Files
js-sdk/tsconfig.esm.json
zeekayandHanzo Dev e7aedf3291 feat: regenerate from hanzo.yaml — /v1/admin/plugins is now reachable
hanzoai/cloud has served the plugin operator surface for a while and no
TypeScript client could reach it: the committed src/ predates
hanzoai/openapi a9d999b, and `grep -r pluginAdmin src/` returned nothing.
It now returns 42, and AdminApi carries all four operations:

  GET  /v1/admin/plugins                  pluginAdminPlugins
  POST /v1/admin/plugins/{name}/enable    pluginAdminEnablePlugin
  POST /v1/admin/plugins/{name}/disable   pluginAdminDisablePlugin
  POST /v1/admin/plugins/{name}/reload    pluginAdminReloadPlugin

Regenerated with ./scripts/generate.sh from hanzo.yaml at hanzoai/openapi
2861089 (hanzo.yaml itself last moved at 3300cda; the two commits after it
are docs), against hanzoai/cloud b87a38df. Also in this regen:

  - /v1/kms/orgs/{org}/secrets -> /v1/kms/secrets. The {org} path parameter
    is gone; the org is read from the token (openapi 3300cda).
  - The api/ surface collapses 493 -> 354 files as merge.py consolidates
    each operation onto one primary tag.

Three fixes were required before this could ship at all.

1. src/api.ts, three lines. hanzo.yaml now carries case-variant duplicate
   tags (AI/Ai, API Keys/Api Keys, MCP/Mcp). openapi-generator emits a
   distinct class per tag, dedupes the colliding filenames to ai0-api.ts,
   then writes the barrel using the pre-dedup name './api/ai-api'. Three
   dangling re-exports; tsc fails. The previous client was clean, so this
   arrived with the tag collapse — meaning generate.yml's "Verify it builds"
   step fails on an untouched auto-regen PR today. The real fix is tag
   normalization in merge.py, upstream; these three lines are the stopgap.

2. tsconfig.esm.json set module=ESNext while inheriting
   moduleResolution=node16, which TS rejects outright (TS5110). `npm run
   build` has been failing on main since the TypeScript 7 migration, so
   publish-npm.yml could not have published anything. Pinned to Bundler,
   which is also the only resolution that accepts the generator's
   extensionless imports.

3. exports.import pointed at dist/esm/index.js. With "type": "commonjs" and
   a .js extension Node parses that as CJS and named imports throw; marking
   dist/esm as ESM only moves the failure to ERR_UNSUPPORTED_DIR_IMPORT,
   because the generated code imports directories ("./api") and
   extensionless paths. dist/esm is a bundler artifact reached via the
   "module" field, so both conditions now point at the CJS build, which
   Node's ESM loader reads named exports from correctly.

Version 1.0.1 -> 2.0.1. package.json was behind the registry: npm already
had 2.0.0 published (from a since-reverted lineage, never tagged), so
1.0.2 would have published below `latest` and walked consumers backwards.
2.0.1 is the patch above what is actually published.

Verified: tsc --noEmit clean; both halves of the build emit (2143 CJS +
2143 ESM + 4286 d.ts); npm pack -> install into a clean project -> require()
and import both resolve, 354 API classes export, all four pluginAdmin*
methods present on AdminApi.prototype, on a constructed instance and on
AdminApiFactory(), the shipped dist carries the four /v1/admin/plugins
routes and the un-orged /v1/kms/secrets, and a strict node16 TS consumer
compiles against the shipped .d.ts.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-28 10:35:28 -07:00

12 lines
364 B
JSON

{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ESNext",
// Node16 resolution would demand an explicit .js on every relative import;
// the generated client writes them extensionless. This half of the build
// feeds the `module` field, which only bundlers read.
"moduleResolution": "Bundler",
"outDir": "dist/esm"
}
}