Standalone interactive fiction runtime built with Svelte and a strict StoryDriver boundary.
npm install interactive-fiction-svelte
import { createDriver, graph, node, choice, choices, body } from "interactive-fiction-svelte";
import { defaultStoryGraph, terminalDossierGraph } from "interactive-fiction-svelte/examples";
This package exposes a stable runtime/library surface from the package root export interactive-fiction-svelte.
Public-by-convention exports include:
createDriver, StoryDriver, replay)ACTION_TYPES, EFFECT_TYPES, CONDITION_TYPES, EVENT_KINDS, STATE_VERSION)interactive-fiction-svelte/examplesThe package is runtime-first. The in-repo app shell, browser entrypoints, workflows, and tests are not part of the semver-stable package surface.
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.
Boundary note:
../interactive-fiction-concern-surface repo.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.npm run test:smoke runs the Playwright smoke test against the built dist/ app (Chromium locally; Chromium + Firefox in CI).npm run test:browser runs the deeper Playwright browser-flow suite against the built dist/ app (Chromium only).npm run test:ci runs the full local CI sequence, including browser smoke coverage.npm run test:full runs the CI sequence plus the deeper browser-flow suite.Browser Flows workflow so the main PR gate stays fast; run it manually or let the nightly schedule cover it.?story=default?story=terminal-dossier?mode=dev (or ?dev=1) for Dev Mode?mode=play for Play Modeinteractive-fiction-svelte/examples follow semver compatibility.