Repository navigation
docs: update examples for SDK 0.11.0 - #83
Merged
Merged
Conversation
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>
varin-nair-factory
approved these changes
Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
What: Moves the examples and guides to
@factory/droid-sdk0.11.0. Two new examples cover what 0.11.0 adds:examples/node/rest-api.tslists Computers and remote sessions with the generated REST client in@factory/droid-sdk/api, andexamples/node/start-workstream.tsstarts a workstream on a running daemon and leaves it running. The reference drops what 0.11.0 removed (unstable.softwareFactory,crons.holdSession()andcrons.resumeSession()), andMIGRATION.mdgains 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 onmainbefore that page publishes.How: Each example is one short file, and
scripts/run-examples.mjschecks what it printed.rest-apiruns by default.start-workstreamis opt-in (--include start-workstream), likemission, because it starts a real workstream on a daemon.Architecture
Reviewer Guide
examples/node/rest-api.tscreateFactoryClient,listComputersandlistSessionsfrom@factory/droid-sdk/api, and checkserroron each resultexamples/node/start-workstream.tsstream()and ends withdetach(), notclose(), so the workstream keeps running. Its optionalDROID_WORKSTREAM_COMPUTER_IDcarries theDROID_prefix, so the harness removes it from isolated runsscripts/run-examples.mjsoptInonstart-workstreamdocs/typescript-sdk-reference.md,MIGRATION.mderrorpackage.json,package-lock.jsonRisk & 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
154d2e4:npm test(14 harness tests),npm run typecheck,npm run lint,prettier --checkon every tracked path, andnpm run check:docs(57 code blocks in the docs) pass against 0.11.0.childEnv()dropsDROID_WORKSTREAM_COMPUTER_IDand keeps an unprefixed name, so the renamed variable cannot reach an isolated run.rest-api.tsran against the hosted dev API with 0.11.0 from npm: exit 0, and it printedComputers (38):andRecent sessions (5):, the two lines its harness checks look for.start-workstream.tsdid not run live here, because it starts a real workstream on a daemon.npm run test:examples -- --include start-workstreamruns it.