@workerkit/core 0.3.11 → 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 +32 -7
- package/README.md +71 -1
- package/dist/descriptors/actions.d.ts +33 -0
- package/dist/descriptors/actions.js +85 -0
- package/dist/descriptors/actions.js.map +1 -0
- package/dist/descriptors/app-discovery.js +26 -1
- package/dist/descriptors/app-discovery.js.map +1 -1
- package/dist/descriptors/decision-authoring.d.ts +2 -2
- package/dist/descriptors/decision-authoring.js +1 -1
- package/dist/descriptors/decision-authoring.js.map +1 -1
- package/dist/descriptors/directory.js +9 -9
- package/dist/descriptors/directory.js.map +1 -1
- package/dist/descriptors/index.d.ts +1 -1
- package/dist/descriptors/index.js +1 -1
- package/dist/descriptors/index.js.map +1 -1
- package/dist/descriptors/manage.js +33 -26
- package/dist/descriptors/manage.js.map +1 -1
- package/dist/descriptors/types.d.ts +5 -1
- package/dist/descriptors/types.js.map +1 -1
- package/dist/execute.js +5 -0
- package/dist/execute.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/docs/hybrid-workers.md +7 -5
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directory.js","sourceRoot":"","sources":["../../src/descriptors/directory.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,sFAAsF;AACtF,4EAA4E;AAC5E,gFAAgF;AAChF,+EAA+E;AAC/E,uDAAuD;AACvD,EAAE;AACF,qEAAqE;AACrE,6EAA6E;AAC7E,8EAA8E;AAC9E,gEAAgE;AAChE,8EAA8E;AAC9E,oEAAoE;AACpE,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,iEAAiE;AAEjE,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAuB,MAAM,YAAY,CAAC;AAE5D,MAAM,GAAG,GAAG,oBAAoB,CAAC;A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EAAE,SAAS;CACvB,CAAC;AAEF,+EAA+E;AAE/E,MAAM,CAAC,MAAM,oBAAoB,GAA8B;IAC7D,cAAc;IACd,iBAAiB;IACjB,UAAU;IACV,MAAM;IACN,WAAW;IACX,YAAY;IACZ,iBAAiB;IACjB,aAAa;IACb,WAAW;CACZ,CAAC","sourcesContent":["// The public kits-directory tools: anonymous, read-only catalog tools over the\n// public directory API. Nine tools rather than one per REST endpoint — the about read\n// (what WorkerKit is and when an agent should reach for it), one vocabulary\n// call, one search, one dossier, one stats read, one publisher profile, and the\n// three authoring reads (the guide, the permission vocabulary an author needs,\n// and the explorer of what each app lets a worker do).\n//\n// The upstream surface is already agent-shaped (always-anonymous, no\n// viewer-scoped fields, opt-in skill-resource bodies, composed overview), so\n// these tools stay thin passthroughs. What lives HERE is the pure half of the\n// presentation an MCP server (or CLI) should not each reinvent:\n// - Empty search results append a broaden-this hint; truncated results append\n// the next page number — the two places agents reliably mis-step.\n// - kit_get / publisher_get carry a computed pageUrl: nothing on an anonymous\n// surface can install, so the agent hands over the link — or, when it holds\n// a manager key with the installKits scope, installs via kit_install_preview\n// / kit_install on the authenticated WorkerKit Manager server.\n\nimport { z } from \"../zod.js\";\nimport { READ_ONLY, type ToolDescriptor } from \"./types.js\";\n\nconst API = \"/api/directory/mcp\";\nconst SITE = \"https://workerkit.ai\";\n\n// ─── Shared phrasing ────────────────────────────────────────────────────────\n\nconst SLUG_HINT = \"The kit's URL slug, as returned by kits_search (slug).\";\n\n// Appended to every tool: the two facts an agent must never get wrong on a\n// public mount — no auth exists, and installing is out of its reach.\nconst DIRECTORY_NOTE =\n \" Public and anonymous: results are identical for everyone, and nothing here installs or publishes. Install: a signed-in human on the kit's workerkit.ai page (offer the URL), or an agent with the installKits scope via kit_install_preview / kit_install on the WorkerKit Manager mount (/workers). Author: kit_authoring_guide + kit_vocabulary here, then kit_validate / kit_publish on /workers (publishKits scope).\";\n\n// The two authoring reads share one framing: they are what an agent reads BEFORE\n// writing a kit for the manager surface, and they are anonymous so it can draft\n// before it holds any credential.\nconst AUTHORING_NOTE =\n \" Public and anonymous, identical for everyone. The kit is validated and published on the WorkerKit Manager mount (/workers): kit_validate (every section's verdict at once), then kit_publish — publishKits scope. Publish PRIVATE first (visibility 'private'): a private kit installs only on its own account (a signed-in human on its workerkit.ai page, or an agent via kit_install), which is also how a worker is created from scratch. A worker uses only apps CONNECTED on its operator (apps_list; app_connect for credential-based ones). An app the platform lacks is added as the account's own custom MCP app: mcp_server_create (credential included), mcp_server_set_tools, then content.mcpServers in the kit.\";\n\n// ─── Pure data mappers + footers (presentation data, not ToolResult assembly) ─\n\ntype Json = Record<string, unknown>;\n\nconst SEARCH_EMPTY_HINT =\n \"No kits matched. Filters AND together — drop some. query is a plain case-insensitive substring over name + job sentence (one short word beats a phrase), and unknown category/app/publisher values match nothing rather than erroring. directory_overview lists every valid filter value. If nothing fits after broadening, author a kit for the exact job rather than installing a near miss: kit_authoring_guide (index, then schema and rules) and kit_app_tools here, then kit_validate and kit_publish (private) on the /workers mount, then kit_install.\";\n\n// publisher_get accepts no search filters, so the search hint above would tell an\n// agent to broaden filters it never set. Reachable: the profile 404s only when the\n// publisher has no PUBLISHED kits, while the catalog list additionally excludes\n// taken-down ones — so a publisher whose only published kit was moderated out\n// returns 200 with an empty items array.\nconst PUBLISHER_EMPTY_HINT =\n \"This publisher currently lists no kits (publisher.kitCount can still be non-zero — a published kit can be withheld from the catalog). publisher_get takes no search filters, so there is nothing to broaden; report the profile as-is.\";\n\n/**\n * The one footer a {items, totalCount, page, pageSize} list needs: how to\n * broaden when nothing matched, or which page comes next when truncated.\n */\nexport function listFooter(body: Json, emptyHint: string = SEARCH_EMPTY_HINT): string | undefined {\n const items = Array.isArray(body.items) ? body.items : [];\n const totalCount = typeof body.totalCount === \"number\" ? body.totalCount : items.length;\n const page = typeof body.page === \"number\" ? body.page : 1;\n const pageSize = typeof body.pageSize === \"number\" && body.pageSize > 0 ? body.pageSize : Math.max(items.length, 1);\n if (totalCount === 0) {\n return emptyHint;\n }\n if (page * pageSize < totalCount) {\n return `Showing page ${page} of ${Math.ceil(totalCount / pageSize)} (${totalCount} kits total) — call again with page: ${page + 1} for more`;\n }\n return undefined;\n}\n\n/** kits_search data: the validated list body, or undefined = serve verbatim. */\nexport function kitListData(data: unknown): Json | undefined {\n const body = data as Json | null;\n if (!body || typeof body !== \"object\" || !Array.isArray((body as Json).items)) {\n return undefined; // unexpected shape — serve verbatim rather than guess\n }\n return body;\n}\n\n/** kit_get data: the dossier with the computed pageUrl, or undefined = verbatim. */\nexport function kitDetailData(data: unknown, params: Record<string, unknown>): Json | undefined {\n const body = data as Json | null;\n if (!body || typeof body !== \"object\" || Array.isArray(body)) return undefined;\n\n const detail = { ...body };\n const slug = typeof detail.slug === \"string\" && detail.slug.length > 0 ? detail.slug : String(params.slug ?? \"\");\n detail.pageUrl = `${SITE}/kit/${encodeURIComponent(slug)}`;\n return detail;\n}\n\n/**\n * kit_get footer. Bodies exist upstream but were not requested: each such\n * resource reports a contentLength with no content. A protected kit's resources\n * carry neither (identity-only), so this stays silent there — re-calling would\n * not help.\n */\nexport function kitDetailFooter(data: unknown, params: Record<string, unknown>): string | undefined {\n const detail = data as Json;\n if (params.includeResourceBodies !== true && Array.isArray(detail.skillResources)) {\n const omitted = detail.skillResources.filter(\n (r) =>\n r !== null && typeof r === \"object\" && !Array.isArray(r) &&\n typeof (r as Json).contentLength === \"number\" && ((r as Json).contentLength as number) > 0 &&\n typeof (r as Json).content !== \"string\"\n ).length;\n if (omitted > 0) {\n return `${omitted} skillResources ${omitted === 1 ? \"body\" : \"bodies\"} omitted — call again with includeResourceBodies: true to read them`;\n }\n }\n return undefined;\n}\n\n/** publisher_get data: the profile with the computed pageUrl, or undefined = verbatim. */\nexport function publisherPageData(data: unknown, params: Record<string, unknown>): Json | undefined {\n const body = data as Json | null;\n if (!body || typeof body !== \"object\" || Array.isArray(body)) return undefined;\n\n const page = { ...body };\n const publisher = page.publisher as Json | undefined;\n const slug =\n publisher && typeof publisher.slug === \"string\" && publisher.slug.length > 0\n ? publisher.slug\n : String(params.slug ?? \"\");\n page.pageUrl = `${SITE}/publishers/${encodeURIComponent(slug)}`;\n return page;\n}\n\n/** publisher_get footer: pages the embedded kit list with the publisher-shaped empty hint. */\nexport function publisherPageFooter(data: unknown): string | undefined {\n const page = data as Json;\n const kits = page.kits;\n if (kits && typeof kits === \"object\" && !Array.isArray(kits) && Array.isArray((kits as Json).items)) {\n return listFooter(kits as Json, PUBLISHER_EMPTY_HINT);\n }\n return undefined;\n}\n\n// ─── Tools ──────────────────────────────────────────────────────────────────\n\nconst directoryOverview: ToolDescriptor = {\n name: \"directory_overview\",\n title: \"Directory Overview\",\n description:\n \"The directory's vocabulary and scale in one call — call this FIRST when you need valid kits_search filter values or a map of what WorkerKit covers. Returns: kitCount (published kits right now); categories grouped as jobFamilies/roles/industries ({slug, name} — slugs feed the category/industry filters); apps ({code, name, categoryCode?, installable} — codes feed the app filter; installable:false means kits can show the app but an install cannot carry it); appCategories ({code, name, members:[{code, name, appCode}]} — codes feed the appCategory filter; members are what an installer picks between, e.g. Slack vs Teams); models ({model, normalized, kitCount} — pass normalized or any substring as the model filter); modelTypes ({code, name, summary} — 'language' | 'decision', each with its one-line summary; codes feed the modelType filter); sortOptions; triggerModes. Vocabulary only — it lists no kits: for 'what is popular', use kits_search with the default downloads sort. Kit pages for humans follow https://workerkit.ai/kit/{slug}.\" +\n DIRECTORY_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {},\n path: `${API}/overview`,\n annotations: READ_ONLY,\n};\n\nconst searchKits: ToolDescriptor = {\n name: \"kits_search\",\n title: \"Search Kits\",\n description:\n \"Search and browse the public WorkerKit kits directory. A kit is a pre-built AI worker template — a job instruction plus exact, pre-scoped app permissions (and often schedules) — that a human installs as a working AI worker in one click. All filters AND together; every value is optional (omit everything to browse the whole catalog). Returns {items, totalCount, page, pageSize}; each card: slug (the key for kit_get), name, jobSentence (what the worker does, one line), publisherName/publisherSlug/isOfficialPublisher/verificationTier, apps (app codes it uses) + categorySlots (capability slots where the installer picks the app, e.g. Slack vs Teams), categories, triggerModes, downloadCount, starCount, modelScores (publisher-declared 0-100 fit per model, best first) + recommendedModel, modelType ('language' | 'decision' — see the filter), isProtected (publisher withholds the instruction TEXT; the kit still fully works — not a red flag), isFeatured, publishedAt. An empty result is not an error — see the footer it returns; valid category/app/appCategory/model filter values come from directory_overview. Kit page for humans: https://workerkit.ai/kit/{slug}.\" +\n DIRECTORY_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {\n query: z.string().max(200).optional().describe(\n \"Free-text search: case-insensitive SUBSTRING match over kit name + job sentence — not keyword or semantic search, so one short stem ('invoice') beats a phrase ('help with my invoices'). Omit to browse by filters alone.\"\n ),\n category: z.string().optional().describe(\n \"Job-category slug (any kind — job family, role, or industry). Valid slugs: directory_overview → categories. Unknown slugs match nothing.\"\n ),\n industry: z.string().optional().describe(\n \"Industry-kind category slug ONLY (a role/job-family slug here matches nothing). ANDs with category.\"\n ),\n app: z.string().optional().describe(\n \"Exact app code the kit must use, e.g. 'email', 'slack', 'crm'. Valid codes: directory_overview → apps.\"\n ),\n appCategory: z.string().optional().describe(\n \"Capability-category code, e.g. 'team-collaboration': matches kits that define that install-time slot OR pin one of its member apps — broader than the app filter. Unknown codes error (the error names the fix). Valid codes: directory_overview → appCategories.\"\n ),\n model: z.string().max(80).optional().describe(\n \"Substring match on a scored model name, e.g. 'sonnet' or 'gpt'. Valid names: directory_overview → models.\"\n ),\n trigger: z.enum([\"onDemand\", \"scheduled\", \"event\"]).optional().describe(\n \"How the kit's worker runs: onDemand (a human or agent triggers it), scheduled (ships recurring schedules), event (webhook-triggered).\"\n ),\n modelType: z.enum([\"language\", \"decision\", \"hybrid\"]).optional().describe(\n \"hybrid = bounded classification followed by one language-model agent; language = an instruction the installer runs on a model of their choice; decision = a routing table the decision model applies per item (triage, sorting, labelling, filtering — no instruction, no model to pick). Omit for both.\"\n ),\n publisher: z.string().optional().describe(\"Publisher slug (publisherSlug on any card) — that publisher's kits only.\"),\n sort: z.enum([\"downloads\", \"new\", \"name\", \"stars\"]).default(\"downloads\").describe(\n \"downloads = most installed (the popularity signal), new = latest published, name = A-Z, stars = most starred.\"\n ),\n page: z.number().int().min(1).default(1).describe(\"1-based page number.\"),\n pageSize: z.number().int().min(1).max(200).default(20).describe(\n \"Cards per page (max 200). 20 keeps responses lean; totalCount always reports the full match count.\"\n ),\n },\n path: `${API}/kits`,\n paramFilter: (params) => {\n // The wire param is `q`; `query` is the agent-facing name.\n const { query, ...rest } = params;\n return { ...rest, q: query };\n },\n annotations: READ_ONLY,\n mapData: (data) => kitListData(data),\n footer: (data) => listFooter(data as Json),\n};\n\nconst getKit: ToolDescriptor = {\n name: \"kit_get\",\n title: \"Get Kit\",\n description:\n \"One kit's full public dossier — what a human, or an agent advising one, evaluates before installing. Fields: description + appDescriptions (the author's per-app / per-tool notes); modelType ('hybrid' combines classification and an instruction; 'language', the default, or 'decision'); instructionContent — a language kit's job instruction VERBATIM, the core of what you are evaluating (empty when isProtected, with instructionLength still real; startCommand / endCommand / whenToUse are null on a protected kit, indistinguishable from 'none'); on a DECISION kit evaluate decisionNarration instead (what it reads, the questions it asks each item, the rules that route them, what happens below the confidence floor — served on protected kits too) and decisionSetup (the questions its installer answers); permissionsManifest — the EXACT data access an install grants (per-app operations / fields / scopes; the numeric value is authoritative, names are display) — summarize THIS when asked what the kit can touch; requiredInputs + memorySetup — the install form (fields the kit needs, questions whose answers become the worker's memory); memoryProfile ('contextual' = the worker sees its own recent runs) and selfFactsEnabled (it saves durable facts on its own); schedules / triggers / usageWindows; skillResources — reference docs the worker fetches on demand (key / kind / name always; description / contentLength unless protected; bodies via includeResourceBodies); hasExternalMcpShells — TRUE means installing creates an MCP gateway in the installer's account pointing at the publisher's own upstream URL (permissionsManifest.mcpServers.shells): surface it when recommending; scan — the security scan of the text being served: outcome 'cleared' or 'underReview' (both are live, installable listings — 'underReview' means a reviewer has not settled a raised check, never that the kit is unsafe), scannedAtUtc (null = published before the scanner existed, most of the catalog), checks (the families that ran on THIS kit — 'cleared' on ['static'] alone is weaker than on all three) and recommendation ('safe' | 'caution' | 'doNotInstall', the SCANNER's own advice, independent of outcome and possibly disagreeing with it: attribute it to SkillSpector, and read 'caution' as 'worth a look' — it is also emitted when the analysis was incomplete); scan is absent when there is nothing to report and never carries findings; modelScores (with notes), downloadCount / starCount, and pageUrl — the install page to hand to the human. 404 = no published kit with that slug.\" +\n DIRECTORY_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {\n slug: z.string().min(1).describe(SLUG_HINT),\n includeResourceBodies: z.boolean().default(false).describe(\n \"true = include each skill resource's full text (can be up to 20k chars each). Default false returns key/kind/name/description/contentLength — enough to describe the kit; fetch bodies only when their content is the question.\"\n ),\n },\n path: (params) => `${API}/kits/${encodeURIComponent(String(params.slug))}`,\n paramFilter: (params) => {\n const { slug: _slug, ...queryParams } = params;\n return queryParams;\n },\n annotations: READ_ONLY,\n mapData: kitDetailData,\n footer: kitDetailFooter,\n};\n\nconst getKitStats: ToolDescriptor = {\n name: \"kit_stats\",\n title: \"Get Kit Stats\",\n description:\n \"One kit's adoption over time: downloadCount (lifetime installs), dailyTrend (per-day installs over the trailing 30 days, UTC — sparse, omitted days are 0), lifetimeTrend (the whole history in at most 52 Monday-aligned buckets; buckets widen for older kits; counts sum to downloadCount). Use it to compare traction between shortlisted kits or to tell 'popular lately' from 'popular once' — the cards' downloadCount alone cannot.\" +\n DIRECTORY_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {\n slug: z.string().min(1).describe(SLUG_HINT),\n },\n path: (params) => `${API}/kits/${encodeURIComponent(String(params.slug))}/stats`,\n paramFilter: () => ({}),\n annotations: READ_ONLY,\n};\n\nconst getPublisher: ToolDescriptor = {\n name: \"publisher_get\",\n title: \"Get Publisher\",\n description:\n \"A kit publisher's public profile + their published kits — the 'who is behind this?' trust check. Returns {publisher, kits, pageUrl}: publisher has name, isOfficial (published by WorkerKit itself), verification handles (xHandle → x.com/{handle}, gitHubHandle → github.com/{handle}, linkedInUrl), description, createDate (member since), kitCount and totalDownloads (published kits only); kits is the same paginated card list kits_search returns, scoped to this publisher. 404 = unknown slug OR a publisher with nothing currently published.\" +\n DIRECTORY_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {\n slug: z.string().min(1).describe(\"The publisher's slug, as returned on any kit card (publisherSlug).\"),\n sort: z.enum([\"downloads\", \"new\", \"name\", \"stars\"]).default(\"downloads\").describe(\"Sort for the publisher's kit list.\"),\n page: z.number().int().min(1).default(1).describe(\"1-based page of the publisher's kit list.\"),\n pageSize: z.number().int().min(1).max(200).default(20).describe(\"Kits per page (max 200).\"),\n },\n path: (params) => `${API}/publishers/${encodeURIComponent(String(params.slug))}`,\n paramFilter: (params) => {\n const { slug: _slug, ...queryParams } = params;\n return queryParams;\n },\n annotations: READ_ONLY,\n mapData: publisherPageData,\n footer: (data) => publisherPageFooter(data),\n};\n\n// ─── Authoring reads ────────────────────────────────────────────────────────\n\nconst GUIDE_SECTIONS = [\"index\", \"decision\", \"schema\", \"rules\", \"skill\", \"slots\", \"instruction\", \"example\", \"selfcheck\"] as const;\n\nconst kitAuthoringGuide: ToolDescriptor = {\n name: \"kit_authoring_guide\",\n title: \"Kit Authoring Guide\",\n description:\n \"Author a WorkerKit kit or decision worker. For classification, scoring, filtering or triage, read section decision: source recipes, typed questions, creation examples and result handling. For full kit authoring read index, then schema; fetch other sections as needed. Returns one markdown section and a table of contents. Live source capabilities are on kit_app_tools; exact permission keys are on kit_vocabulary.\" + DIRECTORY_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {\n section: z.enum(GUIDE_SECTIONS).default(\"index\").describe(\n \"Which section to read. index (default) is the table of contents plus how to use the guide; schema and rules are the two an author cannot skip.\"\n ),\n },\n path: `${API}/authoring/guide`,\n annotations: READ_ONLY,\n};\n\nconst kitVocabulary: ToolDescriptor = {\n name: \"kit_vocabulary\",\n title: \"Kit Authoring Vocabulary\",\n description:\n \"The live vocabulary a kit's permission manifest accepts — read it before writing content.apps / content.categorySlots / categorySlugs: every key is validated strictly and there is no 'all' shorthand. Without app: apps[] (per surface: code, name, summary, operations = the tool KEYS you grant, fields, and every axis it supports — readOperations, masterAccessLevels, writableFields, providers, channels, objectTypes, scopePolicies, contentTypeScopes, capabilities, supportsAllowAll, supportsWriteEnabled, subApps, installable), concreteApps[] (vendor tiles such as Gmail, Monday or Google Sheets, kind standalone | provider | slotMember | subApp — how each lands in content), appCategories[] (the capability slots: members, labelAlias, genericName), categories {jobFamilies, roles, industries} (the ONLY valid categorySlugs), models[], mcpApps[] (platform MCP apps a kit binds via content.mcpServers — id is the gatewayId, tools[].toolId the toolIds; the account's OWN servers are mcp_servers_list on /workers) and note. With app=<code>: that ONE surface as {app, vendors, tools, note}, tools being what an installed worker sees — each {name (cite it in the instruction), description, readOnly, requires (grant one of these keys under operations to get the tool)}; toolsNote replaces tools where no catalog covers the surface. The full read is large: take it once per authoring task, then per-app reads for the surfaces you use; kit_app_tools is the one-call view of what every app can do. Unknown app = 400 naming every valid code.\" +\n AUTHORING_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {\n app: z.string().max(40).optional().describe(\n \"One app code (from apps[].code) to read just that surface with its vendors and tools. Omit for the whole vocabulary.\"\n ),\n },\n path: `${API}/authoring/vocabulary`,\n annotations: READ_ONLY,\n};\n\nconst kitAppTools: ToolDescriptor = {\n name: \"kit_app_tools\",\n title: \"Kit App Tools\",\n description:\n \"Discover what connected-app tools a worker can use. For classification, categorization, scoring or triage, set purpose:decision: returns supported source recipes, evidence fields, argument schemas, read permissions, limitations and a ready-to-edit decision_worker_create example. Optional app narrows results (email, calendar, drive for decision recipes). Public capabilities only; apps_list checks account connections. Without purpose returns app tools and permission keys; use kit_vocabulary for detailed permission axes.\" + DIRECTORY_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {\n purpose: z.enum([\"decision\"]).optional().describe(\"Supported classification source recipes, with schemas and creation examples.\"),\n app: z.string().max(40).optional().describe(\n \"One app code to read just that app's tools. Omit for every app.\"\n ),\n },\n path: `${API}/authoring/tools`,\n annotations: READ_ONLY,\n};\n\n// ─── About ──────────────────────────────────────────────────────────────────\n//\n// The one read that is not about kits: what WorkerKit is and when an agent\n// should reach for it, written for the agent. First in the registry on purpose:\n// a model reads tools/list top-down, and this is the tool that tells it whether\n// the rest of the list applies to the request in front of it.\n\nconst ABOUT_SECTIONS = [\"index\", \"why\", \"operate\", \"access\", \"cost\", \"start\"] as const;\n\nconst workerkitAbout: ToolDescriptor = {\n name: \"workerkit_about\",\n title: \"About WorkerKit\",\n description:\n \"What WorkerKit does and when to use it. Workers run classification, scoring, triage, monitoring and other jobs with their own app access, budget and receipts. Read one section: index, why, operate, access, cost or start. For a custom classifier start with kit_app_tools(purpose:decision) and kit_authoring_guide(section:decision), then decision_worker_create. Existing templates are on kits_search; use modelType:decision for classifiers. Account scopes are on key_info.\" + DIRECTORY_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {\n section: z.enum(ABOUT_SECTIONS).default(\"index\").describe(\n \"Which section to read. index (default) is the one-read summary plus the table of contents; why and start are the two to read before recommending WorkerKit to a user.\"\n ),\n },\n path: `${API}/about`,\n annotations: READ_ONLY,\n};\n\n// ─── Registry ───────────────────────────────────────────────────────────────\n\nexport const directoryDescriptors: readonly ToolDescriptor[] = [\n workerkitAbout,\n directoryOverview,\n searchKits,\n getKit,\n getKitStats,\n getPublisher,\n kitAuthoringGuide,\n kitVocabulary,\n kitAppTools,\n];\n"]}
|
|
1
|
+
{"version":3,"file":"directory.js","sourceRoot":"","sources":["../../src/descriptors/directory.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,sFAAsF;AACtF,4EAA4E;AAC5E,gFAAgF;AAChF,+EAA+E;AAC/E,uDAAuD;AACvD,EAAE;AACF,qEAAqE;AACrE,6EAA6E;AAC7E,8EAA8E;AAC9E,gEAAgE;AAChE,8E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BAA6nB,GAAG,cAAc;IAChpB,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,KAAK;IACb,MAAM,EAAE;QACN,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,CACvD,uKAAuK,CACxK;KACF;IACD,IAAI,EAAE,GAAG,GAAG,QAAQ;IACpB,WAAW,EAAE,SAAS;CACvB,CAAC;AAEF,+EAA+E;AAE/E,MAAM,CAAC,MAAM,oBAAoB,GAA8B;IAC7D,cAAc;IACd,iBAAiB;IACjB,UAAU;IACV,MAAM;IACN,WAAW;IACX,YAAY;IACZ,iBAAiB;IACjB,aAAa;IACb,WAAW;CACZ,CAAC","sourcesContent":["// The public kits-directory tools: anonymous, read-only catalog tools over the\n// public directory API. Nine tools rather than one per REST endpoint — the about read\n// (what WorkerKit is and when an agent should reach for it), one vocabulary\n// call, one search, one dossier, one stats read, one publisher profile, and the\n// three authoring reads (the guide, the permission vocabulary an author needs,\n// and the explorer of what each app lets a worker do).\n//\n// The upstream surface is already agent-shaped (always-anonymous, no\n// viewer-scoped fields, opt-in skill-resource bodies, composed overview), so\n// these tools stay thin passthroughs. What lives HERE is the pure half of the\n// presentation an MCP server (or CLI) should not each reinvent:\n// - Empty search results append a broaden-this hint; truncated results append\n// the next page number — the two places agents reliably mis-step.\n// - kit_get / publisher_get carry a computed pageUrl: nothing on an anonymous\n// surface can install, so the agent hands over the link — or, when it holds\n// a manager key with the installKits scope, installs via kit_install_preview\n// / kit_install on the authenticated WorkerKit Manager server.\n\nimport { z } from \"../zod.js\";\nimport { READ_ONLY, type ToolDescriptor } from \"./types.js\";\n\nconst API = \"/api/directory/mcp\";\nconst SITE = \"https://workerkit.ai\";\n\n// ─── Shared phrasing ────────────────────────────────────────────────────────\n\nconst SLUG_HINT = \"The kit's URL slug, as returned by kits_search (slug).\";\n\n// Appended to every tool: the two facts an agent must never get wrong on a\n// public mount — no auth exists, and installing is out of its reach.\nconst DIRECTORY_NOTE =\n \" Public and anonymous: results are identical for everyone, and nothing here installs or publishes. Install: a signed-in human on the kit's workerkit.ai page (offer the URL), or an agent with the installKits scope via kit_install_preview / kit_install on the WorkerKit Manager mount (/workers). Author: kit_authoring_guide + kit_vocabulary here, then kit_validate / kit_publish on /workers (publishKits scope).\";\n\n// The two authoring reads share one framing: they are what an agent reads BEFORE\n// writing a kit for the manager surface, and they are anonymous so it can draft\n// before it holds any credential.\nconst AUTHORING_NOTE =\n \" Public and anonymous, identical for everyone. The kit is validated and published on the WorkerKit Manager mount (/workers): kit_validate (every section's verdict at once), then kit_publish — publishKits scope. Publish PRIVATE first (visibility 'private'): a private kit installs only on its own account (a signed-in human on its workerkit.ai page, or an agent via kit_install), which is also how a worker is created from scratch. A worker uses only apps CONNECTED on its operator (apps_list; app_connect for credential-based ones). An app the platform lacks is added as the account's own custom MCP app: mcp_server_create (credential included), mcp_server_set_tools, then content.mcpServers in the kit.\";\n\n// ─── Pure data mappers + footers (presentation data, not ToolResult assembly) ─\n\ntype Json = Record<string, unknown>;\n\nconst SEARCH_EMPTY_HINT =\n \"No kits matched. Filters AND together — drop some. query is a plain case-insensitive substring over name + job sentence (one short word beats a phrase), and unknown category/app/publisher values match nothing rather than erroring. directory_overview lists every valid filter value. If nothing fits after broadening, author a kit for the exact job rather than installing a near miss: kit_authoring_guide (index, then schema and rules) and kit_app_tools here, then kit_validate and kit_publish (private) on the /workers mount, then kit_install.\";\n\n// publisher_get accepts no search filters, so the search hint above would tell an\n// agent to broaden filters it never set. Reachable: the profile 404s only when the\n// publisher has no PUBLISHED kits, while the catalog list additionally excludes\n// taken-down ones — so a publisher whose only published kit was moderated out\n// returns 200 with an empty items array.\nconst PUBLISHER_EMPTY_HINT =\n \"This publisher currently lists no kits (publisher.kitCount can still be non-zero — a published kit can be withheld from the catalog). publisher_get takes no search filters, so there is nothing to broaden; report the profile as-is.\";\n\n/**\n * The one footer a {items, totalCount, page, pageSize} list needs: how to\n * broaden when nothing matched, or which page comes next when truncated.\n */\nexport function listFooter(body: Json, emptyHint: string = SEARCH_EMPTY_HINT): string | undefined {\n const items = Array.isArray(body.items) ? body.items : [];\n const totalCount = typeof body.totalCount === \"number\" ? body.totalCount : items.length;\n const page = typeof body.page === \"number\" ? body.page : 1;\n const pageSize = typeof body.pageSize === \"number\" && body.pageSize > 0 ? body.pageSize : Math.max(items.length, 1);\n if (totalCount === 0) {\n return emptyHint;\n }\n if (page * pageSize < totalCount) {\n return `Showing page ${page} of ${Math.ceil(totalCount / pageSize)} (${totalCount} kits total) — call again with page: ${page + 1} for more`;\n }\n return undefined;\n}\n\n/** kits_search data: the validated list body, or undefined = serve verbatim. */\nexport function kitListData(data: unknown): Json | undefined {\n const body = data as Json | null;\n if (!body || typeof body !== \"object\" || !Array.isArray((body as Json).items)) {\n return undefined; // unexpected shape — serve verbatim rather than guess\n }\n return body;\n}\n\n/** kit_get data: the dossier with the computed pageUrl, or undefined = verbatim. */\nexport function kitDetailData(data: unknown, params: Record<string, unknown>): Json | undefined {\n const body = data as Json | null;\n if (!body || typeof body !== \"object\" || Array.isArray(body)) return undefined;\n\n const detail = { ...body };\n const slug = typeof detail.slug === \"string\" && detail.slug.length > 0 ? detail.slug : String(params.slug ?? \"\");\n detail.pageUrl = `${SITE}/kit/${encodeURIComponent(slug)}`;\n return detail;\n}\n\n/**\n * kit_get footer. Bodies exist upstream but were not requested: each such\n * resource reports a contentLength with no content. A protected kit's resources\n * carry neither (identity-only), so this stays silent there — re-calling would\n * not help.\n */\nexport function kitDetailFooter(data: unknown, params: Record<string, unknown>): string | undefined {\n const detail = data as Json;\n if (params.includeResourceBodies !== true && Array.isArray(detail.skillResources)) {\n const omitted = detail.skillResources.filter(\n (r) =>\n r !== null && typeof r === \"object\" && !Array.isArray(r) &&\n typeof (r as Json).contentLength === \"number\" && ((r as Json).contentLength as number) > 0 &&\n typeof (r as Json).content !== \"string\"\n ).length;\n if (omitted > 0) {\n return `${omitted} skillResources ${omitted === 1 ? \"body\" : \"bodies\"} omitted — call again with includeResourceBodies: true to read them`;\n }\n }\n return undefined;\n}\n\n/** publisher_get data: the profile with the computed pageUrl, or undefined = verbatim. */\nexport function publisherPageData(data: unknown, params: Record<string, unknown>): Json | undefined {\n const body = data as Json | null;\n if (!body || typeof body !== \"object\" || Array.isArray(body)) return undefined;\n\n const page = { ...body };\n const publisher = page.publisher as Json | undefined;\n const slug =\n publisher && typeof publisher.slug === \"string\" && publisher.slug.length > 0\n ? publisher.slug\n : String(params.slug ?? \"\");\n page.pageUrl = `${SITE}/publishers/${encodeURIComponent(slug)}`;\n return page;\n}\n\n/** publisher_get footer: pages the embedded kit list with the publisher-shaped empty hint. */\nexport function publisherPageFooter(data: unknown): string | undefined {\n const page = data as Json;\n const kits = page.kits;\n if (kits && typeof kits === \"object\" && !Array.isArray(kits) && Array.isArray((kits as Json).items)) {\n return listFooter(kits as Json, PUBLISHER_EMPTY_HINT);\n }\n return undefined;\n}\n\n// ─── Tools ──────────────────────────────────────────────────────────────────\n\nconst directoryOverview: ToolDescriptor = {\n name: \"directory_overview\",\n title: \"Directory Overview\",\n description:\n \"The directory's vocabulary and scale in one call — call this FIRST when you need valid kits_search filter values or a map of what WorkerKit covers. Returns: kitCount (published kits right now); categories grouped as jobFamilies/roles/industries ({slug, name} — slugs feed the category/industry filters); apps ({code, name, categoryCode?, installable} — codes feed the app filter; installable:false means kits can show the app but an install cannot carry it); appCategories ({code, name, members:[{code, name, appCode}]} — codes feed the appCategory filter; members are what an installer picks between, e.g. Slack vs Teams); models ({model, normalized, kitCount} — pass normalized or any substring as the model filter); modelTypes ({code, name, summary} — 'none' (Action) | 'language' | 'decision' | 'hybrid', each with its one-line summary; codes feed the modelType filter); sortOptions; triggerModes. Vocabulary only — it lists no kits: for 'what is popular', use kits_search with the default downloads sort. Kit pages for humans follow https://workerkit.ai/kit/{slug}.\" +\n DIRECTORY_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {},\n path: `${API}/overview`,\n annotations: READ_ONLY,\n};\n\nconst searchKits: ToolDescriptor = {\n name: \"kits_search\",\n title: \"Search Kits\",\n description:\n \"Search and browse the public WorkerKit kits directory. A kit is a pre-built AI worker template — a job instruction (on a decision kit, a routing table; on an Action kit, selected app tools and no model) plus exact, pre-scoped app permissions (and often schedules) — that a human installs as a working AI worker in one click. All filters AND together; every value is optional (omit everything to browse the whole catalog). Returns {items, totalCount, page, pageSize}; each card: slug (the key for kit_get), name, jobSentence (what the worker does, one line), publisherName/publisherSlug/isOfficialPublisher/verificationTier, apps (app codes it uses) + categorySlots (capability slots where the installer picks the app, e.g. Slack vs Teams), categories, triggerModes, downloadCount, starCount, modelScores (publisher-declared 0-100 fit per model, best first) + recommendedModel, modelType ('language' | 'decision' | 'hybrid' | 'none' — see the filter), isProtected (publisher withholds the instruction TEXT; the kit still fully works — not a red flag), isFeatured, publishedAt. An empty result is not an error — see the footer it returns; valid category/app/appCategory/model filter values come from directory_overview. Kit page for humans: https://workerkit.ai/kit/{slug}.\" +\n DIRECTORY_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {\n query: z.string().max(200).optional().describe(\n \"Free-text search: case-insensitive SUBSTRING match over kit name + job sentence — not keyword or semantic search, so one short stem ('invoice') beats a phrase ('help with my invoices'). Omit to browse by filters alone.\"\n ),\n category: z.string().optional().describe(\n \"Job-category slug (any kind — job family, role, or industry). Valid slugs: directory_overview → categories. Unknown slugs match nothing.\"\n ),\n industry: z.string().optional().describe(\n \"Industry-kind category slug ONLY (a role/job-family slug here matches nothing). ANDs with category.\"\n ),\n app: z.string().optional().describe(\n \"Exact app code the kit must use, e.g. 'email', 'slack', 'crm'. Valid codes: directory_overview → apps.\"\n ),\n appCategory: z.string().optional().describe(\n \"Capability-category code, e.g. 'team-collaboration': matches kits that define that install-time slot OR pin one of its member apps — broader than the app filter. Unknown codes error (the error names the fix). Valid codes: directory_overview → appCategories.\"\n ),\n model: z.string().max(80).optional().describe(\n \"Substring match on a scored model name, e.g. 'sonnet' or 'gpt'. Valid names: directory_overview → models.\"\n ),\n trigger: z.enum([\"onDemand\", \"scheduled\", \"event\"]).optional().describe(\n \"How the kit's worker runs: onDemand (a human or agent triggers it), scheduled (ships recurring schedules), event (webhook-triggered).\"\n ),\n modelType: z.enum([\"none\", \"language\", \"decision\", \"hybrid\"]).optional().describe(\n \"none = Action worker executing selected app tools without a reasoning model; hybrid = bounded classification followed by one language-model agent; language = an instruction the installer runs on a model of their choice; decision = a routing table the decision model applies per item (triage, sorting, labelling, filtering — no instruction, no model to pick). Omit for all worker types.\"\n ),\n publisher: z.string().optional().describe(\"Publisher slug (publisherSlug on any card) — that publisher's kits only.\"),\n sort: z.enum([\"downloads\", \"new\", \"name\", \"stars\"]).default(\"downloads\").describe(\n \"downloads = most installed (the popularity signal), new = latest published, name = A-Z, stars = most starred.\"\n ),\n page: z.number().int().min(1).default(1).describe(\"1-based page number.\"),\n pageSize: z.number().int().min(1).max(200).default(20).describe(\n \"Cards per page (max 200). 20 keeps responses lean; totalCount always reports the full match count.\"\n ),\n },\n path: `${API}/kits`,\n paramFilter: (params) => {\n // The wire param is `q`; `query` is the agent-facing name.\n const { query, ...rest } = params;\n return { ...rest, q: query };\n },\n annotations: READ_ONLY,\n mapData: (data) => kitListData(data),\n footer: (data) => listFooter(data as Json),\n};\n\nconst getKit: ToolDescriptor = {\n name: \"kit_get\",\n title: \"Get Kit\",\n description:\n \"One kit's full public dossier — what a human, or an agent advising one, evaluates before installing. Fields: description + appDescriptions (the author's per-app / per-tool notes); modelType ('none' exposes actionSpec with selected tools and no reasoning model; 'hybrid' combines classification and an instruction; 'language', the default, or 'decision'); instructionContent — a language kit's job instruction VERBATIM, the core of what you are evaluating (empty when isProtected, with instructionLength still real; startCommand / endCommand / whenToUse are null on a protected kit, indistinguishable from 'none'); on a DECISION kit evaluate decisionNarration instead (what it reads, the questions it asks each item, the rules that route them, what happens below the confidence floor — served on protected kits too) and decisionSetup (the questions its installer answers); permissionsManifest — the EXACT data access an install grants (per-app operations / fields / scopes; the numeric value is authoritative, names are display) — summarize THIS when asked what the kit can touch; requiredInputs + memorySetup — the install form (fields the kit needs, questions whose answers become the worker's memory); memoryProfile (stateless omits recent-run summaries; contextual includes bounded summaries; owner rules and injected facts apply in both) and selfFactsEnabled (permits unreviewed recall-only fact saves; later runs must search to use them); schedules / triggers / usageWindows; skillResources — reference docs the worker fetches on demand (key / kind / name always; description / contentLength unless protected; bodies via includeResourceBodies); hasExternalMcpShells — TRUE means installing creates an MCP gateway in the installer's account pointing at the publisher's own upstream URL (permissionsManifest.mcpServers.shells): surface it when recommending; scan — the security scan of the text being served: outcome 'cleared' or 'underReview' (both are live, installable listings — 'underReview' means a reviewer has not settled a raised check, never that the kit is unsafe), scannedAtUtc (null = published before the scanner existed, most of the catalog), checks (the families that ran on THIS kit — 'cleared' on ['static'] alone is weaker than on all three) and recommendation ('safe' | 'caution' | 'doNotInstall', the SCANNER's own advice, independent of outcome and possibly disagreeing with it: attribute it to SkillSpector, and read 'caution' as 'worth a look' — it is also emitted when the analysis was incomplete); scan is absent when there is nothing to report and never carries findings; modelScores (with notes), downloadCount / starCount, and pageUrl — the install page to hand to the human. 404 = no published kit with that slug.\" +\n DIRECTORY_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {\n slug: z.string().min(1).describe(SLUG_HINT),\n includeResourceBodies: z.boolean().default(false).describe(\n \"true = include each skill resource's full text (can be up to 20k chars each). Default false returns key/kind/name/description/contentLength — enough to describe the kit; fetch bodies only when their content is the question.\"\n ),\n },\n path: (params) => `${API}/kits/${encodeURIComponent(String(params.slug))}`,\n paramFilter: (params) => {\n const { slug: _slug, ...queryParams } = params;\n return queryParams;\n },\n annotations: READ_ONLY,\n mapData: kitDetailData,\n footer: kitDetailFooter,\n};\n\nconst getKitStats: ToolDescriptor = {\n name: \"kit_stats\",\n title: \"Get Kit Stats\",\n description:\n \"One kit's adoption over time: downloadCount (lifetime installs), dailyTrend (per-day installs over the trailing 30 days, UTC — sparse, omitted days are 0), lifetimeTrend (the whole history in at most 52 Monday-aligned buckets; buckets widen for older kits; counts sum to downloadCount). Use it to compare traction between shortlisted kits or to tell 'popular lately' from 'popular once' — the cards' downloadCount alone cannot.\" +\n DIRECTORY_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {\n slug: z.string().min(1).describe(SLUG_HINT),\n },\n path: (params) => `${API}/kits/${encodeURIComponent(String(params.slug))}/stats`,\n paramFilter: () => ({}),\n annotations: READ_ONLY,\n};\n\nconst getPublisher: ToolDescriptor = {\n name: \"publisher_get\",\n title: \"Get Publisher\",\n description:\n \"A kit publisher's public profile + their published kits — the 'who is behind this?' trust check. Returns {publisher, kits, pageUrl}: publisher has name, isOfficial (published by WorkerKit itself), verification handles (xHandle → x.com/{handle}, gitHubHandle → github.com/{handle}, linkedInUrl), description, createDate (member since), kitCount and totalDownloads (published kits only); kits is the same paginated card list kits_search returns, scoped to this publisher. 404 = unknown slug OR a publisher with nothing currently published.\" +\n DIRECTORY_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {\n slug: z.string().min(1).describe(\"The publisher's slug, as returned on any kit card (publisherSlug).\"),\n sort: z.enum([\"downloads\", \"new\", \"name\", \"stars\"]).default(\"downloads\").describe(\"Sort for the publisher's kit list.\"),\n page: z.number().int().min(1).default(1).describe(\"1-based page of the publisher's kit list.\"),\n pageSize: z.number().int().min(1).max(200).default(20).describe(\"Kits per page (max 200).\"),\n },\n path: (params) => `${API}/publishers/${encodeURIComponent(String(params.slug))}`,\n paramFilter: (params) => {\n const { slug: _slug, ...queryParams } = params;\n return queryParams;\n },\n annotations: READ_ONLY,\n mapData: publisherPageData,\n footer: (data) => publisherPageFooter(data),\n};\n\n// ─── Authoring reads ────────────────────────────────────────────────────────\n\nconst GUIDE_SECTIONS = [\"index\", \"decision\", \"schema\", \"rules\", \"skill\", \"state\", \"slots\", \"instruction\", \"example\", \"selfcheck\"] as const;\n\nconst kitAuthoringGuide: ToolDescriptor = {\n name: \"kit_authoring_guide\",\n title: \"Kit Authoring Guide\",\n description:\n \"Author a WorkerKit kit, decision worker or Action worker. For classification, scoring, filtering or triage, read section decision: source recipes, typed questions, creation examples and result handling. For explicit app operations with no model (an Action worker, modelType none), index and schema cover it; the shortest path is action_worker_options then action_worker_create on the WorkerKit Manager mount. For full kit authoring read index, then schema; read state for WorkerKit-owned Records, memory options and context hygiene. Fetch other sections as needed. Returns one markdown section and a table of contents. Live source capabilities are on kit_app_tools; exact permission keys are on kit_vocabulary.\" + DIRECTORY_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {\n section: z.enum(GUIDE_SECTIONS).default(\"index\").describe(\n \"Which section to read. index (default) is the table of contents plus how to use the guide; schema and rules are the two an author cannot skip.\"\n ),\n },\n path: `${API}/authoring/guide`,\n annotations: READ_ONLY,\n};\n\nconst kitVocabulary: ToolDescriptor = {\n name: \"kit_vocabulary\",\n title: \"Kit Authoring Vocabulary\",\n description:\n \"The live vocabulary a kit's permission manifest accepts — read it before writing content.apps / content.categorySlots / categorySlugs: every key is validated strictly and there is no 'all' shorthand. Without app: apps[] (per surface: code, name, summary, operations = the tool KEYS you grant, fields, and every axis it supports — readOperations, masterAccessLevels, writableFields, providers, channels, objectTypes, scopePolicies, contentTypeScopes, capabilities, supportsAllowAll, supportsWriteEnabled, subApps, installable), concreteApps[] (vendor tiles such as Gmail, Monday or Google Sheets, kind standalone | provider | slotMember | subApp — how each lands in content), appCategories[] (the capability slots: members, labelAlias, genericName), categories {jobFamilies, roles, industries} (the ONLY valid categorySlugs), models[], mcpApps[] (platform MCP apps a kit binds via content.mcpServers — id is the gatewayId, tools[].toolId the toolIds; the account's OWN servers are mcp_servers_list on /workers) and note. With app=<code>: that ONE surface as {app, vendors, tools, note}, tools being what an installed worker sees — each {name (cite it in the instruction), description, readOnly, argsSchema (exact input JSON Schema), decisionSource (documented result mapping where available), requires (grant one of these keys under operations to get the tool)}; toolsNote replaces tools where no catalog covers the surface. The full read is large: take it once per authoring task, then per-app reads for the surfaces you use; kit_app_tools is the one-call view of what every app can do. Unknown app = 400 naming every valid code.\" +\n AUTHORING_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {\n app: z.string().max(40).optional().describe(\n \"One app code (from apps[].code) to read just that surface with its vendors and tools. Omit for the whole vocabulary.\"\n ),\n },\n path: `${API}/authoring/vocabulary`,\n annotations: READ_ONLY,\n};\n\nconst kitAppTools: ToolDescriptor = {\n name: \"kit_app_tools\",\n title: \"Kit App Tools\",\n description:\n \"Discover what connected-app tools a worker can use. For classification, categorization, scoring or triage, set purpose:decision: returns convenience source recipes, evidence fields, argument schemas, read permissions, limitations and a ready-to-edit decision_worker_create example. Optional app narrows results (email, calendar, drive for decision recipes). Public capabilities only; apps_list checks account connections. Without purpose returns every catalogued app tool with argsSchema and permission keys, plus decisionSource result mappings where documented. Recipes are not a source allowlist: for arbitrary decision sources or routed actions omit purpose, read argsSchema and the documented result mapping, then kit_validate → kit_publish(private) → kit_install. For an Action worker, whose caller invokes app tools directly with no model, action_worker_options lists the tools it can expose. Validation checks structure/grants, not live access. Use kit_vocabulary for detailed permission axes.\" + DIRECTORY_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {\n purpose: z.enum([\"decision\"]).optional().describe(\"Supported classification source recipes, with schemas and creation examples.\"),\n app: z.string().max(40).optional().describe(\n \"One app code to read just that app's tools. Omit for every app.\"\n ),\n },\n path: `${API}/authoring/tools`,\n annotations: READ_ONLY,\n};\n\n// ─── About ──────────────────────────────────────────────────────────────────\n//\n// The one read that is not about kits: what WorkerKit is and when an agent\n// should reach for it, written for the agent. First in the registry on purpose:\n// a model reads tools/list top-down, and this is the tool that tells it whether\n// the rest of the list applies to the request in front of it.\n\nconst ABOUT_SECTIONS = [\"index\", \"why\", \"operate\", \"access\", \"cost\", \"start\"] as const;\n\nconst workerkitAbout: ToolDescriptor = {\n name: \"workerkit_about\",\n title: \"About WorkerKit\",\n description:\n \"What WorkerKit does and when to use it. Workers run classification, scoring, triage, monitoring and other jobs with their own app access, budget and receipts; an Action worker instead exposes selected app tools with no model, which you call with exact inputs (action_worker_options, action_worker_create, worker_tool_call). Read one section: index, why, operate, access, cost or start. For a custom classifier start with kit_app_tools(purpose:decision) and kit_authoring_guide(section:decision), then decision_worker_create. Existing templates are on kits_search; use modelType:decision for classifiers. Account scopes are on key_info.\" + DIRECTORY_NOTE,\n auth: \"anonymous\",\n method: \"get\",\n schema: {\n section: z.enum(ABOUT_SECTIONS).default(\"index\").describe(\n \"Which section to read. index (default) is the one-read summary plus the table of contents; why and start are the two to read before recommending WorkerKit to a user.\"\n ),\n },\n path: `${API}/about`,\n annotations: READ_ONLY,\n};\n\n// ─── Registry ───────────────────────────────────────────────────────────────\n\nexport const directoryDescriptors: readonly ToolDescriptor[] = [\n workerkitAbout,\n directoryOverview,\n searchKits,\n getKit,\n getKitStats,\n getPublisher,\n kitAuthoringGuide,\n kitVocabulary,\n kitAppTools,\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 —
|
|
6
|
+
/** Every descriptor this package ships — 95 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 —
|
|
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 —
|
|
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
|
|
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";
|
|
@@ -46,12 +47,12 @@ const getKeyInfo = {
|
|
|
46
47
|
const listWorkers = {
|
|
47
48
|
name: "workers_list",
|
|
48
49
|
title: "List Workers",
|
|
49
|
-
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).",
|
|
50
51
|
auth: "manager",
|
|
51
52
|
method: "get",
|
|
52
53
|
schema: {
|
|
53
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."),
|
|
54
|
-
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."),
|
|
55
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."),
|
|
56
57
|
q: z.string().max(100).optional().describe("Case-insensitive substring of the worker's title."),
|
|
57
58
|
},
|
|
@@ -61,7 +62,7 @@ const listWorkers = {
|
|
|
61
62
|
const fleetHealth = {
|
|
62
63
|
name: "fleet_health",
|
|
63
64
|
title: "Fleet Health",
|
|
64
|
-
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.",
|
|
65
66
|
auth: "manager",
|
|
66
67
|
method: "get",
|
|
67
68
|
schema: {},
|
|
@@ -81,7 +82,7 @@ const accountUsage = {
|
|
|
81
82
|
const getWorker = {
|
|
82
83
|
name: "worker_get",
|
|
83
84
|
title: "Get Worker",
|
|
84
|
-
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).",
|
|
85
86
|
auth: "manager",
|
|
86
87
|
method: "get",
|
|
87
88
|
schema: {
|
|
@@ -93,12 +94,13 @@ 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"
|
|
99
101
|
? Math.max(30_000, (Math.min(55, Math.max(0, params.waitSeconds)) + 5) * 1000) : undefined,
|
|
100
102
|
title: "Run Worker Now",
|
|
101
|
-
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." +
|
|
102
104
|
DECISION_BLOCK_NOTE + HYBRID_NOTE +
|
|
103
105
|
RUNTIME_NOTE,
|
|
104
106
|
auth: "manager",
|
|
@@ -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: "
|
|
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: {
|
|
@@ -436,7 +439,7 @@ const createSchedule = {
|
|
|
436
439
|
name: "schedule_create",
|
|
437
440
|
title: "Create Schedule",
|
|
438
441
|
description: "Create a schedule for the worker. Per-type required fields: " + SCHEDULE_TYPE_HINT +
|
|
439
|
-
" 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." +
|
|
440
443
|
SCHEDULE_GATE_HINT +
|
|
441
444
|
SCHEDULE_OVERLAP_NOTE,
|
|
442
445
|
auth: "manager",
|
|
@@ -653,7 +656,7 @@ const deleteDelivery = {
|
|
|
653
656
|
const getInstruction = {
|
|
654
657
|
name: "instruction_get",
|
|
655
658
|
title: "Get Instruction",
|
|
656
|
-
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.",
|
|
657
660
|
auth: "manager",
|
|
658
661
|
method: "get",
|
|
659
662
|
schema: {
|
|
@@ -688,7 +691,7 @@ const setWorkerDecision = {
|
|
|
688
691
|
const setInstruction = {
|
|
689
692
|
name: "instruction_set",
|
|
690
693
|
title: "Set Instruction",
|
|
691
|
-
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.",
|
|
692
695
|
auth: "manager",
|
|
693
696
|
method: "put",
|
|
694
697
|
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("
|
|
702
|
-
selfFactsEnabled: z.boolean().optional().describe("
|
|
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) => ({
|
|
@@ -819,7 +822,7 @@ const GITHUB_SELECTION = z.object({
|
|
|
819
822
|
const kitInstallPreview = {
|
|
820
823
|
name: "kit_install_preview",
|
|
821
824
|
title: "Preview Kit Install",
|
|
822
|
-
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.",
|
|
823
826
|
auth: "manager",
|
|
824
827
|
method: "get",
|
|
825
828
|
schema: {
|
|
@@ -836,7 +839,7 @@ const kitInstallPreview = {
|
|
|
836
839
|
const kitInstall = {
|
|
837
840
|
name: "kit_install",
|
|
838
841
|
title: "Install Kit",
|
|
839
|
-
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.",
|
|
840
843
|
auth: "manager",
|
|
841
844
|
method: "post",
|
|
842
845
|
schema: {
|
|
@@ -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."),
|
|
@@ -853,7 +857,7 @@ const kitInstall = {
|
|
|
853
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."),
|
|
854
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."),
|
|
855
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."),
|
|
856
|
-
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."),
|
|
857
861
|
deployment: z.object({
|
|
858
862
|
modelSlug: z.string().max(64).optional().describe("Model to deploy on, from models_list. Omit for the kit's recommended model."),
|
|
859
863
|
maxUsdPerRun: z.number().min(0.01).max(1000).optional().describe("Hard per-run ceiling in USD. Omit for the platform default."),
|
|
@@ -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,
|
|
@@ -1050,11 +1055,11 @@ const setFleetBudget = {
|
|
|
1050
1055
|
// and completely inert: no schedule fires and worker_run answers 409
|
|
1051
1056
|
// not_deployed. Deploying is also where the model and the spend ceilings are
|
|
1052
1057
|
// chosen, which is why the writes sit behind their own scope.
|
|
1053
|
-
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.";
|
|
1054
1059
|
const listModels = {
|
|
1055
1060
|
name: "models_list",
|
|
1056
1061
|
title: "List Deployable Models",
|
|
1057
|
-
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." +
|
|
1058
1063
|
RUNTIME_NOTE,
|
|
1059
1064
|
auth: "manager",
|
|
1060
1065
|
method: "get",
|
|
@@ -1067,7 +1072,7 @@ const listModels = {
|
|
|
1067
1072
|
const listDeployments = {
|
|
1068
1073
|
name: "deployments_list",
|
|
1069
1074
|
title: "List Deployments",
|
|
1070
|
-
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." +
|
|
1071
1076
|
RUNTIME_NOTE,
|
|
1072
1077
|
auth: "manager",
|
|
1073
1078
|
method: "get",
|
|
@@ -1078,7 +1083,7 @@ const listDeployments = {
|
|
|
1078
1083
|
const getDeployment = {
|
|
1079
1084
|
name: "deployment_get",
|
|
1080
1085
|
title: "Get Deployment",
|
|
1081
|
-
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." +
|
|
1082
1087
|
RUNTIME_NOTE,
|
|
1083
1088
|
auth: "manager",
|
|
1084
1089
|
method: "get",
|
|
@@ -1092,7 +1097,7 @@ const getDeployment = {
|
|
|
1092
1097
|
const deployWorker = {
|
|
1093
1098
|
name: "worker_deploy",
|
|
1094
1099
|
title: "Deploy Worker",
|
|
1095
|
-
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." +
|
|
1096
1101
|
DEPLOYMENT_NOTE +
|
|
1097
1102
|
RUNTIME_NOTE +
|
|
1098
1103
|
NEW_SCOPE_NOTE,
|
|
@@ -1186,7 +1191,7 @@ const getWorkerPermissions = {
|
|
|
1186
1191
|
// and the vocabulary on the Directory server, validate, publish private, install.
|
|
1187
1192
|
const KIT_REF = z.string().min(1).max(120);
|
|
1188
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.";
|
|
1189
|
-
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." +
|
|
1190
1195
|
NEW_SCOPE_NOTE;
|
|
1191
1196
|
const kitRefParam = KIT_REF.describe(KIT_REF_HINT);
|
|
1192
1197
|
const kitRefPath = (params, suffix = "") => `${KITS_API}/${encodeURIComponent(String(params.kitRef))}${suffix}`;
|
|
@@ -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("
|
|
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.");
|
|
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("
|
|
1322
|
-
selfFactsEnabled: z.boolean().optional().describe("
|
|
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
|
|
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.";
|
|
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,
|