@codespar/cli 0.6.2 → 0.8.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 +40 -0
- package/dist/api.js +78 -19
- package/dist/api.js.map +1 -1
- package/dist/commands/connect.js +26 -13
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/login.js +6 -6
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logs.js +73 -77
- package/dist/commands/logs.js.map +1 -1
- package/dist/commands/mandate.js +47 -16
- package/dist/commands/mandate.js.map +1 -1
- package/dist/commands/meta-input.js +11 -0
- package/dist/commands/meta-input.js.map +1 -1
- package/dist/commands/meta-tool.js +167 -0
- package/dist/commands/meta-tool.js.map +1 -0
- package/dist/commands/resource.js +74 -0
- package/dist/commands/resource.js.map +1 -0
- package/dist/commands/servers.js +40 -14
- package/dist/commands/servers.js.map +1 -1
- package/dist/commands/sessions.js +50 -27
- package/dist/commands/sessions.js.map +1 -1
- package/dist/commands/spend.js +4 -1
- package/dist/commands/spend.js.map +1 -1
- package/dist/commands/tools.js +38 -21
- package/dist/commands/tools.js.map +1 -1
- package/dist/commands/transfer.js +4 -1
- package/dist/commands/transfer.js.map +1 -1
- package/dist/commands/wallet.js +3 -1
- package/dist/commands/wallet.js.map +1 -1
- package/dist/commands/wizard.js +2 -2
- package/dist/commands/wizard.js.map +1 -1
- package/dist/index.js +113 -14
- package/dist/index.js.map +1 -1
- package/dist/output.js +100 -0
- package/dist/output.js.map +1 -1
- package/dist/surface.js +473 -0
- package/dist/surface.js.map +1 -0
- package/dist/version.js +18 -5
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
package/dist/output.js.map
CHANGED
|
@@ -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,CA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LI'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,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACjD,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,I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AmB;YACzB,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,cAAc,IAAI,6CAA6C;SACxE,CAAC,CAAC;IACL,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
package/dist/version.js
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* The CLI version, read from the package manifest.
|
|
4
|
+
*
|
|
5
|
+
* This was a hand-written literal, kept "in sync with package.json on
|
|
6
|
+
* release". It drifted: 0.6.0, 0.6.1, 0.6.2 and 0.7.0 each bumped the
|
|
7
|
+
* manifest and left the literal at 0.5.5, so the published 0.7.0 tarball
|
|
8
|
+
* introduced itself as 0.5.5 in `--version`, in the banner and in every
|
|
9
|
+
* User-Agent it sent (core#144). Three numbers for one release, and the
|
|
10
|
+
* one the user read was the oldest.
|
|
11
|
+
*
|
|
12
|
+
* Reading the manifest removes the class rather than detecting it: npm
|
|
13
|
+
* always publishes package.json, and it sits one directory above both
|
|
14
|
+
* `src/` and `dist/`, so the same specifier resolves in the repo and in
|
|
15
|
+
* the installed package. `createRequire` and not a JSON import because
|
|
16
|
+
* `rootDir` is `./src` — an import would pull the manifest into the
|
|
17
|
+
* compilation and tsc would refuse it as outside the root.
|
|
6
18
|
*/
|
|
7
|
-
|
|
19
|
+
const require = createRequire(import.meta.url);
|
|
20
|
+
export const VERSION = require("../package.json").version;
|
|
8
21
|
//# sourceMappingURL=version.js.map
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,MAAM,CAAC,MAAM,OAAO,GAAY,OAAO,CAAC,iBAAiB,CAAyB,CAAC,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codespar/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.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": {
|