@rowan-agent/agent 0.31.0 → 0.33.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.
@@ -154,12 +154,6 @@ interface EventBus {
154
154
  on(event: string, listener: Listener): () => void;
155
155
  /** Emit an event to all subscribers. */
156
156
  emit(event: string, ...args: unknown[]): void;
157
- /** Remove all listeners for an event, or all listeners if no event specified. */
158
- off(event?: string): void;
159
- /** Check if there are listeners for an event. */
160
- has(event: string): boolean;
161
- /** Get listener count for an event. */
162
- count(event: string): number;
163
157
  }
164
158
 
165
159
  /**
@@ -349,7 +343,6 @@ declare class ExtensionRunner {
349
343
  private readonly pendingProviders;
350
344
  private bound;
351
345
  private readonly errorListeners;
352
- private readonly capabilityListeners;
353
346
  private readonly resourceChangeListeners;
354
347
  private runtimeAgents?;
355
348
  private readonly activeExtensionPhases;
@@ -416,24 +409,12 @@ declare class ExtensionRunner {
416
409
  * Get a tool definition by name. Returns undefined if not found.
417
410
  */
418
411
  getToolDefinition(toolName: string): RegisteredTool["definition"] | undefined;
419
- /** Get all contributed capabilities across all extensions. */
420
- getCapabilities(): readonly ExtensionCapability[];
421
- /**
422
- * Subscribe to capability changes (contributions added, removed, or extensions disposed).
423
- * Returns an unsubscribe function.
424
- */
425
- onCapabilitiesChanged(listener: (capabilities: readonly ExtensionCapability[]) => void): () => void;
426
412
  /**
427
413
  * Subscribe to resource changes (tools, phases, skills registered, unregistered, or disposed).
428
414
  * Used by RuntimeBootstrapRegistry to re-commit implicit sources after activation.
429
415
  */
430
416
  onResourceChange(listener: (kind: "tool" | "phase" | "skill") => Promise<void> | void): () => void;
431
417
  private notifyResourceChange;
432
- triggerUiAction(event: {
433
- contributionId: string;
434
- actionId: string;
435
- scope?: ScopeRef;
436
- }): void;
437
418
  getPhase(name: string): Phase | undefined;
438
419
  getPhases(): Phase[];
439
420
  getRegisteredPhases(): readonly RegisteredPhase[];
@@ -507,8 +488,6 @@ declare class ExtensionRunner {
507
488
  private createExtensionAPI;
508
489
  private registerTool;
509
490
  private unregisterTool;
510
- private contributeCapability;
511
- private notifyCapabilitiesChanged;
512
491
  private registerPhase;
513
492
  private registerPhaseDefinition;
514
493
  private unregisterPhase;
@@ -1288,13 +1267,6 @@ interface AgentRuntime {
1288
1267
  signal: AbortSignal;
1289
1268
  }>): void | Promise<void>;
1290
1269
  }): Promise<DurableConsumer>;
1291
- listCapabilities(): readonly ExtensionCapability[];
1292
- onCapabilitiesChanged(listener: (capabilities: readonly ExtensionCapability[]) => void): () => void;
1293
- triggerUiAction(event: {
1294
- contributionId: string;
1295
- actionId: string;
1296
- scope?: ScopeRef;
1297
- }): void;
1298
1270
  close(): Promise<void>;
1299
1271
  }
1300
1272
  type ConsumerRegistration = Readonly<{
@@ -1437,18 +1409,6 @@ interface HostApiExtension {
1437
1409
  readonly namespaces: Readonly<Record<string, unknown>>;
1438
1410
  dispose?(): void;
1439
1411
  }
1440
- type ExtensionToolContribution = {
1441
- kind: "tool";
1442
- name: string;
1443
- description: string;
1444
- };
1445
- type ExtensionCapabilityContribution = ExtensionToolContribution;
1446
- type ExtensionCapability = {
1447
- extensionId: string;
1448
- kind: "tool";
1449
- name: string;
1450
- description: string;
1451
- };
1452
1412
  interface SourceInfo {
1453
1413
  source: string;
1454
1414
  baseDir?: string;
@@ -1575,6 +1535,8 @@ interface ExtensionAgentsAPI {
1575
1535
  after?: RunListCursor;
1576
1536
  limit?: number;
1577
1537
  }): Promise<Page<RunSummary, RunListCursor>>;
1538
+ /** One Run in full, including its outcome once it ended. */
1539
+ run(runId: string): Promise<RunSnapshot>;
1578
1540
  runPhase(agentId: AgentId | string, options: {
1579
1541
  phase: string;
1580
1542
  payload?: JsonValue;
@@ -1601,6 +1563,7 @@ interface ExtensionAgentsRuntimeDelegate {
1601
1563
  after?: RunListCursor;
1602
1564
  limit?: number;
1603
1565
  }): Promise<Page<RunSummary, RunListCursor>>;
1566
+ snapshot(runId: RunSnapshot["runId"]): Promise<RunSnapshot>;
1604
1567
  runPhase(agentId: AgentId, options: {
1605
1568
  phase: string;
1606
1569
  payload?: JsonValue;
@@ -1627,17 +1590,15 @@ interface ExtensionAgentsRuntimeDelegate {
1627
1590
  * ```
1628
1591
  */
1629
1592
  interface ExtensionAPI {
1630
- /** Hook events — subscribe or unsubscribe. */
1593
+ /** Hook events — subscribe; Rowan removes subscriptions when the Extension is disposed. */
1631
1594
  hooks: {
1632
1595
  /**
1633
- * Subscribe to a hook event.
1596
+ * Subscribe to a hook event. Returns an unsubscribe function.
1634
1597
  *
1635
1598
  * @param eventType - Hook type, e.g. "before_tool_call"
1636
1599
  * @param handler - Hook handler, can return result to modify behavior
1637
1600
  */
1638
- on<K extends HookEventType>(eventType: K, handler: HookHandler<K>): void;
1639
- /** Unsubscribe from a hook event. */
1640
- off<K extends HookEventType>(eventType: K, handler: HookHandler<K>): void;
1601
+ on<K extends HookEventType>(eventType: K, handler: HookHandler<K>): () => void;
1641
1602
  };
1642
1603
  /** Extension configuration — read own layered config or listen for changes. */
1643
1604
  config: {
@@ -1689,21 +1650,15 @@ interface ExtensionAPI {
1689
1650
  agents: ExtensionAgentsAPI;
1690
1651
  /** Shared event bus for inter-extension communication. */
1691
1652
  events: EventBus;
1692
- /** Capability contributions — advertise tools or features to the host. */
1693
- capabilities: {
1694
- /** Contribute a capability to the host. Returns a disposer to remove the contribution. */
1695
- contribute(contribution: ExtensionCapabilityContribution): () => void;
1696
- };
1697
1653
  /** Runtime context — cwd, signal, exec. */
1698
1654
  context: ExtensionContext;
1699
1655
  }
1700
1656
  /**
1701
1657
  * Extension factory function.
1702
- * Receives ExtensionAPI for registering hooks, phases, and providers.
1658
+ * Receives ExtensionAPI for registering hooks, phases, and providers. Return a cleanup
1659
+ * function only for resources the Extension owns itself; Rowan removes every registration.
1703
1660
  */
1704
- type ExtensionDisposer = () => void | Promise<void>;
1705
- type ExtensionFactoryResult = void | ExtensionDisposer;
1706
- type ExtensionFactory = (api: ExtensionAPI) => ExtensionFactoryResult | Promise<ExtensionFactoryResult>;
1661
+ type ExtensionFactory = (api: ExtensionAPI) => void | (() => void | Promise<void>) | Promise<void | (() => void | Promise<void>)>;
1707
1662
 
1708
1663
  type PhaseStatusState = "running" | "completed";
1709
1664
  /** Normalized status event exposed to Runtime consumers. */
@@ -2254,4 +2209,4 @@ declare class RunInteractionBoundary extends Error {
2254
2209
  constructor(state: ExecutionState, interactions: readonly RunInteraction[]);
2255
2210
  }
2256
2211
 
2257
- export { type AssistantMessage as $, type AgentRuntime as A, type RunEvent as B, type ContextStatus as C, type DurableRunEvent as D, type ExtensionHost as E, type DurableStore as F, type AgentRecord as G, type HostApiExtension as H, type InvocationSource as I, type RunRecord as J, type ToolCallSnapshot as K, type LoadInput as L, type MessageId as M, type ContextCompactionRecord as N, type OwnerLease as O, type Phase as P, type OwnedStore as Q, type ResourceKind as R, type Skill as S, type Tool as T, type UserContent as U, type ConfigToken as V, type ExecutionId as W, type ContextCandidate as X, type RunClaim as Y, type RunFailure as Z, type ExecutionToken as _, type AgentRuntimeOptions as a, type LiveInteractionEvent as a$, type ExecutionCheckpoint as a0, type RunInteraction as a1, type ToolCommit as a2, type ToolCallReservation as a3, type ToolBatchCommit as a4, type Outcome as a5, type ConsumerRegistration as a6, type RetentionResult as a7, type ConfigProvider as a8, type ConfigurationSnapshot as a9, extensionSourceId as aA, isConfigurationSnapshot as aB, mergeToolCall as aC, parseAgentDefinition as aD, resolveConfigurationSnapshot as aE, type AfterToolCall as aF, type AssistantContent as aG, type BeforeToolCall as aH, type EventBus as aI, type EventId as aJ, type ExecOptions as aK, type ExecResult as aL, type ExtensionAPI as aM, type ExtensionAgentConsumerDisposer as aN, type ExtensionAgentsAPI as aO, type ExtensionCapabilityContribution as aP, type ExtensionContext as aQ, type ExtensionDisposer as aR, type ExtensionFactory as aS, type ExtensionFactoryResult as aT, type ExtensionStateStore as aU, type ExtensionToolContribution as aV, type HookEvent as aW, type HookEventType as aX, type HookHandler as aY, type InteractionRecord as aZ, type InternalModelLoopOptions as a_, type ConfigPutResult as aa, type ConfigResolution as ab, type PhaseRegistry as ac, type LoadedExtension as ad, type DefinitionLayer as ae, type ExtensionActivationError as af, type ExtensionActivationResult as ag, type ExtensionContribution as ah, ExtensionLifetimeError as ai, type ExtensionLifetimeErrorCode as aj, type ExtensionLoadInput as ak, type LoadExtensionsResult as al, type ModelRetry as am, type OpaqueId as an, type OwnerToken as ao, type PhaseRegistrySelection as ap, type ResolvedResourceView as aq, type ResourceDiagnostic as ar, type ResourceRef as as, ResourceRegistry as at, ResourceRegistryError as au, type ResourceRegistryErrorCode as av, type ResourceSourceId as aw, type ResourceView as ax, RuntimeBootstrapRegistry as ay, RuntimeExtensionLifetime as az, type AgentDefinition as b, type MessageBase as b0, type MessageCommitted as b1, type MessageContent as b2, type MessageDelta as b3, type MessageRevised as b4, type ModelInvokeOutput as b5, type PhaseContext as b6, type PhaseExecution as b7, type PhaseExecutionIdentity as b8, type PhaseInput as b9, type ToolCallPhase as bA, type ToolCallPresentationInput as bB, type ToolCallPresentationOutput as bC, type ToolInvocationContext as bD, type ToolMessage as bE, type ToolMessageContent as bF, type ToolResultBlock as bG, type ToolResultRecord as bH, type ToolStateChanged as bI, type ToolUseBlock as bJ, type UserMessage as bK, type WithdrawnUserInput as bL, type PhaseInvocation as ba, type PhaseMessageManager as bb, type PhaseOutput as bc, type PhaseRegistration as bd, type PhaseRunHandler as be, type PhaseState as bf, type PhaseStatus as bg, type PhaseStatusState as bh, type RunEndEvent as bi, RunInteractionBoundary as bj, RunInteractionCancelledError as bk, type RunInteractionDriver as bl, type RunInteractionState as bm, type RunInteractionStatus as bn, type RunStartEvent as bo, type RunStateChanged as bp, type SettingsBadge as bq, type SettingsControl as br, type SettingsDefinition as bs, type SettingsItem as bt, type SettingsOption as bu, type SettingsSection as bv, type SkillRegistration as bw, type ThinkingDelta as bx, type ToolCallContext as by, type ToolCallDelta as bz, type LoadResult as c, type AgentConfiguration as d, type HistorySeed as e, type AgentId as f, type AgentDeletionRequest as g, type MessageRevisionResult as h, type RunId as i, type ToolCallId as j, type EventCursor as k, type UserInput as l, type AgentRun as m, type EntryPhaseSpec as n, type AgentListCursor as o, type Page as p, type AgentSummary as q, type RunState as r, type RunListCursor as s, type RunSummary as t, type InvocationCatalogEntry as u, type DurableConsumer as v, type ExtensionCapability as w, type RunSnapshot as x, type Message as y, type RunBoundary as z };
2212
+ export { type ExecutionCheckpoint as $, type AgentRuntime as A, type DurableStore as B, type ContextStatus as C, type DurableRunEvent as D, type ExtensionHost as E, type AgentRecord as F, type RunRecord as G, type HostApiExtension as H, type InvocationSource as I, type ToolCallSnapshot as J, type ContextCompactionRecord as K, type LoadInput as L, type MessageId as M, type OwnedStore as N, type OwnerLease as O, type Phase as P, type ConfigToken as Q, type ResourceKind as R, type Skill as S, type Tool as T, type UserContent as U, type ExecutionId as V, type ContextCandidate as W, type RunClaim as X, type RunFailure as Y, type ExecutionToken as Z, type AssistantMessage as _, type AgentRuntimeOptions as a, type MessageRevised as a$, type RunInteraction as a0, type ToolCommit as a1, type ToolCallReservation as a2, type ToolBatchCommit as a3, type Outcome as a4, type ConsumerRegistration as a5, type RetentionResult as a6, type ConfigProvider as a7, type ConfigurationSnapshot as a8, type ConfigPutResult as a9, isConfigurationSnapshot as aA, mergeToolCall as aB, parseAgentDefinition as aC, resolveConfigurationSnapshot as aD, type AfterToolCall as aE, type AssistantContent as aF, type BeforeToolCall as aG, type EventBus as aH, type EventId as aI, type ExecOptions as aJ, type ExecResult as aK, type ExtensionAPI as aL, type ExtensionAgentConsumerDisposer as aM, type ExtensionAgentsAPI as aN, type ExtensionContext as aO, type ExtensionFactory as aP, type ExtensionStateStore as aQ, type HookEvent as aR, type HookEventType as aS, type HookHandler as aT, type InteractionRecord as aU, type InternalModelLoopOptions as aV, type LiveInteractionEvent as aW, type MessageBase as aX, type MessageCommitted as aY, type MessageContent as aZ, type MessageDelta as a_, type ConfigResolution as aa, type PhaseRegistry as ab, type LoadedExtension as ac, type DefinitionLayer as ad, type ExtensionActivationError as ae, type ExtensionActivationResult as af, type ExtensionContribution as ag, ExtensionLifetimeError as ah, type ExtensionLifetimeErrorCode as ai, type ExtensionLoadInput as aj, type LoadExtensionsResult as ak, type ModelRetry as al, type OpaqueId as am, type OwnerToken as an, type PhaseRegistrySelection as ao, type ResolvedResourceView as ap, type ResourceDiagnostic as aq, type ResourceRef as ar, ResourceRegistry as as, ResourceRegistryError as at, type ResourceRegistryErrorCode as au, type ResourceSourceId as av, type ResourceView as aw, RuntimeBootstrapRegistry as ax, RuntimeExtensionLifetime as ay, extensionSourceId as az, type AgentDefinition as b, type ModelInvokeOutput as b0, type PhaseContext as b1, type PhaseExecution as b2, type PhaseExecutionIdentity as b3, type PhaseInput as b4, type PhaseInvocation as b5, type PhaseMessageManager as b6, type PhaseOutput as b7, type PhaseRegistration as b8, type PhaseRunHandler as b9, type ToolMessageContent as bA, type ToolResultBlock as bB, type ToolResultRecord as bC, type ToolStateChanged as bD, type ToolUseBlock as bE, type UserMessage as bF, type WithdrawnUserInput as bG, type PhaseState as ba, type PhaseStatus as bb, type PhaseStatusState as bc, type RunEndEvent as bd, RunInteractionBoundary as be, RunInteractionCancelledError as bf, type RunInteractionDriver as bg, type RunInteractionState as bh, type RunInteractionStatus as bi, type RunStartEvent as bj, type RunStateChanged as bk, type SettingsBadge as bl, type SettingsControl as bm, type SettingsDefinition as bn, type SettingsItem as bo, type SettingsOption as bp, type SettingsSection as bq, type SkillRegistration as br, type ThinkingDelta as bs, type ToolCallContext as bt, type ToolCallDelta as bu, type ToolCallPhase as bv, type ToolCallPresentationInput as bw, type ToolCallPresentationOutput as bx, type ToolInvocationContext as by, type ToolMessage as bz, type LoadResult as c, type AgentConfiguration as d, type HistorySeed as e, type AgentId as f, type AgentDeletionRequest as g, type MessageRevisionResult as h, type RunId as i, type ToolCallId as j, type EventCursor as k, type UserInput as l, type AgentRun as m, type EntryPhaseSpec as n, type AgentListCursor as o, type Page as p, type AgentSummary as q, type RunState as r, type RunListCursor as s, type RunSummary as t, type InvocationCatalogEntry as u, type DurableConsumer as v, type RunSnapshot as w, type Message as x, type RunBoundary as y, type RunEvent as z };
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 { aF as AfterToolCall, f as AgentId, o as AgentListCursor, m as AgentRun, q as AgentSummary, aG as AssistantContent, $ as AssistantMessage, aH as BeforeToolCall, X as ContextCandidate, N as ContextCompactionRecord, C as ContextStatus, v as DurableConsumer, D as DurableRunEvent, aI as EventBus, k as EventCursor, aJ as EventId, aK as ExecOptions, aL as ExecResult, aM as ExtensionAPI, aN as ExtensionAgentConsumerDisposer, aO as ExtensionAgentsAPI, w as ExtensionCapability, aP as ExtensionCapabilityContribution, aQ as ExtensionContext, aR as ExtensionDisposer, aS as ExtensionFactory, aT as ExtensionFactoryResult, aU as ExtensionStateStore, aV as ExtensionToolContribution, aW as HookEvent, aX as HookEventType, aY as HookHandler, aZ as InteractionRecord, a_ as InternalModelLoopOptions, a$ as LiveInteractionEvent, y as Message, b0 as MessageBase, b1 as MessageCommitted, b2 as MessageContent, b3 as MessageDelta, M as MessageId, b4 as MessageRevised, h as MessageRevisionResult, b5 as ModelInvokeOutput, p as Page, P as Phase, b6 as PhaseContext, b7 as PhaseExecution, b8 as PhaseExecutionIdentity, b9 as PhaseInput, ba as PhaseInvocation, bb as PhaseMessageManager, bc as PhaseOutput, bd as PhaseRegistration, be as PhaseRunHandler, bf as PhaseState, bg as PhaseStatus, bh as PhaseStatusState, z as RunBoundary, bi as RunEndEvent, B as RunEvent, Z as RunFailure, i as RunId, a1 as RunInteraction, bj as RunInteractionBoundary, bk as RunInteractionCancelledError, bl as RunInteractionDriver, bm as RunInteractionState, bn as RunInteractionStatus, s as RunListCursor, x as RunSnapshot, bo as RunStartEvent, r as RunState, bp as RunStateChanged, t as RunSummary, bq as SettingsBadge, br as SettingsControl, bs as SettingsDefinition, bt as SettingsItem, bu as SettingsOption, bv as SettingsSection, bw as SkillRegistration, bx as ThinkingDelta, T as Tool, by as ToolCallContext, bz as ToolCallDelta, j as ToolCallId, bA as ToolCallPhase, bB as ToolCallPresentationInput, bC as ToolCallPresentationOutput, K as ToolCallSnapshot, bD as ToolInvocationContext, bE as ToolMessage, bF as ToolMessageContent, bG as ToolResultBlock, bH as ToolResultRecord, bI as ToolStateChanged, bJ as ToolUseBlock, U as UserContent, l as UserInput, bK as UserMessage, bL as WithdrawnUserInput } from './index-jC_-oKbx.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-OBJCF_CO.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 ExtensionCapability, x as RunSnapshot, y as Message, z as RunBoundary, B as RunEvent, F as DurableStore, G as AgentRecord, J as RunRecord, K as ToolCallSnapshot, N as ContextCompactionRecord, O as OwnerLease, Q as OwnedStore, V as ConfigToken, W as ExecutionId, X as ContextCandidate, Y as RunClaim, Z as RunFailure, _ as ExecutionToken, $ as AssistantMessage, a0 as ExecutionCheckpoint, a1 as RunInteraction, a2 as ToolCommit, a3 as ToolCallReservation, a4 as ToolBatchCommit, a5 as Outcome, a6 as ConsumerRegistration, a7 as RetentionResult, a8 as ConfigProvider, a9 as ConfigurationSnapshot, aa as ConfigPutResult, ab as ConfigResolution, ac as PhaseRegistry, ad as LoadedExtension } from './index-jC_-oKbx.js';
2
- export { ae as DefinitionLayer, af as ExtensionActivationError, ag as ExtensionActivationResult, ah as ExtensionContribution, ai as ExtensionLifetimeError, aj as ExtensionLifetimeErrorCode, ak as ExtensionLoadInput, al as LoadExtensionsResult, am as ModelRetry, an as OpaqueId, ao as OwnerToken, ap as PhaseRegistrySelection, aq as ResolvedResourceView, ar as ResourceDiagnostic, as as ResourceRef, at as ResourceRegistry, au as ResourceRegistryError, av as ResourceRegistryErrorCode, aw as ResourceSourceId, ax as ResourceView, ay as RuntimeBootstrapRegistry, az as RuntimeExtensionLifetime, aA as extensionSourceId, aB as isConfigurationSnapshot, aC as mergeToolCall, aD as parseAgentDefinition, aE as resolveConfigurationSnapshot } from './index-jC_-oKbx.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-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';
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';
@@ -135,13 +135,6 @@ declare class AgentRuntime implements AgentRuntime$1 {
135
135
  signal: AbortSignal;
136
136
  }>): void | Promise<void>;
137
137
  }): Promise<DurableConsumer>;
138
- listCapabilities(): readonly ExtensionCapability[];
139
- onCapabilitiesChanged(listener: (capabilities: readonly ExtensionCapability[]) => void): () => void;
140
- triggerUiAction(event: {
141
- contributionId: string;
142
- actionId: string;
143
- scope?: ScopeRef;
144
- }): void;
145
138
  private liveInteract;
146
139
  close(): Promise<void>;
147
140
  snapshot(runId: RunId): Promise<RunSnapshot>;
package/dist/runtime.js CHANGED
@@ -7300,11 +7300,9 @@ function createExtensionAPI(hooks, options, runtime, eventBus) {
7300
7300
  on: (eventType, handler) => {
7301
7301
  assertActive();
7302
7302
  hooks?.on(eventType, handler);
7303
- trackCleanup?.(() => hooks?.off(eventType, handler));
7304
- },
7305
- off: (eventType, handler) => {
7306
- assertActive();
7307
- hooks?.off(eventType, handler);
7303
+ const unsubscribe = () => hooks?.off(eventType, handler);
7304
+ trackCleanup?.(unsubscribe);
7305
+ return unsubscribe;
7308
7306
  }
7309
7307
  },
7310
7308
  config: {
@@ -7448,6 +7446,11 @@ function createExtensionAPI(hooks, options, runtime, eventBus) {
7448
7446
  if (!agentsDelegate) throw new Error("AgentRuntime is not available in this extension context.");
7449
7447
  return agentsDelegate.listRuns({ agentId, ...filter });
7450
7448
  },
7449
+ run: async (runId) => {
7450
+ assertActive();
7451
+ if (!agentsDelegate) throw new Error("AgentRuntime is not available in this extension context.");
7452
+ return agentsDelegate.snapshot(runId);
7453
+ },
7451
7454
  runPhase: async (agentId, runOpt) => {
7452
7455
  assertActive();
7453
7456
  if (!agentsDelegate) throw new Error("AgentRuntime is not available in this extension context.");
@@ -7483,33 +7486,10 @@ function createExtensionAPI(hooks, options, runtime, eventBus) {
7483
7486
  trackCleanup?.(unsubscribe);
7484
7487
  return unsubscribe;
7485
7488
  },
7486
- off: (event) => eventBus.off(event),
7487
- emit: (event, ...args) => eventBus.emit(event, ...args),
7488
- has: (event) => eventBus.has(event),
7489
- count: (event) => eventBus.count(event)
7489
+ emit: (event, ...args) => eventBus.emit(event, ...args)
7490
7490
  } : { on: () => () => {
7491
- }, off: () => {
7492
7491
  }, emit: () => {
7493
- }, has: () => false, count: () => 0 },
7494
- capabilities: {
7495
- contribute: (contribution) => {
7496
- assertActive();
7497
- if (!contribution || typeof contribution !== "object") {
7498
- throw new TypeError("Capability contribution must be an object.");
7499
- }
7500
- if (contribution.kind !== "tool") {
7501
- throw new TypeError(`Unsupported capability contribution kind: "${contribution.kind}".`);
7502
- }
7503
- if (typeof contribution.name !== "string" || contribution.name.trim() === "") {
7504
- throw new TypeError("Capability contribution requires a non-empty name.");
7505
- }
7506
- if (typeof contribution.description !== "string") {
7507
- throw new TypeError("Capability contribution requires a description string.");
7508
- }
7509
- return options?.contributeCapability ? options.contributeCapability(contribution) : () => {
7510
- };
7511
- }
7512
- },
7492
+ } },
7513
7493
  context: ctx
7514
7494
  };
7515
7495
  if (options?.namespaces) {
@@ -7764,20 +7744,6 @@ function createEventBus() {
7764
7744
  console.error(`[event-bus] Listener error for "${event}":`, err);
7765
7745
  }
7766
7746
  }
7767
- },
7768
- off(event) {
7769
- if (event) {
7770
- listeners.delete(event);
7771
- } else {
7772
- listeners.clear();
7773
- }
7774
- },
7775
- has(event) {
7776
- const set = listeners.get(event);
7777
- return set !== void 0 && set.size > 0;
7778
- },
7779
- count(event) {
7780
- return listeners.get(event)?.size ?? 0;
7781
7747
  }
7782
7748
  };
7783
7749
  }
@@ -7876,8 +7842,6 @@ var ExtensionRunner = class {
7876
7842
  bound = false;
7877
7843
  // Error listeners
7878
7844
  errorListeners = /* @__PURE__ */ new Set();
7879
- // Capability change listeners
7880
- capabilityListeners = /* @__PURE__ */ new Set();
7881
7845
  // Resource change listeners (for Registry live sync)
7882
7846
  resourceChangeListeners = /* @__PURE__ */ new Set();
7883
7847
  runtimeAgents;
@@ -7989,7 +7953,6 @@ var ExtensionRunner = class {
7989
7953
  tools: /* @__PURE__ */ new Map(),
7990
7954
  phases: /* @__PURE__ */ new Set(),
7991
7955
  skills: /* @__PURE__ */ new Set(),
7992
- capabilities: /* @__PURE__ */ new Map(),
7993
7956
  cleanup: [],
7994
7957
  runtime: createExtensionRuntime(),
7995
7958
  hostApi
@@ -8000,9 +7963,6 @@ var ExtensionRunner = class {
8000
7963
  if (typeof disposer === "function") extension.disposer = disposer;
8001
7964
  this.extensions.push(extension);
8002
7965
  this._phaseCache = null;
8003
- if (extension.capabilities.size > 0) {
8004
- this.notifyCapabilitiesChanged();
8005
- }
8006
7966
  } catch (error) {
8007
7967
  await this.rollbackExtension(extension);
8008
7968
  const message = error instanceof Error ? error.message : String(error);
@@ -8026,7 +7986,6 @@ var ExtensionRunner = class {
8026
7986
  tools: /* @__PURE__ */ new Map(),
8027
7987
  phases: /* @__PURE__ */ new Set(),
8028
7988
  skills: /* @__PURE__ */ new Set(),
8029
- capabilities: /* @__PURE__ */ new Map(),
8030
7989
  cleanup: [],
8031
7990
  runtime: createExtensionRuntime(),
8032
7991
  hostApi: this.host.extendApi?.(phase.name)
@@ -8092,7 +8051,6 @@ var ExtensionRunner = class {
8092
8051
  }
8093
8052
  this.extensions.length = 0;
8094
8053
  this.activeExtensionPhases.clear();
8095
- this.capabilityListeners.clear();
8096
8054
  this.resourceChangeListeners.clear();
8097
8055
  this.phases.clear();
8098
8056
  this._phaseCache = null;
@@ -8169,32 +8127,6 @@ var ExtensionRunner = class {
8169
8127
  }
8170
8128
  return void 0;
8171
8129
  }
8172
- // ---------------------------------------------------------------------------
8173
- // Capability management
8174
- // ---------------------------------------------------------------------------
8175
- /** Get all contributed capabilities across all extensions. */
8176
- getCapabilities() {
8177
- const result = [];
8178
- for (const ext of this.extensions) {
8179
- for (const contrib of ext.capabilities.values()) {
8180
- result.push({
8181
- extensionId: ext.id,
8182
- kind: contrib.kind,
8183
- name: contrib.name,
8184
- description: contrib.description
8185
- });
8186
- }
8187
- }
8188
- return Object.freeze(result);
8189
- }
8190
- /**
8191
- * Subscribe to capability changes (contributions added, removed, or extensions disposed).
8192
- * Returns an unsubscribe function.
8193
- */
8194
- onCapabilitiesChanged(listener) {
8195
- this.capabilityListeners.add(listener);
8196
- return () => this.capabilityListeners.delete(listener);
8197
- }
8198
8130
  /**
8199
8131
  * Subscribe to resource changes (tools, phases, skills registered, unregistered, or disposed).
8200
8132
  * Used by RuntimeBootstrapRegistry to re-commit implicit sources after activation.
@@ -8209,9 +8141,6 @@ var ExtensionRunner = class {
8209
8141
  await listener(kind);
8210
8142
  }
8211
8143
  }
8212
- triggerUiAction(event) {
8213
- this.events.emit("ui.action", event);
8214
- }
8215
8144
  // ---------------------------------------------------------------------------
8216
8145
  // Phase management
8217
8146
  // ---------------------------------------------------------------------------
@@ -8407,7 +8336,6 @@ var ExtensionRunner = class {
8407
8336
  unregisterProvider: (name) => this.unregisterProvider(name),
8408
8337
  registerTool: (tool, scope) => this.registerTool(extension, tool, scope),
8409
8338
  unregisterTool: (toolName, scope) => this.unregisterTool(extension, toolName, scope),
8410
- contributeCapability: (contribution) => this.contributeCapability(extension, contribution),
8411
8339
  context: extContext,
8412
8340
  namespaces,
8413
8341
  runtimeAgents: this.runtimeAgents,
@@ -8488,46 +8416,6 @@ var ExtensionRunner = class {
8488
8416
  if (!extension.tools.delete(regKey)) return Promise.resolve();
8489
8417
  return this.notifyResourceChange("tool");
8490
8418
  }
8491
- contributeCapability(extension, contribution) {
8492
- const key = `${contribution.kind}:${contribution.name}`;
8493
- const entry = {
8494
- kind: contribution.kind,
8495
- name: contribution.name,
8496
- description: contribution.description
8497
- };
8498
- extension.capabilities.set(key, entry);
8499
- if (this.extensions.includes(extension)) {
8500
- this.notifyCapabilitiesChanged();
8501
- }
8502
- let disposed = false;
8503
- const dispose = () => {
8504
- if (disposed) return;
8505
- disposed = true;
8506
- if (extension.capabilities.get(key) === entry) {
8507
- extension.capabilities.delete(key);
8508
- if (this.extensions.includes(extension)) {
8509
- this.notifyCapabilitiesChanged();
8510
- }
8511
- }
8512
- };
8513
- extension.cleanup.push(dispose);
8514
- return dispose;
8515
- }
8516
- notifyCapabilitiesChanged() {
8517
- const capabilities = this.getCapabilities();
8518
- for (const listener of this.capabilityListeners) {
8519
- try {
8520
- listener(capabilities);
8521
- } catch (error) {
8522
- this.emitError({
8523
- extensionPath: "<runtime>",
8524
- event: "capabilities_changed",
8525
- error: error instanceof Error ? error.message : String(error),
8526
- stack: error instanceof Error ? error.stack : void 0
8527
- });
8528
- }
8529
- }
8530
- }
8531
8419
  async registerPhase(extension, registration, scope) {
8532
8420
  if (typeof registration === "string") {
8533
8421
  if (registration.length === 0) {
@@ -8676,8 +8564,6 @@ var ExtensionRunner = class {
8676
8564
  }
8677
8565
  }
8678
8566
  extension.skills.clear();
8679
- const hadCapabilities = extension.capabilities.size > 0;
8680
- extension.capabilities.clear();
8681
8567
  for (const cleanup of [...extension.cleanup].reverse()) {
8682
8568
  await Promise.resolve().then(() => cleanup()).catch(() => void 0);
8683
8569
  }
@@ -8690,9 +8576,6 @@ var ExtensionRunner = class {
8690
8576
  await Promise.resolve().then(() => hostDispose()).catch(() => void 0);
8691
8577
  }
8692
8578
  this._phaseCache = null;
8693
- if (hadCapabilities) {
8694
- this.notifyCapabilitiesChanged();
8695
- }
8696
8579
  if (this.bound) {
8697
8580
  if (hadTools) await this.notifyResourceChange("tool");
8698
8581
  if (hadPhases) await this.notifyResourceChange("phase");
@@ -9859,18 +9742,6 @@ var AgentRuntime = class _AgentRuntime {
9859
9742
  });
9860
9743
  return { caughtUp: subscription.caughtUp.promise, done: subscription.done.promise, stop: () => controller.abort() };
9861
9744
  }
9862
- listCapabilities() {
9863
- this.assertOpen();
9864
- return this.resources.extensionRunner.getCapabilities();
9865
- }
9866
- onCapabilitiesChanged(listener) {
9867
- this.assertOpen();
9868
- return this.resources.extensionRunner.onCapabilitiesChanged(listener);
9869
- }
9870
- triggerUiAction(event) {
9871
- this.assertOpen();
9872
- this.resources.extensionRunner.triggerUiAction(event);
9873
- }
9874
9745
  liveInteract(runId, request, signal) {
9875
9746
  if (signal.aborted) {
9876
9747
  return Promise.reject(signal.reason ?? new Error("Run aborted"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rowan-agent/agent",
3
- "version": "0.31.0",
3
+ "version": "0.33.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",