@zergai/ztc 0.4.0-beta.1 → 0.5.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.
- package/README.md +398 -45
- package/RUST_THIRD_PARTY_LICENSES.txt +1080 -822
- package/THIRD_PARTY_NOTICES.md +273 -12
- package/bin/zmux-darwin-arm64 +0 -0
- package/bin/ztc-audio-darwin-arm64 +0 -0
- package/bin/ztc-capture-darwin-arm64 +0 -0
- package/bin/ztc-computer-darwin-arm64 +0 -0
- package/bin/ztc-llm-darwin-arm64 +0 -0
- package/bin/ztc-tts-darwin-arm64 +0 -0
- package/bin/ztc-tui-darwin-arm64 +0 -0
- package/bin/ztc-zlicky-overlay-darwin-arm64 +0 -0
- package/bin/zterm-darwin-arm64 +0 -0
- package/dist/App.js +1206 -209
- package/dist/agent/agent.d.ts +74 -8
- package/dist/agent/agent.js +1073 -184
- package/dist/agent/backends/account_rotation.d.ts +4 -0
- package/dist/agent/backends/account_rotation.js +8 -2
- package/dist/agent/backends/anthropic.d.ts +13 -0
- package/dist/agent/backends/anthropic.js +169 -28
- package/dist/agent/backends/claude_cli.js +18 -8
- package/dist/agent/backends/codex_app_server.d.ts +1 -0
- package/dist/agent/backends/codex_app_server.js +55 -3
- package/dist/agent/backends/codex_auth.d.ts +1 -0
- package/dist/agent/backends/codex_auth.js +67 -13
- package/dist/agent/backends/codex_buffered_recovery.d.ts +27 -0
- package/dist/agent/backends/codex_buffered_recovery.js +293 -0
- package/dist/agent/backends/gemini.js +3 -1
- package/dist/agent/backends/http_error.d.ts +26 -0
- package/dist/agent/backends/http_error.js +221 -0
- package/dist/agent/backends/index.d.ts +9 -2
- package/dist/agent/backends/index.js +22 -2
- package/dist/agent/backends/openai.d.ts +0 -6
- package/dist/agent/backends/openai.js +5 -2
- package/dist/agent/backends/openai_compatible.d.ts +5 -4
- package/dist/agent/backends/openai_compatible.js +26 -19
- package/dist/agent/backends/openai_responses.d.ts +8 -3
- package/dist/agent/backends/openai_responses.js +77 -33
- package/dist/agent/backends/provider_ids.d.ts +1 -0
- package/dist/agent/backends/provider_ids.js +4 -0
- package/dist/agent/backends/request_metrics.js +12 -2
- package/dist/agent/backends/types.d.ts +109 -6
- package/dist/agent/backends/types.js +5 -1
- package/dist/agent/backends/zrouter_stream.d.ts +6 -1
- package/dist/agent/backends/zrouter_stream.js +160 -42
- package/dist/agent/background_registry.d.ts +2 -0
- package/dist/agent/background_registry.js +1 -0
- package/dist/agent/claim_observation.d.ts +6 -0
- package/dist/agent/claim_observation.js +54 -0
- package/dist/agent/commands/accounts.js +46 -177
- package/dist/agent/commands/attention.d.ts +2 -0
- package/dist/agent/commands/attention.js +67 -0
- package/dist/agent/commands/auth.js +18 -2
- package/dist/agent/commands/board.d.ts +2 -0
- package/dist/agent/commands/board.js +169 -0
- package/dist/agent/commands/clipboard.js +50 -1
- package/dist/agent/commands/compact.js +21 -13
- package/dist/agent/commands/config.js +4 -1
- package/dist/agent/commands/context.js +6 -1
- package/dist/agent/commands/desktop.d.ts +2 -0
- package/dist/agent/commands/desktop.js +29 -0
- package/dist/agent/commands/effort.js +14 -6
- package/dist/agent/commands/environment.d.ts +3 -0
- package/dist/agent/commands/environment.js +109 -0
- package/dist/agent/commands/evidence.d.ts +2 -0
- package/dist/agent/commands/evidence.js +9 -0
- package/dist/agent/commands/fork.js +4 -3
- package/dist/agent/commands/goal.d.ts +33 -1
- package/dist/agent/commands/goal.js +174 -14
- package/dist/agent/commands/goal_exit.d.ts +36 -0
- package/dist/agent/commands/goal_exit.js +120 -0
- package/dist/agent/commands/help.js +3 -1
- package/dist/agent/commands/history.js +3 -1
- package/dist/agent/commands/inbox.d.ts +2 -0
- package/dist/agent/commands/inbox.js +148 -0
- package/dist/agent/commands/index.js +16 -1
- package/dist/agent/commands/input_mode.js +8 -6
- package/dist/agent/commands/job.d.ts +2 -0
- package/dist/agent/commands/job.js +93 -0
- package/dist/agent/commands/keybindings.js +4 -1
- package/dist/agent/commands/label.d.ts +2 -0
- package/dist/agent/commands/label.js +77 -0
- package/dist/agent/commands/layout.d.ts +2 -0
- package/dist/agent/commands/layout.js +20 -0
- package/dist/agent/commands/mirror.js +16 -1
- package/dist/agent/commands/model.js +12 -2
- package/dist/agent/commands/permissions.d.ts +3 -1
- package/dist/agent/commands/permissions.js +79 -89
- package/dist/agent/commands/plan.js +5 -15
- package/dist/agent/commands/profile.js +21 -2
- package/dist/agent/commands/provider_selection.js +20 -1
- package/dist/agent/commands/rename.js +1 -1
- package/dist/agent/commands/resources.d.ts +2 -0
- package/dist/agent/commands/resources.js +67 -0
- package/dist/agent/commands/rewind.d.ts +3 -0
- package/dist/agent/commands/rewind.js +16 -0
- package/dist/agent/commands/runbooks.d.ts +2 -0
- package/dist/agent/commands/runbooks.js +73 -0
- package/dist/agent/commands/runbooks_lazy.d.ts +2 -0
- package/dist/agent/commands/runbooks_lazy.js +8 -0
- package/dist/agent/commands/sessions.d.ts +1 -1
- package/dist/agent/commands/sessions.js +33 -5
- package/dist/agent/commands/settings.js +185 -39
- package/dist/agent/commands/setup.d.ts +2 -0
- package/dist/agent/commands/setup.js +78 -0
- package/dist/agent/commands/share.d.ts +2 -0
- package/dist/agent/commands/share.js +64 -0
- package/dist/agent/commands/status.js +14 -2
- package/dist/agent/commands/types.d.ts +99 -6
- package/dist/agent/commands/update.js +8 -0
- package/dist/agent/commands/usage.d.ts +2 -0
- package/dist/agent/commands/usage.js +8 -0
- package/dist/agent/factory.d.ts +11 -0
- package/dist/agent/factory.js +113 -88
- package/dist/agent/loop_policy.d.ts +6 -3
- package/dist/agent/loop_policy.js +12 -3
- package/dist/agent/measurement_guidance.d.ts +2 -0
- package/dist/agent/measurement_guidance.js +5 -0
- package/dist/agent/request_encoder.d.ts +8 -1
- package/dist/agent/request_encoder.js +95 -23
- package/dist/agent/runtime/benchmark_comparison.d.ts +30 -0
- package/dist/agent/runtime/benchmark_comparison.js +94 -0
- package/dist/agent/runtime/benchmark_contract.d.ts +48 -0
- package/dist/agent/runtime/benchmark_contract.js +90 -0
- package/dist/agent/runtime/checked_commands.d.ts +32 -0
- package/dist/agent/runtime/checked_commands.js +119 -0
- package/dist/agent/runtime/command_execution_policy.d.ts +26 -0
- package/dist/agent/runtime/command_execution_policy.js +91 -0
- package/dist/agent/runtime/command_jobs.d.ts +36 -18
- package/dist/agent/runtime/command_jobs.js +151 -13
- package/dist/agent/runtime/command_panes.d.ts +59 -0
- package/dist/agent/runtime/command_panes.js +398 -0
- package/dist/agent/runtime/command_wait.d.ts +19 -0
- package/dist/agent/runtime/command_wait.js +167 -0
- package/dist/agent/runtime/cpu_benchmark.d.ts +30 -0
- package/dist/agent/runtime/cpu_benchmark.js +126 -0
- package/dist/agent/runtime/delegated_evidence.d.ts +26 -0
- package/dist/agent/runtime/delegated_evidence.js +80 -0
- package/dist/agent/runtime/evidence.d.ts +127 -0
- package/dist/agent/runtime/evidence.js +468 -0
- package/dist/agent/runtime/execution_context.d.ts +7 -0
- package/dist/agent/runtime/execution_context.js +39 -3
- package/dist/agent/runtime/json_verifier_recipe.d.ts +8 -0
- package/dist/agent/runtime/json_verifier_recipe.js +66 -0
- package/dist/agent/runtime/measurements.d.ts +110 -0
- package/dist/agent/runtime/measurements.js +317 -0
- package/dist/agent/runtime/policy.d.ts +4 -0
- package/dist/agent/runtime/policy.js +31 -20
- package/dist/agent/runtime/provider_native_evidence.d.ts +20 -0
- package/dist/agent/runtime/provider_native_evidence.js +86 -0
- package/dist/agent/runtime/recovery.d.ts +2 -0
- package/dist/agent/runtime/recovery.js +45 -2
- package/dist/agent/runtime/remote_broker_transport.d.ts +10 -0
- package/dist/agent/runtime/remote_broker_transport.js +84 -0
- package/dist/agent/runtime/remote_deletion_receipts.d.ts +3 -0
- package/dist/agent/runtime/remote_deletion_receipts.js +43 -0
- package/dist/agent/runtime/remote_journal_replay.d.ts +13 -0
- package/dist/agent/runtime/remote_journal_replay.js +233 -0
- package/dist/agent/runtime/remote_mutation_journal.d.ts +25 -0
- package/dist/agent/runtime/remote_mutation_journal.js +208 -0
- package/dist/agent/runtime/remote_resource_endpoint.d.ts +7 -0
- package/dist/agent/runtime/remote_resource_endpoint.js +6 -0
- package/dist/agent/runtime/remote_resource_errors.d.ts +5 -0
- package/dist/agent/runtime/remote_resource_errors.js +9 -0
- package/dist/agent/runtime/remote_resource_script.d.ts +2 -0
- package/dist/agent/runtime/remote_resource_script.js +1009 -0
- package/dist/agent/runtime/remote_resources.d.ts +29 -0
- package/dist/agent/runtime/remote_resources.js +160 -0
- package/dist/agent/runtime/source_verification.d.ts +12 -0
- package/dist/agent/runtime/source_verification.js +210 -0
- package/dist/agent/runtime/source_verification_contract.d.ts +75 -0
- package/dist/agent/runtime/source_verification_contract.js +203 -0
- package/dist/agent/runtime/tool_checkpoints.d.ts +11 -0
- package/dist/agent/runtime/tool_checkpoints.js +26 -0
- package/dist/agent/runtime/tool_effects.d.ts +5 -0
- package/dist/agent/runtime/tool_progress.d.ts +12 -0
- package/dist/agent/runtime/tool_progress.js +76 -0
- package/dist/agent/runtime/tool_runtime.d.ts +16 -1
- package/dist/agent/runtime/tool_runtime.js +204 -10
- package/dist/agent/runtime/tracing.d.ts +1 -1
- package/dist/agent/runtime/verifier_capture.d.ts +9 -0
- package/dist/agent/runtime/verifier_capture.js +100 -0
- package/dist/agent/runtime/verifier_contract.d.ts +24 -0
- package/dist/agent/runtime/verifier_contract.js +41 -0
- package/dist/agent/subagent.d.ts +20 -10
- package/dist/agent/subagent.js +266 -29
- package/dist/agent/tool_response_directory.d.ts +24 -0
- package/dist/agent/tool_response_directory.js +61 -0
- package/dist/agent/tool_response_source.d.ts +8 -0
- package/dist/agent/tool_response_source.js +49 -0
- package/dist/agent/tool_response_store.d.ts +75 -4
- package/dist/agent/tool_response_store.js +583 -64
- package/dist/agent/tools/ask_user.d.ts +3 -1
- package/dist/agent/tools/ask_user.js +30 -11
- package/dist/agent/tools/background.js +1 -0
- package/dist/agent/tools/benchmark_cpu.d.ts +2 -0
- package/dist/agent/tools/benchmark_cpu.js +102 -0
- package/dist/agent/tools/compare_benchmarks.d.ts +2 -0
- package/dist/agent/tools/compare_benchmarks.js +53 -0
- package/dist/agent/tools/deferred.js +1 -0
- package/dist/agent/tools/delegate.js +18 -2
- package/dist/agent/tools/helper_requirements.d.ts +7 -0
- package/dist/agent/tools/helper_requirements.js +19 -0
- package/dist/agent/tools/index.d.ts +1 -0
- package/dist/agent/tools/index.js +3 -0
- package/dist/agent/tools/measurement_report.d.ts +22 -0
- package/dist/agent/tools/measurement_report.js +190 -0
- package/dist/agent/tools/pane.d.ts +0 -7
- package/dist/agent/tools/pane.js +5 -4
- package/dist/agent/tools/project_context.d.ts +3 -0
- package/dist/agent/tools/project_context.js +45 -0
- package/dist/agent/tools/recall_tool_response.d.ts +3 -5
- package/dist/agent/tools/recall_tool_response.js +19 -29
- package/dist/agent/tools/registry.d.ts +1 -0
- package/dist/agent/tools/registry.js +23 -0
- package/dist/agent/tools/related_sessions.d.ts +2 -0
- package/dist/agent/tools/related_sessions.js +156 -0
- package/dist/agent/tools/routine.js +13 -3
- package/dist/agent/tools/session_evidence.d.ts +3 -0
- package/dist/agent/tools/session_evidence.js +72 -0
- package/dist/agent/tools/shell.d.ts +4 -3
- package/dist/agent/tools/shell.js +174 -47
- package/dist/agent/tools/tool_search.js +3 -2
- package/dist/agent/tools/types.d.ts +28 -0
- package/dist/agent/tools/verify_artifact.d.ts +2 -0
- package/dist/agent/tools/verify_artifact.js +60 -0
- package/dist/agent/tools/workflow.js +1 -0
- package/dist/app/activity.d.ts +6 -1
- package/dist/app/activity.js +81 -12
- package/dist/app/agent_runner.d.ts +6 -1
- package/dist/app/agent_runner.js +34 -19
- package/dist/app/command_context.js +106 -10
- package/dist/app/controller.d.ts +15 -4
- package/dist/app/controller.js +29 -3
- package/dist/app/escape_stop.d.ts +11 -0
- package/dist/app/escape_stop.js +15 -0
- package/dist/app/liveness.d.ts +6 -4
- package/dist/app/liveness.js +13 -3
- package/dist/app/model_catalog_cache.d.ts +5 -0
- package/dist/app/model_catalog_cache.js +138 -0
- package/dist/app/ordered_transcript.js +43 -4
- package/dist/app/prompt_turn.d.ts +14 -0
- package/dist/app/prompt_turn.js +53 -0
- package/dist/app/recap.d.ts +3 -0
- package/dist/app/recap.js +9 -3
- package/dist/app/restart.d.ts +3 -2
- package/dist/app/restart.js +22 -7
- package/dist/app/rewind.d.ts +3 -3
- package/dist/app/rewind.js +3 -3
- package/dist/app/selection_completion.d.ts +17 -2
- package/dist/app/selection_completion.js +84 -9
- package/dist/app/session_manager.d.ts +38 -6
- package/dist/app/session_manager.js +263 -60
- package/dist/app/session_messages.d.ts +3 -0
- package/dist/app/session_messages.js +60 -0
- package/dist/app/task_scope_router.d.ts +20 -0
- package/dist/app/task_scope_router.js +173 -0
- package/dist/app/transcript_window.d.ts +2 -0
- package/dist/app/transcript_window.js +4 -0
- package/dist/app/workspace_admission_details.d.ts +3 -0
- package/dist/app/workspace_admission_details.js +26 -0
- package/dist/app/workspace_layout_controller.d.ts +11 -0
- package/dist/app/workspace_layout_controller.js +88 -0
- package/dist/app/workspace_monitor.d.ts +1 -0
- package/dist/app/workspace_monitor.js +216 -0
- package/dist/app/workspace_presets.d.ts +29 -0
- package/dist/app/workspace_presets.js +192 -0
- package/dist/attention/queue.d.ts +37 -0
- package/dist/attention/queue.js +183 -0
- package/dist/bench/rf_shared.d.ts +2 -0
- package/dist/board/binding.d.ts +42 -0
- package/dist/board/binding.js +38 -0
- package/dist/board/client.d.ts +42 -0
- package/dist/board/client.js +60 -0
- package/dist/cli.js +1 -1
- package/dist/cli_args.js +19 -17
- package/dist/cli_main.js +110 -13
- package/dist/cli_ratatui.d.ts +183 -16
- package/dist/cli_ratatui.js +3989 -1255
- package/dist/components/ActivityLine.d.ts +3 -2
- package/dist/components/ActivityLine.js +2 -2
- package/dist/components/InputArea.d.ts +19 -1
- package/dist/components/InputArea.js +264 -190
- package/dist/components/MessageList.d.ts +2 -0
- package/dist/components/MessageList.js +3 -1
- package/dist/components/SingleMessage.d.ts +2 -0
- package/dist/components/SingleMessage.js +4 -2
- package/dist/components/StatusBar.d.ts +4 -2
- package/dist/components/StatusBar.js +3 -1
- package/dist/conductor_branch.js +3 -0
- package/dist/config/api_retry.d.ts +6 -1
- package/dist/config/api_retry.js +19 -1
- package/dist/config/defaults.d.ts +2 -1
- package/dist/config/defaults.js +9 -2
- package/dist/config/message_display.d.ts +1 -0
- package/dist/config/message_display.js +17 -2
- package/dist/config/permissions.d.ts +21 -0
- package/dist/config/permissions.js +89 -0
- package/dist/config/resolved.d.ts +2 -2
- package/dist/config/types.d.ts +32 -5
- package/dist/config.d.ts +38 -4
- package/dist/config.js +290 -42
- package/dist/context/project_intelligence.d.ts +44 -0
- package/dist/context/project_intelligence.js +246 -0
- package/dist/desktop/cli_launch.d.ts +8 -0
- package/dist/desktop/cli_launch.js +6 -0
- package/dist/desktop/cli_shim.d.ts +8 -0
- package/dist/desktop/cli_shim.js +120 -0
- package/dist/desktop/runtime.d.ts +16 -0
- package/dist/desktop/runtime.js +161 -0
- package/dist/desktop/worker_launch.d.ts +7 -0
- package/dist/desktop/worker_launch.js +7 -0
- package/dist/diagnostics/cargo_mutants_selection.d.ts +27 -0
- package/dist/diagnostics/cargo_mutants_selection.js +48 -0
- package/dist/diagnostics/native_terminal_benchmark.d.ts +58 -0
- package/dist/diagnostics/native_terminal_benchmark.js +1247 -0
- package/dist/diagnostics/session_evidence_package.d.ts +40 -0
- package/dist/diagnostics/session_evidence_package.js +234 -0
- package/dist/diagnostics/session_export.d.ts +93 -0
- package/dist/diagnostics/session_export.js +634 -0
- package/dist/emulation/tool_adapters.js +48 -18
- package/dist/emulation/ztc_addendum.d.ts +1 -0
- package/dist/emulation/ztc_addendum.js +13 -12
- package/dist/environment/service_runner.d.ts +1 -0
- package/dist/environment/service_runner.js +68 -0
- package/dist/environment/store.d.ts +120 -0
- package/dist/environment/store.js +387 -0
- package/dist/events.d.ts +40 -1
- package/dist/events.js +10 -17
- package/dist/goal_contract.d.ts +25 -0
- package/dist/goal_contract.js +44 -0
- package/dist/headless.d.ts +31 -0
- package/dist/headless.js +578 -70
- package/dist/headless_cli.js +8 -0
- package/dist/headless_cli_args.d.ts +1 -0
- package/dist/headless_cli_args.js +1 -0
- package/dist/intake/cli.d.ts +1 -0
- package/dist/intake/cli.js +33 -0
- package/dist/intake/format.d.ts +2 -0
- package/dist/intake/format.js +14 -0
- package/dist/intake/notifications.d.ts +16 -0
- package/dist/intake/notifications.js +132 -0
- package/dist/intake/store.d.ts +56 -0
- package/dist/intake/store.js +238 -0
- package/dist/library.d.ts +8 -0
- package/dist/library.js +19 -10
- package/dist/mcp/client.d.ts +1 -0
- package/dist/mcp/client.js +20 -0
- package/dist/modes/builtin/plan.yaml +2 -2
- package/dist/modes/handlers.js +1 -1
- package/dist/onboarding/first_run.d.ts +3 -0
- package/dist/onboarding/first_run.js +33 -25
- package/dist/onboarding/setup.d.ts +32 -0
- package/dist/onboarding/setup.js +133 -0
- package/dist/onboarding/setup_agent_health.d.ts +17 -0
- package/dist/onboarding/setup_agent_health.js +79 -0
- package/dist/onboarding/setup_environment.d.ts +66 -0
- package/dist/onboarding/setup_environment.js +219 -0
- package/dist/onboarding/setup_workspace.d.ts +17 -0
- package/dist/onboarding/setup_workspace.js +129 -0
- package/dist/optimize/adapters/index.d.ts +4 -1
- package/dist/optimize/adapters/index.js +7 -0
- package/dist/optimize/adapters/kernelbench.js +14 -5
- package/dist/optimize/adapters/popcorn.js +3 -2
- package/dist/optimize/adapters/profile_benchmark.js +13 -7
- package/dist/optimize/adapters/rfbench.js +25 -14
- package/dist/optimize/adapters/types.d.ts +3 -0
- package/dist/optimize/adapters/zergpod.js +5 -2
- package/dist/optimize/baseline.js +10 -21
- package/dist/optimize/branch.js +9 -12
- package/dist/optimize/combine.js +2 -3
- package/dist/optimize/executor.js +34 -48
- package/dist/optimize/measurements.d.ts +55 -0
- package/dist/optimize/measurements.js +173 -0
- package/dist/optimize/results.d.ts +1 -0
- package/dist/optimize/results.js +11 -33
- package/dist/optimize/tge.js +2 -1
- package/dist/panes/initial_input.d.ts +19 -0
- package/dist/panes/initial_input.js +206 -0
- package/dist/panes/labels.d.ts +16 -0
- package/dist/panes/labels.js +42 -0
- package/dist/panes/model_catalog.d.ts +3 -3
- package/dist/panes/model_catalog.js +28 -4
- package/dist/panes/pane_registry.js +6 -2
- package/dist/panes/types.d.ts +3 -0
- package/dist/panes/ztc_launch.js +19 -0
- package/dist/plugin/optimization.d.ts +2 -0
- package/dist/plugin/optimization.js +1 -0
- package/dist/plugin/runtime.d.ts +2 -0
- package/dist/plugin/simulation.d.ts +6 -1
- package/dist/plugin/simulation_contract.d.ts +836 -1
- package/dist/plugin/simulation_documents.d.ts +22 -0
- package/dist/plugin/simulation_documents.js +1 -0
- package/dist/plugin/simulation_interventions.d.ts +103 -0
- package/dist/plugin/simulation_interventions.js +1 -0
- package/dist/plugin/simulation_living.d.ts +1 -0
- package/dist/plugin/simulation_living.js +3 -0
- package/dist/plugin/simulation_meetings.d.ts +121 -0
- package/dist/plugin/simulation_meetings.js +1 -0
- package/dist/plugin/simulation_story_review.d.ts +111 -0
- package/dist/plugin/simulation_story_review.js +1 -0
- package/dist/plugin/simulation_storyteller.d.ts +91 -0
- package/dist/plugin/simulation_storyteller.js +1 -0
- package/dist/plugin/simulation_structured.d.ts +2 -0
- package/dist/plugin/simulation_structured.js +2 -0
- package/dist/plugin/simulation_toolkit.d.ts +21 -0
- package/dist/plugin/simulation_toolkit.js +24 -0
- package/dist/prompts/tool_delegate_task.j2 +1 -1
- package/dist/remote-broker/Dockerfile +10 -0
- package/dist/remote-broker/archive.py +1227 -0
- package/dist/remote-broker/cutover.py +761 -0
- package/dist/remote-broker/requirements.txt +5 -0
- package/dist/remote-broker/resources.json +6 -0
- package/dist/remote-broker/resources.write-staging.example.json +18 -0
- package/dist/remote-broker/retained.py +686 -0
- package/dist/remote-broker/retained_cleanup.py +550 -0
- package/dist/remote-broker/server.py +648 -0
- package/dist/remote-broker/worker.py +1007 -0
- package/dist/router_auth.d.ts +31 -0
- package/dist/router_auth.js +155 -9
- package/dist/runbooks/catalog.d.ts +3 -0
- package/dist/runbooks/catalog.js +26 -0
- package/dist/runbooks/library.d.ts +11 -0
- package/dist/runbooks/library.js +95 -0
- package/dist/runbooks/package.d.ts +43 -0
- package/dist/runbooks/package.js +102 -0
- package/dist/session.d.ts +65 -13
- package/dist/session.js +548 -43
- package/dist/session_handoff.d.ts +25 -0
- package/dist/session_handoff.js +322 -0
- package/dist/session_handoff_contract.d.ts +89 -0
- package/dist/session_handoff_contract.js +179 -0
- package/dist/session_media.d.ts +41 -0
- package/dist/session_media.js +357 -0
- package/dist/session_ownership.d.ts +16 -0
- package/dist/session_ownership.js +221 -0
- package/dist/session_public.d.ts +10 -2
- package/dist/session_public.js +6 -1
- package/dist/simulation/dynamic_history.d.ts +42 -0
- package/dist/simulation/dynamic_history.js +173 -0
- package/dist/simulation/engines/swarm/pane_manager.js +7 -6
- package/dist/simulation/inference.d.ts +3 -1
- package/dist/simulation/inference.js +19 -1
- package/dist/simulation/intervention_generation.d.ts +27 -0
- package/dist/simulation/intervention_generation.js +246 -0
- package/dist/simulation/intervention_material.d.ts +4 -0
- package/dist/simulation/intervention_material.js +81 -0
- package/dist/simulation/living/context.d.ts +3130 -0
- package/dist/simulation/living/context.js +944 -0
- package/dist/simulation/living/definer.d.ts +12 -0
- package/dist/simulation/living/definer.js +223 -0
- package/dist/simulation/living/definition.d.ts +257 -0
- package/dist/simulation/living/definition.js +341 -0
- package/dist/simulation/living/frame.d.ts +259 -0
- package/dist/simulation/living/frame.js +223 -0
- package/dist/simulation/living/identifiers.d.ts +2 -0
- package/dist/simulation/living/identifiers.js +12 -0
- package/dist/simulation/living/index.d.ts +15 -0
- package/dist/simulation/living/index.js +15 -0
- package/dist/simulation/living/inference.d.ts +219 -0
- package/dist/simulation/living/inference.js +576 -0
- package/dist/simulation/living/mechanics.d.ts +54 -0
- package/dist/simulation/living/mechanics.js +588 -0
- package/dist/simulation/living/model-input.d.ts +25 -0
- package/dist/simulation/living/model-input.js +215 -0
- package/dist/simulation/living/open-world.d.ts +257 -0
- package/dist/simulation/living/open-world.js +102 -0
- package/dist/simulation/living/projection.d.ts +7 -0
- package/dist/simulation/living/projection.js +31 -0
- package/dist/simulation/living/recall.d.ts +17 -0
- package/dist/simulation/living/recall.js +25 -0
- package/dist/simulation/living/reduce.d.ts +15 -0
- package/dist/simulation/living/reduce.js +1853 -0
- package/dist/simulation/living/replay.d.ts +6 -0
- package/dist/simulation/living/replay.js +22 -0
- package/dist/simulation/living/runtime.d.ts +140 -0
- package/dist/simulation/living/runtime.js +3020 -0
- package/dist/simulation/living/shared-kinds.d.ts +24 -0
- package/dist/simulation/living/shared-kinds.js +96 -0
- package/dist/simulation/living/types.d.ts +2785 -0
- package/dist/simulation/living/types.js +669 -0
- package/dist/simulation/llm.d.ts +3 -1
- package/dist/simulation/llm.js +90 -30
- package/dist/simulation/memory/embedding.d.ts +1 -1
- package/dist/simulation/memory/embedding.js +9 -3
- package/dist/simulation/memory/filesystem.d.ts +2 -0
- package/dist/simulation/memory/filesystem.js +5 -1
- package/dist/simulation/memory/filesystem_file_tree.d.ts +4 -1
- package/dist/simulation/memory/filesystem_file_tree.js +41 -10
- package/dist/simulation/memory/filesystem_invariants.js +1 -2
- package/dist/simulation/memory/filesystem_types.d.ts +1 -0
- package/dist/simulation/memory/memory.d.ts +2 -0
- package/dist/simulation/memory/memory.js +5 -1
- package/dist/simulation/orchestration/intent.js +0 -2
- package/dist/simulation/orchestration/lifecycle.js +0 -2
- package/dist/simulation/plugin_host.d.ts +25 -1
- package/dist/simulation/plugin_host.js +334 -17
- package/dist/simulation/session_documents.d.ts +20 -0
- package/dist/simulation/session_documents.js +62 -0
- package/dist/simulation/session_input_validation.d.ts +43 -0
- package/dist/simulation/session_input_validation.js +364 -0
- package/dist/simulation/session_inputs.d.ts +32 -0
- package/dist/simulation/session_inputs.js +154 -0
- package/dist/simulation/telemetry.d.ts +11 -14
- package/dist/simulation/telemetry.js +177 -54
- package/dist/simulation/toolkit/bounded_turns.d.ts +13 -0
- package/dist/simulation/toolkit/bounded_turns.js +80 -0
- package/dist/simulation/toolkit/dynamic_agents.d.ts +25 -0
- package/dist/simulation/toolkit/dynamic_agents.js +218 -0
- package/dist/simulation/toolkit/dynamic_digest.d.ts +1 -0
- package/dist/simulation/toolkit/dynamic_digest.js +8 -0
- package/dist/simulation/toolkit/dynamic_documents.d.ts +7 -0
- package/dist/simulation/toolkit/dynamic_documents.js +71 -0
- package/dist/simulation/toolkit/dynamic_driver.d.ts +8 -0
- package/dist/simulation/toolkit/dynamic_driver.js +269 -0
- package/dist/simulation/toolkit/dynamic_game.d.ts +53 -0
- package/dist/simulation/toolkit/dynamic_game.js +805 -0
- package/dist/simulation/toolkit/dynamic_knowledge.d.ts +15 -0
- package/dist/simulation/toolkit/dynamic_knowledge.js +91 -0
- package/dist/simulation/toolkit/dynamic_mechanics.d.ts +22 -0
- package/dist/simulation/toolkit/dynamic_mechanics.js +910 -0
- package/dist/simulation/toolkit/dynamic_meetings.d.ts +239 -0
- package/dist/simulation/toolkit/dynamic_meetings.js +350 -0
- package/dist/simulation/toolkit/dynamic_progress.d.ts +131 -0
- package/dist/simulation/toolkit/dynamic_progress.js +214 -0
- package/dist/simulation/toolkit/dynamic_projection.d.ts +9 -0
- package/dist/simulation/toolkit/dynamic_projection.js +219 -0
- package/dist/simulation/toolkit/dynamic_runtime.d.ts +412 -0
- package/dist/simulation/toolkit/dynamic_runtime.js +6536 -0
- package/dist/simulation/toolkit/dynamic_state.d.ts +111 -0
- package/dist/simulation/toolkit/dynamic_state.js +1967 -0
- package/dist/simulation/toolkit/dynamic_story_review.d.ts +508 -0
- package/dist/simulation/toolkit/dynamic_story_review.js +333 -0
- package/dist/simulation/toolkit/dynamic_storyteller.d.ts +77 -0
- package/dist/simulation/toolkit/dynamic_storyteller.js +114 -0
- package/dist/simulation/toolkit/dynamic_storyteller_runtime.d.ts +26 -0
- package/dist/simulation/toolkit/dynamic_storyteller_runtime.js +126 -0
- package/dist/simulation/toolkit/dynamic_world.d.ts +22 -0
- package/dist/simulation/toolkit/dynamic_world.js +377 -0
- package/dist/simulation/toolkit/structured_output.d.ts +5 -0
- package/dist/simulation/toolkit/structured_output.js +321 -0
- package/dist/simulation/types/world.d.ts +2 -0
- package/dist/simulation/world/artifact_store.js +1 -1
- package/dist/simulation/world/memory_manager.d.ts +5 -0
- package/dist/simulation/world/memory_manager.js +17 -2
- package/dist/simulation/world/state.d.ts +3 -2
- package/dist/simulation/world/state.js +15 -5
- package/dist/skills/bundled/measurement-validation/SKILL.md +144 -0
- package/dist/terminal_attach.d.ts +1 -0
- package/dist/terminal_attach.js +113 -0
- package/dist/tool_progress.d.ts +3 -0
- package/dist/tool_progress.js +27 -0
- package/dist/types.d.ts +145 -10
- package/dist/types.js +3 -0
- package/dist/ui/core/input.d.ts +3 -0
- package/dist/ui/core/input_segments.d.ts +18 -1
- package/dist/ui/core/input_segments.js +131 -47
- package/dist/ui/core/input_state.d.ts +12 -0
- package/dist/ui/core/layout_yoga.d.ts +1 -1
- package/dist/ui/core/turn_metadata.d.ts +5 -0
- package/dist/ui/core/turn_metadata.js +22 -0
- package/dist/ui/ink/render.d.ts +2 -1
- package/dist/ui/ink/render.js +6 -5
- package/dist/ui/ratatui/headless_pane_manager.d.ts +14 -1
- package/dist/ui/ratatui/headless_pane_manager.js +293 -104
- package/dist/ui/ratatui/index.d.ts +1 -0
- package/dist/ui/ratatui/input.d.ts +4 -0
- package/dist/ui/ratatui/input.js +15 -0
- package/dist/ui/ratatui/ipc_path.d.ts +2 -0
- package/dist/ui/ratatui/ipc_path.js +29 -1
- package/dist/ui/ratatui/mux_persistence.d.ts +3 -1
- package/dist/ui/ratatui/mux_persistence.js +139 -1
- package/dist/ui/ratatui/pane_relay.d.ts +1 -1
- package/dist/ui/ratatui/pane_relay.js +55 -27
- package/dist/ui/ratatui/process.d.ts +17 -1
- package/dist/ui/ratatui/process.js +80 -7
- package/dist/ui/ratatui/protocol.d.ts +236 -1
- package/dist/ui/ratatui/protocol.js +90 -0
- package/dist/ui/scrollback.d.ts +2 -1
- package/dist/ui/scrollback.js +9 -4
- package/dist/ui/stream_typewriter.d.ts +8 -3
- package/dist/ui/stream_typewriter.js +30 -1
- package/dist/ui/streaming_scrollback.d.ts +1 -0
- package/dist/ui/streaming_scrollback.js +1 -1
- package/dist/ui/transcript_render_cache.js +10 -0
- package/dist/ui/views/activity_line.d.ts +5 -3
- package/dist/ui/views/activity_line.js +65 -7
- package/dist/ui/views/app.d.ts +6 -3
- package/dist/ui/views/app.js +17 -6
- package/dist/ui/views/completion_menu.js +10 -5
- package/dist/ui/views/input_area.d.ts +7 -3
- package/dist/ui/views/input_area.js +15 -9
- package/dist/ui/views/message_list.d.ts +4 -1
- package/dist/ui/views/message_list.js +89 -19
- package/dist/ui/views/queue_panel.d.ts +3 -1
- package/dist/ui/views/queue_panel.js +9 -2
- package/dist/ui/views/status_bar.d.ts +4 -2
- package/dist/ui/views/status_bar.js +28 -13
- package/dist/ui/views/theme.d.ts +2 -0
- package/dist/ui/views/theme.js +2 -0
- package/dist/ui/widgets/color_panel.js +18 -0
- package/dist/ui/widgets/form.js +8 -0
- package/dist/ui/widgets/log_view.js +7 -0
- package/dist/ui/widgets/navigator_panel.js +8 -0
- package/dist/ui/widgets/prompt_viewer.js +2 -0
- package/dist/ui/widgets/questionnaire.d.ts +2 -0
- package/dist/ui/widgets/questionnaire.js +79 -16
- package/dist/ui/widgets/resume_panel.d.ts +2 -0
- package/dist/ui/widgets/resume_panel.js +26 -15
- package/dist/ui/widgets/rewind_panel.d.ts +2 -2
- package/dist/ui/widgets/rewind_panel.js +4 -2
- package/dist/ui/widgets/select.js +16 -27
- package/dist/ui/widgets/settings_panel.js +16 -0
- package/dist/ui/widgets/status_line_panel.d.ts +1 -0
- package/dist/ui/widgets/status_line_panel.js +30 -4
- package/dist/ui/widgets/text_input.d.ts +2 -0
- package/dist/ui/widgets/text_input.js +15 -1
- package/dist/ui/widgets/types.d.ts +2 -0
- package/dist/usage_projection.d.ts +24 -0
- package/dist/usage_projection.js +130 -0
- package/dist/usage_snapshot.d.ts +36 -0
- package/dist/usage_snapshot.js +131 -0
- package/dist/utils/assistant_message.d.ts +2 -0
- package/dist/utils/assistant_message.js +5 -0
- package/dist/utils/atomic_write.d.ts +6 -2
- package/dist/utils/atomic_write.js +29 -4
- package/dist/utils/checked_shell.d.ts +25 -0
- package/dist/utils/checked_shell.js +107 -0
- package/dist/utils/compaction.d.ts +4 -1
- package/dist/utils/compaction.js +31 -7
- package/dist/utils/context.d.ts +4 -4
- package/dist/utils/context.js +14 -12
- package/dist/utils/deepseek.d.ts +2 -2
- package/dist/utils/deepseek.js +13 -5
- package/dist/utils/ephemeral.js +4 -0
- package/dist/utils/ephemeral_tools.d.ts +18 -0
- package/dist/utils/ephemeral_tools.js +97 -0
- package/dist/utils/jev_client.d.ts +4 -0
- package/dist/utils/jev_client.js +15 -0
- package/dist/utils/model_cache.d.ts +15 -0
- package/dist/utils/model_cache.js +143 -0
- package/dist/utils/models.d.ts +4 -2
- package/dist/utils/models.js +12 -16
- package/dist/utils/reasoning.d.ts +8 -1
- package/dist/utils/reasoning.js +31 -11
- package/dist/utils/router_catalog.d.ts +49 -0
- package/dist/utils/router_catalog.js +271 -0
- package/dist/utils/sandbox.d.ts +9 -0
- package/dist/utils/sandbox.js +118 -15
- package/dist/utils/shell.d.ts +7 -0
- package/dist/utils/shell.js +98 -34
- package/dist/utils/subprocess_env.d.ts +3 -0
- package/dist/utils/subprocess_env.js +27 -1
- package/dist/web/accounts_mirror.d.ts +3 -1
- package/dist/web/accounts_mirror.js +13 -9
- package/dist/web/child_publication.d.ts +17 -0
- package/dist/web/child_publication.js +45 -0
- package/dist/web/mirror_authenticator.d.ts +31 -11
- package/dist/web/mirror_authenticator.js +67 -17
- package/dist/web/mirror_client.d.ts +31 -4
- package/dist/web/mirror_client.js +189 -23
- package/dist/web/mirror_stream.d.ts +84 -22
- package/dist/web/mirror_stream.js +676 -95
- package/dist/web/observer_query_redaction.d.ts +6 -0
- package/dist/web/observer_query_redaction.js +58 -0
- package/dist/web/pane_registry.d.ts +2 -0
- package/dist/web/pane_registry.js +86 -22
- package/dist/web/tool_image.d.ts +6 -0
- package/dist/web/tool_image.js +17 -0
- package/dist/web/view_plugin.d.ts +14 -0
- package/dist/web/view_plugin.js +23 -1
- package/dist/worker/executor.js +31 -12
- package/dist/worker/index.d.ts +1 -0
- package/dist/worker/toolsets.js +3 -1
- package/dist/worker/types.d.ts +12 -1
- package/dist/workflows/registry.js +1 -0
- package/dist/workflows/registry_handle.d.ts +2 -0
- package/dist/workflows/runtime.d.ts +2 -0
- package/dist/workflows/runtime.js +1 -0
- package/dist/workspace_agent.d.ts +7 -0
- package/dist/workspace_agent.js +36 -0
- package/dist/workspace_collision.d.ts +76 -0
- package/dist/workspace_collision.js +688 -0
- package/dist/workspace_layout.d.ts +18 -0
- package/dist/workspace_layout.js +121 -0
- package/dist/workspace_runtime.d.ts +44 -0
- package/dist/workspace_runtime.js +82 -0
- package/dist/workspace_session_context.d.ts +62 -0
- package/dist/workspace_session_context.js +160 -0
- package/dist/zlm-embed.mjs +32518 -9615
- package/dist/zlm.js +1 -0
- package/node_modules/@zerg/model-contracts/LICENSE.md +375 -0
- package/node_modules/@zerg/model-contracts/README.md +90 -0
- package/node_modules/@zerg/model-contracts/index.d.ts +20 -0
- package/node_modules/@zerg/model-contracts/index.js +223 -0
- package/node_modules/@zerg/model-contracts/package.json +8 -0
- package/node_modules/glob/node_modules/brace-expansion/index.js +78 -22
- package/node_modules/glob/node_modules/brace-expansion/package.json +1 -1
- package/node_modules/readdir-glob/node_modules/brace-expansion/index.js +78 -22
- package/node_modules/readdir-glob/node_modules/brace-expansion/package.json +1 -1
- package/package.json +45 -24
- package/packages/model-contracts/LICENSE.md +375 -0
- package/packages/model-contracts/README.md +90 -0
- package/packages/model-contracts/index.d.ts +20 -0
- package/packages/model-contracts/index.js +223 -0
- package/packages/model-contracts/package.json +8 -0
- package/remote-broker/Dockerfile +10 -0
- package/remote-broker/README.md +308 -0
- package/remote-broker/archive.py +1227 -0
- package/remote-broker/cutover.py +761 -0
- package/remote-broker/requirements.txt +5 -0
- package/remote-broker/resources.example.json +6 -0
- package/remote-broker/resources.write-staging.example.json +18 -0
- package/remote-broker/retained.py +686 -0
- package/remote-broker/retained_cleanup.py +550 -0
- package/remote-broker/server.py +648 -0
- package/scripts/build-remote-broker.mjs +13 -0
- package/scripts/ensure-local-packages.mjs +6 -0
- package/scripts/node-pty-helpers.mjs +103 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { BOUNDED_PERSON_RECORDS_ENGINE, MAX_WORKING_BELIEFS } from './types.js';
|
|
2
|
+
import { generatedId } from './identifiers.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { LIVING_ENGINE_VERSION, LIVING_SCHEMA_VERSION, MAX_CLOCK_RATE, MESSAGE_TRAVEL_ENGINE, PROBLEM_VIEW_ENGINE, LivingWorldError, messageTravelSchema, parseLivingState, DEADLINE_ENGINE, beatRulesSchema, } from './types.js';
|
|
5
|
+
import { kindDefinitionSchema, propertyValueSchema } from './open-world.js';
|
|
6
|
+
import { sharedKindMap } from './shared-kinds.js';
|
|
7
|
+
// A world definition is authored content: the place graph, the cast, the objects,
|
|
8
|
+
// and the opening tension. The engine turns it into a revision-0 state.
|
|
9
|
+
const id = z.string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/u);
|
|
10
|
+
const characterSchema = z.object({
|
|
11
|
+
voice: z.string().min(1).max(200),
|
|
12
|
+
values: z.array(z.string().min(1).max(200)).min(1),
|
|
13
|
+
redLines: z.array(z.string().min(1).max(200)).min(1),
|
|
14
|
+
privateConcerns: z.array(z.string().min(1).max(200)).min(1),
|
|
15
|
+
});
|
|
16
|
+
export const definitionSchema = z.object({
|
|
17
|
+
kind: id,
|
|
18
|
+
title: z.string().min(1).max(120),
|
|
19
|
+
tagline: z.string().min(1).max(240),
|
|
20
|
+
setting: z.string().min(1).max(2000),
|
|
21
|
+
startClock: z.number().int().min(0).max(1_000_000),
|
|
22
|
+
// A live world runs on the server clock at this many game minutes per real minute.
|
|
23
|
+
clock: z.object({ rate: z.number().int().min(1).max(MAX_CLOCK_RATE) }).optional(),
|
|
24
|
+
// How private messages travel here, such as "by a runner", and the game minutes they take.
|
|
25
|
+
// Left out, messages arrive at once, as by phone.
|
|
26
|
+
messages: messageTravelSchema.optional(),
|
|
27
|
+
currency: z.object({ symbol: z.string().min(1).max(4), name: z.string().min(1).max(40) }).nullable(),
|
|
28
|
+
// Money kept apart from anyone's purse; one held by no one moves only by the world's own happenings.
|
|
29
|
+
accounts: z.array(z.object({ id, name: z.string().min(1).max(200), holderId: id.nullable().default(null), balance: z.number(), allowsDebt: z.boolean().default(false) })).default([]),
|
|
30
|
+
places: z.array(z.object({
|
|
31
|
+
id,
|
|
32
|
+
name: z.string().min(1).max(120),
|
|
33
|
+
kind: z.enum(['room', 'outdoors', 'transit', 'private']),
|
|
34
|
+
summary: z.string().min(1).max(2000),
|
|
35
|
+
connections: z.array(id),
|
|
36
|
+
conditions: z.array(z.string().min(1).max(200)).default([]),
|
|
37
|
+
})).min(2),
|
|
38
|
+
player: z.object({
|
|
39
|
+
id,
|
|
40
|
+
name: z.string().min(1).max(120),
|
|
41
|
+
role: z.string().min(1).max(120),
|
|
42
|
+
roleId: id.nullable().default(null),
|
|
43
|
+
summary: z.string().min(1).max(2000),
|
|
44
|
+
pronouns: z.string().min(1).max(40).optional(),
|
|
45
|
+
placeId: id,
|
|
46
|
+
money: z.number().nullable(),
|
|
47
|
+
}),
|
|
48
|
+
cast: z.array(z.object({
|
|
49
|
+
id,
|
|
50
|
+
name: z.string().min(1).max(120),
|
|
51
|
+
role: z.string().min(1).max(120),
|
|
52
|
+
roleId: id.nullable().default(null),
|
|
53
|
+
summary: z.string().min(1).max(2000),
|
|
54
|
+
persona: z.string().min(1).max(2000).optional(),
|
|
55
|
+
character: characterSchema.optional(),
|
|
56
|
+
pronouns: z.string().min(1).max(40).optional(),
|
|
57
|
+
placeId: id,
|
|
58
|
+
money: z.number().nullable(),
|
|
59
|
+
mood: z.string().min(1).max(120),
|
|
60
|
+
goals: z.array(z.string().min(1).max(600)),
|
|
61
|
+
beliefs: z.array(z.object({ subject: z.string().min(1).max(200), claim: z.string().min(1).max(600) })),
|
|
62
|
+
relationships: z.record(id, z.object({ trust: z.number().int().min(-100).max(100), warmth: z.number().int().min(-100).max(100), note: z.string().max(600) })),
|
|
63
|
+
plan: z.object({ intent: z.string().min(1).max(600), seen: z.string().min(1).max(200).optional(), placeId: id.nullable(), targetId: id.nullable(), inMinutes: z.number().int().min(1).max(100_000) }).nullable(),
|
|
64
|
+
// The player starts knowing where this person is when the opening says so.
|
|
65
|
+
knownAtStart: z.boolean().default(false),
|
|
66
|
+
}).refine(person => person.persona !== undefined || person.character !== undefined, 'A character needs a profile')).min(2),
|
|
67
|
+
objects: z.array(z.object({
|
|
68
|
+
id,
|
|
69
|
+
name: z.string().min(1).max(120),
|
|
70
|
+
summary: z.string().min(1).max(2000),
|
|
71
|
+
placeId: id.nullable(),
|
|
72
|
+
holderId: id.nullable(),
|
|
73
|
+
ownerId: id.nullable(),
|
|
74
|
+
condition: z.string().min(1).max(200),
|
|
75
|
+
singlePersonMovable: z.boolean().default(true),
|
|
76
|
+
// A hidden thing is seen only by those who know where it is: these people, and its holder.
|
|
77
|
+
knownTo: z.array(id).max(64).optional(), hidden: z.boolean().optional(),
|
|
78
|
+
})),
|
|
79
|
+
kinds: z.array(kindDefinitionSchema).default([]),
|
|
80
|
+
entities: z.array(z.object({
|
|
81
|
+
id, kindId: id, name: z.string().min(1).max(200), placeId: id.nullable().default(null),
|
|
82
|
+
properties: z.record(id, propertyValueSchema).default({}), relations: z.record(id, id).default({}),
|
|
83
|
+
// A decision's voting members, and the world's problem its result settles.
|
|
84
|
+
members: z.array(id).min(1).max(12).optional(), settles: id.optional(),
|
|
85
|
+
// Who knows it from the start; left out, everyone in the world does. A hidden thing is not seen by
|
|
86
|
+
// whoever comes to its place.
|
|
87
|
+
knownTo: z.array(id).max(64).optional(), hidden: z.boolean().optional(),
|
|
88
|
+
// Money that moves when the decision passes.
|
|
89
|
+
transfers: z.array(z.object({ fromId: id.nullable(), toId: id.nullable(), amount: z.number().positive().max(1_000_000_000) })).max(4).optional(),
|
|
90
|
+
})).default([]),
|
|
91
|
+
// A fact may name its aspect, so a later happening can replace it, such as a deadline that has passed.
|
|
92
|
+
facts: z.array(z.union([z.string().min(1).max(600), z.object({ aspect: id, text: z.string().min(1).max(600) })])),
|
|
93
|
+
opening: z.object({ title: z.string().min(1).max(200), situation: z.string().min(1).max(2000), stakes: z.string().min(1).max(2000) }),
|
|
94
|
+
tension: z.object({ id, title: z.string().min(1).max(200), summary: z.string().min(1).max(2000), participantIds: z.array(id) }),
|
|
95
|
+
playerRelationships: z.record(id, z.object({ trust: z.number().int().min(-100).max(100), warmth: z.number().int().min(-100).max(100), note: z.string().max(600) })).default({}),
|
|
96
|
+
// Beats are the happenings the opening promises (the ambulances, the storm, the vote).
|
|
97
|
+
// The world carries them out when they fall due, whatever the player does.
|
|
98
|
+
// A beat with everyMinutes comes back after each time it happens: visitors, deliveries, shift changes.
|
|
99
|
+
beats: z.array(z.object({ id, inMinutes: z.number().int().min(1).max(100_000), placeId: id, text: z.string().min(1).max(600),
|
|
100
|
+
everyMinutes: z.number().int().min(1).max(100_000).optional(),
|
|
101
|
+
// What it concerns, and the typed results the world's data gives it (see docs/world-data.md).
|
|
102
|
+
concerns: id.optional(), ...beatRulesSchema.shape })).default([]),
|
|
103
|
+
});
|
|
104
|
+
export function parseLivingWorldDefinition(value) {
|
|
105
|
+
const parsed = definitionSchema.safeParse(value);
|
|
106
|
+
if (!parsed.success)
|
|
107
|
+
throw new LivingWorldError('definition-invalid', parsed.error.message);
|
|
108
|
+
const definition = parsed.data;
|
|
109
|
+
const placeIds = new Set(definition.places.map(place => place.id));
|
|
110
|
+
const peopleIds = new Set([definition.player.id, ...definition.cast.map(person => person.id)]);
|
|
111
|
+
if (peopleIds.size !== definition.cast.length + 1)
|
|
112
|
+
throw new LivingWorldError('definition-invalid', 'Every person needs a distinct id');
|
|
113
|
+
for (const place of definition.places) {
|
|
114
|
+
for (const connection of place.connections) {
|
|
115
|
+
if (!placeIds.has(connection))
|
|
116
|
+
throw new LivingWorldError('definition-invalid', `Place ${place.id} connects to unknown place ${connection}`);
|
|
117
|
+
if (connection === place.id)
|
|
118
|
+
throw new LivingWorldError('definition-invalid', `Place ${place.id} connects to itself`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
for (const person of [definition.player, ...definition.cast]) {
|
|
122
|
+
if (!placeIds.has(person.placeId))
|
|
123
|
+
throw new LivingWorldError('definition-invalid', `${person.id} starts in unknown place ${person.placeId}`);
|
|
124
|
+
}
|
|
125
|
+
for (const person of definition.cast) {
|
|
126
|
+
for (const target of Object.keys(person.relationships)) {
|
|
127
|
+
if (!peopleIds.has(target))
|
|
128
|
+
throw new LivingWorldError('definition-invalid', `${person.id} relates to unknown person ${target}`);
|
|
129
|
+
}
|
|
130
|
+
if (person.plan?.placeId && !placeIds.has(person.plan.placeId))
|
|
131
|
+
throw new LivingWorldError('definition-invalid', `${person.id} plans to reach unknown place ${person.plan.placeId}`);
|
|
132
|
+
}
|
|
133
|
+
for (const target of Object.keys(definition.playerRelationships)) {
|
|
134
|
+
if (!peopleIds.has(target))
|
|
135
|
+
throw new LivingWorldError('definition-invalid', `Player relates to unknown person ${target}`);
|
|
136
|
+
}
|
|
137
|
+
for (const object of definition.objects) {
|
|
138
|
+
if (object.placeId !== null && !placeIds.has(object.placeId))
|
|
139
|
+
throw new LivingWorldError('definition-invalid', `${object.id} sits in unknown place ${object.placeId}`);
|
|
140
|
+
if (object.holderId !== null && !peopleIds.has(object.holderId))
|
|
141
|
+
throw new LivingWorldError('definition-invalid', `${object.id} is held by unknown person ${object.holderId}`);
|
|
142
|
+
if (object.ownerId !== null && !peopleIds.has(object.ownerId))
|
|
143
|
+
throw new LivingWorldError('definition-invalid', `${object.id} is owned by unknown person ${object.ownerId}`);
|
|
144
|
+
if ((object.placeId === null) === (object.holderId === null))
|
|
145
|
+
throw new LivingWorldError('definition-invalid', `${object.id} needs exactly one of a place or a holder`);
|
|
146
|
+
}
|
|
147
|
+
for (const participant of definition.tension.participantIds) {
|
|
148
|
+
if (!peopleIds.has(participant))
|
|
149
|
+
throw new LivingWorldError('definition-invalid', `Tension names unknown person ${participant}`);
|
|
150
|
+
}
|
|
151
|
+
const accountIds = new Set(definition.accounts.map(account => account.id));
|
|
152
|
+
if (accountIds.size !== definition.accounts.length)
|
|
153
|
+
throw new LivingWorldError('definition-invalid', 'Every account needs a distinct id');
|
|
154
|
+
for (const account of definition.accounts) {
|
|
155
|
+
if (peopleIds.has(account.id))
|
|
156
|
+
throw new LivingWorldError('definition-invalid', `Account ${account.id} has the id of a person`);
|
|
157
|
+
if (account.holderId !== null && !peopleIds.has(account.holderId))
|
|
158
|
+
throw new LivingWorldError('definition-invalid', `Account ${account.id} is held by unknown person ${account.holderId}`);
|
|
159
|
+
}
|
|
160
|
+
// A vote names who may cast it and the problem it settles, and only a decision is voted on.
|
|
161
|
+
for (const entity of definition.entities) {
|
|
162
|
+
if ((entity.members !== undefined || entity.settles !== undefined || entity.transfers !== undefined) && entity.kindId !== 'decision' || entity.kindId === 'decision' && entity.members === undefined)
|
|
163
|
+
throw new LivingWorldError('definition-invalid', `${entity.id}: a decision, and only a decision, names its members`);
|
|
164
|
+
for (const member of entity.members ?? [])
|
|
165
|
+
if (!peopleIds.has(member))
|
|
166
|
+
throw new LivingWorldError('definition-invalid', `${entity.id} names unknown member ${member}`);
|
|
167
|
+
for (const knower of entity.knownTo ?? [])
|
|
168
|
+
if (!peopleIds.has(knower))
|
|
169
|
+
throw new LivingWorldError('definition-invalid', `${entity.id} is known to unknown person ${knower}`);
|
|
170
|
+
if (entity.settles !== undefined && entity.settles !== definition.tension.id)
|
|
171
|
+
throw new LivingWorldError('definition-invalid', `${entity.id} settles unknown problem ${entity.settles}`);
|
|
172
|
+
for (const end of (entity.transfers ?? []).flatMap(transfer => [transfer.fromId, transfer.toId])) {
|
|
173
|
+
const person = [definition.player, ...definition.cast].find(candidate => candidate.id === end);
|
|
174
|
+
if (end !== null && !accountIds.has(end) && person?.money === undefined)
|
|
175
|
+
throw new LivingWorldError('definition-invalid', `${entity.id} moves money through unknown person or account ${end}`);
|
|
176
|
+
if (person?.money === null)
|
|
177
|
+
throw new LivingWorldError('definition-invalid', `${entity.id} moves money through ${person.name}, who keeps no money in this world`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
for (const object of definition.objects) {
|
|
181
|
+
for (const knower of object.knownTo ?? [])
|
|
182
|
+
if (!peopleIds.has(knower))
|
|
183
|
+
throw new LivingWorldError('definition-invalid', `${object.id} is known to unknown person ${knower}`);
|
|
184
|
+
}
|
|
185
|
+
const aspects = definition.facts.flatMap(fact => typeof fact === 'string' ? [] : [fact.aspect]);
|
|
186
|
+
const repeated = aspects.filter((aspect, index) => aspects.indexOf(aspect) !== index);
|
|
187
|
+
if (repeated.length > 0)
|
|
188
|
+
throw new LivingWorldError('definition-invalid', `Every fact aspect is named once; ${repeated.join(', ')} is repeated`);
|
|
189
|
+
// A beat's typed results name only what the world has, or they would change nothing when it falls due.
|
|
190
|
+
const thingIds = new Set([...definition.objects.map(object => object.id), ...definition.entities.map(entity => entity.id)]);
|
|
191
|
+
const people = [definition.player, ...definition.cast];
|
|
192
|
+
for (const beat of definition.beats) {
|
|
193
|
+
const refuse = (message) => new LivingWorldError('definition-invalid', `Beat ${beat.id} ${message}`);
|
|
194
|
+
if (!placeIds.has(beat.placeId))
|
|
195
|
+
throw refuse(`happens in unknown place ${beat.placeId}`);
|
|
196
|
+
if (beat.concerns !== undefined && !thingIds.has(beat.concerns) && !peopleIds.has(beat.concerns) && !placeIds.has(beat.concerns) && beat.concerns !== definition.tension.id) {
|
|
197
|
+
throw refuse(`concerns ${beat.concerns}, which is no thing, person, place or problem of this world`);
|
|
198
|
+
}
|
|
199
|
+
if (beat.unless !== undefined && beat.unless.settled !== definition.tension.id)
|
|
200
|
+
throw refuse(`waits on unknown problem ${beat.unless.settled}`);
|
|
201
|
+
if (beat.then?.tension !== undefined && beat.then.tension.id !== definition.tension.id)
|
|
202
|
+
throw refuse(`changes unknown problem ${beat.then.tension.id}`);
|
|
203
|
+
for (const fact of beat.then?.facts ?? [])
|
|
204
|
+
if (!aspects.includes(fact.aspect))
|
|
205
|
+
throw refuse(`changes fact aspect ${fact.aspect}, which no fact of this world has`);
|
|
206
|
+
for (const end of (beat.then?.transfers ?? []).flatMap(transfer => [transfer.fromId, transfer.toId])) {
|
|
207
|
+
if (end === null || accountIds.has(end))
|
|
208
|
+
continue;
|
|
209
|
+
const person = people.find(candidate => candidate.id === end);
|
|
210
|
+
if (person === undefined)
|
|
211
|
+
throw refuse(`moves money through unknown person or account ${end}`);
|
|
212
|
+
if (person.money === null)
|
|
213
|
+
throw refuse(`moves money through ${person.name}, who keeps no money in this world`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (new Set(definition.beats.map(beat => beat.id)).size !== definition.beats.length)
|
|
217
|
+
throw new LivingWorldError('definition-invalid', 'Every beat needs a distinct id');
|
|
218
|
+
const objectIds = new Set(definition.objects.map(object => object.id));
|
|
219
|
+
if (objectIds.size !== definition.objects.length)
|
|
220
|
+
throw new LivingWorldError('definition-invalid', 'Every object needs a distinct id');
|
|
221
|
+
return definition;
|
|
222
|
+
}
|
|
223
|
+
// Revision 0 holds only authored facts. The opening event is the first accepted event.
|
|
224
|
+
export function createLivingState(definition, seed, engine = LIVING_ENGINE_VERSION) {
|
|
225
|
+
const person = (input) => ({
|
|
226
|
+
id: input.id,
|
|
227
|
+
name: input.name,
|
|
228
|
+
role: input.role,
|
|
229
|
+
roleId: input.roleId,
|
|
230
|
+
summary: input.summary,
|
|
231
|
+
persona: input.persona ?? input.character.voice,
|
|
232
|
+
...(input.character ? { character: input.character } : {}),
|
|
233
|
+
...(input.pronouns ? { pronouns: input.pronouns } : {}),
|
|
234
|
+
isPlayer: false,
|
|
235
|
+
placeId: input.placeId,
|
|
236
|
+
money: input.money,
|
|
237
|
+
mood: input.mood,
|
|
238
|
+
goals: input.goals.map((text, index) => ({ id: generatedId(engine, 'goal', [input.id, index + 1], `${input.id}-goal-${index + 1}`), text, status: 'active' })),
|
|
239
|
+
relationships: { ...input.relationships },
|
|
240
|
+
beliefs: (engine >= BOUNDED_PERSON_RECORDS_ENGINE ? input.beliefs.slice(-MAX_WORKING_BELIEFS) : input.beliefs).map((belief, index) => ({
|
|
241
|
+
id: generatedId(engine, 'belief', [input.id, index + 1], `${input.id}-belief-${index + 1}`), subject: belief.subject, claim: belief.claim,
|
|
242
|
+
source: { kind: 'initial', personId: null, eventSeq: 0 }, at: definition.startClock,
|
|
243
|
+
})),
|
|
244
|
+
memories: [],
|
|
245
|
+
commitments: [],
|
|
246
|
+
plan: input.plan ? { intent: input.plan.intent, ...(input.plan.seen ? { seen: input.plan.seen } : {}), placeId: input.plan.placeId, targetId: input.plan.targetId,
|
|
247
|
+
dueAt: definition.startClock + input.plan.inMinutes } : null,
|
|
248
|
+
incapacitated: false,
|
|
249
|
+
});
|
|
250
|
+
const player = {
|
|
251
|
+
id: definition.player.id,
|
|
252
|
+
name: definition.player.name,
|
|
253
|
+
role: definition.player.role,
|
|
254
|
+
roleId: definition.player.roleId,
|
|
255
|
+
summary: definition.player.summary,
|
|
256
|
+
persona: definition.player.summary,
|
|
257
|
+
...(definition.player.pronouns ? { pronouns: definition.player.pronouns } : {}),
|
|
258
|
+
isPlayer: true,
|
|
259
|
+
placeId: definition.player.placeId,
|
|
260
|
+
money: definition.player.money,
|
|
261
|
+
mood: 'Present',
|
|
262
|
+
goals: [],
|
|
263
|
+
relationships: Object.fromEntries(definition.cast.map(other => [other.id, definition.playerRelationships[other.id] ?? { trust: 0, warmth: 0, note: '' }])),
|
|
264
|
+
beliefs: [],
|
|
265
|
+
memories: [],
|
|
266
|
+
commitments: [],
|
|
267
|
+
plan: null,
|
|
268
|
+
incapacitated: false,
|
|
269
|
+
};
|
|
270
|
+
const state = {
|
|
271
|
+
schemaVersion: LIVING_SCHEMA_VERSION,
|
|
272
|
+
engine,
|
|
273
|
+
gameKind: definition.kind,
|
|
274
|
+
seed,
|
|
275
|
+
revision: 0,
|
|
276
|
+
clock: definition.startClock,
|
|
277
|
+
startClock: definition.startClock,
|
|
278
|
+
status: 'open',
|
|
279
|
+
playerId: player.id,
|
|
280
|
+
places: Object.fromEntries(definition.places.map(place => [place.id, { ...place, conditions: [...place.conditions], conditionAspects: {}, connections: [...place.connections], introducedAt: 0 }])),
|
|
281
|
+
people: Object.fromEntries([player, ...definition.cast.map(person)].map(entry => [entry.id, entry])),
|
|
282
|
+
objects: Object.fromEntries(definition.objects.map(({ knownTo, hidden, ...object }) => [object.id, {
|
|
283
|
+
...object, introducedAt: 0, ...(hidden ? { hidden: true } : {}),
|
|
284
|
+
custodyKnownTo: [...new Set([...(object.holderId && definition.cast.some(person => person.id === object.holderId
|
|
285
|
+
&& (person.knownAtStart || person.placeId === definition.player.placeId)) ? [definition.player.id] : []), ...(knownTo ?? [])])],
|
|
286
|
+
conditionKnownTo: object.placeId === definition.player.placeId || object.holderId === definition.player.id
|
|
287
|
+
? [definition.player.id] : [],
|
|
288
|
+
}])),
|
|
289
|
+
facts: definition.facts.map(fact => typeof fact === 'string' ? fact : fact.text),
|
|
290
|
+
factAspects: Object.fromEntries(definition.facts.flatMap((fact, index) => typeof fact === 'string' ? [] : [[fact.aspect, { text: fact.text, changedSeq: 0, index }]])),
|
|
291
|
+
conversations: [],
|
|
292
|
+
messages: [],
|
|
293
|
+
requests: [],
|
|
294
|
+
stances: [],
|
|
295
|
+
tensions: [{ ...definition.tension, participantIds: [...definition.tension.participantIds], status: 'open', resolution: null, changedAt: definition.startClock,
|
|
296
|
+
playerView: { title: definition.tension.title, summary: definition.tension.summary, status: 'open', resolution: null, ...(engine >= PROBLEM_VIEW_ENGINE ? { since: definition.startClock } : {}) } }],
|
|
297
|
+
schedule: [
|
|
298
|
+
...definition.cast.flatMap(member => member.plan ? [{
|
|
299
|
+
id: generatedId(engine, 'opening-plan', [member.id], `${member.id}-opening-plan`, true), at: definition.startClock + member.plan.inMinutes, personId: member.id, kind: 'plan',
|
|
300
|
+
intent: member.plan.intent, placeId: member.plan.placeId, targetId: member.plan.targetId, sourceSeq: 0, importance: 3,
|
|
301
|
+
}] : []),
|
|
302
|
+
...definition.beats.map(beat => {
|
|
303
|
+
const { id: beatId, inMinutes, placeId, text, everyMinutes, concerns, ...rules } = beat;
|
|
304
|
+
const typed = engine >= DEADLINE_ENGINE && Object.keys(rules).length > 0;
|
|
305
|
+
return {
|
|
306
|
+
id: generatedId(engine, 'beat', [beatId]), at: definition.startClock + inMinutes, personId: null, kind: 'world',
|
|
307
|
+
intent: text, placeId, targetId: engine >= DEADLINE_ENGINE ? concerns ?? null : null, sourceSeq: 0, importance: 5,
|
|
308
|
+
...(everyMinutes === undefined ? {} : { everyMinutes, series: generatedId(engine, 'beat', [beatId]) }),
|
|
309
|
+
...(typed ? { beat: { ...rules, ...(rules.deadline === undefined && rules.then !== undefined ? { deadline: true } : {}) } } : {}),
|
|
310
|
+
};
|
|
311
|
+
}),
|
|
312
|
+
].sort((a, b) => a.at - b.at || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0)),
|
|
313
|
+
sightings: Object.fromEntries(definition.cast.filter(member => member.knownAtStart || member.placeId === definition.player.placeId).map(member => [member.id, { placeId: member.placeId, at: definition.startClock }])),
|
|
314
|
+
events: [],
|
|
315
|
+
stoppingPoint: null,
|
|
316
|
+
forcedEnding: null,
|
|
317
|
+
epilogue: null,
|
|
318
|
+
opening: { ...definition.opening },
|
|
319
|
+
currency: definition.currency ? { ...definition.currency } : null,
|
|
320
|
+
...(definition.accounts.length === 0 ? {} : { accounts: Object.fromEntries(definition.accounts.map(account => [account.id, { ...account }])) }),
|
|
321
|
+
setting: definition.setting,
|
|
322
|
+
suggestions: [],
|
|
323
|
+
kinds: sharedKindMap(engine),
|
|
324
|
+
kindRequests: [],
|
|
325
|
+
entities: {},
|
|
326
|
+
entityPlaceIds: {},
|
|
327
|
+
globalEntityIds: [],
|
|
328
|
+
entityMoveSubjectIds: {},
|
|
329
|
+
globalEntityRefs: {},
|
|
330
|
+
worldEntityIds: {},
|
|
331
|
+
meterSchedule: [],
|
|
332
|
+
changes: [],
|
|
333
|
+
clockRate: null,
|
|
334
|
+
paused: false,
|
|
335
|
+
clockAnchor: null,
|
|
336
|
+
messageTravel: engine >= MESSAGE_TRAVEL_ENGINE && definition.messages ? { ...definition.messages } : null,
|
|
337
|
+
chronicle: [],
|
|
338
|
+
thingNotes: {},
|
|
339
|
+
};
|
|
340
|
+
return parseLivingState(state);
|
|
341
|
+
}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import type { LivingEvent } from './types.js';
|
|
2
|
+
import type { LivingState } from './types.js';
|
|
3
|
+
export type LivingPlayerFrame = ReturnType<typeof makeLivingPlayerFrame>;
|
|
4
|
+
export declare function makeLivingPlayerFrame(state: LivingState): {
|
|
5
|
+
revision: number;
|
|
6
|
+
status: "open" | "finished";
|
|
7
|
+
gameKind: string;
|
|
8
|
+
clock: {
|
|
9
|
+
minutes: number;
|
|
10
|
+
label: string;
|
|
11
|
+
rate: number | null;
|
|
12
|
+
paused: boolean;
|
|
13
|
+
anchor: {
|
|
14
|
+
game: number;
|
|
15
|
+
real: number;
|
|
16
|
+
} | null;
|
|
17
|
+
};
|
|
18
|
+
player: {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
role: string;
|
|
22
|
+
summary: string;
|
|
23
|
+
placeId: string;
|
|
24
|
+
money: number | null;
|
|
25
|
+
incapacitated: boolean;
|
|
26
|
+
condition: string | null;
|
|
27
|
+
held: {
|
|
28
|
+
by: string | null;
|
|
29
|
+
reason: string;
|
|
30
|
+
} | null;
|
|
31
|
+
doing: {
|
|
32
|
+
what: string;
|
|
33
|
+
until: string;
|
|
34
|
+
} | null;
|
|
35
|
+
holding: {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
condition: string;
|
|
39
|
+
}[];
|
|
40
|
+
};
|
|
41
|
+
opening: {
|
|
42
|
+
title: string;
|
|
43
|
+
situation: string;
|
|
44
|
+
stakes: string;
|
|
45
|
+
};
|
|
46
|
+
currency: {
|
|
47
|
+
symbol: string;
|
|
48
|
+
name: string;
|
|
49
|
+
} | null;
|
|
50
|
+
messageTravel: {
|
|
51
|
+
minutes: number;
|
|
52
|
+
how: string;
|
|
53
|
+
} | null;
|
|
54
|
+
scene: {
|
|
55
|
+
people: {
|
|
56
|
+
canTalk: boolean;
|
|
57
|
+
holding: string[];
|
|
58
|
+
mood: null;
|
|
59
|
+
condition: string | null;
|
|
60
|
+
doing: string | null;
|
|
61
|
+
held: null;
|
|
62
|
+
incapacitated: boolean;
|
|
63
|
+
arrived?: string | undefined;
|
|
64
|
+
id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
role: string;
|
|
67
|
+
pronouns: string;
|
|
68
|
+
summary: string;
|
|
69
|
+
}[];
|
|
70
|
+
entities: {
|
|
71
|
+
here: boolean;
|
|
72
|
+
details: string[];
|
|
73
|
+
writing: string[];
|
|
74
|
+
refereeOnly?: {
|
|
75
|
+
when: string;
|
|
76
|
+
what: string;
|
|
77
|
+
} | undefined;
|
|
78
|
+
properties: {
|
|
79
|
+
[k: string]: string | number | boolean | undefined;
|
|
80
|
+
};
|
|
81
|
+
relations: {
|
|
82
|
+
[k: string]: string;
|
|
83
|
+
};
|
|
84
|
+
members?: string[] | undefined;
|
|
85
|
+
condition?: string | undefined;
|
|
86
|
+
holderId?: string | null | undefined;
|
|
87
|
+
id: string;
|
|
88
|
+
kindId: string;
|
|
89
|
+
kindName: string;
|
|
90
|
+
name: string;
|
|
91
|
+
}[];
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
kind: "private" | "transit" | "room" | "outdoors";
|
|
95
|
+
summary: string;
|
|
96
|
+
conditions: string[];
|
|
97
|
+
objects: {
|
|
98
|
+
refereeOnly?: {
|
|
99
|
+
when: string;
|
|
100
|
+
what: string;
|
|
101
|
+
} | undefined;
|
|
102
|
+
id: string;
|
|
103
|
+
name: string;
|
|
104
|
+
summary: string;
|
|
105
|
+
condition: string;
|
|
106
|
+
singlePersonMovable: boolean;
|
|
107
|
+
ownerName: string | null;
|
|
108
|
+
}[];
|
|
109
|
+
exits: {
|
|
110
|
+
id: string;
|
|
111
|
+
name: string;
|
|
112
|
+
}[];
|
|
113
|
+
};
|
|
114
|
+
places: {
|
|
115
|
+
id: string;
|
|
116
|
+
name: string;
|
|
117
|
+
kind: "private" | "transit" | "room" | "outdoors";
|
|
118
|
+
summary: string;
|
|
119
|
+
conditions: string[];
|
|
120
|
+
here: boolean;
|
|
121
|
+
reachable: boolean;
|
|
122
|
+
travelMinutes: number | null;
|
|
123
|
+
knownPeopleIds: string[];
|
|
124
|
+
connections: string[];
|
|
125
|
+
introducedAt: number;
|
|
126
|
+
}[];
|
|
127
|
+
people: {
|
|
128
|
+
id: string;
|
|
129
|
+
name: string;
|
|
130
|
+
role: string | null;
|
|
131
|
+
summary: string;
|
|
132
|
+
arrived: {
|
|
133
|
+
at: number;
|
|
134
|
+
label: string;
|
|
135
|
+
} | null;
|
|
136
|
+
here: boolean;
|
|
137
|
+
mood: null;
|
|
138
|
+
condition: string | null;
|
|
139
|
+
incapacitated: boolean;
|
|
140
|
+
lastSeen: {
|
|
141
|
+
placeId: string;
|
|
142
|
+
at: number;
|
|
143
|
+
label: string;
|
|
144
|
+
current: boolean;
|
|
145
|
+
heading: boolean;
|
|
146
|
+
gone: boolean;
|
|
147
|
+
away: boolean;
|
|
148
|
+
goneAt: number | null;
|
|
149
|
+
goneLabel: string | null;
|
|
150
|
+
} | null;
|
|
151
|
+
holding: string[];
|
|
152
|
+
}[];
|
|
153
|
+
conversation: {
|
|
154
|
+
id: string;
|
|
155
|
+
participantIds: string[];
|
|
156
|
+
ended: boolean;
|
|
157
|
+
lines: {
|
|
158
|
+
speaker: string;
|
|
159
|
+
speakerId: string;
|
|
160
|
+
to: string[];
|
|
161
|
+
text: string;
|
|
162
|
+
}[];
|
|
163
|
+
} | null;
|
|
164
|
+
suggestions: string[];
|
|
165
|
+
deadlines: {
|
|
166
|
+
what: string;
|
|
167
|
+
label: string;
|
|
168
|
+
passed: boolean;
|
|
169
|
+
averted?: true;
|
|
170
|
+
unless?: string;
|
|
171
|
+
}[];
|
|
172
|
+
votes: {
|
|
173
|
+
id: string;
|
|
174
|
+
name: string;
|
|
175
|
+
question: string;
|
|
176
|
+
closes: string | null;
|
|
177
|
+
count: string | null;
|
|
178
|
+
}[];
|
|
179
|
+
inbox: {
|
|
180
|
+
id: string;
|
|
181
|
+
at: number;
|
|
182
|
+
label: string;
|
|
183
|
+
fromId: string;
|
|
184
|
+
from: string;
|
|
185
|
+
toIds: string[];
|
|
186
|
+
to: string[];
|
|
187
|
+
text: string;
|
|
188
|
+
mine: boolean;
|
|
189
|
+
onTheWay: boolean;
|
|
190
|
+
}[];
|
|
191
|
+
tensions: {
|
|
192
|
+
id: string;
|
|
193
|
+
title: string;
|
|
194
|
+
summary: string;
|
|
195
|
+
latest: string | null;
|
|
196
|
+
status: "settled" | "open";
|
|
197
|
+
resolution: string | null;
|
|
198
|
+
participants: string[];
|
|
199
|
+
sinceLabel: string | null;
|
|
200
|
+
latestLabel: string | null;
|
|
201
|
+
}[];
|
|
202
|
+
recent: {
|
|
203
|
+
seq: number;
|
|
204
|
+
at: number;
|
|
205
|
+
label: string;
|
|
206
|
+
kind: "message" | "plan" | "finish" | "wait" | "tick" | "world" | "attempt" | "move" | "opening" | "clock" | "arrive" | "speech" | "reaction" | "keep-playing";
|
|
207
|
+
actorId: string | null;
|
|
208
|
+
actor: string | null;
|
|
209
|
+
placeId: string | null;
|
|
210
|
+
place: string | null;
|
|
211
|
+
summary: string;
|
|
212
|
+
narration: string | null;
|
|
213
|
+
outcome: "failed" | "partial" | "succeeded" | "impossible" | null;
|
|
214
|
+
mine: boolean;
|
|
215
|
+
noticed: boolean;
|
|
216
|
+
changes: string[];
|
|
217
|
+
}[];
|
|
218
|
+
engine: number;
|
|
219
|
+
stoppingPoint: {
|
|
220
|
+
at: number;
|
|
221
|
+
tensionId: string;
|
|
222
|
+
title: string;
|
|
223
|
+
summary: string;
|
|
224
|
+
label: string;
|
|
225
|
+
} | null;
|
|
226
|
+
forcedEnding: string | null;
|
|
227
|
+
epilogue: {
|
|
228
|
+
label: string;
|
|
229
|
+
title: string;
|
|
230
|
+
text: string;
|
|
231
|
+
at: number;
|
|
232
|
+
verdict?: string | undefined;
|
|
233
|
+
highlights?: string[] | undefined;
|
|
234
|
+
cast?: {
|
|
235
|
+
name: string;
|
|
236
|
+
line: string;
|
|
237
|
+
}[] | undefined;
|
|
238
|
+
closing?: string | undefined;
|
|
239
|
+
} | null;
|
|
240
|
+
};
|
|
241
|
+
export declare function livingPlayerFeed(state: LivingState, events: readonly LivingEvent[]): LivingFeedItem[];
|
|
242
|
+
export type LivingFeedItem = ReturnType<typeof feedItem>;
|
|
243
|
+
declare function feedItem(state: LivingState, event: LivingEvent): {
|
|
244
|
+
seq: number;
|
|
245
|
+
at: number;
|
|
246
|
+
label: string;
|
|
247
|
+
kind: "message" | "plan" | "finish" | "wait" | "tick" | "world" | "attempt" | "move" | "opening" | "clock" | "arrive" | "speech" | "reaction" | "keep-playing";
|
|
248
|
+
actorId: string | null;
|
|
249
|
+
actor: string | null;
|
|
250
|
+
placeId: string | null;
|
|
251
|
+
place: string | null;
|
|
252
|
+
summary: string;
|
|
253
|
+
narration: string | null;
|
|
254
|
+
outcome: "failed" | "partial" | "succeeded" | "impossible" | null;
|
|
255
|
+
mine: boolean;
|
|
256
|
+
noticed: boolean;
|
|
257
|
+
changes: string[];
|
|
258
|
+
};
|
|
259
|
+
export {};
|