ralphflow-dsh 2.3.1 → 2.4.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.md +48 -22
- package/graphs/codewiki/format.md +362 -0
- package/graphs/codewiki/graph.yaml +39 -0
- package/graphs/codewiki/nodes/assemble.md +24 -0
- package/graphs/codewiki/nodes/core-pages.md +17 -0
- package/graphs/codewiki/nodes/module-pages.md +18 -0
- package/graphs/codewiki/nodes/operations-pages.md +18 -0
- package/graphs/codewiki/nodes/survey.md +22 -0
- package/lib/asset-path.d.ts +59 -0
- package/lib/asset-path.js +181 -0
- package/lib/assets.d.ts +42 -0
- package/lib/assets.js +86 -0
- package/lib/client/phase.d.ts +29 -0
- package/lib/client/phase.js +86 -0
- package/lib/client/selection.d.ts +28 -0
- package/lib/client/selection.js +9 -0
- package/lib/client/status-source.d.ts +3 -1
- package/lib/client/status-source.js +3 -2
- package/lib/client/status.js +49 -13
- package/lib/client/viewer.d.ts +18 -0
- package/lib/client/viewer.js +540 -0
- package/lib/client.js +1159 -64
- package/lib/engine.d.ts +111 -47
- package/lib/engine.js +473 -320
- package/lib/facade.d.ts +175 -0
- package/lib/facade.js +553 -0
- package/lib/graph/agent-registry.d.ts +4 -0
- package/lib/graph/agent-registry.js +20 -0
- package/lib/graph/asset.d.ts +47 -0
- package/lib/graph/asset.js +276 -0
- package/lib/graph/assets.d.ts +47 -0
- package/lib/graph/assets.js +224 -0
- package/lib/graph/branches.d.ts +9 -0
- package/lib/graph/branches.js +13 -0
- package/lib/graph/check.d.ts +23 -0
- package/lib/graph/check.js +46 -0
- package/lib/graph/engine.d.ts +55 -0
- package/lib/graph/engine.js +2002 -0
- package/lib/graph/report.d.ts +9 -0
- package/lib/graph/report.js +117 -0
- package/lib/graph/state.d.ts +244 -0
- package/lib/graph/state.js +358 -0
- package/lib/graph/workspace.d.ts +68 -0
- package/lib/graph/workspace.js +262 -0
- package/lib/index.d.ts +11 -1
- package/lib/index.js +156 -49
- package/lib/owner.d.ts +34 -0
- package/lib/owner.js +49 -0
- package/lib/paths.d.ts +12 -0
- package/lib/paths.js +44 -0
- package/lib/pause.d.ts +12 -0
- package/lib/pause.js +19 -0
- package/lib/skills.d.ts +17 -30
- package/lib/skills.js +85 -21
- package/lib/status-contract.d.ts +114 -1
- package/lib/status-contract.js +106 -4
- package/lib/status-service.d.ts +5 -1
- package/lib/status-service.js +8 -1
- package/lib/tools.d.ts +14 -6
- package/lib/tools.js +88 -60
- package/lib/unfinished.d.ts +11 -0
- package/lib/unfinished.js +18 -0
- package/lib/verifier-preset.d.ts +40 -0
- package/lib/verifier-preset.js +126 -0
- package/lib/verify.d.ts +82 -13
- package/lib/verify.js +382 -95
- package/package.json +50 -38
- package/skills/ralphflow-create/SKILL.md +32 -0
- package/skills/ralphflow-create/graph-authoring.md +85 -0
- package/skills/ralphflow-create/matt/LICENSE +21 -0
- package/skills/ralphflow-create/matt/SHA256SUMS +6 -0
- package/skills/ralphflow-create/matt/SKILL-MECHANICS.md +22 -0
- package/skills/ralphflow-create/matt/SOURCE.md +12 -0
- package/skills/ralphflow-create/matt/grilling.md +30 -0
- package/skills/ralphflow-create/matt/to-spec.md +75 -0
- package/skills/ralphflow-create/matt/to-tickets.md +105 -0
- package/skills/ralphflow-create/matt/writing-for-agents.md +81 -0
- package/skills/ralphflow-create/ralphflow-authoring.md +31 -0
- package/skills/ralphflow-create/testing-workflow.md +60 -0
- package/{references → skills/ralphflow-create}/workflow-authoring.md +25 -5
- package/workflows/create-graph/steps/graph.md +17 -0
- package/workflows/create-graph/workflow.yaml +77 -0
- package/workflows/loop/workflow.yaml +23 -0
- package/lib/create.d.ts +0 -2
- package/lib/create.js +0 -17
- package/workflows/loop.yaml +0 -45
- /package/workflows/{spec.yaml → spec/workflow.yaml} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type GraphInstanceState } from "./state.js";
|
|
2
|
+
export interface GraphReportInput {
|
|
3
|
+
instanceId: string;
|
|
4
|
+
workspace: string;
|
|
5
|
+
statePath: string;
|
|
6
|
+
reportPath: string;
|
|
7
|
+
artifactsRelDir: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function buildGraphReport(state: GraphInstanceState, input: GraphReportInput): string;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph 报告(归档到 `reports/<instance>.md`)—— 与 Flow 同一个路径、同一份头部字段,
|
|
3
|
+
* 这样 `ralphflow_list` 的历史与 `uiReport` 的定位不用维护第二套索引。
|
|
4
|
+
*
|
|
5
|
+
* 报告只指路,不复制执行日志原文(design §3.4):验证者提示词/判定原文在 execution.log,
|
|
6
|
+
* 这里只写判定结论、逐条证据摘要与产物引用。
|
|
7
|
+
*/
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import { formatDuration } from "../engine.js";
|
|
10
|
+
import { pauseLabel } from "../pause.js";
|
|
11
|
+
import { nodeNameOf, nodeStatusOf, NODE_STATUS_LABELS, projectionOf } from "./state.js";
|
|
12
|
+
const STATUS_LABELS = {
|
|
13
|
+
completed: "完成",
|
|
14
|
+
failed: "失败",
|
|
15
|
+
cancelled: "取消",
|
|
16
|
+
paused: "暂停",
|
|
17
|
+
interrupted: "中断",
|
|
18
|
+
waiting: "等待",
|
|
19
|
+
running: "运行中",
|
|
20
|
+
};
|
|
21
|
+
const code = (value) => `\`${String(value ?? "").replaceAll("`", "\\`")}\``;
|
|
22
|
+
const oneLine = (value) => String(value ?? "").replace(/\s+/g, " ").trim();
|
|
23
|
+
function artifactLine(attempt) {
|
|
24
|
+
return attempt?.artifact ? `${code(attempt.artifact.rel ?? attempt.artifact.path)}(sha256 ${code(attempt.artifact.sha256.slice(0, 12))}…)` : "未记录产物";
|
|
25
|
+
}
|
|
26
|
+
export function buildGraphReport(state, input) {
|
|
27
|
+
const asset = state.graph.asset;
|
|
28
|
+
const projectionStatus = state.graph.status;
|
|
29
|
+
const statusLabel = STATUS_LABELS[projectionStatus] ?? projectionStatus;
|
|
30
|
+
const startedAt = state.started_at;
|
|
31
|
+
const endedAt = state.updated_at;
|
|
32
|
+
const duration = Math.max(0, new Date(endedAt).getTime() - new Date(startedAt).getTime());
|
|
33
|
+
const lines = [
|
|
34
|
+
`# ralphflow 报告 · ${oneLine(asset.name)}`,
|
|
35
|
+
"",
|
|
36
|
+
`- 实例:${code(input.instanceId)}`,
|
|
37
|
+
`- 状态:**${statusLabel}**`,
|
|
38
|
+
`- 类型:Graph`,
|
|
39
|
+
`- 任务:${oneLine(state.user_task) || "(未提供)"}`,
|
|
40
|
+
`- 开始:${startedAt}`,
|
|
41
|
+
`- 结束:${endedAt}`,
|
|
42
|
+
`- 总耗时:${formatDuration(duration)}`,
|
|
43
|
+
`- 产出目录:${code(`${input.artifactsRelDir}/`)}`,
|
|
44
|
+
`- 本报告:${code(`${path.relative(input.workspace, input.reportPath).split(path.sep).join("/")}`)}`,
|
|
45
|
+
`- 执行日志:${code(`.dsh/ralph-flow/reports/${input.instanceId}-execution.log`)}`,
|
|
46
|
+
"- 资产:",
|
|
47
|
+
` - id:${code(asset.id)}`,
|
|
48
|
+
` - 版本:${code(state.graph.asset_hash)}`,
|
|
49
|
+
` - 节点:${asset.nodes.length}`,
|
|
50
|
+
"",
|
|
51
|
+
"## 判定",
|
|
52
|
+
"",
|
|
53
|
+
];
|
|
54
|
+
const projection = projectionOf(state, input.instanceId);
|
|
55
|
+
const completed = asset.nodes.filter((node) => nodeStatusOf(state, node) === "completed").length;
|
|
56
|
+
const unfinished = asset.nodes.length - completed;
|
|
57
|
+
const success = projectionStatus === "completed" && unfinished === 0;
|
|
58
|
+
lines.push(`- 结果:${success ? "全部节点已完成" : "未完成全部节点"}`, `- 状态:${code(projectionStatus)}${state.graph.pause_reason ? `(${oneLine(pauseLabel(state.graph.pause_reason))})` : ""}`, `- 完成:${completed}/${asset.nodes.length}`, `- 未完成:${unfinished}`, `- 交付分类:已交付 ${projection.delivery.delivered} · 未接纳 ${projection.delivery.unaccepted} · 未验证 ${projection.delivery.unverified} · 未完成 ${projection.delivery.unfinished}`, ...(state.graph.status === "paused" && state.graph.pause_reason ? [`- 暂停原因:${oneLine(pauseLabel(state.graph.pause_reason))}`] : []), "", "## 节点", "");
|
|
59
|
+
for (const node of asset.nodes) {
|
|
60
|
+
const status = nodeStatusOf(state, node);
|
|
61
|
+
const attempts = state.graph.attempts.filter((attempt) => attempt.node_id === node.id);
|
|
62
|
+
const latest = attempts.at(-1);
|
|
63
|
+
const verdict = latest ? state.graph.verdicts.filter((item) => item.attempt_id === latest.id).at(-1) : undefined;
|
|
64
|
+
const acceptance = state.graph.acceptances.find((item) => item.node_id === node.id);
|
|
65
|
+
const details = [
|
|
66
|
+
`尝试 ${attempts.length}`,
|
|
67
|
+
`产物 ${artifactLine(latest)}`,
|
|
68
|
+
node.check ? `CHECK ${node.check.mode}${verdict ? `/${verdict.status}` : "(未判定)"}` : "CHECK 已关闭",
|
|
69
|
+
...(acceptance?.manual_approval ? ["人工批准"] : []),
|
|
70
|
+
...(acceptance?.integration ? [`合入 ${code(acceptance.integration.commit.slice(0, 12))}…`] : []),
|
|
71
|
+
];
|
|
72
|
+
lines.push(`- ${code(node.id)} ${oneLine(nodeNameOf(state, node))} — ${status}(${NODE_STATUS_LABELS[status]});${details.join(";")}`);
|
|
73
|
+
if (verdict)
|
|
74
|
+
lines.push(` - CHECK ${verdict.status}:${oneLine(verdict.reason)}`);
|
|
75
|
+
if (latest?.failure)
|
|
76
|
+
lines.push(` - 失败:${oneLine(latest.failure.message)}`);
|
|
77
|
+
}
|
|
78
|
+
lines.push("", "## CHECK 判定", "");
|
|
79
|
+
if (state.graph.verdicts.length === 0) {
|
|
80
|
+
lines.push("- (无判定记录:所有节点都关闭了 CHECK,或尚未产生判定)");
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
for (const verdict of state.graph.verdicts) {
|
|
84
|
+
lines.push(`- ${code(verdict.node_id)} · 尝试 ${code(verdict.attempt_id)} — ${verdict.status}(${verdict.check_mode});${oneLine(verdict.reason)}`);
|
|
85
|
+
for (const evidence of verdict.evidence ?? []) {
|
|
86
|
+
lines.push(` - ${evidence.passed ? "✅" : "❌"} ${oneLine(evidence.criterion)}:${oneLine(evidence.evidence)}`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
lines.push("", "## 人工门与待办", "");
|
|
91
|
+
if (state.graph.human_todos.length === 0) {
|
|
92
|
+
lines.push("- (无)");
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
for (const todo of state.graph.human_todos) {
|
|
96
|
+
lines.push(`- ${code(todo.id)} · ${code(todo.node_id)} · ${todo.status}${todo.feedback ? `:${oneLine(todo.feedback)}` : ""}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
lines.push("", "## 集成", "");
|
|
100
|
+
{
|
|
101
|
+
lines.push(`- 模式:git`, `- 集成分支:${code(state.graph.integration?.branch ?? "")}`, `- 基线:${code(state.graph.integration?.baseline ?? "")}`, `- 当前提交:${code(state.graph.integration?.current_commit ?? "")}`);
|
|
102
|
+
for (const acceptance of state.graph.acceptances) {
|
|
103
|
+
if (acceptance.integration) {
|
|
104
|
+
lines.push(`- 接纳 ${code(acceptance.node_id)} · ${code(acceptance.attempt_id)} · ${code(acceptance.integration.commit)}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
lines.push("", "## 轨迹", "");
|
|
109
|
+
if (state.history.length === 0)
|
|
110
|
+
lines.push("- (无)");
|
|
111
|
+
else
|
|
112
|
+
for (const entry of state.history.slice(-60)) {
|
|
113
|
+
lines.push(`- \`${entry.ts}\` **${entry.event}**${entry.step ? ` [${code(entry.step)}]` : ""}${entry.detail ? ` — ${oneLine(entry.detail)}` : ""}`);
|
|
114
|
+
}
|
|
115
|
+
lines.push("", "---", "由 RalphFlow 根据 Graph 持久化运行记录自动生成。报告与执行日志各自独立,不互相抄写。", "");
|
|
116
|
+
return lines.join("\n");
|
|
117
|
+
}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { type HistoryEntry } from "../engine.js";
|
|
2
|
+
import type { GraphAsset, GraphNode } from "./asset.js";
|
|
3
|
+
export type GraphRunStatus = "running" | "paused" | "waiting" | "interrupted" | "completed" | "failed" | "cancelled";
|
|
4
|
+
export type GraphNodeStatus = "pending" | "blocked" | "running" | "verifying" | "reworking" | "waiting_review" | "waiting" | "integrating" | "accepting" | "completed" | "failed" | "cancelled" | "interrupted";
|
|
5
|
+
export declare const GRAPH_ACTIVE_STATUSES: readonly GraphRunStatus[];
|
|
6
|
+
export declare function isGraphTerminal(status: GraphRunStatus): boolean;
|
|
7
|
+
export interface GraphAttempt {
|
|
8
|
+
id: string;
|
|
9
|
+
node_id: string;
|
|
10
|
+
seq: number;
|
|
11
|
+
status: "running" | "submitted" | "rejected" | "failed" | "interrupted" | "cancelled";
|
|
12
|
+
started_at: string;
|
|
13
|
+
finished_at?: string;
|
|
14
|
+
worker_id?: string;
|
|
15
|
+
/** `main` 执行节点没有子会话;`session_id` 只在 background 节点出现。 */
|
|
16
|
+
session_id?: string;
|
|
17
|
+
artifact?: {
|
|
18
|
+
path: string;
|
|
19
|
+
rel?: string;
|
|
20
|
+
sha256: string;
|
|
21
|
+
size: number;
|
|
22
|
+
accepted?: boolean;
|
|
23
|
+
};
|
|
24
|
+
submission?: {
|
|
25
|
+
summary?: string;
|
|
26
|
+
at: string;
|
|
27
|
+
};
|
|
28
|
+
failure?: {
|
|
29
|
+
kind: string;
|
|
30
|
+
message: string;
|
|
31
|
+
};
|
|
32
|
+
rework_reason?: string;
|
|
33
|
+
manual_rework_reason?: string;
|
|
34
|
+
workspace?: {
|
|
35
|
+
path: string;
|
|
36
|
+
baseline?: string;
|
|
37
|
+
};
|
|
38
|
+
workspace_changes?: {
|
|
39
|
+
path: string;
|
|
40
|
+
sha256: string;
|
|
41
|
+
files: string[];
|
|
42
|
+
};
|
|
43
|
+
/** 崩溃恢复时标为 interrupted;重试会开新 attempt。 */
|
|
44
|
+
interrupted_at?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface GraphVerdict {
|
|
47
|
+
node_id: string;
|
|
48
|
+
attempt_id: string;
|
|
49
|
+
status: "passed" | "failed" | "infra";
|
|
50
|
+
reason: string;
|
|
51
|
+
evidence?: Array<{
|
|
52
|
+
criterion: string;
|
|
53
|
+
passed: boolean;
|
|
54
|
+
evidence: string;
|
|
55
|
+
}>;
|
|
56
|
+
agent_id?: string;
|
|
57
|
+
ts: string;
|
|
58
|
+
check_index: number;
|
|
59
|
+
check_mode: "custom";
|
|
60
|
+
check_version: string;
|
|
61
|
+
}
|
|
62
|
+
export interface GraphHumanTodo {
|
|
63
|
+
id: string;
|
|
64
|
+
kind: "manual_review";
|
|
65
|
+
status: "waiting" | "approved" | "revise" | "cancelled" | "stale";
|
|
66
|
+
node_id: string;
|
|
67
|
+
attempt_id: string;
|
|
68
|
+
question: string;
|
|
69
|
+
artifact: {
|
|
70
|
+
path: string;
|
|
71
|
+
sha256: string;
|
|
72
|
+
size: number;
|
|
73
|
+
};
|
|
74
|
+
created_at: string;
|
|
75
|
+
answered_at?: string;
|
|
76
|
+
feedback?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface GraphIntegrationAcceptance {
|
|
79
|
+
node_id: string;
|
|
80
|
+
attempt_id: string;
|
|
81
|
+
accepted_at: string;
|
|
82
|
+
artifact_sha256: string;
|
|
83
|
+
check_mode: "custom" | "disabled";
|
|
84
|
+
manual_approval: boolean;
|
|
85
|
+
integration?: {
|
|
86
|
+
branch: string;
|
|
87
|
+
previous_commit: string;
|
|
88
|
+
commit: string;
|
|
89
|
+
base_commit: string;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export interface GraphWorktreeRecord {
|
|
93
|
+
node_id: string;
|
|
94
|
+
path: string;
|
|
95
|
+
branch: string;
|
|
96
|
+
baseline: string;
|
|
97
|
+
created_at: string;
|
|
98
|
+
}
|
|
99
|
+
export interface GraphInstanceState {
|
|
100
|
+
kind: "graph";
|
|
101
|
+
active: boolean;
|
|
102
|
+
workflow_name: string;
|
|
103
|
+
user_task: string;
|
|
104
|
+
owner_session?: string;
|
|
105
|
+
/** 属主运行时与心跳(见 `owner.ts`):running 时刷新,暂停/结束不刷新。 */
|
|
106
|
+
owner_runtime?: string;
|
|
107
|
+
owner_heartbeat_at?: number;
|
|
108
|
+
artifacts_dir_name: string;
|
|
109
|
+
started_at: string;
|
|
110
|
+
updated_at: string;
|
|
111
|
+
graph: {
|
|
112
|
+
asset: GraphAsset;
|
|
113
|
+
asset_hash: string;
|
|
114
|
+
asset_path?: string;
|
|
115
|
+
status: GraphRunStatus;
|
|
116
|
+
pause_reason?: string;
|
|
117
|
+
project: {
|
|
118
|
+
mode: "artifact" | "git";
|
|
119
|
+
root?: string;
|
|
120
|
+
baseline?: string;
|
|
121
|
+
};
|
|
122
|
+
/** 启动时解析的资料根(主事实;恢复后还要用它们注入路径/复制资源)。 */
|
|
123
|
+
integration?: {
|
|
124
|
+
branch: string;
|
|
125
|
+
baseline: string;
|
|
126
|
+
current_commit: string;
|
|
127
|
+
};
|
|
128
|
+
attempts: GraphAttempt[];
|
|
129
|
+
verdicts: GraphVerdict[];
|
|
130
|
+
acceptances: GraphIntegrationAcceptance[];
|
|
131
|
+
human_todos: GraphHumanTodo[];
|
|
132
|
+
worktrees: GraphWorktreeRecord[];
|
|
133
|
+
rework_counts: Record<string, number>;
|
|
134
|
+
/** 「没有把集成分支合进来」的重试计数:与 CHECK 返工分开,临近交卷的竞态很常见。 */
|
|
135
|
+
integration_retries: Record<string, number>;
|
|
136
|
+
fault_retries: Record<string, number>;
|
|
137
|
+
};
|
|
138
|
+
history: HistoryEntry[];
|
|
139
|
+
}
|
|
140
|
+
export declare function graphRootOf(workspace: string): string;
|
|
141
|
+
export declare function graphInstancesDirOf(workspace: string): string;
|
|
142
|
+
export declare function graphReportsDirOf(workspace: string): string;
|
|
143
|
+
export declare function graphInstanceDirOf(workspace: string, instId: string): string;
|
|
144
|
+
export declare function graphStatePathOf(workspace: string, instId: string): string;
|
|
145
|
+
export declare function graphArtifactsRootOf(workspace: string): string;
|
|
146
|
+
export declare function graphArtifactsDirOf(workspace: string, state: Pick<GraphInstanceState, "artifacts_dir_name">): string;
|
|
147
|
+
export declare function graphNodeArtifactDirOf(workspace: string, state: Pick<GraphInstanceState, "artifacts_dir_name">, nodeId: string, attemptId: string): string;
|
|
148
|
+
export declare function readGraphState(workspace: string, instId: string): GraphInstanceState | null;
|
|
149
|
+
export declare function writeGraphState(workspace: string, state: GraphInstanceState, instId: string): void;
|
|
150
|
+
/** 扫描本工作区所有 Graph 实例状态(包含已结束但保留的实例)。 */
|
|
151
|
+
export declare function listGraphStates(workspace: string): Array<{
|
|
152
|
+
id: string;
|
|
153
|
+
state: GraphInstanceState;
|
|
154
|
+
}>;
|
|
155
|
+
export declare function pushGraphHistory(state: GraphInstanceState, event: string, detail?: string, nodeId?: string): void;
|
|
156
|
+
export declare function attemptsOfNode(state: GraphInstanceState, nodeId: string): GraphAttempt[];
|
|
157
|
+
export declare function latestAttemptOfNode(state: GraphInstanceState, nodeId: string): GraphAttempt | undefined;
|
|
158
|
+
export declare function verdictOfAttempt(state: GraphInstanceState, attemptId: string): GraphVerdict | undefined;
|
|
159
|
+
export declare function acceptanceOfNode(state: GraphInstanceState, nodeId: string): GraphIntegrationAcceptance | undefined;
|
|
160
|
+
export declare function waitingTodoOfNode(state: GraphInstanceState, nodeId: string): GraphHumanTodo | undefined;
|
|
161
|
+
/** 节点是否已经释放下游(Flow 的「完成」等价物;Git 还要完成合入接纳)。 */
|
|
162
|
+
export declare function nodeReleased(state: GraphInstanceState, node: GraphNode): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* 派生节点状态。**纯函数**:不读写状态、不推进,只把主事实翻译成投影。
|
|
165
|
+
* 顺序即语义:已接纳 > 已取消 > 等待人工 > 在飞 > 已交卷待验证/合入 > 待重做/失败 > 依赖阻塞 > 待开始。
|
|
166
|
+
*/
|
|
167
|
+
export declare function nodeStatusOf(state: GraphInstanceState, node: GraphNode): GraphNodeStatus;
|
|
168
|
+
export declare const NODE_STATUS_LABELS: Record<GraphNodeStatus, string>;
|
|
169
|
+
export interface GraphNodeProjection {
|
|
170
|
+
id: string;
|
|
171
|
+
name: string;
|
|
172
|
+
status: GraphNodeStatus;
|
|
173
|
+
label: string;
|
|
174
|
+
dependsOn: string[];
|
|
175
|
+
attempts: number;
|
|
176
|
+
artifact: {
|
|
177
|
+
path: string;
|
|
178
|
+
sha256: string;
|
|
179
|
+
size: number;
|
|
180
|
+
} | null;
|
|
181
|
+
check: {
|
|
182
|
+
mode: "custom" | "disabled";
|
|
183
|
+
status: "passed" | "failed" | "infra" | "pending" | "skipped";
|
|
184
|
+
reason: string;
|
|
185
|
+
reworks: number;
|
|
186
|
+
};
|
|
187
|
+
manual: "pending" | "waiting" | "approved" | "revise" | "not_required" | "stale" | "cancelled";
|
|
188
|
+
integration: "accepted" | "pending" | "not_required";
|
|
189
|
+
integrationCommit: string | null;
|
|
190
|
+
workspace: string | null;
|
|
191
|
+
todoId: string | null;
|
|
192
|
+
current: boolean;
|
|
193
|
+
execution: "background" | "main";
|
|
194
|
+
}
|
|
195
|
+
export interface GraphRunProjection {
|
|
196
|
+
kind: "graph";
|
|
197
|
+
id: string;
|
|
198
|
+
workflow: string;
|
|
199
|
+
task: string;
|
|
200
|
+
status: GraphRunStatus;
|
|
201
|
+
phase: string;
|
|
202
|
+
counts: {
|
|
203
|
+
total: number;
|
|
204
|
+
completed: number;
|
|
205
|
+
running: number;
|
|
206
|
+
waiting: number;
|
|
207
|
+
pending: number;
|
|
208
|
+
blocked: number;
|
|
209
|
+
};
|
|
210
|
+
current: {
|
|
211
|
+
nodeId: string;
|
|
212
|
+
name: string;
|
|
213
|
+
status: GraphNodeStatus;
|
|
214
|
+
} | null;
|
|
215
|
+
nextAction: null | {
|
|
216
|
+
kind: "answer" | "manual_review" | "resume" | "wait";
|
|
217
|
+
label: string;
|
|
218
|
+
message: string;
|
|
219
|
+
todoId?: string;
|
|
220
|
+
nodeId?: string;
|
|
221
|
+
};
|
|
222
|
+
nodes: GraphNodeProjection[];
|
|
223
|
+
integration: {
|
|
224
|
+
branch: string;
|
|
225
|
+
currentCommit: string;
|
|
226
|
+
accepted: number;
|
|
227
|
+
} | null;
|
|
228
|
+
delivery: {
|
|
229
|
+
success: boolean;
|
|
230
|
+
outcome: string;
|
|
231
|
+
delivered: number;
|
|
232
|
+
unaccepted: number;
|
|
233
|
+
unverified: number;
|
|
234
|
+
unfinished: number;
|
|
235
|
+
reason?: string;
|
|
236
|
+
};
|
|
237
|
+
startedAt: string;
|
|
238
|
+
updatedAt: string;
|
|
239
|
+
report: string | null;
|
|
240
|
+
}
|
|
241
|
+
export declare function nodeNameOf(state: GraphInstanceState, node: GraphNode): string;
|
|
242
|
+
export declare function projectionOf(state: GraphInstanceState, id: string): GraphRunProjection;
|
|
243
|
+
/** 运行输入与提示词共用的安全路径:只接受相对路径,拒绝逃出工作区。 */
|
|
244
|
+
export declare function resolveInside(root: string, relative: string): string | null;
|