@bounded-sh/client 0.0.100-performance.0 → 0.0.100

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 (64) hide show
  1. package/README.md +83 -0
  2. package/dist/auth/turnkey-auth.d.ts +4 -1
  3. package/dist/builds/client.d.ts +50 -5
  4. package/dist/builds/index.d.ts +6 -1
  5. package/dist/builds/media-tools.d.ts +37 -0
  6. package/dist/builds/types.d.ts +316 -16
  7. package/dist/{email-auth-provider-BGTfU1_i.mjs → email-auth-provider-BJXeBUwp.mjs} +2 -2
  8. package/dist/{email-auth-provider-CIRbOSM3.mjs.map → email-auth-provider-BJXeBUwp.mjs.map} +1 -1
  9. package/dist/{email-auth-provider-C6SFJd9L.js → email-auth-provider-Cr3I4Po5.js} +2 -2
  10. package/dist/{email-auth-provider-C6SFJd9L.js.map → email-auth-provider-Cr3I4Po5.js.map} +1 -1
  11. package/dist/{email-auth-provider-CIRbOSM3.mjs → email-auth-provider-Ct3YA68i.mjs} +2 -2
  12. package/dist/{email-auth-provider-BGTfU1_i.mjs.map → email-auth-provider-Ct3YA68i.mjs.map} +1 -1
  13. package/dist/{email-auth-provider-Cpj8hIFu.js → email-auth-provider-DCZ93FYg.js} +2 -2
  14. package/dist/{email-auth-provider-Cpj8hIFu.js.map → email-auth-provider-DCZ93FYg.js.map} +1 -1
  15. package/dist/{guest-auth-provider-0PjGFGDm.js → guest-auth-provider--Sqlucfr.js} +2 -2
  16. package/dist/{guest-auth-provider-0PjGFGDm.js.map → guest-auth-provider--Sqlucfr.js.map} +1 -1
  17. package/dist/{guest-auth-provider-pC-AheTZ.js → guest-auth-provider-CPj-w7_R.js} +2 -2
  18. package/dist/{guest-auth-provider-pC-AheTZ.js.map → guest-auth-provider-CPj-w7_R.js.map} +1 -1
  19. package/dist/{guest-auth-provider-DVxlea-z.mjs → guest-auth-provider-CUo6sgop.mjs} +2 -2
  20. package/dist/{guest-auth-provider-DVxlea-z.mjs.map → guest-auth-provider-CUo6sgop.mjs.map} +1 -1
  21. package/dist/{guest-auth-provider-C23vWrOT.mjs → guest-auth-provider-DMtDTZeA.mjs} +2 -2
  22. package/dist/{guest-auth-provider-C23vWrOT.mjs.map → guest-auth-provider-DMtDTZeA.mjs.map} +1 -1
  23. package/dist/{index-DmAXYXDi.mjs → index-CaZx7sd8.mjs} +687 -142
  24. package/dist/index-CaZx7sd8.mjs.map +1 -0
  25. package/dist/{index-DUVRmF9-.js → index-Pyb2SLgv.js} +689 -141
  26. package/dist/index-Pyb2SLgv.js.map +1 -0
  27. package/dist/index.d.ts +4 -0
  28. package/dist/index.js +4 -1
  29. package/dist/index.js.map +1 -1
  30. package/dist/index.mjs +1 -1
  31. package/dist/{index.native-r1I-9E8e.mjs → index.native-3T0IcOed.mjs} +370 -9
  32. package/dist/index.native-3T0IcOed.mjs.map +1 -0
  33. package/dist/{index.native-CllNqdoy.js → index.native-PGrxu7RO.js} +370 -8
  34. package/dist/index.native-PGrxu7RO.js.map +1 -0
  35. package/dist/index.native.js +2 -1
  36. package/dist/index.native.js.map +1 -1
  37. package/dist/index.native.mjs +1 -1
  38. package/dist/{injected-evm-wallet-provider-BPZMEE8I.mjs → injected-evm-wallet-provider-B3Mtkdnu.mjs} +2 -2
  39. package/dist/{injected-evm-wallet-provider-BPZMEE8I.mjs.map → injected-evm-wallet-provider-B3Mtkdnu.mjs.map} +1 -1
  40. package/dist/{injected-evm-wallet-provider-BXM8TfS3.js → injected-evm-wallet-provider-BNu6Z-iN.js} +2 -2
  41. package/dist/{injected-evm-wallet-provider-BXM8TfS3.js.map → injected-evm-wallet-provider-BNu6Z-iN.js.map} +1 -1
  42. package/dist/{injected-evm-wallet-provider-CkhN5u3d.mjs → injected-evm-wallet-provider-C8rBnyO1.mjs} +2 -2
  43. package/dist/{injected-evm-wallet-provider-CkhN5u3d.mjs.map → injected-evm-wallet-provider-C8rBnyO1.mjs.map} +1 -1
  44. package/dist/{injected-evm-wallet-provider-Dq3FDV1M.js → injected-evm-wallet-provider-U0XJu5HM.js} +2 -2
  45. package/dist/{injected-evm-wallet-provider-Dq3FDV1M.js.map → injected-evm-wallet-provider-U0XJu5HM.js.map} +1 -1
  46. package/dist/{injected-wallet-provider-Bi_mB_q3.js → injected-wallet-provider-29eTkM-A.js} +2 -2
  47. package/dist/injected-wallet-provider-29eTkM-A.js.map +1 -0
  48. package/dist/{injected-wallet-provider-BlSdRbgq.mjs → injected-wallet-provider-BnmYbm79.mjs} +2 -2
  49. package/dist/injected-wallet-provider-BnmYbm79.mjs.map +1 -0
  50. package/dist/{injected-wallet-provider-B3LLEpfp.js → injected-wallet-provider-Cv9RELO6.js} +2 -2
  51. package/dist/injected-wallet-provider-Cv9RELO6.js.map +1 -0
  52. package/dist/{injected-wallet-provider-CLLhLBAJ.mjs → injected-wallet-provider-DR8xVudg.mjs} +2 -2
  53. package/dist/injected-wallet-provider-DR8xVudg.mjs.map +1 -0
  54. package/dist/services/broadcast.d.ts +28 -0
  55. package/dist/services/session.d.ts +28 -0
  56. package/package.json +2 -2
  57. package/dist/index-DUVRmF9-.js.map +0 -1
  58. package/dist/index-DmAXYXDi.mjs.map +0 -1
  59. package/dist/index.native-CllNqdoy.js.map +0 -1
  60. package/dist/index.native-r1I-9E8e.mjs.map +0 -1
  61. package/dist/injected-wallet-provider-B3LLEpfp.js.map +0 -1
  62. package/dist/injected-wallet-provider-Bi_mB_q3.js.map +0 -1
  63. package/dist/injected-wallet-provider-BlSdRbgq.mjs.map +0 -1
  64. package/dist/injected-wallet-provider-CLLhLBAJ.mjs.map +0 -1
package/README.md CHANGED
@@ -183,6 +183,89 @@ const watcher = builds.watch(app.appId, submitted.runId, ({ run, events }) => {
183
183
  // watcher.stop();
184
184
  ```
185
185
 
186
+ #### Media builds
187
+
188
+ An image or video is a build too: pass a `deliverable`. Each design round serves
189
+ candidates; a decision names the one it approves or revises. Publication lands a
190
+ release on the app's media asset through the same landing policy as an app change,
191
+ and a release can be edited, forked or rolled back.
192
+
193
+ ```typescript
194
+ const image = await builds.submit(appId, {
195
+ operation: 'create',
196
+ prompt: 'A launch poster for a late-night jazz club',
197
+ deliverable: { kind: 'image', spec: { size: '1024x1536', candidates: 2 } },
198
+ idempotencyKey,
199
+ });
200
+
201
+ // While a round is under review (run.design.gate):
202
+ await builds.decideGate(appId, image.runId, gateId, {
203
+ decision: 'request_changes',
204
+ feedback: { text: 'Add a full moon above the club' },
205
+ selectedArtifactId: 'c1',
206
+ region: { x: 200, y: 100, width: 600, height: 300 }, // only this rectangle changes
207
+ idempotencyKey: 'moon',
208
+ });
209
+ await builds.decideGate(appId, image.runId, gateId, { decision: 'approve', selectedArtifactId: 'c1', idempotencyKey: 'pick' });
210
+
211
+ // After publication: the verified release, a signed download, an edit of that exact release.
212
+ const { asset } = await builds.media(appId, image.runId);
213
+ const { url } = await builds.mediaDownloadUrl(appId, image.runId, 'c1');
214
+ await builds.submit(appId, {
215
+ operation: 'edit',
216
+ prompt: 'Make the lettering gold',
217
+ deliverable: { kind: 'image', assetId: asset.assetId, expectedReleaseId: asset.currentRelease!.releaseId },
218
+ idempotencyKey: 'gold',
219
+ });
220
+ ```
221
+
222
+ An application build can use released images of its app, pinned by digest:
223
+ `mediaSlots` places each image byte for byte at `/media/<slot>.<ext>` in the app,
224
+ so a later edit of the image never changes the app until an app edit pins the new
225
+ release.
226
+
227
+ ```typescript
228
+ await builds.submit(appId, {
229
+ operation: 'edit',
230
+ prompt: 'Use the launch poster as the hero image',
231
+ mediaSlots: [{ slot: 'hero-image', assetId: asset.assetId }],
232
+ idempotencyKey: 'hero',
233
+ });
234
+ ```
235
+
236
+ A multi-scene video names its scenes and captions; a `request_changes` with
237
+ `sceneIds` regenerates only those scenes, an edit with `replaceScenes` replaces
238
+ one scene and keeps every other clip byte for byte, and a captions-only edit
239
+ makes no generation call.
240
+
241
+ Every release stays retained, with its alternatives and scene clips, for edits,
242
+ forks and rollback. A build that ends without a release is collected a week
243
+ after it ends, and an app that retains 20 GiB of media builds is refused new
244
+ ones with `media_storage_quota`.
245
+
246
+ #### Agent tools for media builds
247
+
248
+ `mediaAgentTools(appId)` returns the builds client as tool declarations for an
249
+ agent: `media_create`, `media_edit`, `media_inspect`, `media_revise`,
250
+ `media_select`, `media_export` and `media_propose`. Each has a name, a
251
+ description and a JSON Schema `inputSchema` to offer a model, and an `execute`
252
+ that returns `{ ok, data, next }` or `{ ok: false, code, message, retryable, next }`,
253
+ where `next` names the operations that make sense from the run's state and `code`
254
+ is Build's own reason when the API relays one (`base_moved`, `candidate_unknown`). A request
255
+ the run cannot take (no open review, an unknown candidate, a region outside a PNG
256
+ candidate) is refused with its reason before any call is made. No tool publishes:
257
+ `media_propose` reports whether the chosen candidate awaits the owner's landing
258
+ decision or is already released.
259
+
260
+ ```typescript
261
+ import { mediaAgentTools } from '@bounded-sh/client';
262
+
263
+ const tools = mediaAgentTools(appId);
264
+ const declarations = tools.map(({ name, description, inputSchema }) => ({ name, description, input_schema: inputSchema }));
265
+ // When the model calls a tool:
266
+ const result = await tools.find((tool) => tool.name === call.name)!.execute(call.input);
267
+ ```
268
+
186
269
  ## Usage
187
270
 
188
271
  ### Get Current User
@@ -2,7 +2,10 @@ import type { User } from '@bounded-sh/core';
2
2
  export interface TurnkeyEmailLoginHandle {
3
3
  /** The email the code was sent to (echo, for the widget's "code sent to ..." line). */
4
4
  email: string;
5
- /** Scoped frames remain mounted for later signing. */
5
+ /**
6
+ * App-scoped wallets: the signer document the signing bridge mounts AFTER login. The login
7
+ * code itself is never typed there (BSA-2026-004); `run()` always drives the Bounded OTP frame.
8
+ */
6
9
  frameUrl?: string;
7
10
  signerOrigin?: string;
8
11
  /**
@@ -1,4 +1,4 @@
1
- import type { BuildCancelResponse, BuildDelegatedReviewCapabilityResponse, BuildEventsResponse, BuildGateDecisionResponse, BuildGetResponse, BuildListResponse, BuildReviewAudience, BuildReviewCapabilityRefreshResponse, BuildsApiErrorDetails, BuildSubmitResponse, BuildTopupResponse } from './types';
1
+ import type { BuildCancelResponse, BuildDelegatedReviewCapabilityResponse, BuildDesignFeedback, BuildEventsResponse, BuildGateDecisionResponse, BuildGetResponse, BuildImageDeliverable, BuildVideoDeliverable, BuildListResponse, BuildMediaDownloadUrlResponse, BuildMediaResponse, BuildMediaRollbackResponse, BuildReviewAudience, BuildReviewCapabilityRefreshResponse, BuildsApiErrorDetails, BuildSubmitResponse, BuildTopupResponse } from './types';
2
2
  type BuildIdempotencyOptions = {
3
3
  /** Caller-minted wire key (1-256 characters), passed through unchanged. */
4
4
  idempotencyKey: string;
@@ -41,6 +41,18 @@ export type BuildSubmitOptions = {
41
41
  diff: string;
42
42
  proposalId: string;
43
43
  };
44
+ /** Deliver an image instead of an application: generated, reviewed in design rounds, and released as an asset. */
45
+ deliverable?: BuildImageDeliverable | BuildVideoDeliverable;
46
+ /**
47
+ * An application build's pinned media: released images of this app written byte for byte to `media/<slot>.<ext>`
48
+ * (served at `/media/<slot>.<ext>`). `releaseId` pins a retained release; without it the asset's current release is
49
+ * pinned when the build is admitted, so a later edit of the image never changes this app.
50
+ */
51
+ mediaSlots?: Array<{
52
+ slot: string;
53
+ assetId: string;
54
+ releaseId?: string;
55
+ }>;
44
56
  } & BuildIdempotencyOptions;
45
57
  export interface BuildInputArtifact {
46
58
  artifactId: string;
@@ -62,8 +74,23 @@ export declare function uploadInput(appId: string, options: {
62
74
  * replace a caller-minted `idempotencyKey` and survives refresh replays.
63
75
  */
64
76
  export type BuildGateDecisionOptions = {
65
- decision: 'approve' | 'reject';
77
+ /** `request_changes` answers a design review only, and needs a note or feedback that asks for a change. */
78
+ decision: 'approve' | 'reject' | 'request_changes';
66
79
  note?: string;
80
+ /** Structured answer to a design review, sent beside `note`. */
81
+ feedback?: BuildDesignFeedback;
82
+ /** An image build's chosen candidate (`c1`...): the one approved, or the one a `request_changes` revises. */
83
+ selectedArtifactId?: string;
84
+ /** A multi-scene video's `request_changes`: the scenes of that candidate to regenerate; every other scene is kept. */
85
+ sceneIds?: string[];
86
+ /** An image's `request_changes`: the rectangle of that PNG candidate to change, in whole pixels; every pixel outside it
87
+ * is kept exactly. */
88
+ region?: {
89
+ x: number;
90
+ y: number;
91
+ width: number;
92
+ height: number;
93
+ };
67
94
  } & BuildIdempotencyOptions;
68
95
  /**
69
96
  * Exact owner-rendered approval review capability plus one durable
@@ -104,11 +131,16 @@ export declare class BuildsApiError<TDetails = BuildsApiErrorDetails> extends Er
104
131
  readonly status: number;
105
132
  /**
106
133
  * Developer-api error details, preserved verbatim. For
107
- * `project_limit_exceeded`, `usage`, `limit`, and `dimension` are all present
108
- * (the exact shape is exported as `ProjectLimitExceededDetails`).
134
+ * `project_daily_limit_exceeded`, `usage`, `limit`, `dimension`, `windowMs`,
135
+ * and `resetsAtMs` are all present (the exact shape is exported as
136
+ * `ProjectDailyLimitExceededDetails`).
109
137
  */
110
138
  readonly details?: TDetails;
111
- /** Parsed Retry-After delay, when a 429 response supplied one. */
139
+ /**
140
+ * Parsed Retry-After delay, when a 429 response supplied one. A
141
+ * `project_daily_limit_exceeded` refusal carries it whenever `resetsAtMs` is
142
+ * not null.
143
+ */
112
144
  readonly retryAfterMs?: number;
113
145
  constructor(init: BuildsApiErrorInit<TDetails>);
114
146
  }
@@ -126,6 +158,19 @@ export declare function refreshReviewCapability(appId: string, runId: string, ga
126
158
  * authority.
127
159
  */
128
160
  export declare function getReviewCapability(appId: string, runId: string, gateId: string, options: BuildDelegatedReviewCapabilityOptions): Promise<BuildDelegatedReviewCapabilityResponse>;
161
+ /**
162
+ * Add funds to a run parked for funding. Accounts billed through payer shards refuse it with
163
+ * `topup_unavailable_payer_shard` (in `details.upstreamCode`): a parked run there holds no money, so the payer adds
164
+ * credits and submits the build again.
165
+ */
129
166
  export declare function topup(appId: string, runId: string, options: BuildTopupOptions): Promise<BuildTopupResponse>;
167
+ /** An image build's verified images and its asset's current release. */
168
+ export declare function media(appId: string, runId: string): Promise<BuildMediaResponse>;
169
+ /** A short-lived signed URL for one image of an image build (usable directly as an image source). */
170
+ export declare function mediaDownloadUrl(appId: string, runId: string, artifactId: string): Promise<BuildMediaDownloadUrlResponse>;
171
+ /** Roll back the release an image build published: its asset returns to the release it replaced. */
172
+ export declare function rollbackMedia(appId: string, runId: string, options?: {
173
+ note?: string;
174
+ }): Promise<BuildMediaRollbackResponse>;
130
175
  export declare function list(appId: string, limit?: number): Promise<BuildListResponse>;
131
176
  export {};
@@ -1,4 +1,4 @@
1
- import { cancel, decideGate, events, get, getReviewCapability, list, refreshReviewCapability, submit, topup, uploadInput } from './client';
1
+ import { cancel, decideGate, events, get, getReviewCapability, list, media, mediaDownloadUrl, refreshReviewCapability, rollbackMedia, submit, topup, uploadInput } from './client';
2
2
  import { watch } from './watch';
3
3
  /**
4
4
  * Registered first-party product surfaces only, with
@@ -17,8 +17,13 @@ export declare const builds: {
17
17
  uploadInput: typeof uploadInput;
18
18
  list: typeof list;
19
19
  watch: typeof watch;
20
+ media: typeof media;
21
+ mediaDownloadUrl: typeof mediaDownloadUrl;
22
+ rollbackMedia: typeof rollbackMedia;
20
23
  };
21
24
  export { BuildsApiError } from './client';
25
+ export { mediaAgentTools } from './media-tools';
26
+ export type { MediaAgentTool, MediaToolName, MediaToolResult, MediaToolsClient } from './media-tools';
22
27
  export type { BuildGateDecisionOptions, BuildDelegatedReviewCapabilityOptions, BuildReviewCapabilityRefreshOptions, BuildSubmitOptions, BuildTopupOptions, BuildInputArtifact, } from './client';
23
28
  export type { BuildRunWatchHandle, BuildRunWatchOptions, BuildRunWatchUpdate, } from './watch';
24
29
  export * from './types';
@@ -0,0 +1,37 @@
1
+ import { decideGate as decideGateRequest, get as getRequest, media as mediaRequest, mediaDownloadUrl as mediaDownloadUrlRequest, submit as submitRequest } from './client';
2
+ /**
3
+ * AGENT TOOLS FOR MEDIA BUILDS: the builds client as tool declarations an agent framework can offer a model (a name, a
4
+ * description and a JSON Schema for the input) with an executor for each.
5
+ *
6
+ * An agent creates, inspects, revises, compares and selects within the app's build policy, and exports what was made. It
7
+ * never publishes: a media release lands through the app's landing policy, so `media_propose` only reports where the
8
+ * candidate stands and who decides. Every result names the operations that make sense next, and a request the run cannot
9
+ * take is answered with a code and the reason instead of being attempted.
10
+ */
11
+ export type MediaToolName = 'media_create' | 'media_edit' | 'media_inspect' | 'media_revise' | 'media_select' | 'media_export' | 'media_propose';
12
+ export type MediaToolResult = {
13
+ ok: true;
14
+ data: Record<string, unknown>;
15
+ next: MediaToolName[];
16
+ } | {
17
+ ok: false;
18
+ code: string;
19
+ message: string;
20
+ retryable: boolean;
21
+ next: MediaToolName[];
22
+ };
23
+ export interface MediaAgentTool {
24
+ name: MediaToolName;
25
+ description: string;
26
+ inputSchema: Record<string, unknown>;
27
+ execute(input: unknown): Promise<MediaToolResult>;
28
+ }
29
+ /** The client calls the tools make; the SDK's own by default (tests and other transports substitute). */
30
+ export interface MediaToolsClient {
31
+ submit: typeof submitRequest;
32
+ get: typeof getRequest;
33
+ decideGate: typeof decideGateRequest;
34
+ media: typeof mediaRequest;
35
+ mediaDownloadUrl: typeof mediaDownloadUrlRequest;
36
+ }
37
+ export declare function mediaAgentTools(appId: string, client?: MediaToolsClient): MediaAgentTool[];
@@ -1,8 +1,8 @@
1
1
  export declare const NON_TERMINAL_STATES: readonly ["queued", "admitted", "executing", "preview_ready", "parked", "resuming", "promoting", "quarantined"];
2
2
  export declare const TERMINAL_STATES: readonly ["promoted", "failed", "canceled", "rejected", "expired", "rebase_required", "reported"];
3
3
  export declare const RUN_STATES: readonly ["queued", "admitted", "executing", "preview_ready", "parked", "resuming", "promoting", "quarantined", "promoted", "failed", "canceled", "rejected", "expired", "rebase_required", "reported"];
4
- export declare const PARK_REASONS: readonly ["gate", "funding"];
5
- export declare const FAILURE_REASONS: readonly ["admission_rejected", "dispatch_timeout", "auth_revoked", "owner_changed", "policy_changed", "quarantine_forced", "bind_failed", "internal_error"];
4
+ export declare const PARK_REASONS: readonly ["gate", "funding", "preview", "design"];
5
+ export declare const FAILURE_REASONS: readonly ["admission_rejected", "dispatch_timeout", "auth_revoked", "owner_changed", "policy_changed", "target_retired", "promotion_rejected", "quarantine_forced", "bind_failed", "internal_error"];
6
6
  export type NonTerminalState = (typeof NON_TERMINAL_STATES)[number];
7
7
  export type TerminalState = (typeof TERMINAL_STATES)[number];
8
8
  export type RunState = (typeof RUN_STATES)[number];
@@ -60,6 +60,253 @@ export type BuildDelegatedReviewCapabilityView = BuildDelegatedReviewCapabilityB
60
60
  state: 'decided';
61
61
  decision: 'approve' | 'reject';
62
62
  });
63
+ /** One choice a single-choice design question offers. */
64
+ export interface BuildRunDesignQuestionOption {
65
+ id: string;
66
+ label: string;
67
+ /** Short supporting detail for the choice. */
68
+ hint?: string;
69
+ }
70
+ /**
71
+ * A design assumption the owner can confirm or change. `single` offers 2-4
72
+ * options and `current` names the one the prototype already shows; `text`
73
+ * asks for a short free answer and carries no options.
74
+ */
75
+ export interface BuildRunDesignQuestion {
76
+ /** Unique within its round. */
77
+ id: string;
78
+ /** Short topic, such as "Layout". */
79
+ label: string;
80
+ /** The question itself, one line. */
81
+ prompt: string;
82
+ kind: 'single' | 'text';
83
+ options?: BuildRunDesignQuestionOption[];
84
+ /** The option id the prototype already implements. */
85
+ current?: string;
86
+ /** The design surface this question is about, when it is about one. */
87
+ surfaceId?: string;
88
+ }
89
+ /** One design round the owner has seen. */
90
+ export interface BuildRunDesignRound {
91
+ round: number;
92
+ prototypeUrl?: string;
93
+ shots: number;
94
+ /** Screenshots of the round's served prototype, one per viewport. */
95
+ renders?: Array<{
96
+ viewport: string;
97
+ url: string;
98
+ }>;
99
+ /** The questions that round asked. */
100
+ questions?: BuildRunDesignQuestion[];
101
+ /**
102
+ * How the round's design review was decided. Known decisions are approve,
103
+ * request_changes, cancel, reject, skip and retry; `summary` is the first
104
+ * line of the decision note.
105
+ */
106
+ decision?: {
107
+ decision: string;
108
+ summary?: string;
109
+ decidedAt: string;
110
+ };
111
+ /** The previous round's requested changes could not be applied, so this round shows that prototype again. */
112
+ revisionFailed?: boolean;
113
+ /** A media build's candidates for this round; a decision chooses one with `selectedArtifactId`. */
114
+ candidates?: BuildRunImageCandidate[];
115
+ }
116
+ /** One candidate a design round served (an image, or a `video/mp4` clip with its duration). */
117
+ export interface BuildRunImageCandidate {
118
+ id: string;
119
+ /** Absent when the round was served without a web address (a local Bind); the candidate is still chosen by id. */
120
+ url?: string;
121
+ mimeType: string;
122
+ width: number;
123
+ height: number;
124
+ /** A clip's duration. */
125
+ durationMs?: number;
126
+ /** A multi-scene video's scenes in play order: a `request_changes` names the ones to regenerate (`sceneIds`). */
127
+ scenes?: Array<{
128
+ id: string;
129
+ durationMs: number;
130
+ url?: string;
131
+ }>;
132
+ }
133
+ /** What an image build delivers: its sizing, quality, output format and references. Everything is optional. */
134
+ export interface BuildImageSpec {
135
+ size?: '1024x1024' | '1024x1536' | '1536x1024';
136
+ quality?: 'low' | 'medium' | 'high' | 'xhigh' | 'max';
137
+ format?: 'png' | 'webp' | 'jpeg';
138
+ background?: 'opaque' | 'transparent';
139
+ /** Candidates per review round, 1 to 4 (default 2). */
140
+ candidates?: number;
141
+ /** `default` is the quality image model; `fast` is its faster sibling. */
142
+ model?: 'default' | 'fast';
143
+ /** Image attachments of the same submission the model takes as references. */
144
+ references?: Array<{
145
+ attachmentId: string;
146
+ role: 'subject' | 'style' | 'composition';
147
+ }>;
148
+ /**
149
+ * Edit (or fork) of a released PNG only: the rectangle, in the released image's pixels, that may change. Every pixel
150
+ * outside it stays exactly the release's (verified before the edit is released). Requires PNG output.
151
+ */
152
+ region?: {
153
+ x: number;
154
+ y: number;
155
+ width: number;
156
+ height: number;
157
+ };
158
+ }
159
+ /**
160
+ * An image deliverable. A create generates a new asset of the app; an edit revises the asset's current release, named
161
+ * by `assetId`, optionally asserting the release it expects (`expectedReleaseId`).
162
+ */
163
+ export interface BuildImageDeliverable {
164
+ kind: 'image';
165
+ spec?: BuildImageSpec;
166
+ assetId?: string;
167
+ expectedReleaseId?: string;
168
+ /** Create only: start a new asset from any retained release of this app's assets (a fork of that revision). */
169
+ forkOf?: BuildMediaForkOf;
170
+ }
171
+ /** A retained release a create forks into a new asset. */
172
+ export interface BuildMediaForkOf {
173
+ assetId: string;
174
+ releaseId: string;
175
+ }
176
+ /** What a video build delivers. Everything is optional; an edit keeps its released clip's duration and aspect. */
177
+ export interface BuildVideoSpec {
178
+ /** Whole seconds, 4-30 (default 5). Not on an edit. */
179
+ durationSeconds?: number;
180
+ /** Default `720p`; an edit keeps its released clip's. */
181
+ resolution?: '480p' | '720p';
182
+ /** Default `16:9`. Not with a first frame, whose aspect the clip takes, and not on an edit. */
183
+ aspectRatio?: '16:9' | '4:3' | '1:1' | '3:4' | '9:16' | '21:9';
184
+ /** Generate sound. Default false; an edit keeps its released clip's. */
185
+ audio?: boolean;
186
+ /** Alternatives per round, 1-2 (default 1). */
187
+ candidates?: number;
188
+ model?: 'default';
189
+ /**
190
+ * Image inputs, at most 4: an image attachment of the same submission or a released image asset of this app, as the
191
+ * first frame, the last frame (with a first frame) or a reference. An edit takes references only.
192
+ */
193
+ images?: Array<({
194
+ attachmentId: string;
195
+ } | {
196
+ assetId: string;
197
+ }) & {
198
+ role: 'first_frame' | 'last_frame' | 'reference';
199
+ }>;
200
+ /** Create: a multi-scene video's scenes (1-6 of 4-15 s, 30 s in all), rendered into one video with its captions. */
201
+ scenes?: BuildVideoScene[];
202
+ /** Edit of a multi-scene release: the scenes to regenerate; every other scene keeps its released clip exactly. */
203
+ replaceScenes?: Array<Omit<BuildVideoScene, 'durationSeconds'> & {
204
+ durationSeconds?: number;
205
+ }>;
206
+ /** Captions burned into a multi-scene video (on an edit they replace the released ones; absent, they are kept). An
207
+ * edit that only changes captions makes no generation call. */
208
+ captions?: BuildVideoCaption[];
209
+ }
210
+ /** One scene of a multi-scene video. */
211
+ export interface BuildVideoScene {
212
+ /** `s1` to `s6`, unique; scenes play in order. */
213
+ id: string;
214
+ prompt: string;
215
+ durationSeconds: number;
216
+ /** Reference images for this scene. */
217
+ images?: Array<({
218
+ attachmentId: string;
219
+ } | {
220
+ assetId: string;
221
+ }) & {
222
+ role: 'reference';
223
+ }>;
224
+ }
225
+ /** A caption burned into a multi-scene video, in milliseconds of the finished video. */
226
+ export interface BuildVideoCaption {
227
+ startMs: number;
228
+ endMs: number;
229
+ text: string;
230
+ }
231
+ /**
232
+ * A video deliverable. A create generates a new clip asset of the app; an edit revises the asset's current release, named
233
+ * by `assetId`, optionally asserting the release it expects (`expectedReleaseId`).
234
+ */
235
+ export interface BuildVideoDeliverable {
236
+ kind: 'video';
237
+ spec?: BuildVideoSpec;
238
+ assetId?: string;
239
+ expectedReleaseId?: string;
240
+ /** Create only: start a new clip asset from any retained video release of this app (a fork of that revision). */
241
+ forkOf?: BuildMediaForkOf;
242
+ }
243
+ /** A media build's facts of one image or clip: a clip also carries its duration and whether it has sound. */
244
+ export interface BuildMediaArtifact {
245
+ id: string;
246
+ sha256: string;
247
+ bytes: number;
248
+ mimeType: string;
249
+ width: number;
250
+ height: number;
251
+ durationMs?: number;
252
+ hasAudio?: boolean;
253
+ }
254
+ /** A media build's asset, the verified images of its approved round (or its chosen clip), and the release it published. */
255
+ export interface BuildRunMediaView {
256
+ kind: 'image' | 'video';
257
+ assetId: string;
258
+ baseReleaseId?: string;
259
+ /** The retained release a fork started this asset from. */
260
+ forkOf?: BuildMediaForkOf;
261
+ selectedArtifactId?: string;
262
+ artifacts?: BuildMediaArtifact[];
263
+ /** A multi-scene video: each scene's verified clip and its captions. */
264
+ scenes?: BuildMediaScene[];
265
+ captions?: BuildVideoCaption[];
266
+ releaseId?: string;
267
+ }
268
+ /** A multi-scene video's scene as released. */
269
+ export interface BuildMediaScene {
270
+ id: string;
271
+ sha256: string;
272
+ bytes: number;
273
+ durationMs: number;
274
+ prompt: string;
275
+ }
276
+ /** One published release of a media asset. */
277
+ export interface BuildMediaRelease {
278
+ releaseId: string;
279
+ runId: string;
280
+ prevReleaseId: string | null;
281
+ artifact: BuildMediaArtifact;
282
+ scenes?: BuildMediaScene[];
283
+ captions?: BuildVideoCaption[];
284
+ releasedAtMs: number;
285
+ }
286
+ export interface BuildMediaResponse {
287
+ wire: 1;
288
+ runId: string;
289
+ media: BuildRunMediaView | null;
290
+ asset: {
291
+ assetId: string;
292
+ currentRelease: BuildMediaRelease | null;
293
+ };
294
+ }
295
+ export interface BuildMediaDownloadUrlResponse {
296
+ wire: 1;
297
+ runId: string;
298
+ artifactId: string;
299
+ /** A short-lived signed URL serving exactly this image. */
300
+ url: string;
301
+ expiresAtMs: number;
302
+ }
303
+ export interface BuildMediaRollbackResponse {
304
+ wire: 1;
305
+ runId: string;
306
+ replayed: boolean;
307
+ /** The asset's release after the rollback (null when a create's release was rolled back). */
308
+ currentReleaseId: string | null;
309
+ }
63
310
  /** The owner's design view of a design-first run: the prototype, every round seen, and the open design decision while
64
311
  * the build waits on it (absent once decided). */
65
312
  export interface BuildRunDesignView {
@@ -76,13 +323,13 @@ export interface BuildRunDesignView {
76
323
  id: string;
77
324
  title: string;
78
325
  }>;
326
+ /** One-line summary of the round on screen. */
327
+ summary?: string;
328
+ /** The on-screen round's questions. Show them only while `gate` is open. */
329
+ questions?: BuildRunDesignQuestion[];
79
330
  round?: number;
80
331
  maxRounds?: number;
81
- rounds?: Array<{
82
- round: number;
83
- prototypeUrl?: string;
84
- shots: number;
85
- }>;
332
+ rounds?: BuildRunDesignRound[];
86
333
  gate?: {
87
334
  gateId: string;
88
335
  allowedDecisions: string[];
@@ -130,6 +377,20 @@ export interface BuildRunClientView {
130
377
  };
131
378
  /** Owner-only design view: what an owner needs to answer a design review. */
132
379
  design?: BuildRunDesignView;
380
+ /** Owner-only: an image build's asset, verified images, and published release. */
381
+ media?: BuildRunMediaView;
382
+ /** Owner-only: the released images an application build pinned, and where the app serves each. */
383
+ mediaSlots?: Array<{
384
+ slot: string;
385
+ assetId: string;
386
+ releaseId: string;
387
+ sha256: string;
388
+ bytes: number;
389
+ mimeType: string;
390
+ width: number;
391
+ height: number;
392
+ file: string;
393
+ }>;
133
394
  createdAtMs: number;
134
395
  updatedAtMs: number;
135
396
  }
@@ -157,23 +418,37 @@ export interface BuildRunListRow {
157
418
  };
158
419
  }
159
420
  /**
160
- * Extensible developer-api error details. Project-limit errors populate the
161
- * typed fields below; other error codes may add arbitrary fields.
421
+ * Extensible developer-api error details. Quota refusals populate the typed
422
+ * fields below; other error codes may add arbitrary fields.
162
423
  */
163
424
  export interface BuildsApiErrorDetails {
164
- /** Current usage when `code === "project_limit_exceeded"`. */
425
+ /** Creations counted inside the window when `code === "project_daily_limit_exceeded"`. */
165
426
  usage?: number;
166
- /** Allowed usage when `code === "project_limit_exceeded"`. */
427
+ /** Creations the window allows when `code === "project_daily_limit_exceeded"`. */
167
428
  limit?: number;
168
- /** Limit axis (for example, `maxProjects`) when a quota gate rejects. */
429
+ /** Limit axis (for example, `maxProjectCreatesPerDay`) when a quota gate rejects. */
169
430
  dimension?: string;
431
+ /** Length of the rolling window in milliseconds when a windowed quota gate rejects. */
432
+ windowMs?: number;
433
+ /**
434
+ * When the oldest counted creation leaves the window and one unit of capacity
435
+ * returns; `null` when nothing will free up (a limit of 0).
436
+ */
437
+ resetsAtMs?: number | null;
170
438
  [key: string]: unknown;
171
439
  }
172
- /** Exact details supplied with a `project_limit_exceeded` error. */
173
- export interface ProjectLimitExceededDetails extends BuildsApiErrorDetails {
440
+ /**
441
+ * Exact details supplied with a `project_daily_limit_exceeded` error (HTTP 429):
442
+ * a Free account has used its rolling 24-hour project-create allowance.
443
+ * The response also carries `Retry-After` when `resetsAtMs` is not null, which
444
+ * the SDK surfaces as `BuildsApiError.retryAfterMs`.
445
+ */
446
+ export interface ProjectDailyLimitExceededDetails extends BuildsApiErrorDetails {
174
447
  usage: number;
175
448
  limit: number;
176
- dimension: string;
449
+ dimension: 'maxProjectCreatesPerDay';
450
+ windowMs: number;
451
+ resetsAtMs: number | null;
177
452
  }
178
453
  export interface BuildsApiErrorEnvelope {
179
454
  error: {
@@ -207,9 +482,34 @@ export interface BuildGateDecisionResponse {
207
482
  runId: string;
208
483
  targetAppId: string;
209
484
  gateId: string;
210
- decision: 'approve' | 'reject';
485
+ decision: 'approve' | 'reject' | 'request_changes';
211
486
  state: string;
212
487
  }
488
+ /** One answer to a design question: `optionId` for a `single` question, `text` for a `text` question. */
489
+ export interface BuildDesignAnswer {
490
+ questionId: string;
491
+ optionId?: string;
492
+ text?: string;
493
+ }
494
+ /**
495
+ * Structured design review feedback. The builder validates it: answers must
496
+ * name the open round's questions, and confirming only the options the
497
+ * prototype already shows is not a requested change.
498
+ */
499
+ export interface BuildDesignFeedback {
500
+ text?: string;
501
+ answers?: BuildDesignAnswer[];
502
+ /** Notes on specific design surfaces, by surface id. */
503
+ surfaces?: Array<{
504
+ id: string;
505
+ note: string;
506
+ }>;
507
+ /** Reference links for the designer. */
508
+ attachments?: Array<{
509
+ url: string;
510
+ name?: string;
511
+ }>;
512
+ }
213
513
  export interface BuildDelegatedReviewCapabilityResponse {
214
514
  wire: 1;
215
515
  capability: BuildDelegatedReviewCapabilityView;
@@ -1,5 +1,5 @@
1
1
  import { getActiveSessionManager } from '@bounded-sh/core';
2
- import { s as setCurrentUser, h as hasTurnkeyWallet, a as signMessageWithTurnkey, b as signTransactionWithTurnkey, c as signTransactionV1WithTurnkey, d as signAndSubmitTransactionWithTurnkey, g as getPlatform } from './index-DmAXYXDi.mjs';
2
+ import { s as setCurrentUser, h as hasTurnkeyWallet, a as signMessageWithTurnkey, b as signTransactionWithTurnkey, c as signTransactionV1WithTurnkey, d as signAndSubmitTransactionWithTurnkey, g as getPlatform } from './index-CaZx7sd8.mjs';
3
3
  import 'react';
4
4
 
5
5
  // Web uses localStorage (WebSessionManager); React Native uses the configured
@@ -93,4 +93,4 @@ class EmailAuthProvider {
93
93
  const emailProviderSingleton = new EmailAuthProvider();
94
94
 
95
95
  export { EmailAuthProvider, emailProviderSingleton };
96
- //# sourceMappingURL=email-auth-provider-BGTfU1_i.mjs.map
96
+ //# sourceMappingURL=email-auth-provider-BJXeBUwp.mjs.map