@wenathlan/extension 1.1.59 → 1.1.60
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/README.md +4 -3
- package/dist/cli.js +19 -2
- package/dist/environments.d.ts +96 -0
- package/dist/environments.d.ts.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +559 -1
- package/dist/index.js.map +4 -4
- package/dist/memory.d.ts +55 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/policy.d.ts +32 -1
- package/dist/policy.d.ts.map +1 -1
- package/dist/protocol.d.ts +46 -2
- package/dist/protocol.d.ts.map +1 -1
- package/dist/runstate.d.ts +127 -0
- package/dist/runstate.d.ts.map +1 -0
- package/dist/sandboxframe.d.ts +45 -0
- package/dist/sandboxframe.d.ts.map +1 -0
- package/dist/types.d.ts +168 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/extension/dist/background.js +919 -4
- package/extension/dist/background.js.map +4 -4
- package/extension/dist/manifest.json +16 -2
- package/extension/dist/offscreen.html +7 -0
- package/extension/dist/offscreen.js +87 -0
- package/extension/dist/offscreen.js.map +7 -0
- package/extension/dist/pagebridge.js +7 -0
- package/extension/dist/pagebridge.js.map +2 -2
- package/extension/dist/popup.html +1 -1
- package/extension/dist/popup.js +38 -0
- package/extension/dist/popup.js.map +2 -2
- package/extension/dist/sandbox.html +28 -0
- package/extension/dist/sidepanel.html +1 -1
- package/extension/dist/sidepanel.js +293 -0
- package/extension/dist/sidepanel.js.map +3 -3
- package/extension/manifest.json +16 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2014,6 +2014,170 @@ function swarmstateof(input) {
|
|
|
2014
2014
|
return { agents: input.agents, queue: input.queue, mailboxes: input.mailboxes, killswitch: input.killswitch };
|
|
2015
2015
|
}
|
|
2016
2016
|
|
|
2017
|
+
// runstate.ts
|
|
2018
|
+
function openrun(input) {
|
|
2019
|
+
if (input.runid.trim() === "" || input.sessionid.trim() === "") throw new Error("The run state needs its run and session ids.");
|
|
2020
|
+
if (!Number.isFinite(input.interval) || input.interval <= 0) throw new Error("The keepalive heartbeat interval stays a positive user value in milliseconds.");
|
|
2021
|
+
return {
|
|
2022
|
+
runid: input.runid,
|
|
2023
|
+
sessionid: input.sessionid,
|
|
2024
|
+
planid: input.planid,
|
|
2025
|
+
profileid: input.profileid,
|
|
2026
|
+
state: "active",
|
|
2027
|
+
urlhistory: [],
|
|
2028
|
+
environments: {},
|
|
2029
|
+
turnarounds: {},
|
|
2030
|
+
keepalive: { runid: input.runid, sessionid: input.sessionid, state: "active", startedat: input.now, interval: input.interval, beats: 0, lastbeatat: input.now, portopen: true, events: [{ kind: "start", at: input.now, detail: `The keepalive port opens for the run ${input.runid} and beats every ${input.interval} milliseconds.` }] },
|
|
2031
|
+
updatedat: input.now
|
|
2032
|
+
};
|
|
2033
|
+
}
|
|
2034
|
+
function beatrun(state, now) {
|
|
2035
|
+
if (state.keepalive.state !== "active") throw new Error(`The run ${state.runid} is ${state.keepalive.state}; a stopped run emits no heartbeat.`);
|
|
2036
|
+
return {
|
|
2037
|
+
...state,
|
|
2038
|
+
keepalive: { ...state.keepalive, beats: state.keepalive.beats + 1, lastbeatat: now, events: [...state.keepalive.events, { kind: "heartbeat", at: now }].slice(-200) },
|
|
2039
|
+
updatedat: now
|
|
2040
|
+
};
|
|
2041
|
+
}
|
|
2042
|
+
function closerun(state, now) {
|
|
2043
|
+
if (state.keepalive.state === "stopped") throw new Error(`The run ${state.runid} already stopped its keepalive port.`);
|
|
2044
|
+
return {
|
|
2045
|
+
...state,
|
|
2046
|
+
state: "completed",
|
|
2047
|
+
keepalive: { ...state.keepalive, state: "stopped", stoppedat: now, portopen: false, events: [...state.keepalive.events, { kind: "stop", at: now, detail: "The run reached a terminal state and the keepalive port closed." }].slice(-200) },
|
|
2048
|
+
updatedat: now
|
|
2049
|
+
};
|
|
2050
|
+
}
|
|
2051
|
+
function reattachrun(state, now) {
|
|
2052
|
+
if (state.keepalive.state !== "active") throw new Error(`The run ${state.runid} is ${state.keepalive.state}; a stopped run never reattaches.`);
|
|
2053
|
+
return {
|
|
2054
|
+
...state,
|
|
2055
|
+
state: "recovered",
|
|
2056
|
+
keepalive: { ...state.keepalive, portopen: true, events: [...state.keepalive.events, { kind: "reattach", at: now, detail: "The service worker restarted and the keepalive port reattached from the persisted run state." }].slice(-200) },
|
|
2057
|
+
updatedat: now
|
|
2058
|
+
};
|
|
2059
|
+
}
|
|
2060
|
+
function recordurl(state, entry) {
|
|
2061
|
+
if (entry.url.trim() === "") throw new Error("The url history entry needs its url.");
|
|
2062
|
+
const record2 = { url: entry.url, stepid: entry.stepid, at: entry.now };
|
|
2063
|
+
return { ...state, urlhistory: [...state.urlhistory.filter((item) => !(item.url === record2.url && item.stepid === record2.stepid)), record2], updatedat: entry.now };
|
|
2064
|
+
}
|
|
2065
|
+
function recordenvironment(state, input) {
|
|
2066
|
+
if (input.stepid.trim() === "") throw new Error("The environment record needs its step id.");
|
|
2067
|
+
const provenance = { origin: input.origin, stepid: input.stepid, environment: input.environment };
|
|
2068
|
+
return { ...state, environments: { ...state.environments, [input.stepid]: input.environment }, lastprovenance: provenance, updatedat: input.now };
|
|
2069
|
+
}
|
|
2070
|
+
function recordturnaround(state, input) {
|
|
2071
|
+
if (input.stepid.trim() === "") throw new Error("The turnaround record needs its step id.");
|
|
2072
|
+
if (!Number.isFinite(input.milliseconds) || input.milliseconds < 0) throw new Error("The worker turnaround stays a non-negative duration in milliseconds.");
|
|
2073
|
+
return { ...state, turnarounds: { ...state.turnarounds, [input.stepid]: input.milliseconds }, updatedat: input.now };
|
|
2074
|
+
}
|
|
2075
|
+
function markpending(state, stepid, now) {
|
|
2076
|
+
return { ...state, ...stepid !== void 0 && stepid.trim() !== "" ? { pendingstepid: stepid } : {}, updatedat: now };
|
|
2077
|
+
}
|
|
2078
|
+
function recoveryplan(state) {
|
|
2079
|
+
if (state.state === "completed") return { runid: state.runid, recoverable: false, reason: `The run ${state.runid} completed before the restart; nothing resumes.` };
|
|
2080
|
+
if (state.state === "reaped") return { runid: state.runid, recoverable: false, reason: `The run ${state.runid} was reaped as a zombie; the user starts a fresh reviewed run.` };
|
|
2081
|
+
if (state.pendingstepid === void 0 || state.pendingstepid.trim() === "") return { runid: state.runid, recoverable: false, reason: `The run ${state.runid} carries no pending step; a fresh reviewed run starts over instead of guessing.` };
|
|
2082
|
+
return { runid: state.runid, pendingstepid: state.pendingstepid, recoverable: true, reason: `The executor resumes the pending step ${state.pendingstepid} of the run ${state.runid} from the persisted run state.` };
|
|
2083
|
+
}
|
|
2084
|
+
function zombiesweep(input) {
|
|
2085
|
+
if (!Number.isFinite(input.interval) || input.interval <= 0) throw new Error("The zombie sweep needs its heartbeat interval as a positive user value.");
|
|
2086
|
+
if (!Number.isInteger(input.missedlimit) || input.missedlimit < 1) throw new Error("The zombie tolerance stays a positive whole number of silent intervals.");
|
|
2087
|
+
const silentfor = input.interval * input.missedlimit;
|
|
2088
|
+
const zombies = input.states.filter((state) => state.keepalive.state === "active" && input.now - state.keepalive.lastbeatat > silentfor);
|
|
2089
|
+
if (zombies.length === 0) return { states: input.states, reaped: [] };
|
|
2090
|
+
const ids = new Set(zombies.map((state) => state.runid));
|
|
2091
|
+
return { states: input.states.map((state) => ids.has(state.runid) ? { ...state, state: "reaped", keepalive: { ...state.keepalive, state: "stopped", portopen: false, ...state.keepalive.stoppedat === void 0 ? { stoppedat: input.now } : {}, events: [...state.keepalive.events, { kind: "stop", at: input.now, detail: "The zombie reaper closed the silent run." }] } } : state), reaped: [...ids] };
|
|
2092
|
+
}
|
|
2093
|
+
function acquirerunlock(input) {
|
|
2094
|
+
if (input.sessionid.trim() === "" || input.runid.trim() === "") throw new Error("The run lock needs its session and run ids.");
|
|
2095
|
+
const live = input.locks.filter((lock2) => lock2.sessionid === input.sessionid && (lock2.expiresat === void 0 || lock2.expiresat > input.now));
|
|
2096
|
+
const held = live.find((lock2) => lock2.runid !== input.runid);
|
|
2097
|
+
if (held) return { locks: input.locks, acquired: false, reason: `The session ${input.sessionid} already holds the run ${held.runid}; a session never carries two concurrent runs.` };
|
|
2098
|
+
const own = input.locks.find((lock2) => lock2.sessionid === input.sessionid && lock2.runid === input.runid);
|
|
2099
|
+
if (own) return { locks: input.locks, acquired: true, reason: `The run ${input.runid} of the session ${input.sessionid} already holds its lock.` };
|
|
2100
|
+
const lock = { sessionid: input.sessionid, runid: input.runid, holder: input.holder, acquiredat: input.now, ...input.expiresat !== void 0 ? { expiresat: input.expiresat } : {} };
|
|
2101
|
+
return { locks: [...input.locks.filter((entry) => entry.sessionid !== input.sessionid), lock], acquired: true, reason: `The run ${input.runid} locked the session ${input.sessionid} against concurrent runs.` };
|
|
2102
|
+
}
|
|
2103
|
+
function releaserunlock(input) {
|
|
2104
|
+
const lock = input.locks.find((entry) => entry.sessionid === input.sessionid);
|
|
2105
|
+
if (!lock || lock.runid !== input.runid) return { locks: input.locks, released: false, reason: `The run ${input.runid} holds no lock of the session ${input.sessionid}.` };
|
|
2106
|
+
return { locks: input.locks.filter((entry) => entry.sessionid !== input.sessionid), released: true, reason: `The run ${input.runid} released the run lock of the session ${input.sessionid}.` };
|
|
2107
|
+
}
|
|
2108
|
+
function expirerunlocks(locks, now) {
|
|
2109
|
+
const expired = locks.filter((lock) => lock.expiresat !== void 0 && now > lock.expiresat);
|
|
2110
|
+
if (expired.length === 0) return { locks, expired: [] };
|
|
2111
|
+
const ids = new Set(expired.map((lock) => lock.sessionid));
|
|
2112
|
+
return { locks: locks.filter((lock) => !ids.has(lock.sessionid)), expired: [...ids] };
|
|
2113
|
+
}
|
|
2114
|
+
function serializesteps(input) {
|
|
2115
|
+
const shared = /* @__PURE__ */ new Set();
|
|
2116
|
+
const counts = /* @__PURE__ */ new Map();
|
|
2117
|
+
for (const branch of input.branches) for (const step of branch.steps) counts.set(step.tabid, (counts.get(step.tabid) ?? 0) + 1);
|
|
2118
|
+
for (const [tabid, count] of counts) if (count > 1) shared.add(tabid);
|
|
2119
|
+
const order = [];
|
|
2120
|
+
let cursor = 0;
|
|
2121
|
+
for (const branch of input.branches) {
|
|
2122
|
+
for (const step of branch.steps) {
|
|
2123
|
+
if (shared.has(step.tabid)) {
|
|
2124
|
+
order.push({ branchid: branch.branchid, stepid: step.stepid, tabid: step.tabid, order: cursor });
|
|
2125
|
+
cursor += 1;
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
for (const branch of input.branches) {
|
|
2130
|
+
for (const step of branch.steps) {
|
|
2131
|
+
if (!shared.has(step.tabid)) {
|
|
2132
|
+
order.push({ branchid: branch.branchid, stepid: step.stepid, tabid: step.tabid, order: cursor });
|
|
2133
|
+
cursor += 1;
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
return order;
|
|
2138
|
+
}
|
|
2139
|
+
async function sealrunstate(state) {
|
|
2140
|
+
const payload = JSON.stringify(state);
|
|
2141
|
+
const digest = await sha256(payload);
|
|
2142
|
+
return { payload, algorithm: "sha-256", digest, sealedat: state.updatedat };
|
|
2143
|
+
}
|
|
2144
|
+
async function openseal(sealed) {
|
|
2145
|
+
const digest = await sha256(sealed.payload);
|
|
2146
|
+
if (digest !== sealed.digest) throw new Error("The sealed run state fails its integrity digest; a tampered run state never reaches the recovery.");
|
|
2147
|
+
const parsed = JSON.parse(sealed.payload);
|
|
2148
|
+
if (typeof parsed.runid !== "string" || typeof parsed.sessionid !== "string") throw new Error("The sealed run state carries no run record.");
|
|
2149
|
+
return parsed;
|
|
2150
|
+
}
|
|
2151
|
+
async function sha256(value) {
|
|
2152
|
+
const bytes = new TextEncoder().encode(value);
|
|
2153
|
+
const digest = await crypto.subtle.digest("SHA-256", bytes);
|
|
2154
|
+
return [...new Uint8Array(digest)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
2155
|
+
}
|
|
2156
|
+
function prunerunstates(input) {
|
|
2157
|
+
if (!Number.isFinite(input.ceiling) || input.ceiling <= 0) return { states: input.states, pruned: [], reason: "No storage ceiling is configured, so the run states stay under the user choice alone." };
|
|
2158
|
+
if (input.used <= input.ceiling) return { states: input.states, pruned: [], reason: `The run state storage sits at ${input.used} of the ${input.ceiling} bytes the user configured; no pressure exists.` };
|
|
2159
|
+
const removable = input.states.filter((state) => state.state === "completed" || state.state === "reaped").sort((one, two) => one.updatedat - two.updatedat);
|
|
2160
|
+
const states = [...input.states];
|
|
2161
|
+
const pruned = [];
|
|
2162
|
+
for (const candidate of removable) {
|
|
2163
|
+
pruned.push(candidate.runid);
|
|
2164
|
+
const index = states.findIndex((state) => state.runid === candidate.runid);
|
|
2165
|
+
if (index >= 0) states.splice(index, 1);
|
|
2166
|
+
if (pruned.length >= Math.max(1, Math.ceil(input.states.length / 2))) break;
|
|
2167
|
+
}
|
|
2168
|
+
return { states, pruned, reason: `The storage pressure at ${input.used} of ${input.ceiling} bytes pruned the ${pruned.length} oldest finished run state${pruned.length === 1 ? "" : "s"} while every active run keeps its state.` };
|
|
2169
|
+
}
|
|
2170
|
+
function exportrunstate(states, now) {
|
|
2171
|
+
return {
|
|
2172
|
+
runs: states.length,
|
|
2173
|
+
urls: states.reduce((total, state) => total + state.urlhistory.length, 0),
|
|
2174
|
+
environments: states.reduce((total, state) => total + Object.keys(state.environments).length, 0),
|
|
2175
|
+
offloaded: states.reduce((total, state) => total + Object.values(state.turnarounds).length, 0),
|
|
2176
|
+
beats: states.reduce((total, state) => total + state.keepalive.beats, 0),
|
|
2177
|
+
exportedat: now
|
|
2178
|
+
};
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2017
2181
|
// memory.ts
|
|
2018
2182
|
var sessionmemory = class {
|
|
2019
2183
|
constructor(adapter) {
|
|
@@ -4358,6 +4522,121 @@ var sessionmemory = class {
|
|
|
4358
4522
|
async getswarmcosts() {
|
|
4359
4523
|
return await this.adapter.get("swarmcosts") ?? [];
|
|
4360
4524
|
}
|
|
4525
|
+
/**
|
|
4526
|
+
* Execution environment persistence of the 1.1.60 family.
|
|
4527
|
+
* The run state store seals every persisted run state with its sha-256 integrity digest through the storage api (the browser offers no at-rest encryption for its storage areas, so the honest derivation is the integrity seal that makes tampering detectable before any recovery uses the record), scopes every run state per profile so parallel profiles never share it, expires stale run state past the user configured window while the keepalive summaries survive, tracks the storage quota usage of the run state and prunes the oldest finished run states under pressure.
|
|
4528
|
+
* The adapter seam keeps every accessor a one line storage delegation so a future worker state backend replaces the adapter only.
|
|
4529
|
+
*/
|
|
4530
|
+
/** Returns the environment grant list of the active session; an absent list keeps the documented default posture. */
|
|
4531
|
+
async getenvironmentgrants() {
|
|
4532
|
+
return (await this.getsession())?.environmentgrants;
|
|
4533
|
+
}
|
|
4534
|
+
/** Replaces the environment grant list of the active session so the environment grants join the origin grants in the session record. */
|
|
4535
|
+
async setenvironmentgrants(grants) {
|
|
4536
|
+
const session = await this.getsession();
|
|
4537
|
+
if (!session) throw new Error("The environment grants need an active session to join.");
|
|
4538
|
+
await this.setsession({ ...session, environmentgrants: grants });
|
|
4539
|
+
}
|
|
4540
|
+
/** Seals and stores the run state of one profile: the payload travels beside its sha-256 digest so a tampered record at rest stays detectable before any recovery uses it. */
|
|
4541
|
+
async setrunstate(profileid, state) {
|
|
4542
|
+
const sealed = await sealrunstate(state);
|
|
4543
|
+
const index = await this.adapter.get("runstateindex") ?? [];
|
|
4544
|
+
await this.adapter.set(`runstate:${profileid}`, sealed);
|
|
4545
|
+
if (!index.includes(profileid)) await this.adapter.set("runstateindex", [...index, profileid]);
|
|
4546
|
+
}
|
|
4547
|
+
/** Opens the sealed run state of one profile; a missing or tampered seal returns undefined so the recovery never trusts a broken record. */
|
|
4548
|
+
async getrunstate(profileid) {
|
|
4549
|
+
const sealed = await this.adapter.get(`runstate:${profileid}`);
|
|
4550
|
+
if (!sealed) return void 0;
|
|
4551
|
+
try {
|
|
4552
|
+
return await openseal(sealed);
|
|
4553
|
+
} catch {
|
|
4554
|
+
return void 0;
|
|
4555
|
+
}
|
|
4556
|
+
}
|
|
4557
|
+
/** Removes the run state of one profile from the store and the index: the per profile key takes an empty seal that never opens, so the quota pruning drops the pruned records whole. */
|
|
4558
|
+
async removerunstate(profileid) {
|
|
4559
|
+
const index = await this.adapter.get("runstateindex") ?? [];
|
|
4560
|
+
await this.adapter.set("runstateindex", index.filter((entry) => entry !== profileid));
|
|
4561
|
+
await this.adapter.set(`runstate:${profileid}`, { payload: "", algorithm: "sha-256", digest: "", sealedat: 0 });
|
|
4562
|
+
}
|
|
4563
|
+
/** Lists the stored run state records of every profile, oldest update first. */
|
|
4564
|
+
async listrunstates() {
|
|
4565
|
+
const index = await this.adapter.get("runstateindex") ?? [];
|
|
4566
|
+
const states = [];
|
|
4567
|
+
for (const profileid of index) {
|
|
4568
|
+
const state = await this.getrunstate(profileid);
|
|
4569
|
+
if (state) states.push(state);
|
|
4570
|
+
}
|
|
4571
|
+
return states.sort((one, two) => one.updatedat - two.updatedat);
|
|
4572
|
+
}
|
|
4573
|
+
/** Expires the stale run states past the user configured window: the expired records reduce to their keepalive summaries while an absent window keeps every run state whole. */
|
|
4574
|
+
async expirerunstates(window, now) {
|
|
4575
|
+
if (window === void 0) return await this.listrunstates();
|
|
4576
|
+
const index = await this.adapter.get("runstateindex") ?? [];
|
|
4577
|
+
const kept = [];
|
|
4578
|
+
for (const profileid of index) {
|
|
4579
|
+
const state = await this.getrunstate(profileid);
|
|
4580
|
+
if (!state) continue;
|
|
4581
|
+
if (now - state.updatedat > window && state.keepalive.state === "stopped") {
|
|
4582
|
+
const summary = { runid: state.runid, sessionid: state.sessionid, planid: state.planid, profileid: state.profileid, state: "expired", urlhistory: [], environments: {}, turnarounds: {}, keepalive: state.keepalive, updatedat: now };
|
|
4583
|
+
const sealed = await sealrunstate(summary);
|
|
4584
|
+
await this.adapter.set(`runstate:${profileid}`, sealed);
|
|
4585
|
+
} else {
|
|
4586
|
+
kept.push(state);
|
|
4587
|
+
}
|
|
4588
|
+
}
|
|
4589
|
+
return kept;
|
|
4590
|
+
}
|
|
4591
|
+
/** Records one worker spawn or teardown event with its provenance beside the step outcomes. */
|
|
4592
|
+
async addworkerevent(event) {
|
|
4593
|
+
await this.adapter.set("workerevents", [event, ...await this.adapter.get("workerevents") ?? []].slice(0, 500));
|
|
4594
|
+
}
|
|
4595
|
+
/** Returns the recorded worker spawn and teardown events, newest first. */
|
|
4596
|
+
async getworkerevents() {
|
|
4597
|
+
return await this.adapter.get("workerevents") ?? [];
|
|
4598
|
+
}
|
|
4599
|
+
/** Records one spawned offscreen document with its reasons and justification in the registry. */
|
|
4600
|
+
async addoffscreenentry(entry) {
|
|
4601
|
+
await this.adapter.set("offscreenregistry", [entry, ...await this.adapter.get("offscreenregistry") ?? []]);
|
|
4602
|
+
}
|
|
4603
|
+
/** Replaces one registry entry after its offscreen document closes. */
|
|
4604
|
+
async updateoffscreenentry(entry) {
|
|
4605
|
+
await this.adapter.set("offscreenregistry", (await this.adapter.get("offscreenregistry") ?? []).map((candidate) => candidate.runid === entry.runid ? entry : candidate));
|
|
4606
|
+
}
|
|
4607
|
+
/** Returns the offscreen document registry with the reasons and justification of every spawn. */
|
|
4608
|
+
async getoffscreenentries() {
|
|
4609
|
+
return await this.adapter.get("offscreenregistry") ?? [];
|
|
4610
|
+
}
|
|
4611
|
+
/** Records one sandbox render with its provenance, source origin and nonce. */
|
|
4612
|
+
async addsandboxrender(render) {
|
|
4613
|
+
await this.adapter.set("sandboxrenders", [render, ...await this.adapter.get("sandboxrenders") ?? []].slice(0, 500));
|
|
4614
|
+
}
|
|
4615
|
+
/** Returns the recorded sandbox renders with their provenance, newest first. */
|
|
4616
|
+
async getsandboxrenders() {
|
|
4617
|
+
return await this.adapter.get("sandboxrenders") ?? [];
|
|
4618
|
+
}
|
|
4619
|
+
/** Replaces the stored run locks after one acquisition, release or expiry sweep. */
|
|
4620
|
+
async setrunlocks(locks) {
|
|
4621
|
+
return this.adapter.set("runlocks", locks);
|
|
4622
|
+
}
|
|
4623
|
+
/** Returns the held run locks with their sessions, runs and expiries. */
|
|
4624
|
+
async getrunlocks() {
|
|
4625
|
+
return await this.adapter.get("runlocks") ?? [];
|
|
4626
|
+
}
|
|
4627
|
+
/** Tracks the storage quota usage of the run state: the last measured bytes stay beside the user configured ceiling so the pruning reads both. */
|
|
4628
|
+
async trackrunstatequota(used) {
|
|
4629
|
+
const settings = await this.getsettings();
|
|
4630
|
+
await this.adapter.set("runstatequota", { used, ...settings?.runstatebytes !== void 0 ? { ceiling: settings.runstatebytes } : {}, trackedat: Date.now() });
|
|
4631
|
+
}
|
|
4632
|
+
/** Returns the last tracked storage quota usage of the run state with its ceiling when the user configured one. */
|
|
4633
|
+
async getrunstatequota() {
|
|
4634
|
+
return this.adapter.get("runstatequota");
|
|
4635
|
+
}
|
|
4636
|
+
/** Exports every stored run state as one single audit record through the runstate export envelope. */
|
|
4637
|
+
async exportrunstates() {
|
|
4638
|
+
return exportrunstate(await this.listrunstates(), Date.now());
|
|
4639
|
+
}
|
|
4361
4640
|
};
|
|
4362
4641
|
function mediakindof(record2) {
|
|
4363
4642
|
if ("pages" in record2) return "pdf";
|
|
@@ -5147,6 +5426,133 @@ function replayagentrun(input) {
|
|
|
5147
5426
|
return interleavetimeline(input.events.filter((event) => event.agentid === input.agentid).map((event) => ({ id: event.id, kind: event.kind, summary: event.summary, at: event.at, ...event.agentid !== void 0 ? { agentid: event.agentid } : {} })));
|
|
5148
5427
|
}
|
|
5149
5428
|
|
|
5429
|
+
// environments.ts
|
|
5430
|
+
var offloadfamilies = [
|
|
5431
|
+
{ task: "htmlsnapshot", kinds: ["readhtml", "parsehtml", "readertree", "readoutline", "classifypage"] },
|
|
5432
|
+
{ task: "jsonpayload", kinds: ["readjson", "parsejson"] },
|
|
5433
|
+
{ task: "tablerows", kinds: ["readtable", "scrapetable", "detecttables", "deduperows", "transformvalues"] },
|
|
5434
|
+
{ task: "a11ytree", kinds: ["a11ytree"] },
|
|
5435
|
+
{ task: "complexselector", kinds: ["resolvexpath", "deriveselector", "detectvirtual"] },
|
|
5436
|
+
{ task: "stitchshots", kinds: ["contactsheet", "timelapse", "makethumbs"] }
|
|
5437
|
+
];
|
|
5438
|
+
function offfamilyof(kind) {
|
|
5439
|
+
return offloadfamilies.find((family) => family.kinds.includes(kind))?.task;
|
|
5440
|
+
}
|
|
5441
|
+
function environmentsof(step) {
|
|
5442
|
+
if (markuprenderstep(step)) return ["sandboxframe"];
|
|
5443
|
+
if (step.kind === "evaluate") return ["isolatedworld"];
|
|
5444
|
+
if (offfamilyof(step.kind) !== void 0) return ["pagecontext", "offscreenworker"];
|
|
5445
|
+
return ["pagecontext"];
|
|
5446
|
+
}
|
|
5447
|
+
function defaultenvironment(step) {
|
|
5448
|
+
if (markuprenderstep(step)) return "sandboxframe";
|
|
5449
|
+
if (step.kind === "evaluate") return "isolatedworld";
|
|
5450
|
+
return "pagecontext";
|
|
5451
|
+
}
|
|
5452
|
+
function offamilyeligible(kind) {
|
|
5453
|
+
return offloadfamilies.some((family) => family.kinds.includes(kind));
|
|
5454
|
+
}
|
|
5455
|
+
function offloadkinds() {
|
|
5456
|
+
return offloadfamilies.map((family) => ({ task: family.task, kinds: [...family.kinds] }));
|
|
5457
|
+
}
|
|
5458
|
+
function markuprenderstep(step) {
|
|
5459
|
+
if (!step.options) return false;
|
|
5460
|
+
try {
|
|
5461
|
+
const parsed = JSON.parse(step.options);
|
|
5462
|
+
return Boolean(parsed && typeof parsed === "object" && !Array.isArray(parsed) && typeof parsed.markup === "string" && parsed.markup.trim() !== "");
|
|
5463
|
+
} catch {
|
|
5464
|
+
return false;
|
|
5465
|
+
}
|
|
5466
|
+
}
|
|
5467
|
+
function environmentrequirementsof(kinds) {
|
|
5468
|
+
return kinds.map((kind) => {
|
|
5469
|
+
const bare = { kind };
|
|
5470
|
+
const environments = environmentsof(bare);
|
|
5471
|
+
return { kind, environments, defaultenvironment: defaultenvironment(bare) };
|
|
5472
|
+
});
|
|
5473
|
+
}
|
|
5474
|
+
function executorregistry() {
|
|
5475
|
+
return [
|
|
5476
|
+
{ environment: "pagecontext", adapter: "pagebridge", description: "The page bridge executes dom actions inside the live page because page events only fire there." },
|
|
5477
|
+
{ environment: "isolatedworld", adapter: "scriptingapi", description: "The scripting api injects step logic inside the isolated world where page globals stay unreachable from step code." },
|
|
5478
|
+
{ environment: "offscreenworker", adapter: "offscreendocument", description: "The offscreen document hosts the worker pool that parses heavy payloads away from the page; the capability gate keeps it behind the optional offscreen grant with an inline fallback." },
|
|
5479
|
+
{ environment: "sandboxframe", adapter: "sandboxpage", description: "The sandboxed page renders untrusted markup with scripts and handlers stripped before render and posts its result back through a per render nonce." }
|
|
5480
|
+
];
|
|
5481
|
+
}
|
|
5482
|
+
function routeenvironment(step, input) {
|
|
5483
|
+
const allowed = environmentsof(step);
|
|
5484
|
+
const named = step.environment;
|
|
5485
|
+
if (named !== void 0) {
|
|
5486
|
+
if (!allowed.includes(named)) return { environment: defaultenvironment(step), fallback: false, reason: `The ${named} environment sits outside the ${allowed.join(", ")} the ${step.kind} kind permits, so the executor routes to the ${defaultenvironment(step)} default.` };
|
|
5487
|
+
return { environment: named, fallback: false, reason: `The reviewed step names its ${named} environment and the ${step.kind} kind permits it.` };
|
|
5488
|
+
}
|
|
5489
|
+
if (markuprenderstep(step)) return { environment: "sandboxframe", fallback: false, reason: `The ${step.kind} step carries untrusted markup, so it renders inside the sandboxframe only.` };
|
|
5490
|
+
if (step.kind === "evaluate") return { environment: "isolatedworld", fallback: false, reason: "The evaluate kind runs inside the isolated world where page globals stay unreachable from step code." };
|
|
5491
|
+
if (offamilyeligible(step.kind)) {
|
|
5492
|
+
if (!input.offload) return { environment: "pagecontext", fallback: false, reason: `The ${step.kind} step stays inside the page because the user keeps the parse offload off.` };
|
|
5493
|
+
if (!input.granted) return { environment: "pagecontext", fallback: true, reason: `The ${step.kind} step falls back to inline parsing inside the page because the offscreen capability grant stays absent.` };
|
|
5494
|
+
return { environment: "offscreenworker", fallback: false, reason: `The ${step.kind} step offloads into the offscreen worker pool under the granted capability.` };
|
|
5495
|
+
}
|
|
5496
|
+
return { environment: "pagecontext", fallback: false, reason: `The ${step.kind} step keeps the pagecontext because page events only fire inside the live page.` };
|
|
5497
|
+
}
|
|
5498
|
+
function workerrequestof(input) {
|
|
5499
|
+
const task = offfamilyof(input.kind);
|
|
5500
|
+
if (task === void 0) throw new Error(`The ${input.kind} kind stays outside the offscreen worker pool families.`);
|
|
5501
|
+
if (input.payload.trim() === "") throw new Error("The worker request needs its payload reference.");
|
|
5502
|
+
return { id: input.id, runid: input.runid, stepid: input.stepid, task, payload: input.payload, transferables: transferablekeys(input.options ?? {}), sentat: input.sentat };
|
|
5503
|
+
}
|
|
5504
|
+
function transferablekeys(options) {
|
|
5505
|
+
return Object.keys(options).filter((key) => options[key] instanceof ArrayBuffer);
|
|
5506
|
+
}
|
|
5507
|
+
function workerresponseof(input) {
|
|
5508
|
+
if (input.summary.trim() === "") throw new Error("The worker answer needs its summary in plain language.");
|
|
5509
|
+
return { id: input.id, requestid: input.requestid, ok: input.ok, ...input.result !== void 0 ? { result: input.result } : {}, ...input.partial !== void 0 ? { partial: input.partial } : {}, summary: input.summary, receivedat: input.receivedat };
|
|
5510
|
+
}
|
|
5511
|
+
function acceptworkerresponse(response) {
|
|
5512
|
+
if (!response.ok) return { done: true, partial: false, reason: `The worker refused the request ${response.requestid}: ${response.summary}` };
|
|
5513
|
+
if (response.partial !== void 0) return { done: false, partial: true, reason: `The partial ${response.partial} of the request ${response.requestid} streams back to the executor.` };
|
|
5514
|
+
return { done: true, partial: false, ...response.result !== void 0 ? { result: response.result } : {}, reason: `The request ${response.requestid} completed inside the offscreen worker pool.` };
|
|
5515
|
+
}
|
|
5516
|
+
function poolplan(input) {
|
|
5517
|
+
if (input.size !== void 0) {
|
|
5518
|
+
if (!Number.isFinite(input.size) || input.size < 1 || !Number.isInteger(input.size)) return { workers: input.current, added: 0, retired: 0, reason: "The configured pool size stays a positive whole number the user chose; the pool keeps its current workers." };
|
|
5519
|
+
const target = input.size;
|
|
5520
|
+
if (target > input.current) return { workers: target, added: target - input.current, retired: 0, reason: `The user configured pool size ${target} adds ${target - input.current} worker${target - input.current === 1 ? "" : "s"} to the pool.` };
|
|
5521
|
+
if (target < input.current) return { workers: target, added: 0, retired: input.current - target, reason: `The user configured pool size ${target} retires ${input.current - target} worker${input.current - target === 1 ? "" : "s"} from the pool.` };
|
|
5522
|
+
return { workers: target, added: 0, retired: 0, reason: `The pool holds the ${target} workers the user configured.` };
|
|
5523
|
+
}
|
|
5524
|
+
if (input.pending > input.current) return { workers: input.pending, added: input.pending - input.current, retired: 0, reason: `The ${input.pending} pending parses grow the pool by ${input.pending - input.current} worker${input.pending - input.current === 1 ? "" : "s"}; no engine cap exists.` };
|
|
5525
|
+
if (input.current > input.pending) return { workers: input.pending, added: 0, retired: input.current - input.pending, reason: `The ${input.current - input.pending} idle worker${input.current - input.pending === 1 ? "" : "s"} retire down to the ${input.pending} pending parse${input.pending === 1 ? "" : "s"}.` };
|
|
5526
|
+
return { workers: input.current, added: 0, retired: 0, reason: `The ${input.current} workers match the ${input.pending} pending parses; the pool stays unchanged.` };
|
|
5527
|
+
}
|
|
5528
|
+
function openoffscreen(input) {
|
|
5529
|
+
if (input.document.trim() === "") throw new Error("The offscreen document needs its user configured path.");
|
|
5530
|
+
if (input.reasons.length === 0) throw new Error("The offscreen document needs the reasons the user reviewed.");
|
|
5531
|
+
if (input.justification.trim() === "") throw new Error("The offscreen document needs its justification in plain language.");
|
|
5532
|
+
const open = input.registry.find((entry2) => entry2.runid === input.runid && entry2.closedat === void 0);
|
|
5533
|
+
if (open) return { registry: input.registry, entry: open, reused: true };
|
|
5534
|
+
const entry = { document: input.document, runid: input.runid, reasons: [...input.reasons], justification: input.justification, createdat: input.now };
|
|
5535
|
+
return { registry: [entry, ...input.registry], entry, reused: false };
|
|
5536
|
+
}
|
|
5537
|
+
function closeoffscreen(registry, runid, now) {
|
|
5538
|
+
const open = registry.find((entry) => entry.runid === runid && entry.closedat === void 0);
|
|
5539
|
+
if (!open) return { registry, closed: false };
|
|
5540
|
+
return { registry: registry.map((entry) => entry === open ? { ...entry, closedat: now } : entry), closed: true };
|
|
5541
|
+
}
|
|
5542
|
+
function isolatedinjection(step) {
|
|
5543
|
+
if (step.kind !== "evaluate") throw new Error("The isolated world injection serves the evaluate kind only.");
|
|
5544
|
+
if (!step.value || step.value.trim() === "") throw new Error("The evaluate step needs its reviewed expression.");
|
|
5545
|
+
let args = [];
|
|
5546
|
+
if (step.options) {
|
|
5547
|
+
try {
|
|
5548
|
+
const parsed = JSON.parse(step.options);
|
|
5549
|
+
if (Array.isArray(parsed)) args = parsed.filter((item) => typeof item === "string");
|
|
5550
|
+
} catch {
|
|
5551
|
+
}
|
|
5552
|
+
}
|
|
5553
|
+
return { world: "ISOLATED", code: step.value, args };
|
|
5554
|
+
}
|
|
5555
|
+
|
|
5150
5556
|
// httpclient.ts
|
|
5151
5557
|
var httpkinds = ["fetchurl", "parsejson", "parsehtml", "callrest", "callgraphql"];
|
|
5152
5558
|
var redirectstatuses = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
|
|
@@ -9769,6 +10175,48 @@ function blackboardconsentgrade(entry) {
|
|
|
9769
10175
|
if (entry.consentclass === "sensitive") return { allowed: true, reason: `The blackboard entry ${entry.key} inherits the sensitive class of its source extraction; every agent reads the class beside the value.` };
|
|
9770
10176
|
return { allowed: true, reason: `The blackboard entry ${entry.key} inherits the ${entry.consentclass} class of its source extraction; every agent reads the class beside the value.` };
|
|
9771
10177
|
}
|
|
10178
|
+
function stepenvironmentvalid(step) {
|
|
10179
|
+
if (step.environment !== void 0 && step.environment !== "pagecontext" && step.environment !== "isolatedworld" && step.environment !== "offscreenworker" && step.environment !== "sandboxframe") return { allowed: false, reason: "The step environment stays one of pagecontext, isolatedworld, offscreenworker and sandboxframe." };
|
|
10180
|
+
const allowed = environmentsof(step);
|
|
10181
|
+
if (step.environment !== void 0 && !allowed.includes(step.environment)) return { allowed: false, reason: `The ${step.environment} environment sits outside the ${allowed.join(", ")} the ${step.kind} kind permits; the review sees the environment of every step.` };
|
|
10182
|
+
return { allowed: true, reason: step.environment === void 0 ? `The ${step.kind} step carries no environment field and routes to its ${defaultenvironment(step)} default.` : `The ${step.environment} environment of the ${step.kind} step sits inside the ${allowed.join(", ")} the kind permits.` };
|
|
10183
|
+
}
|
|
10184
|
+
function environmentgrantgate(step, grants) {
|
|
10185
|
+
if (grants === void 0 || grants.length === 0) return { allowed: true, reason: `The session carries no environment grant list, so the ${defaultenvironment(step)} default of the ${step.kind} step stays the documented posture behind the same review.` };
|
|
10186
|
+
const environment = step.environment ?? defaultenvironment(step);
|
|
10187
|
+
if (!grants.includes(environment)) return { allowed: false, reason: `The ${environment} environment sits outside the ${grants.join(", ")} the session granted; no step ever widens the environment grants.` };
|
|
10188
|
+
return { allowed: true, reason: `The ${environment} environment of the ${step.kind} step sits inside the ${grants.join(", ")} the session granted.` };
|
|
10189
|
+
}
|
|
10190
|
+
function offscreencapabilitygate(input) {
|
|
10191
|
+
if (input.environment !== "offscreenworker") return { allowed: true, reason: `The ${input.environment} environment needs no offscreen capability grant.` };
|
|
10192
|
+
if (!input.granted) return { allowed: false, reason: "The offscreen worker pool runs only under the user granted offscreen capability; the step falls back to inline parsing inside the page." };
|
|
10193
|
+
return { allowed: true, reason: "The offscreen worker pool runs under the user granted offscreen capability." };
|
|
10194
|
+
}
|
|
10195
|
+
function keepalivegate(input) {
|
|
10196
|
+
if (!input.session) return { allowed: false, reason: "The keepalive port opens only inside an active session." };
|
|
10197
|
+
if (input.session.stoppedat !== void 0) return { allowed: false, reason: "The keepalive port stays closed for a stopped session." };
|
|
10198
|
+
if (input.session.pausedat !== void 0) return { allowed: false, reason: "The keepalive port stays closed while the session pauses; a resumed run reattaches it." };
|
|
10199
|
+
if (input.now > input.session.expiresat) return { allowed: false, reason: "The keepalive port stays closed for an expired session." };
|
|
10200
|
+
if (!input.plan || input.plan.state !== "approved") return { allowed: false, reason: "The keepalive port opens only behind an active reviewed plan; unreviewed work never holds the service worker alive." };
|
|
10201
|
+
return { allowed: true, reason: `The approved plan ${input.plan.id} of the active session holds the keepalive port open for its whole run.` };
|
|
10202
|
+
}
|
|
10203
|
+
function keepaliveintervalvalid(interval) {
|
|
10204
|
+
if (!Number.isFinite(interval) || interval <= 0) return { allowed: false, reason: "The keepalive heartbeat interval stays a positive user value in milliseconds." };
|
|
10205
|
+
return { allowed: true, reason: `The keepalive heartbeat interval ${interval} milliseconds stays the user configured value; the roadmap documents thirty seconds while the choice stays the user's.` };
|
|
10206
|
+
}
|
|
10207
|
+
function workerpoolsizevalid(size) {
|
|
10208
|
+
if (size === void 0) return { allowed: true, reason: "No worker pool size is configured, so the pool follows the pending parse queue alone with no engine cap." };
|
|
10209
|
+
if (!Number.isInteger(size) || size < 1) return { allowed: false, reason: "The worker pool size stays a positive whole number the user configured; no engine cap exists." };
|
|
10210
|
+
return { allowed: true, reason: `The worker pool size ${size} stays the user configured value; no engine cap exists.` };
|
|
10211
|
+
}
|
|
10212
|
+
function sandboxorigingate(input) {
|
|
10213
|
+
if (input.origin.trim() === "") return { allowed: false, reason: "The sandbox render needs the source origin of its untrusted markup." };
|
|
10214
|
+
if (input.allowed.length > 0 && !input.allowed.includes(input.origin)) return { allowed: false, reason: `The origin ${input.origin} sits outside the origins the user allows to render untrusted markup: ${input.allowed.join(", ")}.` };
|
|
10215
|
+
return { allowed: true, reason: input.allowed.length === 0 ? `The origin ${input.origin} renders untrusted markup under the documented open origin list the user chose not to narrow.` : `The origin ${input.origin} sits inside the origins the user allows to render untrusted markup.` };
|
|
10216
|
+
}
|
|
10217
|
+
function environmentrequirements() {
|
|
10218
|
+
return environmentrequirementsof([...allowedactions]);
|
|
10219
|
+
}
|
|
9772
10220
|
|
|
9773
10221
|
// llm.ts
|
|
9774
10222
|
var defaultrefusalmarkers = ["i cannot", "i can't", "i'm unable", "refusal:", "cannot comply"];
|
|
@@ -10129,7 +10577,7 @@ function budgetcheck(input) {
|
|
|
10129
10577
|
}
|
|
10130
10578
|
|
|
10131
10579
|
// version.ts
|
|
10132
|
-
var packageversion = "1.1.
|
|
10580
|
+
var packageversion = "1.1.60";
|
|
10133
10581
|
|
|
10134
10582
|
// types.ts
|
|
10135
10583
|
var protocolversion = packageversion;
|
|
@@ -10980,6 +11428,44 @@ function removetemplate(templates, name) {
|
|
|
10980
11428
|
return templates.filter((template) => template.name !== name);
|
|
10981
11429
|
}
|
|
10982
11430
|
|
|
11431
|
+
// sandboxframe.ts
|
|
11432
|
+
function stripscripts(markup) {
|
|
11433
|
+
return markup.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, "").replace(/<script\b[^>]*\/>/gi, "").replace(/\son[a-z]+\s*=\s*"[^"]*"/gi, "").replace(/\son[a-z]+\s*=\s*'[^']*'/gi, "").replace(/\son[a-z]+\s*=\s*[^\s>]+/gi, "").replace(/javascript:/gi, "").trim();
|
|
11434
|
+
}
|
|
11435
|
+
function nonceof(seed) {
|
|
11436
|
+
const alphabet = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
11437
|
+
let hash = 0;
|
|
11438
|
+
for (let index = 0; index < seed.length; index += 1) hash = hash * 31 + seed.charCodeAt(index) >>> 0;
|
|
11439
|
+
let nonce = "";
|
|
11440
|
+
let state = hash === 0 ? 2654435769 : hash;
|
|
11441
|
+
for (let index = 0; index < 16; index += 1) {
|
|
11442
|
+
state = state * 1664525 + 1013904223 >>> 0;
|
|
11443
|
+
nonce += alphabet[state % alphabet.length];
|
|
11444
|
+
}
|
|
11445
|
+
return nonce;
|
|
11446
|
+
}
|
|
11447
|
+
function sandboxrenderof(input) {
|
|
11448
|
+
if (input.markup.trim() === "") throw new Error("The sandbox render needs its untrusted markup.");
|
|
11449
|
+
if (input.sourceorigin.trim() === "") throw new Error("The sandbox render needs the source origin of its untrusted markup.");
|
|
11450
|
+
if (input.stepid.trim() === "") throw new Error("The sandbox render names the reviewed step it renders for.");
|
|
11451
|
+
return { id: input.id, nonce: nonceof(`${input.id}:${input.now}`), markup: stripscripts(input.markup), sourceorigin: input.sourceorigin, stepid: input.stepid, renderedat: input.now };
|
|
11452
|
+
}
|
|
11453
|
+
function rendermessage(render) {
|
|
11454
|
+
return { channel: "devthinksandbox", type: "render", nonce: render.nonce, markup: render.markup };
|
|
11455
|
+
}
|
|
11456
|
+
function acceptrenderresult(input) {
|
|
11457
|
+
if (input.message.channel !== "devthinksandbox") return { accepted: false, reason: "The sandbox message travels the devthinksandbox channel only." };
|
|
11458
|
+
if (input.message.type !== "renderresult") return { accepted: false, reason: "The sandbox message answers with the renderresult type only." };
|
|
11459
|
+
const render = input.renders.find((entry) => entry.nonce === input.message.nonce && entry.renderedat <= input.now);
|
|
11460
|
+
if (!render) return { accepted: false, reason: "The sandbox message carries no nonce of a known render; a stale or replayed message never passes." };
|
|
11461
|
+
const text2 = (input.message.text ?? "").replace(/<[^>]*>/g, "");
|
|
11462
|
+
const result = { nonce: render.nonce, ok: input.message.ok !== false, text: text2, summary: input.message.summary?.trim() || `The sandbox frame rendered the markup of the step ${render.stepid} and returned its inert text.`, at: input.now };
|
|
11463
|
+
return { accepted: true, result, reason: `The render result of the step ${render.stepid} answers the nonce of its render; the text stays inside the frame.` };
|
|
11464
|
+
}
|
|
11465
|
+
function renderprovenance(render) {
|
|
11466
|
+
return { origin: render.sourceorigin, stepid: render.stepid, environment: "sandboxframe" };
|
|
11467
|
+
}
|
|
11468
|
+
|
|
10983
11469
|
// taskqueue.ts
|
|
10984
11470
|
function emptyqueue(input = {}) {
|
|
10985
11471
|
return { lanes: input.lanes ?? [], priorities: input.priorities ?? [], completionpolicy: input.completionpolicy ?? "all", items: [], claims: [] };
|
|
@@ -11852,6 +12338,28 @@ function reviewframe(input) {
|
|
|
11852
12338
|
}
|
|
11853
12339
|
};
|
|
11854
12340
|
}
|
|
12341
|
+
function environmentgrammar() {
|
|
12342
|
+
return {
|
|
12343
|
+
version: protocolversion,
|
|
12344
|
+
kinds: environmentrequirements(),
|
|
12345
|
+
notes: [
|
|
12346
|
+
"The evaluate kind runs inside the isolated world only where page globals stay unreachable from step code.",
|
|
12347
|
+
"A step whose reviewed options carry untrusted markup renders inside the sandboxframe only, with scripts and event handlers stripped before the render.",
|
|
12348
|
+
"The parse heavy read kinds offload into the offscreen worker pool only under the user granted offscreen capability and the parse offload toggle, with an inline fallback inside the page.",
|
|
12349
|
+
"Every environment executes only reviewed steps against granted origins; the session environment grant list narrows the steps of one session and no environment ever bypasses the human review."
|
|
12350
|
+
]
|
|
12351
|
+
};
|
|
12352
|
+
}
|
|
12353
|
+
function environmentreport(input) {
|
|
12354
|
+
return {
|
|
12355
|
+
version: protocolversion,
|
|
12356
|
+
environments: Object.entries(input.environments).map(([stepid, environment]) => ({ stepid, environment })),
|
|
12357
|
+
turnarounds: Object.entries(input.turnarounds ?? {}).map(([stepid, milliseconds]) => ({ stepid, milliseconds })),
|
|
12358
|
+
offscreen: input.offscreen ?? [],
|
|
12359
|
+
workers: input.workers ?? 0,
|
|
12360
|
+
...input.keepalive !== void 0 ? { keepalive: input.keepalive } : {}
|
|
12361
|
+
};
|
|
12362
|
+
}
|
|
11855
12363
|
|
|
11856
12364
|
// workfloweditor.ts
|
|
11857
12365
|
var palettecategories = ["actions", "controlflow", "waits", "variables", "triggers"];
|
|
@@ -12557,8 +13065,11 @@ function yamlscalarvalue(text2) {
|
|
|
12557
13065
|
return text2;
|
|
12558
13066
|
}
|
|
12559
13067
|
export {
|
|
13068
|
+
acceptrenderresult,
|
|
13069
|
+
acceptworkerresponse,
|
|
12560
13070
|
ackreview,
|
|
12561
13071
|
acquirelock,
|
|
13072
|
+
acquirerunlock,
|
|
12562
13073
|
activelayers,
|
|
12563
13074
|
addedge,
|
|
12564
13075
|
addnode,
|
|
@@ -12607,6 +13118,7 @@ export {
|
|
|
12607
13118
|
autointervalof,
|
|
12608
13119
|
backoffdelay,
|
|
12609
13120
|
batchreport,
|
|
13121
|
+
beatrun,
|
|
12610
13122
|
bindlocalhost,
|
|
12611
13123
|
bindparam,
|
|
12612
13124
|
bindvariables,
|
|
@@ -12683,6 +13195,8 @@ export {
|
|
|
12683
13195
|
classifyintent,
|
|
12684
13196
|
closechannel,
|
|
12685
13197
|
closeidlechannels,
|
|
13198
|
+
closeoffscreen,
|
|
13199
|
+
closerun,
|
|
12686
13200
|
collectmessages,
|
|
12687
13201
|
collectresults,
|
|
12688
13202
|
commandguard,
|
|
@@ -12724,6 +13238,7 @@ export {
|
|
|
12724
13238
|
dedupeimages,
|
|
12725
13239
|
defaultapprovalwindowms,
|
|
12726
13240
|
defaultchallengelifetimems,
|
|
13241
|
+
defaultenvironment,
|
|
12727
13242
|
defaultheartbeatms,
|
|
12728
13243
|
defaulthttpstream,
|
|
12729
13244
|
defaultidlewindowms,
|
|
@@ -12769,6 +13284,12 @@ export {
|
|
|
12769
13284
|
enqueue,
|
|
12770
13285
|
enqueuerequest,
|
|
12771
13286
|
entryfresh,
|
|
13287
|
+
environmentgrammar,
|
|
13288
|
+
environmentgrantgate,
|
|
13289
|
+
environmentreport,
|
|
13290
|
+
environmentrequirements,
|
|
13291
|
+
environmentrequirementsof,
|
|
13292
|
+
environmentsof,
|
|
12772
13293
|
errorcapture,
|
|
12773
13294
|
errorreportresponse,
|
|
12774
13295
|
escalate,
|
|
@@ -12778,16 +13299,19 @@ export {
|
|
|
12778
13299
|
eventresponse,
|
|
12779
13300
|
eventrulematches,
|
|
12780
13301
|
exchangesreport,
|
|
13302
|
+
executorregistry,
|
|
12781
13303
|
expandblocks,
|
|
12782
13304
|
expandtemplate,
|
|
12783
13305
|
expireapprovals,
|
|
12784
13306
|
expirelayers,
|
|
12785
13307
|
expirelocks,
|
|
12786
13308
|
expireprofilerecords,
|
|
13309
|
+
expirerunlocks,
|
|
12787
13310
|
expiresessions,
|
|
12788
13311
|
expiretokens,
|
|
12789
13312
|
exportcontentreview,
|
|
12790
13313
|
exportpresetlibrary,
|
|
13314
|
+
exportrunstate,
|
|
12791
13315
|
exportsessionfile,
|
|
12792
13316
|
exportworkflow,
|
|
12793
13317
|
expressioneval,
|
|
@@ -12856,6 +13380,7 @@ export {
|
|
|
12856
13380
|
isformkind,
|
|
12857
13381
|
islocalorigin,
|
|
12858
13382
|
isnetwatchkind,
|
|
13383
|
+
isolatedinjection,
|
|
12859
13384
|
isprofilekind,
|
|
12860
13385
|
issessionkind,
|
|
12861
13386
|
issocketkind,
|
|
@@ -12868,6 +13393,8 @@ export {
|
|
|
12868
13393
|
isworkflowkind,
|
|
12869
13394
|
joinbranches,
|
|
12870
13395
|
jsonpathrulesof,
|
|
13396
|
+
keepalivegate,
|
|
13397
|
+
keepaliveintervalvalid,
|
|
12871
13398
|
killall,
|
|
12872
13399
|
killswitchgate,
|
|
12873
13400
|
lanereport,
|
|
@@ -12899,7 +13426,9 @@ export {
|
|
|
12899
13426
|
mapresponse,
|
|
12900
13427
|
mapurlof,
|
|
12901
13428
|
markbreakpoint,
|
|
13429
|
+
markpending,
|
|
12902
13430
|
markprovider,
|
|
13431
|
+
markuprenderstep,
|
|
12903
13432
|
matchmessage,
|
|
12904
13433
|
matchurl,
|
|
12905
13434
|
matchurlpattern,
|
|
@@ -12938,13 +13467,20 @@ export {
|
|
|
12938
13467
|
newsessionrecord,
|
|
12939
13468
|
newworkflowrun,
|
|
12940
13469
|
nextrequest,
|
|
13470
|
+
nonceof,
|
|
12941
13471
|
normalizeendpoint,
|
|
12942
13472
|
oauthflowof,
|
|
12943
13473
|
observationmodeof,
|
|
12944
13474
|
observationresponse,
|
|
12945
13475
|
observeevents,
|
|
13476
|
+
offfamilyof,
|
|
13477
|
+
offloadkinds,
|
|
13478
|
+
offscreencapabilitygate,
|
|
12946
13479
|
openchannel,
|
|
12947
13480
|
openconsensus,
|
|
13481
|
+
openoffscreen,
|
|
13482
|
+
openrun,
|
|
13483
|
+
openseal,
|
|
12948
13484
|
openstreamchannel,
|
|
12949
13485
|
opentabagent,
|
|
12950
13486
|
outcomeresponse,
|
|
@@ -12994,6 +13530,7 @@ export {
|
|
|
12994
13530
|
pollcursorof,
|
|
12995
13531
|
polldecision,
|
|
12996
13532
|
pollurl,
|
|
13533
|
+
poolplan,
|
|
12997
13534
|
popscope,
|
|
12998
13535
|
postentry,
|
|
12999
13536
|
preparehandoff,
|
|
@@ -13011,6 +13548,7 @@ export {
|
|
|
13011
13548
|
providervalid,
|
|
13012
13549
|
proxygate,
|
|
13013
13550
|
proxyrouteof,
|
|
13551
|
+
prunerunstates,
|
|
13014
13552
|
publishmessage,
|
|
13015
13553
|
pushscope,
|
|
13016
13554
|
quarantinereport,
|
|
@@ -13026,12 +13564,17 @@ export {
|
|
|
13026
13564
|
readentries,
|
|
13027
13565
|
readpath,
|
|
13028
13566
|
readstream,
|
|
13567
|
+
reattachrun,
|
|
13029
13568
|
receivemessage,
|
|
13030
13569
|
receivemessages,
|
|
13031
13570
|
reconnectwaits,
|
|
13032
13571
|
recordagentusage,
|
|
13572
|
+
recordenvironment,
|
|
13033
13573
|
recordingoptionsof,
|
|
13574
|
+
recordturnaround,
|
|
13575
|
+
recordurl,
|
|
13034
13576
|
recordwatchvalue,
|
|
13577
|
+
recoveryplan,
|
|
13035
13578
|
redactconsoletext,
|
|
13036
13579
|
redactedcookies,
|
|
13037
13580
|
redactparams,
|
|
@@ -13046,10 +13589,13 @@ export {
|
|
|
13046
13589
|
rejectioncapture,
|
|
13047
13590
|
relayframe,
|
|
13048
13591
|
releaselock,
|
|
13592
|
+
releaserunlock,
|
|
13049
13593
|
removeedge,
|
|
13050
13594
|
removenode,
|
|
13051
13595
|
removetemplate,
|
|
13596
|
+
rendermessage,
|
|
13052
13597
|
renderminimap,
|
|
13598
|
+
renderprovenance,
|
|
13053
13599
|
rendertemplate,
|
|
13054
13600
|
rendertoolbriefs,
|
|
13055
13601
|
reordersteps,
|
|
@@ -13098,6 +13644,7 @@ export {
|
|
|
13098
13644
|
roledefaults,
|
|
13099
13645
|
rotatelogs,
|
|
13100
13646
|
rotationruleof,
|
|
13647
|
+
routeenvironment,
|
|
13101
13648
|
routesfor,
|
|
13102
13649
|
routevalid,
|
|
13103
13650
|
rpcerrorcodeof,
|
|
@@ -13122,6 +13669,8 @@ export {
|
|
|
13122
13669
|
runworkflow,
|
|
13123
13670
|
safetyresponse,
|
|
13124
13671
|
samplingframes,
|
|
13672
|
+
sandboxorigingate,
|
|
13673
|
+
sandboxrenderof,
|
|
13125
13674
|
savetemplate,
|
|
13126
13675
|
saveworkflow,
|
|
13127
13676
|
scaledrect,
|
|
@@ -13131,6 +13680,7 @@ export {
|
|
|
13131
13680
|
scheduleinterval,
|
|
13132
13681
|
scopecheck,
|
|
13133
13682
|
scopegate,
|
|
13683
|
+
sealrunstate,
|
|
13134
13684
|
seamweights,
|
|
13135
13685
|
searchfields,
|
|
13136
13686
|
searchqueryof,
|
|
@@ -13146,6 +13696,7 @@ export {
|
|
|
13146
13696
|
serializearg,
|
|
13147
13697
|
serializecdpcommand,
|
|
13148
13698
|
serializeframe,
|
|
13699
|
+
serializesteps,
|
|
13149
13700
|
serverbindgate,
|
|
13150
13701
|
servercapabilities,
|
|
13151
13702
|
serverenablementgate,
|
|
@@ -13182,6 +13733,7 @@ export {
|
|
|
13182
13733
|
starttls,
|
|
13183
13734
|
statusclassof,
|
|
13184
13735
|
steal,
|
|
13736
|
+
stepenvironmentvalid,
|
|
13185
13737
|
stepmodeof,
|
|
13186
13738
|
steptemplateof,
|
|
13187
13739
|
stepwindows,
|
|
@@ -13192,6 +13744,7 @@ export {
|
|
|
13192
13744
|
streamsummaries,
|
|
13193
13745
|
streamwindowof,
|
|
13194
13746
|
stripguardrails,
|
|
13747
|
+
stripscripts,
|
|
13195
13748
|
structurederrorreport,
|
|
13196
13749
|
submitreviewgranted,
|
|
13197
13750
|
subscriptionframes,
|
|
@@ -13246,6 +13799,7 @@ export {
|
|
|
13246
13799
|
tracestart,
|
|
13247
13800
|
tracetofile,
|
|
13248
13801
|
trailreport,
|
|
13802
|
+
transferablekeys,
|
|
13249
13803
|
transferhandoff,
|
|
13250
13804
|
transformgrammar,
|
|
13251
13805
|
triggereventcatalog,
|
|
@@ -13292,6 +13846,9 @@ export {
|
|
|
13292
13846
|
whileof,
|
|
13293
13847
|
wireformat,
|
|
13294
13848
|
wizardreport,
|
|
13849
|
+
workerpoolsizevalid,
|
|
13850
|
+
workerrequestof,
|
|
13851
|
+
workerresponseof,
|
|
13295
13852
|
workflowblockof,
|
|
13296
13853
|
workflowfileversion,
|
|
13297
13854
|
workflowgate,
|
|
@@ -13300,6 +13857,7 @@ export {
|
|
|
13300
13857
|
workflowreport,
|
|
13301
13858
|
workflowstepof,
|
|
13302
13859
|
workstealgrade,
|
|
13860
|
+
zombiesweep,
|
|
13303
13861
|
zoomcanvas
|
|
13304
13862
|
};
|
|
13305
13863
|
//# sourceMappingURL=index.js.map
|