@contractspec/lib.ai-agent 1.62.0 → 2.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 (209) hide show
  1. package/dist/agent/agent-factory.d.ts +0 -1
  2. package/dist/agent/agent-factory.js +41 -6
  3. package/dist/agent/agent.test.d.ts +0 -1
  4. package/dist/agent/contract-spec-agent.d.ts +0 -1
  5. package/dist/agent/contract-spec-agent.js +41 -6
  6. package/dist/agent/index.d.ts +0 -1
  7. package/dist/agent/index.js +43 -8
  8. package/dist/agent/json-runner.d.ts +0 -1
  9. package/dist/agent/json-runner.js +42 -7
  10. package/dist/agent/json-runner.test.d.ts +0 -1
  11. package/dist/agent/unified-agent.d.ts +0 -1
  12. package/dist/agent/unified-agent.js +42 -7
  13. package/dist/approval/index.d.ts +0 -1
  14. package/dist/approval/index.js +31 -5
  15. package/dist/approval/workflow.d.ts +7 -2
  16. package/dist/approval/workflow.js +31 -5
  17. package/dist/exporters/claude-agent-exporter.d.ts +0 -1
  18. package/dist/exporters/claude-agent-exporter.js +4 -4
  19. package/dist/exporters/index.d.ts +0 -1
  20. package/dist/exporters/index.js +4 -4
  21. package/dist/exporters/opencode-exporter.d.ts +0 -1
  22. package/dist/exporters/opencode-exporter.js +4 -4
  23. package/dist/exporters/types.d.ts +0 -1
  24. package/dist/i18n/catalogs/en.d.ts +1 -2
  25. package/dist/i18n/catalogs/en.js +1 -1
  26. package/dist/i18n/catalogs/es.d.ts +1 -2
  27. package/dist/i18n/catalogs/es.js +1 -1
  28. package/dist/i18n/catalogs/fr.d.ts +1 -2
  29. package/dist/i18n/catalogs/fr.js +1 -1
  30. package/dist/i18n/catalogs/index.d.ts +0 -1
  31. package/dist/i18n/catalogs/index.js +3 -3
  32. package/dist/i18n/i18n.test.d.ts +0 -1
  33. package/dist/i18n/index.d.ts +0 -1
  34. package/dist/i18n/index.js +4 -4
  35. package/dist/i18n/keys.d.ts +0 -1
  36. package/dist/i18n/locale.d.ts +0 -1
  37. package/dist/i18n/messages.d.ts +1 -2
  38. package/dist/i18n/messages.js +4 -4
  39. package/dist/index.d.ts +0 -14
  40. package/dist/index.js +6 -3523
  41. package/dist/interop/index.d.ts +0 -1
  42. package/dist/interop/index.js +4 -4
  43. package/dist/interop/spec-consumer.d.ts +0 -1
  44. package/dist/interop/spec-consumer.js +4 -4
  45. package/dist/interop/tool-consumer.d.ts +0 -1
  46. package/dist/interop/tool-consumer.js +4 -4
  47. package/dist/interop/types.d.ts +0 -1
  48. package/dist/knowledge/index.d.ts +0 -1
  49. package/dist/knowledge/index.js +4 -4
  50. package/dist/knowledge/injector.d.ts +0 -1
  51. package/dist/knowledge/injector.js +4 -4
  52. package/dist/memory/in-memory.d.ts +0 -1
  53. package/dist/memory/index.d.ts +0 -1
  54. package/dist/memory/manager.d.ts +0 -1
  55. package/dist/memory/memory.test.d.ts +0 -1
  56. package/dist/node/agent/agent-factory.js +41 -6
  57. package/dist/node/agent/contract-spec-agent.js +41 -6
  58. package/dist/node/agent/index.js +43 -8
  59. package/dist/node/agent/json-runner.js +42 -7
  60. package/dist/node/agent/unified-agent.js +42 -7
  61. package/dist/node/approval/index.js +31 -5
  62. package/dist/node/approval/workflow.js +31 -5
  63. package/dist/node/exporters/claude-agent-exporter.js +4 -4
  64. package/dist/node/exporters/index.js +4 -4
  65. package/dist/node/exporters/opencode-exporter.js +4 -4
  66. package/dist/node/i18n/catalogs/en.js +1 -1
  67. package/dist/node/i18n/catalogs/es.js +1 -1
  68. package/dist/node/i18n/catalogs/fr.js +1 -1
  69. package/dist/node/i18n/catalogs/index.js +3 -3
  70. package/dist/node/i18n/index.js +4 -4
  71. package/dist/node/i18n/messages.js +4 -4
  72. package/dist/node/index.js +6 -3523
  73. package/dist/node/interop/index.js +4 -4
  74. package/dist/node/interop/spec-consumer.js +4 -4
  75. package/dist/node/interop/tool-consumer.js +4 -4
  76. package/dist/node/knowledge/index.js +4 -4
  77. package/dist/node/knowledge/injector.js +4 -4
  78. package/dist/node/providers/claude-agent-sdk/adapter.js +4 -4
  79. package/dist/node/providers/claude-agent-sdk/index.js +4 -4
  80. package/dist/node/providers/claude-agent-sdk/tool-bridge.js +4 -4
  81. package/dist/node/providers/index.js +4 -4
  82. package/dist/node/providers/opencode-sdk/adapter.js +4 -4
  83. package/dist/node/providers/opencode-sdk/agent-bridge.js +4 -4
  84. package/dist/node/providers/opencode-sdk/index.js +4 -4
  85. package/dist/node/providers/opencode-sdk/tool-bridge.js +4 -4
  86. package/dist/node/providers/registry.js +4 -4
  87. package/dist/node/session/index.js +37 -2
  88. package/dist/node/session/store.js +37 -2
  89. package/dist/node/spec/index.js +5 -5
  90. package/dist/node/spec/registry.js +5 -5
  91. package/dist/node/spec/spec.js +4 -4
  92. package/dist/node/tools/index.js +4 -4
  93. package/dist/node/tools/knowledge-tool.js +4 -4
  94. package/dist/node/tools/mcp-server.js +4 -4
  95. package/dist/node/tools/tool-adapter.js +4 -4
  96. package/dist/providers/claude-agent-sdk/adapter.d.ts +0 -1
  97. package/dist/providers/claude-agent-sdk/adapter.js +4 -4
  98. package/dist/providers/claude-agent-sdk/index.d.ts +0 -1
  99. package/dist/providers/claude-agent-sdk/index.js +4 -4
  100. package/dist/providers/claude-agent-sdk/session-bridge.d.ts +0 -1
  101. package/dist/providers/claude-agent-sdk/tool-bridge.d.ts +0 -1
  102. package/dist/providers/claude-agent-sdk/tool-bridge.js +4 -4
  103. package/dist/providers/index.d.ts +0 -1
  104. package/dist/providers/index.js +4 -4
  105. package/dist/providers/opencode-sdk/adapter.d.ts +0 -1
  106. package/dist/providers/opencode-sdk/adapter.js +4 -4
  107. package/dist/providers/opencode-sdk/agent-bridge.d.ts +0 -1
  108. package/dist/providers/opencode-sdk/agent-bridge.js +4 -4
  109. package/dist/providers/opencode-sdk/index.d.ts +0 -1
  110. package/dist/providers/opencode-sdk/index.js +4 -4
  111. package/dist/providers/opencode-sdk/tool-bridge.d.ts +0 -1
  112. package/dist/providers/opencode-sdk/tool-bridge.js +4 -4
  113. package/dist/providers/registry.d.ts +0 -1
  114. package/dist/providers/registry.js +4 -4
  115. package/dist/providers/types.d.ts +0 -1
  116. package/dist/schema/index.d.ts +0 -1
  117. package/dist/schema/json-schema-to-zod.d.ts +0 -1
  118. package/dist/schema/schema-output.d.ts +0 -1
  119. package/dist/session/index.d.ts +0 -1
  120. package/dist/session/index.js +37 -2
  121. package/dist/session/store.d.ts +12 -2
  122. package/dist/session/store.js +37 -2
  123. package/dist/spec/index.d.ts +0 -1
  124. package/dist/spec/index.js +5 -5
  125. package/dist/spec/registry.d.ts +1 -2
  126. package/dist/spec/registry.js +5 -5
  127. package/dist/spec/spec.d.ts +3 -4
  128. package/dist/spec/spec.js +4 -4
  129. package/dist/telemetry/adapter.d.ts +0 -1
  130. package/dist/telemetry/index.d.ts +0 -1
  131. package/dist/telemetry/posthog-types.d.ts +0 -1
  132. package/dist/telemetry/posthog.d.ts +0 -1
  133. package/dist/telemetry/posthog.test.d.ts +0 -1
  134. package/dist/tools/index.d.ts +0 -1
  135. package/dist/tools/index.js +4 -4
  136. package/dist/tools/knowledge-tool.d.ts +0 -1
  137. package/dist/tools/knowledge-tool.js +4 -4
  138. package/dist/tools/mcp-client.d.ts +0 -1
  139. package/dist/tools/mcp-server.d.ts +0 -1
  140. package/dist/tools/mcp-server.js +4 -4
  141. package/dist/tools/tool-adapter.d.ts +0 -1
  142. package/dist/tools/tool-adapter.js +4 -4
  143. package/dist/tools/tools.test.d.ts +0 -1
  144. package/dist/types.d.ts +0 -1
  145. package/package.json +12 -12
  146. package/dist/agent/agent-factory.d.ts.map +0 -1
  147. package/dist/agent/agent.test.d.ts.map +0 -1
  148. package/dist/agent/contract-spec-agent.d.ts.map +0 -1
  149. package/dist/agent/index.d.ts.map +0 -1
  150. package/dist/agent/json-runner.d.ts.map +0 -1
  151. package/dist/agent/json-runner.test.d.ts.map +0 -1
  152. package/dist/agent/unified-agent.d.ts.map +0 -1
  153. package/dist/approval/index.d.ts.map +0 -1
  154. package/dist/approval/workflow.d.ts.map +0 -1
  155. package/dist/exporters/claude-agent-exporter.d.ts.map +0 -1
  156. package/dist/exporters/index.d.ts.map +0 -1
  157. package/dist/exporters/opencode-exporter.d.ts.map +0 -1
  158. package/dist/exporters/types.d.ts.map +0 -1
  159. package/dist/i18n/catalogs/en.d.ts.map +0 -1
  160. package/dist/i18n/catalogs/es.d.ts.map +0 -1
  161. package/dist/i18n/catalogs/fr.d.ts.map +0 -1
  162. package/dist/i18n/catalogs/index.d.ts.map +0 -1
  163. package/dist/i18n/i18n.test.d.ts.map +0 -1
  164. package/dist/i18n/index.d.ts.map +0 -1
  165. package/dist/i18n/keys.d.ts.map +0 -1
  166. package/dist/i18n/locale.d.ts.map +0 -1
  167. package/dist/i18n/messages.d.ts.map +0 -1
  168. package/dist/index.d.ts.map +0 -1
  169. package/dist/interop/index.d.ts.map +0 -1
  170. package/dist/interop/spec-consumer.d.ts.map +0 -1
  171. package/dist/interop/tool-consumer.d.ts.map +0 -1
  172. package/dist/interop/types.d.ts.map +0 -1
  173. package/dist/knowledge/index.d.ts.map +0 -1
  174. package/dist/knowledge/injector.d.ts.map +0 -1
  175. package/dist/memory/in-memory.d.ts.map +0 -1
  176. package/dist/memory/index.d.ts.map +0 -1
  177. package/dist/memory/manager.d.ts.map +0 -1
  178. package/dist/memory/memory.test.d.ts.map +0 -1
  179. package/dist/providers/claude-agent-sdk/adapter.d.ts.map +0 -1
  180. package/dist/providers/claude-agent-sdk/index.d.ts.map +0 -1
  181. package/dist/providers/claude-agent-sdk/session-bridge.d.ts.map +0 -1
  182. package/dist/providers/claude-agent-sdk/tool-bridge.d.ts.map +0 -1
  183. package/dist/providers/index.d.ts.map +0 -1
  184. package/dist/providers/opencode-sdk/adapter.d.ts.map +0 -1
  185. package/dist/providers/opencode-sdk/agent-bridge.d.ts.map +0 -1
  186. package/dist/providers/opencode-sdk/index.d.ts.map +0 -1
  187. package/dist/providers/opencode-sdk/tool-bridge.d.ts.map +0 -1
  188. package/dist/providers/registry.d.ts.map +0 -1
  189. package/dist/providers/types.d.ts.map +0 -1
  190. package/dist/schema/index.d.ts.map +0 -1
  191. package/dist/schema/json-schema-to-zod.d.ts.map +0 -1
  192. package/dist/schema/schema-output.d.ts.map +0 -1
  193. package/dist/session/index.d.ts.map +0 -1
  194. package/dist/session/store.d.ts.map +0 -1
  195. package/dist/spec/index.d.ts.map +0 -1
  196. package/dist/spec/registry.d.ts.map +0 -1
  197. package/dist/spec/spec.d.ts.map +0 -1
  198. package/dist/telemetry/adapter.d.ts.map +0 -1
  199. package/dist/telemetry/index.d.ts.map +0 -1
  200. package/dist/telemetry/posthog-types.d.ts.map +0 -1
  201. package/dist/telemetry/posthog.d.ts.map +0 -1
  202. package/dist/telemetry/posthog.test.d.ts.map +0 -1
  203. package/dist/tools/index.d.ts.map +0 -1
  204. package/dist/tools/knowledge-tool.d.ts.map +0 -1
  205. package/dist/tools/mcp-client.d.ts.map +0 -1
  206. package/dist/tools/mcp-server.d.ts.map +0 -1
  207. package/dist/tools/tool-adapter.d.ts.map +0 -1
  208. package/dist/tools/tools.test.d.ts.map +0 -1
  209. package/dist/types.d.ts.map +0 -1
@@ -13,7 +13,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
13
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
14
 
15
15
  // src/i18n/catalogs/en.ts
16
- import { defineTranslation } from "@contractspec/lib.contracts/translations";
16
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
17
17
  var enMessages;
18
18
  var init_en = __esm(() => {
19
19
  enMessages = defineTranslation({
@@ -609,7 +609,7 @@ var init_en = __esm(() => {
609
609
  });
610
610
 
611
611
  // src/i18n/catalogs/fr.ts
612
- import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts/translations";
612
+ import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
613
613
  var frMessages;
614
614
  var init_fr = __esm(() => {
615
615
  frMessages = defineTranslation2({
@@ -1220,7 +1220,7 @@ var init_fr = __esm(() => {
1220
1220
  });
1221
1221
 
1222
1222
  // src/i18n/catalogs/es.ts
1223
- import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts/translations";
1223
+ import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
1224
1224
  var esMessages;
1225
1225
  var init_es = __esm(() => {
1226
1226
  esMessages = defineTranslation3({
@@ -1885,7 +1885,7 @@ var init_locale = __esm(() => {
1885
1885
  });
1886
1886
 
1887
1887
  // src/i18n/messages.ts
1888
- import { TranslationRegistry } from "@contractspec/lib.contracts/translations";
1888
+ import { TranslationRegistry } from "@contractspec/lib.contracts-spec/translations";
1889
1889
  function getRegistry() {
1890
1890
  if (!sharedRegistry) {
1891
1891
  sharedRegistry = new TranslationRegistry([
@@ -13,7 +13,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
13
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
14
 
15
15
  // src/i18n/catalogs/en.ts
16
- import { defineTranslation } from "@contractspec/lib.contracts/translations";
16
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
17
17
  var enMessages;
18
18
  var init_en = __esm(() => {
19
19
  enMessages = defineTranslation({
@@ -609,7 +609,7 @@ var init_en = __esm(() => {
609
609
  });
610
610
 
611
611
  // src/i18n/catalogs/fr.ts
612
- import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts/translations";
612
+ import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
613
613
  var frMessages;
614
614
  var init_fr = __esm(() => {
615
615
  frMessages = defineTranslation2({
@@ -1220,7 +1220,7 @@ var init_fr = __esm(() => {
1220
1220
  });
1221
1221
 
1222
1222
  // src/i18n/catalogs/es.ts
1223
- import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts/translations";
1223
+ import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
1224
1224
  var esMessages;
1225
1225
  var init_es = __esm(() => {
1226
1226
  esMessages = defineTranslation3({
@@ -1885,7 +1885,7 @@ var init_locale = __esm(() => {
1885
1885
  });
1886
1886
 
1887
1887
  // src/i18n/messages.ts
1888
- import { TranslationRegistry } from "@contractspec/lib.contracts/translations";
1888
+ import { TranslationRegistry } from "@contractspec/lib.contracts-spec/translations";
1889
1889
  function getRegistry() {
1890
1890
  if (!sharedRegistry) {
1891
1891
  sharedRegistry = new TranslationRegistry([
@@ -13,7 +13,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
13
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
14
 
15
15
  // src/i18n/catalogs/en.ts
16
- import { defineTranslation } from "@contractspec/lib.contracts/translations";
16
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
17
17
  var enMessages;
18
18
  var init_en = __esm(() => {
19
19
  enMessages = defineTranslation({
@@ -609,7 +609,7 @@ var init_en = __esm(() => {
609
609
  });
610
610
 
611
611
  // src/i18n/catalogs/fr.ts
612
- import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts/translations";
612
+ import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
613
613
  var frMessages;
614
614
  var init_fr = __esm(() => {
615
615
  frMessages = defineTranslation2({
@@ -1220,7 +1220,7 @@ var init_fr = __esm(() => {
1220
1220
  });
1221
1221
 
1222
1222
  // src/i18n/catalogs/es.ts
1223
- import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts/translations";
1223
+ import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
1224
1224
  var esMessages;
1225
1225
  var init_es = __esm(() => {
1226
1226
  esMessages = defineTranslation3({
@@ -1885,7 +1885,7 @@ var init_locale = __esm(() => {
1885
1885
  });
1886
1886
 
1887
1887
  // src/i18n/messages.ts
1888
- import { TranslationRegistry } from "@contractspec/lib.contracts/translations";
1888
+ import { TranslationRegistry } from "@contractspec/lib.contracts-spec/translations";
1889
1889
  function getRegistry() {
1890
1890
  if (!sharedRegistry) {
1891
1891
  sharedRegistry = new TranslationRegistry([
@@ -13,7 +13,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
13
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
14
 
15
15
  // src/i18n/catalogs/en.ts
16
- import { defineTranslation } from "@contractspec/lib.contracts/translations";
16
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
17
17
  var enMessages;
18
18
  var init_en = __esm(() => {
19
19
  enMessages = defineTranslation({
@@ -609,7 +609,7 @@ var init_en = __esm(() => {
609
609
  });
610
610
 
611
611
  // src/i18n/catalogs/fr.ts
612
- import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts/translations";
612
+ import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
613
613
  var frMessages;
614
614
  var init_fr = __esm(() => {
615
615
  frMessages = defineTranslation2({
@@ -1220,7 +1220,7 @@ var init_fr = __esm(() => {
1220
1220
  });
1221
1221
 
1222
1222
  // src/i18n/catalogs/es.ts
1223
- import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts/translations";
1223
+ import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
1224
1224
  var esMessages;
1225
1225
  var init_es = __esm(() => {
1226
1226
  esMessages = defineTranslation3({
@@ -1885,7 +1885,7 @@ var init_locale = __esm(() => {
1885
1885
  });
1886
1886
 
1887
1887
  // src/i18n/messages.ts
1888
- import { TranslationRegistry } from "@contractspec/lib.contracts/translations";
1888
+ import { TranslationRegistry } from "@contractspec/lib.contracts-spec/translations";
1889
1889
  function getRegistry() {
1890
1890
  if (!sharedRegistry) {
1891
1891
  sharedRegistry = new TranslationRegistry([
@@ -13,7 +13,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
13
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
14
 
15
15
  // src/i18n/catalogs/en.ts
16
- import { defineTranslation } from "@contractspec/lib.contracts/translations";
16
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
17
17
  var enMessages;
18
18
  var init_en = __esm(() => {
19
19
  enMessages = defineTranslation({
@@ -609,7 +609,7 @@ var init_en = __esm(() => {
609
609
  });
610
610
 
611
611
  // src/i18n/catalogs/fr.ts
612
- import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts/translations";
612
+ import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
613
613
  var frMessages;
614
614
  var init_fr = __esm(() => {
615
615
  frMessages = defineTranslation2({
@@ -1220,7 +1220,7 @@ var init_fr = __esm(() => {
1220
1220
  });
1221
1221
 
1222
1222
  // src/i18n/catalogs/es.ts
1223
- import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts/translations";
1223
+ import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
1224
1224
  var esMessages;
1225
1225
  var init_es = __esm(() => {
1226
1226
  esMessages = defineTranslation3({
@@ -1885,7 +1885,7 @@ var init_locale = __esm(() => {
1885
1885
  });
1886
1886
 
1887
1887
  // src/i18n/messages.ts
1888
- import { TranslationRegistry } from "@contractspec/lib.contracts/translations";
1888
+ import { TranslationRegistry } from "@contractspec/lib.contracts-spec/translations";
1889
1889
  function getRegistry() {
1890
1890
  if (!sharedRegistry) {
1891
1891
  sharedRegistry = new TranslationRegistry([
@@ -13,7 +13,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
13
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
14
 
15
15
  // src/i18n/catalogs/en.ts
16
- import { defineTranslation } from "@contractspec/lib.contracts/translations";
16
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
17
17
  var enMessages;
18
18
  var init_en = __esm(() => {
19
19
  enMessages = defineTranslation({
@@ -609,7 +609,7 @@ var init_en = __esm(() => {
609
609
  });
610
610
 
611
611
  // src/i18n/catalogs/fr.ts
612
- import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts/translations";
612
+ import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
613
613
  var frMessages;
614
614
  var init_fr = __esm(() => {
615
615
  frMessages = defineTranslation2({
@@ -1220,7 +1220,7 @@ var init_fr = __esm(() => {
1220
1220
  });
1221
1221
 
1222
1222
  // src/i18n/catalogs/es.ts
1223
- import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts/translations";
1223
+ import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
1224
1224
  var esMessages;
1225
1225
  var init_es = __esm(() => {
1226
1226
  esMessages = defineTranslation3({
@@ -1885,7 +1885,7 @@ var init_locale = __esm(() => {
1885
1885
  });
1886
1886
 
1887
1887
  // src/i18n/messages.ts
1888
- import { TranslationRegistry } from "@contractspec/lib.contracts/translations";
1888
+ import { TranslationRegistry } from "@contractspec/lib.contracts-spec/translations";
1889
1889
  function getRegistry() {
1890
1890
  if (!sharedRegistry) {
1891
1891
  sharedRegistry = new TranslationRegistry([
@@ -13,7 +13,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
13
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
14
 
15
15
  // src/i18n/catalogs/en.ts
16
- import { defineTranslation } from "@contractspec/lib.contracts/translations";
16
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
17
17
  var enMessages;
18
18
  var init_en = __esm(() => {
19
19
  enMessages = defineTranslation({
@@ -609,7 +609,7 @@ var init_en = __esm(() => {
609
609
  });
610
610
 
611
611
  // src/i18n/catalogs/fr.ts
612
- import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts/translations";
612
+ import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
613
613
  var frMessages;
614
614
  var init_fr = __esm(() => {
615
615
  frMessages = defineTranslation2({
@@ -1220,7 +1220,7 @@ var init_fr = __esm(() => {
1220
1220
  });
1221
1221
 
1222
1222
  // src/i18n/catalogs/es.ts
1223
- import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts/translations";
1223
+ import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
1224
1224
  var esMessages;
1225
1225
  var init_es = __esm(() => {
1226
1226
  esMessages = defineTranslation3({
@@ -1885,7 +1885,7 @@ var init_locale = __esm(() => {
1885
1885
  });
1886
1886
 
1887
1887
  // src/i18n/messages.ts
1888
- import { TranslationRegistry } from "@contractspec/lib.contracts/translations";
1888
+ import { TranslationRegistry } from "@contractspec/lib.contracts-spec/translations";
1889
1889
  function getRegistry() {
1890
1890
  if (!sharedRegistry) {
1891
1891
  sharedRegistry = new TranslationRegistry([
@@ -13,7 +13,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
13
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
14
 
15
15
  // src/i18n/catalogs/en.ts
16
- import { defineTranslation } from "@contractspec/lib.contracts/translations";
16
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
17
17
  var enMessages;
18
18
  var init_en = __esm(() => {
19
19
  enMessages = defineTranslation({
@@ -609,7 +609,7 @@ var init_en = __esm(() => {
609
609
  });
610
610
 
611
611
  // src/i18n/catalogs/fr.ts
612
- import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts/translations";
612
+ import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
613
613
  var frMessages;
614
614
  var init_fr = __esm(() => {
615
615
  frMessages = defineTranslation2({
@@ -1220,7 +1220,7 @@ var init_fr = __esm(() => {
1220
1220
  });
1221
1221
 
1222
1222
  // src/i18n/catalogs/es.ts
1223
- import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts/translations";
1223
+ import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
1224
1224
  var esMessages;
1225
1225
  var init_es = __esm(() => {
1226
1226
  esMessages = defineTranslation3({
@@ -1885,7 +1885,7 @@ var init_locale = __esm(() => {
1885
1885
  });
1886
1886
 
1887
1887
  // src/i18n/messages.ts
1888
- import { TranslationRegistry } from "@contractspec/lib.contracts/translations";
1888
+ import { TranslationRegistry } from "@contractspec/lib.contracts-spec/translations";
1889
1889
  function getRegistry() {
1890
1890
  if (!sharedRegistry) {
1891
1891
  sharedRegistry = new TranslationRegistry([
@@ -13,7 +13,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
13
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
14
 
15
15
  // src/i18n/catalogs/en.ts
16
- import { defineTranslation } from "@contractspec/lib.contracts/translations";
16
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
17
17
  var enMessages;
18
18
  var init_en = __esm(() => {
19
19
  enMessages = defineTranslation({
@@ -609,7 +609,7 @@ var init_en = __esm(() => {
609
609
  });
610
610
 
611
611
  // src/i18n/catalogs/fr.ts
612
- import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts/translations";
612
+ import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
613
613
  var frMessages;
614
614
  var init_fr = __esm(() => {
615
615
  frMessages = defineTranslation2({
@@ -1220,7 +1220,7 @@ var init_fr = __esm(() => {
1220
1220
  });
1221
1221
 
1222
1222
  // src/i18n/catalogs/es.ts
1223
- import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts/translations";
1223
+ import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
1224
1224
  var esMessages;
1225
1225
  var init_es = __esm(() => {
1226
1226
  esMessages = defineTranslation3({
@@ -1885,7 +1885,7 @@ var init_locale = __esm(() => {
1885
1885
  });
1886
1886
 
1887
1887
  // src/i18n/messages.ts
1888
- import { TranslationRegistry } from "@contractspec/lib.contracts/translations";
1888
+ import { TranslationRegistry } from "@contractspec/lib.contracts-spec/translations";
1889
1889
  function getRegistry() {
1890
1890
  if (!sharedRegistry) {
1891
1891
  sharedRegistry = new TranslationRegistry([
@@ -13,7 +13,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
13
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
14
 
15
15
  // src/i18n/catalogs/en.ts
16
- import { defineTranslation } from "@contractspec/lib.contracts/translations";
16
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
17
17
  var enMessages;
18
18
  var init_en = __esm(() => {
19
19
  enMessages = defineTranslation({
@@ -609,7 +609,7 @@ var init_en = __esm(() => {
609
609
  });
610
610
 
611
611
  // src/i18n/catalogs/fr.ts
612
- import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts/translations";
612
+ import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
613
613
  var frMessages;
614
614
  var init_fr = __esm(() => {
615
615
  frMessages = defineTranslation2({
@@ -1220,7 +1220,7 @@ var init_fr = __esm(() => {
1220
1220
  });
1221
1221
 
1222
1222
  // src/i18n/catalogs/es.ts
1223
- import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts/translations";
1223
+ import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
1224
1224
  var esMessages;
1225
1225
  var init_es = __esm(() => {
1226
1226
  esMessages = defineTranslation3({
@@ -1885,7 +1885,7 @@ var init_locale = __esm(() => {
1885
1885
  });
1886
1886
 
1887
1887
  // src/i18n/messages.ts
1888
- import { TranslationRegistry } from "@contractspec/lib.contracts/translations";
1888
+ import { TranslationRegistry } from "@contractspec/lib.contracts-spec/translations";
1889
1889
  function getRegistry() {
1890
1890
  if (!sharedRegistry) {
1891
1891
  sharedRegistry = new TranslationRegistry([
@@ -13,7 +13,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
13
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
14
 
15
15
  // src/i18n/catalogs/en.ts
16
- import { defineTranslation } from "@contractspec/lib.contracts/translations";
16
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
17
17
  var enMessages;
18
18
  var init_en = __esm(() => {
19
19
  enMessages = defineTranslation({
@@ -609,7 +609,7 @@ var init_en = __esm(() => {
609
609
  });
610
610
 
611
611
  // src/i18n/catalogs/fr.ts
612
- import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts/translations";
612
+ import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
613
613
  var frMessages;
614
614
  var init_fr = __esm(() => {
615
615
  frMessages = defineTranslation2({
@@ -1220,7 +1220,7 @@ var init_fr = __esm(() => {
1220
1220
  });
1221
1221
 
1222
1222
  // src/i18n/catalogs/es.ts
1223
- import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts/translations";
1223
+ import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
1224
1224
  var esMessages;
1225
1225
  var init_es = __esm(() => {
1226
1226
  esMessages = defineTranslation3({
@@ -1885,7 +1885,7 @@ var init_locale = __esm(() => {
1885
1885
  });
1886
1886
 
1887
1887
  // src/i18n/messages.ts
1888
- import { TranslationRegistry } from "@contractspec/lib.contracts/translations";
1888
+ import { TranslationRegistry } from "@contractspec/lib.contracts-spec/translations";
1889
1889
  function getRegistry() {
1890
1890
  if (!sharedRegistry) {
1891
1891
  sharedRegistry = new TranslationRegistry([
@@ -13,7 +13,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
13
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
14
 
15
15
  // src/i18n/catalogs/en.ts
16
- import { defineTranslation } from "@contractspec/lib.contracts/translations";
16
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
17
17
  var enMessages;
18
18
  var init_en = __esm(() => {
19
19
  enMessages = defineTranslation({
@@ -609,7 +609,7 @@ var init_en = __esm(() => {
609
609
  });
610
610
 
611
611
  // src/i18n/catalogs/fr.ts
612
- import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts/translations";
612
+ import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
613
613
  var frMessages;
614
614
  var init_fr = __esm(() => {
615
615
  frMessages = defineTranslation2({
@@ -1220,7 +1220,7 @@ var init_fr = __esm(() => {
1220
1220
  });
1221
1221
 
1222
1222
  // src/i18n/catalogs/es.ts
1223
- import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts/translations";
1223
+ import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
1224
1224
  var esMessages;
1225
1225
  var init_es = __esm(() => {
1226
1226
  esMessages = defineTranslation3({
@@ -1885,7 +1885,7 @@ var init_locale = __esm(() => {
1885
1885
  });
1886
1886
 
1887
1887
  // src/i18n/messages.ts
1888
- import { TranslationRegistry } from "@contractspec/lib.contracts/translations";
1888
+ import { TranslationRegistry } from "@contractspec/lib.contracts-spec/translations";
1889
1889
  function getRegistry() {
1890
1890
  if (!sharedRegistry) {
1891
1891
  sharedRegistry = new TranslationRegistry([
@@ -13,7 +13,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
13
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
14
 
15
15
  // src/i18n/catalogs/en.ts
16
- import { defineTranslation } from "@contractspec/lib.contracts/translations";
16
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
17
17
  var enMessages;
18
18
  var init_en = __esm(() => {
19
19
  enMessages = defineTranslation({
@@ -609,7 +609,7 @@ var init_en = __esm(() => {
609
609
  });
610
610
 
611
611
  // src/i18n/catalogs/fr.ts
612
- import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts/translations";
612
+ import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
613
613
  var frMessages;
614
614
  var init_fr = __esm(() => {
615
615
  frMessages = defineTranslation2({
@@ -1220,7 +1220,7 @@ var init_fr = __esm(() => {
1220
1220
  });
1221
1221
 
1222
1222
  // src/i18n/catalogs/es.ts
1223
- import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts/translations";
1223
+ import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
1224
1224
  var esMessages;
1225
1225
  var init_es = __esm(() => {
1226
1226
  esMessages = defineTranslation3({
@@ -1885,7 +1885,7 @@ var init_locale = __esm(() => {
1885
1885
  });
1886
1886
 
1887
1887
  // src/i18n/messages.ts
1888
- import { TranslationRegistry } from "@contractspec/lib.contracts/translations";
1888
+ import { TranslationRegistry } from "@contractspec/lib.contracts-spec/translations";
1889
1889
  function getRegistry() {
1890
1890
  if (!sharedRegistry) {
1891
1891
  sharedRegistry = new TranslationRegistry([
@@ -13,7 +13,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
13
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
14
14
 
15
15
  // src/i18n/catalogs/en.ts
16
- import { defineTranslation } from "@contractspec/lib.contracts/translations";
16
+ import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
17
17
  var enMessages;
18
18
  var init_en = __esm(() => {
19
19
  enMessages = defineTranslation({
@@ -609,7 +609,7 @@ var init_en = __esm(() => {
609
609
  });
610
610
 
611
611
  // src/i18n/catalogs/fr.ts
612
- import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts/translations";
612
+ import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
613
613
  var frMessages;
614
614
  var init_fr = __esm(() => {
615
615
  frMessages = defineTranslation2({
@@ -1220,7 +1220,7 @@ var init_fr = __esm(() => {
1220
1220
  });
1221
1221
 
1222
1222
  // src/i18n/catalogs/es.ts
1223
- import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts/translations";
1223
+ import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
1224
1224
  var esMessages;
1225
1225
  var init_es = __esm(() => {
1226
1226
  esMessages = defineTranslation3({
@@ -1885,7 +1885,7 @@ var init_locale = __esm(() => {
1885
1885
  });
1886
1886
 
1887
1887
  // src/i18n/messages.ts
1888
- import { TranslationRegistry } from "@contractspec/lib.contracts/translations";
1888
+ import { TranslationRegistry } from "@contractspec/lib.contracts-spec/translations";
1889
1889
  function getRegistry() {
1890
1890
  if (!sharedRegistry) {
1891
1891
  sharedRegistry = new TranslationRegistry([
@@ -15,10 +15,19 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
15
15
  // src/session/store.ts
16
16
  class InMemorySessionStore {
17
17
  sessions = new Map;
18
+ maxSessions;
19
+ maxMessagesPerSession;
20
+ maxStepsPerSession;
21
+ constructor(options = {}) {
22
+ this.maxSessions = options.maxSessions ?? 500;
23
+ this.maxMessagesPerSession = options.maxMessagesPerSession ?? 200;
24
+ this.maxStepsPerSession = options.maxStepsPerSession ?? 200;
25
+ }
18
26
  async get(sessionId) {
19
27
  return this.sessions.get(sessionId) ?? null;
20
28
  }
21
29
  async create(session) {
30
+ this.evictIfNeeded();
22
31
  const now = new Date;
23
32
  const fullSession = {
24
33
  ...session,
@@ -32,6 +41,7 @@ class InMemorySessionStore {
32
41
  const session = this.sessions.get(sessionId);
33
42
  if (session) {
34
43
  session.steps.push(step);
44
+ this.trimArray(session.steps, this.maxStepsPerSession);
35
45
  session.updatedAt = new Date;
36
46
  }
37
47
  }
@@ -39,6 +49,7 @@ class InMemorySessionStore {
39
49
  const session = this.sessions.get(sessionId);
40
50
  if (session) {
41
51
  session.messages.push(message);
52
+ this.trimArray(session.messages, this.maxMessagesPerSession);
42
53
  session.updatedAt = new Date;
43
54
  }
44
55
  }
@@ -76,9 +87,33 @@ class InMemorySessionStore {
76
87
  clear() {
77
88
  this.sessions.clear();
78
89
  }
90
+ evictIfNeeded() {
91
+ if (this.sessions.size < this.maxSessions) {
92
+ return;
93
+ }
94
+ let oldestSessionId = null;
95
+ let oldestUpdatedAt = Number.POSITIVE_INFINITY;
96
+ for (const [sessionId, session] of this.sessions.entries()) {
97
+ const updatedAt = session.updatedAt.getTime();
98
+ if (updatedAt < oldestUpdatedAt) {
99
+ oldestUpdatedAt = updatedAt;
100
+ oldestSessionId = sessionId;
101
+ }
102
+ }
103
+ if (oldestSessionId) {
104
+ this.sessions.delete(oldestSessionId);
105
+ }
106
+ }
107
+ trimArray(items, maxItems) {
108
+ if (items.length <= maxItems) {
109
+ return;
110
+ }
111
+ const overflow = items.length - maxItems;
112
+ items.splice(0, overflow);
113
+ }
79
114
  }
80
- function createInMemorySessionStore() {
81
- return new InMemorySessionStore;
115
+ function createInMemorySessionStore(options) {
116
+ return new InMemorySessionStore(options);
82
117
  }
83
118
  function generateSessionId() {
84
119
  return `sess_${Date.now()}_${Math.random().toString(36).slice(2, 11)}`;
@@ -15,10 +15,19 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
15
15
  // src/session/store.ts
16
16
  class InMemorySessionStore {
17
17
  sessions = new Map;
18
+ maxSessions;
19
+ maxMessagesPerSession;
20
+ maxStepsPerSession;
21
+ constructor(options = {}) {
22
+ this.maxSessions = options.maxSessions ?? 500;
23
+ this.maxMessagesPerSession = options.maxMessagesPerSession ?? 200;
24
+ this.maxStepsPerSession = options.maxStepsPerSession ?? 200;
25
+ }
18
26
  async get(sessionId) {
19
27
  return this.sessions.get(sessionId) ?? null;
20
28
  }
21
29
  async create(session) {
30
+ this.evictIfNeeded();
22
31
  const now = new Date;
23
32
  const fullSession = {
24
33
  ...session,
@@ -32,6 +41,7 @@ class InMemorySessionStore {
32
41
  const session = this.sessions.get(sessionId);
33
42
  if (session) {
34
43
  session.steps.push(step);
44
+ this.trimArray(session.steps, this.maxStepsPerSession);
35
45
  session.updatedAt = new Date;
36
46
  }
37
47
  }
@@ -39,6 +49,7 @@ class InMemorySessionStore {
39
49
  const session = this.sessions.get(sessionId);
40
50
  if (session) {
41
51
  session.messages.push(message);
52
+ this.trimArray(session.messages, this.maxMessagesPerSession);
42
53
  session.updatedAt = new Date;
43
54
  }
44
55
  }
@@ -76,9 +87,33 @@ class InMemorySessionStore {
76
87
  clear() {
77
88
  this.sessions.clear();
78
89
  }
90
+ evictIfNeeded() {
91
+ if (this.sessions.size < this.maxSessions) {
92
+ return;
93
+ }
94
+ let oldestSessionId = null;
95
+ let oldestUpdatedAt = Number.POSITIVE_INFINITY;
96
+ for (const [sessionId, session] of this.sessions.entries()) {
97
+ const updatedAt = session.updatedAt.getTime();
98
+ if (updatedAt < oldestUpdatedAt) {
99
+ oldestUpdatedAt = updatedAt;
100
+ oldestSessionId = sessionId;
101
+ }
102
+ }
103
+ if (oldestSessionId) {
104
+ this.sessions.delete(oldestSessionId);
105
+ }
106
+ }
107
+ trimArray(items, maxItems) {
108
+ if (items.length <= maxItems) {
109
+ return;
110
+ }
111
+ const overflow = items.length - maxItems;
112
+ items.splice(0, overflow);
113
+ }
79
114
  }
80
- function createInMemorySessionStore() {
81
- return new InMemorySessionStore;
115
+ function createInMemorySessionStore(options) {
116
+ return new InMemorySessionStore(options);
82
117
  }
83
118
  function generateSessionId() {
84
119
  return `sess_${Date.now()}_${Math.random().toString(36).slice(2, 11)}`;