@@ -936,7 +936,7 @@ The namespaced daemon facade normalizes common collection results:
936936- ` sessions.getMessages() ` returns the message array directly.
937937- Collection methods such as ` customModels.list() ` , ` terminals.list() ` ,
938938 ` mcp.listRegistry() ` , ` mcp.listTools() ` , ` commands.list() ` , and the plugin,
939- marketplace, automation, and Software Factory list methods return arrays.
939+ marketplace, and automation list methods return arrays.
940940- Methods whose protocol result includes additional metadata retain the result
941941 object. This includes ` sessions.search() ` , ` mcp.listServers() ` , and
942942 ` skills.list() ` .
@@ -1095,22 +1095,44 @@ different Factory API host.
10951095| Resource | Functions |
10961096| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
10971097| Machine templates | ` listMachineTemplates ` , ` getMachineTemplate ` |
1098+ | Environments | ` listEnvironments ` |
10981099| Computers | ` listComputers ` , ` getComputer ` , ` getComputerByName ` , ` createComputer ` , ` updateComputer ` , ` deleteComputer ` , ` restartComputer ` , ` refreshComputer ` |
10991100| Computer operations | ` getComputerMetrics ` , ` retryInstallDeps ` |
1100- | Remote sessions | ` listRemoteSessions ` |
1101+ | Remote sessions | ` listRemoteSessions ` , ` listRemoteSessionElicitations ` , ` answerRemoteSessionElicitation ` |
1102+
1103+ The ` @factory/droid-sdk/api ` entry point exports a client generated from the
1104+ public Factory API spec, with one function per operation. Each operation takes
1105+ ` { client } ` from ` createFactoryClient() ` and resolves ` { data, error } ` ,
1106+ where ` error ` holds the body of an HTTP error response. A network failure, an
1107+ abort, or a response that cannot be parsed rejects the call instead, and
1108+ ` throwOnError: true ` makes HTTP errors reject too. Several names, such as
1109+ ` listComputers ` , exist on both entry points with different contracts, so a
1110+ file that imports both should alias the shared names.
1111+
1112+ ``` ts
1113+ import { createFactoryClient , listComputers } from ' @factory/droid-sdk/api' ;
1114+
1115+ const client = createFactoryClient ({ apiKey: process .env .FACTORY_API_KEY ! });
1116+ const { data, error } = await listComputers ({ client });
1117+ ```
1118+
1119+ See [ ` examples/node/rest-api.ts ` ] ( ../examples/node/rest-api.ts ) .
11011120
11021121### Unstable daemon resources
11031122
11041123APIs under ` droid.unstable ` may change between SDK releases.
11051124
1106- | Namespace | Main methods or resources |
1107- | ----------------- | ------------------------------------------------------------------------- |
1108- | ` crons ` | ` list ` , ` create ` , ` update ` , ` delete ` , ` holdSession ` , ` resumeSession ` |
1109- | ` missions ` | ` inspectReadiness ` , ` acknowledgeReadinessWarning ` |
1110- | ` semanticDiff ` | ` getCache ` , ` saveCache ` , ` generate ` |
1111- | ` fileTransfers ` | ` push ` , ` pull ` |
1112- | ` proxy ` | ` getToken ` |
1113- | ` softwareFactory ` | ` workstreams ` , ` signals ` , ` changes ` , ` activities ` , and ` events ` resources |
1125+ | Namespace | Main methods or resources |
1126+ | --------------- | ------------------------------------------------- |
1127+ | ` crons ` | ` list ` , ` create ` , ` update ` , ` delete ` |
1128+ | ` missions ` | ` inspectReadiness ` , ` acknowledgeReadinessWarning ` |
1129+ | ` workstreams ` | ` start ` , ` list ` , ` updateSettings ` |
1130+ | ` semanticDiff ` | ` getCache ` , ` saveCache ` , ` generate ` |
1131+ | ` fileTransfers ` | ` push ` , ` pull ` |
1132+ | ` proxy ` | ` getToken ` |
1133+
1134+ See [ ` examples/node/start-workstream.ts ` ] ( ../examples/node/start-workstream.ts )
1135+ for ` workstreams.start() ` .
11141136
11151137Keep unstable API use behind an application-owned adapter.
11161138
@@ -1317,15 +1339,15 @@ switch (result.subtype) {
13171339- Daemon replacement locking does not coordinate separate clients.
13181340- Browser daemon authentication currently requires an API key.
13191341- New-session spec handoff IDs require raw notification inspection.
1320- - REST remote-session support currently provides listing only.
13211342
13221343## Runnable examples
13231344
13241345The package includes runnable examples for one-shot runs, streaming, partial
13251346events, sessions, resume, model selection, permissions, AskUser, image and
13261347document attachments, structured output, SDK and external MCP tools, skills,
13271348hooks, observability, spec mode, replacement lifecycle, daemon sessions,
1328- concurrent browser sessions, daemon lifecycle operations, and missions.
1349+ concurrent browser sessions, daemon lifecycle operations, missions,
1350+ workstreams, and the Factory REST API.
13291351
13301352All examples are under:
13311353
@@ -1352,26 +1374,29 @@ Some examples need additional input:
13521374- ` document-input.ts ` : optionally pass a text or PDF path.
13531375- ` external-mcp.ts ` : set ` MCP_SERVER_URL ` and, if necessary, ` MCP_SERVER_TOKEN ` .
13541376- ` daemon-session.ts ` : start a daemon first. Set ` DROID_DAEMON_URL ` for a non-default address.
1377+ - ` start-workstream.ts ` : pass the workstream goal, and set ` DROID_DAEMON_URL ` for a running daemon whose account has access to workstreams.
1378+ - ` rest-api.ts ` : optionally pass the API base URL.
13551379
13561380Use compatible SDK and CLI versions. SDK 0.9.1 and earlier can reject newer
13571381protocol messages, including model providers and Script permission requests.
13581382Use SDK 0.10.0 or later with current CLI releases.
13591383A successful result without assistant text does not prove that streaming works.
13601384Do not remove permission checks to bypass a protocol mismatch.
13611385
1362- | Topic | Node examples |
1363- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
1364- | Runs and results | ` run.ts ` , ` result-metadata.ts ` |
1365- | Sessions | ` multi-turn-session.ts ` , ` resume-session.ts ` , ` list-sessions.ts ` , ` rename-session.ts ` , ` init-metadata.ts ` , ` session-settings.ts ` |
1366- | Streaming and cancellation | ` session-stream.ts ` , ` partial-stream.ts ` , ` abort-session-stream.ts ` , ` interrupt-session.ts ` |
1367- | Models | ` model-discovery.ts ` , ` model-selection.ts ` |
1368- | Inputs and outputs | ` image-attachment.ts ` , ` document-input.ts ` , ` structured-output.ts ` |
1369- | Permissions and user input | ` permission-handler.ts ` , ` ask-user-elicitation.ts ` , ` tool-controls.ts ` |
1370- | Extensions | ` sdk-mcp-tool.ts ` , ` external-mcp.ts ` , ` skills.ts ` , ` hook-execution.ts ` |
1371- | Session lifecycle | ` fork-session.ts ` , ` compact-session.ts ` , ` rewind-session.ts ` |
1372- | Spec mode | ` enter-spec-mode.ts ` , ` spec-mode-same-session.ts ` , ` spec-mode-new-session.ts ` |
1373- | Daemon and missions | ` daemon-session.ts ` , ` mission.ts ` |
1374- | Observability | ` observability.ts ` |
1386+ | Topic | Node examples |
1387+ | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
1388+ | Runs and results | ` run.ts ` , ` result-metadata.ts ` |
1389+ | Sessions | ` multi-turn-session.ts ` , ` resume-session.ts ` , ` list-sessions.ts ` , ` rename-session.ts ` , ` init-metadata.ts ` , ` session-settings.ts ` |
1390+ | Streaming and cancellation | ` session-stream.ts ` , ` partial-stream.ts ` , ` abort-session-stream.ts ` , ` interrupt-session.ts ` |
1391+ | Models | ` model-discovery.ts ` , ` model-selection.ts ` |
1392+ | Inputs and outputs | ` image-attachment.ts ` , ` document-input.ts ` , ` structured-output.ts ` |
1393+ | Permissions and user input | ` permission-handler.ts ` , ` ask-user-elicitation.ts ` , ` tool-controls.ts ` |
1394+ | Extensions | ` sdk-mcp-tool.ts ` , ` external-mcp.ts ` , ` skills.ts ` , ` hook-execution.ts ` |
1395+ | Session lifecycle | ` fork-session.ts ` , ` compact-session.ts ` , ` rewind-session.ts ` |
1396+ | Spec mode | ` enter-spec-mode.ts ` , ` spec-mode-same-session.ts ` , ` spec-mode-new-session.ts ` |
1397+ | Daemon, missions, and workstreams | ` daemon-session.ts ` , ` mission.ts ` , ` start-workstream.ts ` |
1398+ | Factory REST API | ` rest-api.ts ` |
1399+ | Observability | ` observability.ts ` |
13751400
13761401Start a mission in a test project and print orchestrator and worker progress.
13771402` interactionMode: DroidInteractionMode.Mission ` alone does not give the session
0 commit comments