paracosm 0.0.1 → 0.1.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 (273) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +215 -0
  3. package/dist/cli/sim-config.d.ts +98 -0
  4. package/dist/cli/sim-config.d.ts.map +1 -0
  5. package/dist/cli/sim-config.js +123 -0
  6. package/dist/cli/sim-config.js.map +1 -0
  7. package/dist/cli/types.d.ts +73 -0
  8. package/dist/cli/types.d.ts.map +1 -0
  9. package/dist/cli/types.js +2 -0
  10. package/dist/cli/types.js.map +1 -0
  11. package/dist/engine/_template/index.d.ts +9 -0
  12. package/dist/engine/_template/index.d.ts.map +1 -0
  13. package/dist/engine/_template/index.js +91 -0
  14. package/dist/engine/_template/index.js.map +1 -0
  15. package/dist/engine/compiler/cache.d.ts +12 -0
  16. package/dist/engine/compiler/cache.d.ts.map +1 -0
  17. package/dist/engine/compiler/cache.js +75 -0
  18. package/dist/engine/compiler/cache.js.map +1 -0
  19. package/dist/engine/compiler/generate-director.d.ts +9 -0
  20. package/dist/engine/compiler/generate-director.d.ts.map +1 -0
  21. package/dist/engine/compiler/generate-director.js +57 -0
  22. package/dist/engine/compiler/generate-director.js.map +1 -0
  23. package/dist/engine/compiler/generate-fingerprint.d.ts +12 -0
  24. package/dist/engine/compiler/generate-fingerprint.d.ts.map +1 -0
  25. package/dist/engine/compiler/generate-fingerprint.js +86 -0
  26. package/dist/engine/compiler/generate-fingerprint.js.map +1 -0
  27. package/dist/engine/compiler/generate-milestones.d.ts +11 -0
  28. package/dist/engine/compiler/generate-milestones.d.ts.map +1 -0
  29. package/dist/engine/compiler/generate-milestones.js +121 -0
  30. package/dist/engine/compiler/generate-milestones.js.map +1 -0
  31. package/dist/engine/compiler/generate-politics.d.ts +11 -0
  32. package/dist/engine/compiler/generate-politics.d.ts.map +1 -0
  33. package/dist/engine/compiler/generate-politics.js +85 -0
  34. package/dist/engine/compiler/generate-politics.js.map +1 -0
  35. package/dist/engine/compiler/generate-progression.d.ts +15 -0
  36. package/dist/engine/compiler/generate-progression.d.ts.map +1 -0
  37. package/dist/engine/compiler/generate-progression.js +104 -0
  38. package/dist/engine/compiler/generate-progression.js.map +1 -0
  39. package/dist/engine/compiler/generate-prompts.d.ts +11 -0
  40. package/dist/engine/compiler/generate-prompts.d.ts.map +1 -0
  41. package/dist/engine/compiler/generate-prompts.js +90 -0
  42. package/dist/engine/compiler/generate-prompts.js.map +1 -0
  43. package/dist/engine/compiler/generate-reactions.d.ts +12 -0
  44. package/dist/engine/compiler/generate-reactions.d.ts.map +1 -0
  45. package/dist/engine/compiler/generate-reactions.js +90 -0
  46. package/dist/engine/compiler/generate-reactions.js.map +1 -0
  47. package/dist/engine/compiler/index.d.ts +34 -0
  48. package/dist/engine/compiler/index.d.ts.map +1 -0
  49. package/dist/engine/compiler/index.js +270 -0
  50. package/dist/engine/compiler/index.js.map +1 -0
  51. package/dist/engine/compiler/seed-ingestion.d.ts +40 -0
  52. package/dist/engine/compiler/seed-ingestion.d.ts.map +1 -0
  53. package/dist/engine/compiler/seed-ingestion.js +232 -0
  54. package/dist/engine/compiler/seed-ingestion.js.map +1 -0
  55. package/dist/engine/compiler/types.d.ts +30 -0
  56. package/dist/engine/compiler/types.d.ts.map +1 -0
  57. package/dist/engine/compiler/types.js +5 -0
  58. package/dist/engine/compiler/types.js.map +1 -0
  59. package/dist/engine/compiler/validate.d.ts +37 -0
  60. package/dist/engine/compiler/validate.d.ts.map +1 -0
  61. package/dist/engine/compiler/validate.js +141 -0
  62. package/dist/engine/compiler/validate.js.map +1 -0
  63. package/dist/engine/core/agent-generator.d.ts +11 -0
  64. package/dist/engine/core/agent-generator.d.ts.map +1 -0
  65. package/dist/engine/core/agent-generator.js +85 -0
  66. package/dist/engine/core/agent-generator.js.map +1 -0
  67. package/dist/engine/core/kernel.d.ts +69 -0
  68. package/dist/engine/core/kernel.d.ts.map +1 -0
  69. package/dist/engine/core/kernel.js +223 -0
  70. package/dist/engine/core/kernel.js.map +1 -0
  71. package/dist/engine/core/progression.d.ts +38 -0
  72. package/dist/engine/core/progression.d.ts.map +1 -0
  73. package/dist/engine/core/progression.js +292 -0
  74. package/dist/engine/core/progression.js.map +1 -0
  75. package/dist/engine/core/rng.d.ts +19 -0
  76. package/dist/engine/core/rng.d.ts.map +1 -0
  77. package/dist/engine/core/rng.js +34 -0
  78. package/dist/engine/core/rng.js.map +1 -0
  79. package/dist/engine/core/state.d.ts +140 -0
  80. package/dist/engine/core/state.d.ts.map +1 -0
  81. package/dist/engine/core/state.js +5 -0
  82. package/dist/engine/core/state.js.map +1 -0
  83. package/dist/engine/effect-registry.d.ts +14 -0
  84. package/dist/engine/effect-registry.d.ts.map +1 -0
  85. package/dist/engine/effect-registry.js +28 -0
  86. package/dist/engine/effect-registry.js.map +1 -0
  87. package/dist/engine/event-taxonomy.d.ts +9 -0
  88. package/dist/engine/event-taxonomy.d.ts.map +1 -0
  89. package/dist/engine/event-taxonomy.js +13 -0
  90. package/dist/engine/event-taxonomy.js.map +1 -0
  91. package/dist/engine/index.d.ts +25 -0
  92. package/dist/engine/index.d.ts.map +1 -0
  93. package/dist/engine/index.js +19 -0
  94. package/dist/engine/index.js.map +1 -0
  95. package/dist/engine/lunar/effects.d.ts +7 -0
  96. package/dist/engine/lunar/effects.d.ts.map +1 -0
  97. package/dist/engine/lunar/effects.js +16 -0
  98. package/dist/engine/lunar/effects.js.map +1 -0
  99. package/dist/engine/lunar/events.d.ts +3 -0
  100. package/dist/engine/lunar/events.d.ts.map +1 -0
  101. package/dist/engine/lunar/events.js +11 -0
  102. package/dist/engine/lunar/events.js.map +1 -0
  103. package/dist/engine/lunar/fingerprint.d.ts +5 -0
  104. package/dist/engine/lunar/fingerprint.d.ts.map +1 -0
  105. package/dist/engine/lunar/fingerprint.js +17 -0
  106. package/dist/engine/lunar/fingerprint.js.map +1 -0
  107. package/dist/engine/lunar/hooks.d.ts +10 -0
  108. package/dist/engine/lunar/hooks.d.ts.map +1 -0
  109. package/dist/engine/lunar/hooks.js +10 -0
  110. package/dist/engine/lunar/hooks.js.map +1 -0
  111. package/dist/engine/lunar/index.d.ts +8 -0
  112. package/dist/engine/lunar/index.d.ts.map +1 -0
  113. package/dist/engine/lunar/index.js +38 -0
  114. package/dist/engine/lunar/index.js.map +1 -0
  115. package/dist/engine/lunar/metrics.d.ts +4 -0
  116. package/dist/engine/lunar/metrics.d.ts.map +1 -0
  117. package/dist/engine/lunar/metrics.js +14 -0
  118. package/dist/engine/lunar/metrics.js.map +1 -0
  119. package/dist/engine/lunar/milestones.d.ts +3 -0
  120. package/dist/engine/lunar/milestones.d.ts.map +1 -0
  121. package/dist/engine/lunar/milestones.js +53 -0
  122. package/dist/engine/lunar/milestones.js.map +1 -0
  123. package/dist/engine/lunar/names.d.ts +4 -0
  124. package/dist/engine/lunar/names.d.ts.map +1 -0
  125. package/dist/engine/lunar/names.js +23 -0
  126. package/dist/engine/lunar/names.js.map +1 -0
  127. package/dist/engine/lunar/politics.d.ts +6 -0
  128. package/dist/engine/lunar/politics.d.ts.map +1 -0
  129. package/dist/engine/lunar/politics.js +13 -0
  130. package/dist/engine/lunar/politics.js.map +1 -0
  131. package/dist/engine/lunar/presets.d.ts +25 -0
  132. package/dist/engine/lunar/presets.d.ts.map +1 -0
  133. package/dist/engine/lunar/presets.js +24 -0
  134. package/dist/engine/lunar/presets.js.map +1 -0
  135. package/dist/engine/lunar/progression-hooks.d.ts +7 -0
  136. package/dist/engine/lunar/progression-hooks.d.ts.map +1 -0
  137. package/dist/engine/lunar/progression-hooks.js +20 -0
  138. package/dist/engine/lunar/progression-hooks.js.map +1 -0
  139. package/dist/engine/lunar/prompts.d.ts +10 -0
  140. package/dist/engine/lunar/prompts.d.ts.map +1 -0
  141. package/dist/engine/lunar/prompts.js +64 -0
  142. package/dist/engine/lunar/prompts.js.map +1 -0
  143. package/dist/engine/lunar/reactions.d.ts +5 -0
  144. package/dist/engine/lunar/reactions.d.ts.map +1 -0
  145. package/dist/engine/lunar/reactions.js +15 -0
  146. package/dist/engine/lunar/reactions.js.map +1 -0
  147. package/dist/engine/lunar/research-bundle.d.ts +8 -0
  148. package/dist/engine/lunar/research-bundle.d.ts.map +1 -0
  149. package/dist/engine/lunar/research-bundle.js +157 -0
  150. package/dist/engine/lunar/research-bundle.js.map +1 -0
  151. package/dist/engine/lunar/scenario.json +117 -0
  152. package/dist/engine/mars/effects.d.ts +18 -0
  153. package/dist/engine/mars/effects.d.ts.map +1 -0
  154. package/dist/engine/mars/effects.js +21 -0
  155. package/dist/engine/mars/effects.js.map +1 -0
  156. package/dist/engine/mars/events.d.ts +9 -0
  157. package/dist/engine/mars/events.d.ts.map +1 -0
  158. package/dist/engine/mars/events.js +12 -0
  159. package/dist/engine/mars/events.js.map +1 -0
  160. package/dist/engine/mars/fingerprint.d.ts +6 -0
  161. package/dist/engine/mars/fingerprint.d.ts.map +1 -0
  162. package/dist/engine/mars/fingerprint.js +21 -0
  163. package/dist/engine/mars/fingerprint.js.map +1 -0
  164. package/dist/engine/mars/hooks.d.ts +11 -0
  165. package/dist/engine/mars/hooks.d.ts.map +1 -0
  166. package/dist/engine/mars/hooks.js +11 -0
  167. package/dist/engine/mars/hooks.js.map +1 -0
  168. package/dist/engine/mars/index.d.ts +8 -0
  169. package/dist/engine/mars/index.d.ts.map +1 -0
  170. package/dist/engine/mars/index.js +44 -0
  171. package/dist/engine/mars/index.js.map +1 -0
  172. package/dist/engine/mars/metrics.d.ts +21 -0
  173. package/dist/engine/mars/metrics.d.ts.map +1 -0
  174. package/dist/engine/mars/metrics.js +25 -0
  175. package/dist/engine/mars/metrics.js.map +1 -0
  176. package/dist/engine/mars/milestones.d.ts +15 -0
  177. package/dist/engine/mars/milestones.d.ts.map +1 -0
  178. package/dist/engine/mars/milestones.js +72 -0
  179. package/dist/engine/mars/milestones.js.map +1 -0
  180. package/dist/engine/mars/names.d.ts +12 -0
  181. package/dist/engine/mars/names.d.ts.map +1 -0
  182. package/dist/engine/mars/names.js +45 -0
  183. package/dist/engine/mars/names.js.map +1 -0
  184. package/dist/engine/mars/politics.d.ts +7 -0
  185. package/dist/engine/mars/politics.d.ts.map +1 -0
  186. package/dist/engine/mars/politics.js +14 -0
  187. package/dist/engine/mars/politics.js.map +1 -0
  188. package/dist/engine/mars/presets.d.ts +29 -0
  189. package/dist/engine/mars/presets.d.ts.map +1 -0
  190. package/dist/engine/mars/presets.js +28 -0
  191. package/dist/engine/mars/presets.js.map +1 -0
  192. package/dist/engine/mars/progression-hooks.d.ts +8 -0
  193. package/dist/engine/mars/progression-hooks.d.ts.map +1 -0
  194. package/dist/engine/mars/progression-hooks.js +21 -0
  195. package/dist/engine/mars/progression-hooks.js.map +1 -0
  196. package/dist/engine/mars/prompts.d.ts +12 -0
  197. package/dist/engine/mars/prompts.d.ts.map +1 -0
  198. package/dist/engine/mars/prompts.js +75 -0
  199. package/dist/engine/mars/prompts.js.map +1 -0
  200. package/dist/engine/mars/reactions.d.ts +7 -0
  201. package/dist/engine/mars/reactions.d.ts.map +1 -0
  202. package/dist/engine/mars/reactions.js +24 -0
  203. package/dist/engine/mars/reactions.js.map +1 -0
  204. package/dist/engine/mars/research-bundle.d.ts +7 -0
  205. package/dist/engine/mars/research-bundle.d.ts.map +1 -0
  206. package/dist/engine/mars/research-bundle.js +174 -0
  207. package/dist/engine/mars/research-bundle.js.map +1 -0
  208. package/dist/engine/mars/scenario.json +117 -0
  209. package/dist/engine/metric-registry.d.ts +12 -0
  210. package/dist/engine/metric-registry.d.ts.map +1 -0
  211. package/dist/engine/metric-registry.js +26 -0
  212. package/dist/engine/metric-registry.js.map +1 -0
  213. package/dist/engine/types.d.ts +354 -0
  214. package/dist/engine/types.d.ts.map +1 -0
  215. package/dist/engine/types.js +7 -0
  216. package/dist/engine/types.js.map +1 -0
  217. package/dist/runtime/agent-memory.d.ts +43 -0
  218. package/dist/runtime/agent-memory.d.ts.map +1 -0
  219. package/dist/runtime/agent-memory.js +201 -0
  220. package/dist/runtime/agent-memory.js.map +1 -0
  221. package/dist/runtime/agent-reactions.d.ts +55 -0
  222. package/dist/runtime/agent-reactions.d.ts.map +1 -0
  223. package/dist/runtime/agent-reactions.js +136 -0
  224. package/dist/runtime/agent-reactions.js.map +1 -0
  225. package/dist/runtime/batch.d.ts +43 -0
  226. package/dist/runtime/batch.d.ts.map +1 -0
  227. package/dist/runtime/batch.js +49 -0
  228. package/dist/runtime/batch.js.map +1 -0
  229. package/dist/runtime/contracts.d.ts +127 -0
  230. package/dist/runtime/contracts.d.ts.map +1 -0
  231. package/dist/runtime/contracts.js +2 -0
  232. package/dist/runtime/contracts.js.map +1 -0
  233. package/dist/runtime/departments.d.ts +28 -0
  234. package/dist/runtime/departments.d.ts.map +1 -0
  235. package/dist/runtime/departments.js +111 -0
  236. package/dist/runtime/departments.js.map +1 -0
  237. package/dist/runtime/director.d.ts +92 -0
  238. package/dist/runtime/director.d.ts.map +1 -0
  239. package/dist/runtime/director.js +220 -0
  240. package/dist/runtime/director.js.map +1 -0
  241. package/dist/runtime/index.d.ts +16 -0
  242. package/dist/runtime/index.d.ts.map +1 -0
  243. package/dist/runtime/index.js +12 -0
  244. package/dist/runtime/index.js.map +1 -0
  245. package/dist/runtime/orchestrator.d.ts +65 -0
  246. package/dist/runtime/orchestrator.d.ts.map +1 -0
  247. package/dist/runtime/orchestrator.js +821 -0
  248. package/dist/runtime/orchestrator.js.map +1 -0
  249. package/dist/runtime/research/knowledge-base.d.ts +14 -0
  250. package/dist/runtime/research/knowledge-base.d.ts.map +1 -0
  251. package/dist/runtime/research/knowledge-base.js +229 -0
  252. package/dist/runtime/research/knowledge-base.js.map +1 -0
  253. package/dist/runtime/research/research-memory.d.ts +21 -0
  254. package/dist/runtime/research/research-memory.d.ts.map +1 -0
  255. package/dist/runtime/research/research-memory.js +118 -0
  256. package/dist/runtime/research/research-memory.js.map +1 -0
  257. package/dist/runtime/research/research.d.ts +4 -0
  258. package/dist/runtime/research/research.d.ts.map +1 -0
  259. package/dist/runtime/research/research.js +138 -0
  260. package/dist/runtime/research/research.js.map +1 -0
  261. package/dist/runtime/research/scenario-research.d.ts +13 -0
  262. package/dist/runtime/research/scenario-research.d.ts.map +1 -0
  263. package/dist/runtime/research/scenario-research.js +58 -0
  264. package/dist/runtime/research/scenario-research.js.map +1 -0
  265. package/dist/runtime/research/scenarios.d.ts +3 -0
  266. package/dist/runtime/research/scenarios.d.ts.map +1 -0
  267. package/dist/runtime/research/scenarios.js +252 -0
  268. package/dist/runtime/research/scenarios.js.map +1 -0
  269. package/dist/runtime/runtime-helpers.d.ts +12 -0
  270. package/dist/runtime/runtime-helpers.d.ts.map +1 -0
  271. package/dist/runtime/runtime-helpers.js +29 -0
  272. package/dist/runtime/runtime-helpers.js.map +1 -0
  273. package/package.json +77 -4
package/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work.
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by the Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding any notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 Manic Agency LLC / Frame.dev
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,215 @@
1
+ <p align="center">
2
+ <a href="https://paracosm.agentos.sh"><img src="assets/favicons/icon.svg" alt="Paracosm" height="64" /></a>
3
+ </p>
4
+
5
+ <h1 align="center">PARACOSM</h1>
6
+
7
+ <p align="center">
8
+ <em>AI Agent Swarm Simulation Engine</em>
9
+ </p>
10
+
11
+ <p align="center">
12
+ Open-source AI agent swarm simulation engine with emergent crises, runtime tool forging, HEXACO personality evolution, and a deterministic kernel. Define any scenario as JSON.
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://www.npmjs.com/package/paracosm"><img src="https://img.shields.io/npm/v/paracosm?style=flat-square&color=e8b44a&labelColor=14110e" alt="npm" /></a>
17
+ <a href="https://github.com/framersai/paracosm/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-e06530?style=flat-square&labelColor=14110e" alt="License" /></a>
18
+ <a href="https://docs.agentos.sh"><img src="https://img.shields.io/badge/docs-agentos.sh-4ca8a8?style=flat-square&labelColor=14110e" alt="Docs" /></a>
19
+ <a href="https://agentos.sh"><img src="https://img.shields.io/badge/built%20on-AgentOS-e06530?style=flat-square&labelColor=14110e" alt="AgentOS" /></a>
20
+ </p>
21
+
22
+ <p align="center">
23
+ <a href="https://paracosm.agentos.sh"><strong>paracosm.agentos.sh</strong></a> &middot;
24
+ <a href="https://agentos.sh">AgentOS</a> &middot;
25
+ <a href="https://docs.agentos.sh">Docs</a> &middot;
26
+ <a href="https://github.com/framersai/paracosm">GitHub</a> &middot;
27
+ <a href="https://www.npmjs.com/package/paracosm">npm</a> &middot;
28
+ <a href="https://frame.dev">Frame.dev</a> &middot;
29
+ <a href="https://manic.agency">Manic Agency</a> &middot;
30
+ <a href="https://wilds.ai/discord">Discord</a>
31
+ </p>
32
+
33
+ ---
34
+
35
+ ## What Is Paracosm
36
+
37
+ Paracosm is an AI agent swarm simulation engine. You define a `ScenarioPackage` describing your world (departments, metrics, crises, progression hooks, research citations), and the engine spawns an autonomous agent swarm to run it: emergent crisis generation, multi-agent department analysis, runtime tool forging, HEXACO personality drift, and deterministic state transitions.
38
+
39
+ The engine handles orchestration. The scenario handles domain.
40
+
41
+ **Engine archetype:** closed-state, turn-based swarm simulation. Covers Mars colonies, lunar outposts, Antarctic stations, orbital habitats, submarine crews, corporate orgs, generation ships. Does not cover graph-seeded social prediction or open-world sims.
42
+
43
+ ## Scenarios
44
+
45
+ ### Mars Genesis (flagship)
46
+
47
+ Two commanders receive the same colony of 100 colonists and the same starting resources. Their HEXACO personalities drive different decisions, different tool inventions, and different civilizational outcomes over 50 years.
48
+
49
+ ```bash
50
+ npm run dashboard
51
+ # Open http://localhost:3456/sim?tab=settings
52
+ ```
53
+
54
+ ### Lunar Outpost
55
+
56
+ 50-person crew at the lunar south pole. Different departments (mining, life-support, communications), different progression (regolith toxicity, 1/6g atrophy), different milestones. Proves the engine works without editing engine code.
57
+
58
+ ## Install
59
+
60
+ ```bash
61
+ npm install paracosm
62
+ ```
63
+
64
+ ## Usage
65
+
66
+ ### As a library
67
+
68
+ ```typescript
69
+ import type { ScenarioPackage, Agent } from 'paracosm';
70
+ import { marsScenario } from 'paracosm/mars';
71
+ import { lunarScenario } from 'paracosm/lunar';
72
+ import { runSimulation, runBatch } from 'paracosm/runtime';
73
+ import { SimulationKernel, SeededRng } from 'paracosm';
74
+
75
+ // Run a single simulation
76
+ const output = await runSimulation(leader, keyPersonnel, {
77
+ scenario: marsScenario,
78
+ maxTurns: 12,
79
+ seed: 950,
80
+ });
81
+
82
+ // Batch run across scenarios
83
+ const manifest = await runBatch({
84
+ scenarios: [marsScenario, lunarScenario],
85
+ leaders: [leaderA, leaderB],
86
+ turns: 5,
87
+ seed: 950,
88
+ });
89
+ ```
90
+
91
+ ### Mars Dashboard (standalone)
92
+
93
+ ```bash
94
+ git clone https://github.com/framersai/paracosm
95
+ cd paracosm
96
+ npm install
97
+ cp .env.example .env # add your API key
98
+
99
+ npm run dashboard # full dashboard with settings
100
+ npm run dashboard:smoke # 3-turn smoke test
101
+ ```
102
+
103
+ The live dashboard is mounted at `/sim`, with `/setup` kept as a convenience alias that redirects to the settings tab.
104
+
105
+ ### Scenario Compiler
106
+
107
+ ```bash
108
+ npm run compile -- scenarios/submarine.json --seed-url https://example.com/report --no-web-search
109
+ ```
110
+
111
+ The compiler CLI now exposes the same seed-ingestion controls as the runtime API: `--seed-text`, `--seed-url`, `--no-web-search`, and `--max-searches`. Compiled custom scenarios are kept in the live scenario catalog so they remain switchable from the settings selector after compilation. If you save a fully runnable `ScenarioPackage` JSON to `scenarios/*.json`, the dashboard server now reloads it into that catalog on startup; draft authoring JSON is saved as-is but only appears in the selector after it has been compiled into a runnable package.
112
+
113
+ ## Architecture
114
+
115
+ ```
116
+ src/
117
+ engine/ importable library (the package)
118
+ types.ts ScenarioPackage, WorldState, hooks
119
+ core/ deterministic kernel (RNG, state, progression)
120
+ mars/ Mars Genesis scenario package
121
+ lunar/ Lunar Outpost scenario package
122
+ index.ts barrel exports
123
+
124
+ runtime/ orchestration (agents, crisis director, departments)
125
+ orchestrator.ts turn pipeline: director -> kernel -> departments -> commander
126
+ batch.ts multi-scenario batch runner
127
+ index.ts barrel exports
128
+
129
+ cli/ server + dashboard + CLI (not exported by package)
130
+ serve.ts HTTP + SSE server
131
+ dashboard/ live visualization (React/Vite, with legacy fallback)
132
+ ```
133
+
134
+ ### Design Principle
135
+
136
+ **The engine owns the chassis. The scenario owns the domain.**
137
+
138
+ The kernel owns canonical state, time, randomness, and invariants. The scenario owns crisis categories, department instructions, progression hooks, fingerprint classification, and research citations. The orchestrator connects them.
139
+
140
+ ## Package Exports
141
+
142
+ | Import | What |
143
+ |--------|------|
144
+ | `paracosm` | Engine types, registries, kernel, scenario packages |
145
+ | `paracosm/mars` | Mars Genesis scenario package |
146
+ | `paracosm/lunar` | Lunar Outpost scenario package |
147
+ | `paracosm/runtime` | `runSimulation`, `runBatch`, orchestration |
148
+ | `paracosm/core` | Kernel state types |
149
+
150
+ ## Creating a Scenario
151
+
152
+ A `ScenarioPackage` defines everything the engine needs:
153
+
154
+ ```typescript
155
+ const myScenario: ScenarioPackage = {
156
+ id: 'my-scenario',
157
+ version: '1.0.0',
158
+ engineArchetype: 'closed_turn_based_settlement',
159
+ labels: { name: 'My Scenario', shortName: 'my', populationNoun: 'members', settlementNoun: 'base', currency: 'credits' },
160
+ theme: { primaryColor: '#22c55e', accentColor: '#86efac', cssVariables: {} },
161
+ setup: { defaultTurns: 8, defaultSeed: 100, defaultStartYear: 2040, defaultPopulation: 30 },
162
+ world: { metrics: {}, capacities: {}, statuses: {}, politics: {}, environment: {} },
163
+ departments: [
164
+ { id: 'engineering', label: 'Engineering', role: 'Chief Engineer', icon: '⚙️', defaultModel: 'gpt-5.4-mini', instructions: '...' },
165
+ ],
166
+ hooks: {
167
+ progressionHook: (ctx) => { /* your domain-specific progression */ },
168
+ directorInstructions: () => '...',
169
+ getMilestoneCrisis: (turn, max) => turn === 1 ? { /* ... */ } : null,
170
+ },
171
+ // ... metrics, events, effects, ui, knowledge, policies, presets
172
+ };
173
+ ```
174
+
175
+ ## What AgentOS Provides
176
+
177
+ | Capability | How It's Used |
178
+ |-----------|--------------|
179
+ | [`agent()`](https://docs.agentos.sh/api) | Commander, department, and Crisis Director agents |
180
+ | [`generateText()`](https://docs.agentos.sh/api) | LLM calls for judge evaluation and crisis generation |
181
+ | [`EmergentCapabilityEngine`](https://docs.agentos.sh/api/classes/EmergentCapabilityEngine) | Runtime tool forging pipeline |
182
+ | [`EmergentJudge`](https://docs.agentos.sh/api/classes/EmergentJudge) | Safety and correctness review of forged tools |
183
+ | [`AgentMemory`](https://docs.agentos.sh/api/classes/AgentMemory) | Semantic research memory with DOI citations |
184
+
185
+ ## The AgentOS Ecosystem
186
+
187
+ | Resource | URL |
188
+ |----------|-----|
189
+ | AgentOS (core runtime) | [github.com/framersai/agentos](https://github.com/framersai/agentos) |
190
+ | Documentation | [docs.agentos.sh](https://docs.agentos.sh) |
191
+ | API Reference | [docs.agentos.sh/api](https://docs.agentos.sh/api) |
192
+ | npm | [@framers/agentos](https://www.npmjs.com/package/@framers/agentos) |
193
+ | Paracosm | [github.com/framersai/paracosm](https://github.com/framersai/paracosm) |
194
+ | Website | [agentos.sh](https://agentos.sh) |
195
+
196
+ ## License
197
+
198
+ Apache-2.0
199
+
200
+ ---
201
+
202
+ <p align="center">
203
+ <a href="https://agentos.sh"><img src="assets/agentos-logo.png" alt="AgentOS" height="36" /></a>
204
+ &nbsp;&nbsp;&nbsp;
205
+ <a href="https://frame.dev"><img src="https://img.shields.io/badge/Frame.dev-frame.dev-0a0a0a?style=flat-square" alt="Frame.dev" height="28" /></a>
206
+ </p>
207
+
208
+ <p align="center">
209
+ Built by <a href="https://manic.agency">Manic Agency LLC</a> / <a href="https://frame.dev">Frame.dev</a><br>
210
+ Contact: <a href="mailto:team@frame.dev">team@frame.dev</a>
211
+ </p>
212
+
213
+ <p align="center">
214
+ <sub>Copyright 2026 Manic Agency LLC. Licensed under Apache-2.0.</sub>
215
+ </p>
@@ -0,0 +1,98 @@
1
+ import type { KeyPersonnel } from '../engine/core/agent-generator.js';
2
+ import type { Department } from '../engine/core/state.js';
3
+ import type { LeaderConfig } from './types.js';
4
+ export interface SimulationModelConfig {
5
+ commander: string;
6
+ departments: string;
7
+ judge: string;
8
+ director: string;
9
+ agentReactions?: string;
10
+ }
11
+ export type LlmProvider = 'openai' | 'anthropic';
12
+ export interface StartingResources {
13
+ foodMonthsReserve: number;
14
+ waterLitersPerDay: number;
15
+ powerKw: number;
16
+ morale: number;
17
+ pressurizedVolumeM3: number;
18
+ lifeSupportCapacity: number;
19
+ infrastructureModules: number;
20
+ scienceOutput: number;
21
+ }
22
+ export interface StartingPolitics {
23
+ earthDependencyPct: number;
24
+ }
25
+ export interface SimulationExecutionConfig {
26
+ commanderMaxSteps: number;
27
+ departmentMaxSteps: number;
28
+ sandboxTimeoutMs: number;
29
+ sandboxMemoryMB: number;
30
+ }
31
+ export interface SimulationSetupPayload {
32
+ leaders: LeaderConfig[];
33
+ provider?: LlmProvider;
34
+ turns?: number;
35
+ seed?: number;
36
+ startYear?: number;
37
+ population?: number;
38
+ liveSearch?: boolean;
39
+ activeDepartments?: Department[];
40
+ customEvents?: Array<{
41
+ turn: number;
42
+ title: string;
43
+ description: string;
44
+ }>;
45
+ keyPersonnel?: KeyPersonnel[];
46
+ startingResources?: Partial<{
47
+ food: number;
48
+ water: number;
49
+ power: number;
50
+ morale: number;
51
+ pressurizedVolumeM3: number;
52
+ lifeSupportCapacity: number;
53
+ infrastructureModules: number;
54
+ scienceOutput: number;
55
+ }>;
56
+ startingPolitics?: Partial<StartingPolitics>;
57
+ execution?: Partial<SimulationExecutionConfig>;
58
+ models?: Partial<SimulationModelConfig>;
59
+ apiKey?: string;
60
+ anthropicKey?: string;
61
+ serperKey?: string;
62
+ firecrawlKey?: string;
63
+ tavilyKey?: string;
64
+ cohereKey?: string;
65
+ }
66
+ export interface NormalizedSimulationConfig {
67
+ leaders: LeaderConfig[];
68
+ provider: LlmProvider;
69
+ turns: number;
70
+ seed: number;
71
+ startYear: number;
72
+ initialPopulation: number;
73
+ liveSearch: boolean;
74
+ activeDepartments: Department[];
75
+ customEvents: Array<{
76
+ turn: number;
77
+ title: string;
78
+ description: string;
79
+ }>;
80
+ keyPersonnel: KeyPersonnel[];
81
+ startingResources: StartingResources;
82
+ startingPolitics: StartingPolitics;
83
+ execution: SimulationExecutionConfig;
84
+ models: SimulationModelConfig;
85
+ apiKey?: string;
86
+ anthropicKey?: string;
87
+ serperKey?: string;
88
+ firecrawlKey?: string;
89
+ tavilyKey?: string;
90
+ cohereKey?: string;
91
+ }
92
+ export declare const DEFAULT_KEY_PERSONNEL: KeyPersonnel[];
93
+ export declare const DEFAULT_MODELS: Record<LlmProvider, SimulationModelConfig>;
94
+ export declare const DEFAULT_EXECUTION: SimulationExecutionConfig;
95
+ export declare function inferProviderFromModel(model?: string): LlmProvider | undefined;
96
+ export declare function resolveSimulationModels(provider: LlmProvider, models?: Partial<SimulationModelConfig>): SimulationModelConfig;
97
+ export declare function normalizeSimulationConfig(input: SimulationSetupPayload): NormalizedSimulationConfig;
98
+ //# sourceMappingURL=sim-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-config.d.ts","sourceRoot":"","sources":["../../src/cli/sim-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,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B,sBAAsB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAK9E;AAED,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,WAAW,EACrB,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,GACtC,qBAAqB,CAgBvB;AA+BD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,sBAAsB,GAAG,0BAA0B,CAmDnG"}
@@ -0,0 +1,123 @@
1
+ export const DEFAULT_KEY_PERSONNEL = [
2
+ { name: 'Dr. Yuki Tanaka', department: 'medical', role: 'Chief Medical Officer', specialization: 'Radiation Medicine', age: 38, featured: true },
3
+ { name: 'Erik Lindqvist', department: 'engineering', role: 'Chief Engineer', specialization: 'Structural Engineering', age: 45, featured: true },
4
+ { name: 'Amara Osei', department: 'agriculture', role: 'Head of Agriculture', specialization: 'Hydroponics', age: 34, featured: true },
5
+ { name: 'Dr. Priya Singh', department: 'psychology', role: 'Colony Psychologist', specialization: 'Clinical Psychology', age: 41, featured: true },
6
+ { name: 'Carlos Fernandez', department: 'science', role: 'Chief Scientist', specialization: 'Geology', age: 50, featured: true },
7
+ ];
8
+ export const DEFAULT_MODELS = {
9
+ openai: {
10
+ commander: 'gpt-5.4',
11
+ departments: 'gpt-5.4-mini',
12
+ judge: 'gpt-5.4',
13
+ director: 'gpt-5.4',
14
+ },
15
+ anthropic: {
16
+ commander: 'claude-sonnet-4-6',
17
+ departments: 'claude-haiku-4-5-20251001',
18
+ judge: 'claude-sonnet-4-6',
19
+ director: 'claude-sonnet-4-6',
20
+ },
21
+ };
22
+ export const DEFAULT_EXECUTION = {
23
+ commanderMaxSteps: 5,
24
+ departmentMaxSteps: 8,
25
+ sandboxTimeoutMs: 10000,
26
+ sandboxMemoryMB: 128,
27
+ };
28
+ const DEFAULT_ACTIVE_DEPARTMENTS = ['medical', 'engineering', 'agriculture', 'psychology', 'governance'];
29
+ export function inferProviderFromModel(model) {
30
+ if (!model)
31
+ return undefined;
32
+ if (model.startsWith('claude-'))
33
+ return 'anthropic';
34
+ if (model.startsWith('gpt-') || model.startsWith('o'))
35
+ return 'openai';
36
+ return undefined;
37
+ }
38
+ export function resolveSimulationModels(provider, models) {
39
+ const defaults = DEFAULT_MODELS[provider];
40
+ const normalizeModel = (requested, fallback) => {
41
+ if (!requested)
42
+ return fallback;
43
+ return inferProviderFromModel(requested) === provider ? requested : fallback;
44
+ };
45
+ return {
46
+ commander: normalizeModel(models?.commander, defaults.commander),
47
+ departments: normalizeModel(models?.departments, defaults.departments),
48
+ judge: normalizeModel(models?.judge, defaults.judge),
49
+ director: normalizeModel(models?.director ?? models?.commander, defaults.director),
50
+ };
51
+ }
52
+ function normalizeCustomEvents(input) {
53
+ return (input ?? [])
54
+ .filter((event) => !!event && Number.isFinite(event.turn) && event.turn > 0 && !!event.title?.trim())
55
+ .map(event => ({
56
+ turn: Math.trunc(event.turn),
57
+ title: event.title.trim(),
58
+ description: event.description?.trim() ?? '',
59
+ }))
60
+ .sort((a, b) => a.turn - b.turn);
61
+ }
62
+ function normalizeActiveDepartments(input) {
63
+ if (!Array.isArray(input) || input.length === 0) {
64
+ return [...DEFAULT_ACTIVE_DEPARTMENTS];
65
+ }
66
+ const requested = input;
67
+ const active = new Set(['medical', 'engineering']);
68
+ for (const dept of requested) {
69
+ if (DEFAULT_ACTIVE_DEPARTMENTS.includes(dept))
70
+ active.add(dept);
71
+ }
72
+ return DEFAULT_ACTIVE_DEPARTMENTS.filter(dept => active.has(dept));
73
+ }
74
+ export function normalizeSimulationConfig(input) {
75
+ if (!Array.isArray(input.leaders) || input.leaders.length < 2) {
76
+ throw new Error('Two leaders required');
77
+ }
78
+ const inferredProvider = input.provider ??
79
+ inferProviderFromModel(input.models?.commander) ??
80
+ inferProviderFromModel(input.models?.departments) ??
81
+ inferProviderFromModel(input.models?.judge) ??
82
+ 'openai';
83
+ const startYear = input.startYear ?? 2035;
84
+ return {
85
+ leaders: input.leaders,
86
+ provider: inferredProvider,
87
+ turns: input.turns ?? 12,
88
+ seed: input.seed ?? 950,
89
+ startYear,
90
+ initialPopulation: input.population ?? 100,
91
+ liveSearch: input.liveSearch ?? false,
92
+ activeDepartments: normalizeActiveDepartments(input.activeDepartments),
93
+ customEvents: normalizeCustomEvents(input.customEvents),
94
+ keyPersonnel: input.keyPersonnel?.length ? input.keyPersonnel : DEFAULT_KEY_PERSONNEL,
95
+ startingResources: {
96
+ foodMonthsReserve: input.startingResources?.food ?? 18,
97
+ waterLitersPerDay: input.startingResources?.water ?? 800,
98
+ powerKw: input.startingResources?.power ?? 400,
99
+ morale: (input.startingResources?.morale ?? 85) / 100,
100
+ pressurizedVolumeM3: input.startingResources?.pressurizedVolumeM3 ?? 3000,
101
+ lifeSupportCapacity: input.startingResources?.lifeSupportCapacity ?? 120,
102
+ infrastructureModules: input.startingResources?.infrastructureModules ?? 3,
103
+ scienceOutput: input.startingResources?.scienceOutput ?? 0,
104
+ },
105
+ startingPolitics: {
106
+ earthDependencyPct: input.startingPolitics?.earthDependencyPct ?? 95,
107
+ },
108
+ execution: {
109
+ commanderMaxSteps: input.execution?.commanderMaxSteps ?? DEFAULT_EXECUTION.commanderMaxSteps,
110
+ departmentMaxSteps: input.execution?.departmentMaxSteps ?? DEFAULT_EXECUTION.departmentMaxSteps,
111
+ sandboxTimeoutMs: input.execution?.sandboxTimeoutMs ?? DEFAULT_EXECUTION.sandboxTimeoutMs,
112
+ sandboxMemoryMB: input.execution?.sandboxMemoryMB ?? DEFAULT_EXECUTION.sandboxMemoryMB,
113
+ },
114
+ models: resolveSimulationModels(inferredProvider, input.models),
115
+ apiKey: input.apiKey,
116
+ anthropicKey: input.anthropicKey,
117
+ serperKey: input.serperKey,
118
+ firecrawlKey: input.firecrawlKey,
119
+ tavilyKey: input.tavilyKey,
120
+ cohereKey: input.cohereKey,
121
+ };
122
+ }
123
+ //# sourceMappingURL=sim-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-config.js","sourceRoot":"","sources":["../../src/c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