@benz-ai-x/dsh-research-graph 0.2.0-rc.2.1 → 0.2.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/README.zh.md +6 -6
- package/lib/client.js +2 -2
- package/lib/migrate-merge-history.js +640 -24
- package/package.json +7 -12
- package/lib/invariant.js +0 -21
- package/lib/types/invariant.d.ts +0 -14
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ flowchart LR
|
|
|
43
43
|
</a>
|
|
44
44
|
</p>
|
|
45
45
|
|
|
46
|
-
Version 0.2.
|
|
46
|
+
Version 0.2.1-alpha.1 with demo data. Click the image for the full-resolution screenshot.
|
|
47
47
|
|
|
48
48
|
<a id="features"></a>
|
|
49
49
|
<a id="what-it-adds"></a>
|
|
@@ -66,8 +66,8 @@ Version 0.2.0-rc.2.1 with demo data. Click the image for the full-resolution scr
|
|
|
66
66
|
|
|
67
67
|
| Item | Details |
|
|
68
68
|
| --- | --- |
|
|
69
|
-
| Plugin release | [0.2.
|
|
70
|
-
| Required Host | **DSH 0.2.
|
|
69
|
+
| Plugin release | [0.2.1-alpha.1](https://github.com/benz-ai-x/dsh-research-graph/releases/tag/v0.2.1-alpha.1), npm `next` |
|
|
70
|
+
| Required Host | **DSH 0.2.1-alpha.1 · Web**, Node.js `^22.19.0 \|\| >=24.0.0` |
|
|
71
71
|
| Data | Research records live on the DSH Host; working positions stay in the browser and Topic arrangements require explicit saving |
|
|
72
72
|
| Model calls | Browsing, manual capture, and export make no model call; AI generation and new discussions use models on demand |
|
|
73
73
|
| Agent capabilities | DSH provides models, tools, presets, and agent execution; this plugin includes no preset or Agent Team launcher. [Details](docs/user-guide.md#dsh-and-agent-presets) |
|
|
@@ -77,10 +77,10 @@ Version 0.2.0-rc.2.1 with demo data. Click the image for the full-resolution scr
|
|
|
77
77
|
|
|
78
78
|
## Quick start
|
|
79
79
|
|
|
80
|
-
Requires **DSH 0.2.
|
|
80
|
+
Requires **DSH 0.2.1-alpha.1**, with both `dsh` and `pnpm` on your `PATH`. Stop any running `dsh web`, then run:
|
|
81
81
|
|
|
82
82
|
```sh
|
|
83
|
-
dsh plugin --profile web add @benz-ai-x/dsh-research-graph@0.2.
|
|
83
|
+
dsh plugin --profile web add @benz-ai-x/dsh-research-graph@0.2.1-alpha.1
|
|
84
84
|
dsh web
|
|
85
85
|
```
|
|
86
86
|
|
|
@@ -88,4 +88,4 @@ Open the login URL printed in the terminal, enter a **non-blank Session**, and s
|
|
|
88
88
|
|
|
89
89
|
## Docs and support
|
|
90
90
|
|
|
91
|
-
[User guide](docs/user-guide.md) · [Troubleshooting](docs/user-guide.md#troubleshooting) · [Development and release](docs/development.md) · [Release acceptance](docs/reviews/release-0.2.
|
|
91
|
+
[User guide](docs/user-guide.md) · [Troubleshooting](docs/user-guide.md#troubleshooting) · [Development and release](docs/development.md) · [Release acceptance](docs/reviews/release-0.2.1-alpha.1.md) · [Report an issue](https://github.com/benz-ai-x/dsh-research-graph/issues)
|
package/README.zh.md
CHANGED
|
@@ -43,7 +43,7 @@ flowchart LR
|
|
|
43
43
|
</a>
|
|
44
44
|
</p>
|
|
45
45
|
|
|
46
|
-
0.2.
|
|
46
|
+
0.2.1-alpha.1 的真实界面(演示数据),点击图片查看高清原图。
|
|
47
47
|
|
|
48
48
|
<a id="核心能力"></a>
|
|
49
49
|
|
|
@@ -65,8 +65,8 @@ flowchart LR
|
|
|
65
65
|
|
|
66
66
|
| 项目 | 说明 |
|
|
67
67
|
| --- | --- |
|
|
68
|
-
| 当前插件 | [0.2.
|
|
69
|
-
| 适配宿主 | **DSH 0.2.
|
|
68
|
+
| 当前插件 | [0.2.1-alpha.1](https://github.com/benz-ai-x/dsh-research-graph/releases/tag/v0.2.1-alpha.1),npm `next` |
|
|
69
|
+
| 适配宿主 | **DSH 0.2.1-alpha.1 · Web**,Node.js `^22.19.0 \|\| >=24.0.0` |
|
|
70
70
|
| 数据保存 | 研究数据保存在 DSH Host;工作位置保存在浏览器,主题排列需显式保存 |
|
|
71
71
|
| 模型调用 | 浏览、手工留卡、导出不调用模型;AI 生成与新讨论按需调用 |
|
|
72
72
|
| Agent 能力 | 模型、工具、预设与 Agent 执行由 DSH 提供;插件不内置预设或 Agent Team 启动器。[详细说明](docs/user-guide.zh.md#dsh-与-agent-预设) |
|
|
@@ -76,10 +76,10 @@ flowchart LR
|
|
|
76
76
|
|
|
77
77
|
## 快速开始
|
|
78
78
|
|
|
79
|
-
需要 **DSH 0.2.
|
|
79
|
+
需要 **DSH 0.2.1-alpha.1**,并确保 `dsh`、`pnpm` 均在 `PATH` 中。如有正在运行的 `dsh web`,先停止,再执行:
|
|
80
80
|
|
|
81
81
|
```sh
|
|
82
|
-
dsh plugin --profile web add @benz-ai-x/dsh-research-graph@0.2.
|
|
82
|
+
dsh plugin --profile web add @benz-ai-x/dsh-research-graph@0.2.1-alpha.1
|
|
83
83
|
dsh web
|
|
84
84
|
```
|
|
85
85
|
|
|
@@ -87,4 +87,4 @@ dsh web
|
|
|
87
87
|
|
|
88
88
|
## 文档与支持
|
|
89
89
|
|
|
90
|
-
[使用指南](docs/user-guide.zh.md) · [故障排查](docs/user-guide.zh.md#故障排查) · [开发与发布](docs/development.zh.md) · [发布验收](docs/reviews/release-0.2.
|
|
90
|
+
[使用指南](docs/user-guide.zh.md) · [故障排查](docs/user-guide.zh.md#故障排查) · [开发与发布](docs/development.zh.md) · [发布验收](docs/reviews/release-0.2.1-alpha.1.md) · [问题反馈](https://github.com/benz-ai-x/dsh-research-graph/issues)
|
package/lib/client.js
CHANGED
|
@@ -113,9 +113,9 @@ window.__ModuleLoader__.load({
|
|
|
113
113
|
/** Published package identity shown in the Graph header tooltip. */
|
|
114
114
|
const SESSION_GRAPH_PACKAGE_NAME = "@benz-ai-x/dsh-research-graph";
|
|
115
115
|
/** Package version from package.json at build time. */
|
|
116
|
-
const SESSION_GRAPH_VERSION = "0.2.
|
|
116
|
+
const SESSION_GRAPH_VERSION = "0.2.1-alpha.1";
|
|
117
117
|
/** Content-derived identifier for the exact local browser build. */
|
|
118
|
-
const SESSION_GRAPH_BUILD_ID = "local-
|
|
118
|
+
const SESSION_GRAPH_BUILD_ID = "local-85e7f70d";
|
|
119
119
|
/** Compact user-visible version badge. */
|
|
120
120
|
const SESSION_GRAPH_BUILD_LABEL = `Research Graph v${SESSION_GRAPH_VERSION} · ${SESSION_GRAPH_BUILD_ID}`;
|
|
121
121
|
/** Complete native-tooltip text for the version badge. */
|
|
@@ -1988,7 +1988,7 @@ var Service = class Service {
|
|
|
1988
1988
|
}
|
|
1989
1989
|
};
|
|
1990
1990
|
//#endregion
|
|
1991
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-brand@0.2.
|
|
1991
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-brand@0.2.1-alpha.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-brand/lib/index.js
|
|
1992
1992
|
/**
|
|
1993
1993
|
* Duplicate-install-safe nominal primitive helpers.
|
|
1994
1994
|
*
|
|
@@ -2019,7 +2019,629 @@ function brandNumber(value) {
|
|
|
2019
2019
|
return value;
|
|
2020
2020
|
}
|
|
2021
2021
|
//#endregion
|
|
2022
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-util-values@0.2.
|
|
2022
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-util-values@0.2.1-alpha.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-util-values/lib/index.js
|
|
2023
|
+
/**
|
|
2024
|
+
* Lazily scanned view of one JSON object's top-level fields, built from text
|
|
2025
|
+
* that may still be streaming or from an already parsed object. Nothing is
|
|
2026
|
+
* scanned until a reader asks; the view remembers every question it answered
|
|
2027
|
+
* and reports changed answers when the owner refreshes for publication.
|
|
2028
|
+
* Used for model tool-call arguments: a row reads the fields it
|
|
2029
|
+
* cares about at whatever granularity it displays, at every stage of the call.
|
|
2030
|
+
* @module @deepseek-ai/dsh-util-values/src/partial-json
|
|
2031
|
+
*/
|
|
2032
|
+
const SIMPLE_ESCAPES = {
|
|
2033
|
+
"\"": "\"",
|
|
2034
|
+
"\\": "\\",
|
|
2035
|
+
"/": "/",
|
|
2036
|
+
b: "\b",
|
|
2037
|
+
f: "\f",
|
|
2038
|
+
n: "\n",
|
|
2039
|
+
r: "\r",
|
|
2040
|
+
t: " "
|
|
2041
|
+
};
|
|
2042
|
+
const CONTENT_ESCAPE = /[\\\u0000-\u001f]/u;
|
|
2043
|
+
function isWhitespace(c) {
|
|
2044
|
+
return c === " " || c === "\n" || c === "\r" || c === " ";
|
|
2045
|
+
}
|
|
2046
|
+
function isHex(c) {
|
|
2047
|
+
return c >= "0" && c <= "9" || c >= "a" && c <= "f" || c >= "A" && c <= "F";
|
|
2048
|
+
}
|
|
2049
|
+
(class PartialArguments {
|
|
2050
|
+
/** The view of a call with no arguments available. */
|
|
2051
|
+
static EMPTY = PartialArguments.fromObject({});
|
|
2052
|
+
/**
|
|
2053
|
+
* View finished argument text without scanning it until a reader asks.
|
|
2054
|
+
* @param text - the complete argument JSON text.
|
|
2055
|
+
* @returns a sealed view.
|
|
2056
|
+
*/
|
|
2057
|
+
static fromText(text) {
|
|
2058
|
+
const view = new PartialArguments();
|
|
2059
|
+
view.append(text);
|
|
2060
|
+
view.sealed = true;
|
|
2061
|
+
return view;
|
|
2062
|
+
}
|
|
2063
|
+
/**
|
|
2064
|
+
* View an already parsed argument payload, such as a PTC dispatch object.
|
|
2065
|
+
* @param value - the parsed argument value.
|
|
2066
|
+
* @returns a sealed view; a non-object payload has no fields.
|
|
2067
|
+
*/
|
|
2068
|
+
static fromObject(value) {
|
|
2069
|
+
const view = new PartialArguments();
|
|
2070
|
+
view.object = typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
|
|
2071
|
+
view.sealed = true;
|
|
2072
|
+
return view;
|
|
2073
|
+
}
|
|
2074
|
+
/**
|
|
2075
|
+
* The source: text so far or a parsed object, plus whether it can still grow.
|
|
2076
|
+
* These are the only enumerable fields, so two views over the same source
|
|
2077
|
+
* compare equal structurally however far each has been read.
|
|
2078
|
+
*/
|
|
2079
|
+
chunks = [];
|
|
2080
|
+
object;
|
|
2081
|
+
sealed = false;
|
|
2082
|
+
#ends = [];
|
|
2083
|
+
#size = 0;
|
|
2084
|
+
#consumed = 0;
|
|
2085
|
+
#mode = "root";
|
|
2086
|
+
#escape = false;
|
|
2087
|
+
#keyStart = 0;
|
|
2088
|
+
#keyEscaped = false;
|
|
2089
|
+
#key = "";
|
|
2090
|
+
#current = null;
|
|
2091
|
+
#nestedEnds = [];
|
|
2092
|
+
#nestedInString = false;
|
|
2093
|
+
#invalidAt;
|
|
2094
|
+
#invalidValue = false;
|
|
2095
|
+
#entries = /* @__PURE__ */ new Map();
|
|
2096
|
+
#order = [];
|
|
2097
|
+
#reads = /* @__PURE__ */ new Map();
|
|
2098
|
+
/** Whether this view rejects further appends; does not scan text or register reads. */
|
|
2099
|
+
get isSealed() {
|
|
2100
|
+
return this.sealed;
|
|
2101
|
+
}
|
|
2102
|
+
/** Whether indexing or a content read found invalid JSON; unread value contents are not validated. */
|
|
2103
|
+
get invalid() {
|
|
2104
|
+
this.scan();
|
|
2105
|
+
return this.#mode === "invalid" || this.#invalidValue;
|
|
2106
|
+
}
|
|
2107
|
+
/**
|
|
2108
|
+
* Retain streamed argument text without scanning or comparing observed answers.
|
|
2109
|
+
* @param fragment - the text following every fragment appended before.
|
|
2110
|
+
*/
|
|
2111
|
+
append(fragment) {
|
|
2112
|
+
if (this.sealed) throw new Error("PartialArguments: cannot append to a sealed view");
|
|
2113
|
+
if (fragment.length === 0) return;
|
|
2114
|
+
this.chunks.push(fragment);
|
|
2115
|
+
this.#size += fragment.length;
|
|
2116
|
+
this.#ends.push(this.#size);
|
|
2117
|
+
}
|
|
2118
|
+
/**
|
|
2119
|
+
* Reconcile a streamed prefix with authoritative complete text without joining the fragments.
|
|
2120
|
+
* @param text - the final argument text, which replaces missing or conflicting deltas.
|
|
2121
|
+
* @returns this view sealed with its caches retained when every character matches; otherwise a new sealed view.
|
|
2122
|
+
*/
|
|
2123
|
+
settle(text) {
|
|
2124
|
+
if (this.object !== void 0 || text.length !== this.#size) return PartialArguments.fromText(text);
|
|
2125
|
+
let offset = 0;
|
|
2126
|
+
for (const chunk of this.chunks) {
|
|
2127
|
+
if (!text.startsWith(chunk, offset)) return PartialArguments.fromText(text);
|
|
2128
|
+
offset += chunk.length;
|
|
2129
|
+
}
|
|
2130
|
+
this.chunks = text.length === 0 ? [] : [text];
|
|
2131
|
+
this.#ends = text.length === 0 ? [] : [text.length];
|
|
2132
|
+
this.sealed = true;
|
|
2133
|
+
return this;
|
|
2134
|
+
}
|
|
2135
|
+
/**
|
|
2136
|
+
* Compare observed answers and advance their publication baseline. Unread views remain unscanned.
|
|
2137
|
+
* @returns whether any observed answer changed since its first read or the preceding refresh.
|
|
2138
|
+
*/
|
|
2139
|
+
refresh() {
|
|
2140
|
+
if (this.#reads.size === 0) return false;
|
|
2141
|
+
this.scan();
|
|
2142
|
+
let changed = false;
|
|
2143
|
+
let completions = false;
|
|
2144
|
+
for (const read of this.#reads.values()) {
|
|
2145
|
+
if (read.completion) {
|
|
2146
|
+
completions = true;
|
|
2147
|
+
continue;
|
|
2148
|
+
}
|
|
2149
|
+
changed = this.refreshRead(read) || changed;
|
|
2150
|
+
}
|
|
2151
|
+
if (completions) {
|
|
2152
|
+
for (const read of this.#reads.values()) if (read.completion) changed = this.refreshRead(read) || changed;
|
|
2153
|
+
}
|
|
2154
|
+
if (this.sealed) this.#reads.clear();
|
|
2155
|
+
return changed;
|
|
2156
|
+
}
|
|
2157
|
+
refreshRead(read) {
|
|
2158
|
+
const now = read.answer();
|
|
2159
|
+
if (Object.is(now, read.last)) return false;
|
|
2160
|
+
read.last = now;
|
|
2161
|
+
return true;
|
|
2162
|
+
}
|
|
2163
|
+
/**
|
|
2164
|
+
* Check whether no further fields can arrive.
|
|
2165
|
+
* @returns whether the outer object closed, indexing failed, or the view is sealed; unread values are not validated.
|
|
2166
|
+
*/
|
|
2167
|
+
closed() {
|
|
2168
|
+
return this.remember("closed", "", () => this.closedNow());
|
|
2169
|
+
}
|
|
2170
|
+
/**
|
|
2171
|
+
* List discovered fields in first-appearance order.
|
|
2172
|
+
* @returns top-level keys seen so far, in first-appearance order.
|
|
2173
|
+
*/
|
|
2174
|
+
keys() {
|
|
2175
|
+
return this.remember("keys", "", () => this.keysNow(), (keys) => keys.length);
|
|
2176
|
+
}
|
|
2177
|
+
/**
|
|
2178
|
+
* Check whether a top-level field has appeared.
|
|
2179
|
+
* @param key - argument name.
|
|
2180
|
+
* @returns whether the field has appeared (a string opened or another value began).
|
|
2181
|
+
*/
|
|
2182
|
+
has(key) {
|
|
2183
|
+
return this.remember("has", key, () => this.hasNow(key));
|
|
2184
|
+
}
|
|
2185
|
+
/**
|
|
2186
|
+
* Check whether a field's closing delimiter has arrived, without validating its contents.
|
|
2187
|
+
* @param key - argument name.
|
|
2188
|
+
* @returns whether its delimiter arrived and no content reader has reported an error for this value.
|
|
2189
|
+
*/
|
|
2190
|
+
complete(key) {
|
|
2191
|
+
return this.remember("complete", key, () => this.completeNow(key));
|
|
2192
|
+
}
|
|
2193
|
+
/**
|
|
2194
|
+
* Read string length without materializing its text.
|
|
2195
|
+
* @param key - argument name.
|
|
2196
|
+
* @param options - change granularity for a streaming string.
|
|
2197
|
+
* @returns decoded UTF-16 length of the string field so far; undefined when absent or not a string.
|
|
2198
|
+
*/
|
|
2199
|
+
stringLength(key, options) {
|
|
2200
|
+
const step = Math.max(1, Math.floor(options?.step ?? 1));
|
|
2201
|
+
const offset = options?.offset ?? 0;
|
|
2202
|
+
return this.remember(`length:${step}:${offset}`, key, () => this.lengthNow(key), (length) => length === void 0 ? void 0 : Math.ceil((length + offset) / step));
|
|
2203
|
+
}
|
|
2204
|
+
/**
|
|
2205
|
+
* Check a string against a decoded UTF-16 length limit without materializing it.
|
|
2206
|
+
* @param key - argument name.
|
|
2207
|
+
* @param maxLength - decoded UTF-16 limit, floored to at least zero.
|
|
2208
|
+
* @returns whether the string is longer than the limit; false when absent or not a string.
|
|
2209
|
+
*/
|
|
2210
|
+
stringExceeds(key, maxLength) {
|
|
2211
|
+
const limit = Math.max(0, Math.floor(maxLength));
|
|
2212
|
+
return this.remember(`exceeds:${limit}`, key, () => (this.lengthNow(key, limit + 1) ?? 0) > limit);
|
|
2213
|
+
}
|
|
2214
|
+
/**
|
|
2215
|
+
* Read a decoded string, including a streaming prefix.
|
|
2216
|
+
* @param key - argument name.
|
|
2217
|
+
* @returns the string field's decoded text so far; undefined when absent or not a string.
|
|
2218
|
+
*/
|
|
2219
|
+
text(key) {
|
|
2220
|
+
return this.remember("text", key, () => this.textNow(key));
|
|
2221
|
+
}
|
|
2222
|
+
/**
|
|
2223
|
+
* Read at most the first decoded UTF-16 units of a string.
|
|
2224
|
+
* @param key - argument name.
|
|
2225
|
+
* @param maxLength - maximum decoded UTF-16 length, floored to at least one.
|
|
2226
|
+
* @returns the bounded string prefix; undefined when absent or not a string.
|
|
2227
|
+
*/
|
|
2228
|
+
textPrefix(key, maxLength) {
|
|
2229
|
+
const limit = Math.max(1, Math.floor(maxLength));
|
|
2230
|
+
return this.remember(`prefix:${limit}`, key, () => this.textPrefixNow(key, limit));
|
|
2231
|
+
}
|
|
2232
|
+
/**
|
|
2233
|
+
* Read a completed non-string argument.
|
|
2234
|
+
* @param key - argument name.
|
|
2235
|
+
* @returns the parsed non-string value once it closed; undefined while open, absent, or a string.
|
|
2236
|
+
*/
|
|
2237
|
+
value(key) {
|
|
2238
|
+
return this.remember("value", key, () => this.valueNow(key));
|
|
2239
|
+
}
|
|
2240
|
+
/** Answer a question and, on a streaming view, remember it for change detection. */
|
|
2241
|
+
remember(kind, key, read, comparison) {
|
|
2242
|
+
this.scan();
|
|
2243
|
+
const result = read();
|
|
2244
|
+
if (!this.sealed) {
|
|
2245
|
+
const id = `${kind}/${key}`;
|
|
2246
|
+
if (!this.#reads.has(id)) this.#reads.set(id, {
|
|
2247
|
+
completion: kind === "complete",
|
|
2248
|
+
answer: comparison === void 0 ? read : () => comparison(read()),
|
|
2249
|
+
last: comparison === void 0 ? result : comparison(result)
|
|
2250
|
+
});
|
|
2251
|
+
}
|
|
2252
|
+
return result;
|
|
2253
|
+
}
|
|
2254
|
+
closedNow() {
|
|
2255
|
+
return this.sealed || this.#mode === "closed" || this.#mode === "invalid";
|
|
2256
|
+
}
|
|
2257
|
+
keysNow() {
|
|
2258
|
+
return this.object === void 0 ? this.#order : Object.keys(this.object);
|
|
2259
|
+
}
|
|
2260
|
+
hasNow(key) {
|
|
2261
|
+
return this.object === void 0 ? this.#entries.has(key) : Object.hasOwn(this.object, key);
|
|
2262
|
+
}
|
|
2263
|
+
completeNow(key) {
|
|
2264
|
+
if (this.object !== void 0) return Object.hasOwn(this.object, key);
|
|
2265
|
+
const entry = this.#entries.get(key);
|
|
2266
|
+
return entry !== void 0 && entry.end >= 0 && (entry.kind === "string" ? entry.invalidAt === void 0 : !entry.invalid);
|
|
2267
|
+
}
|
|
2268
|
+
lengthNow(key, limit = Number.POSITIVE_INFINITY) {
|
|
2269
|
+
if (this.object !== void 0) {
|
|
2270
|
+
const field = Object.hasOwn(this.object, key) ? this.object[key] : void 0;
|
|
2271
|
+
return typeof field === "string" ? field.length : void 0;
|
|
2272
|
+
}
|
|
2273
|
+
const entry = this.#entries.get(key);
|
|
2274
|
+
if (entry?.kind !== "string") return void 0;
|
|
2275
|
+
if (entry.text !== void 0 && entry.text.at === entry.end) return entry.text.length;
|
|
2276
|
+
const read = entry.length ??= {
|
|
2277
|
+
at: entry.start,
|
|
2278
|
+
length: 0,
|
|
2279
|
+
text: ""
|
|
2280
|
+
};
|
|
2281
|
+
this.readString(entry, read, limit, false);
|
|
2282
|
+
return read.length;
|
|
2283
|
+
}
|
|
2284
|
+
textNow(key) {
|
|
2285
|
+
if (this.object !== void 0) {
|
|
2286
|
+
const field = Object.hasOwn(this.object, key) ? this.object[key] : void 0;
|
|
2287
|
+
return typeof field === "string" ? field : void 0;
|
|
2288
|
+
}
|
|
2289
|
+
const entry = this.#entries.get(key);
|
|
2290
|
+
if (entry?.kind !== "string") return void 0;
|
|
2291
|
+
if (entry.text === void 0 && entry.end >= 0 && entry.needsDecoding && entry.invalidAt === void 0) {
|
|
2292
|
+
let text;
|
|
2293
|
+
try {
|
|
2294
|
+
text = JSON.parse(`"${this.slice(entry.start, entry.end)}"`);
|
|
2295
|
+
} catch (_error) {}
|
|
2296
|
+
if (text !== void 0) entry.text = {
|
|
2297
|
+
at: entry.end,
|
|
2298
|
+
length: text.length,
|
|
2299
|
+
text
|
|
2300
|
+
};
|
|
2301
|
+
}
|
|
2302
|
+
const read = entry.text ??= {
|
|
2303
|
+
at: entry.start,
|
|
2304
|
+
length: 0,
|
|
2305
|
+
text: ""
|
|
2306
|
+
};
|
|
2307
|
+
this.readString(entry, read, Number.POSITIVE_INFINITY, true);
|
|
2308
|
+
return read.text;
|
|
2309
|
+
}
|
|
2310
|
+
textPrefixNow(key, maxLength) {
|
|
2311
|
+
if (this.object !== void 0) {
|
|
2312
|
+
const field = Object.hasOwn(this.object, key) ? this.object[key] : void 0;
|
|
2313
|
+
return typeof field === "string" ? field.slice(0, maxLength) : void 0;
|
|
2314
|
+
}
|
|
2315
|
+
const entry = this.#entries.get(key);
|
|
2316
|
+
if (entry?.kind !== "string") return void 0;
|
|
2317
|
+
const prefixes = entry.prefixes ??= /* @__PURE__ */ new Map();
|
|
2318
|
+
let read = prefixes.get(maxLength);
|
|
2319
|
+
if (read === void 0) {
|
|
2320
|
+
read = {
|
|
2321
|
+
at: entry.start,
|
|
2322
|
+
length: 0,
|
|
2323
|
+
text: ""
|
|
2324
|
+
};
|
|
2325
|
+
prefixes.set(maxLength, read);
|
|
2326
|
+
}
|
|
2327
|
+
this.readString(entry, read, maxLength, true);
|
|
2328
|
+
return read.text;
|
|
2329
|
+
}
|
|
2330
|
+
valueNow(key) {
|
|
2331
|
+
if (this.object !== void 0) {
|
|
2332
|
+
if (!Object.hasOwn(this.object, key)) return void 0;
|
|
2333
|
+
const field = this.object[key];
|
|
2334
|
+
return typeof field === "string" ? void 0 : field;
|
|
2335
|
+
}
|
|
2336
|
+
const entry = this.#entries.get(key);
|
|
2337
|
+
if (entry?.kind !== "value" || entry.end < 0 || entry.invalid) return void 0;
|
|
2338
|
+
if (entry.parsed === void 0) try {
|
|
2339
|
+
entry.parsed = JSON.parse(this.slice(entry.start, entry.end));
|
|
2340
|
+
} catch (_error) {
|
|
2341
|
+
entry.invalid = true;
|
|
2342
|
+
this.#invalidValue = true;
|
|
2343
|
+
}
|
|
2344
|
+
return entry.parsed;
|
|
2345
|
+
}
|
|
2346
|
+
chunkAt(at) {
|
|
2347
|
+
let low = 0;
|
|
2348
|
+
let high = this.#ends.length;
|
|
2349
|
+
while (low < high) {
|
|
2350
|
+
const mid = low + high >>> 1;
|
|
2351
|
+
if (this.#ends[mid] <= at) low = mid + 1;
|
|
2352
|
+
else high = mid;
|
|
2353
|
+
}
|
|
2354
|
+
return low;
|
|
2355
|
+
}
|
|
2356
|
+
/** Materialize only a requested range, never the cumulative source. */
|
|
2357
|
+
slice(start, end) {
|
|
2358
|
+
if (start >= end) return "";
|
|
2359
|
+
const first = this.chunkAt(start);
|
|
2360
|
+
const last = this.chunkAt(end - 1);
|
|
2361
|
+
const base = first === 0 ? 0 : this.#ends[first - 1];
|
|
2362
|
+
if (first === last) return this.chunks[first].slice(start - base, end - base);
|
|
2363
|
+
const parts = [this.chunks[first].slice(start - base)];
|
|
2364
|
+
for (let i = first + 1; i < last; i++) parts.push(this.chunks[i]);
|
|
2365
|
+
parts.push(this.chunks[last].slice(0, end - this.#ends[last - 1]));
|
|
2366
|
+
return parts.join("");
|
|
2367
|
+
}
|
|
2368
|
+
readString(entry, read, limit, materialize) {
|
|
2369
|
+
const end = Math.min(entry.end < 0 ? this.#consumed : entry.end, entry.invalidAt ?? Number.POSITIVE_INFINITY, this.#invalidAt ?? Number.POSITIVE_INFINITY);
|
|
2370
|
+
if (!entry.needsDecoding) {
|
|
2371
|
+
const length = Math.min(end - read.at, limit - read.length);
|
|
2372
|
+
if (length <= 0) return;
|
|
2373
|
+
if (materialize) read.text += this.slice(read.at, read.at + length);
|
|
2374
|
+
read.at += length;
|
|
2375
|
+
read.length += length;
|
|
2376
|
+
return;
|
|
2377
|
+
}
|
|
2378
|
+
let chunkIndex = this.chunkAt(read.at);
|
|
2379
|
+
while (read.at < end && read.length < limit) {
|
|
2380
|
+
const base = chunkIndex === 0 ? 0 : this.#ends[chunkIndex - 1];
|
|
2381
|
+
const chunk = this.chunks[chunkIndex];
|
|
2382
|
+
const remaining = chunk.slice(read.at - base, Math.min(chunk.length, end - base));
|
|
2383
|
+
const boundary = remaining.search(CONTENT_ESCAPE);
|
|
2384
|
+
const length = Math.min(boundary < 0 ? remaining.length : boundary, limit - read.length);
|
|
2385
|
+
if (length > 0) {
|
|
2386
|
+
if (materialize) read.text += remaining.slice(0, length);
|
|
2387
|
+
read.at += length;
|
|
2388
|
+
read.length += length;
|
|
2389
|
+
if (read.at === base + chunk.length) chunkIndex++;
|
|
2390
|
+
continue;
|
|
2391
|
+
}
|
|
2392
|
+
const type = remaining.length > 1 ? remaining[1] : read.at + 1 < end ? this.chunks[chunkIndex + 1][0] : void 0;
|
|
2393
|
+
let decoded;
|
|
2394
|
+
let width = 2;
|
|
2395
|
+
if (remaining[0] === "\\" && type === void 0 && entry.end < 0) return;
|
|
2396
|
+
if (remaining[0] === "\\" && type === "u") {
|
|
2397
|
+
const hex = this.slice(read.at + 2, Math.min(end, read.at + 6));
|
|
2398
|
+
let valid = true;
|
|
2399
|
+
for (let i = 0; i < hex.length; i++) if (!isHex(hex[i])) valid = false;
|
|
2400
|
+
if (valid) {
|
|
2401
|
+
if (hex.length < 4 && entry.end < 0) return;
|
|
2402
|
+
if (hex.length === 4) decoded = String.fromCharCode(Number.parseInt(hex, 16));
|
|
2403
|
+
}
|
|
2404
|
+
width = 6;
|
|
2405
|
+
} else if (remaining[0] === "\\" && type !== void 0) decoded = SIMPLE_ESCAPES[type];
|
|
2406
|
+
if (decoded === void 0) {
|
|
2407
|
+
entry.invalidAt = read.at;
|
|
2408
|
+
this.#invalidValue = true;
|
|
2409
|
+
return;
|
|
2410
|
+
}
|
|
2411
|
+
if (materialize) read.text += decoded;
|
|
2412
|
+
read.length++;
|
|
2413
|
+
read.at += width;
|
|
2414
|
+
while (chunkIndex < this.chunks.length && read.at >= this.#ends[chunkIndex]) chunkIndex++;
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
/** Locate new field ranges without decoding or parsing their contents. */
|
|
2418
|
+
scan() {
|
|
2419
|
+
if (this.object !== void 0 || this.#consumed === this.#size) return;
|
|
2420
|
+
for (let i = this.chunkAt(this.#consumed); i < this.chunks.length && this.#invalidAt === void 0; i++) {
|
|
2421
|
+
const pending = this.chunks[i];
|
|
2422
|
+
const base = i === 0 ? 0 : this.#ends[i - 1];
|
|
2423
|
+
for (let index = this.#consumed - base; index < pending.length && this.#mode !== "invalid"; index++) {
|
|
2424
|
+
if (this.#mode === "string" || this.#mode === "nested" && this.#nestedInString) {
|
|
2425
|
+
const end = this.stringBoundary(pending, index);
|
|
2426
|
+
this.#consumed += end - index;
|
|
2427
|
+
index = end;
|
|
2428
|
+
if (index === pending.length) break;
|
|
2429
|
+
}
|
|
2430
|
+
this.step(pending[index], this.#consumed);
|
|
2431
|
+
this.#consumed++;
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
/** Only raw quotes and their preceding backslash runs can terminate a string. */
|
|
2436
|
+
stringBoundary(fragment, start) {
|
|
2437
|
+
let at = start;
|
|
2438
|
+
while (true) {
|
|
2439
|
+
const quote = fragment.indexOf("\"", at);
|
|
2440
|
+
const end = quote < 0 ? fragment.length : quote;
|
|
2441
|
+
if (this.#mode === "string") {
|
|
2442
|
+
const entry = this.#current;
|
|
2443
|
+
if (!entry.needsDecoding && CONTENT_ESCAPE.test(fragment.slice(at, end))) entry.needsDecoding = true;
|
|
2444
|
+
}
|
|
2445
|
+
let slashStart = end;
|
|
2446
|
+
while (slashStart > at && fragment[slashStart - 1] === "\\") slashStart--;
|
|
2447
|
+
const escaped = (end - slashStart) % 2 === 1 !== (slashStart === at && this.#escape);
|
|
2448
|
+
this.#escape = quote < 0 && escaped;
|
|
2449
|
+
if (quote < 0 || !escaped) return end;
|
|
2450
|
+
at = quote + 1;
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
step(c, at) {
|
|
2454
|
+
switch (this.#mode) {
|
|
2455
|
+
case "root":
|
|
2456
|
+
if (isWhitespace(c)) return;
|
|
2457
|
+
if (c === "{") {
|
|
2458
|
+
this.#mode = "key-or-end";
|
|
2459
|
+
return;
|
|
2460
|
+
}
|
|
2461
|
+
this.fail();
|
|
2462
|
+
return;
|
|
2463
|
+
case "key-or-end":
|
|
2464
|
+
if (isWhitespace(c)) return;
|
|
2465
|
+
if (c === "}") {
|
|
2466
|
+
this.#mode = "closed";
|
|
2467
|
+
return;
|
|
2468
|
+
}
|
|
2469
|
+
if (c === "\"") {
|
|
2470
|
+
this.beginKey(at);
|
|
2471
|
+
return;
|
|
2472
|
+
}
|
|
2473
|
+
this.fail();
|
|
2474
|
+
return;
|
|
2475
|
+
case "key-only":
|
|
2476
|
+
if (isWhitespace(c)) return;
|
|
2477
|
+
if (c === "\"") {
|
|
2478
|
+
this.beginKey(at);
|
|
2479
|
+
return;
|
|
2480
|
+
}
|
|
2481
|
+
this.fail();
|
|
2482
|
+
return;
|
|
2483
|
+
case "key":
|
|
2484
|
+
this.stepKey(c, at);
|
|
2485
|
+
return;
|
|
2486
|
+
case "colon":
|
|
2487
|
+
if (isWhitespace(c)) return;
|
|
2488
|
+
if (c === ":") {
|
|
2489
|
+
this.#mode = "value";
|
|
2490
|
+
return;
|
|
2491
|
+
}
|
|
2492
|
+
this.fail();
|
|
2493
|
+
return;
|
|
2494
|
+
case "value":
|
|
2495
|
+
this.beginValue(c, at);
|
|
2496
|
+
return;
|
|
2497
|
+
case "string": {
|
|
2498
|
+
const entry = this.#current;
|
|
2499
|
+
entry.end = at;
|
|
2500
|
+
this.#current = null;
|
|
2501
|
+
this.#mode = "comma-or-end";
|
|
2502
|
+
return;
|
|
2503
|
+
}
|
|
2504
|
+
case "scalar":
|
|
2505
|
+
this.stepScalar(c, at);
|
|
2506
|
+
return;
|
|
2507
|
+
case "nested":
|
|
2508
|
+
this.stepNested(c, at);
|
|
2509
|
+
return;
|
|
2510
|
+
case "comma-or-end":
|
|
2511
|
+
if (isWhitespace(c)) return;
|
|
2512
|
+
if (c === ",") {
|
|
2513
|
+
this.#mode = "key-only";
|
|
2514
|
+
return;
|
|
2515
|
+
}
|
|
2516
|
+
if (c === "}") {
|
|
2517
|
+
this.#mode = "closed";
|
|
2518
|
+
return;
|
|
2519
|
+
}
|
|
2520
|
+
this.fail();
|
|
2521
|
+
return;
|
|
2522
|
+
case "closed":
|
|
2523
|
+
if (isWhitespace(c)) return;
|
|
2524
|
+
this.fail();
|
|
2525
|
+
return;
|
|
2526
|
+
/* v8 ignore next 2 -- scan() stops stepping once the view is invalid. */
|
|
2527
|
+
case "invalid": return;
|
|
2528
|
+
/* v8 ignore next 2 -- Every scanner mode has a handler above. */
|
|
2529
|
+
default: assertNever(this.#mode);
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
fail() {
|
|
2533
|
+
this.#invalidAt = this.#consumed;
|
|
2534
|
+
this.#mode = "invalid";
|
|
2535
|
+
this.#current = null;
|
|
2536
|
+
}
|
|
2537
|
+
beginKey(at) {
|
|
2538
|
+
this.#mode = "key";
|
|
2539
|
+
this.#keyStart = at + 1;
|
|
2540
|
+
this.#keyEscaped = false;
|
|
2541
|
+
this.#escape = false;
|
|
2542
|
+
}
|
|
2543
|
+
stepKey(c, at) {
|
|
2544
|
+
if (c < " ") {
|
|
2545
|
+
this.fail();
|
|
2546
|
+
return;
|
|
2547
|
+
}
|
|
2548
|
+
if (this.#escape) {
|
|
2549
|
+
this.#escape = false;
|
|
2550
|
+
return;
|
|
2551
|
+
}
|
|
2552
|
+
if (c === "\\") {
|
|
2553
|
+
this.#escape = true;
|
|
2554
|
+
this.#keyEscaped = true;
|
|
2555
|
+
return;
|
|
2556
|
+
}
|
|
2557
|
+
if (c !== "\"") return;
|
|
2558
|
+
const raw = this.slice(this.#keyStart, at);
|
|
2559
|
+
if (this.#keyEscaped) try {
|
|
2560
|
+
this.#key = JSON.parse(`"${raw}"`);
|
|
2561
|
+
} catch (_error) {
|
|
2562
|
+
this.fail();
|
|
2563
|
+
return;
|
|
2564
|
+
}
|
|
2565
|
+
else this.#key = raw;
|
|
2566
|
+
this.#mode = "colon";
|
|
2567
|
+
}
|
|
2568
|
+
open(entry) {
|
|
2569
|
+
if (!this.#entries.has(this.#key)) this.#order.push(this.#key);
|
|
2570
|
+
this.#entries.set(this.#key, entry);
|
|
2571
|
+
this.#current = entry;
|
|
2572
|
+
}
|
|
2573
|
+
beginValue(c, at) {
|
|
2574
|
+
if (isWhitespace(c)) return;
|
|
2575
|
+
if (c === "\"") {
|
|
2576
|
+
this.open({
|
|
2577
|
+
kind: "string",
|
|
2578
|
+
start: at + 1,
|
|
2579
|
+
end: -1,
|
|
2580
|
+
needsDecoding: false,
|
|
2581
|
+
invalidAt: void 0,
|
|
2582
|
+
length: void 0,
|
|
2583
|
+
text: void 0,
|
|
2584
|
+
prefixes: void 0
|
|
2585
|
+
});
|
|
2586
|
+
this.#escape = false;
|
|
2587
|
+
this.#mode = "string";
|
|
2588
|
+
return;
|
|
2589
|
+
}
|
|
2590
|
+
if (c === "}" || c === "," || c === ":" || c === "]") {
|
|
2591
|
+
this.fail();
|
|
2592
|
+
return;
|
|
2593
|
+
}
|
|
2594
|
+
this.open({
|
|
2595
|
+
kind: "value",
|
|
2596
|
+
start: at,
|
|
2597
|
+
end: -1,
|
|
2598
|
+
parsed: void 0,
|
|
2599
|
+
invalid: false
|
|
2600
|
+
});
|
|
2601
|
+
if (c === "{" || c === "[") {
|
|
2602
|
+
this.#mode = "nested";
|
|
2603
|
+
this.#nestedEnds = [c === "{" ? "}" : "]"];
|
|
2604
|
+
this.#nestedInString = false;
|
|
2605
|
+
this.#escape = false;
|
|
2606
|
+
return;
|
|
2607
|
+
}
|
|
2608
|
+
this.#mode = "scalar";
|
|
2609
|
+
}
|
|
2610
|
+
stepScalar(c, at) {
|
|
2611
|
+
if (c !== "," && c !== "}" && !isWhitespace(c)) return;
|
|
2612
|
+
this.closeValue(at);
|
|
2613
|
+
this.#mode = c === "," ? "key-only" : c === "}" ? "closed" : "comma-or-end";
|
|
2614
|
+
}
|
|
2615
|
+
stepNested(c, at) {
|
|
2616
|
+
if (this.#nestedInString) {
|
|
2617
|
+
this.#nestedInString = false;
|
|
2618
|
+
return;
|
|
2619
|
+
}
|
|
2620
|
+
if (c === "\"") {
|
|
2621
|
+
this.#nestedInString = true;
|
|
2622
|
+
return;
|
|
2623
|
+
}
|
|
2624
|
+
if (c === "{" || c === "[") {
|
|
2625
|
+
this.#nestedEnds.push(c === "{" ? "}" : "]");
|
|
2626
|
+
return;
|
|
2627
|
+
}
|
|
2628
|
+
if (c === "}" || c === "]") {
|
|
2629
|
+
if (this.#nestedEnds.pop() !== c) {
|
|
2630
|
+
this.fail();
|
|
2631
|
+
return;
|
|
2632
|
+
}
|
|
2633
|
+
if (this.#nestedEnds.length === 0) {
|
|
2634
|
+
this.closeValue(at + 1);
|
|
2635
|
+
this.#mode = "comma-or-end";
|
|
2636
|
+
}
|
|
2637
|
+
}
|
|
2638
|
+
}
|
|
2639
|
+
closeValue(end) {
|
|
2640
|
+
const entry = this.#current;
|
|
2641
|
+
entry.end = end;
|
|
2642
|
+
this.#current = null;
|
|
2643
|
+
}
|
|
2644
|
+
});
|
|
2023
2645
|
/** Duplicate-install-safe JSON and immutable-value helpers. @module @deepseek-ai/dsh-util-values */
|
|
2024
2646
|
/**
|
|
2025
2647
|
* Mark an unreachable closed-union branch.
|
|
@@ -2250,7 +2872,7 @@ function deepFreeze(value) {
|
|
|
2250
2872
|
return value;
|
|
2251
2873
|
}
|
|
2252
2874
|
//#endregion
|
|
2253
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-typert-protocol@0.2.
|
|
2875
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-typert-protocol@0.2.1-alpha.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-typert-protocol/lib/index.js
|
|
2254
2876
|
/** The one Remote failure class shared by owners, the Gateway, and consumers. */
|
|
2255
2877
|
/**
|
|
2256
2878
|
* One Remote call failure: a real Error carrying its stable code and typed
|
|
@@ -2410,7 +3032,7 @@ function validateName(subject, value) {
|
|
|
2410
3032
|
if (!isTypertRemoteSegment(value)) throw new TypeError(`typert-protocol: ${subject} must contain only RPC endpoint segment characters`);
|
|
2411
3033
|
}
|
|
2412
3034
|
//#endregion
|
|
2413
|
-
//#region node_modules/.pnpm/@deepseek-ai+cosmokit@1.8.
|
|
3035
|
+
//#region node_modules/.pnpm/@deepseek-ai+cosmokit@1.8.6-alpha.1/node_modules/@deepseek-ai/cosmokit/lib/index.js
|
|
2414
3036
|
/** Return true when a value is `null` or `undefined`. */
|
|
2415
3037
|
function isNullable(value) {
|
|
2416
3038
|
return value === null || value === void 0;
|
|
@@ -2664,7 +3286,7 @@ var Time;
|
|
|
2664
3286
|
Time.template = template;
|
|
2665
3287
|
})(Time || (Time = {}));
|
|
2666
3288
|
//#endregion
|
|
2667
|
-
//#region node_modules/.pnpm/@deepseek-ai+schemastery@3.18.
|
|
3289
|
+
//#region node_modules/.pnpm/@deepseek-ai+schemastery@3.18.5-alpha.1/node_modules/@deepseek-ai/schemastery/lib/index.mjs
|
|
2668
3290
|
const kSchema = Symbol.for("schemastery");
|
|
2669
3291
|
const kValidationError = Symbol.for("ValidationError");
|
|
2670
3292
|
globalThis.__schemastery_index__ ??= 0;
|
|
@@ -3297,11 +3919,11 @@ defineMethod("transform", [
|
|
|
3297
3919
|
"preserve"
|
|
3298
3920
|
], ({ inner }, isInner) => inner.toString(isInner));
|
|
3299
3921
|
//#endregion
|
|
3300
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-timeout@0.2.
|
|
3922
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-timeout@0.2.1-alpha.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-timeout/lib/index.js
|
|
3301
3923
|
/** Largest delay Node schedules without clamping it to one millisecond. */
|
|
3302
3924
|
const MAX_TIMER_DELAY_MS = 2147483647;
|
|
3303
3925
|
//#endregion
|
|
3304
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-llm@0.2.
|
|
3926
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-llm@0.2.1-alpha.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-llm/lib/index.js
|
|
3305
3927
|
/**
|
|
3306
3928
|
* Detach and deep-freeze a message whose identity already exists.
|
|
3307
3929
|
* @param message - complete message, including its stable identity.
|
|
@@ -3317,7 +3939,7 @@ function freezeMessage(message) {
|
|
|
3317
3939
|
*/
|
|
3318
3940
|
/**
|
|
3319
3941
|
* Base class for all harness errors. Carries a `code` (stable, programmatic —
|
|
3320
|
-
* e.g. `NO_ADAPTER`, `INVALID_ARGS
|
|
3942
|
+
* e.g. `NO_ADAPTER`, `INVALID_ARGS`) distinct from the
|
|
3321
3943
|
* human-readable `message`, and supports `cause` chaining via the standard
|
|
3322
3944
|
* `ErrorOptions`. `name` defaults to the subclass constructor name.
|
|
3323
3945
|
*/
|
|
@@ -3730,7 +4352,7 @@ function projectToolUpdates(messages, tools, toolUpdate, history) {
|
|
|
3730
4352
|
/**
|
|
3731
4353
|
* Centralize the non-secret product identity every provider request sends as `User-Agent`, keeping
|
|
3732
4354
|
* adapters from drifting. See
|
|
3733
|
-
*
|
|
4355
|
+
* `docs/subsystems/llm-streaming.md#appidentity--app-attribution`.
|
|
3734
4356
|
*
|
|
3735
4357
|
* App-attribution vocabulary for provider requests.
|
|
3736
4358
|
* @module @deepseek-ai/dsh-llm/attribution
|
|
@@ -3996,20 +4618,14 @@ var LlmError = class extends HarnessError {
|
|
|
3996
4618
|
}
|
|
3997
4619
|
/** Notify topology observers without letting one broken listener veto the commit. */
|
|
3998
4620
|
emitAdaptersUpdated() {
|
|
3999
|
-
let invariantFailure;
|
|
4000
4621
|
for (const listener of this.ctx.events.dispatch("emit", ["llm/adapters-updated"])) try {
|
|
4001
4622
|
const returned = listener();
|
|
4002
4623
|
if (returned != null && typeof returned.then === "function") Promise.resolve(returned).then(void 0, (error) => {
|
|
4003
4624
|
this.warnAdaptersListenerFailure(error);
|
|
4004
4625
|
});
|
|
4005
4626
|
} catch (error) {
|
|
4006
|
-
if (error?.code === "INVARIANT") {
|
|
4007
|
-
invariantFailure ??= error;
|
|
4008
|
-
continue;
|
|
4009
|
-
}
|
|
4010
4627
|
this.warnAdaptersListenerFailure(error);
|
|
4011
4628
|
}
|
|
4012
|
-
if (invariantFailure !== void 0) throw invariantFailure;
|
|
4013
4629
|
}
|
|
4014
4630
|
/** Contained-listener diagnostic shared by the sync and async failure paths. */
|
|
4015
4631
|
warnAdaptersListenerFailure(error) {
|
|
@@ -4581,7 +5197,7 @@ function adapterFailureChunk(error, signal) {
|
|
|
4581
5197
|
};
|
|
4582
5198
|
}
|
|
4583
5199
|
//#endregion
|
|
4584
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-session@0.2.
|
|
5200
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-session@0.2.1-alpha.1_@deepseek-ai+cordis@4.0.2_@deepseek-ai+dsh-scope_730caf887e974df7aa78bba388173e1f/node_modules/@deepseek-ai/dsh-session/lib/index.js
|
|
4585
5201
|
/**
|
|
4586
5202
|
* Brand a string as a {@link SessionId}.
|
|
4587
5203
|
* @param id - the raw session id string.
|
|
@@ -5703,7 +6319,7 @@ var Session = class Session {
|
|
|
5703
6319
|
}
|
|
5704
6320
|
};
|
|
5705
6321
|
//#endregion
|
|
5706
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-session-format@0.2.
|
|
6322
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-session-format@0.2.1-alpha.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-session-format/lib/index.js
|
|
5707
6323
|
/** Error raised when a durable Session artifact cannot be restored or migrated losslessly. */
|
|
5708
6324
|
var SessionFormatError = class extends Error {
|
|
5709
6325
|
name = "SessionFormatError";
|
|
@@ -6155,7 +6771,7 @@ function malformed(targetVersion, error, storedVersion) {
|
|
|
6155
6771
|
});
|
|
6156
6772
|
}
|
|
6157
6773
|
//#endregion
|
|
6158
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-compaction-image-offload@0.2.
|
|
6774
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-compaction-image-offload@0.2.1-alpha.1_392e7d108234227ae1c581b9c86095b4/node_modules/@deepseek-ai/dsh-compaction-image-offload/lib/types/project-message.js
|
|
6159
6775
|
/** Immutable application of the image occurrences recorded by image/offload. */
|
|
6160
6776
|
/**
|
|
6161
6777
|
* Project selected image occurrences to immutable offloaded blocks.
|
|
@@ -6195,7 +6811,7 @@ function offloadMessageImages(message, indexes) {
|
|
|
6195
6811
|
});
|
|
6196
6812
|
}
|
|
6197
6813
|
//#endregion
|
|
6198
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-compaction-image-offload@0.2.
|
|
6814
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-compaction-image-offload@0.2.1-alpha.1_392e7d108234227ae1c581b9c86095b4/node_modules/@deepseek-ai/dsh-compaction-image-offload/lib/types/projection.js
|
|
6199
6815
|
/** Browser-safe durable image selection declaration and pure replay definition. */
|
|
6200
6816
|
/** Whether a durable value is a JSON object. */
|
|
6201
6817
|
function isRecord(value) {
|
|
@@ -6232,7 +6848,7 @@ const imageOffloadProjection = {
|
|
|
6232
6848
|
}
|
|
6233
6849
|
};
|
|
6234
6850
|
//#endregion
|
|
6235
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-session-format-v0-to-v1@0.2.
|
|
6851
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-session-format-v0-to-v1@0.2.1-alpha.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-session-format-v0-to-v1/lib/index.js
|
|
6236
6852
|
/**
|
|
6237
6853
|
* Freeze one exact released payload-member disposition for adjacent format validators.
|
|
6238
6854
|
* @param required - members that must be present.
|
|
@@ -8732,7 +9348,7 @@ function assertCurrentSurfaceSpan(surface, data, type) {
|
|
|
8732
9348
|
if (expected.length !== seqs.length || expected.some((seq, index) => seq !== seqs[index])) throw new SessionFormatError(`${type} shadowedSeqs do not name an exact current surface span`);
|
|
8733
9349
|
}
|
|
8734
9350
|
//#endregion
|
|
8735
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-session-format-v1-to-v2@0.2.
|
|
9351
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-session-format-v1-to-v2@0.2.1-alpha.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-session-format-v1-to-v2/lib/index.js
|
|
8736
9352
|
const retained = Object.fromEntries(Object.entries(RELEASED_V0_EVENT_DISPOSITIONS).filter(([type]) => type !== "assistant/chunk" && type !== "assistant/message" && type !== "session-log-deepseek/delivery-accepted" && type !== "session/end-seed"));
|
|
8737
9353
|
/** Exact top-level event and payload-member inventory frozen for released v2. */
|
|
8738
9354
|
const RELEASED_V2_EVENT_DISPOSITIONS = Object.freeze({
|
|
@@ -9556,7 +10172,7 @@ function refusal(message) {
|
|
|
9556
10172
|
return new SessionFormatUnsupportedMigrationError(message);
|
|
9557
10173
|
}
|
|
9558
10174
|
//#endregion
|
|
9559
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-session-format-v2-to-v3@0.2.
|
|
10175
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-session-format-v2-to-v3@0.2.1-alpha.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-session-format-v2-to-v3/lib/index.js
|
|
9560
10176
|
/** Audited V2 migration admission and V3 payload validation, independent of installed core Session types. */
|
|
9561
10177
|
/** Audited surface event names; all other admitted events are log-only. */
|
|
9562
10178
|
const SURFACE_TYPES$1 = /* @__PURE__ */ new Set([
|
|
@@ -10410,7 +11026,7 @@ function renameMessageSource(message) {
|
|
|
10410
11026
|
};
|
|
10411
11027
|
}
|
|
10412
11028
|
//#endregion
|
|
10413
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-session-format-v3-to-v4@0.2.
|
|
11029
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-session-format-v3-to-v4@0.2.1-alpha.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/lib/index.js
|
|
10414
11030
|
/** Released V3 plugin-source conversion and declared message traversal. */
|
|
10415
11031
|
/**
|
|
10416
11032
|
* Visit only messages carried by first-party event payloads.
|
|
@@ -11390,7 +12006,7 @@ const sessionFormatV3ToV4 = defineSessionFormatMigration({
|
|
|
11390
12006
|
validateTargetHeader: assertReleasedV4Header
|
|
11391
12007
|
});
|
|
11392
12008
|
//#endregion
|
|
11393
|
-
//#region node_modules/.pnpm/@deepseek-ai+dsh-session-format-catalog@0.2.
|
|
12009
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-session-format-catalog@0.2.1-alpha.1_392e7d108234227ae1c581b9c86095b4/node_modules/@deepseek-ai/dsh-session-format-catalog/lib/index.js
|
|
11394
12010
|
/** Pure first-party message interpreters for detached current-format replay, including browser readers. */
|
|
11395
12011
|
/** Installed interpretation definitions; recovery listeners are mounted separately by their owning plugins. */
|
|
11396
12012
|
const currentSessionMessageProjections = [imageOffloadProjection];
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"typescript",
|
|
22
22
|
"react"
|
|
23
23
|
],
|
|
24
|
-
"version": "0.2.
|
|
24
|
+
"version": "0.2.1-alpha.1",
|
|
25
25
|
"type": "module",
|
|
26
26
|
"main": "lib/index.js",
|
|
27
27
|
"types": "lib/types/index.d.ts",
|
|
@@ -34,10 +34,6 @@
|
|
|
34
34
|
"types": "./lib/types/index.d.ts",
|
|
35
35
|
"default": "./lib/index.js"
|
|
36
36
|
},
|
|
37
|
-
"./invariant": {
|
|
38
|
-
"types": "./lib/types/invariant.d.ts",
|
|
39
|
-
"default": "./lib/invariant.js"
|
|
40
|
-
},
|
|
41
37
|
"./client": {
|
|
42
38
|
"types": "./lib/types/client.d.ts",
|
|
43
39
|
"default": "./lib/client.js"
|
|
@@ -47,7 +43,6 @@
|
|
|
47
43
|
},
|
|
48
44
|
"files": [
|
|
49
45
|
"lib/index.js",
|
|
50
|
-
"lib/invariant.js",
|
|
51
46
|
"lib/client.js",
|
|
52
47
|
"lib/client.js.map",
|
|
53
48
|
"lib/types/**/*.d.ts",
|
|
@@ -94,20 +89,20 @@
|
|
|
94
89
|
}
|
|
95
90
|
},
|
|
96
91
|
"dependencies": {
|
|
97
|
-
"@deepseek-ai/dsh-typert-protocol": "0.2.
|
|
98
|
-
"@deepseek-ai/schemastery": "
|
|
92
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.1-alpha.1",
|
|
93
|
+
"@deepseek-ai/schemastery": "~3.18.5-alpha.1",
|
|
99
94
|
"clsx": "^2.1.1",
|
|
100
95
|
"zod": "4.4.3"
|
|
101
96
|
},
|
|
102
97
|
"peerDependencies": {
|
|
103
98
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
104
|
-
"@deepseek-ai/dsh-llm": "0.2.
|
|
99
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.1"
|
|
105
100
|
},
|
|
106
101
|
"devDependencies": {
|
|
107
102
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
108
|
-
"@deepseek-ai/dsh-attachment": "0.2.
|
|
109
|
-
"@deepseek-ai/dsh-llm": "0.2.
|
|
110
|
-
"@deepseek-ai/dsh-session-format-catalog": "0.2.
|
|
103
|
+
"@deepseek-ai/dsh-attachment": "0.2.1-alpha.1",
|
|
104
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.1",
|
|
105
|
+
"@deepseek-ai/dsh-session-format-catalog": "0.2.1-alpha.1",
|
|
111
106
|
"@testing-library/react": "^16.3.2",
|
|
112
107
|
"@types/node": "^22.20.0",
|
|
113
108
|
"@types/react": "~18.3.1",
|
package/lib/invariant.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//#region src/invariant.ts
|
|
2
|
-
const PACKAGE_NAME = "@benz-ai-x/dsh-research-graph";
|
|
3
|
-
/** Cordis companion plugin name. */
|
|
4
|
-
const name = "research-graph-invariant";
|
|
5
|
-
/** Service required before the companion can reserve package ownership. */
|
|
6
|
-
const inject = ["invariants"];
|
|
7
|
-
/**
|
|
8
|
-
* No additional cross-plugin event invariant. Session facts remain owned by
|
|
9
|
-
* Harness; topic records are validated and committed through its Storage
|
|
10
|
-
* Domain contract. Public Gateway and registered-view behavior specs cover
|
|
11
|
-
* topic durability, source immutability, cancellation, and effect disposal.
|
|
12
|
-
*/
|
|
13
|
-
const install = () => {};
|
|
14
|
-
/**
|
|
15
|
-
* Register this package's invariant companion.
|
|
16
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
17
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
18
|
-
*/
|
|
19
|
-
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
20
|
-
//#endregion
|
|
21
|
-
export { apply, inject, name };
|
package/lib/types/invariant.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Context } from "@deepseek-ai/cordis";
|
|
2
|
-
//#region src/invariant.d.ts
|
|
3
|
-
/** Cordis companion plugin name. */
|
|
4
|
-
declare const name = "research-graph-invariant";
|
|
5
|
-
/** Service required before the companion can reserve package ownership. */
|
|
6
|
-
declare const inject: string[];
|
|
7
|
-
/**
|
|
8
|
-
* Register this package's invariant companion.
|
|
9
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
10
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
11
|
-
*/
|
|
12
|
-
declare const apply: (ctx: Context) => Promise<() => void>;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { apply, inject, name };
|