Repository navigation
Install independent extension packages by npm spec or tarball (#844) - #853
Merged
Merged
Conversation
…arball (#844) An extension no longer has to be @jimhoyd/urlcode-<name> from core's catalog. `urlcode extensions add` also takes an npm spec or local tarball: npm installs it with --ignore-scripts --save-exact and locks its sha512; core finds the extension it provides by the package's urlcode.json descriptor, not its name, and wires it like a released one (YAML block, scaffold, host import of <package>/extension). list reports it as independent, static validate checks it against its descriptor's schemas, and remove takes it out by name. Refused: no valid extension descriptor, an artifact descriptor, a first-party name or @jimhoyd package, a duplicate provider, and missing requirements. Artifacts stay catalog-only. The #843 proof's Better Auth adapter is now such a package (@example/urlcode-better-auth), so the proof site passes static validate and extensions list --strict. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Problem and change
First slice of #844. Every extension had to be the first-party package
@jimhoyd/urlcode-<name>from core's catalog. The #843 proof showed the cost: staticurlcode validaterefused the Better Auth adapter because it looked for@jimhoyd/urlcode-better-auth, and advisedextensions add better-auth, which could never work.Now an operator can add their own extension package:
--ignore-scripts --save-exact. Itspackage-lock.jsonsha512 entry is the pin (core'saddons.jsonstill pins released add-ons).urlcode.jsonto learn which extension it provides (installedProviders), not its package name.extensions.<name>block, its scaffold's routes and files, andimport <name> from '<package>/extension'inhost.mjs.listreports it asindependent(locked by npm integrity, orlinked, not lockedfor afile:directory) and checks declaration and host drift.validatechecks its declaration against the descriptor's schemas without host code.removetakes it out by name. Requirement andusesedges come from core's signed pins for released add-ons and from the descriptor for independent ones.artifactdescriptor (artifacts stay catalog-only);@jimhoyd/urlcode*package;requires.proofs/private-requests/better-auth-extension/, as@example/urlcode-better-authwith its own descriptor. The proof site depends on it withfile:, andtest:proofnow assertsextensions list --strictand staticvalidateboth pass.Not in this slice, and still open on #844:
get_extensions,get_addon_agent_tooling, docs search) cover independent packages.Verification
test/addons.test.ts(offline, fake npm): a new test adds the independent fixture by path. It covers each refusal with package.json rolled back, the YAML and host edits,listwithout problems, static validation (valid and invalid config),remove, and--ignore-scriptson every npm call. The fake npm learned positional specs and non-@jimhoydpruning.test/addons.integration.ts(real npm, packed core): the fixture is packed to a tarball and added. The lock has a sha512 integrity,list --strictshows it independent, pinned, at 2.3.4, staticvalidatepasses,validate --localwith the host activates it, andremoveunwires it.npm run verify: exit 0, core 1,100/1,100, every workspace suite,test:addons,test:proof12/12.npm run test:packagepasses.extensions addloader and the agent-facts ordering check are updated for the renamed variables; the semantics are unchanged.Compatibility and security
Additive CLI behaviour; released add-ons install exactly as before.
Installing an independent package runs no lifecycle script. Its
./extensionentry becomes trusted operator code oncehost.mjsimports it, the same as a hand-written operator module.docs/EXTENSIONS.mdsays to review it.Changes match the documented portable contract; docs/examples are updated where needed.
Relevant tests and package checks pass, or limitations are explained above.
No credentials, customer data or private project material are included.
Runtime/starter changes remain aligned where applicable.
🤖 Generated with Claude Code