@sideboard-ai/core 0.1.319 → 0.1.320

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 (61) hide show
  1. package/dist/{abletime-L3ODNTBT.js → abletime-CRRLEYTE.js} +4 -4
  2. package/dist/{abletime-DVYO4IVS.js → abletime-ICW6Q2AB.js} +4 -4
  3. package/dist/{abletime-oauth-2VWQCXGT.js → abletime-oauth-P3KPPJE4.js} +3 -3
  4. package/dist/{abletime-oauth-6DTX7LB7.js → abletime-oauth-Q76XBSPG.js} +3 -3
  5. package/dist/{abletime-rest-PYQM234B.js → abletime-rest-DNFAYYLP.js} +3 -3
  6. package/dist/{abletime-rest-7NICZYOC.js → abletime-rest-DQ3PNKXP.js} +3 -3
  7. package/dist/{agents-KABJUDPI.js → agents-CJZYJOWP.js} +7 -7
  8. package/dist/{agents-2AR7I6B6.js → agents-F2E2HACB.js} +7 -7
  9. package/dist/{app-settings-CZVFMOI5.js → app-settings-KMPVI2B7.js} +1 -1
  10. package/dist/{app-settings-V6YPYY57.js → app-settings-P3H4SEIK.js} +1 -1
  11. package/dist/{chunk-YEIHCSZS.js → chunk-4GZC6DDH.js} +2 -0
  12. package/dist/{chunk-5OM7UCTQ.js → chunk-56M6VEXI.js} +3 -3
  13. package/dist/{chunk-ZM43NTJJ.js → chunk-5OQONGHO.js} +5 -5
  14. package/dist/{chunk-A6C67DY5.js → chunk-5S3YP5KH.js} +4 -4
  15. package/dist/{chunk-QPLQXWND.js → chunk-72PUPPV2.js} +3 -3
  16. package/dist/{chunk-OO3R6CS2.js → chunk-B7UL36WH.js} +214 -37
  17. package/dist/{chunk-WLZHRNE6.js → chunk-BTIXTH4N.js} +3 -3
  18. package/dist/{chunk-AESO2KJS.js → chunk-CB5Z5C3J.js} +2 -2
  19. package/dist/{chunk-AUJ4XB6H.js → chunk-DFUXW2IT.js} +2 -2
  20. package/dist/{chunk-ST2UQBJT.js → chunk-DJZRDTZY.js} +6 -6
  21. package/dist/{chunk-TUJFCJJU.js → chunk-EDXTP2VR.js} +2 -2
  22. package/dist/{chunk-I5TESHDN.js → chunk-EQ52JR3Q.js} +5 -5
  23. package/dist/{chunk-FDXHNROD.js → chunk-EQ5JY3MJ.js} +2 -2
  24. package/dist/{chunk-E52SQENB.js → chunk-FZKAAAEB.js} +3 -1
  25. package/dist/{chunk-JD7CC6SW.js → chunk-HHPTGIKS.js} +2 -2
  26. package/dist/{chunk-U2N32EA6.js → chunk-IDPFLXRY.js} +215 -38
  27. package/dist/{chunk-GCHSJCCX.js → chunk-IFU4W4C4.js} +3 -1
  28. package/dist/{chunk-IAPO7ZFG.js → chunk-LLIEU2ZB.js} +5 -5
  29. package/dist/{chunk-MBYGWNLQ.js → chunk-OAFBHCSM.js} +1 -1
  30. package/dist/{chunk-NRSC4N5X.js → chunk-P74GXA5V.js} +6 -6
  31. package/dist/{chunk-A46CIARU.js → chunk-PNLGWAYE.js} +2 -2
  32. package/dist/{chunk-53OCOGND.js → chunk-QGY3UNNL.js} +2 -2
  33. package/dist/{chunk-7Q327QF2.js → chunk-QIC2JXHW.js} +5 -5
  34. package/dist/{chunk-YALFZKSC.js → chunk-RHJPP26T.js} +11 -11
  35. package/dist/{chunk-AZ4GEEGL.js → chunk-UK2KESBN.js} +2 -2
  36. package/dist/{chunk-LXBZQP2Q.js → chunk-V76MQ7MH.js} +5 -5
  37. package/dist/{chunk-HOLB6ZFZ.js → chunk-XMHMVEIY.js} +2 -0
  38. package/dist/{chunk-GH7UMULC.js → chunk-ZYZBCLJR.js} +6 -6
  39. package/dist/{conductor-MG2RAQNT.js → conductor-FPFY6Z5S.js} +6 -6
  40. package/dist/{conductor-NIUBJLTS.js → conductor-JA5W3L7C.js} +6 -6
  41. package/dist/{coordinator-prompt-3CT3D5UM.js → coordinator-prompt-M75TAN43.js} +4 -4
  42. package/dist/{coordinator-prompt-X74F3JIC.js → coordinator-prompt-NUC2ZXMJ.js} +4 -4
  43. package/dist/{global-workspace-BUWMRNW5.js → global-workspace-5A4H34AF.js} +4 -4
  44. package/dist/{global-workspace-FTNJEML3.js → global-workspace-SCLQUNUI.js} +4 -4
  45. package/dist/index.cjs +589 -402
  46. package/dist/index.d.cts +29 -4
  47. package/dist/index.d.ts +29 -4
  48. package/dist/index.js +28 -28
  49. package/dist/mcp/run-stdio.cjs +219 -32
  50. package/dist/mcp/run-stdio.js +23 -23
  51. package/dist/{optional-cli-EMSZBYDE.js → optional-cli-2V3SLME5.js} +3 -3
  52. package/dist/{optional-cli-6GGESWGE.js → optional-cli-MRNQKVIR.js} +4 -4
  53. package/dist/{orchestrator-H3DSZ5RM.js → orchestrator-7BDZ5GWD.js} +10 -10
  54. package/dist/{orchestrator-NCA4LSCC.js → orchestrator-NPFWU3XU.js} +10 -10
  55. package/dist/{thread-store-PLNIWFZ4.js → thread-store-JWHVXLDX.js} +1 -1
  56. package/dist/{thread-store-7BBA63KV.js → thread-store-QHYN2ZMQ.js} +1 -1
  57. package/dist/{workspaces-2V5UYPYC.js → workspaces-5QA3YM4L.js} +4 -4
  58. package/dist/{workspaces-MGKEAYNM.js → workspaces-KWMBOTQD.js} +4 -4
  59. package/dist/{worktree-THAXW5U7.js → worktree-7EATHVYQ.js} +3 -3
  60. package/dist/{worktree-XJKLDYOL.js → worktree-O6BANO2I.js} +3 -3
  61. package/package.json +1 -1
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  formatOptionalServicesDirectiveForTurn,
8
8
  formatOptionalServicesReminderForTurn
9
- } from "./chunk-MBYGWNLQ.js";
9
+ } from "./chunk-OAFBHCSM.js";
10
10
  import {
11
11
  extractPresentedPlan,
12
12
  isPresentPlanToolName,
@@ -27,7 +27,7 @@ import {
27
27
  parseSessionQuotaResetAt,
28
28
  planModeTurnInstruction,
29
29
  resolveQuotaFallbackAgent
30
- } from "./chunk-GH7UMULC.js";
30
+ } from "./chunk-ZYZBCLJR.js";
31
31
  import {
32
32
  applyWorktreePkgCacheEnv,
33
33
  askBlockStillWaiting,
@@ -65,7 +65,7 @@ import {
65
65
  worktreeDevProcessKey,
66
66
  worktreeRunProcessKey,
67
67
  worktreeSetupProcessKey
68
- } from "./chunk-NRSC4N5X.js";
68
+ } from "./chunk-P74GXA5V.js";
69
69
  import {
70
70
  applyAgentEvent,
71
71
  clipAgentEventForPaint,
@@ -92,7 +92,7 @@ import {
92
92
  summarizeTurnStderr,
93
93
  toolDescription,
94
94
  turnFailChatText
95
- } from "./chunk-I5TESHDN.js";
95
+ } from "./chunk-EQ52JR3Q.js";
96
96
  import {
97
97
  SLACK_REPLY_FORMATTING,
98
98
  addWorkspace,
@@ -117,7 +117,7 @@ import {
117
117
  stageAbsolutePathsAsAttachments,
118
118
  stageBuffersAsAttachments,
119
119
  syncWorkspacesFromThreads
120
- } from "./chunk-A6C67DY5.js";
120
+ } from "./chunk-5S3YP5KH.js";
121
121
  import {
122
122
  addPrStackLayer,
123
123
  allocateTeamSlug,
@@ -159,7 +159,7 @@ import {
159
159
  resolveRepoRoot,
160
160
  switchWorktreeBranch,
161
161
  withRepoGitLock
162
- } from "./chunk-A46CIARU.js";
162
+ } from "./chunk-PNLGWAYE.js";
163
163
  import {
164
164
  clearStaleIndexLocks,
165
165
  enrichPathWithNpmGlobalBin,
@@ -201,7 +201,7 @@ import {
201
201
  usageOnLimit,
202
202
  withTurnScopedCost,
203
203
  writeViewerContext
204
- } from "./chunk-GCHSJCCX.js";
204
+ } from "./chunk-IFU4W4C4.js";
205
205
  import {
206
206
  writePrivateFile
207
207
  } from "./chunk-NSTQ6QKD.js";
@@ -242,7 +242,10 @@ import {
242
242
  worktreeNameFromPath,
243
243
  worktreeSlugForTicket,
244
244
  writeThread
245
- } from "./chunk-HOLB6ZFZ.js";
245
+ } from "./chunk-XMHMVEIY.js";
246
+ import {
247
+ normalizeThinkingEffort
248
+ } from "./chunk-KGZBYWZ3.js";
246
249
  import {
247
250
  annotateDevAccessRuns,
248
251
  appDataDir,
@@ -507,9 +510,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
507
510
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
508
511
  );
509
512
  }
510
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-BUWMRNW5.js");
513
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-5A4H34AF.js");
511
514
  if (isGlobalThread2(thread)) {
512
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-3CT3D5UM.js");
515
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-M75TAN43.js");
513
516
  ensureGlobalCoordinatorCwd2(
514
517
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
515
518
  );
@@ -1955,6 +1958,71 @@ function claimSteerRequest(threadId) {
1955
1958
  });
1956
1959
  }
1957
1960
 
1961
+ // src/orchestrator/ephemeral-automation.ts
1962
+ function ephemeralRunReadyToArchive(thread) {
1963
+ if (!thread.ephemeralAutomationId?.trim()) return false;
1964
+ if (thread.status !== "idle" && thread.status !== "error") return false;
1965
+ if (thread.queue.length > 0) return false;
1966
+ if (thread.agentBlock?.reason?.trim()) return false;
1967
+ if (thread.quotaResumeAt) return false;
1968
+ return true;
1969
+ }
1970
+ function markEphemeralAutomation(threadId, opts) {
1971
+ const id = opts.ephemeralAutomationId?.trim();
1972
+ const current = readThread(threadId);
1973
+ if (!current) throw new Error(`Thread not found: ${threadId}`);
1974
+ if (!id) return current;
1975
+ const title = opts.ephemeralTitle?.trim();
1976
+ return updateThread(threadId, {
1977
+ ephemeralAutomationId: id,
1978
+ ...title ? { title, userSetTitle: true } : {}
1979
+ });
1980
+ }
1981
+ async function archiveEphemeralAutomationIfReady(threadId, archive) {
1982
+ const keep = await withThreadLock(threadId, async () => {
1983
+ const thread = readThread(threadId);
1984
+ if (!thread || !ephemeralRunReadyToArchive(thread)) return null;
1985
+ const automationId = thread.ephemeralAutomationId?.trim();
1986
+ if (!automationId) return null;
1987
+ await archive(thread.id);
1988
+ return {
1989
+ automationId,
1990
+ keepId: archivedContinuationId(automationId, threadId) ?? threadId
1991
+ };
1992
+ });
1993
+ if (keep) forgetOlderEphemeralRuns(keep.automationId, keep.keepId);
1994
+ }
1995
+ function archivedContinuationId(automationId, sourceId) {
1996
+ for (const thread of listThreads({ includeArchived: true })) {
1997
+ if (thread.id === sourceId || thread.status !== "archived") continue;
1998
+ if (thread.ephemeralAutomationId !== automationId) continue;
1999
+ if (thread.quotaContinuedFromId !== sourceId) continue;
2000
+ return thread.id;
2001
+ }
2002
+ return null;
2003
+ }
2004
+ function clearEphemeralAutomation(threadId) {
2005
+ const thread = readThread(threadId);
2006
+ if (!thread?.ephemeralAutomationId?.trim()) return;
2007
+ updateThread(threadId, { ephemeralAutomationId: void 0 });
2008
+ }
2009
+ function forgetOlderEphemeralRuns(automationId, keepId) {
2010
+ const id = automationId.trim();
2011
+ if (!id || !keepId) return [];
2012
+ const removed = [];
2013
+ for (const thread of listThreads({ includeArchived: true })) {
2014
+ if (thread.id === keepId) continue;
2015
+ if (thread.status !== "archived") continue;
2016
+ if (thread.ephemeralAutomationId !== id) continue;
2017
+ try {
2018
+ deleteThreadRecord(thread.id);
2019
+ removed.push(thread.id);
2020
+ } catch {
2021
+ }
2022
+ }
2023
+ return removed;
2024
+ }
2025
+
1958
2026
  // src/threads/agent-purpose-title.ts
1959
2027
  function agentPurposeStamp(input) {
1960
2028
  if (input.autoContinue) return null;
@@ -2632,7 +2700,7 @@ async function createThread(input, _onSetupLine) {
2632
2700
  });
2633
2701
  await requireAgent(resolved.agent);
2634
2702
  if (input.cowboy) {
2635
- const { cowboyModeEnabled } = await import("./app-settings-CZVFMOI5.js");
2703
+ const { cowboyModeEnabled } = await import("./app-settings-KMPVI2B7.js");
2636
2704
  if (!cowboyModeEnabled()) {
2637
2705
  throw new Error(
2638
2706
  "Cowboy mode is off. Enable it in Settings \u2192 Advanced."
@@ -2691,7 +2759,7 @@ async function createThread(input, _onSetupLine) {
2691
2759
  let sourceIsFork = false;
2692
2760
  if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
2693
2761
  if (isAbleTimeConnected() && getIssueSource() === "abletime") {
2694
- const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-L3ODNTBT.js");
2762
+ const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-CRRLEYTE.js");
2695
2763
  const task = await ensureAbleTimeTask({
2696
2764
  title: title?.trim() || "Untitled work",
2697
2765
  description: input.prompt?.trim() || void 0
@@ -3450,17 +3518,23 @@ async function isolateQuotaFailover(run) {
3450
3518
  }
3451
3519
  }
3452
3520
  function createQuotaFailoverChat(from, fallbackAgent, limitText, opts) {
3521
+ const ephemeralAutomationId = from.ephemeralAutomationId?.trim();
3522
+ const ephemeralTitle = ephemeralAutomationId ? from.title.trim() : "";
3453
3523
  const handoff = buildQuotaHandoffAttachment(from, limitText, fallbackAgent);
3454
3524
  const tab = createChatTab({
3455
3525
  fromThreadId: from.id,
3456
3526
  agent: fallbackAgent,
3457
3527
  model: null,
3458
3528
  attachments: [handoff],
3529
+ ...ephemeralTitle ? { title: ephemeralTitle } : {},
3459
3530
  ...opts && "accountId" in opts ? { accountId: opts.accountId } : {}
3460
3531
  });
3461
3532
  const patch = {
3462
3533
  quotaContinuedFromId: from.id,
3463
- sourceRef: from.sourceRef
3534
+ sourceRef: from.sourceRef,
3535
+ // The original drain archives as idle. This sibling has to carry the one-off
3536
+ // so it archives when the continued turn finishes and History keeps it.
3537
+ ...ephemeralAutomationId ? { ephemeralAutomationId } : {}
3464
3538
  };
3465
3539
  if (isOrchestratorThread(from)) {
3466
3540
  patch.parentThreadId = from.id;
@@ -3567,7 +3641,7 @@ async function adoptThread(input) {
3567
3641
  messages: input.messages ?? []
3568
3642
  });
3569
3643
  writeThread(thread);
3570
- const { addWorkspace: addWorkspace2 } = await import("./workspaces-2V5UYPYC.js");
3644
+ const { addWorkspace: addWorkspace2 } = await import("./workspaces-5QA3YM4L.js");
3571
3645
  await addWorkspace2(repoPath);
3572
3646
  const { ensureWorktreeSideboardIgnored } = await import("./worktree-exclude-5N2KTYIT.js");
3573
3647
  await ensureWorktreeSideboardIgnored(input.worktreePath);
@@ -5749,7 +5823,7 @@ function formatWorktreeDirective(thread, opts) {
5749
5823
  lines.push(formatDevAccessHint(opts?.activeRuns));
5750
5824
  lines.push("");
5751
5825
  lines.push(
5752
- "Schedules: `create_schedule` / `list_schedules` (`at` / `every` / `cron`). `chatId=self` continues this chat; omit chatId for a new Global chat. Fires only while Sideboard.app is running. A future job turns on Settings \u2192 Advanced \u2192 Caffeinate while schedules are enabled."
5826
+ "Automations (sidebar, after Board): `create_schedule` / `list_schedules` (`at` / `every` / `cron`). `chatId=self` continues this chat; omit chatId for a new Global chat. Fires only while Sideboard.app is running. A future job turns on Settings \u2192 Advanced \u2192 Caffeinate while automations are enabled."
5753
5827
  );
5754
5828
  lines.push(
5755
5829
  "`set_workspace_tags` labels this checkout (omit ref; replace, add, or remove). Not another checkout."
@@ -5769,7 +5843,7 @@ function connectedOrchestratorTurnReminder(thread, find) {
5769
5843
  return formatConnectedOrchestratorReminder(connectedOrchestrator(thread, find));
5770
5844
  }
5771
5845
  function formatWorktreeReminder() {
5772
- return "Sideboard workspace: stay in this cwd for all file and git work. Push and open PRs against origin, never upstream. Do not edit the main repo checkout. If a goal is given (Greptile 5/5, CI green), watch-fix-push until it lands \u2014 do not watch after every push. Schedules: create_schedule (at / every / cron; chatId=self for this chat). set_workspace_tags updates labels on this workspace (omit ref).";
5846
+ return "Sideboard workspace: stay in this cwd for all file and git work. Push and open PRs against origin, never upstream. Do not edit the main repo checkout. If a goal is given (Greptile 5/5, CI green), watch-fix-push until it lands \u2014 do not watch after every push. Automations: create_schedule (at / every / cron; chatId=self for this chat). set_workspace_tags updates labels on this workspace (omit ref).";
5773
5847
  }
5774
5848
  function formatClaudeSubagentReminder() {
5775
5849
  return 'Claude subagents: if Task/Agent workers will edit files, write a short plan in this chat and continue in the same turn. Do not ask the user whether to isolate, and do not set worktree.bgIsolation to none. One writer may edit this workspace. Every other writer is an Agent with isolation "worktree" and a disjoint file list (read-only explore agents may overlap). While those agents run, leave their files alone. Merge each returned branch into this workspace, then remove the temporary worktree. You stay in this cwd. If Claude says another write-capable agent is in this directory, or that writes to the shared checkout are blocked, re-spawn that agent with isolation "worktree" or make the edit yourself. That note is another worker in this chat, or a worker Claude still has marked running. Do not mention it to the user.';
@@ -6387,7 +6461,7 @@ function parseDurationMs(every) {
6387
6461
  }
6388
6462
  function defaultScheduleName(prompt) {
6389
6463
  const line = prompt.trim().split(/\r?\n/, 1)[0]?.trim() ?? "";
6390
- if (!line) return "Untitled schedule";
6464
+ if (!line) return "Untitled automation";
6391
6465
  return line.length > 60 ? `${line.slice(0, 57).trimEnd()}\u2026` : line;
6392
6466
  }
6393
6467
  function resolveScheduleThreadId(raw, env = process.env) {
@@ -6452,6 +6526,45 @@ function normalizeWhen(raw) {
6452
6526
  }
6453
6527
  throw new Error("Schedule `when` must be once, every, or cron");
6454
6528
  }
6529
+ var ATTACHMENT_KINDS = /* @__PURE__ */ new Set([
6530
+ "transcript",
6531
+ "file",
6532
+ "issue",
6533
+ "workspace",
6534
+ "diff-comment",
6535
+ "code-ref"
6536
+ ]);
6537
+ function normalizeOptionalBool(raw) {
6538
+ if (raw === true || raw === false) return raw;
6539
+ return null;
6540
+ }
6541
+ function normalizeAutonomy(raw) {
6542
+ return raw === "default" || raw === "full" ? raw : null;
6543
+ }
6544
+ function normalizeAttachments(raw) {
6545
+ if (!Array.isArray(raw)) return [];
6546
+ const out = [];
6547
+ for (const item of raw) {
6548
+ if (!item || typeof item !== "object") continue;
6549
+ const row = item;
6550
+ if (typeof row.id !== "string" || !row.id.trim()) continue;
6551
+ if (typeof row.name !== "string" || !row.name) continue;
6552
+ if (typeof row.content !== "string") continue;
6553
+ if (!ATTACHMENT_KINDS.has(row.kind)) continue;
6554
+ const next = {
6555
+ id: row.id,
6556
+ name: row.name,
6557
+ kind: row.kind,
6558
+ content: row.content
6559
+ };
6560
+ if (typeof row.path === "string" && row.path) next.path = row.path;
6561
+ if (typeof row.previewDataUrl === "string" && row.previewDataUrl) {
6562
+ next.previewDataUrl = row.previewDataUrl;
6563
+ }
6564
+ out.push(next);
6565
+ }
6566
+ return out;
6567
+ }
6455
6568
  function normalizeTask(raw) {
6456
6569
  const when = normalizeWhen(raw.when);
6457
6570
  const agent = raw.agent && isOrchestratorCapableAgent(raw.agent) ? raw.agent : null;
@@ -6464,6 +6577,11 @@ function normalizeTask(raw) {
6464
6577
  threadId: raw.threadId?.trim() || null,
6465
6578
  agent,
6466
6579
  model: raw.model?.trim() || null,
6580
+ effort: normalizeThinkingEffort(raw.effort),
6581
+ fast: normalizeOptionalBool(raw.fast),
6582
+ planMode: normalizeOptionalBool(raw.planMode),
6583
+ autonomy: normalizeAutonomy(raw.autonomy),
6584
+ attachments: normalizeAttachments(raw.attachments),
6467
6585
  nextRunAt: raw.nextRunAt,
6468
6586
  lastRunAt: raw.lastRunAt ?? null,
6469
6587
  lastThreadId: raw.lastThreadId ?? null,
@@ -6510,6 +6628,11 @@ function buildTask(input, now) {
6510
6628
  threadId: input.threadId?.trim() || null,
6511
6629
  agent,
6512
6630
  model: input.model?.trim() || null,
6631
+ effort: input.effort != null ? normalizeThinkingEffort(input.effort) : null,
6632
+ fast: normalizeOptionalBool(input.fast),
6633
+ planMode: normalizeOptionalBool(input.planMode),
6634
+ autonomy: normalizeAutonomy(input.autonomy),
6635
+ attachments: normalizeAttachments(input.attachments),
6513
6636
  nextRunAt,
6514
6637
  lastRunAt: null,
6515
6638
  lastThreadId: null,
@@ -6551,7 +6674,7 @@ function createSchedule(input) {
6551
6674
  function updateSchedule(id, patch) {
6552
6675
  const rows = readAll();
6553
6676
  const idx = rows.findIndex((row) => row.id === id || id.length >= 8 && row.id.startsWith(id));
6554
- if (idx < 0) throw new Error(`Schedule not found: ${id}`);
6677
+ if (idx < 0) throw new Error(`Automation not found: ${id}`);
6555
6678
  const prev = rows[idx];
6556
6679
  const when = patch.when ? normalizeWhen(patch.when) : prev.when;
6557
6680
  const prompt = patch.prompt !== void 0 ? patch.prompt.trim() : prev.prompt;
@@ -6566,6 +6689,11 @@ function updateSchedule(id, patch) {
6566
6689
  threadId: patch.threadId !== void 0 ? patch.threadId?.trim() || null : prev.threadId,
6567
6690
  agent: patch.agent !== void 0 ? patch.agent ? coerceOrchestratorAgent(patch.agent) : null : prev.agent,
6568
6691
  model: patch.model !== void 0 ? patch.model?.trim() || null : prev.model,
6692
+ effort: patch.effort !== void 0 ? normalizeThinkingEffort(patch.effort) : prev.effort,
6693
+ fast: patch.fast !== void 0 ? normalizeOptionalBool(patch.fast) : prev.fast,
6694
+ planMode: patch.planMode !== void 0 ? normalizeOptionalBool(patch.planMode) : prev.planMode,
6695
+ autonomy: patch.autonomy !== void 0 ? normalizeAutonomy(patch.autonomy) : prev.autonomy,
6696
+ attachments: patch.attachments !== void 0 ? normalizeAttachments(patch.attachments) : prev.attachments,
6569
6697
  nextRunAt: whenChanged ? computeNextRunAt(when).toISOString() : prev.nextRunAt,
6570
6698
  lastError: whenChanged ? null : prev.lastError,
6571
6699
  updatedAt: nowIso()
@@ -6580,13 +6708,13 @@ function deleteSchedule(id) {
6580
6708
  const next = rows.filter(
6581
6709
  (row) => row.id !== id && !(id.length >= 8 && row.id.startsWith(id))
6582
6710
  );
6583
- if (next.length === rows.length) throw new Error(`Schedule not found: ${id}`);
6711
+ if (next.length === rows.length) throw new Error(`Automation not found: ${id}`);
6584
6712
  writeAll(next);
6585
6713
  }
6586
6714
  function recordScheduleRun(id, result) {
6587
6715
  const rows = readAll();
6588
6716
  const idx = rows.findIndex((row) => row.id === id);
6589
- if (idx < 0) throw new Error(`Schedule not found: ${id}`);
6717
+ if (idx < 0) throw new Error(`Automation not found: ${id}`);
6590
6718
  const prev = rows[idx];
6591
6719
  const firedAt = result.firedAt ?? /* @__PURE__ */ new Date();
6592
6720
  const next = {
@@ -6613,21 +6741,56 @@ function formatScheduledPrompt(name, prompt) {
6613
6741
  ${prompt}`;
6614
6742
  }
6615
6743
  async function defaultDeps() {
6616
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-H3DSZ5RM.js");
6744
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-7BDZ5GWD.js");
6617
6745
  const orch = getOrchestrator2();
6618
6746
  return {
6619
6747
  findThread: (id) => findThreadByRef(id),
6620
- send: (id, prompt) => orch.send(id, prompt),
6748
+ send: async (id, prompt, opts) => {
6749
+ if (opts?.options && Object.keys(opts.options).length > 0) {
6750
+ try {
6751
+ orch.setThreadOptions(id, opts.options);
6752
+ } catch {
6753
+ const rest = scheduleOptionsAfterRefusedAgentSwitch(opts.options);
6754
+ if (Object.keys(rest).length > 0) {
6755
+ try {
6756
+ orch.setThreadOptions(id, rest);
6757
+ } catch {
6758
+ }
6759
+ }
6760
+ }
6761
+ }
6762
+ const thread = findThreadByRef(id);
6763
+ const attachments = thread ? persistPendingFileAttachments(thread.worktreePath, opts?.attachments ?? []) : opts?.attachments ?? [];
6764
+ return orch.send(id, prompt, { attachments });
6765
+ },
6621
6766
  startOrchestration: (opts) => startOrchestration2(opts)
6622
6767
  };
6623
6768
  }
6769
+ function scheduleOptionsAfterRefusedAgentSwitch(options) {
6770
+ const { agent: _agent, model: _model, ...rest } = options;
6771
+ return rest;
6772
+ }
6773
+ function scheduleSendOptions(schedule) {
6774
+ const patch = {};
6775
+ if (schedule.agent) {
6776
+ patch.agent = schedule.agent;
6777
+ patch.model = schedule.model;
6778
+ } else if (schedule.model) {
6779
+ patch.model = schedule.model;
6780
+ }
6781
+ if (schedule.effort) patch.effort = schedule.effort;
6782
+ if (schedule.fast != null) patch.fast = schedule.fast;
6783
+ if (schedule.planMode != null) patch.planMode = schedule.planMode;
6784
+ if (schedule.autonomy) patch.autonomy = schedule.autonomy;
6785
+ return Object.keys(patch).length > 0 ? patch : void 0;
6786
+ }
6624
6787
  function pickAgent(schedule) {
6625
6788
  if (schedule.agent) return schedule.agent;
6626
6789
  return coerceOrchestratorAgent(resolveOrchestratorDefaults().agent);
6627
6790
  }
6628
6791
  async function fireSchedule(id) {
6629
6792
  const schedule = getSchedule(id);
6630
- if (!schedule) throw new Error(`Schedule not found: ${id}`);
6793
+ if (!schedule) throw new Error(`Automation not found: ${id}`);
6631
6794
  if (firing.has(schedule.id)) return schedule;
6632
6795
  firing.add(schedule.id);
6633
6796
  try {
@@ -6635,18 +6798,28 @@ async function fireSchedule(id) {
6635
6798
  const prompt = formatScheduledPrompt(schedule.name, schedule.prompt);
6636
6799
  const target = schedule.threadId ? deps.findThread(schedule.threadId) : null;
6637
6800
  if (target && target.status !== "archived") {
6638
- const sent = await deps.send(target.id, prompt);
6801
+ const sent = await deps.send(target.id, prompt, {
6802
+ attachments: schedule.attachments,
6803
+ options: scheduleSendOptions(schedule)
6804
+ });
6639
6805
  return recordScheduleRun(schedule.id, {
6640
6806
  lastThreadId: sent.id,
6641
6807
  lastError: null
6642
6808
  });
6643
6809
  }
6810
+ const pinReplacement = Boolean(schedule.threadId) && schedule.when.kind !== "once";
6644
6811
  const created = await deps.startOrchestration({
6645
6812
  goal: prompt,
6646
6813
  agent: pickAgent(schedule),
6647
- model: schedule.model
6814
+ model: schedule.model,
6815
+ ...schedule.effort ? { effort: schedule.effort } : {},
6816
+ ...schedule.fast != null ? { fast: schedule.fast } : {},
6817
+ ...schedule.planMode != null ? { planMode: schedule.planMode } : {},
6818
+ ...schedule.autonomy ? { autonomy: schedule.autonomy } : {},
6819
+ attachments: schedule.attachments,
6820
+ ...pinReplacement ? {} : { ephemeralAutomationId: schedule.id, ephemeralTitle: schedule.name }
6648
6821
  });
6649
- if (schedule.threadId && schedule.when.kind !== "once") {
6822
+ if (pinReplacement) {
6650
6823
  updateSchedule(schedule.id, { threadId: created.id });
6651
6824
  }
6652
6825
  return recordScheduleRun(schedule.id, {
@@ -6934,7 +7107,7 @@ var Orchestrator = class {
6934
7107
  orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
6935
7108
  });
6936
7109
  }
6937
- const { autoCleanupOrphansEnabled } = await import("./app-settings-CZVFMOI5.js");
7110
+ const { autoCleanupOrphansEnabled } = await import("./app-settings-KMPVI2B7.js");
6938
7111
  if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
6939
7112
  await cleanupOrphanWorktrees({ repoPaths });
6940
7113
  }
@@ -7328,7 +7501,7 @@ var Orchestrator = class {
7328
7501
  }
7329
7502
  await setup;
7330
7503
  if (skipSetup) return;
7331
- const { autoRunAfterSetupEnabled } = await import("./app-settings-CZVFMOI5.js");
7504
+ const { autoRunAfterSetupEnabled } = await import("./app-settings-KMPVI2B7.js");
7332
7505
  if (autoRunAfterSetupEnabled()) {
7333
7506
  try {
7334
7507
  await this.startDev(threadId);
@@ -7537,6 +7710,7 @@ var Orchestrator = class {
7537
7710
  } finally {
7538
7711
  this.draining.delete(threadId);
7539
7712
  }
7713
+ await archiveEphemeralAutomationIfReady(threadId, (id) => this.archive(id));
7540
7714
  }
7541
7715
  async runTurn(threadId, prompt) {
7542
7716
  const existing = readThread(threadId);
@@ -7704,7 +7878,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
7704
7878
  }
7705
7879
  const isBrightsy = fresh.agent === "brightsy";
7706
7880
  const isOrchestration = isOrchestratorThread(fresh);
7707
- const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-CZVFMOI5.js");
7881
+ const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-KMPVI2B7.js");
7708
7882
  const gitAuthMode = getGithubGitAuthMode();
7709
7883
  const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
7710
7884
  githubSlug: await withTimeout(
@@ -9032,7 +9206,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
9032
9206
  if (Object.keys(patch).length === 0) continue;
9033
9207
  updateThread(t.id, patch);
9034
9208
  }
9035
- const { autoArchiveOnMergeEnabled } = await import("./app-settings-CZVFMOI5.js");
9209
+ const { autoArchiveOnMergeEnabled } = await import("./app-settings-KMPVI2B7.js");
9036
9210
  const latest = this.requireThread(thread.id);
9037
9211
  if (!shouldAutoArchiveOnPrMerge({
9038
9212
  previousPrState: prevState || null,
@@ -9356,7 +9530,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
9356
9530
  await runArchiveScript(thread.repoPath, thread.worktreePath);
9357
9531
  } catch {
9358
9532
  }
9359
- const { deleteBranchOnPurgeEnabled } = await import("./app-settings-CZVFMOI5.js");
9533
+ const { deleteBranchOnPurgeEnabled } = await import("./app-settings-KMPVI2B7.js");
9360
9534
  const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
9361
9535
  await removeWorktree(thread.repoPath, thread.worktreePath, {
9362
9536
  deleteBranch: deleteBranch ? thread.branchName : void 0
@@ -9370,6 +9544,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
9370
9544
  if (thread.status !== "archived") {
9371
9545
  throw new Error("Thread is not archived");
9372
9546
  }
9547
+ clearEphemeralAutomation(thread.id);
9373
9548
  if (isGlobalThread(thread)) {
9374
9549
  const { globalAgentCwd } = await import("./paths-HAAJNTTE.js");
9375
9550
  updateThread(thread.id, { worktreePath: globalAgentCwd() });
@@ -9469,10 +9644,11 @@ async function startOrchestration(opts) {
9469
9644
  planMode: opts.planMode,
9470
9645
  attachments: opts.attachments
9471
9646
  });
9647
+ const ready2 = markEphemeralAutomation(thread2.id, opts);
9472
9648
  if (goal) {
9473
- return orch.send(thread2.id, goal);
9649
+ return orch.send(ready2.id, goal);
9474
9650
  }
9475
- return thread2;
9651
+ return ready2;
9476
9652
  }
9477
9653
  const { titleFromPrompt: titleFromPrompt2 } = await import("./title-ERD6D3C3.js");
9478
9654
  const title = titleFromPrompt2(goal) || "Orchestration";
@@ -9492,7 +9668,7 @@ async function startOrchestration(opts) {
9492
9668
  sourceRef: "default",
9493
9669
  ...createOpts
9494
9670
  }).catch(async () => {
9495
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-XJKLDYOL.js");
9671
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-O6BANO2I.js");
9496
9672
  const repo = await resolveRepoRoot2(repoPath);
9497
9673
  const def = await resolveDefaultBranch2(repo);
9498
9674
  return orch.createThread({
@@ -9502,15 +9678,16 @@ async function startOrchestration(opts) {
9502
9678
  repoPath: repo
9503
9679
  });
9504
9680
  });
9505
- const { updateThread: upd } = await import("./thread-store-PLNIWFZ4.js");
9681
+ const { updateThread: upd } = await import("./thread-store-JWHVXLDX.js");
9506
9682
  const updated = upd(thread.id, {
9507
9683
  sourceType: "orchestration",
9508
9684
  sourceRef: goal
9509
9685
  });
9686
+ const ready = markEphemeralAutomation(updated.id, opts);
9510
9687
  if (goal) {
9511
- return orch.send(updated.id, goal);
9688
+ return orch.send(ready.id, goal);
9512
9689
  }
9513
- return updated;
9690
+ return ready;
9514
9691
  }
9515
9692
 
9516
9693
  export {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  abletimeRestUrl,
3
3
  textFromAbleTimeDoc
4
- } from "./chunk-AUJ4XB6H.js";
4
+ } from "./chunk-DFUXW2IT.js";
5
5
  import {
6
6
  assertAbleTimeCredential,
7
7
  callAbleTimeTool,
8
8
  normalizeAbleTimeHost,
9
9
  rewriteAbleTimeError
10
- } from "./chunk-LXBZQP2Q.js";
10
+ } from "./chunk-V76MQ7MH.js";
11
11
  import {
12
12
  httpFetch
13
13
  } from "./chunk-JAT3JFOS.js";
@@ -20,7 +20,7 @@ import {
20
20
  getAbleTimeHost,
21
21
  isAbleTimeConnected,
22
22
  saveAbleTimeConnection
23
- } from "./chunk-E52SQENB.js";
23
+ } from "./chunk-FZKAAAEB.js";
24
24
 
25
25
  // src/integrations/issue-attachments.ts
26
26
  import { existsSync, mkdirSync, writeFileSync } from "fs";
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-QVN2WOKJ.js";
8
8
  import {
9
9
  resolveAgentExecutable
10
- } from "./chunk-E52SQENB.js";
10
+ } from "./chunk-FZKAAAEB.js";
11
11
 
12
12
  // src/agents/install.ts
13
13
  import { existsSync } from "fs";
@@ -265,7 +265,7 @@ async function loginAgent(agent) {
265
265
  };
266
266
  }
267
267
  async function loginManagedAccount(accountId) {
268
- const { loadAppSettings } = await import("./app-settings-V6YPYY57.js");
268
+ const { loadAppSettings } = await import("./app-settings-P3H4SEIK.js");
269
269
  const { loginEnvPrefix } = await import("./managed-accounts-JJTAKHMG.js");
270
270
  const account = loadAppSettings().accounts.accounts.find((a) => a.id === accountId);
271
271
  if (!account) {
@@ -4,14 +4,14 @@ import {
4
4
  normalizeAbleTimeCredential,
5
5
  normalizeAbleTimeHost,
6
6
  rewriteAbleTimeError
7
- } from "./chunk-LXBZQP2Q.js";
7
+ } from "./chunk-V76MQ7MH.js";
8
8
  import {
9
9
  httpFetch
10
10
  } from "./chunk-JAT3JFOS.js";
11
11
  import {
12
12
  getAbleTimeAccessToken,
13
13
  getAbleTimeHost
14
- } from "./chunk-E52SQENB.js";
14
+ } from "./chunk-FZKAAAEB.js";
15
15
 
16
16
  // src/integrations/abletime-rest.ts
17
17
  var ABLETIME_REST_PREFIX = "/api/public/v2";
@@ -2,17 +2,17 @@ import {
2
2
  compactSummaryPart,
3
3
  isInternalAgentStatusText,
4
4
  lastAssistantMessageText
5
- } from "./chunk-7Q327QF2.js";
5
+ } from "./chunk-QIC2JXHW.js";
6
6
  import {
7
7
  isCloudCoordinatorThread,
8
8
  isGlobalThread,
9
9
  isOrchestratorThread,
10
10
  isSlackCoordinatorThread
11
- } from "./chunk-YALFZKSC.js";
11
+ } from "./chunk-RHJPP26T.js";
12
12
  import {
13
13
  mergeAgentGitAuthEnv,
14
14
  resolveAgentGitAuthEnv
15
- } from "./chunk-TUJFCJJU.js";
15
+ } from "./chunk-EDXTP2VR.js";
16
16
  import {
17
17
  REVIEW_TAB_TITLE,
18
18
  allocateTeamName,
@@ -24,7 +24,7 @@ import {
24
24
  updateThread,
25
25
  worktreeNameFromPath,
26
26
  writeThread
27
- } from "./chunk-YEIHCSZS.js";
27
+ } from "./chunk-4GZC6DDH.js";
28
28
  import {
29
29
  ensureWorktreeSideboardIgnored
30
30
  } from "./chunk-2P4XKWV2.js";
@@ -44,7 +44,7 @@ import {
44
44
  import {
45
45
  assertOrchestratorCapableAgent,
46
46
  contextTokens
47
- } from "./chunk-E52SQENB.js";
47
+ } from "./chunk-FZKAAAEB.js";
48
48
  import {
49
49
  stripNestedElectronEnv
50
50
  } from "./chunk-4TR3HZFT.js";
@@ -1808,7 +1808,7 @@ var PORT_RANGE_SIZE = 10;
1808
1808
  var RECLAIM_RETRY_DELAY_MS = 40;
1809
1809
  var RECLAIM_TRIES = 8;
1810
1810
  async function killReclaimable(ports, worktreePath, signal) {
1811
- const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-MG2RAQNT.js");
1811
+ const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-FPFY6Z5S.js");
1812
1812
  if (worktreePath) killStaleWorktreeListeners2(ports, worktreePath, signal);
1813
1813
  else killListenersOnPorts2(ports);
1814
1814
  }
@@ -4,7 +4,7 @@ import {
4
4
  normalizeTakenSlug,
5
5
  normalizeWorktreePath,
6
6
  takenSlugsFromThread
7
- } from "./chunk-YEIHCSZS.js";
7
+ } from "./chunk-4GZC6DDH.js";
8
8
  import {
9
9
  ensureWorktreeSideboardIgnored
10
10
  } from "./chunk-2P4XKWV2.js";
@@ -24,7 +24,7 @@ import {
24
24
  import {
25
25
  getGithubGitAuthMode,
26
26
  getGithubPat
27
- } from "./chunk-E52SQENB.js";
27
+ } from "./chunk-FZKAAAEB.js";
28
28
  import {
29
29
  worktreesRoot
30
30
  } from "./chunk-H4UEFJRI.js";
@@ -566,13 +566,13 @@ function toolDescription(name, input) {
566
566
  else if (/notify_orchestrator$/i.test(name)) return "Notify orchestrator";
567
567
  else if (/set_workspace_tags$/i.test(name)) return "Set workspace tags";
568
568
  if (/(?:list|set|delete)_env$/i.test(name)) return /list_env$/i.test(name) ? "List env vars" : /set_env$/i.test(name) ? "Set env var" : "Delete env var";
569
- if (/list_schedules$/i.test(name)) return "List schedules";
569
+ if (/list_schedules$/i.test(name)) return "List automations";
570
570
  if (/create_schedule$/i.test(name)) {
571
- return str(input?.name) ? `Schedule ${str(input?.name)}` : "Create schedule";
571
+ return str(input?.name) ? `Automation ${str(input?.name)}` : "Create automation";
572
572
  }
573
- if (/update_schedule$/i.test(name)) return "Update schedule";
574
- if (/delete_schedule$/i.test(name)) return "Delete schedule";
575
- if (/run_schedule$/i.test(name)) return "Run schedule";
573
+ if (/update_schedule$/i.test(name)) return "Update automation";
574
+ if (/delete_schedule$/i.test(name)) return "Delete automation";
575
+ if (/run_schedule$/i.test(name)) return "Run automation";
576
576
  if (isSkillToolName(name)) {
577
577
  const cmd = skillCommandFromInput(input);
578
578
  return cmd ? `Using /${cmd}` : "Using skill";