From afac8b102fdc159e83043b1f9de9be4ff05426fd Mon Sep 17 00:00:00 2001 From: factory-ain3sh Date: Fri, 13 Nov 2026 00:54:55 +0000 Subject: [PATCH 1/2] docs: update examples for SDK 0.11.0 Add the workstream and REST API examples that ship in the 0.11.0 package, document the removed Software Factory resource and held cron sessions, and list the new workstreams, environments and elicitation APIs. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- MIGRATION.md | 49 +++++ README.md | 4 +- docs/typescript-sdk-reference.md | 35 +++- examples/node/rest-api.ts | 55 ++++++ examples/node/start-workstream.ts | 76 ++++++++ package-lock.json | 312 +++++++++++++++++++++++++----- package.json | 4 +- scripts/run-examples.mjs | 23 ++- 8 files changed, 496 insertions(+), 62 deletions(-) create mode 100644 examples/node/rest-api.ts create mode 100644 examples/node/start-workstream.ts diff --git a/MIGRATION.md b/MIGRATION.md index 730ea6d..a60b0f6 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,5 +1,54 @@ # Migration Guide +## Migrating from 0.10.0 to 0.11.0 + +### 1. Upgrade the package + +```bash +npm install @factory/droid-sdk@^0.11.0 +``` + +Applications that use `run()`, `createSession()`, `resumeSession()`, or +`connectToDaemon()` sessions need no changes. Two unstable daemon resources +lost methods. + +### 2. Remove Software Factory calls + +`droid.unstable.softwareFactory` is gone, with its `workstreams`, `signals`, +`changes`, `activities`, and `events` resources and their types +(`SoftwareFactoryResource`, `SoftwareFactoryWorkstreamsResource`, +`SoftwareFactorySignalsResource`, `SoftwareFactoryChangesResource`, +`SoftwareFactoryActivitiesResource`, `SoftwareFactoryEventsResource`, and +`SoftwareFactoryWorkstreamEntry`). Daemons no longer serve them. + +### 3. Remove held cron sessions + +`droid.unstable.crons.holdSession()` and `resumeSession()` are gone, with the +`CronOperationsResource` type. A loop tick now reaches its session as a steering +message, so there is no held state to set or clear. `list`, `create`, `update`, +and `delete` are unchanged. + +### 4. New in 0.11.0 + +- `droid.unstable.workstreams` starts, lists, and updates workstreams on a + daemon. See + [`examples/node/start-workstream.ts`](./examples/node/start-workstream.ts). +- `@factory/droid-sdk/api` exports a client generated from the public Factory + API spec. See [`examples/node/rest-api.ts`](./examples/node/rest-api.ts). +- The root entry point adds `listEnvironments`, `listRemoteSessionElicitations`, + and `answerRemoteSessionElicitation`. +- `@factory/droid-sdk/node` adds `DroidConnectionEndedError`, + `RequestCancelledError`, and `isDroidConnectionEnded`. + +### 5. Verify the migration + +```bash +npm run typecheck +npm run lint +npm run format:check +npx tsx examples/node/list-sessions.ts +``` + ## Migrating from 0.9.x to 0.10.0 ### 1. Upgrade the package diff --git a/README.md b/README.md index ee455c8..e7fd6e1 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,9 @@ Run Node examples with `npx tsx examples/node/.ts`. To connect a Node application to a running daemon with an API key, run `FACTORY_API_KEY=... npx tsx examples/node/daemon-session.ts`. To start a mission with orchestrator and worker progress, run -`npx tsx examples/node/mission.ts`. +`npx tsx examples/node/mission.ts`. To start a workstream on a running daemon +and leave it running, run +`DROID_DAEMON_URL=... FACTORY_API_KEY=... npx tsx examples/node/start-workstream.ts ""`. For browser examples, start a local daemon and run `npm run serve:browser-example`, then open `http://127.0.0.1:8420/`. The diff --git a/docs/typescript-sdk-reference.md b/docs/typescript-sdk-reference.md index dc51760..19b12c6 100644 --- a/docs/typescript-sdk-reference.md +++ b/docs/typescript-sdk-reference.md @@ -1095,22 +1095,39 @@ different Factory API host. | Resource | Functions | | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | Machine templates | `listMachineTemplates`, `getMachineTemplate` | +| Environments | `listEnvironments` | | Computers | `listComputers`, `getComputer`, `getComputerByName`, `createComputer`, `updateComputer`, `deleteComputer`, `restartComputer`, `refreshComputer` | | Computer operations | `getComputerMetrics`, `retryInstallDeps` | -| Remote sessions | `listRemoteSessions` | +| Remote sessions | `listRemoteSessions`, `listRemoteSessionElicitations`, `answerRemoteSessionElicitation` | + +The `@factory/droid-sdk/api` entry point exports a client generated from the +public Factory API spec, with one function per operation. Each operation takes +`{ client }` from `createFactoryClient()` and resolves `{ data, error }` +instead of throwing. Several names, such as `listComputers`, exist on both +entry points with different contracts, so a file that imports both should +alias the shared names. + +```ts +import { createFactoryClient, listComputers } from '@factory/droid-sdk/api'; + +const client = createFactoryClient({ apiKey: process.env.FACTORY_API_KEY! }); +const { data, error } = await listComputers({ client }); +``` + +See [`examples/node/rest-api.ts`](../examples/node/rest-api.ts). ### Unstable daemon resources APIs under `droid.unstable` may change between SDK releases. -| Namespace | Main methods or resources | -| ----------------- | ------------------------------------------------------------------------- | -| `crons` | `list`, `create`, `update`, `delete`, `holdSession`, `resumeSession` | -| `missions` | `inspectReadiness`, `acknowledgeReadinessWarning` | -| `semanticDiff` | `getCache`, `saveCache`, `generate` | -| `fileTransfers` | `push`, `pull` | -| `proxy` | `getToken` | -| `softwareFactory` | `workstreams`, `signals`, `changes`, `activities`, and `events` resources | +| Namespace | Main methods or resources | +| --------------- | ------------------------------------------------- | +| `crons` | `list`, `create`, `update`, `delete` | +| `missions` | `inspectReadiness`, `acknowledgeReadinessWarning` | +| `workstreams` | `start`, `list`, `updateSettings` | +| `semanticDiff` | `getCache`, `saveCache`, `generate` | +| `fileTransfers` | `push`, `pull` | +| `proxy` | `getToken` | Keep unstable API use behind an application-owned adapter. diff --git a/examples/node/rest-api.ts b/examples/node/rest-api.ts new file mode 100644 index 0000000..8b58119 --- /dev/null +++ b/examples/node/rest-api.ts @@ -0,0 +1,55 @@ +/** + * Factory REST API example. + * + * Lists the Computers and remote sessions an API key can see, using the + * client generated from the public Factory API spec. + * + * These operations take `{ client }` from `createFactoryClient({ apiKey, baseUrl })` + * and resolve `{ data, error }`. The root `@factory/droid-sdk` REST helpers + * take `{ apiKey, baseUrl }` and resolve the response body. Several names + * exist on both with different contracts, so a file that imports both should + * alias the shared names or import this entry under a namespace. A root + * options object cannot be passed here: generated operations require a + * `client` created with `createFactoryClient`. + * + * Usage: + * FACTORY_API_KEY=... npx tsx examples/node/rest-api.ts [baseUrl] + */ + +import { + createFactoryClient, + listComputers, + listSessions, +} from '@factory/droid-sdk/api'; + +const apiKey = process.env.FACTORY_API_KEY; +if (!apiKey) { + throw new Error('Set FACTORY_API_KEY.'); +} + +const client = createFactoryClient({ + apiKey, + baseUrl: process.argv[2], +}); + +const computers = await listComputers({ client }); +if (computers.error !== undefined) { + throw new Error( + `Listing Computers failed: ${JSON.stringify(computers.error)}` + ); +} +console.log(`Computers (${computers.data.computers.length}):`); +for (const computer of computers.data.computers) { + console.log(` ${computer.id} ${computer.name} ${computer.status ?? ''}`); +} + +const sessions = await listSessions({ client, query: { limit: 5 } }); +if (sessions.error !== undefined) { + throw new Error(`Listing sessions failed: ${JSON.stringify(sessions.error)}`); +} +console.log(`Recent sessions (${sessions.data.sessions.length}):`); +for (const session of sessions.data.sessions) { + console.log( + ` ${session.sessionId} ${session.status} ${session.messageCount} messages` + ); +} diff --git a/examples/node/start-workstream.ts b/examples/node/start-workstream.ts new file mode 100644 index 0000000..33d6f53 --- /dev/null +++ b/examples/node/start-workstream.ts @@ -0,0 +1,76 @@ +/** + * Start a workstream on a running daemon and leave it running. + * + * The orchestrator plans the goal and runs agents in the daemon, which keeps + * the workstream going after this script exits. Without an `askUserHandler`, + * any question the orchestrator asks is declined (see ask-user-elicitation.ts). + * An agent's questions and permission prompts are answered only by a client + * that attaches that agent with handlers (`droid.sessions.resume(agentId, ...)`). + * + * Set DROID_DAEMON_URL and FACTORY_API_KEY for an existing daemon whose account + * has access to workstreams. Set WORKSTREAM_COMPUTER_ID to let agents also run + * on that computer instead of only on this daemon's machine. + * Usage: npx tsx examples/node/start-workstream.ts "" [cwd] + */ + +import { + AutonomyLevel, + DroidMessageType, + ReasoningEffort, + WorkstreamMachineTargetKind, + connectToDaemon, +} from '@factory/droid-sdk'; + +const url = process.env.DROID_DAEMON_URL; +const apiKey = process.env.FACTORY_API_KEY; +const computerId = process.env.WORKSTREAM_COMPUTER_ID; +if (!url || !apiKey) { + throw new Error('Set DROID_DAEMON_URL and FACTORY_API_KEY.'); +} + +const [goal, cwd = process.cwd()] = process.argv.slice(2); +if (!goal) { + throw new Error('Pass the workstream goal as the first argument.'); +} + +const droid = await connectToDaemon({ url, auth: { apiKey } }); +try { + // Agents on another machine reach this daemon through its relay. + if (computerId) await droid.relay.start(); + const orchestrator = await droid.unstable.workstreams.start({ + cwd, + title: goal.slice(0, 80), + // Agents inherit the orchestrator's autonomy; below High they stop to ask. + autonomyLevel: AutonomyLevel.High, + agentReasoningEffort: ReasoningEffort.High, + ...(computerId + ? { + machines: [ + { + label: 'remote', + target: { + kind: WorkstreamMachineTargetKind.Computer, + computerId, + }, + }, + ], + defaultMachineLabel: 'remote', + } + : {}), + }); + console.log(`Workstream ${orchestrator.id} started.`); + + for await (const msg of orchestrator.stream(goal)) { + if (msg.type === DroidMessageType.Assistant) { + process.stdout.write(msg.text); + } else if (msg.type === DroidMessageType.Result && !msg.success) { + throw new Error(msg.error?.message ?? `Turn ended: ${msg.subtype}`); + } + } + + // Detach, not close: closing would end the workstream in the daemon. + await orchestrator.detach(); + console.log(`\nWorkstream ${orchestrator.id} keeps running in the daemon.`); +} finally { + droid.disconnect(); +} diff --git a/package-lock.json b/package-lock.json index 71247e7..6934825 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.10.0", "license": "Apache-2.0", "dependencies": { - "@factory/droid-sdk": "0.10.0", + "@factory/droid-sdk": "0.11.0", "zod": "^3.25.0" }, "devDependencies": { @@ -628,18 +628,18 @@ } }, "node_modules/@factory/droid-sdk": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@factory/droid-sdk/-/droid-sdk-0.10.0.tgz", - "integrity": "sha512-C9152p2CHvJV5Mw5EYZ7H+fflfqYXzMtTaC3TQK+AYLqOfzVFyI74npfqG/WWpkeRyDpRFsBjQiuTeSM6att7g==", + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@factory/droid-sdk/-/droid-sdk-0.11.0.tgz", + "integrity": "sha512-SJuyHyNjVpGdammi7EpUScelLHJZgvjky2BJQlfudBruQLH+jcaBpqKymtnCSoVXMdHfFjZaUuNP/zBx8knsoA==", "license": "Apache-2.0", "dependencies": { - "@modelcontextprotocol/sdk": "^1.29.0", + "@modelcontextprotocol/sdk": "^1.32.1", "@opentelemetry/api": "^1.9.0", "eventemitter3": "^5.0.1", "fast-deep-equal": "^3.1.3", "isows": "^1.0.7", "libsodium-wrappers-sumo": "^0.8.4", - "uuid": "^9.0.0", + "uuid": "^11.1.1", "ws": "^8.21.0", "zod": "^3.24.0" }, @@ -648,13 +648,15 @@ } }, "node_modules/@hono/node-server": { - "version": "1.19.14", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.8.tgz", + "integrity": "sha512-jdf7FHh6A1lzjpHHQUgxsg2GeER2vMetnAOfeActzcoli6jamlK+NAwL6Dsr5Fl3BS3tYUQzCdtZjU8Qxv7bEA==", "license": "MIT", "engines": { - "node": ">=18.14.1" + "node": ">=20" }, "peerDependencies": { - "hono": "^4" + "hono": "^4 || ^5.0.0-0" } }, "node_modules/@humanfs/core": { @@ -702,10 +704,12 @@ } }, "node_modules/@modelcontextprotocol/sdk": { - "version": "1.29.0", + "version": "1.32.2", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.32.2.tgz", + "integrity": "sha512-SWsVtH/0vULSQStoZ6xxH2K09Li8fXYTMC64ZeogCdpZ3XSi1eCPOByV1OpuJxuI3OcmHhosDWYyii07tpPsLw==", "license": "MIT", "dependencies": { - "@hono/node-server": "^1.19.9", + "@hono/node-server": "^1.19.9 || ^2.0.5", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "content-type": "^1.0.5", @@ -741,6 +745,8 @@ }, "node_modules/@modelcontextprotocol/sdk/node_modules/ajv": { "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", @@ -755,6 +761,8 @@ }, "node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "license": "MIT" }, "node_modules/@napi-rs/wasm-runtime": { @@ -1337,6 +1345,8 @@ }, "node_modules/accepts": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", "license": "MIT", "dependencies": { "mime-types": "^3.0.0", @@ -1382,6 +1392,8 @@ }, "node_modules/ajv-formats": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", "license": "MIT", "dependencies": { "ajv": "^8.0.0" @@ -1397,6 +1409,8 @@ }, "node_modules/ajv-formats/node_modules/ajv": { "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", @@ -1411,6 +1425,8 @@ }, "node_modules/ajv-formats/node_modules/json-schema-traverse": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "license": "MIT" }, "node_modules/ansi-styles": { @@ -1570,18 +1586,20 @@ "license": "MIT" }, "node_modules/body-parser": { - "version": "2.2.2", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.4.0.tgz", + "integrity": "sha512-Ifk1KcLrxaGt1occQagQNFNNOqRt1LFuehEnHHzB8Z6cRgIxRU1TBaiIsUiCdA+gy5PL7Y1IX31DNKkRmxtXjQ==", "license": "MIT", "dependencies": { "bytes": "^3.1.2", - "content-type": "^1.0.5", + "content-type": "^2.1.0", "debug": "^4.4.3", - "http-errors": "^2.0.0", - "iconv-lite": "^0.7.0", + "http-errors": "^2.0.1", + "iconv-lite": "^0.7.3", "on-finished": "^2.4.1", - "qs": "^6.14.1", - "raw-body": "^3.0.1", - "type-is": "^2.0.1" + "qs": "^6.16.1", + "raw-body": "^3.0.2", + "type-is": "^2.1.0" }, "engines": { "node": ">=18" @@ -1591,6 +1609,19 @@ "url": "https://opencollective.com/express" } }, + "node_modules/body-parser/node_modules/content-type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz", + "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/brace-expansion": { "version": "1.1.12", "dev": true, @@ -1602,6 +1633,8 @@ }, "node_modules/bytes": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -1694,7 +1727,9 @@ "license": "MIT" }, "node_modules/content-disposition": { - "version": "1.1.0", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-2.0.1.tgz", + "integrity": "sha512-e+H0ZXHSWYrENhQzw1LPuP4oF5MzVKmDU6d3hxlvaPEYLLg62MxtQNPRx4SYSuYJSBUgnQIG4HIN2tEtNv7Dog==", "license": "MIT", "engines": { "node": ">=18" @@ -1706,6 +1741,8 @@ }, "node_modules/content-type": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -1713,6 +1750,8 @@ }, "node_modules/cookie": { "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -1720,6 +1759,8 @@ }, "node_modules/cookie-signature": { "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", "license": "MIT", "engines": { "node": ">=6.6.0" @@ -1727,6 +1768,8 @@ }, "node_modules/cors": { "version": "2.8.6", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz", + "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", "license": "MIT", "dependencies": { "object-assign": "^4", @@ -1854,6 +1897,8 @@ }, "node_modules/depd": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -1884,13 +1929,21 @@ }, "node_modules/ee-first": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", "license": "MIT" }, "node_modules/encodeurl": { - "version": "2.0.0", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.3.tgz", + "integrity": "sha512-mIteYONiEfc4xWf2F1WXovh1c8npzS00vNeiUPdwFF+QlVJni+gNvpQltLMQhob8rew/bWWc/bGTuUr0EUGt0w==", "license": "MIT", "engines": { "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/es-abstract": { @@ -2067,6 +2120,8 @@ }, "node_modules/escape-html": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", "license": "MIT" }, "node_modules/escape-string-regexp": { @@ -2380,6 +2435,8 @@ }, "node_modules/etag": { "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -2391,6 +2448,8 @@ }, "node_modules/eventsource": { "version": "3.0.7", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", + "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", "license": "MIT", "dependencies": { "eventsource-parser": "^3.0.1" @@ -2400,20 +2459,24 @@ } }, "node_modules/eventsource-parser": { - "version": "3.0.8", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.1.1.tgz", + "integrity": "sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ==", "license": "MIT", "engines": { "node": ">=18.0.0" } }, "node_modules/express": { - "version": "5.2.1", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/express/-/express-5.3.0.tgz", + "integrity": "sha512-qCqy1xSoaugxOD4IVHb1ZWdkvCF2W3aE2okKouWj8VwJ+ztskSiXoBnCSJqfKT+cVPJhuJqe9YLbY425+Zh00g==", "license": "MIT", "dependencies": { "accepts": "^2.0.0", - "body-parser": "^2.2.1", - "content-disposition": "^1.0.0", - "content-type": "^1.0.5", + "body-parser": "^2.3.0", + "content-disposition": "^2.0.1", + "content-type": "^2.0.0", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", @@ -2429,14 +2492,14 @@ "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", - "proxy-addr": "^2.0.7", - "qs": "^6.14.0", + "proxy-addr": "^2.0.8", + "qs": "^6.16.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", - "type-is": "^2.0.1", + "type-is": "^2.1.0", "vary": "^1.1.2" }, "engines": { @@ -2448,10 +2511,13 @@ } }, "node_modules/express-rate-limit": { - "version": "8.5.0", + "version": "8.7.4", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.7.4.tgz", + "integrity": "sha512-LKBXzX700wz3zAGNNmVnjRI5mEbYkLv7UbMI4+9Xa+JPcg2UZh6AgY/2CZh9RrJjFM5ttC/N1lD+KzyFoZITCw==", "license": "MIT", "dependencies": { - "ip-address": "10.1.0" + "debug": "^4.4.3", + "ip-address": "^10.2.0" }, "engines": { "node": ">= 16" @@ -2463,6 +2529,19 @@ "express": ">= 4.11" } }, + "node_modules/express/node_modules/content-type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz", + "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "license": "MIT" @@ -2478,7 +2557,9 @@ "license": "MIT" }, "node_modules/fast-uri": { - "version": "3.1.2", + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz", + "integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==", "funding": [ { "type": "github", @@ -2520,6 +2601,8 @@ }, "node_modules/finalhandler": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", "license": "MIT", "dependencies": { "debug": "^4.4.0", @@ -2585,6 +2668,8 @@ }, "node_modules/forwarded": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -2592,6 +2677,8 @@ }, "node_modules/fresh": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -2837,7 +2924,9 @@ } }, "node_modules/hono": { - "version": "4.12.17", + "version": "4.13.18", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.18.tgz", + "integrity": "sha512-H9q/E1XizaWstJxUW881dmLxEj+t/TrGGnyxINkm4+sK0qUwsMtFdo2BWI9Vs3cIS19MU6b6iCijoUoEf4f3DA==", "license": "MIT", "engines": { "node": ">=16.9.0" @@ -2845,6 +2934,8 @@ }, "node_modules/http-errors": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", "license": "MIT", "dependencies": { "depd": "~2.0.0", @@ -2862,7 +2953,9 @@ } }, "node_modules/iconv-lite": { - "version": "0.7.2", + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz", + "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==", "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" @@ -2908,6 +3001,8 @@ }, "node_modules/inherits": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, "node_modules/internal-slot": { @@ -2924,7 +3019,9 @@ } }, "node_modules/ip-address": { - "version": "10.1.0", + "version": "10.7.6", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.6.tgz", + "integrity": "sha512-00LYkM6byILa9eQIx6qoaXCM40xTLd56AZ4vyaPW3YTyb49VZYPo5xsiAq4tuQ54GH4R7gVdYScJ1B7B77PuTg==", "license": "MIT", "engines": { "node": ">= 12" @@ -2932,6 +3029,8 @@ }, "node_modules/ipaddr.js": { "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", "license": "MIT", "engines": { "node": ">= 0.10" @@ -3154,6 +3253,8 @@ }, "node_modules/is-promise": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", "license": "MIT" }, "node_modules/is-regex": { @@ -3306,7 +3407,9 @@ } }, "node_modules/jose": { - "version": "6.2.3", + "version": "6.2.17", + "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.17.tgz", + "integrity": "sha512-wOuK9V1yujQFH5S0ZWmLcDZN7+IKh9bUCC2ZPCf2HDlol3WWHy+PPyNjEI75FXRLMp3vDKQcupP59xhVU95hcg==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/panva" @@ -3335,6 +3438,8 @@ }, "node_modules/json-schema-typed": { "version": "8.0.2", + "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz", + "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==", "license": "BSD-2-Clause" }, "node_modules/json-stable-stringify-without-jsonify": { @@ -3415,14 +3520,22 @@ } }, "node_modules/media-typer": { - "version": "1.1.0", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.1.tgz", + "integrity": "sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ==", "license": "MIT", "engines": { "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/merge-descriptors": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", "license": "MIT", "engines": { "node": ">=18" @@ -3433,6 +3546,8 @@ }, "node_modules/mime-db": { "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -3440,6 +3555,8 @@ }, "node_modules/mime-types": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", "license": "MIT", "dependencies": { "mime-db": "^1.54.0" @@ -3495,10 +3612,32 @@ "license": "MIT" }, "node_modules/negotiator": { - "version": "1.0.0", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.1.0.tgz", + "integrity": "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==", "license": "MIT", + "dependencies": { + "content-type": "^2.1.0" + }, "engines": { - "node": ">= 0.6" + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/negotiator/node_modules/content-type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz", + "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/node-exports-info": { @@ -3528,6 +3667,8 @@ }, "node_modules/object-assign": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -3632,17 +3773,25 @@ } }, "node_modules/on-finished": { - "version": "2.4.1", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.2.tgz", + "integrity": "sha512-ATWUv387i+nLD49EiDoOft5scf32Vsdz3ktrQJG9bi7jRFmaXTssvyvj1EmeKVVgvesbqUtvQQvaS2TpTukAZQ==", "license": "MIT", "dependencies": { "ee-first": "1.1.1" }, "engines": { "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/once": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "license": "ISC", "dependencies": { "wrappy": "1" @@ -3721,6 +3870,8 @@ }, "node_modules/parseurl": { "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -3748,6 +3899,8 @@ }, "node_modules/path-to-regexp": { "version": "8.4.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", "license": "MIT", "funding": { "type": "opencollective", @@ -3767,6 +3920,8 @@ }, "node_modules/pkce-challenge": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz", + "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==", "license": "MIT", "engines": { "node": ">=16.20.0" @@ -3803,7 +3958,9 @@ } }, "node_modules/proxy-addr": { - "version": "2.0.7", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.8.tgz", + "integrity": "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==", "license": "MIT", "dependencies": { "forwarded": "0.2.0", @@ -3811,6 +3968,10 @@ }, "engines": { "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/punycode": { @@ -3822,9 +3983,9 @@ } }, "node_modules/qs": { - "version": "6.16.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.2.tgz", - "integrity": "sha512-VYdnB5S7/0IeXzBacUtwNAaM6d7Y/PgYnNC7bJCI6meqA/OgnsQbZMtVW8Dt2D1PHgbHGtYmhSoEIgvt7xZ2ZA==", + "version": "6.17.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.17.1.tgz", + "integrity": "sha512-jd3COkaKVgGUW+ZHyEHCG9bH7RoaaiWuMgzsIBjUMVjLAaWGWpoUAVwljVvBHxRu/2qEHnadLGZrkutYUBPQJA==", "license": "BSD-3-Clause", "dependencies": { "es-define-property": "^1.0.1", @@ -3838,14 +3999,22 @@ } }, "node_modules/range-parser": { - "version": "1.2.1", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz", + "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==", "license": "MIT", "engines": { "node": ">= 0.6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/raw-body": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", "license": "MIT", "dependencies": { "bytes": "~3.1.2", @@ -3899,6 +4068,8 @@ }, "node_modules/require-from-string": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -3944,6 +4115,8 @@ }, "node_modules/router": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", "license": "MIT", "dependencies": { "debug": "^4.4.0", @@ -4007,6 +4180,8 @@ }, "node_modules/safer-buffer": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "license": "MIT" }, "node_modules/semver": { @@ -4022,6 +4197,8 @@ }, "node_modules/send": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", "license": "MIT", "dependencies": { "debug": "^4.4.3", @@ -4046,6 +4223,8 @@ }, "node_modules/serve-static": { "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", "license": "MIT", "dependencies": { "encodeurl": "^2.0.0", @@ -4106,6 +4285,8 @@ }, "node_modules/setprototypeof": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "license": "ISC" }, "node_modules/shebang-command": { @@ -4201,6 +4382,8 @@ }, "node_modules/statuses": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -4329,6 +4512,8 @@ }, "node_modules/toidentifier": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "license": "MIT", "engines": { "node": ">=0.6" @@ -4873,15 +5058,34 @@ } }, "node_modules/type-is": { - "version": "2.0.1", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz", + "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==", "license": "MIT", "dependencies": { - "content-type": "^1.0.5", + "content-type": "^2.0.0", "media-typer": "^1.1.0", "mime-types": "^3.0.0" }, "engines": { - "node": ">= 0.6" + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/type-is/node_modules/content-type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz", + "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/typed-array-buffer": { @@ -5012,6 +5216,8 @@ }, "node_modules/unpipe": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -5059,18 +5265,22 @@ } }, "node_modules/uuid": { - "version": "9.0.1", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.1.tgz", + "integrity": "sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], "license": "MIT", "bin": { - "uuid": "dist/bin/uuid" + "uuid": "dist/esm/bin/uuid" } }, "node_modules/vary": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -5180,6 +5390,8 @@ }, "node_modules/wrappy": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "license": "ISC" }, "node_modules/ws": { @@ -5221,6 +5433,8 @@ }, "node_modules/zod-to-json-schema": { "version": "3.25.2", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.2.tgz", + "integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==", "license": "ISC", "peerDependencies": { "zod": "^3.25.28 || ^4" diff --git a/package.json b/package.json index d2e9db9..fb850ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@factory/droid-sdk-examples", - "version": "0.10.0", + "version": "0.11.0", "private": true, "description": "Guides and runnable examples for the Factory Droid SDK", "license": "Apache-2.0", @@ -25,7 +25,7 @@ "node": ">=20.0.0" }, "dependencies": { - "@factory/droid-sdk": "0.10.0", + "@factory/droid-sdk": "0.11.0", "zod": "^3.25.0" }, "devDependencies": { diff --git a/scripts/run-examples.mjs b/scripts/run-examples.mjs index 541d60a..4c9227d 100644 --- a/scripts/run-examples.mjs +++ b/scripts/run-examples.mjs @@ -22,7 +22,7 @@ * --concurrency Chains to run at the same time (default 4) * --only Run only these examples (and the chain steps they need) * --skip Do not run these examples; reject dependency conflicts - * --include Add opt-in examples (mission) + * --include Add opt-in examples (mission, start-workstream) * --out Directory for logs and the report * --droid Droid executable for the daemon (default: droid on PATH) * --retries Run a failed chain again up to n times, each time in a @@ -334,6 +334,13 @@ export const EXAMPLES = { stdoutMatches(/turns: [1-9]/), ], }, + 'rest-api': { + checks: [ + exitZero(), + stdoutMatches(/^Computers \(\d+\):$/m, 'listed Computers'), + stdoutMatches(/^Recent sessions \(\d+\):$/m, 'listed sessions'), + ], + }, 'resume-session': { args: (state) => [state.savedId ?? 'missing-session-id'], checks: [ @@ -455,6 +462,20 @@ export const EXAMPLES = { })), ], }, + 'start-workstream': { + optIn: true, + daemon: true, + timeoutSec: 600, + args: () => ['Reply with one short sentence. Start no agents.'], + checks: [ + exitZero(), + stdoutMatches( + new RegExp(`^Workstream ${UUID} started\\.$`, 'm'), + 'the workstream started' + ), + stdoutMatches(/keeps running in the daemon\.$/m), + ], + }, }; /** Steps whose output a later step needs. `after` runs after a step passes or fails. */ From 154d2e408880c1f860430d9a6d18066156eedc57 Mon Sep 17 00:00:00 2001 From: factory-ain3sh Date: Fri, 13 Nov 2026 03:31:35 +0000 Subject: [PATCH 2/2] docs: answer the 0.11.0 examples review - start-workstream.ts reads DROID_WORKSTREAM_COMPUTER_ID, so the example harness's DROID_ scrub keeps a developer's Computer out of isolated runs. - The reference says generated REST operations put only HTTP error bodies in `error`; network, abort and parse failures reject, and throwOnError makes HTTP errors reject too. - Drop the reference's Software Factory list methods and its "REST remote-session support provides listing only" limitation, both false for 0.11.0. - rest-api.ts says session listing needs the feature on the key's organization. - The reference's example index, inputs list and unstable resources section name start-workstream.ts and rest-api.ts. - package-lock.json root version fields read 0.11.0. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- docs/typescript-sdk-reference.md | 48 ++++++++++++++++++------------- examples/node/rest-api.ts | 3 +- examples/node/start-workstream.ts | 4 +-- package-lock.json | 4 +-- 4 files changed, 34 insertions(+), 25 deletions(-) diff --git a/docs/typescript-sdk-reference.md b/docs/typescript-sdk-reference.md index 19b12c6..6b60eeb 100644 --- a/docs/typescript-sdk-reference.md +++ b/docs/typescript-sdk-reference.md @@ -936,7 +936,7 @@ The namespaced daemon facade normalizes common collection results: - `sessions.getMessages()` returns the message array directly. - Collection methods such as `customModels.list()`, `terminals.list()`, `mcp.listRegistry()`, `mcp.listTools()`, `commands.list()`, and the plugin, - marketplace, automation, and Software Factory list methods return arrays. + marketplace, and automation list methods return arrays. - Methods whose protocol result includes additional metadata retain the result object. This includes `sessions.search()`, `mcp.listServers()`, and `skills.list()`. @@ -1102,10 +1102,12 @@ different Factory API host. The `@factory/droid-sdk/api` entry point exports a client generated from the public Factory API spec, with one function per operation. Each operation takes -`{ client }` from `createFactoryClient()` and resolves `{ data, error }` -instead of throwing. Several names, such as `listComputers`, exist on both -entry points with different contracts, so a file that imports both should -alias the shared names. +`{ client }` from `createFactoryClient()` and resolves `{ data, error }`, +where `error` holds the body of an HTTP error response. A network failure, an +abort, or a response that cannot be parsed rejects the call instead, and +`throwOnError: true` makes HTTP errors reject too. Several names, such as +`listComputers`, exist on both entry points with different contracts, so a +file that imports both should alias the shared names. ```ts import { createFactoryClient, listComputers } from '@factory/droid-sdk/api'; @@ -1129,6 +1131,9 @@ APIs under `droid.unstable` may change between SDK releases. | `fileTransfers` | `push`, `pull` | | `proxy` | `getToken` | +See [`examples/node/start-workstream.ts`](../examples/node/start-workstream.ts) +for `workstreams.start()`. + Keep unstable API use behind an application-owned adapter. For example, create and manage a scheduled prompt through the unstable cron @@ -1334,7 +1339,6 @@ switch (result.subtype) { - Daemon replacement locking does not coordinate separate clients. - Browser daemon authentication currently requires an API key. - New-session spec handoff IDs require raw notification inspection. -- REST remote-session support currently provides listing only. ## Runnable examples @@ -1342,7 +1346,8 @@ The package includes runnable examples for one-shot runs, streaming, partial events, sessions, resume, model selection, permissions, AskUser, image and document attachments, structured output, SDK and external MCP tools, skills, hooks, observability, spec mode, replacement lifecycle, daemon sessions, -concurrent browser sessions, daemon lifecycle operations, and missions. +concurrent browser sessions, daemon lifecycle operations, missions, +workstreams, and the Factory REST API. All examples are under: @@ -1369,6 +1374,8 @@ Some examples need additional input: - `document-input.ts`: optionally pass a text or PDF path. - `external-mcp.ts`: set `MCP_SERVER_URL` and, if necessary, `MCP_SERVER_TOKEN`. - `daemon-session.ts`: start a daemon first. Set `DROID_DAEMON_URL` for a non-default address. +- `start-workstream.ts`: pass the workstream goal, and set `DROID_DAEMON_URL` for a running daemon whose account has access to workstreams. +- `rest-api.ts`: optionally pass the API base URL. Use compatible SDK and CLI versions. SDK 0.9.1 and earlier can reject newer protocol messages, including model providers and Script permission requests. @@ -1376,19 +1383,20 @@ Use SDK 0.10.0 or later with current CLI releases. A successful result without assistant text does not prove that streaming works. Do not remove permission checks to bypass a protocol mismatch. -| Topic | Node examples | -| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| Runs and results | `run.ts`, `result-metadata.ts` | -| Sessions | `multi-turn-session.ts`, `resume-session.ts`, `list-sessions.ts`, `rename-session.ts`, `init-metadata.ts`, `session-settings.ts` | -| Streaming and cancellation | `session-stream.ts`, `partial-stream.ts`, `abort-session-stream.ts`, `interrupt-session.ts` | -| Models | `model-discovery.ts`, `model-selection.ts` | -| Inputs and outputs | `image-attachment.ts`, `document-input.ts`, `structured-output.ts` | -| Permissions and user input | `permission-handler.ts`, `ask-user-elicitation.ts`, `tool-controls.ts` | -| Extensions | `sdk-mcp-tool.ts`, `external-mcp.ts`, `skills.ts`, `hook-execution.ts` | -| Session lifecycle | `fork-session.ts`, `compact-session.ts`, `rewind-session.ts` | -| Spec mode | `enter-spec-mode.ts`, `spec-mode-same-session.ts`, `spec-mode-new-session.ts` | -| Daemon and missions | `daemon-session.ts`, `mission.ts` | -| Observability | `observability.ts` | +| Topic | Node examples | +| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| Runs and results | `run.ts`, `result-metadata.ts` | +| Sessions | `multi-turn-session.ts`, `resume-session.ts`, `list-sessions.ts`, `rename-session.ts`, `init-metadata.ts`, `session-settings.ts` | +| Streaming and cancellation | `session-stream.ts`, `partial-stream.ts`, `abort-session-stream.ts`, `interrupt-session.ts` | +| Models | `model-discovery.ts`, `model-selection.ts` | +| Inputs and outputs | `image-attachment.ts`, `document-input.ts`, `structured-output.ts` | +| Permissions and user input | `permission-handler.ts`, `ask-user-elicitation.ts`, `tool-controls.ts` | +| Extensions | `sdk-mcp-tool.ts`, `external-mcp.ts`, `skills.ts`, `hook-execution.ts` | +| Session lifecycle | `fork-session.ts`, `compact-session.ts`, `rewind-session.ts` | +| Spec mode | `enter-spec-mode.ts`, `spec-mode-same-session.ts`, `spec-mode-new-session.ts` | +| Daemon, missions, and workstreams | `daemon-session.ts`, `mission.ts`, `start-workstream.ts` | +| Factory REST API | `rest-api.ts` | +| Observability | `observability.ts` | Start a mission in a test project and print orchestrator and worker progress. `interactionMode: DroidInteractionMode.Mission` alone does not give the session diff --git a/examples/node/rest-api.ts b/examples/node/rest-api.ts index 8b58119..e374289 100644 --- a/examples/node/rest-api.ts +++ b/examples/node/rest-api.ts @@ -2,7 +2,8 @@ * Factory REST API example. * * Lists the Computers and remote sessions an API key can see, using the - * client generated from the public Factory API spec. + * client generated from the public Factory API spec. Listing sessions works + * only for organizations that have that feature enabled. * * These operations take `{ client }` from `createFactoryClient({ apiKey, baseUrl })` * and resolve `{ data, error }`. The root `@factory/droid-sdk` REST helpers diff --git a/examples/node/start-workstream.ts b/examples/node/start-workstream.ts index 33d6f53..42a8184 100644 --- a/examples/node/start-workstream.ts +++ b/examples/node/start-workstream.ts @@ -8,7 +8,7 @@ * that attaches that agent with handlers (`droid.sessions.resume(agentId, ...)`). * * Set DROID_DAEMON_URL and FACTORY_API_KEY for an existing daemon whose account - * has access to workstreams. Set WORKSTREAM_COMPUTER_ID to let agents also run + * has access to workstreams. Set DROID_WORKSTREAM_COMPUTER_ID to let agents also run * on that computer instead of only on this daemon's machine. * Usage: npx tsx examples/node/start-workstream.ts "" [cwd] */ @@ -23,7 +23,7 @@ import { const url = process.env.DROID_DAEMON_URL; const apiKey = process.env.FACTORY_API_KEY; -const computerId = process.env.WORKSTREAM_COMPUTER_ID; +const computerId = process.env.DROID_WORKSTREAM_COMPUTER_ID; if (!url || !apiKey) { throw new Error('Set DROID_DAEMON_URL and FACTORY_API_KEY.'); } diff --git a/package-lock.json b/package-lock.json index 6934825..75c641c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@factory/droid-sdk-examples", - "version": "0.10.0", + "version": "0.11.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@factory/droid-sdk-examples", - "version": "0.10.0", + "version": "0.11.0", "license": "Apache-2.0", "dependencies": { "@factory/droid-sdk": "0.11.0",