@owlmeans/viable-sdk 0.1.18-rc.3 → 0.1.18-rc.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +2 -28
  2. package/agent-meta/manifest.json +16 -0
  3. package/agent-meta/skills/viable-sdk/SKILL.md +535 -0
  4. package/build/api/remote.d.ts +7 -3
  5. package/build/api/remote.d.ts.map +1 -1
  6. package/build/api/remote.js +18 -29
  7. package/build/api/remote.js.map +1 -1
  8. package/build/consts.d.ts +22 -9
  9. package/build/consts.d.ts.map +1 -1
  10. package/build/consts.js +26 -9
  11. package/build/consts.js.map +1 -1
  12. package/build/context/index.d.ts +10 -1
  13. package/build/context/index.d.ts.map +1 -1
  14. package/build/context/index.js +70 -24
  15. package/build/context/index.js.map +1 -1
  16. package/build/executor/shell.d.ts.map +1 -1
  17. package/build/executor/shell.js +17 -5
  18. package/build/executor/shell.js.map +1 -1
  19. package/build/harness/templates.d.ts +2 -2
  20. package/build/harness/templates.d.ts.map +1 -1
  21. package/build/harness/templates.js +39 -20
  22. package/build/harness/templates.js.map +1 -1
  23. package/build/project/setup.d.ts +1 -1
  24. package/build/task/envelope.d.ts.map +1 -1
  25. package/build/task/envelope.js +5 -1
  26. package/build/task/envelope.js.map +1 -1
  27. package/build/tools/catalogue.d.ts +2 -2
  28. package/build/tools/catalogue.d.ts.map +1 -1
  29. package/build/tools/catalogue.js +227 -161
  30. package/build/tools/catalogue.js.map +1 -1
  31. package/build/tools/index.d.ts +3 -1
  32. package/build/tools/index.d.ts.map +1 -1
  33. package/build/tools/index.js +3 -1
  34. package/build/tools/index.js.map +1 -1
  35. package/build/tools/mcp.d.ts +2 -10
  36. package/build/tools/mcp.d.ts.map +1 -1
  37. package/build/tools/mcp.js +51 -35
  38. package/build/tools/mcp.js.map +1 -1
  39. package/build/tools/platform.d.ts +27 -8
  40. package/build/tools/platform.d.ts.map +1 -1
  41. package/build/tools/platform.js +125 -43
  42. package/build/tools/platform.js.map +1 -1
  43. package/build/tools/refusal.d.ts +8 -2
  44. package/build/tools/refusal.d.ts.map +1 -1
  45. package/build/tools/refusal.js +150 -5
  46. package/build/tools/refusal.js.map +1 -1
  47. package/build/tools/settings.d.ts +45 -0
  48. package/build/tools/settings.d.ts.map +1 -0
  49. package/build/tools/settings.js +86 -0
  50. package/build/tools/settings.js.map +1 -0
  51. package/build/tools/status.d.ts +17 -0
  52. package/build/tools/status.d.ts.map +1 -0
  53. package/build/tools/status.js +104 -0
  54. package/build/tools/status.js.map +1 -0
  55. package/build/tools/stories.d.ts +57 -0
  56. package/build/tools/stories.d.ts.map +1 -0
  57. package/build/tools/stories.js +102 -0
  58. package/build/tools/stories.js.map +1 -0
  59. package/build/tools/types.d.ts +8 -0
  60. package/build/tools/types.d.ts.map +1 -1
  61. package/build/tools/types.js.map +1 -1
  62. package/build/types.d.ts +43 -30
  63. package/build/types.d.ts.map +1 -1
  64. package/package.json +20 -17
  65. package/build/tools/jobs.d.ts +0 -12
  66. package/build/tools/jobs.d.ts.map +0 -1
  67. package/build/tools/jobs.js +0 -60
  68. package/build/tools/jobs.js.map +0 -1
package/README.md CHANGED
@@ -12,9 +12,7 @@ needs and the platform cannot supply:
12
12
  both over HTTP and in-process;
13
13
  - **a session runtime** that answers the operations the platform sends: file writes, shell
14
14
  commands and git against a project on the user's own machine;
15
- - **the tool catalogue and the model-task protocol** a parent agent reads — including the
16
- questions the platform puts to a person, and the tools for converting an application that
17
- already exists.
15
+ - **the tool catalogue and the model-task protocol** a parent agent reads.
18
16
 
19
17
  ## The two axes
20
18
 
@@ -74,35 +72,11 @@ throughput problem, it is a corrupted tree.
74
72
  outstanding, including what it had already answered when the connection dropped. Re-running a build
75
73
  because an acknowledgement was lost is exactly the cost that cache avoids.
76
74
 
77
- **A question is the user's, and the connector answers none of it.** An inquiry arrives on the
78
- same operation loop as everything else and is executed by nobody: `next_question` hands it to the
79
- parent to put to a person, and `answer_question` sends the answer back. The two queues stay
80
- separate from the task queue, because draining one list would sooner or later hand a decision
81
- about somebody's project to a subagent. Declining is an answer — a parent whose user is away says
82
- so rather than waiting out the deadline or inventing one.
83
-
84
- **A model task is handed over once.** The platform redelivers every unanswered operation on each
85
- poll, which is free for a slot command the result cache answers and expensive for a task a
86
- subagent is already working on. The shared queue remembers every id it has handed over and ignores
87
- a second delivery of one, while still refreshing the operation the answer must route to.
88
-
89
75
  **A malformed model-task answer is refused locally.** `parseTaskResult` checks the answer against
90
76
  the task before the platform ever sees it — with the subagent's context still open, so the parent
91
77
  can retry immediately. A malformed answer that reached the platform would cost a whole new task, a
92
78
  new subagent and another wait.
93
79
 
94
- **A refusal is phrased from its marker.** The platform's refusal classes live in packages this one
95
- does not depend on, so an error crossing the wire arrives as a marshalled `type|||marker|||stack`
96
- wrapped in a local stack trace. `REFUSALS` maps the marker to one sentence a parent agent can act
97
- on; an unknown marker keeps the marker and names the tool to call next, and no stack ever reaches
98
- the model — including the one shape with no separator in it, where `ResilientError.ensure` swaps a
99
- plain-text response body into `type` and its stack into `message`.
100
-
101
- **A refusal reads the same wherever it is rendered.** The same marker arrives thrown from a call
102
- and stored as text — `job.error`, `slot.lastError`, a conversion's `lastError`, a pipeline row's
103
- `error` — so every one of those goes through `refusalPhrase` too. Anything that is not a refusal,
104
- a build warning above all, is rendered exactly as it stands.
105
-
106
80
  **The harness installer never writes the token.** Each configuration references the environment
107
81
  variable in its own syntax, so what it writes is safe to commit. `tests/harness.spec.ts` greps
108
82
  every written file for a token shape.
@@ -119,7 +93,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
119
93
  your project's skill store (`.agents/skills/`):
120
94
 
121
95
  ```sh
122
- npx @owlmeans/agent-skills@^0.1.18-rc.14
96
+ npx @owlmeans/agent-skills@^0.1.18-rc.38
123
97
  ```
124
98
 
125
99
  The embedded files are version-matched to this package release. Do not edit them
@@ -0,0 +1,16 @@
1
+ {
2
+ "schemaVersion": 2,
3
+ "package": "@owlmeans/viable-sdk",
4
+ "version": "0.1.18-rc.31",
5
+ "generatedAt": "2026-09-23T19:57:40.666Z",
6
+ "canonicalRepo": "https://github.com/owlmeans/common",
7
+ "entries": [
8
+ {
9
+ "kind": "skill",
10
+ "name": "viable-sdk",
11
+ "category": "package-specific",
12
+ "file": "skills/viable-sdk/SKILL.md",
13
+ "canonicalPath": ".agents/skills/viable-sdk/SKILL.md"
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,535 @@
1
+ ---
2
+ name: viable-sdk
3
+ description: How to use @owlmeans/viable-sdk — the connector SDK an external coding agent drives the OwlMeans Viable platform with — the token-authenticated client context, the two host kinds and their tool catalogue, the session operation loop, the local slot executor and local run, the model-task envelope, and the harness installer. Auto-invoked when building or changing a connector, an MCP host, a connector tool, the task envelope, or anything that executes platform slot commands on a developer's machine.
4
+ user-invocable: false
5
+ ---
6
+ <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
7
+
8
+ # @owlmeans/viable-sdk
9
+
10
+ **Layer:** Tooling (Node/Bun; not a browser or React package)
11
+ **Install:** `"@owlmeans/viable-sdk": "^0.1.18-rc.31"` in `dependencies`
12
+ **Subpaths:** `.` · `./executor` · `./run` · `./tools` · `./task` · `./harness`
13
+ **Contracts:** `@owlmeans/viable-common` (`./connect`, `./slot`, `./integrity`, and the planning
14
+ vocabulary — story type and story flow) and `@owlmeans/planning` (the planning protocol tree
15
+ and facade) — every name on the wire is declared there, so the SDK and the platform cannot spell one
16
+ differently.
17
+
18
+ Everything a coding agent needs in order to drive the platform: authenticate with one access token,
19
+ attach a session to a project, execute the platform's slot commands against a directory on this
20
+ machine, deliver its model calls to the parent agent, and run the generated application locally.
21
+ `@owlmeans/viable-mcp` is one host built on it.
22
+
23
+ ## Key Exports
24
+
25
+ | Export | Description |
26
+ |--------|-------------|
27
+ | `makeSdkContext({ apiUrl, token, service?, onRejected? })` | A client context authenticated by one token — a literal or a thunk — with the connector protocols and the planning tree bound and the planning client registered |
28
+ | `makeRemoteConnectorApi(context)` | `ConnectorApi` over HTTP; its `planning` is the context's planning client facade |
29
+ | `openSession(opts)` → `SessionRuntime` | One attached session: the operation loop, the task queue, `stats` |
30
+ | `renderTaskEnvelope(task, { harness })` · `parseTaskResult(task, raw)` | What the parent agent is told; what its answer is checked against |
31
+ | `makeModelTaskDriver({ models })` · `TaskDriver` | A reference parent agent backed by a chat model (tests, CLIs) |
32
+ | `installHarness(dir, harness, opts?)` · `describeHarness(harness)` · `WORKING_RULE` | Set a coding agent up; preview it first |
33
+ | `catalogue` · `visibleTools(host)` · `toolByName` · `registerCatalogue(server, deps)` · `serverInstructions({ host })` | The tools and how they reach an MCP server |
34
+ | `renderProjectStatus`, `renderStoryStatus(status, { landing? })`, `renderPipelineStatus`, `conversionNext` | Domain status as concise lines ending in the next valid action |
35
+ | `resolveStory(deps, projectId, ref)` · `storyQuery(projectId, filter?)` · `renderStories(items, page, total)` · `STORY_ORDER` · `isLandingStory(card)` · `LANDING_MARK` · `LANDING_NOTE` | The story tools' reading of planning cards |
36
+ | `PROJECT_SETTINGS` · `projectSettingOf(key)` · `settingsPatch(args)` · `renderProjectSettings(projectId, settings)` · `settingsReach(target)` | The project-settings tools: each setting's label and rule, the patch a call asks for, the rendering |
37
+ | `PLATFORM_CATALOGUE` (`pipelines`, `features`, `capabilities`) · `renderPlatform(catalogue, host)` · `GENERATED_SUMMARY` | What `describe_platform` renders, and the one-sentence product summary `describe_capabilities` ends with |
38
+ | `ToolHostKind` (`Stdio`/`Http`) · `ToolHost` · `ToolDeps` · `anyHost`/`localTarget`/`cloudTarget`/`withExecutor`/`delegatedLlm`/`sessionCapable`/`performsModelTasks` | The host description and the availability predicates |
39
+ | `./executor`: `makeLocalSlotExecutor(dir, opts?)`, `createLocalFileHelper`, `createLocalShellHelper`, `dispatchGitCommand`, `verifyTarget`/`forgetIntegrity`, `targetPaths`/`apiPath`/`webPath`/`workerPath`, `backendEnv`/`frontendEnv`, `classifyTargetHealth`/`readTargetHealth`, `runBootCheck`, `confineToProject`, the spawn helpers | The publisher's workload, on somebody's laptop |
40
+ | `./run`: `runLocal`, `stopLocal`, `localStatus`, `createLocalServer`, `startApi`/`startWorker`/`restartApi`/`stopProcess`, `readRun`/`writeRun`/`clearRun` | Building and running the generated app locally |
41
+ | `readMarker`/`writeMarker`/`discoverProject`/`isViableTree` · `readEnv`/`writeEnv`/`envStatus`/`replaceManagedBlock` | The `.viable/connect.json` marker and the managed `.env` block |
42
+ | `SdkError`, `SdkAuthError`, `SdkMisconfigured`, `SdkUnsupported` | Registered `ResilientError` classes |
43
+ | `ENV_TOKEN`, `ENV_API_URL`, `ENV_MCP_URL`, `ENV_TARGET`, `ENV_LLM`, `ENV_HARNESS`, `ENV_PROJECT_DIR` · `DEFAULT_MCP_URL` · `resolveMcpUrl(values)` · `TOOL_DEADLINE_MS` (45 s) · `COMMIT_WAIT_MS` (20 s) · `COMMIT_POLL_SEC` · `STORY_PAGE_SIZE` · `NEXT_TASK_WAIT_MS` · `PULL_WAIT_MS` | Configuration and deadlines |
44
+
45
+ ## One credential, and the routes the server declares
46
+
47
+ `makeSdkContext` registers `makeTokenCarrierGuard` under `DEFAULT_GUARD` and binds the SAME
48
+ immutable `connectProtocols(...)` tree the server mounts, so a path or a schema cannot be right on
49
+ one end and wrong on the other. The planning tree is bound the same way:
50
+ `makePlanningProtocols({ base: { alias: 'viable:manager-api:planning', path: '/planning' }, guards:
51
+ DEFAULT_GUARD, socketBase: <the /update base> })` — manager-api's mount minus its ownership gate, which
52
+ is the server's to apply — followed by `appendPlanningClient(context, { protocols, bind: false, poll:
53
+ COMMIT_POLL_SEC, timeout: TOOL_DEADLINE_MS, schemas: false })`. The base alias and path are literals
54
+ beside the `/update` base for the same reason that one is: they belong to manager-api, and every
55
+ planning alias and path derives from them. No socket opener is passed, so a commit is awaited by long
56
+ poll only, and the schema bundle is not fetched at startup — nothing a tool does reads a flow, and a
57
+ server nobody has asked anything yet makes no call. There is deliberately **no second credential path**: a connector that could
58
+ fall back to another form of authentication is a connector whose access nobody can revoke by
59
+ revoking a token. A literal token that is empty or lacks `CONNECT_TOKEN_PREFIX` is refused locally
60
+ (`SdkMisconfigured` / `SdkAuthError`), because a 401 says nothing about which of several plausible
61
+ mistakes was made and the answer is always the same one.
62
+
63
+ **`token` may be a thunk** (`() => string | Promise<string>`), resolved on every request — what a
64
+ credential holder (`@owlmeans/cli-auth`) hands over, since it is `''` until a browser sign-in
65
+ completes and a real token after, with no reconfiguration. Only a literal is validated eagerly; a
66
+ thunk's value is unknown at construction, and an empty one is simply "not signed in". `onRejected`
67
+ is passed to the carrier guard and fires when the platform 401s the presented token, which is where
68
+ the holder forgets a dead file token (or reports a dead environment one) — see [[auth-token]].
69
+
70
+ **The `/mcp` URL is a value the SDK resolves, never one it derives:** `resolveMcpUrl(values)` returns
71
+ `values[ENV_MCP_URL]` (`VIABLE_MCP_URL`, empty = unset) else `DEFAULT_MCP_URL`
72
+ (`https://api.owlmeans.com/mcp`), trailing slash dropped so a resource URI has one spelling. The
73
+ caller passes the already merged environment + `~/.owlmeans` values (environment wins). A deployment's
74
+ own resource identifier stays host-derived on the server.
75
+
76
+ **The context must also declare the platform's `/update` base itself.** The connector's socket route
77
+ and the planning commit feed hang under that namespace, and a parent an entrypoint registry cannot resolve fails the **whole
78
+ context at init** rather than the one call that would have used it — a server that exited at startup
79
+ with `Entrypoint viable:manager-api:update:base not found`. It is declared with the path the
80
+ platform declares and never binds: it is a namespace, and nothing calls it.
81
+
82
+ **`cfg.webService` names the API CLIENT, never the backend.** It is the alias the entrypoint handler
83
+ looks up with `context.service(...)`, and the only thing registered under it is the `ApiClient` that
84
+ `makeClientContext` appends (`web-client`). Naming the backend service there — which is exactly what
85
+ `addWebService` does — makes every call fail with `Service <backend> not found` before a request is
86
+ sent. The backend belongs in `cfg.services` as an ordinary descriptor marked `default: true`; the
87
+ connect routes name no service of their own, so that is the one they resolve to.
88
+
89
+ **A POST with nothing to say still sends `{}`.** The client sets no `Content-Type` for an absent
90
+ body, and Fastify answers **415 Unsupported Media Type** before the handler runs — an error about
91
+ media types for a call whose only fault was having no arguments. `makeRemoteConnectorApi` fills an
92
+ empty body for any POST route that was given none; `session.close` and `session.heartbeat` are
93
+ exactly that shape.
94
+
95
+ ## Two hosts, one interface
96
+
97
+ `ConnectorApi` is an interface because two implementations must stay interchangeable — one calling
98
+ the API over HTTP (`makeRemoteConnectorApi`, the npx server) and one calling the manager's own
99
+ handlers in process (`makeInProcessConnectorApi` in `viable-manager-api`, behind `POST /mcp`). Every
100
+ tool is written against it, so a tool cannot accidentally work in only one of the two. Which route
101
+ `openSession` calls fixes the mode: the delegated route carries the entitlement gate, so a caller
102
+ without the capability is refused at the boundary rather than by a check somewhere inside.
103
+
104
+ ## A SESSION belongs to a host that stays; `sessionCapable` is what says so
105
+
106
+ A session is a connector ATTACHED — a process that drains the project's operations and holds a model
107
+ task until its answer comes back. The URL-configured host answers one request and forgets, so
108
+ opening one there would claim the project's single connector slot, **supersede the stdio connector
109
+ legitimately holding it**, and be abandoned before the first operation was delivered.
110
+
111
+ So `ensureSession` — what `confirm_project`, `reinitialize_project`, `develop_story`,
112
+ `modify_project` and `resume_pipeline` call before returning their job — opens one only on a
113
+ `sessionCapable` host, and `next_task`/`submit_task_result` are available on `performsModelTasks`
114
+ (delegated **and** session-capable) rather than on the account setting alone. `serverInstructions`
115
+ reads the same predicate: a parent told to call `next_task` when the tool is not in its list is a
116
+ parent that waits for a run nobody will advance. A host that cannot serve the delegated mode says so
117
+ in one sentence instead, naming the stdio connector.
118
+
119
+ The in-process implementation refuses the five session verbs (`openSession`, `closeSession`,
120
+ `heartbeat`, `pullOps`, `submitOp`) with a message naming `@owlmeans/viable-mcp`, because
121
+ "unsupported" alone leaves the reader with nothing to do about it.
122
+
123
+ ## A tool that cannot work in a mode is HIDDEN, not failing
124
+
125
+ `ToolDefinition.availability` and `visibleTools(host)` decide the catalogue a parent actually sees. A
126
+ tool a host cannot serve is a tool the parent tries once, is refused, and remembers as broken — so
127
+ the list it reads is exactly the set of things that work for it. Predicates: `anyHost`,
128
+ `localTarget`, `cloudTarget`, `withExecutor`, `delegatedLlm`.
129
+
130
+ ## 45 seconds is the ceiling, so long operations return domain status
131
+
132
+ Every MCP host bounds a tool call and the strictest default in the field is sixty seconds (Codex).
133
+ `TOOL_DEADLINE_MS` leaves room for the round trip and keeps the connector inside every host's
134
+ ceiling without configuration. A tool that outlives its host's ceiling is reported to the user as a
135
+ **broken server**, and the true answer — the platform was slow — never reaches them.
136
+
137
+ Anything that takes minutes returns the owning domain's status and continues server-side.
138
+ `project_status`, `story_status`, `conversion_status` and `pipeline_status` compose the durable
139
+ records and run state a parent needs. `registerCatalogue` enforces the deadline per call and
140
+ converts a throw into an `isError` result the model can read and act on, because an exception
141
+ crossing the transport tells it only that something went wrong somewhere. Each status renderer
142
+ ends with a single `next:` line so the parent follows the domain workflow and does not invent a
143
+ polling strategy or treat a parked run as failed.
144
+
145
+ ## The story tools speak planning
146
+
147
+ A user story is a planning CARD of `VIABLE_STORY_TYPE` under its project card, and every change to one
148
+ is a transition executed through `ConnectorApi.planning` — a `PlanningFacade`: the client facade
149
+ `appendPlanningClient` registers over HTTP, and `ensurePlanningService(ctx).for(scope)` in the
150
+ platform's in-process host. The scope a call answers for is the CREDENTIAL's; a tool sends none.
151
+
152
+ | Tool | Facade call |
153
+ |---|---|
154
+ | `list_stories` | `cards.list({ ...storyQuery(project, { status, area }), page, size, sort: STORY_ORDER })` → `renderStories` |
155
+ | `search_stories` | the same with `{ q }` |
156
+ | `create_story` | `execute({ action: create, card: { kind: card, type: VIABLE_STORY_TYPE, parent, title, fields: { primary: false } } }, { wait: true, timeout: COMMIT_WAIT_MS })` |
157
+ | `update_story` | `resolveStory` → `execute({ card, action: update, changes: { title }, expectSeq: head ?? seq }, { wait: true, … })` |
158
+ | `delete_story` | `resolveStory` → `execute({ card, action: delete }, { wait: true, … })` → the project-lock poll |
159
+ | `develop_story` | `resolveStory` → `execute({ card, action: transit, transition: start }, { wait: true, … })`, tolerating `CommitTimeout` → `story.status(project, card.id)` |
160
+ | `story_status` | `resolveStory` → the card, its development run, pending inquiry, warning and landing mark |
161
+
162
+ Rules the table rests on:
163
+
164
+ - **A tool NAME is a parent agent's vocabulary and is never renamed**, and neither is an argument:
165
+ `storyId` stays `storyId` although the platform keys on card ids. New facts are added (`designSystem`
166
+ on `confirm_project`, the project status line and the design-system section of `project_status`),
167
+ never substituted.
168
+ - **`storyId` accepts a code or an id**, because `list_stories` prints the CODE — the handle every
169
+ generated file names a story by. `resolveStory` asks for both at once, the id wins, a code is also
170
+ tried uppercased, and neither answers for a story of another project (`ProjectStoryNotFound`).
171
+ - **Development is the story's `start`, not a call of its own.** The platform begins the run once that
172
+ move COMMITS, and refuses it there too (the flow, one story in progress, the balance). The wait is
173
+ `COMMIT_WAIT_MS`, well inside the tool deadline; a late commit is not a failure — the transition is
174
+ durable — so `develop_story` answers from `story_status` rather than outliving the host's ceiling.
175
+ - **A story a person writes goes as written, with no area.** Re-formatting the narrative and deciding
176
+ the area are the platform's, done in its planning middleware for the `connect` channel; a connector
177
+ that guessed an area would be a second answer. `update_story` carries only `title` and the head it
178
+ read, so a change made in between is refused (`WorkcardConflict`) rather than overwritten.
179
+ - **The delete commit is no proof the slot is done.** It says the card is gone and nothing about the
180
+ placeholder screens still being retired under the project lock, so `delete_story` keeps its two
181
+ unlocked observations.
182
+ - **Stories are read in `order`, then `createdAt`**: `order` is the analysis's flow ordinal (a
183
+ connective story sits at a fraction between two steps). `renderStories` keeps the line shape a parent
184
+ already reads — `code · status[ · primary][ · landing gate][ · area]` over the narrative — under a
185
+ header counting the page by intrinsic state. A new fact is a new FLAG beside `primary`; the area
186
+ stays last.
187
+ - **The landing gate story is read off the card the tool already holds** (`fields.landing`, at most
188
+ one per project, decided by the platform at initialization — a connector never sets it). The list
189
+ flags it; `story_status` and `develop_story` pass the resolved card to `renderStoryStatus`, which
190
+ adds `LANDING_NOTE` under the status line, and their structured result gains `landing: true`. No
191
+ second call and no change to `connect.story.status`: that route carries the run, not the card's
192
+ fields. It is said because developing that story also replaces the guest-home sketch with the real
193
+ component, which the narrative alone never tells a parent.
194
+ - **A planning refusal is phrased like any other**: `planning:illegal-transition:`,
195
+ `workcard-conflict:`, `workcard-not-found:`, `fields-invalid:`, `commit-timeout:`, `commit-failed:`
196
+ and the story markers (`viable-project:story:not-found:` / `:missconfigured:`) each have a sentence in
197
+ `REFUSALS`.
198
+
199
+ - **A sign-in refusal is phrased**: `oauth:sign-in-required:` (detail `<url> <code>`, the code absent
200
+ while no device sign-in is pending), `oauth:token-rejected:` (an environment token that was refused
201
+ is never replaced) and `api:auth:guard:auth-token` (a file token the platform refused — forgotten,
202
+ the next call signs in). Each ends with "call this tool again".
203
+
204
+ ## The project settings are ONE record, and the platform is the only validator
205
+
206
+ `project_settings` and `update_project_settings` read and change what a person edits on the project's
207
+ control panel — the copyright line, the organization name, the Terms and Privacy links and the Google
208
+ tag — through `ConnectorApi.projectBranding(projectId)` and
209
+ `saveProjectBranding(projectId, patch)` (`connect.project.branding.get` / `.save`,
210
+ `ConnectProjectBranding` / `ConnectProjectBrandingSave` from `@owlmeans/viable-common`).
211
+
212
+ - **A save is a PATCH.** `settingsPatch` keeps exactly the settings the call named, trimmed; an
213
+ omitted one keeps its stored value, and an EMPTY string is sent as given — for the Google tag that
214
+ is the removal, for the others a value the platform refuses. A call naming none is refused locally
215
+ and saves nothing. The answer is the merged record the platform stored, led by where the change
216
+ shows (`settingsReach`): a cloud preview is rebuilt, production takes it at the next Publish; a
217
+ local project gets it in its `.env` and `run_local` builds with it.
218
+ - **The connector states the rules and checks none of them.** `PROJECT_SETTINGS[].rule` is the web
219
+ save's validation in words — never-empty copyright and organization; an `https://` address without
220
+ credentials or a single-slash path on the application (`/terms`, `/privacy` are the generated
221
+ pages); a `GTM-`/`G-`/`GT-`/`AW-`/`DC-` id or `''` — used by the tool description and by the
222
+ refusal. A second copy of the check would be a second answer that drifts from the platform's.
223
+ - **A refusal names the setting and its rule.** The platform refuses a field with
224
+ `AuthenPayloadError(<wire field>)`; the `authen:payload:` phrase answers a known setting with its
225
+ label and rule and "Nothing was changed", any other field with a generic sentence. The tool runs in
226
+ `answering`, so the refusal is its own `isError` result and is still logged.
227
+ - **The save attaches the connector first** (`ensureSession`), like a story mutation: it ends in the
228
+ platform's configuration push, which for a local project is a `Configure` operation this connector
229
+ answers.
230
+ - **A relative link is annotated, never "fixed"**: `/terms` renders as "the generated Terms page", so
231
+ a parent does not rewrite it into an absolute address that points away from the generated page.
232
+ - **The credit switch is not reachable.** It is a paid capability with its own gated route;
233
+ neither the record nor the patch carries it.
234
+
235
+ ## `describe_platform` also says what a generated application CARRIES
236
+
237
+ `PLATFORM_CATALOGUE.features` holds facts about the product the runs produce — the landing gate, the
238
+ generated Terms and Privacy pages, the consent-gated Google tag, the look, production builds without
239
+ preview scaffolding — rendered whole on every host under "WHAT A GENERATED APPLICATION CARRIES", with
240
+ only their `tools` narrowed to what the host offers. A parent that is not told the platform generates
241
+ the legal pages writes its own beside them. `describe_capabilities` ends with `GENERATED_SUMMARY`, the
242
+ same facts in one sentence, because it is read at the same moment by a parent that may never call
243
+ `describe_platform`; the two sit side by side in `platform.ts`. The pipelines' `stages` name the steps
244
+ a run can stop at (`landing` and `legal` in init, `landing` in story development).
245
+
246
+ ## A balance or consent refusal is phrased for a person, and pushed through `notify`
247
+
248
+ `registerCatalogue`'s catch special-cases the two refusals only a PERSON can resolve
249
+ (`@owlmeans/viable-common` `connect/errors.ts`), by `instanceof`:
250
+
251
+ - `ConnectOutOfCredits` — rather than the raw `viable-connect:out-of-credits:...` marker, the tool
252
+ result reads as a sentence: what it needed, what the account has, and a link to top up.
253
+ - `ConnectConsentRequired` — the EU spend consent: "Nothing was started", why (credits bought less
254
+ than 14 days ago may only be used once a person expressly asks, the purchase still withdrawable up
255
+ to the last day), the `consentUrl` to open and confirm in the browser, and that the call must NOT
256
+ be retried automatically — only after the user says they confirmed (`consentRequiredPhrase(url,
257
+ deadline)` in `tools/refusal.ts`, shared with the stored-text entry below).
258
+
259
+ Their fields travel packed into the message (only `type` and `message` survive the platform's
260
+ internal HTTP hop) and are read back with `finalizeUnmarshal()`. Both are also handed to the
261
+ optional `ToolDeps.notify?('warning', text)`, which a host wires to its own out-of-band channel —
262
+ the stdio `viable-mcp` host sends an MCP `notifications/message`; the platform's stateless `/mcp`
263
+ host has no channel and omits it, so `notify` is always best-effort and optional. Every other
264
+ error returns through `refusalPhrase` and never calls `notify`.
265
+
266
+ The same refusals also arrive where no class survives, and `REFUSALS` phrases them by marker:
267
+ `viable-connect:consent-required:` (a stored run error; the URL and deadline parsed from the
268
+ detail), `performance-consent-required` (the web refusal inside a planning `commit-failed:` or a
269
+ stored error — no URL, so "Billing in the OwlMeans web application") — both ABOVE the planning
270
+ markers, because the consent is what the person acts on — and, for a production body that carries
271
+ only an incident id (`@owlmeans/api` `ApiStatusError`), `api:client:status:428` (the consent
272
+ sentence) and `api:client:status:402` (the balance sentence).
273
+
274
+ ## The session loop: serial, and free to redeliver
275
+
276
+ `openSession` pulls operations, answers them **one at a time**, and puts model tasks aside. Serial
277
+ because the thing on the other end of a local operation is a filesystem the platform believes it is
278
+ the only writer of — two concurrent template writes into one tree is not a throughput problem, it is
279
+ a corrupted tree.
280
+
281
+ Results are remembered by operation id. A connector that reconnects is handed everything still
282
+ outstanding, **including whatever it had already answered when the connection dropped**, and the
283
+ cached result answers it without doing the work again — re-executing a build or a model task because
284
+ an acknowledgement was lost is exactly the cost this avoids. A failed `submitOp` is logged, never
285
+ thrown: the operation stays in the platform's store and is redelivered.
286
+
287
+ Model tasks are **not executed here at all** — they are the parent agent's to run in its own clean
288
+ subagent, and what the loop owes them is delivery. The operation id is kept beside each task and
289
+ never shown to the parent: a parent that could name one could answer an operation it was never
290
+ given.
291
+
292
+ A local operation that fails reports `ConnectOpErrorKind.Refused`, never `Unavailable`. The
293
+ connector ran and could not do the thing; `Unavailable` tells the platform to give up on a run that
294
+ is fine.
295
+
296
+ **The pull long-poll is the transport.** It works through every proxy and needs no reconnection
297
+ logic. It is also the only transport a session ever uses — the URL-configured host opens no session
298
+ at all, so it never pulls. The contract declares a socket
299
+ (`connect.session.socket`, served by manager-api) and `SessionStats.transport` can say `'socket'`,
300
+ but **the SDK implements only the pull loop** — `PING_INTERVAL_MS`, `SOCKET_HANDSHAKE_MS` and
301
+ `RECONNECT_BACKOFF_MS` are declared for a socket client that does not exist yet. Treat the socket as
302
+ a platform capability, not an SDK one.
303
+
304
+ ## An answer is READ in the shapes models produce, not only the one asked for
305
+
306
+ The tool-call instruction asks for a JSON array and models mostly comply — but a single call comes
307
+ back as a bare object often enough, and some wrap the array in `{tool_calls: […]}`, that assuming
308
+ the array is a defect rather than strictness. The reference driver cast straight to an array, so a
309
+ bare object threw `parsed.map is not a function`; the TypeError was handed back AS the answer, the
310
+ model ladder read that as a bad answer and asked again with feedback that said nothing about what
311
+ was wrong, and the story failed with `retry-exceeded` having never been told. `toolCallsOf` accepts
312
+ all three shapes and still throws for an answer carrying no call at all — an empty answer is a bad
313
+ answer, and the retry is the right response to it.
314
+
315
+ The same rule is why `parseTaskResult` refuses with a described reason rather than a stack trace:
316
+ whatever comes back becomes a model's next prompt, so it has to be readable by one.
317
+
318
+ ## A redelivered model task must NOT be handed over twice
319
+
320
+ The platform redelivers every unanswered operation on each poll — that is what makes a connector
321
+ restart cost a round trip instead of a run, and for a slot command it is free because the result
322
+ cache answers it. A MODEL task is different: it is answered by a parent agent in tens of seconds,
323
+ and every poll during that window used to queue another copy. The parent then ran the same task
324
+ over and over — real model calls, paid for by the user, thrown away — while the job stayed blocked,
325
+ because only the first answer routed to a live operation and every later one reported that no
326
+ operation was waiting.
327
+
328
+ `TaskQueue` therefore remembers every task id it has handed over and ignores a second delivery of
329
+ one, keeping the memory after the task settles so a redelivery that raced the platform's deletion
330
+ is ignored rather than answered again. The operation id IS refreshed on a redelivery, because the
331
+ answer must route to the operation the platform is currently waiting on. `push` returns whether the
332
+ task was accepted, and `tasksDelivered` counts only accepted ones — a counter that grew per poll
333
+ would make a stuck run look busy.
334
+
335
+ ## The task envelope is text for a model to act on
336
+
337
+ The reader is a language model working from a tool result, so it must be able to act without a
338
+ schema in front of it. Everything it must do is stated **in order and before the material** — how to
339
+ run it (in a clean subagent, per harness), what to call afterwards (`submit_task_result`, with the
340
+ id spelled out), and what shape the answer takes — so a model that stops reading early has still
341
+ read the instruction. The task id appears at the top and in the follow-up call because it is the
342
+ only thing that routes an answer back: a parent that paraphrases the rest but copies the id still
343
+ works. A retry says which attempt it is and why the previous answer was refused. Harnesses differ
344
+ only in the isolation mechanism, never in what is asked; `Other` gets the request stated rather than
345
+ mechanised.
346
+
347
+ For Codex, the parent gives a fresh `viable-worker` only the task's system prompt, then its
348
+ conversation, then the requested result shape: the outer handoff instruction and
349
+ `submit_task_result` call are parent-only. It passes that final response through unchanged, but must
350
+ preserve the mode: a `text` task returns the requested source or text and never a JSON tool-call
351
+ array; that array belongs only to `tools` mode.
352
+
353
+ **`parseTaskResult` refuses a malformed answer locally**, and returns a `problem` rather than
354
+ throwing. The refusal is worth more than the parse: an answer that reaches the platform malformed
355
+ costs a whole retry — another task, another subagent, another wait — while one caught here is a
356
+ sentence the parent can act on immediately, with the subagent's context still open. It unfences,
357
+ rejects an array or a scalar in `Json` mode, and rejects a tool name the task never offered.
358
+
359
+ A task is handed out ONCE, and the platform then waits on it for up to 45 minutes. So the loop has
360
+ to survive a parent that lost the envelope — a compacted conversation, a subagent that died before
361
+ answering. `next_task` takes an optional `taskId` that re-reads a task already handed out, and when
362
+ nothing new is queued but something is unanswered it NAMES the outstanding ids rather than re-handing
363
+ them: re-handing would have a parent whose subagent is still working run the same task twice. A
364
+ refused answer keeps the task outstanding for exactly the same reason.
365
+
366
+ ## The harness installer is idempotent by construction, and never writes the token
367
+
368
+ A section is replaced between `<!-- viable:begin -->` and `<!-- viable:end -->`, a JSON entry is
369
+ merged under its own key, and a file whose content would not change is skipped. An instruction file
370
+ belongs to its project: overwriting it to add a paragraph deletes whatever else was in it, and
371
+ appending unconditionally grows a duplicate on every install. That is what makes `install_harness`
372
+ safe to offer as a tool the agent may call whenever it is unsure. A configuration that is not valid
373
+ JSON is **refused** — somebody is editing it, and overwriting would destroy every other server they
374
+ had configured.
375
+
376
+ **No file it writes contains the token**, and none REQUIRES one: a person who signed in with a browser
377
+ has the token in `~/.owlmeans`, which the server reads itself. So each configuration references
378
+ `VIABLE_API_TOKEN` in its harness's own syntax only where that cannot break a machine that never set
379
+ it — claude-code's `.mcp.json` uses `${VIABLE_API_TOKEN:-}` (an unset `${VAR}` makes Claude Code refuse
380
+ the whole file; the server ignores the empty value), Copilot's `.vscode/mcp.json` has no token prompt
381
+ at all, and Codex's `env_vars` lists `VIABLE_API_TOKEN`, `OWLMEANS_CREDENTIALS` and `HOME` (its filtered
382
+ environment otherwise hides the credentials file). The result is safe to commit. `WORKING_RULE` is written once and rendered
383
+ into every harness's instruction file, so the four cannot drift into four different protocols.
384
+
385
+ **The server command is written once, too.** Every harness configuration starts the connector from
386
+ `MCP_COMMAND` in `src/harness/templates.ts` — viable-mcp through `npx -y`, pinned with a caret at the
387
+ viable-mcp release, on ONE line with its `npx` so the release pin audit reads it as an install
388
+ command and moves it with every viable-mcp bump. Never a tag (`@next` is refused by that audit) and
389
+ never a per-harness literal: three copies spelled `@next` while the fourth carried the pin.
390
+ `tests/harness.spec.ts` asserts all four configurations name the viable-mcp manifest's version, that no
391
+ file contains a `vib_…` secret, and the optional-token shapes above.
392
+
393
+ ## The executor is the publisher's job, on somebody's laptop
394
+
395
+ `makeLocalSlotExecutor(dir)` answers the platform's slot commands against a directory here. The
396
+ dispatcher is the publisher's, switch for switch: the platform's remote helpers parse the ANSWERS
397
+ and cannot tell whether a pod or a laptop produced one, so an ordinary failure comes back in the
398
+ same shape ("error text or null"), and only an unknown command — a protocol fault rather than a
399
+ project fault — escapes as an exception. Everything is resolved per call rather than closed over,
400
+ because a re-initialization replaces the tree under a running connector. The integrity verdict is
401
+ forgotten after every command that changes the tree.
402
+
403
+ Five rules the local half adds, each learned from a defect:
404
+
405
+ - **`backendEnv` reads the root `.env` and `frontendEnv` the web package's own — the file split IS
406
+ the leak boundary.** The publisher has an allow-list (`frontendEnvVars`/`frontendSecrets`); here
407
+ the two files are never merged in either direction, because `FRONTEND_ENV_KEYS` announces
408
+ everything in the frontend set to the bundler and a merge would compile `OIDC_SECRET` and
409
+ `DATABASE_URL` into a bundle every visitor downloads.
410
+ - **`Discard` passes `git clean -fd -e .viable`.** `.viable/connect.json` is untracked until someone
411
+ commits it, and a discard that swept it leaves a tree no later session can recognise as a platform
412
+ project at all.
413
+ - **The always-keep list must not leave empty parent shells.** A wipe keeps `.viable`, `.env`, the
414
+ web package's `.env` and `.git` whatever the caller asked, so a directory holding a kept path is
415
+ walked and pruned rather than removed — and a keep that was not there (the web `.env` every
416
+ project without local branding lacks) must not leave the walked directory behind as a skeleton the
417
+ install then lands in.
418
+ - **An absolute path from elsewhere on the machine is re-rooted inside the project**, not refused —
419
+ the publisher's own behaviour, kept deliberately and pinned by a test. Concatenating it onto the
420
+ root instead builds a shadow tree: the write reports success, a later read of the same name
421
+ resolves to the untouched original, and the change looks silently ignored. `resolveInProject`
422
+ (exported as `confineToProject`) then compares the fully resolved path to the root — confinement,
423
+ not sanitization, and applied on **every** fs call rather than a `..`-to-`.` replace at one caller.
424
+ - **`run/state.ts` sits below both the shell commands and the run**, so the three do not form a
425
+ cycle: `DbSync` bounces the api child, `DbSync` is a shell command, and the shell commands are
426
+ reached through the executor the run is built on. Everything that touches a child process lives
427
+ there, and the run record is a file because the processes outlive the call — and, on a restarted
428
+ connector, the process — that started them.
429
+
430
+ ## Attaching a session is what writes the project marker
431
+
432
+ `.viable/connect.json` is how a connector started in a directory tomorrow knows which project it
433
+ is, and `attach_project` finds a project by its directory through it. It was declared, read at MCP
434
+ startup and documented in `mcp.md` before anything wrote it — a marker nothing writes is a lookup
435
+ that always misses.
436
+
437
+ `openSession` writes it when the session names a project and a directory, which is the moment the
438
+ directory becomes that project's. Best-effort and idempotent: a session that works is worth more
439
+ than a note about it, and it is skipped when the marker already names the same project. It holds
440
+ no secret and is meant to be committed, which is why the API URL and the slug are in it and the
441
+ token never is.
442
+
443
+ ## The managed block yields to every key the user assigned
444
+
445
+ A `.env` gives the LAST assignment of a key and the platform's block is appended, so a platform line
446
+ silently outranks whatever the user wrote above it. That made the documented promise — everything
447
+ outside the block is yours — false for the one value the platform cannot supply: `DATABASE_URL`, the
448
+ line the setup guide tells people to write. The application connected to the placeholder no matter
449
+ what its owner put in the file.
450
+
451
+ `writeEnv` therefore reads the file with the block cut out, and replaces any block line assigning a
452
+ key the user already assigns with a comment saying so. The rule is about VALUES, not lines: a key the
453
+ user has not claimed is still the platform's to set, and a key they later delete goes back to the
454
+ platform on the next push.
455
+
456
+ ## The two services a local project needs are ASKED for, never assumed
457
+
458
+ The platform provisions nothing on somebody's own machine, so a database — and, for a project with a
459
+ worker, a queue store — is the one thing it cannot supply and must not guess. `local_setup_guide`
460
+ reports what the machine already provides and, where something is missing, returns a QUESTION with
461
+ three answers: the user already has one, wants one installed here, or wants a free hosted plan.
462
+ Guessing means either a container on somebody's machine they did not ask for, or a connection string
463
+ invented for a database that does not exist — and the second surfaces minutes later as a boot error
464
+ about a connection, which sends the reader looking for a database rather than for a typo.
465
+
466
+ `set_local_service` records what they answered: it writes the value into the project's own half of
467
+ the `.env`, replacing that key rather than appending a second copy, and PROBES it immediately, so a
468
+ string that does not connect is caught while the user is still in the conversation. A credential
469
+ never reaches the marker, a harness configuration, or the platform, and the guide warns when the
470
+ file is not git-ignored.
471
+
472
+ ## A detached child outlives the connector, so the port is RECLAIMED before it is used
473
+
474
+ Every target process is spawned detached — that is what keeps a build from dying with the tool that
475
+ started it — and detaching is also why a connector killed mid-run (a host restart, a Ctrl-C, a
476
+ crashed test) leaves one alive. What survives holds port 3000, and the next attempt fails with the
477
+ TARGET's own "the api port is already in use", which reads as a defect in the generated app rather
478
+ than as a leftover.
479
+
480
+ Two rules, both ported from the publisher because a laptop needs them more than a pod does:
481
+ - `killGroupAndWait` never returns early on the child's own exit code. The child is a shell wrapping
482
+ `bun`, so a signal the shell dies from leaves `bun` alive while `exitCode` says gone; the wait
483
+ polls the GROUP instead of the child's exit event.
484
+ - `reclaimPort` runs before a spawn as well as after one, and matches on the script AND the process
485
+ marker (`--viable-api`, `--viable-worker`, `--viable-boot-check`) — never a port alone, and never
486
+ a marker alone, since reclaiming sends SIGKILL and a marker on its own matches any command line
487
+ that merely mentions it.
488
+
489
+ ## Running the generated app locally
490
+
491
+ `runLocal` builds and starts the api, the worker (when the project has one) and a local server that
492
+ holds the web port and proxies `/api` to the api process on the same origin — the generated app's
493
+ configuration assumes one origin, and splitting them across two loopback ports would put its CORS
494
+ setup in the path of a developer's first page load. There is no respawn ladder, no reconciler and no
495
+ health route: a developer watching their own terminal is the supervisor. What IS reproduced is the
496
+ shape — the same ports, the same argv marker, the same environment, and the same "port ownership is
497
+ the only proof" rule about restarts. Nothing from the publisher's public-hostname policy (robots,
498
+ CSP, the preview error reporter, the build-state header) is reproduced: a loopback address has no
499
+ reputation to spend and no crawler to answer.
500
+
501
+ `run_local` refuses to start a project whose `.env` is still missing a required key, because an app
502
+ launched without a database URL fails at boot with a message about a connection, which sends the
503
+ reader looking for a database that was never configured.
504
+
505
+ ## Tests
506
+
507
+ `bun test ./tests` — offline: the envelope and its parser, the harness installer, the tool catalogue,
508
+ the `registerCatalogue` out-of-credits, consent and planning-refusal phrasing and `notify` wiring
509
+ (`mcp-catalogue.spec.ts`; the consent marker, the bare 428/402 statuses and a consent inside a
510
+ commit failure in `catalogue.spec.ts`), the executor's files/git/layout rules, and the marker + managed-`.env`
511
+ block. The story tools run over a REAL `@owlmeans/server-planning` service (memory store, the Viable
512
+ types and flows, one plugin standing in for the platform's format seam) built in `tests/context.ts`,
513
+ the landing mark included; the settings tools over a recorded `ConnectorApi` (order of session and
514
+ save, the patch sent, the phrased `AuthenPayloadError`). `platform.spec.ts` pins that every tool a
515
+ pipeline, feature or group names exists and every tool is in a group; `planning-wiring.spec.ts` pins
516
+ the planning aliases and paths a context binds, and `remote.spec.ts` drives the remote facade and the
517
+ settings routes through a captured transport to pin their paths and deadlines.
518
+
519
+ ## Depends On
520
+
521
+ - `@owlmeans/viable-common` — the whole wire contract · `@owlmeans/auth-token` — the carrier guard
522
+ - `@owlmeans/planning` — the protocol tree, the facade contract and its refusals ·
523
+ `@owlmeans/client-planning` — the remote facade and the long-poll commit wait
524
+ - `@owlmeans/api`, `@owlmeans/client-context`, `@owlmeans/client-entrypoint`, `@owlmeans/client-config`,
525
+ `@owlmeans/auth-common`, `@owlmeans/entrypoint`, `@owlmeans/route`, `@owlmeans/socket`,
526
+ `@owlmeans/config`, `@owlmeans/context`, `@owlmeans/error`, `@owlmeans/basic-ids`
527
+ - `@modelcontextprotocol/sdk` (types only, structurally), `zod`, `fs-extra`, `globby`, `ajv`
528
+
529
+ ## Related
530
+
531
+ - [[viable-mcp]] — the npx stdio server built on this
532
+ - [[auth-token]] — the credential and its carrier guard
533
+ - [[client-planning]] · [[planning]] — the facade the story tools write through
534
+ - `@owlmeans/llm-delegate` (`internal` monorepo, skill `llm-delegate`) — the other end of a model
535
+ task, inside the platform
@@ -7,7 +7,7 @@ export declare const isTransientTransportError: (value: unknown) => boolean;
7
7
  * Recover a long poll with one non-blocking snapshot.
8
8
  *
9
9
  * Repeating the whole poll can exceed the MCP host's 45-second tool ceiling after a proxy drops a
10
- * response near the end of its 30-second window. A snapshot asks for the same durable job row with
10
+ * response near the end of its 30-second window. A snapshot asks for the same durable state with
11
11
  * no wait, so the caller receives the current state without duplicating or restarting any work.
12
12
  */
13
13
  export declare const recoverLongPoll: <T>(poll: () => Promise<T>, snapshot: () => Promise<T>) => Promise<T>;
@@ -16,8 +16,12 @@ export declare const recoverLongPoll: <T>(poll: () => Promise<T>, snapshot: () =
16
16
  *
17
17
  * Every call is bounded by the tool deadline rather than left to the transport's own default: a
18
18
  * tool that outlives its host's ceiling is reported to the user as a broken server, and the true
19
- * answer — the platform was slow — never reaches them. Anything that legitimately takes longer is
20
- * a job, and a job returns at once.
19
+ * answer — the platform was slow — never reaches them. Long work returns its current domain status.
20
+ *
21
+ * `planning` is the facade `makeSdkContext` registered with `appendPlanningClient`: its reads and
22
+ * its execute POST carry the same tool deadline, and a commit is awaited by long polls whose HTTP
23
+ * deadline outlasts their own hold by ten seconds. Its scope is empty on purpose — the platform
24
+ * reads the organization and the profile from the token.
21
25
  */
22
26
  export declare const makeRemoteConnectorApi: (context: Ctx) => ConnectorApi;
23
27
  export {};