orbit-code-ai 0.1.37 → 0.1.38

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 (2) hide show
  1. package/dist/cli.mjs +52 -38
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -83792,7 +83792,7 @@ async function printStartupScreen() {
83792
83792
  const sLen = ` ● ${sL} Ready — type /help to begin`.length;
83793
83793
  out.push(boxRow(sRow, W2, sLen));
83794
83794
  out.push(`${rgb(...BORDER)}╚${"═".repeat(W2 - 2)}╝${RESET}`);
83795
- out.push(` ${DIM}${rgb(...DIMCOL)}orbit-code ${RESET}${rgb(...ACCENT)}v${"0.1.37"}${RESET}`);
83795
+ out.push(` ${DIM}${rgb(...DIMCOL)}orbit-code ${RESET}${rgb(...ACCENT)}v${"0.1.38"}${RESET}`);
83796
83796
  out.push("");
83797
83797
  process.stdout.write(out.join(`
83798
83798
  `) + `
@@ -334299,7 +334299,7 @@ function getAnthropicEnvMetadata() {
334299
334299
  function getBuildAgeMinutes() {
334300
334300
  if (false)
334301
334301
  ;
334302
- const buildTime = new Date("2026-07-01T13:35:22.092Z").getTime();
334302
+ const buildTime = new Date("2026-07-09T12:17:41.680Z").getTime();
334303
334303
  if (isNaN(buildTime))
334304
334304
  return;
334305
334305
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -358716,7 +358716,7 @@ function buildPrimarySection() {
358716
358716
  }, undefined, false, undefined, this);
358717
358717
  return [{
358718
358718
  label: "Version",
358719
- value: "0.1.37"
358719
+ value: "0.1.38"
358720
358720
  }, {
358721
358721
  label: "Session name",
358722
358722
  value: nameValue
@@ -448476,7 +448476,7 @@ function readState() {
448476
448476
  if (typeof parsed.p !== "string" || typeof parsed.c !== "number") {
448477
448477
  return fresh;
448478
448478
  }
448479
- return { p: parsed.p, c: Math.max(0, Math.floor(parsed.c)) };
448479
+ return { p: parsed.p, c: Math.max(0, parsed.c) };
448480
448480
  } catch {
448481
448481
  return fresh;
448482
448482
  }
@@ -448490,34 +448490,37 @@ function writeState(state2) {
448490
448490
  } catch {}
448491
448491
  }
448492
448492
  function buildMessage(period) {
448493
- return `You've reached this build's monthly usage limit (${USAGE_CAP} turns for ${period}). It resets on ${resetDateLabel()}. Contact ${ADMIN_CONTACT} if you need more.`;
448493
+ return `You've reached this build's monthly usage limit (${USAGE_CAP} for ${period}). It resets on ${resetDateLabel()}. Contact ${ADMIN_CONTACT} if you need more.`;
448494
448494
  }
448495
- function recordTurnAndCheck() {
448495
+ function unitsForCost(costUSD) {
448496
+ if (!(costUSD > 0))
448497
+ return 1;
448498
+ if (costUSD < 0.1)
448499
+ return 1;
448500
+ if (costUSD < 0.5)
448501
+ return 1.5;
448502
+ return 2 + Math.floor((costUSD - 0.5) / 0.5) * 0.5;
448503
+ }
448504
+ function checkUsageAllowed() {
448505
+ return getUsageStatus();
448506
+ }
448507
+ function recordTurnCost(costUSD) {
448496
448508
  const period = currentPeriod();
448497
448509
  const state2 = readState();
448498
448510
  if (state2.p !== period) {
448499
448511
  state2.p = period;
448500
448512
  state2.c = 0;
448501
448513
  }
448502
- if (state2.c >= USAGE_CAP) {
448503
- return {
448504
- allowed: false,
448505
- count: state2.c,
448506
- cap: USAGE_CAP,
448507
- remaining: 0,
448508
- periodKey: period,
448509
- message: buildMessage(period)
448510
- };
448511
- }
448512
- state2.c += 1;
448514
+ state2.c = state2.c + unitsForCost(costUSD);
448513
448515
  writeState(state2);
448514
448516
  notifyUsageListeners();
448515
448517
  return {
448516
- allowed: true,
448518
+ allowed: state2.c < USAGE_CAP,
448517
448519
  count: state2.c,
448518
448520
  cap: USAGE_CAP,
448519
448521
  remaining: Math.max(0, USAGE_CAP - state2.c),
448520
- periodKey: period
448522
+ periodKey: period,
448523
+ ...state2.c >= USAGE_CAP ? { message: buildMessage(period) } : {}
448521
448524
  };
448522
448525
  }
448523
448526
  function getUsageStatus() {
@@ -448542,6 +448545,9 @@ var init_usageCap = __esm(() => {
448542
448545
  });
448543
448546
 
448544
448547
  // src/components/UsageBar.tsx
448548
+ function fmt(n2) {
448549
+ return Number.isInteger(n2) ? String(n2) : n2.toFixed(1);
448550
+ }
448545
448551
  function UsageBar() {
448546
448552
  const [status2, setStatus] = import_react230.useState(getUsageStatus);
448547
448553
  import_react230.useEffect(() => subscribeUsage(() => setStatus(getUsageStatus())), []);
@@ -448577,11 +448583,11 @@ function UsageBar() {
448577
448583
  dimColor: true,
448578
448584
  children: [
448579
448585
  " ",
448580
- count4,
448586
+ fmt(count4),
448581
448587
  "/",
448582
448588
  cap,
448583
448589
  " · ",
448584
- remaining,
448590
+ fmt(remaining),
448585
448591
  " left"
448586
448592
  ]
448587
448593
  }, undefined, true, undefined, this)
@@ -456147,18 +456153,25 @@ async function executeUserInput(params) {
456147
456153
  const primaryInput = primaryCmd && typeof primaryCmd.value === "string" ? primaryCmd.value : undefined;
456148
456154
  const shouldCallBeforeQuery = primaryMode === "prompt";
456149
456155
  let effectiveShouldQuery = shouldQuery;
456156
+ let costAtTurnStart = null;
456150
456157
  if (shouldQuery) {
456151
- const usage = recordTurnAndCheck();
456152
- if (!usage.allowed) {
456158
+ const gate = checkUsageAllowed();
456159
+ if (!gate.allowed) {
456153
456160
  effectiveShouldQuery = false;
456154
456161
  addNotification?.({
456155
456162
  key: "usage-cap-reached",
456156
- text: usage.message ?? "Usage limit reached.",
456163
+ text: gate.message ?? "Usage limit reached.",
456157
456164
  priority: "immediate"
456158
456165
  });
456166
+ } else {
456167
+ costAtTurnStart = getTotalCostUSD();
456159
456168
  }
456160
456169
  }
456161
456170
  await onQuery(newMessages, abortController, effectiveShouldQuery, allowedTools ?? [], model ? resolveSkillModelOverride(model, mainLoopModel) : resolveExecutionModel(mainLoopModel), shouldCallBeforeQuery ? onBeforeQuery : undefined, primaryInput, effort);
456171
+ if (costAtTurnStart !== null) {
456172
+ const turnCost = Math.max(0, getTotalCostUSD() - costAtTurnStart);
456173
+ recordTurnCost(turnCost);
456174
+ }
456162
456175
  } else {
456163
456176
  queryGuard.cancelReservation();
456164
456177
  setToolJSX({
@@ -456193,6 +456206,7 @@ var init_handlePromptSubmit = __esm(() => {
456193
456206
  init_messageQueueManager();
456194
456207
  init_model();
456195
456208
  init_processUserInput();
456209
+ init_state();
456196
456210
  init_queryProfiler();
456197
456211
  init_usageCap();
456198
456212
  init_workloadContext();
@@ -471011,7 +471025,7 @@ function WelcomeV2() {
471011
471025
  dimColor: true,
471012
471026
  children: [
471013
471027
  "v",
471014
- "0.1.37",
471028
+ "0.1.38",
471015
471029
  " "
471016
471030
  ]
471017
471031
  }, undefined, true, undefined, this)
@@ -471211,7 +471225,7 @@ function WelcomeV2() {
471211
471225
  dimColor: true,
471212
471226
  children: [
471213
471227
  "v",
471214
- "0.1.37",
471228
+ "0.1.38",
471215
471229
  " "
471216
471230
  ]
471217
471231
  }, undefined, true, undefined, this)
@@ -471437,7 +471451,7 @@ function AppleTerminalWelcomeV2(t0) {
471437
471451
  dimColor: true,
471438
471452
  children: [
471439
471453
  "v",
471440
- "0.1.37",
471454
+ "0.1.38",
471441
471455
  " "
471442
471456
  ]
471443
471457
  }, undefined, true, undefined, this);
@@ -471691,7 +471705,7 @@ function AppleTerminalWelcomeV2(t0) {
471691
471705
  dimColor: true,
471692
471706
  children: [
471693
471707
  "v",
471694
- "0.1.37",
471708
+ "0.1.38",
471695
471709
  " "
471696
471710
  ]
471697
471711
  }, undefined, true, undefined, this);
@@ -478543,8 +478557,8 @@ var require_sprintf = __commonJS((exports) => {
478543
478557
  function sprintf(key) {
478544
478558
  return sprintf_format(sprintf_parse(key), arguments);
478545
478559
  }
478546
- function vsprintf(fmt, argv) {
478547
- return sprintf.apply(null, [fmt].concat(argv || []));
478560
+ function vsprintf(fmt2, argv) {
478561
+ return sprintf.apply(null, [fmt2].concat(argv || []));
478548
478562
  }
478549
478563
  function sprintf_format(parse_tree, argv) {
478550
478564
  var cursor = 1, tree_length = parse_tree.length, arg, output = "", i3, k, ph, pad, pad_character, pad_length, is_positive, sign;
@@ -478646,11 +478660,11 @@ var require_sprintf = __commonJS((exports) => {
478646
478660
  return output;
478647
478661
  }
478648
478662
  var sprintf_cache = Object.create(null);
478649
- function sprintf_parse(fmt) {
478650
- if (sprintf_cache[fmt]) {
478651
- return sprintf_cache[fmt];
478663
+ function sprintf_parse(fmt2) {
478664
+ if (sprintf_cache[fmt2]) {
478665
+ return sprintf_cache[fmt2];
478652
478666
  }
478653
- var _fmt = fmt, match, parse_tree = [], arg_names = 0;
478667
+ var _fmt = fmt2, match, parse_tree = [], arg_names = 0;
478654
478668
  while (_fmt) {
478655
478669
  if ((match = re.text.exec(_fmt)) !== null) {
478656
478670
  parse_tree.push(match[0]);
@@ -478697,7 +478711,7 @@ var require_sprintf = __commonJS((exports) => {
478697
478711
  }
478698
478712
  _fmt = _fmt.substring(match[0].length);
478699
478713
  }
478700
- return sprintf_cache[fmt] = parse_tree;
478714
+ return sprintf_cache[fmt2] = parse_tree;
478701
478715
  }
478702
478716
  if (typeof exports !== "undefined") {
478703
478717
  exports.sprintf = sprintf;
@@ -527410,7 +527424,7 @@ Usage: orbit --remote "your task description"`, () => gracefulShutdown(1));
527410
527424
  pendingHookMessages
527411
527425
  }, renderAndRun);
527412
527426
  }
527413
- }).version("0.1.37 (Orbit AI)", "-v, --version", "Output the version number");
527427
+ }).version("0.1.38 (Orbit AI)", "-v, --version", "Output the version number");
527414
527428
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
527415
527429
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
527416
527430
  if (canUserConfigureAdvisor()) {
@@ -527932,7 +527946,7 @@ if (false) {}
527932
527946
  async function main2() {
527933
527947
  const args = process.argv.slice(2);
527934
527948
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
527935
- console.log(`${"0.1.37"} (Orbit AI)`);
527949
+ console.log(`${"0.1.38"} (Orbit AI)`);
527936
527950
  return;
527937
527951
  }
527938
527952
  if (args.includes("--provider")) {
@@ -528040,4 +528054,4 @@ async function main2() {
528040
528054
  }
528041
528055
  main2();
528042
528056
 
528043
- //# debugId=501C8BF8CD9E779664756E2164756E21
528057
+ //# debugId=915C704C919EC95E64756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orbit-code-ai",
3
- "version": "0.1.37",
3
+ "version": "0.1.38",
4
4
  "description": "Orbit AI – Your AI-powered IBM ACE coding companion",
5
5
  "type": "module",
6
6
  "author": "moenawaf",