@graph8/sdk 0.4.0 → 0.5.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/index.js CHANGED
@@ -703,6 +703,38 @@ var createVoiceClient = (apiKey, apiUrl) => {
703
703
  );
704
704
  const data = await resp.json();
705
705
  return data.data || data;
706
+ },
707
+ /** Fetch the full transcript for a single dialer call. */
708
+ async callTranscript(roomName) {
709
+ const resp = await fetch(
710
+ `${baseUrl}/api/v1/voice/dialer/calls/${encodeURIComponent(roomName)}/transcript`,
711
+ { headers: headers() }
712
+ );
713
+ return resp.json();
714
+ },
715
+ /** List dialer calls — pass `contact_id` or `user_email` to scope. */
716
+ async listCalls(params = {}) {
717
+ const resp = await fetch(
718
+ `${baseUrl}/api/v1/voice/dialer/calls${toQuery(params)}`,
719
+ { headers: headers() }
720
+ );
721
+ return resp.json();
722
+ },
723
+ /** Convenience: list calls for a single contact. */
724
+ async listCallsForContact(contactId, extra = {}) {
725
+ const resp = await fetch(
726
+ `${baseUrl}/api/v1/voice/dialer/calls${toQuery({ contact_id: contactId, ...extra })}`,
727
+ { headers: headers() }
728
+ );
729
+ return resp.json();
730
+ },
731
+ /** Convenience: list calls placed by a specific SDR. */
732
+ async listCallsForSdr(userEmail, extra = {}) {
733
+ const resp = await fetch(
734
+ `${baseUrl}/api/v1/voice/dialer/calls${toQuery({ user_email: userEmail, ...extra })}`,
735
+ { headers: headers() }
736
+ );
737
+ return resp.json();
706
738
  }
707
739
  };
708
740
  return {
@@ -1342,9 +1374,677 @@ var createInboxClient = (apiKey, apiUrl) => {
1342
1374
  };
1343
1375
  };
1344
1376
 
1377
+ // src/quotes.ts
1378
+ var DEFAULT_API23 = "https://be.graph8.com";
1379
+ var createQuotesClient = (apiKey, apiUrl) => {
1380
+ const baseUrl = apiUrl || DEFAULT_API23;
1381
+ const headers = () => ({ "Content-Type": "application/json", Authorization: `Bearer ${apiKey}` });
1382
+ const toQuery = (params) => {
1383
+ const qs = new URLSearchParams();
1384
+ for (const [k, v] of Object.entries(params)) {
1385
+ if (v != null) qs.set(k, String(v));
1386
+ }
1387
+ const s = qs.toString();
1388
+ return s ? `?${s}` : "";
1389
+ };
1390
+ return {
1391
+ /** List quotes org-wide with optional filters and pagination. */
1392
+ async list(params = {}) {
1393
+ const resp = await fetch(`${baseUrl}/api/v1/quotes${toQuery(params)}`, { headers: headers() });
1394
+ return resp.json();
1395
+ },
1396
+ /** Get full details for a single quote. */
1397
+ async get(quoteId) {
1398
+ const resp = await fetch(`${baseUrl}/api/v1/quotes/${quoteId}`, { headers: headers() });
1399
+ const data = await resp.json();
1400
+ return data.data || data;
1401
+ },
1402
+ /** Create a new quote from line items. */
1403
+ async create(quote) {
1404
+ const resp = await fetch(`${baseUrl}/api/v1/quotes`, {
1405
+ method: "POST",
1406
+ headers: headers(),
1407
+ body: JSON.stringify(quote)
1408
+ });
1409
+ const data = await resp.json();
1410
+ return data.data || data;
1411
+ },
1412
+ /** Update a draft quote (line items, expiry, notes). */
1413
+ async update(quoteId, fields) {
1414
+ const resp = await fetch(`${baseUrl}/api/v1/quotes/${quoteId}`, {
1415
+ method: "PUT",
1416
+ headers: headers(),
1417
+ body: JSON.stringify(fields)
1418
+ });
1419
+ const data = await resp.json();
1420
+ return data.data || data;
1421
+ },
1422
+ /** Delete a draft quote (irreversible). */
1423
+ async delete(quoteId) {
1424
+ const resp = await fetch(`${baseUrl}/api/v1/quotes/${quoteId}`, {
1425
+ method: "DELETE",
1426
+ headers: headers()
1427
+ });
1428
+ return resp.json();
1429
+ },
1430
+ /** Duplicate an existing quote (all line items copied into a new draft). */
1431
+ async duplicate(quoteId) {
1432
+ const resp = await fetch(`${baseUrl}/api/v1/quotes/${quoteId}/duplicate`, {
1433
+ method: "POST",
1434
+ headers: headers(),
1435
+ body: JSON.stringify({})
1436
+ });
1437
+ const data = await resp.json();
1438
+ return data.data || data;
1439
+ },
1440
+ /** Convert a signed / sent quote back to editable draft state. */
1441
+ async editAsDraft(quoteId) {
1442
+ const resp = await fetch(`${baseUrl}/api/v1/quotes/${quoteId}/edit-as-draft`, {
1443
+ method: "POST",
1444
+ headers: headers(),
1445
+ body: JSON.stringify({})
1446
+ });
1447
+ return resp.json();
1448
+ },
1449
+ /** Send a quote to its recipient via email (with signature + optional payment link). */
1450
+ async send(quoteId, params) {
1451
+ const resp = await fetch(`${baseUrl}/api/v1/quotes/${quoteId}/send`, {
1452
+ method: "POST",
1453
+ headers: headers(),
1454
+ body: JSON.stringify(params)
1455
+ });
1456
+ const data = await resp.json();
1457
+ return data.data || data;
1458
+ },
1459
+ /** List products available for line items. */
1460
+ async products() {
1461
+ const resp = await fetch(`${baseUrl}/api/v1/quotable-products`, { headers: headers() });
1462
+ return resp.json();
1463
+ },
1464
+ /** Get org-level quote settings (currency, tax rate, payment providers, logo). */
1465
+ async settings() {
1466
+ const resp = await fetch(`${baseUrl}/api/v1/quote-settings`, { headers: headers() });
1467
+ const data = await resp.json();
1468
+ return data.data || data;
1469
+ },
1470
+ /** Get all quotes associated with a contact. */
1471
+ async forContact(contactId) {
1472
+ const resp = await fetch(`${baseUrl}/api/v1/contacts/${contactId}/quotes`, { headers: headers() });
1473
+ return resp.json();
1474
+ },
1475
+ /** Get all quotes associated with a company. */
1476
+ async forCompany(companyId) {
1477
+ const resp = await fetch(`${baseUrl}/api/v1/companies/${companyId}/quotes`, { headers: headers() });
1478
+ return resp.json();
1479
+ }
1480
+ };
1481
+ };
1482
+
1483
+ // src/pipelines.ts
1484
+ var DEFAULT_API24 = "https://be.graph8.com";
1485
+ var createPipelinesClient = (apiKey, apiUrl) => {
1486
+ const baseUrl = apiUrl || DEFAULT_API24;
1487
+ const headers = () => ({ "Content-Type": "application/json", Authorization: `Bearer ${apiKey}` });
1488
+ return {
1489
+ /** List all stage-checklist pipelines with stages, evidence, scripts. */
1490
+ async list() {
1491
+ const resp = await fetch(`${baseUrl}/api/v1/pipelines`, { headers: headers() });
1492
+ return resp.json();
1493
+ },
1494
+ /** Get a single pipeline by ID. */
1495
+ async get(pipelineId) {
1496
+ const resp = await fetch(`${baseUrl}/api/v1/pipelines/${pipelineId}`, { headers: headers() });
1497
+ const data = await resp.json();
1498
+ return data.data || data;
1499
+ },
1500
+ /** Get the canonical evidence-key library (used when defining stages). */
1501
+ async evidenceLibrary() {
1502
+ const resp = await fetch(`${baseUrl}/api/v1/pipelines/evidence-library`, { headers: headers() });
1503
+ return resp.json();
1504
+ },
1505
+ /** Create a new pipeline. Defaults to a templated set of stages; pass blank=true for empty. */
1506
+ async create(params) {
1507
+ const resp = await fetch(`${baseUrl}/api/v1/pipelines`, {
1508
+ method: "POST",
1509
+ headers: headers(),
1510
+ body: JSON.stringify(params)
1511
+ });
1512
+ const data = await resp.json();
1513
+ return data.data || data;
1514
+ },
1515
+ /** Update pipeline metadata (name, target). */
1516
+ async update(pipelineId, fields) {
1517
+ const resp = await fetch(`${baseUrl}/api/v1/pipelines/${pipelineId}`, {
1518
+ method: "PUT",
1519
+ headers: headers(),
1520
+ body: JSON.stringify(fields)
1521
+ });
1522
+ const data = await resp.json();
1523
+ return data.data || data;
1524
+ },
1525
+ /** Delete a pipeline. Only allowed when no deals reference it. */
1526
+ async delete(pipelineId) {
1527
+ const resp = await fetch(`${baseUrl}/api/v1/pipelines/${pipelineId}`, {
1528
+ method: "DELETE",
1529
+ headers: headers()
1530
+ });
1531
+ return resp.json();
1532
+ },
1533
+ /** Add a new stage to a pipeline. */
1534
+ async createStage(pipelineId, stage) {
1535
+ const resp = await fetch(`${baseUrl}/api/v1/pipelines/${pipelineId}/stages`, {
1536
+ method: "POST",
1537
+ headers: headers(),
1538
+ body: JSON.stringify(stage)
1539
+ });
1540
+ const data = await resp.json();
1541
+ return data.data || data;
1542
+ },
1543
+ /** Update a stage (evidence, scripts, position). */
1544
+ async updateStage(pipelineId, stageId, fields) {
1545
+ const resp = await fetch(`${baseUrl}/api/v1/pipelines/${pipelineId}/stages/${stageId}`, {
1546
+ method: "PUT",
1547
+ headers: headers(),
1548
+ body: JSON.stringify(fields)
1549
+ });
1550
+ const data = await resp.json();
1551
+ return data.data || data;
1552
+ },
1553
+ /** Reorder stages within a pipeline (pass full ordered list of stage IDs). */
1554
+ async reorderStages(pipelineId, stageIds) {
1555
+ const resp = await fetch(`${baseUrl}/api/v1/pipelines/${pipelineId}/stages/reorder`, {
1556
+ method: "PUT",
1557
+ headers: headers(),
1558
+ body: JSON.stringify({ stage_ids: stageIds })
1559
+ });
1560
+ return resp.json();
1561
+ },
1562
+ /** Delete a stage from a pipeline. */
1563
+ async deleteStage(pipelineId, stageId) {
1564
+ const resp = await fetch(`${baseUrl}/api/v1/pipelines/${pipelineId}/stages/${stageId}`, {
1565
+ method: "DELETE",
1566
+ headers: headers()
1567
+ });
1568
+ return resp.json();
1569
+ },
1570
+ /** Get an AI-suggested pipeline based on org context (brand, ICP, messaging). */
1571
+ async suggest() {
1572
+ const resp = await fetch(`${baseUrl}/api/v1/pipelines/suggest`, {
1573
+ method: "POST",
1574
+ headers: headers(),
1575
+ body: JSON.stringify({})
1576
+ });
1577
+ return resp.json();
1578
+ },
1579
+ /** Create a real pipeline from an AI suggestion (optionally with overrides). */
1580
+ async fromSuggestion(suggestionId, overrides) {
1581
+ const resp = await fetch(`${baseUrl}/api/v1/pipelines/from-suggestion`, {
1582
+ method: "POST",
1583
+ headers: headers(),
1584
+ body: JSON.stringify({ suggestion_id: suggestionId, ...overrides || {} })
1585
+ });
1586
+ const data = await resp.json();
1587
+ return data.data || data;
1588
+ }
1589
+ };
1590
+ };
1591
+
1592
+ // src/workflows.ts
1593
+ var DEFAULT_API25 = "https://be.graph8.com";
1594
+ var createWorkflowsClient = (apiKey, apiUrl) => {
1595
+ const baseUrl = apiUrl || DEFAULT_API25;
1596
+ const headers = () => ({ "Content-Type": "application/json", Authorization: `Bearer ${apiKey}` });
1597
+ const toQuery = (params) => {
1598
+ const qs = new URLSearchParams();
1599
+ for (const [k, v] of Object.entries(params)) {
1600
+ if (v != null) qs.set(k, String(v));
1601
+ }
1602
+ const s = qs.toString();
1603
+ return s ? `?${s}` : "";
1604
+ };
1605
+ return {
1606
+ /** List workflows org-wide. */
1607
+ async list(params = {}) {
1608
+ const resp = await fetch(`${baseUrl}/api/v1/workflows${toQuery(params)}`, { headers: headers() });
1609
+ return resp.json();
1610
+ },
1611
+ /** Get full workflow definition (nodes, connections, trigger, execution state). */
1612
+ async get(workflowId) {
1613
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/${workflowId}`, { headers: headers() });
1614
+ const data = await resp.json();
1615
+ return data.data || data;
1616
+ },
1617
+ /** Create a new workflow. */
1618
+ async create(params) {
1619
+ const resp = await fetch(`${baseUrl}/api/v1/workflows`, {
1620
+ method: "POST",
1621
+ headers: headers(),
1622
+ body: JSON.stringify(params)
1623
+ });
1624
+ const data = await resp.json();
1625
+ return data.data || data;
1626
+ },
1627
+ /**
1628
+ * Update a workflow. Pass the full `config` (nodes + connections) to edit
1629
+ * the graph — node-level CRUD is performed client-side by mutating the
1630
+ * config and submitting the updated record.
1631
+ */
1632
+ async update(workflowId, fields) {
1633
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/${workflowId}`, {
1634
+ method: "PUT",
1635
+ headers: headers(),
1636
+ body: JSON.stringify(fields)
1637
+ });
1638
+ const data = await resp.json();
1639
+ return data.data || data;
1640
+ },
1641
+ /** Delete a workflow. */
1642
+ async delete(workflowId) {
1643
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/${workflowId}`, {
1644
+ method: "DELETE",
1645
+ headers: headers()
1646
+ });
1647
+ return resp.json();
1648
+ },
1649
+ /** Validate a workflow definition (orphans, dangling connections, required fields). */
1650
+ async validate(workflow) {
1651
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/validate`, {
1652
+ method: "POST",
1653
+ headers: headers(),
1654
+ body: JSON.stringify(workflow)
1655
+ });
1656
+ return resp.json();
1657
+ },
1658
+ /** Execute a workflow immediately with a trigger payload. */
1659
+ async execute(workflowId, triggerPayload = {}) {
1660
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/${workflowId}/execute`, {
1661
+ method: "POST",
1662
+ headers: headers(),
1663
+ body: JSON.stringify({ trigger_payload: triggerPayload })
1664
+ });
1665
+ const data = await resp.json();
1666
+ return data.data || data;
1667
+ },
1668
+ /** Get the status + output of a workflow execution. */
1669
+ async getExecution(executionId) {
1670
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/executions/${executionId}`, { headers: headers() });
1671
+ const data = await resp.json();
1672
+ return data.data || data;
1673
+ },
1674
+ /** Pause an in-flight execution. */
1675
+ async pauseExecution(executionId) {
1676
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/executions/${executionId}/pause`, {
1677
+ method: "POST",
1678
+ headers: headers(),
1679
+ body: JSON.stringify({})
1680
+ });
1681
+ return resp.json();
1682
+ },
1683
+ /** Resume a paused execution. */
1684
+ async resumeExecution(executionId) {
1685
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/executions/${executionId}/resume`, {
1686
+ method: "POST",
1687
+ headers: headers(),
1688
+ body: JSON.stringify({})
1689
+ });
1690
+ return resp.json();
1691
+ },
1692
+ /** Stop an execution (terminal state — cannot resume). */
1693
+ async stopExecution(executionId) {
1694
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/executions/${executionId}/stop`, {
1695
+ method: "POST",
1696
+ headers: headers(),
1697
+ body: JSON.stringify({})
1698
+ });
1699
+ return resp.json();
1700
+ },
1701
+ /** Get the status of a workflow's external trigger (e.g. "waiting for webhook"). */
1702
+ async getTriggerStatus(workflowId) {
1703
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/${workflowId}/trigger-status`, { headers: headers() });
1704
+ return resp.json();
1705
+ },
1706
+ /** Reset the trigger cursor (e.g. for event-stream triggers — resume from beginning). */
1707
+ async resetTrigger(workflowId) {
1708
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/${workflowId}/trigger-reset`, {
1709
+ method: "POST",
1710
+ headers: headers(),
1711
+ body: JSON.stringify({})
1712
+ });
1713
+ return resp.json();
1714
+ },
1715
+ /**
1716
+ * List available node types with schemas. Pass a `type` param to fetch one type's full schema.
1717
+ */
1718
+ async nodeTypes(params = {}) {
1719
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/node-types/schema${toQuery(params)}`, { headers: headers() });
1720
+ return resp.json();
1721
+ },
1722
+ /** Slack workspace users (for Slack action recipients). */
1723
+ async listSlackUsers() {
1724
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/integrations/slack/users`, { headers: headers() });
1725
+ return resp.json();
1726
+ },
1727
+ /** Slack channels. */
1728
+ async listSlackChannels() {
1729
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/integrations/slack/channels`, { headers: headers() });
1730
+ return resp.json();
1731
+ },
1732
+ /** Roam (Copilot chat) users. */
1733
+ async listRoamUsers() {
1734
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/integrations/roam/users`, { headers: headers() });
1735
+ return resp.json();
1736
+ },
1737
+ /** Roam (Copilot chat) groups. */
1738
+ async listRoamGroups() {
1739
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/integrations/roam/groups`, { headers: headers() });
1740
+ return resp.json();
1741
+ },
1742
+ /** Available MCP servers (for Agent-node integrations). */
1743
+ async listMcpServers() {
1744
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/mcp-servers`, { headers: headers() });
1745
+ return resp.json();
1746
+ },
1747
+ /** Available call dispositions (voice workflow nodes). */
1748
+ async listDispositions() {
1749
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/dispositions`, { headers: headers() });
1750
+ return resp.json();
1751
+ },
1752
+ /** Form field schema for form-trigger nodes. */
1753
+ async listFormFields(formId) {
1754
+ const resp = await fetch(`${baseUrl}/api/v1/workflows/forms/${formId}/fields`, { headers: headers() });
1755
+ return resp.json();
1756
+ }
1757
+ };
1758
+ };
1759
+
1760
+ // src/skills.ts
1761
+ var DEFAULT_API26 = "https://be.graph8.com";
1762
+ var createSkillsClient = (apiKey, apiUrl) => {
1763
+ const baseUrl = apiUrl || DEFAULT_API26;
1764
+ const headers = () => ({ "Content-Type": "application/json", Authorization: `Bearer ${apiKey}` });
1765
+ const toQuery = (params) => {
1766
+ const qs = new URLSearchParams();
1767
+ for (const [k, v] of Object.entries(params)) {
1768
+ if (v != null) qs.set(k, String(v));
1769
+ }
1770
+ const s = qs.toString();
1771
+ return s ? `?${s}` : "";
1772
+ };
1773
+ return {
1774
+ /** List skills. */
1775
+ async list(params = {}) {
1776
+ const resp = await fetch(`${baseUrl}/api/v1/skills${toQuery(params)}`, { headers: headers() });
1777
+ return resp.json();
1778
+ },
1779
+ /** Get a skill by ID. */
1780
+ async get(skillId) {
1781
+ const resp = await fetch(`${baseUrl}/api/v1/skills/${skillId}`, { headers: headers() });
1782
+ const data = await resp.json();
1783
+ return data.data || data;
1784
+ },
1785
+ /** Get the variables required by a skill (extracted from prompt or body template). */
1786
+ async getVariables(skillId) {
1787
+ const resp = await fetch(`${baseUrl}/api/v1/skills/${skillId}/variables`, { headers: headers() });
1788
+ return resp.json();
1789
+ },
1790
+ /** List available LLM models. */
1791
+ async listModels() {
1792
+ const resp = await fetch(`${baseUrl}/api/v1/skills/models`, { headers: headers() });
1793
+ return resp.json();
1794
+ },
1795
+ /** List skill templates. */
1796
+ async listTemplates(params = {}) {
1797
+ const resp = await fetch(`${baseUrl}/api/v1/skills/templates${toQuery(params)}`, { headers: headers() });
1798
+ return resp.json();
1799
+ },
1800
+ /** Create an LLM skill (prompt + model + schemas). */
1801
+ async createLLM(params) {
1802
+ const resp = await fetch(`${baseUrl}/api/v1/skills`, {
1803
+ method: "POST",
1804
+ headers: headers(),
1805
+ body: JSON.stringify({ ...params, type: "llm" })
1806
+ });
1807
+ const data = await resp.json();
1808
+ return data.data || data;
1809
+ },
1810
+ /** Create an API skill (HTTP request wrapper). */
1811
+ async createAPI(params) {
1812
+ const resp = await fetch(`${baseUrl}/api/v1/skills`, {
1813
+ method: "POST",
1814
+ headers: headers(),
1815
+ body: JSON.stringify({ ...params, type: "api" })
1816
+ });
1817
+ const data = await resp.json();
1818
+ return data.data || data;
1819
+ },
1820
+ /** Create a skill from a built-in template. */
1821
+ async createFromTemplate(params) {
1822
+ const resp = await fetch(`${baseUrl}/api/v1/skills/from-template`, {
1823
+ method: "POST",
1824
+ headers: headers(),
1825
+ body: JSON.stringify(params)
1826
+ });
1827
+ const data = await resp.json();
1828
+ return data.data || data;
1829
+ },
1830
+ /** Lift a workflow node into a reusable skill. */
1831
+ async createFromNode(params) {
1832
+ const resp = await fetch(`${baseUrl}/api/v1/skills/from-node`, {
1833
+ method: "POST",
1834
+ headers: headers(),
1835
+ body: JSON.stringify(params)
1836
+ });
1837
+ const data = await resp.json();
1838
+ return data.data || data;
1839
+ },
1840
+ /** Update an LLM skill. */
1841
+ async updateLLM(skillId, fields) {
1842
+ const resp = await fetch(`${baseUrl}/api/v1/skills/${skillId}`, {
1843
+ method: "PUT",
1844
+ headers: headers(),
1845
+ body: JSON.stringify({ ...fields, type: "llm" })
1846
+ });
1847
+ const data = await resp.json();
1848
+ return data.data || data;
1849
+ },
1850
+ /** Update an API skill. */
1851
+ async updateAPI(skillId, fields) {
1852
+ const resp = await fetch(`${baseUrl}/api/v1/skills/${skillId}`, {
1853
+ method: "PUT",
1854
+ headers: headers(),
1855
+ body: JSON.stringify({ ...fields, type: "api" })
1856
+ });
1857
+ const data = await resp.json();
1858
+ return data.data || data;
1859
+ },
1860
+ /** Delete a skill (irreversible if in-use workflows exist). */
1861
+ async delete(skillId) {
1862
+ const resp = await fetch(`${baseUrl}/api/v1/skills/${skillId}`, {
1863
+ method: "DELETE",
1864
+ headers: headers()
1865
+ });
1866
+ return resp.json();
1867
+ },
1868
+ /** Validate a skill definition (without saving). */
1869
+ async validate(skill) {
1870
+ const resp = await fetch(`${baseUrl}/api/v1/skills/validate`, {
1871
+ method: "POST",
1872
+ headers: headers(),
1873
+ body: JSON.stringify(skill)
1874
+ });
1875
+ return resp.json();
1876
+ },
1877
+ /** Execute a skill immediately with an input payload (test / preview). */
1878
+ async execute(skillId, inputPayload) {
1879
+ const resp = await fetch(`${baseUrl}/api/v1/skills/${skillId}/execute`, {
1880
+ method: "POST",
1881
+ headers: headers(),
1882
+ body: JSON.stringify(inputPayload)
1883
+ });
1884
+ return resp.json();
1885
+ }
1886
+ };
1887
+ };
1888
+
1889
+ // src/intent.ts
1890
+ var DEFAULT_API27 = "https://be.graph8.com";
1891
+ var createIntentClient = (apiKey, apiUrl) => {
1892
+ const baseUrl = apiUrl || DEFAULT_API27;
1893
+ const headers = () => ({ "Content-Type": "application/json", Authorization: `Bearer ${apiKey}` });
1894
+ const get = async (path) => {
1895
+ const resp = await fetch(`${baseUrl}/api/v1${path}`, { headers: headers() });
1896
+ return resp.json();
1897
+ };
1898
+ const post = async (path, body = {}) => {
1899
+ const resp = await fetch(`${baseUrl}/api/v1${path}`, {
1900
+ method: "POST",
1901
+ headers: headers(),
1902
+ body: JSON.stringify(body)
1903
+ });
1904
+ return resp.json();
1905
+ };
1906
+ const del = async (path) => {
1907
+ const resp = await fetch(`${baseUrl}/api/v1${path}`, { method: "DELETE", headers: headers() });
1908
+ return resp.json();
1909
+ };
1910
+ return {
1911
+ /** Org-level intent stats (totals over the last 30 days). */
1912
+ async stats() {
1913
+ return get("/intent/stats");
1914
+ },
1915
+ /** List tracked keywords with optional pagination. */
1916
+ async listKeywords(params = {}) {
1917
+ return post("/intent/keywords/list", params);
1918
+ },
1919
+ /** Create a keyword group from a domain (auto-tracks all pages). */
1920
+ async createFromDomain(domain) {
1921
+ return post("/intent/keywords/create-from-domain", { domain });
1922
+ },
1923
+ /** Stop tracking a keyword (irreversible — historical data is retained). */
1924
+ async deleteKeyword(keywordId) {
1925
+ return del(`/intent/keywords/${keywordId}`);
1926
+ },
1927
+ /** Companies showing interest in a tracked keyword. */
1928
+ async keywordCompanies(keywordId, params = {}) {
1929
+ return post(`/intent/keywords/${keywordId}/companies`, params);
1930
+ },
1931
+ /** Contacts showing interest in a tracked keyword. */
1932
+ async keywordContacts(keywordId, params = {}) {
1933
+ return post(`/intent/keywords/${keywordId}/contacts`, params);
1934
+ },
1935
+ /** URLs associated with a keyword (pages visitors landed on while interested). */
1936
+ async keywordUrls(keywordId, params = {}) {
1937
+ return post(`/intent/keywords/${keywordId}/urls`, params);
1938
+ },
1939
+ /** Pages tracked on a specific domain. */
1940
+ async pagesByDomain(domain, params = {}) {
1941
+ return post("/intent/pages-by-domain", { domain, ...params });
1942
+ },
1943
+ /** Search tracked pages by URL fragment or keyword. */
1944
+ async searchPages(query, params = {}) {
1945
+ return post("/intent/pages/search", { query, ...params });
1946
+ },
1947
+ /** Get visitor records for a specific page URL. */
1948
+ async pageVisitors(pageUrl, params = {}) {
1949
+ return post("/intent/pages/visitors", { url: pageUrl, ...params });
1950
+ },
1951
+ /** Get contacts who visited a specific page URL. */
1952
+ async pageContacts(pageUrl, params = {}) {
1953
+ return post("/intent/pages/contacts", { url: pageUrl, ...params });
1954
+ },
1955
+ /** Visitor count aggregates by page (pass an array of URLs). */
1956
+ async pageVisitorCounts(urls) {
1957
+ return post("/intent/pages/visitor-counts", { urls });
1958
+ },
1959
+ /**
1960
+ * Find companies whose users visited a specific URL (intent search).
1961
+ *
1962
+ * Note: this endpoint lives at the bare host (no `/api/v1` prefix), unlike the rest
1963
+ * of the intent surface — we call it directly here instead of through the shared `post()` helper.
1964
+ */
1965
+ async urlCompanies(url, params = {}) {
1966
+ const resp = await fetch(`${baseUrl}/intent-search/url-companies`, {
1967
+ method: "POST",
1968
+ headers: headers(),
1969
+ body: JSON.stringify({ url, ...params })
1970
+ });
1971
+ return resp.json();
1972
+ }
1973
+ };
1974
+ };
1975
+
1976
+ // src/studio.ts
1977
+ var DEFAULT_API28 = "https://be.graph8.com";
1978
+ var createStudioClient = (apiKey, apiUrl) => {
1979
+ const baseUrl = apiUrl || DEFAULT_API28;
1980
+ const headers = () => ({ "Content-Type": "application/json", Authorization: `Bearer ${apiKey}` });
1981
+ const toQuery = (params) => {
1982
+ const qs = new URLSearchParams();
1983
+ for (const [k, v] of Object.entries(params)) {
1984
+ if (v != null) qs.set(k, String(v));
1985
+ }
1986
+ const s = qs.toString();
1987
+ return s ? `?${s}` : "";
1988
+ };
1989
+ const get = async (path, params = {}) => {
1990
+ const resp = await fetch(`${baseUrl}/api/v1${path}${toQuery(params)}`, { headers: headers() });
1991
+ return resp.json();
1992
+ };
1993
+ return {
1994
+ /** Org-level Studio documents (brand_brief, value_props, messaging_house, etc.). */
1995
+ async globalContext(params = {}) {
1996
+ return get("/global-context/documents", params);
1997
+ },
1998
+ /** ICP definitions. */
1999
+ async icps(params = {}) {
2000
+ return get("/icps", params);
2001
+ },
2002
+ /** Buyer persona definitions. */
2003
+ async personas(params = {}) {
2004
+ return get("/personas", params);
2005
+ },
2006
+ /** Intelligence data (website scrapes, enrichment, competitor research). */
2007
+ async intelligenceData(params = {}) {
2008
+ return get("/intelligence-data", params);
2009
+ },
2010
+ /** AI research reports (buyer psychology, competitive teardown, GTM channel, etc.). */
2011
+ async researchReports(params = {}) {
2012
+ return get("/research-reports", params);
2013
+ }
2014
+ };
2015
+ };
2016
+
2017
+ // src/meetings.ts
2018
+ var DEFAULT_API29 = "https://be.graph8.com";
2019
+ var createMeetingsClient = (apiKey, apiUrl) => {
2020
+ const baseUrl = apiUrl || DEFAULT_API29;
2021
+ const headers = () => ({ "Content-Type": "application/json", Authorization: `Bearer ${apiKey}` });
2022
+ const toQuery = (params) => {
2023
+ const qs = new URLSearchParams();
2024
+ for (const [k, v] of Object.entries(params)) {
2025
+ if (v != null) qs.set(k, String(v));
2026
+ }
2027
+ const s = qs.toString();
2028
+ return s ? `?${s}` : "";
2029
+ };
2030
+ return {
2031
+ /** List meetings with optional filters. Returns summary rows without transcript / analysis. */
2032
+ async list(params = {}) {
2033
+ const resp = await fetch(`${baseUrl}/api/v1/inbox/meetings${toQuery(params)}`, { headers: headers() });
2034
+ return resp.json();
2035
+ },
2036
+ /** Get full meeting detail including transcript + AI analysis (transcript available 1-5 min after meeting ends). */
2037
+ async get(meetingId) {
2038
+ const resp = await fetch(`${baseUrl}/api/v1/inbox/meetings/${meetingId}`, { headers: headers() });
2039
+ const data = await resp.json();
2040
+ return data.data || data;
2041
+ }
2042
+ };
2043
+ };
2044
+
1345
2045
  // src/core.ts
1346
2046
  var DEFAULT_HOST = "https://t.graph8.com";
1347
- var DEFAULT_API23 = "https://be.graph8.com";
2047
+ var DEFAULT_API30 = "https://be.graph8.com";
1348
2048
  var G8 = class {
1349
2049
  constructor() {
1350
2050
  /** @internal */
@@ -1395,6 +2095,20 @@ var G8 = class {
1395
2095
  this._deals = null;
1396
2096
  /** @internal */
1397
2097
  this._inbox = null;
2098
+ /** @internal */
2099
+ this._quotes = null;
2100
+ /** @internal */
2101
+ this._pipelines = null;
2102
+ /** @internal */
2103
+ this._workflows = null;
2104
+ /** @internal */
2105
+ this._skills = null;
2106
+ /** @internal */
2107
+ this._intent = null;
2108
+ /** @internal */
2109
+ this._studio = null;
2110
+ /** @internal */
2111
+ this._meetings = null;
1398
2112
  }
1399
2113
  /**
1400
2114
  * Initialize the graph8 SDK. Must be called before any other method.
@@ -1409,7 +2123,7 @@ var G8 = class {
1409
2123
  debug: config.debug
1410
2124
  });
1411
2125
  }
1412
- const apiUrl = config.apiUrl || DEFAULT_API23;
2126
+ const apiUrl = config.apiUrl || DEFAULT_API30;
1413
2127
  const writeKey = config.writeKey || "";
1414
2128
  const apiKey = config.apiKey || "";
1415
2129
  if (writeKey) {
@@ -1437,6 +2151,13 @@ var G8 = class {
1437
2151
  this._fields = createFieldsClient(apiKey, apiUrl);
1438
2152
  this._deals = createDealsClient(apiKey, apiUrl);
1439
2153
  this._inbox = createInboxClient(apiKey, apiUrl);
2154
+ this._quotes = createQuotesClient(apiKey, apiUrl);
2155
+ this._pipelines = createPipelinesClient(apiKey, apiUrl);
2156
+ this._workflows = createWorkflowsClient(apiKey, apiUrl);
2157
+ this._skills = createSkillsClient(apiKey, apiUrl);
2158
+ this._intent = createIntentClient(apiKey, apiUrl);
2159
+ this._studio = createStudioClient(apiKey, apiUrl);
2160
+ this._meetings = createMeetingsClient(apiKey, apiUrl);
1440
2161
  this._signals = createSignalsClient(apiKey, true, apiUrl);
1441
2162
  }
1442
2163
  }
@@ -1568,6 +2289,41 @@ var G8 = class {
1568
2289
  this._assertKey("inbox");
1569
2290
  return this._inbox;
1570
2291
  }
2292
+ /** Quote-to-cash: draft, send, sign, payment-link quotes (requires API key). */
2293
+ get quotes() {
2294
+ this._assertKey("quotes");
2295
+ return this._quotes;
2296
+ }
2297
+ /** Stage Checklist v2 pipelines: workflow stages with evidence + scripts (requires API key). */
2298
+ get pipelines() {
2299
+ this._assertKey("pipelines");
2300
+ return this._pipelines;
2301
+ }
2302
+ /** Workflow builder — multi-node automation graphs with execution lifecycle (requires API key). */
2303
+ get workflows() {
2304
+ this._assertKey("workflows");
2305
+ return this._workflows;
2306
+ }
2307
+ /** Skill authoring — LLM and API building blocks that workflows compose (requires API key). */
2308
+ get skills() {
2309
+ this._assertKey("skills");
2310
+ return this._skills;
2311
+ }
2312
+ /** Intent tracking — keyword groups, page visitors, account-level intent (requires API key). */
2313
+ get intent() {
2314
+ this._assertKey("intent");
2315
+ return this._intent;
2316
+ }
2317
+ /** Studio context — ICPs, personas, brand briefs, intelligence, AI research reports (requires API key). */
2318
+ get studio() {
2319
+ this._assertKey("studio");
2320
+ return this._studio;
2321
+ }
2322
+ /** Meetings — read scheduled, completed, cancelled meetings with transcripts + AI analysis (requires API key). */
2323
+ get meetings() {
2324
+ this._assertKey("meetings");
2325
+ return this._meetings;
2326
+ }
1571
2327
  /** Whether the SDK has been initialized. */
1572
2328
  get initialized() {
1573
2329
  return this.config !== null;