@workerkit/core 0.3.8 → 0.3.10

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.
@@ -11,7 +11,7 @@ export const onboardingDescriptors = [
11
11
  provider: z.string().max(40).optional().describe("Optional model provider to check."),
12
12
  },
13
13
  annotations: READ_ONLY,
14
- description: "Read this credential’s scopes/expiry, account model-funding requirements and human-approved spendPolicy with remaining reserved allowance. No additional scope required. Agents cannot raise the account ceiling; it applies to scheduled and manual runs. If humanActionRequired is true, show the returned setup URL. The user enters provider keys on WorkerKit, never in chat. BYOK can still require wallet credits for platform fees and metered apps. After funding, check worker readiness, deploy and run; runtime guards remain authoritative.",
14
+ description: "Read this credential’s scopes/expiry, account model-funding requirements and human-approved spendPolicy. The policy counts settled model cost plus BYOK fees and outstanding reservations: headroom is maxUsdPerDay minus spentTodayUsd minus reservedTodayUsd (monthly: maxUsdPerMonth minus spentThisMonthUsd minus reservedMonthUsd). Completion replaces the hold with receipt cost. Active holds cross UTC boundaries; interrupted runs with unknown cost retain their original-window hold. Use dayResetsAtUtc, monthResetsAtUtc and serverTimeUtc. Older responses without spent/reset fields counted cumulative reservations. No additional scope required. Agents cannot raise this ceiling; it applies to scheduled and manual runs. A refusal carries skipReason FleetSpendCap and errorCode human_spend_ceiling; fleet_spend_cap identifies the separately editable fleet budget. If humanActionRequired is true, show the returned setup URL. The user enters provider keys on WorkerKit, never in chat. BYOK can still require wallet credits for platform fees and metered apps. After funding, check worker readiness, deploy and run; runtime guards remain authoritative.",
15
15
  },
16
16
  {
17
17
  name: "wallet_get",
@@ -1 +1 @@
1
- {"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../src/descriptors/onboarding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAuB,MAAM,YAAY,CAAC;AAE5D,MAAM,CAAC,MAAM,qBAAqB,GAA8B;IAC9D;QACE,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Ac,CAAC,EAAE,CAAC;QACjF,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;QACvG,WAAW,EAAE,iYAAiY;KAC/Y;IACD;QACE,IAAI,EAAE,qBAAqB;QAC3B,KAAK,EAAE,sBAAsB;QAC7B,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,gCAAgC,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE;QAChG,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;QACvB,MAAM,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACjD,WAAW,EAAE,SAAS;QACtB,WAAW,EAAE,uUAAuU;KACrV;CACF,CAAC","sourcesContent":["import { z } from \"../zod.js\";\nimport { READ_ONLY, type ToolDescriptor } from \"./types.js\";\n\nexport const onboardingDescriptors: readonly ToolDescriptor[] = [\n {\n name: \"onboarding_get\",\n title: \"Check onboarding requirements\",\n auth: \"manager\",\n method: \"get\",\n path: \"/api/manage/onboarding\",\n schema: {\n provider: z.string().max(40).optional().describe(\"Optional model provider to check.\"),\n },\n annotations: READ_ONLY,\n description: \"Read this credential’s scopes/expiry, account model-funding requirements and human-approved spendPolicy with remaining reserved allowance. No additional scope required. Agents cannot raise the account ceiling; it applies to scheduled and manual runs. If humanActionRequired is true, show the returned setup URL. The user enters provider keys on WorkerKit, never in chat. BYOK can still require wallet credits for platform fees and metered apps. After funding, check worker readiness, deploy and run; runtime guards remain authoritative.\",\n },\n {\n name: \"wallet_get\",\n title: \"Read wallet\",\n auth: \"manager\",\n method: \"get\",\n path: \"/api/manage/wallet\",\n schema: {},\n annotations: READ_ONLY,\n description: \"Read spendable wallet balance and checkout fee/amount limits. Requires readWallet. A wallet balance is not evidence that a particular checkout was credited; use wallet_checkout_get for that.\",\n },\n {\n name: \"wallet_checkout_create\",\n title: \"Request wallet funding\",\n auth: \"manager\",\n method: \"post\",\n path: \"/api/manage/wallet/checkouts\",\n schema: {\n amountUsd: z.number().min(0.01).max(999999.99).multipleOf(0.01)\n .describe(\"Credit amount in whole cents, before the returned platform fee. Read wallet_get for current purchase limits.\"),\n idempotencyKey: z.string().min(1).max(200).regex(/^[\\x21-\\x7E]+$/)\n .describe(\"Unique printable-ASCII purchase request ID. Reuse only for retries of the same amount.\"),\n },\n bodyBuilder: (params) => ({ amountUsd: params.amountUsd }),\n headerBuilder: (params) => ({ \"Idempotency-Key\": String(params.idempotencyKey) }),\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },\n description: \"Create a Stripe Checkout link for a specific wallet credit purchase. Requires requestWalletTopUp. Show the credit, fee and total and ask the user to open checkout and confirm payment. Never ask for card details or charge a saved card. Poll wallet_checkout_get after payment; only credited confirms funds reached the ledger. Reuse idempotencyKey for retries, never a different amount.\",\n },\n {\n name: \"wallet_checkout_get\",\n title: \"Check wallet payment\",\n auth: \"manager\",\n method: \"get\",\n path: (params) => `/api/manage/wallet/checkouts/${encodeURIComponent(String(params.sessionId))}`,\n paramFilter: () => ({}),\n schema: { sessionId: z.string().min(1).max(255) },\n annotations: READ_ONLY,\n description: \"Check pending, paid_pending_credit, credited or expired checkout status. Requires readWallet, or requestWalletTopUp for a checkout created by this credential. Only credited means the wallet ledger has committed. Wait at least five seconds between checks; stop on credited or expired and use bounded waits for delayed payment.\",\n },\n];\n"]}
1
+ {"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../src/descriptors/onboarding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAuB,MAAM,YAAY,CAAC;AAE5D,MAAM,C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BAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;QACjF,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;QACvG,WAAW,EAAE,iYAAiY;KAC/Y;IACD;QACE,IAAI,EAAE,qBAAqB;QAC3B,KAAK,EAAE,sBAAsB;QAC7B,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,gCAAgC,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE;QAChG,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;QACvB,MAAM,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACjD,WAAW,EAAE,SAAS;QACtB,WAAW,EAAE,uUAAuU;KACrV;CACF,CAAC","sourcesContent":["import { z } from \"../zod.js\";\nimport { READ_ONLY, type ToolDescriptor } from \"./types.js\";\n\nexport const onboardingDescriptors: readonly ToolDescriptor[] = [\n {\n name: \"onboarding_get\",\n title: \"Check onboarding requirements\",\n auth: \"manager\",\n method: \"get\",\n path: \"/api/manage/onboarding\",\n schema: {\n provider: z.string().max(40).optional().describe(\"Optional model provider to check.\"),\n },\n annotations: READ_ONLY,\n description: \"Read this credential’s scopes/expiry, account model-funding requirements and human-approved spendPolicy. The policy counts settled model cost plus BYOK fees and outstanding reservations: headroom is maxUsdPerDay minus spentTodayUsd minus reservedTodayUsd (monthly: maxUsdPerMonth minus spentThisMonthUsd minus reservedMonthUsd). Completion replaces the hold with receipt cost. Active holds cross UTC boundaries; interrupted runs with unknown cost retain their original-window hold. Use dayResetsAtUtc, monthResetsAtUtc and serverTimeUtc. Older responses without spent/reset fields counted cumulative reservations. No additional scope required. Agents cannot raise this ceiling; it applies to scheduled and manual runs. A refusal carries skipReason FleetSpendCap and errorCode human_spend_ceiling; fleet_spend_cap identifies the separately editable fleet budget. If humanActionRequired is true, show the returned setup URL. The user enters provider keys on WorkerKit, never in chat. BYOK can still require wallet credits for platform fees and metered apps. After funding, check worker readiness, deploy and run; runtime guards remain authoritative.\",\n },\n {\n name: \"wallet_get\",\n title: \"Read wallet\",\n auth: \"manager\",\n method: \"get\",\n path: \"/api/manage/wallet\",\n schema: {},\n annotations: READ_ONLY,\n description: \"Read spendable wallet balance and checkout fee/amount limits. Requires readWallet. A wallet balance is not evidence that a particular checkout was credited; use wallet_checkout_get for that.\",\n },\n {\n name: \"wallet_checkout_create\",\n title: \"Request wallet funding\",\n auth: \"manager\",\n method: \"post\",\n path: \"/api/manage/wallet/checkouts\",\n schema: {\n amountUsd: z.number().min(0.01).max(999999.99).multipleOf(0.01)\n .describe(\"Credit amount in whole cents, before the returned platform fee. Read wallet_get for current purchase limits.\"),\n idempotencyKey: z.string().min(1).max(200).regex(/^[\\x21-\\x7E]+$/)\n .describe(\"Unique printable-ASCII purchase request ID. Reuse only for retries of the same amount.\"),\n },\n bodyBuilder: (params) => ({ amountUsd: params.amountUsd }),\n headerBuilder: (params) => ({ \"Idempotency-Key\": String(params.idempotencyKey) }),\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },\n description: \"Create a Stripe Checkout link for a specific wallet credit purchase. Requires requestWalletTopUp. Show the credit, fee and total and ask the user to open checkout and confirm payment. Never ask for card details or charge a saved card. Poll wallet_checkout_get after payment; only credited confirms funds reached the ledger. Reuse idempotencyKey for retries, never a different amount.\",\n },\n {\n name: \"wallet_checkout_get\",\n title: \"Check wallet payment\",\n auth: \"manager\",\n method: \"get\",\n path: (params) => `/api/manage/wallet/checkouts/${encodeURIComponent(String(params.sessionId))}`,\n paramFilter: () => ({}),\n schema: { sessionId: z.string().min(1).max(255) },\n annotations: READ_ONLY,\n description: \"Check pending, paid_pending_credit, credited or expired checkout status. Requires readWallet, or requestWalletTopUp for a checkout created by this credential. Only credited means the wallet ledger has committed. Wait at least five seconds between checks; stop on credited or expired and use bounded waits for delayed payment.\",\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 (84 manager + 9 anonymous directory tools), the
2
+ // tool-descriptor registry (88 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 (84 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 (88 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workerkit/core",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
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",