@managoat/fountain-sdk 5.1.0 → 5.2.0

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.
package/CHANGELOG.md CHANGED
@@ -11,6 +11,12 @@ server releases.
11
11
 
12
12
  ---
13
13
 
14
+ ## [5.2.0] - 2026-09-15
15
+
16
+ ### Added
17
+
18
+ - `runRequest(request, options)` forwards API-shaped conversation inputs, with generated `ConversationInput` types and separate local run options (#2228).
19
+
14
20
  ## [5.1.0] — 2026-09-14
15
21
 
16
22
  ### Added
package/README.md CHANGED
@@ -456,3 +456,29 @@ release containing the credit-only server contract (`c3349343`).
456
456
  `insufficient_credits` and a generic HTTP 402 identify the credit gate.
457
457
  `subscription_required` has no special mapping; it follows the HTTP status.
458
458
  The response still exposes its original code and purchase URL.
459
+
460
+ ### API-shaped launches
461
+
462
+ Use `client.runRequest(request, options)` to send any conversation creation
463
+ field using its API name. `ConversationInput` is derived from OpenAPI; new
464
+ fields require regeneration, not a new helper option.
465
+
466
+ ```ts
467
+ await client.runRequest({
468
+ agent_id: agent.id,
469
+ prompt: "Review the repository",
470
+ labels: { source: "nightly" },
471
+ sandbox_api_access: "none",
472
+ }, { timeoutMs: 120_000, collectEvents: true });
473
+ ```
474
+
475
+ This path uses IDs directly and forwards values unchanged, including explicit
476
+ null, false and empty collections. Omitted properties stay omitted. Local run
477
+ options are a separate argument. It does not combine raw fields with the
478
+ name-based options of `run(prompt, config)`; existing `run` calls still work.
479
+ A run needs a non-empty prompt and cannot queue (`queue: true` is refused
480
+ before HTTP). Use `client.api.request` for promptless or queued creation.
481
+
482
+ With `channel_id`, `runRequest` follows turn 1 when the server creates a
483
+ conversation, including fresh launches. When the server resumes a channel,
484
+ it submits the prompt and images to that conversation and follows the next turn.
package/dist/client.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { ConversationInput } from "./schemas.ts";
1
2
  import { HttpClient, type FetchLike, type RequestOptions } from "./http.ts";
2
3
  import { type ConfigOptions, type ResolvedConfig } from "./config.ts";
3
4
  import { Run, type RunOptions } from "./run.ts";
@@ -89,6 +90,12 @@ export declare class Fountain {
89
90
  * starts either way.
90
91
  */
91
92
  run(prompt: string, config: RunConfig): Run;
93
+ /**
94
+ * Run an API-shaped launch request using IDs, without name resolution.
95
+ * Every request field goes to the server; local execution settings stay in
96
+ * options. For a promptless or queued creation, use api.request instead.
97
+ */
98
+ runRequest(request: ConversationInput, options?: RunOptions): Run;
92
99
  /**
93
100
  * Pick a conversation back up. The sandbox is still there and so is the
94
101
  * agent's session — `send` costs one prompt, not a re-explanation.
package/dist/client.js CHANGED
@@ -98,6 +98,40 @@ export class Fountain {
98
98
  },
99
99
  }, options);
100
100
  }
101
+ /**
102
+ * Run an API-shaped launch request using IDs, without name resolution.
103
+ * Every request field goes to the server; local execution settings stay in
104
+ * options. For a promptless or queued creation, use api.request instead.
105
+ */
106
+ runRequest(request, options = {}) {
107
+ if (typeof request.prompt !== "string" || !request.prompt.trim()) {
108
+ throw new TypeError("runRequest requires a non-empty prompt; use api.request for promptless creation");
109
+ }
110
+ if (request.queue != null && request.queue !== false) {
111
+ throw new TypeError("runRequest does not support queued creation; use api.request");
112
+ }
113
+ const body = { ...request };
114
+ return new Run(this.api, {
115
+ start: async () => {
116
+ const response = await this.api.request("POST", "/api/conversations", { body });
117
+ const conversation = response.data;
118
+ if (response.meta?.resumed === true) {
119
+ // Resume only binds the channel; it does not submit the launch prompt.
120
+ // Capture history before sending, so fast turns cannot be skipped.
121
+ const after = await this.resume(conversation.id).cursor();
122
+ const turnNumber = await this.nextTurnNumber(conversation.id);
123
+ const promptBody = { prompt: body.prompt };
124
+ if (body.images !== undefined)
125
+ promptBody.images = body.images;
126
+ await this.api.request("POST", `/api/conversations/${conversation.id}/prompts`, {
127
+ body: promptBody,
128
+ });
129
+ return { conversation, turnNumber, after };
130
+ }
131
+ return { conversation, turnNumber: 1, after: 0 };
132
+ },
133
+ }, options);
134
+ }
101
135
  /**
102
136
  * Pick a conversation back up. The sandbox is still there and so is the
103
137
  * agent's session — `send` costs one prompt, not a re-explanation.
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAuC,MAAM,WAAW,CAAC;AAC5E,OAAO,EAAE,aAAa,EAA2C,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,GAAG,EAAmB,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,UAAU,EAAsB,MAAM,UAAU,CAAC;AA4D1D;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,QAAQ;IACnB,gFAAgF;IACvE,GAAG,CAAa;IAChB,MAAM,CAAiB;IAEhC,8CAA8C;IACrC,MAAM,CAAS;IACxB,sCAAsC;IAC7B,YAAY,CAAe;IACpC,gCAAgC;IACvB,MAAM,CAAS;IACxB,6DAA6D;IACpD,IAAI,CAAO;IACpB,6EAA6E;IACpE,WAAW,CAAc;IAEjB,QAAQ,CAAW;IAEpC,YAAY,UAA2B,EAAE;QACvC,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE;YACrC,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,SAAS,EAAE,OAAO,CAAC,SAAS;SAC7B,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,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E,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IACpF,CAAC;CACF"}
@@ -3712,7 +3712,7 @@ export interface components {
3712
3712
  /** @enum {string} */
3713
3713
  runtime: "claude" | "codex" | "gemini" | "opencode" | "acp" | "fountain-fixture";
3714
3714
  runtime_session_id?: string | null;
3715
- sandbox?: components["schemas"]["Sandbox"] | null;
3715
+ sandbox?: (components["schemas"]["Sandbox"] | (null)) | null;
3716
3716
  /**
3717
3717
  * @description Immutable sandbox callback credential policy. none never issues a callback token.
3718
3718
  * @enum {string}
@@ -5082,7 +5082,7 @@ export interface components {
5082
5082
  prompt?: string;
5083
5083
  status?: string;
5084
5084
  turn_number?: number;
5085
- usage?: components["schemas"]["TurnUsage"] | null;
5085
+ usage?: (components["schemas"]["TurnUsage"] | (null)) | null;
5086
5086
  } | null;
5087
5087
  /** @description What the teammate is called: the conversation's title, else the agent's name. */
5088
5088
  name: string;
@@ -5165,7 +5165,7 @@ export interface components {
5165
5165
  status: "pending" | "running" | "completed" | "failed" | "interrupted";
5166
5166
  turn_number: number;
5167
5167
  /** @description The end-of-turn token figure; null while the turn runs, when the runtime reported none, or on turns that predate the field. */
5168
- usage?: components["schemas"]["TurnUsage"] | null;
5168
+ usage?: (components["schemas"]["TurnUsage"] | (null)) | null;
5169
5169
  /** @description The turn ended with a permission request still open (#1635): the agent answered with stop reason `waiting`, the turn is `completed` and the request is on the conversation as a `pending_requests` entry. */
5170
5170
  waiting?: boolean;
5171
5171
  };
package/dist/http.d.ts CHANGED
@@ -15,7 +15,7 @@ export interface RequestOptions {
15
15
  * this string is already what Fountain's request logs are keyed on. The
16
16
  * version half is asserted against `package.json` by a test.
17
17
  */
18
- export declare const USER_AGENT = "fountain-sdk-js/5.1.0";
18
+ export declare const USER_AGENT = "fountain-sdk-js/5.2.0";
19
19
  export declare class HttpClient {
20
20
  readonly config: ResolvedConfig;
21
21
  private readonly fetchImpl;
package/dist/http.js CHANGED
@@ -5,7 +5,7 @@ import { AuthError, ConnectionError, FountainError, errorForStatus } from "./err
5
5
  * this string is already what Fountain's request logs are keyed on. The
6
6
  * version half is asserted against `package.json` by a test.
7
7
  */
8
- export const USER_AGENT = "fountain-sdk-js/5.1.0";
8
+ export const USER_AGENT = "fountain-sdk-js/5.2.0";
9
9
  /**
10
10
  * The thin layer everything else is built on: one bearer token, JSON in and
11
11
  * out, and errors that say which call failed. `Fountain#api` exposes it
package/dist/schemas.d.ts CHANGED
@@ -31,6 +31,8 @@ export type VaultInput = S["VaultRequest"];
31
31
  export type VaultPatch = S["VaultUpdate"];
32
32
  /** One run of an agent inside a sandbox. */
33
33
  export type ConversationRecord = S["Conversation"];
34
+ /** The API launch body, with wire names and server-owned validation. */
35
+ export type ConversationInput = S["ConversationCreateRequest"];
34
36
  /** A machine, with the conversations on it. */
35
37
  export type SandboxRecord = S["SandboxDetail"];
36
38
  /** One directory on a sandbox, directories first (ADR 0039). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managoat/fountain-sdk",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "description": "Run a coding agent on a real computer, with your repos and your credentials, in one call.",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -51,7 +51,7 @@
51
51
  "prepublishOnly": "node scripts/ci-publishes.mjs && npm run typecheck && npm test && npm run build"
52
52
  },
53
53
  "devDependencies": {
54
- "@redocly/ajv": "8.11.2",
54
+ "@redocly/ajv": "8.18.3",
55
55
  "@types/node": "^26.4.0",
56
56
  "openapi-typescript": "^7.13.0",
57
57
  "typescript": "^5.7.0"