@paybond/kit 0.12.0 → 0.12.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.
- package/dist/agent/evidence.d.ts +10 -0
- package/dist/agent/evidence.js +16 -0
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/interceptor.js +4 -0
- package/dist/agent/receipt-client.d.ts +16 -1
- package/dist/agent/run.d.ts +3 -0
- package/dist/agent/run.js +1 -1
- package/dist/agent-mandate.d.ts +103 -0
- package/dist/agent-mandate.js +423 -0
- package/dist/agent-receipt-external-attestations.d.ts +27 -0
- package/dist/agent-receipt-external-attestations.js +61 -0
- package/dist/agent-receipt-pdf-export.d.ts +43 -0
- package/dist/agent-receipt-pdf-export.js +109 -0
- package/dist/agent-receipt-prevalidate.d.ts +7 -0
- package/dist/agent-receipt-prevalidate.js +63 -0
- package/dist/agent-receipt.d.ts +21 -1
- package/dist/agent-receipt.js +63 -4
- package/dist/cli/command-spec.js +50 -1
- package/dist/cli/commands/dev.js +10 -3
- package/dist/cli/commands/setup.js +19 -1
- package/dist/cli/commands/shopify.d.ts +53 -0
- package/dist/cli/commands/shopify.js +808 -0
- package/dist/cli/help.d.ts +1 -1
- package/dist/cli/help.js +13 -3
- package/dist/cli/router.js +15 -1
- package/dist/commerce-binding.d.ts +59 -0
- package/dist/commerce-binding.js +129 -0
- package/dist/doctor-completion.d.ts +16 -0
- package/dist/doctor-completion.js +157 -1
- package/dist/index.d.ts +27 -2
- package/dist/index.js +43 -7
- package/dist/mcp-server.d.ts +1 -0
- package/dist/mcp-server.js +28 -9
- package/dist/policy/presets.d.ts +1 -1
- package/dist/policy/presets.js +1 -0
- package/dist/project-init.d.ts +1 -1
- package/dist/project-init.js +1 -0
- package/dist/protocol-receipt.d.ts +129 -0
- package/dist/protocol-receipt.js +620 -0
- package/dist/shopify/checkout.d.ts +29 -0
- package/dist/shopify/checkout.js +79 -0
- package/dist/shopify/evidence.d.ts +13 -0
- package/dist/shopify/evidence.js +85 -0
- package/dist/shopify/index.d.ts +8 -0
- package/dist/shopify/index.js +6 -0
- package/dist/shopify/instrument.d.ts +61 -0
- package/dist/shopify/instrument.js +52 -0
- package/dist/shopify/order.d.ts +8 -0
- package/dist/shopify/order.js +110 -0
- package/dist/shopify/types.d.ts +82 -0
- package/dist/shopify/types.js +4 -0
- package/dist/solutions/catalog.d.ts +1 -1
- package/dist/solutions/catalog.js +1 -1
- package/dist/stripe-commerce/evidence.d.ts +13 -0
- package/dist/stripe-commerce/evidence.js +164 -0
- package/dist/stripe-commerce/index.d.ts +3 -0
- package/dist/stripe-commerce/index.js +2 -0
- package/dist/stripe-commerce/metadata.d.ts +11 -0
- package/dist/stripe-commerce/metadata.js +34 -0
- package/dist/stripe-commerce/types.d.ts +38 -0
- package/dist/stripe-commerce/types.js +1 -0
- package/dist/template-init.d.ts +1 -1
- package/dist/template-init.js +6 -1
- package/package.json +1 -1
- package/policy/presets/stripe-commerce.yaml +19 -0
- package/solutions/stripe-commerce.json +19 -0
- package/templates/manifest.json +82 -10
- package/templates/openai-shopping-agent/package-lock.json +10 -10
- package/templates/openai-shopping-agent/src/paybond.config.ts +1 -1
- package/templates/paybond-aws-operator/package-lock.json +7 -7
- package/templates/paybond-aws-operator/src/paybond.config.ts +1 -1
- package/templates/paybond-claude-agents-demo/package-lock.json +7 -7
- package/templates/paybond-claude-agents-demo/src/paybond.config.ts +1 -1
- package/templates/paybond-mastra-travel-agent/package-lock.json +30 -30
- package/templates/paybond-mastra-travel-agent/src/paybond.config.ts +1 -1
- package/templates/paybond-mcp-coding-agent/package-lock.json +7 -7
- package/templates/paybond-mcp-coding-agent/src/paybond.config.ts +1 -1
- package/templates/paybond-openai-agents-demo/package-lock.json +10 -10
- package/templates/paybond-openai-agents-demo/src/paybond.config.ts +1 -1
- package/templates/paybond-procurement-agent/package-lock.json +7 -7
- package/templates/paybond-procurement-agent/src/paybond.config.ts +1 -1
- package/templates/paybond-shopify-shopping-agent/.env.example +3 -0
- package/templates/paybond-shopify-shopping-agent/.github/workflows/smoke.yml +20 -0
- package/templates/paybond-shopify-shopping-agent/LICENSE +201 -0
- package/templates/paybond-shopify-shopping-agent/README.md +29 -0
- package/templates/paybond-shopify-shopping-agent/package-lock.json +223 -0
- package/templates/paybond-shopify-shopping-agent/package.json +20 -0
- package/templates/paybond-shopify-shopping-agent/paybond.policy.yaml +22 -0
- package/templates/paybond-shopify-shopping-agent/src/index.ts +54 -0
- package/templates/paybond-shopify-shopping-agent/src/paybond.config.ts +51 -0
- package/templates/paybond-shopify-shopping-agent/tsconfig.json +13 -0
- package/templates/paybond-stripe-agent-demo/.env.example +9 -0
- package/templates/paybond-stripe-agent-demo/.github/workflows/smoke.yml +20 -0
- package/templates/paybond-stripe-agent-demo/LICENSE +201 -0
- package/templates/paybond-stripe-agent-demo/README.md +50 -0
- package/templates/paybond-stripe-agent-demo/package-lock.json +223 -0
- package/templates/paybond-stripe-agent-demo/package.json +20 -0
- package/templates/paybond-stripe-agent-demo/paybond.policy.yaml +22 -0
- package/templates/paybond-stripe-agent-demo/src/charge-customer.ts +237 -0
- package/templates/paybond-stripe-agent-demo/src/index.ts +78 -0
- package/templates/paybond-stripe-agent-demo/src/paybond.config.ts +51 -0
- package/templates/paybond-stripe-agent-demo/tsconfig.json +13 -0
- package/templates/paybond-travel-agent/package-lock.json +13 -13
- package/templates/paybond-travel-agent/src/paybond.config.ts +1 -1
- package/templates/paybond-vercel-shopping-agent/package-lock.json +7 -7
- package/templates/paybond-vercel-shopping-agent/src/paybond.config.ts +1 -1
package/dist/cli/commands/dev.js
CHANGED
|
@@ -11,6 +11,7 @@ import { CliError } from "../types.js";
|
|
|
11
11
|
import { handleAgentSandboxSmoke } from "./agent.js";
|
|
12
12
|
import { handleLogin } from "./setup.js";
|
|
13
13
|
import { handlePolicyInit, handlePolicyValidateTools } from "./policy.js";
|
|
14
|
+
import { buildShopifyNextStepsBanner } from "./shopify.js";
|
|
14
15
|
import { scheduleCliCommandTelemetry } from "../telemetry.js";
|
|
15
16
|
function devCliError(message, options) {
|
|
16
17
|
return new CliError(message, {
|
|
@@ -229,6 +230,10 @@ export async function handleDevLoop(ctx, argv) {
|
|
|
229
230
|
rest = offlineFlag.rest;
|
|
230
231
|
const policyFlag = consumeFlag(rest, "--policy-file");
|
|
231
232
|
rest = policyFlag.rest;
|
|
233
|
+
const presetFlag = consumeFlag(rest, "--preset");
|
|
234
|
+
rest = presetFlag.rest;
|
|
235
|
+
const shopifyFlag = consumeBooleanFlag(rest, "--shopify");
|
|
236
|
+
rest = shopifyFlag.rest;
|
|
232
237
|
const noLoginFlag = consumeBooleanFlag(rest, "--no-login");
|
|
233
238
|
rest = noLoginFlag.rest;
|
|
234
239
|
if (rest.length > 0) {
|
|
@@ -237,6 +242,7 @@ export async function handleDevLoop(ctx, argv) {
|
|
|
237
242
|
category: "usage",
|
|
238
243
|
});
|
|
239
244
|
}
|
|
245
|
+
const preset = presetFlag.value?.trim() || DEV_DEFAULT_PRESET;
|
|
240
246
|
const policyFile = policyFlag.value?.trim() || DEV_DEFAULT_POLICY_FILE;
|
|
241
247
|
const steps = [];
|
|
242
248
|
const bannerLines = buildDevStartupBannerLines();
|
|
@@ -279,7 +285,7 @@ export async function handleDevLoop(ctx, argv) {
|
|
|
279
285
|
}
|
|
280
286
|
const initResult = await handlePolicyInit(activeCtx, [
|
|
281
287
|
"--preset",
|
|
282
|
-
|
|
288
|
+
preset,
|
|
283
289
|
"--out",
|
|
284
290
|
policyFile,
|
|
285
291
|
"--force",
|
|
@@ -303,13 +309,14 @@ export async function handleDevLoop(ctx, argv) {
|
|
|
303
309
|
details: { steps },
|
|
304
310
|
});
|
|
305
311
|
}
|
|
306
|
-
const smokeResult = await runDevSmokeCore(activeCtx,
|
|
312
|
+
const smokeResult = await runDevSmokeCore(activeCtx, preset, offlineFlag.present);
|
|
307
313
|
steps.push({ name: "smoke", ok: true, data: smokeResult.data });
|
|
308
314
|
const traceUrl = String(smokeResult.data.trace_url ?? devTraceUrl());
|
|
309
315
|
const auditLog = String(smokeResult.data.audit_log ?? resolve(ctx.cwd, ".paybond/dev-audit.jsonl"));
|
|
310
316
|
const smokeChecklist = Array.isArray(smokeResult.data.checklist_lines)
|
|
311
317
|
? smokeResult.data.checklist_lines
|
|
312
318
|
: [];
|
|
319
|
+
const shopifyBanner = shopifyFlag.present ? buildShopifyNextStepsBanner() : [];
|
|
313
320
|
scheduleCliCommandTelemetry(activeCtx, {
|
|
314
321
|
commandPath: "dev loop",
|
|
315
322
|
offline: offlineFlag.present,
|
|
@@ -321,7 +328,7 @@ export async function handleDevLoop(ctx, argv) {
|
|
|
321
328
|
smoke: smokeResult.data,
|
|
322
329
|
trace_url: traceUrl,
|
|
323
330
|
audit_log: auditLog,
|
|
324
|
-
banner_lines: bannerLines,
|
|
331
|
+
banner_lines: [...bannerLines, ...shopifyBanner],
|
|
325
332
|
checklist_lines: appendDevLoopTraceLine(smokeChecklist, traceUrl, ctx.globals),
|
|
326
333
|
},
|
|
327
334
|
warnings: smokeResult.warnings,
|
|
@@ -22,6 +22,7 @@ import { copyTemplateToDirectory, normalizeTemplateId, templateInitUsage, } from
|
|
|
22
22
|
import { parseArgs as parseLoginArgs, runLogin } from "../../login.js";
|
|
23
23
|
import { main as runMcpServerMain } from "../../mcp-server.js";
|
|
24
24
|
import { PaybondMCPServer } from "../../mcp-server.js";
|
|
25
|
+
import { runShopifyDoctorChecks } from "./shopify.js";
|
|
25
26
|
async function readJsonFile(filePath) {
|
|
26
27
|
return readJsonBody(filePath, process.stdin);
|
|
27
28
|
}
|
|
@@ -124,6 +125,19 @@ export async function handleInitWizard(ctx, argv) {
|
|
|
124
125
|
});
|
|
125
126
|
return { data: result };
|
|
126
127
|
}
|
|
128
|
+
if (parsed.solution === "shopping" && parsed.framework === "shopify") {
|
|
129
|
+
const result = await copyTemplateToDirectory({
|
|
130
|
+
cwd: ctx.cwd,
|
|
131
|
+
templateId: normalizeTemplateId("shopify-shopping-agent"),
|
|
132
|
+
force: parsed.force,
|
|
133
|
+
writeStdout(line) {
|
|
134
|
+
if (ctx.globals.format !== "json") {
|
|
135
|
+
ctx.stdout.write(`${line}\n`);
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
return { data: result };
|
|
140
|
+
}
|
|
127
141
|
const { template: _template, ...wizardOptions } = parsed;
|
|
128
142
|
const result = await runProjectInit({
|
|
129
143
|
cwd: ctx.cwd,
|
|
@@ -353,7 +367,8 @@ export async function handleMcpVerifyConfig(ctx, argv) {
|
|
|
353
367
|
}
|
|
354
368
|
export async function handleDoctor(ctx, argv) {
|
|
355
369
|
const agentFlag = consumeBooleanFlag(argv, "--agent");
|
|
356
|
-
const
|
|
370
|
+
const shopifyFlag = consumeBooleanFlag(agentFlag.rest, "--shopify");
|
|
371
|
+
const hostFlag = consumeFlag(shopifyFlag.rest, "--host");
|
|
357
372
|
const checks = [];
|
|
358
373
|
const defaults = resolvedDefaultsForDoctor(ctx.globals);
|
|
359
374
|
checks.push({
|
|
@@ -436,6 +451,9 @@ export async function handleDoctor(ctx, argv) {
|
|
|
436
451
|
});
|
|
437
452
|
}
|
|
438
453
|
}
|
|
454
|
+
if (shopifyFlag.present) {
|
|
455
|
+
checks.push(...(await runShopifyDoctorChecks(ctx)));
|
|
456
|
+
}
|
|
439
457
|
const completionChecks = await runCompletionCatalogDoctorChecks({
|
|
440
458
|
cwd: ctx.cwd,
|
|
441
459
|
gateway: apiKey
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { CliContext } from "../context.js";
|
|
2
|
+
import { type CommandResult } from "../types.js";
|
|
3
|
+
export type ShopifyDoctorCheck = {
|
|
4
|
+
name: string;
|
|
5
|
+
ok: boolean;
|
|
6
|
+
message: string;
|
|
7
|
+
details?: Record<string, unknown>;
|
|
8
|
+
};
|
|
9
|
+
type ExternalCommandResult = {
|
|
10
|
+
code: number;
|
|
11
|
+
stdout: string;
|
|
12
|
+
stderr: string;
|
|
13
|
+
};
|
|
14
|
+
type ShopifyCommandHooks = {
|
|
15
|
+
whichExecutable?: (name: string) => Promise<string | null>;
|
|
16
|
+
runCommand?: (command: string, args: string[]) => Promise<ExternalCommandResult>;
|
|
17
|
+
};
|
|
18
|
+
/** Test hook: override external CLI discovery and execution. */
|
|
19
|
+
export declare function setShopifyCommandHooks(hooks: ShopifyCommandHooks): void;
|
|
20
|
+
export type ShopifyAppTomlInfo = {
|
|
21
|
+
exists: boolean;
|
|
22
|
+
clientId?: string;
|
|
23
|
+
path?: string;
|
|
24
|
+
};
|
|
25
|
+
/** Parse `client_id` from a linked `shopify.app.toml` in the working directory. */
|
|
26
|
+
export declare function readShopifyAppToml(cwd: string): Promise<ShopifyAppTomlInfo>;
|
|
27
|
+
export declare function formatShopifyDoctorChecklist(checks: ShopifyDoctorCheck[], useColor: boolean): string[];
|
|
28
|
+
export declare function buildShopifyNextStepsBanner(shopDomain?: string): string[];
|
|
29
|
+
/** Resolve a Paybond gateway origin to the Shopify sandbox webhook path. */
|
|
30
|
+
export declare function resolveShopifyWebhookAddress(gatewayBase: string, tunnel?: string): string;
|
|
31
|
+
export declare function buildShopifyWebhookTriggerCommand(input: {
|
|
32
|
+
topic: string;
|
|
33
|
+
address: string;
|
|
34
|
+
clientId?: string;
|
|
35
|
+
}): string[];
|
|
36
|
+
/** Locate a Paybond Payments `shopify.app.toml` for local dev (cwd or monorepo app path). */
|
|
37
|
+
export declare function readShopifyPaymentsAppToml(cwd: string): Promise<ShopifyAppTomlInfo>;
|
|
38
|
+
export declare function buildShopifyPaymentsNextStepsBanner(shopDomain?: string): string[];
|
|
39
|
+
/** Readiness checks for Paybond + Shopify local development. */
|
|
40
|
+
export declare function runShopifyDoctorChecks(ctx: CliContext): Promise<ShopifyDoctorCheck[]>;
|
|
41
|
+
export declare function handleShopifyDoctor(ctx: CliContext, argv: string[]): Promise<CommandResult>;
|
|
42
|
+
export declare function handleShopifyLink(ctx: CliContext, argv: string[]): Promise<CommandResult>;
|
|
43
|
+
export declare function handleShopifyDev(ctx: CliContext, argv: string[]): Promise<CommandResult>;
|
|
44
|
+
export declare function handleShopifyWebhookTrigger(ctx: CliContext, argv: string[]): Promise<CommandResult>;
|
|
45
|
+
export declare function handleShopifyCheckoutSmoke(ctx: CliContext, argv: string[]): Promise<CommandResult>;
|
|
46
|
+
export declare function handleShopifyOrderShow(ctx: CliContext, argv: string[]): Promise<CommandResult>;
|
|
47
|
+
export declare function handleShopifyCaptureReady(ctx: CliContext, argv: string[]): Promise<CommandResult>;
|
|
48
|
+
export declare function runShopifyPaymentsDoctorChecks(ctx: CliContext): Promise<ShopifyDoctorCheck[]>;
|
|
49
|
+
export declare function handleShopifyPaymentsDoctor(ctx: CliContext, argv: string[]): Promise<CommandResult>;
|
|
50
|
+
export declare function handleShopifyPaymentsSmoke(ctx: CliContext, argv: string[]): Promise<CommandResult>;
|
|
51
|
+
export declare function handleShopifyPaymentsSessionShow(ctx: CliContext, argv: string[]): Promise<CommandResult>;
|
|
52
|
+
export declare function handleShopify(ctx: CliContext, subcommand: string, third: string | undefined, fourth: string | undefined, argv: string[]): Promise<CommandResult>;
|
|
53
|
+
export {};
|