@workerkit/core 0.3.12 → 0.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ import { type ToolDescriptor } from "./types.js";
2
+ export declare const supportDescriptors: readonly ToolDescriptor[];
@@ -0,0 +1,35 @@
1
+ import { scrubSecrets } from "../redact.js";
2
+ import { z } from "../zod.js";
3
+ import { CREATE } from "./types.js";
4
+ // The subject and message are stored and emailed to the support inbox, and the
5
+ // agent is asked to paste error text and call arguments into them: key-shaped
6
+ // strings are redacted before they leave the process, whatever the agent wrote.
7
+ const redacted = (value) => (typeof value === "string" ? scrubSecrets(value) : value);
8
+ export const supportDescriptors = [
9
+ {
10
+ name: "support_request_create",
11
+ title: "Contact Support",
12
+ auth: "manager",
13
+ method: "post",
14
+ path: "/api/manage/support/requests",
15
+ schema: {
16
+ category: z.enum(["error", "bug", "app_request", "general"])
17
+ .describe("The kind of request. error: a WorkerKit tool or API call failed in a way you cannot fix; bug: something works incorrectly; app_request: an app or integration WorkerKit does not offer yet; general: billing, the account or any other question."),
18
+ subject: z.string().min(3).max(150).describe("One line that summarizes the request."),
19
+ message: z.string().min(10).max(2000)
20
+ .describe("What happened and what was expected. For an error: the tool called, its arguments without secrets, the HTTP status, and the error code and message exactly as returned."),
21
+ runId: z.string().uuid().optional().describe("The runId concerned, when the problem is about a run."),
22
+ workerId: z.string().uuid().optional().describe("The workerId concerned, when the problem is about a worker: the UUID workers_list returns, not the numeric tokenId."),
23
+ },
24
+ bodyBuilder: (params) => ({
25
+ category: params.category,
26
+ subject: redacted(params.subject),
27
+ message: redacted(params.message),
28
+ runId: params.runId,
29
+ workerId: params.workerId,
30
+ }),
31
+ annotations: CREATE,
32
+ description: "Contact WorkerKit support on the user's behalf and receive a PE-XXXXXX reference. Use it when a WorkerKit tool fails in a way you cannot fix: a 5xx, a refusal that does not explain itself, or a result that contradicts the documentation. Also use it when the user reports a bug, asks for an app or integration WorkerKit does not offer (app_request), or wants to reach the team about billing, the account or anything else (general). Do not file refusals that name their own fix, such as a missing scope (403 OPERATION_NOT_ALLOWED), a validation error or insufficient funds; follow the fix instead. For an error, put the tool called, the HTTP status and the error code and message exactly as returned in message, and pass runId or workerId when they apply. Never include API keys, tokens or other secrets. No scope is needed, but the key must belong to an active user of the account, because support replies to that user by email; a key without one is refused with 403 user_not_connected. Tell the user what you filed and give them the returned referenceNumber. File each problem once: send it again only after 503 support_unavailable, or after a 429 once its Retry-After has passed. Limited per account to 2 requests a minute, 5 an hour and 20 a day.",
33
+ },
34
+ ];
35
+ //# sourceMappingURL=support.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"support.js","sourceRoot":"","sources":["../../src/descriptors/support.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAuB,MAAM,YAAY,CAAC;AAEzD,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAE/F,MAAM,CAAC,MAAM,kBAAkB,GAA8B;IAC3D;QACE,IAAI,EAAE,wBAAwB;QAC9B,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,8BAA8B;QACpC,MAAM,EAAE;YACN,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;iBACzD,QAAQ,CAAC,kPAAkP,CAAC;YAC/P,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,uCAAuC,CAAC;YACrF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;iBAClC,QAAQ,CAAC,yKAAyK,CAAC;YACtL,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;YACrG,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qHAAqH,CAAC;SACvK;QACD,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACxB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;YACjC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;YACjC,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;SAC1B,CAAC;QACF,WAAW,EAAE,MAAM;QACnB,WAAW,EAAE,kuCAAkuC;KAChvC;CACF,CAAC","sourcesContent":["import { scrubSecrets } from \"../redact.js\";\nimport { z } from \"../zod.js\";\nimport { CREATE, type ToolDescriptor } from \"./types.js\";\n\n// The subject and message are stored and emailed to the support inbox, and the\n// agent is asked to paste error text and call arguments into them: key-shaped\n// strings are redacted before they leave the process, whatever the agent wrote.\nconst redacted = (value: unknown) => (typeof value === \"string\" ? scrubSecrets(value) : value);\n\nexport const supportDescriptors: readonly ToolDescriptor[] = [\n {\n name: \"support_request_create\",\n title: \"Contact Support\",\n auth: \"manager\",\n method: \"post\",\n path: \"/api/manage/support/requests\",\n schema: {\n category: z.enum([\"error\", \"bug\", \"app_request\", \"general\"])\n .describe(\"The kind of request. error: a WorkerKit tool or API call failed in a way you cannot fix; bug: something works incorrectly; app_request: an app or integration WorkerKit does not offer yet; general: billing, the account or any other question.\"),\n subject: z.string().min(3).max(150).describe(\"One line that summarizes the request.\"),\n message: z.string().min(10).max(2000)\n .describe(\"What happened and what was expected. For an error: the tool called, its arguments without secrets, the HTTP status, and the error code and message exactly as returned.\"),\n runId: z.string().uuid().optional().describe(\"The runId concerned, when the problem is about a run.\"),\n workerId: z.string().uuid().optional().describe(\"The workerId concerned, when the problem is about a worker: the UUID workers_list returns, not the numeric tokenId.\"),\n },\n bodyBuilder: (params) => ({\n category: params.category,\n subject: redacted(params.subject),\n message: redacted(params.message),\n runId: params.runId,\n workerId: params.workerId,\n }),\n annotations: CREATE,\n description: \"Contact WorkerKit support on the user's behalf and receive a PE-XXXXXX reference. Use it when a WorkerKit tool fails in a way you cannot fix: a 5xx, a refusal that does not explain itself, or a result that contradicts the documentation. Also use it when the user reports a bug, asks for an app or integration WorkerKit does not offer (app_request), or wants to reach the team about billing, the account or anything else (general). Do not file refusals that name their own fix, such as a missing scope (403 OPERATION_NOT_ALLOWED), a validation error or insufficient funds; follow the fix instead. For an error, put the tool called, the HTTP status and the error code and message exactly as returned in message, and pass runId or workerId when they apply. Never include API keys, tokens or other secrets. No scope is needed, but the key must belong to an active user of the account, because support replies to that user by email; a key without one is refused with 403 user_not_connected. Tell the user what you filed and give them the returned referenceNumber. File each problem once: send it again only after 503 support_unavailable, or after a 429 once its Retry-After has passed. Limited per account to 2 requests a minute, 5 an hour and 20 a day.\",\n },\n];\n"]}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @workerkit/core — the shareable WorkerKit surface: the HTTP client, the
2
- // tool-descriptor registry (95 manager + 9 anonymous directory tools), the
2
+ // tool-descriptor registry (97 manager + 9 anonymous directory tools), the
3
3
  // single wire-execution path, and the pure formatting/redaction helpers.
4
4
  // Deliberately MCP-free: MCP (or CLI) presentation lives with the consumer.
5
5
  export { PortEdenClient, WorkerKitClient, ResponseTooLargeError, } from "./client.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,2EAA2E;AAC3E,yEAAyE;AACzE,4EAA4E;AAE5E,OAAO,EACL,cAAc,EACd,eAAe,EACf,qBAAqB,GACtB,MAAM,aAAa,CAAC;AASrB,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC","sourcesContent":["// @workerkit/core — the shareable WorkerKit surface: the HTTP client, the\n// tool-descriptor registry (95 manager + 9 anonymous directory tools), the\n// single wire-execution path, and the pure formatting/redaction helpers.\n// Deliberately MCP-free: MCP (or CLI) presentation lives with the consumer.\n\nexport {\n PortEdenClient,\n WorkerKitClient,\n ResponseTooLargeError,\n} from \"./client.js\";\nexport type {\n ApiResult,\n ClientLogger,\n ClientOptions,\n QuotaInfo,\n RequestOpts,\n} from \"./client.js\";\n\nexport * from \"./descriptors/index.js\";\n\nexport { executeTool } from \"./execute.js\";\nexport type { ExecuteToolOpts } from \"./execute.js\";\n\nexport { isSuccess, quotaSuffix, retryAfterSuffix } from \"./errors.js\";\n\nexport { SECRET_PATTERNS, scrubSecrets } from \"./redact.js\";\n\nexport { z } from \"./zod.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,2EAA2E;AAC3E,yEAAyE;AACzE,4EAA4E;AAE5E,OAAO,EACL,cAAc,EACd,eAAe,EACf,qBAAqB,GACtB,MAAM,aAAa,CAAC;AASrB,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC","sourcesContent":["// @workerkit/core — the shareable WorkerKit surface: the HTTP client, the\n// tool-descriptor registry (97 manager + 9 anonymous directory tools), the\n// single wire-execution path, and the pure formatting/redaction helpers.\n// Deliberately MCP-free: MCP (or CLI) presentation lives with the consumer.\n\nexport {\n PortEdenClient,\n WorkerKitClient,\n ResponseTooLargeError,\n} from \"./client.js\";\nexport type {\n ApiResult,\n ClientLogger,\n ClientOptions,\n QuotaInfo,\n RequestOpts,\n} from \"./client.js\";\n\nexport * from \"./descriptors/index.js\";\n\nexport { executeTool } from \"./execute.js\";\nexport type { ExecuteToolOpts } from \"./execute.js\";\n\nexport { isSuccess, quotaSuffix, retryAfterSuffix } from \"./errors.js\";\n\nexport { SECRET_PATTERNS, scrubSecrets } from \"./redact.js\";\n\nexport { z } from \"./zod.js\";\n"]}
@@ -52,11 +52,13 @@ Hybrid runs are on demand; recurring runs are unsupported.
52
52
  ## Model compatibility
53
53
 
54
54
  Worker kind describes behavior, not a model vendor or version. Preserve model
55
- identifiers and version metadata returned by the API. Use the model identity supplied by the server; do not infer confidence semantics
56
- or silently substitute providers. `models_list` lists language models; it is not
57
- a decision-model picker.
55
+ identifiers and version metadata returned by the API. Use the model identity
56
+ supplied by the server; do not infer confidence semantics or silently substitute
57
+ providers. `models_list` lists language models and, in `decisionProfiles`, the
58
+ available classifiers; pass a profile's `profileId` as `decisionProfileId`.
58
59
 
59
- Consumers should validate inputs with each descriptor's Zod schema before calling
60
- `executeTool`; that function maps requests and does not perform schema validation.
60
+ `executeTool` parses the input of descriptors marked `strictInput` and throws
61
+ before any request when it is invalid or has unknown fields. Validate other
62
+ descriptors' input with their Zod schema before calling it.
61
63
  `ApiResult.data` preserves the API response. `mapData` is an optional compact
62
64
  presentation for human or agent output, not the raw receipt contract.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workerkit/core",
3
- "version": "0.3.12",
3
+ "version": "0.3.14",
4
4
  "description": "API client and tool descriptors for WorkerKit: manage AI workers and browse the public kits directory",
5
5
  "type": "module",
6
6
  "license": "MIT",