-
Notifications
You must be signed in to change notification settings - Fork 5
DX-2548: add configurable box sizes (small, medium, large) #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e39f7b3
feat: add configurable box sizes (small, medium, large)
CahidArda 8d3d907
feat: add Box.delete() and Box.deleteAll() static methods
CahidArda 633234d
feat: add type-safe agentOptions for run and stream
CahidArda f982d5c
feat: add box.skills namespace for platform skills API
CahidArda 15ee04e
feat: add multi-modal prompt files for run and stream
CahidArda b82ab80
feat: add size option to EphemeralBox creation
CahidArda 4a3483e
chore: run deleteAll integration test separately before other tests
CahidArda ca7f324
fix: rm ping
CahidArda c0d4dfc
feat: add sample TXT file and tests for uploading in run and stream
CahidArda 1ca635d
fix: set correct MIME type on multipart file uploads
CahidArda 0a12054
refactor: remove deleteAll method and rename agentOptions to options
CahidArda c63842e
refactor: convert CodexAgentOptions properties to camelCase
CahidArda 8a46624
feat: add tests for multipart FormData with webhook fields and update…
CahidArda 1e599bf
test: update webhook handling in box.agent.run tests to include headers
CahidArda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@upstash/box": patch | ||
| --- | ||
|
|
||
| Add type-safe options to RunOptions and StreamOptions for passing SDK-specific options to Claude Code, Codex, and OpenCode agents |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@upstash/box": patch | ||
| --- | ||
|
|
||
| Add configurable box sizes (small, medium, large) to Box.create() and Box.fromSnapshot() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@upstash/box": patch | ||
| --- | ||
|
|
||
| Add Box.delete() static method for bulk box deletion |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@upstash/box": patch | ||
| --- | ||
|
|
||
| Add multi-modal prompt files support for run and stream (file paths as multipart, base64 as JSON) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@upstash/box": patch | ||
| --- | ||
|
|
||
| Add box.skills namespace for managing platform skills (add, remove, list) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"; | ||
| import { Box, BoxError } from "../client.js"; | ||
| import { mockResponse, TEST_CONFIG } from "./helpers.js"; | ||
|
|
||
| describe("Box.delete (static)", () => { | ||
| beforeEach(() => { | ||
| vi.stubGlobal("fetch", vi.fn()); | ||
| delete process.env.UPSTASH_BOX_API_KEY; | ||
| }); | ||
| afterEach(() => vi.restoreAllMocks()); | ||
|
|
||
| it("deletes a single box by ID", async () => { | ||
| vi.mocked(fetch).mockResolvedValueOnce(mockResponse({})); | ||
|
|
||
| await Box.delete({ apiKey: TEST_CONFIG.apiKey, baseUrl: TEST_CONFIG.baseUrl, boxIds: "box-1" }); | ||
|
|
||
| const [url, init] = vi.mocked(fetch).mock.calls[0]!; | ||
| expect(url).toBe(`${TEST_CONFIG.baseUrl}/v2/box`); | ||
| expect(init?.method).toBe("DELETE"); | ||
| const body = JSON.parse(init?.body as string); | ||
| expect(body.ids).toEqual(["box-1"]); | ||
| }); | ||
|
|
||
| it("deletes multiple boxes by ID", async () => { | ||
| vi.mocked(fetch).mockResolvedValueOnce(mockResponse({})); | ||
|
|
||
| await Box.delete({ | ||
| apiKey: TEST_CONFIG.apiKey, | ||
| baseUrl: TEST_CONFIG.baseUrl, | ||
| boxIds: ["box-1", "box-2", "box-3"], | ||
| }); | ||
|
|
||
| const body = JSON.parse(vi.mocked(fetch).mock.calls[0]![1]?.body as string); | ||
| expect(body.ids).toEqual(["box-1", "box-2", "box-3"]); | ||
| }); | ||
|
|
||
| it("throws when apiKey is missing", async () => { | ||
| await expect(Box.delete({ boxIds: "box-1" })).rejects.toThrow("apiKey is required"); | ||
| }); | ||
|
|
||
| it("uses env var for apiKey", async () => { | ||
| process.env.UPSTASH_BOX_API_KEY = "env-key"; | ||
| vi.mocked(fetch).mockResolvedValueOnce(mockResponse({})); | ||
|
|
||
| await Box.delete({ boxIds: "box-1" }); | ||
|
|
||
| const [, init] = vi.mocked(fetch).mock.calls[0]!; | ||
| expect((init?.headers as Record<string, string>)["X-Box-Api-Key"]).toBe("env-key"); | ||
| }); | ||
|
|
||
| it("throws on API error", async () => { | ||
| vi.mocked(fetch).mockResolvedValueOnce(mockResponse({ error: "not found" }, 404)); | ||
|
|
||
| await expect( | ||
| Box.delete({ apiKey: TEST_CONFIG.apiKey, baseUrl: TEST_CONFIG.baseUrl, boxIds: "bad-id" }), | ||
| ).rejects.toThrow("not found"); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.