@paybond/kit 0.11.0 → 0.11.1

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 (33) hide show
  1. package/README.md +59 -15
  2. package/dist/cli/agent/demo-loaders.d.ts +4 -0
  3. package/dist/cli/agent/demo-loaders.js +66 -0
  4. package/dist/cli/commands/agent.js +5 -4
  5. package/dist/dev/trace-buffer.js +1 -1
  6. package/dist/mcp-server.js +1 -1
  7. package/package.json +1 -1
  8. package/templates/manifest.json +9 -9
  9. package/templates/openai-shopping-agent/.github/workflows/smoke.yml +1 -1
  10. package/templates/openai-shopping-agent/package-lock.json +1525 -0
  11. package/templates/openai-shopping-agent/package.json +1 -1
  12. package/templates/paybond-aws-operator/.github/workflows/smoke.yml +1 -1
  13. package/templates/paybond-aws-operator/package-lock.json +151 -0
  14. package/templates/paybond-aws-operator/package.json +1 -1
  15. package/templates/paybond-claude-agents-demo/.github/workflows/smoke.yml +1 -1
  16. package/templates/paybond-claude-agents-demo/package-lock.json +1489 -0
  17. package/templates/paybond-claude-agents-demo/package.json +1 -1
  18. package/templates/paybond-invoice-agent/requirements.txt +1 -1
  19. package/templates/paybond-mcp-coding-agent/.github/workflows/smoke.yml +1 -1
  20. package/templates/paybond-mcp-coding-agent/package-lock.json +151 -0
  21. package/templates/paybond-mcp-coding-agent/package.json +1 -1
  22. package/templates/paybond-openai-agents-demo/.github/workflows/smoke.yml +1 -1
  23. package/templates/paybond-openai-agents-demo/package-lock.json +1525 -0
  24. package/templates/paybond-openai-agents-demo/package.json +1 -1
  25. package/templates/paybond-procurement-agent/.github/workflows/smoke.yml +1 -1
  26. package/templates/paybond-procurement-agent/package-lock.json +151 -0
  27. package/templates/paybond-procurement-agent/package.json +1 -1
  28. package/templates/paybond-travel-agent/.github/workflows/smoke.yml +1 -1
  29. package/templates/paybond-travel-agent/package-lock.json +444 -0
  30. package/templates/paybond-travel-agent/package.json +1 -1
  31. package/templates/paybond-vercel-shopping-agent/.github/workflows/smoke.yml +1 -1
  32. package/templates/paybond-vercel-shopping-agent/package-lock.json +265 -0
  33. package/templates/paybond-vercel-shopping-agent/package.json +1 -1
package/README.md CHANGED
@@ -14,6 +14,23 @@ npm install @paybond/kit
14
14
 
15
15
  `@paybond/kit` is an ESM-only package for modern Node.js runtimes. Use `import` from a Node ESM / `NodeNext` project or a compatible bundler.
16
16
 
17
+ ### Optional framework integrations
18
+
19
+ The core package is enough for Harbor sessions, spend guards, policy files, and `paybond agent sandbox smoke`. Install optional peers only when you import a framework subpath:
20
+
21
+ | Subpath | Peer dependency |
22
+ | --- | --- |
23
+ | `@paybond/kit/vercel-ai` | `ai` |
24
+ | `@paybond/kit/openai-agents` | `@openai/agents` |
25
+ | `@paybond/kit/langgraph` | `@langchain/core`, `@langchain/langgraph` |
26
+ | `@paybond/kit/claude-agents` | `@anthropic-ai/claude-agent-sdk` |
27
+
28
+ ```bash
29
+ npm install ai @openai/agents @langchain/core @langchain/langgraph @anthropic-ai/claude-agent-sdk
30
+ ```
31
+
32
+ Thin npm wrappers (`@paybond/vercel-ai`, `@paybond/langgraph`, `@paybond/openai-agents`, `@paybond/claude-agents`, `@paybond/agent`, `@paybond/mcp`) re-export the same subpaths for discoverability.
33
+
17
34
  ## Open source
18
35
 
19
36
  `@paybond/kit` is distributed as open-source software under the Apache 2.0 license. The published npm package includes the full license text in `LICENSE`.
@@ -32,9 +49,42 @@ npx -p @paybond/kit paybond login
32
49
 
33
50
  `paybond login` writes a sandbox `PAYBOND_API_KEY` to `.env.local` with file mode `0600`, adds the default `.env.local` target to `.gitignore` when needed, and refuses to overwrite an existing key unless `--force` is passed. Custom env-file paths inside a git repo must already be ignored. Live production keys are created by tenant admins in Console and stored in deployment secret managers.
34
51
 
52
+ ## CLI
53
+
54
+ The package ships the `paybond` CLI (`paybond`, `paybond-init`, `paybond-kit-login`, `paybond-mcp-server`).
55
+
56
+ Scaffold a starter project from bundled templates:
57
+
58
+ ```bash
59
+ npx -p @paybond/kit paybond init --template travel-agent
60
+ npm install
61
+ npm run smoke
62
+ ```
63
+
64
+ End-to-end sandbox smoke (bind + execute + evidence) with no app code:
65
+
66
+ ```bash
67
+ npx -p @paybond/kit paybond agent sandbox smoke \
68
+ --policy-file paybond.policy.yaml \
69
+ --operation travel.book_hotel \
70
+ --requested-spend-cents 18700 \
71
+ --evidence-preset cost_and_completion \
72
+ --result-body '{"status":"completed","cost_cents":18700}' \
73
+ --format json
74
+ ```
75
+
76
+ `agent sandbox smoke` only requires `@paybond/kit`. Framework demo commands (`agent demo vercel-ai smoke`, etc.) load their optional peers on demand.
77
+
78
+ Offline local dev loop and trace dashboard:
79
+
80
+ ```bash
81
+ npx -p @paybond/kit paybond dev loop --offline
82
+ npx -p @paybond/kit paybond dev trace
83
+ ```
84
+
35
85
  ## First guardrail scaffold
36
86
 
37
- Use this first when you have a paid tool and want Paybond guardrails in the sandbox:
87
+ Use this when you have a paid tool and want Paybond guardrails in the sandbox:
38
88
 
39
89
  ```bash
40
90
  npx -p @paybond/kit paybond-init \
@@ -114,15 +164,6 @@ await paybond.guardrails.submitSandboxEvidence({
114
164
 
115
165
  The `paybond.harbor` and `paybond.guardrails` clients are created by `Paybond.open(...)` and bound to the tenant resolved from the service-account API key. Production integrations read `capability_token` from `paybond.intents.create(...)`, or from `paybond.intents.fund(...)` after an `x402_usdc_base` payment challenge is satisfied.
116
166
 
117
- Scaffold a guardrail integration:
118
-
119
- ```bash
120
- npx -p @paybond/kit paybond-init \
121
- --preset paid-tool-guard \
122
- --framework provider-agnostic \
123
- --out paybond-paid-tool-guard.ts
124
- ```
125
-
126
167
  ## What the package includes
127
168
 
128
169
  Core SDK:
@@ -135,6 +176,12 @@ Core SDK:
135
176
  - Runtime-neutral and framework aliases: `paybondAgentToolSpendGuard`, `paybondRuntimeNeutralToolSpendGuard`, `paybondLangGraphToolSpendGuard`, and `paybondMCPToolSpendGuard`
136
177
  - `paybondRuntimeToolCallAdapter` for agent SDKs and custom runtimes that expose a tool-call object plus an application-owned executor
137
178
 
179
+ Agent middleware (`@paybond/kit/agent`) and framework subpaths (`vercel-ai`, `openai-agents`, `langgraph`, `claude-agents`, `mcp`, `policy`):
180
+
181
+ - `PaybondAgentRun`, tool registry, interceptor, and policy-file binding
182
+ - Framework adapters with optional peer dependencies (see table above)
183
+ - `paybond init`, `paybond agent run bind`, `paybond agent tool execute`, and `paybond agent sandbox smoke`
184
+
138
185
  Gateway and trust helpers:
139
186
 
140
187
  - `GatewaySignalClient` and `ServiceAccountSignalSession` for tenant-scoped Signal reads and signed portfolio artifacts
@@ -146,10 +193,6 @@ Gateway and trust helpers:
146
193
 
147
194
  Agent-facing surfaces are model-provider agnostic. Paybond verifies tool operations and tenant scope, not whether a tool call came from OpenAI, Anthropic, Gemini, a local model, or another runtime.
148
195
 
149
- Advanced exports:
150
-
151
- - Low-level signing helpers for callers that need to pre-build signed request bodies or evidence payloads
152
-
153
196
  `allowedTools` values are your own tool or operation names, not a Paybond-owned catalog. Harbor enforces string matching against whatever names you chose when creating the intent.
154
197
 
155
198
  `settlementRail` on intent creation is a principal-signed rail request. Stripe destinations and x402 receive addresses stay tenant-owned server-side config and are never supplied by the SDK caller.
@@ -161,12 +204,13 @@ Gateway-backed protocol helpers throw `ProtocolHttpError` with parsed `errorCode
161
204
  ## What it does not include
162
205
 
163
206
  - No operator-tier settlement or console workflows
164
- - No model-provider-specific TypeScript agent wrapper; use the documented app-side wrapper pattern with `paybond.spendGuard(...)`
207
+ - No bundled LLM or model runtime bring your own agent framework and install optional peers when needed
165
208
  - No model-provider-specific MCP wrapper; the MCP server is host-agnostic and works with any MCP-compatible runtime
166
209
 
167
210
  ## Docs
168
211
 
169
212
  - Long-form docs: https://paybond.ai/docs/kit
213
+ - Agent quickstart: https://paybond.ai/docs/kit/quickstart-agent
170
214
  - One-command guardrails: https://paybond.ai/docs/kit/one-command-guardrails
171
215
  - TypeScript quickstart: https://paybond.ai/docs/kit/quickstart-typescript
172
216
  - TypeScript SDK reference: https://paybond.ai/docs/kit/sdk-reference-typescript
@@ -0,0 +1,4 @@
1
+ export declare function loadRunVercelAiSandboxDemo(): Promise<typeof import("../../vercel-ai/sandbox-demo.js").runVercelAiSandboxDemo>;
2
+ export declare function loadRunLangGraphSandboxDemo(): Promise<typeof import("../../langgraph/sandbox-demo.js").runLangGraphSandboxDemo>;
3
+ export declare function loadRunClaudeAgentsSandboxDemo(): Promise<typeof import("../../claude-agents/sandbox-demo.js").runClaudeAgentsSandboxDemo>;
4
+ export declare function loadRunOpenAIAgentsSandboxDemo(): Promise<typeof import("../../openai-agents/sandbox-demo.js").runOpenAIAgentsSandboxDemo>;
@@ -0,0 +1,66 @@
1
+ import { CliError } from "../types.js";
2
+ function missingPeerDependencyError(packageName, integration) {
3
+ return new CliError(`${integration} demo requires the optional peer dependency "${packageName}"; install it with: npm install ${packageName}`, {
4
+ category: "validation",
5
+ code: "cli.agent.missing_peer_dependency",
6
+ exitCode: 1,
7
+ details: { package: packageName, integration },
8
+ });
9
+ }
10
+ function isMissingModuleError(err, packageName) {
11
+ if (!(err instanceof Error)) {
12
+ return false;
13
+ }
14
+ const code = "code" in err ? String(err.code) : "";
15
+ return (code === "ERR_MODULE_NOT_FOUND" &&
16
+ err.message.includes(`'${packageName}'`));
17
+ }
18
+ export async function loadRunVercelAiSandboxDemo() {
19
+ try {
20
+ const mod = await import("../../vercel-ai/sandbox-demo.js");
21
+ return mod.runVercelAiSandboxDemo;
22
+ }
23
+ catch (err) {
24
+ if (isMissingModuleError(err, "ai")) {
25
+ throw missingPeerDependencyError("ai", "vercel-ai");
26
+ }
27
+ throw err;
28
+ }
29
+ }
30
+ export async function loadRunLangGraphSandboxDemo() {
31
+ try {
32
+ const mod = await import("../../langgraph/sandbox-demo.js");
33
+ return mod.runLangGraphSandboxDemo;
34
+ }
35
+ catch (err) {
36
+ if (isMissingModuleError(err, "@langchain/core") ||
37
+ isMissingModuleError(err, "@langchain/langgraph")) {
38
+ throw missingPeerDependencyError("@langchain/core @langchain/langgraph", "langgraph");
39
+ }
40
+ throw err;
41
+ }
42
+ }
43
+ export async function loadRunClaudeAgentsSandboxDemo() {
44
+ try {
45
+ const mod = await import("../../claude-agents/sandbox-demo.js");
46
+ return mod.runClaudeAgentsSandboxDemo;
47
+ }
48
+ catch (err) {
49
+ if (isMissingModuleError(err, "@anthropic-ai/claude-agent-sdk")) {
50
+ throw missingPeerDependencyError("@anthropic-ai/claude-agent-sdk", "claude-agents");
51
+ }
52
+ throw err;
53
+ }
54
+ }
55
+ export async function loadRunOpenAIAgentsSandboxDemo() {
56
+ try {
57
+ const mod = await import("../../openai-agents/sandbox-demo.js");
58
+ return mod.runOpenAIAgentsSandboxDemo;
59
+ }
60
+ catch (err) {
61
+ if (isMissingModuleError(err, "@openai/agents")) {
62
+ throw missingPeerDependencyError("@openai/agents", "openai-agents");
63
+ }
64
+ throw err;
65
+ }
66
+ }
@@ -1,11 +1,8 @@
1
1
  import { resolve } from "node:path";
2
2
  import { readFile } from "node:fs/promises";
3
3
  import { PaybondAgentRun, PaybondAutoEvidenceSubmitError, PaybondToolRegistryValidationError, PaybondUnregisteredSideEffectingToolError, } from "../../agent/index.js";
4
- import { runVercelAiSandboxDemo } from "../../vercel-ai/sandbox-demo.js";
5
- import { runLangGraphSandboxDemo } from "../../langgraph/sandbox-demo.js";
6
4
  import { runGenericSandboxDemo } from "../../agent/generic-sandbox-demo.js";
7
- import { runClaudeAgentsSandboxDemo } from "../../claude-agents/sandbox-demo.js";
8
- import { runOpenAIAgentsSandboxDemo } from "../../openai-agents/sandbox-demo.js";
5
+ import { loadRunClaudeAgentsSandboxDemo, loadRunLangGraphSandboxDemo, loadRunOpenAIAgentsSandboxDemo, loadRunVercelAiSandboxDemo, } from "../agent/demo-loaders.js";
9
6
  import { buildSmokeRegistry, loadAgentRegistryFile, validateAgentRegistryDocument, } from "../../agent/registry-file.js";
10
7
  import { createPaybondToolRegistry } from "../../agent/registry.js";
11
8
  import { devTraceStepsFromEvents, devTraceUrl, findDevTraceEventForRun, resolveDevTraceSink, recordSmokeTraceEvent, } from "../../dev/trace-buffer.js";
@@ -817,6 +814,7 @@ export async function handleAgentDemoVercelAiSmoke(ctx, argv) {
817
814
  }
818
815
  const requestedSpendCents = parseRequiredNonNegativeInt(spendFlag.value, "--requested-spend-cents");
819
816
  return withPaybondAgentCli(ctx, productionFlag.present, async (session) => {
817
+ const runVercelAiSandboxDemo = await loadRunVercelAiSandboxDemo();
820
818
  const demo = await runVercelAiSandboxDemo({
821
819
  paybond: session.paybond,
822
820
  operation: operationFlag.value,
@@ -858,6 +856,7 @@ export async function handleAgentDemoLanggraphSmoke(ctx, argv) {
858
856
  }
859
857
  const requestedSpendCents = parseRequiredNonNegativeInt(spendFlag.value, "--requested-spend-cents");
860
858
  return withPaybondAgentCli(ctx, productionFlag.present, async (session) => {
859
+ const runLangGraphSandboxDemo = await loadRunLangGraphSandboxDemo();
861
860
  const demo = await runLangGraphSandboxDemo({
862
861
  paybond: session.paybond,
863
862
  operation: operationFlag.value,
@@ -940,6 +939,7 @@ export async function handleAgentDemoClaudeAgentsSmoke(ctx, argv) {
940
939
  }
941
940
  const requestedSpendCents = parseRequiredNonNegativeInt(spendFlag.value, "--requested-spend-cents");
942
941
  return withPaybondAgentCli(ctx, productionFlag.present, async (session) => {
942
+ const runClaudeAgentsSandboxDemo = await loadRunClaudeAgentsSandboxDemo();
943
943
  const demo = await runClaudeAgentsSandboxDemo({
944
944
  paybond: session.paybond,
945
945
  operation: operationFlag.value,
@@ -976,6 +976,7 @@ export async function handleAgentDemoOpenAIAgentsSmoke(ctx, argv) {
976
976
  }
977
977
  const requestedSpendCents = parseRequiredNonNegativeInt(spendFlag.value, "--requested-spend-cents");
978
978
  return withPaybondAgentCli(ctx, productionFlag.present, async (session) => {
979
+ const runOpenAIAgentsSandboxDemo = await loadRunOpenAIAgentsSandboxDemo();
979
980
  const demo = await runOpenAIAgentsSandboxDemo({
980
981
  paybond: session.paybond,
981
982
  operation: operationFlag.value,
@@ -306,7 +306,7 @@ export function recordSmokeTraceEvent(input, cwd) {
306
306
  durationMs: 0,
307
307
  recordedAt: new Date().toISOString(),
308
308
  },
309
- ...((input.execute.evidence_submitted ?? input.execute.evidence)
309
+ ...(input.execute.evidence_submitted ?? input.execute.evidence
310
310
  ? [
311
311
  {
312
312
  type: "evidence_submitted",
@@ -13,7 +13,7 @@ import { McpCapabilityTokenCache, mcpToolStoresCapabilityToken, parseMcpCapabili
13
13
  import { createMcpPolicyGatewayAdapter, McpPolicyReloadGate, parseMcpPolicyReloadConfig, } from "./mcp-policy-reload.js";
14
14
  import { DEFAULT_PAYBOND_GATEWAY_BASE_URL, GatewayFraudClient, GatewaySignalClient, } from "./index.js";
15
15
  const SERVER_NAME = "Paybond MCP";
16
- const SERVER_VERSION = "0.11.0";
16
+ const SERVER_VERSION = "0.11.1";
17
17
  const MCP_PROTOCOL_VERSION = "2025-11-25";
18
18
  const DEFAULT_PRINCIPAL_PATH = "/v1/auth/principal";
19
19
  const DEFAULT_RECOGNITION_VERIFIER_ID = "paybond-gateway";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paybond/kit",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "mcpName": "io.github.nonameuserd/paybond",
5
5
  "description": "Paybond Kit for TypeScript: agent spend governance for paid tool calls with spend authorization, evidence receipts, refunds, disputes, hosted Gateway sessions, and settlement.",
6
6
  "license": "Apache-2.0",
@@ -13,7 +13,7 @@
13
13
  "evidence_preset": "cost_and_completion",
14
14
  "smoke_result_body": { "status": "completed", "cost_cents": 18700 },
15
15
  "dependencies": {
16
- "@paybond/kit": "^0.11.0",
16
+ "@paybond/kit": "^0.11.1",
17
17
  "@langchain/core": "^1.2.1",
18
18
  "@langchain/langgraph": "^1.4.7",
19
19
  "zod": "^4.2.0"
@@ -33,7 +33,7 @@
33
33
  "evidence_preset": "cost_and_completion",
34
34
  "smoke_result_body": { "status": "completed", "cost_cents": 4500 },
35
35
  "dependencies": {
36
- "@paybond/kit": "^0.11.0",
36
+ "@paybond/kit": "^0.11.1",
37
37
  "ai": "^5.0.0",
38
38
  "zod": "^4.2.0"
39
39
  },
@@ -52,7 +52,7 @@
52
52
  "evidence_preset": "cost_and_completion",
53
53
  "smoke_result_body": { "status": "completed", "cost_cents": 2900 },
54
54
  "dependencies": {
55
- "@paybond/kit": "^0.11.0",
55
+ "@paybond/kit": "^0.11.1",
56
56
  "@openai/agents": "^0.4.0",
57
57
  "zod": "^4.2.0"
58
58
  },
@@ -71,7 +71,7 @@
71
71
  "evidence_preset": "cost_and_completion",
72
72
  "smoke_result_body": { "status": "completed", "cost_cents": 4500 },
73
73
  "dependencies": {
74
- "@paybond/kit": "^0.11.0",
74
+ "@paybond/kit": "^0.11.1",
75
75
  "@openai/agents": "^0.4.0",
76
76
  "zod": "^4.2.0"
77
77
  },
@@ -90,7 +90,7 @@
90
90
  "evidence_preset": "cost_and_completion",
91
91
  "smoke_result_body": { "status": "completed", "cost_cents": 18700 },
92
92
  "dependencies": {
93
- "@paybond/kit": "^0.11.0",
93
+ "@paybond/kit": "^0.11.1",
94
94
  "@anthropic-ai/claude-agent-sdk": "^0.2.100",
95
95
  "zod": "^4.2.0"
96
96
  },
@@ -110,7 +110,7 @@
110
110
  "evidence_preset": "cost_and_completion",
111
111
  "smoke_result_body": { "status": "completed", "cost_cents": 500 },
112
112
  "dependencies": {
113
- "@paybond/kit": "^0.11.0"
113
+ "@paybond/kit": "^0.11.1"
114
114
  },
115
115
  "mcp_tool_policy": "spend-write"
116
116
  },
@@ -127,7 +127,7 @@
127
127
  "evidence_preset": "cost_and_completion",
128
128
  "smoke_result_body": { "status": "completed", "cost_cents": 12000 },
129
129
  "dependencies": {
130
- "@paybond/kit": "^0.11.0"
130
+ "@paybond/kit": "^0.11.1"
131
131
  },
132
132
  "demo_mode": "generic"
133
133
  },
@@ -143,7 +143,7 @@
143
143
  "evidence_preset": "cost_and_completion",
144
144
  "smoke_result_body": { "status": "completed", "cost_cents": 12500 },
145
145
  "dependencies": {
146
- "@paybond/kit": "^0.11.0"
146
+ "@paybond/kit": "^0.11.1"
147
147
  },
148
148
  "demo_mode": "generic"
149
149
  },
@@ -159,7 +159,7 @@
159
159
  "evidence_preset": "cost_and_completion",
160
160
  "smoke_result_body": { "status": "completed", "cost_cents": 2900 },
161
161
  "python_dependencies": {
162
- "paybond-kit": ">=0.11.0",
162
+ "paybond-kit": ">=0.11.1",
163
163
  "langgraph": ">=1.2.0"
164
164
  },
165
165
  "demo_import": "paybond_kit.langgraph_sandbox_demo",
@@ -14,7 +14,7 @@ jobs:
14
14
  with:
15
15
  node-version: "22"
16
16
  cache: npm
17
- - run: npm install
17
+ - run: npm ci
18
18
  - run: npm run smoke
19
19
  env:
20
20
  PAYBOND_API_KEY: ${{ secrets.PAYBOND_SANDBOX_API_KEY }}