@guandata/guanetl 0.1.27 → 0.1.29
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 +12 -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/guanetl-darwin-arm64 +0 -0
- package/binaries/guanetl-darwin-x64 +0 -0
- package/binaries/guanetl-linux-arm64 +0 -0
- package/binaries/guanetl-linux-x64 +0 -0
- package/binaries/guanetl-win32-x64.exe +0 -0
- package/package.json +1 -1
- package/skills/guanetl/SKILL.md +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## @guandata/guanetl 0.1.29 - 2026-08-25
|
|
4
|
+
|
|
5
|
+
- ETL 调度配置适配会拦截原生 PUT 请求的客户网络代理,提升受限网络环境中的保存成功率。
|
|
6
|
+
- 支持企业 OIDC 认证上下文,并同步升级底层请求兼容能力。
|
|
7
|
+
|
|
8
|
+
## @guandata/guanetl 0.1.28 - 2026-08-20
|
|
9
|
+
|
|
10
|
+
- 改进 npm 安装后的自动 Skill 安装反馈,便于判断安装结果和后续处理。
|
|
11
|
+
- 修复 Skill 安装/删除确认流程的兼容性问题,降低交互式安装失败风险。
|
|
12
|
+
- 优化 Windows 环境下的 CLI 启动兼容性。
|
|
13
|
+
- 同步更新安装与使用说明。
|
|
14
|
+
|
|
3
15
|
## @guandata/guanetl 0.1.27
|
|
4
16
|
|
|
5
17
|
- 优化 ETL 首次运行后的输出校验,临时输出数据集完成生成后再进行字段检查,首次运行更稳定。
|
package/README.md
CHANGED
|
@@ -47,10 +47,20 @@ guanetl save --dir <work_dir>
|
|
|
47
47
|
guanetl install-skill
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
> `npm install -g` / `npm link`
|
|
50
|
+
> `npm install -g --foreground-scripts @guandata/guanetl` / `npm link --foreground-scripts` 会通过 postinstall 自动刷新 skill,并显示明确的成功、失败或跳过结果;上述 `guanetl install-skill` 仅用于失败后的手动修复或排查。CI 等无需 skill 的环境可设 `GUAN_SKIP_INSTALL_SKILL=1` 跳过。
|
|
51
51
|
|
|
52
52
|
## 版本更新
|
|
53
53
|
|
|
54
|
+
### @guandata/guanetl 0.1.29
|
|
55
|
+
|
|
56
|
+
- ETL 调度配置适配受限网络代理,提升客户环境中的保存成功率。
|
|
57
|
+
- 支持企业 OIDC 认证上下文,并同步升级底层请求兼容能力。
|
|
58
|
+
|
|
59
|
+
### @guandata/guanetl 0.1.28
|
|
60
|
+
|
|
61
|
+
- 改进 Skill 自动安装反馈和删除确认流程。
|
|
62
|
+
- 优化 Windows 环境下的 CLI 启动兼容性。
|
|
63
|
+
|
|
54
64
|
### @guandata/guanetl 0.1.27
|
|
55
65
|
|
|
56
66
|
- 优化 ETL 首次运行后的输出校验,临时输出数据集完成生成后再进行字段检查,首次运行更稳定。
|
|
@@ -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": "guanetl-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 guanetl 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/guanetl/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: guanetl
|
|
3
3
|
description: 当用户要新建、修改、调试、定时调度、立即执行、取消执行、保存发布观远 BI / Guandata 的 ETL,或给出 ETL ID、dataFlowId、etl.go、meta.json、SQL 节点、dsId、节点报错时,优先使用这个 skill。即使用户只说"帮我改一下这个 ETL""这个 ETL 导出失败""新建一个观远 ETL""把这个 ETL 配成每天 2 点跑""取消正在跑的 ETL""保存后立即执行并等完成",也要主动使用。它把线上 ETL 拉到本地工作目录,约束 AI 只编辑 etl/ 下文件,并完成 create/edit → export → preview → save → run/schedule 闭环。查 ETL/数据集元信息走 guancli;数据源/数据集 CRUD 走 guands。
|
|
4
|
-
compatibility: "Requires Node.js 14+. Install via npm link (local) or npm install -g @guandata/guanetl (from internal Nexus registry). CLI command: guanetl."
|
|
4
|
+
compatibility: "Requires Node.js 14+. Install via npm link --foreground-scripts (local) or npm install -g --foreground-scripts @guandata/guanetl (from internal Nexus registry) so the AI skill refresh result is visible. CLI command: guanetl."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# guanetl
|
|
@@ -32,7 +32,7 @@ compatibility: "Requires Node.js 14+. Install via npm link (local) or npm instal
|
|
|
32
32
|
|
|
33
33
|
### 0. 先确认前置条件
|
|
34
34
|
|
|
35
|
-
- 确认底层 CLI
|
|
35
|
+
- 确认底层 CLI 认证正常:普通 guancli profile 先执行 `guancli auth use <profile>`;上游托管 OIDC Token 时在当前进程同时设置 `GUANCLI_OIDC_BASE_URL`/`GUANCLI_OIDC_ACCESS_TOKEN`,无需本地 profile;guancli-lite 设置 `GUANCLI_BASE_URL`/`GUANCLI_TOKEN`。
|
|
36
36
|
- 如果用户指定的资源(目录、数据集、ETL)搜索不到,先用 `guancli auth list` 列出所有可用环境,提示用户确认是否需要切换环境。
|
|
37
37
|
|
|
38
38
|
### Artifact contract(本地可测契约)
|