@ai2aim.ai/hivemind-sdk 1.0.15 → 3.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.
package/dist/types.d.ts CHANGED
@@ -1,253 +1,83 @@
1
- /**
2
- * Every JSON response from the backend is wrapped in this envelope by
3
- * the `ResponseEnvelopeMiddleware`. The SDK's REST client unwraps it
4
- * automatically — use {@link ApiEnvelope} when you need access to
5
- * `message` or `statusCode` directly.
6
- */
7
1
  export interface ApiEnvelope<T = unknown> {
8
2
  success: boolean;
9
3
  statusCode: number;
10
4
  data: T;
11
5
  message: string;
12
6
  }
13
- /** Shape of the envelope when the request failed (4xx / 5xx). */
14
7
  export interface ApiErrorBody {
15
8
  success: false;
16
9
  statusCode: number;
17
10
  data: Record<string, unknown> | null;
18
11
  message: string;
19
12
  }
20
- /**
21
- * Optional per-request overrides. Use this to pass an API key from your
22
- * own database/cache instead of storing it in client config.
23
- */
13
+ export type RequestAuthMode = "api" | "admin" | "webhook" | "none";
24
14
  export interface RequestOptions {
25
- /** Organization API key for this request (e.g. from your DB/cache). */
26
15
  apiKey?: string;
16
+ authMode?: RequestAuthMode;
27
17
  }
28
- /**
29
- * Resolved config (baseUrl always set). Used internally.
30
- */
31
18
  export interface HivemindClientConfig {
32
19
  baseUrl: string;
33
20
  apiPrefix?: string;
34
21
  apiKey?: string;
35
22
  adminKey?: string;
36
23
  webhookSecret?: string;
37
- employeeId?: string;
38
24
  timeoutMs?: number;
39
25
  insecure?: boolean;
40
26
  }
41
- /**
42
- * Config when creating a client. baseUrl is optional:
43
- * if omitted, it is read from env (HIVEMIND_BASE_URL or HIVEMIND_API_URL).
44
- * Set it once in the environment and only pass overrides (e.g. adminKey, apiKey)
45
- * when creating the client.
46
- */
47
- export interface HivemindClientConfigInput {
48
- /** Base URL; defaults to HIVEMIND_BASE_URL or HIVEMIND_API_URL */
27
+ export interface HivemindClientConfigInput extends Partial<HivemindClientConfig> {
49
28
  baseUrl?: string;
50
- /** API prefix, defaults to "/v1" */
51
- apiPrefix?: string;
52
- /** Organization API key (vtx_…); or pass per-request via RequestOptions */
53
- apiKey?: string;
54
- /** Admin bootstrap key for admin-only endpoints */
55
- adminKey?: string;
56
- /** Webhook secret for webhook endpoints */
57
- webhookSecret?: string;
58
- /** Employee ID header */
59
- employeeId?: string;
60
- /** Request timeout in ms (default 30 000) */
61
- timeoutMs?: number;
62
- /** Skip TLS verification (self-signed certs) */
63
- insecure?: boolean;
64
29
  }
65
- /** Organization tier determining quotas, rate limits, and available features. */
66
- export type OrgTier = "free" | "standard" | "premium" | "enterprise";
67
- /** Organization lifecycle status. */
68
- export type OrgStatus = "active" | "suspended";
69
- /**
70
- * Parameters for creating a new organization.
71
- *
72
- * **Auth:** Requires `adminKey` in client config.
73
- * **Endpoint:** `POST /v1/organizations`
74
- */
75
- export interface OrgCreateParams {
76
- /** Unique organization identifier (2–64 characters, alphanumeric + hyphens). */
77
- org_id: string;
78
- /** Human-readable display name (2–128 characters). */
79
- name: string;
80
- /** Organization tier. Determines quotas and rate limits. @default "standard" */
81
- tier?: OrgTier;
82
- /** Custom key-value settings for the organization. @default {} */
30
+ export type ApiKeyScopeStatus = "active" | "suspended";
31
+ export interface ApiKeyIssueParams {
32
+ name?: string;
83
33
  settings?: Record<string, unknown>;
84
34
  }
85
- /** Options for organization creation helpers. */
86
- export interface CreateOrganizationOptions {
87
- /**
88
- * Controls duplicate-organization handling.
89
- * Defaults to `true`, which makes org creation idempotent.
90
- */
91
- allowExisting?: boolean;
92
- }
93
- /** Full organization entity as returned by the API. */
94
- export interface Organization {
95
- /** Unique organization identifier. */
96
- org_id: string;
97
- /** Display name. */
35
+ export interface ApiKeyScope {
98
36
  name: string;
99
- /** Current tier (free, standard, premium, enterprise). */
100
- tier: OrgTier;
101
- /** Lifecycle status (active or suspended). */
102
- status: OrgStatus;
103
- /** ISO 8601 creation timestamp. */
37
+ status: ApiKeyScopeStatus;
104
38
  created_at: string;
105
- /** ISO 8601 last-update timestamp. */
106
39
  updated_at: string;
107
- /** Custom organization settings. */
108
40
  settings: Record<string, unknown>;
109
41
  }
110
- /**
111
- * Response from creating an organization.
112
- * Contains the full organization entity and the generated API key.
113
- */
114
- export interface OrgBootstrapResponse {
115
- /** The created organization. */
116
- organization: Organization;
117
- /** Generated API key (prefix `vxk_`). Store securely — shown only once. */
42
+ export interface ApiKeyBootstrapResponse {
43
+ scope: ApiKeyScope;
118
44
  api_key: string;
119
45
  }
120
- /** Successful response when an organization was newly created. */
121
- export interface OrgCreatedResponse extends OrgBootstrapResponse {
122
- /** Indicates the organization was created by this call. */
123
- created: true;
124
- }
125
- /** Successful response when the organization already existed. */
126
- export interface OrgExistingResponse {
127
- /** Indicates the organization already existed before this call. */
128
- created: false;
129
- /** Current organization details fetched via the admin API. */
130
- organization: Organization;
131
- /** Existing orgs do not expose the original API key again. */
132
- api_key: null;
133
- }
134
- /** Result from an idempotent organization provisioning flow. */
135
- export type OrgEnsureResponse = OrgCreatedResponse | OrgExistingResponse;
136
- /**
137
- * Response from rotating an organization's API key.
138
- * The previous key remains valid during a 24-hour grace period.
139
- */
140
- export interface RotateApiKeyResponse {
141
- /** Organization identifier. */
142
- org_id: string;
143
- /** Newly generated API key. */
46
+ export interface ApiKeyRotateResponse {
144
47
  new_api_key: string;
145
- /** ISO 8601 timestamp when the previous key expires. */
146
48
  previous_key_grace_expires_at: string;
147
49
  }
148
- /** Response from suspending or reactivating an organization. */
149
- export interface ChangeOrgStatusResponse {
150
- /** Organization identifier. */
151
- org_id: string;
152
- /** New status after the operation. */
153
- status: OrgStatus;
154
- /** ISO 8601 timestamp of the status change. */
155
- updated_at: string;
156
- }
157
- /**
158
- * Parameters for exchanging the bootstrap admin key for a signed session token.
159
- *
160
- * **Auth:** None (this is the login endpoint).
161
- * **Endpoint:** `POST /v1/admin/login`
162
- */
163
50
  export interface AdminLoginParams {
164
- /** The bootstrap admin key (min 1 character). */
165
51
  admin_key: string;
166
52
  }
167
- /** Response containing a signed admin session token. */
168
53
  export interface AdminLoginResponse {
169
- /** Signed JWT session token. Use as `Authorization: Bearer <token>`. */
170
54
  access_token: string;
171
- /** Token type — always `"bearer"`. */
172
55
  token_type: string;
173
- /** Token validity in seconds (default 28800 = 8 hours). */
174
56
  expires_in_seconds: number;
175
57
  }
176
- /**
177
- * Response from uploading and ingesting a document.
178
- * The document is stored in GCS, split into chunks, and embedded for RAG retrieval.
179
- */
58
+ export interface RootResponse {
59
+ service: string;
60
+ status: string;
61
+ health: string;
62
+ docs: string;
63
+ }
64
+ export interface HealthResponse {
65
+ service: string;
66
+ version: string;
67
+ status: string;
68
+ stats: Record<string, unknown>;
69
+ }
180
70
  export interface DocumentUploadResponse {
181
- /** Unique document identifier. */
182
71
  document_id: string;
183
- /** Organization the document belongs to. */
184
- org_id: string;
185
- /** Original filename. */
186
72
  filename: string;
187
- /** Number of text chunks created from the document. */
188
73
  chunks: number;
189
- /** Processing status (e.g. `"processed"`). */
190
74
  status: string;
191
75
  }
192
- /**
193
- * Parameters for a RAG (Retrieval-Augmented Generation) query.
194
- *
195
- * **Auth:** Requires org-scoped API key.
196
- * **Endpoint:** `POST /v1/organizations/{orgId}/query`
197
- */
198
- export interface QueryParams {
199
- /** The query text (min 1 character). */
200
- query: string;
201
- /** Optional user identifier for tracking and audit. */
202
- user_id?: string;
203
- /** Optional content-project context for project-scoped memory. */
204
- project_id?: string;
205
- /** Gemini model to use for generation. @default "gemini-pro" */
206
- model_type?: string;
207
- /** Sampling temperature (0.0–1.0). Lower = more deterministic. @default 0.2 */
208
- temperature?: number;
209
- /** Retrieval strategy: `"hybrid"`, `"dense"`, or `"sparse"`. @default "hybrid" */
210
- retrieval_strategy?: string;
211
- }
212
- /** A single citation returned inside a RAG query response. */
213
- export interface Citation {
214
- doc_id: string;
215
- chunk_id: string;
216
- score: number;
217
- snippet: string;
218
- }
219
- /** Response from a RAG query, including the generated answer and source citations. */
220
- export interface QueryResponse {
221
- /** Generated answer text. */
222
- answer: string;
223
- /** Source document chunks used to generate the answer, with scores and snippets. */
224
- sources: Citation[];
225
- /** Backward-compatible answer field used by older API consumers. */
226
- response: string;
227
- /** Backward-compatible citations field used by older API consumers. */
228
- citations: Citation[];
229
- /** Confidence score returned by the answering pipeline. */
230
- confidence: number;
231
- /** Approximate processing time in seconds. */
232
- processing_time: number;
233
- /** Model used for generation. */
234
- model_type?: string | null;
235
- }
236
- /**
237
- * Parameters for source discovery search.
238
- *
239
- * **Auth:** Requires org-scoped API key.
240
- * **Endpoint:** `POST /v1/organizations/{orgId}/search`
241
- */
242
76
  export interface SearchParams {
243
- /** Search query text (min 1 character). */
244
77
  query: string;
245
- /** Optional search type hint. */
246
78
  type?: string;
247
- /** Maximum number of results to return (1-25). @default 10 */
248
79
  num?: number;
249
80
  }
250
- /** A single organic search result. */
251
81
  export interface SearchOrganicResult {
252
82
  url: string;
253
83
  title: string;
@@ -255,382 +85,166 @@ export interface SearchOrganicResult {
255
85
  date?: string | null;
256
86
  order?: number | null;
257
87
  }
258
- /** A single "people also ask" result. */
259
88
  export interface SearchPeopleAlsoAskResult {
260
89
  question: string;
261
90
  snippet: string;
262
91
  title: string;
263
92
  link: string;
264
93
  }
265
- /** Source discovery search response. */
266
94
  export interface SearchResponse {
267
95
  organic: SearchOrganicResult[];
268
96
  peopleAlsoAsk: SearchPeopleAlsoAskResult[];
269
97
  relatedSearches: string[];
270
98
  }
271
- export type ProjectStatus = "active" | "archived";
272
- export type ContentItemType = "script" | "article" | "social_post" | "generic" | "video" | "audio" | "music";
273
- export type ContentItemStatus = "draft" | "ready" | "published" | "archived";
274
- export type SourceStatus = "pending" | "scraped" | "failed";
275
- export type ScheduleStatus = "scheduled" | "processing" | "published" | "failed" | "cancelled";
276
- export interface ProjectCreateParams {
277
- name: string;
278
- description?: string;
279
- metadata?: Record<string, unknown>;
280
- }
281
- export interface ProjectUpdateParams {
282
- name?: string;
283
- description?: string;
284
- metadata?: Record<string, unknown>;
285
- status?: ProjectStatus;
286
- }
287
- export interface ContentProject {
288
- project_id: string;
289
- org_id: string;
290
- name: string;
291
- description: string;
292
- created_at: string;
293
- updated_at: string;
294
- created_by: string;
295
- status: ProjectStatus;
296
- metadata: Record<string, unknown>;
297
- }
298
- export interface ContentProjectListResponse {
299
- projects: ContentProject[];
300
- total: number;
301
- }
302
- export interface ProjectChatParams {
303
- message: string;
304
- user_id: string;
305
- model_type?: string;
306
- temperature?: number;
307
- retrieval_strategy?: string;
308
- }
309
- export interface ConversationMessage {
310
- org_id: string;
311
- user_id: string;
312
- role: string;
313
- content: string;
314
- created_at: string;
315
- metadata: Record<string, unknown>;
316
- }
317
- export interface ProjectChatHistoryResponse {
318
- messages: ConversationMessage[];
319
- total: number;
320
- }
321
- export interface ContentItemCreateParams {
322
- item_type: ContentItemType;
323
- title: string;
324
- content?: string;
325
- asset_url?: string;
326
- status?: ContentItemStatus;
327
- metadata?: Record<string, unknown>;
328
- }
329
- export interface ContentItemUpdateParams {
330
- title?: string;
331
- content?: string;
332
- asset_url?: string | null;
333
- status?: ContentItemStatus;
334
- metadata?: Record<string, unknown>;
335
- }
336
- export interface ContentItemResponse {
337
- content_id: string;
338
- org_id: string;
339
- project_id: string;
340
- item_type: ContentItemType;
341
- title: string;
342
- content: string;
343
- created_at: string;
344
- updated_at: string;
345
- created_by: string;
346
- status: ContentItemStatus;
347
- asset_url?: string | null;
348
- metadata: Record<string, unknown>;
349
- }
350
- export interface ContentItemListResponse {
351
- items: ContentItemResponse[];
352
- total: number;
353
- }
354
- export interface ProjectSourceCreateParams {
355
- url: string;
356
- title?: string;
357
- content?: string;
358
- description?: string;
359
- source_type?: string;
360
- status?: SourceStatus;
361
- metadata?: Record<string, unknown>;
362
- }
363
- /**
364
- * Parameters for scraping one or more URLs and persisting the normalized
365
- * results as project sources.
366
- *
367
- * **Auth:** Requires org-scoped API key.
368
- * **Endpoint:** `POST /v1/organizations/{orgId}/projects/{projectId}/sources/scrape`
369
- */
370
- export interface ProjectSourceScrapeParams {
371
- /** One or more absolute URLs to fetch and save into the project. */
372
- urls: string[];
373
- }
374
- export interface ProjectSourceUpdateParams {
375
- title?: string;
376
- content?: string;
377
- description?: string;
378
- status?: SourceStatus;
379
- metadata?: Record<string, unknown>;
380
- }
381
- export interface ProjectSourceResponse {
382
- source_id: string;
383
- org_id: string;
384
- project_id: string;
385
- url: string;
386
- title: string;
387
- content: string;
388
- created_at: string;
389
- updated_at: string;
390
- source_type: string;
391
- description: string;
392
- status: SourceStatus;
393
- metadata: Record<string, unknown>;
394
- }
395
- export interface ProjectSourceListResponse {
396
- sources: ProjectSourceResponse[];
397
- total: number;
398
- }
399
- export interface PublishScheduleCreateParams {
400
- content_id: string;
401
- target_platforms?: string[];
402
- publish_at: string;
403
- timezone?: string;
404
- delivery_endpoint?: string;
405
- delivery_headers?: Record<string, string>;
406
- metadata?: Record<string, unknown>;
407
- }
408
- export interface PublishScheduleUpdateParams {
409
- target_platforms?: string[];
410
- publish_at?: string;
411
- timezone?: string;
412
- status?: ScheduleStatus;
413
- delivery_endpoint?: string | null;
414
- delivery_headers?: Record<string, string>;
415
- metadata?: Record<string, unknown>;
416
- }
417
- export interface PublishScheduleResponse {
418
- schedule_id: string;
419
- org_id: string;
420
- project_id: string;
421
- content_id: string;
422
- target_platforms: string[];
423
- publish_at: string;
424
- created_at: string;
425
- updated_at: string;
426
- created_by: string;
427
- timezone: string;
428
- status: ScheduleStatus;
429
- delivery_endpoint?: string | null;
430
- delivery_headers: Record<string, string>;
431
- published_at?: string | null;
432
- last_result: Record<string, unknown>;
433
- metadata: Record<string, unknown>;
434
- }
435
- export interface PublishScheduleListResponse {
436
- schedules: PublishScheduleResponse[];
437
- total: number;
438
- }
439
- /**
440
- * Response from manually running due Content Creator schedules.
441
- *
442
- * Returned by `POST /v1/admin/content-creator/schedules/run-due`.
443
- */
444
- export interface ScheduleRunResultResponse {
445
- processed: number;
446
- published: number;
447
- failed: number;
448
- schedules: PublishScheduleResponse[];
449
- }
450
- /**
451
- * Parameters for starting an asynchronous video generation job (Vertex AI Veo).
452
- *
453
- * **Auth:** Requires org-scoped API key.
454
- * **Endpoint:** `POST /v1/organizations/{orgId}/generate/video`
455
- */
456
99
  export interface GenerateVideoParams {
457
- /** Video generation prompt (min 1 character). */
458
100
  prompt: string;
459
- /** Duration in seconds. Must be 4, 6, or 8. @default 8 */
460
101
  duration?: 4 | 6 | 8;
461
- /** Aspect ratio (e.g. `"16:9"`, `"9:16"`, `"1:1"`). @default "16:9" */
462
102
  aspect_ratio?: string;
463
- /** Visual style hint (e.g. `"cinematic"`, `"anime"`). */
464
103
  style?: string;
465
- /** Optional user identifier for tracking. */
466
- user_id?: string;
467
- }
468
- /**
469
- * Parameters for starting an asynchronous image generation job (Vertex AI Imagen).
470
- *
471
- * **Auth:** Requires org-scoped API key.
472
- * **Endpoint:** `POST /v1/organizations/{orgId}/generate/image`
473
- */
104
+ }
474
105
  export interface GenerateImageParams {
475
- /** Image generation prompt (min 1 character). */
476
106
  prompt: string;
477
- /** Aspect ratio (e.g. `"1:1"`, `"16:9"`, `"9:16"`). @default "1:1" */
478
107
  aspect_ratio?: string;
479
- /** Visual style hint (e.g. `"digital art"`, `"photorealistic"`). */
480
108
  style?: string;
481
- /** Number of images to generate (1–8). @default 1 */
482
109
  num_images?: number;
483
- /** Optional user identifier for tracking. */
484
- user_id?: string;
485
- }
486
- /**
487
- * Parameters for starting an asynchronous music generation job.
488
- *
489
- * **Auth:** Requires org-scoped API key.
490
- * **Endpoint:** `POST /v1/organizations/{orgId}/generate/music`
491
- */
110
+ }
492
111
  export interface GenerateMusicParams {
493
- /** Target genre (e.g. `"ambient"`). */
494
112
  genre: string;
495
- /** Target mood (e.g. `"uplifting"`). */
496
113
  mood: string;
497
- /** Duration in seconds. */
498
114
  duration: number;
499
- /** Optional user identifier for tracking. */
500
- user_id?: string;
501
115
  }
502
- /** Response returned when an asynchronous generation job is accepted (HTTP 202). */
116
+ export type SocialPlatform = "x" | "linkedin" | "facebook" | "instagram" | "tiktok" | "youtube";
117
+ export type SocialContentGoal = "awareness" | "engagement" | "clicks" | "leads" | "conversions" | "education" | "community" | "launch";
118
+ export type SocialContentLength = "short" | "medium" | "long";
119
+ export type SocialTone = "professional" | "friendly" | "playful" | "bold" | "authoritative" | "educational" | "witty";
120
+ export type SocialWritingStyle = "conversational" | "storytelling" | "direct" | "thought_leadership" | "persuasive" | "community_led" | "scripted";
121
+ export type EmojiDensity = "none" | "light" | "medium" | "heavy";
122
+ export interface SocialContentGenerateParams {
123
+ prompt: string;
124
+ platforms: SocialPlatform[];
125
+ objective?: SocialContentGoal;
126
+ target_audience?: string;
127
+ brand_name?: string;
128
+ tone?: SocialTone;
129
+ writing_style?: SocialWritingStyle;
130
+ length?: SocialContentLength;
131
+ call_to_action?: string;
132
+ primary_keyword?: string;
133
+ secondary_keywords?: string[];
134
+ include_hashtags?: boolean;
135
+ hashtags?: string[];
136
+ hashtag_count?: number;
137
+ include_emojis?: boolean;
138
+ emoji_density?: EmojiDensity;
139
+ variation_count?: number;
140
+ include_title?: boolean;
141
+ include_hook?: boolean;
142
+ include_short_description?: boolean;
143
+ include_script?: boolean;
144
+ must_include?: string[];
145
+ avoid_terms?: string[];
146
+ compliance_notes?: string[];
147
+ landing_page_url?: string;
148
+ language?: string;
149
+ }
150
+ export interface SocialContentAnalysis {
151
+ summary: string;
152
+ recommended_hook: string;
153
+ recommended_structure: string[];
154
+ keyword_focus: string[];
155
+ platform_notes: Record<string, string[]>;
156
+ risks: string[];
157
+ }
158
+ export interface SocialContentSeoCheck {
159
+ passed: boolean;
160
+ score: number;
161
+ primary_keyword?: string | null;
162
+ matched_keywords: string[];
163
+ missing_keywords: string[];
164
+ recommendations: string[];
165
+ }
166
+ export interface SocialContentGuardrail {
167
+ passed: boolean;
168
+ risk_level: string;
169
+ issues: string[];
170
+ redactions: string[];
171
+ sanitized: boolean;
172
+ }
173
+ export interface SocialContentVariant {
174
+ platform: SocialPlatform;
175
+ variation: number;
176
+ title?: string | null;
177
+ hook?: string | null;
178
+ body: string;
179
+ short_description?: string | null;
180
+ call_to_action?: string | null;
181
+ hashtags: string[];
182
+ keywords_used: string[];
183
+ script?: string | null;
184
+ notes: string[];
185
+ seo: SocialContentSeoCheck;
186
+ guardrails: SocialContentGuardrail;
187
+ }
188
+ export interface SocialContentGenerationResponse {
189
+ request_id: string;
190
+ model?: string | null;
191
+ tools_used: string[];
192
+ analysis: SocialContentAnalysis;
193
+ variants: SocialContentVariant[];
194
+ }
503
195
  export interface JobAcceptedResponse {
504
- /** Unique job identifier. Use with `getJob()` or `waitForJob()` to poll status. */
505
196
  job_id: string;
506
- /** Initial status — always `"processing"`. */
507
197
  status: string;
508
- /** Estimated processing time in seconds. */
509
198
  estimated_time: number;
510
199
  }
511
- /**
512
- * Status of an asynchronous job (video or image generation).
513
- *
514
- * **Auth:** Requires org-scoped API key.
515
- * **Endpoint:** `GET /v1/organizations/{orgId}/jobs/{jobId}`
516
- */
517
200
  export interface JobStatusResponse {
518
- /** Job identifier. */
519
201
  job_id: string;
520
- /** Current status: `"processing"`, `"completed"`, `"failed"`, or `"cancelled"`. */
521
202
  status: string;
522
- /** Result payload when completed (e.g. `{ output_url, signed_url }`). `null` while processing. */
523
203
  result: unknown;
524
- /** Error message if the job failed. `null` otherwise. */
525
204
  error: string | null;
526
205
  }
527
- /**
528
- * Parameters for a natural-language query over BigQuery datasets.
529
- *
530
- * **Auth:** Requires org-scoped API key.
531
- * **Endpoint:** `POST /v1/organizations/{orgId}/data-chat`
532
- */
533
206
  export interface DataChatParams {
534
- /** Natural-language question (min 1 character). */
535
207
  question: string;
536
- /** Optional user identifier for tracking. */
537
- user_id?: string;
538
208
  }
539
- /** Response from a data chat query, including the generated SQL and result rows. */
540
209
  export interface DataChatResponse {
541
- /** Natural-language answer summarizing the results. */
542
210
  answer: string;
543
- /** Generated SQL query executed against the data backend. */
544
211
  sql: string;
545
- /** Result rows returned by the query. */
546
212
  data: Array<Record<string, unknown>>;
547
- /** Number of rows returned. */
548
213
  row_count: number;
549
- /** Backend tool used (e.g. "alloydb"). */
550
214
  tool_used: string;
551
215
  }
552
- /**
553
- * Parameters for creating a custom AI agent template.
554
- *
555
- * **Auth:** Requires org-scoped API key.
556
- * **Endpoint:** `POST /v1/organizations/{orgId}/agents/custom`
557
- */
558
216
  export interface AgentCreateParams {
559
- /** Agent name (2–64 characters). */
560
217
  name: string;
561
- /** System instructions for the agent (min 4 characters). */
562
218
  instructions: string;
563
- /** Tool identifiers the agent can use (e.g. `["rag_search", "ticket_create"]`). @default [] */
564
219
  tools?: string[];
565
220
  }
566
- /** Response from creating a custom agent. */
567
221
  export interface AgentCreateResponse {
568
- /** Unique agent identifier. */
569
222
  agent_id: string;
570
- /** Agent name. */
571
223
  name: string;
572
- /** Tools enabled for this agent. */
573
224
  tools: string[];
574
225
  }
575
- /**
576
- * Parameters for querying an AI agent.
577
- *
578
- * **Auth:** Requires org-scoped API key.
579
- * **Endpoint:** `POST /v1/organizations/{orgId}/agents/query`
580
- */
581
226
  export interface AgentQueryParams {
582
- /** User query text (min 1 character). */
583
227
  query: string;
584
- /** User identifier (required for agent context). */
585
- user_id: string;
586
- /** Agent type to route to. @default "auto" */
587
228
  agent_type?: string;
588
229
  }
589
- /** Response from an agent query. */
590
230
  export interface AgentQueryResponse {
591
- /** Agent type that handled the query. */
592
231
  agent_type: string;
593
- /** Agent's response text. */
594
232
  response: string;
595
- /** Actions taken by the agent during processing. */
596
233
  actions: string[];
597
234
  }
598
- /**
599
- * Parameters for audio transcription (speech-to-text).
600
- *
601
- * **Auth:** Requires org-scoped API key.
602
- * **Endpoint:** `POST /v1/organizations/{orgId}/audio/transcribe`
603
- */
604
235
  export interface AudioTranscribeParams {
605
- /** Legacy fallback text input used when no audio URL is provided. */
606
236
  audio_text?: string;
607
- /** Public or cloud-storage URL for the audio file to transcribe with ElevenLabs Scribe. */
608
237
  audio_url?: string;
609
- /** BCP-47 language code. @default "en-US" */
610
238
  language_code?: string;
611
- /** Speech-to-text model. @default "scribe_v2" */
612
239
  model_id?: string;
613
240
  }
614
- /**
615
- * Parameters for text-to-speech synthesis.
616
- *
617
- * **Auth:** Requires org-scoped API key.
618
- * **Endpoint:** `POST /v1/organizations/{orgId}/audio/synthesize`
619
- */
620
241
  export interface AudioSynthesizeParams {
621
- /** Text to convert to speech (min 1 character). */
622
242
  text: string;
623
- /** Voice identifier. @default "en-US-Neural2-J" */
624
243
  voice_name?: string;
625
- /** Optional ElevenLabs model override, e.g. `eleven_v3`. */
626
244
  model_id?: string;
627
- /** Optional ElevenLabs output format override, e.g. `mp3_44100_128`. */
628
245
  output_format?: string;
629
- /** Optional ISO 639-1 language code passed to ElevenLabs. */
630
246
  language_code?: string;
631
- /** Optional deterministic seed passed to ElevenLabs. */
632
247
  seed?: number;
633
- /** Optional per-request ElevenLabs voice settings override. */
634
248
  voice_settings?: {
635
249
  stability?: number;
636
250
  similarity_boost?: number;
@@ -639,12 +253,10 @@ export interface AudioSynthesizeParams {
639
253
  speed?: number;
640
254
  };
641
255
  }
642
- /** A speaker turn detected by the transcription pipeline. */
643
256
  export interface AudioSpeakerTurn {
644
257
  speaker: number;
645
258
  word_count: number;
646
259
  }
647
- /** Response from audio transcription (speech-to-text). */
648
260
  export interface AudioTranscriptionResponse {
649
261
  transcript: string;
650
262
  speaker_turns: AudioSpeakerTurn[];
@@ -653,7 +265,6 @@ export interface AudioTranscriptionResponse {
653
265
  transcription_id?: string | null;
654
266
  source_url?: string | null;
655
267
  }
656
- /** Response from text-to-speech synthesis. */
657
268
  export interface AudioSynthesizeResponse {
658
269
  url: string;
659
270
  output_url: string;
@@ -668,256 +279,79 @@ export interface AudioSynthesizeResponse {
668
279
  content_type?: string | null;
669
280
  request_id?: string | null;
670
281
  }
671
- /**
672
- * Parameters for training a predictive model on tabular data.
673
- *
674
- * **Auth:** Requires org-scoped API key.
675
- * **Endpoint:** `POST /v1/organizations/{orgId}/analytics/train`
676
- */
677
282
  export interface TrainModelParams {
678
- /** Column name to predict. */
679
283
  target_column: string;
680
- /** Feature column names used as model inputs. */
681
284
  feature_columns: string[];
682
- /** Training data rows. Each row is an object with feature + target columns. */
683
285
  rows: Array<Record<string, unknown>>;
684
286
  }
685
- /** Response from training a predictive model. */
686
287
  export interface TrainModelResponse {
687
- /** Unique model identifier. Use with `predict()`. */
688
288
  model_id: string;
689
- /** Deployment status (e.g. `"deployed"`). */
690
289
  status: string;
691
290
  }
692
- /**
693
- * Parameters for running predictions with a trained model.
694
- *
695
- * **Auth:** Requires org-scoped API key.
696
- * **Endpoint:** `POST /v1/organizations/{orgId}/analytics/predict`
697
- */
698
291
  export interface PredictParams {
699
- /** Trained model identifier (from `trainModel()`). */
700
292
  model_id: string;
701
- /** Data instances to predict on. Each instance has the model's feature columns. */
702
293
  instances: Array<Record<string, unknown>>;
703
294
  }
704
- /** Response containing prediction results. */
705
295
  export interface PredictResponse {
706
- /** Predictions for each input instance. */
707
296
  predictions: unknown[];
708
297
  }
709
- /**
710
- * Parameters for time-series forecasting.
711
- *
712
- * **Auth:** Requires org-scoped API key.
713
- * **Endpoint:** `POST /v1/organizations/{orgId}/analytics/forecast`
714
- */
715
298
  export interface ForecastParams {
716
- /** Historical time-series values. */
717
299
  series: number[];
718
- /** Forecast horizon in periods (1–365). @default 30 */
719
300
  horizon?: number;
720
301
  }
721
- /** Response containing the forecast values. */
722
302
  export interface ForecastResponse {
723
- /** Predicted future values for the specified horizon. */
724
303
  forecast: number[];
725
- /** Model used for forecasting. */
726
304
  model: string;
727
305
  }
728
- /**
729
- * Monthly usage summary for an organization.
730
- * Includes token, image, video, storage, and compute usage against tier limits.
731
- */
732
- export interface UsageSummaryResponse {
733
- /** Organization identifier. */
734
- org_id: string;
735
- /** Month in `YYYY-MM` format. */
736
- month: string;
737
- /** Usage counters (tokens_used, images_generated, videos_generated, storage_bytes, compute_hours). */
738
- usage: Record<string, unknown>;
739
- /** Tier limits for comparison. */
740
- limits: Record<string, unknown>;
741
- /** Whether the organization is within all quotas. */
742
- within_quota: boolean;
743
- /** List of limit keys that have been exceeded. */
744
- exceeded_limits: string[];
745
- }
746
- /**
747
- * Monthly invoice with cost breakdown by resource type.
748
- * Costs are calculated based on the platform's pricing configuration.
749
- */
750
- export interface InvoiceResponse {
751
- /** Organization identifier. */
752
- org_id: string;
753
- /** Month in `YYYY-MM` format. */
754
- month: string;
755
- /** Usage counters for the billing period. */
756
- usage: Record<string, unknown>;
757
- /** Cost breakdown by resource type. */
758
- costs: Record<string, number>;
759
- /** Total cost for the period. */
760
- total: number;
761
- /** Currency code. */
762
- currency: string;
763
- }
764
- /** A single audit log entry recording an API action. */
765
306
  export interface AuditRecord {
766
- /** ISO 8601 timestamp of the action. */
767
307
  timestamp: string;
768
- /** Organization identifier. */
769
- org_id: string;
770
- /** User who performed the action (null for system actions). */
771
- user_id: string | null;
772
- /** Action identifier (e.g. `"query.execute"`, `"document.upload"`). */
773
308
  action: string;
774
- /** Resource path (e.g. `"rag/query"`, `"documents/upload"`). */
775
309
  resource: string;
776
- /** Outcome status (e.g. `"success"`, `"failure"`). */
777
310
  status: string;
778
- /** Additional context (model_type, file size, etc.). */
779
311
  metadata: Record<string, unknown>;
780
312
  }
781
- /**
782
- * Response containing audit log records for an organization.
783
- * Backend model: `AuditLogListResponse`.
784
- */
785
313
  export interface AuditLogResponse {
786
- /** Organization identifier. */
787
- org_id: string;
788
- /** Audit log entries, newest first. */
789
314
  records: AuditRecord[];
790
315
  }
791
- /**
792
- * Parameters for submitting URLs to scrape.
793
- *
794
- * **Auth:** None required.
795
- * **Endpoint:** `POST /v1/scraping/scrape`
796
- */
797
316
  export interface ScrapeParams {
798
- /** List of URLs to scrape. JS-heavy sites (Reddit, Twitter, etc.) are auto-routed to Selenium. */
799
317
  urls: string[];
800
318
  }
801
- /** Response from submitting a scrape job. */
802
319
  export interface ScrapeResponse {
803
- /** Unique task identifier. Use with `getScrapeStatus()` to poll results. */
804
320
  task_id: string;
805
- /** Submission status (`"completed"` for inline mode, `"submitted"` for Celery mode). */
806
321
  status: string;
807
322
  }
808
- /** A single scraped page result. */
809
323
  export interface ScrapeResultItem {
810
- /** Source URL. */
811
324
  url?: string;
812
- /** Page title. */
813
325
  title?: string;
814
- /** Meta description. */
815
326
  description?: string;
816
- /** Extracted text paragraphs. */
817
327
  paragraphs?: string[];
818
- /** Full extracted text content. */
819
328
  full_text?: string;
820
- /** Error message if scraping this URL failed. */
821
329
  error?: string;
822
330
  }
823
- /**
824
- * Status and results of a scrape task.
825
- *
826
- * **Endpoint:** `GET /v1/scraping/status/{taskId}`
827
- */
828
331
  export interface ScrapeStatusResponse {
829
- /** Task identifier. */
830
332
  task_id: string;
831
- /** Task status: `"PENDING"`, `"SUCCESS"`, `"FAILURE"`, or `"completed"`. */
832
333
  status: string;
833
- /** Scraped results (empty while pending). */
834
334
  result: ScrapeResultItem[];
835
335
  }
836
- /**
837
- * Runtime scraping configuration.
838
- *
839
- * **Endpoint:** `GET /v1/scraping/config`
840
- */
841
336
  export interface ScrapingConfigResponse {
842
- /** Execution mode: `"inline"`, `"celery"`, or `"auto"`. */
843
337
  execution_mode: string;
844
- /** Whether running on Cloud Run. */
845
338
  is_cloud_run: boolean;
846
- /** Maximum inline result cache size. */
847
339
  inline_result_cache_size: number;
848
- /** Current number of cached entries. */
849
340
  inline_result_cache_entries: number;
850
341
  }
851
- /**
852
- * Payload for the video generation completion webhook.
853
- *
854
- * **Auth:** Requires `webhookSecret` in client config.
855
- * **Endpoint:** `POST /v1/webhook/video-complete`
856
- */
857
342
  export interface VideoCompleteWebhook {
858
- /** Job identifier. */
859
343
  job_id: string;
860
- /** Organization identifier. */
861
- org_id: string;
862
- /** Completion status (e.g. `"completed"`, `"failed"`). */
863
344
  status: string;
864
- /** Additional metadata (e.g. `{ output_uri: "gs://..." }`). */
865
345
  metadata?: Record<string, unknown>;
866
346
  }
867
- /**
868
- * Payload for the document processing completion webhook.
869
- *
870
- * **Auth:** Requires `webhookSecret` in client config.
871
- * **Endpoint:** `POST /v1/webhook/document-processed`
872
- */
873
347
  export interface DocumentProcessedWebhook {
874
- /** Document identifier. */
875
348
  document_id: string;
876
- /** Organization identifier. */
877
- org_id: string;
878
- /** Processing status (e.g. `"processed"`, `"failed"`). */
879
349
  status: string;
880
- /** Additional metadata (e.g. `{ chunks: 47 }`). */
881
350
  metadata?: Record<string, unknown>;
882
351
  }
883
- /**
884
- * Root service metadata response.
885
- *
886
- * **Auth:** None required.
887
- * **Endpoint:** `GET /`
888
- */
889
- export interface RootResponse {
890
- /** Service name. */
891
- service: string;
892
- /** Service status (`"ok"`). */
893
- status: string;
894
- /** Relative health endpoint path. */
895
- health: string;
896
- /** Relative Swagger docs path. */
897
- docs: string;
898
- }
899
- /**
900
- * Service health check response.
901
- *
902
- * **Auth:** None required.
903
- * **Endpoint:** `GET /v1/health`
904
- */
905
- export interface HealthResponse {
906
- /** Service name. */
907
- service: string;
908
- /** Service version. */
909
- version: string;
910
- /** Health status (`"ok"`). */
911
- status: string;
912
- /** Aggregate statistics (organizations, documents, total_chunks). */
913
- stats: Record<string, unknown>;
352
+ export interface WebhookAckResponse {
353
+ received: boolean;
914
354
  }
915
- /**
916
- * Full service configuration overview.
917
- *
918
- * **Auth:** Requires `adminKey` in client config.
919
- * **Endpoint:** `GET /v1/admin/config`
920
- */
921
355
  export interface ConfigOverview {
922
356
  service_name: string;
923
357
  service_version: string;
@@ -940,41 +374,33 @@ export interface ConfigOverview {
940
374
  max_upload_bytes: number;
941
375
  use_secret_manager: boolean;
942
376
  redis_url_set: boolean;
943
- content_schedule_runner_enabled: boolean;
944
- content_schedule_runner_poll_seconds: number;
945
377
  log_level: string;
946
378
  debug: boolean;
947
379
  }
948
- /** Request to update a runtime setting. */
949
380
  export interface UpdateSettingRequest {
950
381
  key: string;
951
382
  value: unknown;
952
383
  }
953
- /** Response after updating a runtime setting. */
954
384
  export interface UpdateSettingResponse {
955
385
  key: string;
956
386
  previous_value: unknown;
957
387
  new_value: unknown;
958
388
  updated_at: string;
959
389
  }
960
- /** Request to change the log level. */
961
390
  export interface LogLevelRequest {
962
391
  level: string;
963
392
  }
964
- /** Response from changing the log level. */
965
393
  export interface LogLevelResponse {
966
394
  previous_level: string;
967
395
  new_level: string;
968
396
  updated_at: string;
969
397
  }
970
- /** Information about a single logger. */
971
398
  export interface LoggerInfo {
972
399
  name: string;
973
400
  level: string;
974
401
  effective_level: string;
975
402
  handlers: string[];
976
403
  }
977
- /** Inbound traffic statistics. */
978
404
  export interface InboundTrafficStats {
979
405
  total_requests: number;
980
406
  requests_by_method: Record<string, number>;
@@ -983,7 +409,6 @@ export interface InboundTrafficStats {
983
409
  top_paths: Array<Record<string, unknown>>;
984
410
  collected_since: string;
985
411
  }
986
- /** A single outbound dependency health check. */
987
412
  export interface OutboundDependency {
988
413
  name: string;
989
414
  type: string;
@@ -991,151 +416,100 @@ export interface OutboundDependency {
991
416
  latency_ms: number | null;
992
417
  details: Record<string, unknown>;
993
418
  }
994
- /** Response from checking outbound dependencies. */
995
419
  export interface OutboundStatusResponse {
996
420
  checked_at: string;
997
421
  dependencies: OutboundDependency[];
998
422
  }
999
- /** A single rate-limit entry for an organization. */
1000
423
  export interface RateLimitEntry {
1001
- org_id: string;
424
+ scope_id: string;
1002
425
  current_count: number;
1003
426
  window_start: string | null;
1004
427
  }
1005
- /** Summary of an organization for admin listing. */
1006
- export interface OrgSummary {
1007
- org_id: string;
1008
- name: string;
1009
- tier: string;
1010
- status: string;
1011
- created_at: string;
1012
- }
1013
- /** Response from listing all organizations. */
1014
- export interface OrgListResponse {
1015
- total: number;
1016
- organizations: OrgSummary[];
1017
- }
1018
- /** Summary of a job for admin listing. */
1019
428
  export interface JobSummary {
1020
429
  job_id: string;
1021
- org_id: string;
430
+ scope_id: string;
1022
431
  status: string;
1023
432
  created_at: string;
1024
433
  completed_at: string | null;
1025
434
  }
1026
- /** Response from listing all jobs. */
1027
435
  export interface JobListResponse {
1028
436
  total: number;
1029
437
  jobs: JobSummary[];
1030
438
  }
1031
- /** A single feature flag. */
1032
439
  export interface FeatureFlag {
1033
440
  key: string;
1034
441
  enabled: boolean;
1035
442
  description: string;
1036
443
  }
1037
- /** Request to create or update a feature flag. */
1038
444
  export interface FeatureFlagUpdate {
1039
445
  key: string;
1040
446
  enabled: boolean;
1041
447
  }
1042
- /** Request to set maintenance mode. */
1043
448
  export interface MaintenanceModeRequest {
1044
449
  enabled: boolean;
1045
450
  message?: string;
1046
451
  }
1047
- /** Response with current maintenance mode state. */
1048
452
  export interface MaintenanceModeResponse {
1049
453
  enabled: boolean;
1050
454
  message: string;
1051
455
  updated_at: string;
1052
456
  }
1053
- /** Cache statistics. */
1054
457
  export interface CacheStatsResponse {
1055
458
  backend: string;
1056
459
  connected: boolean;
1057
460
  details: Record<string, unknown>;
1058
461
  }
1059
- /** Configuration for a single tier. */
1060
- export interface TierConfigResponse {
1061
- tier: string;
1062
- max_tokens_per_month: number;
1063
- max_images_per_month: number;
1064
- max_videos_per_month: number;
1065
- max_storage_gb: number;
1066
- max_compute_hours: number;
1067
- requests_per_minute: number;
1068
- concurrent_jobs: number;
1069
- features: string[];
1070
- }
1071
- /** Pricing configuration. */
1072
- export interface PricingResponse {
1073
- pricing: Record<string, number>;
1074
- }
1075
- /** A single admin audit log entry. */
1076
462
  export interface AdminAuditEntry {
1077
463
  timestamp: string;
1078
464
  admin_action: string;
1079
465
  detail: string;
1080
466
  metadata: Record<string, unknown>;
1081
467
  }
1082
- /** Response from the admin audit endpoint. */
1083
468
  export interface AdminAuditResponse {
1084
469
  total: number;
1085
470
  entries: AdminAuditEntry[];
1086
471
  }
1087
- /**
1088
- * Request to connect a Jira Cloud site using an API token.
1089
- *
1090
- * **Auth:** Requires org-scoped API key.
1091
- * **Endpoint:** `POST /v1/organizations/{orgId}/integrations/jira/connect`
1092
- */
472
+ export interface JiraWebhookPayload {
473
+ webhookEvent: string;
474
+ timestamp?: number | null;
475
+ issue?: Record<string, unknown> | null;
476
+ comment?: Record<string, unknown> | null;
477
+ changelog?: Record<string, unknown> | null;
478
+ user?: Record<string, unknown>;
479
+ matchedWebhookIds?: number[];
480
+ }
1093
481
  export interface JiraConnectRequest {
1094
482
  site_url: string;
1095
483
  email: string;
1096
484
  api_token: string;
1097
485
  }
1098
- /**
1099
- * Response from connecting a Jira Cloud site.
1100
- *
1101
- * **Auth:** Requires org-scoped API key.
1102
- * **Endpoint:** `POST /v1/organizations/{orgId}/integrations/jira/connect`
1103
- */
486
+ export interface JiraIntegrationStatusResponse {
487
+ connected: boolean;
488
+ site_url?: string | null;
489
+ cloud_id?: string | null;
490
+ status?: string | null;
491
+ connected_at?: string | null;
492
+ }
1104
493
  export interface JiraConnectResponse {
1105
494
  status: string;
1106
- org_id: string;
1107
495
  site_url: string;
1108
496
  cloud_id: string;
1109
497
  }
1110
- /**
1111
- * Jira integration status for an organization.
1112
- *
1113
- * **Auth:** Requires org-scoped API key.
1114
- * **Endpoint:** `GET /v1/organizations/{orgId}/integrations/jira/status`
1115
- */
1116
- export interface JiraIntegrationStatusResponse {
1117
- org_id: string;
1118
- connected: boolean;
1119
- site_url: string | null;
1120
- cloud_id: string | null;
1121
- status: string | null;
1122
- connected_at: string | null;
1123
- }
1124
- /**
1125
- * Request to sync Jira projects.
1126
- *
1127
- * **Auth:** Requires org-scoped API key.
1128
- * **Endpoint:** `POST /v1/organizations/{orgId}/integrations/jira/sync`
1129
- */
1130
498
  export interface JiraSyncRequest {
1131
499
  project_keys: string[];
1132
500
  }
1133
- /** Response from initiating a Jira sync. */
1134
501
  export interface JiraSyncResponse {
1135
502
  job_id: string;
1136
503
  status: string;
1137
504
  project_keys: string[];
1138
505
  }
506
+ export interface JiraDisconnectResponse {
507
+ status: string;
508
+ }
509
+ export interface JiraWebhookAckResponse {
510
+ received: boolean;
511
+ result: Record<string, unknown>;
512
+ }
1139
513
  export interface AIGenerationRules {
1140
514
  enabled: boolean;
1141
515
  context_required: string[];
@@ -1149,8 +523,8 @@ export interface BlueprintSection {
1149
523
  is_required: boolean;
1150
524
  section_type: string;
1151
525
  ai_generation_rules: AIGenerationRules;
1152
- min_length: number | null;
1153
- max_length: number | null;
526
+ min_length?: number | null;
527
+ max_length?: number | null;
1154
528
  }
1155
529
  export interface WorkflowStageConfig {
1156
530
  allowed_roles: string[];
@@ -1176,11 +550,10 @@ export interface TargetRoles {
1176
550
  }
1177
551
  export interface BlueprintResponse {
1178
552
  blueprint_id: string;
1179
- org_id: string;
1180
553
  name: string;
1181
554
  description: string;
1182
555
  category: string;
1183
- status: "draft" | "published" | "archived";
556
+ status: string;
1184
557
  version: number;
1185
558
  created_at: string;
1186
559
  updated_at: string;
@@ -1205,16 +578,9 @@ export interface BlueprintCreateParams {
1205
578
  target_roles?: Partial<TargetRoles>;
1206
579
  sections?: Array<Omit<BlueprintSection, "section_id">>;
1207
580
  workflow_config?: Partial<WorkflowConfig>;
581
+ metadata?: Record<string, unknown>;
1208
582
  }
1209
- export interface BlueprintUpdateParams {
1210
- name?: string;
1211
- description?: string;
1212
- category?: string;
1213
- default_workflow?: string;
1214
- visibility_notes?: string;
1215
- target_roles?: Partial<TargetRoles>;
1216
- sections?: Array<Omit<BlueprintSection, "section_id">>;
1217
- workflow_config?: Partial<WorkflowConfig>;
583
+ export interface BlueprintUpdateParams extends BlueprintCreateParams {
1218
584
  }
1219
585
  export interface DocumentSectionContent {
1220
586
  section_id: string;
@@ -1235,8 +601,8 @@ export interface DocumentSection {
1235
601
  order: number;
1236
602
  content: string;
1237
603
  is_ai_generated: boolean;
1238
- last_edited_by: string | null;
1239
- last_edited_at: string | null;
604
+ last_edited_by: string;
605
+ last_edited_at?: string | null;
1240
606
  }
1241
607
  export interface WorkflowAction {
1242
608
  action_id: string;
@@ -1249,10 +615,9 @@ export interface WorkflowAction {
1249
615
  }
1250
616
  export interface ManagedDocumentResponse {
1251
617
  document_id: string;
1252
- org_id: string;
1253
618
  blueprint_id: string;
1254
619
  title: string;
1255
- status: "draft" | "in_review" | "approved" | "sealed" | "rejected" | "revision";
620
+ status: string;
1256
621
  created_at: string;
1257
622
  updated_at: string;
1258
623
  created_by: string;
@@ -1276,77 +641,18 @@ export interface DocumentWorkflowActionParams {
1276
641
  action: "submit" | "approve" | "reject" | "request_changes" | "seal";
1277
642
  comment?: string;
1278
643
  }
1279
- /** Parameters for AI-generating content for a document section. */
1280
644
  export interface DocumentGenerateSectionParams {
1281
- /** Section ID to generate content for. */
1282
645
  section_id: string;
1283
- /** Key-value context for AI generation. */
1284
646
  context?: Record<string, string>;
1285
647
  }
1286
- /** Response from AI-generating a document section. */
1287
648
  export interface DocumentGenerateResponse {
1288
- /** Section that was generated. */
1289
649
  section_id: string;
1290
- /** Generated content. */
1291
650
  generated_content: string;
1292
- /** AI model used for generation. */
1293
651
  model_used: string;
1294
652
  }
1295
- /** Response from a webhook acknowledgment. */
1296
- export interface WebhookAckResponse {
1297
- received: boolean;
1298
- }
1299
- /** Response from disconnecting a Jira integration. */
1300
- export interface JiraDisconnectResponse {
1301
- status: string;
1302
- org_id: string;
1303
- }
1304
- /** Response from a Jira webhook acknowledgment. */
1305
- export interface JiraWebhookAckResponse {
1306
- received: boolean;
1307
- org_id: string;
1308
- result: Record<string, unknown>;
1309
- }
1310
- /** A parsed Server-Sent Event. */
1311
653
  export interface SseEvent {
1312
- /** Event type (from the `event:` line). Undefined for unnamed events. */
1313
654
  event?: string;
1314
- /** Payload string (from the `data:` line(s)). */
1315
655
  data: string;
1316
- /** Event ID (from the `id:` line), if present. */
1317
656
  id?: string;
1318
657
  }
1319
- /** Typed SSE events emitted by the chat/stream endpoint. */
1320
- export type ChatStreamEvent = {
1321
- event: "start";
1322
- data: {
1323
- org_id: string;
1324
- project_id: string;
1325
- };
1326
- } | {
1327
- event: "done";
1328
- data: QueryResponse;
1329
- } | {
1330
- event: "error";
1331
- data: {
1332
- message: string;
1333
- };
1334
- };
1335
- /** Command sent by the client over a chat WebSocket. */
1336
- export interface WsChatCommand {
1337
- type: "chat";
1338
- message: string;
1339
- user_id: string;
1340
- model_type?: string;
1341
- temperature?: number;
1342
- retrieval_strategy?: string;
1343
- }
1344
- /** Frames sent by the server over a chat WebSocket. */
1345
- export type WsChatFrame = {
1346
- type: "result";
1347
- payload: QueryResponse;
1348
- } | {
1349
- type: "error";
1350
- message: string;
1351
- };
1352
658
  //# sourceMappingURL=types.d.ts.map