@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.
Files changed (42) hide show
  1. package/.env.example +6 -0
  2. package/docker-compose.yml +1 -1
  3. package/package.json +1 -1
  4. package/src/agent/graph.js +377 -142
  5. package/src/agent/graph.test.js +576 -34
  6. package/src/agent/llm.js +5 -5
  7. package/src/cli/wiki-manager.js +294 -9
  8. package/src/cli/wiki-manager.test.js +28 -0
  9. package/src/commands/slash.js +80 -13
  10. package/src/commands/slash.test.js +9 -1
  11. package/src/contracts/schemas.js +33 -0
  12. package/src/contracts/schemas.test.js +14 -0
  13. package/src/core/agentEvents.js +6 -0
  14. package/src/core/agentEvents.test.js +26 -0
  15. package/src/core/agentLoop.js +15 -16
  16. package/src/core/agentLoop.test.js +9 -7
  17. package/src/core/buildInfo.json +2 -2
  18. package/src/core/mcp.js +13 -6
  19. package/src/core/mcp.test.js +0 -12
  20. package/src/core/skills.js +0 -28
  21. package/src/orchestrator/capabilityRegistry.js +14 -0
  22. package/src/orchestrator/capabilityRegistry.test.js +12 -1
  23. package/src/orchestrator/dependencyResolver.js +10 -1
  24. package/src/orchestrator/dispatcher.js +34 -3
  25. package/src/orchestrator/dispatcher.test.js +34 -0
  26. package/src/orchestrator/objectiveResolver.js +79 -0
  27. package/src/orchestrator/objectiveResolver.test.js +50 -0
  28. package/src/orchestrator/scheduler.js +24 -0
  29. package/src/orchestrator/scheduler.test.js +65 -1
  30. package/src/runtime/client.js +34 -2
  31. package/src/runtime/lifecycle.js +1 -1
  32. package/src/runtime/recoveryManager.js +14 -7
  33. package/src/runtime/runner.js +214 -14
  34. package/src/runtime/runner.test.js +100 -2
  35. package/src/runtime/server.js +43 -3
  36. package/src/runtime/supervisor.js +65 -1
  37. package/src/runtime/supervisor.test.js +80 -0
  38. package/src/shell/LeftPane.tsx +9 -2
  39. package/src/shell/repl.js +57 -42
  40. package/src/shell/repl.test.js +81 -12
  41. package/src/shell/tui.tsx +26 -3
  42. package/src/shell/useSession.ts +15 -3
@@ -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
- setRuntimeState(state);
392
- mergeRuntimeConversation(state);
402
+ const displayState = sanitizeRuntimeStateForDisplay(state);
403
+ setRuntimeState(displayState);
404
+ mergeRuntimeConversation(displayState);
393
405
  setRuntimeStatus('connected');
394
406
  refresh();
395
407
  })