@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.
- package/README.md +629 -167
- package/RUST_THIRD_PARTY_LICENSES.txt +5 -5
- package/bin/zmux-darwin-arm64 +0 -0
- package/bin/zmux-linux-x64 +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-tui-linux-x64 +0 -0
- package/bin/zterm-darwin-arm64 +2 -2
- package/dist/App.js +6 -1
- package/dist/agent/agent.d.ts +21 -15
- package/dist/agent/agent.js +389 -163
- package/dist/agent/backends/codex_app_server.d.ts +7 -1
- package/dist/agent/backends/codex_app_server.js +11 -1
- package/dist/agent/backends/gemini.js +22 -8
- package/dist/agent/commands/batch.js +8 -0
- package/dist/agent/commands/config.js +10 -0
- package/dist/agent/commands/environment.js +5 -5
- package/dist/agent/commands/goal.d.ts +1 -0
- package/dist/agent/commands/goal.js +2 -1
- package/dist/agent/commands/index.js +2 -1
- package/dist/agent/commands/manifest.js +4 -0
- package/dist/agent/commands/optimize.js +5 -2
- package/dist/agent/commands/pane_cli.d.ts +29 -0
- package/dist/agent/commands/pane_cli.js +303 -0
- package/dist/agent/commands/settings.js +13 -3
- package/dist/agent/commands/shannon.js +8 -0
- package/dist/agent/commands/update.js +15 -3
- package/dist/agent/commands/zerg.js +31 -1
- package/dist/agent/commands/ztc_pane.js +3 -1
- package/dist/agent/factory.d.ts +4 -0
- package/dist/agent/factory.js +11 -1
- package/dist/agent/loop_policy.d.ts +42 -5
- package/dist/agent/loop_policy.js +206 -3
- package/dist/agent/runtime/command_jobs.d.ts +5 -0
- package/dist/agent/runtime/command_jobs.js +241 -31
- package/dist/agent/runtime/command_wait.d.ts +2 -0
- package/dist/agent/runtime/command_wait.js +1 -0
- package/dist/agent/runtime/done_report.d.ts +18 -0
- package/dist/agent/runtime/done_report.js +130 -0
- package/dist/agent/runtime/execution_context.js +4 -1
- package/dist/agent/runtime/failure_cause.d.ts +2 -0
- package/dist/agent/runtime/failure_cause.js +35 -0
- package/dist/agent/runtime/policy.d.ts +14 -2
- package/dist/agent/runtime/policy.js +104 -12
- package/dist/agent/runtime/quiet_job.d.ts +18 -0
- package/dist/agent/runtime/quiet_job.js +48 -0
- package/dist/agent/runtime/recovery.d.ts +1 -5
- package/dist/agent/runtime/recovery.js +2 -44
- package/dist/agent/runtime/tool_runtime.d.ts +1 -0
- package/dist/agent/runtime/tool_runtime.js +2 -0
- package/dist/agent/subagent.js +6 -1
- package/dist/agent/tools/deferred.js +1 -0
- package/dist/agent/tools/index.d.ts +2 -0
- package/dist/agent/tools/index.js +1 -0
- package/dist/agent/tools/outcome.d.ts +15 -0
- package/dist/agent/tools/outcome.js +107 -0
- package/dist/agent/tools/pane.d.ts +2 -1
- package/dist/agent/tools/pane.js +21 -3
- package/dist/agent/tools/registry.js +2 -0
- package/dist/agent/tools/shell.d.ts +1 -0
- package/dist/agent/tools/shell.js +128 -17
- package/dist/agent/tools/sim_domain_tools.js +4 -2
- package/dist/agent/tools/supervision.js +4 -2
- package/dist/agent/tools/types.d.ts +3 -0
- package/dist/app/command_context.js +5 -9
- package/dist/app/conversation_compaction.d.ts +4 -2
- package/dist/app/conversation_compaction.js +16 -5
- package/dist/app/headless_shell_mode.d.ts +14 -0
- package/dist/app/headless_shell_mode.js +7 -0
- package/dist/app/hosted_resident.d.ts +356 -0
- package/dist/app/hosted_resident.js +677 -0
- package/dist/app/restart.js +11 -2
- package/dist/app/session_manager.d.ts +5 -0
- package/dist/app/session_manager.js +21 -6
- package/dist/app/session_messages.js +6 -6
- package/dist/app/workspace_layout_controller.js +7 -0
- package/dist/batch/worktree.d.ts +10 -0
- package/dist/batch/worktree.js +15 -0
- package/dist/bench/registry.js +4 -2
- package/dist/cli_args.js +1 -1
- package/dist/cli_main.js +80 -10
- package/dist/cli_ratatui.d.ts +75 -0
- package/dist/cli_ratatui.js +485 -84
- package/dist/components/InputArea.js +4 -4
- package/dist/config/execution.d.ts +10 -0
- package/dist/config/execution.js +10 -0
- package/dist/config/hosted_runtime.d.ts +4 -1
- package/dist/config/hosted_runtime.js +4 -1
- package/dist/config/permission_pin.d.ts +34 -2
- package/dist/config/permission_pin.js +52 -2
- package/dist/config/person_command_policy.d.ts +38 -0
- package/dist/config/person_command_policy.js +11 -0
- package/dist/config/profiles.d.ts +21 -0
- package/dist/config/profiles.js +56 -2
- package/dist/config/types.d.ts +4 -1
- package/dist/config.js +34 -19
- package/dist/desktop/daily/codex_exec_adapter.js +7 -2
- package/dist/desktop/daily/desktop_wiring.d.ts +7 -1
- package/dist/desktop/daily/desktop_wiring.js +11 -3
- package/dist/desktop/daily/recipes.js +20 -4
- package/dist/desktop/health.d.ts +24 -0
- package/dist/desktop/health.js +151 -0
- package/dist/desktop/native_dialogs.d.ts +37 -0
- package/dist/desktop/native_dialogs.js +105 -0
- package/dist/diagnostics/session_export.d.ts +1 -0
- package/dist/diagnostics/session_export.js +28 -0
- package/dist/embedded/registry.js +4 -2
- package/dist/emulation/tool_adapters.js +9 -4
- package/dist/emulation/ztc_addendum.js +3 -0
- package/dist/headless.d.ts +11 -4
- package/dist/headless.js +99 -34
- package/dist/headless_approval.d.ts +6 -0
- package/dist/headless_cli.js +1 -1
- package/dist/hooks/runner.js +7 -6
- package/dist/library.d.ts +4 -0
- package/dist/library.js +3 -0
- package/dist/mcp/client.js +3 -3
- package/dist/modes/registry.js +13 -4
- package/dist/onboarding/setup_environment.js +13 -1
- package/dist/optimize/adapters/kernelbench.js +88 -10
- package/dist/optimize/adapters/types.d.ts +5 -0
- package/dist/optimize/executor.js +21 -0
- package/dist/panes/cli_install.d.ts +54 -0
- package/dist/panes/cli_install.js +157 -0
- package/dist/panes/model_catalog.js +3 -0
- package/dist/panes/new_pane_choices.d.ts +6 -2
- package/dist/panes/new_pane_choices.js +24 -12
- package/dist/panes/pane_cli_launch.d.ts +50 -0
- package/dist/panes/pane_cli_launch.js +124 -0
- package/dist/panes/pane_clis.d.ts +171 -0
- package/dist/panes/pane_clis.js +325 -0
- package/dist/panes/person_only_panes.d.ts +45 -0
- package/dist/panes/person_only_panes.js +117 -0
- package/dist/plugin/simulation_living.js +0 -2
- package/dist/plugin/simulation_living_engine.d.ts +1 -0
- package/dist/plugin/simulation_living_engine.js +1 -0
- package/dist/plugin/simulation_living_labels.d.ts +3 -0
- package/dist/plugin/simulation_living_labels.js +2 -0
- package/dist/router_auth.js +12 -1
- package/dist/session.js +26 -1
- package/dist/simulation/art/gemini_image.js +11 -5
- package/dist/simulation/domains/loader.js +25 -3
- package/dist/simulation/living/cold.d.ts +23 -0
- package/dist/simulation/living/cold.js +41 -0
- package/dist/simulation/living/context.d.ts +591 -1283
- package/dist/simulation/living/context.js +378 -244
- package/dist/simulation/living/contradictions.d.ts +14 -0
- package/dist/simulation/living/contradictions.js +282 -0
- package/dist/simulation/living/core/ids.d.ts +53 -0
- package/dist/simulation/living/core/ids.js +39 -0
- package/dist/simulation/living/core/kind.d.ts +20 -0
- package/dist/simulation/living/core/kind.js +15 -0
- package/dist/simulation/living/core/laws.d.ts +179 -0
- package/dist/simulation/living/core/laws.js +184 -0
- package/dist/simulation/living/core/ops.d.ts +257 -0
- package/dist/simulation/living/core/ops.js +34 -0
- package/dist/simulation/living/definer.d.ts +17 -1
- package/dist/simulation/living/definer.js +130 -51
- package/dist/simulation/living/definition.d.ts +174 -65
- package/dist/simulation/living/definition.js +287 -180
- package/dist/simulation/living/director.d.ts +80 -0
- package/dist/simulation/living/director.js +363 -0
- package/dist/simulation/living/frame.d.ts +108 -21
- package/dist/simulation/living/frame.js +111 -66
- package/dist/simulation/living/identifiers.d.ts +0 -1
- package/dist/simulation/living/identifiers.js +0 -3
- package/dist/simulation/living/index.d.ts +18 -9
- package/dist/simulation/living/index.js +18 -9
- package/dist/simulation/living/inference.d.ts +92 -50
- package/dist/simulation/living/inference.js +319 -175
- package/dist/simulation/living/knowledge.d.ts +28 -0
- package/dist/simulation/living/knowledge.js +73 -0
- package/dist/simulation/living/library.json +1177 -0
- package/dist/simulation/living/mechanics.d.ts +31 -34
- package/dist/simulation/living/mechanics.js +222 -138
- package/dist/simulation/living/model-input.d.ts +6 -3
- package/dist/simulation/living/model-input.js +18 -26
- package/dist/simulation/living/open-world.d.ts +74 -94
- package/dist/simulation/living/open-world.js +151 -30
- package/dist/simulation/living/phrases.d.ts +3 -0
- package/dist/simulation/living/phrases.js +37 -0
- package/dist/simulation/living/phrases.json +560 -0
- package/dist/simulation/living/projection.d.ts +316 -2
- package/dist/simulation/living/projection.js +50 -2
- package/dist/simulation/living/prompts/example-spec.json +11 -0
- package/dist/simulation/living/prompts/role-text.json +14 -0
- package/dist/simulation/living/prompts.d.ts +5 -0
- package/dist/simulation/living/prompts.js +275 -0
- package/dist/simulation/living/recall.d.ts +2 -2
- package/dist/simulation/living/reduce.d.ts +51 -14
- package/dist/simulation/living/reduce.js +941 -579
- package/dist/simulation/living/replay.d.ts +5 -4
- package/dist/simulation/living/replay.js +10 -9
- package/dist/simulation/living/runtime.d.ts +135 -25
- package/dist/simulation/living/runtime.js +1641 -583
- package/dist/simulation/living/scale.d.ts +96 -0
- package/dist/simulation/living/scale.js +124 -0
- package/dist/simulation/living/script.d.ts +5 -0
- package/dist/simulation/living/script.js +115 -0
- package/dist/simulation/living/shared-kinds.d.ts +4 -11
- package/dist/simulation/living/shared-kinds.js +11 -81
- package/dist/simulation/living/space.d.ts +14 -0
- package/dist/simulation/living/space.js +132 -0
- package/dist/simulation/living/state.d.ts +100 -0
- package/dist/simulation/living/state.js +393 -0
- package/dist/simulation/living/types.d.ts +829 -512
- package/dist/simulation/living/types.js +162 -187
- package/dist/simulation/living/world-rules.d.ts +100 -0
- package/dist/simulation/living/world-rules.js +267 -0
- package/dist/simulation/plugins/loader.js +11 -0
- package/dist/skills/loader.js +4 -0
- package/dist/tools.d.ts +1 -0
- package/dist/tools.js +1 -0
- package/dist/ui/ratatui/headless_pane_manager.d.ts +4 -1
- package/dist/ui/ratatui/headless_pane_manager.js +13 -9
- package/dist/ui/ratatui/pane_relay.js +29 -0
- package/dist/ui/ratatui/pane_type.d.ts +10 -0
- package/dist/ui/ratatui/pane_type.js +11 -0
- package/dist/ui/ratatui/process.d.ts +30 -0
- package/dist/ui/ratatui/process.js +133 -19
- package/dist/ui/ratatui/protocol.d.ts +124 -2
- package/dist/ui/ratatui/protocol.js +35 -0
- package/dist/ui/ratatui/relay_policy.js +3 -0
- package/dist/ui/ratatui/ztc_launch_trust.d.ts +2 -1
- package/dist/ui/ratatui/ztc_launch_trust.js +8 -1
- package/dist/ui/terminal_image.d.ts +12 -0
- package/dist/ui/terminal_image.js +21 -1
- package/dist/utils/codex_project_trust.d.ts +19 -0
- package/dist/utils/codex_project_trust.js +37 -0
- package/dist/utils/compaction.js +103 -20
- package/dist/utils/git_program_files.d.ts +19 -12
- package/dist/utils/git_program_files.js +411 -83
- package/dist/utils/host_shell.d.ts +10 -1
- package/dist/utils/host_shell.js +14 -1
- package/dist/utils/mid_turn_compaction.d.ts +2 -0
- package/dist/utils/mid_turn_compaction.js +2 -0
- package/dist/utils/models.js +6 -1
- package/dist/utils/sandbox.d.ts +109 -8
- package/dist/utils/sandbox.js +981 -187
- package/dist/utils/shell.d.ts +2 -0
- package/dist/utils/shell.js +10 -4
- package/dist/utils/subprocess_env.d.ts +47 -11
- package/dist/utils/subprocess_env.js +107 -15
- package/dist/utils/system_ps.d.ts +8 -0
- package/dist/utils/system_ps.js +39 -7
- package/dist/utils/unattended_compaction.d.ts +9 -0
- package/dist/utils/unattended_compaction.js +13 -0
- package/dist/utils/ztc_own_state.d.ts +8 -5
- package/dist/utils/ztc_own_state.js +17 -11
- package/dist/web/mirror_client.js +1 -0
- package/dist/web/mirror_stream.d.ts +50 -6
- package/dist/web/mirror_stream.js +160 -15
- package/dist/workflows/registry.js +3 -1
- package/dist/workspace/controller.js +12 -0
- package/dist/workspace_collision.d.ts +3 -0
- package/dist/workspace_collision.js +14 -1
- package/dist/workspace_session_context.js +2 -1
- package/dist/zlm-embed.mjs +3823 -1970
- package/node_modules/@zerg/model-contracts/README.md +16 -4
- package/node_modules/@zerg/model-contracts/index.js +6 -1
- package/npm-shrinkwrap.json +1 -1
- package/package.json +42 -24
- package/packages/model-contracts/README.md +16 -4
- package/packages/model-contracts/index.js +6 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type LivingEvent, type
|
|
3
|
-
|
|
4
|
-
export declare function
|
|
1
|
+
import { type LivingWorldDefinitionRaw } from './definition.js';
|
|
2
|
+
import { type LivingEvent, type LivingStateRaw } from './types.js';
|
|
3
|
+
import { type ColdStore } from './cold.js';
|
|
4
|
+
export declare function replayLivingWorld(definition: LivingWorldDefinitionRaw, seed: string, events: readonly LivingEvent[], cold?: ColdStore, admissionCapsFrom?: number): LivingStateRaw;
|
|
5
|
+
export declare function verifyLivingWorld(definition: LivingWorldDefinitionRaw, saved: LivingStateRaw, events: readonly LivingEvent[], cold?: ColdStore): {
|
|
5
6
|
exact: boolean;
|
|
6
7
|
};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { createLivingState } from './definition.js';
|
|
2
2
|
import { foldLivingEvents } from './reduce.js';
|
|
3
|
+
import { capsBoundaryOf } from './state.js';
|
|
3
4
|
import { LIVING_ENGINE_VERSION, LivingWorldError } from './types.js';
|
|
5
|
+
import { MemoryColdStore } from './cold.js';
|
|
4
6
|
// Replay folds the saved events over the authored definition. It never asks a model
|
|
5
7
|
// and never invents an outcome; a saved state that differs from the fold is rejected.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return foldLivingEvents(createLivingState(definition, seed, engine), events);
|
|
8
|
+
export function replayLivingWorld(definition, seed, events, cold = new MemoryColdStore(), admissionCapsFrom = 1) {
|
|
9
|
+
const initial = createLivingState(definition, seed);
|
|
10
|
+
initial.admissionCapsFrom = admissionCapsFrom;
|
|
11
|
+
return foldLivingEvents(initial, events, cold);
|
|
11
12
|
}
|
|
12
|
-
export function verifyLivingWorld(definition, saved, events) {
|
|
13
|
-
|
|
13
|
+
export function verifyLivingWorld(definition, saved, events, cold = new MemoryColdStore()) {
|
|
14
|
+
if (saved.engine !== LIVING_ENGINE_VERSION)
|
|
15
|
+
throw new LivingWorldError('engine-retired', `This world was made by engine ${saved.engine}; only engine ${LIVING_ENGINE_VERSION} worlds open.`);
|
|
16
|
+
const replayed = replayLivingWorld(definition, saved.seed, events, cold, capsBoundaryOf(saved));
|
|
14
17
|
if (replayed.revision !== saved.revision)
|
|
15
18
|
throw new LivingWorldError('replay-mismatch', `Replay reached revision ${replayed.revision}, saved state is at ${saved.revision}`);
|
|
16
|
-
if (saved.engine !== LIVING_ENGINE_VERSION)
|
|
17
|
-
return { exact: false };
|
|
18
19
|
if (!isDeepStrictEqual(replayed, saved))
|
|
19
20
|
throw new LivingWorldError('replay-mismatch', 'Replayed state differs from the saved state');
|
|
20
21
|
return { exact: true };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type LivingWorldDefinitionRaw } from './definition.js';
|
|
2
2
|
import { type GmEffectRecord, type LivingInference, type LivingInferenceCall } from './inference.js';
|
|
3
3
|
import type { LivingKindDefinition } from './open-world.js';
|
|
4
|
-
import {
|
|
4
|
+
import { peopleAt } from './reduce.js';
|
|
5
|
+
import { type LivingCalendar } from './scale.js';
|
|
6
|
+
import { type LivingEffect, type LivingEvent, type LivingPerson, type LivingStateRaw } from './types.js';
|
|
7
|
+
import type { LivingState } from './types.js';
|
|
8
|
+
import type { ColdStore } from './cold.js';
|
|
9
|
+
export type LivingStateView = LivingState;
|
|
5
10
|
export type LivingCommand = {
|
|
6
11
|
kind: 'move';
|
|
7
12
|
placeId: string;
|
|
@@ -23,9 +28,10 @@ export type LivingCommand = {
|
|
|
23
28
|
} | {
|
|
24
29
|
kind: 'finish';
|
|
25
30
|
} | {
|
|
26
|
-
kind: '
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
kind: 'choose';
|
|
32
|
+
entityId: string;
|
|
33
|
+
slotId: string;
|
|
34
|
+
option: string;
|
|
29
35
|
};
|
|
30
36
|
export type LivingAuditRecord = {
|
|
31
37
|
phase: LivingInferenceCall['phase'];
|
|
@@ -33,12 +39,13 @@ export type LivingAuditRecord = {
|
|
|
33
39
|
actorId: string | null;
|
|
34
40
|
status: 'accepted' | 'rejected' | 'failed';
|
|
35
41
|
failureCode: string | null;
|
|
42
|
+
reasons?: string[];
|
|
36
43
|
inputSha256: string;
|
|
37
44
|
outputSha256: string | null;
|
|
38
45
|
latencyMs: number;
|
|
39
46
|
};
|
|
40
47
|
export type LivingStep = {
|
|
41
|
-
state:
|
|
48
|
+
state: LivingStateRaw;
|
|
42
49
|
events: LivingEvent[];
|
|
43
50
|
audit: LivingAuditRecord[];
|
|
44
51
|
modelCalls: number;
|
|
@@ -49,53 +56,74 @@ type DecisionTurn = {
|
|
|
49
56
|
done: Promise<void>;
|
|
50
57
|
end: () => void;
|
|
51
58
|
};
|
|
59
|
+
type TurnGate = {
|
|
60
|
+
session: object;
|
|
61
|
+
count: number;
|
|
62
|
+
done: Promise<void>;
|
|
63
|
+
end: () => void;
|
|
64
|
+
};
|
|
52
65
|
export type LivingWorldCell = {
|
|
53
|
-
state:
|
|
66
|
+
state: LivingStateRaw;
|
|
54
67
|
readonly log?: LivingEvent[];
|
|
55
68
|
turns?: Map<string, DecisionTurn>;
|
|
69
|
+
turnPriority?: Map<string, TurnGate>;
|
|
70
|
+
cold?: ColdStore;
|
|
71
|
+
onCommit?: (event: LivingEvent) => void;
|
|
72
|
+
onAnswering?: (personId: string, answering: boolean) => void;
|
|
56
73
|
};
|
|
57
74
|
export type LivingWork = {
|
|
58
75
|
kind: 'recover';
|
|
59
76
|
personId: string;
|
|
60
77
|
} | {
|
|
61
78
|
kind: 'due';
|
|
62
|
-
item:
|
|
79
|
+
item: LivingStateRaw['schedule'][number];
|
|
63
80
|
} | {
|
|
64
81
|
kind: 'decide';
|
|
65
82
|
personId: string;
|
|
83
|
+
} | {
|
|
84
|
+
kind: 'steward';
|
|
85
|
+
facet: string;
|
|
86
|
+
kindId: string;
|
|
66
87
|
};
|
|
67
88
|
export declare const MAX_DUE_ITEMS_PER_STEP = 2;
|
|
68
89
|
export declare const MAX_DUE_ERRANDS_PER_STEP = 4;
|
|
69
90
|
export declare const MAX_REACTORS = 2;
|
|
70
91
|
export declare const MAX_MODEL_CALLS_PER_COMMAND = 6;
|
|
71
|
-
export declare const MAX_NONPLAYER_MINUTES_PER_COMMAND = 20;
|
|
72
92
|
export declare const SHOCK_IMPORTANCE = 7;
|
|
73
|
-
export declare const SHOCK_PLAN_DELAY_MINUTES = 5;
|
|
74
|
-
export declare const OTHERS_MAX_MINUTES = 10;
|
|
75
|
-
export declare const LONG_ACT_MINUTES = 10;
|
|
76
|
-
export declare const DEADLINE_GRACE_MINUTES = 15;
|
|
77
|
-
export declare const ERRAND_DELAY_MINUTES = 3;
|
|
78
|
-
export declare const SPEECH_MINUTES = 1;
|
|
79
|
-
export declare const MESSAGE_MINUTES = 1;
|
|
80
|
-
export declare const MESSAGE_REPLY_DELAY_MINUTES = 10;
|
|
81
|
-
export declare const IDLE_WAIT_MINUTES = 60;
|
|
82
|
-
export declare const OVERDUE_WAIT_MINUTES = 15;
|
|
83
93
|
export declare const PLAYER_MAX_TEXT_BYTES = 2000;
|
|
84
|
-
export declare const
|
|
94
|
+
export declare const OBJECTIVE_EFFECT_KINDS: ReadonlySet<string>;
|
|
95
|
+
export declare const EFFECT_KINDS: Readonly<{
|
|
96
|
+
say: "say";
|
|
97
|
+
message: "message";
|
|
98
|
+
requestOpen: "request.open";
|
|
99
|
+
requestUpdate: "request.update";
|
|
100
|
+
stance: "stance";
|
|
101
|
+
normViolation: "norm.violation";
|
|
102
|
+
}>;
|
|
103
|
+
export declare const EVENT_KINDS: Readonly<{
|
|
104
|
+
message: "message";
|
|
105
|
+
}>;
|
|
106
|
+
export declare const SCHEDULE_KINDS: Readonly<{
|
|
107
|
+
plan: "plan";
|
|
108
|
+
}>;
|
|
109
|
+
export declare const PLAN_OVERDUE_PACE: "defaultActivity";
|
|
110
|
+
export declare function planOverdueAfter(calendar: LivingCalendar): number;
|
|
85
111
|
export declare function cleanMood(value: unknown, fallback: string): string;
|
|
86
|
-
export declare function
|
|
87
|
-
export declare function
|
|
112
|
+
export declare function validateLivingWorldDefinition(value: unknown): LivingWorldDefinitionRaw;
|
|
113
|
+
export declare function startLivingWorld(definition: LivingWorldDefinitionRaw, seed: string, nowMs?: number): LivingStep;
|
|
114
|
+
export declare function livingClockTarget(state: LivingStateRaw, nowMs: number): number;
|
|
88
115
|
export declare function setLivingClock(options: {
|
|
89
116
|
cell: LivingWorldCell;
|
|
90
117
|
paused?: boolean;
|
|
91
118
|
rate?: number;
|
|
92
119
|
nowMs: number;
|
|
120
|
+
hold?: boolean;
|
|
93
121
|
}): LivingStep;
|
|
94
122
|
export declare function tickLivingWorld(cell: LivingWorldCell, nowMs: number, options?: {
|
|
95
123
|
limit?: number;
|
|
96
124
|
idleMinutes?: number;
|
|
97
125
|
}): LivingEvent | null;
|
|
98
|
-
export declare function livingDueWork(state:
|
|
126
|
+
export declare function livingDueWork(state: LivingStateRaw): LivingWork[];
|
|
99
127
|
type WorkOptions = {
|
|
100
128
|
cell: LivingWorldCell;
|
|
101
129
|
inference: LivingInference;
|
|
@@ -119,7 +147,7 @@ export declare function advanceLivingWorld(options: WorkOptions & {
|
|
|
119
147
|
nowMs: number;
|
|
120
148
|
}): Promise<LivingStep>;
|
|
121
149
|
export declare function runLivingCommand(options: ({
|
|
122
|
-
state:
|
|
150
|
+
state: LivingStateRaw;
|
|
123
151
|
cell?: undefined;
|
|
124
152
|
} | {
|
|
125
153
|
cell: LivingWorldCell;
|
|
@@ -132,9 +160,91 @@ export declare function runLivingCommand(options: ({
|
|
|
132
160
|
tickLimit?: number;
|
|
133
161
|
takenEntityIds?: (ids: readonly string[]) => Promise<ReadonlySet<string>>;
|
|
134
162
|
}): Promise<LivingStep>;
|
|
135
|
-
export declare function translateGmEffect(state:
|
|
163
|
+
export declare function translateGmEffect(state: LivingStateRaw, record: GmEffectRecord, seq: number, index: number, placeId?: string | null, usedCreationIds?: ReadonlySet<string>): {
|
|
136
164
|
effect: LivingEffect;
|
|
165
|
+
also?: LivingEffect[];
|
|
137
166
|
} | {
|
|
138
167
|
error: string;
|
|
139
168
|
};
|
|
169
|
+
type Plan = {
|
|
170
|
+
intent: string;
|
|
171
|
+
seen?: string;
|
|
172
|
+
placeId: string | null;
|
|
173
|
+
targetId: string | null;
|
|
174
|
+
inMinutes: number;
|
|
175
|
+
};
|
|
176
|
+
export type Reaction = {
|
|
177
|
+
say: string | null;
|
|
178
|
+
request: {
|
|
179
|
+
topic: string;
|
|
180
|
+
receiverId: string;
|
|
181
|
+
priorId: string | null;
|
|
182
|
+
} | null;
|
|
183
|
+
requestDecision: {
|
|
184
|
+
id: string;
|
|
185
|
+
status: 'answered' | 'accepted' | 'refused' | 'done';
|
|
186
|
+
} | null;
|
|
187
|
+
commitmentDecision: {
|
|
188
|
+
id: string;
|
|
189
|
+
status: 'kept' | 'broken';
|
|
190
|
+
} | null;
|
|
191
|
+
answered: string | null;
|
|
192
|
+
act: string | null;
|
|
193
|
+
toIds: string[];
|
|
194
|
+
waitingOnIds: string[];
|
|
195
|
+
mood: string;
|
|
196
|
+
leaveToPlaceId: string | null;
|
|
197
|
+
trust: number;
|
|
198
|
+
warmth: number;
|
|
199
|
+
relationshipNote: string | null;
|
|
200
|
+
belief: {
|
|
201
|
+
subject: string;
|
|
202
|
+
claim: string;
|
|
203
|
+
} | null;
|
|
204
|
+
commitment: {
|
|
205
|
+
toId: string;
|
|
206
|
+
text: string;
|
|
207
|
+
dueInMinutes: number | null;
|
|
208
|
+
placeId: string | null;
|
|
209
|
+
} | null;
|
|
210
|
+
newGoal: string | null;
|
|
211
|
+
goalDone: string | null;
|
|
212
|
+
weight: number;
|
|
213
|
+
stance: 'undecided' | 'cooperate' | 'refuse' | 'report' | 'avoid' | 'confront' | null;
|
|
214
|
+
plan: Plan | null;
|
|
215
|
+
tell: {
|
|
216
|
+
targetId: string;
|
|
217
|
+
text: string;
|
|
218
|
+
} | null;
|
|
219
|
+
suggestedReplies: string[];
|
|
220
|
+
endConversation: boolean;
|
|
221
|
+
};
|
|
222
|
+
export declare function changesSomething(reaction: Reaction): boolean;
|
|
223
|
+
export type ReactionProblemFacts = {
|
|
224
|
+
phase: string;
|
|
225
|
+
causeSeq: number;
|
|
226
|
+
trigger: {
|
|
227
|
+
kind: string;
|
|
228
|
+
actorId: string | null;
|
|
229
|
+
};
|
|
230
|
+
budgetAllows: boolean;
|
|
231
|
+
};
|
|
232
|
+
export declare function reactionAnswerProblems(reaction: Reaction, state: Parameters<typeof reactionProblems>[1], personId: string, facts: ReactionProblemFacts): (ReactionProblem | string)[];
|
|
233
|
+
export type ReactionProblem = {
|
|
234
|
+
kind: 'unknown-request' | 'request-already-made' | 'request-not-open' | 'request-not-yours' | 'person-absent';
|
|
235
|
+
requestId: string | null;
|
|
236
|
+
status: string | null;
|
|
237
|
+
personId?: string;
|
|
238
|
+
};
|
|
239
|
+
export declare function presenceProblems(reaction: Reaction, state: Parameters<typeof peopleAt>[0], personId: string): ReactionProblem[];
|
|
240
|
+
export declare function reactionProblems(reaction: Reaction, state: LivingStateRaw, personId: string): ReactionProblem[];
|
|
241
|
+
export declare function parseReaction(answer: unknown, state: {
|
|
242
|
+
calendar: LivingCalendar;
|
|
243
|
+
}): Reaction;
|
|
244
|
+
export declare function duePlanCard(state: LivingStateRaw, person: LivingPerson, entry: LivingStateRaw['schedule'][number]): {
|
|
245
|
+
intent: string;
|
|
246
|
+
overdueMinutes?: number;
|
|
247
|
+
placeId?: string | null;
|
|
248
|
+
targetId?: string | null;
|
|
249
|
+
};
|
|
140
250
|
export {};
|