@zoowork-ai/sdk 0.10.0 → 0.10.2
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 +13 -0
- package/README.md +34 -13
- package/dist/client.d.ts +34 -13
- package/dist/events.d.ts +4 -3
- package/dist/events.js +4 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
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.10.2 — 2026-10-04
|
|
7
|
+
|
|
8
|
+
- Accept `project` in `uploadSkill` for named Project keys.
|
|
9
|
+
- Clarify Skill registry read/write scopes, version publishing, and Agent bindings for Platform keys.
|
|
10
|
+
- Existing calls remain compatible. Project-scoped uploads require service-side support; this SDK release does not deploy the service.
|
|
11
|
+
|
|
12
|
+
## 0.10.1 — 2026-10-03
|
|
13
|
+
|
|
14
|
+
- Correct production availability guidance for Files, Database viewer, Schedules and Agent configuration updates.
|
|
15
|
+
- Clarify approval and blocked tool events, stream cursor recovery, repeated deletion and Usage validation.
|
|
16
|
+
- Link to the public developer documentation.
|
|
17
|
+
- Documentation and comments only; no runtime or public API changes. Existing service limitations remain.
|
|
18
|
+
|
|
6
19
|
## 0.10.0 — 2026-10-03
|
|
7
20
|
|
|
8
21
|
- Add Files, read-only Agent Database, Usage, Run Output, action paging/detail and Agent webhook management helpers.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @zoowork-ai/sdk
|
|
2
2
|
|
|
3
|
-
TypeScript SDK for the [ZooWork Managed Agents](https://
|
|
3
|
+
TypeScript SDK for the [ZooWork Managed Agents](https://zoowork.ai/docs/) API. Developer Preview.
|
|
4
4
|
|
|
5
5
|
Zero runtime dependencies — it uses the platform `fetch`, which you can override for edge runtimes and tests. ESM only, Node 20+.
|
|
6
6
|
|
|
@@ -149,7 +149,7 @@ to use the owner; IM sessions reject it. See the field's SDK comment for input c
|
|
|
149
149
|
|
|
150
150
|
## Agent Skills
|
|
151
151
|
|
|
152
|
-
New Agents receive global Skills by default. Use `listAgentSkills(agentId)` to inspect attached Skills. At create time, `resource.skills` accepts a catalog name or `skill_id`; `include_global_skills: false` or an explicit empty list opts out of automatic Skills. Root Skill uploads are unavailable to Project keys. Keep source changes in your application
|
|
152
|
+
New Agents receive global Skills by default. Use `listAgentSkills(agentId)` to inspect attached Skills. At create time, `resource.skills` accepts a catalog name or `skill_id`; `include_global_skills: false` or an explicit empty list opts out of automatic Skills. Root Skill uploads are unavailable to Project keys. Keep source changes in your application; use persona documents for standing instructions and Session messages for text task data.
|
|
153
153
|
|
|
154
154
|
## Schedules, wake and exec
|
|
155
155
|
|
|
@@ -357,7 +357,7 @@ and `listEvents` truncates at 500 events with nothing in the response to say it
|
|
|
357
357
|
|
|
358
358
|
## Documentation
|
|
359
359
|
|
|
360
|
-
Full guides and the capability matrix: **[zoowork-agents-docs](https://
|
|
360
|
+
Full guides and the capability matrix: **[zoowork-agents-docs](https://zoowork.ai/docs/)**.
|
|
361
361
|
|
|
362
362
|
Runnable examples in [`examples/`](examples):
|
|
363
363
|
|
|
@@ -408,11 +408,6 @@ MIT
|
|
|
408
408
|
These helpers require an SDK release that includes them. Check the installed declarations before using an example; use the documented HTTP endpoint if the installed release lacks the method.
|
|
409
409
|
|
|
410
410
|
```ts
|
|
411
|
-
const files = await zc.getWorkspaceFile(agentId, '/workspace')
|
|
412
|
-
await zc.writeWorkspaceFile(agentId, '/workspace/input.txt', 'hello')
|
|
413
|
-
const bytes = await zc.getWorkspaceFileContent(agentId, '/workspace/result.bin')
|
|
414
|
-
const database = await zc.getAgentDatabase(agentId) // reading never provisions it
|
|
415
|
-
const rows = await zc.getAgentDatabaseRows(agentId, 'results', { limit: 100, offset: 0 })
|
|
416
411
|
const usage = await zc.getUsage({ range: '7d', view: 'both' })
|
|
417
412
|
const endpoint = await zc.createAgentWebhook(agentId, {
|
|
418
413
|
url: 'https://receiver.example/webhook', event_types: ['run.finished'],
|
|
@@ -423,9 +418,10 @@ const output = await zc.getRunOutput(agentId, sessionId, runId)
|
|
|
423
418
|
const approvals = await zc.listApprovalPage(agentId, { sessionId })
|
|
424
419
|
```
|
|
425
420
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
421
|
+
Direct workspace Files and the database viewer are not supported production workflows.
|
|
422
|
+
Supply text in Session messages, ask the Agent to create and publish Artifacts, and download
|
|
423
|
+
those through the Artifact API. The Agent can use `agent_db` and return query results in its
|
|
424
|
+
reply. Method presence is not production availability. Usage stays within the current key scope. Page helpers retain `next_cursor` and `has_more`; replay cursors
|
|
429
425
|
verbatim. `getApproval` and `getCustomToolCall` read terminal as well as pending actions.
|
|
430
426
|
|
|
431
427
|
Agent webhook methods include get/update/delete, `rotateAgentWebhookSecret`, `testAgentWebhook`,
|
|
@@ -436,5 +432,30 @@ records to learn the result. SDK writes do not retry automatically.
|
|
|
436
432
|
`createSession` accepts `runtime_mode: 'active'` to pin the current active configuration at
|
|
437
433
|
creation. Omit it to resolve active configuration on later turns. `idle_compaction` preserves
|
|
438
434
|
false, null and omission. MCP tool overrides accept `requireConfirmation?: boolean`.
|
|
439
|
-
`updateAgent`
|
|
440
|
-
`
|
|
435
|
+
Production `updateAgent` currently rejects `expected_config_version` with
|
|
436
|
+
`400 invalid_declared_key`. Omit it for ordinary last-write-wins updates; serialize competing
|
|
437
|
+
writes in your application. A GET followed by PUT is not atomic. Ownership-only changes do not
|
|
438
|
+
increment the configuration version. The separate `upgradeSystemPrompt` precondition remains supported.
|
|
439
|
+
|
|
440
|
+
## Current production behavior
|
|
441
|
+
|
|
442
|
+
- Manual Schedule execution requires `enabled: true`, which also enables automatic firings.
|
|
443
|
+
A disabled Schedule can return `triggered: true` and still be skipped. The receipt is not a
|
|
444
|
+
run result; run rows can lack status/session linkage.
|
|
445
|
+
- Approval waiting is `agent.approval` / `requested`; `resolved` ends the approval wait.
|
|
446
|
+
`agent.tool` / `blocked` ends a call without execution, with no later `end`. Reasons include
|
|
447
|
+
policy denial, approval denial/timeout/cancellation, or interruption; inspect the event
|
|
448
|
+
payload's `deniedReason`.
|
|
449
|
+
- Save each processed stream cursor with its Session ID. Pass it when reading a subsequent
|
|
450
|
+
turn in that Session. No cursor means replay from the beginning, including old `run.finished`.
|
|
451
|
+
REST events and post-event receipts do not supply a cursor; the last REST page has a null
|
|
452
|
+
continuation token. There is no current-tail helper. Without a saved cursor, replay and
|
|
453
|
+
reconstruct state or deliberately start a new conversation; do not synthesize a cursor from seq.
|
|
454
|
+
- First Agent deletion succeeds with 204; repeated deletion returns 404 through the public API.
|
|
455
|
+
For cleanup retries, interpret 404 as absence only for a known Agent with unchanged key scope.
|
|
456
|
+
Other-tenant or inaccessible resources also return 404.
|
|
457
|
+
- Invalid Usage parameters can return either `400 usage.invalid_query` or 422 with no business
|
|
458
|
+
error type. Correct the parameters rather than retrying unchanged. Match status as well as type.
|
|
459
|
+
|
|
460
|
+
See the [public guides](https://zoowork.ai/docs/) for supported workflows. These notes do not
|
|
461
|
+
change SDK transport behavior or make unavailable endpoints usable.
|
package/dist/client.d.ts
CHANGED
|
@@ -676,7 +676,7 @@ export interface AgentRecord {
|
|
|
676
676
|
*/
|
|
677
677
|
export interface SkillRecord {
|
|
678
678
|
skill_id: string;
|
|
679
|
-
scope?: 'org' | 'personal' | 'global' | 'pack' | string;
|
|
679
|
+
scope?: 'project' | 'org' | 'personal' | 'global' | 'pack' | string;
|
|
680
680
|
name?: string;
|
|
681
681
|
description?: string;
|
|
682
682
|
latest_version?: number | string | null;
|
|
@@ -694,6 +694,7 @@ export interface SkillRecord {
|
|
|
694
694
|
ownership?: {
|
|
695
695
|
owner_uid?: string | null;
|
|
696
696
|
org_id?: string | null;
|
|
697
|
+
project_id?: string | null;
|
|
697
698
|
[k: string]: unknown;
|
|
698
699
|
};
|
|
699
700
|
[k: string]: unknown;
|
|
@@ -1351,10 +1352,13 @@ export interface ZooworkClient extends DeveloperApi {
|
|
|
1351
1352
|
listAgents(opts?: AgentListParams): AgentPagePromise;
|
|
1352
1353
|
getAgent(agentId: string): Promise<AgentRecord>;
|
|
1353
1354
|
/** PUT declared sections. Ownership-only changes do not bump config_version.
|
|
1354
|
-
*
|
|
1355
|
+
* Production currently rejects expected_config_version with 400 invalid_declared_key.
|
|
1356
|
+
* Omit it for last-write-wins updates and serialize competing writes in the application. */
|
|
1355
1357
|
updateAgent(agentId: string, sections: Record<string, unknown>): Promise<AgentRecord>;
|
|
1356
1358
|
/**
|
|
1357
1359
|
* Soft delete: the agent stops resolving on the API, but this is not a resource purge.
|
|
1360
|
+
* The first public-API deletion returns 204; repeating it returns 404. A 404 can also
|
|
1361
|
+
* hide an inaccessible resource, so cleanup retries must retain the original key scope.
|
|
1358
1362
|
* On gateway releases that carry the channels surface, a successful delete also
|
|
1359
1363
|
* best-effort disables the agent's bound channels — a failure there never turns the
|
|
1360
1364
|
* delete into an error, so a chat binding can in rare cases outlive its agent.
|
|
@@ -1405,9 +1409,10 @@ export interface ZooworkClient extends DeveloperApi {
|
|
|
1405
1409
|
verbose?: boolean;
|
|
1406
1410
|
}): Promise<AgentSkill[]>;
|
|
1407
1411
|
/**
|
|
1408
|
-
* Attach a
|
|
1409
|
-
*
|
|
1410
|
-
*
|
|
1412
|
+
* Attach a visible Skill by id. Platform keys can attach global, same-org org,
|
|
1413
|
+
* same-Project project, and eligible owner-personal Skills. Binding a visible Skill
|
|
1414
|
+
* does not grant permission to publish its versions or delete its registry record.
|
|
1415
|
+
* Work service tokens retain their org/personal visibility rules.
|
|
1411
1416
|
*/
|
|
1412
1417
|
putAgentSkill(agentId: string, skillId: string, opts?: {
|
|
1413
1418
|
enabled?: boolean;
|
|
@@ -1571,14 +1576,18 @@ export interface ZooworkClient extends DeveloperApi {
|
|
|
1571
1576
|
* accepted. `SKILL.md` must be non-empty and declare both `name` and `description`.
|
|
1572
1577
|
* 50 MB expanded, zip only (store/deflate), encrypted zips rejected.
|
|
1573
1578
|
*
|
|
1574
|
-
*
|
|
1575
|
-
*
|
|
1579
|
+
* Platform keys on deployments with Project Skill registry support use project scope for a
|
|
1580
|
+
* named Project and org scope for the Default Project. Ownership is derived from the key;
|
|
1581
|
+
* Default Project org Skills are shared across the Organization. Other scopes return
|
|
1582
|
+
* 400 service_api.invalid_body. Work service tokens retain org/personal create scopes.
|
|
1583
|
+
* Older deployments may reject Platform registry requests with 404; SDK support alone
|
|
1584
|
+
* does not prove deployment availability. On CREATE the public gateway drops the
|
|
1576
1585
|
* description option: put the description in the zip's frontmatter instead.
|
|
1577
1586
|
* idempotencyKey is retained as a transport option, not a replay guarantee for Skill uploads.
|
|
1578
1587
|
* A retry after a successful create can return 409 skill_exists; read back before retrying.
|
|
1579
1588
|
*/
|
|
1580
1589
|
uploadSkill(zip: Blob | ArrayBuffer | Uint8Array, opts: {
|
|
1581
|
-
scope: 'org' | 'personal';
|
|
1590
|
+
scope: 'project' | 'org' | 'personal';
|
|
1582
1591
|
fileName?: string;
|
|
1583
1592
|
description?: string;
|
|
1584
1593
|
idempotencyKey?: string;
|
|
@@ -1589,6 +1598,10 @@ export interface ZooworkClient extends DeveloperApi {
|
|
|
1589
1598
|
* skill's name. Unlike root create, description can override the frontmatter here.
|
|
1590
1599
|
* Returns a version row (version/state), not a SkillRecord (latest_version/status).
|
|
1591
1600
|
* Identical content for the same skill is deduplicated by content, not by Idempotency-Key.
|
|
1601
|
+
* Platform keys can publish only within their write scope: their own named Project's
|
|
1602
|
+
* project Skills, or their Organization's org Skills for a Default Project key. Visible
|
|
1603
|
+
* global/personal Skills and a named Project's visible org Skills remain read-only in the
|
|
1604
|
+
* registry; writes return 404 service_api.not_found. Requires Project registry deployment support.
|
|
1592
1605
|
*
|
|
1593
1606
|
* Agents that installed the skill unpinned follow the new version on their own — the registry
|
|
1594
1607
|
* bumps their `config_version`; you do not re-`putAgentSkill`.
|
|
@@ -1599,16 +1612,24 @@ export interface ZooworkClient extends DeveloperApi {
|
|
|
1599
1612
|
idempotencyKey?: string;
|
|
1600
1613
|
}): Promise<SkillVersionRecord>;
|
|
1601
1614
|
/**
|
|
1602
|
-
*
|
|
1603
|
-
*
|
|
1604
|
-
*
|
|
1615
|
+
* One page of the visible catalog. With Project registry deployment support, Platform keys
|
|
1616
|
+
* see global Skills, their Organization's org Skills, their named Project's project Skills,
|
|
1617
|
+
* and eligible personal Skills owned by the key's owner. Visibility does not grant registry
|
|
1618
|
+
* write permission. Ownership selectors come from the key. Work service tokens retain their
|
|
1619
|
+
* existing catalog behavior. `q` matches name; `page` is 1-based with a page size of 100.
|
|
1605
1620
|
*/
|
|
1606
1621
|
listSkills(opts?: {
|
|
1607
|
-
scope?: 'org' | 'personal' | 'global' | string;
|
|
1622
|
+
scope?: 'project' | 'org' | 'personal' | 'global' | string;
|
|
1608
1623
|
q?: string;
|
|
1609
1624
|
page?: number;
|
|
1610
1625
|
}): Promise<SkillRecord[]>;
|
|
1611
|
-
/**
|
|
1626
|
+
/**
|
|
1627
|
+
* Delete the registry Skill (204), not just one Agent binding. Platform keys require Project
|
|
1628
|
+
* registry deployment support and may delete only their own named Project's project Skills
|
|
1629
|
+
* or, for a Default Project key, their Organization's org Skills. Other IDs, including visible
|
|
1630
|
+
* read-only Skills, return 404 service_api.not_found. Check consumers before deleting a shared
|
|
1631
|
+
* org Skill; use deleteAgentSkill to detach only one Agent.
|
|
1632
|
+
*/
|
|
1612
1633
|
deleteSkill(skillId: string): Promise<void>;
|
|
1613
1634
|
createSession(agentId: string, input: {
|
|
1614
1635
|
initial_events?: OutboundEvent[];
|
package/dist/events.d.ts
CHANGED
|
@@ -95,8 +95,9 @@ export declare function customToolUse(e: SessionEvent): CustomToolUse | undefine
|
|
|
95
95
|
* `phase: 'end'` carries `isError` and `resultPreview`. Pair them by `toolCallId` — they are
|
|
96
96
|
* NOT adjacent in the stream when calls run concurrently.
|
|
97
97
|
*
|
|
98
|
-
* `phase: 'blocked'`
|
|
99
|
-
*
|
|
100
|
-
*
|
|
98
|
+
* `phase: 'blocked'` ends the call without execution; no `end` follows. Reasons include
|
|
99
|
+
* policy denial, approval denial/timeout/cancellation, or interruption. Inspect
|
|
100
|
+
* `e.payload.deniedReason` for the reason. Approval waiting uses `agent.approval` with `phase: 'requested'`,
|
|
101
|
+
* followed by `phase: 'resolved'`. A resolution is not proof of successful execution.
|
|
101
102
|
*/
|
|
102
103
|
export declare function toolCall(e: SessionEvent): ToolCall | undefined;
|
package/dist/events.js
CHANGED
|
@@ -152,9 +152,10 @@ export function customToolUse(e) {
|
|
|
152
152
|
* `phase: 'end'` carries `isError` and `resultPreview`. Pair them by `toolCallId` — they are
|
|
153
153
|
* NOT adjacent in the stream when calls run concurrently.
|
|
154
154
|
*
|
|
155
|
-
* `phase: 'blocked'`
|
|
156
|
-
*
|
|
157
|
-
*
|
|
155
|
+
* `phase: 'blocked'` ends the call without execution; no `end` follows. Reasons include
|
|
156
|
+
* policy denial, approval denial/timeout/cancellation, or interruption. Inspect
|
|
157
|
+
* `e.payload.deniedReason` for the reason. Approval waiting uses `agent.approval` with `phase: 'requested'`,
|
|
158
|
+
* followed by `phase: 'resolved'`. A resolution is not proof of successful execution.
|
|
158
159
|
*/
|
|
159
160
|
export function toolCall(e) {
|
|
160
161
|
if (e.eventType !== 'agent.tool')
|