@chainalert/cli 0.0.6 → 0.0.8

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.
@@ -6,8 +6,8 @@ import {
6
6
  getAlert,
7
7
  getAlertStats,
8
8
  listAlerts
9
- } from "./chunk-BEHAHSK3.js";
10
- import "./chunk-4WIKOXYN.js";
9
+ } from "./chunk-3CRBW6AR.js";
10
+ import "./chunk-G3JPH2JO.js";
11
11
  import {
12
12
  dim,
13
13
  print,
@@ -15,7 +15,7 @@ import {
15
15
  printJson,
16
16
  printKV,
17
17
  printTable
18
- } from "./chunk-FRKJPHES.js";
18
+ } from "./chunk-6T27UZ4O.js";
19
19
 
20
20
  // src/commands/alerts.ts
21
21
  async function run(args, flags) {
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ask
4
- } from "./chunk-56X2ZTGI.js";
4
+ } from "./chunk-57VHSRHP.js";
5
5
  import {
6
6
  loadConfig,
7
7
  saveConfig
8
- } from "./chunk-4WIKOXYN.js";
8
+ } from "./chunk-G3JPH2JO.js";
9
9
  import {
10
10
  dim,
11
11
  print,
@@ -13,7 +13,7 @@ import {
13
13
  printJson,
14
14
  printKV,
15
15
  printSuccess
16
- } from "./chunk-FRKJPHES.js";
16
+ } from "./chunk-6T27UZ4O.js";
17
17
 
18
18
  // src/commands/auth.ts
19
19
  async function run(args, flags) {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  confirm
4
- } from "./chunk-56X2ZTGI.js";
4
+ } from "./chunk-57VHSRHP.js";
5
5
  import {
6
6
  spinner
7
7
  } from "./chunk-CE4DKHAY.js";
@@ -10,15 +10,15 @@ import {
10
10
  deleteChannel,
11
11
  listChannels,
12
12
  testChannel
13
- } from "./chunk-BEHAHSK3.js";
14
- import "./chunk-4WIKOXYN.js";
13
+ } from "./chunk-3CRBW6AR.js";
14
+ import "./chunk-G3JPH2JO.js";
15
15
  import {
16
16
  print,
17
17
  printError,
18
18
  printJson,
19
19
  printSuccess,
20
20
  printTable
21
- } from "./chunk-FRKJPHES.js";
21
+ } from "./chunk-6T27UZ4O.js";
22
22
 
23
23
  // src/commands/channels.ts
24
24
  async function run(args, flags) {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getApiKey,
4
4
  getApiUrl
5
- } from "./chunk-4WIKOXYN.js";
5
+ } from "./chunk-G3JPH2JO.js";
6
6
 
7
7
  // src/client/http.ts
8
8
  var ApiError = class extends Error {
@@ -7,23 +7,33 @@ function setReplRl(rl) {
7
7
  replRl = rl;
8
8
  }
9
9
  function confirm(question) {
10
- if (replRl) replRl.pause();
10
+ if (replRl) {
11
+ return new Promise((resolve) => {
12
+ replRl.question(`${question} [y/N] `, (answer) => {
13
+ resolve(answer.trim().toLowerCase() === "y");
14
+ });
15
+ });
16
+ }
11
17
  const rl = createInterface({ input: process.stdin, output: process.stderr });
12
18
  return new Promise((resolve) => {
13
19
  rl.question(`${question} [y/N] `, (answer) => {
14
20
  rl.close();
15
- if (replRl) replRl.resume();
16
21
  resolve(answer.trim().toLowerCase() === "y");
17
22
  });
18
23
  });
19
24
  }
20
25
  function ask(question) {
21
- if (replRl) replRl.pause();
26
+ if (replRl) {
27
+ return new Promise((resolve) => {
28
+ replRl.question(question, (answer) => {
29
+ resolve(answer.trim());
30
+ });
31
+ });
32
+ }
22
33
  const rl = createInterface({ input: process.stdin, output: process.stderr });
23
34
  return new Promise((resolve) => {
24
35
  rl.question(question, (answer) => {
25
36
  rl.close();
26
- if (replRl) replRl.resume();
27
37
  resolve(answer.trim());
28
38
  });
29
39
  });
@@ -3,7 +3,7 @@
3
3
  // src/config/constants.ts
4
4
  import { homedir } from "os";
5
5
  import { join } from "path";
6
- var VERSION = "0.0.4";
6
+ var VERSION = true ? "0.0.8" : "0.0.0-dev";
7
7
  var DEFAULT_API_URL = "https://chainalert.dev/api";
8
8
  var CONFIG_DIR = join(homedir(), ".chainalert");
9
9
  var CONFIG_FILE = join(CONFIG_DIR, "config.json");
@@ -3,7 +3,7 @@ import {
3
3
  CONFIG_DIR,
4
4
  CONFIG_FILE,
5
5
  DEFAULT_API_URL
6
- } from "./chunk-FRKJPHES.js";
6
+ } from "./chunk-6T27UZ4O.js";
7
7
 
8
8
  // src/config/store.ts
9
9
  import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs";
@@ -5,8 +5,8 @@ import {
5
5
  import {
6
6
  getStorageSlots,
7
7
  resolveContract
8
- } from "./chunk-BEHAHSK3.js";
9
- import "./chunk-4WIKOXYN.js";
8
+ } from "./chunk-3CRBW6AR.js";
9
+ import "./chunk-G3JPH2JO.js";
10
10
  import {
11
11
  bold,
12
12
  dim,
@@ -14,7 +14,7 @@ import {
14
14
  printError,
15
15
  printJson,
16
16
  printKV
17
- } from "./chunk-FRKJPHES.js";
17
+ } from "./chunk-6T27UZ4O.js";
18
18
 
19
19
  // src/commands/contracts.ts
20
20
  async function run(args, flags) {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  confirm
4
- } from "./chunk-56X2ZTGI.js";
4
+ } from "./chunk-57VHSRHP.js";
5
5
  import {
6
6
  spinner
7
7
  } from "./chunk-CE4DKHAY.js";
@@ -12,8 +12,8 @@ import {
12
12
  listDetections,
13
13
  testDetection,
14
14
  updateDetection
15
- } from "./chunk-BEHAHSK3.js";
16
- import "./chunk-4WIKOXYN.js";
15
+ } from "./chunk-3CRBW6AR.js";
16
+ import "./chunk-G3JPH2JO.js";
17
17
  import {
18
18
  bold,
19
19
  dim,
@@ -26,7 +26,7 @@ import {
26
26
  printTable,
27
27
  red,
28
28
  yellow
29
- } from "./chunk-FRKJPHES.js";
29
+ } from "./chunk-6T27UZ4O.js";
30
30
 
31
31
  // src/commands/detections.ts
32
32
  async function run(args, flags) {
@@ -5,8 +5,8 @@ import {
5
5
  import {
6
6
  getEvent,
7
7
  listEvents
8
- } from "./chunk-BEHAHSK3.js";
9
- import "./chunk-4WIKOXYN.js";
8
+ } from "./chunk-3CRBW6AR.js";
9
+ import "./chunk-G3JPH2JO.js";
10
10
  import {
11
11
  dim,
12
12
  print,
@@ -14,7 +14,7 @@ import {
14
14
  printJson,
15
15
  printKV,
16
16
  printTable
17
- } from "./chunk-FRKJPHES.js";
17
+ } from "./chunk-6T27UZ4O.js";
18
18
 
19
19
  // src/commands/events.ts
20
20
  async function run(args, flags) {
@@ -4,15 +4,15 @@ import {
4
4
  } from "./chunk-CE4DKHAY.js";
5
5
  import {
6
6
  getHealth
7
- } from "./chunk-BEHAHSK3.js";
8
- import "./chunk-4WIKOXYN.js";
7
+ } from "./chunk-3CRBW6AR.js";
8
+ import "./chunk-G3JPH2JO.js";
9
9
  import {
10
10
  print,
11
11
  printError,
12
12
  printJson,
13
13
  printSuccess,
14
14
  red
15
- } from "./chunk-FRKJPHES.js";
15
+ } from "./chunk-6T27UZ4O.js";
16
16
 
17
17
  // src/commands/health.ts
18
18
  async function run(args, flags) {
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  bold,
5
5
  print,
6
6
  printError
7
- } from "./chunk-FRKJPHES.js";
7
+ } from "./chunk-6T27UZ4O.js";
8
8
 
9
9
  // src/index.ts
10
10
  function parseArgs(argv) {
@@ -67,12 +67,12 @@ async function main() {
67
67
  switch (root) {
68
68
  // No command or "chat" -> interactive REPL
69
69
  case void 0: {
70
- const { startRepl } = await import("./repl-DQU6NZJV.js");
70
+ const { startRepl } = await import("./repl-UQMLAMGP.js");
71
71
  await startRepl();
72
72
  return;
73
73
  }
74
74
  case "chat": {
75
- const { startRepl } = await import("./repl-DQU6NZJV.js");
75
+ const { startRepl } = await import("./repl-UQMLAMGP.js");
76
76
  await startRepl();
77
77
  return;
78
78
  }
@@ -80,68 +80,68 @@ async function main() {
80
80
  case "login":
81
81
  case "logout":
82
82
  case "whoami": {
83
- const auth = await import("./auth-Q7GKIG24.js");
83
+ const auth = await import("./auth-3HWMEYI4.js");
84
84
  await auth.run([root, ...rest], flags);
85
85
  return;
86
86
  }
87
87
  case "config": {
88
- const auth = await import("./auth-Q7GKIG24.js");
88
+ const auth = await import("./auth-3HWMEYI4.js");
89
89
  await auth.runConfig(rest, flags);
90
90
  return;
91
91
  }
92
92
  // Resource commands
93
93
  case "health": {
94
- const mod = await import("./health-LZOEYRFT.js");
94
+ const mod = await import("./health-V7N7NJMK.js");
95
95
  await mod.run(rest, flags);
96
96
  return;
97
97
  }
98
98
  case "networks": {
99
- const mod = await import("./networks-X6W43DTO.js");
99
+ const mod = await import("./networks-XNVDSKSP.js");
100
100
  await mod.run(rest, flags);
101
101
  return;
102
102
  }
103
103
  case "templates": {
104
- const mod = await import("./templates-QD6XFBKS.js");
104
+ const mod = await import("./templates-ICHZ5IB6.js");
105
105
  await mod.run(rest, flags);
106
106
  return;
107
107
  }
108
108
  case "detections": {
109
- const mod = await import("./detections-LMJFG257.js");
109
+ const mod = await import("./detections-WUOCJTF4.js");
110
110
  await mod.run(rest, flags);
111
111
  return;
112
112
  }
113
113
  case "alerts": {
114
- const mod = await import("./alerts-3PPV43JZ.js");
114
+ const mod = await import("./alerts-MENP4SK4.js");
115
115
  await mod.run(rest, flags);
116
116
  return;
117
117
  }
118
118
  case "events": {
119
- const mod = await import("./events-6RZPVNDF.js");
119
+ const mod = await import("./events-A2CNER4U.js");
120
120
  await mod.run(rest, flags);
121
121
  return;
122
122
  }
123
123
  case "state-changes": {
124
- const mod = await import("./state-changes-UNTPB4O2.js");
124
+ const mod = await import("./state-changes-CJGVKBTY.js");
125
125
  await mod.run(rest, flags);
126
126
  return;
127
127
  }
128
128
  case "channels": {
129
- const mod = await import("./channels-WIGDNPEC.js");
129
+ const mod = await import("./channels-QARAQ47H.js");
130
130
  await mod.run(rest, flags);
131
131
  return;
132
132
  }
133
133
  case "contracts": {
134
- const mod = await import("./contracts-AD7PNBBN.js");
134
+ const mod = await import("./contracts-JRC5A6DK.js");
135
135
  await mod.run(rest, flags);
136
136
  return;
137
137
  }
138
138
  case "org-contracts": {
139
- const mod = await import("./org-contracts-CJASTL5O.js");
139
+ const mod = await import("./org-contracts-LLJZX2TH.js");
140
140
  await mod.run(rest, flags);
141
141
  return;
142
142
  }
143
143
  case "rpc-configs": {
144
- const mod = await import("./rpc-configs-Q5J3BMH2.js");
144
+ const mod = await import("./rpc-configs-Z7EZSAMJ.js");
145
145
  await mod.run(rest, flags);
146
146
  return;
147
147
  }
@@ -4,14 +4,14 @@ import {
4
4
  } from "./chunk-CE4DKHAY.js";
5
5
  import {
6
6
  listNetworks
7
- } from "./chunk-BEHAHSK3.js";
8
- import "./chunk-4WIKOXYN.js";
7
+ } from "./chunk-3CRBW6AR.js";
8
+ import "./chunk-G3JPH2JO.js";
9
9
  import {
10
10
  print,
11
11
  printError,
12
12
  printJson,
13
13
  printTable
14
- } from "./chunk-FRKJPHES.js";
14
+ } from "./chunk-6T27UZ4O.js";
15
15
 
16
16
  // src/commands/networks.ts
17
17
  async function run(args, flags) {
@@ -7,8 +7,8 @@ import {
7
7
  getOrgContractTraits,
8
8
  listOrgContracts,
9
9
  registerOrgContract
10
- } from "./chunk-BEHAHSK3.js";
11
- import "./chunk-4WIKOXYN.js";
10
+ } from "./chunk-3CRBW6AR.js";
11
+ import "./chunk-G3JPH2JO.js";
12
12
  import {
13
13
  dim,
14
14
  print,
@@ -17,7 +17,7 @@ import {
17
17
  printKV,
18
18
  printSuccess,
19
19
  printTable
20
- } from "./chunk-FRKJPHES.js";
20
+ } from "./chunk-6T27UZ4O.js";
21
21
 
22
22
  // src/commands/org-contracts.ts
23
23
  async function run(args, flags) {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  confirm,
4
4
  setReplRl
5
- } from "./chunk-56X2ZTGI.js";
5
+ } from "./chunk-57VHSRHP.js";
6
6
  import {
7
7
  addRpcConfig,
8
8
  createChannel,
@@ -29,12 +29,12 @@ import {
29
29
  testChannel,
30
30
  testDetection,
31
31
  updateDetection
32
- } from "./chunk-BEHAHSK3.js";
32
+ } from "./chunk-3CRBW6AR.js";
33
33
  import {
34
34
  getApiKey,
35
35
  getApiUrl,
36
36
  loadConfig
37
- } from "./chunk-4WIKOXYN.js";
37
+ } from "./chunk-G3JPH2JO.js";
38
38
  import {
39
39
  bold,
40
40
  cyan,
@@ -43,7 +43,7 @@ import {
43
43
  printDim,
44
44
  printError,
45
45
  printWarn
46
- } from "./chunk-FRKJPHES.js";
46
+ } from "./chunk-6T27UZ4O.js";
47
47
 
48
48
  // src/repl/repl.ts
49
49
  import { createInterface } from "readline";
@@ -1585,6 +1585,7 @@ async function startRepl() {
1585
1585
  rl.prompt();
1586
1586
  return;
1587
1587
  }
1588
+ rl.pause();
1588
1589
  conversation.add({ role: "user", content: input });
1589
1590
  try {
1590
1591
  let done = false;
@@ -1630,6 +1631,7 @@ async function startRepl() {
1630
1631
  } catch (err) {
1631
1632
  printError(err.message ?? "AI request failed");
1632
1633
  }
1634
+ rl.resume();
1633
1635
  rl.prompt();
1634
1636
  });
1635
1637
  rl.on("close", () => {
@@ -6,15 +6,15 @@ import {
6
6
  addRpcConfig,
7
7
  listRpcConfigs,
8
8
  testRpcConfig
9
- } from "./chunk-BEHAHSK3.js";
10
- import "./chunk-4WIKOXYN.js";
9
+ } from "./chunk-3CRBW6AR.js";
10
+ import "./chunk-G3JPH2JO.js";
11
11
  import {
12
12
  print,
13
13
  printError,
14
14
  printJson,
15
15
  printSuccess,
16
16
  printTable
17
- } from "./chunk-FRKJPHES.js";
17
+ } from "./chunk-6T27UZ4O.js";
18
18
 
19
19
  // src/commands/rpc-configs.ts
20
20
  async function run(args, flags) {
@@ -4,15 +4,15 @@ import {
4
4
  } from "./chunk-CE4DKHAY.js";
5
5
  import {
6
6
  listStateChanges
7
- } from "./chunk-BEHAHSK3.js";
8
- import "./chunk-4WIKOXYN.js";
7
+ } from "./chunk-3CRBW6AR.js";
8
+ import "./chunk-G3JPH2JO.js";
9
9
  import {
10
10
  dim,
11
11
  print,
12
12
  printError,
13
13
  printJson,
14
14
  printTable
15
- } from "./chunk-FRKJPHES.js";
15
+ } from "./chunk-6T27UZ4O.js";
16
16
 
17
17
  // src/commands/state-changes.ts
18
18
  async function run(args, flags) {
@@ -5,8 +5,8 @@ import {
5
5
  import {
6
6
  getTemplate,
7
7
  listTemplates
8
- } from "./chunk-BEHAHSK3.js";
9
- import "./chunk-4WIKOXYN.js";
8
+ } from "./chunk-3CRBW6AR.js";
9
+ import "./chunk-G3JPH2JO.js";
10
10
  import {
11
11
  bold,
12
12
  dim,
@@ -15,7 +15,7 @@ import {
15
15
  printJson,
16
16
  printKV,
17
17
  printTable
18
- } from "./chunk-FRKJPHES.js";
18
+ } from "./chunk-6T27UZ4O.js";
19
19
 
20
20
  // src/commands/templates.ts
21
21
  async function run(args, flags) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainalert/cli",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "ChainAlert CLI — manage blockchain monitoring from the command line",
5
5
  "type": "module",
6
6
  "license": "MIT",