@avantf/dsh-mem 0.7.0 → 0.8.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 +4 -0
- package/lib/client.js +548 -1195
- package/lib/dsh-build.json +1 -0
- package/lib/engine/graph-recall/in-memory.d.ts +93 -0
- package/lib/engine/graph-recall/index.d.ts +22 -0
- package/lib/engine/graph-recall/traverse.d.ts +119 -0
- package/lib/engine/graph-recall/types.d.ts +188 -0
- package/lib/engine/mem/config/config_files.d.ts +1 -1
- package/lib/engine/mem/config/loader.d.ts +2 -3
- package/lib/engine/mem/config/paths.d.ts +2 -13
- package/lib/engine/mem/db/dao/contradictions.d.ts +4 -22
- package/lib/engine/mem/db/dao/entities.d.ts +80 -7
- package/lib/engine/mem/db/dao/fact_sources.d.ts +3 -13
- package/lib/engine/mem/db/dao/facts.d.ts +311 -56
- package/lib/engine/mem/db/dao/triples.d.ts +1 -26
- package/lib/engine/mem/db/graph.d.ts +249 -0
- package/lib/engine/mem/db/journal_notes.d.ts +35 -0
- package/lib/engine/mem/db/migrations.d.ts +9 -0
- package/lib/engine/mem/db/port.d.ts +22 -3
- package/lib/engine/mem/db/schema.d.ts +119 -0
- package/lib/engine/mem/db/tokenizer.d.ts +9 -0
- package/lib/engine/mem/dbdrivers/fake/driver.d.ts +75 -0
- package/lib/engine/mem/dbdrivers/fake/index.d.ts +7 -0
- package/lib/engine/mem/dbdrivers/fake/surface.d.ts +34 -0
- package/lib/engine/mem/dbdrivers/fake/transport.d.ts +61 -0
- package/lib/engine/mem/dbdrivers/sqlite/connection.d.ts +14 -0
- package/lib/engine/mem/dbdrivers/sqlite/contradictions.d.ts +35 -0
- package/lib/engine/mem/dbdrivers/sqlite/dao/index.d.ts +16 -0
- package/lib/engine/mem/dbdrivers/sqlite/driver.d.ts +54 -0
- package/lib/engine/mem/dbdrivers/sqlite/facts.d.ts +117 -0
- package/lib/engine/mem/dbdrivers/sqlite/index.d.ts +6 -0
- package/lib/engine/mem/dbdrivers/sqlite/migrations.d.ts +15 -0
- package/lib/engine/mem/dbdrivers/sqlite/relations.d.ts +62 -0
- package/lib/engine/mem/dbdrivers/sqlite/search.d.ts +56 -0
- package/lib/engine/mem/dbdrivers/sqlite/sources.d.ts +37 -0
- package/lib/engine/mem/defaults.d.ts +3 -4
- package/lib/engine/mem/dispatch.d.ts +7 -32
- package/lib/engine/mem/entities/extract.d.ts +44 -47
- package/lib/engine/mem/eval/derived_runner.d.ts +6 -1
- package/lib/engine/mem/eval/relation_gold.d.ts +251 -0
- package/lib/engine/mem/eval/write_metrics.d.ts +1 -1
- package/lib/engine/mem/facts_io.d.ts +50 -10
- package/lib/engine/mem/index.d.ts +6 -2
- package/lib/engine/mem/interfaces/capabilities.d.ts +30 -0
- package/lib/engine/mem/interfaces/common.d.ts +11 -0
- package/lib/engine/mem/interfaces/errors.d.ts +65 -0
- package/lib/engine/mem/interfaces/index.d.ts +18 -0
- package/lib/engine/mem/interfaces/migrations.d.ts +21 -0
- package/lib/engine/mem/interfaces/repositories.d.ts +471 -0
- package/lib/engine/mem/interfaces/search_index.d.ts +113 -0
- package/lib/engine/mem/interfaces/storage_backend.d.ts +84 -0
- package/lib/engine/mem/interfaces/storage_driver.d.ts +43 -0
- package/lib/engine/mem/interfaces/version.d.ts +34 -0
- package/lib/engine/mem/lifecycle/contradiction.d.ts +2 -2
- package/lib/engine/mem/modelBootstrap.d.ts +1 -1
- package/lib/engine/mem/relations/confidence.d.ts +39 -0
- package/lib/engine/mem/relations/extract.d.ts +128 -0
- package/lib/engine/mem/relations/index.d.ts +32 -0
- package/lib/engine/mem/relations/name-quality.d.ts +78 -0
- package/lib/engine/mem/relations/normalize.d.ts +275 -0
- package/lib/engine/mem/relations/patterns.d.ts +67 -0
- package/lib/engine/mem/relations/statement.d.ts +88 -0
- package/lib/engine/mem/relations/types.d.ts +79 -0
- package/lib/engine/mem/runtime.d.ts +61 -88
- package/lib/engine/mem/storage/create.d.ts +42 -0
- package/lib/engine/mem/storage/errors.d.ts +65 -0
- package/lib/engine/mem/storage/index.d.ts +15 -0
- package/lib/engine/mem/storage/ports.d.ts +472 -0
- package/lib/engine/mem/storage/registry.d.ts +37 -0
- package/lib/engine/mem/storage/sqlite.d.ts +28 -0
- package/lib/engine/mem/store/common.d.ts +1 -1
- package/lib/engine/mem/store/entity_leg.d.ts +59 -2
- package/lib/engine/mem/store/entity_sweep.d.ts +4 -3
- package/lib/engine/mem/store/explicit_relations.d.ts +52 -0
- package/lib/engine/mem/store/facts_restore.d.ts +10 -2
- package/lib/engine/mem/store/floors.d.ts +4 -1
- package/lib/engine/mem/store/graph_reader.d.ts +146 -0
- package/lib/engine/mem/store/hybrid.d.ts +50 -13
- package/lib/engine/mem/store/kinds.d.ts +47 -0
- package/lib/engine/mem/store/legs.d.ts +24 -29
- package/lib/engine/mem/store/lexical.d.ts +36 -45
- package/lib/engine/mem/store/memory.d.ts +471 -83
- package/lib/engine/mem/store/recall_policy.d.ts +49 -0
- package/lib/engine/mem/store/relation_backfill.d.ts +210 -0
- package/lib/engine/mem/store/relation_planner.d.ts +191 -0
- package/lib/engine/mem/store/secret_guard.d.ts +0 -1
- package/lib/engine/mem/store/self_query.d.ts +4 -2
- package/lib/engine/mem/store/time_filter.d.ts +121 -0
- package/lib/engine/mem/store/titles.d.ts +52 -0
- package/lib/engine/mem/store/vector_repair.d.ts +44 -54
- package/lib/engine/mem-contract/config.d.ts +44 -38
- package/lib/engine/mem-contract/text.d.ts +1 -1
- package/lib/engine/mem-contract/tools.d.ts +145 -132
- package/lib/engine/mem-contract/types.d.ts +364 -288
- package/lib/index.js +12048 -11337
- package/lib/interface-version.json +1 -1
- package/lib/types/client/index.d.ts +2 -2
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/paging.d.ts +3 -12
- package/lib/types/client/paging.d.ts.map +1 -1
- package/lib/types/client/summarize.d.ts.map +1 -1
- package/lib/types/envinit-bootstrap.d.ts +1 -1
- package/lib/types/envinit.d.ts +2 -6
- package/lib/types/envinit.d.ts.map +1 -1
- package/lib/types/hints.d.ts +28 -24
- package/lib/types/hints.d.ts.map +1 -1
- package/lib/types/index.d.ts +21 -40
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/inject.d.ts +3 -2
- package/lib/types/inject.d.ts.map +1 -1
- package/lib/types/interface_gate.d.ts +1 -1
- package/lib/types/prompt.d.ts +17 -41
- package/lib/types/prompt.d.ts.map +1 -1
- package/lib/types/provision.d.ts +3 -0
- package/lib/types/provision.d.ts.map +1 -1
- package/lib/types/remote.d.ts +14 -7
- package/lib/types/remote.d.ts.map +1 -1
- package/lib/types/tool_schema.d.ts +4 -0
- package/lib/types/tool_schema.d.ts.map +1 -1
- package/lib/types/vectorMigration.d.ts +5 -7
- package/lib/types/vectorMigration.d.ts.map +1 -1
- package/package.json +15 -14
- package/lib/engine/mem/config/domains.d.ts +0 -20
- package/lib/engine/mem/db/dao/chunks.d.ts +0 -231
- package/lib/engine/mem/db/dao/documents.d.ts +0 -51
- package/lib/engine/mem/db/hash.d.ts +0 -2
- package/lib/engine/mem/db/knowledge.d.ts +0 -17
- package/lib/engine/mem/eval/index.d.ts +0 -4
- package/lib/engine/mem/git.d.ts +0 -73
- package/lib/engine/mem/router.d.ts +0 -51
- package/lib/engine/mem/store/doc_files.d.ts +0 -125
- package/lib/engine/mem/store/document_text.d.ts +0 -47
- package/lib/engine/mem/store/ingest_guard.d.ts +0 -25
- package/lib/engine/mem/store/knowledge.d.ts +0 -598
- package/lib/engine/mem/store/source_picker.d.ts +0 -43
- package/lib/engine/mem-retrieval/adapters/local_reranker.d.ts +0 -52
- package/lib/engine/mem-retrieval/adapters/none_reranker.d.ts +0 -10
- package/lib/engine/mem-retrieval/rerank.d.ts +0 -13
- package/lib/types/client/domains.d.ts +0 -53
- package/lib/types/client/domains.d.ts.map +0 -1
- package/lib/types/client/ingest.d.ts +0 -24
- package/lib/types/client/ingest.d.ts.map +0 -1
- package/lib/types/open.d.ts +0 -77
- package/lib/types/open.d.ts.map +0 -1
- package/lib/types/reconcile.d.ts +0 -64
- package/lib/types/reconcile.d.ts.map +0 -1
|
@@ -24,12 +24,12 @@ interface ClientContext {
|
|
|
24
24
|
/** Client cordis-plugin name shown in boot diagnostics. */
|
|
25
25
|
export declare const name = "avantf-mem-client";
|
|
26
26
|
/**
|
|
27
|
-
* Services required to render the
|
|
27
|
+
* Services required to render the tab. `remote` (not `remote.avantfMem`)
|
|
28
28
|
* on purpose: a missing namespace must not leave this entry pending, because
|
|
29
29
|
* the client boot rejects the whole tree when any entry is pending.
|
|
30
30
|
*/
|
|
31
31
|
export declare const inject: string[];
|
|
32
|
-
/** Contribute the
|
|
32
|
+
/** Contribute the `conversation.view` tab, mounting this package's Remote namespace first. */
|
|
33
33
|
export declare function apply(ctx: ClientContext): Promise<void>;
|
|
34
34
|
export {};
|
|
35
35
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AA6DA,wDAAwD;AACxD,UAAU,aAAa;IACrB,KAAK,EAAE;QACL,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAA;QAChD,QAAQ,CACN,OAAO,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,EAAE,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,MAAM,CAAA;SAAE,EACzE,SAAS,EAAE,MAAM,OAAO,GACvB,IAAI,CAAA;KACR,CAAA;IACD,MAAM,EAAE;QACN,wEAAwE;QACxE,MAAM,CAAC,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;KAC5D,CAAA;IACD;;;;;OAKG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAC3B;AAgqCD,2DAA2D;AAC3D,eAAO,MAAM,IAAI,sBAAsB,CAAA;AAEvC;;;;GAIG;AACH,eAAO,MAAM,MAAM,UAAsB,CAAA;AAEzC,8FAA8F;AAC9F,wBAAsB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA+B7D"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Page merging for the
|
|
2
|
+
* Page merging for the fact list.
|
|
3
3
|
*
|
|
4
4
|
* Kept out of `client/index.ts` so it can be tested without a DOM (the same reason `summarize.ts`
|
|
5
|
-
* lives on its own):
|
|
6
|
-
*
|
|
5
|
+
* lives on its own): this is where page drift is handled, and page drift is the kind of bug that
|
|
6
|
+
* only shows up as a React key warning plus a row nobody can scroll to.
|
|
7
7
|
*
|
|
8
8
|
* @module client/paging
|
|
9
9
|
*/
|
|
@@ -18,13 +18,4 @@
|
|
|
18
18
|
export declare function mergePage<T extends {
|
|
19
19
|
fact_id: number;
|
|
20
20
|
}>(previous: T[], page: T[]): T[];
|
|
21
|
-
/**
|
|
22
|
-
* Append one page of documents, dropping ids already present.
|
|
23
|
-
*
|
|
24
|
-
* Same window shift as `mergePage`: `kb.list` pages by `OFFSET` over `updated_at DESC`, which also
|
|
25
|
-
* has second precision, and a document ingested between two requests repeats a row.
|
|
26
|
-
*/
|
|
27
|
-
export declare function mergeDocs<T extends {
|
|
28
|
-
doc_id: number;
|
|
29
|
-
}>(previous: T[], page: T[]): T[];
|
|
30
21
|
//# sourceMappingURL=paging.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paging.d.ts","sourceRoot":"","sources":["../../../src/client/paging.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAEtF
|
|
1
|
+
{"version":3,"file":"paging.d.ts","sourceRoot":"","sources":["../../../src/client/paging.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAEtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarize.d.ts","sourceRoot":"","sources":["../../../src/client/summarize.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA6BH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"summarize.d.ts","sourceRoot":"","sources":["../../../src/client/summarize.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA6BH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CA+BhD"}
|
package/lib/types/envinit.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ type EnvinitModule = typeof import('@avantf/dsh-plugin-base');
|
|
|
6
6
|
* The item ids. `resolve()` / `onSettled` are keyed by them, so the DSH plugin compares against these
|
|
7
7
|
* names rather than re-spelling literals.
|
|
8
8
|
*/
|
|
9
|
-
export declare const PANDOC_ITEM = "mem:pandoc";
|
|
10
9
|
export declare const MODEL_ITEM = "mem:model";
|
|
11
10
|
/** The logging surface this module needs — `AvantfLogger` satisfies it. */
|
|
12
11
|
interface EnvinitLogger {
|
|
@@ -17,13 +16,10 @@ interface EnvinitLogger {
|
|
|
17
16
|
/**
|
|
18
17
|
* What the engine resolved from its config, handed to {@link EnvinitRuntime.provisionResources}.
|
|
19
18
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* way (unless the runtime reads its models elsewhere), because WHEN it is off is a DOWNLOAD question,
|
|
23
|
-
* not a declaration question — see {@link ResourcePlan.modelAutoDownload}.
|
|
19
|
+
* The model is declared whether or not downloads are allowed, because WHEN it is off is a DOWNLOAD
|
|
20
|
+
* question, not a declaration question — see {@link ResourcePlan.modelAutoDownload}.
|
|
24
21
|
*/
|
|
25
22
|
export interface ResourcePlan {
|
|
26
|
-
readonly pandoc: boolean;
|
|
27
23
|
/** `tools.mirror` — URL templates tried before the official source, for archive downloads. */
|
|
28
24
|
readonly archiveMirrors: readonly string[];
|
|
29
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envinit.d.ts","sourceRoot":"","sources":["../../src/envinit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"envinit.d.ts","sourceRoot":"","sources":["../../src/envinit.ts"],"names":[],"mappings":"AAiDA,OAAO,KAAK,EAAiB,oBAAoB,EAAe,MAAM,yBAAyB,CAAA;AAG/F,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAA;AAKvB,4FAA4F;AAC5F,KAAK,aAAa,GAAG,cAAc,yBAAyB,CAAC,CAAA;AAK7D;;;GAGG;AACH,eAAO,MAAM,UAAU,cAAc,CAAA;AAmDrC,2EAA2E;AAC3E,UAAU,aAAa;IACrB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,8FAA8F;IAC9F,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1C;;;;;;;;OAQG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CA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AC,EAAE,MAAM,CAAA;IACtB,mHAAmH;IACnH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,yFAAyF;IACzF,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAA;IAClC,0FAA0F;IAC1F,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAA;CACrC;AA8GD;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAEjG"}
|
package/lib/types/hints.d.ts
CHANGED
|
@@ -1,41 +1,45 @@
|
|
|
1
|
-
import type { RelevanceHit } from '../engine/mem/index.js';
|
|
2
1
|
/**
|
|
3
|
-
* The plugin's CONDITIONAL hint: ONE line,
|
|
4
|
-
* something relevant to the message the user just sent (DESIGN §12).
|
|
2
|
+
* The plugin's CONDITIONAL hint: ONE line, injected as its own user message only when memory already
|
|
3
|
+
* holds something relevant to the message the user just sent (DESIGN §12).
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
5
|
+
* It is deliberately NOT part of the always-on usage section. A usage section says WHEN memory is
|
|
6
|
+
* worth consulting and therefore has to be paid for on every step of every session; this says
|
|
7
|
+
* "there is something here, right now", which is only true sometimes. The two layers compose: the
|
|
8
|
+
* section is the fallback for what the probe misses, and the hint is the concrete nudge for the case
|
|
9
|
+
* it catches.
|
|
11
10
|
*
|
|
12
|
-
* ONE LINE
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* from `mem_recall` and again inside `kb_query`'s fused result — and made every memory↔knowledge
|
|
16
|
-
* transition a fresh snapshot append. `mem_recall` remains the tool for the memory-only actions
|
|
17
|
-
* (chain / probe / reason / contradict); the always-on memory usage section is where that is said.
|
|
11
|
+
* ONE LINE, naming ONE tool: `mem_recall` is the entry point for every retrieval action (search /
|
|
12
|
+
* search / titles and the built-in relation stage), so a single sentence covers whichever one the model
|
|
13
|
+
* needs.
|
|
18
14
|
*
|
|
19
|
-
* WHY THE LINE NAMES THE PLUGIN.
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
15
|
+
* WHY THE LINE NAMES THE PLUGIN. The hint is injected as a USER-role message (`index.ts`'s
|
|
16
|
+
* `agent/pre-step` listener), and the harness shows such a message in the trace as coming from the
|
|
17
|
+
* user. Without an author, a line like "记忆里有相关内容" reads as something the user said. The
|
|
18
|
+
* `[avantf-mem]` prefix is what keeps the provenance honest.
|
|
23
19
|
*/
|
|
24
|
-
export declare const RELEVANCE_HINT = "[avantf-mem] \u8BB0\u5FC6\
|
|
20
|
+
export declare const RELEVANCE_HINT = "[avantf-mem] \u8BB0\u5FC6\u91CC\u6709\u4E0E\u4E0A\u6761\u7528\u6237\u6D88\u606F\u76F8\u5173\u7684\u5185\u5BB9\uFF1B\u9700\u8981\u65F6\u7528 `mem_recall` \u68C0\u7D22\u3002";
|
|
25
21
|
/**
|
|
26
|
-
*
|
|
22
|
+
* The text of the messages THIS STEP newly claimed from the user, or `''` when it claimed none.
|
|
27
23
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
24
|
+
* This is the whole deduplication rule of the hint, and it is STRUCTURAL rather than remembered:
|
|
25
|
+
* `inbox.claim()` empties the pending queue, so a turn's second and later steps are handed no new
|
|
26
|
+
* user message and this returns `''`. "One injection per user message" is therefore a consequence
|
|
27
|
+
* of how the step is fed, not of state this plugin keeps — which is also why a restart, a resume,
|
|
28
|
+
* or a discarded inbox entry cannot leave a stale verdict behind.
|
|
29
|
+
*
|
|
30
|
+
* Only `source.kind === 'user'` moves the verdict. The step's messages also carry this plugin's own
|
|
31
|
+
* wake-ups, other plugins' notices (`kind: 'plugin:*'`), sub-agent relays and the runtime-context
|
|
32
|
+
* snapshot; probing those would let a "任务 n1 已结束" wake rewrite a hint that claims to be about
|
|
33
|
+
* the user's last message.
|
|
30
34
|
*/
|
|
31
|
-
export declare function
|
|
35
|
+
export declare function freshUserText(messages: readonly unknown[]): string;
|
|
32
36
|
/**
|
|
33
37
|
* The plain text of an inbox message, or `''` when it carries none.
|
|
34
38
|
*
|
|
35
39
|
* `dsh-agent-loop`'s own extractor returns `undefined` unless the message is exactly ONE text
|
|
36
40
|
* block; a steered or multi-part message would then silently produce no hint. Concatenating the
|
|
37
41
|
* text blocks keeps the probe working for those, and non-text blocks (images) are simply skipped —
|
|
38
|
-
*
|
|
42
|
+
* with no text there is nothing for either the lexical or the semantic probe to judge.
|
|
39
43
|
*/
|
|
40
44
|
export declare function messageText(message: unknown): string;
|
|
41
45
|
//# sourceMappingURL=hints.d.ts.map
|
package/lib/types/hints.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hints.d.ts","sourceRoot":"","sources":["../../src/hints.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hints.d.ts","sourceRoot":"","sources":["../../src/hints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,cAAc,gLAC4B,CAAA;AAEvD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,CAMlE;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAUpD"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -15,12 +15,28 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { Context } from '@deepseek-ai/cordis';
|
|
17
17
|
import z from '@deepseek-ai/schemastery';
|
|
18
|
+
import { type ContextFormed } from '@deepseek-ai/dsh-llm';
|
|
18
19
|
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
19
|
-
import { type AvantfRuntime, type
|
|
20
|
-
import { type
|
|
20
|
+
import { type AvantfRuntime, type MemoryStore, type RecallHitsResult, type StoreResult } from '../engine/mem/index.js';
|
|
21
|
+
import { type RemoteEnvelope } from '../engine/mem-contract/index.js';
|
|
22
|
+
/**
|
|
23
|
+
* The hint's own message source kind, declared where the hint is produced.
|
|
24
|
+
*
|
|
25
|
+
* `MessageSourceMap` is merge-extensible on purpose: `kind` answers WHO produced a message, and
|
|
26
|
+
* every producer owns its own value (there is no shared `plugin` catch-all). Declaring it here is
|
|
27
|
+
* also what lets `createUserMessage` accept the source without a cast, and what makes the trace row
|
|
28
|
+
* after a restart name `mem-hint` instead of an opaque unknown producer.
|
|
29
|
+
*/
|
|
30
|
+
declare module '@deepseek-ai/dsh-llm' {
|
|
31
|
+
interface MessageSourceMap {
|
|
32
|
+
'mem-hint': {
|
|
33
|
+
kind: 'mem-hint';
|
|
34
|
+
} & ContextFormed;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
21
37
|
export declare const name = "avantf-mem";
|
|
22
38
|
export { inject } from './inject.js';
|
|
23
|
-
export {
|
|
39
|
+
export { MEMORY_PROMPT_SECTION } from './prompt.js';
|
|
24
40
|
export { registerSemanticBackend, registerVectorStore, type SemanticBackend, type VectorStore, } from '../engine/mem/index.js';
|
|
25
41
|
export interface Config {
|
|
26
42
|
mode?: 'cordis' | 'mcp';
|
|
@@ -29,7 +45,7 @@ export interface Config {
|
|
|
29
45
|
export declare const Config: z<Config>;
|
|
30
46
|
type WireArgs = Record<string, unknown>;
|
|
31
47
|
/**
|
|
32
|
-
* Pass-through gateway mirroring the
|
|
48
|
+
* Pass-through gateway mirroring the three agent tools. Every payload is
|
|
33
49
|
* re-validated with the contract zod union before dispatch (same guarantee the
|
|
34
50
|
* tools give the model), and results are wrapped in the contract's
|
|
35
51
|
* `{ok:true,value}` / `{ok:false,error,violations}` RemoteEnvelope the client decodes.
|
|
@@ -59,43 +75,8 @@ export declare class AvantfMemGateway extends TypertRemoteService {
|
|
|
59
75
|
* here stops compiling instead of quietly misdescribing the wire.
|
|
60
76
|
*/
|
|
61
77
|
remember(args: WireArgs): Promise<RemoteEnvelope<StoreResult<MemoryStore, 'add'>>>;
|
|
62
|
-
recall(args: WireArgs): Promise<RemoteEnvelope<
|
|
78
|
+
recall(args: WireArgs): Promise<RemoteEnvelope<RecallHitsResult>>;
|
|
63
79
|
admin(args: WireArgs): Promise<RemoteEnvelope<StoreResult<MemoryStore, 'list'>>>;
|
|
64
|
-
/**
|
|
65
|
-
* The one method that keeps `unknown`, and deliberately: its payload is whichever of the seven
|
|
66
|
-
* corpus actions the caller asked for (a page, one document, an ingest report, a conflict report, a
|
|
67
|
-
* reindex plan …), so there is no single engine type to name. The engine's `KbDispatch` spells all
|
|
68
|
-
* seven out; the client names its expectation at each call site (`callRemote<…>(…)`).
|
|
69
|
-
*/
|
|
70
|
-
kb(args: WireArgs): Promise<RemoteEnvelope<unknown>>;
|
|
71
|
-
query(args: WireArgs): Promise<RemoteEnvelope<RecallResult>>;
|
|
72
|
-
/**
|
|
73
|
-
* UI-only: what IS this string? Answered against the ingestion boundary, so the UI can label the
|
|
74
|
-
* input and pick the right `kb_manage` action (URL → fetch, file → ingest, directory → import,
|
|
75
|
-
* text → ingest the string itself, missing → refuse and say why).
|
|
76
|
-
*/
|
|
77
|
-
classifySource(args: WireArgs): Promise<RemoteEnvelope<SourceClassification>>;
|
|
78
|
-
/** UI-only: one directory listing for the 选择 picker (same boundary as ingestion). */
|
|
79
|
-
browseDir(args: WireArgs): Promise<RemoteEnvelope<BrowseListing>>;
|
|
80
|
-
/**
|
|
81
|
-
* UI-only: the 知识页 domain picker's options — the configured `knowledge.domains` allowlist
|
|
82
|
-
* together with the domains the library already holds — plus whether the allowlist is active
|
|
83
|
-
* (non-empty). The host is the only side that knows either half.
|
|
84
|
-
*/
|
|
85
|
-
kbDomains(_args: WireArgs): Promise<RemoteEnvelope<StoreResult<KnowledgeStore, 'domainCatalog'>>>;
|
|
86
|
-
/**
|
|
87
|
-
* UI-only: add one 知识域 to the store config's `domains` allowlist AND to the live set, so the
|
|
88
|
-
* 知识 tab's 「+」 works without a restart. No agent tool mirrors this on purpose — the model must
|
|
89
|
-
* stay bounded by the configured list, while the user can widen it.
|
|
90
|
-
*/
|
|
91
|
-
kbAddDomain(args: WireArgs): Promise<RemoteEnvelope<StoreResult<KnowledgeStore, 'addDomain'>>>;
|
|
92
|
-
/**
|
|
93
|
-
* UI-only: hand one managed document file — or the directory that holds it — to the user's
|
|
94
|
-
* editor. No agent tool mirrors this, so it carries its own envelope instead of going through
|
|
95
|
-
* `dispatchToolKey`; the path is resolved from `doc_id` here, so nothing the client sends is
|
|
96
|
-
* trusted.
|
|
97
|
-
*/
|
|
98
|
-
openDoc(args: WireArgs): Promise<RemoteEnvelope<OpenOutcome>>;
|
|
99
80
|
}
|
|
100
81
|
export declare function apply(ctx: Context, config: Config): Promise<void>;
|
|
101
82
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAQlD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AACxC,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAE5E,OAAO,EAAE,mBAAmB,EAAU,MAAM,kCAAkC,CAAA;AAE9E,OAAO,EASL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,aAAa,CAAA;AACpB,OAAO,EAcL,KAAK,cAAc,EAIpB,MA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AO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyZvE"}
|
package/lib/types/inject.d.ts
CHANGED
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
* `test/provision.spec.ts`, which asserts that every service cordis WAITS for has a contract in
|
|
7
7
|
* `SERVICE_CONTRACTS`.
|
|
8
8
|
*
|
|
9
|
-
* `systemPrompt` is here because the plugin contributes three usage sections
|
|
10
|
-
*
|
|
9
|
+
* `systemPrompt` is here because the plugin contributes three usage sections (see `prompt.ts`).
|
|
10
|
+
* The conditional hint is NOT one of them: it is a single user message injected by `agent/pre-step`,
|
|
11
|
+
* which needs no service. Each service gates `apply`: without `tools`/`typert` there is nothing to
|
|
11
12
|
* register, and without the prompt registry the guidance has nowhere to land.
|
|
12
13
|
*/
|
|
13
14
|
export declare const inject: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../../src/inject.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../../src/inject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,UAAsC,CAAA"}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* `@module` line below differs. Everything here is the consumption contract and the ONE verdict→decision
|
|
18
18
|
* mapping; nothing in it is plugin-specific by construction. What IS plugin-specific (which text the
|
|
19
19
|
* prompt layer falls back to, which resources take the legacy path) belongs in that plugin's own
|
|
20
|
-
* `envinit.ts`, never here. `base/
|
|
20
|
+
* `envinit.ts`, never here. `base/test/interface_consumers.spec.ts` pins the three
|
|
21
21
|
* copies against each other, so a divergence is a red test instead of three shims that drifted.
|
|
22
22
|
*
|
|
23
23
|
* The loader SKELETON every startup shares lives here too: the once-per-process cache
|
package/lib/types/prompt.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PromptSection } from '@deepseek-ai/dsh-system-prompt';
|
|
2
2
|
import type { LoadedPromptText, PromptFileSpec } from '@avantf/dsh-plugin-base';
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
4
|
+
* The one system-prompt section this plugin contributes (DESIGN §10).
|
|
5
5
|
*
|
|
6
6
|
* The TEXTS are user-editable: each section's body lives in its own `.md` under the shared family
|
|
7
7
|
* prompt directory `<data_home>/prompts` (`PROMPT_FILES` maps file → section), and the constants
|
|
@@ -13,20 +13,11 @@ import type { LoadedPromptText, PromptFileSpec } from '@avantf/dsh-plugin-base';
|
|
|
13
13
|
* release, not a plugin rebuild. When the base is unavailable the built-in defaults below are used
|
|
14
14
|
* and nothing is written to disk.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
* never when to reach for it unprompted, and the default behaviour is to wait until asked. So
|
|
18
|
-
* says only WHEN
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* The knowledge one is the section whose ABSENCE was measured: a user had just ingested
|
|
23
|
-
* 《Cgroup v2 技术综述》(which answers "cgroup v2 的内存保护" at score 1.0) and asked about it in a
|
|
24
|
-
* session whose prompt named only the memory tools, so the model never looked. A tool description
|
|
25
|
-
* cannot fix that by itself — `kb_query`'s says what the call does and even leads with 记忆 facts,
|
|
26
|
-
* which reads as a memory tool — and the model cannot know the library is relevant to a question
|
|
27
|
-
* without being told to check it. Hence the "先检索一次再作答" nudge, plus the explicit
|
|
28
|
-
* "你看不到库里有什么" clause: the thing that made the miss invisible is that nothing in the
|
|
29
|
-
* prompt acknowledged the store existed at all.
|
|
16
|
+
* It exists for something a tool description cannot carry: a description says what a call DOES,
|
|
17
|
+
* never when to reach for it unprompted, and the default behaviour is to wait until asked. So it
|
|
18
|
+
* says only WHEN memory is worth writing or reading. It says nothing about how memory is retained —
|
|
19
|
+
* that stays out of every model-facing string, held to the contract's `RETENTION_VOCABULARY`, the
|
|
20
|
+
* same list the tool descriptions are held to.
|
|
30
21
|
*
|
|
31
22
|
* `order` 3000/3010 are third-party slots: after the harness's per-tool guidance block (1000–2900)
|
|
32
23
|
* and before its toolset-level guidance (5000). They are not repository-owned placements, so they
|
|
@@ -41,39 +32,24 @@ import type { LoadedPromptText, PromptFileSpec } from '@avantf/dsh-plugin-base';
|
|
|
41
32
|
* `update` plus the verification basis; and `recall` output is not written straight back as a new
|
|
42
33
|
* fact. Because the FILE version wins over this built-in fallback, users who already customised
|
|
43
34
|
* `mem-memory-usage.md` do NOT get them automatically — the upgrade note in
|
|
44
|
-
* `
|
|
35
|
+
* `CHANGELOG/unreleased.md` carries the pasteable text for exactly that case.
|
|
45
36
|
*
|
|
46
37
|
* Kept in its own module — not in `index.ts` — so the text can be read and checked without the
|
|
47
38
|
* plugin entry's `@deepseek-ai/*` runtime imports, which resolve only in a harness workspace.
|
|
48
39
|
*/
|
|
49
|
-
export declare const MEMORY_PROMPT_SECTION: {
|
|
50
|
-
readonly name: "avantf:memory-usage";
|
|
51
|
-
readonly order: 3000;
|
|
52
|
-
readonly text: string;
|
|
53
|
-
};
|
|
54
40
|
/**
|
|
55
|
-
* WHEN
|
|
56
|
-
* section rather than a clause inside the memory one: the two stores answer different questions,
|
|
57
|
-
* and a session that needs the knowledge base may have no memory question at all.
|
|
58
|
-
*/
|
|
59
|
-
export declare const KNOWLEDGE_PROMPT_SECTION: {
|
|
60
|
-
readonly name: "avantf:knowledge-usage";
|
|
61
|
-
readonly order: 3010;
|
|
62
|
-
readonly text: string;
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* HOW to change a document that is already in the library.
|
|
41
|
+
* WHEN and WHAT to remember — now in the memory's own two LAYERS (JOURNAL_NOTES_REDESIGN N9).
|
|
66
42
|
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
43
|
+
* The section no longer asks the model to classify by TOPIC (the eight values and their fallback are
|
|
44
|
+
* gone): it names the two layers, says when each applies, and says the only relationship between
|
|
45
|
+
* them that matters — a note is distilled FROM journal entries once the fact is stable, and it cites
|
|
46
|
+
* the entry it came from with `source_ref`. Everything else (the P-04 hygiene clauses, "do not
|
|
47
|
+
* record transient chatter", the 400-character budget asserted by `prompt_section.spec.ts`) is
|
|
48
|
+
* unchanged.
|
|
73
49
|
*/
|
|
74
|
-
export declare const
|
|
75
|
-
readonly name: "avantf:
|
|
76
|
-
readonly order:
|
|
50
|
+
export declare const MEMORY_PROMPT_SECTION: {
|
|
51
|
+
readonly name: "avantf:memory-usage";
|
|
52
|
+
readonly order: 3000;
|
|
77
53
|
readonly text: string;
|
|
78
54
|
};
|
|
79
55
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAEnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE/E
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAEnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB;;;;CAgBA,CAAA;AAElC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,QAAQ,CAAA;AAErC,gGAAgG;AAChG,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,kGAAkG;IAClG,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAC5D;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,YAAY,EAAE,SAAS,eAAe,EAElD,CAAA;AAED,qGAAqG;AACrG,wBAAgB,eAAe,IAAI,cAAc,EAAE,CAElD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,GAAG,aAAa,EAAE,CAOxF;AAED,0FAA0F;AAC1F,eAAO,MAAM,kBAAkB,MAAM,CAAA;AAKrC;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,GAAG,MAAM,EAAE,CAmB/E"}
|
package/lib/types/provision.d.ts
CHANGED
|
@@ -48,6 +48,9 @@ export declare const SERVICE_CONTRACTS: readonly ServiceContract[];
|
|
|
48
48
|
* A listener for a name the host no longer emits registers happily and then never runs: the house
|
|
49
49
|
* hints would simply stop appearing. Nothing inside a plugin can prove the host still emits a name,
|
|
50
50
|
* so the list is a known limit the gate records and the running dsh version is the operator's signal.
|
|
51
|
+
*
|
|
52
|
+
* `agent/pre-step` is the one the hint rides on: without it the always-on usage sections still
|
|
53
|
+
* stand, but no per-message nudge ever appears.
|
|
51
54
|
*/
|
|
52
55
|
export declare const REQUIRED_EVENTS: readonly string[];
|
|
53
56
|
/** Packages released in lockstep with dsh; their version says which dsh is running. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provision.d.ts","sourceRoot":"","sources":["../../src/provision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,YAAY,EACZ,UAAU,EACV,aAAa,EACb,eAAe,EAChB,MAAM,yBAAyB,CAAA;AAIhC,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,CAAA;AAE7C,wEAAwE;AACxE,MAAM,MAAM,YAAY,GAAG,cAAc,yBAAyB,CAAC,CAAA;AAEnE,mFAAmF;AACnF,e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EAAE,YAAY,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAMzE;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CAyBrE;AAoBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CACvB,GAAG,EAAE,aAAa,EAClB,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,aAAa,EACrB,IAAI,GAAE,UAAwB,GAC7B,SAAS,CAMX;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,aAAa,EACtB,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,aAAa,GACpB,IAAI,CAaN;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IACrC,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAA;IAC1B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;CAC/B,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAQ1C"}
|
package/lib/types/remote.d.ts
CHANGED
|
@@ -19,8 +19,8 @@ export declare const clientContribution: TypertRemoteContribution;
|
|
|
19
19
|
*
|
|
20
20
|
* WHY THE ENVELOPE AND NOT ONE METHOD'S PAYLOAD. Mission's `snapshot` is the panel's one entry point,
|
|
21
21
|
* so its marker rides that payload. mem has no such method: the 记忆 tab opens with `admin.list` and
|
|
22
|
-
*
|
|
23
|
-
*
|
|
22
|
+
* may then call `recall` or `remember`, any order. The one object EVERY answer shares is the
|
|
23
|
+
* application envelope, so the revision rides there — same
|
|
24
24
|
* guarantee, stamped in the one place every method already goes through (`wireOk`/`wireErr`).
|
|
25
25
|
*
|
|
26
26
|
* BUMP RULE. Bump on every added/removed `@Remote` method — the number tracks the SET of methods the
|
|
@@ -36,16 +36,23 @@ export declare const clientContribution: TypertRemoteContribution;
|
|
|
36
36
|
* marker", never as a decode failure — the answer is still readable.
|
|
37
37
|
*
|
|
38
38
|
* Revision history:
|
|
39
|
-
* - 1: the first marker. The face at
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* exists for the NEXT method.
|
|
39
|
+
* - 1: the first marker. The face at that point was ten methods (the three tool-backed ones plus the
|
|
40
|
+
* knowledge-base UI methods, all removed in revision 4), all of which predate the marker — so
|
|
41
|
+
* nothing is gated on revision 1; the mechanism exists for the NEXT method.
|
|
43
42
|
* - 2: the rerank capability was removed (0.5.0). This changed NO `@Remote` method, but it removed the
|
|
44
43
|
* `rerank_used` / `rerank_fallback` / `rerank_truncated` fields from the retrieval-health payload
|
|
45
44
|
* that `admin.stats` answers — fields the client half dereferenced. A rebuilt client talking to an
|
|
46
45
|
* old host (or the reverse) therefore has to be reported as skew, not silently render `NaN`.
|
|
46
|
+
* - 3: the memory has two layers (`kind: journal | note`) instead of eight categories. `remember` /
|
|
47
|
+
* `recall` / `admin` accept `kind` in place of `category`, and a fact view carries `kind` in place of
|
|
48
|
+
* `category` — a removed payload field the client half dereferenced (the fact list rendered it), so
|
|
49
|
+
* this is a skew between halves, not a silent field rename.
|
|
50
|
+
* - 4: the document knowledge base moved to its own plugin. The face lost `kb`, `query`, `openDoc`,
|
|
51
|
+
* `classifySource`, `browseDir`, `kbDomains` and `kbAddDomain`, and `admin.vectors_fix` lost its
|
|
52
|
+
* `store` field — so a rebuilt client MUST NOT call them against an older host, and this number is
|
|
53
|
+
* the reason it can tell.
|
|
47
54
|
*/
|
|
48
|
-
export declare const WIRE_VERSION =
|
|
55
|
+
export declare const WIRE_VERSION = 4;
|
|
49
56
|
/**
|
|
50
57
|
* The successful application envelope, with the wire revision stamped on.
|
|
51
58
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/remote.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/remote.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,oBAAoB,EAGpB,wBAAwB,EACzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAGhF,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AA8F/D,eAAO,MAAM,WAAW,EAAE,SAAS,oBAAoB,EAwFtD,CAAA;AAED,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,EAAE,wBAGhC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,eAAO,MAAM,YAAY,IAAI,CAAA;AAE7B;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAE/C;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,SAAS,CAEnE;AA8BD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,EAAE,kBA0C9B,CAAA"}
|
|
@@ -5,6 +5,10 @@ type ParamSpec = {
|
|
|
5
5
|
required?: true;
|
|
6
6
|
enum?: readonly string[];
|
|
7
7
|
items?: ParamSpec;
|
|
8
|
+
/** DSH's schema compiler requires this explicitly on every nested object. */
|
|
9
|
+
additionalProperties?: boolean;
|
|
10
|
+
/** Nested object fields; DSH rejects every key when this is missing. */
|
|
11
|
+
properties?: Record<string, ParamSpec>;
|
|
8
12
|
};
|
|
9
13
|
/** Nearest `description` on a schema (wrappers included — the converter already unwrapped them). */
|
|
10
14
|
export declare function schemaDescription(schema: unknown): string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool_schema.d.ts","sourceRoot":"","sources":["../../src/tool_schema.ts"],"names":[],"mappings":"AAgBA,OAAO,EAA0B,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE5E,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAA;IACtE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,IAAI,CAAA;IACf,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,KAAK,CAAC,EAAE,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"tool_schema.d.ts","sourceRoot":"","sources":["../../src/tool_schema.ts"],"names":[],"mappings":"AAgBA,OAAO,EAA0B,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE5E,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAA;IACtE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,IAAI,CAAA;IACf,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,6EAA6E;IAC7E,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;CACvC,CAAA;AA+BD,oGAAoG;AACpG,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAGrE;AAkCD,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAEpD;AAOD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAiDzE"}
|
|
@@ -9,11 +9,9 @@
|
|
|
9
9
|
* degraded to lexical+entity with no error anywhere — the stores' open-time warning now says so, and
|
|
10
10
|
* this module is what repairs it without the operator having to know `vectors --fix` exists.
|
|
11
11
|
*
|
|
12
|
-
* The FLOW lives in the engine
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* — in one pass, because one embedding space is configured for the whole runtime: the knowledge
|
|
16
|
-
* store used to be left behind, silently, with only a manual `kb_reindex` able to fix it.
|
|
12
|
+
* The FLOW lives in the engine (`@avantf/mem`'s `store/vector_repair.ts`: batch size, event-loop
|
|
13
|
+
* yield, stop / resume / no-progress rules, the `semantic.auto_migrate` decision and the store-named
|
|
14
|
+
* log kinds).
|
|
17
15
|
*
|
|
18
16
|
* This module owns only the process LIFECYCLE: one start, one stop, and "never an unhandled
|
|
19
17
|
* rejection". It sits BEHIND the startup gate (`awaitStartupGate`, see index.ts): the model warm and
|
|
@@ -27,7 +25,7 @@ import { type AvantfRuntime } from '../engine/mem/index.js';
|
|
|
27
25
|
import type { AvantfLogger } from '../engine/mem-contract/index.js';
|
|
28
26
|
export interface VectorMigrationHandle {
|
|
29
27
|
/**
|
|
30
|
-
* Run one migration pass. Quiet no-op when
|
|
28
|
+
* Run one migration pass. Quiet no-op when the store is already current, when a pass is already
|
|
31
29
|
* running, or after {@link stop}. Failures never escape: they are logged and left for the next
|
|
32
30
|
* heartbeat to retry.
|
|
33
31
|
*/
|
|
@@ -44,5 +42,5 @@ export declare function createVectorMigration(opts: {
|
|
|
44
42
|
isActive: () => boolean;
|
|
45
43
|
/** Rows per batch; the engine's `DEFAULT_VECTOR_MIGRATION_BATCH` when omitted. */
|
|
46
44
|
batchSize?: number;
|
|
47
|
-
}): VectorMigrationHandle
|
|
45
|
+
}): Promise<VectorMigrationHandle>;
|
|
48
46
|
//# sourceMappingURL=vectorMigration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectorMigration.d.ts","sourceRoot":"","sources":["../../src/vectorMigration.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vectorMigration.d.ts","sourceRoot":"","sources":["../../src/vectorMigration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,KAAK,IAAI,IAAI,CAAA;IACb,wFAAwF;IACxF,IAAI,IAAI,IAAI,CAAA;IACZ,wCAAwC;IACxC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAC1B;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,EAAE,EAAE,aAAa,CAAA;IACjB,MAAM,EAAE,YAAY,CAAA;IACpB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,OAAO,CAAA;IACvB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAiCjC"}
|