agent-framework-js 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/AGENT_USAGE.md +207 -0
  2. package/LICENSE +21 -0
  3. package/README.md +99 -0
  4. package/dist/agents/index.cjs +35 -0
  5. package/dist/agents/index.cjs.map +1 -0
  6. package/dist/agents/index.d.cts +8 -0
  7. package/dist/agents/index.d.ts +8 -0
  8. package/dist/agents/index.js +10 -0
  9. package/dist/agents/index.js.map +1 -0
  10. package/dist/chunk-5M6ER4ZX.cjs +4 -0
  11. package/dist/chunk-5M6ER4ZX.cjs.map +1 -0
  12. package/dist/chunk-5PDJOBTD.js +38 -0
  13. package/dist/chunk-5PDJOBTD.js.map +1 -0
  14. package/dist/chunk-7ZXUIHLH.js +18 -0
  15. package/dist/chunk-7ZXUIHLH.js.map +1 -0
  16. package/dist/chunk-ACBIHS5H.js +30 -0
  17. package/dist/chunk-ACBIHS5H.js.map +1 -0
  18. package/dist/chunk-DEABART4.js +54 -0
  19. package/dist/chunk-DEABART4.js.map +1 -0
  20. package/dist/chunk-FOTCUNP5.cjs +34 -0
  21. package/dist/chunk-FOTCUNP5.cjs.map +1 -0
  22. package/dist/chunk-FSDMBWQV.cjs +20 -0
  23. package/dist/chunk-FSDMBWQV.cjs.map +1 -0
  24. package/dist/chunk-GYDY3KX5.cjs +72 -0
  25. package/dist/chunk-GYDY3KX5.cjs.map +1 -0
  26. package/dist/chunk-HGEPXJDG.js +129 -0
  27. package/dist/chunk-HGEPXJDG.js.map +1 -0
  28. package/dist/chunk-IJASUMIQ.cjs +57 -0
  29. package/dist/chunk-IJASUMIQ.cjs.map +1 -0
  30. package/dist/chunk-IU3LS5FC.cjs +10 -0
  31. package/dist/chunk-IU3LS5FC.cjs.map +1 -0
  32. package/dist/chunk-IUKD54F7.js +8 -0
  33. package/dist/chunk-IUKD54F7.js.map +1 -0
  34. package/dist/chunk-IXV4UIF5.js +79 -0
  35. package/dist/chunk-IXV4UIF5.js.map +1 -0
  36. package/dist/chunk-KEI3EALJ.cjs +10 -0
  37. package/dist/chunk-KEI3EALJ.cjs.map +1 -0
  38. package/dist/chunk-LMN75W3W.cjs +87 -0
  39. package/dist/chunk-LMN75W3W.cjs.map +1 -0
  40. package/dist/chunk-MCLVWCOB.js +3 -0
  41. package/dist/chunk-MCLVWCOB.js.map +1 -0
  42. package/dist/chunk-MQ2XTH3S.cjs +87 -0
  43. package/dist/chunk-MQ2XTH3S.cjs.map +1 -0
  44. package/dist/chunk-QJ5XHA6S.cjs +95 -0
  45. package/dist/chunk-QJ5XHA6S.cjs.map +1 -0
  46. package/dist/chunk-RD5YUB2E.js +190 -0
  47. package/dist/chunk-RD5YUB2E.js.map +1 -0
  48. package/dist/chunk-RZ43WNHR.js +8 -0
  49. package/dist/chunk-RZ43WNHR.js.map +1 -0
  50. package/dist/chunk-RZP2ZUUX.cjs +252 -0
  51. package/dist/chunk-RZP2ZUUX.cjs.map +1 -0
  52. package/dist/chunk-T2GHJ5R4.js +241 -0
  53. package/dist/chunk-T2GHJ5R4.js.map +1 -0
  54. package/dist/chunk-TAMJ5HSR.cjs +137 -0
  55. package/dist/chunk-TAMJ5HSR.cjs.map +1 -0
  56. package/dist/chunk-TLACSVEZ.cjs +201 -0
  57. package/dist/chunk-TLACSVEZ.cjs.map +1 -0
  58. package/dist/chunk-UVWQWOLO.js +196 -0
  59. package/dist/chunk-UVWQWOLO.js.map +1 -0
  60. package/dist/chunk-V472N2PK.js +91 -0
  61. package/dist/chunk-V472N2PK.js.map +1 -0
  62. package/dist/chunk-V6O6SYAN.cjs +43 -0
  63. package/dist/chunk-V6O6SYAN.cjs.map +1 -0
  64. package/dist/chunk-VLSVL5N2.js +48 -0
  65. package/dist/chunk-VLSVL5N2.js.map +1 -0
  66. package/dist/chunk-WSMYH2IN.cjs +86 -0
  67. package/dist/chunk-WSMYH2IN.cjs.map +1 -0
  68. package/dist/chunk-XPXTXOYQ.js +81 -0
  69. package/dist/chunk-XPXTXOYQ.js.map +1 -0
  70. package/dist/chunk-YBFLWRO5.cjs +194 -0
  71. package/dist/chunk-YBFLWRO5.cjs.map +1 -0
  72. package/dist/chunk-YCBDEEAV.js +82 -0
  73. package/dist/chunk-YCBDEEAV.js.map +1 -0
  74. package/dist/chunk-YH5746OF.js +69 -0
  75. package/dist/chunk-YH5746OF.js.map +1 -0
  76. package/dist/chunk-YKZJRE32.cjs +50 -0
  77. package/dist/chunk-YKZJRE32.cjs.map +1 -0
  78. package/dist/declarative/index.cjs +19 -0
  79. package/dist/declarative/index.cjs.map +1 -0
  80. package/dist/declarative/index.d.cts +60 -0
  81. package/dist/declarative/index.d.ts +60 -0
  82. package/dist/declarative/index.js +10 -0
  83. package/dist/declarative/index.js.map +1 -0
  84. package/dist/errors-CjVz4W_5.d.cts +68 -0
  85. package/dist/errors-CjVz4W_5.d.ts +68 -0
  86. package/dist/index-C2vzfbBz.d.cts +57 -0
  87. package/dist/index-C2vzfbBz.d.ts +57 -0
  88. package/dist/index-D7-znzrc.d.ts +153 -0
  89. package/dist/index-DdYZeNIu.d.cts +153 -0
  90. package/dist/index.cjs +236 -0
  91. package/dist/index.cjs.map +1 -0
  92. package/dist/index.d.cts +51 -0
  93. package/dist/index.d.ts +51 -0
  94. package/dist/index.js +19 -0
  95. package/dist/index.js.map +1 -0
  96. package/dist/mcp/index.cjs +19 -0
  97. package/dist/mcp/index.cjs.map +1 -0
  98. package/dist/mcp/index.d.cts +72 -0
  99. package/dist/mcp/index.d.ts +72 -0
  100. package/dist/mcp/index.js +6 -0
  101. package/dist/mcp/index.js.map +1 -0
  102. package/dist/middleware/index.cjs +17 -0
  103. package/dist/middleware/index.cjs.map +1 -0
  104. package/dist/middleware/index.d.cts +29 -0
  105. package/dist/middleware/index.d.ts +29 -0
  106. package/dist/middleware/index.js +4 -0
  107. package/dist/middleware/index.js.map +1 -0
  108. package/dist/observability/index.cjs +29 -0
  109. package/dist/observability/index.cjs.map +1 -0
  110. package/dist/observability/index.d.cts +1 -0
  111. package/dist/observability/index.d.ts +1 -0
  112. package/dist/observability/index.js +4 -0
  113. package/dist/observability/index.js.map +1 -0
  114. package/dist/persistence/index.cjs +24 -0
  115. package/dist/persistence/index.cjs.map +1 -0
  116. package/dist/persistence/index.d.cts +51 -0
  117. package/dist/persistence/index.d.ts +51 -0
  118. package/dist/persistence/index.js +7 -0
  119. package/dist/persistence/index.js.map +1 -0
  120. package/dist/provider-CMAymr1b.d.cts +82 -0
  121. package/dist/provider-osAtfZ7x.d.ts +82 -0
  122. package/dist/providers/index.cjs +26 -0
  123. package/dist/providers/index.cjs.map +1 -0
  124. package/dist/providers/index.d.cts +107 -0
  125. package/dist/providers/index.d.ts +107 -0
  126. package/dist/providers/index.js +5 -0
  127. package/dist/providers/index.js.map +1 -0
  128. package/dist/registry-CpO0yH5v.d.ts +57 -0
  129. package/dist/registry-D4fThGiN.d.cts +57 -0
  130. package/dist/skill-DfNChtJN.d.cts +45 -0
  131. package/dist/skill-DfNChtJN.d.ts +45 -0
  132. package/dist/skills/index.cjs +20 -0
  133. package/dist/skills/index.cjs.map +1 -0
  134. package/dist/skills/index.d.cts +30 -0
  135. package/dist/skills/index.d.ts +30 -0
  136. package/dist/skills/index.js +3 -0
  137. package/dist/skills/index.js.map +1 -0
  138. package/dist/thread-CWVzTyti.d.ts +51 -0
  139. package/dist/thread-Dfo9LLf7.d.cts +51 -0
  140. package/dist/tool-BZg_znMZ.d.cts +50 -0
  141. package/dist/tool-CSCC87OD.d.ts +50 -0
  142. package/dist/tools/index.cjs +27 -0
  143. package/dist/tools/index.cjs.map +1 -0
  144. package/dist/tools/index.d.cts +21 -0
  145. package/dist/tools/index.d.ts +21 -0
  146. package/dist/tools/index.js +6 -0
  147. package/dist/tools/index.js.map +1 -0
  148. package/dist/types-Cn1g9Tg4.d.cts +63 -0
  149. package/dist/types-Cn1g9Tg4.d.ts +63 -0
  150. package/dist/workflows/index.cjs +50 -0
  151. package/dist/workflows/index.cjs.map +1 -0
  152. package/dist/workflows/index.d.cts +182 -0
  153. package/dist/workflows/index.d.ts +182 -0
  154. package/dist/workflows/index.js +5 -0
  155. package/dist/workflows/index.js.map +1 -0
  156. package/package.json +145 -0
@@ -0,0 +1,51 @@
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
+ 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
+ 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';
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';
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';
11
+ export { MCPConnection, MCPConnectionConfig, MCPTransport, connectMCP, mcpToolToTool } from './mcp/index.cjs';
12
+ export { SkillIndex } from './skills/index.cjs';
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';
14
+ export { useMiddleware } from './middleware/index.cjs';
15
+ export { BrowserStoreOptions, Store, ThreadPersistence, createBrowserStore, createMemoryStore } from './persistence/index.cjs';
16
+ export { AgentDefinition, LoaderDeps, ProviderDefinition, loadAgentDefinition } from './declarative/index.cjs';
17
+ export { S as Skill, a as SkillSource, d as defineSkill, l as loadSource } from './skill-DfNChtJN.cjs';
18
+
19
+ /**
20
+ * Runtime capability detection. The framework runs in browsers, edge runtimes,
21
+ * and Node. Features that need Node-only APIs (process spawning, filesystem) are
22
+ * gated behind these checks and throw {@link RuntimeUnsupportedError} when used
23
+ * in a runtime that cannot support them. (FR-030, FR-030a)
24
+ *
25
+ * @packageDocumentation
26
+ */
27
+ /** Describes which optional capabilities the current runtime supports. */
28
+ interface RuntimeCapabilities {
29
+ /** Can spawn child processes (Node only) — required for stdio MCP transport. */
30
+ canSpawnProcess: boolean;
31
+ /** Has `localStorage` available (browsers). */
32
+ hasLocalStorage: boolean;
33
+ /** Has `indexedDB` available (browsers). */
34
+ hasIndexedDB: boolean;
35
+ /** Running under Node.js. */
36
+ isNode: boolean;
37
+ }
38
+ /** Detect the current runtime's capabilities (memoized). */
39
+ declare function detectRuntime(): RuntimeCapabilities;
40
+ /**
41
+ * Assert that a runtime capability is present, throwing a typed error otherwise.
42
+ *
43
+ * @param capability - The capability key to require.
44
+ * @param feature - Human-readable feature name used in the error message.
45
+ * @throws {RuntimeUnsupportedError} when the capability is unavailable.
46
+ */
47
+ declare function requireCapability(capability: keyof RuntimeCapabilities, feature: string): void;
48
+ /** Reset the memoized detection — intended for tests only. */
49
+ declare function resetRuntimeCache(): void;
50
+
51
+ export { type RuntimeCapabilities, detectRuntime, requireCapability, resetRuntimeCache };
@@ -0,0 +1,51 @@
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
+ 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
+ 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';
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';
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';
11
+ export { MCPConnection, MCPConnectionConfig, MCPTransport, connectMCP, mcpToolToTool } from './mcp/index.js';
12
+ export { SkillIndex } from './skills/index.js';
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';
14
+ export { useMiddleware } from './middleware/index.js';
15
+ export { BrowserStoreOptions, Store, ThreadPersistence, createBrowserStore, createMemoryStore } from './persistence/index.js';
16
+ export { AgentDefinition, LoaderDeps, ProviderDefinition, loadAgentDefinition } from './declarative/index.js';
17
+ export { S as Skill, a as SkillSource, d as defineSkill, l as loadSource } from './skill-DfNChtJN.js';
18
+
19
+ /**
20
+ * Runtime capability detection. The framework runs in browsers, edge runtimes,
21
+ * and Node. Features that need Node-only APIs (process spawning, filesystem) are
22
+ * gated behind these checks and throw {@link RuntimeUnsupportedError} when used
23
+ * in a runtime that cannot support them. (FR-030, FR-030a)
24
+ *
25
+ * @packageDocumentation
26
+ */
27
+ /** Describes which optional capabilities the current runtime supports. */
28
+ interface RuntimeCapabilities {
29
+ /** Can spawn child processes (Node only) — required for stdio MCP transport. */
30
+ canSpawnProcess: boolean;
31
+ /** Has `localStorage` available (browsers). */
32
+ hasLocalStorage: boolean;
33
+ /** Has `indexedDB` available (browsers). */
34
+ hasIndexedDB: boolean;
35
+ /** Running under Node.js. */
36
+ isNode: boolean;
37
+ }
38
+ /** Detect the current runtime's capabilities (memoized). */
39
+ declare function detectRuntime(): RuntimeCapabilities;
40
+ /**
41
+ * Assert that a runtime capability is present, throwing a typed error otherwise.
42
+ *
43
+ * @param capability - The capability key to require.
44
+ * @param feature - Human-readable feature name used in the error message.
45
+ * @throws {RuntimeUnsupportedError} when the capability is unavailable.
46
+ */
47
+ declare function requireCapability(capability: keyof RuntimeCapabilities, feature: string): void;
48
+ /** Reset the memoized detection — intended for tests only. */
49
+ declare function resetRuntimeCache(): void;
50
+
51
+ export { type RuntimeCapabilities, detectRuntime, requireCapability, resetRuntimeCache };
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ export { defineTool } from './chunk-RZ43WNHR.js';
2
+ export { CHECKPOINT_VERSION, createCheckpoint, createWorkflow, restoreCheckpoint, runBounded, serializeCheckpoint, stepConcurrent, stepGroup, stepHandoff, stepSequential } from './chunk-T2GHJ5R4.js';
3
+ import './chunk-MCLVWCOB.js';
4
+ export { loadAgentDefinition } from './chunk-VLSVL5N2.js';
5
+ export { buildMessages, createAgent, runLoop } from './chunk-RD5YUB2E.js';
6
+ export { SkillIndex, defineSkill, loadSource } from './chunk-YCBDEEAV.js';
7
+ export { ToolRegistry, namespacedName, validateArgs } from './chunk-HGEPXJDG.js';
8
+ export { connectMCP, mcpToolToTool } from './chunk-YH5746OF.js';
9
+ export { useMiddleware } from './chunk-IUKD54F7.js';
10
+ export { composeMiddleware } from './chunk-7ZXUIHLH.js';
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';
14
+ export { detectRuntime, requireCapability, resetRuntimeCache } from './chunk-ACBIHS5H.js';
15
+ export { createCopilotProvider, createOpenAICompatibleProvider, providerErrorFromStatus, withRetry } from './chunk-UVWQWOLO.js';
16
+ export { CheckpointError, FrameworkError, MCPError, ProviderError, RuntimeUnsupportedError, ToolError, ValidationError } from './chunk-IXV4UIF5.js';
17
+ export { REDACTED, redact } from './chunk-DEABART4.js';
18
+ //# sourceMappingURL=index.js.map
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var chunkGYDY3KX5_cjs = require('../chunk-GYDY3KX5.cjs');
4
+ require('../chunk-FOTCUNP5.cjs');
5
+ require('../chunk-MQ2XTH3S.cjs');
6
+ require('../chunk-IJASUMIQ.cjs');
7
+
8
+
9
+
10
+ Object.defineProperty(exports, "connectMCP", {
11
+ enumerable: true,
12
+ get: function () { return chunkGYDY3KX5_cjs.connectMCP; }
13
+ });
14
+ Object.defineProperty(exports, "mcpToolToTool", {
15
+ enumerable: true,
16
+ get: function () { return chunkGYDY3KX5_cjs.mcpToolToTool; }
17
+ });
18
+ //# sourceMappingURL=index.cjs.map
19
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,72 @@
1
+ import { T as Tool } from '../tool-BZg_znMZ.cjs';
2
+ import '../types-Cn1g9Tg4.cjs';
3
+
4
+ /**
5
+ * MCP (Model Context Protocol) integration. Connects to MCP servers and exposes
6
+ * their tools through the framework's uniform tool interface.
7
+ *
8
+ * Remote transport (HTTP/SSE) works in all runtimes; stdio (spawning a server
9
+ * process) works only where process spawning is permitted (Node). Requesting
10
+ * stdio elsewhere throws a typed {@link RuntimeUnsupportedError}. (FR-013, FR-013a,
11
+ * FR-013b, FR-030a)
12
+ *
13
+ * The `@modelcontextprotocol/sdk` package is an optional peer dependency and is
14
+ * loaded lazily so browser bundles that do not use MCP pay no cost.
15
+ *
16
+ * @packageDocumentation
17
+ */
18
+
19
+ /** Transport options for an MCP connection. */
20
+ type MCPTransport = {
21
+ kind: "remote";
22
+ url: string;
23
+ } | {
24
+ kind: "stdio";
25
+ command: string;
26
+ args?: string[];
27
+ };
28
+ /** Configuration for connecting to an MCP server. */
29
+ interface MCPConnectionConfig {
30
+ /** Connection id; becomes the namespace prefix for discovered tools. (FR-014a) */
31
+ id: string;
32
+ transport: MCPTransport;
33
+ /** Whether the connection's tools are enabled. Defaults to true. */
34
+ enabled?: boolean;
35
+ }
36
+ /** A live connection to an MCP server. */
37
+ interface MCPConnection {
38
+ readonly id: string;
39
+ connect(): Promise<void>;
40
+ listTools(): Promise<Tool[]>;
41
+ close(): Promise<void>;
42
+ }
43
+ /**
44
+ * Connect to an MCP server.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const mcp = await connectMCP({ id: "docs", transport: { kind: "remote", url: "https://mcp.example.com" } });
49
+ * const tools = await mcp.listTools(); // namespaced as docs.<tool>
50
+ * ```
51
+ */
52
+ declare function connectMCP(config: MCPConnectionConfig): Promise<MCPConnection>;
53
+
54
+ /**
55
+ * Adapts MCP-provided tools onto the framework's uniform {@link Tool} contract,
56
+ * namespaced by the connection id so collisions are impossible. (FR-014, FR-014a)
57
+ *
58
+ * @packageDocumentation
59
+ */
60
+
61
+ interface MCPToolDef {
62
+ name: string;
63
+ description?: string;
64
+ inputSchema: Record<string, unknown>;
65
+ }
66
+ /**
67
+ * Wrap an MCP tool definition as a framework tool. Invocation calls back through
68
+ * the MCP client; failures surface as typed {@link MCPError}/tool errors.
69
+ */
70
+ declare function mcpToolToTool(serverId: string, def: MCPToolDef, client: any): Tool;
71
+
72
+ export { type MCPConnection, type MCPConnectionConfig, type MCPTransport, connectMCP, mcpToolToTool };
@@ -0,0 +1,72 @@
1
+ import { T as Tool } from '../tool-CSCC87OD.js';
2
+ import '../types-Cn1g9Tg4.js';
3
+
4
+ /**
5
+ * MCP (Model Context Protocol) integration. Connects to MCP servers and exposes
6
+ * their tools through the framework's uniform tool interface.
7
+ *
8
+ * Remote transport (HTTP/SSE) works in all runtimes; stdio (spawning a server
9
+ * process) works only where process spawning is permitted (Node). Requesting
10
+ * stdio elsewhere throws a typed {@link RuntimeUnsupportedError}. (FR-013, FR-013a,
11
+ * FR-013b, FR-030a)
12
+ *
13
+ * The `@modelcontextprotocol/sdk` package is an optional peer dependency and is
14
+ * loaded lazily so browser bundles that do not use MCP pay no cost.
15
+ *
16
+ * @packageDocumentation
17
+ */
18
+
19
+ /** Transport options for an MCP connection. */
20
+ type MCPTransport = {
21
+ kind: "remote";
22
+ url: string;
23
+ } | {
24
+ kind: "stdio";
25
+ command: string;
26
+ args?: string[];
27
+ };
28
+ /** Configuration for connecting to an MCP server. */
29
+ interface MCPConnectionConfig {
30
+ /** Connection id; becomes the namespace prefix for discovered tools. (FR-014a) */
31
+ id: string;
32
+ transport: MCPTransport;
33
+ /** Whether the connection's tools are enabled. Defaults to true. */
34
+ enabled?: boolean;
35
+ }
36
+ /** A live connection to an MCP server. */
37
+ interface MCPConnection {
38
+ readonly id: string;
39
+ connect(): Promise<void>;
40
+ listTools(): Promise<Tool[]>;
41
+ close(): Promise<void>;
42
+ }
43
+ /**
44
+ * Connect to an MCP server.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const mcp = await connectMCP({ id: "docs", transport: { kind: "remote", url: "https://mcp.example.com" } });
49
+ * const tools = await mcp.listTools(); // namespaced as docs.<tool>
50
+ * ```
51
+ */
52
+ declare function connectMCP(config: MCPConnectionConfig): Promise<MCPConnection>;
53
+
54
+ /**
55
+ * Adapts MCP-provided tools onto the framework's uniform {@link Tool} contract,
56
+ * namespaced by the connection id so collisions are impossible. (FR-014, FR-014a)
57
+ *
58
+ * @packageDocumentation
59
+ */
60
+
61
+ interface MCPToolDef {
62
+ name: string;
63
+ description?: string;
64
+ inputSchema: Record<string, unknown>;
65
+ }
66
+ /**
67
+ * Wrap an MCP tool definition as a framework tool. Invocation calls back through
68
+ * the MCP client; failures surface as typed {@link MCPError}/tool errors.
69
+ */
70
+ declare function mcpToolToTool(serverId: string, def: MCPToolDef, client: any): Tool;
71
+
72
+ export { type MCPConnection, type MCPConnectionConfig, type MCPTransport, connectMCP, mcpToolToTool };
@@ -0,0 +1,6 @@
1
+ export { connectMCP, mcpToolToTool } from '../chunk-YH5746OF.js';
2
+ import '../chunk-ACBIHS5H.js';
3
+ import '../chunk-IXV4UIF5.js';
4
+ import '../chunk-DEABART4.js';
5
+ //# sourceMappingURL=index.js.map
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ var chunkKEI3EALJ_cjs = require('../chunk-KEI3EALJ.cjs');
4
+ var chunkFSDMBWQV_cjs = require('../chunk-FSDMBWQV.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "useMiddleware", {
9
+ enumerable: true,
10
+ get: function () { return chunkKEI3EALJ_cjs.useMiddleware; }
11
+ });
12
+ Object.defineProperty(exports, "composeMiddleware", {
13
+ enumerable: true,
14
+ get: function () { return chunkFSDMBWQV_cjs.composeMiddleware; }
15
+ });
16
+ //# sourceMappingURL=index.cjs.map
17
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,29 @@
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';
4
+ import '../errors-CjVz4W_5.cjs';
5
+ import '../provider-CMAymr1b.cjs';
6
+ import '../tool-BZg_znMZ.cjs';
7
+ import '../skill-DfNChtJN.cjs';
8
+ import '../thread-Dfo9LLf7.cjs';
9
+ import '../registry-D4fThGiN.cjs';
10
+
11
+ /**
12
+ * Convenience helper for attaching middleware to an agent configuration.
13
+ * Middleware is applied around provider calls when the agent runs. (FR-023)
14
+ *
15
+ * @packageDocumentation
16
+ */
17
+
18
+ /**
19
+ * Return a copy of `config` with the given middleware appended.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const cfg = useMiddleware(baseConfig, loggingMiddleware, retryMiddleware);
24
+ * const agent = createAgent(cfg);
25
+ * ```
26
+ */
27
+ declare function useMiddleware(config: AgentConfig, ...middleware: Middleware[]): AgentConfig;
28
+
29
+ export { Middleware, useMiddleware };
@@ -0,0 +1,29 @@
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';
4
+ import '../errors-CjVz4W_5.js';
5
+ import '../provider-osAtfZ7x.js';
6
+ import '../tool-CSCC87OD.js';
7
+ import '../skill-DfNChtJN.js';
8
+ import '../thread-CWVzTyti.js';
9
+ import '../registry-CpO0yH5v.js';
10
+
11
+ /**
12
+ * Convenience helper for attaching middleware to an agent configuration.
13
+ * Middleware is applied around provider calls when the agent runs. (FR-023)
14
+ *
15
+ * @packageDocumentation
16
+ */
17
+
18
+ /**
19
+ * Return a copy of `config` with the given middleware appended.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const cfg = useMiddleware(baseConfig, loggingMiddleware, retryMiddleware);
24
+ * const agent = createAgent(cfg);
25
+ * ```
26
+ */
27
+ declare function useMiddleware(config: AgentConfig, ...middleware: Middleware[]): AgentConfig;
28
+
29
+ export { Middleware, useMiddleware };
@@ -0,0 +1,4 @@
1
+ export { useMiddleware } from '../chunk-IUKD54F7.js';
2
+ export { composeMiddleware } from '../chunk-7ZXUIHLH.js';
3
+ //# sourceMappingURL=index.js.map
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var chunkV6O6SYAN_cjs = require('../chunk-V6O6SYAN.cjs');
4
+ var chunkIJASUMIQ_cjs = require('../chunk-IJASUMIQ.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "configureObservability", {
9
+ enumerable: true,
10
+ get: function () { return chunkV6O6SYAN_cjs.configureObservability; }
11
+ });
12
+ Object.defineProperty(exports, "isObservabilityEnabled", {
13
+ enumerable: true,
14
+ get: function () { return chunkV6O6SYAN_cjs.isObservabilityEnabled; }
15
+ });
16
+ Object.defineProperty(exports, "resetObservability", {
17
+ enumerable: true,
18
+ get: function () { return chunkV6O6SYAN_cjs.resetObservability; }
19
+ });
20
+ Object.defineProperty(exports, "withSpan", {
21
+ enumerable: true,
22
+ get: function () { return chunkV6O6SYAN_cjs.withSpan; }
23
+ });
24
+ Object.defineProperty(exports, "redact", {
25
+ enumerable: true,
26
+ get: function () { return chunkIJASUMIQ_cjs.redact; }
27
+ });
28
+ //# sourceMappingURL=index.cjs.map
29
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1 @@
1
+ export { O as ObservabilityConfig, c as configureObservability, i as isObservabilityEnabled, r as redact, a as resetObservability, w as withSpan } from '../index-C2vzfbBz.cjs';
@@ -0,0 +1 @@
1
+ export { O as ObservabilityConfig, c as configureObservability, i as isObservabilityEnabled, r as redact, a as resetObservability, w as withSpan } from '../index-C2vzfbBz.js';
@@ -0,0 +1,4 @@
1
+ export { configureObservability, isObservabilityEnabled, resetObservability, withSpan } from '../chunk-5PDJOBTD.js';
2
+ export { redact } from '../chunk-DEABART4.js';
3
+ //# sourceMappingURL=index.js.map
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ var chunkQJ5XHA6S_cjs = require('../chunk-QJ5XHA6S.cjs');
4
+ require('../chunk-LMN75W3W.cjs');
5
+ require('../chunk-FOTCUNP5.cjs');
6
+ require('../chunk-MQ2XTH3S.cjs');
7
+ require('../chunk-IJASUMIQ.cjs');
8
+
9
+
10
+
11
+ Object.defineProperty(exports, "ThreadPersistence", {
12
+ enumerable: true,
13
+ get: function () { return chunkQJ5XHA6S_cjs.ThreadPersistence; }
14
+ });
15
+ Object.defineProperty(exports, "createBrowserStore", {
16
+ enumerable: true,
17
+ get: function () { return chunkQJ5XHA6S_cjs.createBrowserStore; }
18
+ });
19
+ Object.defineProperty(exports, "createMemoryStore", {
20
+ enumerable: true,
21
+ get: function () { return chunkQJ5XHA6S_cjs.createMemoryStore; }
22
+ });
23
+ //# sourceMappingURL=index.cjs.map
24
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,51 @@
1
+ import { T as Thread } from '../thread-Dfo9LLf7.cjs';
2
+ import '../types-Cn1g9Tg4.cjs';
3
+ import '../provider-CMAymr1b.cjs';
4
+
5
+ /**
6
+ * Pluggable storage abstraction for persisting conversation/thread state in a
7
+ * no-backend environment. No database server is assumed. (FR-024)
8
+ *
9
+ * @packageDocumentation
10
+ */
11
+
12
+ /** A minimal key/value store. */
13
+ interface Store {
14
+ get(key: string): Promise<unknown | undefined>;
15
+ set(key: string, value: unknown): Promise<void>;
16
+ delete(key: string): Promise<void>;
17
+ }
18
+ /** Save and load threads via a {@link Store}. */
19
+ declare const ThreadPersistence: {
20
+ /** Persist a thread under the key `thread:<id>`. */
21
+ save(store: Store, thread: Thread): Promise<void>;
22
+ /** Load and rehydrate a thread, or undefined if absent. */
23
+ load(store: Store, id: string): Promise<Thread | undefined>;
24
+ };
25
+
26
+ /**
27
+ * In-memory store adapter. Works in every runtime; ideal as a default and for tests.
28
+ * @packageDocumentation
29
+ */
30
+
31
+ /** Create an in-memory {@link Store}. */
32
+ declare function createMemoryStore(): Store;
33
+
34
+ /**
35
+ * Browser store adapters backed by `localStorage` or `IndexedDB`. Capability-gated
36
+ * so a clear typed error is thrown if used where unavailable. (FR-024, FR-030a)
37
+ *
38
+ * @packageDocumentation
39
+ */
40
+
41
+ /** Options for {@link createBrowserStore}. */
42
+ interface BrowserStoreOptions {
43
+ /** Storage backend. Default "local". */
44
+ backend?: "local" | "indexeddb";
45
+ /** Key namespace/prefix. Default "afjs". */
46
+ namespace?: string;
47
+ }
48
+ /** Create a browser-backed {@link Store}. */
49
+ declare function createBrowserStore(options?: BrowserStoreOptions): Store;
50
+
51
+ export { type BrowserStoreOptions, type Store, ThreadPersistence, createBrowserStore, createMemoryStore };
@@ -0,0 +1,51 @@
1
+ import { T as Thread } from '../thread-CWVzTyti.js';
2
+ import '../types-Cn1g9Tg4.js';
3
+ import '../provider-osAtfZ7x.js';
4
+
5
+ /**
6
+ * Pluggable storage abstraction for persisting conversation/thread state in a
7
+ * no-backend environment. No database server is assumed. (FR-024)
8
+ *
9
+ * @packageDocumentation
10
+ */
11
+
12
+ /** A minimal key/value store. */
13
+ interface Store {
14
+ get(key: string): Promise<unknown | undefined>;
15
+ set(key: string, value: unknown): Promise<void>;
16
+ delete(key: string): Promise<void>;
17
+ }
18
+ /** Save and load threads via a {@link Store}. */
19
+ declare const ThreadPersistence: {
20
+ /** Persist a thread under the key `thread:<id>`. */
21
+ save(store: Store, thread: Thread): Promise<void>;
22
+ /** Load and rehydrate a thread, or undefined if absent. */
23
+ load(store: Store, id: string): Promise<Thread | undefined>;
24
+ };
25
+
26
+ /**
27
+ * In-memory store adapter. Works in every runtime; ideal as a default and for tests.
28
+ * @packageDocumentation
29
+ */
30
+
31
+ /** Create an in-memory {@link Store}. */
32
+ declare function createMemoryStore(): Store;
33
+
34
+ /**
35
+ * Browser store adapters backed by `localStorage` or `IndexedDB`. Capability-gated
36
+ * so a clear typed error is thrown if used where unavailable. (FR-024, FR-030a)
37
+ *
38
+ * @packageDocumentation
39
+ */
40
+
41
+ /** Options for {@link createBrowserStore}. */
42
+ interface BrowserStoreOptions {
43
+ /** Storage backend. Default "local". */
44
+ backend?: "local" | "indexeddb";
45
+ /** Key namespace/prefix. Default "afjs". */
46
+ namespace?: string;
47
+ }
48
+ /** Create a browser-backed {@link Store}. */
49
+ declare function createBrowserStore(options?: BrowserStoreOptions): Store;
50
+
51
+ export { type BrowserStoreOptions, type Store, ThreadPersistence, createBrowserStore, createMemoryStore };
@@ -0,0 +1,7 @@
1
+ export { ThreadPersistence, createBrowserStore, createMemoryStore } from '../chunk-V472N2PK.js';
2
+ import '../chunk-XPXTXOYQ.js';
3
+ import '../chunk-ACBIHS5H.js';
4
+ import '../chunk-IXV4UIF5.js';
5
+ import '../chunk-DEABART4.js';
6
+ //# sourceMappingURL=index.js.map
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}