@bastani/atomic 0.9.46-alpha.1 → 0.9.47-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +11 -0
  3. package/dist/builtin/intercom/package.json +1 -1
  4. package/dist/builtin/mcp/package.json +1 -1
  5. package/dist/builtin/subagents/CHANGELOG.md +11 -0
  6. package/dist/builtin/subagents/package.json +1 -1
  7. package/dist/builtin/subagents/src/extension/index.bundle.mjs +2 -2
  8. package/dist/builtin/web-access/package.json +1 -1
  9. package/dist/builtin/workflows/CHANGELOG.md +40 -0
  10. package/dist/builtin/workflows/package.json +1 -1
  11. package/dist/builtin/workflows/src/extension/index.bundle.mjs +55 -28
  12. package/dist/builtin/workflows/src/extension/local-worker-entry.mjs +55 -28
  13. package/dist/builtin/workflows/src/index.js +55 -28
  14. package/dist/builtin/workflows/src/local-worker-entry.mjs +55 -28
  15. package/dist/core/agent-session-tasks.d.ts.map +1 -1
  16. package/dist/core/agent-session-tasks.js +8 -1
  17. package/dist/core/agent-session-tasks.js.map +1 -1
  18. package/dist/core/extensions/ui-types.d.ts +9 -1
  19. package/dist/core/extensions/ui-types.d.ts.map +1 -1
  20. package/dist/core/extensions/ui-types.js.map +1 -1
  21. package/dist/core/model-resolver-defaults.js +2 -2
  22. package/dist/core/model-resolver-defaults.js.map +1 -1
  23. package/dist/core/package-manager-npm.d.ts.map +1 -1
  24. package/dist/core/package-manager-npm.js +7 -3
  25. package/dist/core/package-manager-npm.js.map +1 -1
  26. package/dist/core/tasks/completion.d.ts +6 -1
  27. package/dist/core/tasks/completion.d.ts.map +1 -1
  28. package/dist/core/tasks/completion.js +33 -18
  29. package/dist/core/tasks/completion.js.map +1 -1
  30. package/dist/core/tasks/pause.d.ts +2 -1
  31. package/dist/core/tasks/pause.d.ts.map +1 -1
  32. package/dist/core/tasks/pause.js +3 -2
  33. package/dist/core/tasks/pause.js.map +1 -1
  34. package/dist/core/tools/grep.d.ts.map +1 -1
  35. package/dist/core/tools/grep.js +6 -4
  36. package/dist/core/tools/grep.js.map +1 -1
  37. package/dist/core/tools/shell-task-status.d.ts.map +1 -1
  38. package/dist/core/tools/shell-task-status.js +2 -1
  39. package/dist/core/tools/shell-task-status.js.map +1 -1
  40. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  41. package/dist/extensions/codemode/execute.js +14 -2
  42. package/dist/extensions/codemode/execute.js.map +1 -1
  43. package/dist/extensions/tool-search/tool.d.ts +6 -0
  44. package/dist/extensions/tool-search/tool.d.ts.map +1 -1
  45. package/dist/extensions/tool-search/tool.js +41 -6
  46. package/dist/extensions/tool-search/tool.js.map +1 -1
  47. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  48. package/dist/modes/interactive/components/assistant-message.js +20 -12
  49. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  50. package/dist/modes/interactive/interactive-extension-custom-ui.js +1 -1
  51. package/dist/modes/interactive/interactive-extension-custom-ui.js.map +1 -1
  52. package/dist/modes/interactive/interactive-extension-dialogs.js +10 -4
  53. package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
  54. package/dist/modes/interactive/interactive-mode-surface.d.ts +1 -0
  55. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  56. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  57. package/dist/modes/interactive-engine/engine-custom-ui.d.ts +3 -0
  58. package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
  59. package/dist/modes/interactive-engine/engine-custom-ui.js +1 -0
  60. package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
  61. package/dist/modes/interactive-engine/protocol.d.ts +6 -0
  62. package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
  63. package/dist/modes/interactive-engine/protocol.js +9 -0
  64. package/dist/modes/interactive-engine/protocol.js.map +1 -1
  65. package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
  66. package/dist/modes/interactive-engine/remote-component.js +3 -2
  67. package/dist/modes/interactive-engine/remote-component.js.map +1 -1
  68. package/docs/llama-cpp.md +25 -14
  69. package/docs/tui.md +2 -0
  70. package/npm-shrinkwrap.json +32 -32
  71. package/package.json +3 -3
@@ -8065,7 +8065,7 @@ var init_stage_question_form = __esm(() => {
8065
8065
  });
8066
8066
 
8067
8067
  // dist/builtin/workflows/src/shared/resume-continuation.ts
8068
- var RESUME_CONTINUATION_PROMPT = "Continue where you left off. If you believe you are finished with your original task (or a redefined task if the user told you), stop.";
8068
+ var RESUME_CONTINUATION_PROMPT = "Continue where you left off. If a pause interrupted a command or step you were running, redo or continue that step as needed. If you believe you are finished with your original task (or a redefined task if the user told you), stop.";
8069
8069
 
8070
8070
  // dist/builtin/workflows/src/runs/foreground/executor-hil.ts
8071
8071
  import { createHash } from "node:crypto";
@@ -64245,13 +64245,19 @@ class HeldPromptAnswers {
64245
64245
  if (held.runId === runId && generation > held.generation && !present.has(key))
64246
64246
  this.held.delete(key);
64247
64247
  }
64248
+ awaitsLaterAttempt(runId, stageId, generation) {
64249
+ const held = this.held.get(JSON.stringify([runId, stageId]));
64250
+ return held !== undefined && generation <= held.generation;
64251
+ }
64248
64252
  takePrompt(runId, stageId, prompt, generation) {
64249
64253
  const key = JSON.stringify([runId, stageId]);
64250
64254
  const held = this.held.get(key);
64251
64255
  if (held === undefined || generation <= held.generation)
64252
64256
  return;
64253
64257
  this.held.delete(key);
64254
- return held.kind === "prompt" && held.identity === promptIdentity(prompt) ? { response: held.response } : undefined;
64258
+ if (held.kind !== "prompt" || held.identity !== promptIdentity(prompt))
64259
+ return;
64260
+ return "error" in held ? { error: held.error } : { response: held.response };
64255
64261
  }
64256
64262
  takeQuestion(runId, stageId, question, generation) {
64257
64263
  const key = JSON.stringify([runId, stageId]);
@@ -64259,7 +64265,9 @@ class HeldPromptAnswers {
64259
64265
  if (held === undefined || generation <= held.generation)
64260
64266
  return;
64261
64267
  this.held.delete(key);
64262
- return held.kind === "question" && held.identity === questionIdentity(question) ? { answer: held.answer } : undefined;
64268
+ if (held.kind !== "question" || held.identity !== questionIdentity(question))
64269
+ return;
64270
+ return "error" in held ? { error: held.error } : { answer: held.answer };
64263
64271
  }
64264
64272
  clear() {
64265
64273
  this.held.clear();
@@ -67783,18 +67791,39 @@ class LocalWorkerPool {
67783
67791
  const key = JSON.stringify([run.id, stage.id, prompt.id]);
67784
67792
  if (this.routedPrompts.has(key))
67785
67793
  continue;
67794
+ if (this.heldAnswers.awaitsLaterAttempt(run.id, stage.id, generation))
67795
+ continue;
67786
67796
  this.routedPrompts.add(key);
67787
67797
  const held = this.heldAnswers.takePrompt(run.id, stage.id, prompt, generation);
67788
- if (held !== undefined)
67798
+ if (held !== undefined && "response" in held)
67789
67799
  store?.resolveStagePendingPrompt(run.id, stage.id, prompt.id, held.response);
67790
- const fail = (error) => this.answerPooledStagePrompt(run.id, stage.id, {
67791
- kind: "failed",
67792
- promptId: prompt.id,
67793
- error: error.message
67794
- });
67800
+ const fail = async (error) => {
67801
+ const result = await this.answerPooledStagePrompt(run.id, stage.id, {
67802
+ kind: "failed",
67803
+ promptId: prompt.id,
67804
+ error: error.message
67805
+ });
67806
+ if (!result.ok && result.refusal !== "StageNotLive") {
67807
+ this.heldAnswers.hold(run.id, stage.id, {
67808
+ kind: "prompt",
67809
+ generation,
67810
+ promptId: prompt.id,
67811
+ identity: promptIdentity(prompt),
67812
+ error: error.message
67813
+ });
67814
+ this.applyHeldAnswer(run.id, stage.id, generation);
67815
+ }
67816
+ return result;
67817
+ };
67818
+ let failedElsewhere = held !== undefined && "error" in held;
67795
67819
  const heldLater = Promise.withResolvers();
67796
- this.routedPromptAnswers.set(key, heldLater.resolve);
67797
- const answered = held !== undefined ? Promise.resolve(held.response) : prompt.kind === "custom" ? Promise.reject(new Error(POOLED_CUSTOM_PROMPT_UNAVAILABLE)) : Promise.race([
67820
+ this.routedPromptAnswers.set(key, (outcome) => {
67821
+ if ("response" in outcome)
67822
+ return heldLater.resolve(outcome.response);
67823
+ failedElsewhere = true;
67824
+ heldLater.reject(new Error(outcome.error));
67825
+ });
67826
+ const answered = held !== undefined ? "response" in held ? Promise.resolve(held.response) : Promise.reject(new Error(held.error)) : prompt.kind === "custom" ? Promise.reject(new Error(POOLED_CUSTOM_PROMPT_UNAVAILABLE)) : Promise.race([
67798
67827
  heldLater.promise,
67799
67828
  this.promptUi !== undefined ? askStagePromptUi(this.promptUi, prompt) : store?.awaitStagePendingPrompt(run.id, stage.id, prompt.id) ?? Promise.reject(new Error("No workflow store answers this prompt."))
67800
67829
  ]);
@@ -67816,9 +67845,9 @@ class LocalWorkerPool {
67816
67845
  this.applyHeldAnswer(run.id, stage.id, generation);
67817
67846
  }
67818
67847
  return result;
67819
- }, (error) => this.promptUi !== undefined || prompt.kind === "custom" ? fail(error) : undefined);
67848
+ }, (error) => failedElsewhere || this.promptUi !== undefined || prompt.kind === "custom" ? fail(error) : undefined);
67820
67849
  answer.then((result) => {
67821
- if (result?.ok === false && result.refusal === "StaleAttempt")
67850
+ if (result?.ok === false && result.refusal !== "StageNotLive")
67822
67851
  this.routedPrompts.delete(key);
67823
67852
  }).catch(() => this.routedPrompts.delete(key));
67824
67853
  }
@@ -67854,8 +67883,10 @@ class LocalWorkerPool {
67854
67883
  if (question?.promptId !== promptId || signal.aborted)
67855
67884
  return signal.aborted;
67856
67885
  const held = this.heldAnswers.takeQuestion(runId, stageId, question, generation);
67857
- if (held !== undefined)
67858
- return this.sendQuestionAnswer(runId, stageId, question, generation, held.answer, route);
67886
+ if (held !== undefined) {
67887
+ const sent = await this.sendQuestionOutcome(runId, stageId, question, generation, held, route);
67888
+ return sent && "error" in held ? "failed" : sent;
67889
+ }
67859
67890
  const broker = this.questionBroker ?? currentStageUiBroker();
67860
67891
  let answered;
67861
67892
  let failure;
@@ -67879,19 +67910,15 @@ class LocalWorkerPool {
67879
67910
  broker.clearStagePrompt(runId, stageId);
67880
67911
  }
67881
67912
  if (failure !== undefined) {
67882
- await this.answerPooledStagePrompt(runId, stageId, { kind: "failed", promptId, error: failure.message });
67883
- return "failed";
67913
+ const sent = await this.sendQuestionOutcome(runId, stageId, question, generation, { error: failure.message }, route);
67914
+ return sent ? "failed" : false;
67884
67915
  }
67885
67916
  if (answered === undefined)
67886
67917
  return true;
67887
- return this.sendQuestionAnswer(runId, stageId, question, generation, { raw: answered.value }, route);
67918
+ return this.sendQuestionOutcome(runId, stageId, question, generation, { answer: { raw: answered.value } }, route);
67888
67919
  }
67889
- async sendQuestionAnswer(runId, stageId, question, generation, answer, route) {
67890
- const result = await this.answerPooledStagePrompt(runId, stageId, {
67891
- kind: "input",
67892
- promptId: question.promptId,
67893
- answer
67894
- });
67920
+ async sendQuestionOutcome(runId, stageId, question, generation, outcome, route) {
67921
+ const result = await this.answerPooledStagePrompt(runId, stageId, "error" in outcome ? { kind: "failed", promptId: question.promptId, error: outcome.error } : { kind: "input", promptId: question.promptId, answer: outcome.answer });
67895
67922
  if (result.ok || result.refusal === "StageNotLive")
67896
67923
  return true;
67897
67924
  this.heldAnswers.hold(runId, stageId, {
@@ -67899,7 +67926,7 @@ class LocalWorkerPool {
67899
67926
  generation,
67900
67927
  promptId: question.promptId,
67901
67928
  identity: questionIdentity(question),
67902
- answer
67929
+ ...outcome
67903
67930
  });
67904
67931
  const key = JSON.stringify([runId, stageId]);
67905
67932
  const active = this.routedQuestions.get(key);
@@ -67907,7 +67934,7 @@ class LocalWorkerPool {
67907
67934
  this.routedQuestions.delete(key);
67908
67935
  else if (active !== undefined && active.promptId === question.promptId && active.generation > generation) {
67909
67936
  this.routedQuestions.delete(key);
67910
- active.controller.abort(new Error("The question was answered before its worker was replaced."));
67937
+ active.controller.abort(new Error("The question was settled before its worker was replaced."));
67911
67938
  }
67912
67939
  this.applyHeldAnswer(runId, stageId, generation);
67913
67940
  return false;
@@ -67928,9 +67955,9 @@ class LocalWorkerPool {
67928
67955
  const held = this.heldAnswers.takePrompt(runId, stageId, prompt, generation);
67929
67956
  if (held === undefined)
67930
67957
  return;
67931
- if (this.promptUi === undefined)
67958
+ if (this.promptUi === undefined && "response" in held)
67932
67959
  this.store?.resolveStagePendingPrompt(runId, stageId, prompt.id, held.response);
67933
- deliver(held.response);
67960
+ deliver(held);
67934
67961
  }
67935
67962
  async pausePooledStage(watch) {
67936
67963
  if (this.closed || this.coordinatorLost !== undefined)
@@ -10755,7 +10755,7 @@ var init_stage_question_form = __esm(() => {
10755
10755
  });
10756
10756
 
10757
10757
  // dist/builtin/workflows/src/shared/resume-continuation.ts
10758
- var RESUME_CONTINUATION_PROMPT = "Continue where you left off. If you believe you are finished with your original task (or a redefined task if the user told you), stop.";
10758
+ var RESUME_CONTINUATION_PROMPT = "Continue where you left off. If a pause interrupted a command or step you were running, redo or continue that step as needed. If you believe you are finished with your original task (or a redefined task if the user told you), stop.";
10759
10759
 
10760
10760
  // dist/builtin/workflows/src/runs/foreground/executor-hil.ts
10761
10761
  import { createHash as createHash2 } from "node:crypto";
@@ -64239,13 +64239,19 @@ class HeldPromptAnswers {
64239
64239
  if (held.runId === runId && generation > held.generation && !present.has(key))
64240
64240
  this.held.delete(key);
64241
64241
  }
64242
+ awaitsLaterAttempt(runId, stageId, generation) {
64243
+ const held = this.held.get(JSON.stringify([runId, stageId]));
64244
+ return held !== undefined && generation <= held.generation;
64245
+ }
64242
64246
  takePrompt(runId, stageId, prompt, generation) {
64243
64247
  const key = JSON.stringify([runId, stageId]);
64244
64248
  const held = this.held.get(key);
64245
64249
  if (held === undefined || generation <= held.generation)
64246
64250
  return;
64247
64251
  this.held.delete(key);
64248
- return held.kind === "prompt" && held.identity === promptIdentity(prompt) ? { response: held.response } : undefined;
64252
+ if (held.kind !== "prompt" || held.identity !== promptIdentity(prompt))
64253
+ return;
64254
+ return "error" in held ? { error: held.error } : { response: held.response };
64249
64255
  }
64250
64256
  takeQuestion(runId, stageId, question, generation) {
64251
64257
  const key = JSON.stringify([runId, stageId]);
@@ -64253,7 +64259,9 @@ class HeldPromptAnswers {
64253
64259
  if (held === undefined || generation <= held.generation)
64254
64260
  return;
64255
64261
  this.held.delete(key);
64256
- return held.kind === "question" && held.identity === questionIdentity(question) ? { answer: held.answer } : undefined;
64262
+ if (held.kind !== "question" || held.identity !== questionIdentity(question))
64263
+ return;
64264
+ return "error" in held ? { error: held.error } : { answer: held.answer };
64257
64265
  }
64258
64266
  clear() {
64259
64267
  this.held.clear();
@@ -67803,18 +67811,39 @@ class LocalWorkerPool {
67803
67811
  const key = JSON.stringify([run.id, stage.id, prompt.id]);
67804
67812
  if (this.routedPrompts.has(key))
67805
67813
  continue;
67814
+ if (this.heldAnswers.awaitsLaterAttempt(run.id, stage.id, generation))
67815
+ continue;
67806
67816
  this.routedPrompts.add(key);
67807
67817
  const held = this.heldAnswers.takePrompt(run.id, stage.id, prompt, generation);
67808
- if (held !== undefined)
67818
+ if (held !== undefined && "response" in held)
67809
67819
  store?.resolveStagePendingPrompt(run.id, stage.id, prompt.id, held.response);
67810
- const fail = (error) => this.answerPooledStagePrompt(run.id, stage.id, {
67811
- kind: "failed",
67812
- promptId: prompt.id,
67813
- error: error.message
67814
- });
67820
+ const fail = async (error) => {
67821
+ const result = await this.answerPooledStagePrompt(run.id, stage.id, {
67822
+ kind: "failed",
67823
+ promptId: prompt.id,
67824
+ error: error.message
67825
+ });
67826
+ if (!result.ok && result.refusal !== "StageNotLive") {
67827
+ this.heldAnswers.hold(run.id, stage.id, {
67828
+ kind: "prompt",
67829
+ generation,
67830
+ promptId: prompt.id,
67831
+ identity: promptIdentity(prompt),
67832
+ error: error.message
67833
+ });
67834
+ this.applyHeldAnswer(run.id, stage.id, generation);
67835
+ }
67836
+ return result;
67837
+ };
67838
+ let failedElsewhere = held !== undefined && "error" in held;
67815
67839
  const heldLater = Promise.withResolvers();
67816
- this.routedPromptAnswers.set(key, heldLater.resolve);
67817
- const answered = held !== undefined ? Promise.resolve(held.response) : prompt.kind === "custom" ? Promise.reject(new Error(POOLED_CUSTOM_PROMPT_UNAVAILABLE)) : Promise.race([
67840
+ this.routedPromptAnswers.set(key, (outcome) => {
67841
+ if ("response" in outcome)
67842
+ return heldLater.resolve(outcome.response);
67843
+ failedElsewhere = true;
67844
+ heldLater.reject(new Error(outcome.error));
67845
+ });
67846
+ const answered = held !== undefined ? "response" in held ? Promise.resolve(held.response) : Promise.reject(new Error(held.error)) : prompt.kind === "custom" ? Promise.reject(new Error(POOLED_CUSTOM_PROMPT_UNAVAILABLE)) : Promise.race([
67818
67847
  heldLater.promise,
67819
67848
  this.promptUi !== undefined ? askStagePromptUi(this.promptUi, prompt) : store?.awaitStagePendingPrompt(run.id, stage.id, prompt.id) ?? Promise.reject(new Error("No workflow store answers this prompt."))
67820
67849
  ]);
@@ -67836,9 +67865,9 @@ class LocalWorkerPool {
67836
67865
  this.applyHeldAnswer(run.id, stage.id, generation);
67837
67866
  }
67838
67867
  return result;
67839
- }, (error) => this.promptUi !== undefined || prompt.kind === "custom" ? fail(error) : undefined);
67868
+ }, (error) => failedElsewhere || this.promptUi !== undefined || prompt.kind === "custom" ? fail(error) : undefined);
67840
67869
  answer.then((result) => {
67841
- if (result?.ok === false && result.refusal === "StaleAttempt")
67870
+ if (result?.ok === false && result.refusal !== "StageNotLive")
67842
67871
  this.routedPrompts.delete(key);
67843
67872
  }).catch(() => this.routedPrompts.delete(key));
67844
67873
  }
@@ -67874,8 +67903,10 @@ class LocalWorkerPool {
67874
67903
  if (question?.promptId !== promptId || signal.aborted)
67875
67904
  return signal.aborted;
67876
67905
  const held = this.heldAnswers.takeQuestion(runId, stageId, question, generation);
67877
- if (held !== undefined)
67878
- return this.sendQuestionAnswer(runId, stageId, question, generation, held.answer, route);
67906
+ if (held !== undefined) {
67907
+ const sent = await this.sendQuestionOutcome(runId, stageId, question, generation, held, route);
67908
+ return sent && "error" in held ? "failed" : sent;
67909
+ }
67879
67910
  const broker = this.questionBroker ?? currentStageUiBroker();
67880
67911
  let answered;
67881
67912
  let failure;
@@ -67899,19 +67930,15 @@ class LocalWorkerPool {
67899
67930
  broker.clearStagePrompt(runId, stageId);
67900
67931
  }
67901
67932
  if (failure !== undefined) {
67902
- await this.answerPooledStagePrompt(runId, stageId, { kind: "failed", promptId, error: failure.message });
67903
- return "failed";
67933
+ const sent = await this.sendQuestionOutcome(runId, stageId, question, generation, { error: failure.message }, route);
67934
+ return sent ? "failed" : false;
67904
67935
  }
67905
67936
  if (answered === undefined)
67906
67937
  return true;
67907
- return this.sendQuestionAnswer(runId, stageId, question, generation, { raw: answered.value }, route);
67938
+ return this.sendQuestionOutcome(runId, stageId, question, generation, { answer: { raw: answered.value } }, route);
67908
67939
  }
67909
- async sendQuestionAnswer(runId, stageId, question, generation, answer, route) {
67910
- const result = await this.answerPooledStagePrompt(runId, stageId, {
67911
- kind: "input",
67912
- promptId: question.promptId,
67913
- answer
67914
- });
67940
+ async sendQuestionOutcome(runId, stageId, question, generation, outcome, route) {
67941
+ const result = await this.answerPooledStagePrompt(runId, stageId, "error" in outcome ? { kind: "failed", promptId: question.promptId, error: outcome.error } : { kind: "input", promptId: question.promptId, answer: outcome.answer });
67915
67942
  if (result.ok || result.refusal === "StageNotLive")
67916
67943
  return true;
67917
67944
  this.heldAnswers.hold(runId, stageId, {
@@ -67919,7 +67946,7 @@ class LocalWorkerPool {
67919
67946
  generation,
67920
67947
  promptId: question.promptId,
67921
67948
  identity: questionIdentity(question),
67922
- answer
67949
+ ...outcome
67923
67950
  });
67924
67951
  const key = JSON.stringify([runId, stageId]);
67925
67952
  const active = this.routedQuestions.get(key);
@@ -67927,7 +67954,7 @@ class LocalWorkerPool {
67927
67954
  this.routedQuestions.delete(key);
67928
67955
  else if (active !== undefined && active.promptId === question.promptId && active.generation > generation) {
67929
67956
  this.routedQuestions.delete(key);
67930
- active.controller.abort(new Error("The question was answered before its worker was replaced."));
67957
+ active.controller.abort(new Error("The question was settled before its worker was replaced."));
67931
67958
  }
67932
67959
  this.applyHeldAnswer(runId, stageId, generation);
67933
67960
  return false;
@@ -67948,9 +67975,9 @@ class LocalWorkerPool {
67948
67975
  const held = this.heldAnswers.takePrompt(runId, stageId, prompt, generation);
67949
67976
  if (held === undefined)
67950
67977
  return;
67951
- if (this.promptUi === undefined)
67978
+ if (this.promptUi === undefined && "response" in held)
67952
67979
  this.store?.resolveStagePendingPrompt(runId, stageId, prompt.id, held.response);
67953
- deliver(held.response);
67980
+ deliver(held);
67954
67981
  }
67955
67982
  async pausePooledStage(watch) {
67956
67983
  if (this.closed || this.coordinatorLost !== undefined)
@@ -1 +1 @@
1
- {"version":3,"file":"agent-session-tasks.d.ts","sourceRoot":"","sources":["../../src/core/agent-session-tasks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG9F,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAYzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAOzE,oGAAoG;AACpG,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,iBAAiB,CAAC,GAAG,OAAO,CAE9F;AAUD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAMnE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,aAAa,CAkIlE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,sBAAsB,GAAG,SAAS,CAY3F;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAMzE;AAED,mFAAmF;AACnF,wBAAsB,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAElE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAEpD;AAED,eAAO,MAAM,uBAAuB;;;;;;CAMnC,CAAC"}
1
+ {"version":3,"file":"agent-session-tasks.d.ts","sourceRoot":"","sources":["../../src/core/agent-session-tasks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG9F,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAYzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAOzE,oGAAoG;AACpG,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,iBAAiB,CAAC,GAAG,OAAO,CAE9F;AAUD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAMnE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,aAAa,CAwIlE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,sBAAsB,GAAG,SAAS,CAY3F;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAMzE;AAED,mFAAmF;AACnF,wBAAsB,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAElE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAEpD;AAED,eAAO,MAAM,uBAAuB;;;;;;CAMnC,CAAC"}
@@ -128,7 +128,14 @@ export function getAgentTaskHost() {
128
128
  throw new Error("Subagent delegation is not available inside a subagent");
129
129
  },
130
130
  onTaskSettled: (...[ref, receipt]) => {
131
- outbox.record(ref.ownerId, receipt);
131
+ // Save the task's kind with the intent: a notice replayed after a restart has no task record to read it from.
132
+ const watched = this._agentTaskHost?.watchOwnerTasks();
133
+ const kind = watched?.ok
134
+ ? watched.value.snapshot.tasks.find((task) => task.ref.taskId === receipt.taskId)?.kind
135
+ : undefined;
136
+ if (watched?.ok)
137
+ watched.value.dispose();
138
+ outbox.record(ref.ownerId, receipt, kind);
132
139
  void outbox.flush();
133
140
  },
134
141
  };
@@ -1 +1 @@
1
- {"version":3,"file":"agent-session-tasks.js","sourceRoot":"","sources":["../../src/core/agent-session-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAiC,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AACzG,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EACN,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAEvF,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAE/E,6EAA6E;AAC7E,6EAA6E;AAC7E,MAAM,sBAAsB,GAAG,IAAI,OAAO,EAAkB,CAAC;AAE7D,oGAAoG;AACpG,MAAM,UAAU,sBAAsB,CAAC,OAA8C;IACpF,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC;AAED;;;GAGG;AACH,SAAS,kBAAkB,CAAC,OAAqB;IAChD,OAAO,sBAAsB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC;AACtF,CAAC;AAED,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,eAAe,CAAC,CAAC;AAC3G,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACtC,uFAAuF;IACvF,IAAI,kBAAkB,CAAC,IAAI,CAAC;QAAE,OAAO;IACrC,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC;IAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IACjE,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;AAC5F,CAAC;AAED,mFAAmF;AACnF,MAAM,CAAC,KAAK,UAAU,UAAU;IAC/B,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,UAAU,EAAE,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,WAAW;IAC1B,IAAI,CAAC,cAAc,EAAE,WAAW,EAAE,CAAC;AACpC,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC,gBAAgB;IAChB,oBAAoB;IACpB,iBAAiB;IACjB,UAAU;IACV,WAAW;CACX,CAAC","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport type { AgentSessionInternalSurface as AgentSession } from \"./agent-session-methods.ts\";\nimport { getExtensionRuntimeEventBus } from \"./extensions/loader-core.js\";\nimport { sessionGenerationClosing } from \"./session-lifecycle-work.ts\";\nimport { AgentTaskHost } from \"./tasks/agent-adapter.js\";\nimport { type ChildTaskCompletionRoute, childTaskCompletionRoute } from \"./tasks/child-command-owner.js\";\nimport { COMMAND_DETAIL_TAIL_BYTES, taskOutputText } from \"./tasks/command-output.js\";\nimport {\n\tformatTaskCompletion,\n\tTASK_COMPLETION_MESSAGE_TYPE,\n\tTaskCompletionOutbox,\n\ttaskCompletionNotice,\n} from \"./tasks/completion.js\";\nimport { flushTaskCompletionMessages } from \"./tasks/completion-ordering.js\";\nimport { bindOwnerTaskStore, OwnerTaskStore } from \"./tasks/owner-store.js\";\nimport { taskOwnTranscriptEntries, taskTranscriptSource } from \"./tasks/supervisor.js\";\nimport type { SupervisedCommandOwner } from \"./tools/bash-pty-native.js\";\nimport { WorkflowStageAdmissionBoundary } from \"./workflow-stage-admission.ts\";\n\n// Native owners identify live generations, never borrowed persisted storage.\n// Explicit workflow-stage owners remain borrowed across session replacement.\nconst replacementOwnerScopes = new WeakMap<object, string>();\n\n/** An admitted in-process subagent child; top-level sessions may carry a policy without `depth`. */\nexport function isSubagentChildSession(session: Pick<AgentSession, \"_subagentPolicy\">): boolean {\n\treturn (session._subagentPolicy?.depth ?? 0) >= 1;\n}\n\n/**\n * A child launched from a workflow stage inherits the stage's admission boundary for\n * message delivery, but must never bind or rebind the stage's own task owner.\n */\nfunction stageTaskAdmission(session: AgentSession) {\n\treturn isSubagentChildSession(session) ? undefined : session._workflowStageAdmission;\n}\n\nexport function replaceSessionTaskOwner(session: AgentSession): void {\n\tif (stageTaskAdmission(session)) return;\n\treplacementOwnerScopes.set(session, randomUUID());\n\tsession._agentTaskHost = undefined;\n\tsession._taskAdmission = undefined;\n\tsession._taskCompletionOutbox = undefined;\n}\n\nexport function getAgentTaskHost(this: AgentSession): AgentTaskHost {\n\tif (this._disposed || sessionGenerationClosing.has(this)) throw new Error(\"Task owner is closed\");\n\tif (this._agentTaskHost) return this._agentTaskHost;\n\tconst stageAdmission = stageTaskAdmission(this);\n\tconst admission = stageAdmission ?? WorkflowStageAdmissionBoundary.restore(this.sessionManager.getEntries());\n\tthis._taskAdmission = admission;\n\tconst outbox = new TaskCompletionOutbox(\n\t\tthis.sessionManager,\n\t\t() => !this._disposed && admission.isOpen(),\n\t\tasync (envelope, restored) => {\n\t\t\t// Settlement can precede the UI projection's next drain. Read the owner\n\t\t\t// snapshot, not the display store, when attaching completion context.\n\t\t\tconst host = this._agentTaskHost;\n\t\t\tconst watched = host?.watchOwnerTasks();\n\t\t\tconst task = watched?.ok\n\t\t\t\t? watched.value.snapshot.tasks.find(\n\t\t\t\t\t\t(item) => item.ref.taskId === envelope.taskId && item.ref.ownerId === envelope.ownerId,\n\t\t\t\t\t)\n\t\t\t\t: undefined;\n\t\t\tif (watched?.ok) watched.value.dispose();\n\t\t\t// Foreground shell results already return through their tool call. Do not\n\t\t\t// create a second model turn or background card for that same execution.\n\t\t\tif (task?.kind === \"command\" && !task.wasBackground) return;\n\t\t\tconst lease = task ? host?.resolveTask(envelope.taskId) : undefined;\n\t\t\tconst source = lease?.ok ? taskTranscriptSource(lease.value) : undefined;\n\t\t\tconst ownEntries = lease?.ok ? taskOwnTranscriptEntries(lease.value) : undefined;\n\t\t\tconst response = ownEntries\n\t\t\t\t? ownEntries\n\t\t\t\t\t\t.slice()\n\t\t\t\t\t\t.reverse()\n\t\t\t\t\t\t.find(\n\t\t\t\t\t\t\t(entry) =>\n\t\t\t\t\t\t\t\tentry.type === \"message\" &&\n\t\t\t\t\t\t\t\tentry.message.role === \"assistant\" &&\n\t\t\t\t\t\t\t\tentry.message.content.some((block) => block.type === \"text\" && block.text.trim()),\n\t\t\t\t\t\t)\n\t\t\t\t: undefined;\n\t\t\tlet output =\n\t\t\t\tresponse?.type === \"message\" && response.message.role === \"assistant\"\n\t\t\t\t\t? response.message.content\n\t\t\t\t\t\t\t.filter((block) => block.type === \"text\")\n\t\t\t\t\t\t\t.map((block) => block.text)\n\t\t\t\t\t\t\t.join(\"\\n\")\n\t\t\t\t\t: undefined;\n\t\t\tif (task?.kind === \"command\" && lease?.ok && host) {\n\t\t\t\ttry {\n\t\t\t\t\tconst bytes = BigInt(task.output.byteCount);\n\t\t\t\t\tconst start = bytes > BigInt(COMMAND_DETAIL_TAIL_BYTES) ? bytes - BigInt(COMMAND_DETAIL_TAIL_BYTES) : 0n;\n\t\t\t\t\tconst page = await host.ownerBinding.supervisor.readTaskOutput(lease.value, {\n\t\t\t\t\t\tstart: String(start),\n\t\t\t\t\t\tmaximumBytes: COMMAND_DETAIL_TAIL_BYTES,\n\t\t\t\t\t});\n\t\t\t\t\toutput = page.ok\n\t\t\t\t\t\t? `${start > 0n ? \"[Earlier output omitted]\\n\" : \"\"}${taskOutputText(page.value)}`\n\t\t\t\t\t\t: \"Output unavailable\";\n\t\t\t\t} catch {\n\t\t\t\t\t// Missing retained output must not suppress a terminal notification.\n\t\t\t\t\toutput = \"Output unavailable\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst message = {\n\t\t\t\tcustomType: TASK_COMPLETION_MESSAGE_TYPE,\n\t\t\t\tcontent: formatTaskCompletion(envelope, task, output),\n\t\t\t\tdetails: { ...envelope, notification: taskCompletionNotice(envelope, task, output) },\n\t\t\t\tdisplay: true as const,\n\t\t\t};\n\t\t\tconst childRoute =\n\t\t\t\thost && task?.kind === \"command\" ? childTaskCompletionRoute(host, envelope.taskId) : undefined;\n\t\t\tif (childRoute) {\n\t\t\t\ttry {\n\t\t\t\t\tawait childRoute.deliver(message);\n\t\t\t\t\treturn;\n\t\t\t\t} catch {\n\t\t\t\t\t// The launching child ended before delivery; the owning parent receives the notice.\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst completionSource = source?.ok ? source.value.session.completionSource : undefined;\n\t\t\tif (completionSource) {\n\t\t\t\tawait flushTaskCompletionMessages(\n\t\t\t\t\tgetExtensionRuntimeEventBus(this._resourceLoader.getExtensions().runtime),\n\t\t\t\t\tcompletionSource,\n\t\t\t\t\tenvelope.completionId,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst deliver = () =>\n\t\t\t\tthis.sendCustomMessage(\n\t\t\t\t\tmessage,\n\t\t\t\t\trestored\n\t\t\t\t\t\t? { triggerTurn: false, stageAdmissionKey: envelope.completionId }\n\t\t\t\t\t\t: { triggerTurn: true, persistWhenStreaming: true, stageAdmissionKey: envelope.completionId },\n\t\t\t\t);\n\t\t\tif (stageAdmission) await deliver();\n\t\t\telse {\n\t\t\t\tawait admission.admit(envelope.completionId, deliver, () => {\n\t\t\t\t\tthrow new Error(\"Task owner is closed\");\n\t\t\t\t}).completion;\n\t\t\t}\n\t\t},\n\t);\n\tthis._taskCompletionOutbox = outbox;\n\tconst binding = {\n\t\tresourceAdmission: this._resourceAdmission,\n\t\tauthorizeLaunch: () => {\n\t\t\tif (this._disposed || sessionGenerationClosing.has(this) || !admission.isOpen())\n\t\t\t\tthrow new Error(\"Task owner is closed\");\n\t\t\tif (isSubagentChildSession(this)) throw new Error(\"Subagent delegation is not available inside a subagent\");\n\t\t},\n\t\tonTaskSettled: (\n\t\t\t...[ref, receipt]: Parameters<NonNullable<import(\"./tasks/supervisor.js\").TrustedTaskHost[\"onTaskSettled\"]>>\n\t\t) => {\n\t\t\toutbox.record(ref.ownerId, receipt);\n\t\t\tvoid outbox.flush();\n\t\t},\n\t};\n\tif (!stageAdmission && !replacementOwnerScopes.has(this)) replacementOwnerScopes.set(this, randomUUID());\n\tthis._agentTaskHost = stageAdmission\n\t\t? stageAdmission.bindAgentTaskHost(binding)\n\t\t: new AgentTaskHost({\n\t\t\t\t...binding,\n\t\t\t\tscope: {\n\t\t\t\t\tkind: \"session\",\n\t\t\t\t\tsessionId: replacementOwnerScopes.get(this)!,\n\t\t\t\t},\n\t\t\t});\n\tconst { supervisor, owner } = this._agentTaskHost.ownerBinding;\n\tconst store = new OwnerTaskStore(supervisor, owner);\n\tconst connected = store.connect();\n\tif (!connected.ok) throw new Error(connected.error.message);\n\tbindOwnerTaskStore(this, store);\n\treturn this._agentTaskHost;\n}\n\n/**\n * Shell task owner for this session. A subagent child runs shells in its parent's owner,\n * so they appear in the parent's `/tasks` and outlive the child.\n */\nexport function _getCommandTaskOwner(this: AgentSession): SupervisedCommandOwner | undefined {\n\tif (!isSubagentChildSession(this)) return this.getAgentTaskHost().ownerBinding;\n\tif (!this._parentCommandTaskOwner || this._disposed) return undefined;\n\tconst route: ChildTaskCompletionRoute = {\n\t\tisOpen: () => !this._disposed && this._subagentPolicy?.messageAdmission?.isOpen() === true,\n\t\tdeliver: async (message) => {\n\t\t\tconst admission = this._subagentPolicy?.messageAdmission;\n\t\t\tif (!admission) throw new Error(\"Subagent execution cannot accept messages\");\n\t\t\tawait admission.run(() => this.sendCustomMessage(message, { triggerTurn: true, persistWhenStreaming: true }));\n\t\t},\n\t};\n\treturn this._parentCommandTaskOwner.bind(this.sessionManager.getSessionId(), route, this._childTaskWaits);\n}\n\nexport async function closeSessionTasks(this: AgentSession): Promise<void> {\n\t// Replacement stage sessions share generation lifetime; disposal is not stage closure.\n\tif (stageTaskAdmission(this)) return;\n\tthis._taskAdmission?.seal();\n\tconst closed = await this._agentTaskHost?.close(\"session-close\");\n\tif (closed && !closed.ok) throw new Error(`${closed.error.code}: ${closed.error.message}`);\n}\n\n/** Workflow controller only: main-chat message pause does not stop owned tasks. */\nexport async function pauseTasks(this: AgentSession): Promise<void> {\n\tawait this.getAgentTaskHost().pauseTasks();\n}\n\nexport function resumeTasks(this: AgentSession): void {\n\tthis._agentTaskHost?.resumeTasks();\n}\n\nexport const agentSessionTaskMethods = {\n\tgetAgentTaskHost,\n\t_getCommandTaskOwner,\n\tcloseSessionTasks,\n\tpauseTasks,\n\tresumeTasks,\n};\n"]}
1
+ {"version":3,"file":"agent-session-tasks.js","sourceRoot":"","sources":["../../src/core/agent-session-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAiC,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AACzG,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EACN,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,uB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AAI,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC;IAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IACjE,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;AAC5F,CAAC;AAED,mFAAmF;AACnF,MAAM,CAAC,KAAK,UAAU,UAAU;IAC/B,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,UAAU,EAAE,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,WAAW;IAC1B,IAAI,CAAC,cAAc,EAAE,WAAW,EAAE,CAAC;AACpC,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC,gBAAgB;IAChB,oBAAoB;IACpB,iBAAiB;IACjB,UAAU;IACV,WAAW;CACX,CAAC","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport type { AgentSessionInternalSurface as AgentSession } from \"./agent-session-methods.ts\";\nimport { getExtensionRuntimeEventBus } from \"./extensions/loader-core.js\";\nimport { sessionGenerationClosing } from \"./session-lifecycle-work.ts\";\nimport { AgentTaskHost } from \"./tasks/agent-adapter.js\";\nimport { type ChildTaskCompletionRoute, childTaskCompletionRoute } from \"./tasks/child-command-owner.js\";\nimport { COMMAND_DETAIL_TAIL_BYTES, taskOutputText } from \"./tasks/command-output.js\";\nimport {\n\tformatTaskCompletion,\n\tTASK_COMPLETION_MESSAGE_TYPE,\n\tTaskCompletionOutbox,\n\ttaskCompletionNotice,\n} from \"./tasks/completion.js\";\nimport { flushTaskCompletionMessages } from \"./tasks/completion-ordering.js\";\nimport { bindOwnerTaskStore, OwnerTaskStore } from \"./tasks/owner-store.js\";\nimport { taskOwnTranscriptEntries, taskTranscriptSource } from \"./tasks/supervisor.js\";\nimport type { SupervisedCommandOwner } from \"./tools/bash-pty-native.js\";\nimport { WorkflowStageAdmissionBoundary } from \"./workflow-stage-admission.ts\";\n\n// Native owners identify live generations, never borrowed persisted storage.\n// Explicit workflow-stage owners remain borrowed across session replacement.\nconst replacementOwnerScopes = new WeakMap<object, string>();\n\n/** An admitted in-process subagent child; top-level sessions may carry a policy without `depth`. */\nexport function isSubagentChildSession(session: Pick<AgentSession, \"_subagentPolicy\">): boolean {\n\treturn (session._subagentPolicy?.depth ?? 0) >= 1;\n}\n\n/**\n * A child launched from a workflow stage inherits the stage's admission boundary for\n * message delivery, but must never bind or rebind the stage's own task owner.\n */\nfunction stageTaskAdmission(session: AgentSession) {\n\treturn isSubagentChildSession(session) ? undefined : session._workflowStageAdmission;\n}\n\nexport function replaceSessionTaskOwner(session: AgentSession): void {\n\tif (stageTaskAdmission(session)) return;\n\treplacementOwnerScopes.set(session, randomUUID());\n\tsession._agentTaskHost = undefined;\n\tsession._taskAdmission = undefined;\n\tsession._taskCompletionOutbox = undefined;\n}\n\nexport function getAgentTaskHost(this: AgentSession): AgentTaskHost {\n\tif (this._disposed || sessionGenerationClosing.has(this)) throw new Error(\"Task owner is closed\");\n\tif (this._agentTaskHost) return this._agentTaskHost;\n\tconst stageAdmission = stageTaskAdmission(this);\n\tconst admission = stageAdmission ?? WorkflowStageAdmissionBoundary.restore(this.sessionManager.getEntries());\n\tthis._taskAdmission = admission;\n\tconst outbox = new TaskCompletionOutbox(\n\t\tthis.sessionManager,\n\t\t() => !this._disposed && admission.isOpen(),\n\t\tasync (envelope, restored) => {\n\t\t\t// Settlement can precede the UI projection's next drain. Read the owner\n\t\t\t// snapshot, not the display store, when attaching completion context.\n\t\t\tconst host = this._agentTaskHost;\n\t\t\tconst watched = host?.watchOwnerTasks();\n\t\t\tconst task = watched?.ok\n\t\t\t\t? watched.value.snapshot.tasks.find(\n\t\t\t\t\t\t(item) => item.ref.taskId === envelope.taskId && item.ref.ownerId === envelope.ownerId,\n\t\t\t\t\t)\n\t\t\t\t: undefined;\n\t\t\tif (watched?.ok) watched.value.dispose();\n\t\t\t// Foreground shell results already return through their tool call. Do not\n\t\t\t// create a second model turn or background card for that same execution.\n\t\t\tif (task?.kind === \"command\" && !task.wasBackground) return;\n\t\t\tconst lease = task ? host?.resolveTask(envelope.taskId) : undefined;\n\t\t\tconst source = lease?.ok ? taskTranscriptSource(lease.value) : undefined;\n\t\t\tconst ownEntries = lease?.ok ? taskOwnTranscriptEntries(lease.value) : undefined;\n\t\t\tconst response = ownEntries\n\t\t\t\t? ownEntries\n\t\t\t\t\t\t.slice()\n\t\t\t\t\t\t.reverse()\n\t\t\t\t\t\t.find(\n\t\t\t\t\t\t\t(entry) =>\n\t\t\t\t\t\t\t\tentry.type === \"message\" &&\n\t\t\t\t\t\t\t\tentry.message.role === \"assistant\" &&\n\t\t\t\t\t\t\t\tentry.message.content.some((block) => block.type === \"text\" && block.text.trim()),\n\t\t\t\t\t\t)\n\t\t\t\t: undefined;\n\t\t\tlet output =\n\t\t\t\tresponse?.type === \"message\" && response.message.role === \"assistant\"\n\t\t\t\t\t? response.message.content\n\t\t\t\t\t\t\t.filter((block) => block.type === \"text\")\n\t\t\t\t\t\t\t.map((block) => block.text)\n\t\t\t\t\t\t\t.join(\"\\n\")\n\t\t\t\t\t: undefined;\n\t\t\tif (task?.kind === \"command\" && lease?.ok && host) {\n\t\t\t\ttry {\n\t\t\t\t\tconst bytes = BigInt(task.output.byteCount);\n\t\t\t\t\tconst start = bytes > BigInt(COMMAND_DETAIL_TAIL_BYTES) ? bytes - BigInt(COMMAND_DETAIL_TAIL_BYTES) : 0n;\n\t\t\t\t\tconst page = await host.ownerBinding.supervisor.readTaskOutput(lease.value, {\n\t\t\t\t\t\tstart: String(start),\n\t\t\t\t\t\tmaximumBytes: COMMAND_DETAIL_TAIL_BYTES,\n\t\t\t\t\t});\n\t\t\t\t\toutput = page.ok\n\t\t\t\t\t\t? `${start > 0n ? \"[Earlier output omitted]\\n\" : \"\"}${taskOutputText(page.value)}`\n\t\t\t\t\t\t: \"Output unavailable\";\n\t\t\t\t} catch {\n\t\t\t\t\t// Missing retained output must not suppress a terminal notification.\n\t\t\t\t\toutput = \"Output unavailable\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst message = {\n\t\t\t\tcustomType: TASK_COMPLETION_MESSAGE_TYPE,\n\t\t\t\tcontent: formatTaskCompletion(envelope, task, output),\n\t\t\t\tdetails: { ...envelope, notification: taskCompletionNotice(envelope, task, output) },\n\t\t\t\tdisplay: true as const,\n\t\t\t};\n\t\t\tconst childRoute =\n\t\t\t\thost && task?.kind === \"command\" ? childTaskCompletionRoute(host, envelope.taskId) : undefined;\n\t\t\tif (childRoute) {\n\t\t\t\ttry {\n\t\t\t\t\tawait childRoute.deliver(message);\n\t\t\t\t\treturn;\n\t\t\t\t} catch {\n\t\t\t\t\t// The launching child ended before delivery; the owning parent receives the notice.\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst completionSource = source?.ok ? source.value.session.completionSource : undefined;\n\t\t\tif (completionSource) {\n\t\t\t\tawait flushTaskCompletionMessages(\n\t\t\t\t\tgetExtensionRuntimeEventBus(this._resourceLoader.getExtensions().runtime),\n\t\t\t\t\tcompletionSource,\n\t\t\t\t\tenvelope.completionId,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst deliver = () =>\n\t\t\t\tthis.sendCustomMessage(\n\t\t\t\t\tmessage,\n\t\t\t\t\trestored\n\t\t\t\t\t\t? { triggerTurn: false, stageAdmissionKey: envelope.completionId }\n\t\t\t\t\t\t: { triggerTurn: true, persistWhenStreaming: true, stageAdmissionKey: envelope.completionId },\n\t\t\t\t);\n\t\t\tif (stageAdmission) await deliver();\n\t\t\telse {\n\t\t\t\tawait admission.admit(envelope.completionId, deliver, () => {\n\t\t\t\t\tthrow new Error(\"Task owner is closed\");\n\t\t\t\t}).completion;\n\t\t\t}\n\t\t},\n\t);\n\tthis._taskCompletionOutbox = outbox;\n\tconst binding = {\n\t\tresourceAdmission: this._resourceAdmission,\n\t\tauthorizeLaunch: () => {\n\t\t\tif (this._disposed || sessionGenerationClosing.has(this) || !admission.isOpen())\n\t\t\t\tthrow new Error(\"Task owner is closed\");\n\t\t\tif (isSubagentChildSession(this)) throw new Error(\"Subagent delegation is not available inside a subagent\");\n\t\t},\n\t\tonTaskSettled: (\n\t\t\t...[ref, receipt]: Parameters<NonNullable<import(\"./tasks/supervisor.js\").TrustedTaskHost[\"onTaskSettled\"]>>\n\t\t) => {\n\t\t\t// Save the task's kind with the intent: a notice replayed after a restart has no task record to read it from.\n\t\t\tconst watched = this._agentTaskHost?.watchOwnerTasks();\n\t\t\tconst kind = watched?.ok\n\t\t\t\t? watched.value.snapshot.tasks.find((task) => task.ref.taskId === receipt.taskId)?.kind\n\t\t\t\t: undefined;\n\t\t\tif (watched?.ok) watched.value.dispose();\n\t\t\toutbox.record(ref.ownerId, receipt, kind);\n\t\t\tvoid outbox.flush();\n\t\t},\n\t};\n\tif (!stageAdmission && !replacementOwnerScopes.has(this)) replacementOwnerScopes.set(this, randomUUID());\n\tthis._agentTaskHost = stageAdmission\n\t\t? stageAdmission.bindAgentTaskHost(binding)\n\t\t: new AgentTaskHost({\n\t\t\t\t...binding,\n\t\t\t\tscope: {\n\t\t\t\t\tkind: \"session\",\n\t\t\t\t\tsessionId: replacementOwnerScopes.get(this)!,\n\t\t\t\t},\n\t\t\t});\n\tconst { supervisor, owner } = this._agentTaskHost.ownerBinding;\n\tconst store = new OwnerTaskStore(supervisor, owner);\n\tconst connected = store.connect();\n\tif (!connected.ok) throw new Error(connected.error.message);\n\tbindOwnerTaskStore(this, store);\n\treturn this._agentTaskHost;\n}\n\n/**\n * Shell task owner for this session. A subagent child runs shells in its parent's owner,\n * so they appear in the parent's `/tasks` and outlive the child.\n */\nexport function _getCommandTaskOwner(this: AgentSession): SupervisedCommandOwner | undefined {\n\tif (!isSubagentChildSession(this)) return this.getAgentTaskHost().ownerBinding;\n\tif (!this._parentCommandTaskOwner || this._disposed) return undefined;\n\tconst route: ChildTaskCompletionRoute = {\n\t\tisOpen: () => !this._disposed && this._subagentPolicy?.messageAdmission?.isOpen() === true,\n\t\tdeliver: async (message) => {\n\t\t\tconst admission = this._subagentPolicy?.messageAdmission;\n\t\t\tif (!admission) throw new Error(\"Subagent execution cannot accept messages\");\n\t\t\tawait admission.run(() => this.sendCustomMessage(message, { triggerTurn: true, persistWhenStreaming: true }));\n\t\t},\n\t};\n\treturn this._parentCommandTaskOwner.bind(this.sessionManager.getSessionId(), route, this._childTaskWaits);\n}\n\nexport async function closeSessionTasks(this: AgentSession): Promise<void> {\n\t// Replacement stage sessions share generation lifetime; disposal is not stage closure.\n\tif (stageTaskAdmission(this)) return;\n\tthis._taskAdmission?.seal();\n\tconst closed = await this._agentTaskHost?.close(\"session-close\");\n\tif (closed && !closed.ok) throw new Error(`${closed.error.code}: ${closed.error.message}`);\n}\n\n/** Workflow controller only: main-chat message pause does not stop owned tasks. */\nexport async function pauseTasks(this: AgentSession): Promise<void> {\n\tawait this.getAgentTaskHost().pauseTasks();\n}\n\nexport function resumeTasks(this: AgentSession): void {\n\tthis._agentTaskHost?.resumeTasks();\n}\n\nexport const agentSessionTaskMethods = {\n\tgetAgentTaskHost,\n\t_getCommandTaskOwner,\n\tcloseSessionTasks,\n\tpauseTasks,\n\tresumeTasks,\n};\n"]}
@@ -1,4 +1,4 @@
1
- import type { AutocompleteProvider, Component, EditorComponent, EditorTheme, OverlayHandle, OverlayOptions, TUI } from "@earendil-works/pi-tui";
1
+ import type { AutocompleteProvider, Component, EditorComponent, EditorTheme, OverlayHandle, OverlayOptions, ProgramStatus, TUI } from "@earendil-works/pi-tui";
2
2
  import type { Theme } from "../../modes/interactive/theme/theme.js";
3
3
  import type { ReadonlyFooterDataProvider } from "../footer-data-provider.ts";
4
4
  import type { KeybindingsManager } from "../keybindings.ts";
@@ -286,6 +286,14 @@ export interface ExtensionUIContext {
286
286
  overlayOptions?: OverlayOptions | (() => OverlayOptions);
287
287
  /** Called with the overlay handle after the overlay is shown. Use to control visibility. */
288
288
  onHandle?: (handle: OverlayHandle) => void;
289
+ /**
290
+ * Report Atomic as blocked on user input (OSC 7501 program status) while this component is visible.
291
+ * Only applies to inline components, not overlays.
292
+ */
293
+ blocked?: {
294
+ kind: NonNullable<ProgramStatus["kind"]>;
295
+ message: string;
296
+ };
289
297
  }): Promise<T>;
290
298
  /**
291
299
  * Open a session-list picker that runs natively in the host terminal
@@ -1 +1 @@
1
- {"version":3,"file":"ui-types.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/ui-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EACpB,SAAS,EACT,eAAe,EACf,WAAW,EACX,aAAa,EACb,cAAc,EACd,GAAG,EACH,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,wCAAwC;AACxC,MAAM,WAAW,wBAAwB;IACxC,0DAA0D;IAC1D,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,uCAAuC;AACvC,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,aAAa,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IACnC,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;C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A;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,8BAA8B,CAAC;AAExE,6FAA6F;AAC7F,MAAM,UAAU,2BAA2B,CAAC,KAAwB;IACnE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,IAAI,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAChG,CAAC;AACH,CAAC;AAED,MAAM,kBAAkB,GAAG,aAAa,CAAC;AACzC,MAAM,0BAA0B,GAAG,uDAAuD,CAAC;AAE3F;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAwB;IACxD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,0BAA0B,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CACvF,CAAC;AACH,CAAC","sourcesContent":["import type {\n\tAutocompleteProvider,\n\tComponent,\n\tEditorComponent,\n\tEditorTheme,\n\tOverlayHandle,\n\tOverlayOptions,\n\tTUI,\n} from \"@earendil-works/pi-tui\";\nimport type { Theme } from \"../../modes/interactive/theme/theme.js\";\nimport type { ReadonlyFooterDataProvider } from \"../footer-data-provider.ts\";\nimport type { KeybindingsManager } from \"../keybindings.ts\";\nimport type { MarkdownTransformer, MessageRenderer } from \"./message-types.ts\";\nimport type { ToolRenderers } from \"./tool-types.ts\";\n\n/** Options for extension UI dialogs. */\nexport interface ExtensionUIDialogOptions {\n\t/** AbortSignal to programmatically dismiss the dialog. */\n\tsignal?: AbortSignal;\n\t/** Timeout in milliseconds. Dialog auto-dismisses with live countdown display. */\n\ttimeout?: number;\n}\n\n/** Placement for extension widgets. */\nexport type WidgetPlacement = \"aboveEditor\" | \"belowEditor\";\n\nexport interface WidgetScrollState {\n\tscrollTop: number;\n\tviewportHeight: number;\n\tcontentHeight: number;\n}\n\nexport interface WidgetScrollRequest {\n\t/** Increase when intentionally requesting a new position. */\n\tversion: number;\n\tscrollTop: number;\n}\n\nexport interface ScrollableWidgetComponent extends Component {\n\tgetScrollRequest?(): WidgetScrollRequest | undefined;\n\tonScroll?(state: WidgetScrollState): void;\n\tdispose?(): void;\n}\n\n/** Options for extension widgets. */\nexport interface ExtensionWidgetOptions {\n\t/** Where the widget is rendered. Defaults to \"aboveEditor\". */\n\tplacement?: WidgetPlacement;\n\t/** Opt in to a host-owned viewport. Height is a cap, not a guaranteed allocation. */\n\tscroll?: { maxHeight: number; maxHeightFraction?: number };\n}\n\n/** Raw terminal input listener for extensions. */\nexport type TerminalInputHandler = (data: string) => { consume?: boolean; data?: string } | undefined;\n\n/** Working indicator configuration for the interactive Working lifecycle. */\nexport interface WorkingIndicatorOptions {\n\t/** Animation frames. Use an empty array to hide the indicator entirely. Custom frames are rendered verbatim. */\n\tframes?: string[];\n\t/** Frame interval in milliseconds for animated indicators. */\n\tintervalMs?: number;\n}\n\n/** Wrap the current autocomplete provider with additional behavior. */\nexport type AutocompleteProviderFactory = (current: AutocompleteProvider) => AutocompleteProvider;\nexport type EditorFactory = (tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager) => EditorComponent;\n/** Component returned by `ctx.ui.custom()`. Input handlers must report whether they consumed the key. */\nexport type ExtensionCustomComponent = Omit<Component, \"handleInput\"> & {\n\thandleInput?: (data: string) => boolean | undefined | Promise<boolean | undefined>;\n\tdispose?(): void;\n};\n\n/**\n * Zero-width mark a custom component may embed in the line it most needs kept\n * on screen — the selected row of a list, say.\n *\n * A `reserveTranscriptRows` overlay is bounded against the terminal height, and\n * on a short terminal that bound has to drop rows. Without a mark the host can\n * only guess, and it guessed wrong: it kept a fixed number of rows from the top,\n * so on a 16-to-22-row terminal the selected option was cropped away and the\n * dialog looked frozen under the arrow keys. With the mark the host windows what\n * it keeps around that row instead.\n *\n * It is an APC sequence, so pi-tui's `visibleWidth` measures it as zero and\n * terminals ignore it — the same mechanism as pi-tui's own `CURSOR_MARKER`, but\n * private to Atomic. Embed it once per frame; the host uses the first line that\n * carries it.\n *\n * The terminator is ST (`ESC \\`), which is what ECMA-48 requires of an APC\n * string. A BEL terminator is accepted for OSC but not for APC, so terminals\n * that follow the spec — tmux among them — kept swallowing the rest of the line\n * as APC payload and drew whatever followed the mark at the wrong column. The\n * renderer strips the mark centrally in `applyLineResets` before painting, so\n * it does not reach the terminal at all; the conforming terminator is the\n * second layer, bounding the damage if a frame ever escapes that strip.\n */\nexport const OVERLAY_ACTIVE_ROW_MARKER = \"\\u001B_atomic:active\\u001B\\\\\";\n\n/** Remove every {@link OVERLAY_ACTIVE_ROW_MARKER} from `lines`, leaving widths untouched. */\nexport function stripOverlayActiveRowMarker(lines: readonly string[]): string[] {\n\treturn lines.map((line) =>\n\t\tline.includes(OVERLAY_ACTIVE_ROW_MARKER) ? line.replaceAll(OVERLAY_ACTIVE_ROW_MARKER, \"\") : line,\n\t);\n}\n\nconst OSC133_PROMPT_MARK = \"\\u001B]133;\";\nconst OSC133_PROMPT_MARK_PATTERN = /\\u001B\\]133;[ABC][^\\u0007\\u001B]*(?:\\u0007|\\u001B\\\\)/g;\n\n/**\n * Remove every OSC 133 `A`/`B`/`C` shell-integration mark from `lines`, wherever it sits in the line.\n * Terminals treat `A` as a new shell prompt and drop the program's OSC 7501 status record, so a\n * fullscreen frame must never carry one. The marks are zero-width, so no column moves.\n */\nexport function stripOsc133Marks(lines: readonly string[]): string[] {\n\treturn lines.map((line) =>\n\t\tline.includes(OSC133_PROMPT_MARK) ? line.replace(OSC133_PROMPT_MARK_PATTERN, \"\") : line,\n\t);\n}\n\nexport interface ChatRenderSettings {\n\thideThinkingBlock: boolean;\n\thiddenThinkingLabel: string;\n\ttoolOutputExpanded: boolean;\n\tshowImages: boolean;\n\timageWidthCells: number;\n\tmarkdownTransformers: readonly MarkdownTransformer[];\n\trenderLatex?: boolean;\n\tgetToolDefinition(toolName: string): ToolRenderers | undefined;\n\tgetCustomMessageRenderer(customType: string): MessageRenderer | undefined;\n}\n\n/** Host-owned inline custom UI focus state exposed to overlays without prompt content. */\nexport interface HostCustomUiState {\n\t/** Number of active non-overlay host custom UI mounts. */\n\tblockingInlineCustomUiDepth: number;\n\t/** True when at least one non-overlay host custom UI is mounted and blocking. */\n\tblockingInlineCustomUiActive: boolean;\n\t/** True when the active inline custom UI is waiting behind an overlay that kept focus. */\n\tblockingInlineCustomUiFocusDeferred?: boolean;\n\t/** Distinguishes required prompts from navigation. Omitted when all mounts are prompts. */\n\tblockingInlineCustomUiNeedsInput?: boolean;\n}\n\nexport type HostCustomUiStateListener = (state: HostCustomUiState) => void;\n\n/** Supported field kinds for the host-native input form. */\nexport type HostInputFormFieldType = \"string\" | \"text\" | \"number\" | \"integer\" | \"boolean\" | \"select\";\n\n/** JSON-safe field descriptor for {@link ExtensionUIContext.hostInputForm}. */\nexport interface HostInputFormField {\n\tname: string;\n\ttype: HostInputFormFieldType;\n\tdescription?: string;\n\trequired?: boolean;\n\tchoices?: string[];\n\tplaceholder?: string;\n\t/** Raw, display-ready initial value. */\n\tinitialValue: string;\n}\n\n/** Request for a host-owned inline input form. */\nexport interface HostInputFormRequest {\n\ttitle: string;\n\tfields: HostInputFormField[];\n\t/** Panel heading label. Defaults to \"WORKFLOW INPUTS\". */\n\theading?: string;\n\t/** Submit button label. Defaults to \"[ Run workflow ]\". */\n\tsubmitLabel?: string;\n}\n\n/**\n * JSON-safe session-selector row for the host-native session picker.\n * Mirrors `SessionInfo` with `created`/`modified` flattened to epoch millis so\n * rows can cross the interactive-engine protocol without `Date` objects.\n */\nexport interface HostSessionPickerRow {\n\tpath: string;\n\tid: string;\n\tcwd: string;\n\t/** Creation time in epoch milliseconds. */\n\tcreatedAt: number;\n\t/** Last-modified time in epoch milliseconds. */\n\tmodifiedAt: number;\n\tmessageCount: number;\n\tfirstMessage: string;\n\t/** Generated resume summary. Absent when never generated, or stale against the latest message. */\n\tsummary?: string;\n\tallMessagesText?: string;\n\tname?: string;\n\t/** Optional semantic color for synthetic selector rows. */\n\tmessageColor?: \"success\" | \"warning\" | \"accent\" | \"error\";\n}\n\n/** Request for {@link ExtensionUIContext.hostSessionPicker}. */\nexport interface HostSessionPickerRequest {\n\t/** Rows shown in the first frame. Push later rows via the handle's `update()`. */\n\tsessions: HostSessionPickerRow[];\n\t/** Show the rename keybinding hint in the picker header. Defaults to false. */\n\tshowRenameHint?: boolean;\n\t/**\n\t * Invoked after the user confirms a Ctrl+D delete on a row. The host does\n\t * NOT remove the row; reply with `update()` (row removed) or `error()`.\n\t */\n\tonDelete?: (path: string) => void | Promise<void>;\n}\n\n/** Live control surface for an open host-native session picker. */\nexport interface HostSessionPickerHandle {\n\t/** Resolves with the selected row's `path`, or `undefined` on cancel/close. */\n\tresult: Promise<string | undefined>;\n\t/** Replace the picker rows (navigation/search state is preserved host-side). */\n\tupdate(sessions: HostSessionPickerRow[]): void;\n\t/** Surface a transient error message in the picker header. */\n\terror(message: string): void;\n\t/** Close the picker; `result` resolves `undefined`. Idempotent. */\n\tclose(): void;\n}\n\n/**\n * UI context for extensions to request interactive UI.\n * Each mode (interactive, RPC, print) provides its own implementation.\n */\nexport interface ExtensionUIContext {\n\t/** Show a selector and return the user's choice. */\n\tselect(title: string, options: string[], opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Show a confirmation dialog. */\n\tconfirm(title: string, message: string, opts?: ExtensionUIDialogOptions): Promise<boolean>;\n\n\t/** Show a text input dialog. */\n\tinput(title: string, placeholder?: string, opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Show a notification to the user. */\n\tnotify(message: string, type?: \"info\" | \"warning\" | \"error\"): void;\n\n\t/** Request an interactive repaint after extension-owned state changes. */\n\trequestRender(): void;\n\n\t/** Get host-owned inline custom UI focus state, if the mode exposes it. */\n\tgetHostCustomUiState?(): HostCustomUiState;\n\n\t/** Observe host-owned inline custom UI focus state changes. Returns an unsubscribe function. */\n\tonHostCustomUiStateChange?(listener: HostCustomUiStateListener): () => void;\n\n\t/** Move focus to a mounted host-owned inline custom UI, if one is pending. */\n\tfocusHostInlineCustomUi?(): boolean;\n\n\t/** Listen to raw terminal input (interactive mode only). Returns an unsubscribe function. */\n\tonTerminalInput(handler: TerminalInputHandler): () => void;\n\n\t/** Set status text in the footer/status bar. Pass undefined to clear. */\n\tsetStatus(key: string, text: string | undefined): void;\n\n\t/**\n\t * Set the working/loading message presented during the active Working lifecycle,\n\t * from accepted prompt startup through the agent turn. This customizes\n\t * presentation only; it does not start work or emit pre-start events. Call with\n\t * no argument to restore the default.\n\t */\n\tsetWorkingMessage(message?: string): void;\n\n\t/**\n\t * Show or hide the built-in row during the active Working lifecycle.\n\t * This customizes presentation only; it does not start or stop work.\n\t */\n\tsetWorkingVisible(visible: boolean): void;\n\n\t/**\n\t * Configure the interactive indicator presented during the active Working\n\t * lifecycle, from accepted prompt startup through the agent turn. This\n\t * customizes presentation only; it does not start work or emit pre-start events.\n\t *\n\t * - Omit the argument to restore the default animated spinner.\n\t * - Use `frames: [\"●\"]` for a static indicator.\n\t * - Use `frames: []` to hide the indicator entirely.\n\t * - Custom frames are rendered as provided, so extensions must add their own colors.\n\t */\n\tsetWorkingIndicator(options?: WorkingIndicatorOptions): void;\n\n\t/** Set the label shown for hidden thinking blocks. Call with no argument to restore default. */\n\tsetHiddenThinkingLabel(label?: string): void;\n\n\t/** Set a widget to display above or below the editor. Accepts string array or component factory. */\n\tsetWidget(key: string, content: string[] | undefined, options?: ExtensionWidgetOptions): void;\n\tsetWidget(\n\t\tkey: string,\n\t\tcontent: ((tui: TUI, theme: Theme) => Component & { dispose?(): void }) | undefined,\n\t\toptions?: ExtensionWidgetOptions,\n\t): void;\n\n\t/** Observe host-driven widget release events for a key. Returns an unsubscribe function. */\n\tonWidgetRelease?(key: string, listener: () => void): () => void;\n\n\t/** Set a custom footer component, or undefined to restore the built-in footer.\n\t *\n\t * The factory receives a FooterDataProvider for data not otherwise accessible:\n\t * git branch and extension statuses from setStatus(). Context usage is on\n\t * ctx.getContextUsage(), token stats on ctx.sessionManager.getEntries(), and model info on ctx.model.\n\t */\n\tsetFooter(\n\t\tfactory:\n\t\t\t| ((tui: TUI, theme: Theme, footerData: ReadonlyFooterDataProvider) => Component & { dispose?(): void })\n\t\t\t| undefined,\n\t): void;\n\n\t/** Set a custom header component (shown at startup, above chat), or undefined to restore the built-in header. */\n\tsetHeader(factory: ((tui: TUI, theme: Theme) => Component & { dispose?(): void }) | undefined): void;\n\n\t/** Set the terminal window/tab title. */\n\tsetTitle(title: string): void;\n\n\t/** Show a custom component with keyboard focus. */\n\tcustom<T>(\n\t\tfactory: (\n\t\t\ttui: TUI,\n\t\t\ttheme: Theme,\n\t\t\tkeybindings: KeybindingsManager,\n\t\t\tdone: (result: T) => void,\n\t\t) => ExtensionCustomComponent | Promise<ExtensionCustomComponent>,\n\t\toptions?: {\n\t\t\t/** Navigation does not emit approval-prompt events. Defaults to \"prompt\". */\n\t\t\tpurpose?: \"prompt\" | \"navigation\";\n\t\t\toverlay?: boolean;\n\t\t\t/** Keep host inline custom UI pending in the background while this overlay is visible. */\n\t\t\tdeferInlineCustomUiFocus?: boolean;\n\t\t\t/**\n\t\t\t * Declare that this component binds Ctrl+C itself (cancel, skip, close).\n\t\t\t * The host then forwards the first Ctrl+C to it instead of closing it.\n\t\t\t *\n\t\t\t * Leave it unset unless the component really handles the key: the host\n\t\t\t * closes an undeclared component on the first Ctrl+C so a component that\n\t\t\t * never resolves can never trap the keyboard.\n\t\t\t */\n\t\t\thandlesCtrlC?: boolean;\n\t\t\t/** Declare that this component claims internal UI actions such as the jump-to-bottom URL. */\n\t\t\thandlesInternalUiAction?: boolean;\n\t\t\t/**\n\t\t\t * Overlay-only. Bound this overlay's height so a transcript strip stays\n\t\t\t * visible, and extend the transcript's scroll extent by the rows it\n\t\t\t * still covers, so every line of the scrollback can be brought above it.\n\t\t\t *\n\t\t\t * Set it for a blocking bottom-anchored dialog. Leave it unset for an\n\t\t\t * overlay that is meant to take the screen, such as a full-screen graph.\n\t\t\t */\n\t\t\treserveTranscriptRows?: boolean;\n\t\t\t/** AbortSignal to programmatically dismiss the custom UI. */\n\t\t\tsignal?: AbortSignal;\n\t\t\t/** Overlay positioning/sizing options. Can be static or a function for dynamic updates. */\n\t\t\toverlayOptions?: OverlayOptions | (() => OverlayOptions);\n\t\t\t/** Called with the overlay handle after the overlay is shown. Use to control visibility. */\n\t\t\tonHandle?: (handle: OverlayHandle) => void;\n\t\t},\n\t): Promise<T>;\n\n\t/**\n\t * Open a session-list picker that runs natively in the host terminal\n\t * process. Every interactive host implements it — non-isolated mode\n\t * mounts the selector directly (no IPC), isolated mode routes it over\n\t * the engine session-picker protocol channel — so callers use one\n\t * identical API. In both cases navigation and search never cross a\n\t * process boundary; only open/update/select/delete/cancel do. The\n\t * member is absent only on non-interactive surfaces (headless RPC,\n\t * print); callers should fail with an actionable error there rather\n\t * than degrade.\n\t */\n\thostSessionPicker?(request: HostSessionPickerRequest): HostSessionPickerHandle;\n\n\t/**\n\t * Open an inline form whose component, focus, and editing state live in the\n\t * terminal host. Resolves raw field values, or undefined on cancellation.\n\t */\n\thostInputForm?(request: HostInputFormRequest): Promise<Record<string, string> | undefined>;\n\n\t/** Paste text into the editor, triggering paste handling (collapse for large content). */\n\tpasteToEditor(text: string): void;\n\n\t/** Set the text in the core input editor. */\n\tsetEditorText(text: string): void;\n\n\t/** Get the current text from the core input editor. */\n\tgetEditorText(): string;\n\n\t/**\n\t * Show a multi-line editor for text editing.\n\t *\n\t * `opts.signal` lets a host cancel the mount it owns — the isolated engine\n\t * bridge uses it to close dialogs belonging to a dead engine generation.\n\t */\n\teditor(title: string, prefill?: string, opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Stack additional autocomplete behavior on top of the built-in provider. */\n\taddAutocompleteProvider(factory: AutocompleteProviderFactory): void;\n\n\t/**\n\t * Set a custom editor component via factory function.\n\t * Pass undefined to restore the default editor.\n\t *\n\t * The factory receives:\n\t * - `theme`: EditorTheme for styling borders and autocomplete\n\t * - `keybindings`: KeybindingsManager for app-level keybindings\n\t *\n\t * For full app keybinding support (escape, ctrl+d, model switching, etc.),\n\t * extend `CustomEditor` from `@bastani/atomic` and return `super.handleInput(data)`\n\t * for keys you don't handle.\n\t *\n\t * @example\n\t * ```ts\n\t * import { CustomEditor } from \"@bastani/atomic\";\n\t *\n\t * class VimEditor extends CustomEditor {\n\t * private mode: \"normal\" | \"insert\" = \"insert\";\n\t *\n\t * handleInput(data: string): boolean {\n\t * if (this.mode === \"normal\") {\n\t * // Handle vim normal mode keys...\n\t * if (data === \"i\") { this.mode = \"insert\"; return true; }\n\t * }\n\t * return super.handleInput(data); // App keybindings + text editing\n\t * }\n\t * }\n\t *\n\t * ctx.ui.setEditorComponent((tui, theme, keybindings) =>\n\t * new VimEditor(tui, theme, keybindings)\n\t * );\n\t * ```\n\t */\n\tsetEditorComponent(factory: EditorFactory | undefined): void;\n\n\t/** Get the currently configured custom editor factory, or undefined when using the default editor. */\n\tgetEditorComponent(): EditorFactory | undefined;\n\n\t/** Get the built-in footer data provider so embedded extension UIs can reuse the core footer. */\n\tgetFooterDataProvider(): ReadonlyFooterDataProvider;\n\n\t/** Get the current theme for styling. */\n\treadonly theme: Theme;\n\n\t/** Get all available themes with their names and file paths. */\n\tgetAllThemes(): { name: string; path: string | undefined }[];\n\n\t/** Load a theme by name without switching to it. Returns undefined if not found. */\n\tgetTheme(name: string): Theme | undefined;\n\n\t/** Set the current theme by name or Theme object. */\n\tsetTheme(theme: string | Theme): { success: boolean; error?: string };\n\n\t/** Get current tool output expansion state. */\n\tgetToolsExpanded(): boolean;\n\n\t/** Set tool output expansion state. */\n\tsetToolsExpanded(expanded: boolean): void;\n\n\t/** Get current chat rendering preferences and extension renderers. */\n\tgetChatRenderSettings(): ChatRenderSettings;\n}\n"]}
1
+ {"version":3,"file":"ui-types.js","sourceRoot":"","sources":["../../../src/core/extensions/ui-types.ts"],"names":[],"mappings":"AAyEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,8BAA8B,CAAC;AAExE,6FAA6F;AAC7F,MAAM,UAAU,2BAA2B,CAAC,KAAwB;IACnE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,IAAI,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAChG,CAAC;AACH,CAAC;AAED,MAAM,kBAAkB,GAAG,aAAa,CAAC;AACzC,MAAM,0BAA0B,GAAG,uDAAuD,CAAC;AAE3F;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAwB;IACxD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,0BAA0B,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CACvF,CAAC;AACH,CAAC","sourcesContent":["import type {\n\tAutocompleteProvider,\n\tComponent,\n\tEditorComponent,\n\tEditorTheme,\n\tOverlayHandle,\n\tOverlayOptions,\n\tProgramStatus,\n\tTUI,\n} from \"@earendil-works/pi-tui\";\nimport type { Theme } from \"../../modes/interactive/theme/theme.js\";\nimport type { ReadonlyFooterDataProvider } from \"../footer-data-provider.ts\";\nimport type { KeybindingsManager } from \"../keybindings.ts\";\nimport type { MarkdownTransformer, MessageRenderer } from \"./message-types.ts\";\nimport type { ToolRenderers } from \"./tool-types.ts\";\n\n/** Options for extension UI dialogs. */\nexport interface ExtensionUIDialogOptions {\n\t/** AbortSignal to programmatically dismiss the dialog. */\n\tsignal?: AbortSignal;\n\t/** Timeout in milliseconds. Dialog auto-dismisses with live countdown display. */\n\ttimeout?: number;\n}\n\n/** Placement for extension widgets. */\nexport type WidgetPlacement = \"aboveEditor\" | \"belowEditor\";\n\nexport interface WidgetScrollState {\n\tscrollTop: number;\n\tviewportHeight: number;\n\tcontentHeight: number;\n}\n\nexport interface WidgetScrollRequest {\n\t/** Increase when intentionally requesting a new position. */\n\tversion: number;\n\tscrollTop: number;\n}\n\nexport interface ScrollableWidgetComponent extends Component {\n\tgetScrollRequest?(): WidgetScrollRequest | undefined;\n\tonScroll?(state: WidgetScrollState): void;\n\tdispose?(): void;\n}\n\n/** Options for extension widgets. */\nexport interface ExtensionWidgetOptions {\n\t/** Where the widget is rendered. Defaults to \"aboveEditor\". */\n\tplacement?: WidgetPlacement;\n\t/** Opt in to a host-owned viewport. Height is a cap, not a guaranteed allocation. */\n\tscroll?: { maxHeight: number; maxHeightFraction?: number };\n}\n\n/** Raw terminal input listener for extensions. */\nexport type TerminalInputHandler = (data: string) => { consume?: boolean; data?: string } | undefined;\n\n/** Working indicator configuration for the interactive Working lifecycle. */\nexport interface WorkingIndicatorOptions {\n\t/** Animation frames. Use an empty array to hide the indicator entirely. Custom frames are rendered verbatim. */\n\tframes?: string[];\n\t/** Frame interval in milliseconds for animated indicators. */\n\tintervalMs?: number;\n}\n\n/** Wrap the current autocomplete provider with additional behavior. */\nexport type AutocompleteProviderFactory = (current: AutocompleteProvider) => AutocompleteProvider;\nexport type EditorFactory = (tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager) => EditorComponent;\n/** Component returned by `ctx.ui.custom()`. Input handlers must report whether they consumed the key. */\nexport type ExtensionCustomComponent = Omit<Component, \"handleInput\"> & {\n\thandleInput?: (data: string) => boolean | undefined | Promise<boolean | undefined>;\n\tdispose?(): void;\n};\n\n/**\n * Zero-width mark a custom component may embed in the line it most needs kept\n * on screen — the selected row of a list, say.\n *\n * A `reserveTranscriptRows` overlay is bounded against the terminal height, and\n * on a short terminal that bound has to drop rows. Without a mark the host can\n * only guess, and it guessed wrong: it kept a fixed number of rows from the top,\n * so on a 16-to-22-row terminal the selected option was cropped away and the\n * dialog looked frozen under the arrow keys. With the mark the host windows what\n * it keeps around that row instead.\n *\n * It is an APC sequence, so pi-tui's `visibleWidth` measures it as zero and\n * terminals ignore it — the same mechanism as pi-tui's own `CURSOR_MARKER`, but\n * private to Atomic. Embed it once per frame; the host uses the first line that\n * carries it.\n *\n * The terminator is ST (`ESC \\`), which is what ECMA-48 requires of an APC\n * string. A BEL terminator is accepted for OSC but not for APC, so terminals\n * that follow the spec — tmux among them — kept swallowing the rest of the line\n * as APC payload and drew whatever followed the mark at the wrong column. The\n * renderer strips the mark centrally in `applyLineResets` before painting, so\n * it does not reach the terminal at all; the conforming terminator is the\n * second layer, bounding the damage if a frame ever escapes that strip.\n */\nexport const OVERLAY_ACTIVE_ROW_MARKER = \"\\u001B_atomic:active\\u001B\\\\\";\n\n/** Remove every {@link OVERLAY_ACTIVE_ROW_MARKER} from `lines`, leaving widths untouched. */\nexport function stripOverlayActiveRowMarker(lines: readonly string[]): string[] {\n\treturn lines.map((line) =>\n\t\tline.includes(OVERLAY_ACTIVE_ROW_MARKER) ? line.replaceAll(OVERLAY_ACTIVE_ROW_MARKER, \"\") : line,\n\t);\n}\n\nconst OSC133_PROMPT_MARK = \"\\u001B]133;\";\nconst OSC133_PROMPT_MARK_PATTERN = /\\u001B\\]133;[ABC][^\\u0007\\u001B]*(?:\\u0007|\\u001B\\\\)/g;\n\n/**\n * Remove every OSC 133 `A`/`B`/`C` shell-integration mark from `lines`, wherever it sits in the line.\n * Terminals treat `A` as a new shell prompt and drop the program's OSC 7501 status record, so a\n * fullscreen frame must never carry one. The marks are zero-width, so no column moves.\n */\nexport function stripOsc133Marks(lines: readonly string[]): string[] {\n\treturn lines.map((line) =>\n\t\tline.includes(OSC133_PROMPT_MARK) ? line.replace(OSC133_PROMPT_MARK_PATTERN, \"\") : line,\n\t);\n}\n\nexport interface ChatRenderSettings {\n\thideThinkingBlock: boolean;\n\thiddenThinkingLabel: string;\n\ttoolOutputExpanded: boolean;\n\tshowImages: boolean;\n\timageWidthCells: number;\n\tmarkdownTransformers: readonly MarkdownTransformer[];\n\trenderLatex?: boolean;\n\tgetToolDefinition(toolName: string): ToolRenderers | undefined;\n\tgetCustomMessageRenderer(customType: string): MessageRenderer | undefined;\n}\n\n/** Host-owned inline custom UI focus state exposed to overlays without prompt content. */\nexport interface HostCustomUiState {\n\t/** Number of active non-overlay host custom UI mounts. */\n\tblockingInlineCustomUiDepth: number;\n\t/** True when at least one non-overlay host custom UI is mounted and blocking. */\n\tblockingInlineCustomUiActive: boolean;\n\t/** True when the active inline custom UI is waiting behind an overlay that kept focus. */\n\tblockingInlineCustomUiFocusDeferred?: boolean;\n\t/** Distinguishes required prompts from navigation. Omitted when all mounts are prompts. */\n\tblockingInlineCustomUiNeedsInput?: boolean;\n}\n\nexport type HostCustomUiStateListener = (state: HostCustomUiState) => void;\n\n/** Supported field kinds for the host-native input form. */\nexport type HostInputFormFieldType = \"string\" | \"text\" | \"number\" | \"integer\" | \"boolean\" | \"select\";\n\n/** JSON-safe field descriptor for {@link ExtensionUIContext.hostInputForm}. */\nexport interface HostInputFormField {\n\tname: string;\n\ttype: HostInputFormFieldType;\n\tdescription?: string;\n\trequired?: boolean;\n\tchoices?: string[];\n\tplaceholder?: string;\n\t/** Raw, display-ready initial value. */\n\tinitialValue: string;\n}\n\n/** Request for a host-owned inline input form. */\nexport interface HostInputFormRequest {\n\ttitle: string;\n\tfields: HostInputFormField[];\n\t/** Panel heading label. Defaults to \"WORKFLOW INPUTS\". */\n\theading?: string;\n\t/** Submit button label. Defaults to \"[ Run workflow ]\". */\n\tsubmitLabel?: string;\n}\n\n/**\n * JSON-safe session-selector row for the host-native session picker.\n * Mirrors `SessionInfo` with `created`/`modified` flattened to epoch millis so\n * rows can cross the interactive-engine protocol without `Date` objects.\n */\nexport interface HostSessionPickerRow {\n\tpath: string;\n\tid: string;\n\tcwd: string;\n\t/** Creation time in epoch milliseconds. */\n\tcreatedAt: number;\n\t/** Last-modified time in epoch milliseconds. */\n\tmodifiedAt: number;\n\tmessageCount: number;\n\tfirstMessage: string;\n\t/** Generated resume summary. Absent when never generated, or stale against the latest message. */\n\tsummary?: string;\n\tallMessagesText?: string;\n\tname?: string;\n\t/** Optional semantic color for synthetic selector rows. */\n\tmessageColor?: \"success\" | \"warning\" | \"accent\" | \"error\";\n}\n\n/** Request for {@link ExtensionUIContext.hostSessionPicker}. */\nexport interface HostSessionPickerRequest {\n\t/** Rows shown in the first frame. Push later rows via the handle's `update()`. */\n\tsessions: HostSessionPickerRow[];\n\t/** Show the rename keybinding hint in the picker header. Defaults to false. */\n\tshowRenameHint?: boolean;\n\t/**\n\t * Invoked after the user confirms a Ctrl+D delete on a row. The host does\n\t * NOT remove the row; reply with `update()` (row removed) or `error()`.\n\t */\n\tonDelete?: (path: string) => void | Promise<void>;\n}\n\n/** Live control surface for an open host-native session picker. */\nexport interface HostSessionPickerHandle {\n\t/** Resolves with the selected row's `path`, or `undefined` on cancel/close. */\n\tresult: Promise<string | undefined>;\n\t/** Replace the picker rows (navigation/search state is preserved host-side). */\n\tupdate(sessions: HostSessionPickerRow[]): void;\n\t/** Surface a transient error message in the picker header. */\n\terror(message: string): void;\n\t/** Close the picker; `result` resolves `undefined`. Idempotent. */\n\tclose(): void;\n}\n\n/**\n * UI context for extensions to request interactive UI.\n * Each mode (interactive, RPC, print) provides its own implementation.\n */\nexport interface ExtensionUIContext {\n\t/** Show a selector and return the user's choice. */\n\tselect(title: string, options: string[], opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Show a confirmation dialog. */\n\tconfirm(title: string, message: string, opts?: ExtensionUIDialogOptions): Promise<boolean>;\n\n\t/** Show a text input dialog. */\n\tinput(title: string, placeholder?: string, opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Show a notification to the user. */\n\tnotify(message: string, type?: \"info\" | \"warning\" | \"error\"): void;\n\n\t/** Request an interactive repaint after extension-owned state changes. */\n\trequestRender(): void;\n\n\t/** Get host-owned inline custom UI focus state, if the mode exposes it. */\n\tgetHostCustomUiState?(): HostCustomUiState;\n\n\t/** Observe host-owned inline custom UI focus state changes. Returns an unsubscribe function. */\n\tonHostCustomUiStateChange?(listener: HostCustomUiStateListener): () => void;\n\n\t/** Move focus to a mounted host-owned inline custom UI, if one is pending. */\n\tfocusHostInlineCustomUi?(): boolean;\n\n\t/** Listen to raw terminal input (interactive mode only). Returns an unsubscribe function. */\n\tonTerminalInput(handler: TerminalInputHandler): () => void;\n\n\t/** Set status text in the footer/status bar. Pass undefined to clear. */\n\tsetStatus(key: string, text: string | undefined): void;\n\n\t/**\n\t * Set the working/loading message presented during the active Working lifecycle,\n\t * from accepted prompt startup through the agent turn. This customizes\n\t * presentation only; it does not start work or emit pre-start events. Call with\n\t * no argument to restore the default.\n\t */\n\tsetWorkingMessage(message?: string): void;\n\n\t/**\n\t * Show or hide the built-in row during the active Working lifecycle.\n\t * This customizes presentation only; it does not start or stop work.\n\t */\n\tsetWorkingVisible(visible: boolean): void;\n\n\t/**\n\t * Configure the interactive indicator presented during the active Working\n\t * lifecycle, from accepted prompt startup through the agent turn. This\n\t * customizes presentation only; it does not start work or emit pre-start events.\n\t *\n\t * - Omit the argument to restore the default animated spinner.\n\t * - Use `frames: [\"●\"]` for a static indicator.\n\t * - Use `frames: []` to hide the indicator entirely.\n\t * - Custom frames are rendered as provided, so extensions must add their own colors.\n\t */\n\tsetWorkingIndicator(options?: WorkingIndicatorOptions): void;\n\n\t/** Set the label shown for hidden thinking blocks. Call with no argument to restore default. */\n\tsetHiddenThinkingLabel(label?: string): void;\n\n\t/** Set a widget to display above or below the editor. Accepts string array or component factory. */\n\tsetWidget(key: string, content: string[] | undefined, options?: ExtensionWidgetOptions): void;\n\tsetWidget(\n\t\tkey: string,\n\t\tcontent: ((tui: TUI, theme: Theme) => Component & { dispose?(): void }) | undefined,\n\t\toptions?: ExtensionWidgetOptions,\n\t): void;\n\n\t/** Observe host-driven widget release events for a key. Returns an unsubscribe function. */\n\tonWidgetRelease?(key: string, listener: () => void): () => void;\n\n\t/** Set a custom footer component, or undefined to restore the built-in footer.\n\t *\n\t * The factory receives a FooterDataProvider for data not otherwise accessible:\n\t * git branch and extension statuses from setStatus(). Context usage is on\n\t * ctx.getContextUsage(), token stats on ctx.sessionManager.getEntries(), and model info on ctx.model.\n\t */\n\tsetFooter(\n\t\tfactory:\n\t\t\t| ((tui: TUI, theme: Theme, footerData: ReadonlyFooterDataProvider) => Component & { dispose?(): void })\n\t\t\t| undefined,\n\t): void;\n\n\t/** Set a custom header component (shown at startup, above chat), or undefined to restore the built-in header. */\n\tsetHeader(factory: ((tui: TUI, theme: Theme) => Component & { dispose?(): void }) | undefined): void;\n\n\t/** Set the terminal window/tab title. */\n\tsetTitle(title: string): void;\n\n\t/** Show a custom component with keyboard focus. */\n\tcustom<T>(\n\t\tfactory: (\n\t\t\ttui: TUI,\n\t\t\ttheme: Theme,\n\t\t\tkeybindings: KeybindingsManager,\n\t\t\tdone: (result: T) => void,\n\t\t) => ExtensionCustomComponent | Promise<ExtensionCustomComponent>,\n\t\toptions?: {\n\t\t\t/** Navigation does not emit approval-prompt events. Defaults to \"prompt\". */\n\t\t\tpurpose?: \"prompt\" | \"navigation\";\n\t\t\toverlay?: boolean;\n\t\t\t/** Keep host inline custom UI pending in the background while this overlay is visible. */\n\t\t\tdeferInlineCustomUiFocus?: boolean;\n\t\t\t/**\n\t\t\t * Declare that this component binds Ctrl+C itself (cancel, skip, close).\n\t\t\t * The host then forwards the first Ctrl+C to it instead of closing it.\n\t\t\t *\n\t\t\t * Leave it unset unless the component really handles the key: the host\n\t\t\t * closes an undeclared component on the first Ctrl+C so a component that\n\t\t\t * never resolves can never trap the keyboard.\n\t\t\t */\n\t\t\thandlesCtrlC?: boolean;\n\t\t\t/** Declare that this component claims internal UI actions such as the jump-to-bottom URL. */\n\t\t\thandlesInternalUiAction?: boolean;\n\t\t\t/**\n\t\t\t * Overlay-only. Bound this overlay's height so a transcript strip stays\n\t\t\t * visible, and extend the transcript's scroll extent by the rows it\n\t\t\t * still covers, so every line of the scrollback can be brought above it.\n\t\t\t *\n\t\t\t * Set it for a blocking bottom-anchored dialog. Leave it unset for an\n\t\t\t * overlay that is meant to take the screen, such as a full-screen graph.\n\t\t\t */\n\t\t\treserveTranscriptRows?: boolean;\n\t\t\t/** AbortSignal to programmatically dismiss the custom UI. */\n\t\t\tsignal?: AbortSignal;\n\t\t\t/** Overlay positioning/sizing options. Can be static or a function for dynamic updates. */\n\t\t\toverlayOptions?: OverlayOptions | (() => OverlayOptions);\n\t\t\t/** Called with the overlay handle after the overlay is shown. Use to control visibility. */\n\t\t\tonHandle?: (handle: OverlayHandle) => void;\n\t\t\t/**\n\t\t\t * Report Atomic as blocked on user input (OSC 7501 program status) while this component is visible.\n\t\t\t * Only applies to inline components, not overlays.\n\t\t\t */\n\t\t\tblocked?: { kind: NonNullable<ProgramStatus[\"kind\"]>; message: string };\n\t\t},\n\t): Promise<T>;\n\n\t/**\n\t * Open a session-list picker that runs natively in the host terminal\n\t * process. Every interactive host implements it — non-isolated mode\n\t * mounts the selector directly (no IPC), isolated mode routes it over\n\t * the engine session-picker protocol channel — so callers use one\n\t * identical API. In both cases navigation and search never cross a\n\t * process boundary; only open/update/select/delete/cancel do. The\n\t * member is absent only on non-interactive surfaces (headless RPC,\n\t * print); callers should fail with an actionable error there rather\n\t * than degrade.\n\t */\n\thostSessionPicker?(request: HostSessionPickerRequest): HostSessionPickerHandle;\n\n\t/**\n\t * Open an inline form whose component, focus, and editing state live in the\n\t * terminal host. Resolves raw field values, or undefined on cancellation.\n\t */\n\thostInputForm?(request: HostInputFormRequest): Promise<Record<string, string> | undefined>;\n\n\t/** Paste text into the editor, triggering paste handling (collapse for large content). */\n\tpasteToEditor(text: string): void;\n\n\t/** Set the text in the core input editor. */\n\tsetEditorText(text: string): void;\n\n\t/** Get the current text from the core input editor. */\n\tgetEditorText(): string;\n\n\t/**\n\t * Show a multi-line editor for text editing.\n\t *\n\t * `opts.signal` lets a host cancel the mount it owns — the isolated engine\n\t * bridge uses it to close dialogs belonging to a dead engine generation.\n\t */\n\teditor(title: string, prefill?: string, opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Stack additional autocomplete behavior on top of the built-in provider. */\n\taddAutocompleteProvider(factory: AutocompleteProviderFactory): void;\n\n\t/**\n\t * Set a custom editor component via factory function.\n\t * Pass undefined to restore the default editor.\n\t *\n\t * The factory receives:\n\t * - `theme`: EditorTheme for styling borders and autocomplete\n\t * - `keybindings`: KeybindingsManager for app-level keybindings\n\t *\n\t * For full app keybinding support (escape, ctrl+d, model switching, etc.),\n\t * extend `CustomEditor` from `@bastani/atomic` and return `super.handleInput(data)`\n\t * for keys you don't handle.\n\t *\n\t * @example\n\t * ```ts\n\t * import { CustomEditor } from \"@bastani/atomic\";\n\t *\n\t * class VimEditor extends CustomEditor {\n\t * private mode: \"normal\" | \"insert\" = \"insert\";\n\t *\n\t * handleInput(data: string): boolean {\n\t * if (this.mode === \"normal\") {\n\t * // Handle vim normal mode keys...\n\t * if (data === \"i\") { this.mode = \"insert\"; return true; }\n\t * }\n\t * return super.handleInput(data); // App keybindings + text editing\n\t * }\n\t * }\n\t *\n\t * ctx.ui.setEditorComponent((tui, theme, keybindings) =>\n\t * new VimEditor(tui, theme, keybindings)\n\t * );\n\t * ```\n\t */\n\tsetEditorComponent(factory: EditorFactory | undefined): void;\n\n\t/** Get the currently configured custom editor factory, or undefined when using the default editor. */\n\tgetEditorComponent(): EditorFactory | undefined;\n\n\t/** Get the built-in footer data provider so embedded extension UIs can reuse the core footer. */\n\tgetFooterDataProvider(): ReadonlyFooterDataProvider;\n\n\t/** Get the current theme for styling. */\n\treadonly theme: Theme;\n\n\t/** Get all available themes with their names and file paths. */\n\tgetAllThemes(): { name: string; path: string | undefined }[];\n\n\t/** Load a theme by name without switching to it. Returns undefined if not found. */\n\tgetTheme(name: string): Theme | undefined;\n\n\t/** Set the current theme by name or Theme object. */\n\tsetTheme(theme: string | Theme): { success: boolean; error?: string };\n\n\t/** Get current tool output expansion state. */\n\tgetToolsExpanded(): boolean;\n\n\t/** Set tool output expansion state. */\n\tsetToolsExpanded(expanded: boolean): void;\n\n\t/** Get current chat rendering preferences and extension renderers. */\n\tgetChatRenderSettings(): ChatRenderSettings;\n}\n"]}