Skip to content

docs: update examples for SDK 0.11.0 - #83

Merged
factory-ain3sh merged 2 commits into
mainfrom
ain3sh/sdk-0-11-examples
Nov 13, 2026
Merged

factory-ain3sh merged 2 commits into
mainfrom
ain3sh/sdk-0-11-examples

Conversation

@factory-ain3sh

@factory-ain3sh factory-ain3sh commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

What: Moves the examples and guides to @factory/droid-sdk 0.11.0. Two new examples cover what 0.11.0 adds: examples/node/rest-api.ts lists Computers and remote sessions with the generated REST client in @factory/droid-sdk/api, and examples/node/start-workstream.ts starts a workstream on a running daemon and leaves it running. The reference drops what 0.11.0 removed (unstable.softwareFactory, crons.holdSession() and crons.resumeSession()), and MIGRATION.md gains a 0.10.0 to 0.11.0 section.

Why: 0.11.0 is on npm, and this repository still pins 0.10.0. The TypeScript SDK page on docs.factory.ai (Factory-AI/factory-public-web#981) links both new examples at blob/main/examples/node/, so they have to be on main before that page publishes.

How: Each example is one short file, and scripts/run-examples.mjs checks what it printed. rest-api runs by default. start-workstream is opt-in (--include start-workstream), like mission, because it starts a real workstream on a daemon.

Architecture

Two new examples (rest-api.ts, start-workstream.ts) with harness checks, the 0.11.0 pin, and the reference and migration guide updated for what 0.11.0 adds and removes

Reviewer Guide

File Check
examples/node/rest-api.ts It uses only createFactoryClient, listComputers and listSessions from @factory/droid-sdk/api, and checks error on each result
examples/node/start-workstream.ts It sends the goal with stream() and ends with detach(), not close(), so the workstream keeps running. Its optional DROID_WORKSTREAM_COMPUTER_ID carries the DROID_ prefix, so the harness removes it from isolated runs
scripts/run-examples.mjs The checks for both examples, and optIn on start-workstream
docs/typescript-sdk-reference.md, MIGRATION.md Each removal and addition matches 0.11.0's exports, and the REST section says which failures reject instead of returning error
package.json, package-lock.json The 0.11.0 pin and the regenerated lockfile

Risk & Impact

Docs and examples only; nothing this repository publishes changes. From this PR on, the scheduled live examples job also runs rest-api, which reads Computers and sessions and writes nothing.

Verification

  • At 154d2e4: npm test (14 harness tests), npm run typecheck, npm run lint, prettier --check on every tracked path, and npm run check:docs (57 code blocks in the docs) pass against 0.11.0.
  • The harness's childEnv() drops DROID_WORKSTREAM_COMPUTER_ID and keeps an unprefixed name, so the renamed variable cannot reach an isolated run.
  • rest-api.ts ran against the hosted dev API with 0.11.0 from npm: exit 0, and it printed Computers (38): and Recent sessions (5):, the two lines its harness checks look for.
  • start-workstream.ts did not run live here, because it starts a real workstream on a daemon. npm run test:examples -- --include start-workstream runs it.

factory-ain3sh and others added 2 commits November 13, 2026 00:54
Add the workstream and REST API examples that ship in the 0.11.0 package,
document the removed Software Factory resource and held cron sessions, and
list the new workstreams, environments and elicitation APIs.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
- start-workstream.ts reads DROID_WORKSTREAM_COMPUTER_ID, so the example
  harness's DROID_ scrub keeps a developer's Computer out of isolated runs.
- The reference says generated REST operations put only HTTP error bodies
  in `error`; network, abort and parse failures reject, and throwOnError
  makes HTTP errors reject too.
- Drop the reference's Software Factory list methods and its
  "REST remote-session support provides listing only" limitation, both
  false for 0.11.0.
- rest-api.ts says session listing needs the feature on the key's
  organization.
- The reference's example index, inputs list and unstable resources
  section name start-workstream.ts and rest-api.ts.
- package-lock.json root version fields read 0.11.0.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@factory-ain3sh
factory-ain3sh merged commit a410305 into main Nov 13, 2026
3 checks passed
@factory-ain3sh
factory-ain3sh deleted the ain3sh/sdk-0-11-examples branch November 13, 2026 07:29
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