groundswell 0.0.3 → 1.0.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 (292) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +26 -9
  3. package/dist/cache/cache-key.d.ts +20 -0
  4. package/dist/cache/cache-key.d.ts.map +1 -1
  5. package/dist/cache/cache-key.js +9 -0
  6. package/dist/cache/cache-key.js.map +1 -1
  7. package/dist/core/agent.d.ts +120 -29
  8. package/dist/core/agent.d.ts.map +1 -1
  9. package/dist/core/agent.js +584 -177
  10. package/dist/core/agent.js.map +1 -1
  11. package/dist/core/mcp-handler.d.ts +63 -5
  12. package/dist/core/mcp-handler.d.ts.map +1 -1
  13. package/dist/core/mcp-handler.js +184 -4
  14. package/dist/core/mcp-handler.js.map +1 -1
  15. package/dist/core/workflow-context.d.ts +6 -2
  16. package/dist/core/workflow-context.d.ts.map +1 -1
  17. package/dist/core/workflow-context.js +99 -4
  18. package/dist/core/workflow-context.js.map +1 -1
  19. package/dist/core/workflow.d.ts +315 -13
  20. package/dist/core/workflow.d.ts.map +1 -1
  21. package/dist/core/workflow.js +552 -30
  22. package/dist/core/workflow.js.map +1 -1
  23. package/dist/debugger/event-replayer.d.ts +422 -0
  24. package/dist/debugger/event-replayer.d.ts.map +1 -0
  25. package/dist/debugger/event-replayer.js +639 -0
  26. package/dist/debugger/event-replayer.js.map +1 -0
  27. package/dist/debugger/tree-debugger.d.ts +170 -1
  28. package/dist/debugger/tree-debugger.d.ts.map +1 -1
  29. package/dist/debugger/tree-debugger.js +423 -1
  30. package/dist/debugger/tree-debugger.js.map +1 -1
  31. package/dist/decorators/step.d.ts.map +1 -1
  32. package/dist/decorators/step.js +129 -47
  33. package/dist/decorators/step.js.map +1 -1
  34. package/dist/harnesses/claude-code-harness.d.ts +391 -0
  35. package/dist/harnesses/claude-code-harness.d.ts.map +1 -0
  36. package/dist/harnesses/claude-code-harness.js +1076 -0
  37. package/dist/harnesses/claude-code-harness.js.map +1 -0
  38. package/dist/harnesses/harness-registry.d.ts +440 -0
  39. package/dist/harnesses/harness-registry.d.ts.map +1 -0
  40. package/dist/harnesses/harness-registry.js +543 -0
  41. package/dist/harnesses/harness-registry.js.map +1 -0
  42. package/dist/harnesses/index.d.ts +12 -0
  43. package/dist/harnesses/index.d.ts.map +1 -0
  44. package/dist/harnesses/index.js +11 -0
  45. package/dist/harnesses/index.js.map +1 -0
  46. package/dist/harnesses/pi-harness.d.ts +219 -0
  47. package/dist/harnesses/pi-harness.d.ts.map +1 -0
  48. package/dist/harnesses/pi-harness.js +676 -0
  49. package/dist/harnesses/pi-harness.js.map +1 -0
  50. package/dist/harnesses/pi-schema-converter.d.ts +24 -0
  51. package/dist/harnesses/pi-schema-converter.d.ts.map +1 -0
  52. package/dist/harnesses/pi-schema-converter.js +81 -0
  53. package/dist/harnesses/pi-schema-converter.js.map +1 -0
  54. package/dist/harnesses/register-defaults.d.ts +24 -0
  55. package/dist/harnesses/register-defaults.d.ts.map +1 -0
  56. package/dist/harnesses/register-defaults.js +40 -0
  57. package/dist/harnesses/register-defaults.js.map +1 -0
  58. package/dist/harnesses/session-store.d.ts +201 -0
  59. package/dist/harnesses/session-store.d.ts.map +1 -0
  60. package/dist/harnesses/session-store.js +254 -0
  61. package/dist/harnesses/session-store.js.map +1 -0
  62. package/dist/index.d.ts +12 -2
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +17 -0
  65. package/dist/index.js.map +1 -1
  66. package/dist/reflection/reflection.d.ts.map +1 -1
  67. package/dist/reflection/reflection.js +19 -4
  68. package/dist/reflection/reflection.js.map +1 -1
  69. package/dist/types/agent.d.ts +1253 -2
  70. package/dist/types/agent.d.ts.map +1 -1
  71. package/dist/types/agent.js +418 -1
  72. package/dist/types/agent.js.map +1 -1
  73. package/dist/types/decorators.d.ts +10 -1
  74. package/dist/types/decorators.d.ts.map +1 -1
  75. package/dist/types/events.d.ts +26 -0
  76. package/dist/types/events.d.ts.map +1 -1
  77. package/dist/types/harnesses.d.ts +474 -0
  78. package/dist/types/harnesses.d.ts.map +1 -0
  79. package/dist/types/harnesses.js +2 -0
  80. package/dist/types/harnesses.js.map +1 -0
  81. package/dist/types/index.d.ts +9 -1
  82. package/dist/types/index.d.ts.map +1 -1
  83. package/dist/types/index.js +6 -0
  84. package/dist/types/index.js.map +1 -1
  85. package/dist/types/providers.d.ts +691 -0
  86. package/dist/types/providers.d.ts.map +1 -0
  87. package/dist/types/providers.js +14 -0
  88. package/dist/types/providers.js.map +1 -0
  89. package/dist/types/restart.d.ts +132 -0
  90. package/dist/types/restart.d.ts.map +1 -0
  91. package/dist/types/restart.js +2 -0
  92. package/dist/types/restart.js.map +1 -0
  93. package/dist/types/streaming.d.ts +194 -0
  94. package/dist/types/streaming.d.ts.map +1 -0
  95. package/dist/types/streaming.js +67 -0
  96. package/dist/types/streaming.js.map +1 -0
  97. package/dist/types/workflow-context.d.ts +137 -1
  98. package/dist/types/workflow-context.d.ts.map +1 -1
  99. package/dist/utils/agent-validation.d.ts +88 -0
  100. package/dist/utils/agent-validation.d.ts.map +1 -0
  101. package/dist/utils/agent-validation.js +87 -0
  102. package/dist/utils/agent-validation.js.map +1 -0
  103. package/dist/utils/delay.d.ts +7 -0
  104. package/dist/utils/delay.d.ts.map +1 -0
  105. package/dist/utils/delay.js +9 -0
  106. package/dist/utils/delay.js.map +1 -0
  107. package/dist/utils/harness-config.d.ts +180 -0
  108. package/dist/utils/harness-config.d.ts.map +1 -0
  109. package/dist/utils/harness-config.js +311 -0
  110. package/dist/utils/harness-config.js.map +1 -0
  111. package/dist/utils/index.d.ts +9 -1
  112. package/dist/utils/index.d.ts.map +1 -1
  113. package/dist/utils/index.js +8 -1
  114. package/dist/utils/index.js.map +1 -1
  115. package/dist/utils/model-spec.d.ts +110 -0
  116. package/dist/utils/model-spec.d.ts.map +1 -0
  117. package/dist/utils/model-spec.js +149 -0
  118. package/dist/utils/model-spec.js.map +1 -0
  119. package/dist/utils/provider-config.d.ts +10 -0
  120. package/dist/utils/provider-config.d.ts.map +1 -0
  121. package/dist/utils/provider-config.js +10 -0
  122. package/dist/utils/provider-config.js.map +1 -0
  123. package/dist/utils/restart-analysis.d.ts +202 -0
  124. package/dist/utils/restart-analysis.d.ts.map +1 -0
  125. package/dist/utils/restart-analysis.js +426 -0
  126. package/dist/utils/restart-analysis.js.map +1 -0
  127. package/dist/utils/session-serialization.d.ts +118 -0
  128. package/dist/utils/session-serialization.d.ts.map +1 -0
  129. package/dist/utils/session-serialization.js +217 -0
  130. package/dist/utils/session-serialization.js.map +1 -0
  131. package/package.json +31 -5
  132. package/CHANGELOG.md +0 -188
  133. package/dist/__tests__/adversarial/attachChild-performance.test.d.ts +0 -16
  134. package/dist/__tests__/adversarial/attachChild-performance.test.d.ts.map +0 -1
  135. package/dist/__tests__/adversarial/attachChild-performance.test.js +0 -187
  136. package/dist/__tests__/adversarial/attachChild-performance.test.js.map +0 -1
  137. package/dist/__tests__/adversarial/circular-reference.test.d.ts +0 -13
  138. package/dist/__tests__/adversarial/circular-reference.test.d.ts.map +0 -1
  139. package/dist/__tests__/adversarial/circular-reference.test.js +0 -92
  140. package/dist/__tests__/adversarial/circular-reference.test.js.map +0 -1
  141. package/dist/__tests__/adversarial/complex-circular-reference.test.d.ts +0 -16
  142. package/dist/__tests__/adversarial/complex-circular-reference.test.d.ts.map +0 -1
  143. package/dist/__tests__/adversarial/complex-circular-reference.test.js +0 -127
  144. package/dist/__tests__/adversarial/complex-circular-reference.test.js.map +0 -1
  145. package/dist/__tests__/adversarial/concurrent-task-failures.test.d.ts +0 -21
  146. package/dist/__tests__/adversarial/concurrent-task-failures.test.d.ts.map +0 -1
  147. package/dist/__tests__/adversarial/concurrent-task-failures.test.js +0 -667
  148. package/dist/__tests__/adversarial/concurrent-task-failures.test.js.map +0 -1
  149. package/dist/__tests__/adversarial/deep-analysis.test.d.ts +0 -6
  150. package/dist/__tests__/adversarial/deep-analysis.test.d.ts.map +0 -1
  151. package/dist/__tests__/adversarial/deep-analysis.test.js +0 -877
  152. package/dist/__tests__/adversarial/deep-analysis.test.js.map +0 -1
  153. package/dist/__tests__/adversarial/deep-hierarchy-stress.test.d.ts +0 -13
  154. package/dist/__tests__/adversarial/deep-hierarchy-stress.test.d.ts.map +0 -1
  155. package/dist/__tests__/adversarial/deep-hierarchy-stress.test.js +0 -186
  156. package/dist/__tests__/adversarial/deep-hierarchy-stress.test.js.map +0 -1
  157. package/dist/__tests__/adversarial/e2e-prd-validation.test.d.ts +0 -6
  158. package/dist/__tests__/adversarial/e2e-prd-validation.test.d.ts.map +0 -1
  159. package/dist/__tests__/adversarial/e2e-prd-validation.test.js +0 -626
  160. package/dist/__tests__/adversarial/e2e-prd-validation.test.js.map +0 -1
  161. package/dist/__tests__/adversarial/edge-case.test.d.ts +0 -6
  162. package/dist/__tests__/adversarial/edge-case.test.d.ts.map +0 -1
  163. package/dist/__tests__/adversarial/edge-case.test.js +0 -857
  164. package/dist/__tests__/adversarial/edge-case.test.js.map +0 -1
  165. package/dist/__tests__/adversarial/error-merge-strategy.test.d.ts +0 -20
  166. package/dist/__tests__/adversarial/error-merge-strategy.test.d.ts.map +0 -1
  167. package/dist/__tests__/adversarial/error-merge-strategy.test.js +0 -907
  168. package/dist/__tests__/adversarial/error-merge-strategy.test.js.map +0 -1
  169. package/dist/__tests__/adversarial/incremental-performance.test.d.ts +0 -2
  170. package/dist/__tests__/adversarial/incremental-performance.test.d.ts.map +0 -1
  171. package/dist/__tests__/adversarial/incremental-performance.test.js +0 -113
  172. package/dist/__tests__/adversarial/incremental-performance.test.js.map +0 -1
  173. package/dist/__tests__/adversarial/node-map-update-benchmarks.test.d.ts +0 -22
  174. package/dist/__tests__/adversarial/node-map-update-benchmarks.test.d.ts.map +0 -1
  175. package/dist/__tests__/adversarial/node-map-update-benchmarks.test.js +0 -383
  176. package/dist/__tests__/adversarial/node-map-update-benchmarks.test.js.map +0 -1
  177. package/dist/__tests__/adversarial/observer-propagation.test.d.ts +0 -21
  178. package/dist/__tests__/adversarial/observer-propagation.test.d.ts.map +0 -1
  179. package/dist/__tests__/adversarial/observer-propagation.test.js +0 -404
  180. package/dist/__tests__/adversarial/observer-propagation.test.js.map +0 -1
  181. package/dist/__tests__/adversarial/parent-validation.test.d.ts +0 -13
  182. package/dist/__tests__/adversarial/parent-validation.test.d.ts.map +0 -1
  183. package/dist/__tests__/adversarial/parent-validation.test.js +0 -128
  184. package/dist/__tests__/adversarial/parent-validation.test.js.map +0 -1
  185. package/dist/__tests__/adversarial/prd-12-2-compliance.test.d.ts +0 -20
  186. package/dist/__tests__/adversarial/prd-12-2-compliance.test.d.ts.map +0 -1
  187. package/dist/__tests__/adversarial/prd-12-2-compliance.test.js +0 -482
  188. package/dist/__tests__/adversarial/prd-12-2-compliance.test.js.map +0 -1
  189. package/dist/__tests__/adversarial/prd-compliance.test.d.ts +0 -6
  190. package/dist/__tests__/adversarial/prd-compliance.test.d.ts.map +0 -1
  191. package/dist/__tests__/adversarial/prd-compliance.test.js +0 -886
  192. package/dist/__tests__/adversarial/prd-compliance.test.js.map +0 -1
  193. package/dist/__tests__/compatibility/backward-compatibility.test.d.ts +0 -22
  194. package/dist/__tests__/compatibility/backward-compatibility.test.d.ts.map +0 -1
  195. package/dist/__tests__/compatibility/backward-compatibility.test.js +0 -1843
  196. package/dist/__tests__/compatibility/backward-compatibility.test.js.map +0 -1
  197. package/dist/__tests__/helpers/index.d.ts +0 -10
  198. package/dist/__tests__/helpers/index.d.ts.map +0 -1
  199. package/dist/__tests__/helpers/index.js +0 -10
  200. package/dist/__tests__/helpers/index.js.map +0 -1
  201. package/dist/__tests__/helpers/tree-verification.d.ts +0 -90
  202. package/dist/__tests__/helpers/tree-verification.d.ts.map +0 -1
  203. package/dist/__tests__/helpers/tree-verification.js +0 -202
  204. package/dist/__tests__/helpers/tree-verification.js.map +0 -1
  205. package/dist/__tests__/integration/agent-workflow.test.d.ts +0 -2
  206. package/dist/__tests__/integration/agent-workflow.test.d.ts.map +0 -1
  207. package/dist/__tests__/integration/agent-workflow.test.js +0 -256
  208. package/dist/__tests__/integration/agent-workflow.test.js.map +0 -1
  209. package/dist/__tests__/integration/bidirectional-consistency.test.d.ts +0 -14
  210. package/dist/__tests__/integration/bidirectional-consistency.test.d.ts.map +0 -1
  211. package/dist/__tests__/integration/bidirectional-consistency.test.js +0 -668
  212. package/dist/__tests__/integration/bidirectional-consistency.test.js.map +0 -1
  213. package/dist/__tests__/integration/observer-logging.test.d.ts +0 -2
  214. package/dist/__tests__/integration/observer-logging.test.d.ts.map +0 -1
  215. package/dist/__tests__/integration/observer-logging.test.js +0 -517
  216. package/dist/__tests__/integration/observer-logging.test.js.map +0 -1
  217. package/dist/__tests__/integration/tree-mirroring.test.d.ts +0 -2
  218. package/dist/__tests__/integration/tree-mirroring.test.d.ts.map +0 -1
  219. package/dist/__tests__/integration/tree-mirroring.test.js +0 -117
  220. package/dist/__tests__/integration/tree-mirroring.test.js.map +0 -1
  221. package/dist/__tests__/integration/workflow-reparenting.test.d.ts +0 -12
  222. package/dist/__tests__/integration/workflow-reparenting.test.d.ts.map +0 -1
  223. package/dist/__tests__/integration/workflow-reparenting.test.js +0 -239
  224. package/dist/__tests__/integration/workflow-reparenting.test.js.map +0 -1
  225. package/dist/__tests__/unit/agent.test.d.ts +0 -2
  226. package/dist/__tests__/unit/agent.test.d.ts.map +0 -1
  227. package/dist/__tests__/unit/agent.test.js +0 -143
  228. package/dist/__tests__/unit/agent.test.js.map +0 -1
  229. package/dist/__tests__/unit/cache-key.test.d.ts +0 -5
  230. package/dist/__tests__/unit/cache-key.test.d.ts.map +0 -1
  231. package/dist/__tests__/unit/cache-key.test.js +0 -145
  232. package/dist/__tests__/unit/cache-key.test.js.map +0 -1
  233. package/dist/__tests__/unit/cache.test.d.ts +0 -5
  234. package/dist/__tests__/unit/cache.test.d.ts.map +0 -1
  235. package/dist/__tests__/unit/cache.test.js +0 -132
  236. package/dist/__tests__/unit/cache.test.js.map +0 -1
  237. package/dist/__tests__/unit/context.test.d.ts +0 -2
  238. package/dist/__tests__/unit/context.test.d.ts.map +0 -1
  239. package/dist/__tests__/unit/context.test.js +0 -220
  240. package/dist/__tests__/unit/context.test.js.map +0 -1
  241. package/dist/__tests__/unit/decorators.test.d.ts +0 -2
  242. package/dist/__tests__/unit/decorators.test.d.ts.map +0 -1
  243. package/dist/__tests__/unit/decorators.test.js +0 -162
  244. package/dist/__tests__/unit/decorators.test.js.map +0 -1
  245. package/dist/__tests__/unit/introspection-tools.test.d.ts +0 -5
  246. package/dist/__tests__/unit/introspection-tools.test.d.ts.map +0 -1
  247. package/dist/__tests__/unit/introspection-tools.test.js +0 -191
  248. package/dist/__tests__/unit/introspection-tools.test.js.map +0 -1
  249. package/dist/__tests__/unit/logger.test.d.ts +0 -2
  250. package/dist/__tests__/unit/logger.test.d.ts.map +0 -1
  251. package/dist/__tests__/unit/logger.test.js +0 -241
  252. package/dist/__tests__/unit/logger.test.js.map +0 -1
  253. package/dist/__tests__/unit/observable.test.d.ts +0 -2
  254. package/dist/__tests__/unit/observable.test.d.ts.map +0 -1
  255. package/dist/__tests__/unit/observable.test.js +0 -251
  256. package/dist/__tests__/unit/observable.test.js.map +0 -1
  257. package/dist/__tests__/unit/prompt.test.d.ts +0 -2
  258. package/dist/__tests__/unit/prompt.test.d.ts.map +0 -1
  259. package/dist/__tests__/unit/prompt.test.js +0 -113
  260. package/dist/__tests__/unit/prompt.test.js.map +0 -1
  261. package/dist/__tests__/unit/reflection.test.d.ts +0 -5
  262. package/dist/__tests__/unit/reflection.test.d.ts.map +0 -1
  263. package/dist/__tests__/unit/reflection.test.js +0 -160
  264. package/dist/__tests__/unit/reflection.test.js.map +0 -1
  265. package/dist/__tests__/unit/tree-debugger-incremental.test.d.ts +0 -2
  266. package/dist/__tests__/unit/tree-debugger-incremental.test.d.ts.map +0 -1
  267. package/dist/__tests__/unit/tree-debugger-incremental.test.js +0 -136
  268. package/dist/__tests__/unit/tree-debugger-incremental.test.js.map +0 -1
  269. package/dist/__tests__/unit/tree-debugger.test.d.ts +0 -2
  270. package/dist/__tests__/unit/tree-debugger.test.d.ts.map +0 -1
  271. package/dist/__tests__/unit/tree-debugger.test.js +0 -69
  272. package/dist/__tests__/unit/tree-debugger.test.js.map +0 -1
  273. package/dist/__tests__/unit/utils/workflow-error-utils.test.d.ts +0 -2
  274. package/dist/__tests__/unit/utils/workflow-error-utils.test.d.ts.map +0 -1
  275. package/dist/__tests__/unit/utils/workflow-error-utils.test.js +0 -154
  276. package/dist/__tests__/unit/utils/workflow-error-utils.test.js.map +0 -1
  277. package/dist/__tests__/unit/workflow-detachChild.test.d.ts +0 -2
  278. package/dist/__tests__/unit/workflow-detachChild.test.d.ts.map +0 -1
  279. package/dist/__tests__/unit/workflow-detachChild.test.js +0 -76
  280. package/dist/__tests__/unit/workflow-detachChild.test.js.map +0 -1
  281. package/dist/__tests__/unit/workflow-emitEvent-childDetached.test.d.ts +0 -2
  282. package/dist/__tests__/unit/workflow-emitEvent-childDetached.test.d.ts.map +0 -1
  283. package/dist/__tests__/unit/workflow-emitEvent-childDetached.test.js +0 -122
  284. package/dist/__tests__/unit/workflow-emitEvent-childDetached.test.js.map +0 -1
  285. package/dist/__tests__/unit/workflow-isDescendantOf.test.d.ts +0 -2
  286. package/dist/__tests__/unit/workflow-isDescendantOf.test.d.ts.map +0 -1
  287. package/dist/__tests__/unit/workflow-isDescendantOf.test.js +0 -140
  288. package/dist/__tests__/unit/workflow-isDescendantOf.test.js.map +0 -1
  289. package/dist/__tests__/unit/workflow.test.d.ts +0 -2
  290. package/dist/__tests__/unit/workflow.test.d.ts.map +0 -1
  291. package/dist/__tests__/unit/workflow.test.js +0 -330
  292. package/dist/__tests__/unit/workflow.test.js.map +0 -1
@@ -0,0 +1,691 @@
1
+ import type { Tool, MCPServer, Skill, TokenUsage } from "./sdk-primitives.js";
2
+ import type { AgentResponse } from "./agent.js";
3
+ import type { StreamEvent } from "./streaming.js";
4
+ import type { HarnessId, HarnessCapabilities, HarnessHookEvents, HarnessExecutionOptions, HarnessRequest, ToolExecutionRequest, ToolExecutionResult, ModelSpec } from "./harnesses.js";
5
+ /**
6
+ * @deprecated Since v1.2. The single `ProviderId` axis is SPLIT:
7
+ * - runtime axis → {@link HarnessId} ('pi' | 'claude-code') — types/harnesses.ts
8
+ * - LLM-host axis → {@link ModelProviderId} (open set) — types/harnesses.ts
9
+ *
10
+ * This union is a SUPERSET kept only so pre-migration consumers (AnthropicProvider
11
+ * id:'anthropic', ProviderRegistry) keep compiling.
12
+ * `'anthropic'` remains for AnthropicProvider (ClaudeCodeHarness alias). The legacy
13
+ * non-harness provider was deleted in v2.0.0 (P4.M1).
14
+ */
15
+ export type ProviderId = HarnessId | 'anthropic';
16
+ /**
17
+ * @deprecated Since v1.2. Use {@link HarnessCapabilities} from types/harnesses.ts.
18
+ *
19
+ * ```typescript
20
+ * // BEFORE (v1.x)
21
+ * import type { ProviderCapabilities } from 'groundswell';
22
+ * // AFTER (v1.2)
23
+ * import type { HarnessCapabilities } from 'groundswell';
24
+ * ```
25
+ */
26
+ export type ProviderCapabilities = HarnessCapabilities;
27
+ /**
28
+ * @deprecated Since v1.2. Use {@link HarnessHookEvents} from types/harnesses.ts.
29
+ *
30
+ * ```typescript
31
+ * // BEFORE (v1.x)
32
+ * import type { ProviderHookEvents } from 'groundswell';
33
+ * // AFTER (v1.2)
34
+ * import type { HarnessHookEvents } from 'groundswell';
35
+ * ```
36
+ */
37
+ export type ProviderHookEvents = HarnessHookEvents;
38
+ /**
39
+ * @deprecated Since v1.2. Use {@link HarnessExecutionOptions} from types/harnesses.ts.
40
+ *
41
+ * ```typescript
42
+ * // BEFORE (v1.x)
43
+ * import type { ProviderExecutionOptions } from 'groundswell';
44
+ * // AFTER (v1.2)
45
+ * import type { HarnessExecutionOptions } from 'groundswell';
46
+ * ```
47
+ */
48
+ export type ProviderExecutionOptions = HarnessExecutionOptions;
49
+ /**
50
+ * @deprecated Since v1.2. Use {@link HarnessRequest} from types/harnesses.ts.
51
+ *
52
+ * ```typescript
53
+ * // BEFORE (v1.x)
54
+ * import type { ProviderRequest } from 'groundswell';
55
+ * // AFTER (v1.2)
56
+ * import type { HarnessRequest } from 'groundswell';
57
+ * ```
58
+ */
59
+ export type ProviderRequest = HarnessRequest;
60
+ /**
61
+ * @deprecated Since v1.2. Use {@link ModelSpec} from types/harnesses.ts directly.
62
+ * `provider` is now the open `ModelProviderId` set (anthropic/openai/google/zai/…).
63
+ *
64
+ * ```typescript
65
+ * // BEFORE (v1.x)
66
+ * import type { ModelSpec } from 'groundswell';
67
+ * // AFTER (v1.2)
68
+ * import type { ModelSpec } from 'groundswell';
69
+ * ```
70
+ */
71
+ export type { ModelSpec };
72
+ export type { ToolExecutionRequest, ToolExecutionResult };
73
+ /**
74
+ * @deprecated Since v1.2. Use {@link HarnessOptions} from types/harnesses.ts.
75
+ *
76
+ * Note: HarnessOptions is SLIMMED — it omits `sessionStore`, `sessionPersistence`,
77
+ * `sessionTtl`, and `sessionPath` (those move to the concrete harness adapter).
78
+ *
79
+ * ```typescript
80
+ * // BEFORE (v1.x)
81
+ * import type { ProviderOptions } from 'groundswell';
82
+ * const opts: ProviderOptions = { sessionPersistence: 'file', sessionPath: '/tmp' };
83
+ * // AFTER (v1.2)
84
+ * import type { HarnessOptions } from 'groundswell';
85
+ * const opts: HarnessOptions = { apiKey: 'sk-...' };
86
+ * ```
87
+ */
88
+ export interface ProviderOptions {
89
+ /** API endpoint override */
90
+ endpoint?: string;
91
+ /** API key (if not from environment) */
92
+ apiKey?: string;
93
+ /** Session ID for session-based providers */
94
+ sessionId?: string;
95
+ /** Timeout in milliseconds */
96
+ timeout?: number;
97
+ /** Custom headers */
98
+ headers?: Record<string, string>;
99
+ /**
100
+ * Session store for persistent session storage
101
+ *
102
+ * @remarks
103
+ * Using type import to avoid circular dependency. The actual SessionStore
104
+ * type is imported from '../harnesses/session-store.js'.
105
+ */
106
+ sessionStore?: import("../harnesses/session-store.js").SessionStore<SessionState>;
107
+ /**
108
+ * Session persistence type
109
+ *
110
+ * @remarks
111
+ * Use 'file' for persistent storage across restarts. Mutually exclusive with
112
+ * sessionStore property.
113
+ *
114
+ * When specified, a SessionStore instance will be created automatically.
115
+ * Provide sessionStore directly for custom store implementations.
116
+ *
117
+ * @example
118
+ * ```ts
119
+ * // Easy configuration - file persistence
120
+ * { sessionPersistence: 'file' }
121
+ *
122
+ * // Full configuration - custom path and TTL
123
+ * {
124
+ * sessionPersistence: 'file',
125
+ * sessionPath: '/tmp/sessions',
126
+ * sessionTtl: 3600000
127
+ * }
128
+ *
129
+ * // Direct injection - custom store
130
+ * { sessionStore: new CustomStore() }
131
+ * ```
132
+ */
133
+ sessionPersistence?: 'memory' | 'file' | 'redis';
134
+ /**
135
+ * Session time-to-live in milliseconds
136
+ *
137
+ * @remarks
138
+ * Sessions expire after this duration. Default: 86400000 (24 hours).
139
+ *
140
+ * Note: TTL enforcement is planned for a future PRP (P2.M2.T2.S2).
141
+ * This option is accepted now for forward compatibility.
142
+ */
143
+ sessionTtl?: number;
144
+ /**
145
+ * Directory path for file-based session storage
146
+ *
147
+ * @remarks
148
+ * Only used when sessionPersistence is 'file'. Default: './sessions'.
149
+ */
150
+ sessionPath?: string;
151
+ }
152
+ /**
153
+ * @deprecated Since v1.2. Session state is harness-adapter-internal; do not depend on
154
+ * this Anthropic-SDK-specific shape from public code.
155
+ *
156
+ * ```typescript
157
+ * // BEFORE (v1.x)
158
+ * import type { SessionState } from 'groundswell';
159
+ * // AFTER (v1.2)
160
+ * // Access session state through the harness adapter internals; do not import.
161
+ * ```
162
+ */
163
+ export interface SessionState {
164
+ /** Conversation history - all user messages in this session */
165
+ history: import("@anthropic-ai/claude-agent-sdk").SDKUserMessage[];
166
+ /** Last result message from the most recent execution */
167
+ lastResult: import("@anthropic-ai/claude-agent-sdk").SDKResultMessage | null;
168
+ /**
169
+ * Unix timestamp in milliseconds when session was created
170
+ *
171
+ * @remarks
172
+ * Set automatically on session creation. Used for TTL expiration
173
+ * calculations alongside lastAccessedAt.
174
+ *
175
+ * Optional for backward compatibility with legacy sessions.
176
+ */
177
+ createdAt?: number;
178
+ /**
179
+ * Unix timestamp in milliseconds when session was last accessed
180
+ *
181
+ * @remarks
182
+ * Updated automatically on session load/save operations. Used for
183
+ * sliding TTL expiration - sessions expire after lastAccessedAt + TTL.
184
+ *
185
+ * Optional for backward compatibility with legacy sessions.
186
+ */
187
+ lastAccessedAt?: number;
188
+ }
189
+ /**
190
+ * Tool executor callback function
191
+ * Delegates tool execution to the MCPHandler
192
+ *
193
+ * @remarks
194
+ * Provider implementations receive this callback and use it to execute tools.
195
+ * The provider does not create or manage its own MCPHandler instance.
196
+ */
197
+ export type ToolExecutor = (request: ToolExecutionRequest) => Promise<ToolExecutionResult>;
198
+ /**
199
+ * Provider response status
200
+ *
201
+ * @deprecated Since v1.5.0. Will be removed in v2.0.0.
202
+ * Use {@link AgentResponseStatus} instead.
203
+ *
204
+ * The values are identical: `'success' | 'error' | 'partial'`
205
+ *
206
+ * ## Migration Guide
207
+ *
208
+ * **Quick migration**: Replace `ProviderResponseStatus` with `AgentResponseStatus`
209
+ *
210
+ * ```typescript
211
+ * // BEFORE (v1.x)
212
+ * import { ProviderResponseStatus } from 'groundswell';
213
+ * const status: ProviderResponseStatus = 'success';
214
+ *
215
+ * // AFTER (v1.5+)
216
+ * import { AgentResponseStatus } from 'groundswell';
217
+ * const status: AgentResponseStatus = 'success';
218
+ * ```
219
+ *
220
+ * Three-state status indicating the outcome of a provider operation.
221
+ * - 'success': Operation completed successfully with valid data
222
+ * - 'error': Operation failed with error details
223
+ * - 'partial': Operation partially completed (streaming, incremental)
224
+ *
225
+ * @see {@link AgentResponseStatus | New response status type}
226
+ */
227
+ export type ProviderResponseStatus = "success" | "error" | "partial";
228
+ /**
229
+ * Detailed error information for provider operations
230
+ *
231
+ * @deprecated Since v1.5.0. Will be removed in v2.0.0.
232
+ * Use {@link AgentErrorDetails} instead.
233
+ *
234
+ * The structure is identical - only the type name changed.
235
+ *
236
+ * ## Migration Guide
237
+ *
238
+ * **Quick migration**: Replace `ProviderErrorDetails` with `AgentErrorDetails`
239
+ *
240
+ * ```typescript
241
+ * // BEFORE (v1.x)
242
+ * import { ProviderErrorDetails } from 'groundswell';
243
+ * const error: ProviderErrorDetails = {
244
+ * code: 'VALIDATION_FAILED',
245
+ * message: 'Invalid input',
246
+ * details: null,
247
+ * recoverable: false
248
+ * };
249
+ *
250
+ * // AFTER (v1.5+)
251
+ * import { AgentErrorDetails } from 'groundswell';
252
+ * const error: AgentErrorDetails = {
253
+ * code: 'VALIDATION_FAILED',
254
+ * message: 'Invalid input',
255
+ * details: null,
256
+ * recoverable: false
257
+ * };
258
+ * ```
259
+ *
260
+ * Provides structured error details for failed provider operations.
261
+ * Used in ProviderResult when status is 'error'.
262
+ *
263
+ * @see {@link AgentErrorDetails | New error details type}
264
+ */
265
+ export interface ProviderErrorDetails {
266
+ /**
267
+ * Machine-readable error code
268
+ * Examples: VALIDATION_FAILED, EXECUTION_FAILED, API_REQUEST_FAILED
269
+ */
270
+ code: string;
271
+ /**
272
+ * Human-readable error description
273
+ * Explains what went wrong in user-friendly terms
274
+ */
275
+ message: string;
276
+ /**
277
+ * Additional error context
278
+ * May contain structured data about the error for debugging
279
+ */
280
+ details?: Record<string, unknown> | null;
281
+ /**
282
+ * Whether the error is recoverable
283
+ * Hint for parent workflow retry logic
284
+ */
285
+ recoverable: boolean;
286
+ }
287
+ /**
288
+ * Metadata about provider operation execution
289
+ *
290
+ * @deprecated Since v1.5.0. Will be removed in v2.0.0.
291
+ * Use {@link AgentResponseMetadata} instead.
292
+ *
293
+ * Field mapping:
294
+ * - `providerId` → `agentId`
295
+ * - All other fields are identical
296
+ *
297
+ * ## Migration Guide
298
+ *
299
+ * **Quick migration**: Replace `ProviderResponseMetadata` with `AgentResponseMetadata` and rename `providerId` to `agentId`
300
+ *
301
+ * ```typescript
302
+ * // BEFORE (v1.x)
303
+ * import { ProviderResponseMetadata } from 'groundswell';
304
+ * const metadata: ProviderResponseMetadata = {
305
+ * providerId: 'anthropic',
306
+ * timestamp: Date.now(),
307
+ * duration: 1523
308
+ * };
309
+ *
310
+ * // AFTER (v1.5+)
311
+ * import { AgentResponseMetadata } from 'groundswell';
312
+ * const metadata: AgentResponseMetadata = {
313
+ * agentId: 'anthropic', // Note: providerId → agentId
314
+ * timestamp: Date.now(),
315
+ * duration: 1523
316
+ * };
317
+ * ```
318
+ *
319
+ * Contains execution context information for provider operations.
320
+ * Always present in ProviderResult regardless of status.
321
+ *
322
+ * @see {@link AgentResponseMetadata | New response metadata type}
323
+ */
324
+ export interface ProviderResponseMetadata {
325
+ /**
326
+ * Provider identifier
327
+ * ID of the provider that generated this response
328
+ */
329
+ providerId: string;
330
+ /**
331
+ * Unix timestamp in milliseconds
332
+ * Time when the response was generated
333
+ */
334
+ timestamp: number;
335
+ /**
336
+ * Execution duration in milliseconds
337
+ * Time taken for the provider operation to complete
338
+ */
339
+ duration?: number | null;
340
+ /**
341
+ * Request correlation ID
342
+ * Used for tracing requests across distributed systems
343
+ */
344
+ requestId?: string | null;
345
+ /**
346
+ * Token usage from the API
347
+ * Breakdown of input, output, and cache tokens used
348
+ */
349
+ usage?: TokenUsage;
350
+ /**
351
+ * Number of tool invocations
352
+ * Count of tool/function calls made during execution
353
+ */
354
+ toolCalls?: number;
355
+ }
356
+ /**
357
+ * Provider execution result wrapper
358
+ *
359
+ * @deprecated Since v1.5.0. Will be removed in v2.0.0.
360
+ * Use {@link AgentResponse} instead.
361
+ *
362
+ * ## Migration Guide
363
+ *
364
+ * **Quick migration**: Replace `ProviderResult<T>` with `AgentResponse<T>`
365
+ *
366
+ * ```typescript
367
+ * // BEFORE (v1.x)
368
+ * import { ProviderResult } from 'groundswell';
369
+ * const result: ProviderResult<Data> = await provider.execute(...);
370
+ *
371
+ * // AFTER (v1.5+)
372
+ * import { AgentResponse } from 'groundswell';
373
+ * const result: AgentResponse<Data> = await provider.execute(...);
374
+ * ```
375
+ *
376
+ * The structure is identical - only the type name changes:
377
+ * - `status: 'success' | 'error' | 'partial'` (same)
378
+ * - `data: T | null` (same)
379
+ * - `error: ErrorDetails | null` (same structure)
380
+ * - `metadata: ResponseMetadata` (same structure, with `providerId` → `agentId`)
381
+ *
382
+ * Wraps the result of provider execution with status, data, error,
383
+ * and metadata. Uses discriminated union pattern for type safety.
384
+ *
385
+ * ## PRD 6.4 Response Requirements
386
+ *
387
+ * All ProviderResult instances MUST satisfy:
388
+ * 1. **Strict JSON**: Parseable by JSON.parse()
389
+ * 2. **No Prose Wrapping**: No markdown or conversational text
390
+ * 3. **Consistent Structure**: Conforms to this interface
391
+ * 4. **Null over Undefined**: Use null for absent values
392
+ * 5. **Error Responses**: Failed ops return valid JSON with status='error'
393
+ *
394
+ * ## Type Narrowing
395
+ *
396
+ * The status field is a discriminant. Use type guards to narrow:
397
+ * - status='success' → data is T (not null), error is null
398
+ * - status='error' → data is null, error is ProviderErrorDetails (not null)
399
+ * - status='partial' → data is T (not null), error may be null
400
+ *
401
+ * @template T - The type of data returned on success (unknown by default)
402
+ * @see {@link AgentResponse | New response type}
403
+ * @see {@link ProviderResponseStatus}, {@link ProviderErrorDetails}
404
+ *
405
+ * @example
406
+ * ```ts
407
+ * const result: ProviderResult<{ answer: string }> = {
408
+ * status: 'success',
409
+ * data: { answer: '42' },
410
+ * error: null,
411
+ * metadata: { providerId: 'anthropic', timestamp: Date.now() }
412
+ * };
413
+ * ```
414
+ */
415
+ export interface ProviderResult<T = unknown> {
416
+ /**
417
+ * Response status discriminator
418
+ * Use for type narrowing: 'success' | 'error' | 'partial'
419
+ */
420
+ status: ProviderResponseStatus;
421
+ /**
422
+ * Response data
423
+ * Present on success and partial responses, null on error
424
+ */
425
+ data: T | null;
426
+ /**
427
+ * Error details
428
+ * Present on error responses, null on success
429
+ */
430
+ error: ProviderErrorDetails | null;
431
+ /**
432
+ * Response metadata
433
+ * Always present, contains execution context
434
+ */
435
+ metadata: ProviderResponseMetadata;
436
+ }
437
+ /**
438
+ * @deprecated Since v1.2. Use {@link GlobalHarnessConfig} from types/harnesses.ts.
439
+ *
440
+ * Note the field renames:
441
+ * `defaultProvider` → `defaultHarness`
442
+ * `providerDefaults` → `harnessDefaults`
443
+ * (plus the new `defaultModelProvider` axis)
444
+ *
445
+ * Successor `configureHarnesses()` lands in P1.M2.T2.S1.
446
+ *
447
+ * ```typescript
448
+ * // BEFORE (v1.x)
449
+ * import type { GlobalProviderConfig } from 'groundswell';
450
+ * const cfg: GlobalProviderConfig = { defaultProvider: 'anthropic' };
451
+ * // AFTER (v1.2)
452
+ * import type { GlobalHarnessConfig } from 'groundswell';
453
+ * const cfg: GlobalHarnessConfig = { defaultHarness: 'claude-code', defaultModelProvider: 'anthropic' };
454
+ * ```
455
+ */
456
+ export interface GlobalProviderConfig {
457
+ /**
458
+ * Default provider to use when none specified
459
+ */
460
+ defaultProvider: ProviderId;
461
+ /**
462
+ * Per-provider default options
463
+ * Mapped by provider ID, all options are optional
464
+ */
465
+ providerDefaults?: Partial<Record<ProviderId, ProviderOptions>>;
466
+ }
467
+ /**
468
+ * @deprecated Since v1.2. Implement {@link Harness} (types/harnesses.ts) instead.
469
+ *
470
+ * NOTE: this interface is kept CONCRETE (not `extends Harness`) because Harness.id is the
471
+ * narrow `HarnessId` while adapters still declare `id: ProviderId` with the legacy
472
+ * `'anthropic'` literal. It is removed when AnthropicProvider→ClaudeCodeHarness
473
+ * (P2.M1) migration completes. The method surface is identical to
474
+ * Harness — only the `id` union width differs today.
475
+ *
476
+ * ```typescript
477
+ * // BEFORE (v1.x)
478
+ * import type { Provider } from 'groundswell';
479
+ * class MyProvider implements Provider { readonly id: ProviderId = 'anthropic'; … }
480
+ * // AFTER (v1.2)
481
+ * import type { Harness } from 'groundswell';
482
+ * class MyHarness implements Harness { readonly id: HarnessId = 'claude-code'; … }
483
+ * ```
484
+ */
485
+ export interface Provider {
486
+ /**
487
+ * Unique provider identifier
488
+ *
489
+ * Used for provider selection and model qualification.
490
+ * Must be one of the supported {@link ProviderId} values.
491
+ *
492
+ * @readonly
493
+ *
494
+ * @example
495
+ * ```ts
496
+ * readonly id: ProviderId; // 'anthropic'
497
+ * ```
498
+ */
499
+ readonly id: ProviderId;
500
+ /**
501
+ * Provider capability flags
502
+ *
503
+ * Indicates which features this provider supports.
504
+ * Used for feature detection and capability queries.
505
+ *
506
+ * @readonly
507
+ *
508
+ * @example
509
+ * ```ts
510
+ * readonly capabilities: ProviderCapabilities;
511
+ * // { mcp: true, skills: true, lsp: true, streaming: true, sessions: false, extendedThinking: false }
512
+ * ```
513
+ */
514
+ readonly capabilities: ProviderCapabilities;
515
+ /**
516
+ * Initialize the provider with optional configuration
517
+ *
518
+ * Called when provider is first instantiated or registered.
519
+ * Providers should perform one-time setup here (SDK clients, connections).
520
+ *
521
+ * @param options - Optional provider-specific configuration
522
+ * @throws ProviderError if initialization fails
523
+ *
524
+ * @example
525
+ * ```ts
526
+ * await provider.initialize({ apiKey: 'sk-...', endpoint: 'https://...' });
527
+ * ```
528
+ */
529
+ initialize(options?: ProviderOptions): Promise<void>;
530
+ /**
531
+ * Terminate the provider and cleanup resources
532
+ *
533
+ * Called when provider is being shut down or unregistered.
534
+ * Providers should close connections, release resources, etc.
535
+ *
536
+ * @example
537
+ * ```ts
538
+ * await provider.terminate();
539
+ * ```
540
+ */
541
+ terminate(): Promise<void>;
542
+ /**
543
+ * Execute a prompt request with type-safe response
544
+ *
545
+ * This is the core method for LLM execution. Providers must:
546
+ * 1. Construct the appropriate SDK query/request
547
+ * 2. Handle tool execution via the toolExecutor callback
548
+ * 3. Invoke hooks at appropriate lifecycle points
549
+ * 4. Return an AgentResponse with validated data (or AsyncGenerator for streaming)
550
+ *
551
+ * @typeParam T - The expected response data type (inferred from schema or explicit)
552
+ * @param request - The prompt request with options
553
+ * @param toolExecutor - Callback for executing tools (delegated to MCPHandler)
554
+ * @param hooks - Optional lifecycle hooks for events
555
+ * @returns Promise resolving to AgentResponse or AsyncGenerator for streaming
556
+ *
557
+ * @example <caption>Explicit type parameter</caption>
558
+ * ```ts
559
+ * const response = await provider.execute<{ answer: string }>(
560
+ * { prompt: 'What is 2+2?', options: {} },
561
+ * toolExecutor,
562
+ * hooks
563
+ * );
564
+ * if (response.status === 'success') {
565
+ * console.log(response.data.answer); // Type-safe access
566
+ * }
567
+ * ```
568
+ *
569
+ * @example <caption>Schema inference (if supported)</caption>
570
+ * ```ts
571
+ * const response = await provider.execute(
572
+ * { prompt: '...', options: { outputSchema: AnswerSchema } },
573
+ * toolExecutor
574
+ * );
575
+ * ```
576
+ *
577
+ * @example <caption>Streaming mode</caption>
578
+ * ```ts
579
+ * const stream = await provider.execute(
580
+ * { prompt: '...', options: { streaming: true } },
581
+ * toolExecutor
582
+ * );
583
+ * if (Symbol.asyncIterator in stream) {
584
+ * for await (const event of stream) {
585
+ * // Handle streaming events
586
+ * }
587
+ * }
588
+ * ```
589
+ */
590
+ execute<T>(request: ProviderRequest, toolExecutor: ToolExecutor, hooks?: ProviderHookEvents): Promise<AgentResponse<T>> | AsyncGenerator<StreamEvent, AgentResponse<T>, unknown>;
591
+ /**
592
+ * Register MCP servers and return available tools
593
+ *
594
+ * Providers should connect to the given MCP servers and discover
595
+ * all available tools. Returns the list of discovered tools.
596
+ *
597
+ * @param servers - Array of MCP server configurations
598
+ * @returns Promise resolving to array of discovered Tool definitions
599
+ *
600
+ * @example
601
+ * ```ts
602
+ * const tools = await provider.registerMCPs([
603
+ * { name: 'filesystem', transport: 'stdio', command: 'python', args: ['mcp_server.py'] }
604
+ * ]);
605
+ * console.log(`Registered ${tools.length} tools`);
606
+ * ```
607
+ */
608
+ registerMCPs(servers: MCPServer[]): Promise<Tool[]>;
609
+ /**
610
+ * Load skills into the provider
611
+ *
612
+ * Skills are reusable prompt templates or capabilities.
613
+ * Anthropic provider uses system prompts; other providers have their own skill mechanisms.
614
+ *
615
+ * @param skills - Array of skill definitions to load
616
+ *
617
+ * @example
618
+ * ```ts
619
+ * await provider.loadSkills([
620
+ * { name: 'web-search', path: '/skills/web-search' }
621
+ * ]);
622
+ * ```
623
+ */
624
+ loadSkills(skills: Skill[]): Promise<void>;
625
+ /**
626
+ * Normalize a model string to a ModelSpec
627
+ *
628
+ * Parses model strings in two formats:
629
+ * - Plain: "claude-sonnet-4-20250514" (uses default provider)
630
+ * - Qualified: "anthropic/claude-opus-4-20250514" (explicit provider)
631
+ *
632
+ * @param model - Model string to parse
633
+ * @returns ModelSpec with provider, model, and raw string
634
+ *
635
+ * @example
636
+ * ```ts
637
+ * provider.normalizeModel('claude-sonnet-4')
638
+ * // Returns: { provider: 'anthropic', model: 'claude-sonnet-4', raw: 'claude-sonnet-4' }
639
+ *
640
+ * provider.normalizeModel('anthropic/claude-opus-4')
641
+ * // Returns: { provider: 'anthropic', model: 'claude-opus-4', raw: 'anthropic/claude-opus-4' }
642
+ * ```
643
+ */
644
+ normalizeModel(model: string): ModelSpec;
645
+ /**
646
+ * Check if a specific capability is supported
647
+ *
648
+ * Convenience method for querying provider capabilities.
649
+ * Equivalent to accessing `this.capabilities[capability]`.
650
+ *
651
+ * @param capability - The capability to check (must be keyof ProviderCapabilities)
652
+ * @returns true if the capability is supported, false otherwise
653
+ *
654
+ * @example
655
+ * ```ts
656
+ * const provider = new AnthropicProvider();
657
+ * if (provider.supports('mcp')) {
658
+ * // Register MCP servers
659
+ * }
660
+ *
661
+ * // Type-safe: TypeScript will error on invalid capability names
662
+ * provider.supports('invalid'); // Type error
663
+ * ```
664
+ */
665
+ supports(capability: keyof ProviderCapabilities): boolean;
666
+ /**
667
+ * Check if all specified features are supported
668
+ *
669
+ * Convenience method for validating multiple capabilities at once.
670
+ * Returns true only if ALL specified features are supported.
671
+ *
672
+ * @param features - Array of capability keys to check
673
+ * @returns true if all features are supported, false if any are unsupported
674
+ *
675
+ * @example
676
+ * ```ts
677
+ * const provider = new AnthropicProvider();
678
+ * if (provider.requiresFeatures(['mcp', 'streaming'])) {
679
+ * // Enable advanced features requiring both MCP and streaming
680
+ * }
681
+ *
682
+ * // Empty array returns true (no requirements)
683
+ * provider.requiresFeatures([]); // true
684
+ *
685
+ * // Any unsupported feature returns false
686
+ * provider.requiresFeatures(['mcp', 'lsp']); // false if lsp is not supported
687
+ * ```
688
+ */
689
+ requiresFeatures(features: (keyof ProviderCapabilities)[]): boolean;
690
+ }
691
+ //# sourceMappingURL=providers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/types/providers.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EACV,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,EACV,MAAM,gBAAgB,CAAC;AAIxB;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC;AAIjD;;;;;;;;;GASG;AACH,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AAEvD;;;;;;;;;GASG;AACH,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAEnD;;;;;;;;;GASG;AACH,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,CAAC;AAE/D;;;;;;;;;GASG;AACH,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC;AAE7C;;;;;;;;;;GAUG;AACH,YAAY,EAAE,SAAS,EAAE,CAAC;AAK1B,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;AAI1D;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,eAAe;IAC9B,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC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