@arp-protocol/cli 0.0.1 → 0.0.3
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 +74 -0
- package/LICENSE +26 -0
- package/README.md +19 -8
- package/dist/chunks/backfill-awengrsd.js +1048 -0
- package/dist/chunks/{ccip-qmytgn8e.js → ccip-zxtpc4fx.js} +4 -4
- package/dist/chunks/cli-00qp1sj2.js +116 -0
- package/dist/chunks/{cli-c8568g4c.js → cli-0gsbnq5w.js} +72 -72
- package/dist/chunks/{cli-0z6f3603.js → cli-10wacn76.js} +229 -15
- package/dist/chunks/{cli-zpft011j.js → cli-64fx73kx.js} +3 -3
- package/dist/chunks/{cli-v446mw5v.js → cli-fbwpcfvp.js} +34 -34
- package/dist/chunks/{cli-0hqxver6.js → cli-mhzh9z8k.js} +33 -33
- package/dist/chunks/{cli-tyey74p3.js → cli-n4qagybd.js} +6 -2
- package/dist/chunks/{cli-74hv4etk.js → cli-wev0jgf7.js} +4801 -3898
- package/dist/chunks/{commands-dnk10vze.js → commands-157bms70.js} +77 -16
- package/dist/chunks/{env-s4585w6j.js → env-n5ac8d1z.js} +1 -0
- package/dist/chunks/{index-3a3ssef1.js → index-jrs2shcc.js} +3 -3
- package/dist/chunks/line-691gbaha.js +166 -0
- package/dist/chunks/{node-init-4v2m2vj0.js → node-init-rcepfyeh.js} +6 -6
- package/dist/chunks/{node-0ydee9hy.js → node-m0mx4y5k.js} +6 -6
- package/dist/chunks/{server-jmyjttvv.js → server-59zry2jp.js} +3817 -163
- package/dist/chunks/{share-g8v5qe6r.js → share-vtbkzs5f.js} +8 -5
- package/dist/cli.js +48 -19
- package/dist/hook.js +3542 -232
- package/package.json +10 -3
- package/dist/chunks/backfill-j4hxt1w1.js +0 -262
- package/dist/chunks/line-zy1tc2np.js +0 -45
|
@@ -5,11 +5,12 @@ import {
|
|
|
5
5
|
installedFromSkillLock,
|
|
6
6
|
isSharingOn,
|
|
7
7
|
parseLocalFailures,
|
|
8
|
+
parseLocalOutcomes,
|
|
8
9
|
sharedLineKey
|
|
9
|
-
} from "./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
10
|
+
} from "./cli-wev0jgf7.js";
|
|
11
|
+
import"./cli-0gsbnq5w.js";
|
|
12
|
+
import"./cli-fbwpcfvp.js";
|
|
13
|
+
import"./cli-mhzh9z8k.js";
|
|
13
14
|
import"./cli-d3dy7cxe.js";
|
|
14
15
|
import"./cli-3kbbwfbp.js";
|
|
15
16
|
import"./cli-g5zvr10v.js";
|
|
@@ -37,6 +38,7 @@ function decide(env) {
|
|
|
37
38
|
const decision = decideShare({
|
|
38
39
|
on,
|
|
39
40
|
failures: parseLocalFailures(read(join(env.arpHome, "failures.jsonl")) ?? ""),
|
|
41
|
+
outcomes: parseLocalOutcomes(read(join(env.arpHome, "outcomes.jsonl")) ?? ""),
|
|
40
42
|
installed: [
|
|
41
43
|
...installedFromSkillLock(read(join(env.home, ".agents", ".skill-lock.json"))),
|
|
42
44
|
...installedFromReceipts(read(join(env.arpHome, "receipts.jsonl"))),
|
|
@@ -81,7 +83,8 @@ function describe(decision) {
|
|
|
81
83
|
if (decision.lines.length > 0) {
|
|
82
84
|
out.push("", "would be public on testnet 13579:");
|
|
83
85
|
for (const line of decision.lines) {
|
|
84
|
-
|
|
86
|
+
const tail = line.outcome === "failed" ? `failed ${line.reason}${line.need === undefined ? "" : ` needs ${line.need}`}` : `worked${line.need === undefined ? "" : ` with ${line.need}`}`;
|
|
87
|
+
out.push(` ${line.toolUrl} ${line.domain ?? "(no domain)"} ${tail}`);
|
|
85
88
|
}
|
|
86
89
|
}
|
|
87
90
|
if (decision.keptLocal.length > 0) {
|
package/dist/cli.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
bufferedCopy
|
|
4
|
-
} from "./chunks/cli-
|
|
5
|
-
import"./chunks/cli-
|
|
6
|
-
import"./chunks/cli-
|
|
4
|
+
} from "./chunks/cli-n4qagybd.js";
|
|
5
|
+
import"./chunks/cli-fbwpcfvp.js";
|
|
6
|
+
import"./chunks/cli-mhzh9z8k.js";
|
|
7
7
|
import"./chunks/cli-d3dy7cxe.js";
|
|
8
8
|
import"./chunks/cli-3kbbwfbp.js";
|
|
9
9
|
import {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import { dirname } from "node:path";
|
|
15
15
|
import { fileURLToPath } from "node:url";
|
|
16
16
|
// package.json
|
|
17
|
-
var version = "0.0.
|
|
17
|
+
var version = "0.0.3";
|
|
18
18
|
|
|
19
19
|
// src/cli.ts
|
|
20
20
|
var USAGE = `arp ${version} — ARP's agent-side programs
|
|
@@ -22,15 +22,21 @@ var USAGE = `arp ${version} — ARP's agent-side programs
|
|
|
22
22
|
usage
|
|
23
23
|
arp mcp [--http] the MCP server. stdio by default, which is how an MCP client launches it
|
|
24
24
|
arp hook the runtime hook: one payload on stdin. Records what a session used in
|
|
25
|
-
.arp/session.jsonl, and a skill's failures in ~/.arp/failures.jsonl
|
|
25
|
+
.arp/session.jsonl, and a skill's failures in ~/.arp/failures.jsonl. On
|
|
26
|
+
Stop, asks once per skill whether it did its job: ~/.arp/outcomes.jsonl
|
|
26
27
|
arp backfill read old Claude Code transcripts into ~/.arp/failures.jsonl. Sends nothing
|
|
27
|
-
arp share say what would be public from ~/.arp/failures.jsonl
|
|
28
|
+
arp share say what would be public from ~/.arp/failures.jsonl and outcomes.jsonl,
|
|
29
|
+
and what stays here.
|
|
28
30
|
arp share on, off (off by default). arp share send writes them on testnet
|
|
29
31
|
arp node the hire endpoint. Opt-in: it listens on 127.0.0.1 and is reached through
|
|
30
32
|
a tunnel you rent (cloudflared or ngrok, or ARP_NODE_PUBLIC_URL)
|
|
31
33
|
|
|
32
34
|
arp line write one public line on testnet 13579 through ARP's sponsor: --tool <url>
|
|
33
35
|
--outcome worked|failed [--domain <category>] [--reason <reason>]
|
|
36
|
+
[--payment-tx <hash> --network eip155:8453] an x402 payment, read on Base;
|
|
37
|
+
with it, --tool is the exact URL you paid
|
|
38
|
+
[--needs <name>] or [--with <name>] the program or variable name that was
|
|
39
|
+
missing, or that you added; written only if the skill's SKILL.md names it
|
|
34
40
|
arp init add the MCP server and the hook to every runtime found here
|
|
35
41
|
arp uninstall remove them, and only them
|
|
36
42
|
arp doctor check what is installed and that the server answers
|
|
@@ -51,17 +57,20 @@ usage
|
|
|
51
57
|
--capture (init) hook every runtime and keep each payload, redacted, in
|
|
52
58
|
~/.arp/captures/ — to teach the hook a new runtime
|
|
53
59
|
--force (init) replace an MCP server named "arp" that ARP did not write
|
|
60
|
+
--share, --no-share (init) answer the sharing offer up front; off unless --share or a "y"
|
|
54
61
|
arp --version
|
|
55
62
|
arp --help
|
|
56
63
|
|
|
57
|
-
docs: https://github.com/
|
|
64
|
+
docs: https://github.com/intuition-box/ARP/blob/main/docs/22_RUNNING_THE_NODE.md
|
|
58
65
|
`;
|
|
59
66
|
var EXIT = { ok: 0, usage: 2, writeFailed: 5 };
|
|
60
67
|
var CLI_PATH = fileURLToPath(import.meta.url);
|
|
61
68
|
var ARGV = process.argv.slice(2);
|
|
62
|
-
var
|
|
69
|
+
var asksHelp = (rest) => rest.some((arg) => arg === "--help" || arg === "-h");
|
|
70
|
+
var WANTS_HELP = asksHelp(ARGV.slice(1));
|
|
71
|
+
var STDIO_INPUT = ARGV[0] === "mcp" && !ARGV.includes("--http") && !WANTS_HELP ? bufferedCopy(process.stdin) : undefined;
|
|
63
72
|
async function runNodeInit(rest) {
|
|
64
|
-
const { nodeInit, parseNodeInitFlags } = await import("./chunks/node-init-
|
|
73
|
+
const { nodeInit, parseNodeInitFlags } = await import("./chunks/node-init-rcepfyeh.js");
|
|
65
74
|
const flags = parseNodeInitFlags(rest);
|
|
66
75
|
if (flags instanceof Error) {
|
|
67
76
|
process.stderr.write(`arp init --node: ${flags.message}
|
|
@@ -89,9 +98,9 @@ async function runNodeInit(rest) {
|
|
|
89
98
|
});
|
|
90
99
|
}
|
|
91
100
|
async function shareCommand(rest) {
|
|
92
|
-
const { arpHome } = await import("./chunks/index-
|
|
101
|
+
const { arpHome } = await import("./chunks/index-jrs2shcc.js");
|
|
93
102
|
const { homedir } = await import("node:os");
|
|
94
|
-
const share = await import("./chunks/share-
|
|
103
|
+
const share = await import("./chunks/share-vtbkzs5f.js");
|
|
95
104
|
const env = { arpHome: arpHome(process.env, homedir()), home: homedir(), cwd: process.cwd() };
|
|
96
105
|
if (rest[0] === "send") {
|
|
97
106
|
if (!share.decide(env).on) {
|
|
@@ -99,7 +108,7 @@ async function shareCommand(rest) {
|
|
|
99
108
|
return EXIT.ok;
|
|
100
109
|
}
|
|
101
110
|
process.env["ARP_TARGET"] ??= "testnet";
|
|
102
|
-
const { writeLineHere } = await import("./chunks/line-
|
|
111
|
+
const { writeLineHere } = await import("./chunks/line-691gbaha.js");
|
|
103
112
|
const done = await share.sendShared(env, async (line) => {
|
|
104
113
|
await writeLineHere(line);
|
|
105
114
|
});
|
|
@@ -122,11 +131,15 @@ async function shareCommand(rest) {
|
|
|
122
131
|
}
|
|
123
132
|
async function run(argv) {
|
|
124
133
|
const [command, ...rest] = argv;
|
|
134
|
+
if (asksHelp(rest)) {
|
|
135
|
+
process.stdout.write(USAGE);
|
|
136
|
+
return EXIT.ok;
|
|
137
|
+
}
|
|
125
138
|
if (command === "init" && rest.includes("--node"))
|
|
126
139
|
return runNodeInit(rest);
|
|
127
140
|
switch (command) {
|
|
128
141
|
case "mcp": {
|
|
129
|
-
const { main } = await import("./chunks/server-
|
|
142
|
+
const { main } = await import("./chunks/server-59zry2jp.js");
|
|
130
143
|
await main(rest.includes("--http") ? rest : ["--stdio", ...rest], STDIO_INPUT);
|
|
131
144
|
return EXIT.ok;
|
|
132
145
|
}
|
|
@@ -150,12 +163,28 @@ async function run(argv) {
|
|
|
150
163
|
const outcome = flag("outcome");
|
|
151
164
|
if (toolUrl === undefined || outcome === undefined) {
|
|
152
165
|
process.stderr.write(`usage: arp line --tool <url> --outcome worked|failed [--domain <category>] [--reason <reason>]
|
|
166
|
+
[--parent <category> --why <text>] adds a --domain the tree lacks, under --parent
|
|
167
|
+
[--payment-tx <hash> --network eip155:8453] the x402 payment this outcome refers to;
|
|
168
|
+
--tool is then the exact URL you paid
|
|
169
|
+
[--needs <name>] with missing-program or missing-key: the program or variable name (never a value)
|
|
170
|
+
[--with <name>] with --outcome worked: what you had to add; either is written only if the SKILL.md names it
|
|
153
171
|
`);
|
|
154
172
|
return EXIT.usage;
|
|
155
173
|
}
|
|
156
174
|
process.env["ARP_TARGET"] ??= "testnet";
|
|
157
|
-
const { lineFromArgs, writeLineHere } = await import("./chunks/line-
|
|
158
|
-
const input = lineFromArgs({
|
|
175
|
+
const { lineFromArgs, writeLineHere } = await import("./chunks/line-691gbaha.js");
|
|
176
|
+
const input = lineFromArgs({
|
|
177
|
+
toolUrl,
|
|
178
|
+
outcome,
|
|
179
|
+
domain: flag("domain"),
|
|
180
|
+
reason: flag("reason"),
|
|
181
|
+
parent: flag("parent"),
|
|
182
|
+
why: flag("why"),
|
|
183
|
+
paymentTx: flag("payment-tx"),
|
|
184
|
+
network: flag("network"),
|
|
185
|
+
needs: flag("needs"),
|
|
186
|
+
with: flag("with")
|
|
187
|
+
});
|
|
159
188
|
if (input instanceof Error) {
|
|
160
189
|
process.stderr.write(`arp line: ${input.message}
|
|
161
190
|
`);
|
|
@@ -173,22 +202,22 @@ async function run(argv) {
|
|
|
173
202
|
}
|
|
174
203
|
}
|
|
175
204
|
case "backfill": {
|
|
176
|
-
const { backfill } = await import("./chunks/backfill-
|
|
205
|
+
const { backfill } = await import("./chunks/backfill-awengrsd.js");
|
|
177
206
|
const found = backfill();
|
|
178
207
|
process.stdout.write(`read ${found.transcripts} transcripts: ${found.uses} skill uses, ${found.added} new failures in ${found.file}
|
|
179
208
|
`);
|
|
180
209
|
return EXIT.ok;
|
|
181
210
|
}
|
|
182
211
|
case "node": {
|
|
183
|
-
const { main } = await import("./chunks/node-
|
|
212
|
+
const { main } = await import("./chunks/node-m0mx4y5k.js");
|
|
184
213
|
await main();
|
|
185
214
|
return EXIT.ok;
|
|
186
215
|
}
|
|
187
216
|
case "init":
|
|
188
217
|
case "uninstall":
|
|
189
218
|
case "doctor": {
|
|
190
|
-
const install = await import("./chunks/commands-
|
|
191
|
-
const { processEnv } = await import("./chunks/env-
|
|
219
|
+
const install = await import("./chunks/commands-157bms70.js");
|
|
220
|
+
const { processEnv } = await import("./chunks/env-n5ac8d1z.js");
|
|
192
221
|
const flags = install.parseFlags(rest);
|
|
193
222
|
if (flags instanceof Error) {
|
|
194
223
|
process.stderr.write(`arp ${command}: ${flags.message}
|