@zergai/ztc 0.26.6-dev.202611240947 → 0.27.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/README.md +629 -167
  2. package/RUST_THIRD_PARTY_LICENSES.txt +5 -5
  3. package/bin/zmux-darwin-arm64 +0 -0
  4. package/bin/zmux-linux-x64 +0 -0
  5. package/bin/ztc-audio-darwin-arm64 +0 -0
  6. package/bin/ztc-capture-darwin-arm64 +0 -0
  7. package/bin/ztc-computer-darwin-arm64 +0 -0
  8. package/bin/ztc-llm-darwin-arm64 +0 -0
  9. package/bin/ztc-tts-darwin-arm64 +0 -0
  10. package/bin/ztc-tui-darwin-arm64 +0 -0
  11. package/bin/ztc-tui-linux-x64 +0 -0
  12. package/bin/zterm-darwin-arm64 +2 -2
  13. package/dist/App.js +6 -1
  14. package/dist/agent/agent.d.ts +21 -15
  15. package/dist/agent/agent.js +389 -163
  16. package/dist/agent/backends/codex_app_server.d.ts +7 -1
  17. package/dist/agent/backends/codex_app_server.js +11 -1
  18. package/dist/agent/backends/gemini.js +22 -8
  19. package/dist/agent/commands/batch.js +8 -0
  20. package/dist/agent/commands/config.js +10 -0
  21. package/dist/agent/commands/environment.js +5 -5
  22. package/dist/agent/commands/goal.d.ts +1 -0
  23. package/dist/agent/commands/goal.js +2 -1
  24. package/dist/agent/commands/index.js +2 -1
  25. package/dist/agent/commands/manifest.js +4 -0
  26. package/dist/agent/commands/optimize.js +5 -2
  27. package/dist/agent/commands/pane_cli.d.ts +29 -0
  28. package/dist/agent/commands/pane_cli.js +303 -0
  29. package/dist/agent/commands/settings.js +13 -3
  30. package/dist/agent/commands/shannon.js +8 -0
  31. package/dist/agent/commands/update.js +15 -3
  32. package/dist/agent/commands/zerg.js +31 -1
  33. package/dist/agent/commands/ztc_pane.js +3 -1
  34. package/dist/agent/factory.d.ts +4 -0
  35. package/dist/agent/factory.js +11 -1
  36. package/dist/agent/loop_policy.d.ts +42 -5
  37. package/dist/agent/loop_policy.js +206 -3
  38. package/dist/agent/runtime/command_jobs.d.ts +5 -0
  39. package/dist/agent/runtime/command_jobs.js +241 -31
  40. package/dist/agent/runtime/command_wait.d.ts +2 -0
  41. package/dist/agent/runtime/command_wait.js +1 -0
  42. package/dist/agent/runtime/done_report.d.ts +18 -0
  43. package/dist/agent/runtime/done_report.js +130 -0
  44. package/dist/agent/runtime/execution_context.js +4 -1
  45. package/dist/agent/runtime/failure_cause.d.ts +2 -0
  46. package/dist/agent/runtime/failure_cause.js +35 -0
  47. package/dist/agent/runtime/policy.d.ts +14 -2
  48. package/dist/agent/runtime/policy.js +104 -12
  49. package/dist/agent/runtime/quiet_job.d.ts +18 -0
  50. package/dist/agent/runtime/quiet_job.js +48 -0
  51. package/dist/agent/runtime/recovery.d.ts +1 -5
  52. package/dist/agent/runtime/recovery.js +2 -44
  53. package/dist/agent/runtime/tool_runtime.d.ts +1 -0
  54. package/dist/agent/runtime/tool_runtime.js +2 -0
  55. package/dist/agent/subagent.js +6 -1
  56. package/dist/agent/tools/deferred.js +1 -0
  57. package/dist/agent/tools/index.d.ts +2 -0
  58. package/dist/agent/tools/index.js +1 -0
  59. package/dist/agent/tools/outcome.d.ts +15 -0
  60. package/dist/agent/tools/outcome.js +107 -0
  61. package/dist/agent/tools/pane.d.ts +2 -1
  62. package/dist/agent/tools/pane.js +21 -3
  63. package/dist/agent/tools/registry.js +2 -0
  64. package/dist/agent/tools/shell.d.ts +1 -0
  65. package/dist/agent/tools/shell.js +128 -17
  66. package/dist/agent/tools/sim_domain_tools.js +4 -2
  67. package/dist/agent/tools/supervision.js +4 -2
  68. package/dist/agent/tools/types.d.ts +3 -0
  69. package/dist/app/command_context.js +5 -9
  70. package/dist/app/conversation_compaction.d.ts +4 -2
  71. package/dist/app/conversation_compaction.js +16 -5
  72. package/dist/app/headless_shell_mode.d.ts +14 -0
  73. package/dist/app/headless_shell_mode.js +7 -0
  74. package/dist/app/hosted_resident.d.ts +356 -0
  75. package/dist/app/hosted_resident.js +677 -0
  76. package/dist/app/restart.js +11 -2
  77. package/dist/app/session_manager.d.ts +5 -0
  78. package/dist/app/session_manager.js +21 -6
  79. package/dist/app/session_messages.js +6 -6
  80. package/dist/app/workspace_layout_controller.js +7 -0
  81. package/dist/batch/worktree.d.ts +10 -0
  82. package/dist/batch/worktree.js +15 -0
  83. package/dist/bench/registry.js +4 -2
  84. package/dist/cli_args.js +1 -1
  85. package/dist/cli_main.js +80 -10
  86. package/dist/cli_ratatui.d.ts +75 -0
  87. package/dist/cli_ratatui.js +485 -84
  88. package/dist/components/InputArea.js +4 -4
  89. package/dist/config/execution.d.ts +10 -0
  90. package/dist/config/execution.js +10 -0
  91. package/dist/config/hosted_runtime.d.ts +4 -1
  92. package/dist/config/hosted_runtime.js +4 -1
  93. package/dist/config/permission_pin.d.ts +34 -2
  94. package/dist/config/permission_pin.js +52 -2
  95. package/dist/config/person_command_policy.d.ts +38 -0
  96. package/dist/config/person_command_policy.js +11 -0
  97. package/dist/config/profiles.d.ts +21 -0
  98. package/dist/config/profiles.js +56 -2
  99. package/dist/config/types.d.ts +4 -1
  100. package/dist/config.js +34 -19
  101. package/dist/desktop/daily/codex_exec_adapter.js +7 -2
  102. package/dist/desktop/daily/desktop_wiring.d.ts +7 -1
  103. package/dist/desktop/daily/desktop_wiring.js +11 -3
  104. package/dist/desktop/daily/recipes.js +20 -4
  105. package/dist/desktop/health.d.ts +24 -0
  106. package/dist/desktop/health.js +151 -0
  107. package/dist/desktop/native_dialogs.d.ts +37 -0
  108. package/dist/desktop/native_dialogs.js +105 -0
  109. package/dist/diagnostics/session_export.d.ts +1 -0
  110. package/dist/diagnostics/session_export.js +28 -0
  111. package/dist/embedded/registry.js +4 -2
  112. package/dist/emulation/tool_adapters.js +9 -4
  113. package/dist/emulation/ztc_addendum.js +3 -0
  114. package/dist/headless.d.ts +11 -4
  115. package/dist/headless.js +99 -34
  116. package/dist/headless_approval.d.ts +6 -0
  117. package/dist/headless_cli.js +1 -1
  118. package/dist/hooks/runner.js +7 -6
  119. package/dist/library.d.ts +4 -0
  120. package/dist/library.js +3 -0
  121. package/dist/mcp/client.js +3 -3
  122. package/dist/modes/registry.js +13 -4
  123. package/dist/onboarding/setup_environment.js +13 -1
  124. package/dist/optimize/adapters/kernelbench.js +88 -10
  125. package/dist/optimize/adapters/types.d.ts +5 -0
  126. package/dist/optimize/executor.js +21 -0
  127. package/dist/panes/cli_install.d.ts +54 -0
  128. package/dist/panes/cli_install.js +157 -0
  129. package/dist/panes/model_catalog.js +3 -0
  130. package/dist/panes/new_pane_choices.d.ts +6 -2
  131. package/dist/panes/new_pane_choices.js +24 -12
  132. package/dist/panes/pane_cli_launch.d.ts +50 -0
  133. package/dist/panes/pane_cli_launch.js +124 -0
  134. package/dist/panes/pane_clis.d.ts +171 -0
  135. package/dist/panes/pane_clis.js +325 -0
  136. package/dist/panes/person_only_panes.d.ts +45 -0
  137. package/dist/panes/person_only_panes.js +117 -0
  138. package/dist/plugin/simulation_living.js +0 -2
  139. package/dist/plugin/simulation_living_engine.d.ts +1 -0
  140. package/dist/plugin/simulation_living_engine.js +1 -0
  141. package/dist/plugin/simulation_living_labels.d.ts +3 -0
  142. package/dist/plugin/simulation_living_labels.js +2 -0
  143. package/dist/router_auth.js +12 -1
  144. package/dist/session.js +26 -1
  145. package/dist/simulation/art/gemini_image.js +11 -5
  146. package/dist/simulation/domains/loader.js +25 -3
  147. package/dist/simulation/living/cold.d.ts +23 -0
  148. package/dist/simulation/living/cold.js +41 -0
  149. package/dist/simulation/living/context.d.ts +591 -1283
  150. package/dist/simulation/living/context.js +378 -244
  151. package/dist/simulation/living/contradictions.d.ts +14 -0
  152. package/dist/simulation/living/contradictions.js +282 -0
  153. package/dist/simulation/living/core/ids.d.ts +53 -0
  154. package/dist/simulation/living/core/ids.js +39 -0
  155. package/dist/simulation/living/core/kind.d.ts +20 -0
  156. package/dist/simulation/living/core/kind.js +15 -0
  157. package/dist/simulation/living/core/laws.d.ts +179 -0
  158. package/dist/simulation/living/core/laws.js +184 -0
  159. package/dist/simulation/living/core/ops.d.ts +257 -0
  160. package/dist/simulation/living/core/ops.js +34 -0
  161. package/dist/simulation/living/definer.d.ts +17 -1
  162. package/dist/simulation/living/definer.js +130 -51
  163. package/dist/simulation/living/definition.d.ts +174 -65
  164. package/dist/simulation/living/definition.js +287 -180
  165. package/dist/simulation/living/director.d.ts +80 -0
  166. package/dist/simulation/living/director.js +363 -0
  167. package/dist/simulation/living/frame.d.ts +108 -21
  168. package/dist/simulation/living/frame.js +111 -66
  169. package/dist/simulation/living/identifiers.d.ts +0 -1
  170. package/dist/simulation/living/identifiers.js +0 -3
  171. package/dist/simulation/living/index.d.ts +18 -9
  172. package/dist/simulation/living/index.js +18 -9
  173. package/dist/simulation/living/inference.d.ts +92 -50
  174. package/dist/simulation/living/inference.js +319 -175
  175. package/dist/simulation/living/knowledge.d.ts +28 -0
  176. package/dist/simulation/living/knowledge.js +73 -0
  177. package/dist/simulation/living/library.json +1177 -0
  178. package/dist/simulation/living/mechanics.d.ts +31 -34
  179. package/dist/simulation/living/mechanics.js +222 -138
  180. package/dist/simulation/living/model-input.d.ts +6 -3
  181. package/dist/simulation/living/model-input.js +18 -26
  182. package/dist/simulation/living/open-world.d.ts +74 -94
  183. package/dist/simulation/living/open-world.js +151 -30
  184. package/dist/simulation/living/phrases.d.ts +3 -0
  185. package/dist/simulation/living/phrases.js +37 -0
  186. package/dist/simulation/living/phrases.json +560 -0
  187. package/dist/simulation/living/projection.d.ts +316 -2
  188. package/dist/simulation/living/projection.js +50 -2
  189. package/dist/simulation/living/prompts/example-spec.json +11 -0
  190. package/dist/simulation/living/prompts/role-text.json +14 -0
  191. package/dist/simulation/living/prompts.d.ts +5 -0
  192. package/dist/simulation/living/prompts.js +275 -0
  193. package/dist/simulation/living/recall.d.ts +2 -2
  194. package/dist/simulation/living/reduce.d.ts +51 -14
  195. package/dist/simulation/living/reduce.js +941 -579
  196. package/dist/simulation/living/replay.d.ts +5 -4
  197. package/dist/simulation/living/replay.js +10 -9
  198. package/dist/simulation/living/runtime.d.ts +135 -25
  199. package/dist/simulation/living/runtime.js +1641 -583
  200. package/dist/simulation/living/scale.d.ts +96 -0
  201. package/dist/simulation/living/scale.js +124 -0
  202. package/dist/simulation/living/script.d.ts +5 -0
  203. package/dist/simulation/living/script.js +115 -0
  204. package/dist/simulation/living/shared-kinds.d.ts +4 -11
  205. package/dist/simulation/living/shared-kinds.js +11 -81
  206. package/dist/simulation/living/space.d.ts +14 -0
  207. package/dist/simulation/living/space.js +132 -0
  208. package/dist/simulation/living/state.d.ts +100 -0
  209. package/dist/simulation/living/state.js +393 -0
  210. package/dist/simulation/living/types.d.ts +829 -512
  211. package/dist/simulation/living/types.js +162 -187
  212. package/dist/simulation/living/world-rules.d.ts +100 -0
  213. package/dist/simulation/living/world-rules.js +267 -0
  214. package/dist/simulation/plugins/loader.js +11 -0
  215. package/dist/skills/loader.js +4 -0
  216. package/dist/tools.d.ts +1 -0
  217. package/dist/tools.js +1 -0
  218. package/dist/ui/ratatui/headless_pane_manager.d.ts +4 -1
  219. package/dist/ui/ratatui/headless_pane_manager.js +13 -9
  220. package/dist/ui/ratatui/pane_relay.js +29 -0
  221. package/dist/ui/ratatui/pane_type.d.ts +10 -0
  222. package/dist/ui/ratatui/pane_type.js +11 -0
  223. package/dist/ui/ratatui/process.d.ts +30 -0
  224. package/dist/ui/ratatui/process.js +133 -19
  225. package/dist/ui/ratatui/protocol.d.ts +124 -2
  226. package/dist/ui/ratatui/protocol.js +35 -0
  227. package/dist/ui/ratatui/relay_policy.js +3 -0
  228. package/dist/ui/ratatui/ztc_launch_trust.d.ts +2 -1
  229. package/dist/ui/ratatui/ztc_launch_trust.js +8 -1
  230. package/dist/ui/terminal_image.d.ts +12 -0
  231. package/dist/ui/terminal_image.js +21 -1
  232. package/dist/utils/codex_project_trust.d.ts +19 -0
  233. package/dist/utils/codex_project_trust.js +37 -0
  234. package/dist/utils/compaction.js +103 -20
  235. package/dist/utils/git_program_files.d.ts +19 -12
  236. package/dist/utils/git_program_files.js +411 -83
  237. package/dist/utils/host_shell.d.ts +10 -1
  238. package/dist/utils/host_shell.js +14 -1
  239. package/dist/utils/mid_turn_compaction.d.ts +2 -0
  240. package/dist/utils/mid_turn_compaction.js +2 -0
  241. package/dist/utils/models.js +6 -1
  242. package/dist/utils/sandbox.d.ts +109 -8
  243. package/dist/utils/sandbox.js +981 -187
  244. package/dist/utils/shell.d.ts +2 -0
  245. package/dist/utils/shell.js +10 -4
  246. package/dist/utils/subprocess_env.d.ts +47 -11
  247. package/dist/utils/subprocess_env.js +107 -15
  248. package/dist/utils/system_ps.d.ts +8 -0
  249. package/dist/utils/system_ps.js +39 -7
  250. package/dist/utils/unattended_compaction.d.ts +9 -0
  251. package/dist/utils/unattended_compaction.js +13 -0
  252. package/dist/utils/ztc_own_state.d.ts +8 -5
  253. package/dist/utils/ztc_own_state.js +17 -11
  254. package/dist/web/mirror_client.js +1 -0
  255. package/dist/web/mirror_stream.d.ts +50 -6
  256. package/dist/web/mirror_stream.js +160 -15
  257. package/dist/workflows/registry.js +3 -1
  258. package/dist/workspace/controller.js +12 -0
  259. package/dist/workspace_collision.d.ts +3 -0
  260. package/dist/workspace_collision.js +14 -1
  261. package/dist/workspace_session_context.js +2 -1
  262. package/dist/zlm-embed.mjs +3823 -1970
  263. package/node_modules/@zerg/model-contracts/README.md +16 -4
  264. package/node_modules/@zerg/model-contracts/index.js +6 -1
  265. package/npm-shrinkwrap.json +1 -1
  266. package/package.json +42 -24
  267. package/packages/model-contracts/README.md +16 -4
  268. package/packages/model-contracts/index.js +6 -1
@@ -1,15 +1,24 @@
1
- export { modelContextPeople } from './context.js';
2
- export { assertLivingModelCall, LIVING_INPUT_BUDGETS, LIVING_RESPONSE_SCHEMA_BUDGET, MODEL_VIEW_NOTE, modelTextExcerpt } from './model-input.js';
1
+ export { modelContextPeople, knownPlaces, perceivedPlaces, knowsPlace, reachFor } from './context.js';
2
+ export { PERSON_KNOWLEDGE, personKnowledgeSources, type PersonKnowledgeKind, type PersonKnowledgeSource } from './knowledge.js';
3
+ export { assertLivingModelCall, LIVING_INPUT_BUDGETS, LIVING_RESPONSE_SCHEMA_BUDGET, MODEL_EXCERPT_LIMITS, MODEL_VIEW_NOTE, modelTextExcerpt } from './model-input.js';
3
4
  export * from './types.js';
4
- export { defineLivingKind, kindDefinitionResponseSchema, DEFINER_SYSTEM } from './definer.js';
5
- export { kindDefinitionSchema, kindRequestSchema, type LivingKindDefinition } from './open-world.js';
6
- export { definitionSchema, parseLivingWorldDefinition, createLivingState, type LivingWorldDefinition, type LivingWorldDefinitionInput } from './definition.js';
7
- export { applyLivingEvent, clockTargetAt, livingClockLead, peopleAt, witnessesFor, nearbyFor, arrivalFor, travelPath, unansweredSince, TRAVEL_MINUTES_PER_HOP } from './reduce.js';
5
+ export { BOUNDS, boundState, capsBoundaryOf, weigh, digestOf, foldOf, ring, tableRing, sealState, notedShare, type Fold, type Ring, type TableRing } from './state.js';
6
+ export { MemoryColdStore, type ColdRecord, type ColdStore } from './cold.js';
7
+ export { defineLivingKind, reviseLivingKind, kindDefinitionResponseSchema, REVISION_CALLS } from './definer.js';
8
+ export { kindDefinitionSchema, kindRequestSchema, narrowsKindRevision, seriesEntrySchema, idDescription, idSchema, type LivingKindDefinition, type LivingSeriesEntry } from './open-world.js';
9
+ export { definitionSchema, definitionJsonSchema, parseLivingWorldDefinition, parseKindRevision, createLivingState, type LivingWorldDefinition, type LivingWorldDefinitionRaw, type LivingWorldDefinitionInput } from './definition.js';
10
+ export { worldRuleLines, answerReach } from './world-rules.js';
11
+ export { DEFAULT_CALENDAR, calendarSchema, PACING, type LivingCalendar, type PacingKey } from './scale.js';
12
+ export { proseContradictions, unknownNames, type ProseContradiction } from './contradictions.js';
13
+ export { answeredAgain, saidAgain, applyLivingEvent, clockTargetAt, livingClockLead, peopleAt, witnessesFor, nearbyFor, arrivalFor, travelPath, unansweredSince, liveExchange } from './reduce.js';
8
14
  export { recallMemories, recallBeliefs, type RecalledMemory } from './recall.js';
9
- export { LIVING_INFERENCE_LIMITS, GM_EFFECT_KINDS, gmEffectSchema, attemptResponseSchema, scopedAttemptResponseSchema, reactionResponseSchema, scopedReactionResponseSchema, speechImpactResponseSchema, planResponseSchema, scopedPlanResponseSchema, messageReplyResponseSchema, epilogueResponseSchema, type LivingInference, type LivingInferenceCall, type LivingInferenceRole, type GmEffectRecord, } from './inference.js';
10
- export { clockLabel, describeScene, gameMasterAttemptInput, gameMasterWorldInput, characterReactionInput, characterPlanInput, characterMessageReplyInput, epilogueInput, pressingMatters, joinedPlaceSeq, conversationLines, recentLinesBy, GAME_MASTER_SYSTEM, SPEECH_IMPACT_SYSTEM, CHARACTER_REACTION_SYSTEM, CHARACTER_PLAN_SYSTEM, CHARACTER_MESSAGE_SYSTEM, NARRATOR_EPILOGUE_SYSTEM, PRESSING_MINUTES, PRESSING_IMPORTANCE, } from './context.js';
11
- export { startLivingWorld, runLivingCommand, translateGmEffect, livingClockTarget, setLivingClock, tickLivingWorld, livingDueWork, runLivingWork, advanceLivingWorld, carryOnLivingWork, livingWorkIsRoutine, DEFAULT_ACTIVITY_MINUTES, type LivingWorldCell, type LivingWork, MAX_DUE_ITEMS_PER_STEP, MAX_REACTORS, MAX_MODEL_CALLS_PER_COMMAND, SHOCK_IMPORTANCE, SPEECH_MINUTES, MESSAGE_MINUTES, MESSAGE_REPLY_DELAY_MINUTES, IDLE_WAIT_MINUTES, PLAYER_MAX_TEXT_BYTES, type LivingCommand, type LivingStep, type LivingAuditRecord, } from './runtime.js';
15
+ export { LIVING_INFERENCE_LIMITS, LIVING_ANSWER_BUDGET_MS, LIVING_ANSWER_CHARS_PER_TOKEN, LIVING_TRUNCATED_ANSWER_CODE, schemaWorstCaseChars, livingAnswerTokens, livingAnswerWasCutOff, GM_EFFECT_KINDS, gmEffectSchema, attemptResponseSchema, scopedAttemptResponseSchema, reactionResponseSchema, scopedReactionResponseSchema, speechImpactResponseSchema, planResponseSchema, scopedPlanResponseSchema, messageReplyResponseSchema, scopedMessageReplyResponseSchema, epilogueResponseSchema, type LivingInference, type LivingInferenceCall, type LivingInferenceRole, type GmEffectRecord, } from './inference.js';
16
+ export { clockLabel, describeScene, gameMasterAttemptInput, gameMasterWorldInput, characterReactionInput, replyPressureMatches, characterPlanInput, characterMessageReplyInput, epilogueInput, pressingMatters, joinedPlaceSeq, conversationLines, recentLinesBy, memoryBoundToOpenBusiness, memoryIsPressing, ownPapers, openChoices, PRESSING_IMPORTANCE, } from './context.js';
17
+ export { ROLE_IDS, WORLD_PRINCIPLES, roleText, systemFor, type RoleId } from './prompts.js';
18
+ export { startLivingWorld, validateLivingWorldDefinition, runLivingCommand, translateGmEffect, livingClockTarget, setLivingClock, tickLivingWorld, livingDueWork, runLivingWork, advanceLivingWorld, carryOnLivingWork, livingWorkIsRoutine, duePlanCard, parseReaction, reactionProblems, presenceProblems, reactionAnswerProblems, type ReactionProblem, type ReactionProblemFacts, type LivingWorldCell, type LivingWork, MAX_DUE_ITEMS_PER_STEP, MAX_REACTORS, MAX_MODEL_CALLS_PER_COMMAND, SHOCK_IMPORTANCE, PLAYER_MAX_TEXT_BYTES, OBJECTIVE_EFFECT_KINDS, EFFECT_KINDS, EVENT_KINDS, SCHEDULE_KINDS, PLAN_OVERDUE_PACE, planOverdueAfter, changesSomething, type Reaction, type LivingCommand, type LivingStep, type LivingAuditRecord, } from './runtime.js';
12
19
  export { replayLivingWorld, verifyLivingWorld } from './replay.js';
20
+ export { DIRECTOR_STALL_COMMANDS, DIRECTOR_REPEATED_ASKS, directorResponseSchema, directorResponseSchemaFor, directorSignals, directorInput, parseDirectorDevelopment, directorScheduledItem, runDirectorJob, type DirectorTrigger, type DirectorSignals, type DirectorDevelopment, type DirectorHost, } from './director.js';
13
21
  export { makeLivingPlayerFrame, livingPlayerFeed, type LivingPlayerFrame, type LivingFeedItem } from './frame.js';
14
22
  export { blockedActionKinds, blockedByGate, gatesOn } from './mechanics.js';
15
23
  export { sharedKindMap } from './shared-kinds.js';
24
+ export { characterView, ownRecentLines, spokenLines, papersInMindFor, duePlanEntry, nearbyObserved, evidenceOf } from './projection.js';
@@ -1,15 +1,24 @@
1
- export { modelContextPeople } from './context.js';
2
- export { assertLivingModelCall, LIVING_INPUT_BUDGETS, LIVING_RESPONSE_SCHEMA_BUDGET, MODEL_VIEW_NOTE, modelTextExcerpt } from './model-input.js';
1
+ export { modelContextPeople, knownPlaces, perceivedPlaces, knowsPlace, reachFor } from './context.js';
2
+ export { PERSON_KNOWLEDGE, personKnowledgeSources } from './knowledge.js';
3
+ export { assertLivingModelCall, LIVING_INPUT_BUDGETS, LIVING_RESPONSE_SCHEMA_BUDGET, MODEL_EXCERPT_LIMITS, MODEL_VIEW_NOTE, modelTextExcerpt } from './model-input.js';
3
4
  export * from './types.js';
4
- export { defineLivingKind, kindDefinitionResponseSchema, DEFINER_SYSTEM } from './definer.js';
5
- export { kindDefinitionSchema, kindRequestSchema } from './open-world.js';
6
- export { definitionSchema, parseLivingWorldDefinition, createLivingState } from './definition.js';
7
- export { applyLivingEvent, clockTargetAt, livingClockLead, peopleAt, witnessesFor, nearbyFor, arrivalFor, travelPath, unansweredSince, TRAVEL_MINUTES_PER_HOP } from './reduce.js';
5
+ export { BOUNDS, boundState, capsBoundaryOf, weigh, digestOf, foldOf, ring, tableRing, sealState, notedShare } from './state.js';
6
+ export { MemoryColdStore } from './cold.js';
7
+ export { defineLivingKind, reviseLivingKind, kindDefinitionResponseSchema, REVISION_CALLS } from './definer.js';
8
+ export { kindDefinitionSchema, kindRequestSchema, narrowsKindRevision, seriesEntrySchema, idDescription, idSchema } from './open-world.js';
9
+ export { definitionSchema, definitionJsonSchema, parseLivingWorldDefinition, parseKindRevision, createLivingState } from './definition.js';
10
+ export { worldRuleLines, answerReach } from './world-rules.js';
11
+ export { DEFAULT_CALENDAR, calendarSchema, PACING } from './scale.js';
12
+ export { proseContradictions, unknownNames } from './contradictions.js';
13
+ export { answeredAgain, saidAgain, applyLivingEvent, clockTargetAt, livingClockLead, peopleAt, witnessesFor, nearbyFor, arrivalFor, travelPath, unansweredSince, liveExchange } from './reduce.js';
8
14
  export { recallMemories, recallBeliefs } from './recall.js';
9
- export { LIVING_INFERENCE_LIMITS, GM_EFFECT_KINDS, gmEffectSchema, attemptResponseSchema, scopedAttemptResponseSchema, reactionResponseSchema, scopedReactionResponseSchema, speechImpactResponseSchema, planResponseSchema, scopedPlanResponseSchema, messageReplyResponseSchema, epilogueResponseSchema, } from './inference.js';
10
- export { clockLabel, describeScene, gameMasterAttemptInput, gameMasterWorldInput, characterReactionInput, characterPlanInput, characterMessageReplyInput, epilogueInput, pressingMatters, joinedPlaceSeq, conversationLines, recentLinesBy, GAME_MASTER_SYSTEM, SPEECH_IMPACT_SYSTEM, CHARACTER_REACTION_SYSTEM, CHARACTER_PLAN_SYSTEM, CHARACTER_MESSAGE_SYSTEM, NARRATOR_EPILOGUE_SYSTEM, PRESSING_MINUTES, PRESSING_IMPORTANCE, } from './context.js';
11
- export { startLivingWorld, runLivingCommand, translateGmEffect, livingClockTarget, setLivingClock, tickLivingWorld, livingDueWork, runLivingWork, advanceLivingWorld, carryOnLivingWork, livingWorkIsRoutine, DEFAULT_ACTIVITY_MINUTES, MAX_DUE_ITEMS_PER_STEP, MAX_REACTORS, MAX_MODEL_CALLS_PER_COMMAND, SHOCK_IMPORTANCE, SPEECH_MINUTES, MESSAGE_MINUTES, MESSAGE_REPLY_DELAY_MINUTES, IDLE_WAIT_MINUTES, PLAYER_MAX_TEXT_BYTES, } from './runtime.js';
15
+ export { LIVING_INFERENCE_LIMITS, LIVING_ANSWER_BUDGET_MS, LIVING_ANSWER_CHARS_PER_TOKEN, LIVING_TRUNCATED_ANSWER_CODE, schemaWorstCaseChars, livingAnswerTokens, livingAnswerWasCutOff, GM_EFFECT_KINDS, gmEffectSchema, attemptResponseSchema, scopedAttemptResponseSchema, reactionResponseSchema, scopedReactionResponseSchema, speechImpactResponseSchema, planResponseSchema, scopedPlanResponseSchema, messageReplyResponseSchema, scopedMessageReplyResponseSchema, epilogueResponseSchema, } from './inference.js';
16
+ export { clockLabel, describeScene, gameMasterAttemptInput, gameMasterWorldInput, characterReactionInput, replyPressureMatches, characterPlanInput, characterMessageReplyInput, epilogueInput, pressingMatters, joinedPlaceSeq, conversationLines, recentLinesBy, memoryBoundToOpenBusiness, memoryIsPressing, ownPapers, openChoices, PRESSING_IMPORTANCE, } from './context.js';
17
+ export { ROLE_IDS, WORLD_PRINCIPLES, roleText, systemFor } from './prompts.js';
18
+ export { startLivingWorld, validateLivingWorldDefinition, runLivingCommand, translateGmEffect, livingClockTarget, setLivingClock, tickLivingWorld, livingDueWork, runLivingWork, advanceLivingWorld, carryOnLivingWork, livingWorkIsRoutine, duePlanCard, parseReaction, reactionProblems, presenceProblems, reactionAnswerProblems, MAX_DUE_ITEMS_PER_STEP, MAX_REACTORS, MAX_MODEL_CALLS_PER_COMMAND, SHOCK_IMPORTANCE, PLAYER_MAX_TEXT_BYTES, OBJECTIVE_EFFECT_KINDS, EFFECT_KINDS, EVENT_KINDS, SCHEDULE_KINDS, PLAN_OVERDUE_PACE, planOverdueAfter, changesSomething, } from './runtime.js';
12
19
  export { replayLivingWorld, verifyLivingWorld } from './replay.js';
20
+ export { DIRECTOR_STALL_COMMANDS, DIRECTOR_REPEATED_ASKS, directorResponseSchema, directorResponseSchemaFor, directorSignals, directorInput, parseDirectorDevelopment, directorScheduledItem, runDirectorJob, } from './director.js';
13
21
  export { makeLivingPlayerFrame, livingPlayerFeed } from './frame.js';
14
22
  export { blockedActionKinds, blockedByGate, gatesOn } from './mechanics.js';
15
23
  export { sharedKindMap } from './shared-kinds.js';
24
+ export { characterView, ownRecentLines, spokenLines, papersInMindFor, duePlanEntry, nearbyObserved, evidenceOf } from './projection.js';
@@ -1,4 +1,4 @@
1
- export type LivingInferenceRole = 'game-master' | 'character' | 'narrator' | 'definer';
1
+ export type LivingInferenceRole = 'game-master' | 'character' | 'narrator' | 'definer' | 'director';
2
2
  export type LivingInferenceCall = {
3
3
  role: LivingInferenceRole;
4
4
  actorId?: string | null;
@@ -9,8 +9,9 @@ export type LivingInferenceCall = {
9
9
  kind: string;
10
10
  id: string;
11
11
  evidenceEventSeq: number;
12
+ evidenceKind?: string;
12
13
  }[];
13
- phase: 'attempt' | 'world' | 'speech-impact' | 'reaction' | 'reply' | 'plan' | 'epilogue' | 'message-reply' | 'define';
14
+ phase: 'attempt' | 'world' | 'speech-impact' | 'reaction' | 'reply' | 'plan' | 'epilogue' | 'message-reply' | 'define' | 'revise' | 'director';
14
15
  system: string;
15
16
  input: Readonly<Record<string, unknown>>;
16
17
  responseSchema: Readonly<Record<string, unknown>>;
@@ -18,50 +19,23 @@ export type LivingInferenceCall = {
18
19
  timeoutMs: number;
19
20
  reserveRetry?: () => boolean;
20
21
  stillWanted?: () => boolean;
21
- rebuild?: () => Pick<LivingInferenceCall, 'input' | 'responseSchema' | 'inputRefs' | 'revision'>;
22
+ rebuild?: () => Pick<LivingInferenceCall, 'input' | 'responseSchema' | 'inputRefs' | 'revision' | 'maxTokens'> & {
23
+ system?: string;
24
+ };
22
25
  };
23
26
  export interface LivingInference {
24
27
  complete(call: LivingInferenceCall): Promise<unknown>;
25
28
  }
26
- export declare const LIVING_INFERENCE_LIMITS: Readonly<{
27
- attempt: {
28
- maxTokens: number;
29
- timeoutMs: number;
30
- };
31
- world: {
32
- maxTokens: number;
33
- timeoutMs: number;
34
- };
35
- 'speech-impact': {
36
- maxTokens: number;
37
- timeoutMs: number;
38
- };
39
- reaction: {
40
- maxTokens: number;
41
- timeoutMs: number;
42
- };
43
- reply: {
44
- maxTokens: number;
45
- timeoutMs: number;
46
- };
47
- plan: {
48
- maxTokens: number;
49
- timeoutMs: number;
50
- };
51
- 'message-reply': {
52
- maxTokens: number;
53
- timeoutMs: number;
54
- };
55
- epilogue: {
56
- maxTokens: number;
57
- timeoutMs: number;
58
- };
59
- define: {
60
- maxTokens: number;
61
- timeoutMs: number;
62
- };
63
- }>;
64
- export declare const GM_EFFECT_KINDS: readonly ["move", "take", "drop", "object.update", "object.create", "place.condition", "place.create", "person.create", "money", "transfer", "relationship", "belief", "commitment", "goal", "mood", "person.condition", "hold", "role", "schedule", "fact", "tension.update", "tension.create", "incapacitate", "message", "entity.create", "property.set", "relation.set", "request.open", "person.leave", "person.away", "ballot"];
29
+ export declare const LIVING_ANSWER_CHARS_PER_TOKEN = 2;
30
+ export declare const LIVING_TRUNCATED_ANSWER_CODE = "output-truncated";
31
+ type SchemaNode = Readonly<Record<string, unknown>>;
32
+ export declare function schemaWorstCaseChars(schema: SchemaNode): number;
33
+ export declare function livingAnswerTokens(schema: SchemaNode): number;
34
+ export declare function livingAnswerWasCutOff(completion: {
35
+ finishReason?: string | null;
36
+ completionTokens?: number | null;
37
+ } | undefined, maxTokens: number): boolean;
38
+ export declare const GM_EFFECT_KINDS: readonly ["move", "take", "drop", "object.update", "object.create", "place.condition", "place.create", "person.create", "shift", "relationship", "belief", "commitment", "goal", "mood", "person.condition", "hold", "role", "schedule", "fact", "tension.update", "tension.create", "incapacitate", "message", "entity.create", "property.set", "cell.add", "relation.set", "request.open", "person.leave", "person.offstage"];
65
39
  export declare function kindFirst(container: string): (arm: {
66
40
  required: readonly string[];
67
41
  properties: Record<string, unknown>;
@@ -87,6 +61,7 @@ export type GmEffectRecord = {
87
61
  condition: string | null;
88
62
  role?: string | null;
89
63
  amount: number | null;
64
+ slot?: string | null;
90
65
  trust: number | null;
91
66
  warmth: number | null;
92
67
  minutes: number | null;
@@ -102,16 +77,17 @@ export type GmEffectRecord = {
102
77
  value?: boolean | number | string | null;
103
78
  initialProperties?: Record<string, boolean | number | string>;
104
79
  choice?: 'yes' | 'no' | 'abstain' | null;
80
+ slotId?: string | null;
81
+ option?: string | null;
105
82
  };
106
- export declare const SIGNAL_SENSES: readonly ["sound", "voices", "shouting", "scream", "crash", "bang", "alarm", "machinery", "footsteps", "music", "loudspeaker", "sight", "light", "smoke", "burning", "smell"];
107
- export declare const SIGNAL_NOTICES: Readonly<Record<typeof SIGNAL_SENSES[number], string>>;
108
83
  export declare const attemptResponseSchema: {
109
84
  readonly type: "object";
110
85
  readonly additionalProperties: false;
111
- readonly required: readonly ["narration", "record", "observed", "perceivedBy", "visibleObjectIds", "visibleTensionIds", "outcome", "minutes", "importance", "reach", "signalChannel", "actionKind", "reactorIds", "settledTensionId", "settlement", "newTension", "stateKindFit", "stateNewKind", "stateUpdates", "thingIds"];
86
+ readonly required: readonly ["narration", "record", "reason", "observed", "perceivedBy", "visibleObjectIds", "visibleTensionIds", "outcome", "minutes", "importance", "reach", "signalChannel", "actionKind", "reactorIds", "settledTensionId", "settlement", "newTension", "stateKindFit", "stateNewKind", "stateNoted", "stateUpdates", "thingIds", "contactIds"];
112
87
  readonly properties: {
113
88
  readonly narration: Record<string, unknown>;
114
89
  readonly record: Record<string, unknown>;
90
+ readonly reason: Record<string, unknown>;
115
91
  readonly observed: Record<string, unknown>;
116
92
  readonly perceivedBy: Record<string, unknown>;
117
93
  readonly visibleObjectIds: Record<string, unknown>;
@@ -128,19 +104,31 @@ export declare const attemptResponseSchema: {
128
104
  readonly newTension: Record<string, unknown>;
129
105
  readonly stateKindFit: Record<string, unknown>;
130
106
  readonly stateNewKind: Record<string, unknown>;
107
+ readonly stateNoted: Record<string, unknown>;
131
108
  readonly stateUpdates: Record<string, unknown>;
132
109
  readonly thingIds: Record<string, unknown>;
110
+ readonly contactIds: Record<string, unknown>;
133
111
  };
134
112
  };
135
113
  export declare function scopedAttemptResponseSchema(input: Readonly<Record<string, unknown>>): Readonly<Record<string, unknown>>;
114
+ export declare function ruleActionKinds(kinds: readonly {
115
+ laws?: readonly {
116
+ kind: string;
117
+ on: unknown;
118
+ do?: readonly {
119
+ op: string;
120
+ }[];
121
+ }[];
122
+ }[]): string[];
136
123
  export declare const reactionResponseSchema: {
137
124
  readonly type: "object";
138
125
  readonly additionalProperties: false;
139
- readonly required: readonly ["say", "act", "toIds", "mood", "weight", "leaveToPlaceId", "trust", "warmth", "relationshipNote", "belief", "commitment", "newGoal", "goalDone", "plan", "tell", "suggestedReplies", "endConversation", "request", "requestDecision", "answered", "stance"];
126
+ readonly required: readonly ["say", "act", "toIds", "mood", "weight", "leaveToPlaceId", "trust", "warmth", "relationshipNote", "belief", "commitment", "newGoal", "goalDone", "plan", "tell", "suggestedReplies", "endConversation", "request", "requestDecision", "commitmentDecision", "answered", "stance"];
140
127
  readonly properties: {
141
128
  readonly say: Record<string, unknown>;
142
129
  readonly request: Record<string, unknown>;
143
130
  readonly requestDecision: Record<string, unknown>;
131
+ readonly commitmentDecision: Record<string, unknown>;
144
132
  readonly answered: Record<string, unknown>;
145
133
  readonly act: Record<string, unknown>;
146
134
  readonly toIds: Record<string, unknown>;
@@ -162,8 +150,8 @@ export declare const reactionResponseSchema: {
162
150
  };
163
151
  };
164
152
  export declare const ENGINE_ACTION_KINDS: ReadonlySet<string>;
165
- export declare function scopedReactionResponseSchema(input: Readonly<Record<string, unknown>>): Readonly<Record<string, unknown>>;
166
- export declare function scopedPlanResponseSchema(input: Readonly<Record<string, unknown>>): Readonly<Record<string, unknown>>;
153
+ export declare function scopedReactionResponseSchema(input: Readonly<Record<string, unknown>>, engine?: number): Readonly<Record<string, unknown>>;
154
+ export declare function scopedPlanResponseSchema(input: Readonly<Record<string, unknown>>, engine?: number, restAction?: string | null): Readonly<Record<string, unknown>>;
167
155
  export declare const speechImpactResponseSchema: {
168
156
  readonly type: "object";
169
157
  readonly additionalProperties: false;
@@ -173,20 +161,24 @@ export declare const speechImpactResponseSchema: {
173
161
  readonly pressure: Record<string, unknown>;
174
162
  readonly loud: Record<string, unknown>;
175
163
  readonly addressedIds: Record<string, unknown>;
164
+ readonly mentionedIds: Record<string, unknown>;
176
165
  readonly aboutIds: Record<string, unknown>;
166
+ readonly act: Record<string, unknown>;
177
167
  };
178
168
  };
179
169
  export declare function scopedSpeechImpactResponseSchema(presentIds: readonly string[], thingIds?: readonly string[]): Readonly<Record<string, unknown>>;
180
170
  export declare const planResponseSchema: {
181
171
  readonly type: "object";
182
172
  readonly additionalProperties: false;
183
- readonly required: readonly ["action", "placeId", "targetId", "text", "mood", "nextPlan", "request", "stance"];
173
+ readonly required: readonly ["action", "placeId", "targetId", "text", "mood", "nextPlan", "request", "requestDecision", "commitmentDecision", "stance"];
184
174
  readonly properties: {
185
175
  readonly action: Record<string, unknown>;
186
176
  readonly placeId: Record<string, unknown>;
187
177
  readonly targetId: Record<string, unknown>;
188
178
  readonly text: Record<string, unknown>;
189
179
  readonly request: Record<string, unknown>;
180
+ readonly requestDecision: Record<string, unknown>;
181
+ readonly commitmentDecision: Record<string, unknown>;
190
182
  readonly mood: Record<string, unknown>;
191
183
  readonly nextPlan: Record<string, unknown>;
192
184
  readonly stance: Record<string, unknown>;
@@ -195,7 +187,7 @@ export declare const planResponseSchema: {
195
187
  export declare const messageReplyResponseSchema: {
196
188
  readonly type: "object";
197
189
  readonly additionalProperties: false;
198
- readonly required: readonly ["reply", "mood", "trust", "warmth", "belief", "plan"];
190
+ readonly required: readonly ["reply", "mood", "trust", "warmth", "belief", "plan", "requestDecision"];
199
191
  readonly properties: {
200
192
  readonly reply: Record<string, unknown>;
201
193
  readonly mood: Record<string, unknown>;
@@ -203,8 +195,10 @@ export declare const messageReplyResponseSchema: {
203
195
  readonly warmth: Record<string, unknown>;
204
196
  readonly belief: Record<string, unknown>;
205
197
  readonly plan: Record<string, unknown>;
198
+ readonly requestDecision: Record<string, unknown>;
206
199
  };
207
200
  };
201
+ export declare function scopedMessageReplyResponseSchema(input: Readonly<Record<string, unknown>>, engine?: number): Readonly<Record<string, unknown>>;
208
202
  export declare const epilogueResponseSchema: {
209
203
  readonly type: "object";
210
204
  readonly additionalProperties: false;
@@ -217,3 +211,51 @@ export declare const epilogueResponseSchema: {
217
211
  readonly closing: Record<string, unknown>;
218
212
  };
219
213
  };
214
+ export declare const LIVING_INFERENCE_LIMITS: Readonly<{
215
+ attempt: {
216
+ maxTokens: number;
217
+ timeoutMs: number;
218
+ };
219
+ world: {
220
+ maxTokens: number;
221
+ timeoutMs: number;
222
+ };
223
+ 'speech-impact': {
224
+ maxTokens: number;
225
+ timeoutMs: number;
226
+ };
227
+ reaction: {
228
+ maxTokens: number;
229
+ timeoutMs: number;
230
+ };
231
+ reply: {
232
+ maxTokens: number;
233
+ timeoutMs: number;
234
+ };
235
+ plan: {
236
+ maxTokens: number;
237
+ timeoutMs: number;
238
+ };
239
+ 'message-reply': {
240
+ maxTokens: number;
241
+ timeoutMs: number;
242
+ };
243
+ epilogue: {
244
+ maxTokens: number;
245
+ timeoutMs: number;
246
+ };
247
+ define: {
248
+ maxTokens: number;
249
+ timeoutMs: number;
250
+ };
251
+ revise: {
252
+ maxTokens: number;
253
+ timeoutMs: number;
254
+ };
255
+ director: {
256
+ maxTokens: number;
257
+ timeoutMs: number;
258
+ };
259
+ }>;
260
+ export declare const LIVING_ANSWER_BUDGET_MS: number;
261
+ export {};