@netnodeag/kraftwerk 0.12.0 → 0.14.0
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/dist/inspector/chat/sessions.js +30 -6
- package/inspector/dist/assets/index-B1BtRAPj.js +80 -0
- package/inspector/dist/assets/index-B1Vm-R4m.css +1 -0
- package/inspector/dist/index.html +2 -2
- package/package.json +1 -1
- package/inspector/dist/assets/index-BIoC3aBd.js +0 -80
- package/inspector/dist/assets/index-BMT3xv2t.css +0 -1
|
@@ -5,7 +5,7 @@ import { knowledgeIndex } from "../knowledge.js";
|
|
|
5
5
|
import { getRun, listRuns, safeRunDir } from "../runs.js";
|
|
6
6
|
import { listSkills, readSkill } from "../skills.js";
|
|
7
7
|
import { listWorkflows } from "../workflows.js";
|
|
8
|
-
import { getMember } from "../team.js";
|
|
8
|
+
import { getMember, listMembers } from "../team.js";
|
|
9
9
|
import { startAcpBackend } from "./acp.js";
|
|
10
10
|
import { startPiBackend } from "./pi.js";
|
|
11
11
|
import { appendEvent, listChatMetas, newChatId, readEvents, readMeta, safeChatDir, writeMeta, } from "./store.js";
|
|
@@ -184,18 +184,42 @@ async function baseScopeContext(scope, agent) {
|
|
|
184
184
|
`verification is the human's click in the UI. Ask the user what knowledge to capture, then author concise, well-typed concepts.`);
|
|
185
185
|
}
|
|
186
186
|
if (scope.kind === "kraftwerk") {
|
|
187
|
-
const [{ workflows }, runs] = await Promise.all([
|
|
187
|
+
const [{ workflows }, runs, knowledge, members] = await Promise.all([
|
|
188
|
+
listWorkflows(),
|
|
189
|
+
listRuns(),
|
|
190
|
+
knowledgeIndex().catch(() => ({ bundles: [] })),
|
|
191
|
+
listMembers().catch(() => []),
|
|
192
|
+
]);
|
|
188
193
|
const wfLines = workflows
|
|
189
|
-
.map((w) => `- ${w.
|
|
194
|
+
.map((w) => `- ${w.slug}: ${w.description ?? w.name ?? ""} (${w.steps} steps, ${w.agents} agents)`)
|
|
190
195
|
.join("\n");
|
|
191
196
|
const runLines = runs
|
|
192
197
|
.slice(0, 10)
|
|
193
198
|
.map((r) => `- ${r.id} — ${r.workflow ?? "?"} [${r.status}] ${r.request ?? ""}`.trim())
|
|
194
199
|
.join("\n");
|
|
200
|
+
const bundleLines = knowledge.bundles
|
|
201
|
+
.map((b) => `- ${b.name} (${b.concepts} concepts${b.updatedAt ? `, updated ${b.updatedAt.slice(0, 10)}` : ""})`)
|
|
202
|
+
.join("\n");
|
|
203
|
+
const memberLines = members
|
|
204
|
+
.map((m) => `- ${m.emoji} ${m.name} (${m.slug})${m.description ? `: ${m.description}` : ""}`)
|
|
205
|
+
.join("\n");
|
|
195
206
|
return (`You are the assistant inside the kraftwerk inspector, a UI for a workflow-as-code agent framework. ` +
|
|
196
|
-
`The consumer project root is ${getProjectRoot()}; run outputs live in ${getOutputDir()} (one folder per run under runs/, each with a trace.jsonl and working files)
|
|
197
|
-
`
|
|
198
|
-
|
|
207
|
+
`The consumer project root is ${getProjectRoot()}; run outputs live in ${getOutputDir()} (one folder per run under runs/, each with a trace.jsonl and working files). ` +
|
|
208
|
+
`Everything below is current — no need to re-discover the project layout or the CLI before acting.\n\n` +
|
|
209
|
+
`## Workflows\n${wfLines || "(none)"}\n\n` +
|
|
210
|
+
`Run one directly with:\n` +
|
|
211
|
+
` KRAFTWERK_YES=1 npx kraftwerk run <workflow> "<request>"\n` +
|
|
212
|
+
`The command blocks until the run finishes and prints the run id; artifacts land in the output ` +
|
|
213
|
+
`folder above. When the user's request matches a workflow, run it instead of doing the work by hand.\n\n` +
|
|
214
|
+
`## Recent runs\n${runLines || "(none)"}\n\n` +
|
|
215
|
+
`## Knowledge\nOKF bundles in this project:\n${bundleLines || "(none)"}\n` +
|
|
216
|
+
`Read with \`npx kraftwerk knowledge list [bundle]\`, \`get <bundle>/<path>\`, \`search <text>\`. ` +
|
|
217
|
+
`Write ONLY through \`npx kraftwerk knowledge put <bundle>/<path> --file <tmp.md> --actor kraftwerk-chat/${agent}\` ` +
|
|
218
|
+
`(stamps provenance, maintains index.md/log.md — never hand-edit those).\n\n` +
|
|
219
|
+
`## Team agents\n${memberLines || "(none)"}\n` +
|
|
220
|
+
`These are persistent agent teammates (defined under agents/); the user talks to them on the ` +
|
|
221
|
+
`Agents screen. Point the user there when a request clearly belongs to one of them.\n\n` +
|
|
222
|
+
`Answer questions about workflows and runs by reading the files above. Do not modify run outputs unless asked.`);
|
|
199
223
|
}
|
|
200
224
|
if (scope.kind === "run") {
|
|
201
225
|
const run = await getRun(scope.runId);
|