@conto_finance/create-conto-agent 0.8.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,9 +11,10 @@ import {
11
11
  maskSecret,
12
12
  missingSdkKeyMessage,
13
13
  saveGlobalConfig,
14
+ savedOrgKeyFor,
14
15
  writeEnvLocal,
15
16
  writeSandboxSetupEnv
16
- } from "./chunk-RQ4PUBL7.js";
17
+ } from "./chunk-F72EK2TO.js";
17
18
  export {
18
19
  SANDBOX_SETUP_ENV_FILE,
19
20
  clearGlobalConfig,
@@ -27,6 +28,7 @@ export {
27
28
  maskSecret,
28
29
  missingSdkKeyMessage,
29
30
  saveGlobalConfig,
31
+ savedOrgKeyFor,
30
32
  writeEnvLocal,
31
33
  writeSandboxSetupEnv
32
34
  };
package/dist/index.js CHANGED
@@ -1,7 +1,10 @@
1
1
  import {
2
2
  runInit
3
- } from "./chunk-HGEZBNZB.js";
4
- import "./chunk-RQ4PUBL7.js";
3
+ } from "./chunk-6PK4I5VO.js";
4
+ import {
5
+ delegatesToCli
6
+ } from "./chunk-D6JPJHU4.js";
7
+ import "./chunk-F72EK2TO.js";
5
8
  import {
6
9
  isJsonMode,
7
10
  printJson,
@@ -9,39 +12,8 @@ import {
9
12
  } from "./chunk-DT5NOLBD.js";
10
13
 
11
14
  // src/index.ts
12
- var CLI_COMMANDS = /* @__PURE__ */ new Set([
13
- "status",
14
- "doctor",
15
- "balance",
16
- "pay",
17
- "transactions",
18
- "wallets",
19
- "webhooks",
20
- "agents",
21
- "counterparties",
22
- "channels",
23
- "changes",
24
- "test-report",
25
- "fund",
26
- "policies",
27
- "limits",
28
- "alerts",
29
- "config",
30
- "login",
31
- "logout",
32
- "mcp",
33
- "docs",
34
- "init",
35
- "sandbox",
36
- "help",
37
- "--help",
38
- "-h",
39
- "--version",
40
- "-V"
41
- ]);
42
15
  var args = process.argv.slice(2);
43
- var delegatedCommand = args[0] && CLI_COMMANDS.has(args[0]) || args[0] === "--json" && args[1] !== void 0 && CLI_COMMANDS.has(args[1]);
44
- if (delegatedCommand) {
16
+ if (delegatesToCli(args)) {
45
17
  await import("./cli.js");
46
18
  } else {
47
19
  const options = {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * First arguments that `create-conto-agent` hands to the full conto CLI
3
+ * instead of starting the setup wizard. Every top-level command registered in
4
+ * cli.ts must be here, or `npx @conto_finance/create-conto-agent <command>`
5
+ * runs setup. test/delegation.test.mjs fails when one is missing.
6
+ */
7
+ declare const CLI_COMMANDS: ReadonlySet<string>;
8
+ /** Whether these arguments name a conto CLI command, optionally after a leading --json. */
9
+ declare function delegatesToCli(args: readonly string[]): boolean;
10
+
11
+ export { CLI_COMMANDS, delegatesToCli };
@@ -0,0 +1,8 @@
1
+ import {
2
+ CLI_COMMANDS,
3
+ delegatesToCli
4
+ } from "../chunk-D6JPJHU4.js";
5
+ export {
6
+ CLI_COMMANDS,
7
+ delegatesToCli
8
+ };
@@ -61,6 +61,14 @@ declare function validatePaymentRequest(input: {
61
61
  category?: string;
62
62
  walletId?: string;
63
63
  }): PaymentValidation;
64
+ /**
65
+ * Rule types that block what they match. Conto refuses ALLOW on these, since an
66
+ * ALLOW rule permits only what its condition matches, so a blocklist saved as
67
+ * ALLOW would permit only what it lists. Keep in step with the app's
68
+ * src/lib/policies/blocklist-rules.ts.
69
+ */
70
+ declare const BLOCKLIST_RULE_TYPES: readonly string[];
71
+ declare function isBlocklistRuleType(ruleType: string): boolean;
64
72
 
65
- export { BUDGET_PERIODS, VELOCITY_PERIODS, buildBudgetCapValue, buildVelocityCountValue, dateRangePlaceholder, parseTrustScoreInput, validatePaymentRequest };
73
+ export { BLOCKLIST_RULE_TYPES, BUDGET_PERIODS, VELOCITY_PERIODS, buildBudgetCapValue, buildVelocityCountValue, dateRangePlaceholder, isBlocklistRuleType, parseTrustScoreInput, validatePaymentRequest };
66
74
  export type { PaymentRequestBody, PaymentValidation, ValidationResult, VelocityPeriod };
@@ -1,18 +1,22 @@
1
1
  import {
2
+ BLOCKLIST_RULE_TYPES,
2
3
  BUDGET_PERIODS,
3
4
  VELOCITY_PERIODS,
4
5
  buildBudgetCapValue,
5
6
  buildVelocityCountValue,
6
7
  dateRangePlaceholder,
8
+ isBlocklistRuleType,
7
9
  parseTrustScoreInput,
8
10
  validatePaymentRequest
9
- } from "../chunk-2M2WVAJI.js";
11
+ } from "../chunk-PUHGIKBB.js";
10
12
  export {
13
+ BLOCKLIST_RULE_TYPES,
11
14
  BUDGET_PERIODS,
12
15
  VELOCITY_PERIODS,
13
16
  buildBudgetCapValue,
14
17
  buildVelocityCountValue,
15
18
  dateRangePlaceholder,
19
+ isBlocklistRuleType,
16
20
  parseTrustScoreInput,
17
21
  validatePaymentRequest
18
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conto_finance/create-conto-agent",
3
- "version": "0.8.0",
3
+ "version": "0.9.1",
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",
@@ -18,8 +18,8 @@
18
18
  "access": "public"
19
19
  },
20
20
  "scripts": {
21
- "build": "tsup src/index.ts src/cli.ts src/lib/rule-values.ts --format esm --dts --clean",
22
- "dev": "tsup src/index.ts src/cli.ts src/lib/rule-values.ts --format esm --dts --watch",
21
+ "build": "tsup src/index.ts src/cli.ts src/lib/rule-values.ts src/lib/cli-commands.ts --format esm --dts --clean",
22
+ "dev": "tsup src/index.ts src/cli.ts src/lib/rule-values.ts src/lib/cli-commands.ts --format esm --dts --watch",
23
23
  "lint": "tsc --noEmit",
24
24
  "test": "npm run lint && npm run test:contract",
25
25
  "test:contract": "npm run build && node --test test/*.test.mjs",