@rowan-agent/agent 0.33.0 → 0.34.0

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.
@@ -342,6 +342,7 @@ declare class ExtensionRunner {
342
342
  private readonly skills;
343
343
  private readonly pendingProviders;
344
344
  private bound;
345
+ private readonly providersChangedListeners;
345
346
  private readonly errorListeners;
346
347
  private readonly resourceChangeListeners;
347
348
  private runtimeAgents?;
@@ -496,6 +497,9 @@ declare class ExtensionRunner {
496
497
  private registerSkillDefinition;
497
498
  private unregisterSkill;
498
499
  private loadRegisteredSkill;
500
+ /** Called after a Provider registration change has been applied to the model registry. */
501
+ onProvidersChanged(listener: () => void): () => void;
502
+ private notifyProvidersChanged;
499
503
  private registerProvider;
500
504
  private unregisterProvider;
501
505
  private flushPendingProviders;
@@ -1267,6 +1271,8 @@ interface AgentRuntime {
1267
1271
  signal: AbortSignal;
1268
1272
  }>): void | Promise<void>;
1269
1273
  }): Promise<DurableConsumer>;
1274
+ /** Called after an Extension registers, replaces or unregisters a Provider in the model registry. */
1275
+ onProvidersChanged(listener: () => void): () => void;
1270
1276
  close(): Promise<void>;
1271
1277
  }
1272
1278
  type ConsumerRegistration = Readonly<{
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _rowan_agent_models from '@rowan-agent/models';
2
2
  export { _rowan_agent_models as models };
3
3
  export { AudioBlock, ContentBlock, ImageBlock, JsonObject, JsonPrimitive, JsonValue, ResourceBlock, ResourceLinkBlock, RunInteractionKind, RunInteractionRequest, ScopeRef, StreamBlock, TextBlock, ThinkingBlock, ToolResult } from '@rowan-agent/models';
4
- export { aE as AfterToolCall, f as AgentId, o as AgentListCursor, m as AgentRun, q as AgentSummary, aF as AssistantContent, _ as AssistantMessage, aG as BeforeToolCall, W as ContextCandidate, K as ContextCompactionRecord, C as ContextStatus, v as DurableConsumer, D as DurableRunEvent, aH as EventBus, k as EventCursor, aI as EventId, aJ as ExecOptions, aK as ExecResult, aL as ExtensionAPI, aM as ExtensionAgentConsumerDisposer, aN as ExtensionAgentsAPI, aO as ExtensionContext, aP as ExtensionFactory, aQ as ExtensionStateStore, aR as HookEvent, aS as HookEventType, aT as HookHandler, aU as InteractionRecord, aV as InternalModelLoopOptions, aW as LiveInteractionEvent, x as Message, aX as MessageBase, aY as MessageCommitted, aZ as MessageContent, a_ as MessageDelta, M as MessageId, a$ as MessageRevised, h as MessageRevisionResult, b0 as ModelInvokeOutput, p as Page, P as Phase, b1 as PhaseContext, b2 as PhaseExecution, b3 as PhaseExecutionIdentity, b4 as PhaseInput, b5 as PhaseInvocation, b6 as PhaseMessageManager, b7 as PhaseOutput, b8 as PhaseRegistration, b9 as PhaseRunHandler, ba as PhaseState, bb as PhaseStatus, bc as PhaseStatusState, y as RunBoundary, bd as RunEndEvent, z as RunEvent, Y as RunFailure, i as RunId, a0 as RunInteraction, be as RunInteractionBoundary, bf as RunInteractionCancelledError, bg as RunInteractionDriver, bh as RunInteractionState, bi as RunInteractionStatus, s as RunListCursor, w as RunSnapshot, bj as RunStartEvent, r as RunState, bk as RunStateChanged, t as RunSummary, bl as SettingsBadge, bm as SettingsControl, bn as SettingsDefinition, bo as SettingsItem, bp as SettingsOption, bq as SettingsSection, br as SkillRegistration, bs as ThinkingDelta, T as Tool, bt as ToolCallContext, bu as ToolCallDelta, j as ToolCallId, bv as ToolCallPhase, bw as ToolCallPresentationInput, bx as ToolCallPresentationOutput, J as ToolCallSnapshot, by as ToolInvocationContext, bz as ToolMessage, bA as ToolMessageContent, bB as ToolResultBlock, bC as ToolResultRecord, bD as ToolStateChanged, bE as ToolUseBlock, U as UserContent, l as UserInput, bF as UserMessage, bG as WithdrawnUserInput } from './index-OBJCF_CO.js';
4
+ export { aE as AfterToolCall, f as AgentId, o as AgentListCursor, m as AgentRun, q as AgentSummary, aF as AssistantContent, _ as AssistantMessage, aG as BeforeToolCall, W as ContextCandidate, K as ContextCompactionRecord, C as ContextStatus, v as DurableConsumer, D as DurableRunEvent, aH as EventBus, k as EventCursor, aI as EventId, aJ as ExecOptions, aK as ExecResult, aL as ExtensionAPI, aM as ExtensionAgentConsumerDisposer, aN as ExtensionAgentsAPI, aO as ExtensionContext, aP as ExtensionFactory, aQ as ExtensionStateStore, aR as HookEvent, aS as HookEventType, aT as HookHandler, aU as InteractionRecord, aV as InternalModelLoopOptions, aW as LiveInteractionEvent, x as Message, aX as MessageBase, aY as MessageCommitted, aZ as MessageContent, a_ as MessageDelta, M as MessageId, a$ as MessageRevised, h as MessageRevisionResult, b0 as ModelInvokeOutput, p as Page, P as Phase, b1 as PhaseContext, b2 as PhaseExecution, b3 as PhaseExecutionIdentity, b4 as PhaseInput, b5 as PhaseInvocation, b6 as PhaseMessageManager, b7 as PhaseOutput, b8 as PhaseRegistration, b9 as PhaseRunHandler, ba as PhaseState, bb as PhaseStatus, bc as PhaseStatusState, y as RunBoundary, bd as RunEndEvent, z as RunEvent, Y as RunFailure, i as RunId, a0 as RunInteraction, be as RunInteractionBoundary, bf as RunInteractionCancelledError, bg as RunInteractionDriver, bh as RunInteractionState, bi as RunInteractionStatus, s as RunListCursor, w as RunSnapshot, bj as RunStartEvent, r as RunState, bk as RunStateChanged, t as RunSummary, bl as SettingsBadge, bm as SettingsControl, bn as SettingsDefinition, bo as SettingsItem, bp as SettingsOption, bq as SettingsSection, br as SkillRegistration, bs as ThinkingDelta, T as Tool, bt as ToolCallContext, bu as ToolCallDelta, j as ToolCallId, bv as ToolCallPhase, bw as ToolCallPresentationInput, bx as ToolCallPresentationOutput, J as ToolCallSnapshot, by as ToolInvocationContext, bz as ToolMessage, bA as ToolMessageContent, bB as ToolResultBlock, bC as ToolResultRecord, bD as ToolStateChanged, bE as ToolUseBlock, U as UserContent, l as UserInput, bF as UserMessage, bG as WithdrawnUserInput } from './index-Det5FQSu.js';
5
5
  import 'typebox';
package/dist/runtime.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { E as ExtensionHost, H as HostApiExtension, A as AgentRuntime$1, a as AgentRuntimeOptions, L as LoadInput, b as AgentDefinition, c as LoadResult, S as Skill, P as Phase, T as Tool, R as ResourceKind, d as AgentConfiguration, e as HistorySeed, f as AgentId, g as AgentDeletionRequest, M as MessageId, U as UserContent, h as MessageRevisionResult, i as RunId, j as ToolCallId, k as EventCursor, C as ContextStatus, l as UserInput, m as AgentRun, n as EntryPhaseSpec, o as AgentListCursor, p as Page, q as AgentSummary, r as RunState, s as RunListCursor, t as RunSummary, I as InvocationSource, u as InvocationCatalogEntry, D as DurableRunEvent, v as DurableConsumer, w as RunSnapshot, x as Message, y as RunBoundary, z as RunEvent, B as DurableStore, F as AgentRecord, G as RunRecord, J as ToolCallSnapshot, K as ContextCompactionRecord, O as OwnerLease, N as OwnedStore, Q as ConfigToken, V as ExecutionId, W as ContextCandidate, X as RunClaim, Y as RunFailure, Z as ExecutionToken, _ as AssistantMessage, $ as ExecutionCheckpoint, a0 as RunInteraction, a1 as ToolCommit, a2 as ToolCallReservation, a3 as ToolBatchCommit, a4 as Outcome, a5 as ConsumerRegistration, a6 as RetentionResult, a7 as ConfigProvider, a8 as ConfigurationSnapshot, a9 as ConfigPutResult, aa as ConfigResolution, ab as PhaseRegistry, ac as LoadedExtension } from './index-OBJCF_CO.js';
2
- export { ad as DefinitionLayer, ae as ExtensionActivationError, af as ExtensionActivationResult, ag as ExtensionContribution, ah as ExtensionLifetimeError, ai as ExtensionLifetimeErrorCode, aj as ExtensionLoadInput, ak as LoadExtensionsResult, al as ModelRetry, am as OpaqueId, an as OwnerToken, ao as PhaseRegistrySelection, ap as ResolvedResourceView, aq as ResourceDiagnostic, ar as ResourceRef, as as ResourceRegistry, at as ResourceRegistryError, au as ResourceRegistryErrorCode, av as ResourceSourceId, aw as ResourceView, ax as RuntimeBootstrapRegistry, ay as RuntimeExtensionLifetime, az as extensionSourceId, aA as isConfigurationSnapshot, aB as mergeToolCall, aC as parseAgentDefinition, aD as resolveConfigurationSnapshot } from './index-OBJCF_CO.js';
1
+ import { E as ExtensionHost, H as HostApiExtension, A as AgentRuntime$1, a as AgentRuntimeOptions, L as LoadInput, b as AgentDefinition, c as LoadResult, S as Skill, P as Phase, T as Tool, R as ResourceKind, d as AgentConfiguration, e as HistorySeed, f as AgentId, g as AgentDeletionRequest, M as MessageId, U as UserContent, h as MessageRevisionResult, i as RunId, j as ToolCallId, k as EventCursor, C as ContextStatus, l as UserInput, m as AgentRun, n as EntryPhaseSpec, o as AgentListCursor, p as Page, q as AgentSummary, r as RunState, s as RunListCursor, t as RunSummary, I as InvocationSource, u as InvocationCatalogEntry, D as DurableRunEvent, v as DurableConsumer, w as RunSnapshot, x as Message, y as RunBoundary, z as RunEvent, B as DurableStore, F as AgentRecord, G as RunRecord, J as ToolCallSnapshot, K as ContextCompactionRecord, O as OwnerLease, N as OwnedStore, Q as ConfigToken, V as ExecutionId, W as ContextCandidate, X as RunClaim, Y as RunFailure, Z as ExecutionToken, _ as AssistantMessage, $ as ExecutionCheckpoint, a0 as RunInteraction, a1 as ToolCommit, a2 as ToolCallReservation, a3 as ToolBatchCommit, a4 as Outcome, a5 as ConsumerRegistration, a6 as RetentionResult, a7 as ConfigProvider, a8 as ConfigurationSnapshot, a9 as ConfigPutResult, aa as ConfigResolution, ab as PhaseRegistry, ac as LoadedExtension } from './index-Det5FQSu.js';
2
+ export { ad as DefinitionLayer, ae as ExtensionActivationError, af as ExtensionActivationResult, ag as ExtensionContribution, ah as ExtensionLifetimeError, ai as ExtensionLifetimeErrorCode, aj as ExtensionLoadInput, ak as LoadExtensionsResult, al as ModelRetry, am as OpaqueId, an as OwnerToken, ao as PhaseRegistrySelection, ap as ResolvedResourceView, aq as ResourceDiagnostic, ar as ResourceRef, as as ResourceRegistry, at as ResourceRegistryError, au as ResourceRegistryErrorCode, av as ResourceSourceId, aw as ResourceView, ax as RuntimeBootstrapRegistry, ay as RuntimeExtensionLifetime, az as extensionSourceId, aA as isConfigurationSnapshot, aB as mergeToolCall, aC as parseAgentDefinition, aD as resolveConfigurationSnapshot } from './index-Det5FQSu.js';
3
3
  import * as _rowan_agent_models from '@rowan-agent/models';
4
4
  import { JsonObject, JsonValue, ScopeRef, ModelRef, LlmTokenUsage, StreamBlock, ToolKind, ToolCallLocation, ToolCallContent, ToolResult, ToolCall, ToolCallUpdate } from '@rowan-agent/models';
5
5
  import 'typebox';
@@ -136,6 +136,7 @@ declare class AgentRuntime implements AgentRuntime$1 {
136
136
  }>): void | Promise<void>;
137
137
  }): Promise<DurableConsumer>;
138
138
  private liveInteract;
139
+ onProvidersChanged(listener: () => void): () => void;
139
140
  close(): Promise<void>;
140
141
  snapshot(runId: RunId): Promise<RunSnapshot>;
141
142
  history(agentId: AgentId): Promise<readonly Message[]>;
package/dist/runtime.js CHANGED
@@ -7840,6 +7840,7 @@ var ExtensionRunner = class {
7840
7840
  // Provider management
7841
7841
  pendingProviders = [];
7842
7842
  bound = false;
7843
+ providersChangedListeners = /* @__PURE__ */ new Set();
7843
7844
  // Error listeners
7844
7845
  errorListeners = /* @__PURE__ */ new Set();
7845
7846
  // Resource change listeners (for Registry live sync)
@@ -8052,6 +8053,7 @@ var ExtensionRunner = class {
8052
8053
  this.extensions.length = 0;
8053
8054
  this.activeExtensionPhases.clear();
8054
8055
  this.resourceChangeListeners.clear();
8056
+ this.providersChangedListeners.clear();
8055
8057
  this.phases.clear();
8056
8058
  this._phaseCache = null;
8057
8059
  this.skills.clear();
@@ -8515,9 +8517,24 @@ var ExtensionRunner = class {
8515
8517
  const skill = await loadSkill(resolve5(extensionBase, registration));
8516
8518
  await this.registerSkillDefinition(extension, skill, scope);
8517
8519
  }
8520
+ /** Called after a Provider registration change has been applied to the model registry. */
8521
+ onProvidersChanged(listener) {
8522
+ this.providersChangedListeners.add(listener);
8523
+ return () => this.providersChangedListeners.delete(listener);
8524
+ }
8525
+ notifyProvidersChanged() {
8526
+ for (const listener of this.providersChangedListeners) {
8527
+ try {
8528
+ listener();
8529
+ } catch (err) {
8530
+ console.error("[extension-runner] Providers-changed listener failed:", err);
8531
+ }
8532
+ }
8533
+ }
8518
8534
  registerProvider(config) {
8519
8535
  if (this.bound) {
8520
8536
  applyProviderRegistration(config);
8537
+ this.notifyProvidersChanged();
8521
8538
  } else {
8522
8539
  this.pendingProviders.push({ kind: "register", config });
8523
8540
  }
@@ -8525,6 +8542,7 @@ var ExtensionRunner = class {
8525
8542
  unregisterProvider(name) {
8526
8543
  if (this.bound) {
8527
8544
  applyProviderUnregistration(name);
8545
+ this.notifyProvidersChanged();
8528
8546
  } else {
8529
8547
  this.pendingProviders.push({ kind: "unregister", name });
8530
8548
  }
@@ -8537,7 +8555,9 @@ var ExtensionRunner = class {
8537
8555
  applyProviderUnregistration(action.name);
8538
8556
  }
8539
8557
  }
8558
+ const applied = this.pendingProviders.length > 0;
8540
8559
  this.pendingProviders.length = 0;
8560
+ if (applied) this.notifyProvidersChanged();
8541
8561
  }
8542
8562
  getRegisteredPhase(name) {
8543
8563
  return this.collectRegisteredPhases().get(name);
@@ -9786,6 +9806,9 @@ var AgentRuntime = class _AgentRuntime {
9786
9806
  });
9787
9807
  });
9788
9808
  }
9809
+ onProvidersChanged(listener) {
9810
+ return this.resources.extensionRunner.onProvidersChanged(listener);
9811
+ }
9789
9812
  async close() {
9790
9813
  if (this.closed) return;
9791
9814
  this.closed = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rowan-agent/agent",
3
- "version": "0.33.0",
3
+ "version": "0.34.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",