@workerkit/core 0.3.11 → 0.3.12

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.
@@ -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 — 88 manager + 9 anonymous. */
6
+ /** Every descriptor this package ships — 95 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 — 88 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 — 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,7 +1,8 @@
1
- // The 88 authenticated fleet-management tools, as pure descriptors. The
1
+ // The 95 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.
5
+ import { actionDescriptors } from "./actions.js";
5
6
  import { appDiscoveryDescriptors } from "./app-discovery.js";
6
7
  import { compactDecisionReceipt } from "./decision-receipt.js";
7
8
  import { createDecisionWorker } from "./decision-authoring.js";
@@ -93,6 +94,7 @@ const getWorker = {
93
94
  };
94
95
  // ─── Runs ───────────────────────────────────────────────────────────────────
95
96
  const runWorker = {
97
+ strictInput: true,
96
98
  mapData: compactDecisionReceipt,
97
99
  name: "worker_run",
98
100
  requestTimeoutMs: (params) => typeof params.waitSeconds === "number"
@@ -126,6 +128,7 @@ const runWorker = {
126
128
  annotations: TRIGGER,
127
129
  };
128
130
  const runWorkersBulk = {
131
+ strictInput: true,
129
132
  name: "run_bulk",
130
133
  title: "Run Workers in Bulk",
131
134
  description: "Run several workers now in ONE call — a prompt fanned out across a fleet without spending the single trigger's 30/min budget one worker at a time. Up to 20 workers per call, each named by workerId (preferred) or its deprecated tokenId (the GUID wins when both are sent), each with its own optional prompt, modelSlug, decisionProfileId, sourceArgs, answers and maxItems. IT IS NOT ATOMIC AND IT DOES NOT STOP: every worker passes the mint gauntlet on its own, so an unknown id, a missing deployment or a cap already hit is reported on THAT item (success false, errorCode, error) and the loop goes on to the next — a stale id in a fan-out never discards the nineteen runs that were fine. A SKIPPED RECEIPT IS A SUCCESS HERE: a run was minted and its status/skipReason say why it did not start, so read items[] and never the status code or minted alone. Each successful item carries runId, status, skipReason and errorCode; run_events and run_get take the runId from there. Recorded as API-triggered runs, attributed to the manager key's minter. Own window: 2 calls per minute and 20 per hour per ACCOUNT, on top of the surface windows. Requires the runWorkers scope." +
@@ -143,7 +146,7 @@ const runWorkersBulk = {
143
146
  sourceArgs: runWorker.schema.sourceArgs,
144
147
  answers: runWorker.schema.answers,
145
148
  maxItems: runWorker.schema.maxItems,
146
- }))
149
+ }).strict())
147
150
  .min(1)
148
151
  .max(20)
149
152
  .describe("One entry per worker to run, 1–20 of them; each needs a workerId or a tokenId."),
@@ -353,7 +356,7 @@ const scoreRun = {
353
356
  const getMemory = {
354
357
  name: "memory_get",
355
358
  title: "Get Worker Memory",
356
- description: "The worker's memory: memoryProfile (stateless|contextual), selfFactsEnabled, rules (what the worker must DO — injected into every run), facts (what IS true — injected), recallFacts (searchable tier), pendingProposalCount, and a usage meter with every cap (rules, injected facts, char pools, recall) including recallFull — the only signal that the worker can no longer save new facts on its own.",
359
+ description: "Read the worker's independent memory settings and stored statements. memoryProfile: stateless omits recent-run summaries; contextual includes them. Owner rules and injected facts apply in both. selfFactsEnabled permits unreviewed recall-only saves, subject to effective access; later runs must search to use them. Returns rules, facts (injected), recallFacts (searchable), pendingProposalCount (inactive until owner approval), and usage caps including recallFull. Records collections are separate WorkerKit-owned structured data, not part of this fact store. Read the authoring guide's state section for feature selection and context hygiene.",
357
360
  auth: "manager",
358
361
  method: "get",
359
362
  schema: {
@@ -698,8 +701,8 @@ const setInstruction = {
698
701
  jobSentence: z.string().max(200).optional().describe("The worker's one-liner (≤200). Omit = unchanged; '' = clear."),
699
702
  whenToUse: z.string().max(500).optional().describe("Trigger text: when this worker should be used (≤500). Omit = unchanged; '' = clear."),
700
703
  description: z.string().max(2000).optional().describe("Longer display-only description (≤2000). Omit = unchanged; '' = clear."),
701
- memoryProfile: z.enum(["stateless", "contextual"]).optional().describe("Worker class: stateless (fresh each run) or contextual (carries prior-run reports). Omit = unchanged."),
702
- selfFactsEnabled: z.boolean().optional().describe("Whether the worker may save its own facts during runs. Set true when the content tells the worker to save facts. Omit = unchanged."),
704
+ memoryProfile: z.enum(["stateless", "contextual"]).optional().describe("Recent-run context: stateless omits summaries; contextual includes bounded summaries. Owner rules and injected facts apply in both; neither deletes saved facts or Records. Omit = unchanged."),
705
+ selfFactsEnabled: z.boolean().optional().describe("Permit unreviewed, recall-only fact saves through add_fact, subject to effective access. Independent of memoryProfile. Instructions must say what to save and when to retrieve it with search_facts. Omit = unchanged."),
703
706
  },
704
707
  path: (params) => `${API}/${params.tokenId}/instruction`,
705
708
  bodyBuilder: (params) => ({
@@ -844,6 +847,7 @@ const kitInstall = {
844
847
  operatorId: z.string().uuid().optional().describe("Operator (workspace) to install into. Omit to use the account's default operator."),
845
848
  title: z.string().max(100).optional().describe("Name for the new worker (≤100 chars). Omit to use the kit's name."),
846
849
  avatar: z.string().max(40).optional().describe("Avatar slug for the new worker. Omit for the default."),
850
+ 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."),
847
851
  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."),
848
852
  categoryChoices: z.array(z.object({
849
853
  categoryCode: z.string().describe("The slot's categoryCode from the preview."),
@@ -873,6 +877,7 @@ const kitInstall = {
873
877
  memoryAnswers: params.memoryAnswers,
874
878
  decisionAnswers: params.decisionAnswers,
875
879
  deploy: params.deploy,
880
+ slackConnectionId: params.slackConnectionId,
876
881
  deployment: params.deployment,
877
882
  }),
878
883
  annotations: CREATE,
@@ -1209,7 +1214,8 @@ const LISTING_SCHEMA = {
1209
1214
  declaredModelFloor: z.string().max(80).optional().describe("Display-only minimum model (≤80)."),
1210
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."),
1211
1216
  };
1212
- const CONTENT_SCHEMA = z.record(z.unknown()).describe("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 both kinds. 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.");
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. No model, prompts, memory, schedules or deployment. 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 both kinds. 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.");
1213
1219
  const getMyPublisher = {
1214
1220
  name: "publisher_get_mine",
1215
1221
  title: "Get My Publisher",
@@ -1318,8 +1324,8 @@ const updateKit = {
1318
1324
  permissions: z.array(z.record(z.unknown())).optional().describe("Full replace of the pinned-app permission selections (content.apps shape). Replaces TOGETHER with categorySlots."),
1319
1325
  categorySlots: z.array(z.record(z.unknown())).optional().describe("Full replace of the capability slots (content.categorySlots shape). Replaces TOGETHER with permissions; [] clears."),
1320
1326
  contactAllowAll: z.boolean().optional().describe("The token-wide contact/board stance: true allow-all, false deny-by-default."),
1321
- memoryProfile: z.enum(["stateless", "contextual"]).optional().describe("The declared worker class."),
1322
- selfFactsEnabled: z.boolean().optional().describe("Whether the instruction expects the worker to save its own facts."),
1327
+ memoryProfile: z.enum(["stateless", "contextual"]).optional().describe("Recent-run context: stateless omits summaries; contextual includes bounded summaries. Owner rules and injected facts apply in both."),
1328
+ selfFactsEnabled: z.boolean().optional().describe("Permit unreviewed, recall-only fact saves independently of memoryProfile. The instruction must specify what to save and when to search for it."),
1323
1329
  memorySetup: z.array(z.record(z.unknown())).max(10).optional().describe("Full replace of the memory-setup questions ([] asks nothing). Shape: kit_authoring_guide section 'schema'."),
1324
1330
  },
1325
1331
  path: (params) => kitRefPath(params),
@@ -1409,7 +1415,7 @@ const deleteKit = {
1409
1415
  const APPS_API = "/api/manage/apps";
1410
1416
  const MODEL_KEYS_API = "/api/manage/model-keys";
1411
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.";
1412
- const PROVIDER_HINT = "A recipe's provider code from apps_list → apps[].connect[].provider: telegram, discord, slack, twilio, sendgrid, resend, tavily, brave, exa, brightData, firecrawl, nimble, granola, krisp, gong, zendesk, shopify, hubspot, notion, linear, monday, jira, asana, confluence, or mcp:<slug> for an MCP app (a platform one, or one of your own from mcp_servers_list — published or not). Case-insensitive.";
1418
+ const PROVIDER_HINT = "A recipe's provider code from apps_list → apps[].connect[].provider: telegram, discord, slack, twilio, sendgrid, resend, tavily, brave, exa, brightData, firecrawl, nimble, granola, gong, zendesk, shopify, hubspot, notion, linear, monday, jira, asana, confluence, or mcp:<slug> for an MCP app (a platform one, or one of your own from mcp_servers_list — published or not). Case-insensitive.";
1413
1419
  const listApps = {
1414
1420
  name: "apps_list",
1415
1421
  title: "List Connected Apps",
@@ -1627,6 +1633,7 @@ export const manageDescriptors = [
1627
1633
  ...appDiscoveryDescriptors,
1628
1634
  ...onboardingDescriptors,
1629
1635
  createDecisionWorker,
1636
+ ...actionDescriptors,
1630
1637
  setWorkerDecision,
1631
1638
  getKeyInfo,
1632
1639
  listWorkers,