@zoowork-ai/sdk 0.11.1 → 0.12.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 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.12.0 — 2026-10-14
7
+
8
+ - Add the Agent default thinking level (Managed API `model.thinking`, live in production from
9
+ Engine `v0.2.33-release`). New exported types `ThinkingLevel`
10
+ (`'off' | 'low' | 'medium' | 'high' | 'max'`), `AgentModelUpdate` and `AgentUpdate`.
11
+ `AgentResource.model.thinking` accepts a level or `null`. `null` in an update clears it, and
12
+ `{ model: { thinking: null } } satisfies AgentUpdate` type-checks without `primary`.
13
+ - `ModelInfo.thinking` types the new `GET /v1/models` field `{ default, levels }`, which lists the
14
+ levels a model honours as named. A level a model does not list resolves to the nearest one.
15
+ - `SchedulePayload.thinking` overrides the Agent's level for an `agentTurn` job. On update,
16
+ omitting it keeps the stored value and `null` clears it.
17
+ - Additive only. Existing calls and types compile unchanged.
18
+
6
19
  ## 0.11.1 — 2026-10-04
7
20
 
8
21
  - `uploadFile` no longer runs `chown` on the uploaded file or on directories it creates. The
package/README.md CHANGED
@@ -51,6 +51,29 @@ const session = await zc.createSession(agent.agent_id, {
51
51
  before using a catalog row in a new Agent or config. A non-selectable choice returns
52
52
  `409 model_not_selectable`; `expired_fallback_to` names the reviewed replacement when present.
53
53
 
54
+ To set a default thinking level, read the levels a model supports from `listModels()` and
55
+ choose one of them in `model.thinking` (`'off' | 'low' | 'medium' | 'high' | 'max'`). Omit it to
56
+ use the platform default; send `thinking: null` in an `updateAgent` call to clear it. A schedule's
57
+ `agentTurn` payload accepts the same `thinking` values; on `updateSchedule`, omitting it keeps the
58
+ stored value and `null` clears it.
59
+
60
+ ```ts
61
+ // `models` and `primary` come from the listModels() example above.
62
+ const info = models.find((m) => m.model === primary)
63
+ const wanted: ThinkingLevel = 'high'
64
+
65
+ // Set the level only when the model supports it; otherwise leave `thinking` out and the
66
+ // Agent follows the platform default.
67
+ const model: AgentResource['model'] = { primary }
68
+ if (info?.thinking?.levels.includes(wanted)) model.thinking = wanted
69
+
70
+ const tuned = await zc.createAgent({ resource: { name: 'deep-research-agent', model } })
71
+
72
+ // Clear it later. `model.thinking` merges, so `primary` is not needed. `satisfies AgentUpdate`
73
+ // makes the compiler reject an unknown level (updateAgent itself accepts any object).
74
+ await zc.updateAgent(tuned.agent_id, { model: { thinking: null } } satisfies AgentUpdate)
75
+ ```
76
+
54
77
  Agent resources also accept `userTimezone`, a named IANA timezone used for prompt and message
55
78
  time context, and `include_global_skills: false` to disable automatic global Skills while keeping
56
79
  explicitly listed Skills. An explicit `skills: []` also opts out. Schedule timezones are configured
package/dist/client.d.ts CHANGED
@@ -118,6 +118,12 @@ export interface Ownership {
118
118
  project_id?: string | null;
119
119
  visibility?: 'private' | 'project';
120
120
  }
121
+ /**
122
+ * Thinking level, in ascending order of reasoning. A model resolves a level it does not list in
123
+ * `ModelInfo.thinking.levels` to the nearest listed one (ties go up), so `off` on a model that
124
+ * cannot stop thinking becomes its lowest level.
125
+ */
126
+ export type ThinkingLevel = 'off' | 'low' | 'medium' | 'high' | 'max';
121
127
  export interface ModelInfo {
122
128
  model: string;
123
129
  display_name?: string;
@@ -132,6 +138,15 @@ export interface ModelInfo {
132
138
  selectable?: boolean;
133
139
  retire_not_before?: string | null;
134
140
  default_for?: string[];
141
+ /**
142
+ * Thinking levels that take effect as named on this model, ascending; any other
143
+ * {@link ThinkingLevel} resolves to the nearest listed one. `default` is what the platform
144
+ * applies when an Agent sets none. Optional so older servers that omit it still type-check.
145
+ */
146
+ thinking?: {
147
+ default: ThinkingLevel;
148
+ levels: ThinkingLevel[];
149
+ };
135
150
  [k: string]: unknown;
136
151
  }
137
152
  /** Approval behavior for one MCP server or one of its tools. */
@@ -281,6 +296,21 @@ export interface OutcomeConfig {
281
296
  /** Defaults to `after_satisfied` at run time: an unsatisfied result stays unpublished. */
282
297
  publish?: 'after_satisfied' | 'always' | 'never';
283
298
  }
299
+ /**
300
+ * Partial `model` section for {@link ZooworkClient.updateAgent}. `model.thinking` merges on its
301
+ * own, so `{ thinking: null }` alone clears the declared level; `primary` is not required.
302
+ */
303
+ export type AgentModelUpdate = Partial<NonNullable<AgentResource['model']>>;
304
+ /**
305
+ * Opt-in typing for the `sections` argument of `updateAgent`. `updateAgent` itself still takes
306
+ * `Record<string, unknown>` so existing callers compile unchanged; write
307
+ * `const update = { model: { thinking: null } } satisfies AgentUpdate` (or annotate with this
308
+ * type) to have the compiler check `model` and reject an unknown thinking level.
309
+ */
310
+ export type AgentUpdate = {
311
+ model?: AgentModelUpdate;
312
+ [section: string]: unknown;
313
+ };
284
314
  export interface AgentResource {
285
315
  name: string;
286
316
  /** Named IANA timezone used in prompt context and message timestamps, e.g. `Asia/Shanghai`. */
@@ -290,11 +320,16 @@ export interface AgentResource {
290
320
  * defaults can rotate; call `listModels()` and set `primary` explicitly for deterministic
291
321
  * provisioning. `max_tokens` caps output tokens per model request; omit only that field to
292
322
  * use the platform token limit.
323
+ *
324
+ * `thinking` is the Agent's default thinking level. Omit it to use the platform default for
325
+ * the model; send `null` in an update (PUT) to clear a previously declared value. Check
326
+ * `ModelInfo.thinking.levels` from `listModels()` for the levels a model accepts.
293
327
  */
294
328
  model?: {
295
329
  primary: string;
296
330
  input?: string[];
297
331
  max_tokens?: number;
332
+ thinking?: ThinkingLevel | null;
298
333
  };
299
334
  persona?: {
300
335
  docs: {
@@ -884,6 +919,16 @@ export interface SchedulePayload {
884
919
  * 2026-08-14 (201, read back verbatim). See {@link OutcomeConfig}.
885
920
  */
886
921
  outcome?: OutcomeConfig | null;
922
+ /**
923
+ * Thinking level for THIS job's turns, outranking the Agent's `model.thinking`. Only an
924
+ * `agentTurn` payload honours it. On an update it has three states: omit it (or send an empty or
925
+ * whitespace-only string) to keep the stored value, send `null` to clear it so the job follows
926
+ * the Agent again, or send a level to set it. The server trims and lowercases a new value and
927
+ * normalizes legacy spellings (`xhigh`, `minimal`, `adaptive` become `max`, `low`, `medium`);
928
+ * a stored value written back unchanged stays as is, so a job stored before this change may
929
+ * still read back a legacy spelling.
930
+ */
931
+ thinking?: ThinkingLevel | null;
887
932
  [k: string]: unknown;
888
933
  }
889
934
  export interface ScheduleInput {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { createZooworkClient, DEFAULT_BASE_URL, ZooworkError, type ZooworkClient, type ZooworkConfig, type ZooworkAuth, type Ownership, type ModelInfo, type AgentResource, type AgentRecord, type AgentListParams, type AgentPage, type AgentPagePromise, type AgentStatus, type AgentSkill, type AgentChannel, type AgentChannelCapabilitySync, type AgentChannelCapabilities, type FeishuChannelProviderStatus, type FeishuDocumentsCapability, type ChannelPlatform, type AddChannelPlatform, type GuidedSetupPlatform, type AddChannelInput, type UpdateChannelInput, type ChannelSetupInput, type ChannelSetupSession, type ChannelPollResult, type FeishuSetupInput, type FeishuSetupSession, type FeishuPollResult, type McpContextConfig, type McpServerDeclaration, type McpToolPermission, type McpToolPermissionOverride, type CustomToolDeclaration, type CustomToolResultImageMimeType, type CustomToolResultContent, type CustomToolResultEvent, type SkillRecord, type SkillVersionRecord, type SessionRecord, type SessionListPageOptions, type SessionListPage, type SessionHistoryEntry, type SessionEvent, type SessionEventPage, type OutboundEvent, type PostEventReceipt, type ApprovalDecision, type ApprovalRecord, type CustomToolCallStatus, type CustomToolCallRecord, type ArtifactPage, type ArtifactRecord, type ArtifactStatus, type OutcomeConfig, type OutcomeEvaluator, type SystemPromptDeclaration, type SystemPromptInfo, type SystemPromptPreview, type SystemPromptPreviewInput, type SystemPromptUpgrade, type ScheduleSpec, type SchedulePayload, type ScheduleInput, type ScheduleUpdate, type ScheduleRecord, type ScheduleRun, type WakeResult, type ExecResult, type UploadFileResult, type EnvironmentConfig, type EnvironmentResource, type EnvironmentRecord, type EnvironmentVersionRecord, } from './client.js';
1
+ export { createZooworkClient, DEFAULT_BASE_URL, ZooworkError, type ZooworkClient, type ZooworkConfig, type ZooworkAuth, type Ownership, type ModelInfo, type ThinkingLevel, type AgentResource, type AgentModelUpdate, type AgentUpdate, type AgentRecord, type AgentListParams, type AgentPage, type AgentPagePromise, type AgentStatus, type AgentSkill, type AgentChannel, type AgentChannelCapabilitySync, type AgentChannelCapabilities, type FeishuChannelProviderStatus, type FeishuDocumentsCapability, type ChannelPlatform, type AddChannelPlatform, type GuidedSetupPlatform, type AddChannelInput, type UpdateChannelInput, type ChannelSetupInput, type ChannelSetupSession, type ChannelPollResult, type FeishuSetupInput, type FeishuSetupSession, type FeishuPollResult, type McpContextConfig, type McpServerDeclaration, type McpToolPermission, type McpToolPermissionOverride, type CustomToolDeclaration, type CustomToolResultImageMimeType, type CustomToolResultContent, type CustomToolResultEvent, type SkillRecord, type SkillVersionRecord, type SessionRecord, type SessionListPageOptions, type SessionListPage, type SessionHistoryEntry, type SessionEvent, type SessionEventPage, type OutboundEvent, type PostEventReceipt, type ApprovalDecision, type ApprovalRecord, type CustomToolCallStatus, type CustomToolCallRecord, type ArtifactPage, type ArtifactRecord, type ArtifactStatus, type OutcomeConfig, type OutcomeEvaluator, type SystemPromptDeclaration, type SystemPromptInfo, type SystemPromptPreview, type SystemPromptPreviewInput, type SystemPromptUpgrade, type ScheduleSpec, type SchedulePayload, type ScheduleInput, type ScheduleUpdate, type ScheduleRecord, type ScheduleRun, type WakeResult, type ExecResult, type UploadFileResult, type EnvironmentConfig, type EnvironmentResource, type EnvironmentRecord, type EnvironmentVersionRecord, } from './client.js';
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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zoowork-ai/sdk",
3
- "version": "0.11.1",
3
+ "version": "0.12.0",
4
4
  "description": "TypeScript SDK for the ZooWork Managed Agents API (Developer Preview)",
5
5
  "keywords": [
6
6
  "zoowork",