@descryy/mcp 0.5.0 → 0.7.0
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/action-handshake.d.ts +8 -75
- package/dist/action-handshake.d.ts.map +1 -1
- package/dist/action-handshake.js +9 -79
- package/dist/action-handshake.js.map +1 -1
- package/dist/bin/descry-mcp.d.ts +4 -15
- package/dist/bin/descry-mcp.d.ts.map +1 -1
- package/dist/bin/descry-mcp.js +12 -42
- package/dist/bin/descry-mcp.js.map +1 -1
- package/dist/browser/driver.d.ts +62 -178
- package/dist/browser/driver.d.ts.map +1 -1
- package/dist/browser/driver.js +14 -46
- package/dist/browser/driver.js.map +1 -1
- package/dist/browser/evidence.d.ts +11 -35
- package/dist/browser/evidence.d.ts.map +1 -1
- package/dist/browser/evidence.js +25 -51
- package/dist/browser/evidence.js.map +1 -1
- package/dist/browser/fake-driver.d.ts +12 -16
- package/dist/browser/fake-driver.d.ts.map +1 -1
- package/dist/browser/fake-driver.js +24 -17
- package/dist/browser/fake-driver.js.map +1 -1
- package/dist/browser/graph-write.d.ts +4 -45
- package/dist/browser/graph-write.d.ts.map +1 -1
- package/dist/browser/graph-write.js +8 -53
- package/dist/browser/graph-write.js.map +1 -1
- package/dist/browser/playwright-driver.d.ts +17 -67
- package/dist/browser/playwright-driver.d.ts.map +1 -1
- package/dist/browser/playwright-driver.js +169 -166
- package/dist/browser/playwright-driver.js.map +1 -1
- package/dist/browser/provider.d.ts +5 -34
- package/dist/browser/provider.d.ts.map +1 -1
- package/dist/browser/provider.js +4 -24
- package/dist/browser/provider.js.map +1 -1
- package/dist/browser/registry.d.ts +26 -106
- package/dist/browser/registry.d.ts.map +1 -1
- package/dist/browser/registry.js +20 -77
- package/dist/browser/registry.js.map +1 -1
- package/dist/browser/scenario-resolve.d.ts +10 -44
- package/dist/browser/scenario-resolve.d.ts.map +1 -1
- package/dist/browser/scenario-resolve.js +10 -41
- package/dist/browser/scenario-resolve.js.map +1 -1
- package/dist/browser/scenario-runner.d.ts +12 -70
- package/dist/browser/scenario-runner.d.ts.map +1 -1
- package/dist/browser/scenario-runner.js +33 -91
- package/dist/browser/scenario-runner.js.map +1 -1
- package/dist/browser/stack-parser.d.ts +4 -28
- package/dist/browser/stack-parser.d.ts.map +1 -1
- package/dist/browser/stack-parser.js +12 -39
- package/dist/browser/stack-parser.js.map +1 -1
- package/dist/browser/tool-support.d.ts +20 -67
- package/dist/browser/tool-support.d.ts.map +1 -1
- package/dist/browser/tool-support.js +22 -66
- package/dist/browser/tool-support.js.map +1 -1
- package/dist/browser/url-scheme.d.ts +14 -0
- package/dist/browser/url-scheme.d.ts.map +1 -0
- package/dist/browser/url-scheme.js +38 -0
- package/dist/browser/url-scheme.js.map +1 -0
- package/dist/cancellation.d.ts +11 -46
- package/dist/cancellation.d.ts.map +1 -1
- package/dist/cancellation.js +11 -46
- package/dist/cancellation.js.map +1 -1
- package/dist/capped.d.ts +17 -0
- package/dist/capped.d.ts.map +1 -0
- package/dist/capped.js +15 -0
- package/dist/capped.js.map +1 -0
- package/dist/disclosure-ledger.d.ts +6 -30
- package/dist/disclosure-ledger.d.ts.map +1 -1
- package/dist/disclosure-ledger.js +4 -26
- package/dist/disclosure-ledger.js.map +1 -1
- package/dist/index.d.ts +10 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -17
- package/dist/index.js.map +1 -1
- package/dist/module-trust.d.ts +24 -0
- package/dist/module-trust.d.ts.map +1 -0
- package/dist/module-trust.js +60 -0
- package/dist/module-trust.js.map +1 -0
- package/dist/path-confinement.d.ts +31 -0
- package/dist/path-confinement.d.ts.map +1 -0
- package/dist/path-confinement.js +44 -0
- package/dist/path-confinement.js.map +1 -0
- package/dist/protocol.d.ts +10 -53
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +14 -60
- package/dist/protocol.js.map +1 -1
- package/dist/registry.d.ts +10 -58
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +38 -90
- package/dist/registry.js.map +1 -1
- package/dist/render.d.ts +79 -11
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +126 -14
- package/dist/render.js.map +1 -1
- package/dist/runtime-registry.d.ts +8 -49
- package/dist/runtime-registry.d.ts.map +1 -1
- package/dist/runtime-registry.js +72 -63
- package/dist/runtime-registry.js.map +1 -1
- package/dist/scenarios/index.d.ts +1 -1
- package/dist/scenarios/index.d.ts.map +1 -1
- package/dist/scenarios/index.js +1 -1
- package/dist/scenarios/index.js.map +1 -1
- package/dist/scenarios/parse.d.ts +4 -18
- package/dist/scenarios/parse.d.ts.map +1 -1
- package/dist/scenarios/parse.js +14 -34
- package/dist/scenarios/parse.js.map +1 -1
- package/dist/scenarios/scenario.d.ts +18 -74
- package/dist/scenarios/scenario.d.ts.map +1 -1
- package/dist/scenarios/scenario.js +7 -34
- package/dist/scenarios/scenario.js.map +1 -1
- package/dist/scenarios/storage.d.ts +11 -41
- package/dist/scenarios/storage.d.ts.map +1 -1
- package/dist/scenarios/storage.js +57 -47
- package/dist/scenarios/storage.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +55 -13
- package/dist/server.js.map +1 -1
- package/dist/session.d.ts +69 -239
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +76 -231
- package/dist/session.js.map +1 -1
- package/dist/tools/analyze.d.ts +27 -101
- package/dist/tools/analyze.d.ts.map +1 -1
- package/dist/tools/analyze.js +58 -148
- package/dist/tools/analyze.js.map +1 -1
- package/dist/tools/browser-click.d.ts +3 -21
- package/dist/tools/browser-click.d.ts.map +1 -1
- package/dist/tools/browser-click.js +10 -31
- package/dist/tools/browser-click.js.map +1 -1
- package/dist/tools/browser-close-session.d.ts +4 -13
- package/dist/tools/browser-close-session.d.ts.map +1 -1
- package/dist/tools/browser-close-session.js +4 -13
- package/dist/tools/browser-close-session.js.map +1 -1
- package/dist/tools/browser-fill.d.ts +5 -36
- package/dist/tools/browser-fill.d.ts.map +1 -1
- package/dist/tools/browser-fill.js +9 -44
- package/dist/tools/browser-fill.js.map +1 -1
- package/dist/tools/browser-navigate.d.ts +6 -27
- package/dist/tools/browser-navigate.d.ts.map +1 -1
- package/dist/tools/browser-navigate.js +6 -23
- package/dist/tools/browser-navigate.js.map +1 -1
- package/dist/tools/browser-run-scenario.d.ts +5 -31
- package/dist/tools/browser-run-scenario.d.ts.map +1 -1
- package/dist/tools/browser-run-scenario.js +10 -46
- package/dist/tools/browser-run-scenario.js.map +1 -1
- package/dist/tools/browser-save-scenario.d.ts +3 -28
- package/dist/tools/browser-save-scenario.d.ts.map +1 -1
- package/dist/tools/browser-save-scenario.js +102 -55
- package/dist/tools/browser-save-scenario.js.map +1 -1
- package/dist/tools/browser-snapshot.d.ts +6 -39
- package/dist/tools/browser-snapshot.d.ts.map +1 -1
- package/dist/tools/browser-snapshot.js +4 -31
- package/dist/tools/browser-snapshot.js.map +1 -1
- package/dist/tools/browser-start-session.d.ts +4 -23
- package/dist/tools/browser-start-session.d.ts.map +1 -1
- package/dist/tools/browser-start-session.js +38 -51
- package/dist/tools/browser-start-session.js.map +1 -1
- package/dist/tools/browser-type.d.ts +5 -35
- package/dist/tools/browser-type.d.ts.map +1 -1
- package/dist/tools/browser-type.js +10 -45
- package/dist/tools/browser-type.js.map +1 -1
- package/dist/tools/contracts.d.ts +17 -63
- package/dist/tools/contracts.d.ts.map +1 -1
- package/dist/tools/contracts.js +91 -47
- package/dist/tools/contracts.js.map +1 -1
- package/dist/tools/cross-pr.d.ts +56 -15
- package/dist/tools/cross-pr.d.ts.map +1 -1
- package/dist/tools/cross-pr.js +141 -38
- package/dist/tools/cross-pr.js.map +1 -1
- package/dist/tools/git-diff.d.ts +18 -2
- package/dist/tools/git-diff.d.ts.map +1 -1
- package/dist/tools/git-diff.js +143 -23
- package/dist/tools/git-diff.js.map +1 -1
- package/dist/tools/git-history.d.ts +5 -16
- package/dist/tools/git-history.d.ts.map +1 -1
- package/dist/tools/git-history.js +3 -10
- package/dist/tools/git-history.js.map +1 -1
- package/dist/tools/history.d.ts +4 -33
- package/dist/tools/history.d.ts.map +1 -1
- package/dist/tools/history.js +6 -31
- package/dist/tools/history.js.map +1 -1
- package/dist/tools/impact.d.ts +7 -51
- package/dist/tools/impact.d.ts.map +1 -1
- package/dist/tools/impact.js +15 -67
- package/dist/tools/impact.js.map +1 -1
- package/dist/tools/index.d.ts +3 -8
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -8
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/kit.d.ts +66 -113
- package/dist/tools/kit.d.ts.map +1 -1
- package/dist/tools/kit.js +60 -28
- package/dist/tools/kit.js.map +1 -1
- package/dist/tools/link-workspace.d.ts +7 -45
- package/dist/tools/link-workspace.d.ts.map +1 -1
- package/dist/tools/link-workspace.js +10 -48
- package/dist/tools/link-workspace.js.map +1 -1
- package/dist/tools/lookup.d.ts +4 -14
- package/dist/tools/lookup.d.ts.map +1 -1
- package/dist/tools/lookup.js +4 -14
- package/dist/tools/lookup.js.map +1 -1
- package/dist/tools/mark-incident.d.ts +7 -54
- package/dist/tools/mark-incident.d.ts.map +1 -1
- package/dist/tools/mark-incident.js +15 -68
- package/dist/tools/mark-incident.js.map +1 -1
- package/dist/tools/observe-runtime.d.ts +27 -210
- package/dist/tools/observe-runtime.d.ts.map +1 -1
- package/dist/tools/observe-runtime.js +258 -436
- package/dist/tools/observe-runtime.js.map +1 -1
- package/dist/tools/observe-tests.d.ts +9 -88
- package/dist/tools/observe-tests.d.ts.map +1 -1
- package/dist/tools/observe-tests.js +34 -108
- package/dist/tools/observe-tests.js.map +1 -1
- package/dist/tools/pr-analysis.d.ts +18 -2
- package/dist/tools/pr-analysis.d.ts.map +1 -1
- package/dist/tools/pr-analysis.js +73 -23
- package/dist/tools/pr-analysis.js.map +1 -1
- package/dist/tools/pre-push.d.ts +94 -9
- package/dist/tools/pre-push.d.ts.map +1 -1
- package/dist/tools/pre-push.js +139 -34
- package/dist/tools/pre-push.js.map +1 -1
- package/dist/tools/propagation.d.ts +11 -53
- package/dist/tools/propagation.d.ts.map +1 -1
- package/dist/tools/propagation.js +14 -57
- package/dist/tools/propagation.js.map +1 -1
- package/dist/tools/questions.d.ts +13 -63
- package/dist/tools/questions.d.ts.map +1 -1
- package/dist/tools/questions.js +33 -105
- package/dist/tools/questions.js.map +1 -1
- package/dist/tools/refusal-fetch.d.ts +4 -40
- package/dist/tools/refusal-fetch.d.ts.map +1 -1
- package/dist/tools/refusal-fetch.js +4 -40
- package/dist/tools/refusal-fetch.js.map +1 -1
- package/dist/tools/runtime-incident.d.ts +4 -63
- package/dist/tools/runtime-incident.d.ts.map +1 -1
- package/dist/tools/runtime-incident.js +10 -87
- package/dist/tools/runtime-incident.js.map +1 -1
- package/dist/tools/scope.d.ts +7 -25
- package/dist/tools/scope.d.ts.map +1 -1
- package/dist/tools/scope.js +17 -20
- package/dist/tools/scope.js.map +1 -1
- package/dist/tools/similar-incidents.d.ts +11 -86
- package/dist/tools/similar-incidents.d.ts.map +1 -1
- package/dist/tools/similar-incidents.js +7 -71
- package/dist/tools/similar-incidents.js.map +1 -1
- package/dist/tools/validate.d.ts +31 -47
- package/dist/tools/validate.d.ts.map +1 -1
- package/dist/tools/validate.js +133 -61
- package/dist/tools/validate.js.map +1 -1
- package/dist/tools/verification-status.d.ts +9 -64
- package/dist/tools/verification-status.d.ts.map +1 -1
- package/dist/tools/verification-status.js +9 -62
- package/dist/tools/verification-status.js.map +1 -1
- package/dist/tools/verify-claim.d.ts +5 -52
- package/dist/tools/verify-claim.d.ts.map +1 -1
- package/dist/tools/verify-claim.js +6 -56
- package/dist/tools/verify-claim.js.map +1 -1
- package/dist/transport.d.ts +15 -52
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +16 -60
- package/dist/transport.js.map +1 -1
- package/package.json +33 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-click.d.ts","sourceRoot":"","sources":["../../src/tools/browser-click.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"browser-click.d.ts","sourceRoot":"","sources":["../../src/tools/browser-click.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnF,OAAO,EAAoC,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAGjF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,qFAAqF;IACrF,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;CACnC;AA8FD,eAAO,MAAM,gBAAgB,EAAE,cAe9B,CAAC"}
|
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `browser_click
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `DEC-380` grants consent once, at
|
|
7
|
-
* `browser_start_session`, bound to that call's origin. So this tool declares
|
|
8
|
-
* `class: "action"` — it does change a running application, and pretending
|
|
9
|
-
* otherwise would be the lie — while its `describeAction` returns `undefined`,
|
|
10
|
-
* the existing "this particular call has nothing to confirm" path that
|
|
11
|
-
* `questions` uses when asked to read rather than write.
|
|
12
|
-
*
|
|
13
|
-
* The property that makes that safe rather than merely cheap: **a verb cannot
|
|
14
|
-
* mint consent for itself.** Called against a session with no consent record,
|
|
15
|
-
* it refuses. There is deliberately no path from a click to a token.
|
|
16
|
-
*
|
|
17
|
-
* ## A ref, never a selector
|
|
18
|
-
*
|
|
19
|
-
* The element is named by a ref from a snapshot the calling agent actually
|
|
20
|
-
* saw. A raw selector would let an agent act on an element it never looked
|
|
21
|
-
* at, and a ref from a superseded snapshot refuses rather than resolving
|
|
22
|
-
* against whatever now matches — that is the same mistake, arriving later.
|
|
2
|
+
* `browser_click`: clicks a ref the agent has seen from a snapshot, never a
|
|
3
|
+
* raw selector. Consent (DEC-380) is granted once at
|
|
4
|
+
* `browser_start_session` — a verb cannot mint consent for itself, and refuses with none on record. A stale ref (superseded snapshot) also refuses.
|
|
23
5
|
*/
|
|
24
6
|
import { browserAnswer, emptyEvidence, mutationRefusal, observeAndCorrelate, useSession } from "../browser/tool-support.js";
|
|
25
7
|
import { NO_GRAPH_WRITE } from "../browser/graph-write.js";
|
|
@@ -52,10 +34,9 @@ const SCHEMA = {
|
|
|
52
34
|
async function run(args, ctx) {
|
|
53
35
|
const sessionId = requiredString(args, "sessionId");
|
|
54
36
|
const ref = requiredString(args, "ref");
|
|
55
|
-
// Checked before the session is touched
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
// `browser_start_session` and its consent, not to this call.
|
|
37
|
+
// Checked before the session is touched: this verb changes a running
|
|
38
|
+
// application and the caller said stop. Session stays open — it belongs
|
|
39
|
+
// to browser_start_session's consent, not this call.
|
|
59
40
|
if (ctx.signal.aborted) {
|
|
60
41
|
return browserAnswer({
|
|
61
42
|
ctx,
|
|
@@ -76,8 +57,7 @@ async function run(args, ctx) {
|
|
|
76
57
|
});
|
|
77
58
|
}
|
|
78
59
|
const { entry } = found;
|
|
79
|
-
// Consent and safetyLevel are independent and both must pass
|
|
80
|
-
// granted at session start; this is the other half.
|
|
60
|
+
// Consent and safetyLevel are independent and both must pass; consent was granted at session start.
|
|
81
61
|
const refused = mutationRefusal(entry);
|
|
82
62
|
if (refused !== null) {
|
|
83
63
|
return browserAnswer({
|
|
@@ -122,10 +102,9 @@ export const browserClickTool = {
|
|
|
122
102
|
version: "1.0.0",
|
|
123
103
|
inputSchema: SCHEMA,
|
|
124
104
|
run,
|
|
125
|
-
// Undefined, always:
|
|
126
|
-
//
|
|
127
|
-
//
|
|
128
|
-
// were not going to abuse it.
|
|
105
|
+
// Undefined, always: session already confirmed at browser_start_session —
|
|
106
|
+
// a verb that could mint its own consent would be a gate that only
|
|
107
|
+
// catches callers who weren't going to abuse it.
|
|
129
108
|
describeAction: () => undefined,
|
|
130
109
|
};
|
|
131
110
|
//# sourceMappingURL=browser-click.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-click.js","sourceRoot":"","sources":["../../src/tools/browser-click.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"browser-click.js","sourceRoot":"","sources":["../../src/tools/browser-click.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC5H,OAAO,EAAE,cAAc,EAA0B,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAyC,MAAM,UAAU,CAAC;AAYjF,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,qDAAqD;SACnE;QACD,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,+FAA+F;gBAC/F,+FAA+F;gBAC/F,8DAA8D;SACjE;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,iGAAiG;gBACjG,kGAAkG;gBAClG,8BAA8B;SACjC;KACF;IACD,QAAQ,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC;IAC9B,oBAAoB,EAAE,KAAK;CACnB,CAAC;AAEX,KAAK,UAAU,GAAG,CAAC,IAA6B,EAAE,GAAgB;IAChE,MAAM,SAAS,G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E,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE;KAC3G,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAmB;IAC9C,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,qCAAqC;IAC5C,WAAW,EAAE,qGAAqG;QAChH,kGAAkG;QAClG,mFAAmF;IACrF,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,MAAM;IACnB,GAAG;IACH,0EAA0E;IAC1E,mEAAmE;IACnE,iDAAiD;IACjD,cAAc,EAAE,GAAG,EAAE,CAAC,SAAS;CAChC,CAAC"}
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `browser_close_session` —
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* discloses it — so the last thing a session does is report what it was
|
|
7
|
-
* holding.
|
|
8
|
-
*
|
|
9
|
-
* Closing a session that is already gone is **not an error**. An agent whose
|
|
10
|
-
* session timed out while it was thinking should get "here is why it went,
|
|
11
|
-
* and here is what it saw", not a failure it has to handle. That is the whole
|
|
12
|
-
* reason the registry keeps a record of a reaped session rather than
|
|
13
|
-
* forgetting the id.
|
|
14
|
-
*/
|
|
2
|
+
* `browser_close_session` — returns the final flush, not an acknowledgement: evidence
|
|
3
|
+
* captured then dropped with nothing to disclose it is worse than never captured.
|
|
4
|
+
* Closing an already-gone session is NOT an error — an agent whose session timed out
|
|
5
|
+
* gets "here's why, here's what it saw," not a failure to handle. */
|
|
15
6
|
import type { BrowserEvidenceReport } from "../browser/evidence.ts";
|
|
16
7
|
import { type ToolDefinition } from "./kit.ts";
|
|
17
8
|
export interface BrowserCloseSessionData {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-close-session.d.ts","sourceRoot":"","sources":["../../src/tools/browser-close-session.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"browser-close-session.d.ts","sourceRoot":"","sources":["../../src/tools/browser-close-session.ts"],"names":[],"mappings":"AAAA;;;;qEAIqE;AAGrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAoC,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAGjF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,aAAa,GAAG,kBAAkB,GAAG,SAAS,GAAG,eAAe,CAAC;IAChG,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;CAC1C;AA+CD,eAAO,MAAM,uBAAuB,EAAE,cAWrC,CAAC"}
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `browser_close_session` —
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* discloses it — so the last thing a session does is report what it was
|
|
7
|
-
* holding.
|
|
8
|
-
*
|
|
9
|
-
* Closing a session that is already gone is **not an error**. An agent whose
|
|
10
|
-
* session timed out while it was thinking should get "here is why it went,
|
|
11
|
-
* and here is what it saw", not a failure it has to handle. That is the whole
|
|
12
|
-
* reason the registry keeps a record of a reaped session rather than
|
|
13
|
-
* forgetting the id.
|
|
14
|
-
*/
|
|
2
|
+
* `browser_close_session` — returns the final flush, not an acknowledgement: evidence
|
|
3
|
+
* captured then dropped with nothing to disclose it is worse than never captured.
|
|
4
|
+
* Closing an already-gone session is NOT an error — an agent whose session timed out
|
|
5
|
+
* gets "here's why, here's what it saw," not a failure to handle. */
|
|
15
6
|
import { evidenceNotes } from "../browser/evidence.js";
|
|
16
7
|
import { browserAnswer, reportOf } from "../browser/tool-support.js";
|
|
17
8
|
import { requiredString } from "./kit.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-close-session.js","sourceRoot":"","sources":["../../src/tools/browser-close-session.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"browser-close-session.js","sourceRoot":"","sources":["../../src/tools/browser-close-session.ts"],"names":[],"mappings":"AAAA;;;;qEAIqE;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAyC,MAAM,UAAU,CAAC;AAUjF,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,kGAAkG;gBAClG,wEAAwE;SAC3E;KACF;IACD,QAAQ,EAAE,CAAC,WAAW,CAAC;IACvB,oBAAoB,EAAE,KAAK;CACnB,CAAC;AAEX,KAAK,UAAU,GAAG,CAAC,IAA6B,EAAE,GAAgB;IAChE,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACpD,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC;IAE/C,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACjD,GAAG,CAAC,QAAQ,CAAC,2BAA2B,SAAS,EAAE,CAAC,CAAC;IACrD,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACpD,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;IAEvC,MAAM,OAAO,GACX,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC;IAExH,MAAM,KAAK,GAAG,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3C,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,KAAK,CAAC,IAAI,CACR,mCAAmC,OAAO,0DAA0D;YAClG,wBAAwB,CAC3B,CAAC;IACJ,CAAC;IAED,OAAO,aAAa,CAA0B;QAC5C,GAAG;QACH,QAAQ,EACN,aAAa,KAAK,SAAS;YACzB,CAAC,CAAC,0BAA0B,SAAS,GAAG;YACxC,CAAC,CAAC,mBAAmB,SAAS,uBAAuB,OAAO,IAAI;QACpE,KAAK;QACL,IAAI,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE;KACvC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAmB;IACrD,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,yBAAyB;IAChC,WAAW,EACT,wGAAwG;QACxG,kGAAkG;IACpG,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,MAAM;IACnB,GAAG;CACJ,CAAC"}
|
|
@@ -1,39 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `DEC-380` grants consent once, at
|
|
7
|
-
* `browser_start_session`, bound to that call's origin. So this tool declares
|
|
8
|
-
* `class: "action"` — it does change a running application, and pretending
|
|
9
|
-
* otherwise would be the lie — while its `describeAction` returns `undefined`,
|
|
10
|
-
* the existing "this particular call has nothing to confirm" path that
|
|
11
|
-
* `questions` uses when asked to read rather than write.
|
|
12
|
-
*
|
|
13
|
-
* The property that makes that safe rather than merely cheap: **a verb cannot
|
|
14
|
-
* mint consent for itself.** Called against a session with no consent record,
|
|
15
|
-
* it refuses. There is deliberately no path from a click to a token.
|
|
16
|
-
*
|
|
17
|
-
* ## A ref, never a selector
|
|
18
|
-
*
|
|
19
|
-
* The element is named by a ref from a snapshot the calling agent actually
|
|
20
|
-
* saw. A raw selector would let an agent act on an element it never looked
|
|
21
|
-
* at, and a ref from a superseded snapshot refuses rather than resolving
|
|
22
|
-
* against whatever now matches — that is the same mistake, arriving later.
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* ## The trap this tool sets, stated where a reader meets it
|
|
26
|
-
*
|
|
27
|
-
* `fill` is faster and more reliable than typing, and for most fields it is
|
|
28
|
-
* the right verb. It also fires **no key events whatsoever** — the value is
|
|
29
|
-
* set directly. Any behaviour the page attaches to typing simply does not
|
|
30
|
-
* happen: autocompletes stay closed, per-character validation never runs, a
|
|
31
|
-
* debounced search never fires. The field ends up holding the right string
|
|
32
|
-
* and the page never learns it was touched.
|
|
33
|
-
*
|
|
34
|
-
* That is a correct tool producing a wrong answer, so the distinction is in
|
|
35
|
-
* the schema prose and not only here.
|
|
36
|
-
*/
|
|
1
|
+
/** `browser_fill` sets a field's value directly. Consent is granted once, at
|
|
2
|
+
* `browser_start_session` (DEC-380) — this is `class: "action"` but `describeAction` returns
|
|
3
|
+
* `undefined`; a verb cannot mint its own consent, so it refuses with no consent record. A ref
|
|
4
|
+
* must come from a snapshot the agent actually saw, never a raw selector. Fires **no key
|
|
5
|
+
* events**: autocomplete, per-char validation and debounced search never run — use browser_type. */
|
|
37
6
|
import type { BrowserEvidenceReport } from "../browser/evidence.ts";
|
|
38
7
|
import { type BrowserGraphWrite } from "../browser/graph-write.ts";
|
|
39
8
|
import { type ToolDefinition } from "./kit.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-fill.d.ts","sourceRoot":"","sources":["../../src/tools/browser-fill.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"browser-fill.d.ts","sourceRoot":"","sources":["../../src/tools/browser-fill.ts"],"names":[],"mappings":"AAAA;;;;qGAIqG;AAErG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnF,OAAO,EAAoC,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAGjF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,qFAAqF;IACrF,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;CACnC;AAsGD,eAAO,MAAM,eAAe,EAAE,cAe7B,CAAC"}
|
|
@@ -1,39 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `DEC-380` grants consent once, at
|
|
7
|
-
* `browser_start_session`, bound to that call's origin. So this tool declares
|
|
8
|
-
* `class: "action"` — it does change a running application, and pretending
|
|
9
|
-
* otherwise would be the lie — while its `describeAction` returns `undefined`,
|
|
10
|
-
* the existing "this particular call has nothing to confirm" path that
|
|
11
|
-
* `questions` uses when asked to read rather than write.
|
|
12
|
-
*
|
|
13
|
-
* The property that makes that safe rather than merely cheap: **a verb cannot
|
|
14
|
-
* mint consent for itself.** Called against a session with no consent record,
|
|
15
|
-
* it refuses. There is deliberately no path from a click to a token.
|
|
16
|
-
*
|
|
17
|
-
* ## A ref, never a selector
|
|
18
|
-
*
|
|
19
|
-
* The element is named by a ref from a snapshot the calling agent actually
|
|
20
|
-
* saw. A raw selector would let an agent act on an element it never looked
|
|
21
|
-
* at, and a ref from a superseded snapshot refuses rather than resolving
|
|
22
|
-
* against whatever now matches — that is the same mistake, arriving later.
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* ## The trap this tool sets, stated where a reader meets it
|
|
26
|
-
*
|
|
27
|
-
* `fill` is faster and more reliable than typing, and for most fields it is
|
|
28
|
-
* the right verb. It also fires **no key events whatsoever** — the value is
|
|
29
|
-
* set directly. Any behaviour the page attaches to typing simply does not
|
|
30
|
-
* happen: autocompletes stay closed, per-character validation never runs, a
|
|
31
|
-
* debounced search never fires. The field ends up holding the right string
|
|
32
|
-
* and the page never learns it was touched.
|
|
33
|
-
*
|
|
34
|
-
* That is a correct tool producing a wrong answer, so the distinction is in
|
|
35
|
-
* the schema prose and not only here.
|
|
36
|
-
*/
|
|
1
|
+
/** `browser_fill` sets a field's value directly. Consent is granted once, at
|
|
2
|
+
* `browser_start_session` (DEC-380) — this is `class: "action"` but `describeAction` returns
|
|
3
|
+
* `undefined`; a verb cannot mint its own consent, so it refuses with no consent record. A ref
|
|
4
|
+
* must come from a snapshot the agent actually saw, never a raw selector. Fires **no key
|
|
5
|
+
* events**: autocomplete, per-char validation and debounced search never run — use browser_type. */
|
|
37
6
|
import { browserAnswer, emptyEvidence, mutationRefusal, observeAndCorrelate, useSession } from "../browser/tool-support.js";
|
|
38
7
|
import { NO_GRAPH_WRITE } from "../browser/graph-write.js";
|
|
39
8
|
import { UnknownElementRefError } from "../browser/driver.js";
|
|
@@ -72,10 +41,8 @@ async function run(args, ctx) {
|
|
|
72
41
|
const sessionId = requiredString(args, "sessionId");
|
|
73
42
|
const ref = requiredString(args, "ref");
|
|
74
43
|
const text = requiredString(args, "text");
|
|
75
|
-
// Checked before the session is touched
|
|
76
|
-
//
|
|
77
|
-
// stop. The session itself is left open — it belongs to
|
|
78
|
-
// `browser_start_session` and its consent, not to this call.
|
|
44
|
+
// Checked before the session is touched: the caller said stop, so nothing happens. The session
|
|
45
|
+
// itself stays open — it belongs to browser_start_session's consent, not to this call.
|
|
79
46
|
if (ctx.signal.aborted) {
|
|
80
47
|
return browserAnswer({
|
|
81
48
|
ctx,
|
|
@@ -143,10 +110,8 @@ export const browserFillTool = {
|
|
|
143
110
|
version: "1.0.0",
|
|
144
111
|
inputSchema: SCHEMA,
|
|
145
112
|
run,
|
|
146
|
-
// Undefined, always:
|
|
147
|
-
//
|
|
148
|
-
// mint — its own consent would be a gate that exists only for callers who
|
|
149
|
-
// were not going to abuse it.
|
|
113
|
+
// Undefined, always: consent lives at browser_start_session — a verb that could mint its own
|
|
114
|
+
// consent would be a gate only honest callers respect.
|
|
150
115
|
describeAction: () => undefined,
|
|
151
116
|
};
|
|
152
117
|
//# sourceMappingURL=browser-fill.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-fill.js","sourceRoot":"","sources":["../../src/tools/browser-fill.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"browser-fill.js","sourceRoot":"","sources":["../../src/tools/browser-fill.ts"],"names":[],"mappings":"AAAA;;;;qGAIqG;AAGrG,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC5H,OAAO,EAAE,cAAc,EAA0B,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAyC,MAAM,UAAU,CAAC;AAYjF,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,qDAAqD;SACnE;QACD,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,+FAA+F;gBAC/F,+FAA+F;gBAC/F,8DAA8D;SACjE;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,kGAAkG;gBAClG,8FAA8F;gBAC9F,qFAAqF;SACxF;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,iGAAiG;gBACjG,kGA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B,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAEvD,OAAO,aAAa,CAAkB;QACpC,GAAG;QACH,QAAQ,EAAE,cAAc,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG;QAClD,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,IAAI,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE;KAC3G,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,8BAA8B;IACrC,WAAW,EAAE,uGAAuG;QAClH,uGAAuG;QACvG,gGAAgG;QAChG,kEAAkE;IACpE,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,MAAM;IACnB,GAAG;IACH,6FAA6F;IAC7F,uDAAuD;IACvD,cAAc,EAAE,GAAG,EAAE,CAAC,SAAS;CAChC,CAAC"}
|
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Navigation is where a session-scoped consent could quietly become a
|
|
7
|
-
* general-purpose browser. The grant names an origin; this tool is the only
|
|
8
|
-
* thing that can leave it, so this is where the bound is enforced. A
|
|
9
|
-
* cross-origin navigate **refuses** — it does not ask again, because a second
|
|
10
|
-
* prompt at this point is exactly the reflexive confirmation the consent
|
|
11
|
-
* ruling rejected.
|
|
12
|
-
*
|
|
13
|
-
* ## Class
|
|
14
|
-
*
|
|
15
|
-
* `stateful-read`. It changes what a later call sees, so it is not a pure
|
|
16
|
-
* read; but the fact a developer approves — *drive a browser against this
|
|
17
|
-
* application* — was stated and confirmed at `browser_start_session`, and
|
|
18
|
-
* re-gating each hop would make the session grant meaningless.
|
|
19
|
-
*/
|
|
1
|
+
/** `browser_navigate` moves an open session to another page. Cross-origin navigate refuses —
|
|
2
|
+
* never re-prompts — since navigation is the one place a session's consent could otherwise widen
|
|
3
|
+
* into a general-purpose browser. `class: "stateful-read"`: it changes what later calls see, but
|
|
4
|
+
* the developer's approval was already stated at `browser_start_session`. */
|
|
20
5
|
import { type ToolDefinition } from "./kit.ts";
|
|
21
6
|
import type { BrowserPageData } from "./browser-snapshot.ts";
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* A navigate answers the question a snapshot answers — *what is on the page
|
|
26
|
-
* now* — so returning a different shape would make a caller write two readers
|
|
27
|
-
* for one fact. It is an alias rather than a re-declaration so the two cannot
|
|
28
|
-
* drift.
|
|
29
|
-
*/
|
|
7
|
+
/** Deliberately the same shape `browser_snapshot` returns — an alias, not a re-declaration, so the
|
|
8
|
+
* two cannot drift. */
|
|
30
9
|
export type BrowserNavigateData = BrowserPageData;
|
|
31
10
|
export declare const browserNavigateTool: ToolDefinition;
|
|
32
11
|
//# sourceMappingURL=browser-navigate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-navigate.d.ts","sourceRoot":"","sources":["../../src/tools/browser-navigate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"browser-navigate.d.ts","sourceRoot":"","sources":["../../src/tools/browser-navigate.ts"],"names":[],"mappings":"AAAA;;;8EAG8E;AAM9E,OAAO,EAAoC,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAEjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;wBACwB;AACxB,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC;AA0FlD,eAAO,MAAM,mBAAmB,EAAE,cAYjC,CAAC"}
|
|
@@ -1,22 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Navigation is where a session-scoped consent could quietly become a
|
|
7
|
-
* general-purpose browser. The grant names an origin; this tool is the only
|
|
8
|
-
* thing that can leave it, so this is where the bound is enforced. A
|
|
9
|
-
* cross-origin navigate **refuses** — it does not ask again, because a second
|
|
10
|
-
* prompt at this point is exactly the reflexive confirmation the consent
|
|
11
|
-
* ruling rejected.
|
|
12
|
-
*
|
|
13
|
-
* ## Class
|
|
14
|
-
*
|
|
15
|
-
* `stateful-read`. It changes what a later call sees, so it is not a pure
|
|
16
|
-
* read; but the fact a developer approves — *drive a browser against this
|
|
17
|
-
* application* — was stated and confirmed at `browser_start_session`, and
|
|
18
|
-
* re-gating each hop would make the session grant meaningless.
|
|
19
|
-
*/
|
|
1
|
+
/** `browser_navigate` moves an open session to another page. Cross-origin navigate refuses —
|
|
2
|
+
* never re-prompts — since navigation is the one place a session's consent could otherwise widen
|
|
3
|
+
* into a general-purpose browser. `class: "stateful-read"`: it changes what later calls see, but
|
|
4
|
+
* the developer's approval was already stated at `browser_start_session`. */
|
|
20
5
|
import { browserAnswer, emptyEvidence, observeAndCorrelate, useSession, withinConsent } from "../browser/tool-support.js";
|
|
21
6
|
import { NO_GRAPH_WRITE } from "../browser/graph-write.js";
|
|
22
7
|
import { CANCELLED_STATE, cancellationHeadline, cancellationNotes } from "../cancellation.js";
|
|
@@ -44,10 +29,8 @@ function blank(url, evidence) {
|
|
|
44
29
|
async function run(args, ctx) {
|
|
45
30
|
const sessionId = requiredString(args, "sessionId");
|
|
46
31
|
const url = requiredString(args, "url");
|
|
47
|
-
// Checked before the session is touched
|
|
48
|
-
//
|
|
49
|
-
// stop. The session itself is left open — it belongs to
|
|
50
|
-
// `browser_start_session` and its consent, not to this call.
|
|
32
|
+
// Checked before the session is touched: the caller said stop, so nothing happens. The session
|
|
33
|
+
// itself stays open — it belongs to browser_start_session's consent, not to this call.
|
|
51
34
|
if (ctx.signal.aborted) {
|
|
52
35
|
return browserAnswer({
|
|
53
36
|
ctx,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-navigate.js","sourceRoot":"","sources":["../../src/tools/browser-navigate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"browser-navigate.js","sourceRoot":"","sources":["../../src/tools/browser-navigate.ts"],"names":[],"mappings":"AAAA;;;8EAG8E;AAG9E,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC1H,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAyC,MAAM,UAAU,CAAC;AAQjF,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wHAAwH;SACtI;QACD,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,kGAAkG;gBAClG,kGAAkG;gBAClG,6CAA6C;SAChD;KACF;IACD,QAAQ,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC;IAC9B,oBAAoB,EAAE,KAAK;CACnB,CAAC;AAEX,SAAS,KAAK,CAAC,GAAW,EAAE,QAA+B;IACzD,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;AAC5G,CAAC;AAED,KAAK,UAAU,GAAG,CAAC,IAA6B,EAAE,GAAgB;IAChE,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACpD,MAAM,G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point of this tool over "call browser_click six times" is that a
|
|
7
|
-
* scenario is a *check*, and a check has one outcome. Six replies make the
|
|
8
|
-
* calling agent reassemble a verdict from fragments and give it six chances to
|
|
9
|
-
* stop early with a partial picture; one reply carries the whole run — every
|
|
10
|
-
* step, every assertion, and one aggregated evidence summary drained a step at
|
|
11
|
-
* a time.
|
|
12
|
-
*
|
|
13
|
-
* ## Class
|
|
14
|
-
*
|
|
15
|
-
* `action`, on the same test as `browser_click`: it changes a running
|
|
16
|
-
* application, and declaring it anything softer would be the lie. Like the
|
|
17
|
-
* verbs, it mints nothing — consent was granted once at
|
|
18
|
-
* `browser_start_session` and bound to that origin, and a scenario cannot
|
|
19
|
-
* widen it: a stored `navigate` step that would leave the consented origin
|
|
20
|
-
* stops the replay rather than following the file.
|
|
21
|
-
*
|
|
22
|
-
* ## What it will not do
|
|
23
|
-
*
|
|
24
|
-
* Report a verdict about the application beyond what the scenario's own author
|
|
25
|
-
* wrote down. `DEC-381` keeps classification
|
|
26
|
-
* in the desktop pipeline, so a console error observed during a replay is
|
|
27
|
-
* reported and is not blocking — while a console error the author *asserted*
|
|
28
|
-
* would not happen is a failed assertion and is. Same evidence, different
|
|
29
|
-
* status, and the difference is entirely whether a person claimed something
|
|
30
|
-
* about it.
|
|
31
|
-
*/
|
|
1
|
+
/** `browser_run_scenario` replays a saved scenario in one batch call — one aggregated reply
|
|
2
|
+
* instead of N, since a check has one outcome, not fragments to reassemble. `class: "action"`
|
|
3
|
+
* like the verbs: mints nothing, consent stays bound to `browser_start_session`'s origin, and a
|
|
4
|
+
* stored `navigate` leaving it stops the replay. Per DEC-381, only an asserted expectation that
|
|
5
|
+
* fails is blocking — an observed console error the author never asserted against is not. */
|
|
32
6
|
import { type BrowserGraphWrite } from "../browser/graph-write.ts";
|
|
33
7
|
import { type ScenarioAssertionResult, type ScenarioCounts, type ScenarioStepResult } from "../browser/scenario-runner.ts";
|
|
34
8
|
import type { BrowserEvidenceReport } from "../browser/evidence.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-run-scenario.d.ts","sourceRoot":"","sources":["../../src/tools/browser-run-scenario.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"browser-run-scenario.d.ts","sourceRoot":"","sources":["../../src/tools/browser-run-scenario.ts"],"names":[],"mappings":"AAAA;;;;8FAI8F;AAI9F,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAA2B,KAAK,uBAAuB,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEpJ,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAoC,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAGjF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,+GAA+G;IAC/G,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,YAAY,GAAG,QAAQ,CAAC;IAC/E,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,qGAAqG;IACrG,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,uGAAuG;IACvG,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC9C,QAAQ,CAAC,UAAU,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACxD,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;CACnC;AA6LD,eAAO,MAAM,sBAAsB,EAAE,cAiBpC,CAAC"}
|
|
@@ -1,34 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* The point of this tool over "call browser_click six times" is that a
|
|
7
|
-
* scenario is a *check*, and a check has one outcome. Six replies make the
|
|
8
|
-
* calling agent reassemble a verdict from fragments and give it six chances to
|
|
9
|
-
* stop early with a partial picture; one reply carries the whole run — every
|
|
10
|
-
* step, every assertion, and one aggregated evidence summary drained a step at
|
|
11
|
-
* a time.
|
|
12
|
-
*
|
|
13
|
-
* ## Class
|
|
14
|
-
*
|
|
15
|
-
* `action`, on the same test as `browser_click`: it changes a running
|
|
16
|
-
* application, and declaring it anything softer would be the lie. Like the
|
|
17
|
-
* verbs, it mints nothing — consent was granted once at
|
|
18
|
-
* `browser_start_session` and bound to that origin, and a scenario cannot
|
|
19
|
-
* widen it: a stored `navigate` step that would leave the consented origin
|
|
20
|
-
* stops the replay rather than following the file.
|
|
21
|
-
*
|
|
22
|
-
* ## What it will not do
|
|
23
|
-
*
|
|
24
|
-
* Report a verdict about the application beyond what the scenario's own author
|
|
25
|
-
* wrote down. `DEC-381` keeps classification
|
|
26
|
-
* in the desktop pipeline, so a console error observed during a replay is
|
|
27
|
-
* reported and is not blocking — while a console error the author *asserted*
|
|
28
|
-
* would not happen is a failed assertion and is. Same evidence, different
|
|
29
|
-
* status, and the difference is entirely whether a person claimed something
|
|
30
|
-
* about it.
|
|
31
|
-
*/
|
|
1
|
+
/** `browser_run_scenario` replays a saved scenario in one batch call — one aggregated reply
|
|
2
|
+
* instead of N, since a check has one outcome, not fragments to reassemble. `class: "action"`
|
|
3
|
+
* like the verbs: mints nothing, consent stays bound to `browser_start_session`'s origin, and a
|
|
4
|
+
* stored `navigate` leaving it stops the replay. Per DEC-381, only an asserted expectation that
|
|
5
|
+
* fails is blocking — an observed console error the author never asserted against is not. */
|
|
32
6
|
import { readScenario } from "../scenarios/index.js";
|
|
33
7
|
import { browserAnswer, emptyEvidence, mutationRefusal, useSession, withinConsent } from "../browser/tool-support.js";
|
|
34
8
|
import { NO_GRAPH_WRITE } from "../browser/graph-write.js";
|
|
@@ -145,10 +119,8 @@ async function run(args, ctx) {
|
|
|
145
119
|
const notes = [
|
|
146
120
|
...(replay.sessionEnded === null ? [] : replay.sessionEnded.notes),
|
|
147
121
|
...replay.notes,
|
|
148
|
-
// A cancelled replay is `unresolved`
|
|
149
|
-
//
|
|
150
|
-
// could not run" and send a reader looking for a rename that never
|
|
151
|
-
// happened. The replay's own note already says what stopped it.
|
|
122
|
+
// A cancelled replay is `unresolved` with zero unresolved steps — skip the outcome note, the
|
|
123
|
+
// replay's own note already says what stopped it.
|
|
152
124
|
...(replay.cancelled ? [] : outcomeNotes(replay.outcome, replay.counts, name)),
|
|
153
125
|
...replay.steps.filter((s) => s.resolution !== null).map((s) => s.resolution.message),
|
|
154
126
|
...replay.assertions.filter((a) => a.status === "failed" || a.status === "unevaluable").map((a) => a.detail),
|
|
@@ -177,13 +149,8 @@ async function run(args, ctx) {
|
|
|
177
149
|
},
|
|
178
150
|
});
|
|
179
151
|
}
|
|
180
|
-
/**
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
* Emitted per outcome rather than always, because a note that appears on every
|
|
184
|
-
* reply is a note nobody reads by the third one — the same reasoning
|
|
185
|
-
* `evidenceNotes` uses for the triage disclaimer.
|
|
186
|
-
*/
|
|
152
|
+
/** The disclosure the three counts exist for. Emitted per outcome, not always — a note on every
|
|
153
|
+
* reply is one nobody reads by the third (same reasoning as `evidenceNotes`'s triage disclaimer). */
|
|
187
154
|
function outcomeNotes(outcome, counts, name) {
|
|
188
155
|
switch (outcome) {
|
|
189
156
|
case "unverified":
|
|
@@ -228,10 +195,7 @@ export const browserRunScenarioTool = {
|
|
|
228
195
|
version: "1.0.0",
|
|
229
196
|
inputSchema: SCHEMA,
|
|
230
197
|
run,
|
|
231
|
-
// Undefined, always
|
|
232
|
-
// confirmed at browser_start_session; a replay that could mint its own
|
|
233
|
-
// consent would be a gate that exists only for callers who were not going
|
|
234
|
-
// to abuse it.
|
|
198
|
+
// Undefined, always, same as the verbs: consent lives at browser_start_session, not here.
|
|
235
199
|
describeAction: () => undefined,
|
|
236
200
|
};
|
|
237
201
|
//# sourceMappingURL=browser-run-scenario.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-run-scenario.js","sourceRoot":"","sources":["../../src/tools/browser-run-scenario.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"browser-run-scenario.js","sourceRoot":"","sources":["../../src/tools/browser-run-scenario.ts"],"names":[],"mappings":"AAAA;;;;8FAI8F;AAE9F,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACtH,OAAO,EAAE,cAAc,EAA0B,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,cAAc,EAA8E,MAAM,+BAA+B,CAAC;AACpJ,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAyC,MAAM,UAAU,CAAC;AAqBjF,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wHAAwH;SACtI;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,kFAAkF;gBAClF,sGAAsG;gBACtG,oCAAoC;SACvC;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,oGAAoG;gBACpG,6FAA6F;gBAC7F,oBAAoB;SACvB;KACF;IACD,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC;IAC/B,oBAAoB,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YAAY;YACf,OAAO;gBACL,GAAG,MAAM,CAAC,UAAU,8EAA8E;oBAChG,mGAAmG;oBACnG,+FAA+F;oBAC/F,iDAAiD;aACpD,CAAC;QACJ,KAAK,QAAQ;YACX,OAAO;gBACL,GAAG,MAAM,CAAC,MAAM,mFAAmF;oBACjG,qGAAqG;oBACrG,0DAA0D;oBAC1D,CAAC,MAAM,CAAC,UAAU,GAAG,CAAC;wBACpB,CAAC,CAAC,IAAI,MAAM,CAAC,UAAU,0EAA0E;4BAC/F,iBAAiB;wBACnB,CAAC,CAAC,EAAE,CAAC;aACV,CAAC;QACJ,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ;YACX,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAmB;IACpD,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,yBAAyB;IAChC,WAAW,EACT,qGAAqG;QACrG,uGAAuG;QACvG,uGAAuG;QACvG,uGAAuG;QACvG,qGAAqG;QACrG,qEAAqE;IACvE,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,MAAM;IACnB,GAAG;IACH,0FAA0F;IAC1F,cAAc,EAAE,GAAG,EAAE,CAAC,SAAS;CAChC,CAAC"}
|
|
@@ -1,32 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `browser_save_scenario
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* ## Everything goes out through `writeScenario`
|
|
6
|
-
*
|
|
7
|
-
* There is deliberately no private path to disk here. `writeScenario`
|
|
8
|
-
* validates on the way *out* as well as in, and that is not redundant: a
|
|
9
|
-
* scenario is written once and read on every push afterwards, so a fault saved
|
|
10
|
-
* today surfaces during a check somebody is waiting on, long after the session
|
|
11
|
-
* that could have explained it is gone. A tool that serialized its own JSON
|
|
12
|
-
* would be a second writer with a first writer's rules, and the second one is
|
|
13
|
-
* the one that ships a file nothing can read.
|
|
14
|
-
*
|
|
15
|
-
* ## A step carries no ref, and this schema offers no way to send one
|
|
16
|
-
*
|
|
17
|
-
* The ref refusal is enforced twice on purpose. The format module rejects a
|
|
18
|
-
* step carrying a `ref` **by name**, with the reason in the message; this
|
|
19
|
-
* schema does not declare the field at all. A caller working from a
|
|
20
|
-
* `browser_snapshot` reply has the three durable fields already — every
|
|
21
|
-
* snapshot element carries `role`, `name` and `selector` — so the natural
|
|
22
|
-
* thing to copy is the right thing to store.
|
|
23
|
-
*
|
|
24
|
-
* ## What the session supplies
|
|
25
|
-
*
|
|
26
|
-
* The consented origin (a scenario may not be saved pointing somewhere this
|
|
27
|
-
* session was never allowed to drive), the URL to start from, and the
|
|
28
|
-
* provenance pair. The steps are the caller's: this server has no exploration
|
|
29
|
-
* planner and does not pretend to have recorded intent it never saw.
|
|
2
|
+
* `browser_save_scenario`: an explored session becomes a durable scenario,
|
|
3
|
+
* written only through `writeScenario` (validates in and out — no private
|
|
4
|
+
* disk path here). A step can't carry a `ref`: the schema omits the field entirely and the format module also rejects one by name.
|
|
30
5
|
*/
|
|
31
6
|
import { type ToolDefinition } from "./kit.ts";
|
|
32
7
|
export interface BrowserSaveScenarioData {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-save-scenario.d.ts","sourceRoot":"","sources":["../../src/tools/browser-save-scenario.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"browser-save-scenario.d.ts","sourceRoot":"","sources":["../../src/tools/browser-save-scenario.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,OAAO,EAAoE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAGjH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAqVD,eAAO,MAAM,uBAAuB,EAAE,cAqBrC,CAAC"}
|