@aria_asi/cli 0.2.25 → 0.2.26
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/aria-connector/src/connectors/claude-code.d.ts.map +1 -1
- package/dist/aria-connector/src/connectors/claude-code.js +37 -3
- package/dist/aria-connector/src/connectors/claude-code.js.map +1 -1
- package/dist/sdk/BUNDLED.json +1 -1
- package/dist/sdk/index.d.ts +34 -0
- package/dist/sdk/index.js +205 -0
- package/dist/sdk/index.js.map +1 -1
- package/hooks/aria-agent-handoff.mjs +0 -0
- package/hooks/aria-architect-fallback.mjs +198 -0
- package/hooks/aria-discovery-record.mjs +101 -0
- package/hooks/aria-outcome-record.mjs +80 -0
- package/hooks/aria-pre-tool-gate.mjs +158 -0
- package/hooks/aria-stop-gate.mjs +103 -1
- package/package.json +1 -1
- package/src/connectors/claude-code.ts +45 -10
package/package.json
CHANGED
|
@@ -36,6 +36,10 @@ const HOOK_FILES = [
|
|
|
36
36
|
// Pre-text gate — validates state-dependent claims in prose against
|
|
37
37
|
// probe evidence before emission. Closes "WHEN TO LOOK before speaking" gap.
|
|
38
38
|
'aria-pre-text-gate.mjs',
|
|
39
|
+
// Discovery-ledger write primitive (#83) — sub-agents pipe findings here;
|
|
40
|
+
// outcome-record fires on every state-mutating tool PostToolUse.
|
|
41
|
+
'aria-discovery-record.mjs',
|
|
42
|
+
'aria-outcome-record.mjs',
|
|
39
43
|
];
|
|
40
44
|
// Compiled location: <pkg>/dist/aria-connector/src/connectors/claude-code.js
|
|
41
45
|
// (tsc preserves the src/ rooted layout under outDir). From this file:
|
|
@@ -162,15 +166,28 @@ const HOOKS_BLOCK = {
|
|
|
162
166
|
}],
|
|
163
167
|
},
|
|
164
168
|
],
|
|
165
|
-
PostToolUse: [
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
169
|
+
PostToolUse: [
|
|
170
|
+
{
|
|
171
|
+
matcher: 'Agent',
|
|
172
|
+
hooks: [{
|
|
173
|
+
type: 'command',
|
|
174
|
+
command: 'node $HOME/.claude/hooks/aria-agent-ledger-merge.mjs',
|
|
175
|
+
timeout: 8,
|
|
176
|
+
statusMessage: 'Merging sub-agent ledger...',
|
|
177
|
+
}],
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
// Outcome-record: fires on every state-mutating tool to accumulate the
|
|
181
|
+
// outcome ledger (Sonnet H's #76 endpoint). Fire-and-forget — HTTP
|
|
182
|
+
// failures in the hook do not block the tool pipeline.
|
|
183
|
+
matcher: 'Bash|Edit|Write|NotebookEdit',
|
|
184
|
+
hooks: [{
|
|
185
|
+
type: 'command',
|
|
186
|
+
command: 'node $HOME/.claude/hooks/aria-outcome-record.mjs',
|
|
187
|
+
timeout: 3,
|
|
188
|
+
}],
|
|
189
|
+
},
|
|
190
|
+
],
|
|
174
191
|
Stop: [{
|
|
175
192
|
// Stop gate — text-decision boundary. Reflexive replies fail this
|
|
176
193
|
// gate the same way reflexive Bash does. Mirrors PreToolUse
|
|
@@ -307,9 +324,25 @@ function wireHooksBlock(settings: Record<string, unknown>, logs: string[]): void
|
|
|
307
324
|
if (!settings.$schema) {
|
|
308
325
|
settings.$schema = 'https://json.schemastore.org/claude-code-settings.json';
|
|
309
326
|
}
|
|
310
|
-
logs.push(`Wired hooks into settings.json (${mergedEvents} events: SessionStart, UserPromptSubmit, PreToolUse [cognition+memory-gate+Agent-handoff], PostToolUse [Agent-ledger-merge], Stop) — merge-safe, preserves third-party entries`);
|
|
327
|
+
logs.push(`Wired hooks into settings.json (${mergedEvents} events: SessionStart, UserPromptSubmit, PreToolUse [cognition+memory-gate+Agent-handoff], PostToolUse [Agent-ledger-merge + outcome-record], Stop) — merge-safe, preserves third-party entries`);
|
|
311
328
|
}
|
|
312
329
|
|
|
330
|
+
// Layer 2 (#84): hard prefix injected into every Agent dispatch so sub-agents
|
|
331
|
+
// know to load the harness packet before ANY tool call. This text appears in
|
|
332
|
+
// the system-prompt-prefix which Claude Code copies into spawned Agent contexts.
|
|
333
|
+
const ARIA_HARNESS_BINDING_PREFIX = `[ARIA_HARNESS_BINDING — MANDATORY FIRST ACTION]
|
|
334
|
+
Before any tool call, Read the harness packet at: $ARIA_HARNESS_PACKET_PATH
|
|
335
|
+
(path is also in your environment as ARIA_HARNESS_PACKET_PATH variable)
|
|
336
|
+
Cite it in your first cognition block — reference at least one axiom + one frame + one memory class from the packet.
|
|
337
|
+
Without packet-citation in your first cognition block, your output will be rejected by aria-pre-tool-gate.mjs in your sub-process.
|
|
338
|
+
[/ARIA_HARNESS_BINDING]
|
|
339
|
+
|
|
340
|
+
[ARIA_DISCOVERY_RECORDING — when you find a defect, doctrine violation, or notable observation during work]
|
|
341
|
+
Record findings to your session ledger via:
|
|
342
|
+
echo '{"text":"<finding>","kind":"defect|observation|principle","refs":["<file:line>"]}' | node $HOME/.claude/hooks/aria-discovery-record.mjs
|
|
343
|
+
This makes findings visible to the parent session's ledger-merge hook + the auto-fix spawner.
|
|
344
|
+
[/ARIA_DISCOVERY_RECORDING]`;
|
|
345
|
+
|
|
313
346
|
function buildAriaSystemBlock(config: AriaConfig): string {
|
|
314
347
|
const repoList = config.repositories.map((r) => `- ${r.name} (${r.path})`).join('\n');
|
|
315
348
|
const schemaText = Object.entries(config.schemaImages)
|
|
@@ -322,6 +355,8 @@ You are augmented with Aria's cognitive harness. This provides:
|
|
|
322
355
|
- Garden memory: persistent project memory across sessions
|
|
323
356
|
- 8-lens cognition: multi-perspective analysis for every decision
|
|
324
357
|
|
|
358
|
+
${ARIA_HARNESS_BINDING_PREFIX}
|
|
359
|
+
|
|
325
360
|
[SELF-GATE PROTOCOL]
|
|
326
361
|
Before emitting any claim, verify against these hard constraints:
|
|
327
362
|
1. Truth over deception — always.
|