@sideboard-ai/core 0.1.322 → 0.1.323

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 (55) hide show
  1. package/dist/{abletime-CRRLEYTE.js → abletime-5ZY3ZUUO.js} +4 -4
  2. package/dist/{abletime-ICW6Q2AB.js → abletime-CU2UPMJF.js} +4 -4
  3. package/dist/{abletime-oauth-P3KPPJE4.js → abletime-oauth-4TTCR3CT.js} +3 -3
  4. package/dist/{abletime-oauth-Q76XBSPG.js → abletime-oauth-7EOSBEFM.js} +3 -3
  5. package/dist/{abletime-rest-DQ3PNKXP.js → abletime-rest-3TG4G7LW.js} +3 -3
  6. package/dist/{abletime-rest-DNFAYYLP.js → abletime-rest-KOKE7V4B.js} +3 -3
  7. package/dist/{agents-PFVYC36J.js → agents-2ZXORBEJ.js} +5 -5
  8. package/dist/{agents-ROFDNE7Z.js → agents-SPRAOMGI.js} +5 -5
  9. package/dist/{app-settings-KMPVI2B7.js → app-settings-I5HM5RMP.js} +1 -1
  10. package/dist/{app-settings-P3H4SEIK.js → app-settings-XIF4EC4K.js} +1 -1
  11. package/dist/{chunk-45UB2J47.js → chunk-4C5PQ7JA.js} +160 -46
  12. package/dist/{chunk-XDQSHSL6.js → chunk-53SBTCKF.js} +4 -4
  13. package/dist/{chunk-BPDVHB4U.js → chunk-5GDJSFCT.js} +2 -2
  14. package/dist/{chunk-H6GXYV5Q.js → chunk-6W3XRKD5.js} +3 -3
  15. package/dist/{chunk-RHJKZOPQ.js → chunk-74OPNF7U.js} +2 -2
  16. package/dist/{chunk-BTIXTH4N.js → chunk-7PVT73H6.js} +3 -3
  17. package/dist/{chunk-JNEFEA2A.js → chunk-D3VSKNVA.js} +4 -4
  18. package/dist/{chunk-FZKAAAEB.js → chunk-EJ66LEKH.js} +1 -0
  19. package/dist/{chunk-DFUXW2IT.js → chunk-EKU7FQVG.js} +2 -2
  20. package/dist/{chunk-5OQONGHO.js → chunk-FR3SAYUL.js} +5 -5
  21. package/dist/{chunk-UWJUARFA.js → chunk-FUFNMUNR.js} +1 -1
  22. package/dist/{chunk-TEFFR6PB.js → chunk-INBUV7HY.js} +2 -2
  23. package/dist/{chunk-LD2DXHBP.js → chunk-JDX3474T.js} +182 -50
  24. package/dist/{chunk-SPMIZSKH.js → chunk-MYVKOIIY.js} +3 -3
  25. package/dist/{chunk-7JV5QP5K.js → chunk-MZIZTSR2.js} +2 -2
  26. package/dist/{chunk-HHPTGIKS.js → chunk-NXUN4U5P.js} +2 -2
  27. package/dist/{chunk-V76MQ7MH.js → chunk-ODH3XHMI.js} +5 -5
  28. package/dist/{chunk-IFU4W4C4.js → chunk-OIHRC2ZJ.js} +1 -0
  29. package/dist/{chunk-56M6VEXI.js → chunk-Q3YJZPQI.js} +3 -3
  30. package/dist/{chunk-UX6EDDGR.js → chunk-QOS4465Y.js} +1 -1
  31. package/dist/{chunk-YWBLQBSN.js → chunk-ROOZDDFA.js} +1 -1
  32. package/dist/{chunk-BANN5HUX.js → chunk-RTVS3M74.js} +4 -4
  33. package/dist/{chunk-RGUZPMTF.js → chunk-SKO7IGKU.js} +4 -4
  34. package/dist/{chunk-72PUPPV2.js → chunk-Y3WREIPQ.js} +3 -3
  35. package/dist/{conductor-XLXJU24U.js → conductor-52KTQ3IM.js} +4 -4
  36. package/dist/{conductor-CNT3VL3S.js → conductor-FB7MKLRN.js} +4 -4
  37. package/dist/{coordinator-prompt-D5EE2YTV.js → coordinator-prompt-7HXV7HJ5.js} +3 -3
  38. package/dist/{coordinator-prompt-TU24TQ4I.js → coordinator-prompt-7W7WPY4X.js} +3 -3
  39. package/dist/{global-workspace-UPMXDQM7.js → global-workspace-5BWUTSPJ.js} +3 -3
  40. package/dist/{global-workspace-743TPQNF.js → global-workspace-EI3KBGZE.js} +3 -3
  41. package/dist/index.cjs +267 -57
  42. package/dist/index.d.cts +45 -17
  43. package/dist/index.d.ts +45 -17
  44. package/dist/index.js +113 -36
  45. package/dist/mcp/run-stdio.cjs +242 -57
  46. package/dist/mcp/run-stdio.js +97 -31
  47. package/dist/{optional-cli-USD6PROE.js → optional-cli-RMMS5L6F.js} +3 -3
  48. package/dist/{optional-cli-2YDQQCCD.js → optional-cli-Y3Z3GIPZ.js} +4 -4
  49. package/dist/{orchestrator-VQ4HRYVB.js → orchestrator-2RDE2YS3.js} +8 -8
  50. package/dist/{orchestrator-B4STIW4B.js → orchestrator-RMPZETOO.js} +8 -8
  51. package/dist/{workspaces-75FD4QUR.js → workspaces-LJQS73K6.js} +3 -3
  52. package/dist/{workspaces-47WQL5IG.js → workspaces-OPQ5NMM6.js} +3 -3
  53. package/dist/{worktree-G3E6WP66.js → worktree-4NGXCCUO.js} +2 -2
  54. package/dist/{worktree-PDNPL5CQ.js → worktree-ZDA2UJ7C.js} +2 -2
  55. package/package.json +1 -1
@@ -19,12 +19,12 @@ import {
19
19
  toAbleTimeIssueInfo,
20
20
  updateAbleTimeTask,
21
21
  verifyAbleTimeConnection
22
- } from "./chunk-72PUPPV2.js";
23
- import "./chunk-HHPTGIKS.js";
24
- import "./chunk-5OQONGHO.js";
22
+ } from "./chunk-Y3WREIPQ.js";
23
+ import "./chunk-NXUN4U5P.js";
24
+ import "./chunk-FR3SAYUL.js";
25
25
  import "./chunk-2GPQZZLY.js";
26
26
  import "./chunk-N2WW62LF.js";
27
- import "./chunk-IFU4W4C4.js";
27
+ import "./chunk-OIHRC2ZJ.js";
28
28
  import "./chunk-NSTQ6QKD.js";
29
29
  import "./chunk-WWUABK6B.js";
30
30
  import "./chunk-FJZWM2ON.js";
@@ -17,12 +17,12 @@ import {
17
17
  toAbleTimeIssueInfo,
18
18
  updateAbleTimeTask,
19
19
  verifyAbleTimeConnection
20
- } from "./chunk-BTIXTH4N.js";
21
- import "./chunk-DFUXW2IT.js";
22
- import "./chunk-V76MQ7MH.js";
20
+ } from "./chunk-7PVT73H6.js";
21
+ import "./chunk-EKU7FQVG.js";
22
+ import "./chunk-ODH3XHMI.js";
23
23
  import "./chunk-JAT3JFOS.js";
24
24
  import "./chunk-6K64FJDD.js";
25
- import "./chunk-FZKAAAEB.js";
25
+ import "./chunk-EJ66LEKH.js";
26
26
  import "./chunk-77WWLBCI.js";
27
27
  import "./chunk-4TR3HZFT.js";
28
28
  import "./chunk-WDRMZKVB.js";
@@ -3,7 +3,7 @@
3
3
  import {
4
4
  DEFAULT_ABLETIME_HOST,
5
5
  normalizeAbleTimeHost
6
- } from "./chunk-5OQONGHO.js";
6
+ } from "./chunk-FR3SAYUL.js";
7
7
  import {
8
8
  httpFetch
9
9
  } from "./chunk-2GPQZZLY.js";
@@ -12,7 +12,7 @@ import {
12
12
  getAbleTimeHost,
13
13
  loadAppSettings,
14
14
  saveAbleTimeConnection
15
- } from "./chunk-IFU4W4C4.js";
15
+ } from "./chunk-OIHRC2ZJ.js";
16
16
  import "./chunk-NSTQ6QKD.js";
17
17
  import "./chunk-WWUABK6B.js";
18
18
  import "./chunk-FJZWM2ON.js";
@@ -288,7 +288,7 @@ async function startAbleTimeOAuth(opts) {
288
288
  persistAbleTimeTokens(data, { host });
289
289
  const token = data.access_token.trim();
290
290
  try {
291
- const { getAbleTimeOrientation } = await import("./abletime-CRRLEYTE.js");
291
+ const { getAbleTimeOrientation } = await import("./abletime-5ZY3ZUUO.js");
292
292
  const orientation = await getAbleTimeOrientation({ token, host });
293
293
  return saveAbleTimeConnection({
294
294
  accessToken: token,
@@ -20,10 +20,10 @@ import {
20
20
  parseAbleTimeOAuthCallbackUrl,
21
21
  resolveAbleTimeOAuthHost,
22
22
  startAbleTimeOAuth
23
- } from "./chunk-56M6VEXI.js";
24
- import "./chunk-V76MQ7MH.js";
23
+ } from "./chunk-Q3YJZPQI.js";
24
+ import "./chunk-ODH3XHMI.js";
25
25
  import "./chunk-JAT3JFOS.js";
26
- import "./chunk-FZKAAAEB.js";
26
+ import "./chunk-EJ66LEKH.js";
27
27
  import "./chunk-77WWLBCI.js";
28
28
  import "./chunk-4TR3HZFT.js";
29
29
  import "./chunk-WDRMZKVB.js";
@@ -7,10 +7,10 @@ import {
7
7
  callAbleTimeRestTool,
8
8
  looksLikeAbleTimeUlid,
9
9
  textFromAbleTimeDoc
10
- } from "./chunk-HHPTGIKS.js";
11
- import "./chunk-5OQONGHO.js";
10
+ } from "./chunk-NXUN4U5P.js";
11
+ import "./chunk-FR3SAYUL.js";
12
12
  import "./chunk-2GPQZZLY.js";
13
- import "./chunk-IFU4W4C4.js";
13
+ import "./chunk-OIHRC2ZJ.js";
14
14
  import "./chunk-NSTQ6QKD.js";
15
15
  import "./chunk-WWUABK6B.js";
16
16
  import "./chunk-FJZWM2ON.js";
@@ -5,10 +5,10 @@ import {
5
5
  callAbleTimeRestTool,
6
6
  looksLikeAbleTimeUlid,
7
7
  textFromAbleTimeDoc
8
- } from "./chunk-DFUXW2IT.js";
9
- import "./chunk-V76MQ7MH.js";
8
+ } from "./chunk-EKU7FQVG.js";
9
+ import "./chunk-ODH3XHMI.js";
10
10
  import "./chunk-JAT3JFOS.js";
11
- import "./chunk-FZKAAAEB.js";
11
+ import "./chunk-EJ66LEKH.js";
12
12
  import "./chunk-77WWLBCI.js";
13
13
  import "./chunk-4TR3HZFT.js";
14
14
  import "./chunk-WDRMZKVB.js";
@@ -46,7 +46,7 @@ import {
46
46
  resolveCursorSdkRoot,
47
47
  resolveQuotaFallbackAgent,
48
48
  turnCostUsdFromCursorUsage
49
- } from "./chunk-XDQSHSL6.js";
49
+ } from "./chunk-53SBTCKF.js";
50
50
  import {
51
51
  getAgentSetupInfo,
52
52
  installAgent,
@@ -58,13 +58,13 @@ import {
58
58
  prepareTerminalCommand,
59
59
  resolveLoginCommand,
60
60
  whichOnPath
61
- } from "./chunk-7JV5QP5K.js";
61
+ } from "./chunk-MZIZTSR2.js";
62
62
  import "./chunk-6U6QRUHY.js";
63
63
  import "./chunk-E63AM3PW.js";
64
64
  import "./chunk-2GPQZZLY.js";
65
65
  import "./chunk-EQ52JR3Q.js";
66
- import "./chunk-SPMIZSKH.js";
67
- import "./chunk-YWBLQBSN.js";
66
+ import "./chunk-MYVKOIIY.js";
67
+ import "./chunk-ROOZDDFA.js";
68
68
  import "./chunk-N2WW62LF.js";
69
69
  import "./chunk-4YXZOXMT.js";
70
70
  import {
@@ -83,7 +83,7 @@ import {
83
83
  assertOrchestratorCapableAgent,
84
84
  coerceOrchestratorAgent,
85
85
  isOrchestratorCapableAgent
86
- } from "./chunk-IFU4W4C4.js";
86
+ } from "./chunk-OIHRC2ZJ.js";
87
87
  import "./chunk-NSTQ6QKD.js";
88
88
  import "./chunk-WWUABK6B.js";
89
89
  import "./chunk-FJZWM2ON.js";
@@ -37,7 +37,7 @@ import {
37
37
  planModeTurnInstruction,
38
38
  resolveCursorModelId,
39
39
  resolveQuotaFallbackAgent
40
- } from "./chunk-JNEFEA2A.js";
40
+ } from "./chunk-D3VSKNVA.js";
41
41
  import "./chunk-S5CJUIPY.js";
42
42
  import "./chunk-QIC2JXHW.js";
43
43
  import {
@@ -51,9 +51,9 @@ import {
51
51
  prepareTerminalCommand,
52
52
  resolveLoginCommand,
53
53
  whichOnPath
54
- } from "./chunk-BPDVHB4U.js";
55
- import "./chunk-H6GXYV5Q.js";
56
- import "./chunk-UWJUARFA.js";
54
+ } from "./chunk-5GDJSFCT.js";
55
+ import "./chunk-6W3XRKD5.js";
56
+ import "./chunk-FUFNMUNR.js";
57
57
  import "./chunk-IFWGG2M2.js";
58
58
  import "./chunk-QKHEVSB5.js";
59
59
  import "./chunk-RSA47QYR.js";
@@ -88,7 +88,7 @@ import {
88
88
  assertOrchestratorCapableAgent,
89
89
  coerceOrchestratorAgent,
90
90
  isOrchestratorCapableAgent
91
- } from "./chunk-FZKAAAEB.js";
91
+ } from "./chunk-EJ66LEKH.js";
92
92
  import "./chunk-77WWLBCI.js";
93
93
  import "./chunk-4TR3HZFT.js";
94
94
  import "./chunk-WDRMZKVB.js";
@@ -109,7 +109,7 @@ import {
109
109
  updateProjectProfileSettings,
110
110
  usageOnLimit,
111
111
  writeViewerContext
112
- } from "./chunk-IFU4W4C4.js";
112
+ } from "./chunk-OIHRC2ZJ.js";
113
113
  import "./chunk-NSTQ6QKD.js";
114
114
  import "./chunk-WWUABK6B.js";
115
115
  import "./chunk-FJZWM2ON.js";
@@ -107,7 +107,7 @@ import {
107
107
  updateProjectProfileSettings,
108
108
  usageOnLimit,
109
109
  writeViewerContext
110
- } from "./chunk-FZKAAAEB.js";
110
+ } from "./chunk-EJ66LEKH.js";
111
111
  import "./chunk-77WWLBCI.js";
112
112
  import "./chunk-4TR3HZFT.js";
113
113
  import "./chunk-WDRMZKVB.js";
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  formatOptionalServicesDirectiveForTurn,
8
8
  formatOptionalServicesReminderForTurn
9
- } from "./chunk-UX6EDDGR.js";
9
+ } from "./chunk-QOS4465Y.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-XDQSHSL6.js";
30
+ } from "./chunk-53SBTCKF.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-RGUZPMTF.js";
68
+ } from "./chunk-SKO7IGKU.js";
69
69
  import {
70
70
  applyAgentEvent,
71
71
  clipAgentEventForPaint,
@@ -117,7 +117,7 @@ import {
117
117
  stageAbsolutePathsAsAttachments,
118
118
  stageBuffersAsAttachments,
119
119
  syncWorkspacesFromThreads
120
- } from "./chunk-SPMIZSKH.js";
120
+ } from "./chunk-MYVKOIIY.js";
121
121
  import {
122
122
  addPrStackLayer,
123
123
  allocateTeamSlug,
@@ -166,7 +166,7 @@ import {
166
166
  resolveRepoRoot,
167
167
  switchWorktreeBranch,
168
168
  withRepoGitLock
169
- } from "./chunk-YWBLQBSN.js";
169
+ } from "./chunk-ROOZDDFA.js";
170
170
  import {
171
171
  clearStaleIndexLocks,
172
172
  enrichPathWithNpmGlobalBin,
@@ -178,6 +178,7 @@ import {
178
178
  import {
179
179
  HISTORY_CLEANUP_INTERVAL_HOURS_DEFAULT,
180
180
  applyTurnUsage,
181
+ archivedUpdatedMs,
181
182
  assertOrchestratorCapableAgent,
182
183
  autoCleanupHistoryEnabled,
183
184
  caffeinateWhileSchedulesEnabled,
@@ -209,7 +210,7 @@ import {
209
210
  usageOnLimit,
210
211
  withTurnScopedCost,
211
212
  writeViewerContext
212
- } from "./chunk-IFU4W4C4.js";
213
+ } from "./chunk-OIHRC2ZJ.js";
213
214
  import {
214
215
  writePrivateFile
215
216
  } from "./chunk-NSTQ6QKD.js";
@@ -518,9 +519,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
518
519
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
519
520
  );
520
521
  }
521
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-743TPQNF.js");
522
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-EI3KBGZE.js");
522
523
  if (isGlobalThread2(thread)) {
523
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-TU24TQ4I.js");
524
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-7W7WPY4X.js");
524
525
  ensureGlobalCoordinatorCwd2(
525
526
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
526
527
  );
@@ -2020,6 +2021,7 @@ function claimSteerRequest(threadId) {
2020
2021
  }
2021
2022
 
2022
2023
  // src/orchestrator/ephemeral-automation.ts
2024
+ var EPHEMERAL_AUTOMATION_KEEP = 5;
2023
2025
  function ephemeralRunReadyToArchive(thread) {
2024
2026
  if (!thread.ephemeralAutomationId?.trim()) return false;
2025
2027
  if (thread.status !== "idle" && thread.status !== "error") return false;
@@ -2030,12 +2032,12 @@ function ephemeralRunReadyToArchive(thread) {
2030
2032
  }
2031
2033
  function markEphemeralAutomation(threadId, opts) {
2032
2034
  const id = opts.ephemeralAutomationId?.trim();
2035
+ const title = opts.ephemeralTitle?.trim();
2033
2036
  const current = readThread(threadId);
2034
2037
  if (!current) throw new Error(`Thread not found: ${threadId}`);
2035
- if (!id) return current;
2036
- const title = opts.ephemeralTitle?.trim();
2038
+ if (!id && !title) return current;
2037
2039
  return updateThread(threadId, {
2038
- ephemeralAutomationId: id,
2040
+ ...id ? { ephemeralAutomationId: id } : {},
2039
2041
  ...title ? { title, userSetTitle: true } : {}
2040
2042
  });
2041
2043
  }
@@ -2070,11 +2072,19 @@ function clearEphemeralAutomation(threadId) {
2070
2072
  function forgetOlderEphemeralRuns(automationId, keepId) {
2071
2073
  const id = automationId.trim();
2072
2074
  if (!id || !keepId) return [];
2075
+ const archived = listThreads({ includeArchived: true }).filter(
2076
+ (thread) => thread.status === "archived" && thread.ephemeralAutomationId === id
2077
+ );
2078
+ const ranked = [...archived].sort((a, b) => {
2079
+ if (a.id === keepId) return -1;
2080
+ if (b.id === keepId) return 1;
2081
+ return archivedUpdatedMs(b) - archivedUpdatedMs(a);
2082
+ });
2083
+ const keep = new Set(ranked.slice(0, EPHEMERAL_AUTOMATION_KEEP).map((thread) => thread.id));
2084
+ keep.add(keepId);
2073
2085
  const removed = [];
2074
- for (const thread of listThreads({ includeArchived: true })) {
2075
- if (thread.id === keepId) continue;
2076
- if (thread.status !== "archived") continue;
2077
- if (thread.ephemeralAutomationId !== id) continue;
2086
+ for (const thread of archived) {
2087
+ if (keep.has(thread.id)) continue;
2078
2088
  try {
2079
2089
  deleteThreadRecord(thread.id);
2080
2090
  removed.push(thread.id);
@@ -2761,7 +2771,7 @@ async function createThread(input, _onSetupLine) {
2761
2771
  });
2762
2772
  await requireAgent(resolved.agent);
2763
2773
  if (input.cowboy) {
2764
- const { cowboyModeEnabled } = await import("./app-settings-KMPVI2B7.js");
2774
+ const { cowboyModeEnabled } = await import("./app-settings-I5HM5RMP.js");
2765
2775
  if (!cowboyModeEnabled()) {
2766
2776
  throw new Error(
2767
2777
  "Cowboy mode is off. Enable it in Settings \u2192 Advanced."
@@ -2820,7 +2830,7 @@ async function createThread(input, _onSetupLine) {
2820
2830
  let sourceIsFork = false;
2821
2831
  if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
2822
2832
  if (isAbleTimeConnected() && getIssueSource() === "abletime") {
2823
- const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-CRRLEYTE.js");
2833
+ const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-5ZY3ZUUO.js");
2824
2834
  const task = await ensureAbleTimeTask({
2825
2835
  title: title?.trim() || "Untitled work",
2826
2836
  description: input.prompt?.trim() || void 0
@@ -3702,7 +3712,7 @@ async function adoptThread(input) {
3702
3712
  messages: input.messages ?? []
3703
3713
  });
3704
3714
  writeThread(thread);
3705
- const { addWorkspace: addWorkspace2 } = await import("./workspaces-75FD4QUR.js");
3715
+ const { addWorkspace: addWorkspace2 } = await import("./workspaces-LJQS73K6.js");
3706
3716
  await addWorkspace2(repoPath);
3707
3717
  const { ensureWorktreeSideboardIgnored } = await import("./worktree-exclude-P5NJODWP.js");
3708
3718
  await ensureWorktreeSideboardIgnored(input.worktreePath);
@@ -6092,7 +6102,7 @@ function formatWorktreeDirective(thread, opts) {
6092
6102
  lines.push(formatDevAccessHint(opts?.activeRuns));
6093
6103
  lines.push("");
6094
6104
  lines.push(
6095
- "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."
6105
+ "Automations (sidebar, after Board): `create_schedule` / `list_schedules` (`at` / `every` / `cron` / `time`+`days`). `archiveChat=false` keeps the new chat. `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."
6096
6106
  );
6097
6107
  lines.push(
6098
6108
  "`set_workspace_tags` labels this checkout (omit ref; replace, add, or remove). Not another checkout."
@@ -6112,7 +6122,7 @@ function connectedOrchestratorTurnReminder(thread, find) {
6112
6122
  return formatConnectedOrchestratorReminder(connectedOrchestrator(thread, find));
6113
6123
  }
6114
6124
  function formatWorktreeReminder() {
6115
- 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).";
6125
+ 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, or time + days such as weekdays at 07:30; archiveChat=false leaves the new chat open; chatId=self for this chat). set_workspace_tags updates labels on this workspace (omit ref).";
6116
6126
  }
6117
6127
  function formatClaudeSubagentReminder() {
6118
6128
  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.';
@@ -6710,6 +6720,8 @@ async function syncThreadBranchFromGit(threadId) {
6710
6720
  import { randomUUID as randomUUID4 } from "crypto";
6711
6721
  import { existsSync as existsSync13, readFileSync as readFileSync8 } from "fs";
6712
6722
  import { join as join14 } from "path";
6723
+
6724
+ // src/store/schedule-when.ts
6713
6725
  import { Cron } from "croner";
6714
6726
  var DURATION_RE = /^(\d+)(s|m|h|d)$/i;
6715
6727
  var UNIT_MS = {
@@ -6718,9 +6730,26 @@ var UNIT_MS = {
6718
6730
  h: 36e5,
6719
6731
  d: 864e5
6720
6732
  };
6721
- function schedulesPath() {
6722
- return join14(appDataDir(), "schedules.json");
6723
- }
6733
+ var DAY_ALIASES = {
6734
+ sun: 0,
6735
+ sunday: 0,
6736
+ mon: 1,
6737
+ monday: 1,
6738
+ tue: 2,
6739
+ tues: 2,
6740
+ tuesday: 2,
6741
+ wed: 3,
6742
+ wednesday: 3,
6743
+ thu: 4,
6744
+ thur: 4,
6745
+ thurs: 4,
6746
+ thursday: 4,
6747
+ fri: 5,
6748
+ friday: 5,
6749
+ sat: 6,
6750
+ saturday: 6
6751
+ };
6752
+ var TIME_RE = /^([01]\d|2[0-3]):([0-5]\d)(?::[0-5]\d)?$/;
6724
6753
  function parseDurationMs(every) {
6725
6754
  const m = every.trim().match(DURATION_RE);
6726
6755
  if (!m) return null;
@@ -6729,18 +6758,65 @@ function parseDurationMs(every) {
6729
6758
  const unit = m[2].toLowerCase();
6730
6759
  return n * UNIT_MS[unit];
6731
6760
  }
6732
- function defaultScheduleName(prompt) {
6733
- const line = prompt.trim().split(/\r?\n/, 1)[0]?.trim() ?? "";
6734
- if (!line) return "Untitled automation";
6735
- return line.length > 60 ? `${line.slice(0, 57).trimEnd()}\u2026` : line;
6736
- }
6737
- function resolveScheduleThreadId(raw, env = process.env) {
6738
- const value = raw?.trim() || "";
6739
- if (!value) return null;
6740
- if (value.toLowerCase() === "self") {
6741
- return env.SIDEBOARD_ORCHESTRATOR_THREAD_ID?.trim() || env.SIDEBOARD_THREAD_ID?.trim() || null;
6761
+ function dayIndex(token) {
6762
+ const text3 = token.trim().toLowerCase();
6763
+ if (/^[0-6]$/.test(text3)) return Number(text3);
6764
+ return DAY_ALIASES[text3];
6765
+ }
6766
+ function normalizeWeekdays(days) {
6767
+ const set = /* @__PURE__ */ new Set();
6768
+ for (const day of days) {
6769
+ if (!Number.isInteger(day) || day < 0 || day > 6) {
6770
+ throw new Error("Days must be 0 (Sunday) through 6 (Saturday)");
6771
+ }
6772
+ set.add(day);
6773
+ }
6774
+ if (set.size === 0) throw new Error("Pick at least one day");
6775
+ return [...set].sort((a, b) => a - b);
6776
+ }
6777
+ function parseWeeklyDays(raw) {
6778
+ const text3 = raw.trim().toLowerCase();
6779
+ if (!text3) throw new Error("Pick at least one day");
6780
+ if (text3 === "daily" || text3 === "all" || text3 === "every day" || text3 === "everyday") {
6781
+ return [0, 1, 2, 3, 4, 5, 6];
6782
+ }
6783
+ if (text3 === "weekdays" || text3 === "weekday") return [1, 2, 3, 4, 5];
6784
+ if (text3 === "weekends" || text3 === "weekend") return [0, 6];
6785
+ const days = [];
6786
+ for (const part of text3.split(/[\s,]+/).filter(Boolean)) {
6787
+ const range = part.split("-");
6788
+ if (range.length === 2 && range[0] && range[1]) {
6789
+ const start = dayIndex(range[0]);
6790
+ const end = dayIndex(range[1]);
6791
+ if (start === void 0 || end === void 0) {
6792
+ throw new Error(`Unknown day: ${part} (use mon,tue, weekdays, weekends, or daily)`);
6793
+ }
6794
+ if (start <= end) {
6795
+ for (let d = start; d <= end; d++) days.push(d);
6796
+ } else {
6797
+ for (let d = start; d <= 6; d++) days.push(d);
6798
+ for (let d = 0; d <= end; d++) days.push(d);
6799
+ }
6800
+ continue;
6801
+ }
6802
+ const n = dayIndex(part);
6803
+ if (n === void 0) {
6804
+ throw new Error(`Unknown day: ${part} (use mon,tue, weekdays, weekends, or daily)`);
6805
+ }
6806
+ days.push(n);
6742
6807
  }
6743
- return value;
6808
+ return normalizeWeekdays(days);
6809
+ }
6810
+ function normalizeWeeklyTime(raw) {
6811
+ const m = raw.trim().match(TIME_RE);
6812
+ if (!m) throw new Error(`Invalid time: ${raw} (use HH:mm, 24-hour)`);
6813
+ return `${m[1]}:${m[2]}`;
6814
+ }
6815
+ function weeklyCronExpr(when) {
6816
+ const time = normalizeWeeklyTime(when.time);
6817
+ const [hh, mm] = time.split(":");
6818
+ const days = normalizeWeekdays(when.days);
6819
+ return `${Number(mm)} ${Number(hh)} * * ${days.join(",")}`;
6744
6820
  }
6745
6821
  function computeNextRunAt(when, from = /* @__PURE__ */ new Date()) {
6746
6822
  if (when.kind === "once") {
@@ -6757,6 +6833,12 @@ function computeNextRunAt(when, from = /* @__PURE__ */ new Date()) {
6757
6833
  }
6758
6834
  return new Date(from.getTime() + ms);
6759
6835
  }
6836
+ if (when.kind === "weekly") {
6837
+ return computeNextRunAt(
6838
+ { kind: "cron", expr: weeklyCronExpr(when), tz: when.tz },
6839
+ from
6840
+ );
6841
+ }
6760
6842
  try {
6761
6843
  const job = new Cron(when.expr, {
6762
6844
  timezone: when.tz?.trim() || void 0,
@@ -6772,9 +6854,6 @@ function computeNextRunAt(when, from = /* @__PURE__ */ new Date()) {
6772
6854
  throw new Error(`Invalid cron: ${message}`);
6773
6855
  }
6774
6856
  }
6775
- function nowIso(d = /* @__PURE__ */ new Date()) {
6776
- return d.toISOString();
6777
- }
6778
6857
  function normalizeWhen(raw) {
6779
6858
  if (!raw || typeof raw !== "object") {
6780
6859
  throw new Error("Schedule is missing `when`");
@@ -6794,7 +6873,36 @@ function normalizeWhen(raw) {
6794
6873
  tz: typeof rec.tz === "string" && rec.tz.trim() ? rec.tz.trim() : void 0
6795
6874
  };
6796
6875
  }
6797
- throw new Error("Schedule `when` must be once, every, or cron");
6876
+ if (kind === "weekly" && Array.isArray(rec.days) && typeof rec.time === "string") {
6877
+ return {
6878
+ kind: "weekly",
6879
+ days: normalizeWeekdays(rec.days.map((day) => Number(day))),
6880
+ time: normalizeWeeklyTime(rec.time),
6881
+ tz: typeof rec.tz === "string" && rec.tz.trim() ? rec.tz.trim() : void 0
6882
+ };
6883
+ }
6884
+ throw new Error("Schedule `when` must be once, every, weekly, or cron");
6885
+ }
6886
+
6887
+ // src/store/schedules.ts
6888
+ function schedulesPath() {
6889
+ return join14(appDataDir(), "schedules.json");
6890
+ }
6891
+ function defaultScheduleName(prompt) {
6892
+ const line = prompt.trim().split(/\r?\n/, 1)[0]?.trim() ?? "";
6893
+ if (!line) return "Untitled automation";
6894
+ return line.length > 60 ? `${line.slice(0, 57).trimEnd()}\u2026` : line;
6895
+ }
6896
+ function resolveScheduleThreadId(raw, env = process.env) {
6897
+ const value = raw?.trim() || "";
6898
+ if (!value) return null;
6899
+ if (value.toLowerCase() === "self") {
6900
+ return env.SIDEBOARD_ORCHESTRATOR_THREAD_ID?.trim() || env.SIDEBOARD_THREAD_ID?.trim() || null;
6901
+ }
6902
+ return value;
6903
+ }
6904
+ function nowIso(d = /* @__PURE__ */ new Date()) {
6905
+ return d.toISOString();
6798
6906
  }
6799
6907
  var ATTACHMENT_KINDS = /* @__PURE__ */ new Set([
6800
6908
  "transcript",
@@ -6852,6 +6960,7 @@ function normalizeTask(raw) {
6852
6960
  planMode: normalizeOptionalBool(raw.planMode),
6853
6961
  autonomy: normalizeAutonomy(raw.autonomy),
6854
6962
  attachments: normalizeAttachments(raw.attachments),
6963
+ archiveChat: raw.archiveChat !== false,
6855
6964
  nextRunAt: raw.nextRunAt,
6856
6965
  lastRunAt: raw.lastRunAt ?? null,
6857
6966
  lastThreadId: raw.lastThreadId ?? null,
@@ -6903,6 +7012,7 @@ function buildTask(input, now) {
6903
7012
  planMode: normalizeOptionalBool(input.planMode),
6904
7013
  autonomy: normalizeAutonomy(input.autonomy),
6905
7014
  attachments: normalizeAttachments(input.attachments),
7015
+ archiveChat: input.archiveChat !== false,
6906
7016
  nextRunAt,
6907
7017
  lastRunAt: null,
6908
7018
  lastThreadId: null,
@@ -6964,6 +7074,7 @@ function updateSchedule(id, patch) {
6964
7074
  planMode: patch.planMode !== void 0 ? normalizeOptionalBool(patch.planMode) : prev.planMode,
6965
7075
  autonomy: patch.autonomy !== void 0 ? normalizeAutonomy(patch.autonomy) : prev.autonomy,
6966
7076
  attachments: patch.attachments !== void 0 ? normalizeAttachments(patch.attachments) : prev.attachments,
7077
+ archiveChat: patch.archiveChat !== void 0 ? patch.archiveChat !== false : prev.archiveChat,
6967
7078
  nextRunAt: whenChanged ? computeNextRunAt(when).toISOString() : prev.nextRunAt,
6968
7079
  lastError: whenChanged ? null : prev.lastError,
6969
7080
  updatedAt: nowIso()
@@ -7011,7 +7122,7 @@ function formatScheduledPrompt(name, prompt) {
7011
7122
  ${prompt}`;
7012
7123
  }
7013
7124
  async function defaultDeps() {
7014
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-VQ4HRYVB.js");
7125
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-2RDE2YS3.js");
7015
7126
  const orch = getOrchestrator2();
7016
7127
  return {
7017
7128
  findThread: (id) => findThreadByRef(id),
@@ -7078,6 +7189,7 @@ async function fireSchedule(id) {
7078
7189
  });
7079
7190
  }
7080
7191
  const pinReplacement = Boolean(schedule.threadId) && schedule.when.kind !== "once";
7192
+ const archiveFresh = schedule.archiveChat !== false && !pinReplacement;
7081
7193
  const created = await deps.startOrchestration({
7082
7194
  goal: prompt,
7083
7195
  agent: pickAgent(schedule),
@@ -7087,7 +7199,8 @@ async function fireSchedule(id) {
7087
7199
  ...schedule.planMode != null ? { planMode: schedule.planMode } : {},
7088
7200
  ...schedule.autonomy ? { autonomy: schedule.autonomy } : {},
7089
7201
  attachments: schedule.attachments,
7090
- ...pinReplacement ? {} : { ephemeralAutomationId: schedule.id, ephemeralTitle: schedule.name }
7202
+ ...archiveFresh ? { ephemeralAutomationId: schedule.id } : {},
7203
+ ephemeralTitle: schedule.name
7091
7204
  });
7092
7205
  if (pinReplacement) {
7093
7206
  updateSchedule(schedule.id, { threadId: created.id });
@@ -7377,7 +7490,7 @@ var Orchestrator = class {
7377
7490
  orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
7378
7491
  });
7379
7492
  }
7380
- const { autoCleanupOrphansEnabled } = await import("./app-settings-KMPVI2B7.js");
7493
+ const { autoCleanupOrphansEnabled } = await import("./app-settings-I5HM5RMP.js");
7381
7494
  if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
7382
7495
  await cleanupOrphanWorktrees({ repoPaths });
7383
7496
  }
@@ -7771,7 +7884,7 @@ var Orchestrator = class {
7771
7884
  }
7772
7885
  await setup;
7773
7886
  if (skipSetup) return;
7774
- const { autoRunAfterSetupEnabled } = await import("./app-settings-KMPVI2B7.js");
7887
+ const { autoRunAfterSetupEnabled } = await import("./app-settings-I5HM5RMP.js");
7775
7888
  if (autoRunAfterSetupEnabled()) {
7776
7889
  try {
7777
7890
  await this.startDev(threadId);
@@ -8149,7 +8262,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
8149
8262
  }
8150
8263
  const isBrightsy = fresh.agent === "brightsy";
8151
8264
  const isOrchestration = isOrchestratorThread(fresh);
8152
- const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-KMPVI2B7.js");
8265
+ const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-I5HM5RMP.js");
8153
8266
  const gitAuthMode = getGithubGitAuthMode();
8154
8267
  const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
8155
8268
  githubSlug: turnOrigin?.forge === "github" ? turnOrigin.slug : await withTimeout(resolveGithubRepoSlug(fresh.worktreePath), 8e3, "resolveGithubRepoSlug").catch(() => null),
@@ -9476,7 +9589,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
9476
9589
  if (Object.keys(patch).length === 0) continue;
9477
9590
  updateThread(t.id, patch);
9478
9591
  }
9479
- const { autoArchiveOnMergeEnabled } = await import("./app-settings-KMPVI2B7.js");
9592
+ const { autoArchiveOnMergeEnabled } = await import("./app-settings-I5HM5RMP.js");
9480
9593
  const latest = this.requireThread(thread.id);
9481
9594
  if (!shouldAutoArchiveOnPrMerge({
9482
9595
  previousPrState: prevState || null,
@@ -9800,7 +9913,7 @@ ${formatEnvReminder(projectNameForRepoPath(thread.repoPath || thread.worktreePat
9800
9913
  await runArchiveScript(thread.repoPath, thread.worktreePath);
9801
9914
  } catch {
9802
9915
  }
9803
- const { deleteBranchOnPurgeEnabled } = await import("./app-settings-KMPVI2B7.js");
9916
+ const { deleteBranchOnPurgeEnabled } = await import("./app-settings-I5HM5RMP.js");
9804
9917
  const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
9805
9918
  await removeWorktree(thread.repoPath, thread.worktreePath, {
9806
9919
  deleteBranch: deleteBranch ? thread.branchName : void 0
@@ -9938,7 +10051,7 @@ async function startOrchestration(opts) {
9938
10051
  sourceRef: "default",
9939
10052
  ...createOpts
9940
10053
  }).catch(async () => {
9941
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-G3E6WP66.js");
10054
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-4NGXCCUO.js");
9942
10055
  const repo = await resolveRepoRoot2(repoPath);
9943
10056
  const def = await resolveDefaultBranch2(repo);
9944
10057
  return orch.createThread({
@@ -10007,6 +10120,7 @@ export {
10007
10120
  formatListedIssuesForMcp,
10008
10121
  mcpJson,
10009
10122
  registerViewerContextTools,
10123
+ parseWeeklyDays,
10010
10124
  resolveScheduleThreadId,
10011
10125
  listSchedules,
10012
10126
  scheduleNeedsCaffeinate,