@adhdev/mesh-shared 1.0.82-rc.13 → 1.0.82-rc.131

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 (60) hide show
  1. package/dist/assistant-protocol.d.ts +158 -6
  2. package/dist/decision-push-relay.d.ts +20 -0
  3. package/dist/index.d.ts +10 -0
  4. package/dist/index.js +1524 -110
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +1391 -110
  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 +6 -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 +35 -1
  15. package/dist/outbound-message.d.ts +9 -2
  16. package/dist/protocol/daemon-server.d.ts +42 -2
  17. package/dist/protocol/dashboard-daemon-p2p.d.ts +1 -1
  18. package/dist/protocol/dashboard-server.d.ts +20 -2
  19. package/dist/quota-freshness.d.ts +4 -4
  20. package/dist/relay-reprobe.d.ts +52 -0
  21. package/dist/release.d.ts +90 -0
  22. package/dist/role-launch.d.ts +11 -0
  23. package/dist/session-launch.d.ts +10 -22
  24. package/dist/slot-proposal.d.ts +14 -0
  25. package/dist/task-source-phase.d.ts +83 -0
  26. package/dist/task-stages.d.ts +210 -0
  27. package/dist/turn-evidence.d.ts +26 -8
  28. package/dist/turn-ipc-mission.d.ts +72 -1
  29. package/dist/turn-ipc-queue.d.ts +30 -0
  30. package/dist/turn-ipc.d.ts +2 -2
  31. package/dist/worker-protocol.d.ts +41 -1
  32. package/package.json +1 -1
  33. package/src/assistant-protocol.ts +294 -6
  34. package/src/daemon-normalize.ts +7 -5
  35. package/src/decision-push-relay.ts +23 -0
  36. package/src/index.ts +11 -0
  37. package/src/launch-defaults.ts +170 -0
  38. package/src/light-task.ts +116 -0
  39. package/src/mesh-tool-names.ts +22 -0
  40. package/src/mesh-vocabulary.ts +4 -2
  41. package/src/mission-git-state.ts +112 -0
  42. package/src/mission-items.ts +421 -0
  43. package/src/node-facts.ts +35 -1
  44. package/src/outbound-message.ts +19 -0
  45. package/src/protocol/daemon-server.ts +37 -2
  46. package/src/protocol/dashboard-server.ts +13 -2
  47. package/src/quota-freshness.ts +22 -11
  48. package/src/relay-reprobe.ts +117 -0
  49. package/src/release.ts +121 -0
  50. package/src/role-launch.ts +51 -0
  51. package/src/session-launch.ts +17 -1
  52. package/src/slot-proposal.ts +61 -2
  53. package/src/task-source-phase.ts +70 -0
  54. package/src/task-stages.ts +459 -0
  55. package/src/turn-evidence.ts +42 -4
  56. package/src/turn-ipc-mission.ts +127 -11
  57. package/src/turn-ipc-queue.ts +45 -2
  58. package/src/turn-ipc-turn.ts +1 -1
  59. package/src/turn-ipc.ts +1 -0
  60. 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,18 +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,
147
228
  WORKER_REPORT_SUMMARY_MAX_CHARS: () => WORKER_REPORT_SUMMARY_MAX_CHARS,
229
+ WORKER_SHELL_LITERAL_PATHS_RULE: () => WORKER_SHELL_LITERAL_PATHS_RULE,
148
230
  WORKER_TOOLS: () => WORKER_TOOLS,
231
+ aggregateMissionGitState: () => aggregateMissionGitState,
149
232
  appendWorkerProtocolFooter: () => appendWorkerProtocolFooter,
150
233
  argsCarryStatusProbeMarker: () => argsCarryStatusProbeMarker,
151
234
  assessQuotaFreshness: () => assessQuotaFreshness,
235
+ boundEventPayload: () => boundEventPayload,
152
236
  buildSlotProposal: () => buildSlotProposal,
153
237
  canonicalDaemonId: () => canonicalDaemonId,
238
+ changelogMissionMarker: () => changelogMissionMarker,
239
+ classifyChangelogSection: () => classifyChangelogSection,
154
240
  classifySessionStatus: () => classifySessionStatus,
155
241
  compareDashboardWireVersion: () => compareDashboardWireVersion,
156
242
  compareSemver: () => compareSemver,
243
+ computeRelayReprobeDelay: () => computeRelayReprobeDelay,
157
244
  daemonIdsEquivalent: () => daemonIdsEquivalent,
158
245
  decodeActiveWorkQueryRequest: () => decodeActiveWorkQueryRequest,
159
246
  decodeActiveWorkQueryResponse: () => decodeActiveWorkQueryResponse,
@@ -196,6 +283,8 @@ __export(index_exports, {
196
283
  decodeQueueQueryResponse: () => decodeQueueQueryResponse,
197
284
  decodeQueueRequeueRequest: () => decodeQueueRequeueRequest,
198
285
  decodeQueueRequeueResponse: () => decodeQueueRequeueResponse,
286
+ decodeQueueReviseRequest: () => decodeQueueReviseRequest,
287
+ decodeQueueReviseResponse: () => decodeQueueReviseResponse,
199
288
  decodeRecordLocalRequest: () => decodeRecordLocalRequest,
200
289
  decodeRecordLocalResponse: () => decodeRecordLocalResponse,
201
290
  decodeRecoveryContextQueryRequest: () => decodeRecoveryContextQueryRequest,
@@ -215,6 +304,8 @@ __export(index_exports, {
215
304
  decodeUserSessionToDashboard: () => decodeUserSessionToDashboard,
216
305
  decodeViewerToSharedSession: () => decodeViewerToSharedSession,
217
306
  defaultProviderPriorityFromNodeFacts: () => defaultProviderPriorityFromNodeFacts,
307
+ defaultStagePlan: () => defaultStagePlan,
308
+ deriveItemDedupeKey: () => deriveItemDedupeKey,
218
309
  deriveProviderPriorityFromSlots: () => deriveProviderPriorityFromSlots,
219
310
  deriveSlotsFromLegacy: () => deriveSlotsFromLegacy,
220
311
  describeModelSelection: () => describeModelSelection,
@@ -225,14 +316,21 @@ __export(index_exports, {
225
316
  expandDaemonIdForms: () => expandDaemonIdForms,
226
317
  findOwnershipConflicts: () => findOwnershipConflicts,
227
318
  foldKeyedDoc: () => foldKeyedDoc,
319
+ followedRemoteProjectKey: () => followedRemoteProjectKey,
320
+ followerOpPermitted: () => followerOpPermitted,
228
321
  formatQuotaAccount: () => formatQuotaAccount,
322
+ formatStageVerdictLine: () => formatStageVerdictLine,
229
323
  hasGitStatusEvidence: () => hasGitStatusEvidence,
230
324
  hasWorkerProtocolFooter: () => hasWorkerProtocolFooter,
231
325
  interpolateString: () => interpolateString,
232
326
  isActionableProviderApproval: () => isActionableProviderApproval,
327
+ isAssistantFollowerAllowedOp: () => isAssistantFollowerAllowedOp,
233
328
  isAssistantTool: () => isAssistantTool,
234
329
  isBlockedStatus: () => isBlockedStatus,
330
+ isBlockingSeverity: () => isBlockingSeverity,
235
331
  isBusyStatus: () => isBusyStatus,
332
+ isCarryOverMissionRecord: () => isCarryOverMissionRecord,
333
+ isCarryOverMissionTitle: () => isCarryOverMissionTitle,
236
334
  isChunkType: () => isChunkType,
237
335
  isCommitStrength: () => isCommitStrength,
238
336
  isDaemonDirectCommandType: () => isDaemonDirectCommandType,
@@ -248,14 +346,21 @@ __export(index_exports, {
248
346
  isDeadStatus: () => isDeadStatus,
249
347
  isDowngrade: () => isDowngrade,
250
348
  isEvidenceIdentifier: () => isEvidenceIdentifier,
349
+ isFindingCategory: () => isFindingCategory,
350
+ isFindingResponseKind: () => isFindingResponseKind,
351
+ isFindingSeverity: () => isFindingSeverity,
251
352
  isFiniteNumber: () => isFiniteNumber,
252
353
  isIdleSessionState: () => isIdleSessionState,
253
354
  isInputEnvelopeWire: () => isInputEnvelopeWire,
355
+ isLaunchDefaultRole: () => isLaunchDefaultRole,
356
+ isLaunchDefaultSource: () => isLaunchDefaultSource,
357
+ isLightWorkerSession: () => isLightWorkerSession,
254
358
  isMeshDeliveryMode: () => isMeshDeliveryMode,
255
359
  isMeshIndexQueryResponse: () => isMeshIndexQueryResponse,
256
360
  isMeshMissionStatusValue: () => isMeshMissionStatusValue,
257
361
  isMeshP2PSignalType: () => isMeshP2PSignalType,
258
362
  isMeshRecordPayload: () => isMeshRecordPayload,
363
+ isMeshReleaseChannel: () => isMeshReleaseChannel,
259
364
  isMeshTaskDifficulty: () => isMeshTaskDifficulty,
260
365
  isMeshTaskMode: () => isMeshTaskMode,
261
366
  isMeshTaskPriority: () => isMeshTaskPriority,
@@ -263,6 +368,8 @@ __export(index_exports, {
263
368
  isMeshTerminalTaskStatus: () => isMeshTerminalTaskStatus,
264
369
  isMeshTopicEntry: () => isMeshTopicEntry,
265
370
  isMessageId: () => isMessageId,
371
+ isMissionOutcome: () => isMissionOutcome,
372
+ isMissionRefContained: () => isMissionRefContained,
266
373
  isMissionUpsertResponse: () => isMissionUpsertResponse,
267
374
  isModelAxisSource: () => isModelAxisSource,
268
375
  isNativeMarkerRef: () => isNativeMarkerRef,
@@ -272,10 +379,13 @@ __export(index_exports, {
272
379
  isOutboundMessageOrigin: () => isOutboundMessageOrigin,
273
380
  isP2PSignalType: () => isP2PSignalType,
274
381
  isPhantomDaemonEntry: () => isPhantomDaemonEntry,
382
+ isPriorFindingStatus: () => isPriorFindingStatus,
275
383
  isProviderQuestionBinding: () => isProviderQuestionBinding,
276
384
  isRawDaemonDoId: () => isRawDaemonDoId,
277
385
  isReadyStatus: () => isReadyStatus,
278
386
  isRecord: () => isRecord,
387
+ isReleaseStatus: () => isReleaseStatus,
388
+ isReviewVerdict: () => isReviewVerdict,
279
389
  isSendPolicy: () => isSendPolicy,
280
390
  isSendPolicyMode: () => isSendPolicyMode,
281
391
  isSendRefusal: () => isSendRefusal,
@@ -284,6 +394,8 @@ __export(index_exports, {
284
394
  isSessionLaunchedBy: () => isSessionLaunchedBy,
285
395
  isSessionStatus: () => isSessionStatus,
286
396
  isSharedSessionToViewerType: () => isSharedSessionToViewerType,
397
+ isStageBlockedReason: () => isStageBlockedReason,
398
+ isStageEligibleTask: () => isStageEligibleTask,
287
399
  isSubmitOutcome: () => isSubmitOutcome,
288
400
  isSummaryRef: () => isSummaryRef,
289
401
  isTerminalSessionRecordStatus: () => isTerminalSessionRecordStatus,
@@ -302,6 +414,7 @@ __export(index_exports, {
302
414
  isWorkingStatus: () => isWorkingStatus,
303
415
  joinRepoPath: () => joinRepoPath,
304
416
  launchModelSelectionValue: () => launchModelSelectionValue,
417
+ lintChangelogText: () => lintChangelogText,
305
418
  machineCoreFromDaemonId: () => machineCoreFromDaemonId,
306
419
  makeTypeGuard: () => makeTypeGuard,
307
420
  measureWorstCaseChunkEnvelopeBytes: () => measureWorstCaseChunkEnvelopeBytes,
@@ -313,20 +426,29 @@ __export(index_exports, {
313
426
  minutesUntilQuotaCheck: () => minutesUntilQuotaCheck,
314
427
  normalizeAuthOkLimits: () => normalizeAuthOkLimits,
315
428
  normalizeBrainSlot: () => normalizeBrainSlot,
429
+ normalizeDecisionInput: () => normalizeDecisionInput,
316
430
  normalizeDifficultyBrainMap: () => normalizeDifficultyBrainMap,
431
+ normalizeForDedupe: () => normalizeForDedupe,
317
432
  normalizeGitStatus: () => normalizeGitStatus,
318
433
  normalizeMeshNodeFacts: () => normalizeMeshNodeFacts,
319
434
  normalizeMeshNodeId: () => normalizeMeshNodeId,
320
435
  normalizeMeshSessionRecord: () => normalizeMeshSessionRecord,
321
436
  normalizeMeshWorkspaceForCompare: () => normalizeMeshWorkspaceForCompare,
322
437
  normalizeMissionBrief: () => normalizeMissionBrief,
438
+ normalizeMissionItemInput: () => normalizeMissionItemInput,
439
+ normalizeMissionItemUpdate: () => normalizeMissionItemUpdate,
440
+ normalizeMissionRefs: () => normalizeMissionRefs,
441
+ normalizeMissionSummary: () => normalizeMissionSummary,
323
442
  normalizeNodeCapabilitySlot: () => normalizeNodeCapabilitySlot,
324
443
  normalizeNodeCapabilitySlots: () => normalizeNodeCapabilitySlots,
444
+ normalizeOutcomeReason: () => normalizeOutcomeReason,
325
445
  normalizeOwnedPaths: () => normalizeOwnedPaths,
446
+ normalizeReportCommits: () => normalizeReportCommits,
326
447
  normalizeSessionStatus: () => normalizeSessionStatus,
327
448
  normalizeThinkingLevel: () => normalizeThinkingLevel,
328
449
  orderProvidersByBuiltinPreference: () => orderProvidersByBuiltinPreference,
329
450
  parseJsonRecord: () => parseJsonRecord,
451
+ parseRoleLaunchSelection: () => parseRoleLaunchSelection,
330
452
  parseSemver: () => parseSemver,
331
453
  parseSessionLaunchRecord: () => parseSessionLaunchRecord,
332
454
  pathsOverlap: () => pathsOverlap,
@@ -345,11 +467,17 @@ __export(index_exports, {
345
467
  readStringArray: () => readStringArray,
346
468
  readText: () => readText,
347
469
  renderCoordinatorWorkerSection: () => renderCoordinatorWorkerSection,
470
+ renderLightWorkspaceRules: () => renderLightWorkspaceRules,
348
471
  renderMissionBriefBlock: () => renderMissionBriefBlock,
472
+ renderStageProtocolLines: () => renderStageProtocolLines,
349
473
  renderWorkerProtocolFooter: () => renderWorkerProtocolFooter,
474
+ resolveStagePlan: () => resolveStagePlan,
350
475
  retiredMeshToolError: () => retiredMeshToolError,
476
+ reviewIndependenceOf: () => reviewIndependenceOf,
477
+ sanitizeDispatchRefusalDetail: () => sanitizeDispatchRefusalDetail,
351
478
  sanitizeModelIdentifier: () => sanitizeModelIdentifier,
352
479
  sanitizeRefusalCode: () => sanitizeRefusalCode,
480
+ sanitizeRemoteRepoIdentity: () => sanitizeRemoteRepoIdentity,
353
481
  scoreGitStatusCandidate: () => scoreGitStatusCandidate,
354
482
  scoreGitUpstreamFreshness: () => scoreGitUpstreamFreshness,
355
483
  sessionIdsEquivalent: () => sessionIdsEquivalent,
@@ -360,6 +488,11 @@ __export(index_exports, {
360
488
  summarizeGitShape: () => summarizeGitShape,
361
489
  supportsQuota: () => supportsQuota,
362
490
  touchedFilesOutsideOwnership: () => touchedFilesOutsideOwnership,
491
+ truncateMissionText: () => truncateMissionText,
492
+ unwrapPastedContent: () => unwrapPastedContent,
493
+ validateFindingResponses: () => validateFindingResponses,
494
+ validateReviewReport: () => validateReviewReport,
495
+ validateTestsRun: () => validateTestsRun,
363
496
  withStatusProbeMarker: () => withStatusProbeMarker
364
497
  });
365
498
  module.exports = __toCommonJS(index_exports);
@@ -560,15 +693,15 @@ function pickBestTransitGitStatus(node, options) {
560
693
  }
561
694
 
562
695
  // src/session-normalize.ts
563
- function deriveSyntheticSessionId(record) {
696
+ function deriveSyntheticSessionId(record2) {
564
697
  const parts = [
565
- readString(record.workspace),
566
- readString(record.providerType, record.provider),
567
- readString(record.role),
568
- readString(record.state, record.status),
569
- readString(record.title),
570
- readString(record.createdAt, record.created_at),
571
- 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)
572
705
  ].filter((part) => Boolean(part));
573
706
  if (parts.length === 0) return void 0;
574
707
  return `synthetic:${parts.join("|")}`;
@@ -580,33 +713,33 @@ function sessionIdsEquivalent(a, b) {
580
713
  return idA === idB;
581
714
  }
582
715
  function normalizeMeshSessionRecord(entry) {
583
- const record = readRecord(entry);
584
- 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);
585
718
  if (!sessionId) return null;
586
719
  return {
587
720
  sessionId,
588
- ...readString(record.providerType, record.provider) ? { providerType: readString(record.providerType, record.provider) } : {},
589
- ...readString(record.state, record.status) ? { state: readString(record.state, record.status) } : {},
590
- ...readString(record.chatStatus, record.chat_status) ? { chatStatus: readString(record.chatStatus, record.chat_status) } : {},
591
- ...readString(record.lifecycle) ? { lifecycle: readString(record.lifecycle) } : {},
592
- ...readString(record.surfaceKind, record.surface_kind) ? { surfaceKind: readString(record.surfaceKind, record.surface_kind) } : {},
593
- ...readString(record.recoveryState, record.recovery_state) ? { recoveryState: readString(record.recoveryState, record.recovery_state) } : {},
594
- ...readString(record.workspace) ? { workspace: readString(record.workspace) } : {},
595
- ...readString(record.title) ? { title: readString(record.title) } : {},
596
- ...readString(record.role) ? { role: readString(record.role) } : {},
597
- ...readBoolean(record.isSelfCoordinator, record.is_self_coordinator) !== void 0 ? { isSelfCoordinator: readBoolean(record.isSelfCoordinator, record.is_self_coordinator) } : {},
598
- ...readString(record.statusNote, record.status_note) ? { statusNote: readString(record.statusNote, record.status_note) } : {},
599
- ...readString(record.createdAt, record.created_at) ? { createdAt: readString(record.createdAt, record.created_at) } : {},
600
- ...readString(record.startedAt, record.started_at) ? { startedAt: readString(record.startedAt, record.started_at) } : {},
601
- ...readString(record.lastActivityAt, record.last_activity_at) ? { lastActivityAt: readString(record.lastActivityAt, record.last_activity_at) } : {},
602
- ...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) } : {}
603
736
  };
604
737
  }
605
738
 
606
739
  // src/node-normalize.ts
607
740
  function normalizeMeshNodeId(node) {
608
- const record = node && typeof node === "object" ? node : {};
609
- 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);
610
743
  }
611
744
  function meshNodeIdMatches(node, candidateId) {
612
745
  if (!candidateId) return false;
@@ -618,12 +751,12 @@ function meshNodeIdMatches(node, candidateId) {
618
751
  // src/node-facts.ts
619
752
  function normalizeMeshNodeFacts(raw) {
620
753
  if (!raw || typeof raw !== "object" || Array.isArray(raw)) return void 0;
621
- const record = raw;
622
- const schemaVersion = Number(record.schemaVersion);
623
- const reportedAt = Number(record.reportedAt);
754
+ const record2 = raw;
755
+ const schemaVersion = Number(record2.schemaVersion);
756
+ const reportedAt = Number(record2.reportedAt);
624
757
  if (!Number.isFinite(schemaVersion) || schemaVersion < 1) return void 0;
625
758
  if (!Number.isFinite(reportedAt) || reportedAt <= 0) return void 0;
626
- return { ...record, schemaVersion, reportedAt };
759
+ return { ...record2, schemaVersion, reportedAt };
627
760
  }
628
761
  var QUOTA_SUPPORTED_PROVIDERS = [
629
762
  "antigravity-cli",
@@ -691,9 +824,17 @@ function backfillCheckAt(quota, now) {
691
824
  function assessQuotaFreshness(quota, now = Date.now()) {
692
825
  const meta = quota.metadata;
693
826
  const kind = meta?.failureKind;
694
- const userMustAct = kind === "no-data" && quota.provider !== "codex-cli" || kind === "expired-token" && quota.provider === "antigravity-cli";
695
- if (userMustAct && hasReading(quota)) return { cue: "stale", userMustAct: true };
696
- 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
+ }
697
838
  const retryAtMs = finiteMs(meta?.retryAtMs);
698
839
  const retryStopped = meta?.retryExhausted === true || retryAtMs !== void 0 && retryAtMs + QUOTA_RETRY_INFLIGHT_GRACE_MS < now;
699
840
  if (kind !== "no-data" && !retryStopped) return { cue: "refreshing", userMustAct: false };
@@ -733,19 +874,21 @@ function isPhantomDaemonEntry(entry) {
733
874
  function machineCoreFromDaemonId(id2) {
734
875
  const trimmed = readString(id2);
735
876
  if (!trimmed) return void 0;
877
+ const lower = trimmed.toLowerCase();
736
878
  for (const prefix of DAEMON_ID_PREFIXES) {
737
- if (trimmed.startsWith(prefix)) {
879
+ if (lower.startsWith(prefix)) {
738
880
  const core = trimmed.slice(prefix.length).trim();
739
- return core || void 0;
881
+ if (!core) return void 0;
882
+ return /^mach_/i.test(core) ? `mach_${core.slice(5)}` : core;
740
883
  }
741
884
  }
742
- return trimmed;
885
+ return /^mach_/i.test(trimmed) ? `mach_${trimmed.slice(5)}` : trimmed;
743
886
  }
744
887
  function canonicalDaemonId(id2) {
745
888
  const core = machineCoreFromDaemonId(id2);
746
889
  if (!core) return void 0;
747
- if (!core.startsWith("mach_")) return core;
748
- return `daemon_${core}`;
890
+ if (!/^mach_/i.test(core)) return core;
891
+ return `daemon_mach_${core.slice(5)}`;
749
892
  }
750
893
  function daemonIdsEquivalent(a, b) {
751
894
  const coreA = machineCoreFromDaemonId(a);
@@ -774,9 +917,9 @@ function expandDaemonIdForms(ids) {
774
917
 
775
918
  // src/git-summarize.ts
776
919
  function summarizeGitShape(status) {
777
- const record = readRecord(status);
778
- if (!Object.keys(record).length) return null;
779
- 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) => {
780
923
  const sub = readRecord(entry);
781
924
  return {
782
925
  path: readString(sub.path) ?? null,
@@ -786,23 +929,23 @@ function summarizeGitShape(status) {
786
929
  };
787
930
  }) : [];
788
931
  return {
789
- isGitRepo: readBoolean(record.isGitRepo),
790
- workspace: readString(record.workspace) ?? null,
791
- repoRoot: readString(record.repoRoot, record.repo_root) ?? null,
792
- branch: readString(record.branch) ?? null,
793
- upstream: readString(record.upstream) ?? null,
794
- upstreamStatus: readString(record.upstreamStatus, record.upstream_status) ?? null,
795
- headCommit: readString(record.headCommit, record.head_commit)?.slice(0, 12) ?? null,
796
- ahead: readNumber(record.ahead) ?? null,
797
- 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,
798
941
  dirtyCounts: {
799
- staged: readNumber(record.staged) ?? 0,
800
- modified: readNumber(record.modified) ?? 0,
801
- untracked: readNumber(record.untracked) ?? 0,
802
- deleted: readNumber(record.deleted) ?? 0,
803
- 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
804
947
  },
805
- lastCheckedAt: readNumber(record.lastCheckedAt, record.last_checked_at) ?? null,
948
+ lastCheckedAt: readNumber(record2.lastCheckedAt, record2.last_checked_at) ?? null,
806
949
  submoduleCount: submodules.length,
807
950
  submodules
808
951
  };
@@ -968,10 +1111,25 @@ var CLI_SLOT_RECIPES = Object.freeze({
968
1111
  ],
969
1112
  "antigravity-cli": [
970
1113
  {
971
- 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)"],
972
1116
  difficulty: ["easy"],
973
1117
  maxParallel: 2,
974
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."
975
1133
  }
976
1134
  ],
977
1135
  "cursor-cli": [
@@ -1010,6 +1168,24 @@ function dedupeDetected(detected) {
1010
1168
  }
1011
1169
  return out;
1012
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
+ }
1013
1189
  function buildSlotProposal(detected, currentSlots = []) {
1014
1190
  const providers = dedupeDetected(detected ?? []);
1015
1191
  const proposedSlots = [];
@@ -1025,7 +1201,7 @@ function buildSlotProposal(detected, currentSlots = []) {
1025
1201
  for (const recipe of recipes) {
1026
1202
  const slot = normalizeNodeCapabilitySlot({
1027
1203
  provider: provider.type,
1028
- model: recipe.model,
1204
+ model: resolveRecipeModel(recipe, provider.modelOptions),
1029
1205
  thinkingLevel: recipe.thinkingLevel,
1030
1206
  difficulty: recipe.difficulty,
1031
1207
  maxParallel: recipe.maxParallel
@@ -1078,7 +1254,12 @@ var CANONICAL_MESH_TOOL_NAMES = [
1078
1254
  "mesh_enqueue_task",
1079
1255
  "mesh_view_queue",
1080
1256
  "mesh_queue_cancel",
1257
+ "mesh_task_stage_decide",
1258
+ "mesh_direct_cancel",
1081
1259
  "mesh_queue_requeue",
1260
+ "mesh_queue_revise",
1261
+ "mesh_light_land",
1262
+ "mesh_light_discard",
1082
1263
  "mesh_send_task",
1083
1264
  "mesh_read_chat",
1084
1265
  "mesh_read_debug",
@@ -1095,8 +1276,13 @@ var CANONICAL_MESH_TOOL_NAMES = [
1095
1276
  "mesh_list_pending_approvals",
1096
1277
  "mesh_create",
1097
1278
  "mesh_add_node",
1279
+ "mesh_reattach_source_parent",
1280
+ "mesh_attach_remote",
1281
+ "mesh_host_pairing",
1098
1282
  "mesh_clone_node",
1099
1283
  "mesh_remove_node",
1284
+ "mesh_retry_node_bootstrap",
1285
+ "mesh_recover_node_identity",
1100
1286
  "mesh_cleanup_worktree_nodes",
1101
1287
  "mesh_refine_node",
1102
1288
  "mesh_refine_batch",
@@ -1113,8 +1299,20 @@ var CANONICAL_MESH_TOOL_NAMES = [
1113
1299
  "mesh_reconcile_ledger",
1114
1300
  "mesh_mission_upsert",
1115
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",
1116
1309
  "mesh_review_inbox",
1117
- "mesh_node_slots"
1310
+ "mesh_node_slots",
1311
+ "driver_list",
1312
+ "driver_describe",
1313
+ "artifact_list",
1314
+ "artifact_read",
1315
+ "artifact_register"
1118
1316
  ];
1119
1317
  var CANONICAL_MESH_TOOL_COUNT = CANONICAL_MESH_TOOL_NAMES.length;
1120
1318
  var RETIRED_MESH_TOOLS = {
@@ -1424,9 +1622,15 @@ var DAEMON_STATUS_EVENT_NAMES = [
1424
1622
  "agent:waiting_choice",
1425
1623
  "agent:generating_completed",
1426
1624
  "agent:stopped",
1427
- "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"
1428
1629
  ];
1429
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;
1430
1634
  var RELEASE_CHANNELS = ["stable", "preview"];
1431
1635
  var NPM_UPDATE_TAGS = ["latest", "next"];
1432
1636
  var VERSION_UPDATE_REASONS = ["force_update_below", "major_minor_mismatch", "patch_mismatch", "daemon_ahead"];
@@ -1789,15 +1993,15 @@ function isTerminalSessionRecordStatus(raw) {
1789
1993
  return typeof raw === "string" && TERMINAL_SESSION_RECORD_STATUSES.includes(raw.trim().toLowerCase());
1790
1994
  }
1791
1995
  function isIdleSessionState(state) {
1792
- const record = state && typeof state === "object" ? state : {};
1793
- 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() : "";
1794
1998
  if (isTerminalSessionRecordStatus(status) || isDeadStatus(status)) return false;
1795
- return isReadyStatus(status) || record.activeChat?.status === "waiting_input";
1999
+ return isReadyStatus(status) || record2.activeChat?.status === "waiting_input";
1796
2000
  }
1797
2001
 
1798
2002
  // src/mesh-vocabulary.ts
1799
- var MESH_TASK_STATUSES = ["pending", "assigned", "completed", "failed", "cancelled"];
1800
- 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"];
1801
2005
  var MESH_TASK_MODES = ["code_change", "validation", "live_debug_readonly", "launch_app", "convergence"];
1802
2006
  var MESH_TASK_PRIORITIES = ["low", "normal", "high"];
1803
2007
  var MESH_THINKING_LEVELS = ["low", "medium", "high"];
@@ -1871,6 +2075,7 @@ var SEND_REFUSAL_REASONS = [
1871
2075
  "no_target",
1872
2076
  "bootstrap_pending",
1873
2077
  "duplicate_dispatch",
2078
+ "new_work_held",
1874
2079
  "internal_error"
1875
2080
  ];
1876
2081
  function isSendRefusal(value) {
@@ -1902,6 +2107,14 @@ function isOutboundMessage(value) {
1902
2107
  const candidate = value;
1903
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";
1904
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
+ }
1905
2118
 
1906
2119
  // src/mission-brief.ts
1907
2120
  var GOAL_MAX = 500;
@@ -1987,13 +2200,39 @@ var WORKER_TOOLS = [
1987
2200
  "peer_context_pull",
1988
2201
  "git_status",
1989
2202
  "git_log",
1990
- "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"
1991
2219
  ];
1992
2220
  var WORKER_TOOL_SET = new Set(WORKER_TOOLS);
1993
2221
  function isWorkerTool(value) {
1994
2222
  return typeof value === "string" && WORKER_TOOL_SET.has(value);
1995
2223
  }
1996
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.";
1997
2236
  function hasWorkerProtocolFooter(body) {
1998
2237
  return typeof body === "string" && body.includes(WORKER_PROTOCOL_FOOTER_MARKER);
1999
2238
  }
@@ -2015,6 +2254,9 @@ function renderWorkerProtocolFooter(input = {}) {
2015
2254
  if (input.readonly) scope.push("read-only");
2016
2255
  if (scope.length) lines.push(`You are a delegated worker (${scope.join(", ")}).`);
2017
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);
2018
2260
  if (input.workerMcp === false) {
2019
2261
  lines.push(
2020
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.",
@@ -2034,15 +2276,30 @@ function renderWorkerProtocolFooter(input = {}) {
2034
2276
  "Memos from the coordinator arrive appended to the response of whichever worker tool you call next; read them and follow them.",
2035
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`.",
2036
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 `[]`.",
2037
- "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."
2038
2282
  );
2039
2283
  if (input.enclosedHandoffNotes && input.enclosedHandoffNotes > 0) {
2040
2284
  lines.push(
2041
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.`
2042
2286
  );
2043
2287
  }
2288
+ if (input.stage) lines.push(...renderStageProtocolLines(input.stage));
2044
2289
  return lines.join("\n");
2045
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
+ }
2046
2303
  function stripWorkerProtocolFooter(body) {
2047
2304
  if (typeof body !== "string") return body;
2048
2305
  const at = body.indexOf(WORKER_PROTOCOL_FOOTER_MARKER);
@@ -2079,11 +2336,23 @@ var ASSISTANT_TOOLS = [
2079
2336
  "project_send",
2080
2337
  "project_read",
2081
2338
  "project_add",
2339
+ "project_attach_remote",
2082
2340
  "discover_repos",
2083
2341
  "memory",
2342
+ "memory_search",
2084
2343
  "skill_view",
2085
2344
  "skill_manage",
2086
- "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"
2087
2356
  ];
2088
2357
  var ASSISTANT_TOOL_SET = new Set(ASSISTANT_TOOLS);
2089
2358
  function isAssistantTool(value) {
@@ -2091,6 +2360,8 @@ function isAssistantTool(value) {
2091
2360
  }
2092
2361
  var ASSISTANT_VERB = {
2093
2362
  // tool verbs
2363
+ driverList: "driver_list",
2364
+ driverDescribe: "driver_describe",
2094
2365
  projects: "assistant_projects",
2095
2366
  environment: "assistant_environment",
2096
2367
  action: "assistant_action",
@@ -2101,20 +2372,46 @@ var ASSISTANT_VERB = {
2101
2372
  projectSend: "assistant_project_send",
2102
2373
  projectRead: "assistant_project_read",
2103
2374
  projectAdd: "assistant_project_add",
2375
+ projectAttachRemote: "assistant_project_attach_remote",
2104
2376
  discoverRepos: "assistant_discover_repos",
2105
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",
2106
2380
  skillView: "assistant_skill_view",
2107
2381
  skillManage: "assistant_skill_manage",
2108
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",
2109
2395
  // assistant-side daemon verbs without a tool of the same name
2110
2396
  launch: "launch_assistant",
2111
2397
  pendingRelays: "assistant_pending_relays",
2112
2398
  // owner verbs (dashboard only)
2113
2399
  stagedResolve: "assistant_staged_resolve",
2114
2400
  storeAdmin: "assistant_store_admin",
2115
- 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"
2116
2411
  };
2117
2412
  var ASSISTANT_TOOL_VERBS = {
2413
+ driver_list: ASSISTANT_VERB.driverList,
2414
+ driver_describe: ASSISTANT_VERB.driverDescribe,
2118
2415
  projects: ASSISTANT_VERB.projects,
2119
2416
  environment: ASSISTANT_VERB.environment,
2120
2417
  assistant_action: ASSISTANT_VERB.action,
@@ -2123,27 +2420,110 @@ var ASSISTANT_TOOL_VERBS = {
2123
2420
  project_send: ASSISTANT_VERB.projectSend,
2124
2421
  project_read: ASSISTANT_VERB.projectRead,
2125
2422
  project_add: ASSISTANT_VERB.projectAdd,
2423
+ project_attach_remote: ASSISTANT_VERB.projectAttachRemote,
2126
2424
  discover_repos: ASSISTANT_VERB.discoverRepos,
2127
2425
  memory: ASSISTANT_VERB.memory,
2426
+ memory_search: ASSISTANT_VERB.memorySearch,
2128
2427
  skill_view: ASSISTANT_VERB.skillView,
2129
2428
  skill_manage: ASSISTANT_VERB.skillManage,
2130
- 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
2131
2438
  };
2132
- var ASSISTANT_WRITE_TOOLS = ["project_watch", "assistant_action", "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"];
2133
2440
  var ASSISTANT_OWNER_VERBS = [
2134
2441
  ASSISTANT_VERB.executionSettings,
2135
2442
  ASSISTANT_VERB.stagedResolve,
2136
2443
  ASSISTANT_VERB.storeAdmin,
2137
- ASSISTANT_VERB.importSkills
2444
+ ASSISTANT_VERB.importSkills,
2445
+ ASSISTANT_VERB.skillsList,
2446
+ ASSISTANT_VERB.memoryDigest,
2447
+ ASSISTANT_VERB.memoryUndo,
2448
+ ASSISTANT_VERB.threadClose
2138
2449
  ];
2139
2450
  var ASSISTANT_REVIEW_TURN_VERBS = [
2140
2451
  ASSISTANT_VERB.memory,
2452
+ ASSISTANT_VERB.memorySearch,
2141
2453
  ASSISTANT_VERB.skillView,
2142
2454
  ASSISTANT_VERB.skillManage,
2143
2455
  ASSISTANT_VERB.projectNote
2144
2456
  ];
2145
2457
  var ASSISTANT_SESSION_ID_ENV = "ADHDEV_ASSISTANT_SESSION_ID";
2146
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
+ }
2147
2527
 
2148
2528
  // src/turn-evidence.ts
2149
2529
  var MESH_TOPIC_PROTOCOL_VERSION = 2;
@@ -2179,13 +2559,24 @@ var TURN_SCOPES = ["mesh_queue", "mesh_direct", "plain"];
2179
2559
  var RECLAIMING_SEND_REFUSALS = ["session_exited", "no_target", "unsupported_input"];
2180
2560
  var DELIVERY_OUTCOMES = ["delivered", "queued"];
2181
2561
  var DELIVERY_VIAS = ["local", "p2p"];
2182
- 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"];
2183
2563
  function sanitizeRefusalCode(value) {
2184
2564
  if (typeof value !== "string") return void 0;
2185
2565
  const normalized = value.trim().toLowerCase().replace(/[^a-z_]/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "");
2186
2566
  if (!normalized) return void 0;
2187
2567
  return normalized.slice(0, 64);
2188
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
+ }
2189
2580
  var CONSUME_PROFILES = ["default", "native_source"];
2190
2581
  var SESSION_REBOUND_REASONS = ["restart", "live_holder"];
2191
2582
  var SUSPENSION_MODALS = ["approval", "choice"];
@@ -2228,9 +2619,12 @@ var HOLD_REASONS = [
2228
2619
  // a session whose FSM never shows the idle edge again does not wait for
2229
2620
  // liveness / hard_ceiling.
2230
2621
  "await_end",
2231
- "report_correction"
2622
+ "report_correction",
2623
+ // A generating mesh attempt with no output/activity for `stallReclaimMs`: expiry reclaims it
2624
+ // (`stalled_no_output`) instead of waiting for the hard ceiling. Re-armed by every output.
2625
+ "stall_ceiling"
2232
2626
  ];
2233
- var TURN_OUTCOMES = ["completed", "failed", "cancelled"];
2627
+ var TURN_OUTCOMES = ["completed", "blocked", "failed", "cancelled"];
2234
2628
  var COMMIT_STRENGTHS = ["genuine", "weak", "tool_report", "operator"];
2235
2629
  var TURN_REASONS = [
2236
2630
  // commits
@@ -2242,6 +2636,7 @@ var TURN_REASONS = [
2242
2636
  "weak_end_liveness_unconfirmed",
2243
2637
  "weak_end_probe_unobserved",
2244
2638
  "report_correction_expired",
2639
+ "report_missing_timeout",
2245
2640
  "session_error",
2246
2641
  "provider_auth_failed",
2247
2642
  "provider_billing_failed",
@@ -2260,6 +2655,8 @@ var TURN_REASONS = [
2260
2655
  "reclaim_budget_exhausted",
2261
2656
  "hollow_max_retries",
2262
2657
  "migration_orphan",
2658
+ // a stopping attempt whose writer node stayed unreachable (or was removed) past the bound
2659
+ "writer_unreachable",
2263
2660
  // reclaims (generation + 1)
2264
2661
  "dispatch_refused_session_exited",
2265
2662
  "dispatch_refused_no_target",
@@ -2271,10 +2668,13 @@ var TURN_REASONS = [
2271
2668
  "hollow_completion",
2272
2669
  "assigned_stranded_dispatch_unconfirmed",
2273
2670
  "delivered_not_consumed_redrive",
2274
- "delivered_no_turn_deadline"
2671
+ "delivered_no_turn_deadline",
2672
+ // a generating worker produced no output/activity for the stall reclaim bound
2673
+ "stalled_no_output"
2275
2674
  ];
2276
2675
  var NOTIFY_KINDS = [
2277
2676
  "completed",
2677
+ "blocked",
2278
2678
  "failed",
2279
2679
  "cancelled",
2280
2680
  "stopped",
@@ -2530,17 +2930,89 @@ function projectTurnEvidenceEntry(evidence, attempt) {
2530
2930
  };
2531
2931
  }
2532
2932
 
2933
+ // src/launch-defaults.ts
2934
+ var LAUNCH_DEFAULT_ROLES = ["assistant", "coordinator"];
2935
+ var LAUNCH_DEFAULT_SOURCES = ["user", "stored_default", "project_default", "provider_default"];
2936
+ var LAUNCH_DEFAULTS_NEXT_LAUNCH_NOTE = "Applies to the next launch; running sessions are unchanged.";
2937
+ function isLaunchDefaultRole(value) {
2938
+ return typeof value === "string" && LAUNCH_DEFAULT_ROLES.includes(value);
2939
+ }
2940
+ function isLaunchDefaultSource(value) {
2941
+ return typeof value === "string" && LAUNCH_DEFAULT_SOURCES.includes(value);
2942
+ }
2943
+ var LAUNCH_DEFAULT_ERROR_CODES = [
2944
+ "invalid_args",
2945
+ "launch_default_required",
2946
+ "launch_default_unavailable",
2947
+ "launch_selection_invalid",
2948
+ "launch_default_invalid",
2949
+ "revision_conflict",
2950
+ "store_unavailable",
2951
+ "store_busy",
2952
+ "persistence_failed",
2953
+ "project_not_found",
2954
+ "project_ambiguous",
2955
+ "project_not_hosted",
2956
+ "project_storage_unavailable",
2957
+ "staging_unavailable",
2958
+ "staging_failed",
2959
+ "review_turn_tool_denied"
2960
+ ];
2961
+
2962
+ // src/role-launch.ts
2963
+ function record(value) {
2964
+ return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
2965
+ }
2966
+ function ref(value) {
2967
+ const r = record(value);
2968
+ 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;
2969
+ return {
2970
+ role: r.role,
2971
+ scope: r.scope,
2972
+ revision: r.revision,
2973
+ ...r.scope === "project" ? { projectId: r.projectId } : {}
2974
+ };
2975
+ }
2976
+ function axis(value) {
2977
+ const a = record(value);
2978
+ if (!a || !isLaunchDefaultSource(a.source) || a.value !== null && typeof a.value !== "string") return void 0;
2979
+ const defaultRef = ref(a.defaultRef);
2980
+ 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;
2981
+ return { value: a.value, source: a.source, ...defaultRef ? { defaultRef } : {} };
2982
+ }
2983
+ function parseRoleLaunchSelection(value) {
2984
+ const r = record(value), s = record(r?.selection), a = record(r?.applied);
2985
+ 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;
2986
+ const provider = axis(a?.provider), model = axis(a?.model), thinkingLevel = axis(a?.thinkingLevel);
2987
+ 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;
2988
+ const defaultRef = ref(r.defaultRef);
2989
+ return {
2990
+ role: r.role,
2991
+ selection: {
2992
+ provider: s.provider,
2993
+ ...typeof s.model === "string" ? { model: s.model } : {},
2994
+ ...typeof s.thinkingLevel === "string" ? { thinkingLevel: s.thinkingLevel } : {}
2995
+ },
2996
+ applied: { provider, model, thinkingLevel },
2997
+ ...defaultRef ? { defaultRef } : {},
2998
+ documentRevision: r.documentRevision
2999
+ };
3000
+ }
3001
+
2533
3002
  // src/session-launch.ts
2534
3003
  var MODEL_AXIS_SOURCES = [
2535
3004
  /** Picked explicitly for this launch (dashboard dropdown, coordinator dialog). */
2536
3005
  "user",
2537
3006
  /** The dashboard dialog restored it from the last launch (browser-local memory). */
2538
3007
  "remembered",
3008
+ /** The authoritative daemon role default or host project override. */
3009
+ "stored_default",
3010
+ "project_default",
2539
3011
  /** A mesh capability slot supplied it (or a difficulty preset the slot outranked). */
2540
3012
  "mesh_slot",
2541
3013
  /** An explicit per-task model / thinking level on a mesh queue task. */
2542
3014
  "task_override",
2543
- /** Nothing was requested; the provider's default is known (discovery / manifest). */
3015
+ /** Nothing requested: the provider chooses; resolvedDefault records it when known. */
2544
3016
  "provider_default",
2545
3017
  /** A value was requested without saying where it came from, or nothing is known. */
2546
3018
  "unspecified"
@@ -2584,10 +3056,10 @@ function readFiniteNumber(value) {
2584
3056
  }
2585
3057
  function parseModelSelection(raw) {
2586
3058
  if (!raw || typeof raw !== "object") return void 0;
2587
- const record = raw;
3059
+ const record2 = raw;
2588
3060
  const history = [];
2589
- if (Array.isArray(record.history)) {
2590
- for (const entry of record.history) {
3061
+ if (Array.isArray(record2.history)) {
3062
+ for (const entry of record2.history) {
2591
3063
  if (!entry || typeof entry !== "object") continue;
2592
3064
  const e = entry;
2593
3065
  const value = readString(e.value);
@@ -2596,41 +3068,45 @@ function parseModelSelection(raw) {
2596
3068
  if (value && at !== void 0 && via) history.push({ at, value, via });
2597
3069
  }
2598
3070
  }
2599
- const requested = readString(record.requested);
2600
- const launchValue = readString(record.launchValue);
2601
- const resolvedDefault = readString(record.resolvedDefault);
2602
- const current = readString(record.current);
2603
- const observed = readString(record.observed);
2604
- const observedAt = readFiniteNumber(record.observedAt);
3071
+ const requested = readString(record2.requested);
3072
+ const launchValue = readString(record2.launchValue);
3073
+ const resolvedDefault = readString(record2.resolvedDefault);
3074
+ const current = readString(record2.current);
3075
+ const observed = readString(record2.observed);
3076
+ const observedAt = readFiniteNumber(record2.observedAt);
3077
+ const fallback = record2.fallback === true;
2605
3078
  return {
2606
- source: isModelAxisSource(record.source) ? record.source : "unspecified",
3079
+ source: isModelAxisSource(record2.source) ? record2.source : "unspecified",
2607
3080
  ...requested ? { requested } : {},
2608
3081
  ...launchValue ? { launchValue } : {},
2609
3082
  ...resolvedDefault ? { resolvedDefault } : {},
2610
3083
  ...current ? { current } : {},
2611
3084
  ...observed ? { observed } : {},
2612
3085
  ...observedAt !== void 0 ? { observedAt } : {},
3086
+ ...fallback ? { fallback } : {},
2613
3087
  history: history.slice(-MODEL_SELECTION_HISTORY_LIMIT)
2614
3088
  };
2615
3089
  }
2616
3090
  function parseSessionLaunchRecord(raw) {
2617
3091
  if (!raw || typeof raw !== "object") return void 0;
2618
- const record = raw;
2619
- const sessionId = readString(record.sessionId);
2620
- const providerType = readString(record.providerType);
2621
- const launchedAt = readFiniteNumber(record.launchedAt);
2622
- const model = parseModelSelection(record.model);
2623
- const thinkingLevel = parseModelSelection(record.thinkingLevel);
3092
+ const record2 = raw;
3093
+ const sessionId = readString(record2.sessionId);
3094
+ const providerType = readString(record2.providerType);
3095
+ const launchedAt = readFiniteNumber(record2.launchedAt);
3096
+ const model = parseModelSelection(record2.model);
3097
+ const thinkingLevel = parseModelSelection(record2.thinkingLevel);
2624
3098
  if (!sessionId || !providerType || launchedAt === void 0 || !model || !thinkingLevel) return void 0;
2625
- const providerVersion = readString(record.providerVersion);
2626
- const workspace = readString(record.workspace);
2627
- const autoApproveModeId = readString(record.autoApproveModeId);
3099
+ const providerVersion = readString(record2.providerVersion);
3100
+ const workspace = readString(record2.workspace);
3101
+ const autoApproveModeId = readString(record2.autoApproveModeId);
3102
+ const roleLaunch = parseRoleLaunchSelection(record2.roleLaunch);
2628
3103
  return {
3104
+ ...roleLaunch ? { roleLaunch } : {},
2629
3105
  sessionId,
2630
3106
  providerType,
2631
3107
  ...providerVersion ? { providerVersion } : {},
2632
- ...record.providerChannel === "stable" || record.providerChannel === "preview" ? { providerChannel: record.providerChannel } : {},
2633
- launchedBy: isSessionLaunchedBy(record.launchedBy) ? record.launchedBy : "api",
3108
+ ...record2.providerChannel === "stable" || record2.providerChannel === "preview" ? { providerChannel: record2.providerChannel } : {},
3109
+ launchedBy: isSessionLaunchedBy(record2.launchedBy) ? record2.launchedBy : "api",
2634
3110
  launchedAt,
2635
3111
  ...workspace ? { workspace } : {},
2636
3112
  model,
@@ -2694,7 +3170,7 @@ function isTurnAttemptRefValue(value) {
2694
3170
  function isTurnObserveResponse(value) {
2695
3171
  return isRecord(value) && hasOnlyKeys2(value, ["verdict", "attemptRef", "outcome"]) && isTurnObserveVerdict(value.verdict) && isTurnAttemptRefValue(value.attemptRef) && (value.outcome === void 0 || isTurnOutcomeValue(value.outcome));
2696
3172
  }
2697
- var TURN_OUTCOMES_LOCAL = ["completed", "failed", "cancelled"];
3173
+ var TURN_OUTCOMES_LOCAL = ["completed", "blocked", "failed", "cancelled"];
2698
3174
  function isTurnOutcomeValue(value) {
2699
3175
  return typeof value === "string" && TURN_OUTCOMES_LOCAL.includes(value);
2700
3176
  }
@@ -2920,8 +3396,23 @@ function isMissionBriefWire(value) {
2920
3396
  }
2921
3397
  return true;
2922
3398
  }
3399
+ var STRUCTURED_MISSION_KEYS = ["summary", "releaseNote", "outcome", "outcomeReason", "version", "carryOver", "openItems"];
3400
+ function isOpenItemCountsWire(value) {
3401
+ if (!isRecord(value) || !hasOnlyKeys2(value, ["remaining", "live_check", "decision", "evidence"])) return false;
3402
+ return ["remaining", "live_check", "decision", "evidence"].every((k) => isNonNegativeInt(value[k]));
3403
+ }
3404
+ function isStructuredMissionFields(value) {
3405
+ for (const k of ["summary", "releaseNote", "outcome", "outcomeReason"]) {
3406
+ if (value[k] !== void 0 && typeof value[k] !== "string") return false;
3407
+ }
3408
+ if (value.version !== void 0 && !isNonNegativeInt(value.version)) return false;
3409
+ if (value.carryOver !== void 0 && typeof value.carryOver !== "boolean") return false;
3410
+ if (value.openItems !== void 0 && !isOpenItemCountsWire(value.openItems)) return false;
3411
+ return true;
3412
+ }
2923
3413
  function isMeshMissionRecordWire(value) {
2924
- if (!isRecord(value) || !hasOnlyKeys2(value, ["id", "meshId", "title", "goal", "status", "brief"])) return false;
3414
+ if (!isRecord(value) || !hasOnlyKeys2(value, ["id", "meshId", "title", "goal", "status", "brief", ...STRUCTURED_MISSION_KEYS])) return false;
3415
+ if (!isStructuredMissionFields(value)) return false;
2925
3416
  if (!isEvidenceIdentifier(value.id) || !isEvidenceIdentifier(value.meshId)) return false;
2926
3417
  if (typeof value.title !== "string" || typeof value.goal !== "string") return false;
2927
3418
  if (!isMeshMissionStatusValue(value.status)) return false;
@@ -2929,11 +3420,22 @@ function isMeshMissionRecordWire(value) {
2929
3420
  return true;
2930
3421
  }
2931
3422
  function isMissionUpsertRequest(value) {
2932
- if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "id", "title", "goal", "status", "brief"])) return false;
3423
+ if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "id", "title", "goal", "status", "brief", "structured", "summary", "releaseNote", "outcome", "outcomeReason", "carryOverTo", "toCarryOver", "itemsAdd", "itemsUpdate"])) return false;
2933
3424
  if (value.v !== TURN_IPC_PROTOCOL_VERSION) return false;
2934
3425
  if (!isEvidenceIdentifier(value.meshId)) return false;
2935
3426
  if (value.id !== void 0 && !isEvidenceIdentifier(value.id)) return false;
2936
- if (typeof value.title !== "string" || value.title.trim().length === 0) return false;
3427
+ if (typeof value.title !== "string") return false;
3428
+ if (value.title.trim().length === 0 && value.toCarryOver !== true && value.id === void 0) return false;
3429
+ if (value.structured !== void 0 && typeof value.structured !== "boolean") return false;
3430
+ if (value.toCarryOver !== void 0 && typeof value.toCarryOver !== "boolean") return false;
3431
+ for (const k of ["summary", "releaseNote", "outcome", "outcomeReason"]) {
3432
+ if (value[k] !== void 0 && typeof value[k] !== "string") return false;
3433
+ }
3434
+ if (value.carryOverTo !== void 0 && !isEvidenceIdentifier(value.carryOverTo)) return false;
3435
+ for (const k of ["itemsAdd", "itemsUpdate"]) {
3436
+ const list = value[k];
3437
+ if (list !== void 0 && (!Array.isArray(list) || list.length > 500 || !list.every(isRecord))) return false;
3438
+ }
2937
3439
  if (value.goal !== void 0 && typeof value.goal !== "string") return false;
2938
3440
  if (value.status !== void 0 && !isMeshMissionStatusValue(value.status)) return false;
2939
3441
  if (value.brief !== void 0 && value.brief !== null && !isMissionBriefWire(value.brief)) return false;
@@ -2943,7 +3445,7 @@ function decodeMissionUpsertRequest(value) {
2943
3445
  return isMissionUpsertRequest(value) ? value : null;
2944
3446
  }
2945
3447
  function isMissionUpsertResponse(value) {
2946
- return isRecord(value) && hasOnlyKeys2(value, ["mission"]) && isMeshMissionRecordWire(value.mission);
3448
+ return isRecord(value) && hasOnlyKeys2(value, ["mission", "result"]) && isMeshMissionRecordWire(value.mission) && (value.result === void 0 || isRecord(value.result));
2947
3449
  }
2948
3450
  function decodeMissionUpsertResponse(value) {
2949
3451
  return isMissionUpsertResponse(value) ? value : null;
@@ -2969,7 +3471,10 @@ function decodeMissionQueryResponse(value) {
2969
3471
  return isMissionQueryResponse(value) ? value : null;
2970
3472
  }
2971
3473
  function isMissionListQueryRequest(value) {
2972
- if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "statuses", "verbose", "withStats", "limit", "historyIdLimit", "meshStatusView"])) return false;
3474
+ if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "statuses", "verbose", "withStats", "limit", "historyIdLimit", "meshStatusView", "structured", "items", "history"])) return false;
3475
+ for (const k of ["structured", "items", "history"]) {
3476
+ if (value[k] !== void 0 && typeof value[k] !== "boolean") return false;
3477
+ }
2973
3478
  if (value.meshStatusView !== void 0 && value.meshStatusView !== "compact" && value.meshStatusView !== "verbose") return false;
2974
3479
  if (value.v !== TURN_IPC_PROTOCOL_VERSION) return false;
2975
3480
  if (!isEvidenceIdentifier(value.meshId)) return false;
@@ -2995,12 +3500,13 @@ function isMeshMissionTaskAggregateWire(value) {
2995
3500
  return value.lastActivityAt === null || typeof value.lastActivityAt === "string";
2996
3501
  }
2997
3502
  function isMeshMissionStatsWire(value) {
2998
- const keys = ["missionId", "taskCount", "completed", "failed", "totalDurationMs", "wallClockMs", "retries", "incompleteTaskIds"];
3503
+ const keys = ["missionId", "taskCount", "completed", "failed", "blocked", "totalDurationMs", "wallClockMs", "retries", "incompleteTaskIds"];
2999
3504
  if (!isRecord(value) || !hasOnlyKeys2(value, keys)) return false;
3000
3505
  if (!isEvidenceIdentifier(value.missionId)) return false;
3001
3506
  for (const k of ["taskCount", "completed", "failed", "totalDurationMs", "retries"]) {
3002
3507
  if (!isNonNegativeInt(value[k])) return false;
3003
3508
  }
3509
+ if (value.blocked !== void 0 && !isNonNegativeInt(value.blocked)) return false;
3004
3510
  if (value.wallClockMs !== null && !isNonNegativeInt(value.wallClockMs)) return false;
3005
3511
  if (!Array.isArray(value.incompleteTaskIds) || !value.incompleteTaskIds.every(isEvidenceIdentifier)) return false;
3006
3512
  return true;
@@ -3010,7 +3516,7 @@ function isMissionListSummaryWire(value) {
3010
3516
  const hasGoal = "goal" in value;
3011
3517
  const hasPreview = "goalPreview" in value && "goalTruncated" in value;
3012
3518
  if (hasGoal === hasPreview) return false;
3013
- const baseKeys = ["id", "meshId", "title", "status", "tasks", "stats", "brief", "createdAt", "updatedAt", "closeCandidateEmittedAt"];
3519
+ const baseKeys = ["id", "meshId", "title", "status", "tasks", "stats", "brief", "createdAt", "updatedAt", "closeCandidateEmittedAt", ...STRUCTURED_MISSION_KEYS, "items", "history"];
3014
3520
  const allowed = hasGoal ? [...baseKeys, "goal"] : [...baseKeys, "goalPreview", "goalTruncated"];
3015
3521
  if (!hasOnlyKeys2(value, allowed)) return false;
3016
3522
  if (!isEvidenceIdentifier(value.id) || !isEvidenceIdentifier(value.meshId)) return false;
@@ -3024,6 +3530,10 @@ function isMissionListSummaryWire(value) {
3024
3530
  if (value.createdAt !== void 0 && typeof value.createdAt !== "string") return false;
3025
3531
  if (value.updatedAt !== void 0 && typeof value.updatedAt !== "string") return false;
3026
3532
  if (value.closeCandidateEmittedAt !== void 0 && value.closeCandidateEmittedAt !== null && typeof value.closeCandidateEmittedAt !== "string") return false;
3533
+ if (!isStructuredMissionFields(value)) return false;
3534
+ for (const k of ["items", "history"]) {
3535
+ if (value[k] !== void 0 && (!Array.isArray(value[k]) || !value[k].every(isRecord))) return false;
3536
+ }
3027
3537
  return true;
3028
3538
  }
3029
3539
  function isMeshMissionHistoryFoldWire(value) {
@@ -3122,12 +3632,15 @@ function isLedgerQueryEntryWire(value) {
3122
3632
  return true;
3123
3633
  }
3124
3634
  function isLedgerQuerySummaryWire(value) {
3125
- const keys = ["meshId", "totalEntries", "taskDispatched", "taskCompleted", "taskFailed", "taskStalled", "sessionLaunched", "checkpointCreated", "lastActivityAt", "recentFailures"];
3635
+ const keys = ["meshId", "totalEntries", "taskDispatched", "taskCompleted", "taskFailed", "taskBlocked", "taskStalled", "sessionLaunched", "checkpointCreated", "lastActivityAt", "recentFailures", "taskBlocked", "refineFailed", "recentRefineFailures"];
3126
3636
  if (!isRecord(value) || !hasOnlyKeys2(value, keys)) return false;
3127
3637
  if (!isEvidenceIdentifier(value.meshId)) return false;
3128
3638
  for (const k of ["totalEntries", "taskDispatched", "taskCompleted", "taskFailed", "taskStalled", "sessionLaunched", "checkpointCreated", "recentFailures"]) {
3129
3639
  if (!isNonNegativeInt(value[k])) return false;
3130
3640
  }
3641
+ if (value.taskBlocked !== void 0 && !isNonNegativeInt(value.taskBlocked)) return false;
3642
+ if (value.refineFailed !== void 0 && !isNonNegativeInt(value.refineFailed)) return false;
3643
+ if (value.recentRefineFailures !== void 0 && !isNonNegativeInt(value.recentRefineFailures)) return false;
3131
3644
  if (value.lastActivityAt !== null && typeof value.lastActivityAt !== "string") return false;
3132
3645
  return true;
3133
3646
  }
@@ -3171,9 +3684,10 @@ function isQueueDependencyHeadWire(value) {
3171
3684
  return isRecord(value) && hasOnlyKeys2(value, ["id", "status", "cancelReason"]) && typeof value.id === "string" && typeof value.status === "string" && (value.cancelReason === void 0 || typeof value.cancelReason === "string");
3172
3685
  }
3173
3686
  function isQueueQueryResponse(value) {
3174
- if (!isRecord(value) || !hasOnlyKeys2(value, ["entries", "counts", "oldHistoricalCount", "dependencyHeads"])) return false;
3687
+ if (!isRecord(value) || !hasOnlyKeys2(value, ["entries", "counts", "oldHistoricalCount", "legacyReportedBlockedCount", "dependencyHeads"])) return false;
3175
3688
  if (!Array.isArray(value.entries) || !value.entries.every(isQueueEntryWire)) return false;
3176
3689
  if (value.counts !== void 0 && (!isRecord(value.counts) || !Object.values(value.counts).every(isNonNegativeInt))) return false;
3690
+ if (value.legacyReportedBlockedCount !== void 0 && !isNonNegativeInt(value.legacyReportedBlockedCount)) return false;
3177
3691
  if (value.oldHistoricalCount !== void 0 && !isNonNegativeInt(value.oldHistoricalCount)) return false;
3178
3692
  if (value.dependencyHeads !== void 0 && (!Array.isArray(value.dependencyHeads) || !value.dependencyHeads.every(isQueueDependencyHeadWire))) return false;
3179
3693
  return true;
@@ -3231,7 +3745,7 @@ function decodeQueueRequeueRequest(value) {
3231
3745
  return isQueueRequeueRequest(value) ? value : null;
3232
3746
  }
3233
3747
  function isQueueRequeueResponse(value) {
3234
- return isRecord(value) && hasOnlyKeys2(value, ["task"]) && (value.task === null || isQueueEntryWire(value.task));
3748
+ 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");
3235
3749
  }
3236
3750
  function decodeQueueRequeueResponse(value) {
3237
3751
  return isQueueRequeueResponse(value) ? value : null;
@@ -3295,6 +3809,24 @@ function isRecoveryContextQueryResponse(value) {
3295
3809
  function decodeRecoveryContextQueryResponse(value) {
3296
3810
  return isRecoveryContextQueryResponse(value) ? value : null;
3297
3811
  }
3812
+ function decodeQueueReviseRequest(value) {
3813
+ 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;
3814
+ if (value.dryRun !== void 0 && typeof value.dryRun !== "boolean") return null;
3815
+ if (value.deferScheduling !== void 0 && typeof value.deferScheduling !== "boolean") return null;
3816
+ const p = value.patch;
3817
+ if (p.requestQuotaOverride && (value.dryRun !== void 0 || value.deferScheduling !== void 0)) return null;
3818
+ if (p.requestQuotaOverride !== void 0 && (p.requestQuotaOverride !== true || Object.keys(p).length !== 1)) return null;
3819
+ if (p.attestActiveOwnership && value.deferScheduling !== void 0) return null;
3820
+ if (p.attestActiveOwnership !== void 0 && (p.attestActiveOwnership !== true || Object.keys(p).length !== 1)) return null;
3821
+ if (p.message !== void 0 && (typeof p.message !== "string" || !p.message.trim())) return null;
3822
+ if (p.phase !== void 0 && p.phase !== "source" && p.phase !== "integration") return null;
3823
+ if (p.difficulty !== void 0 && p.difficulty !== "easy" && p.difficulty !== "medium" && p.difficulty !== "difficult" && p.difficulty !== "freeform") return null;
3824
+ for (const key of ["ownedPaths", "dependsOn"]) {
3825
+ if (p[key] !== void 0 && (!Array.isArray(p[key]) || !p[key].every((x) => typeof x === "string" && !!x.trim()))) return null;
3826
+ }
3827
+ return value;
3828
+ }
3829
+ var decodeQueueReviseResponse = decodeQueueRequeueResponse;
3298
3830
 
3299
3831
  // src/turn-ipc-stats.ts
3300
3832
  function isTaskStatsQueryRequest(value) {
@@ -3393,6 +3925,7 @@ var TURN_IPC_COMMANDS = [
3393
3925
  "queue_enqueue_batch",
3394
3926
  "queue_cancel",
3395
3927
  "queue_requeue",
3928
+ "queue_revise",
3396
3929
  "direct_dispatch_record",
3397
3930
  "active_work_query",
3398
3931
  "recovery_context_query",
@@ -3532,6 +4065,357 @@ function touchedFilesOutsideOwnership(touched, owned) {
3532
4065
  return { undeclaredTouched, unusedDeclarations };
3533
4066
  }
3534
4067
 
4068
+ // src/mission-items.ts
4069
+ var MISSION_ITEM_KINDS = ["remaining", "live_check", "decision", "evidence"];
4070
+ var MISSION_ITEM_STATES = ["open", "done", "failed", "dropped", "moved", "answered", "expired", "withdrawn", "superseded"];
4071
+ var COORDINATOR_SETTABLE_ITEM_STATES = {
4072
+ remaining: ["open", "done", "dropped"],
4073
+ live_check: ["open", "done", "dropped"],
4074
+ evidence: ["open", "done", "dropped"],
4075
+ decision: ["open", "withdrawn", "superseded"]
4076
+ };
4077
+ var MISSION_OUTCOMES = ["merged", "verified_live", "superseded", "not_needed", "owner_abandoned", "unspecified"];
4078
+ function isMissionOutcome(value) {
4079
+ return typeof value === "string" && MISSION_OUTCOMES.includes(value);
4080
+ }
4081
+ var MISSION_REF_KINDS = ["commit", "branch", "pr", "task", "artifact", "mission", "url"];
4082
+ var MISSION_LIMITS = {
4083
+ summary: 300,
4084
+ outcomeReason: 500,
4085
+ itemText: 300,
4086
+ machine: 80,
4087
+ refs: 8,
4088
+ refValue: 300,
4089
+ refRepo: 120,
4090
+ refNote: 200,
4091
+ dedupeKey: 400,
4092
+ question: 300,
4093
+ context: 600,
4094
+ options: 5,
4095
+ optionLabel: 60,
4096
+ optionDetail: 200,
4097
+ /** Open items per mission before the oldest `remaining` fold into a "N more" summary item. */
4098
+ openItemsPerMission: 200,
4099
+ /** One event payload (serialized). */
4100
+ eventPayloadBytes: 16 * 1024,
4101
+ /** items_add / items_update entries honoured per call (extra entries are reported, not applied). */
4102
+ itemsPerCall: 50
4103
+ };
4104
+ var MISSION_DECISION_OPTION_IDS = ["a", "b", "c", "d", "e"];
4105
+ var MISSION_DECISION_URGENCIES = ["normal", "blocking"];
4106
+ var MISSION_DECISION_ON_DUE = ["remind", "apply_recommended"];
4107
+ function truncateMissionText(value, max) {
4108
+ if (value.length <= max) return value;
4109
+ return `${value.slice(0, max - 1).trimEnd()}\u2026`;
4110
+ }
4111
+ function str(value) {
4112
+ return typeof value === "string" ? value.trim() : "";
4113
+ }
4114
+ function collapse(value) {
4115
+ return value.replace(/\s+/g, " ").trim();
4116
+ }
4117
+ function normalizeMissionSummary(value) {
4118
+ if (typeof value !== "string") return null;
4119
+ const text = collapse(value);
4120
+ return { value: truncateMissionText(text, MISSION_LIMITS.summary), truncated: text.length > MISSION_LIMITS.summary };
4121
+ }
4122
+ function normalizeOutcomeReason(value) {
4123
+ if (typeof value !== "string") return null;
4124
+ const text = value.trim();
4125
+ return { value: truncateMissionText(text, MISSION_LIMITS.outcomeReason), truncated: text.length > MISSION_LIMITS.outcomeReason };
4126
+ }
4127
+ function normalizeMissionRefs(value) {
4128
+ if (!Array.isArray(value)) return { refs: [], truncated: false };
4129
+ const refs = [];
4130
+ let truncated = false;
4131
+ for (const raw of value) {
4132
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) continue;
4133
+ const r = raw;
4134
+ const kind = str(r.kind);
4135
+ const refValue = str(r.value);
4136
+ if (!MISSION_REF_KINDS.includes(kind) || !refValue) continue;
4137
+ if (refs.length >= MISSION_LIMITS.refs) {
4138
+ truncated = true;
4139
+ break;
4140
+ }
4141
+ const repo = str(r.repo);
4142
+ const note = str(r.note);
4143
+ refs.push({
4144
+ kind,
4145
+ ...repo ? { repo: truncateMissionText(repo, MISSION_LIMITS.refRepo) } : {},
4146
+ value: truncateMissionText(refValue, MISSION_LIMITS.refValue),
4147
+ ...note ? { note: truncateMissionText(note, MISSION_LIMITS.refNote) } : {}
4148
+ });
4149
+ }
4150
+ return { refs, truncated };
4151
+ }
4152
+ function normalizeOptions(value, truncated) {
4153
+ if (!Array.isArray(value)) return [];
4154
+ const out = [];
4155
+ for (const raw of value) {
4156
+ if (typeof raw === "string" && raw.trim()) {
4157
+ if (out.length >= MISSION_LIMITS.options) {
4158
+ truncated.push("options");
4159
+ break;
4160
+ }
4161
+ out.push({ id: MISSION_DECISION_OPTION_IDS[out.length], label: truncateMissionText(raw.trim(), MISSION_LIMITS.optionLabel) });
4162
+ continue;
4163
+ }
4164
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) continue;
4165
+ const o = raw;
4166
+ const label = collapse(str(o.label));
4167
+ if (!label) continue;
4168
+ if (out.length >= MISSION_LIMITS.options) {
4169
+ truncated.push("options");
4170
+ break;
4171
+ }
4172
+ const detail = str(o.detail);
4173
+ out.push({
4174
+ id: MISSION_DECISION_OPTION_IDS[out.length],
4175
+ label: truncateMissionText(label, MISSION_LIMITS.optionLabel),
4176
+ ...detail ? { detail: truncateMissionText(detail, MISSION_LIMITS.optionDetail) } : {}
4177
+ });
4178
+ }
4179
+ return out;
4180
+ }
4181
+ function normalizeDueAt(value) {
4182
+ if (typeof value !== "string" || !value.trim()) return void 0;
4183
+ const ms2 = Date.parse(value);
4184
+ return Number.isNaN(ms2) ? void 0 : new Date(ms2).toISOString();
4185
+ }
4186
+ function normalizeDecisionInput(raw, truncated) {
4187
+ const questionSource = collapse(str(raw.question) || str(raw.text));
4188
+ if (!questionSource) return null;
4189
+ if (questionSource.length > MISSION_LIMITS.question) truncated.push("question");
4190
+ const question = truncateMissionText(questionSource, MISSION_LIMITS.question);
4191
+ const contextSource = str(raw.context);
4192
+ if (contextSource.length > MISSION_LIMITS.context) truncated.push("context");
4193
+ const options = normalizeOptions(raw.options, truncated);
4194
+ const recommendedRaw = str(raw.recommended);
4195
+ const recommended = recommendedRaw && options.some((o) => o.id === recommendedRaw) ? recommendedRaw : options.find((o) => recommendedRaw && o.label.toLowerCase() === recommendedRaw.toLowerCase())?.id;
4196
+ const dueAt = normalizeDueAt(raw.dueAt ?? raw.due_at);
4197
+ const onDueRaw = str(raw.onDue ?? raw.on_due);
4198
+ const urgencyRaw = str(raw.urgency);
4199
+ const allowFreeTextRaw = raw.allowFreeText ?? raw.allow_free_text;
4200
+ return {
4201
+ question,
4202
+ ...contextSource ? { context: truncateMissionText(contextSource, MISSION_LIMITS.context) } : {},
4203
+ options,
4204
+ ...recommended ? { recommended } : {},
4205
+ allowFreeText: typeof allowFreeTextRaw === "boolean" ? allowFreeTextRaw : true,
4206
+ ...dueAt ? { dueAt } : {},
4207
+ // apply_recommended without a recommended option has nothing to apply — fall back to remind.
4208
+ onDue: onDueRaw === "apply_recommended" && recommended ? "apply_recommended" : "remind",
4209
+ urgency: urgencyRaw === "blocking" ? "blocking" : "normal"
4210
+ };
4211
+ }
4212
+ function normalizeForDedupe(text) {
4213
+ return collapse(text).toLowerCase().replace(/[\s.!?。]+$/u, "");
4214
+ }
4215
+ function deriveItemDedupeKey(kind, parts) {
4216
+ const explicit = str(parts.explicit);
4217
+ if (explicit) return truncateMissionText(`k:${explicit}`, MISSION_LIMITS.dedupeKey);
4218
+ if (kind === "decision") return truncateMissionText(`decision:${normalizeForDedupe(parts.question ?? parts.text ?? "")}`, MISSION_LIMITS.dedupeKey);
4219
+ if (kind === "evidence") {
4220
+ const ref2 = parts.refs?.[0];
4221
+ if (ref2) return truncateMissionText(`evidence:${ref2.kind}:${ref2.repo ?? ""}:${ref2.value}`, MISSION_LIMITS.dedupeKey);
4222
+ }
4223
+ const machine = parts.machine ? `@${normalizeForDedupe(parts.machine)}` : "";
4224
+ return truncateMissionText(`${kind}${machine}:${normalizeForDedupe(parts.text ?? "")}`, MISSION_LIMITS.dedupeKey);
4225
+ }
4226
+ function normalizeMissionItemInput(raw) {
4227
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return { error: "item must be an object" };
4228
+ const r = raw;
4229
+ const kind = str(r.kind) || "remaining";
4230
+ if (!MISSION_ITEM_KINDS.includes(kind)) {
4231
+ return { error: `invalid kind '${kind}' (valid: ${MISSION_ITEM_KINDS.join(", ")})` };
4232
+ }
4233
+ const truncated = [];
4234
+ const { refs, truncated: refsTruncated } = normalizeMissionRefs(r.refs);
4235
+ if (refsTruncated) truncated.push("refs");
4236
+ const machineRaw = collapse(str(r.machine));
4237
+ const machine = machineRaw ? truncateMissionText(machineRaw, MISSION_LIMITS.machine) : void 0;
4238
+ const explicitKey = str(r.dedupe_key ?? r.dedupeKey);
4239
+ if (kind === "decision") {
4240
+ const decisionRaw = r.decision && typeof r.decision === "object" && !Array.isArray(r.decision) ? r.decision : r;
4241
+ const decision = normalizeDecisionInput({ ...decisionRaw, question: decisionRaw.question ?? r.question ?? r.text }, truncated);
4242
+ if (!decision) return { error: "decision item needs a question" };
4243
+ return {
4244
+ item: {
4245
+ kind,
4246
+ text: decision.question,
4247
+ ...machine ? { machine } : {},
4248
+ refs,
4249
+ decision,
4250
+ dedupeKey: deriveItemDedupeKey("decision", { question: decision.question, explicit: explicitKey }),
4251
+ truncated
4252
+ }
4253
+ };
4254
+ }
4255
+ const textSource = collapse(str(r.text));
4256
+ if (!textSource && !(kind === "evidence" && refs.length > 0)) return { error: `${kind} item needs text` };
4257
+ if (textSource.length > MISSION_LIMITS.itemText) truncated.push("text");
4258
+ const text = truncateMissionText(textSource || `${refs[0].kind}: ${refs[0].value}`, MISSION_LIMITS.itemText);
4259
+ return {
4260
+ item: {
4261
+ kind,
4262
+ text,
4263
+ ...machine ? { machine } : {},
4264
+ refs,
4265
+ dedupeKey: deriveItemDedupeKey(kind, { text, machine, refs, explicit: explicitKey }),
4266
+ truncated
4267
+ }
4268
+ };
4269
+ }
4270
+ function normalizeMissionItemUpdate(raw) {
4271
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return { error: "update must be an object" };
4272
+ const r = raw;
4273
+ const id2 = str(r.id ?? r.item_id ?? r.itemId);
4274
+ if (!id2) return { error: "update needs an item id" };
4275
+ const truncated = [];
4276
+ const update = { id: id2 };
4277
+ if (r.state !== void 0) {
4278
+ const state = str(r.state);
4279
+ if (!MISSION_ITEM_STATES.includes(state)) return { error: `invalid state '${state}'` };
4280
+ update.state = state;
4281
+ }
4282
+ if (typeof r.text === "string") {
4283
+ const text = collapse(r.text);
4284
+ if (text.length > MISSION_LIMITS.itemText) truncated.push("text");
4285
+ if (text) update.text = truncateMissionText(text, MISSION_LIMITS.itemText);
4286
+ }
4287
+ if (r.machine === null) update.machine = null;
4288
+ else if (typeof r.machine === "string") {
4289
+ const machine = collapse(r.machine);
4290
+ update.machine = machine ? truncateMissionText(machine, MISSION_LIMITS.machine) : null;
4291
+ }
4292
+ if (r.refs !== void 0) {
4293
+ const { refs, truncated: t } = normalizeMissionRefs(r.refs);
4294
+ if (t) truncated.push("refs");
4295
+ update.refs = refs;
4296
+ }
4297
+ return { update, truncated };
4298
+ }
4299
+ function boundEventPayload(payload) {
4300
+ let json = JSON.stringify(payload);
4301
+ if (json.length <= MISSION_LIMITS.eventPayloadBytes) return json;
4302
+ const shrunk = {};
4303
+ for (const [k, v] of Object.entries(payload)) {
4304
+ shrunk[k] = typeof v === "string" && v.length > 4e3 ? `${v.slice(0, 4e3)}\u2026` : v;
4305
+ }
4306
+ shrunk.payloadTruncated = true;
4307
+ json = JSON.stringify(shrunk);
4308
+ if (json.length <= MISSION_LIMITS.eventPayloadBytes) return json;
4309
+ return JSON.stringify({ payloadTruncated: true, keys: Object.keys(payload).slice(0, 20) });
4310
+ }
4311
+ var CARRY_OVER_MISSION_TITLE = "Carry-over \u2014 open items from closed missions";
4312
+ var LEGACY_CARRY_OVER_MISSION_TITLE = "\uC774\uC6D4 \u2014 \uB2EB\uD78C \uBBF8\uC158\uC5D0\uC11C \uB118\uC5B4\uC628 \uD56D\uBAA9";
4313
+ var CARRY_OVER_MISSION_GOAL = "Open items carried over from closed missions, and decisions requested without a mission. Managed automatically \u2014 do not close.";
4314
+ function isCarryOverMissionRecord(m) {
4315
+ return !!m && (m.isCarryOver === true || isCarryOverMissionTitle(m.title));
4316
+ }
4317
+ function isCarryOverMissionTitle(title) {
4318
+ if (typeof title !== "string") return false;
4319
+ const t = title.trim();
4320
+ return t === CARRY_OVER_MISSION_TITLE || t === LEGACY_CARRY_OVER_MISSION_TITLE;
4321
+ }
4322
+ var OWNER_ABANDON_CONFIRM_KEY_PREFIX = "owner-abandon-confirm:";
4323
+ var OWNER_ABANDON_CONFIRM_QUESTION = "The coordinator closed this as 'owner abandoned' \u2014 correct?";
4324
+ var OWNER_ABANDON_CONFIRM_OPTIONS = ["Correct", "Reopen"];
4325
+ var WORKER_DECISIONS_NEEDED_MAX = 3;
4326
+ var WORKER_COMMITS_MAX = 20;
4327
+ var SHA_RE = /^[0-9a-f]{7,64}$/i;
4328
+ function normalizeReportCommits(value) {
4329
+ if (!Array.isArray(value)) return null;
4330
+ const out = [];
4331
+ for (const v of value) {
4332
+ if (typeof v !== "string") return null;
4333
+ const sha = v.trim();
4334
+ if (!SHA_RE.test(sha)) return null;
4335
+ if (!out.includes(sha.toLowerCase())) out.push(sha.toLowerCase());
4336
+ }
4337
+ return out;
4338
+ }
4339
+
4340
+ // src/mission-git-state.ts
4341
+ var MISSION_REF_GIT_STATUSES = ["contained_ancestor", "contained_patch_equivalent", "not_contained", "unknown"];
4342
+ var MISSION_REF_GIT_METHODS = ["ancestry", "cherry", "residual_patch"];
4343
+ var MISSION_GIT_STATES = ["no_refs", "landed", "partial", "not_landed", "unknown"];
4344
+ function isMissionRefContained(status) {
4345
+ return status === "contained_ancestor" || status === "contained_patch_equivalent";
4346
+ }
4347
+ function aggregateMissionGitState(statuses) {
4348
+ const total = statuses.length;
4349
+ const contained = statuses.filter(isMissionRefContained).length;
4350
+ const notContained = statuses.filter((s) => s === "not_contained").length;
4351
+ const unknown = statuses.filter((s) => s === "unknown").length;
4352
+ const counts = { total, contained, notContained, unknown };
4353
+ if (total === 0) return { state: "no_refs", partialUnknown: false, counts };
4354
+ if (contained === total) return { state: "landed", partialUnknown: false, counts };
4355
+ if (contained > 0) return { state: "partial", partialUnknown: unknown > 0, counts };
4356
+ if (notContained === total) return { state: "not_landed", partialUnknown: false, counts };
4357
+ return { state: "unknown", partialUnknown: false, counts };
4358
+ }
4359
+
4360
+ // src/release.ts
4361
+ var MESH_RELEASE_CHANNELS = ["preview", "stable"];
4362
+ function isMeshReleaseChannel(value) {
4363
+ return typeof value === "string" && MESH_RELEASE_CHANNELS.includes(value);
4364
+ }
4365
+ var MESH_RELEASE_STATUSES = ["planned", "frozen", "deployed", "verified", "superseded", "cancelled"];
4366
+ function isReleaseStatus(value) {
4367
+ return typeof value === "string" && MESH_RELEASE_STATUSES.includes(value);
4368
+ }
4369
+ var RELEASE_MEMBER_STATES = ["member", "moved_out", "removed"];
4370
+ var RELEASE_ACTORS = ["coordinator", "owner", "assistant", "script"];
4371
+ var RELEASE_EVENT_TYPES = [
4372
+ "created",
4373
+ "status_changed",
4374
+ "scope_added",
4375
+ "scope_moved",
4376
+ "scope_removed",
4377
+ "deploy_recorded",
4378
+ "changelog_drafted",
4379
+ "changelog_applied"
4380
+ ];
4381
+ var MISSION_RELEASE_EVENT_TYPES = ["release_attached", "release_moved", "release_detached"];
4382
+ var RELEASE_LIMITS = {
4383
+ name: 80,
4384
+ note: 500,
4385
+ /** `mesh_missions.release_note`: one user/operator-visible sentence. */
4386
+ releaseNote: 400,
4387
+ missionsPerCall: 100,
4388
+ changelogEntries: 300
4389
+ };
4390
+ var CHANGELOG_SECTIONS = ["Added", "Fixed", "Changed"];
4391
+ var NEEDS_WORDING_MARKER = "[needs user-facing wording]";
4392
+ function changelogMissionMarker(missionId) {
4393
+ return `<!-- m:${missionId.slice(0, 8)} -->`;
4394
+ }
4395
+ function classifyChangelogSection(text, hint) {
4396
+ const m = /^\s*\[(added|fixed|changed)\]\s*/i.exec(text);
4397
+ if (m) {
4398
+ const key = m[1].toLowerCase();
4399
+ return { section: key === "added" ? "Added" : key === "fixed" ? "Fixed" : "Changed", text: text.slice(m[0].length).trim() };
4400
+ }
4401
+ const probe = `${hint ?? ""} ${text}`.toLowerCase();
4402
+ if (/\b(fix|fixes|fixed|bug|regression|crash|error)\b|오류|결함|버그|수정/.test(probe)) return { section: "Fixed", text };
4403
+ if (/\b(add|adds|added|new|introduc\w*|support\w*)\b|신규|추가/.test(probe)) return { section: "Added", text };
4404
+ return { section: "Changed", text };
4405
+ }
4406
+ function lintChangelogText(text) {
4407
+ const out = [];
4408
+ if (/\bwave[\s-]*\d+/i.test(text) || /웨이브\s*\d+/.test(text)) out.push("mentions an internal wave number");
4409
+ if (/\brc[.\s-]?\d+\b/i.test(text)) out.push("mentions an internal rc number");
4410
+ 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");
4411
+ if (/\bmission\b/i.test(text)) out.push('mentions "mission" (internal vocabulary)');
4412
+ return out;
4413
+ }
4414
+
4415
+ // src/decision-push-relay.ts
4416
+ var DECISION_PUSH_RELAY_COMMAND = "mission_decision_push_relay_answer";
4417
+ var DECISION_PUSH_RELAY_SOURCE = "push_relay";
4418
+
3535
4419
  // src/keyed-doc-delta.ts
3536
4420
  function sig(value) {
3537
4421
  if (value === void 0) return void 0;
@@ -3894,9 +4778,412 @@ function isProviderQuestionBinding(value) {
3894
4778
  if (["sessionId", "generation", "threadId", "turnId", "itemId"].some((key) => typeof b[key] !== "string" || !b[key].trim())) return false;
3895
4779
  return b.transport === "codex_async" ? b.requestId === void 0 : typeof b.requestId === "string" && !!b.requestId.trim() || typeof b.requestId === "number" && Number.isFinite(b.requestId);
3896
4780
  }
4781
+
4782
+ // src/task-source-phase.ts
4783
+ function reviewIndependenceOf(review) {
4784
+ return review.independence ?? "different_provider";
4785
+ }
4786
+
4787
+ // src/light-task.ts
4788
+ var LIGHT_REJECT = {
4789
+ REQUIRES_LOCAL_BASE: "light_requires_local_base",
4790
+ NOT_CONFIGURED: "light_workspace_not_configured",
4791
+ REQUIRES_OWNED_PATHS: "light_requires_owned_paths",
4792
+ MODE_CONFLICT: "light_mode_conflict"
4793
+ };
4794
+ var LIGHT_HOLD = {
4795
+ PREPARE_FAILED: "light_workspace_prepare_failed",
4796
+ LIMIT: "light_workspace_limit",
4797
+ DISK_LOW: "light_workspace_disk_low",
4798
+ CAP: "max_light_parallel_tasks_reached"
4799
+ };
4800
+ var LIGHT_BLOCK_REASONS = [
4801
+ "light_uncommitted_changes",
4802
+ "light_dependency_change",
4803
+ "light_lineage_unproven",
4804
+ "shared_checkout_mutated"
4805
+ ];
4806
+ var LIGHT_WARNINGS = ["shared_checkout_changed_during_task", "light_base_dirty_overlap"];
4807
+ var LIGHT_LAND_MODES = ["refine", "apply_to_checkout"];
4808
+ var LIGHT_TESTS_RUN_MAX = 20;
4809
+ function isLightWorkerSession(session) {
4810
+ const s = session;
4811
+ if (!s || typeof s !== "object") return false;
4812
+ const has = (o) => !!o && typeof o === "object" && typeof o.lightWorkspaceId === "string" && o.lightWorkspaceId.trim() !== "";
4813
+ return has(s.settings) || has(s.launchRecord?.settings) || has(s);
4814
+ }
4815
+
4816
+ // src/relay-reprobe.ts
4817
+ var RELAY_REPROBE_BASE_DELAY_MS = 6e4;
4818
+ var RELAY_REPROBE_MAX_DELAY_MS = 5 * 6e4;
4819
+ var RELAY_REPROBE_JITTER_RATIO = 0.2;
4820
+ function computeRelayReprobeDelay(failures, random, timing = {}) {
4821
+ const base = timing.baseDelayMs ?? RELAY_REPROBE_BASE_DELAY_MS;
4822
+ const max = timing.maxDelayMs ?? RELAY_REPROBE_MAX_DELAY_MS;
4823
+ const jitter = timing.jitterRatio ?? RELAY_REPROBE_JITTER_RATIO;
4824
+ const grown = Math.min(max, base * 2 ** Math.max(0, failures));
4825
+ const factor = 1 + jitter * (Math.min(1, Math.max(0, random())) * 2 - 1);
4826
+ return Math.round(grown * factor);
4827
+ }
4828
+ var RelayReprobeScheduler = class {
4829
+ constructor(options) {
4830
+ this.options = options;
4831
+ }
4832
+ handle = null;
4833
+ running = false;
4834
+ inFlight = false;
4835
+ failureCount = 0;
4836
+ generation = 0;
4837
+ get isRunning() {
4838
+ return this.running;
4839
+ }
4840
+ get failures() {
4841
+ return this.failureCount;
4842
+ }
4843
+ get probing() {
4844
+ return this.inFlight;
4845
+ }
4846
+ /** Begin probing (idempotent). Call when a connection is selected as relay. */
4847
+ start() {
4848
+ if (this.running) return;
4849
+ this.running = true;
4850
+ this.failureCount = 0;
4851
+ this.generation++;
4852
+ this.schedule();
4853
+ }
4854
+ /** Stop for good (direct path found, connection closed, auth epoch changed). */
4855
+ stop() {
4856
+ this.running = false;
4857
+ this.generation++;
4858
+ if (this.handle !== null) {
4859
+ this.options.clearTimer(this.handle);
4860
+ this.handle = null;
4861
+ }
4862
+ }
4863
+ schedule() {
4864
+ if (!this.running) return;
4865
+ const generation = this.generation;
4866
+ const delay = computeRelayReprobeDelay(this.failureCount, this.options.random, this.options);
4867
+ this.handle = this.options.setTimer(() => {
4868
+ this.handle = null;
4869
+ void this.tick(generation);
4870
+ }, delay);
4871
+ }
4872
+ async tick(generation) {
4873
+ if (!this.running || generation !== this.generation) return;
4874
+ if (this.inFlight || !this.options.shouldProbe()) {
4875
+ this.schedule();
4876
+ return;
4877
+ }
4878
+ this.inFlight = true;
4879
+ let outcome;
4880
+ try {
4881
+ outcome = await this.options.probe();
4882
+ } catch {
4883
+ outcome = "failed";
4884
+ }
4885
+ this.inFlight = false;
4886
+ if (!this.running || generation !== this.generation) return;
4887
+ if (outcome === "direct") {
4888
+ this.stop();
4889
+ return;
4890
+ }
4891
+ if (outcome !== "skipped") this.failureCount++;
4892
+ this.schedule();
4893
+ }
4894
+ };
4895
+
4896
+ // src/task-stages.ts
4897
+ var REVIEW_VERDICTS = ["approve", "approve_with_nits", "changes_requested", "reject_approach"];
4898
+ var FINDING_SEVERITIES = ["blocking", "major", "minor", "nit"];
4899
+ var FINDING_CATEGORIES = ["correctness", "regression", "test_gap", "scope", "security", "performance", "maintainability"];
4900
+ var PRIOR_FINDING_STATUSES = ["resolved", "unresolved", "dispute_accepted", "dispute_rejected"];
4901
+ var FINDING_RESPONSE_KINDS = ["fixed", "disputed"];
4902
+ var STAGE_PHASES = ["implementing", "self_checking", "awaiting_review", "reviewing", "revising", "done"];
4903
+ var STAGE_PARKED_PHASES = ["self_checking", "awaiting_review", "reviewing"];
4904
+ var STAGE_INDEPENDENCE_MODES = ["different_provider", "fresh_session_ok"];
4905
+ var STAGE_ROLES = ["implement", "revise", "review"];
4906
+ var STAGE_BLOCKED_REASONS = [
4907
+ "review_unresolved",
4908
+ "review_rejected_approach",
4909
+ "review_unavailable",
4910
+ "self_check_failed",
4911
+ "stage_pipeline_ceiling",
4912
+ "reviewer_mutated_source",
4913
+ // The read-lease checkout could not be fingerprinted (start or end): the review's integrity cannot be verified.
4914
+ "reviewer_integrity_unverifiable"
4915
+ ];
4916
+ var STAGE_DECIDE_ACTIONS = ["accept", "revise_once", "rereview", "abandon"];
4917
+ var STAGE_MAX_REVISIONS_LIMIT = 3;
4918
+ var STAGE_DEFAULT_MAX_REVISIONS = 2;
4919
+ var STAGE_SELF_CHECK_MAX_BOUNCES = 2;
4920
+ var STAGE_INDEPENDENCE_FALLBACK_MS = 10 * 60 * 1e3;
4921
+ var STAGE_PIPELINE_CEILING_DEFAULT_MS = 4 * 60 * 60 * 1e3;
4922
+ var REVIEW_FINDINGS_MAX = 30;
4923
+ var REVIEW_CLAIM_MAX_CHARS = 500;
4924
+ var REVIEW_EVIDENCE_MAX_CHARS = 1e3;
4925
+ var REVIEW_FIX_MAX_CHARS = 500;
4926
+ var REVIEW_FINDING_ID_MAX_CHARS = 40;
4927
+ var REVIEW_CHECKED_MAX = 20;
4928
+ var REVIEW_NOTE_MAX_CHARS = 500;
4929
+ var REVIEW_TESTS_RUN_MAX = 20;
4930
+ var FINDING_RESPONSES_MAX = 30;
4931
+ function makeGuard4(values) {
4932
+ const set = new Set(values);
4933
+ return (value) => typeof value === "string" && set.has(value);
4934
+ }
4935
+ var isReviewVerdict = makeGuard4(REVIEW_VERDICTS);
4936
+ var isFindingSeverity = makeGuard4(FINDING_SEVERITIES);
4937
+ var isFindingCategory = makeGuard4(FINDING_CATEGORIES);
4938
+ var isPriorFindingStatus = makeGuard4(PRIOR_FINDING_STATUSES);
4939
+ var isFindingResponseKind = makeGuard4(FINDING_RESPONSE_KINDS);
4940
+ var isStageBlockedReason = makeGuard4(STAGE_BLOCKED_REASONS);
4941
+ var isRecord4 = (v) => !!v && typeof v === "object" && !Array.isArray(v);
4942
+ function isBlockingSeverity(severity) {
4943
+ return severity === "blocking" || severity === "major";
4944
+ }
4945
+ function resolveStagePlan(raw, task, opts = {}) {
4946
+ const eligible = isStageEligibleTask(task);
4947
+ if (raw === void 0 || raw === null) return (opts.defaultOn ?? false) && defaultsOnFor(task) ? defaultStagePlan() : null;
4948
+ if (raw === false) return null;
4949
+ if (raw === true) {
4950
+ if (!eligible) throw new Error(`invalid_review_option: review requires a non-readonly code_change task (got taskMode=${task.taskMode ?? "unset"}${task.readonly ? ", readonly" : ""})`);
4951
+ return defaultStagePlan();
4952
+ }
4953
+ if (!isRecord4(raw)) throw new Error("invalid_review_option: review must be true, false or {max_revisions?, independence?}");
4954
+ const allowed = /* @__PURE__ */ new Set(["max_revisions", "maxRevisions", "independence"]);
4955
+ for (const key of Object.keys(raw)) {
4956
+ if (!allowed.has(key)) throw new Error(`invalid_review_option: unknown review key '${key}' (expected max_revisions, independence)`);
4957
+ }
4958
+ if (!eligible) throw new Error(`invalid_review_option: review requires a non-readonly code_change task (got taskMode=${task.taskMode ?? "unset"}${task.readonly ? ", readonly" : ""})`);
4959
+ const rawMax = raw.max_revisions ?? raw.maxRevisions;
4960
+ let maxRevisions = STAGE_DEFAULT_MAX_REVISIONS;
4961
+ if (rawMax !== void 0) {
4962
+ if (typeof rawMax !== "number" || !Number.isInteger(rawMax) || rawMax < 0 || rawMax > STAGE_MAX_REVISIONS_LIMIT) {
4963
+ throw new Error(`invalid_review_option: max_revisions must be an integer 0..${STAGE_MAX_REVISIONS_LIMIT}`);
4964
+ }
4965
+ maxRevisions = rawMax;
4966
+ }
4967
+ let independence = "fresh_session_ok";
4968
+ if (raw.independence !== void 0) {
4969
+ if (!STAGE_INDEPENDENCE_MODES.includes(raw.independence)) {
4970
+ throw new Error(`invalid_review_option: independence must be one of ${STAGE_INDEPENDENCE_MODES.join(" | ")}`);
4971
+ }
4972
+ independence = raw.independence;
4973
+ }
4974
+ return { review: true, maxRevisions, independence };
4975
+ }
4976
+ function defaultStagePlan() {
4977
+ return { review: true, maxRevisions: STAGE_DEFAULT_MAX_REVISIONS, independence: "fresh_session_ok" };
4978
+ }
4979
+ function isStageEligibleTask(task) {
4980
+ if (task.readonly) return false;
4981
+ return (task.taskMode ?? "code_change") === "code_change";
4982
+ }
4983
+ function defaultsOnFor(task) {
4984
+ return isStageEligibleTask(task) && (task.difficulty === "medium" || task.difficulty === "difficult");
4985
+ }
4986
+ function str2(value) {
4987
+ return typeof value === "string" ? value.trim() : "";
4988
+ }
4989
+ function validateStringList(value, field, max, maxChars, errors, minItems = 0) {
4990
+ if (!Array.isArray(value)) {
4991
+ errors.push({ field, message: `${field} must be an array of strings` });
4992
+ return [];
4993
+ }
4994
+ if (value.length > max) errors.push({ field, message: `${field} has ${value.length} entries, over the ${max} limit` });
4995
+ const out = [];
4996
+ for (const item of value) {
4997
+ const text = str2(item);
4998
+ if (!text) continue;
4999
+ if (text.length > maxChars) {
5000
+ errors.push({ field, message: `${field} contains an entry over ${maxChars} chars` });
5001
+ continue;
5002
+ }
5003
+ out.push(text);
5004
+ }
5005
+ 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` });
5006
+ return out;
5007
+ }
5008
+ function validateReviewReport(raw, ctx) {
5009
+ const errors = [];
5010
+ if (!isRecord4(raw)) return { errors: [{ field: "review", message: "review must be an object {verdict, findings, checked, notChecked, ...}" }] };
5011
+ const KNOWN = /* @__PURE__ */ new Set(["verdict", "findings", "priorFindings", "checked", "notChecked", "testsRun"]);
5012
+ 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(", ")})` });
5013
+ const verdict = raw.verdict;
5014
+ if (!isReviewVerdict(verdict)) errors.push({ field: "review.verdict", message: `verdict must be one of ${REVIEW_VERDICTS.join(" | ")}` });
5015
+ const findings = [];
5016
+ if (!Array.isArray(raw.findings)) errors.push({ field: "review.findings", message: "findings must be an array (use [] when there are none)" });
5017
+ else {
5018
+ 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` });
5019
+ const seen = /* @__PURE__ */ new Set();
5020
+ raw.findings.forEach((f, i) => {
5021
+ const at = `review.findings[${i}]`;
5022
+ if (!isRecord4(f)) {
5023
+ errors.push({ field: at, message: "each finding must be an object" });
5024
+ return;
5025
+ }
5026
+ const FK = /* @__PURE__ */ new Set(["id", "severity", "category", "file", "line", "claim", "evidence", "suggestedFix"]);
5027
+ for (const key of Object.keys(f)) if (!FK.has(key)) errors.push({ field: `${at}.${key}`, message: `unknown field '${key}'` });
5028
+ const id2 = str2(f.id);
5029
+ 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)` });
5030
+ else if (seen.has(id2)) errors.push({ field: `${at}.id`, message: `duplicate finding id '${id2}'` });
5031
+ else seen.add(id2);
5032
+ if (!isFindingSeverity(f.severity)) errors.push({ field: `${at}.severity`, message: `severity must be one of ${FINDING_SEVERITIES.join(" | ")}` });
5033
+ if (!isFindingCategory(f.category)) errors.push({ field: `${at}.category`, message: `category must be one of ${FINDING_CATEGORIES.join(" | ")}` });
5034
+ const claim = str2(f.claim);
5035
+ if (!claim) errors.push({ field: `${at}.claim`, message: "claim is required" });
5036
+ else if (claim.length > REVIEW_CLAIM_MAX_CHARS) errors.push({ field: `${at}.claim`, message: `claim is over ${REVIEW_CLAIM_MAX_CHARS} chars` });
5037
+ const evidence = str2(f.evidence);
5038
+ if (!evidence) errors.push({ field: `${at}.evidence`, message: "evidence is required \u2014 what did you read or run to know this" });
5039
+ else if (evidence.length > REVIEW_EVIDENCE_MAX_CHARS) errors.push({ field: `${at}.evidence`, message: `evidence is over ${REVIEW_EVIDENCE_MAX_CHARS} chars` });
5040
+ const fix = f.suggestedFix === void 0 ? void 0 : str2(f.suggestedFix);
5041
+ if (fix !== void 0 && fix.length > REVIEW_FIX_MAX_CHARS) errors.push({ field: `${at}.suggestedFix`, message: `suggestedFix is over ${REVIEW_FIX_MAX_CHARS} chars` });
5042
+ if (f.file !== void 0 && typeof f.file !== "string") errors.push({ field: `${at}.file`, message: "file must be a string" });
5043
+ 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" });
5044
+ if (id2 && isFindingSeverity(f.severity) && isFindingCategory(f.category) && claim && evidence) {
5045
+ findings.push({
5046
+ id: id2,
5047
+ severity: f.severity,
5048
+ category: f.category,
5049
+ ...typeof f.file === "string" && f.file.trim() ? { file: f.file.trim() } : {},
5050
+ ...typeof f.line === "number" ? { line: f.line } : {},
5051
+ claim,
5052
+ evidence,
5053
+ ...fix ? { suggestedFix: fix } : {}
5054
+ });
5055
+ }
5056
+ });
5057
+ }
5058
+ const checked = validateStringList(raw.checked, "review.checked", REVIEW_CHECKED_MAX, REVIEW_CLAIM_MAX_CHARS, errors, 1);
5059
+ const notChecked = validateStringList(raw.notChecked, "review.notChecked", REVIEW_CHECKED_MAX, REVIEW_CLAIM_MAX_CHARS, errors, 1);
5060
+ let priorFindings;
5061
+ if (raw.priorFindings !== void 0) {
5062
+ if (!Array.isArray(raw.priorFindings)) errors.push({ field: "review.priorFindings", message: "priorFindings must be an array" });
5063
+ else {
5064
+ priorFindings = [];
5065
+ raw.priorFindings.forEach((p, i) => {
5066
+ const at = `review.priorFindings[${i}]`;
5067
+ if (!isRecord4(p)) {
5068
+ errors.push({ field: at, message: "each entry must be an object {id, status, note?}" });
5069
+ return;
5070
+ }
5071
+ for (const key of Object.keys(p)) if (!["id", "status", "note"].includes(key)) errors.push({ field: `${at}.${key}`, message: `unknown field '${key}'` });
5072
+ const id2 = str2(p.id);
5073
+ if (!id2) errors.push({ field: `${at}.id`, message: "id is required" });
5074
+ if (!isPriorFindingStatus(p.status)) errors.push({ field: `${at}.status`, message: `status must be one of ${PRIOR_FINDING_STATUSES.join(" | ")}` });
5075
+ const note = p.note === void 0 ? void 0 : str2(p.note);
5076
+ if (note !== void 0 && note.length > REVIEW_NOTE_MAX_CHARS) errors.push({ field: `${at}.note`, message: `note is over ${REVIEW_NOTE_MAX_CHARS} chars` });
5077
+ if (id2 && isPriorFindingStatus(p.status)) priorFindings.push({ id: id2, status: p.status, ...note ? { note } : {} });
5078
+ });
5079
+ }
5080
+ }
5081
+ const testsRun = raw.testsRun === void 0 ? void 0 : validateTestsRun(raw.testsRun, "review.testsRun", errors);
5082
+ if (isReviewVerdict(verdict)) {
5083
+ const blocking = findings.filter((f) => isBlockingSeverity(f.severity));
5084
+ if (verdict === "changes_requested" && blocking.length === 0 && Array.isArray(raw.findings) && errors.length === 0) {
5085
+ errors.push({ field: "review.verdict", message: "changes_requested needs at least one blocking or major finding \u2014 nits alone are approve_with_nits" });
5086
+ }
5087
+ if (verdict === "approve" && blocking.length > 0) {
5088
+ errors.push({ field: "review.verdict", message: "approve cannot carry blocking or major findings" });
5089
+ }
5090
+ if (verdict === "approve_with_nits" && blocking.length > 0) {
5091
+ errors.push({ field: "review.verdict", message: "approve_with_nits cannot carry blocking or major findings \u2014 use changes_requested" });
5092
+ }
5093
+ }
5094
+ if (ctx.round >= 2 && ctx.priorOpenBlockingIds?.length) {
5095
+ const answered = new Set((priorFindings ?? []).map((p) => p.id));
5096
+ const missing = ctx.priorOpenBlockingIds.filter((id2) => !answered.has(id2));
5097
+ 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(", ")}` });
5098
+ }
5099
+ if (errors.length) return { errors };
5100
+ return {
5101
+ report: {
5102
+ verdict,
5103
+ findings,
5104
+ ...priorFindings?.length ? { priorFindings } : {},
5105
+ checked,
5106
+ notChecked,
5107
+ ...testsRun?.length ? { testsRun } : {}
5108
+ },
5109
+ errors: []
5110
+ };
5111
+ }
5112
+ function validateTestsRun(raw, field, errors) {
5113
+ if (!Array.isArray(raw)) {
5114
+ errors.push({ field, message: `${field} must be an array of {command, exit, passed?, failed?, note?}` });
5115
+ return [];
5116
+ }
5117
+ if (raw.length > REVIEW_TESTS_RUN_MAX) errors.push({ field, message: `${field} has ${raw.length} entries, over the ${REVIEW_TESTS_RUN_MAX} limit` });
5118
+ const out = [];
5119
+ raw.forEach((t, i) => {
5120
+ const at = `${field}[${i}]`;
5121
+ if (!isRecord4(t)) {
5122
+ errors.push({ field: at, message: "each entry must be an object" });
5123
+ return;
5124
+ }
5125
+ for (const key of Object.keys(t)) if (!["command", "exit", "passed", "failed", "note"].includes(key)) errors.push({ field: `${at}.${key}`, message: `unknown field '${key}'` });
5126
+ const command = str2(t.command);
5127
+ if (!command || command.length > REVIEW_CLAIM_MAX_CHARS) errors.push({ field: `${at}.command`, message: `command is required (\u2264 ${REVIEW_CLAIM_MAX_CHARS} chars)` });
5128
+ if (typeof t.exit !== "number" || !Number.isInteger(t.exit)) errors.push({ field: `${at}.exit`, message: "exit must be an integer" });
5129
+ for (const k of ["passed", "failed"]) {
5130
+ 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` });
5131
+ }
5132
+ const note = t.note === void 0 ? void 0 : str2(t.note);
5133
+ if (note !== void 0 && note.length > REVIEW_NOTE_MAX_CHARS) errors.push({ field: `${at}.note`, message: `note is over ${REVIEW_NOTE_MAX_CHARS} chars` });
5134
+ if (command && typeof t.exit === "number") {
5135
+ out.push({
5136
+ command,
5137
+ exit: t.exit,
5138
+ ...typeof t.passed === "number" ? { passed: t.passed } : {},
5139
+ ...typeof t.failed === "number" ? { failed: t.failed } : {},
5140
+ ...note ? { note } : {}
5141
+ });
5142
+ }
5143
+ });
5144
+ return out;
5145
+ }
5146
+ function validateFindingResponses(raw, field = "findingResponses") {
5147
+ const errors = [];
5148
+ if (!Array.isArray(raw)) return { errors: [{ field, message: `${field} must be an array of {id, response, note}` }] };
5149
+ if (raw.length > FINDING_RESPONSES_MAX) errors.push({ field, message: `${field} has ${raw.length} entries, over the ${FINDING_RESPONSES_MAX} limit` });
5150
+ const out = [];
5151
+ raw.forEach((r, i) => {
5152
+ const at = `${field}[${i}]`;
5153
+ if (!isRecord4(r)) {
5154
+ errors.push({ field: at, message: "each entry must be an object {id, response, note}" });
5155
+ return;
5156
+ }
5157
+ for (const key of Object.keys(r)) if (!["id", "response", "note"].includes(key)) errors.push({ field: `${at}.${key}`, message: `unknown field '${key}'` });
5158
+ const id2 = str2(r.id);
5159
+ if (!id2) errors.push({ field: `${at}.id`, message: "id is required" });
5160
+ if (!isFindingResponseKind(r.response)) errors.push({ field: `${at}.response`, message: `response must be one of ${FINDING_RESPONSE_KINDS.join(" | ")}` });
5161
+ const note = str2(r.note);
5162
+ if (!note) errors.push({ field: `${at}.note`, message: "note is required \u2014 say what changed, or why you dispute it" });
5163
+ else if (note.length > REVIEW_NOTE_MAX_CHARS) errors.push({ field: `${at}.note`, message: `note is over ${REVIEW_NOTE_MAX_CHARS} chars` });
5164
+ if (id2 && isFindingResponseKind(r.response) && note && note.length <= REVIEW_NOTE_MAX_CHARS) out.push({ id: id2, response: r.response, note });
5165
+ });
5166
+ return errors.length ? { errors } : { responses: out, errors: [] };
5167
+ }
5168
+ function formatStageVerdictLine(input) {
5169
+ const parts = [`review: ${input.verdict}`];
5170
+ if (input.verdict === "skipped_no_diff") return parts[0];
5171
+ parts.push(`${input.rounds} round${input.rounds === 1 ? "" : "s"}`);
5172
+ if (input.reviewerProvider) parts.push(`reviewer ${input.reviewerProvider} (${input.independenceUsed ?? "different_provider"})`);
5173
+ const tail = [];
5174
+ if (input.fixed) tail.push(`${input.fixed} finding${input.fixed === 1 ? "" : "s"} fixed`);
5175
+ if (input.openNits) tail.push(`${input.openNits} nit${input.openNits === 1 ? "" : "s"} open`);
5176
+ return tail.length ? `${parts.join(" \xB7 ")} \xB7 ${tail.join(", ")}` : parts.join(" \xB7 ");
5177
+ }
3897
5178
  // Annotate the CommonJS export names for ESM import in node:
3898
5179
  0 && (module.exports = {
5180
+ ASSISTANT_ACCOUNT_SLOT,
5181
+ ASSISTANT_FOLLOWER_ALLOWED_OPS,
3899
5182
  ASSISTANT_OWNER_VERBS,
5183
+ ASSISTANT_REMOTE_FOLLOW_COMMAND,
5184
+ ASSISTANT_REMOTE_PROJECT_ACCESS_COMMAND,
5185
+ ASSISTANT_REMOTE_PROJECT_CATALOG_COMMAND,
5186
+ ASSISTANT_REMOTE_PROJECT_COMMAND,
3900
5187
  ASSISTANT_REVIEW_TURN_VERBS,
3901
5188
  ASSISTANT_SESSION_ID_ARG,
3902
5189
  ASSISTANT_SESSION_ID_ENV,
@@ -3908,12 +5195,16 @@ function isProviderQuestionBinding(value) {
3908
5195
  CANCEL_REASONS,
3909
5196
  CANONICAL_MESH_TOOL_COUNT,
3910
5197
  CANONICAL_MESH_TOOL_NAMES,
5198
+ CARRY_OVER_MISSION_GOAL,
5199
+ CARRY_OVER_MISSION_TITLE,
5200
+ CHANGELOG_SECTIONS,
3911
5201
  CLAUDE_TUI_REVIEW_PAGE_NOT_FOCUSED_PREFIX,
3912
5202
  CLAUDE_TUI_REVIEW_UNCONFIRMED_PREFIX,
3913
5203
  CLI_SLOT_RECIPES,
3914
5204
  COMMIT_STRENGTHS,
3915
5205
  CONSUME_PROFILES,
3916
5206
  COORDINATOR_ACK_OUTCOMES,
5207
+ COORDINATOR_SETTABLE_ITEM_STATES,
3917
5208
  DAEMON_METADATA_DOC_SPEC,
3918
5209
  DAEMON_P2P_SIGNAL_TYPES,
3919
5210
  DAEMON_STATUS_EVENT_NAMES,
@@ -3926,13 +5217,34 @@ function isProviderQuestionBinding(value) {
3926
5217
  DASHBOARD_TO_DAEMON_P2P_TYPES,
3927
5218
  DASHBOARD_TO_USER_SESSION_TYPES,
3928
5219
  DASHBOARD_WIRE_VERSION,
5220
+ DECISION_PUSH_OPTIONS_MAX,
5221
+ DECISION_PUSH_OPTION_LABEL_MAX,
5222
+ DECISION_PUSH_QUESTION_MAX,
5223
+ DECISION_PUSH_RELAY_COMMAND,
5224
+ DECISION_PUSH_RELAY_SOURCE,
3929
5225
  DEFAULT_DIFFICULTY_BRAINS,
3930
5226
  DELIVERY_OUTCOMES,
3931
5227
  DELIVERY_VIAS,
3932
5228
  DISPATCH_FAILURE_REASONS,
5229
+ DISPATCH_REFUSAL_DETAIL_MAX,
3933
5230
  EVIDENCE_ENVELOPE_FIELD_SPECS,
3934
5231
  EVIDENCE_SOURCE_IDS,
5232
+ FINDING_CATEGORIES,
5233
+ FINDING_RESPONSES_MAX,
5234
+ FINDING_RESPONSE_KINDS,
5235
+ FINDING_SEVERITIES,
3935
5236
  HOLD_REASONS,
5237
+ LAUNCH_DEFAULTS_NEXT_LAUNCH_NOTE,
5238
+ LAUNCH_DEFAULT_ERROR_CODES,
5239
+ LAUNCH_DEFAULT_ROLES,
5240
+ LAUNCH_DEFAULT_SOURCES,
5241
+ LEGACY_CARRY_OVER_MISSION_TITLE,
5242
+ LIGHT_BLOCK_REASONS,
5243
+ LIGHT_HOLD,
5244
+ LIGHT_LAND_MODES,
5245
+ LIGHT_REJECT,
5246
+ LIGHT_TESTS_RUN_MAX,
5247
+ LIGHT_WARNINGS,
3936
5248
  LIVENESS_RESULTS,
3937
5249
  MAX_MESH_RECORD_STRING,
3938
5250
  MAX_OWNED_PATHS,
@@ -3947,6 +5259,8 @@ function isProviderQuestionBinding(value) {
3947
5259
  MESH_MISSION_STATUSES,
3948
5260
  MESH_P2P_SIGNAL_TYPES,
3949
5261
  MESH_RECORD_PAYLOAD_KEYS,
5262
+ MESH_RELEASE_CHANNELS,
5263
+ MESH_RELEASE_STATUSES,
3950
5264
  MESH_SESSION_CLEANUP_MODES,
3951
5265
  MESH_STATUS_DOC_SPEC,
3952
5266
  MESH_TASK_DIFFICULTIES,
@@ -3958,10 +5272,23 @@ function isProviderQuestionBinding(value) {
3958
5272
  MESH_TOPIC_ENTRY_KINDS,
3959
5273
  MESH_TOPIC_PROTOCOL_VERSION,
3960
5274
  MISSION_BRIEF_RENDER_MAX_CHARS,
5275
+ MISSION_DECISION_ON_DUE,
5276
+ MISSION_DECISION_OPTION_IDS,
5277
+ MISSION_DECISION_URGENCIES,
5278
+ MISSION_GIT_STATES,
5279
+ MISSION_ITEM_KINDS,
5280
+ MISSION_ITEM_STATES,
5281
+ MISSION_LIMITS,
5282
+ MISSION_OUTCOMES,
5283
+ MISSION_REF_GIT_METHODS,
5284
+ MISSION_REF_GIT_STATUSES,
5285
+ MISSION_REF_KINDS,
5286
+ MISSION_RELEASE_EVENT_TYPES,
3961
5287
  MODEL_AXIS_SOURCES,
3962
5288
  MODEL_SELECTION_HISTORY_LIMIT,
3963
5289
  MeshChunkAssembler,
3964
5290
  NATIVE_TURN_OUTCOMES,
5291
+ NEEDS_WORDING_MARKER,
3965
5292
  NOTIFY_KINDS,
3966
5293
  NO_PROGRESS_OBSERVED_STATUSES,
3967
5294
  NPM_UPDATE_TAGS,
@@ -3971,16 +5298,37 @@ function isProviderQuestionBinding(value) {
3971
5298
  OPERATOR_STATUS_REASON_VALUES,
3972
5299
  OPERATOR_STATUS_VALUES,
3973
5300
  OUTBOUND_MESSAGE_ORIGINS,
5301
+ OWNER_ABANDON_CONFIRM_KEY_PREFIX,
5302
+ OWNER_ABANDON_CONFIRM_OPTIONS,
5303
+ OWNER_ABANDON_CONFIRM_QUESTION,
3974
5304
  P2P_SIGNAL_TYPES,
5305
+ PRIOR_FINDING_STATUSES,
3975
5306
  PROVIDER_FAILURES,
3976
5307
  QUOTA_BACKFILL_HORIZON_MS,
3977
5308
  QUOTA_RETRY_INFLIGHT_GRACE_MS,
3978
5309
  QUOTA_SUPPORTED_PROVIDERS,
3979
5310
  RECENT_SESSION_BUCKETS,
3980
5311
  RECLAIMING_SEND_REFUSALS,
5312
+ RELAY_REPROBE_BASE_DELAY_MS,
5313
+ RELAY_REPROBE_JITTER_RATIO,
5314
+ RELAY_REPROBE_MAX_DELAY_MS,
5315
+ RELEASE_ACTORS,
3981
5316
  RELEASE_CHANNELS,
5317
+ RELEASE_EVENT_TYPES,
5318
+ RELEASE_LIMITS,
5319
+ RELEASE_MEMBER_STATES,
3982
5320
  REMOVED_MESH_TOOLS,
3983
5321
  RETIRED_MESH_TOOLS,
5322
+ REVIEW_CHECKED_MAX,
5323
+ REVIEW_CLAIM_MAX_CHARS,
5324
+ REVIEW_EVIDENCE_MAX_CHARS,
5325
+ REVIEW_FINDINGS_MAX,
5326
+ REVIEW_FINDING_ID_MAX_CHARS,
5327
+ REVIEW_FIX_MAX_CHARS,
5328
+ REVIEW_NOTE_MAX_CHARS,
5329
+ REVIEW_TESTS_RUN_MAX,
5330
+ REVIEW_VERDICTS,
5331
+ RelayReprobeScheduler,
3984
5332
  SEND_POLICY_MODES,
3985
5333
  SEND_REFUSAL_REASONS,
3986
5334
  SERVER_STATUS_EVENT_NAMES,
@@ -3993,6 +5341,17 @@ function isProviderQuestionBinding(value) {
3993
5341
  SESSION_STATUS_ALIASES,
3994
5342
  SESSION_STATUS_CLASS,
3995
5343
  SHARED_SESSION_TO_VIEWER_TYPES,
5344
+ STAGE_BLOCKED_REASONS,
5345
+ STAGE_DECIDE_ACTIONS,
5346
+ STAGE_DEFAULT_MAX_REVISIONS,
5347
+ STAGE_INDEPENDENCE_FALLBACK_MS,
5348
+ STAGE_INDEPENDENCE_MODES,
5349
+ STAGE_MAX_REVISIONS_LIMIT,
5350
+ STAGE_PARKED_PHASES,
5351
+ STAGE_PHASES,
5352
+ STAGE_PIPELINE_CEILING_DEFAULT_MS,
5353
+ STAGE_ROLES,
5354
+ STAGE_SELF_CHECK_MAX_BOUNCES,
3996
5355
  STATUS_PROBE_ARG_KEY,
3997
5356
  SUSPENSION_MODALS,
3998
5357
  SUSPENSION_RESOLUTIONS,
@@ -4018,18 +5377,27 @@ function isProviderQuestionBinding(value) {
4018
5377
  VERSION_UPDATE_REASONS,
4019
5378
  VIEWER_TO_SHARED_SESSION_TYPES,
4020
5379
  WORKER_BRANCH_STATES,
5380
+ WORKER_COMMITS_MAX,
5381
+ WORKER_CURRENT_BRANCH_RULE,
5382
+ WORKER_DECISIONS_NEEDED_MAX,
4021
5383
  WORKER_PROTOCOL_FOOTER_MARKER,
4022
5384
  WORKER_REPORT_OUTCOMES,
4023
5385
  WORKER_REPORT_SUMMARY_MAX_CHARS,
5386
+ WORKER_SHELL_LITERAL_PATHS_RULE,
4024
5387
  WORKER_TOOLS,
5388
+ aggregateMissionGitState,
4025
5389
  appendWorkerProtocolFooter,
4026
5390
  argsCarryStatusProbeMarker,
4027
5391
  assessQuotaFreshness,
5392
+ boundEventPayload,
4028
5393
  buildSlotProposal,
4029
5394
  canonicalDaemonId,
5395
+ changelogMissionMarker,
5396
+ classifyChangelogSection,
4030
5397
  classifySessionStatus,
4031
5398
  compareDashboardWireVersion,
4032
5399
  compareSemver,
5400
+ computeRelayReprobeDelay,
4033
5401
  daemonIdsEquivalent,
4034
5402
  decodeActiveWorkQueryRequest,
4035
5403
  decodeActiveWorkQueryResponse,
@@ -4072,6 +5440,8 @@ function isProviderQuestionBinding(value) {
4072
5440
  decodeQueueQueryResponse,
4073
5441
  decodeQueueRequeueRequest,
4074
5442
  decodeQueueRequeueResponse,
5443
+ decodeQueueReviseRequest,
5444
+ decodeQueueReviseResponse,
4075
5445
  decodeRecordLocalRequest,
4076
5446
  decodeRecordLocalResponse,
4077
5447
  decodeRecoveryContextQueryRequest,
@@ -4091,6 +5461,8 @@ function isProviderQuestionBinding(value) {
4091
5461
  decodeUserSessionToDashboard,
4092
5462
  decodeViewerToSharedSession,
4093
5463
  defaultProviderPriorityFromNodeFacts,
5464
+ defaultStagePlan,
5465
+ deriveItemDedupeKey,
4094
5466
  deriveProviderPriorityFromSlots,
4095
5467
  deriveSlotsFromLegacy,
4096
5468
  describeModelSelection,
@@ -4101,14 +5473,21 @@ function isProviderQuestionBinding(value) {
4101
5473
  expandDaemonIdForms,
4102
5474
  findOwnershipConflicts,
4103
5475
  foldKeyedDoc,
5476
+ followedRemoteProjectKey,
5477
+ followerOpPermitted,
4104
5478
  formatQuotaAccount,
5479
+ formatStageVerdictLine,
4105
5480
  hasGitStatusEvidence,
4106
5481
  hasWorkerProtocolFooter,
4107
5482
  interpolateString,
4108
5483
  isActionableProviderApproval,
5484
+ isAssistantFollowerAllowedOp,
4109
5485
  isAssistantTool,
4110
5486
  isBlockedStatus,
5487
+ isBlockingSeverity,
4111
5488
  isBusyStatus,
5489
+ isCarryOverMissionRecord,
5490
+ isCarryOverMissionTitle,
4112
5491
  isChunkType,
4113
5492
  isCommitStrength,
4114
5493
  isDaemonDirectCommandType,
@@ -4124,14 +5503,21 @@ function isProviderQuestionBinding(value) {
4124
5503
  isDeadStatus,
4125
5504
  isDowngrade,
4126
5505
  isEvidenceIdentifier,
5506
+ isFindingCategory,
5507
+ isFindingResponseKind,
5508
+ isFindingSeverity,
4127
5509
  isFiniteNumber,
4128
5510
  isIdleSessionState,
4129
5511
  isInputEnvelopeWire,
5512
+ isLaunchDefaultRole,
5513
+ isLaunchDefaultSource,
5514
+ isLightWorkerSession,
4130
5515
  isMeshDeliveryMode,
4131
5516
  isMeshIndexQueryResponse,
4132
5517
  isMeshMissionStatusValue,
4133
5518
  isMeshP2PSignalType,
4134
5519
  isMeshRecordPayload,
5520
+ isMeshReleaseChannel,
4135
5521
  isMeshTaskDifficulty,
4136
5522
  isMeshTaskMode,
4137
5523
  isMeshTaskPriority,
@@ -4139,6 +5525,8 @@ function isProviderQuestionBinding(value) {
4139
5525
  isMeshTerminalTaskStatus,
4140
5526
  isMeshTopicEntry,
4141
5527
  isMessageId,
5528
+ isMissionOutcome,
5529
+ isMissionRefContained,
4142
5530
  isMissionUpsertResponse,
4143
5531
  isModelAxisSource,
4144
5532
  isNativeMarkerRef,
@@ -4148,10 +5536,13 @@ function isProviderQuestionBinding(value) {
4148
5536
  isOutboundMessageOrigin,
4149
5537
  isP2PSignalType,
4150
5538
  isPhantomDaemonEntry,
5539
+ isPriorFindingStatus,
4151
5540
  isProviderQuestionBinding,
4152
5541
  isRawDaemonDoId,
4153
5542
  isReadyStatus,
4154
5543
  isRecord,
5544
+ isReleaseStatus,
5545
+ isReviewVerdict,
4155
5546
  isSendPolicy,
4156
5547
  isSendPolicyMode,
4157
5548
  isSendRefusal,
@@ -4160,6 +5551,8 @@ function isProviderQuestionBinding(value) {
4160
5551
  isSessionLaunchedBy,
4161
5552
  isSessionStatus,
4162
5553
  isSharedSessionToViewerType,
5554
+ isStageBlockedReason,
5555
+ isStageEligibleTask,
4163
5556
  isSubmitOutcome,
4164
5557
  isSummaryRef,
4165
5558
  isTerminalSessionRecordStatus,
@@ -4178,6 +5571,7 @@ function isProviderQuestionBinding(value) {
4178
5571
  isWorkingStatus,
4179
5572
  joinRepoPath,
4180
5573
  launchModelSelectionValue,
5574
+ lintChangelogText,
4181
5575
  machineCoreFromDaemonId,
4182
5576
  makeTypeGuard,
4183
5577
  measureWorstCaseChunkEnvelopeBytes,
@@ -4189,20 +5583,29 @@ function isProviderQuestionBinding(value) {
4189
5583
  minutesUntilQuotaCheck,
4190
5584
  normalizeAuthOkLimits,
4191
5585
  normalizeBrainSlot,
5586
+ normalizeDecisionInput,
4192
5587
  normalizeDifficultyBrainMap,
5588
+ normalizeForDedupe,
4193
5589
  normalizeGitStatus,
4194
5590
  normalizeMeshNodeFacts,
4195
5591
  normalizeMeshNodeId,
4196
5592
  normalizeMeshSessionRecord,
4197
5593
  normalizeMeshWorkspaceForCompare,
4198
5594
  normalizeMissionBrief,
5595
+ normalizeMissionItemInput,
5596
+ normalizeMissionItemUpdate,
5597
+ normalizeMissionRefs,
5598
+ normalizeMissionSummary,
4199
5599
  normalizeNodeCapabilitySlot,
4200
5600
  normalizeNodeCapabilitySlots,
5601
+ normalizeOutcomeReason,
4201
5602
  normalizeOwnedPaths,
5603
+ normalizeReportCommits,
4202
5604
  normalizeSessionStatus,
4203
5605
  normalizeThinkingLevel,
4204
5606
  orderProvidersByBuiltinPreference,
4205
5607
  parseJsonRecord,
5608
+ parseRoleLaunchSelection,
4206
5609
  parseSemver,
4207
5610
  parseSessionLaunchRecord,
4208
5611
  pathsOverlap,
@@ -4221,11 +5624,17 @@ function isProviderQuestionBinding(value) {
4221
5624
  readStringArray,
4222
5625
  readText,
4223
5626
  renderCoordinatorWorkerSection,
5627
+ renderLightWorkspaceRules,
4224
5628
  renderMissionBriefBlock,
5629
+ renderStageProtocolLines,
4225
5630
  renderWorkerProtocolFooter,
5631
+ resolveStagePlan,
4226
5632
  retiredMeshToolError,
5633
+ reviewIndependenceOf,
5634
+ sanitizeDispatchRefusalDetail,
4227
5635
  sanitizeModelIdentifier,
4228
5636
  sanitizeRefusalCode,
5637
+ sanitizeRemoteRepoIdentity,
4229
5638
  scoreGitStatusCandidate,
4230
5639
  scoreGitUpstreamFreshness,
4231
5640
  sessionIdsEquivalent,
@@ -4236,6 +5645,11 @@ function isProviderQuestionBinding(value) {
4236
5645
  summarizeGitShape,
4237
5646
  supportsQuota,
4238
5647
  touchedFilesOutsideOwnership,
5648
+ truncateMissionText,
5649
+ unwrapPastedContent,
5650
+ validateFindingResponses,
5651
+ validateReviewReport,
5652
+ validateTestsRun,
4239
5653
  withStatusProbeMarker
4240
5654
  });
4241
5655
  //# sourceMappingURL=index.js.map