gsd-pi 2.45.0-dev.fdcf73c → 2.46.0-dev.cc9d310

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 (180) hide show
  1. package/dist/resources/extensions/gsd/auto/phases.js +14 -35
  2. package/dist/resources/extensions/gsd/auto/session.js +0 -11
  3. package/dist/resources/extensions/gsd/auto-artifact-paths.js +112 -0
  4. package/dist/resources/extensions/gsd/auto-post-unit.js +25 -96
  5. package/dist/resources/extensions/gsd/auto-start.js +2 -3
  6. package/dist/resources/extensions/gsd/auto.js +8 -52
  7. package/dist/resources/extensions/gsd/bootstrap/register-hooks.js +18 -0
  8. package/dist/resources/extensions/gsd/commands/context.js +0 -4
  9. package/dist/resources/extensions/gsd/commands/handlers/parallel.js +1 -1
  10. package/dist/resources/extensions/gsd/crash-recovery.js +2 -4
  11. package/dist/resources/extensions/gsd/dashboard-overlay.js +0 -44
  12. package/dist/resources/extensions/gsd/doctor-checks.js +166 -1
  13. package/dist/resources/extensions/gsd/doctor.js +3 -1
  14. package/dist/resources/extensions/gsd/gsd-db.js +11 -2
  15. package/dist/resources/extensions/gsd/guided-flow.js +1 -2
  16. package/dist/resources/extensions/gsd/parallel-merge.js +1 -1
  17. package/dist/resources/extensions/gsd/parallel-orchestrator.js +5 -18
  18. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
  19. package/dist/resources/extensions/gsd/prompts/complete-slice.md +10 -23
  20. package/dist/resources/extensions/gsd/prompts/discuss.md +2 -2
  21. package/dist/resources/extensions/gsd/prompts/execute-task.md +5 -15
  22. package/dist/resources/extensions/gsd/prompts/guided-discuss-milestone.md +1 -1
  23. package/dist/resources/extensions/gsd/prompts/guided-discuss-slice.md +1 -1
  24. package/dist/resources/extensions/gsd/prompts/guided-plan-slice.md +1 -1
  25. package/dist/resources/extensions/gsd/prompts/guided-research-slice.md +1 -1
  26. package/dist/resources/extensions/gsd/prompts/plan-milestone.md +1 -1
  27. package/dist/resources/extensions/gsd/prompts/plan-slice.md +4 -2
  28. package/dist/resources/extensions/gsd/prompts/queue.md +2 -2
  29. package/dist/resources/extensions/gsd/prompts/quick-task.md +2 -0
  30. package/dist/resources/extensions/gsd/prompts/reactive-execute.md +1 -1
  31. package/dist/resources/extensions/gsd/prompts/research-slice.md +3 -3
  32. package/dist/resources/extensions/gsd/prompts/rethink.md +7 -2
  33. package/dist/resources/extensions/gsd/prompts/system.md +1 -1
  34. package/dist/resources/extensions/gsd/session-lock.js +1 -3
  35. package/dist/resources/extensions/gsd/state.js +7 -0
  36. package/dist/resources/extensions/gsd/sync-lock.js +89 -0
  37. package/dist/resources/extensions/gsd/tools/complete-milestone.js +58 -12
  38. package/dist/resources/extensions/gsd/tools/complete-slice.js +56 -11
  39. package/dist/resources/extensions/gsd/tools/complete-task.js +50 -2
  40. package/dist/resources/extensions/gsd/tools/plan-milestone.js +37 -1
  41. package/dist/resources/extensions/gsd/tools/plan-slice.js +30 -1
  42. package/dist/resources/extensions/gsd/tools/plan-task.js +27 -1
  43. package/dist/resources/extensions/gsd/tools/reassess-roadmap.js +32 -2
  44. package/dist/resources/extensions/gsd/tools/reopen-slice.js +86 -0
  45. package/dist/resources/extensions/gsd/tools/reopen-task.js +90 -0
  46. package/dist/resources/extensions/gsd/tools/replan-slice.js +32 -2
  47. package/dist/resources/extensions/gsd/unit-ownership.js +85 -0
  48. package/dist/resources/extensions/gsd/workflow-events.js +102 -0
  49. package/dist/resources/extensions/gsd/workflow-logger.js +56 -1
  50. package/dist/resources/extensions/gsd/workflow-manifest.js +244 -0
  51. package/dist/resources/extensions/gsd/workflow-migration.js +280 -0
  52. package/dist/resources/extensions/gsd/workflow-projections.js +373 -0
  53. package/dist/resources/extensions/gsd/workflow-reconcile.js +411 -0
  54. package/dist/resources/extensions/gsd/write-intercept.js +84 -0
  55. package/dist/web/standalone/.next/BUILD_ID +1 -1
  56. package/dist/web/standalone/.next/app-path-routes-manifest.json +17 -17
  57. package/dist/web/standalone/.next/build-manifest.json +2 -2
  58. package/dist/web/standalone/.next/prerender-manifest.json +3 -3
  59. package/dist/web/standalone/.next/server/app/_global-error.html +2 -2
  60. package/dist/web/standalone/.next/server/app/_global-error.rsc +1 -1
  61. package/dist/web/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  62. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  63. package/dist/web/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  64. package/dist/web/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  65. package/dist/web/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  66. package/dist/web/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  67. package/dist/web/standalone/.next/server/app/_not-found.html +1 -1
  68. package/dist/web/standalone/.next/server/app/_not-found.rsc +1 -1
  69. package/dist/web/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  70. package/dist/web/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  71. package/dist/web/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  72. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  73. package/dist/web/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  74. package/dist/web/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  75. package/dist/web/standalone/.next/server/app/index.html +1 -1
  76. package/dist/web/standalone/.next/server/app/index.rsc +1 -1
  77. package/dist/web/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  78. package/dist/web/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
  79. package/dist/web/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  80. package/dist/web/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
  81. package/dist/web/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  82. package/dist/web/standalone/.next/server/app-paths-manifest.json +17 -17
  83. package/dist/web/standalone/.next/server/pages/404.html +1 -1
  84. package/dist/web/standalone/.next/server/pages/500.html +2 -2
  85. package/dist/web/standalone/.next/server/server-reference-manifest.json +1 -1
  86. package/package.json +1 -1
  87. package/packages/pi-coding-agent/package.json +1 -1
  88. package/pkg/package.json +1 -1
  89. package/src/resources/extensions/gsd/auto/loop-deps.ts +0 -19
  90. package/src/resources/extensions/gsd/auto/phases.ts +11 -35
  91. package/src/resources/extensions/gsd/auto/session.ts +0 -18
  92. package/src/resources/extensions/gsd/auto-artifact-paths.ts +131 -0
  93. package/src/resources/extensions/gsd/auto-dashboard.ts +0 -1
  94. package/src/resources/extensions/gsd/auto-post-unit.ts +25 -106
  95. package/src/resources/extensions/gsd/auto-start.ts +1 -3
  96. package/src/resources/extensions/gsd/auto.ts +4 -80
  97. package/src/resources/extensions/gsd/bootstrap/register-hooks.ts +22 -0
  98. package/src/resources/extensions/gsd/commands/context.ts +0 -5
  99. package/src/resources/extensions/gsd/commands/handlers/parallel.ts +1 -1
  100. package/src/resources/extensions/gsd/crash-recovery.ts +1 -5
  101. package/src/resources/extensions/gsd/dashboard-overlay.ts +0 -50
  102. package/src/resources/extensions/gsd/doctor-checks.ts +179 -1
  103. package/src/resources/extensions/gsd/doctor-types.ts +7 -1
  104. package/src/resources/extensions/gsd/doctor.ts +4 -1
  105. package/src/resources/extensions/gsd/gsd-db.ts +11 -2
  106. package/src/resources/extensions/gsd/guided-flow.ts +1 -2
  107. package/src/resources/extensions/gsd/parallel-merge.ts +1 -1
  108. package/src/resources/extensions/gsd/parallel-orchestrator.ts +5 -21
  109. package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
  110. package/src/resources/extensions/gsd/prompts/complete-slice.md +10 -23
  111. package/src/resources/extensions/gsd/prompts/discuss.md +2 -2
  112. package/src/resources/extensions/gsd/prompts/execute-task.md +5 -15
  113. package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +1 -1
  114. package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +1 -1
  115. package/src/resources/extensions/gsd/prompts/guided-plan-slice.md +1 -1
  116. package/src/resources/extensions/gsd/prompts/guided-research-slice.md +1 -1
  117. package/src/resources/extensions/gsd/prompts/plan-milestone.md +1 -1
  118. package/src/resources/extensions/gsd/prompts/plan-slice.md +4 -2
  119. package/src/resources/extensions/gsd/prompts/queue.md +2 -2
  120. package/src/resources/extensions/gsd/prompts/quick-task.md +2 -0
  121. package/src/resources/extensions/gsd/prompts/reactive-execute.md +1 -1
  122. package/src/resources/extensions/gsd/prompts/research-slice.md +3 -3
  123. package/src/resources/extensions/gsd/prompts/rethink.md +7 -2
  124. package/src/resources/extensions/gsd/prompts/system.md +1 -1
  125. package/src/resources/extensions/gsd/session-lock.ts +0 -4
  126. package/src/resources/extensions/gsd/state.ts +8 -0
  127. package/src/resources/extensions/gsd/sync-lock.ts +94 -0
  128. package/src/resources/extensions/gsd/tests/auto-lock-creation.test.ts +5 -13
  129. package/src/resources/extensions/gsd/tests/auto-loop.test.ts +6 -10
  130. package/src/resources/extensions/gsd/tests/complete-slice.test.ts +264 -228
  131. package/src/resources/extensions/gsd/tests/complete-task.test.ts +317 -250
  132. package/src/resources/extensions/gsd/tests/crash-recovery.test.ts +2 -8
  133. package/src/resources/extensions/gsd/tests/custom-engine-loop-integration.test.ts +0 -3
  134. package/src/resources/extensions/gsd/tests/gsd-db.test.ts +1 -1
  135. package/src/resources/extensions/gsd/tests/idle-recovery.test.ts +1 -1
  136. package/src/resources/extensions/gsd/tests/integration-proof.test.ts +15 -24
  137. package/src/resources/extensions/gsd/tests/journal-integration.test.ts +0 -3
  138. package/src/resources/extensions/gsd/tests/md-importer.test.ts +1 -1
  139. package/src/resources/extensions/gsd/tests/memory-store.test.ts +2 -2
  140. package/src/resources/extensions/gsd/tests/milestone-transition-state-rebuild.test.ts +8 -9
  141. package/src/resources/extensions/gsd/tests/parallel-budget-atomicity.test.ts +0 -1
  142. package/src/resources/extensions/gsd/tests/parallel-crash-recovery.test.ts +0 -7
  143. package/src/resources/extensions/gsd/tests/parallel-merge.test.ts +7 -8
  144. package/src/resources/extensions/gsd/tests/parallel-orchestration.test.ts +20 -24
  145. package/src/resources/extensions/gsd/tests/parallel-worker-monitoring.test.ts +0 -2
  146. package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +9 -6
  147. package/src/resources/extensions/gsd/tests/post-mutation-hook.test.ts +171 -0
  148. package/src/resources/extensions/gsd/tests/projection-regression.test.ts +174 -0
  149. package/src/resources/extensions/gsd/tests/prompt-contracts.test.ts +15 -14
  150. package/src/resources/extensions/gsd/tests/reopen-slice.test.ts +155 -0
  151. package/src/resources/extensions/gsd/tests/reopen-task.test.ts +165 -0
  152. package/src/resources/extensions/gsd/tests/session-lock-regression.test.ts +1 -4
  153. package/src/resources/extensions/gsd/tests/stop-auto-remote.test.ts +2 -3
  154. package/src/resources/extensions/gsd/tests/sync-lock.test.ts +122 -0
  155. package/src/resources/extensions/gsd/tests/unit-ownership.test.ts +175 -0
  156. package/src/resources/extensions/gsd/tests/workflow-events.test.ts +205 -0
  157. package/src/resources/extensions/gsd/tests/workflow-manifest.test.ts +186 -0
  158. package/src/resources/extensions/gsd/tests/workflow-projections.test.ts +171 -0
  159. package/src/resources/extensions/gsd/tests/write-intercept.test.ts +76 -0
  160. package/src/resources/extensions/gsd/tools/complete-milestone.ts +70 -13
  161. package/src/resources/extensions/gsd/tools/complete-slice.ts +68 -11
  162. package/src/resources/extensions/gsd/tools/complete-task.ts +63 -1
  163. package/src/resources/extensions/gsd/tools/plan-milestone.ts +45 -0
  164. package/src/resources/extensions/gsd/tools/plan-slice.ts +38 -0
  165. package/src/resources/extensions/gsd/tools/plan-task.ts +35 -1
  166. package/src/resources/extensions/gsd/tools/reassess-roadmap.ts +39 -1
  167. package/src/resources/extensions/gsd/tools/reopen-slice.ts +125 -0
  168. package/src/resources/extensions/gsd/tools/reopen-task.ts +129 -0
  169. package/src/resources/extensions/gsd/tools/replan-slice.ts +38 -1
  170. package/src/resources/extensions/gsd/types.ts +8 -0
  171. package/src/resources/extensions/gsd/unit-ownership.ts +104 -0
  172. package/src/resources/extensions/gsd/workflow-events.ts +154 -0
  173. package/src/resources/extensions/gsd/workflow-logger.ts +51 -1
  174. package/src/resources/extensions/gsd/workflow-manifest.ts +334 -0
  175. package/src/resources/extensions/gsd/workflow-migration.ts +345 -0
  176. package/src/resources/extensions/gsd/workflow-projections.ts +425 -0
  177. package/src/resources/extensions/gsd/workflow-reconcile.ts +503 -0
  178. package/src/resources/extensions/gsd/write-intercept.ts +90 -0
  179. /package/dist/web/standalone/.next/static/{zWYDSwB-terOjfhmWzqk1 → ZIDqryyYDroh_8AnaAOSG}/_buildManifest.js +0 -0
  180. /package/dist/web/standalone/.next/static/{zWYDSwB-terOjfhmWzqk1 → ZIDqryyYDroh_8AnaAOSG}/_ssgManifest.js +0 -0
@@ -0,0 +1,411 @@
1
+ import { join } from "node:path";
2
+ import { mkdirSync, existsSync, readFileSync, unlinkSync } from "node:fs";
3
+ import { readEvents, findForkPoint, appendEvent, getSessionId } from "./workflow-events.js";
4
+ import { transaction, updateTaskStatus, updateSliceStatus, insertVerificationEvidence, upsertDecision, openDatabase, } from "./gsd-db.js";
5
+ import { writeManifest } from "./workflow-manifest.js";
6
+ import { atomicWriteSync } from "./atomic-write.js";
7
+ import { acquireSyncLock, releaseSyncLock } from "./sync-lock.js";
8
+ // ─── replayEvents ─────────────────────────────────────────────────────────────
9
+ /**
10
+ * Replay a list of WorkflowEvents by dispatching each to the appropriate
11
+ * gsd-db function. This replaces the old engine.replayAll() pattern with
12
+ * direct DB calls.
13
+ */
14
+ function replayEvents(events) {
15
+ transaction(() => {
16
+ for (const event of events) {
17
+ const p = event.params;
18
+ switch (event.cmd) {
19
+ case "complete_task": {
20
+ const milestoneId = p["milestoneId"];
21
+ const sliceId = p["sliceId"];
22
+ const taskId = p["taskId"];
23
+ updateTaskStatus(milestoneId, sliceId, taskId, "done", event.ts);
24
+ break;
25
+ }
26
+ case "start_task": {
27
+ const milestoneId = p["milestoneId"];
28
+ const sliceId = p["sliceId"];
29
+ const taskId = p["taskId"];
30
+ updateTaskStatus(milestoneId, sliceId, taskId, "in-progress", event.ts);
31
+ break;
32
+ }
33
+ case "report_blocker": {
34
+ // report_blocker marks the task with blocker_discovered = 1
35
+ // The DB helper updateTaskStatus doesn't handle blockers,
36
+ // so we just update status to "blocked" as a best-effort replay.
37
+ const milestoneId = p["milestoneId"];
38
+ const sliceId = p["sliceId"];
39
+ const taskId = p["taskId"];
40
+ updateTaskStatus(milestoneId, sliceId, taskId, "blocked");
41
+ break;
42
+ }
43
+ case "record_verification": {
44
+ const milestoneId = p["milestoneId"];
45
+ const sliceId = p["sliceId"];
46
+ const taskId = p["taskId"];
47
+ insertVerificationEvidence({
48
+ taskId,
49
+ sliceId,
50
+ milestoneId,
51
+ command: p["command"] ?? "",
52
+ exitCode: p["exitCode"] ?? 0,
53
+ verdict: p["verdict"] ?? "",
54
+ durationMs: p["durationMs"] ?? 0,
55
+ });
56
+ break;
57
+ }
58
+ case "complete_slice": {
59
+ const milestoneId = p["milestoneId"];
60
+ const sliceId = p["sliceId"];
61
+ updateSliceStatus(milestoneId, sliceId, "done", event.ts);
62
+ break;
63
+ }
64
+ case "plan_slice": {
65
+ // plan_slice events are informational — slice should already exist.
66
+ // No DB mutation needed during replay (the slice was inserted at plan time).
67
+ break;
68
+ }
69
+ case "save_decision": {
70
+ upsertDecision({
71
+ id: p["id"] ?? `${p["scope"]}:${p["decision"]}`,
72
+ when_context: p["when_context"] ?? p["whenContext"] ?? "",
73
+ scope: p["scope"] ?? "",
74
+ decision: p["decision"] ?? "",
75
+ choice: p["choice"] ?? "",
76
+ rationale: p["rationale"] ?? "",
77
+ revisable: p["revisable"] ?? "yes",
78
+ made_by: (p["made_by"] ?? p["madeBy"] ?? "agent"),
79
+ superseded_by: p["superseded_by"] ?? p["supersededBy"] ?? null,
80
+ });
81
+ break;
82
+ }
83
+ default:
84
+ // Unknown commands are silently skipped during replay
85
+ break;
86
+ }
87
+ }
88
+ }); // end transaction
89
+ }
90
+ // ─── extractEntityKey ─────────────────────────────────────────────────────────
91
+ /**
92
+ * Map a WorkflowEvent command to its affected entity type and ID.
93
+ * Returns null for commands that don't touch a named entity
94
+ * (e.g. unknown or future cmds).
95
+ */
96
+ export function extractEntityKey(event) {
97
+ const p = event.params;
98
+ switch (event.cmd) {
99
+ case "complete_task":
100
+ case "start_task":
101
+ case "report_blocker":
102
+ case "record_verification":
103
+ return typeof p["taskId"] === "string"
104
+ ? { type: "task", id: p["taskId"] }
105
+ : null;
106
+ case "complete_slice":
107
+ return typeof p["sliceId"] === "string"
108
+ ? { type: "slice", id: p["sliceId"] }
109
+ : null;
110
+ case "plan_slice":
111
+ return typeof p["sliceId"] === "string"
112
+ ? { type: "slice_plan", id: p["sliceId"] }
113
+ : null;
114
+ case "save_decision":
115
+ if (typeof p["scope"] === "string" && typeof p["decision"] === "string") {
116
+ return { type: "decision", id: `${p["scope"]}:${p["decision"]}` };
117
+ }
118
+ return null;
119
+ default:
120
+ return null;
121
+ }
122
+ }
123
+ // ─── detectConflicts ──────────────────────────────────────────────────────────
124
+ /**
125
+ * Compare two sets of diverged events. Returns conflict entries for any
126
+ * entity touched by both sides.
127
+ *
128
+ * Entity-level granularity: if both sides touched task T01 (with any cmd),
129
+ * that is one conflict regardless of field-level differences.
130
+ */
131
+ export function detectConflicts(mainDiverged, wtDiverged) {
132
+ // Group each side's events by entity key
133
+ const mainByEntity = new Map();
134
+ for (const event of mainDiverged) {
135
+ const key = extractEntityKey(event);
136
+ if (!key)
137
+ continue;
138
+ const bucket = mainByEntity.get(`${key.type}:${key.id}`) ?? [];
139
+ bucket.push(event);
140
+ mainByEntity.set(`${key.type}:${key.id}`, bucket);
141
+ }
142
+ const wtByEntity = new Map();
143
+ for (const event of wtDiverged) {
144
+ const key = extractEntityKey(event);
145
+ if (!key)
146
+ continue;
147
+ const bucket = wtByEntity.get(`${key.type}:${key.id}`) ?? [];
148
+ bucket.push(event);
149
+ wtByEntity.set(`${key.type}:${key.id}`, bucket);
150
+ }
151
+ // Find entities touched by both sides
152
+ const conflicts = [];
153
+ for (const [entityKey, mainEvents] of mainByEntity) {
154
+ const wtEvents = wtByEntity.get(entityKey);
155
+ if (!wtEvents)
156
+ continue;
157
+ const colonIdx = entityKey.indexOf(":");
158
+ const entityType = entityKey.slice(0, colonIdx);
159
+ const entityId = entityKey.slice(colonIdx + 1);
160
+ conflicts.push({
161
+ entityType,
162
+ entityId,
163
+ mainSideEvents: mainEvents,
164
+ worktreeSideEvents: wtEvents,
165
+ });
166
+ }
167
+ return conflicts;
168
+ }
169
+ // ─── writeConflictsFile ───────────────────────────────────────────────────────
170
+ /**
171
+ * Write a human-readable CONFLICTS.md to basePath/.gsd/CONFLICTS.md.
172
+ * Lists each conflict with both sides' event payloads and resolution instructions.
173
+ */
174
+ export function writeConflictsFile(basePath, conflicts, worktreePath) {
175
+ const timestamp = new Date().toISOString();
176
+ const lines = [
177
+ `# Merge Conflicts — ${timestamp}`,
178
+ "",
179
+ `Conflicts detected merging worktree \`${worktreePath}\` into \`${basePath}\`.`,
180
+ `Run \`gsd resolve-conflict\` to resolve each conflict.`,
181
+ "",
182
+ ];
183
+ conflicts.forEach((conflict, idx) => {
184
+ lines.push(`## Conflict ${idx + 1}: ${conflict.entityType} ${conflict.entityId}`);
185
+ lines.push("");
186
+ lines.push("**Main side events:**");
187
+ for (const event of conflict.mainSideEvents) {
188
+ lines.push(`- ${event.cmd} at ${event.ts} (hash: ${event.hash})`);
189
+ lines.push(` params: ${JSON.stringify(event.params)}`);
190
+ }
191
+ lines.push("");
192
+ lines.push("**Worktree side events:**");
193
+ for (const event of conflict.worktreeSideEvents) {
194
+ lines.push(`- ${event.cmd} at ${event.ts} (hash: ${event.hash})`);
195
+ lines.push(` params: ${JSON.stringify(event.params)}`);
196
+ }
197
+ lines.push("");
198
+ lines.push(`**Resolve with:** \`gsd resolve-conflict --entity ${conflict.entityType}:${conflict.entityId} --pick [main|worktree]\``);
199
+ lines.push("");
200
+ });
201
+ const content = lines.join("\n");
202
+ const dir = join(basePath, ".gsd");
203
+ mkdirSync(dir, { recursive: true });
204
+ atomicWriteSync(join(dir, "CONFLICTS.md"), content);
205
+ }
206
+ // ─── reconcileWorktreeLogs ────────────────────────────────────────────────────
207
+ /**
208
+ * Event-log-based reconciliation algorithm:
209
+ *
210
+ * 1. Read both event logs
211
+ * 2. Find fork point (last common event by hash)
212
+ * 3. Slice diverged sets from each side
213
+ * 4. If no divergence on either side → return autoMerged: 0, conflicts: []
214
+ * 5. detectConflicts() — if any, writeConflictsFile + return early (D-04 all-or-nothing)
215
+ * 6. If clean: sort merged = mainDiverged + wtDiverged by timestamp, replayAll
216
+ * 7. Write merged event log (base + merged in timestamp order)
217
+ * 8. writeManifest
218
+ * 9. Return { autoMerged: merged.length, conflicts: [] }
219
+ */
220
+ export function reconcileWorktreeLogs(mainBasePath, worktreeBasePath) {
221
+ // Acquire advisory lock to prevent concurrent reconcile + append races
222
+ const lock = acquireSyncLock(mainBasePath);
223
+ if (!lock.acquired) {
224
+ process.stderr.write(`[gsd] reconcile: could not acquire sync lock — another reconciliation may be in progress\n`);
225
+ return { autoMerged: 0, conflicts: [] };
226
+ }
227
+ try {
228
+ return _reconcileWorktreeLogsInner(mainBasePath, worktreeBasePath);
229
+ }
230
+ finally {
231
+ releaseSyncLock(mainBasePath);
232
+ }
233
+ }
234
+ function _reconcileWorktreeLogsInner(mainBasePath, worktreeBasePath) {
235
+ // Step 1: Read both logs
236
+ const mainLogPath = join(mainBasePath, ".gsd", "event-log.jsonl");
237
+ const wtLogPath = join(worktreeBasePath, ".gsd", "event-log.jsonl");
238
+ const mainEvents = readEvents(mainLogPath);
239
+ const wtEvents = readEvents(wtLogPath);
240
+ // Step 2: Find fork point
241
+ const forkPoint = findForkPoint(mainEvents, wtEvents);
242
+ // Step 3: Slice diverged sets
243
+ const mainDiverged = mainEvents.slice(forkPoint + 1);
244
+ const wtDiverged = wtEvents.slice(forkPoint + 1);
245
+ // Step 4: No divergence on either side
246
+ if (mainDiverged.length === 0 && wtDiverged.length === 0) {
247
+ return { autoMerged: 0, conflicts: [] };
248
+ }
249
+ // Step 5: Detect conflicts (entity-level)
250
+ const conflicts = detectConflicts(mainDiverged, wtDiverged);
251
+ if (conflicts.length > 0) {
252
+ // D-04: atomic all-or-nothing — block entire merge
253
+ writeConflictsFile(mainBasePath, conflicts, worktreeBasePath);
254
+ process.stderr.write(`[gsd] reconcile: ${conflicts.length} conflict(s) detected — see ${join(mainBasePath, ".gsd", "CONFLICTS.md")}\n`);
255
+ return { autoMerged: 0, conflicts };
256
+ }
257
+ // Step 6: Clean merge — stable sort by timestamp (index-based tiebreaker)
258
+ const indexed = [...mainDiverged, ...wtDiverged].map((e, i) => ({ e, i }));
259
+ indexed.sort((a, b) => a.e.ts.localeCompare(b.e.ts) || a.i - b.i);
260
+ const merged = indexed.map(({ e }) => e);
261
+ // Step 7: Write merged event log FIRST (so crash recovery can re-derive DB state)
262
+ const baseEvents = mainEvents.slice(0, forkPoint + 1);
263
+ const mergedLog = baseEvents.concat(merged);
264
+ const logContent = mergedLog.map((e) => JSON.stringify(e)).join("\n") + (mergedLog.length > 0 ? "\n" : "");
265
+ mkdirSync(join(mainBasePath, ".gsd"), { recursive: true });
266
+ atomicWriteSync(join(mainBasePath, ".gsd", "event-log.jsonl"), logContent);
267
+ // Step 8: Replay into DB (wrapped in a transaction by replayEvents)
268
+ openDatabase(join(mainBasePath, ".gsd", "gsd.db"));
269
+ replayEvents(merged);
270
+ // Step 9: Write manifest
271
+ try {
272
+ writeManifest(mainBasePath);
273
+ }
274
+ catch (err) {
275
+ process.stderr.write(`[gsd] reconcile: manifest write failed (non-fatal): ${err.message}\n`);
276
+ }
277
+ return { autoMerged: merged.length, conflicts: [] };
278
+ }
279
+ // ─── Conflict Resolution (D-06) ─────────────────────────────────────────────
280
+ /**
281
+ * Parse CONFLICTS.md and return structured ConflictEntry[].
282
+ * Returns empty array when CONFLICTS.md does not exist.
283
+ *
284
+ * Parses the format written by writeConflictsFile:
285
+ * ## Conflict N: {entityType} {entityId}
286
+ * **Main side events:**
287
+ * - {cmd} at {ts} (hash: {hash})
288
+ * params: {JSON}
289
+ * **Worktree side events:**
290
+ * - {cmd} at {ts} (hash: {hash})
291
+ * params: {JSON}
292
+ */
293
+ export function listConflicts(basePath) {
294
+ const conflictsPath = join(basePath, ".gsd", "CONFLICTS.md");
295
+ if (!existsSync(conflictsPath))
296
+ return [];
297
+ const content = readFileSync(conflictsPath, "utf-8");
298
+ const conflicts = [];
299
+ // Split into per-conflict sections on "## Conflict N:" headings
300
+ const sections = content.split(/^## Conflict \d+:/m).slice(1);
301
+ for (const section of sections) {
302
+ // Extract entity type and id from first line: " {entityType} {entityId}"
303
+ const headingMatch = section.match(/^\s+(\S+)\s+(\S+)/);
304
+ if (!headingMatch)
305
+ continue;
306
+ const entityType = headingMatch[1];
307
+ const entityId = headingMatch[2];
308
+ // Split into main/worktree blocks
309
+ const mainMatch = section.split("**Main side events:**")[1];
310
+ const wtMatch = mainMatch?.split("**Worktree side events:**");
311
+ const mainBlock = wtMatch?.[0] ?? "";
312
+ const wtBlock = wtMatch?.[1] ?? "";
313
+ const mainSideEvents = parseEventBlock(mainBlock);
314
+ const worktreeSideEvents = parseEventBlock(wtBlock);
315
+ conflicts.push({ entityType, entityId, mainSideEvents, worktreeSideEvents });
316
+ }
317
+ return conflicts;
318
+ }
319
+ /**
320
+ * Parse a block of event lines from CONFLICTS.md into WorkflowEvent[].
321
+ * Each event spans two lines:
322
+ * - {cmd} at {ts} (hash: {hash})
323
+ * params: {JSON}
324
+ */
325
+ function parseEventBlock(block) {
326
+ const events = [];
327
+ // Find lines starting with "- " (event lines)
328
+ const lines = block.split("\n");
329
+ let i = 0;
330
+ while (i < lines.length) {
331
+ const line = lines[i].trim();
332
+ if (line.startsWith("- ")) {
333
+ // Parse: - {cmd} at {ts} (hash: {hash})
334
+ const eventMatch = line.match(/^-\s+(\S+)\s+at\s+(\S+)\s+\(hash:\s+(\S+)\)$/);
335
+ if (eventMatch) {
336
+ const cmd = eventMatch[1];
337
+ const ts = eventMatch[2];
338
+ const hash = eventMatch[3];
339
+ // Next line: " params: {JSON}"
340
+ let params = {};
341
+ const nextLine = lines[i + 1];
342
+ if (nextLine) {
343
+ const paramsMatch = nextLine.trim().match(/^params:\s+(.+)$/);
344
+ if (paramsMatch) {
345
+ try {
346
+ params = JSON.parse(paramsMatch[1]);
347
+ }
348
+ catch {
349
+ // Keep empty params on parse error
350
+ }
351
+ i++; // consume params line
352
+ }
353
+ }
354
+ events.push({ cmd, params, ts, hash, actor: "agent", session_id: getSessionId() });
355
+ }
356
+ }
357
+ i++;
358
+ }
359
+ return events;
360
+ }
361
+ /**
362
+ * Resolve a single conflict by picking one side's events.
363
+ * Replays the picked events through the DB helpers, appends them to the event log,
364
+ * and updates or removes CONFLICTS.md.
365
+ *
366
+ * When the last conflict is resolved, non-conflicting events from both sides
367
+ * are also replayed (they were blocked by the all-or-nothing D-04 rule).
368
+ */
369
+ export function resolveConflict(basePath, worktreeBasePath, entityKey, // e.g. "task:T01"
370
+ pick) {
371
+ const conflicts = listConflicts(basePath);
372
+ const colonIdx = entityKey.indexOf(":");
373
+ const entityType = entityKey.slice(0, colonIdx);
374
+ const entityId = entityKey.slice(colonIdx + 1);
375
+ const idx = conflicts.findIndex((c) => c.entityType === entityType && c.entityId === entityId);
376
+ if (idx === -1)
377
+ throw new Error(`No conflict found for entity ${entityKey}`);
378
+ const conflict = conflicts[idx];
379
+ const eventsToReplay = pick === "main" ? conflict.mainSideEvents : conflict.worktreeSideEvents;
380
+ // Replay resolved events through the DB (updates DB state)
381
+ openDatabase(join(basePath, ".gsd", "gsd.db"));
382
+ replayEvents(eventsToReplay);
383
+ // Append resolved events to the event log
384
+ for (const event of eventsToReplay) {
385
+ appendEvent(basePath, { cmd: event.cmd, params: event.params, ts: event.ts, actor: event.actor });
386
+ }
387
+ // Remove resolved conflict from list
388
+ conflicts.splice(idx, 1);
389
+ if (conflicts.length === 0) {
390
+ // All conflicts resolved — remove CONFLICTS.md and re-run reconciliation
391
+ // to pick up non-conflicting events that were blocked by D-04 all-or-nothing.
392
+ removeConflictsFile(basePath);
393
+ if (worktreeBasePath) {
394
+ reconcileWorktreeLogs(basePath, worktreeBasePath);
395
+ }
396
+ }
397
+ else {
398
+ // Re-write CONFLICTS.md with remaining conflicts
399
+ writeConflictsFile(basePath, conflicts, worktreeBasePath);
400
+ }
401
+ }
402
+ /**
403
+ * Remove CONFLICTS.md — called when all conflicts are resolved.
404
+ * No-op if CONFLICTS.md does not exist.
405
+ */
406
+ export function removeConflictsFile(basePath) {
407
+ const conflictsPath = join(basePath, ".gsd", "CONFLICTS.md");
408
+ if (existsSync(conflictsPath)) {
409
+ unlinkSync(conflictsPath);
410
+ }
411
+ }
@@ -0,0 +1,84 @@
1
+ // GSD Extension — Write Intercept for Agent State File Blocks
2
+ // Detects agent attempts to write authoritative state files and returns
3
+ // an error directing the agent to use the engine tool API instead.
4
+ import { realpathSync } from "node:fs";
5
+ import { resolve } from "node:path";
6
+ /**
7
+ * Patterns matching authoritative .gsd/ state files that agents must NOT write directly.
8
+ *
9
+ * Only STATE.md is blocked — it is purely engine-rendered from DB state.
10
+ * All other .gsd/ files are agent-authored content that agents create and
11
+ * update during discuss, plan, and execute phases:
12
+ * - REQUIREMENTS.md — agents create during discuss, read during planning
13
+ * - PROJECT.md — agents create during discuss, update at milestone close
14
+ * - ROADMAP.md / PLAN.md — agents create during planning, engine renders checkboxes
15
+ * - SUMMARY.md, KNOWLEDGE.md, CONTEXT.md — non-authoritative content
16
+ */
17
+ const BLOCKED_PATTERNS = [
18
+ // STATE.md is the only purely engine-rendered file.
19
+ // Case-insensitive to prevent bypass on macOS (case-insensitive APFS).
20
+ // (^|[/\\]) matches both absolute paths (/project/.gsd/…) and bare relative
21
+ // paths (.gsd/STATE.md) so a path without a leading separator is also blocked.
22
+ /(^|[/\\])\.gsd[/\\]STATE\.md$/i,
23
+ // Also match resolved symlink paths under ~/.gsd/projects/ (Pitfall #6)
24
+ /(^|[/\\])\.gsd[/\\]projects[/\\][^/\\]+[/\\]STATE\.md$/i,
25
+ ];
26
+ /**
27
+ * Bash command patterns that target STATE.md.
28
+ * Covers common shell write patterns: redirect, tee, cp, mv, sed -i, etc.
29
+ */
30
+ const BASH_STATE_PATTERNS = [
31
+ // Redirect/pipe writes: > STATE.md, >> STATE.md, >| STATE.md
32
+ /[>|]+\s*\S*STATE\.md/i,
33
+ // tee to STATE.md
34
+ /\btee\b.*STATE\.md/i,
35
+ // cp/mv targeting STATE.md
36
+ /\b(cp|mv)\b.*STATE\.md/i,
37
+ // sed -i editing STATE.md
38
+ /\bsed\b.*-i.*STATE\.md/i,
39
+ // dd output to STATE.md
40
+ /\bdd\b.*of=\S*STATE\.md/i,
41
+ ];
42
+ /**
43
+ * Tests whether the given file path matches a blocked authoritative .gsd/ state file.
44
+ * Resolves `..` segments via path.resolve() and attempts realpathSync for symlinks.
45
+ */
46
+ export function isBlockedStateFile(filePath) {
47
+ // Check raw path first
48
+ if (matchesBlockedPattern(filePath))
49
+ return true;
50
+ // Resolve ".." segments (works even for non-existing files)
51
+ const resolved = resolve(filePath);
52
+ if (resolved !== filePath && matchesBlockedPattern(resolved))
53
+ return true;
54
+ // Also try symlink resolution — file may not exist yet, so wrap in try/catch
55
+ try {
56
+ const realpath = realpathSync(filePath);
57
+ if (realpath !== filePath && realpath !== resolved && matchesBlockedPattern(realpath))
58
+ return true;
59
+ }
60
+ catch {
61
+ // File doesn't exist yet — path matching above is sufficient
62
+ }
63
+ return false;
64
+ }
65
+ /**
66
+ * Tests whether a bash command appears to target STATE.md for writing.
67
+ */
68
+ export function isBashWriteToStateFile(command) {
69
+ return BASH_STATE_PATTERNS.some((pattern) => pattern.test(command));
70
+ }
71
+ function matchesBlockedPattern(path) {
72
+ return BLOCKED_PATTERNS.some((pattern) => pattern.test(path));
73
+ }
74
+ /**
75
+ * Error message returned when an agent attempts to directly write an authoritative .gsd/ state file.
76
+ * Directs the agent to use engine tool calls instead.
77
+ */
78
+ export const BLOCKED_WRITE_ERROR = `Direct writes to .gsd/STATE.md are blocked. Use engine tool calls instead:
79
+ - To complete a task: call gsd_complete_task(milestone_id, slice_id, task_id, summary)
80
+ - To complete a slice: call gsd_complete_slice(milestone_id, slice_id, summary, uat_result)
81
+ - To save a decision: call gsd_save_decision(scope, decision, choice, rationale)
82
+ - To start a task: call gsd_start_task(milestone_id, slice_id, task_id)
83
+ - To record verification: call gsd_record_verification(milestone_id, slice_id, task_id, evidence)
84
+ - To report a blocker: call gsd_report_blocker(milestone_id, slice_id, task_id, description)`;
@@ -1 +1 @@
1
- zWYDSwB-terOjfhmWzqk1
1
+ ZIDqryyYDroh_8AnaAOSG
@@ -1,45 +1,45 @@
1
1
  {
2
- "/_global-error/page": "/_global-error",
3
2
  "/_not-found/page": "/_not-found",
3
+ "/_global-error/page": "/_global-error",
4
+ "/api/boot/route": "/api/boot",
4
5
  "/api/bridge-terminal/resize/route": "/api/bridge-terminal/resize",
5
6
  "/api/bridge-terminal/input/route": "/api/bridge-terminal/input",
6
- "/api/boot/route": "/api/boot",
7
- "/api/dev-mode/route": "/api/dev-mode",
7
+ "/api/cleanup/route": "/api/cleanup",
8
8
  "/api/browse-directories/route": "/api/browse-directories",
9
+ "/api/dev-mode/route": "/api/dev-mode",
9
10
  "/api/export-data/route": "/api/export-data",
10
- "/api/cleanup/route": "/api/cleanup",
11
- "/api/forensics/route": "/api/forensics",
11
+ "/api/captures/route": "/api/captures",
12
12
  "/api/doctor/route": "/api/doctor",
13
- "/api/git/route": "/api/git",
13
+ "/api/forensics/route": "/api/forensics",
14
14
  "/api/history/route": "/api/history",
15
- "/api/bridge-terminal/stream/route": "/api/bridge-terminal/stream",
16
- "/api/hooks/route": "/api/hooks",
15
+ "/api/git/route": "/api/git",
17
16
  "/api/inspect/route": "/api/inspect",
17
+ "/api/hooks/route": "/api/hooks",
18
+ "/api/knowledge/route": "/api/knowledge",
18
19
  "/api/live-state/route": "/api/live-state",
20
+ "/api/bridge-terminal/stream/route": "/api/bridge-terminal/stream",
19
21
  "/api/preferences/route": "/api/preferences",
20
- "/api/projects/route": "/api/projects",
21
22
  "/api/onboarding/route": "/api/onboarding",
22
23
  "/api/recovery/route": "/api/recovery",
23
- "/api/captures/route": "/api/captures",
24
24
  "/api/session/browser/route": "/api/session/browser",
25
25
  "/api/session/command/route": "/api/session/command",
26
+ "/api/projects/route": "/api/projects",
26
27
  "/api/session/events/route": "/api/session/events",
27
- "/api/session/manage/route": "/api/session/manage",
28
28
  "/api/shutdown/route": "/api/shutdown",
29
29
  "/api/settings-data/route": "/api/settings-data",
30
- "/api/knowledge/route": "/api/knowledge",
31
30
  "/api/skill-health/route": "/api/skill-health",
32
- "/api/steer/route": "/api/steer",
31
+ "/api/session/manage/route": "/api/session/manage",
33
32
  "/api/files/route": "/api/files",
34
- "/api/terminal/input/route": "/api/terminal/input",
35
- "/api/switch-root/route": "/api/switch-root",
36
33
  "/api/terminal/resize/route": "/api/terminal/resize",
34
+ "/api/steer/route": "/api/steer",
35
+ "/api/switch-root/route": "/api/switch-root",
37
36
  "/api/terminal/stream/route": "/api/terminal/stream",
38
37
  "/api/terminal/sessions/route": "/api/terminal/sessions",
38
+ "/api/terminal/input/route": "/api/terminal/input",
39
+ "/api/visualizer/route": "/api/visualizer",
39
40
  "/api/terminal/upload/route": "/api/terminal/upload",
40
41
  "/api/undo/route": "/api/undo",
41
- "/api/update/route": "/api/update",
42
42
  "/api/remote-questions/route": "/api/remote-questions",
43
- "/api/visualizer/route": "/api/visualizer",
43
+ "/api/update/route": "/api/update",
44
44
  "/page": "/"
45
45
  }
@@ -4,8 +4,8 @@
4
4
  ],
5
5
  "devFiles": [],
6
6
  "lowPriorityFiles": [
7
- "static/zWYDSwB-terOjfhmWzqk1/_buildManifest.js",
8
- "static/zWYDSwB-terOjfhmWzqk1/_ssgManifest.js"
7
+ "static/ZIDqryyYDroh_8AnaAOSG/_buildManifest.js",
8
+ "static/ZIDqryyYDroh_8AnaAOSG/_ssgManifest.js"
9
9
  ],
10
10
  "rootMainFiles": [
11
11
  "static/chunks/webpack-0a4cd455ec4197d2.js",
@@ -78,8 +78,8 @@
78
78
  "dynamicRoutes": {},
79
79
  "notFoundRoutes": [],
80
80
  "preview": {
81
- "previewModeId": "cf4d5d78c74a67ed917c9171afd61d0b",
82
- "previewModeSigningKey": "fc306d9119bb4c07ab2d3b214cfcdf8dc6524f3fcf803567b3ab7958fcf13057",
83
- "previewModeEncryptionKey": "e3207cb64939ad76e542dfc07ac0d2bce48e0f4c04b9cf9db4e9ff0994b68c20"
81
+ "previewModeId": "8a3f7e9c16724e3c2a128f7c9a6904d1",
82
+ "previewModeSigningKey": "987cd2996d69481e52130ceaf4bb19ae6761b73cc326cd69838b6f34e3090b2e",
83
+ "previewModeEncryptionKey": "1dff61a43bad4904a84ea728f8dae8aca396f2bd2d0c352abbe0c442278174eb"
84
84
  }
85
85
  }
@@ -1,2 +1,2 @@
1
- <!DOCTYPE html><!--zWYDSwB_terOjfhmWzqk1--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0a4cd455ec4197d2.js"/><script src="/_next/static/chunks/4bd1b696-e5d7c65570c947b7.js" async=""></script><script src="/_next/static/chunks/3794-337d1ca25ad99a89.js" async=""></script><script src="/_next/static/chunks/main-app-fdab67f7802d7832.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
2
- @media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-0a4cd455ec4197d2.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[57121,[],\"\"]\n3:I[74581,[],\"\"]\n4:I[90484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[90484,[],\"ViewportBoundary\"]\n9:I[90484,[],\"MetadataBoundary\"]\nb:I[27123,[],\"\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"zWYDSwB-terOjfhmWzqk1\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{}]}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\na:[]\n"])</script></body></html>
1
+ <!DOCTYPE html><!--ZIDqryyYDroh_8AnaAOSG--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0a4cd455ec4197d2.js"/><script src="/_next/static/chunks/4bd1b696-e5d7c65570c947b7.js" async=""></script><script src="/_next/static/chunks/3794-337d1ca25ad99a89.js" async=""></script><script src="/_next/static/chunks/main-app-fdab67f7802d7832.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
2
+ @media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-0a4cd455ec4197d2.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[57121,[],\"\"]\n3:I[74581,[],\"\"]\n4:I[90484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[90484,[],\"ViewportBoundary\"]\n9:I[90484,[],\"MetadataBoundary\"]\nb:I[27123,[],\"\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"ZIDqryyYDroh_8AnaAOSG\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{}]}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\na:[]\n"])</script></body></html>
@@ -6,7 +6,7 @@
6
6
  7:I[90484,[],"ViewportBoundary"]
7
7
  9:I[90484,[],"MetadataBoundary"]
8
8
  b:I[27123,[],""]
9
- 0:{"P":null,"b":"zWYDSwB-terOjfhmWzqk1","c":["","_global-error"],"q":"","i":false,"f":[[["",{"children":["_global-error",{"children":["__PAGE__",{}]}]}],[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","html",null,{"id":"__next_error__","children":[["$","head",null,{"children":["$","title",null,{"children":"500: Internal Server Error."}]}],["$","body",null,{"children":["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"style":{"lineHeight":"48px"},"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","paddingRight":23,"fontSize":24,"fontWeight":500,"verticalAlign":"top"},"children":"500"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"28px"},"children":"Internal Server Error."}]}]]}]}]}]]}],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$L7",null,{"children":"$L8"}],["$","div",null,{"hidden":true,"children":["$","$L9",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$La"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$b",[]],"S":true}
9
+ 0:{"P":null,"b":"ZIDqryyYDroh_8AnaAOSG","c":["","_global-error"],"q":"","i":false,"f":[[["",{"children":["_global-error",{"children":["__PAGE__",{}]}]}],[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","html",null,{"id":"__next_error__","children":[["$","head",null,{"children":["$","title",null,{"children":"500: Internal Server Error."}]}],["$","body",null,{"children":["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"style":{"lineHeight":"48px"},"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","paddingRight":23,"fontSize":24,"fontWeight":500,"verticalAlign":"top"},"children":"500"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"28px"},"children":"Internal Server Error."}]}]]}]}]}]]}],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$L7",null,{"children":"$L8"}],["$","div",null,{"hidden":true,"children":["$","$L9",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$La"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$b",[]],"S":true}
10
10
  8:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
11
11
  6:null
12
12
  a:[]