@ponythewhite/base-context 1.0.13 → 1.0.14

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 (60) hide show
  1. package/CHANGELOG.md +9 -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-BJVPUMPB.js → anthropic-AXUXEET7.js} +1 -1
  7. package/dist/bundle/{azure-openai-responses-ERRMAXK6.js → azure-openai-responses-J3NTJKEO.js} +2 -2
  8. package/dist/bundle/{bundled-modules-URKVA3UB.js → bundled-modules-UODO7ZR7.js} +5 -5
  9. package/dist/bundle/{chunk-FOGKLC7V.js → chunk-72LSQYUV.js} +1 -1
  10. package/dist/bundle/{chunk-MUFZODP5.js → chunk-EGFIZABJ.js} +1 -1
  11. package/dist/bundle/{chunk-AEMRBMI2.js → chunk-IEM74GZ5.js} +9 -9
  12. package/dist/bundle/{chunk-25VYRAC6.js → chunk-JKKXN6JE.js} +72 -0
  13. package/dist/bundle/{chunk-TXVF6Q5H.js → chunk-NLRWERWA.js} +37 -32
  14. package/dist/bundle/{chunk-TKOBEJ5E.js → chunk-SX7CAXWU.js} +22 -4
  15. package/dist/bundle/{chunk-Q6UAHLII.js → chunk-V6LOBH6X.js} +2 -2
  16. package/dist/bundle/{cli-main-ZTJM5EEH.js → cli-main-6GXXIMQQ.js} +4 -4
  17. package/dist/bundle/cli.js +1 -1
  18. package/dist/bundle/{google-4GA4YMUX.js → google-QLKV2ZLC.js} +2 -2
  19. package/dist/bundle/{google-vertex-7AMALD7D.js → google-vertex-UGLUZV6B.js} +2 -2
  20. package/dist/bundle/{main-53I74INO.js → main-HF64B4HM.js} +5 -5
  21. package/dist/bundle/{mistral-74BXMNRM.js → mistral-2ITSLHYF.js} +1 -1
  22. package/dist/bundle/{openai-codex-responses-COXNC4IH.js → openai-codex-responses-FRREQXS3.js} +5 -4
  23. package/dist/bundle/{openai-completions-BCSA5Q6S.js → openai-completions-HF6UPPLW.js} +1 -1
  24. package/dist/bundle/{openai-responses-ONCIZSJS.js → openai-responses-LRTMBDFW.js} +2 -2
  25. package/dist/core/agent-session.d.ts.map +1 -1
  26. package/dist/core/agent-session.js +6 -1
  27. package/dist/core/agent-session.js.map +1 -1
  28. package/dist/core/autonomous.d.ts +2 -0
  29. package/dist/core/autonomous.d.ts.map +1 -1
  30. package/dist/core/autonomous.js +4 -0
  31. package/dist/core/autonomous.js.map +1 -1
  32. package/dist/core/canonical-context.d.ts.map +1 -1
  33. package/dist/core/canonical-context.js +7 -0
  34. package/dist/core/canonical-context.js.map +1 -1
  35. package/dist/core/public-context.d.ts.map +1 -1
  36. package/dist/core/public-context.js +2 -0
  37. package/dist/core/public-context.js.map +1 -1
  38. package/dist/core/view-units.d.ts.map +1 -1
  39. package/dist/core/view-units.js +3 -0
  40. package/dist/core/view-units.js.map +1 -1
  41. package/dist/main.d.ts.map +1 -1
  42. package/dist/main.js +1 -1
  43. package/dist/main.js.map +1 -1
  44. package/dist/modes/daemon/daemon-mode.d.ts.map +1 -1
  45. package/dist/modes/daemon/daemon-mode.js +4 -3
  46. package/dist/modes/daemon/daemon-mode.js.map +1 -1
  47. package/dist/modes/daemon/daemon-supervisor.d.ts.map +1 -1
  48. package/dist/modes/daemon/daemon-supervisor.js +11 -5
  49. package/dist/modes/daemon/daemon-supervisor.js.map +1 -1
  50. package/dist/modes/daemon/daemon-worker-protocol.d.ts +3 -0
  51. package/dist/modes/daemon/daemon-worker-protocol.d.ts.map +1 -1
  52. package/dist/modes/daemon/daemon-worker-protocol.js +2 -0
  53. package/dist/modes/daemon/daemon-worker-protocol.js.map +1 -1
  54. package/dist/modes/print-mode.d.ts.map +1 -1
  55. package/dist/modes/print-mode.js +24 -21
  56. package/dist/modes/print-mode.js.map +1 -1
  57. package/docs/json.md +14 -1
  58. package/docs/long-running-agents.md +23 -2
  59. package/docs/providers.md +17 -0
  60. package/package.json +4 -4
@@ -12,7 +12,7 @@ import { sleep } from "../utils/sleep.js";
12
12
  import { AGENT_MESSAGE_CUSTOM_TYPE, AGENT_MESSAGE_RECEIVED_PREVIEW_LABEL, AGENT_MESSAGE_SKILL_NAME, assertAgentMessageQueueCapacity, assertAgentSessionNameAvailable, assertDirectAgentMessageTarget, createAgentMessageHostHandlers, DEFAULT_AGENT_MESSAGE_MAX_PENDING_PER_SESSION, formatAgentSessionNameUnavailable, isAgentSessionMessage, isAgentSessionMessagePrompt, normalizeAgentSessionMessage, parseAgentSessionMessagePromptId, startsAgentRun, } from "./agent-messages.js";
13
13
  import { AGENT_OBSERVE_SKILL_NAME, createAgentObserveHostHandlers, normalizeObserveLimit, normalizeObserveMaxChars, ORCHESTRATION_HEARTBEAT_SKILL_NAME, } from "./agent-observe.js";
14
14
  import { addLoginGuidanceToAuthError, formatAuthenticationFailedMessage, formatNoApiKeyFoundMessage, formatNoModelSelectedMessage, isLikelyAuthenticationError, } from "./auth-guidance.js";
15
- import { addAutonomousContinuation, addAutonomousUsage, autonomousStatus, createAutonomousRuntimeState, nextAutonomousContinuation, refreshAutonomousQualityGates, setAutonomousEnabled, } from "./autonomous.js";
15
+ import { addAutonomousContinuation, addAutonomousUsage, autonomousRunLimitReason, autonomousStatus, createAutonomousRuntimeState, nextAutonomousContinuation, refreshAutonomousQualityGates, setAutonomousEnabled, } from "./autonomous.js";
16
16
  import { executeBashWithOperations } from "./bash-executor.js";
17
17
  import { stringifyBoundedJson } from "./bounded-json.js";
18
18
  import { CanonicalContextCompiler, canonicalRecoveryBoundary, getCanonicalEpochContext, getCanonicalMessageSource, getCanonicalViewSelectionSource, getCanonicalViewUnits, MissingRecoveryReplayContractError, prepareCanonicalEpoch, prepareContextModeEpoch, prepareRecoveryCompaction, readCanonicalContextMode, } from "./canonical-context.js";
@@ -2345,6 +2345,9 @@ export class AgentSession {
2345
2345
  "proceed");
2346
2346
  }
2347
2347
  async _getTurnOutcome(context, signal) {
2348
+ // Usage is recorded by message_end. Join it before admitting another native tool turn.
2349
+ if (this._autonomousState.enabled)
2350
+ await this._agentEventQueue;
2348
2351
  const sourceOwner = signal ? this._invocationCompactionOwner : this._captureCompactionOwner();
2349
2352
  if (!sourceOwner ||
2350
2353
  signal?.aborted ||
@@ -2371,6 +2374,8 @@ export class AgentSession {
2371
2374
  return { kind: "finish" };
2372
2375
  if (!current())
2373
2376
  return { kind: "cancelled" };
2377
+ if (this._autonomousState.enabled && autonomousRunLimitReason(this._autonomousState))
2378
+ return { kind: "finish" };
2374
2379
  try {
2375
2380
  if (await this._accountGoalUsageForAssistantMessage(context.message, goalOwner)) {
2376
2381
  this._assertGoalContinuationOwner(goalOwner);