Skip to content

Agent-readiness layer + package the node as @sphere-pub/node - #3

Merged
marianoviola merged 3 commits into
mainfrom
agent-readiness-compact-layer
Sep 21, 2026
Merged

marianoviola merged 3 commits into
mainfrom
agent-readiness-compact-layer

Conversation

@marianoviola

Copy link
Copy Markdown
Owner

Two commits:

  1. Compact agent-readiness layer (already on this branch): robots.txt with Content Signals, sitemap.xml, Accept: text/markdown negotiation, x402/MPP challenge shapes.
  2. Package the node as @sphere-pub/node; relicense to MIT. The node ships as the Deploy-button reference instance (unchanged) and as an npm package. An instance is three files (src/index.ts re-export, wrangler.toml with migrations_dir pointing into the package, the dependency). sphere-pub is the first instance.

Verified locally: typecheck, 90/90 tests, npm pack; installed the tarball into sphere-pub, wrangler d1 migrations list finds the migration from node_modules, wrangler dev serves discovery/llms.txt/HTML/assets from the package, owner publish + markdown negotiation work.

After merge: tag v1.0.0 to publish (needs NPM_TOKEN secret) — or publish once locally with npm publish.

🤖 Generated with Claude Code

marianoviola and others added 2 commits July 19, 2026 23:49
…tiation, x402/MPP

An agent-readiness audit (isitagentready.com) scored this node against
standards outside its own bespoke contract. Add everything honestly
achievable without a real payment/checkout backend: /robots.txt with
Content Signals (SPHERE_ALLOW_AI_TRAINING, off by default), /sitemap.xml,
Accept: text/markdown negotiation at the canonical /fragments/{id} URL,
and an alternate-discovery Link header on the human pages.

Commerce: access.payment.profile now shapes the 402 challenge correctly —
"x402" replaces the body with the real x402 PaymentRequired envelope
(github.com/coinbase/x402 spec v2, verified field-for-field against the
spec), "mpp" sets a real Payment HTTP-auth-scheme WWW-Authenticate header
(paymentauth.org draft-httpauth-payment-00, likewise verified), and any
other profile keeps the original generic shape byte-for-byte — every
existing test passes unchanged. ACP and UCP are intentionally not
implemented: neither has a discovery-only mode, and claiming support
without a real checkout API would be misleading.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The node now ships in two forms: the Deploy-button reference instance
(unchanged, built from source) and an npm package for owners who keep
their own Worker project. An instance is three files: re-export the
handler, point wrangler.toml's migrations_dir into the package, add the
dependency. sphere.pub becomes the first such instance.

- src/index.ts: public entry (default handler, Env, handleRequest,
  depsFromEnv, contract types). Env is now exported.
- scripts/build.mjs: esbuild bundles dist/index.js (worker) and
  dist/cli.js (the `sphere-node` bin wrapping scripts/publish.ts);
  tsc emits declarations to dist/types.
- package.json: name, exports (., ./spec/*, ./migrations/*), bin,
  files, prepack build; esbuild as an explicit devDependency.
- scripts/publish.ts: detect direct invocation by real path so the
  bin works through the node_modules/.bin symlink.
- LICENSE: MIT, aligned with the plugin (package.json already said
  MIT while the file was Apache 2.0).
- .github/workflows: ci on push/PR; release publishes to npm on a v*
  tag matching package.json.
- README: "Use as a package" section, release notes, MIT.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@marianoviola
marianoviola merged commit 80fb224 into main Sep 21, 2026
1 check passed
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.

1 participant