agent-framework-js 0.1.2 → 0.3.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 (74) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/README.md +45 -0
  3. package/dist/agents/index.cjs +7 -7
  4. package/dist/agents/index.d.cts +6 -6
  5. package/dist/agents/index.d.ts +6 -6
  6. package/dist/agents/index.js +2 -2
  7. package/dist/{chunk-YKZJRE32.cjs → chunk-2WBJEXNY.cjs} +4 -4
  8. package/dist/{chunk-YKZJRE32.cjs.map → chunk-2WBJEXNY.cjs.map} +1 -1
  9. package/dist/{chunk-VLSVL5N2.js → chunk-55NB43FN.js} +3 -3
  10. package/dist/{chunk-VLSVL5N2.js.map → chunk-55NB43FN.js.map} +1 -1
  11. package/dist/{chunk-YBFLWRO5.cjs → chunk-FDCTSJMB.cjs} +21 -16
  12. package/dist/chunk-FDCTSJMB.cjs.map +1 -0
  13. package/dist/{chunk-LMN75W3W.cjs → chunk-I55OVD23.cjs} +4 -3
  14. package/dist/chunk-I55OVD23.cjs.map +1 -0
  15. package/dist/{chunk-QJ5XHA6S.cjs → chunk-IHMPSELC.cjs} +4 -4
  16. package/dist/{chunk-QJ5XHA6S.cjs.map → chunk-IHMPSELC.cjs.map} +1 -1
  17. package/dist/{chunk-RD5YUB2E.js → chunk-KOPGBIES.js} +15 -10
  18. package/dist/chunk-KOPGBIES.js.map +1 -0
  19. package/dist/{chunk-XPXTXOYQ.js → chunk-LC54DGGR.js} +4 -3
  20. package/dist/chunk-LC54DGGR.js.map +1 -0
  21. package/dist/{chunk-V472N2PK.js → chunk-PYIZ4PT3.js} +3 -3
  22. package/dist/{chunk-V472N2PK.js.map → chunk-PYIZ4PT3.js.map} +1 -1
  23. package/dist/chunk-QD2FFISV.js +327 -0
  24. package/dist/chunk-QD2FFISV.js.map +1 -0
  25. package/dist/chunk-XMDGLQFL.cjs +333 -0
  26. package/dist/chunk-XMDGLQFL.cjs.map +1 -0
  27. package/dist/declarative/index.cjs +4 -4
  28. package/dist/declarative/index.d.cts +6 -6
  29. package/dist/declarative/index.d.ts +6 -6
  30. package/dist/declarative/index.js +3 -3
  31. package/dist/{index-D7-znzrc.d.ts → index-C22fqyZQ.d.ts} +7 -5
  32. package/dist/{index-DdYZeNIu.d.cts → index-b1oTo3Lv.d.cts} +7 -5
  33. package/dist/index.cjs +34 -30
  34. package/dist/index.d.cts +6 -6
  35. package/dist/index.d.ts +6 -6
  36. package/dist/index.js +6 -6
  37. package/dist/mcp/index.d.cts +2 -2
  38. package/dist/mcp/index.d.ts +2 -2
  39. package/dist/middleware/index.d.cts +7 -7
  40. package/dist/middleware/index.d.ts +7 -7
  41. package/dist/persistence/index.cjs +5 -5
  42. package/dist/persistence/index.d.cts +3 -3
  43. package/dist/persistence/index.d.ts +3 -3
  44. package/dist/persistence/index.js +2 -2
  45. package/dist/provider-B807EuDV.d.cts +132 -0
  46. package/dist/provider-CvU3I-Xo.d.ts +132 -0
  47. package/dist/providers/index.cjs +9 -5
  48. package/dist/providers/index.d.cts +58 -14
  49. package/dist/providers/index.d.ts +58 -14
  50. package/dist/providers/index.js +1 -1
  51. package/dist/{registry-D4fThGiN.d.cts → registry-BCkSIe0E.d.cts} +2 -2
  52. package/dist/{registry-CpO0yH5v.d.ts → registry-D-CmT0gk.d.ts} +2 -2
  53. package/dist/{thread-CWVzTyti.d.ts → thread-BzwE1OnJ.d.cts} +4 -2
  54. package/dist/{thread-Dfo9LLf7.d.cts → thread-COljUAtD.d.ts} +4 -2
  55. package/dist/{tool-BZg_znMZ.d.cts → tool-D9Uodu9Y.d.cts} +1 -1
  56. package/dist/{tool-CSCC87OD.d.ts → tool-LPMc4QQd.d.ts} +1 -1
  57. package/dist/tools/index.d.cts +4 -4
  58. package/dist/tools/index.d.ts +4 -4
  59. package/dist/{types-Cn1g9Tg4.d.cts → types-AlvjoTyS.d.cts} +24 -1
  60. package/dist/{types-Cn1g9Tg4.d.ts → types-AlvjoTyS.d.ts} +24 -1
  61. package/dist/workflows/index.d.cts +6 -6
  62. package/dist/workflows/index.d.ts +6 -6
  63. package/package.json +4 -4
  64. package/AGENT_USAGE.md +0 -207
  65. package/dist/chunk-LMN75W3W.cjs.map +0 -1
  66. package/dist/chunk-RD5YUB2E.js.map +0 -1
  67. package/dist/chunk-TLACSVEZ.cjs +0 -201
  68. package/dist/chunk-TLACSVEZ.cjs.map +0 -1
  69. package/dist/chunk-UVWQWOLO.js +0 -196
  70. package/dist/chunk-UVWQWOLO.js.map +0 -1
  71. package/dist/chunk-XPXTXOYQ.js.map +0 -1
  72. package/dist/chunk-YBFLWRO5.cjs.map +0 -1
  73. package/dist/provider-CMAymr1b.d.cts +0 -82
  74. package/dist/provider-osAtfZ7x.d.ts +0 -82
@@ -1,10 +1,10 @@
1
- import { M as Message } from './types-Cn1g9Tg4.cjs';
1
+ import { M as Message } from './types-AlvjoTyS.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';
4
- import { T as Tool } from './tool-BZg_znMZ.cjs';
3
+ import { a as GenerateRequest, b as GenerateResponse, P as Provider } from './provider-B807EuDV.cjs';
4
+ import { T as Tool } from './tool-D9Uodu9Y.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-BzwE1OnJ.cjs';
7
+ import { T as ToolRegistry } from './registry-BCkSIe0E.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) */
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 chunk2WBJEXNY_cjs = require('./chunk-2WBJEXNY.cjs');
7
+ var chunkFDCTSJMB_cjs = require('./chunk-FDCTSJMB.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');
13
12
  var chunkV6O6SYAN_cjs = require('./chunk-V6O6SYAN.cjs');
14
- var chunkQJ5XHA6S_cjs = require('./chunk-QJ5XHA6S.cjs');
15
- var chunkLMN75W3W_cjs = require('./chunk-LMN75W3W.cjs');
13
+ var chunkGYDY3KX5_cjs = require('./chunk-GYDY3KX5.cjs');
14
+ var chunkIHMPSELC_cjs = require('./chunk-IHMPSELC.cjs');
15
+ var chunkI55OVD23_cjs = require('./chunk-I55OVD23.cjs');
16
16
  var chunkFOTCUNP5_cjs = require('./chunk-FOTCUNP5.cjs');
17
- var chunkTLACSVEZ_cjs = require('./chunk-TLACSVEZ.cjs');
17
+ var chunkXMDGLQFL_cjs = require('./chunk-XMDGLQFL.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 chunk2WBJEXNY_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 chunkFDCTSJMB_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 chunkFDCTSJMB_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 chunkFDCTSJMB_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; }
@@ -136,37 +128,45 @@ Object.defineProperty(exports, "withSpan", {
136
128
  enumerable: true,
137
129
  get: function () { return chunkV6O6SYAN_cjs.withSpan; }
138
130
  });
131
+ Object.defineProperty(exports, "connectMCP", {
132
+ enumerable: true,
133
+ get: function () { return chunkGYDY3KX5_cjs.connectMCP; }
134
+ });
135
+ Object.defineProperty(exports, "mcpToolToTool", {
136
+ enumerable: true,
137
+ get: function () { return chunkGYDY3KX5_cjs.mcpToolToTool; }
138
+ });
139
139
  Object.defineProperty(exports, "ThreadPersistence", {
140
140
  enumerable: true,
141
- get: function () { return chunkQJ5XHA6S_cjs.ThreadPersistence; }
141
+ get: function () { return chunkIHMPSELC_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 chunkIHMPSELC_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 chunkIHMPSELC_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 chunkI55OVD23_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 chunkI55OVD23_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 chunkI55OVD23_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 chunkI55OVD23_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 chunkI55OVD23_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 chunkXMDGLQFL_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 chunkXMDGLQFL_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 chunkXMDGLQFL_cjs.providerErrorFromStatus; }
194
+ });
195
+ Object.defineProperty(exports, "resolveModels", {
196
+ enumerable: true,
197
+ get: function () { return chunkXMDGLQFL_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 chunkXMDGLQFL_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
- 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';
1
+ export { C as ContentPart, J as JSONSchema, M as Message, a as MessageToolCall, b as ModelCapabilities, R as Role, h as hasImage, m as messageText, t as textMessage } from './types-AlvjoTyS.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-B807EuDV.cjs';
5
5
  export { CopilotProviderOptions, OpenAICompatibleProviderOptions, RetryOptions, createCopilotProvider, createOpenAICompatibleProvider, providerErrorFromStatus, withRetry } from './providers/index.cjs';
6
- export { T as Tool, d as defineTool } from './tool-BZg_znMZ.cjs';
6
+ export { T as Tool, d as defineTool } from './tool-D9Uodu9Y.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-BCkSIe0E.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-b1oTo3Lv.cjs';
10
+ export { T as Thread, a as ThreadOptions, e as estimateTokens } from './thread-BzwE1OnJ.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
- 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';
1
+ export { C as ContentPart, J as JSONSchema, M as Message, a as MessageToolCall, b as ModelCapabilities, R as Role, h as hasImage, m as messageText, t as textMessage } from './types-AlvjoTyS.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-CvU3I-Xo.js';
5
5
  export { CopilotProviderOptions, OpenAICompatibleProviderOptions, RetryOptions, createCopilotProvider, createOpenAICompatibleProvider, providerErrorFromStatus, withRetry } from './providers/index.js';
6
- export { T as Tool, d as defineTool } from './tool-CSCC87OD.js';
6
+ export { T as Tool, d as defineTool } from './tool-LPMc4QQd.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-D-CmT0gk.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-C22fqyZQ.js';
10
+ export { T as Thread, a as ThreadOptions, e as estimateTokens } from './thread-COljUAtD.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-55NB43FN.js';
5
+ export { buildMessages, createAgent, runLoop } from './chunk-KOPGBIES.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';
11
10
  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';
11
+ export { connectMCP, mcpToolToTool } from './chunk-YH5746OF.js';
12
+ export { ThreadPersistence, createBrowserStore, createMemoryStore } from './chunk-PYIZ4PT3.js';
13
+ export { Thread, estimateTokens, hasImage, messageText, textMessage } from './chunk-LC54DGGR.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-QD2FFISV.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,5 +1,5 @@
1
- import { T as Tool } from '../tool-BZg_znMZ.cjs';
2
- import '../types-Cn1g9Tg4.cjs';
1
+ import { T as Tool } from '../tool-D9Uodu9Y.cjs';
2
+ import '../types-AlvjoTyS.cjs';
3
3
 
4
4
  /**
5
5
  * MCP (Model Context Protocol) integration. Connects to MCP servers and exposes
@@ -1,5 +1,5 @@
1
- import { T as Tool } from '../tool-CSCC87OD.js';
2
- import '../types-Cn1g9Tg4.js';
1
+ import { T as Tool } from '../tool-LPMc4QQd.js';
2
+ import '../types-AlvjoTyS.js';
3
3
 
4
4
  /**
5
5
  * MCP (Model Context Protocol) integration. Connects to MCP servers and exposes
@@ -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';
3
- import '../types-Cn1g9Tg4.cjs';
1
+ import { a as AgentConfig, M as Middleware } from '../index-b1oTo3Lv.cjs';
2
+ export { d as MiddlewareContext, N as Next, i as composeMiddleware } from '../index-b1oTo3Lv.cjs';
3
+ import '../types-AlvjoTyS.cjs';
4
4
  import '../errors-CjVz4W_5.cjs';
5
- import '../provider-CMAymr1b.cjs';
6
- import '../tool-BZg_znMZ.cjs';
5
+ import '../provider-B807EuDV.cjs';
6
+ import '../tool-D9Uodu9Y.cjs';
7
7
  import '../skill-DfNChtJN.cjs';
8
- import '../thread-Dfo9LLf7.cjs';
9
- import '../registry-D4fThGiN.cjs';
8
+ import '../thread-BzwE1OnJ.cjs';
9
+ import '../registry-BCkSIe0E.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';
3
- import '../types-Cn1g9Tg4.js';
1
+ import { a as AgentConfig, M as Middleware } from '../index-C22fqyZQ.js';
2
+ export { d as MiddlewareContext, N as Next, i as composeMiddleware } from '../index-C22fqyZQ.js';
3
+ import '../types-AlvjoTyS.js';
4
4
  import '../errors-CjVz4W_5.js';
5
- import '../provider-osAtfZ7x.js';
6
- import '../tool-CSCC87OD.js';
5
+ import '../provider-CvU3I-Xo.js';
6
+ import '../tool-LPMc4QQd.js';
7
7
  import '../skill-DfNChtJN.js';
8
- import '../thread-CWVzTyti.js';
9
- import '../registry-CpO0yH5v.js';
8
+ import '../thread-COljUAtD.js';
9
+ import '../registry-D-CmT0gk.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 chunkIHMPSELC_cjs = require('../chunk-IHMPSELC.cjs');
4
+ require('../chunk-I55OVD23.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 chunkIHMPSELC_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 chunkIHMPSELC_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 chunkIHMPSELC_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';
2
- import '../types-Cn1g9Tg4.cjs';
3
- import '../provider-CMAymr1b.cjs';
1
+ import { T as Thread } from '../thread-BzwE1OnJ.cjs';
2
+ import '../types-AlvjoTyS.cjs';
3
+ import '../provider-B807EuDV.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';
2
- import '../types-Cn1g9Tg4.js';
3
- import '../provider-osAtfZ7x.js';
1
+ import { T as Thread } from '../thread-COljUAtD.js';
2
+ import '../types-AlvjoTyS.js';
3
+ import '../provider-CvU3I-Xo.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-PYIZ4PT3.js';
2
+ import '../chunk-LC54DGGR.js';
3
3
  import '../chunk-ACBIHS5H.js';
4
4
  import '../chunk-IXV4UIF5.js';
5
5
  import '../chunk-DEABART4.js';
@@ -0,0 +1,132 @@
1
+ import { b as ModelCapabilities, M as Message } from './types-AlvjoTyS.cjs';
2
+
3
+ /**
4
+ * LLM provider abstraction. Agents and workflows depend only on this interface,
5
+ * never on a concrete provider, so new providers can be added without changing
6
+ * agent/workflow code. (FR-007)
7
+ *
8
+ * Credentials are always obtained via a caller-supplied callback and are never
9
+ * bundled, persisted, or logged by the framework. (FR-005a, FR-008)
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+
14
+ /** A caller-supplied source of credentials. The framework never stores the value. */
15
+ interface CredentialSource {
16
+ /** Return the current credential (token/api key). May be async. */
17
+ getCredential(): string | Promise<string>;
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;
58
+ /** A tool description passed to the provider so the model can decide to call it. */
59
+ interface ToolSpec {
60
+ name: string;
61
+ description: string;
62
+ inputSchema: Record<string, unknown>;
63
+ }
64
+ /** A request to generate a model response. */
65
+ interface GenerateRequest {
66
+ messages: Message[];
67
+ tools?: ToolSpec[];
68
+ /** Which configured model to use; defaults to the provider's default model. */
69
+ model?: string;
70
+ /** Abort signal to cancel an in-flight request. */
71
+ signal?: AbortSignal;
72
+ }
73
+ /** A tool call requested by the model. */
74
+ interface ToolCall {
75
+ id: string;
76
+ name: string;
77
+ /** Raw JSON arguments (validated by the tools module before invocation). */
78
+ arguments: unknown;
79
+ }
80
+ /** A complete (non-streaming) model response. */
81
+ interface GenerateResponse {
82
+ /** Final answer text. */
83
+ text: string;
84
+ /** Reasoning/thinking content — only present for reasoning-capable models. (FR-003a) */
85
+ reasoning?: string;
86
+ /**
87
+ * Opaque reasoning blob (e.g. Claude thinking signature) to round-trip on the
88
+ * next assistant turn for thinking continuity. Never logged or inspected.
89
+ */
90
+ reasoningOpaque?: string;
91
+ /** Tool calls the model wants to make, if any. */
92
+ toolCalls?: ToolCall[];
93
+ /** Approximate token usage if reported by the provider. */
94
+ usage?: {
95
+ inputTokens?: number;
96
+ outputTokens?: number;
97
+ };
98
+ }
99
+ /** An incremental streaming chunk. */
100
+ type GenerateChunk = {
101
+ type: "text";
102
+ text: string;
103
+ } | {
104
+ type: "reasoning";
105
+ text: string;
106
+ } | {
107
+ type: "tool-call";
108
+ toolCall: ToolCall;
109
+ } | {
110
+ type: "done";
111
+ response: GenerateResponse;
112
+ };
113
+ /**
114
+ * An LLM backend. Implementations adapt a concrete API (Copilot, OpenAI-compatible)
115
+ * onto this uniform surface.
116
+ */
117
+ interface Provider {
118
+ /** Stable provider identifier, e.g. `"openai-compatible"`. */
119
+ readonly name: string;
120
+ /** The default model's capability configuration. (FR-007a) */
121
+ readonly capabilities: ModelCapabilities;
122
+ /** All models this provider is configured with (one or more). */
123
+ readonly models: ModelCapabilities[];
124
+ /** Look up a configured model by name, or the default when omitted. */
125
+ model(name?: string): ModelCapabilities;
126
+ /** Generate a complete response. */
127
+ generate(req: GenerateRequest): Promise<GenerateResponse>;
128
+ /** Generate a streamed response. */
129
+ generateStream(req: GenerateRequest): AsyncIterable<GenerateChunk>;
130
+ }
131
+
132
+ 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 };
@@ -0,0 +1,132 @@
1
+ import { b as ModelCapabilities, M as Message } from './types-AlvjoTyS.js';
2
+
3
+ /**
4
+ * LLM provider abstraction. Agents and workflows depend only on this interface,
5
+ * never on a concrete provider, so new providers can be added without changing
6
+ * agent/workflow code. (FR-007)
7
+ *
8
+ * Credentials are always obtained via a caller-supplied callback and are never
9
+ * bundled, persisted, or logged by the framework. (FR-005a, FR-008)
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+
14
+ /** A caller-supplied source of credentials. The framework never stores the value. */
15
+ interface CredentialSource {
16
+ /** Return the current credential (token/api key). May be async. */
17
+ getCredential(): string | Promise<string>;
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;
58
+ /** A tool description passed to the provider so the model can decide to call it. */
59
+ interface ToolSpec {
60
+ name: string;
61
+ description: string;
62
+ inputSchema: Record<string, unknown>;
63
+ }
64
+ /** A request to generate a model response. */
65
+ interface GenerateRequest {
66
+ messages: Message[];
67
+ tools?: ToolSpec[];
68
+ /** Which configured model to use; defaults to the provider's default model. */
69
+ model?: string;
70
+ /** Abort signal to cancel an in-flight request. */
71
+ signal?: AbortSignal;
72
+ }
73
+ /** A tool call requested by the model. */
74
+ interface ToolCall {
75
+ id: string;
76
+ name: string;
77
+ /** Raw JSON arguments (validated by the tools module before invocation). */
78
+ arguments: unknown;
79
+ }
80
+ /** A complete (non-streaming) model response. */
81
+ interface GenerateResponse {
82
+ /** Final answer text. */
83
+ text: string;
84
+ /** Reasoning/thinking content — only present for reasoning-capable models. (FR-003a) */
85
+ reasoning?: string;
86
+ /**
87
+ * Opaque reasoning blob (e.g. Claude thinking signature) to round-trip on the
88
+ * next assistant turn for thinking continuity. Never logged or inspected.
89
+ */
90
+ reasoningOpaque?: string;
91
+ /** Tool calls the model wants to make, if any. */
92
+ toolCalls?: ToolCall[];
93
+ /** Approximate token usage if reported by the provider. */
94
+ usage?: {
95
+ inputTokens?: number;
96
+ outputTokens?: number;
97
+ };
98
+ }
99
+ /** An incremental streaming chunk. */
100
+ type GenerateChunk = {
101
+ type: "text";
102
+ text: string;
103
+ } | {
104
+ type: "reasoning";
105
+ text: string;
106
+ } | {
107
+ type: "tool-call";
108
+ toolCall: ToolCall;
109
+ } | {
110
+ type: "done";
111
+ response: GenerateResponse;
112
+ };
113
+ /**
114
+ * An LLM backend. Implementations adapt a concrete API (Copilot, OpenAI-compatible)
115
+ * onto this uniform surface.
116
+ */
117
+ interface Provider {
118
+ /** Stable provider identifier, e.g. `"openai-compatible"`. */
119
+ readonly name: string;
120
+ /** The default model's capability configuration. (FR-007a) */
121
+ readonly capabilities: ModelCapabilities;
122
+ /** All models this provider is configured with (one or more). */
123
+ readonly models: ModelCapabilities[];
124
+ /** Look up a configured model by name, or the default when omitted. */
125
+ model(name?: string): ModelCapabilities;
126
+ /** Generate a complete response. */
127
+ generate(req: GenerateRequest): Promise<GenerateResponse>;
128
+ /** Generate a streamed response. */
129
+ generateStream(req: GenerateRequest): AsyncIterable<GenerateChunk>;
130
+ }
131
+
132
+ 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 };