@dotdrelle/wiki-manager 0.9.3 → 0.11.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/README.md +21 -6
- package/agents.docker-compose.yml +5 -0
- package/package.json +5 -2
- package/src/agent/graph.js +68 -9
- package/src/agent/graph.test.js +64 -0
- package/src/cli/wiki-manager.js +1 -1
- package/src/commands/slash.js +6 -2
- package/src/contracts/README.md +16 -0
- package/src/contracts/schemas.js +302 -0
- package/src/contracts/schemas.test.js +93 -0
- package/src/core/activity.js +14 -2
- package/src/core/activity.test.js +4 -2
- package/src/core/agentEvents.js +158 -15
- package/src/core/agentEvents.test.js +54 -12
- package/src/core/agentLoop.js +32 -7
- package/src/core/mcp.js +3 -1
- package/src/core/plan.js +4 -0
- package/src/core/planPatch.js +224 -0
- package/src/core/planPatch.test.js +63 -0
- package/src/core/workflow.js +264 -0
- package/src/core/workflow.test.js +66 -0
- package/src/runtime/client.js +28 -1
- package/src/runtime/runner.js +432 -20
- package/src/runtime/runner.test.js +273 -1
- package/src/runtime/server.js +322 -15
- package/src/runtime/server.test.js +339 -0
- package/src/runtime/store.js +59 -10
- package/src/runtime/store.test.js +47 -1
- package/src/shell/RightPane.tsx +1 -7
- package/src/shell/StartupScreen.tsx +212 -0
- package/src/shell/repl.js +51 -7
- package/src/shell/repl.test.js +77 -1
- package/src/shell/textFit.ts +6 -0
- package/src/shell/tui.tsx +163 -0
- package/src/shell/useAgent.ts +17 -9
- package/src/shell/useSession.ts +34 -0
package/src/shell/useSession.ts
CHANGED
|
@@ -169,6 +169,18 @@ export function useSession(props: { agent: unknown; packageJson: Record<string,
|
|
|
169
169
|
let lastVisiblePlan: Array<{ step: number; description: string; status: string }> | null = null;
|
|
170
170
|
const activities = createMemo(() => {
|
|
171
171
|
version();
|
|
172
|
+
const workflowActivities = nonEmptyRuntimeArray(runtimeState()?.workflow?.nodes?.filter((node: any) => node.type === 'activity'));
|
|
173
|
+
if (workflowActivities) {
|
|
174
|
+
return workflowActivities.map((node: any) => ({
|
|
175
|
+
...(node.raw ?? {}),
|
|
176
|
+
key: node.key,
|
|
177
|
+
label: node.label,
|
|
178
|
+
status: node.status,
|
|
179
|
+
terminal: ['done', 'failed', 'cancelled'].includes(String(node.status)),
|
|
180
|
+
_runtime: true,
|
|
181
|
+
_workflow: true,
|
|
182
|
+
}));
|
|
183
|
+
}
|
|
172
184
|
const runtimeActivities = nonEmptyRuntimeArray(runtimeState()?.activities);
|
|
173
185
|
if (runtimeActivities) {
|
|
174
186
|
return runtimeActivities.map((activity: any) => ({ ...activity, _runtime: true }));
|
|
@@ -184,6 +196,10 @@ export function useSession(props: { agent: unknown; packageJson: Record<string,
|
|
|
184
196
|
});
|
|
185
197
|
const queueItems = createMemo(() => {
|
|
186
198
|
version();
|
|
199
|
+
const workflowQueue = nonEmptyRuntimeArray(runtimeState()?.workflow?.nodes?.filter((node: any) => node.type === 'queue'));
|
|
200
|
+
if (workflowQueue) {
|
|
201
|
+
return workflowQueue.map((node: any) => ({ ...(node.raw ?? {}), id: node.itemId ?? node.id, label: node.label, status: node.status, _runtime: true, _workflow: true }));
|
|
202
|
+
}
|
|
187
203
|
const runtimeQueue = nonEmptyRuntimeArray(runtimeState()?.queue);
|
|
188
204
|
if (runtimeQueue) return runtimeQueue.map((item: any) => ({ ...item, _runtime: true }));
|
|
189
205
|
return projectQueue((session as any).headlessPlan, (session as any).jobQueue ?? [], { workspace: (session as any).workspace ?? null })
|
|
@@ -191,6 +207,14 @@ export function useSession(props: { agent: unknown; packageJson: Record<string,
|
|
|
191
207
|
});
|
|
192
208
|
const queueInfo = createMemo(() => {
|
|
193
209
|
version();
|
|
210
|
+
const workflowQueue = runtimeState()?.workflow?.nodes?.filter((node: any) => node.type === 'queue');
|
|
211
|
+
if (Array.isArray(workflowQueue)) {
|
|
212
|
+
return {
|
|
213
|
+
active: workflowQueue.filter((item: any) => ['waiting', 'starting', 'running', 'queued', 'pending', 'pending_approval'].includes(String(item.status ?? '').toLowerCase())).length,
|
|
214
|
+
current: workflowQueue.filter((item: any) => ['starting', 'running'].includes(String(item.status ?? '').toLowerCase())).length,
|
|
215
|
+
frozen: 0,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
194
218
|
const runtimeQueue = runtimeState()?.queue;
|
|
195
219
|
if (Array.isArray(runtimeQueue)) {
|
|
196
220
|
return {
|
|
@@ -203,6 +227,16 @@ export function useSession(props: { agent: unknown; packageJson: Record<string,
|
|
|
203
227
|
});
|
|
204
228
|
const plan = createMemo(() => {
|
|
205
229
|
version();
|
|
230
|
+
const workflowTasks = nonEmptyRuntimeArray(runtimeState()?.workflow?.nodes?.filter((node: any) => node.type === 'task'));
|
|
231
|
+
if (workflowTasks) {
|
|
232
|
+
return workflowTasks
|
|
233
|
+
.sort((a: any, b: any) => Number(a.step ?? 0) - Number(b.step ?? 0))
|
|
234
|
+
.map((node: any, index: number) => ({
|
|
235
|
+
step: Number(node.step ?? index + 1),
|
|
236
|
+
description: String(node.description ?? node.label ?? `Step ${index + 1}`),
|
|
237
|
+
status: String(node.status ?? 'pending'),
|
|
238
|
+
}));
|
|
239
|
+
}
|
|
206
240
|
const runtimePlan = nonEmptyRuntimeArray(runtimeState()?.plan);
|
|
207
241
|
if (runtimePlan) {
|
|
208
242
|
return runtimePlan.map((step: any, index: number) => ({
|