dsh-wiredag 0.0.0-stage → 0.1.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/LICENSE.md ADDED
@@ -0,0 +1,39 @@
1
+ # WireDag 最终用户许可协议 / End User License Agreement
2
+
3
+ 版本:2026-12-03
4
+
5
+ 中文版与英文版具有同等效力;如有歧义,以中文版为准。
6
+
7
+ ## 中文版
8
+
9
+ ### 1. 适用范围
10
+
11
+ 本协议适用于 WireDag 的编辑器扩展、各 Agent 平台插件、命令行工具及其后续更新(下称“本软件”)。安装或使用本软件,即表示你同意本协议。
12
+
13
+ ### 2. 免费试用
14
+
15
+ 首次使用起可免费试用 7 天,用于个人或商业用途,不需要登录。到期后需购买 Pro 才能继续使用本软件。
16
+
17
+ ### 3. Pro 终身会员
18
+
19
+ 购买 Pro 后,权益与购买者的云帆平台账号绑定。使用同一账号可在各支持的平台和本人的设备上恢复权益,不限制设备数量。软件通过联网验证权益。WireDag 的权益与云帆的其他产品分开。
20
+
21
+ ### 4. 隐私与本地数据
22
+
23
+ 用户源码、试验拓扑、`.wiredag/cas/` 本地缓存产物与执行日志全部留在本机处理,不会上传至云帆服务器。
24
+
25
+ ---
26
+
27
+ ## English Version
28
+
29
+ ### 1. Scope
30
+
31
+ This Agreement governs the WireDag editor extensions, AI coding agent plugins, CLI daemon, and subsequent updates ("the Software"). By installing or using the Software, you agree to this Agreement.
32
+
33
+ ### 2. Free Trial & Lifetime Pro
34
+
35
+ You receive a 7-day full-featured free trial upon first use on your machine. After the trial expires, a one-time WireDag Pro purchase unlocks lifetime access across supported platforms under your Yunfan account.
36
+
37
+ ### 3. Local-First Data Privacy
38
+
39
+ All source code, experiment DAG topologies, `.wiredag/cas/` intermediate artifacts, and execution logs remain 100% local on your machine and are never uploaded to Yunfan servers.
package/README.md CHANGED
@@ -1,3 +1,22 @@
1
- # Temporary Holding Version
1
+ # Visual Workflow & Experiment DAG · WireDag (for DeepSeek Harness)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **Wire polyglot modules into layered experiment DAGs — right inside the DeepSeek Harness sidebar.**
4
+
5
+ Click the **`WireDag`** button on the document preview toolbar to open the WireDag canvas for your session's working directory:
6
+
7
+ - **One DAG, many languages**: SQL, Python, C++, Rust, Go, TypeScript and Shell modules in the same `*.wiredag.yaml`, exchanging tables as Apache Arrow files.
8
+ - **Incremental runs**: a content-addressed cache skips every node whose code, parameters and inputs did not change; node states are shown in color as the run progresses.
9
+ - **Layered graphs**: fold nodes into groups, nest them, and drill in on the canvas.
10
+ - **Pipeline audit**: checks for integer overflow across languages, normalization fitted before the train/eval split, and other data-leakage patterns, with one-click suggested fixes.
11
+ - **100% local**: your code, experiment files, cached data and logs stay on your machine.
12
+
13
+ ## Install & Usage
14
+
15
+ ```bash
16
+ dsh plugin --profile web add dsh-wiredag
17
+ ```
18
+
19
+ 1. Preview any file of your project in DeepSeek Harness and click **`WireDag`** in the top-right preview toolbar to open the canvas in the right sidebar.
20
+ 2. Requires **Node.js 22.13 or newer** for the Harness host process. Python modules need `python3` (or `uv`); native modules need the matching compiler.
21
+ 3. Includes a **7-day free trial** (no sign-in required). After that, WireDag Pro is a one-time purchase you can make from the canvas.
22
+ 4. Website: https://zhiyuanv.com/wiredag.html
package/README.zh.md ADDED
@@ -0,0 +1,22 @@
1
+ # 可视化模块试验流 · WireDag(DeepSeek Harness 插件)
2
+
3
+ **在 DeepSeek Harness 右侧栏里,把多语言模块连成可分层折叠的试验图。**
4
+
5
+ 在文档预览工具栏点击 **`WireDag`** 按钮,即可在右侧分栏打开当前会话工作目录的 WireDag 画布:
6
+
7
+ - **多语言混连**:SQL、Python、C++、Rust、Go、TypeScript、Shell 模块写在同一个 `*.wiredag.yaml` 里,用 Apache Arrow 文件交换数据表。
8
+ - **增量重跑**:代码、参数、输入都没变的节点直接复用内容寻址缓存;运行时每个节点的状态彩色显示。
9
+ - **分层折叠**:把节点成组、嵌套,在画布上逐层展开查看。
10
+ - **流水线体检**:自动发现跨语言整数溢出、切分训练集之前就做了归一化等数据穿越问题,修复建议一键采纳。
11
+ - **纯本机处理**:源码、试验文件、缓存数据与日志全部留在本机,绝不上传云端。
12
+
13
+ ## 安装与使用
14
+
15
+ ```bash
16
+ dsh plugin --profile web add dsh-wiredag
17
+ ```
18
+
19
+ 1. 在 DeepSeek Harness 中预览项目里任意文件,点击右上角预览工具栏的 **`WireDag`** 按钮,在右侧分栏打开画布。
20
+ 2. Harness 本机进程需要 **Node.js 22.13 或更新版本**。Python 模块需要 `python3`(或 `uv`),原生模块需要相应的编译器。
21
+ 3. 首次使用享有 **7 天免登录免费试用**;之后可在画布里一次买断 WireDag Pro。
22
+ 4. 官方网站:https://zhiyuanv.com/wiredag.html
package/client.js ADDED
@@ -0,0 +1,210 @@
1
+ window.__ModuleLoader__.load({ id: "dsh-wiredag", factory: require => { const module = { exports: {} }; const exports = module.exports;
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // packages/harness/src/client.mjs
22
+ var client_exports = {};
23
+ __export(client_exports, {
24
+ apply: () => apply,
25
+ inject: () => inject
26
+ });
27
+ module.exports = __toCommonJS(client_exports);
28
+ var import_react = require("react");
29
+
30
+ // packages/harness/src/shared.mjs
31
+ var packageName = true ? "dsh-wiredag" : "dsh-wiredag";
32
+ var kind = "wiredag-canvas";
33
+ var actionSlot = "sidebar.right.tab.document.actions";
34
+ var bodySlot = "sidebar.right.pane.tab";
35
+ var route = "/wiredag-harness/session";
36
+ var prefix = "dsh-resource://file/session/";
37
+ function fileAddress(sessionId, absolutePath) {
38
+ const path = /^(?:[A-Z]:[\\/]|\\\\)/i.test(absolutePath) ? absolutePath.replaceAll("\\", "/") : absolutePath;
39
+ return prefix + encodeURIComponent(sessionId) + "/" + path.split("/").map(encodeURIComponent).join("/");
40
+ }
41
+ function selectedSession(address) {
42
+ if (typeof address !== "string" || !address.startsWith(prefix)) return;
43
+ try {
44
+ const sessionId = decodeURIComponent(address.slice(prefix.length).split("/")[0]);
45
+ if (sessionId) return { sessionId };
46
+ } catch {
47
+ }
48
+ }
49
+ var PANEL_URL = /^http:\/\/127\.0\.0\.1:\d+\/\?token=[A-Za-z0-9_-]{16,}$/;
50
+
51
+ // packages/harness/src/client.mjs
52
+ var inject = ["slots", "sidebarRight", "sidebarRightTabs"];
53
+ var zh = () => {
54
+ const docLang = typeof document !== "undefined" ? document.documentElement?.lang || "" : "";
55
+ const navLang = typeof navigator !== "undefined" ? navigator.language || "" : "";
56
+ return /^zh(?:[-_.]|$)/i.test(docLang || navLang);
57
+ };
58
+ var label = () => zh() ? "\u7528 WireDag \u6253\u5F00\u8BD5\u9A8C\u753B\u5E03" : "Open the experiment canvas in WireDag";
59
+ var desktop = () => location.protocol === "dsh-app:" && location.hostname === "app";
60
+ var actionClass = "wiredag-harness-open";
61
+ var LEASE_RENEW_MS = 5 * 6e4;
62
+ var request = (method, body) => fetch(route, {
63
+ method,
64
+ headers: { "content-type": "application/json" },
65
+ body: JSON.stringify(body),
66
+ keepalive: method === "DELETE"
67
+ });
68
+ function apply(ctx) {
69
+ const sessions = /* @__PURE__ */ new Map();
70
+ function session(tab) {
71
+ if (sessions.has(tab.signal)) return sessions.get(tab.signal).opened;
72
+ if (tab.signal.aborted) return Promise.reject(new Error("Closed WireDag tab"));
73
+ const opened = request("POST", { address: tab.contentId }).then(async (response) => {
74
+ if (!response.ok) throw new Error("WireDag panel is unavailable");
75
+ const data = await response.json();
76
+ if (typeof data.lease !== "string" || typeof data.url !== "string" || !PANEL_URL.test(data.url)) {
77
+ throw new Error("Invalid WireDag panel address");
78
+ }
79
+ return data;
80
+ });
81
+ const renewal = setInterval(() => {
82
+ void opened.then(({ lease }) => request("POST", { action: "renew", lease })).catch(() => {
83
+ });
84
+ }, LEASE_RENEW_MS);
85
+ void opened.catch(() => {
86
+ clearInterval(renewal);
87
+ tab.signal.removeEventListener("abort", release);
88
+ sessions.delete(tab.signal);
89
+ });
90
+ function release() {
91
+ clearInterval(renewal);
92
+ tab.signal.removeEventListener("abort", release);
93
+ sessions.delete(tab.signal);
94
+ void opened.then(({ lease }) => request("DELETE", { lease })).catch(() => {
95
+ });
96
+ }
97
+ sessions.set(tab.signal, { opened, release });
98
+ tab.signal.addEventListener("abort", release, { once: true });
99
+ return opened;
100
+ }
101
+ function OpenAction({ absolutePath }) {
102
+ if (typeof absolutePath !== "string" || !absolutePath || !desktop() && !["127.0.0.1", "[::1]", "localhost"].includes(location.hostname)) return null;
103
+ return (0, import_react.createElement)("button", {
104
+ type: "button",
105
+ className: actionClass,
106
+ title: label(),
107
+ "aria-label": label(),
108
+ onClick(event) {
109
+ const sessionId = ctx.sidebarRight.mounted.getSnapshot();
110
+ if (!sessionId) return;
111
+ const target = ctx.sidebarRight.focusedTarget(event.currentTarget);
112
+ const paneId = target?.host === "dock" ? target.paneId : void 0;
113
+ ctx.sidebarRight.openResource(fileAddress(sessionId, absolutePath), { kind, paneId, preferNewPane: true });
114
+ }
115
+ }, "WireDag");
116
+ }
117
+ function PanelBody({ useTabInfo }) {
118
+ const { tab } = useTabInfo();
119
+ const [view, setView] = (0, import_react.useState)({});
120
+ const frame = (0, import_react.useRef)(null);
121
+ (0, import_react.useEffect)(() => {
122
+ let mounted = true;
123
+ void session(tab).then(
124
+ ({ url }) => {
125
+ if (mounted) setView({ signal: tab.signal, url });
126
+ },
127
+ () => {
128
+ if (mounted) setView({ signal: tab.signal, failed: true });
129
+ }
130
+ );
131
+ return () => {
132
+ mounted = false;
133
+ };
134
+ }, [tab.signal, tab.contentId]);
135
+ (0, import_react.useEffect)(() => {
136
+ if (!desktop() || view.signal !== tab.signal || !view.url) return;
137
+ const origin = new URL(view.url).origin;
138
+ function openExternal(event) {
139
+ const { source, data } = event;
140
+ if (!source || source !== frame.current?.contentWindow || event.origin !== origin || data?.type !== "wiredag:open-external" || typeof data.id !== "string" || tab.signal.aborted) return;
141
+ let ok = false;
142
+ try {
143
+ if (typeof data.url === "string" && new URL(data.url).protocol === "https:") {
144
+ window.open(data.url, "_blank", "noopener,noreferrer");
145
+ ok = true;
146
+ }
147
+ } catch {
148
+ }
149
+ source.postMessage({ type: "wiredag:open-external", id: data.id, ok }, origin);
150
+ }
151
+ window.addEventListener("message", openExternal);
152
+ return () => window.removeEventListener("message", openExternal);
153
+ }, [tab.signal, view]);
154
+ if (view.signal !== tab.signal || !view.url) {
155
+ const failed = view.signal === tab.signal && view.failed;
156
+ const message = failed ? zh() ? "\u65E0\u6CD5\u6253\u5F00\u753B\u5E03\u3002\u8BF7\u5728\u672C\u673A\u7684\u5DE5\u4F5C\u76EE\u5F55\u91CC\u4F7F\u7528 WireDag\u3002" : "Could not open the canvas. Use WireDag in a local working directory." : zh() ? "\u6B63\u5728\u6253\u5F00 WireDag\u2026" : "Opening WireDag\u2026";
157
+ return (0, import_react.createElement)("p", { role: failed ? "alert" : "status", style: { padding: 16 } }, message);
158
+ }
159
+ return (0, import_react.createElement)("iframe", {
160
+ ref: frame,
161
+ src: desktop() ? `${view.url}&external=host` : view.url,
162
+ title: "WireDag",
163
+ referrerPolicy: "no-referrer",
164
+ sandbox: "allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox",
165
+ style: { display: "block", width: "100%", height: "100%", border: 0 }
166
+ });
167
+ }
168
+ ctx.effect(() => ctx.sidebarRightTabs.register({
169
+ id: packageName,
170
+ kind,
171
+ canOpen: (address) => !!selectedSession(address),
172
+ title: () => "WireDag",
173
+ keepMounted: true
174
+ }), "WireDag sidebar tab");
175
+ ctx.effect(() => ctx.slots.inject(actionSlot, () => ctx.slots.register({
176
+ name: actionSlot,
177
+ id: packageName
178
+ }, OpenAction)), "WireDag entry");
179
+ ctx.effect(() => ctx.slots.inject(bodySlot, () => ctx.slots.register({
180
+ name: bodySlot,
181
+ key: packageName
182
+ }, PanelBody)), "WireDag sidebar panel");
183
+ ctx.effect(() => {
184
+ const style = document.createElement("style");
185
+ style.textContent = `
186
+ .${actionClass} { display: inline-flex; align-items: center; gap: 5px; height: 26px;
187
+ padding: 0 9px; border: 1px solid color-mix(in srgb, currentColor 20%, transparent); border-radius: 6px;
188
+ background: color-mix(in srgb, currentColor 8%, transparent); color: inherit;
189
+ font: inherit; font-size: 12px; font-weight: 500; white-space: nowrap; cursor: pointer; }
190
+ .${actionClass}:hover { background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 14%, transparent)); }
191
+ .${actionClass}:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
192
+ `;
193
+ document.head.append(style);
194
+ return () => style.remove();
195
+ }, "WireDag entry style");
196
+ ctx.effect(() => {
197
+ const releaseAll = () => {
198
+ for (const { release } of sessions.values()) release();
199
+ };
200
+ const pageHidden = (event) => {
201
+ if (!event.persisted) releaseAll();
202
+ };
203
+ window.addEventListener("pagehide", pageHidden);
204
+ return () => {
205
+ window.removeEventListener("pagehide", pageHidden);
206
+ releaseAll();
207
+ };
208
+ }, "WireDag tab sessions");
209
+ }
210
+ return module.exports; } });
@@ -0,0 +1,3 @@
1
+ - insert:
2
+ - id: wiredag
3
+ name: dsh-wiredag