@guandata/guanwf 0.1.825 → 0.1.827
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/CHANGELOG.md +11 -0
- package/README.md +11 -1
- package/bin/install-env.js +73 -0
- package/bin/postinstall.js +5 -2
- package/bin/run.js +6 -1
- package/binaries/guanwf-darwin-arm64 +0 -0
- package/binaries/guanwf-darwin-x64 +0 -0
- package/binaries/guanwf-linux-arm64 +0 -0
- package/binaries/guanwf-linux-x64 +0 -0
- package/binaries/guanwf-win32-x64.exe +0 -0
- package/package.json +1 -1
- package/skills/guanwf/SKILL.md +10 -3
- package/skills/guanwf/references/WORKFLOW_NODES.md +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## @guandata/guanwf 0.1.827 - 2026-08-20
|
|
4
|
+
|
|
5
|
+
- 改进 npm 安装后的 Skill 自动安装反馈,安装结果与后续处理提示更清晰。
|
|
6
|
+
- 修复安装/删除 Skill 时的确认交互与 Windows CLI 兼容问题,提升跨平台可用性。
|
|
7
|
+
- 同步更新安装命令与使用说明。
|
|
8
|
+
|
|
9
|
+
## @guandata/guanwf 0.1.826 - 2026-08-07
|
|
10
|
+
|
|
11
|
+
- 完善工作流输出落位闭环,支持目录预检与目标资源存在性判定,提升保存和执行流程的可靠性。
|
|
12
|
+
- 修复工作流输出绑定中的字段错位问题,确保数据集同步与输出配置正确关联。
|
|
13
|
+
- 更新工作流节点使用说明,补充输出落位相关行为和操作指引。
|
|
3
14
|
## @guandata/guanwf 0.1.825 - 2026-08-05
|
|
4
15
|
|
|
5
16
|
- Python 节点输出支持绑定已有数据集,可直接覆盖或追加到指定数据集,避免重复创建输出并保持下游引用稳定。
|
package/README.md
CHANGED
|
@@ -43,10 +43,20 @@ DatasetNode 刷新目标,应使用 SubWorkflowNode 调用产出工作流。参
|
|
|
43
43
|
guanwf install-skill
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
> `npm install -g` / `npm link`
|
|
46
|
+
> `npm install -g --foreground-scripts @guandata/guanwf` / `npm link --foreground-scripts` 会通过 postinstall 自动刷新 skill,并显示明确的成功、失败或跳过结果;上述 `guanwf install-skill` 仅用于失败后的手动修复或排查。CI 等无需 skill 的环境可设 `GUAN_SKIP_INSTALL_SKILL=1` 跳过。
|
|
47
47
|
|
|
48
48
|
## 版本更新
|
|
49
49
|
|
|
50
|
+
### @guandata/guanwf 0.1.827
|
|
51
|
+
|
|
52
|
+
- 改进 Skill 自动安装反馈和删除确认流程。
|
|
53
|
+
- 优化 Windows 环境下的 CLI 启动兼容性。
|
|
54
|
+
|
|
55
|
+
### @guandata/guanwf 0.1.826
|
|
56
|
+
|
|
57
|
+
- 完善工作流输出落位校验,保存和执行时能更准确地确认目标数据集。
|
|
58
|
+
- 修复输出绑定中的字段错位问题,提升数据集同步准确性。
|
|
59
|
+
|
|
50
60
|
### @guandata/guanwf 0.1.825
|
|
51
61
|
|
|
52
62
|
- Python 节点输出支持绑定已有数据集,可直接覆盖或追加到指定数据集,避免重复创建输出并保持下游引用稳定。
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require("child_process");
|
|
4
|
+
|
|
5
|
+
const SANITIZED_MARKER = "GUAN_INSTALL_ENV_SANITIZED";
|
|
6
|
+
const SAFE_DELETE_TARGET = String.raw`(?:"(?:[^"]*[\\/])?genie-safe-delete\.cjs"|'(?:[^']*[\\/])?genie-safe-delete\.cjs'|(?:[^\s"']*[\\/])?genie-safe-delete\.cjs)`;
|
|
7
|
+
|
|
8
|
+
function envKey(env, expected) {
|
|
9
|
+
return Object.keys(env).find((key) => key.toLowerCase() === expected.toLowerCase());
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function stripWorkBuddySafeDelete(nodeOptions) {
|
|
13
|
+
const pattern = new RegExp(
|
|
14
|
+
String.raw`(^|\s)(?:--require|-r)(?:=|\s+)${SAFE_DELETE_TARGET}(?=\s|$)(?:\s+|$)`,
|
|
15
|
+
"gi"
|
|
16
|
+
);
|
|
17
|
+
let removed = false;
|
|
18
|
+
const value = String(nodeOptions || "").replace(pattern, (_, prefix) => {
|
|
19
|
+
removed = true;
|
|
20
|
+
return prefix ? " " : "";
|
|
21
|
+
}).trim();
|
|
22
|
+
return { value, removed };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function hasWorkBuddySafeDelete(env = process.env) {
|
|
26
|
+
const key = envKey(env, "NODE_OPTIONS");
|
|
27
|
+
return Boolean(key && stripWorkBuddySafeDelete(env[key]).removed);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function createInstallChildEnv(env = process.env) {
|
|
31
|
+
const childEnv = { ...env };
|
|
32
|
+
for (const key of Object.keys(childEnv)) {
|
|
33
|
+
if (key.toLowerCase() === "npm_config_global") {
|
|
34
|
+
delete childEnv[key];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const nodeOptionsKey = envKey(childEnv, "NODE_OPTIONS");
|
|
39
|
+
if (nodeOptionsKey) {
|
|
40
|
+
const cleaned = stripWorkBuddySafeDelete(childEnv[nodeOptionsKey]);
|
|
41
|
+
if (cleaned.removed) {
|
|
42
|
+
if (cleaned.value) childEnv[nodeOptionsKey] = cleaned.value;
|
|
43
|
+
else delete childEnv[nodeOptionsKey];
|
|
44
|
+
childEnv[SANITIZED_MARKER] = "1";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return childEnv;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function reexecInstallCommand(scriptPath, args, options = {}) {
|
|
51
|
+
const env = options.env || process.env;
|
|
52
|
+
if (env[SANITIZED_MARKER] === "1" || !hasWorkBuddySafeDelete(env)) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const spawn = options.spawn || spawnSync;
|
|
57
|
+
const exit = options.exit || process.exit;
|
|
58
|
+
const nodePath = options.nodePath || process.execPath;
|
|
59
|
+
const result = spawn(nodePath, [scriptPath, ...args], {
|
|
60
|
+
stdio: "inherit",
|
|
61
|
+
env: createInstallChildEnv(env),
|
|
62
|
+
shell: false,
|
|
63
|
+
});
|
|
64
|
+
if (result.error) throw result.error;
|
|
65
|
+
exit(result.status == null ? 1 : result.status);
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
module.exports = {
|
|
70
|
+
createInstallChildEnv,
|
|
71
|
+
hasWorkBuddySafeDelete,
|
|
72
|
+
reexecInstallCommand,
|
|
73
|
+
};
|
package/bin/postinstall.js
CHANGED
|
@@ -41,18 +41,21 @@ function main() {
|
|
|
41
41
|
);
|
|
42
42
|
if (result.error || result.status !== 0) {
|
|
43
43
|
console.warn(
|
|
44
|
-
`[${CLI_NAME}] postinstall:
|
|
44
|
+
`[${CLI_NAME}] postinstall: AI skill update FAILED` +
|
|
45
45
|
(result.error ? ` (${result.error.message})` : ` (exit ${result.status})`) +
|
|
46
46
|
`; run \`${CLI_NAME} install-skill\` manually to refresh SKILL.md.`
|
|
47
47
|
);
|
|
48
|
+
return;
|
|
48
49
|
}
|
|
50
|
+
console.log(`[${CLI_NAME}] postinstall: AI skill updated successfully.`);
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
try {
|
|
52
54
|
main();
|
|
53
55
|
} catch (err) {
|
|
54
56
|
console.warn(
|
|
55
|
-
`[${CLI_NAME}] postinstall: ${err.message};
|
|
57
|
+
`[${CLI_NAME}] postinstall: AI skill update FAILED (${err.message}); ` +
|
|
58
|
+
`run \`${CLI_NAME} install-skill\` manually.`
|
|
56
59
|
);
|
|
57
60
|
}
|
|
58
61
|
process.exit(0);
|
package/bin/run.js
CHANGED
|
@@ -6,6 +6,7 @@ const { execFileSync, execSync, spawnSync } = require("child_process");
|
|
|
6
6
|
const path = require("path");
|
|
7
7
|
const fs = require("fs");
|
|
8
8
|
const os = require("os");
|
|
9
|
+
const { createInstallChildEnv, reexecInstallCommand } = require("./install-env");
|
|
9
10
|
|
|
10
11
|
const PLATFORM_MAP = {
|
|
11
12
|
"darwin-arm64": "guanwf-darwin-arm64",
|
|
@@ -111,6 +112,7 @@ function resolveNpxInvocation() {
|
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
if (process.argv[2] === "install-skill") {
|
|
115
|
+
reexecInstallCommand(__filename, process.argv.slice(2));
|
|
114
116
|
const pkgRoot = path.join(__dirname, "..");
|
|
115
117
|
const extraArgs = process.argv.slice(3);
|
|
116
118
|
const args = [
|
|
@@ -128,8 +130,11 @@ if (process.argv[2] === "install-skill") {
|
|
|
128
130
|
console.log("Installing guanwf to AI coding assistants...");
|
|
129
131
|
const npxInvocation = resolveNpxInvocation();
|
|
130
132
|
const result = spawnSync(npxInvocation.command, [...npxInvocation.argsPrefix, ...args], {
|
|
133
|
+
// Avoid leaking project-only Agent markers (for example PromptScript) from
|
|
134
|
+
// the caller's cwd into this global installation.
|
|
135
|
+
cwd: pkgRoot,
|
|
131
136
|
stdio: "inherit",
|
|
132
|
-
env: process.env,
|
|
137
|
+
env: createInstallChildEnv(process.env),
|
|
133
138
|
shell: false,
|
|
134
139
|
});
|
|
135
140
|
if (result.error) throw result.error;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/skills/guanwf/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: guanwf
|
|
3
3
|
description: 当用户要创建、编辑、保存工作流引擎中的工作流(含数据流节点、Python 节点、子工作流编排、参数赋值等多节点 DAG),或需要预览数据流节点、校验/试运行 Python 脚本、运行工作流、配置定时调度、从失败处恢复续跑,或需要查询工作流/数据流列表和详情时使用。也适用于把一批已有作业工作流按依赖串成统一调度的主工作流(编排):从血缘自动推导依赖生成编排(deps plan)、对账编排依赖与血缘是否一致(deps verify)、配置 cron 调度上下线(schedule)、失败后增量恢复(run --recover)。数据流是 BI ETL 的扩展,运行在独立的工作流引擎中。适用于用户说"创建一个数据流""创建一个带 Python 节点的工作流""编辑这个工作流""保存数据流""预览数据流节点""运行工作流""验证这个 Python 脚本能不能跑""列出所有数据流""查看这个工作流的定义""把这批作业串起来统一调度""按血缘生成调度依赖""给工作流配个每天凌晨的调度""调度先下线""编排里有作业挂了修好后接着跑"等场景。
|
|
4
|
-
compatibility: "Requires Node.js 14+. Install via npm link (local) or npm install -g @guandata/guanwf (from internal Nexus registry). CLI command: guanwf."
|
|
4
|
+
compatibility: "Requires Node.js 14+. Install via npm link --foreground-scripts (local) or npm install -g --foreground-scripts @guandata/guanwf (from internal Nexus registry) so the AI skill refresh result is visible. CLI command: guanwf."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# guanwf
|
|
@@ -348,8 +348,15 @@ NEED_FAULT_TOLERANCE。适用于长链路编排中
|
|
|
348
348
|
本地快照里有、导出里删了的节点 → 删除;服务端有、本地快照不知道的节点(他人并发新增)→
|
|
349
349
|
保留并打印提示
|
|
350
350
|
5. dataflowJson 按 dataflow id 经 etlmerge 做 actions 字段级合并(成员判断同上)
|
|
351
|
-
6. 调用 `/process/save-draft` 或 `/process/save
|
|
352
|
-
|
|
351
|
+
6. 调用 `/process/save-draft` 或 `/process/save`,成功后把**本次提交的定义**刷新为本地快照
|
|
352
|
+
并同步进 `python.json`(不是服务端回写值——服务端在保存/运行后对输出 dataSource/dsId
|
|
353
|
+
等字段的回写需要重新 `guanwf edit` 才能拿到),随后回读服务端做输出落位诊断:
|
|
354
|
+
目录被纠正时提示 `save.output_dir_rectified`,输出尚未物化时提示
|
|
355
|
+
`save.output_pending_materialization`(此时 dsId 是临时值,首次成功运行前每次保存都会
|
|
356
|
+
重新生成,勿用于下游引用)。`run` 等待成功后会校验所有输出的数据集实体线上存在
|
|
357
|
+
(`created=true` 直接通过;`created=false` 会查询数据集本身——绑定其他流程创建的
|
|
358
|
+
已有数据集时 DSL 要求保持 `Created=false`,该状态合法),数据集不存在的输出会直接
|
|
359
|
+
报错(后端存在"脚本未产出输出时静默跳过注册但任务 SUCCESS"的路径)。
|
|
353
360
|
|
|
354
361
|
因此用户和 AI 都不需要手写服务端保存 payload。多人/多端并发修改同一工作流时,以服务端
|
|
355
362
|
最新版本为基底合并,不会把别人新加的节点冲掉;但同一节点的并发修改仍是后保存者覆盖。
|
|
@@ -67,10 +67,13 @@ node_1006 := LoadNodeFromFile("node_1006.json", node_1005)
|
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
配置说明:
|
|
70
|
-
- `OutputDsId`: 输出数据集 ID
|
|
70
|
+
- `OutputDsId`: 输出数据集 ID(序列化为服务端的 `dsId` 键;绑定已有数据集时填写)
|
|
71
|
+
- `ParentDirID`: 输出数据集目录(DATA_SET 目录树 id,新建输出必填,缺失会导致运行期报错)
|
|
71
72
|
- `UpdateMode`: `APPEND`(追加)或 `UPSERT`(更新插入)
|
|
72
73
|
- `PrimaryKeys`: UPSERT 模式的主键列
|
|
73
74
|
|
|
75
|
+
推荐优先使用透传模式(LoadNodeFromFile),可保留服务端节点的全部配置。
|
|
76
|
+
|
|
74
77
|
## 原生 DSL 节点
|
|
75
78
|
|
|
76
79
|
以下节点有结构化的 Go DSL 函数,import 后会生成可直接编辑的代码。
|