@conto_finance/create-conto-agent 0.4.6 → 0.4.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.7
4
+
5
+ - Add `conto test-report` to export allowed, denied, and optional human-review payment evidence without executing a payment. Reports use owner-only files, refuse overwrites, and distinguish payment completion, control verification, audit evidence, and saving. Incomplete evidence exits with status 2.
6
+
3
7
  ## 0.4.6
4
8
 
5
9
  - Generated starters support `--status REQUEST_ID` and `--resume REQUEST_ID`, so continuing after owner approval uses the existing request instead of creating another payment.
@@ -20,7 +20,7 @@ import {
20
20
  // package.json
21
21
  var package_default = {
22
22
  name: "@conto_finance/create-conto-agent",
23
- version: "0.4.6",
23
+ version: "0.4.7",
24
24
  description: "Set up an AI agent with Conto spending controls",
25
25
  bin: {
26
26
  "create-conto-agent": "bin/create-conto-agent.js",
@@ -71,19 +71,19 @@ var package_default = {
71
71
  email: "support@conto.finance"
72
72
  },
73
73
  dependencies: {
74
- "@clack/prompts": "^0.9.1",
74
+ "@clack/prompts": "^1.8.1",
75
75
  chalk: "^5.4.1",
76
76
  "cli-table3": "^0.6.5",
77
77
  commander: "^13.1.0",
78
- open: "^10.1.0"
78
+ open: "^11.0.4"
79
79
  },
80
80
  overrides: {
81
81
  esbuild: "0.28.1"
82
82
  },
83
83
  devDependencies: {
84
- "@types/node": "22.19.18",
85
- tsup: "^8.5.1",
86
- typescript: "^5.9.3"
84
+ "@types/node": "26.6.5",
85
+ tsup: "^9.0.0",
86
+ typescript: "^6.0.3"
87
87
  }
88
88
  };
89
89
 
@@ -1731,7 +1731,7 @@ async function runOrganizationInit(options) {
1731
1731
  const agentName = options.name || resumed?.agentName || (interactive ? await p.text({
1732
1732
  message: "Agent name",
1733
1733
  placeholder: "my-procurement-bot",
1734
- validate: (v) => v.length < 2 ? "Name must be at least 2 characters" : void 0
1734
+ validate: (v) => (v ?? "").length < 2 ? "Name must be at least 2 characters" : void 0
1735
1735
  }) : HEADLESS_DEFAULT_NAME);
1736
1736
  if (p.isCancel(agentName)) {
1737
1737
  p.cancel("Setup cancelled.");
package/dist/cli.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
 
2
- export { }
2
+ export { };
package/dist/cli.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  retryAfterSeconds,
18
18
  runInit,
19
19
  writeProjectStateFile
20
- } from "./chunk-MASQPQTP.js";
20
+ } from "./chunk-HSJDGYZ5.js";
21
21
  import {
22
22
  VELOCITY_PERIODS,
23
23
  buildVelocityCountValue,
@@ -53,6 +53,9 @@ import {
53
53
  // src/cli.ts
54
54
  import { Command } from "commander";
55
55
 
56
+ // src/commands/test-report.ts
57
+ import fs from "fs";
58
+
56
59
  // src/lib/api-client.ts
57
60
  var REQUEST_TIMEOUT_MS = 3e4;
58
61
  function assertSecureBaseUrl(baseUrl) {
@@ -128,6 +131,12 @@ var ApiClient = class {
128
131
  clearTimeout(timeoutId);
129
132
  }
130
133
  }
134
+ async getTestReport(options) {
135
+ const query = new URLSearchParams({ allowed: options.allowed, denied: options.denied });
136
+ if (options.review) query.set("review", options.review);
137
+ if (options.reviewOutcome) query.set("reviewOutcome", options.reviewOutcome);
138
+ return this.request("GET", `/api/sdk/test-report?${query}`);
139
+ }
131
140
  // ── Org-level Admin APIs (used during init) ──
132
141
  async createWallet(params) {
133
142
  return this.request("POST", "/api/wallets", { body: params, auth: "org" });
@@ -277,6 +286,44 @@ function createApiClient(options) {
277
286
  return new ApiClient(options);
278
287
  }
279
288
 
289
+ // src/commands/test-report.ts
290
+ async function testReportCommand(options) {
291
+ try {
292
+ const config = loadConfig();
293
+ if (!config.apiKey) throw new Error(missingSdkKeyMessage(config));
294
+ const report = await createApiClient({
295
+ baseUrl: config.baseUrl,
296
+ apiKey: config.apiKey
297
+ }).getTestReport(options);
298
+ const fd = fs.openSync(options.output, "wx", 384);
299
+ try {
300
+ fs.writeFileSync(
301
+ fd,
302
+ JSON.stringify(
303
+ { ...report, milestones: { ...report.milestones, savedForReview: true } },
304
+ null,
305
+ 2
306
+ ) + "\n"
307
+ );
308
+ } catch (error) {
309
+ fs.closeSync(fd);
310
+ fs.unlinkSync(options.output);
311
+ throw error;
312
+ }
313
+ fs.closeSync(fd);
314
+ printJson({
315
+ savedTo: options.output,
316
+ milestones: { ...report.milestones, savedForReview: true },
317
+ reviewCoverage: report.reviewCoverage
318
+ });
319
+ if (!report.milestones.controlsVerified || !report.milestones.evidencePrepared)
320
+ process.exitCode = 2;
321
+ } catch (error) {
322
+ printError(error instanceof Error ? error.message : "Could not save the test report.");
323
+ process.exitCode = 1;
324
+ }
325
+ }
326
+
280
327
  // src/commands/status.ts
281
328
  async function statusCommand() {
282
329
  const config = loadConfig();
@@ -1891,7 +1938,7 @@ async function promptForRule(policyType) {
1891
1938
  message: "Max transactions in that window",
1892
1939
  placeholder: "5",
1893
1940
  validate: (v) => {
1894
- const result = buildVelocityCountValue(v, period);
1941
+ const result = buildVelocityCountValue(v ?? "", period);
1895
1942
  return result.ok ? void 0 : result.error;
1896
1943
  }
1897
1944
  });
@@ -1932,7 +1979,7 @@ async function promptForRule(policyType) {
1932
1979
  message: `Value: ${valueHint}`,
1933
1980
  placeholder,
1934
1981
  validate: ruleStr === "TRUST_SCORE" ? (v) => {
1935
- const result = parseTrustScoreInput(v);
1982
+ const result = parseTrustScoreInput(v ?? "");
1936
1983
  return result.ok ? void 0 : result.error;
1937
1984
  } : void 0
1938
1985
  });
@@ -2348,7 +2395,7 @@ async function testWebhook(url) {
2348
2395
  }
2349
2396
 
2350
2397
  // src/commands/sandbox.ts
2351
- import fs from "fs";
2398
+ import fs2 from "fs";
2352
2399
  import path from "path";
2353
2400
  import { setTimeout as sleep } from "timers/promises";
2354
2401
  import chalk8 from "chalk";
@@ -2612,7 +2659,7 @@ var TEST_MODE_AFTER_CLAIM = {
2612
2659
  credentialsPromoted: false
2613
2660
  };
2614
2661
  function cliPrefix() {
2615
- return fs.existsSync(path.join(process.cwd(), "node_modules", ".bin", "conto")) ? "npx conto" : "npx @conto_finance/create-conto-agent";
2662
+ return fs2.existsSync(path.join(process.cwd(), "node_modules", ".bin", "conto")) ? "npx conto" : "npx @conto_finance/create-conto-agent";
2616
2663
  }
2617
2664
  function emit(report) {
2618
2665
  if (isJsonMode()) {
@@ -2737,7 +2784,7 @@ function markExpired(cwd, state) {
2737
2784
  return expired;
2738
2785
  }
2739
2786
  function claimedReport(command, state, extra = {}) {
2740
- const setupKeyFileExists = fs.existsSync(path.join(process.cwd(), SANDBOX_SETUP_ENV_FILE));
2787
+ const setupKeyFileExists = fs2.existsSync(path.join(process.cwd(), SANDBOX_SETUP_ENV_FILE));
2741
2788
  return {
2742
2789
  command,
2743
2790
  status: "claimed",
@@ -3362,6 +3409,7 @@ program.command("status").description("Agent info, wallet balances, spending sum
3362
3409
  program.command("doctor").description("Diagnose setup: auth, key scopes, wallet, chain, balance, base URL").action(doctorCommand);
3363
3410
  program.command("balance").description("Wallet balances across all linked wallets").action(balanceCommand);
3364
3411
  program.command("pay <address> <amount>").description("Request + execute a payment").option("--purpose <purpose>", "Payment purpose").option("--category <category>", "Spend category").option("--dry-run", "Validate input and show the request without sending it (no policy check)").option("--wallet <walletId>", "Specific wallet to use").action(payCommand);
3412
+ program.command("test-report").description("Save buyer-side payment, control, and review evidence without executing payments").requiredOption("--allowed <id>", "Completed allowed payment request ID").requiredOption("--denied <id>", "Policy-denied payment request ID").option("--review <id>", "Review exercise payment request ID").option("--review-outcome <outcome>", "Expected review outcome: approved, denied, or expired").requiredOption("--output <file>", "New owner-only JSON report file (never overwritten)").action(testReportCommand);
3365
3413
  program.command("transactions [id]").description("List recent transactions or view details").option("--limit <n>", "Number of transactions", "10").option("--status <status>", "Filter by status").action(transactionsCommand);
3366
3414
  program.command("wallets").description("List wallets with balances").action(() => walletsCommand("list"));
3367
3415
  program.command("fund").description("Show wallet funding instructions").option("--faucet", "Request testnet funds from the configured faucet").action((opts) => walletsCommand("fund", { faucet: opts.faucet === true }));
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
 
2
- export { }
2
+ export { };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runInit
3
- } from "./chunk-MASQPQTP.js";
3
+ } from "./chunk-HSJDGYZ5.js";
4
4
  import {
5
5
  isJsonMode,
6
6
  printJson,
@@ -49,4 +49,5 @@ declare function validatePaymentRequest(input: {
49
49
  walletId?: string;
50
50
  }): PaymentValidation;
51
51
 
52
- export { type PaymentRequestBody, type PaymentValidation, VELOCITY_PERIODS, type ValidationResult, type VelocityPeriod, buildVelocityCountValue, parseTrustScoreInput, validatePaymentRequest };
52
+ export { VELOCITY_PERIODS, buildVelocityCountValue, parseTrustScoreInput, validatePaymentRequest };
53
+ export type { PaymentRequestBody, PaymentValidation, ValidationResult, VelocityPeriod };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conto_finance/create-conto-agent",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "Set up an AI agent with Conto spending controls",
5
5
  "bin": {
6
6
  "create-conto-agent": "bin/create-conto-agent.js",
@@ -51,18 +51,18 @@
51
51
  "email": "support@conto.finance"
52
52
  },
53
53
  "dependencies": {
54
- "@clack/prompts": "^0.9.1",
54
+ "@clack/prompts": "^1.8.1",
55
55
  "chalk": "^5.4.1",
56
56
  "cli-table3": "^0.6.5",
57
57
  "commander": "^13.1.0",
58
- "open": "^10.1.0"
58
+ "open": "^11.0.4"
59
59
  },
60
60
  "overrides": {
61
61
  "esbuild": "0.28.1"
62
62
  },
63
63
  "devDependencies": {
64
- "@types/node": "22.19.18",
65
- "tsup": "^8.5.1",
66
- "typescript": "^5.9.3"
64
+ "@types/node": "26.6.5",
65
+ "tsup": "^9.0.0",
66
+ "typescript": "^6.0.3"
67
67
  }
68
68
  }