vibe64 0.1.21 → 0.1.22

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 (143) hide show
  1. package/dist/assets/ProjectTypeGate-B3NHteXC.js +1 -0
  2. package/dist/assets/ProjectTypeGate-fJcYj6sR.css +1 -0
  3. package/dist/assets/{SetupReadinessGate-DkkorR2Y.js → SetupReadinessGate-2twHjoYZ.js} +1 -1
  4. package/dist/assets/{ShellLayout-BcKS2HG9.js → ShellLayout-BjAbXfzf.js} +1 -1
  5. package/dist/assets/{VTabs-BJ8MKoig.js → VTabs-BLGGdbms.js} +1 -1
  6. package/dist/assets/{error-CwT53qTu.js → error-DvUPciuh.js} +1 -1
  7. package/dist/assets/history-DfM4ewyV.js +1 -0
  8. package/dist/assets/home-sh4v0vz7.js +1 -0
  9. package/dist/assets/index-C4JbNnml.css +1 -0
  10. package/dist/assets/{index-BJxDQvyK.js → index-CdFWokfE.js} +1 -1
  11. package/dist/assets/index-D4oqjV9n.js +132 -0
  12. package/dist/assets/{index-CY-wDjNv.js → index-DqoYKexs.js} +15 -15
  13. package/dist/assets/{placement-7FCYadh2.js → placement-QfRaYTFY.js} +1 -1
  14. package/dist/assets/{setup-BzzdD38G.js → setup-B-WOti3H.js} +2 -2
  15. package/dist/assets/{streamEvents-Ba9kHw-1.js → streamEvents-CIqegoLa.js} +1 -1
  16. package/dist/assets/{studioGateApi-hkZdLr1Y.js → studioGateApi-CFtez6lH.js} +1 -1
  17. package/dist/assets/{target-scripts-8hczu84t.js → target-scripts-CI-nAISO.js} +1 -1
  18. package/dist/assets/useStudioTerminal-I8tuBymw.js +1 -0
  19. package/dist/assets/vibe64SessionPanelModel-DLdexNxC.js +1 -0
  20. package/dist/index.html +1 -1
  21. package/node_modules/@local/setup-doctor-core/src/server/doctorToolchain.js +4 -0
  22. package/node_modules/@local/studio-terminal-core/src/server/gitGithubTransport.js +33 -0
  23. package/node_modules/@local/studio-terminal-core/src/server/index.js +1 -0
  24. package/node_modules/@local/studio-terminal-core/src/server/terminalSessions.js +51 -1
  25. package/node_modules/@local/vibe64-adapters/src/server/adapter.js +4 -0
  26. package/node_modules/@local/vibe64-adapters/src/server/adapters/laravel/adapter.js +5 -0
  27. package/node_modules/@local/vibe64-adapters/src/server/adapters/laravel/databaseRuntime.js +50 -0
  28. package/node_modules/@local/vibe64-adapters/src/server/configStore.js +22 -1
  29. package/node_modules/@local/vibe64-adapters/src/server/systemPrompts/agent_conversation.txt +0 -2
  30. package/node_modules/@local/vibe64-adapters/src/server/systemPrompts/draft_issue.txt +18 -0
  31. package/node_modules/@local/vibe64-adapters/src/server/systemPrompts/make_plan.txt +14 -2
  32. package/node_modules/@local/vibe64-adapters/src/server/systemPrompts/prepare_for_merge.txt +2 -0
  33. package/node_modules/@local/vibe64-adapters/src/server/systemPrompts/resolve_pull_request.txt +1 -0
  34. package/node_modules/@local/vibe64-adapters/src/server/systemPrompts/run_deep_ui_check.txt +7 -3
  35. package/node_modules/@local/vibe64-adapters/src/server/workflowCommandTerminal/commitPush.js +4 -22
  36. package/node_modules/@local/vibe64-adapters/src/server/workflowCommandTerminal/factMetadata.js +21 -20
  37. package/node_modules/@local/vibe64-adapters/src/server/workflowCommandTerminal/issuePr.js +27 -4
  38. package/node_modules/@local/vibe64-adapters/src/server/workflowCommandTerminal/mergeSync.js +65 -8
  39. package/node_modules/@local/vibe64-adapters/src/server/workflowCommandTerminal/worktreeDependencies.js +12 -25
  40. package/node_modules/@local/vibe64-adapters/src/server/workflowSessionActions.js +77 -20
  41. package/node_modules/@local/vibe64-core/src/server/terminalWebSocketRoutes.js +14 -5
  42. package/node_modules/@local/vibe64-project/src/server/actions.js +21 -0
  43. package/node_modules/@local/vibe64-project/src/server/registerRoutes.js +6 -0
  44. package/node_modules/@local/vibe64-project/src/server/service.js +125 -8
  45. package/node_modules/@local/vibe64-runtime/src/server/coreProjectTools.js +135 -0
  46. package/node_modules/@local/vibe64-runtime/src/server/index.js +4 -0
  47. package/node_modules/@local/vibe64-runtime/src/server/projectToolRegistry.js +434 -0
  48. package/node_modules/@local/vibe64-runtime/src/server/runtime.js +40 -16
  49. package/node_modules/@local/vibe64-runtime/src/server/sessionWorktreeState.js +25 -0
  50. package/node_modules/@local/vibe64-runtime/src/server/terminalFailureFixRequest.js +112 -0
  51. package/node_modules/@local/vibe64-runtime/src/server/workflowArtifacts.js +2 -2
  52. package/node_modules/@local/vibe64-runtime/src/server/workflowDefinitionBuilders.js +1 -0
  53. package/node_modules/@local/vibe64-runtime/src/server/workflowDefinitionComposers.js +192 -0
  54. package/node_modules/@local/vibe64-runtime/src/server/workflowMachine.js +5 -0
  55. package/node_modules/@local/vibe64-runtime/src/server/workflowModules/coreCoding.js +1309 -419
  56. package/node_modules/@local/vibe64-runtime/src/server/workflowModules/coreLifecycle.js +540 -358
  57. package/node_modules/@local/vibe64-runtime/src/server/workflowModules/coreMaintenance.js +5 -26
  58. package/node_modules/@local/vibe64-runtime/src/server/workflowPresentation.js +153 -26
  59. package/node_modules/@local/vibe64-runtime/src/server/workflowStepMachineHelpers.js +63 -10
  60. package/node_modules/@local/vibe64-runtime/src/server/workflowStepMachines.js +63 -2
  61. package/node_modules/@local/vibe64-sessions/src/server/inputSchemas.js +5 -0
  62. package/node_modules/@local/vibe64-sessions/src/server/service.js +8 -9
  63. package/node_modules/@local/vibe64-terminals/src/server/actions.js +65 -0
  64. package/node_modules/@local/vibe64-terminals/src/server/codexTerminal.js +608 -23
  65. package/node_modules/@local/vibe64-terminals/src/server/commandTerminal.js +261 -4
  66. package/node_modules/@local/vibe64-terminals/src/server/fixCodexJobs.js +420 -0
  67. package/node_modules/@local/vibe64-terminals/src/server/inputSchemas.js +240 -0
  68. package/node_modules/@local/vibe64-terminals/src/server/launchTargetTerminal.js +2 -0
  69. package/node_modules/@local/vibe64-terminals/src/server/registerRoutes.js +226 -0
  70. package/node_modules/@local/vibe64-terminals/src/server/service.js +140 -1
  71. package/node_modules/@local/vibe64-terminals/src/server/targetToolchainTerminal.js +1 -1
  72. package/node_modules/@local/vibe64-terminals/src/server/terminalShared.js +34 -0
  73. package/node_modules/node-pty/build/Makefile +369 -0
  74. package/node_modules/node-pty/build/Release/pty.node +0 -0
  75. package/node_modules/node-pty/build/binding.Makefile +6 -0
  76. package/node_modules/node-pty/build/config.gypi +440 -0
  77. package/node_modules/node-pty/build/pty.target.mk +166 -0
  78. package/node_modules/node-pty/node-addon-api/node_addon_api.Makefile +6 -0
  79. package/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +104 -0
  80. package/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +108 -0
  81. package/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +104 -0
  82. package/node_modules/which/CHANGELOG.md +166 -0
  83. package/package.json +2 -2
  84. package/packages/setup-doctor-core/src/server/doctorToolchain.js +4 -0
  85. package/packages/studio-terminal-core/src/server/gitGithubTransport.js +33 -0
  86. package/packages/studio-terminal-core/src/server/index.js +1 -0
  87. package/packages/studio-terminal-core/src/server/terminalSessions.js +51 -1
  88. package/packages/vibe64-adapters/src/server/adapter.js +4 -0
  89. package/packages/vibe64-adapters/src/server/adapters/laravel/adapter.js +5 -0
  90. package/packages/vibe64-adapters/src/server/adapters/laravel/databaseRuntime.js +50 -0
  91. package/packages/vibe64-adapters/src/server/configStore.js +22 -1
  92. package/packages/vibe64-adapters/src/server/systemPrompts/agent_conversation.txt +0 -2
  93. package/packages/vibe64-adapters/src/server/systemPrompts/draft_issue.txt +18 -0
  94. package/packages/vibe64-adapters/src/server/systemPrompts/make_plan.txt +14 -2
  95. package/packages/vibe64-adapters/src/server/systemPrompts/prepare_for_merge.txt +2 -0
  96. package/packages/vibe64-adapters/src/server/systemPrompts/resolve_pull_request.txt +1 -0
  97. package/packages/vibe64-adapters/src/server/systemPrompts/run_deep_ui_check.txt +7 -3
  98. package/packages/vibe64-adapters/src/server/workflowCommandTerminal/commitPush.js +4 -22
  99. package/packages/vibe64-adapters/src/server/workflowCommandTerminal/factMetadata.js +21 -20
  100. package/packages/vibe64-adapters/src/server/workflowCommandTerminal/issuePr.js +27 -4
  101. package/packages/vibe64-adapters/src/server/workflowCommandTerminal/mergeSync.js +65 -8
  102. package/packages/vibe64-adapters/src/server/workflowCommandTerminal/worktreeDependencies.js +12 -25
  103. package/packages/vibe64-adapters/src/server/workflowSessionActions.js +77 -20
  104. package/packages/vibe64-core/src/server/terminalWebSocketRoutes.js +14 -5
  105. package/packages/vibe64-project/src/server/actions.js +21 -0
  106. package/packages/vibe64-project/src/server/registerRoutes.js +6 -0
  107. package/packages/vibe64-project/src/server/service.js +125 -8
  108. package/packages/vibe64-runtime/src/server/coreProjectTools.js +135 -0
  109. package/packages/vibe64-runtime/src/server/index.js +4 -0
  110. package/packages/vibe64-runtime/src/server/projectToolRegistry.js +434 -0
  111. package/packages/vibe64-runtime/src/server/runtime.js +40 -16
  112. package/packages/vibe64-runtime/src/server/sessionWorktreeState.js +25 -0
  113. package/packages/vibe64-runtime/src/server/terminalFailureFixRequest.js +112 -0
  114. package/packages/vibe64-runtime/src/server/workflowArtifacts.js +2 -2
  115. package/packages/vibe64-runtime/src/server/workflowDefinitionBuilders.js +1 -0
  116. package/packages/vibe64-runtime/src/server/workflowDefinitionComposers.js +192 -0
  117. package/packages/vibe64-runtime/src/server/workflowMachine.js +5 -0
  118. package/packages/vibe64-runtime/src/server/workflowModules/coreCoding.js +1309 -419
  119. package/packages/vibe64-runtime/src/server/workflowModules/coreLifecycle.js +540 -358
  120. package/packages/vibe64-runtime/src/server/workflowModules/coreMaintenance.js +5 -26
  121. package/packages/vibe64-runtime/src/server/workflowPresentation.js +153 -26
  122. package/packages/vibe64-runtime/src/server/workflowStepMachineHelpers.js +63 -10
  123. package/packages/vibe64-runtime/src/server/workflowStepMachines.js +63 -2
  124. package/packages/vibe64-sessions/src/server/inputSchemas.js +5 -0
  125. package/packages/vibe64-sessions/src/server/service.js +8 -9
  126. package/packages/vibe64-terminals/src/server/actions.js +65 -0
  127. package/packages/vibe64-terminals/src/server/codexTerminal.js +608 -23
  128. package/packages/vibe64-terminals/src/server/commandTerminal.js +261 -4
  129. package/packages/vibe64-terminals/src/server/fixCodexJobs.js +420 -0
  130. package/packages/vibe64-terminals/src/server/inputSchemas.js +240 -0
  131. package/packages/vibe64-terminals/src/server/launchTargetTerminal.js +2 -0
  132. package/packages/vibe64-terminals/src/server/registerRoutes.js +226 -0
  133. package/packages/vibe64-terminals/src/server/service.js +140 -1
  134. package/packages/vibe64-terminals/src/server/targetToolchainTerminal.js +1 -1
  135. package/packages/vibe64-terminals/src/server/terminalShared.js +34 -0
  136. package/dist/assets/ProjectTypeGate-DStq4W4X.js +0 -1
  137. package/dist/assets/ProjectTypeGate-Dh2ycSoM.css +0 -1
  138. package/dist/assets/history-HQ_XliX2.js +0 -1
  139. package/dist/assets/home-B89EbUmA.js +0 -1
  140. package/dist/assets/index-16P0GeGq.js +0 -134
  141. package/dist/assets/index-eMhOXhf_.css +0 -1
  142. package/dist/assets/useStudioTerminal-D9TNb50w.js +0 -1
  143. package/dist/assets/vibe64SessionPanelModel-DvY_IbW3.js +0 -1
@@ -5,9 +5,6 @@ import {
5
5
  import {
6
6
  buildAgentConversationStepDefinition
7
7
  } from "../workflowDefinitionBuilders.js";
8
- import {
9
- coreLifecycleWorkflowIntentHandlers
10
- } from "./coreLifecycle.js";
11
8
  import { when } from "../workflowConditions.js";
12
9
  import {
13
10
  STEP_STATUS,
@@ -25,7 +22,6 @@ import {
25
22
  const moduleId = "core.maintenance";
26
23
  const localSessionFinishedStepId = "local_session_finished";
27
24
  const workflowDefinitionIds = deepFreeze({
28
- NON_CODE_MAINTENANCE: "non_code_maintenance",
29
25
  NON_COMMIT_MAINTENANCE: "non_commit_maintenance"
30
26
  });
31
27
 
@@ -87,33 +83,15 @@ const coreMaintenanceStepDefinitionsById = deepFreeze({
87
83
  });
88
84
 
89
85
  const coreMaintenanceWorkflowDefinitions = [
90
- {
91
- description: "Update documentation or other non-code project files, validate, commit, create a PR, and optionally merge.",
92
- id: workflowDefinitionIds.NON_CODE_MAINTENANCE,
93
- intentHandlers: coreLifecycleWorkflowIntentHandlers,
94
- label: "Documentation/non code maintenance",
95
- sessionWord: "documentation",
96
- steps: [
97
- "session_created",
98
- "work_source_selected",
99
- "worktree_created",
100
- "dependencies_installed",
101
- "maintenance_conversation",
102
- "project_validated",
103
- "changes_committed",
104
- "create_pull_request",
105
- "pr_merged",
106
- "main_checkout_synced",
107
- "session_finished"
108
- ],
109
- userSelectable: true
110
- },
111
86
  {
112
87
  description: "Run a local maintenance task without commit, pull request, or merge steps.",
113
88
  id: workflowDefinitionIds.NON_COMMIT_MAINTENANCE,
114
89
  label: "Non-commit maintenance",
115
90
  initialMetadata: {
116
- work_source: "new_branch"
91
+ github_issue_mode: "skip",
92
+ issue_source: "none",
93
+ work_anchor_type: "description",
94
+ work_source: "description"
117
95
  },
118
96
  sessionWord: "maintenance",
119
97
  steps: [
@@ -168,6 +146,7 @@ const localSessionFinishedMachine = {
168
146
  const coreMaintenanceSteps = Object.freeze([
169
147
  {
170
148
  config: {
149
+ completionMessage: "Maintenance conversation turn completed.",
171
150
  completionPolicy: {
172
151
  decidedBy: "user"
173
152
  },
@@ -15,6 +15,9 @@ import {
15
15
  vibe64SessionDebugLog,
16
16
  vibe64SessionDebugSummary
17
17
  } from "./sessionDebugLog.js";
18
+ import {
19
+ sessionHasWorktree
20
+ } from "./sessionWorktreeState.js";
18
21
  import { STEP_STATUS } from "./workflowStepMachines.js";
19
22
 
20
23
  // Vibe64 ownership contract:
@@ -33,6 +36,7 @@ const INTENT_IDS = Object.freeze({
33
36
  });
34
37
 
35
38
  const COMMAND_RECOVERY_DELAY_MS = 5000;
39
+ const CODEX_BOOTSTRAP_TASK_ID = "codex_bootstrap";
36
40
  const COMMAND_LIFECYCLE_RUNNING_PHASES = Object.freeze(new Set([
37
41
  "starting",
38
42
  "started"
@@ -152,18 +156,26 @@ function inputPresentation(input = {}, {
152
156
 
153
157
  function intent(id, {
154
158
  actionId = "",
159
+ auditMessage = "",
155
160
  disabledReason = "",
156
161
  enabled = true,
157
162
  control = null,
158
163
  input = null,
159
164
  inputFields = [],
160
165
  label = "",
161
- style = "secondary"
166
+ operation = "",
167
+ saveCurrentStepInputBeforeRun = false,
168
+ style = "secondary",
169
+ submitFields = null
162
170
  } = {}) {
163
171
  const controlPresentation = isPlainObject(control) ? normalizeControlPresentation(control) : null;
164
172
  const intentInputPresentation = isPlainObject(input) ? input : null;
173
+ const intentSubmitFields = isPlainObject(submitFields) ? submitFields : null;
174
+ const normalizedAuditMessage = normalizeText(auditMessage);
175
+ const normalizedOperation = normalizeText(operation);
165
176
  return {
166
177
  actionId: normalizeText(actionId),
178
+ ...(normalizedAuditMessage ? { auditMessage: normalizedAuditMessage } : {}),
167
179
  ...(controlPresentation ? { control: controlPresentation } : {}),
168
180
  disabledReason: enabled ? "" : normalizeText(disabledReason || "This action is not available right now."),
169
181
  enabled: enabled === true,
@@ -171,6 +183,9 @@ function intent(id, {
171
183
  ...(intentInputPresentation ? { input: intentInputPresentation } : {}),
172
184
  inputFields: Array.isArray(inputFields) ? inputFields : [],
173
185
  label: normalizeText(label || id),
186
+ ...(normalizedOperation ? { operation: normalizedOperation } : {}),
187
+ ...(saveCurrentStepInputBeforeRun === true ? { saveCurrentStepInputBeforeRun: true } : {}),
188
+ ...(intentSubmitFields ? { submitFields: intentSubmitFields } : {}),
174
189
  style
175
190
  };
176
191
  }
@@ -219,25 +234,33 @@ function normalizeControlPresentation(control = {}) {
219
234
  }
220
235
 
221
236
  function intentForAction(id, action = {}, options = {}) {
237
+ const configuredInputFields = Array.isArray(options.inputFields) && options.inputFields.length > 0
238
+ ? options.inputFields
239
+ : null;
222
240
  return intent(id, {
223
241
  ...options,
224
242
  actionId: action?.id || options.actionId || "",
225
243
  disabledReason: action?.disabledReason || options.disabledReason || "",
226
244
  enabled: action?.enabled === true,
227
245
  input: options.input,
228
- inputFields: options.inputFields || action?.inputFields || [],
246
+ inputFields: configuredInputFields || action?.inputFields || [],
229
247
  label: options.label || action?.label || id
230
248
  });
231
249
  }
232
250
 
233
251
  function continueIntent(session = {}, {
252
+ auditMessage = "",
234
253
  id = INTENT_IDS.CONTINUE_STEP,
235
- label = ""
254
+ label = "",
255
+ saveCurrentStepInputBeforeRun = false
236
256
  } = {}) {
237
257
  return intent(normalizeText(id) || INTENT_IDS.CONTINUE_STEP, {
258
+ auditMessage,
238
259
  disabledReason: session.next?.disabledReason || "",
239
260
  enabled: nextIsReady(session),
240
261
  label: label || session.next?.label || "Continue",
262
+ operation: "continue",
263
+ saveCurrentStepInputBeforeRun,
241
264
  style: "primary"
242
265
  });
243
266
  }
@@ -329,17 +352,21 @@ function intentFromConfig(session = {}, config = {}) {
329
352
  }
330
353
  if (normalizeText(config.type) === "continue") {
331
354
  return continueIntent(session, {
355
+ auditMessage: config.auditMessage,
332
356
  id,
333
- label: config.label
357
+ label: config.label,
358
+ saveCurrentStepInputBeforeRun: config.saveCurrentStepInputBeforeRun === true
334
359
  });
335
360
  }
336
361
  if (normalizeText(config.type) === "reject") {
337
362
  const enabled = Boolean(rejectTargetStepId(session));
338
363
  return intent(id, {
364
+ auditMessage: config.auditMessage,
339
365
  disabledReason: enabled ? "" : "This workflow does not define a rejection target for the current step.",
340
366
  enabled,
341
367
  inputFields: config.inputFields,
342
368
  label: config.label || "Reject",
369
+ operation: "reject",
343
370
  style: config.style || "secondary"
344
371
  });
345
372
  }
@@ -347,9 +374,11 @@ function intentFromConfig(session = {}, config = {}) {
347
374
  const stage = stageAction(session);
348
375
  const action = actionById(session, config.actionId || stage?.actionId || "");
349
376
  return intentForAction(id, action, {
377
+ auditMessage: config.auditMessage,
350
378
  disabledReason: config.disabledReason || "",
351
379
  inputFields: config.inputFields,
352
380
  label: config.label || "",
381
+ saveCurrentStepInputBeforeRun: config.saveCurrentStepInputBeforeRun === true,
353
382
  style: config.style || "secondary"
354
383
  });
355
384
  }
@@ -357,12 +386,17 @@ function intentFromConfig(session = {}, config = {}) {
357
386
  const enabled = configuredIntentEnabled(session, config);
358
387
  return intent(id, {
359
388
  actionId: config.actionId || "",
389
+ auditMessage: config.auditMessage,
360
390
  control: config.control,
361
391
  disabledReason: action?.disabledReason || configuredIntentDisabledReason(session, config, enabled),
362
392
  enabled: action ? action.enabled === true && enabled : enabled,
363
393
  input: config.input,
364
- inputFields: config.inputFields || action?.inputFields || [],
394
+ inputFields: Array.isArray(config.inputFields) && config.inputFields.length > 0
395
+ ? config.inputFields
396
+ : action?.inputFields || [],
365
397
  label: config.label || action?.label || "",
398
+ saveCurrentStepInputBeforeRun: config.saveCurrentStepInputBeforeRun === true,
399
+ submitFields: config.submitFields,
366
400
  style: config.style || "secondary"
367
401
  });
368
402
  }
@@ -377,15 +411,27 @@ function presentationFromConfig(session = {}, config = {}) {
377
411
  };
378
412
  }
379
413
 
380
- function configuredStopIntentsExcept(session = {}, excludedIntentIds = []) {
414
+ function fallbackContinueIntentExcept(session = {}, excluded = new Set()) {
415
+ if (session.next?.visible === false || !session.next?.stepId) {
416
+ return [];
417
+ }
418
+ const fallback = continueIntent(session);
419
+ return excluded.has(fallback.id) ? [] : [fallback];
420
+ }
421
+
422
+ function configuredStopIntentsExcept(session = {}, excludedIntentIds = [], {
423
+ useConfigured = true
424
+ } = {}) {
381
425
  const excluded = new Set(excludedIntentIds.map(normalizeText).filter(Boolean));
426
+ if (!useConfigured) {
427
+ return fallbackContinueIntentExcept(session, excluded);
428
+ }
382
429
  const stopIntents = stopScreenPresentation(session).intents
383
430
  .filter((candidate) => !excluded.has(candidate.id));
384
431
  if (stopIntents.length > 0 || session.next?.visible === false || !session.next?.stepId) {
385
432
  return stopIntents;
386
433
  }
387
- const fallback = continueIntent(session);
388
- return excluded.has(fallback.id) ? [] : [fallback];
434
+ return fallbackContinueIntentExcept(session, excluded);
389
435
  }
390
436
 
391
437
  function stopScreenPresentation(session = {}) {
@@ -402,6 +448,11 @@ function stopScreenPresentation(session = {}) {
402
448
  };
403
449
  }
404
450
 
451
+ function stopPresentationPersistsWhenComplete(session = {}) {
452
+ const configured = stepPresentationConfig(session).stop;
453
+ return isPlainObject(configured) && configured.persistWhenComplete === true;
454
+ }
455
+
405
456
  function userDecisionPresentation(session = {}) {
406
457
  const configured = stepPresentationConfig(session).decision;
407
458
  if (isPlainObject(configured)) {
@@ -428,6 +479,30 @@ function userDecisionPresentation(session = {}) {
428
479
  };
429
480
  }
430
481
 
482
+ function interactionIntents(session = {}, interaction = {}) {
483
+ return (Array.isArray(interaction.intents) ? interaction.intents : [])
484
+ .map((intentConfig) => intentFromConfig(session, intentConfig))
485
+ .filter(Boolean);
486
+ }
487
+
488
+ function conversationSkipIntent(interaction = {}, action = {}) {
489
+ const skipInput = isPlainObject(interaction.skipInput) ? interaction.skipInput : null;
490
+ const message = normalizeText(skipInput?.message);
491
+ if (!skipInput || !message) {
492
+ return null;
493
+ }
494
+ return intent(skipInput.id || "let_codex_decide", {
495
+ actionId: action?.id || "",
496
+ disabledReason: action?.disabledReason || "",
497
+ enabled: action?.enabled === true,
498
+ label: skipInput.label || "Let Codex decide",
499
+ style: skipInput.style || "secondary",
500
+ submitFields: {
501
+ conversationRequest: message
502
+ }
503
+ });
504
+ }
505
+
431
506
  function interactionPresentation(session = {}) {
432
507
  const interaction = currentStepDefinition(session).interaction;
433
508
  if (!isPlainObject(interaction)) {
@@ -446,10 +521,13 @@ function interactionPresentation(session = {}) {
446
521
  label: interaction.submitLabel || action?.label || "Send to Codex",
447
522
  style: "primary"
448
523
  });
524
+ const waitingForInput = stepMachineStatus(session) === STEP_STATUS.WAITING_FOR_INPUT;
525
+ const skipIntent = waitingForInput ? conversationSkipIntent(interaction, action) : null;
449
526
  return {
450
527
  intents: [
451
528
  primaryIntent,
452
- ...configuredStopIntentsExcept(session, [conversationIntentId])
529
+ ...(skipIntent ? [skipIntent] : []),
530
+ ...(waitingForInput ? [] : configuredStopIntentsExcept(session, [conversationIntentId]))
453
531
  ],
454
532
  screen: screen("conversation", {
455
533
  input: inputPresentation(interaction, {
@@ -463,7 +541,7 @@ function interactionPresentation(session = {}) {
463
541
  };
464
542
  }
465
543
  return {
466
- intents: [],
544
+ intents: interactionIntents(session, interaction),
467
545
  screen: screen(stepMachineStatus(session) === STEP_STATUS.CONFIRM_FILES ? "confirm_files" : "input", {
468
546
  input: inputPresentation(interaction, {
469
547
  submitTarget: "current-step-input"
@@ -502,7 +580,7 @@ function waitingPresentation(session = {}) {
502
580
  icon: "progress",
503
581
  message: "Wait for Codex to finish the current step.",
504
582
  showProgress: true,
505
- title: "Terminal is transmitting..."
583
+ title: "Codex is thinking..."
506
584
  })
507
585
  };
508
586
  }
@@ -512,6 +590,9 @@ function genericPresentation(session = {}) {
512
590
  return {
513
591
  intents: [continueIntent(session)],
514
592
  screen: screen("ready", {
593
+ message: stepMachineStatus(session) === STEP_STATUS.DONE
594
+ ? session.stepMachine?.message || `${currentStepLabel(session)} completed.`
595
+ : "",
515
596
  title: currentStepLabel(session)
516
597
  })
517
598
  };
@@ -533,9 +614,15 @@ function automationWaitReason(session = {}) {
533
614
  return "input";
534
615
  }
535
616
  if (currentAutopilot(session).stop === true) {
617
+ if (stepMachineStatus(session) === STEP_STATUS.DONE && nextIsReady(session) && !stopPresentationPersistsWhenComplete(session)) {
618
+ return "";
619
+ }
536
620
  return "user";
537
621
  }
538
622
  if (currentAutopilot(session).userDecision === true) {
623
+ if (stepMachineStatus(session) === STEP_STATUS.DONE && nextIsReady(session)) {
624
+ return "";
625
+ }
539
626
  return "decision";
540
627
  }
541
628
  return "";
@@ -698,12 +785,22 @@ function mergeOperation(session = {}, config = {}) {
698
785
  const metadata = session.metadata || {};
699
786
  const skippedMetadataName = requiredPresentationValue(config, "skippedMetadataName", "merge automation");
700
787
  const mergedMetadataName = requiredPresentationValue(config, "mergedMetadataName", "merge automation");
788
+ const syncActionId = normalizeText(config.syncActionId);
789
+ const syncedMetadataName = normalizeText(config.syncedMetadataName);
701
790
  if (normalizeText(metadata[skippedMetadataName])) {
702
791
  return nextIsReady(session)
703
792
  ? advanceOperation(session)
704
793
  : stopOperation(session.next?.disabledReason || "");
705
794
  }
706
795
  if (normalizeText(metadata[mergedMetadataName])) {
796
+ if (syncActionId && syncedMetadataName && !normalizeText(metadata[syncedMetadataName])) {
797
+ if (stepMachineIsWaitingForCodex(session) || stepMachineNeedsInput(session)) {
798
+ return waitOperation(automationWaitReason(session));
799
+ }
800
+ return actionOperation(session, {
801
+ actionId: syncActionId
802
+ });
803
+ }
707
804
  return nextIsReady(session)
708
805
  ? advanceOperation(session)
709
806
  : stopOperation(session.next?.disabledReason || "");
@@ -761,10 +858,6 @@ function nextAutomationOperation(session = {}) {
761
858
  return waitOperation(waitReason);
762
859
  }
763
860
 
764
- if (stepMachineStatus(session) === STEP_STATUS.DONE && nextIsReady(session)) {
765
- return advanceOperation(session);
766
- }
767
-
768
861
  const stage = stageAction(session);
769
862
  if (stage) {
770
863
  return actionOperation(session, stage);
@@ -784,7 +877,7 @@ function promptPresentation(session = {}) {
784
877
  case STEP_STATUS.ATTEMPTING_EXECUTION:
785
878
  return {
786
879
  state: "waiting_for_agent",
787
- statusText: "Waiting for Codex."
880
+ statusText: "Codex is thinking."
788
881
  };
789
882
  case STEP_STATUS.CONFIRM_FILES:
790
883
  case STEP_STATUS.WAITING_FOR_INPUT:
@@ -811,7 +904,14 @@ function promptPresentation(session = {}) {
811
904
  }
812
905
  }
813
906
 
814
- function backgroundTaskRetryPresentation(task = {}) {
907
+ function backgroundTaskRetryPresentation(task = {}, session = {}) {
908
+ if (
909
+ normalizeText(task.id) === CODEX_BOOTSTRAP_TASK_ID &&
910
+ normalizeText(task.status) === "failed" &&
911
+ !sessionHasWorktree(session)
912
+ ) {
913
+ return null;
914
+ }
815
915
  const retry = isPlainObject(task.retry) ? task.retry : null;
816
916
  if (!retry) {
817
917
  return null;
@@ -848,7 +948,7 @@ function backgroundTaskPresentation(session = {}) {
848
948
  kind: normalizeText(task.kind),
849
949
  label: normalizeText(task.label) || id,
850
950
  message: normalizeText(task.message),
851
- retry: backgroundTaskRetryPresentation(task),
951
+ retry: backgroundTaskRetryPresentation(task, session),
852
952
  startedAt: normalizeText(task.startedAt),
853
953
  status,
854
954
  terminalSessionId: normalizeText(task.terminalSessionId),
@@ -865,6 +965,12 @@ function buildPresentation(session = {}) {
865
965
  const kind = normalizeText(autopilot.kind);
866
966
  let base = interaction || waiting;
867
967
 
968
+ if (!base && autopilot.stop === true && stopPresentationPersistsWhenComplete(session)) {
969
+ base = stopScreenPresentation(session);
970
+ }
971
+ if (!base && stepMachineStatus(session) === STEP_STATUS.DONE && nextIsReady(session)) {
972
+ base = genericPresentation(session);
973
+ }
868
974
  if (!base && autopilot.userDecision === true) {
869
975
  base = userDecisionPresentation(session);
870
976
  }
@@ -1070,7 +1176,11 @@ async function runActionIntent(runtime, session = {}, selectedIntent = {}, inten
1070
1176
  "vibe64_intent_not_handled"
1071
1177
  );
1072
1178
  }
1073
- return runtime.runAction(session.sessionId, actionId, fields);
1179
+ return runtime.runAction(session.sessionId, actionId, {
1180
+ ...(isPlainObject(selectedIntent.submitFields) ? selectedIntent.submitFields : {}),
1181
+ ...(isPlainObject(config.submitFields) ? config.submitFields : {}),
1182
+ ...fields
1183
+ });
1074
1184
  }
1075
1185
 
1076
1186
  async function rejectWorkflowIntent(runtime, session = {}, fields = {}) {
@@ -1227,7 +1337,7 @@ async function runWorkflowIntentHandler(runtime, session = {}, selectedIntent =
1227
1337
 
1228
1338
  async function runBuiltinWorkflowIntent(runtime, session = {}, selectedIntent = {}, intentConfig = {}, fields = {}) {
1229
1339
  const hasIntentConfig = isPlainObject(intentConfig) && Object.keys(intentConfig).length > 0;
1230
- const type = normalizeText(intentConfig?.type);
1340
+ const type = normalizeText(intentConfig?.type || selectedIntent.operation);
1231
1341
  if (type === "continue") {
1232
1342
  return runtime.advance(session.sessionId);
1233
1343
  }
@@ -1243,6 +1353,20 @@ async function runBuiltinWorkflowIntent(runtime, session = {}, selectedIntent =
1243
1353
  );
1244
1354
  }
1245
1355
 
1356
+ async function withIntentAuditMessage(runtime, session = {}, selectedIntent = {}, resultSession = {}) {
1357
+ const auditMessage = normalizeText(selectedIntent.auditMessage);
1358
+ if (!auditMessage || typeof runtime?.store?.writeConversationUserMessage !== "function") {
1359
+ return resultSession;
1360
+ }
1361
+ await runtime.store.writeConversationUserMessage(session.sessionId, {
1362
+ text: auditMessage
1363
+ });
1364
+ return {
1365
+ ...await runtime.getSession(session.sessionId),
1366
+ ...(resultSession?.actionResult ? { actionResult: resultSession.actionResult } : {})
1367
+ };
1368
+ }
1369
+
1246
1370
  async function runWorkflowIntent(runtime, sessionId = "", intentId = "", input = {}) {
1247
1371
  const session = await runtime.getSession(sessionId);
1248
1372
  const normalizedIntentId = normalizeText(intentId);
@@ -1261,18 +1385,21 @@ async function runWorkflowIntent(runtime, sessionId = "", intentId = "", input =
1261
1385
  }
1262
1386
  assertIntentMatchesCurrentState(session, input);
1263
1387
 
1264
- const fields = intentFields(input);
1388
+ const intentConfig = intentConfigForIntent(runtime, session, normalizedIntentId);
1389
+ const fields = {
1390
+ ...(isPlainObject(selectedIntent.submitFields) ? selectedIntent.submitFields : {}),
1391
+ ...(isPlainObject(intentConfig?.submitFields) ? intentConfig.submitFields : {}),
1392
+ ...intentFields(input)
1393
+ };
1265
1394
  const handledSession = await runWorkflowIntentHandler(runtime, session, selectedIntent, fields);
1266
- if (handledSession) {
1267
- return handledSession;
1268
- }
1269
- return runBuiltinWorkflowIntent(
1395
+ const resultSession = handledSession || await runBuiltinWorkflowIntent(
1270
1396
  runtime,
1271
1397
  session,
1272
1398
  selectedIntent,
1273
- intentConfigForIntent(runtime, session, normalizedIntentId),
1399
+ intentConfig,
1274
1400
  fields
1275
1401
  );
1402
+ return withIntentAuditMessage(runtime, session, selectedIntent, resultSession);
1276
1403
  }
1277
1404
 
1278
1405
  export {
@@ -33,6 +33,12 @@ const STEP_INPUT_KIND = Object.freeze({
33
33
  WAITING_FOR_INPUT: "waiting_for_input"
34
34
  });
35
35
 
36
+ const LET_CODEX_DECIDE_INPUT = Object.freeze({
37
+ id: "let_codex_decide",
38
+ label: "Let Codex decide",
39
+ message: "You decide."
40
+ });
41
+
36
42
  function machineState(status, details = {}) {
37
43
  return {
38
44
  ...details,
@@ -200,24 +206,25 @@ function artifactText(value = "") {
200
206
  }
201
207
 
202
208
  function commandFailureInteraction({
203
- prompt = "The command failed. Explain what should happen, then retry the command.",
209
+ prompt = "The command failed. Fix anything needed, then retry the command.",
204
210
  title = "Command needs attention"
205
211
  } = {}) {
206
212
  return {
207
213
  fields: [
208
214
  {
209
215
  kind: "textarea",
210
- label: "What should happen next?",
216
+ label: "Retry note",
211
217
  name: "response",
212
- required: true,
213
- requiredMessage: "Explain what should happen before retrying.",
218
+ placeholder: "Optional note about what changed before retrying.",
219
+ required: false,
220
+ rows: 3,
214
221
  value: ""
215
222
  }
216
223
  ],
217
224
  kind: "command_failure_response",
218
225
  prompt,
219
226
  submitKind: STEP_INPUT_KIND.USER_RESPONSE,
220
- submitLabel: "Save response",
227
+ submitLabel: "Retry command",
221
228
  title
222
229
  };
223
230
  }
@@ -225,9 +232,18 @@ function commandFailureInteraction({
225
232
  function promptWaitingForInputInteraction({
226
233
  actionId = "",
227
234
  prompt = "Codex needs more information before this step can continue.",
235
+ skipInput = null,
228
236
  submitLabel = "Send to Codex",
229
237
  title = "Talk to Codex"
230
238
  } = {}) {
239
+ const normalizedSkipInput = skipInput && typeof skipInput === "object" && !Array.isArray(skipInput)
240
+ ? {
241
+ id: normalizeText(skipInput.id || "let_codex_decide"),
242
+ label: normalizeText(skipInput.label || "Let Codex decide"),
243
+ message: normalizeText(skipInput.message),
244
+ style: normalizeText(skipInput.style || "secondary")
245
+ }
246
+ : null;
231
247
  return {
232
248
  actionId: normalizeText(actionId),
233
249
  fields: [
@@ -243,6 +259,7 @@ function promptWaitingForInputInteraction({
243
259
  intentId: "talk_to_codex",
244
260
  kind: "conversation",
245
261
  prompt,
262
+ ...(normalizedSkipInput?.message ? { skipInput: normalizedSkipInput } : {}),
246
263
  submitKind: "",
247
264
  submitLabel,
248
265
  title
@@ -314,6 +331,16 @@ function promptActionIsReadyForDone(input = {}) {
314
331
  return input.kind === STEP_INPUT_KIND.READY || input.kind === STEP_INPUT_KIND.CONSIDER_RESOLVED;
315
332
  }
316
333
 
334
+ function inputIsStructuredCompletion(input = {}) {
335
+ return input.kind === STEP_INPUT_KIND.READY || input.kind === STEP_INPUT_KIND.CONFIRM_FILES;
336
+ }
337
+
338
+ function configuredCompletionMessage(completionMessage, context = {}, input = {}) {
339
+ return normalizeText(typeof completionMessage === "function"
340
+ ? completionMessage(context, input)
341
+ : completionMessage);
342
+ }
343
+
317
344
  async function writePromptResponseArtifact(context = {}, artifactName = "", text = "") {
318
345
  const normalizedArtifact = normalizeText(artifactName);
319
346
  if (!normalizedArtifact) {
@@ -331,12 +358,13 @@ function promptStepDoneView(context = {}, machine = {}, state = {}) {
331
358
  };
332
359
  }
333
360
 
334
- function promptStepWaitingForInputView(context = {}, machine = {}, state = {}) {
361
+ function promptStepWaitingForInputView(context = {}, machine = {}, state = {}, options = {}) {
335
362
  return {
336
363
  interaction: promptWaitingForInputInteraction({
337
- actionId: machine.promptActionId,
338
- prompt: state.message || "Codex needs more information before this step can continue.",
339
- title: "Talk to Codex"
364
+ actionId: normalizeText(options.actionId || state.promptActionId || machine.promptActionId),
365
+ prompt: options.prompt || state.message || "Codex needs more information before this step can continue.",
366
+ skipInput: options.skipInput,
367
+ title: options.title || "Talk to Codex"
340
368
  }),
341
369
  next: nextForSession(context.session, {
342
370
  disabledReason: "Answer Codex before continuing."
@@ -383,6 +411,7 @@ function chatWithAiPromptInstructionOptions({
383
411
  }
384
412
 
385
413
  function createChatWithAiMachine({
414
+ completionMessage = "Conversation turn completed.",
386
415
  completionPolicy = {},
387
416
  nextWhenIdle = {
388
417
  enabled: true
@@ -430,6 +459,13 @@ function createChatWithAiMachine({
430
459
  });
431
460
  },
432
461
 
462
+ inputCompletionMessage(context = {}) {
463
+ const input = normalizeMachineInput(context.input);
464
+ return promptActionIsReadyForDone(input)
465
+ ? configuredCompletionMessage(completionMessage, context, input)
466
+ : "";
467
+ },
468
+
433
469
  async actionStarted(context = {}) {
434
470
  return markPromptActionStarted(context, this, normalizedPromptActionId, {
435
471
  restartDone: true
@@ -455,6 +491,7 @@ function optionalActionsView(context = {}, state = {}, actionConfig = null) {
455
491
  // show those fields for user confirmation, then optionally wait for a command.
456
492
  function createEditableArtifactReviewMachine({
457
493
  command = null,
494
+ completionMessage = "Draft submitted for review.",
458
495
  done,
459
496
  draftOrigin = "user",
460
497
  draftReady,
@@ -689,6 +726,13 @@ function createEditableArtifactReviewMachine({
689
726
  : command.failureState(context, state));
690
727
  },
691
728
 
729
+ inputCompletionMessage(context = {}) {
730
+ const input = normalizeMachineInput(context.input);
731
+ return inputIsStructuredCompletion(input)
732
+ ? configuredCompletionMessage(completionMessage, context, input)
733
+ : "";
734
+ },
735
+
692
736
  ...(typeof promptInstruction === "function" ? { promptInstruction } : {})
693
737
  };
694
738
  }
@@ -728,8 +772,15 @@ async function handleStandardPromptInput(context = {}, machine = {}, {
728
772
  if (responseArtifact) {
729
773
  await writePromptResponseArtifact(context, responseArtifact, input.fields.response || input.text);
730
774
  }
775
+ const completionMessage = normalizeText(input.message) ||
776
+ (typeof machine.inputCompletionMessage === "function"
777
+ ? normalizeText(machine.inputCompletionMessage({
778
+ input,
779
+ ...context
780
+ }))
781
+ : "");
731
782
  await writeState(context, machine, machineState(STEP_STATUS.DONE, {
732
- message: input.message,
783
+ message: completionMessage,
733
784
  source: input.source
734
785
  }));
735
786
  return;
@@ -903,6 +954,7 @@ function commandStepView(context = {}, machine = {}, state = {}, {
903
954
  }
904
955
 
905
956
  export {
957
+ LET_CODEX_DECIDE_INPUT,
906
958
  STEP_INPUT_KIND,
907
959
  STEP_STATUS,
908
960
  actionCompleted,
@@ -935,5 +987,6 @@ export {
935
987
  submitCommandFailureInput,
936
988
  unsupportedInputKind,
937
989
  writeCommandActionFinishedState,
990
+ writePromptResponseArtifact,
938
991
  writeState
939
992
  };