diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5153d7..260ff3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: ${{ github.repository == 'stainless-sdks/parallel-sdk-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: 'ubuntu-latest' if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -26,7 +26,7 @@ jobs: - name: Set up Node uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: '20' + node-version: '24' - name: Bootstrap run: ./scripts/bootstrap @@ -37,7 +37,7 @@ jobs: build: timeout-minutes: 5 name: build - runs-on: ${{ github.repository == 'stainless-sdks/parallel-sdk-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: 'ubuntu-latest' if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') permissions: contents: read @@ -48,7 +48,7 @@ jobs: - name: Set up Node uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: '20' + node-version: '24' - name: Bootstrap run: ./scripts/bootstrap @@ -58,7 +58,7 @@ jobs: - name: Get GitHub OIDC Token if: |- - github.repository == 'stainless-sdks/parallel-sdk-typescript' && + github.repository == 'parallel-web/parallel-sdk-typescript-staging' && !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 @@ -67,7 +67,7 @@ jobs: - name: Upload tarball if: |- - github.repository == 'stainless-sdks/parallel-sdk-typescript' && + github.repository == 'parallel-web/parallel-sdk-typescript-staging' && !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s @@ -77,7 +77,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ${{ github.repository == 'stainless-sdks/parallel-sdk-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: 'ubuntu-latest' if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -85,7 +85,7 @@ jobs: - name: Set up Node uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: - node-version: '20' + node-version: '24' - name: Bootstrap run: ./scripts/bootstrap diff --git a/.github/workflows/detect-breaking-changes.yml b/.github/workflows/detect-breaking-changes.yml index 733ec0f..0d2652f 100644 --- a/.github/workflows/detect-breaking-changes.yml +++ b/.github/workflows/detect-breaking-changes.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Node uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1 with: - node-version: '20' + node-version: '24' - name: Install dependencies run: | yarn install diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index a30e70f..4d91615 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -22,7 +22,7 @@ jobs: - name: Set up Node uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1 with: - node-version: '20' + node-version: '24' - name: Install dependencies run: | diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5fdd883..c3f1463 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.1.0" + ".": "1.2.0" } diff --git a/.stats.yml b/.stats.yml index 4b2af5b..00c360c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 30 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/parallel-web/parallel-sdk-3001a018c926803bb713f19d99c3d5d39ed44ce3fe670bebefc326fd252b8821.yml -openapi_spec_hash: 0883a98aa5b566818f5910d01c831c4a -config_hash: 8572a2d7a5ede9ade3be8ad4d8aafd7d +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/parallel-web/parallel-sdk-e72f6dcf18ffc713480444feef670bbbe754221e0a68336823642b474c20ec93.yml +openapi_spec_hash: ae8c3c62a78f2413f52c240c2a5d68a8 +config_hash: d4f69197dba970d05757624fe3f7b373 diff --git a/CHANGELOG.md b/CHANGELOG.md index d509d98..a8d3c85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## 1.2.0 (2026-08-10) + +Full Changelog: [v1.1.0...v1.2.0](https://github.com/parallel-web/parallel-sdk-typescript/compare/v1.1.0...v1.2.0) + +### Features + +* **api:** add memory support ([f1b25e8](https://github.com/parallel-web/parallel-sdk-typescript/commit/f1b25e80452f3b7783954c8458ef722afaf30138)) +* **api:** manual updates ([cb62cb9](https://github.com/parallel-web/parallel-sdk-typescript/commit/cb62cb9593fdefeb891593118177bedbadabf3c9)) +* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([992a6cb](https://github.com/parallel-web/parallel-sdk-typescript/commit/992a6cb9135579ee933cc823ab17f53701827ad2)) + + +### Bug Fixes + +* **ci:** bump @arethetypeswrong/cli to ^0.18.0 and run CI workflows on Node 24 ([d0d5961](https://github.com/parallel-web/parallel-sdk-typescript/commit/d0d596109348af8a07a761b7901c65d652bbec6a)) +* **client:** send content-type header for requests with an omitted optional body ([c6fe4a8](https://github.com/parallel-web/parallel-sdk-typescript/commit/c6fe4a83c994e6e669223ef4343462c614a32541)) +* **stlc:** stop hand-edited CI workflows from blocking seals and builds ([9758e4f](https://github.com/parallel-web/parallel-sdk-typescript/commit/9758e4f90e34d7e4de7144091e992235d674ba66)) + + +### Chores + +* **internal:** codegen related update ([7688dc2](https://github.com/parallel-web/parallel-sdk-typescript/commit/7688dc22e69e4ae68652997e359f239f556ba23c)) +* **internal:** codegen related update ([4d4d2ac](https://github.com/parallel-web/parallel-sdk-typescript/commit/4d4d2aca26c360cb5af102eb6afa010c1700f32d)) + ## 1.1.0 (2026-06-08) Full Changelog: [v1.0.1...v1.1.0](https://github.com/parallel-web/parallel-sdk-typescript/compare/v1.0.1...v1.1.0) diff --git a/package.json b/package.json index 1a1e419..fb3b228 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "parallel-web", - "version": "1.1.0", + "version": "1.2.0", "description": "The official TypeScript library for the Parallel API", "author": "Parallel ", "types": "dist/index.d.ts", @@ -28,7 +28,7 @@ }, "dependencies": {}, "devDependencies": { - "@arethetypeswrong/cli": "^0.17.0", + "@arethetypeswrong/cli": "^0.18.0", "@swc/core": "^1.3.102", "@swc/jest": "^0.2.29", "@types/jest": "^29.4.0", diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index fd3bcc9..d099b06 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -13,6 +13,7 @@ TEST_PATHS=( tests/api-resources/monitor.test.ts tests/api-resources/beta/beta.test.ts tests/api-resources/beta/findall.test.ts + tests/api-resources/beta/memory.test.ts tests/index.test.ts ) diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index c6bb07f..ee42cc2 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -20,7 +20,7 @@ UPLOAD_RESPONSE=$(curl -v -X PUT \ if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" - echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/parallel-sdk-typescript/$SHA'\033[0m" + echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/parallel-sdk-typescript-staging/$SHA'\033[0m" else echo -e "\033[31mFailed to upload artifact.\033[0m" exit 1 diff --git a/src/client.ts b/src/client.ts index b216d9a..feaa40e 100644 --- a/src/client.ts +++ b/src/client.ts @@ -782,11 +782,19 @@ export class Parallel { return () => controller.abort(); } - private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): { + private buildBody({ options }: { options: FinalRequestOptions }): { bodyHeaders: HeadersLike; body: BodyInit | undefined; } { + const { body, headers: rawHeaders } = options; if (!body) { + // A resource method always passes a `body` key when its operation defines a + // request body, even if the caller omitted an optional body param. Keep the + // content-type for those, and only elide it for operations with no body at + // all (e.g. GET/DELETE). + if (body == null && 'body' in options) { + return this.#encoder({ body, headers: buildHeaders([rawHeaders]) }); + } return { bodyHeaders: undefined, body: undefined }; } const headers = buildHeaders([rawHeaders]); diff --git a/src/resources/beta/api.md b/src/resources/beta/api.md index 012216f..b3e9fb0 100644 --- a/src/resources/beta/api.md +++ b/src/resources/beta/api.md @@ -35,3 +35,22 @@ Methods: - client.beta.findall.ingest({ ...params }) -> FindAllSchema - client.beta.findall.result(findallID, { ...params }) -> FindAllRunResult - client.beta.findall.schema(findallID, { ...params }) -> FindAllSchema + +## Memory + +Types: + +- FindAllMemoryResult +- MemoryClearRequest +- MemoryEvictRequest +- MemoryRetrieveRequest +- MemoryRetrieveResponse +- MonitorMemoryEvent +- MonitorMemoryResult +- TaskMemoryResult + +Methods: + +- client.beta.memory.retrieve({ ...params }) -> MemoryRetrieveResponse +- client.beta.memory.clear({ ...params }) -> void +- client.beta.memory.evict({ ...params }) -> void diff --git a/src/resources/beta/beta.ts b/src/resources/beta/beta.ts index 75c86d8..fa9ec5c 100644 --- a/src/resources/beta/beta.ts +++ b/src/resources/beta/beta.ts @@ -33,12 +33,29 @@ import { MatchCondition, ParallelBeta, } from './findall'; +import * as MemoryAPI from './memory'; +import { + FindAllMemoryResult, + Memory, + MemoryClearParams, + MemoryClearRequest, + MemoryEvictParams, + MemoryEvictRequest, + MemoryRetrieveParams, + MemoryRetrieveRequest, + MemoryRetrieveResponse, + MonitorMemoryEvent, + MonitorMemoryResult, + TaskMemoryResult, +} from './memory'; export class Beta extends APIResource { findall: FindAllAPI.FindAll = new FindAllAPI.FindAll(this._client); + memory: MemoryAPI.Memory = new MemoryAPI.Memory(this._client); } Beta.FindAll = FindAll; +Beta.Memory = Memory; export declare namespace Beta { export { @@ -72,4 +89,19 @@ export declare namespace Beta { type FindAllResultParams as FindAllResultParams, type FindAllSchemaParams as FindAllSchemaParams, }; + + export { + Memory as Memory, + type FindAllMemoryResult as FindAllMemoryResult, + type MemoryClearRequest as MemoryClearRequest, + type MemoryEvictRequest as MemoryEvictRequest, + type MemoryRetrieveRequest as MemoryRetrieveRequest, + type MemoryRetrieveResponse as MemoryRetrieveResponse, + type MonitorMemoryEvent as MonitorMemoryEvent, + type MonitorMemoryResult as MonitorMemoryResult, + type TaskMemoryResult as TaskMemoryResult, + type MemoryRetrieveParams as MemoryRetrieveParams, + type MemoryClearParams as MemoryClearParams, + type MemoryEvictParams as MemoryEvictParams, + }; } diff --git a/src/resources/beta/findall.ts b/src/resources/beta/findall.ts index 3a6fd93..d5aab7f 100644 --- a/src/resources/beta/findall.ts +++ b/src/resources/beta/findall.ts @@ -546,10 +546,17 @@ export interface FindAllRunInput { objective: string; /** - * List of entity names/IDs to exclude from results. + * List of entity names/IDs to exclude from results. At most 10,000 entries are + * allowed. */ exclude_list?: Array | null; + /** + * User-provided key identifying the memory scope to use. Omit to use personal + * memory, if available. + */ + memory_scope_key?: string | null; + /** * Metadata for the FindAll run. */ @@ -797,10 +804,17 @@ export interface FindAllCreateParams { objective: string; /** - * Body param: List of entity names/IDs to exclude from results. + * Body param: List of entity names/IDs to exclude from results. At most 10,000 + * entries are allowed. */ exclude_list?: Array | null; + /** + * Body param: User-provided key identifying the memory scope to use. Omit to use + * personal memory, if available. + */ + memory_scope_key?: string | null; + /** * Body param: Metadata for the FindAll run. */ diff --git a/src/resources/beta/index.ts b/src/resources/beta/index.ts index 80557b6..cf48a46 100644 --- a/src/resources/beta/index.ts +++ b/src/resources/beta/index.ts @@ -32,3 +32,17 @@ export { type FindAllResultParams, type FindAllSchemaParams, } from './findall'; +export { + Memory, + type FindAllMemoryResult, + type MemoryClearRequest, + type MemoryEvictRequest, + type MemoryRetrieveRequest, + type MemoryRetrieveResponse, + type MonitorMemoryEvent, + type MonitorMemoryResult, + type TaskMemoryResult, + type MemoryRetrieveParams, + type MemoryClearParams, + type MemoryEvictParams, +} from './memory'; diff --git a/src/resources/beta/memory.ts b/src/resources/beta/memory.ts new file mode 100644 index 0000000..2d60a5d --- /dev/null +++ b/src/resources/beta/memory.ts @@ -0,0 +1,301 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../core/resource'; +import { APIPromise } from '../../core/api-promise'; +import { buildHeaders } from '../../internal/headers'; +import { RequestOptions } from '../../internal/request-options'; + +/** + * The Memory API retrieves and manages memories created by Tasks, Monitors, and FindAll runs. Memories can be personal or isolated with a `memory_scope_key`. + */ +export class Memory extends APIResource { + /** + * Retrieves relevant or recent runs from the selected memory. Provide a query to + * rank results by relevance; leave it empty to return the most recent runs. + * + * @example + * ```ts + * const memoryRetrieveResponse = + * await client.beta.memory.retrieve(); + * ``` + */ + retrieve(body: MemoryRetrieveParams, options?: RequestOptions): APIPromise { + return this._client.post('/v1beta/memory/retrieve', { + body, + ...options, + headers: buildHeaders([{ 'parallel-beta': 'search-extract-2025-10-10' }, options?.headers]), + }); + } + + /** + * Clears all entries from the selected memory without deleting the underlying + * tasks, monitors, or FindAll runs. + * + * @example + * ```ts + * await client.beta.memory.clear(); + * ``` + */ + clear(body: MemoryClearParams, options?: RequestOptions): APIPromise { + return this._client.post('/v1beta/memory/clear', { + body, + ...options, + headers: buildHeaders([ + { 'parallel-beta': 'search-extract-2025-10-10', Accept: '*/*' }, + options?.headers, + ]), + }); + } + + /** + * Removes a task run, monitor, or FindAll run from the selected memory without + * deleting the original resource. + * + * @example + * ```ts + * await client.beta.memory.evict({ id: 'id', kind: 'task' }); + * ``` + */ + evict(body: MemoryEvictParams, options?: RequestOptions): APIPromise { + return this._client.post('/v1beta/memory/evict', { + body, + ...options, + headers: buildHeaders([ + { 'parallel-beta': 'search-extract-2025-10-10', Accept: '*/*' }, + options?.headers, + ]), + }); + } +} + +export interface FindAllMemoryResult { + /** + * ID of the FindAll run. + */ + id: string; + + /** + * Preview of the run's objective. May be truncated. + */ + input_excerpt: string; + + /** + * Current number of matched entities. + */ + matched_count: number; + + /** + * When the FindAll result was last updated, as an RFC 3339 timestamp. + */ + updated_at: string; + + kind?: 'findall'; +} + +export interface MemoryClearRequest { + /** + * User-provided key identifying the memory scope to use. Omit to use personal + * memory, if available. + */ + memory_scope_key?: string | null; +} + +export interface MemoryEvictRequest { + /** + * ID of the task run, monitor, or FindAll run to evict. + */ + id: string; + + /** + * Kind of source to evict: `task`, `monitor`, or `findall`. + */ + kind: 'task' | 'monitor' | 'findall'; + + /** + * User-provided key identifying the memory scope to use. Omit to use personal + * memory, if available. + */ + memory_scope_key?: string | null; +} + +export interface MemoryRetrieveRequest { + /** + * Filter memories by kind: `task`, `monitor`, or `findall`. + */ + kind?: 'task' | 'monitor' | 'findall' | null; + + /** + * Maximum number of memories to return. + */ + limit?: number; + + /** + * User-provided key identifying the memory scope to use. Omit to use personal + * memory, if available. + */ + memory_scope_key?: string | null; + + /** + * Concise query describing the memories to retrieve. Empty queries return the most + * recent memories. + */ + query?: string | null; + + /** + * Only return memories sourced from task, monitor, or FindAll runs completed at or + * after this RFC 3339 timestamp. + */ + since?: string | null; +} + +export interface MemoryRetrieveResponse { + results: Array; +} + +export interface MonitorMemoryEvent { + /** + * When the event was detected, as an RFC 3339 timestamp. + */ + detected_at: string; + + /** + * ID of the execution that produced this event. + */ + event_group_id: string; + + /** + * ID of the monitor event. + */ + event_id: string; + + /** + * Excerpt of the monitor event. May be truncated. + */ + excerpt: string; +} + +export interface MonitorMemoryResult { + /** + * ID of the monitor. + */ + id: string; + + /** + * Preview of the monitor's query. May be truncated. + */ + input_excerpt: string; + + /** + * Current status of the monitor. + */ + status: 'active' | 'cancelled'; + + /** + * When the monitor last ran, as an RFC 3339 timestamp. + */ + updated_at: string; + + kind?: 'monitor'; + + /** + * Detected events matching the retrieval query, ordered by relevance with more + * recent events favored. For an empty query, events are ordered by recency. + */ + matched_events?: Array; +} + +export interface TaskMemoryResult { + /** + * ID of the task run. + */ + id: string; + + /** + * Preview of the run's input. May be truncated. + */ + input_excerpt: string; + + /** + * Preview of the run's output. May be truncated. + */ + output_excerpt: string; + + /** + * When the run completed, as an RFC 3339 timestamp. + */ + updated_at: string; + + kind?: 'task'; +} + +export interface MemoryRetrieveParams { + /** + * Filter memories by kind: `task`, `monitor`, or `findall`. + */ + kind?: 'task' | 'monitor' | 'findall' | null; + + /** + * Maximum number of memories to return. + */ + limit?: number; + + /** + * User-provided key identifying the memory scope to use. Omit to use personal + * memory, if available. + */ + memory_scope_key?: string | null; + + /** + * Concise query describing the memories to retrieve. Empty queries return the most + * recent memories. + */ + query?: string | null; + + /** + * Only return memories sourced from task, monitor, or FindAll runs completed at or + * after this RFC 3339 timestamp. + */ + since?: string | null; +} + +export interface MemoryClearParams { + /** + * User-provided key identifying the memory scope to use. Omit to use personal + * memory, if available. + */ + memory_scope_key?: string | null; +} + +export interface MemoryEvictParams { + /** + * ID of the task run, monitor, or FindAll run to evict. + */ + id: string; + + /** + * Kind of source to evict: `task`, `monitor`, or `findall`. + */ + kind: 'task' | 'monitor' | 'findall'; + + /** + * User-provided key identifying the memory scope to use. Omit to use personal + * memory, if available. + */ + memory_scope_key?: string | null; +} + +export declare namespace Memory { + export { + type FindAllMemoryResult as FindAllMemoryResult, + type MemoryClearRequest as MemoryClearRequest, + type MemoryEvictRequest as MemoryEvictRequest, + type MemoryRetrieveRequest as MemoryRetrieveRequest, + type MemoryRetrieveResponse as MemoryRetrieveResponse, + type MonitorMemoryEvent as MonitorMemoryEvent, + type MonitorMemoryResult as MonitorMemoryResult, + type TaskMemoryResult as TaskMemoryResult, + type MemoryRetrieveParams as MemoryRetrieveParams, + type MemoryClearParams as MemoryClearParams, + type MemoryEvictParams as MemoryEvictParams, + }; +} diff --git a/src/resources/monitor.ts b/src/resources/monitor.ts index 03b8ebb..e88e9ac 100644 --- a/src/resources/monitor.ts +++ b/src/resources/monitor.ts @@ -198,6 +198,12 @@ export interface CreateMonitorRequest { */ type: 'event_stream' | 'snapshot'; + /** + * User-provided key identifying the memory scope to use. Omit to use personal + * memory, if available. + */ + memory_scope_key?: string | null; + /** * User-provided metadata stored with the monitor and echoed back in webhook * notifications and GET responses, so you can map events to objects in your @@ -636,6 +642,12 @@ export interface MonitorCreateParams { */ type: 'event_stream' | 'snapshot'; + /** + * User-provided key identifying the memory scope to use. Omit to use personal + * memory, if available. + */ + memory_scope_key?: string | null; + /** * User-provided metadata stored with the monitor and echoed back in webhook * notifications and GET responses, so you can map events to objects in your diff --git a/src/resources/task-run.ts b/src/resources/task-run.ts index e6a8768..e280afb 100644 --- a/src/resources/task-run.ts +++ b/src/resources/task-run.ts @@ -309,6 +309,12 @@ export interface RunInput { */ mcp_servers?: Array | null; + /** + * User-provided key identifying the memory scope to use. Omit to use personal + * memory, if available. + */ + memory_scope_key?: string | null; + /** * User-provided metadata stored with the run. Keys and values must be strings with * a maximum length of 16 and 512 characters respectively. @@ -695,6 +701,12 @@ export interface TaskRunCreateParams { */ mcp_servers?: Array | null; + /** + * Body param: User-provided key identifying the memory scope to use. Omit to use + * personal memory, if available. + */ + memory_scope_key?: string | null; + /** * Body param: User-provided metadata stored with the run. Keys and values must be * strings with a maximum length of 16 and 512 characters respectively. diff --git a/src/version.ts b/src/version.ts index c80f975..54c8a47 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '1.1.0'; // x-release-please-version +export const VERSION = '1.2.0'; // x-release-please-version diff --git a/tests/api-resources/beta/findall.test.ts b/tests/api-resources/beta/findall.test.ts index c7f466c..1296dc9 100644 --- a/tests/api-resources/beta/findall.test.ts +++ b/tests/api-resources/beta/findall.test.ts @@ -45,6 +45,7 @@ describe('resource findall', () => { match_limit: 0, objective: 'objective', exclude_list: [{ name: 'name', url: 'url' }], + memory_scope_key: 'memory_scope_key', metadata: { foo: 'string' }, webhook: { url: 'url', event_types: ['task_run.status'] }, betas: ['mcp-server-2025-07-17'], diff --git a/tests/api-resources/beta/memory.test.ts b/tests/api-resources/beta/memory.test.ts new file mode 100644 index 0000000..2cb3aea --- /dev/null +++ b/tests/api-resources/beta/memory.test.ts @@ -0,0 +1,51 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Parallel from 'parallel-web'; + +const client = new Parallel({ + apiKey: 'My API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource memory', () => { + test('retrieve', async () => { + const responsePromise = client.beta.memory.retrieve({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('clear', async () => { + const responsePromise = client.beta.memory.clear({}); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('evict: only required params', async () => { + const responsePromise = client.beta.memory.evict({ id: 'id', kind: 'task' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('evict: required and optional params', async () => { + const response = await client.beta.memory.evict({ + id: 'id', + kind: 'task', + memory_scope_key: 'memory_scope_key', + }); + }); +}); diff --git a/tests/api-resources/monitor.test.ts b/tests/api-resources/monitor.test.ts index 2bcd474..c5649c5 100644 --- a/tests/api-resources/monitor.test.ts +++ b/tests/api-resources/monitor.test.ts @@ -48,6 +48,7 @@ describe('resource monitor', () => { }, }, type: 'event_stream', + memory_scope_key: 'memory_scope_key', metadata: { slack_thread_id: '1234567890.123456', user_id: 'U123ABC' }, processor: 'lite', webhook: { url: 'https://example.com/webhook', event_types: ['monitor.event.detected'] }, diff --git a/tests/api-resources/task-group.test.ts b/tests/api-resources/task-group.test.ts index a46d7fc..cd16b4a 100644 --- a/tests/api-resources/task-group.test.ts +++ b/tests/api-resources/task-group.test.ts @@ -60,6 +60,7 @@ describe('resource taskGroup', () => { type: 'url', }, ], + memory_scope_key: 'memory_scope_key', metadata: { foo: 'string' }, previous_interaction_id: 'previous_interaction_id', source_policy: { diff --git a/tests/api-resources/task-run.test.ts b/tests/api-resources/task-run.test.ts index c6c1ae3..15d6fab 100644 --- a/tests/api-resources/task-run.test.ts +++ b/tests/api-resources/task-run.test.ts @@ -37,6 +37,7 @@ describe('resource taskRun', () => { type: 'url', }, ], + memory_scope_key: 'memory_scope_key', metadata: { foo: 'string' }, previous_interaction_id: 'previous_interaction_id', source_policy: { diff --git a/yarn.lock b/yarn.lock index 06fc108..f16b683 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,12 +12,12 @@ resolved "https://registry.yarnpkg.com/@andrewbranch/untar.js/-/untar.js-1.0.3.tgz#ba9494f85eb83017c5c855763969caf1d0adea00" integrity sha512-Jh15/qVmrLGhkKJBdXlK1+9tY4lZruYjsgkDFj08ZmDiWVBLJcqkok7Z0/R0In+i1rScBpJlSvrTS2Lm41Pbnw== -"@arethetypeswrong/cli@^0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@arethetypeswrong/cli/-/cli-0.17.0.tgz#f97f10926b3f9f9eb5117550242d2e06c25cadac" - integrity sha512-xSMW7bfzVWpYw5JFgZqBXqr6PdR0/REmn3DkxCES5N0JTcB0CVgbIynJCvKBFmXaPc3hzmmTrb7+yPDRoOSZdA== +"@arethetypeswrong/cli@^0.18.0": + version "0.18.4" + resolved "https://registry.yarnpkg.com/@arethetypeswrong/cli/-/cli-0.18.4.tgz#c31f54f3b0d0e0f3256ab3edb6530beeb5e64b4b" + integrity sha512-kNWo6LTzGAuLYPpJ7Sgo63whSUeeSuKMlYx6IBgzs4ONEG807gW4hSSENvpeCHzO2H2wIzG5EFl0OKBbqGBAyA== dependencies: - "@arethetypeswrong/core" "0.17.0" + "@arethetypeswrong/core" "0.18.4" chalk "^4.1.2" cli-table3 "^0.6.3" commander "^10.0.1" @@ -25,15 +25,16 @@ marked-terminal "^7.1.0" semver "^7.5.4" -"@arethetypeswrong/core@0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@arethetypeswrong/core/-/core-0.17.0.tgz#abb3b5f425056d37193644c2a2de4aecf866b76b" - integrity sha512-FHyhFizXNetigTVsIhqXKGYLpazPS5YNojEPpZEUcBPt9wVvoEbNIvG+hybuBR+pjlRcbyuqhukHZm1fr+bDgA== +"@arethetypeswrong/core@0.18.4": + version "0.18.4" + resolved "https://registry.yarnpkg.com/@arethetypeswrong/core/-/core-0.18.4.tgz#24edea3d651dea7d32bf6f1cc9ee9a00db39de49" + integrity sha512-M5F0ePyN6h2Z6XxRiyIPqjGbltotXLjR0CKA0uKspsDu0QmgTNYvRb4RSQPMUs2ZXZHCCYpbaZbFbYOXLxCjUA== dependencies: "@andrewbranch/untar.js" "^1.0.3" + "@loaderkit/resolve" "^1.0.2" cjs-module-lexer "^1.2.3" - fflate "^0.8.2" - lru-cache "^10.4.3" + fflate "^0.8.3" + lru-cache "^11.0.1" semver "^7.5.4" typescript "5.6.1-rc" validate-npm-package-name "^5.0.0" @@ -306,6 +307,11 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@braidai/lang@^1.0.0": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@braidai/lang/-/lang-1.1.2.tgz#65bc2bc1db6d00e153b95ac7006f4573e289e9be" + integrity sha512-qBcknbBufNHlui137Hft8xauQMTZDKdophmLFv05r2eNmdIv/MlPuP4TdUknHG68UdWLgVZwgxVe735HzJNIwA== + "@colors/colors@1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" @@ -688,6 +694,13 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@loaderkit/resolve@^1.0.2": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@loaderkit/resolve/-/resolve-1.0.6.tgz#8d45341e688faecc25b3ae919c0f45d94c4e26c9" + integrity sha512-G8FdIoF5CypfwmD9rl8BXod5HDn8JqB0CCNBXDTaRZ+yRYhARrrSToX1zg1zy9jX3zLqigsELwhT4gNtkdQAUg== + dependencies: + "@braidai/lang" "^1.0.0" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -1215,9 +1228,9 @@ baseline-browser-mapping@^2.9.0: integrity sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg== brace-expansion@^2.0.2: - version "2.1.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.1.tgz#c68b1c4111c76aae3a6fba55d496cee10c39dad8" - integrity sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA== + version "2.1.4" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.4.tgz#589dab11c0018d0366be64cd8bf12c8dbecc8326" + integrity sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg== dependencies: balanced-match "^1.0.0" @@ -1696,10 +1709,10 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -fflate@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.8.2.tgz#fc8631f5347812ad6028bbe4a2308b2792aa1dea" - integrity sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A== +fflate@^0.8.3: + version "0.8.3" + resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.8.3.tgz#bc27d8eb30343d4d512abb03480202ce65d825fc" + integrity sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA== file-entry-cache@^8.0.0: version "8.0.0" @@ -2490,10 +2503,10 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lru-cache@^10.4.3: - version "10.4.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" - integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== +lru-cache@^11.0.1: + version "11.5.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.5.2.tgz#00e16665c90c620fba14a3c368732a976493f760" + integrity sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g== lru-cache@^5.1.1: version "5.1.1"