@tomflow/proflow-execution-browser-extension 0.1.10 → 0.1.12

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @tomflow/proflow-execution-browser-extension
2
2
 
3
+ ## 0.1.12
4
+
5
+ ### Patch Changes
6
+
7
+ - Distinguish dependency blocking from verified failure, expose Module-owned status diagnostics, remove automatic docs paging, consolidate start checks, add contextual help, and clarify uninstall output.
8
+
9
+ ## 0.1.11
10
+
11
+ ### Patch Changes
12
+
13
+ - Upgrade the ProFlow terminal experience, stream Registry and package-manager progress, publish structured Chinese Module documentation, and provide numbered package-owned Setup assistants.
14
+
3
15
  ## 0.1.10
4
16
 
5
17
  ### Patch Changes
package/DOCS.md CHANGED
@@ -1,13 +1,39 @@
1
- # execution-browser-extension
1
+ # execution-browser-extension — 浏览器执行扩展
2
2
 
3
- Execution Browser Extension(浏览器执行扩展)让 ProFlow 在 Chrome 中执行受控页面操作、采集页面证据,并提供任务与审批界面。
3
+ ## 模块定位与作用
4
4
 
5
- ## 什么时候需要
5
+ Execution 领域拥有的 Chrome MV3 Extension,负责 Task UI、审批提醒、Conversation Carrier 和真实 Browser Effect。
6
6
 
7
- 首次部署浏览器能力、扩展升级,或者 Chrome 报告扩展未连接时使用。
7
+ ## 主要能力
8
8
 
9
- ## 如何配置
9
+ - 提供 New Task 与 Side Panel UI、Task Observer 和 System Observer。
10
+ - 创建、恢复和唤醒 Custom GPT Conversation,稳定观察 workerRef/c-id。
11
+ - 执行 DOM-first 浏览器操作,必要时使用截图与 Vision 辅助观察。
10
12
 
11
- 运行 `pnpm exec -- proflow-execution-browser-extension setup`。向导会准备扩展目录、打开 Chrome 扩展管理页,并说明如何加载已解压扩展;完成后收集 Extension ID(扩展标识)并验证连接状态。
13
+ ## 提供的 API Public Contract
12
14
 
13
- 扩展不保存 Task(任务)或 Approval(审批)的业务真相,只负责浏览器侧交互。
15
+ - 提供 `execution-browser-executor` Contract,版本 `1.0.0`。
16
+ - 通过本地 Bridge 接收 typed Browser operation 并返回 Evidence。
17
+
18
+ ## 依赖的 Module、Contract 和外部资源
19
+
20
+ - 依赖 `execution`、`task-orchestration` 和 `agent-runtime`,兼容版本均为 `>=1.0.0 <2.0.0`。
21
+ - 依赖 Chrome、用户加载 MV3 扩展和真实 ChatGPT 页面。
22
+
23
+ ## 运行形态与生命周期
24
+
25
+ 类型为 Browser Extension。后台 Service Worker 由 Chrome 管理,本地配置由 Module setup 生成。
26
+
27
+ ## 使用方式
28
+
29
+ 运行 `pnpm exec -- proflow-execution-browser-extension setup`,加载准备好的目录、登记 Extension ID、Reload 并验证 Bridge。
30
+
31
+ ## 职责边界与限制
32
+
33
+ 不拥有 Task/Agent 业务事实,不依赖坐标点击,不维持 frame registry,也不创建第二套 Effect 状态机。
34
+
35
+ ## 术语
36
+
37
+ - MV3(Manifest V3):Chrome 扩展当前使用的清单与运行模型。
38
+ - Service Worker(后台服务):Chrome 管理的扩展后台执行环境。
39
+ - DOM-first(DOM 优先):优先使用结构化页面元素完成观察和操作。
package/SETUP.md CHANGED
@@ -1,10 +1,25 @@
1
- # @tomflow/proflow-execution-browser-extension — Module Setup
1
+ # execution-browser-extension Setup
2
2
 
3
- ## STEP-EXECUTION-BROWSER-EXTENSION-01 — 加载并验证 Chrome 扩展
3
+ ## STEP-EXECUTION-BROWSER-EXTENSION-01 — 准备扩展并打开 Chrome
4
+ Responsible: USER
5
+ Interactive executable: `pnpm exec -- proflow-execution-browser-extension setup 01`
6
+ Non-interactive executable: `pnpm exec -- proflow-execution-browser-extension setup 01`
7
+ Required inputs: none
8
+ Verify: `pnpm exec -- proflow-execution-browser-extension setup 01`
9
+ Success condition: 扩展目录已生成并可选择。
4
10
 
11
+ ## STEP-EXECUTION-BROWSER-EXTENSION-02 — 登记 Extension ID 并生成配置
5
12
  Responsible: USER
6
- Interactive executable: `pnpm exec -- proflow-execution-browser-extension setup`
7
- Non-interactive executable: `pnpm exec -- proflow-execution-browser-extension setup --extension-id <id>`
13
+ Interactive executable: `pnpm exec -- proflow-execution-browser-extension setup 02`
14
+ Non-interactive executable: `pnpm exec -- proflow-execution-browser-extension setup 02 --extension-id <id>`
8
15
  Required inputs: Chrome Extension ID
9
16
  Verify: `pnpm exec -- proflow-execution-browser-extension verify`
17
+ Success condition: Extension ID 和运行配置已保存。
18
+
19
+ ## STEP-EXECUTION-BROWSER-EXTENSION-03 — 验证 Service Worker 与 Bridge
20
+ Responsible: AI
21
+ Interactive executable: `pnpm exec -- proflow-execution-browser-extension setup 03`
22
+ Non-interactive executable: `pnpm exec -- proflow-execution-browser-extension verify`
23
+ Required inputs: none
24
+ Verify: `pnpm exec -- proflow-execution-browser-extension verify`
10
25
  Success condition: `execution-browser-extension.setupStatus=READY`.
@@ -14,7 +14,7 @@ export declare const behaviorAdapter: {
14
14
  ok: true;
15
15
  status: "SUCCEEDED";
16
16
  moduleRef: "execution-browser-extension";
17
- moduleVersion: "0.1.10";
17
+ moduleVersion: "0.1.12";
18
18
  data: {
19
19
  loadDir: string;
20
20
  };
@@ -27,7 +27,7 @@ export declare const behaviorAdapter: {
27
27
  readonly ok: true;
28
28
  readonly status: "SUCCEEDED";
29
29
  readonly moduleRef: "execution-browser-extension";
30
- readonly moduleVersion: "0.1.10";
30
+ readonly moduleVersion: "0.1.12";
31
31
  };
32
32
  observedEffects: never[];
33
33
  }>;
@@ -37,10 +37,17 @@ export declare const behaviorAdapter: {
37
37
  ok: true;
38
38
  status: "SUCCEEDED";
39
39
  moduleRef: "execution-browser-extension";
40
- moduleVersion: "0.1.10";
40
+ moduleVersion: "0.1.12";
41
41
  data: {
42
42
  setupStatus: "ACTION_REQUIRED" | "READY";
43
43
  runtimeStatus: "RUNNING" | "STOPPED";
44
+ issues?: {
45
+ scope: "SETUP";
46
+ code: string;
47
+ message: string;
48
+ relatedModuleRefs: string[];
49
+ nextCommand: string;
50
+ }[];
44
51
  };
45
52
  };
46
53
  observedEffects: string[];
@@ -49,7 +56,7 @@ export declare const behaviorAdapter: {
49
56
  result: {
50
57
  contract: "deployment.result.v1";
51
58
  moduleRef: "execution-browser-extension";
52
- moduleVersion: "0.1.10";
59
+ moduleVersion: "0.1.12";
53
60
  ok: false;
54
61
  status: "FAILED";
55
62
  error: {
@@ -59,7 +66,7 @@ export declare const behaviorAdapter: {
59
66
  };
60
67
  data: {
61
68
  readonly steps: readonly [{
62
- readonly id: "STEP-EXECUTION-BROWSER-EXTENSION-02";
69
+ readonly id: "STEP-EXECUTION-BROWSER-EXTENSION-04";
63
70
  readonly title: "修复扩展配置";
64
71
  readonly state: "BLOCKED";
65
72
  readonly responsible: "EXTERNAL";
@@ -79,18 +86,33 @@ export declare const behaviorAdapter: {
79
86
  result: {
80
87
  contract: "deployment.result.v1";
81
88
  moduleRef: "execution-browser-extension";
82
- moduleVersion: "0.1.10";
89
+ moduleVersion: "0.1.12";
83
90
  ok: false;
84
91
  status: "ACTION_REQUIRED";
85
92
  data: {
86
93
  readonly steps: readonly [{
87
94
  readonly id: "STEP-EXECUTION-BROWSER-EXTENSION-01";
88
- readonly title: "加载 Chrome 扩展";
95
+ readonly title: "准备扩展并打开 Chrome";
96
+ readonly description: "生成 unpacked 目录,复制路径并打开扩展管理页。";
89
97
  readonly state: "TODO";
90
98
  readonly responsible: "USER";
91
99
  readonly execution: {
92
- readonly interactive: "pnpm exec -- proflow-execution-browser-extension setup";
93
- readonly nonInteractive: "pnpm exec -- proflow-execution-browser-extension setup --extension-id <id>";
100
+ readonly interactive: "pnpm exec -- proflow-execution-browser-extension setup 01";
101
+ readonly nonInteractive: "pnpm exec -- proflow-execution-browser-extension setup 01";
102
+ };
103
+ readonly requiredInputs: readonly [];
104
+ readonly verify: "pnpm exec -- proflow-execution-browser-extension setup 01";
105
+ readonly successCondition: "扩展目录已生成并可选择";
106
+ readonly humanAction: "启用开发者模式并选择脚本复制的目录。";
107
+ }, {
108
+ readonly id: "STEP-EXECUTION-BROWSER-EXTENSION-02";
109
+ readonly title: "登记 Extension ID 并生成配置";
110
+ readonly description: "保存扩展 ID,生成 Bridge 配置并提示 Reload。";
111
+ readonly state: "TODO";
112
+ readonly responsible: "USER";
113
+ readonly execution: {
114
+ readonly interactive: "pnpm exec -- proflow-execution-browser-extension setup 02";
115
+ readonly nonInteractive: "pnpm exec -- proflow-execution-browser-extension setup 02 --extension-id <id>";
94
116
  };
95
117
  readonly requiredInputs: readonly [{
96
118
  readonly name: "extensionId";
@@ -98,7 +120,21 @@ export declare const behaviorAdapter: {
98
120
  readonly sensitive: false;
99
121
  }];
100
122
  readonly verify: "pnpm exec -- proflow-execution-browser-extension verify";
101
- readonly successCondition: "配置状态变为“已就绪”";
123
+ readonly successCondition: "Extension ID 和运行配置已保存";
124
+ readonly humanAction: "复制扩展 ID,并在配置生成后点击 Reload。";
125
+ }, {
126
+ readonly id: "STEP-EXECUTION-BROWSER-EXTENSION-03";
127
+ readonly title: "验证 Service Worker 与 Bridge";
128
+ readonly description: "重新观察扩展后台和本地 Bridge。";
129
+ readonly state: "TODO";
130
+ readonly responsible: "AI";
131
+ readonly execution: {
132
+ readonly interactive: "pnpm exec -- proflow-execution-browser-extension setup 03";
133
+ readonly nonInteractive: "pnpm exec -- proflow-execution-browser-extension verify";
134
+ };
135
+ readonly requiredInputs: readonly [];
136
+ readonly verify: "pnpm exec -- proflow-execution-browser-extension verify";
137
+ readonly successCondition: "execution-browser-extension.setupStatus=READY";
102
138
  }];
103
139
  };
104
140
  actionRequired: {
@@ -113,7 +149,7 @@ export declare const behaviorAdapter: {
113
149
  readonly ok: true;
114
150
  readonly status: "SUCCEEDED";
115
151
  readonly moduleRef: "execution-browser-extension";
116
- readonly moduleVersion: "0.1.10";
152
+ readonly moduleVersion: "0.1.12";
117
153
  };
118
154
  observedEffects: string[];
119
155
  }>;
@@ -123,7 +159,7 @@ export declare const behaviorAdapter: {
123
159
  ok: true;
124
160
  status: "SUCCEEDED";
125
161
  moduleRef: "execution-browser-extension";
126
- moduleVersion: "0.1.10";
162
+ moduleVersion: "0.1.12";
127
163
  data: {
128
164
  docs: string;
129
165
  };
@@ -136,11 +172,11 @@ export declare const behaviorAdapter: {
136
172
  readonly ok: true;
137
173
  readonly status: "SUCCEEDED";
138
174
  readonly moduleRef: "execution-browser-extension";
139
- readonly moduleVersion: "0.1.10";
175
+ readonly moduleVersion: "0.1.12";
140
176
  } | {
141
177
  contract: "deployment.result.v1";
142
178
  moduleRef: "execution-browser-extension";
143
- moduleVersion: "0.1.10";
179
+ moduleVersion: "0.1.12";
144
180
  ok: false;
145
181
  status: "FAILED";
146
182
  error: {
@@ -157,7 +193,7 @@ export declare const behaviorAdapter: {
157
193
  readonly ok: true;
158
194
  readonly status: "SUCCEEDED";
159
195
  readonly moduleRef: "execution-browser-extension";
160
- readonly moduleVersion: "0.1.10";
196
+ readonly moduleVersion: "0.1.12";
161
197
  };
162
198
  observedEffects: never[];
163
199
  }>;
@@ -15,12 +15,28 @@ const setupPlan = {
15
15
  steps: [
16
16
  {
17
17
  id: "STEP-EXECUTION-BROWSER-EXTENSION-01",
18
- title: "加载 Chrome 扩展",
18
+ title: "准备扩展并打开 Chrome",
19
+ description: "生成 unpacked 目录,复制路径并打开扩展管理页。",
19
20
  state: "TODO",
20
21
  responsible: "USER",
21
22
  execution: {
22
- interactive: "pnpm exec -- proflow-execution-browser-extension setup",
23
- nonInteractive: "pnpm exec -- proflow-execution-browser-extension setup --extension-id <id>",
23
+ interactive: "pnpm exec -- proflow-execution-browser-extension setup 01",
24
+ nonInteractive: "pnpm exec -- proflow-execution-browser-extension setup 01",
25
+ },
26
+ requiredInputs: [],
27
+ verify: "pnpm exec -- proflow-execution-browser-extension setup 01",
28
+ successCondition: "扩展目录已生成并可选择",
29
+ humanAction: "启用开发者模式并选择脚本复制的目录。",
30
+ },
31
+ {
32
+ id: "STEP-EXECUTION-BROWSER-EXTENSION-02",
33
+ title: "登记 Extension ID 并生成配置",
34
+ description: "保存扩展 ID,生成 Bridge 配置并提示 Reload。",
35
+ state: "TODO",
36
+ responsible: "USER",
37
+ execution: {
38
+ interactive: "pnpm exec -- proflow-execution-browser-extension setup 02",
39
+ nonInteractive: "pnpm exec -- proflow-execution-browser-extension setup 02 --extension-id <id>",
24
40
  },
25
41
  requiredInputs: [
26
42
  {
@@ -30,14 +46,29 @@ const setupPlan = {
30
46
  },
31
47
  ],
32
48
  verify: "pnpm exec -- proflow-execution-browser-extension verify",
33
- successCondition: "配置状态变为“已就绪”",
49
+ successCondition: "Extension ID 和运行配置已保存",
50
+ humanAction: "复制扩展 ID,并在配置生成后点击 Reload。",
51
+ },
52
+ {
53
+ id: "STEP-EXECUTION-BROWSER-EXTENSION-03",
54
+ title: "验证 Service Worker 与 Bridge",
55
+ description: "重新观察扩展后台和本地 Bridge。",
56
+ state: "TODO",
57
+ responsible: "AI",
58
+ execution: {
59
+ interactive: "pnpm exec -- proflow-execution-browser-extension setup 03",
60
+ nonInteractive: "pnpm exec -- proflow-execution-browser-extension verify",
61
+ },
62
+ requiredInputs: [],
63
+ verify: "pnpm exec -- proflow-execution-browser-extension verify",
64
+ successCondition: "execution-browser-extension.setupStatus=READY",
34
65
  },
35
66
  ],
36
67
  };
37
68
  const blockedSetupPlan = {
38
69
  steps: [
39
70
  {
40
- id: "STEP-EXECUTION-BROWSER-EXTENSION-02",
71
+ id: "STEP-EXECUTION-BROWSER-EXTENSION-04",
41
72
  title: "修复扩展配置",
42
73
  state: "BLOCKED",
43
74
  responsible: "EXTERNAL",
@@ -243,14 +274,28 @@ export const behaviorAdapter = {
243
274
  const loadDir = browserExtensionLoadDir(context.workspaceRoot);
244
275
  const setup = await readSetup(context);
245
276
  const evidence = await readEvidence(context, loadDir);
277
+ const setupReady = Boolean(setup && evidence);
246
278
  return {
247
279
  result: {
248
280
  ...base,
249
281
  data: {
250
- setupStatus: setup && evidence
282
+ setupStatus: setupReady
251
283
  ? "READY"
252
284
  : "ACTION_REQUIRED",
253
285
  runtimeStatus: evidence ? "RUNNING" : "STOPPED",
286
+ ...(setupReady
287
+ ? {}
288
+ : {
289
+ issues: [
290
+ {
291
+ scope: "SETUP",
292
+ code: "EXTENSION_LOAD_REQUIRED",
293
+ message: "Chrome 扩展尚未加载或缺少可验证的运行证据",
294
+ relatedModuleRefs: ["chrome-runtime"],
295
+ nextCommand: "platform setup --module execution-browser-extension",
296
+ },
297
+ ],
298
+ }),
254
299
  },
255
300
  },
256
301
  observedEffects: evidence
@@ -3,7 +3,7 @@ export declare const descriptor: {
3
3
  readonly contractVersion: "1.0.0";
4
4
  readonly moduleRef: "execution-browser-extension";
5
5
  readonly packageName: "@tomflow/proflow-execution-browser-extension";
6
- readonly moduleVersion: "0.1.10";
6
+ readonly moduleVersion: "0.1.12";
7
7
  readonly kind: "browser-extension";
8
8
  readonly templateVersion: "1.0.0";
9
9
  readonly platformCompatibility: ">=1.0.0 <2.0.0";
@@ -3,7 +3,7 @@ export const descriptor = {
3
3
  contractVersion: "1.0.0",
4
4
  moduleRef: "execution-browser-extension",
5
5
  packageName: "@tomflow/proflow-execution-browser-extension",
6
- moduleVersion: "0.1.10",
6
+ moduleVersion: "0.1.12",
7
7
  kind: "browser-extension",
8
8
  templateVersion: "1.0.0",
9
9
  platformCompatibility: ">=1.0.0 <2.0.0",
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { spawn } from "node:child_process";
2
+ import { spawn, spawnSync } from "node:child_process";
3
3
  import { readFile } from "node:fs/promises";
4
4
  import { resolve } from "node:path";
5
5
  import { createInterface } from "node:readline/promises";
@@ -68,6 +68,32 @@ async function main() {
68
68
  ? resolve(option("--workspace"))
69
69
  : process.cwd();
70
70
  if (args[0] === "setup") {
71
+ const step = args[1]?.startsWith("--") ? undefined : args[1];
72
+ if (step === "01") {
73
+ const prepared = await behaviorAdapter.install({ workspaceRoot });
74
+ const loadDir = String(prepared.result.data.loadDir);
75
+ const command = process.platform === "darwin"
76
+ ? "pbcopy"
77
+ : process.platform === "win32"
78
+ ? "clip"
79
+ : "xclip";
80
+ const parameters = process.platform === "linux" ? ["-selection", "clipboard"] : [];
81
+ spawnSync(command, parameters, { input: loadDir, encoding: "utf8" });
82
+ openChromeExtensions();
83
+ process.stdout.write(`\n✓ 扩展目录已准备并复制到剪贴板\n ${loadDir}\n 启用开发者模式并加载该目录,然后运行 setup 02。\n`);
84
+ return;
85
+ }
86
+ if (step === "03") {
87
+ const result = await behaviorAdapter.status({ workspaceRoot });
88
+ process.stdout.write(result.result.data.setupStatus === "READY"
89
+ ? "✓ Service Worker 与 Bridge 验证通过\n"
90
+ : "✕ 扩展尚未就绪,请检查 Reload 和后台错误\n");
91
+ if (result.result.data.setupStatus !== "READY")
92
+ process.exitCode = 1;
93
+ return;
94
+ }
95
+ if (step !== undefined && step !== "02")
96
+ throw new Error(`UNSUPPORTED_SETUP_STEP:${step}`);
71
97
  let extensionId = option("--extension-id");
72
98
  if (!extensionId && !process.stdin.isTTY)
73
99
  throw new Error("非交互环境必须提供 --extension-id");
package/manifest.json CHANGED
@@ -1,28 +1,17 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "ProFlow Execution Browser",
4
- "version": "0.1.10",
5
- "permissions": [
6
- "tabs",
7
- "storage",
8
- "sidePanel"
9
- ],
10
- "host_permissions": [
11
- "https://chatgpt.com/*",
12
- "http://127.0.0.1/*"
13
- ],
4
+ "version": "0.1.12",
5
+ "permissions": ["tabs", "storage", "sidePanel"],
6
+ "host_permissions": ["https://chatgpt.com/*", "http://127.0.0.1/*"],
14
7
  "background": {
15
8
  "service_worker": "dist/extension/background.js",
16
9
  "type": "module"
17
10
  },
18
11
  "content_scripts": [
19
12
  {
20
- "matches": [
21
- "https://chatgpt.com/g/*"
22
- ],
23
- "js": [
24
- "dist/extension/content.js"
25
- ],
13
+ "matches": ["https://chatgpt.com/g/*"],
14
+ "js": ["dist/extension/content.js"],
26
15
  "run_at": "document_idle"
27
16
  }
28
17
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomflow/proflow-execution-browser-extension",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Execution-owned MV3 Browser executor, evidence provider and browser application surface.",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -26,12 +26,12 @@
26
26
  "SETUP.md"
27
27
  ],
28
28
  "dependencies": {
29
- "@tomflow/proflow-execution-contracts": "^0.1.8",
30
- "@tomflow/proflow-module-contract": "^0.1.10"
29
+ "@tomflow/proflow-module-contract": "^0.1.12",
30
+ "@tomflow/proflow-execution-contracts": "^0.1.9"
31
31
  },
32
32
  "devDependencies": {
33
- "@tomflow/proflow-execution-runtime": "^0.1.11",
34
- "@tomflow/proflow-deployment-conformance": "^0.1.8"
33
+ "@tomflow/proflow-deployment-conformance": "^0.1.10",
34
+ "@tomflow/proflow-execution-runtime": "^0.1.13"
35
35
  },
36
36
  "keywords": [
37
37
  "proflow",
@@ -3,7 +3,7 @@
3
3
  "contractVersion": "1.0.0",
4
4
  "moduleRef": "execution-browser-extension",
5
5
  "packageName": "@tomflow/proflow-execution-browser-extension",
6
- "moduleVersion": "0.1.10",
6
+ "moduleVersion": "0.1.12",
7
7
  "kind": "browser-extension",
8
8
  "templateVersion": "1.0.0",
9
9
  "platformCompatibility": ">=1.0.0 <2.0.0",