glimmervoid 0.36.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +86 -84
  2. package/dist/bin/glimmervoid.js +54 -115
  3. package/dist/chunks/{adapters-BdnLyJjf.js → adapters-B-IkWl-r.js} +37 -15
  4. package/dist/chunks/adapters-Dt3vwxwY.js +1 -0
  5. package/dist/chunks/{agent-api-cli-DIqRLvu3.js → agent-api-cli-3hryuewm.js} +1 -1
  6. package/dist/chunks/{agent-api-cli-d-Bgsshx.js → agent-api-cli-BcZ9DLCF.js} +41 -12
  7. package/dist/chunks/{agent-api-core-BUC9WND7.js → agent-api-core--8WtU1xU.js} +88 -6
  8. package/dist/chunks/{agent-setup-cli-CH7EHsAX.js → agent-setup-cli-BixDoCkF.js} +2 -2
  9. package/dist/chunks/{config-CuZ16F9W.js → config-BHBZsCBc.js} +22 -16
  10. package/dist/chunks/config-store-DYj3wYgw.js +1 -0
  11. package/dist/chunks/{config-store-LqQ7MuyV.js → config-store-DbfMbz4j.js} +46 -69
  12. package/dist/chunks/{contracts-BLZAOP57.js → contracts-u40eJhaf.js} +66 -21
  13. package/dist/chunks/git-version-BpnTd8sU.js +139 -0
  14. package/dist/chunks/{grok-Ch4-35_r.js → grok-xFs6zIu4.js} +5 -1
  15. package/dist/chunks/guardrails-deps-Cb-ki4EU.js +70 -0
  16. package/dist/chunks/{sandbox-proxy-core-hnQgKR0T.js → guardrails-proxy-core-BI3rdY-m.js} +4 -4
  17. package/dist/chunks/{json-file-BaxGcB2R.js → json-file-CIJf0Cel.js} +190 -9
  18. package/dist/chunks/{knowledge-graph-cli-DD7QvcFd.js → knowledge-graph-cli-DcspNqhz.js} +1 -1
  19. package/dist/chunks/{loopback-post-DepQfdcM.js → loopback-post-DZK7YibD.js} +10 -10
  20. package/dist/chunks/{main-Rmo83Ow-.js → main-w01-P1oZ.js} +15186 -13134
  21. package/dist/chunks/{pair-cli-DzFeAmq5.js → pair-cli-BdoyrDCr.js} +2 -2
  22. package/dist/chunks/{remote-config-CPdSF2Xi.js → remote-config-61zJ0hME.js} +2 -2
  23. package/dist/chunks/{session-B8RhqQJe.js → session-8Pv0y1vz.js} +55 -9
  24. package/dist/chunks/{session-routes-DB5aDKsx.js → session-routes-D-GZC-Sy.js} +9 -9
  25. package/dist/chunks/{settings-cli-C2TY6hl-.js → settings-cli-DKJsm3AP.js} +3 -3
  26. package/dist/chunks/{ssh-sign-cli-C2nUwJC-.js → ssh-sign-cli-Dc2gOCwE.js} +2 -2
  27. package/dist/client/assets/index-BfqmOGgc.js +275 -0
  28. package/dist/client/assets/index-DxABp5yJ.css +1 -0
  29. package/dist/client/index.html +10 -3
  30. package/dist/scripts/postinstall-path-check.js +4 -4
  31. package/dist/server/index.js +1 -1
  32. package/dist/session/command-hook-relay.js +1 -1
  33. package/dist/session/{sandbox-open-launcher.js → guardrails-open-launcher.js} +10 -10
  34. package/dist/session/hook-relay.js +1 -1
  35. package/dist/session/statusline-relay.js +1 -1
  36. package/dist/session/visions-relay.js +7 -7
  37. package/package.json +4 -3
  38. package/scripts/recover-handoff.mjs +1 -1
  39. package/dist/chunks/adapters-BVozg-Lg.js +0 -1
  40. package/dist/chunks/config-store-tVmt_nfm.js +0 -1
  41. package/dist/chunks/git-version-CUcDtF5k.js +0 -58
  42. package/dist/chunks/sandbox-deps-CWiH1d1w.js +0 -70
  43. package/dist/client/assets/index-BIaSyXwH.css +0 -1
  44. package/dist/client/assets/index-Ddu7M4Ad.js +0 -259
@@ -2,9 +2,9 @@ import { n as errorLabel, r as errorMessage } from "./text-DoirglWV.js";
2
2
  import { n as equalsIgnoringCaseOnWindows } from "./paths-Bu4eH1Yd.js";
3
3
  import { n as glimmervoidHomeDir$1, t as decideConfigPath } from "./config-path-core-DFt-TemS.js";
4
4
  import { n as isRecord } from "./coerce-NSst8oRP.js";
5
- import { d as writeJsonAtomicSync, f as writeTextAtomic, p as writeTextAtomicSync } from "./json-file-BaxGcB2R.js";
6
- import { A as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, B as USAGE_BUDGET_RANGE, C as normalizeLegacyConfigNumbers, D as FLYING_ANIMALS_DURATION_RANGE, E as FLYING_ANIMALS_DEFAULTS, F as POSTHOG_TRAFFIC_BASELINE_RANGE, G as WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE, H as USAGE_RETAIN_DAYS_RANGE, I as POSTHOG_TRAFFIC_MIN_USERS_RANGE, L as POSTHOG_TRAFFIC_MULTIPLIER_RANGE, M as PORT_RANGE, N as POSITIVE_NUMBER_RANGE, O as FLYING_ANIMALS_GAP_RANGE, P as POSTHOG_FIX_TIMEOUT_RANGE, R as REPLAY_BUFFER_KB_RANGE, T as FACTORY_MAX_LIVE_WORKERS_RANGE, U as USAGE_SCAN_INTERVAL_RANGE, V as USAGE_INTEGER_RANGES, W as WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE, d as CHANGE_MAP_NARRATOR_ENGINES, f as DEFAULT_FACTORY_CHECKS, h as UPDATE_CHANNELS, i as Config, j as NON_NEGATIVE_NUMBER_RANGE, k as FLYING_ANIMALS_SCALE_RANGE, l as configIssueMessage, m as POST_TURN_CHECK_MODES, n as BUILTIN_AGENT_IDS, p as DEFAULT_FACTORY_PROTECTED_PATHS, s as RUNTIME_CONFIG_SCALAR_KEYS, t as AGENT_ID_SHAPE_MESSAGE, u as BranchGcFileSettings, w as CHANGE_MAP_NARRATOR_TIMEOUT_RANGE, x as USAGE_COST_MODES, z as TASK_TITLE_TIMEOUT_RANGE } from "./config-CuZ16F9W.js";
7
- import { V as FeatureFlagsResponse, W as TELEMETRY_KILL_SWITCH_FLAG } from "./contracts-BLZAOP57.js";
5
+ import { b as DEFAULT_CHECK_MEMORY_RESERVE_MB, d as writeJsonAtomicSync, f as writeTextAtomic, p as writeTextAtomicSync } from "./json-file-CIJf0Cel.js";
6
+ import { A as FLYING_ANIMALS_GAP_RANGE, B as POSTHOG_TRAFFIC_MULTIPLIER_RANGE, C as USAGE_COST_MODES, D as FACTORY_MAX_LIVE_WORKERS_RANGE, E as CHANGE_MAP_NARRATOR_TIMEOUT_RANGE, F as PORT_RANGE, G as USAGE_RETAIN_DAYS_RANGE, H as TASK_TITLE_TIMEOUT_RANGE, I as POSITIVE_NUMBER_RANGE, J as WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE, K as USAGE_SCAN_INTERVAL_RANGE, L as POSTHOG_FIX_TIMEOUT_RANGE, M as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, N as MEMORY_RESERVE_MB_RANGE, O as FLYING_ANIMALS_DEFAULTS, P as NON_NEGATIVE_NUMBER_RANGE, R as POSTHOG_TRAFFIC_BASELINE_RANGE, T as normalizeLegacyConfigNumbers, U as USAGE_BUDGET_RANGE, V as REPLAY_BUFFER_KB_RANGE, W as USAGE_INTEGER_RANGES, _ as UPDATE_CHANNELS, c as RUNTIME_CONFIG_SCALAR_KEYS, d as BranchGcFileSettings, f as CHANGE_MAP_NARRATOR_ENGINES, g as POST_TURN_CHECK_MODES, i as Config, j as FLYING_ANIMALS_SCALE_RANGE, k as FLYING_ANIMALS_DURATION_RANGE, m as DEFAULT_FACTORY_PROTECTED_PATHS, n as BUILTIN_AGENT_IDS, p as DEFAULT_FACTORY_CHECKS, q as WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE, t as AGENT_ID_SHAPE_MESSAGE, u as configIssueMessage, z as POSTHOG_TRAFFIC_MIN_USERS_RANGE } from "./config-BHBZsCBc.js";
7
+ import { K as TELEMETRY_KILL_SWITCH_FLAG, U as FeatureFlagsResponse } from "./contracts-u40eJhaf.js";
8
8
  import fs from "node:fs";
9
9
  import path from "node:path";
10
10
  import os from "node:os";
@@ -264,7 +264,7 @@ var POSTHOG_INGEST_HOST = "https://us.i.posthog.com";
264
264
  var TELEMETRY_BATCH_URL = `${POSTHOG_INGEST_HOST}/batch/`;
265
265
  var TELEMETRY_FLAGS_URL = `${POSTHOG_INGEST_HOST}/flags?v=2`;
266
266
  var MAX_STACK_LENGTH = 16384;
267
- var FIRST_RUN_NOTICE = ["Glimmervoid sends anonymous usage and error data to help improve it: app starts, daily activity, session starts and ends with the agent kind, exit kind and duration, errors as their type, error code and scrubbed stack frames, per session token counts, models and estimated cost, and factory outcomes as the kind of decision, how it came out, its duration and attempt number. No error messages, paths, repository names, prompts, objectives, model output or terminal output.", "Turn it off in Settings > Privacy, or set GLIMMERVOID_TELEMETRY=0 or DO_NOT_TRACK=1."].join("\n");
267
+ var FIRST_RUN_NOTICE = ["Anonymous usage data is on. Never paths, prompts or output. Details: https://github.com/johncwaters/glimmervoid/blob/main/docs/configuration.md#telemetry", "Turn it off in Settings > Privacy, or GLIMMERVOID_TELEMETRY=0."].join("\n");
268
268
  var TRUTHY_FLAGS = /* @__PURE__ */ new Set([
269
269
  "1",
270
270
  "true",
@@ -659,10 +659,6 @@ var DAYS = {
659
659
  label: "days",
660
660
  storedPerDisplay: 1
661
661
  };
662
- var MILLISECONDS = {
663
- label: "ms",
664
- storedPerDisplay: 1
665
- };
666
662
  var SECONDS_STORED_AS_MS = {
667
663
  label: "seconds",
668
664
  storedPerDisplay: MS_PER_SECOND,
@@ -1003,7 +999,7 @@ var SECTIONS = Object.freeze([
1003
999
  id: "auto-resume",
1004
1000
  path: "autoResume",
1005
1001
  title: "Auto-resume sessions on startup",
1006
- description: "Resume conversations that were live when Glimmervoid last shut down or crashed.",
1002
+ description: "Resume conversations that were live when Glimmervoid last shut down or crashed, and tell sessions that were mid-turn to continue.",
1007
1003
  control: "toggle",
1008
1004
  keywords: ["startup", "conversation"],
1009
1005
  defaultValue: true,
@@ -1013,7 +1009,7 @@ var SECTIONS = Object.freeze([
1013
1009
  id: "conversation-view",
1014
1010
  path: "conversationView",
1015
1011
  title: "Conversation view (experimental)",
1016
- description: "Let each Claude Code and Codex session turn on a Conversation face from its card menu, which renders the transcript as messages, approvals and a composer. Sessions stay on the terminal until you turn it on for them. A Codex session connects on its next start, through a local app-server so approvals can be answered from the dashboard; sandboxed Codex sessions and those that bypass Codex hook trust keep the terminal only.",
1012
+ description: "Let each Claude Code and Codex session turn on a Conversation face from its card menu, which renders the transcript as messages, approvals and a composer. Sessions stay on the terminal until you turn it on for them. A Claude Code session started while this is on can answer its permission prompts and questions there. A Codex session connects on its next start, through a local app-server so approvals can be answered from the dashboard; guarded Codex sessions and those that bypass Codex hook trust keep the terminal only.",
1017
1013
  control: "toggle",
1018
1014
  keywords: [
1019
1015
  "experimental",
@@ -1628,7 +1624,7 @@ var SECTIONS = Object.freeze([
1628
1624
  id: "team-review-keep-mergeable-enabled",
1629
1625
  path: "teamReview.keepMergeableEnabled",
1630
1626
  title: "Keep mergeable",
1631
- description: "Offer Keep mergeable on your pull requests: a sandboxed agent repairs conflicts and failing checks and pushes the repair. Off hides the control and starts no repair; the pull requests you chose stay chosen for when you turn it back on.",
1627
+ description: "Offer Keep mergeable on your pull requests: a guarded agent repairs conflicts and failing checks and pushes the repair. Off hides the control and starts no repair; the pull requests you chose stay chosen for when you turn it back on.",
1632
1628
  control: "toggle",
1633
1629
  keywords: [
1634
1630
  "repair",
@@ -1704,7 +1700,7 @@ var SECTIONS = Object.freeze([
1704
1700
  id: "workflows-rules",
1705
1701
  path: "status:workflow-rules",
1706
1702
  title: "Workflow rules",
1707
- description: "Each rule watches repositories for one pull request event (opened, checks-failed, review-requested, approved, commented or merged), narrows it by author, labels, base branch, your own pull requests or a review request to your team, and then notifies you, labels or comments on the pull request, or starts a sandboxed agent session that pushes nothing. Rules start disabled. Turn each rule on or off here; everything else about a rule is set in config.json under workflows.rules.",
1703
+ description: "Each rule watches repositories for one pull request event (opened, checks-failed, review-requested, approved, commented or merged), narrows it by author, labels, base branch, your own pull requests or a review request to your team, and then notifies you, labels or comments on the pull request, or starts a guarded agent session that pushes nothing. Rules start disabled. Turn each rule on or off here; everything else about a rule is set in config.json under workflows.rules.",
1708
1704
  control: "readonly",
1709
1705
  keywords: [
1710
1706
  "pull requests",
@@ -2019,6 +2015,42 @@ var FILE_ONLY_SETTINGS = Object.freeze([
2019
2015
  fileOnlyReason: TUNING_KNOB,
2020
2016
  ...FILE_ONLY
2021
2017
  },
2018
+ {
2019
+ id: "file-session-memory-reserve",
2020
+ path: "sessionMemoryReserveMB",
2021
+ title: "Session memory reserve",
2022
+ group: "machine-sessions",
2023
+ description: "Free memory an automatic session start waits for; 0 starts sessions without checking.",
2024
+ control: "number",
2025
+ range: MEMORY_RESERVE_MB_RANGE,
2026
+ unit: {
2027
+ label: "MB",
2028
+ storedPerDisplay: 1
2029
+ },
2030
+ keywords: ["memory", "headroom"],
2031
+ defaultValue: 600,
2032
+ takesEffect: "now",
2033
+ fileOnlyReason: TUNING_KNOB,
2034
+ ...FILE_ONLY
2035
+ },
2036
+ {
2037
+ id: "file-check-memory-reserve",
2038
+ path: "checkMemoryReserveMB",
2039
+ title: "Check run memory reserve",
2040
+ group: "machine-sessions",
2041
+ description: "Free memory a factory check run waits for; 0 runs checks without checking.",
2042
+ control: "number",
2043
+ range: MEMORY_RESERVE_MB_RANGE,
2044
+ unit: {
2045
+ label: "MB",
2046
+ storedPerDisplay: 1
2047
+ },
2048
+ keywords: ["memory", "factory"],
2049
+ defaultValue: 1500,
2050
+ takesEffect: "now",
2051
+ fileOnlyReason: TUNING_KNOB,
2052
+ ...FILE_ONLY
2053
+ },
2022
2054
  {
2023
2055
  id: "file-cursor-blink",
2024
2056
  path: "cursorBlink",
@@ -2190,57 +2222,6 @@ var FILE_ONLY_SETTINGS = Object.freeze([
2190
2222
  fileOnlyReason: BY_RULE,
2191
2223
  ...FILE_ONLY
2192
2224
  },
2193
- {
2194
- id: "file-auto-recover-seconds",
2195
- path: "autoRecoverSeconds",
2196
- title: "Auto-recovery delay",
2197
- group: "machine-detection-sessions",
2198
- description: "Delay before an interrupted state can recover.",
2199
- control: "number",
2200
- integer: false,
2201
- step: "any",
2202
- range: POSITIVE_NUMBER_RANGE,
2203
- unit: SECONDS,
2204
- keywords: ["timer", "recovery"],
2205
- defaultValue: 3,
2206
- takesEffect: "new-sessions",
2207
- fileOnlyReason: TUNING_KNOB,
2208
- ...FILE_ONLY
2209
- },
2210
- {
2211
- id: "file-input-grace-seconds",
2212
- path: "inputGraceSeconds",
2213
- title: "Input grace period",
2214
- group: "machine-detection-sessions",
2215
- description: "Grace window around operator input.",
2216
- control: "number",
2217
- integer: false,
2218
- step: "any",
2219
- range: POSITIVE_NUMBER_RANGE,
2220
- unit: SECONDS,
2221
- keywords: ["timer", "prompt"],
2222
- defaultValue: 5,
2223
- takesEffect: "new-sessions",
2224
- fileOnlyReason: TUNING_KNOB,
2225
- ...FILE_ONLY
2226
- },
2227
- {
2228
- id: "file-prompt-detection-ms",
2229
- path: "promptDetectionMs",
2230
- title: "Prompt detection delay",
2231
- group: "machine-detection-sessions",
2232
- description: "Timing threshold used by prompt detection.",
2233
- control: "number",
2234
- integer: false,
2235
- step: "any",
2236
- range: POSITIVE_NUMBER_RANGE,
2237
- unit: MILLISECONDS,
2238
- keywords: ["timer", "detection"],
2239
- defaultValue: 1500,
2240
- takesEffect: "new-sessions",
2241
- fileOnlyReason: TUNING_KNOB,
2242
- ...FILE_ONLY
2243
- },
2244
2225
  {
2245
2226
  id: "file-notify-debounce-ms",
2246
2227
  path: "notifyDebounceMs",
@@ -3552,9 +3533,6 @@ function findEscapingArchiveMember(listingText) {
3552
3533
  //#region server/config-store.ts
3553
3534
  var DEFAULT_CONFIG = {
3554
3535
  port: 3e3,
3555
- autoRecoverSeconds: 3,
3556
- inputGraceSeconds: 5,
3557
- promptDetectionMs: 1500,
3558
3536
  notifyDebounceMs: 3e3,
3559
3537
  phoneEscalationMs: 3e5,
3560
3538
  cursorBlink: false,
@@ -3564,6 +3542,8 @@ var DEFAULT_CONFIG = {
3564
3542
  detectBackgroundAgents: true,
3565
3543
  detectScheduledWakeups: true,
3566
3544
  replayBufferKB: 512,
3545
+ sessionMemoryReserveMB: 600,
3546
+ checkMemoryReserveMB: DEFAULT_CHECK_MEMORY_RESERVE_MB,
3567
3547
  recordSignals: true,
3568
3548
  trace: { enabled: true },
3569
3549
  planReview: { enabled: true },
@@ -4004,9 +3984,6 @@ function createConfigStore({ settingsDefaults } = {}) {
4004
3984
  function getSettings() {
4005
3985
  return {
4006
3986
  port: config.port,
4007
- autoRecoverSeconds: config.autoRecoverSeconds,
4008
- inputGraceSeconds: config.inputGraceSeconds,
4009
- promptDetectionMs: config.promptDetectionMs,
4010
3987
  notifyDebounceMs: config.notifyDebounceMs,
4011
3988
  phoneEscalationMs: config.phoneEscalationMs ?? DEFAULT_CONFIG.phoneEscalationMs,
4012
3989
  replayBufferKB: config.replayBufferKB,
@@ -1,5 +1,5 @@
1
- import { A as MyPrKeepMergeableResult, D as LinkedPr, Dt as GithubPollingRefreshRequest, E as TaskTitle, F as MyPrMergeWhenReadyRequest, G as CommitSha, H as MyPrsStatus, I as MyPrMergeWhenReadyResult, M as MyPrMergeRequest, N as MyPrMergeResult, Ot as GithubPollingRefreshResult, S as SessionState, Tt as REPO_SLUG_RE, U as SessionPrLinks, _ as SESSION_DOC_PATH_MAX_CHARS, b as SessionDoc, ct as TeamReviewActionResult, d as ConversationApprovalDecision, ft as TeamReviewStatus, k as MyPrKeepMergeableRequest, kt as githubPollingShape, p as PendingWakeup, st as TeamReviewActionRequest, u as ConversationApproval, vt as hasRequiredActionHead, x as SessionSnapshot } from "./session-B8RhqQJe.js";
2
- import { J as CoherenceRisk, K as CoherenceOrient, Q as CoherenceWorkState, n as BUILTIN_AGENT_IDS, q as CoherenceReadiness } from "./config-CuZ16F9W.js";
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-8Pv0y1vz.js";
2
+ import { X as CoherenceReadiness, Y as CoherenceOrient, Z as CoherenceRisk, h as FactorySettings, n as BUILTIN_AGENT_IDS, tt as CoherenceWorkState } from "./config-BHBZsCBc.js";
3
3
  import { z } from "zod";
4
4
  //#region shared/contracts/factory.ts
5
5
  var FactoryConsequences = z.looseObject({ records: z.array(z.looseObject({
@@ -15,6 +15,7 @@ var FactoryConsequences = z.looseObject({ records: z.array(z.looseObject({
15
15
  session: z.string().optional(),
16
16
  evidence: z.string().optional()
17
17
  })) });
18
+ var confirmedFlakes = z.array(z.string().min(1)).max(256);
18
19
  var FactoryProjectState = z.object({
19
20
  projectId: z.string(),
20
21
  projectName: z.string(),
@@ -34,6 +35,12 @@ var FactoryProjectState = z.object({
34
35
  spentTodayUsd: z.number().finite().nonnegative().optional(),
35
36
  dailyBudgetUsd: z.number().finite().nonnegative().nullable().optional(),
36
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(),
37
44
  error: z.string().nullable(),
38
45
  heading: z.object({
39
46
  action: CoherenceOrient.shape.action,
@@ -52,6 +59,9 @@ var FactoryProjectState = z.object({
52
59
  dependsOn: z.array(z.string()),
53
60
  writeScopes: z.array(z.string()),
54
61
  owner: z.string().nullable(),
62
+ blockReason: z.string().nullable().optional(),
63
+ parked: z.boolean().optional(),
64
+ blockCount: z.number().int().nonnegative().optional(),
55
65
  lastEvent: z.object({
56
66
  event: z.string(),
57
67
  at: z.string(),
@@ -79,7 +89,11 @@ var FactoryHarnessStateLine = z.object({
79
89
  state: FactoryState
80
90
  });
81
91
  var FactoryHarnessVerdict = z.looseObject({
82
- outcome: z.enum(["pass", "fail"]),
92
+ outcome: z.enum([
93
+ "pass",
94
+ "partial",
95
+ "fail"
96
+ ]),
83
97
  failureClass: z.string().nullable().optional()
84
98
  });
85
99
  var FACTORY_ERROR_MAX_CHARS = 16384;
@@ -141,12 +155,22 @@ var FactoryQueueIntentResult = z.object({
141
155
  });
142
156
  var FactoryControlRequest = z.object({
143
157
  projectId,
144
- action: z.enum(["pause", "resume"])
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"]
145
168
  });
146
169
  var FactoryControlResult = z.object({
147
170
  projectId: z.string().max(128),
148
171
  action: FactoryControlRequest.shape.action,
149
172
  ok: z.boolean(),
173
+ reopenedWorkIds: z.array(z.string().min(1)).optional(),
150
174
  error: z.string().max(FACTORY_ERROR_MAX_CHARS).optional()
151
175
  });
152
176
  var FactoryReviewVerdict = z.object({
@@ -181,6 +205,8 @@ var FactoryLaneState = z.object({
181
205
  trustedIntentIds: z.array(z.string().min(1)).optional(),
182
206
  intentWriteScopes: z.record(z.string().min(1), z.array(z.string().min(1))).optional(),
183
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(),
184
210
  ticketedIntentIds: z.array(z.string().min(1)).optional(),
185
211
  pendingIntentTickets: z.record(z.string().min(1), z.object({
186
212
  risk: CoherenceRisk,
@@ -191,7 +217,7 @@ var FactoryLaneState = z.object({
191
217
  factoryLandedShas: z.array(z.string().regex(/^[a-f0-9]{40,64}$/)).optional(),
192
218
  unlandedFactoryRecords: z.array(FactoryUnlandedRecord).optional(),
193
219
  ticketBlockCounts: z.record(z.string().min(1), z.number().int().nonnegative()).optional(),
194
- intentCapCancelCounts: z.record(z.string().min(1), z.number().int().nonnegative()).optional()
220
+ notifiedIntentOutcomes: z.array(z.string().min(1)).optional()
195
221
  });
196
222
  var FactoryWorkerEvent = z.object({
197
223
  workId: z.string().min(1),
@@ -269,7 +295,7 @@ var decisionFields = {
269
295
  attempt: z.number().int().positive().nullable(),
270
296
  durationMs: z.number().int().nonnegative().nullable(),
271
297
  failureClass: FactoryDecisionFailureClass.nullable(),
272
- reason: z.string().max(1e3).nullable()
298
+ reason: z.string().max(3999).nullable()
273
299
  };
274
300
  var FactoryDecisionLogLine = z.discriminatedUnion("kind", [
275
301
  z.strictObject({
@@ -1276,6 +1302,7 @@ var SessionCardFields = z.object({
1276
1302
  saneYolo: z.boolean(),
1277
1303
  worktree: z.boolean(),
1278
1304
  workspace: z.boolean().optional(),
1305
+ guarded: z.boolean().optional(),
1279
1306
  resumeSessionId: nullableString,
1280
1307
  ephemeral: z.boolean().optional(),
1281
1308
  linkedPrs: z.array(LinkedPr).optional()
@@ -1331,8 +1358,6 @@ var idOnlyClientTypes = [
1331
1358
  "start-session",
1332
1359
  "restart",
1333
1360
  "force-restart",
1334
- "sleep",
1335
- "wake",
1336
1361
  "merge-session",
1337
1362
  "finish-session",
1338
1363
  "merge-continue-session",
@@ -1393,15 +1418,20 @@ var clientVariants = [
1393
1418
  id: sessionId,
1394
1419
  key: PullRequestKey
1395
1420
  }),
1396
- loose("reorder-sessions", { order: z.array(sessionId) }),
1397
1421
  loose("ping", { requestId }),
1398
1422
  loose("get-settings", { requestId }),
1399
1423
  loose("update-settings", {
1400
1424
  settings: z.record(z.string(), z.unknown()),
1401
1425
  requestId
1402
1426
  }),
1403
- loose("scan-repo-roots", { requestId }),
1404
- loose("list-agents", { requestId }),
1427
+ loose("scan-repo-roots", {
1428
+ requestId,
1429
+ includeSuggestions: z.boolean().optional()
1430
+ }),
1431
+ loose("list-agents", {
1432
+ requestId,
1433
+ rescan: z.boolean().optional()
1434
+ }),
1405
1435
  loose("get-radar-report", {
1406
1436
  issueId: z.union([z.string(), z.number()]),
1407
1437
  requestId
@@ -1519,7 +1549,8 @@ var clientVariants = [
1519
1549
  loose("conversation-approval", {
1520
1550
  id: sessionId,
1521
1551
  requestId: ConversationApproval.shape.requestId,
1522
- decision: ConversationApprovalDecision
1552
+ decision: ConversationApprovalDecision,
1553
+ answers: ConversationAnswers.optional()
1523
1554
  }),
1524
1555
  loose("session-doc-read", {
1525
1556
  id: sessionId,
@@ -1562,8 +1593,6 @@ Object.freeze([
1562
1593
  "session-wakeup",
1563
1594
  "session-prompt",
1564
1595
  "session-conversation",
1565
- "session-sleep",
1566
- "session-wake",
1567
1596
  "session-merge-status",
1568
1597
  "session-worktree-blocked",
1569
1598
  "session-worktree-warning",
@@ -1588,6 +1617,7 @@ Object.freeze([
1588
1617
  "notify",
1589
1618
  "update-status",
1590
1619
  "update-progress",
1620
+ "post-turn-leftovers",
1591
1621
  "error",
1592
1622
  "session-error",
1593
1623
  "settings",
@@ -1622,7 +1652,6 @@ Object.freeze([
1622
1652
  "factory-state",
1623
1653
  "my-prs-status",
1624
1654
  "issues-status",
1625
- "branch-gc-status",
1626
1655
  "usage-sessions",
1627
1656
  "usage-report",
1628
1657
  "plan-limits",
@@ -1636,7 +1665,6 @@ Object.freeze([
1636
1665
  "ingest-activity",
1637
1666
  "ingest-snapshot",
1638
1667
  "client-trust",
1639
- "sessions-reordered",
1640
1668
  "shutting-down",
1641
1669
  "restarting"
1642
1670
  ]);
@@ -1747,8 +1775,6 @@ var serverVariants = [
1747
1775
  isConversationViewOn: z.boolean(),
1748
1776
  conversationApproval: ConversationApproval.nullable()
1749
1777
  }),
1750
- loose("session-sleep"),
1751
- loose("session-wake"),
1752
1778
  loose("session-merge-status", {
1753
1779
  id: sessionId,
1754
1780
  mergeStatus: z.string(),
@@ -1876,6 +1902,10 @@ var serverVariants = [
1876
1902
  }),
1877
1903
  loose("update-status", updateStatusShape),
1878
1904
  loose("update-progress", { journal: UpdateJournal }),
1905
+ loose("post-turn-leftovers", {
1906
+ repositories: z.array(z.string()),
1907
+ command: z.string()
1908
+ }),
1879
1909
  loose("error", {
1880
1910
  id: sessionId.optional(),
1881
1911
  message: z.string(),
@@ -1918,6 +1948,11 @@ var serverVariants = [
1918
1948
  path: z.string()
1919
1949
  }))
1920
1950
  })),
1951
+ suggestions: z.array(openObject({
1952
+ path: z.string(),
1953
+ label: z.string(),
1954
+ gitRepoCount: z.number().int().nonnegative()
1955
+ })).optional(),
1921
1956
  error: z.string().optional()
1922
1957
  }),
1923
1958
  loose("conversations", {
@@ -2055,7 +2090,6 @@ var serverVariants = [
2055
2090
  loose("factory-state", FactoryState.shape),
2056
2091
  MyPrsStatus,
2057
2092
  IssuesStatus,
2058
- loose("branch-gc-status"),
2059
2093
  loose("usage-sessions", {
2060
2094
  ts: timestamp,
2061
2095
  pricingSource: nullableString,
@@ -2143,7 +2177,6 @@ var serverVariants = [
2143
2177
  ts: timestamp
2144
2178
  }),
2145
2179
  loose("client-trust", { trust: z.enum(["local", "remote"]) }),
2146
- loose("sessions-reordered", { order: z.array(sessionId) }),
2147
2180
  loose("shutting-down"),
2148
2181
  loose("restarting")
2149
2182
  ];
@@ -2168,6 +2201,9 @@ z.object({
2168
2201
  rows: viewerRows,
2169
2202
  seq: z.number().int().nonnegative()
2170
2203
  });
2204
+ var DATA_ATTACH_HISTORY_PARAM = "history";
2205
+ var DEEP_HISTORY_SCROLLBACK_LINES = 5e3;
2206
+ var DataAttachHistory = z.enum(["screen", "deep"]);
2171
2207
  function decodeJson(raw) {
2172
2208
  try {
2173
2209
  return JSON.parse(raw);
@@ -2180,6 +2216,15 @@ function parseDataClientMessage(raw) {
2180
2216
  if (!parsed.success) return null;
2181
2217
  return parsed.data;
2182
2218
  }
2219
+ function parseDataAttachHistory(rawUrl) {
2220
+ if (typeof rawUrl !== "string") return "screen";
2221
+ const queryAt = rawUrl.indexOf("?");
2222
+ if (queryAt === -1) return "screen";
2223
+ const query = new URLSearchParams(rawUrl.slice(queryAt + 1).split("#")[0]);
2224
+ const parsed = DataAttachHistory.safeParse(query.get(DATA_ATTACH_HISTORY_PARAM));
2225
+ if (!parsed.success) return "screen";
2226
+ return parsed.data;
2227
+ }
2183
2228
  //#endregion
2184
2229
  //#region shared/contracts/hooks.ts
2185
2230
  var HTTP_URL_RE = /^https?:\/\/\S+$/i;
@@ -2203,4 +2248,4 @@ z.object({
2203
2248
  projects: z.array(z.string()).optional()
2204
2249
  }).passthrough();
2205
2250
  //#endregion
2206
- 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 };
2251
+ export { FactoryControlRequest as $, 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, FactoryConsequences as Q, BenchmarkSuite as R, planTitle as S, IssueKey as T, FeatureFlagsResponse as U, MinedPrReviewData as V, PendingCrashReport as W, FACTORY_ERROR_MAX_CHARS as X, FactoryDecisionLogLine as Y, FACTORY_PROTECTED_PATH_FLOOR as Z, PLAN_RESULT_HOOK_EVENT as _, parseDataClientMessage as a, FactoryReviewVerdict as at, PlanRevision as b, DIFF_ANNOTATION_NOTE_MAX_CHARS as c, isSingleFactoryPathSegment as ct, MAX_RAW_LINE_CHARS as d, FactoryHarnessStateLine as et, TraceCheckpoint as f, PLAN_HOOK_OUTPUT_MAX_CHARS as g, PLAN_HOOK_EVENT as h, parseDataAttachHistory as i, FactoryQueueIntentRequest as it, changeMapFactId as j, IssuesStatus as k, InstallFlavor as l, PLAN_BODY_CAP_BYTES as m, HookEnvelope as n, FactoryLaneState as nt, CONTROL_FRAME_MAX_BYTES as o, FactoryReviewerOutput as ot, TraceRecord as p, TelemetryState as q, DEEP_HISTORY_SCROLLBACK_LINES as r, FactoryProjectState as rt, ClientMessage as s, FactoryWorkerEvent as st, HTTP_URL_RE as t, FactoryHarnessVerdict as tt, UpdateJournal as u, PLAN_TOOL_NAME as v, GithubIssueResponse as w, parseExitPlanModeHookPayload as x, PlanDecision as y, CommitComparison as z };
@@ -0,0 +1,139 @@
1
+ import { t as AGENT_API_VERBS } from "./session-8Pv0y1vz.js";
2
+ import { r as execFileSync } from "./child-process-safe-CbQnyh7D.js";
3
+ //#region server/core/command-line-core.ts
4
+ var SUBCOMMANDS_HONORING_TRAILING_GLOBAL_OPTIONS = /* @__PURE__ */ new Set([
5
+ "doctor",
6
+ "pair",
7
+ "visions"
8
+ ]);
9
+ var SUBCOMMANDS_HONORING_A_LEADING_HELP_OR_VERSION = /* @__PURE__ */ new Set([...AGENT_API_VERBS, "factory"]);
10
+ var OPTIONS_TAKING_A_VALUE = {
11
+ "--config": "configPath",
12
+ "--port": "port"
13
+ };
14
+ function scanGlobalOption(argv, index, state) {
15
+ const token = argv[index];
16
+ const valueKey = OPTIONS_TAKING_A_VALUE[token];
17
+ if (valueKey) {
18
+ const value = argv[index + 1];
19
+ if (value !== void 0) state[valueKey] = value;
20
+ return index + 2;
21
+ }
22
+ if (token === "--help" || token === "-h") state.wantsHelp = true;
23
+ if (token === "--version") state.wantsVersion = true;
24
+ if (token === "--doctor") state.wantsDoctor = true;
25
+ if (token === "--no-open") state.wantsNoOpen = true;
26
+ return index + 1;
27
+ }
28
+ function scanTrailingGlobalOptions(subcommandArgs, state) {
29
+ let index = 0;
30
+ while (index < subcommandArgs.length) {
31
+ if (!subcommandArgs[index].startsWith("-")) {
32
+ index += 1;
33
+ continue;
34
+ }
35
+ index = scanGlobalOption(subcommandArgs, index, state);
36
+ }
37
+ }
38
+ function scanLeadingHelpOrVersion(subcommandArgs, state) {
39
+ const firstArgument = subcommandArgs[0];
40
+ if (firstArgument === "--help" || firstArgument === "-h") state.wantsHelp = true;
41
+ if (firstArgument === "--version") state.wantsVersion = true;
42
+ }
43
+ function parseCommandLine(argv) {
44
+ const state = {
45
+ configPath: null,
46
+ port: null,
47
+ wantsHelp: false,
48
+ wantsVersion: false,
49
+ wantsDoctor: false,
50
+ wantsNoOpen: false
51
+ };
52
+ let index = 0;
53
+ while (index < argv.length && argv[index].startsWith("-")) index = scanGlobalOption(argv, index, state);
54
+ const name = argv[index];
55
+ const subcommandArgs = argv.slice(index + 1);
56
+ if (name !== void 0 && SUBCOMMANDS_HONORING_TRAILING_GLOBAL_OPTIONS.has(name)) scanTrailingGlobalOptions(subcommandArgs, state);
57
+ if (name !== void 0 && SUBCOMMANDS_HONORING_A_LEADING_HELP_OR_VERSION.has(name)) scanLeadingHelpOrVersion(subcommandArgs, state);
58
+ if (state.wantsHelp) return { kind: "help" };
59
+ if (state.wantsVersion) return { kind: "version" };
60
+ const globalOptions = {
61
+ configPath: state.configPath,
62
+ port: state.port
63
+ };
64
+ if (state.wantsDoctor) return {
65
+ kind: "subcommand",
66
+ name: "doctor",
67
+ subcommandArgs: [],
68
+ globalOptions
69
+ };
70
+ if (name === void 0) return {
71
+ kind: "server",
72
+ globalOptions,
73
+ isBrowserOpenSkipped: state.wantsNoOpen
74
+ };
75
+ return {
76
+ kind: "subcommand",
77
+ name,
78
+ subcommandArgs,
79
+ globalOptions
80
+ };
81
+ }
82
+ //#endregion
83
+ //#region server/git/core/git-version-core.ts
84
+ var NEW_WORK_ISOLATION_FLOOR = Object.freeze({
85
+ major: 2,
86
+ minor: 48
87
+ });
88
+ var NEW_WORK_ISOLATION_FLOOR_LABEL = `${NEW_WORK_ISOLATION_FLOOR.major}.${NEW_WORK_ISOLATION_FLOOR.minor}`;
89
+ var WHOLE_RANGE_CONSEQUENCE = "a team re-review cannot single out the author's new work and reviews the whole pull request range";
90
+ var GIT_UPDATE_HINT = `Update git to ${NEW_WORK_ISOLATION_FLOOR_LABEL} or newer`;
91
+ var UNKNOWN_GIT_VERSION = Object.freeze({
92
+ version: null,
93
+ isTooOldToIsolateNewWork: false
94
+ });
95
+ function gitVersionReport(versionOutput) {
96
+ const match = /^git version (\d+)\.(\d+)(?:\.(\d+))?/.exec(versionOutput?.trim() ?? "");
97
+ if (!match) return UNKNOWN_GIT_VERSION;
98
+ const [, major = "", minor = "", patch] = match;
99
+ const isBelowFloorMajor = Number(major) < NEW_WORK_ISOLATION_FLOOR.major;
100
+ const isBelowFloorMinor = Number(major) === NEW_WORK_ISOLATION_FLOOR.major && Number(minor) < NEW_WORK_ISOLATION_FLOOR.minor;
101
+ return {
102
+ version: [
103
+ major,
104
+ minor,
105
+ patch
106
+ ].filter((part) => part !== void 0).join("."),
107
+ isTooOldToIsolateNewWork: isBelowFloorMajor || isBelowFloorMinor
108
+ };
109
+ }
110
+ function gitBootWarning(report) {
111
+ if (!report.isTooOldToIsolateNewWork) return null;
112
+ return `[git] git ${report.version} is older than ${NEW_WORK_ISOLATION_FLOOR_LABEL}, so ${WHOLE_RANGE_CONSEQUENCE}. ${GIT_UPDATE_HINT}.`;
113
+ }
114
+ function gitDoctorRows(report) {
115
+ const versionRow = ["git", report.version ?? "unknown"];
116
+ if (!report.isTooOldToIsolateNewWork) return [versionRow];
117
+ return [versionRow, ["hint", `${GIT_UPDATE_HINT}: on an older one ${WHOLE_RANGE_CONSEQUENCE}`]];
118
+ }
119
+ //#endregion
120
+ //#region server/git/git-version.ts
121
+ function readGitVersionOutput() {
122
+ return execFileSync("git", ["--version"], {
123
+ encoding: "utf8",
124
+ timeout: 3e3
125
+ });
126
+ }
127
+ function probeGitVersion({ readVersionOutput = readGitVersionOutput } = {}) {
128
+ try {
129
+ return gitVersionReport(readVersionOutput());
130
+ } catch {
131
+ return gitVersionReport(null);
132
+ }
133
+ }
134
+ function warnWhenGitIsTooOld({ probe = probeGitVersion, log = console } = {}) {
135
+ const warning = gitBootWarning(probe());
136
+ if (warning !== null) log.warn(warning);
137
+ }
138
+ //#endregion
139
+ export { parseCommandLine as i, warnWhenGitIsTooOld as n, gitDoctorRows as r, probeGitVersion as t };
@@ -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 { n as AGENT_URL_ENV, v as SIGN_URL_ENV } from "./session-B8RhqQJe.js";
3
+ import { T as SIGN_URL_ENV, n as AGENT_URL_ENV } from "./session-8Pv0y1vz.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";
@@ -271,6 +271,9 @@ function mayContributeHooks(configText) {
271
271
  if (!isRecord(settings)) return false;
272
272
  return Object.hasOwn(settings, "hooks");
273
273
  }
274
+ function userConfigFolders() {
275
+ return [path.join(os.homedir(), ".claude")];
276
+ }
274
277
  function mapHookToSignal(event, payload) {
275
278
  const normalizedEvent = String(event || "").toLowerCase();
276
279
  if (normalizedEvent === "subagentstart") return "subagent-start";
@@ -403,6 +406,7 @@ var grok = {
403
406
  hookToolRelayPath: HOOK_TOOL_RELAY_PATH
404
407
  }),
405
408
  projectConfigCandidates: PROJECT_CONFIG_CANDIDATES,
409
+ userConfigFolders,
406
410
  mayContributeHooks
407
411
  }
408
412
  },