@cuylabs/agent-core 0.8.0 → 0.10.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.
- package/README.md +33 -17
- package/dist/chunk-2O4MCSQS.js +780 -0
- package/dist/chunk-2TTOLHBT.js +198 -0
- package/dist/chunk-5FMSGQVX.js +281 -0
- package/dist/chunk-5NVVNXPQ.js +288 -0
- package/dist/{chunk-CAA7FHIH.js → chunk-6HZBHFOL.js} +3 -103
- package/dist/chunk-CJI7PVS2.js +58 -0
- package/dist/{chunk-N6HWIEEA.js → chunk-CMYN2RCB.js} +278 -61
- package/dist/chunk-FII65CN7.js +117 -0
- package/dist/{chunk-IVUJDISU.js → chunk-GFTW23FV.js} +5 -14
- package/dist/chunk-I6PKJ7XQ.js +292 -0
- package/dist/{chunk-BDBZ3SLK.js → chunk-ICZ66572.js} +48 -4
- package/dist/chunk-KYLPMBHD.js +316 -0
- package/dist/chunk-MXAP4UG6.js +2956 -0
- package/dist/{chunk-RZITT45F.js → chunk-N3VX7FEE.js} +39 -6
- package/dist/{chunk-YSLSEQ6B.js → chunk-NDZWXCBZ.js} +218 -95
- package/dist/{chunk-P6YF7USR.js → chunk-Q742PSH3.js} +23 -38
- package/dist/chunk-QAL3OMI3.js +943 -0
- package/dist/{chunk-RFEKJKTO.js → chunk-RN6WZEUF.js} +330 -280
- package/dist/{chunk-ZXAKHMWH.js → chunk-ROTGCYDW.js} +22 -84
- package/dist/chunk-SPBFQXOT.js +0 -0
- package/dist/{chunk-LRHOS4ZN.js → chunk-SPILYYDF.js} +3 -2
- package/dist/chunk-SSFBF3US.js +602 -0
- package/dist/chunk-SZ2XBPTW.js +8 -0
- package/dist/chunk-T4UIX5D7.js +115 -0
- package/dist/chunk-TIHPYVAJ.js +102 -0
- package/dist/{chunk-YUUJK53A.js → chunk-TOTDGK3P.js} +1 -1
- package/dist/chunk-V4RFNEET.js +563 -0
- package/dist/chunk-VOUEJSW6.js +0 -0
- package/dist/{chunk-4BDA7DQY.js → chunk-WBPOZ7CL.js} +673 -273
- package/dist/chunk-X4VN4GIJ.js +185 -0
- package/dist/dispatch/index.d.ts +93 -0
- package/dist/dispatch/index.js +37 -0
- package/dist/events/index.d.ts +93 -0
- package/dist/events/index.js +6 -0
- package/dist/{runtime → execution}/index.d.ts +120 -34
- package/dist/{runtime → execution}/index.js +18 -13
- package/dist/index-BCqEGzBj.d.ts +251 -0
- package/dist/index.d.ts +490 -122
- package/dist/index.js +2104 -615
- package/dist/{errors → inference/errors}/index.d.ts +2 -2
- package/dist/{errors → inference/errors}/index.js +1 -1
- package/dist/inference/index.d.ts +16 -23
- package/dist/inference/index.js +45 -16
- package/dist/instance-BqV2D5pc.d.ts +5723 -0
- package/dist/logger/index.d.ts +50 -0
- package/dist/logger/index.js +11 -0
- package/dist/mcp/index.d.ts +5 -9
- package/dist/mcp/index.js +2 -3
- package/dist/middleware/index.d.ts +10 -149
- package/dist/middleware/index.js +11 -3
- package/dist/model-messages-B4nK9D1-.d.ts +13 -0
- package/dist/models/index.d.ts +23 -18
- package/dist/models/index.js +48 -11
- package/dist/models/reasoning/index.d.ts +4 -0
- package/dist/{reasoning → models/reasoning}/index.js +3 -3
- package/dist/plugin/index.d.ts +458 -0
- package/dist/plugin/index.js +32 -0
- package/dist/profiles/index.d.ts +55 -0
- package/dist/profiles/index.js +30 -0
- package/dist/prompt/index.d.ts +8 -12
- package/dist/prompt/index.js +3 -2
- package/dist/safety/index.d.ts +109 -14
- package/dist/safety/index.js +59 -3
- package/dist/sandbox/index.d.ts +81 -0
- package/dist/sandbox/index.js +1 -0
- package/dist/skill/index.d.ts +10 -8
- package/dist/skill/index.js +3 -3
- package/dist/storage/index.d.ts +12 -4
- package/dist/storage/index.js +1 -1
- package/dist/subagents/index.d.ts +177 -0
- package/dist/subagents/index.js +78 -0
- package/dist/team/index.d.ts +544 -0
- package/dist/team/index.js +41 -0
- package/dist/tool/host/index.d.ts +41 -0
- package/dist/tool/host/index.js +10 -0
- package/dist/tool/index.d.ts +125 -21
- package/dist/tool/index.js +20 -13
- package/dist/{types-VQgymC1N.d.ts → types-Bj_J8u_W.d.ts} +44 -64
- package/dist/{types-CHiPh8U2.d.ts → types-C_LCeYNg.d.ts} +7 -7
- package/dist/types-RSCv7nQ4.d.ts +59 -0
- package/package.json +58 -53
- package/dist/builder-UpOWQMW3.d.ts +0 -34
- package/dist/chunk-7MUFEN4K.js +0 -559
- package/dist/chunk-7VKQ4WPB.js +0 -73
- package/dist/chunk-BFM2YHNM.js +0 -222
- package/dist/chunk-DWYX7ASF.js +0 -26
- package/dist/chunk-KUVSERLJ.js +0 -50
- package/dist/chunk-N7P4PN3O.js +0 -84
- package/dist/chunk-SDSBEQXG.js +0 -157
- package/dist/chunk-SQU2AJHO.js +0 -305
- package/dist/chunk-VBWWUHWI.js +0 -724
- package/dist/chunk-VEKUXUVF.js +0 -41
- package/dist/chunk-VNQBHPCT.js +0 -398
- package/dist/chunk-WWYYNWEW.js +0 -259
- package/dist/context/index.d.ts +0 -259
- package/dist/context/index.js +0 -26
- package/dist/events-CE72w8W4.d.ts +0 -149
- package/dist/host/index.d.ts +0 -45
- package/dist/host/index.js +0 -8
- package/dist/index-CWSchSql.d.ts +0 -1058
- package/dist/messages-BYWGn8TY.d.ts +0 -110
- package/dist/presets/index.d.ts +0 -53
- package/dist/presets/index.js +0 -28
- package/dist/reasoning/index.d.ts +0 -116
- package/dist/registry-DwYqsQkX.d.ts +0 -164
- package/dist/runner-e2YRcUoX.d.ts +0 -786
- package/dist/scope/index.d.ts +0 -10
- package/dist/scope/index.js +0 -14
- package/dist/session-manager-B_CWGTsl.d.ts +0 -274
- package/dist/signal/index.d.ts +0 -28
- package/dist/signal/index.js +0 -6
- package/dist/sub-agent/index.d.ts +0 -23
- package/dist/sub-agent/index.js +0 -15
- package/dist/tool-BHbyUAy3.d.ts +0 -150
- package/dist/tool-DLXAR9Ce.d.ts +0 -145
- package/dist/tracker-DClqYqTj.d.ts +0 -96
- package/dist/tracking/index.d.ts +0 -111
- package/dist/tracking/index.js +0 -20
- package/dist/types-BfNpU8NS.d.ts +0 -270
- package/dist/types-BnpEOYV-.d.ts +0 -50
- package/dist/types-CQL-SvTn.d.ts +0 -29
- package/dist/types-CWm-7rvB.d.ts +0 -55
- package/dist/types-KKDrdU9Y.d.ts +0 -325
- package/dist/types-QA4WhEfz.d.ts +0 -138
- package/dist/types-QKHHQLLq.d.ts +0 -336
- package/dist/types-YuWV4ag7.d.ts +0 -72
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { C as ConsoleLoggerOptions, L as Logger, F as FileLoggerOptions } from '../types-RSCv7nQ4.js';
|
|
2
|
+
export { a as LogLevel, b as LogMeta } from '../types-RSCv7nQ4.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Built-in logger implementations.
|
|
6
|
+
*
|
|
7
|
+
* - `silentLogger` — no-op (default for agents)
|
|
8
|
+
* - `createConsoleLogger` — pretty console output with level gating
|
|
9
|
+
* - `createFileLogger` — append-only file output for debugging
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A logger that discards every message.
|
|
14
|
+
*
|
|
15
|
+
* This is the default used when no logger is supplied to `createAgent()`.
|
|
16
|
+
*/
|
|
17
|
+
declare const silentLogger: Logger;
|
|
18
|
+
/**
|
|
19
|
+
* Create a console-backed logger with configurable minimum level.
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { createConsoleLogger } from "@cuylabs/agent-core";
|
|
23
|
+
*
|
|
24
|
+
* const agent = createAgent({
|
|
25
|
+
* model,
|
|
26
|
+
* logger: createConsoleLogger({ level: "debug" }),
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* Respects the `AGENT_LOG_LEVEL` environment variable when no explicit
|
|
31
|
+
* level is supplied, falling back to `"warn"`.
|
|
32
|
+
*/
|
|
33
|
+
declare function createConsoleLogger(options?: ConsoleLoggerOptions): Logger;
|
|
34
|
+
/**
|
|
35
|
+
* Create a file-backed logger that appends timestamped entries.
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* import { createFileLogger } from "@cuylabs/agent-core";
|
|
39
|
+
*
|
|
40
|
+
* const logger = createFileLogger({ filePath: "/tmp/team.log", level: "debug" });
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* The log file is created (with parent directories) if it doesn't exist.
|
|
44
|
+
* All writes are non-blocking; write errors are silently swallowed.
|
|
45
|
+
*/
|
|
46
|
+
declare function createFileLogger(options: FileLoggerOptions): Logger & {
|
|
47
|
+
close(): void;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export { ConsoleLoggerOptions, FileLoggerOptions, Logger, createConsoleLogger, createFileLogger, silentLogger };
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { M as MCPConfig, a as MCPManager,
|
|
2
|
-
export { b as
|
|
1
|
+
import { M as MCPConfig, a as MCPManager, R as RemoteTransportConfig, d as StdioTransportConfig } from '../types-Bj_J8u_W.js';
|
|
2
|
+
export { H as HttpTransportConfig, b as MCPServerConfig, c as MCPServerStatus, S as SseTransportConfig } from '../types-Bj_J8u_W.js';
|
|
3
3
|
import 'ai';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Create an MCP manager for connecting to multiple MCP servers.
|
|
7
7
|
*/
|
|
8
8
|
declare function createMCPManager(config: MCPConfig): MCPManager;
|
|
9
|
-
/**
|
|
10
|
-
* Helper to define a single MCP server config.
|
|
11
|
-
*/
|
|
12
|
-
declare function defineServer(config: MCPServerConfig): MCPServerConfig;
|
|
13
9
|
/**
|
|
14
10
|
* Helper to create a stdio server config.
|
|
15
11
|
*/
|
|
@@ -17,10 +13,10 @@ declare function stdioServer(command: string, args?: string[], options?: Omit<St
|
|
|
17
13
|
/**
|
|
18
14
|
* Helper to create an HTTP server config.
|
|
19
15
|
*/
|
|
20
|
-
declare function httpServer(url: string, options?: Omit<
|
|
16
|
+
declare function httpServer(url: string, options?: Omit<RemoteTransportConfig, "transport" | "url">): RemoteTransportConfig;
|
|
21
17
|
/**
|
|
22
18
|
* Helper to create an SSE server config.
|
|
23
19
|
*/
|
|
24
|
-
declare function sseServer(url: string, options?: Omit<
|
|
20
|
+
declare function sseServer(url: string, options?: Omit<RemoteTransportConfig, "transport" | "url">): RemoteTransportConfig;
|
|
25
21
|
|
|
26
|
-
export {
|
|
22
|
+
export { MCPConfig, MCPManager, RemoteTransportConfig, StdioTransportConfig, createMCPManager, httpServer, sseServer, stdioServer };
|
package/dist/mcp/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createMCPManager,
|
|
3
|
-
defineServer,
|
|
4
3
|
httpServer,
|
|
5
4
|
sseServer,
|
|
6
5
|
stdioServer
|
|
7
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-ROTGCYDW.js";
|
|
7
|
+
import "../chunk-T4UIX5D7.js";
|
|
8
8
|
export {
|
|
9
9
|
createMCPManager,
|
|
10
|
-
defineServer,
|
|
11
10
|
httpServer,
|
|
12
11
|
sseServer,
|
|
13
12
|
stdioServer
|
|
@@ -1,153 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import '
|
|
6
|
-
import '../events-CE72w8W4.js';
|
|
7
|
-
import '../messages-BYWGn8TY.js';
|
|
8
|
-
import '../types-BfNpU8NS.js';
|
|
9
|
-
import '../types-CQL-SvTn.js';
|
|
10
|
-
import '../tool-DLXAR9Ce.js';
|
|
11
|
-
import '../types-CHiPh8U2.js';
|
|
12
|
-
import '../tool-BHbyUAy3.js';
|
|
1
|
+
import { bR as OtelMiddlewareConfig, L as AgentMiddleware, de as TelemetryConfig, df as TelemetryConfigResult } from '../instance-BqV2D5pc.js';
|
|
2
|
+
export { N as AgentModelHooks, ac as ApprovalAgentMiddleware, al as ApprovalMiddlewareConfig, as as BlockedModelCall, au as ChatLifecycleContext, b as MiddlewareRunner, d as ModelCallContext, bK as ModelCallInput, bL as ModelCallOutput, dh as ToolCallDecision, di as ToolCallOutput, dz as approvalMiddleware, dM as isApprovalMiddleware, dN as isBlockedModelCall } from '../instance-BqV2D5pc.js';
|
|
3
|
+
import '../types-C_LCeYNg.js';
|
|
4
|
+
import 'ai';
|
|
5
|
+
import '../types-RSCv7nQ4.js';
|
|
13
6
|
import 'zod';
|
|
14
7
|
import '../types-CQaXbRsS.js';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* Wraps the existing approval system as an AgentMiddleware.
|
|
20
|
-
* This is how approval finally gets wired into the tool execution
|
|
21
|
-
* pipeline — no more dead code.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```typescript
|
|
25
|
-
* import { createAgent, approvalMiddleware } from "@cuylabs/agent-core";
|
|
26
|
-
*
|
|
27
|
-
* const agent = createAgent({
|
|
28
|
-
* model: anthropic("claude-sonnet-4-20250514"),
|
|
29
|
-
* tools: [read, write, bash],
|
|
30
|
-
* middleware: [
|
|
31
|
-
* approvalMiddleware({
|
|
32
|
-
* rules: [
|
|
33
|
-
* { pattern: "src/*", tool: "read_file", action: "allow" },
|
|
34
|
-
* ],
|
|
35
|
-
* onRequest: async (req) => {
|
|
36
|
-
* // Prompt user in your UI
|
|
37
|
-
* return await askUser(req);
|
|
38
|
-
* },
|
|
39
|
-
* }),
|
|
40
|
-
* ],
|
|
41
|
-
* });
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Configuration for the approval middleware.
|
|
47
|
-
*
|
|
48
|
-
* Extends the existing ApprovalConfig with middleware-specific options.
|
|
49
|
-
*/
|
|
50
|
-
interface ApprovalMiddlewareConfig extends ApprovalConfig {
|
|
51
|
-
/**
|
|
52
|
-
* Custom risk classification for tools.
|
|
53
|
-
*
|
|
54
|
-
* Overrides the built-in risk map. Tools not listed here
|
|
55
|
-
* fall back to the default classification.
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* ```typescript
|
|
59
|
-
* customRisks: {
|
|
60
|
-
* "my_deploy_tool": "dangerous",
|
|
61
|
-
* "my_lint_tool": "safe",
|
|
62
|
-
* }
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
customRisks?: Record<string, RiskLevel>;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Create an approval middleware from an ApprovalConfig.
|
|
69
|
-
*
|
|
70
|
-
* This bridges the existing `createApprovalHandler` into the middleware
|
|
71
|
-
* system. The `beforeToolCall` hook checks rules, classifies risk,
|
|
72
|
-
* and calls the approval handler when needed.
|
|
73
|
-
*
|
|
74
|
-
* @param config - Approval configuration (rules, handler, timeout, etc.)
|
|
75
|
-
* @returns An AgentMiddleware that gates tool execution
|
|
76
|
-
*/
|
|
77
|
-
declare function approvalMiddleware(config?: ApprovalMiddlewareConfig): AgentMiddleware;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Configuration for the OpenTelemetry middleware.
|
|
81
|
-
*/
|
|
82
|
-
interface OtelMiddlewareConfig {
|
|
83
|
-
/**
|
|
84
|
-
* Whether to record tool call arguments as span attributes.
|
|
85
|
-
* Defaults to `true`.
|
|
86
|
-
*/
|
|
87
|
-
recordInputs?: boolean;
|
|
88
|
-
/**
|
|
89
|
-
* Whether to record tool results as span attributes.
|
|
90
|
-
* Defaults to `true`.
|
|
91
|
-
*/
|
|
92
|
-
recordOutputs?: boolean;
|
|
93
|
-
/**
|
|
94
|
-
* Agent name — used in the root span name and attributes.
|
|
95
|
-
* Falls back to `"agent"`.
|
|
96
|
-
*/
|
|
97
|
-
agentName?: string;
|
|
98
|
-
/** Agent description — recorded as `gen_ai.agent.description`. */
|
|
99
|
-
agentDescription?: string;
|
|
100
|
-
/**
|
|
101
|
-
* Whether to emit `execute_tool` spans for tool calls.
|
|
102
|
-
* Defaults to `true`.
|
|
103
|
-
*/
|
|
104
|
-
emitToolSpans?: boolean;
|
|
105
|
-
/**
|
|
106
|
-
* TTL in milliseconds for orphaned spans.
|
|
107
|
-
* Defaults to 5 minutes.
|
|
108
|
-
*/
|
|
109
|
-
spanTimeoutMs?: number;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Configuration for `createTelemetryConfig()`.
|
|
113
|
-
*/
|
|
114
|
-
interface TelemetryConfig {
|
|
115
|
-
/** Agent name — used in span names and `gen_ai.agent.name`. */
|
|
116
|
-
agentName: string;
|
|
117
|
-
/** Agent description — recorded as `gen_ai.agent.description`. */
|
|
118
|
-
agentDescription?: string;
|
|
119
|
-
/** Record tool arguments and LLM prompts in spans. Defaults to `true`. */
|
|
120
|
-
recordInputs?: boolean;
|
|
121
|
-
/** Record tool results and LLM responses in spans. Defaults to `true`. */
|
|
122
|
-
recordOutputs?: boolean;
|
|
123
|
-
/** Emit `execute_tool` spans from our middleware. Defaults to `true`. */
|
|
124
|
-
emitToolSpans?: boolean;
|
|
125
|
-
/** TTL in ms for orphaned spans. Defaults to 5 minutes. */
|
|
126
|
-
spanTimeoutMs?: number;
|
|
127
|
-
/**
|
|
128
|
-
* An OTel `SpanProcessor` to auto-create and register a `NodeTracerProvider`.
|
|
129
|
-
*/
|
|
130
|
-
spanProcessor?: unknown;
|
|
131
|
-
/**
|
|
132
|
-
* OTel service name for the `NodeTracerProvider` resource.
|
|
133
|
-
* Defaults to `agentName`.
|
|
134
|
-
*/
|
|
135
|
-
serviceName?: string;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Result of `createTelemetryConfig()`.
|
|
139
|
-
*/
|
|
140
|
-
interface TelemetryConfigResult {
|
|
141
|
-
/** Agent-core middleware. */
|
|
142
|
-
middleware: AgentMiddleware;
|
|
143
|
-
/** AI SDK telemetry settings. */
|
|
144
|
-
telemetry: TelemetrySettings;
|
|
145
|
-
/**
|
|
146
|
-
* Flush and shut down the auto-created tracer provider.
|
|
147
|
-
* No-op when no provider was auto-created.
|
|
148
|
-
*/
|
|
149
|
-
shutdown: () => Promise<void>;
|
|
150
|
-
}
|
|
8
|
+
import '../types-Bj_J8u_W.js';
|
|
9
|
+
import '@ai-sdk/provider-utils';
|
|
10
|
+
import '../sandbox/index.js';
|
|
11
|
+
import '../llm-error-D93FNNLY.js';
|
|
151
12
|
|
|
152
13
|
declare function otelMiddleware(config?: OtelMiddlewareConfig): AgentMiddleware;
|
|
153
14
|
|
|
@@ -246,4 +107,4 @@ interface PromptCacheConfig {
|
|
|
246
107
|
*/
|
|
247
108
|
declare function promptCacheMiddleware(config?: PromptCacheConfig): AgentMiddleware;
|
|
248
109
|
|
|
249
|
-
export { AgentMiddleware, type
|
|
110
|
+
export { AgentMiddleware, type CacheTTL, OtelMiddlewareConfig, type PromptCacheConfig, TelemetryConfig, TelemetryConfigResult, createTelemetryConfig, otelMiddleware, promptCacheMiddleware };
|
package/dist/middleware/index.js
CHANGED
|
@@ -2,15 +2,23 @@ import {
|
|
|
2
2
|
MiddlewareRunner,
|
|
3
3
|
approvalMiddleware,
|
|
4
4
|
createTelemetryConfig,
|
|
5
|
+
isApprovalMiddleware,
|
|
5
6
|
otelMiddleware,
|
|
6
7
|
promptCacheMiddleware
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import
|
|
9
|
-
|
|
8
|
+
} from "../chunk-NDZWXCBZ.js";
|
|
9
|
+
import {
|
|
10
|
+
isBlockedModelCall
|
|
11
|
+
} from "../chunk-CJI7PVS2.js";
|
|
12
|
+
import "../chunk-I6PKJ7XQ.js";
|
|
13
|
+
import "../chunk-V4RFNEET.js";
|
|
14
|
+
import "../chunk-FII65CN7.js";
|
|
15
|
+
import "../chunk-T4UIX5D7.js";
|
|
10
16
|
export {
|
|
11
17
|
MiddlewareRunner,
|
|
12
18
|
approvalMiddleware,
|
|
13
19
|
createTelemetryConfig,
|
|
20
|
+
isApprovalMiddleware,
|
|
21
|
+
isBlockedModelCall,
|
|
14
22
|
otelMiddleware,
|
|
15
23
|
promptCacheMiddleware
|
|
16
24
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ModelMessage } from 'ai';
|
|
2
|
+
import { M as Message } from './instance-BqV2D5pc.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Convert framework messages into Vercel AI SDK model messages.
|
|
6
|
+
*
|
|
7
|
+
* This keeps the message translation logic reusable for workflow activities
|
|
8
|
+
* and other runtime integrations without forcing those integrations to reach
|
|
9
|
+
* into `Agent` internals.
|
|
10
|
+
*/
|
|
11
|
+
declare function convertAgentMessagesToModelMessages(messages: Message[]): ModelMessage[];
|
|
12
|
+
|
|
13
|
+
export { convertAgentMessagesToModelMessages as c };
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { LanguageModel } from 'ai';
|
|
2
|
-
import { C as CapabilitySource, S as SourcePriority, b as SourceResult, P as ProviderCompatibility, R as ResolverOptions, a as ModelEntry, M as ModelCapabilities } from '../
|
|
3
|
-
export { D as DEFAULT_RESOLVER_OPTIONS, I as InputModality, O as OutputModality } from '../
|
|
2
|
+
import { C as CapabilitySource, S as SourcePriority, b as SourceResult, P as ProviderCompatibility, R as ResolverOptions, a as ModelEntry, M as ModelCapabilities } from '../index-BCqEGzBj.js';
|
|
3
|
+
export { D as DEFAULT_RESOLVER_OPTIONS, I as InputModality, O as OutputModality, c as buildAnthropicOptions, d as buildBedrockOptions, e as buildGoogleOptions, f as buildGroqOptions, g as buildOpenAIOptions, h as buildOpenRouterOptions, i as buildReasoningOptions, j as buildReasoningOptionsSync, k as buildXAIOptions, l as getProviderOptionsKey, m as getReasoningConfig, n as getReasoningConfigSync, s as supportsReasoning, o as supportsReasoningSync } from '../index-BCqEGzBj.js';
|
|
4
|
+
import { L as Logger } from '../types-RSCv7nQ4.js';
|
|
5
|
+
export { E as EXTENDED_LEVELS, F as FIXED_LEVELS, a as ReasoningConfig, R as ReasoningLevel, S as STANDARD_LEVELS, s as shouldIncludeReasoningSummary } from '../types-CQaXbRsS.js';
|
|
6
|
+
import '@ai-sdk/provider-utils';
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
* Extract a model ID string from a LanguageModel instance.
|
|
@@ -10,6 +13,19 @@ declare function getModelId(model: LanguageModel): string;
|
|
|
10
13
|
* Extract a provider identifier from a LanguageModel instance.
|
|
11
14
|
*/
|
|
12
15
|
declare function getProviderId(model: LanguageModel): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Extract model ID from a LanguageModel.
|
|
18
|
+
*
|
|
19
|
+
* Canonical helper — use this instead of `getModelId` in consumer code.
|
|
20
|
+
*/
|
|
21
|
+
declare const extractModelId: (model: LanguageModel) => string;
|
|
22
|
+
/**
|
|
23
|
+
* Extract provider from a LanguageModel.
|
|
24
|
+
*
|
|
25
|
+
* Tries the model's `.provider` property first, then falls back
|
|
26
|
+
* to pattern-matching the model ID via `inferProvider`.
|
|
27
|
+
*/
|
|
28
|
+
declare function extractProvider(model: LanguageModel): string | undefined;
|
|
13
29
|
|
|
14
30
|
type AdapterKind = "openai" | "anthropic" | "google" | "openai-compatible" | "openrouter" | "azure" | "bedrock" | "vertex" | "xai" | "mistral" | "groq";
|
|
15
31
|
type AdapterSettings = {
|
|
@@ -33,11 +49,6 @@ type Directory = {
|
|
|
33
49
|
entries?: Record<string, ModelSpec>;
|
|
34
50
|
};
|
|
35
51
|
type Resolver = (key: string) => Promise<LanguageModel>;
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated Use `Resolver` (async) instead. Kept for backwards compatibility
|
|
38
|
-
* with custom `build` functions that return synchronously.
|
|
39
|
-
*/
|
|
40
|
-
type SyncResolver = (key: string) => LanguageModel;
|
|
41
52
|
declare function createResolver(directory: Directory): Resolver;
|
|
42
53
|
|
|
43
54
|
/**
|
|
@@ -90,7 +101,8 @@ declare class CapabilityCache {
|
|
|
90
101
|
private memoryCache;
|
|
91
102
|
private ttlMs;
|
|
92
103
|
private loaded;
|
|
93
|
-
|
|
104
|
+
private readonly log;
|
|
105
|
+
constructor(options?: Partial<ResolverOptions>, logger?: Logger);
|
|
94
106
|
private load;
|
|
95
107
|
get(modelId: string, provider?: string): Promise<ModelEntry | undefined>;
|
|
96
108
|
set(entry: ModelEntry): Promise<void>;
|
|
@@ -158,14 +170,6 @@ declare class RemoteCapabilitySource implements CapabilitySource {
|
|
|
158
170
|
* Designed for the Vercel AI SDK v6 ecosystem.
|
|
159
171
|
*/
|
|
160
172
|
|
|
161
|
-
/**
|
|
162
|
-
* Extract model ID from LanguageModel
|
|
163
|
-
*/
|
|
164
|
-
declare function extractModelId(model: LanguageModel): string;
|
|
165
|
-
/**
|
|
166
|
-
* Extract provider from LanguageModel
|
|
167
|
-
*/
|
|
168
|
-
declare function extractProvider(model: LanguageModel): string | undefined;
|
|
169
173
|
/**
|
|
170
174
|
* Resolution result with source information
|
|
171
175
|
*/
|
|
@@ -191,7 +195,8 @@ declare class ModelCapabilityResolver {
|
|
|
191
195
|
private sources;
|
|
192
196
|
private initialized;
|
|
193
197
|
private initPromise;
|
|
194
|
-
|
|
198
|
+
private readonly log;
|
|
199
|
+
constructor(options?: Partial<ResolverOptions>, logger?: Logger);
|
|
195
200
|
/**
|
|
196
201
|
* Initialize the resolver (load cache, optionally fetch remote)
|
|
197
202
|
*/
|
|
@@ -253,4 +258,4 @@ declare function getDefaultResolver(): ModelCapabilityResolver;
|
|
|
253
258
|
*/
|
|
254
259
|
declare function configureResolver(options: Partial<ResolverOptions>): void;
|
|
255
260
|
|
|
256
|
-
export { type AdapterSettings, CacheCapabilitySource, CapabilityCache, type CapabilityOverrides, CapabilitySource, type Directory, type EngineSpec, ModelCapabilities, ModelCapabilityResolver, ModelEntry, type ModelSpec, type NetworkStatus, PatternCapabilitySource, ProviderCompatibility, RemoteCapabilityFetcher, RemoteCapabilitySource, type ResolutionResult, type Resolver, ResolverOptions, SourcePriority, SourceResult,
|
|
261
|
+
export { type AdapterSettings, CacheCapabilitySource, CapabilityCache, type CapabilityOverrides, CapabilitySource, type Directory, type EngineSpec, ModelCapabilities, ModelCapabilityResolver, ModelEntry, type ModelSpec, type NetworkStatus, PatternCapabilitySource, ProviderCompatibility, RemoteCapabilityFetcher, RemoteCapabilitySource, type ResolutionResult, type Resolver, ResolverOptions, SourcePriority, SourceResult, applyCapabilityOverride, configureResolver, createResolver, extractModelId, extractProvider, findCapabilityOverride, getDefaultResolver, getModelId, getNetworkStatus, getProviderCompatibility, getProviderId, inferContextWindow, inferProvider, likelySupportsReasoning };
|
package/dist/models/index.js
CHANGED
|
@@ -1,39 +1,70 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CacheCapabilitySource,
|
|
3
3
|
CapabilityCache,
|
|
4
|
-
|
|
4
|
+
EXTENDED_LEVELS,
|
|
5
|
+
FIXED_LEVELS,
|
|
5
6
|
ModelCapabilityResolver,
|
|
6
|
-
PatternCapabilitySource,
|
|
7
7
|
RemoteCapabilityFetcher,
|
|
8
8
|
RemoteCapabilitySource,
|
|
9
|
-
|
|
9
|
+
STANDARD_LEVELS,
|
|
10
10
|
applyCapabilityOverride,
|
|
11
|
+
buildAnthropicOptions,
|
|
12
|
+
buildBedrockOptions,
|
|
13
|
+
buildGoogleOptions,
|
|
14
|
+
buildGroqOptions,
|
|
15
|
+
buildOpenAIOptions,
|
|
16
|
+
buildOpenRouterOptions,
|
|
17
|
+
buildReasoningOptions,
|
|
18
|
+
buildReasoningOptionsSync,
|
|
19
|
+
buildXAIOptions,
|
|
11
20
|
configureResolver,
|
|
12
21
|
createResolver,
|
|
13
|
-
extractModelId,
|
|
14
|
-
extractProvider,
|
|
15
22
|
findCapabilityOverride,
|
|
16
23
|
getDefaultResolver,
|
|
17
24
|
getNetworkStatus,
|
|
25
|
+
getProviderOptionsKey,
|
|
26
|
+
getReasoningConfig,
|
|
27
|
+
getReasoningConfigSync,
|
|
28
|
+
shouldIncludeReasoningSummary,
|
|
29
|
+
supportsReasoning,
|
|
30
|
+
supportsReasoningSync
|
|
31
|
+
} from "../chunk-RN6WZEUF.js";
|
|
32
|
+
import {
|
|
33
|
+
DEFAULT_RESOLVER_OPTIONS,
|
|
34
|
+
PatternCapabilitySource,
|
|
35
|
+
SourcePriority,
|
|
36
|
+
extractModelId,
|
|
37
|
+
extractProvider,
|
|
38
|
+
getModelId,
|
|
18
39
|
getProviderCompatibility,
|
|
40
|
+
getProviderId,
|
|
19
41
|
inferContextWindow,
|
|
20
42
|
inferProvider,
|
|
21
43
|
likelySupportsReasoning
|
|
22
|
-
} from "../chunk-
|
|
23
|
-
import
|
|
24
|
-
getModelId,
|
|
25
|
-
getProviderId
|
|
26
|
-
} from "../chunk-DWYX7ASF.js";
|
|
44
|
+
} from "../chunk-I6PKJ7XQ.js";
|
|
45
|
+
import "../chunk-T4UIX5D7.js";
|
|
27
46
|
export {
|
|
28
47
|
CacheCapabilitySource,
|
|
29
48
|
CapabilityCache,
|
|
30
49
|
DEFAULT_RESOLVER_OPTIONS,
|
|
50
|
+
EXTENDED_LEVELS,
|
|
51
|
+
FIXED_LEVELS,
|
|
31
52
|
ModelCapabilityResolver,
|
|
32
53
|
PatternCapabilitySource,
|
|
33
54
|
RemoteCapabilityFetcher,
|
|
34
55
|
RemoteCapabilitySource,
|
|
56
|
+
STANDARD_LEVELS,
|
|
35
57
|
SourcePriority,
|
|
36
58
|
applyCapabilityOverride,
|
|
59
|
+
buildAnthropicOptions,
|
|
60
|
+
buildBedrockOptions,
|
|
61
|
+
buildGoogleOptions,
|
|
62
|
+
buildGroqOptions,
|
|
63
|
+
buildOpenAIOptions,
|
|
64
|
+
buildOpenRouterOptions,
|
|
65
|
+
buildReasoningOptions,
|
|
66
|
+
buildReasoningOptionsSync,
|
|
67
|
+
buildXAIOptions,
|
|
37
68
|
configureResolver,
|
|
38
69
|
createResolver,
|
|
39
70
|
extractModelId,
|
|
@@ -44,7 +75,13 @@ export {
|
|
|
44
75
|
getNetworkStatus,
|
|
45
76
|
getProviderCompatibility,
|
|
46
77
|
getProviderId,
|
|
78
|
+
getProviderOptionsKey,
|
|
79
|
+
getReasoningConfig,
|
|
80
|
+
getReasoningConfigSync,
|
|
47
81
|
inferContextWindow,
|
|
48
82
|
inferProvider,
|
|
49
|
-
likelySupportsReasoning
|
|
83
|
+
likelySupportsReasoning,
|
|
84
|
+
shouldIncludeReasoningSummary,
|
|
85
|
+
supportsReasoning,
|
|
86
|
+
supportsReasoningSync
|
|
50
87
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { E as EXTENDED_LEVELS, F as FIXED_LEVELS, a as ReasoningConfig, R as ReasoningLevel, S as STANDARD_LEVELS, s as shouldIncludeReasoningSummary } from '../../types-CQaXbRsS.js';
|
|
2
|
+
export { c as buildAnthropicOptions, d as buildBedrockOptions, e as buildGoogleOptions, f as buildGroqOptions, g as buildOpenAIOptions, h as buildOpenRouterOptions, i as buildReasoningOptions, j as buildReasoningOptionsSync, k as buildXAIOptions, l as getProviderOptionsKey, m as getReasoningConfig, n as getReasoningConfigSync, s as supportsReasoning, o as supportsReasoningSync } from '../../index-BCqEGzBj.js';
|
|
3
|
+
import 'ai';
|
|
4
|
+
import '@ai-sdk/provider-utils';
|
|
@@ -17,9 +17,9 @@ import {
|
|
|
17
17
|
shouldIncludeReasoningSummary,
|
|
18
18
|
supportsReasoning,
|
|
19
19
|
supportsReasoningSync
|
|
20
|
-
} from "
|
|
21
|
-
import "
|
|
22
|
-
import "
|
|
20
|
+
} from "../../chunk-RN6WZEUF.js";
|
|
21
|
+
import "../../chunk-I6PKJ7XQ.js";
|
|
22
|
+
import "../../chunk-T4UIX5D7.js";
|
|
23
23
|
export {
|
|
24
24
|
EXTENDED_LEVELS,
|
|
25
25
|
FIXED_LEVELS,
|