@deepseek-ai/dsh-experimental-webworker-packer 0.1.6-alpha.2 → 0.1.7-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.i18n.yaml +2 -2
- package/README.md +5 -2
- package/README.zh.md +5 -2
- package/lib/bin.js +2 -2
- package/lib/index.js +2 -2
- package/lib/{repository-f0am6-5_.js → repository-Dpj3ScQ2.js} +105 -4
- package/lib/types/bin.js +3 -3
- package/lib/types/index.d.ts +1 -1
- package/lib/types/preview.d.ts +11 -0
- package/lib/types/repository.d.ts +1 -0
- package/package.json +9 -6
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/experimental/webworker-packer/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: dfb3eccf8343f29c1028dae3a2db22a543675de8
|
|
6
|
+
README.zh.md: 3c528628a8d810db00d9bd8b2c0b64a179faa729
|
package/README.md
CHANGED
|
@@ -31,11 +31,13 @@ The pack is a three-layer standard stack:
|
|
|
31
31
|
|
|
32
32
|
1. **Roster** — the composed profile's plugin rows (standard YAML parse under Include's dialect, `!!js` intact), plus the rows of every config tree the CLI declares in its `package.json` `dsh.configTrees` (agent presets), materialized as a Node-style dependency closure. External peer edges never bind the worker; workspace peers stay on the chain.
|
|
33
33
|
2. **Publish view** — each workspace or vendored package contributes its built npm slice (`files` through picomatch) without source or workspace `dist/`. External packages retain published JavaScript under both `src/` and `dist/` because their `main` or `exports` may point there; only generic test, map, declaration, and archive exclusions apply.
|
|
34
|
-
3. **Reachability sweep** — the runtime loader's own resolution walks from every workspace export
|
|
34
|
+
3. **Reachability sweep** — the runtime loader's own resolution walks from every non-wildcard workspace runtime export plus the worker assembly's seeds (`IMAGE_ENTRY_SEEDS`), lowering each reached module to the wrapper contract at pack time. Declaration-only condition trees do not seed the sweep; runtime requests for those exports still fail. The transform reports statically named imports, re-exports, and dynamic imports; calls through `require`; and module-scope direct calls of the form `createRequire(import.meta.url)('pkg')` through a named import from `node:module` or `module`, including an import alias. Page assets (`lib/client.js` behind `./client` exports) ship verbatim; an unresolvable request from our own code fails the pack, third-party ones are tolerated to fail loud at require time.
|
|
35
35
|
|
|
36
36
|
`repository.ts` owns the repo-shaped inputs (workspace scan of `vendor/`, `packages/`, `native/system/packages/`, and `apps/`; profile composition through the real CLI dump path); `pack.ts` owns none of them, so the same library packs a different tree by being called differently. The native scan makes the Landlock entry package an ordinary published-view dependency while its executable remains a Worker platform implementation. The CLI is `dsh-pack-vfs-image --out <file> [--profile web]`; `apps/web`'s `build:preview` runs it after the preview shell build.
|
|
37
37
|
|
|
38
|
-
The repository adapter also declares the preview-only fixture trees under `webworker-runtime/tests/fixtures/`. The CLI packs each named fixture into a separate deterministic overlay archive plus a browser-readable manifest. Overlay files bypass npm publish-view and module-reachability exclusions, so dot directories and example source files remain intact; their mounts are limited to `home/` and `workspace/`. `
|
|
38
|
+
The repository adapter also declares the preview-only fixture trees under `webworker-runtime/tests/fixtures/`. The CLI packs each named fixture into a separate deterministic overlay archive plus a browser-readable manifest. Overlay files bypass npm publish-view and module-reachability exclusions, so dot directories and example source files remain intact; their mounts are limited to `home/` and `workspace/`. `packVfsOverlay` treats all files as opaque bytes.
|
|
39
|
+
|
|
40
|
+
`packPreviewFixture` prepares the newest canonical raw Session generation in each fixture directory through the [Session format catalog](../../session/session-format-catalog/README.md) in Node. It collects direct-child discovery evidence from the same fixture root before completing historical parent catalogs. It strictly restores the source, encodes and strictly validates the current successor, and packs that successor beside unchanged source files. A malformed, unsupported, or future selected generation refuses the build without falling back. Temporary successors are removed after packing. Browser write-open then uses current data without invoking Node's migration-verification Worker. Projection caches remain owner-validated; an older generation cannot supply a current fold checkpoint.
|
|
39
41
|
|
|
40
42
|
-----
|
|
41
43
|
|
|
@@ -57,6 +59,7 @@ None; this package neither assembles nor sends a provider request.
|
|
|
57
59
|
- **Vendored package sources (`src/*.ts`) are excluded** — nothing resolves them at runtime; a future in-worker source-inspection feature would need a dedicated include rule.
|
|
58
60
|
- **The packer assumes built `lib/` artifacts are current**: it never compiles, so a stale workspace build packs stale bytes. Run the repository build first.
|
|
59
61
|
- **The CLI requires its original repository location**: `dsh-pack-vfs-image` finds the checkout relative to its own installed file and reads the source CLI, configuration trees, and preview fixtures there. An npm installation supports the parameterized library API; the CLI and repository helpers require a complete, built DeepSeek Harness checkout.
|
|
62
|
+
- **Preview Session inputs use raw JSONL** — `packPreviewFixture` rejects compressed and noncanonical Session generation filenames. Generic overlays remain byte-preserving.
|
|
60
63
|
|
|
61
64
|
|
|
62
65
|
<a id="dev-note"></a>
|
package/README.zh.md
CHANGED
|
@@ -31,11 +31,13 @@ VFS 镜像打包器:把一份合成 profile 变成浏览器 worker 挂载为
|
|
|
31
31
|
|
|
32
32
|
1. **Roster**——合成 profile 的插件行(标准 YAML 解析、Include 方言、`!!js` 原样保留),加上 CLI(命令行界面)在 `package.json` `dsh.configTrees` 里声明的每棵配置树(agent(智能体) presets)的行,按 Node 式依赖闭包物化。外部 peer 边绝不会绑定到 worker,workspace peer 保留在链上。
|
|
33
33
|
2. **发布视图**——每个 workspace 或 vendored 包贡献其构建后的 npm 切片(`files` 走 picomatch),不带源码和 workspace `dist/`。外部包的 `main` 或 `exports` 可能指向 `src/` 或 `dist/`,因此两处发布 JavaScript 都会保留,只应用通用的测试、map、声明与归档排除规则。
|
|
34
|
-
3. **可达性 sweep
|
|
34
|
+
3. **可达性 sweep**——用运行时加载器自己的解析, 从全部不含通配符的 workspace 运行时导出加 worker 装配种子 (`IMAGE_ENTRY_SEEDS`) 出发, 打包时把每个可达模块转换为符合包装层约定的形式. 仅含类型声明的条件树不作为扫描入口; 运行时代码请求这些导出仍会失败. 该转换会报告名称可静态确定的 import、re-export 与动态 import、经 `require` 发起的调用, 以及通过 `node:module` 或 `module` 具名导入 (含导入别名) 在模块作用域直接发起的 `createRequire(import.meta.url)('pkg')` 调用. 页面资产 (`./client` 导出背后的 `lib/client.js`) 原样直发; 自家代码的不可解析请求会让打包失败, 第三方不可解析请求则允许延后到 require 时明确失败.
|
|
35
35
|
|
|
36
36
|
`repository.ts` 拥有仓库形态输入(`vendor/`、`packages/`、`native/system/packages/` 与 `apps/` 的 workspace 扫描;经真 CLI dump 路径合成 profile);`pack.ts` 一概不拥有,同一库换参即可打另一棵树。Native 扫描使 Landlock 入口包成为普通发布视图依赖,其可执行文件仍由 Worker 平台实现。CLI 为 `dsh-pack-vfs-image --out <file> [--profile web]`;`apps/web` 的 `build:preview` 在预览壳构建后运行它。
|
|
37
37
|
|
|
38
|
-
仓库适配器还声明 `webworker-runtime/tests/fixtures/` 下仅用于 preview 的 fixture(测试前置数据) tree。CLI 会把每套具名 fixture 打成一份独立的确定性 overlay 归档,并写出浏览器可读的 manifest(元数据清单)。Overlay 文件绕过 npm 发布视图和模块可达性排除规则,因此点目录与示例源码会完整保留;其挂载位置仅限 `home/` 与 `workspace/`。`
|
|
38
|
+
仓库适配器还声明 `webworker-runtime/tests/fixtures/` 下仅用于 preview 的 fixture(测试前置数据) tree。CLI 会把每套具名 fixture 打成一份独立的确定性 overlay 归档,并写出浏览器可读的 manifest(元数据清单)。Overlay 文件绕过 npm 发布视图和模块可达性排除规则,因此点目录与示例源码会完整保留;其挂载位置仅限 `home/` 与 `workspace/`。`packVfsOverlay` 将所有文件视为不透明字节。
|
|
39
|
+
|
|
40
|
+
`packPreviewFixture` 在 Node 中通过 [Session 格式目录](../../session/session-format-catalog/README.zh.md)准备每个 fixture 目录里最新的规范原始 Session 代际。它从同一 fixture 根目录收集直属子 Session 的发现证据,再补全历史父目录。它严格恢复源文件、编码并严格校验当前后继文件,然后将后继文件与未改变的源文件一同打包。如果选中的代际格式错误、不受支持或属于未来版本,构建会拒绝,不回退。临时后继文件在打包后删除。浏览器以写模式打开时即可使用当前数据,无需调用 Node 的迁移校验 Worker。投影缓存仍由其所属包校验;较早代际不能提供当前折叠检查点。
|
|
39
41
|
|
|
40
42
|
-----
|
|
41
43
|
|
|
@@ -57,6 +59,7 @@ VFS 镜像打包器:把一份合成 profile 变成浏览器 worker 挂载为
|
|
|
57
59
|
- **vendored 包源码(`src/*.ts`)被排除**——运行时无人解析它们;未来若有 worker 内源码巡检功能需要专门的 include 规则。
|
|
58
60
|
- **打包器假定构建产物 `lib/` 是新鲜的**:它从不编译,工作区构建陈旧就会打包陈旧字节。先跑仓库构建。
|
|
59
61
|
- **CLI 必须位于原有仓库位置**:`dsh-pack-vfs-image` 相对于自身安装文件定位检出目录,并从中读取源码 CLI、配置树和预览 fixture。npm 安装支持参数化的库 API;CLI 和仓库辅助函数需要完整且已构建的 DeepSeek Harness 检出目录。
|
|
62
|
+
- **Preview Session 输入使用原始 JSONL** — `packPreviewFixture` 拒绝压缩文件与不规范的 Session 代际文件名。通用 overlay 仍逐字节保留输入。
|
|
60
63
|
|
|
61
64
|
|
|
62
65
|
<a id="dev-note"></a>
|
package/lib/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as previewFixtures, i as indexWorkspacePackages,
|
|
2
|
+
import { a as previewFixtures, i as indexWorkspacePackages, n as configTrees, o as packPreviewFixture, r as describePack, t as composeProfile, u as packVfsImage } from "./repository-Dpj3ScQ2.js";
|
|
3
3
|
import { PREVIEW_FIXTURE_MANIFEST_FILE, PREVIEW_FIXTURE_MANIFEST_VERSION } from "@deepseek-ai/dsh-experimental-webworker-runtime";
|
|
4
4
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
@@ -50,7 +50,7 @@ const fixtureDefinitions = previewFixtures(repoRoot);
|
|
|
50
50
|
mkdirSync(join(dirname(outputFile), "fixtures"), { recursive: true });
|
|
51
51
|
const fixtureLines = [];
|
|
52
52
|
const fixtures = fixtureDefinitions.map((fixture) => {
|
|
53
|
-
const packed =
|
|
53
|
+
const packed = packPreviewFixture(fixture.trees);
|
|
54
54
|
const file = `fixtures/${fixture.id}.tar.gz`;
|
|
55
55
|
writeFileSync(join(dirname(outputFile), file), packed.image);
|
|
56
56
|
fixtureLines.push(` fixture overlay ${fixture.id} (${String(packed.image.byteLength)} B compressed)`);
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as previewFixtures, c as
|
|
2
|
-
export { CONFIG_PATH, DEFAULT_ROOT, MANIFEST_PATH, WRAPPER_CONTRACT, composeProfile, configTrees, describePack, indexWorkspacePackages, packVfsImage, packVfsOverlay, previewFixtures };
|
|
1
|
+
import { a as previewFixtures, c as DEFAULT_ROOT, d as packVfsOverlay, f as WRAPPER_CONTRACT, i as indexWorkspacePackages, l as MANIFEST_PATH, n as configTrees, o as packPreviewFixture, r as describePack, s as CONFIG_PATH, t as composeProfile, u as packVfsImage } from "./repository-Dpj3ScQ2.js";
|
|
2
|
+
export { CONFIG_PATH, DEFAULT_ROOT, MANIFEST_PATH, WRAPPER_CONTRACT, composeProfile, configTrees, describePack, indexWorkspacePackages, packPreviewFixture, packVfsImage, packVfsOverlay, previewFixtures };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_ROOT, DEFAULT_ROOT as DEFAULT_ROOT$1, IMAGE_CONFIG_PATH, IMAGE_EMPTY_DIRECTORIES, IMAGE_MANIFEST_PATH, IMAGE_OVERLAY_DIRECTORIES, LOWERING_VERSION, MODULE_PROXIES, MODULE_PROXY_PREFIXES, MemoryVfs, REPLACED_EXTERNAL_PACKAGES, WorkerModuleLoader, lowerModuleSource, packTar } from "@deepseek-ai/dsh-experimental-webworker-runtime";
|
|
2
|
-
import { existsSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync } from "node:fs";
|
|
3
|
-
import { dirname, join, relative } from "node:path";
|
|
2
|
+
import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join, posix, relative } from "node:path";
|
|
4
4
|
import { gzipSync } from "node:zlib";
|
|
5
5
|
import picomatch from "picomatch";
|
|
6
6
|
import yaml from "js-yaml";
|
|
@@ -8,6 +8,9 @@ import { entryListSchema } from "@deepseek-ai/cordis-plugin-include";
|
|
|
8
8
|
import { execFileSync } from "node:child_process";
|
|
9
9
|
import { tmpdir } from "node:os";
|
|
10
10
|
import { DSH_HOME_ENV } from "@deepseek-ai/dsh-home-paths";
|
|
11
|
+
import { isSessionFormatJsonObject, parseSessionFormatLogFilename, sessionFormatLogFilename } from "@deepseek-ai/dsh-session-format";
|
|
12
|
+
import { createSessionFormatCatalogWithChildren, historicalSessionFormatCatalog, sessionFormatCatalog } from "@deepseek-ai/dsh-session-format-catalog";
|
|
13
|
+
import { historicalChildCatalogSource } from "@deepseek-ai/dsh-session-format-v3-to-v4";
|
|
11
14
|
//#region lib/types/transform-image.js
|
|
12
15
|
/**
|
|
13
16
|
* The wrapper contract packed bodies are emitted against, and the image-entry
|
|
@@ -308,6 +311,13 @@ function debuggerNamer(workspaces, resolveFrom) {
|
|
|
308
311
|
return directory === void 0 ? key : `${directory}${rest.slice(packageName.length)}`;
|
|
309
312
|
};
|
|
310
313
|
}
|
|
314
|
+
/** Declaration-only condition trees add no runtime roots; explicit imports still resolve normally. */
|
|
315
|
+
function isDeclarationOnlyExport(value) {
|
|
316
|
+
if (typeof value !== "object" || value === null) return false;
|
|
317
|
+
if (Array.isArray(value)) return value.length > 0 && value.every(isDeclarationOnlyExport);
|
|
318
|
+
const conditions = Object.entries(value);
|
|
319
|
+
return conditions.length > 0 && conditions.every(([condition, target]) => condition === "types" || condition.startsWith("types@") || isDeclarationOnlyExport(target));
|
|
320
|
+
}
|
|
311
321
|
function sweepImage(files, options, rootPackages, root) {
|
|
312
322
|
const decoder = new TextDecoder();
|
|
313
323
|
const encoder = new TextEncoder();
|
|
@@ -335,7 +345,7 @@ function sweepImage(files, options, rootPackages, root) {
|
|
|
335
345
|
} catch {
|
|
336
346
|
continue;
|
|
337
347
|
}
|
|
338
|
-
const subpaths = manifest.exports === void 0 ? ["."] : Object.
|
|
348
|
+
const subpaths = manifest.exports === void 0 ? ["."] : Object.entries(manifest.exports).filter(([key, target]) => key.startsWith(".") && !key.includes("*") && !isDeclarationOnlyExport(target)).map(([key]) => key);
|
|
339
349
|
for (const subpath of subpaths) queue.push({
|
|
340
350
|
specifier: subpath === "." ? name : `${name}/${subpath.slice(2)}`,
|
|
341
351
|
from: root,
|
|
@@ -584,6 +594,97 @@ function packVfsOverlay(trees) {
|
|
|
584
594
|
};
|
|
585
595
|
}
|
|
586
596
|
//#endregion
|
|
597
|
+
//#region lib/types/preview.js
|
|
598
|
+
/** Node-side Session preparation for browser Preview data overlays. */
|
|
599
|
+
/**
|
|
600
|
+
* Pack Preview data with strictly validated current Session successors prepared in Node.
|
|
601
|
+
* Committed source bytes remain in the overlay; only the newest canonical raw generation
|
|
602
|
+
* of each Session is restored. Future, malformed, and unsupported selected data refuse the pack.
|
|
603
|
+
* @param trees - Ordered source trees under the Preview's home and workspace mounts.
|
|
604
|
+
* @returns Deterministic overlay containing unchanged inputs and final current successors.
|
|
605
|
+
*/
|
|
606
|
+
function packPreviewFixture(trees) {
|
|
607
|
+
const original = packVfsOverlay(trees);
|
|
608
|
+
const successors = /* @__PURE__ */ new Map();
|
|
609
|
+
const sources = selectedSessions(original.files).map((source) => {
|
|
610
|
+
const text = new TextDecoder("utf-8", { fatal: true }).decode(source.bytes);
|
|
611
|
+
if (!text.endsWith("\n")) throw new Error(`preview fixture: ${source.path} has a torn physical tail`);
|
|
612
|
+
const [headerLine = "", ...rows] = text.slice(0, -1).split("\n");
|
|
613
|
+
const header = JSON.parse(headerLine);
|
|
614
|
+
if (!isSessionFormatJsonObject(header) || header["version"] !== source.version || header["id"] !== source.id) throw new Error(`preview fixture: ${source.path} disagrees with its Session header`);
|
|
615
|
+
const restore = (source.version <= 3 ? historicalSessionFormatCatalog : sessionFormatCatalog).createRestore(header, {
|
|
616
|
+
recovery: "strict",
|
|
617
|
+
validation: "current"
|
|
618
|
+
});
|
|
619
|
+
const events = rows.map((row) => JSON.parse(row));
|
|
620
|
+
for (const event of events) restore.decodeRow(event);
|
|
621
|
+
return {
|
|
622
|
+
...source,
|
|
623
|
+
header,
|
|
624
|
+
events,
|
|
625
|
+
artifact: restore.finish()
|
|
626
|
+
};
|
|
627
|
+
});
|
|
628
|
+
for (const source of sources) {
|
|
629
|
+
if (source.version === sessionFormatCatalog.currentVersion) continue;
|
|
630
|
+
const restore = createSessionFormatCatalogWithChildren(sources.filter((child) => posix.dirname(child.directory) === posix.dirname(source.directory) && child.artifact.header.parentSession === source.id && child.artifact.header.origin === "subagent").map((child) => ({
|
|
631
|
+
...historicalChildCatalogSource(child.artifact),
|
|
632
|
+
sourcePath: child.path
|
|
633
|
+
}))).createRestore(source.header, {
|
|
634
|
+
recovery: "strict",
|
|
635
|
+
validation: "current"
|
|
636
|
+
});
|
|
637
|
+
for (const event of source.events) restore.decodeRow(event);
|
|
638
|
+
const artifact = restore.finish();
|
|
639
|
+
const encodedHeader = sessionFormatCatalog.encodeCurrentHeader(artifact.header, artifact.inheritedEventCount);
|
|
640
|
+
const encodedEvents = artifact.events.map((event) => sessionFormatCatalog.encodeCurrentEvent(event));
|
|
641
|
+
const verification = sessionFormatCatalog.createRestore(encodedHeader, {
|
|
642
|
+
recovery: "strict",
|
|
643
|
+
validation: "current"
|
|
644
|
+
});
|
|
645
|
+
for (const event of encodedEvents) verification.decodeRow(event);
|
|
646
|
+
verification.finish();
|
|
647
|
+
successors.set(posix.join(source.directory, sessionFormatLogFilename(sessionFormatCatalog.currentVersion)), [encodedHeader, ...encodedEvents].map((row) => JSON.stringify(row) + "\n").join(""));
|
|
648
|
+
}
|
|
649
|
+
if (successors.size === 0) return original;
|
|
650
|
+
const directory = mkdtempSync(join(tmpdir(), "dsh-preview-sessions-"));
|
|
651
|
+
try {
|
|
652
|
+
for (const [imagePath, content] of successors) {
|
|
653
|
+
const path = join(directory, imagePath.slice(14));
|
|
654
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
655
|
+
writeFileSync(path, content, { flag: "wx" });
|
|
656
|
+
}
|
|
657
|
+
return packVfsOverlay([...trees, {
|
|
658
|
+
mount: "home/sessions",
|
|
659
|
+
directory
|
|
660
|
+
}]);
|
|
661
|
+
} finally {
|
|
662
|
+
rmSync(directory, {
|
|
663
|
+
recursive: true,
|
|
664
|
+
force: true
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
function selectedSessions(files) {
|
|
669
|
+
const selected = /* @__PURE__ */ new Map();
|
|
670
|
+
for (const [path, bytes] of Object.entries(files)) {
|
|
671
|
+
const match = /^home\/sessions\/[^/]+\/([^/]+)\/(session(?:\..*)?\.jsonl(?:\.zstd)?)$/u.exec(path);
|
|
672
|
+
if (match === null) continue;
|
|
673
|
+
const version = parseSessionFormatLogFilename(match[2]);
|
|
674
|
+
if (version === void 0) throw new Error(`preview fixture: ${path} must name a canonical raw Session generation`);
|
|
675
|
+
const directory = posix.dirname(path);
|
|
676
|
+
const previous = selected.get(directory);
|
|
677
|
+
if (previous === void 0 || previous.version < version) selected.set(directory, {
|
|
678
|
+
path,
|
|
679
|
+
directory,
|
|
680
|
+
id: match[1],
|
|
681
|
+
version,
|
|
682
|
+
bytes
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
return [...selected.values()];
|
|
686
|
+
}
|
|
687
|
+
//#endregion
|
|
587
688
|
//#region lib/types/repository.js
|
|
588
689
|
/**
|
|
589
690
|
* Repository knowledge for the packer: where this tree's workspaces, profile
|
|
@@ -761,4 +862,4 @@ function describePack(result, repoRoot, outputFile) {
|
|
|
761
862
|
];
|
|
762
863
|
}
|
|
763
864
|
//#endregion
|
|
764
|
-
export { previewFixtures as a,
|
|
865
|
+
export { previewFixtures as a, DEFAULT_ROOT$1 as c, packVfsOverlay as d, WRAPPER_CONTRACT as f, indexWorkspacePackages as i, MANIFEST_PATH as l, configTrees as n, packPreviewFixture as o, describePack as r, CONFIG_PATH as s, composeProfile as t, packVfsImage as u };
|
package/lib/types/bin.js
CHANGED
|
@@ -11,8 +11,8 @@ import { mkdirSync, writeFileSync } from 'node:fs';
|
|
|
11
11
|
import { dirname, isAbsolute, join, resolve } from 'node:path';
|
|
12
12
|
import { fileURLToPath } from 'node:url';
|
|
13
13
|
import { PREVIEW_FIXTURE_MANIFEST_FILE, PREVIEW_FIXTURE_MANIFEST_VERSION, } from '@deepseek-ai/dsh-experimental-webworker-runtime';
|
|
14
|
-
import { packVfsImage
|
|
15
|
-
import { composeProfile, configTrees, describePack, indexWorkspacePackages, previewFixtures, } from "./repository.js";
|
|
14
|
+
import { packVfsImage } from "./pack.js";
|
|
15
|
+
import { composeProfile, configTrees, describePack, indexWorkspacePackages, packPreviewFixture, previewFixtures, } from "./repository.js";
|
|
16
16
|
/**
|
|
17
17
|
* Read one `--flag value` pair.
|
|
18
18
|
* @param name - Flag name without dashes.
|
|
@@ -56,7 +56,7 @@ const fixtureDirectory = join(dirname(outputFile), 'fixtures');
|
|
|
56
56
|
mkdirSync(fixtureDirectory, { recursive: true });
|
|
57
57
|
const fixtureLines = [];
|
|
58
58
|
const fixtures = fixtureDefinitions.map((fixture) => {
|
|
59
|
-
const packed =
|
|
59
|
+
const packed = packPreviewFixture(fixture.trees);
|
|
60
60
|
const file = `fixtures/${fixture.id}.tar.gz`;
|
|
61
61
|
writeFileSync(join(dirname(outputFile), file), packed.image);
|
|
62
62
|
fixtureLines.push(` fixture overlay ${fixture.id} (${String(packed.image.byteLength)} B compressed)`);
|
package/lib/types/index.d.ts
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { WRAPPER_CONTRACT, type ImageFiles, type TransformOutcome, } from './transform-image.ts';
|
|
6
6
|
export { CONFIG_PATH, DEFAULT_ROOT, MANIFEST_PATH, packVfsImage, packVfsOverlay, type ConfigTree, type ImageTree, type PackOptions, type PackOverlayResult, type PackResult, } from './pack.ts';
|
|
7
|
-
export { composeProfile, configTrees, describePack, indexWorkspacePackages, previewFixtures, type PreviewFixture, } from './repository.ts';
|
|
7
|
+
export { composeProfile, configTrees, describePack, indexWorkspacePackages, packPreviewFixture, previewFixtures, type PreviewFixture, } from './repository.ts';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Node-side Session preparation for browser Preview data overlays. */
|
|
2
|
+
import { type ImageTree, type PackOverlayResult } from './pack.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Pack Preview data with strictly validated current Session successors prepared in Node.
|
|
5
|
+
* Committed source bytes remain in the overlay; only the newest canonical raw generation
|
|
6
|
+
* of each Session is restored. Future, malformed, and unsupported selected data refuse the pack.
|
|
7
|
+
* @param trees - Ordered source trees under the Preview's home and workspace mounts.
|
|
8
|
+
* @returns Deterministic overlay containing unchanged inputs and final current successors.
|
|
9
|
+
*/
|
|
10
|
+
export declare function packPreviewFixture(trees: readonly ImageTree[]): PackOverlayResult;
|
|
11
|
+
//# sourceMappingURL=preview.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-experimental-webworker-packer",
|
|
3
3
|
"description": "Build-time packer for the browser runtime's base VFS image and ordered data-overlay archives",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.7-alpha.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -35,16 +35,19 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"js-yaml": "^4.2.0",
|
|
37
37
|
"picomatch": "^4.0.4",
|
|
38
|
-
"@deepseek-ai/cordis-plugin-include": "^1.0.
|
|
39
|
-
"@deepseek-ai/dsh-experimental-webworker-runtime": "^0.1.
|
|
40
|
-
"@deepseek-ai/dsh-
|
|
38
|
+
"@deepseek-ai/cordis-plugin-include": "^1.0.8",
|
|
39
|
+
"@deepseek-ai/dsh-experimental-webworker-runtime": "^0.1.7-alpha.1",
|
|
40
|
+
"@deepseek-ai/dsh-session-format-v3-to-v4": "^0.1.7-alpha.1",
|
|
41
|
+
"@deepseek-ai/dsh-session-format-catalog": "^0.1.7-alpha.1",
|
|
42
|
+
"@deepseek-ai/dsh-home-paths": "^0.1.7-alpha.1",
|
|
43
|
+
"@deepseek-ai/dsh-session-format": "^0.1.7-alpha.1"
|
|
41
44
|
},
|
|
42
45
|
"devDependencies": {
|
|
43
46
|
"@types/js-yaml": "^4.0.9",
|
|
44
47
|
"@types/picomatch": "^3.0.2",
|
|
45
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
48
|
+
"@deepseek-ai/cordis": "^4.0.3"
|
|
46
49
|
},
|
|
47
50
|
"peerDependencies": {
|
|
48
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
51
|
+
"@deepseek-ai/cordis": "^4.0.3"
|
|
49
52
|
}
|
|
50
53
|
}
|