@buildaharness/aielia 0.3.5 → 0.3.7
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/README.md +97 -19
- package/dist/action-approval-service.d.ts +34 -2
- package/dist/action-record.d.ts +13 -0
- package/dist/activity-log.d.ts +4 -0
- package/dist/agent-loop.d.ts +83 -1
- package/dist/assistant-session.d.ts +20 -1
- package/dist/assistant-types.d.ts +3 -1
- package/dist/assistant.d.ts +32 -0
- package/dist/{bin-CjKpxDxl.js → bin-C_hgDdSf.js} +369 -219
- package/dist/bin-C_hgDdSf.js.map +1 -0
- package/dist/cli-config.d.ts +3 -0
- package/dist/cli-session.d.ts +5 -4
- package/dist/cli.d.ts +9 -0
- package/dist/cli.js +1 -1
- package/dist/config.d.ts +3 -1
- package/dist/debug-log.d.ts +10 -1
- package/dist/email.d.ts +5 -3
- package/dist/file-tools-mcp-server.mjs +155 -30
- package/dist/file-tools.d.ts +2 -0
- package/dist/git-exclude.d.ts +9 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +127 -126
- package/dist/ink-select-prompt.d.ts +2 -0
- package/dist/ink-test-render.d.ts +2 -0
- package/dist/memory-service.d.ts +8 -0
- package/dist/next-step-proposer.d.ts +7 -0
- package/dist/plan-drafting-service.d.ts +3 -0
- package/dist/plan-store.d.ts +5 -0
- package/dist/{provider-setup-LFsaTkpf.js → provider-setup-wX2IBw2X.js} +2183 -919
- package/dist/provider-setup-wX2IBw2X.js.map +1 -0
- package/dist/reply-audit.d.ts +67 -0
- package/dist/side-call-policy.d.ts +30 -0
- package/dist/tool-step.d.ts +6 -0
- package/dist/trace-events.d.ts +1 -1
- package/dist/trust-tagging.d.ts +2 -0
- package/dist/{tui-app-BLR-PRFp.js → tui-app-C0J6HRzv.js} +127 -26
- package/dist/tui-app-C0J6HRzv.js.map +1 -0
- package/dist/tui-app.d.ts +35 -0
- package/dist/tui-mode-flag.d.ts +1 -1
- package/dist/turn-abort.d.ts +18 -0
- package/dist/turn-intent-classifier.d.ts +8 -0
- package/dist/turn-interpreter.d.ts +2 -0
- package/dist/version.d.ts +1 -1
- package/package.json +3 -3
- package/dist/bin-CjKpxDxl.js.map +0 -1
- package/dist/provider-setup-LFsaTkpf.js.map +0 -1
- package/dist/tui-app-BLR-PRFp.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import {
|
|
5
|
-
import { A, a, b, C, c, D, e, f, g, h, i, j, k, l, m,
|
|
4
|
+
import { bk as parseModelJson, a1 as classifyRiskLexical } from "./provider-setup-wX2IBw2X.js";
|
|
5
|
+
import { A, a, b, C, c, D, e, f, g, h, i, j, k, l, m, p, F, q, I, L, r, s, t, u, v, w, x, y, M, P, z, B, G, R, H, S, J, K, W, N, O, Q, T, U, V, X, Y, Z, _, $, a0, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ad, ae, af, ah, ai, aj, ak, al, am, an, ap, ar, as, at, au, aw, ax, az, aA, aC, aD, aF, aG, aJ, aL, aM, aN, aO, aQ, aR, aS, aT, aU, aV, aX, aY, aZ, a_, a$, b0, b1, b2, b3, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf, bg, bi, bl, bm, bn, bq, br, bs, bt, bu, bv, bw, bx, by, bz, bA, bB, bC, bD, bE, bF, bG, bI, bJ, bL, bN, bO, bP, bQ, bR, bS, bT, bU } from "./provider-setup-wX2IBw2X.js";
|
|
6
6
|
import { DEFAULT_LAYER_POLICY_MODE, MAX_OPTIONS_PER_QUESTION, MAX_QUESTIONS_PER_BATCH, MIN_OPTIONS_PER_QUESTION, validateAskResponse } from "@buildaharness/harness";
|
|
7
7
|
const PLAN_SCHEMA = {
|
|
8
8
|
type: "object",
|
|
@@ -156,143 +156,144 @@ export {
|
|
|
156
156
|
k as DEFAULT_ONE_LOOP_MODE,
|
|
157
157
|
l as DEFAULT_PLAN_GRAPH_MODE,
|
|
158
158
|
m as DEFAULT_PLAN_MODE,
|
|
159
|
-
|
|
159
|
+
p as EmailDeliveryError,
|
|
160
160
|
F as FETCH_URL_TOOL,
|
|
161
|
-
|
|
161
|
+
q as FILE_TOOLS,
|
|
162
162
|
I as InvalidEmailArgsError,
|
|
163
163
|
L as LAYER_DISPLAY_NAME,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
164
|
+
r as LAYER_ORDER,
|
|
165
|
+
s as LAYER_SETTINGS,
|
|
166
|
+
t as LAYER_SHORT_CODE,
|
|
167
|
+
u as LEXICAL_CHECK_FAMILIES,
|
|
168
|
+
v as LEXICAL_FAMILIES,
|
|
169
|
+
w as LIST_DIRECTORY_TOOL,
|
|
170
|
+
x as LayerSettingError,
|
|
171
|
+
y as LiveSteeringChannel,
|
|
172
172
|
MAX_OPTIONS_PER_QUESTION,
|
|
173
173
|
MAX_QUESTIONS_PER_BATCH,
|
|
174
174
|
M as MEMORY_WRITE_MODES,
|
|
175
175
|
MIN_OPTIONS_PER_QUESTION,
|
|
176
176
|
P as PROVIDER_SETUP,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
z as PathOutsideWorkspaceError,
|
|
178
|
+
B as PersonalAssistant,
|
|
179
|
+
G as PrivateNetworkTargetError,
|
|
180
180
|
R as READ_FILE_TOOL,
|
|
181
|
-
|
|
181
|
+
H as RUN_SHELL_COMMAND_TOOL,
|
|
182
182
|
S as SEMANTIC_ESCALATIONS,
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
J as SEND_EMAIL_TOOL,
|
|
184
|
+
K as SHELL_TOOLS,
|
|
185
185
|
W as WEB_SEARCH_TOOL,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
186
|
+
N as WEB_TOOLS,
|
|
187
|
+
O as WRITE_FILE_TOOL,
|
|
188
|
+
Q as abandonPlan,
|
|
189
|
+
T as applyLayerSettings,
|
|
190
|
+
U as applyPendingAction,
|
|
191
|
+
V as assertPublicHttpUrl,
|
|
192
|
+
X as braveSearch,
|
|
193
|
+
Y as buildClaudePrompt,
|
|
194
194
|
buildPlanFromTemplate,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
195
|
+
Z as buildWhyChain,
|
|
196
|
+
_ as checkApiKeyFormat,
|
|
197
|
+
$ as classifyError,
|
|
198
|
+
a0 as classifyRisk,
|
|
199
|
+
a2 as classifyToolYield,
|
|
200
|
+
a3 as classifyTurnIntent,
|
|
201
|
+
a4 as cleanApiKey,
|
|
202
|
+
a5 as computePlanPosition,
|
|
203
|
+
a6 as createPlanRecord,
|
|
204
|
+
a7 as createResendSender,
|
|
205
205
|
createScriptedLLMClient,
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
206
|
+
a8 as createSmtpSender,
|
|
207
|
+
a9 as decisionNote,
|
|
208
|
+
aa as decompositionReframeEnabled,
|
|
209
|
+
ab as defaultExportFilename,
|
|
210
|
+
ad as detectHomogeneousBatchList,
|
|
211
|
+
ae as discardPendingAction,
|
|
212
|
+
af as effectiveState,
|
|
213
|
+
ah as escalationEnabled,
|
|
214
|
+
ai as estimateCostUsd,
|
|
215
|
+
aj as executeActionTool,
|
|
216
|
+
ak as executeFileTool,
|
|
217
|
+
al as executeShellTool,
|
|
218
|
+
am as executeWebTool,
|
|
219
|
+
an as explicitEnvOverride,
|
|
220
|
+
ap as findLayer,
|
|
221
|
+
ar as formatCostSummary,
|
|
222
|
+
as as formatDoctorReport,
|
|
223
|
+
at as formatEmailApprovalReason,
|
|
224
|
+
au as formatGoalGraphState,
|
|
225
|
+
aw as formatLayerListing,
|
|
226
|
+
ax as formatMemoryArchive,
|
|
227
|
+
az as formatMemoryHistory,
|
|
228
|
+
aA as formatMemoryInjection,
|
|
229
|
+
aC as formatMemoryStatus,
|
|
230
|
+
aD as formatMemorySummary,
|
|
231
|
+
aF as formatPlanProgress,
|
|
232
|
+
aG as formatSearchResults,
|
|
233
|
+
aJ as formatTranscriptMarkdown,
|
|
234
|
+
aL as getProviderSetup,
|
|
235
|
+
aM as harnessGatePolicy,
|
|
236
|
+
aN as injectionDetectionEnabled,
|
|
237
|
+
aO as isAdaptivePolicyEnabled,
|
|
238
|
+
aQ as isGoalGraphEnabled,
|
|
239
|
+
aR as isGoalGraphSuggestEnabled,
|
|
240
|
+
aS as isLayerPolicyMode,
|
|
241
|
+
aT as isLikelyEmailAddress,
|
|
242
|
+
aU as isPlanGraphEnabled,
|
|
243
|
+
aV as isPolicyRecordingEnabled,
|
|
244
|
+
aX as isToggleable,
|
|
245
|
+
aY as lexicalActive,
|
|
246
|
+
aZ as lexicalOffEnvValue,
|
|
247
|
+
a_ as listTemplateNames,
|
|
248
|
+
a$ as loadActivePlan,
|
|
249
|
+
b0 as loadPendingAction,
|
|
250
|
+
b1 as loadTemplate,
|
|
251
|
+
b2 as lowerConfidenceSourceLines,
|
|
252
|
+
b3 as matchTemplateIfConfident,
|
|
253
|
+
b5 as memoryStatusChecks,
|
|
254
|
+
b6 as nextPendingTask,
|
|
255
|
+
b7 as nodeDisplayName,
|
|
256
|
+
b8 as nodeToLayer,
|
|
257
|
+
b9 as normalizeAmbiguityGuardMode,
|
|
258
|
+
ba as normalizeAskMode,
|
|
259
|
+
bb as normalizeGoalGraphMode,
|
|
260
|
+
bc as normalizeGoalGraphSuggestMode,
|
|
261
|
+
bd as normalizeLayerPolicyMode,
|
|
262
|
+
be as normalizeOneLoopMode,
|
|
263
|
+
bf as normalizePlanGraphMode,
|
|
264
|
+
bg as normalizePlanMode,
|
|
265
|
+
bi as parseClaudeCliOutput,
|
|
266
|
+
bl as pickTemplateForTask,
|
|
267
|
+
bm as planCompletionPct,
|
|
268
|
+
bn as planToSnapshot,
|
|
269
|
+
bq as resolveAmbiguityGuardMode,
|
|
270
|
+
br as resolveAskMode,
|
|
271
|
+
bs as resolveConfig,
|
|
272
|
+
bt as resolveEscalationPlan,
|
|
273
|
+
bu as resolveGoalGraphMode,
|
|
274
|
+
bv as resolveGoalGraphSuggestMode,
|
|
275
|
+
bw as resolveInWorkspace,
|
|
276
|
+
bx as resolveLayerPolicyMode,
|
|
277
|
+
by as resolveLayerPolicyModeFromConfig,
|
|
278
|
+
bz as resolveLexicalMode,
|
|
279
|
+
bA as resolveLexicalOff,
|
|
280
|
+
bB as resolveMemoryWriteMode,
|
|
281
|
+
bC as resolveOneLoopMode,
|
|
282
|
+
bD as resolvePlanGraphMode,
|
|
283
|
+
bE as resolvePlanMode,
|
|
284
|
+
bF as sanitizeLayerChoices,
|
|
285
|
+
bG as savePlan,
|
|
286
|
+
bI as stagePendingAction,
|
|
287
|
+
bJ as stagedActionInput,
|
|
288
|
+
bL as stripMcpToolPrefix,
|
|
289
|
+
bN as summarizeSettledToolStep,
|
|
290
|
+
bO as summarizeToolStep,
|
|
291
|
+
bP as syncHarnessLexicalEnv,
|
|
292
|
+
bQ as testApiKey,
|
|
293
|
+
bR as turnPolicyBudget,
|
|
294
|
+
bS as updatePlanFromRun,
|
|
294
295
|
validateAskResponse,
|
|
295
|
-
|
|
296
|
-
|
|
296
|
+
bT as validateConfig,
|
|
297
|
+
bU as withLayerChoice
|
|
297
298
|
};
|
|
298
299
|
//# sourceMappingURL=index.js.map
|
|
@@ -7,6 +7,8 @@ export interface SelectPromptProps {
|
|
|
7
7
|
/** Called once, with the chosen option's `key` — either Enter on the highlighted row, or a direct keystroke matching an option's `key`. */
|
|
8
8
|
onSubmit: (key: string) => void;
|
|
9
9
|
isActive?: boolean;
|
|
10
|
+
/** Keys arriving within this many ms of the prompt appearing are ignored: a key typed ahead for the previous turn (an Enter, a 'y') must not answer a question the user has not seen yet. Default 0 (no guard). */
|
|
11
|
+
armDelayMs?: number;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
12
14
|
* Phase 7 of the internal plan: an arrow-key + numbered/shortcut-key
|
|
@@ -17,6 +17,8 @@ export interface TestInkInstance {
|
|
|
17
17
|
lastFrame: () => string | undefined;
|
|
18
18
|
/** See `TestStdout.fullOutput`'s doc comment — needed to assert on `<Static>` content. */
|
|
19
19
|
fullOutput: () => string;
|
|
20
|
+
/** How many writes (frames and control sequences) the render has produced so far — constant while the UI is idle. */
|
|
21
|
+
writeCount: () => number;
|
|
20
22
|
rerender: (tree: ReactElement) => void;
|
|
21
23
|
unmount: () => void;
|
|
22
24
|
}
|
package/dist/memory-service.d.ts
CHANGED
|
@@ -350,7 +350,13 @@ export declare class MemoryService {
|
|
|
350
350
|
* (memory-write-gate.test.ts) asserts this is the only call in the file that writes the durable key.
|
|
351
351
|
*/
|
|
352
352
|
private commitDurable;
|
|
353
|
+
/** Tail of the in-process chain serialising the audit log's read-modify-write (concurrent appends lost entries and reused seq numbers). */
|
|
354
|
+
private auditChain;
|
|
355
|
+
/** Same for the usage flush's read-modify-write of the fact stores. */
|
|
356
|
+
private flushChain;
|
|
357
|
+
private serialized;
|
|
353
358
|
private appendAudit;
|
|
359
|
+
private appendAuditNow;
|
|
354
360
|
/** `/memory history` — newest last; the last `limit` entries. */
|
|
355
361
|
getAuditLog(limit?: number): Promise<AuditEntry[]>;
|
|
356
362
|
/**
|
|
@@ -487,6 +493,7 @@ export declare class MemoryService {
|
|
|
487
493
|
restoreArchivedFact(listIndex: number, sessionId?: string): Promise<UserFact | undefined>;
|
|
488
494
|
/** Writes the batched `injectedCount`/`lastInjectedAt` updates collected by budgeted renders, to whichever store(s) hold each fact. A no-op (no writes) when nothing was rendered. */
|
|
489
495
|
private flushInjectionUsage;
|
|
496
|
+
private flushInjectionUsageNow;
|
|
490
497
|
/**
|
|
491
498
|
* `/memory confirm <n>` — promotes the nth (1-based in `/memory`'s display, 0-based here) entry
|
|
492
499
|
* in PENDING_CONFIRMATION_KEY to DURABLE_FACTS_KEY. Runs the same promotion-time check as
|
|
@@ -535,6 +542,7 @@ export declare class MemoryService {
|
|
|
535
542
|
forgetArchived(index: number): Promise<UserFact | undefined>;
|
|
536
543
|
/** Strips one fact's pre/post-images from the audit log (entries stay, marked `erased`, and can no longer be undone) and unlinks `supersedes` references to it. */
|
|
537
544
|
private eraseFromAuditLog;
|
|
545
|
+
private eraseFromAuditLogNow;
|
|
538
546
|
/** Read-only health snapshot (`/doctor`, memory panel). Never touches usage counters or the last-injection record. */
|
|
539
547
|
getMemoryStatus(sessionId: string): Promise<MemoryStatus>;
|
|
540
548
|
/** M3 (D4): `/memory forget digest <id>` or, with no id, every digest. Returns how many were removed. */
|
|
@@ -27,6 +27,13 @@ export interface SuggestedNextStepNode {
|
|
|
27
27
|
promotion: SuggestionPromotion;
|
|
28
28
|
createdAt: string;
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Names the language the suggestions must be written in. The model drifted into Chinese, Spanish or French
|
|
32
|
+
* on English conversations when it was only told to "match the user's language", so English is named
|
|
33
|
+
* outright when the user's own text clearly is English (two distinct common English words); anything else
|
|
34
|
+
* keeps the generic instruction.
|
|
35
|
+
*/
|
|
36
|
+
export declare function suggestionLanguage(userTexts: string[]): string;
|
|
30
37
|
/** Q10's three-way policy shape, applied to this mechanism's own confidence rubric — see this module's doc comment on why the bands aren't reused from `shouldAutoPromote()`. */
|
|
31
38
|
export declare function classifySuggestionPromotion(confidence: SuggestionConfidence): SuggestionPromotion;
|
|
32
39
|
/**
|
|
@@ -68,6 +68,9 @@ export declare class PlanDraftingService {
|
|
|
68
68
|
private readonly memory?;
|
|
69
69
|
constructor(planService: PlanService, session: AssistantSession, llmClient: ILLMClient, model: () => string | undefined, planApproval: PlanApprovalService, onTrace: ((event: TraceEvent) => void) | undefined, agentLoop?: Pick<AgentLoop, "runSupervisorInvestigation"> | undefined, memory?: MemoryAdapter | undefined);
|
|
70
70
|
private planAskPendingKey;
|
|
71
|
+
/** Points at the one nested question a session's draft currently has staged, so cancelling the draft (or staging a newer question) can drop it. */
|
|
72
|
+
private planAskSessionKey;
|
|
73
|
+
private dropStagedAsk;
|
|
71
74
|
/** Peeked by `assistant.ts`'s runTurn before it decides whether a `pendingClarificationId` belongs to this nested-ask side channel (P8) or AskClarificationService's harness-resume path (Q2) — the two staging stores are otherwise independent, so an opaque ID has no other way to say which one it came from. */
|
|
72
75
|
isPendingAsk(id: string): Promise<boolean>;
|
|
73
76
|
/**
|
package/dist/plan-store.d.ts
CHANGED
|
@@ -102,6 +102,11 @@ export interface PlanFsPersistence {
|
|
|
102
102
|
backend: FsBackend;
|
|
103
103
|
workspaceRoot: string;
|
|
104
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Removes the session's mirrored plan files. `loadPlanRecord` prefers the file over the memory record,
|
|
107
|
+
* so deleting only the memory record (`/new`) let the old plan come straight back. Never throws.
|
|
108
|
+
*/
|
|
109
|
+
export declare function deletePlanFiles(fsPersistence: PlanFsPersistence, sessionId: string): Promise<void>;
|
|
105
110
|
/**
|
|
106
111
|
* Reads `sessionId`'s stored plan record regardless of `mode` — unlike `loadActivePlan`, which
|
|
107
112
|
* filters to `mode === 'active'` only. Plan mode's P1 drafting path needs to resume a
|