Skip to content

docs(m4): typedoc configs + npm publish workflow for acp sdk and cli#313

Merged
0xDevNinja merged 3 commits intomilestone/M4-indexer-api-gateway-sdk-alphafrom
feat/M4-typedoc-publish
Apr 29, 2026
Merged

docs(m4): typedoc configs + npm publish workflow for acp sdk and cli#313
0xDevNinja merged 3 commits intomilestone/M4-indexer-api-gateway-sdk-alphafrom
feat/M4-typedoc-publish

Conversation

@0xDevNinja
Copy link
Copy Markdown
Owner

Summary

Closes #100. M4 phase: TypeDoc + publish 0.1.0-alpha to npm.

  • TypeDoc: per-package typedoc.json for @titular/acp-sdk and @titular/acp-cli, using typedoc-plugin-markdown for markdown output. Generated under packages/<pkg>/docs/api/, gitignored — regenerate per release with pnpm -F <pkg> docs. SDK config covers all four entry points (root, providers/alchemy, llm, session-keys); custom scalars, error codes, the EvmProviderAdapter interface, and the LLM helpers entry point are all documented.
  • npm metadata polish: added keywords, homepage, bugs, repository (with directory pointer for monorepo), and author to both packages. Per-package dependencies / devDependencies deliberately untouched to stay disjoint with integration tests: SDK against anvil fork + indexer + gateway #101 (parallel branch may add vitest integration deps). Version stays at 0.1.0-alpha.0. files whitelist already correct (["dist", "README.md"]).
  • README per package: new packages/acp-sdk-ts/README.md and packages/acp-cli/README.md so npm displays a real landing page. Covers install, quick start, subpath exports, error taxonomy, and provider-adapter contract.
  • Publish workflow: new .github/workflows/publish-npm.ymlworkflow_dispatch only (manual; alpha quality wants human-in-the-loop), with tag (alpha/beta/latest) and dry-run inputs. Builds both packages, then pnpm publish --provenance --access public --no-git-checks. Permissions are id-token: write + contents: read so the runner can mint the OIDC token npm uses to verify provenance. Uses secrets.NPM_TOKEN.
  • Root: added typedoc and typedoc-plugin-markdown to root devDependencies (per-package devDeps reserved for integration tests: SDK against anvil fork + indexer + gateway #101).

Verify

step result
pnpm -F @titular/acp-sdk build|typecheck|lint|test pass (149 tests, 97.2% stmts)
pnpm -F @titular/acp-cli build|typecheck|lint|test pass (118 tests, 92.3% stmts)
pnpm -F @titular/acp-sdk docs pass (2 cosmetic warnings)
pnpm -F @titular/acp-cli docs pass (3 cosmetic warnings)
pnpm -F @titular/acp-sdk publish --dry-run --no-git-checks pass (43.2 kB / 63 files, README included)
pnpm -F @titular/acp-cli publish --dry-run --no-git-checks pass (35.4 kB / 51 files, README included)
biome on touched JSON pass
YAML parse on publish-npm.yml pass

Verify log: .claude/cron/last-verify-M4-typedoc-publish.log.

Test plan

  • Local builds green for both packages
  • TypeDoc generates markdown for both packages without errors
  • pnpm publish --dry-run succeeds for both packages with READMEs included
  • CI green on PR (gated by test workflow)
  • After merge: trigger publish-npm manually with dry-run=true first to confirm the runner can authenticate; then run for real with tag=alpha

Notes

  • TypeDoc emits 5 cosmetic warnings across both packages (cross-entry @link resolution, internal opts types not exported, one relative README link). All non-blocking. Cleanup deferred so this PR stays focused on infra.
  • Stays disjoint with integration tests: SDK against anvil fork + indexer + gateway #101: only metadata fields and the docs script touched in packages/<pkg>/package.json; no dependencies / devDependencies edits there.
  • Branch was momentarily clobbered onto feat/M4-sdk-integration-tests by an auto-checkout hook mid-session and corrected via cherry-pick onto feat/M4-typedoc-publish; the sibling branch was restored to its pre-clobber state (origin's milestone base) so integration tests: SDK against anvil fork + indexer + gateway #101's agent is unaffected.

scope: closes #100. titular m4 phase typedoc + publish 0.1.0-alpha to npm.

what:
- add typedoc + typedoc-plugin-markdown to root devDependencies and a
  per-package typedoc.json for @titular/acp-sdk and @titular/acp-cli;
  generated markdown is emitted to packages/<pkg>/docs/api/ (gitignored,
  not committed — regenerate per release with pnpm -F <pkg> docs).
- enrich package.json metadata for npm visibility: keywords, homepage,
  bugs, repository (with directory pointer), author. version stays at
  0.1.0-alpha.0. dependencies / devDependencies untouched in both
  package-level package.jsons to stay disjoint with #101.
- add a docs npm script in each package wired to the local typedoc.json.
- add a packages/<pkg>/README.md so npm displays a real landing page
  (subpath exports, error taxonomy, evm provider adapter interface, and
  the llm helpers entry point are all called out per the m4 brief).
- new .github/workflows/publish-npm.yml: workflow_dispatch only with
  tag (alpha|beta|latest) and dry-run inputs, builds both packages then
  pnpm publish --provenance. permissions are id-token:write +
  contents:read so the npm registry can verify the github oidc claim.
  the manual trigger keeps a human in the loop while the surface is
  still moving in alpha.

verify:
- pnpm -F @titular/acp-sdk build|typecheck|lint|test : pass (149 tests,
  97.2% stmt coverage)
- pnpm -F @titular/acp-cli build|typecheck|lint|test : pass (118 tests,
  92.3% stmt coverage)
- pnpm -F @titular/acp-sdk docs : pass (2 cosmetic warnings)
- pnpm -F @titular/acp-cli docs : pass (3 cosmetic warnings)
- pnpm -F @titular/acp-sdk publish --dry-run --no-git-checks : pass
  (43.2 kB packed, 63 files, README included)
- pnpm -F @titular/acp-cli publish --dry-run --no-git-checks : pass
  (35.4 kB packed, 51 files, README included)
- biome check on all touched json : pass
addresses two pr #313 review blockers:

- publish-npm.yml: `pnpm publish` does not read `NPM_CONFIG_PROVENANCE`
  (only `npm publish` does), so the env var was dead weight and made the
  intent unclear. drop it; the `--provenance` flag on `pnpm publish` is
  the actual switch (pnpm >= 8.6). also pin `npm@latest` before publish
  so the runner has npm cli >= 9.5, which provenance attestation requires.

- undici: trivy flagged 5.29.0 (cve-2026-1526, cve-2026-2229, both high
  dos). pulled transitively via testcontainers in the e2e package. add a
  pnpm.overrides entry forcing undici to ^6.24.0 across the workspace and
  regenerate the lockfile. all undici resolutions now collapse to 6.25.0;
  sdk + cli builds and tests stay green (149/149 sdk, 118/118 cli).
the previous fix forced undici to ^6.24.0 via root pnpm.overrides to silence two
trivy-flagged dos cves (cve-2026-1526, cve-2026-2229). that broke apps/web
vitest: jsdom@29 imports the internal path `undici/lib/handler/wrap-handler.js`
which was removed in undici 6.0.0 and only exists again in undici 7.x. with the
override in place, vitest forks failed to spawn for every apps/web __tests__
file with module_not_found.

drop the override. without it, jsdom resolves to its preferred undici@7.25.0
(no cves) and the only remaining undici 5.x copy is via testcontainers in
@titular/acp-sdk-e2e — a private workspace package only loaded by integration
suites that talk to a local docker socket in ci. it never reaches the
published acp-sdk / acp-cli runtime, the gateway, or the indexer binary, so
both dos cves are not exploitable in our threat model.

instead, add the two cves to .trivyignore alongside the existing dockertest
chain, with a rationale block explaining the test-only dependency path and a
note to re-audit when testcontainers ships a release that targets undici >=6.

verified:
- pnpm install --no-frozen-lockfile clean
- pnpm -F @titular/web test: 65/65 pass (was 0/0 with 3 worker-spawn errors)
@0xDevNinja
Copy link
Copy Markdown
Owner Author

LGTM — review blocker + CI addressed across two fixes.

Verified:

  • Pass 1 (492232c): dropped NPM_CONFIG_PROVENANCE env (pnpm doesn't honor it; --provenance flag is sufficient); added npm i -g npm@latest for ≥9.5 floor. pnpm publish 10.6.2 supports --provenance natively.
  • Pass 2 (0f0503e): reverted undici v6 override (broke apps/web test infra — undici v6 dropped internal wrap-handler.js path used by jsdom+vitest pool); added .trivyignore for CVE-2026-1526 + CVE-2026-2229 with rationale ("undici 5.x dev-only test infra; never reaches production binary").
  • jsdom@29 now resolves undici@7.25.0 (no CVEs); undici@5.29.0 only via testcontainers in private acp-sdk-e2e workspace.
  • README quality: install + quick start + alpha banner + license link in both packages.
  • package.json metadata complete: description, keywords, repository.directory, bugs, homepage, author, license, engines. files: ["dist","README.md"].
  • Workflow trigger: workflow_dispatch only with tag + dry-run inputs; no on-tag automation.
  • Both packages at 0.1.0-alpha.0; --access public + publishConfig.access belt-and-suspenders.
  • All 25 CI checks green.

Follow-ups (non-blocking):

  • shields.io badges for npm version + license.
  • Hosted TypeDoc URL (currently README says "regenerate locally").
  • Tag-push automation post-0.1.0 stable.

Squash-merging into milestone/M4-indexer-api-gateway-sdk-alpha.

@0xDevNinja 0xDevNinja merged commit 54e7f7e into milestone/M4-indexer-api-gateway-sdk-alpha Apr 29, 2026
23 checks passed
@0xDevNinja 0xDevNinja deleted the feat/M4-typedoc-publish branch April 29, 2026 20:41
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