@egdesk/next-api-plugin 1.5.69 → 1.5.77

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.
@@ -139,7 +139,7 @@ function generateHelpers(projectPath, options = {}) {
139
139
  *
140
140
  * Type-safe helpers for EGDesk user data, Google Workspace (Sheets / Drive / Docs / Slides MCP + sync, Gmail, Apps Script),
141
141
  * FinanceHub (banks, cards, Hometax, promissory notes),
142
- * internal knowledge / business identity / company research (MCP), Korean law (MCP), Bizinfo grants (MCP), NPS workplace headcount (MCP), and browser recorder replay / live browse.
142
+ * internal knowledge / business identity / company research (MCP), company research docs (cited tool-result blocks), Korean law (MCP), Bizinfo grants (MCP), NPS workplace headcount (MCP), and browser recorder replay / live browse.
143
143
  * Works in both client and server components.
144
144
  *
145
145
  * Generated by @egdesk/next-api-plugin — do not edit by hand.
@@ -1768,6 +1768,87 @@ export async function searchCompanyResearch(searchText: string) {
1768
1768
  return callCompanyResearchTool('companyresearch_search', { searchText });
1769
1769
  }
1770
1770
 
1771
+ // ==========================================
1772
+ // COMPANY RESEARCH DOCS (interactive cited canvases)
1773
+ // ==========================================
1774
+
1775
+ /** List interactive company research docs (one per businessNumber) */
1776
+ export async function listCompanyResearchDocs() {
1777
+ return callCompanyResearchTool('companyresearch_doc_list', {});
1778
+ }
1779
+
1780
+ /** Get company research doc by businessNumber or docId */
1781
+ export async function getCompanyResearchDoc(options: {
1782
+ businessNumber?: string;
1783
+ docId?: string;
1784
+ }) {
1785
+ return callCompanyResearchTool('companyresearch_doc_get', options);
1786
+ }
1787
+
1788
+ /** Get or create the doc for a company (unique per businessNumber) */
1789
+ export async function getOrCreateCompanyResearchDoc(input: {
1790
+ businessNumber: string;
1791
+ companyName?: string;
1792
+ domain?: string;
1793
+ title?: string;
1794
+ }) {
1795
+ return callCompanyResearchTool('companyresearch_doc_get_or_create', input);
1796
+ }
1797
+
1798
+ /**
1799
+ * Run a company-research tool and append a cited block to the company doc —
1800
+ * same as "문서에 넣기" in the Company Research doc editor UI.
1801
+ */
1802
+ export async function insertCompanyResearchDocToolResult(input: {
1803
+ businessNumber: string;
1804
+ toolName: string;
1805
+ params?: Record<string, unknown>;
1806
+ companyName?: string;
1807
+ domain?: string;
1808
+ title?: string;
1809
+ }) {
1810
+ return callCompanyResearchTool('companyresearch_doc_insert_tool_result', input);
1811
+ }
1812
+
1813
+ /** Append already-fetched tool JSON to a company doc without re-running the tool */
1814
+ export async function insertCompanyResearchDocResult(input: {
1815
+ businessNumber: string;
1816
+ toolName: string;
1817
+ rawResult: unknown;
1818
+ companyName?: string;
1819
+ domain?: string;
1820
+ title?: string;
1821
+ }) {
1822
+ return callCompanyResearchTool('companyresearch_doc_insert_result', input);
1823
+ }
1824
+
1825
+ /** Fixed proposal deck layouts and hard content limits (no LLM). */
1826
+ export async function getProposalLayoutCatalog() {
1827
+ return callCompanyResearchTool('companyresearch_proposal_layout_catalog', {});
1828
+ }
1829
+
1830
+ /** Validate structured proposal slide JSON → placeholders + slides[] for export. */
1831
+ export async function parseProposalSlideContent(content: unknown) {
1832
+ return callCompanyResearchTool('companyresearch_proposal_parse_content', { content });
1833
+ }
1834
+
1835
+ /** LLM: excerpt → structured proposal content (same as Doc Editor slide-from-text). */
1836
+ export async function structureCompanyResearchDocSlideFromText(text: string) {
1837
+ return callCompanyResearchTool('companyresearch_doc_slide_from_text', { text });
1838
+ }
1839
+
1840
+ /** Append slides[] to a company research doc deck. */
1841
+ export async function appendCompanyResearchDocSlides(input: {
1842
+ businessNumber?: string;
1843
+ docId?: string;
1844
+ slides: unknown[];
1845
+ companyName?: string;
1846
+ domain?: string;
1847
+ title?: string;
1848
+ }) {
1849
+ return callCompanyResearchTool('companyresearch_doc_append_slides', input);
1850
+ }
1851
+
1771
1852
  // ==========================================
1772
1853
  // BROWSER RECORDING HELPERS
1773
1854
  // ==========================================
@@ -3757,23 +3838,41 @@ export async function getGoogleSlidesAuthStatus() {
3757
3838
  return callSlidesTool('slides_auth_status', {});
3758
3839
  }
3759
3840
 
3760
- export async function createGoogleSlides(title: string) {
3761
- return callSlidesTool('slides_create', { title });
3841
+ /**
3842
+ * Create a Google Slides presentation.
3843
+ * Pass preferOAuth: true (default) to create in the signed-in user's Drive when a service account is also configured.
3844
+ */
3845
+ export async function createGoogleSlides(
3846
+ title: string,
3847
+ options: WorkspaceVisitorCallOptions = {},
3848
+ ) {
3849
+ const preferOAuth = options.preferOAuth ?? true;
3850
+ return callSlidesTool('slides_create', { title, preferOAuth }, options);
3762
3851
  }
3763
3852
 
3764
- export async function getGoogleSlides(presentationId: string) {
3765
- return callSlidesTool('slides_get', { presentationId });
3853
+ export async function getGoogleSlides(
3854
+ presentationId: string,
3855
+ options: WorkspaceVisitorCallOptions = {},
3856
+ ) {
3857
+ const preferOAuth = options.preferOAuth ?? true;
3858
+ return callSlidesTool('slides_get', { presentationId, preferOAuth }, options);
3766
3859
  }
3767
3860
 
3768
- export async function getGoogleSlidesText(presentationId: string) {
3769
- return callSlidesTool('slides_get_text', { presentationId });
3861
+ export async function getGoogleSlidesText(
3862
+ presentationId: string,
3863
+ options: WorkspaceVisitorCallOptions = {},
3864
+ ) {
3865
+ const preferOAuth = options.preferOAuth ?? true;
3866
+ return callSlidesTool('slides_get_text', { presentationId, preferOAuth }, options);
3770
3867
  }
3771
3868
 
3772
3869
  export async function addGoogleSlide(
3773
3870
  presentationId: string,
3774
- options: { text?: string; insertionIndex?: number } = {},
3871
+ options: { text?: string; insertionIndex?: number; preferOAuth?: boolean } = {},
3872
+ callOptions: WorkspaceVisitorCallOptions = {},
3775
3873
  ) {
3776
- return callSlidesTool('slides_add_slide', { presentationId, ...options });
3874
+ const preferOAuth = options.preferOAuth ?? callOptions.preferOAuth ?? true;
3875
+ return callSlidesTool('slides_add_slide', { presentationId, ...options, preferOAuth }, callOptions);
3777
3876
  }
3778
3877
 
3779
3878
  export async function replaceGoogleSlidesText(
@@ -3781,8 +3880,14 @@ export async function replaceGoogleSlidesText(
3781
3880
  findText: string,
3782
3881
  replaceText: string,
3783
3882
  matchCase?: boolean,
3883
+ options: WorkspaceVisitorCallOptions = {},
3784
3884
  ) {
3785
- return callSlidesTool('slides_replace_text', { presentationId, findText, replaceText, matchCase });
3885
+ const preferOAuth = options.preferOAuth ?? true;
3886
+ return callSlidesTool(
3887
+ 'slides_replace_text',
3888
+ { presentationId, findText, replaceText, matchCase, preferOAuth },
3889
+ options,
3890
+ );
3786
3891
  }
3787
3892
 
3788
3893
  export async function insertGoogleSlidesImage(
@@ -3792,9 +3897,30 @@ export async function insertGoogleSlidesImage(
3792
3897
  imageUrl?: string;
3793
3898
  slideIndex?: number;
3794
3899
  slideObjectId?: string;
3900
+ preferOAuth?: boolean;
3795
3901
  },
3902
+ callOptions: WorkspaceVisitorCallOptions = {},
3796
3903
  ) {
3797
- return callSlidesTool('slides_insert_image', { presentationId, ...options });
3904
+ const preferOAuth = options.preferOAuth ?? callOptions.preferOAuth ?? true;
3905
+ return callSlidesTool('slides_insert_image', { ...options, preferOAuth }, callOptions);
3906
+ }
3907
+
3908
+ export async function getGoogleSlidesProposalLayoutCatalog() {
3909
+ return callSlidesTool('slides_proposal_layout_catalog', {});
3910
+ }
3911
+
3912
+ /** Append a slide from structured proposal content to a Google Slides deck. */
3913
+ export async function fillGoogleSlideFromProposalContent(
3914
+ presentationId: string,
3915
+ content: unknown,
3916
+ options: WorkspaceVisitorCallOptions = {},
3917
+ ) {
3918
+ const preferOAuth = options.preferOAuth ?? true;
3919
+ return callSlidesTool(
3920
+ 'slides_fill_from_content',
3921
+ { presentationId, content, preferOAuth },
3922
+ options,
3923
+ );
3798
3924
  }
3799
3925
 
3800
3926
  // ==========================================
@@ -4241,7 +4367,8 @@ export async function getEgdeskTunnel(role?: 'prod' | 'dev') {
4241
4367
  // ==========================================
4242
4368
 
4243
4369
  /**
4244
- * Call EGDesk Phone MCP tool (Messages Web devices, inbox, SMS queue, consent).
4370
+ * Call EGDesk Phone MCP tool (Messages Web devices, inbox, SMS queue, consent,
4371
+ * snapshot links, inbound/outbound rules, background listener).
4245
4372
  *
4246
4373
  * - Server: \`POST {apiUrl}/phone/tools/call\`
4247
4374
  * - Client: \`POST /__phone_proxy\` (see proxy.ts / middleware)
@@ -4316,15 +4443,28 @@ export async function syncPhoneConversations(deviceId: string) {
4316
4443
 
4317
4444
  export async function listPhoneConversationMessages(options: {
4318
4445
  deviceId: string;
4319
- convKey: string;
4446
+ convKey?: string;
4447
+ phoneNumber?: string;
4320
4448
  }) {
4321
4449
  return callPhoneTool('phone_list_conversation_messages', options);
4322
4450
  }
4323
4451
 
4452
+ export async function getPhoneMessages(options: {
4453
+ deviceId: string;
4454
+ phoneNumber?: string;
4455
+ convKey?: string;
4456
+ title?: string;
4457
+ preview?: string;
4458
+ }) {
4459
+ return callPhoneTool('phone_get_messages', options);
4460
+ }
4461
+
4324
4462
  export async function syncPhoneConversationThread(options: {
4325
4463
  deviceId: string;
4326
- convKey: string;
4327
- title: string;
4464
+ convKey?: string;
4465
+ title?: string;
4466
+ preview?: string;
4467
+ phoneNumber?: string;
4328
4468
  }) {
4329
4469
  return callPhoneTool('phone_sync_conversation_thread', options);
4330
4470
  }
@@ -4349,6 +4489,19 @@ export async function sendPhoneSms(options: {
4349
4489
  return callPhoneTool('phone_send', options);
4350
4490
  }
4351
4491
 
4492
+ /** Alias of sendPhoneSms — enqueues an SMS job for the background worker. */
4493
+ export async function enqueuePhoneSms(options: {
4494
+ deviceId: string;
4495
+ phoneNumber: string;
4496
+ message: string;
4497
+ snapshotId?: string;
4498
+ scheduledAt?: number;
4499
+ isMarketing?: boolean;
4500
+ brandName?: string;
4501
+ }) {
4502
+ return callPhoneTool('phone_enqueue', options);
4503
+ }
4504
+
4352
4505
  export async function listPhoneQueue(options: {
4353
4506
  deviceId?: string;
4354
4507
  snapshotId?: string;
@@ -4369,6 +4522,14 @@ export async function listPhoneDevicesForSnapshot(snapshotId: string) {
4369
4522
  return callPhoneTool('phone_list_for_snapshot', { snapshotId });
4370
4523
  }
4371
4524
 
4525
+ export async function listPhoneSnapshotLinks() {
4526
+ return callPhoneTool('phone_list_snapshot_links', {});
4527
+ }
4528
+
4529
+ export async function listPhoneSnapshotsForDevice(deviceId: string) {
4530
+ return callPhoneTool('phone_list_snapshots_for_device', { deviceId });
4531
+ }
4532
+
4372
4533
  export async function linkPhoneSnapshot(options: {
4373
4534
  snapshotId: string;
4374
4535
  deviceId: string;
@@ -4399,6 +4560,66 @@ export async function syncPhoneConsentEvents(snapshotId: string) {
4399
4560
  return callPhoneTool('phone_consent_events_sync', { snapshotId });
4400
4561
  }
4401
4562
 
4563
+ export async function setPhoneConsentAction(options: {
4564
+ snapshotId: string;
4565
+ phone: string;
4566
+ action: 'opt_in' | 'opt_out';
4567
+ }) {
4568
+ return callPhoneTool('phone_consent_action_set', options);
4569
+ }
4570
+
4571
+ export async function createPhoneMessageRule(options: {
4572
+ deviceId: string;
4573
+ enabled?: boolean;
4574
+ matchPhone?: string;
4575
+ matchBodyContains?: string;
4576
+ matchBodyRegex?: string;
4577
+ matchDirection?: 'incoming' | 'outgoing' | 'any';
4578
+ actionType: 'script' | 'send_sms' | 'webhook';
4579
+ actionPayload: Record<string, any>;
4580
+ cooldownMs?: number;
4581
+ }) {
4582
+ return callPhoneTool('phone_rule_create', options);
4583
+ }
4584
+
4585
+ export async function updatePhoneMessageRule(options: {
4586
+ ruleId: string;
4587
+ enabled?: boolean;
4588
+ matchPhone?: string;
4589
+ matchBodyContains?: string;
4590
+ matchBodyRegex?: string;
4591
+ matchDirection?: 'incoming' | 'outgoing' | 'any';
4592
+ actionType?: 'script' | 'send_sms' | 'webhook';
4593
+ actionPayload?: Record<string, any>;
4594
+ cooldownMs?: number;
4595
+ }) {
4596
+ return callPhoneTool('phone_rule_update', options);
4597
+ }
4598
+
4599
+ export async function deletePhoneMessageRule(ruleId: string) {
4600
+ return callPhoneTool('phone_rule_delete', { ruleId });
4601
+ }
4602
+
4603
+ export async function listPhoneMessageRules(deviceId?: string) {
4604
+ return callPhoneTool('phone_rule_list', deviceId ? { deviceId } : {});
4605
+ }
4606
+
4607
+ export async function getPhoneListenerStatus(deviceId?: string) {
4608
+ return callPhoneTool('phone_listener_status', deviceId ? { deviceId } : {});
4609
+ }
4610
+
4611
+ export async function testPhoneListener(options: {
4612
+ deviceId: string;
4613
+ body: string;
4614
+ phone?: string;
4615
+ direction?: 'incoming' | 'outgoing' | 'unknown';
4616
+ convKey?: string;
4617
+ title?: string;
4618
+ dryRun?: boolean;
4619
+ }) {
4620
+ return callPhoneTool('phone_listener_test', options);
4621
+ }
4622
+
4402
4623
  // ==========================================
4403
4624
  // INSTAGRAM (MCP)
4404
4625
  // ==========================================
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * The minimum EGDesk app version this plugin version is compatible with.
9
9
  * The app checks this at setup time and warns on mismatch.
10
10
  */
11
- export declare const COMPATIBLE_APP_VERSION = "1.4.74";
11
+ export declare const COMPATIBLE_APP_VERSION = "1.4.82";
12
12
  export interface SetupOptions {
13
13
  egdeskUrl?: string;
14
14
  /** Production EGDesk server URL — written to .env.production.local. Falls back to egdeskUrl. */
package/dist/index.js CHANGED
@@ -46,7 +46,7 @@ exports.setupNextApiPlugin = setupNextApiPlugin;
46
46
  * The minimum EGDesk app version this plugin version is compatible with.
47
47
  * The app checks this at setup time and warns on mismatch.
48
48
  */
49
- exports.COMPATIBLE_APP_VERSION = '1.4.74';
49
+ exports.COMPATIBLE_APP_VERSION = '1.4.82';
50
50
  const fs = __importStar(require("fs"));
51
51
  const path = __importStar(require("path"));
52
52
  const setup_userdata_1 = require("./setup-userdata");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egdesk/next-api-plugin",
3
- "version": "1.5.69",
3
+ "version": "1.5.77",
4
4
  "description": "Next.js plugin for EGDesk database proxy integration",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",