@workerkit/core 0.3.12 → 0.3.13
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 +17 -7
- package/README.md +31 -8
- package/dist/descriptors/actions.js +47 -23
- package/dist/descriptors/actions.js.map +1 -1
- package/dist/descriptors/decision-authoring.js +1 -1
- package/dist/descriptors/decision-authoring.js.map +1 -1
- package/dist/descriptors/directory.js +4 -4
- package/dist/descriptors/directory.js.map +1 -1
- package/dist/descriptors/manage.js +20 -20
- package/dist/descriptors/manage.js.map +1 -1
- package/docs/hybrid-workers.md +7 -5
- package/package.json +1 -1
|
@@ -47,12 +47,12 @@ const getKeyInfo = {
|
|
|
47
47
|
const listWorkers = {
|
|
48
48
|
name: "workers_list",
|
|
49
49
|
title: "List Workers",
|
|
50
|
-
description: "List the AI workers on this account with live status: title, avatar, status (active|paused|expired), isEnabled, expiresAt, readiness (status ready|blocked with the actionable issues — the same block worker_get carries), deployment (null = this worker is NOT on the hosted runtime and will never run, whatever readiness says; worker_deploy fixes that), lastRun (the newest SETTLED run: runId, outcome succeeded|attention|failed|awaitingInput|skipped|canceled, skipReason, errorCode — in-flight runs never appear here), schedule rollup (total/enabled/nextRunUtc), and live state (isRunning, inFlightRuns, currentRunId — poll run_get with currentRunId to watch it). FILTERS, all optional and ANDed: status, deployed, readiness, q (title substring); an unknown status/readiness value is a 400 invalid_filter, never an empty page. totalWorkers is the count BEFORE filtering: 0 means nothing is installed on this account yet (shortlist a kit with kits_search on the Directory server, kit_install it with deploy:true), non-zero with an empty workers[] means the filter matched nothing. For 'what is wrong with this fleet' call fleet_health instead of scanning this list. Compute elapsed/next-run times against the response's serverTimeUtc, never your own clock. IMPORTANT: lastRun.resultText is the report the worker itself wrote and requires the manager key to hold the readRuns scope IN ADDITION to readWorkers — with readWorkers only it is null, which does NOT mean the run produced no report; check your key's scopes before concluding anything from a null. Scope model for every tool here: a 403 OPERATION_NOT_ALLOWED names the missing scope — the key must be re-minted with broader scopes by an account admin at https://workerkit.ai (do not retry the call).",
|
|
50
|
+
description: "List the AI workers on this account with live status: title, avatar, status (active|paused|expired), isEnabled, expiresAt, readiness (status ready|blocked with the actionable issues — the same block worker_get carries), modelType (language | decision | hybrid | none — see worker_get), deployment (null = this worker is NOT on the hosted runtime and will never run, whatever readiness says; worker_deploy fixes that — except on an Action worker, modelType none, which is never deployed or run: worker_tools lists its tools and worker_tool_call calls one), lastRun (the newest SETTLED run: runId, outcome succeeded|attention|failed|awaitingInput|skipped|canceled, skipReason, errorCode — in-flight runs never appear here), schedule rollup (total/enabled/nextRunUtc), and live state (isRunning, inFlightRuns, currentRunId — poll run_get with currentRunId to watch it). FILTERS, all optional and ANDed: status, deployed, readiness, q (title substring); an unknown status/readiness value is a 400 invalid_filter, never an empty page. totalWorkers is the count BEFORE filtering: 0 means nothing is installed on this account yet (shortlist a kit with kits_search on the Directory server, kit_install it with deploy:true), non-zero with an empty workers[] means the filter matched nothing. For 'what is wrong with this fleet' call fleet_health instead of scanning this list. Compute elapsed/next-run times against the response's serverTimeUtc, never your own clock. IMPORTANT: lastRun.resultText is the report the worker itself wrote and requires the manager key to hold the readRuns scope IN ADDITION to readWorkers — with readWorkers only it is null, which does NOT mean the run produced no report; check your key's scopes before concluding anything from a null. Scope model for every tool here: a 403 OPERATION_NOT_ALLOWED names the missing scope — the key must be re-minted with broader scopes by an account admin at https://workerkit.ai (do not retry the call).",
|
|
51
51
|
auth: "manager",
|
|
52
52
|
method: "get",
|
|
53
53
|
schema: {
|
|
54
54
|
status: z.enum(["active", "paused", "expired"]).optional().describe("Only workers in this lifecycle state. paused = stopped with worker_set_enabled; expired = the key's expiry passed. Omit for all."),
|
|
55
|
-
deployed: z.boolean().optional().describe("true = only workers on the hosted runtime (the ones that can run); false = only workers without a deployment. Omit for both."),
|
|
55
|
+
deployed: z.boolean().optional().describe("true = only workers on the hosted runtime (the ones that can run); false = only workers without a deployment, which includes every Action worker (modelType none: never deployed, called with worker_tool_call). Omit for both."),
|
|
56
56
|
readiness: z.enum(["ready", "blocked"]).optional().describe("ready = configuration lets it run hosted; blocked = something actionable is missing (an app connection, an instruction, an identity). Omit for both."),
|
|
57
57
|
q: z.string().max(100).optional().describe("Case-insensitive substring of the worker's title."),
|
|
58
58
|
},
|
|
@@ -62,7 +62,7 @@ const listWorkers = {
|
|
|
62
62
|
const fleetHealth = {
|
|
63
63
|
name: "fleet_health",
|
|
64
64
|
title: "Fleet Health",
|
|
65
|
-
description: "The fleet's rot in ONE call — the digest to brief from instead of crawling workers_list + worker_get + runs_feed: counts (workers, active, paused, expired, runsInFlight, and one per section: blocked, notDeployed, overdueSchedules, awaitingInput, lastRunAttention) plus five typed sections, each row naming the worker (workerId, tokenId, title) and what to do. blocked[] = active workers whose readiness is blocked, with issues[] (app_not_connected → app_connect on the worker's operator or the human at the dashboard; no_instruction → instruction_set; no_identity → the dashboard). notDeployed[] = active workers with NO hosted deployment:
|
|
65
|
+
description: "The fleet's rot in ONE call — the digest to brief from instead of crawling workers_list + worker_get + runs_feed: counts (workers, active, paused, expired, runsInFlight, and one per section: blocked, notDeployed, overdueSchedules, awaitingInput, lastRunAttention) plus five typed sections, each row naming the worker (workerId, tokenId, title) and what to do. blocked[] = active workers whose readiness is blocked, with issues[] (app_not_connected → app_connect on the worker's operator or the human at the dashboard; no_instruction → instruction_set; no_identity → the dashboard; an Action worker's action_connection_unavailable / action_tools_unavailable → its owner, in the dashboard). notDeployed[] = active workers with NO hosted deployment (Action workers, modelType none, are never deployed and never listed here): these fire no schedule and refuse worker_run with not_deployed, however ready they look — enabledSchedules > 0 there is a schedule that will never run until worker_deploy; readiness says whether deploying is enough. overdueSchedules[] = deployed workers whose earliest enabled schedule was due more than 15 minutes ago and was never claimed (nextRunUtc, overdueMinutes, deploymentStatus — Paused explains it by itself: deployment_update with resume). awaitingInput[] = runs that ended by ASKING their owner and are still waiting (questionId, runId, askedAtUtc, expiresAtUtc, chainDepth, and question — a 300-char preview that needs readRuns and is NULL without it: that null is a scope gap, not an empty question; run_question has the full text and options, run_answer takes the runId). lastRunAttention[] = active workers whose newest settled run was failed (errorCode), attention (succeeded with friction — denials, tool errors, reported issues) or skipped (skipReason says why; InsufficientCredits means the wallet, TokenDisabled/DailyRunCap/FleetSpendCap name themselves). Paused and expired workers are COUNTED, never listed: stopping a worker is a decision, not rot. Empty sections are the healthy answer. Measure every age against serverTimeUtc. Requires the readWorkers scope.",
|
|
66
66
|
auth: "manager",
|
|
67
67
|
method: "get",
|
|
68
68
|
schema: {},
|
|
@@ -82,7 +82,7 @@ const accountUsage = {
|
|
|
82
82
|
const getWorker = {
|
|
83
83
|
name: "worker_get",
|
|
84
84
|
title: "Get Worker",
|
|
85
|
-
description: "One worker in full: everything workers_list shows (including readiness: status ready|blocked with actionable issues — worker_inactive, no_identity, app_not_connected incl. candidateProviders, no_instruction) plus timeZoneId, maxRunsPerDay, kit provenance (templateId/slug/name), hasInstruction, modelType ('language' | 'decision' — a decision
|
|
85
|
+
description: "One worker in full: everything workers_list shows (including readiness: status ready|blocked with actionable issues — worker_inactive, no_identity, app_not_connected incl. candidateProviders, no_instruction, and on an Action worker action_connection_unavailable / action_tools_unavailable; canRun says whether a hosted run could start, canInvoke whether an Action worker's tools can be called) plus timeZoneId, maxRunsPerDay, kit provenance (templateId/slug/name), hasInstruction, modelType ('language' | 'decision' | 'hybrid' | 'none' — language runs an instruction on a model; decision runs a routing table instead: instruction_get reads it, worker_run runs it, and decisionPendingSetup names any install question still blank; hybrid classifies, then hands the selected items to one language-model agent; 'none' is an ACTION worker: selected app tools, no model, never deployed or run (worker_run and worker_deploy answer 400 action_worker_requires_invoke) — call it with worker_tools, then worker_tool_call), isProtected, jobSentence, apps[] (every app the worker has enabled with connection connected|needs_connection|unknown and the providers serving it — the per-worker view of apps_list; an app at needs_connection is fixed with app_connect on the worker's operator or on the dashboard), deployment (status + modelSlug, or NULL WHEN THE WORKER IS NOT DEPLOYED — an undeployed worker never runs, whatever readiness says, because readiness judges configuration and deployment is what puts it on the runtime; fix with worker_deploy, except on an Action worker, whose deployment is always null), and 30-day activity (runs by outcome, success rate, cost; null while hosted runs are not enabled for the environment).",
|
|
86
86
|
auth: "manager",
|
|
87
87
|
method: "get",
|
|
88
88
|
schema: {
|
|
@@ -100,7 +100,7 @@ const runWorker = {
|
|
|
100
100
|
requestTimeoutMs: (params) => typeof params.waitSeconds === "number"
|
|
101
101
|
? Math.max(30_000, (Math.min(55, Math.max(0, params.waitSeconds)) + 5) * 1000) : undefined,
|
|
102
102
|
title: "Run Worker Now",
|
|
103
|
-
description: "Trigger the worker to run now (recorded as an API-triggered run, attributed to the manager key's minter). The response is the minted run's RECEIPT — read status before assuming it ran: policy rejections (kill switch, usage window, daily run/spend cap, concurrency, wallet credits, readiness, or a rejected BYOK provider key) come back as HTTP 200 with status Skipped and a skipReason telling the story; that is a normal receipt, NOT an error. Most skips clear on their own (a cap resets, concurrency frees up, credits top up) — but skipReason 'ByokKeyInvalid' / errorCode 'byok_key_invalid' means the ACCOUNT's own model-provider API key was rejected by the provider, arrives with errorDetail null (no prose), and is owner-fixable ONLY: never retry it, report it to the human so they can re-add or remove the key. Structural refusals are 409 (not_deployed, deployment_paused, deployment_suspended, model_unavailable) and 404 for an unknown worker; run-endpoint errors use the {error, message} envelope where error IS the snake_case code. prompt = what to do THIS run; omit it and the worker runs on its standing instructions. Rate limit: 30 run-triggers per minute per ACCOUNT (all of this account's keys and clients share it; other accounts do not affect you). On a 429 back off for the Retry-After — never tighten a loop in response. To fan one prompt across many workers, run_bulk takes up to 20 in one call on a window of its own. Runs in flight per worker are bounded by the account's plan (Free 5, Pro 20, Team 50); at that limit this answers a Skipped receipt with skipReason ConcurrencyLimit. The worker's model type (worker_get → modelType) decides which fields apply: a LANGUAGE worker takes prompt and modelSlug; a DECISION worker runs its own routing table and takes neither (409 not_language_worker), taking sourceArgs / answers / maxItems instead — and sending those to a language worker is 409 not_decision_worker." +
|
|
103
|
+
description: "Trigger the worker to run now (recorded as an API-triggered run, attributed to the manager key's minter). The response is the minted run's RECEIPT — read status before assuming it ran: policy rejections (kill switch, usage window, daily run/spend cap, concurrency, wallet credits, readiness, or a rejected BYOK provider key) come back as HTTP 200 with status Skipped and a skipReason telling the story; that is a normal receipt, NOT an error. Most skips clear on their own (a cap resets, concurrency frees up, credits top up) — but skipReason 'ByokKeyInvalid' / errorCode 'byok_key_invalid' means the ACCOUNT's own model-provider API key was rejected by the provider, arrives with errorDetail null (no prose), and is owner-fixable ONLY: never retry it, report it to the human so they can re-add or remove the key. Structural refusals are 409 (not_deployed, deployment_paused, deployment_suspended, model_unavailable) and 404 for an unknown worker; run-endpoint errors use the {error, message} envelope where error IS the snake_case code. prompt = what to do THIS run; omit it and the worker runs on its standing instructions. Rate limit: 30 run-triggers per minute per ACCOUNT (all of this account's keys and clients share it; other accounts do not affect you). On a 429 back off for the Retry-After — never tighten a loop in response. To fan one prompt across many workers, run_bulk takes up to 20 in one call on a window of its own. Runs in flight per worker are bounded by the account's plan (Free 5, Pro 20, Team 50); at that limit this answers a Skipped receipt with skipReason ConcurrencyLimit. The worker's model type (worker_get → modelType) decides which fields apply: a LANGUAGE worker takes prompt and modelSlug; a DECISION worker runs its own routing table and takes neither (409 not_language_worker), taking sourceArgs / answers / maxItems instead — and sending those to a language worker is 409 not_decision_worker. An ACTION worker (modelType none) is never run: this answers 400 action_worker_requires_invoke, and its tools are called with worker_tool_call instead." +
|
|
104
104
|
DECISION_BLOCK_NOTE + HYBRID_NOTE +
|
|
105
105
|
RUNTIME_NOTE,
|
|
106
106
|
auth: "manager",
|
|
@@ -439,7 +439,7 @@ const createSchedule = {
|
|
|
439
439
|
name: "schedule_create",
|
|
440
440
|
title: "Create Schedule",
|
|
441
441
|
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). Requires the manageSchedules scope." +
|
|
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." +
|
|
443
443
|
SCHEDULE_GATE_HINT +
|
|
444
444
|
SCHEDULE_OVERLAP_NOTE,
|
|
445
445
|
auth: "manager",
|
|
@@ -656,7 +656,7 @@ const deleteDelivery = {
|
|
|
656
656
|
const getInstruction = {
|
|
657
657
|
name: "instruction_get",
|
|
658
658
|
title: "Get Instruction",
|
|
659
|
-
description: "What the worker runs, by its model type (worker_get → modelType). A HYBRID worker returns {modelType, instruction, decision}; read both sections. instruction may be protected; classification answers remain editable. A LANGUAGE worker: its standing instruction — content, jobSentence, whenToUse, description, memoryProfile, selfFactsEnabled, isProtected, currentVersion, timestamps; for a worker installed from a protected kit the metadata is returned and the text is REDACTED (it belongs to the kit's publisher), which is not an error. A DECISION worker: its routing table as sentences (narration: what it reads, what it asks per item, what it does with each answer, what happens when it is not sure), its install questions (setup[]) with the CURRENT answers, the ones still pending (pendingSetup[] — a pending question blocks deploy and run; fill them with instruction_set's answers); the raw spec is withheld for a protected kit's worker. A bare \"Operation completed successfully.\" response means there is neither yet (HTTP 204) — use instruction_set. The version history (instruction_versions, instruction_restore) is language-only: a decision worker's table is versioned with its kit.",
|
|
659
|
+
description: "What the worker runs, by its model type (worker_get → modelType). A HYBRID worker returns {modelType, instruction, decision}; read both sections. instruction may be protected; classification answers remain editable. A LANGUAGE worker: its standing instruction — content, jobSentence, whenToUse, description, memoryProfile, selfFactsEnabled, isProtected, currentVersion, timestamps; for a worker installed from a protected kit the metadata is returned and the text is REDACTED (it belongs to the kit's publisher), which is not an error. A DECISION worker: its routing table as sentences (narration: what it reads, what it asks per item, what it does with each answer, what happens when it is not sure), its install questions (setup[]) with the CURRENT answers, the ones still pending (pendingSetup[] — a pending question blocks deploy and run; fill them with instruction_set's answers); the raw spec is withheld for a protected kit's worker. A bare \"Operation completed successfully.\" response means there is neither yet (HTTP 204) — use instruction_set. An ACTION worker (modelType none) answers 204 (optionsFor answers 409 not_decision_worker): it runs no instruction, and its selected tools are listed with worker_tools. The version history (instruction_versions, instruction_restore) is language-only: a decision worker's table is versioned with its kit.",
|
|
660
660
|
auth: "manager",
|
|
661
661
|
method: "get",
|
|
662
662
|
schema: {
|
|
@@ -691,7 +691,7 @@ const setWorkerDecision = {
|
|
|
691
691
|
const setInstruction = {
|
|
692
692
|
name: "instruction_set",
|
|
693
693
|
title: "Set Instruction",
|
|
694
|
-
description: "Set what the worker runs: content for a LANGUAGE or HYBRID worker's standing instruction, answers for a DECISION or HYBRID worker's classification setup. They are mutually exclusive — sending both is a 400. content replaces the whole instruction: a changed body snapshots the prior version, omitted optional fields stay unchanged, an empty string clears, and a protected kit's worker returns 403 OPERATION_NOT_ALLOWED because that text belongs to its publisher (do not retry). answers fills or changes the questions the routing table binds at every run, so a saved change reaches the next one. A protected kit withholds its spec, never its questions, so answering them is not refused. Requires the manageInstructions scope either way.",
|
|
694
|
+
description: "Set what the worker runs: content for a LANGUAGE or HYBRID worker's standing instruction, answers for a DECISION or HYBRID worker's classification setup. They are mutually exclusive — sending both is a 400. content replaces the whole instruction: a changed body snapshots the prior version, omitted optional fields stay unchanged, an empty string clears, and a protected kit's worker returns 403 OPERATION_NOT_ALLOWED because that text belongs to its publisher (do not retry). answers fills or changes the questions the routing table binds at every run, so a saved change reaches the next one. A protected kit withholds its spec, never its questions, so answering them is not refused. An ACTION worker (modelType none) takes neither and refuses both: only its owner changes its selected tools, in the dashboard. Requires the manageInstructions scope either way.",
|
|
695
695
|
auth: "manager",
|
|
696
696
|
method: "put",
|
|
697
697
|
schema: {
|
|
@@ -822,7 +822,7 @@ const GITHUB_SELECTION = z.object({
|
|
|
822
822
|
const kitInstallPreview = {
|
|
823
823
|
name: "kit_install_preview",
|
|
824
824
|
title: "Preview Kit Install",
|
|
825
|
-
description: "The kit's install form plus this account's current ability to satisfy it — call this BEFORE kit_install and gather every answer it demands. Creates nothing. Requires the installKits scope (403 names it). Returns: requiredInputs (EVERY key is mandatory at install — collect a value for each from the human, keys are exact), memorySetup (questions whose answers become the worker's first memory; only required:true entries are mandatory), modelType, decisionSetup, decisionNarration (a 'decision' kit runs a routing table instead of an instruction, on no model you pick: decisionNarration is that table as sentences — brief the human from it; decisionSetup are its install questions, answered by key in kit_install's decisionAnswers — a required one with no default is mandatory, except an appPick, answerable later with instruction_set; the worker's table acts from its first run), categorySlots (pick ONE member per slot via categoryChoices; each member carries connection — prefer a connected one — and connectionProvider, which when set means also pass categoryChoices[].resourceId picked from operatorResources, ideally one with hasActiveConnection and a matching provider), apps + appsNeedingConnection (the connection state the new worker would START with; installing anyway is allowed — the worker starts blocked and a human finishes at connectAppsUrl), githubAccounts (the operator's connected GitHub accounts; each id is a connectionId for kit_install's githubSelection), githubSetup (requiredScope, discovery tools and explicitSelectionRequired; discover repositories and branches before install, then send githubSelection with selected IDs or accounts:[] to defer setup), operator (which operator the install targets), limits (currentWorkers/maxWorkers — at the cap the install returns 402), kitPageUrl (the human install page). Preview is advisory: the install response's readiness block is the verdict. For the kit's full permissions manifest and instruction use kit_get on the public Directory server.",
|
|
825
|
+
description: "The kit's install form plus this account's current ability to satisfy it — call this BEFORE kit_install and gather every answer it demands. Creates nothing. Requires the installKits scope (403 names it). Returns: requiredInputs (EVERY key is mandatory at install — collect a value for each from the human, keys are exact), memorySetup (questions whose answers become the worker's first memory; only required:true entries are mandatory), modelType ('language' | 'decision' | 'hybrid' | 'none'), decisionSetup, decisionNarration (a 'decision' kit runs a routing table instead of an instruction, on no model you pick: decisionNarration is that table as sentences — brief the human from it; decisionSetup are its install questions, answered by key in kit_install's decisionAnswers — a required one with no default is mandatory, except an appPick, answerable later with instruction_set; the worker's table acts from its first run), actionSpec + actionConnections (a 'none' kit is an Action kit: actionSpec lists the app tools the new worker will expose, with no model or deployment; when they include Slack tools, actionConnections lists the bot connections to pin with kit_install's slackConnectionId), categorySlots (pick ONE member per slot via categoryChoices; each member carries connection — prefer a connected one — and connectionProvider, which when set means also pass categoryChoices[].resourceId picked from operatorResources, ideally one with hasActiveConnection and a matching provider), apps + appsNeedingConnection (the connection state the new worker would START with; installing anyway is allowed — the worker starts blocked and a human finishes at connectAppsUrl), githubAccounts (the operator's connected GitHub accounts; each id is a connectionId for kit_install's githubSelection), githubSetup (requiredScope, discovery tools and explicitSelectionRequired; discover repositories and branches before install, then send githubSelection with selected IDs or accounts:[] to defer setup), operator (which operator the install targets), limits (currentWorkers/maxWorkers — at the cap the install returns 402), kitPageUrl (the human install page). Preview is advisory: the install response's readiness block is the verdict. For the kit's full permissions manifest and instruction use kit_get on the public Directory server.",
|
|
826
826
|
auth: "manager",
|
|
827
827
|
method: "get",
|
|
828
828
|
schema: {
|
|
@@ -839,7 +839,7 @@ const kitInstallPreview = {
|
|
|
839
839
|
const kitInstall = {
|
|
840
840
|
name: "kit_install",
|
|
841
841
|
title: "Install Kit",
|
|
842
|
-
description: "Install a directory kit as a NEW worker on this account. NOT idempotent: every success creates another worker — never retry a success; on a timeout check workers_list (readWorkers) first. Requires the installKits scope. Call kit_install_preview first, then supply every requiredInputs key in inputs (a missing or unknown key is a 400 naming it), required memorySetup answers in memoryAnswers, a DECISION kit's decisionSetup answers in decisionAnswers, and one categoryChoices entry per slot (a member with connectionProvider set also takes resourceId from the preview's operatorResources). CRITICAL — secrets shown ONCE: install.rawKey (the worker's pe_ API key) and install.triggers[].signingSecret can NEVER be read again; hand them to the human before discarding the response. Also returned: readiness (ready | blocked with actionable issues such as app_not_connected + candidateProviders; null means the readiness check failed AFTER the install succeeded — read it via worker_get, never re-install), workerUrl (the worker's dashboard page — hand it to the human) and connectAppsUrl (where the human connects missing apps; agents cannot). 402 {error:'limit_exceeded'} is the plan's worker cap — terminal: the human upgrades, or frees a slot with worker_delete (deleteWorkers scope; permanent, so only with their agreement). Rate: 10 installs/hour per account. Installing does NOT make the worker run: without a deployment it fires no schedule and worker_run refuses it with not_deployed. deploy:true (optionally with deployment: modelSlug from models_list and the ceilings) installs and deploys in ONE call and the response carries deployment; a deploy refused after the install still returns 201 with deploymentError naming the fix — the worker exists, so fix it and call worker_deploy, never re-install. deploy:true needs manageDeployments IN ADDITION to installKits: a key without it is refused up front (403 OPERATION_NOT_ALLOWED) and nothing is created — drop deploy, install, and have the owner re-scope the key before worker_deploy.",
|
|
842
|
+
description: "Install a directory kit as a NEW worker on this account. NOT idempotent: every success creates another worker — never retry a success; on a timeout check workers_list (readWorkers) first. Requires the installKits scope. Call kit_install_preview first, then supply every requiredInputs key in inputs (a missing or unknown key is a 400 naming it), required memorySetup answers in memoryAnswers, a DECISION kit's decisionSetup answers in decisionAnswers, and one categoryChoices entry per slot (a member with connectionProvider set also takes resourceId from the preview's operatorResources). CRITICAL — secrets shown ONCE: install.rawKey (the worker's pe_ API key) and install.triggers[].signingSecret can NEVER be read again; hand them to the human before discarding the response. Also returned: readiness (ready | blocked with actionable issues such as app_not_connected + candidateProviders; null means the readiness check failed AFTER the install succeeded — read it via worker_get, never re-install), workerUrl (the worker's dashboard page — hand it to the human) and connectAppsUrl (where the human connects missing apps; agents cannot). 402 {error:'limit_exceeded'} is the plan's worker cap — terminal: the human upgrades, or frees a slot with worker_delete (deleteWorkers scope; permanent, so only with their agreement). Rate: 10 installs/hour per account. Installing does NOT make the worker run: without a deployment it fires no schedule and worker_run refuses it with not_deployed. deploy:true (optionally with deployment: modelSlug from models_list and the ceilings) installs and deploys in ONE call and the response carries deployment; a deploy refused after the install still returns 201 with deploymentError naming the fix — the worker exists, so fix it and call worker_deploy, never re-install. deploy:true needs manageDeployments IN ADDITION to installKits: a key without it is refused up front (403 OPERATION_NOT_ALLOWED) and nothing is created — drop deploy, install, and have the owner re-scope the key before worker_deploy. An Action kit (modelType none) installs a worker that is never deployed: leave deploy off, then list its tools with worker_tools and call one with worker_tool_call.",
|
|
843
843
|
auth: "manager",
|
|
844
844
|
method: "post",
|
|
845
845
|
schema: {
|
|
@@ -857,7 +857,7 @@ const kitInstall = {
|
|
|
857
857
|
inputs: z.record(z.string(), z.string()).optional().describe("Answers to requiredInputs, keyed EXACTLY by each entry's key. Every key is mandatory; values are single-line, 1-200 chars."),
|
|
858
858
|
memoryAnswers: z.record(z.string(), z.string()).optional().describe("Answers to memorySetup questions by key. Entries with required:true are mandatory. Keep this separate from inputs — mixing the two maps is a 400."),
|
|
859
859
|
decisionAnswers: z.record(z.string(), z.string()).optional().describe("DECISION and HYBRID kits: answers to the preview's decisionSetup questions by key — a choice takes an option's value, a scale a stop's label (or its value), a list one row per line or ';'-separated (≤20 rows; a list with a built-in default keeps it when left blank — the template classifiers ship their categories that way), an appPick an id (or leave it blank and answer it later with instruction_set); text and rows ≤200 chars. A required question with no default and no answer is a 400 naming it."),
|
|
860
|
-
deploy: z.boolean().optional().describe("true = also put the new worker on the hosted runtime, so it actually runs. Without this the install creates a worker that fires no schedule and refuses worker_run with not_deployed. Needs the manageDeployments scope."),
|
|
860
|
+
deploy: z.boolean().optional().describe("true = also put the new worker on the hosted runtime, so it actually runs. Without this the install creates a worker that fires no schedule and refuses worker_run with not_deployed. Needs the manageDeployments scope. Leave it off for an Action kit (modelType none): its worker is never deployed."),
|
|
861
861
|
deployment: z.object({
|
|
862
862
|
modelSlug: z.string().max(64).optional().describe("Model to deploy on, from models_list. Omit for the kit's recommended model."),
|
|
863
863
|
maxUsdPerRun: z.number().min(0.01).max(1000).optional().describe("Hard per-run ceiling in USD. Omit for the platform default."),
|
|
@@ -1055,11 +1055,11 @@ const setFleetBudget = {
|
|
|
1055
1055
|
// and completely inert: no schedule fires and worker_run answers 409
|
|
1056
1056
|
// not_deployed. Deploying is also where the model and the spend ceilings are
|
|
1057
1057
|
// chosen, which is why the writes sit behind their own scope.
|
|
1058
|
-
const DEPLOYMENT_NOTE = " A worker with NO DEPLOYMENT is configuration only: its schedules never fire and worker_run refuses it with 409 not_deployed. Deploying puts it on the runtime and sets its model and per-run / per-day spend ceilings.";
|
|
1058
|
+
const DEPLOYMENT_NOTE = " A worker with NO DEPLOYMENT is configuration only: its schedules never fire and worker_run refuses it with 409 not_deployed. Deploying puts it on the runtime and sets its model and per-run / per-day spend ceilings. The exception is an Action worker (modelType none): it is never deployed, and its tools are called with worker_tool_call.";
|
|
1059
1059
|
const listModels = {
|
|
1060
1060
|
name: "models_list",
|
|
1061
1061
|
title: "List Deployable Models",
|
|
1062
|
-
description: "The models this ACCOUNT may deploy a worker on, priced per million tokens — the picker for worker_deploy's modelSlug. Each row carries slug (the value deployment calls take), displayName, provider, inputUsdPerMTok / outputUsdPerMTok / cachedInputUsdPerMTok / cacheWriteInputUsdPerMTok, contextWindowK, minTier, recommended, and the reasoning vocabulary. A MODEL ABSENT FROM THIS LIST IS NOT DEPLOYABLE HERE — either the account's tier does not reach it or no live provider serves it — so never pass a slug you read somewhere else; that is a 400 one call later. reasoningStyle says what the deployment's thinking field accepts FOR THAT MODEL: 'budget' takes a per-turn token count AS A STRING ('1024', between thinkingBudgetMin and thinkingBudgetMax), 'effort' takes one of reasoningEffortOptions ('high'), 'none' takes only 'default' or 'off'. Sending the wrong kind is 400 invalid_thinking. byokProviders lists the providers this account holds its own API key for (model_keys_list) — a run on a model from one of those bills the account's key plus a platform fee instead of the wallet. Pass kitSlug to have the kit's own recommendation marked recommended:true; without it nothing is marked. The separate decisionProfiles list contains enabled classifiers, their prices and supported capabilities; pass a row's profileId as decisionProfileId to decision_worker_create, worker_deploy, deployment_update, worker_run or run_bulk, or as a kit's default. Language and hybrid workers: a DECISION worker (worker_get modelType 'decision') runs the decision model and takes no modelSlug. Requires readWorkers." +
|
|
1062
|
+
description: "The models this ACCOUNT may deploy a worker on, priced per million tokens — the picker for worker_deploy's modelSlug. Each row carries slug (the value deployment calls take), displayName, provider, inputUsdPerMTok / outputUsdPerMTok / cachedInputUsdPerMTok / cacheWriteInputUsdPerMTok, contextWindowK, minTier, recommended, and the reasoning vocabulary. A MODEL ABSENT FROM THIS LIST IS NOT DEPLOYABLE HERE — either the account's tier does not reach it or no live provider serves it — so never pass a slug you read somewhere else; that is a 400 one call later. reasoningStyle says what the deployment's thinking field accepts FOR THAT MODEL: 'budget' takes a per-turn token count AS A STRING ('1024', between thinkingBudgetMin and thinkingBudgetMax), 'effort' takes one of reasoningEffortOptions ('high'), 'none' takes only 'default' or 'off'. Sending the wrong kind is 400 invalid_thinking. byokProviders lists the providers this account holds its own API key for (model_keys_list) — a run on a model from one of those bills the account's key plus a platform fee instead of the wallet. Pass kitSlug to have the kit's own recommendation marked recommended:true; without it nothing is marked. The separate decisionProfiles list contains enabled classifiers, their prices and supported capabilities; pass a row's profileId as decisionProfileId to decision_worker_create, worker_deploy, deployment_update, worker_run or run_bulk, or as a kit's default. Language and hybrid workers: a DECISION worker (worker_get modelType 'decision') runs the decision model and takes no modelSlug. An ACTION worker (modelType 'none') uses neither list: it has no model. Requires readWorkers." +
|
|
1063
1063
|
RUNTIME_NOTE,
|
|
1064
1064
|
auth: "manager",
|
|
1065
1065
|
method: "get",
|
|
@@ -1072,7 +1072,7 @@ const listModels = {
|
|
|
1072
1072
|
const listDeployments = {
|
|
1073
1073
|
name: "deployments_list",
|
|
1074
1074
|
title: "List Deployments",
|
|
1075
|
-
description: "Every DEPLOYED worker on the account with its model, spend ceilings and deployment status — the fleet answer to \"what is actually able to run\". A worker that appears in workers_list but NOT here is not on the runtime, however complete it looks: that is the single most common reason a newly built worker never produces a run. Account-scoped by the key, so it takes no worker id. Requires readWorkers." +
|
|
1075
|
+
description: "Every DEPLOYED worker on the account with its model, spend ceilings and deployment status — the fleet answer to \"what is actually able to run\". A worker that appears in workers_list but NOT here is not on the runtime, however complete it looks: that is the single most common reason a newly built worker never produces a run. Action workers (modelType none) never appear here, by design: they are not deployed, and their tools are called with worker_tool_call. Account-scoped by the key, so it takes no worker id. Requires readWorkers." +
|
|
1076
1076
|
RUNTIME_NOTE,
|
|
1077
1077
|
auth: "manager",
|
|
1078
1078
|
method: "get",
|
|
@@ -1083,7 +1083,7 @@ const listDeployments = {
|
|
|
1083
1083
|
const getDeployment = {
|
|
1084
1084
|
name: "deployment_get",
|
|
1085
1085
|
title: "Get Deployment",
|
|
1086
|
-
description: "One worker's deployment: status, modelSlug + modelDisplayName, maxUsdPerRun / maxUsdPerDay, transcriptRetention (+ transcriptRetentionAvailable — false on a worker installed from a protected kit, where the control should not even be offered), thinking, allowPlatformEgress and warnings. 404 not_found means THE WORKER IS NOT DEPLOYED (or is not on this account — the two are indistinguishable by design); the fix is worker_deploy, not a retry. status: Provisioned / Active = it runs; Paused = schedules and run triggers are refused until deployment_update action:'resume'; Suspended = the platform stopped it and only support can lift that. Requires readWorkers." +
|
|
1086
|
+
description: "One worker's deployment: status, modelSlug + modelDisplayName, maxUsdPerRun / maxUsdPerDay, transcriptRetention (+ transcriptRetentionAvailable — false on a worker installed from a protected kit, where the control should not even be offered), thinking, allowPlatformEgress and warnings. 404 not_found means THE WORKER IS NOT DEPLOYED (or is not on this account — the two are indistinguishable by design); the fix is worker_deploy, not a retry, except on an Action worker (modelType none), which always answers 404 here because it is never deployed. status: Provisioned / Active = it runs; Paused = schedules and run triggers are refused until deployment_update action:'resume'; Suspended = the platform stopped it and only support can lift that. Requires readWorkers." +
|
|
1087
1087
|
RUNTIME_NOTE,
|
|
1088
1088
|
auth: "manager",
|
|
1089
1089
|
method: "get",
|
|
@@ -1097,7 +1097,7 @@ const getDeployment = {
|
|
|
1097
1097
|
const deployWorker = {
|
|
1098
1098
|
name: "worker_deploy",
|
|
1099
1099
|
title: "Deploy Worker",
|
|
1100
|
-
description: "Put the worker on the hosted runtime — what makes it runnable and schedulable, and the step most often forgotten after kit_install (whose deploy:true does both in one call). EVERYTHING IS OPTIONAL: send nothing and it deploys on the model its kit recommends with the platform's default ceilings; 400 model_required means the kit named none — pick one from models_list. Each refusal names its fix: 422 instruction_required (no instruction — a hosted run has nothing to execute), 422 apps_not_connected (the message names the apps: app_connect them or drop them from the worker — a half-connected worker is refused rather than left to burn spend on a partial answer), 402 wallet_required (hosted runs meter from the prepaid wallet and AN AGENT CANNOT TOP IT UP WITHOUT HUMAN PAYMENT: with requestWalletTopUp request a wallet_checkout_create link, otherwise tell the human), 402 hosted_worker_limit, 409 already_deployed (use deployment_update), 400 invalid_model / model_tier_gated (unknown, disabled or above the account's tier — choose another from models_list), 400 invalid_thinking (wrong reasoning vocabulary for the model), 400 invalid_caps (maxUsdPerDay below maxUsdPerRun). A DECISION worker needs neither a model nor an instruction — deploy it as is (a modelSlug or thinking value is refused: 400 invalid_model / invalid_thinking); its routing table acts from the first run. Its one extra refusal is 400 decision_setup_pending, an install question still blank: instruction_get names it, instruction_get with optionsFor lists an appPick's live values, instruction_set fills it. warnings[] on success never blocks: ip_rules_enforced means the worker's IP allowlist will reject hosted runs, which arrive from platform egress. Requires manageDeployments." +
|
|
1100
|
+
description: "Put the worker on the hosted runtime — what makes it runnable and schedulable, and the step most often forgotten after kit_install (whose deploy:true does both in one call). EVERYTHING IS OPTIONAL: send nothing and it deploys on the model its kit recommends with the platform's default ceilings; 400 model_required means the kit named none — pick one from models_list. Each refusal names its fix: 422 instruction_required (no instruction — a hosted run has nothing to execute), 422 apps_not_connected (the message names the apps: app_connect them or drop them from the worker — a half-connected worker is refused rather than left to burn spend on a partial answer), 402 wallet_required (hosted runs meter from the prepaid wallet and AN AGENT CANNOT TOP IT UP WITHOUT HUMAN PAYMENT: with requestWalletTopUp request a wallet_checkout_create link, otherwise tell the human), 402 hosted_worker_limit, 409 already_deployed (use deployment_update), 400 invalid_model / model_tier_gated (unknown, disabled or above the account's tier — choose another from models_list), 400 invalid_thinking (wrong reasoning vocabulary for the model), 400 invalid_caps (maxUsdPerDay below maxUsdPerRun). A DECISION worker needs neither a model nor an instruction — deploy it as is (a modelSlug or thinking value is refused: 400 invalid_model / invalid_thinking); its routing table acts from the first run. Its one extra refusal is 400 decision_setup_pending, an install question still blank: instruction_get names it, instruction_get with optionsFor lists an appPick's live values, instruction_set fills it. An ACTION worker (modelType none) is never deployed: this answers 400 action_worker_requires_invoke — call its tools with worker_tool_call instead. warnings[] on success never blocks: ip_rules_enforced means the worker's IP allowlist will reject hosted runs, which arrive from platform egress. Requires manageDeployments." +
|
|
1101
1101
|
DEPLOYMENT_NOTE +
|
|
1102
1102
|
RUNTIME_NOTE +
|
|
1103
1103
|
NEW_SCOPE_NOTE,
|
|
@@ -1191,7 +1191,7 @@ const getWorkerPermissions = {
|
|
|
1191
1191
|
// and the vocabulary on the Directory server, validate, publish private, install.
|
|
1192
1192
|
const KIT_REF = z.string().min(1).max(120);
|
|
1193
1193
|
const KIT_REF_HINT = "The kit's slug, as returned by my_kits_list / kit_publish (its legacy numeric id is also accepted). Resolution is account-scoped: 404 not_found means no such kit on THIS account — another account's kit is indistinguishable from a nonexistent one.";
|
|
1194
|
-
const AUTHORING_FLOW_NOTE = " Authoring flow: read kit_authoring_guide (index, then schema and rules) and kit_vocabulary on the public WorkerKit Directory server first; kit_validate the exact body you will publish; publish PRIVATE (visibility 'private') and kit_install it; promote with kit_replace (visibility 'public') once a run has proved it. Requires the publishKits scope." +
|
|
1194
|
+
const AUTHORING_FLOW_NOTE = " Authoring flow: read kit_authoring_guide (index, then schema and rules) and kit_vocabulary on the public WorkerKit Directory server first; kit_validate the exact body you will publish; publish PRIVATE (visibility 'private') and kit_install it; promote with kit_replace (visibility 'public') once a run (an Action kit: a tool call) has proved it. Requires the publishKits scope." +
|
|
1195
1195
|
NEW_SCOPE_NOTE;
|
|
1196
1196
|
const kitRefParam = KIT_REF.describe(KIT_REF_HINT);
|
|
1197
1197
|
const kitRefPath = (params, suffix = "") => `${KITS_API}/${encodeURIComponent(String(params.kitRef))}${suffix}`;
|
|
@@ -1214,8 +1214,8 @@ const LISTING_SCHEMA = {
|
|
|
1214
1214
|
declaredModelFloor: z.string().max(80).optional().describe("Display-only minimum model (≤80)."),
|
|
1215
1215
|
modelScores: z.array(z.record(z.unknown())).max(10).optional().describe("≤10 of {model, score 0-100, notes ≤300} — only for models the kit was actually run on."),
|
|
1216
1216
|
};
|
|
1217
|
-
const CONTENT_SCHEMA = z.record(z.unknown()).describe("An ACTION kit declares modelType none and actionSpec (schemaVersion 1, tools of ref/version); omitting the spec copies the reviewed Slack defaults.
|
|
1218
|
-
"A HYBRID kit declares modelType hybrid, includes both instructionContent and a schema-3 decisionSpec with agentAction, and may use language-model commands, resources and memory. Its routes are agent/escalate/none, source maxItems at most 50, agentAction.maxItems at most 20 (defaults 20 and 5). Availability is server-gated. The kit's content: instructionContent (required on a LANGUAGE or HYBRID kit), whenToUse, startCommand, endCommand, endCommandDescription, skillResources, appCodes XOR apps, categorySlots, mcpServers, contactAllowAll, blockedSenderCategories, timeframePastDays, timeframeFutureDays, maxChildTokens, memoryProfile, selfFactsEnabled, memorySetup, schedules, triggers, usageWindows — or, for a DECISION kit, decisionSpec INSTEAD of instructionContent (a routing table the decision model runs per item; optionally modelType 'decision') and none of commands, whenToUse, skillResources, memorySetup or selfFactsEnabled; the compartment, stance and cadence fields apply to
|
|
1217
|
+
const CONTENT_SCHEMA = z.record(z.unknown()).describe("An ACTION kit declares modelType none and actionSpec (schemaVersion 1, 1-64 tools of ref/version, refs copied from action_worker_options); omitting the spec on a kit copies the reviewed Slack defaults (action_worker_create instead copies the chosen app's defaults). It takes no model, prompts, memory, schedules, triggers, category slots or deployment; leave appCodes/apps out, because the selected tools derive them. Calls use worker_tools and worker_tool_call. " +
|
|
1218
|
+
"A HYBRID kit declares modelType hybrid, includes both instructionContent and a schema-3 decisionSpec with agentAction, and may use language-model commands, resources and memory. Its routes are agent/escalate/none, source maxItems at most 50, agentAction.maxItems at most 20 (defaults 20 and 5). Availability is server-gated. The kit's content: instructionContent (required on a LANGUAGE or HYBRID kit), whenToUse, startCommand, endCommand, endCommandDescription, skillResources, appCodes XOR apps, categorySlots, mcpServers, contactAllowAll, blockedSenderCategories, timeframePastDays, timeframeFutureDays, maxChildTokens, memoryProfile, selfFactsEnabled, memorySetup, schedules, triggers, usageWindows — or, for a DECISION kit, decisionSpec INSTEAD of instructionContent (a routing table the decision model runs per item; optionally modelType 'decision') and none of commands, whenToUse, skillResources, memorySetup or selfFactsEnabled; the compartment, stance and cadence fields apply to language, decision and hybrid kits. Which kind a job is, the exact shape, every cap and every rule: kit_authoring_guide sections 'index' and 'schema'; app codes, tool keys and category slugs: kit_vocabulary. Validated strictly server-side — unknown keys are rejected, never ignored — so kit_validate first.");
|
|
1219
1219
|
const getMyPublisher = {
|
|
1220
1220
|
name: "publisher_get_mine",
|
|
1221
1221
|
title: "Get My Publisher",
|
|
@@ -1415,7 +1415,7 @@ const deleteKit = {
|
|
|
1415
1415
|
const APPS_API = "/api/manage/apps";
|
|
1416
1416
|
const MODEL_KEYS_API = "/api/manage/model-keys";
|
|
1417
1417
|
const OPERATOR_ID_HINT = "The operator (workspace) to act for, as a GUID from apps_list → operators[]. Omit for the account's default operator — the one installs and clones land on. Account-level providers ignore it.";
|
|
1418
|
-
const PROVIDER_HINT = "A recipe's provider code
|
|
1418
|
+
const PROVIDER_HINT = "A recipe's provider code exactly as apps_list → apps[].connect[].provider lists it (telegram, notion, granola…; apps_list is the complete, current set), or mcp:<slug> for an MCP app (a platform one, or one of your own from mcp_servers_list — published or not). Case-insensitive.";
|
|
1419
1419
|
const listApps = {
|
|
1420
1420
|
name: "apps_list",
|
|
1421
1421
|
title: "List Connected Apps",
|