@egdesk/next-api-plugin 1.5.54 → 1.5.55

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.
@@ -1647,19 +1647,6 @@ export async function callCompanyResearchTool(
1647
1647
  return parseEgdeskMcpToolResponse(response);
1648
1648
  }
1649
1649
 
1650
- /** Run full company research workflow for a domain (several minutes) */
1651
- export async function runCompanyResearch(
1652
- domain: string,
1653
- options: {
1654
- bypassCache?: boolean;
1655
- inquiryData?: Record<string, any>;
1656
- companyName?: string;
1657
- clientBusinessNumber?: string;
1658
- } = {}
1659
- ) {
1660
- return callCompanyResearchTool('companyresearch_run', { domain, ...options });
1661
- }
1662
-
1663
1650
  /** List company research records */
1664
1651
  export async function listCompanyResearch(
1665
1652
  status?: 'completed' | 'failed' | 'in_progress'
@@ -1679,11 +1666,6 @@ export async function getCompanyResearchByDomain(domain: string) {
1679
1666
  return callCompanyResearchTool('companyresearch_get_by_domain', { domain });
1680
1667
  }
1681
1668
 
1682
- /** Most recent completed research for a domain */
1683
- export async function getLatestCompletedCompanyResearch(domain: string) {
1684
- return callCompanyResearchTool('companyresearch_get_latest_completed', { domain });
1685
- }
1686
-
1687
1669
  /** Search company research by company name or domain */
1688
1670
  export async function searchCompanyResearch(searchText: string) {
1689
1671
  return callCompanyResearchTool('companyresearch_search', { searchText });
@@ -1890,11 +1872,24 @@ export async function openBrowserRecordingAccount(
1890
1872
  });
1891
1873
  }
1892
1874
 
1893
- /** Numbered live-page elements, including left-nav / header menus */
1875
+ /** Numbered live-page elements on the active tab, including tabs[] and left-nav / header menus */
1894
1876
  export async function inspectBrowserRecordingPage(sessionId: string) {
1895
1877
  return callBrowserRecordingTool('browser_recording_inspect_page', { sessionId });
1896
1878
  }
1897
1879
 
1880
+ /** Switch the live session to a Chrome tab from inspect tabs[].index */
1881
+ export async function focusBrowserRecordingTab(sessionId: string, tabIndex: number) {
1882
+ return callBrowserRecordingTool('browser_recording_focus_tab', { sessionId, tabIndex });
1883
+ }
1884
+
1885
+ /** Close one Chrome tab. Omit tabIndex to close the active tab. Refuses the last tab. */
1886
+ export async function closeBrowserRecordingTab(sessionId: string, tabIndex?: number) {
1887
+ return callBrowserRecordingTool('browser_recording_close_tab', {
1888
+ sessionId,
1889
+ ...(tabIndex !== undefined ? { tabIndex } : {}),
1890
+ });
1891
+ }
1892
+
1898
1893
  /** Search live-page labels (exact/substring first). Returns indexes for click. */
1899
1894
  export async function searchBrowserRecordingElements(sessionId: string, query: string) {
1900
1895
  return callBrowserRecordingTool('browser_recording_search_elements', { sessionId, query });
@@ -1959,7 +1954,7 @@ export async function listBrowserRecordingSessions() {
1959
1954
  return callBrowserRecordingTool('browser_recording_list_sessions', {});
1960
1955
  }
1961
1956
 
1962
- /** Close a live session only when fully done — not after login */
1957
+ /** Close Chrome. Does not save a recording or page HTML — only when fully done. */}
1963
1958
  export async function closeBrowserRecordingSession(sessionId: string) {
1964
1959
  return callBrowserRecordingTool('browser_recording_close_session', { sessionId });
1965
1960
  }
@@ -2002,11 +1997,34 @@ export async function uploadBrowserRecordingFile(
2002
1997
  });
2003
1998
  }
2004
1999
 
2005
- /** Save the live session as a new *.spec.js (login prefix + logged workflow). Does not close Chrome. */
2000
+ /** Write a replayable recording (click tape). Chrome stays open — not close_session, not save_page_html. */
2006
2001
  export async function saveBrowserRecordingSession(sessionId: string, name: string) {
2007
2002
  return callBrowserRecordingTool('browser_recording_save_session', { sessionId, name });
2008
2003
  }
2009
2004
 
2005
+ /** Dump the active tab as HTML. Chrome stays open — not a replayable recording, not close_session. */
2006
+ export async function saveBrowserRecordingPageHtml(sessionId: string, name?: string) {
2007
+ return callBrowserRecordingTool('browser_recording_save_page_html', {
2008
+ sessionId,
2009
+ ...(name ? { name } : {}),
2010
+ });
2011
+ }
2012
+
2013
+ /** After walking one row cycle, bind that recipe to every remaining matching list key. */
2014
+ export async function forEachBrowserRecordingRow(
2015
+ sessionId: string,
2016
+ query: string,
2017
+ opts?: { namePrefix?: string; skipExisting?: boolean; maxRows?: number }
2018
+ ) {
2019
+ return callBrowserRecordingTool('browser_recording_for_each_row', {
2020
+ sessionId,
2021
+ query,
2022
+ ...(opts?.namePrefix ? { namePrefix: opts.namePrefix } : {}),
2023
+ ...(opts?.skipExisting === false ? { skipExisting: false } : {}),
2024
+ ...(opts?.maxRows !== undefined ? { maxRows: opts.maxRows } : {}),
2025
+ });
2026
+ }
2027
+
2010
2028
  // ==========================================
2011
2029
  // AI CENTER (workflows, entities, relations, tags)
2012
2030
  // ==========================================
@@ -2354,37 +2372,13 @@ export async function getKoreanLawDecision(id: string) {
2354
2372
  /**
2355
2373
  * Call EGDesk Bizinfo MCP tool (기업마당 지원사업 공고 — grants, not company verify).
2356
2374
  *
2357
- * - Server: \`POST {apiUrl}/bizinfo/tools/call\`
2358
- * - Client: \`POST /__bizinfo_proxy\` (see proxy.ts / middleware)
2359
- * - Tunnel: \`POST https://tunneling-service.onrender.com/t/{id}/bizinfo/tools/call\`
2375
+ * Routed through company-research MCP (\`POST {apiUrl}/company-research/tools/call\`).
2360
2376
  */
2361
2377
  export async function callBizinfoTool(
2362
2378
  toolName: string,
2363
2379
  args: Record<string, any> = {}
2364
2380
  ): Promise<any> {
2365
- const body = JSON.stringify({ tool: toolName, arguments: args });
2366
-
2367
- const isServer = typeof window === 'undefined';
2368
-
2369
- let response: Response;
2370
- if (isServer) {
2371
- const apiUrl =
2372
- (typeof process !== 'undefined' && process.env?.NEXT_PUBLIC_EGDESK_API_URL) ||
2373
- EGDESK_CONFIG.apiUrl;
2374
- response = await fetch(\`\${apiUrl}/bizinfo/tools/call\`, {
2375
- method: 'POST',
2376
- headers: buildServerEgdeskHeaders(),
2377
- body
2378
- });
2379
- } else {
2380
- response = await apiFetch('/__bizinfo_proxy', {
2381
- method: 'POST',
2382
- headers: { 'Content-Type': 'application/json' },
2383
- body
2384
- });
2385
- }
2386
-
2387
- return parseEgdeskMcpToolResponse(response);
2381
+ return callCompanyResearchTool(toolName, args);
2388
2382
  }
2389
2383
 
2390
2384
  /** Search government grants / 지원사업 (category, region, optional client-side query). Not a company registry. */
@@ -2427,37 +2421,13 @@ export async function getBizinfoAnnouncement(id: string) {
2427
2421
  /**
2428
2422
  * Call EGDesk NPS MCP tool (국민연금 가입 사업장 내역 / 가입자 추이).
2429
2423
  *
2430
- * - Server: \`POST {apiUrl}/nps/tools/call\`
2431
- * - Client: \`POST /__nps_proxy\` (see proxy.ts / middleware)
2432
- * - Tunnel: \`POST https://tunneling-service.onrender.com/t/{id}/nps/tools/call\`
2424
+ * Routed through company-research MCP.
2433
2425
  */
2434
2426
  export async function callNpsTool(
2435
2427
  toolName: string,
2436
2428
  args: Record<string, any> = {}
2437
2429
  ): Promise<any> {
2438
- const body = JSON.stringify({ tool: toolName, arguments: args });
2439
-
2440
- const isServer = typeof window === 'undefined';
2441
-
2442
- let response: Response;
2443
- if (isServer) {
2444
- const apiUrl =
2445
- (typeof process !== 'undefined' && process.env?.NEXT_PUBLIC_EGDESK_API_URL) ||
2446
- EGDESK_CONFIG.apiUrl;
2447
- response = await fetch(\`\${apiUrl}/nps/tools/call\`, {
2448
- method: 'POST',
2449
- headers: buildServerEgdeskHeaders(),
2450
- body
2451
- });
2452
- } else {
2453
- response = await apiFetch('/__nps_proxy', {
2454
- method: 'POST',
2455
- headers: { 'Content-Type': 'application/json' },
2456
- body
2457
- });
2458
- }
2459
-
2460
- return parseEgdeskMcpToolResponse(response);
2430
+ return callCompanyResearchTool(toolName, args);
2461
2431
  }
2462
2432
 
2463
2433
  /** Search NPS workplaces by name and/or 사업자번호 앞 6자리 */
@@ -2503,26 +2473,7 @@ export async function callKonepsTool(
2503
2473
  toolName: string,
2504
2474
  args: Record<string, any> = {}
2505
2475
  ): Promise<any> {
2506
- const body = JSON.stringify({ tool: toolName, arguments: args });
2507
- const isServer = typeof window === 'undefined';
2508
- let response: Response;
2509
- if (isServer) {
2510
- const apiUrl =
2511
- (typeof process !== 'undefined' && process.env?.NEXT_PUBLIC_EGDESK_API_URL) ||
2512
- EGDESK_CONFIG.apiUrl;
2513
- response = await fetch(\`\${apiUrl}/koneps/tools/call\`, {
2514
- method: 'POST',
2515
- headers: buildServerEgdeskHeaders(),
2516
- body
2517
- });
2518
- } else {
2519
- response = await apiFetch('/__koneps_proxy', {
2520
- method: 'POST',
2521
- headers: { 'Content-Type': 'application/json' },
2522
- body
2523
- });
2524
- }
2525
- return parseEgdeskMcpToolResponse(response);
2476
+ return callCompanyResearchTool(toolName, args);
2526
2477
  }
2527
2478
 
2528
2479
  export async function searchKonepsContracts(options: Record<string, any> = {}) {
@@ -2552,26 +2503,7 @@ export async function callBidnoticeTool(
2552
2503
  toolName: string,
2553
2504
  args: Record<string, any> = {}
2554
2505
  ): Promise<any> {
2555
- const body = JSON.stringify({ tool: toolName, arguments: args });
2556
- const isServer = typeof window === 'undefined';
2557
- let response: Response;
2558
- if (isServer) {
2559
- const apiUrl =
2560
- (typeof process !== 'undefined' && process.env?.NEXT_PUBLIC_EGDESK_API_URL) ||
2561
- EGDESK_CONFIG.apiUrl;
2562
- response = await fetch(\`\${apiUrl}/bidnotice/tools/call\`, {
2563
- method: 'POST',
2564
- headers: buildServerEgdeskHeaders(),
2565
- body
2566
- });
2567
- } else {
2568
- response = await apiFetch('/__bidnotice_proxy', {
2569
- method: 'POST',
2570
- headers: { 'Content-Type': 'application/json' },
2571
- body
2572
- });
2573
- }
2574
- return parseEgdeskMcpToolResponse(response);
2506
+ return callCompanyResearchTool(toolName, args);
2575
2507
  }
2576
2508
 
2577
2509
  export async function searchBidNotices(options: Record<string, any> = {}) {
@@ -222,7 +222,7 @@ export async function proxy(request: NextRequest) {
222
222
  const body = await request.text();
223
223
  const apiUrl = process.env.NEXT_PUBLIC_EGDESK_API_URL || 'http://localhost:8080';
224
224
 
225
- const response = await fetch(\`\${apiUrl}/bizinfo/tools/call\`, {
225
+ const response = await fetch(\`\${apiUrl}/company-research/tools/call\`, {
226
226
  method: 'POST',
227
227
  headers: buildEgdeskHeaders(),
228
228
  body,
@@ -244,7 +244,7 @@ export async function proxy(request: NextRequest) {
244
244
  const body = await request.text();
245
245
  const apiUrl = process.env.NEXT_PUBLIC_EGDESK_API_URL || 'http://localhost:8080';
246
246
 
247
- const response = await fetch(\`\${apiUrl}/bidnotice/tools/call\`, {
247
+ const response = await fetch(\`\${apiUrl}/company-research/tools/call\`, {
248
248
  method: 'POST',
249
249
  headers: buildEgdeskHeaders(),
250
250
  body,
@@ -266,7 +266,7 @@ export async function proxy(request: NextRequest) {
266
266
  const body = await request.text();
267
267
  const apiUrl = process.env.NEXT_PUBLIC_EGDESK_API_URL || 'http://localhost:8080';
268
268
 
269
- const response = await fetch(\`\${apiUrl}/koneps/tools/call\`, {
269
+ const response = await fetch(\`\${apiUrl}/company-research/tools/call\`, {
270
270
  method: 'POST',
271
271
  headers: buildEgdeskHeaders(),
272
272
  body,
@@ -288,7 +288,7 @@ export async function proxy(request: NextRequest) {
288
288
  const body = await request.text();
289
289
  const apiUrl = process.env.NEXT_PUBLIC_EGDESK_API_URL || 'http://localhost:8080';
290
290
 
291
- const response = await fetch(\`\${apiUrl}/nps/tools/call\`, {
291
+ const response = await fetch(\`\${apiUrl}/company-research/tools/call\`, {
292
292
  method: 'POST',
293
293
  headers: buildEgdeskHeaders(),
294
294
  body,
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.62";
11
+ export declare const COMPATIBLE_APP_VERSION = "1.4.63";
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.62';
49
+ exports.COMPATIBLE_APP_VERSION = '1.4.63';
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.54",
3
+ "version": "1.5.55",
4
4
  "description": "Next.js plugin for EGDesk database proxy integration",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",