@codespar/cli 0.6.1 → 0.7.0

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/README.md CHANGED
@@ -41,6 +41,19 @@ codespar spend --mandate <id> --amount 1 --agent buyer \
41
41
  # ramp trade at the real rate). Omit --execute to just plan it.
42
42
  codespar transfer shopper --from BRL --to USDC --amount 15000
43
43
 
44
+ # Every published meta-tool is invocable by name; the actions come from the
45
+ # published definition, so an unknown one is refused before anything is sent
46
+ codespar tools meta
47
+ codespar tool codespar_wallet --action balance --arg consumer_id=con_0000
48
+ codespar pay --action status --arg reference=pay_0000
49
+
50
+ # Resource groups are derived from the served OpenAPI document: each
51
+ # subcommand is one operation, its path parameters are the positionals
52
+ codespar sellers status slr_0000
53
+ codespar wallets list --query status=active
54
+ codespar triggers create --input '{"url":"https://example.test/hook","events":["payment.settled"]}'
55
+ codespar boletos list con_0000
56
+
44
57
  # Manage sessions and logs
45
58
  codespar sessions list
46
59
  codespar logs tail --server stripe
@@ -60,6 +73,15 @@ codespar init my-agent
60
73
  | `servers show <id>` | Show a server's details and tools |
61
74
  | `tools list` | List tools (filter by `--server`) |
62
75
  | `tools show <name>` | Show a tool's full input/output schema |
76
+ | `tools meta [name]` | The 15 published meta-tool definitions — actions, required input, vocabularies |
77
+ | `tool <name>` | Invoke any published meta-tool: `--action`, `--arg key=value`, `--input` |
78
+ | `pay` / `kyc` | Shorthand for `tool codespar_pay` / `tool codespar_kyc` |
79
+ | `consumers <sub>` | Consumers: profile, Pix keys, Pix lookups, receipts, contact verification |
80
+ | `boletos <sub>` | DDA: subscribe a document, list the boletos it receives |
81
+ | `sellers <sub>` | Sellers: onboarding status, custody, pending settlement, ledger |
82
+ | `mcp-servers <sub>` | Tenant MCP servers: register, validate, patch a tool, sweep platform fees |
83
+ | `wallets <sub>` | Wallets: balances, ledger, funding sources, execute, transfer, custody |
84
+ | `triggers <sub>` | Triggers (webhooks): endpoints, deliveries, DLQ, secret rotation, redelivery |
63
85
  | `execute <tool>` | Run a single tool call in a throwaway session |
64
86
  | `discover <query>` | Search the catalog for tools matching a use case |
65
87
  | `mandate create` | Create a consumer mandate — the agent's allowance. `--slot CURRENCY:METHOD:CAP:PER_TX` (repeatable, e.g. `BRL:pix:50000:1500`) for a unified multi-currency wallet; per-currency caps, no FX |
@@ -91,6 +113,24 @@ codespar init my-agent
91
113
  | `--base-url <url>` | Point at a custom API (staging, self-hosted) |
92
114
  | `--project <id>` | Scope requests to a project (multi-project orgs) |
93
115
 
116
+ Resource-group subcommands also take `-q, --query key=value` (repeatable),
117
+ `--timeout <ms>`, and — when the operation declares a request body —
118
+ `-i, --input '<json>'` or `-f, --input-file <path>`.
119
+
120
+ ## Where the commands come from
121
+
122
+ The resource groups and the meta-tool commands are not written one by one.
123
+ `codespar sellers`, `consumers`, `boletos`, `mcp-servers`, `wallets` and
124
+ `triggers` are derived from `API_OPERATIONS` — the operation table
125
+ `@codespar/sdk` generates from the served OpenAPI document — so a
126
+ subcommand is one operation, and the request behind it is the one the
127
+ document declares. `codespar tool <name>` reads the 15 shared meta-tool
128
+ definitions from `@codespar/types`: the names, the actions and the
129
+ required input are the published ones, checked before anything is sent.
130
+
131
+ A resource family with no command needs a written exception with a date
132
+ (`src/surface.ts`), and the coverage test refuses to let that list grow.
133
+
94
134
  ## Configuration
95
135
 
96
136
  Resolution order (first match wins):
@@ -30,4 +30,15 @@ export async function resolveMetaInput(opts, name, example) {
30
30
  throw new CliError(`${source} is not valid JSON: ${err.message}`);
31
31
  }
32
32
  }
33
+ /**
34
+ * Same two flags, but the body is optional: a GET has nothing to send and
35
+ * a POST may take an empty body. Returns `undefined` when neither flag is
36
+ * given, and throws the same way as `resolveMetaInput` when one is given
37
+ * and does not parse.
38
+ */
39
+ export async function resolveOptionalInput(opts, what) {
40
+ if (opts.input === undefined && opts.inputFile === undefined)
41
+ return undefined;
42
+ return resolveMetaInput(opts, what, "{}");
43
+ }
33
44
  //# sourceMappingURL=meta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YAAY,QAAQ;YAAE,MAAM,GAAG,CAAC;QACvC,MAAM,IAAI,QAAQ,CAAC,GAAG,MAAM,uBAAwB,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,IAA4C,EAC5C,IAAY;IAEZ,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC/E,OAAO,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,167 @@
1
+ import { CodeSpar } from "@codespar/sdk";
2
+ import { CliError } from "../config.js";
3
+ import { c, info, json, kv, renderResult, table } from "../output.js";
4
+ import { resolveOptionalInput } from "./meta-input.js";
5
+ import { metaToolActions, metaToolDefinition, metaToolNames, META_TOOLS } from "../surface.js";
6
+ /**
7
+ * Resolve a tool name against the published definitions. The list in the
8
+ * error is the published list — the CLI knows of no other tool, and a
9
+ * name it cannot find is a name `@codespar/types` does not publish.
10
+ */
11
+ export function requireDefinition(name) {
12
+ const definition = metaToolDefinition(name);
13
+ if (definition)
14
+ return definition;
15
+ throw new CliError(`Unknown meta-tool "${name}". Published tools:\n ${metaToolNames().join("\n ")}`);
16
+ }
17
+ /**
18
+ * Coerce a `--arg key=value` pair against the property's published type.
19
+ * An `object` or `array` property takes JSON; everything else takes the
20
+ * literal, so a Pix key that looks like a number stays a string when the
21
+ * contract says string.
22
+ */
23
+ export function coerceArg(definition, key, raw) {
24
+ const property = definition.input_schema.properties[key];
25
+ if (!property) {
26
+ throw new CliError(`${definition.name} has no property "${key}". Published properties:\n ${definition.contract.properties.join("\n ")}`);
27
+ }
28
+ let value = raw;
29
+ if (property.type === "number" || property.type === "integer") {
30
+ const n = Number(raw);
31
+ if (!Number.isFinite(n))
32
+ throw new CliError(`${key} expects a number, got "${raw}".`);
33
+ value = n;
34
+ }
35
+ else if (property.type === "boolean") {
36
+ if (raw !== "true" && raw !== "false") {
37
+ throw new CliError(`${key} expects true or false, got "${raw}".`);
38
+ }
39
+ value = raw === "true";
40
+ }
41
+ else if (property.type === "object" || property.type === "array") {
42
+ try {
43
+ value = JSON.parse(raw);
44
+ }
45
+ catch (err) {
46
+ throw new CliError(`${key} is a ${property.type}; --arg needs valid JSON for it (or use --input): ${err.message}`);
47
+ }
48
+ }
49
+ if (property.enum && typeof value === "string" && !property.enum.includes(value)) {
50
+ throw new CliError(`${key}="${value}" is outside the published vocabulary: ${property.enum.join(" | ")}`);
51
+ }
52
+ return value;
53
+ }
54
+ /**
55
+ * Build the tool arguments from `--input`, `--arg` and `--action`, then
56
+ * check them against the published contract before anything is sent. The
57
+ * checks are the contract's own: the property names it publishes, the
58
+ * subset it marks required, and the closed vocabularies it declares. No
59
+ * vocabulary is written here — a rail or an action added to the published
60
+ * definition is accepted by this CLI without a code change.
61
+ */
62
+ export function buildArgs(definition, base, argPairs, action) {
63
+ const args = { ...(base ?? {}) };
64
+ for (const pair of argPairs) {
65
+ const eq = pair.indexOf("=");
66
+ if (eq <= 0)
67
+ throw new CliError(`--arg expects key=value, got "${pair}".`);
68
+ const key = pair.slice(0, eq);
69
+ args[key] = coerceArg(definition, key, pair.slice(eq + 1));
70
+ }
71
+ if (action !== undefined) {
72
+ const actions = metaToolActions(definition.name);
73
+ if (actions.length === 0) {
74
+ const discriminator = definition.contract.required[0];
75
+ throw new CliError(`${definition.name} publishes no "action" property, so --action means nothing to it.` +
76
+ (discriminator
77
+ ? ` Its required input is: ${definition.contract.required.join(", ")} — pass it with --arg ${discriminator}=<value> or --input.`
78
+ : ""));
79
+ }
80
+ if (!actions.includes(action)) {
81
+ throw new CliError(`${definition.name} --action "${action}" is outside the published vocabulary: ${actions.join(" | ")}`);
82
+ }
83
+ args.action = action;
84
+ }
85
+ const missing = definition.contract.required.filter((name) => args[name] === undefined || args[name] === "");
86
+ if (missing.length > 0) {
87
+ const how = missing.map((m) => {
88
+ const vocabulary = definition.contract.enums?.[m];
89
+ if (m === "action" && vocabulary)
90
+ return `--action <${vocabulary.join("|")}>`;
91
+ if (vocabulary)
92
+ return `--arg ${m}=<${vocabulary.join("|")}>`;
93
+ return `--arg ${m}=<value>`;
94
+ });
95
+ throw new CliError(`${definition.name} requires ${missing.join(", ")}. Pass ${how.join(" ")} or --input '<json>'. Nothing was sent.`);
96
+ }
97
+ return args;
98
+ }
99
+ /**
100
+ * Invoke one of the published meta-tools through a throwaway session, the
101
+ * same wire `session.execute(name, args)` uses. The router picks the rail,
102
+ * so there is no `--server`.
103
+ */
104
+ export async function metaToolCommand(name, opts) {
105
+ const definition = requireDefinition(name);
106
+ const base = await resolveOptionalInput(opts, definition.name);
107
+ const args = buildArgs(definition, base, opts.arg, opts.action);
108
+ const cs = new CodeSpar({
109
+ apiKey: opts.apiKey,
110
+ baseUrl: opts.baseUrl,
111
+ projectId: opts.project,
112
+ });
113
+ const session = await cs.create(opts.user ?? "cli-user", { servers: [] });
114
+ try {
115
+ const result = await session.execute(definition.name, args);
116
+ if (!result.success) {
117
+ throw new CliError(`${definition.name} failed: ${result.error ?? "unknown error"}`);
118
+ }
119
+ if (opts.json) {
120
+ json(result.data ?? null);
121
+ return;
122
+ }
123
+ info(`${definition.name}${args.action ? ` action=${String(args.action)}` : ""}`);
124
+ renderResult(result.data);
125
+ }
126
+ finally {
127
+ await session.close();
128
+ }
129
+ }
130
+ /** `codespar tools meta` — the published definitions, as published. */
131
+ export function listMetaToolsCommand(opts) {
132
+ if (opts.json) {
133
+ json(META_TOOLS);
134
+ return;
135
+ }
136
+ table(["TOOL", "ACTIONS", "REQUIRED"], metaToolNames().map((name) => {
137
+ const definition = META_TOOLS[name];
138
+ const actions = metaToolActions(name);
139
+ return [
140
+ name,
141
+ actions.length > 0 ? actions.join(" | ") : "-",
142
+ definition.contract.required.join(", ") || "-",
143
+ ];
144
+ }));
145
+ }
146
+ /** `codespar tools meta <name>` — one definition, schema and vocabularies. */
147
+ export function showMetaToolCommand(name, opts) {
148
+ const definition = requireDefinition(name);
149
+ if (opts.json) {
150
+ json(definition);
151
+ return;
152
+ }
153
+ kv([
154
+ ["Name", definition.name],
155
+ ["Required", definition.contract.required.join(", ") || "-"],
156
+ ["Properties", definition.contract.properties.join(", ")],
157
+ ]);
158
+ process.stdout.write(`\n${definition.description}\n`);
159
+ const enums = definition.contract.enums ?? {};
160
+ if (Object.keys(enums).length > 0) {
161
+ process.stdout.write(`\n${c.bold("Vocabularies")}\n`);
162
+ kv(Object.entries(enums).map(([key, values]) => [key, values.join(" | ")]));
163
+ }
164
+ process.stdout.write("\nInput schema:\n");
165
+ process.stdout.write(JSON.stringify(definition.input_schema, null, 2) + "\n");
166
+ }
167
+ //# sourceMappingURL=meta-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta-tool.js","sourceRoot":"","sources":["../../src/commands/meta-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAc/F;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,UAAU,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC5C,IAAI,UAAU;QAAE,OAAO,UAAU,CAAC;IAClC,MAAM,IAAI,QAAQ,CAChB,sBAAsB,IAAI,0BAA0B,aAAa,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CACnF,CAAC;A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,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC;QACzB,CAAC,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;QAC5D,CAAC,YAAY,EAAE,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAC1D,CAAC,CAAC;IACH,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC,WAAW,IAAI,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC;IAC9C,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QACtD,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAC1C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AAChF,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { CodeSpar } from "@codespar/sdk";
2
+ import { CliError } from "../config.js";
3
+ import { info, json, renderResult } from "../output.js";
4
+ import { resolveOptionalInput } from "./meta-input.js";
5
+ /** `--query k=v` (repeatable) → `{ k: v }`, repeats collect into an array. */
6
+ export function parseQuery(pairs) {
7
+ const out = {};
8
+ for (const pair of pairs) {
9
+ const eq = pair.indexOf("=");
10
+ if (eq <= 0) {
11
+ throw new CliError(`--query expects key=value, got "${pair}".`);
12
+ }
13
+ const key = pair.slice(0, eq);
14
+ const value = pair.slice(eq + 1);
15
+ const existing = out[key];
16
+ if (existing === undefined)
17
+ out[key] = value;
18
+ else if (Array.isArray(existing))
19
+ existing.push(value);
20
+ else
21
+ out[key] = [existing, value];
22
+ }
23
+ return out;
24
+ }
25
+ /** Positional arguments → the path parameter object the client expands. */
26
+ export function bindPathParams(command, args) {
27
+ if (args.length !== command.params.length) {
28
+ throw new CliError(`${command.path} takes ${command.params.length} argument(s) (${command.params.join(", ")}), got ${args.length}.`);
29
+ }
30
+ const out = {};
31
+ command.params.forEach((name, i) => {
32
+ const value = args[i] ?? "";
33
+ if (value === "")
34
+ throw new CliError(`Path parameter <${name}> must not be empty.`);
35
+ out[name] = value;
36
+ });
37
+ return out;
38
+ }
39
+ /**
40
+ * Run one derived resource command: bind the positionals to the path
41
+ * parameters, pass `--query` through, pass `--input` as the request body
42
+ * when the operation declares one, and print whatever came back. No
43
+ * response is synthesised: what prints is the API's own payload, and a
44
+ * non-2xx status surfaces as the API's error.
45
+ */
46
+ export async function runResourceCommand(command, opts) {
47
+ const body = await resolveOptionalInput(opts, `${command.method.toUpperCase()} ${command.path}`);
48
+ if (body !== undefined && !command.acceptsBody) {
49
+ throw new CliError(`${command.method.toUpperCase()} ${command.path} declares no request body; drop --input / --input-file.`);
50
+ }
51
+ const timeout = opts.timeout === undefined ? undefined : Number(opts.timeout);
52
+ if (timeout !== undefined && (!Number.isFinite(timeout) || timeout <= 0)) {
53
+ throw new CliError(`--timeout expects a positive number of milliseconds, got "${opts.timeout}".`);
54
+ }
55
+ const cs = new CodeSpar({
56
+ apiKey: opts.apiKey,
57
+ baseUrl: opts.baseUrl,
58
+ projectId: opts.project,
59
+ ...(timeout !== undefined ? { timeout } : {}),
60
+ });
61
+ const api = cs.api;
62
+ const result = await api.request(command.method, command.path, {
63
+ path: bindPathParams(command, opts.args),
64
+ query: parseQuery(opts.query),
65
+ ...(body !== undefined ? { body } : {}),
66
+ });
67
+ if (opts.json) {
68
+ json(result ?? null);
69
+ return;
70
+ }
71
+ info(`${command.method.toUpperCase()} ${command.path}`);
72
+ renderResult(result);
73
+ }
74
+ //# sourceMappingURL=resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.js","sourceRoot":"","sources":["../../src/commands/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAsCvD,8EAA8E;AAC9E,MAAM,UAAU,UAAU,CAAC,KAAwB;IACjD,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;YACZ,MAAM,IAAI,QAAQ,CAAC,mCAAmC,IAAI,IAAI,CAAC,CAAC;QAClE,CAAC;QACD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACjC,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,QAAQ,KAAK,SAAS;YAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;aACxC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;YAAE,QAAQ,CAAC,I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OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACxD,YAAY,CAAC,MAAM,CAAC,CAAC;AACvB,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from "commander";
3
+ import { CodesparApiError, TimeoutError } from "@codespar/sdk";
3
4
  import { ApiClient } from "./api.js";
4
5
  import { CliError, loadConfig, requireApiKey } from "./config.js";
5
6
  import { loginCommand, whoamiCommand } from "./commands/login.js";
@@ -23,6 +24,9 @@ import { verificationStatusCommand } from "./commands/verification-status.js";
23
24
  import { wizardCommand } from "./commands/wizard.js";
24
25
  import { ledgerCommand } from "./commands/ledger.js";
25
26
  import { issueCommand } from "./commands/issue.js";
27
+ import { listMetaToolsCommand, metaToolCommand, showMetaToolCommand, } from "./commands/meta-tool.js";
28
+ import { runResourceCommand } from "./commands/resource.js";
29
+ import { derivedSurface, metaToolNames } from "./surface.js";
26
30
  import { c } from "./output.js";
27
31
  import { printBanner } from "./banner.js";
28
32
  import { VERSION } from "./version.js";
@@ -121,6 +125,84 @@ tools
121
125
  const client = await authedClient();
122
126
  await showToolCommand(client, name, { json: rootJsonFlag() });
123
127
  });
128
+ tools
129
+ .command("meta [name]")
130
+ .description(`Show the ${metaToolNames().length} published meta-tool definitions (name, actions, required input)`)
131
+ .action((name) => {
132
+ if (name)
133
+ showMetaToolCommand(name, { json: rootJsonFlag() });
134
+ else
135
+ listMetaToolsCommand({ json: rootJsonFlag() });
136
+ });
137
+ // ============ meta-tools ============
138
+ // One command over every published definition. The names, the actions and
139
+ // the required input come from `@codespar/types` via the SDK re-export, so
140
+ // a tool added there is invocable here with no code change.
141
+ program
142
+ .command("tool <name>")
143
+ .description(`Invoke a published meta-tool by name (${metaToolNames().length} of them — see \`codespar tools meta\`)`)
144
+ .option("--action <action>", "Action to run, validated against the tool's published vocabulary")
145
+ .option("--arg <key=value>", "Single input property (repeatable); typed by the published schema", collect, [])
146
+ .option("-i, --input <json>", "Full input as a JSON string")
147
+ .option("-f, --input-file <path>", "Full input from a JSON file")
148
+ .option("-u, --user <id>", "User id for the session (default: cli-user)")
149
+ .action(async (name, opts) => {
150
+ const auth = await resolveAuth();
151
+ await metaToolCommand(name, { ...opts, ...auth, json: rootJsonFlag() });
152
+ });
153
+ // `pay` and `kyc` are the two money methods core#125 names by hand; both
154
+ // are the same runner over the same published definition, given a shorter
155
+ // spelling because they are the ones people reach for.
156
+ for (const [alias, tool] of [
157
+ ["pay", "codespar_pay"],
158
+ ["kyc", "codespar_kyc"],
159
+ ]) {
160
+ program
161
+ .command(alias)
162
+ .description(`Invoke ${tool} (alias of \`codespar tool ${tool}\`)`)
163
+ .option("--action <action>", "Action to run, validated against the tool's published vocabulary")
164
+ .option("--arg <key=value>", "Single input property (repeatable); typed by the published schema", collect, [])
165
+ .option("-i, --input <json>", "Full input as a JSON string")
166
+ .option("-f, --input-file <path>", "Full input from a JSON file")
167
+ .option("-u, --user <id>", "User id for the session (default: cli-user)")
168
+ .action(async (opts) => {
169
+ const auth = await resolveAuth();
170
+ await metaToolCommand(tool, { ...opts, ...auth, json: rootJsonFlag() });
171
+ });
172
+ }
173
+ // ============ resource groups (derived from the served OpenAPI document) ============
174
+ // No per-route code: each subcommand below is one row of the SDK's
175
+ // generated operation table, with its path parameters as positionals.
176
+ for (const { spec, commands } of derivedSurface()) {
177
+ const group = program.command(spec.name).description(spec.description);
178
+ for (const command of commands) {
179
+ const sub = group
180
+ .command(command.name)
181
+ .description(`${command.method.toUpperCase()} ${command.path}`)
182
+ .option("-q, --query <key=value>", "Query parameter (repeatable)", collect, [])
183
+ .option("--timeout <ms>", "Per-request timeout in milliseconds");
184
+ for (const param of command.params)
185
+ sub.argument(`<${param}>`);
186
+ if (command.acceptsBody) {
187
+ sub
188
+ .option("-i, --input <json>", "Request body as a JSON string")
189
+ .option("-f, --input-file <path>", "Request body from a JSON file");
190
+ }
191
+ sub.action(async (...actionArgs) => {
192
+ const opts = actionArgs[command.params.length];
193
+ const auth = await resolveAuth();
194
+ await runResourceCommand(command, {
195
+ ...auth,
196
+ args: actionArgs.slice(0, command.params.length).map(String),
197
+ query: opts.query,
198
+ input: opts.input,
199
+ inputFile: opts.inputFile,
200
+ timeout: opts.timeout,
201
+ json: rootJsonFlag(),
202
+ });
203
+ });
204
+ }
205
+ }
124
206
  // ============ execute ============
125
207
  program
126
208
  .command("execute <tool>")
@@ -425,6 +507,20 @@ async function main() {
425
507
  process.stderr.write(`${c.red("✗")} ${err.message}\n`);
426
508
  process.exit(1);
427
509
  }
510
+ // The generated REST client answers with its own error types. Print the
511
+ // API's message and body verbatim — an exit code plus a stack trace
512
+ // would hide the one thing the caller needs, which is what the API said.
513
+ if (err instanceof CodesparApiError) {
514
+ process.stderr.write(`${c.red("✗")} ${err.message}\n`);
515
+ if (err.body !== undefined) {
516
+ process.stderr.write(JSON.stringify(err.body, null, 2) + "\n");
517
+ }
518
+ process.exit(1);
519
+ }
520
+ if (err instanceof TimeoutError) {
521
+ process.stderr.write(`${c.red("✗")} ${err.message}\n`);
522
+ process.exit(1);
523
+ }
428
524
  // Unexpected error — show stack so we can debug.
429
525
  process.stderr.write(`${c.red("✗ internal error:")}\n`);
430
526
  process.stderr.write(String(err.stack ?? err) + "\n");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,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,CAAC;QACD,iDAAiD;QACjD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACxD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAE,GAAa,CAAC,KAAK,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;QACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
package/dist/output.js CHANGED
@@ -51,4 +51,86 @@ export function success(msg) {
51
51
  export function warn(msg) {
52
52
  process.stderr.write(`${c.yellow("⚠")} ${msg}\n`);
53
53
  }
54
+ /** Scalars a generic table can print in a cell. */
55
+ function isScalar(v) {
56
+ return v === null || ["string", "number", "boolean"].includes(typeof v);
57
+ }
58
+ function cell(v) {
59
+ if (v === null || v === undefined)
60
+ return "-";
61
+ const s = typeof v === "string" ? v : JSON.stringify(v);
62
+ return s.length <= 40 ? s : s.slice(0, 39) + "…";
63
+ }
64
+ /** The array inside a single-collection envelope (`{ data: [...] }`), if any. */
65
+ function collectionOf(value) {
66
+ const arrays = Object.entries(value).filter(([, v]) => Array.isArray(v));
67
+ if (arrays.length !== 1)
68
+ return undefined;
69
+ const [key, list] = arrays[0];
70
+ return [key, list];
71
+ }
72
+ const MAX_COLUMNS = 6;
73
+ /**
74
+ * Print an API payload without knowing its shape. A list — bare or inside
75
+ * a single-array envelope — becomes a table over the scalar fields its
76
+ * items share; anything else prints as JSON. Deliberately dumb: a
77
+ * generic renderer that guesses at semantics would show a number under
78
+ * the wrong heading, and the payload is the product here.
79
+ */
80
+ export function renderResult(value) {
81
+ if (value === undefined || value === null) {
82
+ process.stderr.write(c.dim("(no content)\n"));
83
+ return;
84
+ }
85
+ if (typeof value === "string") {
86
+ process.stdout.write(value.endsWith("\n") ? value : value + "\n");
87
+ return;
88
+ }
89
+ if (Array.isArray(value)) {
90
+ renderList(value);
91
+ return;
92
+ }
93
+ if (typeof value === "object") {
94
+ const record = value;
95
+ const collection = collectionOf(record);
96
+ if (collection && collection[1].length > 0) {
97
+ const [key, list] = collection;
98
+ const rest = Object.fromEntries(Object.entries(record).filter(([k]) => k !== key));
99
+ renderList(list);
100
+ if (Object.keys(rest).length > 0) {
101
+ process.stdout.write("\n");
102
+ json(rest);
103
+ }
104
+ return;
105
+ }
106
+ }
107
+ json(value);
108
+ }
109
+ function renderList(list) {
110
+ if (list.length === 0) {
111
+ process.stderr.write(c.dim("(no results)\n"));
112
+ return;
113
+ }
114
+ if (!list.every((item) => item !== null && typeof item === "object" && !Array.isArray(item))) {
115
+ json(list);
116
+ return;
117
+ }
118
+ const rows = list;
119
+ const columns = [];
120
+ for (const row of rows) {
121
+ for (const [k, v] of Object.entries(row)) {
122
+ if (isScalar(v) && !columns.includes(k))
123
+ columns.push(k);
124
+ }
125
+ }
126
+ if (columns.length === 0) {
127
+ json(list);
128
+ return;
129
+ }
130
+ const shown = columns.slice(0, MAX_COLUMNS);
131
+ table(shown, rows.map((row) => shown.map((k) => cell(row[k]))));
132
+ if (columns.length > shown.length) {
133
+ process.stderr.write(c.dim(`(${columns.length - shown.length} more field(s) per row — use --json)\n`));
134
+ }
135
+ }
54
136
  //# sourceMappingURL=output.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,SAAS,GACb,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS;IAClC,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,GAAG;IAC/B,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAElE,SAAS,IAAI,CAAC,IAAY,EAAE,KAAa;IACvC,OAAO,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,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;IACT,CAAC;IACD,MAAM,IAAI,GAAG,IAA8C,CAAC;IAC5D,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YACzC,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,CAAC;QACX,OAAO;IACT,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;IAC5C,KAAK,CACH,KAAK,EACL,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAClD,CAAC;IACF,IAAI,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,CAAC,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,wCAAwC,CAAC,CACjF,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,473 @@
1
+ /**
2
+ * The CLI's command surface, derived from the published API surface.
3
+ *
4
+ * Two sources, both published, neither retyped here:
5
+ *
6
+ * `API_OPERATIONS` (@codespar/sdk) — every REST operation of
7
+ * the served OpenAPI document
8
+ * `SHARED_META_TOOL_DEFINITIONS` (@codespar/types,
9
+ * re-exported by @codespar/sdk) — the 15 agent-facing meta-tools
10
+ *
11
+ * A resource command group is a path prefix plus a name; the subcommands
12
+ * under it are computed from the operation rows that live under that
13
+ * prefix. There is no per-route code: adding a group is one row in
14
+ * `PUBLISHED_GROUPS`, and a route added to the served document appears as
15
+ * a subcommand the next time the SDK snapshot is refreshed.
16
+ *
17
+ * `auditSurface()` is the checker behind the coverage gate
18
+ * (`__tests__/surface-coverage.test.ts`): it takes the surface as an
19
+ * argument instead of reading the module's own constants, so the gate can
20
+ * run it against synthetic inputs and prove it fails when it should.
21
+ */
22
+ import { API_OPERATIONS, SHARED_META_TOOL_DEFINITIONS } from "@codespar/sdk";
23
+ /** Every operation of the served document, as plain rows. */
24
+ export const OPERATIONS = API_OPERATIONS.map((row) => ({
25
+ method: row.method,
26
+ path: row.path,
27
+ body: row.body,
28
+ }));
29
+ /* ── Census ───────────────────────────────────────────────────────── */
30
+ /**
31
+ * The resource group an operation belongs to, for census purposes: the
32
+ * first path segment after the version prefix (`/v1/wallets/{id}/ledger`
33
+ * → `wallets`), or `(non-v1) <segment>` for the handful of unversioned
34
+ * routes. Coarse on purpose — the census asks "does this family of
35
+ * routes have any CLI at all", not "is every route wired".
36
+ */
37
+ export function censusGroup(path) {
38
+ const segments = path.split("/").filter(Boolean);
39
+ if (segments[0] !== "v1")
40
+ return `(non-v1) ${segments[0] ?? ""}`;
41
+ return segments[1] ?? "";
42
+ }
43
+ /** Every census group of the served document, with its operations. */
44
+ export function census(operations = OPERATIONS) {
45
+ const groups = new Map();
46
+ for (const op of operations) {
47
+ const key = censusGroup(op.path);
48
+ const bucket = groups.get(key);
49
+ if (bucket)
50
+ bucket.push(op);
51
+ else
52
+ groups.set(key, [op]);
53
+ }
54
+ return groups;
55
+ }
56
+ /**
57
+ * The resource groups this CLI publishes. Each row is a prefix; an
58
+ * operation belongs to the LONGEST prefix that matches it, so
59
+ * `/v1/consumers/{}/dda/...` lands in `boletos` and every other
60
+ * `/v1/consumers/...` route lands in `consumers`.
61
+ *
62
+ * Onda 4 of the API matrix (v2.1.1) names admin, sellers, mcp-servers,
63
+ * consumers and boletos; core#125 adds the money methods (wallets,
64
+ * triggers, and the meta-tools below). `admin` is absent on purpose: the
65
+ * served document declares no `/v1/admin/*` operation, so there is
66
+ * nothing to derive a command from (see SURFACE_EXCEPTIONS).
67
+ */
68
+ export const PUBLISHED_GROUPS = [
69
+ {
70
+ name: "consumers",
71
+ prefix: "/v1/consumers",
72
+ description: "Consumers: profile, Pix keys, Pix lookups, receipts, contact verification",
73
+ },
74
+ {
75
+ name: "boletos",
76
+ prefix: "/v1/consumers/{}/dda",
77
+ description: "DDA boletos: subscribe a document, list the boletos it receives",
78
+ },
79
+ {
80
+ name: "sellers",
81
+ prefix: "/v1/sellers",
82
+ description: "Sellers: onboarding status, custody, pending settlement, ledger",
83
+ },
84
+ {
85
+ name: "mcp-servers",
86
+ prefix: "/v1/mcp-servers",
87
+ description: "Tenant MCP servers: register, validate, list, patch a tool, sweep platform fees",
88
+ },
89
+ {
90
+ name: "wallets",
91
+ prefix: "/v1/wallets",
92
+ description: "Wallets: balances, ledger, funding sources, execute, transfer, custody",
93
+ },
94
+ {
95
+ name: "triggers",
96
+ prefix: "/v1/triggers",
97
+ description: "Triggers (webhooks): endpoints, deliveries, DLQ, secret rotation, redelivery",
98
+ },
99
+ // Both families below arrived in the served document when packages/core
100
+ // refreshed openapi-snapshot.json to 221 operations (core#143). They are
101
+ // published, not excepted: the coverage gate reserves an exception for a
102
+ // family with no terminal use, and both of these end at a person.
103
+ {
104
+ name: "consents",
105
+ prefix: "/v1/consents",
106
+ description: "Consent tokens: mint the token whose URL the consumer opens to authorise an agent",
107
+ },
108
+ {
109
+ name: "consumer-payments",
110
+ prefix: "/v1/consumer-payments",
111
+ description: "Consumer payments: execute a payment on a consumer's behalf, with the audit chain (execute-stream returns SSE)",
112
+ },
113
+ ];
114
+ /** `{anything}` → `{}`, so a prefix matches whatever the params are called. */
115
+ function normalise(path) {
116
+ return path.replace(/\{[^}]*\}/g, "{}");
117
+ }
118
+ function isParam(segment) {
119
+ return segment.startsWith("{") && segment.endsWith("}");
120
+ }
121
+ /** Segment-wise prefix test: `/v1/consumers/{}/dda` matches `/v1/consumers/{cid}/dda/boletos`. */
122
+ function underPrefix(path, prefix) {
123
+ const p = normalise(path).split("/");
124
+ const q = prefix.split("/");
125
+ if (p.length < q.length)
126
+ return false;
127
+ return q.every((segment, i) => segment === p[i]);
128
+ }
129
+ /** The group spec that claims an operation: the longest matching prefix. */
130
+ export function claimingGroup(path, groups = PUBLISHED_GROUPS) {
131
+ let best;
132
+ for (const spec of groups) {
133
+ if (!underPrefix(path, spec.prefix))
134
+ continue;
135
+ if (!best || spec.prefix.length > best.prefix.length)
136
+ best = spec;
137
+ }
138
+ return best;
139
+ }
140
+ const COLLECTION_VERB = {
141
+ get: "list",
142
+ post: "create",
143
+ put: "set",
144
+ patch: "update",
145
+ delete: "delete",
146
+ };
147
+ /**
148
+ * Derive the subcommands of one group.
149
+ *
150
+ * The name of a subcommand is a pure function of the operation set, not
151
+ * of the order rows appear in: the literal segments below the group's
152
+ * prefix form a suffix, and the suffix is used bare when it identifies
153
+ * exactly one operation in the group, or prefixed with the method's verb
154
+ * when two or more operations share it (`triggers list-deliveries` vs
155
+ * `triggers get-deliveries`). A route with no literal suffix is named
156
+ * after its verb alone (`list`, `get`, `create`, `update`, `delete`), and
157
+ * a suffix that merely repeats the group name collapses to the verb too
158
+ * (`GET /v1/consumers/{}/dda/boletos` is `boletos list`, not
159
+ * `boletos boletos`).
160
+ *
161
+ * The names are pinned in `__tests__/resource-commands.test.ts`, so a
162
+ * spec change that renames an existing command is a red test, not a
163
+ * silent break in someone's script.
164
+ */
165
+ export function deriveGroup(spec, operations = OPERATIONS, groups = PUBLISHED_GROUPS) {
166
+ const rows = operations.filter((op) => claimingGroup(op.path, groups)?.name === spec.name);
167
+ const depth = spec.prefix.split("/").length;
168
+ const parsed = rows.map((op) => {
169
+ const all = op.path.split("/").filter(Boolean);
170
+ const segments = op.path.split("/").slice(depth);
171
+ const literals = segments.filter((s) => !isParam(s));
172
+ // Positionals come from the WHOLE path, not just the part below the
173
+ // prefix: `boletos` hangs off `/v1/consumers/{consumerId}/dda`, and
174
+ // dropping the parameter the prefix passes over would build a command
175
+ // that cannot address a consumer at all.
176
+ const params = all.filter(isParam).map((s) => s.slice(1, -1));
177
+ const endsWithParam = segments.length > 0 && isParam(segments[segments.length - 1]);
178
+ const suffix = literals.join("-");
179
+ const verb = op.method === "get" ? (endsWithParam ? "get" : "list") : COLLECTION_VERB[op.method];
180
+ return { op, suffix, verb, params };
181
+ });
182
+ const suffixCount = new Map();
183
+ for (const p of parsed)
184
+ suffixCount.set(p.suffix, (suffixCount.get(p.suffix) ?? 0) + 1);
185
+ const commands = parsed.map(({ op, suffix, verb, params }) => {
186
+ const bare = suffix === "" || suffix === spec.name;
187
+ const name = bare ? verb : suffixCount.get(suffix) === 1 ? suffix : `${verb}-${suffix}`;
188
+ return {
189
+ name,
190
+ method: op.method,
191
+ path: op.path,
192
+ params,
193
+ acceptsBody: op.body !== null,
194
+ };
195
+ });
196
+ return { spec, commands };
197
+ }
198
+ /** Every published group, derived. */
199
+ export function derivedSurface(groups = PUBLISHED_GROUPS, operations = OPERATIONS) {
200
+ return groups.map((spec) => deriveGroup(spec, operations, groups));
201
+ }
202
+ /* ── Meta-tools ───────────────────────────────────────────────────── */
203
+ /**
204
+ * The 15 agent-facing meta-tools, read from the published definitions.
205
+ * Never a list written here: `@codespar/types` publishes the names, the
206
+ * input schemas and the closed vocabularies (ent#933), and the CLI shows
207
+ * exactly those.
208
+ */
209
+ export const META_TOOLS = SHARED_META_TOOL_DEFINITIONS;
210
+ export function metaToolNames() {
211
+ return Object.keys(META_TOOLS);
212
+ }
213
+ export function metaToolDefinition(name) {
214
+ return Object.prototype.hasOwnProperty.call(META_TOOLS, name) ? META_TOOLS[name] : undefined;
215
+ }
216
+ /**
217
+ * The closed vocabulary of a meta-tool's `action` property, or an empty
218
+ * array when the tool has no `action` (codespar_kyc discriminates on
219
+ * `check_type`, codespar_discover on `use_case`).
220
+ */
221
+ export function metaToolActions(name) {
222
+ return metaToolDefinition(name)?.contract.enums?.action ?? [];
223
+ }
224
+ /**
225
+ * Census groups with no derived command group, each with a reason and a
226
+ * date. This list is a ratchet: it may shrink, never grow. Adding an
227
+ * entry to get the gate green is the wrong move — the machinery makes a
228
+ * group one row in `PUBLISHED_GROUPS`.
229
+ *
230
+ * Only census groups belong here. The admin/account family the API
231
+ * matrix names has no entry because it has no served route to except:
232
+ * `surface-coverage.test.ts` asserts the document still declares no
233
+ * `/v1/admin/*` operation, and goes red the day it does.
234
+ */
235
+ export const SURFACE_EXCEPTIONS = {
236
+ "(non-v1) .well-known": {
237
+ reason: "OAuth protected-resource and authorization-server discovery documents. Read by MCP clients during handshake, never by a person at a terminal.",
238
+ since: "2026-09-10",
239
+ },
240
+ "(non-v1) oauth": {
241
+ reason: "OAuth register/authorize/token. A browser redirect flow; `codespar login` and `codespar connect start` are the terminal-side entrances.",
242
+ since: "2026-09-10",
243
+ },
244
+ "(non-v1) openapi.json": {
245
+ reason: "The served spec document itself. `npm run spec:refresh` in packages/core is the maintained way to pull it, and it regenerates the client at the same time.",
246
+ since: "2026-09-10",
247
+ },
248
+ "openapi.json": {
249
+ reason: "Versioned alias of the served spec document. Same reason as the unversioned one: spec:refresh, not a CLI command.",
250
+ since: "2026-09-10",
251
+ },
252
+ servers: {
253
+ reason: "Covered by the pre-existing `codespar servers list|show` commands (hand-written paths).",
254
+ since: "2026-09-10",
255
+ },
256
+ sessions: {
257
+ reason: "Covered by the pre-existing `codespar sessions list|show|close` and `codespar execute` commands (hand-written paths).",
258
+ since: "2026-09-10",
259
+ },
260
+ connections: {
261
+ reason: "Covered by the pre-existing `codespar connect list|start|revoke` commands.",
262
+ since: "2026-09-10",
263
+ },
264
+ connect: {
265
+ reason: "POST /v1/connect/start is what `codespar connect start` calls.",
266
+ since: "2026-09-10",
267
+ },
268
+ whoami: {
269
+ reason: "Covered by the pre-existing `codespar whoami` command.",
270
+ since: "2026-09-10",
271
+ },
272
+ "tool-calls": {
273
+ reason: "Covered by the pre-existing `codespar payment-status` and `codespar verification-status` commands, including their SSE streams.",
274
+ since: "2026-09-10",
275
+ },
276
+ "meta-tools": {
277
+ reason: "POST /v1/meta-tools/discover is what `codespar discover` calls.",
278
+ since: "2026-09-10",
279
+ },
280
+ "webhook-endpoints": {
281
+ reason: "The same ten operations as `triggers`, under the older path family. The CLI publishes the canonical `triggers` name only; wiring both would double the surface for one backend.",
282
+ since: "2026-09-10",
283
+ },
284
+ mandates: {
285
+ reason: "Org-scoped mandate lifecycle (pause/resume/revoke). `codespar mandate create|verify` covers issuance and offline verification; the lifecycle verbs are wave-5 work in the matrix.",
286
+ since: "2026-09-10",
287
+ },
288
+ orgs: {
289
+ reason: "Org administration (agents, keys, audit config, approvals, data-subject anonymisation). Not in onda 4 of the matrix.",
290
+ since: "2026-09-10",
291
+ },
292
+ organizations: {
293
+ reason: "Single org read. Not in onda 4 of the matrix.",
294
+ since: "2026-09-10",
295
+ },
296
+ projects: {
297
+ reason: "Project CRUD and settings history. Dashboard surface; not in onda 4 of the matrix.",
298
+ since: "2026-09-10",
299
+ },
300
+ policies: {
301
+ reason: "Policy CRUD and reorder. Not in onda 4 of the matrix.",
302
+ since: "2026-09-10",
303
+ },
304
+ "policy-evaluations": {
305
+ reason: "Policy evaluation log. Not in onda 4 of the matrix.",
306
+ since: "2026-09-10",
307
+ },
308
+ evaluations: {
309
+ reason: "Evaluation log alias. Not in onda 4 of the matrix.",
310
+ since: "2026-09-10",
311
+ },
312
+ "audit-events": {
313
+ reason: "Audit event stream, incidents and config. Not in onda 4 of the matrix.",
314
+ since: "2026-09-10",
315
+ },
316
+ audit: {
317
+ reason: "Audit event alias. Not in onda 4 of the matrix.",
318
+ since: "2026-09-10",
319
+ },
320
+ approvals: {
321
+ reason: "Approval reads used by the caller-side poll in approval-status.ts, not by an operator at a terminal.",
322
+ since: "2026-09-10",
323
+ },
324
+ "commerce-memory": {
325
+ reason: "Counterparties, interactions, preferences, negotiations and insights. Not in onda 4 of the matrix.",
326
+ since: "2026-09-10",
327
+ },
328
+ counterparties: {
329
+ reason: "Counterparty reads outside commerce-memory. Not in onda 4 of the matrix.",
330
+ since: "2026-09-10",
331
+ },
332
+ "payment-links": {
333
+ reason: "Payment link CRUD. Dashboard surface; not in onda 4 of the matrix.",
334
+ since: "2026-09-10",
335
+ },
336
+ paywalls: {
337
+ reason: "Paywall reads and stats. Dashboard surface; not in onda 4 of the matrix.",
338
+ since: "2026-09-10",
339
+ },
340
+ providers: {
341
+ reason: "Provider catalog and auth schemas. `codespar servers` and `codespar wizard` are the terminal entrances.",
342
+ since: "2026-09-10",
343
+ },
344
+ agents: {
345
+ reason: "Agent registration and key rotation. Security-sensitive; wants its own design pass, not a derived command.",
346
+ since: "2026-09-10",
347
+ },
348
+ ofb: {
349
+ reason: "Open Finance Brasil consent lifecycle. Browser redirect flow; not in onda 4 of the matrix.",
350
+ since: "2026-09-10",
351
+ },
352
+ "bank-consents": {
353
+ reason: "Single bank-consent read, alias of the ofb family. Not in onda 4 of the matrix.",
354
+ since: "2026-09-10",
355
+ },
356
+ "consent-records": {
357
+ reason: "Single consent-record read. Not in onda 4 of the matrix.",
358
+ since: "2026-09-10",
359
+ },
360
+ "account-applications": {
361
+ reason: "Single account-application read. Belongs with the admin/account family that has no served routes yet.",
362
+ since: "2026-09-10",
363
+ },
364
+ kyc: {
365
+ reason: "GET /v1/kyc/onboard/{proposalId}/status. Reachable as `codespar tool codespar_kyc --action status`.",
366
+ since: "2026-09-10",
367
+ },
368
+ cards: {
369
+ reason: "Single card read. Reachable as `codespar tool codespar_issue --action card-get`.",
370
+ since: "2026-09-10",
371
+ },
372
+ issuer: {
373
+ reason: "Issuer-side card read, alias of the cards family. Same meta-tool covers it.",
374
+ since: "2026-09-10",
375
+ },
376
+ "funding-sources": {
377
+ reason: "Single funding-source read. The wallet-scoped ones are wired under `codespar wallets`.",
378
+ since: "2026-09-10",
379
+ },
380
+ facilitator: {
381
+ reason: "x402 facilitator executions. Machine-to-machine surface driven by the x402 rail, not by an operator.",
382
+ since: "2026-09-10",
383
+ },
384
+ cart: {
385
+ reason: "Mercado Livre / iFood cart connect starts. Browser redirect flow; `codespar connect start` is the terminal entrance.",
386
+ since: "2026-09-10",
387
+ },
388
+ fees: {
389
+ reason: "Fee schedule reads. Pricing surface; not in onda 4 of the matrix.",
390
+ since: "2026-09-10",
391
+ },
392
+ events: {
393
+ reason: "Event replay. Operational recovery tool; wants an explicit confirmation design, not a derived command.",
394
+ since: "2026-09-10",
395
+ },
396
+ generate: {
397
+ reason: "Server-generation helper used by the dashboard scaffolder. `codespar init` is the terminal scaffolder.",
398
+ since: "2026-09-10",
399
+ },
400
+ discovery: {
401
+ reason: "Discovery manifest, read by agent clients during handshake.",
402
+ since: "2026-09-10",
403
+ },
404
+ health: {
405
+ reason: "Liveness probe. `curl` is the right tool and needs no API key.",
406
+ since: "2026-09-10",
407
+ },
408
+ };
409
+ /** How many exceptions the gate expects. Lower it when one goes away. */
410
+ export const EXCEPTION_PIN = 43;
411
+ const ISO_DATE = /^\d{4}-\d{2}-\d{2}$/;
412
+ const MIN_REASON = 20;
413
+ /**
414
+ * The check itself, as a pure function of the surface handed to it. The
415
+ * gate runs it twice on synthetic inputs — once on a surface that is
416
+ * covered, once on a surface that is not — so a checker that cannot fail
417
+ * is caught by its own controls.
418
+ */
419
+ export function auditSurface(input) {
420
+ const violations = [];
421
+ const covered = new Set(input.coveredGroups);
422
+ const census = new Set(input.censusGroups);
423
+ for (const group of input.censusGroups) {
424
+ if (covered.has(group))
425
+ continue;
426
+ const exception = input.exceptions[group];
427
+ if (!exception) {
428
+ violations.push({
429
+ kind: "uncovered-group",
430
+ subject: group,
431
+ detail: `resource group "${group}" has no command and no written exception`,
432
+ });
433
+ continue;
434
+ }
435
+ if (!exception.reason || exception.reason.trim().length < MIN_REASON) {
436
+ violations.push({
437
+ kind: "empty-reason",
438
+ subject: group,
439
+ detail: `exception for "${group}" has no usable reason (needs at least ${MIN_REASON} characters saying why)`,
440
+ });
441
+ }
442
+ if (!ISO_DATE.test(exception.since ?? "")) {
443
+ violations.push({
444
+ kind: "bad-date",
445
+ subject: group,
446
+ detail: `exception for "${group}" has no ISO date (YYYY-MM-DD) saying when it was written`,
447
+ });
448
+ }
449
+ }
450
+ for (const group of Object.keys(input.exceptions)) {
451
+ if (census.has(group) && !covered.has(group))
452
+ continue;
453
+ violations.push({
454
+ kind: "stale-exception",
455
+ subject: group,
456
+ detail: covered.has(group)
457
+ ? `"${group}" has a command AND an exception — delete the exception`
458
+ : `"${group}" is not a resource group of the served document — delete the exception`,
459
+ });
460
+ }
461
+ const invocable = new Set(input.invocableMetaTools);
462
+ for (const name of input.publishedMetaTools) {
463
+ if (invocable.has(name))
464
+ continue;
465
+ violations.push({
466
+ kind: "meta-tool-missing",
467
+ subject: name,
468
+ detail: `meta-tool "${name}" is published but the CLI cannot invoke it`,
469
+ });
470
+ }
471
+ return violations;
472
+ }
473
+ //# sourceMappingURL=surface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surface.js","sourceRoot":"","sources":["../src/surface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,cAAc,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAY7E,6DAA6D;AAC7D,MAAM,CAAC,MAAM,UAAU,GAA4B,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC9E,MAAM,EAAE,GAAG,CAAC,MAAoB;IAChC,IAAI,EAAE,GAAG,CAAC,IAAc;IACxB,IAAI,EAAE,GAAG,CAAC,IAAqB;CAChC,CAAC,CAAC,CAAC;AAEJ,yEAAyE;AAEzE;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,C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AAS,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,SAAS;QAClC,UAAU,CAAC,IAAI,CAAC;YACd,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,cAAc,IAAI,6CAA6C;SACxE,CAAC,CAAC;IACL,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codespar/cli",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "CodeSpar CLI. The agentic OS for money movement in Latin America, from your terminal: authenticate, browse servers, mint mandates, execute tools, manage sessions, stream logs.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -46,7 +46,7 @@
46
46
  "node": ">=20"
47
47
  },
48
48
  "dependencies": {
49
- "@codespar/sdk": "^0.12.0",
49
+ "@codespar/sdk": "^0.12.0 || ^0.13.0",
50
50
  "commander": "^13.0.0"
51
51
  },
52
52
  "devDependencies": {