Skip to content

Install independent extension packages by npm spec or tarball (#844) - #853

Merged
jimhoyd merged 1 commit into
mainfrom
claude/independent-providers-844
Sep 28, 2026
Merged

jimhoyd merged 1 commit into
mainfrom
claude/independent-providers-844

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

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: static urlcode validate refused the Better Auth adapter because it looked for @jimhoyd/urlcode-better-auth, and advised extensions add better-auth, which could never work.

Now an operator can add their own extension package:

urlcode extensions add ./example-urlcode-greeting-2.3.4.tgz
urlcode extensions add @example/[email protected]
  • Install and pin. npm installs the spec with --ignore-scripts --save-exact. Its package-lock.json sha512 entry is the pin (core's addons.json still pins released add-ons).
  • Found by descriptor. Core reads the package's urlcode.json to learn which extension it provides (installedProviders), not its package name.
  • Wired like a released one. It gets the extensions.<name> block, its scaffold's routes and files, and import <name> from '<package>/extension' in host.mjs.
  • list reports it as independent (locked by npm integrity, or linked, not locked for a file: directory) and checks declaration and host drift.
  • Static validate checks its declaration against the descriptor's schemas without host code.
  • remove takes it out by name. Requirement and uses edges come from core's signed pins for released add-ons and from the descriptor for independent ones.
  • Refused:
    • a package with no valid extension descriptor;
    • an artifact descriptor (artifacts stay catalog-only);
    • a name that a first-party add-on of this core has, or a @jimhoyd/urlcode* package;
    • two packages providing the same name;
    • unmet requires.
  • Proof. The [Request]: Prove an embedded upstream auth provider in one local URLCode application #843 adapter moves to proofs/private-requests/better-auth-extension/, as @example/urlcode-better-auth with its own descriptor. The proof site depends on it with file:, and test:proof now asserts extensions list --strict and static validate both pass.

Not in this slice, and still open on #844:

  • offline, non-executing inspection of a tarball's documents;
  • standard OpenAPI/JSON Schema documents with local refs;
  • source staging;
  • the malicious path/symlink/cycle fixtures;
  • how CLI and MCP discovery (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, list without problems, static validation (valid and invalid config), remove, and --ignore-scripts on every npm call. The fake npm learned positional specs and non-@jimhoyd pruning.
  • test/addons.integration.ts (real npm, packed core): the fixture is packed to a tarball and added. The lock has a sha512 integrity, list --strict shows it independent, pinned, at 2.3.4, static validate passes, validate --local with the host activates it, and remove unwires it.
  • npm run verify: exit 0, core 1,100/1,100, every workspace suite, test:addons, test:proof 12/12. npm run test:package passes.
  • The core boundary allowlist entry for the extensions add loader and the agent-facts ordering check are updated for the renamed variables; the semantics are unchanged.
  • Not run on Windows.

Compatibility and security

  • Additive CLI behaviour; released add-ons install exactly as before.

  • Installing an independent package runs no lifecycle script. Its ./extension entry becomes trusted operator code once host.mjs imports it, the same as a hand-written operator module. docs/EXTENSIONS.md says 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

…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]>
@jimhoyd
jimhoyd enabled auto-merge (squash) September 28, 2026 17:19
@jimhoyd
jimhoyd merged commit b02d521 into main Sep 28, 2026
30 checks passed
@jimhoyd
jimhoyd deleted the claude/independent-providers-844 branch September 28, 2026 17:26
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