auto-chrome-mcp-shared 1.11.2 → 1.13.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,6 +1,5 @@
1
1
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
2
2
 
3
- declare const DEFAULT_SERVER_PORT = 12320;
4
3
  declare const HOST_NAME = "com.autochromemcp.nativehost";
5
4
 
6
5
  declare enum NativeMessageType {
@@ -826,4 +825,4 @@ type OpenProjectResponse = {
826
825
  error: string;
827
826
  };
828
827
 
829
- export { type AgentActRequest, type AgentActResponse, type AgentAttachment, type AgentCliPreference, type AgentConnectedEvent, type AgentEngineInfo, type AgentHeartbeatEvent, type AgentManagementInfo, type AgentMessage, type AgentProject, type AgentRole, type AgentSession, type AgentSessionOptionsConfig, type AgentStatusEvent, type AgentStoredMessage, type AgentSystemPromptConfig, type AgentToolsConfig, type AgentUsageStats, type AttachmentCleanupRequest, type AttachmentCleanupResponse, type AttachmentMetadata, type AttachmentProjectStats, type AttachmentStatsResponse, CODEX_AUTO_INSTRUCTIONS, type CleanupProjectResult, type CodexEngineConfig, type CodexReasoningEffort, type CodexSandboxMode, type CreateAgentSessionInput, DEFAULT_CODEX_CONFIG, DEFAULT_SERVER_PORT, EDGE_LABELS, type EdgeLabel, type ElementPickerRequest, type ElementPickerResult, type ElementPickerResultItem, type FieldArray, type FieldBoolean, type FieldJson, type FieldNumber, type FieldObject, type FieldSelect, type FieldSpec, type FieldSpecBase, type FieldString, type FieldType, HOST_NAME, type NativeMessage, NativeMessageType, type NodeCategory, type NodeSpec, type NodeSpecDisplay, type OpenProjectRequest, type OpenProjectResponse, type OpenProjectTarget, type PickedElement, type PickedElementPoint, type PickedElementRect, type RREdge, type RRNode, type RRStepType, RR_STEP_TYPES, type RealtimeEvent, STEP_TYPES, type ServerStartedPayload, type StepTypeConst, type StreamTransport, TOOL_NAMES, TOOL_SCHEMAS, type UpdateAgentSessionInput, getNodeSpec, listNodeSpecs, mapNodeToStep, mapStepToNodeConfig, nodesToSteps, registerBuiltinSpecs, registerNodeSpec, stepsToDAG, stepsToNodes, topoOrder };
828
+ export { type AgentActRequest, type AgentActResponse, type AgentAttachment, type AgentCliPreference, type AgentConnectedEvent, type AgentEngineInfo, type AgentHeartbeatEvent, type AgentManagementInfo, type AgentMessage, type AgentProject, type AgentRole, type AgentSession, type AgentSessionOptionsConfig, type AgentStatusEvent, type AgentStoredMessage, type AgentSystemPromptConfig, type AgentToolsConfig, type AgentUsageStats, type AttachmentCleanupRequest, type AttachmentCleanupResponse, type AttachmentMetadata, type AttachmentProjectStats, type AttachmentStatsResponse, CODEX_AUTO_INSTRUCTIONS, type CleanupProjectResult, type CodexEngineConfig, type CodexReasoningEffort, type CodexSandboxMode, type CreateAgentSessionInput, DEFAULT_CODEX_CONFIG, EDGE_LABELS, type EdgeLabel, type ElementPickerRequest, type ElementPickerResult, type ElementPickerResultItem, type FieldArray, type FieldBoolean, type FieldJson, type FieldNumber, type FieldObject, type FieldSelect, type FieldSpec, type FieldSpecBase, type FieldString, type FieldType, HOST_NAME, type NativeMessage, NativeMessageType, type NodeCategory, type NodeSpec, type NodeSpecDisplay, type OpenProjectRequest, type OpenProjectResponse, type OpenProjectTarget, type PickedElement, type PickedElementPoint, type PickedElementRect, type RREdge, type RRNode, type RRStepType, RR_STEP_TYPES, type RealtimeEvent, STEP_TYPES, type ServerStartedPayload, type StepTypeConst, type StreamTransport, TOOL_NAMES, TOOL_SCHEMAS, type UpdateAgentSessionInput, getNodeSpec, listNodeSpecs, mapNodeToStep, mapStepToNodeConfig, nodesToSteps, registerBuiltinSpecs, registerNodeSpec, stepsToDAG, stepsToNodes, topoOrder };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
2
2
 
3
- declare const DEFAULT_SERVER_PORT = 12320;
4
3
  declare const HOST_NAME = "com.autochromemcp.nativehost";
5
4
 
6
5
  declare enum NativeMessageType {
@@ -826,4 +825,4 @@ type OpenProjectResponse = {
826
825
  error: string;
827
826
  };
828
827
 
829
- export { type AgentActRequest, type AgentActResponse, type AgentAttachment, type AgentCliPreference, type AgentConnectedEvent, type AgentEngineInfo, type AgentHeartbeatEvent, type AgentManagementInfo, type AgentMessage, type AgentProject, type AgentRole, type AgentSession, type AgentSessionOptionsConfig, type AgentStatusEvent, type AgentStoredMessage, type AgentSystemPromptConfig, type AgentToolsConfig, type AgentUsageStats, type AttachmentCleanupRequest, type AttachmentCleanupResponse, type AttachmentMetadata, type AttachmentProjectStats, type AttachmentStatsResponse, CODEX_AUTO_INSTRUCTIONS, type CleanupProjectResult, type CodexEngineConfig, type CodexReasoningEffort, type CodexSandboxMode, type CreateAgentSessionInput, DEFAULT_CODEX_CONFIG, DEFAULT_SERVER_PORT, EDGE_LABELS, type EdgeLabel, type ElementPickerRequest, type ElementPickerResult, type ElementPickerResultItem, type FieldArray, type FieldBoolean, type FieldJson, type FieldNumber, type FieldObject, type FieldSelect, type FieldSpec, type FieldSpecBase, type FieldString, type FieldType, HOST_NAME, type NativeMessage, NativeMessageType, type NodeCategory, type NodeSpec, type NodeSpecDisplay, type OpenProjectRequest, type OpenProjectResponse, type OpenProjectTarget, type PickedElement, type PickedElementPoint, type PickedElementRect, type RREdge, type RRNode, type RRStepType, RR_STEP_TYPES, type RealtimeEvent, STEP_TYPES, type ServerStartedPayload, type StepTypeConst, type StreamTransport, TOOL_NAMES, TOOL_SCHEMAS, type UpdateAgentSessionInput, getNodeSpec, listNodeSpecs, mapNodeToStep, mapStepToNodeConfig, nodesToSteps, registerBuiltinSpecs, registerNodeSpec, stepsToDAG, stepsToNodes, topoOrder };
828
+ export { type AgentActRequest, type AgentActResponse, type AgentAttachment, type AgentCliPreference, type AgentConnectedEvent, type AgentEngineInfo, type AgentHeartbeatEvent, type AgentManagementInfo, type AgentMessage, type AgentProject, type AgentRole, type AgentSession, type AgentSessionOptionsConfig, type AgentStatusEvent, type AgentStoredMessage, type AgentSystemPromptConfig, type AgentToolsConfig, type AgentUsageStats, type AttachmentCleanupRequest, type AttachmentCleanupResponse, type AttachmentMetadata, type AttachmentProjectStats, type AttachmentStatsResponse, CODEX_AUTO_INSTRUCTIONS, type CleanupProjectResult, type CodexEngineConfig, type CodexReasoningEffort, type CodexSandboxMode, type CreateAgentSessionInput, DEFAULT_CODEX_CONFIG, EDGE_LABELS, type EdgeLabel, type ElementPickerRequest, type ElementPickerResult, type ElementPickerResultItem, type FieldArray, type FieldBoolean, type FieldJson, type FieldNumber, type FieldObject, type FieldSelect, type FieldSpec, type FieldSpecBase, type FieldString, type FieldType, HOST_NAME, type NativeMessage, NativeMessageType, type NodeCategory, type NodeSpec, type NodeSpecDisplay, type OpenProjectRequest, type OpenProjectResponse, type OpenProjectTarget, type PickedElement, type PickedElementPoint, type PickedElementRect, type RREdge, type RRNode, type RRStepType, RR_STEP_TYPES, type RealtimeEvent, STEP_TYPES, type ServerStartedPayload, type StepTypeConst, type StreamTransport, TOOL_NAMES, TOOL_SCHEMAS, type UpdateAgentSessionInput, getNodeSpec, listNodeSpecs, mapNodeToStep, mapStepToNodeConfig, nodesToSteps, registerBuiltinSpecs, registerNodeSpec, stepsToDAG, stepsToNodes, topoOrder };
package/dist/index.js CHANGED
@@ -22,7 +22,6 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  CODEX_AUTO_INSTRUCTIONS: () => CODEX_AUTO_INSTRUCTIONS,
24
24
  DEFAULT_CODEX_CONFIG: () => DEFAULT_CODEX_CONFIG,
25
- DEFAULT_SERVER_PORT: () => DEFAULT_SERVER_PORT,
26
25
  EDGE_LABELS: () => EDGE_LABELS,
27
26
  HOST_NAME: () => HOST_NAME,
28
27
  NativeMessageType: () => NativeMessageType,
@@ -44,7 +43,6 @@ __export(index_exports, {
44
43
  module.exports = __toCommonJS(index_exports);
45
44
 
46
45
  // src/constants.ts
47
- var DEFAULT_SERVER_PORT = 12320;
48
46
  var HOST_NAME = "com.autochromemcp.nativehost";
49
47
 
50
48
  // src/types.ts
@@ -156,7 +154,17 @@ var P_WHEN = 'Run only if this condition holds, e.g. { path: "hit.matches", op:
156
154
  var P_STOP_IF = "Stop the whole run after this step when the condition holds.";
157
155
  var P_REPEAT = 'Repeat group: { max: 1-20, until?: condition, delayMs?: 0-5000 } together with a "steps" array.';
158
156
  var P_GROUP_STEPS = "Steps of a repeat group (no repeat inside a repeat).";
159
- var P_PARAMS = "save: declare { user: { required: true }, pw: { secret: true } }. run: values for {{params.user}}.";
157
+ var P_PARAMS = "save: declare { user: { required: true }, pw: { secret: true } }. run: values for {{params.user}}. schedule with flowId: values for the flow variables.";
158
+ var P_TASK = 'Short label for what this run is doing (max 24 chars). Shows on the MCP tab group while it runs, then goes back to "MCP".';
159
+ var P_HISTORY_RUN_ID = 'action="history": return this one run in full, including its "results".';
160
+ var P_HISTORY_LIMIT = 'action="history": how many runs to list (default 20, max 100).';
161
+ var P_HISTORY_SINCE = 'action="history": only runs started at or after this time (ISO string or epoch ms).';
162
+ var P_SCHEDULE = 'action="schedule": { every: "15m"|"1h"|"6h"|"24h" } or { daily: ["08:00"], days?: ["mon"] }.';
163
+ var P_NOTIFY = 'action="schedule": show a Chrome notification when a run fails (default true).';
164
+ var P_REPORT = 'action="schedule": also write the run record to Downloads/mcp-screenshots (default false).';
165
+ var P_LOGIN_CHECK = 'action="schedule": "as" name of the top level step whose stopIf means the login expired. With flowId: the flow step id that fails when the login expired.';
166
+ var P_FLOW_ID = "action=schedule/unschedule/history: target a published flow id instead of a shortcut name (the id from record_replay_list_published). Error if given together with name.";
167
+ var P_HISTORY_STATUS = 'action="history": keep only these statuses: running, success, failed, stopped, timeout, interrupted, skipped_queue, login_required, user_took_over_tab.';
160
168
  var tabIdProp = { type: "number", description: P_TAB_ID };
161
169
  var windowIdProp = { type: "number", description: P_WINDOW_ID };
162
170
  var frameIdProp = { type: "number", description: P_FRAME_ID };
@@ -199,7 +207,8 @@ var TOOL_SCHEMAS = [
199
207
  type: "array",
200
208
  items: { type: "string" },
201
209
  description: P_RETURN
202
- }
210
+ },
211
+ task: { type: "string", description: P_TASK }
203
212
  },
204
213
  required: ["steps"]
205
214
  }
@@ -226,31 +235,24 @@ var TOOL_SCHEMAS = [
226
235
  },
227
236
  {
228
237
  name: TOOL_NAMES.BROWSER.SHORTCUT,
229
- description: "Save and run named macros (a chrome_batch step list stored under a name). action: save {name, steps, description} | run (through the normal pipeline) | list | delete. Use for flows you repeat across sessions (logins, routine collection).",
238
+ description: "Save, run and schedule named macros (a chrome_batch step list stored under a name). action: save {name, steps, description} | run (through the normal pipeline) | list | delete | history (past runs) | schedule (run it on a timer with no MCP session) | unschedule | schedules. schedule/unschedule/history also take a published flow through flowId. Use for flows you repeat across sessions (logins, routine collection, overnight checks).",
230
239
  inputSchema: {
231
240
  type: "object",
232
241
  properties: {
233
242
  action: {
234
243
  type: "string",
235
- enum: ["save", "run", "list", "delete"],
244
+ enum: ["save", "run", "list", "delete", "history", "schedule", "unschedule", "schedules"],
236
245
  description: "What to do"
237
246
  },
238
- name: { type: "string", description: "Shortcut name (save/run/delete)" },
247
+ name: {
248
+ type: "string",
249
+ description: "Shortcut name (save/run/delete/schedule/unschedule)"
250
+ },
251
+ flowId: { type: "string", description: P_FLOW_ID },
239
252
  steps: {
240
253
  type: "array",
241
- description: 'action="save": chrome_batch steps, max 20. Each: { tool: string, args?: object }, or a repeat group',
242
- items: {
243
- type: "object",
244
- properties: {
245
- tool: { type: "string" },
246
- args: { type: "object" },
247
- as: { type: "string", description: P_STEP_AS },
248
- when: { type: "object", description: P_WHEN },
249
- stopIf: { type: "object", description: P_STOP_IF },
250
- repeat: { type: "object", description: P_REPEAT },
251
- steps: { type: "array", description: P_GROUP_STEPS }
252
- }
253
- }
254
+ description: 'action="save": same shape as chrome_batch.steps (max 20, tool/args, or a repeat group).',
255
+ items: { type: "object" }
254
256
  },
255
257
  description: { type: "string", description: 'action="save": what this shortcut does' },
256
258
  continueOnError: {
@@ -263,7 +265,20 @@ var TOOL_SCHEMAS = [
263
265
  items: { type: "string" },
264
266
  description: P_RETURN
265
267
  },
266
- params: { type: "object", description: P_PARAMS }
268
+ params: { type: "object", description: P_PARAMS },
269
+ task: { type: "string", description: P_TASK },
270
+ runId: { type: "string", description: P_HISTORY_RUN_ID },
271
+ limit: { type: "number", description: P_HISTORY_LIMIT },
272
+ since: { type: "string", description: P_HISTORY_SINCE },
273
+ status: {
274
+ type: "array",
275
+ items: { type: "string" },
276
+ description: P_HISTORY_STATUS
277
+ },
278
+ schedule: { type: "object", description: P_SCHEDULE },
279
+ notify: { type: "boolean", description: P_NOTIFY },
280
+ report: { type: "boolean", description: P_REPORT },
281
+ loginCheck: { type: "string", description: P_LOGIN_CHECK }
267
282
  },
268
283
  required: ["action"]
269
284
  }
@@ -371,24 +386,59 @@ var TOOL_SCHEMAS = [
371
386
  required: []
372
387
  }
373
388
  },
374
- // record_replay 두 도구는 **의도적으로 MCP 에 노출하지 않는다** (2026-09-04 Codex 3차 검토, 항목 3).
375
- //
376
- // replay 엔진은 대상 탭을 스스로 고른다 — rr-utils 의 ensureTab() 이 tabTarget 미지정·'current'
377
- // 에서 사용자의 활성 탭을 잡고, legacy step executor 와 대부분의 노드(click·fill·extract·
378
- // assert·script·wait·drag 등)가 ctx.tabId 를 무시하고 같은 조회를 다시 한다(엔진·노드 전체
379
- // 28곳/16파일). 그래서 백그라운드 작업 게이트가 작업 탭 id 를 주입해도 소비하는 지점이 없고,
380
- // flow_run 호출이 사용자가 보고 있는 탭을 조작한다. 엔진이 ctx.tabId 를 존중하도록 고치기 전에는
381
- // 노출하지 않으며, 확장의 게이트도 백그라운드 모드에서 flow_run 을 거절한다
382
- // (utils/work-tab-gate.ts 의 BACKGROUND_MODE_UNSUPPORTED_TOOLS).
383
- //
384
- // {
385
- // name: TOOL_NAMES.RECORD_REPLAY.FLOW_RUN,
386
- // ...
387
- // },
388
- // {
389
- // name: TOOL_NAMES.RECORD_REPLAY.LIST_PUBLISHED,
390
- // ...
391
- // },
389
+ {
390
+ name: TOOL_NAMES.RECORD_REPLAY.FLOW_RUN,
391
+ description: "Run a published record-replay flow (recorded in the extension side panel) on this session work tab. With no work tab it opens one in the background at the flow start URL (the page the flow was recorded on, or the startUrl argument); only when neither exists is the call refused with no_work_tab, and then chrome_navigate makes the work tab. Cannot be nested inside chrome_batch. Returns a summary: success, step counts, first failed step, flow outputs, and tabSource (work_tab | created_from_start_url | explicit).",
392
+ inputSchema: {
393
+ type: "object",
394
+ properties: {
395
+ flowId: {
396
+ type: "string",
397
+ description: "Flow id, from record_replay_list_published."
398
+ },
399
+ args: {
400
+ type: "object",
401
+ description: "Values for the flow variables, keyed by variable name."
402
+ },
403
+ tabTarget: {
404
+ type: "string",
405
+ enum: ["current", "new"],
406
+ description: "'current' (default) runs in the work tab. 'new' opens a background tab in the work tab window, runs there and leaves it open. Pass a specific tab as tabId, not here."
407
+ },
408
+ startUrl: {
409
+ type: "string",
410
+ description: "Open this URL in the run tab before the first step. Overrides the flow's own start URL, and is also what a work tab is created from when there is none."
411
+ },
412
+ refresh: {
413
+ type: "boolean",
414
+ description: "Reload the run tab before the first step (default false)."
415
+ },
416
+ captureNetwork: {
417
+ type: "boolean",
418
+ description: "Record network requests during the run (default false)."
419
+ },
420
+ returnLogs: {
421
+ type: "boolean",
422
+ description: "Include the step log, capped at 4000 chars (default false)."
423
+ },
424
+ timeoutMs: {
425
+ type: "number",
426
+ description: "Abort the whole run after this many ms."
427
+ },
428
+ tabId: tabIdProp
429
+ },
430
+ required: ["flowId"]
431
+ }
432
+ },
433
+ {
434
+ name: TOOL_NAMES.RECORD_REPLAY.LIST_PUBLISHED,
435
+ description: "List the published record-replay flows (id, slug, name, version, description) that record_replay_flow_run can run.",
436
+ inputSchema: {
437
+ type: "object",
438
+ properties: {},
439
+ required: []
440
+ }
441
+ },
392
442
  {
393
443
  name: TOOL_NAMES.BROWSER.PERFORMANCE_START_TRACE,
394
444
  description: "Start a performance trace on the selected page. Optionally reload and/or auto-stop after a short duration.",
@@ -658,14 +708,15 @@ var TOOL_SCHEMAS = [
658
708
  refresh: {
659
709
  type: "boolean",
660
710
  description: "Refresh the active tab instead of navigating (url ignored). Default false."
661
- }
711
+ },
712
+ task: { type: "string", description: P_TASK }
662
713
  },
663
714
  required: []
664
715
  }
665
716
  },
666
717
  {
667
718
  name: TOOL_NAMES.BROWSER.SCREENSHOT,
668
- description: '[Prefer chrome_read_page, or chrome_computer action="screenshot"] Take a screenshot of the page or an element. Use this tool only when you need its advanced options.',
719
+ description: '[Prefer chrome_read_page, or chrome_computer action="screenshot"] Take a screenshot of the page or an element. Use this tool only when you need its advanced options. With storeBase64, the image arrives as a separate MCP image content block in image pixels (chrome_computer converts coordinates via imageScale automatically), not base64 in this text; a saved file path (savePng/saveToDownloads) is included in the response.',
669
720
  inputSchema: {
670
721
  type: "object",
671
722
  properties: {
@@ -1010,7 +1061,7 @@ var TOOL_SCHEMAS = [
1010
1061
  },
1011
1062
  {
1012
1063
  name: TOOL_NAMES.BROWSER.JAVASCRIPT,
1013
- description: "Execute JavaScript in a tab and return the result. Uses CDP Runtime.evaluate (awaitPromise, returnByValue) and falls back to chrome.scripting.executeScript if the debugger is busy. Output is sanitized (sensitive data redacted) and truncated by default.",
1064
+ description: "Execute JavaScript in a tab and return the result, falling back automatically to a different execution path if the debugger is busy. Output is sanitized (sensitive data redacted) and truncated by default.",
1014
1065
  inputSchema: {
1015
1066
  type: "object",
1016
1067
  properties: {
@@ -1270,7 +1321,7 @@ var TOOL_SCHEMAS = [
1270
1321
  },
1271
1322
  {
1272
1323
  name: TOOL_NAMES.BROWSER.FILE_UPLOAD,
1273
- description: "Upload files to file-input form elements using Chrome DevTools Protocol",
1324
+ description: "Upload files to file-input form elements.",
1274
1325
  inputSchema: {
1275
1326
  type: "object",
1276
1327
  properties: {
@@ -1309,7 +1360,7 @@ var TOOL_SCHEMAS = [
1309
1360
  },
1310
1361
  {
1311
1362
  name: TOOL_NAMES.BROWSER.HANDLE_DIALOG,
1312
- description: "Handle JavaScript dialogs (alert/confirm/prompt) via CDP",
1363
+ description: "Handle JavaScript dialogs (alert/confirm/prompt).",
1313
1364
  inputSchema: {
1314
1365
  type: "object",
1315
1366
  properties: {
@@ -1489,7 +1540,7 @@ var TOOL_SCHEMAS = [
1489
1540
  // ===== auto-chrome-mcp fork (B1~B4) =====
1490
1541
  {
1491
1542
  name: TOOL_NAMES.BROWSER.STORAGE,
1492
- description: "Read or modify cookies, localStorage, or sessionStorage. Use it to save/restore a login session, test the logged-out state, pre-seed a consent cookie, or inspect front-end state. VALUES are masked by default (names/domains/expiry still returned); pass includeValues:true only when you need the secrets.",
1543
+ description: "Read or modify cookies, localStorage, or sessionStorage. VALUES are masked by default (names/domains/expiry still returned); pass includeValues:true only when you need the secrets.",
1493
1544
  inputSchema: {
1494
1545
  type: "object",
1495
1546
  properties: {
@@ -1649,13 +1700,10 @@ var LANE_EXEMPT_TOOLS = /* @__PURE__ */ new Set([
1649
1700
  TOOL_NAMES.BROWSER.BOOKMARK_SEARCH,
1650
1701
  TOOL_NAMES.BROWSER.BOOKMARK_ADD,
1651
1702
  TOOL_NAMES.BROWSER.BOOKMARK_DELETE,
1652
- TOOL_NAMES.BROWSER.REQUEST_USER_CONSENT,
1653
- // record_replay 두 도구는 레인 대상이 아니다: flow_run 은 대상 탭을 엔진이 스스로 잡아
1654
- // 레인→작업탭 주입 경로를 타지 않고, list_published 는 순수 조회다. 지금은 두 스키마가
1655
- // 위에서 주석 처리돼 TOOL_SCHEMAS 에 없으므로 이 항목은 실질적으로 무효지만, 다시 노출할 때
1656
- // 판단을 되풀이하지 않도록 남겨 둔다.
1657
- TOOL_NAMES.RECORD_REPLAY.FLOW_RUN,
1658
- TOOL_NAMES.RECORD_REPLAY.LIST_PUBLISHED
1703
+ TOOL_NAMES.BROWSER.REQUEST_USER_CONSENT
1704
+ // record_replay 두 도구는 여기 넣지 않는다. flow_run 은 레인별 작업 탭을 그대로 받아야
1705
+ // 하고(게이트의 TAB_ID_INJECT_TOOLS), list_published 도 같은 레인 인자를 달고 다니는 편이
1706
+ // 호출 형태가 일관된다.
1659
1707
  ]);
1660
1708
  var LANE_DESCRIPTION_SHORT = "Parallel-agent lane id (same value every call). Omit if solo.";
1661
1709
  var LANE_DESCRIPTION_LONG = "Parallel lane id. Sub-agents of one Claude Code session share one MCP session, so without a lane they overwrite each other's work tab. Give each concurrent agent a distinct lane (same value every call): a lane keeps its own work tab that no other lane closes or retargets.";
@@ -2673,7 +2721,6 @@ var DEFAULT_CODEX_CONFIG = {
2673
2721
  0 && (module.exports = {
2674
2722
  CODEX_AUTO_INSTRUCTIONS,
2675
2723
  DEFAULT_CODEX_CONFIG,
2676
- DEFAULT_SERVER_PORT,
2677
2724
  EDGE_LABELS,
2678
2725
  HOST_NAME,
2679
2726
  NativeMessageType,
package/dist/index.mjs CHANGED
@@ -1,5 +1,4 @@
1
1
  // src/constants.ts
2
- var DEFAULT_SERVER_PORT = 12320;
3
2
  var HOST_NAME = "com.autochromemcp.nativehost";
4
3
 
5
4
  // src/types.ts
@@ -111,7 +110,17 @@ var P_WHEN = 'Run only if this condition holds, e.g. { path: "hit.matches", op:
111
110
  var P_STOP_IF = "Stop the whole run after this step when the condition holds.";
112
111
  var P_REPEAT = 'Repeat group: { max: 1-20, until?: condition, delayMs?: 0-5000 } together with a "steps" array.';
113
112
  var P_GROUP_STEPS = "Steps of a repeat group (no repeat inside a repeat).";
114
- var P_PARAMS = "save: declare { user: { required: true }, pw: { secret: true } }. run: values for {{params.user}}.";
113
+ var P_PARAMS = "save: declare { user: { required: true }, pw: { secret: true } }. run: values for {{params.user}}. schedule with flowId: values for the flow variables.";
114
+ var P_TASK = 'Short label for what this run is doing (max 24 chars). Shows on the MCP tab group while it runs, then goes back to "MCP".';
115
+ var P_HISTORY_RUN_ID = 'action="history": return this one run in full, including its "results".';
116
+ var P_HISTORY_LIMIT = 'action="history": how many runs to list (default 20, max 100).';
117
+ var P_HISTORY_SINCE = 'action="history": only runs started at or after this time (ISO string or epoch ms).';
118
+ var P_SCHEDULE = 'action="schedule": { every: "15m"|"1h"|"6h"|"24h" } or { daily: ["08:00"], days?: ["mon"] }.';
119
+ var P_NOTIFY = 'action="schedule": show a Chrome notification when a run fails (default true).';
120
+ var P_REPORT = 'action="schedule": also write the run record to Downloads/mcp-screenshots (default false).';
121
+ var P_LOGIN_CHECK = 'action="schedule": "as" name of the top level step whose stopIf means the login expired. With flowId: the flow step id that fails when the login expired.';
122
+ var P_FLOW_ID = "action=schedule/unschedule/history: target a published flow id instead of a shortcut name (the id from record_replay_list_published). Error if given together with name.";
123
+ var P_HISTORY_STATUS = 'action="history": keep only these statuses: running, success, failed, stopped, timeout, interrupted, skipped_queue, login_required, user_took_over_tab.';
115
124
  var tabIdProp = { type: "number", description: P_TAB_ID };
116
125
  var windowIdProp = { type: "number", description: P_WINDOW_ID };
117
126
  var frameIdProp = { type: "number", description: P_FRAME_ID };
@@ -154,7 +163,8 @@ var TOOL_SCHEMAS = [
154
163
  type: "array",
155
164
  items: { type: "string" },
156
165
  description: P_RETURN
157
- }
166
+ },
167
+ task: { type: "string", description: P_TASK }
158
168
  },
159
169
  required: ["steps"]
160
170
  }
@@ -181,31 +191,24 @@ var TOOL_SCHEMAS = [
181
191
  },
182
192
  {
183
193
  name: TOOL_NAMES.BROWSER.SHORTCUT,
184
- description: "Save and run named macros (a chrome_batch step list stored under a name). action: save {name, steps, description} | run (through the normal pipeline) | list | delete. Use for flows you repeat across sessions (logins, routine collection).",
194
+ description: "Save, run and schedule named macros (a chrome_batch step list stored under a name). action: save {name, steps, description} | run (through the normal pipeline) | list | delete | history (past runs) | schedule (run it on a timer with no MCP session) | unschedule | schedules. schedule/unschedule/history also take a published flow through flowId. Use for flows you repeat across sessions (logins, routine collection, overnight checks).",
185
195
  inputSchema: {
186
196
  type: "object",
187
197
  properties: {
188
198
  action: {
189
199
  type: "string",
190
- enum: ["save", "run", "list", "delete"],
200
+ enum: ["save", "run", "list", "delete", "history", "schedule", "unschedule", "schedules"],
191
201
  description: "What to do"
192
202
  },
193
- name: { type: "string", description: "Shortcut name (save/run/delete)" },
203
+ name: {
204
+ type: "string",
205
+ description: "Shortcut name (save/run/delete/schedule/unschedule)"
206
+ },
207
+ flowId: { type: "string", description: P_FLOW_ID },
194
208
  steps: {
195
209
  type: "array",
196
- description: 'action="save": chrome_batch steps, max 20. Each: { tool: string, args?: object }, or a repeat group',
197
- items: {
198
- type: "object",
199
- properties: {
200
- tool: { type: "string" },
201
- args: { type: "object" },
202
- as: { type: "string", description: P_STEP_AS },
203
- when: { type: "object", description: P_WHEN },
204
- stopIf: { type: "object", description: P_STOP_IF },
205
- repeat: { type: "object", description: P_REPEAT },
206
- steps: { type: "array", description: P_GROUP_STEPS }
207
- }
208
- }
210
+ description: 'action="save": same shape as chrome_batch.steps (max 20, tool/args, or a repeat group).',
211
+ items: { type: "object" }
209
212
  },
210
213
  description: { type: "string", description: 'action="save": what this shortcut does' },
211
214
  continueOnError: {
@@ -218,7 +221,20 @@ var TOOL_SCHEMAS = [
218
221
  items: { type: "string" },
219
222
  description: P_RETURN
220
223
  },
221
- params: { type: "object", description: P_PARAMS }
224
+ params: { type: "object", description: P_PARAMS },
225
+ task: { type: "string", description: P_TASK },
226
+ runId: { type: "string", description: P_HISTORY_RUN_ID },
227
+ limit: { type: "number", description: P_HISTORY_LIMIT },
228
+ since: { type: "string", description: P_HISTORY_SINCE },
229
+ status: {
230
+ type: "array",
231
+ items: { type: "string" },
232
+ description: P_HISTORY_STATUS
233
+ },
234
+ schedule: { type: "object", description: P_SCHEDULE },
235
+ notify: { type: "boolean", description: P_NOTIFY },
236
+ report: { type: "boolean", description: P_REPORT },
237
+ loginCheck: { type: "string", description: P_LOGIN_CHECK }
222
238
  },
223
239
  required: ["action"]
224
240
  }
@@ -326,24 +342,59 @@ var TOOL_SCHEMAS = [
326
342
  required: []
327
343
  }
328
344
  },
329
- // record_replay 두 도구는 **의도적으로 MCP 에 노출하지 않는다** (2026-09-04 Codex 3차 검토, 항목 3).
330
- //
331
- // replay 엔진은 대상 탭을 스스로 고른다 — rr-utils 의 ensureTab() 이 tabTarget 미지정·'current'
332
- // 에서 사용자의 활성 탭을 잡고, legacy step executor 와 대부분의 노드(click·fill·extract·
333
- // assert·script·wait·drag 등)가 ctx.tabId 를 무시하고 같은 조회를 다시 한다(엔진·노드 전체
334
- // 28곳/16파일). 그래서 백그라운드 작업 게이트가 작업 탭 id 를 주입해도 소비하는 지점이 없고,
335
- // flow_run 호출이 사용자가 보고 있는 탭을 조작한다. 엔진이 ctx.tabId 를 존중하도록 고치기 전에는
336
- // 노출하지 않으며, 확장의 게이트도 백그라운드 모드에서 flow_run 을 거절한다
337
- // (utils/work-tab-gate.ts 의 BACKGROUND_MODE_UNSUPPORTED_TOOLS).
338
- //
339
- // {
340
- // name: TOOL_NAMES.RECORD_REPLAY.FLOW_RUN,
341
- // ...
342
- // },
343
- // {
344
- // name: TOOL_NAMES.RECORD_REPLAY.LIST_PUBLISHED,
345
- // ...
346
- // },
345
+ {
346
+ name: TOOL_NAMES.RECORD_REPLAY.FLOW_RUN,
347
+ description: "Run a published record-replay flow (recorded in the extension side panel) on this session work tab. With no work tab it opens one in the background at the flow start URL (the page the flow was recorded on, or the startUrl argument); only when neither exists is the call refused with no_work_tab, and then chrome_navigate makes the work tab. Cannot be nested inside chrome_batch. Returns a summary: success, step counts, first failed step, flow outputs, and tabSource (work_tab | created_from_start_url | explicit).",
348
+ inputSchema: {
349
+ type: "object",
350
+ properties: {
351
+ flowId: {
352
+ type: "string",
353
+ description: "Flow id, from record_replay_list_published."
354
+ },
355
+ args: {
356
+ type: "object",
357
+ description: "Values for the flow variables, keyed by variable name."
358
+ },
359
+ tabTarget: {
360
+ type: "string",
361
+ enum: ["current", "new"],
362
+ description: "'current' (default) runs in the work tab. 'new' opens a background tab in the work tab window, runs there and leaves it open. Pass a specific tab as tabId, not here."
363
+ },
364
+ startUrl: {
365
+ type: "string",
366
+ description: "Open this URL in the run tab before the first step. Overrides the flow's own start URL, and is also what a work tab is created from when there is none."
367
+ },
368
+ refresh: {
369
+ type: "boolean",
370
+ description: "Reload the run tab before the first step (default false)."
371
+ },
372
+ captureNetwork: {
373
+ type: "boolean",
374
+ description: "Record network requests during the run (default false)."
375
+ },
376
+ returnLogs: {
377
+ type: "boolean",
378
+ description: "Include the step log, capped at 4000 chars (default false)."
379
+ },
380
+ timeoutMs: {
381
+ type: "number",
382
+ description: "Abort the whole run after this many ms."
383
+ },
384
+ tabId: tabIdProp
385
+ },
386
+ required: ["flowId"]
387
+ }
388
+ },
389
+ {
390
+ name: TOOL_NAMES.RECORD_REPLAY.LIST_PUBLISHED,
391
+ description: "List the published record-replay flows (id, slug, name, version, description) that record_replay_flow_run can run.",
392
+ inputSchema: {
393
+ type: "object",
394
+ properties: {},
395
+ required: []
396
+ }
397
+ },
347
398
  {
348
399
  name: TOOL_NAMES.BROWSER.PERFORMANCE_START_TRACE,
349
400
  description: "Start a performance trace on the selected page. Optionally reload and/or auto-stop after a short duration.",
@@ -613,14 +664,15 @@ var TOOL_SCHEMAS = [
613
664
  refresh: {
614
665
  type: "boolean",
615
666
  description: "Refresh the active tab instead of navigating (url ignored). Default false."
616
- }
667
+ },
668
+ task: { type: "string", description: P_TASK }
617
669
  },
618
670
  required: []
619
671
  }
620
672
  },
621
673
  {
622
674
  name: TOOL_NAMES.BROWSER.SCREENSHOT,
623
- description: '[Prefer chrome_read_page, or chrome_computer action="screenshot"] Take a screenshot of the page or an element. Use this tool only when you need its advanced options.',
675
+ description: '[Prefer chrome_read_page, or chrome_computer action="screenshot"] Take a screenshot of the page or an element. Use this tool only when you need its advanced options. With storeBase64, the image arrives as a separate MCP image content block in image pixels (chrome_computer converts coordinates via imageScale automatically), not base64 in this text; a saved file path (savePng/saveToDownloads) is included in the response.',
624
676
  inputSchema: {
625
677
  type: "object",
626
678
  properties: {
@@ -965,7 +1017,7 @@ var TOOL_SCHEMAS = [
965
1017
  },
966
1018
  {
967
1019
  name: TOOL_NAMES.BROWSER.JAVASCRIPT,
968
- description: "Execute JavaScript in a tab and return the result. Uses CDP Runtime.evaluate (awaitPromise, returnByValue) and falls back to chrome.scripting.executeScript if the debugger is busy. Output is sanitized (sensitive data redacted) and truncated by default.",
1020
+ description: "Execute JavaScript in a tab and return the result, falling back automatically to a different execution path if the debugger is busy. Output is sanitized (sensitive data redacted) and truncated by default.",
969
1021
  inputSchema: {
970
1022
  type: "object",
971
1023
  properties: {
@@ -1225,7 +1277,7 @@ var TOOL_SCHEMAS = [
1225
1277
  },
1226
1278
  {
1227
1279
  name: TOOL_NAMES.BROWSER.FILE_UPLOAD,
1228
- description: "Upload files to file-input form elements using Chrome DevTools Protocol",
1280
+ description: "Upload files to file-input form elements.",
1229
1281
  inputSchema: {
1230
1282
  type: "object",
1231
1283
  properties: {
@@ -1264,7 +1316,7 @@ var TOOL_SCHEMAS = [
1264
1316
  },
1265
1317
  {
1266
1318
  name: TOOL_NAMES.BROWSER.HANDLE_DIALOG,
1267
- description: "Handle JavaScript dialogs (alert/confirm/prompt) via CDP",
1319
+ description: "Handle JavaScript dialogs (alert/confirm/prompt).",
1268
1320
  inputSchema: {
1269
1321
  type: "object",
1270
1322
  properties: {
@@ -1444,7 +1496,7 @@ var TOOL_SCHEMAS = [
1444
1496
  // ===== auto-chrome-mcp fork (B1~B4) =====
1445
1497
  {
1446
1498
  name: TOOL_NAMES.BROWSER.STORAGE,
1447
- description: "Read or modify cookies, localStorage, or sessionStorage. Use it to save/restore a login session, test the logged-out state, pre-seed a consent cookie, or inspect front-end state. VALUES are masked by default (names/domains/expiry still returned); pass includeValues:true only when you need the secrets.",
1499
+ description: "Read or modify cookies, localStorage, or sessionStorage. VALUES are masked by default (names/domains/expiry still returned); pass includeValues:true only when you need the secrets.",
1448
1500
  inputSchema: {
1449
1501
  type: "object",
1450
1502
  properties: {
@@ -1604,13 +1656,10 @@ var LANE_EXEMPT_TOOLS = /* @__PURE__ */ new Set([
1604
1656
  TOOL_NAMES.BROWSER.BOOKMARK_SEARCH,
1605
1657
  TOOL_NAMES.BROWSER.BOOKMARK_ADD,
1606
1658
  TOOL_NAMES.BROWSER.BOOKMARK_DELETE,
1607
- TOOL_NAMES.BROWSER.REQUEST_USER_CONSENT,
1608
- // record_replay 두 도구는 레인 대상이 아니다: flow_run 은 대상 탭을 엔진이 스스로 잡아
1609
- // 레인→작업탭 주입 경로를 타지 않고, list_published 는 순수 조회다. 지금은 두 스키마가
1610
- // 위에서 주석 처리돼 TOOL_SCHEMAS 에 없으므로 이 항목은 실질적으로 무효지만, 다시 노출할 때
1611
- // 판단을 되풀이하지 않도록 남겨 둔다.
1612
- TOOL_NAMES.RECORD_REPLAY.FLOW_RUN,
1613
- TOOL_NAMES.RECORD_REPLAY.LIST_PUBLISHED
1659
+ TOOL_NAMES.BROWSER.REQUEST_USER_CONSENT
1660
+ // record_replay 두 도구는 여기 넣지 않는다. flow_run 은 레인별 작업 탭을 그대로 받아야
1661
+ // 하고(게이트의 TAB_ID_INJECT_TOOLS), list_published 도 같은 레인 인자를 달고 다니는 편이
1662
+ // 호출 형태가 일관된다.
1614
1663
  ]);
1615
1664
  var LANE_DESCRIPTION_SHORT = "Parallel-agent lane id (same value every call). Omit if solo.";
1616
1665
  var LANE_DESCRIPTION_LONG = "Parallel lane id. Sub-agents of one Claude Code session share one MCP session, so without a lane they overwrite each other's work tab. Give each concurrent agent a distinct lane (same value every call): a lane keeps its own work tab that no other lane closes or retargets.";
@@ -2627,7 +2676,6 @@ var DEFAULT_CODEX_CONFIG = {
2627
2676
  export {
2628
2677
  CODEX_AUTO_INSTRUCTIONS,
2629
2678
  DEFAULT_CODEX_CONFIG,
2630
- DEFAULT_SERVER_PORT,
2631
2679
  EDGE_LABELS,
2632
2680
  HOST_NAME,
2633
2681
  NativeMessageType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auto-chrome-mcp-shared",
3
- "version": "1.11.2",
3
+ "version": "1.13.0",
4
4
  "author": "hangye (upstream), cw02326 (auto-chrome-mcp fork)",
5
5
  "repository": {
6
6
  "type": "git",