@workerkit/core 0.3.15 → 0.3.16

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +30 -9
  3. package/dist/contract-provenance.d.ts +6 -0
  4. package/dist/contract-provenance.js +8 -0
  5. package/dist/contract-provenance.js.map +1 -0
  6. package/dist/descriptors/actions.js +21 -19
  7. package/dist/descriptors/actions.js.map +1 -1
  8. package/dist/descriptors/app-discovery.d.ts +1 -0
  9. package/dist/descriptors/app-discovery.js +14 -12
  10. package/dist/descriptors/app-discovery.js.map +1 -1
  11. package/dist/descriptors/decision-authoring.js +7 -5
  12. package/dist/descriptors/decision-authoring.js.map +1 -1
  13. package/dist/descriptors/decision-receipt.js +1 -0
  14. package/dist/descriptors/decision-receipt.js.map +1 -1
  15. package/dist/descriptors/directory.js +13 -17
  16. package/dist/descriptors/directory.js.map +1 -1
  17. package/dist/descriptors/index.d.ts +1 -0
  18. package/dist/descriptors/index.js +2 -0
  19. package/dist/descriptors/index.js.map +1 -1
  20. package/dist/descriptors/manage.d.ts +8 -0
  21. package/dist/descriptors/manage.js +327 -360
  22. package/dist/descriptors/manage.js.map +1 -1
  23. package/dist/descriptors/onboarding.js +14 -13
  24. package/dist/descriptors/onboarding.js.map +1 -1
  25. package/dist/descriptors/support.js +5 -4
  26. package/dist/descriptors/support.js.map +1 -1
  27. package/dist/descriptors/types.d.ts +6 -0
  28. package/dist/descriptors/types.js +17 -0
  29. package/dist/descriptors/types.js.map +1 -1
  30. package/dist/guidance-coverage.d.ts +18 -0
  31. package/dist/guidance-coverage.js +102 -0
  32. package/dist/guidance-coverage.js.map +1 -0
  33. package/dist/guidance.d.ts +29 -0
  34. package/dist/guidance.js +44 -0
  35. package/dist/guidance.js.map +1 -0
  36. package/dist/index.d.ts +7 -0
  37. package/dist/index.js +7 -0
  38. package/dist/index.js.map +1 -1
  39. package/dist/instructions.d.ts +24 -0
  40. package/dist/instructions.js +73 -0
  41. package/dist/instructions.js.map +1 -0
  42. package/dist/profiles.d.ts +5 -0
  43. package/dist/profiles.js +18 -0
  44. package/dist/profiles.js.map +1 -0
  45. package/dist/redact.js +1 -0
  46. package/dist/redact.js.map +1 -1
  47. package/dist/scopes.d.ts +21 -0
  48. package/dist/scopes.js +74 -0
  49. package/dist/scopes.js.map +1 -0
  50. package/dist/text-audit.d.ts +43 -0
  51. package/dist/text-audit.js +62 -0
  52. package/dist/text-audit.js.map +1 -0
  53. package/dist/zod.js +1 -0
  54. package/dist/zod.js.map +1 -1
  55. package/package.json +13 -6
@@ -1,3 +1,4 @@
1
+ // Generated from the backend agent contract. Edit the backend source and re-import; do not edit here.
1
2
  // The public kits-directory tools: anonymous, read-only catalog tools over the
2
3
  // public directory API. Eight tools rather than one per REST endpoint — the about read
3
4
  // (what WorkerKit is and when an agent should reach for it), one vocabulary
@@ -23,11 +24,11 @@ const SITE = "https://workerkit.ai";
23
24
  const SLUG_HINT = "The kit's URL slug, as returned by kits_search (slug).";
24
25
  // Appended to every tool: the two facts an agent must never get wrong on a
25
26
  // public mount — no auth exists, and installing is out of its reach.
26
- const DIRECTORY_NOTE = " 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).";
27
+ const DIRECTORY_NOTE = " Public and anonymous, identical for everyone; reads only. Install: signed-in human at pageUrl, or kit_install_preview/kit_install on Manager /workers (installKits).";
27
28
  // The two authoring reads share one framing: they are what an agent reads BEFORE
28
29
  // writing a kit for the manager surface, and they are anonymous so it can draft
29
30
  // before it holds any credential.
30
- const AUTHORING_NOTE = " 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.";
31
+ const AUTHORING_NOTE = " Public and anonymous. On Manager /workers: kit_validate checks all sections, then kit_publish (publishKits). Publish PRIVATE first: only this account can install it via a signed-in human at pageUrl or kit_install, also the create-from-scratch path. Workers need apps connected on their operator (apps_list/app_connect). Add unsupported apps via mcp_server_create (credential), mcp_server_set_tools, then content.mcpServers.";
31
32
  const SEARCH_EMPTY_HINT = "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.";
32
33
  // publisher_get accepts no search filters, so the search hint above would tell an
33
34
  // agent to broaden filters it never set. Reachable: the profile 404s only when the
@@ -114,8 +115,7 @@ export function publisherPageFooter(data) {
114
115
  const directoryOverview = {
115
116
  name: "directory_overview",
116
117
  title: "Directory Overview",
117
- description: "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}." +
118
- DIRECTORY_NOTE,
118
+ description: "Read directory vocabulary before choosing kits_search filters. kitCount counts published kits; categories.jobFamilies/roles/industries supplies slug/name for category/industry. apps code/name/categoryCode/installable supplies app (installable:false can appear in kits but cannot be installed). appCategories code/name/members[{code,name,appCode}] supplies appCategory and installer choices (e.g. Slack/Teams). models model/normalized/kitCount supplies model (normalized or substring). modelTypes code/name/summary supplies none(Action)|language|decision|hybrid. Also sortOptions/triggerModes. No kits here: for popularity use kits_search's default downloads sort. Human pages: https://workerkit.ai/kit/{slug}." + DIRECTORY_NOTE,
119
119
  auth: "anonymous",
120
120
  method: "get",
121
121
  schema: {},
@@ -125,8 +125,7 @@ const directoryOverview = {
125
125
  const searchKits = {
126
126
  name: "kits_search",
127
127
  title: "Search Kits",
128
- description: "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, 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}." +
129
- DIRECTORY_NOTE,
128
+ description: "Search public worker templates: instructions, decision routing or Action tools, with pre-scoped app permissions and often schedules. All optional filters AND; omit to browse. Returns {items,totalCount,page,pageSize}. Cards: slug(kit_get key), name/jobSentence, publisherName/publisherSlug/isOfficialPublisher/verificationTier, apps/categorySlots(installer chooses member), categories/triggerModes, starCount, modelScores(publisher-declared 0-100 fit, best first)/recommendedModel, modelType(language|decision|hybrid|none), isProtected,isFeatured,publishedAt. Protected instruction TEXT is intentionally withheld; kit still works, not a red flag. Empty is not an error; read its footer and directory_overview for valid filters. Human page: https://workerkit.ai/kit/{slug}." + DIRECTORY_NOTE,
130
129
  auth: "anonymous",
131
130
  method: "get",
132
131
  schema: {
@@ -134,10 +133,10 @@ const searchKits = {
134
133
  category: z.string().optional().describe("Job-category slug (any kind — job family, role, or industry). Valid slugs: directory_overview → categories. Unknown slugs match nothing."),
135
134
  industry: z.string().optional().describe("Industry-kind category slug ONLY (a role/job-family slug here matches nothing). ANDs with category."),
136
135
  app: z.string().optional().describe("Exact app code the kit must use, e.g. 'email', 'slack', 'crm'. Valid codes: directory_overview → apps."),
137
- appCategory: z.string().optional().describe("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."),
136
+ appCategory: z.string().optional().describe("Capability category from directory_overview.appCategories: matches an install slot OR a pinned member app, broader than app. Unknown code errors with the fix."),
138
137
  model: z.string().max(80).optional().describe("Substring match on a scored model name, e.g. 'sonnet' or 'gpt'. Valid names: directory_overview → models."),
139
138
  trigger: z.enum(["onDemand", "scheduled", "event"]).optional().describe("How the kit's worker runs: onDemand (a human or agent triggers it), scheduled (ships recurring schedules), event (webhook-triggered)."),
140
- modelType: z.enum(["none", "language", "decision", "hybrid"]).optional().describe("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."),
139
+ modelType: z.enum(["none", "language", "decision", "hybrid"]).optional().describe("Worker type: none=direct Action tools; language=prose with installer-chosen model; decision=per-item routing without prose/model choice; hybrid=bounded classification then one language agent. Omit for all."),
141
140
  publisher: z.string().optional().describe("Publisher slug (publisherSlug on any card) — that publisher's kits only."),
142
141
  sort: z.enum(["downloads", "new", "name", "stars"]).default("downloads").describe("downloads = most installed (the popularity signal), new = latest published, name = A-Z, stars = most starred."),
143
142
  page: z.number().int().min(1).default(1).describe("1-based page number."),
@@ -156,8 +155,7 @@ const searchKits = {
156
155
  const getKit = {
157
156
  name: "kit_get",
158
157
  title: "Get Kit",
159
- description: "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), starCount, and pageUrl — the install page to hand to the human. 404 = no published kit with that slug." +
160
- DIRECTORY_NOTE,
158
+ description: "Inspect a kit before installation: description/appDescriptions (author app/tool notes), modelType, exact permissions, content and setup. none exposes actionSpec without a model; hybrid combines prose/classification; language is default. instructionContent is verbatim prose, empty if isProtected while instructionLength remains real; protected startCommand/endCommand/whenToUse are null, indistinguishable from absent. For decision, evaluate decisionNarration (sources/questions/routes/confidence fallback, also served when protected) and decisionSetup. permissionsManifest is EXACT installed access: operations/fields/scopes; numeric values are authoritative, names display-only. Summarize this for access questions. requiredInputs/memorySetup is the install form. memoryProfile stateless omits recent-run summaries, contextual includes bounded summaries; owner rules/injected facts apply to both. selfFactsEnabled permits unreviewed recall-only saves that later runs must search to use. Also schedules/triggers/usageWindows, modelScores with notes/starCount/pageUrl. skillResources always has key/kind/name; description/contentLength withheld when protected; includeResourceBodies fetches bodies. Surface hasExternalMcpShells when recommending: install creates account gateways to publisher URLs in permissionsManifest.mcpServers.shells. scan.outcome cleared|underReview are BOTH live/installable; underReview is an unsettled raised check, not unsafe. scannedAtUtc:null means pre-scanner publication. checks lists families run; static-only cleared is weaker than all three. Attribute recommendation safe|caution|doNotInstall to SkillSpector; independent of outcome and may disagree. caution means worth reviewing, including incomplete analysis. scan is absent with nothing to report, never includes findings. 404:no published kit for slug." + DIRECTORY_NOTE,
161
159
  auth: "anonymous",
162
160
  method: "get",
163
161
  schema: {
@@ -176,8 +174,7 @@ const getKit = {
176
174
  const getPublisher = {
177
175
  name: "publisher_get",
178
176
  title: "Get Publisher",
179
- description: "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 (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." +
180
- DIRECTORY_NOTE,
177
+ description: "Inspect a publisher and its published kits for the 'who is behind this?' check. Returns {publisher,kits,pageUrl}. publisher: name,isOfficial(WorkerKit), xHandle(x.com),gitHubHandle(github.com),linkedInUrl,description,createDate(member since),kitCount(published only). kits uses the paginated kits_search card shape, scoped to this publisher. 404:unknown publisher or none currently published." + DIRECTORY_NOTE,
181
178
  auth: "anonymous",
182
179
  method: "get",
183
180
  schema: {
@@ -200,7 +197,7 @@ const GUIDE_SECTIONS = ["index", "decision", "schema", "rules", "skill", "state"
200
197
  const kitAuthoringGuide = {
201
198
  name: "kit_authoring_guide",
202
199
  title: "Kit Authoring Guide",
203
- description: "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,
200
+ description: "Read kit authoring guidance one Markdown section at a time, with table of contents. Classification/scoring/filtering/triage: decision has recipes, typed questions, creation examples/results. Action(modelType none): index/schema; quickest create path is action_worker_options then action_worker_create on Manager. Full kit authoring: index, then schema/rules; state covers Records, memory and context hygiene; fetch other sections as needed. Unknown section:400 with valid names. Live sources:kit_app_tools; exact permission keys:kit_vocabulary. On Manager /workers, kit_validate the exact body then kit_publish (publishKits). Publish private, install and prove a run (Action:tool call) before public promotion with kit_replace." + DIRECTORY_NOTE,
204
201
  auth: "anonymous",
205
202
  method: "get",
206
203
  schema: {
@@ -212,8 +209,7 @@ const kitAuthoringGuide = {
212
209
  const kitVocabulary = {
213
210
  name: "kit_vocabulary",
214
211
  title: "Kit Authoring Vocabulary",
215
- description: "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." +
216
- AUTHORING_NOTE,
212
+ description: "Read the exact live keys before writing content.apps/categorySlots/categorySlugs; strict validation, no 'all' shorthand. Without app: apps[] code/name/summary, operations(tool KEYS), fields, supported axes(readOperations,masterAccessLevels,writableFields,providers,channels,objectTypes,scopePolicies,contentTypeScopes,capabilities,supportsAllowAll,supportsWriteEnabled,subApps,installable); concreteApps[] vendor tiles with standalone|provider|slotMember|subApp kind and content mapping; appCategories[] members/labelAlias/genericName; categories.jobFamilies/roles/industries(the valid categorySlugs); models; mcpApps(id=gatewayId,tools[].toolId=toolIds); note. Own MCP servers: mcp_servers_list on Manager. With app: {app,vendors,tools,note}; tools describes installed-worker tools: name(use in prose),description,readOnly,argsSchema,decisionSource result mapping where known,requires(grant one listed operations key). toolsNote replaces an unavailable catalog. Full response is large: read once/task, then per-app; kit_app_tools explores all app capabilities in one call. Unknown app:400 with valid codes." + AUTHORING_NOTE,
217
213
  auth: "anonymous",
218
214
  method: "get",
219
215
  schema: {
@@ -225,7 +221,7 @@ const kitVocabulary = {
225
221
  const kitAppTools = {
226
222
  name: "kit_app_tools",
227
223
  title: "Kit App Tools",
228
- description: "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,
224
+ description: "Discover app tool capabilities. purpose:decision returns convenience source recipes, evidence fields, argument schemas, read permissions, limits and editable decision_worker_create examples; app narrows email/calendar/drive recipes. Public capability data only; apps_list checks account connections. Without purpose: apps[] in catalog order with operations and tools[{name,title,description,readOnly,argsSchema,decisionSource,requires,provider,scope,hosted}]. requires grants one listed operations key; absent means the tool comes with the app. provider pins a vendor, scope a Drive content family; hosted:false excludes hosted runs. toolsNote replaces unavailable catalogs. Platform MCP tools:kit_vocabulary.mcpApps; unsupported apps:mcp_server_create. Unknown app:400 with valid codes. Responses are cacheable public capability data; connectionStatus:not_checked is not live authorization. Recipes are not an allowlist: arbitrary sources/routed actions use the general catalog, argsSchema/result mapping, then kit_validate -> kit_publish(private) -> kit_install. Validation checks structure/grants, not live access. Action tool selection: action_worker_options. Detailed permission axes:kit_vocabulary." + DIRECTORY_NOTE,
229
225
  auth: "anonymous",
230
226
  method: "get",
231
227
  schema: {
@@ -245,7 +241,7 @@ const ABOUT_SECTIONS = ["index", "why", "operate", "access", "cost", "start"];
245
241
  const workerkitAbout = {
246
242
  name: "workerkit_about",
247
243
  title: "About WorkerKit",
248
- description: "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,
244
+ description: "Read what WorkerKit does and when to use it: index/why/operate/access/cost/start. Workers classify, score, triage, monitor and run jobs with app grants, budgets and receipts. Action(modelType none) exposes tools without a model: action_worker_options/create then worker_tool_call. For custom classification: kit_app_tools(purpose:decision), kit_authoring_guide(section:decision), decision_worker_create. Reuse templates via kits_search(modelType:decision); key_info shows account scopes." + DIRECTORY_NOTE,
249
245
  auth: "anonymous",
250
246
  method: "get",
251
247
  schema: {
@@ -1 +1 @@
1
- {"version":3,"file":"directory.js","sourceRoot":"","sources":["../../src/descriptors/directory.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,uFAAuF;AACvF,4EAA4E;AAC5E,gFAAgF;AAChF,gFAAgF;AAChF,sCAAsC;AACtC,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;AACjC,MAAM,IAAI,GAAG,sBAAsB,CAAC;AAEpC,+EAA+E;AAE/E,MAAM,SAAS,GAAG,wDAAwD,CAAC;AAE3E,2EAA2E;AAC3E,qEAAqE;AACrE,MAAM,cAAc,GAClB,2ZAA2Z,CAAC;AAE9Z,iFAAiF;AACjF,gFAAgF;AAChF,kCAAkC;AAClC,MAAM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;AAC/E,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;AAChF,gFAAgF;AAChF,8DAA8D;AAE9D,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AAEvF,MAAM,cAAc,GAAmB;IACrC,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,iBAAiB;IACxB,WAAW,EACT,6nBAA6nB,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,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. Eight 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 publisher profile, and the three authoring\n// reads (the guide, the permission vocabulary an author needs, and the explorer\n// 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, 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), 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 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 (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 getPublisher,\n kitAuthoringGuide,\n kitVocabulary,\n kitAppTools,\n];\n"]}
1
+ {"version":3,"file":"directory.js","sourceRoot":"","sources":["../../src/descriptors/directory.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,+EAA+E;AAC/E,uFAAuF;AACvF,4EAA4E;AAC5E,gFAAgF;AAChF,gFAAgF;AAChF,sCAAsC;AACtC,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;AACjC,MAAM,IAAI,GAAG,sBAAsB,CAAC;AAEpC,+EAA+E;AAE/E,MAAM,SAAS,GAAG,wDAAwD,CAAC;AAE3E,2EAA2E;AAC3E,qEAAqE;AACrE,MAAM,cAAc,GAClB,uKAAuK,CAAC;AAE1K,iFAAiF;AACjF,gFAAgF;AAChF,kCAAkC;AAClC,MAAM,cAAc,GAClB,0aAA0a,CAAC;AAM7a,MAAM,iBAAiB,GACrB,giBAAgiB,CAAC;AAEniB,kFAAkF;AAClF,mFAAmF;AACnF,gFAAgF;AAChF,8EAA8E;AAC9E,yCAAyC;AACzC,MAAM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O,CAAU,CAAC;AAEvF,MAAM,cAAc,GAAmB;IACrC,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,iBAAiB;IACxB,WAAW,EACT,yeAAye,GAAG,cAAc;IAC5f,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,YAAY;IACZ,iBAAiB;IACjB,aAAa;IACb,WAAW;CACZ,CAAC","sourcesContent":["// Generated from the backend agent contract. Edit the backend source and re-import; do not edit here.\n// The public kits-directory tools: anonymous, read-only catalog tools over the\n// public directory API. Eight 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 publisher profile, and the three authoring\n// reads (the guide, the permission vocabulary an author needs, and the explorer\n// 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, identical for everyone; reads only. Install: signed-in human at pageUrl, or kit_install_preview/kit_install on Manager /workers (installKits).\";\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. On Manager /workers: kit_validate checks all sections, then kit_publish (publishKits). Publish PRIVATE first: only this account can install it via a signed-in human at pageUrl or kit_install, also the create-from-scratch path. Workers need apps connected on their operator (apps_list/app_connect). Add unsupported apps via mcp_server_create (credential), mcp_server_set_tools, then content.mcpServers.\";\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 \"Read directory vocabulary before choosing kits_search filters. kitCount counts published kits; categories.jobFamilies/roles/industries supplies slug/name for category/industry. apps code/name/categoryCode/installable supplies app (installable:false can appear in kits but cannot be installed). appCategories code/name/members[{code,name,appCode}] supplies appCategory and installer choices (e.g. Slack/Teams). models model/normalized/kitCount supplies model (normalized or substring). modelTypes code/name/summary supplies none(Action)|language|decision|hybrid. Also sortOptions/triggerModes. No kits here: for popularity use kits_search's default downloads sort. Human pages: https://workerkit.ai/kit/{slug}.\" + 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 public worker templates: instructions, decision routing or Action tools, with pre-scoped app permissions and often schedules. All optional filters AND; omit to browse. Returns {items,totalCount,page,pageSize}. Cards: slug(kit_get key), name/jobSentence, publisherName/publisherSlug/isOfficialPublisher/verificationTier, apps/categorySlots(installer chooses member), categories/triggerModes, starCount, modelScores(publisher-declared 0-100 fit, best first)/recommendedModel, modelType(language|decision|hybrid|none), isProtected,isFeatured,publishedAt. Protected instruction TEXT is intentionally withheld; kit still works, not a red flag. Empty is not an error; read its footer and directory_overview for valid filters. Human page: https://workerkit.ai/kit/{slug}.\" + 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 from directory_overview.appCategories: matches an install slot OR a pinned member app, broader than app. Unknown code errors with the fix.\"\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 \"Worker type: none=direct Action tools; language=prose with installer-chosen model; decision=per-item routing without prose/model choice; hybrid=bounded classification then one language agent. Omit for all.\"\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 \"Inspect a kit before installation: description/appDescriptions (author app/tool notes), modelType, exact permissions, content and setup. none exposes actionSpec without a model; hybrid combines prose/classification; language is default. instructionContent is verbatim prose, empty if isProtected while instructionLength remains real; protected startCommand/endCommand/whenToUse are null, indistinguishable from absent. For decision, evaluate decisionNarration (sources/questions/routes/confidence fallback, also served when protected) and decisionSetup. permissionsManifest is EXACT installed access: operations/fields/scopes; numeric values are authoritative, names display-only. Summarize this for access questions. requiredInputs/memorySetup is the install form. memoryProfile stateless omits recent-run summaries, contextual includes bounded summaries; owner rules/injected facts apply to both. selfFactsEnabled permits unreviewed recall-only saves that later runs must search to use. Also schedules/triggers/usageWindows, modelScores with notes/starCount/pageUrl. skillResources always has key/kind/name; description/contentLength withheld when protected; includeResourceBodies fetches bodies. Surface hasExternalMcpShells when recommending: install creates account gateways to publisher URLs in permissionsManifest.mcpServers.shells. scan.outcome cleared|underReview are BOTH live/installable; underReview is an unsettled raised check, not unsafe. scannedAtUtc:null means pre-scanner publication. checks lists families run; static-only cleared is weaker than all three. Attribute recommendation safe|caution|doNotInstall to SkillSpector; independent of outcome and may disagree. caution means worth reviewing, including incomplete analysis. scan is absent with nothing to report, never includes findings. 404:no published kit for slug.\" + 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 getPublisher: ToolDescriptor = {\n name: \"publisher_get\",\n title: \"Get Publisher\",\n description:\n \"Inspect a publisher and its published kits for the 'who is behind this?' check. Returns {publisher,kits,pageUrl}. publisher: name,isOfficial(WorkerKit), xHandle(x.com),gitHubHandle(github.com),linkedInUrl,description,createDate(member since),kitCount(published only). kits uses the paginated kits_search card shape, scoped to this publisher. 404:unknown publisher or none currently published.\" + 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 \"Read kit authoring guidance one Markdown section at a time, with table of contents. Classification/scoring/filtering/triage: decision has recipes, typed questions, creation examples/results. Action(modelType none): index/schema; quickest create path is action_worker_options then action_worker_create on Manager. Full kit authoring: index, then schema/rules; state covers Records, memory and context hygiene; fetch other sections as needed. Unknown section:400 with valid names. Live sources:kit_app_tools; exact permission keys:kit_vocabulary. On Manager /workers, kit_validate the exact body then kit_publish (publishKits). Publish private, install and prove a run (Action:tool call) before public promotion with kit_replace.\" + 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 \"Read the exact live keys before writing content.apps/categorySlots/categorySlugs; strict validation, no 'all' shorthand. Without app: apps[] code/name/summary, operations(tool KEYS), fields, supported axes(readOperations,masterAccessLevels,writableFields,providers,channels,objectTypes,scopePolicies,contentTypeScopes,capabilities,supportsAllowAll,supportsWriteEnabled,subApps,installable); concreteApps[] vendor tiles with standalone|provider|slotMember|subApp kind and content mapping; appCategories[] members/labelAlias/genericName; categories.jobFamilies/roles/industries(the valid categorySlugs); models; mcpApps(id=gatewayId,tools[].toolId=toolIds); note. Own MCP servers: mcp_servers_list on Manager. With app: {app,vendors,tools,note}; tools describes installed-worker tools: name(use in prose),description,readOnly,argsSchema,decisionSource result mapping where known,requires(grant one listed operations key). toolsNote replaces an unavailable catalog. Full response is large: read once/task, then per-app; kit_app_tools explores all app capabilities in one call. Unknown app:400 with valid codes.\" + 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 app tool capabilities. purpose:decision returns convenience source recipes, evidence fields, argument schemas, read permissions, limits and editable decision_worker_create examples; app narrows email/calendar/drive recipes. Public capability data only; apps_list checks account connections. Without purpose: apps[] in catalog order with operations and tools[{name,title,description,readOnly,argsSchema,decisionSource,requires,provider,scope,hosted}]. requires grants one listed operations key; absent means the tool comes with the app. provider pins a vendor, scope a Drive content family; hosted:false excludes hosted runs. toolsNote replaces unavailable catalogs. Platform MCP tools:kit_vocabulary.mcpApps; unsupported apps:mcp_server_create. Unknown app:400 with valid codes. Responses are cacheable public capability data; connectionStatus:not_checked is not live authorization. Recipes are not an allowlist: arbitrary sources/routed actions use the general catalog, argsSchema/result mapping, then kit_validate -> kit_publish(private) -> kit_install. Validation checks structure/grants, not live access. Action tool selection: action_worker_options. Detailed permission axes:kit_vocabulary.\" + 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 \"Read what WorkerKit does and when to use it: index/why/operate/access/cost/start. Workers classify, score, triage, monitor and run jobs with app grants, budgets and receipts. Action(modelType none) exposes tools without a model: action_worker_options/create then worker_tool_call. For custom classification: kit_app_tools(purpose:decision), kit_authoring_guide(section:decision), decision_worker_create. Reuse templates via kits_search(modelType:decision); key_info shows account scopes.\" + 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 getPublisher,\n kitAuthoringGuide,\n kitVocabulary,\n kitAppTools,\n];\n"]}
@@ -7,3 +7,4 @@ import type { ToolDescriptor } from "./types.js";
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;
10
+ export { toolDocumentation } from "./types.js";
@@ -1,3 +1,4 @@
1
+ // Generated from the backend agent contract. Edit the backend source and re-import; do not edit here.
1
2
  export { CREATE, DELETE, READ_ONLY, TRIGGER, UPDATE, } from "./types.js";
2
3
  export { manageDescriptors } from "./manage.js";
3
4
  export { directoryDescriptors, kitDetailData, kitDetailFooter, kitListData, listFooter, publisherPageData, publisherPageFooter, } from "./directory.js";
@@ -13,4 +14,5 @@ const byNameIndex = new Map(allDescriptors.map((d) => [d.name, d]));
13
14
  export function byName(name) {
14
15
  return byNameIndex.get(name);
15
16
  }
17
+ export { toolDocumentation } from "./types.js";
16
18
  //# sourceMappingURL=index.js.map
@@ -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 — 97 manager + 8 anonymous. */\nexport const allDescriptors: readonly ToolDescriptor[] = [\n ...manageDescriptors,\n ...directoryDescriptors,\n];\n\nconst byNameIndex = new Map(allDescriptors.map((d) => [d.name, d]));\n\n/** Look a descriptor up by its tool name. */\nexport function byName(name: string): ToolDescriptor | undefined {\n return byNameIndex.get(name);\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,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;AAED,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC","sourcesContent":["// Generated from the backend agent contract. Edit the backend source and re-import; do not edit here.\nexport {\n CREATE,\n DELETE,\n READ_ONLY,\n TRIGGER,\n UPDATE,\n} from \"./types.js\";\nexport type { HttpMethod, ToolAnnotations, ToolDescriptor } from \"./types.js\";\n\nexport { manageDescriptors } from \"./manage.js\";\nexport {\n directoryDescriptors,\n kitDetailData,\n kitDetailFooter,\n kitListData,\n listFooter,\n publisherPageData,\n publisherPageFooter,\n} from \"./directory.js\";\n\nimport type { ToolDescriptor } from \"./types.js\";\nimport { manageDescriptors } from \"./manage.js\";\nimport { directoryDescriptors } from \"./directory.js\";\n\n/** Every descriptor this package ships — 97 manager + 8 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\nexport { toolDocumentation } from \"./types.js\";\n"]}
@@ -1,2 +1,10 @@
1
1
  import { type ToolDescriptor } from "./types.js";
2
2
  export declare const manageDescriptors: readonly ToolDescriptor[];
3
+ export declare const manageTextFragments: {
4
+ readonly score: " Grading: selfScore (0-100) is the run's self-report, explained by selfScoreReason; ownerScore (0-100) is the human grade and overrides it. All three are null when unassessed (including stateless and very short runs): never treat null as zero or include it in averages.";
5
+ readonly clone: " Copies only source-approved permissions; flags select instruction, OWNER-authored active memory, schedules, deliveries and deployment. Agent facts and instruction history never copy; history starts at version 1. Schedules arrive disabled. Webhooks arrive disabled without secrets: delivery_secret_rotate, then delivery_update to enable. Per-run/day ceilings copy, multiplying fleet exposure: read fleet_budget_get before bulk cloning. Protected-kit instruction with includeInstruction:true is refused; reinstall the kit or set false.";
6
+ readonly scheduleType: "EveryNMinutes (intervalValue 1–1440), EveryNHours (intervalValue 1–168), DailyAtTime (timeOfDayMinutes required — wall-clock minutes past midnight in the effective time zone, DST-correct), or OneShot (anchorUtc required, must be in the future). Input is parsed case-insensitively; responses always return the PascalCase form.";
7
+ readonly scheduleGate: " 402 feature_gated {feature,upgradeTrigger,message} is terminal: schedule_cadence excludes minute schedules (choose EveryNHours/DailyAtTime); schedule_count caps recurring schedules (OneShot does not count). Choose an allowed option or ask the human to upgrade.";
8
+ readonly scheduleOverlap: " Schedules never overlap any in-flight run of their worker: a blocked fire produces Skipped/ConcurrencyLimit regardless of plan concurrency. Space fires beyond run duration. On-demand runs may overlap scheduled runs up to the plan limit.";
9
+ readonly budgetWindow: " Dollar day/month ceilings reset at UTC midnight (month on the 1st); maxRunsPerDay uses the worker's timeZoneId, default UTC, matching its scheduler.";
10
+ };