@conto_finance/create-conto-agent 0.1.1 → 0.3.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/dist/index.js CHANGED
@@ -1,33 +1,82 @@
1
1
  import {
2
2
  runInit
3
- } from "./chunk-AWKUQSTP.js";
4
- import "./chunk-6TRDZ4JG.js";
5
- import "./chunk-NK52PCTE.js";
3
+ } from "./chunk-ICDSTI2Z.js";
4
+ import {
5
+ setJsonMode
6
+ } from "./chunk-K4LBO234.js";
7
+ import "./chunk-OS5PZNRM.js";
6
8
 
7
9
  // src/index.ts
10
+ var CLI_COMMANDS = /* @__PURE__ */ new Set([
11
+ "status",
12
+ "doctor",
13
+ "balance",
14
+ "pay",
15
+ "transactions",
16
+ "wallets",
17
+ "fund",
18
+ "policies",
19
+ "limits",
20
+ "alerts",
21
+ "config",
22
+ "login",
23
+ "logout",
24
+ "mcp",
25
+ "docs",
26
+ "init",
27
+ "help",
28
+ "--help",
29
+ "-h",
30
+ "--version",
31
+ "-V"
32
+ ]);
8
33
  var args = process.argv.slice(2);
9
- var options = {};
10
- for (let i = 0; i < args.length; i++) {
11
- const arg = args[i];
12
- if (arg === "--chain" && args[i + 1]) {
13
- options.chain = args[++i];
14
- } else if (arg === "--name" && args[i + 1]) {
15
- options.name = args[++i];
16
- } else if (arg === "--type" && args[i + 1]) {
17
- options.type = args[++i];
18
- } else if (arg === "--limit" && args[i + 1]) {
19
- options.limit = args[++i];
20
- } else if (arg === "--base-url" && args[i + 1]) {
21
- options.baseUrl = args[++i];
34
+ if (args.length > 0 && CLI_COMMANDS.has(args[0])) {
35
+ await import("./cli.js");
36
+ } else {
37
+ const options = {};
38
+ for (let i = 0; i < args.length; i++) {
39
+ const arg = args[i];
40
+ if (arg === "--chain" && args[i + 1]) {
41
+ options.chain = args[++i];
42
+ } else if (arg === "--name" && args[i + 1]) {
43
+ options.name = args[++i];
44
+ } else if (arg === "--type" && args[i + 1]) {
45
+ options.type = args[++i];
46
+ } else if (arg === "--limit" && args[i + 1]) {
47
+ options.limit = args[++i];
48
+ } else if (arg === "--base-url" && args[i + 1]) {
49
+ options.baseUrl = args[++i];
50
+ } else if (arg === "--api-key" && args[i + 1]) {
51
+ options.apiKey = args[++i];
52
+ } else if (arg === "--sandbox") {
53
+ options.sandbox = true;
54
+ } else if (arg === "--no-browser") {
55
+ options.noBrowser = true;
56
+ } else if (arg === "--json") {
57
+ options.json = true;
58
+ } else if (arg === "--no-install") {
59
+ options.noInstall = true;
60
+ }
61
+ }
62
+ if (options.json) {
63
+ setJsonMode(true);
64
+ }
65
+ if (options.noBrowser && !options.sandbox && !options.apiKey) {
66
+ console.error("--no-browser requires either --sandbox or --api-key <org-api-key>.");
67
+ process.exit(1);
22
68
  }
69
+ runInit({
70
+ chain: options.chain,
71
+ name: options.name,
72
+ type: options.type,
73
+ limit: options.limit ? Number(options.limit) : void 0,
74
+ baseUrl: options.baseUrl,
75
+ install: options.noInstall ? false : void 0,
76
+ sandbox: options.sandbox === true,
77
+ apiKey: options.apiKey
78
+ }).catch((err) => {
79
+ console.error("Fatal error:", err.message || err);
80
+ process.exit(1);
81
+ });
23
82
  }
24
- runInit({
25
- chain: options.chain,
26
- name: options.name,
27
- type: options.type,
28
- limit: options.limit ? Number(options.limit) : void 0,
29
- baseUrl: options.baseUrl
30
- }).catch((err) => {
31
- console.error("Fatal error:", err.message || err);
32
- process.exit(1);
33
- });
@@ -13,7 +13,7 @@ import {
13
13
  printWarning,
14
14
  setJsonMode,
15
15
  truncateAddress
16
- } from "./chunk-6TRDZ4JG.js";
16
+ } from "./chunk-K4LBO234.js";
17
17
  export {
18
18
  isJsonMode,
19
19
  printAmount,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conto_finance/create-conto-agent",
3
- "version": "0.1.1",
3
+ "version": "0.3.0",
4
4
  "description": "CLI quickstart for Conto — Agentic Payments Control Center",
5
5
  "bin": {
6
6
  "create-conto-agent": "bin/create-conto-agent.js",
@@ -15,7 +15,8 @@
15
15
  "scripts": {
16
16
  "build": "tsup src/index.ts src/cli.ts --format esm --dts --clean",
17
17
  "dev": "tsup src/index.ts src/cli.ts --format esm --dts --watch",
18
- "lint": "tsc --noEmit"
18
+ "lint": "tsc --noEmit",
19
+ "test": "npm run build && node --test test/*.test.mjs"
19
20
  },
20
21
  "engines": {
21
22
  "node": ">=18"
@@ -48,9 +49,12 @@
48
49
  "commander": "^13.1.0",
49
50
  "open": "^10.1.0"
50
51
  },
52
+ "overrides": {
53
+ "esbuild": "0.28.1"
54
+ },
51
55
  "devDependencies": {
52
- "@types/node": "^20.0.0",
53
- "tsup": "^8.0.0",
54
- "typescript": "^5.0.0"
56
+ "@types/node": "^22.19.18",
57
+ "tsup": "^8.5.1",
58
+ "typescript": "^5.9.3"
55
59
  }
56
60
  }