@keb-org/consol 0.2.1 → 0.3.1
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 +55 -13
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -5
- package/dist/mcp.d.ts +2 -0
- package/dist/mcp.js +20422 -0
- package/dist/native.d.ts +5 -3
- package/dist/types.d.ts +99 -89
- package/dist/vault.d.ts +43 -95
- package/package.json +12 -8
package/dist/native.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { type CallOptions, type Context, type Transport } from "./transport";
|
|
2
2
|
import type { Reply } from "./types";
|
|
3
|
-
/**
|
|
3
|
+
/** A contextualized-embeddings endpoint (`POST {url}/contextualizedembeddings`); without it recall stays lexical-only. */
|
|
4
4
|
export interface EmbeddingOptions {
|
|
5
5
|
url: string;
|
|
6
6
|
/** Omit for endpoints that take no key. */
|
|
7
7
|
apiKey?: string;
|
|
8
8
|
model: string;
|
|
9
9
|
dims?: number;
|
|
10
|
-
queryPrefix?: string;
|
|
11
|
-
batchSize?: number;
|
|
12
10
|
timeoutMs?: number;
|
|
13
11
|
}
|
|
14
12
|
/** Jev advice (experimental). */
|
|
@@ -51,6 +49,10 @@ export interface Addon {
|
|
|
51
49
|
/** `location` is the JSON `{"vaultRoot"}` or `{"vault"}`. */
|
|
52
50
|
openEngine(location: string, settings: Record<string, string>): Promise<NativeEngine>;
|
|
53
51
|
setLogSink(sink: ((line: string) => void) | null, level?: string): void;
|
|
52
|
+
/** JSON `{instructions, tools: [{name, description, inputSchema}]}` of the MCP server. Needs no engine. */
|
|
53
|
+
mcpSurface(): string;
|
|
54
|
+
/** The MCP `CallToolResult` (JSON) of a wire reply (JSON) of `tool`. Needs no engine. */
|
|
55
|
+
mcpResult(tool: string, reply: string): string;
|
|
54
56
|
}
|
|
55
57
|
/**
|
|
56
58
|
* Explicit path authoritative (a missing file fails here), then CONSOL_ADDON authoritative, then the
|
package/dist/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { ConsolErrorCode } from "./errors";
|
|
|
3
3
|
type Open<T extends string> = T | (string & {});
|
|
4
4
|
/**
|
|
5
5
|
* The wire reply, the same on every transport. `text` is rendered for an LLM, `result` is the
|
|
6
|
-
* contract payload (receipt fields next to `error` for a failed
|
|
6
|
+
* contract payload (receipt fields next to `error` for a failed token-bound write). Tool
|
|
7
7
|
* errors are replies with `error`, never exceptions.
|
|
8
8
|
*/
|
|
9
9
|
export interface Reply {
|
|
@@ -19,7 +19,7 @@ export interface ToolError {
|
|
|
19
19
|
code: ConsolErrorCode;
|
|
20
20
|
retryable: boolean;
|
|
21
21
|
message: string;
|
|
22
|
-
/** Input at fault as a path, e.g. `decisions[2].
|
|
22
|
+
/** Input at fault as a path, e.g. `decisions[2].refs[0]`; only when one input is to blame. */
|
|
23
23
|
field?: string;
|
|
24
24
|
}
|
|
25
25
|
/** Part of a successful call that could not be done; an empty list means nothing was degraded. */
|
|
@@ -103,19 +103,33 @@ export interface RecallCard {
|
|
|
103
103
|
relationships?: Relationship[];
|
|
104
104
|
linked_via?: string;
|
|
105
105
|
compact?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* The note's best passage whole (its `#`/`##` section, or part of a long one), as UTF-8 byte
|
|
108
|
+
* offsets into the text `read` returns: what a caller quotes when an excerpt window is too short to
|
|
109
|
+
* carry the evidence (`sliceUtf8(text, ...passage.byte_range)`). Full and lead cards.
|
|
110
|
+
*/
|
|
111
|
+
passage?: {
|
|
112
|
+
byte_range: ByteRange;
|
|
113
|
+
heading_context?: string;
|
|
114
|
+
};
|
|
106
115
|
}
|
|
107
116
|
/** Every `jev`, `jev_triage` and `jev_advisory` field is experimental: present only with Jev configured. */
|
|
108
117
|
export type Experimental = Record<string, unknown>;
|
|
109
|
-
/** `recall` payload: at most
|
|
118
|
+
/** `recall` payload: at most 30 cards (100 for a `*` query), linked companions included. */
|
|
110
119
|
export interface RecallResult {
|
|
111
120
|
/**
|
|
112
121
|
* The progressive disclosure as a model reads it: full cards with excerpts, lead and id cards,
|
|
113
|
-
* the
|
|
122
|
+
* the blocks its query symbols ask for and the hints. `candidates` are the same cards as data.
|
|
114
123
|
*/
|
|
115
124
|
text: string;
|
|
116
125
|
candidates: RecallCard[];
|
|
117
126
|
/** True when more matched cards or companions were omitted. */
|
|
118
127
|
truncated: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* No note is near the top of both the word and the meaning search: the vault may not hold the
|
|
130
|
+
* answer. Without a judge, treat it as "not found" where a wrong answer costs more than none.
|
|
131
|
+
*/
|
|
132
|
+
weak_evidence: boolean;
|
|
119
133
|
unavailable: Unavailable[];
|
|
120
134
|
jev?: Experimental;
|
|
121
135
|
}
|
|
@@ -131,7 +145,7 @@ export interface EntityAffectedGroup {
|
|
|
131
145
|
entity: string;
|
|
132
146
|
docs: AffectedDoc[];
|
|
133
147
|
}
|
|
134
|
-
/** `remember` receipt; a
|
|
148
|
+
/** `remember` receipt; a token-bound write adds `reflection_write` to this same shape. */
|
|
135
149
|
export interface RememberResult {
|
|
136
150
|
changed: boolean;
|
|
137
151
|
indexed: boolean;
|
|
@@ -145,8 +159,10 @@ export interface RememberResult {
|
|
|
145
159
|
affected: AffectedDoc[];
|
|
146
160
|
entity_affected: EntityAffectedGroup[];
|
|
147
161
|
unavailable: Unavailable[];
|
|
148
|
-
/** Outcome of a
|
|
162
|
+
/** Outcome of a token-bound write (and of the write-token resume form). */
|
|
149
163
|
reflection_write?: WriteOutcome;
|
|
164
|
+
/** `meta.<key>` for each `meta` key the server does not know; absent when there are none. */
|
|
165
|
+
ignored?: string[];
|
|
150
166
|
jev?: Experimental;
|
|
151
167
|
}
|
|
152
168
|
/** `remove` receipt: the note is archived, its body stays readable and editable. */
|
|
@@ -163,7 +179,7 @@ export interface RemoveResult {
|
|
|
163
179
|
reflection_write?: WriteOutcome;
|
|
164
180
|
jev?: Experimental;
|
|
165
181
|
}
|
|
166
|
-
/** Durable state of a
|
|
182
|
+
/** Durable state of a token-bound write (open); only `succeeded` published bytes. */
|
|
167
183
|
export type WriteState = Open<"pending" | "succeeded" | "conflicted" | "abandoned">;
|
|
168
184
|
/** Why a reflection write has not succeeded yet (open); resume or abandon it explicitly. */
|
|
169
185
|
export type WriteFailureCode = Open<"source_conflict" | "basis_changed" | "index_pending" | "publication_pending" | "receipt_pending">;
|
|
@@ -180,10 +196,13 @@ export interface WriteResolution {
|
|
|
180
196
|
inspected: SourceRef | null;
|
|
181
197
|
reason: string;
|
|
182
198
|
}
|
|
183
|
-
/** Outcome of one
|
|
199
|
+
/** Outcome of one token-bound write; a write never completes the work by itself. */
|
|
184
200
|
export interface WriteOutcome {
|
|
185
|
-
|
|
186
|
-
|
|
201
|
+
/** Write token: resume the write with it through `tool`, or abandon it through `reflect`. */
|
|
202
|
+
token: string;
|
|
203
|
+
tool: "remember" | "remove";
|
|
204
|
+
/** The note the write targets. */
|
|
205
|
+
id: string;
|
|
187
206
|
state: WriteState;
|
|
188
207
|
/** True for a replayed terminal outcome: it describes history, not the current source. */
|
|
189
208
|
historical: boolean;
|
|
@@ -193,8 +212,16 @@ export interface WriteOutcome {
|
|
|
193
212
|
resolution: WriteResolution | null;
|
|
194
213
|
failure_code: WriteFailureCode | null;
|
|
195
214
|
}
|
|
196
|
-
/**
|
|
197
|
-
export
|
|
215
|
+
/** An unresolved (pending or conflicted) write, as `reflect` lists every one of them on every call. */
|
|
216
|
+
export interface UnresolvedWrite {
|
|
217
|
+
token: string;
|
|
218
|
+
tool: "remember" | "remove";
|
|
219
|
+
id: string;
|
|
220
|
+
state: WriteState;
|
|
221
|
+
failure_code: WriteFailureCode | null;
|
|
222
|
+
}
|
|
223
|
+
/** Queue state of a work item that is not open for a decision; only an accepted decision completes work. */
|
|
224
|
+
export type ItemStatus = Open<"completed" | "stale">;
|
|
198
225
|
/** Pair found through a link authored in `owner`. */
|
|
199
226
|
export interface AuthoredLead {
|
|
200
227
|
route: "authored";
|
|
@@ -236,43 +263,6 @@ export interface PromotionLead {
|
|
|
236
263
|
scope: "skills" | "core";
|
|
237
264
|
existing: string[];
|
|
238
265
|
}
|
|
239
|
-
/** Sources a work item was judged on; the basis hash binds decisions to exactly these versions. */
|
|
240
|
-
export interface WorkBasis<L> {
|
|
241
|
-
subjects: SourceRef[];
|
|
242
|
-
sources: SourceRef[];
|
|
243
|
-
lead: L;
|
|
244
|
-
}
|
|
245
|
-
/** Shared by every work kind, so they stay readable before narrowing on `kind`. */
|
|
246
|
-
export interface WorkBase {
|
|
247
|
-
work_id: string;
|
|
248
|
-
basis_hash: string;
|
|
249
|
-
status: WorkStatus;
|
|
250
|
-
}
|
|
251
|
-
/** Review one note; source work carries no lead. */
|
|
252
|
-
export interface SourceWork extends WorkBase {
|
|
253
|
-
kind: "source";
|
|
254
|
-
basis: {
|
|
255
|
-
subjects: SourceRef[];
|
|
256
|
-
sources: SourceRef[];
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
/** Compare two notes. */
|
|
260
|
-
export interface PairWork extends WorkBase {
|
|
261
|
-
kind: "pair";
|
|
262
|
-
basis: WorkBasis<PairLead>;
|
|
263
|
-
}
|
|
264
|
-
/** Form, attach to or bridge a hub. Unstable: checked against Rust source only. */
|
|
265
|
-
export interface HubWork extends WorkBase {
|
|
266
|
-
kind: "hub_attachment" | "hub_formation" | "hub_bridge";
|
|
267
|
-
basis: WorkBasis<HubLead>;
|
|
268
|
-
}
|
|
269
|
-
/** Promote recurring knowledge to skills/core. Unstable: checked against Rust source only. */
|
|
270
|
-
export interface PromotionWork extends WorkBase {
|
|
271
|
-
kind: "promotion";
|
|
272
|
-
basis: WorkBasis<PromotionLead>;
|
|
273
|
-
}
|
|
274
|
-
/** A delivered work item, discriminated on `kind`. */
|
|
275
|
-
export type ReflectionWork = SourceWork | PairWork | HubWork | PromotionWork;
|
|
276
266
|
/** Markdown block of a delivered source, as a suggested excerpt boundary. */
|
|
277
267
|
export interface CandidateBlock {
|
|
278
268
|
byte_range: ByteRange;
|
|
@@ -287,50 +277,62 @@ export interface DeliveredSource {
|
|
|
287
277
|
/** Suggested body spans, not a replacement for inspection. */
|
|
288
278
|
candidate_blocks: CandidateBlock[];
|
|
289
279
|
}
|
|
290
|
-
/**
|
|
291
|
-
export interface
|
|
292
|
-
|
|
280
|
+
/** Shared by every work kind, so they stay readable before narrowing on `kind`. */
|
|
281
|
+
export interface ItemBase {
|
|
282
|
+
/** Work token: pass it to `remember` / `remove` to bind a write, and in a decision. Opaque. */
|
|
283
|
+
token: string;
|
|
284
|
+
/** What the server offers for this item (open: it grows without a schema change); empty when `status` is set. */
|
|
285
|
+
verdicts: string[];
|
|
286
|
+
/** The evidence each verdict requires. */
|
|
287
|
+
needs: string[];
|
|
288
|
+
subjects: SourceRef[];
|
|
289
|
+
/** The complete Markdown of every source the item was judged on. */
|
|
293
290
|
sources: DeliveredSource[];
|
|
294
|
-
|
|
291
|
+
/** Present only when the work is not open for a decision (`verdicts` is then empty). */
|
|
292
|
+
status?: ItemStatus;
|
|
295
293
|
jev_advisory?: Experimental;
|
|
296
294
|
}
|
|
297
|
-
/**
|
|
298
|
-
export interface
|
|
299
|
-
|
|
300
|
-
work_id?: string;
|
|
301
|
-
/** Present for a requested source (`ids` mode). */
|
|
302
|
-
requested_id?: string;
|
|
303
|
-
complete: false;
|
|
304
|
-
error: ToolError;
|
|
295
|
+
/** Review one note; source work carries no lead. */
|
|
296
|
+
export interface SourceItem extends ItemBase {
|
|
297
|
+
kind: "source";
|
|
305
298
|
}
|
|
306
|
-
/**
|
|
307
|
-
export
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
export
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
299
|
+
/** Compare two notes. `validity` is computed from their bounds; where it is `unknown` a verdict may carry a second word. */
|
|
300
|
+
export interface PairItem extends ItemBase {
|
|
301
|
+
kind: "pair";
|
|
302
|
+
lead: PairLead;
|
|
303
|
+
validity?: Open<"overlap" | "disjoint" | "empty" | "unknown">;
|
|
304
|
+
}
|
|
305
|
+
/** Form, attach to or bridge a hub. Unstable: checked against Rust source only. */
|
|
306
|
+
export interface HubItem extends ItemBase {
|
|
307
|
+
kind: "hub_attachment" | "hub_formation" | "hub_bridge";
|
|
308
|
+
lead: HubLead;
|
|
309
|
+
}
|
|
310
|
+
/** Promote recurring knowledge to skills/core. Unstable: checked against Rust source only. */
|
|
311
|
+
export interface PromotionItem extends ItemBase {
|
|
312
|
+
kind: "promotion";
|
|
313
|
+
lead: PromotionLead;
|
|
319
314
|
}
|
|
320
|
-
/**
|
|
321
|
-
export
|
|
322
|
-
|
|
323
|
-
|
|
315
|
+
/** A delivered work item, discriminated on `kind`. */
|
|
316
|
+
export type ReflectItem = SourceItem | PairItem | HubItem | PromotionItem;
|
|
317
|
+
/** Accepted decision; `verdict` repeats the outcome (and a pair's validity word). */
|
|
318
|
+
export interface AcceptedDecision {
|
|
319
|
+
token: string;
|
|
324
320
|
accepted: true;
|
|
321
|
+
verdict: string;
|
|
325
322
|
}
|
|
326
323
|
/** Failed decision; the call still succeeds and later decisions still run. */
|
|
327
324
|
export interface RejectedDecision {
|
|
328
|
-
|
|
325
|
+
token: string;
|
|
329
326
|
accepted: false;
|
|
330
327
|
error: ToolError;
|
|
331
328
|
}
|
|
332
329
|
/** One entry of `reflect().decisions`, in submission order. */
|
|
333
|
-
export type DecisionReceipt = AcceptedDecision |
|
|
330
|
+
export type DecisionReceipt = AcceptedDecision | RejectedDecision;
|
|
331
|
+
/** A `focus` target that could not be delivered, or a work that failed to deliver; the call itself succeeded. */
|
|
332
|
+
export interface FocusError {
|
|
333
|
+
focus: string;
|
|
334
|
+
error: ToolError;
|
|
335
|
+
}
|
|
334
336
|
/** Discovery lanes in the order the server reports them. */
|
|
335
337
|
export type ReflectionLane = "source" | "semantic_pairs" | "structural_pairs" | "hubs" | "promotions";
|
|
336
338
|
/** Progress of one discovery page. */
|
|
@@ -359,7 +361,7 @@ export type DiscoveryLane = {
|
|
|
359
361
|
error: ToolError;
|
|
360
362
|
current_complete?: boolean;
|
|
361
363
|
};
|
|
362
|
-
/** Queue counters; `done` is true only when every lane is
|
|
364
|
+
/** Queue counters; `done` is true only when every lane is current and nothing is open. */
|
|
363
365
|
export interface ReflectCounters {
|
|
364
366
|
pending: number;
|
|
365
367
|
blocked: number;
|
|
@@ -367,17 +369,25 @@ export interface ReflectCounters {
|
|
|
367
369
|
unresolved_writes: number;
|
|
368
370
|
done: boolean;
|
|
369
371
|
}
|
|
370
|
-
/**
|
|
372
|
+
/** What to do next: `resume` unresolved writes, `decide` the delivered items, `continue` the scan, or `done`. */
|
|
373
|
+
export type ReflectNext = Open<"resume" | "decide" | "continue" | "done">;
|
|
374
|
+
/**
|
|
375
|
+
* `reflect` payload. One call applies its decisions, then delivers work, so a loop is: call with the
|
|
376
|
+
* decisions so far and follow `next`. `writes` lists every unresolved write on every call.
|
|
377
|
+
*/
|
|
371
378
|
export interface ReflectResult {
|
|
372
|
-
|
|
379
|
+
next: ReflectNext;
|
|
380
|
+
items: ReflectItem[];
|
|
381
|
+
writes: UnresolvedWrite[];
|
|
382
|
+
/** Work tokens of blocked work; pass one in `focus` to reopen it. */
|
|
383
|
+
blocked: string[];
|
|
373
384
|
decisions: DecisionReceipt[];
|
|
374
|
-
writes: WriteOutcome[];
|
|
375
|
-
/** Lanes are filled by discovery (no targets) only. */
|
|
376
|
-
discovery: {
|
|
377
|
-
completion_checked: boolean;
|
|
378
|
-
lanes: DiscoveryLane[];
|
|
379
|
-
};
|
|
380
385
|
counters: ReflectCounters;
|
|
386
|
+
/** Empty when `focus` named targets. */
|
|
387
|
+
lanes: DiscoveryLane[];
|
|
388
|
+
/** `focus` symbols this version does not know. */
|
|
389
|
+
ignored?: string[];
|
|
390
|
+
errors?: FocusError[];
|
|
381
391
|
jev?: Experimental;
|
|
382
392
|
jev_triage?: Experimental;
|
|
383
393
|
}
|
package/dist/vault.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type EngineOptions } from "./native";
|
|
2
2
|
import { type CallOptions } from "./transport";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ReadResult, RecallResult, Reply, ReflectResult, RememberResult, RemoveResult, Scope } from "./types";
|
|
4
4
|
export { sliceUtf8 } from "./types";
|
|
5
5
|
export declare const CLIENT_INFO: {
|
|
6
6
|
name: string;
|
|
@@ -24,88 +24,28 @@ export interface HostedOptions {
|
|
|
24
24
|
/** Default per-call deadline in ms (300000); 0 disables it. */
|
|
25
25
|
timeoutMs?: number;
|
|
26
26
|
}
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
export interface
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
content_version: string;
|
|
38
|
-
}
|
|
39
|
-
/** Body byte range (UTF-8, frontmatter excluded) that a decision cites as evidence. */
|
|
40
|
-
export interface InspectedSpan {
|
|
41
|
-
source: InspectedSource;
|
|
42
|
-
byte_range: [number, number];
|
|
43
|
-
}
|
|
44
|
-
/** Required for completed pair decisions so validity periods are compared, not assumed. */
|
|
45
|
-
export interface TemporalAssessment {
|
|
46
|
-
validity: "overlap" | "disjoint" | "empty" | "unknown";
|
|
27
|
+
/**
|
|
28
|
+
* One outcome for `reflect({ decisions })`. `token` is an item's work token, or a write token to
|
|
29
|
+
* abandon that write. `verdict` is one of the item's `verdicts` (`abandon` for a write token); a
|
|
30
|
+
* pair verdict may add `overlap`, `disjoint` or `empty` only where the item's `validity` is unknown.
|
|
31
|
+
* `refs` is what you inspected: `id@version` (a whole source) or `id@version#start-end` (a body
|
|
32
|
+
* span, UTF-8 byte offsets). `outputs` are the notes the work produced or relied on, `id@version`.
|
|
33
|
+
*/
|
|
34
|
+
export interface Decision {
|
|
35
|
+
token: string;
|
|
36
|
+
verdict: string;
|
|
47
37
|
reason: string;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
/** Names the authored link a `linked` pair decision relies on. */
|
|
52
|
-
export interface PairAssertion {
|
|
53
|
-
owner: InspectedSource;
|
|
54
|
-
src: string;
|
|
55
|
-
dst: string;
|
|
56
|
-
relation: "derives" | "causes" | "contradicts" | "questions";
|
|
38
|
+
refs?: string[];
|
|
39
|
+
outputs?: string[];
|
|
57
40
|
}
|
|
58
41
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
42
|
+
* Flat wire args for recall. Symbols in `query` (whitespace-separated punctuation tokens): `*` breadth,
|
|
43
|
+
* `~` chronology, `^` latest, `+` history, `#` numbers as words only, and `=` literal: the text as
|
|
44
|
+
* written, with no phrases, alternatives, ranges or other symbols (for free text an application passes).
|
|
62
45
|
*/
|
|
63
|
-
export type Decision = {
|
|
64
|
-
kind: "source";
|
|
65
|
-
work_id: string;
|
|
66
|
-
basis_hash: string;
|
|
67
|
-
disposition: SourceDisposition;
|
|
68
|
-
reason: string;
|
|
69
|
-
outputs?: InspectedSource[];
|
|
70
|
-
action_keys?: string[];
|
|
71
|
-
retry_after_ms?: number;
|
|
72
|
-
} | {
|
|
73
|
-
kind: "pair";
|
|
74
|
-
work_id: string;
|
|
75
|
-
basis_hash: string;
|
|
76
|
-
disposition: PairDisposition;
|
|
77
|
-
reason: string;
|
|
78
|
-
temporal?: TemporalAssessment;
|
|
79
|
-
assertion?: PairAssertion;
|
|
80
|
-
action_keys?: string[];
|
|
81
|
-
retry_after_ms?: number;
|
|
82
|
-
} | {
|
|
83
|
-
kind: "hub" | "promotion";
|
|
84
|
-
work_id: string;
|
|
85
|
-
basis_hash: string;
|
|
86
|
-
disposition: ConsolidationDisposition;
|
|
87
|
-
reason: string;
|
|
88
|
-
outputs?: InspectedSource[];
|
|
89
|
-
evidence?: InspectedSpan[];
|
|
90
|
-
action_keys?: string[];
|
|
91
|
-
retry_after_ms?: number;
|
|
92
|
-
} | {
|
|
93
|
-
kind: "abandon_write";
|
|
94
|
-
work_id: string;
|
|
95
|
-
basis_hash: string;
|
|
96
|
-
action_key: string;
|
|
97
|
-
inspected: InspectedSource | null;
|
|
98
|
-
reason: string;
|
|
99
|
-
};
|
|
100
|
-
/** What a recall question asks for beyond its terms; the caller declares it, in any language. */
|
|
101
|
-
export type Intent = "breadth" | "chronology" | "latest";
|
|
102
|
-
/** Flat wire args for recall. */
|
|
103
46
|
export interface RecallArgs {
|
|
104
47
|
query: string;
|
|
105
48
|
agent?: string;
|
|
106
|
-
include_history?: boolean;
|
|
107
|
-
limit?: number;
|
|
108
|
-
intents?: Intent[];
|
|
109
49
|
}
|
|
110
50
|
/** Flat wire args for read. */
|
|
111
51
|
export interface ReadArgs {
|
|
@@ -114,8 +54,8 @@ export interface ReadArgs {
|
|
|
114
54
|
continuation?: string;
|
|
115
55
|
}
|
|
116
56
|
/**
|
|
117
|
-
*
|
|
118
|
-
*
|
|
57
|
+
* Wire args for remember. Omitted or null `content` preserves the body. Without `expected_version`
|
|
58
|
+
* the write is create-only.
|
|
119
59
|
*/
|
|
120
60
|
export interface RememberArgs {
|
|
121
61
|
id: string;
|
|
@@ -123,35 +63,43 @@ export interface RememberArgs {
|
|
|
123
63
|
/** Markdown body only, never frontmatter. */
|
|
124
64
|
content?: string | null;
|
|
125
65
|
expected_version?: string;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
66
|
+
/**
|
|
67
|
+
* A key left out keeps its value; null, "" or [] clears it (not `scope` or `team`: null keeps
|
|
68
|
+
* them). `valid_from`/`valid_to` are `YYYY-MM-DD` or RFC 3339 with `Z`/offset. A key the server
|
|
69
|
+
* does not know is ignored and listed in the receipt's `ignored`.
|
|
70
|
+
*/
|
|
71
|
+
meta?: {
|
|
72
|
+
summary?: string | null;
|
|
73
|
+
entities?: string[] | null;
|
|
74
|
+
facets?: string[] | null;
|
|
75
|
+
scope?: Scope | null;
|
|
76
|
+
team?: string | null;
|
|
77
|
+
valid_from?: string | null;
|
|
78
|
+
valid_to?: string | null;
|
|
79
|
+
/** false: this note's `[[...]]` in prose is text, not a link (imported citations such as `[[1]]`). */
|
|
80
|
+
links?: boolean | null;
|
|
81
|
+
[key: string]: unknown;
|
|
82
|
+
};
|
|
83
|
+
/** An item's work token from `reflect` binds this write to that work; the server derives its action key. */
|
|
84
|
+
token?: string;
|
|
135
85
|
}
|
|
136
86
|
/** Flat wire args for remove (archives the note; its body stays readable). */
|
|
137
87
|
export interface RemoveArgs {
|
|
138
88
|
id: string;
|
|
139
89
|
expected_version: string;
|
|
140
90
|
agent?: string;
|
|
141
|
-
|
|
91
|
+
/** An item's work token from `reflect` records this archive as one write of that work. */
|
|
92
|
+
token?: string;
|
|
142
93
|
}
|
|
143
|
-
/** Resume a
|
|
94
|
+
/** Resume (or replay) a write by its write token, with the tool that wrote it. */
|
|
144
95
|
export interface ResumeArgs {
|
|
145
|
-
|
|
146
|
-
reflection: ReflectionContext;
|
|
96
|
+
token: string;
|
|
147
97
|
agent?: string;
|
|
148
98
|
}
|
|
149
|
-
/** Flat wire args for reflect. */
|
|
99
|
+
/** Flat wire args for reflect. `focus` is whitespace-separated work tokens and note ids. */
|
|
150
100
|
export interface ReflectArgs {
|
|
151
101
|
agent?: string;
|
|
152
|
-
|
|
153
|
-
work_ids?: string[];
|
|
154
|
-
limit?: number;
|
|
102
|
+
focus?: string;
|
|
155
103
|
decisions?: Decision[];
|
|
156
104
|
}
|
|
157
105
|
/** One vault behind a transport (the in-process engine or a hosted backend). Build it with createVault or openVault; close() is final. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keb-org/consol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Consol memory engine SDK: a local vault, a hosted vault client, and the Consol backend class",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
"require": "./dist/index.js"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
+
"bin": {
|
|
33
|
+
"consol-mcp": "dist/mcp.js"
|
|
34
|
+
},
|
|
32
35
|
"files": [
|
|
33
36
|
"dist"
|
|
34
37
|
],
|
|
@@ -37,7 +40,7 @@
|
|
|
37
40
|
},
|
|
38
41
|
"license": "MIT",
|
|
39
42
|
"scripts": {
|
|
40
|
-
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && bun build src/index.ts --outfile dist/index.js --target node --format cjs && cp src/index.mjs dist/index.mjs && tsc --emitDeclarationOnly --pretty false",
|
|
43
|
+
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && bun build src/index.ts --outfile dist/index.js --target node --format cjs && bun build src/mcp.ts --outfile dist/mcp.js --target node --format cjs && cp src/index.mjs dist/index.mjs && tsc --emitDeclarationOnly --pretty false",
|
|
41
44
|
"typecheck": "tsc --noEmit --pretty false",
|
|
42
45
|
"test": "bun run build && bun test/pure.ts && node test/http.ts && node test/native.ts && node test/sdk.ts && tsc --noEmit --pretty false -p test",
|
|
43
46
|
"test:offline": "bun run build && bun test/pure.ts && node test/http.ts && node test/native.ts && tsc --noEmit --pretty false -p test",
|
|
@@ -45,16 +48,17 @@
|
|
|
45
48
|
},
|
|
46
49
|
"devDependencies": {
|
|
47
50
|
"typescript": "5.3.3",
|
|
48
|
-
"@types/node": "20.11.0"
|
|
51
|
+
"@types/node": "20.11.0",
|
|
52
|
+
"@modelcontextprotocol/server": "2.3.1"
|
|
49
53
|
},
|
|
50
54
|
"publishConfig": {
|
|
51
55
|
"access": "public"
|
|
52
56
|
},
|
|
53
57
|
"optionalDependencies": {
|
|
54
|
-
"@keb-org/consol-win32-x64": "0.
|
|
55
|
-
"@keb-org/consol-darwin-arm64": "0.
|
|
56
|
-
"@keb-org/consol-darwin-x64": "0.
|
|
57
|
-
"@keb-org/consol-linux-x64": "0.
|
|
58
|
-
"@keb-org/consol-linux-arm64": "0.
|
|
58
|
+
"@keb-org/consol-win32-x64": "0.3.1",
|
|
59
|
+
"@keb-org/consol-darwin-arm64": "0.3.1",
|
|
60
|
+
"@keb-org/consol-darwin-x64": "0.3.1",
|
|
61
|
+
"@keb-org/consol-linux-x64": "0.3.1",
|
|
62
|
+
"@keb-org/consol-linux-arm64": "0.3.1"
|
|
59
63
|
}
|
|
60
64
|
}
|