@keb-org/consol 0.2.1 → 0.3.0
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 +85 -89
- package/dist/vault.d.ts +37 -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. */
|
|
@@ -106,11 +106,11 @@ export interface RecallCard {
|
|
|
106
106
|
}
|
|
107
107
|
/** Every `jev`, `jev_triage` and `jev_advisory` field is experimental: present only with Jev configured. */
|
|
108
108
|
export type Experimental = Record<string, unknown>;
|
|
109
|
-
/** `recall` payload: at most
|
|
109
|
+
/** `recall` payload: at most 30 cards (100 for a `*` query), linked companions included. */
|
|
110
110
|
export interface RecallResult {
|
|
111
111
|
/**
|
|
112
112
|
* The progressive disclosure as a model reads it: full cards with excerpts, lead and id cards,
|
|
113
|
-
* the
|
|
113
|
+
* the blocks its query symbols ask for and the hints. `candidates` are the same cards as data.
|
|
114
114
|
*/
|
|
115
115
|
text: string;
|
|
116
116
|
candidates: RecallCard[];
|
|
@@ -131,7 +131,7 @@ export interface EntityAffectedGroup {
|
|
|
131
131
|
entity: string;
|
|
132
132
|
docs: AffectedDoc[];
|
|
133
133
|
}
|
|
134
|
-
/** `remember` receipt; a
|
|
134
|
+
/** `remember` receipt; a token-bound write adds `reflection_write` to this same shape. */
|
|
135
135
|
export interface RememberResult {
|
|
136
136
|
changed: boolean;
|
|
137
137
|
indexed: boolean;
|
|
@@ -145,8 +145,10 @@ export interface RememberResult {
|
|
|
145
145
|
affected: AffectedDoc[];
|
|
146
146
|
entity_affected: EntityAffectedGroup[];
|
|
147
147
|
unavailable: Unavailable[];
|
|
148
|
-
/** Outcome of a
|
|
148
|
+
/** Outcome of a token-bound write (and of the write-token resume form). */
|
|
149
149
|
reflection_write?: WriteOutcome;
|
|
150
|
+
/** `meta.<key>` for each `meta` key the server does not know; absent when there are none. */
|
|
151
|
+
ignored?: string[];
|
|
150
152
|
jev?: Experimental;
|
|
151
153
|
}
|
|
152
154
|
/** `remove` receipt: the note is archived, its body stays readable and editable. */
|
|
@@ -163,7 +165,7 @@ export interface RemoveResult {
|
|
|
163
165
|
reflection_write?: WriteOutcome;
|
|
164
166
|
jev?: Experimental;
|
|
165
167
|
}
|
|
166
|
-
/** Durable state of a
|
|
168
|
+
/** Durable state of a token-bound write (open); only `succeeded` published bytes. */
|
|
167
169
|
export type WriteState = Open<"pending" | "succeeded" | "conflicted" | "abandoned">;
|
|
168
170
|
/** Why a reflection write has not succeeded yet (open); resume or abandon it explicitly. */
|
|
169
171
|
export type WriteFailureCode = Open<"source_conflict" | "basis_changed" | "index_pending" | "publication_pending" | "receipt_pending">;
|
|
@@ -180,10 +182,13 @@ export interface WriteResolution {
|
|
|
180
182
|
inspected: SourceRef | null;
|
|
181
183
|
reason: string;
|
|
182
184
|
}
|
|
183
|
-
/** Outcome of one
|
|
185
|
+
/** Outcome of one token-bound write; a write never completes the work by itself. */
|
|
184
186
|
export interface WriteOutcome {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
+
/** Write token: resume the write with it through `tool`, or abandon it through `reflect`. */
|
|
188
|
+
token: string;
|
|
189
|
+
tool: "remember" | "remove";
|
|
190
|
+
/** The note the write targets. */
|
|
191
|
+
id: string;
|
|
187
192
|
state: WriteState;
|
|
188
193
|
/** True for a replayed terminal outcome: it describes history, not the current source. */
|
|
189
194
|
historical: boolean;
|
|
@@ -193,8 +198,16 @@ export interface WriteOutcome {
|
|
|
193
198
|
resolution: WriteResolution | null;
|
|
194
199
|
failure_code: WriteFailureCode | null;
|
|
195
200
|
}
|
|
196
|
-
/**
|
|
197
|
-
export
|
|
201
|
+
/** An unresolved (pending or conflicted) write, as `reflect` lists every one of them on every call. */
|
|
202
|
+
export interface UnresolvedWrite {
|
|
203
|
+
token: string;
|
|
204
|
+
tool: "remember" | "remove";
|
|
205
|
+
id: string;
|
|
206
|
+
state: WriteState;
|
|
207
|
+
failure_code: WriteFailureCode | null;
|
|
208
|
+
}
|
|
209
|
+
/** Queue state of a work item that is not open for a decision; only an accepted decision completes work. */
|
|
210
|
+
export type ItemStatus = Open<"completed" | "stale">;
|
|
198
211
|
/** Pair found through a link authored in `owner`. */
|
|
199
212
|
export interface AuthoredLead {
|
|
200
213
|
route: "authored";
|
|
@@ -236,43 +249,6 @@ export interface PromotionLead {
|
|
|
236
249
|
scope: "skills" | "core";
|
|
237
250
|
existing: string[];
|
|
238
251
|
}
|
|
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
252
|
/** Markdown block of a delivered source, as a suggested excerpt boundary. */
|
|
277
253
|
export interface CandidateBlock {
|
|
278
254
|
byte_range: ByteRange;
|
|
@@ -287,50 +263,62 @@ export interface DeliveredSource {
|
|
|
287
263
|
/** Suggested body spans, not a replacement for inspection. */
|
|
288
264
|
candidate_blocks: CandidateBlock[];
|
|
289
265
|
}
|
|
290
|
-
/**
|
|
291
|
-
export interface
|
|
292
|
-
|
|
266
|
+
/** Shared by every work kind, so they stay readable before narrowing on `kind`. */
|
|
267
|
+
export interface ItemBase {
|
|
268
|
+
/** Work token: pass it to `remember` / `remove` to bind a write, and in a decision. Opaque. */
|
|
269
|
+
token: string;
|
|
270
|
+
/** What the server offers for this item (open: it grows without a schema change); empty when `status` is set. */
|
|
271
|
+
verdicts: string[];
|
|
272
|
+
/** The evidence each verdict requires. */
|
|
273
|
+
needs: string[];
|
|
274
|
+
subjects: SourceRef[];
|
|
275
|
+
/** The complete Markdown of every source the item was judged on. */
|
|
293
276
|
sources: DeliveredSource[];
|
|
294
|
-
|
|
277
|
+
/** Present only when the work is not open for a decision (`verdicts` is then empty). */
|
|
278
|
+
status?: ItemStatus;
|
|
295
279
|
jev_advisory?: Experimental;
|
|
296
280
|
}
|
|
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;
|
|
281
|
+
/** Review one note; source work carries no lead. */
|
|
282
|
+
export interface SourceItem extends ItemBase {
|
|
283
|
+
kind: "source";
|
|
305
284
|
}
|
|
306
|
-
/**
|
|
307
|
-
export
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
export
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
work_id: string;
|
|
317
|
-
accepted: true;
|
|
318
|
-
status: SourceDisposition | PairDisposition | ConsolidationDisposition;
|
|
285
|
+
/** Compare two notes. `validity` is computed from their bounds; where it is `unknown` a verdict may carry a second word. */
|
|
286
|
+
export interface PairItem extends ItemBase {
|
|
287
|
+
kind: "pair";
|
|
288
|
+
lead: PairLead;
|
|
289
|
+
validity?: Open<"overlap" | "disjoint" | "empty" | "unknown">;
|
|
290
|
+
}
|
|
291
|
+
/** Form, attach to or bridge a hub. Unstable: checked against Rust source only. */
|
|
292
|
+
export interface HubItem extends ItemBase {
|
|
293
|
+
kind: "hub_attachment" | "hub_formation" | "hub_bridge";
|
|
294
|
+
lead: HubLead;
|
|
319
295
|
}
|
|
320
|
-
/**
|
|
321
|
-
export interface
|
|
322
|
-
|
|
323
|
-
|
|
296
|
+
/** Promote recurring knowledge to skills/core. Unstable: checked against Rust source only. */
|
|
297
|
+
export interface PromotionItem extends ItemBase {
|
|
298
|
+
kind: "promotion";
|
|
299
|
+
lead: PromotionLead;
|
|
300
|
+
}
|
|
301
|
+
/** A delivered work item, discriminated on `kind`. */
|
|
302
|
+
export type ReflectItem = SourceItem | PairItem | HubItem | PromotionItem;
|
|
303
|
+
/** Accepted decision; `verdict` repeats the outcome (and a pair's validity word). */
|
|
304
|
+
export interface AcceptedDecision {
|
|
305
|
+
token: string;
|
|
324
306
|
accepted: true;
|
|
307
|
+
verdict: string;
|
|
325
308
|
}
|
|
326
309
|
/** Failed decision; the call still succeeds and later decisions still run. */
|
|
327
310
|
export interface RejectedDecision {
|
|
328
|
-
|
|
311
|
+
token: string;
|
|
329
312
|
accepted: false;
|
|
330
313
|
error: ToolError;
|
|
331
314
|
}
|
|
332
315
|
/** One entry of `reflect().decisions`, in submission order. */
|
|
333
|
-
export type DecisionReceipt = AcceptedDecision |
|
|
316
|
+
export type DecisionReceipt = AcceptedDecision | RejectedDecision;
|
|
317
|
+
/** A `focus` target that could not be delivered, or a work that failed to deliver; the call itself succeeded. */
|
|
318
|
+
export interface FocusError {
|
|
319
|
+
focus: string;
|
|
320
|
+
error: ToolError;
|
|
321
|
+
}
|
|
334
322
|
/** Discovery lanes in the order the server reports them. */
|
|
335
323
|
export type ReflectionLane = "source" | "semantic_pairs" | "structural_pairs" | "hubs" | "promotions";
|
|
336
324
|
/** Progress of one discovery page. */
|
|
@@ -359,7 +347,7 @@ export type DiscoveryLane = {
|
|
|
359
347
|
error: ToolError;
|
|
360
348
|
current_complete?: boolean;
|
|
361
349
|
};
|
|
362
|
-
/** Queue counters; `done` is true only when every lane is
|
|
350
|
+
/** Queue counters; `done` is true only when every lane is current and nothing is open. */
|
|
363
351
|
export interface ReflectCounters {
|
|
364
352
|
pending: number;
|
|
365
353
|
blocked: number;
|
|
@@ -367,17 +355,25 @@ export interface ReflectCounters {
|
|
|
367
355
|
unresolved_writes: number;
|
|
368
356
|
done: boolean;
|
|
369
357
|
}
|
|
370
|
-
/**
|
|
358
|
+
/** What to do next: `resume` unresolved writes, `decide` the delivered items, `continue` the scan, or `done`. */
|
|
359
|
+
export type ReflectNext = Open<"resume" | "decide" | "continue" | "done">;
|
|
360
|
+
/**
|
|
361
|
+
* `reflect` payload. One call applies its decisions, then delivers work, so a loop is: call with the
|
|
362
|
+
* decisions so far and follow `next`. `writes` lists every unresolved write on every call.
|
|
363
|
+
*/
|
|
371
364
|
export interface ReflectResult {
|
|
372
|
-
|
|
365
|
+
next: ReflectNext;
|
|
366
|
+
items: ReflectItem[];
|
|
367
|
+
writes: UnresolvedWrite[];
|
|
368
|
+
/** Work tokens of blocked work; pass one in `focus` to reopen it. */
|
|
369
|
+
blocked: string[];
|
|
373
370
|
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
371
|
counters: ReflectCounters;
|
|
372
|
+
/** Empty when `focus` named targets. */
|
|
373
|
+
lanes: DiscoveryLane[];
|
|
374
|
+
/** `focus` symbols this version does not know. */
|
|
375
|
+
ignored?: string[];
|
|
376
|
+
errors?: FocusError[];
|
|
381
377
|
jev?: Experimental;
|
|
382
378
|
jev_triage?: Experimental;
|
|
383
379
|
}
|
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,24 @@ export interface HostedOptions {
|
|
|
24
24
|
/** Default per-call deadline in ms (300000); 0 disables it. */
|
|
25
25
|
timeoutMs?: number;
|
|
26
26
|
}
|
|
27
|
-
/** Binds one recoverable write to inspected work; a write never completes the work. */
|
|
28
|
-
export interface ReflectionContext {
|
|
29
|
-
work_id: string;
|
|
30
|
-
basis_hash: string;
|
|
31
|
-
action_key: string;
|
|
32
|
-
}
|
|
33
|
-
/** Decision input source reference; unlike results it never carries `review_version`. */
|
|
34
|
-
export interface InspectedSource {
|
|
35
|
-
id: string;
|
|
36
|
-
owner: string;
|
|
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";
|
|
47
|
-
reason: string;
|
|
48
|
-
evidence: InspectedSpan[];
|
|
49
|
-
correction_reason?: string;
|
|
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";
|
|
57
|
-
}
|
|
58
27
|
/**
|
|
59
|
-
* One
|
|
60
|
-
*
|
|
61
|
-
*
|
|
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`.
|
|
62
33
|
*/
|
|
63
|
-
export
|
|
64
|
-
|
|
65
|
-
|
|
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;
|
|
34
|
+
export interface Decision {
|
|
35
|
+
token: string;
|
|
36
|
+
verdict: string;
|
|
87
37
|
reason: string;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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";
|
|
38
|
+
refs?: string[];
|
|
39
|
+
outputs?: string[];
|
|
40
|
+
}
|
|
102
41
|
/** Flat wire args for recall. */
|
|
103
42
|
export interface RecallArgs {
|
|
104
43
|
query: string;
|
|
105
44
|
agent?: string;
|
|
106
|
-
include_history?: boolean;
|
|
107
|
-
limit?: number;
|
|
108
|
-
intents?: Intent[];
|
|
109
45
|
}
|
|
110
46
|
/** Flat wire args for read. */
|
|
111
47
|
export interface ReadArgs {
|
|
@@ -114,8 +50,8 @@ export interface ReadArgs {
|
|
|
114
50
|
continuation?: string;
|
|
115
51
|
}
|
|
116
52
|
/**
|
|
117
|
-
*
|
|
118
|
-
*
|
|
53
|
+
* Wire args for remember. Omitted or null `content` preserves the body. Without `expected_version`
|
|
54
|
+
* the write is create-only.
|
|
119
55
|
*/
|
|
120
56
|
export interface RememberArgs {
|
|
121
57
|
id: string;
|
|
@@ -123,35 +59,41 @@ export interface RememberArgs {
|
|
|
123
59
|
/** Markdown body only, never frontmatter. */
|
|
124
60
|
content?: string | null;
|
|
125
61
|
expected_version?: string;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
62
|
+
/**
|
|
63
|
+
* A key left out keeps its value; null, "" or [] clears it (not `scope` or `team`: null keeps
|
|
64
|
+
* them). `valid_from`/`valid_to` are `YYYY-MM-DD` or RFC 3339 with `Z`/offset. A key the server
|
|
65
|
+
* does not know is ignored and listed in the receipt's `ignored`.
|
|
66
|
+
*/
|
|
67
|
+
meta?: {
|
|
68
|
+
summary?: string | null;
|
|
69
|
+
entities?: string[] | null;
|
|
70
|
+
facets?: string[] | null;
|
|
71
|
+
scope?: Scope | null;
|
|
72
|
+
team?: string | null;
|
|
73
|
+
valid_from?: string | null;
|
|
74
|
+
valid_to?: string | null;
|
|
75
|
+
[key: string]: unknown;
|
|
76
|
+
};
|
|
77
|
+
/** An item's work token from `reflect` binds this write to that work; the server derives its action key. */
|
|
78
|
+
token?: string;
|
|
135
79
|
}
|
|
136
80
|
/** Flat wire args for remove (archives the note; its body stays readable). */
|
|
137
81
|
export interface RemoveArgs {
|
|
138
82
|
id: string;
|
|
139
83
|
expected_version: string;
|
|
140
84
|
agent?: string;
|
|
141
|
-
|
|
85
|
+
/** An item's work token from `reflect` records this archive as one write of that work. */
|
|
86
|
+
token?: string;
|
|
142
87
|
}
|
|
143
|
-
/** Resume a
|
|
88
|
+
/** Resume (or replay) a write by its write token, with the tool that wrote it. */
|
|
144
89
|
export interface ResumeArgs {
|
|
145
|
-
|
|
146
|
-
reflection: ReflectionContext;
|
|
90
|
+
token: string;
|
|
147
91
|
agent?: string;
|
|
148
92
|
}
|
|
149
|
-
/** Flat wire args for reflect. */
|
|
93
|
+
/** Flat wire args for reflect. `focus` is whitespace-separated work tokens and note ids. */
|
|
150
94
|
export interface ReflectArgs {
|
|
151
95
|
agent?: string;
|
|
152
|
-
|
|
153
|
-
work_ids?: string[];
|
|
154
|
-
limit?: number;
|
|
96
|
+
focus?: string;
|
|
155
97
|
decisions?: Decision[];
|
|
156
98
|
}
|
|
157
99
|
/** 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.0",
|
|
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.0",
|
|
59
|
+
"@keb-org/consol-darwin-arm64": "0.3.0",
|
|
60
|
+
"@keb-org/consol-darwin-x64": "0.3.0",
|
|
61
|
+
"@keb-org/consol-linux-x64": "0.3.0",
|
|
62
|
+
"@keb-org/consol-linux-arm64": "0.3.0"
|
|
59
63
|
}
|
|
60
64
|
}
|