agent-framework-js 0.1.2 → 0.2.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +45 -0
  3. package/dist/agents/index.cjs +7 -7
  4. package/dist/agents/index.d.cts +4 -4
  5. package/dist/agents/index.d.ts +4 -4
  6. package/dist/agents/index.js +2 -2
  7. package/dist/{chunk-YKZJRE32.cjs → chunk-245NZAGV.cjs} +4 -4
  8. package/dist/{chunk-YKZJRE32.cjs.map → chunk-245NZAGV.cjs.map} +1 -1
  9. package/dist/{chunk-UVWQWOLO.js → chunk-7M3EAGCA.js} +41 -8
  10. package/dist/chunk-7M3EAGCA.js.map +1 -0
  11. package/dist/{chunk-XPXTXOYQ.js → chunk-E4VTVUYU.js} +4 -3
  12. package/dist/chunk-E4VTVUYU.js.map +1 -0
  13. package/dist/{chunk-V472N2PK.js → chunk-IGIFX6QO.js} +3 -3
  14. package/dist/{chunk-V472N2PK.js.map → chunk-IGIFX6QO.js.map} +1 -1
  15. package/dist/{chunk-LMN75W3W.cjs → chunk-ILBKDEEL.cjs} +4 -3
  16. package/dist/chunk-ILBKDEEL.cjs.map +1 -0
  17. package/dist/{chunk-YBFLWRO5.cjs → chunk-NURRGYIU.cjs} +18 -15
  18. package/dist/chunk-NURRGYIU.cjs.map +1 -0
  19. package/dist/{chunk-VLSVL5N2.js → chunk-S5776DOL.js} +3 -3
  20. package/dist/{chunk-VLSVL5N2.js.map → chunk-S5776DOL.js.map} +1 -1
  21. package/dist/{chunk-TLACSVEZ.cjs → chunk-U64OEHG6.cjs} +40 -6
  22. package/dist/chunk-U64OEHG6.cjs.map +1 -0
  23. package/dist/{chunk-QJ5XHA6S.cjs → chunk-UIXNKPLQ.cjs} +4 -4
  24. package/dist/{chunk-QJ5XHA6S.cjs.map → chunk-UIXNKPLQ.cjs.map} +1 -1
  25. package/dist/{chunk-RD5YUB2E.js → chunk-WEKU7735.js} +12 -9
  26. package/dist/chunk-WEKU7735.js.map +1 -0
  27. package/dist/declarative/index.cjs +4 -4
  28. package/dist/declarative/index.d.cts +4 -4
  29. package/dist/declarative/index.d.ts +4 -4
  30. package/dist/declarative/index.js +3 -3
  31. package/dist/{index-DdYZeNIu.d.cts → index-5eIhfrC1.d.cts} +5 -3
  32. package/dist/{index-D7-znzrc.d.ts → index-Dog-CyOK.d.ts} +5 -3
  33. package/dist/index.cjs +34 -30
  34. package/dist/index.d.cts +4 -4
  35. package/dist/index.d.ts +4 -4
  36. package/dist/index.js +6 -6
  37. package/dist/middleware/index.d.cts +5 -5
  38. package/dist/middleware/index.d.ts +5 -5
  39. package/dist/persistence/index.cjs +5 -5
  40. package/dist/persistence/index.d.cts +2 -2
  41. package/dist/persistence/index.d.ts +2 -2
  42. package/dist/persistence/index.js +2 -2
  43. package/dist/{provider-osAtfZ7x.d.ts → provider-C_rgZvmX.d.ts} +47 -2
  44. package/dist/{provider-CMAymr1b.d.cts → provider-IJnfNhCX.d.cts} +47 -2
  45. package/dist/providers/index.cjs +9 -5
  46. package/dist/providers/index.d.cts +32 -13
  47. package/dist/providers/index.d.ts +32 -13
  48. package/dist/providers/index.js +1 -1
  49. package/dist/{registry-D4fThGiN.d.cts → registry-B-hicOxp.d.cts} +1 -1
  50. package/dist/{registry-CpO0yH5v.d.ts → registry-KMWN0p4Z.d.ts} +1 -1
  51. package/dist/{thread-CWVzTyti.d.ts → thread-COV135Ja.d.ts} +4 -2
  52. package/dist/{thread-Dfo9LLf7.d.cts → thread-D3zaGK1Y.d.cts} +4 -2
  53. package/dist/tools/index.d.cts +2 -2
  54. package/dist/tools/index.d.ts +2 -2
  55. package/dist/workflows/index.d.cts +4 -4
  56. package/dist/workflows/index.d.ts +4 -4
  57. package/package.json +4 -4
  58. package/AGENT_USAGE.md +0 -207
  59. package/dist/chunk-LMN75W3W.cjs.map +0 -1
  60. package/dist/chunk-RD5YUB2E.js.map +0 -1
  61. package/dist/chunk-TLACSVEZ.cjs.map +0 -1
  62. package/dist/chunk-UVWQWOLO.js.map +0 -1
  63. package/dist/chunk-XPXTXOYQ.js.map +0 -1
  64. package/dist/chunk-YBFLWRO5.cjs.map +0 -1
@@ -1,11 +1,11 @@
1
1
  import { a as ModelCapabilities } from '../types-Cn1g9Tg4.js';
2
- import { P as Provider } from '../provider-osAtfZ7x.js';
2
+ import { P as Provider } from '../provider-C_rgZvmX.js';
3
3
  import { T as Tool } from '../tool-CSCC87OD.js';
4
4
  import { S as Skill } from '../skill-DfNChtJN.js';
5
- import { A as Agent } from '../index-D7-znzrc.js';
5
+ import { A as Agent } from '../index-Dog-CyOK.js';
6
6
  import '../errors-CjVz4W_5.js';
7
- import '../thread-CWVzTyti.js';
8
- import '../registry-CpO0yH5v.js';
7
+ import '../thread-COV135Ja.js';
8
+ import '../registry-KMWN0p4Z.js';
9
9
 
10
10
  /**
11
11
  * Declarative agent definitions. Agents can be defined in YAML or JSON against a
@@ -1,9 +1,9 @@
1
- export { loadAgentDefinition } from '../chunk-VLSVL5N2.js';
2
- import '../chunk-RD5YUB2E.js';
1
+ export { loadAgentDefinition } from '../chunk-S5776DOL.js';
2
+ import '../chunk-WEKU7735.js';
3
3
  import '../chunk-YCBDEEAV.js';
4
4
  import '../chunk-HGEPXJDG.js';
5
5
  import '../chunk-7ZXUIHLH.js';
6
- import '../chunk-XPXTXOYQ.js';
6
+ import '../chunk-E4VTVUYU.js';
7
7
  import '../chunk-IXV4UIF5.js';
8
8
  import '../chunk-DEABART4.js';
9
9
  //# sourceMappingURL=index.js.map
@@ -1,10 +1,10 @@
1
1
  import { M as Message } from './types-Cn1g9Tg4.cjs';
2
2
  import { P as ProviderError } from './errors-CjVz4W_5.cjs';
3
- import { a as GenerateRequest, b as GenerateResponse, P as Provider } from './provider-CMAymr1b.cjs';
3
+ import { a as GenerateRequest, b as GenerateResponse, P as Provider } from './provider-IJnfNhCX.cjs';
4
4
  import { T as Tool } from './tool-BZg_znMZ.cjs';
5
5
  import { S as Skill } from './skill-DfNChtJN.cjs';
6
- import { T as Thread } from './thread-Dfo9LLf7.cjs';
7
- import { T as ToolRegistry } from './registry-D4fThGiN.cjs';
6
+ import { T as Thread } from './thread-D3zaGK1Y.cjs';
7
+ import { T as ToolRegistry } from './registry-B-hicOxp.cjs';
8
8
 
9
9
  /**
10
10
  * Middleware pipeline for intercepting and processing agent provider calls —
@@ -87,6 +87,8 @@ interface AgentConfig {
87
87
  name: string;
88
88
  instructions: string;
89
89
  provider: Provider;
90
+ /** Which of the provider's models to use; defaults to the provider's default model. */
91
+ model?: string;
90
92
  tools?: Tool[];
91
93
  skills?: Skill[];
92
94
  /** Max tool-call iterations per run; -1 = unlimited. Default 10. (FR-012b) */
@@ -1,10 +1,10 @@
1
1
  import { M as Message } from './types-Cn1g9Tg4.js';
2
2
  import { P as ProviderError } from './errors-CjVz4W_5.js';
3
- import { a as GenerateRequest, b as GenerateResponse, P as Provider } from './provider-osAtfZ7x.js';
3
+ import { a as GenerateRequest, b as GenerateResponse, P as Provider } from './provider-C_rgZvmX.js';
4
4
  import { T as Tool } from './tool-CSCC87OD.js';
5
5
  import { S as Skill } from './skill-DfNChtJN.js';
6
- import { T as Thread } from './thread-CWVzTyti.js';
7
- import { T as ToolRegistry } from './registry-CpO0yH5v.js';
6
+ import { T as Thread } from './thread-COV135Ja.js';
7
+ import { T as ToolRegistry } from './registry-KMWN0p4Z.js';
8
8
 
9
9
  /**
10
10
  * Middleware pipeline for intercepting and processing agent provider calls —
@@ -87,6 +87,8 @@ interface AgentConfig {
87
87
  name: string;
88
88
  instructions: string;
89
89
  provider: Provider;
90
+ /** Which of the provider's models to use; defaults to the provider's default model. */
91
+ model?: string;
90
92
  tools?: Tool[];
91
93
  skills?: Skill[];
92
94
  /** Max tool-call iterations per run; -1 = unlimited. Default 10. (FR-012b) */
package/dist/index.cjs CHANGED
@@ -3,18 +3,18 @@
3
3
  var chunkIU3LS5FC_cjs = require('./chunk-IU3LS5FC.cjs');
4
4
  var chunkRZP2ZUUX_cjs = require('./chunk-RZP2ZUUX.cjs');
5
5
  require('./chunk-5M6ER4ZX.cjs');
6
- var chunkYKZJRE32_cjs = require('./chunk-YKZJRE32.cjs');
7
- var chunkYBFLWRO5_cjs = require('./chunk-YBFLWRO5.cjs');
6
+ var chunk245NZAGV_cjs = require('./chunk-245NZAGV.cjs');
7
+ var chunkNURRGYIU_cjs = require('./chunk-NURRGYIU.cjs');
8
8
  var chunkWSMYH2IN_cjs = require('./chunk-WSMYH2IN.cjs');
9
9
  var chunkTAMJ5HSR_cjs = require('./chunk-TAMJ5HSR.cjs');
10
- var chunkGYDY3KX5_cjs = require('./chunk-GYDY3KX5.cjs');
11
10
  var chunkKEI3EALJ_cjs = require('./chunk-KEI3EALJ.cjs');
12
11
  var chunkFSDMBWQV_cjs = require('./chunk-FSDMBWQV.cjs');
12
+ var chunkGYDY3KX5_cjs = require('./chunk-GYDY3KX5.cjs');
13
13
  var chunkV6O6SYAN_cjs = require('./chunk-V6O6SYAN.cjs');
14
- var chunkQJ5XHA6S_cjs = require('./chunk-QJ5XHA6S.cjs');
15
- var chunkLMN75W3W_cjs = require('./chunk-LMN75W3W.cjs');
14
+ var chunkUIXNKPLQ_cjs = require('./chunk-UIXNKPLQ.cjs');
15
+ var chunkILBKDEEL_cjs = require('./chunk-ILBKDEEL.cjs');
16
16
  var chunkFOTCUNP5_cjs = require('./chunk-FOTCUNP5.cjs');
17
- var chunkTLACSVEZ_cjs = require('./chunk-TLACSVEZ.cjs');
17
+ var chunkU64OEHG6_cjs = require('./chunk-U64OEHG6.cjs');
18
18
  var chunkMQ2XTH3S_cjs = require('./chunk-MQ2XTH3S.cjs');
19
19
  var chunkIJASUMIQ_cjs = require('./chunk-IJASUMIQ.cjs');
20
20
 
@@ -66,19 +66,19 @@ Object.defineProperty(exports, "stepSequential", {
66
66
  });
67
67
  Object.defineProperty(exports, "loadAgentDefinition", {
68
68
  enumerable: true,
69
- get: function () { return chunkYKZJRE32_cjs.loadAgentDefinition; }
69
+ get: function () { return chunk245NZAGV_cjs.loadAgentDefinition; }
70
70
  });
71
71
  Object.defineProperty(exports, "buildMessages", {
72
72
  enumerable: true,
73
- get: function () { return chunkYBFLWRO5_cjs.buildMessages; }
73
+ get: function () { return chunkNURRGYIU_cjs.buildMessages; }
74
74
  });
75
75
  Object.defineProperty(exports, "createAgent", {
76
76
  enumerable: true,
77
- get: function () { return chunkYBFLWRO5_cjs.createAgent; }
77
+ get: function () { return chunkNURRGYIU_cjs.createAgent; }
78
78
  });
79
79
  Object.defineProperty(exports, "runLoop", {
80
80
  enumerable: true,
81
- get: function () { return chunkYBFLWRO5_cjs.runLoop; }
81
+ get: function () { return chunkNURRGYIU_cjs.runLoop; }
82
82
  });
83
83
  Object.defineProperty(exports, "SkillIndex", {
84
84
  enumerable: true,
@@ -104,14 +104,6 @@ Object.defineProperty(exports, "validateArgs", {
104
104
  enumerable: true,
105
105
  get: function () { return chunkTAMJ5HSR_cjs.validateArgs; }
106
106
  });
107
- Object.defineProperty(exports, "connectMCP", {
108
- enumerable: true,
109
- get: function () { return chunkGYDY3KX5_cjs.connectMCP; }
110
- });
111
- Object.defineProperty(exports, "mcpToolToTool", {
112
- enumerable: true,
113
- get: function () { return chunkGYDY3KX5_cjs.mcpToolToTool; }
114
- });
115
107
  Object.defineProperty(exports, "useMiddleware", {
116
108
  enumerable: true,
117
109
  get: function () { return chunkKEI3EALJ_cjs.useMiddleware; }
@@ -120,6 +112,14 @@ Object.defineProperty(exports, "composeMiddleware", {
120
112
  enumerable: true,
121
113
  get: function () { return chunkFSDMBWQV_cjs.composeMiddleware; }
122
114
  });
115
+ Object.defineProperty(exports, "connectMCP", {
116
+ enumerable: true,
117
+ get: function () { return chunkGYDY3KX5_cjs.connectMCP; }
118
+ });
119
+ Object.defineProperty(exports, "mcpToolToTool", {
120
+ enumerable: true,
121
+ get: function () { return chunkGYDY3KX5_cjs.mcpToolToTool; }
122
+ });
123
123
  Object.defineProperty(exports, "configureObservability", {
124
124
  enumerable: true,
125
125
  get: function () { return chunkV6O6SYAN_cjs.configureObservability; }
@@ -138,35 +138,35 @@ Object.defineProperty(exports, "withSpan", {
138
138
  });
139
139
  Object.defineProperty(exports, "ThreadPersistence", {
140
140
  enumerable: true,
141
- get: function () { return chunkQJ5XHA6S_cjs.ThreadPersistence; }
141
+ get: function () { return chunkUIXNKPLQ_cjs.ThreadPersistence; }
142
142
  });
143
143
  Object.defineProperty(exports, "createBrowserStore", {
144
144
  enumerable: true,
145
- get: function () { return chunkQJ5XHA6S_cjs.createBrowserStore; }
145
+ get: function () { return chunkUIXNKPLQ_cjs.createBrowserStore; }
146
146
  });
147
147
  Object.defineProperty(exports, "createMemoryStore", {
148
148
  enumerable: true,
149
- get: function () { return chunkQJ5XHA6S_cjs.createMemoryStore; }
149
+ get: function () { return chunkUIXNKPLQ_cjs.createMemoryStore; }
150
150
  });
151
151
  Object.defineProperty(exports, "Thread", {
152
152
  enumerable: true,
153
- get: function () { return chunkLMN75W3W_cjs.Thread; }
153
+ get: function () { return chunkILBKDEEL_cjs.Thread; }
154
154
  });
155
155
  Object.defineProperty(exports, "estimateTokens", {
156
156
  enumerable: true,
157
- get: function () { return chunkLMN75W3W_cjs.estimateTokens; }
157
+ get: function () { return chunkILBKDEEL_cjs.estimateTokens; }
158
158
  });
159
159
  Object.defineProperty(exports, "hasImage", {
160
160
  enumerable: true,
161
- get: function () { return chunkLMN75W3W_cjs.hasImage; }
161
+ get: function () { return chunkILBKDEEL_cjs.hasImage; }
162
162
  });
163
163
  Object.defineProperty(exports, "messageText", {
164
164
  enumerable: true,
165
- get: function () { return chunkLMN75W3W_cjs.messageText; }
165
+ get: function () { return chunkILBKDEEL_cjs.messageText; }
166
166
  });
167
167
  Object.defineProperty(exports, "textMessage", {
168
168
  enumerable: true,
169
- get: function () { return chunkLMN75W3W_cjs.textMessage; }
169
+ get: function () { return chunkILBKDEEL_cjs.textMessage; }
170
170
  });
171
171
  Object.defineProperty(exports, "detectRuntime", {
172
172
  enumerable: true,
@@ -182,19 +182,23 @@ Object.defineProperty(exports, "resetRuntimeCache", {
182
182
  });
183
183
  Object.defineProperty(exports, "createCopilotProvider", {
184
184
  enumerable: true,
185
- get: function () { return chunkTLACSVEZ_cjs.createCopilotProvider; }
185
+ get: function () { return chunkU64OEHG6_cjs.createCopilotProvider; }
186
186
  });
187
187
  Object.defineProperty(exports, "createOpenAICompatibleProvider", {
188
188
  enumerable: true,
189
- get: function () { return chunkTLACSVEZ_cjs.createOpenAICompatibleProvider; }
189
+ get: function () { return chunkU64OEHG6_cjs.createOpenAICompatibleProvider; }
190
190
  });
191
191
  Object.defineProperty(exports, "providerErrorFromStatus", {
192
192
  enumerable: true,
193
- get: function () { return chunkTLACSVEZ_cjs.providerErrorFromStatus; }
193
+ get: function () { return chunkU64OEHG6_cjs.providerErrorFromStatus; }
194
+ });
195
+ Object.defineProperty(exports, "resolveModels", {
196
+ enumerable: true,
197
+ get: function () { return chunkU64OEHG6_cjs.resolveModels; }
194
198
  });
195
199
  Object.defineProperty(exports, "withRetry", {
196
200
  enumerable: true,
197
- get: function () { return chunkTLACSVEZ_cjs.withRetry; }
201
+ get: function () { return chunkU64OEHG6_cjs.withRetry; }
198
202
  });
199
203
  Object.defineProperty(exports, "CheckpointError", {
200
204
  enumerable: true,
package/dist/index.d.cts CHANGED
@@ -1,13 +1,13 @@
1
1
  export { C as ContentPart, J as JSONSchema, M as Message, a as ModelCapabilities, R as Role, h as hasImage, m as messageText, t as textMessage } from './types-Cn1g9Tg4.cjs';
2
2
  export { C as CheckpointError, a as CheckpointErrorReason, E as ErrorKind, F as FrameworkError, M as MCPError, P as ProviderError, b as ProviderErrorReason, R as RuntimeUnsupportedError, T as ToolError, c as ToolErrorReason, V as ValidationError } from './errors-CjVz4W_5.cjs';
3
3
  export { O as ObservabilityConfig, R as REDACTED, c as configureObservability, i as isObservabilityEnabled, r as redact, a as resetObservability, w as withSpan } from './index-C2vzfbBz.cjs';
4
- export { C as CredentialSource, G as GenerateChunk, a as GenerateRequest, b as GenerateResponse, P as Provider, T as ToolCall, c as ToolSpec } from './provider-CMAymr1b.cjs';
4
+ export { C as CredentialSource, G as GenerateChunk, a as GenerateRequest, b as GenerateResponse, M as ModelSelectionOptions, P as Provider, R as ResolvedModels, T as ToolCall, c as ToolSpec, r as resolveModels } from './provider-IJnfNhCX.cjs';
5
5
  export { CopilotProviderOptions, OpenAICompatibleProviderOptions, RetryOptions, createCopilotProvider, createOpenAICompatibleProvider, providerErrorFromStatus, withRetry } from './providers/index.cjs';
6
6
  export { T as Tool, d as defineTool } from './tool-BZg_znMZ.cjs';
7
7
  export { validateArgs } from './tools/index.cjs';
8
- export { T as ToolRegistry, a as ToolResult, n as namespacedName } from './registry-D4fThGiN.cjs';
9
- export { A as Agent, a as AgentConfig, b as AgentInput, G as GenerateFn, L as LoopOptions, c as LoopResult, M as Middleware, d as MiddlewareContext, N as Next, R as RunChunk, e as RunOptions, f as RunResult, g as RunStatus, h as buildMessages, i as composeMiddleware, j as createAgent, r as runLoop } from './index-DdYZeNIu.cjs';
10
- export { T as Thread, a as ThreadOptions, e as estimateTokens } from './thread-Dfo9LLf7.cjs';
8
+ export { T as ToolRegistry, a as ToolResult, n as namespacedName } from './registry-B-hicOxp.cjs';
9
+ export { A as Agent, a as AgentConfig, b as AgentInput, G as GenerateFn, L as LoopOptions, c as LoopResult, M as Middleware, d as MiddlewareContext, N as Next, R as RunChunk, e as RunOptions, f as RunResult, g as RunStatus, h as buildMessages, i as composeMiddleware, j as createAgent, r as runLoop } from './index-5eIhfrC1.cjs';
10
+ export { T as Thread, a as ThreadOptions, e as estimateTokens } from './thread-D3zaGK1Y.cjs';
11
11
  export { MCPConnection, MCPConnectionConfig, MCPTransport, connectMCP, mcpToolToTool } from './mcp/index.cjs';
12
12
  export { SkillIndex } from './skills/index.cjs';
13
13
  export { BranchResult, CHECKPOINT_VERSION, Checkpoint, FailurePolicy, PatternHooks, StepResult, Workflow, WorkflowConfig, WorkflowContext, WorkflowEvent, WorkflowPattern, WorkflowState, WorkflowStatus, createCheckpoint, createWorkflow, restoreCheckpoint, runBounded, serializeCheckpoint, stepConcurrent, stepGroup, stepHandoff, stepSequential } from './workflows/index.cjs';
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  export { C as ContentPart, J as JSONSchema, M as Message, a as ModelCapabilities, R as Role, h as hasImage, m as messageText, t as textMessage } from './types-Cn1g9Tg4.js';
2
2
  export { C as CheckpointError, a as CheckpointErrorReason, E as ErrorKind, F as FrameworkError, M as MCPError, P as ProviderError, b as ProviderErrorReason, R as RuntimeUnsupportedError, T as ToolError, c as ToolErrorReason, V as ValidationError } from './errors-CjVz4W_5.js';
3
3
  export { O as ObservabilityConfig, R as REDACTED, c as configureObservability, i as isObservabilityEnabled, r as redact, a as resetObservability, w as withSpan } from './index-C2vzfbBz.js';
4
- export { C as CredentialSource, G as GenerateChunk, a as GenerateRequest, b as GenerateResponse, P as Provider, T as ToolCall, c as ToolSpec } from './provider-osAtfZ7x.js';
4
+ export { C as CredentialSource, G as GenerateChunk, a as GenerateRequest, b as GenerateResponse, M as ModelSelectionOptions, P as Provider, R as ResolvedModels, T as ToolCall, c as ToolSpec, r as resolveModels } from './provider-C_rgZvmX.js';
5
5
  export { CopilotProviderOptions, OpenAICompatibleProviderOptions, RetryOptions, createCopilotProvider, createOpenAICompatibleProvider, providerErrorFromStatus, withRetry } from './providers/index.js';
6
6
  export { T as Tool, d as defineTool } from './tool-CSCC87OD.js';
7
7
  export { validateArgs } from './tools/index.js';
8
- export { T as ToolRegistry, a as ToolResult, n as namespacedName } from './registry-CpO0yH5v.js';
9
- export { A as Agent, a as AgentConfig, b as AgentInput, G as GenerateFn, L as LoopOptions, c as LoopResult, M as Middleware, d as MiddlewareContext, N as Next, R as RunChunk, e as RunOptions, f as RunResult, g as RunStatus, h as buildMessages, i as composeMiddleware, j as createAgent, r as runLoop } from './index-D7-znzrc.js';
10
- export { T as Thread, a as ThreadOptions, e as estimateTokens } from './thread-CWVzTyti.js';
8
+ export { T as ToolRegistry, a as ToolResult, n as namespacedName } from './registry-KMWN0p4Z.js';
9
+ export { A as Agent, a as AgentConfig, b as AgentInput, G as GenerateFn, L as LoopOptions, c as LoopResult, M as Middleware, d as MiddlewareContext, N as Next, R as RunChunk, e as RunOptions, f as RunResult, g as RunStatus, h as buildMessages, i as composeMiddleware, j as createAgent, r as runLoop } from './index-Dog-CyOK.js';
10
+ export { T as Thread, a as ThreadOptions, e as estimateTokens } from './thread-COV135Ja.js';
11
11
  export { MCPConnection, MCPConnectionConfig, MCPTransport, connectMCP, mcpToolToTool } from './mcp/index.js';
12
12
  export { SkillIndex } from './skills/index.js';
13
13
  export { BranchResult, CHECKPOINT_VERSION, Checkpoint, FailurePolicy, PatternHooks, StepResult, Workflow, WorkflowConfig, WorkflowContext, WorkflowEvent, WorkflowPattern, WorkflowState, WorkflowStatus, createCheckpoint, createWorkflow, restoreCheckpoint, runBounded, serializeCheckpoint, stepConcurrent, stepGroup, stepHandoff, stepSequential } from './workflows/index.js';
package/dist/index.js CHANGED
@@ -1,18 +1,18 @@
1
1
  export { defineTool } from './chunk-RZ43WNHR.js';
2
2
  export { CHECKPOINT_VERSION, createCheckpoint, createWorkflow, restoreCheckpoint, runBounded, serializeCheckpoint, stepConcurrent, stepGroup, stepHandoff, stepSequential } from './chunk-T2GHJ5R4.js';
3
3
  import './chunk-MCLVWCOB.js';
4
- export { loadAgentDefinition } from './chunk-VLSVL5N2.js';
5
- export { buildMessages, createAgent, runLoop } from './chunk-RD5YUB2E.js';
4
+ export { loadAgentDefinition } from './chunk-S5776DOL.js';
5
+ export { buildMessages, createAgent, runLoop } from './chunk-WEKU7735.js';
6
6
  export { SkillIndex, defineSkill, loadSource } from './chunk-YCBDEEAV.js';
7
7
  export { ToolRegistry, namespacedName, validateArgs } from './chunk-HGEPXJDG.js';
8
- export { connectMCP, mcpToolToTool } from './chunk-YH5746OF.js';
9
8
  export { useMiddleware } from './chunk-IUKD54F7.js';
10
9
  export { composeMiddleware } from './chunk-7ZXUIHLH.js';
10
+ export { connectMCP, mcpToolToTool } from './chunk-YH5746OF.js';
11
11
  export { configureObservability, isObservabilityEnabled, resetObservability, withSpan } from './chunk-5PDJOBTD.js';
12
- export { ThreadPersistence, createBrowserStore, createMemoryStore } from './chunk-V472N2PK.js';
13
- export { Thread, estimateTokens, hasImage, messageText, textMessage } from './chunk-XPXTXOYQ.js';
12
+ export { ThreadPersistence, createBrowserStore, createMemoryStore } from './chunk-IGIFX6QO.js';
13
+ export { Thread, estimateTokens, hasImage, messageText, textMessage } from './chunk-E4VTVUYU.js';
14
14
  export { detectRuntime, requireCapability, resetRuntimeCache } from './chunk-ACBIHS5H.js';
15
- export { createCopilotProvider, createOpenAICompatibleProvider, providerErrorFromStatus, withRetry } from './chunk-UVWQWOLO.js';
15
+ export { createCopilotProvider, createOpenAICompatibleProvider, providerErrorFromStatus, resolveModels, withRetry } from './chunk-7M3EAGCA.js';
16
16
  export { CheckpointError, FrameworkError, MCPError, ProviderError, RuntimeUnsupportedError, ToolError, ValidationError } from './chunk-IXV4UIF5.js';
17
17
  export { REDACTED, redact } from './chunk-DEABART4.js';
18
18
  //# sourceMappingURL=index.js.map
@@ -1,12 +1,12 @@
1
- import { a as AgentConfig, M as Middleware } from '../index-DdYZeNIu.cjs';
2
- export { d as MiddlewareContext, N as Next, i as composeMiddleware } from '../index-DdYZeNIu.cjs';
1
+ import { a as AgentConfig, M as Middleware } from '../index-5eIhfrC1.cjs';
2
+ export { d as MiddlewareContext, N as Next, i as composeMiddleware } from '../index-5eIhfrC1.cjs';
3
3
  import '../types-Cn1g9Tg4.cjs';
4
4
  import '../errors-CjVz4W_5.cjs';
5
- import '../provider-CMAymr1b.cjs';
5
+ import '../provider-IJnfNhCX.cjs';
6
6
  import '../tool-BZg_znMZ.cjs';
7
7
  import '../skill-DfNChtJN.cjs';
8
- import '../thread-Dfo9LLf7.cjs';
9
- import '../registry-D4fThGiN.cjs';
8
+ import '../thread-D3zaGK1Y.cjs';
9
+ import '../registry-B-hicOxp.cjs';
10
10
 
11
11
  /**
12
12
  * Convenience helper for attaching middleware to an agent configuration.
@@ -1,12 +1,12 @@
1
- import { a as AgentConfig, M as Middleware } from '../index-D7-znzrc.js';
2
- export { d as MiddlewareContext, N as Next, i as composeMiddleware } from '../index-D7-znzrc.js';
1
+ import { a as AgentConfig, M as Middleware } from '../index-Dog-CyOK.js';
2
+ export { d as MiddlewareContext, N as Next, i as composeMiddleware } from '../index-Dog-CyOK.js';
3
3
  import '../types-Cn1g9Tg4.js';
4
4
  import '../errors-CjVz4W_5.js';
5
- import '../provider-osAtfZ7x.js';
5
+ import '../provider-C_rgZvmX.js';
6
6
  import '../tool-CSCC87OD.js';
7
7
  import '../skill-DfNChtJN.js';
8
- import '../thread-CWVzTyti.js';
9
- import '../registry-CpO0yH5v.js';
8
+ import '../thread-COV135Ja.js';
9
+ import '../registry-KMWN0p4Z.js';
10
10
 
11
11
  /**
12
12
  * Convenience helper for attaching middleware to an agent configuration.
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkQJ5XHA6S_cjs = require('../chunk-QJ5XHA6S.cjs');
4
- require('../chunk-LMN75W3W.cjs');
3
+ var chunkUIXNKPLQ_cjs = require('../chunk-UIXNKPLQ.cjs');
4
+ require('../chunk-ILBKDEEL.cjs');
5
5
  require('../chunk-FOTCUNP5.cjs');
6
6
  require('../chunk-MQ2XTH3S.cjs');
7
7
  require('../chunk-IJASUMIQ.cjs');
@@ -10,15 +10,15 @@ require('../chunk-IJASUMIQ.cjs');
10
10
 
11
11
  Object.defineProperty(exports, "ThreadPersistence", {
12
12
  enumerable: true,
13
- get: function () { return chunkQJ5XHA6S_cjs.ThreadPersistence; }
13
+ get: function () { return chunkUIXNKPLQ_cjs.ThreadPersistence; }
14
14
  });
15
15
  Object.defineProperty(exports, "createBrowserStore", {
16
16
  enumerable: true,
17
- get: function () { return chunkQJ5XHA6S_cjs.createBrowserStore; }
17
+ get: function () { return chunkUIXNKPLQ_cjs.createBrowserStore; }
18
18
  });
19
19
  Object.defineProperty(exports, "createMemoryStore", {
20
20
  enumerable: true,
21
- get: function () { return chunkQJ5XHA6S_cjs.createMemoryStore; }
21
+ get: function () { return chunkUIXNKPLQ_cjs.createMemoryStore; }
22
22
  });
23
23
  //# sourceMappingURL=index.cjs.map
24
24
  //# sourceMappingURL=index.cjs.map
@@ -1,6 +1,6 @@
1
- import { T as Thread } from '../thread-Dfo9LLf7.cjs';
1
+ import { T as Thread } from '../thread-D3zaGK1Y.cjs';
2
2
  import '../types-Cn1g9Tg4.cjs';
3
- import '../provider-CMAymr1b.cjs';
3
+ import '../provider-IJnfNhCX.cjs';
4
4
 
5
5
  /**
6
6
  * Pluggable storage abstraction for persisting conversation/thread state in a
@@ -1,6 +1,6 @@
1
- import { T as Thread } from '../thread-CWVzTyti.js';
1
+ import { T as Thread } from '../thread-COV135Ja.js';
2
2
  import '../types-Cn1g9Tg4.js';
3
- import '../provider-osAtfZ7x.js';
3
+ import '../provider-C_rgZvmX.js';
4
4
 
5
5
  /**
6
6
  * Pluggable storage abstraction for persisting conversation/thread state in a
@@ -1,5 +1,5 @@
1
- export { ThreadPersistence, createBrowserStore, createMemoryStore } from '../chunk-V472N2PK.js';
2
- import '../chunk-XPXTXOYQ.js';
1
+ export { ThreadPersistence, createBrowserStore, createMemoryStore } from '../chunk-IGIFX6QO.js';
2
+ import '../chunk-E4VTVUYU.js';
3
3
  import '../chunk-ACBIHS5H.js';
4
4
  import '../chunk-IXV4UIF5.js';
5
5
  import '../chunk-DEABART4.js';
@@ -16,6 +16,45 @@ interface CredentialSource {
16
16
  /** Return the current credential (token/api key). May be async. */
17
17
  getCredential(): string | Promise<string>;
18
18
  }
19
+ /**
20
+ * Model configuration for a provider. A provider may expose **one or more** models
21
+ * (e.g. GitHub Copilot offers several; an OpenAI-compatible endpoint is usually one).
22
+ * Supply either a single `capabilities` object or an array via `models`.
23
+ */
24
+ interface ModelSelectionOptions {
25
+ /** Single-model shorthand. */
26
+ capabilities?: ModelCapabilities;
27
+ /** One or more models this provider can use. */
28
+ models?: ModelCapabilities[];
29
+ /** Name of the default model (defaults to the first entry). */
30
+ defaultModel?: string;
31
+ }
32
+ /** Resolved model set with a default and a lookup helper. */
33
+ interface ResolvedModels {
34
+ /** All configured models (at least one). */
35
+ models: ModelCapabilities[];
36
+ /** The default model used when a request does not specify one. */
37
+ defaultModel: ModelCapabilities;
38
+ /** Look up a model by name, or return the default when omitted. */
39
+ modelOf(name?: string): ModelCapabilities;
40
+ }
41
+ /**
42
+ * Normalize {@link ModelSelectionOptions} into a model list, a default, and a
43
+ * lookup helper. Throws {@link ValidationError} if no model is configured or a
44
+ * named model is missing.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const { defaultModel, modelOf } = resolveModels({
49
+ * models: [
50
+ * { model: "gpt-4o", maxInputTokens: 128000, maxOutputTokens: 16000 },
51
+ * { model: "o3-mini", maxInputTokens: 200000, maxOutputTokens: 100000, supportsReasoning: true },
52
+ * ],
53
+ * defaultModel: "gpt-4o",
54
+ * });
55
+ * ```
56
+ */
57
+ declare function resolveModels(options: ModelSelectionOptions): ResolvedModels;
19
58
  /** A tool description passed to the provider so the model can decide to call it. */
20
59
  interface ToolSpec {
21
60
  name: string;
@@ -26,6 +65,8 @@ interface ToolSpec {
26
65
  interface GenerateRequest {
27
66
  messages: Message[];
28
67
  tools?: ToolSpec[];
68
+ /** Which configured model to use; defaults to the provider's default model. */
69
+ model?: string;
29
70
  /** Abort signal to cancel an in-flight request. */
30
71
  signal?: AbortSignal;
31
72
  }
@@ -71,12 +112,16 @@ type GenerateChunk = {
71
112
  interface Provider {
72
113
  /** Stable provider identifier, e.g. `"openai-compatible"`. */
73
114
  readonly name: string;
74
- /** Per-model capability configuration supplied by the caller. (FR-007a) */
115
+ /** The default model's capability configuration. (FR-007a) */
75
116
  readonly capabilities: ModelCapabilities;
117
+ /** All models this provider is configured with (one or more). */
118
+ readonly models: ModelCapabilities[];
119
+ /** Look up a configured model by name, or the default when omitted. */
120
+ model(name?: string): ModelCapabilities;
76
121
  /** Generate a complete response. */
77
122
  generate(req: GenerateRequest): Promise<GenerateResponse>;
78
123
  /** Generate a streamed response. */
79
124
  generateStream(req: GenerateRequest): AsyncIterable<GenerateChunk>;
80
125
  }
81
126
 
82
- export type { CredentialSource as C, GenerateChunk as G, Provider as P, ToolCall as T, GenerateRequest as a, GenerateResponse as b, ToolSpec as c };
127
+ export { type CredentialSource as C, type GenerateChunk as G, type ModelSelectionOptions as M, type Provider as P, type ResolvedModels as R, type ToolCall as T, type GenerateRequest as a, type GenerateResponse as b, type ToolSpec as c, resolveModels as r };
@@ -16,6 +16,45 @@ interface CredentialSource {
16
16
  /** Return the current credential (token/api key). May be async. */
17
17
  getCredential(): string | Promise<string>;
18
18
  }
19
+ /**
20
+ * Model configuration for a provider. A provider may expose **one or more** models
21
+ * (e.g. GitHub Copilot offers several; an OpenAI-compatible endpoint is usually one).
22
+ * Supply either a single `capabilities` object or an array via `models`.
23
+ */
24
+ interface ModelSelectionOptions {
25
+ /** Single-model shorthand. */
26
+ capabilities?: ModelCapabilities;
27
+ /** One or more models this provider can use. */
28
+ models?: ModelCapabilities[];
29
+ /** Name of the default model (defaults to the first entry). */
30
+ defaultModel?: string;
31
+ }
32
+ /** Resolved model set with a default and a lookup helper. */
33
+ interface ResolvedModels {
34
+ /** All configured models (at least one). */
35
+ models: ModelCapabilities[];
36
+ /** The default model used when a request does not specify one. */
37
+ defaultModel: ModelCapabilities;
38
+ /** Look up a model by name, or return the default when omitted. */
39
+ modelOf(name?: string): ModelCapabilities;
40
+ }
41
+ /**
42
+ * Normalize {@link ModelSelectionOptions} into a model list, a default, and a
43
+ * lookup helper. Throws {@link ValidationError} if no model is configured or a
44
+ * named model is missing.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const { defaultModel, modelOf } = resolveModels({
49
+ * models: [
50
+ * { model: "gpt-4o", maxInputTokens: 128000, maxOutputTokens: 16000 },
51
+ * { model: "o3-mini", maxInputTokens: 200000, maxOutputTokens: 100000, supportsReasoning: true },
52
+ * ],
53
+ * defaultModel: "gpt-4o",
54
+ * });
55
+ * ```
56
+ */
57
+ declare function resolveModels(options: ModelSelectionOptions): ResolvedModels;
19
58
  /** A tool description passed to the provider so the model can decide to call it. */
20
59
  interface ToolSpec {
21
60
  name: string;
@@ -26,6 +65,8 @@ interface ToolSpec {
26
65
  interface GenerateRequest {
27
66
  messages: Message[];
28
67
  tools?: ToolSpec[];
68
+ /** Which configured model to use; defaults to the provider's default model. */
69
+ model?: string;
29
70
  /** Abort signal to cancel an in-flight request. */
30
71
  signal?: AbortSignal;
31
72
  }
@@ -71,12 +112,16 @@ type GenerateChunk = {
71
112
  interface Provider {
72
113
  /** Stable provider identifier, e.g. `"openai-compatible"`. */
73
114
  readonly name: string;
74
- /** Per-model capability configuration supplied by the caller. (FR-007a) */
115
+ /** The default model's capability configuration. (FR-007a) */
75
116
  readonly capabilities: ModelCapabilities;
117
+ /** All models this provider is configured with (one or more). */
118
+ readonly models: ModelCapabilities[];
119
+ /** Look up a configured model by name, or the default when omitted. */
120
+ model(name?: string): ModelCapabilities;
76
121
  /** Generate a complete response. */
77
122
  generate(req: GenerateRequest): Promise<GenerateResponse>;
78
123
  /** Generate a streamed response. */
79
124
  generateStream(req: GenerateRequest): AsyncIterable<GenerateChunk>;
80
125
  }
81
126
 
82
- export type { CredentialSource as C, GenerateChunk as G, Provider as P, ToolCall as T, GenerateRequest as a, GenerateResponse as b, ToolSpec as c };
127
+ export { type CredentialSource as C, type GenerateChunk as G, type ModelSelectionOptions as M, type Provider as P, type ResolvedModels as R, type ToolCall as T, type GenerateRequest as a, type GenerateResponse as b, type ToolSpec as c, resolveModels as r };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkTLACSVEZ_cjs = require('../chunk-TLACSVEZ.cjs');
3
+ var chunkU64OEHG6_cjs = require('../chunk-U64OEHG6.cjs');
4
4
  require('../chunk-MQ2XTH3S.cjs');
5
5
  require('../chunk-IJASUMIQ.cjs');
6
6
 
@@ -8,19 +8,23 @@ require('../chunk-IJASUMIQ.cjs');
8
8
 
9
9
  Object.defineProperty(exports, "createCopilotProvider", {
10
10
  enumerable: true,
11
- get: function () { return chunkTLACSVEZ_cjs.createCopilotProvider; }
11
+ get: function () { return chunkU64OEHG6_cjs.createCopilotProvider; }
12
12
  });
13
13
  Object.defineProperty(exports, "createOpenAICompatibleProvider", {
14
14
  enumerable: true,
15
- get: function () { return chunkTLACSVEZ_cjs.createOpenAICompatibleProvider; }
15
+ get: function () { return chunkU64OEHG6_cjs.createOpenAICompatibleProvider; }
16
16
  });
17
17
  Object.defineProperty(exports, "providerErrorFromStatus", {
18
18
  enumerable: true,
19
- get: function () { return chunkTLACSVEZ_cjs.providerErrorFromStatus; }
19
+ get: function () { return chunkU64OEHG6_cjs.providerErrorFromStatus; }
20
+ });
21
+ Object.defineProperty(exports, "resolveModels", {
22
+ enumerable: true,
23
+ get: function () { return chunkU64OEHG6_cjs.resolveModels; }
20
24
  });
21
25
  Object.defineProperty(exports, "withRetry", {
22
26
  enumerable: true,
23
- get: function () { return chunkTLACSVEZ_cjs.withRetry; }
27
+ get: function () { return chunkU64OEHG6_cjs.withRetry; }
24
28
  });
25
29
  //# sourceMappingURL=index.cjs.map
26
30
  //# sourceMappingURL=index.cjs.map