@tomflow/proflow-execution-browser-extension 0.1.32 → 0.1.33

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.
@@ -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.32";
50
+ moduleVersion: "0.1.33";
51
51
  data: {
52
52
  loadDir: string;
53
53
  };
@@ -60,7 +60,7 @@ export declare const behaviorAdapter: {
60
60
  readonly ok: true;
61
61
  readonly status: "SUCCEEDED";
62
62
  readonly moduleRef: "execution-browser-extension";
63
- readonly moduleVersion: "0.1.32";
63
+ readonly moduleVersion: "0.1.33";
64
64
  };
65
65
  observedEffects: never[];
66
66
  }>;
@@ -70,7 +70,7 @@ export declare const behaviorAdapter: {
70
70
  ok: true;
71
71
  status: "SUCCEEDED";
72
72
  moduleRef: "execution-browser-extension";
73
- moduleVersion: "0.1.32";
73
+ moduleVersion: "0.1.33";
74
74
  data: {
75
75
  setupStatus: "ACTION_REQUIRED" | "READY";
76
76
  runtimeStatus: "NOT_APPLICABLE";
@@ -95,7 +95,7 @@ export declare const behaviorAdapter: {
95
95
  result: {
96
96
  contract: "deployment.result.v1";
97
97
  moduleRef: "execution-browser-extension";
98
- moduleVersion: "0.1.32";
98
+ moduleVersion: "0.1.33";
99
99
  ok: false;
100
100
  status: "ACTION_REQUIRED";
101
101
  data: {
@@ -127,14 +127,14 @@ export declare const behaviorAdapter: {
127
127
  readonly ok: true;
128
128
  readonly status: "SUCCEEDED";
129
129
  readonly moduleRef: "execution-browser-extension";
130
- readonly moduleVersion: "0.1.32";
130
+ readonly moduleVersion: "0.1.33";
131
131
  };
132
132
  observedEffects: string[];
133
133
  } | {
134
134
  result: {
135
135
  contract: "deployment.result.v1";
136
136
  moduleRef: "execution-browser-extension";
137
- moduleVersion: "0.1.32";
137
+ moduleVersion: "0.1.33";
138
138
  ok: false;
139
139
  status: "FAILED";
140
140
  error: {
@@ -167,7 +167,7 @@ export declare const behaviorAdapter: {
167
167
  ok: true;
168
168
  status: "SUCCEEDED";
169
169
  moduleRef: "execution-browser-extension";
170
- moduleVersion: "0.1.32";
170
+ moduleVersion: "0.1.33";
171
171
  data: {
172
172
  docs: string;
173
173
  };
@@ -180,11 +180,11 @@ export declare const behaviorAdapter: {
180
180
  readonly ok: true;
181
181
  readonly status: "SUCCEEDED";
182
182
  readonly moduleRef: "execution-browser-extension";
183
- readonly moduleVersion: "0.1.32";
183
+ readonly moduleVersion: "0.1.33";
184
184
  } | {
185
185
  contract: "deployment.result.v1";
186
186
  moduleRef: "execution-browser-extension";
187
- moduleVersion: "0.1.32";
187
+ moduleVersion: "0.1.33";
188
188
  ok: false;
189
189
  status: "FAILED";
190
190
  error: {
@@ -201,7 +201,7 @@ export declare const behaviorAdapter: {
201
201
  readonly ok: true;
202
202
  readonly status: "SUCCEEDED";
203
203
  readonly moduleRef: "execution-browser-extension";
204
- readonly moduleVersion: "0.1.32";
204
+ readonly moduleVersion: "0.1.33";
205
205
  };
206
206
  observedEffects: never[];
207
207
  }>;
@@ -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.32";
6
+ readonly moduleVersion: "0.1.33";
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.32",
6
+ moduleVersion: "0.1.33",
7
7
  kind: "browser-extension",
8
8
  templateVersion: "1.0.0",
9
9
  platformCompatibility: ">=1.0.0 <2.0.0",
@@ -13876,6 +13876,8 @@ function shouldTriggerObserverRecovery(previous, current) {
13876
13876
  // packages/execution-browser-extension/extension/background.ts
13877
13877
  var extensionInstanceId = `extension:${crypto.randomUUID()}`;
13878
13878
  var sessions = /* @__PURE__ */ new Map();
13879
+ var BROWSER_CARRIER_KEEPALIVE_KEY = "proflowBrowserSnapshot";
13880
+ var BROWSER_CARRIER_KEEPALIVE_MS = 2e4;
13879
13881
  var sleep = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds));
13880
13882
  async function persistSnapshot() {
13881
13883
  await chrome.storage.session.set({
@@ -14517,7 +14519,12 @@ async function runBridgeLoop() {
14517
14519
  });
14518
14520
  if (!hello.ok) throw new Error("BRIDGE_HELLO_REJECTED");
14519
14521
  let lastHeartbeatAt = 0;
14522
+ let lastExtensionKeepaliveAt = 0;
14520
14523
  while (true) {
14524
+ if (Date.now() - lastExtensionKeepaliveAt >= BROWSER_CARRIER_KEEPALIVE_MS) {
14525
+ await chrome.storage.session.get(BROWSER_CARRIER_KEEPALIVE_KEY).catch(() => ({}));
14526
+ lastExtensionKeepaliveAt = Date.now();
14527
+ }
14521
14528
  if (Date.now() - lastHeartbeatAt >= 5e3) {
14522
14529
  const heartbeat = await bridgeFetch(
14523
14530
  config2,
@@ -108,7 +108,9 @@ export async function createBrowserRealityBridgeServer(options) {
108
108
  const now = options.now ?? (() => new Date());
109
109
  const idFactory = options.idFactory ?? randomUUID;
110
110
  const freshnessMs = options.heartbeatFreshnessMs ?? 10_000;
111
- const commandTimeoutMs = options.commandTimeoutMs ?? 15_000;
111
+ // Browser commands are Promise-driven. This is only an abnormal hung-command
112
+ // watchdog; normal page load / content observation must not be scheduled by it.
113
+ const commandTimeoutMs = options.commandTimeoutMs ?? 120_000;
112
114
  const expectedOrigin = `chrome-extension://${options.extensionId}`;
113
115
  const queue = [];
114
116
  const pending = new Map();
@@ -106,7 +106,10 @@ type ChromeRuntime = {
106
106
  onInstalled: { addListener(listener: () => void): void };
107
107
  };
108
108
  storage: {
109
- session: { set(value: Record<string, unknown>): Promise<void> };
109
+ session: {
110
+ get(key: string): Promise<Record<string, unknown>>;
111
+ set(value: Record<string, unknown>): Promise<void>;
112
+ };
110
113
  local: {
111
114
  get(key: string): Promise<Record<string, unknown>>;
112
115
  set(value: Record<string, unknown>): Promise<void>;
@@ -138,6 +141,8 @@ declare const chrome: ChromeRuntime;
138
141
 
139
142
  const extensionInstanceId = `extension:${crypto.randomUUID()}`;
140
143
  const sessions = new Map<number, ContentObservation>();
144
+ const BROWSER_CARRIER_KEEPALIVE_KEY = "proflowBrowserSnapshot";
145
+ const BROWSER_CARRIER_KEEPALIVE_MS = 20_000;
141
146
 
142
147
  const sleep = (milliseconds: number) =>
143
148
  new Promise<void>((resolve) => setTimeout(resolve, milliseconds));
@@ -1002,7 +1007,17 @@ async function runBridgeLoop() {
1002
1007
  });
1003
1008
  if (!hello.ok) throw new Error("BRIDGE_HELLO_REJECTED");
1004
1009
  let lastHeartbeatAt = 0;
1010
+ let lastExtensionKeepaliveAt = 0;
1005
1011
  while (true) {
1012
+ if (
1013
+ Date.now() - lastExtensionKeepaliveAt >=
1014
+ BROWSER_CARRIER_KEEPALIVE_MS
1015
+ ) {
1016
+ await chrome.storage.session
1017
+ .get(BROWSER_CARRIER_KEEPALIVE_KEY)
1018
+ .catch(() => ({}));
1019
+ lastExtensionKeepaliveAt = Date.now();
1020
+ }
1006
1021
  if (Date.now() - lastHeartbeatAt >= 5_000) {
1007
1022
  const heartbeat = await bridgeFetch(
1008
1023
  config,
package/manifest.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "ProFlow Execution Browser",
4
- "version": "0.1.32",
4
+ "version": "0.1.33",
5
5
  "permissions": [
6
6
  "tabs",
7
7
  "storage"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomflow/proflow-execution-browser-extension",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "description": "Execution-owned MV3 Browser executor, evidence provider and browser application surface.",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -31,8 +31,8 @@
31
31
  "@tomflow/proflow-module-contract": "^0.1.13"
32
32
  },
33
33
  "devDependencies": {
34
- "@tomflow/proflow-execution-runtime": "^0.1.15",
35
- "@tomflow/proflow-deployment-conformance": "^0.1.13"
34
+ "@tomflow/proflow-deployment-conformance": "^0.1.13",
35
+ "@tomflow/proflow-execution-runtime": "^0.1.16"
36
36
  },
37
37
  "keywords": [
38
38
  "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.32",
6
+ "moduleVersion": "0.1.33",
7
7
  "kind": "browser-extension",
8
8
  "templateVersion": "1.0.0",
9
9
  "platformCompatibility": ">=1.0.0 <2.0.0",