@owlmeans/viable-sdk 0.1.18-rc.2 → 0.1.18-rc.20

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 (50) 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 +438 -0
  4. package/build/api/remote.d.ts +5 -0
  5. package/build/api/remote.d.ts.map +1 -1
  6. package/build/api/remote.js +7 -17
  7. package/build/api/remote.js.map +1 -1
  8. package/build/consts.d.ts +13 -0
  9. package/build/consts.d.ts.map +1 -1
  10. package/build/consts.js +13 -0
  11. package/build/consts.js.map +1 -1
  12. package/build/context/index.d.ts.map +1 -1
  13. package/build/context/index.js +55 -16
  14. package/build/context/index.js.map +1 -1
  15. package/build/executor/shell.d.ts.map +1 -1
  16. package/build/executor/shell.js +17 -5
  17. package/build/executor/shell.js.map +1 -1
  18. package/build/harness/templates.d.ts.map +1 -1
  19. package/build/harness/templates.js +17 -8
  20. package/build/harness/templates.js.map +1 -1
  21. package/build/task/envelope.d.ts.map +1 -1
  22. package/build/task/envelope.js +5 -1
  23. package/build/task/envelope.js.map +1 -1
  24. package/build/tools/catalogue.d.ts.map +1 -1
  25. package/build/tools/catalogue.js +119 -26
  26. package/build/tools/catalogue.js.map +1 -1
  27. package/build/tools/index.d.ts +1 -0
  28. package/build/tools/index.d.ts.map +1 -1
  29. package/build/tools/index.js +1 -0
  30. package/build/tools/index.js.map +1 -1
  31. package/build/tools/mcp.d.ts +2 -10
  32. package/build/tools/mcp.d.ts.map +1 -1
  33. package/build/tools/mcp.js +29 -27
  34. package/build/tools/mcp.js.map +1 -1
  35. package/build/tools/platform.d.ts.map +1 -1
  36. package/build/tools/platform.js +3 -1
  37. package/build/tools/platform.js.map +1 -1
  38. package/build/tools/refusal.d.ts.map +1 -1
  39. package/build/tools/refusal.js +46 -0
  40. package/build/tools/refusal.js.map +1 -1
  41. package/build/tools/stories.d.ts +39 -0
  42. package/build/tools/stories.d.ts.map +1 -0
  43. package/build/tools/stories.js +81 -0
  44. package/build/tools/stories.js.map +1 -0
  45. package/build/tools/types.d.ts +8 -0
  46. package/build/tools/types.d.ts.map +1 -1
  47. package/build/tools/types.js.map +1 -1
  48. package/build/types.d.ts +12 -16
  49. package/build/types.d.ts.map +1 -1
  50. package/package.json +20 -17
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.28
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.20",
5
+ "generatedAt": "2026-09-17T08:16:11.191Z",
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,438 @@
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.20"` in `dependencies`
12
+ **Subpaths:** `.` · `./executor` · `./run` · `./tools` · `./task` · `./harness`
13
+ **Contracts:** `@owlmeans/viable-common` (`./connect`, `./slot`, `./integrity`, and the planning
14
+ vocabulary — story type, story flow, `jobIdOf`) 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? })` | A client context authenticated by one token, 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
+ | `renderJob(job)` · `isSettled(job)` | A job as a few lines a model can act on |
35
+ | `resolveStory(deps, projectId, ref)` · `storyQuery(projectId, filter?)` · `renderStories(items, page, total)` · `STORY_ORDER` | The story tools' reading of planning cards |
36
+ | `ToolHostKind` (`Stdio`/`Http`) · `ToolHost` · `ToolDeps` · `anyHost`/`localTarget`/`cloudTarget`/`withExecutor`/`delegatedLlm`/`sessionCapable`/`performsModelTasks` | The host description and the availability predicates |
37
+ | `./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 job, on somebody's laptop |
38
+ | `./run`: `runLocal`, `stopLocal`, `localStatus`, `createLocalServer`, `startApi`/`startWorker`/`restartApi`/`stopProcess`, `readRun`/`writeRun`/`clearRun` | Building and running the generated app locally |
39
+ | `readMarker`/`writeMarker`/`discoverProject`/`isViableTree` · `readEnv`/`writeEnv`/`envStatus`/`replaceManagedBlock` | The `.viable/connect.json` marker and the managed `.env` block |
40
+ | `SdkError`, `SdkAuthError`, `SdkMisconfigured`, `SdkUnsupported` | Registered `ResilientError` classes |
41
+ | `ENV_TOKEN`, `ENV_API_URL`, `ENV_TARGET`, `ENV_LLM`, `ENV_HARNESS`, `ENV_PROJECT_DIR` · `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 |
42
+
43
+ ## One credential, and the routes the server declares
44
+
45
+ `makeSdkContext` registers `makeTokenCarrierGuard` under `DEFAULT_GUARD` and binds the SAME
46
+ immutable `connectProtocols(...)` tree the server mounts, so a path or a schema cannot be right on
47
+ one end and wrong on the other. The planning tree is bound the same way:
48
+ `makePlanningProtocols({ base: { alias: 'viable:manager-api:planning', path: '/planning' }, guards:
49
+ DEFAULT_GUARD, socketBase: <the /update base> })` — manager-api's mount minus its ownership gate, which
50
+ is the server's to apply — followed by `appendPlanningClient(context, { protocols, bind: false, poll:
51
+ COMMIT_POLL_SEC, timeout: TOOL_DEADLINE_MS, schemas: false })`. The base alias and path are literals
52
+ beside the `/update` base for the same reason that one is: they belong to manager-api, and every
53
+ planning alias and path derives from them. No socket opener is passed, so a commit is awaited by long
54
+ poll only, and the schema bundle is not fetched at startup — nothing a tool does reads a flow, and a
55
+ server nobody has asked anything yet makes no call. There is deliberately **no second credential path**: a connector that could
56
+ fall back to another form of authentication is a connector whose access nobody can revoke by
57
+ revoking a token. A token without `CONNECT_TOKEN_PREFIX` is refused locally, because a 401 says
58
+ nothing about which of several plausible mistakes was made and the answer is always the same one.
59
+
60
+ **The context must also declare the platform's `/update` base itself.** The connector's socket route
61
+ and the planning commit feed hang under that namespace, and a parent an entrypoint registry cannot resolve fails the **whole
62
+ context at init** rather than the one call that would have used it — a server that exited at startup
63
+ with `Entrypoint viable:manager-api:update:base not found`. It is declared with the path the
64
+ platform declares and never binds: it is a namespace, and nothing calls it.
65
+
66
+ **`cfg.webService` names the API CLIENT, never the backend.** It is the alias the entrypoint handler
67
+ looks up with `context.service(...)`, and the only thing registered under it is the `ApiClient` that
68
+ `makeClientContext` appends (`web-client`). Naming the backend service there — which is exactly what
69
+ `addWebService` does — makes every call fail with `Service <backend> not found` before a request is
70
+ sent. The backend belongs in `cfg.services` as an ordinary descriptor marked `default: true`; the
71
+ connect routes name no service of their own, so that is the one they resolve to.
72
+
73
+ **A POST with nothing to say still sends `{}`.** The client sets no `Content-Type` for an absent
74
+ body, and Fastify answers **415 Unsupported Media Type** before the handler runs — an error about
75
+ media types for a call whose only fault was having no arguments. `makeRemoteConnectorApi` fills an
76
+ empty body for any POST route that was given none; `session.close` and `session.heartbeat` are
77
+ exactly that shape.
78
+
79
+ ## Two hosts, one interface
80
+
81
+ `ConnectorApi` is an interface because two implementations must stay interchangeable — one calling
82
+ the API over HTTP (`makeRemoteConnectorApi`, the npx server) and one calling the manager's own
83
+ handlers in process (`makeInProcessConnectorApi` in `viable-manager-api`, behind `POST /mcp`). Every
84
+ tool is written against it, so a tool cannot accidentally work in only one of the two. Which route
85
+ `openSession` calls fixes the mode: the delegated route carries the entitlement gate, so a caller
86
+ without the capability is refused at the boundary rather than by a check somewhere inside.
87
+
88
+ ## A SESSION belongs to a host that stays; `sessionCapable` is what says so
89
+
90
+ A session is a connector ATTACHED — a process that drains the project's operations and holds a model
91
+ task until its answer comes back. The URL-configured host answers one request and forgets, so
92
+ opening one there would claim the project's single connector slot, **supersede the stdio connector
93
+ legitimately holding it**, and be abandoned before the first operation was delivered.
94
+
95
+ So `ensureSession` — what `confirm_project`, `reinitialize_project`, `develop_story`,
96
+ `modify_project` and `resume_pipeline` call before returning their job — opens one only on a
97
+ `sessionCapable` host, and `next_task`/`submit_task_result` are available on `performsModelTasks`
98
+ (delegated **and** session-capable) rather than on the account setting alone. `serverInstructions`
99
+ reads the same predicate: a parent told to call `next_task` when the tool is not in its list is a
100
+ parent that waits for a run nobody will advance. A host that cannot serve the delegated mode says so
101
+ in one sentence instead, naming the stdio connector.
102
+
103
+ The in-process implementation refuses the five session verbs (`openSession`, `closeSession`,
104
+ `heartbeat`, `pullOps`, `submitOp`) with a message naming `@owlmeans/viable-mcp`, because
105
+ "unsupported" alone leaves the reader with nothing to do about it.
106
+
107
+ ## A tool that cannot work in a mode is HIDDEN, not failing
108
+
109
+ `ToolDefinition.availability` and `visibleTools(host)` decide the catalogue a parent actually sees. A
110
+ tool a host cannot serve is a tool the parent tries once, is refused, and remembers as broken — so
111
+ the list it reads is exactly the set of things that work for it. Predicates: `anyHost`,
112
+ `localTarget`, `cloudTarget`, `withExecutor`, `delegatedLlm`.
113
+
114
+ ## 45 seconds is the ceiling, which is why long operations are JOBS
115
+
116
+ Every MCP host bounds a tool call and the strictest default in the field is sixty seconds (Codex).
117
+ `TOOL_DEADLINE_MS` leaves room for the round trip and keeps the connector inside every host's
118
+ ceiling without configuration. A tool that outlives its host's ceiling is reported to the user as a
119
+ **broken server**, and the true answer — the platform was slow — never reaches them.
120
+
121
+ So anything that takes minutes returns a `ConnectJob` at once and is polled with `wait_for`.
122
+ `registerCatalogue` enforces the deadline per call and converts a throw into an `isError` result the
123
+ model can read and act on, because an exception crossing the transport tells it only that something
124
+ went wrong somewhere. `renderJob` ends every job with a single `next:` line — that is what keeps a
125
+ parent from inventing a polling strategy of its own, or from concluding that a blocked run has
126
+ failed.
127
+
128
+ ## The story tools speak planning
129
+
130
+ A user story is a planning CARD of `VIABLE_STORY_TYPE` under its project card, and every change to one
131
+ is a transition executed through `ConnectorApi.planning` — a `PlanningFacade`: the client facade
132
+ `appendPlanningClient` registers over HTTP, and `ensurePlanningService(ctx).for(scope)` in the
133
+ platform's in-process host. The scope a call answers for is the CREDENTIAL's; a tool sends none.
134
+
135
+ | Tool | Facade call |
136
+ |---|---|
137
+ | `list_stories` | `cards.list({ ...storyQuery(project, { status, area }), page, size, sort: STORY_ORDER })` → `renderStories` |
138
+ | `search_stories` | the same with `{ q }` |
139
+ | `create_story` | `execute({ action: create, card: { kind: card, type: VIABLE_STORY_TYPE, parent, title, fields: { primary: false } } }, { wait: true, timeout: COMMIT_WAIT_MS })` |
140
+ | `update_story` | `resolveStory` → `execute({ card, action: update, changes: { title }, expectSeq: head ?? seq }, { wait: true, … })` |
141
+ | `delete_story` | `resolveStory` → `execute({ card, action: delete }, { wait: true, … })` → the project-lock poll |
142
+ | `develop_story` | `resolveStory` → `execute({ card, action: transit, transition: start }, { wait: true, … })`, a `CommitTimeout` tolerated → `project.job(project, jobIdOf(StoryDevelop, project, card.id))` |
143
+ | `story_status` | `resolveStory` → the card's code, status and `fields.warning` |
144
+
145
+ Rules the table rests on:
146
+
147
+ - **A tool NAME is a parent agent's vocabulary and is never renamed**, and neither is an argument:
148
+ `storyId` stays `storyId` although the platform keys on card ids. New facts are added (`designSystem`
149
+ on `confirm_project`, the project status line and the design-system section of `project_status`),
150
+ never substituted.
151
+ - **`storyId` accepts a code or an id**, because `list_stories` prints the CODE — the handle every
152
+ generated file names a story by. `resolveStory` asks for both at once, the id wins, a code is also
153
+ tried uppercased, and neither answers for a story of another project (`ProjectStoryNotFound`).
154
+ - **Development is the story's `start`, not a call of its own.** The platform begins the run once that
155
+ move COMMITS, and refuses it there too (the flow, one story in progress, the balance). The wait is
156
+ `COMMIT_WAIT_MS`, well inside the tool deadline; a late commit is not a failure — the transition is
157
+ durable — so `develop_story` answers from the job row rather than outliving the host's ceiling. The
158
+ job id is composed with viable-common's `jobIdOf`, the one spelling the platform answers under.
159
+ - **A story a person writes goes as written, with no area.** Re-formatting the narrative and deciding
160
+ the area are the platform's, done in its planning middleware for the `connect` channel; a connector
161
+ that guessed an area would be a second answer. `update_story` carries only `title` and the head it
162
+ read, so a change made in between is refused (`WorkcardConflict`) rather than overwritten.
163
+ - **The delete commit is no proof the slot is done.** It says the card is gone and nothing about the
164
+ placeholder screens still being retired under the project lock, so `delete_story` keeps its two
165
+ unlocked observations.
166
+ - **Stories are read in `order`, then `createdAt`**: `order` is the analysis's flow ordinal (a
167
+ connective story sits at a fraction between two steps). `renderStories` keeps the line shape a parent
168
+ already reads — `code · status[ · primary][ · area]` over the narrative — under a header counting the
169
+ page by intrinsic state.
170
+ - **A planning refusal is phrased like any other**: `planning:illegal-transition:`,
171
+ `workcard-conflict:`, `workcard-not-found:`, `fields-invalid:`, `commit-timeout:`, `commit-failed:`
172
+ and the story markers (`viable-project:story:not-found:` / `:missconfigured:`) each have a sentence in
173
+ `REFUSALS`.
174
+
175
+ ## An out-of-credits refusal is phrased, and pushed through `notify`
176
+
177
+ `registerCatalogue`'s catch special-cases `ConnectOutOfCredits` (`@owlmeans/viable-common`
178
+ `connect/errors.ts`): rather than the raw `viable-connect:out-of-credits:...` marker, the tool
179
+ result reads as a sentence — what it needed, what the account has, and a link to top up — because
180
+ only `type` and `message` survive the platform's internal HTTP hop, so those three fields travel
181
+ packed into the message and are read back out with `finalizeUnmarshal()`. The same refusal is also
182
+ handed to the optional `ToolDeps.notify?(level, text)`, which a host wires to its own out-of-band
183
+ channel — the stdio `viable-mcp` host sends an MCP `notifications/message`; the platform's stateless
184
+ `/mcp` host has no channel and omits it, so `notify` is always best-effort and optional. Every other
185
+ error still returns as its own `.message`, unphrased, and never calls `notify`.
186
+
187
+ ## The session loop: serial, and free to redeliver
188
+
189
+ `openSession` pulls operations, answers them **one at a time**, and puts model tasks aside. Serial
190
+ because the thing on the other end of a local operation is a filesystem the platform believes it is
191
+ the only writer of — two concurrent template writes into one tree is not a throughput problem, it is
192
+ a corrupted tree.
193
+
194
+ Results are remembered by operation id. A connector that reconnects is handed everything still
195
+ outstanding, **including whatever it had already answered when the connection dropped**, and the
196
+ cached result answers it without doing the work again — re-executing a build or a model task because
197
+ an acknowledgement was lost is exactly the cost this avoids. A failed `submitOp` is logged, never
198
+ thrown: the operation stays in the platform's store and is redelivered.
199
+
200
+ Model tasks are **not executed here at all** — they are the parent agent's to run in its own clean
201
+ subagent, and what the loop owes them is delivery. The operation id is kept beside each task and
202
+ never shown to the parent: a parent that could name one could answer an operation it was never
203
+ given.
204
+
205
+ A local operation that fails reports `ConnectOpErrorKind.Refused`, never `Unavailable`. The
206
+ connector ran and could not do the thing; `Unavailable` tells the platform to give up on a run that
207
+ is fine.
208
+
209
+ **The pull long-poll is the transport.** It works through every proxy and needs no reconnection
210
+ logic. It is also the only transport a session ever uses — the URL-configured host opens no session
211
+ at all, so it never pulls. The contract declares a socket
212
+ (`connect.session.socket`, served by manager-api) and `SessionStats.transport` can say `'socket'`,
213
+ but **the SDK implements only the pull loop** — `PING_INTERVAL_MS`, `SOCKET_HANDSHAKE_MS` and
214
+ `RECONNECT_BACKOFF_MS` are declared for a socket client that does not exist yet. Treat the socket as
215
+ a platform capability, not an SDK one.
216
+
217
+ ## An answer is READ in the shapes models produce, not only the one asked for
218
+
219
+ The tool-call instruction asks for a JSON array and models mostly comply — but a single call comes
220
+ back as a bare object often enough, and some wrap the array in `{tool_calls: […]}`, that assuming
221
+ the array is a defect rather than strictness. The reference driver cast straight to an array, so a
222
+ bare object threw `parsed.map is not a function`; the TypeError was handed back AS the answer, the
223
+ model ladder read that as a bad answer and asked again with feedback that said nothing about what
224
+ was wrong, and the story failed with `retry-exceeded` having never been told. `toolCallsOf` accepts
225
+ all three shapes and still throws for an answer carrying no call at all — an empty answer is a bad
226
+ answer, and the retry is the right response to it.
227
+
228
+ The same rule is why `parseTaskResult` refuses with a described reason rather than a stack trace:
229
+ whatever comes back becomes a model's next prompt, so it has to be readable by one.
230
+
231
+ ## A redelivered model task must NOT be handed over twice
232
+
233
+ The platform redelivers every unanswered operation on each poll — that is what makes a connector
234
+ restart cost a round trip instead of a run, and for a slot command it is free because the result
235
+ cache answers it. A MODEL task is different: it is answered by a parent agent in tens of seconds,
236
+ and every poll during that window used to queue another copy. The parent then ran the same task
237
+ over and over — real model calls, paid for by the user, thrown away — while the job stayed blocked,
238
+ because only the first answer routed to a live operation and every later one reported that no
239
+ operation was waiting.
240
+
241
+ `TaskQueue` therefore remembers every task id it has handed over and ignores a second delivery of
242
+ one, keeping the memory after the task settles so a redelivery that raced the platform's deletion
243
+ is ignored rather than answered again. The operation id IS refreshed on a redelivery, because the
244
+ answer must route to the operation the platform is currently waiting on. `push` returns whether the
245
+ task was accepted, and `tasksDelivered` counts only accepted ones — a counter that grew per poll
246
+ would make a stuck run look busy.
247
+
248
+ ## The task envelope is text for a model to act on
249
+
250
+ The reader is a language model working from a tool result, so it must be able to act without a
251
+ schema in front of it. Everything it must do is stated **in order and before the material** — how to
252
+ run it (in a clean subagent, per harness), what to call afterwards (`submit_task_result`, with the
253
+ id spelled out), and what shape the answer takes — so a model that stops reading early has still
254
+ read the instruction. The task id appears at the top and in the follow-up call because it is the
255
+ only thing that routes an answer back: a parent that paraphrases the rest but copies the id still
256
+ works. A retry says which attempt it is and why the previous answer was refused. Harnesses differ
257
+ only in the isolation mechanism, never in what is asked; `Other` gets the request stated rather than
258
+ mechanised.
259
+
260
+ For Codex, the parent gives a fresh `viable-worker` only the task's system prompt, then its
261
+ conversation, then the requested result shape: the outer handoff instruction and
262
+ `submit_task_result` call are parent-only. It passes that final response through unchanged, but must
263
+ preserve the mode: a `text` task returns the requested source or text and never a JSON tool-call
264
+ array; that array belongs only to `tools` mode.
265
+
266
+ **`parseTaskResult` refuses a malformed answer locally**, and returns a `problem` rather than
267
+ throwing. The refusal is worth more than the parse: an answer that reaches the platform malformed
268
+ costs a whole retry — another task, another subagent, another wait — while one caught here is a
269
+ sentence the parent can act on immediately, with the subagent's context still open. It unfences,
270
+ rejects an array or a scalar in `Json` mode, and rejects a tool name the task never offered.
271
+
272
+ A task is handed out ONCE, and the platform then waits on it for up to 45 minutes. So the loop has
273
+ to survive a parent that lost the envelope — a compacted conversation, a subagent that died before
274
+ answering. `next_task` takes an optional `taskId` that re-reads a task already handed out, and when
275
+ nothing new is queued but something is unanswered it NAMES the outstanding ids rather than re-handing
276
+ them: re-handing would have a parent whose subagent is still working run the same task twice. A
277
+ refused answer keeps the task outstanding for exactly the same reason.
278
+
279
+ ## The harness installer is idempotent by construction, and never writes the token
280
+
281
+ A section is replaced between `<!-- viable:begin -->` and `<!-- viable:end -->`, a JSON entry is
282
+ merged under its own key, and a file whose content would not change is skipped. An instruction file
283
+ belongs to its project: overwriting it to add a paragraph deletes whatever else was in it, and
284
+ appending unconditionally grows a duplicate on every install. That is what makes `install_harness`
285
+ safe to offer as a tool the agent may call whenever it is unsure. A configuration that is not valid
286
+ JSON is **refused** — somebody is editing it, and overwriting would destroy every other server they
287
+ had configured.
288
+
289
+ **No file it writes contains the token**: each configuration references `VIABLE_API_TOKEN` in its
290
+ harness's own syntax, so the result is safe to commit. `WORKING_RULE` is written once and rendered
291
+ into every harness's instruction file, so the four cannot drift into four different protocols.
292
+
293
+ **The server command is written once, too.** Every harness configuration starts the connector from
294
+ `MCP_COMMAND` in `src/harness/templates.ts` — viable-mcp through `npx -y`, pinned with a caret at the
295
+ viable-mcp release, on ONE line with its `npx` so the release pin audit reads it as an install
296
+ command and moves it with every viable-mcp bump. Never a tag (`@next` is refused by that audit) and
297
+ never a per-harness literal: three copies spelled `@next` while the fourth carried the pin.
298
+ `tests/harness.spec.ts` asserts all four configurations name the viable-mcp manifest's version.
299
+
300
+ ## The executor is the publisher's job, on somebody's laptop
301
+
302
+ `makeLocalSlotExecutor(dir)` answers the platform's slot commands against a directory here. The
303
+ dispatcher is the publisher's, switch for switch: the platform's remote helpers parse the ANSWERS
304
+ and cannot tell whether a pod or a laptop produced one, so an ordinary failure comes back in the
305
+ same shape ("error text or null"), and only an unknown command — a protocol fault rather than a
306
+ project fault — escapes as an exception. Everything is resolved per call rather than closed over,
307
+ because a re-initialization replaces the tree under a running connector. The integrity verdict is
308
+ forgotten after every command that changes the tree.
309
+
310
+ Five rules the local half adds, each learned from a defect:
311
+
312
+ - **`backendEnv` reads the root `.env` and `frontendEnv` the web package's own — the file split IS
313
+ the leak boundary.** The publisher has an allow-list (`frontendEnvVars`/`frontendSecrets`); here
314
+ the two files are never merged in either direction, because `FRONTEND_ENV_KEYS` announces
315
+ everything in the frontend set to the bundler and a merge would compile `OIDC_SECRET` and
316
+ `DATABASE_URL` into a bundle every visitor downloads.
317
+ - **`Discard` passes `git clean -fd -e .viable`.** `.viable/connect.json` is untracked until someone
318
+ commits it, and a discard that swept it leaves a tree no later session can recognise as a platform
319
+ project at all.
320
+ - **The always-keep list must not leave empty parent shells.** A wipe keeps `.viable`, `.env`, the
321
+ web package's `.env` and `.git` whatever the caller asked, so a directory holding a kept path is
322
+ walked and pruned rather than removed — and a keep that was not there (the web `.env` every
323
+ project without local branding lacks) must not leave the walked directory behind as a skeleton the
324
+ install then lands in.
325
+ - **An absolute path from elsewhere on the machine is re-rooted inside the project**, not refused —
326
+ the publisher's own behaviour, kept deliberately and pinned by a test. Concatenating it onto the
327
+ root instead builds a shadow tree: the write reports success, a later read of the same name
328
+ resolves to the untouched original, and the change looks silently ignored. `resolveInProject`
329
+ (exported as `confineToProject`) then compares the fully resolved path to the root — confinement,
330
+ not sanitization, and applied on **every** fs call rather than a `..`-to-`.` replace at one caller.
331
+ - **`run/state.ts` sits below both the shell commands and the run**, so the three do not form a
332
+ cycle: `DbSync` bounces the api child, `DbSync` is a shell command, and the shell commands are
333
+ reached through the executor the run is built on. Everything that touches a child process lives
334
+ there, and the run record is a file because the processes outlive the call — and, on a restarted
335
+ connector, the process — that started them.
336
+
337
+ ## Attaching a session is what writes the project marker
338
+
339
+ `.viable/connect.json` is how a connector started in a directory tomorrow knows which project it
340
+ is, and `attach_project` finds a project by its directory through it. It was declared, read at MCP
341
+ startup and documented in `mcp.md` before anything wrote it — a marker nothing writes is a lookup
342
+ that always misses.
343
+
344
+ `openSession` writes it when the session names a project and a directory, which is the moment the
345
+ directory becomes that project's. Best-effort and idempotent: a session that works is worth more
346
+ than a note about it, and it is skipped when the marker already names the same project. It holds
347
+ no secret and is meant to be committed, which is why the API URL and the slug are in it and the
348
+ token never is.
349
+
350
+ ## The managed block yields to every key the user assigned
351
+
352
+ A `.env` gives the LAST assignment of a key and the platform's block is appended, so a platform line
353
+ silently outranks whatever the user wrote above it. That made the documented promise — everything
354
+ outside the block is yours — false for the one value the platform cannot supply: `DATABASE_URL`, the
355
+ line the setup guide tells people to write. The application connected to the placeholder no matter
356
+ what its owner put in the file.
357
+
358
+ `writeEnv` therefore reads the file with the block cut out, and replaces any block line assigning a
359
+ key the user already assigns with a comment saying so. The rule is about VALUES, not lines: a key the
360
+ user has not claimed is still the platform's to set, and a key they later delete goes back to the
361
+ platform on the next push.
362
+
363
+ ## The two services a local project needs are ASKED for, never assumed
364
+
365
+ The platform provisions nothing on somebody's own machine, so a database — and, for a project with a
366
+ worker, a queue store — is the one thing it cannot supply and must not guess. `local_setup_guide`
367
+ reports what the machine already provides and, where something is missing, returns a QUESTION with
368
+ three answers: the user already has one, wants one installed here, or wants a free hosted plan.
369
+ Guessing means either a container on somebody's machine they did not ask for, or a connection string
370
+ invented for a database that does not exist — and the second surfaces minutes later as a boot error
371
+ about a connection, which sends the reader looking for a database rather than for a typo.
372
+
373
+ `set_local_service` records what they answered: it writes the value into the project's own half of
374
+ the `.env`, replacing that key rather than appending a second copy, and PROBES it immediately, so a
375
+ string that does not connect is caught while the user is still in the conversation. A credential
376
+ never reaches the marker, a harness configuration, or the platform, and the guide warns when the
377
+ file is not git-ignored.
378
+
379
+ ## A detached child outlives the connector, so the port is RECLAIMED before it is used
380
+
381
+ Every target process is spawned detached — that is what keeps a build from dying with the tool that
382
+ started it — and detaching is also why a connector killed mid-run (a host restart, a Ctrl-C, a
383
+ crashed test) leaves one alive. What survives holds port 3000, and the next attempt fails with the
384
+ TARGET's own "the api port is already in use", which reads as a defect in the generated app rather
385
+ than as a leftover.
386
+
387
+ Two rules, both ported from the publisher because a laptop needs them more than a pod does:
388
+ - `killGroupAndWait` never returns early on the child's own exit code. The child is a shell wrapping
389
+ `bun`, so a signal the shell dies from leaves `bun` alive while `exitCode` says gone; the wait
390
+ polls the GROUP instead of the child's exit event.
391
+ - `reclaimPort` runs before a spawn as well as after one, and matches on the script AND the process
392
+ marker (`--viable-api`, `--viable-worker`, `--viable-boot-check`) — never a port alone, and never
393
+ a marker alone, since reclaiming sends SIGKILL and a marker on its own matches any command line
394
+ that merely mentions it.
395
+
396
+ ## Running the generated app locally
397
+
398
+ `runLocal` builds and starts the api, the worker (when the project has one) and a local server that
399
+ holds the web port and proxies `/api` to the api process on the same origin — the generated app's
400
+ configuration assumes one origin, and splitting them across two loopback ports would put its CORS
401
+ setup in the path of a developer's first page load. There is no respawn ladder, no reconciler and no
402
+ health route: a developer watching their own terminal is the supervisor. What IS reproduced is the
403
+ shape — the same ports, the same argv marker, the same environment, and the same "port ownership is
404
+ the only proof" rule about restarts. Nothing from the publisher's public-hostname policy (robots,
405
+ CSP, the preview error reporter, the build-state header) is reproduced: a loopback address has no
406
+ reputation to spend and no crawler to answer.
407
+
408
+ `run_local` refuses to start a project whose `.env` is still missing a required key, because an app
409
+ launched without a database URL fails at boot with a message about a connection, which sends the
410
+ reader looking for a database that was never configured.
411
+
412
+ ## Tests
413
+
414
+ `bun test ./tests` — offline: the envelope and its parser, the harness installer, the tool catalogue,
415
+ the `registerCatalogue` out-of-credits and planning-refusal phrasing and `notify` wiring
416
+ (`mcp-catalogue.spec.ts`), the executor's files/git/layout rules, and the marker + managed-`.env`
417
+ block. The story tools run over a REAL `@owlmeans/server-planning` service (memory store, the Viable
418
+ types and flows, one plugin standing in for the platform's format seam) built in `tests/context.ts`;
419
+ `planning-wiring.spec.ts` pins the planning aliases and paths a context binds, and `remote.spec.ts`
420
+ drives the remote facade through a captured transport to pin its deadlines.
421
+
422
+ ## Depends On
423
+
424
+ - `@owlmeans/viable-common` — the whole wire contract · `@owlmeans/auth-token` — the carrier guard
425
+ - `@owlmeans/planning` — the protocol tree, the facade contract and its refusals ·
426
+ `@owlmeans/client-planning` — the remote facade and the long-poll commit wait
427
+ - `@owlmeans/api`, `@owlmeans/client-context`, `@owlmeans/client-entrypoint`, `@owlmeans/client-config`,
428
+ `@owlmeans/auth-common`, `@owlmeans/entrypoint`, `@owlmeans/route`, `@owlmeans/socket`,
429
+ `@owlmeans/config`, `@owlmeans/context`, `@owlmeans/error`, `@owlmeans/basic-ids`
430
+ - `@modelcontextprotocol/sdk` (types only, structurally), `zod`, `fs-extra`, `globby`, `ajv`
431
+
432
+ ## Related
433
+
434
+ - [[viable-mcp]] — the npx stdio server built on this
435
+ - [[auth-token]] — the credential and its carrier guard
436
+ - [[client-planning]] · [[planning]] — the facade the story tools write through
437
+ - `@owlmeans/llm-delegate` (`internal` monorepo, skill `llm-delegate`) — the other end of a model
438
+ task, inside the platform
@@ -18,6 +18,11 @@ export declare const recoverLongPoll: <T>(poll: () => Promise<T>, snapshot: () =
18
18
  * tool that outlives its host's ceiling is reported to the user as a broken server, and the true
19
19
  * answer — the platform was slow — never reaches them. Anything that legitimately takes longer is
20
20
  * a job, and a job returns at once.
21
+ *
22
+ * `planning` is the facade `makeSdkContext` registered with `appendPlanningClient`: its reads and
23
+ * its execute POST carry the same tool deadline, and a commit is awaited by long polls whose HTTP
24
+ * deadline outlasts their own hold by ten seconds. Its scope is empty on purpose — the platform
25
+ * reads the organization and the profile from the token.
21
26
  */
22
27
  export declare const makeRemoteConnectorApi: (context: Ctx) => ConnectorApi;
23
28
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/api/remote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAS3E,OAAO,KAAK,EAAE,YAAY,EAA6C,MAAM,aAAa,CAAA;AAE1F,KAAK,GAAG,GAAG,aAAa,CAAC,YAAY,CAAC,CAAA;AAOtC,4FAA4F;AAC5F,eAAO,MAAM,yBAAyB,UAAW,OAAO,KAAG,OAgB1D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAU,CAAC,QAC/B,MAAM,OAAO,CAAC,CAAC,CAAC,YAAY,MAAM,OAAO,CAAC,CAAC,CAAC,KACjD,OAAO,CAAC,CAAC,CAQX,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,YAAa,GAAG,KAAG,YA0IrD,CAAA"}
1
+ {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/api/remote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAS3E,OAAO,KAAK,EAAE,YAAY,EAAiC,MAAM,aAAa,CAAA;AAE9E,KAAK,GAAG,GAAG,aAAa,CAAC,YAAY,CAAC,CAAA;AAOtC,4FAA4F;AAC5F,eAAO,MAAM,yBAAyB,UAAW,OAAO,KAAG,OAgB1D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAU,CAAC,QAC/B,MAAM,OAAO,CAAC,CAAC,CAAC,YAAY,MAAM,OAAO,CAAC,CAAC,CAAC,KACjD,OAAO,CAAC,CAAC,CAQX,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,YAAa,GAAG,KAAG,YAuHrD,CAAA"}
@@ -1,3 +1,4 @@
1
+ import { planningOf } from '@owlmeans/client-planning';
1
2
  import { connectRef } from '@owlmeans/viable-common';
2
3
  import { TOOL_DEADLINE_MS } from '../consts.js';
3
4
  const TRANSIENT_TRANSPORT_CODES = new Set([
@@ -45,6 +46,11 @@ export const recoverLongPoll = async (poll, snapshot) => {
45
46
  * tool that outlives its host's ceiling is reported to the user as a broken server, and the true
46
47
  * answer — the platform was slow — never reaches them. Anything that legitimately takes longer is
47
48
  * a job, and a job returns at once.
49
+ *
50
+ * `planning` is the facade `makeSdkContext` registered with `appendPlanningClient`: its reads and
51
+ * its execute POST carry the same tool deadline, and a commit is awaited by long polls whose HTTP
52
+ * deadline outlasts their own hold by ten seconds. Its scope is empty on purpose — the platform
53
+ * reads the organization and the profile from the token.
48
54
  */
49
55
  export const makeRemoteConnectorApi = (context) => {
50
56
  return {
@@ -105,23 +111,7 @@ export const makeRemoteConnectorApi = (context) => {
105
111
  : await recoverLongPoll(async () => await read(waitSec), async () => await read(0));
106
112
  },
107
113
  },
108
- story: {
109
- list: async (id, query) => await context.entrypoint(connectRef.story.list).call({
110
- params: { id }, query: query ?? {}, timeout: TOOL_DEADLINE_MS,
111
- }),
112
- get: async (id, storyId) => await context
113
- .entrypoint(connectRef.story.get).call({ params: { id, storyId }, timeout: TOOL_DEADLINE_MS }),
114
- create: async (id, story) => await context
115
- .entrypoint(connectRef.story.create).call({ params: { id }, body: { story }, timeout: TOOL_DEADLINE_MS }),
116
- update: async (id, storyId, story) => await context.entrypoint(connectRef.story.update).call({
117
- params: { id, storyId }, body: { story }, timeout: TOOL_DEADLINE_MS,
118
- }),
119
- remove: async (id, storyId) => await context
120
- .entrypoint(connectRef.story.delete).call({ params: { id, storyId }, timeout: TOOL_DEADLINE_MS }),
121
- develop: async (id, storyId) => await context.entrypoint(connectRef.story.develop).call({
122
- params: { id, storyId }, timeout: TOOL_DEADLINE_MS,
123
- }),
124
- },
114
+ planning: planningOf(context, {}),
125
115
  files: {
126
116
  list: async (id) => await context.entrypoint(connectRef.files.list).call({
127
117
  params: { id }, timeout: TOOL_DEADLINE_MS,
@@ -1 +1 @@
1
- {"version":3,"file":"remote.js","sourceRoot":"","sources":["../../src/api/remote.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAOpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAK/C,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC;IACxC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,yBAAyB;IAC7E,yBAAyB,EAAE,gBAAgB;CAC5C,CAAC,CAAA;AAEF,4FAA4F;AAC5F,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,KAAc,EAAW,EAAE;IACnE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAW,CAAA;IAC/B,IAAI,OAAO,GAAY,KAAK,CAAA;IAE5B,OAAO,OAAO,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QACjB,MAAM,KAAK,GAAG,OAAiE,CAAA;QAC/E,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,yBAAyB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAA;QAC5F,MAAM,OAAO,GAAG,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QACnF,IAAI,oGAAoG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,C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;SAC5F;QAED,OAAO,EAAE;YACP,MAAM,EAAE,KAAK,EAAE,EAAU,EAAE,SAAiB,EAAE,MAA4B,EAAE,EAAE;YAC5E,0FAA0F;YAC1F,qEAAqE;YACrE,MAAM,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;gBACvD,MAAM,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,gBAAgB;aACrF,CAAC;SACL;KACF,CAAA;AACH,CAAC,CAAA"}
package/build/consts.d.ts CHANGED
@@ -25,6 +25,19 @@ export declare const TOOL_DEADLINE_MS = 45000;
25
25
  * was given failed on every poll that ran the full window.
26
26
  */
27
27
  export declare const JOB_POLL_MAX_SEC = 30;
28
+ /**
29
+ * How long a story tool waits for its planning transition to COMMIT, in milliseconds.
30
+ *
31
+ * Well under {@link TOOL_DEADLINE_MS}: the same call has already resolved the story and posted the
32
+ * transition, and on the platform a person's narrative is re-formatted by a model before it is
33
+ * appended. A commit that is late is not a failure — the transition is durable and nothing is
34
+ * undone — so `develop_story` answers from the job row instead of waiting out the host's ceiling.
35
+ */
36
+ export declare const COMMIT_WAIT_MS = 20000;
37
+ /** How long one long poll of a commit may hold, in seconds — what the platform holds at most for a connector. */
38
+ export declare const COMMIT_POLL_SEC = 20;
39
+ /** How many stories one page of `list_stories` carries when the caller names no size. */
40
+ export declare const STORY_PAGE_SIZE = 25;
28
41
  /** How long `next_task` waits before answering "nothing yet". Under every host's ceiling. */
29
42
  export declare const NEXT_TASK_WAIT_MS = 30000;
30
43
  /**