Skip to content

docs(khal-os): SDK hooks + services — 6 pages#4

Merged
namastex888 merged 1 commit into
devfrom
docs-khal-sdk-20260417
Apr 17, 2026
Merged

docs(khal-os): SDK hooks + services — 6 pages#4
namastex888 merged 1 commit into
devfrom
docs-khal-sdk-20260417

Conversation

@namastex888

Copy link
Copy Markdown
Contributor

Summary

Adds 6 MDX pages for the FDE-facing SDK surface, plus navigation wiring in docs.json.

SDK hookssdk/

  • hooks-reference.mdx — landing + index table linking each hook
  • useNats.mdx — pub / sub / request-reply over the platform NATS bridge, with subject-naming guidance and the required <Warning> against subscribing to khal.internal.* / khal.catalog.*
  • useKhalAuth.mdx — current user, org, role, and signOut; explicit about what is not exposed (JWT, session, refresh) per kernel guardrails
  • useService.mdx — transport-agnostic client (appId) for your own pack backend, with request / publish / subscribe / ports

Pack servicesservices/

  • backend-overview.mdx — what a pack service is, directory shape, lifecycle (platform-managed), transport (NATS-first)
  • environment-config.mdxkhal-app.json env[] declaration, type: 'secret' vs 'string', runtime injection, frontend-never-reads-secrets

Source-of-truth verification

All hook signatures were read from app-kit/packages/os-sdk/src/app/hooks.ts before writing. Examples cite pack-terminal (full-stack reference) and pack-settings (frontend-only).

Kernel guardrails

  • No `core/`, `platform/`, `brain/`, or `deploy/` source citations.
  • Contracts exposed, mechanisms hidden.
  • NATS surface only — no cluster topology, no JetStream, no `khal.catalog.*`.
  • JWT / session / WorkOS integration explicitly out-of-scope.
  • Pack-authoring ≠ pack-deployment boundary respected.

Test plan

  • `mint dev` — pages render without MDX errors
  • `mint broken-links` — all internal links resolve
  • Navigation shows SDK + Services groups under guides tab
  • Spot-check hook signatures against `os-sdk/src/app/hooks.ts`
  • Review examples compile / run against pack-terminal reference

Wish: `.genie/wishes/docs-khal-sdk/WISH.md`

Authored 6 MDX pages for the FDE-facing SDK surface:

sdk/
  - hooks-reference.mdx (index page linking the three hooks)
  - useNats.mdx (pub/sub/request over the platform NATS bridge)
  - useKhalAuth.mdx (current user + org + role)
  - useService.mdx (transport-agnostic client for your own backend)

services/
  - backend-overview.mdx (what a pack service is, shape, lifecycle)
  - environment-config.mdx (khal-app.json env[] declaration + runtime injection)

All hook signatures verified against
app-kit/packages/os-sdk/src/app/hooks.ts. Examples cite pack-terminal
(full-stack reference) and pack-settings (frontend-only useKhalAuth).

docs.json navigation updated with SDK and Services groups under the
existing guides tab.

Kernel guardrails respected: no core/platform/brain/deploy source
citations; contracts-over-mechanisms; NATS surface only (no cluster,
JetStream, or khal.catalog.* internals); JWT/WorkOS explicitly
out-of-scope.

Wish: .genie/wishes/docs-khal-sdk/WISH.md
@namastex888 namastex888 changed the base branch from main to dev April 17, 2026 05:22
@namastex888 namastex888 merged commit 966de05 into dev Apr 17, 2026
2 checks passed
@namastex888 namastex888 deleted the docs-khal-sdk-20260417 branch April 17, 2026 05:28
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.

2 participants