@avantf/dsh-mem 0.6.4 → 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.
Files changed (150) hide show
  1. package/README.md +19 -10
  2. package/lib/client.js +1665 -3466
  3. package/lib/dsh-build.json +6 -5
  4. package/lib/engine/graph-recall/in-memory.d.ts +93 -0
  5. package/lib/engine/graph-recall/index.d.ts +22 -0
  6. package/lib/engine/graph-recall/traverse.d.ts +119 -0
  7. package/lib/engine/graph-recall/types.d.ts +188 -0
  8. package/lib/engine/mem/config/config_files.d.ts +1 -1
  9. package/lib/engine/mem/config/loader.d.ts +2 -3
  10. package/lib/engine/mem/config/paths.d.ts +2 -13
  11. package/lib/engine/mem/db/dao/contradictions.d.ts +4 -22
  12. package/lib/engine/mem/db/dao/entities.d.ts +80 -7
  13. package/lib/engine/mem/db/dao/fact_sources.d.ts +3 -13
  14. package/lib/engine/mem/db/dao/facts.d.ts +311 -56
  15. package/lib/engine/mem/db/dao/triples.d.ts +1 -26
  16. package/lib/engine/mem/db/graph.d.ts +249 -0
  17. package/lib/engine/mem/db/journal_notes.d.ts +35 -0
  18. package/lib/engine/mem/db/migrations.d.ts +9 -0
  19. package/lib/engine/mem/db/port.d.ts +22 -3
  20. package/lib/engine/mem/db/schema.d.ts +119 -0
  21. package/lib/engine/mem/db/tokenizer.d.ts +9 -0
  22. package/lib/engine/mem/dbdrivers/fake/driver.d.ts +75 -0
  23. package/lib/engine/mem/dbdrivers/fake/index.d.ts +7 -0
  24. package/lib/engine/mem/dbdrivers/fake/surface.d.ts +34 -0
  25. package/lib/engine/mem/dbdrivers/fake/transport.d.ts +61 -0
  26. package/lib/engine/mem/dbdrivers/sqlite/connection.d.ts +14 -0
  27. package/lib/engine/mem/dbdrivers/sqlite/contradictions.d.ts +35 -0
  28. package/lib/engine/mem/dbdrivers/sqlite/dao/index.d.ts +16 -0
  29. package/lib/engine/mem/dbdrivers/sqlite/driver.d.ts +54 -0
  30. package/lib/engine/mem/dbdrivers/sqlite/facts.d.ts +117 -0
  31. package/lib/engine/mem/dbdrivers/sqlite/index.d.ts +6 -0
  32. package/lib/engine/mem/dbdrivers/sqlite/migrations.d.ts +15 -0
  33. package/lib/engine/mem/dbdrivers/sqlite/relations.d.ts +62 -0
  34. package/lib/engine/mem/dbdrivers/sqlite/search.d.ts +56 -0
  35. package/lib/engine/mem/dbdrivers/sqlite/sources.d.ts +37 -0
  36. package/lib/engine/mem/defaults.d.ts +3 -4
  37. package/lib/engine/mem/dispatch.d.ts +7 -32
  38. package/lib/engine/mem/entities/extract.d.ts +44 -47
  39. package/lib/engine/mem/eval/derived_runner.d.ts +6 -1
  40. package/lib/engine/mem/eval/relation_gold.d.ts +251 -0
  41. package/lib/engine/mem/eval/write_metrics.d.ts +1 -1
  42. package/lib/engine/mem/facts_io.d.ts +328 -0
  43. package/lib/engine/mem/index.d.ts +10 -2
  44. package/lib/engine/mem/interfaces/capabilities.d.ts +30 -0
  45. package/lib/engine/mem/interfaces/common.d.ts +11 -0
  46. package/lib/engine/mem/interfaces/errors.d.ts +65 -0
  47. package/lib/engine/mem/interfaces/index.d.ts +18 -0
  48. package/lib/engine/mem/interfaces/migrations.d.ts +21 -0
  49. package/lib/engine/mem/interfaces/repositories.d.ts +471 -0
  50. package/lib/engine/mem/interfaces/search_index.d.ts +113 -0
  51. package/lib/engine/mem/interfaces/storage_backend.d.ts +84 -0
  52. package/lib/engine/mem/interfaces/storage_driver.d.ts +43 -0
  53. package/lib/engine/mem/interfaces/version.d.ts +34 -0
  54. package/lib/engine/mem/lifecycle/contradiction.d.ts +2 -2
  55. package/lib/engine/mem/maintenance_paths.d.ts +41 -0
  56. package/lib/engine/mem/modelBootstrap.d.ts +1 -1
  57. package/lib/engine/mem/relations/confidence.d.ts +39 -0
  58. package/lib/engine/mem/relations/extract.d.ts +128 -0
  59. package/lib/engine/mem/relations/index.d.ts +32 -0
  60. package/lib/engine/mem/relations/name-quality.d.ts +78 -0
  61. package/lib/engine/mem/relations/normalize.d.ts +275 -0
  62. package/lib/engine/mem/relations/patterns.d.ts +67 -0
  63. package/lib/engine/mem/relations/statement.d.ts +88 -0
  64. package/lib/engine/mem/relations/types.d.ts +79 -0
  65. package/lib/engine/mem/runtime.d.ts +117 -90
  66. package/lib/engine/mem/storage/create.d.ts +42 -0
  67. package/lib/engine/mem/storage/errors.d.ts +65 -0
  68. package/lib/engine/mem/storage/index.d.ts +15 -0
  69. package/lib/engine/mem/storage/ports.d.ts +472 -0
  70. package/lib/engine/mem/storage/registry.d.ts +37 -0
  71. package/lib/engine/mem/storage/sqlite.d.ts +28 -0
  72. package/lib/engine/mem/store/common.d.ts +1 -1
  73. package/lib/engine/mem/store/entity_leg.d.ts +59 -2
  74. package/lib/engine/mem/store/entity_sweep.d.ts +4 -3
  75. package/lib/engine/mem/store/explicit_relations.d.ts +52 -0
  76. package/lib/engine/mem/store/facts_restore.d.ts +124 -0
  77. package/lib/engine/mem/store/floors.d.ts +4 -1
  78. package/lib/engine/mem/store/graph_reader.d.ts +146 -0
  79. package/lib/engine/mem/store/hybrid.d.ts +50 -13
  80. package/lib/engine/mem/store/kinds.d.ts +47 -0
  81. package/lib/engine/mem/store/legs.d.ts +24 -29
  82. package/lib/engine/mem/store/lexical.d.ts +36 -45
  83. package/lib/engine/mem/store/memory.d.ts +486 -82
  84. package/lib/engine/mem/store/recall_policy.d.ts +49 -0
  85. package/lib/engine/mem/store/relation_backfill.d.ts +210 -0
  86. package/lib/engine/mem/store/relation_planner.d.ts +191 -0
  87. package/lib/engine/mem/store/secret_guard.d.ts +0 -1
  88. package/lib/engine/mem/store/self_query.d.ts +4 -2
  89. package/lib/engine/mem/store/time_filter.d.ts +121 -0
  90. package/lib/engine/mem/store/titles.d.ts +52 -0
  91. package/lib/engine/mem/store/vector_repair.d.ts +44 -54
  92. package/lib/engine/mem-contract/config.d.ts +44 -38
  93. package/lib/engine/mem-contract/text.d.ts +1 -1
  94. package/lib/engine/mem-contract/tools.d.ts +184 -117
  95. package/lib/engine/mem-contract/types.d.ts +364 -288
  96. package/lib/index.js +13898 -11500
  97. package/lib/interface-version.json +1 -1
  98. package/lib/types/client/index.d.ts +2 -2
  99. package/lib/types/client/index.d.ts.map +1 -1
  100. package/lib/types/client/paging.d.ts +3 -12
  101. package/lib/types/client/paging.d.ts.map +1 -1
  102. package/lib/types/client/summarize.d.ts.map +1 -1
  103. package/lib/types/command.d.ts +61 -0
  104. package/lib/types/command.d.ts.map +1 -0
  105. package/lib/types/envinit-bootstrap.d.ts +1 -1
  106. package/lib/types/envinit.d.ts +2 -6
  107. package/lib/types/envinit.d.ts.map +1 -1
  108. package/lib/types/hints.d.ts +28 -24
  109. package/lib/types/hints.d.ts.map +1 -1
  110. package/lib/types/index.d.ts +21 -40
  111. package/lib/types/index.d.ts.map +1 -1
  112. package/lib/types/inject.d.ts +3 -2
  113. package/lib/types/inject.d.ts.map +1 -1
  114. package/lib/types/interface_gate.d.ts +9 -9
  115. package/lib/types/prompt.d.ts +17 -41
  116. package/lib/types/prompt.d.ts.map +1 -1
  117. package/lib/types/provision.d.ts +3 -0
  118. package/lib/types/provision.d.ts.map +1 -1
  119. package/lib/types/remote.d.ts +23 -9
  120. package/lib/types/remote.d.ts.map +1 -1
  121. package/lib/types/render.d.ts +3 -3
  122. package/lib/types/tool_schema.d.ts +4 -0
  123. package/lib/types/tool_schema.d.ts.map +1 -1
  124. package/lib/types/vectorMigration.d.ts +5 -7
  125. package/lib/types/vectorMigration.d.ts.map +1 -1
  126. package/package.json +16 -15
  127. package/lib/engine/mem/config/domains.d.ts +0 -20
  128. package/lib/engine/mem/db/dao/chunks.d.ts +0 -231
  129. package/lib/engine/mem/db/dao/documents.d.ts +0 -51
  130. package/lib/engine/mem/db/hash.d.ts +0 -2
  131. package/lib/engine/mem/db/knowledge.d.ts +0 -17
  132. package/lib/engine/mem/eval/index.d.ts +0 -4
  133. package/lib/engine/mem/git.d.ts +0 -73
  134. package/lib/engine/mem/router.d.ts +0 -51
  135. package/lib/engine/mem/store/doc_files.d.ts +0 -125
  136. package/lib/engine/mem/store/document_text.d.ts +0 -47
  137. package/lib/engine/mem/store/ingest_guard.d.ts +0 -25
  138. package/lib/engine/mem/store/knowledge.d.ts +0 -598
  139. package/lib/engine/mem/store/source_picker.d.ts +0 -43
  140. package/lib/engine/mem-retrieval/adapters/local_reranker.d.ts +0 -52
  141. package/lib/engine/mem-retrieval/adapters/none_reranker.d.ts +0 -10
  142. package/lib/engine/mem-retrieval/rerank.d.ts +0 -13
  143. package/lib/types/client/domains.d.ts +0 -53
  144. package/lib/types/client/domains.d.ts.map +0 -1
  145. package/lib/types/client/ingest.d.ts +0 -24
  146. package/lib/types/client/ingest.d.ts.map +0 -1
  147. package/lib/types/open.d.ts +0 -77
  148. package/lib/types/open.d.ts.map +0 -1
  149. package/lib/types/reconcile.d.ts +0 -64
  150. package/lib/types/reconcile.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
1
  {
2
- "baseVersion": "0.5.2",
2
+ "baseVersion": "0.5.3",
3
3
  "interfaceVersion": 4
4
4
  }
@@ -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 two tabs. `remote` (not `remote.avantfMem`)
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 two `conversation.view` tabs, mounting this package's Remote namespace first. */
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":"AAwGA,wDAAwD;AACxD,UAAU,aAAa;I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AE,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 two list tabs.
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): these two functions are where page drift is handled, and page drift is the
6
- * kind of bug that only shows up as a React key warning plus a row nobody can scroll to.
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;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAErF"}
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,CAoChD"}
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"}
@@ -0,0 +1,61 @@
1
+ import { defaultFactsExportPath as defaultExportPath, type AvantfRuntime } from '../engine/mem/index.js';
2
+ import { type AvantfLogger } from '../engine/mem-contract/index.js';
3
+ /** What one `/mem` invocation answers; the command service renders `text` verbatim. */
4
+ export interface MemCommandResult {
5
+ kind: 'success' | 'error';
6
+ text: string;
7
+ }
8
+ /** The slice of the host `commands` service this module calls. */
9
+ export interface MemCommandsService {
10
+ register(definition: {
11
+ name: string;
12
+ description: string;
13
+ input?: {
14
+ hint?: string;
15
+ };
16
+ handler: (invocation: {
17
+ rawInput: string;
18
+ }) => MemCommandResult | Promise<MemCommandResult>;
19
+ }): unknown;
20
+ }
21
+ /** The slice of a Cordis context registration needs — deliberately structural. */
22
+ export interface MemCommandContext {
23
+ get(name: string): unknown;
24
+ }
25
+ /** Registration options; the degraded path supplies the reason its runtime never opened. */
26
+ export interface RegisterMemCommandOptions {
27
+ /**
28
+ * When set, the command always answers with this reason instead of touching a runtime. The
29
+ * degraded mount passes the SAME `describeError` message its tools report.
30
+ */
31
+ degradedReason?: string;
32
+ }
33
+ /** One short description shared by registration and the help text. */
34
+ export declare const MEM_COMMAND_DESCRIPTION: string;
35
+ /** The input placeholder advertised to capable clients. */
36
+ export declare const MEM_COMMAND_INPUT_HINT = "[export [path] [--brotli|--gzip|--plain] | import <file> [--dry-run] [--source-ref <text>] | merge <db-path> [--dry-run] [--source-ref <text>]]";
37
+ /** Kept as this module's public name for the shared default-path rule (the one in the engine). */
38
+ export { defaultExportPath };
39
+ /**
40
+ * Run one `/mem` invocation. Pure of host services: the caller only needs a built runtime,
41
+ * which is what makes the whole command testable without mounting the plugin.
42
+ *
43
+ * @param rt - the live runtime (the same instance the tools use).
44
+ * @param rawInput - the text after `/mem` (may be empty).
45
+ * @returns a success or error result whose `text` is already human-readable Chinese.
46
+ */
47
+ export declare function runMemCommand(rt: AvantfRuntime, rawInput: string): Promise<MemCommandResult>;
48
+ /**
49
+ * Register the one `mem` slash command, when the host has a command service.
50
+ *
51
+ * Missing `commands` is a WARNING, not a mount failure: this plugin's tools, service, prompt
52
+ * and Remote face must survive a host that has no human-command registry. A registration that
53
+ * throws is contained for the same reason.
54
+ *
55
+ * @param ctx - the plugin context; only `get` is called.
56
+ * @param rt - the live runtime, or `undefined` on the degraded mount.
57
+ * @param log - the plugin logger.
58
+ * @param options - `degradedReason` makes the command report the runtime failure instead of running.
59
+ */
60
+ export declare function registerMemCommand(ctx: MemCommandContext, rt: AvantfRuntime | undefined, log: AvantfLogger, options?: RegisterMemCommandOptions): void;
61
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+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G,EAAE,iBAAiB,EACtB,EAAE,EAAE,aAAa,GAAG,SAAS,EAC7B,GAAG,EAAE,YAAY,EACjB,OAAO,GAAE,yBAA8B,GACtC,IAAI,CA+CN"}
@@ -3,7 +3,7 @@
3
3
  * @module bootstrap
4
4
  */
5
5
  /** The bootstrap version; the resolved framework must satisfy {@link supportedRange}. */
6
- export declare const VERSION = "0.5.2";
6
+ export declare const VERSION = "0.5.3";
7
7
  /**
8
8
  * The framework interval this bootstrap can launch.
9
9
  *
@@ -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
- * `pandoc` is "this build needs it": when `tools.auto_install` is off the item is NOT declared, so the
21
- * framework never fetches something the operator disabled per feature. The model is declared either
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":"AAoDA,OAAO,KAAK,EAAiB,oBAAoB,EAAe,MAAM,yBAAyB,CAAA;AAG/F,OA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A2F;IAC3F,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CAAA;IAC1C,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IACnE;;;;;;OAMG;IACH,kBAAkB,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,GAAG,IAAI,CAAA;IAC9F,wEAAwE;IACxE,OAAO,IAAI,IAAI,CAAA;CAChB;AAED,uCAAuC;AACvC,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,GAAG,CAAC,EAAE,aAAa,CAAA;IAC5B,6FAA6F;IAC7F,QAAQ,CAAC,IAAI,CAAC,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"}
@@ -1,41 +1,45 @@
1
- import type { RelevanceHit } from '../engine/mem/index.js';
2
1
  /**
3
- * The plugin's CONDITIONAL hint: ONE line, contributed only when either store already holds
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
- * These are deliberately NOT part of the always-on usage sections. A usage section says WHEN a
7
- * store is worth consulting and therefore has to be paid for on every step of every session; this
8
- * says "there is something here, right now", which is only true sometimes. The two layers compose:
9
- * the section is the fallback for the paraphrase the lexical probe misses, and the hint is the
10
- * concrete nudge for the case it catches.
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 FOR BOTH STORES, and it names ONE tool. `kb_query` is a cross-store retrieval (document
13
- * chunks AND memory facts), so a single line covers whichever store matched. Per-store lines used
14
- * to name two tools, which invited two overlapping calls — the memory facts came back twice, once
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. This text is injected as runtime context, and the harness
20
- * materialises that as a USER-role snapshot in the conversation (`dsh-agent-loop`'s
21
- * `runtimeContext.project`). Without an author, a line like "记忆里有相关内容" reads as something
22
- * the user said. The `[avantf-mem]` prefix is what keeps the provenance honest.
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\u6216\u77E5\u8BC6\u5E93\u91CC\u6709\u4E0E\u4E0A\u6761\u7528\u6237\u6D88\u606F\u76F8\u5173\u7684\u5185\u5BB9\uFF1B\u9700\u8981\u65F6\u7528 `kb_query` \u68C0\u7D22\u3002";
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
- * Map one answer to the contribution, as text.
22
+ * The text of the messages THIS STEP newly claimed from the user, or `''` when it claimed none.
27
23
  *
28
- * An empty string is the "contribute nothing" value: `renderContextSections` drops empty text, so
29
- * "nothing found" costs no tokens at all.
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 hintText(hit: RelevanceHit): string;
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
- * the probe is lexical, so it has nothing to say about them anyway.
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
@@ -1 +1 @@
1
- {"version":3,"file":"hints.d.ts","sourceRoot":"","sources":["../../src/hints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAO,MAAM,cAAc,sMAC8B,CAAA;AAEzD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAElD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAUpD"}
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"}
@@ -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 KnowledgeStore, type MemoryStore, type StoreResult } from '../engine/mem/index.js';
20
- import { type BrowseListing, type OpenOutcome, type RecallResult, type RemoteEnvelope, type SourceClassification } from '../engine/mem-contract/index.js';
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 { KNOWLEDGE_PROMPT_SECTION, MEMORY_PROMPT_SECTION } from './prompt.js';
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 five agent tools. Every payload is
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<StoreResult<MemoryStore, 'search'>>>;
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
@@ -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;AASlD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAExC,OAAO,EAAE,mBAAmB,EAAU,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AC,gBAAgB,CAAC,CAAC;IAMjE,KAAK,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;CAKjF;AAmGD,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyZvE"}
@@ -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 and two conditional
10
- * hints (see `prompt.ts`). Each service gates `apply`: without `tools`/`typert` there is nothing to
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;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,MAAM,UAAsC,CAAA"}
1
+ {"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../../src/inject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,UAAsC,CAAA"}
@@ -13,19 +13,19 @@
13
13
  * the legacy path — but the plugin ALWAYS mounts (tools, service, Remote and UI stay registered).
14
14
  * "Cannot tell" is never "incompatible": it warns and uses the base normally.
15
15
  *
16
- * **This file is a SHARED SHIM and must stay byte-identical in BOTH plugins** — only the `@module`
17
- * line below differs. Everything here is the consumption contract and the ONE verdict→decision
16
+ * **This file is a SHARED SHIM and must stay byte-identical in ALL THREE plugin trees** — only the
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/plugin-base/test/interface_consumers.spec.ts` pins the two copies
21
- * against each other, so a divergence is a red test instead of two shims that drifted.
20
+ * `envinit.ts`, never here. `base/test/interface_consumers.spec.ts` pins the three
21
+ * copies against each other, so a divergence is a red test instead of three shims that drifted.
22
22
  *
23
- * The loader SKELETON the two startups share lives here too: the once-per-process cache
23
+ * The loader SKELETON every startup shares lives here too: the once-per-process cache
24
24
  * ({@link createLoadCache}), the guard that turns any throw into one warning
25
25
  * ({@link loadGuarded}), and the gate→decision step ({@link gateOrDegrade}). Those sentences are
26
- * observably NOT the same in the two plugins, so every shared function takes them as
27
- * {@link DegradeWords}: the shim owns the mechanism, the caller owns the wording, and the two trees'
28
- * `envinit.spec.ts` pin each plugin's own text verbatim.
26
+ * observably NOT the same in each tree, so every shared function takes them as
27
+ * {@link DegradeWords}: the shim owns the mechanism, the caller owns the wording, and each tree's
28
+ * `envinit.spec.ts` pins its own text verbatim.
29
29
  *
30
30
  * @module @avantf/dsh-mem/interface_gate
31
31
  */
@@ -113,7 +113,7 @@ export declare function createLoadCache<O, T>(guarded: (options: O) => Promise<T
113
113
  * inside that window and half-register a plugin (the Remote face cannot be rolled back). A fiberless
114
114
  * stub counts as active: an unknown shape is "cannot tell", never "disposed".
115
115
  *
116
- * Generic Cordis liveness rather than interface-gate knowledge — but the two plugins' startup paths
116
+ * Generic Cordis liveness rather than interface-gate knowledge — but every plugin's startup path
117
117
  * share it byte-for-byte, so it lives with their one shared shim, where the two readings of "is my
118
118
  * context alive" cannot drift.
119
119
  */
@@ -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 three system-prompt sections this plugin contributes (DESIGN §10).
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
- * They exist 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 each
18
- * says only WHEN its store is worth writing or reading. Neither says anything about how memory is
19
- * retained — that stays out of every model-facing string, held to the contract's
20
- * `RETENTION_VOCABULARY`, the same list the tool descriptions are held to.
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
- * `docs/PENDING-RELEASE-NOTES.md` carries the pasteable text for exactly that case.
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 to consult the document knowledge base. See the module comment for why this is a separate
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
- * A separate section because it is a different job from the one above, and because the first
68
- * section is already at 382 of its 400-character budget. It exists to prevent a measured failure:
69
- * asked to "update the knowledge base", a model called the old all-in-one tool with a NEW title and
70
- * silently created a sibling document (《… · 补遗》) while the original stayed behind — two
71
- * overlapping documents, and the reader left to reconcile them. Changing a document is a FILE EDIT,
72
- * so the section has to name the file tools and warn about the one that destroys the frontmatter.
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 KB_EDIT_PROMPT_SECTION: {
75
- readonly name: "avantf:kb-edit";
76
- readonly order: 3020;
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,qBAAqB;;;;CAYA,CAAA;AAElC;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;CAOH,CAAA;AAElC;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB;;;;CAMD,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,EAIlD,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"}
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"}
@@ -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,eAAO,MAAM,cAAc,4BAA4B,CAAA;AAEvD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,eAAe,EAMvD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAA6C,CAAA;AAE1F,uFAAuF;AACvF,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAAmE,CAAA;AAKjH,6EAA6E;AAC7E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B,wCAAwC;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,+FAA+F;IAC/F,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;CACxC;AAED,0BAA0B;AAC1B,UAAU,SAAS;IACjB,kGAAkG;IAClG,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAA;CAChC;AAED,sDAAsD;AACtD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE/C;AAED,2EAA2E;AAC3E,wBAAgB,IAAI,CAAC,G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AAE;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"}
@@ -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
- * the 知识 tab with `kb.list`/`kb.domains`, either can be first, and neither is mandatory. The one
23
- * object EVERY answer shares is the application envelope, so the revision rides there — same
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 this point is the ten methods in `descriptors`
40
- * (remember / recall / admin / kb / query + openDoc / classifySource / browseDir / kbDomains /
41
- * kbAddDomain), all of which predate the marker — so nothing is gated on revision 1; the mechanism
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 = 2;
55
+ export declare const WIRE_VERSION = 4;
49
56
  /**
50
57
  * The successful application envelope, with the wire revision stamped on.
51
58
  *
@@ -70,8 +77,15 @@ export declare function wireErr(failure: Omit<RemoteErr, 'wire'>): RemoteErr;
70
77
  * the one inside the installed harness build), so no imported field type can be both correct and
71
78
  * stable; and the registry's field type is generation-specific (`TypertSchema['schema']` in 0.1.5,
72
79
  * `TypertSchemaFactory['create']`'s return in 0.1.6+, the name gone in 0.1.7), so naming it is what
73
- * broke this file's compilation on 0.1.7. The two copies are structurally identical, which is why the
74
- * declared entries stay assignable to whichever entry type the installed host declares.
80
+ * broke this file's compilation on 0.1.7.
81
+ *
82
+ * The two copies are structurally identical but NOT type-identical, and the host's own copy is not one
83
+ * version: 0.1.5 declares `zod: ^4.4.3` (a caret, so the install resolves the newest 4.x — 4.6.7) while
84
+ * 0.2.1-rc.2 pins `zod: "4.4.3"` exactly. `_zod.version.minor` is a literal type, so whichever minor we
85
+ * compile with, the other host's `TypertSchema['schema']` disagrees with it. That is why the `schemas`
86
+ * ASSIGNMENT below carries one explicit cast: the values are interchangeable at runtime (a schema
87
+ * carries its own methods, and the registry only calls them), while the type cannot be. Same trade the
88
+ * mem engine documents in DESIGN §20.11.
75
89
  */
76
90
  export declare const hostContribution: TypertContribution;
77
91
  //# sourceMappingURL=remote.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/remote.ts"],"names":[],"mappings":"AAwBA,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;AA6E/D,eAAO,MAAM,WAAW,EAAE,SAAS,oBAAoB,EA4HtD,CAAA;AAED,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,EAAE,wBAGhC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;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;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,EAAE,kBA0C9B,CAAA"}
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,wBAG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