@buildaharness/aielia 0.3.9 → 0.3.10
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/_memory-core-generated.d.ts +6 -0
- package/dist/assistant.d.ts +11 -0
- package/dist/{bin-CCwDFxDe.js → bin-Cz3FY6Ew.js} +30 -11
- package/dist/bin-Cz3FY6Ew.js.map +1 -0
- package/dist/claude-cli-llm-client.d.ts +2 -0
- package/dist/claude-cli-prompt.d.ts +7 -0
- package/dist/cli.js +1 -1
- package/dist/fact-repository.contract.d.ts +2 -0
- package/dist/fact-repository.d.ts +44 -0
- package/dist/file-tools-mcp-server.mjs +29 -0
- package/dist/harness-bridge.d.ts +5 -5
- package/dist/html-to-markdown.d.ts +11 -0
- package/dist/index.d.ts +82 -2
- package/dist/index.js +4975 -173
- package/dist/index.js.map +1 -1
- package/dist/layer-settings.d.ts +16 -3
- package/dist/memory-events.d.ts +177 -0
- package/dist/memory-service.d.ts +15 -0
- package/dist/model-pricing.d.ts +3 -0
- package/dist/{provider-setup-Cy9dwqrd.js → provider-setup-DG8iYm_F.js} +5756 -4787
- package/dist/provider-setup-DG8iYm_F.js.map +1 -0
- package/dist/scripted-llm-client.d.ts +1 -1
- package/dist/{tui-app-Dt72u8vZ.js → tui-app-oWbIUcBW.js} +3 -3
- package/dist/{tui-app-Dt72u8vZ.js.map → tui-app-oWbIUcBW.js.map} +1 -1
- package/dist/turn-abort.d.ts +5 -0
- package/dist/version.d.ts +1 -1
- package/dist/web-fetch-core.d.ts +0 -14
- package/dist/writer/article-autosave.d.ts +12 -0
- package/dist/writer/article-change-summary.d.ts +28 -0
- package/dist/writer/article-claims.d.ts +49 -0
- package/dist/writer/article-comments.d.ts +20 -0
- package/dist/writer/article-consistency.d.ts +27 -0
- package/dist/writer/article-decorations.d.ts +23 -0
- package/dist/writer/article-dependencies.d.ts +44 -0
- package/dist/writer/article-draft.d.ts +23 -0
- package/dist/writer/article-edit-outline.d.ts +16 -0
- package/dist/writer/article-edit-suggest.d.ts +30 -0
- package/dist/writer/article-folder.d.ts +29 -0
- package/dist/writer/article-history.d.ts +73 -0
- package/dist/writer/article-ideas.d.ts +34 -0
- package/dist/writer/article-issues.d.ts +47 -0
- package/dist/writer/article-marks.d.ts +25 -0
- package/dist/writer/article-memory-store.d.ts +3 -0
- package/dist/writer/article-model.d.ts +1337 -0
- package/dist/writer/article-outline.d.ts +43 -0
- package/dist/writer/article-resolver.d.ts +55 -0
- package/dist/writer/article-revisions.d.ts +30 -0
- package/dist/writer/article-rules.d.ts +60 -0
- package/dist/writer/article-sections.d.ts +26 -0
- package/dist/writer/article-selection.d.ts +26 -0
- package/dist/writer/article-service.d.ts +542 -0
- package/dist/writer/article-source-links.d.ts +42 -0
- package/dist/writer/article-sources.d.ts +82 -0
- package/dist/writer/article-style-derive.d.ts +26 -0
- package/dist/writer/article-style.d.ts +31 -0
- package/dist/writer/article-suggestions.d.ts +33 -0
- package/dist/writer/article-support.d.ts +33 -0
- package/dist/writer/article-verify.d.ts +42 -0
- package/dist/writer/local-folder.d.ts +49 -0
- package/dist/writer/model-failure-hint.d.ts +7 -0
- package/dist/writer/repo-reader.d.ts +29 -0
- package/dist/writer/repo-search.d.ts +33 -0
- package/dist/writer/repo-verify-loop.d.ts +61 -0
- package/dist/writer/text-tool-calls.d.ts +11 -0
- package/dist/writer/work-progress.d.ts +51 -0
- package/dist/writer/write-activity.d.ts +61 -0
- package/dist/writer/write-models.d.ts +12 -0
- package/dist/writer/write-parameters.d.ts +31 -0
- package/dist/writer/write-permissions.d.ts +89 -0
- package/dist/writer/write-spend.d.ts +16 -0
- package/dist/writer/writer-chat-capture.d.ts +25 -0
- package/dist/writer/writer-chat-history.d.ts +17 -0
- package/dist/writer/writer-chat-state.d.ts +358 -0
- package/dist/writer/writer-chat-turn.d.ts +52 -0
- package/dist/writer/writer-intent.d.ts +20 -0
- package/package.json +3 -3
- package/dist/bin-CCwDFxDe.js.map +0 -1
- package/dist/provider-setup-Cy9dwqrd.js.map +0 -1
package/dist/layer-settings.d.ts
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* layer needed a second code path. An env value the operator set themselves always wins and renders as pinned,
|
|
6
6
|
* the same precedence `explicitEnvOverride` already gives it.
|
|
7
7
|
*
|
|
8
|
-
* Floor layers
|
|
9
|
-
*
|
|
8
|
+
* Floor layers: control state, tool policy and verification each have a gate flag and may be switched off (they carry
|
|
9
|
+
* a `caution`). Approval staging is locked on purpose, and diagnostics and template hypotheses have no effect of their own
|
|
10
|
+
* (they only feed the control state), so they follow `control_state`.
|
|
10
11
|
*/
|
|
11
|
-
export type LayerGroup = 'escalation' | 'opt_in' | 'floor';
|
|
12
|
+
export type LayerGroup = 'escalation' | 'behaviour' | 'opt_in' | 'floor';
|
|
12
13
|
export interface LayerSetting {
|
|
13
14
|
id: string;
|
|
14
15
|
group: LayerGroup;
|
|
@@ -21,10 +22,22 @@ export interface LayerSetting {
|
|
|
21
22
|
cost: string;
|
|
22
23
|
/** What the audit found, in plain words — the record, not a promise. */
|
|
23
24
|
evidence: string;
|
|
25
|
+
/** What switching it off gives up; set on floor layers a user may still switch off. */
|
|
26
|
+
caution?: string;
|
|
27
|
+
/** A layer with no gate of its own: it is on exactly when this layer is. */
|
|
28
|
+
followsLayer?: string;
|
|
29
|
+
/** Layers this one does nothing without. Switching it on while one of them is off is allowed but reported. */
|
|
30
|
+
requires?: readonly string[];
|
|
24
31
|
}
|
|
25
32
|
export declare const LAYER_SETTINGS: readonly LayerSetting[];
|
|
26
33
|
export type LayerChoices = Readonly<Record<string, boolean>>;
|
|
27
34
|
export declare function findLayer(id: string): LayerSetting | undefined;
|
|
35
|
+
/** The layers that have no switch of their own and are on exactly when `leader` is. */
|
|
36
|
+
export declare function followersOf(leader: LayerSetting): LayerSetting[];
|
|
37
|
+
/** The layers `layer` needs that are currently off. Empty when `layer` is off itself: nothing is lost then. */
|
|
38
|
+
export declare function unmetRequirements(layer: LayerSetting, choices: LayerChoices | undefined, pinned: ReadonlySet<string>, env: Env): LayerSetting[];
|
|
39
|
+
/** One line per switched-on layer that has no effect because a layer it needs is off. */
|
|
40
|
+
export declare function layerWarnings(choices: LayerChoices | undefined, pinned: ReadonlySet<string>, env: Env): string[];
|
|
28
41
|
/** The layers a user may change: everything except the locked floor. */
|
|
29
42
|
export declare function isToggleable(layer: LayerSetting): boolean;
|
|
30
43
|
type Env = Record<string, string | undefined>;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UserFact } from './fact-extraction.js';
|
|
3
|
+
/**
|
|
4
|
+
* One record per memory transition: what changed, WHY (a closed, countable reason code) and which
|
|
5
|
+
* sources justified it. Pure (no I/O, no clock): `MemoryService` builds events from the changes it
|
|
6
|
+
* makes and hands them to an `EventSink`. The wire enums come from the shared contract
|
|
7
|
+
* (`spec/memory-core.json`), so the Python twin sees the same names.
|
|
8
|
+
*
|
|
9
|
+
* Privacy: an event holds ids and codes, never fact text, unless the caller asks for images
|
|
10
|
+
* (`withImages`, tied to the audit log flag). `factKey()` is a one-way id, so an event about a
|
|
11
|
+
* forgotten fact reveals nothing; `scrubForgotten()` also drops the quotes and images of every
|
|
12
|
+
* earlier event about it.
|
|
13
|
+
*/
|
|
14
|
+
export declare const MEMORY_EVENTS_KEY: string;
|
|
15
|
+
export declare const MEMORY_EVENTS_KEEP: number;
|
|
16
|
+
export declare const MemoryEventKindSchema: z.ZodEnum<["promote", "decline", "correct", "contradict", "supersede", "retire", "forget", "expire", "restore", "recall"]>;
|
|
17
|
+
export declare const ReasonCodeSchema: z.ZodEnum<["user_stated", "user_corrected", "user_confirmed", "user_rejected", "inferred_high_conf", "inferred_pending_confirmation", "inferred_low_conf_session_only", "conflicts_with_fact", "superseded_by_newer", "explicit_forget", "retention_expired", "gate_blocked_secret", "gate_blocked_instruction", "duplicate"]>;
|
|
18
|
+
export declare const SourceRefSchema: z.ZodObject<{
|
|
19
|
+
type: z.ZodEnum<["user_message", "assistant_message", "tool_result", "prior_fact", "user_command"]>;
|
|
20
|
+
/** messageId | toolCallId | factKey | command name. */
|
|
21
|
+
ref: z.ZodString;
|
|
22
|
+
/** Short justification the reader sees; present only with images on, and removed when the fact is forgotten. */
|
|
23
|
+
quote: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
type: "user_message" | "assistant_message" | "tool_result" | "prior_fact" | "user_command";
|
|
26
|
+
ref: string;
|
|
27
|
+
quote?: string | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
type: "user_message" | "assistant_message" | "tool_result" | "prior_fact" | "user_command";
|
|
30
|
+
ref: string;
|
|
31
|
+
quote?: string | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const MemoryEventSchema: z.ZodObject<{
|
|
34
|
+
seq: z.ZodNumber;
|
|
35
|
+
at: z.ZodString;
|
|
36
|
+
session: z.ZodString;
|
|
37
|
+
turn: z.ZodString;
|
|
38
|
+
kind: z.ZodEnum<["promote", "decline", "correct", "contradict", "supersede", "retire", "forget", "expire", "restore", "recall"]>;
|
|
39
|
+
/** `factKey()` of the fact the event is about (the pre-image for a supersession). */
|
|
40
|
+
factId: z.ZodString;
|
|
41
|
+
/** `factKey()` of the replacement, for a supersession. */
|
|
42
|
+
afterFactId: z.ZodOptional<z.ZodString>;
|
|
43
|
+
attributeKey: z.ZodOptional<z.ZodString>;
|
|
44
|
+
store: z.ZodOptional<z.ZodEnum<["durable", "pending", "rejected", "session"]>>;
|
|
45
|
+
before: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
text: z.ZodString;
|
|
47
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
48
|
+
text: z.ZodString;
|
|
49
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
50
|
+
text: z.ZodString;
|
|
51
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
52
|
+
after: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
text: z.ZodString;
|
|
54
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
55
|
+
text: z.ZodString;
|
|
56
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
57
|
+
text: z.ZodString;
|
|
58
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
59
|
+
reason: z.ZodEnum<["user_stated", "user_corrected", "user_confirmed", "user_rejected", "inferred_high_conf", "inferred_pending_confirmation", "inferred_low_conf_session_only", "conflicts_with_fact", "superseded_by_newer", "explicit_forget", "retention_expired", "gate_blocked_secret", "gate_blocked_instruction", "duplicate"]>;
|
|
60
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
61
|
+
type: z.ZodEnum<["user_message", "assistant_message", "tool_result", "prior_fact", "user_command"]>;
|
|
62
|
+
/** messageId | toolCallId | factKey | command name. */
|
|
63
|
+
ref: z.ZodString;
|
|
64
|
+
/** Short justification the reader sees; present only with images on, and removed when the fact is forgotten. */
|
|
65
|
+
quote: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
type: "user_message" | "assistant_message" | "tool_result" | "prior_fact" | "user_command";
|
|
68
|
+
ref: string;
|
|
69
|
+
quote?: string | undefined;
|
|
70
|
+
}, {
|
|
71
|
+
type: "user_message" | "assistant_message" | "tool_result" | "prior_fact" | "user_command";
|
|
72
|
+
ref: string;
|
|
73
|
+
quote?: string | undefined;
|
|
74
|
+
}>, "many">;
|
|
75
|
+
decidedBy: z.ZodEnum<["user", "classifier", "reviewer", "consolidation", "rule"]>;
|
|
76
|
+
confidence: z.ZodOptional<z.ZodEnum<["high", "medium", "low"]>>;
|
|
77
|
+
group: z.ZodOptional<z.ZodString>;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
at: string;
|
|
80
|
+
kind: "retire" | "restore" | "promote" | "decline" | "correct" | "contradict" | "supersede" | "forget" | "expire" | "recall";
|
|
81
|
+
reason: "user_stated" | "user_corrected" | "user_confirmed" | "user_rejected" | "inferred_high_conf" | "inferred_pending_confirmation" | "inferred_low_conf_session_only" | "conflicts_with_fact" | "superseded_by_newer" | "explicit_forget" | "retention_expired" | "gate_blocked_secret" | "gate_blocked_instruction" | "duplicate";
|
|
82
|
+
session: string;
|
|
83
|
+
seq: number;
|
|
84
|
+
factId: string;
|
|
85
|
+
turn: string;
|
|
86
|
+
sources: {
|
|
87
|
+
type: "user_message" | "assistant_message" | "tool_result" | "prior_fact" | "user_command";
|
|
88
|
+
ref: string;
|
|
89
|
+
quote?: string | undefined;
|
|
90
|
+
}[];
|
|
91
|
+
decidedBy: "reviewer" | "rule" | "user" | "consolidation" | "classifier";
|
|
92
|
+
confidence?: "high" | "medium" | "low" | undefined;
|
|
93
|
+
before?: z.objectOutputType<{
|
|
94
|
+
text: z.ZodString;
|
|
95
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
96
|
+
after?: z.objectOutputType<{
|
|
97
|
+
text: z.ZodString;
|
|
98
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
99
|
+
store?: "rejected" | "durable" | "pending" | "session" | undefined;
|
|
100
|
+
group?: string | undefined;
|
|
101
|
+
afterFactId?: string | undefined;
|
|
102
|
+
attributeKey?: string | undefined;
|
|
103
|
+
}, {
|
|
104
|
+
at: string;
|
|
105
|
+
kind: "retire" | "restore" | "promote" | "decline" | "correct" | "contradict" | "supersede" | "forget" | "expire" | "recall";
|
|
106
|
+
reason: "user_stated" | "user_corrected" | "user_confirmed" | "user_rejected" | "inferred_high_conf" | "inferred_pending_confirmation" | "inferred_low_conf_session_only" | "conflicts_with_fact" | "superseded_by_newer" | "explicit_forget" | "retention_expired" | "gate_blocked_secret" | "gate_blocked_instruction" | "duplicate";
|
|
107
|
+
session: string;
|
|
108
|
+
seq: number;
|
|
109
|
+
factId: string;
|
|
110
|
+
turn: string;
|
|
111
|
+
sources: {
|
|
112
|
+
type: "user_message" | "assistant_message" | "tool_result" | "prior_fact" | "user_command";
|
|
113
|
+
ref: string;
|
|
114
|
+
quote?: string | undefined;
|
|
115
|
+
}[];
|
|
116
|
+
decidedBy: "reviewer" | "rule" | "user" | "consolidation" | "classifier";
|
|
117
|
+
confidence?: "high" | "medium" | "low" | undefined;
|
|
118
|
+
before?: z.objectInputType<{
|
|
119
|
+
text: z.ZodString;
|
|
120
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
121
|
+
after?: z.objectInputType<{
|
|
122
|
+
text: z.ZodString;
|
|
123
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
124
|
+
store?: "rejected" | "durable" | "pending" | "session" | undefined;
|
|
125
|
+
group?: string | undefined;
|
|
126
|
+
afterFactId?: string | undefined;
|
|
127
|
+
attributeKey?: string | undefined;
|
|
128
|
+
}>;
|
|
129
|
+
export type MemoryEventKind = z.infer<typeof MemoryEventKindSchema>;
|
|
130
|
+
export type ReasonCode = z.infer<typeof ReasonCodeSchema>;
|
|
131
|
+
export type SourceRef = z.infer<typeof SourceRefSchema>;
|
|
132
|
+
export type MemoryEvent = z.infer<typeof MemoryEventSchema>;
|
|
133
|
+
export type MemoryEventDraft = Omit<MemoryEvent, 'seq' | 'at'>;
|
|
134
|
+
export interface EventSink {
|
|
135
|
+
emit(events: MemoryEvent[]): void | Promise<void>;
|
|
136
|
+
}
|
|
137
|
+
export declare class InMemoryEventSink implements EventSink {
|
|
138
|
+
readonly events: MemoryEvent[];
|
|
139
|
+
emit(events: MemoryEvent[]): void;
|
|
140
|
+
}
|
|
141
|
+
/** Stable, non-reversible id for a fact (FNV-1a over `text|extractedAt`): lets events point at a fact without carrying its words. */
|
|
142
|
+
export declare function factKey(fact: Pick<UserFact, 'text' | 'extractedAt'>): string;
|
|
143
|
+
export declare function keyOfFactId(id: string): string;
|
|
144
|
+
/** The slice of an audit entry an event is derived from (structural, so this module never imports the service). */
|
|
145
|
+
export interface AuditLike {
|
|
146
|
+
op: 'add' | 'replace' | 'retire' | 'remove' | 'confirm' | 'reject' | 'undo' | 'archive' | 'restore';
|
|
147
|
+
factId: string;
|
|
148
|
+
before?: UserFact;
|
|
149
|
+
after?: UserFact;
|
|
150
|
+
store: 'durable' | 'pending' | 'rejected';
|
|
151
|
+
writer: string;
|
|
152
|
+
turn: string;
|
|
153
|
+
group?: string;
|
|
154
|
+
}
|
|
155
|
+
/** Project one audit change onto its event: kind, reason, decider and sources, from the op, the writer and the fact's own provenance bits (never its wording). */
|
|
156
|
+
export declare function eventFromAudit(a: AuditLike, withImages: boolean): MemoryEventDraft;
|
|
157
|
+
/** Drops quotes and images from every earlier event about a forgotten fact, so the log cannot be used to read it back. */
|
|
158
|
+
export declare function scrubForgotten(log: MemoryEvent[], forgottenKeys: Set<string>): MemoryEvent[];
|
|
159
|
+
/** Keeps the newest `keep` events. */
|
|
160
|
+
export declare function trimEvents(log: MemoryEvent[], keep?: number): MemoryEvent[];
|
|
161
|
+
/**
|
|
162
|
+
* Replays an event stream from empty and returns the ids of the durable facts, in order. This is
|
|
163
|
+
* the correctness check for the log: it must equal `factKey()` over the stored durable list.
|
|
164
|
+
* `unsupported` counts events it cannot replay (an undo reinserts at a recorded position).
|
|
165
|
+
*/
|
|
166
|
+
export declare function foldDurable(events: MemoryEvent[]): {
|
|
167
|
+
ids: string[];
|
|
168
|
+
unsupported: number;
|
|
169
|
+
};
|
|
170
|
+
export interface EventFilter {
|
|
171
|
+
/** A fact id as printed by `formatMemoryEvents` (`f_xxxxxxxx`), or an attribute key. */
|
|
172
|
+
fact?: string;
|
|
173
|
+
kind?: MemoryEventKind;
|
|
174
|
+
}
|
|
175
|
+
export declare function filterEvents(events: MemoryEvent[], f?: EventFilter): MemoryEvent[];
|
|
176
|
+
/** `/memory history events [fact]`: one line per event, with the reason and its sources. Shared by the CLI and chat-ui. */
|
|
177
|
+
export declare function formatMemoryEvents(events: MemoryEvent[]): string;
|
package/dist/memory-service.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { UserFact } from './fact-extraction.js';
|
|
|
4
4
|
import { Corroboration } from './contradiction-checker.js';
|
|
5
5
|
import { DigestStore, SessionDigest } from './episodic-digest.js';
|
|
6
6
|
import { StatedFact, FactCategory } from './turn-intent-classifier.js';
|
|
7
|
+
import { EventSink, EventFilter, MemoryEvent } from './memory-events.js';
|
|
7
8
|
import { MemoryWriteMode, CrossTurnWriter } from './memory-governance.js';
|
|
8
9
|
import { ConsolidationProposal } from './memory-consolidation.js';
|
|
9
10
|
import { VerifiedReviewOp } from './memory-reviewer.js';
|
|
@@ -205,6 +206,8 @@ export declare function memoryBudgetedRenderEnabled(env?: Record<string, string
|
|
|
205
206
|
export declare function memoryWriteGateEnabled(env?: Record<string, string | undefined>): boolean;
|
|
206
207
|
/** `AUDIT_MEMORY_AUDIT_LOG`: append-only `memory:audit`. Default OFF until the pilot; `=0` restores the unlogged path. */
|
|
207
208
|
export declare function memoryAuditLogEnabled(env?: Record<string, string | undefined>): boolean;
|
|
209
|
+
/** `AUDIT_MEMORY_EVENTS`: metadata-only transition events (kind, reason code, source refs, ids; no fact text unless the audit log is on). Default ON; `=0`/`off` restores no events. */
|
|
210
|
+
export declare function memoryEventsEnabled(env?: Record<string, string | undefined>): boolean;
|
|
208
211
|
/** Outcome of `admitCandidate()` for one candidate. `session` = kept session-scoped only, never durable or pending. */
|
|
209
212
|
export interface AdmitDecision {
|
|
210
213
|
action: 'admit' | 'session' | 'flag' | 'drop';
|
|
@@ -280,6 +283,8 @@ export declare class MemoryService {
|
|
|
280
283
|
private readonly writeMode;
|
|
281
284
|
/** Time source for every timestamp this service writes (extractedAt of stated facts, audit `at`, retiredAt, usage flush). Injectable so the cross-runtime conformance fixtures are byte-reproducible; default is wall-clock, i.e. no behaviour change. */
|
|
282
285
|
private readonly clock;
|
|
286
|
+
/** Every fact list goes through this seam (see fact-repository.ts); the key-value implementation keeps today's keys. */
|
|
287
|
+
private readonly repo;
|
|
283
288
|
constructor(memory: MemoryAdapter, reminderStore: ReminderStore, experienceStore: ExperienceStore, llmClient: ILLMClient, model: () => string | undefined,
|
|
284
289
|
/** Resolves to `config.activeProject` if the user set one via `/project <name>`, else the workspace root — read through a getter (same convention as `model` above) so a mid-session `/project`/`/config set activeProject` change takes effect on the very next turn. See UserFact.project's doc comment for how this is used. */
|
|
285
290
|
currentProject?: () => string,
|
|
@@ -358,6 +363,16 @@ export declare class MemoryService {
|
|
|
358
363
|
private flushChain;
|
|
359
364
|
private serialized;
|
|
360
365
|
private appendAudit;
|
|
366
|
+
/** Extra destinations for events (the eval collector); each receives every event, whether or not the stored log is on. */
|
|
367
|
+
private eventSinks;
|
|
368
|
+
private eventSeqLocal;
|
|
369
|
+
addEventSink(sink: EventSink): void;
|
|
370
|
+
/** Stamps seq/at, appends to the stored event log (when `AUDIT_MEMORY_EVENTS` is on) and fans out to the extra sinks. A sink that throws never blocks the memory write. */
|
|
371
|
+
private emitEvents;
|
|
372
|
+
/** `/memory history events [fact]`: the newest transition events, optionally for one fact id or attribute key. */
|
|
373
|
+
getEvents(limit?: number, filter?: EventFilter): Promise<MemoryEvent[]>;
|
|
374
|
+
/** A decision that wrote nothing (a promotion declined, a duplicate, a contradiction found) still leaves an event. */
|
|
375
|
+
private decisionEvent;
|
|
361
376
|
private appendAuditNow;
|
|
362
377
|
/** `/memory history` — newest last; the last `limit` entries. */
|
|
363
378
|
getAuditLog(limit?: number): Promise<AuditEntry[]>;
|
package/dist/model-pricing.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export interface ModelPriceUsd {
|
|
|
10
10
|
outputPerMTok: number;
|
|
11
11
|
/** Rate for input tokens served from the provider's prompt cache; absent = same as inputPerMTok. */
|
|
12
12
|
cachedInputPerMTok?: number;
|
|
13
|
+
/** Rate for input tokens written to the prompt cache; absent = same as inputPerMTok. */
|
|
14
|
+
cacheWritePerMTok?: number;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
17
|
* Returns undefined (rather than a misleading number) when the model is unset or not a recognized one — callers must not silently treat "no estimate" as "free".
|
|
@@ -19,4 +21,5 @@ export declare function estimateCostUsd(model: string | undefined, usage: {
|
|
|
19
21
|
inputTokens: number;
|
|
20
22
|
outputTokens: number;
|
|
21
23
|
cachedInputTokens?: number;
|
|
24
|
+
cacheWriteTokens?: number;
|
|
22
25
|
}): number | undefined;
|