@dotdrelle/wiki-manager 0.12.11 → 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/.env.example +6 -0
- package/docker-compose.yml +1 -1
- package/package.json +1 -1
- package/src/agent/graph.js +377 -142
- package/src/agent/graph.test.js +576 -34
- package/src/agent/llm.js +5 -5
- package/src/cli/wiki-manager.js +294 -9
- package/src/cli/wiki-manager.test.js +28 -0
- package/src/commands/slash.js +80 -13
- package/src/commands/slash.test.js +9 -1
- package/src/contracts/schemas.js +33 -0
- package/src/contracts/schemas.test.js +14 -0
- package/src/core/agentEvents.js +6 -0
- package/src/core/agentEvents.test.js +26 -0
- package/src/core/agentLoop.js +15 -16
- package/src/core/agentLoop.test.js +9 -7
- package/src/core/buildInfo.json +2 -2
- package/src/core/mcp.js +13 -6
- package/src/core/mcp.test.js +0 -12
- package/src/core/skills.js +0 -28
- package/src/orchestrator/capabilityRegistry.js +14 -0
- package/src/orchestrator/capabilityRegistry.test.js +12 -1
- package/src/orchestrator/dependencyResolver.js +10 -1
- package/src/orchestrator/dispatcher.js +34 -3
- package/src/orchestrator/dispatcher.test.js +34 -0
- package/src/orchestrator/objectiveResolver.js +79 -0
- package/src/orchestrator/objectiveResolver.test.js +50 -0
- package/src/orchestrator/scheduler.js +24 -0
- package/src/orchestrator/scheduler.test.js +65 -1
- package/src/runtime/client.js +34 -2
- package/src/runtime/lifecycle.js +1 -1
- package/src/runtime/recoveryManager.js +14 -7
- package/src/runtime/runner.js +214 -14
- package/src/runtime/runner.test.js +100 -2
- package/src/runtime/server.js +43 -3
- package/src/runtime/supervisor.js +65 -1
- package/src/runtime/supervisor.test.js +80 -0
- package/src/shell/LeftPane.tsx +9 -2
- package/src/shell/repl.js +57 -42
- package/src/shell/repl.test.js +81 -12
- package/src/shell/tui.tsx +26 -3
- package/src/shell/useSession.ts +15 -3
package/src/shell/useSession.ts
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
conversationMessages,
|
|
18
18
|
createSession,
|
|
19
19
|
runtimeUnavailableAgentMessage,
|
|
20
|
+
sanitizeRuntimeStateForDisplay,
|
|
20
21
|
} from './repl.js';
|
|
21
22
|
import { useAgent } from './useAgent';
|
|
22
23
|
|
|
@@ -340,10 +341,20 @@ export function useSession(props: { agent: unknown; packageJson: Record<string,
|
|
|
340
341
|
function mergeRuntimeConversation(state: any) {
|
|
341
342
|
const workspace = (session as any).workspace || '__global__';
|
|
342
343
|
const runtimeConversation = Array.isArray(state?.conversation) ? state.conversation : [];
|
|
343
|
-
if (runtimeConversation.length === 0) return;
|
|
344
344
|
const target = conversationMessages(session);
|
|
345
345
|
const backed = runtimeConversationRefsByWorkspace.get(workspace) ?? [];
|
|
346
346
|
runtimeConversationRefsByWorkspace.set(workspace, backed);
|
|
347
|
+
if (runtimeConversation.length === 0) {
|
|
348
|
+
// Idle runtime display state deliberately has no historical run
|
|
349
|
+
// conversation. Remove only entries previously merged from that
|
|
350
|
+
// runtime; preserve local slash-command output and the current input.
|
|
351
|
+
for (const entry of backed) {
|
|
352
|
+
const index = target.indexOf(entry);
|
|
353
|
+
if (index !== -1) target.splice(index, 1);
|
|
354
|
+
}
|
|
355
|
+
backed.length = 0;
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
347
358
|
// The merge is index-aligned with the runtime conversation array. If that
|
|
348
359
|
// array got SHORTER (runtime restart, projection reset), keeping stale
|
|
349
360
|
// refs would make every new runtime entry silently overwrite an old
|
|
@@ -388,8 +399,9 @@ export function useSession(props: { agent: unknown; packageJson: Record<string,
|
|
|
388
399
|
function syncRuntimeState() {
|
|
389
400
|
void fetchRuntimeState({ url: props.runtime.url, workspace: (session as any).workspace ?? null })
|
|
390
401
|
.then((state) => {
|
|
391
|
-
|
|
392
|
-
|
|
402
|
+
const displayState = sanitizeRuntimeStateForDisplay(state);
|
|
403
|
+
setRuntimeState(displayState);
|
|
404
|
+
mergeRuntimeConversation(displayState);
|
|
393
405
|
setRuntimeStatus('connected');
|
|
394
406
|
refresh();
|
|
395
407
|
})
|