@fieldwangai/agentflow 0.1.160 → 0.1.163
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/bin/lib/auth.mjs +231 -14
- package/bin/lib/catalog-flows.mjs +2 -0
- package/bin/lib/cli-auth-page.mjs +103 -0
- package/bin/lib/flow-dsl/codegen.mjs +23 -2
- package/bin/lib/flow-dsl/lint.mjs +44 -0
- package/bin/lib/flow-dsl/parser.mjs +68 -1
- package/bin/lib/marketplace-usage.mjs +218 -0
- package/bin/lib/marketplace.mjs +183 -3
- package/bin/lib/node-package-manifest.mjs +1 -1
- package/bin/lib/skill-runtime.mjs +6 -0
- package/bin/lib/spaces.mjs +200 -0
- package/bin/lib/table.mjs +2 -3
- package/bin/lib/ui-server.mjs +471 -84
- package/bin/lib/workspace-draft.mjs +74 -0
- package/bin/lib/workspace-routes.mjs +484 -4
- package/bin/lib/workspace-server.mjs +373 -30
- package/bin/lib/workspace-state.mjs +2 -1
- package/builtin/nodes/agent_subAgent.md +5 -1
- package/builtin/nodes/context_bundle.md +44 -0
- package/builtin/nodes/context_knowledge.md +29 -0
- package/builtin/nodes/context_skills.md +29 -0
- package/builtin/nodes/context_workspace.md +36 -0
- package/builtin/nodes/control_while.md +12 -5
- package/builtin/nodes/tool_git_worktree_load.md +4 -3
- package/builtin/pipelines/new/workspace.flow.js +1 -1
- package/builtin/web-ui/dist/assets/{WorkflowAssistantThread-Bfo9Ythw.js → WorkflowAssistantThread-DmhIgoD7.js} +1 -1
- package/builtin/web-ui/dist/assets/index-CI9J6Unt.js +873 -0
- package/builtin/web-ui/dist/assets/index-DY5vE7v1.css +1 -0
- package/builtin/web-ui/dist/index.html +2 -2
- package/package.json +5 -1
- package/shared/slot-types.js +1 -0
- package/skills/agentflow-author-flow/SKILL.md +81 -8
- package/skills/agentflow-author-flow/agents/openai.yaml +3 -3
- package/skills/agentflow-cli/SKILL.md +179 -27
- package/skills/agentflow-cli/agents/openai.yaml +2 -2
- package/skills/agentflow-cli/runtime/bin/lib/skill-runtime.mjs +14879 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/agent_subAgent.md +38 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/context_bundle.md +44 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/context_knowledge.md +29 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/context_skills.md +29 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/context_workspace.md +36 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_agent_toBool.md +26 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_anyOne.md +19 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_cancelled.md +26 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_cd_workspace.md +50 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_delay.md +31 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_end.md +13 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_if.md +21 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_interval_loop.md +55 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_load_mcp.md +24 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_load_skills.md +35 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_parse_json.md +25 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_start.md +13 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_subflow_call.md +27 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_toBool.md +27 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_user_workspace.md +24 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_wait_until.md +34 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/control_while.md +131 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_ascii.md +24 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_chart.md +32 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_code.md +39 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_html.md +32 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_image.md +36 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_markdown.md +24 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_mermaid.md +24 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_react_app.md +53 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/display_table.md +32 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/provide_bool.md +14 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/provide_file.md +14 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/provide_json.md +14 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/provide_password.md +14 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/provide_str.md +14 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_display_share_link.md +47 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_get_env.md +20 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_git_checkout.md +70 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_git_worktree_load.md +74 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_git_worktree_unload.md +52 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_gitlab_create_mr.md +114 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_jenkins_build.md +67 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_load_key.md +26 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_nodejs.md +52 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_print.md +21 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_save_key.md +26 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_set_run_env.md +38 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_user_ask.md +27 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_user_check.md +26 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_wecom_send_app_markdown.md +57 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/tool_wecom_send_group_markdown.md +45 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/workspace_one_click_task.md +44 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/workspace_run.md +16 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/workspace_scheduled_run.md +16 -0
- package/skills/agentflow-cli/runtime/builtin/nodes/workspace_subflow_input.md +14 -0
- package/skills/agentflow-cli/runtime/package.json +6 -0
- package/skills/agentflow-cli/scripts/agentflow-auth-store.mjs +113 -0
- package/skills/agentflow-cli/scripts/agentflow-cli.mjs +457 -28
- package/skills/agentflow-cli/scripts/agentflow-runtime.mjs +11 -4
- package/skills/agentflow-flow-add-instances/SKILL.md +2 -2
- package/skills/agentflow-flow-dsl/SKILL.md +73 -8
- package/skills/agentflow-flow-dsl/agents/openai.yaml +2 -2
- package/skills/agentflow-flow-dsl/references/node-calls.md +6 -2
- package/skills/agentflow-flow-dsl/references/subflow-authoring.md +34 -7
- package/skills/agentflow-flow-edit-node-fields/SKILL.md +3 -3
- package/skills/agentflow-flow-recipes/SKILL.md +1 -1
- package/skills/agentflow-flow-recipes/references/recipes.md +1 -2
- package/skills/agentflow-flow-sync-ui/SKILL.md +1 -1
- package/skills/agentflow-node-dsl/SKILL.md +5 -13
- package/skills/agentflow-node-reference/references/builtin-nodes.md +37 -5
- package/skills/agentflow-workspace-markdown/SKILL.md +1 -1
- package/builtin/web-ui/dist/assets/index-XbeI5foV.js +0 -872
- package/builtin/web-ui/dist/assets/index-e1omCEau.css +0 -1
- package/skills/agentflow-workspace-graph/SKILL.md +0 -85
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
# 内置节点:Scheduled Run
|
|
3
|
+
runtime: native
|
|
4
|
+
type: control
|
|
5
|
+
description: 定时运行入口。与 Run 相同的执行语义,区别是由调度器按节点 body 中的 JSON 排程配置触发。
|
|
6
|
+
displayName: Scheduled Run
|
|
7
|
+
input:
|
|
8
|
+
- type: node
|
|
9
|
+
name: prev
|
|
10
|
+
default: ""
|
|
11
|
+
output:
|
|
12
|
+
- type: node
|
|
13
|
+
name: next
|
|
14
|
+
default: ""
|
|
15
|
+
---
|
|
16
|
+
Run the downstream workspace subgraph on a schedule.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
# 内置节点:子流程输入
|
|
3
|
+
runtime: native
|
|
4
|
+
type: control
|
|
5
|
+
palette: hidden
|
|
6
|
+
description: 子流程调用帧的输入代理。只允许通过 flow.input 创建,不在节点面板中展示。
|
|
7
|
+
displayName: Subflow Input
|
|
8
|
+
input: []
|
|
9
|
+
output:
|
|
10
|
+
- type: text
|
|
11
|
+
name: value
|
|
12
|
+
default: ""
|
|
13
|
+
---
|
|
14
|
+
Expose one value injected by a flow.call invocation.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import crypto from "node:crypto";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
|
|
6
|
+
function emptyStore() {
|
|
7
|
+
return { version: 1, profiles: {}, pending: {} };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function agentFlowAuthFile() {
|
|
11
|
+
const configured = String(process.env.AGENTFLOW_AUTH_FILE || "").trim();
|
|
12
|
+
return path.resolve(configured || path.join(os.homedir(), ".agentflow", "auth.json"));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function readAgentFlowAuthStore() {
|
|
16
|
+
const file = agentFlowAuthFile();
|
|
17
|
+
try {
|
|
18
|
+
const data = JSON.parse(fs.readFileSync(file, "utf-8"));
|
|
19
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) return emptyStore();
|
|
20
|
+
return {
|
|
21
|
+
version: 1,
|
|
22
|
+
profiles: data.profiles && typeof data.profiles === "object" && !Array.isArray(data.profiles) ? data.profiles : {},
|
|
23
|
+
pending: data.pending && typeof data.pending === "object" && !Array.isArray(data.pending) ? data.pending : {},
|
|
24
|
+
};
|
|
25
|
+
} catch {
|
|
26
|
+
return emptyStore();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function writeAgentFlowAuthStore(store) {
|
|
31
|
+
const file = agentFlowAuthFile();
|
|
32
|
+
const dir = path.dirname(file);
|
|
33
|
+
fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
34
|
+
try { fs.chmodSync(dir, 0o700); } catch {}
|
|
35
|
+
const temp = `${file}.${process.pid}.${crypto.randomBytes(6).toString("hex")}.tmp`;
|
|
36
|
+
fs.writeFileSync(temp, `${JSON.stringify(store, null, 2)}\n`, { encoding: "utf-8", mode: 0o600 });
|
|
37
|
+
try { fs.chmodSync(temp, 0o600); } catch {}
|
|
38
|
+
fs.renameSync(temp, file);
|
|
39
|
+
try { fs.chmodSync(file, 0o600); } catch {}
|
|
40
|
+
return file;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function profileKey(baseUrl) {
|
|
44
|
+
return String(baseUrl || "").replace(/\/+$/, "");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function savedAgentFlowProfile(baseUrl) {
|
|
48
|
+
const key = profileKey(baseUrl);
|
|
49
|
+
const profile = readAgentFlowAuthStore().profiles[key];
|
|
50
|
+
if (!profile || typeof profile !== "object") return null;
|
|
51
|
+
if (Number(profile.expiresAt) > 0 && Number(profile.expiresAt) <= Date.now()) return null;
|
|
52
|
+
const token = String(profile.token || "").trim();
|
|
53
|
+
return token ? { ...profile, token } : null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function savedAgentFlowPendingAuthorization(baseUrl) {
|
|
57
|
+
const key = profileKey(baseUrl);
|
|
58
|
+
const pending = readAgentFlowAuthStore().pending[key];
|
|
59
|
+
if (!pending || typeof pending !== "object") return null;
|
|
60
|
+
if (Number(pending.expiresAt) > 0 && Number(pending.expiresAt) <= Date.now()) return null;
|
|
61
|
+
return { ...pending };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function saveAgentFlowPendingAuthorization(baseUrl, pending) {
|
|
65
|
+
const key = profileKey(baseUrl);
|
|
66
|
+
const store = readAgentFlowAuthStore();
|
|
67
|
+
store.pending[key] = {
|
|
68
|
+
requestId: String(pending.requestId || ""),
|
|
69
|
+
deviceCode: String(pending.deviceCode || ""),
|
|
70
|
+
userCode: String(pending.userCode || ""),
|
|
71
|
+
verificationUrl: String(pending.verificationUrl || ""),
|
|
72
|
+
expiresAt: Number(pending.expiresAt) || 0,
|
|
73
|
+
pollInterval: Number(pending.pollInterval) || 3,
|
|
74
|
+
createdAt: Date.now(),
|
|
75
|
+
};
|
|
76
|
+
writeAgentFlowAuthStore(store);
|
|
77
|
+
return { ...store.pending[key], deviceCode: undefined };
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function saveAgentFlowProfile(baseUrl, profile) {
|
|
81
|
+
const key = profileKey(baseUrl);
|
|
82
|
+
const store = readAgentFlowAuthStore();
|
|
83
|
+
store.profiles[key] = {
|
|
84
|
+
token: String(profile.token || ""),
|
|
85
|
+
tokenType: String(profile.tokenType || "Bearer"),
|
|
86
|
+
expiresAt: Number(profile.expiresAt) || 0,
|
|
87
|
+
user: profile.user && typeof profile.user === "object" ? profile.user : null,
|
|
88
|
+
scopes: Array.isArray(profile.scopes) ? profile.scopes.map(String) : [],
|
|
89
|
+
updatedAt: Date.now(),
|
|
90
|
+
};
|
|
91
|
+
delete store.pending[key];
|
|
92
|
+
const file = writeAgentFlowAuthStore(store);
|
|
93
|
+
return { file, profile: { ...store.profiles[key], token: undefined } };
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function clearAgentFlowPendingAuthorization(baseUrl) {
|
|
97
|
+
const key = profileKey(baseUrl);
|
|
98
|
+
const store = readAgentFlowAuthStore();
|
|
99
|
+
if (!store.pending[key]) return false;
|
|
100
|
+
delete store.pending[key];
|
|
101
|
+
writeAgentFlowAuthStore(store);
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function clearAgentFlowProfile(baseUrl) {
|
|
106
|
+
const key = profileKey(baseUrl);
|
|
107
|
+
const store = readAgentFlowAuthStore();
|
|
108
|
+
const existed = Boolean(store.profiles[key] || store.pending[key]);
|
|
109
|
+
delete store.profiles[key];
|
|
110
|
+
delete store.pending[key];
|
|
111
|
+
if (existed) writeAgentFlowAuthStore(store);
|
|
112
|
+
return existed;
|
|
113
|
+
}
|