dominus-sdk-nodejs 11.0.2 → 11.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +351 -371
  2. package/dist/contract/index.d.ts +3 -0
  3. package/dist/contract/index.d.ts.map +1 -0
  4. package/dist/contract/index.js +3 -0
  5. package/dist/contract/index.js.map +1 -0
  6. package/dist/contract/node-envelope.d.ts +12 -0
  7. package/dist/contract/node-envelope.d.ts.map +1 -0
  8. package/dist/contract/node-envelope.js +16 -0
  9. package/dist/contract/node-envelope.js.map +1 -0
  10. package/dist/contract/node-projections.d.ts +15 -0
  11. package/dist/contract/node-projections.d.ts.map +1 -0
  12. package/dist/contract/node-projections.js +4 -0
  13. package/dist/contract/node-projections.js.map +1 -0
  14. package/dist/lib/config.d.ts +3 -2
  15. package/dist/lib/config.d.ts.map +1 -1
  16. package/dist/lib/config.js +4 -3
  17. package/dist/lib/config.js.map +1 -1
  18. package/dist/lib/errors.d.ts +7 -0
  19. package/dist/lib/errors.d.ts.map +1 -1
  20. package/dist/lib/errors.js +53 -0
  21. package/dist/lib/errors.js.map +1 -1
  22. package/dist/lib/recovery-action.d.ts +4 -0
  23. package/dist/lib/recovery-action.d.ts.map +1 -0
  24. package/dist/lib/recovery-action.js +29 -0
  25. package/dist/lib/recovery-action.js.map +1 -0
  26. package/dist/namespaces/portal.d.ts +10 -0
  27. package/dist/namespaces/portal.d.ts.map +1 -1
  28. package/dist/namespaces/portal.js +11 -0
  29. package/dist/namespaces/portal.js.map +1 -1
  30. package/dist/namespaces/secrets.d.ts +5 -1
  31. package/dist/namespaces/secrets.d.ts.map +1 -1
  32. package/dist/namespaces/secrets.js +15 -1
  33. package/dist/namespaces/secrets.js.map +1 -1
  34. package/docs/agent-guide/2026-06-27-0849-sdk-orient/00-reading-order.md +35 -35
  35. package/docs/agent-guide/2026-06-27-0849-sdk-orient/01-purpose-and-boundaries.md +48 -48
  36. package/docs/agent-guide/2026-06-27-0849-sdk-orient/02-repo-map-and-entrypoints.md +46 -46
  37. package/docs/agent-guide/2026-06-27-0849-sdk-orient/03-api-surface.md +59 -59
  38. package/docs/agent-guide/2026-06-27-0849-sdk-orient/04-data-state-and-storage.md +36 -36
  39. package/docs/agent-guide/2026-06-27-0849-sdk-orient/05-integrations-and-runtime.md +40 -40
  40. package/docs/agent-guide/2026-06-27-0849-sdk-orient/06-workflows-commands-and-ci.md +58 -58
  41. package/docs/agent-guide/2026-06-27-0849-sdk-orient/07-operations-release-and-live-proof.md +40 -40
  42. package/docs/agent-guide/2026-06-27-0849-sdk-orient/08-security-privacy-and-secrets.md +38 -38
  43. package/docs/agent-guide/2026-06-27-0849-sdk-orient/09-known-risks-and-debt.md +34 -34
  44. package/docs/agent-guide/2026-06-27-0849-sdk-orient/10-agent-playbook.md +48 -48
  45. package/docs/agent-guide/2026-08-04-sdk-nodejs/00-reading-order.md +11 -11
  46. package/docs/agent-guide/2026-08-04-sdk-nodejs/01-purpose-and-boundaries.md +14 -14
  47. package/docs/agent-guide/2026-08-04-sdk-nodejs/03-api-surface.md +16 -16
  48. package/docs/agent-guide/2026-08-04-sdk-nodejs/10-agent-playbook.md +14 -14
  49. package/docs/agent-guide/INDEX.md +14 -14
  50. package/docs/agent-guide/current.md +22 -22
  51. package/docs/architecture.md +119 -119
  52. package/docs/atlas/2026-07-24-1231-sdk-nodejs-blockers.md +15 -15
  53. package/docs/atlas/2026-07-24-1231-sdk-nodejs-proof-ladder.md +25 -25
  54. package/docs/atlas/2026-07-24-1231-sdk-nodejs-truthmap.md +43 -43
  55. package/docs/atlas/2026-08-04-sdk-nodejs-blockers.md +12 -12
  56. package/docs/atlas/2026-08-04-sdk-nodejs-proof-ladder.md +9 -9
  57. package/docs/atlas/2026-08-04-sdk-nodejs-truthmap.md +21 -21
  58. package/docs/atlas/INDEX.md +26 -26
  59. package/docs/janitor/2026-06-27-0849-sdk-orient-cleanup-audit.md +102 -102
  60. package/docs/janitor/2026-08-04-sdk-nodejs-cleanup-audit.md +14 -14
  61. package/docs/migration-error-base.md +115 -0
  62. package/docs/plans/2026-08-04-pending-work-fruition-summary.md +46 -46
  63. package/docs/routes-services.md +80 -80
  64. package/docs/usage-reference.md +698 -698
  65. package/docs/workflow-hard-cut-release.md +24 -24
  66. package/package.json +55 -55
@@ -1,58 +1,58 @@
1
- # 06 Workflows, Commands, And CI
2
-
3
- All commands from `package.json` `scripts`.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm ci # CI / reproducible
9
- npm install # local
10
- ```
11
-
12
- ## Build / Dev
13
-
14
- ```bash
15
- npm run build # tsc -> dist/
16
- npm run dev # tsc --watch
17
- npm run clean # rm -rf dist
18
- ```
19
-
20
- ## Typecheck / Lint
21
-
22
- ```bash
23
- npm run typecheck # tsc --noEmit
24
- npm run lint # tsc --noEmit (lint == typecheck in this repo)
25
- npm run test:types # tsc -p tsconfig.type-tests.json (the *.typecheck.ts files)
26
- ```
27
-
28
- ## Test
29
-
30
- ```bash
31
- npm test
32
- ```
33
-
34
- `npm test` = `build` + `test:types` + an explicit `node --test` file list (24
35
- files under `tests/`). Run before finalizing substantial changes (`CLAUDE.md`
36
- Validation). Tests are committed and present — the older "no committed tests"
37
- note is stale.
38
-
39
- ## Fast Local Validation
40
-
41
- `npm run typecheck` (or `lint`) for a quick compile check; `npm run test:types`
42
- for the type-level contract tests.
43
-
44
- ## Full Validation
45
-
46
- `npm test` (build + type tests + unit/contract tests).
47
-
48
- ## CI Workflows
49
-
50
- | Workflow | Trigger | Signal |
51
- |---|---|---|
52
- | `.github/workflows/publish-production.yml` | push to `production` | `npm ci` + build + npm publish (skips if version already on registry; falls back to provenance publish). |
53
- | `.github/workflows/publish-staging.yml` | (staging branch) | npm publish lane. |
54
- | `.github/workflows/publish-development.yml` | (development branch) | npm publish lane. |
55
-
56
- Per workspace reality, only the `production` lane is the live publish path for
57
- this repo. Publishing is version-gated: bump `package.json` `version` or the
58
- publish step no-ops.
1
+ # 06 Workflows, Commands, And CI
2
+
3
+ All commands from `package.json` `scripts`.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm ci # CI / reproducible
9
+ npm install # local
10
+ ```
11
+
12
+ ## Build / Dev
13
+
14
+ ```bash
15
+ npm run build # tsc -> dist/
16
+ npm run dev # tsc --watch
17
+ npm run clean # rm -rf dist
18
+ ```
19
+
20
+ ## Typecheck / Lint
21
+
22
+ ```bash
23
+ npm run typecheck # tsc --noEmit
24
+ npm run lint # tsc --noEmit (lint == typecheck in this repo)
25
+ npm run test:types # tsc -p tsconfig.type-tests.json (the *.typecheck.ts files)
26
+ ```
27
+
28
+ ## Test
29
+
30
+ ```bash
31
+ npm test
32
+ ```
33
+
34
+ `npm test` = `build` + `test:types` + an explicit `node --test` file list (24
35
+ files under `tests/`). Run before finalizing substantial changes (`CLAUDE.md`
36
+ Validation). Tests are committed and present — the older "no committed tests"
37
+ note is stale.
38
+
39
+ ## Fast Local Validation
40
+
41
+ `npm run typecheck` (or `lint`) for a quick compile check; `npm run test:types`
42
+ for the type-level contract tests.
43
+
44
+ ## Full Validation
45
+
46
+ `npm test` (build + type tests + unit/contract tests).
47
+
48
+ ## CI Workflows
49
+
50
+ | Workflow | Trigger | Signal |
51
+ |---|---|---|
52
+ | `.github/workflows/publish-production.yml` | push to `production` | `npm ci` + build + npm publish (skips if version already on registry; falls back to provenance publish). |
53
+ | `.github/workflows/publish-staging.yml` | (staging branch) | npm publish lane. |
54
+ | `.github/workflows/publish-development.yml` | (development branch) | npm publish lane. |
55
+
56
+ Per workspace reality, only the `production` lane is the live publish path for
57
+ this repo. Publishing is version-gated: bump `package.json` `version` or the
58
+ publish step no-ops.
@@ -1,40 +1,40 @@
1
- # 07 Operations, Release, And Live Proof
2
-
3
- ## Deployment Lane
4
-
5
- This is a published npm package, not a deployed service. "Release" = npm publish.
6
-
7
- - Push to `production` → `.github/workflows/publish-production.yml` →
8
- `npm publish --access public`.
9
- - Per workspace convention this repo's production branch is `production` (NOT
10
- `dominus-production`, which is the convention for other Dominus repos).
11
- - Requires GitHub Environment `production` with `NPM_TOKEN` (or npm OIDC trusted
12
- publishing for the provenance-only retry).
13
-
14
- ## Release Files And Version Rules
15
-
16
- - `package.json` `version` is the single source of truth (6.6.0 at this
17
- snapshot). The publish step checks `npm view <name>@<version>` and skips if the
18
- version already exists, so **a version bump is required to publish**.
19
- - `CHANGELOG.md` records each version's changes; update it with the bump.
20
- - `package.json` `files` ships `dist`, `README.md`, and `docs`.
21
- - `prepublishOnly` runs `npm run build` so `dist/` is fresh in the tarball.
22
-
23
- ## Live Proof
24
-
25
- - Registry: `npm view dominus-sdk-nodejs version` should match the pushed
26
- `package.json` version after the workflow succeeds.
27
- - CI: the publish-production workflow run on the `production` push.
28
-
29
- ## Done Definitions
30
-
31
- - **Local done:** `npm test` green (build + type tests + unit/contract tests).
32
- - **CI done:** publish-production workflow succeeds.
33
- - **Release done:** new version visible on npm.
34
-
35
- ## Rollback
36
-
37
- Per `docs/workflow-hard-cut-release.md`: downgrade target is the previously
38
- published production SDK version. Trigger: customers report Authority-backed
39
- recipe launch or native pipelines cannot start. (npm versions are immutable;
40
- "rollback" means consumers pin the prior version.)
1
+ # 07 Operations, Release, And Live Proof
2
+
3
+ ## Deployment Lane
4
+
5
+ This is a published npm package, not a deployed service. "Release" = npm publish.
6
+
7
+ - Push to `production` → `.github/workflows/publish-production.yml` →
8
+ `npm publish --access public`.
9
+ - Per workspace convention this repo's production branch is `production` (NOT
10
+ `dominus-production`, which is the convention for other Dominus repos).
11
+ - Requires GitHub Environment `production` with `NPM_TOKEN` (or npm OIDC trusted
12
+ publishing for the provenance-only retry).
13
+
14
+ ## Release Files And Version Rules
15
+
16
+ - `package.json` `version` is the single source of truth (6.6.0 at this
17
+ snapshot). The publish step checks `npm view <name>@<version>` and skips if the
18
+ version already exists, so **a version bump is required to publish**.
19
+ - `CHANGELOG.md` records each version's changes; update it with the bump.
20
+ - `package.json` `files` ships `dist`, `README.md`, and `docs`.
21
+ - `prepublishOnly` runs `npm run build` so `dist/` is fresh in the tarball.
22
+
23
+ ## Live Proof
24
+
25
+ - Registry: `npm view dominus-sdk-nodejs version` should match the pushed
26
+ `package.json` version after the workflow succeeds.
27
+ - CI: the publish-production workflow run on the `production` push.
28
+
29
+ ## Done Definitions
30
+
31
+ - **Local done:** `npm test` green (build + type tests + unit/contract tests).
32
+ - **CI done:** publish-production workflow succeeds.
33
+ - **Release done:** new version visible on npm.
34
+
35
+ ## Rollback
36
+
37
+ Per `docs/workflow-hard-cut-release.md`: downgrade target is the previously
38
+ published production SDK version. Trigger: customers report Authority-backed
39
+ recipe launch or native pipelines cannot start. (npm versions are immutable;
40
+ "rollback" means consumers pin the prior version.)
@@ -1,38 +1,38 @@
1
- # 08 Security, Privacy, And Secrets
2
-
3
- ## Auth Boundaries
4
-
5
- - **Service auth:** `DOMINUS_TOKEN` PSK → minted short-lived JWT via gateway
6
- `/jwt/mint`, cached (`src/lib/client.ts`). Default for namespace calls.
7
- - **User auth:** optional `userToken` passes a caller JWT through unchanged;
8
- the backend authorizes the user context.
9
- - **Selected-scope:** `mintSelectedScopeJwt(targetOrgId, targetEnv)` is the only
10
- supported selected-scope mint helper; scope keys off org + environment.
11
- - **Local JWT helpers:** `verifyJwtLocally`, `isJwtValid`, `auth.validateJwt`
12
- (local payload/expiry checks — not full remote introspection), `auth.getJwks`
13
- (cached public keys).
14
-
15
- Identity-family rule (workspace policy): service token, service JWT, portal user
16
- JWT, client JWT, and selected-scope operator token are NOT interchangeable. Do
17
- not forward a user or machine JWT to admin-only planes.
18
-
19
- Service-side 401 rule (`CLAUDE.md`): a non-`/portal/auth/*` 401 must not be
20
- laundered into user-session expiry by callers. Classify by
21
- `DominusError.endpoint`, not message strings — every `getServiceJwt` throw
22
- carries `endpoint='/jwt/mint'`.
23
-
24
- ## Secret / Config Resolution
25
-
26
- - `src/lib/config.ts` resolves gateway/proxy/url config and `DOMINUS_TOKEN`
27
- from env. No secret values are committed.
28
- - `.gitignore` excludes `.env`, `.env.local`, `.env.*.local`, `.npmrc`.
29
-
30
- ## PHI / Sensitive-Data Rules
31
-
32
- - This SDK carries no PHI itself, but it transports caller data to backends.
33
- - Never log or write into docs: PHI, secret values, tokens, cookies, JWTs, raw
34
- request/response bodies.
35
-
36
- ## Must Never Be Written Into Docs
37
-
38
- Tokens, PSKs, JWTs, secret values, raw response bodies, customer/patient data.
1
+ # 08 Security, Privacy, And Secrets
2
+
3
+ ## Auth Boundaries
4
+
5
+ - **Service auth:** `DOMINUS_TOKEN` PSK → minted short-lived JWT via gateway
6
+ `/jwt/mint`, cached (`src/lib/client.ts`). Default for namespace calls.
7
+ - **User auth:** optional `userToken` passes a caller JWT through unchanged;
8
+ the backend authorizes the user context.
9
+ - **Selected-scope:** `mintSelectedScopeJwt(targetOrgId, targetEnv)` is the only
10
+ supported selected-scope mint helper; scope keys off org + environment.
11
+ - **Local JWT helpers:** `verifyJwtLocally`, `isJwtValid`, `auth.validateJwt`
12
+ (local payload/expiry checks — not full remote introspection), `auth.getJwks`
13
+ (cached public keys).
14
+
15
+ Identity-family rule (workspace policy): service token, service JWT, portal user
16
+ JWT, client JWT, and selected-scope operator token are NOT interchangeable. Do
17
+ not forward a user or machine JWT to admin-only planes.
18
+
19
+ Service-side 401 rule (`CLAUDE.md`): a non-`/portal/auth/*` 401 must not be
20
+ laundered into user-session expiry by callers. Classify by
21
+ `DominusError.endpoint`, not message strings — every `getServiceJwt` throw
22
+ carries `endpoint='/jwt/mint'`.
23
+
24
+ ## Secret / Config Resolution
25
+
26
+ - `src/lib/config.ts` resolves gateway/proxy/url config and `DOMINUS_TOKEN`
27
+ from env. No secret values are committed.
28
+ - `.gitignore` excludes `.env`, `.env.local`, `.env.*.local`, `.npmrc`.
29
+
30
+ ## PHI / Sensitive-Data Rules
31
+
32
+ - This SDK carries no PHI itself, but it transports caller data to backends.
33
+ - Never log or write into docs: PHI, secret values, tokens, cookies, JWTs, raw
34
+ request/response bodies.
35
+
36
+ ## Must Never Be Written Into Docs
37
+
38
+ Tokens, PSKs, JWTs, secret values, raw response bodies, customer/patient data.
@@ -1,34 +1,34 @@
1
- # 09 Known Risks And Debt
2
-
3
- ## Stale Docs (corrected this pass)
4
-
5
- - `docs/architecture.md` §10 and `CLAUDE.md` Validation note claimed "no
6
- committed automated tests". STALE — `tests/` has 24 committed files run by
7
- `npm test`. Corrected in both files in this janitor pass. If a future edit
8
- re-introduces the claim, fix it; do not trust it.
9
-
10
- ## Doc Maintenance Burden
11
-
12
- - `docs/usage-reference.md` is ~98 KB and `docs/routes-services.md` cites
13
- "450 commands across 29 namespace surfaces". These hand-maintained counts can
14
- drift from source. Treat `src/namespaces/*.ts` + `src/index.ts` as authority;
15
- re-derive counts before quoting them. (At this snapshot: 27 namespace files,
16
- 24 test files.)
17
-
18
- ## Generated Residue
19
-
20
- - `dist/` (~1.6 MB) is built output, gitignored; safe to delete and rebuild with
21
- `npm run build`. Auto-cleaned this pass (see janitor audit). `node_modules/`
22
- likewise reproducible via `npm ci`.
23
-
24
- ## Ownership / Boundaries
25
-
26
- - The SDK must conform to kernel contracts (identity families, error envelope,
27
- routing) defined in the Dominus workers — it does not define them. Changes that
28
- touch wire protocol, JWT TTLs, or route transforms are contract-sensitive and
29
- warrant `dominus-expert` review before shipping.
30
-
31
- ## Cleanup Links
32
-
33
- - Janitor audit: `docs/janitor/2026-06-27-0849-sdk-orient-cleanup-audit.md`.
34
- - No `docs/atlas/` exists; run `kyle-atlas` if truth becomes scattered.
1
+ # 09 Known Risks And Debt
2
+
3
+ ## Stale Docs (corrected this pass)
4
+
5
+ - `docs/architecture.md` §10 and `CLAUDE.md` Validation note claimed "no
6
+ committed automated tests". STALE — `tests/` has 24 committed files run by
7
+ `npm test`. Corrected in both files in this janitor pass. If a future edit
8
+ re-introduces the claim, fix it; do not trust it.
9
+
10
+ ## Doc Maintenance Burden
11
+
12
+ - `docs/usage-reference.md` is ~98 KB and `docs/routes-services.md` cites
13
+ "450 commands across 29 namespace surfaces". These hand-maintained counts can
14
+ drift from source. Treat `src/namespaces/*.ts` + `src/index.ts` as authority;
15
+ re-derive counts before quoting them. (At this snapshot: 27 namespace files,
16
+ 24 test files.)
17
+
18
+ ## Generated Residue
19
+
20
+ - `dist/` (~1.6 MB) is built output, gitignored; safe to delete and rebuild with
21
+ `npm run build`. Auto-cleaned this pass (see janitor audit). `node_modules/`
22
+ likewise reproducible via `npm ci`.
23
+
24
+ ## Ownership / Boundaries
25
+
26
+ - The SDK must conform to kernel contracts (identity families, error envelope,
27
+ routing) defined in the Dominus workers — it does not define them. Changes that
28
+ touch wire protocol, JWT TTLs, or route transforms are contract-sensitive and
29
+ warrant `dominus-expert` review before shipping.
30
+
31
+ ## Cleanup Links
32
+
33
+ - Janitor audit: `docs/janitor/2026-06-27-0849-sdk-orient-cleanup-audit.md`.
34
+ - No `docs/atlas/` exists; run `kyle-atlas` if truth becomes scattered.
@@ -1,48 +1,48 @@
1
- # 10 Agent Playbook
2
-
3
- ## If You Are Changing X, Read Y First
4
-
5
- - **A namespace command** → `src/namespaces/<name>.ts` + the relevant rows in
6
- `docs/routes-services.md`. Follow the Public API Change Checklist in
7
- `CLAUDE.md` (update namespace, wire in `src/index.ts` if new, export types,
8
- update `docs/usage-reference.md` and `routes-services.md`).
9
- - **Transport / auth / retries / streaming / binary** → `src/lib/client.ts` and
10
- `docs/architecture.md` §3,§5,§6,§7. The 55-min JWT cache TTL is load-bearing;
11
- do not regress it without raising the jwt-worker `JWT_EXPIRY_SECONDS` first.
12
- - **A new public type or root shortcut** → `src/index.ts` (constructor + export).
13
- - **Errors** → `src/lib/errors.ts`; pass `endpoint` on service-auth throws so
14
- callers can classify by `DominusError.endpoint`.
15
- - **Env/gateway config** → `src/lib/config.ts`.
16
-
17
- ## If Validation Fails
18
-
19
- - Build/type errors → `npm run typecheck`; the repo's lint IS tsc.
20
- - Type-contract failures → `npm run test:types` (the `*.typecheck.ts` files).
21
- - Unit/contract failures → `npm test` runs an explicit file list; run a single
22
- file with `node --test tests/<file>.test.js` after `npm run build`.
23
-
24
- ## Common Traps
25
-
26
- - Importing from a subpath — there is only one export entry; import from
27
- `'dominus-sdk-nodejs'`.
28
- - Treating `dist/` as source — it is generated; edit `src/`.
29
- - Forgetting the version bump — publish-production no-ops if the version already
30
- exists on npm.
31
- - Using `dominus-production` as this repo's branch — it is `production` here.
32
- - Pointing `browser` methods at worker-local `/runs/*` — use `/api/browser/*`
33
- with `useGateway: true`.
34
-
35
- ## Which Kyle Skill For Common Work
36
-
37
- - Behavior change / bug fix → `kyle-fix` (test-first via `kyle-tdd`).
38
- - Root-cause unknown → `kyle-diagnose`.
39
- - Plan a larger change → `kyle-plan`.
40
- - Review a diff → `kyle-review`.
41
- - Contract-sensitive change (wire protocol, JWT, routing) → route to
42
- `dominus-expert` before shipping.
43
- - Docs/cleanup drift → `kyle-janitor` (this pack).
44
-
45
- ## Handoff Expectations
46
-
47
- This is a Dominus platform repo: cross-contract or wire-protocol changes need
48
- `dominus-expert` review. Releases are npm publishes gated on a version bump.
1
+ # 10 Agent Playbook
2
+
3
+ ## If You Are Changing X, Read Y First
4
+
5
+ - **A namespace command** → `src/namespaces/<name>.ts` + the relevant rows in
6
+ `docs/routes-services.md`. Follow the Public API Change Checklist in
7
+ `CLAUDE.md` (update namespace, wire in `src/index.ts` if new, export types,
8
+ update `docs/usage-reference.md` and `routes-services.md`).
9
+ - **Transport / auth / retries / streaming / binary** → `src/lib/client.ts` and
10
+ `docs/architecture.md` §3,§5,§6,§7. The 55-min JWT cache TTL is load-bearing;
11
+ do not regress it without raising the jwt-worker `JWT_EXPIRY_SECONDS` first.
12
+ - **A new public type or root shortcut** → `src/index.ts` (constructor + export).
13
+ - **Errors** → `src/lib/errors.ts`; pass `endpoint` on service-auth throws so
14
+ callers can classify by `DominusError.endpoint`.
15
+ - **Env/gateway config** → `src/lib/config.ts`.
16
+
17
+ ## If Validation Fails
18
+
19
+ - Build/type errors → `npm run typecheck`; the repo's lint IS tsc.
20
+ - Type-contract failures → `npm run test:types` (the `*.typecheck.ts` files).
21
+ - Unit/contract failures → `npm test` runs an explicit file list; run a single
22
+ file with `node --test tests/<file>.test.js` after `npm run build`.
23
+
24
+ ## Common Traps
25
+
26
+ - Importing from a subpath — there is only one export entry; import from
27
+ `'dominus-sdk-nodejs'`.
28
+ - Treating `dist/` as source — it is generated; edit `src/`.
29
+ - Forgetting the version bump — publish-production no-ops if the version already
30
+ exists on npm.
31
+ - Using `dominus-production` as this repo's branch — it is `production` here.
32
+ - Pointing `browser` methods at worker-local `/runs/*` — use `/api/browser/*`
33
+ with `useGateway: true`.
34
+
35
+ ## Which Kyle Skill For Common Work
36
+
37
+ - Behavior change / bug fix → `kyle-fix` (test-first via `kyle-tdd`).
38
+ - Root-cause unknown → `kyle-diagnose`.
39
+ - Plan a larger change → `kyle-plan`.
40
+ - Review a diff → `kyle-review`.
41
+ - Contract-sensitive change (wire protocol, JWT, routing) → route to
42
+ `dominus-expert` before shipping.
43
+ - Docs/cleanup drift → `kyle-janitor` (this pack).
44
+
45
+ ## Handoff Expectations
46
+
47
+ This is a Dominus platform repo: cross-contract or wire-protocol changes need
48
+ `dominus-expert` review. Releases are npm publishes gated on a version bump.
@@ -1,11 +1,11 @@
1
- # Dominus SDK for Node.js — reading order
2
-
3
- Snapshot: 2026-08-04, production source commit `0e68c79`.
4
-
5
- 1. `README.md` for package usage, namespace coverage, and lifecycle guidance.
6
- 2. `package.json` for the single export entry and release scripts.
7
- 3. `src/index.ts` and namespace modules for the public surface.
8
- 4. `src/client.ts`/transport and typed error helpers for gateway behavior.
9
- 5. `tests/` plus `tsconfig.type-tests.json` for runtime and compile contracts.
10
- 6. `.github/workflows/publish-production.yml` for registry publication.
11
- 7. `docs/atlas/2026-08-04-sdk-nodejs-truthmap.md` and the pending-work summary.
1
+ # Dominus SDK for Node.js — reading order
2
+
3
+ Snapshot: 2026-08-04, production source commit `0e68c79`.
4
+
5
+ 1. `README.md` for package usage, namespace coverage, and lifecycle guidance.
6
+ 2. `package.json` for the single export entry and release scripts.
7
+ 3. `src/index.ts` and namespace modules for the public surface.
8
+ 4. `src/client.ts`/transport and typed error helpers for gateway behavior.
9
+ 5. `tests/` plus `tsconfig.type-tests.json` for runtime and compile contracts.
10
+ 6. `.github/workflows/publish-production.yml` for registry publication.
11
+ 7. `docs/atlas/2026-08-04-sdk-nodejs-truthmap.md` and the pending-work summary.
@@ -1,14 +1,14 @@
1
- # Purpose and boundaries
2
-
3
- The Node SDK is the typed ESM facade for Dominus gateway-first services. It
4
- packages namespace APIs for application auth, data/DDL, storage and Artifact
5
- V2, AI/runtime, browser automation, jobs, workflows, Authority, logs,
6
- platform/coder, Publisher, admin, and control-plane operations.
7
-
8
- The package owns client-side request shaping, gateway route transforms,
9
- service error decoding, and public type contracts. Server-side authorization,
10
- scope truth, lifecycle truth, and durable records remain owned by the relevant
11
- Dominus services.
12
-
13
- The supported package surface is the single root export. Internal source files
14
- are not stable subpath imports.
1
+ # Purpose and boundaries
2
+
3
+ The Node SDK is the typed ESM facade for Dominus gateway-first services. It
4
+ packages namespace APIs for application auth, data/DDL, storage and Artifact
5
+ V2, AI/runtime, browser automation, jobs, workflows, Authority, logs,
6
+ platform/coder, Publisher, admin, and control-plane operations.
7
+
8
+ The package owns client-side request shaping, gateway route transforms,
9
+ service error decoding, and public type contracts. Server-side authorization,
10
+ scope truth, lifecycle truth, and durable records remain owned by the relevant
11
+ Dominus services.
12
+
13
+ The supported package surface is the single root export. Internal source files
14
+ are not stable subpath imports.
@@ -1,16 +1,16 @@
1
- # API surface
2
-
3
- Import from the root package:
4
-
5
- ```ts
6
- import { dominus } from 'dominus-sdk-nodejs';
7
- ```
8
-
9
- The singleton exposes namespace groups including `auth`, `db`, `ddl`, `files`,
10
- `stash`, `ai`, `browser`, `jobs`, `workflow`, `authority`, `logs`, `platform`,
11
- `coder`, `publisher`, `admin`, and control-plane helpers. The exact exported
12
- types are generated by `npm run build` from `src/`.
13
-
14
- `workflow.ensure` is the preferred Authority-backed lifecycle entry. Use the
15
- Authority namespace for run timeline truth and the explicit archive/repair
16
- helpers for proof-first maintenance.
1
+ # API surface
2
+
3
+ Import from the root package:
4
+
5
+ ```ts
6
+ import { dominus } from 'dominus-sdk-nodejs';
7
+ ```
8
+
9
+ The singleton exposes namespace groups including `auth`, `db`, `ddl`, `files`,
10
+ `stash`, `ai`, `browser`, `jobs`, `workflow`, `authority`, `logs`, `platform`,
11
+ `coder`, `publisher`, `admin`, and control-plane helpers. The exact exported
12
+ types are generated by `npm run build` from `src/`.
13
+
14
+ `workflow.ensure` is the preferred Authority-backed lifecycle entry. Use the
15
+ Authority namespace for run timeline truth and the explicit archive/repair
16
+ helpers for proof-first maintenance.
@@ -1,14 +1,14 @@
1
- # Agent playbook
2
-
3
- Before changing an SDK method, trace its route transform, request body, typed
4
- error contract, and corresponding worker/service endpoint. Run:
5
-
6
- ```text
7
- npm run build
8
- npm run test:types
9
- npm test
10
- ```
11
-
12
- For a package release, update the version intentionally and verify the new
13
- version is not already published before pushing the `production` lane. A
14
- local SDK test pass does not prove server or registry state.
1
+ # Agent playbook
2
+
3
+ Before changing an SDK method, trace its route transform, request body, typed
4
+ error contract, and corresponding worker/service endpoint. Run:
5
+
6
+ ```text
7
+ npm run build
8
+ npm run test:types
9
+ npm test
10
+ ```
11
+
12
+ For a package release, update the version intentionally and verify the new
13
+ version is not already published before pushing the `production` lane. A
14
+ local SDK test pass does not prove server or registry state.
@@ -1,14 +1,14 @@
1
- # Agent Guide Index
2
-
3
- Last updated: 2026-08-04 local
4
- Current snapshot: `2026-08-04-sdk-nodejs/00-reading-order.md`
5
-
6
- ## Read Order
7
-
8
- 1. `2026-08-04-sdk-nodejs/00-reading-order.md`
9
- 2. `2026-08-04-sdk-nodejs/01-purpose-and-boundaries.md`
10
- 3. `2026-08-04-sdk-nodejs/03-api-surface.md`
11
- 4. `2026-08-04-sdk-nodejs/10-agent-playbook.md`
12
-
13
- The published package entry point and `src/` remain authoritative. Historical
14
- guide packs are retained for prior release context.
1
+ # Agent Guide Index
2
+
3
+ Last updated: 2026-08-04 local
4
+ Current snapshot: `2026-08-04-sdk-nodejs/00-reading-order.md`
5
+
6
+ ## Read Order
7
+
8
+ 1. `2026-08-04-sdk-nodejs/00-reading-order.md`
9
+ 2. `2026-08-04-sdk-nodejs/01-purpose-and-boundaries.md`
10
+ 3. `2026-08-04-sdk-nodejs/03-api-surface.md`
11
+ 4. `2026-08-04-sdk-nodejs/10-agent-playbook.md`
12
+
13
+ The published package entry point and `src/` remain authoritative. Historical
14
+ guide packs are retained for prior release context.
@@ -1,22 +1,22 @@
1
- # Current Agent-Guide Snapshot
2
-
3
- Latest snapshot: `2026-06-27-0849-sdk-orient/00-reading-order.md`
4
-
5
- Generated 2026-06-27 from SDK v6.6.0 (`package.json`) on branch `production`.
6
-
7
- ## Top Five Facts To Refresh Before Editing
8
-
9
- 1. **Version + changelog.** Confirm `package.json` `version` and the top of
10
- `CHANGELOG.md`; this pack was written at `6.6.0`.
11
- 2. **Namespace count.** `src/namespaces/` had 27 files, each wired as a
12
- `public readonly` property in `src/index.ts`. Re-count before claiming a
13
- surface is missing.
14
- 3. **Tests exist.** `tests/` has 24 test files run by `npm test`. The older
15
- claim in `docs/architecture.md` §10 / `CLAUDE.md` ("no committed tests") was
16
- stale and is corrected in this pass.
17
- 4. **Storage rule.** `dominus.stash.*` is the primary storage surface;
18
- `redis`/`db`/`files`/`artifacts` are building blocks (see
19
- `docs/architecture.md` §2a).
20
- 5. **Release lane.** Push to `production` triggers
21
- `.github/workflows/publish-production.yml` (npm publish). Do not commit/push
22
- from janitor work.
1
+ # Current Agent-Guide Snapshot
2
+
3
+ Latest snapshot: `2026-06-27-0849-sdk-orient/00-reading-order.md`
4
+
5
+ Generated 2026-06-27 from SDK v6.6.0 (`package.json`) on branch `production`.
6
+
7
+ ## Top Five Facts To Refresh Before Editing
8
+
9
+ 1. **Version + changelog.** Confirm `package.json` `version` and the top of
10
+ `CHANGELOG.md`; this pack was written at `6.6.0`.
11
+ 2. **Namespace count.** `src/namespaces/` had 27 files, each wired as a
12
+ `public readonly` property in `src/index.ts`. Re-count before claiming a
13
+ surface is missing.
14
+ 3. **Tests exist.** `tests/` has 24 test files run by `npm test`. The older
15
+ claim in `docs/architecture.md` §10 / `CLAUDE.md` ("no committed tests") was
16
+ stale and is corrected in this pass.
17
+ 4. **Storage rule.** `dominus.stash.*` is the primary storage surface;
18
+ `redis`/`db`/`files`/`artifacts` are building blocks (see
19
+ `docs/architecture.md` §2a).
20
+ 5. **Release lane.** Push to `production` triggers
21
+ `.github/workflows/publish-production.yml` (npm publish). Do not commit/push
22
+ from janitor work.