@tbox.cn/tboxcode-dsh-bundle 0.1.0-rc.14 → 0.1.0-rc.16

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/cordis.patch.yml CHANGED
@@ -111,6 +111,9 @@
111
111
  name: '@tbox.cn/tboxcode-dsh-bundle/convergence'
112
112
  - id: tboxcode-remote
113
113
  name: '@tbox.cn/tboxcode-dsh-bundle/remote'
114
+ # ── 图片 URL 来源(抓取 → 归一化 → 出处记录;自读 image_url 域,零 config)──
115
+ - id: tboxcode-image-source
116
+ name: '@tbox.cn/tboxcode-dsh-bundle/image-source'
114
117
 
115
118
  # ── persona-identity 单点化(同 id 覆盖 dsh-base system-prompt 服务行;
116
119
  # decisions:reminders-plugin-dissolution——品牌串纯静态零插值,{{model}} 退出 prompt
@@ -1,2 +1,2 @@
1
- import { a as createConvergenceCore, i as ConvergenceState, n as ConvergenceIO, o as rowsEqual, r as ConvergenceRow, t as ConvergenceCore } from "./convergence-core-C1ZtU17g.js";
1
+ import { a as createConvergenceCore, i as ConvergenceState, n as ConvergenceIO, o as rowsEqual, r as ConvergenceRow, t as ConvergenceCore } from "./convergence-core-B81Z55Bq.js";
2
2
  export { ConvergenceCore, ConvergenceIO, ConvergenceRow, ConvergenceState, createConvergenceCore, rowsEqual };
@@ -1,2 +1,2 @@
1
- import { n as inject, r as name, t as apply } from "./convergence-CvqBcQv2.js";
1
+ import { n as inject, r as name, t as apply } from "./convergence-Bb__S8RE.js";
2
2
  export { apply, inject, name };
@@ -0,0 +1,156 @@
1
+ //#region src/image-fetch.ts
2
+ const DEFAULT_IMAGE_FETCH_POLICY = {
3
+ maxBytes: 50 * 1024 * 1024,
4
+ timeoutMs: 3e4,
5
+ deadlineMs: 5e4,
6
+ maxRedirects: 3,
7
+ maxUrlLength: 8192
8
+ };
9
+ /** 声明类型的预筛白名单:这些"非 image/*"不算强否证(CDN 常态)。 */
10
+ const GENERIC_DECLARED = new Set([
11
+ "application/octet-stream",
12
+ "binary/octet-stream",
13
+ "text/plain",
14
+ ""
15
+ ]);
16
+ /**
17
+ * 按文件头判定图片类型。
18
+ * @param bytes - 响应字节(至少前 12 字节)。
19
+ * @returns 命中四种受支持格式时给出媒体类型,否则 undefined。
20
+ */
21
+ function sniffImageMediaType(bytes) {
22
+ const head = bytes.subarray(0, 12);
23
+ if (head.length >= 8 && head[0] === 137 && head[1] === 80 && head[2] === 78 && head[3] === 71 && head[4] === 13 && head[5] === 10 && head[6] === 26 && head[7] === 10) return "image/png";
24
+ if (head.length >= 3 && head[0] === 255 && head[1] === 216 && head[2] === 255) return "image/jpeg";
25
+ if (head.length >= 6 && head[0] === 71 && head[1] === 73 && head[2] === 70 && head[3] === 56) return "image/gif";
26
+ if (head.length >= 12 && head[0] === 82 && head[1] === 73 && head[2] === 70 && head[3] === 70 && head[8] === 87 && head[9] === 69 && head[10] === 66 && head[11] === 80) return "image/webp";
27
+ }
28
+ function isTimeout(error) {
29
+ return error instanceof Error && (error.name === "TimeoutError" || error.name === "AbortError");
30
+ }
31
+ /** URL 的最小合法性检查(绝对 http(s)、无凭据、长度受限)。 */
32
+ function isValidImageUrl(value, maxUrlLength) {
33
+ if (value.length === 0 || value.length > maxUrlLength) return false;
34
+ let parsed;
35
+ try {
36
+ parsed = new URL(value);
37
+ } catch {
38
+ return false;
39
+ }
40
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return false;
41
+ return parsed.username === "" && parsed.password === "";
42
+ }
43
+ /**
44
+ * 抓取一张图片。
45
+ * @param url - 绝对 http(s) URL。
46
+ * @param policy - 抓取策略。
47
+ * @param deps - 注入的 fetch(测试可给桩)与外部取消信号。
48
+ * @returns 成功给出字节与媒体类型;失败给出稳定 reason(调用方映射错误文案)。
49
+ */
50
+ async function fetchImage(url, policy, deps) {
51
+ if (!isValidImageUrl(url, policy.maxUrlLength)) return {
52
+ ok: false,
53
+ reason: "url-invalid"
54
+ };
55
+ const deadline = AbortSignal.timeout(policy.deadlineMs);
56
+ const outer = deps.signal === void 0 ? deadline : AbortSignal.any([deps.signal, deadline]);
57
+ let current = url;
58
+ for (let redirects = 0; redirects <= policy.maxRedirects; redirects += 1) {
59
+ let response;
60
+ try {
61
+ response = await deps.fetch(current, {
62
+ redirect: "manual",
63
+ signal: AbortSignal.any([outer, AbortSignal.timeout(policy.timeoutMs)]),
64
+ headers: { accept: "image/*,*/*;q=0.5" }
65
+ });
66
+ } catch (error) {
67
+ return {
68
+ ok: false,
69
+ reason: isTimeout(error) ? "timeout" : "unreachable"
70
+ };
71
+ }
72
+ if (response.status >= 300 && response.status < 400) {
73
+ const location = response.headers.get("location");
74
+ if (location === null) return {
75
+ ok: false,
76
+ reason: "url-invalid"
77
+ };
78
+ let next;
79
+ try {
80
+ next = new URL(location, current);
81
+ } catch {
82
+ return {
83
+ ok: false,
84
+ reason: "url-invalid"
85
+ };
86
+ }
87
+ if (!isValidImageUrl(next.toString(), policy.maxUrlLength)) return {
88
+ ok: false,
89
+ reason: "url-invalid"
90
+ };
91
+ current = next.toString();
92
+ continue;
93
+ }
94
+ if (!response.ok) return {
95
+ ok: false,
96
+ reason: "unreachable"
97
+ };
98
+ const declared = (response.headers.get("content-type") ?? "").split(";")[0].trim().toLowerCase();
99
+ if (!declared.startsWith("image/") && !GENERIC_DECLARED.has(declared)) return {
100
+ ok: false,
101
+ reason: "not-an-image"
102
+ };
103
+ if (response.body === null) return {
104
+ ok: false,
105
+ reason: "not-an-image"
106
+ };
107
+ const reader = response.body.getReader();
108
+ const chunks = [];
109
+ let total = 0;
110
+ try {
111
+ while (true) {
112
+ const { done, value } = await reader.read();
113
+ if (done) break;
114
+ total += value.byteLength;
115
+ if (total > policy.maxBytes) {
116
+ await reader.cancel().catch(() => void 0);
117
+ return {
118
+ ok: false,
119
+ reason: "too-large"
120
+ };
121
+ }
122
+ chunks.push(value);
123
+ }
124
+ } catch (error) {
125
+ return {
126
+ ok: false,
127
+ reason: isTimeout(error) ? "timeout" : "unreachable"
128
+ };
129
+ }
130
+ const bytes = new Uint8Array(total);
131
+ let offset = 0;
132
+ for (const chunk of chunks) {
133
+ bytes.set(chunk, offset);
134
+ offset += chunk.byteLength;
135
+ }
136
+ const mediaType = sniffImageMediaType(bytes);
137
+ if (mediaType === void 0) return {
138
+ ok: false,
139
+ reason: "not-an-image"
140
+ };
141
+ return {
142
+ ok: true,
143
+ image: {
144
+ mediaType,
145
+ data: Buffer.from(bytes).toString("base64")
146
+ }
147
+ };
148
+ }
149
+ return {
150
+ ok: false,
151
+ reason: "url-invalid"
152
+ };
153
+ }
154
+
155
+ //#endregion
156
+ export { sniffImageMediaType as i, fetchImage as n, isValidImageUrl as r, DEFAULT_IMAGE_FETCH_POLICY as t };
@@ -0,0 +1,54 @@
1
+ //#region src/image-fetch.d.ts
2
+ /**
3
+ * image-fetch —— 图片 URL 抓取策略(纯策略 + 注入 fetch,单测可离线驱动)。
4
+ *
5
+ * 安全姿态是**最小防护 + 沙箱边界**:只允许 http(s)、拒绝 userinfo、逐跳重校验
6
+ * 重定向、单请求超时与整批截止、流式字节上限;不做 DNS/IP 黑名单(dsh 与 box
7
+ * 同容器,网络边界由部署承担——决策见 note 的 Risks)。
8
+ *
9
+ * 媒体类型以 **magic 为唯一权威**:真实 CDN 常返回 application/octet-stream 或
10
+ * 错误声明,声明只用于预筛(明显不是图片的强类型早拒,省流量)与诊断。
11
+ */
12
+ /** 抓取策略(全部可被插件自读域覆盖,字节上限只允许调低)。 */
13
+ interface ImageFetchPolicy {
14
+ readonly maxBytes: number;
15
+ readonly timeoutMs: number;
16
+ readonly deadlineMs: number;
17
+ readonly maxRedirects: number;
18
+ readonly maxUrlLength: number;
19
+ }
20
+ declare const DEFAULT_IMAGE_FETCH_POLICY: ImageFetchPolicy;
21
+ type ImageFetchFailureReason = 'url-invalid' | 'unreachable' | 'timeout' | 'too-large' | 'not-an-image';
22
+ interface FetchedImage {
23
+ readonly mediaType: string;
24
+ /** 规范 base64(标准字母表、带填充)。 */
25
+ readonly data: string;
26
+ }
27
+ type ImageFetchResult = {
28
+ readonly ok: true;
29
+ readonly image: FetchedImage;
30
+ } | {
31
+ readonly ok: false;
32
+ readonly reason: ImageFetchFailureReason;
33
+ };
34
+ /**
35
+ * 按文件头判定图片类型。
36
+ * @param bytes - 响应字节(至少前 12 字节)。
37
+ * @returns 命中四种受支持格式时给出媒体类型,否则 undefined。
38
+ */
39
+ declare function sniffImageMediaType(bytes: Uint8Array): string | undefined;
40
+ /** URL 的最小合法性检查(绝对 http(s)、无凭据、长度受限)。 */
41
+ declare function isValidImageUrl(value: string, maxUrlLength: number): boolean;
42
+ /**
43
+ * 抓取一张图片。
44
+ * @param url - 绝对 http(s) URL。
45
+ * @param policy - 抓取策略。
46
+ * @param deps - 注入的 fetch(测试可给桩)与外部取消信号。
47
+ * @returns 成功给出字节与媒体类型;失败给出稳定 reason(调用方映射错误文案)。
48
+ */
49
+ declare function fetchImage(url: string, policy: ImageFetchPolicy, deps: {
50
+ readonly fetch: typeof fetch;
51
+ readonly signal?: AbortSignal;
52
+ }): Promise<ImageFetchResult>;
53
+ //#endregion
54
+ export { DEFAULT_IMAGE_FETCH_POLICY, FetchedImage, ImageFetchFailureReason, ImageFetchPolicy, ImageFetchResult, fetchImage, isValidImageUrl, sniffImageMediaType };
@@ -0,0 +1,3 @@
1
+ import { i as sniffImageMediaType, n as fetchImage, r as isValidImageUrl, t as DEFAULT_IMAGE_FETCH_POLICY } from "./image-fetch-D_8nywZV.js";
2
+
3
+ export { DEFAULT_IMAGE_FETCH_POLICY, fetchImage, isValidImageUrl, sniffImageMediaType };
@@ -0,0 +1,62 @@
1
+ import { Context, Service } from "@deepseek-ai/cordis";
2
+ import { Session } from "@deepseek-ai/dsh-session";
3
+
4
+ //#region src/image-source.d.ts
5
+ declare const name = "@tbox.cn/tboxcode-dsh-bundle/image-source";
6
+ declare const inject: string[];
7
+ /** 一张已准入的 URL 图片来源(端口面:两载体同形)。 */
8
+ interface ImageSourceAdmission {
9
+ readonly attachment: unknown;
10
+ readonly attachmentId: string;
11
+ readonly name?: string;
12
+ }
13
+ /** 附件服务最小读面(不硬依赖 dsh-attachment 类型——服务缺席即降级)。 */
14
+ interface AttachmentFace {
15
+ readonly imageLimits?: {
16
+ readonly maxImageBytes?: number;
17
+ readonly maxMessageImageBytes?: number;
18
+ };
19
+ admitPromptContent(parts: readonly unknown[]): Promise<readonly unknown[]>;
20
+ readImage?(ref: never, signal?: AbortSignal): Promise<{
21
+ readonly ref: {
22
+ readonly mediaType: string;
23
+ };
24
+ readonly data: Uint8Array;
25
+ }>;
26
+ }
27
+ /**
28
+ * 展示名裁决:客户端原始文件名优先(前端传 `fileName`),缺失/空白/超长时
29
+ * 回退 URL 末段。名称只作展示,永不参与路径解释。
30
+ */
31
+ declare function displayNameFor(url: string, provided: string | undefined): string | undefined;
32
+ declare class TboxcodeImageSource extends Service {
33
+ constructor(ctx: Context);
34
+ /** 自读域重新装载(构造 + watcher 回调;非法值告警后回落默认)。 */
35
+ syncConfig(): void;
36
+ /** 记录真实 Session 实例(注册到 session/created 与 agent/created 两路)。 */
37
+ remember(session: Session): void;
38
+ /** 附件服务读面(可选服务——缺席即降级)。 */
39
+ attachmentsFace(): AttachmentFace | undefined;
40
+ /** 字节上限恒等于附件准入上限(只可调低——"上传能过则 URL 也能过")。 */
41
+ maxImageBytes(): number;
42
+ /**
43
+ * 准入一组图片 URL(等长同序返回;内部按 URL 去重抓取与落盘)。
44
+ * @param request - 会话 id、URL 列表与取消信号。
45
+ */
46
+ admitUrls(request: {
47
+ sessionId: string;
48
+ urls: readonly string[];
49
+ /** 与 `urls` 等长同序的客户端文件名(前端原始 fileName)。 */
50
+ names?: readonly (string | undefined)[];
51
+ signal?: AbortSignal;
52
+ }): Promise<ImageSourceAdmission[]>;
53
+ /** 读一张已落盘图片(历史回显);失败返回 undefined(调用方降级占位)。 */
54
+ readImage(attachment: unknown, signal?: AbortSignal): Promise<{
55
+ mediaType: string;
56
+ data: string;
57
+ } | undefined>;
58
+ }
59
+ /** 插件入口:服务缺席才注册(重复挂载零副作用)。 */
60
+ declare function apply(ctx: Context): void;
61
+ //#endregion
62
+ export { ImageSourceAdmission, TboxcodeImageSource, apply, displayNameFor, inject, name };
@@ -0,0 +1,215 @@
1
+ import { n as fetchImage, t as DEFAULT_IMAGE_FETCH_POLICY } from "./image-fetch-D_8nywZV.js";
2
+ import { readFileSync } from "node:fs";
3
+ import { resolveConfigDir, resolveConfigPath, stripJsonc, watchConfigFiles } from "@tbox.cn/tboxcode-dsh-runtime";
4
+ import { Service } from "@deepseek-ai/cordis";
5
+ import { appendPluginRecord } from "@deepseek-ai/dsh-session";
6
+ import { IMAGE_SOURCE_RECORD } from "@tbox.cn/dsh-acp-bridge-core";
7
+
8
+ //#region src/image-source.ts
9
+ const name = "@tbox.cn/tboxcode-dsh-bundle/image-source";
10
+ const inject = ["attachments", "sessions"];
11
+ /** 抓取并发(进程级;与渲染预读同量级)。 */
12
+ const FETCH_CONCURRENCY = 4;
13
+ function positive(value, fallback) {
14
+ return typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.floor(value) : fallback;
15
+ }
16
+ /** 自读域 → 策略(未知键忽略;非法值保持默认)。 */
17
+ function policyOf(config) {
18
+ if (config === void 0) return DEFAULT_IMAGE_FETCH_POLICY;
19
+ return {
20
+ maxBytes: positive(config.max_bytes, DEFAULT_IMAGE_FETCH_POLICY.maxBytes),
21
+ timeoutMs: Math.min(positive(config.timeout_ms, DEFAULT_IMAGE_FETCH_POLICY.timeoutMs), 12e4),
22
+ deadlineMs: Math.min(positive(config.deadline_ms, DEFAULT_IMAGE_FETCH_POLICY.deadlineMs), 12e4),
23
+ maxRedirects: Math.min(positive(config.max_redirects, DEFAULT_IMAGE_FETCH_POLICY.maxRedirects), 5),
24
+ maxUrlLength: positive(config.max_url_length, DEFAULT_IMAGE_FETCH_POLICY.maxUrlLength)
25
+ };
26
+ }
27
+ /** 展示名兜底:URL pathname 末段(客户端未提供 name 时使用)。 */
28
+ function urlBasename(url) {
29
+ try {
30
+ const segment = new URL(url).pathname.split("/").filter((part) => part !== "").pop();
31
+ return segment === void 0 ? void 0 : decodeURIComponent(segment);
32
+ } catch {
33
+ return;
34
+ }
35
+ }
36
+ /**
37
+ * 展示名裁决:客户端原始文件名优先(前端传 `fileName`),缺失/空白/超长时
38
+ * 回退 URL 末段。名称只作展示,永不参与路径解释。
39
+ */
40
+ function displayNameFor(url, provided) {
41
+ const trimmed = provided?.trim();
42
+ if (trimmed !== void 0 && trimmed !== "" && trimmed.length <= 256) return trimmed;
43
+ return urlBasename(url);
44
+ }
45
+ /** 失败 reason → 面向调用方的稳定错误文案。 */
46
+ const REASON_TEXT = {
47
+ "url-invalid": "图片 URL 不是合法的 http(s) 绝对地址",
48
+ unreachable: "图片 URL 不可达(网络或状态码)",
49
+ timeout: "图片 URL 抓取超时",
50
+ "too-large": "图片超过准入字节上限",
51
+ "not-an-image": "响应不是受支持的图片(png / jpeg / webp / gif)"
52
+ };
53
+ /** 有界并发映射(保序)。 */
54
+ async function mapLimit(items, limit, fn) {
55
+ const results = new Array(items.length);
56
+ let next = 0;
57
+ const workers = Array.from({ length: Math.min(limit, items.length) }, async () => {
58
+ while (true) {
59
+ const index = next++;
60
+ if (index >= items.length) return;
61
+ results[index] = await fn(items[index]);
62
+ }
63
+ });
64
+ await Promise.all(workers);
65
+ return results;
66
+ }
67
+ function stateOf(self) {
68
+ const carrier = self;
69
+ carrier._imageSourceState ??= {
70
+ policy: DEFAULT_IMAGE_FETCH_POLICY,
71
+ sessions: /* @__PURE__ */ new Map()
72
+ };
73
+ return carrier._imageSourceState;
74
+ }
75
+ var TboxcodeImageSource = class extends Service {
76
+ constructor(ctx) {
77
+ super(ctx, "imageSources");
78
+ this.syncConfig();
79
+ if (resolveConfigPath(resolveConfigDir()) !== null) {
80
+ const watcher = watchConfigFiles(resolveConfigDir(), ["config.jsonc", "config.json"], () => this.syncConfig());
81
+ ctx.effect(() => () => watcher.dispose());
82
+ }
83
+ }
84
+ /** 自读域重新装载(构造 + watcher 回调;非法值告警后回落默认)。 */
85
+ syncConfig() {
86
+ const path = resolveConfigPath(resolveConfigDir());
87
+ if (path === null) {
88
+ stateOf(this).policy = DEFAULT_IMAGE_FETCH_POLICY;
89
+ return;
90
+ }
91
+ try {
92
+ const parsed = JSON.parse(stripJsonc(readFileSync(path, "utf8")));
93
+ stateOf(this).policy = policyOf(parsed.image_url);
94
+ } catch (error) {
95
+ console.warn("[tboxcode-image-source] image_url 配置无效,回落默认: " + String(error));
96
+ stateOf(this).policy = DEFAULT_IMAGE_FETCH_POLICY;
97
+ }
98
+ }
99
+ /** 记录真实 Session 实例(注册到 session/created 与 agent/created 两路)。 */
100
+ remember(session) {
101
+ if (typeof session?.id === "string") stateOf(this).sessions.set(session.id, session);
102
+ }
103
+ /** 附件服务读面(可选服务——缺席即降级)。 */
104
+ attachmentsFace() {
105
+ return this.ctx.get("attachments");
106
+ }
107
+ /** 字节上限恒等于附件准入上限(只可调低——"上传能过则 URL 也能过")。 */
108
+ maxImageBytes() {
109
+ const policy = stateOf(this).policy;
110
+ const limit = this.attachmentsFace()?.imageLimits?.maxImageBytes;
111
+ return typeof limit === "number" && limit > 0 ? Math.min(policy.maxBytes, limit) : policy.maxBytes;
112
+ }
113
+ /**
114
+ * 准入一组图片 URL(等长同序返回;内部按 URL 去重抓取与落盘)。
115
+ * @param request - 会话 id、URL 列表与取消信号。
116
+ */
117
+ async admitUrls(request) {
118
+ if (process.env.TBOXCODE_IMAGE_FETCH_DISABLED === "1") throw new Error("图片 URL 抓取已被部署开关禁用");
119
+ const attachments = this.attachmentsFace();
120
+ if (attachments === void 0) throw new Error("附件服务未挂载");
121
+ const session = this.ctx.sessions.get(request.sessionId);
122
+ if (session === void 0) throw new Error("会话 " + request.sessionId + " 不在内存(图片 URL 准入要求会话已激活)");
123
+ const unique = [...new Set(request.urls)];
124
+ const policy = {
125
+ ...stateOf(this).policy,
126
+ maxBytes: this.maxImageBytes()
127
+ };
128
+ const fetched = await mapLimit(unique, FETCH_CONCURRENCY, async (url) => {
129
+ const result = await fetchImage(url, policy, {
130
+ fetch: (input, init) => fetch(input, init),
131
+ ...request.signal === void 0 ? {} : { signal: request.signal }
132
+ });
133
+ if (!result.ok) throw new Error(REASON_TEXT[result.reason] + "(" + new URL(url).origin + ")");
134
+ return {
135
+ url,
136
+ image: result.image
137
+ };
138
+ });
139
+ const providedNames = /* @__PURE__ */ new Map();
140
+ if (request.names !== void 0) request.urls.forEach((url, index) => {
141
+ const provided = request.names?.[index];
142
+ if (!providedNames.has(url) || providedNames.get(url) === void 0) providedNames.set(url, provided);
143
+ });
144
+ const parts = fetched.map((entry) => {
145
+ const name$1 = displayNameFor(entry.url, providedNames.get(entry.url));
146
+ return {
147
+ type: "image",
148
+ mediaType: entry.image.mediaType,
149
+ data: entry.image.data,
150
+ ...name$1 === void 0 ? {} : { name: name$1 }
151
+ };
152
+ });
153
+ let admittedRaw;
154
+ try {
155
+ admittedRaw = await attachments.admitPromptContent(parts);
156
+ } catch (error) {
157
+ throw new Error("附件准入失败:" + (error instanceof Error ? error.message : String(error)));
158
+ }
159
+ const admitted = admittedRaw;
160
+ if (admitted.length !== fetched.length) throw new Error("附件准入返回数量与请求不一致");
161
+ const images = admitted.map((part, index) => {
162
+ const attachmentId = part.attachment?.attachmentId;
163
+ if (typeof attachmentId !== "string" || attachmentId === "") throw new Error("附件准入返回缺少 attachmentId");
164
+ return {
165
+ attachmentId,
166
+ url: fetched[index].url
167
+ };
168
+ });
169
+ try {
170
+ appendPluginRecord(session, IMAGE_SOURCE_RECORD, { images });
171
+ } catch (error) {
172
+ console.warn("[tboxcode-image-source] 出处记录写入失败(live 仍可用):" + (error instanceof Error ? error.message : String(error)));
173
+ }
174
+ const byUrl = /* @__PURE__ */ new Map();
175
+ fetched.forEach((entry, index) => {
176
+ const name$1 = displayNameFor(entry.url, providedNames.get(entry.url));
177
+ byUrl.set(entry.url, {
178
+ attachment: admitted[index].attachment,
179
+ attachmentId: images[index].attachmentId,
180
+ ...name$1 === void 0 ? {} : { name: name$1 }
181
+ });
182
+ });
183
+ return request.urls.map((url) => {
184
+ const found = byUrl.get(url);
185
+ if (found === void 0) throw new Error("图片 URL 归并失败");
186
+ return found;
187
+ });
188
+ }
189
+ /** 读一张已落盘图片(历史回显);失败返回 undefined(调用方降级占位)。 */
190
+ async readImage(attachment, signal) {
191
+ const attachments = this.attachmentsFace();
192
+ if (attachments?.readImage === void 0) return void 0;
193
+ try {
194
+ const stored = await attachments.readImage(attachment, signal);
195
+ return {
196
+ mediaType: stored.ref.mediaType,
197
+ data: Buffer.from(stored.data).toString("base64")
198
+ };
199
+ } catch {
200
+ return;
201
+ }
202
+ }
203
+ };
204
+ /** 插件入口:服务缺席才注册(重复挂载零副作用)。 */
205
+ function apply(ctx) {
206
+ if (ctx.get("imageSources") !== void 0) return;
207
+ const service = new TboxcodeImageSource(ctx);
208
+ ctx.on("session/created", ((session) => service.remember(session)));
209
+ ctx.on("agent/created", ((agent) => {
210
+ if (agent.session !== void 0) service.remember(agent.session);
211
+ }));
212
+ }
213
+
214
+ //#endregion
215
+ export { TboxcodeImageSource, apply, displayNameFor, inject, name };
package/lib/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { a as createConvergenceCore, i as ConvergenceState, n as ConvergenceIO, o as rowsEqual, r as ConvergenceRow, t as ConvergenceCore } from "./convergence-core-C1ZtU17g.js";
2
- import { r as name, t as apply } from "./convergence-CvqBcQv2.js";
3
- import { a as SweepResult, l as sweepSessions, n as RetentionKnobs, o as isOwnedHome, r as RetentionScheduler, s as startRetentionScheduler, t as DEFAULT_KNOBS } from "./retention-B2V8Plpx.js";
4
- import { C as name$1, _ as handleRetentionRun, a as TboxcodeRemoteGateway, b as handleSkillsUserInvocable, d as handleCommit, f as handleDefaultSelection, g as handleReload, h as handleMode, l as handleCommandsExecute, m as handleHealth, o as TboxcodeRemoteServices, p as handleGitPushWatch, r as GitPushEvent, u as handleCommandsList, v as handleSessionsFlush } from "./remote-BZjKKp64.js";
5
- import { a as redactTokens, i as createLogger, n as Logger, t as LogLevel } from "./logger-DcHqQwUI.js";
1
+ import { a as createConvergenceCore, i as ConvergenceState, n as ConvergenceIO, o as rowsEqual, r as ConvergenceRow, t as ConvergenceCore } from "./convergence-core-B81Z55Bq.js";
2
+ import { r as name, t as apply } from "./convergence-Bb__S8RE.js";
3
+ import { a as SweepResult, l as sweepSessions, n as RetentionKnobs, o as isOwnedHome, r as RetentionScheduler, s as startRetentionScheduler, t as DEFAULT_KNOBS } from "./retention-f1rAWNdl.js";
4
+ import { S as handleSkillsUserInvocable, T as name$1, _ as handleMode, a as TboxcodeRemoteGateway, b as handleSessionsFlush, d as handleCommit, f as handleDefaultSelection, l as handleCommandsExecute, m as handleHealth, o as TboxcodeRemoteServices, p as handleGitPushWatch, r as GitPushEvent, u as handleCommandsList, v as handleReload, y as handleRetentionRun } from "./remote--pQj9xul.js";
5
+ import { a as redactTokens, i as createLogger, n as Logger, t as LogLevel } from "./logger-BIhqLW5C.js";
6
6
 
7
7
  //#region src/index.d.ts
8
8
  /**
package/lib/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { n as rowsEqual, t as createConvergenceCore } from "./convergence-core-CbS-hTjK.js";
2
2
  import { r as name, t as apply } from "./convergence-BnrNjcuS.js";
3
- import { a as sweepSessions, n as isOwnedHome, r as startRetentionScheduler, t as DEFAULT_KNOBS } from "./retention-DNEdnIxC.js";
4
- import { n as redactTokens, t as createLogger } from "./logger-BGwLHZXY.js";
5
- import { a as handleCommandsList, c as handleGitPushWatch, d as handleReload, f as handleRetentionRun, h as handleSkillsUserInvocable, i as handleCommandsExecute, l as handleHealth, o as handleCommit, p as handleSessionsFlush, s as handleDefaultSelection, t as TboxcodeRemoteGateway, u as handleMode, v as name$1 } from "./remote-lvZ2n78k.js";
3
+ import { a as sweepSessions, n as isOwnedHome, r as startRetentionScheduler, t as DEFAULT_KNOBS } from "./retention-CVHXhi92.js";
4
+ import { n as redactTokens, t as createLogger } from "./logger-Dnz11jWP.js";
5
+ import { _ as handleSkillsUserInvocable, a as handleCommandsList, b as name$1, c as handleGitPushWatch, f as handleMode, h as handleSessionsFlush, i as handleCommandsExecute, l as handleHealth, m as handleRetentionRun, o as handleCommit, p as handleReload, s as handleDefaultSelection, t as TboxcodeRemoteGateway } from "./remote-Cr46ZKbO.js";
6
6
 
7
7
  //#region src/index.ts
8
8
  /**
package/lib/logger.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as redactTokens, i as createLogger, n as Logger, r as LoggerOptions, t as LogLevel } from "./logger-DcHqQwUI.js";
1
+ import { a as redactTokens, i as createLogger, n as Logger, r as LoggerOptions, t as LogLevel } from "./logger-BIhqLW5C.js";
2
2
  export { LogLevel, Logger, LoggerOptions, createLogger, redactTokens };
package/lib/logger.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as redactTokens, t as createLogger } from "./logger-BGwLHZXY.js";
1
+ import { n as redactTokens, t as createLogger } from "./logger-Dnz11jWP.js";
2
2
 
3
3
  export { createLogger, redactTokens };
@@ -1,8 +1,8 @@
1
- import { t as ConvergenceCore } from "./convergence-core-C1ZtU17g.js";
2
- import { a as SweepResult, r as RetentionScheduler } from "./retention-B2V8Plpx.js";
1
+ import { t as ConvergenceCore } from "./convergence-core-B81Z55Bq.js";
2
+ import { a as SweepResult, r as RetentionScheduler } from "./retention-f1rAWNdl.js";
3
+ import { Context } from "@deepseek-ai/cordis";
3
4
  import { TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
4
5
  import { AutoCommitConfig, AutoCommitOutcome } from "@tbox.cn/tboxcode-dsh-tools";
5
- import { Context } from "@deepseek-ai/cordis";
6
6
 
7
7
  //#region src/remote.d.ts
8
8
  declare module '@deepseek-ai/dsh-typert-protocol' {
@@ -17,6 +17,10 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
17
17
  readonly mode: string;
18
18
  };
19
19
  'tboxcode/attachments-unavailable': Record<string, never>;
20
+ 'tboxcode/images-unavailable': Record<string, never>;
21
+ 'tboxcode/image-unavailable': {
22
+ readonly reason?: string;
23
+ };
20
24
  }
21
25
  }
22
26
  interface RemoteAgentLike {
@@ -70,6 +74,19 @@ interface TboxcodeRemoteServices {
70
74
  attachments?: {
71
75
  admitPromptContent(input: readonly unknown[]): Promise<readonly unknown[]>;
72
76
  };
77
+ /** 图片 URL 准入面(载体二——两端口经 RPC 抵达 dsh 侧同一服务)。 */
78
+ imageSources?: {
79
+ admitUrls(request: {
80
+ sessionId: string;
81
+ urls: readonly string[];
82
+ names?: readonly (string | undefined)[];
83
+ signal?: AbortSignal;
84
+ }): Promise<readonly Record<string, unknown>[]>;
85
+ readImage(attachment: unknown, signal?: AbortSignal): Promise<{
86
+ mediaType: string;
87
+ data: string;
88
+ } | undefined>;
89
+ };
73
90
  sandbox: {
74
91
  setSandboxMode(session: unknown, mode: unknown): unknown;
75
92
  };
@@ -110,6 +127,27 @@ declare function handleAttachmentsAdmit(services: TboxcodeRemoteServices, reques
110
127
  }): Promise<{
111
128
  parts: readonly unknown[];
112
129
  }>;
130
+ /**
131
+ * 图片 URL 准入(载体二):抓取 + 归一化 + 出处记录全在 dsh 侧完成,返回与入参
132
+ * 等长同序的准入结果(attachmentId + 归一化字节)。领域失败转 RemoteError——
133
+ * sdk 侧统一映射为 invalidParams(bridge 的错误面只透传 RequestError)。
134
+ */
135
+ declare function handleImagesAdmit(services: TboxcodeRemoteServices, request: {
136
+ sessionId: string;
137
+ urls: readonly string[];
138
+ names?: readonly (string | undefined)[];
139
+ }, signal: AbortSignal): Promise<{
140
+ images: readonly Record<string, unknown>[];
141
+ }>;
142
+ /** 读一张已落盘图片(载体二历史回显);未命中返回 null(调用方降级占位)。 */
143
+ declare function handleImagesRead(services: TboxcodeRemoteServices, request: {
144
+ attachment: unknown;
145
+ }, signal: AbortSignal): Promise<{
146
+ image: {
147
+ mediaType: string;
148
+ data: string;
149
+ } | null;
150
+ }>;
113
151
  declare function handleSessionsFlush(services: TboxcodeRemoteServices, request: {
114
152
  sessionId: string;
115
153
  }): Promise<void>;
@@ -185,6 +223,21 @@ declare class TboxcodeRemoteGateway extends TypertRemoteService {
185
223
  }): Promise<{
186
224
  parts: readonly unknown[];
187
225
  }>;
226
+ imagesAdmit(request: {
227
+ sessionId: string;
228
+ urls: readonly string[];
229
+ names?: readonly (string | undefined)[];
230
+ }, signal: AbortSignal): Promise<{
231
+ images: readonly Record<string, unknown>[];
232
+ }>;
233
+ imagesRead(request: {
234
+ attachment: unknown;
235
+ }, signal: AbortSignal): Promise<{
236
+ image: {
237
+ mediaType: string;
238
+ data: string;
239
+ } | null;
240
+ }>;
188
241
  commandsList(request: {
189
242
  agentId: string;
190
243
  }): ReadonlyArray<Record<string, unknown>>;
@@ -233,4 +286,4 @@ declare class TboxcodeRemoteGateway extends TypertRemoteService {
233
286
  retentionRun(): Promise<SweepResult>;
234
287
  }
235
288
  //#endregion
236
- export { name as C, inject as S, handleRetentionRun as _, TboxcodeRemoteGateway as a, handleSkillsUserInvocable as b, handleAttachmentsAdmit as c, handleCommit as d, handleDefaultSelection as f, handleReload as g, handleMode as h, RemoteAgentLike as i, handleCommandsExecute as l, handleHealth as m, DefaultModelSelection as n, TboxcodeRemoteServices as o, handleGitPushWatch as p, GitPushEvent as r, handleAgentWatch as s, AgentWatchItem as t, handleCommandsList as u, handleSessionsFlush as v, handleSkillsWatch as x, handleSessionsStat as y };
289
+ export { handleSkillsWatch as C, handleSkillsUserInvocable as S, name as T, handleMode as _, TboxcodeRemoteGateway as a, handleSessionsFlush as b, handleAttachmentsAdmit as c, handleCommit as d, handleDefaultSelection as f, handleImagesRead as g, handleImagesAdmit as h, RemoteAgentLike as i, handleCommandsExecute as l, handleHealth as m, DefaultModelSelection as n, TboxcodeRemoteServices as o, handleGitPushWatch as p, GitPushEvent as r, handleAgentWatch as s, AgentWatchItem as t, handleCommandsList as u, handleReload as v, inject as w, handleSessionsStat as x, handleRetentionRun as y };
@@ -1,10 +1,10 @@
1
- import { n as isOwnedHome, r as startRetentionScheduler } from "./retention-DNEdnIxC.js";
2
- import { t as createLogger } from "./logger-BGwLHZXY.js";
1
+ import { n as isOwnedHome, r as startRetentionScheduler } from "./retention-CVHXhi92.js";
2
+ import { t as createLogger } from "./logger-Dnz11jWP.js";
3
3
  import { join } from "node:path";
4
+ import { translateMode } from "@tbox.cn/dsh-acp-bridge-core";
4
5
  import { homedir } from "node:os";
5
6
  import { RemoteError, TypertRemoteService, remoteMethods } from "@deepseek-ai/dsh-typert-protocol";
6
7
  import { setSandboxMode } from "@deepseek-ai/dsh-sandbox-policy";
7
- import { translateMode } from "@tbox.cn/dsh-acp-bridge-core";
8
8
  import { runAutoCommit } from "@tbox.cn/tboxcode-dsh-tools";
9
9
 
10
10
  //#region src/remote.ts
@@ -55,6 +55,41 @@ async function handleAttachmentsAdmit(services, request) {
55
55
  if (attachments === void 0) throw new RemoteError("tboxcode/attachments-unavailable", "附件服务未挂载(image prompt 拒绝)", {});
56
56
  return { parts: await attachments.admitPromptContent(request.parts) };
57
57
  }
58
+ /**
59
+ * 图片 URL 准入(载体二):抓取 + 归一化 + 出处记录全在 dsh 侧完成,返回与入参
60
+ * 等长同序的准入结果(attachmentId + 归一化字节)。领域失败转 RemoteError——
61
+ * sdk 侧统一映射为 invalidParams(bridge 的错误面只透传 RequestError)。
62
+ */
63
+ async function handleImagesAdmit(services, request, signal) {
64
+ const imageSources = services.imageSources;
65
+ if (imageSources === void 0) throw new RemoteError("tboxcode/images-unavailable", "图片 URL 服务未挂载(image/tbox_url prompt 拒绝)", {});
66
+ try {
67
+ const admitted = await imageSources.admitUrls({
68
+ sessionId: request.sessionId,
69
+ urls: request.urls,
70
+ ...request.names === void 0 ? {} : { names: request.names },
71
+ signal
72
+ });
73
+ return { images: await Promise.all(admitted.map(async (image) => {
74
+ const bytes = await imageSources.readImage(image.attachment, signal);
75
+ if (bytes === void 0) throw new RemoteError("tboxcode/image-unavailable", "图片字节读取失败(附件缺失)", {});
76
+ return {
77
+ attachmentId: image.attachmentId,
78
+ attachment: bytes,
79
+ ...image.name === void 0 ? {} : { name: image.name }
80
+ };
81
+ })) };
82
+ } catch (error) {
83
+ if (error instanceof RemoteError) throw error;
84
+ throw new RemoteError("tboxcode/image-unavailable", error instanceof Error ? error.message : String(error), {});
85
+ }
86
+ }
87
+ /** 读一张已落盘图片(载体二历史回显);未命中返回 null(调用方降级占位)。 */
88
+ async function handleImagesRead(services, request, signal) {
89
+ const imageSources = services.imageSources;
90
+ if (imageSources === void 0) throw new RemoteError("tboxcode/images-unavailable", "图片 URL 服务未挂载", {});
91
+ return { image: await imageSources.readImage(request.attachment, signal) ?? null };
92
+ }
58
93
  async function handleSessionsFlush(services, request) {
59
94
  const session = services.sessions.get(request.sessionId);
60
95
  if (session === void 0) throw new RemoteError("tboxcode/agent-not-found", `会话 ${request.sessionId} 不在内存(flush 须热会话)`, { sessionId: request.sessionId });
@@ -286,6 +321,7 @@ var TboxcodeRemoteGateway = class extends TypertRemoteService {
286
321
  agentDefaultModel: remoteCtx.agentDefaultModel,
287
322
  sessions: remoteCtx.sessions,
288
323
  ...remoteCtx.get?.("attachments") === void 0 ? {} : { attachments: remoteCtx.get("attachments") },
324
+ ...remoteCtx.get?.("imageSources") === void 0 ? {} : { imageSources: remoteCtx.get("imageSources") },
289
325
  persistence: remoteCtx.sessionPersistence ?? { stat: async () => void 0 },
290
326
  on: (event, listener) => remoteCtx.on(event, listener),
291
327
  sandbox: { setSandboxMode: (session, mode) => setSandboxMode(session, mode) },
@@ -298,6 +334,12 @@ var TboxcodeRemoteGateway = class extends TypertRemoteService {
298
334
  attachmentsAdmit(request) {
299
335
  return handleAttachmentsAdmit(stateOf(this).services, request);
300
336
  }
337
+ imagesAdmit(request, signal) {
338
+ return handleImagesAdmit(stateOf(this).services, request, signal);
339
+ }
340
+ imagesRead(request, signal) {
341
+ return handleImagesRead(stateOf(this).services, request, signal);
342
+ }
301
343
  commandsList(request) {
302
344
  return handleCommandsList(stateOf(this).services, request);
303
345
  }
@@ -351,6 +393,14 @@ const REMOTE_METHODS = [
351
393
  method: "attachmentsAdmit",
352
394
  exportName: "attachments.admit"
353
395
  },
396
+ {
397
+ method: "imagesAdmit",
398
+ exportName: "images.admit"
399
+ },
400
+ {
401
+ method: "imagesRead",
402
+ exportName: "images.read"
403
+ },
354
404
  {
355
405
  method: "commandsList",
356
406
  exportName: "commands.list"
@@ -428,4 +478,4 @@ if (markers.length !== REMOTE_METHODS.length || REMOTE_METHODS.some(({ exportNam
428
478
  var remote_default = TboxcodeRemoteGateway;
429
479
 
430
480
  //#endregion
431
- export { inject as _, handleCommandsList as a, handleGitPushWatch as c, handleReload as d, handleRetentionRun as f, handleSkillsWatch as g, handleSkillsUserInvocable as h, handleCommandsExecute as i, handleHealth as l, handleSessionsStat as m, handleAgentWatch as n, handleCommit as o, handleSessionsFlush as p, handleAttachmentsAdmit as r, handleDefaultSelection as s, TboxcodeRemoteGateway as t, handleMode as u, name as v, remote_default as y };
481
+ export { handleSkillsUserInvocable as _, handleCommandsList as a, name as b, handleGitPushWatch as c, handleImagesRead as d, handleMode as f, handleSessionsStat as g, handleSessionsFlush as h, handleCommandsExecute as i, handleHealth as l, handleRetentionRun as m, handleAgentWatch as n, handleCommit as o, handleReload as p, handleAttachmentsAdmit as r, handleDefaultSelection as s, TboxcodeRemoteGateway as t, handleImagesAdmit as u, handleSkillsWatch as v, remote_default as x, inject as y };
package/lib/remote.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import "./convergence-core-C1ZtU17g.js";
2
- import "./retention-B2V8Plpx.js";
3
- import { C as name, S as inject, _ as handleRetentionRun, a as TboxcodeRemoteGateway, b as handleSkillsUserInvocable, c as handleAttachmentsAdmit, d as handleCommit, f as handleDefaultSelection, g as handleReload, h as handleMode, i as RemoteAgentLike, l as handleCommandsExecute, m as handleHealth, n as DefaultModelSelection, o as TboxcodeRemoteServices, p as handleGitPushWatch, r as GitPushEvent, s as handleAgentWatch, t as AgentWatchItem, u as handleCommandsList, v as handleSessionsFlush, x as handleSkillsWatch, y as handleSessionsStat } from "./remote-BZjKKp64.js";
4
- export { AgentWatchItem, DefaultModelSelection, GitPushEvent, RemoteAgentLike, TboxcodeRemoteGateway, TboxcodeRemoteGateway as default, TboxcodeRemoteServices, handleAgentWatch, handleAttachmentsAdmit, handleCommandsExecute, handleCommandsList, handleCommit, handleDefaultSelection, handleGitPushWatch, handleHealth, handleMode, handleReload, handleRetentionRun, handleSessionsFlush, handleSessionsStat, handleSkillsUserInvocable, handleSkillsWatch, inject, name };
1
+ import "./convergence-core-B81Z55Bq.js";
2
+ import "./retention-f1rAWNdl.js";
3
+ import { C as handleSkillsWatch, S as handleSkillsUserInvocable, T as name, _ as handleMode, a as TboxcodeRemoteGateway, b as handleSessionsFlush, c as handleAttachmentsAdmit, d as handleCommit, f as handleDefaultSelection, g as handleImagesRead, h as handleImagesAdmit, i as RemoteAgentLike, l as handleCommandsExecute, m as handleHealth, n as DefaultModelSelection, o as TboxcodeRemoteServices, p as handleGitPushWatch, r as GitPushEvent, s as handleAgentWatch, t as AgentWatchItem, u as handleCommandsList, v as handleReload, w as inject, x as handleSessionsStat, y as handleRetentionRun } from "./remote--pQj9xul.js";
4
+ export { AgentWatchItem, DefaultModelSelection, GitPushEvent, RemoteAgentLike, TboxcodeRemoteGateway, TboxcodeRemoteGateway as default, TboxcodeRemoteServices, handleAgentWatch, handleAttachmentsAdmit, handleCommandsExecute, handleCommandsList, handleCommit, handleDefaultSelection, handleGitPushWatch, handleHealth, handleImagesAdmit, handleImagesRead, handleMode, handleReload, handleRetentionRun, handleSessionsFlush, handleSessionsStat, handleSkillsUserInvocable, handleSkillsWatch, inject, name };
package/lib/remote.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./retention-DNEdnIxC.js";
2
- import "./logger-BGwLHZXY.js";
3
- import { _ as inject, a as handleCommandsList, c as handleGitPushWatch, d as handleReload, f as handleRetentionRun, g as handleSkillsWatch, h as handleSkillsUserInvocable, i as handleCommandsExecute, l as handleHealth, m as handleSessionsStat, n as handleAgentWatch, o as handleCommit, p as handleSessionsFlush, r as handleAttachmentsAdmit, s as handleDefaultSelection, t as TboxcodeRemoteGateway, u as handleMode, v as name, y as remote_default } from "./remote-lvZ2n78k.js";
1
+ import "./retention-CVHXhi92.js";
2
+ import "./logger-Dnz11jWP.js";
3
+ import { _ as handleSkillsUserInvocable, a as handleCommandsList, b as name, c as handleGitPushWatch, d as handleImagesRead, f as handleMode, g as handleSessionsStat, h as handleSessionsFlush, i as handleCommandsExecute, l as handleHealth, m as handleRetentionRun, n as handleAgentWatch, o as handleCommit, p as handleReload, r as handleAttachmentsAdmit, s as handleDefaultSelection, t as TboxcodeRemoteGateway, u as handleImagesAdmit, v as handleSkillsWatch, x as remote_default, y as inject } from "./remote-Cr46ZKbO.js";
4
4
 
5
- export { TboxcodeRemoteGateway, remote_default as default, handleAgentWatch, handleAttachmentsAdmit, handleCommandsExecute, handleCommandsList, handleCommit, handleDefaultSelection, handleGitPushWatch, handleHealth, handleMode, handleReload, handleRetentionRun, handleSessionsFlush, handleSessionsStat, handleSkillsUserInvocable, handleSkillsWatch, inject, name };
5
+ export { TboxcodeRemoteGateway, remote_default as default, handleAgentWatch, handleAttachmentsAdmit, handleCommandsExecute, handleCommandsList, handleCommit, handleDefaultSelection, handleGitPushWatch, handleHealth, handleImagesAdmit, handleImagesRead, handleMode, handleReload, handleRetentionRun, handleSessionsFlush, handleSessionsStat, handleSkillsUserInvocable, handleSkillsWatch, inject, name };
@@ -1,2 +1,2 @@
1
- import { a as SweepResult, c as sweepLlmCalls, i as SessionsSweepFs, l as sweepSessions, n as RetentionKnobs, o as isOwnedHome, r as RetentionScheduler, s as startRetentionScheduler, t as DEFAULT_KNOBS } from "./retention-B2V8Plpx.js";
1
+ import { a as SweepResult, c as sweepLlmCalls, i as SessionsSweepFs, l as sweepSessions, n as RetentionKnobs, o as isOwnedHome, r as RetentionScheduler, s as startRetentionScheduler, t as DEFAULT_KNOBS } from "./retention-f1rAWNdl.js";
2
2
  export { DEFAULT_KNOBS, RetentionKnobs, RetentionScheduler, SessionsSweepFs, SweepResult, isOwnedHome, startRetentionScheduler, sweepLlmCalls, sweepSessions };
package/lib/retention.js CHANGED
@@ -1,3 +1,3 @@
1
- import { a as sweepSessions, i as sweepLlmCalls, n as isOwnedHome, r as startRetentionScheduler, t as DEFAULT_KNOBS } from "./retention-DNEdnIxC.js";
1
+ import { a as sweepSessions, i as sweepLlmCalls, n as isOwnedHome, r as startRetentionScheduler, t as DEFAULT_KNOBS } from "./retention-CVHXhi92.js";
2
2
 
3
3
  export { DEFAULT_KNOBS, isOwnedHome, startRetentionScheduler, sweepLlmCalls, sweepSessions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/tboxcode-dsh-bundle",
3
- "version": "0.1.0-rc.14",
3
+ "version": "0.1.0-rc.16",
4
4
  "type": "module",
5
5
  "description": "tboxcode 组合点(host 服务行 + agent 平面 host 行 + profile 模板三件):patch + prompts / reminders 插件 + tboxcode Remote 服务",
6
6
  "main": "lib/index.js",
@@ -27,6 +27,10 @@
27
27
  "types": "./lib/remote.d.ts",
28
28
  "default": "./lib/remote.js"
29
29
  },
30
+ "./image-source": {
31
+ "types": "./lib/image-source.d.ts",
32
+ "default": "./lib/image-source.js"
33
+ },
30
34
  "./retention": {
31
35
  "types": "./lib/retention.d.ts",
32
36
  "default": "./lib/retention.js"
@@ -47,17 +51,19 @@
47
51
  },
48
52
  "dependencies": {
49
53
  "zod": "4.6.7",
50
- "@tbox.cn/tboxcode-dsh-tools": "0.1.0-rc.14",
51
- "@tbox.cn/tboxcode-dsh-llm": "0.1.0-rc.14",
52
- "@tbox.cn/tboxcode-dsh-runtime": "0.1.0-rc.14",
53
- "@tbox.cn/dsh-acp-bridge-core": "0.1.0-rc.14"
54
+ "@tbox.cn/tboxcode-dsh-tools": "0.1.0-rc.16",
55
+ "@tbox.cn/tboxcode-dsh-runtime": "0.1.0-rc.16",
56
+ "@tbox.cn/dsh-acp-bridge-core": "0.1.0-rc.16",
57
+ "@tbox.cn/tboxcode-dsh-llm": "0.1.0-rc.16"
54
58
  },
55
59
  "peerDependencies": {
56
60
  "@deepseek-ai/cordis": "4.1.0",
57
61
  "@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.1",
58
- "@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.1"
62
+ "@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.1",
63
+ "@deepseek-ai/dsh-session": "0.2.2-rc.1"
59
64
  },
60
65
  "devDependencies": {
66
+ "@deepseek-ai/dsh-session": "0.2.2-rc.1",
61
67
  "@deepseek-ai/cordis": "4.1.0",
62
68
  "yaml": "^2.8.0",
63
69
  "@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.1",
File without changes