@tomflow/proflow-execution-browser-extension 0.1.17 → 0.1.19
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/deployment/adapter.d.ts +10 -10
- package/dist/deployment/adapter.js +35 -2
- package/dist/deployment/descriptor.d.ts +1 -1
- package/dist/deployment/descriptor.js +1 -1
- package/dist/src/chrome-extension-state.d.ts +6 -0
- package/dist/src/chrome-extension-state.js +66 -0
- package/dist/src/install-workflow.js +0 -1
- package/manifest.json +6 -19
- package/package.json +5 -5
- package/proflow.module.json +1 -1
- package/CHANGELOG.md +0 -73
|
@@ -24,7 +24,7 @@ export declare const behaviorAdapter: {
|
|
|
24
24
|
ok: true;
|
|
25
25
|
status: "SUCCEEDED";
|
|
26
26
|
moduleRef: "execution-browser-extension";
|
|
27
|
-
moduleVersion: "0.1.
|
|
27
|
+
moduleVersion: "0.1.19";
|
|
28
28
|
data: {
|
|
29
29
|
loadDir: string;
|
|
30
30
|
};
|
|
@@ -37,7 +37,7 @@ export declare const behaviorAdapter: {
|
|
|
37
37
|
readonly ok: true;
|
|
38
38
|
readonly status: "SUCCEEDED";
|
|
39
39
|
readonly moduleRef: "execution-browser-extension";
|
|
40
|
-
readonly moduleVersion: "0.1.
|
|
40
|
+
readonly moduleVersion: "0.1.19";
|
|
41
41
|
};
|
|
42
42
|
observedEffects: never[];
|
|
43
43
|
}>;
|
|
@@ -47,7 +47,7 @@ export declare const behaviorAdapter: {
|
|
|
47
47
|
ok: true;
|
|
48
48
|
status: "SUCCEEDED";
|
|
49
49
|
moduleRef: "execution-browser-extension";
|
|
50
|
-
moduleVersion: "0.1.
|
|
50
|
+
moduleVersion: "0.1.19";
|
|
51
51
|
data: {
|
|
52
52
|
setupStatus: "ACTION_REQUIRED" | "READY";
|
|
53
53
|
runtimeStatus: "NOT_APPLICABLE";
|
|
@@ -66,7 +66,7 @@ export declare const behaviorAdapter: {
|
|
|
66
66
|
result: {
|
|
67
67
|
contract: "deployment.result.v1";
|
|
68
68
|
moduleRef: "execution-browser-extension";
|
|
69
|
-
moduleVersion: "0.1.
|
|
69
|
+
moduleVersion: "0.1.19";
|
|
70
70
|
ok: false;
|
|
71
71
|
status: "ACTION_REQUIRED";
|
|
72
72
|
data: {
|
|
@@ -98,14 +98,14 @@ export declare const behaviorAdapter: {
|
|
|
98
98
|
readonly ok: true;
|
|
99
99
|
readonly status: "SUCCEEDED";
|
|
100
100
|
readonly moduleRef: "execution-browser-extension";
|
|
101
|
-
readonly moduleVersion: "0.1.
|
|
101
|
+
readonly moduleVersion: "0.1.19";
|
|
102
102
|
};
|
|
103
103
|
observedEffects: string[];
|
|
104
104
|
} | {
|
|
105
105
|
result: {
|
|
106
106
|
contract: "deployment.result.v1";
|
|
107
107
|
moduleRef: "execution-browser-extension";
|
|
108
|
-
moduleVersion: "0.1.
|
|
108
|
+
moduleVersion: "0.1.19";
|
|
109
109
|
ok: false;
|
|
110
110
|
status: "FAILED";
|
|
111
111
|
error: {
|
|
@@ -138,7 +138,7 @@ export declare const behaviorAdapter: {
|
|
|
138
138
|
ok: true;
|
|
139
139
|
status: "SUCCEEDED";
|
|
140
140
|
moduleRef: "execution-browser-extension";
|
|
141
|
-
moduleVersion: "0.1.
|
|
141
|
+
moduleVersion: "0.1.19";
|
|
142
142
|
data: {
|
|
143
143
|
docs: string;
|
|
144
144
|
};
|
|
@@ -151,11 +151,11 @@ export declare const behaviorAdapter: {
|
|
|
151
151
|
readonly ok: true;
|
|
152
152
|
readonly status: "SUCCEEDED";
|
|
153
153
|
readonly moduleRef: "execution-browser-extension";
|
|
154
|
-
readonly moduleVersion: "0.1.
|
|
154
|
+
readonly moduleVersion: "0.1.19";
|
|
155
155
|
} | {
|
|
156
156
|
contract: "deployment.result.v1";
|
|
157
157
|
moduleRef: "execution-browser-extension";
|
|
158
|
-
moduleVersion: "0.1.
|
|
158
|
+
moduleVersion: "0.1.19";
|
|
159
159
|
ok: false;
|
|
160
160
|
status: "FAILED";
|
|
161
161
|
error: {
|
|
@@ -172,7 +172,7 @@ export declare const behaviorAdapter: {
|
|
|
172
172
|
readonly ok: true;
|
|
173
173
|
readonly status: "SUCCEEDED";
|
|
174
174
|
readonly moduleRef: "execution-browser-extension";
|
|
175
|
-
readonly moduleVersion: "0.1.
|
|
175
|
+
readonly moduleVersion: "0.1.19";
|
|
176
176
|
};
|
|
177
177
|
observedEffects: never[];
|
|
178
178
|
}>;
|
|
@@ -3,6 +3,7 @@ import { cp, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
|
3
3
|
import { basename, dirname, join, resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { deterministicLoopbackPort, ensureModuleSecretFile, moduleWorkspaceStateDirectory, readModuleSharedFacts, writeModuleSharedFacts, } from "@tomflow/proflow-module-contract";
|
|
6
|
+
import { probeChromeExtensionState } from "../src/chrome-extension-state.js";
|
|
6
7
|
import { openBrowserExtensionManager, runInteractiveBrowserExtensionSetup, } from "../src/install-workflow.js";
|
|
7
8
|
import { createBrowserExtensionPairingServer } from "../src/pairing.js";
|
|
8
9
|
import { descriptor } from "./descriptor.js";
|
|
@@ -41,6 +42,7 @@ export function browserExtensionLoadDir(workspaceRoot) {
|
|
|
41
42
|
}
|
|
42
43
|
const stateDir = (context) => moduleWorkspaceStateDirectory(context, descriptor.moduleRef);
|
|
43
44
|
const setupFile = (context) => join(stateDir(context), "setup.json");
|
|
45
|
+
const installFlowFile = (context) => join(stateDir(context), "install-flow.json");
|
|
44
46
|
const verificationFile = (context) => join(stateDir(context), "verification.json");
|
|
45
47
|
const executorConfigFile = (context) => join(stateDir(context), "browser-executor.json");
|
|
46
48
|
async function credential(file) {
|
|
@@ -116,6 +118,21 @@ async function readSetup(context) {
|
|
|
116
118
|
return undefined;
|
|
117
119
|
}
|
|
118
120
|
}
|
|
121
|
+
async function readInstallFlow(context) {
|
|
122
|
+
try {
|
|
123
|
+
const raw = JSON.parse(await readFile(installFlowFile(context), "utf8"));
|
|
124
|
+
return raw.developerModeConfirmed === true
|
|
125
|
+
? { developerModeConfirmed: true }
|
|
126
|
+
: undefined;
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async function persistDeveloperModeConfirmation(context) {
|
|
133
|
+
await mkdir(stateDir(context), { recursive: true, mode: 0o700 });
|
|
134
|
+
await writeFile(installFlowFile(context), `${JSON.stringify({ developerModeConfirmed: true })}\n`, { mode: 0o600 });
|
|
135
|
+
}
|
|
119
136
|
async function readEvidence(context, loadDir) {
|
|
120
137
|
try {
|
|
121
138
|
const raw = JSON.parse(await readFile(verificationFile(context), "utf8"));
|
|
@@ -294,7 +311,16 @@ export const behaviorAdapter = {
|
|
|
294
311
|
const loadDir = browserExtensionLoadDir(context.workspaceRoot);
|
|
295
312
|
const setup = await readSetup(context);
|
|
296
313
|
const evidence = await readEvidence(context, loadDir);
|
|
297
|
-
const
|
|
314
|
+
const chromeState = setup && evidence && setup.extensionId === evidence.extensionId
|
|
315
|
+
? await probeChromeExtensionState({
|
|
316
|
+
extensionId: evidence.extensionId,
|
|
317
|
+
loadDir,
|
|
318
|
+
})
|
|
319
|
+
: "MISSING";
|
|
320
|
+
const setupReady = Boolean(setup &&
|
|
321
|
+
evidence &&
|
|
322
|
+
setup.extensionId === evidence.extensionId &&
|
|
323
|
+
chromeState === "ENABLED");
|
|
298
324
|
return {
|
|
299
325
|
result: {
|
|
300
326
|
...base,
|
|
@@ -326,7 +352,10 @@ export const behaviorAdapter = {
|
|
|
326
352
|
const input = typeof context.input === "object" && context.input !== null
|
|
327
353
|
? context.input
|
|
328
354
|
: undefined;
|
|
329
|
-
|
|
355
|
+
const installFlow = await readInstallFlow(context);
|
|
356
|
+
const developerModeConfirmed = input?.developerModeConfirmed === true ||
|
|
357
|
+
installFlow?.developerModeConfirmed === true;
|
|
358
|
+
if (!developerModeConfirmed) {
|
|
330
359
|
await openBrowserExtensionManager(input?.desktop);
|
|
331
360
|
return {
|
|
332
361
|
result: {
|
|
@@ -360,6 +389,10 @@ export const behaviorAdapter = {
|
|
|
360
389
|
observedEffects: [],
|
|
361
390
|
};
|
|
362
391
|
}
|
|
392
|
+
if (input?.developerModeConfirmed === true &&
|
|
393
|
+
installFlow?.developerModeConfirmed !== true) {
|
|
394
|
+
await persistDeveloperModeConfirmation(context);
|
|
395
|
+
}
|
|
363
396
|
await runInteractiveBrowserExtensionSetup({
|
|
364
397
|
workspaceRoot: context.workspaceRoot,
|
|
365
398
|
...(input?.timeoutMs === undefined
|
|
@@ -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.19";
|
|
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.19",
|
|
7
7
|
kind: "browser-extension",
|
|
8
8
|
templateVersion: "1.0.0",
|
|
9
9
|
platformCompatibility: ">=1.0.0 <2.0.0",
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { readdir, readFile } from "node:fs/promises";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
function defaultUserDataRoot() {
|
|
5
|
+
if (process.platform === "darwin")
|
|
6
|
+
return join(homedir(), "Library", "Application Support", "Google", "Chrome");
|
|
7
|
+
if (process.platform === "linux")
|
|
8
|
+
return join(homedir(), ".config", "google-chrome");
|
|
9
|
+
if (process.platform === "win32" && process.env.LOCALAPPDATA)
|
|
10
|
+
return join(process.env.LOCALAPPDATA, "Google", "Chrome", "User Data");
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
function entryState(entry, expectedLoadDir) {
|
|
14
|
+
if (typeof entry.path !== "string" || resolve(entry.path) !== expectedLoadDir)
|
|
15
|
+
return undefined;
|
|
16
|
+
const disabledByReason = Array.isArray(entry.disable_reasons) && entry.disable_reasons.length > 0;
|
|
17
|
+
const disabledByState = entry.state === 0;
|
|
18
|
+
return disabledByReason || disabledByState ? "DISABLED" : "ENABLED";
|
|
19
|
+
}
|
|
20
|
+
async function settingsFrom(path) {
|
|
21
|
+
const raw = JSON.parse(await readFile(path, "utf8"));
|
|
22
|
+
return raw.extensions?.settings ?? {};
|
|
23
|
+
}
|
|
24
|
+
async function preferredProfiles(root) {
|
|
25
|
+
let lastUsed;
|
|
26
|
+
try {
|
|
27
|
+
const localState = JSON.parse(await readFile(join(root, "Local State"), "utf8"));
|
|
28
|
+
if (typeof localState.profile?.last_used === "string")
|
|
29
|
+
lastUsed = localState.profile.last_used;
|
|
30
|
+
}
|
|
31
|
+
catch { }
|
|
32
|
+
const entries = await readdir(root, { withFileTypes: true });
|
|
33
|
+
const profiles = entries
|
|
34
|
+
.filter((entry) => entry.isDirectory() && /^(Default|Profile \d+)$/.test(entry.name))
|
|
35
|
+
.map((entry) => entry.name);
|
|
36
|
+
return lastUsed && profiles.includes(lastUsed)
|
|
37
|
+
? [lastUsed, ...profiles.filter((name) => name !== lastUsed)]
|
|
38
|
+
: profiles;
|
|
39
|
+
}
|
|
40
|
+
export async function probeChromeExtensionState(input) {
|
|
41
|
+
const root = input.userDataRoot ?? defaultUserDataRoot();
|
|
42
|
+
if (!root)
|
|
43
|
+
return "UNKNOWN";
|
|
44
|
+
const expectedLoadDir = resolve(input.loadDir);
|
|
45
|
+
try {
|
|
46
|
+
const profiles = await preferredProfiles(root);
|
|
47
|
+
let sawMatchingDisabled = false;
|
|
48
|
+
for (const profile of profiles) {
|
|
49
|
+
for (const file of ["Secure Preferences", "Preferences"]) {
|
|
50
|
+
try {
|
|
51
|
+
const settings = await settingsFrom(join(root, profile, file));
|
|
52
|
+
const observed = entryState(settings[input.extensionId] ?? {}, expectedLoadDir);
|
|
53
|
+
if (observed === "ENABLED")
|
|
54
|
+
return "ENABLED";
|
|
55
|
+
if (observed === "DISABLED")
|
|
56
|
+
sawMatchingDisabled = true;
|
|
57
|
+
}
|
|
58
|
+
catch { }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return sawMatchingDisabled ? "DISABLED" : "MISSING";
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return "UNKNOWN";
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -60,7 +60,6 @@ export async function runInteractiveBrowserExtensionSetup(input) {
|
|
|
60
60
|
timeoutMs: input.timeoutMs ?? 120_000,
|
|
61
61
|
async onWaiting({ loadDir }) {
|
|
62
62
|
await desktop.copyText(loadDir);
|
|
63
|
-
await desktop.openExtensionsPage();
|
|
64
63
|
await desktop.showInstruction(browserExtensionInstallInstruction(loadDir));
|
|
65
64
|
},
|
|
66
65
|
});
|
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.
|
|
5
|
-
"permissions": [
|
|
6
|
-
|
|
7
|
-
"storage",
|
|
8
|
-
"sidePanel"
|
|
9
|
-
],
|
|
10
|
-
"host_permissions": [
|
|
11
|
-
"https://chatgpt.com/*",
|
|
12
|
-
"http://127.0.0.1/*"
|
|
13
|
-
],
|
|
4
|
+
"version": "0.1.19",
|
|
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
|
-
|
|
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
|
{
|
|
@@ -30,9 +19,7 @@
|
|
|
30
19
|
"https://chatgpt.com/gpts/editor",
|
|
31
20
|
"https://chatgpt.com/gpts/editor/*"
|
|
32
21
|
],
|
|
33
|
-
"js": [
|
|
34
|
-
"dist/extension/provisioning-content.js"
|
|
35
|
-
],
|
|
22
|
+
"js": ["dist/extension/provisioning-content.js"],
|
|
36
23
|
"run_at": "document_idle"
|
|
37
24
|
}
|
|
38
25
|
],
|
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.19",
|
|
4
4
|
"description": "Execution-owned MV3 Browser executor, evidence provider and browser application surface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"SETUP.md"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@tomflow/proflow-
|
|
31
|
-
"@tomflow/proflow-
|
|
30
|
+
"@tomflow/proflow-execution-contracts": "^0.1.10",
|
|
31
|
+
"@tomflow/proflow-module-contract": "^0.1.13"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@tomflow/proflow-
|
|
35
|
-
"@tomflow/proflow-
|
|
34
|
+
"@tomflow/proflow-execution-runtime": "^0.1.15",
|
|
35
|
+
"@tomflow/proflow-deployment-conformance": "^0.1.13"
|
|
36
36
|
},
|
|
37
37
|
"keywords": [
|
|
38
38
|
"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.19",
|
|
7
7
|
"kind": "browser-extension",
|
|
8
8
|
"templateVersion": "1.0.0",
|
|
9
9
|
"platformCompatibility": ">=1.0.0 <2.0.0",
|
package/CHANGELOG.md
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# @tomflow/proflow-execution-browser-extension
|
|
2
|
-
|
|
3
|
-
## 0.1.17
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Repack the Deployment Closeout release from freshly rebuilt artifacts and enforce build + publishability before every canonical publish.
|
|
8
|
-
|
|
9
|
-
## 0.1.16
|
|
10
|
-
|
|
11
|
-
### Patch Changes
|
|
12
|
-
|
|
13
|
-
- Harden Deployment Closeout: fail closed on partial installs and package-manager conflicts, normalize Git workspace isolation, make Dev Tunnel status fast and resumable without fabricating login failures, and align Browser Extension setup/conformance behavior.
|
|
14
|
-
|
|
15
|
-
## 0.1.15
|
|
16
|
-
|
|
17
|
-
### Patch Changes
|
|
18
|
-
|
|
19
|
-
- Add professional setup orchestration, Provider FAST/THINK input, recoverable managed Dev Tunnel provisioning, Browser installation guidance, and precise status diagnostics.
|
|
20
|
-
|
|
21
|
-
## 0.1.14
|
|
22
|
-
|
|
23
|
-
### Patch Changes
|
|
24
|
-
|
|
25
|
-
- Retire the obsolete Carrier package and Browser standalone management CLI, make Platform setup/status preserve owner and dependency semantics, and enforce read-only status observation across the final Real-3 deployment closeout.
|
|
26
|
-
|
|
27
|
-
## 0.1.13
|
|
28
|
-
|
|
29
|
-
### Patch Changes
|
|
30
|
-
|
|
31
|
-
- Ship the Phase 3 browser, tunnel, model automation, platform readiness, and documentation closure as one verifiable platform snapshot.
|
|
32
|
-
|
|
33
|
-
## 0.1.12
|
|
34
|
-
|
|
35
|
-
### Patch Changes
|
|
36
|
-
|
|
37
|
-
- 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.
|
|
38
|
-
|
|
39
|
-
## 0.1.11
|
|
40
|
-
|
|
41
|
-
### Patch Changes
|
|
42
|
-
|
|
43
|
-
- Upgrade the ProFlow terminal experience, stream Registry and package-manager progress, publish structured Chinese Module documentation, and provide numbered package-owned Setup assistants.
|
|
44
|
-
|
|
45
|
-
## 0.1.10
|
|
46
|
-
|
|
47
|
-
### Patch Changes
|
|
48
|
-
|
|
49
|
-
- Make every setup command directly runnable from a workspace and render setup failures without Node stack traces.
|
|
50
|
-
|
|
51
|
-
## 0.1.9
|
|
52
|
-
|
|
53
|
-
### Patch Changes
|
|
54
|
-
|
|
55
|
-
- Improve terminal progress and localized status output, publish readable Chinese module docs, and add guided setup assistants for external resources.
|
|
56
|
-
|
|
57
|
-
## 0.1.8
|
|
58
|
-
|
|
59
|
-
### Patch Changes
|
|
60
|
-
|
|
61
|
-
- Resolve DOCS.md from both source and built deployment adapters, prove all 24 built adapters return the published body, and announce package synchronization before the package manager blocks.
|
|
62
|
-
|
|
63
|
-
## 0.1.7
|
|
64
|
-
|
|
65
|
-
### Patch Changes
|
|
66
|
-
|
|
67
|
-
- Replace JSON terminal protocols with typed CLI outcomes, add real-time Chinese progress and lifecycle summaries, publish DOCS content, standardize executable setup plans and package-owned setup commands, and preserve only user-owned pnpm policy during uninstall.
|
|
68
|
-
|
|
69
|
-
## 0.1.6
|
|
70
|
-
|
|
71
|
-
### Patch Changes
|
|
72
|
-
|
|
73
|
-
- Align all Modules to the seven-command setup contract with executable package-owned setup guidance and full Platform setup aggregation.
|