@namzu/sdk 44.3.0 → 45.1.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.
Files changed (271) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/dist/authorization/command-line.d.ts +66 -19
  3. package/dist/authorization/command-line.d.ts.map +1 -1
  4. package/dist/authorization/command-line.js +130 -270
  5. package/dist/authorization/command-line.js.map +1 -1
  6. package/dist/authorization/gate.d.ts +7 -0
  7. package/dist/authorization/gate.d.ts.map +1 -1
  8. package/dist/authorization/gate.js +13 -3
  9. package/dist/authorization/gate.js.map +1 -1
  10. package/dist/authorization/rules.d.ts +10 -1
  11. package/dist/authorization/rules.d.ts.map +1 -1
  12. package/dist/authorization/rules.js +55 -8
  13. package/dist/authorization/rules.js.map +1 -1
  14. package/dist/authorization/shell-lexer.d.ts +152 -0
  15. package/dist/authorization/shell-lexer.d.ts.map +1 -0
  16. package/dist/authorization/shell-lexer.js +2156 -0
  17. package/dist/authorization/shell-lexer.js.map +1 -0
  18. package/dist/authorization/skill-grant.d.ts +182 -0
  19. package/dist/authorization/skill-grant.d.ts.map +1 -0
  20. package/dist/authorization/skill-grant.js +314 -0
  21. package/dist/authorization/skill-grant.js.map +1 -0
  22. package/dist/bridge/a2a/mapper.d.ts.map +1 -1
  23. package/dist/bridge/a2a/mapper.js +2 -0
  24. package/dist/bridge/a2a/mapper.js.map +1 -1
  25. package/dist/bridge/sse/mapper.d.ts.map +1 -1
  26. package/dist/bridge/sse/mapper.js +1 -0
  27. package/dist/bridge/sse/mapper.js.map +1 -1
  28. package/dist/directory/types.d.ts +2 -0
  29. package/dist/directory/types.d.ts.map +1 -1
  30. package/dist/directory/types.js.map +1 -1
  31. package/dist/manager/resident/outbox.d.ts +4 -4
  32. package/dist/persona/assembler.d.ts.map +1 -1
  33. package/dist/persona/assembler.js +5 -2
  34. package/dist/persona/assembler.js.map +1 -1
  35. package/dist/prompt/coding-agent-doctrine.d.ts +1 -1
  36. package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
  37. package/dist/prompt/coding-agent-doctrine.js +1 -0
  38. package/dist/prompt/coding-agent-doctrine.js.map +1 -1
  39. package/dist/public-runtime.d.ts +5 -1
  40. package/dist/public-runtime.d.ts.map +1 -1
  41. package/dist/public-runtime.js +15 -1
  42. package/dist/public-runtime.js.map +1 -1
  43. package/dist/public-tools.d.ts +4 -0
  44. package/dist/public-tools.d.ts.map +1 -1
  45. package/dist/public-tools.js +12 -1
  46. package/dist/public-tools.js.map +1 -1
  47. package/dist/public-types.d.ts +9 -1
  48. package/dist/public-types.d.ts.map +1 -1
  49. package/dist/runtime/jobs/registry.d.ts +2 -2
  50. package/dist/runtime/jobs/registry.d.ts.map +1 -1
  51. package/dist/runtime/jobs/registry.js +6 -2
  52. package/dist/runtime/jobs/registry.js.map +1 -1
  53. package/dist/runtime/query/declined.d.ts +12 -0
  54. package/dist/runtime/query/declined.d.ts.map +1 -0
  55. package/dist/runtime/query/declined.js +12 -0
  56. package/dist/runtime/query/declined.js.map +1 -0
  57. package/dist/runtime/query/executor.d.ts +36 -40
  58. package/dist/runtime/query/executor.d.ts.map +1 -1
  59. package/dist/runtime/query/executor.js +95 -53
  60. package/dist/runtime/query/executor.js.map +1 -1
  61. package/dist/runtime/query/index.d.ts.map +1 -1
  62. package/dist/runtime/query/index.js +8 -0
  63. package/dist/runtime/query/index.js.map +1 -1
  64. package/dist/runtime/query/iteration/index.d.ts.map +1 -1
  65. package/dist/runtime/query/iteration/index.js +13 -0
  66. package/dist/runtime/query/iteration/index.js.map +1 -1
  67. package/dist/runtime/query/iteration/phases/context.d.ts +13 -0
  68. package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
  69. package/dist/runtime/query/iteration/phases/context.js.map +1 -1
  70. package/dist/runtime/query/iteration/phases/handoff.d.ts +22 -0
  71. package/dist/runtime/query/iteration/phases/handoff.d.ts.map +1 -0
  72. package/dist/runtime/query/iteration/phases/handoff.js +65 -0
  73. package/dist/runtime/query/iteration/phases/handoff.js.map +1 -0
  74. package/dist/runtime/query/iteration/phases/index.d.ts +1 -0
  75. package/dist/runtime/query/iteration/phases/index.d.ts.map +1 -1
  76. package/dist/runtime/query/iteration/phases/index.js +1 -0
  77. package/dist/runtime/query/iteration/phases/index.js.map +1 -1
  78. package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
  79. package/dist/runtime/query/iteration/phases/tool-review.js +56 -3
  80. package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
  81. package/dist/runtime/query/resume-pending.d.ts.map +1 -1
  82. package/dist/runtime/query/resume-pending.js +3 -2
  83. package/dist/runtime/query/resume-pending.js.map +1 -1
  84. package/dist/runtime/query/review-policy.d.ts +11 -0
  85. package/dist/runtime/query/review-policy.d.ts.map +1 -1
  86. package/dist/runtime/query/review-policy.js +36 -3
  87. package/dist/runtime/query/review-policy.js.map +1 -1
  88. package/dist/runtime/query/tooling.d.ts +3 -0
  89. package/dist/runtime/query/tooling.d.ts.map +1 -1
  90. package/dist/runtime/query/tooling.js +1 -0
  91. package/dist/runtime/query/tooling.js.map +1 -1
  92. package/dist/schedules/cron.d.ts +21 -0
  93. package/dist/schedules/cron.d.ts.map +1 -0
  94. package/dist/schedules/cron.js +167 -0
  95. package/dist/schedules/cron.js.map +1 -0
  96. package/dist/schedules/describe.d.ts +14 -0
  97. package/dist/schedules/describe.d.ts.map +1 -0
  98. package/dist/schedules/describe.js +133 -0
  99. package/dist/schedules/describe.js.map +1 -0
  100. package/dist/schedules/errors.d.ts +11 -0
  101. package/dist/schedules/errors.d.ts.map +1 -0
  102. package/dist/schedules/errors.js +15 -0
  103. package/dist/schedules/errors.js.map +1 -0
  104. package/dist/schedules/evaluate.d.ts +35 -0
  105. package/dist/schedules/evaluate.d.ts.map +1 -0
  106. package/dist/schedules/evaluate.js +158 -0
  107. package/dist/schedules/evaluate.js.map +1 -0
  108. package/dist/schedules/index.d.ts +11 -0
  109. package/dist/schedules/index.d.ts.map +1 -0
  110. package/dist/schedules/index.js +8 -0
  111. package/dist/schedules/index.js.map +1 -0
  112. package/dist/schedules/next-fire.d.ts +50 -0
  113. package/dist/schedules/next-fire.d.ts.map +1 -0
  114. package/dist/schedules/next-fire.js +250 -0
  115. package/dist/schedules/next-fire.js.map +1 -0
  116. package/dist/schedules/spec.d.ts +30 -0
  117. package/dist/schedules/spec.d.ts.map +1 -0
  118. package/dist/schedules/spec.js +169 -0
  119. package/dist/schedules/spec.js.map +1 -0
  120. package/dist/schedules/types.d.ts +144 -0
  121. package/dist/schedules/types.d.ts.map +1 -0
  122. package/dist/schedules/types.js +11 -0
  123. package/dist/schedules/types.js.map +1 -0
  124. package/dist/schedules/tz.d.ts +44 -0
  125. package/dist/schedules/tz.d.ts.map +1 -0
  126. package/dist/schedules/tz.js +141 -0
  127. package/dist/schedules/tz.js.map +1 -0
  128. package/dist/skills/index.d.ts +1 -1
  129. package/dist/skills/index.d.ts.map +1 -1
  130. package/dist/skills/index.js +1 -1
  131. package/dist/skills/index.js.map +1 -1
  132. package/dist/skills/loader.d.ts +21 -0
  133. package/dist/skills/loader.d.ts.map +1 -1
  134. package/dist/skills/loader.js +51 -1
  135. package/dist/skills/loader.js.map +1 -1
  136. package/dist/tools/builtins/bash.d.ts.map +1 -1
  137. package/dist/tools/builtins/bash.js +18 -6
  138. package/dist/tools/builtins/bash.js.map +1 -1
  139. package/dist/tools/builtins/browser-url.d.ts +83 -0
  140. package/dist/tools/builtins/browser-url.d.ts.map +1 -0
  141. package/dist/tools/builtins/browser-url.js +240 -0
  142. package/dist/tools/builtins/browser-url.js.map +1 -0
  143. package/dist/tools/builtins/browser.d.ts +367 -0
  144. package/dist/tools/builtins/browser.d.ts.map +1 -0
  145. package/dist/tools/builtins/browser.js +704 -0
  146. package/dist/tools/builtins/browser.js.map +1 -0
  147. package/dist/tools/builtins/skill.d.ts +2 -9
  148. package/dist/tools/builtins/skill.d.ts.map +1 -1
  149. package/dist/tools/builtins/skill.js +74 -51
  150. package/dist/tools/builtins/skill.js.map +1 -1
  151. package/dist/tools/command-shell.d.ts +90 -0
  152. package/dist/tools/command-shell.d.ts.map +1 -0
  153. package/dist/tools/command-shell.js +129 -0
  154. package/dist/tools/command-shell.js.map +1 -0
  155. package/dist/tools/defineTool.d.ts +13 -0
  156. package/dist/tools/defineTool.d.ts.map +1 -1
  157. package/dist/tools/defineTool.js +30 -1
  158. package/dist/tools/defineTool.js.map +1 -1
  159. package/dist/tools/schedules/index.d.ts +5 -0
  160. package/dist/tools/schedules/index.d.ts.map +1 -0
  161. package/dist/tools/schedules/index.js +4 -0
  162. package/dist/tools/schedules/index.js.map +1 -0
  163. package/dist/tools/schedules/loop-tool.d.ts +14 -0
  164. package/dist/tools/schedules/loop-tool.d.ts.map +1 -0
  165. package/dist/tools/schedules/loop-tool.js +81 -0
  166. package/dist/tools/schedules/loop-tool.js.map +1 -0
  167. package/dist/tools/schedules/present.d.ts +16 -0
  168. package/dist/tools/schedules/present.d.ts.map +1 -0
  169. package/dist/tools/schedules/present.js +69 -0
  170. package/dist/tools/schedules/present.js.map +1 -0
  171. package/dist/tools/schedules/prompt-scan.d.ts +17 -0
  172. package/dist/tools/schedules/prompt-scan.d.ts.map +1 -0
  173. package/dist/tools/schedules/prompt-scan.js +92 -0
  174. package/dist/tools/schedules/prompt-scan.js.map +1 -0
  175. package/dist/tools/schedules/schedule-tool.d.ts +16 -0
  176. package/dist/tools/schedules/schedule-tool.d.ts.map +1 -0
  177. package/dist/tools/schedules/schedule-tool.js +327 -0
  178. package/dist/tools/schedules/schedule-tool.js.map +1 -0
  179. package/dist/tools/schedules/types.d.ts +184 -0
  180. package/dist/tools/schedules/types.d.ts.map +1 -0
  181. package/dist/tools/schedules/types.js +11 -0
  182. package/dist/tools/schedules/types.js.map +1 -0
  183. package/dist/types/authorization/index.d.ts +86 -9
  184. package/dist/types/authorization/index.d.ts.map +1 -1
  185. package/dist/types/authorization/index.js +11 -1
  186. package/dist/types/authorization/index.js.map +1 -1
  187. package/dist/types/browser/index.d.ts +280 -0
  188. package/dist/types/browser/index.d.ts.map +1 -0
  189. package/dist/types/browser/index.js +12 -0
  190. package/dist/types/browser/index.js.map +1 -0
  191. package/dist/types/hitl/index.d.ts +23 -0
  192. package/dist/types/hitl/index.d.ts.map +1 -1
  193. package/dist/types/hitl/index.js.map +1 -1
  194. package/dist/types/session/events.d.ts +6 -0
  195. package/dist/types/session/events.d.ts.map +1 -1
  196. package/dist/types/session/events.js.map +1 -1
  197. package/dist/types/session/records.d.ts +23 -0
  198. package/dist/types/session/records.d.ts.map +1 -1
  199. package/dist/types/session/records.js +9 -0
  200. package/dist/types/session/records.js.map +1 -1
  201. package/dist/types/tool/index.d.ts +108 -5
  202. package/dist/types/tool/index.d.ts.map +1 -1
  203. package/dist/types/tool/index.js.map +1 -1
  204. package/dist/types/tool/presentation.d.ts +7 -0
  205. package/dist/types/tool/presentation.d.ts.map +1 -1
  206. package/dist/utils/frontmatter.d.ts +35 -3
  207. package/dist/utils/frontmatter.d.ts.map +1 -1
  208. package/dist/utils/frontmatter.js +45 -5
  209. package/dist/utils/frontmatter.js.map +1 -1
  210. package/dist/utils/id.d.ts +8 -0
  211. package/dist/utils/id.d.ts.map +1 -1
  212. package/dist/utils/id.js +12 -0
  213. package/dist/utils/id.js.map +1 -1
  214. package/package.json +1 -1
  215. package/src/authorization/command-line.ts +148 -293
  216. package/src/authorization/gate.ts +22 -2
  217. package/src/authorization/rules.ts +67 -8
  218. package/src/authorization/shell-lexer.ts +2349 -0
  219. package/src/authorization/skill-grant.ts +400 -0
  220. package/src/bridge/a2a/mapper.ts +2 -0
  221. package/src/bridge/sse/mapper.ts +1 -0
  222. package/src/directory/types.ts +2 -0
  223. package/src/persona/assembler.ts +5 -2
  224. package/src/prompt/coding-agent-doctrine.ts +1 -0
  225. package/src/public-runtime.ts +37 -0
  226. package/src/public-tools.ts +37 -1
  227. package/src/public-types.ts +57 -0
  228. package/src/runtime/jobs/registry.ts +19 -11
  229. package/src/runtime/query/declined.ts +12 -0
  230. package/src/runtime/query/executor.ts +116 -56
  231. package/src/runtime/query/index.ts +8 -0
  232. package/src/runtime/query/iteration/index.ts +13 -0
  233. package/src/runtime/query/iteration/phases/context.ts +13 -0
  234. package/src/runtime/query/iteration/phases/handoff.ts +74 -0
  235. package/src/runtime/query/iteration/phases/index.ts +1 -0
  236. package/src/runtime/query/iteration/phases/tool-review.ts +55 -3
  237. package/src/runtime/query/resume-pending.ts +3 -2
  238. package/src/runtime/query/review-policy.ts +57 -3
  239. package/src/runtime/query/tooling.ts +4 -0
  240. package/src/schedules/cron.ts +202 -0
  241. package/src/schedules/describe.ts +138 -0
  242. package/src/schedules/errors.ts +15 -0
  243. package/src/schedules/evaluate.ts +178 -0
  244. package/src/schedules/index.ts +18 -0
  245. package/src/schedules/next-fire.ts +257 -0
  246. package/src/schedules/spec.ts +210 -0
  247. package/src/schedules/types.ts +163 -0
  248. package/src/schedules/tz.ts +155 -0
  249. package/src/skills/index.ts +1 -1
  250. package/src/skills/loader.ts +59 -1
  251. package/src/tools/builtins/bash.ts +24 -6
  252. package/src/tools/builtins/browser-url.ts +251 -0
  253. package/src/tools/builtins/browser.ts +817 -0
  254. package/src/tools/builtins/skill.ts +92 -53
  255. package/src/tools/command-shell.ts +166 -0
  256. package/src/tools/defineTool.ts +36 -1
  257. package/src/tools/schedules/index.ts +4 -0
  258. package/src/tools/schedules/loop-tool.ts +85 -0
  259. package/src/tools/schedules/present.ts +86 -0
  260. package/src/tools/schedules/prompt-scan.ts +96 -0
  261. package/src/tools/schedules/schedule-tool.ts +376 -0
  262. package/src/tools/schedules/types.ts +197 -0
  263. package/src/types/authorization/index.ts +60 -2
  264. package/src/types/browser/index.ts +341 -0
  265. package/src/types/hitl/index.ts +21 -0
  266. package/src/types/session/events.ts +6 -0
  267. package/src/types/session/records.ts +10 -0
  268. package/src/types/tool/index.ts +109 -5
  269. package/src/types/tool/presentation.ts +7 -0
  270. package/src/utils/frontmatter.ts +81 -5
  271. 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"}