@ponythewhite/base-context 1.0.11 → 1.0.13

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 (80) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/base-context-runtime/pyproject.toml +1 -1
  3. package/dist/base-context-runtime/uv.lock +1 -1
  4. package/dist/build-info.json +1 -1
  5. package/dist/bundle/amazon-bedrock.js +3 -3
  6. package/dist/bundle/{anthropic-5PSCZEER.js → anthropic-BJVPUMPB.js} +2 -2
  7. package/dist/bundle/{azure-openai-responses-AYTLJR33.js → azure-openai-responses-ERRMAXK6.js} +4 -5
  8. package/dist/bundle/{bundled-modules-PEFT72QN.js → bundled-modules-URKVA3UB.js} +5 -5
  9. package/dist/bundle/{chunk-D3KOF57W.js → chunk-25VYRAC6.js} +14 -1
  10. package/dist/bundle/{chunk-2IPDSTDR.js → chunk-AEMRBMI2.js} +9 -9
  11. package/dist/bundle/{chunk-Q3MBSBEB.js → chunk-FOGKLC7V.js} +1 -1
  12. package/dist/bundle/{chunk-KT2BNEPE.js → chunk-MUFZODP5.js} +1 -1
  13. package/dist/bundle/{chunk-QKIFBA7N.js → chunk-Q6UAHLII.js} +2 -2
  14. package/dist/bundle/{chunk-TOOVREMP.js → chunk-TKOBEJ5E.js} +515 -107
  15. package/dist/bundle/{chunk-JZHGOOFM.js → chunk-TXVF6Q5H.js} +118 -22
  16. package/dist/bundle/{cli-main-BRXGYTGK.js → cli-main-ZTJM5EEH.js} +4 -4
  17. package/dist/bundle/cli.js +1 -1
  18. package/dist/bundle/{google-HTMCUJ7X.js → google-4GA4YMUX.js} +2 -2
  19. package/dist/bundle/{google-vertex-ZQO65AXF.js → google-vertex-7AMALD7D.js} +2 -2
  20. package/dist/bundle/{main-POUXGEL6.js → main-53I74INO.js} +5 -5
  21. package/dist/bundle/{mistral-SB7LU56G.js → mistral-74BXMNRM.js} +1 -1
  22. package/dist/bundle/{openai-codex-responses-5CEW4VN3.js → openai-codex-responses-COXNC4IH.js} +2 -2
  23. package/dist/bundle/{openai-completions-BAZJQSS2.js → openai-completions-BCSA5Q6S.js} +2 -2
  24. package/dist/bundle/{openai-responses-VHOE427P.js → openai-responses-ONCIZSJS.js} +3 -3
  25. package/dist/core/agent-session.d.ts +6 -0
  26. package/dist/core/agent-session.d.ts.map +1 -1
  27. package/dist/core/agent-session.js +362 -103
  28. package/dist/core/agent-session.js.map +1 -1
  29. package/dist/core/compaction/compaction.d.ts +9 -1
  30. package/dist/core/compaction/compaction.d.ts.map +1 -1
  31. package/dist/core/compaction/compaction.js +29 -3
  32. package/dist/core/compaction/compaction.js.map +1 -1
  33. package/dist/core/context-tree.d.ts +13 -10
  34. package/dist/core/context-tree.d.ts.map +1 -1
  35. package/dist/core/context-tree.js +49 -3
  36. package/dist/core/context-tree.js.map +1 -1
  37. package/dist/core/inference-coordinator.d.ts +1 -1
  38. package/dist/core/inference-coordinator.d.ts.map +1 -1
  39. package/dist/core/inference-coordinator.js +18 -5
  40. package/dist/core/inference-coordinator.js.map +1 -1
  41. package/dist/core/messages.d.ts +2 -0
  42. package/dist/core/messages.d.ts.map +1 -1
  43. package/dist/core/messages.js +2 -0
  44. package/dist/core/messages.js.map +1 -1
  45. package/dist/core/refinement/refinement.d.ts +2 -0
  46. package/dist/core/refinement/refinement.d.ts.map +1 -1
  47. package/dist/core/refinement/refinement.js +10 -1
  48. package/dist/core/refinement/refinement.js.map +1 -1
  49. package/dist/core/request-usage.d.ts +34 -0
  50. package/dist/core/request-usage.d.ts.map +1 -0
  51. package/dist/core/request-usage.js +111 -0
  52. package/dist/core/request-usage.js.map +1 -0
  53. package/dist/core/settings-manager.d.ts +3 -0
  54. package/dist/core/settings-manager.d.ts.map +1 -1
  55. package/dist/core/settings-manager.js +7 -0
  56. package/dist/core/settings-manager.js.map +1 -1
  57. package/dist/core/system-prompt.d.ts +2 -0
  58. package/dist/core/system-prompt.d.ts.map +1 -1
  59. package/dist/core/system-prompt.js +4 -2
  60. package/dist/core/system-prompt.js.map +1 -1
  61. package/dist/modes/agent-connection/daemon-agent-connection.d.ts.map +1 -1
  62. package/dist/modes/agent-connection/daemon-agent-connection.js +8 -1
  63. package/dist/modes/agent-connection/daemon-agent-connection.js.map +1 -1
  64. package/dist/modes/daemon/daemon-protocol.d.ts +13 -3
  65. package/dist/modes/daemon/daemon-protocol.d.ts.map +1 -1
  66. package/dist/modes/daemon/daemon-protocol.js +10 -2
  67. package/dist/modes/daemon/daemon-protocol.js.map +1 -1
  68. package/dist/modes/daemon/daemon-session-summarizer.d.ts +3 -0
  69. package/dist/modes/daemon/daemon-session-summarizer.d.ts.map +1 -1
  70. package/dist/modes/daemon/daemon-session-summarizer.js +71 -32
  71. package/dist/modes/daemon/daemon-session-summarizer.js.map +1 -1
  72. package/dist/modes/interactive/components/context-tree-format.d.ts.map +1 -1
  73. package/dist/modes/interactive/components/context-tree-format.js +49 -0
  74. package/dist/modes/interactive/components/context-tree-format.js.map +1 -1
  75. package/docs/compaction.md +57 -4
  76. package/docs/context-management.md +23 -1
  77. package/docs/rlm.md +1 -1
  78. package/docs/settings.md +21 -0
  79. package/docs/usage.md +24 -1
  80. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.13] - 2026-09-21
4
+
5
+ - Changed the default automatic compaction target to 90% of the model context window, retaining required-context headroom, the output reserve, and earlier agent-requested compaction.
6
+
7
+ ## [1.0.12] - 2026-09-21
8
+
9
+ - Fixed compaction and recovery for primary RLM child requests.
10
+ - Fixed usage forwarding when retained children resumed, preserved new child attribution across restarts, and prevented nested usage from being counted twice.
11
+ - Added receipt-based per-purpose and captured-family token totals to `/context`, with explicit unknown usage and catalog-cost labels.
12
+ - Reduced repeated dashboard requests with unchanged-input reuse and one-minute refresh coalescing.
13
+ - Kept refinement advice current without rewriting the system prefix, and added stable cache identities for auxiliary requests.
14
+ - Added earlier model-aware compaction targets with headroom for required context and an explicit `model-limit` opt-out.
15
+ - Fixed child run status after terminal provider errors or cancellation.
16
+ - Added guidance to page long output and batch nonurgent agent updates.
17
+
3
18
  ## [1.0.11] - 2026-09-20
4
19
 
5
20
  - Fixed recovery compaction in long-running sessions that use `prime_context` without a request-budget profile.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "base-context-runtime"
3
- version = "1.0.11"
3
+ version = "1.0.13"
4
4
  description = "Kernel-side runtime shim for Base Context recursion"
5
5
  license = "MIT"
6
6
  license-files = ["LICENSE", "NOTICE"]
@@ -367,7 +367,7 @@ wheels = [
367
367
 
368
368
  [[package]]
369
369
  name = "base-context-runtime"
370
- version = "1.0.11"
370
+ version = "1.0.13"
371
371
  source = { editable = "." }
372
372
  dependencies = [
373
373
  { name = "mcp" },
@@ -1,5 +1,5 @@
1
1
  {
2
- "sourceCommit": "67d926ccc3c680e5197852b7ac34dd2cc69c61f9",
2
+ "sourceCommit": "c29f87f196ab576d986a95a2f3dd3feb3fc02a4a",
3
3
  "sourceDirty": false,
4
4
  "buildHost": {
5
5
  "platform": "linux",
@@ -1,14 +1,14 @@
1
1
  import { createRequire as __piBundleCreateRequire } from 'node:module'; const require = __piBundleCreateRequire(import.meta.url);
2
2
  import {
3
3
  writeFileLogEntry
4
- } from "./chunk-QKIFBA7N.js";
5
- import "./chunk-2IPDSTDR.js";
4
+ } from "./chunk-Q6UAHLII.js";
5
+ import "./chunk-AEMRBMI2.js";
6
6
  import "./chunk-5QCJ5DQU.js";
7
7
  import "./chunk-CRBVRZBV.js";
8
8
  import "./chunk-GRJFXLBM.js";
9
9
  import "./chunk-2T7M7VJ4.js";
10
10
  import "./chunk-DGNX7HQ3.js";
11
- import "./chunk-D3KOF57W.js";
11
+ import "./chunk-25VYRAC6.js";
12
12
  import "./chunk-BAWSWWEU.js";
13
13
 
14
14
  // dist/node/amazon-bedrock.js
@@ -36,7 +36,7 @@ import {
36
36
  streamFailureFromStopReason,
37
37
  streamFailureMessage,
38
38
  truncateRawPayload
39
- } from "./chunk-D3KOF57W.js";
39
+ } from "./chunk-25VYRAC6.js";
40
40
  import "./chunk-BAWSWWEU.js";
41
41
 
42
42
  // ../../node_modules/@anthropic-ai/sdk/internal/tslib.mjs
@@ -6595,7 +6595,7 @@ var streamAnthropic = (model, context, options) => {
6595
6595
  client = created.client;
6596
6596
  isOAuth = created.isOAuthToken;
6597
6597
  }
6598
- if (attempts.enabled) {
6598
+ if (attempts.enabled || options?.signal) {
6599
6599
  client = client.withOptions({});
6600
6600
  client.fetchWithTimeout = attempts.wrapHttp(client.fetchWithTimeout.bind(client));
6601
6601
  }
@@ -3,7 +3,7 @@ import {
3
3
  convertResponsesMessages,
4
4
  convertResponsesTools,
5
5
  processResponsesStream
6
- } from "./chunk-KT2BNEPE.js";
6
+ } from "./chunk-MUFZODP5.js";
7
7
  import "./chunk-NQB5DCFC.js";
8
8
  import {
9
9
  AzureOpenAI
@@ -25,7 +25,7 @@ import {
25
25
  formatStreamFailureMessage,
26
26
  recordStreamFailure,
27
27
  streamFailureFromStopReason
28
- } from "./chunk-D3KOF57W.js";
28
+ } from "./chunk-25VYRAC6.js";
29
29
  import "./chunk-BAWSWWEU.js";
30
30
 
31
31
  // ../ai/src/providers/azure-openai-responses.ts
@@ -74,9 +74,8 @@ var streamAzureOpenAIResponses = (model, context, options) => {
74
74
  };
75
75
  try {
76
76
  const apiKey = options?.apiKey || getEnvApiKey(model.provider) || "";
77
- let client = createClient(model, apiKey, options);
78
- if (attempts.enabled) {
79
- client = client.withOptions({});
77
+ const client = createClient(model, apiKey, options);
78
+ if (attempts.enabled || options?.signal) {
80
79
  client.fetchWithTimeout = attempts.wrapHttp(client.fetchWithTimeout.bind(client));
81
80
  }
82
81
  let params = buildParams(model, context, options, deploymentName);
@@ -51,7 +51,7 @@ import {
51
51
  oauth_exports,
52
52
  runPrintMode,
53
53
  runRpcMode
54
- } from "./chunk-JZHGOOFM.js";
54
+ } from "./chunk-TXVF6Q5H.js";
55
55
  import {
56
56
  AgentSession,
57
57
  CURRENT_SESSION_VERSION,
@@ -143,15 +143,15 @@ import {
143
143
  withFileMutationQueue,
144
144
  wrapRegisteredTool,
145
145
  wrapRegisteredTools
146
- } from "./chunk-TOOVREMP.js";
146
+ } from "./chunk-TKOBEJ5E.js";
147
147
  import "./chunk-CFNASUYO.js";
148
- import "./chunk-QKIFBA7N.js";
148
+ import "./chunk-Q6UAHLII.js";
149
149
  import {
150
150
  VERSION,
151
151
  build_exports,
152
152
  getAgentDir,
153
153
  src_exports
154
- } from "./chunk-2IPDSTDR.js";
154
+ } from "./chunk-AEMRBMI2.js";
155
155
  import "./chunk-5QCJ5DQU.js";
156
156
  import {
157
157
  compile_exports,
@@ -162,7 +162,7 @@ import "./chunk-2T7M7VJ4.js";
162
162
  import "./chunk-UIRUOAIQ.js";
163
163
  import "./chunk-HXOBFFJX.js";
164
164
  import "./chunk-DGNX7HQ3.js";
165
- import "./chunk-D3KOF57W.js";
165
+ import "./chunk-25VYRAC6.js";
166
166
  import {
167
167
  __export
168
168
  } from "./chunk-BAWSWWEU.js";
@@ -21668,8 +21668,18 @@ var ProviderAttemptTracker = class {
21668
21668
  }
21669
21669
  /** Wrap an SDK's single-send method, below its retry loop. */
21670
21670
  wrapHttp(send, operation) {
21671
- if (!this.enabled) return send;
21672
21671
  return async (...args) => {
21672
+ const requestInit = args[1];
21673
+ let signal;
21674
+ if (requestInit?.signal) {
21675
+ this.httpLifetime ??= new AbortController();
21676
+ signal = AbortSignal.any([requestInit.signal, this.httpLifetime.signal]);
21677
+ }
21678
+ if (signal) args[1] = { ...requestInit, signal };
21679
+ if (!this.enabled) {
21680
+ signal?.throwIfAborted();
21681
+ return send(...args);
21682
+ }
21673
21683
  if (operation === "input-count") this.options?.signal?.throwIfAborted();
21674
21684
  if (this.hasRequestBudget && operation !== "input-count") {
21675
21685
  const target = args[0];
@@ -21682,6 +21692,7 @@ var ProviderAttemptTracker = class {
21682
21692
  await this.begin("http", operation === "input-count" ? { kind: "input-count" } : {});
21683
21693
  let response;
21684
21694
  try {
21695
+ signal?.throwIfAborted();
21685
21696
  if (operation === "input-count") this.options?.signal?.throwIfAborted();
21686
21697
  this.sent();
21687
21698
  response = await send(...args);
@@ -21752,6 +21763,8 @@ var ProviderAttemptTracker = class {
21752
21763
  } catch (error) {
21753
21764
  output.stopReason = "error";
21754
21765
  output.errorMessage = `Attempt settlement failed: ${error instanceof Error ? error.message : String(error)}`;
21766
+ } finally {
21767
+ this.httpLifetime?.abort();
21755
21768
  }
21756
21769
  if (output.stopReason === "error" || output.stopReason === "aborted") {
21757
21770
  stream.push({ type: "error", reason: output.stopReason, error: output });
@@ -337,7 +337,7 @@ import {
337
337
  supportsFastMode,
338
338
  truncateRawPayload,
339
339
  withRequestBody
340
- } from "./chunk-D3KOF57W.js";
340
+ } from "./chunk-25VYRAC6.js";
341
341
  import {
342
342
  __export
343
343
  } from "./chunk-BAWSWWEU.js";
@@ -1948,7 +1948,7 @@ function createLazySimpleStream(loadModule) {
1948
1948
  };
1949
1949
  }
1950
1950
  function loadAnthropicProviderModule() {
1951
- anthropicProviderModulePromise ||= import("./anthropic-5PSCZEER.js").then((module) => {
1951
+ anthropicProviderModulePromise ||= import("./anthropic-BJVPUMPB.js").then((module) => {
1952
1952
  const provider = module;
1953
1953
  return {
1954
1954
  stream: provider.streamAnthropic,
@@ -1958,7 +1958,7 @@ function loadAnthropicProviderModule() {
1958
1958
  return anthropicProviderModulePromise;
1959
1959
  }
1960
1960
  function loadAzureOpenAIResponsesProviderModule() {
1961
- azureOpenAIResponsesProviderModulePromise ||= import("./azure-openai-responses-AYTLJR33.js").then((module) => {
1961
+ azureOpenAIResponsesProviderModulePromise ||= import("./azure-openai-responses-ERRMAXK6.js").then((module) => {
1962
1962
  const provider = module;
1963
1963
  return {
1964
1964
  stream: provider.streamAzureOpenAIResponses,
@@ -1968,7 +1968,7 @@ function loadAzureOpenAIResponsesProviderModule() {
1968
1968
  return azureOpenAIResponsesProviderModulePromise;
1969
1969
  }
1970
1970
  function loadGoogleProviderModule() {
1971
- googleProviderModulePromise ||= import("./google-HTMCUJ7X.js").then((module) => {
1971
+ googleProviderModulePromise ||= import("./google-4GA4YMUX.js").then((module) => {
1972
1972
  const provider = module;
1973
1973
  return {
1974
1974
  stream: provider.streamGoogle,
@@ -1978,7 +1978,7 @@ function loadGoogleProviderModule() {
1978
1978
  return googleProviderModulePromise;
1979
1979
  }
1980
1980
  function loadGoogleVertexProviderModule() {
1981
- googleVertexProviderModulePromise ||= import("./google-vertex-ZQO65AXF.js").then((module) => {
1981
+ googleVertexProviderModulePromise ||= import("./google-vertex-7AMALD7D.js").then((module) => {
1982
1982
  const provider = module;
1983
1983
  return {
1984
1984
  stream: provider.streamGoogleVertex,
@@ -1988,7 +1988,7 @@ function loadGoogleVertexProviderModule() {
1988
1988
  return googleVertexProviderModulePromise;
1989
1989
  }
1990
1990
  function loadMistralProviderModule() {
1991
- mistralProviderModulePromise ||= import("./mistral-SB7LU56G.js").then((module) => {
1991
+ mistralProviderModulePromise ||= import("./mistral-74BXMNRM.js").then((module) => {
1992
1992
  const provider = module;
1993
1993
  return {
1994
1994
  stream: provider.streamMistral,
@@ -1998,7 +1998,7 @@ function loadMistralProviderModule() {
1998
1998
  return mistralProviderModulePromise;
1999
1999
  }
2000
2000
  function loadOpenAICodexResponsesProviderModule() {
2001
- openAICodexResponsesProviderModulePromise ||= import("./openai-codex-responses-5CEW4VN3.js").then((module) => {
2001
+ openAICodexResponsesProviderModulePromise ||= import("./openai-codex-responses-COXNC4IH.js").then((module) => {
2002
2002
  const provider = module;
2003
2003
  return {
2004
2004
  stream: provider.streamOpenAICodexResponses,
@@ -2008,7 +2008,7 @@ function loadOpenAICodexResponsesProviderModule() {
2008
2008
  return openAICodexResponsesProviderModulePromise;
2009
2009
  }
2010
2010
  function loadOpenAICompletionsProviderModule() {
2011
- openAICompletionsProviderModulePromise ||= import("./openai-completions-BAZJQSS2.js").then((module) => {
2011
+ openAICompletionsProviderModulePromise ||= import("./openai-completions-BCSA5Q6S.js").then((module) => {
2012
2012
  const provider = module;
2013
2013
  return {
2014
2014
  stream: provider.streamOpenAICompletions,
@@ -2018,7 +2018,7 @@ function loadOpenAICompletionsProviderModule() {
2018
2018
  return openAICompletionsProviderModulePromise;
2019
2019
  }
2020
2020
  function loadOpenAIResponsesProviderModule() {
2021
- openAIResponsesProviderModulePromise ||= import("./openai-responses-VHOE427P.js").then((module) => {
2021
+ openAIResponsesProviderModulePromise ||= import("./openai-responses-ONCIZSJS.js").then((module) => {
2022
2022
  const provider = module;
2023
2023
  return {
2024
2024
  stream: provider.streamOpenAIResponses,
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-4GXPNXOJ.js";
6
6
  import {
7
7
  require_base64_js
8
- } from "./chunk-D3KOF57W.js";
8
+ } from "./chunk-25VYRAC6.js";
9
9
  import {
10
10
  __commonJS,
11
11
  __require,
@@ -14,7 +14,7 @@ import {
14
14
  calculateCost,
15
15
  classifyStreamFailure,
16
16
  withRequestBody
17
- } from "./chunk-D3KOF57W.js";
17
+ } from "./chunk-25VYRAC6.js";
18
18
 
19
19
  // ../ai/src/providers/openai-responses-shared.ts
20
20
  function encodeTextSignatureV1(id, phase) {
@@ -2,11 +2,11 @@ import { createRequire as __piBundleCreateRequire } from 'node:module'; const re
2
2
  import {
3
3
  appendRotatingLog,
4
4
  getAgentLogPath
5
- } from "./chunk-2IPDSTDR.js";
5
+ } from "./chunk-AEMRBMI2.js";
6
6
  import {
7
7
  setLogSink,
8
8
  stringifyLogEntry
9
- } from "./chunk-D3KOF57W.js";
9
+ } from "./chunk-25VYRAC6.js";
10
10
 
11
11
  // dist/core/logging.js
12
12
  var AGENT_LOG_MAX_BYTES = 20 * 1024 * 1024;