@tea-agent/loop-agent 0.33.5 → 0.33.6

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 (57) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/application/task-lifecycle/advance.js +254 -4
  3. package/dist/application/task-lifecycle/gates.js +50 -0
  4. package/dist/application/task-lifecycle/observe.js +11 -2
  5. package/dist/commands/init-upgrade.js +32 -1
  6. package/dist/commands/init.js +94 -3
  7. package/dist/executors/shell-write-guard.js +26 -8
  8. package/dist/shared/operator/capabilities.js +72 -42
  9. package/dist/shared/resilient-git.js +133 -0
  10. package/dist/task/source-prepare/artifact-meta.js +137 -0
  11. package/dist/task/source-prepare/index.js +2 -0
  12. package/dist/task/source-prepare/parse-intent.js +58 -10
  13. package/dist/task/source-prepare/prepare.js +180 -16
  14. package/dist/task/source-prepare/reference-integrity.js +18 -2
  15. package/dist/task/source-prepare/semantic-intake.js +404 -0
  16. package/dist/worker/console/app-data.js +2 -0
  17. package/dist/worker/console/chat/chat-event-store.js +190 -25
  18. package/dist/worker/console/chat/pi-console-config.js +250 -32
  19. package/dist/worker/console/chat/pi-runtime.js +625 -71
  20. package/dist/worker/console/chat/resource-loader.js +5 -4
  21. package/dist/worker/console/chat/routes.js +324 -146
  22. package/dist/worker/console/chat/runtime-context.js +48 -12
  23. package/dist/worker/console/chat/runtime-selection.js +59 -0
  24. package/dist/worker/console/chat/shortcuts.js +1 -0
  25. package/dist/worker/console/chat/tool-adapter.js +9 -3
  26. package/dist/worker/console/chat/tools.js +5 -1
  27. package/dist/worker/console/dag-execution-receipt.js +380 -0
  28. package/dist/worker/console/operator-actions.js +559 -68
  29. package/dist/worker/console/server.js +8 -15
  30. package/dist/worker/console/static/assets/index-BUOLppPr.js +28 -0
  31. package/dist/worker/console/static/assets/index-C1KzazY5.css +1 -0
  32. package/dist/worker/console/static/index.html +2 -2
  33. package/dist/worker/console/static-src/operator-chat/chat-sse-events.js +45 -8
  34. package/dist/worker/console/static-src/operator-chat/refs.js +9 -0
  35. package/dist/worker/console/static-src/operator-chat/runtime-snapshot-store.js +257 -0
  36. package/dist/worker/console/static-src/operator-chat/useChatSessions.js +16 -0
  37. package/dist/worker/console/static-src/operator-chat/useChatStream.js +210 -184
  38. package/dist/worker/console/static-src/operator-chat/useChatThread.js +49 -5
  39. package/dist/worker/console/static-src/operator-chat/useComposer.js +17 -0
  40. package/dist/worker/console/static-src/operator-chat/useRuntimeControls.js +225 -74
  41. package/dist/worker/console/static-src/operator-chat/useRuntimeSnapshot.js +196 -0
  42. package/dist/worker/delivery/final-verification.js +13 -5
  43. package/dist/worker/delivery/package.js +31 -19
  44. package/dist/worker/delivery/verification-bundle.js +6 -4
  45. package/dist/worker/observe/static/operator-chrome.css +5 -2
  46. package/dist/worker/observe/static/operator-chrome.js +6 -1
  47. package/dist/worker/observe/static/styles.css +39 -9
  48. package/dist/workflows/dag/frontend-worktree-diff.js +12 -27
  49. package/dist/workflows/dag/workspace-checkpoint.js +8 -27
  50. package/harness.json +1 -1
  51. package/package.json +1 -1
  52. package/skills/loop-agent/references/command-reference.md +3 -1
  53. package/skills/loop-agent/references/source-and-plan-practice.md +13 -0
  54. package/skills/loop-agent/references/task-workflow.md +4 -0
  55. package/dist/worker/console/chat/instruction-skills.js +0 -217
  56. package/dist/worker/console/static/assets/index-CnUXAqxG.css +0 -1
  57. package/dist/worker/console/static/assets/index-CteJFFL2.js +0 -29
@@ -6,6 +6,7 @@ import { fileURLToPath } from "node:url";
6
6
  import { LoopAgentClient } from "../loop-agent/loop-agent-client.js";
7
7
  import { openConsoleAppData } from "./app-data.js";
8
8
  import { DagConfirmationStore } from "./dag-confirmation.js";
9
+ import { DagExecutionReceiptStore } from "./dag-execution-receipt.js";
9
10
  import { DraftStore } from "./draft-store.js";
10
11
  import { AssessmentStore } from "./interview/assessment.js";
11
12
  import { InterviewSessionStore } from "./interview/session.js";
@@ -59,6 +60,7 @@ export async function createConsoleServer(options) {
59
60
  });
60
61
  const drafts = new DraftStore(appData);
61
62
  const confirmations = new DagConfirmationStore(appData, bootToken.confirmationToken);
63
+ const dagExecutionReceipts = new DagExecutionReceiptStore(appData);
62
64
  const interviews = new InterviewSessionStore(appData);
63
65
  const assessments = new AssessmentStore(appData);
64
66
  const readiness = await probePiReadiness({
@@ -94,6 +96,7 @@ export async function createConsoleServer(options) {
94
96
  events,
95
97
  drafts,
96
98
  confirmations,
99
+ dagExecutionReceipts,
97
100
  humanGateSecret: bootToken.confirmationToken,
98
101
  interviews,
99
102
  assessments,
@@ -111,16 +114,18 @@ export async function createConsoleServer(options) {
111
114
  // custom-tool execute() calls dispatch into the operator action layer (Gate 3).
112
115
  // Chat session dir is dedicated (app-data/chat-sessions), NOT user default.
113
116
  const chatStore = new ChatSessionStore(appData);
114
- const chatEvents = createChatEventStore({ appData });
117
+ // M5.1: every Console boot owns a fresh event-log generation. A browser
118
+ // reconnecting with an old SSE cursor must reconcile from snapshot rather
119
+ // than silently consume a different process' event namespace.
120
+ const chatEventEpoch = randomBytes(12).toString("hex");
121
+ const chatEvents = createChatEventStore({ appData, epoch: chatEventEpoch });
115
122
  const chatOperationLinker = createChatOperationLinker({
116
123
  chatEvents,
117
124
  operations,
118
125
  operationEvents: events,
119
126
  });
120
- const skillsDir = resolveLoopAgentSkillsDir(repoRoot);
121
127
  const chatRuntime = new ConsolePiRuntime({
122
128
  cwd: repoRoot,
123
- skillsDir,
124
129
  sessionDir: appData.chatSessions,
125
130
  actionContext,
126
131
  });
@@ -137,7 +142,6 @@ export async function createConsoleServer(options) {
137
142
  bootToken,
138
143
  getConsoleOrigin,
139
144
  allowNonLoopbackAccess: !loopbackBind,
140
- skillsDir,
141
145
  };
142
146
  const nightAuxTicker = new NightAuxTicker({
143
147
  repoRoot,
@@ -292,17 +296,6 @@ export async function createConsoleServer(options) {
292
296
  });
293
297
  });
294
298
  }
295
- /** Resolve the loop-agent repo skills/ directory (source repo or npm pack asset). */
296
- function resolveLoopAgentSkillsDir(repoRoot) {
297
- // When running from dist (npm pack), skills/ is a sibling of dist/ at the
298
- // package root. When running from source (tsx), it's the repo root.
299
- const fromDist = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "..", "..", "skills");
300
- const fromRepo = path.resolve(repoRoot, "skills");
301
- // Prefer whichever exists; dist path wins if present (npm-installed runtime).
302
- if (existsSync(fromDist))
303
- return fromDist;
304
- return fromRepo;
305
- }
306
299
  function requestSource(req) {
307
300
  const forwarded = req.headers["x-forwarded-for"];
308
301
  if (typeof forwarded === "string" && forwarded.trim()) {