Skip to content

feat: the npm path works — behold demo, no-project honesty, /api index, shipped agent contract - #194

Merged
lex00 merged 1 commit into
mainfrom
feat/npm-onboarding
Aug 9, 2026
Merged

feat: the npm path works — behold demo, no-project honesty, /api index, shipped agent contract#194
lex00 merged 1 commit into
mainfrom
feat/npm-onboarding

Conversation

@lex00

@lex00 lex00 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Closes #193.

A fresh npm install @intentius/behold dead-ended: blank graph on non-projects, contributor-only README, nothing runnable in the tarball, invisible agent contract. This PR makes the npm path first-class.

New-user path

  • behold demo — copies the bundled example-writes (now shipped in files) into ./behold-demo, installs its deps, and serves it with --local --env prod. The copy is the user's to edit. Idempotent — rerunning reuses the copy. The copy filter tests paths relative to the bundled root: inside an npm install the example itself lives under node_modules/, so a naive substring match copied nothing (caught by verifying against the packed tarball, not the checkout).
  • Non-chant directory honesty/api/graph 404s with structured {code: "no-project", error, remedy} when the base entity graph is empty and there's no chant.config.ts; the SPA shows its precondition card and the CLI warns at startup. A legitimately empty chant project keeps its 200 (the stack-lens fixtures pin this).
  • README — real npm quickstart (npx @intentius/behold demo / preview); the checkout commands are labeled as such.
  • behold --version.

Agent path

  • GET /api — a route index: method/path/one-line desc for every route, server version, agents-guide link. No more reading source to discover the surface.
  • AGENTS.md — now shipped in the tarball, response shape corrected ({ir, svg, meta}, not {ir, layout, meta}), documents /api discovery, the fuller route set, and the structured no-project code.
  • Docs — new "Driving it from an agent" page, and an npx @intentius/behold demo variant beside the clone-based agent prompt on the front page and run-it.

Verified

587 tests (3 new: no-project 404 + lens exemption, /api index), tsc, build. End-to-end from the packed tarball in a fresh directory: --version → 0.2.3; /api index served; preview in an empty dir → CLI warning + structured 404; behold demo → copy, install, emulator boot, 2-node graph on env prod over HTTP.

🤖 Generated with Claude Code

…x, shipped agent contract (#193)

A fresh `npm install @intentius/behold` used to dead-end: preview in a
non-chant dir served a blank graph, the README's quickstart was
contributor-only, nothing runnable shipped, and the agent contract
(AGENTS.md) was neither in the tarball nor discoverable.

- /api/graph 404s with structured {code: "no-project"} when the base
  entity graph is empty and the dir has no chant.config.ts — the SPA's
  precondition card + a CLI startup warning say so in both surfaces. A
  legitimately empty chant project keeps its 200.
- behold demo: copy the bundled example-writes (now shipped) into
  ./behold-demo, install, serve --local --env prod. The copy filter
  tests paths relative to the bundled root — inside an npm install the
  example itself lives under node_modules, so a bare match copied
  nothing.
- GET /api: a route index (method/path/desc, version, agents-guide
  link). behold --version prints the package version.
- AGENTS.md: shipped via files[], response shape corrected to
  {ir, svg, meta}, /api discovery + fuller routes; docs gain
  "Driving it from an agent" and an npx variant of the agent prompt;
  README gains a real npm quickstart.

Verified from the packed tarball in a fresh directory: --version,
/api index, the no-project 404 + warning, and the full demo — copy,
install, emulator boot, 2-node graph on env prod.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lex00
lex00 merged commit ded3c51 into main Aug 9, 2026
3 checks passed
@lex00
lex00 deleted the feat/npm-onboarding branch August 9, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The npm path dead-ends: blank graph on non-projects, contributor-only README, undiscoverable agent contract

1 participant