@adhdev/mesh-shared 1.0.82-rc.10 → 1.0.82-rc.100

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 (69) hide show
  1. package/dist/assistant-protocol.d.ts +163 -6
  2. package/dist/decision-push-relay.d.ts +20 -0
  3. package/dist/index.d.ts +12 -0
  4. package/dist/index.js +1641 -124
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +1502 -124
  7. package/dist/index.mjs.map +1 -1
  8. package/dist/launch-defaults.d.ts +196 -0
  9. package/dist/light-task.d.ts +96 -0
  10. package/dist/mesh-tool-names.d.ts +2 -2
  11. package/dist/mesh-vocabulary.d.ts +13 -4
  12. package/dist/mission-git-state.d.ts +83 -0
  13. package/dist/mission-items.d.ts +202 -0
  14. package/dist/node-facts.d.ts +61 -1
  15. package/dist/outbound-message.d.ts +9 -2
  16. package/dist/path-ownership.d.ts +1 -1
  17. package/dist/protocol/daemon-server.d.ts +42 -2
  18. package/dist/protocol/dashboard-daemon-p2p.d.ts +1 -1
  19. package/dist/protocol/dashboard-server.d.ts +20 -2
  20. package/dist/provider-approval.d.ts +36 -0
  21. package/dist/provider-question.d.ts +19 -0
  22. package/dist/quota-freshness.d.ts +4 -4
  23. package/dist/relay-reprobe.d.ts +52 -0
  24. package/dist/release.d.ts +90 -0
  25. package/dist/role-launch.d.ts +11 -0
  26. package/dist/session-launch.d.ts +10 -22
  27. package/dist/slot-proposal.d.ts +14 -0
  28. package/dist/task-source-phase.d.ts +83 -0
  29. package/dist/task-stages.d.ts +208 -0
  30. package/dist/turn-evidence.d.ts +43 -13
  31. package/dist/turn-ipc-mission.d.ts +72 -1
  32. package/dist/turn-ipc-queue.d.ts +30 -0
  33. package/dist/turn-ipc.d.ts +2 -2
  34. package/dist/types.d.ts +1 -0
  35. package/dist/worker-protocol.d.ts +41 -1
  36. package/package.json +1 -1
  37. package/src/assistant-protocol.ts +306 -6
  38. package/src/daemon-normalize.ts +7 -5
  39. package/src/decision-push-relay.ts +23 -0
  40. package/src/index.ts +13 -0
  41. package/src/keyed-doc-delta.ts +9 -1
  42. package/src/launch-defaults.ts +170 -0
  43. package/src/light-task.ts +116 -0
  44. package/src/mesh-tool-names.ts +22 -0
  45. package/src/mesh-vocabulary.ts +12 -2
  46. package/src/mission-git-state.ts +112 -0
  47. package/src/mission-items.ts +421 -0
  48. package/src/node-facts.ts +56 -1
  49. package/src/outbound-message.ts +19 -0
  50. package/src/path-ownership.ts +4 -6
  51. package/src/protocol/daemon-server.ts +37 -2
  52. package/src/protocol/dashboard-server.ts +13 -2
  53. package/src/provider-approval.ts +59 -0
  54. package/src/provider-question.ts +31 -0
  55. package/src/quota-freshness.ts +29 -13
  56. package/src/relay-reprobe.ts +117 -0
  57. package/src/release.ts +121 -0
  58. package/src/role-launch.ts +51 -0
  59. package/src/session-launch.ts +17 -1
  60. package/src/slot-proposal.ts +61 -2
  61. package/src/task-source-phase.ts +70 -0
  62. package/src/task-stages.ts +457 -0
  63. package/src/turn-evidence.ts +56 -20
  64. package/src/turn-ipc-mission.ts +127 -11
  65. package/src/turn-ipc-queue.ts +45 -2
  66. package/src/turn-ipc-turn.ts +1 -1
  67. package/src/turn-ipc.ts +1 -0
  68. package/src/types.ts +1 -0
  69. package/src/worker-protocol.ts +94 -0
package/dist/index.js CHANGED
@@ -20,7 +20,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ ASSISTANT_ACCOUNT_SLOT: () => ASSISTANT_ACCOUNT_SLOT,
24
+ ASSISTANT_FOLLOWER_ALLOWED_OPS: () => ASSISTANT_FOLLOWER_ALLOWED_OPS,
23
25
  ASSISTANT_OWNER_VERBS: () => ASSISTANT_OWNER_VERBS,
26
+ ASSISTANT_REMOTE_FOLLOW_COMMAND: () => ASSISTANT_REMOTE_FOLLOW_COMMAND,
27
+ ASSISTANT_REMOTE_PROJECT_ACCESS_COMMAND: () => ASSISTANT_REMOTE_PROJECT_ACCESS_COMMAND,
28
+ ASSISTANT_REMOTE_PROJECT_CATALOG_COMMAND: () => ASSISTANT_REMOTE_PROJECT_CATALOG_COMMAND,
29
+ ASSISTANT_REMOTE_PROJECT_COMMAND: () => ASSISTANT_REMOTE_PROJECT_COMMAND,
24
30
  ASSISTANT_REVIEW_TURN_VERBS: () => ASSISTANT_REVIEW_TURN_VERBS,
25
31
  ASSISTANT_SESSION_ID_ARG: () => ASSISTANT_SESSION_ID_ARG,
26
32
  ASSISTANT_SESSION_ID_ENV: () => ASSISTANT_SESSION_ID_ENV,
@@ -32,12 +38,16 @@ __export(index_exports, {
32
38
  CANCEL_REASONS: () => CANCEL_REASONS,
33
39
  CANONICAL_MESH_TOOL_COUNT: () => CANONICAL_MESH_TOOL_COUNT,
34
40
  CANONICAL_MESH_TOOL_NAMES: () => CANONICAL_MESH_TOOL_NAMES,
41
+ CARRY_OVER_MISSION_GOAL: () => CARRY_OVER_MISSION_GOAL,
42
+ CARRY_OVER_MISSION_TITLE: () => CARRY_OVER_MISSION_TITLE,
43
+ CHANGELOG_SECTIONS: () => CHANGELOG_SECTIONS,
35
44
  CLAUDE_TUI_REVIEW_PAGE_NOT_FOCUSED_PREFIX: () => CLAUDE_TUI_REVIEW_PAGE_NOT_FOCUSED_PREFIX,
36
45
  CLAUDE_TUI_REVIEW_UNCONFIRMED_PREFIX: () => CLAUDE_TUI_REVIEW_UNCONFIRMED_PREFIX,
37
46
  CLI_SLOT_RECIPES: () => CLI_SLOT_RECIPES,
38
47
  COMMIT_STRENGTHS: () => COMMIT_STRENGTHS,
39
48
  CONSUME_PROFILES: () => CONSUME_PROFILES,
40
49
  COORDINATOR_ACK_OUTCOMES: () => COORDINATOR_ACK_OUTCOMES,
50
+ COORDINATOR_SETTABLE_ITEM_STATES: () => COORDINATOR_SETTABLE_ITEM_STATES,
41
51
  DAEMON_METADATA_DOC_SPEC: () => DAEMON_METADATA_DOC_SPEC,
42
52
  DAEMON_P2P_SIGNAL_TYPES: () => DAEMON_P2P_SIGNAL_TYPES,
43
53
  DAEMON_STATUS_EVENT_NAMES: () => DAEMON_STATUS_EVENT_NAMES,
@@ -50,13 +60,34 @@ __export(index_exports, {
50
60
  DASHBOARD_TO_DAEMON_P2P_TYPES: () => DASHBOARD_TO_DAEMON_P2P_TYPES,
51
61
  DASHBOARD_TO_USER_SESSION_TYPES: () => DASHBOARD_TO_USER_SESSION_TYPES,
52
62
  DASHBOARD_WIRE_VERSION: () => DASHBOARD_WIRE_VERSION,
63
+ DECISION_PUSH_OPTIONS_MAX: () => DECISION_PUSH_OPTIONS_MAX,
64
+ DECISION_PUSH_OPTION_LABEL_MAX: () => DECISION_PUSH_OPTION_LABEL_MAX,
65
+ DECISION_PUSH_QUESTION_MAX: () => DECISION_PUSH_QUESTION_MAX,
66
+ DECISION_PUSH_RELAY_COMMAND: () => DECISION_PUSH_RELAY_COMMAND,
67
+ DECISION_PUSH_RELAY_SOURCE: () => DECISION_PUSH_RELAY_SOURCE,
53
68
  DEFAULT_DIFFICULTY_BRAINS: () => DEFAULT_DIFFICULTY_BRAINS,
54
69
  DELIVERY_OUTCOMES: () => DELIVERY_OUTCOMES,
55
70
  DELIVERY_VIAS: () => DELIVERY_VIAS,
56
71
  DISPATCH_FAILURE_REASONS: () => DISPATCH_FAILURE_REASONS,
72
+ DISPATCH_REFUSAL_DETAIL_MAX: () => DISPATCH_REFUSAL_DETAIL_MAX,
57
73
  EVIDENCE_ENVELOPE_FIELD_SPECS: () => EVIDENCE_ENVELOPE_FIELD_SPECS,
58
74
  EVIDENCE_SOURCE_IDS: () => EVIDENCE_SOURCE_IDS,
75
+ FINDING_CATEGORIES: () => FINDING_CATEGORIES,
76
+ FINDING_RESPONSES_MAX: () => FINDING_RESPONSES_MAX,
77
+ FINDING_RESPONSE_KINDS: () => FINDING_RESPONSE_KINDS,
78
+ FINDING_SEVERITIES: () => FINDING_SEVERITIES,
59
79
  HOLD_REASONS: () => HOLD_REASONS,
80
+ LAUNCH_DEFAULTS_NEXT_LAUNCH_NOTE: () => LAUNCH_DEFAULTS_NEXT_LAUNCH_NOTE,
81
+ LAUNCH_DEFAULT_ERROR_CODES: () => LAUNCH_DEFAULT_ERROR_CODES,
82
+ LAUNCH_DEFAULT_ROLES: () => LAUNCH_DEFAULT_ROLES,
83
+ LAUNCH_DEFAULT_SOURCES: () => LAUNCH_DEFAULT_SOURCES,
84
+ LEGACY_CARRY_OVER_MISSION_TITLE: () => LEGACY_CARRY_OVER_MISSION_TITLE,
85
+ LIGHT_BLOCK_REASONS: () => LIGHT_BLOCK_REASONS,
86
+ LIGHT_HOLD: () => LIGHT_HOLD,
87
+ LIGHT_LAND_MODES: () => LIGHT_LAND_MODES,
88
+ LIGHT_REJECT: () => LIGHT_REJECT,
89
+ LIGHT_TESTS_RUN_MAX: () => LIGHT_TESTS_RUN_MAX,
90
+ LIGHT_WARNINGS: () => LIGHT_WARNINGS,
60
91
  LIVENESS_RESULTS: () => LIVENESS_RESULTS,
61
92
  MAX_MESH_RECORD_STRING: () => MAX_MESH_RECORD_STRING,
62
93
  MAX_OWNED_PATHS: () => MAX_OWNED_PATHS,
@@ -71,6 +102,8 @@ __export(index_exports, {
71
102
  MESH_MISSION_STATUSES: () => MESH_MISSION_STATUSES,
72
103
  MESH_P2P_SIGNAL_TYPES: () => MESH_P2P_SIGNAL_TYPES,
73
104
  MESH_RECORD_PAYLOAD_KEYS: () => MESH_RECORD_PAYLOAD_KEYS,
105
+ MESH_RELEASE_CHANNELS: () => MESH_RELEASE_CHANNELS,
106
+ MESH_RELEASE_STATUSES: () => MESH_RELEASE_STATUSES,
74
107
  MESH_SESSION_CLEANUP_MODES: () => MESH_SESSION_CLEANUP_MODES,
75
108
  MESH_STATUS_DOC_SPEC: () => MESH_STATUS_DOC_SPEC,
76
109
  MESH_TASK_DIFFICULTIES: () => MESH_TASK_DIFFICULTIES,
@@ -82,10 +115,23 @@ __export(index_exports, {
82
115
  MESH_TOPIC_ENTRY_KINDS: () => MESH_TOPIC_ENTRY_KINDS,
83
116
  MESH_TOPIC_PROTOCOL_VERSION: () => MESH_TOPIC_PROTOCOL_VERSION,
84
117
  MISSION_BRIEF_RENDER_MAX_CHARS: () => MISSION_BRIEF_RENDER_MAX_CHARS,
118
+ MISSION_DECISION_ON_DUE: () => MISSION_DECISION_ON_DUE,
119
+ MISSION_DECISION_OPTION_IDS: () => MISSION_DECISION_OPTION_IDS,
120
+ MISSION_DECISION_URGENCIES: () => MISSION_DECISION_URGENCIES,
121
+ MISSION_GIT_STATES: () => MISSION_GIT_STATES,
122
+ MISSION_ITEM_KINDS: () => MISSION_ITEM_KINDS,
123
+ MISSION_ITEM_STATES: () => MISSION_ITEM_STATES,
124
+ MISSION_LIMITS: () => MISSION_LIMITS,
125
+ MISSION_OUTCOMES: () => MISSION_OUTCOMES,
126
+ MISSION_REF_GIT_METHODS: () => MISSION_REF_GIT_METHODS,
127
+ MISSION_REF_GIT_STATUSES: () => MISSION_REF_GIT_STATUSES,
128
+ MISSION_REF_KINDS: () => MISSION_REF_KINDS,
129
+ MISSION_RELEASE_EVENT_TYPES: () => MISSION_RELEASE_EVENT_TYPES,
85
130
  MODEL_AXIS_SOURCES: () => MODEL_AXIS_SOURCES,
86
131
  MODEL_SELECTION_HISTORY_LIMIT: () => MODEL_SELECTION_HISTORY_LIMIT,
87
132
  MeshChunkAssembler: () => MeshChunkAssembler,
88
133
  NATIVE_TURN_OUTCOMES: () => NATIVE_TURN_OUTCOMES,
134
+ NEEDS_WORDING_MARKER: () => NEEDS_WORDING_MARKER,
89
135
  NOTIFY_KINDS: () => NOTIFY_KINDS,
90
136
  NO_PROGRESS_OBSERVED_STATUSES: () => NO_PROGRESS_OBSERVED_STATUSES,
91
137
  NPM_UPDATE_TAGS: () => NPM_UPDATE_TAGS,
@@ -95,16 +141,37 @@ __export(index_exports, {
95
141
  OPERATOR_STATUS_REASON_VALUES: () => OPERATOR_STATUS_REASON_VALUES,
96
142
  OPERATOR_STATUS_VALUES: () => OPERATOR_STATUS_VALUES,
97
143
  OUTBOUND_MESSAGE_ORIGINS: () => OUTBOUND_MESSAGE_ORIGINS,
144
+ OWNER_ABANDON_CONFIRM_KEY_PREFIX: () => OWNER_ABANDON_CONFIRM_KEY_PREFIX,
145
+ OWNER_ABANDON_CONFIRM_OPTIONS: () => OWNER_ABANDON_CONFIRM_OPTIONS,
146
+ OWNER_ABANDON_CONFIRM_QUESTION: () => OWNER_ABANDON_CONFIRM_QUESTION,
98
147
  P2P_SIGNAL_TYPES: () => P2P_SIGNAL_TYPES,
148
+ PRIOR_FINDING_STATUSES: () => PRIOR_FINDING_STATUSES,
99
149
  PROVIDER_FAILURES: () => PROVIDER_FAILURES,
100
150
  QUOTA_BACKFILL_HORIZON_MS: () => QUOTA_BACKFILL_HORIZON_MS,
101
151
  QUOTA_RETRY_INFLIGHT_GRACE_MS: () => QUOTA_RETRY_INFLIGHT_GRACE_MS,
102
152
  QUOTA_SUPPORTED_PROVIDERS: () => QUOTA_SUPPORTED_PROVIDERS,
103
153
  RECENT_SESSION_BUCKETS: () => RECENT_SESSION_BUCKETS,
104
154
  RECLAIMING_SEND_REFUSALS: () => RECLAIMING_SEND_REFUSALS,
155
+ RELAY_REPROBE_BASE_DELAY_MS: () => RELAY_REPROBE_BASE_DELAY_MS,
156
+ RELAY_REPROBE_JITTER_RATIO: () => RELAY_REPROBE_JITTER_RATIO,
157
+ RELAY_REPROBE_MAX_DELAY_MS: () => RELAY_REPROBE_MAX_DELAY_MS,
158
+ RELEASE_ACTORS: () => RELEASE_ACTORS,
105
159
  RELEASE_CHANNELS: () => RELEASE_CHANNELS,
160
+ RELEASE_EVENT_TYPES: () => RELEASE_EVENT_TYPES,
161
+ RELEASE_LIMITS: () => RELEASE_LIMITS,
162
+ RELEASE_MEMBER_STATES: () => RELEASE_MEMBER_STATES,
106
163
  REMOVED_MESH_TOOLS: () => REMOVED_MESH_TOOLS,
107
164
  RETIRED_MESH_TOOLS: () => RETIRED_MESH_TOOLS,
165
+ REVIEW_CHECKED_MAX: () => REVIEW_CHECKED_MAX,
166
+ REVIEW_CLAIM_MAX_CHARS: () => REVIEW_CLAIM_MAX_CHARS,
167
+ REVIEW_EVIDENCE_MAX_CHARS: () => REVIEW_EVIDENCE_MAX_CHARS,
168
+ REVIEW_FINDINGS_MAX: () => REVIEW_FINDINGS_MAX,
169
+ REVIEW_FINDING_ID_MAX_CHARS: () => REVIEW_FINDING_ID_MAX_CHARS,
170
+ REVIEW_FIX_MAX_CHARS: () => REVIEW_FIX_MAX_CHARS,
171
+ REVIEW_NOTE_MAX_CHARS: () => REVIEW_NOTE_MAX_CHARS,
172
+ REVIEW_TESTS_RUN_MAX: () => REVIEW_TESTS_RUN_MAX,
173
+ REVIEW_VERDICTS: () => REVIEW_VERDICTS,
174
+ RelayReprobeScheduler: () => RelayReprobeScheduler,
108
175
  SEND_POLICY_MODES: () => SEND_POLICY_MODES,
109
176
  SEND_REFUSAL_REASONS: () => SEND_REFUSAL_REASONS,
110
177
  SERVER_STATUS_EVENT_NAMES: () => SERVER_STATUS_EVENT_NAMES,
@@ -117,6 +184,17 @@ __export(index_exports, {
117
184
  SESSION_STATUS_ALIASES: () => SESSION_STATUS_ALIASES,
118
185
  SESSION_STATUS_CLASS: () => SESSION_STATUS_CLASS,
119
186
  SHARED_SESSION_TO_VIEWER_TYPES: () => SHARED_SESSION_TO_VIEWER_TYPES,
187
+ STAGE_BLOCKED_REASONS: () => STAGE_BLOCKED_REASONS,
188
+ STAGE_DECIDE_ACTIONS: () => STAGE_DECIDE_ACTIONS,
189
+ STAGE_DEFAULT_MAX_REVISIONS: () => STAGE_DEFAULT_MAX_REVISIONS,
190
+ STAGE_INDEPENDENCE_FALLBACK_MS: () => STAGE_INDEPENDENCE_FALLBACK_MS,
191
+ STAGE_INDEPENDENCE_MODES: () => STAGE_INDEPENDENCE_MODES,
192
+ STAGE_MAX_REVISIONS_LIMIT: () => STAGE_MAX_REVISIONS_LIMIT,
193
+ STAGE_PARKED_PHASES: () => STAGE_PARKED_PHASES,
194
+ STAGE_PHASES: () => STAGE_PHASES,
195
+ STAGE_PIPELINE_CEILING_DEFAULT_MS: () => STAGE_PIPELINE_CEILING_DEFAULT_MS,
196
+ STAGE_ROLES: () => STAGE_ROLES,
197
+ STAGE_SELF_CHECK_MAX_BOUNCES: () => STAGE_SELF_CHECK_MAX_BOUNCES,
120
198
  STATUS_PROBE_ARG_KEY: () => STATUS_PROBE_ARG_KEY,
121
199
  SUSPENSION_MODALS: () => SUSPENSION_MODALS,
122
200
  SUSPENSION_RESOLUTIONS: () => SUSPENSION_RESOLUTIONS,
@@ -142,17 +220,27 @@ __export(index_exports, {
142
220
  VERSION_UPDATE_REASONS: () => VERSION_UPDATE_REASONS,
143
221
  VIEWER_TO_SHARED_SESSION_TYPES: () => VIEWER_TO_SHARED_SESSION_TYPES,
144
222
  WORKER_BRANCH_STATES: () => WORKER_BRANCH_STATES,
223
+ WORKER_COMMITS_MAX: () => WORKER_COMMITS_MAX,
224
+ WORKER_CURRENT_BRANCH_RULE: () => WORKER_CURRENT_BRANCH_RULE,
225
+ WORKER_DECISIONS_NEEDED_MAX: () => WORKER_DECISIONS_NEEDED_MAX,
145
226
  WORKER_PROTOCOL_FOOTER_MARKER: () => WORKER_PROTOCOL_FOOTER_MARKER,
146
227
  WORKER_REPORT_OUTCOMES: () => WORKER_REPORT_OUTCOMES,
228
+ WORKER_REPORT_SUMMARY_MAX_CHARS: () => WORKER_REPORT_SUMMARY_MAX_CHARS,
229
+ WORKER_SHELL_LITERAL_PATHS_RULE: () => WORKER_SHELL_LITERAL_PATHS_RULE,
147
230
  WORKER_TOOLS: () => WORKER_TOOLS,
231
+ aggregateMissionGitState: () => aggregateMissionGitState,
148
232
  appendWorkerProtocolFooter: () => appendWorkerProtocolFooter,
149
233
  argsCarryStatusProbeMarker: () => argsCarryStatusProbeMarker,
150
234
  assessQuotaFreshness: () => assessQuotaFreshness,
235
+ boundEventPayload: () => boundEventPayload,
151
236
  buildSlotProposal: () => buildSlotProposal,
152
237
  canonicalDaemonId: () => canonicalDaemonId,
238
+ changelogMissionMarker: () => changelogMissionMarker,
239
+ classifyChangelogSection: () => classifyChangelogSection,
153
240
  classifySessionStatus: () => classifySessionStatus,
154
241
  compareDashboardWireVersion: () => compareDashboardWireVersion,
155
242
  compareSemver: () => compareSemver,
243
+ computeRelayReprobeDelay: () => computeRelayReprobeDelay,
156
244
  daemonIdsEquivalent: () => daemonIdsEquivalent,
157
245
  decodeActiveWorkQueryRequest: () => decodeActiveWorkQueryRequest,
158
246
  decodeActiveWorkQueryResponse: () => decodeActiveWorkQueryResponse,
@@ -195,6 +283,8 @@ __export(index_exports, {
195
283
  decodeQueueQueryResponse: () => decodeQueueQueryResponse,
196
284
  decodeQueueRequeueRequest: () => decodeQueueRequeueRequest,
197
285
  decodeQueueRequeueResponse: () => decodeQueueRequeueResponse,
286
+ decodeQueueReviseRequest: () => decodeQueueReviseRequest,
287
+ decodeQueueReviseResponse: () => decodeQueueReviseResponse,
198
288
  decodeRecordLocalRequest: () => decodeRecordLocalRequest,
199
289
  decodeRecordLocalResponse: () => decodeRecordLocalResponse,
200
290
  decodeRecoveryContextQueryRequest: () => decodeRecoveryContextQueryRequest,
@@ -214,6 +304,8 @@ __export(index_exports, {
214
304
  decodeUserSessionToDashboard: () => decodeUserSessionToDashboard,
215
305
  decodeViewerToSharedSession: () => decodeViewerToSharedSession,
216
306
  defaultProviderPriorityFromNodeFacts: () => defaultProviderPriorityFromNodeFacts,
307
+ defaultStagePlan: () => defaultStagePlan,
308
+ deriveItemDedupeKey: () => deriveItemDedupeKey,
217
309
  deriveProviderPriorityFromSlots: () => deriveProviderPriorityFromSlots,
218
310
  deriveSlotsFromLegacy: () => deriveSlotsFromLegacy,
219
311
  describeModelSelection: () => describeModelSelection,
@@ -224,13 +316,21 @@ __export(index_exports, {
224
316
  expandDaemonIdForms: () => expandDaemonIdForms,
225
317
  findOwnershipConflicts: () => findOwnershipConflicts,
226
318
  foldKeyedDoc: () => foldKeyedDoc,
319
+ followedRemoteProjectKey: () => followedRemoteProjectKey,
320
+ followerOpPermitted: () => followerOpPermitted,
227
321
  formatQuotaAccount: () => formatQuotaAccount,
322
+ formatStageVerdictLine: () => formatStageVerdictLine,
228
323
  hasGitStatusEvidence: () => hasGitStatusEvidence,
229
324
  hasWorkerProtocolFooter: () => hasWorkerProtocolFooter,
230
325
  interpolateString: () => interpolateString,
326
+ isActionableProviderApproval: () => isActionableProviderApproval,
327
+ isAssistantFollowerAllowedOp: () => isAssistantFollowerAllowedOp,
231
328
  isAssistantTool: () => isAssistantTool,
232
329
  isBlockedStatus: () => isBlockedStatus,
330
+ isBlockingSeverity: () => isBlockingSeverity,
233
331
  isBusyStatus: () => isBusyStatus,
332
+ isCarryOverMissionRecord: () => isCarryOverMissionRecord,
333
+ isCarryOverMissionTitle: () => isCarryOverMissionTitle,
234
334
  isChunkType: () => isChunkType,
235
335
  isCommitStrength: () => isCommitStrength,
236
336
  isDaemonDirectCommandType: () => isDaemonDirectCommandType,
@@ -246,14 +346,21 @@ __export(index_exports, {
246
346
  isDeadStatus: () => isDeadStatus,
247
347
  isDowngrade: () => isDowngrade,
248
348
  isEvidenceIdentifier: () => isEvidenceIdentifier,
349
+ isFindingCategory: () => isFindingCategory,
350
+ isFindingResponseKind: () => isFindingResponseKind,
351
+ isFindingSeverity: () => isFindingSeverity,
249
352
  isFiniteNumber: () => isFiniteNumber,
250
353
  isIdleSessionState: () => isIdleSessionState,
251
354
  isInputEnvelopeWire: () => isInputEnvelopeWire,
355
+ isLaunchDefaultRole: () => isLaunchDefaultRole,
356
+ isLaunchDefaultSource: () => isLaunchDefaultSource,
357
+ isLightWorkerSession: () => isLightWorkerSession,
252
358
  isMeshDeliveryMode: () => isMeshDeliveryMode,
253
359
  isMeshIndexQueryResponse: () => isMeshIndexQueryResponse,
254
360
  isMeshMissionStatusValue: () => isMeshMissionStatusValue,
255
361
  isMeshP2PSignalType: () => isMeshP2PSignalType,
256
362
  isMeshRecordPayload: () => isMeshRecordPayload,
363
+ isMeshReleaseChannel: () => isMeshReleaseChannel,
257
364
  isMeshTaskDifficulty: () => isMeshTaskDifficulty,
258
365
  isMeshTaskMode: () => isMeshTaskMode,
259
366
  isMeshTaskPriority: () => isMeshTaskPriority,
@@ -261,17 +368,24 @@ __export(index_exports, {
261
368
  isMeshTerminalTaskStatus: () => isMeshTerminalTaskStatus,
262
369
  isMeshTopicEntry: () => isMeshTopicEntry,
263
370
  isMessageId: () => isMessageId,
371
+ isMissionOutcome: () => isMissionOutcome,
372
+ isMissionRefContained: () => isMissionRefContained,
264
373
  isMissionUpsertResponse: () => isMissionUpsertResponse,
265
374
  isModelAxisSource: () => isModelAxisSource,
375
+ isNativeMarkerRef: () => isNativeMarkerRef,
266
376
  isNonEmptyString: () => isNonEmptyString,
267
377
  isNotifyKind: () => isNotifyKind,
268
378
  isOutboundMessage: () => isOutboundMessage,
269
379
  isOutboundMessageOrigin: () => isOutboundMessageOrigin,
270
380
  isP2PSignalType: () => isP2PSignalType,
271
381
  isPhantomDaemonEntry: () => isPhantomDaemonEntry,
382
+ isPriorFindingStatus: () => isPriorFindingStatus,
383
+ isProviderQuestionBinding: () => isProviderQuestionBinding,
272
384
  isRawDaemonDoId: () => isRawDaemonDoId,
273
385
  isReadyStatus: () => isReadyStatus,
274
386
  isRecord: () => isRecord,
387
+ isReleaseStatus: () => isReleaseStatus,
388
+ isReviewVerdict: () => isReviewVerdict,
275
389
  isSendPolicy: () => isSendPolicy,
276
390
  isSendPolicyMode: () => isSendPolicyMode,
277
391
  isSendRefusal: () => isSendRefusal,
@@ -280,6 +394,8 @@ __export(index_exports, {
280
394
  isSessionLaunchedBy: () => isSessionLaunchedBy,
281
395
  isSessionStatus: () => isSessionStatus,
282
396
  isSharedSessionToViewerType: () => isSharedSessionToViewerType,
397
+ isStageBlockedReason: () => isStageBlockedReason,
398
+ isStageEligibleTask: () => isStageEligibleTask,
283
399
  isSubmitOutcome: () => isSubmitOutcome,
284
400
  isSummaryRef: () => isSummaryRef,
285
401
  isTerminalSessionRecordStatus: () => isTerminalSessionRecordStatus,
@@ -298,6 +414,7 @@ __export(index_exports, {
298
414
  isWorkingStatus: () => isWorkingStatus,
299
415
  joinRepoPath: () => joinRepoPath,
300
416
  launchModelSelectionValue: () => launchModelSelectionValue,
417
+ lintChangelogText: () => lintChangelogText,
301
418
  machineCoreFromDaemonId: () => machineCoreFromDaemonId,
302
419
  makeTypeGuard: () => makeTypeGuard,
303
420
  measureWorstCaseChunkEnvelopeBytes: () => measureWorstCaseChunkEnvelopeBytes,
@@ -309,41 +426,58 @@ __export(index_exports, {
309
426
  minutesUntilQuotaCheck: () => minutesUntilQuotaCheck,
310
427
  normalizeAuthOkLimits: () => normalizeAuthOkLimits,
311
428
  normalizeBrainSlot: () => normalizeBrainSlot,
429
+ normalizeDecisionInput: () => normalizeDecisionInput,
312
430
  normalizeDifficultyBrainMap: () => normalizeDifficultyBrainMap,
431
+ normalizeForDedupe: () => normalizeForDedupe,
313
432
  normalizeGitStatus: () => normalizeGitStatus,
314
433
  normalizeMeshNodeFacts: () => normalizeMeshNodeFacts,
315
434
  normalizeMeshNodeId: () => normalizeMeshNodeId,
316
435
  normalizeMeshSessionRecord: () => normalizeMeshSessionRecord,
317
436
  normalizeMeshWorkspaceForCompare: () => normalizeMeshWorkspaceForCompare,
318
437
  normalizeMissionBrief: () => normalizeMissionBrief,
438
+ normalizeMissionItemInput: () => normalizeMissionItemInput,
439
+ normalizeMissionItemUpdate: () => normalizeMissionItemUpdate,
440
+ normalizeMissionRefs: () => normalizeMissionRefs,
441
+ normalizeMissionSummary: () => normalizeMissionSummary,
319
442
  normalizeNodeCapabilitySlot: () => normalizeNodeCapabilitySlot,
320
443
  normalizeNodeCapabilitySlots: () => normalizeNodeCapabilitySlots,
444
+ normalizeOutcomeReason: () => normalizeOutcomeReason,
321
445
  normalizeOwnedPaths: () => normalizeOwnedPaths,
446
+ normalizeReportCommits: () => normalizeReportCommits,
322
447
  normalizeSessionStatus: () => normalizeSessionStatus,
323
448
  normalizeThinkingLevel: () => normalizeThinkingLevel,
324
449
  orderProvidersByBuiltinPreference: () => orderProvidersByBuiltinPreference,
325
450
  parseJsonRecord: () => parseJsonRecord,
451
+ parseRoleLaunchSelection: () => parseRoleLaunchSelection,
326
452
  parseSemver: () => parseSemver,
327
453
  parseSessionLaunchRecord: () => parseSessionLaunchRecord,
328
454
  pathsOverlap: () => pathsOverlap,
329
455
  pickBestTransitGitStatus: () => pickBestTransitGitStatus,
330
456
  projectFileDiffRow: () => projectFileDiffRow,
331
457
  projectTurnEvidenceEntry: () => projectTurnEvidenceEntry,
458
+ providerApprovalSnapshot: () => providerApprovalSnapshot,
332
459
  readBoolean: () => readBoolean,
333
460
  readEnvelopeFields: () => readEnvelopeFields,
334
461
  readGitSubmodules: () => readGitSubmodules,
335
462
  readNumber: () => readNumber,
336
463
  readOptionalRecord: () => readOptionalRecord,
464
+ readProviderDecision: () => readProviderDecision,
337
465
  readRecord: () => readRecord,
338
466
  readString: () => readString,
339
467
  readStringArray: () => readStringArray,
340
468
  readText: () => readText,
341
469
  renderCoordinatorWorkerSection: () => renderCoordinatorWorkerSection,
470
+ renderLightWorkspaceRules: () => renderLightWorkspaceRules,
342
471
  renderMissionBriefBlock: () => renderMissionBriefBlock,
472
+ renderStageProtocolLines: () => renderStageProtocolLines,
343
473
  renderWorkerProtocolFooter: () => renderWorkerProtocolFooter,
474
+ resolveStagePlan: () => resolveStagePlan,
344
475
  retiredMeshToolError: () => retiredMeshToolError,
476
+ reviewIndependenceOf: () => reviewIndependenceOf,
477
+ sanitizeDispatchRefusalDetail: () => sanitizeDispatchRefusalDetail,
345
478
  sanitizeModelIdentifier: () => sanitizeModelIdentifier,
346
479
  sanitizeRefusalCode: () => sanitizeRefusalCode,
480
+ sanitizeRemoteRepoIdentity: () => sanitizeRemoteRepoIdentity,
347
481
  scoreGitStatusCandidate: () => scoreGitStatusCandidate,
348
482
  scoreGitUpstreamFreshness: () => scoreGitUpstreamFreshness,
349
483
  sessionIdsEquivalent: () => sessionIdsEquivalent,
@@ -354,6 +488,11 @@ __export(index_exports, {
354
488
  summarizeGitShape: () => summarizeGitShape,
355
489
  supportsQuota: () => supportsQuota,
356
490
  touchedFilesOutsideOwnership: () => touchedFilesOutsideOwnership,
491
+ truncateMissionText: () => truncateMissionText,
492
+ unwrapPastedContent: () => unwrapPastedContent,
493
+ validateFindingResponses: () => validateFindingResponses,
494
+ validateReviewReport: () => validateReviewReport,
495
+ validateTestsRun: () => validateTestsRun,
357
496
  withStatusProbeMarker: () => withStatusProbeMarker
358
497
  });
359
498
  module.exports = __toCommonJS(index_exports);
@@ -554,15 +693,15 @@ function pickBestTransitGitStatus(node, options) {
554
693
  }
555
694
 
556
695
  // src/session-normalize.ts
557
- function deriveSyntheticSessionId(record) {
696
+ function deriveSyntheticSessionId(record2) {
558
697
  const parts = [
559
- readString(record.workspace),
560
- readString(record.providerType, record.provider),
561
- readString(record.role),
562
- readString(record.state, record.status),
563
- readString(record.title),
564
- readString(record.createdAt, record.created_at),
565
- readString(record.startedAt, record.started_at)
698
+ readString(record2.workspace),
699
+ readString(record2.providerType, record2.provider),
700
+ readString(record2.role),
701
+ readString(record2.state, record2.status),
702
+ readString(record2.title),
703
+ readString(record2.createdAt, record2.created_at),
704
+ readString(record2.startedAt, record2.started_at)
566
705
  ].filter((part) => Boolean(part));
567
706
  if (parts.length === 0) return void 0;
568
707
  return `synthetic:${parts.join("|")}`;
@@ -574,33 +713,33 @@ function sessionIdsEquivalent(a, b) {
574
713
  return idA === idB;
575
714
  }
576
715
  function normalizeMeshSessionRecord(entry) {
577
- const record = readRecord(entry);
578
- const sessionId = readString(record.sessionId, record.session_id, record.id) ?? deriveSyntheticSessionId(record);
716
+ const record2 = readRecord(entry);
717
+ const sessionId = readString(record2.sessionId, record2.session_id, record2.id) ?? deriveSyntheticSessionId(record2);
579
718
  if (!sessionId) return null;
580
719
  return {
581
720
  sessionId,
582
- ...readString(record.providerType, record.provider) ? { providerType: readString(record.providerType, record.provider) } : {},
583
- ...readString(record.state, record.status) ? { state: readString(record.state, record.status) } : {},
584
- ...readString(record.chatStatus, record.chat_status) ? { chatStatus: readString(record.chatStatus, record.chat_status) } : {},
585
- ...readString(record.lifecycle) ? { lifecycle: readString(record.lifecycle) } : {},
586
- ...readString(record.surfaceKind, record.surface_kind) ? { surfaceKind: readString(record.surfaceKind, record.surface_kind) } : {},
587
- ...readString(record.recoveryState, record.recovery_state) ? { recoveryState: readString(record.recoveryState, record.recovery_state) } : {},
588
- ...readString(record.workspace) ? { workspace: readString(record.workspace) } : {},
589
- ...readString(record.title) ? { title: readString(record.title) } : {},
590
- ...readString(record.role) ? { role: readString(record.role) } : {},
591
- ...readBoolean(record.isSelfCoordinator, record.is_self_coordinator) !== void 0 ? { isSelfCoordinator: readBoolean(record.isSelfCoordinator, record.is_self_coordinator) } : {},
592
- ...readString(record.statusNote, record.status_note) ? { statusNote: readString(record.statusNote, record.status_note) } : {},
593
- ...readString(record.createdAt, record.created_at) ? { createdAt: readString(record.createdAt, record.created_at) } : {},
594
- ...readString(record.startedAt, record.started_at) ? { startedAt: readString(record.startedAt, record.started_at) } : {},
595
- ...readString(record.lastActivityAt, record.last_activity_at) ? { lastActivityAt: readString(record.lastActivityAt, record.last_activity_at) } : {},
596
- ...readBoolean(record.isCached, record.is_cached) !== void 0 ? { isCached: readBoolean(record.isCached, record.is_cached) } : {}
721
+ ...readString(record2.providerType, record2.provider) ? { providerType: readString(record2.providerType, record2.provider) } : {},
722
+ ...readString(record2.state, record2.status) ? { state: readString(record2.state, record2.status) } : {},
723
+ ...readString(record2.chatStatus, record2.chat_status) ? { chatStatus: readString(record2.chatStatus, record2.chat_status) } : {},
724
+ ...readString(record2.lifecycle) ? { lifecycle: readString(record2.lifecycle) } : {},
725
+ ...readString(record2.surfaceKind, record2.surface_kind) ? { surfaceKind: readString(record2.surfaceKind, record2.surface_kind) } : {},
726
+ ...readString(record2.recoveryState, record2.recovery_state) ? { recoveryState: readString(record2.recoveryState, record2.recovery_state) } : {},
727
+ ...readString(record2.workspace) ? { workspace: readString(record2.workspace) } : {},
728
+ ...readString(record2.title) ? { title: readString(record2.title) } : {},
729
+ ...readString(record2.role) ? { role: readString(record2.role) } : {},
730
+ ...readBoolean(record2.isSelfCoordinator, record2.is_self_coordinator) !== void 0 ? { isSelfCoordinator: readBoolean(record2.isSelfCoordinator, record2.is_self_coordinator) } : {},
731
+ ...readString(record2.statusNote, record2.status_note) ? { statusNote: readString(record2.statusNote, record2.status_note) } : {},
732
+ ...readString(record2.createdAt, record2.created_at) ? { createdAt: readString(record2.createdAt, record2.created_at) } : {},
733
+ ...readString(record2.startedAt, record2.started_at) ? { startedAt: readString(record2.startedAt, record2.started_at) } : {},
734
+ ...readString(record2.lastActivityAt, record2.last_activity_at) ? { lastActivityAt: readString(record2.lastActivityAt, record2.last_activity_at) } : {},
735
+ ...readBoolean(record2.isCached, record2.is_cached) !== void 0 ? { isCached: readBoolean(record2.isCached, record2.is_cached) } : {}
597
736
  };
598
737
  }
599
738
 
600
739
  // src/node-normalize.ts
601
740
  function normalizeMeshNodeId(node) {
602
- const record = node && typeof node === "object" ? node : {};
603
- return readString(record.id, record.nodeId, record.node_id);
741
+ const record2 = node && typeof node === "object" ? node : {};
742
+ return readString(record2.id, record2.nodeId, record2.node_id);
604
743
  }
605
744
  function meshNodeIdMatches(node, candidateId) {
606
745
  if (!candidateId) return false;
@@ -612,12 +751,12 @@ function meshNodeIdMatches(node, candidateId) {
612
751
  // src/node-facts.ts
613
752
  function normalizeMeshNodeFacts(raw) {
614
753
  if (!raw || typeof raw !== "object" || Array.isArray(raw)) return void 0;
615
- const record = raw;
616
- const schemaVersion = Number(record.schemaVersion);
617
- const reportedAt = Number(record.reportedAt);
754
+ const record2 = raw;
755
+ const schemaVersion = Number(record2.schemaVersion);
756
+ const reportedAt = Number(record2.reportedAt);
618
757
  if (!Number.isFinite(schemaVersion) || schemaVersion < 1) return void 0;
619
758
  if (!Number.isFinite(reportedAt) || reportedAt <= 0) return void 0;
620
- return { ...record, schemaVersion, reportedAt };
759
+ return { ...record2, schemaVersion, reportedAt };
621
760
  }
622
761
  var QUOTA_SUPPORTED_PROVIDERS = [
623
762
  "antigravity-cli",
@@ -667,7 +806,7 @@ function hasUsableWindow(window) {
667
806
  return !!window && typeof window.usedPercent === "number" && Number.isFinite(window.usedPercent);
668
807
  }
669
808
  function hasReading(quota) {
670
- if (hasUsableWindow(quota.session) || hasUsableWindow(quota.weekly)) return true;
809
+ if (hasUsableWindow(quota.session) || hasUsableWindow(quota.weekly) || hasUsableWindow(quota.monthly)) return true;
671
810
  return Array.isArray(quota.buckets) && quota.buckets.some((b) => !!b && typeof b.usedPercent === "number" && Number.isFinite(b.usedPercent));
672
811
  }
673
812
  function finiteMs(value) {
@@ -685,9 +824,17 @@ function backfillCheckAt(quota, now) {
685
824
  function assessQuotaFreshness(quota, now = Date.now()) {
686
825
  const meta = quota.metadata;
687
826
  const kind = meta?.failureKind;
688
- const userMustAct = kind === "no-data" && quota.provider !== "codex-cli" || kind === "expired-token" && quota.provider === "antigravity-cli";
689
- if (userMustAct && hasReading(quota)) return { cue: "stale", userMustAct: true };
690
- if (meta?.lastGoodWindows !== true) return { userMustAct };
827
+ const userMustAct = kind === "no-data" && quota.provider !== "codex-cli";
828
+ const awaitsCliUse = kind === "expired-token" && ["grok-cli", "kimi", "antigravity-cli"].includes(quota.provider);
829
+ if (userMustAct) return hasReading(quota) ? { cue: "stale", userMustAct: true } : { userMustAct: true };
830
+ if (awaitsCliUse) return hasReading(quota) ? { cue: "stale", userMustAct: false } : { userMustAct: false };
831
+ if (meta?.lastGoodWindows !== true) {
832
+ const measuredAt = finiteMs(quota.updatedAt);
833
+ if (hasReading(quota) && (measuredAt === void 0 || now - measuredAt >= QUOTA_BACKFILL_HORIZON_MS)) {
834
+ return { cue: "stale", userMustAct };
835
+ }
836
+ return { userMustAct };
837
+ }
691
838
  const retryAtMs = finiteMs(meta?.retryAtMs);
692
839
  const retryStopped = meta?.retryExhausted === true || retryAtMs !== void 0 && retryAtMs + QUOTA_RETRY_INFLIGHT_GRACE_MS < now;
693
840
  if (kind !== "no-data" && !retryStopped) return { cue: "refreshing", userMustAct: false };
@@ -727,19 +874,21 @@ function isPhantomDaemonEntry(entry) {
727
874
  function machineCoreFromDaemonId(id2) {
728
875
  const trimmed = readString(id2);
729
876
  if (!trimmed) return void 0;
877
+ const lower = trimmed.toLowerCase();
730
878
  for (const prefix of DAEMON_ID_PREFIXES) {
731
- if (trimmed.startsWith(prefix)) {
879
+ if (lower.startsWith(prefix)) {
732
880
  const core = trimmed.slice(prefix.length).trim();
733
- return core || void 0;
881
+ if (!core) return void 0;
882
+ return /^mach_/i.test(core) ? `mach_${core.slice(5)}` : core;
734
883
  }
735
884
  }
736
- return trimmed;
885
+ return /^mach_/i.test(trimmed) ? `mach_${trimmed.slice(5)}` : trimmed;
737
886
  }
738
887
  function canonicalDaemonId(id2) {
739
888
  const core = machineCoreFromDaemonId(id2);
740
889
  if (!core) return void 0;
741
- if (!core.startsWith("mach_")) return core;
742
- return `daemon_${core}`;
890
+ if (!/^mach_/i.test(core)) return core;
891
+ return `daemon_mach_${core.slice(5)}`;
743
892
  }
744
893
  function daemonIdsEquivalent(a, b) {
745
894
  const coreA = machineCoreFromDaemonId(a);
@@ -768,9 +917,9 @@ function expandDaemonIdForms(ids) {
768
917
 
769
918
  // src/git-summarize.ts
770
919
  function summarizeGitShape(status) {
771
- const record = readRecord(status);
772
- if (!Object.keys(record).length) return null;
773
- const submodules = Array.isArray(record.submodules) ? record.submodules.map((entry) => {
920
+ const record2 = readRecord(status);
921
+ if (!Object.keys(record2).length) return null;
922
+ const submodules = Array.isArray(record2.submodules) ? record2.submodules.map((entry) => {
774
923
  const sub = readRecord(entry);
775
924
  return {
776
925
  path: readString(sub.path) ?? null,
@@ -780,23 +929,23 @@ function summarizeGitShape(status) {
780
929
  };
781
930
  }) : [];
782
931
  return {
783
- isGitRepo: readBoolean(record.isGitRepo),
784
- workspace: readString(record.workspace) ?? null,
785
- repoRoot: readString(record.repoRoot, record.repo_root) ?? null,
786
- branch: readString(record.branch) ?? null,
787
- upstream: readString(record.upstream) ?? null,
788
- upstreamStatus: readString(record.upstreamStatus, record.upstream_status) ?? null,
789
- headCommit: readString(record.headCommit, record.head_commit)?.slice(0, 12) ?? null,
790
- ahead: readNumber(record.ahead) ?? null,
791
- behind: readNumber(record.behind) ?? null,
932
+ isGitRepo: readBoolean(record2.isGitRepo),
933
+ workspace: readString(record2.workspace) ?? null,
934
+ repoRoot: readString(record2.repoRoot, record2.repo_root) ?? null,
935
+ branch: readString(record2.branch) ?? null,
936
+ upstream: readString(record2.upstream) ?? null,
937
+ upstreamStatus: readString(record2.upstreamStatus, record2.upstream_status) ?? null,
938
+ headCommit: readString(record2.headCommit, record2.head_commit)?.slice(0, 12) ?? null,
939
+ ahead: readNumber(record2.ahead) ?? null,
940
+ behind: readNumber(record2.behind) ?? null,
792
941
  dirtyCounts: {
793
- staged: readNumber(record.staged) ?? 0,
794
- modified: readNumber(record.modified) ?? 0,
795
- untracked: readNumber(record.untracked) ?? 0,
796
- deleted: readNumber(record.deleted) ?? 0,
797
- renamed: readNumber(record.renamed) ?? 0
942
+ staged: readNumber(record2.staged) ?? 0,
943
+ modified: readNumber(record2.modified) ?? 0,
944
+ untracked: readNumber(record2.untracked) ?? 0,
945
+ deleted: readNumber(record2.deleted) ?? 0,
946
+ renamed: readNumber(record2.renamed) ?? 0
798
947
  },
799
- lastCheckedAt: readNumber(record.lastCheckedAt, record.last_checked_at) ?? null,
948
+ lastCheckedAt: readNumber(record2.lastCheckedAt, record2.last_checked_at) ?? null,
800
949
  submoduleCount: submodules.length,
801
950
  submodules
802
951
  };
@@ -962,10 +1111,25 @@ var CLI_SLOT_RECIPES = Object.freeze({
962
1111
  ],
963
1112
  "antigravity-cli": [
964
1113
  {
965
- model: "Gemini 3.1 Pro (High)",
1114
+ model: "Gemini 3.8 Flash (High)",
1115
+ modelCandidates: ["Gemini 3.8 Flash (High)", "Gemini 4 Argon (Low)", "Gemini 3.7 Flash (High)", "Gemini 3.1 Pro (High)"],
966
1116
  difficulty: ["easy"],
967
1117
  maxParallel: 2,
968
1118
  rationale: "Cheap capacity for easy tasks."
1119
+ },
1120
+ {
1121
+ model: "Gemini 4 Argon (Medium)",
1122
+ modelCandidates: ["Gemini 4 Argon (Medium)", "Gemini 3.8 Flash (High)", "Gemini 3.7 Flash (High)", "Gemini 3.1 Pro (High)"],
1123
+ difficulty: ["medium"],
1124
+ maxParallel: 2,
1125
+ rationale: "Balanced Argon tier for medium tasks."
1126
+ },
1127
+ {
1128
+ model: "Gemini 4 Argon (High)",
1129
+ modelCandidates: ["Gemini 4 Argon (High)", "Gemini 3.8 Flash (High)", "Gemini 3.1 Pro (High)"],
1130
+ difficulty: ["difficult"],
1131
+ maxParallel: 1,
1132
+ rationale: "Reserved for hard tasks; capped at 1 to bound cost."
969
1133
  }
970
1134
  ],
971
1135
  "cursor-cli": [
@@ -1004,6 +1168,24 @@ function dedupeDetected(detected) {
1004
1168
  }
1005
1169
  return out;
1006
1170
  }
1171
+ function resolveRecipeModel(recipe, modelOptions) {
1172
+ if (!Array.isArray(modelOptions) || modelOptions.length === 0) {
1173
+ return recipe.model;
1174
+ }
1175
+ const available = new Set(
1176
+ modelOptions.filter((m) => typeof m === "string" && m.trim().length > 0).map((m) => m.trim())
1177
+ );
1178
+ if (available.size === 0) return recipe.model;
1179
+ const candidates = [
1180
+ ...recipe.model ? [recipe.model] : [],
1181
+ ...recipe.modelCandidates ?? []
1182
+ ];
1183
+ for (const candidate of candidates) {
1184
+ const trimmed = typeof candidate === "string" ? candidate.trim() : "";
1185
+ if (trimmed && available.has(trimmed)) return trimmed;
1186
+ }
1187
+ return recipe.model;
1188
+ }
1007
1189
  function buildSlotProposal(detected, currentSlots = []) {
1008
1190
  const providers = dedupeDetected(detected ?? []);
1009
1191
  const proposedSlots = [];
@@ -1019,7 +1201,7 @@ function buildSlotProposal(detected, currentSlots = []) {
1019
1201
  for (const recipe of recipes) {
1020
1202
  const slot = normalizeNodeCapabilitySlot({
1021
1203
  provider: provider.type,
1022
- model: recipe.model,
1204
+ model: resolveRecipeModel(recipe, provider.modelOptions),
1023
1205
  thinkingLevel: recipe.thinkingLevel,
1024
1206
  difficulty: recipe.difficulty,
1025
1207
  maxParallel: recipe.maxParallel
@@ -1072,7 +1254,12 @@ var CANONICAL_MESH_TOOL_NAMES = [
1072
1254
  "mesh_enqueue_task",
1073
1255
  "mesh_view_queue",
1074
1256
  "mesh_queue_cancel",
1257
+ "mesh_task_stage_decide",
1258
+ "mesh_direct_cancel",
1075
1259
  "mesh_queue_requeue",
1260
+ "mesh_queue_revise",
1261
+ "mesh_light_land",
1262
+ "mesh_light_discard",
1076
1263
  "mesh_send_task",
1077
1264
  "mesh_read_chat",
1078
1265
  "mesh_read_debug",
@@ -1089,8 +1276,13 @@ var CANONICAL_MESH_TOOL_NAMES = [
1089
1276
  "mesh_list_pending_approvals",
1090
1277
  "mesh_create",
1091
1278
  "mesh_add_node",
1279
+ "mesh_reattach_source_parent",
1280
+ "mesh_attach_remote",
1281
+ "mesh_host_pairing",
1092
1282
  "mesh_clone_node",
1093
1283
  "mesh_remove_node",
1284
+ "mesh_retry_node_bootstrap",
1285
+ "mesh_recover_node_identity",
1094
1286
  "mesh_cleanup_worktree_nodes",
1095
1287
  "mesh_refine_node",
1096
1288
  "mesh_refine_batch",
@@ -1107,8 +1299,20 @@ var CANONICAL_MESH_TOOL_NAMES = [
1107
1299
  "mesh_reconcile_ledger",
1108
1300
  "mesh_mission_upsert",
1109
1301
  "mesh_mission_list",
1302
+ "mesh_mission_git_eval",
1303
+ "mesh_release_upsert",
1304
+ "mesh_release_scope",
1305
+ "mesh_release_list",
1306
+ "mesh_release_record_deploy",
1307
+ "mesh_release_changelog_draft",
1308
+ "mesh_file_transfer",
1110
1309
  "mesh_review_inbox",
1111
- "mesh_node_slots"
1310
+ "mesh_node_slots",
1311
+ "driver_list",
1312
+ "driver_describe",
1313
+ "artifact_list",
1314
+ "artifact_read",
1315
+ "artifact_register"
1112
1316
  ];
1113
1317
  var CANONICAL_MESH_TOOL_COUNT = CANONICAL_MESH_TOOL_NAMES.length;
1114
1318
  var RETIRED_MESH_TOOLS = {
@@ -1418,9 +1622,15 @@ var DAEMON_STATUS_EVENT_NAMES = [
1418
1622
  "agent:waiting_choice",
1419
1623
  "agent:generating_completed",
1420
1624
  "agent:stopped",
1421
- "monitor:no_progress"
1625
+ "monitor:no_progress",
1626
+ // An owner decision (structured missions) needs the owner. Server-bound for the push only;
1627
+ // the dashboard learns about decisions over P2P (`mission_decisions_list`).
1628
+ "agent:decision_needed"
1422
1629
  ];
1423
1630
  var isDaemonStatusEventName = makeTypeGuard(DAEMON_STATUS_EVENT_NAMES);
1631
+ var DECISION_PUSH_QUESTION_MAX = 80;
1632
+ var DECISION_PUSH_OPTION_LABEL_MAX = 24;
1633
+ var DECISION_PUSH_OPTIONS_MAX = 3;
1424
1634
  var RELEASE_CHANNELS = ["stable", "preview"];
1425
1635
  var NPM_UPDATE_TAGS = ["latest", "next"];
1426
1636
  var VERSION_UPDATE_REASONS = ["force_update_below", "major_minor_mismatch", "patch_mismatch", "daemon_ahead"];
@@ -1783,21 +1993,22 @@ function isTerminalSessionRecordStatus(raw) {
1783
1993
  return typeof raw === "string" && TERMINAL_SESSION_RECORD_STATUSES.includes(raw.trim().toLowerCase());
1784
1994
  }
1785
1995
  function isIdleSessionState(state) {
1786
- const record = state && typeof state === "object" ? state : {};
1787
- const status = typeof record.status === "string" ? record.status.trim().toLowerCase() : "";
1996
+ const record2 = state && typeof state === "object" ? state : {};
1997
+ const status = typeof record2.status === "string" ? record2.status.trim().toLowerCase() : "";
1788
1998
  if (isTerminalSessionRecordStatus(status) || isDeadStatus(status)) return false;
1789
- return isReadyStatus(status) || record.activeChat?.status === "waiting_input";
1999
+ return isReadyStatus(status) || record2.activeChat?.status === "waiting_input";
1790
2000
  }
1791
2001
 
1792
2002
  // src/mesh-vocabulary.ts
1793
- var MESH_TASK_STATUSES = ["pending", "assigned", "completed", "failed", "cancelled"];
1794
- var MESH_TERMINAL_TASK_STATUSES = ["completed", "failed", "cancelled"];
2003
+ var MESH_TASK_STATUSES = ["pending", "assigned", "completed", "blocked", "failed", "cancelled"];
2004
+ var MESH_TERMINAL_TASK_STATUSES = ["completed", "blocked", "failed", "cancelled"];
1795
2005
  var MESH_TASK_MODES = ["code_change", "validation", "live_debug_readonly", "launch_app", "convergence"];
1796
2006
  var MESH_TASK_PRIORITIES = ["low", "normal", "high"];
1797
2007
  var MESH_THINKING_LEVELS = ["low", "medium", "high"];
1798
2008
  var MESH_DELIVERY_MODES = ["when_idle", "interrupt"];
1799
2009
  var MESH_SESSION_CLEANUP_MODES = ["preserve", "stop", "delete_stopped", "stop_and_delete"];
1800
2010
  var WORKER_REPORT_OUTCOMES = ["completed", "blocked", "failed"];
2011
+ var WORKER_REPORT_SUMMARY_MAX_CHARS = 8e3;
1801
2012
  var WORKER_BRANCH_STATES = [
1802
2013
  "merged_to_main",
1803
2014
  "pushed_feature_branch_needs_merge",
@@ -1864,6 +2075,7 @@ var SEND_REFUSAL_REASONS = [
1864
2075
  "no_target",
1865
2076
  "bootstrap_pending",
1866
2077
  "duplicate_dispatch",
2078
+ "new_work_held",
1867
2079
  "internal_error"
1868
2080
  ];
1869
2081
  function isSendRefusal(value) {
@@ -1895,6 +2107,14 @@ function isOutboundMessage(value) {
1895
2107
  const candidate = value;
1896
2108
  return isMessageId(candidate.messageId) && typeof candidate.sessionId === "string" && candidate.sessionId.length > 0 && isInputEnvelopeWire(candidate.input) && isOutboundMessageOrigin(candidate.origin) && isSendPolicy(candidate.policy) && typeof candidate.createdAt === "number";
1897
2109
  }
2110
+ var PASTED_OPEN_RE = /^\s*<pasted_content(?:\s+id="[^"]*")?\s*>\s*$/;
2111
+ var PASTED_CLOSE_RE = /^\s*<\/pasted_content(?:\s+id="[^"]*")?\s*>\s*$/;
2112
+ function unwrapPastedContent(text) {
2113
+ const lines = text.replace(/\r\n?/g, "\n").split("\n");
2114
+ const first = lines.findIndex((line) => line.trim());
2115
+ if (first < 0 || !PASTED_OPEN_RE.test(lines[first])) return text;
2116
+ return lines.filter((line) => !PASTED_OPEN_RE.test(line) && !PASTED_CLOSE_RE.test(line)).join("\n");
2117
+ }
1898
2118
 
1899
2119
  // src/mission-brief.ts
1900
2120
  var GOAL_MAX = 500;
@@ -1980,13 +2200,39 @@ var WORKER_TOOLS = [
1980
2200
  "peer_context_pull",
1981
2201
  "git_status",
1982
2202
  "git_log",
1983
- "git_diff"
2203
+ "git_diff",
2204
+ "driver_list",
2205
+ "driver_describe",
2206
+ "driver_invoke",
2207
+ "driver_scaffold",
2208
+ "driver_validate",
2209
+ "driver_export",
2210
+ "driver_install",
2211
+ "artifact_register",
2212
+ "artifact_list",
2213
+ "artifact_read",
2214
+ // Contract versioning (Cut A): exact pinned-unit reads (E2), the explicit
2215
+ // read claim (C1) and the authoritative head/notice pull.
2216
+ "contract_read",
2217
+ "contract_observe",
2218
+ "contract_current"
1984
2219
  ];
1985
2220
  var WORKER_TOOL_SET = new Set(WORKER_TOOLS);
1986
2221
  function isWorkerTool(value) {
1987
2222
  return typeof value === "string" && WORKER_TOOL_SET.has(value);
1988
2223
  }
1989
2224
  var WORKER_PROTOCOL_FOOTER_MARKER = "--- adhdev worker protocol ---";
2225
+ function renderLightWorkspaceRules(light) {
2226
+ const base = light.ossBaseSha ? `${light.baseSha} (oss ${light.ossBaseSha})` : light.baseSha;
2227
+ return [
2228
+ `You are working in a temporary light workspace at \`${light.workspace}\` based on \`${base}\`. Work only inside it. Commit your change there (the branch is already set up); do not push.`,
2229
+ "Do not run `npm install`/`npm ci`/`npm rebuild`/`node-gyp`, do not change package.json or lockfiles \u2014 if the fix needs a dependency change, stop and report `blocked`.",
2230
+ "Do not start long-running servers on fixed ports. Run the narrowest tests that cover your change and list them in `report_completion.testsRun`.",
2231
+ light.ownedPaths.length ? `Stay inside \`owned_paths\` (${light.ownedPaths.join(", ")}); if you must touch more, say why in the summary.` : "Stay inside the paths the task names; if you must touch more, say why in the summary."
2232
+ ];
2233
+ }
2234
+ var WORKER_CURRENT_BRANCH_RULE = "Commit your change on the branch that is currently checked out in this workspace. Do not create or switch branches (no `git checkout -b` / `git switch`) unless the task explicitly says to; report the branch you committed on.";
2235
+ var WORKER_SHELL_LITERAL_PATHS_RULE = "In shell commands, write file and directory paths literally (absolute, or relative to your workspace) instead of through shell variables (`N=dir; cat $N/x`) or `$(...)` substitutions, and keep to one simple command per call, so the command can be checked before it runs. This does not change what you are allowed to run or read.";
1990
2236
  function hasWorkerProtocolFooter(body) {
1991
2237
  return typeof body === "string" && body.includes(WORKER_PROTOCOL_FOOTER_MARKER);
1992
2238
  }
@@ -2008,6 +2254,9 @@ function renderWorkerProtocolFooter(input = {}) {
2008
2254
  if (input.readonly) scope.push("read-only");
2009
2255
  if (scope.length) lines.push(`You are a delegated worker (${scope.join(", ")}).`);
2010
2256
  else lines.push("You are a delegated worker.");
2257
+ if (input.light) lines.push(...renderLightWorkspaceRules(input.light));
2258
+ else if (input.commitOnCurrentBranch && input.stage?.role !== "review") lines.push(WORKER_CURRENT_BRANCH_RULE);
2259
+ lines.push(WORKER_SHELL_LITERAL_PATHS_RULE);
2011
2260
  if (input.workerMcp === false) {
2012
2261
  lines.push(
2013
2262
  "This session has NO adhdev worker tools (`report_completion`, `progress_update`, `peer_context_pull`, `git_*`) \u2014 do not look for them. When your work is finished, blocked, or has failed, end your turn with a plain final summary: what you did, what you found, which files you changed, and where you left the branch. That final message is what the coordinator receives.",
@@ -2027,15 +2276,30 @@ function renderWorkerProtocolFooter(input = {}) {
2027
2276
  "Memos from the coordinator arrive appended to the response of whichever worker tool you call next; read them and follow them.",
2028
2277
  "You have no coordinator tools (no `mesh_*`) by design: do not enqueue, dispatch, or restart anything. If you need a decision from the coordinator, finish with `report_completion` and outcome `blocked`, listing what you need in `blockers`.",
2029
2278
  "On a code-changing task, `report_completion` with outcome `completed` requires `touched_files` \u2014 send `[]` if you changed nothing, omitting the field is what gets refused. `blocked`/`failed` never need it, and a read-only task should omit it or send `[]`.",
2030
- "If `report_completion` is refused, the response carries `validationErrors` (or a `hint`) naming exactly what to fix \u2014 correct that field and call it again; a refusal records nothing."
2279
+ "If `report_completion` is refused, the response carries `validationErrors` (or a `hint`) naming exactly what to fix \u2014 correct that field and call it again; a refusal records nothing.",
2280
+ "Put substantial findings (a diagnosis, evidence, repro steps, review findings) in a workspace file and register it with `artifact_register`, then cite the returned ids in `report_completion` `artifact_ids`. The next task in this mission inherits them as input artifacts instead of re-investigating \u2014 keep each artifact self-contained and factual.",
2281
+ "`driver_invoke` results that carry an image or a large body arrive already registered: take `artifacts[].artifactId` from the result and cite it in `artifact_ids` \u2014 do not paste the body."
2031
2282
  );
2032
2283
  if (input.enclosedHandoffNotes && input.enclosedHandoffNotes > 0) {
2033
2284
  lines.push(
2034
2285
  `The ${input.enclosedHandoffNotes} handoff note(s) above were written by agents who touched this code before you; honour their conflict guidance and add your own in \`handoff_notes\` when you report.`
2035
2286
  );
2036
2287
  }
2288
+ if (input.stage) lines.push(...renderStageProtocolLines(input.stage));
2037
2289
  return lines.join("\n");
2038
2290
  }
2291
+ function renderStageProtocolLines(stage) {
2292
+ if (stage.role === "review") {
2293
+ return [
2294
+ `STAGE: you are the independent reviewer (round ${stage.round} of at most ${stage.maxRevisions + 1}). Read the input artifacts first (diff, self-check log, previous verdict).` + (stage.workspace ? ` Your workspace ${stage.workspace} is pinned to the round head \u2014 you may run tests, but nothing you change lands; do not fix, record findings instead.` : " Do not modify the workspace: read it, and record findings instead of fixing.") + " Do not write any file for the review, not even a report: a new or changed file in the reviewed checkout fails the review as reviewer_mutated_source, and `artifact_register` refuses files outside the workspace. Put every finding in the `review` field of `report_completion` \u2014 that is the review record.",
2295
+ "Your `report_completion` MUST carry `review`: {verdict: approve | approve_with_nits | changes_requested | reject_approach, findings[{id, severity, category, claim, evidence, suggested_fix?}], checked[], not_checked[], tests_run?[]}. `changes_requested` needs at least one blocking/major finding; `approve` allows none. From round 2 also give `prior_findings[{id, status}]` for every earlier blocking/major finding. `reject_approach` is only for a wrong approach, not for fixable defects."
2296
+ ];
2297
+ }
2298
+ return [
2299
+ `STAGE: your \`report_completion\` is a stage report (${stage.role}, round ${stage.round}). An independent reviewer reads your diff next, so commit your work and leave the workspace clean before you report. When your change is committed, report outcome \`completed\` \u2014 the review starts only after that report, so never report \`blocked\` because the review has not run yet. You may receive review findings as a follow-up memo in this same session.`,
2300
+ ...stage.role === "revise" ? ["For every open blocking/major finding in the memo, fill `finding_responses[{id, response: fixed | disputed, note}]` \u2014 `disputed` needs your reasoning; the reviewer judges it next round."] : []
2301
+ ];
2302
+ }
2039
2303
  function stripWorkerProtocolFooter(body) {
2040
2304
  if (typeof body !== "string") return body;
2041
2305
  const at = body.indexOf(WORKER_PROTOCOL_FOOTER_MARKER);
@@ -2065,15 +2329,30 @@ function renderCoordinatorWorkerSection() {
2065
2329
  // src/assistant-protocol.ts
2066
2330
  var ASSISTANT_TOOLS = [
2067
2331
  "projects",
2332
+ "environment",
2333
+ "assistant_action",
2334
+ "project_watch",
2068
2335
  "project_status",
2069
2336
  "project_send",
2070
2337
  "project_read",
2071
2338
  "project_add",
2339
+ "project_attach_remote",
2072
2340
  "discover_repos",
2073
2341
  "memory",
2342
+ "memory_search",
2074
2343
  "skill_view",
2075
2344
  "skill_manage",
2076
- "project_note"
2345
+ "project_note",
2346
+ "launch_defaults",
2347
+ "launch_defaults_set",
2348
+ "driver_list",
2349
+ "driver_describe",
2350
+ "artifact_list",
2351
+ "artifact_read",
2352
+ "decision_answer",
2353
+ "decision_request",
2354
+ "session_control",
2355
+ "file_transfer"
2077
2356
  ];
2078
2357
  var ASSISTANT_TOOL_SET = new Set(ASSISTANT_TOOLS);
2079
2358
  function isAssistantTool(value) {
@@ -2081,50 +2360,170 @@ function isAssistantTool(value) {
2081
2360
  }
2082
2361
  var ASSISTANT_VERB = {
2083
2362
  // tool verbs
2363
+ driverList: "driver_list",
2364
+ driverDescribe: "driver_describe",
2084
2365
  projects: "assistant_projects",
2366
+ environment: "assistant_environment",
2367
+ action: "assistant_action",
2368
+ watch: "assistant_project_watch",
2369
+ executionState: "assistant_execution_state",
2370
+ executionSettings: "assistant_execution_settings",
2085
2371
  projectStatus: "assistant_project_status",
2086
2372
  projectSend: "assistant_project_send",
2087
2373
  projectRead: "assistant_project_read",
2088
2374
  projectAdd: "assistant_project_add",
2375
+ projectAttachRemote: "assistant_project_attach_remote",
2089
2376
  discoverRepos: "assistant_discover_repos",
2090
2377
  memory: "assistant_memory",
2378
+ /** Pull-only FTS search over the archive tier (memory design 2026-11-01 §3.4). */
2379
+ memorySearch: "assistant_memory_search",
2091
2380
  skillView: "assistant_skill_view",
2092
2381
  skillManage: "assistant_skill_manage",
2093
2382
  projectNote: "assistant_project_note",
2383
+ launchDefaults: "assistant_launch_defaults",
2384
+ launchDefaultsSet: "assistant_launch_defaults_set",
2385
+ artifactList: "assistant_artifact_list",
2386
+ artifactRead: "assistant_artifact_read",
2387
+ /** Owner-decision inbox (structured-missions design 2026-10-28 §6.3): the owner's words recorded as answers. */
2388
+ decisionAnswer: "assistant_decision_answer",
2389
+ /** Register a plain-text question a coordinator put to the owner as a decision item (§5.2). */
2390
+ decisionRequest: "assistant_decision_request",
2391
+ /** Stop / restart / switch the provider of a coordinator, worker or the assistant session (handoff design 2026-11-01 §4). */
2392
+ sessionControl: "assistant_session_control",
2393
+ /** Request / status / cancel the assistant's own project file transfers (owner approves in the dashboard; file-transfer design section 6). */
2394
+ fileTransfer: "assistant_file_transfer",
2094
2395
  // assistant-side daemon verbs without a tool of the same name
2095
2396
  launch: "launch_assistant",
2096
2397
  pendingRelays: "assistant_pending_relays",
2097
2398
  // owner verbs (dashboard only)
2098
2399
  stagedResolve: "assistant_staged_resolve",
2099
2400
  storeAdmin: "assistant_store_admin",
2100
- importSkills: "assistant_import_skills"
2401
+ importSkills: "assistant_import_skills",
2402
+ /** Owner skill list (attach/view counts, save proposals, recent skill metrics); reads move no counter. */
2403
+ skillsList: "assistant_skills_list",
2404
+ /** Owner: what the assistant remembered recently, with undo handles (memory design §3.2). */
2405
+ memoryDigest: "assistant_memory_digest",
2406
+ /** Owner: reverse one remembered write or one batch (memory design §3.2). Never an assistant tool. */
2407
+ memoryUndo: "assistant_memory_undo",
2408
+ /** Projects the assistant is following (open relay threads) — list / stop following. */
2409
+ threads: "assistant_threads",
2410
+ threadClose: "assistant_thread_close"
2101
2411
  };
2102
2412
  var ASSISTANT_TOOL_VERBS = {
2413
+ driver_list: ASSISTANT_VERB.driverList,
2414
+ driver_describe: ASSISTANT_VERB.driverDescribe,
2103
2415
  projects: ASSISTANT_VERB.projects,
2416
+ environment: ASSISTANT_VERB.environment,
2417
+ assistant_action: ASSISTANT_VERB.action,
2418
+ project_watch: ASSISTANT_VERB.watch,
2104
2419
  project_status: ASSISTANT_VERB.projectStatus,
2105
2420
  project_send: ASSISTANT_VERB.projectSend,
2106
2421
  project_read: ASSISTANT_VERB.projectRead,
2107
2422
  project_add: ASSISTANT_VERB.projectAdd,
2423
+ project_attach_remote: ASSISTANT_VERB.projectAttachRemote,
2108
2424
  discover_repos: ASSISTANT_VERB.discoverRepos,
2109
2425
  memory: ASSISTANT_VERB.memory,
2426
+ memory_search: ASSISTANT_VERB.memorySearch,
2110
2427
  skill_view: ASSISTANT_VERB.skillView,
2111
2428
  skill_manage: ASSISTANT_VERB.skillManage,
2112
- project_note: ASSISTANT_VERB.projectNote
2429
+ project_note: ASSISTANT_VERB.projectNote,
2430
+ launch_defaults: ASSISTANT_VERB.launchDefaults,
2431
+ launch_defaults_set: ASSISTANT_VERB.launchDefaultsSet,
2432
+ artifact_list: ASSISTANT_VERB.artifactList,
2433
+ artifact_read: ASSISTANT_VERB.artifactRead,
2434
+ decision_answer: ASSISTANT_VERB.decisionAnswer,
2435
+ decision_request: ASSISTANT_VERB.decisionRequest,
2436
+ session_control: ASSISTANT_VERB.sessionControl,
2437
+ file_transfer: ASSISTANT_VERB.fileTransfer
2113
2438
  };
2114
- var ASSISTANT_WRITE_TOOLS = ["memory", "skill_manage", "project_note", "project_send", "project_add"];
2439
+ var ASSISTANT_WRITE_TOOLS = ["project_watch", "assistant_action", "memory", "skill_manage", "project_note", "project_send", "project_add", "project_attach_remote", "launch_defaults_set", "decision_answer", "decision_request", "session_control", "file_transfer"];
2115
2440
  var ASSISTANT_OWNER_VERBS = [
2441
+ ASSISTANT_VERB.executionSettings,
2116
2442
  ASSISTANT_VERB.stagedResolve,
2117
2443
  ASSISTANT_VERB.storeAdmin,
2118
- ASSISTANT_VERB.importSkills
2444
+ ASSISTANT_VERB.importSkills,
2445
+ ASSISTANT_VERB.skillsList,
2446
+ ASSISTANT_VERB.memoryDigest,
2447
+ ASSISTANT_VERB.memoryUndo,
2448
+ ASSISTANT_VERB.threadClose
2119
2449
  ];
2120
2450
  var ASSISTANT_REVIEW_TURN_VERBS = [
2121
2451
  ASSISTANT_VERB.memory,
2452
+ ASSISTANT_VERB.memorySearch,
2122
2453
  ASSISTANT_VERB.skillView,
2123
2454
  ASSISTANT_VERB.skillManage,
2124
2455
  ASSISTANT_VERB.projectNote
2125
2456
  ];
2126
2457
  var ASSISTANT_SESSION_ID_ENV = "ADHDEV_ASSISTANT_SESSION_ID";
2127
2458
  var ASSISTANT_SESSION_ID_ARG = "assistantSessionId";
2459
+ var ASSISTANT_ACCOUNT_SLOT = "personal";
2460
+ var ASSISTANT_REMOTE_PROJECT_COMMAND = "assistant_remote_project";
2461
+ var ASSISTANT_REMOTE_PROJECT_CATALOG_COMMAND = "assistant_remote_project_catalog";
2462
+ var ASSISTANT_REMOTE_PROJECT_ACCESS_COMMAND = "assistant_remote_project_access";
2463
+ var ASSISTANT_REMOTE_FOLLOW_COMMAND = "assistant_remote_follow";
2464
+ var ASSISTANT_FOLLOWER_ALLOWED_OPS = ["status", "read", "poll", "report", "send", "artifact_list", "artifact_read", "decision_list", "decision_answer", "decision_request"];
2465
+ var ASSISTANT_FOLLOWER_ALLOWED_OP_SET = new Set(ASSISTANT_FOLLOWER_ALLOWED_OPS);
2466
+ function isAssistantFollowerAllowedOp(value) {
2467
+ return typeof value === "string" && ASSISTANT_FOLLOWER_ALLOWED_OP_SET.has(value);
2468
+ }
2469
+ var DECISION_OP_IMPLIED_BY = {
2470
+ decision_list: "status",
2471
+ decision_answer: "send",
2472
+ decision_request: "send"
2473
+ };
2474
+ function followerOpPermitted(op, allowedOps) {
2475
+ if (!isAssistantFollowerAllowedOp(op)) return false;
2476
+ if (allowedOps.includes(op)) return true;
2477
+ const implied = DECISION_OP_IMPLIED_BY[op];
2478
+ return implied !== void 0 && allowedOps.includes(implied);
2479
+ }
2480
+ function followedRemoteProjectKey(hostDaemonId, meshId) {
2481
+ const canonHost = canonicalDaemonId(hostDaemonId) ?? hostDaemonId.trim();
2482
+ return `${canonHost}::${meshId.trim()}`;
2483
+ }
2484
+ function sanitizeRemoteRepoIdentity(raw) {
2485
+ if (typeof raw !== "string") return null;
2486
+ const trimmed = raw.trim();
2487
+ if (!trimmed) return null;
2488
+ if (trimmed.startsWith("/") || trimmed.startsWith("./") || trimmed.startsWith("../") || trimmed.startsWith("~/") || trimmed.startsWith("\\") || /^[a-zA-Z]:[\\/]/.test(trimmed) || /^file:/i.test(trimmed)) {
2489
+ return null;
2490
+ }
2491
+ const withoutQuery = trimmed.replace(/[?#].*$/, "").replace(/\/+$/, "");
2492
+ if (!withoutQuery) return null;
2493
+ let host = "";
2494
+ let repoPath = "";
2495
+ if (/^[a-z][a-z0-9+.-]*:\/\//i.test(withoutQuery)) {
2496
+ try {
2497
+ const url = new URL(withoutQuery);
2498
+ if (url.protocol === "file:") return null;
2499
+ host = url.hostname.toLowerCase();
2500
+ repoPath = decodeURIComponent(url.pathname).replace(/^\/+|\/+$/g, "").replace(/\.git$/i, "");
2501
+ } catch {
2502
+ return null;
2503
+ }
2504
+ } else {
2505
+ const scpMatch = withoutQuery.match(/^(?:[^@/:]+@)?(\[[^\]]+\]|[^/:]+):(.+)$/);
2506
+ if (scpMatch) {
2507
+ host = scpMatch[1].replace(/^\[|\]$/g, "").toLowerCase();
2508
+ repoPath = scpMatch[2].replace(/^\/+|\/+$/g, "").replace(/\.git$/i, "");
2509
+ } else {
2510
+ const slash = withoutQuery.indexOf("/");
2511
+ if (slash > 0) {
2512
+ const rawHost = withoutQuery.slice(0, slash);
2513
+ const atIdx = rawHost.lastIndexOf("@");
2514
+ host = (atIdx >= 0 ? rawHost.slice(atIdx + 1) : rawHost).toLowerCase();
2515
+ repoPath = withoutQuery.slice(slash + 1).replace(/^\/+|\/+$/g, "").replace(/\.git$/i, "");
2516
+ }
2517
+ }
2518
+ }
2519
+ if (!host || !repoPath) return null;
2520
+ if (!host.includes(".") && host !== "localhost") return null;
2521
+ if (/[\s@:\\]/.test(host)) return null;
2522
+ const segments = repoPath.split("/").filter(Boolean);
2523
+ if (segments.length === 0) return null;
2524
+ if (segments.some((seg) => seg === "." || seg === ".." || /[\s@:\\]/.test(seg))) return null;
2525
+ return `${host}/${segments.join("/")}`.slice(0, 200);
2526
+ }
2128
2527
 
2129
2528
  // src/turn-evidence.ts
2130
2529
  var MESH_TOPIC_PROTOCOL_VERSION = 2;
@@ -2160,18 +2559,29 @@ var TURN_SCOPES = ["mesh_queue", "mesh_direct", "plain"];
2160
2559
  var RECLAIMING_SEND_REFUSALS = ["session_exited", "no_target", "unsupported_input"];
2161
2560
  var DELIVERY_OUTCOMES = ["delivered", "queued"];
2162
2561
  var DELIVERY_VIAS = ["local", "p2p"];
2163
- var DISPATCH_FAILURE_REASONS = ["worker_absent", "transport_error", "spawn_failed", "rejected_by_worker", "timeout"];
2562
+ var DISPATCH_FAILURE_REASONS = ["worker_absent", "transport_error", "spawn_failed", "rejected_by_worker", "timeout", "submit_unconfirmed"];
2164
2563
  function sanitizeRefusalCode(value) {
2165
2564
  if (typeof value !== "string") return void 0;
2166
2565
  const normalized = value.trim().toLowerCase().replace(/[^a-z_]/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "");
2167
2566
  if (!normalized) return void 0;
2168
2567
  return normalized.slice(0, 64);
2169
2568
  }
2569
+ var DISPATCH_REFUSAL_DETAIL_MAX = 200;
2570
+ function sanitizeDispatchRefusalDetail(code, message) {
2571
+ const cleanCode = sanitizeRefusalCode(code);
2572
+ let cleanMessage;
2573
+ if (typeof message === "string") {
2574
+ const line = message.replace(/(?:[A-Za-z]:)?[\\/](?:Users|home)[\\/][^\s\\/]+/g, "~").replace(/[\u0000-\u001f\u007f]+/g, " ").replace(/\s+/g, " ").trim();
2575
+ if (line) cleanMessage = line.length > DISPATCH_REFUSAL_DETAIL_MAX ? `${line.slice(0, DISPATCH_REFUSAL_DETAIL_MAX - 1)}\u2026` : line;
2576
+ }
2577
+ if (!cleanCode && !cleanMessage) return void 0;
2578
+ return { ...cleanCode ? { code: cleanCode } : {}, ...cleanMessage ? { message: cleanMessage } : {} };
2579
+ }
2170
2580
  var CONSUME_PROFILES = ["default", "native_source"];
2171
2581
  var SESSION_REBOUND_REASONS = ["restart", "live_holder"];
2172
2582
  var SUSPENSION_MODALS = ["approval", "choice"];
2173
- var SUSPENSION_RESOLUTIONS = ["approved", "rejected", "answered"];
2174
- var SUSPENSION_RESOLUTION_VIAS = ["modal_button", "auto_approve", "prompt_answer"];
2583
+ var SUSPENSION_RESOLUTIONS = ["approved", "rejected", "answered", "dismissed"];
2584
+ var SUSPENSION_RESOLUTION_VIAS = ["modal_button", "auto_approve", "prompt_answer", "modal_disappeared"];
2175
2585
  var TURN_END_STRENGTHS = ["genuine", "weak"];
2176
2586
  var TURN_END_BLOCK_REASONS = [
2177
2587
  "missing_final_assistant",
@@ -2179,9 +2589,9 @@ var TURN_END_BLOCK_REASONS = [
2179
2589
  "terminal_block_hard_cap",
2180
2590
  "decoupled_completion"
2181
2591
  ];
2182
- var NATIVE_TURN_OUTCOMES = ["completed", "aborted"];
2592
+ var NATIVE_TURN_OUTCOMES = ["completed", "aborted", "failed"];
2183
2593
  var LIVENESS_RESULTS = ["alive", "unknown", "read_failed", "dead"];
2184
- var PROVIDER_FAILURES = ["auth_failed", "billing_failed"];
2594
+ var PROVIDER_FAILURES = ["auth_failed", "billing_failed", "usage_limit_exceeded", "server_overloaded", "provider_error"];
2185
2595
  var SESSION_ERROR_REASONS = ["provider_error", "adapter_error", "spawn_failed", "auth_failed", "billing_failed", "unknown", "daemon_restart"];
2186
2596
  var CANCEL_REASONS = ["operator_cancel", "intentional_cleanup", "task_removed", "mission_abandoned", "superseded"];
2187
2597
  var OPERATOR_STATUSES = ["completed", "failed"];
@@ -2208,9 +2618,10 @@ var HOLD_REASONS = [
2208
2618
  // — a turn_end commits the report (R9t), expiry commits it anyway (R13t) so
2209
2619
  // a session whose FSM never shows the idle edge again does not wait for
2210
2620
  // liveness / hard_ceiling.
2211
- "await_end"
2621
+ "await_end",
2622
+ "report_correction"
2212
2623
  ];
2213
- var TURN_OUTCOMES = ["completed", "failed", "cancelled"];
2624
+ var TURN_OUTCOMES = ["completed", "blocked", "failed", "cancelled"];
2214
2625
  var COMMIT_STRENGTHS = ["genuine", "weak", "tool_report", "operator"];
2215
2626
  var TURN_REASONS = [
2216
2627
  // commits
@@ -2219,9 +2630,15 @@ var TURN_REASONS = [
2219
2630
  "transcript_final",
2220
2631
  "worker_reported",
2221
2632
  "finalization_timeout_no_response",
2633
+ "weak_end_liveness_unconfirmed",
2634
+ "weak_end_probe_unobserved",
2635
+ "report_correction_expired",
2222
2636
  "session_error",
2223
2637
  "provider_auth_failed",
2224
2638
  "provider_billing_failed",
2639
+ "provider_usage_limit_exceeded",
2640
+ "provider_server_overloaded",
2641
+ "provider_error",
2225
2642
  "operator_cancel",
2226
2643
  "intentional_cleanup",
2227
2644
  "task_removed",
@@ -2234,6 +2651,8 @@ var TURN_REASONS = [
2234
2651
  "reclaim_budget_exhausted",
2235
2652
  "hollow_max_retries",
2236
2653
  "migration_orphan",
2654
+ // a stopping attempt whose writer node stayed unreachable (or was removed) past the bound
2655
+ "writer_unreachable",
2237
2656
  // reclaims (generation + 1)
2238
2657
  "dispatch_refused_session_exited",
2239
2658
  "dispatch_refused_no_target",
@@ -2249,6 +2668,7 @@ var TURN_REASONS = [
2249
2668
  ];
2250
2669
  var NOTIFY_KINDS = [
2251
2670
  "completed",
2671
+ "blocked",
2252
2672
  "failed",
2253
2673
  "cancelled",
2254
2674
  "stopped",
@@ -2298,8 +2718,8 @@ var TURN_EVIDENCE_FIELD_SPECS = {
2298
2718
  duplicate_dispatch_refusal: { holderSessionId: id, holderAttemptId: idOpt },
2299
2719
  session_rebound: { toSessionId: id, reason: en(SESSION_REBOUND_REASONS) },
2300
2720
  turn_started: { retro: bool },
2301
- suspension: { modal: en(SUSPENSION_MODALS), modalKey: idOpt },
2302
- suspension_resolved: { resolution: en(SUSPENSION_RESOLUTIONS), via: en(SUSPENSION_RESOLUTION_VIAS) },
2721
+ suspension: { modal: en(SUSPENSION_MODALS), modalKey: idOpt, providerSetup: boolOpt, clockUnknown: boolOpt },
2722
+ suspension_resolved: { resolution: en(SUSPENSION_RESOLUTIONS), via: en(SUSPENSION_RESOLUTION_VIAS), modalKey: idOpt },
2303
2723
  turn_end: {
2304
2724
  strength: en(TURN_END_STRENGTHS),
2305
2725
  afterFinalizationTimeout: boolOpt,
@@ -2309,6 +2729,7 @@ var TURN_EVIDENCE_FIELD_SPECS = {
2309
2729
  releasedByHardCap: boolOpt,
2310
2730
  nativeOutcome: enOpt(NATIVE_TURN_OUTCOMES),
2311
2731
  live: { t: "live", optional: true },
2732
+ nativeMarker: { t: "native_marker", optional: true },
2312
2733
  reportExpected: boolOpt,
2313
2734
  providerFailure: enOpt(PROVIDER_FAILURES)
2314
2735
  },
@@ -2322,7 +2743,7 @@ var TURN_EVIDENCE_FIELD_SPECS = {
2322
2743
  },
2323
2744
  transcript_activity: { newestActivityAt: ms },
2324
2745
  no_progress: { stalledMs: ms, observedStatus: en(NO_PROGRESS_OBSERVED_STATUSES), finalAssistantPresent: bool },
2325
- liveness: { result: en(LIVENESS_RESULTS) },
2746
+ liveness: { result: en(LIVENESS_RESULTS), probeStartedAtMs: msOpt },
2326
2747
  process_exit: { exitCode: { t: "int", nullable: true }, providerFailure: enOpt(PROVIDER_FAILURES) },
2327
2748
  session_error: { reason: en(SESSION_ERROR_REASONS) },
2328
2749
  worker_report: {
@@ -2332,6 +2753,7 @@ var TURN_EVIDENCE_FIELD_SPECS = {
2332
2753
  branchState: enOpt(WORKER_BRANCH_STATES),
2333
2754
  touchedFileCount: intOpt
2334
2755
  },
2756
+ worker_report_correction_requested: { deliveryId: { t: "id", optional: true } },
2335
2757
  worker_progress: { note: { t: "summary_ref", optional: true } },
2336
2758
  git_side_effect: { dirty: bool, commitsSinceDispatch: { t: "int" }, attributable: bool },
2337
2759
  cancel: { reason: en(CANCEL_REASONS) },
@@ -2379,7 +2801,7 @@ function isLiveTurnPending(value) {
2379
2801
  return isRecord2(value) && hasOnlyKeys(value, ["modal", "adapterPending", "trailingTool", "newestActivityAt"]) && typeof value.modal === "boolean" && typeof value.adapterPending === "boolean" && typeof value.trailingTool === "boolean" && (value.newestActivityAt === void 0 || isFiniteNumber2(value.newestActivityAt));
2380
2802
  }
2381
2803
  function isNativeMarkerRef(value) {
2382
- return isRecord2(value) && hasOnlyKeys(value, ["outcome", "turnId"]) && NATIVE_TURN_OUTCOMES.includes(value.outcome) && (value.turnId === void 0 || isEvidenceIdentifier(value.turnId));
2804
+ return isRecord2(value) && hasOnlyKeys(value, ["outcome", "turnId", "receivedAt", "startedAt", "errorAt"]) && NATIVE_TURN_OUTCOMES.includes(value.outcome) && (value.turnId === void 0 || isEvidenceIdentifier(value.turnId)) && ["receivedAt", "startedAt", "errorAt"].every((key) => value[key] === void 0 || isFiniteNumber2(value[key]));
2383
2805
  }
2384
2806
  function isCoordinatorIdentity(value) {
2385
2807
  return isRecord2(value) && hasOnlyKeys(value, ["daemonId", "coordinatorRunId", "sessionId"]) && isEvidenceIdentifier(value.daemonId) && isEvidenceIdentifier(value.coordinatorRunId) && (value.sessionId === void 0 || isEvidenceIdentifier(value.sessionId));
@@ -2502,17 +2924,89 @@ function projectTurnEvidenceEntry(evidence, attempt) {
2502
2924
  };
2503
2925
  }
2504
2926
 
2927
+ // src/launch-defaults.ts
2928
+ var LAUNCH_DEFAULT_ROLES = ["assistant", "coordinator"];
2929
+ var LAUNCH_DEFAULT_SOURCES = ["user", "stored_default", "project_default", "provider_default"];
2930
+ var LAUNCH_DEFAULTS_NEXT_LAUNCH_NOTE = "Applies to the next launch; running sessions are unchanged.";
2931
+ function isLaunchDefaultRole(value) {
2932
+ return typeof value === "string" && LAUNCH_DEFAULT_ROLES.includes(value);
2933
+ }
2934
+ function isLaunchDefaultSource(value) {
2935
+ return typeof value === "string" && LAUNCH_DEFAULT_SOURCES.includes(value);
2936
+ }
2937
+ var LAUNCH_DEFAULT_ERROR_CODES = [
2938
+ "invalid_args",
2939
+ "launch_default_required",
2940
+ "launch_default_unavailable",
2941
+ "launch_selection_invalid",
2942
+ "launch_default_invalid",
2943
+ "revision_conflict",
2944
+ "store_unavailable",
2945
+ "store_busy",
2946
+ "persistence_failed",
2947
+ "project_not_found",
2948
+ "project_ambiguous",
2949
+ "project_not_hosted",
2950
+ "project_storage_unavailable",
2951
+ "staging_unavailable",
2952
+ "staging_failed",
2953
+ "review_turn_tool_denied"
2954
+ ];
2955
+
2956
+ // src/role-launch.ts
2957
+ function record(value) {
2958
+ return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
2959
+ }
2960
+ function ref(value) {
2961
+ const r = record(value);
2962
+ if (!r || !isLaunchDefaultRole(r.role) || r.scope !== "global" && r.scope !== "project" || !Number.isSafeInteger(r.revision) || r.revision < 1 || r.scope === "project" && (typeof r.projectId !== "string" || !r.projectId)) return void 0;
2963
+ return {
2964
+ role: r.role,
2965
+ scope: r.scope,
2966
+ revision: r.revision,
2967
+ ...r.scope === "project" ? { projectId: r.projectId } : {}
2968
+ };
2969
+ }
2970
+ function axis(value) {
2971
+ const a = record(value);
2972
+ if (!a || !isLaunchDefaultSource(a.source) || a.value !== null && typeof a.value !== "string") return void 0;
2973
+ const defaultRef = ref(a.defaultRef);
2974
+ if (a.source === "stored_default" && defaultRef?.scope !== "global" || a.source === "project_default" && defaultRef?.scope !== "project" || (a.source === "user" || a.source === "provider_default") && a.defaultRef !== void 0) return void 0;
2975
+ return { value: a.value, source: a.source, ...defaultRef ? { defaultRef } : {} };
2976
+ }
2977
+ function parseRoleLaunchSelection(value) {
2978
+ const r = record(value), s = record(r?.selection), a = record(r?.applied);
2979
+ if (!r || !isLaunchDefaultRole(r.role) || !s || typeof s.provider !== "string" || !s.provider || !Number.isSafeInteger(r.documentRevision) || r.documentRevision < 1 || s.model !== void 0 && typeof s.model !== "string" || s.thinkingLevel !== void 0 && typeof s.thinkingLevel !== "string") return void 0;
2980
+ const provider = axis(a?.provider), model = axis(a?.model), thinkingLevel = axis(a?.thinkingLevel);
2981
+ if (!provider || !model || !thinkingLevel || [provider, model, thinkingLevel].some((axis2) => axis2.defaultRef && (axis2.defaultRef.role !== r.role || axis2.defaultRef.scope === "global" && axis2.defaultRef.revision > r.documentRevision)) || provider.value !== s.provider || model.value !== (s.model ?? null) || thinkingLevel.value !== (s.thinkingLevel ?? null)) return void 0;
2982
+ const defaultRef = ref(r.defaultRef);
2983
+ return {
2984
+ role: r.role,
2985
+ selection: {
2986
+ provider: s.provider,
2987
+ ...typeof s.model === "string" ? { model: s.model } : {},
2988
+ ...typeof s.thinkingLevel === "string" ? { thinkingLevel: s.thinkingLevel } : {}
2989
+ },
2990
+ applied: { provider, model, thinkingLevel },
2991
+ ...defaultRef ? { defaultRef } : {},
2992
+ documentRevision: r.documentRevision
2993
+ };
2994
+ }
2995
+
2505
2996
  // src/session-launch.ts
2506
2997
  var MODEL_AXIS_SOURCES = [
2507
2998
  /** Picked explicitly for this launch (dashboard dropdown, coordinator dialog). */
2508
2999
  "user",
2509
3000
  /** The dashboard dialog restored it from the last launch (browser-local memory). */
2510
3001
  "remembered",
3002
+ /** The authoritative daemon role default or host project override. */
3003
+ "stored_default",
3004
+ "project_default",
2511
3005
  /** A mesh capability slot supplied it (or a difficulty preset the slot outranked). */
2512
3006
  "mesh_slot",
2513
3007
  /** An explicit per-task model / thinking level on a mesh queue task. */
2514
3008
  "task_override",
2515
- /** Nothing was requested; the provider's default is known (discovery / manifest). */
3009
+ /** Nothing requested: the provider chooses; resolvedDefault records it when known. */
2516
3010
  "provider_default",
2517
3011
  /** A value was requested without saying where it came from, or nothing is known. */
2518
3012
  "unspecified"
@@ -2556,10 +3050,10 @@ function readFiniteNumber(value) {
2556
3050
  }
2557
3051
  function parseModelSelection(raw) {
2558
3052
  if (!raw || typeof raw !== "object") return void 0;
2559
- const record = raw;
3053
+ const record2 = raw;
2560
3054
  const history = [];
2561
- if (Array.isArray(record.history)) {
2562
- for (const entry of record.history) {
3055
+ if (Array.isArray(record2.history)) {
3056
+ for (const entry of record2.history) {
2563
3057
  if (!entry || typeof entry !== "object") continue;
2564
3058
  const e = entry;
2565
3059
  const value = readString(e.value);
@@ -2568,41 +3062,45 @@ function parseModelSelection(raw) {
2568
3062
  if (value && at !== void 0 && via) history.push({ at, value, via });
2569
3063
  }
2570
3064
  }
2571
- const requested = readString(record.requested);
2572
- const launchValue = readString(record.launchValue);
2573
- const resolvedDefault = readString(record.resolvedDefault);
2574
- const current = readString(record.current);
2575
- const observed = readString(record.observed);
2576
- const observedAt = readFiniteNumber(record.observedAt);
3065
+ const requested = readString(record2.requested);
3066
+ const launchValue = readString(record2.launchValue);
3067
+ const resolvedDefault = readString(record2.resolvedDefault);
3068
+ const current = readString(record2.current);
3069
+ const observed = readString(record2.observed);
3070
+ const observedAt = readFiniteNumber(record2.observedAt);
3071
+ const fallback = record2.fallback === true;
2577
3072
  return {
2578
- source: isModelAxisSource(record.source) ? record.source : "unspecified",
3073
+ source: isModelAxisSource(record2.source) ? record2.source : "unspecified",
2579
3074
  ...requested ? { requested } : {},
2580
3075
  ...launchValue ? { launchValue } : {},
2581
3076
  ...resolvedDefault ? { resolvedDefault } : {},
2582
3077
  ...current ? { current } : {},
2583
3078
  ...observed ? { observed } : {},
2584
3079
  ...observedAt !== void 0 ? { observedAt } : {},
3080
+ ...fallback ? { fallback } : {},
2585
3081
  history: history.slice(-MODEL_SELECTION_HISTORY_LIMIT)
2586
3082
  };
2587
3083
  }
2588
3084
  function parseSessionLaunchRecord(raw) {
2589
3085
  if (!raw || typeof raw !== "object") return void 0;
2590
- const record = raw;
2591
- const sessionId = readString(record.sessionId);
2592
- const providerType = readString(record.providerType);
2593
- const launchedAt = readFiniteNumber(record.launchedAt);
2594
- const model = parseModelSelection(record.model);
2595
- const thinkingLevel = parseModelSelection(record.thinkingLevel);
3086
+ const record2 = raw;
3087
+ const sessionId = readString(record2.sessionId);
3088
+ const providerType = readString(record2.providerType);
3089
+ const launchedAt = readFiniteNumber(record2.launchedAt);
3090
+ const model = parseModelSelection(record2.model);
3091
+ const thinkingLevel = parseModelSelection(record2.thinkingLevel);
2596
3092
  if (!sessionId || !providerType || launchedAt === void 0 || !model || !thinkingLevel) return void 0;
2597
- const providerVersion = readString(record.providerVersion);
2598
- const workspace = readString(record.workspace);
2599
- const autoApproveModeId = readString(record.autoApproveModeId);
3093
+ const providerVersion = readString(record2.providerVersion);
3094
+ const workspace = readString(record2.workspace);
3095
+ const autoApproveModeId = readString(record2.autoApproveModeId);
3096
+ const roleLaunch = parseRoleLaunchSelection(record2.roleLaunch);
2600
3097
  return {
3098
+ ...roleLaunch ? { roleLaunch } : {},
2601
3099
  sessionId,
2602
3100
  providerType,
2603
3101
  ...providerVersion ? { providerVersion } : {},
2604
- ...record.providerChannel === "stable" || record.providerChannel === "preview" ? { providerChannel: record.providerChannel } : {},
2605
- launchedBy: isSessionLaunchedBy(record.launchedBy) ? record.launchedBy : "api",
3102
+ ...record2.providerChannel === "stable" || record2.providerChannel === "preview" ? { providerChannel: record2.providerChannel } : {},
3103
+ launchedBy: isSessionLaunchedBy(record2.launchedBy) ? record2.launchedBy : "api",
2606
3104
  launchedAt,
2607
3105
  ...workspace ? { workspace } : {},
2608
3106
  model,
@@ -2666,7 +3164,7 @@ function isTurnAttemptRefValue(value) {
2666
3164
  function isTurnObserveResponse(value) {
2667
3165
  return isRecord(value) && hasOnlyKeys2(value, ["verdict", "attemptRef", "outcome"]) && isTurnObserveVerdict(value.verdict) && isTurnAttemptRefValue(value.attemptRef) && (value.outcome === void 0 || isTurnOutcomeValue(value.outcome));
2668
3166
  }
2669
- var TURN_OUTCOMES_LOCAL = ["completed", "failed", "cancelled"];
3167
+ var TURN_OUTCOMES_LOCAL = ["completed", "blocked", "failed", "cancelled"];
2670
3168
  function isTurnOutcomeValue(value) {
2671
3169
  return typeof value === "string" && TURN_OUTCOMES_LOCAL.includes(value);
2672
3170
  }
@@ -2892,8 +3390,23 @@ function isMissionBriefWire(value) {
2892
3390
  }
2893
3391
  return true;
2894
3392
  }
3393
+ var STRUCTURED_MISSION_KEYS = ["summary", "releaseNote", "outcome", "outcomeReason", "version", "carryOver", "openItems"];
3394
+ function isOpenItemCountsWire(value) {
3395
+ if (!isRecord(value) || !hasOnlyKeys2(value, ["remaining", "live_check", "decision", "evidence"])) return false;
3396
+ return ["remaining", "live_check", "decision", "evidence"].every((k) => isNonNegativeInt(value[k]));
3397
+ }
3398
+ function isStructuredMissionFields(value) {
3399
+ for (const k of ["summary", "releaseNote", "outcome", "outcomeReason"]) {
3400
+ if (value[k] !== void 0 && typeof value[k] !== "string") return false;
3401
+ }
3402
+ if (value.version !== void 0 && !isNonNegativeInt(value.version)) return false;
3403
+ if (value.carryOver !== void 0 && typeof value.carryOver !== "boolean") return false;
3404
+ if (value.openItems !== void 0 && !isOpenItemCountsWire(value.openItems)) return false;
3405
+ return true;
3406
+ }
2895
3407
  function isMeshMissionRecordWire(value) {
2896
- if (!isRecord(value) || !hasOnlyKeys2(value, ["id", "meshId", "title", "goal", "status", "brief"])) return false;
3408
+ if (!isRecord(value) || !hasOnlyKeys2(value, ["id", "meshId", "title", "goal", "status", "brief", ...STRUCTURED_MISSION_KEYS])) return false;
3409
+ if (!isStructuredMissionFields(value)) return false;
2897
3410
  if (!isEvidenceIdentifier(value.id) || !isEvidenceIdentifier(value.meshId)) return false;
2898
3411
  if (typeof value.title !== "string" || typeof value.goal !== "string") return false;
2899
3412
  if (!isMeshMissionStatusValue(value.status)) return false;
@@ -2901,11 +3414,22 @@ function isMeshMissionRecordWire(value) {
2901
3414
  return true;
2902
3415
  }
2903
3416
  function isMissionUpsertRequest(value) {
2904
- if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "id", "title", "goal", "status", "brief"])) return false;
3417
+ if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "id", "title", "goal", "status", "brief", "structured", "summary", "releaseNote", "outcome", "outcomeReason", "carryOverTo", "toCarryOver", "itemsAdd", "itemsUpdate"])) return false;
2905
3418
  if (value.v !== TURN_IPC_PROTOCOL_VERSION) return false;
2906
3419
  if (!isEvidenceIdentifier(value.meshId)) return false;
2907
3420
  if (value.id !== void 0 && !isEvidenceIdentifier(value.id)) return false;
2908
- if (typeof value.title !== "string" || value.title.trim().length === 0) return false;
3421
+ if (typeof value.title !== "string") return false;
3422
+ if (value.title.trim().length === 0 && value.toCarryOver !== true && value.id === void 0) return false;
3423
+ if (value.structured !== void 0 && typeof value.structured !== "boolean") return false;
3424
+ if (value.toCarryOver !== void 0 && typeof value.toCarryOver !== "boolean") return false;
3425
+ for (const k of ["summary", "releaseNote", "outcome", "outcomeReason"]) {
3426
+ if (value[k] !== void 0 && typeof value[k] !== "string") return false;
3427
+ }
3428
+ if (value.carryOverTo !== void 0 && !isEvidenceIdentifier(value.carryOverTo)) return false;
3429
+ for (const k of ["itemsAdd", "itemsUpdate"]) {
3430
+ const list = value[k];
3431
+ if (list !== void 0 && (!Array.isArray(list) || list.length > 500 || !list.every(isRecord))) return false;
3432
+ }
2909
3433
  if (value.goal !== void 0 && typeof value.goal !== "string") return false;
2910
3434
  if (value.status !== void 0 && !isMeshMissionStatusValue(value.status)) return false;
2911
3435
  if (value.brief !== void 0 && value.brief !== null && !isMissionBriefWire(value.brief)) return false;
@@ -2915,7 +3439,7 @@ function decodeMissionUpsertRequest(value) {
2915
3439
  return isMissionUpsertRequest(value) ? value : null;
2916
3440
  }
2917
3441
  function isMissionUpsertResponse(value) {
2918
- return isRecord(value) && hasOnlyKeys2(value, ["mission"]) && isMeshMissionRecordWire(value.mission);
3442
+ return isRecord(value) && hasOnlyKeys2(value, ["mission", "result"]) && isMeshMissionRecordWire(value.mission) && (value.result === void 0 || isRecord(value.result));
2919
3443
  }
2920
3444
  function decodeMissionUpsertResponse(value) {
2921
3445
  return isMissionUpsertResponse(value) ? value : null;
@@ -2941,7 +3465,10 @@ function decodeMissionQueryResponse(value) {
2941
3465
  return isMissionQueryResponse(value) ? value : null;
2942
3466
  }
2943
3467
  function isMissionListQueryRequest(value) {
2944
- if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "statuses", "verbose", "withStats", "limit", "historyIdLimit", "meshStatusView"])) return false;
3468
+ if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "statuses", "verbose", "withStats", "limit", "historyIdLimit", "meshStatusView", "structured", "items", "history"])) return false;
3469
+ for (const k of ["structured", "items", "history"]) {
3470
+ if (value[k] !== void 0 && typeof value[k] !== "boolean") return false;
3471
+ }
2945
3472
  if (value.meshStatusView !== void 0 && value.meshStatusView !== "compact" && value.meshStatusView !== "verbose") return false;
2946
3473
  if (value.v !== TURN_IPC_PROTOCOL_VERSION) return false;
2947
3474
  if (!isEvidenceIdentifier(value.meshId)) return false;
@@ -2967,12 +3494,13 @@ function isMeshMissionTaskAggregateWire(value) {
2967
3494
  return value.lastActivityAt === null || typeof value.lastActivityAt === "string";
2968
3495
  }
2969
3496
  function isMeshMissionStatsWire(value) {
2970
- const keys = ["missionId", "taskCount", "completed", "failed", "totalDurationMs", "wallClockMs", "retries", "incompleteTaskIds"];
3497
+ const keys = ["missionId", "taskCount", "completed", "failed", "blocked", "totalDurationMs", "wallClockMs", "retries", "incompleteTaskIds"];
2971
3498
  if (!isRecord(value) || !hasOnlyKeys2(value, keys)) return false;
2972
3499
  if (!isEvidenceIdentifier(value.missionId)) return false;
2973
3500
  for (const k of ["taskCount", "completed", "failed", "totalDurationMs", "retries"]) {
2974
3501
  if (!isNonNegativeInt(value[k])) return false;
2975
3502
  }
3503
+ if (value.blocked !== void 0 && !isNonNegativeInt(value.blocked)) return false;
2976
3504
  if (value.wallClockMs !== null && !isNonNegativeInt(value.wallClockMs)) return false;
2977
3505
  if (!Array.isArray(value.incompleteTaskIds) || !value.incompleteTaskIds.every(isEvidenceIdentifier)) return false;
2978
3506
  return true;
@@ -2982,7 +3510,7 @@ function isMissionListSummaryWire(value) {
2982
3510
  const hasGoal = "goal" in value;
2983
3511
  const hasPreview = "goalPreview" in value && "goalTruncated" in value;
2984
3512
  if (hasGoal === hasPreview) return false;
2985
- const baseKeys = ["id", "meshId", "title", "status", "tasks", "stats", "brief", "createdAt", "updatedAt", "closeCandidateEmittedAt"];
3513
+ const baseKeys = ["id", "meshId", "title", "status", "tasks", "stats", "brief", "createdAt", "updatedAt", "closeCandidateEmittedAt", ...STRUCTURED_MISSION_KEYS, "items", "history"];
2986
3514
  const allowed = hasGoal ? [...baseKeys, "goal"] : [...baseKeys, "goalPreview", "goalTruncated"];
2987
3515
  if (!hasOnlyKeys2(value, allowed)) return false;
2988
3516
  if (!isEvidenceIdentifier(value.id) || !isEvidenceIdentifier(value.meshId)) return false;
@@ -2996,6 +3524,10 @@ function isMissionListSummaryWire(value) {
2996
3524
  if (value.createdAt !== void 0 && typeof value.createdAt !== "string") return false;
2997
3525
  if (value.updatedAt !== void 0 && typeof value.updatedAt !== "string") return false;
2998
3526
  if (value.closeCandidateEmittedAt !== void 0 && value.closeCandidateEmittedAt !== null && typeof value.closeCandidateEmittedAt !== "string") return false;
3527
+ if (!isStructuredMissionFields(value)) return false;
3528
+ for (const k of ["items", "history"]) {
3529
+ if (value[k] !== void 0 && (!Array.isArray(value[k]) || !value[k].every(isRecord))) return false;
3530
+ }
2999
3531
  return true;
3000
3532
  }
3001
3533
  function isMeshMissionHistoryFoldWire(value) {
@@ -3094,12 +3626,15 @@ function isLedgerQueryEntryWire(value) {
3094
3626
  return true;
3095
3627
  }
3096
3628
  function isLedgerQuerySummaryWire(value) {
3097
- const keys = ["meshId", "totalEntries", "taskDispatched", "taskCompleted", "taskFailed", "taskStalled", "sessionLaunched", "checkpointCreated", "lastActivityAt", "recentFailures"];
3629
+ const keys = ["meshId", "totalEntries", "taskDispatched", "taskCompleted", "taskFailed", "taskBlocked", "taskStalled", "sessionLaunched", "checkpointCreated", "lastActivityAt", "recentFailures", "taskBlocked", "refineFailed", "recentRefineFailures"];
3098
3630
  if (!isRecord(value) || !hasOnlyKeys2(value, keys)) return false;
3099
3631
  if (!isEvidenceIdentifier(value.meshId)) return false;
3100
3632
  for (const k of ["totalEntries", "taskDispatched", "taskCompleted", "taskFailed", "taskStalled", "sessionLaunched", "checkpointCreated", "recentFailures"]) {
3101
3633
  if (!isNonNegativeInt(value[k])) return false;
3102
3634
  }
3635
+ if (value.taskBlocked !== void 0 && !isNonNegativeInt(value.taskBlocked)) return false;
3636
+ if (value.refineFailed !== void 0 && !isNonNegativeInt(value.refineFailed)) return false;
3637
+ if (value.recentRefineFailures !== void 0 && !isNonNegativeInt(value.recentRefineFailures)) return false;
3103
3638
  if (value.lastActivityAt !== null && typeof value.lastActivityAt !== "string") return false;
3104
3639
  return true;
3105
3640
  }
@@ -3143,9 +3678,10 @@ function isQueueDependencyHeadWire(value) {
3143
3678
  return isRecord(value) && hasOnlyKeys2(value, ["id", "status", "cancelReason"]) && typeof value.id === "string" && typeof value.status === "string" && (value.cancelReason === void 0 || typeof value.cancelReason === "string");
3144
3679
  }
3145
3680
  function isQueueQueryResponse(value) {
3146
- if (!isRecord(value) || !hasOnlyKeys2(value, ["entries", "counts", "oldHistoricalCount", "dependencyHeads"])) return false;
3681
+ if (!isRecord(value) || !hasOnlyKeys2(value, ["entries", "counts", "oldHistoricalCount", "legacyReportedBlockedCount", "dependencyHeads"])) return false;
3147
3682
  if (!Array.isArray(value.entries) || !value.entries.every(isQueueEntryWire)) return false;
3148
3683
  if (value.counts !== void 0 && (!isRecord(value.counts) || !Object.values(value.counts).every(isNonNegativeInt))) return false;
3684
+ if (value.legacyReportedBlockedCount !== void 0 && !isNonNegativeInt(value.legacyReportedBlockedCount)) return false;
3149
3685
  if (value.oldHistoricalCount !== void 0 && !isNonNegativeInt(value.oldHistoricalCount)) return false;
3150
3686
  if (value.dependencyHeads !== void 0 && (!Array.isArray(value.dependencyHeads) || !value.dependencyHeads.every(isQueueDependencyHeadWire))) return false;
3151
3687
  return true;
@@ -3203,7 +3739,7 @@ function decodeQueueRequeueRequest(value) {
3203
3739
  return isQueueRequeueRequest(value) ? value : null;
3204
3740
  }
3205
3741
  function isQueueRequeueResponse(value) {
3206
- return isRecord(value) && hasOnlyKeys2(value, ["task"]) && (value.task === null || isQueueEntryWire(value.task));
3742
+ return isRecord(value) && hasOnlyKeys2(value, ["task", "quotaOverrideRequested"]) && (value.task === null || isQueueEntryWire(value.task)) && (value.quotaOverrideRequested === void 0 || isRecord(value.quotaOverrideRequested) && typeof value.quotaOverrideRequested.decisionId === "string");
3207
3743
  }
3208
3744
  function decodeQueueRequeueResponse(value) {
3209
3745
  return isQueueRequeueResponse(value) ? value : null;
@@ -3267,6 +3803,24 @@ function isRecoveryContextQueryResponse(value) {
3267
3803
  function decodeRecoveryContextQueryResponse(value) {
3268
3804
  return isRecoveryContextQueryResponse(value) ? value : null;
3269
3805
  }
3806
+ function decodeQueueReviseRequest(value) {
3807
+ if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "taskId", "expectedRevision", "patch", "dryRun", "deferScheduling"]) || value.v !== TURN_IPC_PROTOCOL_VERSION || !isEvidenceIdentifier(value.meshId) || !isEvidenceIdentifier(value.taskId) || !Number.isSafeInteger(value.expectedRevision) || value.expectedRevision < 0 || !isRecord(value.patch) || !Object.keys(value.patch).length || !hasOnlyKeys2(value.patch, ["message", "ownedPaths", "phase", "dependsOn", "routingPreferences", "review", "difficulty", "requestQuotaOverride", "attestActiveOwnership"])) return null;
3808
+ if (value.dryRun !== void 0 && typeof value.dryRun !== "boolean") return null;
3809
+ if (value.deferScheduling !== void 0 && typeof value.deferScheduling !== "boolean") return null;
3810
+ const p = value.patch;
3811
+ if (p.requestQuotaOverride && (value.dryRun !== void 0 || value.deferScheduling !== void 0)) return null;
3812
+ if (p.requestQuotaOverride !== void 0 && (p.requestQuotaOverride !== true || Object.keys(p).length !== 1)) return null;
3813
+ if (p.attestActiveOwnership && value.deferScheduling !== void 0) return null;
3814
+ if (p.attestActiveOwnership !== void 0 && (p.attestActiveOwnership !== true || Object.keys(p).length !== 1)) return null;
3815
+ if (p.message !== void 0 && (typeof p.message !== "string" || !p.message.trim())) return null;
3816
+ if (p.phase !== void 0 && p.phase !== "source" && p.phase !== "integration") return null;
3817
+ if (p.difficulty !== void 0 && p.difficulty !== "easy" && p.difficulty !== "medium" && p.difficulty !== "difficult" && p.difficulty !== "freeform") return null;
3818
+ for (const key of ["ownedPaths", "dependsOn"]) {
3819
+ if (p[key] !== void 0 && (!Array.isArray(p[key]) || !p[key].every((x) => typeof x === "string" && !!x.trim()))) return null;
3820
+ }
3821
+ return value;
3822
+ }
3823
+ var decodeQueueReviseResponse = decodeQueueRequeueResponse;
3270
3824
 
3271
3825
  // src/turn-ipc-stats.ts
3272
3826
  function isTaskStatsQueryRequest(value) {
@@ -3365,6 +3919,7 @@ var TURN_IPC_COMMANDS = [
3365
3919
  "queue_enqueue_batch",
3366
3920
  "queue_cancel",
3367
3921
  "queue_requeue",
3922
+ "queue_revise",
3368
3923
  "direct_dispatch_record",
3369
3924
  "active_work_query",
3370
3925
  "recovery_context_query",
@@ -3448,14 +4003,11 @@ function normalizeOwnedPaths(input) {
3448
4003
  }
3449
4004
  function entryContains(base, path) {
3450
4005
  if (path === base.path) return true;
3451
- if (base.subtree && (path === base.path || path.startsWith(`${base.path}/`))) return true;
4006
+ if (base.subtree && (base.path === "" || path.startsWith(`${base.path}/`))) return true;
3452
4007
  return false;
3453
4008
  }
3454
4009
  function entriesOverlap(a, b) {
3455
- if (a.path === b.path) return true;
3456
- if (a.subtree && (b.path === a.path || b.path.startsWith(`${a.path}/`))) return true;
3457
- if (b.subtree && (a.path === b.path || a.path.startsWith(`${b.path}/`))) return true;
3458
- return false;
4010
+ return entryContains(a, b.path) || entryContains(b, a.path);
3459
4011
  }
3460
4012
  function pathsOverlap(a, b) {
3461
4013
  if (a.paths.length === 0 || b.paths.length === 0) return false;
@@ -3507,6 +4059,357 @@ function touchedFilesOutsideOwnership(touched, owned) {
3507
4059
  return { undeclaredTouched, unusedDeclarations };
3508
4060
  }
3509
4061
 
4062
+ // src/mission-items.ts
4063
+ var MISSION_ITEM_KINDS = ["remaining", "live_check", "decision", "evidence"];
4064
+ var MISSION_ITEM_STATES = ["open", "done", "failed", "dropped", "moved", "answered", "expired", "withdrawn", "superseded"];
4065
+ var COORDINATOR_SETTABLE_ITEM_STATES = {
4066
+ remaining: ["open", "done", "dropped"],
4067
+ live_check: ["open", "done", "dropped"],
4068
+ evidence: ["open", "done", "dropped"],
4069
+ decision: ["open", "withdrawn", "superseded"]
4070
+ };
4071
+ var MISSION_OUTCOMES = ["merged", "verified_live", "superseded", "not_needed", "owner_abandoned", "unspecified"];
4072
+ function isMissionOutcome(value) {
4073
+ return typeof value === "string" && MISSION_OUTCOMES.includes(value);
4074
+ }
4075
+ var MISSION_REF_KINDS = ["commit", "branch", "pr", "task", "artifact", "mission", "url"];
4076
+ var MISSION_LIMITS = {
4077
+ summary: 300,
4078
+ outcomeReason: 500,
4079
+ itemText: 300,
4080
+ machine: 80,
4081
+ refs: 8,
4082
+ refValue: 300,
4083
+ refRepo: 120,
4084
+ refNote: 200,
4085
+ dedupeKey: 400,
4086
+ question: 300,
4087
+ context: 600,
4088
+ options: 5,
4089
+ optionLabel: 60,
4090
+ optionDetail: 200,
4091
+ /** Open items per mission before the oldest `remaining` fold into a "N more" summary item. */
4092
+ openItemsPerMission: 200,
4093
+ /** One event payload (serialized). */
4094
+ eventPayloadBytes: 16 * 1024,
4095
+ /** items_add / items_update entries honoured per call (extra entries are reported, not applied). */
4096
+ itemsPerCall: 50
4097
+ };
4098
+ var MISSION_DECISION_OPTION_IDS = ["a", "b", "c", "d", "e"];
4099
+ var MISSION_DECISION_URGENCIES = ["normal", "blocking"];
4100
+ var MISSION_DECISION_ON_DUE = ["remind", "apply_recommended"];
4101
+ function truncateMissionText(value, max) {
4102
+ if (value.length <= max) return value;
4103
+ return `${value.slice(0, max - 1).trimEnd()}\u2026`;
4104
+ }
4105
+ function str(value) {
4106
+ return typeof value === "string" ? value.trim() : "";
4107
+ }
4108
+ function collapse(value) {
4109
+ return value.replace(/\s+/g, " ").trim();
4110
+ }
4111
+ function normalizeMissionSummary(value) {
4112
+ if (typeof value !== "string") return null;
4113
+ const text = collapse(value);
4114
+ return { value: truncateMissionText(text, MISSION_LIMITS.summary), truncated: text.length > MISSION_LIMITS.summary };
4115
+ }
4116
+ function normalizeOutcomeReason(value) {
4117
+ if (typeof value !== "string") return null;
4118
+ const text = value.trim();
4119
+ return { value: truncateMissionText(text, MISSION_LIMITS.outcomeReason), truncated: text.length > MISSION_LIMITS.outcomeReason };
4120
+ }
4121
+ function normalizeMissionRefs(value) {
4122
+ if (!Array.isArray(value)) return { refs: [], truncated: false };
4123
+ const refs = [];
4124
+ let truncated = false;
4125
+ for (const raw of value) {
4126
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) continue;
4127
+ const r = raw;
4128
+ const kind = str(r.kind);
4129
+ const refValue = str(r.value);
4130
+ if (!MISSION_REF_KINDS.includes(kind) || !refValue) continue;
4131
+ if (refs.length >= MISSION_LIMITS.refs) {
4132
+ truncated = true;
4133
+ break;
4134
+ }
4135
+ const repo = str(r.repo);
4136
+ const note = str(r.note);
4137
+ refs.push({
4138
+ kind,
4139
+ ...repo ? { repo: truncateMissionText(repo, MISSION_LIMITS.refRepo) } : {},
4140
+ value: truncateMissionText(refValue, MISSION_LIMITS.refValue),
4141
+ ...note ? { note: truncateMissionText(note, MISSION_LIMITS.refNote) } : {}
4142
+ });
4143
+ }
4144
+ return { refs, truncated };
4145
+ }
4146
+ function normalizeOptions(value, truncated) {
4147
+ if (!Array.isArray(value)) return [];
4148
+ const out = [];
4149
+ for (const raw of value) {
4150
+ if (typeof raw === "string" && raw.trim()) {
4151
+ if (out.length >= MISSION_LIMITS.options) {
4152
+ truncated.push("options");
4153
+ break;
4154
+ }
4155
+ out.push({ id: MISSION_DECISION_OPTION_IDS[out.length], label: truncateMissionText(raw.trim(), MISSION_LIMITS.optionLabel) });
4156
+ continue;
4157
+ }
4158
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) continue;
4159
+ const o = raw;
4160
+ const label = collapse(str(o.label));
4161
+ if (!label) continue;
4162
+ if (out.length >= MISSION_LIMITS.options) {
4163
+ truncated.push("options");
4164
+ break;
4165
+ }
4166
+ const detail = str(o.detail);
4167
+ out.push({
4168
+ id: MISSION_DECISION_OPTION_IDS[out.length],
4169
+ label: truncateMissionText(label, MISSION_LIMITS.optionLabel),
4170
+ ...detail ? { detail: truncateMissionText(detail, MISSION_LIMITS.optionDetail) } : {}
4171
+ });
4172
+ }
4173
+ return out;
4174
+ }
4175
+ function normalizeDueAt(value) {
4176
+ if (typeof value !== "string" || !value.trim()) return void 0;
4177
+ const ms2 = Date.parse(value);
4178
+ return Number.isNaN(ms2) ? void 0 : new Date(ms2).toISOString();
4179
+ }
4180
+ function normalizeDecisionInput(raw, truncated) {
4181
+ const questionSource = collapse(str(raw.question) || str(raw.text));
4182
+ if (!questionSource) return null;
4183
+ if (questionSource.length > MISSION_LIMITS.question) truncated.push("question");
4184
+ const question = truncateMissionText(questionSource, MISSION_LIMITS.question);
4185
+ const contextSource = str(raw.context);
4186
+ if (contextSource.length > MISSION_LIMITS.context) truncated.push("context");
4187
+ const options = normalizeOptions(raw.options, truncated);
4188
+ const recommendedRaw = str(raw.recommended);
4189
+ const recommended = recommendedRaw && options.some((o) => o.id === recommendedRaw) ? recommendedRaw : options.find((o) => recommendedRaw && o.label.toLowerCase() === recommendedRaw.toLowerCase())?.id;
4190
+ const dueAt = normalizeDueAt(raw.dueAt ?? raw.due_at);
4191
+ const onDueRaw = str(raw.onDue ?? raw.on_due);
4192
+ const urgencyRaw = str(raw.urgency);
4193
+ const allowFreeTextRaw = raw.allowFreeText ?? raw.allow_free_text;
4194
+ return {
4195
+ question,
4196
+ ...contextSource ? { context: truncateMissionText(contextSource, MISSION_LIMITS.context) } : {},
4197
+ options,
4198
+ ...recommended ? { recommended } : {},
4199
+ allowFreeText: typeof allowFreeTextRaw === "boolean" ? allowFreeTextRaw : true,
4200
+ ...dueAt ? { dueAt } : {},
4201
+ // apply_recommended without a recommended option has nothing to apply — fall back to remind.
4202
+ onDue: onDueRaw === "apply_recommended" && recommended ? "apply_recommended" : "remind",
4203
+ urgency: urgencyRaw === "blocking" ? "blocking" : "normal"
4204
+ };
4205
+ }
4206
+ function normalizeForDedupe(text) {
4207
+ return collapse(text).toLowerCase().replace(/[\s.!?。]+$/u, "");
4208
+ }
4209
+ function deriveItemDedupeKey(kind, parts) {
4210
+ const explicit = str(parts.explicit);
4211
+ if (explicit) return truncateMissionText(`k:${explicit}`, MISSION_LIMITS.dedupeKey);
4212
+ if (kind === "decision") return truncateMissionText(`decision:${normalizeForDedupe(parts.question ?? parts.text ?? "")}`, MISSION_LIMITS.dedupeKey);
4213
+ if (kind === "evidence") {
4214
+ const ref2 = parts.refs?.[0];
4215
+ if (ref2) return truncateMissionText(`evidence:${ref2.kind}:${ref2.repo ?? ""}:${ref2.value}`, MISSION_LIMITS.dedupeKey);
4216
+ }
4217
+ const machine = parts.machine ? `@${normalizeForDedupe(parts.machine)}` : "";
4218
+ return truncateMissionText(`${kind}${machine}:${normalizeForDedupe(parts.text ?? "")}`, MISSION_LIMITS.dedupeKey);
4219
+ }
4220
+ function normalizeMissionItemInput(raw) {
4221
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return { error: "item must be an object" };
4222
+ const r = raw;
4223
+ const kind = str(r.kind) || "remaining";
4224
+ if (!MISSION_ITEM_KINDS.includes(kind)) {
4225
+ return { error: `invalid kind '${kind}' (valid: ${MISSION_ITEM_KINDS.join(", ")})` };
4226
+ }
4227
+ const truncated = [];
4228
+ const { refs, truncated: refsTruncated } = normalizeMissionRefs(r.refs);
4229
+ if (refsTruncated) truncated.push("refs");
4230
+ const machineRaw = collapse(str(r.machine));
4231
+ const machine = machineRaw ? truncateMissionText(machineRaw, MISSION_LIMITS.machine) : void 0;
4232
+ const explicitKey = str(r.dedupe_key ?? r.dedupeKey);
4233
+ if (kind === "decision") {
4234
+ const decisionRaw = r.decision && typeof r.decision === "object" && !Array.isArray(r.decision) ? r.decision : r;
4235
+ const decision = normalizeDecisionInput({ ...decisionRaw, question: decisionRaw.question ?? r.question ?? r.text }, truncated);
4236
+ if (!decision) return { error: "decision item needs a question" };
4237
+ return {
4238
+ item: {
4239
+ kind,
4240
+ text: decision.question,
4241
+ ...machine ? { machine } : {},
4242
+ refs,
4243
+ decision,
4244
+ dedupeKey: deriveItemDedupeKey("decision", { question: decision.question, explicit: explicitKey }),
4245
+ truncated
4246
+ }
4247
+ };
4248
+ }
4249
+ const textSource = collapse(str(r.text));
4250
+ if (!textSource && !(kind === "evidence" && refs.length > 0)) return { error: `${kind} item needs text` };
4251
+ if (textSource.length > MISSION_LIMITS.itemText) truncated.push("text");
4252
+ const text = truncateMissionText(textSource || `${refs[0].kind}: ${refs[0].value}`, MISSION_LIMITS.itemText);
4253
+ return {
4254
+ item: {
4255
+ kind,
4256
+ text,
4257
+ ...machine ? { machine } : {},
4258
+ refs,
4259
+ dedupeKey: deriveItemDedupeKey(kind, { text, machine, refs, explicit: explicitKey }),
4260
+ truncated
4261
+ }
4262
+ };
4263
+ }
4264
+ function normalizeMissionItemUpdate(raw) {
4265
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return { error: "update must be an object" };
4266
+ const r = raw;
4267
+ const id2 = str(r.id ?? r.item_id ?? r.itemId);
4268
+ if (!id2) return { error: "update needs an item id" };
4269
+ const truncated = [];
4270
+ const update = { id: id2 };
4271
+ if (r.state !== void 0) {
4272
+ const state = str(r.state);
4273
+ if (!MISSION_ITEM_STATES.includes(state)) return { error: `invalid state '${state}'` };
4274
+ update.state = state;
4275
+ }
4276
+ if (typeof r.text === "string") {
4277
+ const text = collapse(r.text);
4278
+ if (text.length > MISSION_LIMITS.itemText) truncated.push("text");
4279
+ if (text) update.text = truncateMissionText(text, MISSION_LIMITS.itemText);
4280
+ }
4281
+ if (r.machine === null) update.machine = null;
4282
+ else if (typeof r.machine === "string") {
4283
+ const machine = collapse(r.machine);
4284
+ update.machine = machine ? truncateMissionText(machine, MISSION_LIMITS.machine) : null;
4285
+ }
4286
+ if (r.refs !== void 0) {
4287
+ const { refs, truncated: t } = normalizeMissionRefs(r.refs);
4288
+ if (t) truncated.push("refs");
4289
+ update.refs = refs;
4290
+ }
4291
+ return { update, truncated };
4292
+ }
4293
+ function boundEventPayload(payload) {
4294
+ let json = JSON.stringify(payload);
4295
+ if (json.length <= MISSION_LIMITS.eventPayloadBytes) return json;
4296
+ const shrunk = {};
4297
+ for (const [k, v] of Object.entries(payload)) {
4298
+ shrunk[k] = typeof v === "string" && v.length > 4e3 ? `${v.slice(0, 4e3)}\u2026` : v;
4299
+ }
4300
+ shrunk.payloadTruncated = true;
4301
+ json = JSON.stringify(shrunk);
4302
+ if (json.length <= MISSION_LIMITS.eventPayloadBytes) return json;
4303
+ return JSON.stringify({ payloadTruncated: true, keys: Object.keys(payload).slice(0, 20) });
4304
+ }
4305
+ var CARRY_OVER_MISSION_TITLE = "Carry-over \u2014 open items from closed missions";
4306
+ var LEGACY_CARRY_OVER_MISSION_TITLE = "\uC774\uC6D4 \u2014 \uB2EB\uD78C \uBBF8\uC158\uC5D0\uC11C \uB118\uC5B4\uC628 \uD56D\uBAA9";
4307
+ var CARRY_OVER_MISSION_GOAL = "Open items carried over from closed missions, and decisions requested without a mission. Managed automatically \u2014 do not close.";
4308
+ function isCarryOverMissionRecord(m) {
4309
+ return !!m && (m.isCarryOver === true || isCarryOverMissionTitle(m.title));
4310
+ }
4311
+ function isCarryOverMissionTitle(title) {
4312
+ if (typeof title !== "string") return false;
4313
+ const t = title.trim();
4314
+ return t === CARRY_OVER_MISSION_TITLE || t === LEGACY_CARRY_OVER_MISSION_TITLE;
4315
+ }
4316
+ var OWNER_ABANDON_CONFIRM_KEY_PREFIX = "owner-abandon-confirm:";
4317
+ var OWNER_ABANDON_CONFIRM_QUESTION = "The coordinator closed this as 'owner abandoned' \u2014 correct?";
4318
+ var OWNER_ABANDON_CONFIRM_OPTIONS = ["Correct", "Reopen"];
4319
+ var WORKER_DECISIONS_NEEDED_MAX = 3;
4320
+ var WORKER_COMMITS_MAX = 20;
4321
+ var SHA_RE = /^[0-9a-f]{7,64}$/i;
4322
+ function normalizeReportCommits(value) {
4323
+ if (!Array.isArray(value)) return null;
4324
+ const out = [];
4325
+ for (const v of value) {
4326
+ if (typeof v !== "string") return null;
4327
+ const sha = v.trim();
4328
+ if (!SHA_RE.test(sha)) return null;
4329
+ if (!out.includes(sha.toLowerCase())) out.push(sha.toLowerCase());
4330
+ }
4331
+ return out;
4332
+ }
4333
+
4334
+ // src/mission-git-state.ts
4335
+ var MISSION_REF_GIT_STATUSES = ["contained_ancestor", "contained_patch_equivalent", "not_contained", "unknown"];
4336
+ var MISSION_REF_GIT_METHODS = ["ancestry", "cherry", "residual_patch"];
4337
+ var MISSION_GIT_STATES = ["no_refs", "landed", "partial", "not_landed", "unknown"];
4338
+ function isMissionRefContained(status) {
4339
+ return status === "contained_ancestor" || status === "contained_patch_equivalent";
4340
+ }
4341
+ function aggregateMissionGitState(statuses) {
4342
+ const total = statuses.length;
4343
+ const contained = statuses.filter(isMissionRefContained).length;
4344
+ const notContained = statuses.filter((s) => s === "not_contained").length;
4345
+ const unknown = statuses.filter((s) => s === "unknown").length;
4346
+ const counts = { total, contained, notContained, unknown };
4347
+ if (total === 0) return { state: "no_refs", partialUnknown: false, counts };
4348
+ if (contained === total) return { state: "landed", partialUnknown: false, counts };
4349
+ if (contained > 0) return { state: "partial", partialUnknown: unknown > 0, counts };
4350
+ if (notContained === total) return { state: "not_landed", partialUnknown: false, counts };
4351
+ return { state: "unknown", partialUnknown: false, counts };
4352
+ }
4353
+
4354
+ // src/release.ts
4355
+ var MESH_RELEASE_CHANNELS = ["preview", "stable"];
4356
+ function isMeshReleaseChannel(value) {
4357
+ return typeof value === "string" && MESH_RELEASE_CHANNELS.includes(value);
4358
+ }
4359
+ var MESH_RELEASE_STATUSES = ["planned", "frozen", "deployed", "verified", "superseded", "cancelled"];
4360
+ function isReleaseStatus(value) {
4361
+ return typeof value === "string" && MESH_RELEASE_STATUSES.includes(value);
4362
+ }
4363
+ var RELEASE_MEMBER_STATES = ["member", "moved_out", "removed"];
4364
+ var RELEASE_ACTORS = ["coordinator", "owner", "assistant", "script"];
4365
+ var RELEASE_EVENT_TYPES = [
4366
+ "created",
4367
+ "status_changed",
4368
+ "scope_added",
4369
+ "scope_moved",
4370
+ "scope_removed",
4371
+ "deploy_recorded",
4372
+ "changelog_drafted",
4373
+ "changelog_applied"
4374
+ ];
4375
+ var MISSION_RELEASE_EVENT_TYPES = ["release_attached", "release_moved", "release_detached"];
4376
+ var RELEASE_LIMITS = {
4377
+ name: 80,
4378
+ note: 500,
4379
+ /** `mesh_missions.release_note`: one user/operator-visible sentence. */
4380
+ releaseNote: 400,
4381
+ missionsPerCall: 100,
4382
+ changelogEntries: 300
4383
+ };
4384
+ var CHANGELOG_SECTIONS = ["Added", "Fixed", "Changed"];
4385
+ var NEEDS_WORDING_MARKER = "[needs user-facing wording]";
4386
+ function changelogMissionMarker(missionId) {
4387
+ return `<!-- m:${missionId.slice(0, 8)} -->`;
4388
+ }
4389
+ function classifyChangelogSection(text, hint) {
4390
+ const m = /^\s*\[(added|fixed|changed)\]\s*/i.exec(text);
4391
+ if (m) {
4392
+ const key = m[1].toLowerCase();
4393
+ return { section: key === "added" ? "Added" : key === "fixed" ? "Fixed" : "Changed", text: text.slice(m[0].length).trim() };
4394
+ }
4395
+ const probe = `${hint ?? ""} ${text}`.toLowerCase();
4396
+ if (/\b(fix|fixes|fixed|bug|regression|crash|error)\b|오류|결함|버그|수정/.test(probe)) return { section: "Fixed", text };
4397
+ if (/\b(add|adds|added|new|introduc\w*|support\w*)\b|신규|추가/.test(probe)) return { section: "Added", text };
4398
+ return { section: "Changed", text };
4399
+ }
4400
+ function lintChangelogText(text) {
4401
+ const out = [];
4402
+ if (/\bwave[\s-]*\d+/i.test(text) || /웨이브\s*\d+/.test(text)) out.push("mentions an internal wave number");
4403
+ if (/\brc[.\s-]?\d+\b/i.test(text)) out.push("mentions an internal rc number");
4404
+ if (/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i.test(text) || /\bmi_[0-9a-f]{12}\b/.test(text) || /\brel_[0-9a-f]{12}\b/.test(text)) out.push("contains an internal id");
4405
+ if (/\bmission\b/i.test(text)) out.push('mentions "mission" (internal vocabulary)');
4406
+ return out;
4407
+ }
4408
+
4409
+ // src/decision-push-relay.ts
4410
+ var DECISION_PUSH_RELAY_COMMAND = "mission_decision_push_relay_answer";
4411
+ var DECISION_PUSH_RELAY_SOURCE = "push_relay";
4412
+
3510
4413
  // src/keyed-doc-delta.ts
3511
4414
  function sig(value) {
3512
4415
  if (value === void 0) return void 0;
@@ -3727,7 +4630,15 @@ function foldKeyedDoc(held, delta, spec) {
3727
4630
  const heldList = heldCollections.get(path);
3728
4631
  if (change?.absent) {
3729
4632
  const [head2, tail2] = splitPath(path);
3730
- if (!tail2) delete next[head2];
4633
+ if (!tail2) {
4634
+ delete next[head2];
4635
+ continue;
4636
+ }
4637
+ const parent2 = next[head2];
4638
+ if (!isRecord3(parent2) || !(tail2 in parent2)) continue;
4639
+ const copy = { ...parent2 };
4640
+ delete copy[tail2];
4641
+ next[head2] = copy;
3731
4642
  continue;
3732
4643
  }
3733
4644
  if (!change && heldList === void 0) continue;
@@ -3791,9 +4702,482 @@ function stableMeshNodeRow(row) {
3791
4702
  }
3792
4703
  return out;
3793
4704
  }
4705
+
4706
+ // src/provider-approval.ts
4707
+ function isActionableProviderApproval(approval) {
4708
+ return !!approval && approval.source === "provider_modal" && approval.type === "tool_permission" && approval.lifecycle === "pending" && approval.evidence === "live" && approval.actionable && !!approval.modalKey && Array.isArray(approval.buttons) && approval.buttons.some((button) => typeof button === "string" && !!button.trim());
4709
+ }
4710
+ function readProviderDecision(approval, waiting, hasModal = false) {
4711
+ if (approval !== void 0) return approval && ["provider_modal", "legacy_provider", "status_only", "ledger_approval"].includes(approval.source) ? approval : null;
4712
+ if (!waiting) return null;
4713
+ return {
4714
+ source: hasModal ? "legacy_provider" : "status_only",
4715
+ type: "unknown",
4716
+ compatibility: hasModal ? "session_only" : "unknown",
4717
+ evidence: "unavailable",
4718
+ lifecycle: "pending",
4719
+ modalKey: null,
4720
+ createdAt: null,
4721
+ resolvedAt: null,
4722
+ description: "",
4723
+ buttons: [],
4724
+ actionable: false
4725
+ };
4726
+ }
4727
+ function providerApprovalSnapshot(approval) {
4728
+ if (!approval) return null;
4729
+ const {
4730
+ source,
4731
+ type,
4732
+ lifecycle,
4733
+ modalKey,
4734
+ createdAt,
4735
+ resolvedAt,
4736
+ providerType,
4737
+ sessionId,
4738
+ nodeId,
4739
+ meshId,
4740
+ taskId,
4741
+ attemptId,
4742
+ generation
4743
+ } = approval;
4744
+ return {
4745
+ source,
4746
+ type,
4747
+ lifecycle,
4748
+ modalKey,
4749
+ createdAt,
4750
+ resolvedAt,
4751
+ providerType,
4752
+ sessionId,
4753
+ nodeId,
4754
+ meshId,
4755
+ taskId,
4756
+ attemptId,
4757
+ generation,
4758
+ evidence: "cached",
4759
+ actionable: false,
4760
+ description: "",
4761
+ buttons: []
4762
+ };
4763
+ }
4764
+
4765
+ // src/provider-question.ts
4766
+ function isProviderQuestionBinding(value) {
4767
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
4768
+ const b = value;
4769
+ if (b.transport !== "codex_rpc" && b.transport !== "codex_async") return false;
4770
+ const keys = ["transport", "sessionId", "generation", "threadId", "turnId", "itemId", ...b.transport === "codex_rpc" ? ["requestId"] : []];
4771
+ if (Reflect.ownKeys(b).some((key) => typeof key !== "string" || !keys.includes(key))) return false;
4772
+ if (["sessionId", "generation", "threadId", "turnId", "itemId"].some((key) => typeof b[key] !== "string" || !b[key].trim())) return false;
4773
+ return b.transport === "codex_async" ? b.requestId === void 0 : typeof b.requestId === "string" && !!b.requestId.trim() || typeof b.requestId === "number" && Number.isFinite(b.requestId);
4774
+ }
4775
+
4776
+ // src/task-source-phase.ts
4777
+ function reviewIndependenceOf(review) {
4778
+ return review.independence ?? "different_provider";
4779
+ }
4780
+
4781
+ // src/light-task.ts
4782
+ var LIGHT_REJECT = {
4783
+ REQUIRES_LOCAL_BASE: "light_requires_local_base",
4784
+ NOT_CONFIGURED: "light_workspace_not_configured",
4785
+ REQUIRES_OWNED_PATHS: "light_requires_owned_paths",
4786
+ MODE_CONFLICT: "light_mode_conflict"
4787
+ };
4788
+ var LIGHT_HOLD = {
4789
+ PREPARE_FAILED: "light_workspace_prepare_failed",
4790
+ LIMIT: "light_workspace_limit",
4791
+ DISK_LOW: "light_workspace_disk_low",
4792
+ CAP: "max_light_parallel_tasks_reached"
4793
+ };
4794
+ var LIGHT_BLOCK_REASONS = [
4795
+ "light_uncommitted_changes",
4796
+ "light_dependency_change",
4797
+ "light_lineage_unproven",
4798
+ "shared_checkout_mutated"
4799
+ ];
4800
+ var LIGHT_WARNINGS = ["shared_checkout_changed_during_task", "light_base_dirty_overlap"];
4801
+ var LIGHT_LAND_MODES = ["refine", "apply_to_checkout"];
4802
+ var LIGHT_TESTS_RUN_MAX = 20;
4803
+ function isLightWorkerSession(session) {
4804
+ const s = session;
4805
+ if (!s || typeof s !== "object") return false;
4806
+ const has = (o) => !!o && typeof o === "object" && typeof o.lightWorkspaceId === "string" && o.lightWorkspaceId.trim() !== "";
4807
+ return has(s.settings) || has(s.launchRecord?.settings) || has(s);
4808
+ }
4809
+
4810
+ // src/relay-reprobe.ts
4811
+ var RELAY_REPROBE_BASE_DELAY_MS = 6e4;
4812
+ var RELAY_REPROBE_MAX_DELAY_MS = 5 * 6e4;
4813
+ var RELAY_REPROBE_JITTER_RATIO = 0.2;
4814
+ function computeRelayReprobeDelay(failures, random, timing = {}) {
4815
+ const base = timing.baseDelayMs ?? RELAY_REPROBE_BASE_DELAY_MS;
4816
+ const max = timing.maxDelayMs ?? RELAY_REPROBE_MAX_DELAY_MS;
4817
+ const jitter = timing.jitterRatio ?? RELAY_REPROBE_JITTER_RATIO;
4818
+ const grown = Math.min(max, base * 2 ** Math.max(0, failures));
4819
+ const factor = 1 + jitter * (Math.min(1, Math.max(0, random())) * 2 - 1);
4820
+ return Math.round(grown * factor);
4821
+ }
4822
+ var RelayReprobeScheduler = class {
4823
+ constructor(options) {
4824
+ this.options = options;
4825
+ }
4826
+ handle = null;
4827
+ running = false;
4828
+ inFlight = false;
4829
+ failureCount = 0;
4830
+ generation = 0;
4831
+ get isRunning() {
4832
+ return this.running;
4833
+ }
4834
+ get failures() {
4835
+ return this.failureCount;
4836
+ }
4837
+ get probing() {
4838
+ return this.inFlight;
4839
+ }
4840
+ /** Begin probing (idempotent). Call when a connection is selected as relay. */
4841
+ start() {
4842
+ if (this.running) return;
4843
+ this.running = true;
4844
+ this.failureCount = 0;
4845
+ this.generation++;
4846
+ this.schedule();
4847
+ }
4848
+ /** Stop for good (direct path found, connection closed, auth epoch changed). */
4849
+ stop() {
4850
+ this.running = false;
4851
+ this.generation++;
4852
+ if (this.handle !== null) {
4853
+ this.options.clearTimer(this.handle);
4854
+ this.handle = null;
4855
+ }
4856
+ }
4857
+ schedule() {
4858
+ if (!this.running) return;
4859
+ const generation = this.generation;
4860
+ const delay = computeRelayReprobeDelay(this.failureCount, this.options.random, this.options);
4861
+ this.handle = this.options.setTimer(() => {
4862
+ this.handle = null;
4863
+ void this.tick(generation);
4864
+ }, delay);
4865
+ }
4866
+ async tick(generation) {
4867
+ if (!this.running || generation !== this.generation) return;
4868
+ if (this.inFlight || !this.options.shouldProbe()) {
4869
+ this.schedule();
4870
+ return;
4871
+ }
4872
+ this.inFlight = true;
4873
+ let outcome;
4874
+ try {
4875
+ outcome = await this.options.probe();
4876
+ } catch {
4877
+ outcome = "failed";
4878
+ }
4879
+ this.inFlight = false;
4880
+ if (!this.running || generation !== this.generation) return;
4881
+ if (outcome === "direct") {
4882
+ this.stop();
4883
+ return;
4884
+ }
4885
+ if (outcome !== "skipped") this.failureCount++;
4886
+ this.schedule();
4887
+ }
4888
+ };
4889
+
4890
+ // src/task-stages.ts
4891
+ var REVIEW_VERDICTS = ["approve", "approve_with_nits", "changes_requested", "reject_approach"];
4892
+ var FINDING_SEVERITIES = ["blocking", "major", "minor", "nit"];
4893
+ var FINDING_CATEGORIES = ["correctness", "regression", "test_gap", "scope", "security", "performance", "maintainability"];
4894
+ var PRIOR_FINDING_STATUSES = ["resolved", "unresolved", "dispute_accepted", "dispute_rejected"];
4895
+ var FINDING_RESPONSE_KINDS = ["fixed", "disputed"];
4896
+ var STAGE_PHASES = ["implementing", "self_checking", "awaiting_review", "reviewing", "revising", "done"];
4897
+ var STAGE_PARKED_PHASES = ["self_checking", "awaiting_review", "reviewing"];
4898
+ var STAGE_INDEPENDENCE_MODES = ["different_provider", "fresh_session_ok"];
4899
+ var STAGE_ROLES = ["implement", "revise", "review"];
4900
+ var STAGE_BLOCKED_REASONS = [
4901
+ "review_unresolved",
4902
+ "review_rejected_approach",
4903
+ "review_unavailable",
4904
+ "self_check_failed",
4905
+ "stage_pipeline_ceiling",
4906
+ "reviewer_mutated_source",
4907
+ // The read-lease checkout could not be fingerprinted (start or end): the review's integrity cannot be verified.
4908
+ "reviewer_integrity_unverifiable"
4909
+ ];
4910
+ var STAGE_DECIDE_ACTIONS = ["accept", "revise_once", "rereview", "abandon"];
4911
+ var STAGE_MAX_REVISIONS_LIMIT = 3;
4912
+ var STAGE_DEFAULT_MAX_REVISIONS = 2;
4913
+ var STAGE_SELF_CHECK_MAX_BOUNCES = 2;
4914
+ var STAGE_INDEPENDENCE_FALLBACK_MS = 10 * 60 * 1e3;
4915
+ var STAGE_PIPELINE_CEILING_DEFAULT_MS = 4 * 60 * 60 * 1e3;
4916
+ var REVIEW_FINDINGS_MAX = 30;
4917
+ var REVIEW_CLAIM_MAX_CHARS = 500;
4918
+ var REVIEW_EVIDENCE_MAX_CHARS = 1e3;
4919
+ var REVIEW_FIX_MAX_CHARS = 500;
4920
+ var REVIEW_FINDING_ID_MAX_CHARS = 40;
4921
+ var REVIEW_CHECKED_MAX = 20;
4922
+ var REVIEW_NOTE_MAX_CHARS = 500;
4923
+ var REVIEW_TESTS_RUN_MAX = 20;
4924
+ var FINDING_RESPONSES_MAX = 30;
4925
+ function makeGuard4(values) {
4926
+ const set = new Set(values);
4927
+ return (value) => typeof value === "string" && set.has(value);
4928
+ }
4929
+ var isReviewVerdict = makeGuard4(REVIEW_VERDICTS);
4930
+ var isFindingSeverity = makeGuard4(FINDING_SEVERITIES);
4931
+ var isFindingCategory = makeGuard4(FINDING_CATEGORIES);
4932
+ var isPriorFindingStatus = makeGuard4(PRIOR_FINDING_STATUSES);
4933
+ var isFindingResponseKind = makeGuard4(FINDING_RESPONSE_KINDS);
4934
+ var isStageBlockedReason = makeGuard4(STAGE_BLOCKED_REASONS);
4935
+ var isRecord4 = (v) => !!v && typeof v === "object" && !Array.isArray(v);
4936
+ function isBlockingSeverity(severity) {
4937
+ return severity === "blocking" || severity === "major";
4938
+ }
4939
+ function resolveStagePlan(raw, task, opts = {}) {
4940
+ const eligible = isStageEligibleTask(task);
4941
+ if (raw === void 0 || raw === null) return (opts.defaultOn ?? true) && defaultsOnFor(task) ? defaultStagePlan() : null;
4942
+ if (raw === false) return null;
4943
+ if (raw === true) {
4944
+ if (!eligible) throw new Error(`invalid_review_option: review requires a non-readonly code_change task (got taskMode=${task.taskMode ?? "unset"}${task.readonly ? ", readonly" : ""})`);
4945
+ return defaultStagePlan();
4946
+ }
4947
+ if (!isRecord4(raw)) throw new Error("invalid_review_option: review must be true, false or {max_revisions?, independence?}");
4948
+ const allowed = /* @__PURE__ */ new Set(["max_revisions", "maxRevisions", "independence"]);
4949
+ for (const key of Object.keys(raw)) {
4950
+ if (!allowed.has(key)) throw new Error(`invalid_review_option: unknown review key '${key}' (expected max_revisions, independence)`);
4951
+ }
4952
+ if (!eligible) throw new Error(`invalid_review_option: review requires a non-readonly code_change task (got taskMode=${task.taskMode ?? "unset"}${task.readonly ? ", readonly" : ""})`);
4953
+ const rawMax = raw.max_revisions ?? raw.maxRevisions;
4954
+ let maxRevisions = STAGE_DEFAULT_MAX_REVISIONS;
4955
+ if (rawMax !== void 0) {
4956
+ if (typeof rawMax !== "number" || !Number.isInteger(rawMax) || rawMax < 0 || rawMax > STAGE_MAX_REVISIONS_LIMIT) {
4957
+ throw new Error(`invalid_review_option: max_revisions must be an integer 0..${STAGE_MAX_REVISIONS_LIMIT}`);
4958
+ }
4959
+ maxRevisions = rawMax;
4960
+ }
4961
+ let independence = "fresh_session_ok";
4962
+ if (raw.independence !== void 0) {
4963
+ if (!STAGE_INDEPENDENCE_MODES.includes(raw.independence)) {
4964
+ throw new Error(`invalid_review_option: independence must be one of ${STAGE_INDEPENDENCE_MODES.join(" | ")}`);
4965
+ }
4966
+ independence = raw.independence;
4967
+ }
4968
+ return { review: true, maxRevisions, independence };
4969
+ }
4970
+ function defaultStagePlan() {
4971
+ return { review: true, maxRevisions: STAGE_DEFAULT_MAX_REVISIONS, independence: "fresh_session_ok" };
4972
+ }
4973
+ function isStageEligibleTask(task) {
4974
+ if (task.readonly) return false;
4975
+ return (task.taskMode ?? "code_change") === "code_change";
4976
+ }
4977
+ function defaultsOnFor(task) {
4978
+ return isStageEligibleTask(task) && (task.difficulty === "medium" || task.difficulty === "difficult");
4979
+ }
4980
+ function str2(value) {
4981
+ return typeof value === "string" ? value.trim() : "";
4982
+ }
4983
+ function validateStringList(value, field, max, maxChars, errors, minItems = 0) {
4984
+ if (!Array.isArray(value)) {
4985
+ errors.push({ field, message: `${field} must be an array of strings` });
4986
+ return [];
4987
+ }
4988
+ if (value.length > max) errors.push({ field, message: `${field} has ${value.length} entries, over the ${max} limit` });
4989
+ const out = [];
4990
+ for (const item of value) {
4991
+ const text = str2(item);
4992
+ if (!text) continue;
4993
+ if (text.length > maxChars) {
4994
+ errors.push({ field, message: `${field} contains an entry over ${maxChars} chars` });
4995
+ continue;
4996
+ }
4997
+ out.push(text);
4998
+ }
4999
+ if (out.length < minItems) errors.push({ field, message: `${field} needs at least ${minItems} entry \u2014 an empty ${field} list is a review with no recorded scope` });
5000
+ return out;
5001
+ }
5002
+ function validateReviewReport(raw, ctx) {
5003
+ const errors = [];
5004
+ if (!isRecord4(raw)) return { errors: [{ field: "review", message: "review must be an object {verdict, findings, checked, notChecked, ...}" }] };
5005
+ const KNOWN = /* @__PURE__ */ new Set(["verdict", "findings", "priorFindings", "checked", "notChecked", "testsRun"]);
5006
+ for (const key of Object.keys(raw)) if (!KNOWN.has(key)) errors.push({ field: `review.${key}`, message: `unknown field '${key}' (expected one of: ${[...KNOWN].join(", ")})` });
5007
+ const verdict = raw.verdict;
5008
+ if (!isReviewVerdict(verdict)) errors.push({ field: "review.verdict", message: `verdict must be one of ${REVIEW_VERDICTS.join(" | ")}` });
5009
+ const findings = [];
5010
+ if (!Array.isArray(raw.findings)) errors.push({ field: "review.findings", message: "findings must be an array (use [] when there are none)" });
5011
+ else {
5012
+ if (raw.findings.length > REVIEW_FINDINGS_MAX) errors.push({ field: "review.findings", message: `findings has ${raw.findings.length} entries, over the ${REVIEW_FINDINGS_MAX} limit \u2014 keep the most important` });
5013
+ const seen = /* @__PURE__ */ new Set();
5014
+ raw.findings.forEach((f, i) => {
5015
+ const at = `review.findings[${i}]`;
5016
+ if (!isRecord4(f)) {
5017
+ errors.push({ field: at, message: "each finding must be an object" });
5018
+ return;
5019
+ }
5020
+ const FK = /* @__PURE__ */ new Set(["id", "severity", "category", "file", "line", "claim", "evidence", "suggestedFix"]);
5021
+ for (const key of Object.keys(f)) if (!FK.has(key)) errors.push({ field: `${at}.${key}`, message: `unknown field '${key}'` });
5022
+ const id2 = str2(f.id);
5023
+ if (!id2 || id2.length > REVIEW_FINDING_ID_MAX_CHARS) errors.push({ field: `${at}.id`, message: `id is required (\u2264 ${REVIEW_FINDING_ID_MAX_CHARS} chars)` });
5024
+ else if (seen.has(id2)) errors.push({ field: `${at}.id`, message: `duplicate finding id '${id2}'` });
5025
+ else seen.add(id2);
5026
+ if (!isFindingSeverity(f.severity)) errors.push({ field: `${at}.severity`, message: `severity must be one of ${FINDING_SEVERITIES.join(" | ")}` });
5027
+ if (!isFindingCategory(f.category)) errors.push({ field: `${at}.category`, message: `category must be one of ${FINDING_CATEGORIES.join(" | ")}` });
5028
+ const claim = str2(f.claim);
5029
+ if (!claim) errors.push({ field: `${at}.claim`, message: "claim is required" });
5030
+ else if (claim.length > REVIEW_CLAIM_MAX_CHARS) errors.push({ field: `${at}.claim`, message: `claim is over ${REVIEW_CLAIM_MAX_CHARS} chars` });
5031
+ const evidence = str2(f.evidence);
5032
+ if (!evidence) errors.push({ field: `${at}.evidence`, message: "evidence is required \u2014 what did you read or run to know this" });
5033
+ else if (evidence.length > REVIEW_EVIDENCE_MAX_CHARS) errors.push({ field: `${at}.evidence`, message: `evidence is over ${REVIEW_EVIDENCE_MAX_CHARS} chars` });
5034
+ const fix = f.suggestedFix === void 0 ? void 0 : str2(f.suggestedFix);
5035
+ if (fix !== void 0 && fix.length > REVIEW_FIX_MAX_CHARS) errors.push({ field: `${at}.suggestedFix`, message: `suggestedFix is over ${REVIEW_FIX_MAX_CHARS} chars` });
5036
+ if (f.file !== void 0 && typeof f.file !== "string") errors.push({ field: `${at}.file`, message: "file must be a string" });
5037
+ if (f.line !== void 0 && (typeof f.line !== "number" || !Number.isInteger(f.line) || f.line < 1)) errors.push({ field: `${at}.line`, message: "line must be a positive integer" });
5038
+ if (id2 && isFindingSeverity(f.severity) && isFindingCategory(f.category) && claim && evidence) {
5039
+ findings.push({
5040
+ id: id2,
5041
+ severity: f.severity,
5042
+ category: f.category,
5043
+ ...typeof f.file === "string" && f.file.trim() ? { file: f.file.trim() } : {},
5044
+ ...typeof f.line === "number" ? { line: f.line } : {},
5045
+ claim,
5046
+ evidence,
5047
+ ...fix ? { suggestedFix: fix } : {}
5048
+ });
5049
+ }
5050
+ });
5051
+ }
5052
+ const checked = validateStringList(raw.checked, "review.checked", REVIEW_CHECKED_MAX, REVIEW_CLAIM_MAX_CHARS, errors, 1);
5053
+ const notChecked = validateStringList(raw.notChecked, "review.notChecked", REVIEW_CHECKED_MAX, REVIEW_CLAIM_MAX_CHARS, errors, 1);
5054
+ let priorFindings;
5055
+ if (raw.priorFindings !== void 0) {
5056
+ if (!Array.isArray(raw.priorFindings)) errors.push({ field: "review.priorFindings", message: "priorFindings must be an array" });
5057
+ else {
5058
+ priorFindings = [];
5059
+ raw.priorFindings.forEach((p, i) => {
5060
+ const at = `review.priorFindings[${i}]`;
5061
+ if (!isRecord4(p)) {
5062
+ errors.push({ field: at, message: "each entry must be an object {id, status, note?}" });
5063
+ return;
5064
+ }
5065
+ for (const key of Object.keys(p)) if (!["id", "status", "note"].includes(key)) errors.push({ field: `${at}.${key}`, message: `unknown field '${key}'` });
5066
+ const id2 = str2(p.id);
5067
+ if (!id2) errors.push({ field: `${at}.id`, message: "id is required" });
5068
+ if (!isPriorFindingStatus(p.status)) errors.push({ field: `${at}.status`, message: `status must be one of ${PRIOR_FINDING_STATUSES.join(" | ")}` });
5069
+ const note = p.note === void 0 ? void 0 : str2(p.note);
5070
+ if (note !== void 0 && note.length > REVIEW_NOTE_MAX_CHARS) errors.push({ field: `${at}.note`, message: `note is over ${REVIEW_NOTE_MAX_CHARS} chars` });
5071
+ if (id2 && isPriorFindingStatus(p.status)) priorFindings.push({ id: id2, status: p.status, ...note ? { note } : {} });
5072
+ });
5073
+ }
5074
+ }
5075
+ const testsRun = raw.testsRun === void 0 ? void 0 : validateTestsRun(raw.testsRun, "review.testsRun", errors);
5076
+ if (isReviewVerdict(verdict)) {
5077
+ const blocking = findings.filter((f) => isBlockingSeverity(f.severity));
5078
+ if (verdict === "changes_requested" && blocking.length === 0 && Array.isArray(raw.findings) && errors.length === 0) {
5079
+ errors.push({ field: "review.verdict", message: "changes_requested needs at least one blocking or major finding \u2014 nits alone are approve_with_nits" });
5080
+ }
5081
+ if (verdict === "approve" && blocking.length > 0) {
5082
+ errors.push({ field: "review.verdict", message: "approve cannot carry blocking or major findings" });
5083
+ }
5084
+ if (verdict === "approve_with_nits" && blocking.length > 0) {
5085
+ errors.push({ field: "review.verdict", message: "approve_with_nits cannot carry blocking or major findings \u2014 use changes_requested" });
5086
+ }
5087
+ }
5088
+ if (ctx.round >= 2 && ctx.priorOpenBlockingIds?.length) {
5089
+ const answered = new Set((priorFindings ?? []).map((p) => p.id));
5090
+ const missing = ctx.priorOpenBlockingIds.filter((id2) => !answered.has(id2));
5091
+ if (missing.length) errors.push({ field: "review.priorFindings", message: `round ${ctx.round} must give a status for every prior blocking/major finding; missing: ${missing.join(", ")}` });
5092
+ }
5093
+ if (errors.length) return { errors };
5094
+ return {
5095
+ report: {
5096
+ verdict,
5097
+ findings,
5098
+ ...priorFindings?.length ? { priorFindings } : {},
5099
+ checked,
5100
+ notChecked,
5101
+ ...testsRun?.length ? { testsRun } : {}
5102
+ },
5103
+ errors: []
5104
+ };
5105
+ }
5106
+ function validateTestsRun(raw, field, errors) {
5107
+ if (!Array.isArray(raw)) {
5108
+ errors.push({ field, message: `${field} must be an array of {command, exit, passed?, failed?, note?}` });
5109
+ return [];
5110
+ }
5111
+ if (raw.length > REVIEW_TESTS_RUN_MAX) errors.push({ field, message: `${field} has ${raw.length} entries, over the ${REVIEW_TESTS_RUN_MAX} limit` });
5112
+ const out = [];
5113
+ raw.forEach((t, i) => {
5114
+ const at = `${field}[${i}]`;
5115
+ if (!isRecord4(t)) {
5116
+ errors.push({ field: at, message: "each entry must be an object" });
5117
+ return;
5118
+ }
5119
+ for (const key of Object.keys(t)) if (!["command", "exit", "passed", "failed", "note"].includes(key)) errors.push({ field: `${at}.${key}`, message: `unknown field '${key}'` });
5120
+ const command = str2(t.command);
5121
+ if (!command || command.length > REVIEW_CLAIM_MAX_CHARS) errors.push({ field: `${at}.command`, message: `command is required (\u2264 ${REVIEW_CLAIM_MAX_CHARS} chars)` });
5122
+ if (typeof t.exit !== "number" || !Number.isInteger(t.exit)) errors.push({ field: `${at}.exit`, message: "exit must be an integer" });
5123
+ for (const k of ["passed", "failed"]) {
5124
+ if (t[k] !== void 0 && (typeof t[k] !== "number" || !Number.isInteger(t[k]) || t[k] < 0)) errors.push({ field: `${at}.${k}`, message: `${k} must be a non-negative integer` });
5125
+ }
5126
+ const note = t.note === void 0 ? void 0 : str2(t.note);
5127
+ if (note !== void 0 && note.length > REVIEW_NOTE_MAX_CHARS) errors.push({ field: `${at}.note`, message: `note is over ${REVIEW_NOTE_MAX_CHARS} chars` });
5128
+ if (command && typeof t.exit === "number") {
5129
+ out.push({
5130
+ command,
5131
+ exit: t.exit,
5132
+ ...typeof t.passed === "number" ? { passed: t.passed } : {},
5133
+ ...typeof t.failed === "number" ? { failed: t.failed } : {},
5134
+ ...note ? { note } : {}
5135
+ });
5136
+ }
5137
+ });
5138
+ return out;
5139
+ }
5140
+ function validateFindingResponses(raw, field = "findingResponses") {
5141
+ const errors = [];
5142
+ if (!Array.isArray(raw)) return { errors: [{ field, message: `${field} must be an array of {id, response, note}` }] };
5143
+ if (raw.length > FINDING_RESPONSES_MAX) errors.push({ field, message: `${field} has ${raw.length} entries, over the ${FINDING_RESPONSES_MAX} limit` });
5144
+ const out = [];
5145
+ raw.forEach((r, i) => {
5146
+ const at = `${field}[${i}]`;
5147
+ if (!isRecord4(r)) {
5148
+ errors.push({ field: at, message: "each entry must be an object {id, response, note}" });
5149
+ return;
5150
+ }
5151
+ for (const key of Object.keys(r)) if (!["id", "response", "note"].includes(key)) errors.push({ field: `${at}.${key}`, message: `unknown field '${key}'` });
5152
+ const id2 = str2(r.id);
5153
+ if (!id2) errors.push({ field: `${at}.id`, message: "id is required" });
5154
+ if (!isFindingResponseKind(r.response)) errors.push({ field: `${at}.response`, message: `response must be one of ${FINDING_RESPONSE_KINDS.join(" | ")}` });
5155
+ const note = str2(r.note);
5156
+ if (!note) errors.push({ field: `${at}.note`, message: "note is required \u2014 say what changed, or why you dispute it" });
5157
+ else if (note.length > REVIEW_NOTE_MAX_CHARS) errors.push({ field: `${at}.note`, message: `note is over ${REVIEW_NOTE_MAX_CHARS} chars` });
5158
+ if (id2 && isFindingResponseKind(r.response) && note && note.length <= REVIEW_NOTE_MAX_CHARS) out.push({ id: id2, response: r.response, note });
5159
+ });
5160
+ return errors.length ? { errors } : { responses: out, errors: [] };
5161
+ }
5162
+ function formatStageVerdictLine(input) {
5163
+ const parts = [`review: ${input.verdict}`];
5164
+ if (input.verdict === "skipped_no_diff") return parts[0];
5165
+ parts.push(`${input.rounds} round${input.rounds === 1 ? "" : "s"}`);
5166
+ if (input.reviewerProvider) parts.push(`reviewer ${input.reviewerProvider} (${input.independenceUsed ?? "different_provider"})`);
5167
+ const tail = [];
5168
+ if (input.fixed) tail.push(`${input.fixed} finding${input.fixed === 1 ? "" : "s"} fixed`);
5169
+ if (input.openNits) tail.push(`${input.openNits} nit${input.openNits === 1 ? "" : "s"} open`);
5170
+ return tail.length ? `${parts.join(" \xB7 ")} \xB7 ${tail.join(", ")}` : parts.join(" \xB7 ");
5171
+ }
3794
5172
  // Annotate the CommonJS export names for ESM import in node:
3795
5173
  0 && (module.exports = {
5174
+ ASSISTANT_ACCOUNT_SLOT,
5175
+ ASSISTANT_FOLLOWER_ALLOWED_OPS,
3796
5176
  ASSISTANT_OWNER_VERBS,
5177
+ ASSISTANT_REMOTE_FOLLOW_COMMAND,
5178
+ ASSISTANT_REMOTE_PROJECT_ACCESS_COMMAND,
5179
+ ASSISTANT_REMOTE_PROJECT_CATALOG_COMMAND,
5180
+ ASSISTANT_REMOTE_PROJECT_COMMAND,
3797
5181
  ASSISTANT_REVIEW_TURN_VERBS,
3798
5182
  ASSISTANT_SESSION_ID_ARG,
3799
5183
  ASSISTANT_SESSION_ID_ENV,
@@ -3805,12 +5189,16 @@ function stableMeshNodeRow(row) {
3805
5189
  CANCEL_REASONS,
3806
5190
  CANONICAL_MESH_TOOL_COUNT,
3807
5191
  CANONICAL_MESH_TOOL_NAMES,
5192
+ CARRY_OVER_MISSION_GOAL,
5193
+ CARRY_OVER_MISSION_TITLE,
5194
+ CHANGELOG_SECTIONS,
3808
5195
  CLAUDE_TUI_REVIEW_PAGE_NOT_FOCUSED_PREFIX,
3809
5196
  CLAUDE_TUI_REVIEW_UNCONFIRMED_PREFIX,
3810
5197
  CLI_SLOT_RECIPES,
3811
5198
  COMMIT_STRENGTHS,
3812
5199
  CONSUME_PROFILES,
3813
5200
  COORDINATOR_ACK_OUTCOMES,
5201
+ COORDINATOR_SETTABLE_ITEM_STATES,
3814
5202
  DAEMON_METADATA_DOC_SPEC,
3815
5203
  DAEMON_P2P_SIGNAL_TYPES,
3816
5204
  DAEMON_STATUS_EVENT_NAMES,
@@ -3823,13 +5211,34 @@ function stableMeshNodeRow(row) {
3823
5211
  DASHBOARD_TO_DAEMON_P2P_TYPES,
3824
5212
  DASHBOARD_TO_USER_SESSION_TYPES,
3825
5213
  DASHBOARD_WIRE_VERSION,
5214
+ DECISION_PUSH_OPTIONS_MAX,
5215
+ DECISION_PUSH_OPTION_LABEL_MAX,
5216
+ DECISION_PUSH_QUESTION_MAX,
5217
+ DECISION_PUSH_RELAY_COMMAND,
5218
+ DECISION_PUSH_RELAY_SOURCE,
3826
5219
  DEFAULT_DIFFICULTY_BRAINS,
3827
5220
  DELIVERY_OUTCOMES,
3828
5221
  DELIVERY_VIAS,
3829
5222
  DISPATCH_FAILURE_REASONS,
5223
+ DISPATCH_REFUSAL_DETAIL_MAX,
3830
5224
  EVIDENCE_ENVELOPE_FIELD_SPECS,
3831
5225
  EVIDENCE_SOURCE_IDS,
5226
+ FINDING_CATEGORIES,
5227
+ FINDING_RESPONSES_MAX,
5228
+ FINDING_RESPONSE_KINDS,
5229
+ FINDING_SEVERITIES,
3832
5230
  HOLD_REASONS,
5231
+ LAUNCH_DEFAULTS_NEXT_LAUNCH_NOTE,
5232
+ LAUNCH_DEFAULT_ERROR_CODES,
5233
+ LAUNCH_DEFAULT_ROLES,
5234
+ LAUNCH_DEFAULT_SOURCES,
5235
+ LEGACY_CARRY_OVER_MISSION_TITLE,
5236
+ LIGHT_BLOCK_REASONS,
5237
+ LIGHT_HOLD,
5238
+ LIGHT_LAND_MODES,
5239
+ LIGHT_REJECT,
5240
+ LIGHT_TESTS_RUN_MAX,
5241
+ LIGHT_WARNINGS,
3833
5242
  LIVENESS_RESULTS,
3834
5243
  MAX_MESH_RECORD_STRING,
3835
5244
  MAX_OWNED_PATHS,
@@ -3844,6 +5253,8 @@ function stableMeshNodeRow(row) {
3844
5253
  MESH_MISSION_STATUSES,
3845
5254
  MESH_P2P_SIGNAL_TYPES,
3846
5255
  MESH_RECORD_PAYLOAD_KEYS,
5256
+ MESH_RELEASE_CHANNELS,
5257
+ MESH_RELEASE_STATUSES,
3847
5258
  MESH_SESSION_CLEANUP_MODES,
3848
5259
  MESH_STATUS_DOC_SPEC,
3849
5260
  MESH_TASK_DIFFICULTIES,
@@ -3855,10 +5266,23 @@ function stableMeshNodeRow(row) {
3855
5266
  MESH_TOPIC_ENTRY_KINDS,
3856
5267
  MESH_TOPIC_PROTOCOL_VERSION,
3857
5268
  MISSION_BRIEF_RENDER_MAX_CHARS,
5269
+ MISSION_DECISION_ON_DUE,
5270
+ MISSION_DECISION_OPTION_IDS,
5271
+ MISSION_DECISION_URGENCIES,
5272
+ MISSION_GIT_STATES,
5273
+ MISSION_ITEM_KINDS,
5274
+ MISSION_ITEM_STATES,
5275
+ MISSION_LIMITS,
5276
+ MISSION_OUTCOMES,
5277
+ MISSION_REF_GIT_METHODS,
5278
+ MISSION_REF_GIT_STATUSES,
5279
+ MISSION_REF_KINDS,
5280
+ MISSION_RELEASE_EVENT_TYPES,
3858
5281
  MODEL_AXIS_SOURCES,
3859
5282
  MODEL_SELECTION_HISTORY_LIMIT,
3860
5283
  MeshChunkAssembler,
3861
5284
  NATIVE_TURN_OUTCOMES,
5285
+ NEEDS_WORDING_MARKER,
3862
5286
  NOTIFY_KINDS,
3863
5287
  NO_PROGRESS_OBSERVED_STATUSES,
3864
5288
  NPM_UPDATE_TAGS,
@@ -3868,16 +5292,37 @@ function stableMeshNodeRow(row) {
3868
5292
  OPERATOR_STATUS_REASON_VALUES,
3869
5293
  OPERATOR_STATUS_VALUES,
3870
5294
  OUTBOUND_MESSAGE_ORIGINS,
5295
+ OWNER_ABANDON_CONFIRM_KEY_PREFIX,
5296
+ OWNER_ABANDON_CONFIRM_OPTIONS,
5297
+ OWNER_ABANDON_CONFIRM_QUESTION,
3871
5298
  P2P_SIGNAL_TYPES,
5299
+ PRIOR_FINDING_STATUSES,
3872
5300
  PROVIDER_FAILURES,
3873
5301
  QUOTA_BACKFILL_HORIZON_MS,
3874
5302
  QUOTA_RETRY_INFLIGHT_GRACE_MS,
3875
5303
  QUOTA_SUPPORTED_PROVIDERS,
3876
5304
  RECENT_SESSION_BUCKETS,
3877
5305
  RECLAIMING_SEND_REFUSALS,
5306
+ RELAY_REPROBE_BASE_DELAY_MS,
5307
+ RELAY_REPROBE_JITTER_RATIO,
5308
+ RELAY_REPROBE_MAX_DELAY_MS,
5309
+ RELEASE_ACTORS,
3878
5310
  RELEASE_CHANNELS,
5311
+ RELEASE_EVENT_TYPES,
5312
+ RELEASE_LIMITS,
5313
+ RELEASE_MEMBER_STATES,
3879
5314
  REMOVED_MESH_TOOLS,
3880
5315
  RETIRED_MESH_TOOLS,
5316
+ REVIEW_CHECKED_MAX,
5317
+ REVIEW_CLAIM_MAX_CHARS,
5318
+ REVIEW_EVIDENCE_MAX_CHARS,
5319
+ REVIEW_FINDINGS_MAX,
5320
+ REVIEW_FINDING_ID_MAX_CHARS,
5321
+ REVIEW_FIX_MAX_CHARS,
5322
+ REVIEW_NOTE_MAX_CHARS,
5323
+ REVIEW_TESTS_RUN_MAX,
5324
+ REVIEW_VERDICTS,
5325
+ RelayReprobeScheduler,
3881
5326
  SEND_POLICY_MODES,
3882
5327
  SEND_REFUSAL_REASONS,
3883
5328
  SERVER_STATUS_EVENT_NAMES,
@@ -3890,6 +5335,17 @@ function stableMeshNodeRow(row) {
3890
5335
  SESSION_STATUS_ALIASES,
3891
5336
  SESSION_STATUS_CLASS,
3892
5337
  SHARED_SESSION_TO_VIEWER_TYPES,
5338
+ STAGE_BLOCKED_REASONS,
5339
+ STAGE_DECIDE_ACTIONS,
5340
+ STAGE_DEFAULT_MAX_REVISIONS,
5341
+ STAGE_INDEPENDENCE_FALLBACK_MS,
5342
+ STAGE_INDEPENDENCE_MODES,
5343
+ STAGE_MAX_REVISIONS_LIMIT,
5344
+ STAGE_PARKED_PHASES,
5345
+ STAGE_PHASES,
5346
+ STAGE_PIPELINE_CEILING_DEFAULT_MS,
5347
+ STAGE_ROLES,
5348
+ STAGE_SELF_CHECK_MAX_BOUNCES,
3893
5349
  STATUS_PROBE_ARG_KEY,
3894
5350
  SUSPENSION_MODALS,
3895
5351
  SUSPENSION_RESOLUTIONS,
@@ -3915,17 +5371,27 @@ function stableMeshNodeRow(row) {
3915
5371
  VERSION_UPDATE_REASONS,
3916
5372
  VIEWER_TO_SHARED_SESSION_TYPES,
3917
5373
  WORKER_BRANCH_STATES,
5374
+ WORKER_COMMITS_MAX,
5375
+ WORKER_CURRENT_BRANCH_RULE,
5376
+ WORKER_DECISIONS_NEEDED_MAX,
3918
5377
  WORKER_PROTOCOL_FOOTER_MARKER,
3919
5378
  WORKER_REPORT_OUTCOMES,
5379
+ WORKER_REPORT_SUMMARY_MAX_CHARS,
5380
+ WORKER_SHELL_LITERAL_PATHS_RULE,
3920
5381
  WORKER_TOOLS,
5382
+ aggregateMissionGitState,
3921
5383
  appendWorkerProtocolFooter,
3922
5384
  argsCarryStatusProbeMarker,
3923
5385
  assessQuotaFreshness,
5386
+ boundEventPayload,
3924
5387
  buildSlotProposal,
3925
5388
  canonicalDaemonId,
5389
+ changelogMissionMarker,
5390
+ classifyChangelogSection,
3926
5391
  classifySessionStatus,
3927
5392
  compareDashboardWireVersion,
3928
5393
  compareSemver,
5394
+ computeRelayReprobeDelay,
3929
5395
  daemonIdsEquivalent,
3930
5396
  decodeActiveWorkQueryRequest,
3931
5397
  decodeActiveWorkQueryResponse,
@@ -3968,6 +5434,8 @@ function stableMeshNodeRow(row) {
3968
5434
  decodeQueueQueryResponse,
3969
5435
  decodeQueueRequeueRequest,
3970
5436
  decodeQueueRequeueResponse,
5437
+ decodeQueueReviseRequest,
5438
+ decodeQueueReviseResponse,
3971
5439
  decodeRecordLocalRequest,
3972
5440
  decodeRecordLocalResponse,
3973
5441
  decodeRecoveryContextQueryRequest,
@@ -3987,6 +5455,8 @@ function stableMeshNodeRow(row) {
3987
5455
  decodeUserSessionToDashboard,
3988
5456
  decodeViewerToSharedSession,
3989
5457
  defaultProviderPriorityFromNodeFacts,
5458
+ defaultStagePlan,
5459
+ deriveItemDedupeKey,
3990
5460
  deriveProviderPriorityFromSlots,
3991
5461
  deriveSlotsFromLegacy,
3992
5462
  describeModelSelection,
@@ -3997,13 +5467,21 @@ function stableMeshNodeRow(row) {
3997
5467
  expandDaemonIdForms,
3998
5468
  findOwnershipConflicts,
3999
5469
  foldKeyedDoc,
5470
+ followedRemoteProjectKey,
5471
+ followerOpPermitted,
4000
5472
  formatQuotaAccount,
5473
+ formatStageVerdictLine,
4001
5474
  hasGitStatusEvidence,
4002
5475
  hasWorkerProtocolFooter,
4003
5476
  interpolateString,
5477
+ isActionableProviderApproval,
5478
+ isAssistantFollowerAllowedOp,
4004
5479
  isAssistantTool,
4005
5480
  isBlockedStatus,
5481
+ isBlockingSeverity,
4006
5482
  isBusyStatus,
5483
+ isCarryOverMissionRecord,
5484
+ isCarryOverMissionTitle,
4007
5485
  isChunkType,
4008
5486
  isCommitStrength,
4009
5487
  isDaemonDirectCommandType,
@@ -4019,14 +5497,21 @@ function stableMeshNodeRow(row) {
4019
5497
  isDeadStatus,
4020
5498
  isDowngrade,
4021
5499
  isEvidenceIdentifier,
5500
+ isFindingCategory,
5501
+ isFindingResponseKind,
5502
+ isFindingSeverity,
4022
5503
  isFiniteNumber,
4023
5504
  isIdleSessionState,
4024
5505
  isInputEnvelopeWire,
5506
+ isLaunchDefaultRole,
5507
+ isLaunchDefaultSource,
5508
+ isLightWorkerSession,
4025
5509
  isMeshDeliveryMode,
4026
5510
  isMeshIndexQueryResponse,
4027
5511
  isMeshMissionStatusValue,
4028
5512
  isMeshP2PSignalType,
4029
5513
  isMeshRecordPayload,
5514
+ isMeshReleaseChannel,
4030
5515
  isMeshTaskDifficulty,
4031
5516
  isMeshTaskMode,
4032
5517
  isMeshTaskPriority,
@@ -4034,17 +5519,24 @@ function stableMeshNodeRow(row) {
4034
5519
  isMeshTerminalTaskStatus,
4035
5520
  isMeshTopicEntry,
4036
5521
  isMessageId,
5522
+ isMissionOutcome,
5523
+ isMissionRefContained,
4037
5524
  isMissionUpsertResponse,
4038
5525
  isModelAxisSource,
5526
+ isNativeMarkerRef,
4039
5527
  isNonEmptyString,
4040
5528
  isNotifyKind,
4041
5529
  isOutboundMessage,
4042
5530
  isOutboundMessageOrigin,
4043
5531
  isP2PSignalType,
4044
5532
  isPhantomDaemonEntry,
5533
+ isPriorFindingStatus,
5534
+ isProviderQuestionBinding,
4045
5535
  isRawDaemonDoId,
4046
5536
  isReadyStatus,
4047
5537
  isRecord,
5538
+ isReleaseStatus,
5539
+ isReviewVerdict,
4048
5540
  isSendPolicy,
4049
5541
  isSendPolicyMode,
4050
5542
  isSendRefusal,
@@ -4053,6 +5545,8 @@ function stableMeshNodeRow(row) {
4053
5545
  isSessionLaunchedBy,
4054
5546
  isSessionStatus,
4055
5547
  isSharedSessionToViewerType,
5548
+ isStageBlockedReason,
5549
+ isStageEligibleTask,
4056
5550
  isSubmitOutcome,
4057
5551
  isSummaryRef,
4058
5552
  isTerminalSessionRecordStatus,
@@ -4071,6 +5565,7 @@ function stableMeshNodeRow(row) {
4071
5565
  isWorkingStatus,
4072
5566
  joinRepoPath,
4073
5567
  launchModelSelectionValue,
5568
+ lintChangelogText,
4074
5569
  machineCoreFromDaemonId,
4075
5570
  makeTypeGuard,
4076
5571
  measureWorstCaseChunkEnvelopeBytes,
@@ -4082,41 +5577,58 @@ function stableMeshNodeRow(row) {
4082
5577
  minutesUntilQuotaCheck,
4083
5578
  normalizeAuthOkLimits,
4084
5579
  normalizeBrainSlot,
5580
+ normalizeDecisionInput,
4085
5581
  normalizeDifficultyBrainMap,
5582
+ normalizeForDedupe,
4086
5583
  normalizeGitStatus,
4087
5584
  normalizeMeshNodeFacts,
4088
5585
  normalizeMeshNodeId,
4089
5586
  normalizeMeshSessionRecord,
4090
5587
  normalizeMeshWorkspaceForCompare,
4091
5588
  normalizeMissionBrief,
5589
+ normalizeMissionItemInput,
5590
+ normalizeMissionItemUpdate,
5591
+ normalizeMissionRefs,
5592
+ normalizeMissionSummary,
4092
5593
  normalizeNodeCapabilitySlot,
4093
5594
  normalizeNodeCapabilitySlots,
5595
+ normalizeOutcomeReason,
4094
5596
  normalizeOwnedPaths,
5597
+ normalizeReportCommits,
4095
5598
  normalizeSessionStatus,
4096
5599
  normalizeThinkingLevel,
4097
5600
  orderProvidersByBuiltinPreference,
4098
5601
  parseJsonRecord,
5602
+ parseRoleLaunchSelection,
4099
5603
  parseSemver,
4100
5604
  parseSessionLaunchRecord,
4101
5605
  pathsOverlap,
4102
5606
  pickBestTransitGitStatus,
4103
5607
  projectFileDiffRow,
4104
5608
  projectTurnEvidenceEntry,
5609
+ providerApprovalSnapshot,
4105
5610
  readBoolean,
4106
5611
  readEnvelopeFields,
4107
5612
  readGitSubmodules,
4108
5613
  readNumber,
4109
5614
  readOptionalRecord,
5615
+ readProviderDecision,
4110
5616
  readRecord,
4111
5617
  readString,
4112
5618
  readStringArray,
4113
5619
  readText,
4114
5620
  renderCoordinatorWorkerSection,
5621
+ renderLightWorkspaceRules,
4115
5622
  renderMissionBriefBlock,
5623
+ renderStageProtocolLines,
4116
5624
  renderWorkerProtocolFooter,
5625
+ resolveStagePlan,
4117
5626
  retiredMeshToolError,
5627
+ reviewIndependenceOf,
5628
+ sanitizeDispatchRefusalDetail,
4118
5629
  sanitizeModelIdentifier,
4119
5630
  sanitizeRefusalCode,
5631
+ sanitizeRemoteRepoIdentity,
4120
5632
  scoreGitStatusCandidate,
4121
5633
  scoreGitUpstreamFreshness,
4122
5634
  sessionIdsEquivalent,
@@ -4127,6 +5639,11 @@ function stableMeshNodeRow(row) {
4127
5639
  summarizeGitShape,
4128
5640
  supportsQuota,
4129
5641
  touchedFilesOutsideOwnership,
5642
+ truncateMissionText,
5643
+ unwrapPastedContent,
5644
+ validateFindingResponses,
5645
+ validateReviewReport,
5646
+ validateTestsRun,
4130
5647
  withStatusProbeMarker
4131
5648
  });
4132
5649
  //# sourceMappingURL=index.js.map