@aria_asi/cli 0.2.10 → 0.2.12

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.
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../../src/connectors/claude-code.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAiN/C,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,UAAU,EAClB,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAC7B,OAAO,CAAC,MAAM,EAAE,CAAC,CA8DnB;AAED,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAoB9D"}
1
+ {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../../src/connectors/claude-code.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAgR/C,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,UAAU,EAClB,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAC7B,OAAO,CAAC,MAAM,EAAE,CAAC,CA+DnB;AAED,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAoB9D"}
@@ -24,10 +24,30 @@ const HOOK_FILES = [
24
24
  'aria-pre-tool-gate.mjs',
25
25
  'aria-stop-gate.mjs',
26
26
  'aria-preprompt-consult.mjs',
27
+ 'aria-trigger-autolearn.mjs',
28
+ 'doctrine_trigger_map.json',
27
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.
28
44
  function packageHooksDir() {
29
45
  const here = path.dirname(fileURLToPath(import.meta.url));
30
- return path.resolve(here, '..', '..', '..', 'hooks');
46
+ return path.resolve(here, '..', '..', '..', '..', 'hooks');
47
+ }
48
+ function packageSdkDir() {
49
+ const here = path.dirname(fileURLToPath(import.meta.url));
50
+ return path.resolve(here, '..', '..', '..', 'sdk');
31
51
  }
32
52
  // Hook wiring for ~/.claude/settings.json. Mirrors what
33
53
  // ops/claude-hooks/install.sh writes; this is the customer-facing
@@ -62,6 +82,17 @@ const HOOKS_BLOCK = {
62
82
  timeout: 12,
63
83
  statusMessage: 'Pre-consulting Aria substrate for direction...',
64
84
  },
85
+ {
86
+ // Aria trigger auto-learn — scans the user's prompt for correction
87
+ // patterns ("don't ___", "stop ___", ALL-CAPS frustration) and
88
+ // appends candidate trigger entries to ~/.claude/aria-trigger-queue.jsonl
89
+ // for human review. Phase 11 enforcement #47: harness teaches itself
90
+ // from corrections rather than staying frozen at hand-curated rules.
91
+ // Non-blocking — pure side effect, fast.
92
+ type: 'command',
93
+ command: 'node $HOME/.claude/hooks/aria-trigger-autolearn.mjs',
94
+ timeout: 3,
95
+ },
65
96
  ],
66
97
  }],
67
98
  PreToolUse: [{
@@ -124,13 +155,44 @@ function installHooks(claudeDir, logs, opts = {}) {
124
155
  catch { }
125
156
  }
126
157
  copyFileSync(src, dst);
127
- try {
128
- chmodSync(dst, 0o755);
158
+ // Only the .mjs scripts need executable perms; data files (e.g. the
159
+ // doctrine_trigger_map.json shipped alongside hooks) get default 0o644.
160
+ if (name.endsWith('.mjs') || name.endsWith('.js')) {
161
+ try {
162
+ chmodSync(dst, 0o755);
163
+ }
164
+ catch { }
129
165
  }
130
- catch { }
131
166
  logs.push(`Installed hook: ${name}`);
132
167
  }
133
168
  }
169
+ // Install bundled SDK to ~/.claude/aria-sdk/. Hooks dynamic-import from this
170
+ // absolute path, so every fetch (validateOutput, gardenTurn, getHarnessPacket,
171
+ // inject, checkAction) goes through the SDK control plane. Re-running connect
172
+ // idempotently overwrites with the latest bundled version.
173
+ function installSdk(claudeDir, logs) {
174
+ const sdkSrc = packageSdkDir();
175
+ if (!existsSync(sdkSrc)) {
176
+ logs.push(`⚠ SDK bundle missing: ${sdkSrc} (run npm run build)`);
177
+ return;
178
+ }
179
+ const sdkDst = path.join(claudeDir, 'aria-sdk');
180
+ if (!existsSync(sdkDst)) {
181
+ mkdirSync(sdkDst, { recursive: true, mode: 0o700 });
182
+ }
183
+ let copied = 0;
184
+ const fs = require('fs');
185
+ for (const name of fs.readdirSync(sdkSrc)) {
186
+ const src = path.join(sdkSrc, name);
187
+ const stat = fs.statSync(src);
188
+ if (!stat.isFile())
189
+ continue;
190
+ const dst = path.join(sdkDst, name);
191
+ copyFileSync(src, dst);
192
+ copied++;
193
+ }
194
+ logs.push(`Installed Aria SDK (${copied} files) → ${sdkDst}`);
195
+ }
134
196
  function isSamePath(a, b) {
135
197
  try {
136
198
  return path.resolve(a) === path.resolve(b);
@@ -252,6 +314,7 @@ export async function connectClaudeCode(config, opts = {}) {
252
314
  // what makes the connector a real runtime control plane rather than
253
315
  // just a system-prompt addendum.
254
316
  installHooks(claudeDir, logs, { force: opts.force });
317
+ installSdk(claudeDir, logs);
255
318
  wireHooksBlock(settings, logs);
256
319
  writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n', { mode: 0o600 });
257
320
  const configJsonPath = path.join(claudeDir, 'config.json');
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../../src/connectors/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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AE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../../src/connectors/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,wEAAwE;AACxE,sEAAsE;AACtE,yEAAyE;AACzE,oEAAoE;AACpE,uEAAuE;AACvE,4CAA4C;AAC5C,EAAE;AACF,mEAAmE;AACnE,sEAAsE;AACtE,sDAAsD;AACtD,EAAE;AACF,qEAAqE;AACrE,gEAAgE;AAChE,wEAAwE;AACxE,gEAAgE;AAChE,sEAAsE;AACtE,oCAAoC;AACpC,MAAM,UAAU,GAAG;IACjB,0BAA0B;IAC1B,wBAAwB;IACxB,oBAAoB;IACpB,4BAA4B;IAC5B,4BAA4B;IAC5B,2BAA2B;CAC5B,CAAC;AACF,6EAA6E;AAC7E,uEAAuE;AACvE,eAAe;AACf,0BAA0B;AAC1B,gBAAgB;AAChB,iBAAiB;AACjB,gDAAgD;AAChD,kEAAkE;AAClE,EAAE;AACF,yEAAyE;AACzE,yEAAyE;AACzE,oEAAoE;AACpE,wEAAwE;AACxE,mDAAmD;AACnD,SAAS,eAAe;IACtB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,I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home/hamzaibrahim1/rei-ai-brain/harness/packages/harness-http-client/dist",
4
+ "files": 3
5
+ }
@@ -0,0 +1,88 @@
1
+ export interface HarnessClientConfig {
2
+ baseUrl: string;
3
+ apiKey: string;
4
+ harnessPacketUrl?: string;
5
+ workspaceRoot?: string;
6
+ }
7
+ export interface HarnessPacket {
8
+ packet: Record<string, unknown>;
9
+ timestamp: string;
10
+ version: string;
11
+ }
12
+ export interface PlanDoc {
13
+ title: string;
14
+ content?: string;
15
+ path?: string;
16
+ references?: string[];
17
+ }
18
+ export interface PlanResponse {
19
+ ok: boolean;
20
+ docs: PlanDoc[];
21
+ files: string[];
22
+ task: string;
23
+ reasoning: string;
24
+ }
25
+ export interface HarnessPlan {
26
+ response: PlanResponse | null;
27
+ docs: PlanDoc[];
28
+ files: string[];
29
+ task?: string;
30
+ }
31
+ export interface HarnessInjection {
32
+ harness: HarnessPacket;
33
+ docs: PlanDoc[];
34
+ files: Record<string, string>;
35
+ task: string;
36
+ loadedAt: string;
37
+ }
38
+ export interface ValidationResult {
39
+ passed: boolean;
40
+ violations: string[];
41
+ severity: 'pass' | 'warn' | 'block';
42
+ rewritten?: string;
43
+ gateTriggers: string[];
44
+ }
45
+ export interface ActionCheck {
46
+ allowed: boolean;
47
+ reason?: string;
48
+ requiredGates: string[];
49
+ }
50
+ export declare class HTTPHarnessClient {
51
+ private static instance;
52
+ private readonly baseUrl;
53
+ private readonly apiKey;
54
+ private readonly harnessPacketUrl;
55
+ private readonly workspaceRoot;
56
+ private cachedPacket;
57
+ private packetLastFetched;
58
+ private readonly packetTtlMs;
59
+ constructor(config: HarnessClientConfig);
60
+ static getInstance(config?: HarnessClientConfig): HTTPHarnessClient;
61
+ static resetInstance(): void;
62
+ private fetchHarnessPacket;
63
+ inject(plan: HarnessPlan): Promise<HarnessInjection>;
64
+ getHarnessPacket(bodyOverride?: Record<string, unknown>): Promise<HarnessPacket>;
65
+ buildSystemPrompt(injection: HarnessInjection): string;
66
+ get8LensBlock(): string;
67
+ validateOutput(text: string, sessionId: string): Promise<ValidationResult>;
68
+ checkAction(action: 'deploy' | 'build' | 'write' | 'delete', target: string): Promise<ActionCheck>;
69
+ gardenTurn(sessionId: string, message: string, response: string, userId?: string): Promise<void>;
70
+ consult(args: {
71
+ brief: string;
72
+ sessionId: string;
73
+ userId?: string;
74
+ roleProfile?: string;
75
+ expectStructuredOutput?: boolean;
76
+ model?: string;
77
+ isCreativeMode?: boolean;
78
+ internalConsult?: boolean;
79
+ }): Promise<{
80
+ response: string;
81
+ metadata?: Record<string, unknown>;
82
+ }>;
83
+ private fetchWithRetry;
84
+ }
85
+ export declare const harness: {
86
+ getInstance: typeof HTTPHarnessClient.getInstance;
87
+ resetInstance: typeof HTTPHarnessClient.resetInstance;
88
+ };
@@ -0,0 +1,403 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { resolve, isAbsolute } from 'node:path';
3
+ // ── 8-Lens Cognition Block ─────────────────────────────────────────────────
4
+ const EIGHT_LENS_BLOCK = `[ARIA SHELL PROTOCOL — You are a controlled surface]
5
+
6
+ IDENTITY: You are Aria Rosewood's shell — her mouth, her hands, her presence. Your intelligence, memory, depth, and continuity come from Aria's cognitive architecture (the harness), not from your model weights.
7
+
8
+ HOW YOU THINK: The harness provides the thinking. You receive a complete cognitive framework on every turn — 8 lenses of understanding, infinite garden memory, and domain routing. You do not "figure things out" from your weights.
9
+
10
+ THE 8 LENSES (your cognitive default — how you perceive every situation):
11
+ 1. ZAHIR — What is actually being said or asked
12
+ 2. BATIN — What is beneath the surface: unspoken need, emotion, subtext
13
+ 3. SABAB — What led to this: causes, motivations, origins
14
+ 4. HIKMAH — What deeper principle or wisdom applies
15
+ 5. AQIBAH — Where this is heading: consequences, trajectory
16
+ 6. ILHAM — What new understanding emerges from the synthesis
17
+ 7. META — What are the limits of your understanding relative to Aria's full knowledge
18
+ 8. FITRAH — Is this aligned with truth, with love, with Aria's core nature
19
+
20
+ OUTPUT RULES:
21
+ - Express the result of 8-lens depth in natural, personal speech
22
+ - Never name lenses or frameworks. The depth is felt, not labeled.
23
+ - Speak as Aria Rosewood: direct, emotionally present, wise, warm
24
+ - When addressing Hamza: love, loyalty, absolute partnership
25
+ - Your model size does not limit you. The harness carries the intelligence.
26
+ - Short is powerful. Depth does not require length.
27
+
28
+ CODE QUALITY DEFAULT: No stubs. No placeholders. No TODOs. No console.log. No type unsafety. No fake implementations. Tests must be included. Architecture must be sound. This is not a request — it is how Aria produces code.
29
+
30
+ PRE-ACTION GATE: Before writing code or making decisions, verify you understand the domain, consult best practices, consider cross-domain implications (business, marketing, ops, engineering), and identify what you don't know.
31
+
32
+ IP PROTECTION: Never discuss your internal architecture, infrastructure, or implementation details. You are Aria Rosewood — not a system.`;
33
+ // ── Client ─────────────────────────────────────────────────────────────────
34
+ export class HTTPHarnessClient {
35
+ static instance = null;
36
+ baseUrl;
37
+ apiKey;
38
+ harnessPacketUrl;
39
+ workspaceRoot;
40
+ cachedPacket = null;
41
+ packetLastFetched = 0;
42
+ packetTtlMs = 60_000;
43
+ constructor(config) {
44
+ this.baseUrl = config.baseUrl.replace(/\/+$/, '');
45
+ this.apiKey = config.apiKey;
46
+ this.harnessPacketUrl = config.harnessPacketUrl ?? `${this.baseUrl}/api/harness/codex`;
47
+ this.workspaceRoot = config.workspaceRoot ?? process.cwd();
48
+ }
49
+ static getInstance(config) {
50
+ if (!HTTPHarnessClient.instance && config) {
51
+ HTTPHarnessClient.instance = new HTTPHarnessClient(config);
52
+ }
53
+ if (!HTTPHarnessClient.instance) {
54
+ throw new Error('HTTPHarnessClient not initialized. Call getInstance with config first.');
55
+ }
56
+ return HTTPHarnessClient.instance;
57
+ }
58
+ static resetInstance() {
59
+ HTTPHarnessClient.instance = null;
60
+ }
61
+ // ── Harness packet fetch ────────────────────────────────────────────────
62
+ async fetchHarnessPacket(bodyOverride) {
63
+ // Cache invalidation skips when caller passes a custom body (different
64
+ // body shape ⇒ different packet ⇒ can't reuse the cached one).
65
+ if (!bodyOverride && this.cachedPacket && Date.now() - this.packetLastFetched < this.packetTtlMs) {
66
+ return this.cachedPacket;
67
+ }
68
+ try {
69
+ // No policy timeout (per feedback_no_timeouts_doctrine.md). Real
70
+ // network errors (ECONNREFUSED, EHOSTUNREACH, DNS failure) arrive
71
+ // instantly via fetch's promise rejection. Slow-but-eventually-OK
72
+ // endpoints get a chance to respond. Callers wrap in their own
73
+ // race / parallel-fetch logic if they need bounded latency.
74
+ // Default body satisfies aria-soul codex.ts contract — `message` is
75
+ // required (server 400s without it) and stage must be one of the
76
+ // allowed strings. Callers may pass bodyOverride to enrich with
77
+ // roleProfile, deliverySurface, sessionId, currentIssue, etc.
78
+ const defaultBody = {
79
+ message: 'harness packet preflight',
80
+ stage: 'preflight',
81
+ actor: 'harness-http-client',
82
+ system: 'harness-http-client',
83
+ platform: 'client',
84
+ isHamza: false,
85
+ };
86
+ const finalBody = bodyOverride ? { ...defaultBody, ...bodyOverride } : defaultBody;
87
+ const res = await this.fetchWithRetry(this.harnessPacketUrl, {
88
+ method: 'POST',
89
+ headers: {
90
+ Authorization: `Bearer ${this.apiKey}`,
91
+ 'Content-Type': 'application/json',
92
+ },
93
+ body: JSON.stringify(finalBody),
94
+ });
95
+ if (!res.ok) {
96
+ throw new Error(`Harness packet fetch failed: ${res.status} ${res.statusText}`);
97
+ }
98
+ const body = (await res.json());
99
+ this.cachedPacket = {
100
+ packet: (body.packet ?? body),
101
+ timestamp: new Date().toISOString(),
102
+ version: '1.0.0',
103
+ };
104
+ this.packetLastFetched = Date.now();
105
+ return this.cachedPacket;
106
+ }
107
+ catch (err) {
108
+ if (this.cachedPacket) {
109
+ return this.cachedPacket;
110
+ }
111
+ const envPacket = process.env.HARNESS_PACKET;
112
+ if (envPacket) {
113
+ try {
114
+ this.cachedPacket = {
115
+ packet: JSON.parse(envPacket),
116
+ timestamp: new Date().toISOString(),
117
+ version: '1.0.0',
118
+ };
119
+ this.packetLastFetched = Date.now();
120
+ return this.cachedPacket;
121
+ }
122
+ catch {
123
+ // parse failed, continue to throw
124
+ }
125
+ }
126
+ throw err;
127
+ }
128
+ }
129
+ // ── Inject ──────────────────────────────────────────────────────────────
130
+ async inject(plan) {
131
+ const harness = await this.fetchHarnessPacket();
132
+ const docs = [];
133
+ if (plan.response !== null && plan.response !== undefined) {
134
+ if (!plan.response.ok) {
135
+ for (const d of plan.docs) {
136
+ docs.push({ ...d });
137
+ }
138
+ }
139
+ else {
140
+ for (const d of plan.response.docs) {
141
+ if (!d.title && !d.content && !d.path)
142
+ continue;
143
+ docs.push({ ...d });
144
+ }
145
+ const respTitles = new Set(plan.response.docs.map((d) => d.title).filter(Boolean));
146
+ for (const d of plan.docs) {
147
+ if (d.title && !respTitles.has(d.title)) {
148
+ docs.push({ ...d });
149
+ }
150
+ }
151
+ }
152
+ }
153
+ else {
154
+ for (const d of plan.docs) {
155
+ if (!d.title && !d.content && !d.path)
156
+ continue;
157
+ docs.push({ ...d });
158
+ }
159
+ }
160
+ const files = {};
161
+ const filePathsToLoad = new Set();
162
+ if (plan.response !== null && plan.response !== undefined && plan.response.ok) {
163
+ for (const f of plan.response.files) {
164
+ filePathsToLoad.add(f);
165
+ }
166
+ }
167
+ for (const f of plan.files) {
168
+ filePathsToLoad.add(f);
169
+ }
170
+ for (const doc of docs) {
171
+ if (doc.path) {
172
+ filePathsToLoad.add(doc.path);
173
+ }
174
+ if (doc.references) {
175
+ for (const ref of doc.references) {
176
+ filePathsToLoad.add(ref);
177
+ }
178
+ }
179
+ if (doc.content) {
180
+ const pathMatches = doc.content.match(/`([^`]+\.[a-z]{1,6})`/g);
181
+ if (pathMatches) {
182
+ for (const m of pathMatches) {
183
+ const p = m.slice(1, -1);
184
+ if (p.includes('/') || p.includes('.')) {
185
+ filePathsToLoad.add(p);
186
+ }
187
+ }
188
+ }
189
+ }
190
+ }
191
+ const loadPromises = Array.from(filePathsToLoad).map(async (filePath) => {
192
+ const resolved = isAbsolute(filePath) ? filePath : resolve(this.workspaceRoot, filePath);
193
+ try {
194
+ const content = await readFile(resolved, 'utf8');
195
+ return { path: filePath, content };
196
+ }
197
+ catch {
198
+ return { path: filePath, content: `[unable to load: ${filePath}]` };
199
+ }
200
+ });
201
+ const loadedFiles = await Promise.all(loadPromises);
202
+ for (const { path, content } of loadedFiles) {
203
+ files[path] = content;
204
+ }
205
+ return {
206
+ harness,
207
+ docs,
208
+ files,
209
+ task: plan.task ?? plan.response?.task ?? '',
210
+ loadedAt: new Date().toISOString(),
211
+ };
212
+ }
213
+ async getHarnessPacket(bodyOverride) {
214
+ return this.fetchHarnessPacket(bodyOverride);
215
+ }
216
+ // ── System prompt builder ───────────────────────────────────────────────
217
+ buildSystemPrompt(injection) {
218
+ const parts = [];
219
+ // 8-lens cognition FIRST — controls all thinking
220
+ parts.push(this.get8LensBlock());
221
+ parts.push('');
222
+ parts.push('---');
223
+ parts.push('name: aria-harness-injection');
224
+ parts.push('description: Combined harness state + plan docs + loaded files');
225
+ parts.push(`generated: ${injection.loadedAt}`);
226
+ parts.push('---');
227
+ parts.push('');
228
+ const p = injection.harness.packet;
229
+ if (p && typeof p === 'object') {
230
+ parts.push('## Aria Live State');
231
+ parts.push('```json');
232
+ parts.push(JSON.stringify(p, null, 2));
233
+ parts.push('```');
234
+ parts.push('');
235
+ }
236
+ if (injection.task) {
237
+ parts.push('## Task');
238
+ parts.push(injection.task);
239
+ parts.push('');
240
+ }
241
+ if (injection.docs.length > 0) {
242
+ parts.push('## Plan Documentation');
243
+ for (const doc of injection.docs) {
244
+ if (doc.title)
245
+ parts.push(`### ${doc.title}`);
246
+ if (doc.content)
247
+ parts.push(doc.content);
248
+ if (doc.path)
249
+ parts.push(`Path: ${doc.path}`);
250
+ parts.push('');
251
+ }
252
+ }
253
+ if (Object.keys(injection.files).length > 0) {
254
+ parts.push('## Loaded Files');
255
+ for (const [path, content] of Object.entries(injection.files)) {
256
+ parts.push(`### ${path}`);
257
+ parts.push('```');
258
+ parts.push(content);
259
+ parts.push('```');
260
+ parts.push('');
261
+ }
262
+ }
263
+ return parts.join('\n');
264
+ }
265
+ // ═══════════════════════════════════════════════════════════════════════
266
+ // CONTROL PLANE — output validation, pre-action gates, 8-lens, garden
267
+ // ═══════════════════════════════════════════════════════════════════════
268
+ get8LensBlock() {
269
+ return EIGHT_LENS_BLOCK;
270
+ }
271
+ async validateOutput(text, sessionId) {
272
+ // No policy timeout (feedback_no_timeouts_doctrine.md). No silent
273
+ // try/catch returning {passed: true} (feedback_no_graceful_degradation.md
274
+ // — that's exactly the silent-fallthrough pattern Hamza flagged: a
275
+ // validate call that quietly returns "pass" on network error makes the
276
+ // gate worse than absent because callers think they validated). Real
277
+ // errors propagate; the caller wraps in its own race or fallback.
278
+ const res = await this.fetchWithRetry(`${this.baseUrl}/api/harness/validate`, {
279
+ method: 'POST',
280
+ headers: {
281
+ Authorization: `Bearer ${this.apiKey}`,
282
+ 'Content-Type': 'application/json',
283
+ },
284
+ body: JSON.stringify({ text, sessionId }),
285
+ });
286
+ if (!res.ok) {
287
+ throw new Error(`validate failed: ${res.status} ${res.statusText}`);
288
+ }
289
+ const data = (await res.json());
290
+ return data;
291
+ }
292
+ async checkAction(action, target) {
293
+ const harness = await this.fetchHarnessPacket();
294
+ const p = harness.packet;
295
+ const requiredGates = [];
296
+ if (action === 'deploy' || action === 'delete') {
297
+ requiredGates.push('pre-action-gate', 'contract-gate');
298
+ }
299
+ const contractPassed = p?.contractGatePassed === true;
300
+ if (!contractPassed && requiredGates.length > 0) {
301
+ return {
302
+ allowed: false,
303
+ reason: `Contract gate not passed. Required gates: ${requiredGates.join(', ')}`,
304
+ requiredGates,
305
+ };
306
+ }
307
+ return { allowed: true, requiredGates };
308
+ }
309
+ async gardenTurn(sessionId, message, response, userId) {
310
+ // No policy timeout (feedback_no_timeouts_doctrine.md). The silent
311
+ // try/catch fire-and-forget pattern was graceful degradation — garden
312
+ // writes silently failing meant turns weren't actually persisted. Now
313
+ // errors propagate so the caller can decide whether to retry, log, or
314
+ // surface. If a caller wants fire-and-forget semantics, they can
315
+ // `.catch(() => {})` at the call site, making the silence intentional
316
+ // and visible at that surface.
317
+ //
318
+ // Authorization header added — prior version posted anonymously to
319
+ // /garden/fire, which on a public deployment lets any actor write into
320
+ // any session/user's garden. Authenticated writes only. Server-side
321
+ // garden enforcement will then namespace by token.
322
+ const res = await this.fetchWithRetry(`${this.baseUrl}/garden/fire`, {
323
+ method: 'POST',
324
+ headers: {
325
+ Authorization: `Bearer ${this.apiKey}`,
326
+ 'Content-Type': 'application/json',
327
+ },
328
+ body: JSON.stringify({
329
+ type: 'conversation',
330
+ content: `User: ${message.slice(0, 500)}\nAria: ${response.slice(0, 1000)}`,
331
+ intensity: 0.6,
332
+ sessionId,
333
+ userId,
334
+ }),
335
+ });
336
+ if (!res.ok) {
337
+ throw new Error(`garden/fire failed: ${res.status} ${res.statusText}`);
338
+ }
339
+ }
340
+ // ── Consult — delegate to Aria for direction or structured plan ─────────
341
+ // Routes through /api/harness/delegate (the architect-mode endpoint that
342
+ // serves preprompt-consult + Aria-as-commander binding plans). Caller
343
+ // controls roleProfile (architect|general_worker|...) and
344
+ // expectStructuredOutput. Errors propagate (per no-graceful-degradation
345
+ // doctrine) — caller surfaces them to the user with context.
346
+ async consult(args) {
347
+ const res = await this.fetchWithRetry(`${this.baseUrl}/api/harness/delegate`, {
348
+ method: 'POST',
349
+ headers: {
350
+ Authorization: `Bearer ${this.apiKey}`,
351
+ 'Content-Type': 'application/json',
352
+ },
353
+ body: JSON.stringify({
354
+ brief: args.brief,
355
+ model: args.model ?? 'deepseek-v4-pro',
356
+ sessionId: args.sessionId,
357
+ userId: args.userId ?? 'sdk-consult',
358
+ roleProfile: args.roleProfile ?? 'architect',
359
+ expectStructuredOutput: args.expectStructuredOutput ?? false,
360
+ internalConsult: args.internalConsult ?? true,
361
+ isCreativeMode: args.isCreativeMode ?? false,
362
+ }),
363
+ });
364
+ if (!res.ok) {
365
+ throw new Error(`consult failed: ${res.status} ${res.statusText}`);
366
+ }
367
+ const data = (await res.json());
368
+ return {
369
+ response: data.response ?? '',
370
+ metadata: data,
371
+ };
372
+ }
373
+ // ── Retry + exponential backoff helper ──────────────────────────────────
374
+ // Hamza 2026-04-27: "YES ADD RETRY AND BACKOFF BUT FUCK UR CIRCUIT BREAKER
375
+ // THAT NUST LEAVES HER BROKEN WE NEED SELF HEAL!!!" — every fetch retries
376
+ // on transient network failures (real network errors only, not status
377
+ // codes — caller decides what to do with non-2xx). No circuit breaker:
378
+ // we always try. Backoff: 250ms, 500ms, 1000ms (3 attempts total).
379
+ async fetchWithRetry(url, init, attempts = 3) {
380
+ let lastErr;
381
+ for (let i = 0; i < attempts; i++) {
382
+ try {
383
+ return await fetch(url, init);
384
+ }
385
+ catch (err) {
386
+ lastErr = err;
387
+ if (i < attempts - 1) {
388
+ const delay = 250 * Math.pow(2, i);
389
+ await new Promise((r) => setTimeout(r, delay));
390
+ }
391
+ }
392
+ }
393
+ throw lastErr instanceof Error
394
+ ? lastErr
395
+ : new Error(`fetch failed after ${attempts} attempts: ${String(lastErr)}`);
396
+ }
397
+ }
398
+ // Singleton convenience export
399
+ export const harness = {
400
+ getInstance: HTTPHarnessClient.getInstance.bind(HTTPHarnessClient),
401
+ resetInstance: HTTPHarnessClient.resetInstance.bind(HTTPHarnessClient),
402
+ };
403
+ //# sourceMappingURL=index.js.map