glimmervoid 0.37.0 → 0.38.1

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 (38) hide show
  1. package/dist/bin/glimmervoid.js +16 -14
  2. package/dist/chunks/{adapters-BmfVPxlH.js → adapters-B0EJp_oE.js} +19 -4
  3. package/dist/chunks/{adapters-CqFFmM2R.js → adapters-BIbF8RJB.js} +1 -1
  4. package/dist/chunks/{agent-api-cli-CBgOKXoO.js → agent-api-cli-B5Tm0wXO.js} +27 -8
  5. package/dist/chunks/{agent-api-cli-BTHEyJKS.js → agent-api-cli-BDu1CxZf.js} +1 -1
  6. package/dist/chunks/{agent-api-core-DzKhakCv.js → agent-api-core-B_mUSenR.js} +30 -7
  7. package/dist/chunks/{agent-setup-cli-C8DGxlA-.js → agent-setup-cli-C9MMiask.js} +2 -2
  8. package/dist/chunks/{config-BYc2z1Oc.js → browser-config-BrBT8269.js} +9 -223
  9. package/dist/chunks/config-CjawSOBk.js +219 -0
  10. package/dist/chunks/config-store-B6mX2phK.js +1 -0
  11. package/dist/chunks/{config-store-B7MpiYxG.js → config-store-CKcDJebD.js} +42 -64
  12. package/dist/chunks/{contracts-C6ipN_zw.js → contracts-HVCEJfxs.js} +23 -250
  13. package/dist/chunks/factory-D7ryES9n.js +240 -0
  14. package/dist/chunks/{git-version-6QFnKbWa.js → git-version-rWZjF2Px.js} +1 -1
  15. package/dist/chunks/{grok-CZ6kP_vD.js → grok-y65HOvlU.js} +1 -1
  16. package/dist/chunks/{json-file-BaxGcB2R.js → json-file-CIJf0Cel.js} +190 -9
  17. package/dist/chunks/{knowledge-graph-cli-DApeMzA8.js → knowledge-graph-cli-ByUJoKw_.js} +1 -1
  18. package/dist/chunks/{loopback-post-DJ6iYWuL.js → loopback-post-DZK7YibD.js} +1 -1
  19. package/dist/chunks/{main-BUfjroXE.js → main-DeiiNNI7.js} +1186 -475
  20. package/dist/chunks/{pair-cli-GZ9t1mIO.js → pair-cli-B9hHUHLl.js} +2 -2
  21. package/dist/chunks/{remote-config-D2Is89Kj.js → remote-config-DlquYoVe.js} +2 -2
  22. package/dist/chunks/{session-BZbariv5.js → session-BlT68ppa.js} +6 -3
  23. package/dist/chunks/{session-routes-C4t8O8yg.js → session-routes-CT1JrjoT.js} +1 -1
  24. package/dist/chunks/{settings-cli-DQOjmjev.js → settings-cli-C5i9v59a.js} +3 -3
  25. package/dist/chunks/{ssh-sign-cli-LIBP8ppO.js → ssh-sign-cli-C74BGTQS.js} +2 -2
  26. package/dist/client/assets/index-ChXRDbjt.js +275 -0
  27. package/dist/client/assets/index-DA251uL1.css +1 -0
  28. package/dist/client/index.html +11 -3
  29. package/dist/server/index.js +1 -1
  30. package/dist/session/command-hook-relay.js +1 -1
  31. package/dist/session/hook-relay.js +1 -1
  32. package/dist/session/statusline-relay.js +1 -1
  33. package/dist/session/visions-relay.js +7 -7
  34. package/package.json +3 -2
  35. package/scripts/recover-handoff.mjs +1 -1
  36. package/dist/chunks/config-store-CsUoy88Q.js +0 -1
  37. package/dist/client/assets/index-B_Qt7fbZ.css +0 -1
  38. package/dist/client/assets/index-D-upBor0.js +0 -265
@@ -1,238 +1,8 @@
1
- import { D as SessionDoc, Dt as hasRequiredActionHead, G as MyPrMergeWhenReadyResult, H as MyPrMergeResult, It as GithubPollingRefreshRequest, Lt as GithubPollingRefreshResult, N as TaskTitle, O as SessionSnapshot, P as LinkedPr, Pt as REPO_SLUG_RE, Q as SessionPrLinks, R as MyPrKeepMergeableRequest, Rt as githubPollingShape, V as MyPrMergeRequest, W as MyPrMergeWhenReadyRequest, Z as MyPrsStatus, _ as ConversationApprovalDecision, _t as TeamReviewActionResult, b as PendingWakeup, et as CommitSha, g as ConversationApproval, gt as TeamReviewActionRequest, h as ConversationAnswers, k as SessionState, w as SESSION_DOC_PATH_MAX_CHARS, xt as TeamReviewStatus, z as MyPrKeepMergeableResult } from "./session-BZbariv5.js";
2
- import { J as CoherenceOrient, X as CoherenceRisk, Y as CoherenceReadiness, et as CoherenceWorkState, h as FactorySettings, n as BUILTIN_AGENT_IDS } from "./config-BYc2z1Oc.js";
1
+ import { $ as SessionPrLinks, A as SessionState, B as MyPrKeepMergeableResult, F as LinkedPr, Ft as REPO_SLUG_RE, G as MyPrMergeWhenReadyRequest, H as MyPrMergeRequest, K as MyPrMergeWhenReadyResult, Lt as GithubPollingRefreshRequest, O as SessionDoc, Ot as hasRequiredActionHead, P as TaskTitle, Q as MyPrsStatus, Rt as GithubPollingRefreshResult, St as TeamReviewStatus, T as SESSION_DOC_PATH_MAX_CHARS, U as MyPrMergeResult, _ as ConversationApproval, _t as TeamReviewActionRequest, g as ConversationAnswers, k as SessionSnapshot, tt as CommitSha, v as ConversationApprovalDecision, vt as TeamReviewActionResult, x as PendingWakeup, z as MyPrKeepMergeableRequest, zt as githubPollingShape } from "./session-BlT68ppa.js";
2
+ import "./browser-config-BrBT8269.js";
3
+ import { _ as isSingleFactoryPathSegment, a as FactoryControlRequest, d as FactoryQueueIntentRequest, f as FactoryQueueIntentResult, h as FactoryState, o as FactoryControlResult, p as FactoryReviewVerdict } from "./factory-D7ryES9n.js";
4
+ import { n as BUILTIN_AGENT_IDS } from "./config-CjawSOBk.js";
3
5
  import { z } from "zod";
4
- //#region shared/contracts/factory.ts
5
- var FactoryConsequences = z.looseObject({ records: z.array(z.looseObject({
6
- from: z.object({
7
- kind: z.string(),
8
- id: z.string()
9
- }),
10
- relation: z.string(),
11
- to: z.object({
12
- kind: z.string(),
13
- id: z.string()
14
- }),
15
- session: z.string().optional(),
16
- evidence: z.string().optional()
17
- })) });
18
- var confirmedFlakes = z.array(z.string().min(1)).max(256);
19
- var FactoryProjectState = z.object({
20
- projectId: z.string(),
21
- projectName: z.string(),
22
- headSha: z.string().nullable(),
23
- paused: z.boolean(),
24
- orchestrator: z.object({
25
- sessionId: z.string(),
26
- intentId: z.string(),
27
- state: SessionState
28
- }).nullable(),
29
- liveWorkers: z.array(z.object({
30
- workId: z.string(),
31
- sessionId: z.string()
32
- })).optional(),
33
- reviewing: z.array(z.string()).optional(),
34
- note: z.string().nullable().optional(),
35
- spentTodayUsd: z.number().finite().nonnegative().optional(),
36
- dailyBudgetUsd: z.number().finite().nonnegative().nullable().optional(),
37
- verifierIntentIds: z.array(z.string()).optional(),
38
- confirmedFlakesByIntent: z.record(z.string().min(1), confirmedFlakes).optional(),
39
- partialIntentIds: z.array(z.string()).optional(),
40
- factoryProfile: FactorySettings.unwrap().unwrap().pick({ checks: true }).extend({
41
- focusedTestCommand: z.string().trim().min(1).optional(),
42
- widenableScopes: z.array(z.string().trim().min(1)).optional()
43
- }).optional(),
44
- error: z.string().nullable(),
45
- heading: z.object({
46
- action: CoherenceOrient.shape.action,
47
- reasons: z.array(z.string())
48
- }),
49
- orders: z.array(z.object({
50
- id: z.string(),
51
- objective: z.string(),
52
- openedAt: z.iso.datetime(),
53
- criteria: z.array(z.string()),
54
- boundary: z.string(),
55
- risk: CoherenceRisk,
56
- state: CoherenceWorkState,
57
- readiness: CoherenceReadiness,
58
- parent: z.string().nullable(),
59
- dependsOn: z.array(z.string()),
60
- writeScopes: z.array(z.string()),
61
- owner: z.string().nullable(),
62
- blockReason: z.string().nullable().optional(),
63
- parked: z.boolean().optional(),
64
- blockCount: z.number().int().nonnegative().optional(),
65
- lastEvent: z.object({
66
- event: z.string(),
67
- at: z.string(),
68
- session: z.string()
69
- }).nullable()
70
- })),
71
- conflicts: z.array(z.object({
72
- left: z.string(),
73
- right: z.string(),
74
- scope: z.string()
75
- })),
76
- unverifiedCompletedWork: z.array(z.string()),
77
- observedRun: z.object({
78
- recordDirectory: z.string(),
79
- outcome: z.string().nullable()
80
- }).optional()
81
- });
82
- var FactoryState = z.object({
83
- type: z.literal("factory-state"),
84
- ts: z.number().finite(),
85
- projects: z.array(FactoryProjectState)
86
- });
87
- var FactoryHarnessStateLine = z.object({
88
- arrivedAt: z.string(),
89
- state: FactoryState
90
- });
91
- var FactoryHarnessVerdict = z.looseObject({
92
- outcome: z.enum([
93
- "pass",
94
- "partial",
95
- "fail"
96
- ]),
97
- failureClass: z.string().nullable().optional()
98
- });
99
- var FACTORY_ERROR_MAX_CHARS = 16384;
100
- function isSingleFactoryPathSegment(value) {
101
- return value !== "." && value !== ".." && !/[/\\]/.test(value);
102
- }
103
- var projectId = z.string().trim().min(1).max(128).refine(isSingleFactoryPathSegment, "Invalid factory project id");
104
- var intentText = z.string().trim().min(1).max(4096);
105
- var scopeText = z.string().trim().min(1).max(1024);
106
- var FACTORY_INTENT_TICKET_LIMIT = 32;
107
- var ticketKey = z.string().trim().min(1).max(64);
108
- var FACTORY_PROTECTED_PATH_FLOOR = [
109
- "**/package.json",
110
- "**/package-lock.json",
111
- "**/npm-shrinkwrap.json",
112
- "**/yarn.lock",
113
- "**/pnpm-lock.yaml",
114
- "**/bun.lock",
115
- "**/bun.lockb",
116
- "**/.npmrc",
117
- "**/.yarnrc",
118
- "**/.yarnrc.yml",
119
- "**/pnpm-workspace.yaml",
120
- "**/.pnpmfile.cjs",
121
- "**/tsconfig*.json",
122
- "**/biome.json",
123
- "**/biome.jsonc",
124
- "**/vite.config.*",
125
- "**/vitest.config.*",
126
- "**/vitest.workspace.*",
127
- "**/jest.config.*",
128
- "**/.mocharc*",
129
- "**/playwright.config.*"
130
- ];
131
- var FactoryFloorAllowance = z.enum(FACTORY_PROTECTED_PATH_FLOOR);
132
- var floorAllowances = z.array(FactoryFloorAllowance).max(FACTORY_PROTECTED_PATH_FLOOR.length);
133
- var FactoryIntentTicket = z.object({
134
- id: ticketKey,
135
- objective: intentText,
136
- criteria: z.array(intentText).min(1).max(12),
137
- dependsOn: z.array(ticketKey).max(FACTORY_INTENT_TICKET_LIMIT),
138
- writeScopes: z.array(scopeText).min(1).max(32)
139
- });
140
- var FactoryQueueIntentRequest = z.object({
141
- projectId,
142
- objective: intentText,
143
- criteria: z.array(intentText).min(1).max(12),
144
- risk: CoherenceRisk,
145
- boundary: intentText,
146
- writeScopes: z.array(scopeText).max(32),
147
- tickets: z.array(FactoryIntentTicket).min(1).max(FACTORY_INTENT_TICKET_LIMIT).optional(),
148
- floorAllowances: floorAllowances.optional()
149
- });
150
- var FactoryQueueIntentResult = z.object({
151
- projectId: z.string().max(128),
152
- ok: z.boolean(),
153
- workId: z.string().min(1).max(128).optional(),
154
- error: z.string().max(FACTORY_ERROR_MAX_CHARS).optional()
155
- });
156
- var FactoryControlRequest = z.object({
157
- projectId,
158
- action: z.enum([
159
- "pause",
160
- "resume",
161
- "retry-parked",
162
- "rerun-setup"
163
- ]),
164
- intentId: z.string().trim().min(1).max(128).optional()
165
- }).refine((request) => request.action !== "retry-parked" || request.intentId !== void 0, {
166
- message: "Retry parked requires an intentId",
167
- path: ["intentId"]
168
- });
169
- var FactoryControlResult = z.object({
170
- projectId: z.string().max(128),
171
- action: FactoryControlRequest.shape.action,
172
- ok: z.boolean(),
173
- reopenedWorkIds: z.array(z.string().min(1)).optional(),
174
- error: z.string().max(FACTORY_ERROR_MAX_CHARS).optional()
175
- });
176
- var FactoryReviewVerdict = z.object({
177
- pass: z.boolean(),
178
- findings: z.array(z.string())
179
- }).strict();
180
- var FactoryReviewerOutput = z.object({
181
- type: z.literal("result"),
182
- subtype: z.literal("success"),
183
- is_error: z.literal(false),
184
- structured_output: FactoryReviewVerdict
185
- });
186
- var FactoryUnlandedRecord = z.object({
187
- id: z.string().min(1).max(1024),
188
- path: z.string().min(1).max(4096),
189
- line: z.string().min(1).regex(/^[^\n]*$/)
190
- });
191
- var FactoryLaneState = z.object({
192
- ledgerPath: z.string().min(1).max(4096).nullable(),
193
- ledgerBranch: z.string().min(1).max(1024).nullable(),
194
- paused: z.boolean(),
195
- trustedVerifications: z.array(z.object({
196
- id: z.string().min(1),
197
- sha: z.string().regex(/^[a-f0-9]{40,64}$/)
198
- })).optional(),
199
- trustedIntentCloses: z.array(z.string().min(1)).optional(),
200
- pendingVerifierTrusts: z.array(z.object({
201
- intentId: z.string().min(1),
202
- sha: z.string().regex(/^[a-f0-9]{40,64}$/),
203
- records: z.array(FactoryUnlandedRecord).min(1)
204
- })).optional(),
205
- trustedIntentIds: z.array(z.string().min(1)).optional(),
206
- intentWriteScopes: z.record(z.string().min(1), z.array(z.string().min(1))).optional(),
207
- intentFloorAllowances: z.record(z.string().min(1), floorAllowances).optional(),
208
- intentConfirmedFlakes: z.record(z.string().min(1), confirmedFlakes).optional(),
209
- intentScopeNeeds: z.record(z.string().min(1), z.array(z.string().min(1)).max(256)).optional(),
210
- ticketedIntentIds: z.array(z.string().min(1)).optional(),
211
- pendingIntentTickets: z.record(z.string().min(1), z.object({
212
- risk: CoherenceRisk,
213
- boundary: intentText,
214
- tickets: z.array(FactoryIntentTicket).min(1).max(FACTORY_INTENT_TICKET_LIMIT)
215
- })).optional(),
216
- intentBaseShas: z.record(z.string().min(1), z.string().regex(/^[a-f0-9]{40,64}$/)).optional(),
217
- factoryLandedShas: z.array(z.string().regex(/^[a-f0-9]{40,64}$/)).optional(),
218
- unlandedFactoryRecords: z.array(FactoryUnlandedRecord).optional(),
219
- ticketBlockCounts: z.record(z.string().min(1), z.number().int().nonnegative()).optional(),
220
- notifiedIntentOutcomes: z.array(z.string().min(1)).optional()
221
- });
222
- var FactoryWorkerEvent = z.object({
223
- workId: z.string().min(1),
224
- event: z.string().min(1),
225
- sessionId: z.string().optional(),
226
- detail: z.string().optional()
227
- });
228
- z.discriminatedUnion("ok", [z.object({
229
- ok: z.literal(true),
230
- sessionId: z.string()
231
- }), z.object({
232
- ok: z.literal(false),
233
- reason: z.string()
234
- })]);
235
- //#endregion
236
6
  //#region shared/contracts/factory-decision-log.ts
237
7
  var FACTORY_DECISION_OUTPUT_MAX_BYTES = 16384;
238
8
  var FactoryDecisionKind = z.enum([
@@ -1358,8 +1128,6 @@ var idOnlyClientTypes = [
1358
1128
  "start-session",
1359
1129
  "restart",
1360
1130
  "force-restart",
1361
- "sleep",
1362
- "wake",
1363
1131
  "merge-session",
1364
1132
  "finish-session",
1365
1133
  "merge-continue-session",
@@ -1420,7 +1188,6 @@ var clientVariants = [
1420
1188
  id: sessionId,
1421
1189
  key: PullRequestKey
1422
1190
  }),
1423
- loose("reorder-sessions", { order: z.array(sessionId) }),
1424
1191
  loose("ping", { requestId }),
1425
1192
  loose("get-settings", { requestId }),
1426
1193
  loose("update-settings", {
@@ -1528,10 +1295,7 @@ var clientVariants = [
1528
1295
  loose("focus-change", { focused: z.boolean() }),
1529
1296
  loose("request-health-snapshot"),
1530
1297
  loose("update-check"),
1531
- loose("update-apply", {
1532
- restartWhenStaged: z.boolean().optional(),
1533
- confirmedSessionIds: z.array(z.string().min(1)).max(1e3).optional()
1534
- }),
1298
+ loose("update-apply"),
1535
1299
  loose("session-trace", {
1536
1300
  id: sessionId,
1537
1301
  requestId,
@@ -1596,8 +1360,6 @@ Object.freeze([
1596
1360
  "session-wakeup",
1597
1361
  "session-prompt",
1598
1362
  "session-conversation",
1599
- "session-sleep",
1600
- "session-wake",
1601
1363
  "session-merge-status",
1602
1364
  "session-worktree-blocked",
1603
1365
  "session-worktree-warning",
@@ -1622,6 +1384,7 @@ Object.freeze([
1622
1384
  "notify",
1623
1385
  "update-status",
1624
1386
  "update-progress",
1387
+ "post-turn-leftovers",
1625
1388
  "error",
1626
1389
  "session-error",
1627
1390
  "settings",
@@ -1656,7 +1419,6 @@ Object.freeze([
1656
1419
  "factory-state",
1657
1420
  "my-prs-status",
1658
1421
  "issues-status",
1659
- "branch-gc-status",
1660
1422
  "usage-sessions",
1661
1423
  "usage-report",
1662
1424
  "plan-limits",
@@ -1670,7 +1432,6 @@ Object.freeze([
1670
1432
  "ingest-activity",
1671
1433
  "ingest-snapshot",
1672
1434
  "client-trust",
1673
- "sessions-reordered",
1674
1435
  "shutting-down",
1675
1436
  "restarting"
1676
1437
  ]);
@@ -1781,8 +1542,6 @@ var serverVariants = [
1781
1542
  isConversationViewOn: z.boolean(),
1782
1543
  conversationApproval: ConversationApproval.nullable()
1783
1544
  }),
1784
- loose("session-sleep"),
1785
- loose("session-wake"),
1786
1545
  loose("session-merge-status", {
1787
1546
  id: sessionId,
1788
1547
  mergeStatus: z.string(),
@@ -1910,6 +1669,10 @@ var serverVariants = [
1910
1669
  }),
1911
1670
  loose("update-status", updateStatusShape),
1912
1671
  loose("update-progress", { journal: UpdateJournal }),
1672
+ loose("post-turn-leftovers", {
1673
+ repositories: z.array(z.string()),
1674
+ command: z.string()
1675
+ }),
1913
1676
  loose("error", {
1914
1677
  id: sessionId.optional(),
1915
1678
  message: z.string(),
@@ -2094,7 +1857,6 @@ var serverVariants = [
2094
1857
  loose("factory-state", FactoryState.shape),
2095
1858
  MyPrsStatus,
2096
1859
  IssuesStatus,
2097
- loose("branch-gc-status"),
2098
1860
  loose("usage-sessions", {
2099
1861
  ts: timestamp,
2100
1862
  pricingSource: nullableString,
@@ -2182,7 +1944,6 @@ var serverVariants = [
2182
1944
  ts: timestamp
2183
1945
  }),
2184
1946
  loose("client-trust", { trust: z.enum(["local", "remote"]) }),
2185
- loose("sessions-reordered", { order: z.array(sessionId) }),
2186
1947
  loose("shutting-down"),
2187
1948
  loose("restarting")
2188
1949
  ];
@@ -2207,6 +1968,9 @@ z.object({
2207
1968
  rows: viewerRows,
2208
1969
  seq: z.number().int().nonnegative()
2209
1970
  });
1971
+ var DATA_ATTACH_HISTORY_PARAM = "history";
1972
+ var DEEP_HISTORY_SCROLLBACK_LINES = 5e3;
1973
+ var DataAttachHistory = z.enum(["screen", "deep"]);
2210
1974
  function decodeJson(raw) {
2211
1975
  try {
2212
1976
  return JSON.parse(raw);
@@ -2219,6 +1983,15 @@ function parseDataClientMessage(raw) {
2219
1983
  if (!parsed.success) return null;
2220
1984
  return parsed.data;
2221
1985
  }
1986
+ function parseDataAttachHistory(rawUrl) {
1987
+ if (typeof rawUrl !== "string") return "screen";
1988
+ const queryAt = rawUrl.indexOf("?");
1989
+ if (queryAt === -1) return "screen";
1990
+ const query = new URLSearchParams(rawUrl.slice(queryAt + 1).split("#")[0]);
1991
+ const parsed = DataAttachHistory.safeParse(query.get(DATA_ATTACH_HISTORY_PARAM));
1992
+ if (!parsed.success) return "screen";
1993
+ return parsed.data;
1994
+ }
2222
1995
  //#endregion
2223
1996
  //#region shared/contracts/hooks.ts
2224
1997
  var HTTP_URL_RE = /^https?:\/\/\S+$/i;
@@ -2242,4 +2015,4 @@ z.object({
2242
2015
  projects: z.array(z.string()).optional()
2243
2016
  }).passthrough();
2244
2017
  //#endregion
2245
- export { FactoryHarnessVerdict as $, BenchmarkActionRequest as A, PrCheckoutCaseInput as B, IssueKey as C, IssuesStatus as D, IssuesState as E, BenchmarkStatus as F, TelemetryState as G, PendingCrashReport as H, BenchmarkSuite as I, FACTORY_ERROR_MAX_CHARS as J, FACTORY_DECISION_OUTPUT_MAX_BYTES as K, CommitComparison as L, BenchmarkId as M, BenchmarkJudgement as N, ChangeMap as O, BenchmarkRun as P, FactoryHarnessStateLine as Q, MergedPrListing as R, GithubIssueResponse as S, IssuesSearchResponse as T, TELEMETRY_EVENT_SCHEMAS as U, FeatureFlagsResponse as V, TELEMETRY_KILL_SWITCH_FLAG as W, FactoryConsequences as X, FACTORY_PROTECTED_PATH_FLOOR as Y, FactoryControlRequest as Z, PlanDecision as _, ClientMessage as a, FactoryWorkerEvent as at, planTitle as b, UpdateJournal as c, TraceRecord as d, FactoryLaneState as et, PLAN_BODY_CAP_BYTES as f, PLAN_TOOL_NAME as g, PLAN_RESULT_HOOK_EVENT as h, CONTROL_FRAME_MAX_BYTES as i, FactoryReviewerOutput as it, BenchmarkCase as j, changeMapFactId as k, MAX_RAW_LINE_CHARS as l, PLAN_HOOK_OUTPUT_MAX_CHARS as m, HookEnvelope as n, FactoryQueueIntentRequest as nt, DIFF_ANNOTATION_NOTE_MAX_CHARS as o, isSingleFactoryPathSegment as ot, PLAN_HOOK_EVENT as p, FactoryDecisionLogLine as q, parseDataClientMessage as r, FactoryReviewVerdict as rt, InstallFlavor as s, HTTP_URL_RE as t, FactoryProjectState as tt, TraceCheckpoint as u, PlanRevision as v, IssueUpdate as w, GithubIssuePullRequestsRepository as x, parseExitPlanModeHookPayload as y, MinedPrReviewData as z };
2018
+ export { ChangeMap as A, MergedPrListing as B, GithubIssuePullRequestsRepository as C, IssuesSearchResponse as D, IssueUpdate as E, BenchmarkJudgement as F, TELEMETRY_EVENT_SCHEMAS as G, PrCheckoutCaseInput as H, BenchmarkRun as I, FACTORY_DECISION_OUTPUT_MAX_BYTES as J, TELEMETRY_KILL_SWITCH_FLAG as K, BenchmarkStatus as L, BenchmarkActionRequest as M, BenchmarkCase as N, IssuesState as O, BenchmarkId as P, BenchmarkSuite as R, planTitle as S, IssueKey as T, FeatureFlagsResponse as U, MinedPrReviewData as V, PendingCrashReport as W, FactoryDecisionLogLine as Y, PLAN_RESULT_HOOK_EVENT as _, parseDataClientMessage as a, PlanRevision as b, DIFF_ANNOTATION_NOTE_MAX_CHARS as c, MAX_RAW_LINE_CHARS as d, TraceCheckpoint as f, PLAN_HOOK_OUTPUT_MAX_CHARS as g, PLAN_HOOK_EVENT as h, parseDataAttachHistory as i, changeMapFactId as j, IssuesStatus as k, InstallFlavor as l, PLAN_BODY_CAP_BYTES as m, HookEnvelope as n, CONTROL_FRAME_MAX_BYTES as o, TraceRecord as p, TelemetryState as q, DEEP_HISTORY_SCROLLBACK_LINES as r, ClientMessage as s, HTTP_URL_RE as t, UpdateJournal as u, PLAN_TOOL_NAME as v, GithubIssueResponse as w, parseExitPlanModeHookPayload as x, PlanDecision as y, CommitComparison as z };
@@ -0,0 +1,240 @@
1
+ import { A as SessionState } from "./session-BlT68ppa.js";
2
+ import { Q as CoherenceRisk, X as CoherenceOrient, Z as CoherenceReadiness, nt as CoherenceWorkState, s as FactorySettings } from "./browser-config-BrBT8269.js";
3
+ import { z } from "zod";
4
+ //#region shared/contracts/factory.ts
5
+ var FactoryConsequences = z.looseObject({ records: z.array(z.looseObject({
6
+ from: z.object({
7
+ kind: z.string(),
8
+ id: z.string()
9
+ }),
10
+ relation: z.string(),
11
+ to: z.object({
12
+ kind: z.string(),
13
+ id: z.string()
14
+ }),
15
+ session: z.string().optional(),
16
+ evidence: z.string().optional()
17
+ })) });
18
+ var confirmedFlakes = z.array(z.string().min(1)).max(256);
19
+ var FactoryProjectState = z.object({
20
+ projectId: z.string(),
21
+ projectName: z.string(),
22
+ headSha: z.string().nullable(),
23
+ paused: z.boolean(),
24
+ orchestrator: z.object({
25
+ sessionId: z.string(),
26
+ intentId: z.string(),
27
+ state: SessionState
28
+ }).nullable(),
29
+ liveWorkers: z.array(z.object({
30
+ workId: z.string(),
31
+ sessionId: z.string()
32
+ })).optional(),
33
+ reviewing: z.array(z.string()).optional(),
34
+ note: z.string().nullable().optional(),
35
+ spentTodayUsd: z.number().finite().nonnegative().optional(),
36
+ dailyBudgetUsd: z.number().finite().nonnegative().nullable().optional(),
37
+ verifierIntentIds: z.array(z.string()).optional(),
38
+ confirmedFlakesByIntent: z.record(z.string().min(1), confirmedFlakes).optional(),
39
+ partialIntentIds: z.array(z.string()).optional(),
40
+ factoryProfile: FactorySettings.unwrap().unwrap().pick({ checks: true }).extend({
41
+ focusedTestCommand: z.string().trim().min(1).optional(),
42
+ widenableScopes: z.array(z.string().trim().min(1)).optional()
43
+ }).optional(),
44
+ error: z.string().nullable(),
45
+ heading: z.object({
46
+ action: CoherenceOrient.shape.action,
47
+ reasons: z.array(z.string())
48
+ }),
49
+ orders: z.array(z.object({
50
+ id: z.string(),
51
+ objective: z.string(),
52
+ openedAt: z.iso.datetime(),
53
+ criteria: z.array(z.string()),
54
+ boundary: z.string(),
55
+ risk: CoherenceRisk,
56
+ state: CoherenceWorkState,
57
+ readiness: CoherenceReadiness,
58
+ parent: z.string().nullable(),
59
+ dependsOn: z.array(z.string()),
60
+ writeScopes: z.array(z.string()),
61
+ owner: z.string().nullable(),
62
+ blockReason: z.string().nullable().optional(),
63
+ parked: z.boolean().optional(),
64
+ blockCount: z.number().int().nonnegative().optional(),
65
+ lastEvent: z.object({
66
+ event: z.string(),
67
+ at: z.string(),
68
+ session: z.string()
69
+ }).nullable()
70
+ })),
71
+ conflicts: z.array(z.object({
72
+ left: z.string(),
73
+ right: z.string(),
74
+ scope: z.string()
75
+ })),
76
+ unverifiedCompletedWork: z.array(z.string()),
77
+ observedRun: z.object({
78
+ recordDirectory: z.string(),
79
+ outcome: z.string().nullable()
80
+ }).optional()
81
+ });
82
+ var FactoryState = z.object({
83
+ type: z.literal("factory-state"),
84
+ ts: z.number().finite(),
85
+ projects: z.array(FactoryProjectState)
86
+ });
87
+ var FactoryHarnessStateLine = z.object({
88
+ arrivedAt: z.string(),
89
+ state: FactoryState
90
+ });
91
+ var FactoryHarnessVerdict = z.looseObject({
92
+ outcome: z.enum([
93
+ "pass",
94
+ "partial",
95
+ "fail"
96
+ ]),
97
+ failureClass: z.string().nullable().optional()
98
+ });
99
+ var FACTORY_ERROR_MAX_CHARS = 16384;
100
+ function isSingleFactoryPathSegment(value) {
101
+ return value !== "." && value !== ".." && !/[/\\]/.test(value);
102
+ }
103
+ var projectId = z.string().trim().min(1).max(128).refine(isSingleFactoryPathSegment, "Invalid factory project id");
104
+ var intentText = z.string().trim().min(1).max(4096);
105
+ var scopeText = z.string().trim().min(1).max(1024);
106
+ var FACTORY_INTENT_TICKET_LIMIT = 32;
107
+ var ticketKey = z.string().trim().min(1).max(64);
108
+ var FACTORY_PROTECTED_PATH_FLOOR = [
109
+ "**/package.json",
110
+ "**/package-lock.json",
111
+ "**/npm-shrinkwrap.json",
112
+ "**/yarn.lock",
113
+ "**/pnpm-lock.yaml",
114
+ "**/bun.lock",
115
+ "**/bun.lockb",
116
+ "**/.npmrc",
117
+ "**/.yarnrc",
118
+ "**/.yarnrc.yml",
119
+ "**/pnpm-workspace.yaml",
120
+ "**/.pnpmfile.cjs",
121
+ "**/tsconfig*.json",
122
+ "**/biome.json",
123
+ "**/biome.jsonc",
124
+ "**/vite.config.*",
125
+ "**/vitest.config.*",
126
+ "**/vitest.workspace.*",
127
+ "**/jest.config.*",
128
+ "**/.mocharc*",
129
+ "**/playwright.config.*"
130
+ ];
131
+ var FactoryFloorAllowance = z.enum(FACTORY_PROTECTED_PATH_FLOOR);
132
+ var floorAllowances = z.array(FactoryFloorAllowance).max(FACTORY_PROTECTED_PATH_FLOOR.length);
133
+ var FactoryIntentTicket = z.object({
134
+ id: ticketKey,
135
+ objective: intentText,
136
+ criteria: z.array(intentText).min(1).max(12),
137
+ dependsOn: z.array(ticketKey).max(FACTORY_INTENT_TICKET_LIMIT),
138
+ writeScopes: z.array(scopeText).min(1).max(32)
139
+ });
140
+ var FactoryQueueIntentRequest = z.object({
141
+ projectId,
142
+ objective: intentText,
143
+ criteria: z.array(intentText).min(1).max(12),
144
+ risk: CoherenceRisk,
145
+ boundary: intentText,
146
+ writeScopes: z.array(scopeText).max(32),
147
+ tickets: z.array(FactoryIntentTicket).min(1).max(FACTORY_INTENT_TICKET_LIMIT).optional(),
148
+ floorAllowances: floorAllowances.optional()
149
+ });
150
+ var AgentFactoryQueueRequest = FactoryQueueIntentRequest.omit({
151
+ projectId: true,
152
+ floorAllowances: true
153
+ }).strict();
154
+ var FactoryQueueIntentResult = z.object({
155
+ projectId: z.string().max(128),
156
+ ok: z.boolean(),
157
+ workId: z.string().min(1).max(128).optional(),
158
+ error: z.string().max(FACTORY_ERROR_MAX_CHARS).optional()
159
+ });
160
+ var FactoryControlRequest = z.object({
161
+ projectId,
162
+ action: z.enum([
163
+ "pause",
164
+ "resume",
165
+ "retry-parked",
166
+ "rerun-setup"
167
+ ]),
168
+ intentId: z.string().trim().min(1).max(128).optional()
169
+ }).refine((request) => request.action !== "retry-parked" || request.intentId !== void 0, {
170
+ message: "Retry parked requires an intentId",
171
+ path: ["intentId"]
172
+ });
173
+ var FactoryControlResult = z.object({
174
+ projectId: z.string().max(128),
175
+ action: FactoryControlRequest.shape.action,
176
+ ok: z.boolean(),
177
+ reopenedWorkIds: z.array(z.string().min(1)).optional(),
178
+ error: z.string().max(FACTORY_ERROR_MAX_CHARS).optional()
179
+ });
180
+ var FactoryReviewVerdict = z.object({
181
+ pass: z.boolean(),
182
+ findings: z.array(z.string())
183
+ }).strict();
184
+ var FactoryReviewerOutput = z.object({
185
+ type: z.literal("result"),
186
+ subtype: z.literal("success"),
187
+ is_error: z.literal(false),
188
+ structured_output: FactoryReviewVerdict
189
+ });
190
+ var FactoryUnlandedRecord = z.object({
191
+ id: z.string().min(1).max(1024),
192
+ path: z.string().min(1).max(4096),
193
+ line: z.string().min(1).regex(/^[^\n]*$/)
194
+ });
195
+ var FactoryLaneState = z.object({
196
+ ledgerPath: z.string().min(1).max(4096).nullable(),
197
+ ledgerBranch: z.string().min(1).max(1024).nullable(),
198
+ paused: z.boolean(),
199
+ trustedVerifications: z.array(z.object({
200
+ id: z.string().min(1),
201
+ sha: z.string().regex(/^[a-f0-9]{40,64}$/)
202
+ })).optional(),
203
+ trustedIntentCloses: z.array(z.string().min(1)).optional(),
204
+ pendingVerifierTrusts: z.array(z.object({
205
+ intentId: z.string().min(1),
206
+ sha: z.string().regex(/^[a-f0-9]{40,64}$/),
207
+ records: z.array(FactoryUnlandedRecord).min(1)
208
+ })).optional(),
209
+ trustedIntentIds: z.array(z.string().min(1)).optional(),
210
+ intentWriteScopes: z.record(z.string().min(1), z.array(z.string().min(1))).optional(),
211
+ intentFloorAllowances: z.record(z.string().min(1), floorAllowances).optional(),
212
+ intentConfirmedFlakes: z.record(z.string().min(1), confirmedFlakes).optional(),
213
+ intentScopeNeeds: z.record(z.string().min(1), z.array(z.string().min(1)).max(256)).optional(),
214
+ ticketedIntentIds: z.array(z.string().min(1)).optional(),
215
+ pendingIntentTickets: z.record(z.string().min(1), z.object({
216
+ risk: CoherenceRisk,
217
+ boundary: intentText,
218
+ tickets: z.array(FactoryIntentTicket).min(1).max(FACTORY_INTENT_TICKET_LIMIT)
219
+ })).optional(),
220
+ intentBaseShas: z.record(z.string().min(1), z.string().regex(/^[a-f0-9]{40,64}$/)).optional(),
221
+ factoryLandedShas: z.array(z.string().regex(/^[a-f0-9]{40,64}$/)).optional(),
222
+ unlandedFactoryRecords: z.array(FactoryUnlandedRecord).optional(),
223
+ ticketBlockCounts: z.record(z.string().min(1), z.number().int().nonnegative()).optional(),
224
+ notifiedIntentOutcomes: z.array(z.string().min(1)).optional()
225
+ });
226
+ var FactoryWorkerEvent = z.object({
227
+ workId: z.string().min(1),
228
+ event: z.string().min(1),
229
+ sessionId: z.string().optional(),
230
+ detail: z.string().optional()
231
+ });
232
+ z.discriminatedUnion("ok", [z.object({
233
+ ok: z.literal(true),
234
+ sessionId: z.string()
235
+ }), z.object({
236
+ ok: z.literal(false),
237
+ reason: z.string()
238
+ })]);
239
+ //#endregion
240
+ export { isSingleFactoryPathSegment as _, FactoryControlRequest as a, FactoryHarnessVerdict as c, FactoryQueueIntentRequest as d, FactoryQueueIntentResult as f, FactoryWorkerEvent as g, FactoryState as h, FactoryConsequences as i, FactoryLaneState as l, FactoryReviewerOutput as m, FACTORY_ERROR_MAX_CHARS as n, FactoryControlResult as o, FactoryReviewVerdict as p, FACTORY_PROTECTED_PATH_FLOOR as r, FactoryHarnessStateLine as s, AgentFactoryQueueRequest as t, FactoryProjectState as u };
@@ -1,4 +1,4 @@
1
- import { t as AGENT_API_VERBS } from "./session-BZbariv5.js";
1
+ import { t as AGENT_API_VERBS } from "./session-BlT68ppa.js";
2
2
  import { r as execFileSync } from "./child-process-safe-CbQnyh7D.js";
3
3
  //#region server/core/command-line-core.ts
4
4
  var SUBCOMMANDS_HONORING_TRAILING_GLOBAL_OPTIONS = /* @__PURE__ */ new Set([
@@ -1,6 +1,6 @@
1
1
  import { r as errorMessage } from "./text-DoirglWV.js";
2
2
  import { o as relayPath } from "./runtime-paths-BkeftE60.js";
3
- import { T as SIGN_URL_ENV, n as AGENT_URL_ENV } from "./session-BZbariv5.js";
3
+ import { E as SIGN_URL_ENV, n as AGENT_URL_ENV } from "./session-BlT68ppa.js";
4
4
  import { t as HOOK_URL_ENV } from "./hook-relay-core-DA_bz2KA.js";
5
5
  import { n as isRecord } from "./coerce-NSst8oRP.js";
6
6
  import { o as SANE_YOLO_PATH_ENV, r as RTK_PATH_ENV, s as saneYoloEnv } from "./rtk-hook-core-VrUafGAp.js";