mirror of
https://bitbucket.org/siakitem/my-pi.git
synced 2026-08-28 08:35:57 +00:00
feat(chrome): hand snapshots to context mode
This commit is contained in:
@@ -74,9 +74,10 @@ test("all package extensions load together without global registration conflicts
|
||||
assert.ok(packageJson.pi.extensions.includes("./pi-ask-user/index.ts"), "the bundle must load pi-ask-user");
|
||||
assert.equal(packageJson.dependencies["pi-ask-user"], "file:./pi-ask-user");
|
||||
assert.ok(packageJson.files.includes("pi-ask-user"), "the packed bundle must include pi-ask-user source");
|
||||
const chromeExtension = "./node_modules/pi-chrome/extensions/chrome-profile-bridge/index.ts";
|
||||
assert.equal(packageJson.dependencies["pi-chrome"], "0.15.46", "the browser bridge package must stay exactly pinned");
|
||||
assert.ok(packageJson.pi.extensions.includes(chromeExtension), "the bundle must load pi-chrome's Chrome profile bridge");
|
||||
const chromeExtension = "./pi-chrome/extensions/chrome-profile-bridge/index.ts";
|
||||
assert.equal(packageJson.dependencies["pi-chrome"], "file:./pi-chrome", "the browser bridge must use the locally maintained source");
|
||||
assert.ok(packageJson.files.includes("pi-chrome"), "the packed bundle must include the locally maintained pi-chrome source");
|
||||
assert.ok(packageJson.pi.extensions.includes(chromeExtension), "the bundle must load the local Chrome profile bridge directly");
|
||||
assert.ok(
|
||||
packageJson.pi.extensions.indexOf(chromeExtension) <
|
||||
packageJson.pi.extensions.indexOf("./pi-tool-search/extensions/index.ts"),
|
||||
|
||||
@@ -50,6 +50,14 @@ test("context routing analyzes large files without a full read", () => {
|
||||
assert.match(section, /host permission approval does not bypass this Context Mode boundary/);
|
||||
});
|
||||
|
||||
test("Chrome snapshot routing keeps raw page data out of model context", () => {
|
||||
const section = buildToolRoutingSection(["chrome_snapshot", "ctx_execute_file"]);
|
||||
|
||||
assert.match(section, /immediately analyze the returned workspace-relative capture path with ctx_execute_file/);
|
||||
assert.match(section, /never use read or cat for the raw JSON/);
|
||||
assert.match(section, /take a fresh snapshot after any interaction/);
|
||||
});
|
||||
|
||||
test("hashline routing uses small reads and fresh anchors for edits", () => {
|
||||
const section = buildToolRoutingSection(["read", "edit"]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user