@sideboard-ai/core 0.1.206 → 0.1.208

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 (50) hide show
  1. package/dist/{abletime-TONBQP4O.js → abletime-I4IYZBKU.js} +4 -4
  2. package/dist/{abletime-S3UHQZVW.js → abletime-UWSSLXH3.js} +4 -4
  3. package/dist/{abletime-oauth-SD4SZY5U.js → abletime-oauth-C3BQXKW3.js} +5 -3
  4. package/dist/{abletime-oauth-AVCEO2DY.js → abletime-oauth-UZHPB3W2.js} +14 -4
  5. package/dist/{abletime-rest-J2OBB4VA.js → abletime-rest-5YPPEOKK.js} +3 -3
  6. package/dist/{abletime-rest-6ODSXV7G.js → abletime-rest-HYNYDYK3.js} +3 -3
  7. package/dist/agents/cursor-runner.js +1 -1
  8. package/dist/{agents-UW2BUEDH.js → agents-CCS5IEBV.js} +6 -6
  9. package/dist/{agents-5SDF6KCI.js → agents-QHQXR55O.js} +5 -5
  10. package/dist/{app-settings-YEPF46IJ.js → app-settings-GJ6KDYEF.js} +1 -1
  11. package/dist/{app-settings-LGHMNHSP.js → app-settings-R2KNCT37.js} +1 -1
  12. package/dist/{chunk-X743YN5Y.js → chunk-4EGK47WV.js} +1 -0
  13. package/dist/{chunk-6Q7DFVDQ.js → chunk-6J4OQ6TF.js} +14 -4
  14. package/dist/{chunk-FO2NTJ7L.js → chunk-6YZLSZLK.js} +3 -3
  15. package/dist/{chunk-ARR4OGLY.js → chunk-7DKX5JLT.js} +2 -0
  16. package/dist/{chunk-64L62EZY.js → chunk-7PEIIN7P.js} +30 -5
  17. package/dist/{chunk-FX3P25X2.js → chunk-A6SOSLUV.js} +32 -5
  18. package/dist/{chunk-IQEBC3LD.js → chunk-C5MNMITQ.js} +95 -35
  19. package/dist/{chunk-SCIMSW7C.js → chunk-C6ZNQV5W.js} +91 -33
  20. package/dist/{chunk-R7QI3O74.js → chunk-DNTPX6HV.js} +3 -3
  21. package/dist/{chunk-CYLDJWRK.js → chunk-F4LZUEIO.js} +37 -7
  22. package/dist/{chunk-GD2WKFFA.js → chunk-HA4EZKFY.js} +3 -3
  23. package/dist/{chunk-4YXOCLJU.js → chunk-JZHRZ3DR.js} +1 -1
  24. package/dist/{chunk-6F2L3NTL.js → chunk-NJ2CCLV6.js} +2 -2
  25. package/dist/{chunk-EJX62RSX.js → chunk-OP6CFVTB.js} +2 -2
  26. package/dist/{chunk-3K257PCS.js → chunk-TEDEVD4O.js} +37 -7
  27. package/dist/{chunk-QAVWH2RQ.js → chunk-W6X4GZJG.js} +3 -3
  28. package/dist/{chunk-SGUVAK66.js → chunk-WXWJ5MJ4.js} +5 -5
  29. package/dist/{chunk-W6VM36YO.js → chunk-X45BV4VX.js} +5 -5
  30. package/dist/{chunk-QFBBUFD4.js → chunk-Y4CF7LHH.js} +1 -0
  31. package/dist/{chunk-DWGEBZ3C.js → chunk-ZHCB4CKR.js} +2 -0
  32. package/dist/{coordinator-prompt-EWHEK24X.js → coordinator-prompt-TUHB6ZFA.js} +4 -4
  33. package/dist/{coordinator-prompt-6Q5NDWOC.js → coordinator-prompt-WOTJQMD5.js} +4 -4
  34. package/dist/{global-workspace-2GMALKKE.js → global-workspace-5UUUNA4A.js} +4 -4
  35. package/dist/{global-workspace-KHSZZKIH.js → global-workspace-V6G2KH2V.js} +4 -4
  36. package/dist/index.cjs +164 -20
  37. package/dist/index.d.cts +39 -4
  38. package/dist/index.d.ts +39 -4
  39. package/dist/index.js +26 -13
  40. package/dist/mcp/run-stdio.cjs +150 -20
  41. package/dist/mcp/run-stdio.js +11 -11
  42. package/dist/{orchestrator-WIL5WFBL.js → orchestrator-4IGHVRAF.js} +6 -6
  43. package/dist/{orchestrator-NXZ5NDAM.js → orchestrator-D4AQNF25.js} +7 -7
  44. package/dist/{thread-store-XGYWXR2P.js → thread-store-ESZYZSVC.js} +1 -1
  45. package/dist/{thread-store-LS2T6RVH.js → thread-store-FMWDFAO5.js} +1 -1
  46. package/dist/{workspaces-6RGWGUFK.js → workspaces-CLNANACI.js} +4 -4
  47. package/dist/{workspaces-4CBMCP6N.js → workspaces-PZ36M7EQ.js} +4 -4
  48. package/dist/{worktree-SPH7Q2S6.js → worktree-JKTM47K5.js} +3 -3
  49. package/dist/{worktree-2U7SZBO2.js → worktree-NC4XQNQI.js} +3 -3
  50. package/package.json +1 -1
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  getAbleTimeHost,
8
8
  isAbleTimeConnected
9
- } from "./chunk-X743YN5Y.js";
9
+ } from "./chunk-4EGK47WV.js";
10
10
 
11
11
  // src/integrations/abletime-mcp.ts
12
12
  var DEFAULT_ABLETIME_HOST = "https://track.abletime.com";
@@ -155,7 +155,7 @@ function textsFromUnknown(value) {
155
155
  return "";
156
156
  }
157
157
  async function abletimeMcpRequest(method, params, opts) {
158
- const rawToken = opts?.token ?? await import("./abletime-oauth-AVCEO2DY.js").then((m) => m.ensureAbleTimeAccessToken());
158
+ const rawToken = opts?.token ?? await import("./abletime-oauth-UZHPB3W2.js").then((m) => m.ensureAbleTimeAccessToken());
159
159
  if (!rawToken?.trim()) {
160
160
  throw new Error("AbleTime is not connected \u2014 paste a personal access token in Account settings");
161
161
  }
@@ -226,9 +226,9 @@ async function callAbleTimeTool(name, args = {}, opts) {
226
226
  if (!opts?.token && !isAbleTimeConnected()) {
227
227
  throw new Error("AbleTime is not connected \u2014 paste a personal access token in Account settings");
228
228
  }
229
- const rawToken = opts?.token ?? await import("./abletime-oauth-AVCEO2DY.js").then((m) => m.ensureAbleTimeAccessToken());
229
+ const rawToken = opts?.token ?? await import("./abletime-oauth-UZHPB3W2.js").then((m) => m.ensureAbleTimeAccessToken());
230
230
  if (rawToken && ableTimeUsesRest(rawToken)) {
231
- const { callAbleTimeRestTool } = await import("./abletime-rest-6ODSXV7G.js");
231
+ const { callAbleTimeRestTool } = await import("./abletime-rest-HYNYDYK3.js");
232
232
  return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
233
233
  }
234
234
  const requestOpts = { ...opts, pm: opts?.pm ?? abletimeToolUsesPm(name) };
@@ -244,7 +244,7 @@ async function callAbleTimeTool(name, args = {}, opts) {
244
244
  return await call();
245
245
  }
246
246
  if (rawToken && ableTimeUsesRest(rawToken) && isAbleTimeRejectedCredential(message)) {
247
- const { callAbleTimeRestTool } = await import("./abletime-rest-6ODSXV7G.js");
247
+ const { callAbleTimeRestTool } = await import("./abletime-rest-HYNYDYK3.js");
248
248
  return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
249
249
  }
250
250
  throw err instanceof Error ? new Error(rewriteAbleTimeError(err.message)) : err;
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  getAbleTimeHost,
6
6
  isAbleTimeConnected
7
- } from "./chunk-QFBBUFD4.js";
7
+ } from "./chunk-Y4CF7LHH.js";
8
8
 
9
9
  // src/integrations/abletime-mcp.ts
10
10
  var DEFAULT_ABLETIME_HOST = "https://track.abletime.com";
@@ -153,7 +153,7 @@ function textsFromUnknown(value) {
153
153
  return "";
154
154
  }
155
155
  async function abletimeMcpRequest(method, params, opts) {
156
- const rawToken = opts?.token ?? await import("./abletime-oauth-SD4SZY5U.js").then((m) => m.ensureAbleTimeAccessToken());
156
+ const rawToken = opts?.token ?? await import("./abletime-oauth-C3BQXKW3.js").then((m) => m.ensureAbleTimeAccessToken());
157
157
  if (!rawToken?.trim()) {
158
158
  throw new Error("AbleTime is not connected \u2014 paste a personal access token in Account settings");
159
159
  }
@@ -224,9 +224,9 @@ async function callAbleTimeTool(name, args = {}, opts) {
224
224
  if (!opts?.token && !isAbleTimeConnected()) {
225
225
  throw new Error("AbleTime is not connected \u2014 paste a personal access token in Account settings");
226
226
  }
227
- const rawToken = opts?.token ?? await import("./abletime-oauth-SD4SZY5U.js").then((m) => m.ensureAbleTimeAccessToken());
227
+ const rawToken = opts?.token ?? await import("./abletime-oauth-C3BQXKW3.js").then((m) => m.ensureAbleTimeAccessToken());
228
228
  if (rawToken && ableTimeUsesRest(rawToken)) {
229
- const { callAbleTimeRestTool } = await import("./abletime-rest-J2OBB4VA.js");
229
+ const { callAbleTimeRestTool } = await import("./abletime-rest-5YPPEOKK.js");
230
230
  return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
231
231
  }
232
232
  const requestOpts = { ...opts, pm: opts?.pm ?? abletimeToolUsesPm(name) };
@@ -242,7 +242,7 @@ async function callAbleTimeTool(name, args = {}, opts) {
242
242
  return await call();
243
243
  }
244
244
  if (rawToken && ableTimeUsesRest(rawToken) && isAbleTimeRejectedCredential(message)) {
245
- const { callAbleTimeRestTool } = await import("./abletime-rest-J2OBB4VA.js");
245
+ const { callAbleTimeRestTool } = await import("./abletime-rest-5YPPEOKK.js");
246
246
  return callAbleTimeRestTool(name, args, { ...opts, token: rawToken });
247
247
  }
248
248
  throw err instanceof Error ? new Error(rewriteAbleTimeError(err.message)) : err;
@@ -1577,6 +1577,7 @@ function disconnectAbleTimeConnection() {
1577
1577
  delete integrations.abletimeRefreshToken;
1578
1578
  delete integrations.abletimeTokenExpiresAt;
1579
1579
  delete integrations.abletimeViewerName;
1580
+ delete integrations.abletimeHost;
1580
1581
  return saveAppSettings({ ...current, integrations });
1581
1582
  }
1582
1583
  function getIssueSource(settings = loadAppSettings()) {
@@ -43,6 +43,7 @@ function normalizeThread(raw) {
43
43
  lastError: raw.lastError ?? null,
44
44
  agentPid: raw.agentPid ?? null,
45
45
  attachments: Array.isArray(raw.attachments) ? raw.attachments : [],
46
+ pendingTurnAttachments: Array.isArray(raw.pendingTurnAttachments) ? raw.pendingTurnAttachments : [],
46
47
  prTitle: raw.prTitle ?? null,
47
48
  prState: raw.prState ?? null,
48
49
  prIsDraft: Boolean(raw.prIsDraft),
@@ -85,6 +86,7 @@ function createEmptyThread(partial) {
85
86
  userSetTitle: partial.userSetTitle ?? false,
86
87
  messages: partial.messages ?? [],
87
88
  attachments: partial.attachments ?? [],
89
+ pendingTurnAttachments: partial.pendingTurnAttachments ?? [],
88
90
  createdAt: ts,
89
91
  updatedAt: ts,
90
92
  title: partial.title,
@@ -9,13 +9,13 @@ import {
9
9
  enrichWorkspacesWithGithub,
10
10
  ensureGlobalCoordinatorCwd,
11
11
  formatWorkspaceInventory
12
- } from "./chunk-R7QI3O74.js";
13
- import "./chunk-6F2L3NTL.js";
12
+ } from "./chunk-DNTPX6HV.js";
13
+ import "./chunk-NJ2CCLV6.js";
14
14
  import "./chunk-D6JWYJ4P.js";
15
- import "./chunk-DWGEBZ3C.js";
15
+ import "./chunk-ZHCB4CKR.js";
16
16
  import "./chunk-SYFVUF2C.js";
17
17
  import "./chunk-FNQNJOHY.js";
18
- import "./chunk-X743YN5Y.js";
18
+ import "./chunk-4EGK47WV.js";
19
19
  import "./chunk-NSTQ6QKD.js";
20
20
  import "./chunk-KGZBYWZ3.js";
21
21
  import "./chunk-EQNRWDLN.js";
@@ -7,15 +7,15 @@ import {
7
7
  enrichWorkspacesWithGithub,
8
8
  ensureGlobalCoordinatorCwd,
9
9
  formatWorkspaceInventory
10
- } from "./chunk-GD2WKFFA.js";
11
- import "./chunk-EJX62RSX.js";
10
+ } from "./chunk-HA4EZKFY.js";
11
+ import "./chunk-OP6CFVTB.js";
12
12
  import "./chunk-6K64FJDD.js";
13
13
  import "./chunk-QQKDGPUI.js";
14
- import "./chunk-QFBBUFD4.js";
14
+ import "./chunk-Y4CF7LHH.js";
15
15
  import "./chunk-4TR3HZFT.js";
16
16
  import "./chunk-WDRMZKVB.js";
17
17
  import "./chunk-JT7R45JB.js";
18
- import "./chunk-ARR4OGLY.js";
18
+ import "./chunk-7DKX5JLT.js";
19
19
  import "./chunk-77WWLBCI.js";
20
20
  import "./chunk-WFUDY6PC.js";
21
21
  import "./chunk-UFHNSFAS.js";
@@ -15,15 +15,15 @@ import {
15
15
  orchestratorSessionPoisonedByBuiltins,
16
16
  slackCoordinatorSourceRef,
17
17
  takenTeamSlugsForOrchestration
18
- } from "./chunk-GD2WKFFA.js";
19
- import "./chunk-EJX62RSX.js";
18
+ } from "./chunk-HA4EZKFY.js";
19
+ import "./chunk-OP6CFVTB.js";
20
20
  import "./chunk-6K64FJDD.js";
21
21
  import "./chunk-QQKDGPUI.js";
22
- import "./chunk-QFBBUFD4.js";
22
+ import "./chunk-Y4CF7LHH.js";
23
23
  import "./chunk-4TR3HZFT.js";
24
24
  import "./chunk-WDRMZKVB.js";
25
25
  import "./chunk-JT7R45JB.js";
26
- import "./chunk-ARR4OGLY.js";
26
+ import "./chunk-7DKX5JLT.js";
27
27
  import "./chunk-77WWLBCI.js";
28
28
  import {
29
29
  globalAgentCwd
@@ -17,13 +17,13 @@ import {
17
17
  orchestratorSessionPoisonedByBuiltins,
18
18
  slackCoordinatorSourceRef,
19
19
  takenTeamSlugsForOrchestration
20
- } from "./chunk-R7QI3O74.js";
21
- import "./chunk-6F2L3NTL.js";
20
+ } from "./chunk-DNTPX6HV.js";
21
+ import "./chunk-NJ2CCLV6.js";
22
22
  import "./chunk-D6JWYJ4P.js";
23
- import "./chunk-DWGEBZ3C.js";
23
+ import "./chunk-ZHCB4CKR.js";
24
24
  import "./chunk-SYFVUF2C.js";
25
25
  import "./chunk-FNQNJOHY.js";
26
- import "./chunk-X743YN5Y.js";
26
+ import "./chunk-4EGK47WV.js";
27
27
  import "./chunk-NSTQ6QKD.js";
28
28
  import "./chunk-KGZBYWZ3.js";
29
29
  import {
package/dist/index.cjs CHANGED
@@ -2281,6 +2281,7 @@ function disconnectAbleTimeConnection() {
2281
2281
  delete integrations.abletimeRefreshToken;
2282
2282
  delete integrations.abletimeTokenExpiresAt;
2283
2283
  delete integrations.abletimeViewerName;
2284
+ delete integrations.abletimeHost;
2284
2285
  return saveAppSettings({ ...current, integrations });
2285
2286
  }
2286
2287
  function getIssueSource(settings = loadAppSettings()) {
@@ -2853,6 +2854,7 @@ function normalizeThread(raw) {
2853
2854
  lastError: raw.lastError ?? null,
2854
2855
  agentPid: raw.agentPid ?? null,
2855
2856
  attachments: Array.isArray(raw.attachments) ? raw.attachments : [],
2857
+ pendingTurnAttachments: Array.isArray(raw.pendingTurnAttachments) ? raw.pendingTurnAttachments : [],
2856
2858
  prTitle: raw.prTitle ?? null,
2857
2859
  prState: raw.prState ?? null,
2858
2860
  prIsDraft: Boolean(raw.prIsDraft),
@@ -2895,6 +2897,7 @@ function createEmptyThread(partial) {
2895
2897
  userSetTitle: partial.userSetTitle ?? false,
2896
2898
  messages: partial.messages ?? [],
2897
2899
  attachments: partial.attachments ?? [],
2900
+ pendingTurnAttachments: partial.pendingTurnAttachments ?? [],
2898
2901
  createdAt: ts,
2899
2902
  updatedAt: ts,
2900
2903
  title: partial.title,
@@ -3375,7 +3378,7 @@ function looksLikeCodexMcpError(text7) {
3375
3378
  if (/\brmcp\b/.test(t) && /fatal|quit|transport|error|died|kill|auth/.test(t)) {
3376
3379
  return true;
3377
3380
  }
3378
- return /mcp[_ -]?(server|tool|error|transport|client)/.test(t) && /fail|error|timeout|disconnect|auth|unauthorized/.test(t);
3381
+ return /invalid transport in mcp_servers/.test(t);
3379
3382
  }
3380
3383
  function shouldFeedErrorBackToAgent(opts) {
3381
3384
  const detail = opts.detail.trim();
@@ -3784,6 +3787,28 @@ function clipThinkingForStore(text7, max = THINKING_PART_MAX_CHARS) {
3784
3787
  const marker = "\u2026(earlier thinking trimmed)\n";
3785
3788
  return marker + text7.slice(text7.length - Math.max(1, max - marker.length));
3786
3789
  }
3790
+ function clipEventTail(text7, max) {
3791
+ if (text7.length <= max) return text7;
3792
+ const marker = "\u2026(truncated)\n";
3793
+ return marker + text7.slice(text7.length - Math.max(1, max - marker.length));
3794
+ }
3795
+ function clipAgentEventForPaint(event) {
3796
+ if (event.type === "tool_result" && event.content) {
3797
+ const content = clipToolResultForStore(event.content);
3798
+ if (content === event.content) return event;
3799
+ return { ...event, content };
3800
+ }
3801
+ if (event.type === "thinking" && event.data.length > THINKING_PART_MAX_CHARS) {
3802
+ return { ...event, data: clipThinkingForStore(event.data) };
3803
+ }
3804
+ if (event.type === "stdout" && event.data.length > STDOUT_EVENT_MAX_CHARS) {
3805
+ return { ...event, data: clipEventTail(event.data, STDOUT_EVENT_MAX_CHARS) };
3806
+ }
3807
+ if (event.type === "stderr" && event.data.length > STDERR_EVENT_MAX_CHARS) {
3808
+ return { ...event, data: clipEventTail(event.data, STDERR_EVENT_MAX_CHARS) };
3809
+ }
3810
+ return event;
3811
+ }
3787
3812
  function withPartTimes(next, prev) {
3788
3813
  const now = Date.now();
3789
3814
  const startedAt = prev && typeof prev.startedAt === "number" ? prev.startedAt : now;
@@ -4010,7 +4035,7 @@ function normalizeParseResult(parsed) {
4010
4035
  if (!parsed) return [];
4011
4036
  return Array.isArray(parsed) ? parsed : [parsed];
4012
4037
  }
4013
- var CHAT_DETAIL_MAX, SHELL_BIN_DIR, THINKING_PART_MAX_CHARS;
4038
+ var CHAT_DETAIL_MAX, SHELL_BIN_DIR, THINKING_PART_MAX_CHARS, STDOUT_EVENT_MAX_CHARS, STDERR_EVENT_MAX_CHARS;
4014
4039
  var init_message_parts = __esm({
4015
4040
  "src/agents/message-parts.ts"() {
4016
4041
  "use strict";
@@ -4018,6 +4043,8 @@ var init_message_parts = __esm({
4018
4043
  CHAT_DETAIL_MAX = 72;
4019
4044
  SHELL_BIN_DIR = /^(?:\/usr\/local\/bin|\/usr\/bin|\/bin|\/opt\/homebrew\/bin|\/sbin|\/usr\/sbin)\//;
4020
4045
  THINKING_PART_MAX_CHARS = 64e3;
4046
+ STDOUT_EVENT_MAX_CHARS = 16e3;
4047
+ STDERR_EVENT_MAX_CHARS = 4e3;
4021
4048
  }
4022
4049
  });
4023
4050
 
@@ -15479,6 +15506,24 @@ var init_agent_git_actions = __esm({
15479
15506
  function normalizePrState(state) {
15480
15507
  return (state ?? "").trim().toUpperCase();
15481
15508
  }
15509
+ function samePrIdentity(a, b) {
15510
+ const left = (a ?? "").trim().replace(/\/+$/, "");
15511
+ const right = (b ?? "").trim().replace(/\/+$/, "");
15512
+ if (!left || !right) return false;
15513
+ if (left === right) return true;
15514
+ const ln = left.match(/\/pull\/(\d+)/i)?.[1];
15515
+ const rn = right.match(/\/pull\/(\d+)/i)?.[1];
15516
+ return Boolean(ln && rn && ln === rn);
15517
+ }
15518
+ function shouldPersistFetchedPrMeta(opts) {
15519
+ const meta = opts.metaUrl?.trim() || "";
15520
+ if (!meta) return false;
15521
+ const head = opts.headPrUrl?.trim() || "";
15522
+ if (head) return samePrIdentity(meta, head);
15523
+ const live = opts.livePrUrl?.trim() || "";
15524
+ if (live) return samePrIdentity(meta, live);
15525
+ return true;
15526
+ }
15482
15527
  function sameLoginList(a, b) {
15483
15528
  const left = [...a ?? []].map((s) => s.trim().toLowerCase()).filter(Boolean).sort();
15484
15529
  const right = [...b ?? []].map((s) => s.trim().toLowerCase()).filter(Boolean).sort();
@@ -17607,6 +17652,7 @@ __export(abletime_oauth_exports, {
17607
17652
  hasBakedAbleTimeOAuth: () => hasBakedAbleTimeOAuth,
17608
17653
  isAbleTimeOAuthCancelled: () => isAbleTimeOAuthCancelled,
17609
17654
  parseAbleTimeOAuthCallbackUrl: () => parseAbleTimeOAuthCallbackUrl,
17655
+ resolveAbleTimeOAuthHost: () => resolveAbleTimeOAuthHost,
17610
17656
  startAbleTimeOAuth: () => startAbleTimeOAuth
17611
17657
  });
17612
17658
  function ableTimeOAuthRedirectUri() {
@@ -17658,6 +17704,12 @@ function ableTimeOAuthClientId() {
17658
17704
  function ableTimeOAuthResource(host) {
17659
17705
  return `${normalizeAbleTimeHost(host)}/api/public/v2/mcp`;
17660
17706
  }
17707
+ function resolveAbleTimeOAuthHost(requested, saved) {
17708
+ const fromRequest = requested?.trim();
17709
+ if (fromRequest) return fromRequest;
17710
+ const fromSaved = saved?.trim();
17711
+ return fromSaved || void 0;
17712
+ }
17661
17713
  function createAbleTimePkce() {
17662
17714
  const verifier = (0, import_node_crypto10.randomBytes)(32).toString("base64url");
17663
17715
  const challenge = (0, import_node_crypto10.createHash)("sha256").update(verifier).digest("base64url");
@@ -17761,7 +17813,10 @@ async function startAbleTimeOAuth(opts) {
17761
17813
  `AbleTime browser sign-in needs a Client ID Metadata Document URL. Host ${BAKED_ABLETIME_OAUTH_CLIENT_ID} (see site/oauth/abletime-client.json), or set SIDEBOARD_ABLETIME_OAUTH_CLIENT_ID.`
17762
17814
  );
17763
17815
  }
17764
- const host = opts?.host?.trim() || void 0;
17816
+ const host = resolveAbleTimeOAuthHost(
17817
+ opts?.host,
17818
+ loadAppSettings().integrations.abletimeHost
17819
+ );
17765
17820
  const state = (0, import_node_crypto10.randomBytes)(16).toString("hex");
17766
17821
  const pkce = createAbleTimePkce();
17767
17822
  const authorizeUrl = ableTimeOAuthAuthorizeUrl(clientId, state, pkce.challenge, host);
@@ -18037,6 +18092,7 @@ function restTaskToRaw(raw, users) {
18037
18092
  description: textFromAbleTimeDoc(rec.description) || asString(rec.descriptionSanitized),
18038
18093
  projectId: asString(rec.projectId),
18039
18094
  categoryId: asString(rec.projectCategoryId) || asString(rec.categoryId),
18095
+ parentId: asString(rec.parentTaskId) || asString(rec.parentId),
18040
18096
  tags: rec.tags,
18041
18097
  comments,
18042
18098
  createdAt: asString(rec.dateCreated) || asString(rec.createdAt),
@@ -18127,6 +18183,19 @@ function firstStringArg(args, keys) {
18127
18183
  }
18128
18184
  return "";
18129
18185
  }
18186
+ function isNoneToken(value) {
18187
+ return value.trim().toLowerCase() === "none";
18188
+ }
18189
+ function findRestProject(projects, projectId) {
18190
+ const wanted = projectId.trim().toLowerCase();
18191
+ return projects.find(
18192
+ (item) => asString(item.id).toLowerCase() === wanted || asString(item.name).toLowerCase() === wanted
18193
+ ) ?? null;
18194
+ }
18195
+ async function resolveRestParentTaskId(parent, opts) {
18196
+ if (isNoneToken(parent)) return null;
18197
+ return resolveTaskId(parent, opts);
18198
+ }
18130
18199
  async function callAbleTimeRestTool(name, args = {}, opts) {
18131
18200
  const token = normalizeAbleTimeCredential(opts?.token ?? getAbleTimeAccessToken() ?? "");
18132
18201
  if (!token) {
@@ -18172,9 +18241,7 @@ async function callAbleTimeRestTool(name, args = {}, opts) {
18172
18241
  const projectId = firstStringArg(args, ["project_id", "projectId", "project"]);
18173
18242
  if (!projectId) throw new Error("AbleTime project is required");
18174
18243
  const projects = await listProjectsRaw(requestOpts);
18175
- const project = projects.find(
18176
- (item) => String(item.id).toLowerCase() === projectId.toLowerCase() || String(item.name).toLowerCase() === projectId.toLowerCase()
18177
- ) ?? projects[0];
18244
+ const project = findRestProject(projects, projectId) ?? projects[0];
18178
18245
  if (!project) throw new Error("AbleTime has no projects to create a task in");
18179
18246
  const categories = asList(project.categories);
18180
18247
  const wantedCategory = firstStringArg(args, ["category_id", "categoryId", "category"]);
@@ -18182,13 +18249,16 @@ async function callAbleTimeRestTool(name, args = {}, opts) {
18182
18249
  if (!item || !wantedCategory) return false;
18183
18250
  return asString(item.id).toLowerCase() === wantedCategory.toLowerCase() || asString(item.name).toLowerCase() === wantedCategory.toLowerCase();
18184
18251
  }) ?? asRecord5(categories[0]);
18252
+ const parentArg = firstStringArg(args, ["parent", "parent_id", "parentId", "related_task_id"]);
18253
+ const parentTaskId = parentArg ? await resolveRestParentTaskId(parentArg, requestOpts) : void 0;
18185
18254
  const created = await abletimeRestRequest("/tasks", {
18186
18255
  ...requestOpts,
18187
18256
  method: "POST",
18188
18257
  body: {
18189
- projectId: project.id,
18258
+ projectId: asString(project.id),
18190
18259
  projectCategoryId: category ? asString(category.id) : void 0,
18191
- title
18260
+ title,
18261
+ ...parentTaskId ? { parentTaskId } : {}
18192
18262
  }
18193
18263
  });
18194
18264
  const state = firstStringArg(args, ["state"]);
@@ -18221,6 +18291,21 @@ async function callAbleTimeRestTool(name, args = {}, opts) {
18221
18291
  if (args.tags !== void 0 || args.labels !== void 0) {
18222
18292
  patch.tags = args.tags ?? args.labels ?? args.tag_names;
18223
18293
  }
18294
+ const projectArg = firstStringArg(args, ["project", "project_id", "projectId"]);
18295
+ if (projectArg) {
18296
+ if (isNoneToken(projectArg)) {
18297
+ throw new Error("AbleTime tasks stay in a project \u2014 pass a project name or id");
18298
+ }
18299
+ const projects = await listProjectsRaw(requestOpts);
18300
+ const project = findRestProject(projects, projectArg);
18301
+ const nextProjectId = project ? asString(project.id) : "";
18302
+ if (!nextProjectId) throw new Error(`AbleTime project not found: ${projectArg}`);
18303
+ patch.projectId = nextProjectId;
18304
+ }
18305
+ const parentArg = firstStringArg(args, ["parent", "parent_id", "parentId", "related_task_id"]);
18306
+ if (parentArg) {
18307
+ patch.parentTaskId = await resolveRestParentTaskId(parentArg, requestOpts);
18308
+ }
18224
18309
  if (Object.keys(patch).length > 0) {
18225
18310
  await abletimeRestRequest(`/tasks/${encodeURIComponent(id)}`, {
18226
18311
  ...requestOpts,
@@ -21535,6 +21620,33 @@ var init_expand = __esm({
21535
21620
  }
21536
21621
  });
21537
21622
 
21623
+ // src/composer/consume-attachments.ts
21624
+ function consumeComposerAttachments(thread) {
21625
+ if (thread.attachments.length === 0) {
21626
+ return {
21627
+ attachments: [],
21628
+ pendingTurnAttachments: thread.pendingTurnAttachments ?? []
21629
+ };
21630
+ }
21631
+ return {
21632
+ attachments: [],
21633
+ pendingTurnAttachments: [
21634
+ ...thread.pendingTurnAttachments ?? [],
21635
+ ...thread.attachments
21636
+ ]
21637
+ };
21638
+ }
21639
+ function takePendingTurnAttachments(thread) {
21640
+ const pending = thread.pendingTurnAttachments ?? [];
21641
+ if (pending.length === 0 && thread.attachments.length === 0) return [];
21642
+ return [...pending, ...thread.attachments];
21643
+ }
21644
+ var init_consume_attachments = __esm({
21645
+ "src/composer/consume-attachments.ts"() {
21646
+ "use strict";
21647
+ }
21648
+ });
21649
+
21538
21650
  // src/skills/detached-job-path.ts
21539
21651
  function detachedJobScriptIn(dir) {
21540
21652
  for (const name of DETACHED_JOB_FILENAMES) {
@@ -22532,6 +22644,7 @@ var init_orchestrator = __esm({
22532
22644
  init_diff();
22533
22645
  init_discover();
22534
22646
  init_expand();
22647
+ init_consume_attachments();
22535
22648
  init_stage_files();
22536
22649
  init_context_compact();
22537
22650
  init_instructions();
@@ -23036,6 +23149,11 @@ var init_orchestrator = __esm({
23036
23149
  const inFlight = this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id) || current.status === "running";
23037
23150
  shouldSteer = followUp === "steer" && (inFlight || current.queue.length > 0);
23038
23151
  const patch = { queue };
23152
+ if (current.attachments.length > 0) {
23153
+ const consumed = consumeComposerAttachments(current);
23154
+ patch.attachments = consumed.attachments;
23155
+ patch.pendingTurnAttachments = consumed.pendingTurnAttachments;
23156
+ }
23039
23157
  if (!inFlight) patch.status = "queued";
23040
23158
  const pid = current.agentPid;
23041
23159
  if (typeof pid === "number" && pid > 0 && !isPidAlive(pid)) {
@@ -23216,7 +23334,8 @@ var init_orchestrator = __esm({
23216
23334
  thread = this.requireThread(threadId);
23217
23335
  }
23218
23336
  const autoContinue = isJobContinuePrompt(prompt) || prompt.trim().startsWith("The previous agent process ended before it finished.");
23219
- const sentAttachments = !autoContinue && thread.attachments.length > 0 ? [...thread.attachments] : void 0;
23337
+ const parked = takePendingTurnAttachments(thread);
23338
+ const sentAttachments = !autoContinue && parked.length > 0 ? parked : void 0;
23220
23339
  appendMessage(threadId, {
23221
23340
  role: "user",
23222
23341
  text: prompt,
@@ -23283,8 +23402,8 @@ var init_orchestrator = __esm({
23283
23402
  slackReplyContext,
23284
23403
  expandedPrompt
23285
23404
  ].filter(Boolean).join("\n\n");
23286
- if (!autoContinue && thread.attachments.length > 0) {
23287
- updateThread(threadId, { attachments: [] });
23405
+ if (!autoContinue && sentAttachments) {
23406
+ updateThread(threadId, { attachments: [], pendingTurnAttachments: [] });
23288
23407
  }
23289
23408
  const adapter = getAdapter(thread.agent);
23290
23409
  const resolved = await adapter.resolveSessionId(thread.worktreePath, thread.sessionId);
@@ -23390,8 +23509,9 @@ var init_orchestrator = __esm({
23390
23509
  isolateCodexPlugins: fresh.isolateCodexPlugins === true
23391
23510
  },
23392
23511
  (event) => {
23393
- this.emit({ type: "turn_output", threadId, event });
23394
- noteTurnLiveEvent(threadId, event);
23512
+ const paint = clipAgentEventForPaint(event);
23513
+ this.emit({ type: "turn_output", threadId, event: paint });
23514
+ noteTurnLiveEvent(threadId, paint);
23395
23515
  if (event.type === "session_id") {
23396
23516
  updateThread(threadId, { sessionId: event.data });
23397
23517
  }
@@ -23464,7 +23584,9 @@ var init_orchestrator = __esm({
23464
23584
  let detail = lastStderr || (exitCode !== 0 ? fallbackTurnFailDetail(assistantText) : "");
23465
23585
  const liveThread = this.requireThread(threadId);
23466
23586
  const isolateCodexPluginRetry = liveThread.agent === "codex" && shouldRetryCodexPluginIsolate(detail, {
23467
- alreadyIsolated: liveThread.isolateCodexPlugins === true
23587
+ // Coordinators already pass toCodexUnattendedAppsArgs — a second
23588
+ // isolate exec keeps sessionId and burns the crash/OOM retry.
23589
+ alreadyIsolated: liveThread.isolateCodexPlugins === true || isOrchestratorThread(liveThread)
23468
23590
  });
23469
23591
  if (isolateCodexPluginRetry) {
23470
23592
  updateThread(threadId, { isolateCodexPlugins: true });
@@ -23514,7 +23636,8 @@ var init_orchestrator = __esm({
23514
23636
  isolateCodexPlugins: isolateCodexPluginRetry || retryThread.isolateCodexPlugins === true
23515
23637
  },
23516
23638
  (event) => {
23517
- this.emit({ type: "turn_output", threadId, event });
23639
+ const paint = clipAgentEventForPaint(event);
23640
+ this.emit({ type: "turn_output", threadId, event: paint });
23518
23641
  if (event.type === "session_id") {
23519
23642
  updateThread(threadId, { sessionId: event.data });
23520
23643
  }
@@ -24267,7 +24390,7 @@ var init_orchestrator = __esm({
24267
24390
  } catch {
24268
24391
  headUrl = null;
24269
24392
  }
24270
- return { thread, selectors: connectedPrSelectors(thread, headUrl), cwd };
24393
+ return { thread, selectors: connectedPrSelectors(thread, headUrl), cwd, headUrl };
24271
24394
  }
24272
24395
  async getPrChecks(threadRef) {
24273
24396
  const { selectors, cwd } = await this.withPrSelector(threadRef);
@@ -24278,13 +24401,20 @@ var init_orchestrator = __esm({
24278
24401
  return null;
24279
24402
  }
24280
24403
  async getPrMeta(threadRef) {
24281
- const { thread, selectors, cwd } = await this.withPrSelector(threadRef);
24404
+ const { thread, selectors, cwd, headUrl } = await this.withPrSelector(threadRef);
24282
24405
  for (const selector of selectors) {
24283
24406
  const meta = await getPrMeta(cwd, selector);
24284
- if (meta) {
24285
- await this.persistPrMetaAndMaybeArchive(thread, meta);
24286
- return meta;
24407
+ if (!meta) continue;
24408
+ const live = this.requireThread(thread.id);
24409
+ if (!shouldPersistFetchedPrMeta({
24410
+ metaUrl: meta.url,
24411
+ livePrUrl: live.prUrl,
24412
+ headPrUrl: headUrl
24413
+ })) {
24414
+ continue;
24287
24415
  }
24416
+ await this.persistPrMetaAndMaybeArchive(live, meta);
24417
+ return meta;
24288
24418
  }
24289
24419
  return null;
24290
24420
  }
@@ -24930,6 +25060,8 @@ __export(index_exports, {
24930
25060
  SLACK_PROGRESS_EDIT_MS: () => SLACK_PROGRESS_EDIT_MS,
24931
25061
  SLACK_REPLY_FORMATTING: () => SLACK_REPLY_FORMATTING,
24932
25062
  SLACK_SEEN_REACTION: () => SLACK_SEEN_REACTION,
25063
+ STDERR_EVENT_MAX_CHARS: () => STDERR_EVENT_MAX_CHARS,
25064
+ STDOUT_EVENT_MAX_CHARS: () => STDOUT_EVENT_MAX_CHARS,
24933
25065
  SlackOAuthCancelledError: () => SlackOAuthCancelledError,
24934
25066
  SlackRelayHub: () => SlackRelayHub,
24935
25067
  THINKING_EFFORTS: () => THINKING_EFFORTS,
@@ -25031,6 +25163,7 @@ __export(index_exports, {
25031
25163
  cleanupOrphanWorktrees: () => cleanupOrphanWorktrees,
25032
25164
  clearBoardPins: () => clearBoardPins,
25033
25165
  clearHomeBoardCache: () => clearHomeBoardCache,
25166
+ clipAgentEventForPaint: () => clipAgentEventForPaint,
25034
25167
  clipThinkingForStore: () => clipThinkingForStore,
25035
25168
  cloneRepoIntoSideboard: () => cloneRepoIntoSideboard,
25036
25169
  codeRefRangeLabel: () => codeRefRangeLabel,
@@ -25053,6 +25186,7 @@ __export(index_exports, {
25053
25186
  connectSlackToken: () => connectSlackToken,
25054
25187
  connectedOptionalServices: () => connectedOptionalServices,
25055
25188
  connectedPrSelectors: () => connectedPrSelectors,
25189
+ consumeComposerAttachments: () => consumeComposerAttachments,
25056
25190
  contextTokens: () => contextTokens,
25057
25191
  coordinatorSystemPrompt: () => coordinatorSystemPrompt,
25058
25192
  coordinatorTurnReminder: () => coordinatorTurnReminder,
@@ -25481,6 +25615,7 @@ __export(index_exports, {
25481
25615
  requireAgent: () => requireAgent,
25482
25616
  resetGhStackDetectCache: () => resetGhStackDetectCache,
25483
25617
  resetGithubAgentTokenMemo: () => resetGithubAgentTokenMemo,
25618
+ resolveAbleTimeOAuthHost: () => resolveAbleTimeOAuthHost,
25484
25619
  resolveAccountProfile: () => resolveAccountProfile,
25485
25620
  resolveAccountProfileFromSettings: () => resolveAccountProfileFromSettings,
25486
25621
  resolveAgentExecutable: () => resolveAgentExecutable,
@@ -25601,6 +25736,7 @@ __export(index_exports, {
25601
25736
  summarizeConversation: () => summarizeConversation,
25602
25737
  switchBrightsyAccount: () => switchBrightsyAccount,
25603
25738
  syncWorkspacesFromThreads: () => syncWorkspacesFromThreads,
25739
+ takePendingTurnAttachments: () => takePendingTurnAttachments,
25604
25740
  takenTeamSlugsForChatTab: () => takenTeamSlugsForChatTab,
25605
25741
  takenTeamSlugsForOrchestration: () => takenTeamSlugsForOrchestration,
25606
25742
  taskMessageText: () => taskMessageText,
@@ -25691,6 +25827,7 @@ function slimThreadForUiList(thread) {
25691
25827
  return {
25692
25828
  ...thread,
25693
25829
  attachments: [],
25830
+ pendingTurnAttachments: [],
25694
25831
  messages: slimMessagesForUiList(messages, thread.updatedAt)
25695
25832
  };
25696
25833
  }
@@ -27905,6 +28042,7 @@ function buildPathRefAttachment(input) {
27905
28042
 
27906
28043
  // src/index.ts
27907
28044
  init_stage_files();
28045
+ init_consume_attachments();
27908
28046
 
27909
28047
  // src/composer/pasted-text.ts
27910
28048
  var import_node_crypto13 = require("crypto");
@@ -33683,6 +33821,8 @@ init_outbound_watch();
33683
33821
  SLACK_PROGRESS_EDIT_MS,
33684
33822
  SLACK_REPLY_FORMATTING,
33685
33823
  SLACK_SEEN_REACTION,
33824
+ STDERR_EVENT_MAX_CHARS,
33825
+ STDOUT_EVENT_MAX_CHARS,
33686
33826
  SlackOAuthCancelledError,
33687
33827
  SlackRelayHub,
33688
33828
  THINKING_EFFORTS,
@@ -33784,6 +33924,7 @@ init_outbound_watch();
33784
33924
  cleanupOrphanWorktrees,
33785
33925
  clearBoardPins,
33786
33926
  clearHomeBoardCache,
33927
+ clipAgentEventForPaint,
33787
33928
  clipThinkingForStore,
33788
33929
  cloneRepoIntoSideboard,
33789
33930
  codeRefRangeLabel,
@@ -33806,6 +33947,7 @@ init_outbound_watch();
33806
33947
  connectSlackToken,
33807
33948
  connectedOptionalServices,
33808
33949
  connectedPrSelectors,
33950
+ consumeComposerAttachments,
33809
33951
  contextTokens,
33810
33952
  coordinatorSystemPrompt,
33811
33953
  coordinatorTurnReminder,
@@ -34234,6 +34376,7 @@ init_outbound_watch();
34234
34376
  requireAgent,
34235
34377
  resetGhStackDetectCache,
34236
34378
  resetGithubAgentTokenMemo,
34379
+ resolveAbleTimeOAuthHost,
34237
34380
  resolveAccountProfile,
34238
34381
  resolveAccountProfileFromSettings,
34239
34382
  resolveAgentExecutable,
@@ -34354,6 +34497,7 @@ init_outbound_watch();
34354
34497
  summarizeConversation,
34355
34498
  switchBrightsyAccount,
34356
34499
  syncWorkspacesFromThreads,
34500
+ takePendingTurnAttachments,
34357
34501
  takenTeamSlugsForChatTab,
34358
34502
  takenTeamSlugsForOrchestration,
34359
34503
  taskMessageText,