@sudobility/screenwriter_types 0.1.1

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 (65) hide show
  1. package/CLAUDE.md +50 -0
  2. package/README.md +34 -0
  3. package/dist/account/index.d.ts +440 -0
  4. package/dist/account/index.js +274 -0
  5. package/dist/admin/index.d.ts +95 -0
  6. package/dist/admin/index.js +20 -0
  7. package/dist/ai/index.d.ts +564 -0
  8. package/dist/ai/index.js +179 -0
  9. package/dist/api/envelope.d.ts +33 -0
  10. package/dist/api/envelope.js +140 -0
  11. package/dist/api/pagination.d.ts +7 -0
  12. package/dist/api/pagination.js +9 -0
  13. package/dist/api/routes.d.ts +273 -0
  14. package/dist/api/routes.js +306 -0
  15. package/dist/assets/index.d.ts +722 -0
  16. package/dist/assets/index.js +452 -0
  17. package/dist/collab/index.d.ts +214 -0
  18. package/dist/collab/index.js +211 -0
  19. package/dist/commands/index.d.ts +92 -0
  20. package/dist/commands/index.js +20 -0
  21. package/dist/credits/index.d.ts +26 -0
  22. package/dist/credits/index.js +7 -0
  23. package/dist/formats/index.d.ts +87 -0
  24. package/dist/formats/index.js +26 -0
  25. package/dist/ids/index.d.ts +2 -0
  26. package/dist/ids/index.js +2 -0
  27. package/dist/index.d.ts +33 -0
  28. package/dist/index.js +33 -0
  29. package/dist/io/index.d.ts +395 -0
  30. package/dist/io/index.js +161 -0
  31. package/dist/jobs/index.d.ts +278 -0
  32. package/dist/jobs/index.js +138 -0
  33. package/dist/keys/index.d.ts +53 -0
  34. package/dist/keys/index.js +22 -0
  35. package/dist/lifecycle/index.d.ts +263 -0
  36. package/dist/lifecycle/index.js +148 -0
  37. package/dist/me/index.d.ts +35 -0
  38. package/dist/me/index.js +18 -0
  39. package/dist/packets/index.d.ts +887 -0
  40. package/dist/packets/index.js +312 -0
  41. package/dist/projects/index.d.ts +201 -0
  42. package/dist/projects/index.js +75 -0
  43. package/dist/public/index.d.ts +95 -0
  44. package/dist/public/index.js +25 -0
  45. package/dist/reads/index.d.ts +387 -0
  46. package/dist/reads/index.js +118 -0
  47. package/dist/reports/index.d.ts +168 -0
  48. package/dist/reports/index.js +466 -0
  49. package/dist/sharing/index.d.ts +256 -0
  50. package/dist/sharing/index.js +91 -0
  51. package/dist/sync/codec.d.ts +7 -0
  52. package/dist/sync/codec.js +91 -0
  53. package/dist/sync/index.d.ts +382 -0
  54. package/dist/sync/index.js +262 -0
  55. package/dist/sync/permissions.d.ts +22 -0
  56. package/dist/sync/permissions.js +11 -0
  57. package/dist/templates/index.d.ts +1699 -0
  58. package/dist/templates/index.js +70 -0
  59. package/dist/tenancy/index.d.ts +116 -0
  60. package/dist/tenancy/index.js +102 -0
  61. package/dist/test/index.d.ts +8 -0
  62. package/dist/test/index.js +88 -0
  63. package/dist/versions/index.d.ts +335 -0
  64. package/dist/versions/index.js +107 -0
  65. package/package.json +62 -0
@@ -0,0 +1,564 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * AI features (spec 06): script review and polish through ShapeShyft.
4
+ *
5
+ * Only the tasks implemented so far are in `AI_TASKS`; adding one means a registry row in
6
+ * `screenwriter_api/src/services/ai/tasks.ts`, a prompt builder, an output schema here and a fixture.
7
+ * Output schemas are written for structured output: every field is required (nullable, never optional)
8
+ * and objects are closed, so `z.toJSONSchema` gives the exact schema to store on the ShapeShyft endpoint.
9
+ */
10
+ export declare const AI_TASKS: readonly ["coverage", "polish.dialogue"];
11
+ export type AiTask = (typeof AI_TASKS)[number];
12
+ export declare const aiTaskSchema: z.ZodEnum<{
13
+ coverage: "coverage";
14
+ "polish.dialogue": "polish.dialogue";
15
+ }>;
16
+ /** ShapeShyft endpoint names (spec 06 2.1). `summarize-chunk` is stage 1 of a long coverage run. */
17
+ export declare const AI_ENDPOINTS: readonly ["coverage-review", "polish", "summarize-chunk"];
18
+ export type AiEndpoint = (typeof AI_ENDPOINTS)[number];
19
+ export declare const AI_JOB_STATUSES: readonly ["queued", "running", "succeeded", "failed", "cancelled"];
20
+ export type AiJobStatus = (typeof AI_JOB_STATUSES)[number];
21
+ /** Counted limits, declared once: schemas, validators and prompt text all read these. */
22
+ export declare const AI_LIMITS: {
23
+ readonly noteTitleMax: 80;
24
+ readonly noteBodyMax: 1200;
25
+ readonly noteAnchorsMax: 8;
26
+ readonly strengthsMax: 8;
27
+ readonly weaknessesMax: 12;
28
+ readonly sceneNotesMax: 20;
29
+ readonly loglineMax: 300;
30
+ readonly summaryMax: 4000;
31
+ readonly genreMax: 3;
32
+ readonly verdictRationaleMax: 800;
33
+ readonly polishSuggestionsMax: 200;
34
+ readonly polishTextMax: 4000;
35
+ readonly rationaleMax: 400;
36
+ readonly chunkSummaryMax: 1200;
37
+ readonly sceneSummaryMax: 280;
38
+ readonly polishMaxScenes: 8;
39
+ readonly instructionsMax: 500;
40
+ };
41
+ export declare const REVIEW_CATEGORIES: readonly ["premise", "structure", "character", "dialogue", "pacing", "tone", "theme", "worldbuilding", "format", "marketability", "clarity", "continuity"];
42
+ export type ReviewCategory = (typeof REVIEW_CATEGORIES)[number];
43
+ export declare const SEVERITIES: readonly ["praise", "minor", "moderate", "major"];
44
+ export type Severity = (typeof SEVERITIES)[number];
45
+ export declare const COVERAGE_VERDICTS: readonly ["recommend", "consider", "pass"];
46
+ /** Where a note points. `elementId: null` means the whole scene. The server adds the content hash. */
47
+ export declare const anchorRefSchema: z.ZodObject<{
48
+ sceneId: z.ZodString;
49
+ elementId: z.ZodNullable<z.ZodString>;
50
+ }, z.core.$strip>;
51
+ export type AnchorRef = z.infer<typeof anchorRefSchema>;
52
+ export declare const noteSchema: z.ZodObject<{
53
+ category: z.ZodEnum<{
54
+ format: "format";
55
+ premise: "premise";
56
+ structure: "structure";
57
+ character: "character";
58
+ dialogue: "dialogue";
59
+ pacing: "pacing";
60
+ tone: "tone";
61
+ theme: "theme";
62
+ worldbuilding: "worldbuilding";
63
+ marketability: "marketability";
64
+ clarity: "clarity";
65
+ continuity: "continuity";
66
+ }>;
67
+ severity: z.ZodEnum<{
68
+ praise: "praise";
69
+ minor: "minor";
70
+ moderate: "moderate";
71
+ major: "major";
72
+ }>;
73
+ title: z.ZodString;
74
+ body: z.ZodString;
75
+ anchors: z.ZodArray<z.ZodObject<{
76
+ sceneId: z.ZodString;
77
+ elementId: z.ZodNullable<z.ZodString>;
78
+ }, z.core.$strip>>;
79
+ }, z.core.$strip>;
80
+ export type ModelNote = z.infer<typeof noteSchema>;
81
+ /** `coverage-review` output. */
82
+ export declare const coverageResponseSchema: z.ZodObject<{
83
+ logline: z.ZodString;
84
+ summary: z.ZodString;
85
+ genre: z.ZodArray<z.ZodString>;
86
+ strengths: z.ZodArray<z.ZodObject<{
87
+ category: z.ZodEnum<{
88
+ format: "format";
89
+ premise: "premise";
90
+ structure: "structure";
91
+ character: "character";
92
+ dialogue: "dialogue";
93
+ pacing: "pacing";
94
+ tone: "tone";
95
+ theme: "theme";
96
+ worldbuilding: "worldbuilding";
97
+ marketability: "marketability";
98
+ clarity: "clarity";
99
+ continuity: "continuity";
100
+ }>;
101
+ severity: z.ZodEnum<{
102
+ praise: "praise";
103
+ minor: "minor";
104
+ moderate: "moderate";
105
+ major: "major";
106
+ }>;
107
+ title: z.ZodString;
108
+ body: z.ZodString;
109
+ anchors: z.ZodArray<z.ZodObject<{
110
+ sceneId: z.ZodString;
111
+ elementId: z.ZodNullable<z.ZodString>;
112
+ }, z.core.$strip>>;
113
+ }, z.core.$strip>>;
114
+ weaknesses: z.ZodArray<z.ZodObject<{
115
+ category: z.ZodEnum<{
116
+ format: "format";
117
+ premise: "premise";
118
+ structure: "structure";
119
+ character: "character";
120
+ dialogue: "dialogue";
121
+ pacing: "pacing";
122
+ tone: "tone";
123
+ theme: "theme";
124
+ worldbuilding: "worldbuilding";
125
+ marketability: "marketability";
126
+ clarity: "clarity";
127
+ continuity: "continuity";
128
+ }>;
129
+ severity: z.ZodEnum<{
130
+ praise: "praise";
131
+ minor: "minor";
132
+ moderate: "moderate";
133
+ major: "major";
134
+ }>;
135
+ title: z.ZodString;
136
+ body: z.ZodString;
137
+ anchors: z.ZodArray<z.ZodObject<{
138
+ sceneId: z.ZodString;
139
+ elementId: z.ZodNullable<z.ZodString>;
140
+ }, z.core.$strip>>;
141
+ }, z.core.$strip>>;
142
+ sceneNotes: z.ZodArray<z.ZodObject<{
143
+ category: z.ZodEnum<{
144
+ format: "format";
145
+ premise: "premise";
146
+ structure: "structure";
147
+ character: "character";
148
+ dialogue: "dialogue";
149
+ pacing: "pacing";
150
+ tone: "tone";
151
+ theme: "theme";
152
+ worldbuilding: "worldbuilding";
153
+ marketability: "marketability";
154
+ clarity: "clarity";
155
+ continuity: "continuity";
156
+ }>;
157
+ severity: z.ZodEnum<{
158
+ praise: "praise";
159
+ minor: "minor";
160
+ moderate: "moderate";
161
+ major: "major";
162
+ }>;
163
+ title: z.ZodString;
164
+ body: z.ZodString;
165
+ anchors: z.ZodArray<z.ZodObject<{
166
+ sceneId: z.ZodString;
167
+ elementId: z.ZodNullable<z.ZodString>;
168
+ }, z.core.$strip>>;
169
+ }, z.core.$strip>>;
170
+ verdict: z.ZodEnum<{
171
+ recommend: "recommend";
172
+ consider: "consider";
173
+ pass: "pass";
174
+ }>;
175
+ verdictRationale: z.ZodString;
176
+ }, z.core.$strip>;
177
+ export type CoverageResponse = z.infer<typeof coverageResponseSchema>;
178
+ /** `polish` output: one proposed replacement per element. */
179
+ export declare const polishResponseSchema: z.ZodObject<{
180
+ suggestions: z.ZodArray<z.ZodObject<{
181
+ elementId: z.ZodString;
182
+ after: z.ZodString;
183
+ rationale: z.ZodString;
184
+ }, z.core.$strip>>;
185
+ }, z.core.$strip>;
186
+ export type PolishResponse = z.infer<typeof polishResponseSchema>;
187
+ /** `summarize-chunk` output (stage 1 of a long-script coverage run). */
188
+ export declare const chunkSummaryResponseSchema: z.ZodObject<{
189
+ scenes: z.ZodArray<z.ZodObject<{
190
+ sceneId: z.ZodString;
191
+ summary: z.ZodString;
192
+ intensity: z.ZodNumber;
193
+ }, z.core.$strip>>;
194
+ chunkSummary: z.ZodString;
195
+ }, z.core.$strip>;
196
+ export type ChunkSummaryResponse = z.infer<typeof chunkSummaryResponseSchema>;
197
+ /** The five input fields every endpoint takes (spec 06 2.1). */
198
+ export declare const aiEndpointInputSchema: z.ZodObject<{
199
+ context: z.ZodString;
200
+ brief: z.ZodString;
201
+ max_output_tokens: z.ZodNumber;
202
+ locale: z.ZodString;
203
+ script_language: z.ZodString;
204
+ }, z.core.$strip>;
205
+ export type AiEndpointInput = z.infer<typeof aiEndpointInputSchema>;
206
+ /** Endpoint -> output schema. `bun run ai:schemas` in screenwriter_api prints these as JSON Schema. */
207
+ export declare const AI_ENDPOINT_OUTPUT_SCHEMAS: {
208
+ readonly 'coverage-review': z.ZodObject<{
209
+ logline: z.ZodString;
210
+ summary: z.ZodString;
211
+ genre: z.ZodArray<z.ZodString>;
212
+ strengths: z.ZodArray<z.ZodObject<{
213
+ category: z.ZodEnum<{
214
+ format: "format";
215
+ premise: "premise";
216
+ structure: "structure";
217
+ character: "character";
218
+ dialogue: "dialogue";
219
+ pacing: "pacing";
220
+ tone: "tone";
221
+ theme: "theme";
222
+ worldbuilding: "worldbuilding";
223
+ marketability: "marketability";
224
+ clarity: "clarity";
225
+ continuity: "continuity";
226
+ }>;
227
+ severity: z.ZodEnum<{
228
+ praise: "praise";
229
+ minor: "minor";
230
+ moderate: "moderate";
231
+ major: "major";
232
+ }>;
233
+ title: z.ZodString;
234
+ body: z.ZodString;
235
+ anchors: z.ZodArray<z.ZodObject<{
236
+ sceneId: z.ZodString;
237
+ elementId: z.ZodNullable<z.ZodString>;
238
+ }, z.core.$strip>>;
239
+ }, z.core.$strip>>;
240
+ weaknesses: z.ZodArray<z.ZodObject<{
241
+ category: z.ZodEnum<{
242
+ format: "format";
243
+ premise: "premise";
244
+ structure: "structure";
245
+ character: "character";
246
+ dialogue: "dialogue";
247
+ pacing: "pacing";
248
+ tone: "tone";
249
+ theme: "theme";
250
+ worldbuilding: "worldbuilding";
251
+ marketability: "marketability";
252
+ clarity: "clarity";
253
+ continuity: "continuity";
254
+ }>;
255
+ severity: z.ZodEnum<{
256
+ praise: "praise";
257
+ minor: "minor";
258
+ moderate: "moderate";
259
+ major: "major";
260
+ }>;
261
+ title: z.ZodString;
262
+ body: z.ZodString;
263
+ anchors: z.ZodArray<z.ZodObject<{
264
+ sceneId: z.ZodString;
265
+ elementId: z.ZodNullable<z.ZodString>;
266
+ }, z.core.$strip>>;
267
+ }, z.core.$strip>>;
268
+ sceneNotes: z.ZodArray<z.ZodObject<{
269
+ category: z.ZodEnum<{
270
+ format: "format";
271
+ premise: "premise";
272
+ structure: "structure";
273
+ character: "character";
274
+ dialogue: "dialogue";
275
+ pacing: "pacing";
276
+ tone: "tone";
277
+ theme: "theme";
278
+ worldbuilding: "worldbuilding";
279
+ marketability: "marketability";
280
+ clarity: "clarity";
281
+ continuity: "continuity";
282
+ }>;
283
+ severity: z.ZodEnum<{
284
+ praise: "praise";
285
+ minor: "minor";
286
+ moderate: "moderate";
287
+ major: "major";
288
+ }>;
289
+ title: z.ZodString;
290
+ body: z.ZodString;
291
+ anchors: z.ZodArray<z.ZodObject<{
292
+ sceneId: z.ZodString;
293
+ elementId: z.ZodNullable<z.ZodString>;
294
+ }, z.core.$strip>>;
295
+ }, z.core.$strip>>;
296
+ verdict: z.ZodEnum<{
297
+ recommend: "recommend";
298
+ consider: "consider";
299
+ pass: "pass";
300
+ }>;
301
+ verdictRationale: z.ZodString;
302
+ }, z.core.$strip>;
303
+ readonly polish: z.ZodObject<{
304
+ suggestions: z.ZodArray<z.ZodObject<{
305
+ elementId: z.ZodString;
306
+ after: z.ZodString;
307
+ rationale: z.ZodString;
308
+ }, z.core.$strip>>;
309
+ }, z.core.$strip>;
310
+ readonly 'summarize-chunk': z.ZodObject<{
311
+ scenes: z.ZodArray<z.ZodObject<{
312
+ sceneId: z.ZodString;
313
+ summary: z.ZodString;
314
+ intensity: z.ZodNumber;
315
+ }, z.core.$strip>>;
316
+ chunkSummary: z.ZodString;
317
+ }, z.core.$strip>;
318
+ };
319
+ export interface Anchor {
320
+ sceneId: string;
321
+ elementId?: string;
322
+ /** Content hash (spec 11 4.2) of the element, or of the scene when there is no elementId, at generation time. */
323
+ contentHash: string;
324
+ }
325
+ export interface AiNote {
326
+ id: string;
327
+ category: ReviewCategory;
328
+ severity: Severity;
329
+ title: string;
330
+ body: string;
331
+ anchors: Anchor[];
332
+ }
333
+ export interface CoverageReport {
334
+ logline: string;
335
+ summary: string;
336
+ genre: string[];
337
+ verdict: (typeof COVERAGE_VERDICTS)[number];
338
+ verdictRationale: string;
339
+ strengths: AiNote[];
340
+ weaknesses: AiNote[];
341
+ notesByScene: {
342
+ sceneId: string;
343
+ heading: string;
344
+ notes: AiNote[];
345
+ }[];
346
+ stats: {
347
+ scenes: number;
348
+ chunks: number;
349
+ droppedItems: number;
350
+ };
351
+ }
352
+ export interface AiTokenUsage {
353
+ promptTokens: number;
354
+ completionTokens: number;
355
+ calls: number;
356
+ model: string | null;
357
+ }
358
+ export declare const aiScopeSchema: z.ZodObject<{
359
+ sceneIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
360
+ elementIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
361
+ }, z.core.$strip>;
362
+ export type AiScope = z.infer<typeof aiScopeSchema>;
363
+ export declare const aiJobOptionsSchema: z.ZodObject<{
364
+ instructions: z.ZodOptional<z.ZodString>;
365
+ intensity: z.ZodOptional<z.ZodEnum<{
366
+ bold: "bold";
367
+ light: "light";
368
+ medium: "medium";
369
+ }>>;
370
+ locale: z.ZodOptional<z.ZodString>;
371
+ }, z.core.$strip>;
372
+ export type AiJobOptions = z.infer<typeof aiJobOptionsSchema>;
373
+ /** `POST /documents/:did/ai/jobs` body. `polish.dialogue` needs a scope; `coverage` defaults to the whole script. */
374
+ export declare const aiJobCreateSchema: z.ZodObject<{
375
+ task: z.ZodEnum<{
376
+ coverage: "coverage";
377
+ "polish.dialogue": "polish.dialogue";
378
+ }>;
379
+ scope: z.ZodOptional<z.ZodObject<{
380
+ sceneIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
381
+ elementIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
382
+ }, z.core.$strip>>;
383
+ options: z.ZodOptional<z.ZodObject<{
384
+ instructions: z.ZodOptional<z.ZodString>;
385
+ intensity: z.ZodOptional<z.ZodEnum<{
386
+ bold: "bold";
387
+ light: "light";
388
+ medium: "medium";
389
+ }>>;
390
+ locale: z.ZodOptional<z.ZodString>;
391
+ }, z.core.$strip>>;
392
+ }, z.core.$strip>;
393
+ export type AiJobCreateRequest = z.infer<typeof aiJobCreateSchema>;
394
+ /** 202 response. */
395
+ export interface AiJobCreated {
396
+ jobId: string;
397
+ status: 'queued';
398
+ }
399
+ export interface AiJobProgress {
400
+ stage: string;
401
+ done: number;
402
+ total: number;
403
+ }
404
+ export interface AiJobError {
405
+ code: string;
406
+ message: string;
407
+ }
408
+ export type AiJobResult = {
409
+ kind: 'report';
410
+ report: CoverageReport;
411
+ }
412
+ /** `suggestionSetId` is null when the model found nothing worth changing (count 0). */
413
+ | {
414
+ kind: 'suggestions';
415
+ suggestionSetId: string | null;
416
+ count: number;
417
+ droppedItems: number;
418
+ };
419
+ /** `GET /ai/jobs/:jobId` and the items of `GET /documents/:did/ai/jobs`. Poll until `status` is final. */
420
+ export interface AiJob {
421
+ id: string;
422
+ documentId: string;
423
+ task: AiTask;
424
+ status: AiJobStatus;
425
+ progress?: AiJobProgress;
426
+ result?: AiJobResult;
427
+ error?: AiJobError;
428
+ promptVersion: string;
429
+ usage?: AiTokenUsage;
430
+ createdAt: string;
431
+ startedAt: string | null;
432
+ finishedAt: string | null;
433
+ }
434
+ export declare const SUGGESTION_STATUSES: readonly ["pending", "accepted", "rejected", "stale"];
435
+ export type SuggestionStatus = (typeof SUGGESTION_STATUSES)[number];
436
+ export declare const SUGGESTION_SET_STATUSES: readonly ["pending", "partiallyAccepted", "accepted", "rejected", "stale", "expired"];
437
+ export type SuggestionSetStatus = (typeof SUGGESTION_SET_STATUSES)[number];
438
+ export interface Suggestion {
439
+ id: string;
440
+ elementId: string;
441
+ kind: 'replaceText';
442
+ before: string;
443
+ after: string;
444
+ rationale: string;
445
+ /** The element's content hash when the suggestion was generated; accepting checks it. */
446
+ contentHash: string;
447
+ status: SuggestionStatus;
448
+ decidedAt: string | null;
449
+ }
450
+ export interface SuggestionSetSummary {
451
+ id: string;
452
+ documentId: string;
453
+ jobId: string;
454
+ task: AiTask;
455
+ promptVersion: string;
456
+ status: SuggestionSetStatus;
457
+ sourceEpoch: number;
458
+ counts: Record<SuggestionStatus, number>;
459
+ createdAt: string;
460
+ }
461
+ export interface SuggestionSet extends SuggestionSetSummary {
462
+ suggestions: Suggestion[];
463
+ }
464
+ export declare const suggestionAcceptSchema: z.ZodObject<{
465
+ suggestionIds: z.ZodArray<z.ZodString>;
466
+ }, z.core.$strip>;
467
+ export type SuggestionAcceptRequest = z.infer<typeof suggestionAcceptSchema>;
468
+ /** `reject` with no ids rejects every pending suggestion in the set. */
469
+ export declare const suggestionRejectSchema: z.ZodObject<{
470
+ suggestionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
471
+ }, z.core.$strip>;
472
+ export type SuggestionRejectRequest = z.infer<typeof suggestionRejectSchema>;
473
+ export interface SuggestionAcceptResponse {
474
+ applied: string[];
475
+ set: SuggestionSet;
476
+ }
477
+ /** `fixture` = canned test-mode answers (AI_TEST_MODE=1); `live` = ShapeShyft configured; `unavailable` = neither. */
478
+ export type AiStatusMode = 'live' | 'fixture' | 'unavailable';
479
+ /** `GET /ai/status`. */
480
+ export interface AiStatus {
481
+ available: boolean;
482
+ mode: AiStatusMode;
483
+ }
484
+ /** Bumping this requires every user to re-accept before their next AI job. */
485
+ export declare const AI_CONSENT_VERSION = 1;
486
+ /** `GET /me/ai-consents`. */
487
+ export interface AiConsentStatus {
488
+ currentVersion: number;
489
+ acceptedVersion: number | null;
490
+ acceptedAt: string | null;
491
+ }
492
+ /** `POST /me/ai-consents`: `version` must equal `AI_CONSENT_VERSION`, else `VALIDATION`. */
493
+ export declare const aiConsentAcceptSchema: z.ZodObject<{
494
+ version: z.ZodNumber;
495
+ }, z.core.$strip>;
496
+ export type AiConsentAcceptRequest = z.infer<typeof aiConsentAcceptSchema>;
497
+ export interface AiConsentAcceptResponse {
498
+ acceptedVersion: number;
499
+ acceptedAt: string;
500
+ }
501
+ /** What a quote was computed from. Pages are approximated from word count until the paginator runs server-side (M2). */
502
+ export interface AiPriceBasis {
503
+ pages: number;
504
+ scopePages?: number;
505
+ }
506
+ export declare const aiEstimateRequestSchema: z.ZodObject<{
507
+ task: z.ZodEnum<{
508
+ coverage: "coverage";
509
+ "polish.dialogue": "polish.dialogue";
510
+ }>;
511
+ scope: z.ZodOptional<z.ZodObject<{
512
+ sceneIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
513
+ elementIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
514
+ }, z.core.$strip>>;
515
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
516
+ }, z.core.$strip>;
517
+ export type AiEstimateRequest = z.infer<typeof aiEstimateRequestSchema>;
518
+ /** `POST /documents/:did/ai/estimate`: the same pricing function `startJob` charges at, run without creating a job. */
519
+ export interface AiEstimateResponse {
520
+ credits: number;
521
+ basis: AiPriceBasis;
522
+ withinLimit: boolean;
523
+ balance: number;
524
+ }
525
+ /** `GET /me/ai-activity`, `GET /workspaces/:wid/ai-activity` (the latter adds `userId`). */
526
+ export interface AiActivityItem {
527
+ jobId: string;
528
+ task: AiTask;
529
+ documentId: string;
530
+ documentTitle: string;
531
+ status: AiJobStatus;
532
+ quotedCredits: number | null;
533
+ chargedCredits: number | null;
534
+ refundedCredits: number | null;
535
+ createdAt: string;
536
+ }
537
+ /** `GET /documents/:did/ai/reports`: a saved coverage/review job, summarised. */
538
+ export interface AiReportSummary {
539
+ jobId: string;
540
+ task: AiTask;
541
+ status: AiJobStatus;
542
+ createdAt: string;
543
+ finishedAt: string | null;
544
+ }
545
+ /** `POST .../reports/:jobId/notes/:noteId/convert`: `noteId` is `"strengths:<i>" | "weaknesses:<i>" | "sceneNotes:<i>"`,
546
+ * the note's position in the immutable stored report (reports have no independently stable note ids). */
547
+ export interface AiNoteConvertResponse {
548
+ scriptNoteId: string;
549
+ }
550
+ export declare const suggestionDecideSchema: z.ZodObject<{
551
+ accept: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"allPending">]>;
552
+ reject: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"allPending">]>;
553
+ expectedHashes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
554
+ dryRun: z.ZodOptional<z.ZodBoolean>;
555
+ }, z.core.$strip>;
556
+ export type SuggestionDecideRequest = z.infer<typeof suggestionDecideSchema>;
557
+ export interface SuggestionDecideResponse {
558
+ accepted: string[];
559
+ rejected: string[];
560
+ skippedStale: string[];
561
+ skippedConflicted: string[];
562
+ autoSnapshotId: string | null;
563
+ epoch: number;
564
+ }