@intent-framework/core
v0.1.0-alpha.10
Published
Platformless semantic graph and runtime for Intent applications
Readme
@intent-framework/core
Platformless semantic graph and runtime for Intent applications.
Install
pnpm add @intent-framework/corenpm install @intent-framework/coreWhat it provides
screen()— define a semantic interaction space$.state.text()/$.state.boolean()/$.state.choice()— reactive state$.ask()— user-facing question with validation$.act()— executable action with conditions, lifecycle, and feedback$.resource()— async state with load/reload lifecycle$.surface()— named containment surfacecreateScreenRuntime()— runtime that owns screen state and resourcesinspectScreen()— semantic graph snapshot with diagnostics- Condition and signal primitives
Minimal example
import { screen, inspectScreen } from "@intent-framework/core"
const InviteMember = screen("InviteMember", $ => {
const email = $.state.text("email")
const emailAsk = $.ask("Email", email)
.required("Email is required")
.validate(value => value.includes("@") ? true : "Enter a valid email")
const invite = $.act("Invite member")
.primary()
.when(emailAsk.valid, "Enter a valid email first")
.does(() => {
console.log("invite", email.value)
})
$.surface("main").contains(emailAsk, invite)
})
const graph = inspectScreen(InviteMember)
console.log(graph.diagnostics)Where this fits
Core defines the product graph. It has no DOM, React, Node, or framework dependencies. Renderers (@intent-framework/dom), the router (@intent-framework/router), and testing (@intent-framework/testing) all build on core.
Learn more
- Root README — project overview and philosophy
- Quickstart — step-by-step guide
- Inspect Screen and Diagnostics Guide — graph inspection and diagnostics
- Resources Guide — resource lifecycle and runtime scoping
- MVP Checkpoint — current implementation boundaries
Status
Experimental alpha. APIs may change. Not recommended for production use.
