@h-rig/harness-plugin 0.0.6-alpha.186
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 +1 -0
- package/dist/bin/rig-agent-dispatch.d.ts +2 -0
- package/dist/bin/rig-agent-dispatch.js +826 -0
- package/dist/src/agent-command.d.ts +3 -0
- package/dist/src/agent-command.js +233 -0
- package/dist/src/agent-harness/agent-mode.d.ts +1 -0
- package/dist/src/agent-harness/agent-mode.js +48 -0
- package/dist/src/agent-harness/agent-wrapper.d.ts +60 -0
- package/dist/src/agent-harness/agent-wrapper.js +842 -0
- package/dist/src/agent-harness/controlled-bash.d.ts +3 -0
- package/dist/src/agent-harness/controlled-bash.js +45 -0
- package/dist/src/agent-harness/git-ops.d.ts +2 -0
- package/dist/src/agent-harness/git-ops.js +27 -0
- package/dist/src/agent-harness/repo-ops.d.ts +14 -0
- package/dist/src/agent-harness/repo-ops.js +37 -0
- package/dist/src/agent-harness/rig-agent-entrypoint.d.ts +1 -0
- package/dist/src/agent-harness/rig-agent-entrypoint.js +1362 -0
- package/dist/src/agent-harness/rig-agent.d.ts +2 -0
- package/dist/src/agent-harness/rig-agent.js +1324 -0
- package/dist/src/agent-harness/runtime-snapshot-config.d.ts +2 -0
- package/dist/src/agent-harness/runtime-snapshot-config.js +25 -0
- package/dist/src/agent-harness/task-data.d.ts +27 -0
- package/dist/src/agent-harness/task-data.js +286 -0
- package/dist/src/agent-harness/task-ops.d.ts +10 -0
- package/dist/src/agent-harness/task-ops.js +352 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.js +4525 -0
- package/dist/src/model.d.ts +80 -0
- package/dist/src/model.js +64 -0
- package/dist/src/pi-command.d.ts +3 -0
- package/dist/src/pi-command.js +154 -0
- package/dist/src/pi-settings-materializer.d.ts +10 -0
- package/dist/src/pi-settings-materializer.js +52 -0
- package/dist/src/plugin.d.ts +24 -0
- package/dist/src/plugin.js +4486 -0
- package/dist/src/profile-command.d.ts +3 -0
- package/dist/src/profile-command.js +79 -0
- package/dist/src/profile-state.d.ts +7 -0
- package/dist/src/profile-state.js +39 -0
- package/dist/src/rig-task-run-skill.d.ts +8 -0
- package/dist/src/rig-task-run-skill.js +39 -0
- package/dist/src/runtime-instructions.d.ts +4 -0
- package/dist/src/runtime-instructions.js +26 -0
- package/dist/src/runtime-secrets.d.ts +6 -0
- package/dist/src/runtime-secrets.js +58 -0
- package/dist/src/service.d.ts +14 -0
- package/dist/src/service.js +33 -0
- package/dist/src/session-asset-materializer-service.d.ts +13 -0
- package/dist/src/session-asset-materializer-service.js +164 -0
- package/dist/src/session-hook-materializer-service.d.ts +34 -0
- package/dist/src/session-hook-materializer-service.js +142 -0
- package/dist/src/skill-materializer.d.ts +25 -0
- package/dist/src/skill-materializer.js +86 -0
- package/dist/src/tooling/browser-tool-entrypoint.d.ts +2 -0
- package/dist/src/tooling/browser-tool-entrypoint.js +125 -0
- package/dist/src/tooling/browser-tools.d.ts +3 -0
- package/dist/src/tooling/browser-tools.js +27 -0
- package/dist/src/tooling/claude-router-binary.d.ts +3 -0
- package/dist/src/tooling/claude-router-binary.js +62 -0
- package/dist/src/tooling/claude-router.d.ts +22 -0
- package/dist/src/tooling/claude-router.js +524 -0
- package/dist/src/tooling/embedded-native-assets.d.ts +7 -0
- package/dist/src/tooling/embedded-native-assets.js +6 -0
- package/dist/src/tooling/file-tools.d.ts +5 -0
- package/dist/src/tooling/file-tools.js +192 -0
- package/dist/src/tooling/gateway.d.ts +4 -0
- package/dist/src/tooling/gateway.js +400 -0
- package/dist/src/tooling/shell-tools.d.ts +5 -0
- package/dist/src/tooling/shell-tools.js +185 -0
- package/native/darwin-arm64/rig-shell +0 -0
- package/native/darwin-arm64/rig-shell.build-manifest.json +4 -0
- package/native/darwin-arm64/rig-tools +0 -0
- package/native/darwin-arm64/rig-tools.build-manifest.json +4 -0
- package/native/darwin-x64/rig-shell +0 -0
- package/native/darwin-x64/rig-tools +0 -0
- package/native/linux-arm64/rig-shell +0 -0
- package/native/linux-arm64/rig-tools +0 -0
- package/native/linux-x64/rig-shell +0 -0
- package/native/linux-x64/rig-tools +0 -0
- package/native/win32-x64/rig-shell.exe +0 -0
- package/native/win32-x64/rig-tools.exe +0 -0
- package/package.json +101 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/harness-plugin/src/agent-harness/runtime-snapshot-config.ts
|
|
3
|
+
import { existsSync, readFileSync } from "fs";
|
|
4
|
+
import { resolve } from "path";
|
|
5
|
+
var DEFAULT_RUNTIME_SNAPSHOT = { enabled: true };
|
|
6
|
+
function loadRuntimeSnapshotConfig(projectRoot) {
|
|
7
|
+
const configPath = resolve(projectRoot, "rig/policy/policy.json");
|
|
8
|
+
if (!existsSync(configPath))
|
|
9
|
+
return { ...DEFAULT_RUNTIME_SNAPSHOT };
|
|
10
|
+
try {
|
|
11
|
+
const parsed = JSON.parse(readFileSync(configPath, "utf8"));
|
|
12
|
+
const runtimeSnapshot = parsed.runtime_snapshot;
|
|
13
|
+
if (runtimeSnapshot && typeof runtimeSnapshot === "object" && !Array.isArray(runtimeSnapshot)) {
|
|
14
|
+
const enabled = runtimeSnapshot.enabled;
|
|
15
|
+
if (typeof enabled === "boolean")
|
|
16
|
+
return { enabled };
|
|
17
|
+
}
|
|
18
|
+
} catch {
|
|
19
|
+
return { ...DEFAULT_RUNTIME_SNAPSHOT };
|
|
20
|
+
}
|
|
21
|
+
return { ...DEFAULT_RUNTIME_SNAPSHOT };
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
loadRuntimeSnapshotConfig
|
|
25
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type TaskConfigEntry } from "@rig/contracts";
|
|
2
|
+
type ProviderTaskData = {
|
|
3
|
+
currentTaskId(projectRoot: string): string;
|
|
4
|
+
readTaskConfig(projectRoot: string): Record<string, TaskConfigEntry>;
|
|
5
|
+
readSourceTaskConfig(projectRoot: string): Record<string, TaskConfigEntry>;
|
|
6
|
+
readValidationDescriptions(projectRoot: string): Record<string, string>;
|
|
7
|
+
lookupTask(projectRoot: string, input: string): string;
|
|
8
|
+
taskLookup(projectRoot: string, id: string): string;
|
|
9
|
+
artifactDirForId(projectRoot: string, id: string): string;
|
|
10
|
+
taskInfo(projectRoot: string, taskId?: string, deprecatedRuntimeProviderOverride?: unknown): Promise<void>;
|
|
11
|
+
taskDeps(projectRoot: string, taskId?: string): Promise<void>;
|
|
12
|
+
taskStatus(projectRoot: string): void;
|
|
13
|
+
taskScope(projectRoot: string, expandFiles: boolean, taskId?: string): Promise<void>;
|
|
14
|
+
taskRecord(projectRoot: string, type: "decision" | "failure", text: string, taskId?: string): Promise<void>;
|
|
15
|
+
taskArtifacts(projectRoot: string, taskId?: string): Promise<void>;
|
|
16
|
+
taskArtifactDir(projectRoot: string, taskId?: string): string;
|
|
17
|
+
taskArtifactWrite(projectRoot: string, filename: string, content: string, taskId?: string): Promise<void>;
|
|
18
|
+
taskArtifactRead(projectRoot: string, filename: string, options?: {
|
|
19
|
+
taskId?: string;
|
|
20
|
+
maxBytes?: number;
|
|
21
|
+
}): Promise<import("@rig/contracts").TaskArtifactReadResult>;
|
|
22
|
+
taskDependencyIds(projectRoot: string, taskId: string): string[];
|
|
23
|
+
changedFilesForTask(projectRoot: string, taskId: string, scoped: boolean): string[];
|
|
24
|
+
pendingFilesForTask(projectRoot: string, taskId: string, scoped: boolean): string[];
|
|
25
|
+
};
|
|
26
|
+
export declare function taskData(): ProviderTaskData;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/harness-plugin/src/agent-harness/task-data.ts
|
|
3
|
+
import { basename } from "path";
|
|
4
|
+
import {
|
|
5
|
+
REPO_CHANGE_SET,
|
|
6
|
+
TASK_ARTIFACTS,
|
|
7
|
+
TASK_STATE_STORE,
|
|
8
|
+
TASK_SOURCE_CONFIG_PROJECTION
|
|
9
|
+
} from "@rig/contracts";
|
|
10
|
+
import { defineCapability } from "@rig/core/capability";
|
|
11
|
+
import { requireInstalledCapability } from "@rig/core/capability-loaders";
|
|
12
|
+
var RepoChangeSetCap = defineCapability(REPO_CHANGE_SET);
|
|
13
|
+
var TaskArtifactsCap = defineCapability(TASK_ARTIFACTS);
|
|
14
|
+
var TaskStateStoreCap = defineCapability(TASK_STATE_STORE);
|
|
15
|
+
var TaskSourceConfigProjectionCap = defineCapability(TASK_SOURCE_CONFIG_PROJECTION);
|
|
16
|
+
function stateStore() {
|
|
17
|
+
return requireInstalledCapability(TaskStateStoreCap, "task state store capability unavailable: load @rig/tasks-plugin (default bundle) before running the provider agent harness.");
|
|
18
|
+
}
|
|
19
|
+
function artifacts() {
|
|
20
|
+
return requireInstalledCapability(TaskArtifactsCap, "task artifacts capability unavailable: load @rig/tasks-plugin (default bundle) before running the provider agent harness.");
|
|
21
|
+
}
|
|
22
|
+
function taskSourceConfigProjection() {
|
|
23
|
+
return requireInstalledCapability(TaskSourceConfigProjectionCap, "task source config projection capability unavailable: load @rig/tasks-plugin (default bundle) before reading validation descriptions.");
|
|
24
|
+
}
|
|
25
|
+
function repoChangeSet() {
|
|
26
|
+
return requireInstalledCapability(RepoChangeSetCap, "repo change-set capability unavailable: load @rig/repos-plugin (default bundle) before reading task file changes.");
|
|
27
|
+
}
|
|
28
|
+
function currentTaskId(projectRoot) {
|
|
29
|
+
return stateStore().readCurrentTaskId(projectRoot) ?? "";
|
|
30
|
+
}
|
|
31
|
+
function readTaskConfig(projectRoot) {
|
|
32
|
+
return stateStore().readTaskConfig(projectRoot);
|
|
33
|
+
}
|
|
34
|
+
function readSourceTaskConfig(projectRoot) {
|
|
35
|
+
return stateStore().readSourceTaskConfig(projectRoot);
|
|
36
|
+
}
|
|
37
|
+
function readValidationDescriptions(projectRoot) {
|
|
38
|
+
return taskSourceConfigProjection().readSourceValidationDescriptions(projectRoot);
|
|
39
|
+
}
|
|
40
|
+
function lookupTask(_projectRoot, input) {
|
|
41
|
+
return input;
|
|
42
|
+
}
|
|
43
|
+
function artifactDirForId(projectRoot, id) {
|
|
44
|
+
return artifacts().artifactDir({ projectRoot, taskId: id });
|
|
45
|
+
}
|
|
46
|
+
function readStringList(candidate) {
|
|
47
|
+
return Array.isArray(candidate) ? candidate.filter((entry) => typeof entry === "string") : [];
|
|
48
|
+
}
|
|
49
|
+
function firstStringList(...candidates) {
|
|
50
|
+
for (const candidate of candidates) {
|
|
51
|
+
const values = readStringList(candidate);
|
|
52
|
+
if (values.length > 0)
|
|
53
|
+
return values;
|
|
54
|
+
}
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
57
|
+
function unique(values) {
|
|
58
|
+
return Array.from(new Set(values));
|
|
59
|
+
}
|
|
60
|
+
function readTaskEntry(projectRoot, taskId) {
|
|
61
|
+
try {
|
|
62
|
+
return readTaskConfig(projectRoot)[taskId] ?? readSourceTaskConfig(projectRoot)[taskId] ?? null;
|
|
63
|
+
} catch {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function taskDependencyIds(projectRoot, taskId) {
|
|
68
|
+
const entry = readTaskEntry(projectRoot, taskId);
|
|
69
|
+
if (!entry)
|
|
70
|
+
return [];
|
|
71
|
+
const record = entry;
|
|
72
|
+
return unique(firstStringList(record.deps, record.dependencies, record.validation_deps, record.validationDeps)).filter((id) => id !== taskId);
|
|
73
|
+
}
|
|
74
|
+
function taskScopePatterns(projectRoot, taskId) {
|
|
75
|
+
const entry = readTaskEntry(projectRoot, taskId);
|
|
76
|
+
return entry ? readStringList(entry.scope) : [];
|
|
77
|
+
}
|
|
78
|
+
function syncRepoChangeSetPaths(result, operation) {
|
|
79
|
+
if (result && typeof result.then === "function") {
|
|
80
|
+
throw new Error(`repo change-set ${operation} returned a Promise; lifecycle task adapter requires a synchronous provider.`);
|
|
81
|
+
}
|
|
82
|
+
return unique(result.map((entry) => entry.path).filter(Boolean));
|
|
83
|
+
}
|
|
84
|
+
function changedFilesForTask(projectRoot, taskId, scoped) {
|
|
85
|
+
return syncRepoChangeSetPaths(repoChangeSet().changedFiles({ projectRoot, selector: { kind: "task", taskId, scoped } }), "changedFiles");
|
|
86
|
+
}
|
|
87
|
+
function pendingFilesForTask(projectRoot, taskId, scoped) {
|
|
88
|
+
return syncRepoChangeSetPaths(repoChangeSet().pendingFiles({ projectRoot, selector: { kind: "task", taskId, scoped } }), "pendingFiles");
|
|
89
|
+
}
|
|
90
|
+
function taskLookup(projectRoot, id) {
|
|
91
|
+
const result = lookupTask(projectRoot, id);
|
|
92
|
+
if (!result)
|
|
93
|
+
throw new Error(`Not found: ${id}`);
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
function taskConfigEntryToRecord(id, entry, source) {
|
|
97
|
+
const record = entry;
|
|
98
|
+
const deps = firstStringList(record.deps, record.dependencies, record.validation_deps, record.validationDeps);
|
|
99
|
+
return {
|
|
100
|
+
id,
|
|
101
|
+
deps,
|
|
102
|
+
status: typeof entry.status === "string" ? entry.status : "open",
|
|
103
|
+
source,
|
|
104
|
+
...typeof entry.title === "string" ? { title: entry.title } : {},
|
|
105
|
+
...typeof entry.description === "string" ? { description: entry.description } : {},
|
|
106
|
+
...typeof entry.acceptance_criteria === "string" ? { acceptanceCriteria: entry.acceptance_criteria } : {},
|
|
107
|
+
...Array.isArray(entry.scope) ? { scope: entry.scope } : {},
|
|
108
|
+
...Array.isArray(entry.validation) ? { validation: entry.validation } : {},
|
|
109
|
+
...typeof entry.role === "string" ? { role: entry.role } : {},
|
|
110
|
+
...entry.browser ? { browser: entry.browser } : {},
|
|
111
|
+
...entry.repo_pins ? { repo_pins: entry.repo_pins } : {},
|
|
112
|
+
...entry.criticality ? { criticality: entry.criticality } : {},
|
|
113
|
+
...typeof entry.queue_weight === "number" ? { queue_weight: entry.queue_weight } : {},
|
|
114
|
+
...entry.creates_repo !== undefined ? { creates_repo: entry.creates_repo } : {},
|
|
115
|
+
...entry.auto_synced !== undefined ? { auto_synced: entry.auto_synced } : {}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
async function taskInfo(projectRoot, taskId, deprecatedRuntimeProviderOverride) {
|
|
119
|
+
const activeTask = taskId || currentTaskId(projectRoot);
|
|
120
|
+
if (!activeTask)
|
|
121
|
+
throw new Error("No active task.");
|
|
122
|
+
const entry = readTaskEntry(projectRoot, activeTask);
|
|
123
|
+
if (!entry)
|
|
124
|
+
throw new Error(`Not found: ${activeTask}`);
|
|
125
|
+
process.stdout.write(`${JSON.stringify(taskConfigEntryToRecord(activeTask, entry, "task-config"), null, 2)}
|
|
126
|
+
`);
|
|
127
|
+
}
|
|
128
|
+
async function taskDeps(projectRoot, taskId) {
|
|
129
|
+
const activeTask = taskId || currentTaskId(projectRoot);
|
|
130
|
+
if (!activeTask)
|
|
131
|
+
throw new Error("No active task.");
|
|
132
|
+
const deps = taskDependencyIds(projectRoot, activeTask);
|
|
133
|
+
if (deps.length > 0)
|
|
134
|
+
process.stdout.write(`${deps.join(`
|
|
135
|
+
`)}
|
|
136
|
+
`);
|
|
137
|
+
}
|
|
138
|
+
function taskStatus(projectRoot) {
|
|
139
|
+
let tasks = [];
|
|
140
|
+
try {
|
|
141
|
+
tasks = Object.entries(readSourceTaskConfig(projectRoot)).map(([id, entry]) => taskConfigEntryToRecord(id, entry, "source-task-config"));
|
|
142
|
+
} catch {
|
|
143
|
+
tasks = Object.entries(readTaskConfig(projectRoot)).map(([id, entry]) => taskConfigEntryToRecord(id, entry, "legacy-task-config"));
|
|
144
|
+
}
|
|
145
|
+
const counts = tasks.reduce((acc, task) => {
|
|
146
|
+
const key = typeof task.status === "string" && task.status.length > 0 ? task.status : "open";
|
|
147
|
+
acc[key] = (acc[key] ?? 0) + 1;
|
|
148
|
+
return acc;
|
|
149
|
+
}, {});
|
|
150
|
+
console.log(`=== Project Rig Progress ===
|
|
151
|
+
`);
|
|
152
|
+
console.log(`Total tasks: ${tasks.length}`);
|
|
153
|
+
for (const status of Object.keys(counts).sort())
|
|
154
|
+
console.log(` ${status}: ${counts[status]}`);
|
|
155
|
+
}
|
|
156
|
+
async function taskScope(projectRoot, expandFiles, taskId) {
|
|
157
|
+
const activeTask = taskId || currentTaskId(projectRoot);
|
|
158
|
+
if (!activeTask)
|
|
159
|
+
throw new Error("No active task.");
|
|
160
|
+
const scopes = taskScopePatterns(projectRoot, activeTask);
|
|
161
|
+
if (scopes.length > 0)
|
|
162
|
+
process.stdout.write(`${scopes.join(`
|
|
163
|
+
`)}
|
|
164
|
+
`);
|
|
165
|
+
}
|
|
166
|
+
async function taskRecord(projectRoot, type, text, taskId) {
|
|
167
|
+
const activeTask = taskId || currentTaskId(projectRoot);
|
|
168
|
+
if (!activeTask)
|
|
169
|
+
throw new Error("No active task.");
|
|
170
|
+
const timestamp = new Date().toISOString();
|
|
171
|
+
if (type === "decision") {
|
|
172
|
+
const artifactService = artifacts();
|
|
173
|
+
const filename = "decision-log.md";
|
|
174
|
+
const existingNames = await artifactNames(artifactService, { projectRoot, taskId: activeTask });
|
|
175
|
+
const existing = existingNames.has(filename) ? (await artifactService.readArtifact({
|
|
176
|
+
projectRoot,
|
|
177
|
+
taskId: activeTask,
|
|
178
|
+
filename,
|
|
179
|
+
maxBytes: Number.MAX_SAFE_INTEGER
|
|
180
|
+
})).contents : "";
|
|
181
|
+
const result2 = await artifactService.writeArtifact({
|
|
182
|
+
projectRoot,
|
|
183
|
+
taskId: activeTask,
|
|
184
|
+
filename,
|
|
185
|
+
content: `${existing}
|
|
186
|
+
### ${timestamp}
|
|
187
|
+
|
|
188
|
+
${text}
|
|
189
|
+
|
|
190
|
+
`
|
|
191
|
+
});
|
|
192
|
+
console.log(`Decision recorded for ${activeTask}.`);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const result = stateStore().recordFailedApproach({ projectRoot, taskId: activeTask, text, timestamp });
|
|
196
|
+
console.log(result.message);
|
|
197
|
+
}
|
|
198
|
+
function taskArtifactDir(projectRoot, taskId) {
|
|
199
|
+
return artifacts().artifactDir({ projectRoot, ...taskId !== undefined ? { taskId } : {} });
|
|
200
|
+
}
|
|
201
|
+
async function taskArtifactWrite(projectRoot, filename, content, taskId) {
|
|
202
|
+
const result = await artifacts().writeArtifact({
|
|
203
|
+
projectRoot,
|
|
204
|
+
filename,
|
|
205
|
+
content,
|
|
206
|
+
...taskId !== undefined ? { taskId } : {}
|
|
207
|
+
});
|
|
208
|
+
console.log(`Wrote: ${result.path}`);
|
|
209
|
+
}
|
|
210
|
+
async function taskArtifactRead(projectRoot, filename, options = {}) {
|
|
211
|
+
return artifacts().readArtifact({
|
|
212
|
+
projectRoot,
|
|
213
|
+
filename,
|
|
214
|
+
...options.taskId !== undefined ? { taskId: options.taskId } : {},
|
|
215
|
+
...options.maxBytes !== undefined ? { maxBytes: options.maxBytes } : {}
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
async function taskArtifacts(projectRoot, taskId) {
|
|
219
|
+
const activeTask = taskId || currentTaskId(projectRoot);
|
|
220
|
+
if (!activeTask)
|
|
221
|
+
throw new Error("No active task.");
|
|
222
|
+
const artifactService = artifacts();
|
|
223
|
+
const ref = { projectRoot, taskId: activeTask };
|
|
224
|
+
const artifactDir = artifactService.artifactDir(ref);
|
|
225
|
+
await artifactService.writeArtifact({
|
|
226
|
+
...ref,
|
|
227
|
+
filename: "changed-files.txt",
|
|
228
|
+
content: `${changedFilesForTask(projectRoot, activeTask, true).join(`
|
|
229
|
+
`)}
|
|
230
|
+
`
|
|
231
|
+
});
|
|
232
|
+
const existingNames = await artifactNames(artifactService, ref);
|
|
233
|
+
if (!existingNames.has("task-result.json")) {
|
|
234
|
+
await artifactService.writeArtifact({
|
|
235
|
+
...ref,
|
|
236
|
+
filename: "task-result.json",
|
|
237
|
+
content: `${JSON.stringify({ task_id: activeTask, status: "completed", summary: "TODO: Write a one-line summary of what you did", completed_at: new Date().toISOString() }, null, 2)}
|
|
238
|
+
`
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
for (const [filename, content] of [
|
|
242
|
+
["decision-log.md", `# Decision Log: ${activeTask}
|
|
243
|
+
|
|
244
|
+
Record key decisions here using: rig-agent record decision "..."
|
|
245
|
+
`],
|
|
246
|
+
["next-actions.md", `# Next Actions: ${activeTask}
|
|
247
|
+
|
|
248
|
+
- TODO: Replace this scaffold with real content before completion
|
|
249
|
+
`]
|
|
250
|
+
]) {
|
|
251
|
+
if (!existingNames.has(filename)) {
|
|
252
|
+
await artifactService.writeArtifact({ ...ref, filename, content });
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
console.log(`Artifacts at: ${artifactDir}/`);
|
|
256
|
+
}
|
|
257
|
+
async function artifactNames(artifactService, ref) {
|
|
258
|
+
const entries = await artifactService.listArtifacts(ref);
|
|
259
|
+
return new Set(entries.filter((entry) => entry.kind === "file").map((entry) => basename(entry.path)));
|
|
260
|
+
}
|
|
261
|
+
function taskData() {
|
|
262
|
+
return {
|
|
263
|
+
currentTaskId,
|
|
264
|
+
readTaskConfig,
|
|
265
|
+
readSourceTaskConfig,
|
|
266
|
+
readValidationDescriptions,
|
|
267
|
+
lookupTask,
|
|
268
|
+
taskLookup,
|
|
269
|
+
artifactDirForId,
|
|
270
|
+
taskInfo,
|
|
271
|
+
taskDeps,
|
|
272
|
+
taskStatus,
|
|
273
|
+
taskScope,
|
|
274
|
+
taskRecord,
|
|
275
|
+
taskArtifacts,
|
|
276
|
+
taskArtifactDir,
|
|
277
|
+
taskArtifactWrite,
|
|
278
|
+
taskArtifactRead,
|
|
279
|
+
taskDependencyIds,
|
|
280
|
+
changedFilesForTask,
|
|
281
|
+
pendingFilesForTask
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
export {
|
|
285
|
+
taskData
|
|
286
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function taskArtifactDir(projectRoot: string, taskId?: string): string;
|
|
2
|
+
export declare function taskArtifacts(projectRoot: string, taskId?: string): Promise<void>;
|
|
3
|
+
export declare function taskArtifactWrite(projectRoot: string, filename: string, content: string, taskId?: string): Promise<void>;
|
|
4
|
+
export declare function taskDeps(projectRoot: string, taskId?: string): Promise<void>;
|
|
5
|
+
export declare function taskInfo(projectRoot: string, taskId?: string): Promise<void>;
|
|
6
|
+
export declare function taskLookup(projectRoot: string, id: string): string;
|
|
7
|
+
export declare function taskRecord(projectRoot: string, type: "decision" | "failure", text: string, taskId?: string): Promise<void>;
|
|
8
|
+
export declare function taskScope(projectRoot: string, expandFiles: boolean, taskId?: string): Promise<void>;
|
|
9
|
+
export declare function taskStatus(projectRoot: string): void;
|
|
10
|
+
export declare function taskValidate(projectRoot: string, taskId?: string, validatorRegistry?: unknown): Promise<boolean>;
|