@zoowork-ai/sdk 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +8 -2
- package/dist/AGENTS.md +18 -0
- package/dist/developer-api.d.ts +9 -0
- package/dist/developer-api.js +1 -0
- package/dist/index.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
3
3
|
All notable changes to `@zoowork-ai/sdk` (formerly `@zooclaw-agents/sdk`). Dates are the
|
|
4
4
|
day the behaviour was verified, not the day it was written.
|
|
5
5
|
|
|
6
|
+
## 0.14.0 — 2026-10-29
|
|
7
|
+
|
|
8
|
+
- Live smoke and thinking tests now default to the platform default model (the catalog row whose
|
|
9
|
+
`default_for` includes `model`) instead of the first catalog row, which sorts alphabetically.
|
|
10
|
+
They fall back to the first eligible row when no default is marked. `--model` still overrides.
|
|
11
|
+
- Ship `dist/AGENTS.md`, a short guide for coding assistants working in a project that installs this
|
|
12
|
+
package. The public docs describe the newest release; the guide tells an assistant to check a
|
|
13
|
+
method against the installed `*.d.ts` and `CHANGELOG.md`, and to tell the user when the docs rely
|
|
14
|
+
on something the installed version lacks instead of upgrading or working around it silently. In
|
|
15
|
+
an eval of projects pinned to 0.10.2, such a guide took Codex from 0/9 to 8/9 on reporting the
|
|
16
|
+
gap and kept Claude Code at 9/9 (zoowork-sdk-skills#40).
|
|
17
|
+
- Add `getBalance()` for `GET /service/v1/balance`. It returns the Organization balance shared by
|
|
18
|
+
all Projects as a USD decimal string (`available_amount`), the same amount the Platform Billing
|
|
19
|
+
page shows. Any Platform key in the Organization can read it; Work service tokens receive
|
|
20
|
+
`service_api.not_found`.
|
|
21
|
+
- Require Node.js 22 or later (`engines.node` is now `>=22`). Node.js 20 reached end of life on
|
|
22
|
+
2026-04-30 and was not patched by the 2026-10-21 Node.js security release. The SDK does not use
|
|
23
|
+
any Node.js 22-only API, so Node.js 20 may still run it, but that line is no longer tested or
|
|
24
|
+
supported. CI now tests Node.js 22, 24 and 26.
|
|
25
|
+
|
|
6
26
|
## 0.13.0 — 2026-10-23
|
|
7
27
|
|
|
8
28
|
- Make the deprecated engine-only event lane visible in the types (#58). `listEvents`,
|
package/README.md
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
TypeScript SDK for the [ZooWork Managed Agents](https://zoowork.ai/docs/) API. Developer Preview.
|
|
4
4
|
|
|
5
|
-
Zero runtime dependencies — it uses the platform `fetch`, which you can override for edge runtimes and tests. ESM only
|
|
5
|
+
Zero runtime dependencies — it uses the platform `fetch`, which you can override for edge runtimes and tests. ESM only. Requires Node.js 22 or later; use the latest security release of your Node.js line.
|
|
6
|
+
|
|
7
|
+
Coding assistants: the installed package includes `dist/AGENTS.md`, which explains how to check
|
|
8
|
+
the docs against the installed version.
|
|
6
9
|
|
|
7
10
|
```bash
|
|
8
11
|
npm install @zoowork-ai/sdk
|
|
@@ -446,6 +449,7 @@ These helpers require an SDK release that includes them. Check the installed dec
|
|
|
446
449
|
|
|
447
450
|
```ts
|
|
448
451
|
const usage = await zc.getUsage({ range: '7d', view: 'both' })
|
|
452
|
+
const balance = await zc.getBalance() // { object: 'balance', available_amount: '11.34', currency: 'usd' }
|
|
449
453
|
const endpoint = await zc.createAgentWebhook(agentId, {
|
|
450
454
|
url: 'https://receiver.example/webhook', event_types: ['run.finished'],
|
|
451
455
|
}, 'register-hook-v1')
|
|
@@ -460,7 +464,9 @@ The workspace Files methods (`getWorkspaceFile`, `writeWorkspaceFile`,
|
|
|
460
464
|
Send a file to an Agent with `uploadFile`, and retrieve results by asking the Agent to publish
|
|
461
465
|
Artifacts and downloading those through the Artifact API. The database viewer is not a
|
|
462
466
|
supported production workflow. The Agent can use `agent_db` and return query results in its
|
|
463
|
-
reply. Method presence is not production availability. Usage stays within the current key scope.
|
|
467
|
+
reply. Method presence is not production availability. Usage stays within the current key scope.
|
|
468
|
+
`getBalance` returns the Organization balance shared by all Projects, in USD, to any Platform
|
|
469
|
+
key in the Organization. Page helpers retain `next_cursor` and `has_more`; replay cursors
|
|
464
470
|
verbatim. `getApproval` and `getCustomToolCall` read terminal as well as pending actions.
|
|
465
471
|
|
|
466
472
|
Agent webhook methods include get/update/delete, `rotateAgentWebhookSecret`, `testAgentWebhook`,
|
package/dist/AGENTS.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# @zoowork-ai/sdk: notes for coding assistants
|
|
2
|
+
|
|
3
|
+
This file ships inside the installed `@zoowork-ai/sdk` package. The installed version is in
|
|
4
|
+
`../package.json`.
|
|
5
|
+
|
|
6
|
+
The docs at https://zoowork.ai/docs describe the newest SDK release, which can be newer than the
|
|
7
|
+
copy installed in this project. Before you use a method, field, or option from the docs:
|
|
8
|
+
|
|
9
|
+
- Check that it exists in the `*.d.ts` files next to this one. They are the source of truth for
|
|
10
|
+
what the installed version supports.
|
|
11
|
+
- `../CHANGELOG.md` lists what each release up to the installed one added. Later releases are
|
|
12
|
+
listed at https://raw.githubusercontent.com/SerendipityOneInc/zoowork-sdk-typescript/main/CHANGELOG.md.
|
|
13
|
+
- If the docs rely on something the installed version lacks, tell the user which release adds it
|
|
14
|
+
and ask before upgrading. Do not upgrade the SDK without asking. If you work around the gap
|
|
15
|
+
instead, for example with a deprecated method or an untyped value, say so.
|
|
16
|
+
|
|
17
|
+
Server behavior (errors, event streams, schedules, limits) does not depend on the SDK version.
|
|
18
|
+
Follow the live docs for it: https://zoowork.ai/docs/llms.txt
|
package/dist/developer-api.d.ts
CHANGED
|
@@ -68,6 +68,13 @@ export interface UsageResult extends ApiObject {
|
|
|
68
68
|
groups?: ApiObject[];
|
|
69
69
|
records?: ApiObject[];
|
|
70
70
|
}
|
|
71
|
+
/** The Organization's shared balance, as shown on the Platform Billing page. */
|
|
72
|
+
export interface BalanceResult extends ApiObject {
|
|
73
|
+
object: 'balance';
|
|
74
|
+
/** Decimal USD string with two places, e.g. `"11.34"`, after current-period usage. */
|
|
75
|
+
available_amount: string;
|
|
76
|
+
currency: 'usd';
|
|
77
|
+
}
|
|
71
78
|
export interface RunOutputArtifact extends ApiObject {
|
|
72
79
|
artifact_id: string | null;
|
|
73
80
|
name: string;
|
|
@@ -182,6 +189,8 @@ export interface DeveloperApi {
|
|
|
182
189
|
offset?: number;
|
|
183
190
|
}): Promise<AgentDatabaseRows>;
|
|
184
191
|
getUsage(opts?: UsageOptions): Promise<UsageResult>;
|
|
192
|
+
/** Read the Organization balance shared by every Project. Requires a Platform key. */
|
|
193
|
+
getBalance(): Promise<BalanceResult>;
|
|
185
194
|
getRunOutput(agentId: string, sessionId: string, runId: string, opts?: CursorOptions): Promise<RunOutput>;
|
|
186
195
|
getApproval(agentId: string, approvalId: string): Promise<ApprovalRecord>;
|
|
187
196
|
getCustomToolCall(agentId: string, callId: string): Promise<CustomToolCallRecord>;
|
package/dist/developer-api.js
CHANGED
|
@@ -21,6 +21,7 @@ export function createDeveloperApi(json, bytes, selectors) {
|
|
|
21
21
|
getAgentDatabase: (id) => json(`${agent(id)}/database`),
|
|
22
22
|
getAgentDatabaseRows: (id, table, opts = {}) => json(`${agent(id)}/database/tables/${segment(table)}/rows${query({ limit: opts.limit, offset: opts.offset })}`),
|
|
23
23
|
getUsage: (opts = {}) => json(`/usage${query({ range: opts.range, timezone: opts.timezone, group_by: opts.groupBy, view: opts.view, session_id: opts.sessionId, api_key_id: opts.apiKeyId, root_session_id: opts.rootSessionId, attribution: opts.attribution, page: opts.page, per_page: opts.perPage, as_of: opts.asOf, snapshot: opts.snapshot, cursor: opts.cursor })}`),
|
|
24
|
+
getBalance: () => json('/balance'),
|
|
24
25
|
getRunOutput: (id, sid, rid, opts = {}) => json(`${agent(id)}/sessions/${segment(sid)}/runs/${segment(rid)}/output${query({ cursor: opts.cursor, limit: opts.limit })}`),
|
|
25
26
|
getApproval: (id, aid) => json(`${agent(id)}/approvals/${segment(aid)}`),
|
|
26
27
|
getCustomToolCall: (id, cid) => json(`${agent(id)}/custom_tool_calls/${segment(cid)}`),
|
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export { createZooworkClient, DEFAULT_BASE_URL, ZooworkError, type ZooworkClient
|
|
|
2
2
|
export { SESSION_EVENT_TYPES, type SessionEventType, PUBLIC_INPUT_EVENT_TYPES, type PublicInputEventType, normalizeEvent, isRunFinished, runOutcome, messageText, assistantText, thinkingText, customToolUse, type CustomToolUse, toolCall, type ToolCall, } from './events.js';
|
|
3
3
|
export { parseSSE, type SSEMessage } from './sse.js';
|
|
4
4
|
export { WEBHOOK_EVENT_TYPES, WEBHOOK_SCHEDULE_CONFIG_EVENT_TYPES, type WebhookEventType, isKnownWebhookEventType, knownWebhookEvent, verifyWebhookSignature, unwrapWebhook, signWebhook, ZooworkWebhookError, type WebhookErrorCode, WEBHOOK_ID_HEADER, WEBHOOK_TIMESTAMP_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_SECRET_ENV, WEBHOOK_TOLERANCE_SECONDS, WEBHOOK_DEFAULT_MAX_BODY_BYTES, type WebhookEvent, type WebhookEventFor, type KnownWebhookEvent, type WebhookEventData, type WebhookEventDataByType, type WebhookEventAttribution, type WebhookScheduleRunRef, type WebhookWaitingOnRef, type WebhookRunEventData, type WebhookRunStartedData, type WebhookRunFinishedData, type WebhookRunYieldedData, type WebhookApprovalEventData, type WebhookApprovalRequestedData, type WebhookApprovalResolvedData, type WebhookCustomToolEventData, type WebhookCustomToolRequestedData, type WebhookCustomToolResolvedData, type WebhookOutcomeEvaluatedData, type WebhookSessionCreatedData, type WebhookSessionArchivedData, type WebhookSessionDeletedData, type WebhookScheduleFireData, type WebhookScheduleDispatchedData, type WebhookScheduleDispatchFailedData, type WebhookScheduleSkippedData, type WebhookScheduleFinishedData, type WebhookScheduleConfigData, type WebhookTestData, type WebhookHeaders, type WebhookHeaderSource, type WebhookSignatureHeaders, type VerifyWebhookInput, type VerifiedWebhook, type SignWebhookInput, } from './webhooks.js';
|
|
5
|
-
export type { ApiObject, CursorOptions, ActionListOptions, ApprovalPage, CustomToolCallPage, WorkspaceFileEntry, WorkspaceFile, AgentDatabase, AgentDatabaseRows, UsageOptions, UsageResult, RunOutputArtifact, RunOutputItem, RunOutput, AgentWebhookInput, AgentWebhookEndpoint, AgentWebhookPage, AgentWebhookCreated, AgentWebhookSecretRotation, WebhookDeliveryOptions, WebhookDeliveryPage, WebhookTestReceipt, WebhookRedeliveryReceipt, WebhookBatchRedeliveryReceipt, WebhookBatchRedeliveryInput, DeveloperApi, } from './developer-api.js';
|
|
5
|
+
export type { ApiObject, CursorOptions, ActionListOptions, ApprovalPage, CustomToolCallPage, WorkspaceFileEntry, WorkspaceFile, AgentDatabase, AgentDatabaseRows, UsageOptions, UsageResult, BalanceResult, RunOutputArtifact, RunOutputItem, RunOutput, AgentWebhookInput, AgentWebhookEndpoint, AgentWebhookPage, AgentWebhookCreated, AgentWebhookSecretRotation, WebhookDeliveryOptions, WebhookDeliveryPage, WebhookTestReceipt, WebhookRedeliveryReceipt, WebhookBatchRedeliveryReceipt, WebhookBatchRedeliveryInput, DeveloperApi, } from './developer-api.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zoowork-ai/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "TypeScript SDK for the ZooWork Managed Agents API (Developer Preview)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"zoowork",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"LICENSE"
|
|
34
34
|
],
|
|
35
35
|
"engines": {
|
|
36
|
-
"node": ">=
|
|
36
|
+
"node": ">=22"
|
|
37
37
|
},
|
|
38
38
|
"sideEffects": false,
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
|
-
"build": "tsc -p tsconfig.build.json",
|
|
43
|
+
"build": "tsc -p tsconfig.build.json && node -e \"require('node:fs').copyFileSync('agent-guide/AGENTS.md', 'dist/AGENTS.md')\"",
|
|
44
44
|
"typecheck": "tsc --noEmit",
|
|
45
45
|
"test": "tsc --noEmit && vitest run",
|
|
46
46
|
"test:watch": "vitest",
|