@avantf/dsh-mem 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +97 -87
- package/lib/client.js +2359 -1174
- package/lib/client.js.map +1 -1
- package/lib/dsh-build.json +5 -5
- package/lib/index.js +1081 -668
- package/lib/interface-version.json +4 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/index.js +21 -1
- package/lib/types/client/index.js.map +1 -1
- package/lib/types/data_home.d.ts +3 -0
- package/lib/types/data_home.d.ts.map +1 -0
- package/lib/types/data_home.js +26 -0
- package/lib/types/data_home.js.map +1 -0
- package/lib/types/envinit-bootstrap.d.ts +13 -3
- package/lib/types/envinit-bootstrap.js +14 -4
- package/lib/types/envinit.d.ts +11 -6
- package/lib/types/envinit.d.ts.map +1 -1
- package/lib/types/envinit.js +62 -155
- package/lib/types/envinit.js.map +1 -1
- package/lib/types/hints.d.ts +15 -16
- package/lib/types/hints.d.ts.map +1 -1
- package/lib/types/hints.js +16 -17
- package/lib/types/hints.js.map +1 -1
- package/lib/types/index.d.ts +33 -11
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +110 -63
- package/lib/types/index.js.map +1 -1
- package/lib/types/interface_gate.d.ts +51 -0
- package/lib/types/interface_gate.d.ts.map +1 -0
- package/lib/types/interface_gate.js +84 -0
- package/lib/types/interface_gate.js.map +1 -0
- package/lib/types/prompt.d.ts +74 -4
- package/lib/types/prompt.d.ts.map +1 -1
- package/lib/types/prompt.js +85 -2
- package/lib/types/prompt.js.map +1 -1
- package/lib/types/provision.d.ts +29 -24
- package/lib/types/provision.d.ts.map +1 -1
- package/lib/types/provision.js +3 -59
- package/lib/types/provision.js.map +1 -1
- package/lib/types/remote.d.ts +7 -6
- package/lib/types/remote.d.ts.map +1 -1
- package/lib/types/remote.js +24 -10
- package/lib/types/remote.js.map +1 -1
- package/package.json +20 -22
|
@@ -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
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,qBAAqB;;;;CAOA,CAAA;AAElC;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;CAOH,CAAA;AAElC;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB;;;;CAMD,CAAA;AAElC,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;;;;;;;;;;;;;;;;GAgBG;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"}
|
package/lib/types/prompt.js
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
import { RETENTION_VOCABULARY } from '@avantf/mem-contract';
|
|
1
2
|
/**
|
|
2
|
-
* The
|
|
3
|
+
* The three system-prompt sections this plugin contributes (DESIGN §10).
|
|
4
|
+
*
|
|
5
|
+
* The TEXTS are user-editable: each section's body lives in its own `.md` under the shared family
|
|
6
|
+
* prompt directory `<data_home>/prompts` (`PROMPT_FILES` maps file → section), and the constants
|
|
7
|
+
* below are both the built-in default and what a missing/blank file is filled with. The identity —
|
|
8
|
+
* section name and order — stays in code, so editing a file cannot silently move a section in the
|
|
9
|
+
* prompt. The loader itself is generic and lives in the family base (`PromptFiles`, exported by
|
|
10
|
+
* `@avantf/dsh-plugin-base`), because "ensure the file exists, otherwise use the default" is the same
|
|
11
|
+
* flow for every section — and taking it from the base at RUNTIME means fixing it takes one base
|
|
12
|
+
* release, not a plugin rebuild. When the base is unavailable the built-in defaults below are used
|
|
13
|
+
* and nothing is written to disk.
|
|
3
14
|
*
|
|
4
15
|
* They exist for something a tool description cannot carry: a description says what a call DOES,
|
|
5
16
|
* never when to reach for it unprompted, and the default behaviour is to wait until asked. So each
|
|
@@ -44,7 +55,7 @@ export const KNOWLEDGE_PROMPT_SECTION = {
|
|
|
44
55
|
order: 3010,
|
|
45
56
|
text: '知识库(`kb_query` / `kb_add`)存放**用户提供的成篇资料**:文档、长说明、规范、综述等要按原文查阅的内容。'
|
|
46
57
|
+ '回答涉及已入库资料的问题之前,先用 `kb_query` 检索;命中就按 `source_ref` 引用原文。'
|
|
47
|
-
+ '用户给了值得长期留存的成篇内容就主动 `kb_add` 入库;一句话的事实属于记忆(`mem_remember`),不要入知识库。'
|
|
58
|
+
+ '用户给了值得长期留存的成篇内容就主动 `kb_add` 入库;一句话的事实属于记忆(`mem_remember`),不要入知识库。',
|
|
48
59
|
};
|
|
49
60
|
/**
|
|
50
61
|
* HOW to change a document that is already in the library.
|
|
@@ -62,4 +73,76 @@ export const KB_EDIT_PROMPT_SECTION = {
|
|
|
62
73
|
text: '更新知识库时,要在原文上修改或追加,不要新建一个补充文档。用 `kb_list` 拿到受管 `.md` 的绝对路径,'
|
|
63
74
|
+ '用文件工具修改。在用户明确要求时使用 `kb_remove` 删除。',
|
|
64
75
|
};
|
|
76
|
+
/**
|
|
77
|
+
* Where each section's text comes from: one `.md` per section, inside the SHARED family prompt
|
|
78
|
+
* directory (`<data_home>/prompts`, see {@link PromptFiles}).
|
|
79
|
+
*
|
|
80
|
+
* Every avantf plugin writes its prompts into that one directory and owns a prefix — `mem-*` here,
|
|
81
|
+
* `work-*` in the work engine — so a deployment can find and diff all of its model-facing text in
|
|
82
|
+
* one place without any plugin having to guess which files belong to it. This manifest is that
|
|
83
|
+
* ownership: a `.md` it does not list is ignored (never read, never written, never deleted).
|
|
84
|
+
*
|
|
85
|
+
* The FILE owns the text; the CODE keeps the identity. Mapping a file name to a section HERE is what
|
|
86
|
+
* makes that true: no edit to the directory can move a section to a different point in the prompt
|
|
87
|
+
* (order) or change the name the harness dedupes on — and no file another plugin owns can be
|
|
88
|
+
* mistaken for one of these.
|
|
89
|
+
*
|
|
90
|
+
* `fallback` is taken from the constant above rather than retyped, so "the text that used to be
|
|
91
|
+
* hardcoded" and "the text a missing file is filled with" cannot drift apart.
|
|
92
|
+
*/
|
|
93
|
+
export const PROMPT_FILES = [
|
|
94
|
+
{ file: 'mem-memory-usage.md', section: MEMORY_PROMPT_SECTION },
|
|
95
|
+
{ file: 'mem-knowledge-usage.md', section: KNOWLEDGE_PROMPT_SECTION },
|
|
96
|
+
{ file: 'mem-kb-edit.md', section: KB_EDIT_PROMPT_SECTION },
|
|
97
|
+
];
|
|
98
|
+
/** The generic loader's input: which file, and the body to write/use when it is missing or blank. */
|
|
99
|
+
export function promptFileSpecs() {
|
|
100
|
+
return PROMPT_FILES.map(({ file, section }) => ({ file, fallback: section.text }));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Zip the loaded texts back onto their sections, in manifest order.
|
|
104
|
+
*
|
|
105
|
+
* A section whose text is missing from `loaded` (the caller loaded a partial manifest) keeps its
|
|
106
|
+
* built-in default rather than losing its prompt entirely.
|
|
107
|
+
*/
|
|
108
|
+
export function buildPromptSections(loaded) {
|
|
109
|
+
const textByFile = new Map(loaded.map((entry) => [entry.file, entry.text]));
|
|
110
|
+
return PROMPT_FILES.map(({ file, section }) => ({
|
|
111
|
+
name: section.name,
|
|
112
|
+
order: section.order,
|
|
113
|
+
text: textByFile.get(file) ?? section.text,
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
/** The budget the built-in defaults are held to (`prompt_section.spec.ts` asserts it). */
|
|
117
|
+
export const PROMPT_TEXT_BUDGET = 400;
|
|
118
|
+
/** Explanatory phrasings the defaults are forbidden to contain; the spec guards the same shapes. */
|
|
119
|
+
const WHY_WORDS = ['因为', '否则', '原因是', '之所以'];
|
|
120
|
+
/**
|
|
121
|
+
* What is worth saying about text the USER wrote — as warnings, never as edits.
|
|
122
|
+
*
|
|
123
|
+
* The defaults are held to hard rules by `prompt_section.spec.ts`: under the budget (they are
|
|
124
|
+
* rendered into every model step), no retention vocabulary, no explanatory "why". An edited file
|
|
125
|
+
* cannot be held to them — it is the user's prompt — but all three are MEASURED regressions rather
|
|
126
|
+
* than style, so a line in the log is cheap and a silently worse prompt is not. Nothing is
|
|
127
|
+
* truncated and nothing is refused: the file is injected exactly as written.
|
|
128
|
+
*/
|
|
129
|
+
export function promptTextWarnings(sections) {
|
|
130
|
+
const out = [];
|
|
131
|
+
for (const section of sections) {
|
|
132
|
+
const text = typeof section.text === 'string' ? section.text : '';
|
|
133
|
+
if (text.length >= PROMPT_TEXT_BUDGET) {
|
|
134
|
+
out.push(`${section.name} is ${String(text.length)} chars (every model step carries it; the built-in default is under ${String(PROMPT_TEXT_BUDGET)})`);
|
|
135
|
+
}
|
|
136
|
+
for (const word of RETENTION_VOCABULARY) {
|
|
137
|
+
if (text.includes(word)) {
|
|
138
|
+
out.push(`${section.name} describes retention ("${word}"), which invites rewriting a fact to refresh it`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
for (const word of WHY_WORDS) {
|
|
142
|
+
if (text.includes(word))
|
|
143
|
+
out.push(`${section.name} explains why ("${word}"); the defaults state actions only`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return out;
|
|
147
|
+
}
|
|
65
148
|
//# sourceMappingURL=prompt.js.map
|
package/lib/types/prompt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/prompt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAG3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,IAAI;IACX,IAAI,EACF,kDAAkD;UAChD,iDAAiD;UACjD,uCAAuC;CACX,CAAA;AAElC;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,wBAAwB;IAC9B,KAAK,EAAE,IAAI;IACX,IAAI,EACF,mEAAmE;UACjE,yDAAyD;UACzD,mEAAmE;CACvC,CAAA;AAElC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,IAAI;IACX,IAAI,EACF,4DAA4D;UAC1D,oCAAoC;CACR,CAAA;AASlC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,YAAY,GAA+B;IACtD,EAAE,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,qBAAqB,EAAE;IAC/D,EAAE,IAAI,EAAE,wBAAwB,EAAE,OAAO,EAAE,wBAAwB,EAAE;IACrE,EAAE,IA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E,IAAI,IAAI,CAAC,MAAM,IAAI,kBAAkB,EAAE,CAAC;YACtC,GAAG,CAAC,IAAI,CACN,GAAG,OAAO,CAAC,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,sEAAsE,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAC7I,CAAA;QACH,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,oBAAoB,EAAE,CAAC;YACxC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxB,GAAG,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,0BAA0B,IAAI,kDAAkD,CAAC,CAAA;YAC3G,CAAC;QACH,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;YAC7B,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAAE,GAAG,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,mBAAmB,IAAI,qCAAqC,CAAC,CAAA;QAChH,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
package/lib/types/provision.d.ts
CHANGED
|
@@ -1,15 +1,34 @@
|
|
|
1
|
-
import type { CompatContext, CompatEvidence, CompatLogger, CompatSpec, CompatVerdict, ServiceContract } from '@avantf/dsh-compat';
|
|
2
|
-
export type { CompatEvidence, CompatVerdict };
|
|
3
|
-
/** The base package, typed but never imported (see the module note). */
|
|
4
|
-
export type CompatModule = typeof import('@avantf/dsh-compat');
|
|
5
|
-
/** The base package id, named here too so the item declaration and the spec need no import. */
|
|
6
|
-
export declare const COMPAT_PACKAGE = "@avantf/dsh-compat";
|
|
7
1
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
2
|
+
* This plugin's compatibility spec, and the wiring that runs it.
|
|
3
|
+
*
|
|
4
|
+
* The rules, the probes, the report and the post-registration check all live in the family base
|
|
5
|
+
* `@avantf/dsh-plugin-base` — its `compat` module, which used to be the separate
|
|
6
|
+
* `@avantf/dsh-compat` package, shipped in the one base release. What stays here is only what is true
|
|
7
|
+
* of THIS plugin: the services and methods it calls, the dsh packages that identify the host, the
|
|
8
|
+
* wire schema names and tool names that must be visible afterwards, the events it listens to, and the
|
|
9
|
+
* Chinese report a user reads. See `DESIGN.md` §12.1.
|
|
10
|
+
*
|
|
11
|
+
* **Who obtains the base.** Not this module. The base IS the framework the inlined bootstrap resolves
|
|
12
|
+
* and loads at startup (`src/envinit.ts`), and the compatibility gate arrives WITH it: there is no
|
|
13
|
+
* `mem:compat` manifest item, no npm download and no managed `<home>/compat/**` copy any more. This
|
|
14
|
+
* module is handed the loaded module and derives everything from it.
|
|
15
|
+
*
|
|
16
|
+
* The base therefore has NO import path of its own here — not even a dynamic one. A static `import`
|
|
17
|
+
* would throw `ERR_MODULE_NOT_FOUND` while the artifact was being evaluated (the base is a PEER, not
|
|
18
|
+
* a runtime dependency of the published plugin), and a bare dynamic `import()` would bypass the module
|
|
19
|
+
* the bootstrap already resolved. The plugin only ever sees the module object it was handed.
|
|
20
|
+
*
|
|
21
|
+
* The plugin computes the gate's verdict here and hands it to the engine as plain data
|
|
22
|
+
* (`{ load, status, reason }`), so the inlined engine bundle never imports the base either.
|
|
23
|
+
*
|
|
24
|
+
* @module @avantf/dsh-mem/provision
|
|
11
25
|
*/
|
|
12
|
-
|
|
26
|
+
import type { CompatContext, CompatEvidence, CompatLogger, CompatSpec, CompatVerdict, ServiceContract } from '@avantf/dsh-plugin-base';
|
|
27
|
+
export type { CompatEvidence, CompatVerdict };
|
|
28
|
+
/** The base package, typed but never imported (see the module note). */
|
|
29
|
+
export type CompatModule = typeof import('@avantf/dsh-plugin-base');
|
|
30
|
+
/** The base package id, named here so the gate's messages need no import of it. */
|
|
31
|
+
export declare const COMPAT_PACKAGE = "@avantf/dsh-plugin-base";
|
|
13
32
|
/**
|
|
14
33
|
* The services this plugin calls, with the methods it calls on them.
|
|
15
34
|
*
|
|
@@ -52,20 +71,6 @@ export interface CompatRun {
|
|
|
52
71
|
export declare function reasonOf(error: unknown): string;
|
|
53
72
|
/** Emit a warning without ever letting the logger turn it into a crash. */
|
|
54
73
|
export declare function warn(log: CompatLogger | undefined, message: string): void;
|
|
55
|
-
/**
|
|
56
|
-
* The range of `@avantf/dsh-compat` this build is written against.
|
|
57
|
-
*
|
|
58
|
-
* Read from THIS plugin's manifest, which is the single source of truth — the framework does not
|
|
59
|
-
* pick it, and a hardcoded constant would silently keep provisioning an old range after the family
|
|
60
|
-
* publishes a new one. The constant is only a fallback for a manifest that lost the entry.
|
|
61
|
-
*
|
|
62
|
-
* It lives in `devDependencies`, deliberately. Nothing imports the base: the framework fetches it
|
|
63
|
-
* into its own managed home and this plugin loads it from there, so a RUNTIME dependency would
|
|
64
|
-
* install a second copy on every consumer that no code path ever loads. `devDependencies` still
|
|
65
|
-
* ships in the packed manifest (pnpm keeps it, rewriting `catalog:` like any other field), so the
|
|
66
|
-
* range travels with the artifact; it just is not installed.
|
|
67
|
-
*/
|
|
68
|
-
export declare function compatRange(manifestUrl?: URL): Promise<string>;
|
|
69
74
|
/**
|
|
70
75
|
* Build the plugin-specific half of the gate from a loaded base.
|
|
71
76
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provision.d.ts","sourceRoot":"","sources":["../../src/provision.ts"],"names":[],"mappings":"
|
|
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,4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;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/provision.js
CHANGED
|
@@ -1,39 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This plugin's compatibility spec, and the wiring that runs it.
|
|
3
|
-
*
|
|
4
|
-
* The rules, the probes, the report and the post-registration check all live in
|
|
5
|
-
* `@avantf/dsh-compat` (shared with the rest of the family). What stays here is only what is true of
|
|
6
|
-
* THIS plugin: the services and methods it calls, the dsh packages that identify the host, the wire
|
|
7
|
-
* schema names and tool names that must be visible afterwards, the events it listens to, and the
|
|
8
|
-
* Chinese report a user reads. See `DESIGN.md` §12.1.
|
|
9
|
-
*
|
|
10
|
-
* **Who obtains the base.** Not this module. The family framework `@avantf/dsh-envinit` provisions
|
|
11
|
-
* `@avantf/dsh-compat` as the `mem:compat` manifest item and hands back the directory it landed in
|
|
12
|
-
* (`src/envinit.ts`); this module is given the loaded module and derives everything from it. That is
|
|
13
|
-
* the whole point of the framework: acquisition (resolve → managed copy → verified download →
|
|
14
|
-
* atomic publish) is one shared mechanism, and the plugin only declares what it needs.
|
|
15
|
-
*
|
|
16
|
-
* The base therefore has NO import path of its own here — not even a dynamic one. A static `import`
|
|
17
|
-
* would throw `ERR_MODULE_NOT_FOUND` while the artifact was being evaluated (the base is not a
|
|
18
|
-
* runtime dependency of the published plugin any more), and a bare dynamic `import()` would bypass
|
|
19
|
-
* the framework's managed copy. The plugin loads the module the framework resolved, by file URL.
|
|
20
|
-
*
|
|
21
|
-
* The plugin computes the gate's verdict here and hands it to the engine as plain data
|
|
22
|
-
* (`{ load, status, reason }`), so the inlined engine bundle never imports the base either.
|
|
23
|
-
*
|
|
24
|
-
* @module @avantf/dsh-mem/provision
|
|
25
|
-
*/
|
|
26
|
-
import { readFile } from 'node:fs/promises';
|
|
27
1
|
import { defineTool } from '@deepseek-ai/dsh-tools';
|
|
28
2
|
import { hostContribution } from './remote.js';
|
|
29
|
-
/** The base package id, named here
|
|
30
|
-
export const COMPAT_PACKAGE = '@avantf/dsh-
|
|
31
|
-
/**
|
|
32
|
-
* Fallback range for `@avantf/dsh-compat`, used only when `package.json` has lost the dependency
|
|
33
|
-
* entry. The manifest is the single source of truth (`compatRange()`); `scripts/pack-plugin.mjs`
|
|
34
|
-
* pins this constant to it so the two cannot drift.
|
|
35
|
-
*/
|
|
36
|
-
export const COMPAT_RANGE = '^0.1.0';
|
|
3
|
+
/** The base package id, named here so the gate's messages need no import of it. */
|
|
4
|
+
export const COMPAT_PACKAGE = '@avantf/dsh-plugin-base';
|
|
37
5
|
/**
|
|
38
6
|
* The services this plugin calls, with the methods it calls on them.
|
|
39
7
|
*
|
|
@@ -78,31 +46,6 @@ export function warn(log, message) {
|
|
|
78
46
|
// A logger that throws is not evidence of anything.
|
|
79
47
|
}
|
|
80
48
|
}
|
|
81
|
-
/**
|
|
82
|
-
* The range of `@avantf/dsh-compat` this build is written against.
|
|
83
|
-
*
|
|
84
|
-
* Read from THIS plugin's manifest, which is the single source of truth — the framework does not
|
|
85
|
-
* pick it, and a hardcoded constant would silently keep provisioning an old range after the family
|
|
86
|
-
* publishes a new one. The constant is only a fallback for a manifest that lost the entry.
|
|
87
|
-
*
|
|
88
|
-
* It lives in `devDependencies`, deliberately. Nothing imports the base: the framework fetches it
|
|
89
|
-
* into its own managed home and this plugin loads it from there, so a RUNTIME dependency would
|
|
90
|
-
* install a second copy on every consumer that no code path ever loads. `devDependencies` still
|
|
91
|
-
* ships in the packed manifest (pnpm keeps it, rewriting `catalog:` like any other field), so the
|
|
92
|
-
* range travels with the artifact; it just is not installed.
|
|
93
|
-
*/
|
|
94
|
-
export async function compatRange(manifestUrl = new URL('../package.json', import.meta.url)) {
|
|
95
|
-
try {
|
|
96
|
-
const raw = JSON.parse(await readFile(manifestUrl, 'utf8'));
|
|
97
|
-
const declared = raw.devDependencies?.[COMPAT_PACKAGE] ?? raw.dependencies?.[COMPAT_PACKAGE];
|
|
98
|
-
if (typeof declared === 'string' && declared.trim() !== '')
|
|
99
|
-
return declared;
|
|
100
|
-
}
|
|
101
|
-
catch {
|
|
102
|
-
// Fall through to the pinned fallback.
|
|
103
|
-
}
|
|
104
|
-
return COMPAT_RANGE;
|
|
105
|
-
}
|
|
106
49
|
/**
|
|
107
50
|
* Build the plugin-specific half of the gate from a loaded base.
|
|
108
51
|
*
|
|
@@ -210,6 +153,7 @@ export function registerCompatMegaphone(ctx, verdict, log, compat) {
|
|
|
210
153
|
warningsLabel: '风险提示:',
|
|
211
154
|
warnings: verdict.warnings,
|
|
212
155
|
fix: '修复:在本仓库重建(`pnpm build:dsh`),或把 `@deepseek-ai/dsh` 换回本构建声明的版本。',
|
|
156
|
+
logPointer: (prefix) => `完整诊断见宿主日志里 ${prefix} 开头的行。`,
|
|
213
157
|
}),
|
|
214
158
|
});
|
|
215
159
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provision.js","sourceRoot":"","sources":["../../src/provision.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provision.js","sourceRoot":"","sources":["../../src/provision.ts"],"names":[],"mappings":"AAiCA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAO9C,mFAAmF;AACnF,MAAM,CAAC,MAAM,cAAc,GAAG,yBAAyB,CAAA;AAEvD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA+B;IAC3D,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,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BAAiB,CAAC;QAC9B,GAAG;QACH,GAAG;QACH,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE;QAC9D,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE;YACxC,OAAO,EAAE,sEAAsE;YAC/E,aAAa,EAAE,OAAO;YACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,GAAG,EAAE,+DAA+D;YACpE,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,cAAc,MAAM,QAAQ;SACrD,CAAC;KACH,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAKrC;IACC,OAAO,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC;QAC/C,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS;QACtC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW;QACrC,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B,CAAC,CAAA;AACJ,CAAC"}
|
package/lib/types/remote.d.ts
CHANGED
|
@@ -6,12 +6,13 @@ export declare const clientContribution: TypertRemoteContribution;
|
|
|
6
6
|
/**
|
|
7
7
|
* Host face: registered by the host half through `ctx.typert.register()`.
|
|
8
8
|
*
|
|
9
|
-
* The schema
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* `
|
|
14
|
-
*
|
|
9
|
+
* The schema values are named `z.ZodType` — this package's own zod — not the registry's field type,
|
|
10
|
+
* for two reasons. There are two PHYSICALLY different zod copies in play (the workspace catalog's and
|
|
11
|
+
* the one inside the installed harness build), so no imported field type can be both correct and
|
|
12
|
+
* stable; and the registry's field type is generation-specific (`TypertSchema['schema']` in 0.1.5,
|
|
13
|
+
* `TypertSchemaFactory['create']`'s return in 0.1.6+, the name gone in 0.1.7), so naming it is what
|
|
14
|
+
* broke this file's compilation on 0.1.7. The two copies are structurally identical, which is why the
|
|
15
|
+
* declared entries stay assignable to whichever entry type the installed host declares.
|
|
15
16
|
*/
|
|
16
17
|
export declare const hostContribution: TypertContribution;
|
|
17
18
|
//# 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,
|
|
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;AA6EhF,eAAO,MAAM,WAAW,EAAE,SAAS,oBAAoB,EAqGtD,CAAA;AAED,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,EAAE,wBAGhC,CAAA;AA8BD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,EAAE,kBA0C9B,CAAA"}
|
package/lib/types/remote.js
CHANGED
|
@@ -32,7 +32,13 @@ const resultSymbol = (method) => fieldSymbol(method, 'result');
|
|
|
32
32
|
*
|
|
33
33
|
* Carries BOTH members on purpose: the host's validator moved from `codec.schema.parse` (0.1.5) to
|
|
34
34
|
* `codec.create()` (0.1.6), and each generation checks only its own. One shape therefore serves
|
|
35
|
-
* either host
|
|
35
|
+
* either host.
|
|
36
|
+
*
|
|
37
|
+
* Kept LOCAL — a two-line mirror of the base kit's `strictCodec`, not a runtime call — on purpose:
|
|
38
|
+
* the Remote face is built at module load and must exist even when the base cannot be loaded at all,
|
|
39
|
+
* so its construction may not depend on a runtime `import()` of the base. This is the "mirrors a
|
|
40
|
+
* convention, so changing it takes a plugin release" side of the rule in the root AGENTS.md; the
|
|
41
|
+
* shared, fixable-by-a-base-release code lives in `@avantf/dsh-plugin-base`'s kit.
|
|
36
42
|
*/
|
|
37
43
|
function strict(schema, typeSymbol) {
|
|
38
44
|
return { mode: 'strict', typeSymbol, schema, create: () => schema };
|
|
@@ -179,26 +185,34 @@ export const clientContribution = {
|
|
|
179
185
|
package: PACKAGE,
|
|
180
186
|
descriptors,
|
|
181
187
|
};
|
|
182
|
-
/**
|
|
188
|
+
/** The zod schema a strict codec carries, whichever generation's codec type is in play. */
|
|
189
|
+
function codecSchema(codec) {
|
|
190
|
+
// Our own `strict()` always puts `schema` on the value, so this is the local schema even when the
|
|
191
|
+
// HOST's `TypertCodec` no longer names that member (0.1.7 removed it from the type; the value a
|
|
192
|
+
// plugin builds still carries it, which is exactly what keeps 0.1.5 hosts validating).
|
|
193
|
+
return codec.schema;
|
|
194
|
+
}
|
|
195
|
+
/** Declare one registered wire schema: the factory 0.1.6+ calls, plus the schema 0.1.5 reads. */
|
|
183
196
|
function declared(name, schema) {
|
|
184
197
|
return { name, schema, create: () => schema };
|
|
185
198
|
}
|
|
186
199
|
/**
|
|
187
200
|
* Host face: registered by the host half through `ctx.typert.register()`.
|
|
188
201
|
*
|
|
189
|
-
* The schema
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* `
|
|
194
|
-
*
|
|
202
|
+
* The schema values are named `z.ZodType` — this package's own zod — not the registry's field type,
|
|
203
|
+
* for two reasons. There are two PHYSICALLY different zod copies in play (the workspace catalog's and
|
|
204
|
+
* the one inside the installed harness build), so no imported field type can be both correct and
|
|
205
|
+
* stable; and the registry's field type is generation-specific (`TypertSchema['schema']` in 0.1.5,
|
|
206
|
+
* `TypertSchemaFactory['create']`'s return in 0.1.6+, the name gone in 0.1.7), so naming it is what
|
|
207
|
+
* broke this file's compilation on 0.1.7. The two copies are structurally identical, which is why the
|
|
208
|
+
* declared entries stay assignable to whichever entry type the installed host declares.
|
|
195
209
|
*/
|
|
196
210
|
export const hostContribution = {
|
|
197
211
|
package: PACKAGE,
|
|
198
212
|
face: 'host',
|
|
199
213
|
schemas: descriptors.flatMap((descriptor) => [
|
|
200
|
-
...descriptor.parameters.map(parameter => declared(`${descriptor.method}${parameter.name}`, parameter.codec
|
|
201
|
-
declared(`${descriptor.method}Result`, descriptor.result
|
|
214
|
+
...descriptor.parameters.map(parameter => declared(`${descriptor.method}${parameter.name}`, codecSchema(parameter.codec))),
|
|
215
|
+
declared(`${descriptor.method}Result`, codecSchema(descriptor.result)),
|
|
202
216
|
]),
|
|
203
217
|
model: {
|
|
204
218
|
services: [
|
package/lib/types/remote.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../src/remote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAYvB,MAAM,OAAO,GAAG,iBAAiB,CAAA;AACjC,MAAM,SAAS,GAAG,WAAW,CAAA;AAE7B,MAAM,UAAU,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,GAAG,OAAO,IAAI,SAAS,IAAI,MAAM,EAAE,CAAA;AAClF,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,KAAa,EAAU,EAAE,CAAC,GAAG,OAAO,IAAI,SAAS,IAAI,MAAM,IAAI,KAAK,EAAE,CAAA;AAC3G,MAAM,YAAY,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;AAE9E
|
|
1
|
+
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../src/remote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CA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,CAAE,SAAS,CAAC,KAAkD,CAAC,CAC3E,CAAC;QACF,QAAQ,CACN,GAAG,UAAU,CAAC,MAAM,QAAQ,EAC5B,WAAW,CAAE,UAAU,CAAC,MAAmD,CAAC,CAC7E;KACF,CAAC;IACF,KAAK,EAAE;QACL,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,cAAc;gBACnB,UAAU,EAAE,cAAc;gBAC1B,WAAW,EAAE,wGAAwG;gBACrH,OAAO,EAAE,2BAA2B;gBACpC,IAAI,EAAE,EAAE;gBACR,OAAO,EAAE,EAAE;gBACX,KAAK,EAAE,EAAE;aACV;YACD;gBACE,GAAG,EAAE,SAAS;gBACd,UAAU,EAAE,SAAS;gBACrB,WAAW,EAAE,4FAA4F;gBACzG,OAAO,EAAE,0BAA0B;gBACnC,IAAI,EAAE,EAAE;gBACR,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;oBACtC,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,UAAU,CAAC,MAAM;oBACvB,SAAS,EAAE,oCAAoC;iBAChD,CAAC,CAAC;gBACH,KAAK,EAAE,EAAE;aACV;SACF;QACD,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,EAAE;KACZ;IACD,WAAW,EAAE,WAAW;CACzB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avantf/dsh-mem",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "avantf-mem DSH native Cordis plugin: host service + tools + RPC + client tabs 记忆/知识",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"README.md"
|
|
31
31
|
],
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@avantf/dsh-
|
|
33
|
+
"@avantf/dsh-plugin-base": ">=0.3.0 <1.0.0",
|
|
34
34
|
"@deepseek-ai/cordis": "^4.0.0",
|
|
35
|
-
"@deepseek-ai/dsh-system-prompt": "^0.1.5-rc.2",
|
|
36
|
-
"@deepseek-ai/dsh-tools": "^0.1.5-rc.2",
|
|
37
|
-
"@deepseek-ai/dsh-typert-protocol": "^0.1.5-rc.2",
|
|
35
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.5-rc.2 || ^0.1.7-rc.2",
|
|
36
|
+
"@deepseek-ai/dsh-tools": "^0.1.5-rc.2 || ^0.1.7-rc.2",
|
|
37
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.1.5-rc.2 || ^0.1.7-rc.2",
|
|
38
38
|
"@deepseek-ai/schemastery": "^3.18.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependenciesMeta": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"exceljs": "^4.4.0",
|
|
60
60
|
"unpdf": "^1.8.1",
|
|
61
61
|
"yaml": "^2.5.0",
|
|
62
|
-
"zod": "4.
|
|
62
|
+
"zod": "4.6.5"
|
|
63
63
|
},
|
|
64
64
|
"optionalDependencies": {
|
|
65
65
|
"@huggingface/transformers": "^4.2.0",
|
|
@@ -67,23 +67,20 @@
|
|
|
67
67
|
"nodejieba": "^2.6.0"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@avantf/dsh-
|
|
71
|
-
"@avantf/
|
|
72
|
-
"@avantf/mem": "0.
|
|
73
|
-
"@avantf/mem-
|
|
74
|
-
"@avantf/mem-
|
|
75
|
-
"@avantf/mem-provision": "0.1.1",
|
|
70
|
+
"@avantf/dsh-plugin-base": ">=0.3.0 <1.0.0",
|
|
71
|
+
"@avantf/mem": "0.3.0",
|
|
72
|
+
"@avantf/mem-contract": "0.3.0",
|
|
73
|
+
"@avantf/mem-convert": "0.3.0",
|
|
74
|
+
"@avantf/mem-provision": "0.3.0",
|
|
76
75
|
"@types/node": "^22.0.0",
|
|
77
76
|
"@types/react": "^18.3.0",
|
|
78
77
|
"@types/react-dom": "^18.3.0",
|
|
79
78
|
"lightningcss": "^1.32.0",
|
|
80
|
-
"react": "
|
|
81
|
-
"react-dom": "
|
|
79
|
+
"react": "18.3.1",
|
|
80
|
+
"react-dom": "18.3.1",
|
|
82
81
|
"tsdown": "0.22.2",
|
|
83
|
-
"typescript": "^5.5.0"
|
|
84
|
-
|
|
85
|
-
"engines": {
|
|
86
|
-
"node": ">=22"
|
|
82
|
+
"typescript": "^5.5.0",
|
|
83
|
+
"vitest": "^2.1.0"
|
|
87
84
|
},
|
|
88
85
|
"license": "MIT",
|
|
89
86
|
"publishConfig": {
|
|
@@ -92,15 +89,16 @@
|
|
|
92
89
|
"prepublishOnly": "pnpm build",
|
|
93
90
|
"repository": {
|
|
94
91
|
"type": "git",
|
|
95
|
-
"url": "git@gitee.com:ffeng86/
|
|
96
|
-
"directory": "packages/plugin"
|
|
92
|
+
"url": "git@gitee.com:ffeng86/dsh-plugins.git",
|
|
93
|
+
"directory": "mem/packages/plugin"
|
|
97
94
|
},
|
|
98
95
|
"author": "qunqi.ff",
|
|
99
96
|
"scripts": {
|
|
100
|
-
"build": "tsc -p tsconfig.json && node ../../scripts/copy-envinit-bootstrap.mjs && tsdown",
|
|
97
|
+
"build": "node ../../scripts/link-dsh.mjs && node ../../scripts/link-envinit.mjs && tsc -p tsconfig.json && node ../../scripts/copy-envinit-bootstrap.mjs && tsdown",
|
|
101
98
|
"bundle": "tsdown",
|
|
102
99
|
"watch": "tsdown --watch",
|
|
103
|
-
"typecheck": "tsc -p tsconfig.json
|
|
100
|
+
"typecheck": "node ../../scripts/link-dsh.mjs && tsc -p tsconfig.test.json",
|
|
101
|
+
"test": "vitest run",
|
|
104
102
|
"test:dsh": "vitest run --config vitest.dsh.config.ts"
|
|
105
103
|
}
|
|
106
104
|
}
|