@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,367 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { BrowserHost, BrowserHostError, BrowserPageInfo } from '../../types/browser/index.js';
|
|
3
|
+
import type { ToolDefinition } from '../../types/tool/index.js';
|
|
4
|
+
export declare const BROWSER_TOOL_NAME: "browser";
|
|
5
|
+
export declare const BROWSER_ACT_TOOL_NAME: "browser_act";
|
|
6
|
+
declare const observeSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
|
|
7
|
+
action: z.ZodLiteral<"navigate">;
|
|
8
|
+
url: z.ZodEffects<z.ZodString, string, string>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
action: "navigate";
|
|
11
|
+
url: string;
|
|
12
|
+
}, {
|
|
13
|
+
action: "navigate";
|
|
14
|
+
url: string;
|
|
15
|
+
}>, z.ZodObject<{
|
|
16
|
+
action: z.ZodLiteral<"back">;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
action: "back";
|
|
19
|
+
}, {
|
|
20
|
+
action: "back";
|
|
21
|
+
}>, z.ZodObject<{
|
|
22
|
+
action: z.ZodLiteral<"forward">;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
action: "forward";
|
|
25
|
+
}, {
|
|
26
|
+
action: "forward";
|
|
27
|
+
}>, z.ZodObject<{
|
|
28
|
+
action: z.ZodLiteral<"reload">;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
action: "reload";
|
|
31
|
+
}, {
|
|
32
|
+
action: "reload";
|
|
33
|
+
}>, z.ZodObject<{
|
|
34
|
+
action: z.ZodLiteral<"snapshot">;
|
|
35
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
36
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
action: "snapshot";
|
|
39
|
+
cursor?: string | undefined;
|
|
40
|
+
ref?: string | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
action: "snapshot";
|
|
43
|
+
cursor?: string | undefined;
|
|
44
|
+
ref?: string | undefined;
|
|
45
|
+
}>, z.ZodObject<{
|
|
46
|
+
action: z.ZodLiteral<"screenshot">;
|
|
47
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
48
|
+
fullPage: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
action: "screenshot";
|
|
51
|
+
ref?: string | undefined;
|
|
52
|
+
fullPage?: boolean | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
action: "screenshot";
|
|
55
|
+
ref?: string | undefined;
|
|
56
|
+
fullPage?: boolean | undefined;
|
|
57
|
+
}>, z.ZodObject<{
|
|
58
|
+
action: z.ZodLiteral<"scroll">;
|
|
59
|
+
direction: z.ZodEnum<["up", "down", "left", "right"]>;
|
|
60
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
61
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
action: "scroll";
|
|
64
|
+
direction: "left" | "right" | "up" | "down";
|
|
65
|
+
amount?: number | undefined;
|
|
66
|
+
ref?: string | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
action: "scroll";
|
|
69
|
+
direction: "left" | "right" | "up" | "down";
|
|
70
|
+
amount?: number | undefined;
|
|
71
|
+
ref?: string | undefined;
|
|
72
|
+
}>, z.ZodObject<{
|
|
73
|
+
action: z.ZodLiteral<"wait_for">;
|
|
74
|
+
text: z.ZodOptional<z.ZodString>;
|
|
75
|
+
textGone: z.ZodOptional<z.ZodString>;
|
|
76
|
+
timeMs: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
action: "wait_for";
|
|
79
|
+
text?: string | undefined;
|
|
80
|
+
textGone?: string | undefined;
|
|
81
|
+
timeMs?: number | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
action: "wait_for";
|
|
84
|
+
text?: string | undefined;
|
|
85
|
+
textGone?: string | undefined;
|
|
86
|
+
timeMs?: number | undefined;
|
|
87
|
+
}>, z.ZodObject<{
|
|
88
|
+
action: z.ZodLiteral<"tabs">;
|
|
89
|
+
op: z.ZodEnum<["list", "select", "close", "new"]>;
|
|
90
|
+
tab: z.ZodOptional<z.ZodString>;
|
|
91
|
+
url: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
92
|
+
}, "strip", z.ZodTypeAny, {
|
|
93
|
+
action: "tabs";
|
|
94
|
+
op: "close" | "list" | "select" | "new";
|
|
95
|
+
url?: string | undefined;
|
|
96
|
+
tab?: string | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
action: "tabs";
|
|
99
|
+
op: "close" | "list" | "select" | "new";
|
|
100
|
+
url?: string | undefined;
|
|
101
|
+
tab?: string | undefined;
|
|
102
|
+
}>]>, {
|
|
103
|
+
action: "navigate";
|
|
104
|
+
url: string;
|
|
105
|
+
} | {
|
|
106
|
+
action: "back";
|
|
107
|
+
} | {
|
|
108
|
+
action: "forward";
|
|
109
|
+
} | {
|
|
110
|
+
action: "reload";
|
|
111
|
+
} | {
|
|
112
|
+
action: "snapshot";
|
|
113
|
+
cursor?: string | undefined;
|
|
114
|
+
ref?: string | undefined;
|
|
115
|
+
} | {
|
|
116
|
+
action: "screenshot";
|
|
117
|
+
ref?: string | undefined;
|
|
118
|
+
fullPage?: boolean | undefined;
|
|
119
|
+
} | {
|
|
120
|
+
action: "scroll";
|
|
121
|
+
direction: "left" | "right" | "up" | "down";
|
|
122
|
+
amount?: number | undefined;
|
|
123
|
+
ref?: string | undefined;
|
|
124
|
+
} | {
|
|
125
|
+
action: "wait_for";
|
|
126
|
+
text?: string | undefined;
|
|
127
|
+
textGone?: string | undefined;
|
|
128
|
+
timeMs?: number | undefined;
|
|
129
|
+
} | {
|
|
130
|
+
action: "tabs";
|
|
131
|
+
op: "close" | "list" | "select" | "new";
|
|
132
|
+
url?: string | undefined;
|
|
133
|
+
tab?: string | undefined;
|
|
134
|
+
}, {
|
|
135
|
+
action: "navigate";
|
|
136
|
+
url: string;
|
|
137
|
+
} | {
|
|
138
|
+
action: "back";
|
|
139
|
+
} | {
|
|
140
|
+
action: "forward";
|
|
141
|
+
} | {
|
|
142
|
+
action: "reload";
|
|
143
|
+
} | {
|
|
144
|
+
action: "snapshot";
|
|
145
|
+
cursor?: string | undefined;
|
|
146
|
+
ref?: string | undefined;
|
|
147
|
+
} | {
|
|
148
|
+
action: "screenshot";
|
|
149
|
+
ref?: string | undefined;
|
|
150
|
+
fullPage?: boolean | undefined;
|
|
151
|
+
} | {
|
|
152
|
+
action: "scroll";
|
|
153
|
+
direction: "left" | "right" | "up" | "down";
|
|
154
|
+
amount?: number | undefined;
|
|
155
|
+
ref?: string | undefined;
|
|
156
|
+
} | {
|
|
157
|
+
action: "wait_for";
|
|
158
|
+
text?: string | undefined;
|
|
159
|
+
textGone?: string | undefined;
|
|
160
|
+
timeMs?: number | undefined;
|
|
161
|
+
} | {
|
|
162
|
+
action: "tabs";
|
|
163
|
+
op: "close" | "list" | "select" | "new";
|
|
164
|
+
url?: string | undefined;
|
|
165
|
+
tab?: string | undefined;
|
|
166
|
+
}>;
|
|
167
|
+
declare const actSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
|
|
168
|
+
origin: z.ZodEffects<z.ZodString, string, string>;
|
|
169
|
+
snapshot: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
action: z.ZodLiteral<"click">;
|
|
171
|
+
ref: z.ZodString;
|
|
172
|
+
doubleClick: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
+
}, "strip", z.ZodTypeAny, {
|
|
174
|
+
origin: string;
|
|
175
|
+
action: "click";
|
|
176
|
+
ref: string;
|
|
177
|
+
snapshot?: boolean | undefined;
|
|
178
|
+
doubleClick?: boolean | undefined;
|
|
179
|
+
}, {
|
|
180
|
+
origin: string;
|
|
181
|
+
action: "click";
|
|
182
|
+
ref: string;
|
|
183
|
+
snapshot?: boolean | undefined;
|
|
184
|
+
doubleClick?: boolean | undefined;
|
|
185
|
+
}>, z.ZodObject<{
|
|
186
|
+
origin: z.ZodEffects<z.ZodString, string, string>;
|
|
187
|
+
snapshot: z.ZodOptional<z.ZodBoolean>;
|
|
188
|
+
action: z.ZodLiteral<"type">;
|
|
189
|
+
ref: z.ZodString;
|
|
190
|
+
text: z.ZodString;
|
|
191
|
+
submit: z.ZodOptional<z.ZodBoolean>;
|
|
192
|
+
}, "strip", z.ZodTypeAny, {
|
|
193
|
+
text: string;
|
|
194
|
+
origin: string;
|
|
195
|
+
action: "type";
|
|
196
|
+
ref: string;
|
|
197
|
+
snapshot?: boolean | undefined;
|
|
198
|
+
submit?: boolean | undefined;
|
|
199
|
+
}, {
|
|
200
|
+
text: string;
|
|
201
|
+
origin: string;
|
|
202
|
+
action: "type";
|
|
203
|
+
ref: string;
|
|
204
|
+
snapshot?: boolean | undefined;
|
|
205
|
+
submit?: boolean | undefined;
|
|
206
|
+
}>, z.ZodObject<{
|
|
207
|
+
origin: z.ZodEffects<z.ZodString, string, string>;
|
|
208
|
+
snapshot: z.ZodOptional<z.ZodBoolean>;
|
|
209
|
+
action: z.ZodLiteral<"fill_form">;
|
|
210
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
211
|
+
ref: z.ZodString;
|
|
212
|
+
value: z.ZodString;
|
|
213
|
+
}, "strip", z.ZodTypeAny, {
|
|
214
|
+
value: string;
|
|
215
|
+
ref: string;
|
|
216
|
+
}, {
|
|
217
|
+
value: string;
|
|
218
|
+
ref: string;
|
|
219
|
+
}>, "many">;
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
origin: string;
|
|
222
|
+
action: "fill_form";
|
|
223
|
+
fields: {
|
|
224
|
+
value: string;
|
|
225
|
+
ref: string;
|
|
226
|
+
}[];
|
|
227
|
+
snapshot?: boolean | undefined;
|
|
228
|
+
}, {
|
|
229
|
+
origin: string;
|
|
230
|
+
action: "fill_form";
|
|
231
|
+
fields: {
|
|
232
|
+
value: string;
|
|
233
|
+
ref: string;
|
|
234
|
+
}[];
|
|
235
|
+
snapshot?: boolean | undefined;
|
|
236
|
+
}>, z.ZodObject<{
|
|
237
|
+
origin: z.ZodEffects<z.ZodString, string, string>;
|
|
238
|
+
snapshot: z.ZodOptional<z.ZodBoolean>;
|
|
239
|
+
action: z.ZodLiteral<"select">;
|
|
240
|
+
ref: z.ZodString;
|
|
241
|
+
values: z.ZodArray<z.ZodString, "many">;
|
|
242
|
+
}, "strip", z.ZodTypeAny, {
|
|
243
|
+
values: string[];
|
|
244
|
+
origin: string;
|
|
245
|
+
action: "select";
|
|
246
|
+
ref: string;
|
|
247
|
+
snapshot?: boolean | undefined;
|
|
248
|
+
}, {
|
|
249
|
+
values: string[];
|
|
250
|
+
origin: string;
|
|
251
|
+
action: "select";
|
|
252
|
+
ref: string;
|
|
253
|
+
snapshot?: boolean | undefined;
|
|
254
|
+
}>, z.ZodObject<{
|
|
255
|
+
origin: z.ZodEffects<z.ZodString, string, string>;
|
|
256
|
+
snapshot: z.ZodOptional<z.ZodBoolean>;
|
|
257
|
+
action: z.ZodLiteral<"press">;
|
|
258
|
+
key: z.ZodString;
|
|
259
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
260
|
+
}, "strip", z.ZodTypeAny, {
|
|
261
|
+
key: string;
|
|
262
|
+
origin: string;
|
|
263
|
+
action: "press";
|
|
264
|
+
snapshot?: boolean | undefined;
|
|
265
|
+
ref?: string | undefined;
|
|
266
|
+
}, {
|
|
267
|
+
key: string;
|
|
268
|
+
origin: string;
|
|
269
|
+
action: "press";
|
|
270
|
+
snapshot?: boolean | undefined;
|
|
271
|
+
ref?: string | undefined;
|
|
272
|
+
}>, z.ZodObject<{
|
|
273
|
+
origin: z.ZodEffects<z.ZodString, string, string>;
|
|
274
|
+
snapshot: z.ZodOptional<z.ZodBoolean>;
|
|
275
|
+
action: z.ZodLiteral<"hover">;
|
|
276
|
+
ref: z.ZodString;
|
|
277
|
+
}, "strip", z.ZodTypeAny, {
|
|
278
|
+
origin: string;
|
|
279
|
+
action: "hover";
|
|
280
|
+
ref: string;
|
|
281
|
+
snapshot?: boolean | undefined;
|
|
282
|
+
}, {
|
|
283
|
+
origin: string;
|
|
284
|
+
action: "hover";
|
|
285
|
+
ref: string;
|
|
286
|
+
snapshot?: boolean | undefined;
|
|
287
|
+
}>, z.ZodObject<{
|
|
288
|
+
origin: z.ZodEffects<z.ZodString, string, string>;
|
|
289
|
+
snapshot: z.ZodOptional<z.ZodBoolean>;
|
|
290
|
+
action: z.ZodLiteral<"upload">;
|
|
291
|
+
ref: z.ZodString;
|
|
292
|
+
path: z.ZodString;
|
|
293
|
+
}, "strip", z.ZodTypeAny, {
|
|
294
|
+
path: string;
|
|
295
|
+
origin: string;
|
|
296
|
+
action: "upload";
|
|
297
|
+
ref: string;
|
|
298
|
+
snapshot?: boolean | undefined;
|
|
299
|
+
}, {
|
|
300
|
+
path: string;
|
|
301
|
+
origin: string;
|
|
302
|
+
action: "upload";
|
|
303
|
+
ref: string;
|
|
304
|
+
snapshot?: boolean | undefined;
|
|
305
|
+
}>, z.ZodObject<{
|
|
306
|
+
origin: z.ZodEffects<z.ZodString, string, string>;
|
|
307
|
+
snapshot: z.ZodOptional<z.ZodBoolean>;
|
|
308
|
+
action: z.ZodLiteral<"dialog">;
|
|
309
|
+
accept: z.ZodBoolean;
|
|
310
|
+
promptText: z.ZodOptional<z.ZodString>;
|
|
311
|
+
}, "strip", z.ZodTypeAny, {
|
|
312
|
+
origin: string;
|
|
313
|
+
action: "dialog";
|
|
314
|
+
accept: boolean;
|
|
315
|
+
snapshot?: boolean | undefined;
|
|
316
|
+
promptText?: string | undefined;
|
|
317
|
+
}, {
|
|
318
|
+
origin: string;
|
|
319
|
+
action: "dialog";
|
|
320
|
+
accept: boolean;
|
|
321
|
+
snapshot?: boolean | undefined;
|
|
322
|
+
promptText?: string | undefined;
|
|
323
|
+
}>]>;
|
|
324
|
+
/** The `browser` tool's input after canonicalisation. */
|
|
325
|
+
export type BrowserToolInput = z.infer<typeof observeSchema>;
|
|
326
|
+
/** The `browser_act` tool's input after canonicalisation. */
|
|
327
|
+
export type BrowserActToolInput = z.infer<typeof actSchema>;
|
|
328
|
+
/**
|
|
329
|
+
* Whether a `browser` call only observes. Navigation, history moves, reload
|
|
330
|
+
* and opening a tab change what the browser has loaded, and are what a site
|
|
331
|
+
* rule on `url` decides; looking, scrolling, waiting and moving between or
|
|
332
|
+
* closing tabs the browser already holds do not.
|
|
333
|
+
*/
|
|
334
|
+
export declare function isBrowserCallReadOnly(input: BrowserToolInput): boolean;
|
|
335
|
+
/**
|
|
336
|
+
* `Page: <origin> — "<title>" (tab t1)`.
|
|
337
|
+
*
|
|
338
|
+
* The origin is the host's and canonical; the model copies it into
|
|
339
|
+
* `browser_act`. The title is the page's, so it is quoted, cut to one line
|
|
340
|
+
* and stripped of the envelope's delimiter.
|
|
341
|
+
*/
|
|
342
|
+
export declare function formatBrowserPageHeader(page: BrowserPageInfo): string;
|
|
343
|
+
/**
|
|
344
|
+
* The structural error a browser host threw, or undefined. Recognised by
|
|
345
|
+
* shape, so a separately installed host and SDK need not share a class.
|
|
346
|
+
*/
|
|
347
|
+
export declare function browserHostErrorOf(value: unknown): BrowserHostError | undefined;
|
|
348
|
+
/**
|
|
349
|
+
* The browser tools over a {@link BrowserHost}: `browser` (observe and
|
|
350
|
+
* navigate) and `browser_act` (change the page).
|
|
351
|
+
*
|
|
352
|
+
* The split is what makes the gate useful. `browser` calls that only look
|
|
353
|
+
* are read-only; `navigate` and `tabs new` carry a canonical `url` a site
|
|
354
|
+
* rule can match; every `browser_act` call carries the canonical `origin`
|
|
355
|
+
* it means to act on, which a site rule can match and which the host checks
|
|
356
|
+
* against the live page before acting.
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* ```ts sketch
|
|
360
|
+
* import { createBrowserTools } from '@namzu/sdk'
|
|
361
|
+
*
|
|
362
|
+
* for (const tool of createBrowserTools(host)) registry.register(tool)
|
|
363
|
+
* ```
|
|
364
|
+
*/
|
|
365
|
+
export declare function createBrowserTools(host: BrowserHost): [ToolDefinition<BrowserToolInput>, ToolDefinition<BrowserActToolInput>];
|
|
366
|
+
export {};
|
|
367
|
+
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../src/tools/builtins/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAKX,WAAW,EACX,gBAAgB,EAIhB,eAAe,EAGf,MAAM,8BAA8B,CAAA;AAOrC,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,2BAA2B,CAAA;AAO3E,eAAO,MAAM,iBAAiB,EAAG,SAAkB,CAAA;AACnD,eAAO,MAAM,qBAAqB,EAAG,aAAsB,CAAA;AAmC3D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDhB,CAAA;AAOH,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+Cb,CAAA;AAEF,yDAAyD;AACzD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAC5D,6DAA6D;AAC7D,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAyB3D;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAetE;AAqJD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAIrE;AA6FD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,GAAG,SAAS,CAwB/E;AAqND;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CACjC,IAAI,EAAE,WAAW,GACf,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,cAAc,CAAC,mBAAmB,CAAC,CAAC,CAiFzE"}
|