billion-context-omp 0.1.1 → 0.1.2

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.
package/dist/index.js CHANGED
@@ -3003,6 +3003,10 @@ function boundaryRaw(ref, byRef, blocks, pick) {
3003
3003
  const pos = (id) => rawPos(byRef[id] ?? id);
3004
3004
  return pick === "min" ? ids.reduce((a, b) => pos(a) <= pos(b) ? a : b) : ids.reduce((a, b) => pos(a) >= pos(b) ? a : b);
3005
3005
  }
3006
+ var VIABLE_RANGE_MIN_TOKENS = 200;
3007
+ function viableRanges(ranges) {
3008
+ return ranges.filter((r) => r.tokens >= VIABLE_RANGE_MIN_TOKENS);
3009
+ }
3006
3010
  function rangeFingerprints(ranges, coreMessages, byRef, blocks) {
3007
3011
  return ranges.map((r) => {
3008
3012
  const start = boundaryRaw(r.startRef, byRef, blocks, "min");
@@ -3665,7 +3669,7 @@ async function handleStatus(args, runtime, ctx) {
3665
3669
  });
3666
3670
  if (args.scope) return base;
3667
3671
  const nudge = turn.nudge;
3668
- const ranges = nudge?.compressibleRanges ?? [];
3672
+ const ranges = viableRanges(nudge?.compressibleRanges ?? []);
3669
3673
  const protectedRanges = nudge?.protectedRanges ?? [];
3670
3674
  const extra = [];
3671
3675
  if (nudge) {
@@ -3811,7 +3815,7 @@ async function statusReport(runtime, ctx) {
3811
3815
  const activeBlocksList = state.blocks.filter((b) => b.active);
3812
3816
  const totalBlocksList = state.blocks;
3813
3817
  const lines = [];
3814
- const versionStr = "0.1.1" ? `billion-context-omp@${"0.1.1"}` : "";
3818
+ const versionStr = "0.1.2" ? `billion-context-omp@${"0.1.2"}` : "";
3815
3819
  lines.push("\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E");
3816
3820
  lines.push("\u2502 ACP Context Analysis \u2502");
3817
3821
  lines.push("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F");
@@ -4287,7 +4291,7 @@ async function checkForUpdate(autoUpdate, notify) {
4287
4291
  const data = await res.json();
4288
4292
  const latest = data.version;
4289
4293
  if (!latest) return;
4290
- const current = runtimeVersion ?? "0.1.1";
4294
+ const current = runtimeVersion ?? "0.1.2";
4291
4295
  const hasUpdate = isNewer(latest, current);
4292
4296
  debug.event("update-check", {
4293
4297
  current,
@@ -4575,7 +4579,7 @@ function wireCompactionDisable(pi, runtime) {
4575
4579
  function wireSessionLifecycle(pi, runtime) {
4576
4580
  pi.on("session_start", async (_event, ctx) => {
4577
4581
  const sid = ctx.sessionManager.getSessionId();
4578
- logInfo("session", { event: "start", sid, cwd: ctx.cwd, debug: runtime.adapter.debug ?? null, version: true ? "0.1.1" : null });
4582
+ logInfo("session", { event: "start", sid, cwd: ctx.cwd, debug: runtime.adapter.debug ?? null, version: true ? "0.1.2" : null });
4579
4583
  try {
4580
4584
  const user = await loadUserConfig(ctx.cwd);
4581
4585
  runtime.setAdapter(applyUserConfig(runtime.adapter, user));
@@ -4672,6 +4676,7 @@ function wireContextTransform(pi, runtime) {
4672
4676
  if (turn.nudge?.shouldInject) {
4673
4677
  const emergency = turn.nudge.breakdown?.emergencyOverride === 1;
4674
4678
  {
4679
+ turn.nudge.compressibleRanges = viableRanges(turn.nudge.compressibleRanges);
4675
4680
  const rendered = renderNudgeText(turn.nudge, runtime.prompts);
4676
4681
  const top = [...turn.nudge.compressibleRanges].sort((a, b) => b.tokens - a.tokens)[0];
4677
4682
  const example = top ? `