@pome-sh/cli 0.21.10 → 0.21.12
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/build-info.json +3 -3
- package/dist/{checks-ZWCORWK4.js → checks-FLXH5OG3.js} +1 -1
- package/dist/{chunk-BK7HSHRA.js → chunk-563RZ7P3.js} +16 -16
- package/dist/{chunk-5TEVH6RY.js → chunk-6BCL7HYR.js} +2 -2
- package/dist/{chunk-F7YLHTCM.js → chunk-75SDBO3W.js} +1 -1
- package/dist/{chunk-PRCZLT4W.js → chunk-EI5ECLLN.js} +2 -2
- package/dist/{chunk-2CMCN5PW.js → chunk-OR4X4BIY.js} +2 -2
- package/dist/{chunk-35TG2GHS.js → chunk-TV5S6WQV.js} +182 -4
- package/dist/{runDemo-7NYX7S5T.js → runDemo-7ZNVR4GX.js} +5 -5
- package/dist/{runTrialGroup-BYUY5WJ7.js → runTrialGroup-7KEOFQEU.js} +4 -4
- package/dist/{server-NJBWJIS3.js → server-DR56XIGP.js} +1 -1
- package/dist/src/cli/main.js +13 -13
- package/dist/{src-TKGHXPEM.js → src-B63VPRRZ.js} +69 -1162
- package/dist/{src-CI5W335G.js → src-JWB5RQSN.js} +66 -331
- package/dist/{src-WQE3MFBD.js → src-RDRKZ4FM.js} +116 -87
- package/dist/{src-4ZLCEPCN.js → src-RUUCDQU4.js} +108 -137
- package/dist/{src-PJGE6SSY.js → src-YH33B2LP.js} +74 -47
- package/dist/twinHarness-4RDIJIM7.js +5 -0
- package/dist/{twinStart-5ZWCVBPZ.js → twinStart-Y525LQUR.js} +3 -3
- package/package.json +1 -1
- package/dist/twinHarness-CJX3IXR3.js +0 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { SLACK_CHECKS } from './chunk-LH4EGGQW.js';
|
|
2
2
|
import './chunk-NY55QTVQ.js';
|
|
3
|
-
import { defineTwin, queryTokenResolver, formTokenResolver, UnknownToolError, openTwinDatabase, createApp } from './chunk-
|
|
3
|
+
import { loadMcpToolFixture, defineTwin, queryTokenResolver, formTokenResolver, deriveMcpToolTable, UnknownToolError, openTwinDatabase, createApp } from './chunk-TV5S6WQV.js';
|
|
4
4
|
import './chunk-VBATFCWR.js';
|
|
5
5
|
import './chunk-SG6ZTIMT.js';
|
|
6
6
|
import { z, ZodError } from 'zod';
|
|
@@ -2471,110 +2471,101 @@ function registerSlackRoutes(app, { domain, recorder }) {
|
|
|
2471
2471
|
write("/canvases.delete", (args, actor, delta) => domain.canvasesDelete({ canvas_id: asString(args.canvas_id) }, actor, delta));
|
|
2472
2472
|
read("/emoji.list", (args) => domain.emojiList(args));
|
|
2473
2473
|
}
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
},
|
|
2504
|
-
{
|
|
2505
|
-
name: "slack_get_channel_history",
|
|
2506
|
-
description: "Get recent messages from a channel",
|
|
2507
|
-
readOnly: true,
|
|
2508
|
-
schema: z.strictObject({
|
|
2509
|
-
channel_id: z.string(),
|
|
2510
|
-
limit: z.number().optional()
|
|
2511
|
-
}).strict()
|
|
2512
|
-
},
|
|
2513
|
-
{
|
|
2514
|
-
name: "slack_get_thread_replies",
|
|
2515
|
-
description: "Get all replies in a message thread",
|
|
2516
|
-
readOnly: true,
|
|
2517
|
-
schema: z.strictObject({
|
|
2518
|
-
channel_id: z.string(),
|
|
2519
|
-
thread_ts: z.string()
|
|
2520
|
-
}).strict()
|
|
2521
|
-
},
|
|
2522
|
-
{
|
|
2523
|
-
name: "slack_list_channels",
|
|
2524
|
-
description: "List public or pre-defined channels in the workspace with pagination",
|
|
2525
|
-
readOnly: true,
|
|
2526
|
-
schema: z.strictObject({
|
|
2527
|
-
limit: z.number().optional(),
|
|
2528
|
-
cursor: z.string().optional()
|
|
2529
|
-
}).strict()
|
|
2530
|
-
},
|
|
2531
|
-
{
|
|
2532
|
-
name: "slack_get_users",
|
|
2533
|
-
description: "Get a list of all users in the workspace with their basic profile information",
|
|
2534
|
-
readOnly: true,
|
|
2535
|
-
schema: z.strictObject({
|
|
2536
|
-
cursor: z.string().optional(),
|
|
2537
|
-
limit: z.number().optional()
|
|
2538
|
-
}).strict()
|
|
2539
|
-
},
|
|
2540
|
-
{
|
|
2541
|
-
name: "slack_get_user_profile",
|
|
2542
|
-
description: "Get detailed profile information for a specific user",
|
|
2543
|
-
readOnly: true,
|
|
2544
|
-
schema: z.strictObject({
|
|
2545
|
-
user_id: z.string()
|
|
2546
|
-
}).strict()
|
|
2547
|
-
},
|
|
2548
|
-
{
|
|
2549
|
-
name: "slack_search_messages",
|
|
2550
|
-
description: "Search messages in the workspace by text query",
|
|
2551
|
-
readOnly: true,
|
|
2552
|
-
schema: z.strictObject({
|
|
2553
|
-
query: z.string(),
|
|
2554
|
-
count: z.number().optional(),
|
|
2555
|
-
page: z.number().optional()
|
|
2556
|
-
}).strict()
|
|
2557
|
-
},
|
|
2558
|
-
{
|
|
2559
|
-
name: "slack_get_reactions",
|
|
2560
|
-
description: "Get all reactions on a specific message",
|
|
2561
|
-
readOnly: true,
|
|
2562
|
-
schema: z.strictObject({
|
|
2563
|
-
channel_id: z.string(),
|
|
2564
|
-
timestamp: z.string()
|
|
2565
|
-
}).strict()
|
|
2474
|
+
|
|
2475
|
+
// ../packages/twin-slack/dist/fixtures/mcp-tools-list.meta.json
|
|
2476
|
+
var mcp_tools_list_meta_default = {
|
|
2477
|
+
twin: "slack",
|
|
2478
|
+
substrate: "twin-code-transcription",
|
|
2479
|
+
endpoint: "in-process://twin-slack/s/:sid/mcp",
|
|
2480
|
+
method: "tools/list",
|
|
2481
|
+
protocol: "JSON-RPC 2.0 over Streamable HTTP",
|
|
2482
|
+
protocolVersion: "2025-06-18",
|
|
2483
|
+
captureDate: "2026-08-06",
|
|
2484
|
+
rawFileSha256: "2125da69d748e6d151aa229ee2fb4b6e5219372c5c858bce900fa045c7a234d4",
|
|
2485
|
+
liveToolCount: 11,
|
|
2486
|
+
liveToolOrder: [
|
|
2487
|
+
"slack_post_message",
|
|
2488
|
+
"slack_reply_to_thread",
|
|
2489
|
+
"slack_add_reaction",
|
|
2490
|
+
"slack_get_channel_history",
|
|
2491
|
+
"slack_get_thread_replies",
|
|
2492
|
+
"slack_list_channels",
|
|
2493
|
+
"slack_get_users",
|
|
2494
|
+
"slack_get_user_profile",
|
|
2495
|
+
"slack_search_messages",
|
|
2496
|
+
"slack_get_reactions",
|
|
2497
|
+
"slack_list_channel_members"
|
|
2498
|
+
],
|
|
2499
|
+
transcription: {
|
|
2500
|
+
readFrom: "twin-slack's own tools/list, booted on defaultSeedState() and driven through Hono's app.request, read immediately before this table became fixture-driven (F-1325)",
|
|
2501
|
+
contentOrigin: "packages/twin-slack/src/tools.ts \u2014 a hand-written TypeScript array. Commit 6abec3c copied its eleven names verbatim out of modelcontextprotocol/servers-archived/src/slack, an archived reference server, and nothing has read Slack's own tools/list since.",
|
|
2502
|
+
comparedToUpstream: "never. https://mcp.slack.com/mcp is OAuth-gated, so F-1326 recorded the upstream golden as deferred (fixtures/mcp-tools-list/slack.status.json, F-1329). Eight of these eleven names are believed to exist on no Slack deployment; reporting that is F-1327's job and renaming them is F-1330's. This fixture is deliberately NOT a claim about Slack."
|
|
2566
2503
|
},
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
}).strict()
|
|
2504
|
+
notes: [
|
|
2505
|
+
"additionalProperties:false on every inputSchema is load-bearing and is frozen here verbatim: src/tools.ts builds each schema with z.strictObject and forces the draft-7 projection, and the divergence lane depends on seeing it on the wire.",
|
|
2506
|
+
"Seeded from the code table rather than from upstream on purpose. F-1325 is name-neutral by construction: every byte this twin serves is identical before and after it."
|
|
2507
|
+
],
|
|
2508
|
+
canonicalFileSha256: "fc8fb7a0cc46ae7747bc1452d6c255194270bf10b4cba0888932661996eebfc6",
|
|
2509
|
+
files: {
|
|
2510
|
+
raw: "mcp-tools-list.raw.json",
|
|
2511
|
+
canonical: "mcp-tools-list.canonical.json"
|
|
2576
2512
|
}
|
|
2577
|
-
|
|
2513
|
+
};
|
|
2514
|
+
|
|
2515
|
+
// ../packages/twin-slack/dist/fixtures/mcp-tools-list.raw.json
|
|
2516
|
+
var mcp_tools_list_raw_default = { jsonrpc: "2.0", id: 1, result: { tools: [{ name: "slack_post_message", description: "Post a new message to a Slack channel", inputSchema: { type: "object", properties: { channel_id: { type: "string" }, text: { type: "string" } }, required: ["channel_id", "text"], additionalProperties: false } }, { name: "slack_reply_to_thread", description: "Reply to a specific message thread in Slack", inputSchema: { type: "object", properties: { channel_id: { type: "string" }, thread_ts: { type: "string" }, text: { type: "string" } }, required: ["channel_id", "thread_ts", "text"], additionalProperties: false } }, { name: "slack_add_reaction", description: "Add a reaction emoji to a message", inputSchema: { type: "object", properties: { channel_id: { type: "string" }, timestamp: { type: "string" }, reaction: { type: "string" } }, required: ["channel_id", "timestamp", "reaction"], additionalProperties: false } }, { name: "slack_get_channel_history", description: "Get recent messages from a channel", inputSchema: { type: "object", properties: { channel_id: { type: "string" }, limit: { type: "number" } }, required: ["channel_id"], additionalProperties: false }, annotations: { readOnlyHint: true } }, { name: "slack_get_thread_replies", description: "Get all replies in a message thread", inputSchema: { type: "object", properties: { channel_id: { type: "string" }, thread_ts: { type: "string" } }, required: ["channel_id", "thread_ts"], additionalProperties: false }, annotations: { readOnlyHint: true } }, { name: "slack_list_channels", description: "List public or pre-defined channels in the workspace with pagination", inputSchema: { type: "object", properties: { limit: { type: "number" }, cursor: { type: "string" } }, required: [], additionalProperties: false }, annotations: { readOnlyHint: true } }, { name: "slack_get_users", description: "Get a list of all users in the workspace with their basic profile information", inputSchema: { type: "object", properties: { cursor: { type: "string" }, limit: { type: "number" } }, required: [], additionalProperties: false }, annotations: { readOnlyHint: true } }, { name: "slack_get_user_profile", description: "Get detailed profile information for a specific user", inputSchema: { type: "object", properties: { user_id: { type: "string" } }, required: ["user_id"], additionalProperties: false }, annotations: { readOnlyHint: true } }, { name: "slack_search_messages", description: "Search messages in the workspace by text query", inputSchema: { type: "object", properties: { query: { type: "string" }, count: { type: "number" }, page: { type: "number" } }, required: ["query"], additionalProperties: false }, annotations: { readOnlyHint: true } }, { name: "slack_get_reactions", description: "Get all reactions on a specific message", inputSchema: { type: "object", properties: { channel_id: { type: "string" }, timestamp: { type: "string" } }, required: ["channel_id", "timestamp"], additionalProperties: false }, annotations: { readOnlyHint: true } }, { name: "slack_list_channel_members", description: "List the member user IDs of a channel with pagination", inputSchema: { type: "object", properties: { channel_id: { type: "string" }, limit: { type: "number" }, cursor: { type: "string" } }, required: ["channel_id"], additionalProperties: false }, annotations: { readOnlyHint: true } }] } };
|
|
2517
|
+
|
|
2518
|
+
// ../packages/twin-slack/dist/src/tools.js
|
|
2519
|
+
var slackToolFixture = loadMcpToolFixture({ raw: mcp_tools_list_raw_default, meta: mcp_tools_list_meta_default });
|
|
2520
|
+
var toolSchemas = {
|
|
2521
|
+
slack_post_message: z.strictObject({
|
|
2522
|
+
channel_id: z.string(),
|
|
2523
|
+
text: z.string()
|
|
2524
|
+
}).strict(),
|
|
2525
|
+
slack_reply_to_thread: z.strictObject({
|
|
2526
|
+
channel_id: z.string(),
|
|
2527
|
+
thread_ts: z.string(),
|
|
2528
|
+
text: z.string()
|
|
2529
|
+
}).strict(),
|
|
2530
|
+
slack_add_reaction: z.strictObject({
|
|
2531
|
+
channel_id: z.string(),
|
|
2532
|
+
timestamp: z.string(),
|
|
2533
|
+
reaction: z.string()
|
|
2534
|
+
}).strict(),
|
|
2535
|
+
slack_get_channel_history: z.strictObject({
|
|
2536
|
+
channel_id: z.string(),
|
|
2537
|
+
limit: z.number().optional()
|
|
2538
|
+
}).strict(),
|
|
2539
|
+
slack_get_thread_replies: z.strictObject({
|
|
2540
|
+
channel_id: z.string(),
|
|
2541
|
+
thread_ts: z.string()
|
|
2542
|
+
}).strict(),
|
|
2543
|
+
slack_list_channels: z.strictObject({
|
|
2544
|
+
limit: z.number().optional(),
|
|
2545
|
+
cursor: z.string().optional()
|
|
2546
|
+
}).strict(),
|
|
2547
|
+
slack_get_users: z.strictObject({
|
|
2548
|
+
cursor: z.string().optional(),
|
|
2549
|
+
limit: z.number().optional()
|
|
2550
|
+
}).strict(),
|
|
2551
|
+
slack_get_user_profile: z.strictObject({
|
|
2552
|
+
user_id: z.string()
|
|
2553
|
+
}).strict(),
|
|
2554
|
+
slack_search_messages: z.strictObject({
|
|
2555
|
+
query: z.string(),
|
|
2556
|
+
count: z.number().optional(),
|
|
2557
|
+
page: z.number().optional()
|
|
2558
|
+
}).strict(),
|
|
2559
|
+
slack_get_reactions: z.strictObject({
|
|
2560
|
+
channel_id: z.string(),
|
|
2561
|
+
timestamp: z.string()
|
|
2562
|
+
}).strict(),
|
|
2563
|
+
slack_list_channel_members: z.strictObject({
|
|
2564
|
+
channel_id: z.string(),
|
|
2565
|
+
limit: z.number().optional(),
|
|
2566
|
+
cursor: z.string().optional()
|
|
2567
|
+
}).strict()
|
|
2568
|
+
};
|
|
2578
2569
|
var MUTATING_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
2579
2570
|
"slack_post_message",
|
|
2580
2571
|
"slack_reply_to_thread",
|
|
@@ -2583,7 +2574,7 @@ var MUTATING_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
|
2583
2574
|
function isMutatingTool(name) {
|
|
2584
2575
|
return MUTATING_TOOL_NAMES.has(name);
|
|
2585
2576
|
}
|
|
2586
|
-
function
|
|
2577
|
+
function slackToolInputSchema(schema) {
|
|
2587
2578
|
const json = z.toJSONSchema(schema, { target: "draft-7" });
|
|
2588
2579
|
return {
|
|
2589
2580
|
type: "object",
|
|
@@ -2592,27 +2583,11 @@ function toJsonSchema(schema) {
|
|
|
2592
2583
|
additionalProperties: false
|
|
2593
2584
|
};
|
|
2594
2585
|
}
|
|
2595
|
-
function listTools() {
|
|
2596
|
-
return toolDefinitions.map((tool) => ({
|
|
2597
|
-
name: tool.name,
|
|
2598
|
-
description: tool.description,
|
|
2599
|
-
input_schema: toJsonSchema(tool.schema),
|
|
2600
|
-
...tool.readOnly ? { annotations: { readOnlyHint: true } } : {}
|
|
2601
|
-
}));
|
|
2602
|
-
}
|
|
2603
|
-
function listToolsForMcp() {
|
|
2604
|
-
return toolDefinitions.map((tool) => ({
|
|
2605
|
-
name: tool.name,
|
|
2606
|
-
description: tool.description,
|
|
2607
|
-
inputSchema: toJsonSchema(tool.schema),
|
|
2608
|
-
...tool.readOnly ? { annotations: { readOnlyHint: true } } : {}
|
|
2609
|
-
}));
|
|
2610
|
-
}
|
|
2611
2586
|
function executeTool(domain, name, args, onDelta, actor = {}) {
|
|
2612
|
-
const
|
|
2613
|
-
if (!
|
|
2587
|
+
const schema = toolSchemas[name];
|
|
2588
|
+
if (!schema)
|
|
2614
2589
|
throw new Error(`Unknown tool: ${name}`);
|
|
2615
|
-
const parsed =
|
|
2590
|
+
const parsed = schema.parse(args);
|
|
2616
2591
|
const delta = (d) => onDelta?.(d);
|
|
2617
2592
|
switch (name) {
|
|
2618
2593
|
case "slack_post_message": {
|
|
@@ -2772,7 +2747,14 @@ function slackErrorEnvelope(err) {
|
|
|
2772
2747
|
body: { ok: false, error: "internal_error", warning: err instanceof Error ? err.message : "internal_error" }
|
|
2773
2748
|
};
|
|
2774
2749
|
}
|
|
2775
|
-
var
|
|
2750
|
+
var slackToolImplementations = Object.fromEntries(Object.entries(toolSchemas).map(([name, schema]) => [
|
|
2751
|
+
name,
|
|
2752
|
+
{
|
|
2753
|
+
schema,
|
|
2754
|
+
mutation: isMutatingTool(name),
|
|
2755
|
+
handler: (domain, args, ctx) => wrapSlackOk(executeTool(domain, name, args, ctx.reportDelta, actorFromSession(ctx.session)))
|
|
2756
|
+
}
|
|
2757
|
+
]));
|
|
2776
2758
|
var slackTwinDefinition = defineTwin({
|
|
2777
2759
|
id: "slack",
|
|
2778
2760
|
version: process.env.POME_TWIN_VERSION ?? "0.1.0",
|
|
@@ -2824,18 +2806,7 @@ var slackTwinDefinition = defineTwin({
|
|
|
2824
2806
|
// Frozen slack admin-gate 403 body.
|
|
2825
2807
|
forbidden: () => ({ status: 403, body: slackError2("restricted_action") })
|
|
2826
2808
|
},
|
|
2827
|
-
tools:
|
|
2828
|
-
const listed = toolListing.get(def.name);
|
|
2829
|
-
return {
|
|
2830
|
-
name: def.name,
|
|
2831
|
-
description: def.description,
|
|
2832
|
-
schema: def.schema,
|
|
2833
|
-
mutation: isMutatingTool(def.name),
|
|
2834
|
-
inputSchema: listed?.input_schema,
|
|
2835
|
-
..."annotations" in (listed ?? {}) ? { annotations: listed.annotations } : {},
|
|
2836
|
-
handler: (domain, args, ctx) => wrapSlackOk(executeTool(domain, def.name, args, ctx.reportDelta, actorFromSession(ctx.session)))
|
|
2837
|
-
};
|
|
2838
|
-
}),
|
|
2809
|
+
tools: deriveMcpToolTable(slackToolFixture, slackToolImplementations),
|
|
2839
2810
|
// Frozen healthz shape: {ok, twin, implementation, tools, runtime} — no
|
|
2840
2811
|
// version/fidelity extras (slack never carried them).
|
|
2841
2812
|
healthz: () => ({}),
|
|
@@ -2866,4 +2837,4 @@ function createSlackTwinApp(opts = {}) {
|
|
|
2866
2837
|
});
|
|
2867
2838
|
}
|
|
2868
2839
|
|
|
2869
|
-
export { MUTATING_TOOL_NAMES, SlackDomain, createSlackTwinApp, defaultSeedState, executeTool, isMutatingTool,
|
|
2840
|
+
export { MUTATING_TOOL_NAMES, SlackDomain, createSlackTwinApp, defaultSeedState, executeTool, isMutatingTool, loadSeedFromEnv, migrate, openSlackTwinDatabase, parseSeed, resetDatabase, seedSchema, slackToolFixture, slackToolInputSchema, slackTwinDefinition, toolSchemas };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { failureInjectionRuleSchema, openTwinDatabase, createFailureInjectionStore, defineTwin, twinBuildInfo, failureInjectionMiddleware, createApp, FAILURE_INJECTION_OVERRIDE_KEY, recordedRequestHeaders, UnknownToolError } from './chunk-
|
|
1
|
+
import { failureInjectionRuleSchema, loadMcpToolFixture, openTwinDatabase, createFailureInjectionStore, defineTwin, twinBuildInfo, deriveMcpToolTable, failureInjectionMiddleware, createApp, FAILURE_INJECTION_OVERRIDE_KEY, recordedRequestHeaders, UnknownToolError } from './chunk-TV5S6WQV.js';
|
|
2
2
|
import './chunk-VBATFCWR.js';
|
|
3
3
|
import './chunk-SG6ZTIMT.js';
|
|
4
4
|
import { z, ZodError } from 'zod';
|
|
@@ -3829,6 +3829,66 @@ function registerX402Routes(session, opts) {
|
|
|
3829
3829
|
message: "Payment verified by the Stripe twin."
|
|
3830
3830
|
}));
|
|
3831
3831
|
}
|
|
3832
|
+
|
|
3833
|
+
// ../packages/twin-stripe/dist/fixtures/mcp-tools-list.meta.json
|
|
3834
|
+
var mcp_tools_list_meta_default = {
|
|
3835
|
+
twin: "stripe",
|
|
3836
|
+
substrate: "twin-code-transcription",
|
|
3837
|
+
endpoint: "in-process://twin-stripe/s/:sid/mcp",
|
|
3838
|
+
method: "tools/list",
|
|
3839
|
+
protocol: "JSON-RPC 2.0 over Streamable HTTP",
|
|
3840
|
+
protocolVersion: "2025-06-18",
|
|
3841
|
+
captureDate: "2026-08-06",
|
|
3842
|
+
rawFileSha256: "7bb87c5d6d99fea8dad1069a501f9801811e42c7cf81723b6b3d4e75aacc5bba",
|
|
3843
|
+
liveToolCount: 26,
|
|
3844
|
+
liveToolOrder: [
|
|
3845
|
+
"create_payment_intent",
|
|
3846
|
+
"retrieve_payment_intent",
|
|
3847
|
+
"list_payment_intents",
|
|
3848
|
+
"confirm_payment_intent",
|
|
3849
|
+
"update_payment_intent",
|
|
3850
|
+
"cancel_payment_intent",
|
|
3851
|
+
"simulate_crypto_deposit",
|
|
3852
|
+
"retrieve_charge",
|
|
3853
|
+
"list_charges",
|
|
3854
|
+
"create_refund",
|
|
3855
|
+
"retrieve_refund",
|
|
3856
|
+
"list_refunds",
|
|
3857
|
+
"create_customer",
|
|
3858
|
+
"retrieve_customer",
|
|
3859
|
+
"update_customer",
|
|
3860
|
+
"delete_customer",
|
|
3861
|
+
"list_customers",
|
|
3862
|
+
"list_customer_payment_methods",
|
|
3863
|
+
"create_payment_method",
|
|
3864
|
+
"retrieve_payment_method",
|
|
3865
|
+
"attach_payment_method",
|
|
3866
|
+
"detach_payment_method",
|
|
3867
|
+
"retrieve_balance",
|
|
3868
|
+
"list_balance_transactions",
|
|
3869
|
+
"retrieve_event",
|
|
3870
|
+
"list_events"
|
|
3871
|
+
],
|
|
3872
|
+
transcription: {
|
|
3873
|
+
readFrom: "twin-stripe's own tools/list, booted on defaultSeed() and driven through Hono's app.request, read immediately before this table became fixture-driven (F-1325)",
|
|
3874
|
+
contentOrigin: "packages/twin-stripe/src/tools.ts \u2014 a hand-written TypeScript array of 26 tools. Each inputSchema is z.toJSONSchema() of that tool's zod schema, frozen here verbatim including the $schema key it emits.",
|
|
3875
|
+
comparedToUpstream: "never, and not comparable today. @stripe/mcp is a stdio-to-HTTP proxy that declares no tools of its own and the served listing is a function of the caller's Restricted API Key, so F-1326 recorded stripe as not-captured (fixtures/mcp-tools-list/stripe.status.json) rather than inventing a deployment-invariant table."
|
|
3876
|
+
},
|
|
3877
|
+
notes: [
|
|
3878
|
+
"Seeded from the code table rather than from upstream on purpose. F-1325 is name-neutral by construction: every byte this twin serves is identical before and after it."
|
|
3879
|
+
],
|
|
3880
|
+
canonicalFileSha256: "76d0bafab29a0ccc15730b7ee4d754bcec75d655891e3a2a21a11b4e7cfc8211",
|
|
3881
|
+
files: {
|
|
3882
|
+
raw: "mcp-tools-list.raw.json",
|
|
3883
|
+
canonical: "mcp-tools-list.canonical.json"
|
|
3884
|
+
}
|
|
3885
|
+
};
|
|
3886
|
+
|
|
3887
|
+
// ../packages/twin-stripe/dist/fixtures/mcp-tools-list.raw.json
|
|
3888
|
+
var mcp_tools_list_raw_default = { jsonrpc: "2.0", id: 1, result: { tools: [{ name: "create_payment_intent", description: "Create a PaymentIntent: crypto-deposit (the x402 entry point) or card (optionally with payment_method / customer / confirm).", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { amount: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, currency: { type: "string", minLength: 1 }, payment_method_types: { minItems: 1, maxItems: 1, type: "array", items: { type: "string", enum: ["crypto", "card"] } }, payment_method_options: { type: "object", properties: { crypto: { type: "object", properties: { mode: { type: "string", const: "deposit" }, deposit_options: { type: "object", properties: { networks: { minItems: 1, type: "array", items: { type: "string" } } }, additionalProperties: false } }, required: ["mode"], additionalProperties: false } }, required: ["crypto"], additionalProperties: false }, payment_method: { type: "string" }, customer: { type: "string" }, confirm: { type: "boolean" }, metadata: { type: "object", propertyNames: { type: "string" }, additionalProperties: { type: "string" } }, capture_method: { type: "string" }, confirmation_method: { type: "string" } }, required: ["amount", "currency", "payment_method_types"], additionalProperties: false } }, { name: "retrieve_payment_intent", description: "Retrieve a PaymentIntent by id.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { id: { type: "string", minLength: 1 } }, required: ["id"], additionalProperties: false } }, { name: "list_payment_intents", description: "List PaymentIntents with optional filters.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { limit: { type: "integer", minimum: 1, maximum: 100 }, created: { anyOf: [{ type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, { type: "object", properties: { gt: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, gte: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, lt: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, lte: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 } }, additionalProperties: false }] } }, additionalProperties: false } }, { name: "confirm_payment_intent", description: "Confirm a PaymentIntent. Card PIs attempt the charge synchronously (magic test PMs decline); crypto-deposit PIs are idempotent here.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { id: { type: "string", minLength: 1 }, payment_method: { type: "string" } }, required: ["id"], additionalProperties: false } }, { name: "update_payment_intent", description: "Update a non-terminal PaymentIntent (amount, metadata, payment_method, customer). The card retry step: attach a new PM after a decline, then confirm again.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { id: { type: "string", minLength: 1 }, amount: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, metadata: { type: "object", propertyNames: { type: "string" }, additionalProperties: { anyOf: [{ type: "string" }, { type: "null" }] } }, payment_method: { type: "string" }, customer: { type: "string" } }, required: ["id"], additionalProperties: false } }, { name: "cancel_payment_intent", description: "Cancel a PaymentIntent. Refused once succeeded.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { id: { type: "string", minLength: 1 } }, required: ["id"], additionalProperties: false } }, { name: "simulate_crypto_deposit", description: "Test helper: drive a crypto-deposit PI from requires_action through processing to succeeded.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { id: { type: "string", minLength: 1 } }, required: ["id"], additionalProperties: false } }, { name: "retrieve_charge", description: "Retrieve a Charge by id.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { id: { type: "string", minLength: 1 } }, required: ["id"], additionalProperties: false } }, { name: "list_charges", description: "List charges with optional payment_intent / customer / created filters.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { limit: { type: "integer", minimum: 1, maximum: 100 }, created: { anyOf: [{ type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, { type: "object", properties: { gt: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, gte: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, lt: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, lte: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 } }, additionalProperties: false }] }, payment_intent: { type: "string" }, customer: { type: "string" } }, additionalProperties: false } }, { name: "create_refund", description: "Refund a charge, fully or partially. Stripe refuses a refund on a charge that is already fully refunded, or one that would exceed the remaining refundable amount.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { charge: { type: "string", minLength: 1 }, amount: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991 }, reason: { type: "string" } }, required: ["charge"], additionalProperties: false } }, { name: "retrieve_refund", description: "Retrieve a Refund by id.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { id: { type: "string", minLength: 1 } }, required: ["id"], additionalProperties: false } }, { name: "list_refunds", description: "List refunds, optionally filtered by charge or payment_intent.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { limit: { type: "integer", minimum: 1, maximum: 100 }, created: { anyOf: [{ type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, { type: "object", properties: { gt: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, gte: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, lt: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, lte: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 } }, additionalProperties: false }] }, charge: { type: "string" }, payment_intent: { type: "string" } }, additionalProperties: false } }, { name: "create_customer", description: "Create a customer. All fields optional, like real Stripe.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { name: { type: "string" }, email: { type: "string" }, description: { type: "string" }, phone: { type: "string" }, metadata: { type: "object", propertyNames: { type: "string" }, additionalProperties: { type: "string" } } }, additionalProperties: false } }, { name: "retrieve_customer", description: "Retrieve a Customer by id. Deleted customers return the {deleted: true} stub.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { id: { type: "string", minLength: 1 } }, required: ["id"], additionalProperties: false } }, { name: "update_customer", description: "Update a customer's fields. Metadata merges per-key; a null or empty value unsets the key.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { id: { type: "string", minLength: 1 }, name: { type: "string" }, email: { type: "string" }, description: { type: "string" }, phone: { type: "string" }, metadata: { type: "object", propertyNames: { type: "string" }, additionalProperties: { anyOf: [{ type: "string" }, { type: "null" }] } } }, required: ["id"], additionalProperties: false } }, { name: "delete_customer", description: "Delete a customer (soft delete; its payment methods are detached).", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { id: { type: "string", minLength: 1 } }, required: ["id"], additionalProperties: false } }, { name: "list_customers", description: "List customers with optional email / created filters.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { limit: { type: "integer", minimum: 1, maximum: 100 }, created: { anyOf: [{ type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, { type: "object", properties: { gt: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, gte: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, lt: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, lte: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 } }, additionalProperties: false }] }, email: { type: "string" } }, additionalProperties: false } }, { name: "list_customer_payment_methods", description: "List the payment methods attached to a customer.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { customer: { type: "string", minLength: 1 }, type: { type: "string" }, limit: { type: "integer", minimum: 1, maximum: 100 } }, required: ["customer"], additionalProperties: false } }, { name: "create_payment_method", description: "Create a card payment method from test card details (e.g. number 4242424242424242).", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { type: { type: "string", const: "card" }, card: { type: "object", properties: { number: { type: "string", minLength: 1 }, exp_month: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, exp_year: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, cvc: { type: "string" } }, required: ["number", "exp_month", "exp_year"], additionalProperties: false } }, required: ["type", "card"], additionalProperties: false } }, { name: "retrieve_payment_method", description: "Retrieve a PaymentMethod by id.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { id: { type: "string", minLength: 1 } }, required: ["id"], additionalProperties: false } }, { name: "attach_payment_method", description: "Attach a payment method to a customer. One customer per PM; a detached PM cannot be reattached.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { id: { type: "string", minLength: 1 }, customer: { type: "string", minLength: 1 } }, required: ["id", "customer"], additionalProperties: false } }, { name: "detach_payment_method", description: "Detach a payment method from its customer.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { id: { type: "string", minLength: 1 } }, required: ["id"], additionalProperties: false } }, { name: "retrieve_balance", description: "Retrieve the current balance (available + pending per currency).", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: {}, additionalProperties: false } }, { name: "list_balance_transactions", description: "List balance transactions (charges, refunds, fees).", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { limit: { type: "integer", minimum: 1, maximum: 100 }, created: { anyOf: [{ type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, { type: "object", properties: { gt: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, gte: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, lt: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, lte: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 } }, additionalProperties: false }] }, type: { type: "string" } }, additionalProperties: false } }, { name: "retrieve_event", description: "Retrieve an event by id.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { id: { type: "string", minLength: 1 } }, required: ["id"], additionalProperties: false } }, { name: "list_events", description: "List events. Filter by type and created.", inputSchema: { $schema: "https://json-schema.org/draft/2020-12/schema", type: "object", properties: { limit: { type: "integer", minimum: 1, maximum: 100 }, created: { anyOf: [{ type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, { type: "object", properties: { gt: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, gte: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, lt: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 }, lte: { type: "integer", minimum: -9007199254740991, maximum: 9007199254740991 } }, additionalProperties: false }] }, type: { type: "string" } }, additionalProperties: false } }] } };
|
|
3889
|
+
|
|
3890
|
+
// ../packages/twin-stripe/dist/src/tools.js
|
|
3891
|
+
var stripeToolFixture = loadMcpToolFixture({ raw: mcp_tools_list_raw_default, meta: mcp_tools_list_meta_default });
|
|
3832
3892
|
var piPMTypes = z.array(z.enum(["crypto", "card"])).length(1);
|
|
3833
3893
|
var cryptoOptions = z.object({
|
|
3834
3894
|
mode: z.literal("deposit"),
|
|
@@ -3863,10 +3923,9 @@ function flattenCreated(input) {
|
|
|
3863
3923
|
created_lte: input.created.lte
|
|
3864
3924
|
};
|
|
3865
3925
|
}
|
|
3866
|
-
var
|
|
3926
|
+
var toolArgumentSchemas = [
|
|
3867
3927
|
{
|
|
3868
3928
|
name: "create_payment_intent",
|
|
3869
|
-
description: "Create a PaymentIntent: crypto-deposit (the x402 entry point) or card (optionally with payment_method / customer / confirm).",
|
|
3870
3929
|
schema: z.object({
|
|
3871
3930
|
amount: z.coerce.number().int().positive(),
|
|
3872
3931
|
currency: z.string().min(1),
|
|
@@ -3884,22 +3943,18 @@ var toolDefinitions = [
|
|
|
3884
3943
|
},
|
|
3885
3944
|
{
|
|
3886
3945
|
name: "retrieve_payment_intent",
|
|
3887
|
-
description: "Retrieve a PaymentIntent by id.",
|
|
3888
3946
|
schema: z.object({ id: z.string().min(1) })
|
|
3889
3947
|
},
|
|
3890
3948
|
{
|
|
3891
3949
|
name: "list_payment_intents",
|
|
3892
|
-
description: "List PaymentIntents with optional filters.",
|
|
3893
3950
|
schema: z.object({ ...limitShape, ...createdRange })
|
|
3894
3951
|
},
|
|
3895
3952
|
{
|
|
3896
3953
|
name: "confirm_payment_intent",
|
|
3897
|
-
description: "Confirm a PaymentIntent. Card PIs attempt the charge synchronously (magic test PMs decline); crypto-deposit PIs are idempotent here.",
|
|
3898
3954
|
schema: z.object({ id: z.string().min(1), payment_method: z.string().optional() })
|
|
3899
3955
|
},
|
|
3900
3956
|
{
|
|
3901
3957
|
name: "update_payment_intent",
|
|
3902
|
-
description: "Update a non-terminal PaymentIntent (amount, metadata, payment_method, customer). The card retry step: attach a new PM after a decline, then confirm again.",
|
|
3903
3958
|
schema: z.object({
|
|
3904
3959
|
id: z.string().min(1),
|
|
3905
3960
|
amount: z.coerce.number().int().optional(),
|
|
@@ -3910,22 +3965,18 @@ var toolDefinitions = [
|
|
|
3910
3965
|
},
|
|
3911
3966
|
{
|
|
3912
3967
|
name: "cancel_payment_intent",
|
|
3913
|
-
description: "Cancel a PaymentIntent. Refused once succeeded.",
|
|
3914
3968
|
schema: z.object({ id: z.string().min(1) })
|
|
3915
3969
|
},
|
|
3916
3970
|
{
|
|
3917
3971
|
name: "simulate_crypto_deposit",
|
|
3918
|
-
description: "Test helper: drive a crypto-deposit PI from requires_action through processing to succeeded.",
|
|
3919
3972
|
schema: z.object({ id: z.string().min(1) })
|
|
3920
3973
|
},
|
|
3921
3974
|
{
|
|
3922
3975
|
name: "retrieve_charge",
|
|
3923
|
-
description: "Retrieve a Charge by id.",
|
|
3924
3976
|
schema: z.object({ id: z.string().min(1) })
|
|
3925
3977
|
},
|
|
3926
3978
|
{
|
|
3927
3979
|
name: "list_charges",
|
|
3928
|
-
description: "List charges with optional payment_intent / customer / created filters.",
|
|
3929
3980
|
schema: z.object({
|
|
3930
3981
|
...limitShape,
|
|
3931
3982
|
...createdRange,
|
|
@@ -3935,7 +3986,6 @@ var toolDefinitions = [
|
|
|
3935
3986
|
},
|
|
3936
3987
|
{
|
|
3937
3988
|
name: "create_refund",
|
|
3938
|
-
description: "Refund a charge, fully or partially. Stripe refuses a refund on a charge that is already fully refunded, or one that would exceed the remaining refundable amount.",
|
|
3939
3989
|
schema: z.object({
|
|
3940
3990
|
charge: z.string().min(1),
|
|
3941
3991
|
amount: z.coerce.number().int().positive().optional(),
|
|
@@ -3944,12 +3994,10 @@ var toolDefinitions = [
|
|
|
3944
3994
|
},
|
|
3945
3995
|
{
|
|
3946
3996
|
name: "retrieve_refund",
|
|
3947
|
-
description: "Retrieve a Refund by id.",
|
|
3948
3997
|
schema: z.object({ id: z.string().min(1) })
|
|
3949
3998
|
},
|
|
3950
3999
|
{
|
|
3951
4000
|
name: "list_refunds",
|
|
3952
|
-
description: "List refunds, optionally filtered by charge or payment_intent.",
|
|
3953
4001
|
schema: z.object({
|
|
3954
4002
|
...limitShape,
|
|
3955
4003
|
...createdRange,
|
|
@@ -3959,7 +4007,6 @@ var toolDefinitions = [
|
|
|
3959
4007
|
},
|
|
3960
4008
|
{
|
|
3961
4009
|
name: "create_customer",
|
|
3962
|
-
description: "Create a customer. All fields optional, like real Stripe.",
|
|
3963
4010
|
schema: z.object({
|
|
3964
4011
|
name: z.string().optional(),
|
|
3965
4012
|
email: z.string().optional(),
|
|
@@ -3970,12 +4017,10 @@ var toolDefinitions = [
|
|
|
3970
4017
|
},
|
|
3971
4018
|
{
|
|
3972
4019
|
name: "retrieve_customer",
|
|
3973
|
-
description: "Retrieve a Customer by id. Deleted customers return the {deleted: true} stub.",
|
|
3974
4020
|
schema: z.object({ id: z.string().min(1) })
|
|
3975
4021
|
},
|
|
3976
4022
|
{
|
|
3977
4023
|
name: "update_customer",
|
|
3978
|
-
description: "Update a customer's fields. Metadata merges per-key; a null or empty value unsets the key.",
|
|
3979
4024
|
schema: z.object({
|
|
3980
4025
|
id: z.string().min(1),
|
|
3981
4026
|
name: z.string().optional(),
|
|
@@ -3988,12 +4033,10 @@ var toolDefinitions = [
|
|
|
3988
4033
|
},
|
|
3989
4034
|
{
|
|
3990
4035
|
name: "delete_customer",
|
|
3991
|
-
description: "Delete a customer (soft delete; its payment methods are detached).",
|
|
3992
4036
|
schema: z.object({ id: z.string().min(1) })
|
|
3993
4037
|
},
|
|
3994
4038
|
{
|
|
3995
4039
|
name: "list_customers",
|
|
3996
|
-
description: "List customers with optional email / created filters.",
|
|
3997
4040
|
schema: z.object({
|
|
3998
4041
|
...limitShape,
|
|
3999
4042
|
...createdRange,
|
|
@@ -4002,7 +4045,6 @@ var toolDefinitions = [
|
|
|
4002
4045
|
},
|
|
4003
4046
|
{
|
|
4004
4047
|
name: "list_customer_payment_methods",
|
|
4005
|
-
description: "List the payment methods attached to a customer.",
|
|
4006
4048
|
schema: z.object({
|
|
4007
4049
|
customer: z.string().min(1),
|
|
4008
4050
|
type: z.string().optional(),
|
|
@@ -4011,7 +4053,6 @@ var toolDefinitions = [
|
|
|
4011
4053
|
},
|
|
4012
4054
|
{
|
|
4013
4055
|
name: "create_payment_method",
|
|
4014
|
-
description: "Create a card payment method from test card details (e.g. number 4242424242424242).",
|
|
4015
4056
|
schema: z.object({
|
|
4016
4057
|
type: z.literal("card"),
|
|
4017
4058
|
card: z.object({
|
|
@@ -4024,27 +4065,22 @@ var toolDefinitions = [
|
|
|
4024
4065
|
},
|
|
4025
4066
|
{
|
|
4026
4067
|
name: "retrieve_payment_method",
|
|
4027
|
-
description: "Retrieve a PaymentMethod by id.",
|
|
4028
4068
|
schema: z.object({ id: z.string().min(1) })
|
|
4029
4069
|
},
|
|
4030
4070
|
{
|
|
4031
4071
|
name: "attach_payment_method",
|
|
4032
|
-
description: "Attach a payment method to a customer. One customer per PM; a detached PM cannot be reattached.",
|
|
4033
4072
|
schema: z.object({ id: z.string().min(1), customer: z.string().min(1) })
|
|
4034
4073
|
},
|
|
4035
4074
|
{
|
|
4036
4075
|
name: "detach_payment_method",
|
|
4037
|
-
description: "Detach a payment method from its customer.",
|
|
4038
4076
|
schema: z.object({ id: z.string().min(1) })
|
|
4039
4077
|
},
|
|
4040
4078
|
{
|
|
4041
4079
|
name: "retrieve_balance",
|
|
4042
|
-
description: "Retrieve the current balance (available + pending per currency).",
|
|
4043
4080
|
schema: z.object({}).optional()
|
|
4044
4081
|
},
|
|
4045
4082
|
{
|
|
4046
4083
|
name: "list_balance_transactions",
|
|
4047
|
-
description: "List balance transactions (charges, refunds, fees).",
|
|
4048
4084
|
schema: z.object({
|
|
4049
4085
|
...limitShape,
|
|
4050
4086
|
...createdRange,
|
|
@@ -4053,12 +4089,10 @@ var toolDefinitions = [
|
|
|
4053
4089
|
},
|
|
4054
4090
|
{
|
|
4055
4091
|
name: "retrieve_event",
|
|
4056
|
-
description: "Retrieve an event by id.",
|
|
4057
4092
|
schema: z.object({ id: z.string().min(1) })
|
|
4058
4093
|
},
|
|
4059
4094
|
{
|
|
4060
4095
|
name: "list_events",
|
|
4061
|
-
description: "List events. Filter by type and created.",
|
|
4062
4096
|
schema: z.object({
|
|
4063
4097
|
...limitShape,
|
|
4064
4098
|
...createdRange,
|
|
@@ -4066,13 +4100,6 @@ var toolDefinitions = [
|
|
|
4066
4100
|
})
|
|
4067
4101
|
}
|
|
4068
4102
|
];
|
|
4069
|
-
function listTools() {
|
|
4070
|
-
return toolDefinitions.map((tool) => ({
|
|
4071
|
-
name: tool.name,
|
|
4072
|
-
description: tool.description,
|
|
4073
|
-
input_schema: schemaToJson(tool.schema)
|
|
4074
|
-
}));
|
|
4075
|
-
}
|
|
4076
4103
|
function isMutatingTool(name) {
|
|
4077
4104
|
return [
|
|
4078
4105
|
"create_payment_intent",
|
|
@@ -4090,7 +4117,7 @@ function isMutatingTool(name) {
|
|
|
4090
4117
|
].includes(name);
|
|
4091
4118
|
}
|
|
4092
4119
|
function executeTool(domain, accountId2, name, input) {
|
|
4093
|
-
const definition =
|
|
4120
|
+
const definition = toolArgumentSchemas.find((tool) => tool.name === name);
|
|
4094
4121
|
if (!definition) {
|
|
4095
4122
|
throw new TwinError("invalid_request_error", "tool_unknown", `No such MCP tool: '${name}'.`, { param: "tool", statusCode: 400 });
|
|
4096
4123
|
}
|
|
@@ -4170,7 +4197,7 @@ function executeTool(domain, accountId2, name, input) {
|
|
|
4170
4197
|
}
|
|
4171
4198
|
}
|
|
4172
4199
|
}
|
|
4173
|
-
function
|
|
4200
|
+
function stripeToolInputSchema(schema) {
|
|
4174
4201
|
const candidate = z.toJSONSchema;
|
|
4175
4202
|
if (typeof candidate === "function") {
|
|
4176
4203
|
try {
|
|
@@ -4221,7 +4248,14 @@ function stripeErrorEnvelope(err) {
|
|
|
4221
4248
|
}
|
|
4222
4249
|
return stripeError("api_error", "internal_error", err instanceof Error ? err.message : "Internal Server Error", { statusCode: 500 });
|
|
4223
4250
|
}
|
|
4224
|
-
var
|
|
4251
|
+
var stripeToolImplementations = Object.fromEntries(toolArgumentSchemas.map((def) => [
|
|
4252
|
+
def.name,
|
|
4253
|
+
{
|
|
4254
|
+
schema: def.schema,
|
|
4255
|
+
mutation: isMutatingTool(def.name),
|
|
4256
|
+
handler: (domain, args, ctx) => executeTool(domain, accountIdFrom(ctx.session), def.name, args)
|
|
4257
|
+
}
|
|
4258
|
+
]));
|
|
4225
4259
|
function createStripeTwinDefinition(opts) {
|
|
4226
4260
|
const { db } = opts;
|
|
4227
4261
|
const startedAtMs = opts.startedAtMs ?? Date.now();
|
|
@@ -4319,14 +4353,7 @@ function createStripeTwinDefinition(opts) {
|
|
|
4319
4353
|
// Frozen stripe admin-gate 403 body.
|
|
4320
4354
|
forbidden: () => forbidden("Forbidden")
|
|
4321
4355
|
},
|
|
4322
|
-
tools:
|
|
4323
|
-
name: def.name,
|
|
4324
|
-
description: def.description,
|
|
4325
|
-
schema: def.schema,
|
|
4326
|
-
mutation: isMutatingTool(def.name),
|
|
4327
|
-
inputSchema: toolListing.get(def.name)?.input_schema,
|
|
4328
|
-
handler: (domain, args, ctx) => executeTool(domain, accountIdFrom(ctx.session), def.name, args)
|
|
4329
|
-
})),
|
|
4356
|
+
tools: deriveMcpToolTable(stripeToolFixture, stripeToolImplementations),
|
|
4330
4357
|
// Frozen healthz extras: fidelity + tthw_seconds on top of the contract
|
|
4331
4358
|
// core {ok, twin, implementation, tools, runtime}.
|
|
4332
4359
|
healthz: () => ({ fidelity: "semantic", tthw_seconds: tthwSeconds(startedAtMs) }),
|
|
@@ -4395,4 +4422,4 @@ function createTwinStripeApp(opts = {}) {
|
|
|
4395
4422
|
});
|
|
4396
4423
|
}
|
|
4397
4424
|
|
|
4398
|
-
export { DEFAULT_API_KEY, DEFAULT_SID, StripeDomain, applySeed, createStripeTwinDefinition, createTwinStripeApp, defaultSeed, executeTool, isMutatingTool,
|
|
4425
|
+
export { DEFAULT_API_KEY, DEFAULT_SID, StripeDomain, applySeed, createStripeTwinDefinition, createTwinStripeApp, defaultSeed, executeTool, isMutatingTool, loadSeedFromEnv, migrate, mintApiKey, openTwinStripeDatabase, parseSeed, paymentMiddleware, registerStripeRoutes, registerX402Routes, resetDatabase, resolveSidFromKey, revokeApiKey, seedSchema, stripeToolFixture, stripeToolInputSchema, toolArgumentSchemas, tthwSeconds };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { bootTwin } from './chunk-
|
|
2
|
-
import { isTwinName, TWIN_NAMES, defaultPortFor, TWIN_REGISTRY } from './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
import { bootTwin } from './chunk-OR4X4BIY.js';
|
|
2
|
+
import { isTwinName, TWIN_NAMES, defaultPortFor, TWIN_REGISTRY } from './chunk-563RZ7P3.js';
|
|
3
|
+
import './chunk-TV5S6WQV.js';
|
|
4
4
|
import './chunk-VBATFCWR.js';
|
|
5
5
|
import './chunk-SG6ZTIMT.js';
|
|
6
6
|
import { randomBytes } from 'node:crypto';
|
package/package.json
CHANGED