@workerkit/core 0.3.13 → 0.3.14

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
@@ -6,6 +6,19 @@ and the package adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.3.14] - 2026-10-09
10
+
11
+ ### Added
12
+
13
+ - `worker_timezone_set` sets a worker's own timezone, which its local dates, the local times in its app results and the times in its reports follow. It recomputes the daily schedules that follow the worker, leaves schedules that have their own timezone unchanged, and needs the `manageSchedules` scope.
14
+ - `kit_install`, `decision_worker_create` and `action_worker_create` take `timeZoneId` to set the new worker's timezone, and tell the agent to ask the worker's creator for it rather than guess it from connected calendars. Omitted, the worker uses UTC.
15
+ - `support_request_create` contacts WorkerKit support on the user's behalf about an error the agent cannot fix, a bug, an app WorkerKit does not offer yet, or a general question, and returns a `PE-XXXXXX` reference. It needs no scope, but the key must belong to an active user of the account, who receives the reply by email. WorkerKit keys and bearer tokens in the subject and message are redacted before the request leaves the process.
16
+
17
+ ### Changed
18
+
19
+ - `schedule_create` and `schedule_update` say that a schedule's own timezone only decides when it fires, and point to `worker_timezone_set` for the worker's timezone.
20
+ - `worker_permissions_get` says that no tool changes a worker's permissions: the agent tells the user what to switch on under the worker's Apps & access on the dashboard, then reads the permissions again to confirm.
21
+
9
22
  ## [0.3.13] - 2026-10-08
10
23
 
11
24
  ### Changed
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![license](https://img.shields.io/npm/l/%40workerkit%2Fcore.svg)](LICENSE)
7
7
 
8
8
  The shareable [WorkerKit](https://workerkit.ai) surface: an HTTP API client, the
9
- declarative tool-descriptor registry (95 authenticated fleet-management tools +
9
+ declarative tool-descriptor registry (97 authenticated fleet-management tools +
10
10
  9 anonymous kits-directory tools), and the single wire-execution path that turns
11
11
  a descriptor plus parameters into one HTTP operation.
12
12
 
@@ -37,6 +37,7 @@ export const actionDescriptors = [
37
37
  requestId: z.string().min(1).max(128)
38
38
  .describe("Your idempotency key for this creation. Repeat it only with the identical body, to recover a timed-out call's result; a different body under the same requestId is 409 request_conflict."),
39
39
  name: z.string().min(1).max(100).describe("Name for the new worker and its private kit."),
40
+ timeZoneId: z.string().trim().min(1).max(64).optional().describe("The worker's timezone, as an IANA id such as America/New_York. Ask the worker creator for it if it is not already known; never guess it from connected calendars or the server's clock. Omitted means UTC."),
40
41
  app: z.string().min(1).max(128).optional()
41
42
  .describe("The app whose default tools are copied when actionSpec is omitted, exactly as action_worker_options apps[].code lists it. Omit for Slack."),
42
43
  slackConnectionId: z.number().int().positive().optional()
@@ -1 +1 @@
1
- {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/descriptors/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAuB,MAAM,YAAY,CAAC;AAE7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC;IACjD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACtB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC;aACtD,QAAQ,CAAC,8FAA8F,CAAC;QAC3G,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC;QACtD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE;aAC3D,QAAQ,CAAC,wI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AAwB,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK;QAC/F,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC,OAAO,qBAAqB,CAAC,CAAC,YAAY,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI;QAC5H,WAAW,EAAE,+RAA+R,GAAG,iBAAiB;QAChU,MAAM,EAAE;YACN,GAAG,MAAM;YACT,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,iEAAiE,CAAC;SAC5G;QACD,WAAW,EAAE,SAAS;KACvB;CACF,CAAC","sourcesContent":["import { z } from \"../zod.js\";\nimport { CREATE, READ_ONLY, TRIGGER, type ToolDescriptor } from \"./types.js\";\n\nexport const actionSpecSchema = z.object({\n schemaVersion: z.literal(1).describe(\"Always 1.\"),\n tools: z.array(z.object({\n ref: z.string().min(1).max(128).regex(/^[A-Za-z0-9_-]+$/)\n .describe(\"A tool name exactly as action_worker_options lists it in tools[].name, from any of its apps.\"),\n version: z.literal(1).default(1).describe(\"Always 1.\"),\n contractHash: z.string().regex(/^[A-Fa-f0-9]{64}$/).optional()\n .describe(\"Optional pin, present when the selection is copied from a kit's actionSpec: creation is refused if that tool's contract changed since.\"),\n }).strict()).min(1).max(64).describe(\"1-64 tools, each listed once.\"),\n}).strict().describe(\"An explicit tool selection instead of the app's defaults: {schemaVersion: 1, tools: [{ref, version: 1}]}.\");\n\n// invokeActions is younger than most keys: the same snapshot rule as every newer scope.\nconst INVOKE_SCOPE_NOTE =\n \" A key minted before invokeActions existed does not carry it (even one minted with \\\"all\\\"): a 403 here is fixed by an account admin re-scoping or re-minting the key at https://workerkit.ai, never by retrying — check key_info's scopes first.\";\n\nconst worker = {\n tokenId: z.number().int().positive()\n .describe(\"The Action worker's numeric tokenId, as returned by workers_list or action_worker_create (modelType none on worker_get). 404 not_found = no such Action worker on this account.\"),\n};\n\nexport const actionDescriptors: readonly ToolDescriptor[] = [\n {\n name: \"action_worker_options\", title: \"Action Worker Setup\", auth: \"manager\", method: \"get\",\n path: \"/api/manage/workers/action-options\", strictInput: true,\n description: \"Get available apps, reviewed tool contracts, the selected app's default tools and any required connections for creating an Action worker: a worker with no model, instruction or deployment, whose selected app tools a caller invokes directly with worker_tool_call (modelType none). Connection IDs and sender identities are server-owned. Requires readWorkers; creates and executes nothing.\",\n schema: {\n operatorId: z.string().uuid().optional()\n .describe(\"The operator (workspace) to read connections for, as a GUID from apps_list → operators[]. Omit for the account's default operator.\"),\n app: z.string().min(1).max(128).optional()\n .describe(\"The app whose tools and defaultTools to return, exactly as apps[].code lists it. Omit for Slack.\"),\n },\n annotations: READ_ONLY,\n },\n {\n name: \"action_worker_create\", title: \"Create Action Worker\", auth: \"manager\", method: \"post\",\n path: \"/api/manage/workers/actions\", strictInput: true,\n description: \"Create a private Action kit and worker for an app from action_worker_options. No model or deployment. The server copies that app's default tools once; optionally provide an explicit actionSpec of up to 64 tools across apps. Slack tools require a fixed bot connection. Only explicit owner edits change installed tools. Requires publishKits and installKits. Reuse requestId with the same body after a timeout; never create a second worker to recover a lost response. Returns tokenId, workerId, kitSlug and modelType none, and no worker key. The worker is never deployed or run (worker_run and worker_deploy refuse it with 400 action_worker_requires_invoke): call worker_tools next, then worker_tool_call.\",\n schema: {\n requestId: z.string().min(1).max(128)\n .describe(\"Your idempotency key for this creation. Repeat it only with the identical body, to recover a timed-out call's result; a different body under the same requestId is 409 request_conflict.\"),\n name: z.string().min(1).max(100).describe(\"Name for the new worker and its private kit.\"),\n app: z.string().min(1).max(128).optional()\n .describe(\"The app whose default tools are copied when actionSpec is omitted, exactly as action_worker_options apps[].code lists it. Omit for Slack.\"),\n slackConnectionId: z.number().int().positive().optional()\n .describe(\"Slack tools only: the bot connection to pin, an id from action_worker_options connections[] (app slack). A sole usable connection is selected automatically.\"),\n operatorId: z.string().uuid().optional()\n .describe(\"The operator (workspace) to create the worker on, as a GUID from apps_list → operators[]. Omit for the account's default operator.\"),\n actionSpec: actionSpecSchema.optional(),\n },\n annotations: { ...CREATE, idempotentHint: true },\n },\n {\n name: \"worker_tools\", title: \"List Action Worker Tools\", auth: \"manager\", method: \"get\",\n path: p => `/api/manage/workers/${p.tokenId}/tools`, paramFilter: () => ({}), strictInput: true,\n description: \"Discover the saved tools, exact input/output schemas, connection and sender of an Action worker. Requires readWorkers. Select a named tool and supply its declared inputs using worker_tool_call. Discovery does not grant execution permission; current policy is checked on each call. Each tools[] entry carries name (the toolName), inputSchema, outputSchema, readOnly (false = a write, which needs an idempotencyKey) and available (false = not callable now: the tool left the catalog, its contract changed or, for a Slack tool, its bot connection is missing, until the owner reviews and re-saves the selection). availableTools are not callable until the owner selects them.\",\n schema: worker, annotations: READ_ONLY,\n },\n {\n name: \"worker_tool_call\", title: \"Call Action Worker Tool\", auth: \"manager\", method: \"post\",\n path: p => `/api/manage/workers/${p.tokenId}/tools/${encodeURIComponent(String(p.toolName))}/invoke`, strictInput: true,\n description: \"Execute exactly one saved Action worker tool with structured inputs, without a model. Discover worker_tools first. Requires invokeActions. Cannot change tools, connection, sender or permissions. Supply a unique idempotencyKey for each intended write and reuse it for transport retries. A repeated key never resends: it replays the first answer, so a refusal with error.retryable true is retried later under a new key. For in_progress poll worker_tool_invocation. outcome_unknown means the app may have completed the action: do not automatically retry or issue a new key. Generic write receipts retain confirmation but not private app response content. Never resend to recover a lost response body. The answer is {invocationId, tool, status, result, error, replayed, contractVersion} with status succeeded | denied | failed | in_progress | outcome_unknown; invocationId is set on writes only (reads leave no receipt). Refusals before the app is reached use the {error, message, code} envelope: 403 tool_not_exposed, 409 tool_contract_changed (the owner must re-save the selection), 409 idempotency_conflict (same key, different arguments), 400 invalid_request (arguments that do not match inputSchema).\" + INVOKE_SCOPE_NOTE,\n schema: {\n ...worker,\n toolName: z.string().min(1).max(128)\n .describe(\"A tools[].name from worker_tools for this worker, exactly.\"),\n contractVersion: z.literal(1).default(1).describe(\"Always 1.\"),\n arguments: z.record(z.unknown())\n .describe(\"The tool's inputs, exactly as its inputSchema in worker_tools declares them, with their JSON types. Send {} for a tool that takes none.\"),\n idempotencyKey: z.string().min(1).max(128).regex(/^[!-~]+$/).optional()\n .describe(\"Required on a write tool (readOnly false in worker_tools): 1-128 printable characters, one per intended write. The same key with the same arguments returns the stored receipt without calling the app again; with different arguments it is 409 idempotency_conflict. Reads need none.\"),\n },\n bodyBuilder: p => ({ contractVersion: p.contractVersion, arguments: p.arguments }),\n headerBuilder: (p): Record<string, string> => p.idempotencyKey ? { \"Idempotency-Key\": String(p.idempotencyKey) } : {},\n requestTimeoutMs: () => 90_000, annotations: { ...TRIGGER, idempotentHint: false },\n },\n {\n name: \"worker_tool_invocation\", title: \"Read Action Invocation\", auth: \"manager\", method: \"get\",\n path: p => `/api/manage/workers/${p.tokenId}/tool-invocations/${p.invocationId}`, paramFilter: () => ({}), strictInput: true,\n description: \"Read an Action invocation's status and effect references. Requires invokeActions. Does not execute or retry anything. Unknown outcomes must not be automatically resent. A write still in_progress after two minutes reads as outcome_unknown: check the app itself before deciding anything.\" + INVOKE_SCOPE_NOTE,\n schema: {\n ...worker,\n invocationId: z.string().uuid().describe(\"The invocationId a worker_tool_call answer carried for a write.\"),\n },\n annotations: READ_ONLY,\n },\n];\n"]}
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/descriptors/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAuB,MAAM,YAAY,CAAC;AAE7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC;IACjD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAA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,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;iBACpE,QAAQ,CAAC,yRAAyR,CAAC;SACvS;QACD,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,CAAC,eAAe,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;QAClF,aAAa,EAAE,CAAC,CAAC,EAA0B,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;QACrH,gBAAgB,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,GAAG,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE;KACnF;IACD;QACE,IAAI,EAAE,wBAAwB,EAAE,KAAK,EAAE,wBAAwB,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK;QAC/F,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC,OAAO,qBAAqB,CAAC,CAAC,YAAY,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI;QAC5H,WAAW,EAAE,+RAA+R,GAAG,iBAAiB;QAChU,MAAM,EAAE;YACN,GAAG,MAAM;YACT,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,iEAAiE,CAAC;SAC5G;QACD,WAAW,EAAE,SAAS;KACvB;CACF,CAAC","sourcesContent":["import { z } from \"../zod.js\";\nimport { CREATE, READ_ONLY, TRIGGER, type ToolDescriptor } from \"./types.js\";\n\nexport const actionSpecSchema = z.object({\n schemaVersion: z.literal(1).describe(\"Always 1.\"),\n tools: z.array(z.object({\n ref: z.string().min(1).max(128).regex(/^[A-Za-z0-9_-]+$/)\n .describe(\"A tool name exactly as action_worker_options lists it in tools[].name, from any of its apps.\"),\n version: z.literal(1).default(1).describe(\"Always 1.\"),\n contractHash: z.string().regex(/^[A-Fa-f0-9]{64}$/).optional()\n .describe(\"Optional pin, present when the selection is copied from a kit's actionSpec: creation is refused if that tool's contract changed since.\"),\n }).strict()).min(1).max(64).describe(\"1-64 tools, each listed once.\"),\n}).strict().describe(\"An explicit tool selection instead of the app's defaults: {schemaVersion: 1, tools: [{ref, version: 1}]}.\");\n\n// invokeActions is younger than most keys: the same snapshot rule as every newer scope.\nconst INVOKE_SCOPE_NOTE =\n \" A key minted before invokeActions existed does not carry it (even one minted with \\\"all\\\"): a 403 here is fixed by an account admin re-scoping or re-minting the key at https://workerkit.ai, never by retrying — check key_info's scopes first.\";\n\nconst worker = {\n tokenId: z.number().int().positive()\n .describe(\"The Action worker's numeric tokenId, as returned by workers_list or action_worker_create (modelType none on worker_get). 404 not_found = no such Action worker on this account.\"),\n};\n\nexport const actionDescriptors: readonly ToolDescriptor[] = [\n {\n name: \"action_worker_options\", title: \"Action Worker Setup\", auth: \"manager\", method: \"get\",\n path: \"/api/manage/workers/action-options\", strictInput: true,\n description: \"Get available apps, reviewed tool contracts, the selected app's default tools and any required connections for creating an Action worker: a worker with no model, instruction or deployment, whose selected app tools a caller invokes directly with worker_tool_call (modelType none). Connection IDs and sender identities are server-owned. Requires readWorkers; creates and executes nothing.\",\n schema: {\n operatorId: z.string().uuid().optional()\n .describe(\"The operator (workspace) to read connections for, as a GUID from apps_list → operators[]. Omit for the account's default operator.\"),\n app: z.string().min(1).max(128).optional()\n .describe(\"The app whose tools and defaultTools to return, exactly as apps[].code lists it. Omit for Slack.\"),\n },\n annotations: READ_ONLY,\n },\n {\n name: \"action_worker_create\", title: \"Create Action Worker\", auth: \"manager\", method: \"post\",\n path: \"/api/manage/workers/actions\", strictInput: true,\n description: \"Create a private Action kit and worker for an app from action_worker_options. No model or deployment. The server copies that app's default tools once; optionally provide an explicit actionSpec of up to 64 tools across apps. Slack tools require a fixed bot connection. Only explicit owner edits change installed tools. Requires publishKits and installKits. Reuse requestId with the same body after a timeout; never create a second worker to recover a lost response. Returns tokenId, workerId, kitSlug and modelType none, and no worker key. The worker is never deployed or run (worker_run and worker_deploy refuse it with 400 action_worker_requires_invoke): call worker_tools next, then worker_tool_call.\",\n schema: {\n requestId: z.string().min(1).max(128)\n .describe(\"Your idempotency key for this creation. Repeat it only with the identical body, to recover a timed-out call's result; a different body under the same requestId is 409 request_conflict.\"),\n name: z.string().min(1).max(100).describe(\"Name for the new worker and its private kit.\"),\n timeZoneId: z.string().trim().min(1).max(64).optional().describe(\"The worker's timezone, as an IANA id such as America/New_York. Ask the worker creator for it if it is not already known; never guess it from connected calendars or the server's clock. Omitted means UTC.\"),\n app: z.string().min(1).max(128).optional()\n .describe(\"The app whose default tools are copied when actionSpec is omitted, exactly as action_worker_options apps[].code lists it. Omit for Slack.\"),\n slackConnectionId: z.number().int().positive().optional()\n .describe(\"Slack tools only: the bot connection to pin, an id from action_worker_options connections[] (app slack). A sole usable connection is selected automatically.\"),\n operatorId: z.string().uuid().optional()\n .describe(\"The operator (workspace) to create the worker on, as a GUID from apps_list → operators[]. Omit for the account's default operator.\"),\n actionSpec: actionSpecSchema.optional(),\n },\n annotations: { ...CREATE, idempotentHint: true },\n },\n {\n name: \"worker_tools\", title: \"List Action Worker Tools\", auth: \"manager\", method: \"get\",\n path: p => `/api/manage/workers/${p.tokenId}/tools`, paramFilter: () => ({}), strictInput: true,\n description: \"Discover the saved tools, exact input/output schemas, connection and sender of an Action worker. Requires readWorkers. Select a named tool and supply its declared inputs using worker_tool_call. Discovery does not grant execution permission; current policy is checked on each call. Each tools[] entry carries name (the toolName), inputSchema, outputSchema, readOnly (false = a write, which needs an idempotencyKey) and available (false = not callable now: the tool left the catalog, its contract changed or, for a Slack tool, its bot connection is missing, until the owner reviews and re-saves the selection). availableTools are not callable until the owner selects them.\",\n schema: worker, annotations: READ_ONLY,\n },\n {\n name: \"worker_tool_call\", title: \"Call Action Worker Tool\", auth: \"manager\", method: \"post\",\n path: p => `/api/manage/workers/${p.tokenId}/tools/${encodeURIComponent(String(p.toolName))}/invoke`, strictInput: true,\n description: \"Execute exactly one saved Action worker tool with structured inputs, without a model. Discover worker_tools first. Requires invokeActions. Cannot change tools, connection, sender or permissions. Supply a unique idempotencyKey for each intended write and reuse it for transport retries. A repeated key never resends: it replays the first answer, so a refusal with error.retryable true is retried later under a new key. For in_progress poll worker_tool_invocation. outcome_unknown means the app may have completed the action: do not automatically retry or issue a new key. Generic write receipts retain confirmation but not private app response content. Never resend to recover a lost response body. The answer is {invocationId, tool, status, result, error, replayed, contractVersion} with status succeeded | denied | failed | in_progress | outcome_unknown; invocationId is set on writes only (reads leave no receipt). Refusals before the app is reached use the {error, message, code} envelope: 403 tool_not_exposed, 409 tool_contract_changed (the owner must re-save the selection), 409 idempotency_conflict (same key, different arguments), 400 invalid_request (arguments that do not match inputSchema).\" + INVOKE_SCOPE_NOTE,\n schema: {\n ...worker,\n toolName: z.string().min(1).max(128)\n .describe(\"A tools[].name from worker_tools for this worker, exactly.\"),\n contractVersion: z.literal(1).default(1).describe(\"Always 1.\"),\n arguments: z.record(z.unknown())\n .describe(\"The tool's inputs, exactly as its inputSchema in worker_tools declares them, with their JSON types. Send {} for a tool that takes none.\"),\n idempotencyKey: z.string().min(1).max(128).regex(/^[!-~]+$/).optional()\n .describe(\"Required on a write tool (readOnly false in worker_tools): 1-128 printable characters, one per intended write. The same key with the same arguments returns the stored receipt without calling the app again; with different arguments it is 409 idempotency_conflict. Reads need none.\"),\n },\n bodyBuilder: p => ({ contractVersion: p.contractVersion, arguments: p.arguments }),\n headerBuilder: (p): Record<string, string> => p.idempotencyKey ? { \"Idempotency-Key\": String(p.idempotencyKey) } : {},\n requestTimeoutMs: () => 90_000, annotations: { ...TRIGGER, idempotentHint: false },\n },\n {\n name: \"worker_tool_invocation\", title: \"Read Action Invocation\", auth: \"manager\", method: \"get\",\n path: p => `/api/manage/workers/${p.tokenId}/tool-invocations/${p.invocationId}`, paramFilter: () => ({}), strictInput: true,\n description: \"Read an Action invocation's status and effect references. Requires invokeActions. Does not execute or retry anything. Unknown outcomes must not be automatically resent. A write still in_progress after two minutes reads as outcome_unknown: check the app itself before deciding anything.\" + INVOKE_SCOPE_NOTE,\n schema: {\n ...worker,\n invocationId: z.string().uuid().describe(\"The invocationId a worker_tool_call answer carried for a write.\"),\n },\n annotations: READ_ONLY,\n },\n];\n"]}
@@ -19,6 +19,7 @@ export const createDecisionWorker = {
19
19
  schema: {
20
20
  requestId: z.string().min(1).max(128).regex(/^[!-~]+$/).describe("Unique creation id. Reuse with the same body on retries; new id creates a new worker."),
21
21
  name: z.string().min(1).max(100),
22
+ timeZoneId: z.string().trim().min(1).max(64).optional().describe("The worker's timezone, as an IANA id such as America/New_York. Ask the worker creator for it if it is not already known; never guess it from connected calendars or the server's clock. Omitted means UTC."),
22
23
  source: z.object({
23
24
  recipe: z.enum(["email-previews", "calendar-events", "sheets-rows"]),
24
25
  args: z.record(z.unknown()).optional().describe("Arguments from the discovered recipe's argsSchema. No placeholders. Sheets requires fileId, range and columns."),
@@ -1 +1 @@
1
- {"version":3,"file":"decision-authoring.js","sourceRoot":"","sources":["../../src/descriptors/decision-authoring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAuB,MAAM,YAAY,CAAC;AAEzD,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;AAC5E,MAAM,IAAI,GAAG,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,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AC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;QACzF,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAChF,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;KAC3E;IACD,WAAW,EAAE,EAAE,GAAG,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE;CACjD,CAAC","sourcesContent":["import { z } from \"../zod.js\";\nimport { CREATE, type ToolDescriptor } from \"./types.js\";\n\nconst key = z.string().regex(/^(?=.{1,40}$)[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/);\nconst base = { key, instructions: z.string().min(1).max(4000) };\nexport const decisionQuestion = z.discriminatedUnion(\"type\", [\n z.object({ ...base, type: z.literal(\"choice\"), options: z.record(key, z.string().min(1).max(200)).refine(options => {\n const entries = Object.entries(options);\n return entries.length >= 1 && entries.length <= 20 && entries.every(([name, description]) => name !== \"unclear\" && description.trim().length > 0 && name.length + 3 + description.length <= 200);\n }, \"Provide 1–20 options excluding unclear; each name and description must fit in 200 characters including the separator.\") }).strict(),\n z.object({ ...base, type: z.literal(\"score\"), levels: z.array(z.string().min(1).max(200)).min(2).max(10) }).strict(),\n z.object({ ...base, type: z.literal(\"noul\"), trueMeaning: z.string().max(200).optional(), falseMeaning: z.string().max(200).optional() }).strict(),\n]);\n\nexport const createDecisionWorker: ToolDescriptor = {\n name: \"decision_worker_create\",\n title: \"Create Decision Worker\",\n description: \"Create a reusable classifier to categorize, score, filter or triage connected data. First discover source recipes with kit_app_tools(purpose:'decision'); kit_authoring_guide(section:'decision') has examples. Creates a private kit and worker atomically; optionally deploys, never runs. Questions and source mappings compile deterministically into the ordinary decision specification. Source filters do not narrow the recipe's read permissions. Requires publishKits + installKits, plus manageDeployments when deploy:true. Reuse requestId and the identical body to recover the original receipt after a timeout; changed body returns 409. Returns tokenId for lifecycle commands, stable workerId, kitSlug, readiness, deployment/error and exact nextCall arguments. Follow nextCall, then worker_run/run_get. A deployment error means the worker already exists. Choice adds unclear automatically; setup answers adjust categories/levels later. Creation returns no worker API secret. For arbitrary decision sources or routed actions use kit_validate → kit_publish(private) → kit_install.\",\n auth: \"manager\", method: \"post\", path: \"/api/manage/decision-workers\",\n strictInput: true,\n schema: {\n requestId: z.string().min(1).max(128).regex(/^[!-~]+$/).describe(\"Unique creation id. Reuse with the same body on retries; new id creates a new worker.\"),\n name: z.string().min(1).max(100),\n source: z.object({\n recipe: z.enum([\"email-previews\", \"calendar-events\", \"sheets-rows\"]),\n args: z.record(z.unknown()).optional().describe(\"Arguments from the discovered recipe's argsSchema. No placeholders. Sheets requires fileId, range and columns.\"),\n }).strict(),\n questions: z.array(decisionQuestion).min(1).max(8).describe(\"Independent questions with unique keys. Choice: 1–20 options, excluding reserved unclear; name + description ≤200 chars. Score: ordered levels, lowest first. Noul: probability of a statement.\"),\n confidenceFloor: z.number().min(0).max(1).describe(\"Required confidence threshold; uncertain choices/scores are flagged, not omitted. Not an accuracy guarantee.\"),\n maxItems: z.number().int().min(1).max(50).default(20),\n operatorId: z.string().uuid().optional(),\n deploy: z.boolean().default(false).describe(\"Create a hosted deployment too. Does not execute a run.\"),\n decisionProfileId: z.string().min(1).max(64).optional().describe(\"Default classifier for the kit and worker: a profileId from models_list.decisionProfiles. Omit for Jev. Independent of deployment and spend settings.\"),\n maxUsdPerRun: z.number().min(0.01).max(1000).optional(),\n maxUsdPerDay: z.number().min(0.01).max(10000).optional(),\n },\n outputSchema: {\n tokenId: z.number().int().positive().describe(\"Use with existing worker tools and CLI commands.\"),\n workerId: z.string().uuid(), kitSlug: z.string(), modelType: z.literal(\"decision\"), workerUrl: z.string(),\n readiness: z.record(z.unknown()).nullable(), deployment: z.record(z.unknown()).nullable(),\n deploymentError: z.record(z.unknown()).nullable(), warnings: z.array(z.string()),\n nextCall: z.object({ tool: z.string(), arguments: z.record(z.unknown()) }),\n },\n annotations: { ...CREATE, idempotentHint: true },\n};\n"]}
1
+ {"version":3,"file":"decision-authoring.js","sourceRoot":"","sources":["../../src/descriptors/decision-authoring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAuB,MAAM,YAAY,CAAC;AAEzD,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;AAC5E,MAAM,IAAI,GAAG,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC3D,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;YACjH,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACxC,OAAO,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,OAAO,CAAC,MAAM,IAAI,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,WAAW,CAA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AC;KAC3E;IACD,WAAW,EAAE,EAAE,GAAG,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE;CACjD,CAAC","sourcesContent":["import { z } from \"../zod.js\";\nimport { CREATE, type ToolDescriptor } from \"./types.js\";\n\nconst key = z.string().regex(/^(?=.{1,40}$)[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/);\nconst base = { key, instructions: z.string().min(1).max(4000) };\nexport const decisionQuestion = z.discriminatedUnion(\"type\", [\n z.object({ ...base, type: z.literal(\"choice\"), options: z.record(key, z.string().min(1).max(200)).refine(options => {\n const entries = Object.entries(options);\n return entries.length >= 1 && entries.length <= 20 && entries.every(([name, description]) => name !== \"unclear\" && description.trim().length > 0 && name.length + 3 + description.length <= 200);\n }, \"Provide 1–20 options excluding unclear; each name and description must fit in 200 characters including the separator.\") }).strict(),\n z.object({ ...base, type: z.literal(\"score\"), levels: z.array(z.string().min(1).max(200)).min(2).max(10) }).strict(),\n z.object({ ...base, type: z.literal(\"noul\"), trueMeaning: z.string().max(200).optional(), falseMeaning: z.string().max(200).optional() }).strict(),\n]);\n\nexport const createDecisionWorker: ToolDescriptor = {\n name: \"decision_worker_create\",\n title: \"Create Decision Worker\",\n description: \"Create a reusable classifier to categorize, score, filter or triage connected data. First discover source recipes with kit_app_tools(purpose:'decision'); kit_authoring_guide(section:'decision') has examples. Creates a private kit and worker atomically; optionally deploys, never runs. Questions and source mappings compile deterministically into the ordinary decision specification. Source filters do not narrow the recipe's read permissions. Requires publishKits + installKits, plus manageDeployments when deploy:true. Reuse requestId and the identical body to recover the original receipt after a timeout; changed body returns 409. Returns tokenId for lifecycle commands, stable workerId, kitSlug, readiness, deployment/error and exact nextCall arguments. Follow nextCall, then worker_run/run_get. A deployment error means the worker already exists. Choice adds unclear automatically; setup answers adjust categories/levels later. Creation returns no worker API secret. For arbitrary decision sources or routed actions use kit_validate → kit_publish(private) → kit_install.\",\n auth: \"manager\", method: \"post\", path: \"/api/manage/decision-workers\",\n strictInput: true,\n schema: {\n requestId: z.string().min(1).max(128).regex(/^[!-~]+$/).describe(\"Unique creation id. Reuse with the same body on retries; new id creates a new worker.\"),\n name: z.string().min(1).max(100),\n timeZoneId: z.string().trim().min(1).max(64).optional().describe(\"The worker's timezone, as an IANA id such as America/New_York. Ask the worker creator for it if it is not already known; never guess it from connected calendars or the server's clock. Omitted means UTC.\"),\n source: z.object({\n recipe: z.enum([\"email-previews\", \"calendar-events\", \"sheets-rows\"]),\n args: z.record(z.unknown()).optional().describe(\"Arguments from the discovered recipe's argsSchema. No placeholders. Sheets requires fileId, range and columns.\"),\n }).strict(),\n questions: z.array(decisionQuestion).min(1).max(8).describe(\"Independent questions with unique keys. Choice: 1–20 options, excluding reserved unclear; name + description ≤200 chars. Score: ordered levels, lowest first. Noul: probability of a statement.\"),\n confidenceFloor: z.number().min(0).max(1).describe(\"Required confidence threshold; uncertain choices/scores are flagged, not omitted. Not an accuracy guarantee.\"),\n maxItems: z.number().int().min(1).max(50).default(20),\n operatorId: z.string().uuid().optional(),\n deploy: z.boolean().default(false).describe(\"Create a hosted deployment too. Does not execute a run.\"),\n decisionProfileId: z.string().min(1).max(64).optional().describe(\"Default classifier for the kit and worker: a profileId from models_list.decisionProfiles. Omit for Jev. Independent of deployment and spend settings.\"),\n maxUsdPerRun: z.number().min(0.01).max(1000).optional(),\n maxUsdPerDay: z.number().min(0.01).max(10000).optional(),\n },\n outputSchema: {\n tokenId: z.number().int().positive().describe(\"Use with existing worker tools and CLI commands.\"),\n workerId: z.string().uuid(), kitSlug: z.string(), modelType: z.literal(\"decision\"), workerUrl: z.string(),\n readiness: z.record(z.unknown()).nullable(), deployment: z.record(z.unknown()).nullable(),\n deploymentError: z.record(z.unknown()).nullable(), warnings: z.array(z.string()),\n nextCall: z.object({ tool: z.string(), arguments: z.record(z.unknown()) }),\n },\n annotations: { ...CREATE, idempotentHint: true },\n};\n"]}
@@ -3,7 +3,7 @@ export type { HttpMethod, ToolAnnotations, ToolDescriptor } from "./types.js";
3
3
  export { manageDescriptors } from "./manage.js";
4
4
  export { directoryDescriptors, kitDetailData, kitDetailFooter, kitListData, listFooter, publisherPageData, publisherPageFooter, } from "./directory.js";
5
5
  import type { ToolDescriptor } from "./types.js";
6
- /** Every descriptor this package ships — 95 manager + 9 anonymous. */
6
+ /** Every descriptor this package ships — 97 manager + 9 anonymous. */
7
7
  export declare const allDescriptors: readonly ToolDescriptor[];
8
8
  /** Look a descriptor up by its tool name. */
9
9
  export declare function byName(name: string): ToolDescriptor | undefined;
@@ -3,7 +3,7 @@ export { manageDescriptors } from "./manage.js";
3
3
  export { directoryDescriptors, kitDetailData, kitDetailFooter, kitListData, listFooter, publisherPageData, publisherPageFooter, } from "./directory.js";
4
4
  import { manageDescriptors } from "./manage.js";
5
5
  import { directoryDescriptors } from "./directory.js";
6
- /** Every descriptor this package ships — 95 manager + 9 anonymous. */
6
+ /** Every descriptor this package ships — 97 manager + 9 anonymous. */
7
7
  export const allDescriptors = [
8
8
  ...manageDescriptors,
9
9
  ...directoryDescriptors,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,MAAM,EACN,SAAS,EACT,OAAO,EACP,MAAM,GACP,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,sEAAsE;AACtE,MAAM,CAAC,MAAM,cAAc,GAA8B;IACvD,GAAG,iBAAiB;IACpB,GAAG,oBAAoB;CACxB,CAAC;AAEF,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAEpE,6CAA6C;AAC7C,MAAM,UAAU,MAAM,CAAC,IAAY;IACjC,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["export {\n CREATE,\n DELETE,\n READ_ONLY,\n TRIGGER,\n UPDATE,\n} from \"./types.js\";\nexport type { HttpMethod, ToolAnnotations, ToolDescriptor } from \"./types.js\";\n\nexport { manageDescriptors } from \"./manage.js\";\nexport {\n directoryDescriptors,\n kitDetailData,\n kitDetailFooter,\n kitListData,\n listFooter,\n publisherPageData,\n publisherPageFooter,\n} from \"./directory.js\";\n\nimport type { ToolDescriptor } from \"./types.js\";\nimport { manageDescriptors } from \"./manage.js\";\nimport { directoryDescriptors } from \"./directory.js\";\n\n/** Every descriptor this package ships — 95 manager + 9 anonymous. */\nexport const allDescriptors: readonly ToolDescriptor[] = [\n ...manageDescriptors,\n ...directoryDescriptors,\n];\n\nconst byNameIndex = new Map(allDescriptors.map((d) => [d.name, d]));\n\n/** Look a descriptor up by its tool name. */\nexport function byName(name: string): ToolDescriptor | undefined {\n return byNameIndex.get(name);\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,MAAM,EACN,SAAS,EACT,OAAO,EACP,MAAM,GACP,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,sEAAsE;AACtE,MAAM,CAAC,MAAM,cAAc,GAA8B;IACvD,GAAG,iBAAiB;IACpB,GAAG,oBAAoB;CACxB,CAAC;AAEF,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAEpE,6CAA6C;AAC7C,MAAM,UAAU,MAAM,CAAC,IAAY;IACjC,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["export {\n CREATE,\n DELETE,\n READ_ONLY,\n TRIGGER,\n UPDATE,\n} from \"./types.js\";\nexport type { HttpMethod, ToolAnnotations, ToolDescriptor } from \"./types.js\";\n\nexport { manageDescriptors } from \"./manage.js\";\nexport {\n directoryDescriptors,\n kitDetailData,\n kitDetailFooter,\n kitListData,\n listFooter,\n publisherPageData,\n publisherPageFooter,\n} from \"./directory.js\";\n\nimport type { ToolDescriptor } from \"./types.js\";\nimport { manageDescriptors } from \"./manage.js\";\nimport { directoryDescriptors } from \"./directory.js\";\n\n/** Every descriptor this package ships — 97 manager + 9 anonymous. */\nexport const allDescriptors: readonly ToolDescriptor[] = [\n ...manageDescriptors,\n ...directoryDescriptors,\n];\n\nconst byNameIndex = new Map(allDescriptors.map((d) => [d.name, d]));\n\n/** Look a descriptor up by its tool name. */\nexport function byName(name: string): ToolDescriptor | undefined {\n return byNameIndex.get(name);\n}\n"]}
@@ -1,4 +1,4 @@
1
- // The 95 authenticated fleet-management tools, as pure descriptors. The
1
+ // The 97 authenticated fleet-management tools, as pure descriptors. The
2
2
  // descriptions ARE the product surface: they are served verbatim to MCP
3
3
  // clients (and any future CLI help), so every contract nuance an agent must
4
4
  // not get wrong is taught here.
@@ -7,6 +7,7 @@ import { appDiscoveryDescriptors } from "./app-discovery.js";
7
7
  import { compactDecisionReceipt } from "./decision-receipt.js";
8
8
  import { createDecisionWorker } from "./decision-authoring.js";
9
9
  import { onboardingDescriptors } from "./onboarding.js";
10
+ import { supportDescriptors } from "./support.js";
10
11
  import { z } from "../zod.js";
11
12
  import { CREATE, DELETE, READ_ONLY, TRIGGER, UPDATE } from "./types.js";
12
13
  // The graded-outcome vocabulary, taught wherever a score can be read or written.
@@ -413,6 +414,20 @@ const deleteMemoryItem = {
413
414
  annotations: DELETE,
414
415
  };
415
416
  // ─── Schedules ──────────────────────────────────────────────────────────────
417
+ const setWorkerTimeZone = {
418
+ name: "worker_timezone_set",
419
+ title: "Set Worker Timezone",
420
+ description: "Set the worker's own timezone. It decides the worker's local dates, the local times in its app results (calendar events, emails and other apps) and the times in the reports it writes. Use the owner's intended zone, for example America/New_York for Eastern time. Recomputes the next run of every daily schedule that follows the worker; explicit schedule timezone overrides remain unchanged, and a schedule's timezone never changes the worker's. Reports already saved keep their times. Requires the manageSchedules scope. Returns timeZoneId, effectiveTimeZoneId and schedules.",
421
+ auth: "manager",
422
+ method: "put",
423
+ schema: {
424
+ tokenId: z.number().int().min(1).describe(TOKEN_ID_HINT),
425
+ timeZoneId: z.string().max(64).nullable().describe("IANA timezone, such as America/New_York. Required: send null or an empty string to choose UTC."),
426
+ },
427
+ path: (params) => `${API}/${params.tokenId}/timezone`,
428
+ bodyBuilder: (params) => ({ timeZoneId: params.timeZoneId }),
429
+ annotations: UPDATE,
430
+ };
416
431
  const listSchedules = {
417
432
  name: "schedules_list",
418
433
  title: "List Schedules",
@@ -435,11 +450,16 @@ const SCHEDULE_GATE_HINT = " Two plan walls return 402 {error:'feature_gated', f
435
450
  // never overlaps itself, whatever the plan allows: two copies of the same
436
451
  // scheduled job side by side duplicate its side effects.
437
452
  const SCHEDULE_OVERLAP_NOTE = " A schedule never overlaps itself: a fire that finds any run of the worker in flight lands as a Skipped receipt (skipReason ConcurrencyLimit) whatever the plan's per-worker concurrency allows — space the schedule wider than a run takes. Runs started on demand may run alongside a scheduled one, up to the plan's limit.";
453
+ // A schedule's zone and the worker's zone are separate settings. Taught on both
454
+ // schedule writes, so an agent fixing a report's times does not reach for the
455
+ // schedule: that only moves when it fires.
456
+ const SCHEDULE_ZONE_NOTE = " A schedule's own timeZoneId only decides when that schedule fires: the worker's local dates and reports follow the worker's timezone, which worker_timezone_set changes.";
438
457
  const createSchedule = {
439
458
  name: "schedule_create",
440
459
  title: "Create Schedule",
441
460
  description: "Create a schedule for the worker. Per-type required fields: " + SCHEDULE_TYPE_HINT +
442
- " Omit timeZoneId to follow the worker's own time zone (the normal case). An Action worker (modelType none) takes no schedules: it is called, never run. Requires the manageSchedules scope." +
461
+ " Omit timeZoneId to follow the worker's own time zone (the normal case)." + SCHEDULE_ZONE_NOTE +
462
+ " An Action worker (modelType none) takes no schedules: it is called, never run. Requires the manageSchedules scope." +
443
463
  SCHEDULE_GATE_HINT +
444
464
  SCHEDULE_OVERLAP_NOTE,
445
465
  auth: "manager",
@@ -469,7 +489,8 @@ const createSchedule = {
469
489
  const updateSchedule = {
470
490
  name: "schedule_update",
471
491
  title: "Update Schedule",
472
- description: "Edit a schedule (partial — omitted fields stay unchanged; timeZoneId='' clears the override so the schedule follows the worker's zone again). nextRunUtc is recomputed on every edit. Per-type field rules: " +
492
+ description: "Edit a schedule (partial — omitted fields stay unchanged; timeZoneId='' clears the override so the schedule follows the worker's zone again). nextRunUtc is recomputed on every edit." +
493
+ SCHEDULE_ZONE_NOTE + " Per-type field rules: " +
473
494
  SCHEDULE_TYPE_HINT + " Requires manageSchedules." + SCHEDULE_GATE_HINT + SCHEDULE_OVERLAP_NOTE,
474
495
  auth: "manager",
475
496
  method: "patch",
@@ -847,6 +868,7 @@ const kitInstall = {
847
868
  operatorId: z.string().uuid().optional().describe("Operator (workspace) to install into. Omit to use the account's default operator."),
848
869
  title: z.string().max(100).optional().describe("Name for the new worker (≤100 chars). Omit to use the kit's name."),
849
870
  avatar: z.string().max(40).optional().describe("Avatar slug for the new worker. Omit for the default."),
871
+ timeZoneId: z.string().trim().min(1).max(64).optional().describe("The worker's timezone, as an IANA id such as America/New_York: it decides the worker's local dates and reports, and is set before the kit's schedules are created. Ask the worker creator for it if it is not already known; never guess it from connected calendars or the server's clock. Omitted means UTC. install.effectiveTimeZoneId in the response is the zone applied."),
850
872
  slackConnectionId: z.number().int().positive().optional().describe("Action kits: pin a Slack bot from actionConnections in the install preview. No model or deployment is needed."),
851
873
  githubSelection: GITHUB_SELECTION.optional().describe("Explicit GitHub targets for the new worker. Discover them with app_github_accounts, app_github_repos and app_github_branches (discoverAppResources scope). connectionId also appears as githubAccounts[].id in kit_install_preview. Use repositoryMode 'selected' with 1-500 stable repositoryIds for a specific job. 'all' includes future repositories granted to that account: choose it only when intended. accounts:[] leaves setup for later. Required for a GitHub kit when the key has discoverAppResources; legacy keys retain the single-account fallback. Discovery and branch inputs do not grant extra access."),
852
874
  categoryChoices: z.array(z.object({
@@ -871,6 +893,7 @@ const kitInstall = {
871
893
  operatorId: params.operatorId,
872
894
  title: params.title,
873
895
  avatar: params.avatar,
896
+ timeZoneId: params.timeZoneId,
874
897
  githubSelection: params.githubSelection,
875
898
  categoryChoices: params.categoryChoices,
876
899
  inputs: params.inputs,
@@ -1173,7 +1196,7 @@ const undeployWorker = {
1173
1196
  const getWorkerPermissions = {
1174
1197
  name: "worker_permissions_get",
1175
1198
  title: "Get Worker Permissions",
1176
- description: "What the worker may touch, in the kit-authoring vocabulary: apps[] ({code, operations, visibleFields, allowAll, writeEnabled, providers, …} — the same shape a kit's content.apps takes), categorySlots[], contactAllowAll, blockedSenderCategories, timeframePastDays / timeframeFutureDays, maxChildTokens, and ruleCounts (per rule table, PRESENCE only — rule values never leave the worker). Read-only: permissions are never written through this surface; they change through a kit (kit_publish private, then kit_install) or in the dashboard. ruleCounts decides between the two ways to multiply a worker: worker_clone carries the rules, kit_publish from sourceWorkerId never does — so a worker with rules would install MORE permissively as a kit than it runs today. Requires the readWorkers scope.",
1199
+ description: "What the worker may touch, in the kit-authoring vocabulary: apps[] ({code, operations, visibleFields, allowAll, writeEnabled, providers, …} — the same shape a kit's content.apps takes), categorySlots[], contactAllowAll, blockedSenderCategories, timeframePastDays / timeframeFutureDays, maxChildTokens, and ruleCounts (per rule table, PRESENCE only — rule values never leave the worker). Read-only: no tool changes a worker's permissions. To add an app or an operation, tell the user what to switch on under the worker's Apps & access on the dashboard, then read this again to confirm the change. A new worker with different permissions comes from a kit instead (kit_publish private, then kit_install). ruleCounts decides between the two ways to multiply a worker: worker_clone carries the rules, kit_publish from sourceWorkerId never does — so a worker with rules would install MORE permissively as a kit than it runs today. Requires the readWorkers scope.",
1177
1200
  auth: "manager",
1178
1201
  method: "get",
1179
1202
  schema: {
@@ -1632,6 +1655,7 @@ const deleteMcpServer = {
1632
1655
  export const manageDescriptors = [
1633
1656
  ...appDiscoveryDescriptors,
1634
1657
  ...onboardingDescriptors,
1658
+ ...supportDescriptors,
1635
1659
  createDecisionWorker,
1636
1660
  ...actionDescriptors,
1637
1661
  setWorkerDecision,
@@ -1657,6 +1681,7 @@ export const manageDescriptors = [
1657
1681
  addMemoryItem,
1658
1682
  updateMemoryItem,
1659
1683
  deleteMemoryItem,
1684
+ setWorkerTimeZone,
1660
1685
  listSchedules,
1661
1686
  createSchedule,
1662
1687
  updateSchedule,