@sideboard-ai/core 0.1.206 → 0.1.207

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 (46) 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-5SDF6KCI.js → agents-7MULGRPU.js} +4 -4
  9. package/dist/{agents-UW2BUEDH.js → agents-KCBCFMFW.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-IQEBC3LD.js → chunk-2GPZ4BAU.js} +54 -27
  13. package/dist/{chunk-X743YN5Y.js → chunk-4EGK47WV.js} +1 -0
  14. package/dist/{chunk-SCIMSW7C.js → chunk-5UQTT4S7.js} +52 -25
  15. package/dist/{chunk-6Q7DFVDQ.js → chunk-6J4OQ6TF.js} +14 -4
  16. package/dist/{chunk-EJX62RSX.js → chunk-6KH4OBEW.js} +1 -1
  17. package/dist/{chunk-FO2NTJ7L.js → chunk-6YZLSZLK.js} +3 -3
  18. package/dist/{chunk-FX3P25X2.js → chunk-A2BRWIEM.js} +5 -5
  19. package/dist/{chunk-CYLDJWRK.js → chunk-F4LZUEIO.js} +37 -7
  20. package/dist/{chunk-4YXOCLJU.js → chunk-JZHRZ3DR.js} +1 -1
  21. package/dist/{chunk-6F2L3NTL.js → chunk-N4A4NWFO.js} +1 -1
  22. package/dist/{chunk-GD2WKFFA.js → chunk-PAQPT3JO.js} +2 -2
  23. package/dist/{chunk-R7QI3O74.js → chunk-QOJB5PC7.js} +2 -2
  24. package/dist/{chunk-3K257PCS.js → chunk-TEDEVD4O.js} +37 -7
  25. package/dist/{chunk-QAVWH2RQ.js → chunk-W6X4GZJG.js} +3 -3
  26. package/dist/{chunk-SGUVAK66.js → chunk-WXWJ5MJ4.js} +5 -5
  27. package/dist/{chunk-W6VM36YO.js → chunk-X45BV4VX.js} +5 -5
  28. package/dist/{chunk-QFBBUFD4.js → chunk-Y4CF7LHH.js} +1 -0
  29. package/dist/{chunk-64L62EZY.js → chunk-ZU7R35NY.js} +5 -5
  30. package/dist/{coordinator-prompt-6Q5NDWOC.js → coordinator-prompt-6A3D7BV3.js} +3 -3
  31. package/dist/{coordinator-prompt-EWHEK24X.js → coordinator-prompt-6NV2IHEX.js} +3 -3
  32. package/dist/{global-workspace-KHSZZKIH.js → global-workspace-I2X6UQMX.js} +3 -3
  33. package/dist/{global-workspace-2GMALKKE.js → global-workspace-VS6HZF2I.js} +3 -3
  34. package/dist/index.cjs +83 -13
  35. package/dist/index.d.cts +5 -3
  36. package/dist/index.d.ts +5 -3
  37. package/dist/index.js +14 -12
  38. package/dist/mcp/run-stdio.cjs +81 -13
  39. package/dist/mcp/run-stdio.js +10 -10
  40. package/dist/{orchestrator-WIL5WFBL.js → orchestrator-7WF32ZXJ.js} +5 -5
  41. package/dist/{orchestrator-NXZ5NDAM.js → orchestrator-CXQY5YRG.js} +6 -6
  42. package/dist/{workspaces-4CBMCP6N.js → workspaces-7PM7UGLG.js} +3 -3
  43. package/dist/{workspaces-6RGWGUFK.js → workspaces-CEU25ANO.js} +3 -3
  44. package/dist/{worktree-2U7SZBO2.js → worktree-T6PCOIHZ.js} +2 -2
  45. package/dist/{worktree-SPH7Q2S6.js → worktree-YD7Y6NRY.js} +2 -2
  46. package/package.json +1 -1
@@ -44,7 +44,7 @@ import {
44
44
  summarizeTurnStderr,
45
45
  toolDescription,
46
46
  turnFailChatText
47
- } from "./chunk-64L62EZY.js";
47
+ } from "./chunk-ZU7R35NY.js";
48
48
  import {
49
49
  SLACK_REPLY_FORMATTING,
50
50
  addWorkspace,
@@ -67,7 +67,7 @@ import {
67
67
  stageAbsolutePathsAsAttachments,
68
68
  stageBuffersAsAttachments,
69
69
  syncWorkspacesFromThreads
70
- } from "./chunk-R7QI3O74.js";
70
+ } from "./chunk-QOJB5PC7.js";
71
71
  import {
72
72
  addPrStackLayer,
73
73
  allocateTeamName,
@@ -117,7 +117,7 @@ import {
117
117
  worktreeDisplayLabelForGroup,
118
118
  worktreeNameFromPath,
119
119
  worktreeSlugForTicket
120
- } from "./chunk-6F2L3NTL.js";
120
+ } from "./chunk-N4A4NWFO.js";
121
121
  import {
122
122
  ATTACHMENTS_DIR,
123
123
  DETACHED_JOBS_DIR,
@@ -171,7 +171,7 @@ import {
171
171
  updateAdvancedSettings,
172
172
  usageOnLimit,
173
173
  writeSecureJson
174
- } from "./chunk-X743YN5Y.js";
174
+ } from "./chunk-4EGK47WV.js";
175
175
  import {
176
176
  writePrivateFile
177
177
  } from "./chunk-NSTQ6QKD.js";
@@ -409,7 +409,7 @@ async function continueSourceThread(threadId, prompt) {
409
409
  await continueOnReply(threadId, prompt);
410
410
  return;
411
411
  }
412
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-WIL5WFBL.js");
412
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-7WF32ZXJ.js");
413
413
  await getOrchestrator2().send(threadId, prompt);
414
414
  } catch {
415
415
  }
@@ -802,9 +802,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
802
802
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
803
803
  );
804
804
  }
805
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-KHSZZKIH.js");
805
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-I2X6UQMX.js");
806
806
  if (isGlobalThread2(thread)) {
807
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-EWHEK24X.js");
807
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-6NV2IHEX.js");
808
808
  ensureGlobalCoordinatorCwd2(
809
809
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
810
810
  );
@@ -1012,6 +1012,24 @@ var FIX_CI_RE = /^Fix CI: .+\.$/;
1012
1012
  function normalizePrState(state) {
1013
1013
  return (state ?? "").trim().toUpperCase();
1014
1014
  }
1015
+ function samePrIdentity(a, b) {
1016
+ const left = (a ?? "").trim().replace(/\/+$/, "");
1017
+ const right = (b ?? "").trim().replace(/\/+$/, "");
1018
+ if (!left || !right) return false;
1019
+ if (left === right) return true;
1020
+ const ln = left.match(/\/pull\/(\d+)/i)?.[1];
1021
+ const rn = right.match(/\/pull\/(\d+)/i)?.[1];
1022
+ return Boolean(ln && rn && ln === rn);
1023
+ }
1024
+ function shouldPersistFetchedPrMeta(opts) {
1025
+ const meta = opts.metaUrl?.trim() || "";
1026
+ if (!meta) return false;
1027
+ const head = opts.headPrUrl?.trim() || "";
1028
+ if (head) return samePrIdentity(meta, head);
1029
+ const live = opts.livePrUrl?.trim() || "";
1030
+ if (live) return samePrIdentity(meta, live);
1031
+ return true;
1032
+ }
1015
1033
  function sameLoginList(a, b) {
1016
1034
  const left = [...a ?? []].map((s) => s.trim().toLowerCase()).filter(Boolean).sort();
1017
1035
  const right = [...b ?? []].map((s) => s.trim().toLowerCase()).filter(Boolean).sort();
@@ -3630,7 +3648,7 @@ async function createThread(input, _onSetupLine) {
3630
3648
  });
3631
3649
  await requireAgent(resolved.agent);
3632
3650
  if (input.cowboy) {
3633
- const { cowboyModeEnabled } = await import("./app-settings-LGHMNHSP.js");
3651
+ const { cowboyModeEnabled } = await import("./app-settings-R2KNCT37.js");
3634
3652
  if (!cowboyModeEnabled()) {
3635
3653
  throw new Error(
3636
3654
  "Cowboy mode is off. Enable it in Settings \u2192 Advanced."
@@ -3688,7 +3706,7 @@ async function createThread(input, _onSetupLine) {
3688
3706
  let sourceIsFork = false;
3689
3707
  if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
3690
3708
  if (isAbleTimeConnected() && getIssueSource() === "abletime") {
3691
- const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-S3UHQZVW.js");
3709
+ const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-UWSSLXH3.js");
3692
3710
  const task = await ensureAbleTimeTask({
3693
3711
  title: title?.trim() || "Untitled work",
3694
3712
  description: input.prompt?.trim() || void 0
@@ -4224,7 +4242,7 @@ async function adoptThread(input) {
4224
4242
  messages: input.messages ?? []
4225
4243
  });
4226
4244
  writeThread(thread);
4227
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-6RGWGUFK.js");
4245
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-CEU25ANO.js");
4228
4246
  await ensureWorkspace2(repoPath);
4229
4247
  const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-N5X5I422.js");
4230
4248
  await ensureWorktreeSideboardIgnored2(input.worktreePath);
@@ -6602,7 +6620,7 @@ function formatScheduledPrompt(name, prompt) {
6602
6620
  ${prompt}`;
6603
6621
  }
6604
6622
  async function defaultDeps() {
6605
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-WIL5WFBL.js");
6623
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-7WF32ZXJ.js");
6606
6624
  const orch = getOrchestrator2();
6607
6625
  return {
6608
6626
  findThread: (id) => findThreadByRef(id),
@@ -6872,7 +6890,7 @@ var Orchestrator = class {
6872
6890
  orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
6873
6891
  });
6874
6892
  }
6875
- const { autoCleanupOrphansEnabled } = await import("./app-settings-LGHMNHSP.js");
6893
+ const { autoCleanupOrphansEnabled } = await import("./app-settings-R2KNCT37.js");
6876
6894
  if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
6877
6895
  await cleanupOrphanWorktrees({ repoPaths });
6878
6896
  }
@@ -7164,7 +7182,7 @@ var Orchestrator = class {
7164
7182
  }
7165
7183
  await setup;
7166
7184
  if (skipSetup) return;
7167
- const { autoRunAfterSetupEnabled } = await import("./app-settings-LGHMNHSP.js");
7185
+ const { autoRunAfterSetupEnabled } = await import("./app-settings-R2KNCT37.js");
7168
7186
  if (autoRunAfterSetupEnabled()) {
7169
7187
  try {
7170
7188
  await this.startDev(threadId);
@@ -7488,7 +7506,7 @@ var Orchestrator = class {
7488
7506
  }
7489
7507
  const isBrightsy = fresh.agent === "brightsy";
7490
7508
  const isOrchestration = isOrchestratorThread(fresh);
7491
- const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-LGHMNHSP.js");
7509
+ const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-R2KNCT37.js");
7492
7510
  const gitAuthMode = getGithubGitAuthMode();
7493
7511
  const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
7494
7512
  githubSlug: await resolveGithubRepoSlug(fresh.worktreePath).catch(
@@ -7653,7 +7671,9 @@ var Orchestrator = class {
7653
7671
  let detail = lastStderr || (exitCode !== 0 ? fallbackTurnFailDetail(assistantText) : "");
7654
7672
  const liveThread = this.requireThread(threadId);
7655
7673
  const isolateCodexPluginRetry = liveThread.agent === "codex" && shouldRetryCodexPluginIsolate(detail, {
7656
- alreadyIsolated: liveThread.isolateCodexPlugins === true
7674
+ // Coordinators already pass toCodexUnattendedAppsArgs — a second
7675
+ // isolate exec keeps sessionId and burns the crash/OOM retry.
7676
+ alreadyIsolated: liveThread.isolateCodexPlugins === true || isOrchestratorThread(liveThread)
7657
7677
  });
7658
7678
  if (isolateCodexPluginRetry) {
7659
7679
  updateThread(threadId, { isolateCodexPlugins: true });
@@ -8456,7 +8476,7 @@ var Orchestrator = class {
8456
8476
  } catch {
8457
8477
  headUrl = null;
8458
8478
  }
8459
- return { thread, selectors: connectedPrSelectors(thread, headUrl), cwd };
8479
+ return { thread, selectors: connectedPrSelectors(thread, headUrl), cwd, headUrl };
8460
8480
  }
8461
8481
  async getPrChecks(threadRef) {
8462
8482
  const { selectors, cwd } = await this.withPrSelector(threadRef);
@@ -8467,13 +8487,20 @@ var Orchestrator = class {
8467
8487
  return null;
8468
8488
  }
8469
8489
  async getPrMeta(threadRef) {
8470
- const { thread, selectors, cwd } = await this.withPrSelector(threadRef);
8490
+ const { thread, selectors, cwd, headUrl } = await this.withPrSelector(threadRef);
8471
8491
  for (const selector of selectors) {
8472
8492
  const meta = await getPrMeta(cwd, selector);
8473
- if (meta) {
8474
- await this.persistPrMetaAndMaybeArchive(thread, meta);
8475
- return meta;
8493
+ if (!meta) continue;
8494
+ const live = this.requireThread(thread.id);
8495
+ if (!shouldPersistFetchedPrMeta({
8496
+ metaUrl: meta.url,
8497
+ livePrUrl: live.prUrl,
8498
+ headPrUrl: headUrl
8499
+ })) {
8500
+ continue;
8476
8501
  }
8502
+ await this.persistPrMetaAndMaybeArchive(live, meta);
8503
+ return meta;
8477
8504
  }
8478
8505
  return null;
8479
8506
  }
@@ -8495,7 +8522,7 @@ var Orchestrator = class {
8495
8522
  if (!titled.userSetTitle && meta.title && titled.title !== meta.title) {
8496
8523
  updateThread(thread.id, { title: meta.title });
8497
8524
  }
8498
- const { autoArchiveOnMergeEnabled } = await import("./app-settings-LGHMNHSP.js");
8525
+ const { autoArchiveOnMergeEnabled } = await import("./app-settings-R2KNCT37.js");
8499
8526
  const latest = this.requireThread(thread.id);
8500
8527
  if (!shouldAutoArchiveOnPrMerge({
8501
8528
  previousPrState: prevState || null,
@@ -8772,7 +8799,7 @@ var Orchestrator = class {
8772
8799
  this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
8773
8800
  if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
8774
8801
  try {
8775
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-6RGWGUFK.js");
8802
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-CEU25ANO.js");
8776
8803
  await ensureWorkspace2(thread.repoPath);
8777
8804
  } catch {
8778
8805
  }
@@ -8799,7 +8826,7 @@ var Orchestrator = class {
8799
8826
  await runArchiveScript(thread.repoPath, thread.worktreePath);
8800
8827
  } catch {
8801
8828
  }
8802
- const { deleteBranchOnPurgeEnabled } = await import("./app-settings-LGHMNHSP.js");
8829
+ const { deleteBranchOnPurgeEnabled } = await import("./app-settings-R2KNCT37.js");
8803
8830
  const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
8804
8831
  await removeWorktree(thread.repoPath, thread.worktreePath, {
8805
8832
  deleteBranch: deleteBranch ? thread.branchName : void 0
@@ -8826,7 +8853,7 @@ var Orchestrator = class {
8826
8853
  `Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
8827
8854
  );
8828
8855
  }
8829
- const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-SPH7Q2S6.js");
8856
+ const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-YD7Y6NRY.js");
8830
8857
  const slug = thread.worktreePath.split("/").pop();
8831
8858
  const dest = thread.worktreePath;
8832
8859
  await withRepoGitLock(thread.repoPath, async () => {
@@ -8936,7 +8963,7 @@ async function startOrchestration(opts) {
8936
8963
  sourceRef: "default",
8937
8964
  ...createOpts
8938
8965
  }).catch(async () => {
8939
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-SPH7Q2S6.js");
8966
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-YD7Y6NRY.js");
8940
8967
  const repo = await resolveRepoRoot2(repoPath);
8941
8968
  const def = await resolveDefaultBranch2(repo);
8942
8969
  return orch.createThread({
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_ABLETIME_HOST,
3
3
  normalizeAbleTimeHost
4
- } from "./chunk-W6VM36YO.js";
4
+ } from "./chunk-X45BV4VX.js";
5
5
  import {
6
6
  httpFetch
7
7
  } from "./chunk-N7WZ6NIN.js";
@@ -10,7 +10,7 @@ import {
10
10
  getAbleTimeHost,
11
11
  loadAppSettings,
12
12
  saveAbleTimeConnection
13
- } from "./chunk-QFBBUFD4.js";
13
+ } from "./chunk-Y4CF7LHH.js";
14
14
 
15
15
  // src/integrations/abletime-oauth.ts
16
16
  import { createHash, randomBytes } from "crypto";
@@ -72,6 +72,12 @@ function ableTimeOAuthClientId() {
72
72
  function ableTimeOAuthResource(host) {
73
73
  return `${normalizeAbleTimeHost(host)}/api/public/v2/mcp`;
74
74
  }
75
+ function resolveAbleTimeOAuthHost(requested, saved) {
76
+ const fromRequest = requested?.trim();
77
+ if (fromRequest) return fromRequest;
78
+ const fromSaved = saved?.trim();
79
+ return fromSaved || void 0;
80
+ }
75
81
  function createAbleTimePkce() {
76
82
  const verifier = randomBytes(32).toString("base64url");
77
83
  const challenge = createHash("sha256").update(verifier).digest("base64url");
@@ -183,7 +189,10 @@ async function startAbleTimeOAuth(opts) {
183
189
  `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.`
184
190
  );
185
191
  }
186
- const host = opts?.host?.trim() || void 0;
192
+ const host = resolveAbleTimeOAuthHost(
193
+ opts?.host,
194
+ loadAppSettings().integrations.abletimeHost
195
+ );
187
196
  const state = randomBytes(16).toString("hex");
188
197
  const pkce = createAbleTimePkce();
189
198
  const authorizeUrl = ableTimeOAuthAuthorizeUrl(clientId, state, pkce.challenge, host);
@@ -271,7 +280,7 @@ async function startAbleTimeOAuth(opts) {
271
280
  persistAbleTimeTokens(data, { host });
272
281
  const token = data.access_token.trim();
273
282
  try {
274
- const { getAbleTimeOrientation } = await import("./abletime-TONBQP4O.js");
283
+ const { getAbleTimeOrientation } = await import("./abletime-I4IYZBKU.js");
275
284
  const orientation = await getAbleTimeOrientation({ token, host });
276
285
  return saveAbleTimeConnection({
277
286
  accessToken: token,
@@ -299,6 +308,7 @@ export {
299
308
  hasBakedAbleTimeOAuth,
300
309
  ableTimeOAuthClientId,
301
310
  ableTimeOAuthResource,
311
+ resolveAbleTimeOAuthHost,
302
312
  createAbleTimePkce,
303
313
  ableTimeOAuthAuthorizeUrl,
304
314
  ensureAbleTimeAccessToken,
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  getGithubGitAuthMode,
9
9
  getGithubPat
10
- } from "./chunk-QFBBUFD4.js";
10
+ } from "./chunk-Y4CF7LHH.js";
11
11
  import {
12
12
  listThreads
13
13
  } from "./chunk-ARR4OGLY.js";
@@ -2,17 +2,17 @@
2
2
 
3
3
  import {
4
4
  textFromAbleTimeDoc
5
- } from "./chunk-3K257PCS.js";
5
+ } from "./chunk-TEDEVD4O.js";
6
6
  import {
7
7
  assertAbleTimeCredential,
8
8
  callAbleTimeTool,
9
9
  normalizeAbleTimeHost,
10
10
  rewriteAbleTimeError
11
- } from "./chunk-SGUVAK66.js";
11
+ } from "./chunk-WXWJ5MJ4.js";
12
12
  import {
13
13
  isAbleTimeConnected,
14
14
  saveAbleTimeConnection
15
- } from "./chunk-X743YN5Y.js";
15
+ } from "./chunk-4EGK47WV.js";
16
16
 
17
17
  // src/integrations/abletime.ts
18
18
  var CLOSED_STATES = /* @__PURE__ */ new Set([
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  isOrchestratorThread
3
- } from "./chunk-GD2WKFFA.js";
3
+ } from "./chunk-PAQPT3JO.js";
4
4
  import {
5
5
  codexUnattendedGitConfigArgs,
6
6
  mergeAgentGitAuthEnv,
7
7
  resolveAgentGitAuthEnv,
8
8
  resolveCodexGitWritableRoots
9
- } from "./chunk-EJX62RSX.js";
9
+ } from "./chunk-6KH4OBEW.js";
10
10
  import {
11
11
  applyConnectedTeamToCli,
12
12
  brightsyMcpServerName,
@@ -33,7 +33,7 @@ import {
33
33
  packagedMcpStdioPath,
34
34
  parseCursorRunnerLine,
35
35
  resolveNodeLaunch
36
- } from "./chunk-4YXOCLJU.js";
36
+ } from "./chunk-JZHRZ3DR.js";
37
37
  import {
38
38
  claudeChromeEnabled,
39
39
  isAbleTimeConnected,
@@ -41,7 +41,7 @@ import {
41
41
  loadAppSettings,
42
42
  resolveAgentExecutable,
43
43
  resolveClaudeExecutable
44
- } from "./chunk-QFBBUFD4.js";
44
+ } from "./chunk-Y4CF7LHH.js";
45
45
  import {
46
46
  isElectronLikeCommand,
47
47
  unwrapStrippedElectronLaunch
@@ -1942,7 +1942,7 @@ var claudeAdapter = {
1942
1942
  );
1943
1943
  }
1944
1944
  const mode = permissionMode(thread);
1945
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-2GMALKKE.js");
1945
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-VS6HZF2I.js");
1946
1946
  const isOrchestrator = isOrchestratorThread2(thread);
1947
1947
  const injectedServers = await buildInjectedMcpServers({
1948
1948
  includeSideboard: true,
@@ -4,14 +4,14 @@ import {
4
4
  normalizeAbleTimeCredential,
5
5
  normalizeAbleTimeHost,
6
6
  rewriteAbleTimeError
7
- } from "./chunk-W6VM36YO.js";
7
+ } from "./chunk-X45BV4VX.js";
8
8
  import {
9
9
  httpFetch
10
10
  } from "./chunk-N7WZ6NIN.js";
11
11
  import {
12
12
  getAbleTimeAccessToken,
13
13
  getAbleTimeHost
14
- } from "./chunk-QFBBUFD4.js";
14
+ } from "./chunk-Y4CF7LHH.js";
15
15
 
16
16
  // src/integrations/abletime-rest.ts
17
17
  var ABLETIME_REST_PREFIX = "/api/public/v2";
@@ -153,6 +153,7 @@ function restTaskToRaw(raw, users) {
153
153
  description: textFromAbleTimeDoc(rec.description) || asString(rec.descriptionSanitized),
154
154
  projectId: asString(rec.projectId),
155
155
  categoryId: asString(rec.projectCategoryId) || asString(rec.categoryId),
156
+ parentId: asString(rec.parentTaskId) || asString(rec.parentId),
156
157
  tags: rec.tags,
157
158
  comments,
158
159
  createdAt: asString(rec.dateCreated) || asString(rec.createdAt),
@@ -243,6 +244,19 @@ function firstStringArg(args, keys) {
243
244
  }
244
245
  return "";
245
246
  }
247
+ function isNoneToken(value) {
248
+ return value.trim().toLowerCase() === "none";
249
+ }
250
+ function findRestProject(projects, projectId) {
251
+ const wanted = projectId.trim().toLowerCase();
252
+ return projects.find(
253
+ (item) => asString(item.id).toLowerCase() === wanted || asString(item.name).toLowerCase() === wanted
254
+ ) ?? null;
255
+ }
256
+ async function resolveRestParentTaskId(parent, opts) {
257
+ if (isNoneToken(parent)) return null;
258
+ return resolveTaskId(parent, opts);
259
+ }
246
260
  async function callAbleTimeRestTool(name, args = {}, opts) {
247
261
  const token = normalizeAbleTimeCredential(opts?.token ?? getAbleTimeAccessToken() ?? "");
248
262
  if (!token) {
@@ -288,9 +302,7 @@ async function callAbleTimeRestTool(name, args = {}, opts) {
288
302
  const projectId = firstStringArg(args, ["project_id", "projectId", "project"]);
289
303
  if (!projectId) throw new Error("AbleTime project is required");
290
304
  const projects = await listProjectsRaw(requestOpts);
291
- const project = projects.find(
292
- (item) => String(item.id).toLowerCase() === projectId.toLowerCase() || String(item.name).toLowerCase() === projectId.toLowerCase()
293
- ) ?? projects[0];
305
+ const project = findRestProject(projects, projectId) ?? projects[0];
294
306
  if (!project) throw new Error("AbleTime has no projects to create a task in");
295
307
  const categories = asList(project.categories);
296
308
  const wantedCategory = firstStringArg(args, ["category_id", "categoryId", "category"]);
@@ -298,13 +310,16 @@ async function callAbleTimeRestTool(name, args = {}, opts) {
298
310
  if (!item || !wantedCategory) return false;
299
311
  return asString(item.id).toLowerCase() === wantedCategory.toLowerCase() || asString(item.name).toLowerCase() === wantedCategory.toLowerCase();
300
312
  }) ?? asRecord(categories[0]);
313
+ const parentArg = firstStringArg(args, ["parent", "parent_id", "parentId", "related_task_id"]);
314
+ const parentTaskId = parentArg ? await resolveRestParentTaskId(parentArg, requestOpts) : void 0;
301
315
  const created = await abletimeRestRequest("/tasks", {
302
316
  ...requestOpts,
303
317
  method: "POST",
304
318
  body: {
305
- projectId: project.id,
319
+ projectId: asString(project.id),
306
320
  projectCategoryId: category ? asString(category.id) : void 0,
307
- title
321
+ title,
322
+ ...parentTaskId ? { parentTaskId } : {}
308
323
  }
309
324
  });
310
325
  const state = firstStringArg(args, ["state"]);
@@ -337,6 +352,21 @@ async function callAbleTimeRestTool(name, args = {}, opts) {
337
352
  if (args.tags !== void 0 || args.labels !== void 0) {
338
353
  patch.tags = args.tags ?? args.labels ?? args.tag_names;
339
354
  }
355
+ const projectArg = firstStringArg(args, ["project", "project_id", "projectId"]);
356
+ if (projectArg) {
357
+ if (isNoneToken(projectArg)) {
358
+ throw new Error("AbleTime tasks stay in a project \u2014 pass a project name or id");
359
+ }
360
+ const projects = await listProjectsRaw(requestOpts);
361
+ const project = findRestProject(projects, projectArg);
362
+ const nextProjectId = project ? asString(project.id) : "";
363
+ if (!nextProjectId) throw new Error(`AbleTime project not found: ${projectArg}`);
364
+ patch.projectId = nextProjectId;
365
+ }
366
+ const parentArg = firstStringArg(args, ["parent", "parent_id", "parentId", "related_task_id"]);
367
+ if (parentArg) {
368
+ patch.parentTaskId = await resolveRestParentTaskId(parentArg, requestOpts);
369
+ }
340
370
  if (Object.keys(patch).length > 0) {
341
371
  await abletimeRestRequest(`/tasks/${encodeURIComponent(id)}`, {
342
372
  ...requestOpts,
@@ -340,7 +340,7 @@ function looksLikeCodexMcpError(text) {
340
340
  if (/\brmcp\b/.test(t) && /fatal|quit|transport|error|died|kill|auth/.test(t)) {
341
341
  return true;
342
342
  }
343
- return /mcp[_ -]?(server|tool|error|transport|client)/.test(t) && /fail|error|timeout|disconnect|auth|unauthorized/.test(t);
343
+ return /invalid transport in mcp_servers/.test(t);
344
344
  }
345
345
  function shouldFeedErrorBackToAgent(opts) {
346
346
  const detail = opts.detail.trim();
@@ -22,7 +22,7 @@ import {
22
22
  import {
23
23
  getGithubGitAuthMode,
24
24
  getGithubPat
25
- } from "./chunk-X743YN5Y.js";
25
+ } from "./chunk-4EGK47WV.js";
26
26
  import {
27
27
  worktreesRoot
28
28
  } from "./chunk-EQNRWDLN.js";
@@ -5,7 +5,7 @@ import {
5
5
  resolveRepoRoot,
6
6
  takenSlugsFromThread,
7
7
  teamSlugFromName
8
- } from "./chunk-EJX62RSX.js";
8
+ } from "./chunk-6KH4OBEW.js";
9
9
  import {
10
10
  ATTACHMENTS_DIR,
11
11
  attachmentsGitignoreBody
@@ -22,7 +22,7 @@ import {
22
22
  resolveThreadDefaults,
23
23
  resolveViewerProfile,
24
24
  resolveViewerProfileForRepo
25
- } from "./chunk-QFBBUFD4.js";
25
+ } from "./chunk-Y4CF7LHH.js";
26
26
  import {
27
27
  createEmptyThread,
28
28
  listThreads,
@@ -7,7 +7,7 @@ import {
7
7
  resolveRepoRoot,
8
8
  takenSlugsFromThread,
9
9
  teamSlugFromName
10
- } from "./chunk-6F2L3NTL.js";
10
+ } from "./chunk-N4A4NWFO.js";
11
11
  import {
12
12
  ATTACHMENTS_DIR,
13
13
  attachmentsGitignoreBody
@@ -30,7 +30,7 @@ import {
30
30
  resolveThreadDefaults,
31
31
  resolveViewerProfile,
32
32
  resolveViewerProfileForRepo
33
- } from "./chunk-X743YN5Y.js";
33
+ } from "./chunk-4EGK47WV.js";
34
34
  import {
35
35
  appDataDir,
36
36
  globalAgentCwd,
@@ -6,14 +6,14 @@ import {
6
6
  normalizeAbleTimeCredential,
7
7
  normalizeAbleTimeHost,
8
8
  rewriteAbleTimeError
9
- } from "./chunk-SGUVAK66.js";
9
+ } from "./chunk-WXWJ5MJ4.js";
10
10
  import {
11
11
  httpFetch
12
12
  } from "./chunk-VKQGAWHY.js";
13
13
  import {
14
14
  getAbleTimeAccessToken,
15
15
  getAbleTimeHost
16
- } from "./chunk-X743YN5Y.js";
16
+ } from "./chunk-4EGK47WV.js";
17
17
 
18
18
  // src/integrations/abletime-rest.ts
19
19
  var ABLETIME_REST_PREFIX = "/api/public/v2";
@@ -155,6 +155,7 @@ function restTaskToRaw(raw, users) {
155
155
  description: textFromAbleTimeDoc(rec.description) || asString(rec.descriptionSanitized),
156
156
  projectId: asString(rec.projectId),
157
157
  categoryId: asString(rec.projectCategoryId) || asString(rec.categoryId),
158
+ parentId: asString(rec.parentTaskId) || asString(rec.parentId),
158
159
  tags: rec.tags,
159
160
  comments,
160
161
  createdAt: asString(rec.dateCreated) || asString(rec.createdAt),
@@ -245,6 +246,19 @@ function firstStringArg(args, keys) {
245
246
  }
246
247
  return "";
247
248
  }
249
+ function isNoneToken(value) {
250
+ return value.trim().toLowerCase() === "none";
251
+ }
252
+ function findRestProject(projects, projectId) {
253
+ const wanted = projectId.trim().toLowerCase();
254
+ return projects.find(
255
+ (item) => asString(item.id).toLowerCase() === wanted || asString(item.name).toLowerCase() === wanted
256
+ ) ?? null;
257
+ }
258
+ async function resolveRestParentTaskId(parent, opts) {
259
+ if (isNoneToken(parent)) return null;
260
+ return resolveTaskId(parent, opts);
261
+ }
248
262
  async function callAbleTimeRestTool(name, args = {}, opts) {
249
263
  const token = normalizeAbleTimeCredential(opts?.token ?? getAbleTimeAccessToken() ?? "");
250
264
  if (!token) {
@@ -290,9 +304,7 @@ async function callAbleTimeRestTool(name, args = {}, opts) {
290
304
  const projectId = firstStringArg(args, ["project_id", "projectId", "project"]);
291
305
  if (!projectId) throw new Error("AbleTime project is required");
292
306
  const projects = await listProjectsRaw(requestOpts);
293
- const project = projects.find(
294
- (item) => String(item.id).toLowerCase() === projectId.toLowerCase() || String(item.name).toLowerCase() === projectId.toLowerCase()
295
- ) ?? projects[0];
307
+ const project = findRestProject(projects, projectId) ?? projects[0];
296
308
  if (!project) throw new Error("AbleTime has no projects to create a task in");
297
309
  const categories = asList(project.categories);
298
310
  const wantedCategory = firstStringArg(args, ["category_id", "categoryId", "category"]);
@@ -300,13 +312,16 @@ async function callAbleTimeRestTool(name, args = {}, opts) {
300
312
  if (!item || !wantedCategory) return false;
301
313
  return asString(item.id).toLowerCase() === wantedCategory.toLowerCase() || asString(item.name).toLowerCase() === wantedCategory.toLowerCase();
302
314
  }) ?? asRecord(categories[0]);
315
+ const parentArg = firstStringArg(args, ["parent", "parent_id", "parentId", "related_task_id"]);
316
+ const parentTaskId = parentArg ? await resolveRestParentTaskId(parentArg, requestOpts) : void 0;
303
317
  const created = await abletimeRestRequest("/tasks", {
304
318
  ...requestOpts,
305
319
  method: "POST",
306
320
  body: {
307
- projectId: project.id,
321
+ projectId: asString(project.id),
308
322
  projectCategoryId: category ? asString(category.id) : void 0,
309
- title
323
+ title,
324
+ ...parentTaskId ? { parentTaskId } : {}
310
325
  }
311
326
  });
312
327
  const state = firstStringArg(args, ["state"]);
@@ -339,6 +354,21 @@ async function callAbleTimeRestTool(name, args = {}, opts) {
339
354
  if (args.tags !== void 0 || args.labels !== void 0) {
340
355
  patch.tags = args.tags ?? args.labels ?? args.tag_names;
341
356
  }
357
+ const projectArg = firstStringArg(args, ["project", "project_id", "projectId"]);
358
+ if (projectArg) {
359
+ if (isNoneToken(projectArg)) {
360
+ throw new Error("AbleTime tasks stay in a project \u2014 pass a project name or id");
361
+ }
362
+ const projects = await listProjectsRaw(requestOpts);
363
+ const project = findRestProject(projects, projectArg);
364
+ const nextProjectId = project ? asString(project.id) : "";
365
+ if (!nextProjectId) throw new Error(`AbleTime project not found: ${projectArg}`);
366
+ patch.projectId = nextProjectId;
367
+ }
368
+ const parentArg = firstStringArg(args, ["parent", "parent_id", "parentId", "related_task_id"]);
369
+ if (parentArg) {
370
+ patch.parentTaskId = await resolveRestParentTaskId(parentArg, requestOpts);
371
+ }
342
372
  if (Object.keys(patch).length > 0) {
343
373
  await abletimeRestRequest(`/tasks/${encodeURIComponent(id)}`, {
344
374
  ...requestOpts,
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  textFromAbleTimeDoc
3
- } from "./chunk-CYLDJWRK.js";
3
+ } from "./chunk-F4LZUEIO.js";
4
4
  import {
5
5
  assertAbleTimeCredential,
6
6
  callAbleTimeTool,
7
7
  normalizeAbleTimeHost,
8
8
  rewriteAbleTimeError
9
- } from "./chunk-W6VM36YO.js";
9
+ } from "./chunk-X45BV4VX.js";
10
10
  import {
11
11
  isAbleTimeConnected,
12
12
  saveAbleTimeConnection
13
- } from "./chunk-QFBBUFD4.js";
13
+ } from "./chunk-Y4CF7LHH.js";
14
14
 
15
15
  // src/integrations/abletime.ts
16
16
  var CLOSED_STATES = /* @__PURE__ */ new Set([
@@ -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;