@michael-joseph-miller/ant-bot 0.3.1 → 0.4.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 CHANGED
@@ -4,6 +4,54 @@ All notable changes to ant-bot are recorded here. The format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow
5
5
  [semantic versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.4.0] — 2026-08-24
8
+
9
+ Connectors, redesigned. Getting an MCP server usable by a Bot took up to eleven steps and eight
10
+ concepts; it is now one command, and ant-bot depends on nothing outside itself for any of it.
11
+
12
+ ### Added
13
+
14
+ - **Built-in connectors.** `antbot mcp add gmail` gives a Bot mail — `search_threads`,
15
+ `get_thread`, `get_message`, `list_labels`, `create_draft`, `send_message` — served by the daemon
16
+ itself over Gmail's REST API with a token from ant-bot's own sign-in. Google's MCP endpoint
17
+ accepts only allowlisted clients, so ant-bot brings its own server rather than a dependency on
18
+ Google's, or on the `claude` CLI's, or on claude.ai. The one-time Google client setup is guided
19
+ in the CLI and the UI, with the redirect URI filled in. `send_message` and `create_draft` ship
20
+ with a `require` rule, so a Bot always asks before mail leaves your account.
21
+ - **One-step add.** `antbot mcp add <name> [command | url]` infers the transport, takes a
22
+ credential once (`--env TOKEN` prompts with echo off and stores it in the keychain), checks the
23
+ server, signs in when it can — opening the browser — and asks which Bots get it (`--bots`).
24
+ The Connectors screen is one **Add** field with the name prefilled, credential rows with a
25
+ **secret** toggle, and Bot checkboxes. Nobody types `{{secret:…}}` any more.
26
+ - **An honest check.** `antbot mcp check <name>` (and **Check** on the screen) gives one verdict —
27
+ `ready`, `needs sign-in`, `needs a credential`, `unreachable` — decided by whether a *call* would
28
+ be allowed, not by whether the server lists tools. It replaces `test`, whose green result many
29
+ servers contradicted on the first real call. The verdict is stored on the row and shown there.
30
+ - **Mid-turn sign-in.** When a connector's token expires during a turn, the Bot's thread gets a
31
+ card with an **Open** button instead of a silently failing tool; the connector reconnects when
32
+ the sign-in finishes, without a restart.
33
+ - **A place for secrets.** `antbot secret set|list|remove` and a **Secrets** section on Settings.
34
+ The API existed; nothing called it.
35
+ - **The agent runtime seam.** `AgentRuntime` in `daemon/src/agent/runtime.ts` is where a Gemini or
36
+ Codex runtime plugs in: connectors reach it as a neutral `MountedConnector`, never as SDK config.
37
+
38
+ ### Changed
39
+
40
+ - **Mounting is strict.** A turn mounts exactly what ant-bot passes — never `~/.claude.json`, a
41
+ plugin's `.mcp.json`, or claude.ai connectors — and every connector's tools are loaded up front
42
+ rather than deferred behind `ToolSearch`. A Bot's tools cannot change because of something
43
+ configured outside ant-bot.
44
+ - **Assignment autosaves.** Ticking a connector in Bot settings is the save; the **Save
45
+ connectors** button is gone.
46
+ - `antbot connector` remains as an alias of `antbot mcp`. `--scopes` on `add` is gone;
47
+ `--transport sse` remains for the rare SSE endpoint.
48
+ - Migration 3 adds `kind`, `last_status`, `last_error`, `checked_at` to `connectors`. Existing
49
+ rows survive as `custom`.
50
+
51
+ ### Removed
52
+
53
+ - `POST /api/connectors/:id/test` and `ConnectorProbeResult.authHint`, replaced by `/check`.
54
+
7
55
  ## [0.3.1] — 2026-08-24
8
56
 
9
57
  ### Fixed
package/README.md CHANGED
@@ -14,9 +14,9 @@ subscription login rather than a metered `ANTHROPIC_API_KEY`.
14
14
  and a memory directory that survives daemon restarts.
15
15
  - **A shared computer** — one workspace directory, one persistent browser profile, one terminal;
16
16
  every Bot can reach what every other Bot can reach.
17
- - **Connectors** — attach an MCP server (GitHub, filesystem, your own) once, then assign it per Bot.
18
- A Bot without the assignment cannot see its tools; credentials stay in the keychain as
19
- `{{secret:NAME}}` references.
17
+ - **Connectors** — give Bots MCP tools in one step: a built-in ant-bot serves itself (Gmail), a
18
+ local command, or a URL. `antbot mcp add` checks it, signs in, and asks which Bots; credentials
19
+ go to the keychain and a Bot without the assignment cannot see the tools at all.
20
20
  - **Approvals** — every tool call a Bot proposes passes a Permission Gateway: deterministic rules,
21
21
  optional Haiku auto-review, or a human approval card in the thread.
22
22
  - **Skills** — standard Claude skills (`SKILL.md`), installed with `antbot skill add <source>` from
@@ -94,7 +94,8 @@ web assets. There's no separate frontend server to run.
94
94
  | `antbot restart` | Stop and start again |
95
95
  | `antbot status` | Whether it's running, on what port, with how many bots |
96
96
  | `antbot doctor` | Diagnose the environment; every failure prints its fix |
97
- | `antbot connector` | Manage the MCP servers your bots can use (`list`/`add`/`test`/`remove`) |
97
+ | `antbot mcp add <name> [command \| url]` | Give bots an MCP server built-in, local command, or URL — in one step (`list`/`check`/`login`/`remove` too) |
98
+ | `antbot secret` | Credentials in your keychain, by name (`set`/`list`/`remove`) |
98
99
  | `antbot update` | Update to the latest published version (`--check` to look without installing) |
99
100
 
100
101
  Run `antbot --help` for the full list, or `antbot <command> --help` for one command.
@@ -280,10 +281,10 @@ Current totals, as run against this checkout:
280
281
  | Package | Test files | Tests |
281
282
  |---|---|---|
282
283
  | `@antbot/contract` | 1 | 34 |
283
- | `@antbot/daemon` | 25 | 575 |
284
- | `@antbot/ui` | 9 | 92 |
285
- | `@antbot/cli` | 8 | 140 |
286
- | **Total** | **43** | **841** |
284
+ | `@antbot/daemon` | 29 | 609 |
285
+ | `@antbot/ui` | 10 | 98 |
286
+ | `@antbot/cli` | 8 | 141 |
287
+ | **Total** | **48** | **882** |
287
288
 
288
289
  ## Status / not built
289
290
 
@@ -94,7 +94,9 @@ var CardSchema = z.discriminatedUnion("type", [
94
94
  }),
95
95
  z.object({ type: z.literal("approval"), approvalId: z.string() }),
96
96
  z.object({ type: z.literal("handoff"), fromBotId: z.string(), toBotId: z.string(), note: z.string() }),
97
- z.object({ type: z.literal("error"), message: z.string() })
97
+ z.object({ type: z.literal("error"), message: z.string() }),
98
+ /** A connector asked for a sign-in mid-turn. The link is the provider's; the bot never sees it. */
99
+ z.object({ type: z.literal("signin"), serverName: z.string(), url: z.string() })
98
100
  ]);
99
101
  var AuthorKindSchema = z.enum(["user", "bot", "system"]);
100
102
  var MessageSchema = z.object({
@@ -185,9 +187,27 @@ var ConnectorSchema = z.object({
185
187
  description: z.string().default(""),
186
188
  /** Account-wide switch. A disabled connector mounts for nobody, whatever the assignments say. */
187
189
  enabled: z.boolean().default(true),
190
+ /**
191
+ * `builtin` — served by the daemon itself (Gmail…), credentials held by the daemon, config
192
+ * points at the daemon's own `/mcp/<name>`. `custom` — a command or URL the user added.
193
+ */
194
+ kind: z.enum(["custom", "builtin"]).default("custom"),
188
195
  config: ConnectorConfigSchema,
196
+ /** Last verdict from a check or a turn: ready | needs-sign-in | needs-credential | unreachable | connected | failed… */
197
+ lastStatus: z.string().nullable().default(null),
198
+ lastError: z.string().nullable().default(null),
199
+ checkedAt: z.number().nullable().default(null),
189
200
  createdAt: z.number()
190
201
  });
202
+ var ConnectorCheckSchema = z.object({
203
+ status: z.enum(["ready", "needs-sign-in", "needs-credential", "unreachable"]),
204
+ /** For needs-sign-in: whether the provider lets ant-bot register itself (no client ID needed). */
205
+ selfRegistration: z.boolean().optional(),
206
+ /** Who is asking for the sign-in, when known — "Google", "accounts.example.com". */
207
+ provider: z.string().optional(),
208
+ tools: z.array(z.object({ name: z.string(), description: z.string() })).default([]),
209
+ detail: z.string().optional()
210
+ });
191
211
  var RoutineSchema = z.object({
192
212
  id: z.string(),
193
213
  botId: z.string(),
@@ -343,9 +363,11 @@ var CreateSkillRequest = z3.object({
343
363
  var CreateConnectorRequest = z3.object({
344
364
  name: ConnectorSchema.shape.name,
345
365
  description: z3.string().default(""),
346
- config: ConnectorConfigSchema,
347
- enabled: z3.boolean().optional()
348
- });
366
+ config: ConnectorConfigSchema.optional(),
367
+ builtin: z3.string().optional(),
368
+ enabled: z3.boolean().optional(),
369
+ botIds: z3.array(z3.string()).optional()
370
+ }).refine((v) => Boolean(v.config) !== Boolean(v.builtin), { message: "Give either config or builtin, not both" });
349
371
  var UpdateConnectorRequest = z3.object({
350
372
  description: z3.string().optional(),
351
373
  config: ConnectorConfigSchema.optional(),
@@ -403,4 +425,4 @@ export {
403
425
  SettingsSchema,
404
426
  SettingsPatchSchema
405
427
  };
406
- //# sourceMappingURL=chunk-I3GHIX3G.js.map
428
+ //# sourceMappingURL=chunk-BKF7CUVN.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../contract/src/limits.ts", "../../contract/src/entities.ts", "../../contract/src/events.ts", "../../contract/src/api.ts"],
4
+ "sourcesContent": ["/** Operational limits \u2014 mirrors grok-bot-system-outline.md \u00A713. */\nexport const LIMITS = {\n MAX_BOTS_AND_GROUPS: 50,\n MIN_GROUP_MEMBERS: 2,\n MAX_GROUP_MEMBERS: 6,\n MAX_ROUTINES_PER_BOT: 50,\n ROUTINE_RUNS_RETAINED: 20,\n MAX_ATTACHMENTS_PER_MESSAGE: 6,\n MAX_ATTACHMENT_BYTES: 25 * 1024 * 1024,\n MAX_VIDEO_ATTACHMENT_BYTES: 200 * 1024 * 1024,\n MAX_BOT_TO_BOT_HOPS: 5,\n DEFAULT_MAX_CONCURRENT_SESSIONS: 2,\n APPROVAL_TIMEOUT_MS: 15 * 60 * 1000,\n TEACH_RECORDING_MAX_MS: 10 * 60 * 1000,\n} as const;\n\n/** Error codes returned by the service layer when a limit is violated. */\nexport const LIMIT_ERROR = {\n TOO_MANY_BOTS: 'TOO_MANY_BOTS',\n GROUP_SIZE: 'GROUP_SIZE',\n TOO_MANY_ROUTINES: 'TOO_MANY_ROUTINES',\n TOO_MANY_ATTACHMENTS: 'TOO_MANY_ATTACHMENTS',\n ATTACHMENT_TOO_LARGE: 'ATTACHMENT_TOO_LARGE',\n HOP_LIMIT: 'HOP_LIMIT',\n} as const;\nexport type LimitErrorCode = (typeof LIMIT_ERROR)[keyof typeof LIMIT_ERROR];\n\nexport class LimitError extends Error {\n constructor(\n public code: LimitErrorCode,\n message: string,\n ) {\n super(message);\n this.name = 'LimitError';\n }\n}\n", "import { z } from 'zod';\n\nexport const BotStateSchema = z.enum([\n 'idle',\n 'queued',\n 'running',\n 'waiting_approval',\n 'waiting_input',\n 'interrupted',\n]);\nexport type BotState = z.infer<typeof BotStateSchema>;\n\nexport const AttentionSchema = z.enum(['none', 'unread', 'needs_attention']);\nexport type Attention = z.infer<typeof AttentionSchema>;\n\n/**\n * Model tiers a Bot can run on, ordered most to least capable \u2014 this is also the order the UI\n * renders them in, so both pickers stay consistent without repeating the list.\n *\n * Each value is a `claude` CLI model alias, passed through verbatim by `resolveModel()`. Adding a\n * tier here means adding an alias the CLI accepts (`claude --model`), not an API model ID.\n */\nexport const MODEL_TIERS = ['fable', 'opus', 'sonnet', 'haiku'] as const;\nexport const ModelTierSchema = z.enum(MODEL_TIERS);\nexport type ModelTier = z.infer<typeof ModelTierSchema>;\n\nexport const BotSchema = z.object({\n id: z.string(),\n slug: z.string().regex(/^[a-z0-9][a-z0-9-]*$/),\n name: z.string().min(1).max(60),\n title: z.string().max(120).default(''),\n description: z.string().max(8000).default(''),\n avatarEmoji: z.string().max(8).default('\uD83E\uDD16'),\n modelTier: ModelTierSchema.default('sonnet'),\n pinned: z.boolean().default(false),\n hidden: z.boolean().default(false),\n notifications: z.boolean().default(true),\n sessionId: z.string().nullable().default(null),\n state: BotStateSchema.default('idle'),\n attention: AttentionSchema.default('none'),\n threadId: z.string().nullable().default(null),\n createdAt: z.number(),\n deletedAt: z.number().nullable().default(null),\n});\nexport type Bot = z.infer<typeof BotSchema>;\n\nexport const ThreadKindSchema = z.enum(['dm', 'group']);\nexport type ThreadKind = z.infer<typeof ThreadKindSchema>;\n\nexport const ThreadSchema = z.object({\n id: z.string(),\n kind: ThreadKindSchema,\n title: z.string().default(''),\n memberBotIds: z.array(z.string()).default([]),\n pinned: z.boolean().default(false),\n hidden: z.boolean().default(false),\n lastReadAt: z.number().default(0),\n createdAt: z.number(),\n});\nexport type Thread = z.infer<typeof ThreadSchema>;\n\n/** Cards render structured, non-prose content inside a message. */\nexport const CardSchema = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('tool'),\n toolName: z.string(),\n summary: z.string(),\n input: z.unknown().optional(),\n result: z.string().optional(),\n status: z.enum(['running', 'ok', 'error', 'denied']),\n }),\n z.object({\n type: z.literal('file'),\n path: z.string(),\n name: z.string(),\n mime: z.string(),\n bytes: z.number(),\n action: z.enum(['created', 'modified']).default('created'),\n }),\n z.object({ type: z.literal('approval'), approvalId: z.string() }),\n z.object({ type: z.literal('handoff'), fromBotId: z.string(), toBotId: z.string(), note: z.string() }),\n z.object({ type: z.literal('error'), message: z.string() }),\n /** A connector asked for a sign-in mid-turn. The link is the provider's; the bot never sees it. */\n z.object({ type: z.literal('signin'), serverName: z.string(), url: z.string() }),\n]);\nexport type Card = z.infer<typeof CardSchema>;\n\nexport const AuthorKindSchema = z.enum(['user', 'bot', 'system']);\nexport type AuthorKind = z.infer<typeof AuthorKindSchema>;\n\nexport const MessageSchema = z.object({\n id: z.string(),\n threadId: z.string(),\n authorKind: AuthorKindSchema,\n authorBotId: z.string().nullable().default(null),\n replyToId: z.string().nullable().default(null),\n contentMd: z.string().default(''),\n cards: z.array(CardSchema).default([]),\n streaming: z.boolean().default(false),\n createdAt: z.number(),\n});\nexport type Message = z.infer<typeof MessageSchema>;\n\nexport const AttachmentSchema = z.object({\n id: z.string(),\n messageId: z.string().nullable(),\n path: z.string(),\n name: z.string(),\n mime: z.string(),\n bytes: z.number(),\n createdAt: z.number(),\n});\nexport type Attachment = z.infer<typeof AttachmentSchema>;\n\nexport const ApprovalStatusSchema = z.enum(['pending', 'allowed', 'denied', 'expired']);\nexport type ApprovalStatus = z.infer<typeof ApprovalStatusSchema>;\n\nexport const ApprovalSchema = z.object({\n id: z.string(),\n botId: z.string(),\n threadId: z.string(),\n toolName: z.string(),\n inputSummary: z.string(),\n rawInput: z.unknown(),\n status: ApprovalStatusSchema.default('pending'),\n decidedBy: z.enum(['user', 'rule', 'auto_review']).nullable().default(null),\n reason: z.string().default(''),\n ruleId: z.string().nullable().default(null),\n createdAt: z.number(),\n decidedAt: z.number().nullable().default(null),\n});\nexport type Approval = z.infer<typeof ApprovalSchema>;\n\nexport const RuleKindSchema = z.enum(['require', 'allow']);\nexport type RuleKind = z.infer<typeof RuleKindSchema>;\n\nexport const RuleSchema = z.object({\n id: z.string(),\n kind: RuleKindSchema,\n /** Glob over tool name, e.g. \"Bash\", \"browser_*\", \"*\" */\n toolPattern: z.string().default('*'),\n /** Optional regex tested against the serialized tool input. */\n inputPattern: z.string().default(''),\n scopeNote: z.string().default(''),\n builtin: z.boolean().default(false),\n enabled: z.boolean().default(true),\n createdAt: z.number(),\n});\nexport type Rule = z.infer<typeof RuleSchema>;\n\nexport const SkillSchema = z.object({\n id: z.string(),\n slug: z.string(),\n name: z.string(),\n description: z.string().default(''),\n path: z.string(),\n source: z.enum(['user', 'taught', 'imported']).default('user'),\n createdAt: z.number(),\n});\nexport type Skill = z.infer<typeof SkillSchema>;\n\n/* ------------------------------ MCP connectors ------------------------------ */\n\n/**\n * Connector names become the middle segment of every tool name the model sees:\n * `mcp__<name>__<tool>`. Underscores are banned outright because `toolNameAliases()`\n * splits on the first `__` pair \u2014 a name containing one would make a connector's tools\n * unmatchable by the rules that are supposed to gate them.\n */\nexport const CONNECTOR_NAME_RE = /^[a-z0-9][a-z0-9-]{0,31}$/;\n\n/** Taken by the built-in servers; a connector using one would overwrite it in the turn's server map. */\nexport const RESERVED_CONNECTOR_NAMES = ['antbot', 'browser'] as const;\n\n/**\n * How to reach an MCP server. Mirrors the Agent SDK's own `McpServerConfig` minus the\n * in-process `sdk` variant, which only the built-in servers use.\n *\n * Secret values are never stored here. An env value or header may embed `{{secret:NAME}}`,\n * resolved against the keychain at mount time \u2014 see `daemon/src/bots/connectors.ts`.\n */\nexport const ConnectorConfigSchema = z.discriminatedUnion('transport', [\n z.object({\n transport: z.literal('stdio'),\n command: z.string().min(1),\n args: z.array(z.string()).default([]),\n env: z.record(z.string(), z.string()).default({}),\n }),\n z.object({\n transport: z.literal('http'),\n url: z.string().url(),\n headers: z.record(z.string(), z.string()).default({}),\n /** Optional allowlist passed through to the SDK. Omit to expose every tool the server offers. */\n tools: z.array(z.string()).optional(),\n }),\n z.object({\n transport: z.literal('sse'),\n url: z.string().url(),\n headers: z.record(z.string(), z.string()).default({}),\n tools: z.array(z.string()).optional(),\n }),\n]);\nexport type ConnectorConfig = z.infer<typeof ConnectorConfigSchema>;\n\nexport const ConnectorSchema = z.object({\n id: z.string(),\n name: z\n .string()\n .regex(CONNECTOR_NAME_RE, 'lowercase letters, digits and hyphens only, max 32 characters')\n .refine((n) => !(RESERVED_CONNECTOR_NAMES as readonly string[]).includes(n), {\n message: `\"antbot\" and \"browser\" are reserved for the built-in servers`,\n }),\n description: z.string().default(''),\n /** Account-wide switch. A disabled connector mounts for nobody, whatever the assignments say. */\n enabled: z.boolean().default(true),\n /**\n * `builtin` \u2014 served by the daemon itself (Gmail\u2026), credentials held by the daemon, config\n * points at the daemon's own `/mcp/<name>`. `custom` \u2014 a command or URL the user added.\n */\n kind: z.enum(['custom', 'builtin']).default('custom'),\n config: ConnectorConfigSchema,\n /** Last verdict from a check or a turn: ready | needs-sign-in | needs-credential | unreachable | connected | failed\u2026 */\n lastStatus: z.string().nullable().default(null),\n lastError: z.string().nullable().default(null),\n checkedAt: z.number().nullable().default(null),\n createdAt: z.number(),\n});\nexport type Connector = z.infer<typeof ConnectorSchema>;\n\n/** The verdict `POST /api/connectors/:id/check` returns, and what `add` prints. */\nexport const ConnectorCheckSchema = z.object({\n status: z.enum(['ready', 'needs-sign-in', 'needs-credential', 'unreachable']),\n /** For needs-sign-in: whether the provider lets ant-bot register itself (no client ID needed). */\n selfRegistration: z.boolean().optional(),\n /** Who is asking for the sign-in, when known \u2014 \"Google\", \"accounts.example.com\". */\n provider: z.string().optional(),\n tools: z.array(z.object({ name: z.string(), description: z.string() })).default([]),\n detail: z.string().optional(),\n});\nexport type ConnectorCheck = z.infer<typeof ConnectorCheckSchema>;\n\nexport const RoutineSchema = z.object({\n id: z.string(),\n botId: z.string(),\n name: z.string().min(1),\n cronExpr: z.string(),\n timezone: z.string().default('UTC'),\n instructionMd: z.string(),\n enabled: z.boolean().default(true),\n lastRunAt: z.number().nullable().default(null),\n nextRunAt: z.number().nullable().default(null),\n createdAt: z.number(),\n});\nexport type Routine = z.infer<typeof RoutineSchema>;\n\nexport const RoutineRunSchema = z.object({\n id: z.string(),\n routineId: z.string(),\n startedAt: z.number(),\n finishedAt: z.number().nullable().default(null),\n status: z.enum(['running', 'ok', 'failed', 'interrupted']),\n summary: z.string().default(''),\n threadId: z.string().nullable().default(null),\n isTest: z.boolean().default(false),\n});\nexport type RoutineRun = z.infer<typeof RoutineRunSchema>;\n\nexport const MailboxEntrySchema = z.object({\n id: z.string(),\n fromBotId: z.string(),\n toBotId: z.string(),\n contentMd: z.string(),\n hops: z.number().default(1),\n delivered: z.boolean().default(false),\n createdAt: z.number(),\n});\nexport type MailboxEntry = z.infer<typeof MailboxEntrySchema>;\n\nexport const UsageRowSchema = z.object({\n id: z.string(),\n botId: z.string(),\n turnId: z.string(),\n model: z.string(),\n inputTokens: z.number().default(0),\n outputTokens: z.number().default(0),\n cacheReadTokens: z.number().default(0),\n costEstimate: z.number().default(0),\n createdAt: z.number(),\n});\nexport type UsageRow = z.infer<typeof UsageRowSchema>;\n\nexport const TurnOriginSchema = z.enum(['user', 'bot', 'routine', 'system']);\nexport type TurnOrigin = z.infer<typeof TurnOriginSchema>;\n", "import { z } from 'zod';\nimport { BotStateSchema, AttentionSchema, CardSchema, MessageSchema, ApprovalSchema, RoutineRunSchema } from './entities.js';\n\n/** Every server\u2192client event carries {threadId, botId, seq} for ordering/reconciliation. */\nconst base = { seq: z.number(), threadId: z.string().nullable(), botId: z.string().nullable() };\n\nexport const ServerEventSchema = z.discriminatedUnion('type', [\n /** Connection handshake. Carries the current seq so a client can detect gaps. */\n z.object({ ...base, type: z.literal('hello') }),\n z.object({ ...base, type: z.literal('message.created'), message: MessageSchema }),\n z.object({ ...base, type: z.literal('message.delta'), messageId: z.string(), delta: z.string() }),\n z.object({ ...base, type: z.literal('message.done'), messageId: z.string(), contentMd: z.string() }),\n z.object({ ...base, type: z.literal('message.card'), messageId: z.string(), card: CardSchema, cardIndex: z.number() }),\n z.object({ ...base, type: z.literal('bot.state'), state: BotStateSchema, attention: AttentionSchema }),\n z.object({ ...base, type: z.literal('approval.pending'), approval: ApprovalSchema }),\n z.object({ ...base, type: z.literal('approval.resolved'), approval: ApprovalSchema }),\n z.object({ ...base, type: z.literal('routine.run'), run: RoutineRunSchema }),\n z.object({ ...base, type: z.literal('usage.tick'), inputTokens: z.number(), outputTokens: z.number(), model: z.string() }),\n z.object({ ...base, type: z.literal('notify'), title: z.string(), body: z.string(), level: z.enum(['info', 'warn', 'error']) }),\n z.object({ ...base, type: z.literal('secret.request'), requestId: z.string(), name: z.string(), reason: z.string() }),\n z.object({ ...base, type: z.literal('thread.updated'), threadId2: z.string() }),\n]);\nexport type ServerEvent = z.infer<typeof ServerEventSchema>;\nexport type ServerEventType = ServerEvent['type'];\n\n/* ------------------------- screencast input (client \u2192 server) ------------------------- */\n\n/**\n * Human input forwarded over the screencast websocket while a screen is taken over.\n *\n * Coordinates are **normalised** (0\u20131, fractions of the rendered frame) rather than pixels: the\n * screencast is capped at 1280px wide and the browser then scales the image to fit the pane, so\n * the client cannot know the page's real viewport and the server cannot know the client's. Each\n * side converts against what it does know.\n *\n * The daemon dispatches these only while `takeOver()` is active for that bot \u2014 see\n * `docs/SECURITY.md`. Input is a human acting as themselves, so it does not pass the Permission\n * Gateway; the gateway governs what *bots* do.\n */\nexport const ScreencastInputSchema = z.discriminatedUnion('kind', [\n z.object({\n kind: z.literal('mouse'),\n action: z.enum(['move', 'down', 'up', 'wheel']),\n x: z.number().min(0).max(1),\n y: z.number().min(0).max(1),\n button: z.enum(['left', 'middle', 'right']).default('left'),\n clickCount: z.number().int().min(0).max(3).default(1),\n /** Wheel deltas, in CSS pixels. Only read for `action: 'wheel'`. */\n deltaX: z.number().default(0),\n deltaY: z.number().default(0),\n }),\n z.object({\n kind: z.literal('key'),\n action: z.enum(['down', 'up']),\n /** A KeyboardEvent.key value \u2014 Playwright's keyboard maps these to the right key codes. */\n key: z.string().min(1).max(32),\n }),\n z.object({\n kind: z.literal('text'),\n /** Committed text (IME, paste, or a printable keypress), inserted verbatim. */\n text: z.string().min(1).max(4096),\n }),\n]);\nexport type ScreencastInput = z.infer<typeof ScreencastInputSchema>;\n\n/** Frames the client may send on the screencast socket. */\nexport const ScreencastClientFrameSchema = z.discriminatedUnion('type', [\n z.object({ type: z.literal('input'), input: ScreencastInputSchema }),\n /**\n * Asks for the remote page's current text selection, so the human can copy out of it.\n *\n * A round trip is needed because the two clipboards are different: pressing Ctrl+C in the\n * viewer copies whatever is selected in *your* browser (nothing \u2014 the page is a JPEG), and\n * forwarding Ctrl+C to the page would write to the headless browser's clipboard, which you\n * have no way to read. So the daemon reads the selection and hands the text back for the\n * viewer to put on your clipboard.\n */\n z.object({ type: z.literal('selection-request') }),\n]);\nexport type ScreencastClientFrame = z.infer<typeof ScreencastClientFrameSchema>;\n", "import { z } from 'zod';\nimport {\n BotSchema, ThreadSchema, MessageSchema, ApprovalSchema, RuleSchema,\n SkillSchema, RoutineSchema, RoutineRunSchema, UsageRowSchema, ModelTierSchema,\n ConnectorSchema, ConnectorConfigSchema, type Connector,\n} from './entities.js';\n\nexport const CreateBotRequest = z.object({\n name: z.string().min(1).max(60),\n title: z.string().max(120).optional(),\n description: z.string().max(8000).optional(),\n avatarEmoji: z.string().max(8).optional(),\n modelTier: ModelTierSchema.optional(),\n});\nexport type CreateBotRequest = z.infer<typeof CreateBotRequest>;\n\nexport const UpdateBotRequest = CreateBotRequest.partial().extend({\n pinned: z.boolean().optional(),\n hidden: z.boolean().optional(),\n notifications: z.boolean().optional(),\n});\nexport type UpdateBotRequest = z.infer<typeof UpdateBotRequest>;\n\nexport const CreateThreadRequest = z.object({\n kind: z.enum(['dm', 'group']),\n title: z.string().optional(),\n memberBotIds: z.array(z.string()),\n});\nexport type CreateThreadRequest = z.infer<typeof CreateThreadRequest>;\n\nexport const PostMessageRequest = z.object({\n contentMd: z.string(),\n attachmentIds: z.array(z.string()).optional(),\n replyToId: z.string().nullable().optional(),\n /** explicit @-mention targets resolved by the client */\n mentionBotIds: z.array(z.string()).optional(),\n mentionEveryone: z.boolean().optional(),\n});\nexport type PostMessageRequest = z.infer<typeof PostMessageRequest>;\n\nexport const ApprovalDecisionRequest = z.object({\n decision: z.enum(['allow', 'deny']),\n alwaysRule: z\n .object({ toolPattern: z.string(), inputPattern: z.string().default(''), scopeNote: z.string().default('') })\n .optional(),\n});\nexport type ApprovalDecisionRequest = z.infer<typeof ApprovalDecisionRequest>;\n\nexport const CreateRuleRequest = z.object({\n kind: z.enum(['require', 'allow']),\n toolPattern: z.string().min(1),\n inputPattern: z.string().default(''),\n scopeNote: z.string().default(''),\n});\nexport type CreateRuleRequest = z.infer<typeof CreateRuleRequest>;\n\nexport const CreateRoutineRequest = z.object({\n botId: z.string(),\n name: z.string().min(1),\n cronExpr: z.string().min(1),\n timezone: z.string().optional(),\n instructionMd: z.string().min(1),\n enabled: z.boolean().optional(),\n});\nexport type CreateRoutineRequest = z.infer<typeof CreateRoutineRequest>;\n\nexport const CreateSkillRequest = z.object({\n name: z.string().min(1),\n description: z.string().default(''),\n bodyMd: z.string().min(1),\n source: z.enum(['user', 'taught', 'imported']).optional(),\n});\nexport type CreateSkillRequest = z.infer<typeof CreateSkillRequest>;\n\n/**\n * Either a custom server (`config`) or a built-in one (`builtin`, a catalog name \u2014 the daemon\n * fills in the config). `botIds` assigns it in the same call so adding is one step.\n */\nexport const CreateConnectorRequest = z\n .object({\n name: ConnectorSchema.shape.name,\n description: z.string().default(''),\n config: ConnectorConfigSchema.optional(),\n builtin: z.string().optional(),\n enabled: z.boolean().optional(),\n botIds: z.array(z.string()).optional(),\n })\n .refine((v) => Boolean(v.config) !== Boolean(v.builtin), { message: 'Give either config or builtin, not both' });\nexport type CreateConnectorRequest = z.infer<typeof CreateConnectorRequest>;\n\n/**\n * No `name`: renaming a connector renames every tool the model and the rules see\n * (`mcp__<name>__<tool>`), silently orphaning any rule written against the old one.\n * Delete and re-add instead.\n */\nexport const UpdateConnectorRequest = z.object({\n description: z.string().optional(),\n config: ConnectorConfigSchema.optional(),\n enabled: z.boolean().optional(),\n});\nexport type UpdateConnectorRequest = z.infer<typeof UpdateConnectorRequest>;\n\n/**\n * A connector as the API returns it. `missingSecrets` names the `{{secret:\u2026}}` references\n * that have nothing behind them \u2014 surfaced so a connector that will silently fail to mount\n * says so in the UI before a turn runs, rather than going quiet at turn time.\n */\nexport type ApiConnector = Connector & {\n missingSecrets: string[];\n /** Whether an interactive sign-in has been completed and stored for this connector. */\n signedIn: boolean;\n};\n\n/** A catalog entry as the API describes it: what it is and what setting it up will involve. */\nexport interface ApiCatalogEntry {\n name: string;\n displayName: string;\n description: string;\n provider: string;\n /** Whether the provider needs a client ID/secret the user creates (Google) or self-registers. */\n needsClientCredentials: boolean;\n setupSteps: string[];\n}\n\n/**\n * A raw probe: did the server answer, and what did it list. Tool names and descriptions only \u2014\n * never config. Reachable is not usable; `ConnectorCheck` is the verdict a person should read.\n */\nexport interface ConnectorProbeResult {\n ok: boolean;\n tools: { name: string; description: string }[];\n error?: string;\n}\n\n/**\n * Field types, declared once and without defaults. `SettingsSchema` layers the\n * defaults on for reads; `SettingsPatchSchema` deliberately leaves them off.\n */\nconst settingsFields = {\n timezone: z.string(),\n maxConcurrentSessions: z.number().min(1).max(8),\n autoReviewEnabled: z.boolean(),\n theme: z.enum(['system', 'light', 'dark']),\n localExecution: z.enum(['ask', 'always', 'never']),\n dailyTokenBudget: z.number(),\n notificationsEnabled: z.boolean(),\n billingMode: z.enum(['subscription', 'api']),\n computerMode: z.enum(['host', 'container']),\n};\n\nexport const SettingsSchema = z.object({\n timezone: settingsFields.timezone.default('UTC'),\n maxConcurrentSessions: settingsFields.maxConcurrentSessions.default(2),\n autoReviewEnabled: settingsFields.autoReviewEnabled.default(true),\n theme: settingsFields.theme.default('system'),\n localExecution: settingsFields.localExecution.default('ask'),\n dailyTokenBudget: settingsFields.dailyTokenBudget.default(0),\n notificationsEnabled: settingsFields.notificationsEnabled.default(true),\n billingMode: settingsFields.billingMode.default('subscription'),\n computerMode: settingsFields.computerMode.default('host'),\n});\nexport type Settings = z.infer<typeof SettingsSchema>;\n\n/**\n * Body schema for `PATCH /api/settings`. It must NOT carry defaults: parsing a\n * one-field patch through a defaulted schema yields a complete object, and\n * persisting that would reset every setting the client didn't mention \u2014 including\n * `localExecution`, which is a security control (see docs/SECURITY.md).\n */\nexport const SettingsPatchSchema = z.object(settingsFields).partial();\nexport type SettingsPatch = z.infer<typeof SettingsPatchSchema>;\n\nexport const SearchResultSchema = z.object({\n kind: z.enum(['message', 'file', 'routine', 'bot']),\n id: z.string(),\n threadId: z.string().nullable(),\n botId: z.string().nullable(),\n title: z.string(),\n snippet: z.string(),\n createdAt: z.number(),\n});\nexport type SearchResult = z.infer<typeof SearchResultSchema>;\n\nexport type ApiBot = z.infer<typeof BotSchema>;\nexport type ApiThread = z.infer<typeof ThreadSchema>;\nexport type ApiMessage = z.infer<typeof MessageSchema>;\nexport type ApiApproval = z.infer<typeof ApprovalSchema>;\nexport type ApiRule = z.infer<typeof RuleSchema>;\nexport type ApiSkill = z.infer<typeof SkillSchema>;\nexport type ApiRoutine = z.infer<typeof RoutineSchema>;\nexport type ApiRoutineRun = z.infer<typeof RoutineRunSchema>;\nexport type ApiUsageRow = z.infer<typeof UsageRowSchema>;\n\nexport interface RosterEntry { bot: ApiBot; thread: ApiThread | null; lastMessageAt: number }\nexport interface ThreadWithMessages { thread: ApiThread; messages: ApiMessage[] }\nexport interface UsageSummary {\n totals: { inputTokens: number; outputTokens: number; cacheReadTokens: number };\n byBot: Array<{ botId: string; botName: string; inputTokens: number; outputTokens: number }>;\n byDay: Array<{ day: string; inputTokens: number; outputTokens: number }>;\n byModel: Array<{ model: string; inputTokens: number; outputTokens: number }>;\n}\n"],
5
+ "mapp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