@namzu/sdk 45.0.0 → 46.0.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/CHANGELOG.md +166 -0
- package/dist/authorization/gate.d.ts +5 -2
- package/dist/authorization/gate.d.ts.map +1 -1
- package/dist/authorization/gate.js +35 -4
- package/dist/authorization/gate.js.map +1 -1
- package/dist/authorization/rules.d.ts.map +1 -1
- package/dist/authorization/rules.js +56 -6
- package/dist/authorization/rules.js.map +1 -1
- package/dist/authorization/shell-lexer.d.ts +38 -0
- package/dist/authorization/shell-lexer.d.ts.map +1 -1
- package/dist/authorization/shell-lexer.js +88 -57
- package/dist/authorization/shell-lexer.js.map +1 -1
- package/dist/bridge/a2a/mapper.d.ts.map +1 -1
- package/dist/bridge/a2a/mapper.js +2 -0
- package/dist/bridge/a2a/mapper.js.map +1 -1
- package/dist/bridge/sse/mapper.d.ts.map +1 -1
- package/dist/bridge/sse/mapper.js +1 -0
- package/dist/bridge/sse/mapper.js.map +1 -1
- package/dist/directory/types.d.ts +2 -0
- package/dist/directory/types.d.ts.map +1 -1
- package/dist/directory/types.js.map +1 -1
- package/dist/manager/resident/outbox.d.ts +4 -4
- package/dist/pricing/catalogue.generated.d.ts.map +1 -1
- package/dist/pricing/catalogue.generated.js +28 -4
- package/dist/pricing/catalogue.generated.js.map +1 -1
- package/dist/prompt/coding-agent-doctrine.d.ts +1 -1
- package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
- package/dist/prompt/coding-agent-doctrine.js +1 -0
- package/dist/prompt/coding-agent-doctrine.js.map +1 -1
- package/dist/public-runtime.d.ts +6 -3
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +14 -2
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +7 -2
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +15 -2
- package/dist/public-tools.js.map +1 -1
- package/dist/public-types.d.ts +8 -2
- package/dist/public-types.d.ts.map +1 -1
- package/dist/registry/tool/callable.d.ts +22 -0
- package/dist/registry/tool/callable.d.ts.map +1 -0
- package/dist/registry/tool/callable.js +29 -0
- package/dist/registry/tool/callable.js.map +1 -0
- package/dist/registry/tool/execute.d.ts.map +1 -1
- package/dist/registry/tool/execute.js +8 -1
- package/dist/registry/tool/execute.js.map +1 -1
- package/dist/runtime/query/declined.d.ts +12 -0
- package/dist/runtime/query/declined.d.ts.map +1 -0
- package/dist/runtime/query/declined.js +12 -0
- package/dist/runtime/query/declined.js.map +1 -0
- package/dist/runtime/query/executor/tool-call-admission.d.ts +37 -11
- package/dist/runtime/query/executor/tool-call-admission.d.ts.map +1 -1
- package/dist/runtime/query/executor/tool-call-admission.js +38 -12
- package/dist/runtime/query/executor/tool-call-admission.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +7 -3
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +32 -7
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +1 -0
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/index.js +7 -0
- package/dist/runtime/query/iteration/index.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts +6 -0
- package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/context.js.map +1 -1
- package/dist/runtime/query/iteration/phases/handoff.d.ts +22 -0
- package/dist/runtime/query/iteration/phases/handoff.d.ts.map +1 -0
- package/dist/runtime/query/iteration/phases/handoff.js +65 -0
- package/dist/runtime/query/iteration/phases/handoff.js.map +1 -0
- package/dist/runtime/query/iteration/phases/index.d.ts +1 -0
- package/dist/runtime/query/iteration/phases/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/index.js +1 -0
- package/dist/runtime/query/iteration/phases/index.js.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.js +8 -3
- package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
- package/dist/runtime/query/resume-pending.d.ts.map +1 -1
- package/dist/runtime/query/resume-pending.js +3 -2
- package/dist/runtime/query/resume-pending.js.map +1 -1
- package/dist/runtime/query/review-policy.d.ts +43 -0
- package/dist/runtime/query/review-policy.d.ts.map +1 -1
- package/dist/runtime/query/review-policy.js +63 -19
- package/dist/runtime/query/review-policy.js.map +1 -1
- package/dist/schedules/cron.d.ts +21 -0
- package/dist/schedules/cron.d.ts.map +1 -0
- package/dist/schedules/cron.js +167 -0
- package/dist/schedules/cron.js.map +1 -0
- package/dist/schedules/describe.d.ts +14 -0
- package/dist/schedules/describe.d.ts.map +1 -0
- package/dist/schedules/describe.js +133 -0
- package/dist/schedules/describe.js.map +1 -0
- package/dist/schedules/errors.d.ts +11 -0
- package/dist/schedules/errors.d.ts.map +1 -0
- package/dist/schedules/errors.js +15 -0
- package/dist/schedules/errors.js.map +1 -0
- package/dist/schedules/evaluate.d.ts +35 -0
- package/dist/schedules/evaluate.d.ts.map +1 -0
- package/dist/schedules/evaluate.js +158 -0
- package/dist/schedules/evaluate.js.map +1 -0
- package/dist/schedules/index.d.ts +11 -0
- package/dist/schedules/index.d.ts.map +1 -0
- package/dist/schedules/index.js +8 -0
- package/dist/schedules/index.js.map +1 -0
- package/dist/schedules/next-fire.d.ts +50 -0
- package/dist/schedules/next-fire.d.ts.map +1 -0
- package/dist/schedules/next-fire.js +250 -0
- package/dist/schedules/next-fire.js.map +1 -0
- package/dist/schedules/spec.d.ts +30 -0
- package/dist/schedules/spec.d.ts.map +1 -0
- package/dist/schedules/spec.js +169 -0
- package/dist/schedules/spec.js.map +1 -0
- package/dist/schedules/types.d.ts +144 -0
- package/dist/schedules/types.d.ts.map +1 -0
- package/dist/schedules/types.js +11 -0
- package/dist/schedules/types.js.map +1 -0
- package/dist/schedules/tz.d.ts +44 -0
- package/dist/schedules/tz.d.ts.map +1 -0
- package/dist/schedules/tz.js +141 -0
- package/dist/schedules/tz.js.map +1 -0
- package/dist/skills/index.d.ts +1 -1
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/loader.d.ts +16 -3
- package/dist/skills/loader.d.ts.map +1 -1
- package/dist/skills/loader.js +48 -4
- package/dist/skills/loader.js.map +1 -1
- package/dist/skills/registry.d.ts +6 -0
- package/dist/skills/registry.d.ts.map +1 -1
- package/dist/skills/registry.js +1 -0
- package/dist/skills/registry.js.map +1 -1
- package/dist/tools/builtins/browser-url.d.ts +83 -0
- package/dist/tools/builtins/browser-url.d.ts.map +1 -0
- package/dist/tools/builtins/browser-url.js +240 -0
- package/dist/tools/builtins/browser-url.js.map +1 -0
- package/dist/tools/builtins/browser.d.ts +367 -0
- package/dist/tools/builtins/browser.d.ts.map +1 -0
- package/dist/tools/builtins/browser.js +704 -0
- package/dist/tools/builtins/browser.js.map +1 -0
- package/dist/tools/builtins/computer-use-coordinates.d.ts +65 -0
- package/dist/tools/builtins/computer-use-coordinates.d.ts.map +1 -0
- package/dist/tools/builtins/computer-use-coordinates.js +123 -0
- package/dist/tools/builtins/computer-use-coordinates.js.map +1 -0
- package/dist/tools/builtins/computer-use-image.d.ts +77 -0
- package/dist/tools/builtins/computer-use-image.d.ts.map +1 -0
- package/dist/tools/builtins/computer-use-image.js +223 -0
- package/dist/tools/builtins/computer-use-image.js.map +1 -0
- package/dist/tools/builtins/computer-use.d.ts +519 -14
- package/dist/tools/builtins/computer-use.d.ts.map +1 -1
- package/dist/tools/builtins/computer-use.js +1188 -183
- package/dist/tools/builtins/computer-use.js.map +1 -1
- package/dist/tools/builtins/index.d.ts +2 -1
- package/dist/tools/builtins/index.d.ts.map +1 -1
- package/dist/tools/builtins/index.js +1 -1
- package/dist/tools/builtins/index.js.map +1 -1
- package/dist/tools/builtins/skill.d.ts +74 -0
- package/dist/tools/builtins/skill.d.ts.map +1 -1
- package/dist/tools/builtins/skill.js +214 -159
- package/dist/tools/builtins/skill.js.map +1 -1
- package/dist/tools/defineTool.d.ts +4 -0
- package/dist/tools/defineTool.d.ts.map +1 -1
- package/dist/tools/defineTool.js +8 -0
- package/dist/tools/defineTool.js.map +1 -1
- package/dist/tools/schedules/index.d.ts +5 -0
- package/dist/tools/schedules/index.d.ts.map +1 -0
- package/dist/tools/schedules/index.js +4 -0
- package/dist/tools/schedules/index.js.map +1 -0
- package/dist/tools/schedules/loop-tool.d.ts +14 -0
- package/dist/tools/schedules/loop-tool.d.ts.map +1 -0
- package/dist/tools/schedules/loop-tool.js +81 -0
- package/dist/tools/schedules/loop-tool.js.map +1 -0
- package/dist/tools/schedules/present.d.ts +16 -0
- package/dist/tools/schedules/present.d.ts.map +1 -0
- package/dist/tools/schedules/present.js +71 -0
- package/dist/tools/schedules/present.js.map +1 -0
- package/dist/tools/schedules/prompt-scan.d.ts +17 -0
- package/dist/tools/schedules/prompt-scan.d.ts.map +1 -0
- package/dist/tools/schedules/prompt-scan.js +92 -0
- package/dist/tools/schedules/prompt-scan.js.map +1 -0
- package/dist/tools/schedules/schedule-tool.d.ts +17 -0
- package/dist/tools/schedules/schedule-tool.d.ts.map +1 -0
- package/dist/tools/schedules/schedule-tool.js +418 -0
- package/dist/tools/schedules/schedule-tool.js.map +1 -0
- package/dist/tools/schedules/types.d.ts +252 -0
- package/dist/tools/schedules/types.d.ts.map +1 -0
- package/dist/tools/schedules/types.js +11 -0
- package/dist/tools/schedules/types.js.map +1 -0
- package/dist/types/authorization/index.d.ts +107 -9
- package/dist/types/authorization/index.d.ts.map +1 -1
- package/dist/types/authorization/index.js +16 -1
- package/dist/types/authorization/index.js.map +1 -1
- package/dist/types/browser/index.d.ts +280 -0
- package/dist/types/browser/index.d.ts.map +1 -0
- package/dist/types/browser/index.js +12 -0
- package/dist/types/browser/index.js.map +1 -0
- package/dist/types/computer-use/index.d.ts +176 -0
- package/dist/types/computer-use/index.d.ts.map +1 -1
- package/dist/types/computer-use/index.js.map +1 -1
- package/dist/types/session/events.d.ts +6 -0
- package/dist/types/session/events.d.ts.map +1 -1
- package/dist/types/session/events.js.map +1 -1
- package/dist/types/session/records.d.ts +23 -0
- package/dist/types/session/records.d.ts.map +1 -1
- package/dist/types/session/records.js +9 -0
- package/dist/types/session/records.js.map +1 -1
- package/dist/types/tool/index.d.ts +60 -0
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/dist/types/tool/presentation.d.ts +7 -0
- package/dist/types/tool/presentation.d.ts.map +1 -1
- package/dist/utils/frontmatter.d.ts +18 -2
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +13 -3
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/id.d.ts +8 -0
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/id.js +12 -0
- package/dist/utils/id.js.map +1 -1
- package/package.json +3 -1
- package/src/authorization/gate.ts +37 -4
- package/src/authorization/rules.ts +55 -7
- package/src/authorization/shell-lexer.ts +109 -51
- package/src/bridge/a2a/mapper.ts +2 -0
- package/src/bridge/sse/mapper.ts +1 -0
- package/src/directory/types.ts +2 -0
- package/src/pricing/catalogue.generated.ts +28 -4
- package/src/pricing/rates.source.json +27 -6
- package/src/prompt/coding-agent-doctrine.ts +1 -0
- package/src/public-runtime.ts +43 -1
- package/src/public-tools.ts +54 -1
- package/src/public-types.ts +55 -0
- package/src/registry/tool/callable.ts +37 -0
- package/src/registry/tool/execute.ts +8 -1
- package/src/runtime/query/declined.ts +12 -0
- package/src/runtime/query/executor/tool-call-admission.ts +60 -16
- package/src/runtime/query/executor.ts +36 -5
- package/src/runtime/query/index.ts +1 -0
- package/src/runtime/query/iteration/index.ts +8 -0
- package/src/runtime/query/iteration/phases/context.ts +6 -0
- package/src/runtime/query/iteration/phases/handoff.ts +74 -0
- package/src/runtime/query/iteration/phases/index.ts +1 -0
- package/src/runtime/query/iteration/phases/tool-review.ts +11 -4
- package/src/runtime/query/resume-pending.ts +3 -2
- package/src/runtime/query/review-policy.ts +107 -18
- package/src/schedules/cron.ts +202 -0
- package/src/schedules/describe.ts +138 -0
- package/src/schedules/errors.ts +15 -0
- package/src/schedules/evaluate.ts +178 -0
- package/src/schedules/index.ts +18 -0
- package/src/schedules/next-fire.ts +257 -0
- package/src/schedules/spec.ts +210 -0
- package/src/schedules/types.ts +163 -0
- package/src/schedules/tz.ts +155 -0
- package/src/skills/index.ts +1 -1
- package/src/skills/loader.ts +55 -4
- package/src/skills/registry.ts +8 -0
- package/src/tools/builtins/browser-url.ts +251 -0
- package/src/tools/builtins/browser.ts +817 -0
- package/src/tools/builtins/computer-use-coordinates.ts +144 -0
- package/src/tools/builtins/computer-use-image.ts +278 -0
- package/src/tools/builtins/computer-use.ts +1485 -191
- package/src/tools/builtins/index.ts +7 -1
- package/src/tools/builtins/skill.ts +304 -156
- package/src/tools/defineTool.ts +13 -0
- package/src/tools/schedules/index.ts +4 -0
- package/src/tools/schedules/loop-tool.ts +85 -0
- package/src/tools/schedules/present.ts +88 -0
- package/src/tools/schedules/prompt-scan.ts +96 -0
- package/src/tools/schedules/schedule-tool.ts +482 -0
- package/src/tools/schedules/types.ts +265 -0
- package/src/types/authorization/index.ts +81 -2
- package/src/types/browser/index.ts +341 -0
- package/src/types/computer-use/index.ts +202 -0
- package/src/types/session/events.ts +6 -0
- package/src/types/session/records.ts +10 -0
- package/src/types/tool/index.ts +61 -0
- package/src/types/tool/presentation.ts +7 -0
- package/src/utils/frontmatter.ts +29 -3
- package/src/utils/id.ts +14 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One spelling per address, decided before anyone judges the address.
|
|
3
|
+
*
|
|
4
|
+
* The browser tools' `url` and `origin` arguments are canonicalised by their
|
|
5
|
+
* input schema, and the registry hands the gate and the reviewer the schema's
|
|
6
|
+
* OUTPUT (`ToolRegistry.prepareExecution`). So a site rule written as
|
|
7
|
+
* `^https://github\.com(?:[/?#]|$)` is tested against the one spelling the
|
|
8
|
+
* browser will load, never against `HTTPS://GitHub.com:443/`,
|
|
9
|
+
* `https://github.com./` or `https://%67ithub.com/`, which name the same page
|
|
10
|
+
* and would each slip past a deny written for the plain form.
|
|
11
|
+
*
|
|
12
|
+
* The canonical form is the WHATWG URL serialisation (`new URL(x).href`),
|
|
13
|
+
* which already lowercases the scheme and host, converts an internationalised
|
|
14
|
+
* host to punycode, drops a default port, decodes percent-encoded host bytes
|
|
15
|
+
* and reads every IPv4 spelling (`2852039166`, `0xA9FEA9FE`,
|
|
16
|
+
* `0251.0376.0251.0376`, `169.254.43518`) as dotted-quad. On top of that:
|
|
17
|
+
*
|
|
18
|
+
* - trailing dots on the host are removed (`github.com.` is `github.com` to
|
|
19
|
+
* DNS and to a person, and a different string to a pattern);
|
|
20
|
+
* - only `http:` and `https:` are accepted, plus the literal `about:blank`;
|
|
21
|
+
* - an address carrying a user name or password is refused — it is how
|
|
22
|
+
* `https://github.com@evil.example/` reads as GitHub to a person;
|
|
23
|
+
* - cloud metadata endpoints are refused outright, in every spelling the
|
|
24
|
+
* parser folds into them. This is a floor, not the site policy: a private
|
|
25
|
+
* or loopback address is left to the operator's site rules, and a DNS name
|
|
26
|
+
* that RESOLVES to a metadata address is the host's to catch after the
|
|
27
|
+
* navigation lands.
|
|
28
|
+
*/
|
|
29
|
+
export type BrowserUrlVerdict = {
|
|
30
|
+
readonly ok: true;
|
|
31
|
+
readonly url: string;
|
|
32
|
+
readonly origin: string;
|
|
33
|
+
} | {
|
|
34
|
+
readonly ok: false;
|
|
35
|
+
readonly reason: string;
|
|
36
|
+
};
|
|
37
|
+
export type BrowserOriginVerdict = {
|
|
38
|
+
readonly ok: true;
|
|
39
|
+
readonly origin: string;
|
|
40
|
+
} | {
|
|
41
|
+
readonly ok: false;
|
|
42
|
+
readonly reason: string;
|
|
43
|
+
};
|
|
44
|
+
/** Longest address the tools accept. Longer is not a page anyone meant to name. */
|
|
45
|
+
export declare const BROWSER_URL_MAX_LENGTH = 8192;
|
|
46
|
+
/**
|
|
47
|
+
* Is this host a cloud metadata endpoint, in any spelling the URL parser
|
|
48
|
+
* folds into one? `hostname` is a URL's `hostname` (IPv6 in brackets) or a
|
|
49
|
+
* bare name or address.
|
|
50
|
+
*/
|
|
51
|
+
export declare function isCloudMetadataHost(hostname: string): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The one spelling of an address the browser may be sent to, or why not.
|
|
54
|
+
*
|
|
55
|
+
* Accepts absolute `http:` and `https:` URLs and `about:blank`. See the
|
|
56
|
+
* module comment for what is folded and what is refused.
|
|
57
|
+
*/
|
|
58
|
+
export declare function canonicalizeBrowserUrl(raw: string): BrowserUrlVerdict;
|
|
59
|
+
/**
|
|
60
|
+
* The canonical origin (`scheme://host[:port]`) a `browser_act` call names,
|
|
61
|
+
* or why it is not one. A trailing `/` is accepted; a path, query or fragment
|
|
62
|
+
* is not — the argument is an origin, copied from the snapshot header.
|
|
63
|
+
*/
|
|
64
|
+
export declare function canonicalizeBrowserOrigin(raw: string): BrowserOriginVerdict;
|
|
65
|
+
export type BrowserSitePatternVerdict = {
|
|
66
|
+
readonly ok: true;
|
|
67
|
+
readonly pattern: string;
|
|
68
|
+
} | {
|
|
69
|
+
readonly ok: false;
|
|
70
|
+
readonly reason: string;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* The canonical spelling of a site key an operator or a job grants —
|
|
74
|
+
* `https://github.com`, `https://*.example.com`, `http://localhost:*` — or
|
|
75
|
+
* why it is not one.
|
|
76
|
+
*
|
|
77
|
+
* The scheme is literal (`http` or `https`). The host may begin with `*.`,
|
|
78
|
+
* meaning one or more labels in front of the rest. The port may be `*`, any
|
|
79
|
+
* port; a default port is dropped. The host is lowercased and punycoded like
|
|
80
|
+
* a URL's. A bare `*`, a path, credentials and metadata hosts are refused.
|
|
81
|
+
*/
|
|
82
|
+
export declare function canonicalizeBrowserSitePattern(raw: string):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,MAAM,CAAA;CAAE,CAAA;AAElD;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,MAAM,GAAG,yBAAyB,CAoCrF"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One spelling per address, decided before anyone judges the address.
|
|
3
|
+
*
|
|
4
|
+
* The browser tools' `url` and `origin` arguments are canonicalised by their
|
|
5
|
+
* input schema, and the registry hands the gate and the reviewer the schema's
|
|
6
|
+
* OUTPUT (`ToolRegistry.prepareExecution`). So a site rule written as
|
|
7
|
+
* `^https://github\.com(?:[/?#]|$)` is tested against the one spelling the
|
|
8
|
+
* browser will load, never against `HTTPS://GitHub.com:443/`,
|
|
9
|
+
* `https://github.com./` or `https://%67ithub.com/`, which name the same page
|
|
10
|
+
* and would each slip past a deny written for the plain form.
|
|
11
|
+
*
|
|
12
|
+
* The canonical form is the WHATWG URL serialisation (`new URL(x).href`),
|
|
13
|
+
* which already lowercases the scheme and host, converts an internationalised
|
|
14
|
+
* host to punycode, drops a default port, decodes percent-encoded host bytes
|
|
15
|
+
* and reads every IPv4 spelling (`2852039166`, `0xA9FEA9FE`,
|
|
16
|
+
* `0251.0376.0251.0376`, `169.254.43518`) as dotted-quad. On top of that:
|
|
17
|
+
*
|
|
18
|
+
* - trailing dots on the host are removed (`github.com.` is `github.com` to
|
|
19
|
+
* DNS and to a person, and a different string to a pattern);
|
|
20
|
+
* - only `http:` and `https:` are accepted, plus the literal `about:blank`;
|
|
21
|
+
* - an address carrying a user name or password is refused — it is how
|
|
22
|
+
* `https://github.com@evil.example/` reads as GitHub to a person;
|
|
23
|
+
* - cloud metadata endpoints are refused outright, in every spelling the
|
|
24
|
+
* parser folds into them. This is a floor, not the site policy: a private
|
|
25
|
+
* or loopback address is left to the operator's site rules, and a DNS name
|
|
26
|
+
* that RESOLVES to a metadata address is the host's to catch after the
|
|
27
|
+
* navigation lands.
|
|
28
|
+
*/
|
|
29
|
+
/** Longest address the tools accept. Longer is not a page anyone meant to name. */
|
|
30
|
+
export const BROWSER_URL_MAX_LENGTH = 8192;
|
|
31
|
+
const ABOUT_BLANK = 'about:blank';
|
|
32
|
+
/** Host names of cloud metadata services. Compared after lowercasing and trailing-dot removal. */
|
|
33
|
+
const METADATA_HOSTNAMES = new Set(['metadata.google.internal', 'metadata', 'metadata.goog']);
|
|
34
|
+
/**
|
|
35
|
+
* IPv4 metadata endpoints: AWS, GCP, Azure, Oracle and DigitalOcean
|
|
36
|
+
* (169.254.169.254), and Alibaba Cloud (100.100.100.200).
|
|
37
|
+
*/
|
|
38
|
+
const METADATA_IPV4 = new Set(['169.254.169.254', '100.100.100.200']);
|
|
39
|
+
/** IPv6 metadata endpoints, in the parser's compressed form. AWS Nitro. */
|
|
40
|
+
const METADATA_IPV6 = new Set(['fd00:ec2::254']);
|
|
41
|
+
function stripTrailingDots(hostname) {
|
|
42
|
+
return hostname.replace(/\.+$/, '');
|
|
43
|
+
}
|
|
44
|
+
/** Eight hextets of a compressed IPv6 literal, or undefined if it is not one. */
|
|
45
|
+
function expandIpv6(address) {
|
|
46
|
+
const halves = address.split('::');
|
|
47
|
+
if (halves.length > 2)
|
|
48
|
+
return undefined;
|
|
49
|
+
const parse = (part) => {
|
|
50
|
+
if (part === undefined || part === '')
|
|
51
|
+
return [];
|
|
52
|
+
const out = [];
|
|
53
|
+
for (const piece of part.split(':')) {
|
|
54
|
+
if (!/^[0-9a-f]{1,4}$/.test(piece))
|
|
55
|
+
return undefined;
|
|
56
|
+
out.push(Number.parseInt(piece, 16));
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
};
|
|
60
|
+
const head = parse(halves[0]);
|
|
61
|
+
const tail = parse(halves[1]);
|
|
62
|
+
if (!head || !tail)
|
|
63
|
+
return undefined;
|
|
64
|
+
if (halves.length === 1)
|
|
65
|
+
return head.length === 8 ? head : undefined;
|
|
66
|
+
const fill = 8 - head.length - tail.length;
|
|
67
|
+
if (fill < 1)
|
|
68
|
+
return undefined;
|
|
69
|
+
return [...head, ...new Array(fill).fill(0), ...tail];
|
|
70
|
+
}
|
|
71
|
+
function ipv4Of(high, low) {
|
|
72
|
+
return `${high >>> 8}.${high & 0xff}.${low >>> 8}.${low & 0xff}`;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* IPv4 addresses an IPv6 literal carries in a well-known embedding: mapped
|
|
76
|
+
* (`::ffff:a.b.c.d`), compatible (`::a.b.c.d`), SIIT (`::ffff:0:a.b.c.d`),
|
|
77
|
+
* NAT64 (`64:ff9b::/96`, `64:ff9b:1::/48`) and 6to4 (`2002:AABB:CCDD::`).
|
|
78
|
+
* Each is a way to reach the IPv4 address from an IPv6 spelling.
|
|
79
|
+
*/
|
|
80
|
+
function embeddedIpv4(h) {
|
|
81
|
+
const out = [];
|
|
82
|
+
const zero = (from, to) => h.slice(from, to).every((x) => x === 0);
|
|
83
|
+
const last = ipv4Of(h[6] ?? 0, h[7] ?? 0);
|
|
84
|
+
if (zero(0, 5) && (h[5] === 0xffff || h[5] === 0))
|
|
85
|
+
out.push(last);
|
|
86
|
+
if (zero(0, 4) && h[4] === 0xffff && h[5] === 0)
|
|
87
|
+
out.push(last);
|
|
88
|
+
if (h[0] === 0x64 && h[1] === 0xff9b)
|
|
89
|
+
out.push(last);
|
|
90
|
+
if (h[0] === 0x2002)
|
|
91
|
+
out.push(ipv4Of(h[1] ?? 0, h[2] ?? 0));
|
|
92
|
+
return out;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Is this host a cloud metadata endpoint, in any spelling the URL parser
|
|
96
|
+
* folds into one? `hostname` is a URL's `hostname` (IPv6 in brackets) or a
|
|
97
|
+
* bare name or address.
|
|
98
|
+
*/
|
|
99
|
+
export function isCloudMetadataHost(hostname) {
|
|
100
|
+
let host = stripTrailingDots(hostname.trim().toLowerCase());
|
|
101
|
+
if (host === '')
|
|
102
|
+
return false;
|
|
103
|
+
// Let the WHATWG parser fold every IPv4 and IPv6 spelling into one.
|
|
104
|
+
const bracketed = host.startsWith('[') ? host : host.includes(':') ? `[${host}]` : host;
|
|
105
|
+
try {
|
|
106
|
+
host = stripTrailingDots(new URL(`http://${bracketed}/`).hostname);
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
if (METADATA_HOSTNAMES.has(host) || METADATA_IPV4.has(host))
|
|
112
|
+
return true;
|
|
113
|
+
if (!host.startsWith('['))
|
|
114
|
+
return false;
|
|
115
|
+
const v6 = host.slice(1, -1);
|
|
116
|
+
if (METADATA_IPV6.has(v6))
|
|
117
|
+
return true;
|
|
118
|
+
const hextets = expandIpv6(v6);
|
|
119
|
+
if (!hextets)
|
|
120
|
+
return false;
|
|
121
|
+
return embeddedIpv4(hextets).some((v4) => METADATA_IPV4.has(v4));
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The one spelling of an address the browser may be sent to, or why not.
|
|
125
|
+
*
|
|
126
|
+
* Accepts absolute `http:` and `https:` URLs and `about:blank`. See the
|
|
127
|
+
* module comment for what is folded and what is refused.
|
|
128
|
+
*/
|
|
129
|
+
export function canonicalizeBrowserUrl(raw) {
|
|
130
|
+
if (typeof raw !== 'string' || raw.trim() === '')
|
|
131
|
+
return { ok: false, reason: 'the address is empty' };
|
|
132
|
+
if (raw.length > BROWSER_URL_MAX_LENGTH)
|
|
133
|
+
return { ok: false, reason: `the address is longer than ${BROWSER_URL_MAX_LENGTH} characters` };
|
|
134
|
+
let url;
|
|
135
|
+
try {
|
|
136
|
+
url = new URL(raw.trim());
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
return {
|
|
140
|
+
ok: false,
|
|
141
|
+
reason: 'the address is not an absolute URL; give the full https:// address',
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
if (url.protocol === 'about:') {
|
|
145
|
+
if (url.pathname.toLowerCase() === 'blank' && url.search === '' && url.hash === '')
|
|
146
|
+
return { ok: true, url: ABOUT_BLANK, origin: 'null' };
|
|
147
|
+
return { ok: false, reason: 'only about:blank is allowed among about: addresses' };
|
|
148
|
+
}
|
|
149
|
+
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
|
|
150
|
+
return {
|
|
151
|
+
ok: false,
|
|
152
|
+
reason: `the scheme "${url.protocol}" is not allowed; only http and https addresses (and about:blank) can be opened`,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
if (url.username !== '' || url.password !== '') {
|
|
156
|
+
return {
|
|
157
|
+
ok: false,
|
|
158
|
+
reason: 'the address carries a user name or password (user@host); credentials never go in an address — open the site and let the user sign in',
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
const host = stripTrailingDots(url.hostname);
|
|
162
|
+
if (host === '')
|
|
163
|
+
return { ok: false, reason: 'the address has no host' };
|
|
164
|
+
if (host !== url.hostname) {
|
|
165
|
+
url.hostname = host;
|
|
166
|
+
// The setter re-parses; a host that did not survive is not one to open.
|
|
167
|
+
if (stripTrailingDots(url.hostname) !== host)
|
|
168
|
+
return { ok: false, reason: 'the address host could not be canonicalised' };
|
|
169
|
+
}
|
|
170
|
+
if (isCloudMetadataHost(url.hostname)) {
|
|
171
|
+
return {
|
|
172
|
+
ok: false,
|
|
173
|
+
reason: `${url.hostname} is a cloud metadata endpoint, which the browser never opens`,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
return { ok: true, url: url.href, origin: url.origin };
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The canonical origin (`scheme://host[:port]`) a `browser_act` call names,
|
|
180
|
+
* or why it is not one. A trailing `/` is accepted; a path, query or fragment
|
|
181
|
+
* is not — the argument is an origin, copied from the snapshot header.
|
|
182
|
+
*/
|
|
183
|
+
export function canonicalizeBrowserOrigin(raw) {
|
|
184
|
+
const verdict = canonicalizeBrowserUrl(raw);
|
|
185
|
+
if (!verdict.ok)
|
|
186
|
+
return verdict;
|
|
187
|
+
if (verdict.url === ABOUT_BLANK)
|
|
188
|
+
return { ok: false, reason: 'about:blank has no origin to act on; open a page first' };
|
|
189
|
+
const url = new URL(verdict.url);
|
|
190
|
+
if (url.pathname !== '/' || url.search !== '' || url.hash !== '') {
|
|
191
|
+
return {
|
|
192
|
+
ok: false,
|
|
193
|
+
reason: `"${raw}" is a URL, not an origin; copy the origin from the snapshot header (${url.origin})`,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
return { ok: true, origin: verdict.origin };
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* The canonical spelling of a site key an operator or a job grants —
|
|
200
|
+
* `https://github.com`, `https://*.example.com`, `http://localhost:*` — or
|
|
201
|
+
* why it is not one.
|
|
202
|
+
*
|
|
203
|
+
* The scheme is literal (`http` or `https`). The host may begin with `*.`,
|
|
204
|
+
* meaning one or more labels in front of the rest. The port may be `*`, any
|
|
205
|
+
* port; a default port is dropped. The host is lowercased and punycoded like
|
|
206
|
+
* a URL's. A bare `*`, a path, credentials and metadata hosts are refused.
|
|
207
|
+
*/
|
|
208
|
+
export function canonicalizeBrowserSitePattern(raw) {
|
|
209
|
+
const trimmed = typeof raw === 'string' ? raw.trim() : '';
|
|
210
|
+
const match = /^([a-zA-Z][a-zA-Z0-9+.-]*):\/\/(\*\.)?([^/:?#@]+)(?::(\d{1,5}|\*))?\/?$/.exec(trimmed);
|
|
211
|
+
if (!match) {
|
|
212
|
+
return {
|
|
213
|
+
ok: false,
|
|
214
|
+
reason: `"${raw}" is not a site; write scheme://host, optionally *.host and :port or :*, with no path`,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
if ((match[3] ?? '').includes('*')) {
|
|
218
|
+
return {
|
|
219
|
+
ok: false,
|
|
220
|
+
reason: `"${raw}" has a wildcard inside the host; a wildcard may only be a leading *. before a domain`,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
const scheme = (match[1] ?? '').toLowerCase();
|
|
224
|
+
const wildcard = match[2] !== undefined;
|
|
225
|
+
const port = match[4];
|
|
226
|
+
if (scheme !== 'http' && scheme !== 'https')
|
|
227
|
+
return { ok: false, reason: `the scheme "${scheme}:" is not allowed; only http and https` };
|
|
228
|
+
const probe = canonicalizeBrowserOrigin(`${scheme}://${match[3]}${port !== undefined && port !== '*' ? `:${port}` : ''}`);
|
|
229
|
+
if (!probe.ok)
|
|
230
|
+
return { ok: false, reason: probe.reason };
|
|
231
|
+
const probeUrl = new URL(probe.origin);
|
|
232
|
+
if (wildcard &&
|
|
233
|
+
(probeUrl.hostname.startsWith('[') || /^\d+(?:\.\d+){3}$/.test(probeUrl.hostname))) {
|
|
234
|
+
return { ok: false, reason: 'a wildcard cannot precede an IP address' };
|
|
235
|
+
}
|
|
236
|
+
const host = `${wildcard ? '*.' : ''}${probeUrl.hostname}`;
|
|
237
|
+
const portPart = port === '*' ? ':*' : probeUrl.port !== '' ? `:${probeUrl.port}` : '';
|
|
238
|
+
return { ok: true, pattern: `${scheme}://${host}${portPart}` };
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=browser-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-url.js","sourceRoot":"","sources":["../../../src/tools/builtins/browser-url.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAUH,mFAAmF;AACnF,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAA;AAE1C,MAAM,WAAW,GAAG,aAAa,CAAA;AAEjC,kGAAkG;AAClG,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,0BAA0B,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC,CAAA;AAE7F;;;GAGG;AACH,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,CAAA;AAErE,2EAA2E;AAC3E,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,eAAe,CAAC,CAAC,CAAA;AAEhD,SAAS,iBAAiB,CA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