Standalone interactive fiction runtime built with Svelte and a strict StoryDriver boundary.
This package now exposes a stable public surface at src/lib/index.js (also package export .).
Public-by-convention exports include:
createDriver, StoryDriver, replay)ACTION_TYPES, EFFECT_TYPES, CONDITION_TYPES, EVENT_KINDS, STATE_VERSION)Identity artifacts are portable, versioned commitments for progress + identity that are designed for future ecology witnessing.
What they are:
{ identity, checkpoint, signature?, receipts?, meta? } payloadsencodeIdentityArtifact / decodeIdentityArtifact)What they are not:
Programmatic flow:
computeCheckpoint({ intentLog, ratifiedLog, receiptLog })createIdentityArtifact({ proof, checkpoint, receipts, meta })encodeIdentityArtifact(artifact) for copy/exportdecodeIdentityArtifact(str) + verifyIdentityArtifact({ artifact, proof }) on importCheckpoint commitment payload:
includeReceipts: false): commits to intentLog + ratifiedLog only.includeReceipts: true): also commits receiptLog.Determinism note:
createdAt explicitly or rely on checkpoint.at.createIdentityArtifact no longer falls back to wall-clock time implicitly.The following remain internal and may change without notice:
src/entry.js, src/App.svelte, src/lib/components/*, src/lib/app/*)scripts/*, rollup.config.js)src/lib/story/drivers/* unless re-exported from src/lib/index.jssrc/lib/story/graph.author.jssrc/lib/story/graph.js (storyGraph = { startNodeId, nodesById })src/lib/story/dsl/validate.jsdocs/if-dsl-quickstart.md/assets/... (for example <img src="/assets/demo.png" alt="demo" />); file:// loading is not supported.docs/if-dsl-quickstart.md under “Media Snippets”.Authoring rules:
src/lib/story/graph.author.js for story content changes.src/lib/story/graph.js directly (it re-exports authored graph).npm run validate-graph and npm test before handoff.AuthorityPort (src/lib/ports/authority.js): ratifies intent into ratifiedEvent and optional linked receipts.ProvisionalPort (src/lib/ports/provisional.js): streams non-authoritative provisional messages.GraphResolverPort (src/lib/ports/graph_resolver.js): resolves graph source (concernId/storyId selectors).ProofPort (src/lib/ports/proof.js): identity/signing seam for checkpoint artifacts.Default local adapters live in src/lib/adapters/ and keep behavior deterministic without mesh transport.
Future ecology integration should plug in via custom Authority + Provisional adapters.
npm run dev starts rollup watch + serves dist/ on http://localhost:4173 with Dev helpers.npm run build builds the Svelte bundle and prepares Play-mode dist shell.npm run start prepares and serves dist/ on http://localhost:4173 in Play mode.npm run validate-graph validates the default graph shape.npm run validate-graph:all validates default + in-repo example graphs.npm run validate-assets validates /assets/... references in known graphs and reports missing/unused files.npm run test runs brittle tests for non-UI story logic.?story=default?story=terminal-dossier?mode=dev (or ?dev=1) for Dev Mode?mode=play for Play Modesrc/lib/index.js follow semver compatibility.