@aisac/cli 0.0.0-stage → 0.4.0-beta.10

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 (46) hide show
  1. package/README.md +202 -2
  2. package/dist/assets/claude/.claude-plugin/plugin.json +147 -0
  3. package/dist/assets/claude/hooks/context-compaction.ts +6934 -0
  4. package/dist/assets/claude/hooks/hooks.json +3 -0
  5. package/dist/assets/claude/hooks/native-host-contract-runtime.ts +18 -0
  6. package/dist/assets/claude/hooks/native-host-contract.test.ts +51 -0
  7. package/dist/assets/claude/hooks/provider-window.js +263 -0
  8. package/dist/assets/claude/hooks/state-fitting.d.mts +47 -0
  9. package/dist/assets/claude/hooks/state-fitting.mjs +324 -0
  10. package/dist/assets/codex-context-compaction.mjs +4786 -0
  11. package/dist/assets/context-selection-fitting.mjs +194 -0
  12. package/dist/assets/context-state-fitting.mjs +324 -0
  13. package/dist/assets/context-telemetry-reporter.mjs +305 -0
  14. package/dist/assets/jev-paid-pilot-terminal.mjs +1066 -0
  15. package/dist/claude-checkpoint.mjs +1338 -0
  16. package/dist/claude-compatibility.mjs +506 -0
  17. package/dist/claude-observation.mjs +1338 -0
  18. package/dist/cli.mjs +805 -0
  19. package/dist/codex-compatibility.mjs +531 -0
  20. package/dist/codex-diagnostics.mjs +447 -0
  21. package/dist/codex-engineering.mjs +165 -0
  22. package/dist/codex-permissions.mjs +590 -0
  23. package/dist/codex-protocol-fingerprint.json +131 -0
  24. package/dist/context-telemetry.mjs +257 -0
  25. package/dist/engineering-pack-public-key.json +10 -0
  26. package/dist/engineering-pack.mjs +845 -0
  27. package/dist/engineering.mjs +194 -0
  28. package/dist/extensions-catalog.mjs +310 -0
  29. package/dist/extensions-cli.mjs +486 -0
  30. package/dist/extensions-preferences.mjs +151 -0
  31. package/dist/guardrails/continuity.mjs +239 -0
  32. package/dist/guardrails/format.mjs +111 -0
  33. package/dist/guardrails/guards.mjs +397 -0
  34. package/dist/guardrails/run.mjs +211 -0
  35. package/dist/guardrails/shell-words.mjs +206 -0
  36. package/dist/guardrails-plugin.mjs +149 -0
  37. package/dist/launch.mjs +786 -0
  38. package/dist/mcp-servers.mjs +192 -0
  39. package/dist/mcp.mjs +962 -0
  40. package/dist/monitor.mjs +166 -0
  41. package/dist/package.json +5 -0
  42. package/dist/platform.mjs +156 -0
  43. package/dist/policy.mjs +218 -0
  44. package/dist/state.mjs +408 -0
  45. package/dist/telemetry-report.mjs +133 -0
  46. package/package.json +24 -4
@@ -0,0 +1,194 @@
1
+ // @ts-check
2
+
3
+ /**
4
+ * AISAC Engineering license check (ADR-0047 wave E3).
5
+ *
6
+ * The server is the only authority. This answer is shown to the user and
7
+ * never unlocks anything locally: every failure is reported as
8
+ * `unavailable`, never as licensed. The account token goes only to the
9
+ * configured AI Brain origin, redirects are refused, and the response is
10
+ * size-bounded and validated before any field is displayed.
11
+ */
12
+
13
+ const LICENSE_PATH = '/engineering/v1/license';
14
+ export const LICENSE_TIMEOUT_MS = 5_000;
15
+ const MAX_LICENSE_BODY_BYTES = 16 * 1024;
16
+ const MAX_URL_LENGTH = 2_048;
17
+ const ISO_INSTANT = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?Z$/u;
18
+ // Reasons are displayed, so only a plain identifier is accepted. New server
19
+ // reasons stay readable by old clients without an allowlist update.
20
+ const SAFE_REASON = /^[a-z][a-z0-9_]{0,63}$/u;
21
+ /** @type {ReadonlyMap<number, string>} */
22
+ const UNAVAILABLE_BY_STATUS = new Map([
23
+ [401, 'unauthorized'],
24
+ [404, 'not_offered'],
25
+ [429, 'rate_limited'],
26
+ [503, 'license_unavailable'],
27
+ ]);
28
+ const SERVER_ERROR_STATUS = 500;
29
+
30
+ /**
31
+ * @typedef {{
32
+ * state: 'active' | 'inactive' | 'unavailable',
33
+ * reason: string,
34
+ * validUntil: string | null,
35
+ * purchaseUrl: string | null
36
+ * }} EngineeringLicense
37
+ */
38
+
39
+ /** @param {string} reason @returns {EngineeringLicense} */
40
+ export function unavailableLicense(reason) {
41
+ return { state: 'unavailable', reason, validUntil: null, purchaseUrl: null };
42
+ }
43
+
44
+ /** @param {string} endpoint */
45
+ export function engineeringLicenseUrl(endpoint) {
46
+ return new URL(LICENSE_PATH, endpoint).toString();
47
+ }
48
+
49
+ /** @param {unknown} value @returns {value is Record<string, unknown>} */
50
+ export function isRecord(value) {
51
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
52
+ }
53
+
54
+ /** @param {unknown} value @returns {value is string} */
55
+ export function isPurchaseUrl(value) {
56
+ if (typeof value !== 'string' || value.length > MAX_URL_LENGTH) return false;
57
+ try {
58
+ const url = new URL(value);
59
+ return url.protocol === 'https:' && url.username === '' && url.password === '';
60
+ } catch {
61
+ return false;
62
+ }
63
+ }
64
+
65
+ /** @param {unknown} value */
66
+ function isValidUntil(value) {
67
+ return (
68
+ value === null ||
69
+ (typeof value === 'string' && ISO_INSTANT.test(value) && Number.isFinite(Date.parse(value)))
70
+ );
71
+ }
72
+
73
+ /**
74
+ * Validate the 200 body of the license route (OpenAPI `EngineeringLicense`).
75
+ * Unknown extra fields are ignored; anything malformed rejects the whole body.
76
+ * @param {string} text
77
+ * @returns {EngineeringLicense | null}
78
+ */
79
+ export function parseLicenseBody(text) {
80
+ let body;
81
+ try {
82
+ body = JSON.parse(text);
83
+ } catch {
84
+ return null;
85
+ }
86
+ if (!isRecord(body) || body.schema_version !== 1 || body.capability !== 'engineering')
87
+ return null;
88
+ const { state, reason, valid_until: validUntil, purchase_url: purchaseUrl } = body;
89
+ if (state !== 'active' && state !== 'inactive') return null;
90
+ if (typeof reason !== 'string' || !SAFE_REASON.test(reason)) return null;
91
+ if (!isValidUntil(validUntil) || !isPurchaseUrl(purchaseUrl)) return null;
92
+ return {
93
+ state,
94
+ reason,
95
+ validUntil: /** @type {string | null} */ (validUntil),
96
+ purchaseUrl: /** @type {string} */ (purchaseUrl),
97
+ };
98
+ }
99
+
100
+ /**
101
+ * Read a response body as UTF-8, refusing anything above `limit` bytes.
102
+ * @param {Response} response
103
+ * @param {number} [limit]
104
+ */
105
+ export async function readBoundedText(response, limit = MAX_LICENSE_BODY_BYTES) {
106
+ const declared = Number(response.headers.get('content-length') ?? '0');
107
+ if (declared > limit) throw new Error('body_too_large');
108
+ if (response.body === null) return '';
109
+ const reader = response.body.getReader();
110
+ /** @type {Uint8Array[]} */
111
+ const chunks = [];
112
+ let size = 0;
113
+ for (;;) {
114
+ const { done, value } = await reader.read();
115
+ if (done) break;
116
+ size += value.byteLength;
117
+ if (size > limit) {
118
+ await reader.cancel().catch(() => undefined);
119
+ throw new Error('body_too_large');
120
+ }
121
+ chunks.push(value);
122
+ }
123
+ return Buffer.concat(chunks).toString('utf8');
124
+ }
125
+
126
+ /** @param {unknown} error */
127
+ export function isTimeout(error) {
128
+ return error instanceof Error && (error.name === 'TimeoutError' || error.name === 'AbortError');
129
+ }
130
+
131
+ /** @param {number} status */
132
+ export function unavailableReasonFor(status) {
133
+ return (
134
+ UNAVAILABLE_BY_STATUS.get(status) ??
135
+ (status >= SERVER_ERROR_STATUS ? 'server_error' : 'unexpected_status')
136
+ );
137
+ }
138
+
139
+ /**
140
+ * Ask the server whether this account holds the AISAC Engineering license.
141
+ * @param {string} endpoint configured AI Brain MCP endpoint (already validated at setup)
142
+ * @param {string} token account PAT
143
+ * @param {{ fetchImpl?: typeof fetch, timeoutMs?: number }} [options]
144
+ * @returns {Promise<EngineeringLicense>}
145
+ */
146
+ export async function checkEngineeringLicense(endpoint, token, options = {}) {
147
+ const { fetchImpl = fetch, timeoutMs = LICENSE_TIMEOUT_MS } = options;
148
+ let url;
149
+ try {
150
+ url = engineeringLicenseUrl(endpoint);
151
+ } catch {
152
+ return unavailableLicense('invalid_endpoint');
153
+ }
154
+ const signal = AbortSignal.timeout(timeoutMs);
155
+ let response;
156
+ try {
157
+ response = await fetchImpl(url, {
158
+ method: 'GET',
159
+ redirect: 'error',
160
+ signal,
161
+ headers: { Authorization: `Bearer ${token}`, Accept: 'application/json' },
162
+ });
163
+ } catch (error) {
164
+ return unavailableLicense(isTimeout(error) ? 'timeout' : 'unreachable');
165
+ }
166
+ if (response.status !== 200) {
167
+ await response.body?.cancel().catch(() => undefined);
168
+ return unavailableLicense(unavailableReasonFor(response.status));
169
+ }
170
+ let text;
171
+ try {
172
+ text = await readBoundedText(response);
173
+ } catch (error) {
174
+ return unavailableLicense(isTimeout(error) ? 'timeout' : 'invalid_response');
175
+ }
176
+ return parseLicenseBody(text) ?? unavailableLicense('invalid_response');
177
+ }
178
+
179
+ /**
180
+ * One line for `aisac setup`. Returns null while the server does not offer the
181
+ * capability yet, so memory-only users see no new noise.
182
+ * @param {EngineeringLicense} license
183
+ * @returns {string | null}
184
+ */
185
+ export function licenseLine(license) {
186
+ if (license.state === 'active') {
187
+ const until = license.validUntil === null ? '' : ` until ${license.validUntil.slice(0, 10)}`;
188
+ return `AISAC Engineering: active${until}.`;
189
+ }
190
+ if (license.state === 'inactive')
191
+ return `AISAC Engineering: inactive (${license.reason}) — ${license.purchaseUrl ?? ''}`.trimEnd();
192
+ if (license.reason === 'not_offered') return null;
193
+ return `AISAC Engineering: unavailable (${license.reason}); memory and context are unaffected.`;
194
+ }
@@ -0,0 +1,310 @@
1
+ // @ts-check
2
+ /**
3
+ * The AISAC Engineering extension catalog (spec aisac-engineering-extensions,
4
+ * FR1, FR2, FR7). It ships with the client and is the only source of hooks
5
+ * and MCP servers: the server and the licensed pack can neither add nor change
6
+ * entries (ADR-0048). Every change to MCP_CATALOG repeats the FR7 review
7
+ * recorded in the spec, and CODEOWNERS covers this file.
8
+ */
9
+
10
+ /** @typedef {'pt-BR' | 'en'} CatalogLocale */
11
+ /** @typedef {'PreToolUse' | 'PostToolUse' | 'UserPromptSubmit' | 'SessionStart' | 'PreCompact' | 'Stop'} HookEvent */
12
+ /** @typedef {'block' | 'advise' | 'context'} HookMode */
13
+ /**
14
+ * @typedef {object} HookBinding
15
+ * @property {HookEvent} event
16
+ * @property {string} [matcher] Tool names (PreToolUse, PostToolUse) or SessionStart sources.
17
+ */
18
+ /**
19
+ * @typedef {object} HookEntry
20
+ * @property {string} id
21
+ * @property {HookMode} mode
22
+ * @property {boolean} defaultOn
23
+ * @property {readonly ('claude' | 'codex')[]} clients
24
+ * @property {readonly HookBinding[]} bindings
25
+ * @property {Readonly<Record<CatalogLocale, string>>} description
26
+ */
27
+
28
+ export const CATALOG_ID = /^[a-z][a-z0-9-]{0,31}$/u;
29
+
30
+ const EDIT_TOOLS = 'Edit|MultiEdit|Write';
31
+
32
+ /** @type {readonly HookEntry[]} */
33
+ export const HOOK_CATALOG = Object.freeze([
34
+ {
35
+ id: 'secrets-guard',
36
+ mode: 'block',
37
+ defaultOn: true,
38
+ clients: ['claude'],
39
+ bindings: [
40
+ { event: 'PreToolUse', matcher: 'Read|Edit|MultiEdit|Write|NotebookEdit|Grep|Bash' },
41
+ ],
42
+ description: {
43
+ en: 'Refuses reading or writing secret files (.env, keys, credentials); decides from names only.',
44
+ 'pt-BR':
45
+ 'Recusa ler ou gravar arquivos de segredo (.env, chaves, credenciais); decide só pelo nome.',
46
+ },
47
+ },
48
+ {
49
+ id: 'git-guard',
50
+ mode: 'block',
51
+ defaultOn: false,
52
+ clients: ['claude'],
53
+ bindings: [{ event: 'PreToolUse', matcher: 'Bash' }],
54
+ description: {
55
+ en: 'Refuses git push to main or master and force pushes (--force-with-lease passes).',
56
+ 'pt-BR': 'Recusa git push na main ou master e push forçado (--force-with-lease passa).',
57
+ },
58
+ },
59
+ {
60
+ id: 'destructive-guard',
61
+ mode: 'block',
62
+ defaultOn: false,
63
+ clients: ['claude'],
64
+ bindings: [{ event: 'PreToolUse', matcher: 'Bash' }],
65
+ description: {
66
+ en: 'Refuses rm -rf on /, ~, . or .. and DROP DATABASE, DROP TABLE or TRUNCATE.',
67
+ 'pt-BR': 'Recusa rm -rf em /, ~, . ou .. e DROP DATABASE, DROP TABLE ou TRUNCATE.',
68
+ },
69
+ },
70
+ {
71
+ id: 'format-on-edit',
72
+ mode: 'advise',
73
+ defaultOn: false,
74
+ clients: ['claude'],
75
+ bindings: [{ event: 'PostToolUse', matcher: EDIT_TOOLS }],
76
+ description: {
77
+ en: "Formats the edited file with the project's own formatter, when one is installed.",
78
+ 'pt-BR': 'Formata o arquivo editado com o formatador do próprio projeto, quando houver.',
79
+ },
80
+ },
81
+ {
82
+ id: 'docs-reminder',
83
+ mode: 'advise',
84
+ defaultOn: true,
85
+ clients: ['claude'],
86
+ bindings: [{ event: 'PostToolUse', matcher: EDIT_TOOLS }, { event: 'UserPromptSubmit' }],
87
+ description: {
88
+ en: 'After a source file changes in a project with docs/, reminds once per turn to update the docs.',
89
+ 'pt-BR':
90
+ 'Quando um arquivo de código muda num projeto com docs/, lembra uma vez por turno de atualizar a documentação.',
91
+ },
92
+ },
93
+ {
94
+ id: 'session-context',
95
+ mode: 'context',
96
+ defaultOn: true,
97
+ clients: ['claude'],
98
+ bindings: [{ event: 'SessionStart', matcher: 'startup|resume|clear' }],
99
+ description: {
100
+ en: 'Starts the session with a short repository snapshot (branch, status, recent commits).',
101
+ 'pt-BR': 'Abre a sessão com um resumo do repositório (branch, status, commits recentes).',
102
+ },
103
+ },
104
+ {
105
+ id: 'compact-continuity',
106
+ mode: 'context',
107
+ defaultOn: true,
108
+ clients: ['claude'],
109
+ bindings: [{ event: 'PreCompact' }, { event: 'SessionStart', matcher: 'compact' }],
110
+ description: {
111
+ en: 'Saves a repository snapshot before a compaction and restores it right after.',
112
+ 'pt-BR': 'Salva um resumo do repositório antes do compact e o devolve logo depois.',
113
+ },
114
+ },
115
+ {
116
+ id: 'continuity-reminder',
117
+ mode: 'block',
118
+ defaultOn: true,
119
+ clients: ['claude'],
120
+ bindings: [
121
+ { event: 'PostToolUse', matcher: EDIT_TOOLS },
122
+ { event: 'UserPromptSubmit' },
123
+ { event: 'Stop' },
124
+ ],
125
+ description: {
126
+ en: 'In a project with NOTES.md, asks once per turn to update NOTES.md, the spec or the CHANGELOG after code changes.',
127
+ 'pt-BR':
128
+ 'Num projeto com NOTES.md, pede uma vez por turno para atualizar NOTES.md, a spec ou o CHANGELOG depois de mudanças no código.',
129
+ },
130
+ },
131
+ ]);
132
+
133
+ /** @param {string} id @returns {HookEntry | undefined} */
134
+ export function hookById(id) {
135
+ return HOOK_CATALOG.find((entry) => entry.id === id);
136
+ }
137
+
138
+ /** @returns {string[]} */
139
+ export function hookIds() {
140
+ return HOOK_CATALOG.map((entry) => entry.id);
141
+ }
142
+
143
+ /**
144
+ * @typedef {object} McpHttpTransport
145
+ * @property {'http'} type
146
+ * @property {string} url Exact URL. Hosts key a stored login by server name and URL.
147
+ * @property {string} [bearerEnv] Environment variable that holds a bearer token. The
148
+ * catalog names it; its value is never stored or read by AISAC.
149
+ */
150
+ /**
151
+ * @typedef {object} McpStdioTransport
152
+ * @property {'stdio'} type
153
+ * @property {'npx'} command
154
+ * @property {readonly string[]} args Pinned to an exact package version (FR7).
155
+ */
156
+ /** @typedef {'host-oauth' | 'optional-oauth' | 'env-token' | 'none'} McpLogin */
157
+ /**
158
+ * @typedef {object} McpEntry
159
+ * @property {string} id
160
+ * @property {false} defaultOn Every catalog server starts off (FR7).
161
+ * @property {readonly ('claude' | 'codex')[]} clients
162
+ * @property {string} publisher
163
+ * @property {string} source The vendor's repository or documentation.
164
+ * @property {McpHttpTransport | McpStdioTransport} transport
165
+ * @property {McpLogin} login
166
+ * @property {string} [setup] A one-time command the user runs before the first use.
167
+ * @property {Readonly<Record<CatalogLocale, string>>} [loginNote] Why and how this login differs.
168
+ * @property {Readonly<Record<CatalogLocale, string>>} description
169
+ * @property {Readonly<Record<CatalogLocale, string>>} reaches What the server can reach (FR7).
170
+ * @property {readonly string[]} [blockedTools] Tools that spend money, removed in both
171
+ * clients whatever the user's permission mode is (FR7.2). Exact names.
172
+ * @property {readonly string[]} [blockedToolPrefixes] Name prefixes removed in Claude Code
173
+ * only, through a glob deny rule; Codex documents exact names only (FR7.2).
174
+ */
175
+
176
+ /** Session name of a catalog server, so it never collides with the user's own. */
177
+ export const MCP_SERVER_PREFIX = 'aisac-';
178
+ const PLAYWRIGHT_PACKAGE = '@playwright/mcp@0.0.83';
179
+
180
+ /**
181
+ * MCP catalog v1 (spec FR7; the owner chose the list on 2026-11-03). The review of
182
+ * each entry (source, transport, login, tools, reach) is recorded in the spec.
183
+ * @type {readonly McpEntry[]}
184
+ */
185
+ export const MCP_CATALOG = Object.freeze([
186
+ {
187
+ id: 'github',
188
+ defaultOn: false,
189
+ clients: ['claude', 'codex'],
190
+ publisher: 'GitHub',
191
+ source: 'https://github.com/github/github-mcp-server',
192
+ transport: {
193
+ type: 'http',
194
+ url: 'https://api.githubcopilot.com/mcp/readonly',
195
+ bearerEnv: 'GITHUB_PERSONAL_ACCESS_TOKEN',
196
+ },
197
+ login: 'env-token',
198
+ loginNote: {
199
+ en: 'GitHub offers no OAuth login for Claude Code or Codex, so this server takes a personal access token. Use a fine-grained token with read-only access to only the repositories you need, and an expiry date: in Claude Code the session’s shell commands can also read this variable.',
200
+ 'pt-BR':
201
+ 'O GitHub não oferece login OAuth para o Claude Code nem para o Codex, então este servidor usa um token de acesso pessoal. Use um token fine-grained, somente leitura, só nos repositórios de que você precisa e com data de validade: no Claude Code os comandos de shell da sessão também conseguem ler essa variável.',
202
+ },
203
+ description: {
204
+ en: "GitHub's hosted server, read-only: repositories, issues, pull requests and users.",
205
+ 'pt-BR':
206
+ 'Servidor hospedado do GitHub, somente leitura: repositórios, issues, pull requests e usuários.',
207
+ },
208
+ reaches: {
209
+ en: 'Reads what your token can see: repository files, commits, branches, releases, issues, pull requests, and user and team profiles. This read-only URL exposes no write tool.',
210
+ 'pt-BR':
211
+ 'Lê o que o seu token enxerga: arquivos, commits, branches e releases dos repositórios, issues, pull requests e perfis de usuários e times. Esta URL somente leitura não expõe ferramenta de escrita.',
212
+ },
213
+ },
214
+ {
215
+ id: 'supabase',
216
+ defaultOn: false,
217
+ clients: ['claude', 'codex'],
218
+ publisher: 'Supabase',
219
+ source: 'https://github.com/supabase-community/supabase-mcp',
220
+ transport: { type: 'http', url: 'https://mcp.supabase.com/mcp?read_only=true' },
221
+ login: 'host-oauth',
222
+ // read_only=true should already leave these out; the vendor does not publish
223
+ // what it removes, so they are blocked as a second layer (FR7.2).
224
+ blockedTools: ['create_project', 'confirm_cost', 'create_branch'],
225
+ description: {
226
+ en: "Supabase's hosted server, read-only: tables, SQL, logs, advisors and docs.",
227
+ 'pt-BR':
228
+ 'Servidor hospedado da Supabase, somente leitura: tabelas, SQL, logs, advisors e documentação.',
229
+ },
230
+ reaches: {
231
+ en: 'Every organization and project of the Supabase account you log in with: database contents through read-only SQL, migrations, logs, advisors, Edge Functions, project URLs and publishable keys. read_only=true runs SQL as a read-only Postgres role and leaves out the write tools; the login grants the scopes you approve on Supabase.',
232
+ 'pt-BR':
233
+ 'Todas as organizações e projetos da conta Supabase em que você entrar: dados do banco por SQL somente leitura, migrations, logs, advisors, Edge Functions, URLs dos projetos e chaves publicáveis. read_only=true executa o SQL com um papel Postgres somente leitura e deixa de fora as ferramentas de escrita; o login concede os escopos que você aprovar na Supabase.',
234
+ },
235
+ },
236
+ {
237
+ id: 'vercel',
238
+ defaultOn: false,
239
+ clients: ['claude', 'codex'],
240
+ publisher: 'Vercel',
241
+ source: 'https://vercel.com/docs/agent-resources/vercel-mcp',
242
+ transport: { type: 'http', url: 'https://mcp.vercel.com' },
243
+ login: 'host-oauth',
244
+ // buy_domain charges the team after a quote, and its confirm flag is a model
245
+ // argument; a domain transfer may be charged (FR7.1, FR7.2).
246
+ blockedTools: ['buy_domain', 'create_or_transfer_domain'],
247
+ blockedToolPrefixes: ['buy_'],
248
+ description: {
249
+ en: "Vercel's hosted server: projects, deployments, logs, domains and environment variables.",
250
+ 'pt-BR':
251
+ 'Servidor hospedado da Vercel: projetos, deploys, logs, domínios e variáveis de ambiente.',
252
+ },
253
+ reaches: {
254
+ en: 'The teams you grant at login, with the access of your Vercel user: projects, deployments, build and runtime logs, domains and DNS, and environment variables, including decrypted values. It also has write tools (deployments, environment variables, DNS records, firewall rules, project settings) and no read-only mode, so keep the confirmation of each call on. Buying domains is blocked by AISAC.',
255
+ 'pt-BR':
256
+ 'Os times que você liberar no login, com o acesso do seu usuário Vercel: projetos, deploys, logs de build e de execução, domínios e DNS, e variáveis de ambiente, inclusive valores decifrados. Também tem ferramentas de escrita (deploys, variáveis de ambiente, registros DNS, regras de firewall, configurações de projeto) e não tem modo somente leitura, então mantenha a confirmação de cada chamada ligada. A compra de domínios é bloqueada pela AISAC.',
257
+ },
258
+ },
259
+ {
260
+ id: 'playwright',
261
+ defaultOn: false,
262
+ clients: ['claude', 'codex'],
263
+ publisher: 'Microsoft',
264
+ source: 'https://github.com/microsoft/playwright-mcp',
265
+ transport: {
266
+ type: 'stdio',
267
+ command: 'npx',
268
+ args: ['-y', PLAYWRIGHT_PACKAGE, '--browser', 'chromium', '--headless', '--isolated'],
269
+ },
270
+ login: 'none',
271
+ setup: `npx -y ${PLAYWRIGHT_PACKAGE} install-browser chrome-for-testing`,
272
+ description: {
273
+ en: 'A local headless browser driven by Playwright, for testing web pages.',
274
+ 'pt-BR': 'Um navegador local sem janela, controlado pelo Playwright, para testar páginas.',
275
+ },
276
+ reaches: {
277
+ en: 'Runs on your machine with a fresh in-memory profile each session, so no saved logins. It opens any URL the agent asks for, including localhost and your local network, can run JavaScript in the page and upload files from the project. Page content is untrusted input.',
278
+ 'pt-BR':
279
+ 'Roda na sua máquina com um perfil novo em memória a cada sessão, sem logins salvos. Abre qualquer URL que o agente pedir, inclusive localhost e a sua rede local, pode executar JavaScript na página e enviar arquivos do projeto. O conteúdo das páginas é entrada não confiável.',
280
+ },
281
+ },
282
+ {
283
+ id: 'context7',
284
+ defaultOn: false,
285
+ clients: ['claude', 'codex'],
286
+ publisher: 'Upstash',
287
+ source: 'https://github.com/upstash/context7',
288
+ transport: { type: 'http', url: 'https://mcp.context7.com/mcp' },
289
+ login: 'optional-oauth',
290
+ description: {
291
+ en: 'Up-to-date documentation and code examples for libraries, from Context7.',
292
+ 'pt-BR': 'Documentação e exemplos de código atualizados de bibliotecas, do Context7.',
293
+ },
294
+ reaches: {
295
+ en: 'Public library documentation only. What the agent asks (library names and questions) goes to Upstash, so keep secrets and private code out of those questions. It works without login, with lower rate limits.',
296
+ 'pt-BR':
297
+ 'Só documentação pública de bibliotecas. O que o agente pergunta (nomes de bibliotecas e dúvidas) vai para a Upstash, então não coloque segredos nem código privado nessas perguntas. Funciona sem login, com limites de uso menores.',
298
+ },
299
+ },
300
+ ]);
301
+
302
+ /** @param {string} id @returns {McpEntry | undefined} */
303
+ export function mcpById(id) {
304
+ return MCP_CATALOG.find((entry) => entry.id === id);
305
+ }
306
+
307
+ /** @returns {string[]} */
308
+ export function mcpIds() {
309
+ return MCP_CATALOG.map((entry) => entry.id);
310
+ }