@sideboard-ai/core 0.1.262 → 0.1.263

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-OQ4PC52L.js → abletime-6AOJI2YZ.js} +4 -4
  2. package/dist/{abletime-CDGINDXG.js → abletime-U75ZGDIX.js} +5 -5
  3. package/dist/{abletime-oauth-KX2TDFTE.js → abletime-oauth-LOAHGG4X.js} +3 -3
  4. package/dist/{abletime-oauth-5A5EOH2A.js → abletime-oauth-TA2YDCYX.js} +4 -4
  5. package/dist/{abletime-rest-UEHOBLXD.js → abletime-rest-CTA5WV26.js} +4 -4
  6. package/dist/{abletime-rest-PUGKYTRR.js → abletime-rest-YZPFM6IY.js} +3 -3
  7. package/dist/agents/claude-runner.cjs +463 -0
  8. package/dist/agents/claude-runner.d.cts +1 -0
  9. package/dist/agents/claude-runner.d.ts +1 -0
  10. package/dist/agents/claude-runner.js +134 -0
  11. package/dist/agents/cursor-runner.cjs +388 -7
  12. package/dist/agents/cursor-runner.js +34 -7
  13. package/dist/{agents-J2P4KNEY.js → agents-3TUMFSMH.js} +10 -9
  14. package/dist/{agents-IKVUGW5H.js → agents-6FWDRVA2.js} +4 -4
  15. package/dist/{app-settings-OM7H64YM.js → app-settings-MVZPM6WW.js} +1 -1
  16. package/dist/{app-settings-VQEUCONM.js → app-settings-RKFFUIFQ.js} +2 -2
  17. package/dist/{chunk-6PFZ6XO7.js → chunk-2QUQH2SZ.js} +81 -6
  18. package/dist/{chunk-VIC6TDYT.js → chunk-36FOBJBF.js} +76 -3
  19. package/dist/{chunk-ABPNIYRS.js → chunk-3H7O27X2.js} +389 -102
  20. package/dist/{chunk-FSZ7YYFQ.js → chunk-4ALDX5IO.js} +5 -3
  21. package/dist/{chunk-5OKJDCBK.js → chunk-5PK53SAP.js} +5 -5
  22. package/dist/{chunk-U3AOJLH3.js → chunk-5ZPT5YAV.js} +8 -6
  23. package/dist/{chunk-YFTO7U2A.js → chunk-6YOXQVJ7.js} +3 -3
  24. package/dist/{chunk-J6ONZP74.js → chunk-6YY7XPPL.js} +5 -5
  25. package/dist/{chunk-WV7KJH2E.js → chunk-A5SAYFJ4.js} +1 -0
  26. package/dist/{chunk-B6XFBNYM.js → chunk-BOMSJUXW.js} +2 -2
  27. package/dist/{chunk-S7VDDJ34.js → chunk-CEOTK5GZ.js} +3 -3
  28. package/dist/{chunk-4F7J6UWD.js → chunk-EK3KVT7I.js} +515 -139
  29. package/dist/{chunk-HHEKVR6C.js → chunk-F5MFNUAA.js} +40 -2
  30. package/dist/{chunk-KVQX62XI.js → chunk-K7B25HO4.js} +3 -3
  31. package/dist/{chunk-JTNY5CK4.js → chunk-L5WGAIL2.js} +46 -46
  32. package/dist/chunk-NYBFYFK7.js +415 -0
  33. package/dist/{chunk-GIZQAOHZ.js → chunk-QX6QUZVD.js} +121 -91
  34. package/dist/{chunk-X2OTZ36G.js → chunk-RKPBIB2U.js} +52 -52
  35. package/dist/{chunk-W5PWGEKS.js → chunk-T3AYRQJZ.js} +107 -77
  36. package/dist/{chunk-D554YCHG.js → chunk-YKYEHDMX.js} +2 -2
  37. package/dist/connected-teams-RU6VATCM.js +1 -1
  38. package/dist/{coordinator-prompt-VQHQ3RIX.js → coordinator-prompt-HZCQZ6C5.js} +6 -6
  39. package/dist/{coordinator-prompt-TU6656OK.js → coordinator-prompt-J7DKHOCH.js} +3 -3
  40. package/dist/{global-workspace-PHF2MOGW.js → global-workspace-6LDUZ2NF.js} +3 -3
  41. package/dist/{global-workspace-47NZVA44.js → global-workspace-TI26K25J.js} +6 -6
  42. package/dist/index.cjs +1712 -721
  43. package/dist/index.d.cts +181 -41
  44. package/dist/index.d.ts +181 -41
  45. package/dist/index.js +693 -285
  46. package/dist/mcp/run-stdio.cjs +10469 -9896
  47. package/dist/mcp/run-stdio.js +193 -168
  48. package/dist/{orchestrator-VLTO5JBR.js → orchestrator-4JSG7BWC.js} +5 -5
  49. package/dist/{orchestrator-OCG4QVA5.js → orchestrator-5YU46YNS.js} +11 -10
  50. package/dist/{workspaces-I7TWFTJM.js → workspaces-QJ3XIPUJ.js} +6 -6
  51. package/dist/{workspaces-2XTDS7N2.js → workspaces-WOQHJFRQ.js} +3 -3
  52. package/dist/{worktree-DDDF3WHV.js → worktree-6U2FA5LO.js} +2 -2
  53. package/dist/{worktree-YASFE65H.js → worktree-KQA4ON2G.js} +5 -5
  54. package/package.json +4 -3
  55. /package/dist/{chunk-LDXSAVWO.js → chunk-GWFVCCJZ.js} +0 -0
@@ -47,11 +47,12 @@ import {
47
47
  resolveLoginCommand,
48
48
  resolveQuotaFallbackAgent,
49
49
  whichOnPath
50
- } from "./chunk-ABPNIYRS.js";
51
- import "./chunk-X2OTZ36G.js";
52
- import "./chunk-U3AOJLH3.js";
50
+ } from "./chunk-3H7O27X2.js";
51
+ import "./chunk-GWFVCCJZ.js";
52
+ import "./chunk-RKPBIB2U.js";
53
+ import "./chunk-5ZPT5YAV.js";
54
+ import "./chunk-FWNL62VA.js";
53
55
  import "./chunk-2P4XKWV2.js";
54
- import "./chunk-LDXSAVWO.js";
55
56
  import "./chunk-ROPGQRPU.js";
56
57
  import "./chunk-N7WZ6NIN.js";
57
58
  import {
@@ -62,8 +63,9 @@ import {
62
63
  preferredCursorCostCents,
63
64
  resolveCursorSdkRoot,
64
65
  turnCostUsdFromCursorUsage
65
- } from "./chunk-WV7KJH2E.js";
66
+ } from "./chunk-A5SAYFJ4.js";
66
67
  import "./chunk-6K64FJDD.js";
68
+ import "./chunk-UWQ6UCIB.js";
67
69
  import {
68
70
  conductorBundledBinDir,
69
71
  enrichPathWithNpmGlobalBin,
@@ -75,19 +77,18 @@ import {
75
77
  resolveCommandBinarySync,
76
78
  withExportedPath
77
79
  } from "./chunk-QVN2WOKJ.js";
80
+ import "./chunk-NYBFYFK7.js";
78
81
  import {
79
82
  ORCHESTRATOR_AGENT_KINDS,
80
83
  assertOrchestratorCapableAgent,
81
84
  coerceOrchestratorAgent,
82
85
  isOrchestratorCapableAgent
83
- } from "./chunk-6PFZ6XO7.js";
86
+ } from "./chunk-2QUQH2SZ.js";
87
+ import "./chunk-77WWLBCI.js";
84
88
  import "./chunk-4TR3HZFT.js";
85
89
  import "./chunk-WDRMZKVB.js";
86
90
  import "./chunk-3HO2OY5T.js";
87
91
  import "./chunk-JT7R45JB.js";
88
- import "./chunk-FWNL62VA.js";
89
- import "./chunk-UWQ6UCIB.js";
90
- import "./chunk-77WWLBCI.js";
91
92
  import "./chunk-EHT2DRT4.js";
92
93
  export {
93
94
  CLAUDE_MODEL_CATALOG,
@@ -56,9 +56,9 @@ import {
56
56
  resolveQuotaFallbackAgent,
57
57
  turnCostUsdFromCursorUsage,
58
58
  whichOnPath
59
- } from "./chunk-4F7J6UWD.js";
60
- import "./chunk-JTNY5CK4.js";
61
- import "./chunk-FSZ7YYFQ.js";
59
+ } from "./chunk-EK3KVT7I.js";
60
+ import "./chunk-L5WGAIL2.js";
61
+ import "./chunk-4ALDX5IO.js";
62
62
  import "./chunk-N2WW62LF.js";
63
63
  import "./chunk-XAISOBBG.js";
64
64
  import "./chunk-P2BSMNHB.js";
@@ -80,7 +80,7 @@ import {
80
80
  assertOrchestratorCapableAgent,
81
81
  coerceOrchestratorAgent,
82
82
  isOrchestratorCapableAgent
83
- } from "./chunk-VIC6TDYT.js";
83
+ } from "./chunk-36FOBJBF.js";
84
84
  import "./chunk-NSTQ6QKD.js";
85
85
  import "./chunk-WWUABK6B.js";
86
86
  import "./chunk-FJZWM2ON.js";
@@ -108,7 +108,7 @@ import {
108
108
  updateProjectProfileSettings,
109
109
  usageOnLimit,
110
110
  writeViewerContext
111
- } from "./chunk-VIC6TDYT.js";
111
+ } from "./chunk-36FOBJBF.js";
112
112
  import "./chunk-NSTQ6QKD.js";
113
113
  import "./chunk-WWUABK6B.js";
114
114
  import "./chunk-FJZWM2ON.js";
@@ -106,12 +106,12 @@ import {
106
106
  updateProjectProfileSettings,
107
107
  usageOnLimit,
108
108
  writeViewerContext
109
- } from "./chunk-6PFZ6XO7.js";
109
+ } from "./chunk-2QUQH2SZ.js";
110
+ import "./chunk-77WWLBCI.js";
110
111
  import "./chunk-4TR3HZFT.js";
111
112
  import "./chunk-WDRMZKVB.js";
112
113
  import "./chunk-3HO2OY5T.js";
113
114
  import "./chunk-JT7R45JB.js";
114
- import "./chunk-77WWLBCI.js";
115
115
  import "./chunk-EHT2DRT4.js";
116
116
  export {
117
117
  AGENT_DONE_SOUNDS,
@@ -1,3 +1,6 @@
1
+ import {
2
+ normalizeThinkingEffort
3
+ } from "./chunk-77WWLBCI.js";
1
4
  import {
2
5
  stripNestedElectronEnv
3
6
  } from "./chunk-4TR3HZFT.js";
@@ -16,9 +19,6 @@ import {
16
19
  chmodOwnerOnly,
17
20
  writePrivateFile
18
21
  } from "./chunk-JT7R45JB.js";
19
- import {
20
- normalizeThinkingEffort
21
- } from "./chunk-77WWLBCI.js";
22
22
  import {
23
23
  appDataDir
24
24
  } from "./chunk-EHT2DRT4.js";
@@ -126,7 +126,7 @@ function compactNotes(notes, max = 160) {
126
126
  }
127
127
  function formatAccountProfilePlaybookLine(profile) {
128
128
  if (!profile.accountNotes) return "";
129
- return `- Account context (Settings \u2192 Agents): ${compactNotes(profile.accountNotes)}. When they ask to find work, use this with list_issues (tickets) and list_prs(queue=review) (reviews) and show the options. Only create_thread and start when they also asked to start. To change it, show the proposed text, ask_user (Save this context / Do not save), wait, then update_viewer_context(scope=account, confirmed=true).`;
129
+ return `- Account context (Settings \u2192 Agents): ${compactNotes(profile.accountNotes)}. When they ask to find work, use this with list_issues (tickets) and list_prs(queue=review) (reviews) and show the options. Only create_workspace and start when they also asked to start. To change it, show the proposed text, ask_user (Save this context / Do not save), wait, then update_viewer_context(scope=account, confirmed=true).`;
130
130
  }
131
131
  function formatProjectProfilePlaybookLines(projects) {
132
132
  const lines = projects.map((project) => {
@@ -390,6 +390,7 @@ function mergeUsage(a, b) {
390
390
  cacheReadTokens: sumOptional(a?.cacheReadTokens, b.cacheReadTokens),
391
391
  cacheWriteTokens: sumOptional(a?.cacheWriteTokens, b.cacheWriteTokens),
392
392
  costUsd: sumOptional(a?.costUsd, b.costUsd),
393
+ sessionCostUsd: b.sessionCostUsd ?? a?.sessionCostUsd,
393
394
  lastRequestTokens: b.lastRequestTokens ?? a?.lastRequestTokens
394
395
  };
395
396
  }
@@ -422,12 +423,17 @@ function hasBilledTokens(u) {
422
423
  function applyTurnUsage(current, incoming, scope = "request") {
423
424
  if (scope === "turn") {
424
425
  if (!hasBilledTokens(incoming) && current && incoming.costUsd != null) {
425
- return { ...current, costUsd: incoming.costUsd };
426
+ return {
427
+ ...current,
428
+ costUsd: incoming.costUsd,
429
+ ...incoming.sessionCostUsd != null ? { sessionCostUsd: incoming.sessionCostUsd } : {}
430
+ };
426
431
  }
427
432
  return {
428
433
  ...incoming,
429
434
  costUsd: incoming.costUsd ?? current?.costUsd,
430
- lastRequestTokens: current?.lastRequestTokens ?? requestOccupancy(incoming)
435
+ lastRequestTokens: current?.lastRequestTokens ?? requestOccupancy(incoming),
436
+ ...incoming.sessionCostUsd == null && current?.sessionCostUsd != null ? { sessionCostUsd: current.sessionCostUsd } : {}
431
437
  };
432
438
  }
433
439
  const merged = mergeUsage(current, incoming);
@@ -444,6 +450,72 @@ function contextTokens(u) {
444
450
  if (u.lastRequestTokens != null && u.lastRequestTokens > 0) return u.lastRequestTokens;
445
451
  return requestOccupancy(u);
446
452
  }
453
+ var USD_EPS = 1e-6;
454
+ function finiteUsd(n) {
455
+ if (n == null || !Number.isFinite(n)) return void 0;
456
+ return n;
457
+ }
458
+ function roundUsd(n) {
459
+ return Math.round(n * 1e8) / 1e8;
460
+ }
461
+ function approxEqualUsd(a, b) {
462
+ return Math.abs(a - b) <= Math.max(USD_EPS, Math.abs(a) * 1e-6, Math.abs(b) * 1e-6);
463
+ }
464
+ function previousCostBaseline(messages) {
465
+ let summed = 0;
466
+ let lastCost;
467
+ let lastSession;
468
+ for (const m of messages) {
469
+ if (m.role !== "agent" || !m.usage) continue;
470
+ const session = finiteUsd(m.usage.sessionCostUsd);
471
+ if (session != null) lastSession = session;
472
+ const cost = finiteUsd(m.usage.costUsd);
473
+ if (cost != null) {
474
+ summed += cost;
475
+ lastCost = cost;
476
+ }
477
+ }
478
+ return {
479
+ sessionCostUsd: lastSession ?? summed,
480
+ lastCostUsd: lastCost
481
+ };
482
+ }
483
+ function turnCostUsdFromProviderSnapshot(opts) {
484
+ const reported = finiteUsd(opts.reportedTurnCostUsd);
485
+ const session = finiteUsd(opts.sessionCostUsd);
486
+ const previous = Math.max(0, opts.previousSessionCostUsd || 0);
487
+ const last = finiteUsd(opts.previousLastCostUsd);
488
+ if (session != null) {
489
+ const looksLikeSessionTotal = reported == null || approxEqualUsd(reported, session);
490
+ if (looksLikeSessionTotal) {
491
+ if (session + USD_EPS >= previous) {
492
+ return roundUsd(Math.max(0, session - previous));
493
+ }
494
+ if (last != null && session + USD_EPS >= last) {
495
+ return roundUsd(Math.max(0, session - last));
496
+ }
497
+ return void 0;
498
+ }
499
+ }
500
+ return reported;
501
+ }
502
+ function withTurnScopedCost(usage, previousMessages) {
503
+ const baseline = previousCostBaseline(previousMessages);
504
+ const costUsd = turnCostUsdFromProviderSnapshot({
505
+ reportedTurnCostUsd: usage.costUsd,
506
+ sessionCostUsd: usage.sessionCostUsd,
507
+ previousSessionCostUsd: baseline.sessionCostUsd,
508
+ previousLastCostUsd: baseline.lastCostUsd
509
+ });
510
+ if (costUsd == null) {
511
+ if (usage.costUsd == null) return usage;
512
+ const next = { ...usage };
513
+ delete next.costUsd;
514
+ return next;
515
+ }
516
+ if (usage.costUsd === costUsd) return usage;
517
+ return { ...usage, costUsd };
518
+ }
447
519
 
448
520
  // src/store/history-retention.ts
449
521
  var HISTORY_MAX_COUNT_DEFAULT = 200;
@@ -2247,6 +2319,9 @@ export {
2247
2319
  applyTurnUsage,
2248
2320
  totalTokens,
2249
2321
  contextTokens,
2322
+ previousCostBaseline,
2323
+ turnCostUsdFromProviderSnapshot,
2324
+ withTurnScopedCost,
2250
2325
  HISTORY_MAX_COUNT_DEFAULT,
2251
2326
  HISTORY_MAX_COUNT_MIN,
2252
2327
  HISTORY_MAX_COUNT_MAX,
@@ -128,7 +128,7 @@ function compactNotes(notes, max = 160) {
128
128
  }
129
129
  function formatAccountProfilePlaybookLine(profile) {
130
130
  if (!profile.accountNotes) return "";
131
- return `- Account context (Settings \u2192 Agents): ${compactNotes(profile.accountNotes)}. When they ask to find work, use this with list_issues (tickets) and list_prs(queue=review) (reviews) and show the options. Only create_thread and start when they also asked to start. To change it, show the proposed text, ask_user (Save this context / Do not save), wait, then update_viewer_context(scope=account, confirmed=true).`;
131
+ return `- Account context (Settings \u2192 Agents): ${compactNotes(profile.accountNotes)}. When they ask to find work, use this with list_issues (tickets) and list_prs(queue=review) (reviews) and show the options. Only create_workspace and start when they also asked to start. To change it, show the proposed text, ask_user (Save this context / Do not save), wait, then update_viewer_context(scope=account, confirmed=true).`;
132
132
  }
133
133
  function formatProjectProfilePlaybookLines(projects) {
134
134
  const lines = projects.map((project) => {
@@ -375,6 +375,7 @@ function mergeUsage(a, b) {
375
375
  cacheReadTokens: sumOptional(a?.cacheReadTokens, b.cacheReadTokens),
376
376
  cacheWriteTokens: sumOptional(a?.cacheWriteTokens, b.cacheWriteTokens),
377
377
  costUsd: sumOptional(a?.costUsd, b.costUsd),
378
+ sessionCostUsd: b.sessionCostUsd ?? a?.sessionCostUsd,
378
379
  lastRequestTokens: b.lastRequestTokens ?? a?.lastRequestTokens
379
380
  };
380
381
  }
@@ -407,12 +408,17 @@ function hasBilledTokens(u) {
407
408
  function applyTurnUsage(current, incoming, scope = "request") {
408
409
  if (scope === "turn") {
409
410
  if (!hasBilledTokens(incoming) && current && incoming.costUsd != null) {
410
- return { ...current, costUsd: incoming.costUsd };
411
+ return {
412
+ ...current,
413
+ costUsd: incoming.costUsd,
414
+ ...incoming.sessionCostUsd != null ? { sessionCostUsd: incoming.sessionCostUsd } : {}
415
+ };
411
416
  }
412
417
  return {
413
418
  ...incoming,
414
419
  costUsd: incoming.costUsd ?? current?.costUsd,
415
- lastRequestTokens: current?.lastRequestTokens ?? requestOccupancy(incoming)
420
+ lastRequestTokens: current?.lastRequestTokens ?? requestOccupancy(incoming),
421
+ ...incoming.sessionCostUsd == null && current?.sessionCostUsd != null ? { sessionCostUsd: current.sessionCostUsd } : {}
416
422
  };
417
423
  }
418
424
  const merged = mergeUsage(current, incoming);
@@ -426,6 +432,72 @@ function contextTokens(u) {
426
432
  if (u.lastRequestTokens != null && u.lastRequestTokens > 0) return u.lastRequestTokens;
427
433
  return requestOccupancy(u);
428
434
  }
435
+ var USD_EPS = 1e-6;
436
+ function finiteUsd(n) {
437
+ if (n == null || !Number.isFinite(n)) return void 0;
438
+ return n;
439
+ }
440
+ function roundUsd(n) {
441
+ return Math.round(n * 1e8) / 1e8;
442
+ }
443
+ function approxEqualUsd(a, b) {
444
+ return Math.abs(a - b) <= Math.max(USD_EPS, Math.abs(a) * 1e-6, Math.abs(b) * 1e-6);
445
+ }
446
+ function previousCostBaseline(messages) {
447
+ let summed = 0;
448
+ let lastCost;
449
+ let lastSession;
450
+ for (const m of messages) {
451
+ if (m.role !== "agent" || !m.usage) continue;
452
+ const session = finiteUsd(m.usage.sessionCostUsd);
453
+ if (session != null) lastSession = session;
454
+ const cost = finiteUsd(m.usage.costUsd);
455
+ if (cost != null) {
456
+ summed += cost;
457
+ lastCost = cost;
458
+ }
459
+ }
460
+ return {
461
+ sessionCostUsd: lastSession ?? summed,
462
+ lastCostUsd: lastCost
463
+ };
464
+ }
465
+ function turnCostUsdFromProviderSnapshot(opts) {
466
+ const reported = finiteUsd(opts.reportedTurnCostUsd);
467
+ const session = finiteUsd(opts.sessionCostUsd);
468
+ const previous = Math.max(0, opts.previousSessionCostUsd || 0);
469
+ const last = finiteUsd(opts.previousLastCostUsd);
470
+ if (session != null) {
471
+ const looksLikeSessionTotal = reported == null || approxEqualUsd(reported, session);
472
+ if (looksLikeSessionTotal) {
473
+ if (session + USD_EPS >= previous) {
474
+ return roundUsd(Math.max(0, session - previous));
475
+ }
476
+ if (last != null && session + USD_EPS >= last) {
477
+ return roundUsd(Math.max(0, session - last));
478
+ }
479
+ return void 0;
480
+ }
481
+ }
482
+ return reported;
483
+ }
484
+ function withTurnScopedCost(usage, previousMessages) {
485
+ const baseline = previousCostBaseline(previousMessages);
486
+ const costUsd = turnCostUsdFromProviderSnapshot({
487
+ reportedTurnCostUsd: usage.costUsd,
488
+ sessionCostUsd: usage.sessionCostUsd,
489
+ previousSessionCostUsd: baseline.sessionCostUsd,
490
+ previousLastCostUsd: baseline.lastCostUsd
491
+ });
492
+ if (costUsd == null) {
493
+ if (usage.costUsd == null) return usage;
494
+ const next = { ...usage };
495
+ delete next.costUsd;
496
+ return next;
497
+ }
498
+ if (usage.costUsd === costUsd) return usage;
499
+ return { ...usage, costUsd };
500
+ }
429
501
 
430
502
  // src/store/history-retention.ts
431
503
  var HISTORY_MAX_COUNT_DEFAULT = 200;
@@ -2222,6 +2294,7 @@ export {
2222
2294
  sumUsageList,
2223
2295
  applyTurnUsage,
2224
2296
  contextTokens,
2297
+ withTurnScopedCost,
2225
2298
  HISTORY_CLEANUP_INTERVAL_HOURS_DEFAULT,
2226
2299
  historyRetentionStubMessage,
2227
2300
  planHistoryRetention,