@tomflow/proflow-execution-browser-extension 0.1.8 → 0.1.9
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 +6 -0
- package/DOCS.md +7 -23
- package/dist/deployment/adapter.d.ts +10 -10
- package/dist/deployment/descriptor.d.ts +1 -1
- package/dist/deployment/descriptor.js +1 -1
- package/dist/src/configure.js +23 -3
- package/manifest.json +16 -5
- package/package.json +5 -5
- package/proflow.module.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @tomflow/proflow-execution-browser-extension
|
|
2
2
|
|
|
3
|
+
## 0.1.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Improve terminal progress and localized status output, publish readable Chinese module docs, and add guided setup assistants for external resources.
|
|
8
|
+
|
|
3
9
|
## 0.1.8
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/DOCS.md
CHANGED
|
@@ -1,29 +1,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# execution-browser-extension
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Domain: `execution`
|
|
5
|
-
Kind: `browser-extension`
|
|
3
|
+
Execution Browser Extension(浏览器执行扩展)让 ProFlow 在 Chrome 中执行受控页面操作、采集页面证据,并提供任务与审批界面。
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
## 什么时候需要
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
首次部署浏览器能力、扩展升级,或者 Chrome 报告扩展未连接时使用。
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
## 如何配置
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
运行 `proflow-execution-browser-extension setup`。向导会准备扩展目录、打开 Chrome 扩展管理页,并说明如何加载已解压扩展;完成后收集 Extension ID(扩展标识)并验证连接状态。
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## Requires
|
|
18
|
-
|
|
19
|
-
- `execution` `>=1.0.0 <2.0.0`
|
|
20
|
-
- `task-orchestration` `>=1.0.0 <2.0.0`
|
|
21
|
-
- `agent-runtime` `>=1.0.0 <2.0.0`
|
|
22
|
-
|
|
23
|
-
## Public setup inputs
|
|
24
|
-
|
|
25
|
-
- None. Deterministic/private values and cross-Module shared facts are not public configuration.
|
|
26
|
-
|
|
27
|
-
## Ownership boundary
|
|
28
|
-
|
|
29
|
-
Module business APIs and any module-specific extra commands remain package-owned. Platform does not proxy or interpret them. Current human/external preparation is documented in `SETUP.md`.
|
|
13
|
+
扩展不保存 Task(任务)或 Approval(审批)的业务真相,只负责浏览器侧交互。
|
|
@@ -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.
|
|
17
|
+
moduleVersion: "0.1.9";
|
|
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.
|
|
30
|
+
readonly moduleVersion: "0.1.9";
|
|
31
31
|
};
|
|
32
32
|
observedEffects: never[];
|
|
33
33
|
}>;
|
|
@@ -37,7 +37,7 @@ export declare const behaviorAdapter: {
|
|
|
37
37
|
ok: true;
|
|
38
38
|
status: "SUCCEEDED";
|
|
39
39
|
moduleRef: "execution-browser-extension";
|
|
40
|
-
moduleVersion: "0.1.
|
|
40
|
+
moduleVersion: "0.1.9";
|
|
41
41
|
data: {
|
|
42
42
|
setupStatus: "ACTION_REQUIRED" | "READY";
|
|
43
43
|
runtimeStatus: "RUNNING" | "STOPPED";
|
|
@@ -49,7 +49,7 @@ export declare const behaviorAdapter: {
|
|
|
49
49
|
result: {
|
|
50
50
|
contract: "deployment.result.v1";
|
|
51
51
|
moduleRef: "execution-browser-extension";
|
|
52
|
-
moduleVersion: "0.1.
|
|
52
|
+
moduleVersion: "0.1.9";
|
|
53
53
|
ok: false;
|
|
54
54
|
status: "FAILED";
|
|
55
55
|
error: {
|
|
@@ -79,7 +79,7 @@ export declare const behaviorAdapter: {
|
|
|
79
79
|
result: {
|
|
80
80
|
contract: "deployment.result.v1";
|
|
81
81
|
moduleRef: "execution-browser-extension";
|
|
82
|
-
moduleVersion: "0.1.
|
|
82
|
+
moduleVersion: "0.1.9";
|
|
83
83
|
ok: false;
|
|
84
84
|
status: "ACTION_REQUIRED";
|
|
85
85
|
data: {
|
|
@@ -113,7 +113,7 @@ export declare const behaviorAdapter: {
|
|
|
113
113
|
readonly ok: true;
|
|
114
114
|
readonly status: "SUCCEEDED";
|
|
115
115
|
readonly moduleRef: "execution-browser-extension";
|
|
116
|
-
readonly moduleVersion: "0.1.
|
|
116
|
+
readonly moduleVersion: "0.1.9";
|
|
117
117
|
};
|
|
118
118
|
observedEffects: string[];
|
|
119
119
|
}>;
|
|
@@ -123,7 +123,7 @@ export declare const behaviorAdapter: {
|
|
|
123
123
|
ok: true;
|
|
124
124
|
status: "SUCCEEDED";
|
|
125
125
|
moduleRef: "execution-browser-extension";
|
|
126
|
-
moduleVersion: "0.1.
|
|
126
|
+
moduleVersion: "0.1.9";
|
|
127
127
|
data: {
|
|
128
128
|
docs: string;
|
|
129
129
|
};
|
|
@@ -136,11 +136,11 @@ export declare const behaviorAdapter: {
|
|
|
136
136
|
readonly ok: true;
|
|
137
137
|
readonly status: "SUCCEEDED";
|
|
138
138
|
readonly moduleRef: "execution-browser-extension";
|
|
139
|
-
readonly moduleVersion: "0.1.
|
|
139
|
+
readonly moduleVersion: "0.1.9";
|
|
140
140
|
} | {
|
|
141
141
|
contract: "deployment.result.v1";
|
|
142
142
|
moduleRef: "execution-browser-extension";
|
|
143
|
-
moduleVersion: "0.1.
|
|
143
|
+
moduleVersion: "0.1.9";
|
|
144
144
|
ok: false;
|
|
145
145
|
status: "FAILED";
|
|
146
146
|
error: {
|
|
@@ -157,7 +157,7 @@ export declare const behaviorAdapter: {
|
|
|
157
157
|
readonly ok: true;
|
|
158
158
|
readonly status: "SUCCEEDED";
|
|
159
159
|
readonly moduleRef: "execution-browser-extension";
|
|
160
|
-
readonly moduleVersion: "0.1.
|
|
160
|
+
readonly moduleVersion: "0.1.9";
|
|
161
161
|
};
|
|
162
162
|
observedEffects: never[];
|
|
163
163
|
}>;
|
|
@@ -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.
|
|
6
|
+
readonly moduleVersion: "0.1.9";
|
|
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.
|
|
6
|
+
moduleVersion: "0.1.9",
|
|
7
7
|
kind: "browser-extension",
|
|
8
8
|
templateVersion: "1.0.0",
|
|
9
9
|
platformCompatibility: ">=1.0.0 <2.0.0",
|
package/dist/src/configure.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
2
3
|
import { readFile } from "node:fs/promises";
|
|
3
4
|
import { resolve } from "node:path";
|
|
4
5
|
import { createInterface } from "node:readline/promises";
|
|
@@ -34,6 +35,21 @@ export async function materializeBrowserExtensionConfig(workspaceRoot) {
|
|
|
34
35
|
workspaceRoot,
|
|
35
36
|
});
|
|
36
37
|
}
|
|
38
|
+
function openChromeExtensions() {
|
|
39
|
+
const url = "chrome://extensions";
|
|
40
|
+
const command = process.platform === "darwin"
|
|
41
|
+
? "open"
|
|
42
|
+
: process.platform === "win32"
|
|
43
|
+
? "cmd"
|
|
44
|
+
: "xdg-open";
|
|
45
|
+
const parameters = process.platform === "darwin"
|
|
46
|
+
? ["-a", "Google Chrome", url]
|
|
47
|
+
: process.platform === "win32"
|
|
48
|
+
? ["/c", "start", "", url]
|
|
49
|
+
: [url];
|
|
50
|
+
const child = spawn(command, parameters, { detached: true, stdio: "ignore" });
|
|
51
|
+
child.unref();
|
|
52
|
+
}
|
|
37
53
|
async function main() {
|
|
38
54
|
const args = process.argv.slice(2);
|
|
39
55
|
if (args.includes("--json"))
|
|
@@ -50,12 +66,16 @@ async function main() {
|
|
|
50
66
|
if (!extensionId && !process.stdin.isTTY)
|
|
51
67
|
throw new Error("非交互环境必须提供 --extension-id");
|
|
52
68
|
if (!extensionId) {
|
|
69
|
+
const prepared = await behaviorAdapter.install({ workspaceRoot });
|
|
70
|
+
const loadDir = String(prepared.result.data.loadDir);
|
|
53
71
|
const prompt = createInterface({
|
|
54
72
|
input: process.stdin,
|
|
55
73
|
output: process.stdout,
|
|
56
74
|
});
|
|
57
75
|
try {
|
|
58
|
-
|
|
76
|
+
process.stdout.write(`\nChrome 扩展配置\n\n 1. 已准备扩展目录:${loadDir}\n 2. 在 Chrome 打开“扩展程序”,启用“开发者模式”。\n 3. 点击“加载已解压的扩展程序”,选择上面的目录。\n 4. 确认 Service Worker(后台服务)显示正常,再复制扩展 ID。\n\n`);
|
|
77
|
+
openChromeExtensions();
|
|
78
|
+
extensionId = await prompt.question("◆ Chrome Extension ID(32 位小写字母)\n> ");
|
|
59
79
|
}
|
|
60
80
|
finally {
|
|
61
81
|
prompt.close();
|
|
@@ -66,8 +86,8 @@ async function main() {
|
|
|
66
86
|
input: { extensionId, serviceWorker: "RUNNING" },
|
|
67
87
|
});
|
|
68
88
|
process.stdout.write(result.result.status === "SUCCEEDED"
|
|
69
|
-
? "
|
|
70
|
-
: "
|
|
89
|
+
? "\n✓ Extension ID 已保存\n✓ Service Worker 运行证据已记录\n"
|
|
90
|
+
: "\n✕ 浏览器扩展尚未就绪,请检查扩展错误后重试。\n");
|
|
71
91
|
if (result.result.status === "FAILED")
|
|
72
92
|
process.exitCode = 1;
|
|
73
93
|
return;
|
package/manifest.json
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"name": "ProFlow Execution Browser",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"permissions": [
|
|
6
|
-
|
|
4
|
+
"version": "0.1.9",
|
|
5
|
+
"permissions": [
|
|
6
|
+
"tabs",
|
|
7
|
+
"storage",
|
|
8
|
+
"sidePanel"
|
|
9
|
+
],
|
|
10
|
+
"host_permissions": [
|
|
11
|
+
"https://chatgpt.com/*",
|
|
12
|
+
"http://127.0.0.1/*"
|
|
13
|
+
],
|
|
7
14
|
"background": {
|
|
8
15
|
"service_worker": "dist/extension/background.js",
|
|
9
16
|
"type": "module"
|
|
10
17
|
},
|
|
11
18
|
"content_scripts": [
|
|
12
19
|
{
|
|
13
|
-
"matches": [
|
|
14
|
-
|
|
20
|
+
"matches": [
|
|
21
|
+
"https://chatgpt.com/g/*"
|
|
22
|
+
],
|
|
23
|
+
"js": [
|
|
24
|
+
"dist/extension/content.js"
|
|
25
|
+
],
|
|
15
26
|
"run_at": "document_idle"
|
|
16
27
|
}
|
|
17
28
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomflow/proflow-execution-browser-extension",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
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-
|
|
30
|
-
"@tomflow/proflow-
|
|
29
|
+
"@tomflow/proflow-execution-contracts": "^0.1.8",
|
|
30
|
+
"@tomflow/proflow-module-contract": "^0.1.10"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@tomflow/proflow-
|
|
34
|
-
"@tomflow/proflow-
|
|
33
|
+
"@tomflow/proflow-deployment-conformance": "^0.1.8",
|
|
34
|
+
"@tomflow/proflow-execution-runtime": "^0.1.11"
|
|
35
35
|
},
|
|
36
36
|
"keywords": [
|
|
37
37
|
"proflow",
|
package/proflow.module.json
CHANGED
|
@@ -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.
|
|
6
|
+
"moduleVersion": "0.1.9",
|
|
7
7
|
"kind": "browser-extension",
|
|
8
8
|
"templateVersion": "1.0.0",
|
|
9
9
|
"platformCompatibility": ">=1.0.0 <2.0.0",
|