Repository navigation
Agent-readiness layer + package the node as @sphere-pub/node - #3
Merged
Merged
Conversation
…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>
4 of 16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two commits:
Accept: text/markdownnegotiation, x402/MPP challenge shapes.@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.tsre-export,wrangler.tomlwithmigrations_dirpointing 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 listfinds the migration fromnode_modules,wrangler devserves discovery/llms.txt/HTML/assets from the package, owner publish + markdown negotiation work.After merge: tag
v1.0.0to publish (needsNPM_TOKENsecret) — or publish once locally withnpm publish.🤖 Generated with Claude Code