@easbot/llm 0.3.45 → 0.3.46

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.
package/dist/index.d.cts CHANGED
@@ -1983,6 +1983,7 @@ declare namespace ProviderTransform {
1983
1983
  function topP(model: Provider.Model): 1 | 0.95 | undefined;
1984
1984
  function topK(model: Provider.Model): 20 | 40 | 64 | undefined;
1985
1985
  function variants(model: Provider.Model): Record<string, Record<string, any>>;
1986
+ function resolveVariant(model: Provider.Model, variant: string | undefined): Record<string, any>;
1986
1987
  function options(input: {
1987
1988
  model: Provider.Model;
1988
1989
  sessionId: string;
@@ -9085,103 +9086,6 @@ declare namespace AgentLoop {
9085
9086
  function run(input: Input): Promise<Result>;
9086
9087
  }
9087
9088
 
9088
- declare enum SdkEventType {
9089
- SDK_SESSION_STATUS = "agent.status",
9090
- SDK_ERROR = "sdk.error",
9091
- SDK_SESSION_UPDATE = "sdk.session_update",
9092
- SDK_PERMISSION_REQUEST = "sdk.permission_request",
9093
- SDK_SESSION_DELETED = "sdk.session_deleted"
9094
- }
9095
- declare const SdkSessionStatusSchema: z$1.ZodObject<{
9096
- sessionId: z$1.ZodString;
9097
- status: z$1.ZodEnum<{
9098
- idle: "idle";
9099
- busy: "busy";
9100
- retry: "retry";
9101
- }>;
9102
- timestamp: z$1.ZodNumber;
9103
- }, z$1.core.$strip>;
9104
- type SdkSessionStatusProps = z$1.infer<typeof SdkSessionStatusSchema>;
9105
- declare const SdkErrorSchema: z$1.ZodObject<{
9106
- error: z$1.ZodString;
9107
- context: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
9108
- timestamp: z$1.ZodNumber;
9109
- }, z$1.core.$strip>;
9110
- type SdkErrorProps = z$1.infer<typeof SdkErrorSchema>;
9111
- declare const SdkSessionUpdateSchema: z$1.ZodObject<{
9112
- sessionId: z$1.ZodString;
9113
- sessionEvent: z$1.ZodUnknown;
9114
- timestamp: z$1.ZodNumber;
9115
- }, z$1.core.$strip>;
9116
- type SdkSessionUpdateProps = z$1.infer<typeof SdkSessionUpdateSchema>;
9117
- declare const SdkPermissionRequestSchema: z$1.ZodObject<{
9118
- requestId: z$1.ZodString;
9119
- sessionId: z$1.ZodString;
9120
- permission: z$1.ZodString;
9121
- tool: z$1.ZodOptional<z$1.ZodObject<{
9122
- callId: z$1.ZodOptional<z$1.ZodString>;
9123
- }, z$1.core.$strip>>;
9124
- metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
9125
- timestamp: z$1.ZodNumber;
9126
- }, z$1.core.$strip>;
9127
- type SdkPermissionRequestProps = z$1.infer<typeof SdkPermissionRequestSchema>;
9128
- declare const SdkSessionDeletedSchema: z$1.ZodObject<{
9129
- sessionId: z$1.ZodString;
9130
- timestamp: z$1.ZodNumber;
9131
- }, z$1.core.$strip>;
9132
- type SdkSessionDeletedProps = z$1.infer<typeof SdkSessionDeletedSchema>;
9133
- type LocalEventProperties = SdkSessionStatusProps | SdkErrorProps | SdkSessionUpdateProps | SdkPermissionRequestProps | SdkSessionDeletedProps;
9134
- interface LocalEvent<T extends SdkEventType = SdkEventType> {
9135
- type: T;
9136
- properties: LocalEventProperties;
9137
- }
9138
- type LocalEventCallback = (event: LocalEvent) => void | Promise<void>;
9139
- declare class SdkEventBus {
9140
- private subscriptions;
9141
- private wildcardSubscriptions;
9142
- private destroyed;
9143
- subscribe(eventType: SdkEventType, callback: LocalEventCallback): () => void;
9144
- subscribeAll(callback: LocalEventCallback): () => void;
9145
- publish(event: LocalEvent): Promise<void>;
9146
- publishSync(event: LocalEvent): void;
9147
- private collectCallbacks;
9148
- subscriberCount(eventType?: SdkEventType): number;
9149
- totalSubscribers(): number;
9150
- hasSubscribers(eventType?: SdkEventType): boolean;
9151
- clear(): void;
9152
- destroy(): void;
9153
- isDestroyed(): boolean;
9154
- }
9155
-
9156
- declare class SdkEventBridge {
9157
- private sdk;
9158
- private sdkEventBus?;
9159
- private abortController;
9160
- private started;
9161
- private readonly sessionFilter?;
9162
- private _cachedPrimaryAgents;
9163
- private readonly _messageMetaCache;
9164
- constructor(sdk: EasbotClient, localEventBus?: SdkEventBus, sessionFilter?: (sessionId: string) => boolean);
9165
- private getMessageMeta;
9166
- private clearMessageMetaCache;
9167
- private pushSessionEvent;
9168
- start(): Promise<void>;
9169
- stop(): Promise<void>;
9170
- isStarted(): boolean;
9171
- private runEventLoop;
9172
- private handleEvent;
9173
- private handleSessionDeleted;
9174
- private handlePermissionAsked;
9175
- private handleMessagePartUpdated;
9176
- private handleToolPart;
9177
- private handleTextPart;
9178
- private handleStepStartPart;
9179
- private handleStepFinishPart;
9180
- private handleReasoningPart;
9181
- private handleSessionStatus;
9182
- private shouldFilterAgent;
9183
- }
9184
-
9185
9089
  interface AgentClientFilterConfig {
9186
9090
  includeThinking: boolean;
9187
9091
  includeToolDetails: boolean;
@@ -9292,6 +9196,136 @@ declare class SdkMessageCollector {
9292
9196
  reset(): void;
9293
9197
  }
9294
9198
 
9199
+ declare const SDK_LOOP_COLLECTOR_FILTER: AgentClientFilterConfig;
9200
+ declare namespace SdkLoop {
9201
+ type RoundContext = AgentLoop.RoundContext;
9202
+ interface Input {
9203
+ model: Provider.Model;
9204
+ agent: string;
9205
+ sessionId: string;
9206
+ userMessageId: string;
9207
+ user: LanguageUserMessage;
9208
+ abort: AbortSignal;
9209
+ messages?: ModelMessage[];
9210
+ system?: string[];
9211
+ tools?: Record<string, Tool$1>;
9212
+ variant?: string;
9213
+ mode?: ContextMode;
9214
+ cwd?: string;
9215
+ root?: string;
9216
+ maxSteps?: typeof DEFAULT_MAX_STEPS | number;
9217
+ directory?: string;
9218
+ filter?: AgentClientFilterConfig;
9219
+ onSessionEvent?: (event: SessionEvent) => void | Promise<void>;
9220
+ onMessage?: (message: AgentMessage) => void | Promise<void>;
9221
+ onEvent?: AgentLoop.Input['onEvent'];
9222
+ onRoundFinish?: AgentLoop.Input['onRoundFinish'];
9223
+ buildRound?: AgentLoop.Input['buildRound'];
9224
+ onCompact?: AgentLoop.Input['onCompact'];
9225
+ shouldContinue?: AgentLoop.Input['shouldContinue'];
9226
+ }
9227
+ interface Result extends AgentLoop.Result {
9228
+ }
9229
+ function run(input: Input): Promise<Result>;
9230
+ }
9231
+
9232
+ declare enum SdkEventType {
9233
+ SDK_SESSION_STATUS = "agent.status",
9234
+ SDK_ERROR = "sdk.error",
9235
+ SDK_SESSION_UPDATE = "sdk.session_update",
9236
+ SDK_PERMISSION_REQUEST = "sdk.permission_request",
9237
+ SDK_SESSION_DELETED = "sdk.session_deleted"
9238
+ }
9239
+ declare const SdkSessionStatusSchema: z$1.ZodObject<{
9240
+ sessionId: z$1.ZodString;
9241
+ status: z$1.ZodEnum<{
9242
+ idle: "idle";
9243
+ busy: "busy";
9244
+ retry: "retry";
9245
+ }>;
9246
+ timestamp: z$1.ZodNumber;
9247
+ }, z$1.core.$strip>;
9248
+ type SdkSessionStatusProps = z$1.infer<typeof SdkSessionStatusSchema>;
9249
+ declare const SdkErrorSchema: z$1.ZodObject<{
9250
+ error: z$1.ZodString;
9251
+ context: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
9252
+ timestamp: z$1.ZodNumber;
9253
+ }, z$1.core.$strip>;
9254
+ type SdkErrorProps = z$1.infer<typeof SdkErrorSchema>;
9255
+ declare const SdkSessionUpdateSchema: z$1.ZodObject<{
9256
+ sessionId: z$1.ZodString;
9257
+ sessionEvent: z$1.ZodUnknown;
9258
+ timestamp: z$1.ZodNumber;
9259
+ }, z$1.core.$strip>;
9260
+ type SdkSessionUpdateProps = z$1.infer<typeof SdkSessionUpdateSchema>;
9261
+ declare const SdkPermissionRequestSchema: z$1.ZodObject<{
9262
+ requestId: z$1.ZodString;
9263
+ sessionId: z$1.ZodString;
9264
+ permission: z$1.ZodString;
9265
+ tool: z$1.ZodOptional<z$1.ZodObject<{
9266
+ callId: z$1.ZodOptional<z$1.ZodString>;
9267
+ }, z$1.core.$strip>>;
9268
+ metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
9269
+ timestamp: z$1.ZodNumber;
9270
+ }, z$1.core.$strip>;
9271
+ type SdkPermissionRequestProps = z$1.infer<typeof SdkPermissionRequestSchema>;
9272
+ declare const SdkSessionDeletedSchema: z$1.ZodObject<{
9273
+ sessionId: z$1.ZodString;
9274
+ timestamp: z$1.ZodNumber;
9275
+ }, z$1.core.$strip>;
9276
+ type SdkSessionDeletedProps = z$1.infer<typeof SdkSessionDeletedSchema>;
9277
+ type LocalEventProperties = SdkSessionStatusProps | SdkErrorProps | SdkSessionUpdateProps | SdkPermissionRequestProps | SdkSessionDeletedProps;
9278
+ interface LocalEvent<T extends SdkEventType = SdkEventType> {
9279
+ type: T;
9280
+ properties: LocalEventProperties;
9281
+ }
9282
+ type LocalEventCallback = (event: LocalEvent) => void | Promise<void>;
9283
+ declare class SdkEventBus {
9284
+ private subscriptions;
9285
+ private wildcardSubscriptions;
9286
+ private destroyed;
9287
+ subscribe(eventType: SdkEventType, callback: LocalEventCallback): () => void;
9288
+ subscribeAll(callback: LocalEventCallback): () => void;
9289
+ publish(event: LocalEvent): Promise<void>;
9290
+ publishSync(event: LocalEvent): void;
9291
+ private collectCallbacks;
9292
+ subscriberCount(eventType?: SdkEventType): number;
9293
+ totalSubscribers(): number;
9294
+ hasSubscribers(eventType?: SdkEventType): boolean;
9295
+ clear(): void;
9296
+ destroy(): void;
9297
+ isDestroyed(): boolean;
9298
+ }
9299
+
9300
+ declare class SdkEventBridge {
9301
+ private sdk;
9302
+ private sdkEventBus?;
9303
+ private abortController;
9304
+ private started;
9305
+ private readonly sessionFilter?;
9306
+ private _cachedPrimaryAgents;
9307
+ private readonly _messageMetaCache;
9308
+ constructor(sdk: EasbotClient, localEventBus?: SdkEventBus, sessionFilter?: (sessionId: string) => boolean);
9309
+ private getMessageMeta;
9310
+ private clearMessageMetaCache;
9311
+ private pushSessionEvent;
9312
+ start(): Promise<void>;
9313
+ stop(): Promise<void>;
9314
+ isStarted(): boolean;
9315
+ private runEventLoop;
9316
+ private handleEvent;
9317
+ private handleSessionDeleted;
9318
+ private handlePermissionAsked;
9319
+ private handleMessagePartUpdated;
9320
+ private handleToolPart;
9321
+ private handleTextPart;
9322
+ private handleStepStartPart;
9323
+ private handleStepFinishPart;
9324
+ private handleReasoningPart;
9325
+ private handleSessionStatus;
9326
+ private shouldFilterAgent;
9327
+ }
9328
+
9295
9329
  interface ProcessorSdkBridgeOptions {
9296
9330
  eventBus: SdkEventBus;
9297
9331
  directory: string;
@@ -10600,4 +10634,4 @@ interface SyncMetaCompatibleDB {
10600
10634
  type MetaEntry = readonly [key: string, value: string];
10601
10635
  declare function syncMeta(db: SyncMetaCompatibleDB, entries: ReadonlyArray<MetaEntry>): void;
10602
10636
 
10603
- export { type AdaptedToolSchema, type AdapterRegistry, Agent, type AgentClientFilterConfig, AgentLoop, type AgentMessage, type StateResult as AgentStateResult, type AnyModelInput, BUILTIN_AGENTS, type BuildPromptOptions, CUSTOM_PROVIDER_DEFINITIONS, type CoercionTarget, type CompletenessResult, Config, type ConsistencyResult, type ContentQualityResult, type ContextRelevancyResult, type CorrectnessResult, DEBUG_AGENT_FILTER, DEFAULT_AGENT_FILTER, DEFAULT_ENABLED_PROVIDERS, DEFAULT_MAX_STEPS, DEFAULT_REMOTE_TIMEOUT, EmbeddingProvider, type EvaluationBase, type EvaluationInput, EvaluationProvider, type EvaluationResult, type EvaluationType, type ExtractedEntity, type ExtractedRelation, type ExtractionResult, type FactCheckingResult, type FaithfulnessResult, Flag, type GoalCompletionResult, type GraphEntityTypeDef, GraphProvider, type GraphRelationTypeDef, type IConfigProvider, type IGlobalPathProvider, type IInstallationProvider, type IInstanceProvider, type ILLM, type ILLMCapabilities, type ILLMInitConfig, type ILLMModels, LLMConfig, LLMConfig as LLMConfigType, LanguageProvider, type LanguageUserMessage, LocalAgent, type LocalAgentConfig, LocalAgentError, Loop, Message, type MetaEntry, type ModelEntity, type ModelIdentifier, type ModelInput, type ModelInputLike, type ModelKind, ModelManager, ModelsDev, type ModerationCategory, type ModerationResult, type OpenaiCompatibleProvider, type OpenaiCompatibleProviderSettings, PROVIDER_DISPLAY_NAMES, type PartData, type ProbeEmbeddingOptions, ProcessorSdkBridge, type ProcessorSdkBridgeOptions, Provider, ProviderAuth, ProviderAuthMethod, ProviderAuthMethod as ProviderAuthMethodType, ProviderConfig, ProviderConfig as ProviderConfigType, ProviderError, ProviderTransform, type ReadabilityResult, type RelevancyResult, RemoteAgent, type RemoteAgentConfig, RemoteAgentError, RemoteAgentHandler, type RemoteAgentHandlerConfig, type RemoteInteractionResult, RerankProvider, type SchemaCoercion, type ScoredEvaluation, SdkEventBridge, SdkEventBus, SdkEventType, SdkMessageCollector, type SdkSessionStatusProps, type SessionEvent, StreamProcessor, SubAgent, SubAgentError, type SubAgentRegistryConfig, type SubAgentRunInput, SummaryProvider, Tool, ToolRegistry, Truncate, adaptToolSchema, adaptTools, buildEntityExtractionPrompt, createOpenaiCompatible, deriveModelIdentifier, extractEntitiesByRules, getAdapterRegistry, getGlobal, getIConfigProvider, getIGlobalPathProvider, getIInstallationProvider, getIInstanceProvider, hasAdapterRegistry, inferEntityType, isModelEntity, normalizeExtractionResult, openaiCompatible, parseEntityExtractionResult, probeEmbeddingDims, readEnvString, readFlagBool, readFlagNumber, resetGlobalAdapter, resolveEmbeddingModel, resolveGraphModel, resolveLanguageModel, resolveModel, resolveModelId, resolveModelIdentifier, resolveRerankModel, sanitizeEntityToken, setAdapterRegistry, setGlobalAdapter, syncMeta, toModel, toRuleset };
10637
+ export { type AdaptedToolSchema, type AdapterRegistry, Agent, type AgentClientFilterConfig, AgentLoop, type AgentMessage, type StateResult as AgentStateResult, type AnyModelInput, BUILTIN_AGENTS, type BuildPromptOptions, CUSTOM_PROVIDER_DEFINITIONS, type CoercionTarget, type CompletenessResult, Config, type ConsistencyResult, type ContentQualityResult, type ContextRelevancyResult, type CorrectnessResult, DEBUG_AGENT_FILTER, DEFAULT_AGENT_FILTER, DEFAULT_ENABLED_PROVIDERS, DEFAULT_MAX_STEPS, DEFAULT_REMOTE_TIMEOUT, EmbeddingProvider, type EvaluationBase, type EvaluationInput, EvaluationProvider, type EvaluationResult, type EvaluationType, type ExtractedEntity, type ExtractedRelation, type ExtractionResult, type FactCheckingResult, type FaithfulnessResult, Flag, type GoalCompletionResult, type GraphEntityTypeDef, GraphProvider, type GraphRelationTypeDef, type IConfigProvider, type IGlobalPathProvider, type IInstallationProvider, type IInstanceProvider, type ILLM, type ILLMCapabilities, type ILLMInitConfig, type ILLMModels, LLMConfig, LLMConfig as LLMConfigType, LanguageProvider, type LanguageUserMessage, LocalAgent, type LocalAgentConfig, LocalAgentError, Loop, Message, type MetaEntry, type ModelEntity, type ModelIdentifier, type ModelInput, type ModelInputLike, type ModelKind, ModelManager, ModelsDev, type ModerationCategory, type ModerationResult, type OpenaiCompatibleProvider, type OpenaiCompatibleProviderSettings, PROVIDER_DISPLAY_NAMES, type PartData, type ProbeEmbeddingOptions, ProcessorSdkBridge, type ProcessorSdkBridgeOptions, Provider, ProviderAuth, ProviderAuthMethod, ProviderAuthMethod as ProviderAuthMethodType, ProviderConfig, ProviderConfig as ProviderConfigType, ProviderError, ProviderTransform, type ReadabilityResult, type RelevancyResult, RemoteAgent, type RemoteAgentConfig, RemoteAgentError, RemoteAgentHandler, type RemoteAgentHandlerConfig, type RemoteInteractionResult, RerankProvider, SDK_LOOP_COLLECTOR_FILTER, type SchemaCoercion, type ScoredEvaluation, SdkEventBridge, SdkEventBus, SdkEventType, SdkLoop, SdkMessageCollector, type SdkSessionStatusProps, type SessionEvent, StreamProcessor, SubAgent, SubAgentError, type SubAgentRegistryConfig, type SubAgentRunInput, SummaryProvider, Tool, ToolRegistry, Truncate, adaptToolSchema, adaptTools, buildEntityExtractionPrompt, createOpenaiCompatible, deriveModelIdentifier, extractEntitiesByRules, getAdapterRegistry, getGlobal, getIConfigProvider, getIGlobalPathProvider, getIInstallationProvider, getIInstanceProvider, hasAdapterRegistry, inferEntityType, isModelEntity, normalizeExtractionResult, openaiCompatible, parseEntityExtractionResult, probeEmbeddingDims, readEnvString, readFlagBool, readFlagNumber, resetGlobalAdapter, resolveEmbeddingModel, resolveGraphModel, resolveLanguageModel, resolveModel, resolveModelId, resolveModelIdentifier, resolveRerankModel, sanitizeEntityToken, setAdapterRegistry, setGlobalAdapter, syncMeta, toModel, toRuleset };
package/dist/index.d.ts CHANGED
@@ -1983,6 +1983,7 @@ declare namespace ProviderTransform {
1983
1983
  function topP(model: Provider.Model): 1 | 0.95 | undefined;
1984
1984
  function topK(model: Provider.Model): 20 | 40 | 64 | undefined;
1985
1985
  function variants(model: Provider.Model): Record<string, Record<string, any>>;
1986
+ function resolveVariant(model: Provider.Model, variant: string | undefined): Record<string, any>;
1986
1987
  function options(input: {
1987
1988
  model: Provider.Model;
1988
1989
  sessionId: string;
@@ -9085,103 +9086,6 @@ declare namespace AgentLoop {
9085
9086
  function run(input: Input): Promise<Result>;
9086
9087
  }
9087
9088
 
9088
- declare enum SdkEventType {
9089
- SDK_SESSION_STATUS = "agent.status",
9090
- SDK_ERROR = "sdk.error",
9091
- SDK_SESSION_UPDATE = "sdk.session_update",
9092
- SDK_PERMISSION_REQUEST = "sdk.permission_request",
9093
- SDK_SESSION_DELETED = "sdk.session_deleted"
9094
- }
9095
- declare const SdkSessionStatusSchema: z$1.ZodObject<{
9096
- sessionId: z$1.ZodString;
9097
- status: z$1.ZodEnum<{
9098
- idle: "idle";
9099
- busy: "busy";
9100
- retry: "retry";
9101
- }>;
9102
- timestamp: z$1.ZodNumber;
9103
- }, z$1.core.$strip>;
9104
- type SdkSessionStatusProps = z$1.infer<typeof SdkSessionStatusSchema>;
9105
- declare const SdkErrorSchema: z$1.ZodObject<{
9106
- error: z$1.ZodString;
9107
- context: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
9108
- timestamp: z$1.ZodNumber;
9109
- }, z$1.core.$strip>;
9110
- type SdkErrorProps = z$1.infer<typeof SdkErrorSchema>;
9111
- declare const SdkSessionUpdateSchema: z$1.ZodObject<{
9112
- sessionId: z$1.ZodString;
9113
- sessionEvent: z$1.ZodUnknown;
9114
- timestamp: z$1.ZodNumber;
9115
- }, z$1.core.$strip>;
9116
- type SdkSessionUpdateProps = z$1.infer<typeof SdkSessionUpdateSchema>;
9117
- declare const SdkPermissionRequestSchema: z$1.ZodObject<{
9118
- requestId: z$1.ZodString;
9119
- sessionId: z$1.ZodString;
9120
- permission: z$1.ZodString;
9121
- tool: z$1.ZodOptional<z$1.ZodObject<{
9122
- callId: z$1.ZodOptional<z$1.ZodString>;
9123
- }, z$1.core.$strip>>;
9124
- metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
9125
- timestamp: z$1.ZodNumber;
9126
- }, z$1.core.$strip>;
9127
- type SdkPermissionRequestProps = z$1.infer<typeof SdkPermissionRequestSchema>;
9128
- declare const SdkSessionDeletedSchema: z$1.ZodObject<{
9129
- sessionId: z$1.ZodString;
9130
- timestamp: z$1.ZodNumber;
9131
- }, z$1.core.$strip>;
9132
- type SdkSessionDeletedProps = z$1.infer<typeof SdkSessionDeletedSchema>;
9133
- type LocalEventProperties = SdkSessionStatusProps | SdkErrorProps | SdkSessionUpdateProps | SdkPermissionRequestProps | SdkSessionDeletedProps;
9134
- interface LocalEvent<T extends SdkEventType = SdkEventType> {
9135
- type: T;
9136
- properties: LocalEventProperties;
9137
- }
9138
- type LocalEventCallback = (event: LocalEvent) => void | Promise<void>;
9139
- declare class SdkEventBus {
9140
- private subscriptions;
9141
- private wildcardSubscriptions;
9142
- private destroyed;
9143
- subscribe(eventType: SdkEventType, callback: LocalEventCallback): () => void;
9144
- subscribeAll(callback: LocalEventCallback): () => void;
9145
- publish(event: LocalEvent): Promise<void>;
9146
- publishSync(event: LocalEvent): void;
9147
- private collectCallbacks;
9148
- subscriberCount(eventType?: SdkEventType): number;
9149
- totalSubscribers(): number;
9150
- hasSubscribers(eventType?: SdkEventType): boolean;
9151
- clear(): void;
9152
- destroy(): void;
9153
- isDestroyed(): boolean;
9154
- }
9155
-
9156
- declare class SdkEventBridge {
9157
- private sdk;
9158
- private sdkEventBus?;
9159
- private abortController;
9160
- private started;
9161
- private readonly sessionFilter?;
9162
- private _cachedPrimaryAgents;
9163
- private readonly _messageMetaCache;
9164
- constructor(sdk: EasbotClient, localEventBus?: SdkEventBus, sessionFilter?: (sessionId: string) => boolean);
9165
- private getMessageMeta;
9166
- private clearMessageMetaCache;
9167
- private pushSessionEvent;
9168
- start(): Promise<void>;
9169
- stop(): Promise<void>;
9170
- isStarted(): boolean;
9171
- private runEventLoop;
9172
- private handleEvent;
9173
- private handleSessionDeleted;
9174
- private handlePermissionAsked;
9175
- private handleMessagePartUpdated;
9176
- private handleToolPart;
9177
- private handleTextPart;
9178
- private handleStepStartPart;
9179
- private handleStepFinishPart;
9180
- private handleReasoningPart;
9181
- private handleSessionStatus;
9182
- private shouldFilterAgent;
9183
- }
9184
-
9185
9089
  interface AgentClientFilterConfig {
9186
9090
  includeThinking: boolean;
9187
9091
  includeToolDetails: boolean;
@@ -9292,6 +9196,136 @@ declare class SdkMessageCollector {
9292
9196
  reset(): void;
9293
9197
  }
9294
9198
 
9199
+ declare const SDK_LOOP_COLLECTOR_FILTER: AgentClientFilterConfig;
9200
+ declare namespace SdkLoop {
9201
+ type RoundContext = AgentLoop.RoundContext;
9202
+ interface Input {
9203
+ model: Provider.Model;
9204
+ agent: string;
9205
+ sessionId: string;
9206
+ userMessageId: string;
9207
+ user: LanguageUserMessage;
9208
+ abort: AbortSignal;
9209
+ messages?: ModelMessage[];
9210
+ system?: string[];
9211
+ tools?: Record<string, Tool$1>;
9212
+ variant?: string;
9213
+ mode?: ContextMode;
9214
+ cwd?: string;
9215
+ root?: string;
9216
+ maxSteps?: typeof DEFAULT_MAX_STEPS | number;
9217
+ directory?: string;
9218
+ filter?: AgentClientFilterConfig;
9219
+ onSessionEvent?: (event: SessionEvent) => void | Promise<void>;
9220
+ onMessage?: (message: AgentMessage) => void | Promise<void>;
9221
+ onEvent?: AgentLoop.Input['onEvent'];
9222
+ onRoundFinish?: AgentLoop.Input['onRoundFinish'];
9223
+ buildRound?: AgentLoop.Input['buildRound'];
9224
+ onCompact?: AgentLoop.Input['onCompact'];
9225
+ shouldContinue?: AgentLoop.Input['shouldContinue'];
9226
+ }
9227
+ interface Result extends AgentLoop.Result {
9228
+ }
9229
+ function run(input: Input): Promise<Result>;
9230
+ }
9231
+
9232
+ declare enum SdkEventType {
9233
+ SDK_SESSION_STATUS = "agent.status",
9234
+ SDK_ERROR = "sdk.error",
9235
+ SDK_SESSION_UPDATE = "sdk.session_update",
9236
+ SDK_PERMISSION_REQUEST = "sdk.permission_request",
9237
+ SDK_SESSION_DELETED = "sdk.session_deleted"
9238
+ }
9239
+ declare const SdkSessionStatusSchema: z$1.ZodObject<{
9240
+ sessionId: z$1.ZodString;
9241
+ status: z$1.ZodEnum<{
9242
+ idle: "idle";
9243
+ busy: "busy";
9244
+ retry: "retry";
9245
+ }>;
9246
+ timestamp: z$1.ZodNumber;
9247
+ }, z$1.core.$strip>;
9248
+ type SdkSessionStatusProps = z$1.infer<typeof SdkSessionStatusSchema>;
9249
+ declare const SdkErrorSchema: z$1.ZodObject<{
9250
+ error: z$1.ZodString;
9251
+ context: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
9252
+ timestamp: z$1.ZodNumber;
9253
+ }, z$1.core.$strip>;
9254
+ type SdkErrorProps = z$1.infer<typeof SdkErrorSchema>;
9255
+ declare const SdkSessionUpdateSchema: z$1.ZodObject<{
9256
+ sessionId: z$1.ZodString;
9257
+ sessionEvent: z$1.ZodUnknown;
9258
+ timestamp: z$1.ZodNumber;
9259
+ }, z$1.core.$strip>;
9260
+ type SdkSessionUpdateProps = z$1.infer<typeof SdkSessionUpdateSchema>;
9261
+ declare const SdkPermissionRequestSchema: z$1.ZodObject<{
9262
+ requestId: z$1.ZodString;
9263
+ sessionId: z$1.ZodString;
9264
+ permission: z$1.ZodString;
9265
+ tool: z$1.ZodOptional<z$1.ZodObject<{
9266
+ callId: z$1.ZodOptional<z$1.ZodString>;
9267
+ }, z$1.core.$strip>>;
9268
+ metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
9269
+ timestamp: z$1.ZodNumber;
9270
+ }, z$1.core.$strip>;
9271
+ type SdkPermissionRequestProps = z$1.infer<typeof SdkPermissionRequestSchema>;
9272
+ declare const SdkSessionDeletedSchema: z$1.ZodObject<{
9273
+ sessionId: z$1.ZodString;
9274
+ timestamp: z$1.ZodNumber;
9275
+ }, z$1.core.$strip>;
9276
+ type SdkSessionDeletedProps = z$1.infer<typeof SdkSessionDeletedSchema>;
9277
+ type LocalEventProperties = SdkSessionStatusProps | SdkErrorProps | SdkSessionUpdateProps | SdkPermissionRequestProps | SdkSessionDeletedProps;
9278
+ interface LocalEvent<T extends SdkEventType = SdkEventType> {
9279
+ type: T;
9280
+ properties: LocalEventProperties;
9281
+ }
9282
+ type LocalEventCallback = (event: LocalEvent) => void | Promise<void>;
9283
+ declare class SdkEventBus {
9284
+ private subscriptions;
9285
+ private wildcardSubscriptions;
9286
+ private destroyed;
9287
+ subscribe(eventType: SdkEventType, callback: LocalEventCallback): () => void;
9288
+ subscribeAll(callback: LocalEventCallback): () => void;
9289
+ publish(event: LocalEvent): Promise<void>;
9290
+ publishSync(event: LocalEvent): void;
9291
+ private collectCallbacks;
9292
+ subscriberCount(eventType?: SdkEventType): number;
9293
+ totalSubscribers(): number;
9294
+ hasSubscribers(eventType?: SdkEventType): boolean;
9295
+ clear(): void;
9296
+ destroy(): void;
9297
+ isDestroyed(): boolean;
9298
+ }
9299
+
9300
+ declare class SdkEventBridge {
9301
+ private sdk;
9302
+ private sdkEventBus?;
9303
+ private abortController;
9304
+ private started;
9305
+ private readonly sessionFilter?;
9306
+ private _cachedPrimaryAgents;
9307
+ private readonly _messageMetaCache;
9308
+ constructor(sdk: EasbotClient, localEventBus?: SdkEventBus, sessionFilter?: (sessionId: string) => boolean);
9309
+ private getMessageMeta;
9310
+ private clearMessageMetaCache;
9311
+ private pushSessionEvent;
9312
+ start(): Promise<void>;
9313
+ stop(): Promise<void>;
9314
+ isStarted(): boolean;
9315
+ private runEventLoop;
9316
+ private handleEvent;
9317
+ private handleSessionDeleted;
9318
+ private handlePermissionAsked;
9319
+ private handleMessagePartUpdated;
9320
+ private handleToolPart;
9321
+ private handleTextPart;
9322
+ private handleStepStartPart;
9323
+ private handleStepFinishPart;
9324
+ private handleReasoningPart;
9325
+ private handleSessionStatus;
9326
+ private shouldFilterAgent;
9327
+ }
9328
+
9295
9329
  interface ProcessorSdkBridgeOptions {
9296
9330
  eventBus: SdkEventBus;
9297
9331
  directory: string;
@@ -10600,4 +10634,4 @@ interface SyncMetaCompatibleDB {
10600
10634
  type MetaEntry = readonly [key: string, value: string];
10601
10635
  declare function syncMeta(db: SyncMetaCompatibleDB, entries: ReadonlyArray<MetaEntry>): void;
10602
10636
 
10603
- export { type AdaptedToolSchema, type AdapterRegistry, Agent, type AgentClientFilterConfig, AgentLoop, type AgentMessage, type StateResult as AgentStateResult, type AnyModelInput, BUILTIN_AGENTS, type BuildPromptOptions, CUSTOM_PROVIDER_DEFINITIONS, type CoercionTarget, type CompletenessResult, Config, type ConsistencyResult, type ContentQualityResult, type ContextRelevancyResult, type CorrectnessResult, DEBUG_AGENT_FILTER, DEFAULT_AGENT_FILTER, DEFAULT_ENABLED_PROVIDERS, DEFAULT_MAX_STEPS, DEFAULT_REMOTE_TIMEOUT, EmbeddingProvider, type EvaluationBase, type EvaluationInput, EvaluationProvider, type EvaluationResult, type EvaluationType, type ExtractedEntity, type ExtractedRelation, type ExtractionResult, type FactCheckingResult, type FaithfulnessResult, Flag, type GoalCompletionResult, type GraphEntityTypeDef, GraphProvider, type GraphRelationTypeDef, type IConfigProvider, type IGlobalPathProvider, type IInstallationProvider, type IInstanceProvider, type ILLM, type ILLMCapabilities, type ILLMInitConfig, type ILLMModels, LLMConfig, LLMConfig as LLMConfigType, LanguageProvider, type LanguageUserMessage, LocalAgent, type LocalAgentConfig, LocalAgentError, Loop, Message, type MetaEntry, type ModelEntity, type ModelIdentifier, type ModelInput, type ModelInputLike, type ModelKind, ModelManager, ModelsDev, type ModerationCategory, type ModerationResult, type OpenaiCompatibleProvider, type OpenaiCompatibleProviderSettings, PROVIDER_DISPLAY_NAMES, type PartData, type ProbeEmbeddingOptions, ProcessorSdkBridge, type ProcessorSdkBridgeOptions, Provider, ProviderAuth, ProviderAuthMethod, ProviderAuthMethod as ProviderAuthMethodType, ProviderConfig, ProviderConfig as ProviderConfigType, ProviderError, ProviderTransform, type ReadabilityResult, type RelevancyResult, RemoteAgent, type RemoteAgentConfig, RemoteAgentError, RemoteAgentHandler, type RemoteAgentHandlerConfig, type RemoteInteractionResult, RerankProvider, type SchemaCoercion, type ScoredEvaluation, SdkEventBridge, SdkEventBus, SdkEventType, SdkMessageCollector, type SdkSessionStatusProps, type SessionEvent, StreamProcessor, SubAgent, SubAgentError, type SubAgentRegistryConfig, type SubAgentRunInput, SummaryProvider, Tool, ToolRegistry, Truncate, adaptToolSchema, adaptTools, buildEntityExtractionPrompt, createOpenaiCompatible, deriveModelIdentifier, extractEntitiesByRules, getAdapterRegistry, getGlobal, getIConfigProvider, getIGlobalPathProvider, getIInstallationProvider, getIInstanceProvider, hasAdapterRegistry, inferEntityType, isModelEntity, normalizeExtractionResult, openaiCompatible, parseEntityExtractionResult, probeEmbeddingDims, readEnvString, readFlagBool, readFlagNumber, resetGlobalAdapter, resolveEmbeddingModel, resolveGraphModel, resolveLanguageModel, resolveModel, resolveModelId, resolveModelIdentifier, resolveRerankModel, sanitizeEntityToken, setAdapterRegistry, setGlobalAdapter, syncMeta, toModel, toRuleset };
10637
+ export { type AdaptedToolSchema, type AdapterRegistry, Agent, type AgentClientFilterConfig, AgentLoop, type AgentMessage, type StateResult as AgentStateResult, type AnyModelInput, BUILTIN_AGENTS, type BuildPromptOptions, CUSTOM_PROVIDER_DEFINITIONS, type CoercionTarget, type CompletenessResult, Config, type ConsistencyResult, type ContentQualityResult, type ContextRelevancyResult, type CorrectnessResult, DEBUG_AGENT_FILTER, DEFAULT_AGENT_FILTER, DEFAULT_ENABLED_PROVIDERS, DEFAULT_MAX_STEPS, DEFAULT_REMOTE_TIMEOUT, EmbeddingProvider, type EvaluationBase, type EvaluationInput, EvaluationProvider, type EvaluationResult, type EvaluationType, type ExtractedEntity, type ExtractedRelation, type ExtractionResult, type FactCheckingResult, type FaithfulnessResult, Flag, type GoalCompletionResult, type GraphEntityTypeDef, GraphProvider, type GraphRelationTypeDef, type IConfigProvider, type IGlobalPathProvider, type IInstallationProvider, type IInstanceProvider, type ILLM, type ILLMCapabilities, type ILLMInitConfig, type ILLMModels, LLMConfig, LLMConfig as LLMConfigType, LanguageProvider, type LanguageUserMessage, LocalAgent, type LocalAgentConfig, LocalAgentError, Loop, Message, type MetaEntry, type ModelEntity, type ModelIdentifier, type ModelInput, type ModelInputLike, type ModelKind, ModelManager, ModelsDev, type ModerationCategory, type ModerationResult, type OpenaiCompatibleProvider, type OpenaiCompatibleProviderSettings, PROVIDER_DISPLAY_NAMES, type PartData, type ProbeEmbeddingOptions, ProcessorSdkBridge, type ProcessorSdkBridgeOptions, Provider, ProviderAuth, ProviderAuthMethod, ProviderAuthMethod as ProviderAuthMethodType, ProviderConfig, ProviderConfig as ProviderConfigType, ProviderError, ProviderTransform, type ReadabilityResult, type RelevancyResult, RemoteAgent, type RemoteAgentConfig, RemoteAgentError, RemoteAgentHandler, type RemoteAgentHandlerConfig, type RemoteInteractionResult, RerankProvider, SDK_LOOP_COLLECTOR_FILTER, type SchemaCoercion, type ScoredEvaluation, SdkEventBridge, SdkEventBus, SdkEventType, SdkLoop, SdkMessageCollector, type SdkSessionStatusProps, type SessionEvent, StreamProcessor, SubAgent, SubAgentError, type SubAgentRegistryConfig, type SubAgentRunInput, SummaryProvider, Tool, ToolRegistry, Truncate, adaptToolSchema, adaptTools, buildEntityExtractionPrompt, createOpenaiCompatible, deriveModelIdentifier, extractEntitiesByRules, getAdapterRegistry, getGlobal, getIConfigProvider, getIGlobalPathProvider, getIInstallationProvider, getIInstanceProvider, hasAdapterRegistry, inferEntityType, isModelEntity, normalizeExtractionResult, openaiCompatible, parseEntityExtractionResult, probeEmbeddingDims, readEnvString, readFlagBool, readFlagNumber, resetGlobalAdapter, resolveEmbeddingModel, resolveGraphModel, resolveLanguageModel, resolveModel, resolveModelId, resolveModelIdentifier, resolveRerankModel, sanitizeEntityToken, setAdapterRegistry, setGlobalAdapter, syncMeta, toModel, toRuleset };