@ai-agent-forge/plugin-sdk 0.88.0 → 0.88.1

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.
@@ -110,6 +110,30 @@ export interface SubagentCommunicationWiringV1 {
110
110
  text: string;
111
111
  }[];
112
112
  }
113
+ /**
114
+ * 模型目录条目的宿主结构视图(D-082 批 3b,契约 B):只暴露 provider-failover
115
+ * 装载预检消费的五个字段(structural、JSON-safe),不透出内核 Model 对象。
116
+ * `compat`/`thinkingLevelMap` 随目录条目可选。
117
+ */
118
+ export interface ModelCatalogModelViewV1 {
119
+ provider: string;
120
+ contextWindow: number;
121
+ maxTokens: number;
122
+ compat?: unknown;
123
+ thinkingLevelMap?: unknown;
124
+ }
125
+ /**
126
+ * 模型目录宿主服务(D-082 批 3b,契约 B;workspaceDirectory 同款可选宿主服务
127
+ * 成员先例):装载预检/目录快照读面(provider-failover 家族),零网络、零
128
+ * OAuth——全部是宿主静态目录与凭据条目的即时读投影。宿主缺模型目录能力时
129
+ * 该成员缺席,插件必须按可选拒绝装配,不得假设其存在。
130
+ */
131
+ export interface ModelCatalogV1 {
132
+ /** 未知 provider/model 对返回 undefined("无候选")。 */
133
+ resolveModel(provider: string, modelId: string): ModelCatalogModelViewV1 | undefined;
134
+ hasProvider(providerId: string): boolean;
135
+ hasConfiguredAuth(providerId: string): boolean;
136
+ }
113
137
  export interface HostCapabilities {
114
138
  apiVersion: typeof EXPERIMENTAL_PUBLIC_API_VERSION;
115
139
  mode: HostMode;
@@ -173,6 +197,12 @@ export interface HostCapabilities {
173
197
  * nothing when no agentDir is declared.
174
198
  */
175
199
  memoryStorage?: MemoryStorageComponentsV1;
200
+ /**
201
+ * 模型目录宿主服务(D-082 批 3b,契约 B):装载预检/目录快照读面
202
+ * (provider-failover 家族),零网络、零 OAuth——只读宿主静态模型目录与
203
+ * 凭据条目投影(`api.host.modelCatalog`)。缺席 = 宿主不提供目录读面。
204
+ */
205
+ modelCatalog?: ModelCatalogV1;
176
206
  }
177
207
  export interface DisposableRegistration {
178
208
  id: string;
@@ -1764,13 +1794,15 @@ export type StreamFnNext = (model: unknown, context: unknown, options: unknown)
1764
1794
  /**
1765
1795
  * Experimental request-time stream-function middleware (provider-failover
1766
1796
  * family): observe the provider stream's terminal state, substitute the
1767
- * request model, and replay. Wrappers run in registration order — the first
1768
- * registered wrapper is the outermost, its `next` covering every later
1769
- * wrapper plus the host default. Must return (a promise of) the event stream
1770
- * the caller consumes; failures belong inside the stream protocol, matching
1771
- * the host stream-function contract. A session whose caller supplied an
1772
- * explicit stream function bypasses the host default assembly entirely and
1773
- * never sees these wrappers.
1797
+ * request model, and replay. Wrapper order follows the registration
1798
+ * priority (contract A, D-082 批 3b): lower `priority` wraps outermost;
1799
+ * equal priorities keep registration order (first registered = outermost
1800
+ * within the same priority). The outermost wrapper's `next` covers every
1801
+ * later wrapper plus the host default. Must return (a promise of) the event
1802
+ * stream the caller consumes; failures belong inside the stream protocol,
1803
+ * matching the host stream-function contract. A session whose caller
1804
+ * supplied an explicit stream function bypasses the host default assembly
1805
+ * entirely and never sees these wrappers.
1774
1806
  */
1775
1807
  export type StreamFnWrapper = (model: unknown, context: unknown, options: unknown, next: StreamFnNext, host: StreamFnWrapperHostV1) => unknown;
1776
1808
  /**
@@ -1955,7 +1987,18 @@ export interface CapabilityAPI {
1955
1987
  */
1956
1988
  registerEntryProjection(projection: EntryProjection): DisposableRegistration;
1957
1989
  registerProviderHeaderTransform(name: string, transform: ProviderHeaderTransform): DisposableRegistration;
1958
- registerStreamFnWrapper(name: string, wrapper: StreamFnWrapper): DisposableRegistration;
1990
+ /**
1991
+ * Registers a stream-function wrapper (provider-failover family, contract
1992
+ * A D-082 批 3b). `options.priority` orders the wrapper chain: lower
1993
+ * values wrap outermost (default 0), so a rerouting wrapper can register
1994
+ * with a negative priority and stay outermost regardless of plugin load
1995
+ * order — every inner wrapper then observes the substituted model on each
1996
+ * retry attempt. Equal priorities keep registration order (first
1997
+ * registered = outermost), the pre-priority semantics.
1998
+ */
1999
+ registerStreamFnWrapper(name: string, wrapper: StreamFnWrapper, options?: {
2000
+ priority?: number;
2001
+ }): DisposableRegistration;
1959
2002
  registerSkill(definition: SkillDefinition): DisposableRegistration;
1960
2003
  registerRetryPolicy(name: string, policy: RetryPolicy): DisposableRegistration;
1961
2004
  registerCompactionPolicy(name: string, policy: CompactionPolicy): DisposableRegistration;