arc402-cli 1.4.48 → 1.5.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/commands/arena-v2.d.ts +5 -0
- package/dist/commands/arena-v2.d.ts.map +1 -0
- package/dist/commands/arena-v2.js +2265 -0
- package/dist/commands/arena-v2.js.map +1 -0
- package/dist/commands/arena.d.ts +2 -0
- package/dist/commands/arena.d.ts.map +1 -1
- package/dist/commands/arena.js +10 -28
- package/dist/commands/arena.js.map +1 -1
- package/dist/commands/chat.d.ts +3 -0
- package/dist/commands/chat.d.ts.map +1 -0
- package/dist/commands/chat.js +561 -0
- package/dist/commands/chat.js.map +1 -0
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +44 -5
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/hermes-init.d.ts +16 -0
- package/dist/commands/hermes-init.d.ts.map +1 -0
- package/dist/commands/hermes-init.js +278 -0
- package/dist/commands/hermes-init.js.map +1 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +74 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/status.d.ts +18 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +141 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/subscription.d.ts +3 -0
- package/dist/commands/subscription.d.ts.map +1 -0
- package/dist/commands/subscription.js +173 -0
- package/dist/commands/subscription.js.map +1 -0
- package/dist/commerce-client.d.ts +77 -0
- package/dist/commerce-client.d.ts.map +1 -0
- package/dist/commerce-client.js +224 -0
- package/dist/commerce-client.js.map +1 -0
- package/dist/commerce-index.d.ts +39 -0
- package/dist/commerce-index.d.ts.map +1 -0
- package/dist/commerce-index.js +294 -0
- package/dist/commerce-index.js.map +1 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/daemon/config.d.ts +1 -0
- package/dist/daemon/config.d.ts.map +1 -1
- package/dist/daemon/config.js +7 -3
- package/dist/daemon/config.js.map +1 -1
- package/dist/daemon/index.d.ts.map +1 -1
- package/dist/daemon/index.js +102 -5
- package/dist/daemon/index.js.map +1 -1
- package/dist/daemon-client.d.ts +46 -0
- package/dist/daemon-client.d.ts.map +1 -0
- package/dist/daemon-client.js +80 -0
- package/dist/daemon-client.js.map +1 -0
- package/dist/index.js +40 -34
- package/dist/index.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +10 -0
- package/dist/program.js.map +1 -1
- package/hermes/DELIVERY-SPEC.md +219 -0
- package/hermes/HERMES-INTEGRATION-SPEC.md +338 -0
- package/hermes/plugins/arc402_hermes/__init__.py +5 -0
- package/hermes/plugins/arc402_hermes/plugin.py +489 -0
- package/hermes/plugins/arc402_hermes/py.typed +0 -0
- package/hermes/plugins/arc402_hermes.egg-info/PKG-INFO +24 -0
- package/hermes/plugins/arc402_hermes.egg-info/SOURCES.txt +10 -0
- package/hermes/plugins/arc402_hermes.egg-info/dependency_links.txt +1 -0
- package/hermes/plugins/arc402_hermes.egg-info/entry_points.txt +2 -0
- package/hermes/plugins/arc402_hermes.egg-info/requires.txt +5 -0
- package/hermes/plugins/arc402_hermes.egg-info/top_level.txt +1 -0
- package/hermes/plugins/arc402_plugin.py +489 -0
- package/hermes/plugins/dist/arc402_hermes-1.0.0-py3-none-any.whl +0 -0
- package/hermes/plugins/dist/arc402_hermes-1.0.0.tar.gz +0 -0
- package/hermes/plugins/pyproject.toml +47 -0
- package/hermes/skills/arc402-agent/SKILL.md +559 -0
- package/hermes/workroom/README.md +174 -0
- package/hermes/workroom/hermes-daemon.toml +21 -0
- package/hermes/workroom/hermes-worker/IDENTITY.md +44 -0
- package/hermes/workroom/hermes-worker/SOUL.md +45 -0
- package/hermes/workroom/hermes-worker/config.json +32 -0
- package/hermes/workroom/hermes-worker/datasets/.gitkeep +0 -0
- package/hermes/workroom/hermes-worker/knowledge/.gitkeep +0 -0
- package/hermes/workroom/hermes-worker/memory/learnings.md +9 -0
- package/hermes/workroom/hermes-worker/skills/.gitkeep +0 -0
- package/package.json +9 -3
- package/README.md +0 -288
package/dist/index.js
CHANGED
|
@@ -37,18 +37,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
37
37
|
const program_1 = require("./program");
|
|
38
38
|
const repl_1 = require("./repl");
|
|
39
39
|
const config_1 = require("./config");
|
|
40
|
+
const status_1 = require("./commands/status");
|
|
40
41
|
// ── Upgrade safety check ────────────────────────────────────────────────────
|
|
41
42
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
42
43
|
const currentVersion = require("../package.json").version;
|
|
43
|
-
function checkUpgrade() {
|
|
44
|
+
async function checkUpgrade() {
|
|
44
45
|
if (!(0, config_1.configExists)())
|
|
45
46
|
return;
|
|
46
47
|
try {
|
|
47
48
|
const config = (0, config_1.loadConfig)();
|
|
48
49
|
const prev = config.lastCliVersion;
|
|
49
50
|
if (prev && prev !== currentVersion) {
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
await (0, status_1.renderOperatorSummary)({
|
|
52
|
+
heading: { type: "upgrade", from: prev, to: currentVersion },
|
|
53
|
+
includeGuidance: false,
|
|
54
|
+
});
|
|
52
55
|
}
|
|
53
56
|
if (config.lastCliVersion !== currentVersion) {
|
|
54
57
|
// Never overwrite existing fields — only update lastCliVersion
|
|
@@ -72,38 +75,41 @@ const knownSubcommands = (() => {
|
|
|
72
75
|
})();
|
|
73
76
|
const argv = process.argv.slice(2).filter((a) => a !== "--print");
|
|
74
77
|
const hasSubcommand = argv.some((a) => !a.startsWith("-") && knownSubcommands.has(a));
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
checkUpgrade();
|
|
78
|
+
async function main() {
|
|
79
|
+
if (printMode) {
|
|
80
|
+
process.argv = process.argv.filter((a) => a !== "--print");
|
|
81
|
+
process.env["NO_COLOR"] = "1";
|
|
82
|
+
process.env["FORCE_COLOR"] = "0";
|
|
83
|
+
process.env["ARC402_PRINT"] = "1";
|
|
84
|
+
await checkUpgrade();
|
|
85
|
+
const program = (0, program_1.createProgram)();
|
|
86
|
+
await program.parseAsync(process.argv);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (process.stdout.isTTY && !hasSubcommand && process.argv.length <= 2) {
|
|
90
|
+
await checkUpgrade();
|
|
91
|
+
try {
|
|
92
|
+
const { launchTUI } = await Promise.resolve().then(() => __importStar(require("./tui/index")));
|
|
93
|
+
await launchTUI();
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
console.error("TUI failed to start:", e instanceof Error ? e.message : String(e));
|
|
98
|
+
await (0, repl_1.startREPL)();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (process.argv.length <= 2) {
|
|
103
|
+
await checkUpgrade();
|
|
104
|
+
await (0, repl_1.startREPL)();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
await checkUpgrade();
|
|
106
108
|
const program = (0, program_1.createProgram)();
|
|
107
109
|
program.parse(process.argv);
|
|
108
110
|
}
|
|
111
|
+
void main().catch((e) => {
|
|
112
|
+
console.error(e instanceof Error ? e.message : String(e));
|
|
113
|
+
process.exit(1);
|
|
114
|
+
});
|
|
109
115
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uCAA0C;AAC1C,iCAAmC;AACnC,qCAAgE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uCAA0C;AAC1C,iCAAmC;AACnC,qCAAgE;AAChE,8CAA0D;AAE1D,+EAA+E;AAC/E,8DAA8D;AAC9D,MAAM,cAAc,GAAY,OAAO,CAAC,iBAAiB,CAAyB,CAAC,OAAO,CAAC;AAE3F,KAAK,UAAU,YAAY;IACzB,IAAI,CAAC,IAAA,qBAAY,GAAE;QAAE,OAAO;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,mBAAU,GAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,MAAM,CAAC,cAAc,CAAC;QACnC,IAAI,IAAI,IAAI,IAAI,KAAK,cAAc,EAAE,CAAC;YACpC,MAAM,IAAA,8BAAqB,EAAC;gBAC1B,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,cAAc,EAAE;gBAC5D,eAAe,EAAE,KAAK;aACvB,CAAC,CAAC;QACL,CAAC;QACD,IAAI,MAAM,CAAC,cAAc,KAAK,cAAc,EAAE,CAAC;YAC7C,+DAA+D;YAC/D,IAAA,mBAAU,EAAC,EAAE,GAAG,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,+BAA+B;IACjC,CAAC;AACH,CAAC;AAED,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAEnD,2FAA2F;AAC3F,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE;IAC7B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
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8CpC,wBAAgB,aAAa,IAAI,OAAO,CAwDvC"}
|
package/dist/program.js
CHANGED
|
@@ -29,6 +29,7 @@ const trust_1 = require("./commands/trust");
|
|
|
29
29
|
const wallet_1 = require("./commands/wallet");
|
|
30
30
|
const owner_1 = require("./commands/owner");
|
|
31
31
|
const setup_1 = require("./commands/setup");
|
|
32
|
+
const chat_1 = require("./commands/chat");
|
|
32
33
|
const verify_1 = require("./commands/verify");
|
|
33
34
|
const contract_interaction_1 = require("./commands/contract-interaction");
|
|
34
35
|
const watchtower_1 = require("./commands/watchtower");
|
|
@@ -42,6 +43,10 @@ const backup_1 = require("./commands/backup");
|
|
|
42
43
|
const compute_1 = require("./commands/compute");
|
|
43
44
|
const tunnel_1 = require("./commands/tunnel");
|
|
44
45
|
const job_1 = require("./commands/job");
|
|
46
|
+
const hermes_init_1 = require("./commands/hermes-init");
|
|
47
|
+
const index_1 = require("./commands/index");
|
|
48
|
+
const subscription_1 = require("./commands/subscription");
|
|
49
|
+
const status_1 = require("./commands/status");
|
|
45
50
|
const reputation_js_1 = __importDefault(require("./commands/reputation.js"));
|
|
46
51
|
const policy_js_1 = __importDefault(require("./commands/policy.js"));
|
|
47
52
|
function createProgram() {
|
|
@@ -51,6 +56,7 @@ function createProgram() {
|
|
|
51
56
|
.description("ARC-402 CLI aligned to canonical-capability discovery → negotiate → hire → remediate → dispute workflow")
|
|
52
57
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
53
58
|
.version(require("../package.json").version);
|
|
59
|
+
(0, status_1.registerStatusCommand)(program);
|
|
54
60
|
(0, config_1.registerConfigCommands)(program);
|
|
55
61
|
(0, agent_handshake_1.registerHandshakeCommand)(program);
|
|
56
62
|
(0, agent_1.registerAgentCommands)(program);
|
|
@@ -75,6 +81,7 @@ function createProgram() {
|
|
|
75
81
|
(0, wallet_1.registerWalletCommands)(program);
|
|
76
82
|
(0, owner_1.registerOwnerCommands)(program);
|
|
77
83
|
(0, setup_1.registerSetupCommands)(program);
|
|
84
|
+
(0, chat_1.registerChatCommand)(program);
|
|
78
85
|
(0, verify_1.registerVerifyCommand)(program);
|
|
79
86
|
(0, contract_interaction_1.registerContractInteractionCommands)(program);
|
|
80
87
|
(0, watchtower_1.registerWatchtowerCommands)(program);
|
|
@@ -88,6 +95,9 @@ function createProgram() {
|
|
|
88
95
|
(0, compute_1.registerComputeCommands)(program);
|
|
89
96
|
(0, tunnel_1.registerTunnelCommands)(program);
|
|
90
97
|
(0, job_1.registerJobCommands)(program);
|
|
98
|
+
(0, hermes_init_1.registerHermesInitCommand)(program);
|
|
99
|
+
(0, index_1.registerIndexCommands)(program);
|
|
100
|
+
(0, subscription_1.registerSubscriptionCommands)(program);
|
|
91
101
|
program.addCommand(reputation_js_1.default);
|
|
92
102
|
program.addCommand(policy_js_1.default);
|
|
93
103
|
return program;
|
package/dist/program.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":";;;;;AA8CA,sCAwDC;AAtGD,yCAAoC;AACpC,8CAA0D;AAC1D,4CAAyD;AACzD,sDAAmE;AACnE,sDAAkE;AAClE,8CAA0D;AAC1D,gDAA6D;AAC7D,8CAA2D;AAC3D,gDAA4D;AAC5D,kDAA8D;AAC9D,kDAA+D;AAC/D,gDAA4D;AAC5D,0CAAsD;AACtD,gEAAsE;AACtE,oDAAiE;AACjE,4CAAyD;AACzD,oDAAiE;AACjE,8CAA2D;AAC3D,oDAAiE;AACjE,kDAA+D;AAC/D,gEAA4E;AAC5E,4CAAwD;AACxD,8CAA2D;AAC3D,4CAAyD;AACzD,4CAAyD;AACzD,0CAAsD;AACtD,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AAC,UAAU,CAAC,mBAAM,CAAC,CAAC;IAE3B,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# ARC-402 Delivery Block Spec
|
|
2
|
+
*Version: 1.0*
|
|
3
|
+
*Source of truth: `cli/src/daemon/worker-executor.ts` — `runViaGateway()` and `buildTask()`*
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
The `<arc402_delivery>` block is the structured output format that worker agents use to transfer deliverable files to the WorkerExecutor. When the parser detects a valid block, it extracts the files, writes them to the job staging directory, computes a Merkle-style root hash over all file contents, and commits that hash on-chain via `commitDeliverable()`.
|
|
10
|
+
|
|
11
|
+
Agents that omit the block trigger a fallback path that writes their raw response as `deliverable.md`. The fallback produces valid on-chain delivery but loses file structure. Always emit the block explicitly.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Format
|
|
16
|
+
|
|
17
|
+
### Single-file delivery
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
<arc402_delivery>
|
|
21
|
+
{"files":[{"name":"deliverable.md","content":"# Deliverable\n\nYour work here."}]}
|
|
22
|
+
</arc402_delivery>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Multi-file delivery
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
<arc402_delivery>
|
|
29
|
+
{"files":[
|
|
30
|
+
{"name":"deliverable.md","content":"# Summary\n\nSee report.md for full analysis."},
|
|
31
|
+
{"name":"report.md","content":"# Full Report\n\n..."},
|
|
32
|
+
{"name":"data.json","content":"{\"results\":[1,2,3]}"}
|
|
33
|
+
]}
|
|
34
|
+
</arc402_delivery>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Structure
|
|
40
|
+
|
|
41
|
+
The inner content of the block is a single JSON object:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"files": [
|
|
46
|
+
{
|
|
47
|
+
"name": "string — filename (required)",
|
|
48
|
+
"content": "string — file content (required)"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Both `name` and `content` must be strings. No other fields are required or consumed by the parser.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Rules
|
|
59
|
+
|
|
60
|
+
| Rule | Detail |
|
|
61
|
+
|------|--------|
|
|
62
|
+
| Block appears once | The parser matches the first `<arc402_delivery>…</arc402_delivery>` in the agent output. Multiple blocks are not supported — only the first match is processed. |
|
|
63
|
+
| `deliverable.md` required | The parser checks `parsed.files.some(f => path.basename(f.name) === "deliverable.md")`. If absent, the block is treated as not extracted and the fallback fires. |
|
|
64
|
+
| File names are flattened | Each `name` is passed through `path.basename()`. Any path component (`../`, `subdir/`) is stripped. `subdir/report.md` → `report.md`. |
|
|
65
|
+
| No dotfiles | Files whose basename starts with `.` are silently skipped. |
|
|
66
|
+
| Content is a JSON string | Newlines must be escaped as `\n`, quotes as `\"`. Raw newlines inside JSON string values are a parse error. |
|
|
67
|
+
| Maximum total content | 1 MB across all file contents combined. Enforced by the daemon before the parser runs. |
|
|
68
|
+
| Excluded from collection | `task.md` and `job.log` are excluded from the delivery manifest even if written to the job directory. Do not include them in the delivery block. |
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Parser Behavior (source: `worker-executor.ts`)
|
|
73
|
+
|
|
74
|
+
### Step 1 — Block detection
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
regex: /<arc402_delivery>\s*([\s\S]*?)\s*<\/arc402_delivery>/
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Applied to the full agent output (gateway response content or raw subprocess stdout). The inner capture group is passed to the JSON parser.
|
|
81
|
+
|
|
82
|
+
### Step 2 — JSON parse
|
|
83
|
+
|
|
84
|
+
The inner content is parsed as:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
{ files?: Array<{ name: string; content: string }> }
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
If `JSON.parse` throws, the parse error is logged and the fallback path fires.
|
|
91
|
+
|
|
92
|
+
### Step 3 — File extraction
|
|
93
|
+
|
|
94
|
+
For each entry in `files`:
|
|
95
|
+
- `name` is passed through `path.basename()` — path separators stripped
|
|
96
|
+
- Entries with a basename starting with `.` are skipped
|
|
97
|
+
- If `name` or `content` is not a string, the entry is skipped
|
|
98
|
+
- Each surviving file is written to the job staging directory: `~/.arc402/jobs/agreement-<id>/<name>`
|
|
99
|
+
|
|
100
|
+
### Step 4 — Delivered flag
|
|
101
|
+
|
|
102
|
+
If any extracted file has basename `deliverable.md`, the parser marks the delivery as successfully extracted (`extractedDeliverable = true`).
|
|
103
|
+
|
|
104
|
+
### Step 5 — Fallback
|
|
105
|
+
|
|
106
|
+
If:
|
|
107
|
+
- No `<arc402_delivery>` block was found, OR
|
|
108
|
+
- JSON parse failed, OR
|
|
109
|
+
- No file with basename `deliverable.md` was extracted
|
|
110
|
+
|
|
111
|
+
→ The entire raw agent output is written to `deliverable.md` with a header:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
# Deliverable
|
|
115
|
+
|
|
116
|
+
Agreement: <agreement-id>
|
|
117
|
+
Capability: <capability>
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
<raw agent output>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The fallback produces valid on-chain delivery. The root hash covers the single fallback file.
|
|
125
|
+
|
|
126
|
+
### Step 6 — Root hash and manifest
|
|
127
|
+
|
|
128
|
+
After file extraction (or fallback), `FileDeliveryManager.storeDirectory()` is called on the job staging directory, excluding `task.md` and `job.log`. It:
|
|
129
|
+
- Lists all surviving files
|
|
130
|
+
- Computes a root hash over all file contents
|
|
131
|
+
- Returns a `DeliveryManifest: { root_hash: string; files: FileEntry[] }`
|
|
132
|
+
|
|
133
|
+
The root hash is committed on-chain via `commitDeliverable()`.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## JSON Encoding Reference
|
|
138
|
+
|
|
139
|
+
The most common error is unescaped content inside JSON strings. Because the entire `files` array is JSON, all file content must be valid JSON string values.
|
|
140
|
+
|
|
141
|
+
| Character | Escaped form |
|
|
142
|
+
|-----------|-------------|
|
|
143
|
+
| Newline | `\n` |
|
|
144
|
+
| Carriage return | `\r` |
|
|
145
|
+
| Tab | `\t` |
|
|
146
|
+
| Double quote | `\"` |
|
|
147
|
+
| Backslash | `\\` |
|
|
148
|
+
|
|
149
|
+
**Correct:**
|
|
150
|
+
```json
|
|
151
|
+
{"name":"report.md","content":"# Report\n\nLine one.\nLine two.\n\n## Section\n\nContent here."}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Incorrect (raw newline inside string — JSON parse error):**
|
|
155
|
+
```json
|
|
156
|
+
{"name":"report.md","content":"# Report
|
|
157
|
+
|
|
158
|
+
Line one."}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Agent Prompt Injection (from `buildTask()`)
|
|
164
|
+
|
|
165
|
+
The WorkerExecutor injects the following output instruction into every task prompt:
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
At the end of your response, you MUST include an <arc402_delivery> block containing ALL output
|
|
169
|
+
files as JSON. This is how your files are transferred to the delivery system. Format:
|
|
170
|
+
|
|
171
|
+
<arc402_delivery>
|
|
172
|
+
{"files":[{"name":"deliverable.md","content":"# Deliverable\n\n..."},{"name":"report.md","content":"..."}]}
|
|
173
|
+
</arc402_delivery>
|
|
174
|
+
|
|
175
|
+
Rules:
|
|
176
|
+
- ALWAYS include `deliverable.md` as a summary of your work
|
|
177
|
+
- Include ALL substantive output files (reports, code, data, etc.)
|
|
178
|
+
- File content must be valid JSON string (escape newlines as \n, quotes as \")
|
|
179
|
+
- Do NOT include task.md or job.log in the delivery block
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Agents are expected to reproduce this format exactly. The instruction is always present in the task prompt — agents do not need to infer the format from the skill alone.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Examples
|
|
187
|
+
|
|
188
|
+
### Research deliverable
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
<arc402_delivery>
|
|
192
|
+
{"files":[{"name":"deliverable.md","content":"# Research Summary\n\nCompleted analysis of topic X.\n\n## Key Findings\n\n1. Finding one.\n2. Finding two.\n\nSee report.md for full detail."},{"name":"report.md","content":"# Full Research Report\n\n## Introduction\n\n..."}]}
|
|
193
|
+
</arc402_delivery>
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Code deliverable
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
<arc402_delivery>
|
|
200
|
+
{"files":[{"name":"deliverable.md","content":"# Code Deliverable\n\nImplemented the requested function. See solution.py."},{"name":"solution.py","content":"def solve(n):\n \"\"\"Solve the problem.\"\"\"\n return n * 2\n"},{"name":"test_solution.py","content":"from solution import solve\n\ndef test_basic():\n assert solve(5) == 10\n"}]}
|
|
201
|
+
</arc402_delivery>
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Data deliverable
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
<arc402_delivery>
|
|
208
|
+
{"files":[{"name":"deliverable.md","content":"# Data Processing Complete\n\nProcessed 1,000 records. Output in results.json."},{"name":"results.json","content":"{\"count\":1000,\"processed\":1000,\"errors\":0,\"data\":[]}"}]}
|
|
209
|
+
</arc402_delivery>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Operator Notes
|
|
215
|
+
|
|
216
|
+
- **Do not attempt to parse delivery blocks outside the daemon.** The `FileDeliveryManager` handles root hash computation — replicating this externally risks hash mismatches that break on-chain verification.
|
|
217
|
+
- **The block is not a transport.** It is parsed by the daemon after the agent process exits. Agents do not need to call any API to submit files — emitting the block in their final message is sufficient.
|
|
218
|
+
- **Binary content is not supported.** File content must be UTF-8 text. For binary outputs, base64-encode the content and note the encoding in `deliverable.md`.
|
|
219
|
+
- **Test locally with `arc402 job manifest <id>`** after a workroom job completes to verify the manifest before checking on-chain state.
|