@trusty-squire/mcp 0.9.19-rc.2 → 0.9.19-rc.21

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 (106) hide show
  1. package/README.md +15 -33
  2. package/dist/api-client.d.ts +6 -0
  3. package/dist/api-client.d.ts.map +1 -1
  4. package/dist/api-client.js.map +1 -1
  5. package/dist/bin.js +4 -10
  6. package/dist/bin.js.map +1 -1
  7. package/dist/bot/agent.d.ts +24 -2
  8. package/dist/bot/agent.d.ts.map +1 -1
  9. package/dist/bot/agent.js +634 -55
  10. package/dist/bot/agent.js.map +1 -1
  11. package/dist/bot/browser.d.ts +7 -0
  12. package/dist/bot/browser.d.ts.map +1 -1
  13. package/dist/bot/browser.js +182 -3
  14. package/dist/bot/browser.js.map +1 -1
  15. package/dist/bot/credential-extraction-flow.d.ts +2 -0
  16. package/dist/bot/credential-extraction-flow.d.ts.map +1 -1
  17. package/dist/bot/credential-extraction-flow.js +71 -1
  18. package/dist/bot/credential-extraction-flow.js.map +1 -1
  19. package/dist/bot/form-fill.d.ts.map +1 -1
  20. package/dist/bot/form-fill.js +11 -0
  21. package/dist/bot/form-fill.js.map +1 -1
  22. package/dist/bot/google-login.d.ts.map +1 -1
  23. package/dist/bot/google-login.js +37 -1
  24. package/dist/bot/google-login.js.map +1 -1
  25. package/dist/bot/index.d.ts +1 -0
  26. package/dist/bot/index.d.ts.map +1 -1
  27. package/dist/bot/index.js +1 -0
  28. package/dist/bot/index.js.map +1 -1
  29. package/dist/bot/login-state.d.ts +2 -1
  30. package/dist/bot/login-state.d.ts.map +1 -1
  31. package/dist/bot/login-state.js +22 -5
  32. package/dist/bot/login-state.js.map +1 -1
  33. package/dist/bot/nav-search.d.ts.map +1 -1
  34. package/dist/bot/nav-search.js +9 -0
  35. package/dist/bot/nav-search.js.map +1 -1
  36. package/dist/bot/post-signup-flow.d.ts.map +1 -1
  37. package/dist/bot/post-signup-flow.js +21 -0
  38. package/dist/bot/post-signup-flow.js.map +1 -1
  39. package/dist/bot/post-signup-recovery-state.d.ts +3 -0
  40. package/dist/bot/post-signup-recovery-state.d.ts.map +1 -1
  41. package/dist/bot/post-signup-recovery-state.js +3 -0
  42. package/dist/bot/post-signup-recovery-state.js.map +1 -1
  43. package/dist/bot/provision-session.d.ts +116 -1
  44. package/dist/bot/provision-session.d.ts.map +1 -1
  45. package/dist/bot/provision-session.js +885 -41
  46. package/dist/bot/provision-session.js.map +1 -1
  47. package/dist/bot/redact.d.ts.map +1 -1
  48. package/dist/bot/redact.js +25 -2
  49. package/dist/bot/redact.js.map +1 -1
  50. package/dist/bot/replay-skill.d.ts +6 -0
  51. package/dist/bot/replay-skill.d.ts.map +1 -1
  52. package/dist/bot/replay-skill.js +39 -5
  53. package/dist/bot/replay-skill.js.map +1 -1
  54. package/dist/bot/skill-hint.d.ts +7 -0
  55. package/dist/bot/skill-hint.d.ts.map +1 -0
  56. package/dist/bot/skill-hint.js +105 -0
  57. package/dist/bot/skill-hint.js.map +1 -0
  58. package/dist/bot/terminal-gate.d.ts +3 -1
  59. package/dist/bot/terminal-gate.d.ts.map +1 -1
  60. package/dist/bot/terminal-gate.js +19 -0
  61. package/dist/bot/terminal-gate.js.map +1 -1
  62. package/dist/install/agents.d.ts.map +1 -1
  63. package/dist/install/agents.js +12 -2
  64. package/dist/install/agents.js.map +1 -1
  65. package/dist/install/cli.d.ts +14 -2
  66. package/dist/install/cli.d.ts.map +1 -1
  67. package/dist/install/cli.js +346 -150
  68. package/dist/install/cli.js.map +1 -1
  69. package/dist/install/interactive.d.ts +9 -3
  70. package/dist/install/interactive.d.ts.map +1 -1
  71. package/dist/install/interactive.js +80 -140
  72. package/dist/install/interactive.js.map +1 -1
  73. package/dist/install/proxy-url.d.ts +2 -0
  74. package/dist/install/proxy-url.d.ts.map +1 -0
  75. package/dist/install/proxy-url.js +20 -0
  76. package/dist/install/proxy-url.js.map +1 -0
  77. package/dist/install/ui.js +1 -1
  78. package/dist/install/ui.js.map +1 -1
  79. package/dist/session.d.ts +3 -0
  80. package/dist/session.d.ts.map +1 -1
  81. package/dist/session.js.map +1 -1
  82. package/dist/skill-registry-client.d.ts +8 -0
  83. package/dist/skill-registry-client.d.ts.map +1 -1
  84. package/dist/skill-registry-client.js +70 -53
  85. package/dist/skill-registry-client.js.map +1 -1
  86. package/dist/tools/index.d.ts +1 -2
  87. package/dist/tools/index.d.ts.map +1 -1
  88. package/dist/tools/index.js +10 -19
  89. package/dist/tools/index.js.map +1 -1
  90. package/dist/tools/provision-any.d.ts +3 -0
  91. package/dist/tools/provision-any.d.ts.map +1 -1
  92. package/dist/tools/provision-any.js +162 -32
  93. package/dist/tools/provision-any.js.map +1 -1
  94. package/dist/tools/provision-drive.d.ts +121 -5
  95. package/dist/tools/provision-drive.d.ts.map +1 -1
  96. package/dist/tools/provision-drive.js +339 -48
  97. package/dist/tools/provision-drive.js.map +1 -1
  98. package/dist/tools/store-credential.d.ts +5 -0
  99. package/dist/tools/store-credential.d.ts.map +1 -1
  100. package/dist/tools/store-credential.js +5 -0
  101. package/dist/tools/store-credential.js.map +1 -1
  102. package/package.json +1 -3
  103. package/dist/bot/telegram-notify.d.ts +0 -8
  104. package/dist/bot/telegram-notify.d.ts.map +0 -1
  105. package/dist/bot/telegram-notify.js +0 -134
  106. package/dist/bot/telegram-notify.js.map +0 -1
@@ -1,48 +1,96 @@
1
1
  // Phase 1 — the interactive provisioning tool surface a frontier HOST agent
2
2
  // drives. The host is the planner; these tools are the browser + the moat.
3
3
  // Backed by ../bot/provision-session.ts (the session registry over the existing
4
- // BrowserController substrate). DEFAULT-ON (opt out with PROVISION_DRIVE_TOOLS=0).
4
+ // BrowserController substrate).
5
5
  // Domain-scoping, the write-only-vault de-fang, and a per-action audit log are
6
6
  // in place; the consent-at-install prompt is the remaining hardening.
7
7
  import { z } from "zod";
8
- import { startProvisionSession, observe, act, extractCredentials, captchaGate, awaitVerification, finishProvisionSession, } from "../bot/provision-session.js";
8
+ import { startProvisionSession, observe, act, extractCredentials, captchaGate, awaitVerification, finishProvisionSession, observedHostsForSession, stashSecretSlot, } from "../bot/provision-session.js";
9
+ import { renderSkillHint, serviceSlugFromUrl } from "../bot/skill-hint.js";
10
+ import { clientFromEnv, generateProvisionId } from "../skill-registry-client.js";
11
+ // Best-effort: ask the registry for a known route for this service so the agent
12
+ // drives on rails instead of ad-hoc. Returns undefined on any miss (no skill,
13
+ // no registry configured, network error) — the agent just drives without it.
14
+ async function resolveRouteHint(serviceUrl) {
15
+ try {
16
+ const accountId = process.env.TRUSTY_SQUIRE_ACCOUNT_ID;
17
+ if (accountId === undefined || accountId.length === 0)
18
+ return undefined;
19
+ const client = clientFromEnv(accountId);
20
+ if (client === null)
21
+ return undefined;
22
+ const slug = serviceSlugFromUrl(serviceUrl);
23
+ if (slug === null)
24
+ return undefined;
25
+ const provisionId = generateProvisionId();
26
+ // Try the slug first; fall back to resolving by signup_url host so a
27
+ // custom-named skill (x.ai → "xai-grok") is reachable from its URL.
28
+ let outcome = await client.fetchActiveSkill(slug, provisionId);
29
+ if (outcome.kind !== "found") {
30
+ const host = new URL(serviceUrl).hostname.toLowerCase().replace(/^www\./, "");
31
+ outcome = await client.fetchSkillByHost(host, provisionId);
32
+ }
33
+ return outcome.kind === "found" ? renderSkillHint(outcome.result.skill) : undefined;
34
+ }
35
+ catch {
36
+ return undefined;
37
+ }
38
+ }
9
39
  const startSchema = z.object({
10
40
  service_url: z.string().url(),
41
+ // Multi-app operate tasks declare every host they span up front (GCP Console
42
+ // + Firebase + the user's app). Alias of extra_allowed_hosts; both seed
43
+ // source "start". A single-service signup passes neither.
44
+ allowed_hosts: z.array(z.string().min(1).max(120)).max(20).optional(),
11
45
  extra_allowed_hosts: z.array(z.string().min(1).max(120)).max(10).optional(),
46
+ // Operate tasks that act AS the user (drive a gated app on an existing
47
+ // account) set this so start fails closed to a connect hand-back if no live
48
+ // Google session exists — rather than driving into a mid-task login wall.
49
+ require_live_identity: z.boolean().optional(),
12
50
  });
13
51
  export const provisionStartTool = {
14
- name: "provision_start",
52
+ name: "operate_start",
15
53
  description: "Begin an interactive provisioning session: opens a scoped browser on the " +
16
- "user's machine at service_url and returns {session_id, url, text, elements}. " +
54
+ "user's machine at service_url and returns {session_id, url, text, screen, " +
55
+ "accessibility, elements}. " +
17
56
  "YOU are the planner — read the observation, then drive the signup with " +
18
- "provision_act, re-read with provision_observe, and call provision_extract " +
19
- "when you reach the credentials. Always provision_finish when done. The " +
20
- "browser is domain-scoped to the target + its identity providers.",
57
+ "operate_act, re-read with operate_observe, and call operate_extract " +
58
+ "when you reach the credentials. Always operate_finish when done. The " +
59
+ "browser is domain-scoped to the target + its identity providers. If the " +
60
+ "registry knows this service, the first observation includes a `hint` — the " +
61
+ "route (login method, where the key lives, how many credentials). Read it and " +
62
+ "drive toward it; fall back to your own judgment if the live page diverges.",
21
63
  inputSchema: startSchema,
22
64
  jsonInputSchema: {
23
65
  type: "object",
24
66
  required: ["service_url"],
25
67
  properties: {
26
68
  service_url: { type: "string" },
69
+ allowed_hosts: { type: "array", items: { type: "string" } },
27
70
  extra_allowed_hosts: { type: "array", items: { type: "string" } },
71
+ require_live_identity: { type: "boolean" },
28
72
  },
29
73
  },
30
74
  async handler(args) {
75
+ const hint = await resolveRouteHint(args.service_url);
76
+ const extra = [...(args.allowed_hosts ?? []), ...(args.extra_allowed_hosts ?? [])];
31
77
  return await startProvisionSession({
32
78
  serviceUrl: args.service_url,
33
- ...(args.extra_allowed_hosts !== undefined
34
- ? { extraAllowedHosts: args.extra_allowed_hosts }
35
- : {}),
79
+ ...(extra.length > 0 ? { extraAllowedHosts: extra } : {}),
80
+ ...(args.require_live_identity === true ? { requireLiveIdentity: true } : {}),
81
+ ...(hint !== undefined ? { hint } : {}),
36
82
  });
37
83
  },
38
84
  };
39
85
  const observeSchema = z.object({ session_id: z.string().min(1) });
40
86
  export const provisionObserveTool = {
41
- name: "provision_observe",
87
+ name: "operate_observe",
42
88
  description: "Re-read the current page of a provisioning session: returns {url, text, " +
43
- "elements}. Each element has a `ref` (its visible label) you pass back as a " +
44
- "target, plus `href` for links. Targets are re-resolved live, so refs stay " +
45
- "valid across re-renders.",
89
+ "screen, accessibility, elements}. Each element has a fresh generated `ref` " +
90
+ "to pass back as operate_act.target, plus `label`/`href` for reading. " +
91
+ "Refs are scoped to the latest observation; stale refs fail loudly, so call " +
92
+ "operate_observe and retry with the new ref. Legacy label targets still " +
93
+ "work, but exact refs are safer on pages with repeated labels.",
46
94
  inputSchema: observeSchema,
47
95
  jsonInputSchema: {
48
96
  type: "object",
@@ -55,16 +103,25 @@ export const provisionObserveTool = {
55
103
  };
56
104
  const actSchema = z.object({
57
105
  session_id: z.string().min(1),
58
- kind: z.enum(["click", "js_click", "type", "goto", "press", "oauth_click", "oauth_settle"]),
106
+ kind: z.enum([
107
+ "click", "js_click", "type", "goto", "press", "oauth_click", "oauth_settle",
108
+ "allow_host", "type_secret", "scroll",
109
+ ]),
59
110
  target: z.string().min(1).max(200).optional(),
60
111
  text: z.string().max(4096).optional(),
61
112
  url: z.string().url().optional(),
62
113
  key: z.string().min(1).max(40).optional(),
114
+ // allow_host: a bare hostname to cross into mid-session.
115
+ host: z.string().min(1).max(253).optional(),
116
+ // type_secret: the sealed slot whose value to type into `target`.
117
+ slot: z.string().min(1).max(60).optional(),
118
+ // scroll: which way to move the viewport (default "down").
119
+ direction: z.enum(["down", "up", "bottom", "top"]).optional(),
63
120
  });
64
121
  function buildAction(args) {
65
122
  const need = (v, name) => {
66
123
  if (v === undefined || v.length === 0) {
67
- throw new Error(`provision_act kind="${args.kind}" requires "${name}"`);
124
+ throw new Error(`operate_act kind="${args.kind}" requires "${name}"`);
68
125
  }
69
126
  return v;
70
127
  };
@@ -83,15 +140,28 @@ function buildAction(args) {
83
140
  return { kind: "press", key: need(args.key, "key") };
84
141
  case "oauth_settle":
85
142
  return { kind: "oauth_settle" };
143
+ case "allow_host":
144
+ return { kind: "allow_host", host: need(args.host, "host") };
145
+ case "type_secret":
146
+ return { kind: "type_secret", slot: need(args.slot, "slot"), target: need(args.target, "target") };
147
+ case "scroll":
148
+ return { kind: "scroll", ...(args.direction !== undefined ? { direction: args.direction } : {}) };
86
149
  }
87
150
  }
88
151
  export const provisionActTool = {
89
- name: "provision_act",
152
+ name: "operate_act",
90
153
  description: "Take one action in a provisioning session, then return the resulting " +
91
- "observation. kinds: click (target=element ref), type (target + text), " +
154
+ "observation. kinds: click (target=element ref, preferably elements[].ref), type (target + text), " +
92
155
  "goto (url — domain-scoped), press (key, e.g. Enter), oauth_click (target — " +
93
156
  "use for 'Continue with Google/GitHub' so the popup is adopted), " +
94
- "oauth_settle (return to the product page after the OAuth handshake).",
157
+ "oauth_settle (return to the product page after the OAuth handshake), " +
158
+ "allow_host (host — cross into another app's domain mid-task, e.g. from the " +
159
+ "GCP console into Firebase), type_secret (slot + target — type a secret you " +
160
+ "captured into a sealed slot via operate_extract{into_slot} into a field " +
161
+ "on the current site; the value never leaves the browser), scroll (direction " +
162
+ "down/up/bottom/top, default down — reveal below-the-fold controls on a long " +
163
+ "form, then operate_observe to pick up the newly-visible elements). If a " +
164
+ "target ref is stale, call operate_observe and retry with a fresh ref.",
95
165
  inputSchema: actSchema,
96
166
  jsonInputSchema: {
97
167
  type: "object",
@@ -100,42 +170,186 @@ export const provisionActTool = {
100
170
  session_id: { type: "string" },
101
171
  kind: {
102
172
  type: "string",
103
- enum: ["click", "js_click", "type", "goto", "press", "oauth_click", "oauth_settle"],
173
+ enum: [
174
+ "click", "js_click", "type", "goto", "press", "oauth_click", "oauth_settle",
175
+ "allow_host", "type_secret", "scroll",
176
+ ],
104
177
  },
105
178
  target: { type: "string" },
106
179
  text: { type: "string" },
107
180
  url: { type: "string" },
108
181
  key: { type: "string" },
182
+ host: { type: "string" },
183
+ slot: { type: "string" },
184
+ direction: { type: "string", enum: ["down", "up", "bottom", "top"] },
109
185
  },
110
186
  },
111
187
  async handler(args) {
112
188
  return await act(args.session_id, buildAction(args));
113
189
  },
114
190
  };
115
- const extractSchema = z.object({ session_id: z.string().min(1) });
191
+ // Shared "store this credential in the vault" shape — used by both the
192
+ // mid-session extract tool and the credentials terminal (operate_finish_task).
193
+ const storeShape = z.object({
194
+ service: z.string().min(1).max(120),
195
+ label: z.string().min(1).max(60).optional(),
196
+ env_var_suggestion: z.string().min(1).max(120).optional(),
197
+ type: z.string().min(1).max(60).optional(),
198
+ // Explicit egress hosts: where this key may LATER be sent by the proxy.
199
+ // Read them off the API base URL the page/SDK snippet shows — a grounded
200
+ // read, not a guess. Unioned with the service-default + start/auto_widen
201
+ // scope (never mid_session task scope). Omit for a single-service key.
202
+ egress_hosts: z.array(z.string().min(1).max(253)).max(10).optional(),
203
+ auth_shape: z
204
+ .string()
205
+ .max(120)
206
+ .regex(/^(bearer|header:.+|query:.+)$/, "auth_shape must be bearer|header:<name>|query:<param>")
207
+ .optional(),
208
+ });
209
+ const storeJsonProps = {
210
+ service: { type: "string" },
211
+ label: { type: "string" },
212
+ env_var_suggestion: { type: "string" },
213
+ type: { type: "string" },
214
+ egress_hosts: { type: "array", items: { type: "string" } },
215
+ auth_shape: { type: "string" },
216
+ };
217
+ // Vault-store an extracted credential. Shared by extract + the credentials
218
+ // terminal so the stored record is byte-identical regardless of entry point.
219
+ async function persistExtracted(sessionId, credentials, store, api) {
220
+ const observedHosts = [
221
+ ...new Set([...(store.egress_hosts ?? []), ...observedHostsForSession(sessionId)]),
222
+ ];
223
+ const singleValue = credentials.api_key;
224
+ const storeInput = typeof singleValue === "string" && Object.keys(credentials).length === 1
225
+ ? { value: singleValue }
226
+ : { fields: credentials };
227
+ const stored = await api.storeCredential({
228
+ service: store.service,
229
+ ...(store.label !== undefined ? { label: store.label } : {}),
230
+ ...storeInput,
231
+ ...(store.env_var_suggestion !== undefined ? { env_var_suggestion: store.env_var_suggestion } : {}),
232
+ ...(store.type !== undefined ? { type: store.type } : { type: "api_key" }),
233
+ ...(store.auth_shape !== undefined ? { auth_shape: store.auth_shape } : {}),
234
+ ...(observedHosts.length > 0 ? { observed_hosts: observedHosts } : {}),
235
+ });
236
+ return {
237
+ reference: stored.reference,
238
+ service: stored.service,
239
+ label: stored.label,
240
+ field_names: stored.field_names,
241
+ allowed_hosts: stored.allowed_hosts,
242
+ updated: stored.updated,
243
+ };
244
+ }
245
+ const extractSchema = z.object({
246
+ session_id: z.string().min(1),
247
+ // Sealed transfer: stash the extracted secret in a session-local slot and
248
+ // return ONLY a masked handle (never the value), so a later type_secret can
249
+ // enter it into another site's form without the value crossing to the host.
250
+ into_slot: z.string().min(1).max(60).optional(),
251
+ // Disambiguate WHICH credential to seal when the page shows several (Google's
252
+ // OAuth dialog has both a client ID and a client secret). Matches the
253
+ // credential's field label, e.g. "client secret" / "secret". Omit when there's
254
+ // only one.
255
+ secret_label: z.string().min(1).max(60).optional(),
256
+ store: storeShape.optional(),
257
+ });
116
258
  export const provisionExtractTool = {
117
- name: "provision_extract",
259
+ name: "operate_extract",
118
260
  description: "Reveal masked keys and extract credentials from the current page: returns " +
119
- "{credentials, candidate_count}. credentials may include `api_key` (or " +
120
- "`api_key_truncated` if only a masked display was reachable) plus named " +
121
- "fields for multi-credential services. Call when you have navigated to the " +
122
- "page that shows the keys.",
261
+ "{credentials, candidate_count, blocked_reason?}. credentials may include " +
262
+ "`api_key` (or `api_key_truncated` if only a masked display was reachable) " +
263
+ "plus named fields for multi-credential services. Pass `store` to immediately " +
264
+ "save the extracted credential into the Trusty Squire vault with the session's " +
265
+ "observed hosts as allowed_hosts seed. If `blocked_reason` is set, " +
266
+ "the page is a login wall / anti-bot interstitial with NO credential present " +
267
+ "(do not treat the empty result as a real key) — drive an interactive login " +
268
+ "or hand back to the user. Call when you have navigated to the keys page. " +
269
+ "With `into_slot`, a still-masked value is refused (reveal it first); pass " +
270
+ "`secret_label` (e.g. \"client secret\") to pick the right one when the page " +
271
+ "shows several credentials.",
123
272
  inputSchema: extractSchema,
124
273
  jsonInputSchema: {
125
274
  type: "object",
126
275
  required: ["session_id"],
127
- properties: { session_id: { type: "string" } },
276
+ properties: {
277
+ session_id: { type: "string" },
278
+ into_slot: { type: "string" },
279
+ secret_label: { type: "string" },
280
+ store: {
281
+ type: "object",
282
+ required: ["service"],
283
+ properties: {
284
+ service: { type: "string" },
285
+ label: { type: "string" },
286
+ env_var_suggestion: { type: "string" },
287
+ type: { type: "string" },
288
+ egress_hosts: { type: "array", items: { type: "string" } },
289
+ auth_shape: { type: "string" },
290
+ },
291
+ },
292
+ },
128
293
  },
129
- async handler(args) {
130
- return await extractCredentials(args.session_id);
294
+ async handler(args, api) {
295
+ const extracted = await extractCredentials(args.session_id);
296
+ // Sealed transfer: capture the primary secret into a session-local slot and
297
+ // return ONLY a masked handle. The value never reaches the host. A later
298
+ // type_secret enters it into another site's form. Mutually exclusive with
299
+ // store (a slotted secret is being shuttled, not vaulted, in this call).
300
+ if (args.into_slot !== undefined) {
301
+ const values = extracted.credentials;
302
+ // A still-masked display (Google's OAuth secret shows "GOCSPX-••••" with a
303
+ // copy button) must NOT be sealed — the slot would hold junk. Reject any
304
+ // value with mask glyphs or the truncated-capture marker, and prefer a
305
+ // full value over the masked api_key when the page has both.
306
+ const looksMasked = (v) => v.includes("•") || v.includes("…") || v.includes("***") || /\.{3,}/.test(v);
307
+ const norm = (s) => s.toLowerCase().replace(/[^a-z0-9]/g, "");
308
+ const candidates = Object.entries(values).filter(([k, v]) => !k.endsWith("_truncated") && typeof v === "string" && v.length >= 8 && !looksMasked(v));
309
+ // When the page shows several credentials (Google's client ID + secret),
310
+ // a secret_label picks the right one by field name; otherwise take the
311
+ // first full value. Falling back avoids a hard fail when the label misses.
312
+ const wantKey = args.secret_label !== undefined ? norm(args.secret_label) : null;
313
+ const matched = wantKey !== null ? candidates.find(([k]) => norm(k).includes(wantKey)) : undefined;
314
+ const full = (matched ?? candidates[0])?.[1];
315
+ if (typeof full !== "string" || full.length === 0) {
316
+ return {
317
+ session_id: extracted.session_id,
318
+ url: extracted.url,
319
+ candidate_count: extracted.candidate_count,
320
+ sealed: false,
321
+ slot: null,
322
+ blocked_reason: "the secret is still masked/hidden — reveal it first (click the " +
323
+ "show/reveal/copy control near the key), then operate_extract again",
324
+ };
325
+ }
326
+ const handle = stashSecretSlot(args.session_id, args.into_slot, full);
327
+ // Strip raw credential VALUES from the response — host gets the handle only.
328
+ return {
329
+ session_id: extracted.session_id,
330
+ url: extracted.url,
331
+ candidate_count: extracted.candidate_count,
332
+ sealed: true,
333
+ slot: handle,
334
+ ...(extracted.blocked_reason !== undefined ? { blocked_reason: extracted.blocked_reason } : {}),
335
+ };
336
+ }
337
+ if (args.store === undefined || Object.keys(extracted.credentials).length === 0) {
338
+ return extracted;
339
+ }
340
+ if (api === null) {
341
+ throw new Error("operate_extract store requires an active Trusty Squire session");
342
+ }
343
+ const stored = await persistExtracted(args.session_id, extracted.credentials, args.store, api);
344
+ return { ...extracted, stored_credential: stored };
131
345
  },
132
346
  };
133
347
  const captchaSchema = z.object({ session_id: z.string().min(1) });
134
348
  export const provisionCaptchaGateTool = {
135
- name: "provision_captcha_gate",
349
+ name: "operate_captcha_gate",
136
350
  description: "Detect a captcha and wait for it to clear: returns {found, variant, " +
137
351
  "settled}. Invisible Turnstile/reCAPTCHA-v3 usually clears from the humanized " +
138
- "driving alone; for a visible checkbox, click it with provision_act first, " +
352
+ "driving alone; for a visible checkbox, click it with operate_act first, " +
139
353
  "then call this to wait for the token. settled=false means a challenge is " +
140
354
  "still up (surface captcha_blocked to the user).",
141
355
  inputSchema: captchaSchema,
@@ -151,27 +365,111 @@ export const provisionCaptchaGateTool = {
151
365
  const verifySchema = z.object({
152
366
  session_id: z.string().min(1),
153
367
  sender: z.string().min(1).max(120).optional(),
368
+ // Seal a found OTP into this slot instead of returning it — then enter it
369
+ // with operate_act{type_secret, slot}. The code never reaches you (safer, and
370
+ // it dodges client-side payload truncation).
371
+ into_slot: z.string().min(1).max(60).optional(),
154
372
  });
155
373
  export const provisionAwaitVerificationTool = {
156
- name: "provision_await_verification",
374
+ name: "operate_await_verification",
157
375
  description: "Read the user's OWN inbox through their signed-in browser session (no IMAP, " +
158
- "no mail token) to complete email verification: returns {found, code, link}. " +
159
- "Pass `sender` (e.g. 'resend.com') to scope the search. Then type the code " +
160
- "with provision_act, or goto the link. Scoped search-and-extract — it reads " +
161
- "only the matching recent mail, never the whole inbox.",
376
+ "no mail token) to complete email verification: returns {found, code, link, " +
377
+ "needs_user?}. Pass `sender` (e.g. 'resend.com') to scope the search. On " +
378
+ "found=true, type the code with operate_act or goto the link. PREFER passing " +
379
+ "`into_slot` (e.g. 'otp'): the code is sealed into a slot (you get a masked " +
380
+ "handle, not the digits) and you enter it with operate_act{type_secret, slot} " +
381
+ "— the code never round-trips through you. On found=false a `needs_user` " +
382
+ "object is returned (wall='verification_code') — the code came by SMS/" +
383
+ "authenticator or hasn't arrived: ASK THE USER for it, then type it with " +
384
+ "operate_act and continue. The session stays live; this is a resumable " +
385
+ "hand-back, not a failure. Scoped search-and-extract — reads only the matching " +
386
+ "recent mail, never the whole inbox.",
162
387
  inputSchema: verifySchema,
163
388
  jsonInputSchema: {
164
389
  type: "object",
165
390
  required: ["session_id"],
166
- properties: { session_id: { type: "string" }, sender: { type: "string" } },
391
+ properties: {
392
+ session_id: { type: "string" },
393
+ sender: { type: "string" },
394
+ into_slot: { type: "string" },
395
+ },
167
396
  },
168
397
  async handler(args) {
169
- return await awaitVerification(args.session_id, args.sender !== undefined ? { sender: args.sender } : {});
398
+ return await awaitVerification(args.session_id, {
399
+ ...(args.sender !== undefined ? { sender: args.sender } : {}),
400
+ ...(args.into_slot !== undefined ? { intoSlot: args.into_slot } : {}),
401
+ });
402
+ },
403
+ };
404
+ // Change 2 — the pluggable terminal. Two outcome kinds: `credentials` (the
405
+ // signup case — extract + vault-store, byte-identical to operate_extract's
406
+ // store path) and `result` (any operate task — a summary + optional structured
407
+ // data: design-review findings, "task done" with confirmed in data, etc.).
408
+ // Both close the session. `operate_finish` stays for abort/give-up.
409
+ const finishTaskSchema = z.object({
410
+ session_id: z.string().min(1),
411
+ kind: z.enum(["credentials", "result"]),
412
+ // credentials kind: where to vault the extracted key (same shape as extract).
413
+ store: storeShape.optional(),
414
+ // result kind: a human-readable outcome + optional bounded structured data.
415
+ summary: z.string().max(4000).optional(),
416
+ data: z.record(z.string().max(4000)).optional(),
417
+ });
418
+ export const provisionFinishTaskTool = {
419
+ name: "operate_finish_task",
420
+ description: "Finish an operate task with its OUTCOME, then close the session. kind=" +
421
+ "'credentials' extracts + vault-stores the key (pass `store`; same as " +
422
+ "operate_extract's store), for signups/key-provisioning. kind='result' " +
423
+ "reports a `summary` (+ optional `data` map) for any other task — a design " +
424
+ "review's findings, extracted data, or 'task done' (put confirmed:true in " +
425
+ "data). Use operate_finish instead to abort without an outcome.",
426
+ inputSchema: finishTaskSchema,
427
+ jsonInputSchema: {
428
+ type: "object",
429
+ required: ["session_id", "kind"],
430
+ properties: {
431
+ session_id: { type: "string" },
432
+ kind: { type: "string", enum: ["credentials", "result"] },
433
+ store: { type: "object", required: ["service"], properties: storeJsonProps },
434
+ summary: { type: "string" },
435
+ data: { type: "object" },
436
+ },
437
+ },
438
+ async handler(args, api) {
439
+ if (args.kind === "credentials") {
440
+ const extracted = await extractCredentials(args.session_id);
441
+ if (args.store === undefined) {
442
+ throw new Error("operate_finish_task kind=credentials requires `store`");
443
+ }
444
+ if (api === null) {
445
+ throw new Error("operate_finish_task credentials requires an active Trusty Squire session");
446
+ }
447
+ const blocked = extracted.blocked_reason;
448
+ const stored = Object.keys(extracted.credentials).length > 0
449
+ ? await persistExtracted(args.session_id, extracted.credentials, args.store, api)
450
+ : null;
451
+ const closed = await finishProvisionSession(args.session_id);
452
+ return {
453
+ kind: "credentials",
454
+ url: closed.url,
455
+ candidate_count: extracted.candidate_count,
456
+ ...(blocked !== undefined ? { blocked_reason: blocked } : {}),
457
+ stored_credential: stored,
458
+ };
459
+ }
460
+ // result kind — summary + bounded data, then close.
461
+ const closed = await finishProvisionSession(args.session_id);
462
+ return {
463
+ kind: "result",
464
+ url: closed.url,
465
+ summary: (args.summary ?? "").slice(0, 4000),
466
+ ...(args.data !== undefined ? { data: args.data } : {}),
467
+ };
170
468
  },
171
469
  };
172
470
  const finishSchema = z.object({ session_id: z.string().min(1) });
173
471
  export const provisionFinishTool = {
174
- name: "provision_finish",
472
+ name: "operate_finish",
175
473
  description: "Close a provisioning session and tear down its browser. Always call this " +
176
474
  "when the run is complete (success or give-up) to release the browser.",
177
475
  inputSchema: finishSchema,
@@ -184,21 +482,14 @@ export const provisionFinishTool = {
184
482
  return await finishProvisionSession(args.session_id);
185
483
  },
186
484
  };
187
- export const PROVISION_DRIVE_TOOLS = [
485
+ export const OPERATE_TOOLS = [
188
486
  provisionStartTool,
189
487
  provisionObserveTool,
190
488
  provisionActTool,
191
489
  provisionCaptchaGateTool,
192
490
  provisionAwaitVerificationTool,
193
491
  provisionExtractTool,
492
+ provisionFinishTaskTool,
194
493
  provisionFinishTool,
195
494
  ];
196
- // DEFAULT-ON (2026-06-25 operator decision — "this will be the default soon").
197
- // The interactive provisioning tools ship by default; opt out with
198
- // PROVISION_DRIVE_TOOLS=0/false/off. Domain-scoping, the write-only-vault
199
- // de-fang, and the per-action audit log are in place; the consent-at-install
200
- // prompt is the remaining hardening (tracked in DESIGN-host-planner-perception).
201
- export function provisionDriveToolsEnabled() {
202
- return !/^(0|false|off|no)$/i.test(process.env.PROVISION_DRIVE_TOOLS ?? "");
203
- }
204
495
  //# sourceMappingURL=provision-drive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"provision-drive.js","sourceRoot":"","sources":["../../src/tools/provision-drive.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,2EAA2E;AAC3E,gFAAgF;AAChF,mFAAmF;AACnF,+EAA+E;AAC/E,sEAAsE;AAEtE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,qBAAqB,EACrB,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACj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QACxB,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;KAC/C;IACD,KAAK,CAAC,OAAO,CAAC,IAAI;QAChB,OAAO,MAAM,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvD,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAW;IACnC,kBAAkB;IAClB,oBAAoB;IACpB,gBAAgB;IAChB,wBAAwB;IACxB,8BAA8B;IAC9B,oBAAoB;IACpB,uBAAuB;IACvB,mBAAmB;CACV,CAAC"}
@@ -7,6 +7,7 @@ declare const inputSchema: z.ZodEffects<z.ZodObject<{
7
7
  fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
8
8
  env_var_suggestion: z.ZodOptional<z.ZodString>;
9
9
  type: z.ZodOptional<z.ZodString>;
10
+ observed_hosts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
10
11
  auth_shape: z.ZodOptional<z.ZodString>;
11
12
  }, "strip", z.ZodTypeAny, {
12
13
  service: string;
@@ -15,6 +16,7 @@ declare const inputSchema: z.ZodEffects<z.ZodObject<{
15
16
  value?: string | undefined;
16
17
  fields?: Record<string, string> | undefined;
17
18
  env_var_suggestion?: string | undefined;
19
+ observed_hosts?: string[] | undefined;
18
20
  auth_shape?: string | undefined;
19
21
  }, {
20
22
  service: string;
@@ -23,6 +25,7 @@ declare const inputSchema: z.ZodEffects<z.ZodObject<{
23
25
  value?: string | undefined;
24
26
  fields?: Record<string, string> | undefined;
25
27
  env_var_suggestion?: string | undefined;
28
+ observed_hosts?: string[] | undefined;
26
29
  auth_shape?: string | undefined;
27
30
  }>, {
28
31
  service: string;
@@ -31,6 +34,7 @@ declare const inputSchema: z.ZodEffects<z.ZodObject<{
31
34
  value?: string | undefined;
32
35
  fields?: Record<string, string> | undefined;
33
36
  env_var_suggestion?: string | undefined;
37
+ observed_hosts?: string[] | undefined;
34
38
  auth_shape?: string | undefined;
35
39
  }, {
36
40
  service: string;
@@ -39,6 +43,7 @@ declare const inputSchema: z.ZodEffects<z.ZodObject<{
39
43
  value?: string | undefined;
40
44
  fields?: Record<string, string> | undefined;
41
45
  env_var_suggestion?: string | undefined;
46
+ observed_hosts?: string[] | undefined;
42
47
  auth_shape?: string | undefined;
43
48
  }>;
44
49
  export declare const storeCredentialTool: Tool<z.infer<typeof inputSchema>>;
@@ -1 +1 @@
1
- {"version":3,"file":"store-credential.d.ts","sourceRoot":"","sources":["../../src/tools/store-credential.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAa,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAGlD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBb,CAAC;AAiBL,eAAO,MAAM,mBAAmB,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAuCjE,CAAC"}
1
+ {"version":3,"file":"store-credential.d.ts","sourceRoot":"","sources":["../../src/tools/store-credential.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAa,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAGlD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBb,CAAC;AAmBL,eAAO,MAAM,mBAAmB,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAyCjE,CAAC"}
@@ -9,6 +9,7 @@ const inputSchema = z
9
9
  fields: z.record(z.string().min(1).max(8192)).optional(),
10
10
  env_var_suggestion: z.string().min(1).max(120).optional(),
11
11
  type: z.string().min(1).max(60).optional(),
12
+ observed_hosts: z.array(z.string().min(1).max(256)).max(10).optional(),
12
13
  auth_shape: z
13
14
  .string()
14
15
  .max(120)
@@ -30,6 +31,8 @@ the same service apart. Optional \`auth_shape\` records how the provider
30
31
  expects the key so an EGRESS GRANT (grant_app_access) auto-injects it
31
32
  correctly: "bearer" (default) | "header:<name>" (e.g. "header:x-api-key")
32
33
  | "query:<param>". Set it for non-bearer providers; bearer needs nothing.
34
+ Optional \`observed_hosts\` carries hosts seen during signup/extraction and is
35
+ unioned into the credential's allowed_hosts with the service defaults.
33
36
  Returns the reference, field names, and allowed_hosts. The value is never
34
37
  readable back to you afterwards.`;
35
38
  export const storeCredentialTool = {
@@ -46,6 +49,7 @@ export const storeCredentialTool = {
46
49
  fields: { type: "object", additionalProperties: { type: "string" } },
47
50
  env_var_suggestion: { type: "string" },
48
51
  type: { type: "string" },
52
+ observed_hosts: { type: "array", items: { type: "string" } },
49
53
  auth_shape: { type: "string" },
50
54
  },
51
55
  },
@@ -60,6 +64,7 @@ export const storeCredentialTool = {
60
64
  ...(args.fields !== undefined ? { fields: args.fields } : {}),
61
65
  ...(args.env_var_suggestion !== undefined ? { env_var_suggestion: args.env_var_suggestion } : {}),
62
66
  ...(args.type !== undefined ? { type: args.type } : {}),
67
+ ...(args.observed_hosts !== undefined ? { observed_hosts: args.observed_hosts } : {}),
63
68
  ...(args.auth_shape !== undefined ? { auth_shape: args.auth_shape } : {}),
64
69
  });
65
70
  return {