@graph8/sdk 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,1148 @@
1
1
  import { AnalyticsInterface } from '@jitsu/js';
2
2
 
3
+ interface MeetingAttendee {
4
+ name: string | null;
5
+ email: string;
6
+ role: "host" | "prospect" | "guest" | string;
7
+ contact_id?: number | null;
8
+ }
9
+ interface MeetingTranscriptLine {
10
+ speaker: string;
11
+ text: string;
12
+ timestamp: number;
13
+ }
14
+ interface MeetingAnalysis {
15
+ sentiment: "positive" | "neutral" | "negative";
16
+ summary: string;
17
+ next_steps: string[];
18
+ objections: string[];
19
+ talk_listen_ratio: number | null;
20
+ }
21
+ interface MeetingSummary {
22
+ id: string;
23
+ status: "scheduled" | "completed" | "cancelled" | "no_show";
24
+ event_type: string | null;
25
+ scheduled_at: string;
26
+ duration_minutes: number;
27
+ attendees: MeetingAttendee[];
28
+ contact_id: number | null;
29
+ conferencing_provider: string | null;
30
+ conferencing_url: string | null;
31
+ recording_url: string | null;
32
+ created_at: string;
33
+ }
34
+ interface MeetingDetail extends MeetingSummary {
35
+ transcript: MeetingTranscriptLine[] | null;
36
+ analysis: MeetingAnalysis | null;
37
+ }
38
+ interface MeetingListParams {
39
+ status?: "scheduled" | "completed" | "cancelled" | "no_show";
40
+ date_from?: string;
41
+ date_to?: string;
42
+ attendee_id?: string;
43
+ event_type?: string;
44
+ contact_id?: number;
45
+ page?: number;
46
+ limit?: number;
47
+ }
48
+ /**
49
+ * Meetings API - read-only access to scheduled, completed, and cancelled meetings.
50
+ * Booking happens via `g8.calendar.*` (write-key safe, browser only) — this surface
51
+ * is for reading meeting records, transcripts, and AI analysis.
52
+ *
53
+ * Requires API key (server-side).
54
+ *
55
+ * Backed by:
56
+ * GET /api/v1/inbox/meetings
57
+ * GET /api/v1/inbox/meetings/{meeting_id}
58
+ */
59
+ declare const createMeetingsClient: (apiKey: string, apiUrl?: string) => {
60
+ /** List meetings with optional filters. Returns summary rows without transcript / analysis. */
61
+ list(params?: MeetingListParams): Promise<{
62
+ data: MeetingSummary[];
63
+ pagination?: {
64
+ page: number;
65
+ limit: number;
66
+ total: number;
67
+ has_next: boolean;
68
+ };
69
+ }>;
70
+ /** Get full meeting detail including transcript + AI analysis (transcript available 1-5 min after meeting ends). */
71
+ get(meetingId: string): Promise<MeetingDetail>;
72
+ };
73
+
74
+ interface GlobalContextDocument {
75
+ id: string;
76
+ category: string;
77
+ title: string;
78
+ content: string;
79
+ metadata: Record<string, unknown> | null;
80
+ created_at: string | null;
81
+ updated_at: string | null;
82
+ }
83
+ interface Persona {
84
+ id: string;
85
+ name: string;
86
+ description: string | null;
87
+ status: string;
88
+ pain_points: string[];
89
+ goals: string[];
90
+ channels: string[];
91
+ created_at: string | null;
92
+ }
93
+ interface ICP {
94
+ id: string;
95
+ name: string;
96
+ description: string | null;
97
+ status: string;
98
+ industry: string[] | null;
99
+ employee_count_min: number | null;
100
+ employee_count_max: number | null;
101
+ revenue_min: number | null;
102
+ revenue_max: number | null;
103
+ countries: string[] | null;
104
+ created_at: string | null;
105
+ }
106
+ interface IntelligenceData {
107
+ id: string;
108
+ source_type: string;
109
+ url: string | null;
110
+ title: string | null;
111
+ content_summary: string | null;
112
+ collected_at: string | null;
113
+ }
114
+ interface ResearchReport {
115
+ id: string;
116
+ category: "buyer_psychology" | "competitive_teardown" | "gtm_channel" | "industry_analyst" | "review_sentiment" | "voice_of_customer";
117
+ title: string;
118
+ summary: string | null;
119
+ created_at: string | null;
120
+ }
121
+ /**
122
+ * Studio context — org-level intelligence documents. The 44-doc engine that
123
+ * powers campaign ideation: brand brief, value props, messaging house, ICPs,
124
+ * personas, intelligence (scrapes + enrichment), and AI research reports.
125
+ *
126
+ * Requires API key (server-side).
127
+ *
128
+ * Backed by:
129
+ * GET /api/v1/global-context/documents
130
+ * GET /api/v1/icps
131
+ * GET /api/v1/personas
132
+ * GET /api/v1/intelligence-data
133
+ * GET /api/v1/research-reports
134
+ */
135
+ declare const createStudioClient: (apiKey: string, apiUrl?: string) => {
136
+ /** Org-level Studio documents (brand_brief, value_props, messaging_house, etc.). */
137
+ globalContext(params?: {
138
+ category?: string;
139
+ limit?: number;
140
+ }): Promise<{
141
+ data: GlobalContextDocument[];
142
+ }>;
143
+ /** ICP definitions. */
144
+ icps(params?: {
145
+ status?: string;
146
+ limit?: number;
147
+ }): Promise<{
148
+ data: ICP[];
149
+ }>;
150
+ /** Buyer persona definitions. */
151
+ personas(params?: {
152
+ status?: string;
153
+ limit?: number;
154
+ }): Promise<{
155
+ data: Persona[];
156
+ }>;
157
+ /** Intelligence data (website scrapes, enrichment, competitor research). */
158
+ intelligenceData(params?: {
159
+ source_type?: string;
160
+ limit?: number;
161
+ }): Promise<{
162
+ data: IntelligenceData[];
163
+ }>;
164
+ /** AI research reports (buyer psychology, competitive teardown, GTM channel, etc.). */
165
+ researchReports(params?: {
166
+ category?: string;
167
+ limit?: number;
168
+ }): Promise<{
169
+ data: ResearchReport[];
170
+ }>;
171
+ };
172
+
173
+ interface IntentKeyword {
174
+ id: string;
175
+ keyword: string;
176
+ domain: string | null;
177
+ include_patterns: string[];
178
+ exclude_patterns: string[];
179
+ page_count: number;
180
+ visitor_count: number;
181
+ company_count: number;
182
+ contact_count: number;
183
+ created_at: string | null;
184
+ }
185
+ interface IntentPage {
186
+ url: string;
187
+ title: string | null;
188
+ keyword: string | null;
189
+ domain: string;
190
+ visitor_count: number;
191
+ last_seen: string | null;
192
+ }
193
+ interface IntentVisitor {
194
+ visitor_id: string;
195
+ company_domain: string | null;
196
+ company_name: string | null;
197
+ page_url: string;
198
+ first_seen: string | null;
199
+ last_seen: string | null;
200
+ visit_count: number;
201
+ }
202
+ interface IntentCompany {
203
+ domain: string;
204
+ name: string | null;
205
+ industry: string | null;
206
+ employee_count: string | null;
207
+ visit_count: number;
208
+ last_seen: string | null;
209
+ }
210
+ interface IntentContact {
211
+ contact_id: number | null;
212
+ email: string | null;
213
+ full_name: string | null;
214
+ company: string | null;
215
+ job_title: string | null;
216
+ last_seen: string | null;
217
+ }
218
+ interface IntentStats {
219
+ total_keywords: number;
220
+ total_pages: number;
221
+ total_visitors_30d: number;
222
+ total_companies_30d: number;
223
+ }
224
+ /**
225
+ * Intent + visitor tracking. Distinct from `g8.signals` (which is summary scoring) —
226
+ * this module exposes keyword tracking, page-level visitor data, and account-level
227
+ * intent signals from your own site (or from competitor URLs you've added).
228
+ *
229
+ * Requires API key (server-side).
230
+ *
231
+ * Backed by:
232
+ * GET /api/v1/intent/stats
233
+ * POST /api/v1/intent/keywords/list
234
+ * POST /api/v1/intent/keywords/create-from-domain
235
+ * DELETE /api/v1/intent/keywords/{keyword_id}
236
+ * POST /api/v1/intent/keywords/{keyword_id}/companies
237
+ * POST /api/v1/intent/keywords/{keyword_id}/contacts
238
+ * POST /api/v1/intent/keywords/{keyword_id}/urls
239
+ * POST /api/v1/intent/pages-by-domain
240
+ * POST /api/v1/intent/pages/search
241
+ * POST /api/v1/intent/pages/visitors
242
+ * POST /api/v1/intent/pages/contacts
243
+ * POST /api/v1/intent/pages/visitor-counts
244
+ * POST /intent-search/url-companies (note: bare host, no /api/v1 prefix)
245
+ */
246
+ declare const createIntentClient: (apiKey: string, apiUrl?: string) => {
247
+ /** Org-level intent stats (totals over the last 30 days). */
248
+ stats(): Promise<{
249
+ data: IntentStats;
250
+ }>;
251
+ /** List tracked keywords with optional pagination. */
252
+ listKeywords(params?: {
253
+ page?: number;
254
+ limit?: number;
255
+ search?: string;
256
+ }): Promise<{
257
+ data: IntentKeyword[];
258
+ }>;
259
+ /** Create a keyword group from a domain (auto-tracks all pages). */
260
+ createFromDomain(domain: string): Promise<{
261
+ data: IntentKeyword;
262
+ }>;
263
+ /** Stop tracking a keyword (irreversible — historical data is retained). */
264
+ deleteKeyword(keywordId: string): Promise<{
265
+ data: {
266
+ deleted: boolean;
267
+ };
268
+ }>;
269
+ /** Companies showing interest in a tracked keyword. */
270
+ keywordCompanies(keywordId: string, params?: {
271
+ limit?: number;
272
+ date_from?: string;
273
+ date_to?: string;
274
+ }): Promise<{
275
+ data: IntentCompany[];
276
+ }>;
277
+ /** Contacts showing interest in a tracked keyword. */
278
+ keywordContacts(keywordId: string, params?: {
279
+ limit?: number;
280
+ date_from?: string;
281
+ date_to?: string;
282
+ }): Promise<{
283
+ data: IntentContact[];
284
+ }>;
285
+ /** URLs associated with a keyword (pages visitors landed on while interested). */
286
+ keywordUrls(keywordId: string, params?: {
287
+ limit?: number;
288
+ }): Promise<{
289
+ data: IntentPage[];
290
+ }>;
291
+ /** Pages tracked on a specific domain. */
292
+ pagesByDomain(domain: string, params?: {
293
+ limit?: number;
294
+ }): Promise<{
295
+ data: IntentPage[];
296
+ }>;
297
+ /** Search tracked pages by URL fragment or keyword. */
298
+ searchPages(query: string, params?: {
299
+ limit?: number;
300
+ }): Promise<{
301
+ data: IntentPage[];
302
+ }>;
303
+ /** Get visitor records for a specific page URL. */
304
+ pageVisitors(pageUrl: string, params?: {
305
+ limit?: number;
306
+ date_from?: string;
307
+ date_to?: string;
308
+ }): Promise<{
309
+ data: IntentVisitor[];
310
+ }>;
311
+ /** Get contacts who visited a specific page URL. */
312
+ pageContacts(pageUrl: string, params?: {
313
+ limit?: number;
314
+ }): Promise<{
315
+ data: IntentContact[];
316
+ }>;
317
+ /** Visitor count aggregates by page (pass an array of URLs). */
318
+ pageVisitorCounts(urls: string[]): Promise<{
319
+ data: Array<{
320
+ url: string;
321
+ visitor_count: number;
322
+ }>;
323
+ }>;
324
+ /**
325
+ * Find companies whose users visited a specific URL (intent search).
326
+ *
327
+ * Note: this endpoint lives at the bare host (no `/api/v1` prefix), unlike the rest
328
+ * of the intent surface — we call it directly here instead of through the shared `post()` helper.
329
+ */
330
+ urlCompanies(url: string, params?: {
331
+ limit?: number;
332
+ date_from?: string;
333
+ date_to?: string;
334
+ }): Promise<{
335
+ data: IntentCompany[];
336
+ }>;
337
+ };
338
+
339
+ type SkillType = "llm" | "api";
340
+ interface SkillInputField {
341
+ name: string;
342
+ type: string;
343
+ required: boolean;
344
+ description?: string;
345
+ }
346
+ interface Skill {
347
+ id: string;
348
+ title: string;
349
+ description: string | null;
350
+ type: SkillType;
351
+ /** Only present on `type=llm`. */
352
+ prompt?: string;
353
+ /** Only present on `type=llm`. */
354
+ model?: string;
355
+ /** Only present on `type=api`. */
356
+ method?: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
357
+ /** Only present on `type=api`. */
358
+ url?: string;
359
+ /** Only present on `type=api`. */
360
+ headers?: Record<string, string>;
361
+ /** Only present on `type=api`. */
362
+ body_template?: string;
363
+ input_schema: {
364
+ fields: SkillInputField[];
365
+ };
366
+ output_schema: Record<string, unknown> | null;
367
+ created_at: string | null;
368
+ updated_at: string | null;
369
+ }
370
+ interface SkillCreateLLMParams {
371
+ title: string;
372
+ description?: string;
373
+ prompt: string;
374
+ model: string;
375
+ input_schema: {
376
+ fields: SkillInputField[];
377
+ };
378
+ output_schema?: Record<string, unknown>;
379
+ }
380
+ interface SkillCreateAPIParams {
381
+ title: string;
382
+ description?: string;
383
+ method: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
384
+ url: string;
385
+ headers?: Record<string, string>;
386
+ body_template?: string;
387
+ response_mapping?: Record<string, string>;
388
+ input_schema: {
389
+ fields: SkillInputField[];
390
+ };
391
+ }
392
+ interface SkillUpdateLLMParams {
393
+ title?: string;
394
+ description?: string;
395
+ prompt?: string;
396
+ model?: string;
397
+ input_schema?: {
398
+ fields: SkillInputField[];
399
+ };
400
+ output_schema?: Record<string, unknown>;
401
+ }
402
+ interface SkillUpdateAPIParams {
403
+ title?: string;
404
+ description?: string;
405
+ method?: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
406
+ url?: string;
407
+ headers?: Record<string, string>;
408
+ body_template?: string;
409
+ response_mapping?: Record<string, string>;
410
+ input_schema?: {
411
+ fields: SkillInputField[];
412
+ };
413
+ }
414
+ interface SkillTemplate {
415
+ id: string;
416
+ title: string;
417
+ description: string;
418
+ type: SkillType;
419
+ use_cases: string[];
420
+ }
421
+ interface SkillListParams {
422
+ page?: number;
423
+ limit?: number;
424
+ type?: SkillType;
425
+ search?: string;
426
+ }
427
+ /**
428
+ * Skills API - LLM and API building blocks that workflows compose into runs.
429
+ * Requires API key (server-side).
430
+ *
431
+ * Backed by:
432
+ * GET /api/v1/skills
433
+ * GET /api/v1/skills/{id}
434
+ * GET /api/v1/skills/{id}/variables
435
+ * GET /api/v1/skills/models
436
+ * GET /api/v1/skills/templates
437
+ * POST /api/v1/skills (both llm + api types via `type` field)
438
+ * POST /api/v1/skills/from-template
439
+ * POST /api/v1/skills/from-node
440
+ * PUT /api/v1/skills/{id}
441
+ * DELETE /api/v1/skills/{id}
442
+ * POST /api/v1/skills/validate
443
+ * POST /api/v1/skills/{id}/execute
444
+ */
445
+ declare const createSkillsClient: (apiKey: string, apiUrl?: string) => {
446
+ /** List skills. */
447
+ list(params?: SkillListParams): Promise<{
448
+ data: Skill[];
449
+ }>;
450
+ /** Get a skill by ID. */
451
+ get(skillId: string): Promise<Skill>;
452
+ /** Get the variables required by a skill (extracted from prompt or body template). */
453
+ getVariables(skillId: string): Promise<{
454
+ data: SkillInputField[];
455
+ }>;
456
+ /** List available LLM models. */
457
+ listModels(): Promise<{
458
+ data: Array<{
459
+ id: string;
460
+ label: string;
461
+ provider: string;
462
+ }>;
463
+ }>;
464
+ /** List skill templates. */
465
+ listTemplates(params?: {
466
+ type?: SkillType;
467
+ }): Promise<{
468
+ data: SkillTemplate[];
469
+ }>;
470
+ /** Create an LLM skill (prompt + model + schemas). */
471
+ createLLM(params: SkillCreateLLMParams): Promise<Skill>;
472
+ /** Create an API skill (HTTP request wrapper). */
473
+ createAPI(params: SkillCreateAPIParams): Promise<Skill>;
474
+ /** Create a skill from a built-in template. */
475
+ createFromTemplate(params: {
476
+ title: string;
477
+ template_id: string;
478
+ overrides?: Record<string, unknown>;
479
+ }): Promise<Skill>;
480
+ /** Lift a workflow node into a reusable skill. */
481
+ createFromNode(params: {
482
+ title: string;
483
+ description?: string;
484
+ node_id: string;
485
+ input_mapping?: Record<string, string>;
486
+ output_mapping?: Record<string, string>;
487
+ }): Promise<Skill>;
488
+ /** Update an LLM skill. */
489
+ updateLLM(skillId: string, fields: SkillUpdateLLMParams): Promise<Skill>;
490
+ /** Update an API skill. */
491
+ updateAPI(skillId: string, fields: SkillUpdateAPIParams): Promise<Skill>;
492
+ /** Delete a skill (irreversible if in-use workflows exist). */
493
+ delete(skillId: string): Promise<{
494
+ data: {
495
+ deleted: boolean;
496
+ };
497
+ }>;
498
+ /** Validate a skill definition (without saving). */
499
+ validate(skill: Partial<Skill>): Promise<{
500
+ data: {
501
+ valid: boolean;
502
+ errors: string[];
503
+ };
504
+ }>;
505
+ /** Execute a skill immediately with an input payload (test / preview). */
506
+ execute(skillId: string, inputPayload: Record<string, unknown>): Promise<{
507
+ data: {
508
+ output: Record<string, unknown>;
509
+ latency_ms: number;
510
+ tokens?: number;
511
+ error: string | null;
512
+ };
513
+ }>;
514
+ };
515
+
516
+ interface WorkflowNode {
517
+ id: string;
518
+ type: string;
519
+ config: Record<string, unknown>;
520
+ position?: {
521
+ x: number;
522
+ y: number;
523
+ };
524
+ /** Mapping from this node's output to the next node's input. */
525
+ input_mappings?: Record<string, string>;
526
+ }
527
+ interface WorkflowConnection {
528
+ from_node_id: string;
529
+ to_node_id: string;
530
+ condition?: string | null;
531
+ }
532
+ interface WorkflowConfig {
533
+ nodes: WorkflowNode[];
534
+ connections: WorkflowConnection[];
535
+ trigger?: Record<string, unknown> | null;
536
+ }
537
+ interface Workflow {
538
+ id: string;
539
+ name: string;
540
+ description: string | null;
541
+ config: WorkflowConfig;
542
+ trigger_config: Record<string, unknown> | null;
543
+ is_active: boolean;
544
+ created_at: string | null;
545
+ updated_at: string | null;
546
+ }
547
+ interface WorkflowCreateParams {
548
+ name: string;
549
+ description?: string;
550
+ config?: WorkflowConfig;
551
+ trigger_config?: Record<string, unknown>;
552
+ }
553
+ interface WorkflowUpdateParams {
554
+ name?: string;
555
+ description?: string;
556
+ config?: WorkflowConfig;
557
+ trigger_config?: Record<string, unknown>;
558
+ is_active?: boolean;
559
+ }
560
+ interface WorkflowExecution {
561
+ id: string;
562
+ workflow_id: string;
563
+ status: "pending" | "running" | "paused" | "completed" | "failed" | "stopped";
564
+ trigger_payload: Record<string, unknown>;
565
+ outputs: Record<string, unknown>;
566
+ error: string | null;
567
+ started_at: string | null;
568
+ ended_at: string | null;
569
+ }
570
+ interface NodeTypeSchema {
571
+ type: string;
572
+ label: string;
573
+ description: string;
574
+ config_schema: Record<string, unknown>;
575
+ output_schema: Record<string, unknown>;
576
+ }
577
+ interface WorkflowListParams {
578
+ page?: number;
579
+ limit?: number;
580
+ is_active?: boolean;
581
+ search?: string;
582
+ }
583
+ /**
584
+ * Workflows API - automation workflows with nodes, connections, and execution lifecycle.
585
+ * Requires API key (server-side).
586
+ *
587
+ * The graph8 workflow surface treats the whole workflow definition as a single
588
+ * record updated via `update()` — there are no per-node CRUD endpoints. To edit
589
+ * nodes or connections, fetch the workflow, mutate `config.nodes` / `config.connections`,
590
+ * and PUT it back.
591
+ *
592
+ * Backed by:
593
+ * GET /api/v1/workflows
594
+ * GET /api/v1/workflows/{id}
595
+ * POST /api/v1/workflows
596
+ * PUT /api/v1/workflows/{id}
597
+ * DELETE /api/v1/workflows/{id}
598
+ * POST /api/v1/workflows/validate
599
+ * POST /api/v1/workflows/{id}/execute
600
+ * GET /api/v1/workflows/executions/{exec_id}
601
+ * POST /api/v1/workflows/executions/{exec_id}/pause
602
+ * POST /api/v1/workflows/executions/{exec_id}/resume
603
+ * POST /api/v1/workflows/executions/{exec_id}/stop
604
+ * GET /api/v1/workflows/{id}/trigger-status
605
+ * POST /api/v1/workflows/{id}/trigger-reset
606
+ * GET /api/v1/workflows/node-types/schema
607
+ * GET /api/v1/workflows/integrations/slack/users|channels
608
+ * GET /api/v1/workflows/integrations/roam/users|groups
609
+ * GET /api/v1/workflows/mcp-servers
610
+ * GET /api/v1/workflows/dispositions
611
+ * GET /api/v1/workflows/forms/{form_id}/fields
612
+ */
613
+ declare const createWorkflowsClient: (apiKey: string, apiUrl?: string) => {
614
+ /** List workflows org-wide. */
615
+ list(params?: WorkflowListParams): Promise<{
616
+ data: Workflow[];
617
+ }>;
618
+ /** Get full workflow definition (nodes, connections, trigger, execution state). */
619
+ get(workflowId: string): Promise<Workflow>;
620
+ /** Create a new workflow. */
621
+ create(params: WorkflowCreateParams): Promise<Workflow>;
622
+ /**
623
+ * Update a workflow. Pass the full `config` (nodes + connections) to edit
624
+ * the graph — node-level CRUD is performed client-side by mutating the
625
+ * config and submitting the updated record.
626
+ */
627
+ update(workflowId: string, fields: WorkflowUpdateParams): Promise<Workflow>;
628
+ /** Delete a workflow. */
629
+ delete(workflowId: string): Promise<{
630
+ data: {
631
+ deleted: boolean;
632
+ };
633
+ }>;
634
+ /** Validate a workflow definition (orphans, dangling connections, required fields). */
635
+ validate(workflow: {
636
+ config: WorkflowConfig;
637
+ trigger_config?: Record<string, unknown>;
638
+ }): Promise<{
639
+ data: {
640
+ valid: boolean;
641
+ errors: Array<{
642
+ node_id?: string;
643
+ field?: string;
644
+ message: string;
645
+ }>;
646
+ };
647
+ }>;
648
+ /** Execute a workflow immediately with a trigger payload. */
649
+ execute(workflowId: string, triggerPayload?: Record<string, unknown>): Promise<WorkflowExecution>;
650
+ /** Get the status + output of a workflow execution. */
651
+ getExecution(executionId: string): Promise<WorkflowExecution>;
652
+ /** Pause an in-flight execution. */
653
+ pauseExecution(executionId: string): Promise<{
654
+ data: {
655
+ paused: boolean;
656
+ };
657
+ }>;
658
+ /** Resume a paused execution. */
659
+ resumeExecution(executionId: string): Promise<{
660
+ data: {
661
+ resumed: boolean;
662
+ };
663
+ }>;
664
+ /** Stop an execution (terminal state — cannot resume). */
665
+ stopExecution(executionId: string): Promise<{
666
+ data: {
667
+ stopped: boolean;
668
+ };
669
+ }>;
670
+ /** Get the status of a workflow's external trigger (e.g. "waiting for webhook"). */
671
+ getTriggerStatus(workflowId: string): Promise<{
672
+ data: {
673
+ status: string;
674
+ details: Record<string, unknown>;
675
+ };
676
+ }>;
677
+ /** Reset the trigger cursor (e.g. for event-stream triggers — resume from beginning). */
678
+ resetTrigger(workflowId: string): Promise<{
679
+ data: {
680
+ reset: boolean;
681
+ };
682
+ }>;
683
+ /**
684
+ * List available node types with schemas. Pass a `type` param to fetch one type's full schema.
685
+ */
686
+ nodeTypes(params?: {
687
+ type?: string;
688
+ }): Promise<{
689
+ data: NodeTypeSchema[];
690
+ }>;
691
+ /** Slack workspace users (for Slack action recipients). */
692
+ listSlackUsers(): Promise<{
693
+ data: Array<{
694
+ id: string;
695
+ name: string;
696
+ email: string | null;
697
+ }>;
698
+ }>;
699
+ /** Slack channels. */
700
+ listSlackChannels(): Promise<{
701
+ data: Array<{
702
+ id: string;
703
+ name: string;
704
+ is_private: boolean;
705
+ }>;
706
+ }>;
707
+ /** Roam (Copilot chat) users. */
708
+ listRoamUsers(): Promise<{
709
+ data: Array<{
710
+ id: string;
711
+ name: string;
712
+ email: string | null;
713
+ }>;
714
+ }>;
715
+ /** Roam (Copilot chat) groups. */
716
+ listRoamGroups(): Promise<{
717
+ data: Array<{
718
+ id: string;
719
+ name: string;
720
+ }>;
721
+ }>;
722
+ /** Available MCP servers (for Agent-node integrations). */
723
+ listMcpServers(): Promise<{
724
+ data: Array<{
725
+ id: string;
726
+ name: string;
727
+ url: string;
728
+ }>;
729
+ }>;
730
+ /** Available call dispositions (voice workflow nodes). */
731
+ listDispositions(): Promise<{
732
+ data: Array<{
733
+ id: string;
734
+ label: string;
735
+ }>;
736
+ }>;
737
+ /** Form field schema for form-trigger nodes. */
738
+ listFormFields(formId: string): Promise<{
739
+ data: Array<{
740
+ name: string;
741
+ type: string;
742
+ required: boolean;
743
+ }>;
744
+ }>;
745
+ };
746
+
747
+ /**
748
+ * Stage Checklist v2 pipelines. A "pipeline" here is a multi-stage workflow
749
+ * (with evidence requirements and per-channel scripts) that lives parallel
750
+ * to deal pipelines. Use `g8.deals.pipelines()` for deal-pipeline reads.
751
+ */
752
+ interface StagePipelineStage {
753
+ id: string;
754
+ name: string;
755
+ position: number;
756
+ /** Evidence keys that must be collected before the stage can be marked done. */
757
+ required_elements: string[];
758
+ /** Evidence keys that are recommended but not enforced. */
759
+ recommended_elements: string[];
760
+ /** Channel-specific scripts (call, email, linkedin, etc.). */
761
+ channel_scripts: Record<string, string>;
762
+ color: string | null;
763
+ stage_type: string | null;
764
+ }
765
+ interface StagePipeline {
766
+ id: string;
767
+ name: string;
768
+ target: string | null;
769
+ is_default: boolean;
770
+ stages: StagePipelineStage[];
771
+ created_at: string | null;
772
+ updated_at: string | null;
773
+ }
774
+ interface StagePipelineCreateParams {
775
+ name: string;
776
+ target?: string;
777
+ /** If true, creates an empty pipeline (no default stages). */
778
+ blank?: boolean;
779
+ }
780
+ interface StagePipelineUpdateParams {
781
+ name?: string;
782
+ target?: string;
783
+ }
784
+ interface StageCreateParams {
785
+ name: string;
786
+ position?: number;
787
+ required_elements?: string[];
788
+ recommended_elements?: string[];
789
+ channel_scripts?: Record<string, string>;
790
+ color?: string;
791
+ stage_type?: string;
792
+ }
793
+ interface StageUpdateParams {
794
+ name?: string;
795
+ position?: number;
796
+ required_elements?: string[];
797
+ recommended_elements?: string[];
798
+ channel_scripts?: Record<string, string>;
799
+ color?: string;
800
+ }
801
+ interface EvidenceKey {
802
+ key: string;
803
+ label: string;
804
+ description: string;
805
+ category: string;
806
+ }
807
+ interface PipelineSuggestion {
808
+ suggestion_id: string;
809
+ name: string;
810
+ target: string;
811
+ stages: Array<{
812
+ name: string;
813
+ required_elements: string[];
814
+ channel_scripts: Record<string, string>;
815
+ }>;
816
+ rationale: string;
817
+ }
818
+ /**
819
+ * Stage Checklist Pipelines API - workflow pipelines with evidence + scripts.
820
+ * Requires API key (server-side).
821
+ *
822
+ * Backed by:
823
+ * GET /api/v1/pipelines
824
+ * GET /api/v1/pipelines/{id}
825
+ * GET /api/v1/pipelines/evidence-library
826
+ * POST /api/v1/pipelines
827
+ * PUT /api/v1/pipelines/{id}
828
+ * DELETE /api/v1/pipelines/{id}
829
+ * POST /api/v1/pipelines/{id}/stages
830
+ * PUT /api/v1/pipelines/{id}/stages/{stage_id}
831
+ * DELETE /api/v1/pipelines/{id}/stages/{stage_id}
832
+ * PUT /api/v1/pipelines/{id}/stages/reorder
833
+ * POST /api/v1/pipelines/suggest
834
+ * POST /api/v1/pipelines/from-suggestion
835
+ */
836
+ declare const createPipelinesClient: (apiKey: string, apiUrl?: string) => {
837
+ /** List all stage-checklist pipelines with stages, evidence, scripts. */
838
+ list(): Promise<{
839
+ data: StagePipeline[];
840
+ }>;
841
+ /** Get a single pipeline by ID. */
842
+ get(pipelineId: string): Promise<StagePipeline>;
843
+ /** Get the canonical evidence-key library (used when defining stages). */
844
+ evidenceLibrary(): Promise<{
845
+ data: EvidenceKey[];
846
+ }>;
847
+ /** Create a new pipeline. Defaults to a templated set of stages; pass blank=true for empty. */
848
+ create(params: StagePipelineCreateParams): Promise<StagePipeline>;
849
+ /** Update pipeline metadata (name, target). */
850
+ update(pipelineId: string, fields: StagePipelineUpdateParams): Promise<StagePipeline>;
851
+ /** Delete a pipeline. Only allowed when no deals reference it. */
852
+ delete(pipelineId: string): Promise<{
853
+ data: {
854
+ deleted: boolean;
855
+ };
856
+ }>;
857
+ /** Add a new stage to a pipeline. */
858
+ createStage(pipelineId: string, stage: StageCreateParams): Promise<StagePipelineStage>;
859
+ /** Update a stage (evidence, scripts, position). */
860
+ updateStage(pipelineId: string, stageId: string, fields: StageUpdateParams): Promise<StagePipelineStage>;
861
+ /** Reorder stages within a pipeline (pass full ordered list of stage IDs). */
862
+ reorderStages(pipelineId: string, stageIds: string[]): Promise<{
863
+ data: StagePipelineStage[];
864
+ }>;
865
+ /** Delete a stage from a pipeline. */
866
+ deleteStage(pipelineId: string, stageId: string): Promise<{
867
+ data: {
868
+ deleted: boolean;
869
+ };
870
+ }>;
871
+ /** Get an AI-suggested pipeline based on org context (brand, ICP, messaging). */
872
+ suggest(): Promise<{
873
+ data: PipelineSuggestion;
874
+ }>;
875
+ /** Create a real pipeline from an AI suggestion (optionally with overrides). */
876
+ fromSuggestion(suggestionId: string, overrides?: Partial<{
877
+ name: string;
878
+ target: string;
879
+ }>): Promise<StagePipeline>;
880
+ };
881
+
882
+ interface QuoteLineItem {
883
+ product_id?: string | null;
884
+ name?: string | null;
885
+ description?: string | null;
886
+ quantity: number;
887
+ unit_price: number;
888
+ currency?: string | null;
889
+ recurring?: boolean | null;
890
+ }
891
+ type QuoteStatus = "draft" | "sent" | "signed" | "declined" | "expired" | "void";
892
+ interface QuoteSummary {
893
+ id: string;
894
+ name: string | null;
895
+ status: QuoteStatus;
896
+ total: number | null;
897
+ currency: string | null;
898
+ contact_id: number | null;
899
+ company_id: number | null;
900
+ expires_at: string | null;
901
+ created_at: string | null;
902
+ updated_at: string | null;
903
+ signing_url: string | null;
904
+ payment_link_url: string | null;
905
+ }
906
+ interface QuoteDetail extends QuoteSummary {
907
+ line_items: QuoteLineItem[];
908
+ notes: string | null;
909
+ recipient_email: string | null;
910
+ signed_at: string | null;
911
+ sent_at: string | null;
912
+ }
913
+ interface QuoteCreateParams {
914
+ contact_id?: number;
915
+ company_id?: number;
916
+ line_items: QuoteLineItem[];
917
+ currency?: string;
918
+ notes?: string;
919
+ /** ISO 8601 timestamp. */
920
+ expires_at?: string;
921
+ name?: string;
922
+ }
923
+ interface QuoteUpdateParams {
924
+ line_items?: QuoteLineItem[];
925
+ notes?: string;
926
+ expires_at?: string;
927
+ name?: string;
928
+ }
929
+ interface QuoteSendParams {
930
+ recipient_email: string;
931
+ /** Whether to attach the signing link. Defaults to true. */
932
+ send_signing_link?: boolean;
933
+ }
934
+ interface QuoteListParams {
935
+ status?: QuoteStatus;
936
+ contact_id?: number;
937
+ company_id?: number;
938
+ page?: number;
939
+ limit?: number;
940
+ }
941
+ interface QuotableProduct {
942
+ id: string;
943
+ name: string;
944
+ description: string | null;
945
+ unit_price: number;
946
+ currency: string;
947
+ recurring: boolean;
948
+ }
949
+ interface QuoteSettings {
950
+ default_currency: string;
951
+ default_tax_rate: number | null;
952
+ payment_providers: string[];
953
+ logo_url: string | null;
954
+ signature_required: boolean;
955
+ }
956
+ interface PaginationMeta$2 {
957
+ page: number;
958
+ limit: number;
959
+ total: number;
960
+ has_next: boolean;
961
+ }
962
+ /**
963
+ * Quotes API - quote-to-cash lifecycle. Requires API key (server-side).
964
+ *
965
+ * Backed by:
966
+ * GET /api/v1/quotes
967
+ * GET /api/v1/quotes/{id}
968
+ * POST /api/v1/quotes
969
+ * PUT /api/v1/quotes/{id}
970
+ * DELETE /api/v1/quotes/{id}
971
+ * POST /api/v1/quotes/{id}/duplicate
972
+ * POST /api/v1/quotes/{id}/edit-as-draft
973
+ * POST /api/v1/quotes/{id}/send
974
+ * GET /api/v1/quotable-products
975
+ * GET /api/v1/quote-settings
976
+ * GET /api/v1/contacts/{contact_id}/quotes
977
+ * GET /api/v1/companies/{company_id}/quotes
978
+ */
979
+ declare const createQuotesClient: (apiKey: string, apiUrl?: string) => {
980
+ /** List quotes org-wide with optional filters and pagination. */
981
+ list(params?: QuoteListParams): Promise<{
982
+ data: QuoteSummary[];
983
+ pagination?: PaginationMeta$2;
984
+ }>;
985
+ /** Get full details for a single quote. */
986
+ get(quoteId: string): Promise<QuoteDetail>;
987
+ /** Create a new quote from line items. */
988
+ create(quote: QuoteCreateParams): Promise<QuoteDetail>;
989
+ /** Update a draft quote (line items, expiry, notes). */
990
+ update(quoteId: string, fields: QuoteUpdateParams): Promise<QuoteDetail>;
991
+ /** Delete a draft quote (irreversible). */
992
+ delete(quoteId: string): Promise<{
993
+ data: {
994
+ deleted: boolean;
995
+ };
996
+ }>;
997
+ /** Duplicate an existing quote (all line items copied into a new draft). */
998
+ duplicate(quoteId: string): Promise<QuoteDetail>;
999
+ /** Convert a signed / sent quote back to editable draft state. */
1000
+ editAsDraft(quoteId: string): Promise<{
1001
+ data: {
1002
+ id: string;
1003
+ status: string;
1004
+ };
1005
+ }>;
1006
+ /** Send a quote to its recipient via email (with signature + optional payment link). */
1007
+ send(quoteId: string, params: QuoteSendParams): Promise<QuoteDetail>;
1008
+ /** List products available for line items. */
1009
+ products(): Promise<{
1010
+ data: QuotableProduct[];
1011
+ }>;
1012
+ /** Get org-level quote settings (currency, tax rate, payment providers, logo). */
1013
+ settings(): Promise<QuoteSettings>;
1014
+ /** Get all quotes associated with a contact. */
1015
+ forContact(contactId: number): Promise<{
1016
+ data: QuoteSummary[];
1017
+ }>;
1018
+ /** Get all quotes associated with a company. */
1019
+ forCompany(companyId: number): Promise<{
1020
+ data: QuoteSummary[];
1021
+ }>;
1022
+ };
1023
+
1024
+ /**
1025
+ * Inbox channel — `email`, `sms`, or `linkedin` (HeyReach internally).
1026
+ * Defaults to `email` on routes that accept this as a query param.
1027
+ */
1028
+ type InboxChannel = "email" | "sms" | "linkedin";
1029
+ interface InboxContact {
1030
+ name?: string | null;
1031
+ email?: string | null;
1032
+ company?: string | null;
1033
+ [key: string]: unknown;
1034
+ }
1035
+ interface InboxTag {
1036
+ id: string;
1037
+ name: string;
1038
+ }
1039
+ interface InboxAssignee {
1040
+ email: string;
1041
+ name?: string | null;
1042
+ [key: string]: unknown;
1043
+ }
1044
+ interface InboxMessage {
1045
+ message_id: string | null;
1046
+ from_address: string | null;
1047
+ to_addresses: string[];
1048
+ content: string | null;
1049
+ /** "USER", "AI", or "OTHER". */
1050
+ responder: string | null;
1051
+ date: string | null;
1052
+ is_draft: boolean;
1053
+ }
1054
+ interface InboxThread {
1055
+ id: string;
1056
+ /** "email", "sms", or "linkedin". */
1057
+ channel: string;
1058
+ subject: string | null;
1059
+ contact: InboxContact | null;
1060
+ messages: InboxMessage[];
1061
+ /** "open", "responded", "ai_responded", etc. */
1062
+ status: string | null;
1063
+ tags: InboxTag[];
1064
+ assignees: InboxAssignee[];
1065
+ created_at: string | null;
1066
+ updated_at: string | null;
1067
+ }
1068
+ interface InboxListParams {
1069
+ channel?: InboxChannel;
1070
+ sequence_id?: string;
1071
+ /** Filter by thread status (e.g. "open", "responded", "ai_responded"). */
1072
+ status?: string;
1073
+ /** Filter by assignee email. */
1074
+ assignee?: string;
1075
+ /** Filter by tag ID. */
1076
+ tag?: string;
1077
+ page?: number;
1078
+ /** Default 50, max 100. */
1079
+ page_size?: number;
1080
+ }
1081
+ interface InboxAssignResult {
1082
+ assigned: boolean;
1083
+ assignee: string;
1084
+ count: number;
1085
+ [key: string]: unknown;
1086
+ }
1087
+ interface InboxTagResult {
1088
+ tagged: boolean;
1089
+ tag_count: number;
1090
+ [key: string]: unknown;
1091
+ }
1092
+ interface InboxDraft {
1093
+ /** HTML body. */
1094
+ content: string;
1095
+ /** Plain-text alternative, if available. */
1096
+ plain_content: string | null;
1097
+ /** Credits charged for AI generation. */
1098
+ credits_charged: number;
1099
+ }
1100
+ interface InboxSendParams {
1101
+ body: string;
1102
+ channel: InboxChannel;
1103
+ subject?: string;
1104
+ /** Recipient override — email, phone, or LinkedIn ID. */
1105
+ to?: string;
1106
+ /** Sender override — mailbox email, Twilio number, or LinkedIn account ID. */
1107
+ from_address?: string;
1108
+ }
1109
+ interface InboxSendResult {
1110
+ message_id: string | null;
1111
+ status: string;
1112
+ channel: string;
1113
+ }
1114
+ /**
1115
+ * Inbox API — read + reply to multi-channel inbox threads (email, SMS, LinkedIn/HeyReach).
1116
+ * Requires API key (server-side).
1117
+ *
1118
+ * Backed by:
1119
+ * GET /api/v1/inbox
1120
+ * GET /api/v1/inbox/{reply_id}
1121
+ * POST /api/v1/inbox/{reply_id}/assign
1122
+ * POST /api/v1/inbox/{reply_id}/tag
1123
+ * GET /api/v1/inbox/{reply_id}/draft (charges credits, 402 on insufficient balance)
1124
+ * POST /api/v1/inbox/{reply_id}/send
1125
+ */
1126
+ declare const createInboxClient: (apiKey: string, apiUrl?: string) => {
1127
+ /** List inbox threads across email, SMS, and LinkedIn. */
1128
+ list(params?: InboxListParams): Promise<{
1129
+ data: InboxThread[];
1130
+ }>;
1131
+ /** Get a single inbox thread. Defaults to email channel. */
1132
+ get(replyId: string, channel?: InboxChannel): Promise<InboxThread>;
1133
+ /** Assign a user to an inbox thread. */
1134
+ assign(replyId: string, assigneeEmail: string, channel?: InboxChannel): Promise<InboxAssignResult>;
1135
+ /** Attach tag IDs to an inbox thread. */
1136
+ tag(replyId: string, tagIds: string[], channel?: InboxChannel): Promise<InboxTagResult>;
1137
+ /**
1138
+ * Generate an AI draft reply for a thread.
1139
+ * Charges credits — server returns 402 if balance is insufficient.
1140
+ */
1141
+ draft(replyId: string, channel?: InboxChannel): Promise<InboxDraft>;
1142
+ /** Send a reply through email, SMS, or LinkedIn. */
1143
+ send(replyId: string, payload: InboxSendParams): Promise<InboxSendResult>;
1144
+ };
1145
+
3
1146
  interface Deal {
4
1147
  id: string | null;
5
1148
  name: string | null;
@@ -79,7 +1222,7 @@ interface ContactDeal {
79
1222
  owner_id: string | null;
80
1223
  created_at: string | null;
81
1224
  }
82
- interface PaginationMeta {
1225
+ interface PaginationMeta$1 {
83
1226
  page: number;
84
1227
  limit: number;
85
1228
  total: number;
@@ -106,7 +1249,7 @@ declare const createDealsClient: (apiKey: string, apiUrl?: string) => {
106
1249
  /** List deals org-wide with optional filters and pagination. */
107
1250
  list(params?: DealListParams): Promise<{
108
1251
  data: Deal[];
109
- pagination?: PaginationMeta;
1252
+ pagination?: PaginationMeta$1;
110
1253
  }>;
111
1254
  /** Create a new deal. */
112
1255
  create(deal: DealCreateParams): Promise<Deal>;
@@ -622,20 +1765,314 @@ interface CallAnalysis {
622
1765
  }
623
1766
  type VoiceEvent = "connected" | "transcription" | "ended" | "error";
624
1767
  type VoiceCallback = (data: Record<string, unknown>) => void;
1768
+ interface VoicePagination {
1769
+ total_items: number;
1770
+ total_pages: number;
1771
+ current_page: number;
1772
+ page_size: number;
1773
+ }
1774
+ interface DialerSessionSummary {
1775
+ session_id: string;
1776
+ status: string | null;
1777
+ user_id: string | null;
1778
+ user_email: string | null;
1779
+ org_id: string | null;
1780
+ from_phone: string | null;
1781
+ campaign_id: string | null;
1782
+ campaign_builder_campaign_id: string | null;
1783
+ name: string | null;
1784
+ session_metadata: Record<string, unknown> | null;
1785
+ total_calls: number | null;
1786
+ created_at: string | null;
1787
+ updated_at: string | null;
1788
+ contact_ids: unknown[];
1789
+ }
1790
+ interface DialerSessionsListResult {
1791
+ sessions: DialerSessionSummary[];
1792
+ pagination: VoicePagination;
1793
+ }
1794
+ interface DialerSessionsListParams {
1795
+ page?: number;
1796
+ /** Default 50, max 200. */
1797
+ page_size?: number;
1798
+ /** Comma-separated status list (e.g. "ACTIVE,PAUSED"). */
1799
+ status?: string;
1800
+ user_email?: string;
1801
+ /** Substring search on session name. */
1802
+ name?: string;
1803
+ campaign_id?: string;
1804
+ list_id?: string;
1805
+ list_name?: string;
1806
+ /** ISO 8601 timestamp. */
1807
+ date_from?: string;
1808
+ /** ISO 8601 timestamp. */
1809
+ date_to?: string;
1810
+ sort_by?: string;
1811
+ /** Default "desc". */
1812
+ sort_order?: "asc" | "desc";
1813
+ }
1814
+ interface DialerStatsParams {
1815
+ session_id?: string;
1816
+ user_email?: string;
1817
+ /** YYYY-MM-DD. */
1818
+ date_from?: string;
1819
+ /** YYYY-MM-DD. */
1820
+ date_to?: string;
1821
+ /** Default "DAILY". */
1822
+ aggregation?: "DAILY" | "TOTAL";
1823
+ }
1824
+ interface DialerReportFilters {
1825
+ session_id: string | null;
1826
+ user_email: string | null;
1827
+ org_id: string | null;
1828
+ date_from: string | null;
1829
+ date_to: string | null;
1830
+ aggregation: string | null;
1831
+ }
1832
+ interface DialerReportMetric {
1833
+ date: string | null;
1834
+ sdr_name: string | null;
1835
+ org_id: string | null;
1836
+ list_title: string | null;
1837
+ total_dials: number;
1838
+ total_connections: number;
1839
+ connection_rate: number;
1840
+ total_voicemails: number;
1841
+ voicemail_rate: number;
1842
+ talk_time_minutes: number;
1843
+ avg_call_duration_minutes: number;
1844
+ dispositions: Record<string, unknown> | null;
1845
+ success_rate: number;
1846
+ unique_sessions: number;
1847
+ avg_calls_per_session: number;
1848
+ redial_count: number;
1849
+ redial_success_rate: number | null;
1850
+ peak_calling_hour: number | null;
1851
+ total_callbacks: number;
1852
+ }
1853
+ interface DialerStatsResult {
1854
+ filters: DialerReportFilters;
1855
+ metrics: DialerReportMetric[];
1856
+ summary: DialerReportMetric | null;
1857
+ }
1858
+ interface DialerNumberInfo {
1859
+ number: string;
1860
+ /** Default "ai". */
1861
+ inbound_type: string;
1862
+ /** Default "twilio". */
1863
+ telephony_provider: string;
1864
+ calls_today: number;
1865
+ calls_7d: number;
1866
+ connect_rate_7d: number;
1867
+ is_valid: boolean;
1868
+ daily_limit: number;
1869
+ assigned_to: string | null;
1870
+ created_at: string | null;
1871
+ }
1872
+ interface DialerNumbersListResult {
1873
+ numbers: DialerNumberInfo[];
1874
+ }
1875
+ interface MissedCallback {
1876
+ id: string | number | null;
1877
+ caller_phone: string | null;
1878
+ inbound_number: string | null;
1879
+ first_name: string | null;
1880
+ last_name: string | null;
1881
+ email: string | null;
1882
+ contact_id: string | number | null;
1883
+ parallel_session_id: string | null;
1884
+ created_at: string | null;
1885
+ call_duration: number | null;
1886
+ is_callback: boolean;
1887
+ }
1888
+ interface MissedCallbacksResult {
1889
+ missed_callbacks: MissedCallback[];
1890
+ count: number;
1891
+ }
1892
+ interface CallGradingResult {
1893
+ room_name: string;
1894
+ /** "ready" or "pending". */
1895
+ status: string;
1896
+ grading: Record<string, unknown> | null;
1897
+ reviewed: boolean;
1898
+ reviewed_at: string | null;
1899
+ }
1900
+ interface DialerAgentSummary {
1901
+ agent_id: string;
1902
+ agent_name: string | null;
1903
+ /** "SDR", etc. */
1904
+ role: string | null;
1905
+ agent_status: string | null;
1906
+ /** "agent" or "twin". */
1907
+ entity_type: string | null;
1908
+ description: string | null;
1909
+ phone: string | null;
1910
+ is_template: boolean;
1911
+ }
1912
+ interface DialerAgentsListResult {
1913
+ agents: DialerAgentSummary[];
1914
+ total_count: number;
1915
+ }
1916
+ interface DialerAgentsListParams {
1917
+ /** e.g. "SDR". */
1918
+ role?: string;
1919
+ agent_status?: string;
1920
+ /** "agent" or "twin". */
1921
+ entity_type?: "agent" | "twin";
1922
+ /** Substring filter on name/description. */
1923
+ search?: string;
1924
+ }
1925
+ interface DialerSessionCreateParams {
1926
+ /** 1-200 chars. */
1927
+ name: string;
1928
+ /** Org's dialer phone (E.164, 9-16 chars). */
1929
+ from_phone: string;
1930
+ /** Contact list ID (stored in session metadata). */
1931
+ list_id?: string;
1932
+ /** Display title for the source list. */
1933
+ list_title?: string;
1934
+ /** V2 agent UUID. */
1935
+ agent_id?: string;
1936
+ /** V1 fallback name. Defaults to "default_agent". */
1937
+ agent_name?: string;
1938
+ /** "agent" or "twin". */
1939
+ entity_type?: "agent" | "twin";
1940
+ /** Campaign Builder UUID. */
1941
+ studio_campaign_id?: string;
1942
+ /** IANA timezone (e.g. "America/New_York"). */
1943
+ user_timezone?: string;
1944
+ /** Per-session voicemail-skip override. null/omit = use SDR default. */
1945
+ skip_voicemails?: boolean;
1946
+ }
1947
+ interface DialerSessionCreateResult {
1948
+ session_id: string;
1949
+ status: string;
1950
+ name: string | null;
1951
+ org_id: string | null;
1952
+ user_id: string | null;
1953
+ user_email: string | null;
1954
+ from_phone: string | null;
1955
+ session_metadata: Record<string, unknown> | null;
1956
+ total_calls: number;
1957
+ created_at: string | null;
1958
+ message: string | null;
1959
+ }
1960
+ /** "ACTIVE" resumes, "PAUSED" pauses, "COMPLETED" stops. "FAILED" is rejected. */
1961
+ type DialerSessionStatus = "ACTIVE" | "PAUSED" | "COMPLETED";
1962
+ interface DialerSessionStatusUpdateResult {
1963
+ session_id: string;
1964
+ status: string;
1965
+ message: string | null;
1966
+ name: string | null;
1967
+ org_id: string | null;
1968
+ user_id: string | null;
1969
+ user_email: string | null;
1970
+ from_phone: string | null;
1971
+ session_metadata: Record<string, unknown> | null;
1972
+ total_calls: number;
1973
+ created_at: string | null;
1974
+ updated_at: string | null;
1975
+ }
1976
+ interface DialerSessionResumeResult extends DialerSessionStatusUpdateResult {
1977
+ /** Contacts actually placed in this batch (voice caps at 4). */
1978
+ dialed_count: number;
1979
+ }
625
1980
  /**
626
- * Voice AI - start AI voice calls, get transcriptions and analysis. Requires API key.
1981
+ * Voice AI start AI voice calls, get transcriptions and analysis.
1982
+ * Plus full parallel-dialer session control via the `dialer` namespace.
1983
+ * Requires API key (server-side).
1984
+ *
1985
+ * Backed by:
1986
+ * GET /api/v1/voice/dialer/sessions
1987
+ * POST /api/v1/voice/dialer/sessions
1988
+ * PATCH /api/v1/voice/dialer/sessions/{session_id}/status
1989
+ * POST /api/v1/voice/dialer/sessions/{session_id}/resume
1990
+ * GET /api/v1/voice/dialer/stats
1991
+ * GET /api/v1/voice/dialer/numbers
1992
+ * GET /api/v1/voice/dialer/missed-callbacks
1993
+ * GET /api/v1/voice/dialer/calls/{room_name}/grading
1994
+ * GET /api/v1/voice/dialer/agents
627
1995
  */
628
1996
  declare const createVoiceClient: (apiKey: string, apiUrl?: string) => {
629
- /** Start an AI voice session. */
1997
+ /**
1998
+ * Start an AI voice session.
1999
+ * @deprecated Preview surface — for parallel-dialer flows use `voice.dialer.createSession()`.
2000
+ */
630
2001
  start(config: {
631
2002
  agent?: string;
632
2003
  contactId?: number;
633
2004
  context?: Record<string, unknown>;
634
2005
  }): Promise<VoiceSession>;
635
- /** Get call analysis for a completed session. */
2006
+ /**
2007
+ * Get call analysis for a completed session.
2008
+ * @deprecated Preview surface — for dialer-call grading use `voice.dialer.callGrading(roomName)`.
2009
+ */
636
2010
  analysis(sessionId: string): Promise<CallAnalysis>;
637
2011
  /** Listen for voice events. */
638
2012
  on(event: VoiceEvent, callback: VoiceCallback): void;
2013
+ /** Parallel-dialer session control + analytics. */
2014
+ dialer: {
2015
+ /** List parallel-dialer sessions with filters + pagination. */
2016
+ listSessions(params?: DialerSessionsListParams): Promise<DialerSessionsListResult>;
2017
+ /** Create a parallel-dialer session in PAUSED state. SDR opens UI to start dialing. */
2018
+ createSession(payload: DialerSessionCreateParams): Promise<DialerSessionCreateResult>;
2019
+ /** Pause / resume / stop a dialer session via status flip. */
2020
+ updateSessionStatus(sessionId: string, status: DialerSessionStatus): Promise<DialerSessionStatusUpdateResult>;
2021
+ /**
2022
+ * Resume a PAUSED dialer session. Auto-fetches the next batch from the source list,
2023
+ * filters already-called + phoneless rows, and forwards to voice's start-session.
2024
+ * @param maxContacts 1-4 (voice caps parallel dialing at 4). Default 4.
2025
+ */
2026
+ resumeSession(sessionId: string, maxContacts?: number): Promise<DialerSessionResumeResult>;
2027
+ /** Aggregated dialer analytics (daily breakdown or total). */
2028
+ stats(params?: DialerStatsParams): Promise<DialerStatsResult>;
2029
+ /** List dialer-eligible phone numbers with 7-day stats + daily limits. */
2030
+ numbers(userEmail?: string): Promise<DialerNumbersListResult>;
2031
+ /** List missed inbound callbacks with caller / contact info. */
2032
+ missedCallbacks(limit?: number): Promise<MissedCallbacksResult>;
2033
+ /** AI grading for a single dialer call (returns "pending" while in progress). */
2034
+ callGrading(roomName: string): Promise<CallGradingResult>;
2035
+ /** List voice agents available for dialer sessions (capped at 100; no pagination). */
2036
+ agents(params?: DialerAgentsListParams): Promise<DialerAgentsListResult>;
2037
+ /** Fetch the full transcript for a single dialer call. */
2038
+ callTranscript(roomName: string): Promise<{
2039
+ data: {
2040
+ status: string;
2041
+ transcript: Array<{
2042
+ speaker: string;
2043
+ text: string;
2044
+ timestamp: number;
2045
+ }>;
2046
+ };
2047
+ }>;
2048
+ /** List dialer calls — pass `contact_id` or `user_email` to scope. */
2049
+ listCalls(params?: {
2050
+ contact_id?: number;
2051
+ user_email?: string;
2052
+ campaign_id?: string;
2053
+ date_from?: string;
2054
+ date_to?: string;
2055
+ limit?: number;
2056
+ page?: number;
2057
+ }): Promise<{
2058
+ data: Array<Record<string, unknown>>;
2059
+ pagination?: VoicePagination;
2060
+ }>;
2061
+ /** Convenience: list calls for a single contact. */
2062
+ listCallsForContact(contactId: number, extra?: {
2063
+ limit?: number;
2064
+ }): Promise<{
2065
+ data: Array<Record<string, unknown>>;
2066
+ }>;
2067
+ /** Convenience: list calls placed by a specific SDR. */
2068
+ listCallsForSdr(userEmail: string, extra?: {
2069
+ limit?: number;
2070
+ date_from?: string;
2071
+ date_to?: string;
2072
+ }): Promise<{
2073
+ data: Array<Record<string, unknown>>;
2074
+ }>;
2075
+ };
639
2076
  };
640
2077
 
641
2078
  interface AnalyticsOverview {
@@ -738,12 +2175,205 @@ interface AddToSequenceConfig {
738
2175
  contactIds: number[];
739
2176
  listId: number;
740
2177
  }
2178
+ interface SequenceListItem {
2179
+ id: string;
2180
+ name: string | null;
2181
+ status: string | null;
2182
+ user_email: string | null;
2183
+ step_count: number | null;
2184
+ contact_count: number | null;
2185
+ sequence_kind: string | null;
2186
+ associated_list_id: number | null;
2187
+ created_at: string | null;
2188
+ updated_at: string | null;
2189
+ }
2190
+ interface SequenceListParams {
2191
+ page?: number;
2192
+ limit?: number;
2193
+ /** Filter by sequence status (e.g. "live", "draft", "paused"). */
2194
+ status?: string;
2195
+ }
2196
+ interface SequenceDetail {
2197
+ id: string;
2198
+ name: string | null;
2199
+ description: string | null;
2200
+ status: string | null;
2201
+ user_email: string | null;
2202
+ associated_list_id: number | null;
2203
+ finish_on_reply: boolean;
2204
+ send_in_same_thread: boolean;
2205
+ wait_for_new_contacts: boolean;
2206
+ paused_at: string | null;
2207
+ resumed_at: string | null;
2208
+ created_at: string | null;
2209
+ updated_at: string | null;
2210
+ }
2211
+ interface SequenceContactItem {
2212
+ id: string | null;
2213
+ contact_id: number | null;
2214
+ state: string | null;
2215
+ current_step_order: number | null;
2216
+ created_at: string | null;
2217
+ updated_at: string | null;
2218
+ }
2219
+ interface SequenceContactsParams {
2220
+ page?: number;
2221
+ limit?: number;
2222
+ /** Filter by contact state (e.g. "active", "completed", "replied"). */
2223
+ state?: string;
2224
+ }
2225
+ interface SequenceActionResult {
2226
+ sequence_id: string;
2227
+ status: string;
2228
+ contacts_affected: number;
2229
+ }
2230
+ /**
2231
+ * Step type. Note: LinkedIn flows use "HEYREACH" — there is no "LINKEDIN" step type.
2232
+ * Server is case-insensitive on input but stores uppercase.
2233
+ */
2234
+ type SequenceStepType = "EMAIL" | "PHONE" | "SMS" | "WHATSAPP" | "HEYREACH" | "MANUAL_DIALER";
2235
+ type SequenceStepInputType = "ON_DEMAND" | "MANUAL_TEMPLATE" | "AI_GENERATED_TEMPLATE";
2236
+ interface SequenceStepConfig {
2237
+ step_order: number;
2238
+ step_type: SequenceStepType | string;
2239
+ /** Defaults to "ON_DEMAND". */
2240
+ input_type?: SequenceStepInputType | string;
2241
+ /** Wait time before this step in seconds. Defaults to 0. */
2242
+ time_interval?: number;
2243
+ /** Template body, AI prompt, or other step-type-specific config. */
2244
+ step_data?: Record<string, unknown>;
2245
+ }
2246
+ interface SequenceChannelConfig {
2247
+ channel_id: number;
2248
+ channel_value: string;
2249
+ channel_type: string;
2250
+ channel_data?: Record<string, unknown>;
2251
+ }
2252
+ interface SequenceCreateParams {
2253
+ name: string;
2254
+ user_email: string;
2255
+ description?: string;
2256
+ finish_on_reply?: boolean;
2257
+ send_in_same_thread?: boolean;
2258
+ wait_for_new_contacts?: boolean;
2259
+ associated_list_id?: number;
2260
+ steps?: SequenceStepConfig[];
2261
+ channels?: SequenceChannelConfig[];
2262
+ campaign_id?: string;
2263
+ }
2264
+ interface SequenceCreateResult {
2265
+ id: string;
2266
+ name: string;
2267
+ status: string;
2268
+ created_at: string | null;
2269
+ }
2270
+ interface SequenceUpdateParams {
2271
+ name?: string;
2272
+ description?: string;
2273
+ is_shared?: boolean;
2274
+ finish_on_reply?: boolean;
2275
+ send_in_same_thread?: boolean;
2276
+ wait_for_new_contacts?: boolean;
2277
+ schedule_id?: string;
2278
+ appointment_id?: number;
2279
+ }
2280
+ interface SequenceStepUpdateParams {
2281
+ step_data?: Record<string, unknown>;
2282
+ time_interval?: number;
2283
+ step_type?: SequenceStepType | string;
2284
+ input_type?: SequenceStepInputType | string;
2285
+ }
2286
+ interface SequencePreviewStep {
2287
+ id: string;
2288
+ step_order: number;
2289
+ step_type: string;
2290
+ input_type: string;
2291
+ time_interval: number | null;
2292
+ step_data: Record<string, unknown> | null;
2293
+ }
2294
+ interface SequencePreviewChannel {
2295
+ id: string;
2296
+ channel_id: number | null;
2297
+ channel_value: string | null;
2298
+ channel_type: string | null;
2299
+ }
2300
+ interface SequencePreview {
2301
+ id: string;
2302
+ name: string | null;
2303
+ status: string | null;
2304
+ description: string | null;
2305
+ steps: SequencePreviewStep[];
2306
+ channels: SequencePreviewChannel[];
2307
+ }
2308
+ interface SequenceAnalytics {
2309
+ overview: Record<string, unknown>;
2310
+ performance: Record<string, unknown>;
2311
+ engagement: Record<string, unknown>;
2312
+ timeline: Record<string, unknown>[];
2313
+ contact_distribution: Record<string, unknown>;
2314
+ step_breakdown: Record<string, unknown>[];
2315
+ step_creation_methods: Record<string, unknown>[];
2316
+ sender_distribution: Record<string, unknown>[];
2317
+ }
2318
+ interface PaginationMeta {
2319
+ page: number;
2320
+ limit: number;
2321
+ total: number;
2322
+ has_next: boolean;
2323
+ }
741
2324
  /**
742
- * Sequences - manage outbound sequences. Requires API key (server-side).
2325
+ * Sequences API list, create, run, pause, update, analyze multi-channel sequences.
2326
+ * Requires API key (server-side).
2327
+ *
2328
+ * Backed by:
2329
+ * GET /api/v1/sequences
2330
+ * POST /api/v1/sequences
2331
+ * GET /api/v1/sequences/{sequence_id}
2332
+ * PATCH /api/v1/sequences/{sequence_id}
2333
+ * DELETE /api/v1/sequences/{sequence_id}
2334
+ * GET /api/v1/sequences/{sequence_id}/contacts
2335
+ * POST /api/v1/sequences/{sequence_id}/contacts
2336
+ * POST /api/v1/sequences/{sequence_id}/run
2337
+ * POST /api/v1/sequences/{sequence_id}/pause
2338
+ * POST /api/v1/sequences/{sequence_id}/resume
2339
+ * PATCH /api/v1/sequences/{sequence_id}/steps/{step_id}
2340
+ * GET /api/v1/sequences/{sequence_id}/preview
2341
+ * GET /api/v1/sequences/{sequence_id}/analytics
743
2342
  */
744
2343
  declare const createSequencesClient: (apiKey: string, apiUrl?: string) => {
745
- list(page?: number, limit?: number): Promise<Sequence[]>;
746
- add(config: AddToSequenceConfig): Promise<void>;
2344
+ /** List sequences with pagination + optional status filter. */
2345
+ list: {
2346
+ (): Promise<SequenceListItem[]>;
2347
+ (page: number, limit?: number): Promise<SequenceListItem[]>;
2348
+ (params: SequenceListParams): Promise<SequenceListItem[]>;
2349
+ };
2350
+ /** Get full sequence details by ID. */
2351
+ get(sequenceId: string): Promise<SequenceDetail>;
2352
+ /** List contacts enrolled in a sequence. Filter by state (e.g. "active", "replied"). */
2353
+ contacts(sequenceId: string, params?: SequenceContactsParams): Promise<{
2354
+ data: SequenceContactItem[];
2355
+ pagination?: PaginationMeta;
2356
+ }>;
2357
+ /** Add contacts to a sequence (V2 queuing). Live or drafted sequences only. */
2358
+ add(config: AddToSequenceConfig): Promise<SequenceActionResult>;
2359
+ /** Create a new sequence with optional steps + channels. */
2360
+ create(payload: SequenceCreateParams): Promise<SequenceCreateResult>;
2361
+ /** Update sequence metadata. Rejected (409) if sequence is in a transitional status. */
2362
+ update(sequenceId: string, fields: SequenceUpdateParams): Promise<SequenceActionResult>;
2363
+ /** Update a single step within a sequence. */
2364
+ updateStep(sequenceId: string, stepId: string, fields: SequenceStepUpdateParams): Promise<SequenceActionResult>;
2365
+ /** Soft-delete (archive) a sequence. */
2366
+ delete(sequenceId: string): Promise<SequenceActionResult>;
2367
+ /** Run/start a DRAFTED sequence (V2 orchestration). */
2368
+ run(sequenceId: string): Promise<SequenceActionResult>;
2369
+ /** Pause a live sequence. */
2370
+ pause(sequenceId: string): Promise<SequenceActionResult>;
2371
+ /** Resume a paused sequence. */
2372
+ resume(sequenceId: string): Promise<SequenceActionResult>;
2373
+ /** Read-only sequence preview with all steps + channels (no enrollment). */
2374
+ preview(sequenceId: string): Promise<SequencePreview>;
2375
+ /** Comprehensive analytics for a sequence. */
2376
+ analytics(sequenceId: string): Promise<SequenceAnalytics>;
747
2377
  };
748
2378
 
749
2379
  interface PersonEnrichment {
@@ -1044,6 +2674,14 @@ declare class G8 {
1044
2674
  /** @internal */ _tasks: ReturnType<typeof createTasksClient> | null;
1045
2675
  /** @internal */ _fields: ReturnType<typeof createFieldsClient> | null;
1046
2676
  /** @internal */ _deals: ReturnType<typeof createDealsClient> | null;
2677
+ /** @internal */ _inbox: ReturnType<typeof createInboxClient> | null;
2678
+ /** @internal */ _quotes: ReturnType<typeof createQuotesClient> | null;
2679
+ /** @internal */ _pipelines: ReturnType<typeof createPipelinesClient> | null;
2680
+ /** @internal */ _workflows: ReturnType<typeof createWorkflowsClient> | null;
2681
+ /** @internal */ _skills: ReturnType<typeof createSkillsClient> | null;
2682
+ /** @internal */ _intent: ReturnType<typeof createIntentClient> | null;
2683
+ /** @internal */ _studio: ReturnType<typeof createStudioClient> | null;
2684
+ /** @internal */ _meetings: ReturnType<typeof createMeetingsClient> | null;
1047
2685
  /**
1048
2686
  * Initialize the graph8 SDK. Must be called before any other method.
1049
2687
  * Safe to call on the server (SSR) - becomes a no-op for tracking.
@@ -1104,7 +2742,19 @@ declare class G8 {
1104
2742
  company_domain?: string;
1105
2743
  }): Promise<PersonEnrichment>;
1106
2744
  company(params: {
1107
- domain?: string;
2745
+ domain
2746
+ /**
2747
+ * graph8 SDK client.
2748
+ *
2749
+ * Handles event tracking, identity, and progressive forms.
2750
+ *
2751
+ * Usage:
2752
+ * import { g8 } from '@graph8/js';
2753
+ * g8.init({ writeKey: 'your_write_key' });
2754
+ * g8.track('page_view', { page: '/pricing' });
2755
+ * g8.identify('user@acme.com', { name: 'John', company: 'Acme' });
2756
+ */
2757
+ ?: string;
1108
2758
  name?: string;
1109
2759
  }): Promise<CompanyEnrichment>;
1110
2760
  verifyEmail(email: string): Promise<EmailVerification>;
@@ -1112,8 +2762,26 @@ declare class G8 {
1112
2762
  };
1113
2763
  /** Sequences (requires API key). */
1114
2764
  get sequences(): {
1115
- list(page?: number, limit?: number): Promise<Sequence[]>;
1116
- add(config: AddToSequenceConfig): Promise<void>;
2765
+ list: {
2766
+ (): Promise<SequenceListItem[]>;
2767
+ (page: number, limit?: number): Promise<SequenceListItem[]>;
2768
+ (params: SequenceListParams): Promise<SequenceListItem[]>;
2769
+ };
2770
+ get(sequenceId: string): Promise<SequenceDetail>;
2771
+ contacts(sequenceId: string, params?: SequenceContactsParams): Promise<{
2772
+ data: SequenceContactItem[];
2773
+ pagination?: PaginationMeta;
2774
+ }>;
2775
+ add(config: AddToSequenceConfig): Promise<SequenceActionResult>;
2776
+ create(payload: SequenceCreateParams): Promise<SequenceCreateResult>;
2777
+ update(sequenceId: string, fields: SequenceUpdateParams): Promise<SequenceActionResult>;
2778
+ updateStep(sequenceId: string, stepId: string, fields: SequenceStepUpdateParams): Promise<SequenceActionResult>;
2779
+ delete(sequenceId: string): Promise<SequenceActionResult>;
2780
+ run(sequenceId: string): Promise<SequenceActionResult>;
2781
+ pause(sequenceId: string): Promise<SequenceActionResult>;
2782
+ resume(sequenceId: string): Promise<SequenceActionResult>;
2783
+ preview(sequenceId: string): Promise<SequencePreview>;
2784
+ analytics(sequenceId: string): Promise<SequenceAnalytics>;
1117
2785
  };
1118
2786
  /** Campaigns (requires API key). */
1119
2787
  get campaigns(): {
@@ -1152,6 +2820,51 @@ declare class G8 {
1152
2820
  }): Promise<VoiceSession>;
1153
2821
  analysis(sessionId: string): Promise<CallAnalysis>;
1154
2822
  on(event: "error" | "ended" | "connected" | "transcription", callback: (data: Record<string, unknown>) => void): void;
2823
+ dialer: {
2824
+ listSessions(params?: DialerSessionsListParams): Promise<DialerSessionsListResult>;
2825
+ createSession(payload: DialerSessionCreateParams): Promise<DialerSessionCreateResult>;
2826
+ updateSessionStatus(sessionId: string, status: DialerSessionStatus): Promise<DialerSessionStatusUpdateResult>;
2827
+ resumeSession(sessionId: string, maxContacts?: number): Promise<DialerSessionResumeResult>;
2828
+ stats(params?: DialerStatsParams): Promise<DialerStatsResult>;
2829
+ numbers(userEmail?: string): Promise<DialerNumbersListResult>;
2830
+ missedCallbacks(limit?: number): Promise<MissedCallbacksResult>;
2831
+ callGrading(roomName: string): Promise<CallGradingResult>;
2832
+ agents(params?: DialerAgentsListParams): Promise<DialerAgentsListResult>;
2833
+ callTranscript(roomName: string): Promise<{
2834
+ data: {
2835
+ status: string;
2836
+ transcript: Array<{
2837
+ speaker: string;
2838
+ text: string;
2839
+ timestamp: number;
2840
+ }>;
2841
+ };
2842
+ }>;
2843
+ listCalls(params?: {
2844
+ contact_id?: number;
2845
+ user_email?: string;
2846
+ campaign_id?: string;
2847
+ date_from?: string;
2848
+ date_to?: string;
2849
+ limit?: number;
2850
+ page?: number;
2851
+ }): Promise<{
2852
+ data: Array<Record<string, unknown>>;
2853
+ pagination?: VoicePagination;
2854
+ }>;
2855
+ listCallsForContact(contactId: number, extra?: {
2856
+ limit?: number;
2857
+ }): Promise<{
2858
+ data: Array<Record<string, unknown>>;
2859
+ }>;
2860
+ listCallsForSdr(userEmail: string, extra?: {
2861
+ limit?: number;
2862
+ date_from?: string;
2863
+ date_to?: string;
2864
+ }): Promise<{
2865
+ data: Array<Record<string, unknown>>;
2866
+ }>;
2867
+ };
1155
2868
  };
1156
2869
  /** Landing pages (requires API key). */
1157
2870
  get pages(): {
@@ -1291,7 +3004,7 @@ declare class G8 {
1291
3004
  }>;
1292
3005
  list(params?: DealListParams): Promise<{
1293
3006
  data: Deal[];
1294
- pagination?: PaginationMeta;
3007
+ pagination?: PaginationMeta$1;
1295
3008
  }>;
1296
3009
  create(deal: DealCreateParams): Promise<Deal>;
1297
3010
  get(dealId: string): Promise<Deal>;
@@ -1308,6 +3021,369 @@ declare class G8 {
1308
3021
  data: ContactDeal[];
1309
3022
  }>;
1310
3023
  };
3024
+ /** Multi-channel inbox — read + reply across email, SMS, LinkedIn (requires API key). */
3025
+ get inbox(): {
3026
+ list(params?: InboxListParams): Promise<{
3027
+ data: InboxThread[];
3028
+ }>;
3029
+ get(replyId: string, channel?: InboxChannel): Promise<InboxThread>;
3030
+ assign(replyId: string, assigneeEmail: string, channel?: InboxChannel): Promise<InboxAssignResult>;
3031
+ tag(replyId: string, tagIds: string[], channel?: InboxChannel): Promise<InboxTagResult>;
3032
+ draft(replyId: string, channel?: InboxChannel): Promise<InboxDraft>;
3033
+ send(replyId: string, payload: InboxSendParams): Promise<InboxSendResult>;
3034
+ };
3035
+ /** Quote-to-cash: draft, send, sign, payment-link quotes (requires API key). */
3036
+ get quotes(): {
3037
+ list(params?: QuoteListParams): Promise<{
3038
+ data: QuoteSummary[];
3039
+ pagination?: PaginationMeta$2;
3040
+ }>;
3041
+ get(quoteId: string): Promise<QuoteDetail>;
3042
+ create(quote: QuoteCreateParams): Promise<QuoteDetail>;
3043
+ update(quoteId: string, fields: QuoteUpdateParams): Promise<QuoteDetail>;
3044
+ delete(quoteId: string): Promise<{
3045
+ data: {
3046
+ deleted: boolean;
3047
+ };
3048
+ }>;
3049
+ duplicate(quoteId: string): Promise<QuoteDetail>;
3050
+ editAsDraft(quoteId: string): Promise<{
3051
+ data: {
3052
+ id: string;
3053
+ status: string;
3054
+ };
3055
+ }>;
3056
+ send(quoteId: string, params: QuoteSendParams): Promise<QuoteDetail>;
3057
+ products(): Promise<{
3058
+ data: QuotableProduct[];
3059
+ }>;
3060
+ settings(): Promise<QuoteSettings>;
3061
+ forContact(contactId: number): Promise<{
3062
+ data: QuoteSummary[];
3063
+ }>;
3064
+ forCompany(companyId: number): Promise<{
3065
+ data: QuoteSummary[];
3066
+ }>;
3067
+ };
3068
+ /** Stage Checklist v2 pipelines: workflow stages with evidence + scripts (requires API key). */
3069
+ get pipelines(): {
3070
+ list(): Promise<{
3071
+ data: StagePipeline[];
3072
+ }>;
3073
+ get(pipelineId: string): Promise<StagePipeline>;
3074
+ evidenceLibrary(): Promise<{
3075
+ data: EvidenceKey[];
3076
+ }>;
3077
+ create(params: StagePipelineCreateParams): Promise<StagePipeline>;
3078
+ update(pipelineId: string, fields: StagePipelineUpdateParams): Promise<StagePipeline>;
3079
+ delete(pipelineId: string): Promise<{
3080
+ data: {
3081
+ deleted: boolean;
3082
+ };
3083
+ }>;
3084
+ createStage(pipelineId: string, stage: StageCreateParams): Promise<StagePipelineStage>;
3085
+ updateStage(pipelineId: string, stageId: string, fields: StageUpdateParams): Promise<StagePipelineStage>;
3086
+ reorderStages(pipelineId: string, stageIds: string[]): Promise<{
3087
+ data: StagePipelineStage[];
3088
+ }>;
3089
+ deleteStage(pipelineId: string, stageId: string): Promise<{
3090
+ data: {
3091
+ deleted: boolean;
3092
+ };
3093
+ }>;
3094
+ suggest(): Promise<{
3095
+ data: PipelineSuggestion;
3096
+ }>;
3097
+ fromSuggestion(suggestionId: string, overrides?: Partial<{
3098
+ name: string;
3099
+ target: string;
3100
+ }>): Promise<StagePipeline>;
3101
+ };
3102
+ /** Workflow builder — multi-node automation graphs with execution lifecycle (requires API key). */
3103
+ get workflows(): {
3104
+ list(params?: WorkflowListParams): Promise<{
3105
+ data: Workflow[];
3106
+ }>;
3107
+ get(workflowId: string): Promise<Workflow>;
3108
+ create(params: WorkflowCreateParams): Promise<Workflow>;
3109
+ update(workflowId: string, fields: WorkflowUpdateParams): Promise<Workflow>;
3110
+ delete(workflowId: string): Promise<{
3111
+ data: {
3112
+ deleted: boolean;
3113
+ };
3114
+ }>;
3115
+ validate(workflow: {
3116
+ config: WorkflowConfig;
3117
+ trigger_config?: Record<string, unknown>;
3118
+ }): Promise<{
3119
+ data: {
3120
+ valid: boolean;
3121
+ errors: Array<{
3122
+ node_id?: string;
3123
+ field?: string;
3124
+ message: string;
3125
+ }>;
3126
+ };
3127
+ }>;
3128
+ execute(workflowId: string, triggerPayload?: Record<string, unknown>): Promise<WorkflowExecution>;
3129
+ getExecution(executionId: string): Promise<WorkflowExecution>;
3130
+ pauseExecution(executionId: string): Promise<{
3131
+ data: {
3132
+ paused: boolean;
3133
+ };
3134
+ }>;
3135
+ resumeExecution(executionId: string): Promise<{
3136
+ data: {
3137
+ resumed: boolean;
3138
+ };
3139
+ }>;
3140
+ stopExecution(executionId: string): Promise<{
3141
+ data: {
3142
+ stopped: boolean;
3143
+ };
3144
+ }>;
3145
+ getTriggerStatus(workflowId: string): Promise<{
3146
+ data: {
3147
+ status: string;
3148
+ details: Record<string, unknown>;
3149
+ };
3150
+ }>;
3151
+ resetTrigger(workflowId: string): Promise<{
3152
+ data: {
3153
+ reset: boolean;
3154
+ };
3155
+ }>;
3156
+ nodeTypes(params?: {
3157
+ type?: string;
3158
+ }): Promise<{
3159
+ data: NodeTypeSchema[];
3160
+ }>;
3161
+ listSlackUsers(): Promise<{
3162
+ data: Array<{
3163
+ id: string;
3164
+ name: string;
3165
+ email: string | null;
3166
+ }>;
3167
+ }>;
3168
+ listSlackChannels(): Promise<{
3169
+ data: Array<{
3170
+ id: string;
3171
+ name: string;
3172
+ is_private: boolean;
3173
+ }>;
3174
+ }>;
3175
+ listRoamUsers(): Promise<{
3176
+ data: Array<{
3177
+ id: string;
3178
+ name: string;
3179
+ email: string | null;
3180
+ }>;
3181
+ }>;
3182
+ listRoamGroups(): Promise<{
3183
+ data: Array<{
3184
+ id: string;
3185
+ name: string;
3186
+ }>;
3187
+ }>;
3188
+ listMcpServers(): Promise<{
3189
+ data: Array<{
3190
+ id: string;
3191
+ name: string;
3192
+ url: string;
3193
+ }>;
3194
+ }>;
3195
+ listDispositions(): Promise<{
3196
+ data: Array<{
3197
+ id: string;
3198
+ label: string;
3199
+ }>;
3200
+ }>;
3201
+ listFormFields(formId: string): Promise<{
3202
+ data: Array<{
3203
+ name: string;
3204
+ type: string;
3205
+ required: boolean;
3206
+ }>;
3207
+ }>;
3208
+ };
3209
+ /** Skill authoring — LLM and API building blocks that workflows compose (requires API key). */
3210
+ get skills(): {
3211
+ list(params?: SkillListParams): Promise<{
3212
+ data: Skill[];
3213
+ }>;
3214
+ get(skillId: string): Promise<Skill>;
3215
+ getVariables(skillId: string): Promise<{
3216
+ data: SkillInputField[];
3217
+ }>;
3218
+ listModels(): Promise<{
3219
+ data: Array<{
3220
+ id: string;
3221
+ label: string;
3222
+ provider: string;
3223
+ }>;
3224
+ }>;
3225
+ listTemplates(params?: {
3226
+ type?: SkillType;
3227
+ }): Promise<{
3228
+ data: SkillTemplate[];
3229
+ }>;
3230
+ createLLM(params: SkillCreateLLMParams): Promise<Skill>;
3231
+ createAPI(params: SkillCreateAPIParams): Promise<Skill>;
3232
+ createFromTemplate(params: {
3233
+ title: string;
3234
+ template_id: string;
3235
+ overrides?: Record<string, unknown>;
3236
+ }): Promise<Skill>;
3237
+ createFromNode(params: {
3238
+ title: string;
3239
+ description?: string;
3240
+ node_id: string;
3241
+ input_mapping?: Record<string, string>;
3242
+ output_mapping?: Record<string, string>;
3243
+ }): Promise<Skill>;
3244
+ updateLLM(skillId: string, fields: SkillUpdateLLMParams): Promise<Skill>;
3245
+ updateAPI(skillId: string, fields: SkillUpdateAPIParams): Promise<Skill>;
3246
+ delete(skillId: string): Promise<{
3247
+ data: {
3248
+ deleted: boolean;
3249
+ };
3250
+ }>;
3251
+ validate(skill: Partial<Skill>): Promise<{
3252
+ data: {
3253
+ valid: boolean;
3254
+ errors: string[];
3255
+ };
3256
+ }>;
3257
+ execute(skillId: string, inputPayload: Record<string, unknown>): Promise<{
3258
+ data: {
3259
+ output: Record<string, unknown>;
3260
+ latency_ms: number;
3261
+ tokens?: number;
3262
+ error: string | null;
3263
+ };
3264
+ }>;
3265
+ };
3266
+ /** Intent tracking — keyword groups, page visitors, account-level intent (requires API key). */
3267
+ get intent(): {
3268
+ stats(): Promise<{
3269
+ data: IntentStats;
3270
+ }>;
3271
+ listKeywords(params?: {
3272
+ page?: number;
3273
+ limit?: number;
3274
+ search?: string;
3275
+ }): Promise<{
3276
+ data: IntentKeyword[];
3277
+ }>;
3278
+ createFromDomain(domain: string): Promise<{
3279
+ data: IntentKeyword;
3280
+ }>;
3281
+ deleteKeyword(keywordId: string): Promise<{
3282
+ data: {
3283
+ deleted: boolean;
3284
+ };
3285
+ }>;
3286
+ keywordCompanies(keywordId: string, params?: {
3287
+ limit?: number;
3288
+ date_from?: string;
3289
+ date_to?: string;
3290
+ }): Promise<{
3291
+ data: IntentCompany[];
3292
+ }>;
3293
+ keywordContacts(keywordId: string, params?: {
3294
+ limit?: number;
3295
+ date_from? /** @internal */: string;
3296
+ date_to?: string;
3297
+ }): Promise<{
3298
+ data: IntentContact[];
3299
+ }>;
3300
+ keywordUrls(keywordId: string, params?: {
3301
+ limit?: number;
3302
+ }): Promise<{
3303
+ data: IntentPage[];
3304
+ }>;
3305
+ pagesByDomain(domain: string, params?: {
3306
+ limit?: number;
3307
+ }): Promise<{
3308
+ data: IntentPage[];
3309
+ }>;
3310
+ searchPages(query: string, params?: {
3311
+ limit?: number;
3312
+ }): Promise<{
3313
+ data: IntentPage[];
3314
+ }>;
3315
+ pageVisitors(pageUrl: string, params?: {
3316
+ limit?: number;
3317
+ date_from?: string;
3318
+ date_to?: string;
3319
+ }): Promise<{
3320
+ data: IntentVisitor[];
3321
+ }>;
3322
+ pageContacts(pageUrl: string, params?: {
3323
+ limit?: number;
3324
+ }): Promise<{
3325
+ data: IntentContact[];
3326
+ }>;
3327
+ pageVisitorCounts(urls: string[]): Promise<{
3328
+ data: Array<{
3329
+ url: string;
3330
+ visitor_count: number;
3331
+ }>;
3332
+ }>;
3333
+ urlCompanies(url: string, params?: {
3334
+ limit?: number;
3335
+ date_from?: string;
3336
+ date_to?: string;
3337
+ }): Promise<{
3338
+ data: IntentCompany[];
3339
+ }>;
3340
+ };
3341
+ /** Studio context — ICPs, personas, brand briefs, intelligence, AI research reports (requires API key). */
3342
+ get studio(): {
3343
+ globalContext(params?: {
3344
+ category?: string;
3345
+ limit?: number;
3346
+ }): Promise<{
3347
+ data: GlobalContextDocument[];
3348
+ }>;
3349
+ icps(params?: {
3350
+ status?: string;
3351
+ limit?: number;
3352
+ }): Promise<{
3353
+ data: ICP[];
3354
+ }>;
3355
+ personas(params?: {
3356
+ status?: string;
3357
+ limit?: number;
3358
+ }): Promise<{
3359
+ data: Persona[];
3360
+ }>;
3361
+ intelligenceData(params?: {
3362
+ source_type?: string;
3363
+ limit?: number;
3364
+ }): Promise<{
3365
+ data: IntelligenceData[];
3366
+ }>;
3367
+ researchReports(params?: {
3368
+ category?: string;
3369
+ limit?: number;
3370
+ }): Promise<{
3371
+ data: ResearchReport[];
3372
+ }>;
3373
+ };
3374
+ /** Meetings — read scheduled, completed, cancelled meetings with transcripts + AI analysis (requires API key). */
3375
+ get meetings(): {
3376
+ list(params?: MeetingListParams): Promise<{
3377
+ data: MeetingSummary[];
3378
+ pagination?: {
3379
+ page: number;
3380
+ limit: number;
3381
+ total: number;
3382
+ has_next: boolean;
3383
+ };
3384
+ }>;
3385
+ get(meetingId: string): Promise<MeetingDetail>;
3386
+ };
1311
3387
  /** Whether the SDK has been initialized. */
1312
3388
  get initialized(): boolean;
1313
3389
  /** @internal */
@@ -1318,4 +3394,4 @@ declare class G8 {
1318
3394
  /** Singleton g8 client instance. */
1319
3395
  declare const g8: G8;
1320
3396
 
1321
- export { type AddToSequenceConfig, type AnalyticsOverview, type Booking, type BookingRequest, type CalendarConfig, type CallAnalysis, type Campaign, type CampaignCreateConfig, type CampaignStats, type ChatConfig, type Company, type CompanyColumn, type CompanyColumnCreateParams, type CompanyContact, type CompanyEnrichment, type CompanyListParams, type CompanyUpdateParams, type Contact, type ContactColumn, type ContactColumnCreateParams, type ContactCreateParams, type ContactDeal, type ContactList, type ContactListParams, type ContactUpdateParams, type CopilotConfig, type CreatedField, type Deal, type DealCreateParams, type DealListParams, type DealUpdateParams, type EmailVerification, type EnrichLookupResult, type Field, type FieldCreateParams, type FieldDeleteParams, type G8Config, type G8PrivacyConfig, type IdentifyProperties, type Integration, type IntentSignals, type LandingPage, type ListContact, type Note, type PaginationMeta, type PersonEnrichment, type Pipeline, type PipelineStage, type SearchFilter, type SearchResults, type Sequence, type SetFieldValueParams, type Task, type TaskCreateParams, type TaskListParams, type TaskUpdateParams, type TimeSlot, type TrackProperties, type VisitorCompany, type VisitorScore, type VoiceSession, type WebhookEvent, g8 };
3397
+ export { type AddToSequenceConfig, type AnalyticsOverview, type Booking, type BookingRequest, type CalendarConfig, type CallAnalysis, type CallGradingResult, type Campaign, type CampaignCreateConfig, type CampaignStats, type ChatConfig, type Company, type CompanyColumn, type CompanyColumnCreateParams, type CompanyContact, type CompanyEnrichment, type CompanyListParams, type CompanyUpdateParams, type Contact, type ContactColumn, type ContactColumnCreateParams, type ContactCreateParams, type ContactDeal, type ContactList, type ContactListParams, type ContactUpdateParams, type CopilotConfig, type CreatedField, type Deal, type DealCreateParams, type DealListParams, type DealUpdateParams, type DialerAgentSummary, type DialerAgentsListParams, type DialerAgentsListResult, type DialerNumberInfo, type DialerNumbersListResult, type DialerReportFilters, type DialerReportMetric, type DialerSessionCreateParams, type DialerSessionCreateResult, type DialerSessionResumeResult, type DialerSessionStatus, type DialerSessionStatusUpdateResult, type DialerSessionSummary, type DialerSessionsListParams, type DialerSessionsListResult, type DialerStatsParams, type DialerStatsResult, type EmailVerification, type EnrichLookupResult, type EvidenceKey, type Field, type FieldCreateParams, type FieldDeleteParams, type G8Config, type G8PrivacyConfig, type GlobalContextDocument, type ICP, type IdentifyProperties, type InboxAssignResult, type InboxAssignee, type InboxChannel, type InboxContact, type InboxDraft, type InboxListParams, type InboxMessage, type InboxSendParams, type InboxSendResult, type InboxTag, type InboxTagResult, type InboxThread, type Integration, type IntelligenceData, type IntentCompany, type IntentContact, type IntentKeyword, type IntentPage, type IntentSignals, type IntentStats, type IntentVisitor, type LandingPage, type ListContact, type MeetingAnalysis, type MeetingAttendee, type MeetingDetail, type MeetingListParams, type MeetingSummary, type MeetingTranscriptLine, type MissedCallback, type MissedCallbacksResult, type NodeTypeSchema, type Note, type PaginationMeta$1 as PaginationMeta, type PersonEnrichment, type Persona, type Pipeline, type PipelineStage, type PipelineSuggestion, type QuotableProduct, type QuoteCreateParams, type QuoteDetail, type QuoteLineItem, type QuoteListParams, type QuoteSendParams, type QuoteSettings, type QuoteStatus, type QuoteSummary, type QuoteUpdateParams, type ResearchReport, type SearchFilter, type SearchResults, type Sequence, type SequenceActionResult, type SequenceAnalytics, type SequenceChannelConfig, type SequenceContactItem, type SequenceContactsParams, type SequenceCreateParams, type SequenceCreateResult, type SequenceDetail, type SequenceListItem, type SequenceListParams, type SequencePreview, type SequencePreviewChannel, type SequencePreviewStep, type SequenceStepConfig, type SequenceStepInputType, type SequenceStepType, type SequenceStepUpdateParams, type SequenceUpdateParams, type SetFieldValueParams, type Skill, type SkillCreateAPIParams, type SkillCreateLLMParams, type SkillInputField, type SkillListParams, type SkillTemplate, type SkillType, type SkillUpdateAPIParams, type SkillUpdateLLMParams, type StageCreateParams, type StagePipeline, type StagePipelineCreateParams, type StagePipelineStage, type StagePipelineUpdateParams, type StageUpdateParams, type Task, type TaskCreateParams, type TaskListParams, type TaskUpdateParams, type TimeSlot, type TrackProperties, type VisitorCompany, type VisitorScore, type VoicePagination, type VoiceSession, type WebhookEvent, type Workflow, type WorkflowConfig, type WorkflowConnection, type WorkflowCreateParams, type WorkflowExecution, type WorkflowListParams, type WorkflowNode, type WorkflowUpdateParams, g8 };