@buildaharness/aielia 0.3.4 → 0.3.6
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 +156 -35
- package/dist/PlanGraphPane.d.ts +19 -0
- package/dist/_memory-core-generated.d.ts +1764 -0
- 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 +106 -9
- package/dist/ambiguity-guard-flag.d.ts +12 -0
- package/dist/ambiguity-guard.d.ts +20 -0
- package/dist/answer-claim.d.ts +13 -1
- package/dist/ask-clarification-service.d.ts +12 -1
- package/dist/ask-response-format.d.ts +6 -0
- package/dist/assistant-session.d.ts +32 -2
- package/dist/assistant-source.d.ts +7 -0
- package/dist/assistant-types.d.ts +20 -2
- package/dist/assistant.d.ts +160 -6
- package/dist/benchmark-injected-failure.d.ts +6 -0
- package/dist/bin-BYRl4xXM.js +4985 -0
- package/dist/bin-BYRl4xXM.js.map +1 -0
- package/dist/cli-config.d.ts +3 -0
- package/dist/cli-session.d.ts +19 -5
- package/dist/cli.d.ts +26 -2
- package/dist/cli.js +1 -1
- package/dist/code-plan-templates.d.ts +21 -0
- package/dist/config.d.ts +31 -0
- package/dist/constraint-check.d.ts +35 -0
- package/dist/contradiction-checker.d.ts +7 -0
- package/dist/debug-log.d.ts +10 -1
- package/dist/decomposed-answer.d.ts +13 -0
- package/dist/decomposition-classifier.d.ts +2 -0
- package/dist/doctor-checks.d.ts +3 -0
- package/dist/email.d.ts +5 -3
- package/dist/episodic-digest.d.ts +89 -0
- package/dist/fact-extraction.d.ts +39 -0
- package/dist/file-tools-mcp-server.mjs +288 -37
- package/dist/file-tools.d.ts +6 -0
- package/dist/first-run.d.ts +0 -2
- package/dist/git-exclude.d.ts +9 -0
- package/dist/goal-graph-store.d.ts +18 -18
- package/dist/grounding-check.d.ts +33 -0
- package/dist/harness-bridge.d.ts +75 -2
- package/dist/harness-token-budget.d.ts +9 -0
- package/dist/index.d.ts +21 -2
- package/dist/index.js +166 -94
- package/dist/index.js.map +1 -1
- package/dist/ink-select-prompt.d.ts +2 -0
- package/dist/ink-test-render.d.ts +2 -0
- package/dist/layer-policy-flag.d.ts +13 -0
- package/dist/layer-policy-wiring.d.ts +77 -0
- package/dist/layer-settings.d.ts +49 -0
- package/dist/layer-telemetry.d.ts +2 -0
- package/dist/lexical/lexical-mode.d.ts +29 -0
- package/dist/memory-consolidation.d.ts +80 -0
- package/dist/memory-governance.d.ts +30 -0
- package/dist/memory-reviewer.d.ts +114 -0
- package/dist/memory-service.d.ts +356 -9
- package/dist/model-json.d.ts +17 -0
- package/dist/next-step-context.d.ts +51 -0
- package/dist/next-step-proposer.d.ts +10 -2
- package/dist/plan-drafting-service.d.ts +3 -0
- package/dist/plan-graph-flag.d.ts +20 -0
- package/dist/plan-question.d.ts +60 -0
- package/dist/plan-service.d.ts +6 -2
- package/dist/plan-step-prompt.d.ts +15 -0
- package/dist/plan-store.d.ts +12 -1
- package/dist/plan-viz/normalize.d.ts +14 -0
- package/dist/plan-viz/plan-detail-lines.d.ts +3 -0
- package/dist/plan-viz/plan-layout.d.ts +48 -0
- package/dist/plan-viz/plan-nav.d.ts +29 -0
- package/dist/plan-viz/plan-raster.d.ts +36 -0
- package/dist/plan-viz/plan-routes.d.ts +6 -0
- package/dist/plan-viz/plan-snapshot.d.ts +73 -0
- package/dist/plan-viz/plan-viewport.d.ts +29 -0
- package/dist/plan-viz/plan-width.d.ts +15 -0
- package/dist/plan-viz/testkit/display-width.d.ts +12 -0
- package/dist/plan-viz/testkit/generators.d.ts +61 -0
- package/dist/plan-viz/testkit/grid-oracles.d.ts +38 -0
- package/dist/plan-viz/testkit/nav-oracles.d.ts +79 -0
- package/dist/plan-viz/testkit/types.d.ts +8 -0
- package/dist/plan-viz/types.d.ts +34 -0
- package/dist/{provider-setup-CPbB5y_V.js → provider-setup-CV3S_TAS.js} +10792 -5731
- package/dist/provider-setup-CV3S_TAS.js.map +1 -0
- package/dist/recall-tool.d.ts +43 -0
- package/dist/recovery-note.d.ts +22 -0
- package/dist/reply-audit.d.ts +67 -0
- package/dist/response-service.d.ts +11 -1
- package/dist/review-checker.d.ts +10 -4
- package/dist/reviewer-revision.d.ts +23 -0
- package/dist/risk-classifier.d.ts +7 -0
- package/dist/scripted-llm-client.d.ts +26 -1
- package/dist/semantic-compaction.d.ts +15 -0
- package/dist/semantic-hypotheses.d.ts +40 -0
- package/dist/side-call-policy.d.ts +30 -0
- package/dist/source-reliability.d.ts +71 -0
- package/dist/task-completion-check.d.ts +24 -0
- package/dist/tool-control-plane.d.ts +33 -1
- package/dist/tool-effect-class.d.ts +9 -0
- package/dist/tool-step.d.ts +6 -0
- package/dist/trace-events.d.ts +1 -1
- package/dist/transcript-compaction.d.ts +9 -0
- package/dist/trust-tagging.d.ts +2 -0
- package/dist/{tui-app-DeyZ4Pr9.js → tui-app-CJq6YaiP.js} +436 -21
- package/dist/tui-app-CJq6YaiP.js.map +1 -0
- package/dist/tui-app.d.ts +73 -0
- package/dist/turn-abort.d.ts +18 -0
- package/dist/turn-intent-classifier.d.ts +81 -14
- package/dist/turn-interpreter.d.ts +27 -3
- package/dist/version.d.ts +1 -1
- package/package.json +6 -6
- package/dist/bin-CdVTAe7j.js +0 -2209
- package/dist/bin-CdVTAe7j.js.map +0 -1
- package/dist/provider-setup-CPbB5y_V.js.map +0 -1
- package/dist/tui-app-DeyZ4Pr9.js.map +0 -1
package/dist/assistant.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExperienceStore, CheckpointStore, AskResponse } from '@buildaharness/harness';
|
|
1
|
+
import { ExperienceStore, CheckpointStore, AskResponse, LayerPolicyMode } from '@buildaharness/harness';
|
|
2
2
|
import { MemoryAdapter, ILLMClient, ChatMessage, ReminderStore } from '@buildaharness/runtime';
|
|
3
3
|
import { FileToolsContext } from './file-tools.js';
|
|
4
4
|
import { UndoLogEntry } from './action-snapshot.js';
|
|
@@ -8,13 +8,18 @@ import { ActionToolsContext } from './action-tools.js';
|
|
|
8
8
|
import { SpendCapConfig, SpendState } from './spend-cap.js';
|
|
9
9
|
import { TraceEvent } from './trace-events.js';
|
|
10
10
|
import { AssistantToolStep } from './tool-step.js';
|
|
11
|
-
import { MemorySummary, MemoryExport } from './memory-service.js';
|
|
11
|
+
import { MemoryService, MemorySummary, MemoryExport, AuditEntry, MemoryStatus, MemoryInjection, ConsolidationOutcome } from './memory-service.js';
|
|
12
|
+
import { MemoryWriteMode } from './memory-governance.js';
|
|
13
|
+
import { ConsolidationProposal } from './memory-consolidation.js';
|
|
12
14
|
import { UserFact } from './fact-extraction.js';
|
|
13
15
|
import { TranscriptSearchHit } from './assistant-session.js';
|
|
16
|
+
import { SessionDigest } from './episodic-digest.js';
|
|
14
17
|
import { PlanDecision, PlanApprovalEdits } from './plan-approval-service.js';
|
|
15
18
|
import { PlanRecord } from './plan-store.js';
|
|
19
|
+
import { GoalGraphRecord } from './goal-graph-store.js';
|
|
16
20
|
import { OneLoopMode } from './one-loop-flag.js';
|
|
17
21
|
import { AskMode } from './ask-mode-flag.js';
|
|
22
|
+
import { AmbiguityGuardMode } from './ambiguity-guard-flag.js';
|
|
18
23
|
import { PlanRolloutMode } from './plan-mode-flag.js';
|
|
19
24
|
import { GoalGraphSuggestMode } from './goal-graph-suggest-flag.js';
|
|
20
25
|
import { GoalGraphState } from './goal-graph-service.js';
|
|
@@ -43,6 +48,10 @@ export type MemoryPendingOutcome = {
|
|
|
43
48
|
};
|
|
44
49
|
export interface TurnOptions {
|
|
45
50
|
sessionId?: string;
|
|
51
|
+
/** Internal: this turn is the one-time correction the reply audit asked for; it is not a user message and is never retried again. */
|
|
52
|
+
auditRetry?: boolean;
|
|
53
|
+
/** M4: a scripted / piped / batch caller. The post-turn memory reviewer is skipped for it (it only runs for an interactive session). */
|
|
54
|
+
nonInteractive?: boolean;
|
|
46
55
|
approved?: boolean;
|
|
47
56
|
pendingActionId?: string;
|
|
48
57
|
/**
|
|
@@ -73,6 +82,12 @@ export interface TurnOptions {
|
|
|
73
82
|
* flag is off.
|
|
74
83
|
*/
|
|
75
84
|
askMode?: AskMode;
|
|
85
|
+
/**
|
|
86
|
+
* Stops the turn: once it fires, no further model call starts or is kept, the transcript is left as it was before
|
|
87
|
+
* the turn, and `turn()` resolves with `status: 'cancelled'` right away. Ignored when resuming a staged action
|
|
88
|
+
* (`pendingActionId`), because that applies a write/shell/email the user already approved and must not be half-done.
|
|
89
|
+
*/
|
|
90
|
+
signal?: AbortSignal;
|
|
76
91
|
onProgress?: (progress: AssistantProgress) => void;
|
|
77
92
|
/**
|
|
78
93
|
* Called with each token as the model's reply streams in. On the plain chat
|
|
@@ -97,7 +112,7 @@ export interface TurnOptions {
|
|
|
97
112
|
*/
|
|
98
113
|
onToolStep?: (step: AssistantToolStep) => void;
|
|
99
114
|
/**
|
|
100
|
-
* **
|
|
115
|
+
* **Benchmark harness only.** Wraps the one-loop
|
|
101
116
|
* proposer so its first `failIterations` harness iterations report a failed execution
|
|
102
117
|
* and `seedFailures` recurring same-class records are seeded into the run's
|
|
103
118
|
* `failureDiagnostics` — enough to trip `cannotMakeProgress()` on iteration 1 and
|
|
@@ -108,6 +123,7 @@ export interface TurnOptions {
|
|
|
108
123
|
failIterations: number;
|
|
109
124
|
seedFailures: number;
|
|
110
125
|
onInjected?: () => void;
|
|
126
|
+
symptom?: string;
|
|
111
127
|
};
|
|
112
128
|
/**
|
|
113
129
|
* Phase 4 of plans/hierarchical_goal_tree_and_steering_plan.html (R1/R4) — the session-scoped
|
|
@@ -137,6 +153,14 @@ export interface PersonalAssistantOptions {
|
|
|
137
153
|
* fresh install with no workspace concept at all.
|
|
138
154
|
*/
|
|
139
155
|
activeProject?: string;
|
|
156
|
+
/** M1: character budget for the facts block under `AUDIT_MEMORY_BUDGETED_RENDER` — see config.ts's `memoryBudgetChars`. */
|
|
157
|
+
memoryBudgetChars?: number;
|
|
158
|
+
/** M6: where model-originated memory writes may land (`auto`/`staged`/`user_only`, default `staged`) — see memory-governance.ts. Changeable live via `setMemoryWriteMode`. */
|
|
159
|
+
memoryWriteMode?: MemoryWriteMode;
|
|
160
|
+
/**
|
|
161
|
+
* M5: run memory consolidation in the background on `/new` (`clearSession`). Off unless the host sets it: the CLI does; chat-ui must not until M6's pending-queue controls exist (D1 stages every proposal, and a browser user could not review one). Still gated by `AUDIT_MEMORY_CONSOLIDATION`.
|
|
162
|
+
*/
|
|
163
|
+
consolidateOnNewSession?: boolean;
|
|
140
164
|
/** Conversation transcript storage — defaults to an in-process Map, swap for IndexedDBAdapter in the browser. */
|
|
141
165
|
memory?: MemoryAdapter;
|
|
142
166
|
/** Learning-layer store — persist and pass the same instance back in across sessions to retain strategy weights. */
|
|
@@ -226,6 +250,8 @@ export interface PersonalAssistantOptions {
|
|
|
226
250
|
* call resolveOneLoopMode(process.env) and pass the result here.
|
|
227
251
|
*/
|
|
228
252
|
oneLoopMode?: OneLoopMode;
|
|
253
|
+
/** AL8a — layer policy mode ('static' default = today's behaviour). Resolved by the surface via resolveLayerPolicyMode; PersonalAssistant never reads process.env for it. */
|
|
254
|
+
layerPolicyMode?: LayerPolicyMode;
|
|
229
255
|
/**
|
|
230
256
|
* R7 (Tier 1.5) — next-step suggestions, one bounded LLM call each: after every full
|
|
231
257
|
* (non-trivial, `ok`) turn, up to three options are attached to the result as `nextSteps` for
|
|
@@ -236,6 +262,8 @@ export interface PersonalAssistantOptions {
|
|
|
236
262
|
* that never asks for suggestions makes no extra call and sees no new field (INV-43).
|
|
237
263
|
*/
|
|
238
264
|
goalGraphSuggestMode?: GoalGraphSuggestMode;
|
|
265
|
+
/** Run the reply audit (reply-audit.ts) after each successful turn; defaults to the AIELIA_REPLY_AUDIT env gate (on). */
|
|
266
|
+
replyAudit?: boolean;
|
|
239
267
|
/**
|
|
240
268
|
* Q2 of the internal plan — global-flag control point (tier 1 of
|
|
241
269
|
* INV-29) for the ask-question mechanism. Undefined (the default) falls back to
|
|
@@ -256,6 +284,13 @@ export interface PersonalAssistantOptions {
|
|
|
256
284
|
* resolvePlanMode(process.env)/normalizePlanMode(import.meta.env...) and pass the result here.
|
|
257
285
|
*/
|
|
258
286
|
planMode?: PlanRolloutMode;
|
|
287
|
+
/**
|
|
288
|
+
* AL3a — see ambiguity-guard-flag.ts. Absent/'disabled' (the default): routing is byte-identical to
|
|
289
|
+
* before. 'enabled': a consequential turn whose request doesn't determine the action gets a
|
|
290
|
+
* clarifying question instead of a staged guess. PersonalAssistant never reads process.env; the
|
|
291
|
+
* surface entry point resolves ASSISTANT_AMBIGUITY_GUARD / `/config set ambiguityGuardMode`.
|
|
292
|
+
*/
|
|
293
|
+
ambiguityGuardMode?: AmbiguityGuardMode;
|
|
259
294
|
}
|
|
260
295
|
/**
|
|
261
296
|
* A light, everyday-use wrapper around HarnessRuntime: one harness run per chat turn,
|
|
@@ -275,8 +310,14 @@ export interface PersonalAssistantOptions {
|
|
|
275
310
|
*/
|
|
276
311
|
export declare class PersonalAssistant {
|
|
277
312
|
private readonly llmClient;
|
|
313
|
+
private readonly abortGate;
|
|
314
|
+
/** A stopped turn whose in-flight model call has not come back yet. Its gate stays armed until it settles, so it cannot write the transcript late. */
|
|
315
|
+
private stoppedWork?;
|
|
278
316
|
private model?;
|
|
279
317
|
private activeProject?;
|
|
318
|
+
private memoryBudgetChars?;
|
|
319
|
+
private memoryWriteMode;
|
|
320
|
+
private consolidateOnNewSession;
|
|
280
321
|
private readonly memory;
|
|
281
322
|
private readonly webTools?;
|
|
282
323
|
private readonly onTrace?;
|
|
@@ -286,6 +327,7 @@ export declare class PersonalAssistant {
|
|
|
286
327
|
private readonly toolLoopWillRun;
|
|
287
328
|
/** R3 of the internal plan — mirrors the same flag HarnessBridge was given at construction, kept here too so runTurn can decide whether to defer the tool loop into a harness-driven proposer instead of precomputing draftReply. See PersonalAssistantOptions.oneLoopMode's doc comment. */
|
|
288
329
|
private readonly oneLoopMode;
|
|
330
|
+
private readonly layerPolicyMode;
|
|
289
331
|
/** Q2 — global-flag tier of the ask-question mechanism's three-tier INV-29 resolution. See PersonalAssistantOptions.askMode's doc comment. */
|
|
290
332
|
private readonly askMode;
|
|
291
333
|
/** P11 — gates whether P3's auto-trigger below can ever enter plan mode for real traffic. See PersonalAssistantOptions.planMode's doc comment. */
|
|
@@ -301,9 +343,24 @@ export declare class PersonalAssistant {
|
|
|
301
343
|
/** See PersonalAssistantOptions.goalGraphSuggestMode. */
|
|
302
344
|
private readonly goalGraphSuggestMode;
|
|
303
345
|
private readonly memoryService;
|
|
346
|
+
/** M4 post-turn cross-turn memory reviewer; inert unless `AUDIT_MEMORY_REVIEWER` is on. */
|
|
347
|
+
private readonly memoryReviewer;
|
|
304
348
|
private readonly session;
|
|
305
349
|
private readonly agentLoop;
|
|
306
350
|
private readonly actionApproval;
|
|
351
|
+
/** Set when the reply was already logged by the reply-ready hook this turn (see AssistantSession.replyReadyHook). */
|
|
352
|
+
private replyLoggedEarly;
|
|
353
|
+
/** Automatic correction retries still allowed for the current user message; resumed (approval) turns share it so a retry cannot chain. */
|
|
354
|
+
private auditRetryBudget;
|
|
355
|
+
/** The session of the turn in progress, for log lines written by code that has no session of its own (the side-call retry note). */
|
|
356
|
+
private lastSessionId;
|
|
357
|
+
/** The last real (not fail-safe) risk classification of a user message, per session, for the audit retry that may correct its reply. */
|
|
358
|
+
private readonly lastClassifiedBySession;
|
|
359
|
+
/** Files, directories and pages each session's turns have read (tool and target, oldest first, capped): the reply audit needs reads from EARLIER turns too, or a correct answer about a file read last turn looks like an unverified outside fact (V1). In memory only; cleared with the session. */
|
|
360
|
+
private readonly sourcesReadBySession;
|
|
361
|
+
/** Index into the action list where the current user message's actions start; an approval resume is a separate turn() call but the same user message. */
|
|
362
|
+
private userMessageActionsStart;
|
|
363
|
+
private readonly replyAuditOn;
|
|
307
364
|
private readonly planService;
|
|
308
365
|
private readonly planApproval;
|
|
309
366
|
private readonly planDrafting;
|
|
@@ -321,12 +378,31 @@ export declare class PersonalAssistant {
|
|
|
321
378
|
* PersonalAssistant(...)` outside a browser (e.g. the CLI).
|
|
322
379
|
*/
|
|
323
380
|
static create(options: PersonalAssistantOptions): Promise<PersonalAssistant>;
|
|
381
|
+
/**
|
|
382
|
+
* The bigger picture both next-step proposers get (see next-step-context.ts): earlier
|
|
383
|
+
* conversation, the steps taken this turn, and every goal thread the session tracks. Best-effort —
|
|
384
|
+
* any read failure just yields no extra context, never a failed turn. At turn end the focus
|
|
385
|
+
* thread is the one the graph currently marks active; for a thread that just finished it is that
|
|
386
|
+
* thread.
|
|
387
|
+
*/
|
|
388
|
+
private nextStepContext;
|
|
389
|
+
/** Logs a message that arrived while a turn was running, at receipt time (its `user_message` is only logged when it is processed). */
|
|
390
|
+
logQueuedMessage(sessionId: string, message: string): void;
|
|
324
391
|
/**
|
|
325
392
|
* Thin wrapper around runTurn(): emits turn_start/turn_end/error trace events
|
|
326
393
|
* around the actual logic, so every one of runTurn's return paths gets a
|
|
327
394
|
* matching turn_end without instrumenting each one individually.
|
|
328
395
|
*/
|
|
329
396
|
turn(userMessage: string, options?: TurnOptions): Promise<AssistantTurnResult>;
|
|
397
|
+
/**
|
|
398
|
+
* M4: after a delivered, ordinary interactive reply, counts the turn and (every N turns without a memory write) starts the
|
|
399
|
+
* cross-turn memory review in the background. Not awaited: the reply is already on its way. Skipped for non-interactive and
|
|
400
|
+
* batch-research turns, and when the layer policy switched the layer off. Its spend is recorded through the same
|
|
401
|
+
* `recordSpend` path as the turn's own, so `/cost` and the spend cap include it.
|
|
402
|
+
*/
|
|
403
|
+
private maybeStartMemoryReview;
|
|
404
|
+
/** Resolves when any in-flight background memory review has finished (a host about to exit, or a test). */
|
|
405
|
+
awaitMemoryReview(): Promise<void>;
|
|
330
406
|
/** Persisted alongside transcript/facts/plan — survives a process restart, same as everything else keyed by sessionId, so the ceiling is genuinely cross-session, not just cross-turn within one process lifetime. */
|
|
331
407
|
getSpendState(sessionId: string): Promise<SpendState>;
|
|
332
408
|
/** The session's conversation transcript, oldest first — same array `turn()` reads/appends to. Used by `/export`. */
|
|
@@ -338,7 +414,48 @@ export declare class PersonalAssistant {
|
|
|
338
414
|
*/
|
|
339
415
|
recordDeclinedRequest(sessionId: string, userMessage: string, reason: string): Promise<void>;
|
|
340
416
|
/** Ends the current conversation — see AssistantSession.clearSession's doc comment for exactly what is and isn't cleared. */
|
|
417
|
+
/** Remembers what a turn read (tool and target) for the reply audit of later turns; oldest entries drop first. */
|
|
418
|
+
private noteSourcesRead;
|
|
341
419
|
clearSession(sessionId: string): Promise<void>;
|
|
420
|
+
/** M5: propose memory consolidation (applies nothing). `manual` forces the model pass past the cost gate. Usage is recorded against the spend state like any other call. */
|
|
421
|
+
proposeMemoryConsolidation(sessionId: string, manual?: boolean): Promise<Awaited<ReturnType<MemoryService['runConsolidation']>>>;
|
|
422
|
+
/** The consolidator MemoryService.consolidate() runs for `/memory consolidate` (chat-ui's button): runs the proposal pass now and reports; applying anything is still the user's accept. */
|
|
423
|
+
private runRegisteredConsolidation;
|
|
424
|
+
/** M5: staged proposals awaiting the user. */
|
|
425
|
+
memoryProposals(): Promise<ConsolidationProposal[]>;
|
|
426
|
+
/** M5: `/memory consolidate accept <n>` (1-based). */
|
|
427
|
+
acceptMemoryProposal(selector: string, sessionId: string): Promise<{
|
|
428
|
+
ok: boolean;
|
|
429
|
+
message: string;
|
|
430
|
+
}>;
|
|
431
|
+
/** M5: `/memory consolidate dismiss <n>` (1-based). */
|
|
432
|
+
dismissMemoryProposal(selector: string): Promise<{
|
|
433
|
+
ok: boolean;
|
|
434
|
+
message: string;
|
|
435
|
+
}>;
|
|
436
|
+
/** How many entries at the head of `listArchivedFacts()` were set aside by staged forgetting (M5) and can be restored; the rest were replaced by a newer statement. */
|
|
437
|
+
restorableArchiveCount(): Promise<number>;
|
|
438
|
+
/** `/memory archive restore <n>` (1-based, over the same numbered listing as `/memory archive`). */
|
|
439
|
+
restoreArchivedMemory(selector: string, sessionId: string): Promise<{
|
|
440
|
+
ok: boolean;
|
|
441
|
+
message: string;
|
|
442
|
+
}>;
|
|
443
|
+
/**
|
|
444
|
+
* M3 session edge: with AUDIT_EPISODIC_DIGEST on, writes the conversation's handoff digest (one bounded call, fail-open)
|
|
445
|
+
* for the current conversation (the rolling digest is refreshed, not duplicated, if the same conversation is digested again). `clearSession` (/new) calls it, then ends the conversation's digest identity; the CLI calls it on exit; never from inside a turn.
|
|
446
|
+
* With the flag off this does nothing, so the old behaviour is untouched.
|
|
447
|
+
*/
|
|
448
|
+
endSession(sessionId: string): Promise<void>;
|
|
449
|
+
/** Stored episodic digests (newest first), for the memory panel and `/memory`; read-only. */
|
|
450
|
+
listSessionDigests(): Promise<SessionDigest[]>;
|
|
451
|
+
/** Which optional memory writers are switched on for this process (their `AUDIT_*` flags): hosts use it to show or hide the matching controls. A writer that is off makes no model call and no write. */
|
|
452
|
+
memoryWriterFlags(): {
|
|
453
|
+
reviewer: boolean;
|
|
454
|
+
consolidation: boolean;
|
|
455
|
+
digest: boolean;
|
|
456
|
+
};
|
|
457
|
+
/** M3 (D4): `/memory forget digest <id>` or all digests when `id` is omitted; returns how many were removed. */
|
|
458
|
+
forgetDigests(id?: string): Promise<number>;
|
|
342
459
|
/**
|
|
343
460
|
* P1 of the internal plan — explicit entry point into plan mode's
|
|
344
461
|
* exclusive drafting state. No production caller yet: P3 will later set this automatically from
|
|
@@ -369,6 +486,11 @@ export declare class PersonalAssistant {
|
|
|
369
486
|
* goal graph yet, same "nothing to show" convention `getGoalGraphState` itself documents.
|
|
370
487
|
*/
|
|
371
488
|
getGoalGraphState(sessionId: string): Promise<GoalGraphState>;
|
|
489
|
+
/**
|
|
490
|
+
* Read-only source for the plan graph view: the session's goal graph when it has threads, else its
|
|
491
|
+
* plan record, else `null`. Never throws and never creates a record.
|
|
492
|
+
*/
|
|
493
|
+
getPlanGraph(sessionId: string): Promise<PlanRecord | GoalGraphRecord | null>;
|
|
372
494
|
/**
|
|
373
495
|
* P9 of the internal plan — the lightweight plan-sketch delegate: a
|
|
374
496
|
* cheaper "just go research and draft an approach" path than plan mode's durable task-graph
|
|
@@ -427,9 +549,39 @@ export declare class PersonalAssistant {
|
|
|
427
549
|
* facts first, then session facts — the same order `getMemorySummary()` returns). Unlike
|
|
428
550
|
* confirm/reject, there's no category form: a durable/session fact carries no `category` field,
|
|
429
551
|
* only pending model-inferred guesses do. Hard-deletes rather than routing through
|
|
430
|
-
* REJECTED_FACTS_KEY — see MemoryService.forgetFact's doc comment.
|
|
431
|
-
|
|
432
|
-
|
|
552
|
+
* REJECTED_FACTS_KEY — see MemoryService.forgetFact's doc comment. By default the removal is recorded
|
|
553
|
+
* in the audit log with the fact's text (so `/memory undo` can restore it); `erase` also scrubs that text.
|
|
554
|
+
*/
|
|
555
|
+
forgetFact(selector: string, sessionId: string, erase?: boolean): Promise<MemoryPendingOutcome>;
|
|
556
|
+
/** `/memory history` — the newest audit-log entries (M2). Empty unless `AUDIT_MEMORY_AUDIT_LOG` is on. */
|
|
557
|
+
memoryHistory(limit?: number): Promise<AuditEntry[]>;
|
|
558
|
+
/** `/memory undo <seq>` — restores the pre-image of one audit entry (M2). */
|
|
559
|
+
undoMemoryChange(selector: string, sessionId: string): Promise<{
|
|
560
|
+
ok: boolean;
|
|
561
|
+
message: string;
|
|
562
|
+
}>;
|
|
563
|
+
/** `/memory` governance mode (M6) — takes effect on the next write. */
|
|
564
|
+
getMemoryWriteMode(): MemoryWriteMode;
|
|
565
|
+
/** Live mode change (CLI `/config set` reloads the assistant; chat-ui calls this directly). Unknown values keep the default rather than widening write authority. */
|
|
566
|
+
setMemoryWriteMode(mode: MemoryWriteMode | string): void;
|
|
567
|
+
/** `/memory off` / `/memory on` — stop or resume all memory writes (facts, pending queue, digests, reviewer, consolidation) for this install. Existing data stays readable and removable. */
|
|
568
|
+
setMemoryEnabled(enabled: boolean): Promise<void>;
|
|
569
|
+
isMemoryEnabled(): Promise<boolean>;
|
|
570
|
+
/** Store size vs budget, pending/audit counts, last consolidation, governance state — `/doctor` and the memory panel. Read-only. */
|
|
571
|
+
getMemoryStatus(sessionId: string): Promise<MemoryStatus>;
|
|
572
|
+
/** The facts the last turn's prompt actually contained, plus how many were left out — the "Why?" panel / `/why` line. Undefined before the first turn. */
|
|
573
|
+
getLastMemoryInjection(): MemoryInjection | undefined;
|
|
574
|
+
/** `/memory archive` — entries set aside by staged forgetting (restorable, first) then entries a keyed update replaced (newest first). */
|
|
575
|
+
listArchivedFacts(): Promise<UserFact[]>;
|
|
576
|
+
/** `/memory archive forget <n>` — permanently erases one archived entry and its history pre-images. */
|
|
577
|
+
forgetArchivedFact(selector: string): Promise<MemoryPendingOutcome>;
|
|
578
|
+
/** `/memory consolidate` — runs the registered consolidator (M5). Until M5 registers one this reports `unavailable`. */
|
|
579
|
+
consolidateMemory(sessionId: string): Promise<ConsolidationOutcome | {
|
|
580
|
+
status: 'unavailable' | 'blocked';
|
|
581
|
+
message: string;
|
|
582
|
+
}>;
|
|
583
|
+
/** M5 hook: lets the consolidation phase plug in without touching the surfaces. */
|
|
584
|
+
registerMemoryConsolidator(fn: Parameters<MemoryService['registerConsolidator']>[0]): void;
|
|
433
585
|
/** Ranked search over the per-message index — see AssistantSession.searchTranscript's doc comment. Used by `/search`. */
|
|
434
586
|
searchTranscript(query: string, topK?: number): Promise<TranscriptSearchHit[]>;
|
|
435
587
|
/** Changes the model used by every subsequent `turn()` call, mid-session — no reconstruction needed. Used by `/model`. Every collaborator constructed above reads this field through a getter closure, never a captured string, so this takes effect for all of them immediately. */
|
|
@@ -447,6 +599,8 @@ export declare class PersonalAssistant {
|
|
|
447
599
|
* plan-cancel bypass, the triviality fast path) actually lives now.
|
|
448
600
|
*/
|
|
449
601
|
private runTurn;
|
|
602
|
+
/** What ActionApprovalService needs to continue a paused tool loop after an approval: the live callbacks, and how a further pause becomes a turn result. */
|
|
603
|
+
private loopResumeOptions;
|
|
450
604
|
/**
|
|
451
605
|
* Shared by the flag-OFF flat/batch tool loop's own needs_approval/escalated ToolLoopResult and
|
|
452
606
|
* the flag-ON harness-driven proposer's equivalent OneLoopPause (R3 of
|
|
@@ -21,6 +21,12 @@ export interface InjectedFailureOptions {
|
|
|
21
21
|
* the internal plan F2).
|
|
22
22
|
*/
|
|
23
23
|
onInjected?: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* The failure symptom text (a paraphrase of a known class, a missing resource, a rate limit…).
|
|
26
|
+
* Becomes the seeded records' description, the observation and the failed execution's error, so
|
|
27
|
+
* failure matching sees the task's own wording. Absent = the generic ETIMEDOUT text.
|
|
28
|
+
*/
|
|
29
|
+
symptom?: string;
|
|
24
30
|
}
|
|
25
31
|
type Proposer = (toolCtx: ToolExecutorContext) => unknown | Promise<unknown>;
|
|
26
32
|
export declare function wrapProposerWithInjectedFailure(realProposer: Proposer, opts: InjectedFailureOptions): (toolCtx: ToolExecutorContext) => Promise<unknown>;
|