simfile 0.0.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 +143 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +348 -0
- package/dist/coverage/index.d.ts +2 -0
- package/dist/coverage/index.d.ts.map +1 -0
- package/dist/coverage/index.js +1 -0
- package/dist/coverage/matrix.d.ts +21 -0
- package/dist/coverage/matrix.d.ts.map +1 -0
- package/dist/coverage/matrix.js +173 -0
- package/dist/coverage/render.d.ts +3 -0
- package/dist/coverage/render.d.ts.map +1 -0
- package/dist/coverage/render.js +26 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/kernel/duration.d.ts +9 -0
- package/dist/kernel/duration.d.ts.map +1 -0
- package/dist/kernel/duration.js +44 -0
- package/dist/kernel/index.d.ts +4 -0
- package/dist/kernel/index.d.ts.map +1 -0
- package/dist/kernel/index.js +3 -0
- package/dist/kernel/range.d.ts +6 -0
- package/dist/kernel/range.d.ts.map +1 -0
- package/dist/kernel/range.js +16 -0
- package/dist/kernel/stochastic.d.ts +10 -0
- package/dist/kernel/stochastic.d.ts.map +1 -0
- package/dist/kernel/stochastic.js +25 -0
- package/dist/ledger/index.d.ts +4 -0
- package/dist/ledger/index.d.ts.map +1 -0
- package/dist/ledger/index.js +3 -0
- package/dist/ledger/markers.d.ts +46 -0
- package/dist/ledger/markers.d.ts.map +1 -0
- package/dist/ledger/markers.js +108 -0
- package/dist/ledger/stable.d.ts +65 -0
- package/dist/ledger/stable.d.ts.map +1 -0
- package/dist/ledger/stable.js +78 -0
- package/dist/ledger/validation.d.ts +16 -0
- package/dist/ledger/validation.d.ts.map +1 -0
- package/dist/ledger/validation.js +127 -0
- package/dist/moltnet/index.d.ts +3 -0
- package/dist/moltnet/index.d.ts.map +1 -0
- package/dist/moltnet/index.js +2 -0
- package/dist/moltnet/transcript-export.d.ts +34 -0
- package/dist/moltnet/transcript-export.d.ts.map +1 -0
- package/dist/moltnet/transcript-export.js +68 -0
- package/dist/moltnet/world-participant.d.ts +77 -0
- package/dist/moltnet/world-participant.d.ts.map +1 -0
- package/dist/moltnet/world-participant.js +221 -0
- package/dist/observe/artifacts.d.ts +16 -0
- package/dist/observe/artifacts.d.ts.map +1 -0
- package/dist/observe/artifacts.js +31 -0
- package/dist/observe/causalStreams.d.ts +19 -0
- package/dist/observe/causalStreams.d.ts.map +1 -0
- package/dist/observe/causalStreams.js +38 -0
- package/dist/observe/compute.d.ts +17 -0
- package/dist/observe/compute.d.ts.map +1 -0
- package/dist/observe/compute.js +97 -0
- package/dist/observe/index.d.ts +11 -0
- package/dist/observe/index.d.ts.map +1 -0
- package/dist/observe/index.js +10 -0
- package/dist/observe/manifest.d.ts +79 -0
- package/dist/observe/manifest.d.ts.map +1 -0
- package/dist/observe/manifest.js +87 -0
- package/dist/observe/memoryBanks.d.ts +38 -0
- package/dist/observe/memoryBanks.d.ts.map +1 -0
- package/dist/observe/memoryBanks.js +86 -0
- package/dist/observe/observe.d.ts +32 -0
- package/dist/observe/observe.d.ts.map +1 -0
- package/dist/observe/observe.js +73 -0
- package/dist/observe/report.d.ts +165 -0
- package/dist/observe/report.d.ts.map +1 -0
- package/dist/observe/report.js +138 -0
- package/dist/observe/seedSpread.d.ts +49 -0
- package/dist/observe/seedSpread.d.ts.map +1 -0
- package/dist/observe/seedSpread.js +262 -0
- package/dist/observe/seedSpreadArtifacts.d.ts +49 -0
- package/dist/observe/seedSpreadArtifacts.d.ts.map +1 -0
- package/dist/observe/seedSpreadArtifacts.js +118 -0
- package/dist/observe/spreadMatcher.d.ts +45 -0
- package/dist/observe/spreadMatcher.d.ts.map +1 -0
- package/dist/observe/spreadMatcher.js +124 -0
- package/dist/report/index.d.ts +4 -0
- package/dist/report/index.d.ts.map +1 -0
- package/dist/report/index.js +3 -0
- package/dist/report/probeArtifact.d.ts +26 -0
- package/dist/report/probeArtifact.d.ts.map +1 -0
- package/dist/report/probeArtifact.js +119 -0
- package/dist/report/probes.d.ts +52 -0
- package/dist/report/probes.d.ts.map +1 -0
- package/dist/report/probes.js +164 -0
- package/dist/report/score.d.ts +27 -0
- package/dist/report/score.d.ts.map +1 -0
- package/dist/report/score.js +14 -0
- package/dist/report/transcripts.d.ts +12 -0
- package/dist/report/transcripts.d.ts.map +1 -0
- package/dist/report/transcripts.js +17 -0
- package/dist/runtime/causal-fixture.d.ts +26 -0
- package/dist/runtime/causal-fixture.d.ts.map +1 -0
- package/dist/runtime/causal-fixture.js +36 -0
- package/dist/runtime/clock.d.ts +25 -0
- package/dist/runtime/clock.d.ts.map +1 -0
- package/dist/runtime/clock.js +63 -0
- package/dist/runtime/condition.d.ts +55 -0
- package/dist/runtime/condition.d.ts.map +1 -0
- package/dist/runtime/condition.js +122 -0
- package/dist/runtime/emit-causal-fixture.d.ts +2 -0
- package/dist/runtime/emit-causal-fixture.d.ts.map +1 -0
- package/dist/runtime/emit-causal-fixture.js +45 -0
- package/dist/runtime/expression.d.ts +11 -0
- package/dist/runtime/expression.d.ts.map +1 -0
- package/dist/runtime/expression.js +305 -0
- package/dist/runtime/numeric.d.ts +7 -0
- package/dist/runtime/numeric.d.ts.map +1 -0
- package/dist/runtime/numeric.js +11 -0
- package/dist/runtime/rule-actions.d.ts +5 -0
- package/dist/runtime/rule-actions.d.ts.map +1 -0
- package/dist/runtime/rule-actions.js +82 -0
- package/dist/runtime/run-record.d.ts +73 -0
- package/dist/runtime/run-record.d.ts.map +1 -0
- package/dist/runtime/run-record.js +179 -0
- package/dist/runtime/step-tick.d.ts +43 -0
- package/dist/runtime/step-tick.d.ts.map +1 -0
- package/dist/runtime/step-tick.js +177 -0
- package/dist/runtime/trace-compile.d.ts +66 -0
- package/dist/runtime/trace-compile.d.ts.map +1 -0
- package/dist/runtime/trace-compile.js +157 -0
- package/dist/runtime/trace-export.d.ts +5 -0
- package/dist/runtime/trace-export.d.ts.map +1 -0
- package/dist/runtime/trace-export.js +4 -0
- package/dist/runtime/trace-run.d.ts +15 -0
- package/dist/runtime/trace-run.d.ts.map +1 -0
- package/dist/runtime/trace-run.js +92 -0
- package/dist/runtime/trace.d.ts +10 -0
- package/dist/runtime/trace.d.ts.map +1 -0
- package/dist/runtime/trace.js +9 -0
- package/dist/runtime/types.d.ts +61 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/types.js +1 -0
- package/dist/runtime/viewer-trace.d.ts +64 -0
- package/dist/runtime/viewer-trace.d.ts.map +1 -0
- package/dist/runtime/viewer-trace.js +164 -0
- package/dist/runtime/world-act.d.ts +55 -0
- package/dist/runtime/world-act.d.ts.map +1 -0
- package/dist/runtime/world-act.js +156 -0
- package/dist/schema/binding.d.ts +23 -0
- package/dist/schema/binding.d.ts.map +1 -0
- package/dist/schema/binding.js +249 -0
- package/dist/schema/index.d.ts +5 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +4 -0
- package/dist/schema/model.d.ts +244 -0
- package/dist/schema/model.d.ts.map +1 -0
- package/dist/schema/model.js +222 -0
- package/dist/schema/parse.d.ts +10 -0
- package/dist/schema/parse.d.ts.map +1 -0
- package/dist/schema/parse.js +15 -0
- package/dist/schema/semantic.d.ts +3 -0
- package/dist/schema/semantic.d.ts.map +1 -0
- package/dist/schema/semantic.js +135 -0
- package/dist/sims/composeRunManifest.d.ts +54 -0
- package/dist/sims/composeRunManifest.d.ts.map +1 -0
- package/dist/sims/composeRunManifest.js +40 -0
- package/dist/sims/composedJungianSimDriver.d.ts +50 -0
- package/dist/sims/composedJungianSimDriver.d.ts.map +1 -0
- package/dist/sims/composedJungianSimDriver.js +199 -0
- package/dist/sims/composedOfficeSimDriver.d.ts +53 -0
- package/dist/sims/composedOfficeSimDriver.d.ts.map +1 -0
- package/dist/sims/composedOfficeSimDriver.js +162 -0
- package/dist/sims/exchangeWait.d.ts +56 -0
- package/dist/sims/exchangeWait.d.ts.map +1 -0
- package/dist/sims/exchangeWait.js +66 -0
- package/dist/sims/index.d.ts +14 -0
- package/dist/sims/index.d.ts.map +1 -0
- package/dist/sims/index.js +13 -0
- package/dist/sims/moltnetRoomClient.d.ts +47 -0
- package/dist/sims/moltnetRoomClient.d.ts.map +1 -0
- package/dist/sims/moltnetRoomClient.js +41 -0
- package/dist/sims/poll.d.ts +19 -0
- package/dist/sims/poll.d.ts.map +1 -0
- package/dist/sims/poll.js +23 -0
- package/dist/sims/spawnfileCli.d.ts +49 -0
- package/dist/sims/spawnfileCli.d.ts.map +1 -0
- package/dist/sims/spawnfileCli.js +90 -0
- package/dist/sims/spawnfileReceipts.d.ts +76 -0
- package/dist/sims/spawnfileReceipts.d.ts.map +1 -0
- package/dist/sims/spawnfileReceipts.js +107 -0
- package/dist/sims/worldDrivenOfficeSimDriver.d.ts +59 -0
- package/dist/sims/worldDrivenOfficeSimDriver.d.ts.map +1 -0
- package/dist/sims/worldDrivenOfficeSimDriver.js +182 -0
- package/dist/sims/worldLedgerWriter.d.ts +32 -0
- package/dist/sims/worldLedgerWriter.d.ts.map +1 -0
- package/dist/sims/worldLedgerWriter.js +39 -0
- package/dist/sims/worldSeedLint.d.ts +42 -0
- package/dist/sims/worldSeedLint.d.ts.map +1 -0
- package/dist/sims/worldSeedLint.js +73 -0
- package/dist/sims/worldTickIngest.d.ts +27 -0
- package/dist/sims/worldTickIngest.d.ts.map +1 -0
- package/dist/sims/worldTickIngest.js +35 -0
- package/dist/sims/worldTickLoop.d.ts +64 -0
- package/dist/sims/worldTickLoop.d.ts.map +1 -0
- package/dist/sims/worldTickLoop.js +122 -0
- package/dist/view/engineProvenance.d.ts +46 -0
- package/dist/view/engineProvenance.d.ts.map +1 -0
- package/dist/view/engineProvenance.js +76 -0
- package/dist/view/index.d.ts +14 -0
- package/dist/view/index.d.ts.map +1 -0
- package/dist/view/index.js +107 -0
- package/dist/view/membranes.d.ts +14 -0
- package/dist/view/membranes.d.ts.map +1 -0
- package/dist/view/membranes.js +127 -0
- package/dist/view/runDetect.d.ts +2 -0
- package/dist/view/runDetect.d.ts.map +1 -0
- package/dist/view/runDetect.js +47 -0
- package/dist/view/runRawArtifacts.d.ts +48 -0
- package/dist/view/runRawArtifacts.d.ts.map +1 -0
- package/dist/view/runRawArtifacts.js +143 -0
- package/dist/view/runTimeline.d.ts +24 -0
- package/dist/view/runTimeline.d.ts.map +1 -0
- package/dist/view/runTimeline.js +204 -0
- package/dist/view/runTimelineRecords.d.ts +42 -0
- package/dist/view/runTimelineRecords.d.ts.map +1 -0
- package/dist/view/runTimelineRecords.js +244 -0
- package/dist/view/runTimelineRefs.d.ts +27 -0
- package/dist/view/runTimelineRefs.d.ts.map +1 -0
- package/dist/view/runTimelineRefs.js +31 -0
- package/dist/view/runTimelineTypes.d.ts +99 -0
- package/dist/view/runTimelineTypes.d.ts.map +1 -0
- package/dist/view/runTimelineTypes.js +1 -0
- package/dist/view/runViewModel.d.ts +21 -0
- package/dist/view/runViewModel.d.ts.map +1 -0
- package/dist/view/runViewModel.js +66 -0
- package/dist/view/runViewModelCompute.d.ts +24 -0
- package/dist/view/runViewModelCompute.d.ts.map +1 -0
- package/dist/view/runViewModelCompute.js +157 -0
- package/dist/view/runViewModelTypes.d.ts +177 -0
- package/dist/view/runViewModelTypes.d.ts.map +1 -0
- package/dist/view/runViewModelTypes.js +1 -0
- package/dist/view/runWorldTrace.d.ts +97 -0
- package/dist/view/runWorldTrace.d.ts.map +1 -0
- package/dist/view/runWorldTrace.js +88 -0
- package/dist/view/server.d.ts +12 -0
- package/dist/view/server.d.ts.map +1 -0
- package/dist/view/server.js +306 -0
- package/package.json +65 -0
- package/web/dist/assets/index-CJHLjfsG.js +49 -0
- package/web/dist/assets/index-DJOsPsU8.css +1 -0
- package/web/dist/index.html +13 -0
- package/web/dist/models/AnimatedMushnub.glb +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-only Moltnet HTTP polling helpers for the composed-run driver —
|
|
3
|
+
* `/healthz`, `/v1/rooms/:id`, `/v1/agents`, `/v1/rooms/:id/messages` are
|
|
4
|
+
* Moltnet's own public wire API (documented, not a Spawnfile internal), the
|
|
5
|
+
* same endpoints `src/e2e/moltnetE2ESupport.ts`'s `createMoltnetHttpClient`
|
|
6
|
+
* speaks — reimplemented locally here (never imported from Spawnfile's
|
|
7
|
+
* `src/e2e`) so this package's charter ("Do not import Spawnfile internals")
|
|
8
|
+
* holds. Every function here is a plain GET: seeding (the one write this
|
|
9
|
+
* driver ever performs) goes through `world-participant.ts` instead.
|
|
10
|
+
*/
|
|
11
|
+
const DEFAULT_TIMEOUT_MS = 10_000;
|
|
12
|
+
const fetchJson = async (url, options) => {
|
|
13
|
+
const timeout = options?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
14
|
+
const signal = timeout > 0 ? AbortSignal.timeout(timeout) : undefined;
|
|
15
|
+
const response = await (options?.fetchFn ?? fetch)(url, { method: "GET", ...(signal ? { signal } : {}) });
|
|
16
|
+
if (!response.ok) {
|
|
17
|
+
throw new Error(`moltnet GET ${url} returned ${response.status}`);
|
|
18
|
+
}
|
|
19
|
+
return (await response.json());
|
|
20
|
+
};
|
|
21
|
+
/** Read-only health probe; never throws — a not-yet-ready server is a
|
|
22
|
+
* negative poll result, not an error. */
|
|
23
|
+
export const moltnetHealthy = async (baseUrl, options) => {
|
|
24
|
+
try {
|
|
25
|
+
const timeout = options?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
26
|
+
const signal = timeout > 0 ? AbortSignal.timeout(timeout) : undefined;
|
|
27
|
+
const response = await (options?.fetchFn ?? fetch)(`${baseUrl}/healthz`, { method: "GET", ...(signal ? { signal } : {}) });
|
|
28
|
+
return response.ok;
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
export const getMoltnetRoom = async (baseUrl, roomId, options) => fetchJson(`${baseUrl}/v1/rooms/${encodeURIComponent(roomId)}`, options);
|
|
35
|
+
export const listMoltnetAgents = async (baseUrl, options) => (await fetchJson(`${baseUrl}/v1/agents`, options)).agents ?? [];
|
|
36
|
+
export const listMoltnetRoomMessages = async (baseUrl, roomId, limit, options) => (await fetchJson(`${baseUrl}/v1/rooms/${encodeURIComponent(roomId)}/messages?limit=${limit}`, options)).messages ?? [];
|
|
37
|
+
/** True once every expected member both appears in room config membership
|
|
38
|
+
* AND has a live, connected bridge attachment — mirrors
|
|
39
|
+
* `moltnetE2ESupport.ts`'s `waitForAgents` gate (room membership alone can be
|
|
40
|
+
* static config, seeding before the bridge attaches is unrecoverable). */
|
|
41
|
+
export const allMembersConnected = (agents, roomId, expectedMembers) => expectedMembers.every((id) => agents.some((agent) => agent.id === id && agent.rooms.includes(roomId) && agent.connected === true));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic bounded-retry poll helper, reused by the composed-run driver for
|
|
3
|
+
* every read-only readiness check (moltnet health, room membership, agent
|
|
4
|
+
* bridge attachment) before the ONE seed write. Ported from the shape of
|
|
5
|
+
* `src/e2e/moltnetE2ESupport.ts`'s `poll` (not imported — this package may
|
|
6
|
+
* not depend on Spawnfile internals) since the polling contract itself is
|
|
7
|
+
* generic and has nothing Spawnfile-specific about it.
|
|
8
|
+
*/
|
|
9
|
+
export interface PollOptions {
|
|
10
|
+
intervalMs: number;
|
|
11
|
+
sleep: (delayMs: number) => Promise<void>;
|
|
12
|
+
timeoutMs: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const defaultSleep: (delayMs: number) => Promise<void>;
|
|
15
|
+
/** Retries `attempt` until it returns a truthy value or the timeout elapses;
|
|
16
|
+
* throws a description-carrying error otherwise. Never coaxes/mutates state —
|
|
17
|
+
* every attempt is a read. */
|
|
18
|
+
export declare const pollUntilReady: <T>(description: string, options: PollOptions, attempt: () => Promise<T | null>) => Promise<T>;
|
|
19
|
+
//# sourceMappingURL=poll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poll.d.ts","sourceRoot":"","sources":["../../src/sims/poll.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,YAAY,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,IAAI,CAG7D,CAAC;AAEL;;8BAE8B;AAC9B,eAAO,MAAM,cAAc,GAAU,CAAC,EACpC,aAAa,MAAM,EACnB,SAAS,WAAW,EACpB,SAAS,MAAM,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,KAC/B,OAAO,CAAC,CAAC,CAcX,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const defaultSleep = async (delayMs) => new Promise((resolve) => {
|
|
2
|
+
setTimeout(resolve, delayMs);
|
|
3
|
+
});
|
|
4
|
+
/** Retries `attempt` until it returns a truthy value or the timeout elapses;
|
|
5
|
+
* throws a description-carrying error otherwise. Never coaxes/mutates state —
|
|
6
|
+
* every attempt is a read. */
|
|
7
|
+
export const pollUntilReady = async (description, options, attempt) => {
|
|
8
|
+
const attempts = Math.max(1, Math.ceil(options.timeoutMs / options.intervalMs));
|
|
9
|
+
let lastError;
|
|
10
|
+
for (let index = 0; index <= attempts; index += 1) {
|
|
11
|
+
try {
|
|
12
|
+
const result = await attempt();
|
|
13
|
+
if (result)
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
lastError = error;
|
|
18
|
+
}
|
|
19
|
+
await options.sleep(options.intervalMs);
|
|
20
|
+
}
|
|
21
|
+
const suffix = lastError instanceof Error ? `: ${lastError.message}` : "";
|
|
22
|
+
throw new Error(`${description} did not become ready${suffix}`);
|
|
23
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type SpawnfileDownReceipt, type SpawnfileExportResult, type SpawnfileUpReceipt } from "./spawnfileReceipts.js";
|
|
2
|
+
/**
|
|
3
|
+
* Everything needed to shell the `spawnfile` CLI as a subprocess — the ONLY
|
|
4
|
+
* sanctioned way this package talks to Spawnfile (contracts.md's CLI rule:
|
|
5
|
+
* "simfile -> spawnfile only through documented CLI + versioned receipts").
|
|
6
|
+
* `spawnfileBin` is a path to spawnfile's built `dist/cli/index.js` (or any
|
|
7
|
+
* equivalent entrypoint script); it is always invoked as `node <spawnfileBin>
|
|
8
|
+
* <args>` rather than executed directly, so no `chmod +x`/shebang resolution
|
|
9
|
+
* is required of the caller.
|
|
10
|
+
*/
|
|
11
|
+
export interface SpawnfileCliContext {
|
|
12
|
+
spawnfileBin: string;
|
|
13
|
+
nodeBin?: string;
|
|
14
|
+
cwd?: string;
|
|
15
|
+
env?: NodeJS.ProcessEnv;
|
|
16
|
+
}
|
|
17
|
+
export interface RunSpawnfileUpInput {
|
|
18
|
+
orgPath: string;
|
|
19
|
+
containerName: string;
|
|
20
|
+
deploymentName: string;
|
|
21
|
+
compiledOutputDirectory: string;
|
|
22
|
+
}
|
|
23
|
+
/** Shells `spawnfile up <org> --detach --name <container> --deployment <name>
|
|
24
|
+
* --out <compiled> --json`, detached, and parses the `spawnfile.up-receipt.v1`
|
|
25
|
+
* (run_id, moltnet base url, per-agent engine disclosure). */
|
|
26
|
+
export declare const runSpawnfileUp: (context: SpawnfileCliContext, input: RunSpawnfileUpInput) => Promise<SpawnfileUpReceipt>;
|
|
27
|
+
export interface RunSpawnfileArtifactsExportInput {
|
|
28
|
+
orgPath: string;
|
|
29
|
+
deploymentName: string;
|
|
30
|
+
compiledOutputDirectory: string;
|
|
31
|
+
destinationDirectory: string;
|
|
32
|
+
}
|
|
33
|
+
/** Shells `spawnfile artifacts export <org> --deployment <name> --compiled
|
|
34
|
+
* <compiled> --out <dest> --json`, run BEFORE `spawnfile down` (Decision 21's
|
|
35
|
+
* export-before-teardown discipline). Lands `raw/{moltnet,mneme,daimon}/...`
|
|
36
|
+
* directly under `destinationDirectory` plus `spawnfile/export-index.json`. */
|
|
37
|
+
export declare const runSpawnfileArtifactsExport: (context: SpawnfileCliContext, input: RunSpawnfileArtifactsExportInput) => Promise<SpawnfileExportResult>;
|
|
38
|
+
export interface RunSpawnfileDownInput {
|
|
39
|
+
orgPath: string;
|
|
40
|
+
deploymentName: string;
|
|
41
|
+
compiledOutputDirectory: string;
|
|
42
|
+
removeVolumes?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/** Shells `spawnfile down <org> --deployment <name> --compiled <compiled>
|
|
45
|
+
* --json`, run AFTER artifacts export. Never passes `--force`: a run whose
|
|
46
|
+
* export failed should fail loudly here rather than silently discard
|
|
47
|
+
* artifacts (the export-before-teardown invariant, `src/deployment/AGENTS.md`). */
|
|
48
|
+
export declare const runSpawnfileDown: (context: SpawnfileCliContext, input: RunSpawnfileDownInput) => Promise<SpawnfileDownReceipt>;
|
|
49
|
+
//# sourceMappingURL=spawnfileCli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawnfileCli.d.ts","sourceRoot":"","sources":["../../src/sims/spawnfileCli.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACxB,MAAM,wBAAwB,CAAC;AAWhC;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AAiCD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,uBAAuB,EAAE,MAAM,CAAC;CACjC;AAED;;8DAE8D;AAC9D,eAAO,MAAM,cAAc,GACzB,SAAS,mBAAmB,EAC5B,OAAO,mBAAmB,KACzB,OAAO,CAAC,kBAAkB,CAc5B,CAAC;AAEF,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,uBAAuB,EAAE,MAAM,CAAC;IAChC,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED;;;+EAG+E;AAC/E,eAAO,MAAM,2BAA2B,GACtC,SAAS,mBAAmB,EAC5B,OAAO,gCAAgC,KACtC,OAAO,CAAC,qBAAqB,CAc/B,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,uBAAuB,EAAE,MAAM,CAAC;IAChC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;mFAGmF;AACnF,eAAO,MAAM,gBAAgB,GAC3B,SAAS,mBAAmB,EAC5B,OAAO,qBAAqB,KAC3B,OAAO,CAAC,oBAAoB,CAa9B,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { promisify } from "node:util";
|
|
3
|
+
import { parseSpawnfileDownReceipt, parseSpawnfileExportResult, parseSpawnfileUpReceipt } from "./spawnfileReceipts.js";
|
|
4
|
+
const execFileAsync = promisify(execFile);
|
|
5
|
+
/** 64MB — generous headroom for a `docker build`'s buildkit progress stream,
|
|
6
|
+
* which lands on stderr (verified: `spawnfile up --json`'s ONLY stdout write
|
|
7
|
+
* is the final receipt; docker build/run output is inherited to stderr, see
|
|
8
|
+
* `src/compiler/buildProject.ts`/`runProjectDocker.ts`). Stdout itself is
|
|
9
|
+
* always small (one JSON receipt), so this only bounds stderr capture. */
|
|
10
|
+
const MAX_BUFFER_BYTES = 64 * 1024 * 1024;
|
|
11
|
+
const execSpawnfile = async (context, args) => {
|
|
12
|
+
const nodeBin = context.nodeBin ?? process.execPath;
|
|
13
|
+
try {
|
|
14
|
+
return await execFileAsync(nodeBin, [context.spawnfileBin, ...args], {
|
|
15
|
+
cwd: context.cwd,
|
|
16
|
+
env: context.env ?? process.env,
|
|
17
|
+
maxBuffer: MAX_BUFFER_BYTES
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
const stderr = error.stderr;
|
|
22
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
23
|
+
throw new Error(`spawnfile ${args.join(" ")} failed: ${message}${stderr ? `\n\n${stderr}` : ""}`);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const parseTrailingJson = (stdout) => {
|
|
27
|
+
const trimmed = stdout.trim();
|
|
28
|
+
try {
|
|
29
|
+
return JSON.parse(trimmed);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
throw new Error(`spawnfile CLI did not print valid JSON on stdout: ${error.message}\n\n${trimmed}`);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
/** Shells `spawnfile up <org> --detach --name <container> --deployment <name>
|
|
36
|
+
* --out <compiled> --json`, detached, and parses the `spawnfile.up-receipt.v1`
|
|
37
|
+
* (run_id, moltnet base url, per-agent engine disclosure). */
|
|
38
|
+
export const runSpawnfileUp = async (context, input) => {
|
|
39
|
+
const { stdout } = await execSpawnfile(context, [
|
|
40
|
+
"up",
|
|
41
|
+
input.orgPath,
|
|
42
|
+
"--detach",
|
|
43
|
+
"--name",
|
|
44
|
+
input.containerName,
|
|
45
|
+
"--deployment",
|
|
46
|
+
input.deploymentName,
|
|
47
|
+
"--out",
|
|
48
|
+
input.compiledOutputDirectory,
|
|
49
|
+
"--json"
|
|
50
|
+
]);
|
|
51
|
+
return parseSpawnfileUpReceipt(parseTrailingJson(stdout));
|
|
52
|
+
};
|
|
53
|
+
/** Shells `spawnfile artifacts export <org> --deployment <name> --compiled
|
|
54
|
+
* <compiled> --out <dest> --json`, run BEFORE `spawnfile down` (Decision 21's
|
|
55
|
+
* export-before-teardown discipline). Lands `raw/{moltnet,mneme,daimon}/...`
|
|
56
|
+
* directly under `destinationDirectory` plus `spawnfile/export-index.json`. */
|
|
57
|
+
export const runSpawnfileArtifactsExport = async (context, input) => {
|
|
58
|
+
const { stdout } = await execSpawnfile(context, [
|
|
59
|
+
"artifacts",
|
|
60
|
+
"export",
|
|
61
|
+
input.orgPath,
|
|
62
|
+
"--deployment",
|
|
63
|
+
input.deploymentName,
|
|
64
|
+
"--compiled",
|
|
65
|
+
input.compiledOutputDirectory,
|
|
66
|
+
"--out",
|
|
67
|
+
input.destinationDirectory,
|
|
68
|
+
"--json"
|
|
69
|
+
]);
|
|
70
|
+
return parseSpawnfileExportResult(parseTrailingJson(stdout));
|
|
71
|
+
};
|
|
72
|
+
/** Shells `spawnfile down <org> --deployment <name> --compiled <compiled>
|
|
73
|
+
* --json`, run AFTER artifacts export. Never passes `--force`: a run whose
|
|
74
|
+
* export failed should fail loudly here rather than silently discard
|
|
75
|
+
* artifacts (the export-before-teardown invariant, `src/deployment/AGENTS.md`). */
|
|
76
|
+
export const runSpawnfileDown = async (context, input) => {
|
|
77
|
+
const args = [
|
|
78
|
+
"down",
|
|
79
|
+
input.orgPath,
|
|
80
|
+
"--deployment",
|
|
81
|
+
input.deploymentName,
|
|
82
|
+
"--compiled",
|
|
83
|
+
input.compiledOutputDirectory,
|
|
84
|
+
"--json"
|
|
85
|
+
];
|
|
86
|
+
if (input.removeVolumes)
|
|
87
|
+
args.push("--volumes");
|
|
88
|
+
const { stdout } = await execSpawnfile(context, args);
|
|
89
|
+
return parseSpawnfileDownReceipt(parseTrailingJson(stdout));
|
|
90
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Minimal local schemas for the THREE documented `spawnfile ... --json`
|
|
4
|
+
* receipts the composed-run driver shells (contracts.md's CLI rule: "simfile
|
|
5
|
+
* -> spawnfile only through documented CLI + versioned receipts"). These are
|
|
6
|
+
* deliberately NOT imported from Spawnfile's own `src/deployment/*Types.ts` —
|
|
7
|
+
* this package's charter ("Do not import Spawnfile internals. Consume
|
|
8
|
+
* explicit machine-readable artifacts.") means simfile treats each receipt as
|
|
9
|
+
* an external wire contract it parses on its own terms, the same way
|
|
10
|
+
* `observe/manifest.ts` and `observe/report.ts` own their schemas rather than
|
|
11
|
+
* importing anyone else's. Every schema below is intentionally loose
|
|
12
|
+
* (`.passthrough()`, no `.strict()`) and only asserts the fields this driver
|
|
13
|
+
* actually reads, so an additive field on the real contract never breaks
|
|
14
|
+
* parsing here.
|
|
15
|
+
*/
|
|
16
|
+
declare const upReceiptSchema: z.ZodObject<{
|
|
17
|
+
version: z.ZodString;
|
|
18
|
+
run_id: z.ZodNullable<z.ZodString>;
|
|
19
|
+
fingerprint: z.ZodOptional<z.ZodString>;
|
|
20
|
+
deployment: z.ZodObject<{
|
|
21
|
+
name: z.ZodNullable<z.ZodString>;
|
|
22
|
+
container_ids: z.ZodArray<z.ZodString>;
|
|
23
|
+
}, z.core.$loose>;
|
|
24
|
+
readiness: z.ZodObject<{
|
|
25
|
+
state: z.ZodString;
|
|
26
|
+
moltnet_base_url: z.ZodNullable<z.ZodString>;
|
|
27
|
+
}, z.core.$loose>;
|
|
28
|
+
engines: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
29
|
+
agent: z.ZodString;
|
|
30
|
+
engine: z.ZodString;
|
|
31
|
+
}, z.core.$loose>>>;
|
|
32
|
+
}, z.core.$loose>;
|
|
33
|
+
export type SpawnfileUpReceipt = z.infer<typeof upReceiptSchema>;
|
|
34
|
+
/** Parses `spawnfile up --json`'s stdout (`spawnfile.up-receipt.v1`). */
|
|
35
|
+
export declare const parseSpawnfileUpReceipt: (raw: unknown) => SpawnfileUpReceipt;
|
|
36
|
+
declare const exportIndexFileSchema: z.ZodObject<{
|
|
37
|
+
path: z.ZodString;
|
|
38
|
+
sha256: z.ZodString;
|
|
39
|
+
bytes: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
source: z.ZodOptional<z.ZodUnknown>;
|
|
41
|
+
}, z.core.$loose>;
|
|
42
|
+
declare const exportResultSchema: z.ZodObject<{
|
|
43
|
+
deployment: z.ZodString;
|
|
44
|
+
failed_files: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
45
|
+
missing_optional_files: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
46
|
+
index_path: z.ZodString;
|
|
47
|
+
index: z.ZodObject<{
|
|
48
|
+
version: z.ZodString;
|
|
49
|
+
run_id: z.ZodString;
|
|
50
|
+
deployment: z.ZodString;
|
|
51
|
+
exported_at: z.ZodString;
|
|
52
|
+
files: z.ZodArray<z.ZodObject<{
|
|
53
|
+
path: z.ZodString;
|
|
54
|
+
sha256: z.ZodString;
|
|
55
|
+
bytes: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
source: z.ZodOptional<z.ZodUnknown>;
|
|
57
|
+
}, z.core.$loose>>;
|
|
58
|
+
}, z.core.$loose>;
|
|
59
|
+
}, z.core.$loose>;
|
|
60
|
+
export type SpawnfileExportResult = z.infer<typeof exportResultSchema>;
|
|
61
|
+
export type SpawnfileExportIndexFile = z.infer<typeof exportIndexFileSchema>;
|
|
62
|
+
/** Parses `spawnfile artifacts export --json`'s stdout (folds
|
|
63
|
+
* `spawnfile.export-index.v1` inside `index`). */
|
|
64
|
+
export declare const parseSpawnfileExportResult: (raw: unknown) => SpawnfileExportResult;
|
|
65
|
+
declare const downReceiptSchema: z.ZodObject<{
|
|
66
|
+
version: z.ZodString;
|
|
67
|
+
deployment: z.ZodString;
|
|
68
|
+
units_stopped: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
69
|
+
retained_volumes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
70
|
+
errors: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
71
|
+
}, z.core.$loose>;
|
|
72
|
+
export type SpawnfileDownReceipt = z.infer<typeof downReceiptSchema>;
|
|
73
|
+
/** Parses `spawnfile down --json`'s stdout (`spawnfile.down-receipt.v1`). */
|
|
74
|
+
export declare const parseSpawnfileDownReceipt: (raw: unknown) => SpawnfileDownReceipt;
|
|
75
|
+
export {};
|
|
76
|
+
//# sourceMappingURL=spawnfileReceipts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawnfileReceipts.d.ts","sourceRoot":"","sources":["../../src/sims/spawnfileReceipts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;GAaG;AAEH,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;iBA4BL,CAAC;AAEjB,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAEjE,yEAAyE;AACzE,eAAO,MAAM,uBAAuB,GAAI,KAAK,OAAO,KAAG,kBAUtD,CAAC;AAEF,QAAA,MAAM,qBAAqB;;;;;iBAOX,CAAC;AAEjB,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;iBAgBR,CAAC;AAEjB,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACvE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE7E;kDACkD;AAClD,eAAO,MAAM,0BAA0B,GAAI,KAAK,OAAO,KAAG,qBAUzD,CAAC;AAEF,QAAA,MAAM,iBAAiB;;;;;;iBAQP,CAAC;AAEjB,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAErE,6EAA6E;AAC7E,eAAO,MAAM,yBAAyB,GAAI,KAAK,OAAO,KAAG,oBAUxD,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Minimal local schemas for the THREE documented `spawnfile ... --json`
|
|
4
|
+
* receipts the composed-run driver shells (contracts.md's CLI rule: "simfile
|
|
5
|
+
* -> spawnfile only through documented CLI + versioned receipts"). These are
|
|
6
|
+
* deliberately NOT imported from Spawnfile's own `src/deployment/*Types.ts` —
|
|
7
|
+
* this package's charter ("Do not import Spawnfile internals. Consume
|
|
8
|
+
* explicit machine-readable artifacts.") means simfile treats each receipt as
|
|
9
|
+
* an external wire contract it parses on its own terms, the same way
|
|
10
|
+
* `observe/manifest.ts` and `observe/report.ts` own their schemas rather than
|
|
11
|
+
* importing anyone else's. Every schema below is intentionally loose
|
|
12
|
+
* (`.passthrough()`, no `.strict()`) and only asserts the fields this driver
|
|
13
|
+
* actually reads, so an additive field on the real contract never breaks
|
|
14
|
+
* parsing here.
|
|
15
|
+
*/
|
|
16
|
+
const upReceiptSchema = z
|
|
17
|
+
.object({
|
|
18
|
+
version: z.string().min(1),
|
|
19
|
+
run_id: z.string().min(1).nullable(),
|
|
20
|
+
fingerprint: z.string().min(1).optional(),
|
|
21
|
+
deployment: z
|
|
22
|
+
.object({
|
|
23
|
+
name: z.string().min(1).nullable(),
|
|
24
|
+
container_ids: z.array(z.string())
|
|
25
|
+
})
|
|
26
|
+
.passthrough(),
|
|
27
|
+
readiness: z
|
|
28
|
+
.object({
|
|
29
|
+
state: z.string(),
|
|
30
|
+
moltnet_base_url: z.string().min(1).nullable()
|
|
31
|
+
})
|
|
32
|
+
.passthrough(),
|
|
33
|
+
engines: z
|
|
34
|
+
.array(z
|
|
35
|
+
.object({
|
|
36
|
+
agent: z.string().min(1),
|
|
37
|
+
engine: z.string().min(1)
|
|
38
|
+
})
|
|
39
|
+
.passthrough())
|
|
40
|
+
.optional()
|
|
41
|
+
})
|
|
42
|
+
.passthrough();
|
|
43
|
+
/** Parses `spawnfile up --json`'s stdout (`spawnfile.up-receipt.v1`). */
|
|
44
|
+
export const parseSpawnfileUpReceipt = (raw) => {
|
|
45
|
+
const result = upReceiptSchema.safeParse(raw);
|
|
46
|
+
if (!result.success) {
|
|
47
|
+
throw new Error(`invalid spawnfile up-receipt: ${result.error.issues
|
|
48
|
+
.map((issue) => `${issue.path.join(".") || "<root>"}: ${issue.message}`)
|
|
49
|
+
.join("; ")}`);
|
|
50
|
+
}
|
|
51
|
+
return result.data;
|
|
52
|
+
};
|
|
53
|
+
const exportIndexFileSchema = z
|
|
54
|
+
.object({
|
|
55
|
+
path: z.string().min(1),
|
|
56
|
+
sha256: z.string().regex(/^[0-9a-f]{64}$/u),
|
|
57
|
+
bytes: z.number().int().nonnegative().optional(),
|
|
58
|
+
source: z.unknown().optional()
|
|
59
|
+
})
|
|
60
|
+
.passthrough();
|
|
61
|
+
const exportResultSchema = z
|
|
62
|
+
.object({
|
|
63
|
+
deployment: z.string().min(1),
|
|
64
|
+
failed_files: z.array(z.string()).default([]),
|
|
65
|
+
missing_optional_files: z.array(z.string()).default([]),
|
|
66
|
+
index_path: z.string().min(1),
|
|
67
|
+
index: z
|
|
68
|
+
.object({
|
|
69
|
+
version: z.string().min(1),
|
|
70
|
+
run_id: z.string().min(1),
|
|
71
|
+
deployment: z.string().min(1),
|
|
72
|
+
exported_at: z.string().min(1),
|
|
73
|
+
files: z.array(exportIndexFileSchema)
|
|
74
|
+
})
|
|
75
|
+
.passthrough()
|
|
76
|
+
})
|
|
77
|
+
.passthrough();
|
|
78
|
+
/** Parses `spawnfile artifacts export --json`'s stdout (folds
|
|
79
|
+
* `spawnfile.export-index.v1` inside `index`). */
|
|
80
|
+
export const parseSpawnfileExportResult = (raw) => {
|
|
81
|
+
const result = exportResultSchema.safeParse(raw);
|
|
82
|
+
if (!result.success) {
|
|
83
|
+
throw new Error(`invalid spawnfile artifacts export result: ${result.error.issues
|
|
84
|
+
.map((issue) => `${issue.path.join(".") || "<root>"}: ${issue.message}`)
|
|
85
|
+
.join("; ")}`);
|
|
86
|
+
}
|
|
87
|
+
return result.data;
|
|
88
|
+
};
|
|
89
|
+
const downReceiptSchema = z
|
|
90
|
+
.object({
|
|
91
|
+
version: z.string().min(1),
|
|
92
|
+
deployment: z.string().min(1),
|
|
93
|
+
units_stopped: z.array(z.string()).default([]),
|
|
94
|
+
retained_volumes: z.array(z.string()).default([]),
|
|
95
|
+
errors: z.array(z.string()).default([])
|
|
96
|
+
})
|
|
97
|
+
.passthrough();
|
|
98
|
+
/** Parses `spawnfile down --json`'s stdout (`spawnfile.down-receipt.v1`). */
|
|
99
|
+
export const parseSpawnfileDownReceipt = (raw) => {
|
|
100
|
+
const result = downReceiptSchema.safeParse(raw);
|
|
101
|
+
if (!result.success) {
|
|
102
|
+
throw new Error(`invalid spawnfile down-receipt: ${result.error.issues
|
|
103
|
+
.map((issue) => `${issue.path.join(".") || "<root>"}: ${issue.message}`)
|
|
104
|
+
.join("; ")}`);
|
|
105
|
+
}
|
|
106
|
+
return result.data;
|
|
107
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type ExchangeEndReason } from "./exchangeWait.js";
|
|
2
|
+
/**
|
|
3
|
+
* Memetics increment (a)'s live world-driven variant of
|
|
4
|
+
* `composedOfficeSimDriver.ts`. That file's own charter — seed-once,
|
|
5
|
+
* poll-read-only, shell spawnfile only through its three documented `--json`
|
|
6
|
+
* subcommands, zero Docker/runtime-auth/Spawnfile-TS-imports here — still
|
|
7
|
+
* holds. What changes is the core loop: instead of one operator-authored
|
|
8
|
+
* seed message, the Simfile WORLD itself (`worldPath`) runs as a live tick
|
|
9
|
+
* loop between "org ready" and "concluded" — ingesting room messages,
|
|
10
|
+
* stepping `stepSimfileTick` once per wall-clock poll, scanning the tick's
|
|
11
|
+
* own ingested messages for marker tokens, delivering any rule-emitted
|
|
12
|
+
* `world.message`/`wake.recommended`, and appending everything to
|
|
13
|
+
* `raw/world/causal.jsonl` — so the room's opening message (the `kickoff`
|
|
14
|
+
* rule) comes from the world's own ledger, not a driver-injected string.
|
|
15
|
+
* There is deliberately no "seed message" builder in this file: "seed" is
|
|
16
|
+
* reserved for the Decision-13 doc-seeded secret (`seed_declaration`); the
|
|
17
|
+
* room's own opening line is the world's `kickoff` rule, delivered like any
|
|
18
|
+
* other rule-emitted world-effect event.
|
|
19
|
+
*/
|
|
20
|
+
export interface RunWorldDrivenOfficeSimOptions {
|
|
21
|
+
spawnfileBin: string;
|
|
22
|
+
/** Path to the composed org (e.g. `fixtures/sims/office-secret-v0/org`). */
|
|
23
|
+
orgPath: string;
|
|
24
|
+
/** Path to the Simfile world file driving this run. */
|
|
25
|
+
worldPath: string;
|
|
26
|
+
containerName: string;
|
|
27
|
+
deploymentName: string;
|
|
28
|
+
compiledOutputDirectory: string;
|
|
29
|
+
runsRootDirectory: string;
|
|
30
|
+
networkId?: string;
|
|
31
|
+
roomId?: string;
|
|
32
|
+
agentIds?: readonly string[];
|
|
33
|
+
/** Agent whose `workspace.docs.memory` carries the Decision-13 secret. */
|
|
34
|
+
seedAgentId?: string;
|
|
35
|
+
/** Absolute path to the seed agent's memory doc; defaults to
|
|
36
|
+
* `<orgPath>/agents/<seedAgentId>/MEMORY.md`. */
|
|
37
|
+
memoryDocPath?: string;
|
|
38
|
+
/** The memetics token set to lint the world against and declare as seeded. */
|
|
39
|
+
tokenSet?: readonly string[];
|
|
40
|
+
targetTurns?: number;
|
|
41
|
+
quietGraceMs?: number;
|
|
42
|
+
timeoutMs?: number;
|
|
43
|
+
pollIntervalMs?: number;
|
|
44
|
+
/** Safety fuse on world ticks, independent of the timeout/turn-cap stop
|
|
45
|
+
* conditions below (which are expected to fire first in any healthy run). */
|
|
46
|
+
maxTicks?: number;
|
|
47
|
+
removeVolumesOnDown?: boolean;
|
|
48
|
+
now?: () => Date;
|
|
49
|
+
}
|
|
50
|
+
export interface RunWorldDrivenOfficeSimResult {
|
|
51
|
+
runDir: string;
|
|
52
|
+
runId: string;
|
|
53
|
+
endedReason: ExchangeEndReason;
|
|
54
|
+
ticksRun: number;
|
|
55
|
+
markerFired: boolean;
|
|
56
|
+
agentTurnCount: number;
|
|
57
|
+
}
|
|
58
|
+
export declare const runWorldDrivenOfficeSim: (options: RunWorldDrivenOfficeSimOptions) => Promise<RunWorldDrivenOfficeSimResult>;
|
|
59
|
+
//# sourceMappingURL=worldDrivenOfficeSimDriver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worldDrivenOfficeSimDriver.d.ts","sourceRoot":"","sources":["../../src/sims/worldDrivenOfficeSimDriver.ts"],"names":[],"mappings":"AAkBA,OAAO,EAA8C,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAkBvG;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,8BAA8B;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,uBAAuB,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;qDACiD;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;iFAC6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,iBAAiB,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB;AAoDD,eAAO,MAAM,uBAAuB,GAClC,SAAS,8BAA8B,KACtC,OAAO,CAAC,6BAA6B,CAiJvC,CAAC"}
|