Skip to content

docs/ examples drifted from shipped src API — copy-paste examples fail #25

Description

@pratikbin

The hand-written guides under docs/ use APIs that don't match the shipped SDK (src/), so copy-paste examples fail. Surfaced while porting these docs to the public site (NodeOps-app/website-04 PR #194); the website copies were corrected against src/ — the same fixes are needed upstream here.

  • Unpublished package name (62 refs, e.g. docs/quickstart.md): install/imports use createos-sandbox-sdk. The published name is @nodeops-createos/sandbox (package.json), so bun add createos-sandbox-sdk / the imports fail.
  • runCommand: docs/how-to/error-handling.md:49,224 runCommand("echo hello"), :123 runCommand("ls /"), docs/reference/client.md:185 runCommand(["bash","-c",...]). Signature is runCommand(cmd, args[]) and returns ExecResponse { result, exec_ms } — read out.result.stdout (src/sandbox.ts:265, src/types.ts:406).
  • client.sandboxes.*: docs/how-to/files.md:28,76, docs/reference/helpers.md:43. No sandboxes sub-API — use client.createSandbox(...) / client.getSandbox(...) (src/client.ts:593,640).
  • template / templateId: docs/how-to/streaming.md:30,81,122, docs/how-to/error-handling.md:47,121,222,251, docs/reference/errors.md:217. The create field is rootfs (src/types.ts:202).
  • Types reference (docs/reference/types.md): :169 replacementsuccessor; RootfsData omits required rootfs: string[] + default: string; :382 ssh_pubkeyskeys (AddSSHPubkeysRequest); :478 ExecRequest lists timeout_ms (+envs) it doesn't expose (real: cmd/args/stream); ExecResponse omits exec_ms; :820 ReadyzResponse.messagereason (+ scheduler_last_ok_ms_ago).

Root cause: docs/ is hand-maintained and drifts from src/. Consider generating the types reference from src/types.ts or adding a docs typecheck.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions