@aria_asi/cli 0.2.9 → 0.2.11
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 +47 -1
- package/dist/aria-connector/src/connectors/claude-code.js.map +1 -1
- package/dist/sdk/BUNDLED.json +5 -0
- package/dist/sdk/index.d.ts +88 -0
- package/dist/sdk/index.js +403 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/package.json +8 -0
- package/hooks/aria-harness-via-sdk.mjs +46 -12
- package/hooks/aria-pre-tool-gate.mjs +61 -1
- package/hooks/aria-preprompt-consult.mjs +58 -18
- package/hooks/aria-stop-gate.mjs +263 -4
- package/hooks/doctrine_trigger_map.json +54 -0
- package/package.json +2 -2
- package/src/connectors/claude-code.ts +48 -1
|
@@ -27,9 +27,28 @@ const HOOK_FILES = [
|
|
|
27
27
|
'aria-stop-gate.mjs',
|
|
28
28
|
'aria-preprompt-consult.mjs',
|
|
29
29
|
];
|
|
30
|
+
// Compiled location: <pkg>/dist/aria-connector/src/connectors/claude-code.js
|
|
31
|
+
// (tsc preserves the src/ rooted layout under outDir). From this file:
|
|
32
|
+
// .. → src/
|
|
33
|
+
// .. → aria-connector/
|
|
34
|
+
// .. → dist/
|
|
35
|
+
// .. → <pkg>/
|
|
36
|
+
// Hooks ship at <pkg>/hooks/ → 4 ..s + 'hooks'.
|
|
37
|
+
// SDK bundled into <pkg>/dist/sdk/ at build time → 3 ..s + 'sdk'.
|
|
38
|
+
//
|
|
39
|
+
// Prior code used 3 ..s for hooks (landed at <pkg>/dist/hooks — missing)
|
|
40
|
+
// and 2 ..s for SDK (landed at <pkg>/dist/aria-connector/sdk — missing).
|
|
41
|
+
// Latent bug since the dist layout settled at this depth; caught by
|
|
42
|
+
// pre-publish smoke-test on 0.2.11. Per feedback_no_flag_without_fix.md
|
|
43
|
+
// the fix lands in the same turn as the discovery.
|
|
30
44
|
function packageHooksDir(): string {
|
|
31
45
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
32
|
-
return path.resolve(here, '..', '..', '..', 'hooks');
|
|
46
|
+
return path.resolve(here, '..', '..', '..', '..', 'hooks');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function packageSdkDir(): string {
|
|
50
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
51
|
+
return path.resolve(here, '..', '..', '..', 'sdk');
|
|
33
52
|
}
|
|
34
53
|
|
|
35
54
|
// Hook wiring for ~/.claude/settings.json. Mirrors what
|
|
@@ -128,6 +147,33 @@ function installHooks(claudeDir: string, logs: string[], opts: { force?: boolean
|
|
|
128
147
|
}
|
|
129
148
|
}
|
|
130
149
|
|
|
150
|
+
// Install bundled SDK to ~/.claude/aria-sdk/. Hooks dynamic-import from this
|
|
151
|
+
// absolute path, so every fetch (validateOutput, gardenTurn, getHarnessPacket,
|
|
152
|
+
// inject, checkAction) goes through the SDK control plane. Re-running connect
|
|
153
|
+
// idempotently overwrites with the latest bundled version.
|
|
154
|
+
function installSdk(claudeDir: string, logs: string[]): void {
|
|
155
|
+
const sdkSrc = packageSdkDir();
|
|
156
|
+
if (!existsSync(sdkSrc)) {
|
|
157
|
+
logs.push(`⚠ SDK bundle missing: ${sdkSrc} (run npm run build)`);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const sdkDst = path.join(claudeDir, 'aria-sdk');
|
|
161
|
+
if (!existsSync(sdkDst)) {
|
|
162
|
+
mkdirSync(sdkDst, { recursive: true, mode: 0o700 });
|
|
163
|
+
}
|
|
164
|
+
let copied = 0;
|
|
165
|
+
const fs = require('fs') as typeof import('fs');
|
|
166
|
+
for (const name of fs.readdirSync(sdkSrc)) {
|
|
167
|
+
const src = path.join(sdkSrc, name);
|
|
168
|
+
const stat = fs.statSync(src);
|
|
169
|
+
if (!stat.isFile()) continue;
|
|
170
|
+
const dst = path.join(sdkDst, name);
|
|
171
|
+
copyFileSync(src, dst);
|
|
172
|
+
copied++;
|
|
173
|
+
}
|
|
174
|
+
logs.push(`Installed Aria SDK (${copied} files) → ${sdkDst}`);
|
|
175
|
+
}
|
|
176
|
+
|
|
131
177
|
function isSamePath(a: string, b: string): boolean {
|
|
132
178
|
try { return path.resolve(a) === path.resolve(b); } catch { return false; }
|
|
133
179
|
}
|
|
@@ -254,6 +300,7 @@ export async function connectClaudeCode(
|
|
|
254
300
|
// what makes the connector a real runtime control plane rather than
|
|
255
301
|
// just a system-prompt addendum.
|
|
256
302
|
installHooks(claudeDir, logs, { force: opts.force });
|
|
303
|
+
installSdk(claudeDir, logs);
|
|
257
304
|
wireHooksBlock(settings, logs);
|
|
258
305
|
writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n', { mode: 0o600 });
|
|
259
306
|
|