@ainecto/cli 0.8.1 → 0.9.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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/core/auth/tokenStore.ts","../../src/core/auth/oauth.ts","../../src/core/config/endpoints.ts","../../src/core/auth/clientRegistration.ts","../../src/core/input/payloadSource.ts","../../src/core/harness/legacyRole.ts","../../src/core/version.ts","../../src/core/mcp/rpcClient.ts","../../src/core/output/render.ts","../../src/core/catalog/generated.prod.ts","../../src/core/catalog/generated.dev.ts","../../src/core/catalog/generator.ts","../../src/core/catalog/index.ts","../../src/core/mcp/stdioBridge.ts","../../src/adapters/mcp/connector.ts","../../src/core/catalog/enrichments.ts","../../src/core/output/table.ts","../../src/adapters/cli/errors.ts","../../src/adapters/cli/flagParser.ts","../../src/adapters/cli/destructiveConfirmation.ts","../../src/adapters/cli/bespokeCommands.ts","../../src/adapters/cli/generatedCommandRouter.ts","../../src/core/upload/attachmentUpload.ts","../../src/core/mcp/toolPayload.ts","../../src/adapters/cli/attachmentsUploadCommand.ts","../../src/adapters/cli/inboxPollCommands.ts","../../src/adapters/cli/initCommand.ts","../../src/core/harness/agentTargets.ts","../../src/core/harness/harnessDoc.ts","../../src/core/harness/initRecord.ts","../../src/core/harness/initPlan.ts","../../src/core/harness/documentFetch.ts","../../src/core/harness/repositoryFiles.ts","../../src/core/setup/accountSummary.ts","../../src/core/setup/agentConnections.ts","../../src/core/setup/commandRunner.ts","../../src/adapters/cli/setupCommand.ts","../../src/core/setup/doctorChecks.ts","../../src/core/setup/machineStatus.ts","../../src/adapters/cli/statusCommand.ts","../../src/adapters/cli/ainectoCli.ts","../../src/bin/ainecto.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { mkdir, readFile, rename, rm, stat, writeFile, chmod } from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nexport interface StoredTokenSet {\n endpoint: string;\n accessToken: string;\n refreshToken?: string;\n tokenType?: string;\n expiresAt?: number;\n scope?: string;\n clientId?: string;\n clientSecret?: string;\n authorizationServer?: string;\n updatedAt: string;\n}\n\n/**\n * 토큰 저장소 — ★서버(endpoint)마다 «한 칸»이다(설계 0.4.2 §2-4). 세션 역할은 없다(0.8.0).\n * 0.4.1 이하가 쓴 역할별 칸은 읽지도 지우지도 않는다(사용자 결정 «마이그레이션은 고려하지 마»).\n */\nexport interface TokenStore {\n load(endpoint: string): Promise<StoredTokenSet | undefined>;\n save(endpoint: string, token: StoredTokenSet): Promise<void>;\n delete(endpoint: string): Promise<void>;\n}\n\ntype TokenFile = Record<string, StoredTokenSet>;\n\nexport class FileTokenStore implements TokenStore {\n readonly filePath: string;\n\n constructor(rootDir = join(homedir(), \".ainecto\")) {\n this.filePath = join(rootDir, \"tokens.json\");\n }\n\n async load(endpoint: string): Promise<StoredTokenSet | undefined> {\n const file = await this.readFile();\n return file[tokenKey(endpoint)];\n }\n\n async save(endpoint: string, token: StoredTokenSet): Promise<void> {\n const file = await this.readFile();\n file[tokenKey(endpoint)] = { ...token, endpoint, updatedAt: new Date().toISOString() };\n await this.writeFile(file);\n }\n\n async delete(endpoint: string): Promise<void> {\n const file = await this.readFile();\n delete file[tokenKey(endpoint)];\n await this.writeFile(file);\n }\n\n private async readFile(): Promise<TokenFile> {\n try {\n await this.hardenExistingPermissions();\n const raw = await readFile(this.filePath, \"utf8\");\n const parsed = JSON.parse(raw) as unknown;\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n throw new Error(\"Token file must contain an object.\");\n }\n return parsed as TokenFile;\n } catch (error) {\n if (isNodeError(error, \"ENOENT\")) {\n return {};\n }\n throw error;\n }\n }\n\n private async writeFile(file: TokenFile): Promise<void> {\n await mkdir(dirname(this.filePath), { recursive: true, mode: 0o700 });\n await chmod(dirname(this.filePath), 0o700);\n const tmpPath = `${this.filePath}.${process.pid}.${Date.now()}.tmp`;\n await writeFile(tmpPath, `${JSON.stringify(file, null, 2)}\\n`, { mode: 0o600 });\n await chmod(tmpPath, 0o600);\n await rename(tmpPath, this.filePath);\n await chmod(this.filePath, 0o600);\n }\n\n private async hardenExistingPermissions(): Promise<void> {\n const dirPath = dirname(this.filePath);\n await chmodIfPermissive(dirPath, 0o700);\n await chmodIfPermissive(this.filePath, 0o600);\n }\n}\n\n/** 서버 하나의 칸. 0.4.1 이하의 «역할 없는» 칸과 같은 키다 — 그때 역할 없이 로그인해 둔 사람은 그대로 쓴다. */\nexport function tokenKey(endpoint: string): string {\n return createHash(\"sha256\").update(endpoint).digest(\"hex\");\n}\n\nexport async function tokenStorePermissions(path: string): Promise<{ mode: number } | undefined> {\n try {\n const result = await stat(path);\n return { mode: result.mode & 0o777 };\n } catch (error) {\n if (isNodeError(error, \"ENOENT\")) {\n return undefined;\n }\n throw error;\n }\n}\n\nexport async function tokenStoreDirectoryPermissions(path: string): Promise<{ mode: number } | undefined> {\n return tokenStorePermissions(dirname(path));\n}\n\nexport async function removeTokenStoreForTests(path: string): Promise<void> {\n await rm(dirname(path), { recursive: true, force: true });\n}\n\nfunction isNodeError(error: unknown, code: string): error is NodeJS.ErrnoException {\n return error instanceof Error && \"code\" in error && error.code === code;\n}\n\nasync function chmodIfPermissive(path: string, mode: number): Promise<void> {\n try {\n const result = await stat(path);\n if ((result.mode & 0o077) !== 0) {\n await chmod(path, mode);\n }\n } catch (error) {\n if (isNodeError(error, \"ENOENT\")) {\n return;\n }\n throw error;\n }\n}\n","import { createHash, randomBytes } from \"node:crypto\";\nimport { createServer } from \"node:http\";\nimport { spawn, type ChildProcess, type SpawnOptions } from \"node:child_process\";\nimport { URLSearchParams } from \"node:url\";\nimport type { StoredTokenSet, TokenStore } from \"./tokenStore\";\nimport { registerPublicClient, type ClientRegistrationResult } from \"./clientRegistration\";\nimport { assertTrustedEndpointUrl, isDefaultEndpoint } from \"../config/endpoints\";\n\n/**\n * ★로그인은 서버마다 한 번이다(설계 0.4.2). 토큰은 역할을 싣지 않고, 역할은 저장소에서 와서\n * 요청 헤더로 실린다({@link McpRpcClient}). 그래서 이 클라이언트에는 역할이 없다.\n */\nexport interface OAuthClientOptions {\n endpoint: string;\n tokenStore: TokenStore;\n fetchImpl?: typeof fetch;\n envVars?: NodeJS.ProcessEnv;\n /**\n * 브라우저를 연다. <b>열기에 실패하면 거절</b>하고, 성공이 확인되면(또는 아직 모르면) 가만히 있는다.\n * login 은 이 약속을 «기다리지 않고» 콜백 대기와 경주시킨다 — 여는 명령이 브라우저가 닫힐 때까지\n * 안 끝나는 환경에서 순서대로 기다리면 교착한다.\n */\n openBrowser?: (url: string) => Promise<void>;\n /**\n * 인가 URL 을 «브라우저를 열기 전에» 알린다. CLI 는 stderr 에 한 줄 쓴다 — 브라우저가 안 열려도\n * 사람이 직접 열 수 있고, 에이전트가 실행했다면 명령이 끝날 때 그 줄이 에이전트에게 닿는다.\n */\n onAuthorizeUrl?: (url: string) => void;\n /** 콜백을 기다리는 한도. 기본 5분 — 사람이 로그인하기엔 넉넉하고, 에이전트 셸 도구 최대 한도보다 짧다. */\n loginTimeoutMs?: number;\n /**\n * 토큰 저장소를 «읽기만» 한다 — 갱신하지 않는다(네트워크도, 토큰 파일 쓰기도 없다).\n * {@code init --dry-run} 이 쓴다: 「아무것도 바꾸지 않는다」에 사용자의 로그인 상태도 든다.\n * 갱신이 필요한(만료된) 토큰은 «없음»으로 본다.\n */\n readOnly?: boolean;\n}\n\n/** 로그인 대기 기본 한도(5분). */\nexport const DEFAULT_LOGIN_TIMEOUT_MS = 300_000;\n\n/**\n * 로그인이 «사람 쪽 사정으로» 끝나지 못한 이유. {@code code} 는 {@code --json} 의 {@code error.code} 로\n * 그대로 나간다(종료 코드는 다른 실패와 같은 1 — 받는 쪽은 메시지를 읽고 사람에게 옮긴다).\n */\nexport class OAuthLoginError extends Error {\n constructor(readonly code: \"LOGIN_TIMEOUT\" | \"BROWSER_UNAVAILABLE\" | \"CALLBACK_UNAVAILABLE\", message: string) {\n super(message);\n this.name = \"OAuthLoginError\";\n }\n}\n\n/**\n * ★저장된 로그인을 인증 서버가 «더는 받지 않는다» — 갱신 요청이 {@code invalid_grant} 등으로 거절됐다\n * (RFC 6749 §5.2: refresh token 만료·폐기, client 등록 폐기). 다시 로그인하는 것 말고는 길이 없다.\n *\n * <p>⚠네트워크 장애·5xx·메타데이터 실패는 이것이 아니다 — 그건 다시 로그인해도 안 고쳐지고,\n * 로그인으로 삼키면 진짜 원인이 브라우저 창 뒤로 숨는다.\n */\nexport class OAuthReauthRequiredError extends Error {\n constructor(readonly oauthError: string, status: number) {\n super(`The stored sign-in was rejected by the server (${oauthError}, HTTP ${status}). Sign in again.`);\n this.name = \"OAuthReauthRequiredError\";\n }\n}\n\n/** 갱신 거절 중 «다시 로그인하라»는 뜻인 OAuth 오류 코드(RFC 6749 §5.2). */\nconst REAUTH_REQUIRED_ERRORS = new Set([\"invalid_grant\", \"invalid_client\", \"unauthorized_client\"]);\n\nexport interface OAuthMetadata {\n authorizationEndpoint: string;\n tokenEndpoint: string;\n registrationEndpoint?: string;\n issuer?: string;\n codeChallengeMethodsSupported: string[];\n}\n\nexport interface TokenProvider {\n getAccessToken(): Promise<string | undefined>;\n refreshAfterUnauthorized(): Promise<string | undefined>;\n}\n\nexport class OAuthClient implements TokenProvider {\n private readonly fetchImpl: typeof fetch;\n private readonly envVars: NodeJS.ProcessEnv;\n private readonly openBrowserImpl: (url: string) => Promise<void>;\n\n constructor(private readonly options: OAuthClientOptions) {\n this.fetchImpl = options.fetchImpl ?? fetch;\n this.envVars = options.envVars ?? process.env;\n this.openBrowserImpl = options.openBrowser ?? openBrowser;\n }\n\n async getAccessToken(): Promise<string | undefined> {\n const envToken = this.envVars.AINECTO_TOKEN;\n if (envToken) {\n assertEnvTokenEndpointAllowed(this.options.endpoint, this.envVars);\n return envToken;\n }\n\n const stored = await this.options.tokenStore.load(this.options.endpoint);\n if (!stored) {\n return undefined;\n }\n\n if (!shouldRefresh(stored)) {\n return stored.accessToken;\n }\n if (this.options.readOnly) {\n return isExpired(stored) ? undefined : stored.accessToken;\n }\n // ★만료됐는데 갱신할 수단이 없으면 «토큰 없음»이다. 예전엔 만료된 토큰을 그대로 돌려줘서,\n // init 은 로그인 대신 401 안내로 떨어졌고 다른 경로는 받을 게 뻔한 401 을 받으러 갔다\n // (2026-09-29 독립 리뷰 P1-2). 아직 60초 창 안이면 쓸 수 있으므로 돌려준다.\n if (!stored.refreshToken) {\n return isExpired(stored) ? undefined : stored.accessToken;\n }\n\n return this.refreshStoredToken({ ...stored, refreshToken: stored.refreshToken });\n }\n\n async refreshAfterUnauthorized(): Promise<string | undefined> {\n const stored = await this.options.tokenStore.load(this.options.endpoint);\n if (this.options.readOnly || !stored?.refreshToken) {\n return undefined;\n }\n return this.refreshStoredToken({ ...stored, refreshToken: stored.refreshToken });\n }\n\n async login(): Promise<StoredTokenSet> {\n const pkce = generatePkcePair();\n const state = generateOAuthState();\n const loopback = await createLoopbackReceiver(state);\n\n try {\n const metadata = await discoverOAuthMetadata(this.options.endpoint, this.fetchImpl);\n const registration = metadata.registrationEndpoint\n ? await registerPublicClient(metadata.registrationEndpoint, loopback.redirectUri, this.fetchImpl)\n : { clientId: \"ainecto-cli\" };\n const authorizeUrl = new URL(metadata.authorizationEndpoint);\n authorizeUrl.searchParams.set(\"response_type\", \"code\");\n authorizeUrl.searchParams.set(\"client_id\", registration.clientId);\n authorizeUrl.searchParams.set(\"redirect_uri\", loopback.redirectUri);\n authorizeUrl.searchParams.set(\"code_challenge\", pkce.codeChallenge);\n authorizeUrl.searchParams.set(\"code_challenge_method\", \"S256\");\n authorizeUrl.searchParams.set(\"resource\", this.options.endpoint);\n authorizeUrl.searchParams.set(\"state\", state);\n // ★역할을 scope 에 싣지 않는다(설계 0.4.2) — 로그인은 서버마다 한 번이고, 역할은 저장소에서\n // 요청 헤더로 온다. 역할은 작업 가드레일이지 보안 경계가 아니다(2026-09-29 사용자 결정 Q1).\n\n assertTrustedEndpointUrl(authorizeUrl, \"OAuth authorization URL\");\n const url = authorizeUrl.toString();\n this.options.onAuthorizeUrl?.(url);\n // ★셋 중 먼저 오는 것이 결과다 — 콜백 도착 / 브라우저 열기 실패 / 시간 한도.\n // 예전엔 한도가 없고 열기 실패를 못 봐서, 브라우저가 없는 기계에서 말없이 영원히 기다렸다\n // (2026-09-29 독립 리뷰 P1-2). 비TTY(에이전트가 실행)에서는 그 대기가 곧 멈춤이다.\n const browserFailure = this.openBrowserImpl(url).then(() => new Promise<never>(() => undefined));\n const code = await withTimeout(\n Promise.race([loopback.waitForCode(), browserFailure]),\n this.options.loginTimeoutMs ?? DEFAULT_LOGIN_TIMEOUT_MS,\n );\n const token = await exchangeToken(metadata.tokenEndpoint, {\n grant_type: \"authorization_code\",\n code,\n redirect_uri: loopback.redirectUri,\n client_id: registration.clientId,\n code_verifier: pkce.codeVerifier,\n resource: this.options.endpoint,\n ...(registration.clientSecret ? { client_secret: registration.clientSecret } : {}),\n }, this.fetchImpl);\n\n const stored = toStoredToken(this.options.endpoint, token, metadata, registration);\n await this.options.tokenStore.save(this.options.endpoint, stored);\n return stored;\n } finally {\n await loopback.close();\n }\n }\n\n async logout(): Promise<void> {\n await this.options.tokenStore.delete(this.options.endpoint);\n }\n\n /** 부르는 쪽이 refresh token 이 있음을 이미 확인했다 — 타입이 그것을 요구한다. */\n private async refreshStoredToken(stored: StoredTokenSet & { refreshToken: string }): Promise<string | undefined> {\n const metadata = await discoverOAuthMetadata(this.options.endpoint, this.fetchImpl);\n const token = await exchangeToken(metadata.tokenEndpoint, {\n grant_type: \"refresh_token\",\n refresh_token: stored.refreshToken,\n client_id: stored.clientId ?? \"ainecto-cli\",\n ...(stored.clientSecret ? { client_secret: stored.clientSecret } : {}),\n resource: this.options.endpoint,\n }, this.fetchImpl);\n const next = toStoredToken(this.options.endpoint, token, metadata, stored);\n await this.options.tokenStore.save(this.options.endpoint, next);\n return next.accessToken;\n }\n}\n\nexport function generatePkcePair(): { codeVerifier: string; codeChallenge: string } {\n const codeVerifier = randomBytes(32).toString(\"base64url\");\n const codeChallenge = createHash(\"sha256\").update(codeVerifier).digest(\"base64url\");\n return { codeVerifier, codeChallenge };\n}\n\nexport function generateOAuthState(): string {\n return randomBytes(32).toString(\"base64url\");\n}\n\n/** 이미 만료됐는가. 만료 시각이 없으면 만료되지 않은 것으로 본다(서버가 수명을 안 알려 준 토큰). */\nexport function isExpired(token: Pick<StoredTokenSet, \"expiresAt\">, now = Date.now()): boolean {\n return token.expiresAt !== undefined && token.expiresAt <= now;\n}\n\nasync function withTimeout<T>(work: Promise<T>, timeoutMs: number): Promise<T> {\n let timer: NodeJS.Timeout | undefined;\n const timeout = new Promise<never>((_, reject) => {\n timer = setTimeout(() => {\n const minutes = timeoutMs / 60_000;\n const span = Number.isInteger(minutes) ? `${minutes} minute${minutes === 1 ? \"\" : \"s\"}` : `${timeoutMs} ms`;\n reject(new OAuthLoginError(\n \"LOGIN_TIMEOUT\",\n `Sign-in was not completed within ${span}. Nothing was saved — run the same command again.`,\n ));\n }, timeoutMs);\n });\n try {\n return await Promise.race([work, timeout]);\n } finally {\n clearTimeout(timer);\n }\n}\n\nexport function shouldRefresh(token: Pick<StoredTokenSet, \"expiresAt\">, now = Date.now()): boolean {\n if (!token.expiresAt) {\n return false;\n }\n return token.expiresAt - now < 60_000;\n}\n\nexport async function discoverOAuthMetadata(endpoint: string, fetchImpl: typeof fetch = fetch): Promise<OAuthMetadata> {\n assertTrustedEndpointUrl(endpoint, \"MCP endpoint\");\n const resourceMetadataUrl = await discoverResourceMetadataUrl(endpoint, fetchImpl);\n assertTrustedEndpointUrl(resourceMetadataUrl, \"OAuth protected resource metadata URL\");\n const resourceMetadata = await fetchJson<Record<string, unknown>>(resourceMetadataUrl, fetchImpl);\n const authorizationServers = resourceMetadata.authorization_servers;\n if (!Array.isArray(authorizationServers) || typeof authorizationServers[0] !== \"string\") {\n throw new Error(\"OAuth protected resource metadata did not include authorization_servers.\");\n }\n const authServer = authorizationServers[0];\n assertTrustedEndpointUrl(authServer, \"OAuth authorization server\");\n const metadataUrl = authServer.includes(\"/.well-known/\")\n ? authServer\n : `${authServer.replace(/\\/$/, \"\")}/.well-known/oauth-authorization-server`;\n assertTrustedEndpointUrl(metadataUrl, \"OAuth authorization server metadata URL\");\n const metadata = await fetchJson<Record<string, unknown>>(metadataUrl, fetchImpl);\n if (typeof metadata.authorization_endpoint !== \"string\" || typeof metadata.token_endpoint !== \"string\") {\n throw new Error(\"OAuth authorization server metadata is missing authorization_endpoint or token_endpoint.\");\n }\n assertTrustedEndpointUrl(metadata.authorization_endpoint, \"OAuth authorization endpoint\");\n assertTrustedEndpointUrl(metadata.token_endpoint, \"OAuth token endpoint\");\n if (typeof metadata.registration_endpoint === \"string\") {\n assertTrustedEndpointUrl(metadata.registration_endpoint, \"OAuth client registration endpoint\");\n }\n if (typeof metadata.issuer === \"string\") {\n assertTrustedEndpointUrl(metadata.issuer, \"OAuth issuer\");\n }\n const codeChallengeMethodsSupported = parseStringArray(metadata.code_challenge_methods_supported);\n if (!codeChallengeMethodsSupported.includes(\"S256\")) {\n throw new Error(\"OAuth authorization server metadata must support PKCE S256.\");\n }\n return {\n authorizationEndpoint: metadata.authorization_endpoint,\n tokenEndpoint: metadata.token_endpoint,\n registrationEndpoint: typeof metadata.registration_endpoint === \"string\" ? metadata.registration_endpoint : undefined,\n issuer: typeof metadata.issuer === \"string\" ? metadata.issuer : undefined,\n codeChallengeMethodsSupported,\n };\n}\n\nasync function discoverResourceMetadataUrl(endpoint: string, fetchImpl: typeof fetch): Promise<string> {\n const challengeUrl = new URL(endpoint);\n assertTrustedEndpointUrl(challengeUrl, \"MCP endpoint\");\n const response = await fetchImpl(challengeUrl, { method: \"GET\" });\n const challenge = response.headers.get(\"www-authenticate\");\n const fromChallenge = challenge ? parseBearerChallengeParam(challenge, \"resource_metadata\") : undefined;\n if (fromChallenge) {\n assertTrustedEndpointUrl(fromChallenge, \"OAuth protected resource metadata URL\");\n return fromChallenge;\n }\n const origin = new URL(endpoint).origin;\n const fallback = `${origin}/.well-known/oauth-protected-resource`;\n assertTrustedEndpointUrl(fallback, \"OAuth protected resource metadata URL\");\n return fallback;\n}\n\nexport function parseBearerChallengeParam(header: string, name: string): string | undefined {\n const pattern = new RegExp(`${name}=\"([^\"]+)\"`);\n return pattern.exec(header)?.[1];\n}\n\nasync function exchangeToken(\n tokenEndpoint: string,\n params: Record<string, string>,\n fetchImpl: typeof fetch,\n): Promise<Record<string, unknown>> {\n assertTrustedEndpointUrl(tokenEndpoint, \"OAuth token endpoint\");\n const response = await fetchImpl(tokenEndpoint, {\n method: \"POST\",\n headers: { \"content-type\": \"application/x-www-form-urlencoded\" },\n body: new URLSearchParams(params),\n });\n if (!response.ok) {\n const oauthError = await readOAuthErrorCode(response);\n if (params.grant_type === \"refresh_token\" && oauthError !== undefined && REAUTH_REQUIRED_ERRORS.has(oauthError)) {\n throw new OAuthReauthRequiredError(oauthError, response.status);\n }\n throw new Error(`OAuth token exchange failed with HTTP ${response.status}${oauthError ? ` (${oauthError})` : \"\"}.`);\n }\n return response.json() as Promise<Record<string, unknown>>;\n}\n\n/** 토큰 오류 응답의 {@code error} 코드. 본문이 JSON 이 아니면 없음 — 그때는 «재로그인» 으로 판정하지 않는다. */\nasync function readOAuthErrorCode(response: Response): Promise<string | undefined> {\n try {\n const body = await response.json() as Record<string, unknown>;\n return typeof body.error === \"string\" ? body.error : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * ★<b>쓸 수 있는 저장 로그인 — init·setup 의 단일 진입점.</b> 없으면 undefined(→ 부르는 쪽이 로그인한다).\n *\n * <p>«없음»에는 저장된 갱신 토큰을 서버가 거절한 경우({@link OAuthReauthRequiredError})도 든다 —\n * 예전엔 setup 이 raw {@code getAccessToken} 을 불러, 그 거절이 로그인 «전에» 명령을 끝냈고 같은 setup 을\n * 반복해도 회복하지 않았다(리뷰 #6 F2). 그 밖의 실패(네트워크·불신 주소의 AINECTO_TOKEN 거절)는 그대로 던진다.\n */\nexport async function usableAccessToken(auth: Pick<TokenProvider, \"getAccessToken\">): Promise<string | undefined> {\n try {\n return await auth.getAccessToken();\n } catch (error) {\n if (error instanceof OAuthReauthRequiredError) {\n return undefined;\n }\n throw error;\n }\n}\n\ntype TokenContext = Partial<Pick<StoredTokenSet, \"refreshToken\" | \"tokenType\" | \"expiresAt\" | \"scope\" | \"clientId\" | \"clientSecret\">>\n & Partial<ClientRegistrationResult>;\n\nfunction toStoredToken(\n endpoint: string,\n token: Record<string, unknown>,\n metadata: OAuthMetadata,\n previous?: TokenContext,\n): StoredTokenSet {\n if (typeof token.access_token !== \"string\") {\n throw new Error(\"OAuth token response did not include access_token.\");\n }\n const expiresIn = typeof token.expires_in === \"number\" ? token.expires_in : undefined;\n return {\n endpoint,\n accessToken: token.access_token,\n refreshToken: typeof token.refresh_token === \"string\" ? token.refresh_token : previous?.refreshToken,\n tokenType: typeof token.token_type === \"string\" ? token.token_type : previous?.tokenType,\n expiresAt: expiresIn ? Date.now() + expiresIn * 1000 : previous?.expiresAt,\n scope: typeof token.scope === \"string\" ? token.scope : previous?.scope,\n clientId: previous?.clientId ?? \"ainecto-cli\",\n clientSecret: previous?.clientSecret,\n authorizationServer: metadata.issuer,\n updatedAt: new Date().toISOString(),\n };\n}\n\n/**\n * 로그인 콜백을 받는 loopback 서버. {@code host} 는 시험이 «바인딩 실패»를 만들 때만 바꾼다.\n */\nexport async function createLoopbackReceiver(expectedState: string, host = \"127.0.0.1\"): Promise<{\n redirectUri: string;\n waitForCode(): Promise<string>;\n close(): Promise<void>;\n}> {\n let resolveCode!: (code: string) => void;\n let rejectCode!: (error: Error) => void;\n const codePromise = new Promise<string>((resolve, reject) => {\n resolveCode = resolve;\n rejectCode = reject;\n });\n codePromise.catch(() => undefined);\n\n const server = createServer((req, res) => {\n const url = new URL(req.url ?? \"/\", \"http://127.0.0.1\");\n const error = url.searchParams.get(\"error\");\n const code = url.searchParams.get(\"code\");\n const state = url.searchParams.get(\"state\");\n if (error) {\n res.writeHead(400, { \"content-type\": \"text/plain\" });\n res.end(\"AiNecto CLI authorization failed. You can close this tab.\");\n rejectCode(new Error(`OAuth authorization failed: ${error}`));\n return;\n }\n if (!state || state !== expectedState) {\n res.writeHead(400, { \"content-type\": \"text/plain\" });\n res.end(\"AiNecto CLI authorization state mismatch. You can close this tab.\");\n rejectCode(new Error(\"OAuth state mismatch.\"));\n return;\n }\n if (!code) {\n res.writeHead(400, { \"content-type\": \"text/plain\" });\n res.end(\"Missing OAuth code.\");\n rejectCode(new Error(\"OAuth redirect did not include a code.\"));\n return;\n }\n res.writeHead(200, { \"content-type\": \"text/plain\" });\n res.end(\"AiNecto CLI authorization complete. You can close this tab.\");\n resolveCode(code);\n });\n\n // ★바인딩이 막히면(에이전트 sandbox 등) 예전엔 error 리스너가 없어 처리되지 않은 예외로 죽었다\n // (2026-09-29 코드 리뷰 P1). 사람이 할 일을 말하는 오류로 바꾼다.\n await new Promise<void>((resolve, reject) => {\n server.once(\"error\", (error) => reject(new OAuthLoginError(\n \"CALLBACK_UNAVAILABLE\",\n `Could not start the local sign-in callback on ${host} (${error.message}). `\n + \"If this command runs in a sandbox, allow local network binding or run it outside the sandbox.\",\n )));\n server.listen(0, host, () => resolve());\n });\n const address = server.address();\n if (!address || typeof address === \"string\") {\n throw new Error(\"Loopback OAuth server did not bind to a TCP port.\");\n }\n return {\n redirectUri: `http://127.0.0.1:${address.port}/callback`,\n waitForCode: () => codePromise,\n close: () => new Promise<void>((resolve, reject) => {\n // Node 18 은 브라우저가 붙들고 있는 keep-alive 연결이 끝날 때까지 close 가 늦어진다.\n server.closeAllConnections?.();\n server.close((error) => error ? reject(error) : resolve());\n }),\n };\n}\n\nfunction parseStringArray(value: unknown): string[] {\n return Array.isArray(value) ? value.filter((item): item is string => typeof item === \"string\") : [];\n}\n\nasync function fetchJson<T>(url: string, fetchImpl: typeof fetch): Promise<T> {\n assertTrustedEndpointUrl(url, \"OAuth metadata URL\");\n const response = await fetchImpl(url);\n if (!response.ok) {\n throw new Error(`Failed to fetch OAuth metadata from ${url}: HTTP ${response.status}.`);\n }\n return response.json() as Promise<T>;\n}\n\nexport function getBrowserOpenCommand(\n url: string,\n platform: NodeJS.Platform = process.platform,\n): { command: string; args: string[] } {\n assertTrustedEndpointUrl(url, \"OAuth authorization URL\");\n if (platform === \"darwin\") {\n return { command: \"open\", args: [url] };\n }\n if (platform === \"win32\") {\n return { command: \"explorer.exe\", args: [url] };\n }\n return { command: \"xdg-open\", args: [url] };\n}\n\nexport interface LaunchBrowserDeps {\n platform?: NodeJS.Platform;\n spawnImpl?: (command: string, args: string[], options: SpawnOptions) => ChildProcess;\n}\n\n/**\n * 기본 브라우저 열기. <b>여는 명령이 없거나(ENOENT) 0 이 아닌 코드로 끝나면 거절</b>한다.\n *\n * <p>★예전엔 {@code error} 리스너가 없어 명령이 없으면 처리되지 않은 오류로 죽었고, 명령은 있는데\n * 브라우저가 없으면({@code xdg-open} 비0 종료) 아무 말 없이 콜백을 영원히 기다렸다\n * (2026-09-29 독립 리뷰 P1-2).\n *\n * <p>⚠<b>Windows 는 종료 코드를 보지 않는다.</b> {@code explorer.exe} 는 성공해도 1 로 끝나는 것으로\n * 알려져 있어, 그 코드로 판정하면 정상 환경을 실패로 만든다 — 명령이 «떴다»는 것만 본다\n * (설계 §8-1, Windows 실측 V14 전까지 추정).\n */\nexport function launchBrowser(url: string, deps: LaunchBrowserDeps = {}): Promise<void> {\n const platform = deps.platform ?? process.platform;\n const { command, args } = getBrowserOpenCommand(url, platform);\n const spawnImpl = deps.spawnImpl ?? spawn;\n return new Promise<void>((resolve, reject) => {\n const unavailable = (reason: string) => new OAuthLoginError(\n \"BROWSER_UNAVAILABLE\",\n `Could not open a browser on this machine (${command}: ${reason}). Sign-in needs a browser here.`,\n );\n let child: ChildProcess;\n try {\n child = spawnImpl(command, args, { stdio: \"ignore\", detached: true });\n } catch (error) {\n reject(unavailable(error instanceof Error ? error.message : String(error)));\n return;\n }\n child.once(\"error\", (error) => reject(unavailable(error.message)));\n if (platform === \"win32\") {\n child.once(\"spawn\", () => resolve());\n } else {\n child.once(\"exit\", (code, signal) => {\n if (code === 0) {\n resolve();\n } else {\n reject(unavailable(code === null ? `stopped by ${signal ?? \"a signal\"}` : `exited with code ${code}`));\n }\n });\n }\n child.unref();\n });\n}\n\nfunction openBrowser(url: string): Promise<void> {\n return launchBrowser(url);\n}\n\nfunction assertEnvTokenEndpointAllowed(endpoint: string, envVars: NodeJS.ProcessEnv): void {\n if (envVars.AINECTO_ALLOW_CUSTOM_ENDPOINT_TOKEN === \"1\") {\n return;\n }\n if (isDefaultEndpoint(endpoint)) {\n return;\n }\n throw new Error(\"AINECTO_TOKEN can only be used with the default prod/dev endpoints. Set AINECTO_ALLOW_CUSTOM_ENDPOINT_TOKEN=1 only when you intentionally trust the custom endpoint.\");\n}\n","export type AinectoEnv = \"prod\" | \"dev\";\n\nexport interface EndpointResolutionInput {\n env?: AinectoEnv;\n endpoint?: string;\n envVars?: NodeJS.ProcessEnv;\n}\n\nexport interface ResolvedEndpoint {\n env: AinectoEnv;\n endpoint: string;\n source: \"flag\" | \"env\" | \"default\";\n}\n\n/**\n * 기본 MCP 엔드포인트.\n *\n * OAuth 메타데이터(issuer·resource·authorization_servers)도 ainecto.com 이다.\n */\nconst DEFAULT_ENDPOINTS: Record<AinectoEnv, string> = {\n prod: \"https://ainecto.com/mcp\",\n dev: \"https://dev.ainecto.com/mcp\",\n};\n\nexport function resolveEndpoint(input: EndpointResolutionInput = {}): ResolvedEndpoint {\n const envVars = input.envVars ?? process.env;\n const env = input.env ?? \"prod\";\n\n if (input.endpoint) {\n return { env, endpoint: normalizeEndpoint(input.endpoint), source: \"flag\" };\n }\n\n if (envVars.AINECTO_MCP_ENDPOINT) {\n return { env, endpoint: normalizeEndpoint(envVars.AINECTO_MCP_ENDPOINT), source: \"env\" };\n }\n\n return { env, endpoint: DEFAULT_ENDPOINTS[env], source: \"default\" };\n}\n\nexport function normalizeEndpoint(endpoint: string): string {\n const url = new URL(endpoint);\n assertTrustedEndpointUrl(url, \"MCP endpoint\");\n url.hash = \"\";\n return url.toString().replace(/\\/$/, \"\");\n}\n\n/**\n * ★<b>이 env 의 기본 주소와 «정확히» 같은가.</b>\n *\n * <p>{@link isDefaultEndpoint} 는 prod·dev 를 둘 다 «기본»으로 보는 넓은 판정이라,\n * 「env=prod 인데 endpoint 만 dev」 같은 입력을 기본으로 착각한다. 그 판정으로 설정에서\n * {@code --endpoint} 를 빼면, 조회한 주소와 세션이 붙는 주소가 갈라진다\n * (2026-09-23 독립 재리뷰 I7).\n */\nexport function isDefaultEndpointFor(env: AinectoEnv, endpoint: string): boolean {\n return normalizeEndpoint(endpoint) === DEFAULT_ENDPOINTS[env];\n}\n\nexport function isDefaultEndpoint(endpoint: string): boolean {\n const normalized = normalizeEndpoint(endpoint);\n return Object.values(DEFAULT_ENDPOINTS).includes(normalized);\n}\n\nexport function assertTrustedEndpointUrl(value: string | URL, label = \"URL\"): void {\n const url = typeof value === \"string\" ? new URL(value) : value;\n if (url.protocol === \"https:\") {\n return;\n }\n if (url.protocol === \"http:\" && isLoopbackHostname(url.hostname)) {\n return;\n }\n throw new Error(`${label} must use https, except http is allowed for localhost loopback endpoints.`);\n}\n\nexport function assertLoopbackRedirectUrl(value: string): void {\n const url = new URL(value);\n if (url.protocol === \"http:\" && isLoopbackHostname(url.hostname)) {\n return;\n }\n throw new Error(\"OAuth redirect URI must be an http localhost loopback URL.\");\n}\n\nfunction isLoopbackHostname(hostname: string): boolean {\n return hostname === \"localhost\"\n || hostname === \"127.0.0.1\"\n || hostname === \"::1\"\n || hostname === \"[::1]\";\n}\n\nexport function assertEnv(value: string | undefined): AinectoEnv | undefined {\n if (value === undefined) {\n return undefined;\n }\n if (value === \"prod\" || value === \"dev\") {\n return value;\n }\n throw new Error(`Invalid --env value \"${value}\". Expected \"prod\" or \"dev\".`);\n}\n\n/**\n * 직무 프로필을 고치는 설정 화면 — ★이 MCP 서버와 같은 출처의 홈페이지 설정(기본 탭 = 계정).\n * 규칙은 웹 앱과 같다(ainecto-front {@code src/lib/homepage.ts} 의 {@code /home/settings}, 같은 출처 배포).\n */\nexport function profileSettingsUrl(endpoint: string): string {\n return `${new URL(endpoint).origin}/home/settings`;\n}\n","import { assertLoopbackRedirectUrl, assertTrustedEndpointUrl } from \"../config/endpoints\";\n\nexport interface ClientRegistrationResult {\n clientId: string;\n clientSecret?: string;\n}\n\nexport async function registerPublicClient(\n registrationEndpoint: string,\n redirectUri: string,\n fetchImpl: typeof fetch = fetch,\n): Promise<ClientRegistrationResult> {\n assertTrustedEndpointUrl(registrationEndpoint, \"OAuth client registration endpoint\");\n assertLoopbackRedirectUrl(redirectUri);\n const response = await fetchImpl(registrationEndpoint, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\", accept: \"application/json\" },\n body: JSON.stringify({\n client_name: \"AiNecto CLI\",\n redirect_uris: [redirectUri],\n token_endpoint_auth_method: \"none\",\n grant_types: [\"authorization_code\", \"refresh_token\"],\n response_types: [\"code\"],\n }),\n });\n if (!response.ok) {\n throw new Error(`OAuth client registration failed with HTTP ${response.status}.`);\n }\n const body = await response.json() as unknown;\n if (!isRecord(body) || typeof body.client_id !== \"string\") {\n throw new Error(\"OAuth client registration response did not include client_id.\");\n }\n return {\n clientId: body.client_id,\n clientSecret: typeof body.client_secret === \"string\" ? body.client_secret : undefined,\n };\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { readFile } from \"node:fs/promises\";\n\nexport interface PayloadSourceInput {\n file?: string;\n inline?: string;\n stdin?: NodeJS.ReadStream;\n stdinText?: string;\n stdinIsTTY?: boolean;\n}\n\nexport interface ParsedPayload {\n value: unknown;\n source: \"file\" | \"stdin\" | \"inline\" | \"empty\";\n warnings: string[];\n}\n\nexport async function parsePayloadSource(input: PayloadSourceInput): Promise<ParsedPayload> {\n const warnings: string[] = [];\n const stdinIsTTY = input.stdinIsTTY ?? input.stdin?.isTTY ?? true;\n const hasInline = input.inline !== undefined && input.inline !== \"\";\n const hasStdin = input.stdinText !== undefined || !stdinIsTTY;\n\n if (input.file) {\n if (hasInline || hasStdin) {\n warnings.push(\"Multiple payload sources were provided; --file takes precedence.\");\n }\n const text = await readFileOrStdin(input.file, input);\n return { value: parseJson(text), source: input.file === \"-\" || input.file === \"@-\" ? \"stdin\" : \"file\", warnings };\n }\n\n if (hasStdin) {\n if (hasInline) {\n warnings.push(\"Multiple payload sources were provided; stdin takes precedence.\");\n }\n const text = input.stdinText ?? await readAllStdin(input.stdin);\n if (!text.trim()) {\n return { value: {}, source: \"empty\", warnings };\n }\n return { value: parseJson(text), source: \"stdin\", warnings };\n }\n\n if (hasInline) {\n const inline = input.inline === \"@-\" ? await readAllStdin(input.stdin) : input.inline;\n return { value: parseJson(inline), source: \"inline\", warnings };\n }\n\n return { value: {}, source: \"empty\", warnings };\n}\n\nfunction parseJson(text: string | undefined): unknown {\n if (text === undefined || !text.trim()) {\n return {};\n }\n try {\n return JSON.parse(text);\n } catch (error) {\n const detail = error instanceof Error ? error.message : String(error);\n throw new Error(`Invalid JSON payload: ${detail}`);\n }\n}\n\nasync function readFileOrStdin(file: string, input: PayloadSourceInput): Promise<string> {\n if (file === \"-\" || file === \"@-\") {\n return input.stdinText ?? await readAllStdin(input.stdin);\n }\n return readFile(file, \"utf8\");\n}\n\nasync function readAllStdin(stdin: NodeJS.ReadStream | undefined): Promise<string> {\n if (!stdin) {\n return \"\";\n }\n stdin.setEncoding(\"utf8\");\n let text = \"\";\n for await (const chunk of stdin) {\n text += chunk;\n }\n return text;\n}\n","/**\n * 옛 세션 역할 입력 — ★0.8.0 에서 세션 역할(Design/Development/Test/Validation)이 없어졌다.\n * 도구 목록은 모든 세션이 같고, 무엇을 할 수 있는지는 서버가 사용자·리소스 권한으로만 정한다.\n *\n * <p>그래도 옛 입력은 «거절하지 않는다» — 0.7.x 의 {@code init} 이 쓴 저장소 설정\n * ({@code npx -y @ainecto/mcp --role design}, 버전 고정 없음)은 게시 즉시 이 판을 띄운다.\n * 여기서 {@code --role} 을 거절하면 그 저장소 전부의 연결이 끊긴다(설계 §2-3 R1).\n *\n * <p>받은 값은 «검사하지 않고» 두 군데에만 쓴다:\n * <ul>\n * <li>stderr 안내 한 줄({@link LEGACY_ROLE_NOTICE}) — 사람이 설정을 정리하게.</li>\n * <li>같은 헤더 {@link LEGACY_ROLE_HEADER} 로 서버에 실어 보냄 — 서버는 판정에 쓰지 않고\n * {@code [mcp][legacy-role]} 로 기록만 한다. 새 헤더를 만들지 않으려고 옛 이름을 재사용한다.</li>\n * </ul>\n * ★관찰 기간(설계 §7-2 ⑤) 뒤 기록이 0건이면 이 파일과 브리지의 {@code --role} 받기를 함께 지운다.\n */\n\n/** 서버가 기록용으로 읽는 헤더 — 서버 McpController 의 옛 역할 헤더와 같은 이름. */\nexport const LEGACY_ROLE_HEADER = \"X-AiNecto-Role\";\n\n/** 0.7.x 가 Codex 처럼 전역 설정뿐인 에이전트에 안내하던 환경변수. */\nexport const LEGACY_ROLE_ENV_VAR = \"AINECTO_ROLE\";\n\nexport const LEGACY_ROLE_NOTICE =\n \"AiNecto session roles were removed; access follows your AiNecto permissions. \"\n + \"Re-run `ainecto init` to tidy this repository.\";\n\n/**\n * 플래그(있으면) 아니면 {@link LEGACY_ROLE_ENV_VAR}. ★값을 검사하지 않는다 — 모르는 값도 받는다.\n * 빈 값은 «없음»이다.\n */\nexport function legacyRoleInput(flag: string | undefined, envVars: NodeJS.ProcessEnv = process.env): string | undefined {\n const value = flag ?? envVars[LEGACY_ROLE_ENV_VAR];\n return value !== undefined && value.trim() ? value.trim() : undefined;\n}\n","/**\n * CLI 버전. ★진실원은 {@code package.json} 이고 빌드(tsup define)가 그 값을 박는다 —\n * 상수로 또 적으면 릴리스 때 한쪽만 올라가 조용히 거짓이 된다.\n * 번들을 거치지 않는 실행(vitest·tsx)에서는 값이 없으므로 \"dev\" 로 떨어진다.\n */\ndeclare const __AINECTO_CLI_VERSION__: string | undefined;\n\n/** 번들을 거치지 않은 실행의 판 표시. */\nconst UNBUNDLED_VERSION = \"dev\";\n\nexport const CLI_VERSION: string =\n typeof __AINECTO_CLI_VERSION__ === \"string\" ? __AINECTO_CLI_VERSION__ : UNBUNDLED_VERSION;\n\n/**\n * npm 주 이름. ★이 이름을 박는 곳은 여기 하나다 — init·setup 이 쓰는 {@code npx -y <이름>@<판>},\n * MCP {@code clientInfo}, User-Agent, init 기록의 {@code generatedBy} 가 모두 이것을 쓴다.\n * {@code package.json} 의 name·{@code server.json} 의 패키지 식별자와 같아야 한다(시험이 대조한다).\n *\n * <p>다른 이름 {@code ainecto}·{@code @ainecto/cli} 에도 같은 코드가 올라가지만(scripts/publish.mjs),\n * 그 판으로 init 해도 이 이름을 쓴다.\n */\nexport const PACKAGE_NAME = \"@ainecto/mcp\";\n\nexport const CLI_USER_AGENT = `${PACKAGE_NAME} ${CLI_VERSION}`;\n\n/**\n * MCP 설정에 쓰는 브리지 패키지 지정 — ★이 CLI 판으로 «고정»한다(설계 결정 #6·D8). 고정하지 않으면\n * 게시 즉시 모든 저장소의 브리지가 새 판으로 바뀐다(0.7.x 의 --role 설정이 그랬다). 올리는 길은\n * {@code setup}/{@code init} 재실행이다. 판을 모르는 실행(vitest·tsx)에서는 고정하지 않는다 —\n * {@code @dev} 는 npm 에서 판이 아니라 배포 태그로 읽힌다.\n */\nexport function bridgePackageSpec(version: string = CLI_VERSION): string {\n return version === UNBUNDLED_VERSION ? PACKAGE_NAME : `${PACKAGE_NAME}@${version}`;\n}\n","import type { TokenProvider } from \"../auth/oauth\";\nimport { LEGACY_ROLE_HEADER } from \"../harness/legacyRole\";\nimport { CLI_VERSION, PACKAGE_NAME } from \"../version\";\n\nexport interface JsonRpcRequest {\n jsonrpc: \"2.0\";\n id?: string | number | null;\n method: string;\n params?: unknown;\n}\n\nexport interface JsonRpcSuccess {\n jsonrpc: \"2.0\";\n id?: string | number | null;\n result: unknown;\n}\n\nexport interface JsonRpcFailure {\n jsonrpc: \"2.0\";\n id?: string | number | null;\n error: {\n code: number;\n message: string;\n data?: unknown;\n };\n}\n\nexport type JsonRpcResponse = JsonRpcSuccess | JsonRpcFailure;\n\n/**\n * 분석용 요청 헤더(GA4 서버 계측 C23). 서버의 ExecutionChannel.HEADER · AgentTypeResolver.HEADER 와 같아야 한다.\n * 서버는 /mcp 필터에서 한 번만 읽고, 모르는 값이면 요청을 막지 않는다(분석 값일 뿐이다).\n */\nexport const CHANNEL_HEADER = \"X-AiNecto-Channel\";\nexport const AGENT_HEADER = \"X-AiNecto-Agent\";\n/** 서버 AgentTypeResolver.MAX_NAME_LENGTH 와 같다. */\nexport const MAX_AGENT_NAME_LENGTH = 100;\n\n/** 이 클라이언트가 서버에 밝히는 길 — 직접 명령(`ainecto tools call …`) = cli, 에이전트의 MCP 브리지 = mcp. */\nexport type ExecutionChannel = \"cli\" | \"mcp\";\n\nexport interface McpRpcClientOptions {\n endpoint: string;\n tokenProvider?: TokenProvider;\n fetchImpl?: typeof fetch;\n envVars?: NodeJS.ProcessEnv;\n /**\n * 옛 {@code --role}/{@code AINECTO_ROLE} 값 — ★기록용이다(legacyRole.ts). 있으면 모든 요청의\n * {@code X-AiNecto-Role} 헤더로 실리고, 서버는 판정에 쓰지 않고 로그로만 남긴다.\n */\n legacyRole?: string;\n /**\n * 요청의 길. ★필수다 — 빠뜨리면 서버가 직접 명령을 MCP 로 센다. 그 빠뜨림을 타입이 잡는다.\n * 모든 요청의 {@code X-AiNecto-Channel} 헤더로 실린다.\n */\n channel: ExecutionChannel;\n}\n\nexport class McpRpcError extends Error {\n constructor(\n message: string,\n readonly code: string,\n readonly details?: unknown,\n ) {\n super(message);\n }\n}\n\nexport class McpRpcClient {\n private readonly fetchImpl: typeof fetch;\n private nextId = 1;\n private agent: string | undefined;\n\n constructor(private readonly options: McpRpcClientOptions) {\n this.fetchImpl = options.fetchImpl ?? fetch;\n }\n\n /**\n * 브리지 전용 — 호스트 에이전트가 보낸 {@code initialize} 의 {@code clientInfo.name}(프로그램 고정 이름).\n * 이후 모든 요청의 {@code X-AiNecto-Agent} 헤더로 싣는다. 직접 명령은 부르지 않는다(누가 셸을 돌렸는지 모른다).\n */\n useAgent(clientName: unknown): void {\n this.agent = agentHeaderValue(clientName);\n }\n\n initialize(): Promise<unknown> {\n return this.request(\"initialize\", {\n protocolVersion: \"2024-11-05\",\n capabilities: {},\n clientInfo: { name: PACKAGE_NAME, version: CLI_VERSION },\n });\n }\n\n async toolsList(): Promise<unknown[]> {\n const result = await this.request(\"tools/list\", {});\n if (!isRecord(result) || !Array.isArray(result.tools)) {\n throw new McpRpcError(\"tools/list response did not include a tools array.\", \"MCP_PROTOCOL_ERROR\", result);\n }\n return result.tools;\n }\n\n async toolsCall(name: string, args: unknown): Promise<unknown> {\n return this.request(\"tools/call\", { name, arguments: args ?? {} });\n }\n\n async request(method: string, params?: unknown): Promise<unknown> {\n const response = await this.sendRaw({\n jsonrpc: \"2.0\",\n id: this.nextId++,\n method,\n params,\n });\n if (!response) {\n return undefined;\n }\n if (\"error\" in response) {\n throw new McpRpcError(response.error.message, \"MCP_ERROR\", response.error);\n }\n return response.result;\n }\n\n async sendRaw(request: JsonRpcRequest): Promise<JsonRpcResponse | undefined> {\n const token = await this.options.tokenProvider?.getAccessToken();\n let response = await this.postJson(request, token);\n if (response.status === 401 && this.options.tokenProvider) {\n const refreshed = await this.options.tokenProvider.refreshAfterUnauthorized();\n if (refreshed) {\n response = await this.postJson(request, refreshed);\n }\n }\n\n if (response.status === 204 || response.status === 202) {\n return undefined;\n }\n const text = await response.text();\n if (!response.ok) {\n throw new McpRpcError(\n `MCP HTTP request failed with HTTP ${response.status}.`,\n \"MCP_HTTP_ERROR\",\n httpErrorDetails(response.status, text, this.options.envVars ?? process.env),\n );\n }\n if (!text.trim()) {\n return undefined;\n }\n const parsed = JSON.parse(text) as unknown;\n if (!isJsonRpcResponse(parsed)) {\n throw new McpRpcError(\"MCP response was not a JSON-RPC response.\", \"MCP_PROTOCOL_ERROR\", parsed);\n }\n return parsed;\n }\n\n private postJson(request: JsonRpcRequest, token: string | undefined): Promise<Response> {\n const headers: Record<string, string> = {\n \"content-type\": \"application/json\",\n accept: \"application/json\",\n };\n if (token) {\n headers.authorization = `Bearer ${token}`;\n }\n const legacyRole = printableHeaderValue(this.options.legacyRole);\n if (legacyRole) {\n headers[LEGACY_ROLE_HEADER.toLowerCase()] = legacyRole;\n }\n headers[CHANNEL_HEADER.toLowerCase()] = this.options.channel;\n if (this.agent) {\n headers[AGENT_HEADER.toLowerCase()] = this.agent;\n }\n return this.fetchImpl(this.options.endpoint, {\n method: \"POST\",\n headers,\n body: JSON.stringify(request),\n });\n }\n}\n\n/**\n * ★MCP 는 «도구가 거부/실패했다»를 JSON-RPC error 가 아니라 결과 안의 {@code isError} 로\n * 알린다(2025-06-18 규격). 그래서 최상위 error 만 보면 실패가 성공으로 보고된다 —\n * 셸 자동화는 exit 0 을 받고 다음 단계로 간다(2026-09-22 독립 리뷰 I9).\n */\nexport function isToolError(result: unknown): boolean {\n return isRecord(result) && result.isError === true;\n}\n\n/**\n * 헤더에 실을 수 있는 이름 — 인쇄 가능한 ASCII 만(그 밖의 글자는 fetch 가 헤더로 거절한다), 앞뒤 공백 제거,\n * 최대 {@link MAX_AGENT_NAME_LENGTH}자. 남는 것이 없으면 싣지 않는다(서버는 unknown 으로 센다).\n */\nexport function agentHeaderValue(clientName: unknown): string | undefined {\n return printableHeaderValue(clientName);\n}\n\n/** 헤더에 실을 수 있는 모양으로 — 규칙은 {@link agentHeaderValue} 와 같다(이 파일의 헤더 값은 전부 이 길을 지난다). */\nfunction printableHeaderValue(value: unknown): string | undefined {\n if (typeof value !== \"string\") {\n return undefined;\n }\n const printable = value.replace(/[^\\x20-\\x7E]/g, \"\").trim().slice(0, MAX_AGENT_NAME_LENGTH).trim();\n return printable || undefined;\n}\n\nfunction isJsonRpcResponse(value: unknown): value is JsonRpcResponse {\n return isRecord(value)\n && value.jsonrpc === \"2.0\"\n && (\"result\" in value || \"error\" in value);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction httpErrorDetails(status: number, body: string, envVars: NodeJS.ProcessEnv): Record<string, unknown> {\n const details: Record<string, unknown> = { status };\n if (envVars.AINECTO_CLI_DEBUG === \"1\" || envVars.AINECTO_DEBUG === \"1\") {\n details.body = safeBodyPreview(body);\n }\n return details;\n}\n\nexport function safeBodyPreview(body: string): string {\n return body.length > 500 ? `${body.slice(0, 500)}...` : body;\n}\n","export interface CliErrorShape {\n ok: false;\n error: {\n code: string;\n message: string;\n details?: unknown;\n };\n}\n\nexport interface CliSuccessShape {\n ok: true;\n data: unknown;\n warnings?: string[];\n}\n\nexport function renderSuccess(data: unknown, options: { json?: boolean; warnings?: string[] } = {}): string {\n if (options.json) {\n const shape: CliSuccessShape = { ok: true, data };\n if (options.warnings?.length) {\n shape.warnings = options.warnings;\n }\n return `${JSON.stringify(shape, null, 2)}\\n`;\n }\n const warnings = options.warnings?.length ? `${options.warnings.map((warning) => `Warning: ${warning}`).join(\"\\n\")}\\n` : \"\";\n return `${warnings}${renderHuman(data)}\\n`;\n}\n\nexport function renderError(error: unknown, options: { json?: boolean } = {}): string {\n const shape = toErrorShape(error);\n if (options.json) {\n return `${JSON.stringify(shape, null, 2)}\\n`;\n }\n return `Error: ${shape.error.message}\\n`;\n}\n\nexport function toErrorShape(error: unknown): CliErrorShape {\n if (error instanceof Error) {\n const maybe = error as Error & { code?: string; details?: unknown };\n return {\n ok: false,\n error: {\n code: maybe.code ?? \"CLI_ERROR\",\n message: error.message,\n details: redactSecrets(maybe.details),\n },\n };\n }\n return { ok: false, error: { code: \"CLI_ERROR\", message: String(error) } };\n}\n\nexport function redactSecrets(value: unknown): unknown {\n return redactSecretsInner(value, new WeakSet<object>());\n}\n\nfunction renderHuman(data: unknown): string {\n if (Array.isArray(data)) {\n return data.map((item) => renderHuman(item)).join(\"\\n\");\n }\n if (typeof data === \"string\") {\n return data;\n }\n return JSON.stringify(data, null, 2);\n}\n\nfunction redactSecretsInner(value: unknown, seen: WeakSet<object>): unknown {\n if (typeof value === \"string\") {\n return redactSecretString(value);\n }\n if (Array.isArray(value)) {\n return value.map((item) => redactSecretsInner(item, seen));\n }\n if (value && typeof value === \"object\") {\n if (seen.has(value)) {\n return \"[circular]\";\n }\n seen.add(value);\n const output: Record<string, unknown> = {};\n for (const [key, child] of Object.entries(value)) {\n output[key] = isSecretKey(key) ? \"[redacted]\" : redactSecretsInner(child, seen);\n }\n return output;\n }\n return value;\n}\n\nfunction isSecretKey(key: string): boolean {\n const normalized = key.toLowerCase().replace(/-/g, \"_\");\n return normalized === \"authorization\"\n || normalized.includes(\"access_token\")\n || normalized.includes(\"refresh_token\")\n || normalized.includes(\"client_secret\")\n || normalized.includes(\"token\");\n}\n\nfunction redactSecretString(value: string): string {\n return value\n .replace(/(\"(?:authorization|access_token|refresh_token|client_secret|token)\"\\s*:\\s*\")([^\"]*)(\")/gi, \"$1[redacted]$3\")\n .replace(/((?:authorization|access_token|refresh_token|client_secret|token)=)([^&\\s\"']+)/gi, \"$1[redacted]\")\n .replace(/(authorization:\\s*bearer\\s+)([^\\s,}]+)/gi, \"$1[redacted]\")\n .replace(/(bearer\\s+)(eyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+)/gi, \"$1[redacted]\");\n}\n","import type { GeneratedToolDefinition } from \"./types\";\n\nexport const generatedTools = [\n {\"mcpName\":\"create_comments\",\"commandPath\":[\"comments\",\"create\"],\"group\":\"generic\",\"description\":\"Add comments, questions, or replies to a document. Anyone who can read the document may comment and reply. Set parentCommentId to reply to a top-level comment. To mention people, get their userId and displayName from list_mention_candidates, write @<displayName> in the body, and list their userIds in mentionUserIds (clientMutationId is then required). Items are applied in order and each one commits on its own; results report each item (ok, or status and error).\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"documentUuid\":{\"description\":\"Document UUID the comments belong to\",\"type\":\"string\"},\"items\":{\"description\":\"Comments to add, applied in order\",\"items\":{\"additionalProperties\":false,\"properties\":{\"body\":{\"description\":\"Comment text (plain text, 1..10000 characters). To mention someone, include @<displayName> exactly as returned by mcp__ainecto__list_mention_candidates.\",\"maxLength\":10000,\"minLength\":1,\"type\":\"string\"},\"clientMutationId\":{\"description\":\"Idempotency key (visible ASCII, at most 128 characters). Required when mentionUserIds is not empty; reuse the same value when retrying the same item so the mention email is not sent twice.\",\"maxLength\":128,\"type\":\"string\"},\"kind\":{\"description\":\"Top-level comments only: COMMENT (default) or QUESTION. A QUESTION can later be resolved with mcp__ainecto__resolve_comments.\",\"enum\":[\"COMMENT\",\"QUESTION\"],\"type\":\"string\"},\"mentionUserIds\":{\"description\":\"userIds to mention (from mcp__ainecto__list_mention_candidates). Each one's @<displayName> must appear in body; newly mentioned people get a notification email.\",\"items\":{\"type\":\"string\"},\"maxItems\":20,\"type\":\"array\",\"uniqueItems\":true},\"parentCommentId\":{\"description\":\"Reply to this top-level comment id (from mcp__ainecto__list_comments). Replies are one level deep: replying to a reply is rejected. The thread's original author and earlier repliers get a notification email (except people mentioned in this reply, who get the mention email instead).\",\"minimum\":1,\"type\":\"integer\"}},\"required\":[\"body\"],\"type\":\"object\"},\"minItems\":1,\"type\":\"array\"},\"mailLanguage\":{\"description\":\"Language of the comment notification email (mention or reply). Defaults to en.\",\"enum\":[\"en\",\"ko\"],\"type\":\"string\"}},\"required\":[\"documentUuid\",\"items\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"b3ad621ef51c3003\"},\n {\"mcpName\":\"create_documents\",\"commandPath\":[\"documents\",\"create\"],\"group\":\"document\",\"description\":\"Create documents. If a document body is tens of KB or more, prefer request_upload_token (purpose=document.create) and upload the body with curl.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Documents\",\"items\":{\"properties\":{\"body\":{\"description\":\"Deprecated compatibility alias for typePayload.body when document type is markdown. 본문이 수십 KB 이상으로 크면 LLM 토큰 절약을 위해 `request_upload_token (purpose=document.create)` 를 호출해 uploadUrl 을 받고 curl 로 직접 PUT 으로 보낼 것.\",\"type\":\"string\"},\"folderUuid\":{\"description\":\"Optional folder UUID\",\"type\":\"string\"},\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"},\"title\":{\"description\":\"Document title\",\"type\":\"string\"},\"type\":{\"description\":\"Document type. Creatable values: erd, markdown, diagram, openapi, html, file.\",\"enum\":[\"erd\",\"markdown\",\"diagram\",\"openapi\",\"html\",\"file\"],\"type\":\"string\"},\"typePayload\":{\"description\":\"Type-specific payload for enabled document types. markdown: {body}; diagram: {diagramSource,sourceLanguage,edgeStyle,isModule,metadata}; openapi: {content}; html: {content} (a full HTML page); file: no JSON payload — bytes go through request_upload_token(purpose=document.create, scopeJson={projectUuid,folderUuid?,type:\\\"file\\\",title,filename}) then one curl PUT (images·PDF·mp4/webm·audio·text/code·CSV only).\",\"type\":\"object\"}},\"required\":[\"projectUuid\",\"type\",\"title\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"aa868b0e2821006a\"},\n {\"mcpName\":\"create_folders\",\"commandPath\":[\"folders\",\"create\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Folders\",\"items\":{\"properties\":{\"name\":{\"description\":\"Folder name\",\"type\":\"string\"},\"parentFolderUuid\":{\"description\":\"Parent folder UUID\",\"type\":\"string\"},\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"projectUuid\",\"name\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"30f45b887259609f\"},\n {\"mcpName\":\"create_projects\",\"commandPath\":[\"projects\",\"create\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Projects\",\"items\":{\"properties\":{\"description\":{\"description\":\"Description\",\"type\":\"string\"},\"name\":{\"description\":\"Project name\",\"type\":\"string\"},\"projectKey\":{\"description\":\"Unique project key\",\"type\":\"string\"},\"workspaceUuid\":{\"description\":\"Workspace UUID — null uses user's default workspace\",\"type\":\"string\"}},\"required\":[\"name\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"edf5cf688d7c039a\"},\n {\"mcpName\":\"create_workspaces\",\"commandPath\":[\"workspaces\",\"create\"],\"group\":\"workspace\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Workspaces\",\"items\":{\"properties\":{\"description\":{\"description\":\"Description\",\"type\":\"string\"},\"name\":{\"description\":\"Workspace name\",\"type\":\"string\"}},\"required\":[\"name\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"d9d1b0d561828b8e\"},\n {\"mcpName\":\"delete_attachments\",\"commandPath\":[\"attachments\",\"delete\"],\"group\":\"attachment\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Attachment UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"b22c24bffdfe3d7d\"},\n {\"mcpName\":\"delete_comments\",\"commandPath\":[\"comments\",\"delete\"],\"group\":\"generic\",\"description\":\"Delete your own comments on a document. Only the author can delete. A resolved question and a top-level comment that still has replies cannot be deleted. Each id is applied on its own; results report each id.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"documentUuid\":{\"description\":\"Document UUID the comments belong to\",\"type\":\"string\"},\"ids\":{\"description\":\"Comment ids to delete (from mcp__ainecto__list_comments)\",\"items\":{\"minimum\":1,\"type\":\"integer\"},\"minItems\":1,\"type\":\"array\"}},\"required\":[\"documentUuid\",\"ids\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"ids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"17b9658b5a47f866\"},\n {\"mcpName\":\"delete_documents\",\"commandPath\":[\"documents\",\"delete\"],\"group\":\"document\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Document UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"3a725ae70956c270\"},\n {\"mcpName\":\"delete_folders\",\"commandPath\":[\"folders\",\"delete\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Folder UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"2254cde89c9e8f06\"},\n {\"mcpName\":\"delete_projects\",\"commandPath\":[\"projects\",\"delete\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Project UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"6521c33a28cb5465\"},\n {\"mcpName\":\"delete_workspaces\",\"commandPath\":[\"workspaces\",\"delete\"],\"group\":\"workspace\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Workspace UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"3177868221137066\"},\n {\"mcpName\":\"diagram_apply_changes\",\"commandPath\":[\"tools\",\"run\",\"diagram-apply-changes\"],\"group\":\"generic\",\"description\":\"Required single-call mutation path for diagram node/edge/group create/update/delete changes. Put nodes, edges, and groups in one request and call this once. Do not look for type-specific diagram CUD tools; this tool is the only diagram CUD entry point.\",\"inputSchema\":{\"properties\":{\"description\":{\"description\":\"Reason for batch (audit)\",\"type\":\"string\"},\"diagramUuid\":{\"description\":\"Diagram UUID\",\"type\":\"string\"},\"edges\":{\"description\":\"Edge operations\",\"items\":{\"properties\":{\"action\":{\"description\":\"Operation kind\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"bridgeType\":{\"description\":\"Omit (null) for a plain node-to-node edge. Set only when a group is an endpoint: GROUP_TO_GROUP|NODE_TO_GROUP|GROUP_TO_NODE\",\"enum\":[\"GROUP_TO_GROUP\",\"NODE_TO_GROUP\",\"GROUP_TO_NODE\"],\"type\":\"string\"},\"fromUuid\":{\"description\":\"Source\",\"type\":\"string\"},\"label\":{\"description\":\"Edge label\",\"type\":\"string\"},\"lineStyle\":{\"description\":\"Line style\",\"type\":\"string\"},\"strokeColor\":{\"description\":\"Stroke color\",\"type\":\"string\"},\"strokeWidth\":{\"description\":\"Stroke width\",\"type\":\"integer\"},\"toUuid\":{\"description\":\"Target\",\"type\":\"string\"},\"uuid\":{\"description\":\"Required for update/delete\",\"type\":\"string\"}},\"required\":[\"action\"],\"type\":\"object\"},\"type\":\"array\"},\"groups\":{\"description\":\"Group operations\",\"items\":{\"properties\":{\"action\":{\"description\":\"Operation kind\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"collapsed\":{\"description\":\"Collapsed state\",\"type\":\"boolean\"},\"color\":{\"description\":\"Group color\",\"type\":\"string\"},\"height\":{\"description\":\"Explicit height; omit to keep it derived from member nodes\",\"type\":\"number\"},\"linkMode\":{\"description\":\"Link mode\",\"type\":\"string\"},\"linkedDiagramUuid\":{\"description\":\"Linked diagram UUID\",\"type\":\"string\"},\"name\":{\"description\":\"Group name\",\"type\":\"string\"},\"parentGroupUuid\":{\"description\":\"Parent group UUID\",\"type\":\"string\"},\"sortOrder\":{\"description\":\"Sort order\",\"type\":\"integer\"},\"uuid\":{\"description\":\"Required for update/delete\",\"type\":\"string\"},\"width\":{\"description\":\"Explicit width; omit to keep it derived from member nodes\",\"type\":\"number\"}},\"required\":[\"action\"],\"type\":\"object\"},\"type\":\"array\"},\"nodes\":{\"description\":\"Node operations\",\"items\":{\"properties\":{\"action\":{\"description\":\"Operation kind\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"fillColor\":{\"description\":\"Fill color\",\"type\":\"string\"},\"groupUuid\":{\"description\":\"Group UUID; empty string clears membership\",\"type\":\"string\"},\"height\":{\"description\":\"Height\",\"type\":\"number\"},\"shape\":{\"description\":\"Node shape (start/end/diamond/cylinder/parallelogram/stadium/hexagon/rect/roundRect/...)\",\"enum\":[\"rect\",\"roundRect\",\"stadium\",\"diamond\",\"decision\",\"circle\",\"start\",\"doubleCircle\",\"end\",\"hexagon\",\"cylinder\",\"parallelogram\"],\"type\":\"string\"},\"strokeColor\":{\"description\":\"Stroke color\",\"type\":\"string\"},\"text\":{\"description\":\"Node text/label. Supports newlines (\\\\n) for multi-line display.\",\"maxLength\":4000,\"type\":\"string\"},\"textColor\":{\"description\":\"Text color\",\"type\":\"string\"},\"type\":{\"description\":\"Node type\",\"type\":\"string\"},\"uuid\":{\"description\":\"Required for update/delete; optional for create\",\"type\":\"string\"},\"width\":{\"description\":\"Width\",\"type\":\"number\"},\"x\":{\"description\":\"X\",\"type\":\"number\"},\"y\":{\"description\":\"Y\",\"type\":\"number\"}},\"required\":[\"action\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"diagramUuid\",\"description\"],\"type\":\"object\"},\"required\":[\"description\",\"diagramUuid\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"2c829103f86f4168\"},\n {\"mcpName\":\"diagram_get_edge\",\"commandPath\":[\"tools\",\"run\",\"diagram-get-edge\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"edgeUuid\":{\"description\":\"Edge UUID\",\"type\":\"string\"}},\"required\":[\"edgeUuid\"],\"type\":\"object\"},\"required\":[\"edgeUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"2c03c4f7daa69898\"},\n {\"mcpName\":\"diagram_get_group\",\"commandPath\":[\"tools\",\"run\",\"diagram-get-group\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"groupUuid\":{\"description\":\"Group UUID\",\"type\":\"string\"}},\"required\":[\"groupUuid\"],\"type\":\"object\"},\"required\":[\"groupUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"55c5aa27b8cf489d\"},\n {\"mcpName\":\"diagram_get_node\",\"commandPath\":[\"tools\",\"run\",\"diagram-get-node\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"nodeUuid\":{\"description\":\"Node UUID\",\"type\":\"string\"}},\"required\":[\"nodeUuid\"],\"type\":\"object\"},\"required\":[\"nodeUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"646d553238328a9e\"},\n {\"mcpName\":\"diagram_get_pending_llm_requests\",\"commandPath\":[\"tools\",\"run\",\"diagram-get-pending-llm-requests\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"2143d616cf7822bf\"},\n {\"mcpName\":\"diagram_list_edges\",\"commandPath\":[\"tools\",\"run\",\"diagram-list-edges\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"diagramUuid\":{\"description\":\"Diagram document UUID\",\"type\":\"string\"}},\"required\":[\"diagramUuid\"],\"type\":\"object\"},\"required\":[\"diagramUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"4645085bde616381\"},\n {\"mcpName\":\"diagram_list_groups\",\"commandPath\":[\"tools\",\"run\",\"diagram-list-groups\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"diagramUuid\":{\"description\":\"Diagram document UUID\",\"type\":\"string\"}},\"required\":[\"diagramUuid\"],\"type\":\"object\"},\"required\":[\"diagramUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"8a7ca45dd34d1aef\"},\n {\"mcpName\":\"diagram_list_nodes\",\"commandPath\":[\"tools\",\"run\",\"diagram-list-nodes\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"diagramUuid\":{\"description\":\"Diagram document UUID\",\"type\":\"string\"}},\"required\":[\"diagramUuid\"],\"type\":\"object\"},\"required\":[\"diagramUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"d444066b5ca6eeb4\"},\n {\"mcpName\":\"diagram_submit_llm_result\",\"commandPath\":[\"tools\",\"run\",\"diagram-submit-llm-result\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"cachedInputTokens\":{\"description\":\"Cached subset of provider total input tokens\",\"type\":\"integer\"},\"creditsCharged\":{\"description\":\"Deprecated; ignored. Credits are calculated server-side from tokens.\",\"type\":\"integer\"},\"inputTokens\":{\"description\":\"Provider total input tokens; Java persists uncached input after one normalization\",\"type\":\"integer\"},\"outputTokens\":{\"description\":\"Output token count\",\"type\":\"integer\"},\"result\":{\"description\":\"LLM result text\",\"type\":\"string\"},\"uuid\":{\"description\":\"LLM request UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"result\"],\"type\":\"object\"},\"required\":[\"result\",\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"870ace32642a770a\"},\n {\"mcpName\":\"diagram_update_llm_request_status\",\"commandPath\":[\"tools\",\"run\",\"diagram-update-llm-request-status\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"errorMessage\":{\"description\":\"Error message (when status=FAILED)\",\"type\":\"string\"},\"status\":{\"description\":\"Target status — currently only FAILED is mutable from caller side\",\"enum\":[\"FAILED\"],\"type\":\"string\"},\"uuid\":{\"description\":\"LLM request UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"status\"],\"type\":\"object\"},\"required\":[\"status\",\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"9ad96e3dc5fd2a8f\"},\n {\"mcpName\":\"disable_shares\",\"commandPath\":[\"tools\",\"run\",\"disable-shares\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"targetType\":{\"description\":\"Share target type\",\"enum\":[\"project\",\"folder\",\"document\"],\"type\":\"string\"},\"targetUuids\":{\"description\":\"Target UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"targetType\",\"targetUuids\"],\"type\":\"object\"},\"required\":[\"targetType\",\"targetUuids\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"bd1b310200b78420\"},\n {\"mcpName\":\"enable_shares\",\"commandPath\":[\"tools\",\"run\",\"enable-shares\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"targetType\":{\"description\":\"Share target type. A document gets a shareUrl anyone can open; a project gets a public API path only (there is no public project page); a folder token is stored but nothing public reads it yet.\",\"enum\":[\"project\",\"folder\",\"document\"],\"type\":\"string\"},\"targetUuids\":{\"description\":\"Target UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"targetType\",\"targetUuids\"],\"type\":\"object\"},\"required\":[\"targetType\",\"targetUuids\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"18559d7c0af09d2c\"},\n {\"mcpName\":\"erd_apply_changes\",\"commandPath\":[\"erd\",\"apply-changes\"],\"group\":\"erd\",\"description\":\"Required single-call mutation path for ERD create/update/delete changes. Put tables, columns, indexes, refs, enums, enum_values, and table groups in one operations array and call this once.\\nRules: (1) all data field names are snake_case; (2) for create, generate your own UUIDs and put them in data.uuid, then later operations in the same batch may reference those UUIDs without read-back calls; (3) enum values are separate enum_value operations, not inline on enum; (4) ref.relationship uses short dbdiagram-style symbols: >, <, or -; (5) ref_column operations map FK columns explicitly, never automatically.\\nDo not look for type-specific ERD CUD tools; this tool is the only ERD CUD entry point. If operations is very large, use request_upload_token with purpose=mcp.call and send the tools/call payload with curl to save LLM tokens.\\nOne-call worked example:\\n{\\n \\\"documentUuid\\\": \\\"erd-doc-uuid\\\",\\n \\\"description\\\": \\\"create users/posts ERD\\\",\\n \\\"operations\\\": [\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"table\\\",\\\"data\\\":{\\\"uuid\\\":\\\"tbl_users\\\",\\\"name\\\":\\\"users\\\",\\\"display_order\\\":1}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_users_id\\\",\\\"table_uuid\\\":\\\"tbl_users\\\",\\\"name\\\":\\\"id\\\",\\\"type\\\":\\\"bigint\\\",\\\"is_pk\\\":true,\\\"is_not_null\\\":true,\\\"display_order\\\":1}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_users_email\\\",\\\"table_uuid\\\":\\\"tbl_users\\\",\\\"name\\\":\\\"email\\\",\\\"type\\\":\\\"varchar(255)\\\",\\\"is_unique\\\":true,\\\"is_not_null\\\":true,\\\"display_order\\\":2}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"table\\\",\\\"data\\\":{\\\"uuid\\\":\\\"tbl_posts\\\",\\\"name\\\":\\\"posts\\\",\\\"display_order\\\":2}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_posts_id\\\",\\\"table_uuid\\\":\\\"tbl_posts\\\",\\\"name\\\":\\\"id\\\",\\\"type\\\":\\\"bigint\\\",\\\"is_pk\\\":true,\\\"is_not_null\\\":true,\\\"display_order\\\":1}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_posts_author_id\\\",\\\"table_uuid\\\":\\\"tbl_posts\\\",\\\"name\\\":\\\"author_id\\\",\\\"type\\\":\\\"bigint\\\",\\\"is_not_null\\\":true,\\\"display_order\\\":2}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_posts_status\\\",\\\"table_uuid\\\":\\\"tbl_posts\\\",\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"post_status\\\",\\\"is_not_null\\\":true,\\\"display_order\\\":3}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"enum\\\",\\\"data\\\":{\\\"uuid\\\":\\\"enum_post_status\\\",\\\"name\\\":\\\"post_status\\\"}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"enum_value\\\",\\\"data\\\":{\\\"uuid\\\":\\\"enum_post_status_draft\\\",\\\"enum_uuid\\\":\\\"enum_post_status\\\",\\\"value\\\":\\\"draft\\\",\\\"display_order\\\":1}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"enum_value\\\",\\\"data\\\":{\\\"uuid\\\":\\\"enum_post_status_published\\\",\\\"enum_uuid\\\":\\\"enum_post_status\\\",\\\"value\\\":\\\"published\\\",\\\"display_order\\\":2}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"ref\\\",\\\"data\\\":{\\\"uuid\\\":\\\"ref_posts_author\\\",\\\"name\\\":\\\"fk_posts_author\\\",\\\"from_table_uuid\\\":\\\"tbl_posts\\\",\\\"to_table_uuid\\\":\\\"tbl_users\\\",\\\"relationship\\\":\\\">\\\",\\\"on_delete\\\":\\\"cascade\\\"}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"ref_column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"refcol_posts_author\\\",\\\"ref_uuid\\\":\\\"ref_posts_author\\\",\\\"from_column_uuid\\\":\\\"col_posts_author_id\\\",\\\"to_column_uuid\\\":\\\"col_users_id\\\",\\\"display_order\\\":1}}\\n ]\\n}\",\"inputSchema\":{\"properties\":{\"arrangeNewTables\":{\"description\":\"Whether to auto-place newly-created tables after the batch; defaults to true\",\"type\":\"boolean\"},\"description\":{\"description\":\"Reason for batch (audit)\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"operations\":{\"description\":\"Atomic create/update/delete operations\",\"items\":{\"description\":\"One ERD mutation. Use a single operations array with client-generated data.uuid values to create cross-referenced tables, columns, enums, refs, and ref_columns without read-back calls.\",\"discriminator\":{\"propertyName\":\"type\"},\"oneOf\":[{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table'.\",\"properties\":{\"alias\":{\"description\":\"Display alias.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"header_color\":{\"description\":\"Header color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"note\":{\"description\":\"Table note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"name\"],\"title\":\"table data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table'.\",\"properties\":{\"alias\":{\"description\":\"Display alias.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"header_color\":{\"description\":\"Header color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"note\":{\"description\":\"Table note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"table\",\"description\":\"Must be 'table' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"table operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='column'.\",\"properties\":{\"default_value\":{\"description\":\"Default value.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"is_increment\":{\"description\":\"Auto-increment flag.\",\"type\":\"boolean\"},\"is_not_null\":{\"description\":\"Not-null flag.\",\"type\":\"boolean\"},\"is_pk\":{\"description\":\"Primary key flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Column name.\",\"type\":\"string\"},\"note\":{\"description\":\"Column note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create; may be a data.uuid from an earlier table operation in this batch.\",\"type\":\"string\"},\"type\":{\"description\":\"SQL data type. Use this exact field name; do not send data_type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"table_uuid\"],\"title\":\"column data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='column'.\",\"properties\":{\"default_value\":{\"description\":\"Default value.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"is_increment\":{\"description\":\"Auto-increment flag.\",\"type\":\"boolean\"},\"is_not_null\":{\"description\":\"Not-null flag.\",\"type\":\"boolean\"},\"is_pk\":{\"description\":\"Primary key flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Column name.\",\"type\":\"string\"},\"note\":{\"description\":\"Column note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create; may be a data.uuid from an earlier table operation in this batch.\",\"type\":\"string\"},\"type\":{\"description\":\"SQL data type. Use this exact field name; do not send data_type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"column data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"column\",\"description\":\"Must be 'column' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"column operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='index'.\",\"properties\":{\"is_pk\":{\"description\":\"Primary key index flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique index flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Index name.\",\"type\":\"string\"},\"note\":{\"description\":\"Index note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create.\",\"type\":\"string\"},\"type\":{\"description\":\"Index type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"table_uuid\"],\"title\":\"index data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='index'.\",\"properties\":{\"is_pk\":{\"description\":\"Primary key index flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique index flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Index name.\",\"type\":\"string\"},\"note\":{\"description\":\"Index note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create.\",\"type\":\"string\"},\"type\":{\"description\":\"Index type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"index data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"index\",\"description\":\"Must be 'index' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"index operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='index_column'.\",\"properties\":{\"column_uuid\":{\"description\":\"Column UUID. Required for create.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"index_uuid\":{\"description\":\"Index UUID. Required for create.\",\"type\":\"string\"},\"sort_order\":{\"description\":\"Sort order, for example ASC or DESC.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"index_uuid\",\"column_uuid\"],\"title\":\"index_column data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='index_column'.\",\"properties\":{\"column_uuid\":{\"description\":\"Column UUID. Required for create.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"index_uuid\":{\"description\":\"Index UUID. Required for create.\",\"type\":\"string\"},\"sort_order\":{\"description\":\"Sort order, for example ASC or DESC.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"index_column data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"index_column\",\"description\":\"Must be 'index_column' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"index_column operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='ref'.\",\"properties\":{\"from_table_uuid\":{\"description\":\"Source table UUID. Required for create.\",\"type\":\"string\"},\"name\":{\"description\":\"Reference name.\",\"type\":\"string\"},\"on_delete\":{\"description\":\"ON DELETE action.\",\"type\":\"string\"},\"on_update\":{\"description\":\"ON UPDATE action.\",\"type\":\"string\"},\"relationship\":{\"description\":\"Required for create. Use short dbdiagram-style relationship symbols.\",\"enum\":[\">\",\"<\",\"-\"],\"type\":\"string\"},\"to_table_uuid\":{\"description\":\"Target table UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"from_table_uuid\",\"to_table_uuid\",\"relationship\"],\"title\":\"ref data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='ref'.\",\"properties\":{\"from_table_uuid\":{\"description\":\"Source table UUID. Required for create.\",\"type\":\"string\"},\"name\":{\"description\":\"Reference name.\",\"type\":\"string\"},\"on_delete\":{\"description\":\"ON DELETE action.\",\"type\":\"string\"},\"on_update\":{\"description\":\"ON UPDATE action.\",\"type\":\"string\"},\"relationship\":{\"description\":\"Required for create. Use short dbdiagram-style relationship symbols.\",\"enum\":[\">\",\"<\",\"-\"],\"type\":\"string\"},\"to_table_uuid\":{\"description\":\"Target table UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"ref data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"ref\",\"description\":\"Must be 'ref' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"ref operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='ref_column'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"from_column_uuid\":{\"description\":\"Source column UUID. Required for create.\",\"type\":\"string\"},\"ref_uuid\":{\"description\":\"Reference UUID. Required for create; may be a data.uuid from an earlier ref operation.\",\"type\":\"string\"},\"to_column_uuid\":{\"description\":\"Target column UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"ref_uuid\",\"from_column_uuid\",\"to_column_uuid\"],\"title\":\"ref_column data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='ref_column'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"from_column_uuid\":{\"description\":\"Source column UUID. Required for create.\",\"type\":\"string\"},\"ref_uuid\":{\"description\":\"Reference UUID. Required for create; may be a data.uuid from an earlier ref operation.\",\"type\":\"string\"},\"to_column_uuid\":{\"description\":\"Target column UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"ref_column data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"ref_column\",\"description\":\"Must be 'ref_column' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"ref_column operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='enum'.\",\"properties\":{\"name\":{\"description\":\"Enum name.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"enum data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='enum'.\",\"properties\":{\"name\":{\"description\":\"Enum name.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"enum data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"enum\",\"description\":\"Must be 'enum' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"enum operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='enum_value'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"enum_uuid\":{\"description\":\"Parent enum UUID. Required for create; may be a data.uuid from an earlier enum operation.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum value note.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"value\":{\"description\":\"Enum value. Inline enum values on enum are not persisted; create enum_value operations.\",\"type\":\"string\"}},\"required\":[\"enum_uuid\"],\"title\":\"enum_value data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='enum_value'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"enum_uuid\":{\"description\":\"Parent enum UUID. Required for create; may be a data.uuid from an earlier enum operation.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum value note.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"value\":{\"description\":\"Enum value. Inline enum values on enum are not persisted; create enum_value operations.\",\"type\":\"string\"}},\"title\":\"enum_value data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"enum_value\",\"description\":\"Must be 'enum_value' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"enum_value operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group'.\",\"properties\":{\"color\":{\"description\":\"Group color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table group name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group'.\",\"properties\":{\"color\":{\"description\":\"Group color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table group name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"table_group\",\"description\":\"Must be 'table_group' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"table_group operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group_table'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Table schema name.\",\"type\":\"string\"},\"table_name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"group_uuid\",\"table_name\"],\"title\":\"table_group_table data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group_table'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Table schema name.\",\"type\":\"string\"},\"table_name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group_table data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"table_group_table\",\"description\":\"Must be 'table_group_table' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"table_group_table operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group_note'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"note_uuid\":{\"description\":\"Note UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"group_uuid\",\"note_uuid\"],\"title\":\"table_group_note data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group_note'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"note_uuid\":{\"description\":\"Note UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group_note data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"table_group_note\",\"description\":\"Must be 'table_group_note' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"table_group_note operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='filter'.\",\"properties\":{\"included_tables\":{\"description\":\"JSON string/list of included tables.\",\"type\":\"string\"},\"is_default\":{\"description\":\"Default filter flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Filter name.\",\"type\":\"string\"},\"table_groups\":{\"description\":\"JSON string/object of table groups.\",\"type\":\"string\"},\"table_positions\":{\"description\":\"JSON string/object of table positions.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"filter data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='filter'.\",\"properties\":{\"included_tables\":{\"description\":\"JSON string/list of included tables.\",\"type\":\"string\"},\"is_default\":{\"description\":\"Default filter flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Filter name.\",\"type\":\"string\"},\"table_groups\":{\"description\":\"JSON string/object of table groups.\",\"type\":\"string\"},\"table_positions\":{\"description\":\"JSON string/object of table positions.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"filter data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"filter\",\"description\":\"Must be 'filter' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"filter operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='note'.\",\"properties\":{\"color\":{\"description\":\"Note color.\",\"type\":\"string\"},\"content\":{\"description\":\"Note content.\",\"type\":\"string\"},\"height\":{\"description\":\"Height.\",\"type\":\"integer\"},\"icon_name\":{\"description\":\"Icon name.\",\"type\":\"string\"},\"position_x\":{\"description\":\"X position.\",\"type\":\"integer\"},\"position_y\":{\"description\":\"Y position.\",\"type\":\"integer\"},\"title\":{\"description\":\"Note title.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"width\":{\"description\":\"Width.\",\"type\":\"integer\"}},\"title\":\"note data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='note'.\",\"properties\":{\"color\":{\"description\":\"Note color.\",\"type\":\"string\"},\"content\":{\"description\":\"Note content.\",\"type\":\"string\"},\"height\":{\"description\":\"Height.\",\"type\":\"integer\"},\"icon_name\":{\"description\":\"Icon name.\",\"type\":\"string\"},\"position_x\":{\"description\":\"X position.\",\"type\":\"integer\"},\"position_y\":{\"description\":\"Y position.\",\"type\":\"integer\"},\"title\":{\"description\":\"Note title.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"width\":{\"description\":\"Width.\",\"type\":\"integer\"}},\"title\":\"note data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"note\",\"description\":\"Must be 'note' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"note operation\",\"type\":\"object\"}],\"properties\":{\"data\":{\"description\":\"Type-specific payload. All field names are snake_case. For create, data.uuid may be client-supplied and referenced by later operations in the same batch.\",\"oneOf\":[{\"description\":\"Payload for operation.type='table'.\",\"properties\":{\"alias\":{\"description\":\"Display alias.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"header_color\":{\"description\":\"Header color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"note\":{\"description\":\"Table note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='column'.\",\"properties\":{\"default_value\":{\"description\":\"Default value.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"is_increment\":{\"description\":\"Auto-increment flag.\",\"type\":\"boolean\"},\"is_not_null\":{\"description\":\"Not-null flag.\",\"type\":\"boolean\"},\"is_pk\":{\"description\":\"Primary key flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Column name.\",\"type\":\"string\"},\"note\":{\"description\":\"Column note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create; may be a data.uuid from an earlier table operation in this batch.\",\"type\":\"string\"},\"type\":{\"description\":\"SQL data type. Use this exact field name; do not send data_type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"column data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='index'.\",\"properties\":{\"is_pk\":{\"description\":\"Primary key index flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique index flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Index name.\",\"type\":\"string\"},\"note\":{\"description\":\"Index note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create.\",\"type\":\"string\"},\"type\":{\"description\":\"Index type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"index data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='index_column'.\",\"properties\":{\"column_uuid\":{\"description\":\"Column UUID. Required for create.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"index_uuid\":{\"description\":\"Index UUID. Required for create.\",\"type\":\"string\"},\"sort_order\":{\"description\":\"Sort order, for example ASC or DESC.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"index_column data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='ref'.\",\"properties\":{\"from_table_uuid\":{\"description\":\"Source table UUID. Required for create.\",\"type\":\"string\"},\"name\":{\"description\":\"Reference name.\",\"type\":\"string\"},\"on_delete\":{\"description\":\"ON DELETE action.\",\"type\":\"string\"},\"on_update\":{\"description\":\"ON UPDATE action.\",\"type\":\"string\"},\"relationship\":{\"description\":\"Required for create. Use short dbdiagram-style relationship symbols.\",\"enum\":[\">\",\"<\",\"-\"],\"type\":\"string\"},\"to_table_uuid\":{\"description\":\"Target table UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"ref data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='ref_column'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"from_column_uuid\":{\"description\":\"Source column UUID. Required for create.\",\"type\":\"string\"},\"ref_uuid\":{\"description\":\"Reference UUID. Required for create; may be a data.uuid from an earlier ref operation.\",\"type\":\"string\"},\"to_column_uuid\":{\"description\":\"Target column UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"ref_column data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='enum'.\",\"properties\":{\"name\":{\"description\":\"Enum name.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"enum data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='enum_value'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"enum_uuid\":{\"description\":\"Parent enum UUID. Required for create; may be a data.uuid from an earlier enum operation.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum value note.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"value\":{\"description\":\"Enum value. Inline enum values on enum are not persisted; create enum_value operations.\",\"type\":\"string\"}},\"title\":\"enum_value data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='table_group'.\",\"properties\":{\"color\":{\"description\":\"Group color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table group name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='table_group_table'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Table schema name.\",\"type\":\"string\"},\"table_name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group_table data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='table_group_note'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"note_uuid\":{\"description\":\"Note UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group_note data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='filter'.\",\"properties\":{\"included_tables\":{\"description\":\"JSON string/list of included tables.\",\"type\":\"string\"},\"is_default\":{\"description\":\"Default filter flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Filter name.\",\"type\":\"string\"},\"table_groups\":{\"description\":\"JSON string/object of table groups.\",\"type\":\"string\"},\"table_positions\":{\"description\":\"JSON string/object of table positions.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"filter data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='note'.\",\"properties\":{\"color\":{\"description\":\"Note color.\",\"type\":\"string\"},\"content\":{\"description\":\"Note content.\",\"type\":\"string\"},\"height\":{\"description\":\"Height.\",\"type\":\"integer\"},\"icon_name\":{\"description\":\"Icon name.\",\"type\":\"string\"},\"position_x\":{\"description\":\"X position.\",\"type\":\"integer\"},\"position_y\":{\"description\":\"Y position.\",\"type\":\"integer\"},\"title\":{\"description\":\"Note title.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"width\":{\"description\":\"Width.\",\"type\":\"integer\"}},\"title\":\"note data\",\"type\":\"object\"}],\"type\":\"object\"},\"op\":{\"description\":\"Operation. For create, put any new UUID in data.uuid; for update/delete, put target UUID in operation.uuid.\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"description\":\"ERD entity type. This selects the operation.data shape.\",\"enum\":[\"table\",\"column\",\"index\",\"index_column\",\"ref\",\"ref_column\",\"enum\",\"enum_value\",\"table_group\",\"table_group_table\",\"table_group_note\",\"filter\",\"note\"],\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete. Do not use this for create; use data.uuid instead.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"documentUuid\",\"description\",\"operations\"],\"type\":\"object\"},\"required\":[\"description\",\"documentUuid\",\"operations\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"87f5bcf5a253815a\"},\n {\"mcpName\":\"erd_arrange_tables\",\"commandPath\":[\"erd\",\"arrange-tables\"],\"group\":\"erd\",\"description\":\"Arrange ERD tables after edits. Default incremental mode places newly-created tables while preserving existing positions; full=true re-layouts the entire diagram. Use after several separate table edits to tidy the canvas.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"full\":{\"description\":\"Re-layout the ENTIRE diagram (overwrites existing positions). Default false = arrange only newly-added (uncoordinated) tables to the top-right while preserving existing table positions. Call this after creating several tables to tidy them up.\",\"type\":\"boolean\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"651fd0d54e3635ff\"},\n {\"mcpName\":\"erd_get_enum\",\"commandPath\":[\"erd\",\"get-enum\"],\"group\":\"erd\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"enumUuid\":{\"description\":\"Enum UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"enumUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"enumUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"f0d79d7a1996939c\"},\n {\"mcpName\":\"erd_get_ref\",\"commandPath\":[\"erd\",\"get-ref\"],\"group\":\"erd\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"refUuid\":{\"description\":\"Relationship UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"refUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"refUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"5b47fe7d99e60d4d\"},\n {\"mcpName\":\"erd_get_table\",\"commandPath\":[\"erd\",\"get-table\"],\"group\":\"erd\",\"description\":\"Get one ERD table with nested columns and indexes. Returns persistent table/column/index UUIDs usable directly as erd_apply_changes update/delete targets and ref_column column references. Column fields use apply_changes snake_case names: uuid, table_uuid, name, type, is_pk, is_unique, is_not_null, is_increment, default_value, note, display_order. Index fields include uuid, name, columns (column UUIDs), is_unique, is_pk, type.\",\"inputSchema\":{\"description\":\"Get one ERD table with nested columns and indexes. Returns persistent table/column/index UUIDs usable directly as mcp__ainecto__erd_apply_changes update/delete targets and ref_column column references. Column fields use apply_changes snake_case names: uuid, table_uuid, name, type, is_pk, is_unique, is_not_null, is_increment, default_value, note, display_order. Index fields include uuid, name, columns (column UUIDs), is_unique, is_pk, type.\",\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"tableUuid\":{\"description\":\"Table UUID. Response includes columns[] and indexes[] with persistent UUIDs for apply_changes.\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"tableUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"tableUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"0dc13648bf3fbf8f\"},\n {\"mcpName\":\"erd_get_table_group\",\"commandPath\":[\"erd\",\"get-table-group\"],\"group\":\"erd\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"tableGroupUuid\":{\"description\":\"Table group UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"tableGroupUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"tableGroupUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"3db246dfe8663370\"},\n {\"mcpName\":\"erd_list_enums\",\"commandPath\":[\"erd\",\"list-enums\"],\"group\":\"erd\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"4d1f602fa487a0e4\"},\n {\"mcpName\":\"erd_list_refs\",\"commandPath\":[\"erd\",\"list-refs\"],\"group\":\"erd\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"307d766c777bbe8c\"},\n {\"mcpName\":\"erd_list_table_groups\",\"commandPath\":[\"erd\",\"list-table-groups\"],\"group\":\"erd\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"775bff53bbc21c9e\"},\n {\"mcpName\":\"erd_list_tables\",\"commandPath\":[\"erd\",\"list-tables\"],\"group\":\"erd\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"34324dfc7ef461c8\"},\n {\"mcpName\":\"get_attachment\",\"commandPath\":[\"attachment\",\"get\"],\"group\":\"attachment\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuid\":{\"description\":\"Attachment UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"required\":[\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"1e0e7f1bf33b669c\"},\n {\"mcpName\":\"get_document\",\"commandPath\":[\"document\",\"get\"],\"group\":\"document\",\"description\":\"Read a document. The body comes back for the types whose create/update take one: markdown → content; openapi → content (the spec text) + format/specVersion/pathCount/operationCount; html → content (the HTML text); file → file {filename, contentType, sizeBytes, viewerKind} + content for text/CSV (first 64 KB); diagram → diagramSource/sourceLanguage/edgeStyle/isModule/metadata; erd → metadata only (read tables/refs via erd_list_*).\",\"inputSchema\":{\"properties\":{\"uuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"required\":[\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"2efef592c2d6dd7a\"},\n {\"mcpName\":\"get_my_work_summary\",\"commandPath\":[\"my-work-summary\",\"get\"],\"group\":\"generic\",\"description\":\"One-call summary of what is waiting for the signed-in user in AiNecto — call it when the user asks things like \\\"do I have anything to do?\\\", \\\"anything new?\\\", \\\"anything to review?\\\" or \\\"did anyone ask me something?\\\". Returns notifications {unread (not yet read by the person, newest 100 counted; unreadCapped when there are more), unreadByKind, newForThisConnection (not yet acknowledged by this connection — the same number as the line at the end of tool results)}, mentionsToRead {items the person has not read that mention them, each with target title and url}, and todos {open, leaseExpired, inProgress, items: questions and requests waiting for the user's agent}. For details use list_notifications and list_agent_todos; to read the document and its comments use get_document with the target uuid. Read-only: nothing is marked read or acknowledged.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"projectUuid\":{\"description\":\"Older single-value form of projectUuids.\",\"type\":\"string\"},\"projectUuids\":{\"description\":\"Only items in any of these projects. Use it when the user names a project or the project you are working in is clear. With workspaceUuids too, both must match. A workspace or project you cannot see matches nothing.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"workspaceUuids\":{\"description\":\"Only items in any of these workspaces.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"bc63904d51058f42\"},\n {\"mcpName\":\"get_project\",\"commandPath\":[\"project\",\"get\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"required\":[\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"192403c3484ac774\"},\n {\"mcpName\":\"get_version\",\"commandPath\":[\"version\",\"get\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"Document UUID\",\"type\":\"string\"},\"versionNumber\":{\"description\":\"Version number\",\"type\":\"integer\"}},\"required\":[\"documentUuid\",\"versionNumber\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"versionNumber\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"4e308c1a8c7203d1\"},\n {\"mcpName\":\"get_workspace\",\"commandPath\":[\"workspace\",\"get\"],\"group\":\"workspace\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuid\":{\"description\":\"Workspace UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"required\":[\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"db6d1b4879d57c56\"},\n {\"mcpName\":\"identity_get_self\",\"commandPath\":[\"tools\",\"run\",\"identity-get-self\"],\"group\":\"generic\",\"description\":\"Return the authenticated MCP caller identity summary; never returns email or token claims.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"f29c86804eb91700\"},\n {\"mcpName\":\"list_agent_todos\",\"commandPath\":[\"agent-todos\",\"list\"],\"group\":\"generic\",\"description\":\"List the to-dos that ask the signed-in user's agent to act now (for example a question that mentions the user). This is the current state, not a feed: a to-do you have not finished comes back on every call until it is completed, dismissed, or closed because the person did it themselves. Each item has todoId, kind, obligation, openedAt, summary, target (title and url), action and state. To work on one, claim it with update_agent_todos and complete it with a one-line note. Actions that affect other people (assigning, approving, inviting) need the user's confirmation first.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"after\":{\"description\":\"todoId of the last item of the previous page.\",\"type\":\"string\"},\"kinds\":{\"description\":\"Only these kinds.\",\"items\":{\"enum\":[\"COMMENT_MENTIONED\",\"COMMENT_REPLIED\",\"QUESTION_ANSWERED\",\"QUESTION_RESOLVED\",\"QUESTION_MENTIONED\"],\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"limit\":{\"description\":\"Items per call, default 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Older single-value form of projectUuids.\",\"type\":\"string\"},\"projectUuids\":{\"description\":\"Only to-dos in any of these projects. Use it when the user names a project or the project you are working in is clear. With workspaceUuids too, both must match. A workspace or project you cannot see matches nothing.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"state\":{\"description\":\"OPEN (default): to-dos you can take, including ones whose lease expired. MINE: to-dos currently leased (claimed) and not expired.\",\"items\":{\"enum\":[\"OPEN\",\"MINE\"],\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"workspaceUuids\":{\"description\":\"Only to-dos in any of these workspaces.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"9c228a3044a546cf\"},\n {\"mcpName\":\"list_attachments\",\"commandPath\":[\"attachments\",\"list\"],\"group\":\"attachment\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"projectUuid\"],\"type\":\"object\"},\"required\":[\"projectUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"fae7152d1e4a930b\"},\n {\"mcpName\":\"list_comments\",\"commandPath\":[\"comments\",\"list\"],\"group\":\"generic\",\"description\":\"List the active comments on a document, oldest first, including replies (a reply has parentCommentId set; replies are one level deep). Each comment has id, kind (COMMENT or QUESTION), body, author, mentions (userId, label and position in the body), and for questions questionState (UNANSWERED, ANSWERED, RESOLVED) and resolvedAt. Anyone who can read the document can list its comments.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"documentUuid\":{\"description\":\"Document UUID the comments belong to\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"4c60115a00f61404\"},\n {\"mcpName\":\"list_documents\",\"commandPath\":[\"documents\",\"list\"],\"group\":\"document\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"folderUuid\":{\"description\":\"Optional folder UUID\",\"type\":\"string\"},\"limit\":{\"description\":\"Result cap when q is set (default 50)\",\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"},\"q\":{\"description\":\"Optional full-text query. When provided, results come from the search index instead of folder listing.\",\"type\":\"string\"},\"type\":{\"description\":\"Optional document type filter. Readable values: erd, markdown, diagram, openapi, html, file.\",\"enum\":[\"erd\",\"markdown\",\"diagram\",\"openapi\",\"html\",\"file\"],\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"2171496b44dc2abf\"},\n {\"mcpName\":\"list_folders\",\"commandPath\":[\"folders\",\"list\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"projectUuid\"],\"type\":\"object\"},\"required\":[\"projectUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"461dc6735ac92c3b\"},\n {\"mcpName\":\"list_history\",\"commandPath\":[\"history\",\"list\"],\"group\":\"generic\",\"description\":\"List recent activity (who did what, people and agents) in a workspace, a project, or on one resource, newest first. Give at least one of workspaceUuid, projectUuid, or resourceType with resourceUuid; you need editor access or higher in that scope. This is a list to refresh, not a gap-free feed: to see what is new, read the first page again and skip ids you have already seen; to get each new notification exactly once use list_notifications. Each item has id, kind, at, lastAt, coalesceCount, actor, target (title and url only when you can read it now), changes and summary.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"actorType\":{\"description\":\"Only people (USER) or only agents (AGENT).\",\"enum\":[\"USER\",\"AGENT\"],\"type\":\"string\"},\"before\":{\"description\":\"nextCursor of the previous page (older items).\",\"type\":\"string\"},\"kinds\":{\"description\":\"Only these kinds.\",\"items\":{\"enum\":[\"COMMENT_MENTIONED\",\"COMMENT_REPLIED\",\"QUESTION_ANSWERED\",\"QUESTION_RESOLVED\",\"QUESTION_MENTIONED\"],\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"limit\":{\"description\":\"Items per call, default 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Activity in this project.\",\"type\":\"string\"},\"resourceType\":{\"description\":\"With resourceUuid: activity on one resource.\",\"enum\":[\"DOCUMENT\",\"PROJECT\"],\"type\":\"string\"},\"resourceUuid\":{\"description\":\"UUID of the resource named by resourceType.\",\"type\":\"string\"},\"workspaceUuid\":{\"description\":\"Activity in this workspace.\",\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"235832683071654b\"},\n {\"mcpName\":\"list_mention_candidates\",\"commandPath\":[\"mention-candidates\",\"list\"],\"group\":\"generic\",\"description\":\"List the people you can mention in comments on a document: userId and displayName. Only people who can read the document are listed. To mention someone, write @<displayName> exactly in the comment body and pass their userId in mentionUserIds of create_comments or update_comments. Page with nextCursor while hasMore is true.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cursor\":{\"description\":\"nextCursor from the previous page (same documentUuid and query).\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to\",\"type\":\"string\"},\"limit\":{\"description\":\"Page size, 1..50. Defaults to 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"query\":{\"description\":\"Name filter, 0..100 characters. Omit or leave empty for the first page of everyone.\",\"maxLength\":100,\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"896a5a6ff357268b\"},\n {\"mcpName\":\"list_notifications\",\"commandPath\":[\"notifications\",\"list\"],\"group\":\"generic\",\"description\":\"Read new notifications for the signed-in user, oldest first and without gaps — for an agent that checks the inbox periodically. The server remembers, per connection and per filter (kinds, workspaceUuids, projectUuids, directOnly), how far you have acknowledged; a new filter starts from now. Each response carries ackToken: pass it as ack in your next call (with the same filter) after you have handled the batch — if you do not, the next call returns the same batch again (identify duplicates by id and seq; an item that comes back with a higher seq and a larger groupCount is an update of the same entry). Each item has id, seq, kind, at, summary (one line), actor, target (title and url only when you can read it now), action (what the user is asked to do) and humanRead. An item you can no longer read comes back as {id, seq, at, redacted: true}. This tool never marks anything read for the person; open to-dos are in list_agent_todos. Calls closer than 30 seconds apart (except a call that carries ack) return retryAfterSeconds instead of items.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"ack\":{\"description\":\"The ackToken of the previous response. Send it with the same filter once you have handled (or safely stored) that batch; only then does the saved position move past it. Without it, the same batch is returned again.\",\"type\":\"string\"},\"cursor\":{\"description\":\"Where to read from. \\\"saved\\\" (default): after what this connection last acknowledged for this same filter. \\\"latest\\\": from now on (moves the saved position to now). \\\"earliest\\\": everything still kept (90 days). Or a nextCursor from a previous response: read after it without using or changing the saved position.\",\"type\":\"string\"},\"directOnly\":{\"description\":\"Only notifications that point at you directly (mentions, questions to you).\",\"type\":\"boolean\"},\"kinds\":{\"description\":\"Only these notification kinds.\",\"items\":{\"enum\":[\"COMMENT_MENTIONED\",\"COMMENT_REPLIED\",\"QUESTION_ANSWERED\",\"QUESTION_RESOLVED\",\"QUESTION_MENTIONED\"],\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"limit\":{\"description\":\"Items per call, default 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Older single-value form of projectUuids.\",\"type\":\"string\"},\"projectUuids\":{\"description\":\"Only notifications in any of these projects. Use it when the user names a project or the project you are working in is clear. With workspaceUuids too, both must match. A workspace or project you cannot see matches nothing.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"workspaceUuids\":{\"description\":\"Only notifications in any of these workspaces.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"0c2bb3fdc8291b03\"},\n {\"mcpName\":\"list_projects\",\"commandPath\":[\"projects\",\"list\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"limit\":{\"description\":\"Result cap when q is set (default 50)\",\"type\":\"integer\"},\"q\":{\"description\":\"Optional full-text query\",\"type\":\"string\"},\"workspaceUuid\":{\"description\":\"Optional Workspace UUID\",\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"939bfcc088425771\"},\n {\"mcpName\":\"list_trash\",\"commandPath\":[\"trash\",\"list\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"329250aecc06a298\"},\n {\"mcpName\":\"list_versions\",\"commandPath\":[\"versions\",\"list\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"f08f9faee3ba9107\"},\n {\"mcpName\":\"list_workspaces\",\"commandPath\":[\"workspaces\",\"list\"],\"group\":\"workspace\",\"description\":\"\",\"inputSchema\":{\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"39dba0089fdbdf6a\"},\n {\"mcpName\":\"markdown_append_document\",\"commandPath\":[\"markdown\",\"append-document\"],\"group\":\"markdown\",\"description\":\"Append to Markdown documents. If the appended body is tens of KB or more, prefer request_upload_token (purpose=document.append) and upload the body with curl.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Appends\",\"items\":{\"properties\":{\"addition\":{\"description\":\"Body addition. 추가할 내용이 크면 (수십 KB 이상) LLM 토큰 절약을 위해 `request_upload_token (purpose=document.append, scopeJson={documentUuid, separator})` 로 uploadUrl 을 받고 curl 로 PUT 으로 보낼 것.\",\"type\":\"string\"},\"separator\":{\"description\":\"Separator between existing body and addition\",\"type\":\"string\"},\"uuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"addition\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"bf82401f055f29b0\"},\n {\"mcpName\":\"markdown_generate_document\",\"commandPath\":[\"markdown\",\"generate-document\"],\"group\":\"markdown\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Generation requests\",\"items\":{\"properties\":{\"context\":{\"description\":\"Optional JSON context\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Target document UUID\",\"type\":\"string\"},\"prompt\":{\"description\":\"Generation prompt\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"prompt\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"1e4724ea42f25743\"},\n {\"mcpName\":\"move_documents\",\"commandPath\":[\"documents\",\"move\"],\"group\":\"document\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"clientMutationId\":{\"description\":\"Optional mutation identifier for client retry tracing\",\"maxLength\":128,\"minLength\":1,\"pattern\":\"^[\\\\x21-\\\\x7E]{1,128}$\",\"type\":\"string\"},\"items\":{\"description\":\"Moves\",\"items\":{\"properties\":{\"newFolderUuid\":{\"description\":\"New folder UUID — null/empty for root\",\"type\":\"string\"},\"targetProjectUuid\":{\"description\":\"Target project UUID — omit to stay in current project\",\"type\":\"string\"},\"targetWorkspaceUuid\":{\"description\":\"Guard only: must match targetProjectUuid workspace\",\"type\":\"string\"},\"uuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"45899053743a0c1e\"},\n {\"mcpName\":\"move_folders\",\"commandPath\":[\"folders\",\"move\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Moves\",\"items\":{\"properties\":{\"newParentFolderUuid\":{\"description\":\"New parent UUID — null/empty for root\",\"type\":\"string\"},\"uuid\":{\"description\":\"Folder UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"eff4458d2f35587a\"},\n {\"mcpName\":\"move_projects\",\"commandPath\":[\"projects\",\"move\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Moves\",\"items\":{\"properties\":{\"targetWorkspaceUuid\":{\"description\":\"Destination workspace UUID (you need write access there)\",\"type\":\"string\"},\"uuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"targetWorkspaceUuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"abe0196da3c48ad5\"},\n {\"mcpName\":\"request_upload_token\",\"commandPath\":[\"tools\",\"run\",\"request-upload-token\"],\"group\":\"attachment\",\"description\":\"Use this for large payloads of tens of KB or more to save LLM tokens. purpose=mcp.call returns a short-lived bearer token that can call any MCP tool, including erd_apply_changes, via curl. purpose=document.create/update/append uploads document bodies directly to the upload endpoint with PUT/curl. Tokens are reusable for 5 minutes by default.\",\"inputSchema\":{\"properties\":{\"maxBytes\":{\"description\":\"최대 업로드 byte (서버 측 한도)\",\"type\":\"integer\"},\"purpose\":{\"description\":\"Token 용도. `mcp.call` 은 curl 로 /mcp 호출, `document.create/update/append` 는 PUT body 로 본문 업로드, `attachment.upload` 는 파일 bytes 업로드. 콘텐츠가 크면 (수십 KB 이상) LLM 토큰 절약을 위해 이 도구로 5분 재사용 토큰을 받고 curl 로 보내는 것을 강력 권장.\",\"enum\":[\"mcp.call\",\"document.create\",\"document.update\",\"document.append\",\"attachment.upload\"],\"type\":\"string\"},\"scopeJson\":{\"description\":\"선택 — JSON scope. document.create 는 projectUuid, type, title 을 포함하고 creatable type values 는 erd, markdown, diagram, openapi, html, file. document.update/document.append 는 documentUuid 를 포함. type=file 은 filename 도 포함(확장자로 형식 판정) — PUT 의 Content-Type 은 파일 MIME, 본문은 파일 바이트. attachment.upload: {documentUuid, filename}; storageKey 는 서버가 발급 scope 에 넣는다.\",\"type\":\"string\"},\"ttlSeconds\":{\"description\":\"TTL (초). 기본 300 (5분)\",\"type\":\"integer\"}},\"required\":[\"purpose\"],\"type\":\"object\"},\"required\":[\"purpose\"],\"payloadMode\":\"binary-upload\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"fe1984b3979abf86\"},\n {\"mcpName\":\"resolve_comments\",\"commandPath\":[\"tools\",\"run\",\"resolve-comments\"],\"group\":\"generic\",\"description\":\"Mark questions on a document as resolved. Only top-level comments with kind QUESTION can be resolved, and it needs edit access to the document (readers can comment but cannot resolve). Resolving cannot be undone. Each id is applied on its own; results report each id.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"documentUuid\":{\"description\":\"Document UUID the comments belong to\",\"type\":\"string\"},\"ids\":{\"description\":\"Question ids to resolve (top-level comments with kind QUESTION)\",\"items\":{\"minimum\":1,\"type\":\"integer\"},\"minItems\":1,\"type\":\"array\"}},\"required\":[\"documentUuid\",\"ids\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"ids\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"7b32b72b3a0d64ba\"},\n {\"mcpName\":\"restore_versions\",\"commandPath\":[\"versions\",\"restore\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Restores\",\"items\":{\"properties\":{\"documentUuid\":{\"description\":\"Document UUID\",\"type\":\"string\"},\"versionNumber\":{\"description\":\"Version number to restore\",\"type\":\"integer\"}},\"required\":[\"documentUuid\",\"versionNumber\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"005b5b08a19fc605\"},\n {\"mcpName\":\"search_documents\",\"commandPath\":[\"documents\",\"search\"],\"group\":\"document\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"limit\":{\"description\":\"결과 개수 (기본 20, 최대 50)\",\"type\":\"integer\"},\"offset\":{\"description\":\"페이지네이션 offset (기본 0)\",\"type\":\"integer\"},\"projectUuid\":{\"description\":\"특정 프로젝트로 한정 (선택)\",\"type\":\"string\"},\"q\":{\"description\":\"검색 키워드\",\"type\":\"string\"},\"type\":{\"description\":\"Optional document type filter. Readable values: erd, markdown, diagram, openapi, html, file.\",\"enum\":[\"erd\",\"markdown\",\"diagram\",\"openapi\",\"html\",\"file\"],\"type\":\"string\"}},\"required\":[\"q\"],\"type\":\"object\"},\"required\":[\"q\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"e82abba1358754e8\"},\n {\"mcpName\":\"unarchive_documents\",\"commandPath\":[\"documents\",\"unarchive\"],\"group\":\"document\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Document UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"f2810e71583a320f\"},\n {\"mcpName\":\"unarchive_folders\",\"commandPath\":[\"folders\",\"unarchive\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Folder UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"2a24cc44696b7906\"},\n {\"mcpName\":\"unarchive_projects\",\"commandPath\":[\"projects\",\"unarchive\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Project UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"6925e444671afe19\"},\n {\"mcpName\":\"unarchive_workspaces\",\"commandPath\":[\"workspaces\",\"unarchive\"],\"group\":\"workspace\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Workspace UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"8dafe9bc6378c3f2\"},\n {\"mcpName\":\"update_agent_todos\",\"commandPath\":[\"agent-todos\",\"update\"],\"group\":\"generic\",\"description\":\"Claim, renew, complete, release, or dismiss the signed-in user's agent to-dos. Only the session holding the current leaseToken may renew, release, or complete a claimed to-do — even another session of the same connection gets CLAIMED_BY_OTHER. Results are per item: {todoId, ok: true, state, leaseToken?, claimExpiresAt?} or {todoId, ok: false, error} with error one of CLAIMED_BY_OTHER, LEASE_LOST, ALREADY_DONE, CLOSED_BY_HUMAN, SUPERSEDED, ACCESS_LOST, NOT_FOUND, INVALID — on CLOSED_BY_HUMAN or SUPERSEDED stop working on it. Retrying the same complete or dismiss returns ok again. There is no tool to mark the person's notifications read.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"items\":{\"description\":\"To-dos to update; each item is applied and reported on its own.\",\"items\":{\"additionalProperties\":false,\"properties\":{\"action\":{\"description\":\"claim: take it (returns leaseToken, valid 30 minutes). renew: extend your lease. complete: done (with leaseToken if you claimed it; without one only while it is still OPEN). release: give it back. dismiss: not a to-do.\",\"enum\":[\"claim\",\"renew\",\"complete\",\"release\",\"dismiss\"],\"type\":\"string\"},\"leaseToken\":{\"description\":\"Required for renew and release, and for complete or dismiss of a to-do you claimed.\",\"type\":\"string\"},\"note\":{\"description\":\"For complete or dismiss: one line on what you did (at most 500 characters, no document bodies). The person sees it in the inbox.\",\"maxLength\":500,\"type\":\"string\"},\"todoId\":{\"description\":\"todoId from list_agent_todos.\",\"type\":\"string\"}},\"required\":[\"todoId\",\"action\"],\"type\":\"object\"},\"maxItems\":50,\"minItems\":1,\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"da38f4f54f68dbce\"},\n {\"mcpName\":\"update_comments\",\"commandPath\":[\"comments\",\"update\"],\"group\":\"generic\",\"description\":\"Edit your own comments on a document. Only the author can edit, and only while they can still read the document. A resolved question and a top-level comment that already has replies are locked. Items are applied in order and each one commits on its own; results report each item.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"documentUuid\":{\"description\":\"Document UUID the comments belong to\",\"type\":\"string\"},\"items\":{\"description\":\"Edits, applied in order\",\"items\":{\"additionalProperties\":false,\"properties\":{\"body\":{\"description\":\"New comment text (replaces the old text).\",\"maxLength\":10000,\"minLength\":1,\"type\":\"string\"},\"clientMutationId\":{\"description\":\"Idempotency key (visible ASCII, at most 128 characters). Required when mentionUserIds is not empty; reuse the same value when retrying the same item so the mention email is not sent twice.\",\"maxLength\":128,\"type\":\"string\"},\"id\":{\"description\":\"Comment id (from mcp__ainecto__list_comments)\",\"minimum\":1,\"type\":\"integer\"},\"mentionUserIds\":{\"description\":\"The complete set of userIds mentioned after the edit; omit to remove all mentions. Each one's @<displayName> must appear in body. Only people who were not mentioned before get a notification email.\",\"items\":{\"type\":\"string\"},\"maxItems\":20,\"type\":\"array\",\"uniqueItems\":true}},\"required\":[\"id\",\"body\"],\"type\":\"object\"},\"minItems\":1,\"type\":\"array\"},\"mailLanguage\":{\"description\":\"Language of the comment notification email (mention or reply). Defaults to en.\",\"enum\":[\"en\",\"ko\"],\"type\":\"string\"}},\"required\":[\"documentUuid\",\"items\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"3c13611a49c95979\"},\n {\"mcpName\":\"update_documents\",\"commandPath\":[\"documents\",\"update\"],\"group\":\"document\",\"description\":\"Update documents. If a replacement body is tens of KB or more, prefer request_upload_token (purpose=document.update) and upload the body with curl.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Updates\",\"items\":{\"properties\":{\"body\":{\"description\":\"Deprecated compatibility alias for typePayload.body when document type is markdown. 본문이 수십 KB 이상으로 크면 LLM 토큰 절약을 위해 `request_upload_token (purpose=document.update)` 를 호출해 uploadUrl 을 받고 curl 로 직접 PUT 으로 보낼 것.\",\"type\":\"string\"},\"title\":{\"description\":\"New title\",\"type\":\"string\"},\"typePayload\":{\"description\":\"Type-specific payload for enabled document types. markdown: {body}; diagram: {diagramSource,sourceLanguage,edgeStyle,isModule,metadata}; openapi: {content}; html: {content} (a full HTML page); file: {file:{filename,contentType,sizeBytes,viewerKind}} (+content for text/CSV, first 64 KB).\",\"type\":\"object\"},\"uuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"c2088f9ef5b49c6c\"},\n {\"mcpName\":\"update_folders\",\"commandPath\":[\"folders\",\"update\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Updates\",\"items\":{\"properties\":{\"name\":{\"description\":\"New name\",\"type\":\"string\"},\"uuid\":{\"description\":\"Folder UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"name\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"43c58a96ee632b5f\"},\n {\"mcpName\":\"update_projects\",\"commandPath\":[\"projects\",\"update\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Updates\",\"items\":{\"properties\":{\"description\":{\"description\":\"New description\",\"type\":\"string\"},\"name\":{\"description\":\"New name\",\"type\":\"string\"},\"uuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"7d849ef0a830aa8c\"},\n {\"mcpName\":\"update_workspaces\",\"commandPath\":[\"workspaces\",\"update\"],\"group\":\"workspace\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Updates\",\"items\":{\"properties\":{\"description\":{\"description\":\"New description\",\"type\":\"string\"},\"name\":{\"description\":\"New name\",\"type\":\"string\"},\"uuid\":{\"description\":\"Workspace UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"553275e6da799c5a\"},\n {\"mcpName\":\"upload_attachments\",\"commandPath\":[\"tools\",\"run\",\"upload-attachments\"],\"group\":\"attachment\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Attachments to register\",\"items\":{\"properties\":{\"contentType\":{\"description\":\"MIME type\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Parent document UUID\",\"type\":\"string\"},\"filename\":{\"description\":\"Original file name\",\"type\":\"string\"},\"sizeBytes\":{\"description\":\"Size in bytes\",\"type\":\"integer\"},\"storageKey\":{\"description\":\"Storage key returned by request_upload_token purpose=attachment.upload\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"filename\",\"storageKey\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"binary-upload\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"deda4a56fbbe064f\"},\n] satisfies GeneratedToolDefinition[];\n","import type { GeneratedToolDefinition } from \"./types\";\n\nexport const generatedTools = [\n {\"mcpName\":\"create_comments\",\"commandPath\":[\"comments\",\"create\"],\"group\":\"generic\",\"description\":\"Add comments, questions, or replies to a document or a kanban card (cardUuid). Anyone who can read it may comment and reply. Set parentCommentId to reply to a top-level comment. To mention people, get their userId and displayName from list_mention_candidates, write @<displayName> in the body, and list their userIds in mentionUserIds (clientMutationId is then required). Items are applied in order and each one commits on its own; results report each item (ok, or status and error).\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"},\"items\":{\"description\":\"Comments to add, applied in order\",\"items\":{\"additionalProperties\":false,\"properties\":{\"body\":{\"description\":\"Comment text (plain text, 1..10000 characters). To mention someone, include @<displayName> exactly as returned by mcp__ainecto__list_mention_candidates.\",\"maxLength\":10000,\"minLength\":1,\"type\":\"string\"},\"clientMutationId\":{\"description\":\"Idempotency key (visible ASCII, at most 128 characters). Required when mentionUserIds is not empty; reuse the same value when retrying the same item so the mention email is not sent twice.\",\"maxLength\":128,\"type\":\"string\"},\"kind\":{\"description\":\"Top-level comments only: COMMENT (default) or QUESTION. A QUESTION can later be resolved with mcp__ainecto__resolve_comments.\",\"enum\":[\"COMMENT\",\"QUESTION\"],\"type\":\"string\"},\"mentionUserIds\":{\"description\":\"userIds to mention (from mcp__ainecto__list_mention_candidates). Each one's @<displayName> must appear in body; newly mentioned people get a notification email.\",\"items\":{\"type\":\"string\"},\"maxItems\":20,\"type\":\"array\",\"uniqueItems\":true},\"parentCommentId\":{\"description\":\"Reply to this top-level comment id (from mcp__ainecto__list_comments). Replies are one level deep: replying to a reply is rejected. The thread's original author and earlier repliers get a notification email (except people mentioned in this reply, who get the mention email instead).\",\"minimum\":1,\"type\":\"integer\"}},\"required\":[\"body\"],\"type\":\"object\"},\"minItems\":1,\"type\":\"array\"},\"mailLanguage\":{\"description\":\"Language of the comment notification email (mention or reply). Defaults to en.\",\"enum\":[\"en\",\"ko\"],\"type\":\"string\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"d44acdedf00dfe76\"},\n {\"mcpName\":\"create_documents\",\"commandPath\":[\"documents\",\"create\"],\"group\":\"document\",\"description\":\"Create documents. If a document body is tens of KB or more, prefer request_upload_token (purpose=document.create) and upload the body with curl.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Documents\",\"items\":{\"properties\":{\"body\":{\"description\":\"Deprecated compatibility alias for typePayload.body when document type is markdown. 본문이 수십 KB 이상으로 크면 LLM 토큰 절약을 위해 `request_upload_token (purpose=document.create)` 를 호출해 uploadUrl 을 받고 curl 로 직접 PUT 으로 보낼 것.\",\"type\":\"string\"},\"folderUuid\":{\"description\":\"Optional folder UUID\",\"type\":\"string\"},\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"},\"title\":{\"description\":\"Document title\",\"type\":\"string\"},\"type\":{\"description\":\"Document type. Creatable values: erd, diagram, markdown, openapi, html, file, kanban.\",\"enum\":[\"erd\",\"diagram\",\"markdown\",\"openapi\",\"html\",\"file\",\"kanban\"],\"type\":\"string\"},\"typePayload\":{\"description\":\"Type-specific payload for enabled document types. markdown: {body}; diagram: {diagramSource,sourceLanguage,edgeStyle,isModule,metadata}; openapi: {content}; html: {content} (a full HTML page); file: no JSON payload — bytes go through request_upload_token(purpose=document.create, scopeJson={projectUuid,folderUuid?,type:\\\"file\\\",title,filename}) then one curl PUT (images·PDF·mp4/webm·audio·text/code·CSV only); kanban: no payload — creates an empty board; add cards with kanban_apply_changes.\",\"type\":\"object\"}},\"required\":[\"projectUuid\",\"type\",\"title\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"65867cbf84bf78a8\"},\n {\"mcpName\":\"create_folders\",\"commandPath\":[\"folders\",\"create\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Folders\",\"items\":{\"properties\":{\"name\":{\"description\":\"Folder name\",\"type\":\"string\"},\"parentFolderUuid\":{\"description\":\"Parent folder UUID\",\"type\":\"string\"},\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"projectUuid\",\"name\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"30f45b887259609f\"},\n {\"mcpName\":\"create_projects\",\"commandPath\":[\"projects\",\"create\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Projects\",\"items\":{\"properties\":{\"description\":{\"description\":\"Description\",\"type\":\"string\"},\"name\":{\"description\":\"Project name\",\"type\":\"string\"},\"projectKey\":{\"description\":\"Unique project key\",\"type\":\"string\"},\"workspaceUuid\":{\"description\":\"Workspace UUID — null uses user's default workspace\",\"type\":\"string\"}},\"required\":[\"name\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"edf5cf688d7c039a\"},\n {\"mcpName\":\"create_workspaces\",\"commandPath\":[\"workspaces\",\"create\"],\"group\":\"workspace\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Workspaces\",\"items\":{\"properties\":{\"description\":{\"description\":\"Description\",\"type\":\"string\"},\"name\":{\"description\":\"Workspace name\",\"type\":\"string\"}},\"required\":[\"name\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"d9d1b0d561828b8e\"},\n {\"mcpName\":\"delete_attachments\",\"commandPath\":[\"attachments\",\"delete\"],\"group\":\"attachment\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Attachment UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"b22c24bffdfe3d7d\"},\n {\"mcpName\":\"delete_comments\",\"commandPath\":[\"comments\",\"delete\"],\"group\":\"generic\",\"description\":\"Delete your own comments on a document or a kanban card (cardUuid). Only the author can delete. A resolved question and a top-level comment that still has replies cannot be deleted. Each id is applied on its own; results report each id.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"},\"ids\":{\"description\":\"Comment ids to delete (from mcp__ainecto__list_comments)\",\"items\":{\"minimum\":1,\"type\":\"integer\"},\"minItems\":1,\"type\":\"array\"}},\"required\":[\"ids\"],\"type\":\"object\"},\"required\":[\"ids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"082e4b4d9ba97fe0\"},\n {\"mcpName\":\"delete_documents\",\"commandPath\":[\"documents\",\"delete\"],\"group\":\"document\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Document UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"3a725ae70956c270\"},\n {\"mcpName\":\"delete_folders\",\"commandPath\":[\"folders\",\"delete\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Folder UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"2254cde89c9e8f06\"},\n {\"mcpName\":\"delete_projects\",\"commandPath\":[\"projects\",\"delete\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Project UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"6521c33a28cb5465\"},\n {\"mcpName\":\"delete_workspaces\",\"commandPath\":[\"workspaces\",\"delete\"],\"group\":\"workspace\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Workspace UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"3177868221137066\"},\n {\"mcpName\":\"diagram_apply_changes\",\"commandPath\":[\"tools\",\"run\",\"diagram-apply-changes\"],\"group\":\"generic\",\"description\":\"Required single-call mutation path for diagram node/edge/group create/update/delete changes. Put nodes, edges, and groups in one request and call this once. Do not look for type-specific diagram CUD tools; this tool is the only diagram CUD entry point.\",\"inputSchema\":{\"properties\":{\"description\":{\"description\":\"Reason for batch (audit)\",\"type\":\"string\"},\"diagramUuid\":{\"description\":\"Diagram UUID\",\"type\":\"string\"},\"edges\":{\"description\":\"Edge operations\",\"items\":{\"properties\":{\"action\":{\"description\":\"Operation kind\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"bridgeType\":{\"description\":\"Omit (null) for a plain node-to-node edge. Set only when a group is an endpoint: GROUP_TO_GROUP|NODE_TO_GROUP|GROUP_TO_NODE\",\"enum\":[\"GROUP_TO_GROUP\",\"NODE_TO_GROUP\",\"GROUP_TO_NODE\"],\"type\":\"string\"},\"fromUuid\":{\"description\":\"Source\",\"type\":\"string\"},\"label\":{\"description\":\"Edge label\",\"type\":\"string\"},\"lineStyle\":{\"description\":\"Line style\",\"type\":\"string\"},\"strokeColor\":{\"description\":\"Stroke color\",\"type\":\"string\"},\"strokeWidth\":{\"description\":\"Stroke width\",\"type\":\"integer\"},\"toUuid\":{\"description\":\"Target\",\"type\":\"string\"},\"uuid\":{\"description\":\"Required for update/delete\",\"type\":\"string\"}},\"required\":[\"action\"],\"type\":\"object\"},\"type\":\"array\"},\"groups\":{\"description\":\"Group operations\",\"items\":{\"properties\":{\"action\":{\"description\":\"Operation kind\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"collapsed\":{\"description\":\"Collapsed state\",\"type\":\"boolean\"},\"color\":{\"description\":\"Group color\",\"type\":\"string\"},\"height\":{\"description\":\"Explicit height; omit to keep it derived from member nodes\",\"type\":\"number\"},\"linkMode\":{\"description\":\"Link mode\",\"type\":\"string\"},\"linkedDiagramUuid\":{\"description\":\"Linked diagram UUID\",\"type\":\"string\"},\"name\":{\"description\":\"Group name\",\"type\":\"string\"},\"parentGroupUuid\":{\"description\":\"Parent group UUID\",\"type\":\"string\"},\"sortOrder\":{\"description\":\"Sort order\",\"type\":\"integer\"},\"uuid\":{\"description\":\"Required for update/delete\",\"type\":\"string\"},\"width\":{\"description\":\"Explicit width; omit to keep it derived from member nodes\",\"type\":\"number\"}},\"required\":[\"action\"],\"type\":\"object\"},\"type\":\"array\"},\"nodes\":{\"description\":\"Node operations\",\"items\":{\"properties\":{\"action\":{\"description\":\"Operation kind\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"fillColor\":{\"description\":\"Fill color\",\"type\":\"string\"},\"groupUuid\":{\"description\":\"Group UUID; empty string clears membership\",\"type\":\"string\"},\"height\":{\"description\":\"Height\",\"type\":\"number\"},\"shape\":{\"description\":\"Node shape (start/end/diamond/cylinder/parallelogram/stadium/hexagon/rect/roundRect/...)\",\"enum\":[\"rect\",\"roundRect\",\"stadium\",\"diamond\",\"decision\",\"circle\",\"start\",\"doubleCircle\",\"end\",\"hexagon\",\"cylinder\",\"parallelogram\"],\"type\":\"string\"},\"strokeColor\":{\"description\":\"Stroke color\",\"type\":\"string\"},\"text\":{\"description\":\"Node text/label. Supports newlines (\\\\n) for multi-line display.\",\"maxLength\":4000,\"type\":\"string\"},\"textColor\":{\"description\":\"Text color\",\"type\":\"string\"},\"type\":{\"description\":\"Node type\",\"type\":\"string\"},\"uuid\":{\"description\":\"Required for update/delete; optional for create\",\"type\":\"string\"},\"width\":{\"description\":\"Width\",\"type\":\"number\"},\"x\":{\"description\":\"X\",\"type\":\"number\"},\"y\":{\"description\":\"Y\",\"type\":\"number\"}},\"required\":[\"action\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"diagramUuid\",\"description\"],\"type\":\"object\"},\"required\":[\"description\",\"diagramUuid\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"2c829103f86f4168\"},\n {\"mcpName\":\"diagram_get_edge\",\"commandPath\":[\"tools\",\"run\",\"diagram-get-edge\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"edgeUuid\":{\"description\":\"Edge UUID\",\"type\":\"string\"}},\"required\":[\"edgeUuid\"],\"type\":\"object\"},\"required\":[\"edgeUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"2c03c4f7daa69898\"},\n {\"mcpName\":\"diagram_get_group\",\"commandPath\":[\"tools\",\"run\",\"diagram-get-group\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"groupUuid\":{\"description\":\"Group UUID\",\"type\":\"string\"}},\"required\":[\"groupUuid\"],\"type\":\"object\"},\"required\":[\"groupUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"55c5aa27b8cf489d\"},\n {\"mcpName\":\"diagram_get_node\",\"commandPath\":[\"tools\",\"run\",\"diagram-get-node\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"nodeUuid\":{\"description\":\"Node UUID\",\"type\":\"string\"}},\"required\":[\"nodeUuid\"],\"type\":\"object\"},\"required\":[\"nodeUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"646d553238328a9e\"},\n {\"mcpName\":\"diagram_get_pending_llm_requests\",\"commandPath\":[\"tools\",\"run\",\"diagram-get-pending-llm-requests\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"2143d616cf7822bf\"},\n {\"mcpName\":\"diagram_list_edges\",\"commandPath\":[\"tools\",\"run\",\"diagram-list-edges\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"diagramUuid\":{\"description\":\"Diagram document UUID\",\"type\":\"string\"}},\"required\":[\"diagramUuid\"],\"type\":\"object\"},\"required\":[\"diagramUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"4645085bde616381\"},\n {\"mcpName\":\"diagram_list_groups\",\"commandPath\":[\"tools\",\"run\",\"diagram-list-groups\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"diagramUuid\":{\"description\":\"Diagram document UUID\",\"type\":\"string\"}},\"required\":[\"diagramUuid\"],\"type\":\"object\"},\"required\":[\"diagramUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"8a7ca45dd34d1aef\"},\n {\"mcpName\":\"diagram_list_nodes\",\"commandPath\":[\"tools\",\"run\",\"diagram-list-nodes\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"diagramUuid\":{\"description\":\"Diagram document UUID\",\"type\":\"string\"}},\"required\":[\"diagramUuid\"],\"type\":\"object\"},\"required\":[\"diagramUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"d444066b5ca6eeb4\"},\n {\"mcpName\":\"diagram_submit_llm_result\",\"commandPath\":[\"tools\",\"run\",\"diagram-submit-llm-result\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"cachedInputTokens\":{\"description\":\"Cached subset of provider total input tokens\",\"type\":\"integer\"},\"creditsCharged\":{\"description\":\"Deprecated; ignored. Credits are calculated server-side from tokens.\",\"type\":\"integer\"},\"inputTokens\":{\"description\":\"Provider total input tokens; Java persists uncached input after one normalization\",\"type\":\"integer\"},\"outputTokens\":{\"description\":\"Output token count\",\"type\":\"integer\"},\"result\":{\"description\":\"LLM result text\",\"type\":\"string\"},\"uuid\":{\"description\":\"LLM request UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"result\"],\"type\":\"object\"},\"required\":[\"result\",\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"870ace32642a770a\"},\n {\"mcpName\":\"diagram_update_llm_request_status\",\"commandPath\":[\"tools\",\"run\",\"diagram-update-llm-request-status\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"errorMessage\":{\"description\":\"Error message (when status=FAILED)\",\"type\":\"string\"},\"status\":{\"description\":\"Target status — currently only FAILED is mutable from caller side\",\"enum\":[\"FAILED\"],\"type\":\"string\"},\"uuid\":{\"description\":\"LLM request UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"status\"],\"type\":\"object\"},\"required\":[\"status\",\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"9ad96e3dc5fd2a8f\"},\n {\"mcpName\":\"disable_shares\",\"commandPath\":[\"tools\",\"run\",\"disable-shares\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"targetType\":{\"description\":\"Share target type\",\"enum\":[\"project\",\"folder\",\"document\"],\"type\":\"string\"},\"targetUuids\":{\"description\":\"Target UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"targetType\",\"targetUuids\"],\"type\":\"object\"},\"required\":[\"targetType\",\"targetUuids\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"bd1b310200b78420\"},\n {\"mcpName\":\"enable_shares\",\"commandPath\":[\"tools\",\"run\",\"enable-shares\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"targetType\":{\"description\":\"Share target type. A document gets a shareUrl anyone can open; a project gets a public API path only (there is no public project page); a folder token is stored but nothing public reads it yet.\",\"enum\":[\"project\",\"folder\",\"document\"],\"type\":\"string\"},\"targetUuids\":{\"description\":\"Target UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"targetType\",\"targetUuids\"],\"type\":\"object\"},\"required\":[\"targetType\",\"targetUuids\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"18559d7c0af09d2c\"},\n {\"mcpName\":\"erd_apply_changes\",\"commandPath\":[\"erd\",\"apply-changes\"],\"group\":\"erd\",\"description\":\"Required single-call mutation path for ERD create/update/delete changes. Put tables, columns, indexes, refs, enums, enum_values, and table groups in one operations array and call this once.\\nRules: (1) all data field names are snake_case; (2) for create, generate your own UUIDs and put them in data.uuid, then later operations in the same batch may reference those UUIDs without read-back calls; (3) enum values are separate enum_value operations, not inline on enum; (4) ref.relationship uses short dbdiagram-style symbols: >, <, or -; (5) ref_column operations map FK columns explicitly, never automatically.\\nDo not look for type-specific ERD CUD tools; this tool is the only ERD CUD entry point. If operations is very large, use request_upload_token with purpose=mcp.call and send the tools/call payload with curl to save LLM tokens.\\nOne-call worked example:\\n{\\n \\\"documentUuid\\\": \\\"erd-doc-uuid\\\",\\n \\\"description\\\": \\\"create users/posts ERD\\\",\\n \\\"operations\\\": [\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"table\\\",\\\"data\\\":{\\\"uuid\\\":\\\"tbl_users\\\",\\\"name\\\":\\\"users\\\",\\\"display_order\\\":1}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_users_id\\\",\\\"table_uuid\\\":\\\"tbl_users\\\",\\\"name\\\":\\\"id\\\",\\\"type\\\":\\\"bigint\\\",\\\"is_pk\\\":true,\\\"is_not_null\\\":true,\\\"display_order\\\":1}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_users_email\\\",\\\"table_uuid\\\":\\\"tbl_users\\\",\\\"name\\\":\\\"email\\\",\\\"type\\\":\\\"varchar(255)\\\",\\\"is_unique\\\":true,\\\"is_not_null\\\":true,\\\"display_order\\\":2}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"table\\\",\\\"data\\\":{\\\"uuid\\\":\\\"tbl_posts\\\",\\\"name\\\":\\\"posts\\\",\\\"display_order\\\":2}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_posts_id\\\",\\\"table_uuid\\\":\\\"tbl_posts\\\",\\\"name\\\":\\\"id\\\",\\\"type\\\":\\\"bigint\\\",\\\"is_pk\\\":true,\\\"is_not_null\\\":true,\\\"display_order\\\":1}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_posts_author_id\\\",\\\"table_uuid\\\":\\\"tbl_posts\\\",\\\"name\\\":\\\"author_id\\\",\\\"type\\\":\\\"bigint\\\",\\\"is_not_null\\\":true,\\\"display_order\\\":2}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_posts_status\\\",\\\"table_uuid\\\":\\\"tbl_posts\\\",\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"post_status\\\",\\\"is_not_null\\\":true,\\\"display_order\\\":3}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"enum\\\",\\\"data\\\":{\\\"uuid\\\":\\\"enum_post_status\\\",\\\"name\\\":\\\"post_status\\\"}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"enum_value\\\",\\\"data\\\":{\\\"uuid\\\":\\\"enum_post_status_draft\\\",\\\"enum_uuid\\\":\\\"enum_post_status\\\",\\\"value\\\":\\\"draft\\\",\\\"display_order\\\":1}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"enum_value\\\",\\\"data\\\":{\\\"uuid\\\":\\\"enum_post_status_published\\\",\\\"enum_uuid\\\":\\\"enum_post_status\\\",\\\"value\\\":\\\"published\\\",\\\"display_order\\\":2}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"ref\\\",\\\"data\\\":{\\\"uuid\\\":\\\"ref_posts_author\\\",\\\"name\\\":\\\"fk_posts_author\\\",\\\"from_table_uuid\\\":\\\"tbl_posts\\\",\\\"to_table_uuid\\\":\\\"tbl_users\\\",\\\"relationship\\\":\\\">\\\",\\\"on_delete\\\":\\\"cascade\\\"}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"ref_column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"refcol_posts_author\\\",\\\"ref_uuid\\\":\\\"ref_posts_author\\\",\\\"from_column_uuid\\\":\\\"col_posts_author_id\\\",\\\"to_column_uuid\\\":\\\"col_users_id\\\",\\\"display_order\\\":1}}\\n ]\\n}\",\"inputSchema\":{\"properties\":{\"arrangeNewTables\":{\"description\":\"Whether to auto-place newly-created tables after the batch; defaults to true\",\"type\":\"boolean\"},\"description\":{\"description\":\"Reason for batch (audit)\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"operations\":{\"description\":\"Atomic create/update/delete operations\",\"items\":{\"description\":\"One ERD mutation. Use a single operations array with client-generated data.uuid values to create cross-referenced tables, columns, enums, refs, and ref_columns without read-back calls.\",\"discriminator\":{\"propertyName\":\"type\"},\"oneOf\":[{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table'.\",\"properties\":{\"alias\":{\"description\":\"Display alias.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"header_color\":{\"description\":\"Header color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"note\":{\"description\":\"Table note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"name\"],\"title\":\"table data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table'.\",\"properties\":{\"alias\":{\"description\":\"Display alias.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"header_color\":{\"description\":\"Header color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"note\":{\"description\":\"Table note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"table\",\"description\":\"Must be 'table' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"table operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='column'.\",\"properties\":{\"default_value\":{\"description\":\"Default value.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"is_increment\":{\"description\":\"Auto-increment flag.\",\"type\":\"boolean\"},\"is_not_null\":{\"description\":\"Not-null flag.\",\"type\":\"boolean\"},\"is_pk\":{\"description\":\"Primary key flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Column name.\",\"type\":\"string\"},\"note\":{\"description\":\"Column note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create; may be a data.uuid from an earlier table operation in this batch.\",\"type\":\"string\"},\"type\":{\"description\":\"SQL data type. Use this exact field name; do not send data_type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"table_uuid\"],\"title\":\"column data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='column'.\",\"properties\":{\"default_value\":{\"description\":\"Default value.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"is_increment\":{\"description\":\"Auto-increment flag.\",\"type\":\"boolean\"},\"is_not_null\":{\"description\":\"Not-null flag.\",\"type\":\"boolean\"},\"is_pk\":{\"description\":\"Primary key flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Column name.\",\"type\":\"string\"},\"note\":{\"description\":\"Column note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create; may be a data.uuid from an earlier table operation in this batch.\",\"type\":\"string\"},\"type\":{\"description\":\"SQL data type. Use this exact field name; do not send data_type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"column data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"column\",\"description\":\"Must be 'column' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"column operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='index'.\",\"properties\":{\"is_pk\":{\"description\":\"Primary key index flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique index flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Index name.\",\"type\":\"string\"},\"note\":{\"description\":\"Index note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create.\",\"type\":\"string\"},\"type\":{\"description\":\"Index type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"table_uuid\"],\"title\":\"index data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='index'.\",\"properties\":{\"is_pk\":{\"description\":\"Primary key index flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique index flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Index name.\",\"type\":\"string\"},\"note\":{\"description\":\"Index note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create.\",\"type\":\"string\"},\"type\":{\"description\":\"Index type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"index data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"index\",\"description\":\"Must be 'index' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"index operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='index_column'.\",\"properties\":{\"column_uuid\":{\"description\":\"Column UUID. Required for create.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"index_uuid\":{\"description\":\"Index UUID. Required for create.\",\"type\":\"string\"},\"sort_order\":{\"description\":\"Sort order, for example ASC or DESC.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"index_uuid\",\"column_uuid\"],\"title\":\"index_column data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='index_column'.\",\"properties\":{\"column_uuid\":{\"description\":\"Column UUID. Required for create.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"index_uuid\":{\"description\":\"Index UUID. Required for create.\",\"type\":\"string\"},\"sort_order\":{\"description\":\"Sort order, for example ASC or DESC.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"index_column data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"index_column\",\"description\":\"Must be 'index_column' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"index_column operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='ref'.\",\"properties\":{\"from_table_uuid\":{\"description\":\"Source table UUID. Required for create.\",\"type\":\"string\"},\"name\":{\"description\":\"Reference name.\",\"type\":\"string\"},\"on_delete\":{\"description\":\"ON DELETE action.\",\"type\":\"string\"},\"on_update\":{\"description\":\"ON UPDATE action.\",\"type\":\"string\"},\"relationship\":{\"description\":\"Required for create. Use short dbdiagram-style relationship symbols.\",\"enum\":[\">\",\"<\",\"-\"],\"type\":\"string\"},\"to_table_uuid\":{\"description\":\"Target table UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"from_table_uuid\",\"to_table_uuid\",\"relationship\"],\"title\":\"ref data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='ref'.\",\"properties\":{\"from_table_uuid\":{\"description\":\"Source table UUID. Required for create.\",\"type\":\"string\"},\"name\":{\"description\":\"Reference name.\",\"type\":\"string\"},\"on_delete\":{\"description\":\"ON DELETE action.\",\"type\":\"string\"},\"on_update\":{\"description\":\"ON UPDATE action.\",\"type\":\"string\"},\"relationship\":{\"description\":\"Required for create. Use short dbdiagram-style relationship symbols.\",\"enum\":[\">\",\"<\",\"-\"],\"type\":\"string\"},\"to_table_uuid\":{\"description\":\"Target table UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"ref data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"ref\",\"description\":\"Must be 'ref' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"ref operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='ref_column'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"from_column_uuid\":{\"description\":\"Source column UUID. Required for create.\",\"type\":\"string\"},\"ref_uuid\":{\"description\":\"Reference UUID. Required for create; may be a data.uuid from an earlier ref operation.\",\"type\":\"string\"},\"to_column_uuid\":{\"description\":\"Target column UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"ref_uuid\",\"from_column_uuid\",\"to_column_uuid\"],\"title\":\"ref_column data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='ref_column'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"from_column_uuid\":{\"description\":\"Source column UUID. Required for create.\",\"type\":\"string\"},\"ref_uuid\":{\"description\":\"Reference UUID. Required for create; may be a data.uuid from an earlier ref operation.\",\"type\":\"string\"},\"to_column_uuid\":{\"description\":\"Target column UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"ref_column data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"ref_column\",\"description\":\"Must be 'ref_column' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"ref_column operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='enum'.\",\"properties\":{\"name\":{\"description\":\"Enum name.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"enum data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='enum'.\",\"properties\":{\"name\":{\"description\":\"Enum name.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"enum data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"enum\",\"description\":\"Must be 'enum' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"enum operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='enum_value'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"enum_uuid\":{\"description\":\"Parent enum UUID. Required for create; may be a data.uuid from an earlier enum operation.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum value note.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"value\":{\"description\":\"Enum value. Inline enum values on enum are not persisted; create enum_value operations.\",\"type\":\"string\"}},\"required\":[\"enum_uuid\"],\"title\":\"enum_value data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='enum_value'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"enum_uuid\":{\"description\":\"Parent enum UUID. Required for create; may be a data.uuid from an earlier enum operation.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum value note.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"value\":{\"description\":\"Enum value. Inline enum values on enum are not persisted; create enum_value operations.\",\"type\":\"string\"}},\"title\":\"enum_value data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"enum_value\",\"description\":\"Must be 'enum_value' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"enum_value operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group'.\",\"properties\":{\"color\":{\"description\":\"Group color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table group name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group'.\",\"properties\":{\"color\":{\"description\":\"Group color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table group name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"table_group\",\"description\":\"Must be 'table_group' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"table_group operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group_table'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Table schema name.\",\"type\":\"string\"},\"table_name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"group_uuid\",\"table_name\"],\"title\":\"table_group_table data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group_table'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Table schema name.\",\"type\":\"string\"},\"table_name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group_table data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"table_group_table\",\"description\":\"Must be 'table_group_table' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"table_group_table operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group_note'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"note_uuid\":{\"description\":\"Note UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"group_uuid\",\"note_uuid\"],\"title\":\"table_group_note data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group_note'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"note_uuid\":{\"description\":\"Note UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group_note data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"table_group_note\",\"description\":\"Must be 'table_group_note' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"table_group_note operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='filter'.\",\"properties\":{\"included_tables\":{\"description\":\"JSON string/list of included tables.\",\"type\":\"string\"},\"is_default\":{\"description\":\"Default filter flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Filter name.\",\"type\":\"string\"},\"table_groups\":{\"description\":\"JSON string/object of table groups.\",\"type\":\"string\"},\"table_positions\":{\"description\":\"JSON string/object of table positions.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"filter data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='filter'.\",\"properties\":{\"included_tables\":{\"description\":\"JSON string/list of included tables.\",\"type\":\"string\"},\"is_default\":{\"description\":\"Default filter flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Filter name.\",\"type\":\"string\"},\"table_groups\":{\"description\":\"JSON string/object of table groups.\",\"type\":\"string\"},\"table_positions\":{\"description\":\"JSON string/object of table positions.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"filter data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"filter\",\"description\":\"Must be 'filter' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"filter operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='note'.\",\"properties\":{\"color\":{\"description\":\"Note color.\",\"type\":\"string\"},\"content\":{\"description\":\"Note content.\",\"type\":\"string\"},\"height\":{\"description\":\"Height.\",\"type\":\"integer\"},\"icon_name\":{\"description\":\"Icon name.\",\"type\":\"string\"},\"position_x\":{\"description\":\"X position.\",\"type\":\"integer\"},\"position_y\":{\"description\":\"Y position.\",\"type\":\"integer\"},\"title\":{\"description\":\"Note title.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"width\":{\"description\":\"Width.\",\"type\":\"integer\"}},\"title\":\"note data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='note'.\",\"properties\":{\"color\":{\"description\":\"Note color.\",\"type\":\"string\"},\"content\":{\"description\":\"Note content.\",\"type\":\"string\"},\"height\":{\"description\":\"Height.\",\"type\":\"integer\"},\"icon_name\":{\"description\":\"Icon name.\",\"type\":\"string\"},\"position_x\":{\"description\":\"X position.\",\"type\":\"integer\"},\"position_y\":{\"description\":\"Y position.\",\"type\":\"integer\"},\"title\":{\"description\":\"Note title.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"width\":{\"description\":\"Width.\",\"type\":\"integer\"}},\"title\":\"note data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"note\",\"description\":\"Must be 'note' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"note operation\",\"type\":\"object\"}],\"properties\":{\"data\":{\"description\":\"Type-specific payload. All field names are snake_case. For create, data.uuid may be client-supplied and referenced by later operations in the same batch.\",\"oneOf\":[{\"description\":\"Payload for operation.type='table'.\",\"properties\":{\"alias\":{\"description\":\"Display alias.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"header_color\":{\"description\":\"Header color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"note\":{\"description\":\"Table note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='column'.\",\"properties\":{\"default_value\":{\"description\":\"Default value.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"is_increment\":{\"description\":\"Auto-increment flag.\",\"type\":\"boolean\"},\"is_not_null\":{\"description\":\"Not-null flag.\",\"type\":\"boolean\"},\"is_pk\":{\"description\":\"Primary key flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Column name.\",\"type\":\"string\"},\"note\":{\"description\":\"Column note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create; may be a data.uuid from an earlier table operation in this batch.\",\"type\":\"string\"},\"type\":{\"description\":\"SQL data type. Use this exact field name; do not send data_type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"column data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='index'.\",\"properties\":{\"is_pk\":{\"description\":\"Primary key index flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique index flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Index name.\",\"type\":\"string\"},\"note\":{\"description\":\"Index note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create.\",\"type\":\"string\"},\"type\":{\"description\":\"Index type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"index data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='index_column'.\",\"properties\":{\"column_uuid\":{\"description\":\"Column UUID. Required for create.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"index_uuid\":{\"description\":\"Index UUID. Required for create.\",\"type\":\"string\"},\"sort_order\":{\"description\":\"Sort order, for example ASC or DESC.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"index_column data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='ref'.\",\"properties\":{\"from_table_uuid\":{\"description\":\"Source table UUID. Required for create.\",\"type\":\"string\"},\"name\":{\"description\":\"Reference name.\",\"type\":\"string\"},\"on_delete\":{\"description\":\"ON DELETE action.\",\"type\":\"string\"},\"on_update\":{\"description\":\"ON UPDATE action.\",\"type\":\"string\"},\"relationship\":{\"description\":\"Required for create. Use short dbdiagram-style relationship symbols.\",\"enum\":[\">\",\"<\",\"-\"],\"type\":\"string\"},\"to_table_uuid\":{\"description\":\"Target table UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"ref data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='ref_column'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"from_column_uuid\":{\"description\":\"Source column UUID. Required for create.\",\"type\":\"string\"},\"ref_uuid\":{\"description\":\"Reference UUID. Required for create; may be a data.uuid from an earlier ref operation.\",\"type\":\"string\"},\"to_column_uuid\":{\"description\":\"Target column UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"ref_column data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='enum'.\",\"properties\":{\"name\":{\"description\":\"Enum name.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"enum data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='enum_value'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"enum_uuid\":{\"description\":\"Parent enum UUID. Required for create; may be a data.uuid from an earlier enum operation.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum value note.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"value\":{\"description\":\"Enum value. Inline enum values on enum are not persisted; create enum_value operations.\",\"type\":\"string\"}},\"title\":\"enum_value data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='table_group'.\",\"properties\":{\"color\":{\"description\":\"Group color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table group name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='table_group_table'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Table schema name.\",\"type\":\"string\"},\"table_name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group_table data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='table_group_note'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"note_uuid\":{\"description\":\"Note UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group_note data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='filter'.\",\"properties\":{\"included_tables\":{\"description\":\"JSON string/list of included tables.\",\"type\":\"string\"},\"is_default\":{\"description\":\"Default filter flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Filter name.\",\"type\":\"string\"},\"table_groups\":{\"description\":\"JSON string/object of table groups.\",\"type\":\"string\"},\"table_positions\":{\"description\":\"JSON string/object of table positions.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"filter data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='note'.\",\"properties\":{\"color\":{\"description\":\"Note color.\",\"type\":\"string\"},\"content\":{\"description\":\"Note content.\",\"type\":\"string\"},\"height\":{\"description\":\"Height.\",\"type\":\"integer\"},\"icon_name\":{\"description\":\"Icon name.\",\"type\":\"string\"},\"position_x\":{\"description\":\"X position.\",\"type\":\"integer\"},\"position_y\":{\"description\":\"Y position.\",\"type\":\"integer\"},\"title\":{\"description\":\"Note title.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"width\":{\"description\":\"Width.\",\"type\":\"integer\"}},\"title\":\"note data\",\"type\":\"object\"}],\"type\":\"object\"},\"op\":{\"description\":\"Operation. For create, put any new UUID in data.uuid; for update/delete, put target UUID in operation.uuid.\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"description\":\"ERD entity type. This selects the operation.data shape.\",\"enum\":[\"table\",\"column\",\"index\",\"index_column\",\"ref\",\"ref_column\",\"enum\",\"enum_value\",\"table_group\",\"table_group_table\",\"table_group_note\",\"filter\",\"note\"],\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete. Do not use this for create; use data.uuid instead.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"documentUuid\",\"description\",\"operations\"],\"type\":\"object\"},\"required\":[\"description\",\"documentUuid\",\"operations\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"87f5bcf5a253815a\"},\n {\"mcpName\":\"erd_arrange_tables\",\"commandPath\":[\"erd\",\"arrange-tables\"],\"group\":\"erd\",\"description\":\"Arrange ERD tables after edits. Default incremental mode places newly-created tables while preserving existing positions; full=true re-layouts the entire diagram. Use after several separate table edits to tidy the canvas.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"full\":{\"description\":\"Re-layout the ENTIRE diagram (overwrites existing positions). Default false = arrange only newly-added (uncoordinated) tables to the top-right while preserving existing table positions. Call this after creating several tables to tidy them up.\",\"type\":\"boolean\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"651fd0d54e3635ff\"},\n {\"mcpName\":\"erd_get_enum\",\"commandPath\":[\"erd\",\"get-enum\"],\"group\":\"erd\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"enumUuid\":{\"description\":\"Enum UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"enumUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"enumUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"f0d79d7a1996939c\"},\n {\"mcpName\":\"erd_get_ref\",\"commandPath\":[\"erd\",\"get-ref\"],\"group\":\"erd\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"refUuid\":{\"description\":\"Relationship UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"refUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"refUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"5b47fe7d99e60d4d\"},\n {\"mcpName\":\"erd_get_table\",\"commandPath\":[\"erd\",\"get-table\"],\"group\":\"erd\",\"description\":\"Get one ERD table with nested columns and indexes. Returns persistent table/column/index UUIDs usable directly as erd_apply_changes update/delete targets and ref_column column references. Column fields use apply_changes snake_case names: uuid, table_uuid, name, type, is_pk, is_unique, is_not_null, is_increment, default_value, note, display_order. Index fields include uuid, name, columns (column UUIDs), is_unique, is_pk, type.\",\"inputSchema\":{\"description\":\"Get one ERD table with nested columns and indexes. Returns persistent table/column/index UUIDs usable directly as mcp__ainecto__erd_apply_changes update/delete targets and ref_column column references. Column fields use apply_changes snake_case names: uuid, table_uuid, name, type, is_pk, is_unique, is_not_null, is_increment, default_value, note, display_order. Index fields include uuid, name, columns (column UUIDs), is_unique, is_pk, type.\",\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"tableUuid\":{\"description\":\"Table UUID. Response includes columns[] and indexes[] with persistent UUIDs for apply_changes.\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"tableUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"tableUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"0dc13648bf3fbf8f\"},\n {\"mcpName\":\"erd_get_table_group\",\"commandPath\":[\"erd\",\"get-table-group\"],\"group\":\"erd\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"tableGroupUuid\":{\"description\":\"Table group UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"tableGroupUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"tableGroupUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"3db246dfe8663370\"},\n {\"mcpName\":\"erd_list_enums\",\"commandPath\":[\"erd\",\"list-enums\"],\"group\":\"erd\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"4d1f602fa487a0e4\"},\n {\"mcpName\":\"erd_list_refs\",\"commandPath\":[\"erd\",\"list-refs\"],\"group\":\"erd\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"307d766c777bbe8c\"},\n {\"mcpName\":\"erd_list_table_groups\",\"commandPath\":[\"erd\",\"list-table-groups\"],\"group\":\"erd\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"775bff53bbc21c9e\"},\n {\"mcpName\":\"erd_list_tables\",\"commandPath\":[\"erd\",\"list-tables\"],\"group\":\"erd\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"34324dfc7ef461c8\"},\n {\"mcpName\":\"get_attachment\",\"commandPath\":[\"attachment\",\"get\"],\"group\":\"attachment\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuid\":{\"description\":\"Attachment UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"required\":[\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"1e0e7f1bf33b669c\"},\n {\"mcpName\":\"get_document\",\"commandPath\":[\"document\",\"get\"],\"group\":\"document\",\"description\":\"Read a document. The body comes back for the types whose create/update take one: markdown → content; openapi → content (the spec text) + format/specVersion/pathCount/operationCount; html → content (the HTML text); file → file {filename, contentType, sizeBytes, viewerKind} + content for text/CSV (first 64 KB); diagram → diagramSource/sourceLanguage/edgeStyle/isModule/metadata; kanban → board {viewer, columns: each column's first 20 cards + hasMore} (more cards and card details via kanban_list_cards); erd → metadata only (read tables/refs via erd_list_*).\",\"inputSchema\":{\"properties\":{\"uuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"required\":[\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"5c8e9d305fc15c1f\"},\n {\"mcpName\":\"get_my_work_summary\",\"commandPath\":[\"my-work-summary\",\"get\"],\"group\":\"generic\",\"description\":\"One-call summary of what is waiting for the signed-in user in AiNecto — call it when the user asks things like \\\"do I have anything to do?\\\", \\\"anything new?\\\", \\\"anything to review?\\\" or \\\"did anyone ask me something?\\\". Returns notifications {unread (not yet read by the person, newest 100 counted; unreadCapped when there are more), unreadByKind, newForThisConnection (not yet acknowledged by this connection — the same number as the line at the end of tool results)}, mentionsToRead {items the person has not read that mention them, each with target title and url}, and todos {open, leaseExpired, inProgress, items: questions and requests waiting for the user's agent} and cards {kanban cards assigned to the user on boards they can read now: assignedOpen, pendingAcceptance (assigned but not yet accepted or declined), inProgress, inReview, blocked, items: the first page}. For details use list_notifications, list_agent_todos and kanban_list_cards; to read the document and its comments use get_document with the target uuid. Read-only: nothing is marked read or acknowledged.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"projectUuid\":{\"description\":\"Older single-value form of projectUuids.\",\"type\":\"string\"},\"projectUuids\":{\"description\":\"Only items in any of these projects. Use it when the user names a project or the project you are working in is clear. With workspaceUuids too, both must match. A workspace or project you cannot see matches nothing.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"workspaceUuids\":{\"description\":\"Only items in any of these workspaces.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"105cc4ba01f785d8\"},\n {\"mcpName\":\"get_project\",\"commandPath\":[\"project\",\"get\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"required\":[\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"192403c3484ac774\"},\n {\"mcpName\":\"get_version\",\"commandPath\":[\"version\",\"get\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"Document UUID\",\"type\":\"string\"},\"versionNumber\":{\"description\":\"Version number\",\"type\":\"integer\"}},\"required\":[\"documentUuid\",\"versionNumber\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"versionNumber\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"4e308c1a8c7203d1\"},\n {\"mcpName\":\"get_workspace\",\"commandPath\":[\"workspace\",\"get\"],\"group\":\"workspace\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuid\":{\"description\":\"Workspace UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"required\":[\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"db6d1b4879d57c56\"},\n {\"mcpName\":\"identity_get_self\",\"commandPath\":[\"tools\",\"run\",\"identity-get-self\"],\"group\":\"generic\",\"description\":\"Return the authenticated MCP caller identity summary; never returns email or token claims.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"f29c86804eb91700\"},\n {\"mcpName\":\"kanban_apply_changes\",\"commandPath\":[\"kanban\",\"apply-changes\"],\"group\":\"kanban\",\"description\":\"Create, edit, reorder and link cards on one kanban board in a single atomic call (at most 100 operations; if one fails nothing is applied and the error carries operationIndex and code). Creating and editing cards needs edit access to the board; the assignee may also check acceptance criteria and add result links (DELIVERABLE, REVIEW_RESULT, TEST_EVIDENCE). To change a card's column, assign it, accept, approve, block, watch and similar, use kanban_card_action. Results list each operation's card uuid, revision, status and sortKey.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"boardUuid\":{\"description\":\"Kanban board (document) UUID.\",\"type\":\"string\"},\"mailLanguage\":{\"description\":\"Language of the emails these operations may send (review requests to newly named reviewers). Defaults to en.\",\"enum\":[\"en\",\"ko\"],\"type\":\"string\"},\"operations\":{\"description\":\"Operations, applied in order in one transaction. If any fails, none is applied and the error names operationIndex.\",\"items\":{\"additionalProperties\":false,\"properties\":{\"afterCardUuid\":{\"description\":\"Place after this card in the column (create, move).\",\"type\":\"string\"},\"beforeCardUuid\":{\"description\":\"move: place before this card in the column.\",\"type\":\"string\"},\"cardType\":{\"description\":\"Card type (default TASK).\",\"enum\":[\"TASK\",\"REVIEW\",\"BUG\",\"DECISION\"],\"type\":\"string\"},\"cardUuid\":{\"description\":\"Target card (update, move, link, unlink). It must be on this board.\",\"type\":\"string\"},\"clientMutationId\":{\"description\":\"create: idempotency key — retrying with the same value returns the same card instead of creating another.\",\"type\":\"string\"},\"criteria\":{\"description\":\"Acceptance criteria. update replaces the whole list; the assignee may only flip done.\",\"items\":{\"additionalProperties\":false,\"properties\":{\"done\":{\"description\":\"Checked (default false).\",\"type\":\"boolean\"},\"text\":{\"description\":\"What must be true.\",\"type\":\"string\"}},\"required\":[\"text\"],\"type\":\"object\"},\"type\":\"array\"},\"description\":{\"description\":\"Markdown description. Keep it short — link longer text as a document instead.\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"AiNecto document to link (you must be able to read it). Give this or url.\",\"type\":\"string\"},\"dueAt\":{\"description\":\"Due time, ISO-8601 instant such as 2026-10-31T09:00:00Z.\",\"type\":\"string\"},\"expectedRevision\":{\"description\":\"The card revision you last read. If the card changed since, the whole call fails with CARD_CHANGED and the current card. Send it when people may edit the card too.\",\"minimum\":0,\"type\":\"integer\"},\"label\":{\"description\":\"Optional label for an external URL.\",\"type\":\"string\"},\"linkId\":{\"description\":\"unlink: the linkId from the card's links.\",\"minimum\":1,\"type\":\"integer\"},\"linkRole\":{\"description\":\"Link role. The assignee may add DELIVERABLE, REVIEW_RESULT and TEST_EVIDENCE links; other roles need edit access to the board.\",\"enum\":[\"REQUIREMENT\",\"REFERENCE\",\"DELIVERABLE\",\"REVIEW_RESULT\",\"DECISION\",\"TEST_EVIDENCE\"],\"type\":\"string\"},\"links\":{\"description\":\"create only: links to attach.\",\"items\":{\"additionalProperties\":false,\"properties\":{\"documentUuid\":{\"description\":\"AiNecto document to link (you must be able to read it). Give this or url.\",\"type\":\"string\"},\"label\":{\"description\":\"Optional label for an external URL.\",\"type\":\"string\"},\"linkRole\":{\"description\":\"Link role. The assignee may add DELIVERABLE, REVIEW_RESULT and TEST_EVIDENCE links; other roles need edit access to the board.\",\"enum\":[\"REQUIREMENT\",\"REFERENCE\",\"DELIVERABLE\",\"REVIEW_RESULT\",\"DECISION\",\"TEST_EVIDENCE\"],\"type\":\"string\"},\"url\":{\"description\":\"External http(s) URL to link, e.g. a pull request. Give this or documentUuid.\",\"type\":\"string\"}},\"required\":[\"linkRole\"],\"type\":\"object\"},\"type\":\"array\"},\"op\":{\"description\":\"create: a new card in To Do (you become its requester). update: change only the fields you send (send null to clear description, dueAt). move: reorder within the card's column. link / unlink: attach or remove a document or an external URL.\",\"enum\":[\"create\",\"link\",\"move\",\"unlink\",\"update\"],\"type\":\"string\"},\"priority\":{\"description\":\"Priority (default MEDIUM).\",\"enum\":[\"LOW\",\"MEDIUM\",\"HIGH\",\"URGENT\"],\"type\":\"string\"},\"responderIds\":{\"description\":\"update only: who should answer while the card is blocked.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"reviewerIds\":{\"description\":\"Reviewers (userIds from list_mention_candidates with cardUuid or the board's documentUuid). update replaces the whole list.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"title\":{\"description\":\"Card title (required for create).\",\"type\":\"string\"},\"url\":{\"description\":\"External http(s) URL to link, e.g. a pull request. Give this or documentUuid.\",\"type\":\"string\"},\"watcherIds\":{\"description\":\"Watchers who get activity notifications. update replaces the whole list.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"required\":[\"op\"],\"type\":\"object\"},\"maxItems\":100,\"minItems\":1,\"type\":\"array\"}},\"required\":[\"boardUuid\",\"operations\"],\"type\":\"object\"},\"required\":[\"boardUuid\",\"operations\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"77de7bc105852b87\"},\n {\"mcpName\":\"kanban_card_action\",\"commandPath\":[\"kanban\",\"card-action\"],\"group\":\"kanban\",\"description\":\"Do one workflow action on a kanban card, the same as the buttons in the web app. ★Before assign (to someone other than the signed-in user), approve or quick_done, show the user what will happen and get their explicit confirmation — these change other people's work and notify them. Actions: assign / unassign; accept / decline (only the assignee — accepting closes the assignment to-do); start (To Do → In Progress; anyone who can edit the board, or the assignee — not while an assignment is waiting to be accepted); request_review (→ In Review); approve (→ Done) / request_changes (→ In Progress) by the requester or a reviewer; quick_done (To Do → Done); reopen (Done → In Progress); block / unblock; archive / unarchive; set_requester; watch / unwatch (yourself). Doing the action is what closes the matching card to-dos — update_agent_todos cannot complete them. Returns the card after the action (status, assignment state, allowedActions) and reasonCommentId when a reason was saved.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"action\":{\"description\":\"The action. Which ones you may do now is the card's allowedActions in kanban_list_cards (with cardUuids).\",\"enum\":[\"assign\",\"unassign\",\"accept\",\"decline\",\"start\",\"request_review\",\"approve\",\"request_changes\",\"quick_done\",\"reopen\",\"block\",\"unblock\",\"archive\",\"unarchive\",\"set_requester\",\"watch\",\"unwatch\"],\"type\":\"string\"},\"assigneeUserId\":{\"description\":\"assign: who gets the card — someone who can read the board (list_mention_candidates with cardUuid). Your own userId assigns it to you and accepts at once.\",\"type\":\"string\"},\"cardUuid\":{\"description\":\"Card UUID (from kanban_list_cards).\",\"type\":\"string\"},\"expectedRevision\":{\"description\":\"The card revision you last read. If the card changed since, the call fails with CARD_CHANGED and the current card. Send it when people may act on the card too.\",\"minimum\":0,\"type\":\"integer\"},\"mailLanguage\":{\"description\":\"Language of the email this action may send (assignment or review request). Defaults to en.\",\"enum\":[\"en\",\"ko\"],\"type\":\"string\"},\"reason\":{\"description\":\"Saved as a comment on the card. Required when the action's allowedActions entry says reasonRequired (e.g. decline, reopen).\",\"type\":\"string\"},\"requesterUserId\":{\"description\":\"set_requester: the new requester.\",\"type\":\"string\"},\"responderIds\":{\"description\":\"block: who should answer (people who can read the board). Omit to keep the card's current responders.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"required\":[\"cardUuid\",\"action\"],\"type\":\"object\"},\"required\":[\"action\",\"cardUuid\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"77da9c03fd1ce5f4\"},\n {\"mcpName\":\"kanban_list_cards\",\"commandPath\":[\"kanban\",\"list-cards\"],\"group\":\"kanban\",\"description\":\"Read kanban cards. Three ways: cardUuids → those cards in full, including allowedActions (what you may do now with kanban_card_action) and links; boardUuid → the board's columns To Do, In Progress, In Review, Done (each with hasMore and nextAfter); neither → cards across all boards you can read where you are the assignee (or requester / watcher), most recently updated first. Each card has uuid, title, status, assignee and assignmentState (PENDING = not yet accepted), blocked, revision and allowedTransitions.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"boardUuid\":{\"description\":\"Board (document) UUID: list its columns, first page each (or one column with status).\",\"type\":\"string\"},\"cardUuids\":{\"description\":\"Read these cards in full (description, people, links, allowedActions). Use alone.\",\"items\":{\"type\":\"string\"},\"maxItems\":50,\"minItems\":1,\"type\":\"array\",\"uniqueItems\":true},\"cursor\":{\"description\":\"Next page: nextCursor (without boardUuid) or a column's nextAfter (with boardUuid and status).\",\"type\":\"string\"},\"includeDone\":{\"description\":\"Without boardUuid: also recently completed cards.\",\"type\":\"boolean\"},\"limit\":{\"description\":\"Cards per page (per column with boardUuid). Default 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Without boardUuid: only boards in this project.\",\"type\":\"string\"},\"relation\":{\"description\":\"Without boardUuid: cards across boards where you are the assignee (default), the requester or a watcher.\",\"enum\":[\"ASSIGNEE\",\"REQUESTER\",\"WATCHER\"],\"type\":\"string\"},\"status\":{\"description\":\"With boardUuid: only this column.\",\"enum\":[\"TODO\",\"IN_PROGRESS\",\"IN_REVIEW\",\"DONE\"],\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"99ed9634a628eb3f\"},\n {\"mcpName\":\"list_agent_todos\",\"commandPath\":[\"agent-todos\",\"list\"],\"group\":\"generic\",\"description\":\"List the to-dos that ask the signed-in user's agent to act now (for example a question that mentions the user). This is the current state, not a feed: a to-do you have not finished comes back on every call until it is completed, dismissed, or closed because the person did it themselves. Each item has todoId, kind, obligation, openedAt, summary, target (title and url), action and state. To work on one, claim it with update_agent_todos and complete it with a one-line note. Actions that affect other people (assigning, approving, inviting) need the user's confirmation first.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"after\":{\"description\":\"todoId of the last item of the previous page.\",\"type\":\"string\"},\"kinds\":{\"description\":\"Only these kinds.\",\"items\":{\"enum\":[\"COMMENT_MENTIONED\",\"COMMENT_REPLIED\",\"QUESTION_ANSWERED\",\"QUESTION_RESOLVED\",\"QUESTION_MENTIONED\",\"CARD_CREATED\",\"CARD_UPDATED\",\"CARD_ASSIGNED\",\"CARD_UNASSIGNED\",\"CARD_ASSIGNMENT_ACCEPTED\",\"CARD_ASSIGNMENT_DECLINED\",\"CARD_STATUS_CHANGED\",\"CARD_REVIEW_REQUESTED\",\"CARD_CHANGES_REQUESTED\",\"CARD_APPROVED\",\"CARD_QUICK_DONE\",\"CARD_REOPENED\",\"CARD_BLOCKED\",\"CARD_UNBLOCKED\",\"CARD_ARCHIVED\",\"CARD_COMMENTED\"],\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"limit\":{\"description\":\"Items per call, default 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Older single-value form of projectUuids.\",\"type\":\"string\"},\"projectUuids\":{\"description\":\"Only to-dos in any of these projects. Use it when the user names a project or the project you are working in is clear. With workspaceUuids too, both must match. A workspace or project you cannot see matches nothing.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"state\":{\"description\":\"OPEN (default): to-dos you can take, including ones whose lease expired. MINE: to-dos currently leased (claimed) and not expired.\",\"items\":{\"enum\":[\"OPEN\",\"MINE\"],\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"workspaceUuids\":{\"description\":\"Only to-dos in any of these workspaces.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"ee1a536fc14ee727\"},\n {\"mcpName\":\"list_attachments\",\"commandPath\":[\"attachments\",\"list\"],\"group\":\"attachment\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"projectUuid\"],\"type\":\"object\"},\"required\":[\"projectUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"fae7152d1e4a930b\"},\n {\"mcpName\":\"list_comments\",\"commandPath\":[\"comments\",\"list\"],\"group\":\"generic\",\"description\":\"List the active comments on a document or a kanban card (cardUuid), oldest first, including replies (a reply has parentCommentId set; replies are one level deep). Each comment has id, kind (COMMENT or QUESTION), body, author, mentions (userId, label and position in the body), and for questions questionState (UNANSWERED, ANSWERED, RESOLVED) and resolvedAt. Anyone who can read it can list its comments.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"21dbfc4740a62df5\"},\n {\"mcpName\":\"list_documents\",\"commandPath\":[\"documents\",\"list\"],\"group\":\"document\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"folderUuid\":{\"description\":\"Optional folder UUID\",\"type\":\"string\"},\"limit\":{\"description\":\"Result cap when q is set (default 50)\",\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"},\"q\":{\"description\":\"Optional full-text query. When provided, results come from the search index instead of folder listing.\",\"type\":\"string\"},\"type\":{\"description\":\"Optional document type filter. Readable values: erd, diagram, markdown, openapi, html, file, kanban.\",\"enum\":[\"erd\",\"diagram\",\"markdown\",\"openapi\",\"html\",\"file\",\"kanban\"],\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"0d7288c249fc715c\"},\n {\"mcpName\":\"list_folders\",\"commandPath\":[\"folders\",\"list\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"projectUuid\"],\"type\":\"object\"},\"required\":[\"projectUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"461dc6735ac92c3b\"},\n {\"mcpName\":\"list_history\",\"commandPath\":[\"history\",\"list\"],\"group\":\"generic\",\"description\":\"List recent activity (who did what, people and agents) in a workspace, a project, or on one resource, newest first. Give at least one of workspaceUuid, projectUuid, or resourceType with resourceUuid; you need editor access or higher in that scope. This is a list to refresh, not a gap-free feed: to see what is new, read the first page again and skip ids you have already seen; to get each new notification exactly once use list_notifications. Each item has id, kind, at, lastAt, coalesceCount, actor, target (title and url only when you can read it now), changes and summary.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"actorType\":{\"description\":\"Only people (USER) or only agents (AGENT).\",\"enum\":[\"USER\",\"AGENT\"],\"type\":\"string\"},\"before\":{\"description\":\"nextCursor of the previous page (older items).\",\"type\":\"string\"},\"kinds\":{\"description\":\"Only these kinds.\",\"items\":{\"enum\":[\"COMMENT_MENTIONED\",\"COMMENT_REPLIED\",\"QUESTION_ANSWERED\",\"QUESTION_RESOLVED\",\"QUESTION_MENTIONED\",\"CARD_CREATED\",\"CARD_UPDATED\",\"CARD_ASSIGNED\",\"CARD_UNASSIGNED\",\"CARD_ASSIGNMENT_ACCEPTED\",\"CARD_ASSIGNMENT_DECLINED\",\"CARD_STATUS_CHANGED\",\"CARD_REVIEW_REQUESTED\",\"CARD_CHANGES_REQUESTED\",\"CARD_APPROVED\",\"CARD_QUICK_DONE\",\"CARD_REOPENED\",\"CARD_BLOCKED\",\"CARD_UNBLOCKED\",\"CARD_ARCHIVED\",\"CARD_COMMENTED\"],\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"limit\":{\"description\":\"Items per call, default 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Activity in this project.\",\"type\":\"string\"},\"resourceType\":{\"description\":\"With resourceUuid: activity on one resource.\",\"enum\":[\"DOCUMENT\",\"PROJECT\",\"KANBAN_CARD\"],\"type\":\"string\"},\"resourceUuid\":{\"description\":\"UUID of the resource named by resourceType.\",\"type\":\"string\"},\"workspaceUuid\":{\"description\":\"Activity in this workspace.\",\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"eef3e3be41cfb6b4\"},\n {\"mcpName\":\"list_mention_candidates\",\"commandPath\":[\"mention-candidates\",\"list\"],\"group\":\"generic\",\"description\":\"List the people you can mention in comments on a document or a kanban card (cardUuid): userId and displayName. Only people who can read it are listed — for a card, the people who can read its board, which are also the people a card can be assigned to. To mention someone, write @<displayName> exactly in the comment body and pass their userId in mentionUserIds of create_comments or update_comments. Page with nextCursor while hasMore is true.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"cursor\":{\"description\":\"nextCursor from the previous page (same parent and query).\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"},\"limit\":{\"description\":\"Page size, 1..50. Defaults to 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"query\":{\"description\":\"Name filter, 0..100 characters. Omit or leave empty for the first page of everyone.\",\"maxLength\":100,\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"e7585805859ccb73\"},\n {\"mcpName\":\"list_notifications\",\"commandPath\":[\"notifications\",\"list\"],\"group\":\"generic\",\"description\":\"Read new notifications for the signed-in user, oldest first and without gaps — for an agent that checks the inbox periodically. The server remembers, per connection and per filter (kinds, workspaceUuids, projectUuids, directOnly), how far you have acknowledged; a new filter starts from now. Each response carries ackToken: pass it as ack in your next call (with the same filter) after you have handled the batch — if you do not, the next call returns the same batch again (identify duplicates by id and seq; an item that comes back with a higher seq and a larger groupCount is an update of the same entry). Each item has id, seq, kind, at, summary (one line), actor, target (title and url only when you can read it now), action (what the user is asked to do) and humanRead. An item you can no longer read comes back as {id, seq, at, redacted: true}. This tool never marks anything read for the person; open to-dos are in list_agent_todos. Calls closer than 30 seconds apart (except a call that carries ack) return retryAfterSeconds instead of items.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"ack\":{\"description\":\"The ackToken of the previous response. Send it with the same filter once you have handled (or safely stored) that batch; only then does the saved position move past it. Without it, the same batch is returned again.\",\"type\":\"string\"},\"cursor\":{\"description\":\"Where to read from. \\\"saved\\\" (default): after what this connection last acknowledged for this same filter. \\\"latest\\\": from now on (moves the saved position to now). \\\"earliest\\\": everything still kept (90 days). Or a nextCursor from a previous response: read after it without using or changing the saved position.\",\"type\":\"string\"},\"directOnly\":{\"description\":\"Only notifications that point at you directly (mentions, questions to you).\",\"type\":\"boolean\"},\"kinds\":{\"description\":\"Only these notification kinds.\",\"items\":{\"enum\":[\"COMMENT_MENTIONED\",\"COMMENT_REPLIED\",\"QUESTION_ANSWERED\",\"QUESTION_RESOLVED\",\"QUESTION_MENTIONED\",\"CARD_CREATED\",\"CARD_UPDATED\",\"CARD_ASSIGNED\",\"CARD_UNASSIGNED\",\"CARD_ASSIGNMENT_ACCEPTED\",\"CARD_ASSIGNMENT_DECLINED\",\"CARD_STATUS_CHANGED\",\"CARD_REVIEW_REQUESTED\",\"CARD_CHANGES_REQUESTED\",\"CARD_APPROVED\",\"CARD_QUICK_DONE\",\"CARD_REOPENED\",\"CARD_BLOCKED\",\"CARD_UNBLOCKED\",\"CARD_ARCHIVED\",\"CARD_COMMENTED\"],\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"limit\":{\"description\":\"Items per call, default 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Older single-value form of projectUuids.\",\"type\":\"string\"},\"projectUuids\":{\"description\":\"Only notifications in any of these projects. Use it when the user names a project or the project you are working in is clear. With workspaceUuids too, both must match. A workspace or project you cannot see matches nothing.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"workspaceUuids\":{\"description\":\"Only notifications in any of these workspaces.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"bedcd4375c7f8735\"},\n {\"mcpName\":\"list_projects\",\"commandPath\":[\"projects\",\"list\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"limit\":{\"description\":\"Result cap when q is set (default 50)\",\"type\":\"integer\"},\"q\":{\"description\":\"Optional full-text query\",\"type\":\"string\"},\"workspaceUuid\":{\"description\":\"Optional Workspace UUID\",\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"939bfcc088425771\"},\n {\"mcpName\":\"list_trash\",\"commandPath\":[\"trash\",\"list\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"329250aecc06a298\"},\n {\"mcpName\":\"list_versions\",\"commandPath\":[\"versions\",\"list\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"f08f9faee3ba9107\"},\n {\"mcpName\":\"list_workspaces\",\"commandPath\":[\"workspaces\",\"list\"],\"group\":\"workspace\",\"description\":\"\",\"inputSchema\":{\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"39dba0089fdbdf6a\"},\n {\"mcpName\":\"markdown_append_document\",\"commandPath\":[\"markdown\",\"append-document\"],\"group\":\"markdown\",\"description\":\"Append to Markdown documents. If the appended body is tens of KB or more, prefer request_upload_token (purpose=document.append) and upload the body with curl.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Appends\",\"items\":{\"properties\":{\"addition\":{\"description\":\"Body addition. 추가할 내용이 크면 (수십 KB 이상) LLM 토큰 절약을 위해 `request_upload_token (purpose=document.append, scopeJson={documentUuid, separator})` 로 uploadUrl 을 받고 curl 로 PUT 으로 보낼 것.\",\"type\":\"string\"},\"separator\":{\"description\":\"Separator between existing body and addition\",\"type\":\"string\"},\"uuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"addition\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"bf82401f055f29b0\"},\n {\"mcpName\":\"markdown_generate_document\",\"commandPath\":[\"markdown\",\"generate-document\"],\"group\":\"markdown\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Generation requests\",\"items\":{\"properties\":{\"context\":{\"description\":\"Optional JSON context\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Target document UUID\",\"type\":\"string\"},\"prompt\":{\"description\":\"Generation prompt\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"prompt\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"1e4724ea42f25743\"},\n {\"mcpName\":\"move_documents\",\"commandPath\":[\"documents\",\"move\"],\"group\":\"document\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"clientMutationId\":{\"description\":\"Optional mutation identifier for client retry tracing\",\"maxLength\":128,\"minLength\":1,\"pattern\":\"^[\\\\x21-\\\\x7E]{1,128}$\",\"type\":\"string\"},\"items\":{\"description\":\"Moves\",\"items\":{\"properties\":{\"newFolderUuid\":{\"description\":\"New folder UUID — null/empty for root\",\"type\":\"string\"},\"targetProjectUuid\":{\"description\":\"Target project UUID — omit to stay in current project\",\"type\":\"string\"},\"targetWorkspaceUuid\":{\"description\":\"Guard only: must match targetProjectUuid workspace\",\"type\":\"string\"},\"uuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"45899053743a0c1e\"},\n {\"mcpName\":\"move_folders\",\"commandPath\":[\"folders\",\"move\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Moves\",\"items\":{\"properties\":{\"newParentFolderUuid\":{\"description\":\"New parent UUID — null/empty for root\",\"type\":\"string\"},\"uuid\":{\"description\":\"Folder UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"eff4458d2f35587a\"},\n {\"mcpName\":\"move_projects\",\"commandPath\":[\"projects\",\"move\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Moves\",\"items\":{\"properties\":{\"targetWorkspaceUuid\":{\"description\":\"Destination workspace UUID (you need write access there)\",\"type\":\"string\"},\"uuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"targetWorkspaceUuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"abe0196da3c48ad5\"},\n {\"mcpName\":\"request_upload_token\",\"commandPath\":[\"tools\",\"run\",\"request-upload-token\"],\"group\":\"attachment\",\"description\":\"Use this for large payloads of tens of KB or more to save LLM tokens. purpose=mcp.call returns a short-lived bearer token that can call any MCP tool, including erd_apply_changes, via curl. purpose=document.create/update/append uploads document bodies directly to the upload endpoint with PUT/curl. Tokens are reusable for 5 minutes by default.\",\"inputSchema\":{\"properties\":{\"maxBytes\":{\"description\":\"최대 업로드 byte (서버 측 한도)\",\"type\":\"integer\"},\"purpose\":{\"description\":\"Token 용도. `mcp.call` 은 curl 로 /mcp 호출, `document.create/update/append` 는 PUT body 로 본문 업로드, `attachment.upload` 는 파일 bytes 업로드. 콘텐츠가 크면 (수십 KB 이상) LLM 토큰 절약을 위해 이 도구로 5분 재사용 토큰을 받고 curl 로 보내는 것을 강력 권장.\",\"enum\":[\"mcp.call\",\"document.create\",\"document.update\",\"document.append\",\"attachment.upload\"],\"type\":\"string\"},\"scopeJson\":{\"description\":\"선택 — JSON scope. document.create 는 projectUuid, type, title 을 포함하고 creatable type values 는 erd, diagram, markdown, openapi, html, file, kanban. document.update/document.append 는 documentUuid 를 포함. type=file 은 filename 도 포함(확장자로 형식 판정) — PUT 의 Content-Type 은 파일 MIME, 본문은 파일 바이트. attachment.upload: {documentUuid, filename}; storageKey 는 서버가 발급 scope 에 넣는다.\",\"type\":\"string\"},\"ttlSeconds\":{\"description\":\"TTL (초). 기본 300 (5분)\",\"type\":\"integer\"}},\"required\":[\"purpose\"],\"type\":\"object\"},\"required\":[\"purpose\"],\"payloadMode\":\"binary-upload\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"99a4b6c77dd2368b\"},\n {\"mcpName\":\"resolve_comments\",\"commandPath\":[\"tools\",\"run\",\"resolve-comments\"],\"group\":\"generic\",\"description\":\"Mark questions on a document or a kanban card (cardUuid) as resolved. Only top-level comments with kind QUESTION can be resolved, and it needs edit access to the document or board (readers can comment but cannot resolve). Resolving cannot be undone. Each id is applied on its own; results report each id.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"},\"ids\":{\"description\":\"Question ids to resolve (top-level comments with kind QUESTION)\",\"items\":{\"minimum\":1,\"type\":\"integer\"},\"minItems\":1,\"type\":\"array\"}},\"required\":[\"ids\"],\"type\":\"object\"},\"required\":[\"ids\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"d996f083fd9e6acf\"},\n {\"mcpName\":\"restore_versions\",\"commandPath\":[\"versions\",\"restore\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Restores\",\"items\":{\"properties\":{\"documentUuid\":{\"description\":\"Document UUID\",\"type\":\"string\"},\"versionNumber\":{\"description\":\"Version number to restore\",\"type\":\"integer\"}},\"required\":[\"documentUuid\",\"versionNumber\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"005b5b08a19fc605\"},\n {\"mcpName\":\"search_documents\",\"commandPath\":[\"documents\",\"search\"],\"group\":\"document\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"limit\":{\"description\":\"결과 개수 (기본 20, 최대 50)\",\"type\":\"integer\"},\"offset\":{\"description\":\"페이지네이션 offset (기본 0)\",\"type\":\"integer\"},\"projectUuid\":{\"description\":\"특정 프로젝트로 한정 (선택)\",\"type\":\"string\"},\"q\":{\"description\":\"검색 키워드\",\"type\":\"string\"},\"type\":{\"description\":\"Optional document type filter. Readable values: erd, diagram, markdown, openapi, html, file, kanban.\",\"enum\":[\"erd\",\"diagram\",\"markdown\",\"openapi\",\"html\",\"file\",\"kanban\"],\"type\":\"string\"}},\"required\":[\"q\"],\"type\":\"object\"},\"required\":[\"q\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"40322499fb85e525\"},\n {\"mcpName\":\"unarchive_documents\",\"commandPath\":[\"documents\",\"unarchive\"],\"group\":\"document\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Document UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"f2810e71583a320f\"},\n {\"mcpName\":\"unarchive_folders\",\"commandPath\":[\"folders\",\"unarchive\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Folder UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"2a24cc44696b7906\"},\n {\"mcpName\":\"unarchive_projects\",\"commandPath\":[\"projects\",\"unarchive\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Project UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"6925e444671afe19\"},\n {\"mcpName\":\"unarchive_workspaces\",\"commandPath\":[\"workspaces\",\"unarchive\"],\"group\":\"workspace\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Workspace UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"8dafe9bc6378c3f2\"},\n {\"mcpName\":\"update_agent_todos\",\"commandPath\":[\"agent-todos\",\"update\"],\"group\":\"generic\",\"description\":\"Claim, renew, complete, release, or dismiss the signed-in user's agent to-dos. Only the session holding the current leaseToken may renew, release, or complete a claimed to-do — even another session of the same connection gets CLAIMED_BY_OTHER. Results are per item: {todoId, ok: true, state, leaseToken?, claimExpiresAt?} or {todoId, ok: false, error} with error one of CLAIMED_BY_OTHER, LEASE_LOST, ALREADY_DONE, CLOSED_BY_HUMAN, SUPERSEDED, ACCESS_LOST, BUSINESS_ACTION_REQUIRED, NOT_FOUND, INVALID — on CLOSED_BY_HUMAN or SUPERSEDED stop working on it. BUSINESS_ACTION_REQUIRED: card to-dos (CARD_*) cannot be completed here; doing the card action closes them. Retrying the same complete or dismiss returns ok again. There is no tool to mark the person's notifications read.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"items\":{\"description\":\"To-dos to update; each item is applied and reported on its own.\",\"items\":{\"additionalProperties\":false,\"properties\":{\"action\":{\"description\":\"claim: take it (returns leaseToken, valid 30 minutes). renew: extend your lease. complete: done (with leaseToken if you claimed it; without one only while it is still OPEN). release: give it back. dismiss: not a to-do.\",\"enum\":[\"claim\",\"renew\",\"complete\",\"release\",\"dismiss\"],\"type\":\"string\"},\"leaseToken\":{\"description\":\"Required for renew and release, and for complete or dismiss of a to-do you claimed.\",\"type\":\"string\"},\"note\":{\"description\":\"For complete or dismiss: one line on what you did (at most 500 characters, no document bodies). The person sees it in the inbox.\",\"maxLength\":500,\"type\":\"string\"},\"todoId\":{\"description\":\"todoId from list_agent_todos.\",\"type\":\"string\"}},\"required\":[\"todoId\",\"action\"],\"type\":\"object\"},\"maxItems\":50,\"minItems\":1,\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"d10fc0752ad55a12\"},\n {\"mcpName\":\"update_comments\",\"commandPath\":[\"comments\",\"update\"],\"group\":\"generic\",\"description\":\"Edit your own comments on a document or a kanban card (cardUuid). Only the author can edit, and only while they can still read it. A resolved question and a top-level comment that already has replies are locked. Items are applied in order and each one commits on its own; results report each item.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"},\"items\":{\"description\":\"Edits, applied in order\",\"items\":{\"additionalProperties\":false,\"properties\":{\"body\":{\"description\":\"New comment text (replaces the old text).\",\"maxLength\":10000,\"minLength\":1,\"type\":\"string\"},\"clientMutationId\":{\"description\":\"Idempotency key (visible ASCII, at most 128 characters). Required when mentionUserIds is not empty; reuse the same value when retrying the same item so the mention email is not sent twice.\",\"maxLength\":128,\"type\":\"string\"},\"id\":{\"description\":\"Comment id (from mcp__ainecto__list_comments)\",\"minimum\":1,\"type\":\"integer\"},\"mentionUserIds\":{\"description\":\"The complete set of userIds mentioned after the edit; omit to remove all mentions. Each one's @<displayName> must appear in body. Only people who were not mentioned before get a notification email.\",\"items\":{\"type\":\"string\"},\"maxItems\":20,\"type\":\"array\",\"uniqueItems\":true}},\"required\":[\"id\",\"body\"],\"type\":\"object\"},\"minItems\":1,\"type\":\"array\"},\"mailLanguage\":{\"description\":\"Language of the comment notification email (mention or reply). Defaults to en.\",\"enum\":[\"en\",\"ko\"],\"type\":\"string\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"a5bc050079e34361\"},\n {\"mcpName\":\"update_documents\",\"commandPath\":[\"documents\",\"update\"],\"group\":\"document\",\"description\":\"Update documents. If a replacement body is tens of KB or more, prefer request_upload_token (purpose=document.update) and upload the body with curl.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Updates\",\"items\":{\"properties\":{\"body\":{\"description\":\"Deprecated compatibility alias for typePayload.body when document type is markdown. 본문이 수십 KB 이상으로 크면 LLM 토큰 절약을 위해 `request_upload_token (purpose=document.update)` 를 호출해 uploadUrl 을 받고 curl 로 직접 PUT 으로 보낼 것.\",\"type\":\"string\"},\"title\":{\"description\":\"New title\",\"type\":\"string\"},\"typePayload\":{\"description\":\"Type-specific payload for enabled document types. markdown: {body}; diagram: {diagramSource,sourceLanguage,edgeStyle,isModule,metadata}; openapi: {content}; html: {content} (a full HTML page); file: {file:{filename,contentType,sizeBytes,viewerKind}} (+content for text/CSV, first 64 KB); kanban: no body — only the title can be updated; cards are changed with kanban_apply_changes and kanban_card_action.\",\"type\":\"object\"},\"uuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"47485db860973df3\"},\n {\"mcpName\":\"update_folders\",\"commandPath\":[\"folders\",\"update\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Updates\",\"items\":{\"properties\":{\"name\":{\"description\":\"New name\",\"type\":\"string\"},\"uuid\":{\"description\":\"Folder UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"name\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"43c58a96ee632b5f\"},\n {\"mcpName\":\"update_projects\",\"commandPath\":[\"projects\",\"update\"],\"group\":\"generic\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Updates\",\"items\":{\"properties\":{\"description\":{\"description\":\"New description\",\"type\":\"string\"},\"name\":{\"description\":\"New name\",\"type\":\"string\"},\"uuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"7d849ef0a830aa8c\"},\n {\"mcpName\":\"update_workspaces\",\"commandPath\":[\"workspaces\",\"update\"],\"group\":\"workspace\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Updates\",\"items\":{\"properties\":{\"description\":{\"description\":\"New description\",\"type\":\"string\"},\"name\":{\"description\":\"New name\",\"type\":\"string\"},\"uuid\":{\"description\":\"Workspace UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"553275e6da799c5a\"},\n {\"mcpName\":\"upload_attachments\",\"commandPath\":[\"tools\",\"run\",\"upload-attachments\"],\"group\":\"attachment\",\"description\":\"\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Attachments to register\",\"items\":{\"properties\":{\"contentType\":{\"description\":\"MIME type\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Parent document UUID\",\"type\":\"string\"},\"filename\":{\"description\":\"Original file name\",\"type\":\"string\"},\"sizeBytes\":{\"description\":\"Size in bytes\",\"type\":\"integer\"},\"storageKey\":{\"description\":\"Storage key returned by request_upload_token purpose=attachment.upload\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"filename\",\"storageKey\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"binary-upload\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"deda4a56fbbe064f\"},\n] satisfies GeneratedToolDefinition[];\n","import { createHash } from \"node:crypto\";\nimport type { GeneratedToolDefinition, JsonSchema, McpToolListItem, PayloadMode, ToolGroup } from \"./types\";\n\n/**\n * 서버가 도구 이름 앞에 달던 prefix.\n *\n * ★2026-09-22 부터 서버는 이 prefix 를 «떼고» 내보낸다 — MCP 클라이언트가 자기 서버 별칭을\n * 한 번 더 얹기 때문에, 서버까지 붙이면 `mcp__ainecto__mcp__ainecto__list_projects` 가 된다.\n * 그래서 여기서는 prefix 를 «있으면 뗀다»로만 다룬다. 옛 카탈로그(이미 받아 둔 generated.*.ts)\n * 에는 긴 이름이 남아 있고 서버가 그것도 계속 받아주므로, 두 형태가 함께 산다.\n */\nconst LEGACY_PREFIX = \"mcp__ainecto__\";\n\n/**\n * 서버 prefix 를 뗀 «맨 이름». 카탈로그가 어느 판에서 왔든(긴 이름·짧은 이름) 같은 도구를 같은\n * 이름으로 가리키려면 이 한 곳을 거친다 — 표시 정보(enrichments)를 이름으로 붙일 때 특히.\n */\nexport function bareToolName(name: string): string {\n return name.startsWith(LEGACY_PREFIX) ? name.slice(LEGACY_PREFIX.length) : name;\n}\nconst DESTRUCTIVE_PREFIXES = [\n \"delete_\",\n \"remove_\",\n \"archive_\",\n \"unarchive_\",\n \"restore_\",\n \"move_\",\n \"erd_delete_\",\n \"erd_remove_\",\n \"testcase_delete_\",\n];\n\nexport function generateCatalog(tools: McpToolListItem[], sourceCatalog: \"prod\" | \"dev\"): GeneratedToolDefinition[] {\n return tools\n .map((tool) => normalizeTool(tool, sourceCatalog))\n .sort((a, b) => a.mcpName.localeCompare(b.mcpName));\n}\n\nexport function normalizeTool(tool: McpToolListItem, sourceCatalog: \"prod\" | \"dev\"): GeneratedToolDefinition {\n if (!tool.name) {\n throw new Error(\"Unsupported tool name: empty.\");\n }\n const stripped = bareToolName(tool.name);\n const group = inferGroup(stripped);\n const inputSchema = normalizeSchema(tool.inputSchema ?? { type: \"object\", properties: {} });\n const required = Array.isArray(inputSchema.required)\n ? inputSchema.required.filter((value): value is string => typeof value === \"string\").sort()\n : [];\n const definition = {\n mcpName: tool.name,\n commandPath: generateCommandPath(stripped, group),\n group,\n description: tool.description ?? \"\",\n inputSchema,\n required,\n payloadMode: inferPayloadMode(stripped, inputSchema),\n destructive: inferDestructive(stripped, tool),\n sourceCatalog,\n schemaHash: \"\",\n } satisfies GeneratedToolDefinition;\n return { ...definition, schemaHash: computeSchemaHash(definition) };\n}\n\nexport function inferGroup(strippedName: string): ToolGroup {\n if (strippedName.startsWith(\"erd_\")) return \"erd\";\n if (strippedName.startsWith(\"flow_\")) return \"flow\";\n if (strippedName.startsWith(\"testcase_\")) return \"testcase\";\n if (strippedName.startsWith(\"markdown_\")) return \"markdown\";\n if (strippedName.includes(\"attachment\") || strippedName.includes(\"upload\")) return \"attachment\";\n if (strippedName.startsWith(\"kanban_\")) return \"kanban\";\n if (strippedName.includes(\"workspace\")) return \"workspace\";\n if (strippedName.includes(\"document\")) return \"document\";\n return \"generic\";\n}\n\nexport function generateCommandPath(strippedName: string, group: ToolGroup): string[] {\n if (group !== \"generic\" && strippedName.startsWith(`${group}_`)) {\n return [group, snakeToKebab(strippedName.slice(group.length + 1))];\n }\n\n const [verb, ...rest] = strippedName.split(\"_\");\n if (verb && rest.length > 0 && isVerb(verb)) {\n return [rest.join(\"-\"), verb];\n }\n\n return [\"tools\", \"run\", snakeToKebab(strippedName)];\n}\n\nexport function inferPayloadMode(strippedName: string, inputSchema: JsonSchema): PayloadMode {\n if (strippedName.includes(\"upload\") || strippedName.includes(\"attachment_upload\")) {\n return \"binary-upload\";\n }\n const properties = inputSchema.properties;\n if (!isRecord(properties)) {\n return \"flags\";\n }\n const values = Object.values(properties);\n if (values.length === 0) {\n return \"flags\";\n }\n if (values.every(isScalarSchema)) {\n return \"flags\";\n }\n return \"file-json\";\n}\n\nexport function inferDestructive(strippedName: string, tool: McpToolListItem): boolean {\n if (tool.annotations?.destructiveHint === true) {\n return true;\n }\n return DESTRUCTIVE_PREFIXES.some((prefix) => strippedName.startsWith(prefix));\n}\n\nexport function computeSchemaHash(tool: Omit<GeneratedToolDefinition, \"schemaHash\">): string {\n return createHash(\"sha256\")\n .update(stableStringify({\n name: tool.mcpName,\n description: tool.description,\n inputSchema: tool.inputSchema,\n }))\n .digest(\"hex\")\n .slice(0, 16);\n}\n\nexport function stableStringify(value: unknown): string {\n if (Array.isArray(value)) {\n return `[${value.map(stableStringify).join(\",\")}]`;\n }\n if (isRecord(value)) {\n return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${stableStringify(value[key])}`).join(\",\")}}`;\n }\n return JSON.stringify(value);\n}\n\nexport function serializeGeneratedCatalog(tools: GeneratedToolDefinition[]): string {\n return [\n \"import type { GeneratedToolDefinition } from \\\"./types\\\";\",\n \"\",\n \"export const generatedTools = [\",\n ...tools.map((tool) => ` ${JSON.stringify(tool)},`),\n \"] satisfies GeneratedToolDefinition[];\",\n \"\",\n ].join(\"\\n\");\n}\n\nfunction normalizeSchema(schema: JsonSchema): JsonSchema {\n return JSON.parse(stableStringify(schema)) as JsonSchema;\n}\n\nfunction isScalarSchema(value: unknown): boolean {\n if (!isRecord(value)) {\n return false;\n }\n const type = value.type;\n return type === \"string\" || type === \"number\" || type === \"integer\" || type === \"boolean\";\n}\n\nfunction isVerb(value: string): boolean {\n return [\n \"list\",\n \"get\",\n \"create\",\n \"update\",\n \"delete\",\n \"move\",\n \"restore\",\n \"archive\",\n \"unarchive\",\n \"search\",\n ].includes(value);\n}\n\nfunction snakeToKebab(value: string): string {\n return value.replaceAll(\"_\", \"-\");\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { generatedTools as prodTools } from \"./generated.prod\";\nimport { generatedTools as devTools } from \"./generated.dev\";\nimport { generateCatalog } from \"./generator\";\nimport type { GeneratedToolDefinition, McpToolListItem } from \"./types\";\nimport type { AinectoEnv } from \"../config/endpoints\";\nimport type { McpRpcClient } from \"../mcp/rpcClient\";\n\n/** 이 CLI 판을 빌드할 때 받아 둔 스냅샷 — 서버를 못 부를 때의 대체본이다. */\nexport function getGeneratedTools(env: AinectoEnv) {\n return env === \"dev\" ? devTools : prodTools;\n}\n\n/**\n * ★서버의 지금 도구 목록 — 진실원은 서버다. 스냅샷만 보여 주면 서버에 새 문서 유형(html)이 열려도\n * 에이전트는 «CLI 에 없다»고 판단했다(2026-10-10). 유형·도구가 늘 때마다 CLI 를 다시 배포하지 않으려고\n * 실행할 때 받는다. 실패는 호출처가 스냅샷으로 대체하며 이유를 알린다.\n */\nexport async function loadLiveTools(env: AinectoEnv, client: McpRpcClient): Promise<GeneratedToolDefinition[]> {\n return generateCatalog(await client.toolsList() as McpToolListItem[], env);\n}\n","import { createInterface } from \"node:readline\";\nimport type { Readable, Writable } from \"node:stream\";\nimport { McpRpcClient, type JsonRpcRequest } from \"./rpcClient\";\n\nexport interface StdioBridgeOptions {\n input: Readable;\n output: Writable;\n errorOutput: Writable;\n client: McpRpcClient;\n}\n\nexport async function runStdioBridge(options: StdioBridgeOptions): Promise<void> {\n const lines = createInterface({ input: options.input, crlfDelay: Infinity });\n\n for await (const line of lines) {\n if (!line.trim()) {\n continue;\n }\n try {\n const request = parseJsonRpcRequest(line);\n if (request.method === \"initialize\") {\n // 호스트 에이전트의 고정 이름 — 이 세션의 모든 요청에 X-AiNecto-Agent 로 실린다(initialize 자신 포함).\n options.client.useAgent(clientInfoName(request.params));\n }\n const response = await options.client.sendRaw(request);\n if (response && request.id !== undefined) {\n options.output.write(`${JSON.stringify(response)}\\n`);\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n options.output.write(`${JSON.stringify({\n jsonrpc: \"2.0\",\n id: null,\n error: { code: -32603, message },\n })}\\n`);\n }\n }\n}\n\nfunction parseJsonRpcRequest(line: string): JsonRpcRequest {\n const parsed = JSON.parse(line) as unknown;\n if (!isRecord(parsed) || parsed.jsonrpc !== \"2.0\" || typeof parsed.method !== \"string\") {\n throw new Error(\"Invalid JSON-RPC request.\");\n }\n return {\n jsonrpc: \"2.0\",\n id: typeof parsed.id === \"string\" || typeof parsed.id === \"number\" || parsed.id === null ? parsed.id : undefined,\n method: parsed.method,\n params: parsed.params,\n };\n}\n\nfunction clientInfoName(params: unknown): unknown {\n return isRecord(params) && isRecord(params.clientInfo) ? params.clientInfo.name : undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { FileTokenStore } from \"../../core/auth/tokenStore\";\nimport { OAuthClient } from \"../../core/auth/oauth\";\nimport { McpRpcClient } from \"../../core/mcp/rpcClient\";\nimport { runStdioBridge } from \"../../core/mcp/stdioBridge\";\nimport { LEGACY_ROLE_NOTICE, legacyRoleInput } from \"../../core/harness/legacyRole\";\nimport type { Readable, Writable } from \"node:stream\";\n\nexport interface ConnectorOptions {\n endpoint: string;\n /** 옛 MCP 설정의 {@code --role} 값(검사하지 않는다). 없으면 {@code AINECTO_ROLE} 를 본다 — 기록용. */\n legacyRoleFlag?: string;\n envVars?: NodeJS.ProcessEnv;\n input: Readable;\n output: Writable;\n errorOutput: Writable;\n}\n\nexport async function runConnector(options: ConnectorOptions): Promise<void> {\n // ★토큰은 서버마다 한 칸이다. 세션 역할은 없다 — 도구 목록·권한은 서버가 사용자 권한으로 정한다.\n const legacyRole = legacyRoleInput(options.legacyRoleFlag, options.envVars);\n if (legacyRole !== undefined) {\n // stdout 은 JSON-RPC 전용이다 — 안내는 stderr 로만.\n options.errorOutput.write(`${LEGACY_ROLE_NOTICE}\\n`);\n }\n const auth = new OAuthClient({ endpoint: options.endpoint, tokenStore: new FileTokenStore() });\n const client = new McpRpcClient({\n endpoint: options.endpoint,\n tokenProvider: auth,\n legacyRole,\n // 에이전트의 MCP 연결 — 에이전트 이름은 브리지가 호스트의 initialize 에서 읽어 싣는다.\n channel: \"mcp\",\n });\n await runStdioBridge({\n input: options.input,\n output: options.output,\n errorOutput: options.errorOutput,\n client,\n });\n}\n","import type { ToolPresentationEnrichment } from \"./types\";\n\nexport const enrichments = [\n {\n mcpName: \"list_projects\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"name\", \"projectKey\", \"workspaceUuid\", \"updatedAt\"],\n displayName: \"List projects\",\n examples: [\"ainecto projects list --env dev\"],\n },\n {\n mcpName: \"list_workspaces\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"name\", \"updatedAt\"],\n displayName: \"List workspaces\",\n },\n {\n mcpName: \"list_folders\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"name\", \"projectUuid\", \"parentFolderUuid\", \"updatedAt\"],\n displayName: \"List folders\",\n },\n {\n mcpName: \"list_documents\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"title\", \"type\", \"projectUuid\", \"folderUuid\", \"updatedAt\"],\n displayName: \"List documents\",\n },\n {\n mcpName: \"search_documents\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"title\", \"type\", \"projectUuid\", \"updatedAt\"],\n displayName: \"Search documents\",\n },\n {\n mcpName: \"list_attachments\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"filename\", \"contentType\", \"sizeBytes\", \"documentUuid\"],\n displayName: \"List attachments\",\n },\n {\n mcpName: \"erd_list_tables\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"name\", \"schema_name\", \"display_order\"],\n displayName: \"List ERD tables\",\n },\n {\n mcpName: \"erd_list_refs\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"name\", \"from_table_uuid\", \"to_table_uuid\", \"relationship\"],\n displayName: \"List ERD refs\",\n },\n {\n mcpName: \"erd_list_enums\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"name\", \"display_order\"],\n displayName: \"List ERD enums\",\n },\n {\n mcpName: \"erd_list_table_groups\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"name\", \"display_order\"],\n displayName: \"List ERD table groups\",\n },\n {\n mcpName: \"enable_shares\",\n aliases: [\"shares enable\"],\n displayName: \"Enable shares\",\n },\n {\n mcpName: \"disable_shares\",\n aliases: [\"shares disable\"],\n displayName: \"Disable shares\",\n },\n] satisfies ToolPresentationEnrichment[];\n","export interface TableOptions {\n columns?: string[];\n}\n\nexport function renderTable(data: unknown, options: TableOptions = {}): string | undefined {\n const rows = extractRows(data);\n if (!rows.length || !rows.every(isRecord)) {\n return undefined;\n }\n\n const columns = options.columns?.length ? options.columns : inferColumns(rows);\n if (!columns.length) {\n return undefined;\n }\n\n const widths = columns.map((column) => Math.max(column.length, ...rows.map((row) => formatCell(row[column]).length)));\n const header = columns.map((column, index) => column.padEnd(widths[index] ?? column.length)).join(\" \");\n const divider = widths.map((width) => \"-\".repeat(width)).join(\" \");\n const body = rows.map((row) => columns.map((column, index) => formatCell(row[column]).padEnd(widths[index] ?? column.length)).join(\" \"));\n\n return [header, divider, ...body].join(\"\\n\");\n}\n\nfunction extractRows(data: unknown): unknown[] {\n if (Array.isArray(data)) {\n return data;\n }\n if (isRecord(data)) {\n for (const key of [\"items\", \"projects\", \"workspaces\", \"folders\", \"documents\", \"tasks\", \"attachments\", \"results\", \"data\"]) {\n const value = data[key];\n if (Array.isArray(value)) {\n return value;\n }\n }\n }\n return [];\n}\n\nfunction inferColumns(rows: Record<string, unknown>[]): string[] {\n const preferred = [\"uuid\", \"id\", \"name\", \"title\", \"status\", \"type\", \"projectUuid\", \"documentUuid\", \"createdAt\", \"updatedAt\"];\n const keys = new Set(rows.flatMap((row) => Object.keys(row)));\n const columns = preferred.filter((key) => keys.has(key));\n if (columns.length > 0) {\n return columns.slice(0, 6);\n }\n return [...keys].slice(0, 6);\n}\n\nfunction formatCell(value: unknown): string {\n if (value === null || value === undefined) {\n return \"\";\n }\n if (typeof value === \"object\") {\n return JSON.stringify(value);\n }\n return String(value);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","export class CliCommandError extends Error {\n constructor(\n readonly code: string,\n message: string,\n readonly details?: unknown,\n ) {\n super(message);\n }\n}\n","import type { GeneratedToolDefinition, JsonSchema } from \"../../core/catalog/types\";\nimport { parsePayloadSource, type ParsedPayload } from \"../../core/input/payloadSource\";\nimport { CliCommandError } from \"./errors\";\n\nexport interface ParsedCommandArgs {\n args: Record<string, unknown>;\n yes: boolean;\n warnings: string[];\n}\n\nexport async function parseGeneratedCommandArgs(\n tool: GeneratedToolDefinition,\n argv: string[],\n stdin: NodeJS.ReadStream,\n): Promise<ParsedCommandArgs> {\n const parsed = parseArgv(argv);\n const payload = await parsePayload(tool, parsed, stdin);\n const args = payloadToArgs(payload.value);\n const properties = getSchemaProperties(tool.inputSchema);\n\n for (const [key, value] of Object.entries(parsed.flags)) {\n if (key === \"yes\") {\n continue;\n }\n const schemaKey = resolveSchemaKey(key, properties);\n if (!schemaKey) {\n throw new CliCommandError(\"UNKNOWN_FLAG\", `Unknown flag --${key} for ${tool.commandPath.join(\" \")}.`, {\n flag: key,\n mcpName: tool.mcpName,\n });\n }\n args[schemaKey] = coerceFlagValue(value, properties[schemaKey], schemaKey);\n }\n\n for (const required of tool.required) {\n if (args[required] === undefined || args[required] === \"\") {\n throw new CliCommandError(\"MISSING_REQUIRED_FLAG\", `Missing required argument \"${required}\" for ${tool.commandPath.join(\" \")}.`, {\n required,\n flag: `--${camelToKebab(required)}`,\n mcpName: tool.mcpName,\n });\n }\n }\n\n return {\n args,\n yes: parsed.yes,\n warnings: payload.warnings,\n };\n}\n\nfunction payloadToArgs(value: unknown): Record<string, unknown> {\n if (value === undefined || value === null) {\n return {};\n }\n if (!isRecord(value)) {\n throw new CliCommandError(\"INVALID_PAYLOAD\", \"Generated command payload must be a JSON object.\", { value });\n }\n return { ...value };\n}\n\ninterface ParsedArgv {\n flags: Record<string, string | boolean>;\n yes: boolean;\n file?: string;\n inline?: string;\n}\n\nfunction parseArgv(argv: string[]): ParsedArgv {\n const flags: Record<string, string | boolean> = {};\n const inline: string[] = [];\n let file: string | undefined;\n let yes = false;\n\n for (let index = 0; index < argv.length; index += 1) {\n const arg = argv[index];\n if (!arg) {\n continue;\n }\n if (arg === \"--file\" || arg === \"-f\") {\n file = requireValue(arg, argv[++index]);\n continue;\n }\n if (arg === \"--yes\" || arg === \"-y\") {\n yes = true;\n flags.yes = true;\n continue;\n }\n if (arg.startsWith(\"--\")) {\n const withoutPrefix = arg.slice(2);\n const eqIndex = withoutPrefix.indexOf(\"=\");\n if (eqIndex >= 0) {\n const key = withoutPrefix.slice(0, eqIndex);\n flags[key] = withoutPrefix.slice(eqIndex + 1);\n continue;\n }\n const next = argv[index + 1];\n if (!next || next.startsWith(\"--\")) {\n flags[withoutPrefix] = true;\n continue;\n }\n flags[withoutPrefix] = next;\n index += 1;\n continue;\n }\n inline.push(arg);\n }\n\n return {\n flags,\n yes,\n file,\n inline: inline.length > 0 ? inline.join(\" \") : undefined,\n };\n}\n\nasync function parsePayload(\n tool: GeneratedToolDefinition,\n parsed: ParsedArgv,\n stdin: NodeJS.ReadStream,\n): Promise<ParsedPayload> {\n if (tool.payloadMode === \"file-json\" || parsed.file || parsed.inline) {\n return parsePayloadSource({\n file: parsed.file,\n inline: parsed.inline,\n stdin,\n });\n }\n\n return { value: {}, source: \"empty\", warnings: [] };\n}\n\nfunction resolveSchemaKey(flag: string, properties: Record<string, JsonSchema>): string | undefined {\n if (properties[flag]) {\n return flag;\n }\n const normalized = flag.toLowerCase();\n return Object.keys(properties).find((key) => camelToKebab(key) === normalized);\n}\n\nfunction coerceFlagValue(value: string | boolean, schema: JsonSchema | undefined, key: string): unknown {\n const type = schema?.type;\n if (type === \"boolean\") {\n if (typeof value === \"boolean\") {\n return value;\n }\n if (value === \"true\") return true;\n if (value === \"false\") return false;\n throw new CliCommandError(\"INVALID_FLAG_VALUE\", `Flag \"${key}\" must be a boolean.`, { key, value });\n }\n if (type === \"string\") {\n if (typeof value === \"boolean\") {\n throw new CliCommandError(\"FLAG_REQUIRES_VALUE\", `--${camelToKebab(key)} requires a value.`, { key });\n }\n return value;\n }\n if (type === \"integer\") {\n if (typeof value === \"boolean\" || !/^-?\\d+$/.test(value)) {\n const code = typeof value === \"boolean\" ? \"FLAG_REQUIRES_VALUE\" : \"INVALID_FLAG_VALUE\";\n throw new CliCommandError(code, `Flag \"${key}\" must be an integer.`, { key, value });\n }\n return Number.parseInt(value, 10);\n }\n if (type === \"number\") {\n if (typeof value === \"boolean\" || Number.isNaN(Number(value))) {\n const code = typeof value === \"boolean\" ? \"FLAG_REQUIRES_VALUE\" : \"INVALID_FLAG_VALUE\";\n throw new CliCommandError(code, `Flag \"${key}\" must be a number.`, { key, value });\n }\n return Number(value);\n }\n throw new CliCommandError(\"UNSUPPORTED_FLAG_PAYLOAD\", `Flag \"${key}\" is not a scalar field; provide it through --file, stdin, or inline JSON.`, {\n key,\n type,\n });\n}\n\nfunction getSchemaProperties(schema: JsonSchema): Record<string, JsonSchema> {\n const properties = schema.properties;\n if (!isRecord(properties)) {\n return {};\n }\n const result: Record<string, JsonSchema> = {};\n for (const [key, value] of Object.entries(properties)) {\n if (isRecord(value)) {\n result[key] = value;\n }\n }\n return result;\n}\n\nexport function camelToKebab(value: string): string {\n return value.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`).toLowerCase();\n}\n\nfunction requireValue(flag: string, value: string | undefined): string {\n if (!value || value.startsWith(\"--\")) {\n throw new CliCommandError(\"FLAG_REQUIRES_VALUE\", `${flag} requires a value.`, { flag });\n }\n return value;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { createInterface } from \"node:readline\";\nimport type { GeneratedToolDefinition } from \"../../core/catalog/types\";\nimport { CliCommandError } from \"./errors\";\n\nexport interface ConfirmationIO {\n stdin: NodeJS.ReadStream;\n stderr: NodeJS.WriteStream;\n}\n\nexport async function confirmDestructiveCommand(options: {\n tool: GeneratedToolDefinition;\n yes: boolean;\n json: boolean;\n io: ConfirmationIO;\n}): Promise<void> {\n if (!options.tool.destructive) {\n return;\n }\n if (options.yes) {\n return;\n }\n if (options.json) {\n throw new CliCommandError(\"CONFIRMATION_REQUIRED\", `Destructive command ${options.tool.commandPath.join(\" \")} requires --yes in --json mode.`, {\n mcpName: options.tool.mcpName,\n });\n }\n\n const answer = await promptConfirmation(options.io, `Run destructive command ${options.tool.commandPath.join(\" \")}? Type \"yes\" to continue: `);\n if (answer.trim().toLowerCase() !== \"yes\") {\n throw new CliCommandError(\"CONFIRMATION_DECLINED\", \"Destructive command was not confirmed.\", {\n mcpName: options.tool.mcpName,\n });\n }\n}\n\nasync function promptConfirmation(io: ConfirmationIO, message: string): Promise<string> {\n io.stderr.write(message);\n const rl = createInterface({ input: io.stdin, terminal: false });\n try {\n for await (const line of rl) {\n return line;\n }\n return \"\";\n } finally {\n rl.close();\n }\n}\n","export const ATTACHMENTS_UPLOAD_COMMAND_PATH = [\"attachments\", \"upload\"] as const;\n/** 알림·할 일 폴링(종료 코드 0 = 새 것 있음 · 3 = 없음) — inboxPollCommands.ts. */\nexport const NOTIFICATIONS_POLL_COMMAND_PATH = [\"notifications\", \"poll\"] as const;\nexport const NOTIFICATIONS_ACK_COMMAND_PATH = [\"notifications\", \"ack\"] as const;\nexport const AGENT_TODOS_POLL_COMMAND_PATH = [\"agent-todos\", \"poll\"] as const;\n\nexport const BESPOKE_COMMAND_PATHS = [\n ATTACHMENTS_UPLOAD_COMMAND_PATH,\n NOTIFICATIONS_POLL_COMMAND_PATH,\n NOTIFICATIONS_ACK_COMMAND_PATH,\n AGENT_TODOS_POLL_COMMAND_PATH,\n] as const;\n","import type { McpRpcClient } from \"../../core/mcp/rpcClient\";\nimport type { GeneratedToolDefinition, ToolPresentationEnrichment } from \"../../core/catalog/types\";\nimport { enrichments } from \"../../core/catalog/enrichments\";\nimport { getGeneratedTools } from \"../../core/catalog\";\nimport type { AinectoEnv } from \"../../core/config/endpoints\";\nimport { renderSuccess } from \"../../core/output/render\";\nimport { isToolError } from \"../../core/mcp/rpcClient\";\nimport { renderTable } from \"../../core/output/table\";\nimport { parseGeneratedCommandArgs } from \"./flagParser\";\nimport { confirmDestructiveCommand, type ConfirmationIO } from \"./destructiveConfirmation\";\nimport { BESPOKE_COMMAND_PATHS } from \"./bespokeCommands\";\n\nexport interface GeneratedCommandRoute {\n tool: GeneratedToolDefinition;\n matchedPath: string[];\n rest: string[];\n presentation?: ToolPresentationEnrichment;\n rawContractWarning?: string;\n}\n\nexport interface GeneratedCommandExecutionOptions {\n /** 라우팅할 도구 목록 — 스냅샷이거나, 스냅샷에 없는 명령이면 서버의 지금 목록. */\n tools: readonly GeneratedToolDefinition[];\n argv: string[];\n client: McpRpcClient;\n json: boolean;\n io: ConfirmationIO & { stdout: NodeJS.WriteStream };\n}\n\nexport function matchGeneratedCommand(\n tools: readonly GeneratedToolDefinition[],\n argv: string[],\n): GeneratedCommandRoute | undefined {\n const commandTokens = argv.filter((arg) => !arg.startsWith(\"-\"));\n const entries = buildRouteEntries(tools, enrichments);\n const match = entries\n .filter((entry) => isPrefix(entry.path, commandTokens))\n .sort((a, b) => b.path.length - a.path.length)[0];\n\n if (!match) {\n return undefined;\n }\n\n const restStart = findRestStart(argv, match.path);\n return {\n tool: match.tool,\n matchedPath: match.path,\n rest: argv.slice(restStart),\n presentation: match.presentation,\n rawContractWarning: match.tool.payloadMode === \"binary-upload\"\n ? \"This generated command uses the raw MCP argument contract only; local file upload semantics are not implemented here.\"\n : undefined,\n };\n}\n\nexport async function executeGeneratedCommand(options: GeneratedCommandExecutionOptions): Promise<number> {\n const route = matchGeneratedCommand(options.tools, options.argv);\n if (!route) {\n return 2;\n }\n\n const parsed = await parseGeneratedCommandArgs(route.tool, route.rest, options.io.stdin);\n await confirmDestructiveCommand({\n tool: route.tool,\n yes: parsed.yes,\n json: options.json,\n io: options.io,\n });\n\n const result = await options.client.toolsCall(route.tool.mcpName, parsed.args);\n const warnings = [...parsed.warnings, ...(route.rawContractWarning ? [route.rawContractWarning] : [])];\n options.io.stdout.write(renderGeneratedResult(result, {\n json: options.json,\n warnings,\n presentation: route.presentation,\n }));\n // ★도구가 «거부»한 것을 성공으로 보고하지 않는다 — 셸 자동화는 exit 코드를 본다.\n return isToolError(result) ? 1 : 0;\n}\n\nexport function assertNoCommandCollisions(env: AinectoEnv): void {\n const entries = buildRouteEntries(getGeneratedTools(env), enrichments);\n const seen = new Map<string, string>();\n for (const entry of entries) {\n const key = entry.path.join(\" \");\n const existing = seen.get(key);\n if (existing) {\n throw new Error(`Command collision for \"${key}\": ${existing} and ${entry.tool.mcpName}`);\n }\n seen.set(key, entry.tool.mcpName);\n }\n for (const commandPath of BESPOKE_COMMAND_PATHS) {\n const command = commandPath.join(\" \");\n const existing = seen.get(command);\n if (existing) {\n throw new Error(`Bespoke command \"${command}\" collides with ${existing}.`);\n }\n }\n}\n\nfunction renderGeneratedResult(\n result: unknown,\n options: {\n json: boolean;\n warnings: string[];\n presentation?: ToolPresentationEnrichment;\n },\n): string {\n if (!options.json && options.presentation?.outputHint === \"table\") {\n const table = renderTable(result, { columns: options.presentation.tableColumns });\n if (table) {\n const warnings = options.warnings.length ? `${options.warnings.map((warning) => `Warning: ${warning}`).join(\"\\n\")}\\n` : \"\";\n return `${warnings}${table}\\n`;\n }\n }\n return renderSuccess(result, { json: options.json, warnings: options.warnings });\n}\n\nfunction buildRouteEntries(\n tools: readonly GeneratedToolDefinition[],\n presentations: readonly ToolPresentationEnrichment[],\n): Array<{ path: string[]; tool: GeneratedToolDefinition; presentation?: ToolPresentationEnrichment }> {\n const byName = new Map(presentations.map((presentation) => [presentation.mcpName, presentation]));\n const entries: Array<{ path: string[]; tool: GeneratedToolDefinition; presentation?: ToolPresentationEnrichment }> = [];\n for (const tool of tools) {\n const presentation = byName.get(tool.mcpName);\n entries.push({ path: tool.commandPath, tool, presentation });\n for (const alias of presentation?.aliases ?? []) {\n entries.push({ path: alias.split(/\\s+/).filter(Boolean), tool, presentation });\n }\n }\n return entries;\n}\n\nfunction isPrefix(prefix: string[], values: string[]): boolean {\n return prefix.every((value, index) => values[index] === value);\n}\n\nfunction findRestStart(argv: string[], commandPath: string[]): number {\n let matched = 0;\n for (let index = 0; index < argv.length; index += 1) {\n if (!argv[index]?.startsWith(\"-\")) {\n if (argv[index] !== commandPath[matched]) {\n return index;\n }\n matched += 1;\n if (matched === commandPath.length) {\n return index + 1;\n }\n }\n }\n return argv.length;\n}\n","import { readFile, stat } from \"node:fs/promises\";\nimport { basename, extname } from \"node:path\";\nimport { McpRpcClient } from \"../mcp/rpcClient\";\nimport { unwrapMcpToolPayload } from \"../mcp/toolPayload\";\n\nexport interface AttachmentUploadFileInput {\n path: string;\n filename?: string;\n contentType?: string;\n}\n\nexport interface UploadAttachmentsInput {\n documentUuid: string;\n files: AttachmentUploadFileInput[];\n maxBytes?: number;\n ttlSeconds?: number;\n requestToolName?: string;\n commitToolName?: string;\n fetchImpl?: typeof fetch;\n onProgress?: (progress: AttachmentUploadProgress) => void;\n}\n\nexport type AttachmentUploadStage = \"token\" | \"put\" | \"register\" | \"done\";\n\nexport interface AttachmentUploadProgress {\n stage: AttachmentUploadStage;\n path: string;\n filename: string;\n index: number;\n total: number;\n}\n\nexport interface RegisteredAttachmentFile {\n path: string;\n documentUuid: string;\n filename: string;\n storageKey: string;\n contentType: string;\n sizeBytes: number;\n registerResult: unknown;\n}\n\nexport interface UploadAttachmentsResult {\n count: number;\n uploaded: RegisteredAttachmentFile[];\n}\n\nexport class AttachmentUploadError extends Error {\n constructor(\n readonly code: string,\n message: string,\n readonly details?: unknown,\n ) {\n super(message);\n }\n}\n\nexport async function uploadAttachments(\n client: McpRpcClient,\n input: UploadAttachmentsInput,\n): Promise<UploadAttachmentsResult> {\n if (!input.documentUuid.trim()) {\n throw new AttachmentUploadError(\"MISSING_REQUIRED_FLAG\", \"Missing required argument \\\"documentUuid\\\".\", {\n flag: \"--document-uuid\",\n });\n }\n if (input.files.length === 0) {\n throw new AttachmentUploadError(\"MISSING_FILE\", \"Expected at least one file to upload.\");\n }\n\n const fetchImpl = input.fetchImpl ?? fetch;\n const uploaded: RegisteredAttachmentFile[] = [];\n\n for (let index = 0; index < input.files.length; index += 1) {\n const file = input.files[index];\n if (!file) {\n continue;\n }\n uploaded.push(await uploadSingleAttachment(client, file, {\n documentUuid: input.documentUuid,\n maxBytes: input.maxBytes,\n ttlSeconds: input.ttlSeconds,\n requestToolName: input.requestToolName ?? \"mcp__ainecto__request_upload_token\",\n commitToolName: input.commitToolName ?? \"mcp__ainecto__upload_attachments\",\n fetchImpl,\n onProgress: input.onProgress,\n index,\n total: input.files.length,\n }));\n }\n\n return { count: uploaded.length, uploaded };\n}\n\ninterface SingleUploadContext {\n documentUuid: string;\n maxBytes?: number;\n ttlSeconds?: number;\n requestToolName: string;\n commitToolName: string;\n fetchImpl: typeof fetch;\n onProgress?: (progress: AttachmentUploadProgress) => void;\n index: number;\n total: number;\n}\n\ninterface UploadTokenResponse {\n token: string;\n uploadUrl: string;\n storageKey: string;\n}\n\ninterface UploadPutResponse {\n storageKey: string;\n sizeBytes: number;\n contentType: string;\n}\n\nasync function uploadSingleAttachment(\n client: McpRpcClient,\n file: AttachmentUploadFileInput,\n context: SingleUploadContext,\n): Promise<RegisteredAttachmentFile> {\n const metadata = await readFileMetadata(file);\n emitProgress(context, \"token\", file.path, metadata.filename);\n const uploadToken = await requestUploadToken(client, metadata, context);\n\n emitProgress(context, \"put\", file.path, metadata.filename);\n const putResult = await putAttachmentBytes(uploadToken, metadata, context.fetchImpl);\n validatePutResult(uploadToken, metadata, putResult);\n\n const item = {\n documentUuid: context.documentUuid,\n filename: metadata.filename,\n storageKey: uploadToken.storageKey,\n contentType: putResult.contentType,\n sizeBytes: putResult.sizeBytes,\n };\n\n emitProgress(context, \"register\", file.path, metadata.filename);\n const registerResult = await client.toolsCall(context.commitToolName, { items: [item] });\n\n emitProgress(context, \"done\", file.path, metadata.filename);\n return {\n path: file.path,\n documentUuid: context.documentUuid,\n filename: metadata.filename,\n storageKey: uploadToken.storageKey,\n contentType: putResult.contentType,\n sizeBytes: putResult.sizeBytes,\n registerResult,\n };\n}\n\nasync function readFileMetadata(file: AttachmentUploadFileInput): Promise<{\n bytes: Buffer;\n filename: string;\n contentType: string;\n sizeBytes: number;\n}> {\n const stats = await stat(file.path);\n if (!stats.isFile()) {\n throw new AttachmentUploadError(\"INVALID_FILE\", `Attachment path is not a file: ${file.path}`, { path: file.path });\n }\n const bytes = await readFile(file.path);\n return {\n bytes,\n filename: file.filename ?? basename(file.path),\n contentType: file.contentType ?? detectContentType(file.path),\n sizeBytes: bytes.byteLength,\n };\n}\n\nasync function requestUploadToken(\n client: McpRpcClient,\n metadata: { filename: string; contentType: string; sizeBytes: number },\n context: SingleUploadContext,\n): Promise<UploadTokenResponse> {\n const scopeJson = JSON.stringify({\n documentUuid: context.documentUuid,\n filename: metadata.filename,\n contentType: metadata.contentType,\n sizeBytes: metadata.sizeBytes,\n });\n const requestArgs: Record<string, unknown> = {\n purpose: \"attachment.upload\",\n scopeJson,\n };\n if (context.maxBytes !== undefined) {\n requestArgs.maxBytes = context.maxBytes;\n }\n if (context.ttlSeconds !== undefined) {\n requestArgs.ttlSeconds = context.ttlSeconds;\n }\n\n const response = unwrapMcpToolPayload(await client.toolsCall(context.requestToolName, requestArgs));\n if (!isRecord(response)) {\n throw new AttachmentUploadError(\"UPLOAD_TOKEN_PROTOCOL_ERROR\", \"request_upload_token response was not an object.\");\n }\n const token = response.token;\n const uploadUrl = response.uploadUrl;\n const storageKey = response.storageKey;\n if (typeof token !== \"string\" || token.length === 0) {\n throw new AttachmentUploadError(\"UPLOAD_TOKEN_PROTOCOL_ERROR\", \"request_upload_token response did not include token.\");\n }\n if (typeof uploadUrl !== \"string\" || uploadUrl.length === 0) {\n throw new AttachmentUploadError(\"UPLOAD_TOKEN_PROTOCOL_ERROR\", \"request_upload_token response did not include uploadUrl.\");\n }\n if (typeof storageKey !== \"string\" || storageKey.length === 0) {\n throw new AttachmentUploadError(\"UPLOAD_TOKEN_PROTOCOL_ERROR\", \"request_upload_token response did not include storageKey.\");\n }\n return { token, uploadUrl, storageKey };\n}\n\nasync function putAttachmentBytes(\n token: UploadTokenResponse,\n metadata: { bytes: Buffer; contentType: string },\n fetchImpl: typeof fetch,\n): Promise<UploadPutResponse> {\n const maxAttempts = 3;\n let lastRetryableError: unknown;\n for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {\n try {\n const response = await fetchImpl(token.uploadUrl, {\n method: \"PUT\",\n headers: {\n authorization: `Bearer ${token.token}`,\n \"content-type\": metadata.contentType,\n },\n body: new Uint8Array(metadata.bytes),\n });\n if (shouldRetryResponse(response.status) && attempt < maxAttempts) {\n continue;\n }\n if (!response.ok) {\n throw uploadHttpError(response.status);\n }\n return parsePutResponse(await response.text());\n } catch (error) {\n if (error instanceof AttachmentUploadError) {\n throw error;\n }\n lastRetryableError = error;\n if (attempt === maxAttempts) {\n break;\n }\n }\n }\n throw new AttachmentUploadError(\"ATTACHMENT_UPLOAD_FAILED\", \"Attachment upload failed.\", {\n cause: lastRetryableError instanceof Error ? lastRetryableError.message : String(lastRetryableError),\n });\n}\n\nfunction uploadHttpError(status: number): AttachmentUploadError {\n if (status === 409) {\n return new AttachmentUploadError(\"ATTACHMENT_UPLOAD_CONFLICT\", \"Attachment upload failed with HTTP 409 Conflict.\", { status });\n }\n if (status === 401 || status === 403) {\n return new AttachmentUploadError(\"ATTACHMENT_UPLOAD_TOKEN_EXPIRED\", `Attachment upload token was rejected with HTTP ${status}.`, { status });\n }\n return new AttachmentUploadError(\"ATTACHMENT_UPLOAD_HTTP_ERROR\", `Attachment upload failed with HTTP ${status}.`, { status });\n}\n\nfunction shouldRetryResponse(status: number): boolean {\n return status === 429 || status >= 500;\n}\n\nfunction parsePutResponse(text: string): UploadPutResponse {\n let parsed: unknown;\n try {\n parsed = JSON.parse(text);\n } catch {\n throw new AttachmentUploadError(\"ATTACHMENT_UPLOAD_PROTOCOL_ERROR\", \"Attachment PUT response was not valid JSON.\");\n }\n if (!isRecord(parsed)) {\n throw new AttachmentUploadError(\"ATTACHMENT_UPLOAD_PROTOCOL_ERROR\", \"Attachment PUT response was not an object.\");\n }\n if (typeof parsed.storageKey !== \"string\") {\n throw new AttachmentUploadError(\"ATTACHMENT_UPLOAD_PROTOCOL_ERROR\", \"Attachment PUT response did not include storageKey.\");\n }\n if (typeof parsed.sizeBytes !== \"number\" || !Number.isFinite(parsed.sizeBytes)) {\n throw new AttachmentUploadError(\"ATTACHMENT_UPLOAD_PROTOCOL_ERROR\", \"Attachment PUT response did not include numeric sizeBytes.\");\n }\n if (typeof parsed.contentType !== \"string\") {\n throw new AttachmentUploadError(\"ATTACHMENT_UPLOAD_PROTOCOL_ERROR\", \"Attachment PUT response did not include contentType.\");\n }\n return {\n storageKey: parsed.storageKey,\n sizeBytes: parsed.sizeBytes,\n contentType: parsed.contentType,\n };\n}\n\nfunction validatePutResult(\n token: UploadTokenResponse,\n metadata: { sizeBytes: number },\n putResult: UploadPutResponse,\n): void {\n if (putResult.storageKey !== token.storageKey) {\n throw new AttachmentUploadError(\"ATTACHMENT_UPLOAD_STORAGE_KEY_MISMATCH\", \"Attachment PUT response storageKey did not match the upload token.\", {\n expected: token.storageKey,\n actual: putResult.storageKey,\n });\n }\n if (putResult.sizeBytes !== metadata.sizeBytes) {\n throw new AttachmentUploadError(\"ATTACHMENT_UPLOAD_SIZE_MISMATCH\", \"Attachment PUT response sizeBytes did not match the local file size.\", {\n expected: metadata.sizeBytes,\n actual: putResult.sizeBytes,\n });\n }\n}\n\nfunction emitProgress(\n context: SingleUploadContext,\n stage: AttachmentUploadStage,\n path: string,\n filename: string,\n): void {\n context.onProgress?.({\n stage,\n path,\n filename,\n index: context.index,\n total: context.total,\n });\n}\n\nfunction detectContentType(path: string): string {\n const extension = extname(path).toLowerCase();\n return MIME_BY_EXTENSION[extension] ?? \"application/octet-stream\";\n}\n\nconst MIME_BY_EXTENSION: Record<string, string> = {\n \".avif\": \"image/avif\",\n \".csv\": \"text/csv\",\n \".gif\": \"image/gif\",\n \".htm\": \"text/html\",\n \".html\": \"text/html\",\n \".jpeg\": \"image/jpeg\",\n \".jpg\": \"image/jpeg\",\n \".json\": \"application/json\",\n \".md\": \"text/markdown\",\n \".pdf\": \"application/pdf\",\n \".png\": \"image/png\",\n \".svg\": \"image/svg+xml\",\n \".txt\": \"text/plain\",\n \".webp\": \"image/webp\",\n \".xls\": \"application/vnd.ms-excel\",\n \".xlsx\": \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n \".zip\": \"application/zip\",\n};\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","/**\n * MCP 도구 결과 → 도구가 돌려준 JSON 객체. 서버는 결과를 `content[].text` 에 JSON 문자열로 싣는다(뒤에 안내 문장이 붙을 수 있다).\n * JSON 으로 시작하는 첫 text 를 읽고, 못 읽으면 받은 값을 그대로 돌려준다.\n */\nexport function unwrapMcpToolPayload(value: unknown): unknown {\n if (!isRecord(value) || !Array.isArray(value.content)) {\n return value;\n }\n const text = value.content\n .map((item) => isRecord(item) && typeof item.text === \"string\" ? item.text : \"\")\n .find((itemText) => itemText.trim().startsWith(\"{\"));\n if (!text) {\n return value;\n }\n try {\n return JSON.parse(text) as unknown;\n } catch {\n return value;\n }\n}\n\n/** 도구가 거부했을 때 사람이 읽을 사유 — content text 를 이어 붙인다. */\nexport function toolErrorText(value: unknown): string {\n if (!isRecord(value) || !Array.isArray(value.content)) {\n return \"The tool returned an error.\";\n }\n const text = value.content\n .map((item) => isRecord(item) && typeof item.text === \"string\" ? item.text : \"\")\n .filter(Boolean)\n .join(\"\\n\");\n return text || \"The tool returned an error.\";\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * 응답 모양을 단정하지 않고 «uuid 와 name 을 가진 객체의 배열»을 찾는다(list_projects 등).\n * ⚠도구 응답 포맷을 여기 박아 두면 서버가 한 겹 감싸는 순간 조용히 빈 목록이 된다.\n */\nexport function extractProjects(value: unknown): Array<{ uuid: string; name: string }> {\n const candidates: unknown[] = Array.isArray(value)\n ? value\n : isRecord(value)\n ? [\"projects\", \"items\", \"created\", \"data\", \"hits\"].flatMap((key) => {\n const nested = value[key];\n return Array.isArray(nested) ? nested : [];\n })\n : [];\n const projects: Array<{ uuid: string; name: string }> = [];\n for (const candidate of candidates) {\n if (isRecord(candidate) && typeof candidate.uuid === \"string\") {\n projects.push({\n uuid: candidate.uuid,\n name: typeof candidate.name === \"string\" ? candidate.name : candidate.uuid,\n });\n }\n }\n return projects;\n}\n","import type { McpRpcClient } from \"../../core/mcp/rpcClient\";\nimport {\n uploadAttachments,\n type AttachmentUploadProgress,\n type UploadAttachmentsResult,\n} from \"../../core/upload/attachmentUpload\";\nimport { renderSuccess } from \"../../core/output/render\";\nimport { CliCommandError } from \"./errors\";\nimport { ATTACHMENTS_UPLOAD_COMMAND_PATH } from \"./bespokeCommands\";\n\nexport interface AttachmentsUploadCommandOptions {\n argv: string[];\n client: McpRpcClient;\n json: boolean;\n io: {\n stdout: NodeJS.WriteStream;\n stderr: NodeJS.WriteStream;\n };\n}\n\nexport function isAttachmentsUploadCommand(domain: string | undefined, action: string | undefined): boolean {\n return domain === ATTACHMENTS_UPLOAD_COMMAND_PATH[0] && action === ATTACHMENTS_UPLOAD_COMMAND_PATH[1];\n}\n\nexport async function executeAttachmentsUploadCommand(options: AttachmentsUploadCommandOptions): Promise<number> {\n const parsed = parseAttachmentsUploadArgs(options.argv);\n const result = await uploadAttachments(options.client, {\n documentUuid: parsed.documentUuid,\n files: parsed.files.map((path) => ({\n path,\n filename: parsed.filename,\n contentType: parsed.contentType,\n })),\n maxBytes: parsed.maxBytes,\n ttlSeconds: parsed.ttlSeconds,\n onProgress: options.json ? undefined : (progress) => {\n renderProgress(progress, options.io.stderr);\n },\n });\n\n options.io.stdout.write(renderAttachmentUploadResult(result, options.json));\n return 0;\n}\n\ninterface ParsedAttachmentsUploadArgs {\n documentUuid: string;\n files: string[];\n filename?: string;\n contentType?: string;\n maxBytes?: number;\n ttlSeconds?: number;\n}\n\nfunction parseAttachmentsUploadArgs(argv: string[]): ParsedAttachmentsUploadArgs {\n const files: string[] = [];\n let documentUuid: string | undefined;\n let filename: string | undefined;\n let contentType: string | undefined;\n let maxBytes: number | undefined;\n let ttlSeconds: number | undefined;\n let readFilesOnly = false;\n\n for (let index = 0; index < argv.length; index += 1) {\n const arg = argv[index];\n if (!arg) {\n continue;\n }\n if (readFilesOnly) {\n files.push(arg);\n continue;\n }\n if (arg === \"--\") {\n readFilesOnly = true;\n continue;\n }\n if (arg === \"--document-uuid\" || arg === \"--documentUuid\") {\n documentUuid = requireValue(arg, argv[++index]);\n continue;\n }\n if (arg === \"--filename\" || arg === \"--name\") {\n filename = requireValue(arg, argv[++index]);\n continue;\n }\n if (arg === \"--content-type\" || arg === \"--contentType\") {\n contentType = requireValue(arg, argv[++index]);\n continue;\n }\n if (arg === \"--max-bytes\" || arg === \"--maxBytes\") {\n maxBytes = parsePositiveInteger(arg, requireValue(arg, argv[++index]));\n continue;\n }\n if (arg === \"--ttl-seconds\" || arg === \"--ttlSeconds\") {\n ttlSeconds = parsePositiveInteger(arg, requireValue(arg, argv[++index]));\n continue;\n }\n if (arg.startsWith(\"--\")) {\n throw new CliCommandError(\"UNKNOWN_FLAG\", `Unknown flag ${arg} for attachments upload.`, { flag: arg });\n }\n files.push(arg);\n }\n\n if (!documentUuid) {\n throw new CliCommandError(\"MISSING_REQUIRED_FLAG\", \"Missing required argument \\\"documentUuid\\\" for attachments upload.\", {\n flag: \"--document-uuid\",\n });\n }\n if (files.length === 0) {\n throw new CliCommandError(\"MISSING_FILE\", \"Expected at least one file to upload.\");\n }\n if (filename && files.length !== 1) {\n throw new CliCommandError(\"INVALID_FLAG_VALUE\", \"--filename/--name can only be used with exactly one file.\", {\n flag: \"--filename\",\n files: files.length,\n });\n }\n\n return {\n documentUuid,\n files,\n filename,\n contentType,\n maxBytes,\n ttlSeconds,\n };\n}\n\nfunction parsePositiveInteger(flag: string, value: string): number {\n if (!/^[1-9]\\d*$/.test(value)) {\n throw new CliCommandError(\"INVALID_FLAG_VALUE\", `${flag} must be a positive integer.`, { flag, value });\n }\n return Number.parseInt(value, 10);\n}\n\nfunction requireValue(flag: string, value: string | undefined): string {\n if (!value || value.startsWith(\"--\")) {\n throw new CliCommandError(\"FLAG_REQUIRES_VALUE\", `${flag} requires a value.`, { flag });\n }\n return value;\n}\n\nfunction renderProgress(progress: AttachmentUploadProgress, stderr: NodeJS.WriteStream): void {\n if (progress.stage === \"token\") {\n stderr.write(`Uploading ${progress.filename} (${progress.index + 1}/${progress.total})...\\n`);\n }\n}\n\nfunction renderAttachmentUploadResult(result: UploadAttachmentsResult, json: boolean): string {\n if (json) {\n return renderSuccess(result, { json });\n }\n const lines = [\n `Uploaded ${result.count} attachment${result.count === 1 ? \"\" : \"s\"}.`,\n ...result.uploaded.map((file) => `- ${file.filename} (${file.sizeBytes} bytes)`),\n ];\n return renderSuccess(lines.join(\"\\n\"), { json: false });\n}\n","/**\n * 알림·할 일 «폴링» 명령 — 사람이 cron/launchd 에 걸어 «새 것이 있을 때만» 에이전트를 깨우게 한다(사건 기록 S2, 설계 §6-4 (5)).\n *\n * ainecto notifications poll --cursor-file <path> [--kinds A,B] [--workspace <uuid>]... [--project <uuid>]... [--direct-only] [--limit N] [--json]\n * ainecto notifications ack --cursor-file <path> [--json]\n * ainecto agent-todos poll [--workspace <uuid>]... [--project <uuid>]... [--only-new --seen-file <path>] [--json]\n *\n * --workspace · --project 는 여러 번 줄 수 있다. 같은 축 안은 OR, 축 사이는 AND(서버가 판정).\n *\n * ★종료 코드: 0 = 새 항목 있음 · 3 = 새 항목 없음 · 1 = 오류 · 2 = 사용법 오류(기존 0/1/2 와 충돌하지 않는다).\n *\n * 알림 증분은 «받기 → (에이전트) → 성공했을 때만 ack» 다. poll 은 받은 배치와 ackToken 을 ★커서 파일에 먼저 저장(fsync)한 뒤\n * 출력하고, ack 전까지 다시 부르면 서버에 묻지 않고 ★같은 배치를 다시 출력한다 — 에이전트가 실패하면 다음 회차에 같은 것을\n * 다시 받는다. ack 는 파일의 보류 ackToken 을 서버에 보내고 파일에서 지운다. 서버 커서는 ack 로만 움직인다.\n *\n * 할 일은 «지금 열린 것» 의 상태 조회다. --only-new 는 본 할 일 id 를 로컬 파일에 적어 «처음 보는 것이 있을 때만» 0 을 낸다\n * (같은 할 일로 5분마다 에이전트를 깨우지 않게 — 서버 상태 0).\n */\nimport { mkdir, open, readFile, rename } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\nimport type { McpRpcClient } from \"../../core/mcp/rpcClient\";\nimport { isToolError } from \"../../core/mcp/rpcClient\";\nimport { toolErrorText, unwrapMcpToolPayload } from \"../../core/mcp/toolPayload\";\nimport { renderError, renderSuccess } from \"../../core/output/render\";\nimport { CliCommandError } from \"./errors\";\nimport { AGENT_TODOS_POLL_COMMAND_PATH, NOTIFICATIONS_ACK_COMMAND_PATH, NOTIFICATIONS_POLL_COMMAND_PATH } from \"./bespokeCommands\";\n\n/** 새 항목 없음 — 셸이 `&&` 로 에이전트 실행을 건너뛰게. */\nexport const EXIT_NOTHING_NEW = 3;\n\nconst LIST_NOTIFICATIONS = \"mcp__ainecto__list_notifications\";\nconst LIST_AGENT_TODOS = \"mcp__ainecto__list_agent_todos\";\n\nexport interface InboxCommandOptions {\n domain: string | undefined;\n action: string | undefined;\n argv: string[];\n client: McpRpcClient;\n json: boolean;\n io: { stdout: NodeJS.WriteStream; stderr: NodeJS.WriteStream };\n}\n\nexport function isInboxPollCommand(domain: string | undefined, action: string | undefined): boolean {\n return [NOTIFICATIONS_POLL_COMMAND_PATH, NOTIFICATIONS_ACK_COMMAND_PATH, AGENT_TODOS_POLL_COMMAND_PATH]\n .some(([d, a]) => d === domain && a === action);\n}\n\n/** 사용법 오류 — 종료 코드 2(설계 §6-4 (5)). */\nexport const EXIT_USAGE = 2;\nconst USAGE_ERRORS = new Set([\"UNKNOWN_FLAG\", \"FLAG_REQUIRES_VALUE\", \"MISSING_REQUIRED_FLAG\", \"INVALID_FLAG_VALUE\"]);\n\nexport async function executeInboxPollCommand(options: InboxCommandOptions): Promise<number> {\n try {\n if (options.domain === \"agent-todos\") return await agentTodosPoll(options);\n if (options.action === \"ack\") return await notificationsAck(options);\n return await notificationsPoll(options);\n } catch (error) {\n if (error instanceof CliCommandError && USAGE_ERRORS.has(error.code)) {\n options.io.stderr.write(renderError(error, { json: options.json }));\n return EXIT_USAGE;\n }\n throw error;\n }\n}\n\n// ── 알림 ────────────────────────────────────────────────────────────────\n\n/** 범위 필터 — 알림·할 일 공용. 두 축 모두 정렬·중복 제거된 집합(비면 undefined). */\ninterface ScopeFilter {\n workspaceUuids?: string[];\n projectUuids?: string[];\n}\n\ninterface PollFilter extends ScopeFilter {\n kinds?: string[];\n directOnly: boolean;\n}\n\n/** 0.7.0 커서 파일의 필터 모양 — 프로젝트가 하나뿐이던 때. 읽을 때 PollFilter 로 바꾼다. */\ninterface LegacyPollFilter extends PollFilter {\n projectUuid?: string;\n}\n\n/** 커서 파일 — 보류 중인 배치(ack 전)와 그 필터. 서버 위치는 서버가 기억한다(파일은 «아직 확인 안 한 것» 만 든다). */\ninterface CursorFile {\n v: 1;\n filter: PollFilter;\n stream?: string;\n ackToken?: string;\n pendingItems?: unknown[];\n}\n\nasync function notificationsPoll(options: InboxCommandOptions): Promise<number> {\n const flags = parseFlags(options.argv, [\"--cursor-file\", \"--kinds\", \"--workspace\", \"--project\", \"--limit\"], [\"--direct-only\"]);\n const cursorPath = requireFlag(flags, \"--cursor-file\", \"notifications poll\");\n const filter: PollFilter = {\n kinds: flags.values[\"--kinds\"]?.split(\",\").map((kind) => kind.trim()).filter(Boolean).sort(),\n ...scopeFilter(flags),\n directOnly: flags.switches.has(\"--direct-only\"),\n };\n if (filter.kinds?.length === 0) filter.kinds = undefined;\n const limit = flags.values[\"--limit\"] === undefined ? undefined : positiveInt(\"--limit\", flags.values[\"--limit\"]);\n\n const saved = await readCursorFile(cursorPath);\n if (saved?.ackToken && saved.pendingItems?.length) {\n if (!sameFilter(saved.filter, filter)) {\n throw new CliCommandError(\"PENDING_BATCH_OTHER_FILTER\",\n `${cursorPath} holds an unacknowledged batch for a different filter. Run \\`ainecto notifications ack --cursor-file ${cursorPath}\\` `\n + \"after handling it, or use another cursor file for this filter.\", { cursorFile: cursorPath });\n }\n // ★ack 전까지 같은 결과 — 서버에 묻지 않는다.\n options.io.stdout.write(renderSuccess({ items: saved.pendingItems, pending: true, stream: saved.stream }, { json: options.json }));\n return 0;\n }\n\n const result = await callTool(options.client, LIST_NOTIFICATIONS, {\n cursor: \"saved\",\n ...(filter.kinds ? { kinds: filter.kinds } : {}),\n ...scopeArgs(filter),\n ...(filter.directOnly ? { directOnly: true } : {}),\n ...(limit !== undefined ? { limit } : {}),\n });\n const items = Array.isArray(result.items) ? result.items : [];\n const stream = typeof result.stream === \"string\" ? result.stream : undefined;\n if (typeof result.retryAfterSeconds === \"number\") {\n options.io.stderr.write(`Polled too soon; try again in ${result.retryAfterSeconds}s.\\n`);\n return EXIT_NOTHING_NEW;\n }\n if (items.length === 0) {\n await writeCursorFile(cursorPath, { v: 1, filter, stream });\n if (options.json) options.io.stdout.write(renderSuccess({ items: [], stream }, { json: true }));\n return EXIT_NOTHING_NEW;\n }\n // ★출력보다 저장이 먼저 — 출력 뒤에 죽어도 다음 회차가 같은 배치를 다시 낸다.\n await writeCursorFile(cursorPath, {\n v: 1, filter, stream, ackToken: typeof result.ackToken === \"string\" ? result.ackToken : undefined, pendingItems: items,\n });\n options.io.stdout.write(renderSuccess({ items, hasMore: result.hasMore === true, stream }, { json: options.json }));\n return 0;\n}\n\nasync function notificationsAck(options: InboxCommandOptions): Promise<number> {\n const flags = parseFlags(options.argv, [\"--cursor-file\"], []);\n const cursorPath = requireFlag(flags, \"--cursor-file\", \"notifications ack\");\n const saved = await readCursorFile(cursorPath);\n if (!saved?.ackToken) {\n if (options.json) options.io.stdout.write(renderSuccess({ acked: false }, { json: true }));\n return EXIT_NOTHING_NEW;\n }\n // ack 는 다음 폴링 인자로 싣는다(서버 계약). 이번 응답의 다음 배치는 버린다 — ack 하지 않았으니 다음 poll 이 다시 받는다.\n await callTool(options.client, LIST_NOTIFICATIONS, {\n cursor: \"saved\",\n ack: saved.ackToken,\n ...(saved.filter.kinds ? { kinds: saved.filter.kinds } : {}),\n ...scopeArgs(saved.filter),\n ...(saved.filter.directOnly ? { directOnly: true } : {}),\n limit: 1,\n });\n const acked = saved.pendingItems?.length ?? 0;\n await writeCursorFile(cursorPath, { v: 1, filter: saved.filter, stream: saved.stream });\n options.io.stdout.write(renderSuccess({ acked: true, items: acked }, { json: options.json }));\n return 0;\n}\n\n// ── 할 일 ────────────────────────────────────────────────────────────────\n\nasync function agentTodosPoll(options: InboxCommandOptions): Promise<number> {\n const flags = parseFlags(options.argv, [\"--workspace\", \"--project\", \"--seen-file\"], [\"--only-new\"]);\n const scope = scopeArgs(scopeFilter(flags));\n const onlyNew = flags.switches.has(\"--only-new\");\n const seenPath = flags.values[\"--seen-file\"];\n if (onlyNew && !seenPath) {\n throw new CliCommandError(\"MISSING_REQUIRED_FLAG\", \"--only-new needs --seen-file <path>.\", { flag: \"--seen-file\" });\n }\n const items: Array<Record<string, unknown>> = [];\n let after: string | undefined;\n for (let page = 0; page < 20; page += 1) {\n const result = await callTool(options.client, LIST_AGENT_TODOS, { state: [\"OPEN\"], ...scope, limit: 50, ...(after ? { after } : {}) });\n const pageItems = Array.isArray(result.items) ? result.items.filter(isRecord) : [];\n items.push(...pageItems);\n const last = pageItems[pageItems.length - 1];\n if (result.hasMore !== true || !last || typeof last.todoId !== \"string\") break;\n after = last.todoId;\n }\n let shown = items;\n if (onlyNew && seenPath) {\n const seen = new Set(await readSeenFile(seenPath));\n shown = items.filter((item) => typeof item.todoId === \"string\" && !seen.has(item.todoId));\n // 본 목록 = 지금 열린 것(닫힌 것은 빠진다 — 파일이 끝없이 자라지 않게).\n await writeJsonAtomic(seenPath, items.map((item) => item.todoId).filter((id): id is string => typeof id === \"string\"));\n }\n if (shown.length === 0) {\n if (options.json) options.io.stdout.write(renderSuccess({ items: [] }, { json: true }));\n return EXIT_NOTHING_NEW;\n }\n options.io.stdout.write(renderSuccess({ items: shown }, { json: options.json }));\n return 0;\n}\n\n// ── 도우미 ──────────────────────────────────────────────────────────────\n\nasync function callTool(client: McpRpcClient, name: string, args: Record<string, unknown>): Promise<Record<string, unknown>> {\n const raw = await client.toolsCall(name, args);\n if (isToolError(raw)) {\n throw new CliCommandError(\"TOOL_ERROR\", toolErrorText(raw), { tool: name });\n }\n const payload = unwrapMcpToolPayload(raw);\n if (!isRecord(payload)) {\n throw new CliCommandError(\"MCP_PROTOCOL_ERROR\", `${name} did not return an object.`, { tool: name });\n }\n return payload;\n}\n\ninterface ParsedFlags {\n /** 값 플래그의 마지막 값. */\n values: Record<string, string | undefined>;\n /** 값 플래그의 모든 값(반복 가능한 플래그용, 준 순서). */\n lists: Record<string, string[]>;\n switches: Set<string>;\n}\n\n/** --workspace · --project(둘 다 반복) → 범위 필터. 정렬·중복 제거 — 같은 집합이면 같은 필터. */\nfunction scopeFilter(flags: ParsedFlags): ScopeFilter {\n const workspaces = uuidSet(flags.lists[\"--workspace\"]);\n const projects = uuidSet(flags.lists[\"--project\"]);\n return {\n ...(workspaces.length ? { workspaceUuids: workspaces } : {}),\n ...(projects.length ? { projectUuids: projects } : {}),\n };\n}\n\nfunction uuidSet(values: string[] | undefined): string[] {\n return [...new Set(values ?? [])].sort();\n}\n\n/**\n * 범위 필터 → 서버 인자 workspaceUuids · projectUuids(배열). ★준 축만 키로 싣는다(옛 서버는 모르는 필드를 거절한다).\n * 단 프로젝트 1개뿐이고 워크스페이스가 없으면 옛 단수 projectUuid 문자열 — 옛 서버도 아는 모양(이 경우만).\n */\nfunction scopeArgs(filter: ScopeFilter): Record<string, unknown> {\n const workspaces = filter.workspaceUuids ?? [];\n const projects = filter.projectUuids ?? [];\n if (workspaces.length === 0 && projects.length === 1) return { projectUuid: projects[0] };\n return {\n ...(workspaces.length ? { workspaceUuids: workspaces } : {}),\n ...(projects.length ? { projectUuids: projects } : {}),\n };\n}\n\nfunction parseFlags(argv: string[], valueFlags: string[], switchFlags: string[]): ParsedFlags {\n const values: Record<string, string | undefined> = {};\n const lists: Record<string, string[]> = {};\n const switches = new Set<string>();\n for (let index = 0; index < argv.length; index += 1) {\n const arg = argv[index];\n if (!arg) continue;\n if (valueFlags.includes(arg)) {\n const value = argv[index + 1];\n if (!value || value.startsWith(\"--\")) {\n throw new CliCommandError(\"FLAG_REQUIRES_VALUE\", `${arg} requires a value.`, { flag: arg });\n }\n values[arg] = value;\n (lists[arg] ??= []).push(value);\n index += 1;\n } else if (switchFlags.includes(arg)) {\n switches.add(arg);\n } else {\n throw new CliCommandError(\"UNKNOWN_FLAG\", `Unknown argument ${arg}.`, { flag: arg });\n }\n }\n return { values, lists, switches };\n}\n\nfunction requireFlag(flags: ParsedFlags, flag: string, command: string): string {\n const value = flags.values[flag];\n if (!value) throw new CliCommandError(\"MISSING_REQUIRED_FLAG\", `${command} needs ${flag} <path>.`, { flag });\n return value;\n}\n\nfunction positiveInt(flag: string, value: string | undefined): number {\n if (!value || !/^[1-9]\\d*$/.test(value)) {\n throw new CliCommandError(\"INVALID_FLAG_VALUE\", `${flag} must be a positive integer.`, { flag, value });\n }\n return Number.parseInt(value, 10);\n}\n\nfunction sameFilter(a: PollFilter, b: PollFilter): boolean {\n return JSON.stringify(a.kinds ?? []) === JSON.stringify(b.kinds ?? [])\n && JSON.stringify(a.workspaceUuids ?? []) === JSON.stringify(b.workspaceUuids ?? [])\n && JSON.stringify(a.projectUuids ?? []) === JSON.stringify(b.projectUuids ?? [])\n && a.directOnly === b.directOnly;\n}\n\n/** 0.7.0 파일의 projectUuid(문자열 1개)를 projectUuids 집합으로 — 옛 보류 배치도 같은 필터로 알아보고 ack 한다. */\nfunction normalizeSavedFilter(saved: LegacyPollFilter): PollFilter {\n const { projectUuid, ...rest } = saved;\n if (rest.projectUuids?.length || !projectUuid) return rest;\n return { ...rest, projectUuids: [projectUuid] };\n}\n\nasync function readCursorFile(path: string): Promise<CursorFile | undefined> {\n const text = await readFile(path, \"utf8\").catch((error: NodeJS.ErrnoException) => {\n if (error.code === \"ENOENT\") return undefined;\n throw error;\n });\n if (text === undefined || !text.trim()) return undefined;\n try {\n const parsed = JSON.parse(text) as CursorFile;\n if (parsed?.v !== 1 || !isRecord(parsed.filter)) throw new Error(\"shape\");\n return { ...parsed, filter: normalizeSavedFilter(parsed.filter) };\n } catch {\n throw new CliCommandError(\"INVALID_CURSOR_FILE\", `${path} is not a cursor file written by ainecto notifications poll.`, { cursorFile: path });\n }\n}\n\nasync function writeCursorFile(path: string, value: CursorFile): Promise<void> {\n await writeJsonAtomic(path, value);\n}\n\nasync function readSeenFile(path: string): Promise<string[]> {\n const text = await readFile(path, \"utf8\").catch((error: NodeJS.ErrnoException) => {\n if (error.code === \"ENOENT\") return undefined;\n throw error;\n });\n if (!text?.trim()) return [];\n try {\n const parsed = JSON.parse(text) as unknown;\n return Array.isArray(parsed) ? parsed.filter((id): id is string => typeof id === \"string\") : [];\n } catch {\n throw new CliCommandError(\"INVALID_SEEN_FILE\", `${path} is not a seen file written by ainecto agent-todos poll.`, { seenFile: path });\n }\n}\n\n/** 임시 파일에 쓰고 fsync 한 뒤 바꿔 끼운다 — 중간에 죽어도 반쯤 쓴 파일이 남지 않는다. */\nasync function writeJsonAtomic(path: string, value: unknown): Promise<void> {\n await mkdir(dirname(path), { recursive: true });\n const temp = `${path}.${process.pid}.tmp`;\n const handle = await open(temp, \"w\", 0o600);\n try {\n await handle.writeFile(`${JSON.stringify(value, null, 2)}\\n`, \"utf8\");\n await handle.sync();\n } finally {\n await handle.close();\n }\n await rename(temp, path);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { chmod, mkdir, rename, rm, rmdir, stat, writeFile } from \"node:fs/promises\";\nimport { dirname, join, relative, resolve, sep } from \"node:path\";\nimport { isDefaultEndpointFor } from \"../../core/config/endpoints\";\nimport { renderSuccess } from \"../../core/output/render\";\nimport {\n initRefusal,\n MANAGED_PATHS,\n planInit,\n planUndo,\n type FileWrite,\n type InitPlan,\n withCreatedDirectories,\n} from \"../../core/harness/initPlan\";\nimport { AGENT_NOTE_KEY, DOC_KEY, HARNESS_DOC_PATH, HARNESS_RECORD_PATH } from \"../../core/harness/harnessDoc\";\nimport { AGENT_TARGETS } from \"../../core/harness/agentTargets\";\nimport { fetchHarnessDocuments, type HarnessDocuments } from \"../../core/harness/documentFetch\";\nimport {\n assertInsideRepository,\n findGitRoot,\n readIfExists,\n readManagedFile,\n} from \"../../core/harness/repositoryFiles\";\n\nexport interface InitCommandOptions {\n argv: string[];\n endpoint: string;\n /**\n * 문서를 받을 때 쓸 토큰을 «필요할 때» 가져온다. 없으면 패키지 기본값으로 간다.\n *\n * <p>★지연 조회인 이유: {@code --undo} 는 순수한 로컬 작업인데, 예전엔 그마저도 토큰\n * 조회·갱신·저장을 먼저 돌렸다(2026-09-23 독립 재리뷰 S1). 로컬 되돌리기가 네트워크에\n * 의존하면, 서버가 죽은 날 되돌릴 수가 없다.\n */\n accessToken?: () => Promise<string | undefined>;\n /**\n * 브라우저 로그인(= {@code ainecto auth login} 과 같은 함수). 없으면 로그인하지 않는다.\n *\n * <p>★init 은 사람이나 에이전트가 «명시적으로» 친 명령이라 여기서 로그인한다. 브리지({@code ainecto mcp})는\n * 여전히 자동 로그인하지 않는다 — 세션 한가운데서 창이 뜨면 안 된다(설계 §8-4).\n */\n login?: () => Promise<void>;\n /** 시험용 주입. 기본은 전역 fetch. */\n fetchImpl?: typeof fetch;\n env: \"prod\" | \"dev\";\n cliVersion: string;\n cwd: string;\n json: boolean;\n io: { stdout: NodeJS.WriteStream; stderr: NodeJS.WriteStream };\n}\n\ninterface InitArgs {\n /** MCP 설정 파일도 쓴다(설계 결정 #6). 없으면 «우리 브리지 항목이 이미 있는» 파일만 갱신한다. */\n mcp: boolean;\n dryRun: boolean;\n undo: boolean;\n /** 0.7.x 의 플래그 — 받아서 무시한다(멈추지 않는다). 안내 한 줄에 이름을 싣는다. */\n ignored: string[];\n}\n\n/**\n * {@code ainecto init} — 이 저장소에 AiNecto 작업 규칙을 둔다(설계 §4-2, 0.8.0).\n *\n * <p>★<b>저장소 규칙만 한다.</b> 세션 역할도, 프로젝트 고르기·만들기도 없다 — 도구와 권한은 서버가\n * 사용자 권한으로 정하고, 저장소는 한 프로젝트에 묶이지 않는다. 기기 전역의 에이전트 연결은 {@code setup} 이다.\n * <ul>\n * <li>쓰는 것: {@code .ainecto/HARNESS.md} · {@code AGENTS.md} 관리 블록(·{@code CLAUDE.md} 가 있으면) ·\n * {@code .ainecto/config.json}(v2) · 기록.</li>\n * <li>MCP 설정 파일은 {@code --mcp} 일 때만 — 단 우리 브리지 항목이 이미 있으면 다시 쓴다(옛 {@code --role}\n * 제거 + 판 고정). 옛 저장소의 이행은 이 재실행 하나다.</li>\n * <li>{@code --dry-run} 도 서버 문서를 받는다 — 계획이 실제 실행과 같아야 한다(요구서 8장 P1).</li>\n * </ul>\n */\nexport async function executeInitCommand(options: InitCommandOptions): Promise<number> {\n const args = parseInitArgs(options.argv);\n if (args.ignored.length > 0) {\n options.io.stderr.write(\n `Ignored ${args.ignored.join(\", \")}: init no longer asks for a role or a project — `\n + \"every session sees the same tools and your AiNecto permissions decide what they may change.\\n\",\n );\n }\n const root = resolve(options.cwd);\n // ★하위 폴더에서 치면 멈춘다. 그 자리에 .mcp.json 을 쓰면 에이전트는 루트에서 그것을 못 본다.\n // undo 도 같은 이유로 루트에서만 한다(기록이 루트에 있다).\n const rootNotes = await repositoryRootNotes(root);\n const files = await readSnapshot(root);\n\n if (args.undo) {\n const plan = planUndo({ files });\n await applyPlan(root, plan, args.dryRun, files, false);\n options.io.stdout.write(renderSuccess(\n {\n action: args.dryRun ? \"undo (dry-run)\" : \"undo\",\n updated: plan.writes.map((write) => write.path),\n removed: plan.deletes,\n notes: [...rootNotes, ...plan.notes],\n },\n { json: options.json },\n ));\n return 0;\n }\n\n // ★<b>원격을 건드리기 «전»에 기록을 본다</b>(9차 1차 리뷰 B7) — 로그인 창을 띄운 뒤 거절하지 않는다.\n const refusal = initRefusal(files);\n if (refusal !== undefined) {\n throw new Error(refusal);\n }\n\n const signedIn = await ensureSignedIn(options, args.dryRun);\n const documents: HarnessDocuments = signedIn\n ? await fetchHarnessDocuments({\n endpoint: options.endpoint,\n accessToken: await options.accessToken?.(),\n // 서버가 문서의 클라이언트별 변형 키를 이 이름으로 찾는다.\n client: \"ainecto-cli\",\n fetchImpl: options.fetchImpl,\n })\n : { versions: {}, fallbacks: {}, unavailableReason: args.dryRun ? \"not signed in, and --dry-run does not sign in\" : \"not signed in\" };\n\n const plan = planInit({\n env: options.env,\n endpoint: options.endpoint,\n mcp: args.mcp,\n cliVersion: options.cliVersion,\n files,\n documents,\n });\n if (plan.refusal !== undefined) {\n // ★계획이 「멈춰라」고 하면 멈춘다(2026-09-27 8차 독립 리뷰 I1). 같은 함수라 위의 판정과 갈리지 않는다.\n throw new Error(plan.refusal);\n }\n await applyPlan(root, plan, args.dryRun, files);\n\n const mcpWritten = plan.writes.some((write) => AGENT_TARGETS.some((target) => target.path === write.path));\n options.io.stdout.write(renderSuccess(\n {\n action: args.dryRun ? \"init (dry-run)\" : \"init\",\n endpoint: options.endpoint,\n written: plan.writes.map((write) => `${write.existed ? \"updated\" : \"created\"} ${write.path}`),\n // ⚠조용히 기본값으로 떨어지지 않는다 — 서버에서 규칙을 고쳐도 안 바뀌는 이유를 사용자가 영영 못 찾는다.\n // ★요청 자체의 실패와 «문서별» 되돌림을 둘 다, 어느 «파일»이 그 글을 받는지까지 적는다.\n notes: [...rootNotes, ...plan.notes, ...fallbackNotes(documents, args.dryRun)],\n next: [\n `Read ${HARNESS_DOC_PATH} first. Every session sees the same AiNecto tools; your AiNecto permissions decide what they may change.`,\n mcpWritten\n ? \"Claude Code and Cursor pick up the repository's MCP config in a new session.\"\n : \"To connect your coding agents on this machine, run `ainecto setup` once\"\n + \" (or re-run init with --mcp to also write this repository's .mcp.json and .cursor/mcp.json).\",\n \"Undo everything with: ainecto init --undo\",\n ],\n },\n { json: options.json },\n ));\n return 0;\n}\n\n/**\n * 패키지 기본값을 쓴 사실과 그 이유 — ★어느 파일이 그 글을 받는지까지. 없으면 빈 배열.\n * dry-run 이면 «실제 실행과 다를 수 있다»를 붙인다(서버 판을 못 받았으므로).\n */\nfunction fallbackNotes(documents: HarnessDocuments, dryRun: boolean): string[] {\n const filesOf: Record<string, string> = {\n [DOC_KEY]: HARNESS_DOC_PATH,\n [AGENT_NOTE_KEY]: \"AGENTS.md / CLAUDE.md\",\n };\n const caveat = dryRun ? \" — the real run may write the server's version instead\" : \"\";\n const reasons: Record<string, string> = documents.unavailableReason\n ? { [DOC_KEY]: documents.unavailableReason, [AGENT_NOTE_KEY]: documents.unavailableReason }\n : documents.fallbacks;\n return Object.entries(reasons).map(([key, reason]) =>\n `${filesOf[key] ?? key}: written from this package's default ${key}, not the server's (${reason})${caveat}.`);\n}\n\n/**\n * ★<b>문서를 받기 전에 로그인을 확인한다.</b> 토큰이 없으면(만료 + refresh 없음 포함) 브라우저 로그인을\n * 하고 이어서 진행한다(합격 시나리오 4). 로그인됐으면 true.\n *\n * <p>⚠{@code --dry-run} 은 브라우저를 띄우지도 토큰을 갱신하지도 않는다 — 「아무것도 바꾸지 않는다」는\n * 약속에 사용자의 로그인 상태도 든다. 그때는 false 를 돌려주고, 계획은 패키지 기본값 기준임을 파일별로 적는다.\n */\nasync function ensureSignedIn(options: InitCommandOptions, dryRun: boolean): Promise<boolean> {\n if (await options.accessToken?.()) {\n return true;\n }\n if (dryRun || options.login === undefined) {\n if (dryRun) {\n options.io.stderr.write(`No usable AiNecto sign-in, so this plan uses the package's default rules. Sign in with: ${loginCommand(options)}\\n`);\n }\n return false;\n }\n await options.login();\n options.io.stderr.write(\"Signed in.\\n\");\n return true;\n}\n\n/**\n * 저장소 루트 판정. 하위 폴더면 멈추고(던진다), git 저장소가 아니면 그 사실을 note 로 돌려준다.\n *\n * <p>★{@code .git} 은 디렉터리 «또는 파일»이다 — worktree·submodule 은 파일이다. {@code git} 실행\n * 파일에는 기대지 않는다. git 이 아니면 멈추지 않는다: git 을 안 쓰는 사용자가 있고, 그 경우엔\n * 가리킬 «진짜 루트»가 없다(설계 §6-1).\n */\nasync function repositoryRootNotes(cwd: string): Promise<string[]> {\n const gitRoot = await findGitRoot(cwd);\n if (gitRoot === undefined) {\n // (init·undo 둘 다 이 note 를 쓴다 — «설정했다»가 아니라 «어디를 기준으로 삼았나»를 말한다.)\n return [`${cwd} is not inside a git repository, so this folder was used as the repository root.`];\n }\n if (gitRoot !== cwd) {\n throw new Error(\n `This folder is inside the git repository at ${gitRoot}, not at its root. `\n + \"Agents read their MCP config from the repository root, so run init there:\\n\\n\"\n + ` cd ${gitRoot}\\n\\n`\n + \"Nothing was changed.\",\n );\n }\n return [];\n}\n\n/**\n * 이 서버에 맞는 로그인 명령 한 줄. ★<b>만드는 곳은 여기 하나다.</b>\n *\n * <p>⚠주소든 env 든 <b>하나는 반드시</b> 실린다 — 안 실으면 dev 에서 막힌 사람이 «운영»에 로그인한다\n * (2026-09-23 4차 독립 리뷰 S2).\n */\nexport function loginCommand(options: Pick<InitCommandOptions, \"env\" | \"endpoint\">): string {\n const target = isDefaultEndpointFor(options.env, options.endpoint)\n ? (options.env === \"prod\" ? \"\" : ` --env ${options.env}`)\n : ` --endpoint ${options.endpoint}`;\n return `ainecto auth login${target}`;\n}\n\n/**\n * ★<b>읽기도 경계 검사를 먼저 통과한다.</b> 예전엔 스냅샷을 다 읽은 «뒤에» 경계를 봤다 —\n * 저장소 밖을 가리키는 링크의 내용을 한 번 읽고 나서 거절했다(2026-09-23 독립 재리뷰 I4).\n * 쓰기·삭제만 막으면 되는 게 아니다. 읽는 것도 남의 파일이다.\n */\nasync function readSnapshot(root: string): Promise<Map<string, string | undefined>> {\n const snapshot = new Map<string, string | undefined>();\n for (const path of MANAGED_PATHS) {\n snapshot.set(path, await readManagedFile(root, path));\n }\n return snapshot;\n}\n\n/**\n * 계획을 적용한다.\n *\n * <p>★<b>먼저 전부 검사하고, 그 다음에 쓴다.</b> 예전엔 한 파일씩 쓰다가 중간에 막히면\n * (권한 등) 앞 파일만 바뀐 채로 실패했다(2026-09-22 독립 리뷰 I5). 지금은 경계·링크·\n * 「스냅샷 이후 바뀌었는가」를 먼저 다 보고, 하나라도 걸리면 아무것도 안 쓴다.\n *\n * <p>⚠그래도 «쓰는 도중» 실패는 완전히 못 막는다(디스크 가득 등). 그때 무엇이 쓰였는지는\n * 오류에 적는다 — 조용히 반쪽 상태로 두지 않는다.\n */\nasync function applyPlan(\n root: string,\n plan: InitPlan,\n dryRun: boolean,\n snapshot: FileSnapshotMap,\n recordFirst = true,\n): Promise<void> {\n // ①먼저 «전부» 본다 — 하나라도 못 쓸 상황이면 아무것도 건드리지 않고 멈추는 게 낫다.\n for (const write of plan.writes) {\n await assertInsideRepository(root, write.path);\n await assertUnchangedSinceSnapshot(root, write.path, snapshot);\n }\n for (const path of plan.deletes) {\n await assertInsideRepository(root, path);\n await assertUnchangedSinceSnapshot(root, path, snapshot);\n }\n if (dryRun) {\n return;\n }\n const applied: string[] = [];\n try {\n // ★<b>복구 기록을 먼저 쓴다.</b> 예전엔 관리 기록(config.json)이 «마지막» 쓰기였다.\n // 그래서 중간에 실패하면 이미 바뀐 파일이 있는데 기록이 없어 undo 가 아무것도 못 되돌렸다\n // (2026-09-23 독립 재리뷰 I11). 되돌릴 수 있게 만드는 것이 첫 일이다.\n // ★되돌리기에서는 기록을 건드리는 일이 «작업 전체»의 마지막이다. 4차에서 config 를 쓰기\n // 목록의 뒤로 옮겼지만, 쓰기가 다 끝난 «뒤에» 삭제가 온다. 그래서 삭제가 실패하면 기록은\n // 이미 옛 파일로 돌아가 있고 되돌릴 근거가 없었다(2026-09-23 5차 독립 리뷰 I1).\n const isRecord = (path: string) => !recordFirst && path === HARNESS_RECORD_PATH;\n const recordWrites = plan.writes.filter((write) => isRecord(write.path));\n const recordDeletes = plan.deletes.filter((path) => isRecord(path));\n /**\n * ★<b>우리가 «실제로 만든» 디렉터리.</b> {@code mkdir(recursive)} 는 자기가 만든 가장 위\n * 디렉터리를 돌려주고, 이미 있었으면 undefined 를 준다 — 그게 우리가 알고 싶던 사실\n * 그 자체다. 이 칸의 진실원은 이 변수 하나이고, 계획은 여기에 관여하지 않는다.\n * (직전 실행에서 이어받은 것은 이미 기록에 있으므로 함께 들고 간다.)\n */\n const createdDirectories: string[] = [...(plan.record?.createdDirectories ?? [])];\n const rememberDirectories = (directories: readonly string[]) => {\n for (const directory of directories) {\n if (!createdDirectories.includes(directory)) {\n createdDirectories.push(directory);\n }\n }\n };\n /**\n * 기록의 디렉터리 칸을 «실제로 만든 것»으로 바로잡는다.\n *\n * <p>★성공했을 때만 하면 안 된다 — 중간에 실패해도 그 순간까지의 사실이 기록에 남아야\n * 한다. 예전엔 보정이 성공 경로에만 있어서, 만들기 «전»에 실패한 계획이 그대로 남고\n * 그 뒤 사용자가 만든 디렉터리를 다음 undo 가 지웠다(2026-09-27 6차 독립 리뷰 S1).\n *\n * <p>⚠기록 보정이 실패해도 원래 오류를 덮지 않는다. 같은 내용을 두 번 써도 무해하다.\n */\n const recordActualDirectories = async () => {\n const write = plan.writes.find((w) => w.path === HARNESS_RECORD_PATH);\n if (!recordFirst || !plan.record || !write || !applied.includes(HARNESS_RECORD_PATH)) {\n return;\n }\n await writeManagedFile(root, {\n ...write,\n content: withCreatedDirectories(write.content, createdDirectories),\n });\n };\n /**\n * 보정을 «삼키지 않는다». 다른 오류가 진행 중이면 그 오류를 살리고, 아니면 드러낸다.\n *\n * <p>★예전엔 무조건 삼켰다. 그러면 init 이 종료 0 을 돌려주는데 기록의 디렉터리 칸이\n * 비어 있고, 그 상태의 undo 는 우리가 만든 디렉터리를 남긴다 — 「성공」이 기록 완료를\n * 보증하지 않았다(2026-09-27 7차 독립 리뷰 S1).\n */\n const recordDirectoriesOrExplain = async (failing: boolean) => {\n try {\n await recordActualDirectories();\n } catch (error) {\n if (!failing) {\n throw error;\n }\n }\n };\n const apply = async (writes: readonly FileWrite[], deletes: readonly string[]) => {\n for (const write of writes) {\n // ②그리고 «쓰기 직전에» 다시 본다. ①과 실제 쓰기 사이에 누가 고칠 수 있다 — 그 틈으로\n // 남의 편집이 덮여 나갔다(같은 항목). 검사와 쓰기를 붙여 놓으면 창이 작아진다.\n await assertUnchangedSinceSnapshot(root, write.path, snapshot);\n await writeManagedFile(root, write, rememberDirectories);\n applied.push(write.path);\n }\n for (const path of deletes) {\n await assertUnchangedSinceSnapshot(root, path, snapshot);\n await rm(join(root, path), { force: true });\n applied.push(path);\n }\n };\n\n try {\n await apply(\n orderedWrites(plan.writes.filter((write) => !isRecord(write.path)), recordFirst),\n plan.deletes.filter((path) => !isRecord(path)),\n );\n await recordDirectoriesOrExplain(false);\n // 여기까지 전부 된 다음에만 기록을 줄이거나 지운다.\n await apply(recordWrites, recordDeletes);\n } catch (error) {\n await recordDirectoriesOrExplain(true);\n throw error;\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new Error(\n `${message}\\nAlready applied before this failure: ${applied.join(\", \") || \"(nothing)\"}`,\n );\n }\n // 우리가 «만든» 디렉터리가 비었으면 그것도 치운다.\n // ⛔recursive 로 지우지 않는다 — 사용자가 그 안에 둔 다른 파일까지 날아간다.\n // rmdir 는 «비어 있을 때만» 성공하므로, 비었는지는 파일시스템이 판정한다.\n // ★「비었으면 치운다」였을 때는 init 전부터 있던 빈 .cursor 까지 사라졌다\n // (2026-09-23 4차 독립 리뷰 S3). 비었다는 것과 우리 것이라는 것은 다른 사실이다.\n for (const directory of plan.removableDirectories ?? []) {\n await rmdir(join(root, directory)).catch(() => undefined);\n }\n}\n\n/**\n * 관리 기록을 맨 앞으로 옮긴 쓰기 순서.\n *\n * <p>★기록이 먼저 디스크에 있어야 그 뒤의 실패를 되돌릴 수 있다. 기록에 적힌 지문은\n * «쓰려던 내용»의 것이라, 못 쓴 파일은 지문이 안 맞아 undo 가 「손댔다」로 보고 남긴다 —\n * 안 만든 파일을 지우려 드는 것보다 안전한 쪽이다.\n */\nfunction orderedWrites(writes: readonly FileWrite[], recordFirst: boolean): FileWrite[] {\n const record = writes.filter((write) => write.path === HARNESS_RECORD_PATH);\n const rest = writes.filter((write) => write.path !== HARNESS_RECORD_PATH);\n // ★undo 에서는 «마지막»이다. undo 가 config 에 쓰는 것은 기록을 남기는 일이 아니라\n // 옛 파일로 «되돌리는» 일이라, 먼저 하면 나머지를 되돌릴 근거를 스스로 지운다\n // (2026-09-23 4차 독립 리뷰 I2). 같은 순서 규칙을 두 방향에 그대로 쓰면 안 된다.\n return recordFirst ? [...record, ...rest] : [...rest, ...record];\n}\n\n\n/** 파일을 읽은 뒤 우리가 네트워크를 기다리는 사이에 누가 고쳤으면, 그 변경을 덮지 않는다. */\nasync function assertUnchangedSinceSnapshot(\n root: string,\n relativePath: string,\n snapshot: FileSnapshotMap,\n): Promise<void> {\n if (!snapshot.has(relativePath)) {\n return;\n }\n const now = await readIfExists(join(root, relativePath));\n if (now !== snapshot.get(relativePath)) {\n throw new Error(\n `${relativePath} changed while init was running; nothing was written. Run init again.`,\n );\n }\n}\n\n/**\n * 임시 파일에 쓰고 바꿔 끼운다 — 도중에 죽어도 반쪽짜리 파일이 남지 않는다.\n *\n * <p>★<b>기존 파일의 권한을 그대로 가져간다.</b> rename 은 inode 를 «갈아치우므로», 그냥\n * 만들면 umask 기본값(보통 0644)이 된다. 남의 서버 설정에 환경변수가 들어 있는 0600 파일이\n * init 한 번에 0644 로 넓어졌다(2026-09-23 독립 재리뷰 N1). 내용을 합치는 일이 남의 파일\n * 접근 권한까지 바꾸면 안 된다.\n */\nasync function writeManagedFile(\n root: string,\n write: FileWrite,\n onDirectoriesCreated?: (directories: readonly string[]) => void,\n): Promise<string[]> {\n const absolutePath = join(root, write.path);\n const targetDirectory = dirname(absolutePath);\n const firstCreated = await mkdir(targetDirectory, { recursive: true });\n // ★<b>만든 사실을 «지금» 넘긴다.</b> 예전엔 반환값으로만 줬는데, 그 반환은 rename 뒤에\n // 일어난다 — 그 사이에 쓰기가 실패하면 «우리가 만든 디렉터리»라는 사실이 통째로 사라졌고,\n // 다음 init 의 mkdir 는 이미 있는 디렉터리에 undefined 를 주므로 회복도 못 했다\n // (2026-09-27 7차 독립 리뷰 S1). 만드는 것과 쓰는 것은 다른 일이다.\n const created = createdChain(root, firstCreated, targetDirectory);\n onDirectoriesCreated?.(created);\n const previousMode = await fileMode(absolutePath);\n const tmpPath = `${absolutePath}.${process.pid}.${Date.now()}.tmp`;\n // 임시 파일도 «처음부터» 좁게 만든다 — 넓게 만들었다가 좁히면 그 사이가 창이다.\n await writeFile(tmpPath, write.content, { encoding: \"utf8\", mode: previousMode ?? 0o600 });\n if (previousMode !== undefined) {\n await chmod(tmpPath, previousMode);\n }\n await rename(tmpPath, absolutePath);\n return created;\n}\n\n/**\n * 이번 {@code mkdir} 이 «정말 만든» 디렉터리들 — 저장소 기준 상대 경로, 깊은 것부터.\n *\n * <p>★{@code recursive: true} 는 자기가 만든 «가장 위» 디렉터리 하나만 돌려준다. 그 아래부터\n * 목표 디렉터리까지도 같이 만들어진 것이므로 구간 전체가 우리 것이다. 이미 있었으면\n * undefined 를 주므로 그때는 빈 목록이다 — <b>「있다」와 「우리가 만들었다」가 갈리는 지점</b>.\n */\nexport function createdChain(root: string, firstCreated: string | undefined, targetDirectory: string): string[] {\n if (firstCreated === undefined) {\n return [];\n }\n const stop = resolve(firstCreated);\n const made: string[] = [];\n for (let at = resolve(targetDirectory); ; at = dirname(at)) {\n const asRelative = relative(root, at);\n if (asRelative && !asRelative.startsWith(\"..\")) {\n made.push(asRelative.split(sep).join(\"/\"));\n }\n if (at === stop || dirname(at) === at) {\n break;\n }\n }\n return made;\n}\n\nasync function fileMode(absolutePath: string): Promise<number | undefined> {\n try {\n return (await stat(absolutePath)).mode & 0o7777;\n } catch (error) {\n if (isRecord(error) && error.code === \"ENOENT\") {\n return undefined;\n }\n throw error;\n }\n}\n\ntype FileSnapshotMap = Map<string, string | undefined>;\n\nfunction parseInitArgs(argv: string[]): InitArgs {\n const args: InitArgs = { mcp: false, dryRun: false, undo: false, ignored: [] };\n for (let index = 0; index < argv.length; index += 1) {\n const arg = argv[index];\n if (!arg) {\n continue;\n }\n if (arg === \"--mcp\") {\n args.mcp = true;\n } else if (arg === \"--dry-run\") {\n args.dryRun = true;\n } else if (arg === \"--undo\") {\n args.undo = true;\n } else if (arg === \"--project\" || arg === \"--project-name\") {\n // 0.7.x — 값까지 삼키고 무시한다. 값이 없으면 플래그만.\n const value = argv[index + 1];\n if (value !== undefined && !value.startsWith(\"--\")) {\n index += 1;\n }\n args.ignored.push(arg);\n } else if (arg === \"--yes\" || arg === \"-y\") {\n args.ignored.push(arg);\n } else if (arg === \"--json\") {\n // 전역 플래그 — 여기선 무시한다.\n } else {\n throw new Error(`Unknown argument: ${arg}`);\n }\n }\n return args;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { basename } from \"node:path\";\nimport { isDefaultEndpointFor } from \"../config/endpoints\";\nimport { bridgePackageSpec, PACKAGE_NAME } from \"../version\";\n\n/**\n * 「어느 에이전트의 어느 파일에 무엇을 적는가」.\n *\n * ★<b>MCP 항목은 «하나»만 쓴다</b> — 이름 {@link SERVER_NAME}, 브리지 {@code npx -y @ainecto/mcp@<판>}.\n * 세션 역할은 없다(0.8.0): 모든 세션이 같은 도구를 보고, 무엇을 할 수 있는지는 서버가 권한으로 정한다.\n *\n * <p>저장소 파일({@code .mcp.json}·{@code .cursor/mcp.json})은 {@code init --mcp} 가, 기기 전역 연결\n * (Claude Code 사용자 범위·Cursor 전역·Codex)은 {@code setup} 이 쓴다. 둘 다 이 파일의 항목 모양과\n * 소유 판정({@link isOurBridge})을 쓴다 — 기록 파일을 따로 두지 않는다.\n */\n\n/** 설정에 쓰는 서버 이름. ⛔env 에 따라 바꾸지 않는다 — 도구 접두사가 흔들리고 --undo 가 못 찾는다. */\nexport const SERVER_NAME = \"ainecto\";\n\nexport interface AgentTarget {\n id: \"claude-code\" | \"cursor\";\n label: string;\n /** 저장소 루트 기준 상대 경로. */\n path: string;\n}\n\nexport const AGENT_TARGETS: readonly AgentTarget[] = [\n { id: \"claude-code\", label: \"Claude Code\", path: \".mcp.json\" },\n { id: \"cursor\", label: \"Cursor\", path: \".cursor/mcp.json\" },\n];\n\nexport interface ServerEntryInput {\n /** \"prod\" 면 인자를 안 붙인다 — 기본값을 설정에 박으면 기본이 바뀔 때 거짓이 된다. */\n env?: \"prod\" | \"dev\";\n /**\n * 기본이 아닌 엔드포인트. ⚠<b>이걸 빠뜨리면</b> 문서가 가리키는 곳과 세션이 붙는 곳이\n * 달라진다(2026-09-22 독립 리뷰 I7).\n */\n endpoint?: string;\n /** 브리지 패키지 지정. 기본은 이 CLI 판으로 고정한 {@link bridgePackageSpec}. */\n packageSpec?: string;\n}\n\nexport interface McpServerEntry {\n command: string;\n args: string[];\n}\n\nexport function buildServerEntry(input: ServerEntryInput = {}): McpServerEntry {\n const args = [\"-y\", input.packageSpec ?? bridgePackageSpec()];\n if (input.env && input.env !== \"prod\") {\n args.push(\"--env\", input.env);\n }\n // ★«이 env 의» 기본 주소일 때만 생략한다. 넓은 기본 판정을 쓰면 dev 주소가 prod 로 해석된다.\n if (input.endpoint && !isDefaultEndpointFor(input.env ?? \"prod\", input.endpoint)) {\n args.push(\"--endpoint\", input.endpoint);\n }\n return { command: \"npx\", args };\n}\n\n/** 이 항목의 브리지가 옛 {@code --role} 을 싣고 있나 — doctor 의 «옛 설정 잔존» 판정이 쓴다. */\nexport function entryCarriesRole(entry: unknown): boolean {\n return isRecord(entry) && Array.isArray(entry.args) && entry.args.includes(\"--role\");\n}\n\n/** 이 항목이 고정한 브리지 판({@code @ainecto/mcp@X} 의 X). 고정하지 않았으면 undefined — doctor 의 «더 새 판» 판정. */\nexport function pinnedBridgeVersion(entry: unknown): string | undefined {\n if (!isRecord(entry) || !Array.isArray(entry.args)) {\n return undefined;\n }\n const pinned = entry.args.find((arg): arg is string => typeof arg === \"string\" && arg.startsWith(`${PACKAGE_NAME}@`));\n return pinned?.slice(PACKAGE_NAME.length + 1);\n}\n\nexport interface MergeResult {\n /** 적어 넣은 결과 JSON 문자열 (끝에 줄바꿈 포함). */\n content: string;\n /** 이 파일에 우리 항목이 이미 있었나 — 보고용. */\n replaced: boolean;\n /**\n * 우리가 «밀어낸» 원래 항목. ★undo 가 이것을 도로 넣는다.\n * 없으면 undefined — 그때는 undo 가 그냥 지운다.\n */\n replacedEntry?: unknown;\n}\n\n/**\n * 기존 설정을 살린 채 우리 항목 하나만 얹는다.\n *\n * ⚠<b>남의 서버 항목을 지우지 않는다.</b> 이 파일은 사용자의 것이고 우리는 한 칸을 빌릴 뿐이다.\n * 파싱이 안 되면 덮어쓰지 말고 던진다 — 읽을 수 없는 파일을 덮으면 사용자의 설정이 사라진다.\n */\n/**\n * 이 파일에 들어 있는 «우리» 서버 항목. 없거나 파일이 JSON 이 아니면 undefined.\n *\n * <p>undo 가 「우리가 쓴 그대로인가」를 보려고 쓴다 — 파일 «전체»가 아니라 우리가 소유한\n * 조각만 견주어야, 남이 다른 항목을 더한 것과 우리 항목을 손댄 것을 구별한다\n * (2026-09-23 독립 재리뷰 I8).\n */\nexport function readServerEntry(existing: string | undefined): unknown {\n if (existing === undefined) {\n return undefined;\n }\n try {\n const parsed = JSON.parse(existing) as { mcpServers?: unknown };\n const servers = parsed?.mcpServers;\n return isRecord(servers) ? servers[SERVER_NAME] : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * 이 항목이 우리 브리지({@code npx -y @ainecto/mcp[@판] …} · 전역 설치한 {@code ainecto})인가.\n * 옛 {@code --role} 을 싣는 것도 우리 브리지뿐이다(0.7.x 가 쓴 항목).\n */\nexport function isOurBridge(entry: unknown): boolean {\n if (!isRecord(entry)) {\n return false;\n }\n const { command, args } = entry as { command?: unknown; args?: unknown };\n const argList = Array.isArray(args) ? args.filter((arg): arg is string => typeof arg === \"string\") : [];\n const isOurPackage = (arg: string) => arg === PACKAGE_NAME || arg.startsWith(`${PACKAGE_NAME}@`);\n if (argList.some((arg) => isOurPackage(arg) || arg === \"--role\")) {\n return true;\n }\n const bin = typeof command === \"string\" ? basename(command) : \"\";\n return OUR_BINS.includes(bin);\n}\n\n/**\n * 전역 설치한 우리 명령 이름(package.json bin 중 브리지를 띄울 수 있는 것). ⚠{@code mcp} 는 넣지 않는다 —\n * 흔한 이름이라 남의 명령일 수 있고, 우리 브리지로 오인하면 남의 항목을 고쳐 쓰게 된다.\n */\nconst OUR_BINS: readonly string[] = [\"ainecto\"];\n\nexport function mergeServerEntry(existing: string | undefined, entry: McpServerEntry): MergeResult {\n const root = parseConfigObject(existing);\n const servers = readServers(root);\n const replaced = Object.prototype.hasOwnProperty.call(servers, SERVER_NAME);\n const replacedEntry = replaced ? servers[SERVER_NAME] : undefined;\n servers[SERVER_NAME] = entry;\n return { content: stringify({ ...root, mcpServers: servers }), replaced, replacedEntry };\n}\n\nexport interface RemoveResult {\n /** 우리 항목을 뺀 결과. 파일을 통째로 지워야 하면 undefined. */\n content?: string;\n removed: boolean;\n /** 우리 항목을 빼고 나니 아무것도 안 남았나. */\n emptied: boolean;\n}\n\n/**\n * 되돌릴 목표를 «감싸서» 받는다.\n *\n * <p>★{@code restoreEntry?: unknown} 과 {@code !== undefined} 조합은 <b>저장된 {@code null} 을\n * 「백업 없음」으로 바꾼다.</b> 사용자가 {@code \"ainecto\": null} 을 적어 두었고 우리가 그것을\n * 백업했다면, 되돌리기는 null 을 도로 넣어야 한다(2026-09-27 7차 독립 리뷰 I5).\n * 「값이 없다」와 「값이 null 이다」는 다른 사실이므로 그 둘을 한 자리에 담지 않는다.\n */\nexport interface RestoreEntry {\n value: unknown;\n}\n\nexport function removeServerEntry(existing: string | undefined, restore?: RestoreEntry): RemoveResult {\n if (existing === undefined) {\n return { removed: false, emptied: false };\n }\n const root = parseConfigObject(existing);\n const servers = readServers(root);\n const removed = Object.prototype.hasOwnProperty.call(servers, SERVER_NAME);\n if (restore !== undefined) {\n // ★우리가 밀어낸 사용자 항목을 도로 넣는다. 지우는 것이 아니라 «되돌리는» 것이다.\n servers[SERVER_NAME] = restore.value;\n return { content: stringify({ ...root, mcpServers: servers }), removed, emptied: false };\n }\n if (removed) {\n delete servers[SERVER_NAME];\n }\n const otherKeys = Object.keys(root).filter((key) => key !== \"mcpServers\");\n const emptied = Object.keys(servers).length === 0 && otherKeys.length === 0;\n return { content: stringify({ ...root, mcpServers: servers }), removed, emptied };\n}\n\n/**\n * {@code mcpServers} 를 읽는다. ⚠<b>모양이 틀리면 «조용히 버리지» 않는다</b> —\n * 배열이나 문자열이 들어 있는 설정을 {@code {}} 로 갈아 끼우면 사용자의 내용이 사라진다\n * (2026-09-22 독립 리뷰 I8). 이미 깨진 설정이어도 원문을 없애는 건 우리 일이 아니다.\n */\nfunction readServers(root: Record<string, unknown>): Record<string, unknown> {\n const servers = root.mcpServers;\n if (servers === undefined) {\n return {};\n }\n if (!isRecord(servers)) {\n throw new Error(\n \"Existing MCP config has an \\\"mcpServers\\\" value that is not an object, so it was left untouched. \"\n + \"Fix it by hand and run init again.\",\n );\n }\n return { ...servers };\n}\n\nfunction parseConfigObject(existing: string | undefined): Record<string, unknown> {\n if (existing === undefined || !existing.trim()) {\n return {};\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(existing);\n } catch (error) {\n throw new Error(\n `Existing MCP config is not valid JSON, so it was left untouched. Fix it by hand and run init again. (${\n error instanceof Error ? error.message : String(error)\n })`,\n );\n }\n if (!isRecord(parsed)) {\n throw new Error(\"Existing MCP config must be a JSON object; it was left untouched.\");\n }\n return parsed;\n}\n\nfunction stringify(value: unknown): string {\n return `${JSON.stringify(value, null, 2)}\\n`;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { SERVER_NAME } from \"./agentTargets\";\n\n/**\n * 저장소에 쓰는 글. ⚠<b>사용자 노출 문자열은 영어</b>로 쓴다 — 이 저장소의 기존 관례이고\n * (help·에러 메시지가 전부 영어) 공개 npm 패키지가 남의 저장소에 써 넣는 파일이다.\n * 주석·설계 메모만 한국어다.\n *\n * ★<b>권한·프로젝트를 여기 적지 않는다.</b> 세션 역할은 없고(0.8.0) 무엇을 할 수 있는지는 서버가\n * 사용자 권한으로 정한다. 저장소에 «한 프로젝트»를 묶지도 않는다 — 에이전트가 작업마다 대상을 찾는다.\n */\n\nexport const MARKER_BEGIN = \"<!-- ainecto:begin -->\";\nexport const MARKER_END = \"<!-- ainecto:end -->\";\n\ntype MarkerKind = \"begin\" | \"end\";\nconst MARKERS: Record<MarkerKind, string> = { begin: MARKER_BEGIN, end: MARKER_END };\n\n/** 하네스 폴더. */\nexport const HARNESS_DIR = \".ainecto\";\nexport const HARNESS_DOC_PATH = `${HARNESS_DIR}/HARNESS.md`;\nexport const HARNESS_CONFIG_PATH = `${HARNESS_DIR}/config.json`;\n\n/**\n * ★<b>되돌리기 기록의 자리. 이 파일은 «전부 우리 것»이다.</b>\n *\n * <p>예전엔 기록이 {@code config.json} 안에 살았다. 그 파일은 사용자도 칸을 더하고 고치는\n * 파일이라, 한 파일에 주인이 둘이었다 — 그래서 되돌리기가 매번 「이 칸이 누구 것인가」를\n * 판정해야 했고, <b>그 판정이 네 차수 연속 샜다</b>(2026-09-23 4차 I7 → 5차 I2·S3 →\n * 6차 I1·I3 → 2026-09-27 7차 I1·I2·I3).\n *\n * <p>기록을 우리 파일로 내보내면 그 질문 자체가 사라진다:\n * <ul>\n * <li>우리 파일 — 통째로 쓰고 통째로 지운다. 병합도 소유 판정도 없다.</li>\n * <li>남의 파일({@code config.json}·{@code .mcp.json}·{@code AGENTS.md}) — «병합»해서 쓰고,\n * 우리 조각만 되돌린다.</li>\n * </ul>\n * ★<b>그리고 자기 지문의 순환도 같이 사라진다.</b> 「자기 해시를 담은 문서의 해시」를 피하려고\n * 정규형에서 그 칸을 빼던 장치가 필요 없다 — 우리 파일은 지문을 «재지 않는다». 사용자가\n * 고칠 파일이 아니고, 고쳐져 있으면 읽기가 실패해 「기록 없음」으로 안전하게 떨어진다.\n */\nexport const HARNESS_RECORD_PATH = `${HARNESS_DIR}/init-record.json`;\n\nexport interface HarnessDocInput {\n endpoint: string;\n}\n\n/**\n * 저장소에 쓸 문서. ★<b>서버 본문과 패키지 기본값이 «같은 채움 경로»를 쓴다.</b>\n * 두 경로로 갈리면 서버 판만 고쳤을 때 오프라인 사용자에게는 다른 글이 나간다.\n *\n * @param template 서버에서 받은 본문. 없으면 이 패키지의 기본값(= 오프라인 기본값)을 쓴다.\n */\nexport function renderHarnessDoc(input: HarnessDocInput, template?: string): string {\n return fillTemplate(template ?? DEFAULT_HARNESS_DOC, { endpoint: input.endpoint });\n}\n\n/**\n * {{name}} 자리표시자를 채운다.\n *\n * <p>★<b>문법은 서버 레지스트리의 것이다.</b> 예전엔 이 패키지만 {@code {name}} 을 썼는데,\n * 같은 본문을 관리자 검증기가 거절했다 — 저장소를 공유하면서 계약이 둘이었다\n * (2026-09-23 독립 재리뷰 I2).\n */\nexport function fillTemplate(template: string, values: Record<string, string>): string {\n // ★원본을 «한 번만» 훑는다. 값을 하나씩 갈아 끼우면, 먼저 넣은 값 안의 자리표시자 모양\n // 글자가 다음 차례에 또 치환된다 — 프로젝트 이름에 {{endpoint}} 라고 적어 둔 사람의\n // 이름 일부가 실제 주소로 바뀌었다(2026-09-23 4차 독립 리뷰 S4).\n // ⚠모르는 이름은 그대로 둔다 — 지우면 「못 채웠다」를 아무도 못 본다.\n return template.replace(/\\{\\{([a-zA-Z0-9_]+)}}/g, (whole, name: string) =>\n Object.prototype.hasOwnProperty.call(values, name) ? values[name]! : whole);\n}\n\nexport const DOC_KEY = \"HARNESS.DOC\";\nexport const AGENT_NOTE_KEY = \"HARNESS.AGENT_NOTE\";\n\n/**\n * 각 문서가 반드시 담아야 할 변수 이름 — 서버의 REQUIRED_VARIABLES 와 같은 목록이다.\n * ★이 CLI 가 채우는 변수도 정확히 이것뿐이다({@link renderHarnessDoc}·{@link renderAgentNote}).\n */\nconst REQUIRED_VARIABLES: Record<string, string[]> = {\n [DOC_KEY]: [\"endpoint\"],\n [AGENT_NOTE_KEY]: [\"harnessDocPath\", \"serverName\"],\n};\n\n/**\n * 받은 본문을 저장소에 «써도 되는가». 쓰면 안 되면 그 이유, 괜찮으면 undefined.\n *\n * <p>셋을 본다: ①필수 변수가 원문에 «있는가» — 없으면 채워도 그 값이 안 들어간다.\n * ②이 CLI 가 «모르는» 변수가 있는가 — 있으면 못 채운 {@code {{name}}} 이 남의 저장소에 그대로 들어간다\n * (예: 0.8.0 이 옛 서버 판의 {@code {{projectName}}} 을 받는 경우 — 그때는 패키지 기본값을 쓴다).\n * ③AGENT_NOTE 라면 관리 마커가 정확히 한 쌍 있는가 — 없으면 우리 블록을 다시 찾을 수 없어\n * 재실행마다 덧붙고 undo 도 못 걷어낸다.\n */\nexport function documentContractProblem(key: string, body: string): string | undefined {\n const known = REQUIRED_VARIABLES[key] ?? [];\n for (const name of known) {\n if (!body.includes(`{{${name}}}`)) {\n return `${key} is missing the required {{${name}}} placeholder`;\n }\n }\n for (const [, name] of body.matchAll(/\\{\\{([a-zA-Z0-9_]+)}}/g)) {\n if (!known.includes(name!)) {\n return `${key} has a {{${name}}} placeholder this CLI does not fill`;\n }\n }\n if (key === AGENT_NOTE_KEY) {\n return managedBlockProblem(key, body);\n }\n return undefined;\n}\n\nconst DEFAULT_HARNESS_DOC = `# AiNecto Harness\n\nThis repository works with AiNecto. The design source of truth — requirements, the ERD,\ndiagrams, documents, and task boards — lives in AiNecto, not in this repository's files.\n\n- MCP endpoint: {{endpoint}}\n\n## What you can do\n\nEvery AI session sees the same AiNecto tools. What a tool may change is decided by the signed-in\nuser's AiNecto permissions on the workspace, project, or document it touches — the server refuses\nwhat the user may not do. A refusal is an answer: report it to the user instead of looking for a\nway around it.\n\nFind the project and document for the task with the tools (\\`list_projects\\`, \\`search_documents\\`,\n\\`get_document\\`) — this repository is not bound to one project.\n\n## When a tool is missing\n\nIf a result names a tool that is not in your tool list, this session started before that tool\nwas added. Start a new session, or call it from the repository with\n\\`npx -y ainecto@latest tools call <tool> '<json>'\\`.\n\n## Commands\n\n npx -y ainecto@latest setup connect this machine's coding agents (once per machine)\n npx -y ainecto@latest status who is signed in, and what is connected\n npx -y ainecto@latest doctor what is missing, and the command that fixes it\n\n---\nGenerated by \\`ainecto init\\`. Remove everything it wrote with \\`ainecto init --undo\\`.\n`;\n\n/**\n * AGENTS.md / CLAUDE.md 에 넣는 블록. ★<b>짧게 쓴다.</b> 이 파일들은 사용자의 것이고\n * 이미 다른 규칙이 들어 있다. 우리는 한 문단만 빌리고 전문은 우리 파일로 보낸다.\n */\nexport function renderAgentNote(template?: string): string {\n return fillTemplate(template ?? DEFAULT_AGENT_NOTE, {\n harnessDocPath: HARNESS_DOC_PATH,\n serverName: SERVER_NAME,\n });\n}\n\nconst DEFAULT_AGENT_NOTE = `${MARKER_BEGIN}\n## AiNecto Harness\n\nThis repository uses AiNecto as its design source of truth. Read \\`{{harnessDocPath}}\\` before doing\nwork that touches requirements, the ERD, or architecture.\n\nAiNecto tools come from the \\`{{serverName}}\\` MCP server. Every session sees the same tools; the\nsigned-in user's AiNecto permissions decide what they may change, and the server refuses the rest.\n${MARKER_END}`;\n\n/**\n * 이 본문이 <b>통째로 «관리 블록 하나»</b>인가. 아니면 그 이유.\n *\n * <p>★예전엔 「마커가 한 쌍 있나」만 봤다. 그래서 마커 «밖»에 머리말·꼬리말이 달린 본문이\n * 통과했고, 그 바깥 글은 init 때마다 한 번씩 더 붙고 undo 로도 안 걷혔다 — 우리가 걷어내는\n * 범위는 마커 «사이»뿐이기 때문이다(2026-09-23 4차 독립 리뷰 I4).\n *\n * <p>「넣는 범위」와 「빼는 범위」가 다르면 차이만큼 남의 파일에 쌓인다. 그래서 «넣을 것»도\n * 뺄 수 있는 모양이어야 한다: 앞뒤 공백을 빼면 정확히 한 블록.\n */\nexport function managedBlockProblem(key: string, body: string): string | undefined {\n const trimmed = body.trim();\n if (!trimmed.startsWith(MARKER_BEGIN)) {\n return `${key} must begin with ${MARKER_BEGIN} — text outside the block is never removed by --undo`;\n }\n if (!trimmed.endsWith(MARKER_END)) {\n return `${key} must end with ${MARKER_END} — text outside the block is never removed by --undo`;\n }\n const inner = trimmed.slice(MARKER_BEGIN.length, trimmed.length - MARKER_END.length);\n if (inner.includes(MARKER_BEGIN) || inner.includes(MARKER_END)) {\n return `${key} must contain exactly one ${MARKER_BEGIN} and one ${MARKER_END}`;\n }\n // ★<b>수락하는 모양과 «다시 찾을 수 있는» 모양이 같아야 한다.</b> 예전엔 양끝 문자열만 봐서\n // 한 줄짜리 블록이나 앞에 공백이 붙은 마커를 수락했다. 그런데 소유 판정은 「들여쓰기 없이\n // 줄 맨 앞, 그 줄에 마커만」이라 방금 쓴 블록을 못 찾고, 재실행마다 블록이 하나씩 늘었다\n // (2026-09-23 5차 독립 리뷰 I4).\n if (!inner.startsWith(\"\\n\")) {\n return `${key} must put ${MARKER_BEGIN} alone on its own line`;\n }\n if (!inner.endsWith(\"\\n\")) {\n return `${key} must put ${MARKER_END} alone on its own line`;\n }\n // 안에 닫히지 않은 코드펜스가 있으면, 파일에 합친 뒤 종료 마커가 그 펜스 «안»으로 들어간다.\n if (hasUnclosedFence(inner)) {\n return `${key} contains an unclosed code fence — the closing marker would fall inside it`;\n }\n return undefined;\n}\n\n/** 이 글이 코드펜스를 열어 둔 채 끝나는가. */\nfunction hasUnclosedFence(content: string): boolean {\n let open: { char: string; length: number } | undefined;\n for (const line of content.split(\"\\n\")) {\n const fence = fenceOf(line);\n if (!fence) continue;\n if (!open) open = { char: fence.char, length: fence.length };\n else if (fence.char === open.char && fence.length >= open.length && fence.info === \"\") open = undefined;\n }\n return open !== undefined;\n}\n\n/**\n * 저장되는 모양 하나. ★<b>쓰기·교체가 모두 이것을 쓴다.</b>\n *\n * <p>끝 개행은 «블록의 것이 아니라 파일 합성의 것»이다. 예전엔 블록에 딸려온 개행을 남긴 채\n * 합성이 하나를 더 붙여, 같은 입력으로 다시 돌릴 때마다 파일이 1바이트씩 자랐다\n * (605 → 606 → 607, 2026-09-23 5차 독립 리뷰 S2). 변경 없는 재실행은 파일을 안 바꿔야 한다.\n */\nexport function canonicalManagedBlock(block: string): string {\n return block.trim();\n}\n\n/**\n * 블록이 이미 있으면 갈아 끼우고, 없으면 끝에 붙인다. 사용자의 다른 내용은 건드리지 않는다.\n *\n * @throws Error 여는 표식만 있고 닫는 표식이 없을 때. ★<b>붙이면 안 된다</b> —\n * begin 이 둘, end 가 하나가 되어 다음 실행에서 «앞의 begin ~ 새 end» 가 한 덩이로\n * 잡히고 그 사이의 사용자 글이 사라진다(2026-09-22 독립 리뷰 I3).\n */\nexport function upsertMarkerBlock(existing: string | undefined, block: string): string {\n const current = existing ?? \"\";\n assertNoDanglingMarker(current);\n // ★개행의 소유를 한 곳으로 모은다 — 블록은 마커로 끝나고, 뒤의 한 줄은 «파일»의 것이다.\n const normalized = canonicalManagedBlock(block);\n const range = markerRange(current);\n const composed = range\n ? `${current.slice(0, range.start)}${normalized}${current.slice(range.end)}`\n : `${current.trim() ? `${current.replace(/\\s*$/, \"\")}\\n\\n` : \"\"}${normalized}\\n`;\n assertComposedBlockIsOurs(composed, current);\n return composed;\n}\n\n/**\n * ★<b>다시 찾을 수 있을 때만 쓴다.</b> 합성 «결과»를 소유 판정으로 되읽어, 관리 블록이\n * 정확히 하나로 보이는지 확인한다.\n *\n * <p>예전엔 «새 블록 안»만 검사했다. 그런데 소유 판정({@link ownedMarkerIndex})은 <b>파일\n * 문맥</b>을 본다 — 기존 파일이 코드펜스를 열어 둔 채 끝나면 멀쩡한 블록도 그 펜스 «안»으로\n * 들어가 우리 것으로 안 보인다. 그래서 init 마다 블록이 하나씩 늘고 undo 는 아무것도 못\n * 걷어냈다(2026-09-27 6차 독립 리뷰 I4).\n *\n * <p>「넣는 범위 = 빼는 범위」라는 규칙을 <b>블록이 아니라 합성 결과에</b> 적용한 것이다.\n * 검사할 대상은 우리가 만든 글이 아니라 «파일에 들어간 모습»이다.\n */\nfunction assertComposedBlockIsOurs(composed: string, existing: string): void {\n if (ownedMarkerCount(composed, \"begin\") === 1 && ownedMarkerCount(composed, \"end\") === 1) {\n return;\n }\n const reason = hasUnclosedFence(existing)\n ? \"this file ends inside an unclosed code fence, so the block would sit inside it\"\n : \"the block could not be found again once merged into this file\";\n throw new Error(\n `ainecto could not place its block where --undo would find it again — ${reason}. `\n + \"The file was left untouched; fix that and run again.\",\n );\n}\n\n/**\n * 표식이 짝이 안 맞으면 그 파일은 «손대지 않는다».\n *\n * <p>사람이 손으로 잘랐거나 붙여 넣다 만 경우다. 우리가 범위를 추측해서 지우면 남의 글이\n * 날아간다. 고치는 건 사람 몫이고, 우리는 무엇이 문제인지만 말한다.\n *\n * <p>★<b>세는 대상은 «우리 것으로 알아볼 수 있는» 표식뿐이다</b>({@link ownedMarkerIndex}).\n * 인용문·코드펜스·들여쓴 예제 안의 표식은 애초에 우리 것이 아니므로 짝을 세지 않는다 —\n * 예전엔 그런 예제까지 세어서 멀쩡한 파일을 「짝이 안 맞는다」고 거절했다.\n */\nexport function assertNoDanglingMarker(content: string): void {\n const begins = ownedMarkerCount(content, \"begin\");\n const ends = ownedMarkerCount(content, \"end\");\n if (begins !== ends || begins > 1) {\n throw new Error(\n `AiNecto markers are unbalanced (${begins} begin, ${ends} end). The file was left untouched — `\n + `remove the stray ${MARKER_BEGIN} / ${MARKER_END} by hand and run again.`,\n );\n }\n if (begins === 0) {\n return;\n }\n // ★개수만 세면 «end 가 begin 보다 앞선» 한 쌍을 정상으로 본다 — 그러면 새 블록을 덧붙이고\n // 다음 실행부터 중복으로 거절된다(2026-09-23 독립 재리뷰 I3).\n if (ownedMarker(content, \"end\", 0)!.at < ownedMarker(content, \"begin\", 0)!.at) {\n throw new Error(\n `AiNecto markers are out of order (${MARKER_END} appears before ${MARKER_BEGIN}). `\n + \"The file was left untouched — fix the markers by hand and run again.\",\n );\n }\n}\n\nfunction ownedMarkerCount(content: string, kind: MarkerKind): number {\n let count = 0;\n for (let hit = ownedMarker(content, kind, 0); hit !== undefined;\n hit = ownedMarker(content, kind, hit.at + 1)) {\n count += 1;\n }\n return count;\n}\n\ninterface MarkerHit {\n at: number;\n length: number;\n}\n\n/** 이 종류(여는·닫는)의 «우리» 마커 중 {@code from} 뒤에서 가장 앞의 것. */\nfunction ownedMarker(content: string, kind: MarkerKind, from: number): MarkerHit | undefined {\n return hit(ownedMarkerIndex(content, MARKERS[kind], from), MARKERS[kind]);\n}\n\n/** 이 종류의 마커 글자(우리 것인지 묻지 않는다) 중 {@code from} 뒤에서 가장 앞의 것. 증거 수집용. */\nfunction anyMarker(content: string, kind: MarkerKind, from: number): MarkerHit | undefined {\n return hit(content.indexOf(MARKERS[kind], from), MARKERS[kind]);\n}\n\nfunction hit(at: number, marker: string): MarkerHit | undefined {\n return at >= 0 ? { at, length: marker.length } : undefined;\n}\n\n/**\n * 이 위치가 코드펜스 «안»인가.\n *\n * <p>★예전엔 줄 맨 앞의 백틱 세 개를 «세어서» 홀짝으로 판정했다. 그래서 tilde 펜스,\n * 들여쓴 펜스, 그리고 «더 긴 펜스 안에 든 짧은 백틱 줄»을 전부 놓쳤고 — 예제로 적어 둔\n * 마커를 우리 블록으로 오인해 남의 본문을 갈아 끼웠다(2026-09-23 독립 재리뷰 I9).\n *\n * <p>지금은 Markdown 의 실제 규칙을 따른다: 펜스는 백틱 또는 tilde 세 개 이상으로 열리고,\n * 들여쓰기는 세 칸까지, 닫는 펜스는 <b>같은 문자</b>로 <b>연 것보다 짧지 않게</b>, 뒤에 아무것도\n * 없어야 한다. 완전한 파서는 아니지만 판정이 틀리는 쪽은 «안전한 쪽»(손대지 않음)이다.\n */\nfunction isInsideFencedBlock(content: string, index: number): boolean {\n let open: { char: string; length: number } | undefined;\n let offset = 0;\n for (const line of content.split(\"\\n\")) {\n const nextOffset = offset + line.length + 1;\n if (index < nextOffset) {\n // 표식이 이 줄에 있다 — 이 줄 «전»까지의 상태가 답이다.\n return open !== undefined;\n }\n const fence = fenceOf(line);\n if (fence) {\n if (!open) {\n open = { char: fence.char, length: fence.length };\n } else if (fence.char === open.char && fence.length >= open.length && fence.info === \"\") {\n open = undefined;\n }\n }\n offset = nextOffset;\n }\n return open !== undefined;\n}\n\n/** 이 줄이 펜스면 그 모양. 아니면 undefined. */\nfunction fenceOf(line: string): { char: string; length: number; info: string } | undefined {\n const match = /^ {0,3}(`{3,}|~{3,})(.*)$/.exec(line);\n if (!match) {\n return undefined;\n }\n const run = match[1]!;\n const info = match[2]!.trim();\n // 백틱 펜스의 정보 문자열에는 백틱이 못 들어간다(Markdown 규칙).\n if (run.startsWith(\"`\") && info.includes(\"`\")) {\n return undefined;\n }\n return { char: run[0]!, length: run.length, info };\n}\n\nexport interface MarkerRemoval {\n content: string;\n removed: boolean;\n /** 블록을 빼고 나니 빈 파일이 됐나 — 우리가 만든 파일이면 지울 수 있다. */\n emptied: boolean;\n}\n\nexport function removeMarkerBlock(existing: string | undefined): MarkerRemoval {\n const current = existing ?? \"\";\n assertNoDanglingMarker(current);\n const range = markerRange(current);\n if (!range) {\n return { content: current, removed: false, emptied: !current.trim() };\n }\n // ★<b>이어붙는 자리만</b> 손본다. 예전엔 파일 «전체»에 /\\n{3,}/ 를 돌려, 우리가 쓰지도 않은\n // 문단 사이 빈 줄까지 줄여 놓았다(2026-09-22 독립 리뷰 I2). 안 건드린 곳은 안 건드린다.\n //\n // ⚠원래 파일이 «끝 줄바꿈 없이» 끝났다면 그것까지는 되살리지 못한다 — upsert 가 붙일 때\n // 이미 지운 정보다. 그래서 「바이트 원복」이라고 말하지 않는다. 한 줄을 더한다.\n const before = current.slice(0, range.start).replace(/\\n*$/, \"\");\n const after = current.slice(range.end).replace(/^\\n*/, \"\");\n const stripped = before && after\n ? `${before}\\n\\n${after}`\n : before\n ? `${before}\\n`\n : after;\n return { content: stripped.trim() ? stripped : \"\", removed: true, emptied: !stripped.trim() };\n}\n\n/** 관리 블록을 «원래 있던 블록»으로 갈아 끼운다. undo 가 쓴다. */\nexport function replaceMarkerBlockWith(content: string, block: string): string {\n const range = markerRange(content);\n return range ? `${content.slice(0, range.start)}${block}${content.slice(range.end)}` : content;\n}\n\n/**\n * 짝이 맞지 않는 마커 하나. 중첩·잘림도 «설명해야 할 것»이므로 증거에 자리를 차지한다.\n *\n * <p>⛔글자를 바꾸지 않는다. 이미 쓰인 init 기록(0.5.0 포함)의 foreignBlocks 에 이 글자 그대로 들어 있다 —\n * 바꾸면 그 기록의 증거가 새 CLI 의 증거와 안 맞아 되돌리기가 «설명되지 않는 마커»로 멈춘다.\n * (바꿀지는 상수 변경이라 사용자 컨펌 대상 — 2026-10-14 0.6.0 에서 보류.)\n *\n * <p>★<b>여는 것과 닫는 것을 구별한다</b>(3차 리뷰 B2). 하나의 문자열로 뭉쳤더니\n * 「원래 있던 «닫는» 예제」와 「우리 블록에서 남은 «여는» 마커」가 서로 상쇄돼, 증거가 맞는 것처럼\n * 보이고 사용자 원본 백업이 버려졌다. 종류가 다르면 다른 증거다.\n */\nexport const UNPAIRED_BEGIN = \"(unpaired ai-erd begin)\";\nexport const UNPAIRED_END = \"(unpaired ai-erd end)\";\n\n/**\n * ★<b>init «전»에 이 파일에 있던 관리 블록들의 신원.</b> 되돌리기가 「이 파일에 남은 마커를\n * 내 기록으로 «설명할 수 있나»」를 묻는 데 쓰는 증거다.\n *\n * <p>★<b>왜 개수도, 모양 비교도 아닌가</b>(2026-09-27 9차 2차 리뷰 B2·N1). 두 번 틀렸다:\n * <ul>\n * <li>개수는 「예제를 지우고 그 자리에 우리 블록을 옮기기」를 못 본다 — 총수가 그대로다.</li>\n * <li>우리 블록을 «모양»으로 알아보려 하면, 제목 한 줄만 고쳐도·인용문({@code > })으로\n * 옮겨도·마커를 겹쳐도 못 알아보고 그것을 「블록이 없다」로 읽어 백업을 버렸다.\n * 거꾸로 init 전부터 있던 «똑같은» 예제는 우리 블록으로 오인해 정상 되돌리기를 막았다.</li>\n * </ul>\n * ⇒ 판정을 뒤집는다. 우리 블록을 알아보려 하지 않고, <b>기록에 있는 예제를 지워 나간 뒤 남는\n * 것을 «설명되지 않은 것»으로 본다.</b> 모양 비교는 「기록해 둔 예제가 그대로 있나」를 볼 때만\n * 쓰고, 의무 완료는 <b>증거 대조</b>가 정한다.\n *\n * <p>⚠사용자가 «자기 예제»를 고쳐 놓으면 그것도 설명되지 않은 것이 되어 되돌리기가 사람에게\n * 넘어간다. 백업을 지우는 것보다는 그쪽이 맞다 — 우리는 그 둘을 가를 근거를 갖고 있지 않다.\n */\nexport function markerEvidence(content: string | undefined): string[] {\n if (!content) {\n return [];\n }\n // ★<b>우리 블록을 «빼고» 본 파일이 증거다.</b> 소유 범위를 남겨 두면 그 경계를 가로질러 짝이\n // 지어진다 — 원래 «여는 마커만» 적어 둔 예제가 우리 블록의 «닫는 마커»와 한 쌍으로 묶여,\n // init 이 자기가 쓴 블록 때문에 «새로운 남의 증거»를 만들어 냈다(3차 리뷰 N2).\n // 빼고 보면 불변식이 선다: 우리 블록을 더하거나 걷어내도 남의 증거는 그대로다.\n const owned = markerRange(content);\n const rest = owned === undefined\n ? content\n : content.slice(0, owned.start) + content.slice(owned.end);\n const evidence: string[] = [];\n let cursor = 0;\n let begins = 0;\n let ends = 0;\n while (true) {\n const begin = anyMarker(rest, \"begin\", cursor);\n const close = anyMarker(rest, \"end\", cursor);\n if (begin === undefined && close === undefined) {\n break;\n }\n if (begin === undefined || (close !== undefined && close.at < begin.at)) {\n ends += 1; // 여는 것 없이 닫는 것이 먼저 나왔다.\n cursor = close!.at + close!.length;\n continue;\n }\n const pairEnd = anyMarker(rest, \"end\", begin.at + begin.length);\n if (pairEnd === undefined) {\n begins += 1;\n cursor = begin.at + begin.length;\n continue;\n }\n evidence.push(blockShape(rest.slice(begin.at, pairEnd.at + pairEnd.length)));\n cursor = pairEnd.at + pairEnd.length;\n }\n for (let i = 0; i < begins; i += 1) evidence.push(UNPAIRED_BEGIN);\n for (let i = 0; i < ends; i += 1) evidence.push(UNPAIRED_END);\n return evidence;\n}\n\n/** 들여쓰기와 빈 줄을 지운 «모양». 펜스·목록 안으로 옮겨져도 같은 예제로 알아본다. */\nfunction blockShape(block: string): string {\n return block.split(\"\\n\").map((line) => line.trim()).filter((line) => line.length > 0).join(\"\\n\");\n}\n\n/** 파일에 이미 들어 있던 관리 블록 원문. 없으면 undefined. undo 가 이것을 도로 넣는다. */\nexport function existingMarkerBlock(content: string | undefined): string | undefined {\n if (!content) {\n return undefined;\n }\n const range = markerRange(content);\n return range ? content.slice(range.start, range.end) : undefined;\n}\n\n/** 짝이 맞는 것은 {@link assertNoDanglingMarker} 가 이미 보장한다 — 여긴 범위만 잡는다. */\nfunction markerRange(content: string): { start: number; end: number } | undefined {\n const start = ownedMarker(content, \"begin\", 0);\n if (start === undefined) {\n return undefined;\n }\n const endMarker = ownedMarker(content, \"end\", start.at);\n if (endMarker === undefined) {\n return undefined;\n }\n return { start: start.at, end: endMarker.at + endMarker.length };\n}\n\n/**\n * ★<b>판정을 뒤집었다.</b> 「예제인지 알아내서 피한다」가 아니라\n * <b>「우리 것임을 확인할 수 있는 형태만 수락한다」</b>이다.\n *\n * <p>예제를 알아내려던 쪽은 계속 샜다 — tilde 펜스, 들여쓴 펜스, 더 긴 펜스 안의 짧은 줄,\n * 인용문 안의 코드, 네 칸 들여쓴 코드 블록…(2026-09-22 I3 → 2026-09-23 3차 I9 → 4차 I6).\n * Markdown 의 «안에 담는 문맥»은 끝이 없어서, 못 알아낸 하나가 곧 남의 본문을 지운다.\n *\n * <p>그래서 우리가 쓰는 <b>정확한 한 가지 형태</b>만 우리 것으로 본다:\n * 들여쓰기 없이 줄 맨 앞에서 시작하고, 그 줄에 표식 말고는 아무것도 없으며, 코드펜스 밖일 것.\n * ⚠이보다 느슨하게 적힌 우리 블록이 있다면 그것도 «못 알아본다» — 그 경우 덧붙이지도\n * 지우지도 않고 표식이 없는 파일처럼 다룬다. 남의 글을 지우는 쪽보다 낫다.\n */\nfunction ownedMarkerIndex(content: string, marker: string, from: number): number {\n for (let at = content.indexOf(marker, from); at >= 0; at = content.indexOf(marker, at + 1)) {\n const lineStart = content.lastIndexOf(\"\\n\", at - 1) + 1;\n if (lineStart !== at) {\n continue; // 들여썼거나 인용문(\">\") 뒤다 — 우리가 쓰는 형태가 아니다.\n }\n const lineEnd = content.indexOf(\"\\n\", at);\n const rest = (lineEnd < 0 ? content.slice(at) : content.slice(at, lineEnd)).slice(marker.length);\n if (rest.trim() !== \"\") {\n continue; // 같은 줄에 다른 글이 있다.\n }\n if (isInsideFencedBlock(content, at)) {\n continue;\n }\n return at;\n }\n return -1;\n}\n","import { HARNESS_RECORD_PATH } from \"./harnessDoc\";\n\n/**\n * 되돌리기 «기록»의 형식과 그 <b>상태 판정</b>. ★이 파일의 책임은 하나다 —\n * 「디스크에 있는 이것이 우리 기록인가, 그렇다면 온전한가」에 <b>명시적으로</b> 답하는 것.\n *\n * <p>★<b>왜 파일을 따로 두는가.</b> 다섯 차수에 걸쳐 같은 축이 샜고, 마지막 독립 리뷰가 그 이름을\n * 붙였다(2026-09-27 8차): <b>「파일 경로가 그 안의 내용이 유효하다는 증거는 아니다」</b>.\n * 기록을 우리 파일로 내보낸 것(7차)은 「이 칸이 누구 것인가」를 없앴지만, 그다음 질문을 남겼다 —\n * 「이 파일이 우리 것이라는 사실이 그 내용을 신뢰할 근거인가」. 아니다.\n *\n * <p>그때 무슨 일이 일어났나:\n * <ul>\n * <li>{@code kind} 가 다르거나 JSON 이 깨진 파일을 «부재»로 읽고, init 이 백업 없이 덮었다.\n * 읽기를 거절했는데 쓰기는 거절하지 않은 것이다(8차 I1).</li>\n * <li>{@code kind} 만 맞으면 {@code managed} 가 배열이어도, {@code version} 이 999 여도,\n * 지문 칸이 통째로 없어도 «정상 기록»으로 읽혔다. 그리고 그 기록으로 돌린 undo 가\n * <b>사용자가 편집한 문서를 지웠다</b>(8차 I2). 빈 기본값으로 채우는 관용이\n * 불확실성을 «확실»로 바꾼 것이다.</li>\n * </ul>\n * ⛔그래서 여기서는 {@code as unknown as} 로 모양을 «주장»하지 않고, 빈 값으로 «메우지» 않는다.\n * 읽어 낼 수 없으면 읽어 낼 수 없다고 말한다 — 그것이 부르는 쪽이 필요한 정보다.\n */\n\n/** 기록 파일의 신원. 사용자가 같은 이름으로 둔 파일을 실행 근거로 삼지 않는다. */\nexport const RECORD_KIND = \"ainecto/init-record\";\n\n/** 이 판이 읽고 쓰는 형식. 모르는 판은 «손상»이 아니라 «지원하지 않음»이다. */\nexport const RECORD_VERSION = 2;\n\n/**\n * 우리가 «소유한 것»의 값. ★명시적 타입이라 세 가지가 갈린다:\n * 「그 자리에 아무것도 없었다」 · 「JSON 값이었다(null 일 수도 있다)」 · 「글이었다」.\n *\n * <p>예전엔 {@code undefined} 하나로 앞의 둘을 덮었고, 그래서 사용자가 저장해 둔 {@code null} 이\n * «백업 없음»으로 바뀌었다(7차 I5).\n */\nexport type Owned =\n | { at: \"absent\" }\n | { at: \"json\"; value: unknown }\n | { at: \"text\"; text: string };\n\nexport const ABSENT: Owned = { at: \"absent\" };\n\n/** 우리가 그 파일의 «무엇을» 소유하나. 넣는 법과 빼는 법이 여기서 갈린다. */\nexport type OwnedScope =\n /** 파일 본문 전체를 우리가 쓴다(.ainecto/HARNESS.md). */\n | \"whole\"\n /** JSON 안의 MCP 서버 항목 하나(.mcp.json · .cursor/mcp.json). */\n | \"entry\"\n /** Markdown 안의 마커 블록 하나(AGENTS.md · CLAUDE.md). */\n | \"block\"\n /** JSON 안의 «칸 몇 개»(.ainecto/config.json). 나머지 칸은 사용자 것이다. */\n | \"fields\";\n\n/**\n * 한 파일에 대한 복구 계약. ★<b>한 파일의 사실이 한 곳에 모인다.</b>\n *\n * <p>예전 기록은 경로를 키로 한 «평행한 map 아홉 개»였다({@code created}·{@code replacedEntries}·\n * {@code blockAdded}·{@code replacedBlocks}·{@code originals}·{@code lastWritten}·\n * {@code lastWrittenFragment}·{@code lastWrittenBody}·{@code foreignMarkers}). 그래서 지금까지\n * 나온 결함이 거의 전부 <b>「한 map 은 X 라 하고 다른 map 은 Y 라 한다」</b>였고, 고칠 때마다\n * 그중 «한 map»만 고쳤다. 한 항목으로 묶으면 그 어긋남이 생길 자리가 없다.\n */\nexport interface FileContract {\n scope: OwnedScope;\n /** 우리가 이 파일을 «만들었나». 지워도 되는 것은 이것뿐이다. */\n createdByUs: boolean;\n /** 되돌릴 «목표» — 우리가 밀어낸 것. {@code absent} 면 「우리가 더했다」는 뜻이다. */\n original: Owned;\n /** 우리가 «실제로 쓴» 것. 「지금 값이 아직 우리 것인가」의 유일한 근거다. */\n written: Owned;\n /**\n * 우리가 쓴 «파일 전체»의 지문. 파일을 지워도 되는지 판정할 때만 쓴다.\n *\n * <p>⚠없으면 «모른다»는 뜻이고, 모를 때는 지우지 않는다. 예전엔 지문이 없으면\n * {@code changedSinceOurWrite} 가 false 를 돌려줘서 「안 바뀌었다」로 읽혔고, 그 판정이\n * 사용자 문서 삭제의 근거가 됐다(8차 I2).\n */\n fileFingerprint?: string;\n /** {@code scope===\"fields\"} 전용 — 우리가 쓴 칸의 값. 칸 단위 대조의 근거다. */\n writtenFields?: Record<string, unknown>;\n /**\n * {@code scope===\"fields\"} 전용 — 우리가 덮기 «전»에 그 칸에 있던 것. 칸마다 따로 든다.\n *\n * <p>★파일 전체를 원본으로 들면 두 가지를 못 한다(8차 I4·I6):\n * <ul>\n * <li>재init 에서 사용자가 고친 칸을 «새 기준»으로 삼기 — 파일 단위로는 어느 칸이 바뀐\n * 것인지 말할 수 없다.</li>\n * <li>원래 «빈 객체»였던 config 를 빈 객체로 되돌리기 — 파일 부재와 빈 객체가 같은\n * 결과로 뭉쳤고, 그래서 프로젝트 연결이 남았다.</li>\n * </ul>\n * ⚠「파일이 아예 없었다」는 {@link #createdByUs} 가 말한다. 이 칸은 «있던 파일 안의 칸»만 다룬다.\n */\n originalFields?: Record<string, Owned>;\n /**\n * {@code scope===\"block\"} 전용 — init «전»에 이 파일에 있던 관리 블록들의 «신원».\n * {@code markerEvidence} 가 만든 목록이고, 짝이 안 맞는 마커는 그 자리에 표시가 하나 들어간다.\n *\n * <p>★<b>개수에서 목록으로 두 번 옮겨 왔다</b>(8차 I5 → 9차 B2·N1):\n * <ul>\n * <li>Boolean 하나로는 「원래 예제가 있다」와 「우리 블록이 옮겨져 남았다」를 못 갈랐다.</li>\n * <li>개수로는 「예제를 지우고 그 자리에 우리 블록을 옮기기」를 못 봤다 — 총수가 그대로다.</li>\n * <li>우리 블록을 «모양»으로 알아보려 하면 제목 한 줄 편집·인용문 이동·중첩에 뚫렸고,\n * 반대로 init 전부터 있던 똑같은 예제를 우리 것으로 오인해 정상 되돌리기를 막았다.</li>\n * </ul>\n * ⇒ 우리 블록을 알아보려 하지 않는다. <b>이 목록으로 설명되지 않는 마커가 파일에 있으면</b>\n * 되돌리기를 완료로 만들지 않고 백업을 지킨다.\n */\n foreignBlocks?: string[];\n}\n\nexport interface InitRecord {\n version: number;\n /** 경로 → 그 파일에 대한 계약. */\n files: Record<string, FileContract>;\n /** 우리가 «실제로 만든» 디렉터리. 적용이 mkdir 결과로 채운다. */\n createdDirectories: string[];\n}\n\nexport function emptyRecord(): InitRecord {\n return { version: RECORD_VERSION, files: {}, createdDirectories: [] };\n}\n\n/**\n * 디스크에 있는 것의 «상태». ★부르는 쪽이 넷을 구별해서 다뤄야 한다 —\n * 특히 {@code corrupt}·{@code legacy} 는 「없음」이 아니다. 덮으면 안 된다.\n */\nexport type RecordState =\n | { state: \"absent\" }\n | { state: \"valid\"; record: InitRecord }\n | { state: \"corrupt\"; reason: string }\n | { state: \"legacy\"; reason: string };\n\n/**\n * ★<b>단일 로더.</b> 기록을 읽는 곳은 여기 하나다.\n *\n * <p>⛔관용을 베풀지 않는다. 한 칸이라도 계약을 벗어나면 «손상»이다 — 그 기록으로 파일을 지우는\n * 것이 되돌리기가 하는 일이고, 판단 재료가 반쯤 맞는 상태로 그 일을 해선 안 된다.\n */\nexport function readRecord(content: string | undefined): RecordState {\n if (content === undefined) {\n return { state: \"absent\" };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(content);\n } catch {\n return { state: \"corrupt\", reason: `${HARNESS_RECORD_PATH} is not valid JSON` };\n }\n if (!isObject(parsed)) {\n return { state: \"corrupt\", reason: `${HARNESS_RECORD_PATH} is not a JSON object` };\n }\n if (parsed.kind !== RECORD_KIND) {\n return {\n state: \"corrupt\",\n reason: `${HARNESS_RECORD_PATH} exists but is not an AiNecto init record (kind=`\n + `${JSON.stringify(parsed.kind)})`,\n };\n }\n if (parsed.version !== RECORD_VERSION) {\n // ★모르는 판은 손상이 아니다 — 다른 판의 CLI 가 쓴 «온전한» 기록일 수 있다.\n // 그 기록의 뜻을 우리가 추측해선 안 되고, 덮어서도 안 된다.\n return {\n state: \"legacy\",\n reason: `${HARNESS_RECORD_PATH} was written by another version of this CLI `\n + `(record version ${JSON.stringify(parsed.version)}, this CLI reads ${RECORD_VERSION})`,\n };\n }\n const files = parsed.files;\n if (!isObject(files)) {\n return { state: \"corrupt\", reason: `${HARNESS_RECORD_PATH} has no \"files\" object` };\n }\n const out: Record<string, FileContract> = {};\n for (const [path, raw] of Object.entries(files)) {\n const read = readContract(raw);\n if (\"problem\" in read) {\n return {\n state: \"corrupt\",\n reason: `${HARNESS_RECORD_PATH} has an unusable entry for ${path} — it ${read.problem}`,\n };\n }\n out[path] = read.contract;\n }\n const directories = parsed.createdDirectories;\n if (directories !== undefined && !isStringArray(directories)) {\n return { state: \"corrupt\", reason: `${HARNESS_RECORD_PATH} has a malformed createdDirectories` };\n }\n return {\n state: \"valid\",\n record: {\n version: RECORD_VERSION,\n files: out,\n createdDirectories: directories === undefined ? [] : [...directories],\n },\n };\n}\n\n/** 기록 파일의 저장 모양. ★지문을 담지 않는다 — 자기 해시를 담은 문서의 해시라는 순환이 생긴다. */\nexport function serializeRecord(record: InitRecord): string {\n return `${JSON.stringify({\n kind: RECORD_KIND,\n version: RECORD_VERSION,\n files: record.files,\n createdDirectories: record.createdDirectories,\n }, null, 2)}\\n`;\n}\n\n/**\n * 한 항목을 읽는다. ★읽어 내지 못하면 «무엇이 어긋났나»를 함께 돌려준다 —\n * 사용자가 손대야 할 파일이라 「읽을 수 없다」만으로는 고칠 수 없다.\n */\ntype ContractRead = { contract: FileContract } | { problem: string };\n\nfunction readContract(raw: unknown): ContractRead {\n if (!isObject(raw)) {\n return { problem: \"is not a JSON object\" };\n }\n const scope = raw.scope;\n if (scope !== \"whole\" && scope !== \"entry\" && scope !== \"block\" && scope !== \"fields\") {\n return { problem: `has an unknown scope (${JSON.stringify(raw.scope)})` };\n }\n if (typeof raw.createdByUs !== \"boolean\") {\n return { problem: \"does not say whether ainecto created the file\" };\n }\n const original = readOwned(raw.original);\n const written = readOwned(raw.written);\n if (original === undefined) {\n return { problem: \"has no readable record of what was there before\" };\n }\n if (written === undefined) {\n return { problem: \"has no readable record of what ainecto wrote\" };\n }\n if (raw.fileFingerprint !== undefined && typeof raw.fileFingerprint !== \"string\") {\n return { problem: \"has a malformed fileFingerprint\" };\n }\n if (raw.writtenFields !== undefined && !isObject(raw.writtenFields)) {\n return { problem: \"has a malformed writtenFields\" };\n }\n let originalFields: Record<string, Owned> | undefined;\n if (raw.originalFields !== undefined) {\n if (!isObject(raw.originalFields)) {\n return { problem: \"has a malformed originalFields\" };\n }\n originalFields = {};\n for (const [field, value] of Object.entries(raw.originalFields)) {\n const owned = readOwned(value);\n if (owned === undefined) {\n return { problem: `has no readable original for the field ${field}` };\n }\n originalFields[field] = owned;\n }\n }\n if (raw.foreignBlocks !== undefined && !isStringArray(raw.foreignBlocks)) {\n return { problem: \"has a malformed foreignBlocks\" };\n }\n if (scope === \"block\" && raw.foreignBlocks === undefined) {\n // ★블록 계약은 「이 파일에 원래 무엇이 있었나」 없이는 완료를 판정할 수 없다. 없으면 없다고 한다.\n return { problem: 'owns a marker block but does not say what marker blocks were already in the file' };\n }\n if (scope === \"fields\") {\n const problem = fieldsContractProblem({\n written,\n writtenFields: isObject(raw.writtenFields) ? raw.writtenFields : undefined,\n originalFields,\n });\n if (problem !== undefined) {\n return { problem };\n }\n }\n const contract: FileContract = {\n scope, createdByUs: raw.createdByUs, original, written,\n };\n if (typeof raw.fileFingerprint === \"string\") contract.fileFingerprint = raw.fileFingerprint;\n if (isObject(raw.writtenFields)) contract.writtenFields = { ...raw.writtenFields };\n if (originalFields !== undefined) contract.originalFields = originalFields;\n if (isStringArray(raw.foreignBlocks)) contract.foreignBlocks = [...raw.foreignBlocks];\n return { contract };\n}\n\n/**\n * {@code scope===\"fields\"} 계약이 «스스로 어긋나지» 않았나. ★로더와 계획이 <b>같은 이 함수</b>를\n * 쓴다 — 두 곳에 두면 「한쪽은 괜찮다 하고 다른 쪽은 아니라 한다」가 또 생긴다.\n *\n * <p>★<b>칸이 «있는지»에서 멈추면 반쯤 맞는 기록으로 파일을 고친다</b>(9차 B1). 세 번 뚫렸다:\n * <ul>\n * <li>{@code writtenFields.endpoint} 하나만 지운 기록을 유효로 읽었고, 되돌리기는 그 칸을\n * 「사용자가 고쳤다」로 읽어 우리 값을 남긴 뒤 <b>사용자 원본이 든 기록까지</b> 지웠다.</li>\n * <li>두 map 에서 «동시에» 지우면 그것도 유효였다 — 칸 집합끼리만 맞춰 봤기 때문이다.\n * 그래서 우리가 쓴 본문에 있는 «우리 칸»이 기록에 적혀 있는지도 본다(2차 리뷰 B1).</li>\n * <li>★원본을 {@code {at:\"text\"}} 로 바꿔 두면 유효로 읽혔고, 되돌리기는 «되돌릴 수 없는\n * 모양»을 부재로 취급해 그 칸을 지웠다 — config 가 {@code &#123;&#125;} 가 되고 기록이 사라졌다.\n * fields 의 원본은 {@code absent} 또는 {@code json} 뿐이다(2차 리뷰 B1).</li>\n * </ul>\n *\n * @param ownedFields 부르는 쪽이 아는 «우리 칸» 이름. 계획은 넘기고(그래서 양쪽 방향을 다 본다),\n * 로더는 넘기지 않는다 — 어느 칸이 우리 것인지는 형식 층의 지식이 아니다.\n */\nexport function fieldsContractProblem(\n contract: {\n written: Owned;\n writtenFields?: Record<string, unknown>;\n originalFields?: Record<string, Owned>;\n },\n ownedFields?: readonly string[],\n): string | undefined {\n const { written, writtenFields, originalFields } = contract;\n if (writtenFields === undefined) {\n return \"owns only some fields of the file but does not say which ones it wrote (writtenFields)\";\n }\n if (originalFields === undefined) {\n return \"owns only some fields of the file but does not say what was in them before (originalFields)\";\n }\n const writtenKeys = Object.keys(writtenFields).sort();\n const originalKeys = Object.keys(originalFields).sort();\n if (writtenKeys.length !== originalKeys.length\n || writtenKeys.some((key, at) => key !== originalKeys[at])) {\n return `lists different fields as written (${writtenKeys.join(\", \") || \"none\"}) and as `\n + `backed up (${originalKeys.join(\", \") || \"none\"})`;\n }\n for (const key of writtenKeys) {\n // ★되돌리기가 할 수 있는 일은 「그 값을 도로 넣기」와 「그 칸을 빼기」뿐이다. 그 둘이 아닌\n // 모양을 들고 있으면 그것은 판정 자료가 아니라 손상이다.\n const original = originalFields[key]!;\n if (original.at !== \"absent\" && original.at !== \"json\") {\n return `records the original of ${key} as ${original.at}, which is not something --undo `\n + \"can put back into a JSON field\";\n }\n }\n if (written.at !== \"text\") {\n return \"owns only some fields of the file but does not hold the file text it wrote\";\n }\n let body: unknown;\n try {\n body = JSON.parse(written.text);\n } catch {\n return \"holds a written file body that is not valid JSON\";\n }\n if (!isObject(body)) {\n return \"holds a written file body that is not a JSON object\";\n }\n for (const key of writtenKeys) {\n if (!Object.prototype.hasOwnProperty.call(body, key)) {\n return `says it wrote ${key}, but that field is not in the file body it recorded`;\n }\n if (stableStringify(body[key]) !== stableStringify(writtenFields[key])) {\n return `records a different value for ${key} than the file body it wrote`;\n }\n }\n if (ownedFields !== undefined) {\n // ★반대 방향. 우리가 쓴 본문에 «우리 칸»이 있는데 기록이 그 칸을 말하지 않으면, 그 칸에 대한\n // 판정 자료가 없다는 뜻이다 — 두 map 에서 동시에 지운 기록이 그래서 유효로 읽혔다.\n for (const key of ownedFields) {\n if (Object.prototype.hasOwnProperty.call(body, key)\n && !Object.prototype.hasOwnProperty.call(writtenFields, key)) {\n return `wrote ${key} into the file but does not record what it put there`;\n }\n }\n }\n return undefined;\n}\n\nfunction readOwned(raw: unknown): Owned | undefined {\n if (!isObject(raw)) {\n return undefined;\n }\n if (raw.at === \"absent\") {\n return ABSENT;\n }\n if (raw.at === \"json\") {\n // ⚠value 는 «없어도» 되는 칸이 아니다 — 키가 있어야 한다. null 이 값이기 때문이다.\n return Object.prototype.hasOwnProperty.call(raw, \"value\")\n ? { at: \"json\", value: raw.value }\n : undefined;\n }\n if (raw.at === \"text\") {\n return typeof raw.text === \"string\" ? { at: \"text\", text: raw.text } : undefined;\n }\n return undefined;\n}\n\n/**\n * 객체 칸의 «순서»를 지운 JSON.\n *\n * <p>★{@code JSON.parse}→{@code stringify} 는 공백은 정규화하지만 칸 순서는 그대로 둔다.\n * 그래서 사람이 편집기로 열었다 저장만 해도 「사용자가 고쳤다」로 잡혔다(4차 독립 리뷰 S1).\n *\n * <p>★<b>여기 한 벌만 둔다.</b> 기록의 «상호 일치» 판정과 계획의 «값이 바뀌었나» 판정이 다른\n * 정규형을 쓰면 「한 쪽은 같다고 하고 다른 쪽은 다르다고 한다」가 또 생긴다 — 그것이 다섯 차수를\n * 관통한 실패의 이름이었다.\n *\n * <p>⚠배열 순서는 유지한다 — 거기선 순서가 곧 내용이다(MCP 인자 목록 등).\n */\nexport function stableStringify(value: unknown): string {\n if (Array.isArray(value)) {\n return `[${value.map(stableStringify).join(\",\")}]`;\n }\n if (value && typeof value === \"object\") {\n const entries = Object.entries(value as Record<string, unknown>)\n .sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0));\n return `{${entries.map(([key, item]) => `${JSON.stringify(key)}:${stableStringify(item)}`).join(\",\")}}`;\n }\n return JSON.stringify(value) ?? \"null\";\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction isStringArray(value: unknown): value is string[] {\n return Array.isArray(value) && value.every((entry) => typeof entry === \"string\");\n}\n","import {\n AGENT_TARGETS,\n readServerEntry,\n buildServerEntry,\n isOurBridge,\n mergeServerEntry,\n removeServerEntry,\n SERVER_NAME,\n} from \"./agentTargets\";\nimport {\n existingMarkerBlock,\n markerEvidence,\n HARNESS_CONFIG_PATH,\n HARNESS_DOC_PATH,\n HARNESS_RECORD_PATH,\n removeMarkerBlock,\n replaceMarkerBlockWith,\n renderAgentNote,\n renderHarnessDoc,\n upsertMarkerBlock,\n} from \"./harnessDoc\";\nimport {\n ABSENT,\n emptyRecord,\n fieldsContractProblem,\n readRecord,\n serializeRecord,\n stableStringify,\n type FileContract,\n type InitRecord,\n type Owned,\n type RecordState,\n} from \"./initRecord\";\nimport { createHash } from \"node:crypto\";\n\n/**\n * init 이 «무엇을 쓸지»를 순수하게 계산한다. 파일을 읽지도 쓰지도 않는다.\n *\n * ★<b>계획과 적용을 가른 이유.</b> 이 명령은 남의 저장소에 파일을 쓴다 — 가장 위험한 종류의\n * 일이다. 계산이 순수하면 「어떤 상태에서 무엇을 쓰는가」를 전부 시험으로 고정할 수 있고,\n * {@code --dry-run} 이 «진짜로 일어날 일»을 그대로 보여 준다(따로 만든 미리보기가 아니다).\n *\n * <p>★★<b>2026-09-27, 여덟 차례의 독립 리뷰 뒤에 경계를 셋으로 나눴다.</b> 다섯 차수 동안 같은\n * 축이 계속 샜고, 마지막 리뷰가 그 이유에 이름을 붙였다 — 기록이 «경로를 키로 한 평행한 map\n * 아홉 개»여서 나온 결함이 거의 전부 「한 map 은 X 라 하고 다른 map 은 Y 라 한다」였다.\n * 고칠 때마다 나는 그중 <b>한 map</b>을 고쳤다.\n * <ol>\n * <li>{@code initRecord.ts} — 기록의 «형식과 상태». 부재·유효·손상·구판을 명시적으로 돌려준다.</li>\n * <li><b>이 파일</b> — «파일별 복구 계약». 한 파일의 사실이 한 항목에 모이고,\n * 완료·보존·미해결이 {@link Outcome} 타입으로 갈린다.</li>\n * <li>{@code initCommand.applyPlan} — 적용과 기록 저장. 실제 변경과 mkdir 결과를 한 경계에서 모은다.</li>\n * </ol>\n */\n\n/** 규칙 블록을 넣을 지침 파일. 없으면 만드는 것과 있을 때만 고치는 것을 구분한다. */\nconst NOTE_TARGETS = [\n { path: \"AGENTS.md\", createIfMissing: true },\n { path: \"CLAUDE.md\", createIfMissing: false },\n] as const;\n\nexport const MANAGED_PATHS: readonly string[] = [\n ...AGENT_TARGETS.map((target) => target.path),\n ...NOTE_TARGETS.map((target) => target.path),\n HARNESS_DOC_PATH,\n HARNESS_CONFIG_PATH,\n HARNESS_RECORD_PATH,\n];\n\n/** 경로 → 현재 내용. 값이 {@code undefined} 면 «파일 없음». */\nexport type FileSnapshot = ReadonlyMap<string, string | undefined>;\n\nexport interface FileWrite {\n path: string;\n content: string;\n existed: boolean;\n}\n\nexport interface InitPlan {\n writes: FileWrite[];\n deletes: string[];\n notes: string[];\n /** init 계획이 남기는 기록. {@code .ainecto/init-record.json} 에 저장된다. */\n record?: InitRecord;\n /**\n * ★<b>아무것도 하지 말아야 하는 이유.</b> 있으면 부르는 쪽이 멈추고 이 문장을 보여 준다.\n *\n * <p>기록을 읽어 내지 못했을 때 그냥 진행하면 그 파일에 든 «남의 원본 백업»을 백업 없이\n * 덮는다 — 읽기를 거절했는데 쓰기는 거절하지 않은 것이다(2026-09-27 8차 독립 리뷰 I1).\n */\n refusal?: string;\n /**\n * 되돌리기가 «치워도 되는» 디렉터리 — 우리가 만든 것뿐이다.\n *\n * <p>★비었다는 것과 우리 것이라는 것은 다른 사실이다(4차 독립 리뷰 S3).\n */\n removableDirectories?: string[];\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// 소유한 값 다루기\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** JSON 값을 {@link Owned} 로. {@code present} 가 false 면 «그 자리에 없다»는 뜻이다. */\nfunction ownedJson(value: unknown, present: boolean): Owned {\n return present ? { at: \"json\", value } : ABSENT;\n}\n\nfunction ownedText(text: string | undefined): Owned {\n return text === undefined ? ABSENT : { at: \"text\", text };\n}\n\n/**\n * 두 소유값이 같은가. ★<b>JSON 타입을 보존한다.</b>\n *\n * <p>예전엔 문자열은 원문 그대로, 객체는 JSON 문자열로 해시해서 <b>객체와 「그 객체의 JSON 을\n * 담은 문자열」이 같은 지문</b>이 됐고, 타입이 다른데도 「원본 복구 완료」로 판정하며 객체\n * 백업을 지웠다(7차 독립 리뷰 I5). 정규화는 «칸 순서와 공백»만 지우는 일이다.\n */\nfunction sameOwned(left: Owned, right: Owned): boolean {\n if (left.at !== right.at) {\n return false;\n }\n if (left.at === \"absent\") {\n return true;\n }\n if (left.at === \"text\" && right.at === \"text\") {\n return left.text === right.text;\n }\n return left.at === \"json\" && right.at === \"json\"\n && stableStringify(left.value) === stableStringify(right.value);\n}\n\n/** 내용 지문. 암호학적 용도가 아니라 «바뀌었나»만 본다. */\nexport function contentFingerprint(content: string): string {\n return createHash(\"sha256\").update(content).digest(\"hex\");\n}\n\nfunction serialize(body: unknown): string {\n return `${JSON.stringify(body, null, 2)}\\n`;\n}\n\n/** 이 경로의 내용 지문. JSON 파일은 칸 순서를 지운 정규형으로 잰다. */\nfunction fingerprintFor(path: string, content: string): string {\n if (!path.endsWith(\".json\")) {\n return contentFingerprint(content);\n }\n try {\n return contentFingerprint(stableStringify(JSON.parse(content)));\n } catch {\n return contentFingerprint(content);\n }\n}\n\nfunction parseJsonObject(content: string): Record<string, unknown> | undefined {\n try {\n const parsed = JSON.parse(content) as unknown;\n return parsed && typeof parsed === \"object\" && !Array.isArray(parsed)\n ? (parsed as Record<string, unknown>)\n : undefined;\n } catch {\n return undefined;\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// config 의 «우리 칸»\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface ConfigBodyValues {\n endpoint: string;\n cliVersion: string;\n versions: Record<string, string>;\n}\n\n/**\n * init 이 config 에 쓰는 내용. ★적는 칸의 진실원이 여기 하나다.\n * v2(0.8.0): {@code project} 칸이 없다 — 저장소를 한 프로젝트에 묶지 않는다(요구서 11장).\n */\nfunction configBodyOf(values: ConfigBodyValues): Record<string, unknown> {\n return {\n version: 2,\n endpoint: values.endpoint,\n generatedBy: values.cliVersion,\n promptVersions: values.versions,\n };\n}\n\n/**\n * config 에서 «우리 것»인 칸. ★여기 없는 칸은 <b>사용자가 적은 것</b>이고 되돌리기가 손대지 않는다.\n *\n * <p>목록을 {@link configBodyOf} 에서 «뽑아낸다» — 손으로 베끼면 칸이 늘 때 잊는다.\n * 같은 자리를 이미 한 번 틀렸다(4차 독립 리뷰 I3).\n *\n * <p>★{@code managed} 는 이 목록에 «없다». 기록이 자기 파일로 나갔기 때문이다 — 사용자가\n * config 에 {@code managed} 라는 칸을 적어 두어도 그것은 사용자 것이다(7차 독립 리뷰 I2).\n */\nconst OUR_CONFIG_FIELDS: readonly string[] = Object.keys(configBodyOf({\n endpoint: \"\", cliVersion: \"\", versions: {},\n}));\n\n/**\n * ★<b>옛 판이 «우리 칸»으로 썼고 지금은 쓰지 않는 칸.</b> 기록({@code writtenFields})에 남아 있으면 그 칸도\n * 우리 것이다 — 재init 은 그대로면 걷어내고(원본이 있었으면 원본으로), 사용자가 고쳤으면 남긴다.\n * 되돌리기도 기록에 있는 동안은 우리 칸으로 다룬다.\n */\nconst RETIRED_CONFIG_FIELDS: readonly string[] = [\"project\"];\n\n/** 이 계약에서 «우리 칸»인 이름 — 지금의 칸 + 기록에 남은 옛 칸. */\nfunction ownedConfigFields(contract: Pick<FileContract, \"writtenFields\"> | undefined): string[] {\n const written = contract?.writtenFields ?? {};\n return [...OUR_CONFIG_FIELDS, ...RETIRED_CONFIG_FIELDS.filter((field) => hasField(written, field))];\n}\n\nconst hasField = (object: Record<string, unknown>, field: string) =>\n Object.prototype.hasOwnProperty.call(object, field);\n\n// ─────────────────────────────────────────────────────────────────────────────\n// 계획 — init\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface PlanInitInput {\n env?: \"prod\" | \"dev\";\n endpoint: string;\n /**\n * ★MCP 설정 파일({@code .mcp.json}·{@code .cursor/mcp.json})을 쓰나 — {@code init --mcp}(설계 결정 #6).\n * 없어도 «우리 브리지 항목이 이미 있는» 파일은 다시 쓴다 — 옛 {@code --role} 을 걷고 판을 고정한다.\n * 이것이 옛 저장소의 이행 경로다(별도 migrate 명령 없음, D10).\n */\n mcp: boolean;\n /** 브리지 패키지 지정(시험용). 기본은 이 CLI 판으로 고정. */\n packageSpec?: string;\n cliVersion: string;\n files: FileSnapshot;\n /** 직전 실행의 기록 «상태». ★유효하지 않으면 init 이 멈춘다 — 덮으면 백업이 사라진다. */\n previous?: RecordState;\n /** 서버에서 받은 문서 본문. 없으면 패키지 기본값(= 오프라인 기본값)을 쓴다. */\n documents?: { doc?: string; agentNote?: string; versions?: Record<string, string> };\n}\n\n/**\n * ★<b>기록 때문에 멈춰야 하나 — «파일만» 보고 답한다.</b>\n *\n * <p>계획을 세우는 것보다 «앞»에 이 질문이 있어야 한다. 예전엔 이 판정이 {@code planInit} 안에만\n * 있었고, 부르는 쪽은 그 전에 프로젝트를 해결했다 — 프로젝트가 0개면 <b>원격에 프로젝트를 만든\n * 뒤에</b> 「아무것도 바꾸지 않았다」는 예외를 냈다(9차 1차 리뷰 B7). 로컬 쓰기가 0이어도\n * 부수효과가 0인 것은 아니다. 그래서 순수 함수로 빼서 원격 호출 전에 물을 수 있게 한다.\n *\n * <p>⚠{@code planInit} 도 이 함수를 쓴다 — 두 곳에 같은 판단을 두면 어긋난다.\n */\nexport function initRefusal(files: FileSnapshot, previous?: RecordState): string | undefined {\n const state = previous ?? readRecord(files.get(HARNESS_RECORD_PATH));\n if (state.state === \"corrupt\" || state.state === \"legacy\") {\n // ★읽어 내지 못한 기록을 덮으면 그 안의 «남의 원본 백업»이 사라진다. 읽기를 거절했으면\n // 쓰기도 거절해야 한다(8차 독립 리뷰 I1).\n return `${state.reason}. Nothing was changed — move that file aside (or restore it) and run again.`;\n }\n const carried = state.state === \"valid\" ? state.record : emptyRecord();\n for (const [path, contract] of Object.entries(carried.files)) {\n if (contract.scope !== \"fields\") {\n continue;\n }\n // ★<b>검증 «전» 기록으로 파일을 고치지 않는다.</b> 같은 완전성 검사가 되돌리기에만 있었고,\n // 재init 은 그 기록을 그대로 실행해 «현재 값»을 새 원본으로 적어 버렸다(3차 리뷰 F1).\n // ⛔로더에 도메인 지식을 넣는 대신, 도메인을 아는 이 경계에서 두 진입점이 같은 검사를 한다.\n const problem = fieldsContractProblem(contract, OUR_CONFIG_FIELDS);\n if (problem !== undefined) {\n return `${HARNESS_RECORD_PATH}'s record for ${path} ${problem}. Nothing was changed — `\n + \"restore that file (or move it aside) and run again.\";\n }\n }\n return undefined;\n}\n\nexport function planInit(input: PlanInitInput): InitPlan {\n const previous = input.previous ?? readRecord(input.files.get(HARNESS_RECORD_PATH));\n const refusal = initRefusal(input.files, previous);\n if (refusal !== undefined) {\n return { writes: [], deletes: [], notes: [], refusal };\n }\n\n const carriedRecord = previous.state === \"valid\" ? previous.record : emptyRecord();\n\n const entry = buildServerEntry({ env: input.env, endpoint: input.endpoint, packageSpec: input.packageSpec });\n const writes: FileWrite[] = [];\n const notes: string[] = [];\n const record: InitRecord = {\n version: carriedRecord.version,\n files: { ...carriedRecord.files },\n createdDirectories: [...carriedRecord.createdDirectories],\n };\n\n /**\n * ★<b>이어받은 계약이 아직 참인가.</b> 기록은 «지난 실행의 주장»이고 그 사이에 파일이 바뀔 수\n * 있다. 지금 값이 우리가 쓴 것도 아니고 되돌릴 목표도 아니면 그 백업은 낡은 것이다 —\n * 지금 값이 사용자의 것이므로 그것이 새 기준이 되어야 한다(6차 I3 → 8차 I4).\n */\n const priorOf = (path: string, current: Owned): FileContract | undefined => {\n const prior = record.files[path];\n if (prior === undefined) {\n return undefined;\n }\n if (sameOwned(prior.written, current) || sameOwned(prior.original, current)) {\n return prior;\n }\n delete record.files[path];\n notes.push(`${path}: it changed outside ainecto, so the older backup was dropped and this is the new baseline.`);\n return undefined;\n };\n\n // ── MCP 설정 파일들 — 우리가 «항목 하나»를 소유한다 ──────────────────────────\n for (const target of AGENT_TARGETS) {\n const existing = input.files.get(target.path);\n const currentEntry = existing === undefined ? undefined : readServerEntry(existing);\n if (!input.mcp && !isOurBridge(currentEntry)) {\n // --mcp 없이는 MCP 설정을 새로 쓰지 않는다. 우리 브리지 항목이 이미 있을 때만 갱신한다.\n continue;\n }\n const prior = priorOf(target.path, ownedJson(currentEntry, currentEntry !== undefined));\n const merged = mergeServerEntry(existing, entry);\n if (existing === merged.content) {\n continue;\n }\n const original = prior?.original ?? ownedJson(merged.replacedEntry, merged.replaced);\n if (prior === undefined && original.at !== \"absent\") {\n notes.push(`${target.path}: your existing \"${SERVER_NAME}\" entry was saved and will be restored by --undo`);\n }\n record.files[target.path] = {\n scope: \"entry\",\n createdByUs: prior?.createdByUs ?? existing === undefined,\n original,\n written: ownedJson(readServerEntry(merged.content), true),\n fileFingerprint: fingerprintFor(target.path, merged.content),\n };\n writes.push({ path: target.path, content: merged.content, existed: existing !== undefined });\n }\n\n // ── HARNESS.md — 우리가 «파일 전체»를 소유한다 ────────────────────────────────\n const existingDoc = input.files.get(HARNESS_DOC_PATH);\n const priorDoc = priorOf(HARNESS_DOC_PATH, ownedText(existingDoc));\n const docContent = renderHarnessDoc({ endpoint: input.endpoint }, input.documents?.doc);\n const docOriginal = priorDoc?.original ?? ownedText(existingDoc);\n if (priorDoc === undefined && docOriginal.at !== \"absent\") {\n notes.push(`${HARNESS_DOC_PATH} already existed; its original was saved and --undo will restore it.`);\n }\n record.files[HARNESS_DOC_PATH] = {\n scope: \"whole\",\n createdByUs: priorDoc?.createdByUs ?? existingDoc === undefined,\n original: docOriginal,\n written: ownedText(docContent),\n fileFingerprint: fingerprintFor(HARNESS_DOC_PATH, docContent),\n };\n if (docContent !== existingDoc) {\n writes.push({ path: HARNESS_DOC_PATH, content: docContent, existed: existingDoc !== undefined });\n }\n\n // ── AGENTS.md / CLAUDE.md — 우리가 «블록 하나»를 소유한다 ─────────────────────\n const note = renderAgentNote(input.documents?.agentNote);\n for (const target of NOTE_TARGETS) {\n const existing = input.files.get(target.path);\n if (existing === undefined && !target.createIfMissing) {\n notes.push(`${target.path} not found — skipped; AGENTS.md already reaches this agent.`);\n continue;\n }\n const blockNow = existing === undefined ? undefined : existingMarkerBlock(existing);\n const carried = record.files[target.path];\n // ⚠아래 판정은 «새 기준을 만들기 전에» 온다. 정상 위치에 블록이 있을 때만 검사하면,\n // 그 블록을 고치고 사본을 옆에 둔 파일이 가드를 건너뛰었다(3차 리뷰 B2).\n let content: string;\n try {\n content = upsertMarkerBlock(existing, note);\n } catch (error) {\n // ★우리 블록을 «다시 찾을 수 있게» 넣을 수 없는 파일이다 — 그 파일만 건너뛰고 나머지\n // init 은 계속한다. ⛔이때 기록은 «한 글자도» 건드리지 않는다: 새 기준도 못 세웠는데\n // 옛 백업을 버리면 양쪽 다 잃는다(7차 독립 리뷰 I4).\n notes.push(`${target.path}: ${error instanceof Error ? error.message : String(error)}`);\n continue;\n }\n if (carried?.scope === \"block\" && unexplainedMarkers(existing, carried) > 0) {\n // ★<b>이 파일의 마커를 기록으로 설명할 수 없다.</b> 우리 블록이 옮겨졌거나 한 벌 더\n // 있을 수 있다는 뜻이다(펜스·인용문 안, 제목만 고친 것, 정상 블록 옆의 사본 포함).\n // 그대로 진행하면 계약을 버려(priorOf) 사용자 원본 백업이 사라지고 파일에는 우리 블록이\n // 둘이 된다 — 그 상태의 undo 는 «새로 더한 것만» 걷어내고 완료로 처리했다(9차 B2).\n // ⇒ 이 파일은 손대지 않고 기록도 그대로 둔다. 자리를 되돌리는 것은 사람 몫이다.\n notes.push(\n `${target.path}: this file has an ainecto marker block that is not where ainecto can find `\n + \"it again (inside a code fence, a quote, or edited). Left untouched and the earlier \"\n + \"backup kept — move that block back to the top level, or remove it, then run again.\",\n );\n continue;\n }\n // ★<b>블록을 «못 찾는다»는 사실은 백업을 버릴 근거가 아니다</b>(3차 리뷰 B2). 마커가\n // 변형·삭제돼 우리 블록이 검출되지 않으면 예전엔 계약을 버려 사용자 원본이 사라졌다.\n // 새 기준은 «정상 위치에 사용자 것이 들어와 있을 때»만 세운다 — 그때만 되돌릴 목표가 바뀐다.\n const prior = blockNow === undefined ? carried : priorOf(target.path, ownedText(blockNow));\n if (content === existing) {\n continue;\n }\n const original = prior?.original ?? ownedText(blockNow);\n if (prior === undefined && original.at !== \"absent\") {\n notes.push(`${target.path}: an existing ainecto block was saved and will be restored by --undo`);\n }\n record.files[target.path] = {\n scope: \"block\",\n createdByUs: prior?.createdByUs ?? existing === undefined,\n original,\n written: ownedText(existingMarkerBlock(content)),\n fileFingerprint: fingerprintFor(target.path, content),\n // init «전»에 이 파일에 있던 관리 블록들의 신원. 되돌리기가 「남은 마커를 설명할 수 있나」를\n // 이것으로 묻는다. ★재init 은 이어받는다 — 다시 재면 우리가 쓴 블록이 «원래 있던 것»이 된다.\n // ★{@code carried} 를 먼저 본다 — {@code priorOf} 가 새 기준을 세웠다는 것이 「남의 예제\n // 목록을 다시 모아도 된다」는 허가가 아니다. 다시 모으면 «우리가 옮겨 둔 사본»이\n // 「원래 있던 예제」로 등록되고, 그다음 되돌리기가 그것을 남긴 채 끝났다(3차 리뷰 B2).\n foreignBlocks: carried?.foreignBlocks ?? prior?.foreignBlocks ?? markerEvidence(existing),\n };\n writes.push({ path: target.path, content, existed: existing !== undefined });\n }\n\n // ── config.json — 우리가 «칸 몇 개»를 소유한다. 나머지는 사용자 것이다 ────────\n const existingConfig = input.files.get(HARNESS_CONFIG_PATH);\n const ourFields = configBodyOf({\n endpoint: input.endpoint,\n cliVersion: input.cliVersion,\n // ★어느 판의 규칙으로 썼나. 이게 없으면 「무엇이 적혀 있었나」를 나중에 못 되짚는다.\n versions: input.documents?.versions ?? {},\n });\n const theirConfig = existingConfig === undefined ? undefined : parseJsonObject(existingConfig);\n if (existingConfig !== undefined && theirConfig === undefined) {\n // JSON 객체가 아닌 파일은 병합할 수 없다 — 손대지 않는다. ⛔이미 있던 계약도 지우지 않는다:\n // 그 안에 아직 못 되돌린 원본이 있을 수 있다(8차 독립 리뷰 I3).\n notes.push(`${HARNESS_CONFIG_PATH} is not a JSON object — left untouched.`);\n } else {\n const priorConfig = record.files[HARNESS_CONFIG_PATH];\n const originalFields: Record<string, Owned> = {};\n for (const field of OUR_CONFIG_FIELDS) {\n const presentNow = theirConfig !== undefined && hasField(theirConfig, field);\n const currentValue = presentNow ? theirConfig![field] : undefined;\n const priorOriginal = priorConfig?.originalFields?.[field];\n const priorWritten = priorConfig?.writtenFields;\n // ★재init: 사용자가 우리 칸을 고쳤으면 «그 값»이 새 원본이다. 옛 원본을 이어받으면\n // 되돌리기가 두 판 전 값을 복원하며 사용자 편집을 잃는다(8차 독립 리뷰 I4).\n const untouchedByUser = priorWritten !== undefined && hasField(priorWritten, field)\n && stableStringify(currentValue) === stableStringify(priorWritten[field]);\n const next = untouchedByUser && priorOriginal !== undefined\n ? priorOriginal\n : ownedJson(currentValue, presentNow);\n originalFields[field] = next;\n if (priorOriginal !== undefined && !sameOwned(next, priorOriginal)) {\n notes.push(`${HARNESS_CONFIG_PATH}: you changed ${field} — ainecto now treats your value as the one to put back.`);\n }\n }\n // ── 옛 판이 쓴 칸(project) — 기록과 같으면 걷어내고, 사용자가 고쳤으면 남긴다 ──\n // ★판정 규칙은 위 칸들과 같다(「기록에 적힌 우리 값과 지금 값이 같은가」). 걷어낸 칸은 기록에서도 뺀다 —\n // 더는 우리 칸이 아니므로, 사용자가 남긴 값은 이후 사용자 것이다.\n const retained = { ...(theirConfig ?? {}) };\n for (const field of RETIRED_CONFIG_FIELDS) {\n const priorWritten = priorConfig?.writtenFields;\n if (priorWritten === undefined || !hasField(priorWritten, field) || !hasField(retained, field)) {\n continue;\n }\n if (stableStringify(retained[field]) !== stableStringify(priorWritten[field])) {\n notes.push(`${HARNESS_CONFIG_PATH}: you changed ${field} — left as you set it (ainecto no longer writes it).`);\n continue;\n }\n const original = priorConfig?.originalFields?.[field];\n if (original?.at === \"json\") {\n retained[field] = original.value;\n } else {\n delete retained[field];\n }\n }\n const mergedConfig = serialize({ ...retained, ...ourFields });\n record.files[HARNESS_CONFIG_PATH] = {\n scope: \"fields\",\n createdByUs: priorConfig?.createdByUs ?? existingConfig === undefined,\n original: ABSENT,\n written: ownedText(mergedConfig),\n fileFingerprint: fingerprintFor(HARNESS_CONFIG_PATH, mergedConfig),\n writtenFields: { ...ourFields },\n originalFields,\n };\n if (mergedConfig !== existingConfig) {\n writes.push({\n path: HARNESS_CONFIG_PATH,\n content: mergedConfig,\n existed: existingConfig !== undefined,\n });\n }\n }\n\n // ── 기록 — 우리 파일. 통째로 쓰고 통째로 지운다 ───────────────────────────────\n const existingRecord = input.files.get(HARNESS_RECORD_PATH);\n const recordContent = serializeRecord(record);\n // ★변경 없는 재실행은 아무 파일도 안 바꿔야 한다(5차 독립 리뷰 S2). ⚠그렇다고 「쓸 것이\n // 없다」가 「새로 알게 된 사실도 없다」를 뜻해선 안 된다 — mkdir 결과는 적용이 따로 저장한다\n // (8차 독립 리뷰 S1).\n if (recordContent !== existingRecord) {\n writes.push({\n path: HARNESS_RECORD_PATH,\n content: recordContent,\n existed: existingRecord !== undefined,\n });\n }\n\n return { writes, deletes: [], notes, record };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// 계획 — undo\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * 한 파일에 대한 처리 «결과». ★완료·보존·미해결을 타입으로 가른다.\n *\n * <p>예전엔 셋이 같은 코드 경로로 흘렀고, 그래서 「손대지 않음」이 「복구 완료」와 같은 결과가\n * 됐다 — 판단 재료가 없어 아무것도 못 한 파일의 백업까지 지웠다(8차 독립 리뷰 I3).\n */\ntype Outcome =\n /** 목표에 도달했다 — 기록에서 지운다. */\n | { kind: \"done\"; note?: string }\n /** 되돌렸다 — 파일을 쓰고 기록에서 지운다. */\n | { kind: \"write\"; content: string; note?: string }\n /** 되돌렸다 — 파일을 지우고 기록에서 지운다. */\n | { kind: \"delete\"; note?: string }\n /** 이제 사용자 것이다 — 파일은 그대로 두고 기록에서 지운다. */\n | { kind: \"keep\"; note: string }\n /** 아직 못 했다 — ★기록을 «지키고» 이유를 말한다. */\n | { kind: \"unresolved\"; note: string };\n\nexport interface PlanUndoInput {\n files: FileSnapshot;\n /** 기록 «상태». 없으면 스냅샷에서 읽는다. */\n record?: RecordState;\n}\n\n/**\n * ★<b>우리가 쓴 것만 되돌린다.</b> 남의 서버 항목, 사용자가 표식 밖에 적은 글은 그대로 둔다.\n * 파일을 지우는 것은 «우리가 만든 파일»뿐이다.\n */\nexport function planUndo(input: PlanUndoInput): InitPlan {\n const state = input.record ?? readRecord(input.files.get(HARNESS_RECORD_PATH));\n const writes: FileWrite[] = [];\n const deletes: string[] = [];\n const notes: string[] = [];\n const tail = () => {\n // 기기 전역 연결(Claude Code 사용자 범위·Cursor 전역·Codex)은 setup 의 것이다 — init 은 그것을 쓰지 않는다.\n notes.push(\"Agent connections that `ainecto setup` made on this machine are removed with `ainecto setup --undo`.\");\n };\n\n if (state.state === \"absent\") {\n // ★기록이 없으면 «아무것도» 되돌리지 않는다. 예전엔 이름이 우리 것이면 지웠는데,\n // init 을 한 적도 없는 저장소의 사용자 항목까지 지웠다(독립 재리뷰 I2).\n notes.push(`No record of a previous init in ${HARNESS_RECORD_PATH} — no local file was changed.`);\n tail();\n return { writes, deletes, notes };\n }\n if (state.state !== \"valid\") {\n // ⛔손상·구판 기록으로 파일을 «지우지» 않는다. 그 안에 아직 못 되돌린 원본이 있을 수 있고,\n // 우리는 그것을 읽어 내지 못했다(8차 독립 리뷰 I1·S2).\n notes.push(\n `${state.reason}. Nothing was changed — that file is kept because it may hold backups `\n + \"--undo still needs. Restore it, or finish the undo with the CLI version that wrote it.\",\n );\n tail();\n return { writes, deletes, notes };\n }\n\n const record = state.record;\n /** 남은 의무. ★끝난 항목만 지운다 — 못 한 것은 남는다. */\n const remaining: Record<string, FileContract> = { ...record.files };\n\n for (const [path, contract] of Object.entries(record.files)) {\n const outcome = undoOne(path, contract, input.files.get(path));\n if (outcome.kind !== \"unresolved\" && outcome.kind !== \"keep\" && outcome.note !== undefined) {\n notes.push(outcome.note);\n } else if (outcome.kind === \"unresolved\" || outcome.kind === \"keep\") {\n notes.push(outcome.note);\n }\n if (outcome.kind === \"unresolved\") {\n continue; // 기록을 지킨다.\n }\n delete remaining[path];\n if (outcome.kind === \"write\") {\n writes.push({ path, content: outcome.content, existed: true });\n } else if (outcome.kind === \"delete\") {\n deletes.push(path);\n }\n }\n\n tail();\n\n // ★기록 파일은 «전부 우리 것»이다 — 남은 의무가 있으면 줄여서 다시 쓰고, 없으면 지운다.\n // 「이 칸이 누구 것인가」를 판정할 일이 없다.\n if (input.files.get(HARNESS_RECORD_PATH) !== undefined) {\n if (Object.keys(remaining).length > 0) {\n const reduced: InitRecord = { ...record, files: remaining };\n writes.push({ path: HARNESS_RECORD_PATH, content: serializeRecord(reduced), existed: true });\n notes.push(\n `${HARNESS_RECORD_PATH}: kept, with the finished items removed — it still holds the backups `\n + \"--undo needs. Run --undo again once the items above are resolved.\",\n );\n } else {\n deletes.push(HARNESS_RECORD_PATH);\n }\n }\n\n // ★비었다고 다 치우지 않는다 — 우리가 만든 것만. 그 목록은 적용이 mkdir 결과로 적어 둔다.\n const removableDirectories = parentsOf(deletes)\n .filter((directory) => record.createdDirectories.includes(directory));\n\n return { writes, deletes, notes, removableDirectories };\n}\n\n/**\n * ★<b>이 파일에 남은 관리 블록을 기록으로 «설명할 수 있나».</b> 설명되지 않는 것이 하나라도\n * 있으면 우리 블록이 어딘가에 있을 수 있다는 뜻이고, 그러면 의무를 완료로 만들지 않는다.\n *\n * <p>★<b>판정을 뒤집은 자리다</b>(9차 2차 리뷰 B2·N1). 「우리 블록을 알아본다」로 짜면 제목 한 줄\n * 편집·인용문 이동·마커 중첩에 전부 뚫리고, 거꾸로 init 전부터 있던 «똑같은» 예제를 우리 것으로\n * 오인해 정상 되돌리기를 막는다. 그래서 알아보려 하지 않고 <b>기록해 둔 예제를 지워 나간 뒤\n * 남는 것</b>을 센다. 모양 비교는 「적어 둔 예제가 그대로 있나」에만 쓴다.\n */\nfunction unexplainedMarkers(existing: string | undefined, contract: FileContract): number {\n const recorded = [...(contract.foreignBlocks ?? [])];\n let unexplained = 0;\n for (const print of markerEvidence(existing)) {\n const at = recorded.indexOf(print);\n if (at >= 0) {\n recorded.splice(at, 1); // init 전에 있던 그 블록이다 — 우리 일이 아니다.\n } else {\n unexplained += 1;\n }\n }\n return unexplained;\n}\n\n/** 이 파일 하나를 어떻게 할까. ★{@link Outcome} 하나만 돌려준다 — 부수효과 없음. */\nfunction undoOne(path: string, contract: FileContract, existing: string | undefined): Outcome {\n if (existing === undefined) {\n if (contract.original.at !== \"absent\" || contract.scope === \"fields\") {\n // 백업을 든 파일이 사라졌다. 「없으니 건너뛴다」로 기록을 지우면 그 원본은 영영\n // 사라진다 — 사용자가 파일을 되살릴 수도 있다(5차 독립 리뷰 I2).\n return {\n kind: \"unresolved\",\n note: `${path} is gone, so what was there before init could not be put back — `\n + \"the backup is kept. Restore the file and run --undo again.\",\n };\n }\n return { kind: \"done\" };\n }\n switch (contract.scope) {\n case \"entry\": return undoEntry(path, contract, existing);\n case \"block\": return undoBlock(path, contract, existing);\n case \"fields\": return undoFields(path, contract, existing);\n case \"whole\": return undoWhole(path, contract, existing);\n }\n}\n\nfunction undoEntry(path: string, contract: FileContract, existing: string): Outcome {\n const current = readServerEntry(existing);\n const currentOwned = ownedJson(current, current !== undefined);\n if (sameOwned(currentOwned, contract.original)) {\n return {\n kind: \"done\",\n note: contract.original.at === \"absent\"\n ? `${path}: the \"${SERVER_NAME}\" entry ainecto added is already gone.`\n : `${path}: your original \"${SERVER_NAME}\" entry is already back in place.`,\n };\n }\n // ★안내대로 지운 사람에게 같은 안내를 반복하지 않는다 — 남은 일은 원본을 도로 넣는 것이고\n // 그 경로가 바로 아래에 있다(7차 독립 리뷰 S2).\n const goneButWeHoldTheOriginal = current === undefined && contract.original.at !== \"absent\";\n if (!goneButWeHoldTheOriginal && !sameOwned(currentOwned, contract.written)) {\n return {\n kind: \"unresolved\",\n note: `${path}: the \"${SERVER_NAME}\" entry was edited after init — left in place. `\n + \"Remove it by hand if you meant to, then run --undo again.\",\n };\n }\n const restore = contract.original.at === \"json\" ? { value: contract.original.value } : undefined;\n const result = removeServerEntry(existing, restore);\n if (result.emptied && contract.createdByUs) {\n return { kind: \"delete\" };\n }\n if (result.content !== undefined && result.content !== existing) {\n return {\n kind: \"write\",\n content: result.content,\n note: restore === undefined ? undefined : `${path}: restored your original \"${SERVER_NAME}\" entry.`,\n };\n }\n return { kind: \"done\" };\n}\n\nfunction undoBlock(path: string, contract: FileContract, existing: string): Outcome {\n const current = existingMarkerBlock(existing);\n const currentOwned = ownedText(current);\n // ★<b>「예제가 있다」와 「우리 블록이 옮겨져 남았다」를 개수로 가른다.</b> Boolean 하나로는\n // 둘을 표현할 수 없었고, 예제가 있는 파일에서는 우리 블록이 남아 있어도 완료로 읽혔다\n // (8차 독립 리뷰 I5).\n // ★기록으로 설명되지 않는 마커가 있으면, 정상 위치의 블록을 걷어내는 것으로 의무가 끝나지\n // 않는다 — 우리 블록이 그 자리에 있을 수 있다. 개수도 모양도 아니라 «증거 대조»다(9차 2차 B2).\n if (unexplainedMarkers(existing, contract) > 0) {\n return {\n kind: \"unresolved\",\n note: `${path}: this file has an ainecto marker block that --undo cannot account for `\n + \"(inside a code fence, a quote, or edited). Remove it by hand, then run --undo again.\",\n };\n }\n if (sameOwned(currentOwned, contract.original)) {\n return {\n kind: \"done\",\n note: contract.original.at === \"absent\"\n ? `${path}: the ainecto block is already gone.`\n : `${path}: the ainecto block that was there before is already back in place.`,\n };\n }\n if (current === undefined && contract.original.at === \"text\") {\n // ★안내대로 지웠다 — 원본 블록을 도로 넣는다. 예전엔 여기서도 「손으로 지우고 다시\n // 실행하라」를 반복해, 이미 지운 사람에게 실행되지 않는 경로를 요구했다(8차 S3).\n const body = existing.trim()\n ? `${existing.replace(/\\s*$/, \"\")}\\n\\n${contract.original.text}\\n`\n : `${contract.original.text}\\n`;\n return { kind: \"write\", content: body, note: `${path}: restored the ainecto block that was there before.` };\n }\n if (!sameOwned(currentOwned, contract.written)) {\n return {\n kind: \"unresolved\",\n note: `${path}: the ainecto block was edited after init — left in place. `\n + \"Remove the block by hand if you meant to, then run --undo again.\",\n };\n }\n let result: { content: string; removed: boolean; emptied: boolean };\n try {\n result = contract.original.at === \"text\"\n ? { content: replaceMarkerBlockWith(existing, contract.original.text), removed: true, emptied: false }\n : removeMarkerBlock(existing);\n } catch (error) {\n return { kind: \"unresolved\", note: `${path}: ${error instanceof Error ? error.message : String(error)}` };\n }\n if (!result.removed) {\n return {\n kind: \"unresolved\",\n note: `${path}: the ainecto block could not be removed — it is still in the file. `\n + \"Remove it by hand, then run --undo again.\",\n };\n }\n if (result.emptied && contract.createdByUs) {\n return { kind: \"delete\" };\n }\n return {\n kind: \"write\",\n content: result.content,\n note: contract.original.at === \"text\"\n ? `${path}: restored the ainecto block that was there before.`\n : undefined,\n };\n}\n\nfunction undoWhole(path: string, contract: FileContract, existing: string): Outcome {\n if (sameOwned(ownedText(existing), contract.original)) {\n // 사용자가 손으로 원본을 되돌려 놨다 — 목표에 이미 도달했다(6차 독립 리뷰 I2).\n return { kind: \"done\", note: `${path} is already the file that existed before init.` };\n }\n if (!sameOwned(ownedText(existing), contract.written)) {\n if (contract.original.at === \"text\") {\n return {\n kind: \"unresolved\",\n note: `${path} was edited after init — left in place instead of restoring the pre-init file. `\n + \"The backup is kept; run --undo again once you have resolved it.\",\n };\n }\n // 우리가 만든 파일을 사용자가 고쳤다 — 이제 사용자 것이다.\n return { kind: \"keep\", note: `${path} was edited after init — left in place instead of deleting it.` };\n }\n if (contract.original.at === \"text\") {\n return {\n kind: \"write\",\n content: contract.original.text,\n note: `${path}: restored the file that existed before init.`,\n };\n }\n return contract.createdByUs ? { kind: \"delete\" } : { kind: \"done\" };\n}\n\nfunction undoFields(path: string, contract: FileContract, existing: string): Outcome {\n const parsed = parseJsonObject(existing);\n if (parsed === undefined) {\n // ★「손대지 않음」은 «복구 완료»가 아니다. 판단 재료가 없으면 백업을 지킨다(8차 I3).\n return {\n kind: \"unresolved\",\n note: `${path} is not a JSON object any more, so ainecto could not take its fields back out — `\n + \"the backup is kept. Fix the file and run --undo again.\",\n };\n }\n // ★<b>로더와 «같은» 검증을 여기서도 한다.</b> 그리고 여기서는 부르는 쪽이 아는 것을 하나 더\n // 넘긴다 — 어느 칸이 우리 것인지. 그래서 「우리가 쓴 칸인데 기록에 없다」까지 걸린다.\n // ⛔빈 map 으로 메우면 모든 칸이 「우리 것이 아니다」로 읽혀 파일은 그대로 두고 백업만\n // 지운다. 판정 자료가 반쯤 맞으면 그것으로 파일을 고치지 않는다(9차 B1 · 2차 리뷰 B1).\n const owned = ownedConfigFields(contract);\n const contractProblem = fieldsContractProblem(contract, owned);\n if (contractProblem !== undefined) {\n return {\n kind: \"unresolved\",\n note: `${path}: ainecto's record of the fields it wrote ${contractProblem}, so its fields `\n + \"were left in place — the backup is kept. Restore that record, or remove the fields by hand.\",\n };\n }\n const written = contract.writtenFields!;\n const originals = contract.originalFields!;\n const next: Record<string, unknown> = {};\n const kept: string[] = [];\n for (const [field, value] of Object.entries(parsed)) {\n if (!owned.includes(field)) {\n next[field] = value; // 사용자 칸 — 손대지 않는다.\n continue;\n }\n if (!hasField(written, field)) {\n // ★우리 칸 이름인데 기록이 그 칸을 말하지 않는다 — 판정 자료가 없다. 「사용자가 고쳤다」도\n // 「우리 것이 아니다」도 근거가 없으므로 완료로 바꾸지 않는다(9차 B1).\n return {\n kind: \"unresolved\",\n note: `${path}: ainecto has no record of what it wrote for ${field}, so its fields were `\n + \"left in place — the backup is kept. Restore that record, or remove the field by hand.\",\n };\n }\n const stillOurs = stableStringify(value) === stableStringify(written[field]);\n if (!stillOurs) {\n // ★이름이 우리 것이어도 «값»은 사용자가 고쳤다. 되돌리기가 그것을 덮지 않는다(7차 I2).\n next[field] = value;\n kept.push(field);\n continue;\n }\n const original = originals[field];\n // ★되돌릴 «목표»를 모르면 지우지 않는다. 예전엔 json 이 아닌 모든 것을 「우리가 더한 칸」으로\n // 묶어 지웠고, 원본이 {at:\"text\"} 로 바뀐 기록 하나가 config 를 «비웠다»(2차 리뷰 B1).\n // 위 검증이 이미 막지만, 이 판단을 그 검증에만 맡기지 않는다 — 여기가 파일을 고치는 자리다.\n if (original === undefined || (original.at !== \"json\" && original.at !== \"absent\")) {\n return {\n kind: \"unresolved\",\n note: `${path}: ainecto cannot tell what was in ${field} before it wrote there, so the `\n + \"file was left as it is — the backup is kept. Remove the field by hand if you meant to.\",\n };\n }\n if (original.at === \"json\") {\n next[field] = original.value; // 원래 있던 칸 → 원본 값으로.\n }\n // ⚠original 이 absent 면 우리가 «더한» 칸이므로 넣지 않는다 = 지운다.\n // ★사용자가 우리 칸을 «지웠으면» 그 칸은 위 루프에 아예 안 들어온다 — 그래서 되살아나지\n // 않는다. 예전엔 뒤에 보충 루프가 있어 삭제를 무조건 되돌렸다(8차 독립 리뷰 I4).\n }\n const note = kept.length === 0 ? undefined\n : `${path}: you changed ${kept.join(\", \")} after init — left as you set it instead of `\n + \"putting the pre-init value back.\";\n if (Object.keys(next).length === 0 && contract.createdByUs) {\n return { kind: \"delete\", note };\n }\n // ★파일이 원래 «빈 객체»였으면 빈 객체를 되돌린다 — 부재와 구별한다(8차 독립 리뷰 I6).\n const body = serialize(next);\n return body === existing\n ? { kind: \"done\", note }\n : {\n kind: \"write\",\n content: body,\n note: note ?? `${path}: removed what ainecto wrote and kept the rest.`,\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// 적용이 쓰는 것\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * 기록의 {@code createdDirectories} 를 «실제로 만든 것»으로 갈아 끼운다.\n *\n * <p>★자기 지문을 다시 계산하는 장치가 없다 — 기록이 우리 파일이라 지문을 재지 않기 때문이다.\n * 같은 순환 함정을 세 번 «요령»으로 막은 뒤(4차 I7 · 5차 S3 · 6차) 순환이 생기는 구조를\n * 없애는 쪽이 답이었다.\n */\nexport function withCreatedDirectories(current: string, directories: readonly string[]): string {\n const state = readRecord(current);\n if (state.state !== \"valid\") {\n return current;\n }\n return serializeRecord({ ...state.record, createdDirectories: [...directories] });\n}\n\nexport { readRecord, serializeRecord, emptyRecord } from \"./initRecord\";\nexport type { InitRecord, RecordState, FileContract, Owned } from \"./initRecord\";\n\n/** 이 경로들의 «저장소 안» 부모 디렉터리. 깊은 것부터 — .a/b 를 치워야 .a 가 비워진다. */\nfunction parentsOf(paths: readonly string[]): string[] {\n const directories = new Set<string>();\n for (const path of paths) {\n const parent = path.includes(\"/\") ? path.slice(0, path.lastIndexOf(\"/\")) : \"\";\n if (parent) {\n directories.add(parent);\n }\n }\n return [...directories].sort((left, right) => right.length - left.length);\n}\n","import { assertTrustedEndpointUrl } from \"../config/endpoints\";\nimport { AGENT_NOTE_KEY, DOC_KEY, documentContractProblem } from \"./harnessDoc\";\n\n/**\n * 저장소에 쓸 하네스 문서를 서버에서 받아 온다.\n *\n * <p>★<b>이것이 「규칙을 고치려면 npm 퍼블리시」를 끊는 지점이다.</b> 예전엔 본문이 패키지\n * 안에 박혀 있어서, 한 줄 고치려면 CLI 를 배포하고 모든 사용자가 init 을 다시 쳐야 했다.\n *\n * <p>⚠<b>못 받으면 «기본값을 썼다»고 적는다.</b> 조용히 패키지 사본으로 떨어지면, 서버에서\n * 규칙을 고쳐도 안 바뀌는 이유를 사용자가 영영 못 찾는다 — 오늘 여러 번 만난 모양이다.\n *\n * <p>MCP 엔드포인트 아래({@code <endpoint>/harness/documents})에 둔 이유: MCP 토큰은 REST\n * ({@code /api/v1/...})에서 거절되고, 도구로 내면 모든 세션의 도구 목록이 한 칸 늘어난다.\n */\nexport interface HarnessDocuments {\n doc?: string;\n agentNote?: string;\n /** 어느 판을 받았나. 못 받았으면 undefined. */\n versions: Record<string, string>;\n /** 못 받은 이유 — 요청 자체가 실패했을 때. 받았으면 undefined. */\n unavailableReason?: string;\n /**\n * ★<b>문서별로 패키지 기본값을 쓴 이유.</b> 서버가 HTTP 200 으로 «빈 문서»를 주거나\n * 계약을 안 지킨 본문을 줘도 예전엔 조용히 패키지 사본으로 떨어졌다 — 사용자는 자기가\n * 서버 판을 받았다고 믿는다(2026-09-23 독립 재리뷰 I5).\n */\n fallbacks: Record<string, string>;\n}\n\nexport interface FetchHarnessDocumentsInput {\n endpoint: string;\n accessToken?: string;\n client?: string;\n fetchImpl?: typeof fetch;\n}\n\nexport async function fetchHarnessDocuments(\n input: FetchHarnessDocumentsInput,\n): Promise<HarnessDocuments> {\n const url = new URL(`${input.endpoint.replace(/\\/$/, \"\")}/harness/documents`);\n assertTrustedEndpointUrl(url, \"harness documents URL\");\n if (input.client) {\n url.searchParams.set(\"client\", input.client);\n }\n const fetchImpl = input.fetchImpl ?? fetch;\n try {\n const response = await fetchImpl(url.toString(), {\n headers: {\n accept: \"application/json\",\n ...(input.accessToken ? { authorization: `Bearer ${input.accessToken}` } : {}),\n },\n });\n if (!response.ok) {\n return { versions: {}, fallbacks: {}, unavailableReason: `server answered HTTP ${response.status}` };\n }\n const payload = (await response.json()) as {\n documents?: Record<string, { body?: unknown; version?: unknown; reason?: unknown }>;\n };\n const documents = payload.documents ?? {};\n const versions: Record<string, string> = {};\n const fallbacks: Record<string, string> = {};\n const bodies: Record<string, string | undefined> = {};\n for (const key of [DOC_KEY, AGENT_NOTE_KEY]) {\n const entry = documents[key];\n const problem = usableBodyProblem(key, entry);\n if (problem) {\n // 서버가 이유를 말해 줬으면 그것을 쓰고, 아니면 우리가 본 것을 쓴다.\n fallbacks[key] = typeof entry?.reason === \"string\" && entry.reason ? entry.reason : problem;\n continue;\n }\n bodies[key] = entry!.body as string;\n if (typeof entry?.version === \"string\") {\n versions[key] = entry.version;\n }\n }\n return { doc: bodies[DOC_KEY], agentNote: bodies[AGENT_NOTE_KEY], versions, fallbacks };\n } catch (error) {\n return {\n versions: {},\n fallbacks: {},\n unavailableReason: error instanceof Error ? error.message : String(error),\n };\n }\n}\n\n/**\n * 이 응답 조각을 저장소에 «써도 되는가». 쓰면 안 되는 이유가 있으면 그 이유를 돌려준다.\n *\n * <p>★서버가 200 을 줬다는 것은 «전송이 됐다»는 뜻이지 «쓸 수 있는 글»이라는 뜻이 아니다.\n * 예전엔 본문이 비어 있지만 않으면 그대로 파일에 썼다 — 변수가 빠진 DOC 이나 관리 마커가\n * 없는 AGENT_NOTE 가 사용자 저장소에 들어갔고, 마커가 없으면 재실행마다 덧붙고 undo 도\n * 못 걷어낸다(2026-09-23 독립 재리뷰 I1).\n */\nfunction usableBodyProblem(key: string, entry: { body?: unknown } | undefined): string | undefined {\n if (typeof entry?.body !== \"string\" || !entry.body.trim()) {\n return `server returned no body for ${key}`;\n }\n return documentContractProblem(key, entry.body);\n}\n","import { lstat, readFile, realpath } from \"node:fs/promises\";\nimport { dirname, join, resolve, sep } from \"node:path\";\n\n/** 저장소 안의 파일을 다루는 문 — init 이 읽고 쓰는 모든 경로가 이 경계 검사를 지난다. */\n\n/** cwd 에서 위로 올라가며 {@code .git} 이 있는 첫 디렉터리. 없으면 undefined. */\nexport async function findGitRoot(cwd: string): Promise<string | undefined> {\n for (let at = resolve(cwd); ; at = dirname(at)) {\n try {\n await lstat(join(at, \".git\"));\n return at;\n } catch {\n // 없다(또는 볼 수 없다) — 한 칸 위로.\n }\n if (dirname(at) === at) {\n return undefined;\n }\n }\n}\n\n/**\n * ★<b>저장소 안의 파일을 읽는 유일한 문.</b> 경계 검사가 읽기 «앞»에 붙어 있다.\n *\n * <p>예전엔 스냅샷만 검사를 했고, 나중에 붙인 역할 추론이 파일을 바로 읽었다. 그래서 저장소 밖을\n * 가리키는 설정 파일을 <b>한 번 읽고 나서</b> 거절했다(2026-09-23 4차 독립 리뷰 I5). 검사와 읽기가\n * 갈라지면, 새로 생긴 경로마다 검사를 잊는다.\n */\nexport async function readManagedFile(root: string, path: string): Promise<string | undefined> {\n await assertInsideRepository(root, path);\n return readIfExists(join(root, path));\n}\n\nexport async function readIfExists(absolutePath: string): Promise<string | undefined> {\n try {\n return await readFile(absolutePath, \"utf8\");\n } catch (error) {\n if (isNodeError(error, \"ENOENT\")) {\n return undefined;\n }\n throw error;\n }\n}\n\n/**\n * ★이 경로가 정말 저장소 «안»인가.\n *\n * <p>{@code join(root, path)} 는 이름을 이어 붙일 뿐이고, {@code readFile}/{@code writeFile}\n * 은 심볼릭 링크를 따라간다. {@code .ainecto → /somewhere/else} 인 저장소에서 undo 를 돌리면\n * 남의 디렉터리 파일이 지워졌다(2026-09-22 독립 리뷰 I4). 실제 경로로 풀어서 경계를 본다.\n */\nexport async function assertInsideRepository(root: string, relativePath: string): Promise<void> {\n const absolutePath = join(root, relativePath);\n const realRoot = await realpath(root);\n let realParent: string;\n try {\n realParent = await realpath(dirname(absolutePath));\n } catch (error) {\n if (isNodeError(error, \"ENOENT\")) {\n return; // 아직 없는 디렉터리는 우리가 만든다 — 링크일 수 없다.\n }\n throw error;\n }\n if (realParent !== realRoot && !realParent.startsWith(realRoot + sep)) {\n throw new Error(\n `${relativePath} resolves outside the repository (${realParent}); refusing to touch it.`,\n );\n }\n try {\n if ((await lstat(absolutePath)).isSymbolicLink()) {\n throw new Error(`${relativePath} is a symbolic link; refusing to write through it.`);\n }\n } catch (error) {\n if (!isNodeError(error, \"ENOENT\")) {\n throw error;\n }\n }\n}\n\nfunction isNodeError(error: unknown, code: string): boolean {\n return typeof error === \"object\" && error !== null && (error as { code?: unknown }).code === code;\n}\n","import { McpRpcError, type McpRpcClient } from \"../mcp/rpcClient\";\nimport { extractProjects, unwrapMcpToolPayload } from \"../mcp/toolPayload\";\n\n/**\n * 로그인한 계정의 요약 — setup·status·doctor 가 같은 함수로 읽는다(읽기만).\n * {@code initialize} → {@code identity_get_self}(userId·표시 이름·직무) → {@code list_projects}(개수만).\n *\n * <p>★이메일은 받지도 내지도 않는다(서버 identity_get_self 도 주지 않는다). 직무는 표시명({@code jobProfile.title})만\n * 쓴다 — 직무 코드 표를 CLI 에 복사하지 않는다.\n */\nexport interface AccountSummary {\n userId?: string;\n displayName?: string;\n /** 직무 표시명. 미설정이면 null. 서버가 칸을 안 주면(옛 서버) undefined. */\n jobTitle?: string | null;\n projectCount?: number;\n /** 못 읽은 이유 — 있으면 위 칸은 읽은 데까지만. */\n problem?: AccountProblem;\n}\n\nexport interface AccountProblem {\n /** network = 서버에 못 닿음 · unauthorized = 401 · forbidden = 403(요금제에 MCP 없음 또는 계정 정지) · other */\n kind: \"network\" | \"unauthorized\" | \"forbidden\" | \"other\";\n message: string;\n}\n\nexport async function readAccount(client: McpRpcClient): Promise<AccountSummary> {\n const summary: AccountSummary = {};\n try {\n await client.initialize();\n const self = unwrapMcpToolPayload(await client.toolsCall(\"identity_get_self\", {})) as Record<string, unknown>;\n if (typeof self?.userId === \"string\") summary.userId = self.userId;\n if (typeof self?.displayName === \"string\") summary.displayName = self.displayName;\n if (\"jobProfile\" in (self ?? {})) {\n const profile = self.jobProfile as { title?: unknown } | null;\n summary.jobTitle = profile && typeof profile.title === \"string\" ? profile.title : null;\n }\n summary.projectCount = extractProjects(unwrapMcpToolPayload(await client.toolsCall(\"list_projects\", {}))).length;\n } catch (error) {\n summary.problem = classify(error);\n }\n return summary;\n}\n\nfunction classify(error: unknown): AccountProblem {\n const message = error instanceof Error ? error.message : String(error);\n if (error instanceof McpRpcError && error.code === \"MCP_HTTP_ERROR\") {\n const status = (error.details as { status?: number } | undefined)?.status;\n if (status === 401) return { kind: \"unauthorized\", message };\n if (status === 403) return { kind: \"forbidden\", message };\n return { kind: \"other\", message };\n }\n if (error instanceof McpRpcError) {\n return { kind: \"other\", message };\n }\n // fetch 자체가 던진 것 — 연결 실패(DNS·TLS·오프라인).\n return { kind: \"network\", message };\n}\n","import { chmod, mkdir, readFile, rename, stat, writeFile } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\nimport {\n buildServerEntry,\n entryCarriesRole,\n isOurBridge,\n pinnedBridgeVersion,\n mergeServerEntry,\n readServerEntry,\n removeServerEntry,\n SERVER_NAME,\n type McpServerEntry,\n} from \"../harness/agentTargets\";\nimport { lastLine, type CommandRunner } from \"./commandRunner\";\n\n/**\n * ★기기 전역의 에이전트 연결 — Claude Code(사용자 범위) · Cursor(전역 {@code ~/.cursor/mcp.json}) · Codex.\n * setup 이 쓰고(connect/disconnect), status·doctor 가 읽는다(inspect). 셋이 같은 판정을 쓴다.\n *\n * <p>소유 판정은 {@link isOurBridge} 하나다 — 기록 파일을 따로 두지 않는다. 남의 {@code ainecto} 항목\n * (원격 URL 등)은 건드리지 않고 그대로 보고한다.\n *\n * <p>Claude Code·Codex 는 그 도구의 CLI({@code claude mcp …}·{@code codex mcp …})로만 고친다 — 설정 파일\n * 형식을 우리가 쓰지 않는다. Cursor 는 CLI 가 없어 우리가 JSON 을 병합한다(남의 항목·다른 키 보존).\n */\n\nexport type AgentClientId = \"claude-code\" | \"cursor\" | \"codex\";\n\nexport const AGENT_CLIENT_LABELS: Record<AgentClientId, string> = {\n \"claude-code\": \"Claude Code\",\n cursor: \"Cursor\",\n codex: \"Codex\",\n};\n\n/** 지금 있는 {@code ainecto} 항목의 모양. 명령형(stdio) 또는 주소형. */\nexport type ExistingEntry = { command: string; args: string[] } | { url: string };\n\nexport interface AgentState {\n client: AgentClientId;\n installed: boolean;\n /** 항목이 있는 범위 — Claude: user·local·project / Cursor·Codex: global. */\n scope?: string;\n entry?: ExistingEntry;\n /** 우리 브리지 항목인가. */\n ours: boolean;\n /** 옛 {@code --role} 을 싣고 있나(0.7.x 의 흔적). */\n carriesRole: boolean;\n /** 고정한 브리지 판({@code @ainecto/mcp@X}). 고정하지 않았으면 undefined. */\n pinnedVersion?: string;\n /** 읽다가 막힌 이유 — 있으면 상태를 모른다. */\n problem?: string;\n}\n\nexport type ConnectionStatus =\n | \"connected\" | \"updated\" | \"kept\" | \"not installed\" | \"failed\" | \"removed\" | \"not connected\";\n\nexport interface ConnectionOutcome {\n client: AgentClientId;\n label: string;\n status: ConnectionStatus;\n /** dry-run 이면 «했을» 일이다. */\n planned?: true;\n detail?: string;\n}\n\nexport interface AgentContext {\n runner: CommandRunner;\n /** 사용자 홈 — Cursor 전역 설정의 자리. 시험은 임시 폴더를 준다. */\n home: string;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// 읽기\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport async function inspectAgents(context: AgentContext): Promise<AgentState[]> {\n return [await inspectClaude(context), await inspectCursor(context), await inspectCodex(context)];\n}\n\nconst NOT_FOUND = /No MCP server named/i;\n\n/**\n * Claude Code. {@code claude mcp get ainecto} 는 «이긴» 범위 하나를 말한다(local > project > user).\n * setup 은 홈 폴더에서 실행해 저장소의 local·project 범위가 끼지 않게 한다(실행기의 cwd).\n */\nexport async function inspectClaude({ runner }: AgentContext): Promise<AgentState> {\n const base = { client: \"claude-code\" as const, ours: false, carriesRole: false };\n const result = await runner(\"claude\", [\"mcp\", \"get\", SERVER_NAME]);\n if (result.missing) {\n return { ...base, installed: false };\n }\n if (result.exitCode !== 0) {\n return NOT_FOUND.test(result.stdout + result.stderr)\n ? { ...base, installed: true }\n : { ...base, installed: true, problem: lastLine(result.stderr) ?? `claude mcp get exited ${result.exitCode}` };\n }\n const field = (name: string) => result.stdout.match(new RegExp(`^\\\\s*${name}:\\\\s*(.*)$`, \"m\"))?.[1]?.trim();\n const scopeText = field(\"Scope\") ?? \"\";\n const scope = /^user/i.test(scopeText) ? \"user\" : /^local/i.test(scopeText) ? \"local\"\n : /^project/i.test(scopeText) ? \"project\" : scopeText || undefined;\n const url = field(\"URL\");\n const command = field(\"Command\");\n const entry: ExistingEntry | undefined = url\n ? { url }\n : command ? { command, args: (field(\"Args\") ?? \"\").split(/\\s+/).filter(Boolean) } : undefined;\n return { ...base, installed: true, scope, ...describe(entry) };\n}\n\nexport async function inspectCursor({ home }: AgentContext): Promise<AgentState> {\n const base = { client: \"cursor\" as const, ours: false, carriesRole: false, scope: \"global\" };\n if (!(await exists(join(home, \".cursor\")))) {\n return { ...base, installed: false };\n }\n let content: string | undefined;\n try {\n content = await readFile(cursorConfigPath(home), \"utf8\");\n } catch (error) {\n if (!isNodeError(error, \"ENOENT\")) {\n return { ...base, installed: true, problem: error instanceof Error ? error.message : String(error) };\n }\n }\n if (content !== undefined && content.trim()) {\n try {\n JSON.parse(content);\n } catch {\n return { ...base, installed: true, problem: `${cursorConfigPath(home)} is not valid JSON` };\n }\n }\n const raw = readServerEntry(content);\n return { ...base, installed: true, ...describe(toExisting(raw)) };\n}\n\nexport async function inspectCodex({ runner }: AgentContext): Promise<AgentState> {\n const base = { client: \"codex\" as const, ours: false, carriesRole: false, scope: \"global\" };\n const result = await runner(\"codex\", [\"mcp\", \"get\", SERVER_NAME, \"--json\"]);\n if (result.missing) {\n return { ...base, installed: false };\n }\n if (result.exitCode !== 0) {\n return NOT_FOUND.test(result.stdout + result.stderr)\n ? { ...base, installed: true }\n : { ...base, installed: true, problem: lastLine(result.stderr) ?? `codex mcp get exited ${result.exitCode}` };\n }\n try {\n const parsed = JSON.parse(result.stdout) as { transport?: { command?: unknown; args?: unknown; url?: unknown } };\n const transport = parsed.transport ?? {};\n return { ...base, installed: true, ...describe(toExisting(transport)) };\n } catch {\n return { ...base, installed: true, problem: \"codex mcp get --json did not return JSON\" };\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// 쓰기\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * 한 클라이언트를 우리 브리지에 연결한다. ★남의 항목은 건드리지 않는다. 실패는 그 클라이언트만의 결과다 —\n * 던지지 않는다(나머지 클라이언트는 계속한다).\n */\nexport async function connectAgent(\n state: AgentState,\n desired: McpServerEntry,\n context: AgentContext,\n dryRun: boolean,\n): Promise<ConnectionOutcome> {\n const outcome = (status: ConnectionStatus, detail?: string): ConnectionOutcome => ({\n client: state.client, label: AGENT_CLIENT_LABELS[state.client], status,\n ...(dryRun && (status === \"connected\" || status === \"updated\") ? { planned: true as const } : {}),\n ...(detail ? { detail } : {}),\n });\n if (!state.installed) {\n return outcome(\"not installed\");\n }\n if (state.problem) {\n return outcome(\"failed\", state.problem);\n }\n if (state.entry && (!state.ours || (state.client === \"claude-code\" && state.scope !== \"user\"))) {\n return outcome(\"kept\", keptDetail(state));\n }\n if (state.entry && sameEntry(state.entry, desired)) {\n return outcome(\"connected\", \"already connected\");\n }\n const updating = state.entry !== undefined;\n const commands = writeCommands(state.client, desired, updating);\n if (dryRun) {\n return outcome(updating ? \"updated\" : \"connected\", commands.length > 0 ? `would run: ${commands.map((c) => c.join(\" \")).join(\" && \")}` : `would write ${cursorConfigPath(context.home)}`);\n }\n try {\n if (state.client === \"cursor\") {\n const path = cursorConfigPath(context.home);\n await writeKeepingMode(path, mergeServerEntry(await readIfExists(path), desired).content);\n }\n for (const [command, ...args] of commands) {\n const result = await context.runner(command!, args);\n if (result.exitCode !== 0) {\n return outcome(\"failed\", `${[command, ...args].join(\" \")}: ${lastLine(result.stderr) ?? lastLine(result.stdout) ?? `exit ${result.exitCode}`}`);\n }\n }\n } catch (error) {\n return outcome(\"failed\", error instanceof Error ? error.message : String(error));\n }\n return outcome(updating ? \"updated\" : \"connected\");\n}\n\n/** 우리 브리지 항목만 지운다(setup --undo). 로그인은 그대로다 — `ainecto auth logout` 이 따로 있다. */\nexport async function disconnectAgent(state: AgentState, context: AgentContext, dryRun: boolean): Promise<ConnectionOutcome> {\n const outcome = (status: ConnectionStatus, detail?: string): ConnectionOutcome => ({\n client: state.client, label: AGENT_CLIENT_LABELS[state.client], status,\n ...(dryRun && status === \"removed\" ? { planned: true as const } : {}),\n ...(detail ? { detail } : {}),\n });\n if (!state.installed) {\n return outcome(\"not installed\");\n }\n if (state.problem) {\n return outcome(\"failed\", state.problem);\n }\n if (!state.entry) {\n return outcome(\"not connected\");\n }\n if (!state.ours || (state.client === \"claude-code\" && state.scope !== \"user\")) {\n return outcome(\"kept\", keptDetail(state));\n }\n if (dryRun) {\n return outcome(\"removed\");\n }\n try {\n if (state.client === \"cursor\") {\n const path = cursorConfigPath(context.home);\n const removed = removeServerEntry(await readIfExists(path));\n if (removed.content !== undefined) {\n await writeKeepingMode(path, removed.content);\n }\n } else {\n const [command, ...args] = removeCommand(state.client);\n const result = await context.runner(command!, args);\n if (result.exitCode !== 0) {\n return outcome(\"failed\", `${[command, ...args].join(\" \")}: ${lastLine(result.stderr) ?? `exit ${result.exitCode}`}`);\n }\n }\n } catch (error) {\n return outcome(\"failed\", error instanceof Error ? error.message : String(error));\n }\n return outcome(\"removed\");\n}\n\n/** setup 이 쓰는 우리 항목 — init 과 같은 모양(판 고정). */\nexport function desiredEntry(input: { env: \"prod\" | \"dev\"; endpoint: string }): McpServerEntry {\n return buildServerEntry({ env: input.env, endpoint: input.endpoint });\n}\n\nexport function cursorConfigPath(home: string): string {\n return join(home, \".cursor\", \"mcp.json\");\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// 내부\n// ─────────────────────────────────────────────────────────────────────────────\n\nfunction writeCommands(client: AgentClientId, entry: McpServerEntry, updating: boolean): string[][] {\n const bridge = [entry.command, ...entry.args];\n if (client === \"claude-code\") {\n // 같은 범위에 같은 이름이 있으면 add 가 거절한다 — 우리 것일 때만 지우고 다시 넣는다.\n return [\n ...(updating ? [[\"claude\", \"mcp\", \"remove\", \"-s\", \"user\", SERVER_NAME]] : []),\n [\"claude\", \"mcp\", \"add\", \"-s\", \"user\", SERVER_NAME, \"--\", ...bridge],\n ];\n }\n if (client === \"codex\") {\n // codex mcp add 는 같은 이름을 덮어쓴다(0.163 실측).\n return [[\"codex\", \"mcp\", \"add\", SERVER_NAME, \"--\", ...bridge]];\n }\n return [];\n}\n\nfunction removeCommand(client: Exclude<AgentClientId, \"cursor\">): string[] {\n return client === \"claude-code\"\n ? [\"claude\", \"mcp\", \"remove\", \"-s\", \"user\", SERVER_NAME]\n : [\"codex\", \"mcp\", \"remove\", SERVER_NAME];\n}\n\nfunction keptDetail(state: AgentState): string {\n if (state.client === \"claude-code\" && state.ours && state.scope !== \"user\") {\n return `a ${state.scope}-scope \"${SERVER_NAME}\" entry takes precedence here — left as it is`;\n }\n const where = state.scope ? ` (${state.scope})` : \"\";\n return `someone else's \"${SERVER_NAME}\" entry${where} — left untouched`;\n}\n\nfunction describe(entry: ExistingEntry | undefined): Pick<AgentState, \"entry\" | \"ours\" | \"carriesRole\" | \"pinnedVersion\"> {\n if (!entry) {\n return { ours: false, carriesRole: false };\n }\n if (\"url\" in entry) {\n return { entry, ours: false, carriesRole: false };\n }\n const pinnedVersion = pinnedBridgeVersion(entry);\n return {\n entry,\n ours: isOurBridge(entry),\n carriesRole: entryCarriesRole(entry),\n ...(pinnedVersion ? { pinnedVersion } : {}),\n };\n}\n\nfunction toExisting(raw: unknown): ExistingEntry | undefined {\n if (typeof raw !== \"object\" || raw === null) {\n return undefined;\n }\n const { command, args, url } = raw as { command?: unknown; args?: unknown; url?: unknown };\n if (typeof url === \"string\" && url) {\n return { url };\n }\n if (typeof command === \"string\") {\n return { command, args: Array.isArray(args) ? args.filter((arg): arg is string => typeof arg === \"string\") : [] };\n }\n return undefined;\n}\n\nfunction sameEntry(entry: ExistingEntry, desired: McpServerEntry): boolean {\n return \"command\" in entry && entry.command === desired.command\n && entry.args.length === desired.args.length && entry.args.every((arg, at) => arg === desired.args[at]);\n}\n\nasync function writeKeepingMode(path: string, content: string): Promise<void> {\n await mkdir(dirname(path), { recursive: true });\n let mode: number | undefined;\n try {\n mode = (await stat(path)).mode & 0o7777;\n } catch (error) {\n if (!isNodeError(error, \"ENOENT\")) {\n throw error;\n }\n }\n const tmp = `${path}.${process.pid}.${Date.now()}.tmp`;\n await writeFile(tmp, content, { encoding: \"utf8\", mode: mode ?? 0o600 });\n if (mode !== undefined) {\n await chmod(tmp, mode);\n }\n await rename(tmp, path);\n}\n\nasync function readIfExists(path: string): Promise<string | undefined> {\n try {\n return await readFile(path, \"utf8\");\n } catch (error) {\n if (isNodeError(error, \"ENOENT\")) {\n return undefined;\n }\n throw error;\n }\n}\n\nasync function exists(path: string): Promise<boolean> {\n try {\n await stat(path);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isNodeError(error: unknown, code: string): boolean {\n return typeof error === \"object\" && error !== null && (error as { code?: unknown }).code === code;\n}\n","import { spawn } from \"node:child_process\";\n\n/**\n * 외부 명령({@code claude}·{@code codex}) 실행의 ★단일 지점. setup·status·doctor 가 모두 이것만 부른다 —\n * 시험은 가짜 실행기(또는 PATH 앞의 기록 스크립트)를 넣는다.\n *\n * <p>셸을 거치지 않는다(인자 그대로). 실행 파일이 없으면 {@code missing} 이고 예외가 아니다 —\n * «설치 안 됨»은 실패가 아니라 보고할 상태다.\n */\nexport interface CommandResult {\n exitCode: number | null;\n stdout: string;\n stderr: string;\n /** 실행 파일을 찾지 못했다(ENOENT). */\n missing: boolean;\n}\n\nexport type CommandRunner = (command: string, args: readonly string[]) => Promise<CommandResult>;\n\n/**\n * 실행한 명령 한 줄 — ★요청과 응답이 한 항목이다(명령 줄 + 종료 코드). 결과의 {@code commands} 로 나간다.\n * 응답이 없는 요청은 구조적으로 없다: 실행기가 끝나야 항목이 생긴다.\n */\nexport interface CommandLog {\n command: string;\n exitCode: number | null;\n missing?: true;\n /** 실패했을 때 stderr(없으면 stdout)의 마지막 줄 — 원인을 그 자리에서 보이게. */\n error?: string;\n}\n\n/**\n * {@code claude mcp get} 은 서버 연결 점검까지 한다(브리지를 띄운다) — 그래서 짧지 않다.\n * 이 한도를 넘기면 그 클라이언트만 실패로 보고하고 나머지는 계속한다.\n */\nconst COMMAND_TIMEOUT_MS = 90_000;\n\nexport function systemCommandRunner(options: { cwd: string; env?: NodeJS.ProcessEnv }): CommandRunner {\n return (command, args) => new Promise((resolve) => {\n let stdout = \"\";\n let stderr = \"\";\n let settled = false;\n const finish = (result: CommandResult) => {\n if (!settled) {\n settled = true;\n clearTimeout(timer);\n resolve(result);\n }\n };\n const child = spawn(command, [...args], {\n cwd: options.cwd,\n env: options.env ?? process.env,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n const timer = setTimeout(() => {\n child.kill();\n finish({ exitCode: null, stdout, stderr: `${stderr}\\n${command} timed out after ${COMMAND_TIMEOUT_MS / 1000}s`, missing: false });\n }, COMMAND_TIMEOUT_MS);\n child.stdout.on(\"data\", (chunk) => { stdout += String(chunk); });\n child.stderr.on(\"data\", (chunk) => { stderr += String(chunk); });\n child.on(\"error\", (error: NodeJS.ErrnoException) => {\n finish({ exitCode: null, stdout, stderr: error.message, missing: error.code === \"ENOENT\" });\n });\n child.on(\"close\", (code) => finish({ exitCode: code, stdout, stderr, missing: false }));\n });\n}\n\n/** 실행기를 감싸 실행한 명령을 {@link CommandLog} 로 모은다. */\nexport function recordingRunner(runner: CommandRunner, log: CommandLog[]): CommandRunner {\n return async (command, args) => {\n const result = await runner(command, args);\n const entry: CommandLog = { command: [command, ...args].join(\" \"), exitCode: result.exitCode };\n if (result.missing) {\n entry.missing = true;\n } else if (result.exitCode !== 0) {\n entry.error = lastLine(result.stderr) ?? lastLine(result.stdout);\n }\n log.push(entry);\n return result;\n };\n}\n\n/** 출력의 마지막 비어 있지 않은 줄 — 실패 원인을 한 줄로 보일 때 쓴다. */\nexport function lastLine(text: string): string | undefined {\n const lines = text.split(\"\\n\").map((line) => line.trim()).filter(Boolean);\n return lines[lines.length - 1];\n}\n","import { usableAccessToken } from \"../../core/auth/oauth\";\nimport { profileSettingsUrl } from \"../../core/config/endpoints\";\nimport { renderSuccess } from \"../../core/output/render\";\nimport type { McpRpcClient } from \"../../core/mcp/rpcClient\";\nimport { readAccount, type AccountSummary } from \"../../core/setup/accountSummary\";\nimport {\n connectAgent,\n desiredEntry,\n disconnectAgent,\n inspectAgents,\n type AgentContext,\n type ConnectionOutcome,\n} from \"../../core/setup/agentConnections\";\nimport { recordingRunner, type CommandLog, type CommandRunner } from \"../../core/setup/commandRunner\";\n\nexport interface SetupCommandOptions {\n argv: string[];\n endpoint: string;\n env: \"prod\" | \"dev\";\n /** `ainecto auth login` 과 같은 함수들. */\n auth: { getAccessToken(): Promise<string | undefined>; login(): Promise<unknown> };\n client: McpRpcClient;\n /** 외부 명령 실행기 — setup 은 이것으로만 `claude`·`codex` 를 부른다. */\n runner: CommandRunner;\n /** 사용자 홈(Cursor 전역 설정의 자리). */\n home: string;\n json: boolean;\n io: { stdout: NodeJS.WriteStream; stderr: NodeJS.WriteStream };\n}\n\n/**\n * {@code ainecto setup} — ★기기 1회(설계 §4-1). 로그인 → 연결 확인(읽기) → 에이전트 연결.\n *\n * <ul>\n * <li>Claude Code(사용자 범위)·Cursor(전역)·Codex 를 각각 따로 연결하고, 결과를 클라이언트마다\n * {@code connected / updated / kept / not installed / failed} 로 말한다. 하나라도 실패하면 «부분 완료», 종료 1.</li>\n * <li>남의 {@code ainecto} 항목은 건드리지 않는다. 소유 판정은 {@code isOurBridge} 하나.</li>\n * <li>{@code --dry-run}: 로그인하지 않고 아무것도 쓰지 않는다 — 할 일만 보인다.</li>\n * <li>{@code --undo}: 우리 브리지 항목만 지운다. 로그인은 {@code ainecto auth logout} 이 따로 한다.</li>\n * </ul>\n */\nexport async function executeSetupCommand(options: SetupCommandOptions): Promise<number> {\n const args = parseSetupArgs(options.argv);\n const commands: CommandLog[] = [];\n const context: AgentContext = { runner: recordingRunner(options.runner, commands), home: options.home };\n\n if (args.undo) {\n const states = await inspectAgents(context);\n const agents: ConnectionOutcome[] = [];\n for (const state of states) {\n agents.push(await disconnectAgent(state, context, args.dryRun));\n }\n const failed = agents.some((agent) => agent.status === \"failed\");\n options.io.stdout.write(renderSuccess({\n action: args.dryRun ? \"setup --undo (dry-run)\" : \"setup --undo\",\n agents,\n commands,\n notes: [\"Your sign-in is kept — sign out with `ainecto auth logout`.\"],\n }, { json: options.json }));\n return failed ? 1 : 0;\n }\n\n // ① 로그인 — 쓸 수 있는 토큰이 없으면(서버가 저장 로그인을 거절한 경우 포함) 브라우저 1회.\n // dry-run 은 로그인하지 않는다. ★판정은 init 과 같은 {@link usableAccessToken} 하나다.\n let signedIn = Boolean(await usableAccessToken(options.auth));\n if (!signedIn && !args.dryRun) {\n await options.auth.login();\n options.io.stderr.write(\"Signed in.\\n\");\n signedIn = true;\n }\n\n // ② 연결 확인(읽기만).\n const account = signedIn ? await readAccount(options.client) : undefined;\n\n // ③ 에이전트 연결 — 클라이언트마다 따로. 실패는 그 클라이언트만의 결과다.\n const desired = desiredEntry({ env: options.env, endpoint: options.endpoint });\n const agents: ConnectionOutcome[] = [];\n for (const state of await inspectAgents(context)) {\n agents.push(await connectAgent(state, desired, context, args.dryRun));\n }\n\n const failed = agents.some((agent) => agent.status === \"failed\") || account?.problem !== undefined;\n options.io.stdout.write(renderSuccess({\n action: args.dryRun ? \"setup (dry-run)\" : \"setup\",\n setup: failed ? \"partial\" : \"complete\",\n endpoint: options.endpoint,\n account: accountView(account, signedIn, options.endpoint),\n agents,\n commands,\n next: nextSteps(account, agents, options.endpoint),\n }, { json: options.json }));\n return failed ? 1 : 0;\n}\n\n/**\n * 사람이 읽는 계정 칸. ★이메일은 없다. 직무는 «Your AiNecto role» — 권한이 아니라 AI 설명 방식에만 쓰인다.\n */\nexport function accountView(account: AccountSummary | undefined, signedIn: boolean, endpoint: string): Record<string, unknown> {\n if (!signedIn) {\n return { signedIn: false, note: \"sign-in required — `ainecto setup` (without --dry-run) opens the browser once\" };\n }\n const view: Record<string, unknown> = { signedIn: true };\n if (account?.userId) view.userId = account.userId;\n if (account?.displayName) view.name = account.displayName;\n if (account?.jobTitle !== undefined) {\n view.jobTitle = account.jobTitle ?? `not set — set it at ${profileSettingsUrl(endpoint)}`;\n }\n if (account?.projectCount !== undefined) view.projects = account.projectCount;\n if (account?.problem) view.problem = `${account.problem.kind}: ${account.problem.message}`;\n return view;\n}\n\nfunction nextSteps(account: AccountSummary | undefined, agents: ConnectionOutcome[], endpoint: string): string[] {\n const next: string[] = [];\n if (agents.some((agent) => agent.status === \"connected\" || agent.status === \"updated\")) {\n next.push(\"Start a new agent session to load the AiNecto tools. Every session sees the same tools; your AiNecto permissions decide what they may change.\");\n }\n if (account?.jobTitle === null) {\n next.push(`Set your AiNecto role (your job) at ${profileSettingsUrl(endpoint)} — AI uses it to pitch explanations; it does not change permissions.`);\n }\n next.push(\"To add AiNecto's working rules to a repository, run `ainecto init` from its root.\");\n next.push(\"`ainecto doctor` shows anything still missing.\");\n return next;\n}\n\nfunction parseSetupArgs(argv: string[]): { dryRun: boolean; undo: boolean } {\n const args = { dryRun: false, undo: false };\n for (const arg of argv) {\n if (arg === \"--dry-run\") {\n args.dryRun = true;\n } else if (arg === \"--undo\") {\n args.undo = true;\n } else if (arg === \"--json\") {\n // 전역 플래그.\n } else {\n throw new Error(`Unknown argument: ${arg}`);\n }\n }\n return args;\n}\n","import { profileSettingsUrl } from \"../config/endpoints\";\nimport { SERVER_NAME } from \"../harness/agentTargets\";\nimport { AGENT_CLIENT_LABELS, type AgentState } from \"./agentConnections\";\nimport type { MachineStatus } from \"./machineStatus\";\n\n/**\n * doctor 의 판정 — ★{@link MachineStatus} 만 보는 순수 함수. 항목마다 ok / warn / fail + 고칠 명령 한 줄.\n *\n * <p>고치는 길은 {@code ainecto setup}·{@code ainecto init} 재실행 둘뿐이다(설계 §4-4, 두 방식 금지) —\n * {@code --fix} 는 없다. fail 이 하나라도 있으면 doctor 는 종료 1. 직무 미설정은 warn(실패 아님).\n */\nexport type CheckLevel = \"ok\" | \"warn\" | \"fail\";\n\nexport interface DoctorCheck {\n item: string;\n level: CheckLevel;\n detail: string;\n /** 고칠 명령(또는 할 일) 한 줄. */\n fix?: string;\n}\n\nexport function doctorChecks(status: MachineStatus): DoctorCheck[] {\n const checks: DoctorCheck[] = [];\n const settings = profileSettingsUrl(status.endpoint);\n\n // ── 로그인 ──\n if (status.token.state === \"not-signed-in\") {\n checks.push({ item: \"sign-in\", level: \"fail\", detail: `not signed in to ${status.endpoint}`, fix: \"ainecto setup\" });\n } else if (status.token.state === \"refresh-failed\") {\n checks.push({ item: \"sign-in\", level: \"fail\", detail: `sign-in expired and could not be renewed (${status.token.reason})`, fix: \"ainecto setup\" });\n } else {\n checks.push({ item: \"sign-in\", level: \"ok\", detail: status.token.state === \"env\" ? \"AINECTO_TOKEN\" : \"signed in\" });\n }\n\n // ── 서버 ──\n const problem = status.account?.problem;\n if (problem?.kind === \"network\") {\n checks.push({ item: \"server\", level: \"fail\", detail: `cannot reach ${status.endpoint} (${problem.message})`, fix: \"check the network, or the --endpoint you passed\" });\n } else if (problem?.kind === \"unauthorized\") {\n checks.push({ item: \"server\", level: \"fail\", detail: `${status.endpoint} refused the sign-in (HTTP 401)`, fix: \"ainecto auth login\" });\n } else if (problem?.kind === \"forbidden\") {\n checks.push({ item: \"server\", level: \"fail\", detail: \"the account's plan does not include MCP, or the account is not active (HTTP 403)\", fix: `check your plan at ${settings}` });\n } else if (problem) {\n checks.push({ item: \"server\", level: \"fail\", detail: problem.message });\n } else if (status.account) {\n checks.push({ item: \"server\", level: \"ok\", detail: `${status.endpoint} answered; ${status.account.projectCount ?? 0} project(s) visible` });\n }\n\n // ── 에이전트 연결 ──\n for (const agent of status.agents) {\n checks.push(agentCheck(agent, status.cliVersion));\n }\n if (status.claudeHere?.entry && status.claudeHere.scope === \"local\") {\n const hereOursUpToDate = status.claudeHere.ours && !status.claudeHere.carriesRole;\n if (!hereOursUpToDate) {\n checks.push({\n item: \"Claude Code (this folder)\",\n level: \"warn\",\n detail: `a local-scope \"${SERVER_NAME}\" entry in this folder hides the user-scope connection`,\n fix: `claude mcp remove ${SERVER_NAME} -s local`,\n });\n }\n }\n\n // ── 이 저장소 ──\n const repo = status.repository;\n if (repo?.problem) {\n checks.push({ item: \"repository\", level: \"warn\", detail: repo.problem });\n } else if (repo) {\n const leftovers = [\n ...repo.mcpFiles.filter((file) => file.ours && file.carriesRole).map((file) => `${file.path} passes the removed --role`),\n ...repo.mcpFiles.filter((file) => file.ours && olderThan(file.pinnedVersion, status.cliVersion))\n .map((file) => `${file.path} pins @ainecto/mcp@${file.pinnedVersion}`),\n ...(repo.configHasProject ? [\".ainecto/config.json still has the old project field\"] : []),\n ];\n if (leftovers.length > 0) {\n checks.push({ item: \"repository\", level: \"warn\", detail: leftovers.join(\"; \"), fix: `ainecto init (in ${repo.root})` });\n } else {\n checks.push({\n item: \"repository\",\n level: \"ok\",\n detail: repo.harnessDoc\n ? `AiNecto rules are set up in ${repo.root}`\n : `no AiNecto rules in ${repo.root} (optional — \\`ainecto init\\` adds them)`,\n });\n }\n }\n\n // ── 옛 설정 잔존 ──\n for (const name of status.legacyEnv) {\n checks.push({ item: name, level: \"warn\", detail: `${name} is set; roles were removed and it is ignored`, fix: `unset ${name} (it can be deleted)` });\n }\n if (status.legacyCodexProfiles.length > 0) {\n checks.push({\n item: \"Codex role profiles\",\n level: \"warn\",\n detail: `these Codex profiles still pass --role: ${status.legacyCodexProfiles.join(\", \")}`,\n fix: \"delete them — `ainecto setup` connects Codex for every session\",\n });\n }\n if (status.globalCliVersion && olderThan(status.globalCliVersion, status.cliVersion)) {\n checks.push({\n item: \"global ainecto\",\n level: \"warn\",\n detail: `the ainecto on your PATH is ${status.globalCliVersion}, older than ${status.cliVersion}`,\n fix: \"npm i -g ainecto@latest\",\n });\n }\n\n // ── 직무 ──\n if (status.account?.jobTitle === null) {\n checks.push({ item: \"AiNecto job title\", level: \"warn\", detail: \"not set — AI uses it to pitch explanations; it does not change permissions\", fix: `set it at ${settings}` });\n } else if (typeof status.account?.jobTitle === \"string\") {\n checks.push({ item: \"AiNecto job title\", level: \"ok\", detail: status.account.jobTitle });\n }\n return checks;\n}\n\nfunction agentCheck(agent: AgentState, cliVersion: string): DoctorCheck {\n const item = AGENT_CLIENT_LABELS[agent.client];\n if (!agent.installed) {\n return { item, level: \"ok\", detail: \"not installed\" };\n }\n if (agent.problem) {\n return { item, level: \"fail\", detail: agent.problem, fix: \"ainecto setup\" };\n }\n if (!agent.entry) {\n return { item, level: \"warn\", detail: \"not connected to AiNecto\", fix: \"ainecto setup\" };\n }\n if (!agent.ours) {\n return {\n item,\n level: \"warn\",\n detail: `someone else's \"${SERVER_NAME}\" entry${agent.scope ? ` (${agent.scope})` : \"\"} — AiNecto setup leaves it alone`,\n fix: agent.client === \"claude-code\" ? `claude mcp get ${SERVER_NAME}` : \"keep it, or remove it and run `ainecto setup`\",\n };\n }\n if (agent.client === \"claude-code\" && agent.scope !== \"user\") {\n return { item, level: \"warn\", detail: `connected in the ${agent.scope} scope, not for every project`, fix: \"ainecto setup\" };\n }\n if (agent.carriesRole) {\n return { item, level: \"warn\", detail: \"connected, but still passes the removed --role\", fix: \"ainecto setup\" };\n }\n if (olderThan(agent.pinnedVersion, cliVersion)) {\n return { item, level: \"warn\", detail: `connected with @ainecto/mcp@${agent.pinnedVersion}; ${cliVersion} is available`, fix: \"ainecto setup\" };\n }\n return { item, level: \"ok\", detail: agent.pinnedVersion ? `connected (@ainecto/mcp@${agent.pinnedVersion})` : \"connected\" };\n}\n\n/** a 가 b 보다 낮은 판인가(x.y.z 숫자 비교). 둘 중 하나라도 판이 아니면(dev 등) false — 판정하지 않는다. */\nexport function olderThan(a: string | undefined, b: string): boolean {\n const left = parseVersion(a);\n const right = parseVersion(b);\n if (!left || !right) {\n return false;\n }\n for (let at = 0; at < 3; at += 1) {\n if (left[at]! !== right[at]!) {\n return left[at]! < right[at]!;\n }\n }\n return false;\n}\n\nfunction parseVersion(value: string | undefined): [number, number, number] | undefined {\n const match = value?.match(/^(\\d+)\\.(\\d+)\\.(\\d+)/);\n return match ? [Number(match[1]), Number(match[2]), Number(match[3])] : undefined;\n}\n","import { readdir, readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport type { TokenStore } from \"../auth/tokenStore\";\nimport type { McpRpcClient } from \"../mcp/rpcClient\";\nimport { AGENT_TARGETS, entryCarriesRole, isOurBridge, pinnedBridgeVersion, readServerEntry } from \"../harness/agentTargets\";\nimport { HARNESS_CONFIG_PATH, HARNESS_DOC_PATH, DOC_KEY } from \"../harness/harnessDoc\";\nimport { LEGACY_ROLE_ENV_VAR } from \"../harness/legacyRole\";\nimport { findGitRoot, readManagedFile } from \"../harness/repositoryFiles\";\nimport { PACKAGE_NAME } from \"../version\";\nimport { readAccount, type AccountSummary } from \"./accountSummary\";\nimport { inspectAgents, inspectClaude, type AgentState } from \"./agentConnections\";\nimport type { CommandRunner } from \"./commandRunner\";\n\n/**\n * ★status 와 doctor 가 쓰는 «수집 함수 하나»(설계 §4-3·§4-4). 읽기만 한다 — 에이전트 설정·저장소 파일을\n * 바꾸지 않는다(토큰 갱신은 평소 명령과 같다: 갱신 실패 원인을 보이려면 갱신을 해 봐야 한다).\n * doctor 의 판정은 {@code doctorChecks.ts} 가 이 결과만 보고 한다(순수 함수).\n */\nexport interface MachineStatus {\n cliVersion: string;\n endpoint: string;\n env: \"prod\" | \"dev\";\n token: TokenStatus;\n /** 쓸 수 있는 토큰이 있을 때만. */\n account?: AccountSummary;\n /** 기기 전역 연결(setup 의 것). */\n agents: AgentState[];\n /** 지금 폴더에서 본 Claude Code 항목 — 이 저장소의 local 범위가 사용자 범위를 가리는지. 홈에서 돌면 없다. */\n claudeHere?: AgentState;\n repository?: RepositoryStatus;\n /** 설정돼 있는 옛 환경변수 이름. */\n legacyEnv: string[];\n /** 우리 브리지에 --role 을 싣는 Codex 프로필 파일(0.7.x 가 안내하던 것). */\n legacyCodexProfiles: string[];\n /** PATH 의 전역 `ainecto` 판. 없으면 undefined(npx 로만 쓰는 사람). */\n globalCliVersion?: string;\n}\n\nexport interface TokenStatus {\n /** env = AINECTO_TOKEN · signed-in · not-signed-in · refresh-failed */\n state: \"env\" | \"signed-in\" | \"not-signed-in\" | \"refresh-failed\";\n /** 저장된 토큰의 만료 시각(ISO). 값 자체는 내지 않는다. */\n expiresAt?: string;\n /** 갱신이 실패한 이유. */\n reason?: string;\n}\n\nexport interface RepositoryStatus {\n root: string;\n /** git 저장소가 아니면 false — 이때 root 는 지금 폴더다. */\n git: boolean;\n harnessDoc: boolean;\n /** config.json 이 기록한 HARNESS.DOC 판. */\n harnessDocVersion?: string;\n configVersion?: number;\n /** 0.7.x 가 쓰던 project 칸이 남아 있나. */\n configHasProject: boolean;\n mcpFiles: Array<{ path: string; ours: boolean; carriesRole: boolean; pinnedVersion?: string }>;\n problem?: string;\n}\n\nexport interface CollectInput {\n endpoint: string;\n env: \"prod\" | \"dev\";\n cliVersion: string;\n tokenStore: TokenStore;\n auth: { getAccessToken(): Promise<string | undefined> };\n client: McpRpcClient;\n /** 홈 폴더에서 도는 실행기(전역 연결·전역 CLI 판). */\n runner: CommandRunner;\n /** 지금 폴더에서 도는 실행기 — 이 저장소의 Claude local 범위를 볼 때. */\n hereRunner?: CommandRunner;\n home: string;\n cwd: string;\n envVars: NodeJS.ProcessEnv;\n}\n\nexport async function collectStatus(input: CollectInput): Promise<MachineStatus> {\n const token = await tokenStatus(input);\n const usable = token.state === \"env\" || token.state === \"signed-in\";\n const status: MachineStatus = {\n cliVersion: input.cliVersion,\n endpoint: input.endpoint,\n env: input.env,\n token,\n agents: await inspectAgents({ runner: input.runner, home: input.home }),\n legacyEnv: [LEGACY_ROLE_ENV_VAR, \"AI_ERD_ROLE\"].filter((name) => input.envVars[name]?.trim()),\n legacyCodexProfiles: await legacyCodexProfiles(input.envVars.CODEX_HOME ?? join(input.home, \".codex\")),\n };\n if (usable) {\n status.account = await readAccount(input.client);\n }\n if (input.hereRunner && input.cwd !== input.home) {\n status.claudeHere = await inspectClaude({ runner: input.hereRunner, home: input.home });\n }\n status.repository = await repositoryStatus(input.cwd);\n const globalVersion = await globalCliVersion(input.runner);\n if (globalVersion) {\n status.globalCliVersion = globalVersion;\n }\n return status;\n}\n\nasync function tokenStatus(input: CollectInput): Promise<TokenStatus> {\n if (input.envVars.AINECTO_TOKEN) {\n return { state: \"env\" };\n }\n const stored = await input.tokenStore.load(input.endpoint);\n const expiresAt = stored?.expiresAt ? new Date(stored.expiresAt).toISOString() : undefined;\n try {\n const token = await input.auth.getAccessToken();\n if (token) {\n return { state: \"signed-in\", ...(expiresAt ? { expiresAt } : {}) };\n }\n return stored\n ? { state: \"refresh-failed\", ...(expiresAt ? { expiresAt } : {}), reason: \"the stored sign-in expired and has no refresh token\" }\n : { state: \"not-signed-in\" };\n } catch (error) {\n return {\n state: \"refresh-failed\",\n ...(expiresAt ? { expiresAt } : {}),\n reason: error instanceof Error ? error.message : String(error),\n };\n }\n}\n\nasync function repositoryStatus(cwd: string): Promise<RepositoryStatus> {\n const gitRoot = await findGitRoot(cwd);\n const root = gitRoot ?? cwd;\n const status: RepositoryStatus = { root, git: gitRoot !== undefined, harnessDoc: false, configHasProject: false, mcpFiles: [] };\n try {\n status.harnessDoc = (await readManagedFile(root, HARNESS_DOC_PATH)) !== undefined;\n const config = parseObject(await readManagedFile(root, HARNESS_CONFIG_PATH));\n if (config) {\n if (typeof config.version === \"number\") status.configVersion = config.version;\n status.configHasProject = Object.prototype.hasOwnProperty.call(config, \"project\");\n const versions = config.promptVersions as Record<string, unknown> | undefined;\n if (typeof versions?.[DOC_KEY] === \"string\") status.harnessDocVersion = versions[DOC_KEY] as string;\n }\n for (const target of AGENT_TARGETS) {\n const entry = readServerEntry(await readManagedFile(root, target.path));\n if (entry !== undefined) {\n const pinnedVersion = pinnedBridgeVersion(entry);\n status.mcpFiles.push({\n path: target.path,\n ours: isOurBridge(entry),\n carriesRole: entryCarriesRole(entry),\n ...(pinnedVersion ? { pinnedVersion } : {}),\n });\n }\n }\n } catch (error) {\n status.problem = error instanceof Error ? error.message : String(error);\n }\n return status;\n}\n\n/** `$CODEX_HOME/*.config.toml` 중 우리 브리지에 --role 을 싣는 것. 0.7.x 가 «역할마다 프로필»을 안내했다. */\nasync function legacyCodexProfiles(codexHome: string): Promise<string[]> {\n let names: string[];\n try {\n names = await readdir(codexHome);\n } catch {\n return [];\n }\n const found: string[] = [];\n for (const name of names.filter((file) => file.endsWith(\".config.toml\"))) {\n const content = await readFile(join(codexHome, name), \"utf8\").catch(() => \"\");\n if (content.includes(PACKAGE_NAME) && content.includes(\"--role\")) {\n found.push(join(codexHome, name));\n }\n }\n return found;\n}\n\n/** PATH 의 `ainecto` 판 — `ainecto --version --json`. 없거나 못 읽으면 undefined. */\nasync function globalCliVersion(runner: CommandRunner): Promise<string | undefined> {\n const result = await runner(\"ainecto\", [\"--version\", \"--json\"]);\n if (result.missing || result.exitCode !== 0) {\n return undefined;\n }\n try {\n const version = (JSON.parse(result.stdout) as { data?: { version?: unknown } }).data?.version;\n return typeof version === \"string\" ? version : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction parseObject(content: string | undefined): Record<string, unknown> | undefined {\n if (content === undefined) {\n return undefined;\n }\n try {\n const parsed = JSON.parse(content) as unknown;\n return parsed && typeof parsed === \"object\" && !Array.isArray(parsed) ? parsed as Record<string, unknown> : undefined;\n } catch {\n return undefined;\n }\n}\n","import { renderSuccess } from \"../../core/output/render\";\nimport { AGENT_CLIENT_LABELS } from \"../../core/setup/agentConnections\";\nimport { doctorChecks } from \"../../core/setup/doctorChecks\";\nimport { collectStatus, type CollectInput, type MachineStatus } from \"../../core/setup/machineStatus\";\nimport { accountView } from \"./setupCommand\";\n\nexport interface StatusCommandOptions {\n argv: string[];\n collect: CollectInput;\n json: boolean;\n io: { stdout: NodeJS.WriteStream; stderr: NodeJS.WriteStream };\n}\n\n/**\n * {@code ainecto status} — 읽기 전용 한 화면(설계 §4-3). 토큰 값·이메일은 내지 않는다.\n */\nexport async function executeStatusCommand(options: StatusCommandOptions): Promise<number> {\n assertNoArgs(\"status\", options.argv);\n const status = await collectStatus(options.collect);\n options.io.stdout.write(renderSuccess(statusView(status), { json: options.json }));\n return 0;\n}\n\n/**\n * {@code ainecto doctor} — status 와 «같은 수집»을 보고 항목마다 ok/warn/fail + 고칠 명령(설계 §4-4).\n * fail 이 하나라도 있으면 종료 1. {@code --fix} 는 없다 — 고치는 길은 setup·init 재실행이다.\n */\nexport async function executeDoctorCommand(options: StatusCommandOptions): Promise<number> {\n assertNoArgs(\"doctor\", options.argv);\n const status = await collectStatus(options.collect);\n const checks = doctorChecks(status);\n const failed = checks.filter((check) => check.level === \"fail\").length;\n const warned = checks.filter((check) => check.level === \"warn\").length;\n options.io.stdout.write(renderSuccess({\n summary: failed > 0 ? `${failed} problem(s) to fix` : warned > 0 ? `working — ${warned} suggestion(s)` : \"all good\",\n checks,\n }, { json: options.json }));\n return failed > 0 ? 1 : 0;\n}\n\nfunction statusView(status: MachineStatus): Record<string, unknown> {\n const signedIn = status.token.state === \"env\" || status.token.state === \"signed-in\";\n return {\n cli: status.cliVersion,\n endpoint: status.endpoint,\n env: status.env,\n signIn: status.token,\n account: accountView(status.account, signedIn, status.endpoint),\n agents: status.agents.map((agent) => ({\n client: AGENT_CLIENT_LABELS[agent.client],\n state: !agent.installed ? \"not installed\"\n : agent.problem ? `unknown (${agent.problem})`\n : !agent.entry ? \"not connected\"\n : agent.ours ? `connected${agent.scope ? ` (${agent.scope})` : \"\"}` : `someone else's entry${agent.scope ? ` (${agent.scope})` : \"\"}`,\n ...(agent.pinnedVersion ? { bridge: `@ainecto/mcp@${agent.pinnedVersion}` } : {}),\n ...(agent.carriesRole ? { legacyRole: true } : {}),\n })),\n ...(status.claudeHere?.entry ? { claudeCodeHere: { scope: status.claudeHere.scope, ours: status.claudeHere.ours } } : {}),\n repository: status.repository,\n ...(status.globalCliVersion ? { globalAinecto: status.globalCliVersion } : {}),\n };\n}\n\nfunction assertNoArgs(command: string, argv: string[]): void {\n const unknown = argv.filter((arg) => arg !== \"--json\");\n if (unknown.length > 0) {\n throw new Error(`Unknown argument for ${command}: ${unknown[0]}`);\n }\n}\n","import { FileTokenStore } from \"../../core/auth/tokenStore\";\nimport { OAuthClient, usableAccessToken } from \"../../core/auth/oauth\";\nimport { resolveEndpoint, assertEnv, type AinectoEnv } from \"../../core/config/endpoints\";\nimport { parsePayloadSource } from \"../../core/input/payloadSource\";\nimport { McpRpcClient, isToolError } from \"../../core/mcp/rpcClient\";\nimport { renderError, renderSuccess } from \"../../core/output/render\";\nimport { getGeneratedTools, loadLiveTools } from \"../../core/catalog\";\nimport type { GeneratedToolDefinition } from \"../../core/catalog/types\";\nimport { runConnector } from \"../mcp/connector\";\nimport { executeGeneratedCommand, matchGeneratedCommand } from \"./generatedCommandRouter\";\nimport { executeAttachmentsUploadCommand, isAttachmentsUploadCommand } from \"./attachmentsUploadCommand\";\nimport { executeInboxPollCommand, isInboxPollCommand } from \"./inboxPollCommands\";\nimport { executeInitCommand } from \"./initCommand\";\nimport { executeSetupCommand } from \"./setupCommand\";\nimport { executeDoctorCommand, executeStatusCommand } from \"./statusCommand\";\nimport { systemCommandRunner } from \"../../core/setup/commandRunner\";\nimport { homedir } from \"node:os\";\nimport { CLI_VERSION, PACKAGE_NAME } from \"../../core/version\";\nimport { LEGACY_ROLE_NOTICE, legacyRoleInput } from \"../../core/harness/legacyRole\";\n\nexport interface CliIO {\n stdout: NodeJS.WriteStream;\n stderr: NodeJS.WriteStream;\n stdin: NodeJS.ReadStream;\n}\n\nexport async function runAinectoCli(argv: string[], io: CliIO): Promise<number> {\n let parsed: GlobalArgs = { json: argv.includes(\"--json\"), help: false, version: false, positionals: [] };\n try {\n parsed = parseGlobalArgs(argv);\n // ★에이전트는 설치 직후 버전부터 확인한다 — «Unknown command»로 답하면 도움말까지 못 간다(2026-09-29, Codex).\n if (parsed.version || parsed.positionals[0] === \"version\") {\n io.stdout.write(renderSuccess({ version: CLI_VERSION }, { json: parsed.json }));\n return 0;\n }\n if (parsed.help || parsed.positionals.length === 0) {\n io.stdout.write(helpText());\n return 0;\n }\n\n const resolved = resolveEndpoint({ env: parsed.env, endpoint: parsed.endpoint });\n const [domain, action, ...rest] = parsed.positionals;\n // ★옛 --role / AINECTO_ROLE — 세션 역할은 없어졌다(0.8.0). 값을 검사하지 않고 받아 안내 한 줄을\n // 남기고, 원격 요청에 기록용 헤더로만 싣는다(legacyRole.ts). 브리지는 connector 가 같은 일을 한다.\n const legacyRole = legacyRoleInput(parsed.legacyRole);\n if (legacyRole !== undefined && domain !== \"mcp\") {\n // --json 이면 stderr 도 JSON 한 줄이다(login_url 과 같은 규칙).\n io.stderr.write(parsed.json\n ? `${JSON.stringify({ event: \"legacy_role_ignored\", message: LEGACY_ROLE_NOTICE })}\\n`\n : `${LEGACY_ROLE_NOTICE}\\n`);\n }\n const tokenStore = new FileTokenStore();\n /** 인증·RPC 클라이언트. ★토큰은 서버마다 한 칸이다. */\n const connect = () => {\n const auth = new OAuthClient({\n endpoint: resolved.endpoint,\n tokenStore,\n // ★init·setup --dry-run 은 토큰을 갱신하지도 않는다 — 「아무것도 바꾸지 않는다」에 로그인 상태도 든다.\n // (하위 명령의 플래그는 positional 로 흘러온다.)\n readOnly: (domain === \"init\" || domain === \"setup\") && parsed.positionals.includes(\"--dry-run\"),\n // ★URL 을 «브라우저를 열기 전에» 알린다. stdout 은 결과 전용이라 stderr 에 쓴다.\n // --json 이면 JSON 한 줄이다(설계 §21-3 (가)). 로그인이 역할과 무관해져 role 칸은 없다(0.4.2 §2-5).\n onAuthorizeUrl: (url) => {\n io.stderr.write(parsed.json\n ? `${JSON.stringify({ event: \"login_url\", url })}\\n`\n : `Opening your browser to sign in to AiNecto. If it does not open, visit:\\n ${url}\\n`);\n },\n });\n // 직접 명령 — 채널 cli. 에이전트 이름은 싣지 않는다(셸을 누가 돌렸는지 모른다 → 서버는 unknown).\n const client = new McpRpcClient({ endpoint: resolved.endpoint, tokenProvider: auth, legacyRole, channel: \"cli\" });\n return { auth, client };\n };\n\n if (domain === \"mcp\") {\n await runConnector({\n endpoint: resolved.endpoint,\n legacyRoleFlag: parsed.legacyRole,\n input: io.stdin,\n output: io.stdout,\n errorOutput: io.stderr,\n });\n return 0;\n }\n\n if (domain === \"init\") {\n // ⚠init 의 플래그는 전역 파서가 positional 로 흘려보낸다. 그대로 넘긴다.\n const { auth } = connect();\n return await executeInitCommand({\n argv: parsed.positionals.slice(1),\n // 문서는 인증 후에 받는다 — 토큰이 없으면 패키지 기본값으로 가고, 그 사실을 보고한다.\n // ★«필요할 때» 가져온다. --undo 는 로컬 작업이라 토큰을 건드리지 않는다(S1).\n // ★판정은 setup 과 같은 {@link usableAccessToken} 하나 — 서버가 저장 로그인을 거절했으면 «없음»(→ 로그인),\n // 네트워크 장애·AINECTO_TOKEN 을 못 쓰는 주소라는 거절은 삼키지 않는다(브라우저 로그인으로 둔갑하지 않게).\n accessToken: () => usableAccessToken(auth),\n // 로그인한다 — `ainecto auth login` 과 같은 함수다. 서버마다 한 번이다.\n login: async () => {\n await auth.login();\n },\n endpoint: resolved.endpoint,\n env: resolved.env,\n cliVersion: `${PACKAGE_NAME} ${CLI_VERSION}`,\n cwd: process.cwd(),\n json: parsed.json,\n io,\n });\n }\n\n if (domain === \"setup\") {\n const { auth, client } = connect();\n return await executeSetupCommand({\n argv: parsed.positionals.slice(1),\n endpoint: resolved.endpoint,\n env: resolved.env,\n auth,\n client,\n // ★외부 CLI 는 홈 폴더에서 돈다 — 지금 저장소의 local·project 범위 항목이 사용자 범위 판정에 끼지 않게.\n runner: systemCommandRunner({ cwd: homedir() }),\n home: homedir(),\n json: parsed.json,\n io,\n });\n }\n\n if (domain === \"status\" || domain === \"doctor\") {\n const { auth, client } = connect();\n const run = domain === \"status\" ? executeStatusCommand : executeDoctorCommand;\n return await run({\n argv: parsed.positionals.slice(1),\n collect: {\n endpoint: resolved.endpoint,\n env: resolved.env,\n cliVersion: CLI_VERSION,\n tokenStore,\n auth,\n client,\n runner: systemCommandRunner({ cwd: homedir() }),\n hereRunner: systemCommandRunner({ cwd: process.cwd() }),\n home: homedir(),\n cwd: process.cwd(),\n envVars: process.env,\n },\n json: parsed.json,\n io,\n });\n }\n\n if (domain === \"auth\") {\n // ★await 를 빼면 이 try 가 실패를 «못 본다» — 거부 사유가 renderError 를 지나치고\n // 날것의 스택 트레이스로 나간다(2026-09-23 실물 실행에서 발견).\n return await handleAuth(action, connect().auth, resolved.endpoint, parsed.json, io);\n }\n\n const env = parsed.env ?? \"prod\";\n // ★카탈로그는 서버의 지금 목록이다. 못 받으면 스냅샷으로 답한다.\n if (domain === \"tools\" && action === \"catalog\") {\n return await printCatalog(parsed, io, resolved.endpoint, async () => connect().client);\n }\n // 스냅샷에 없는 명령은 서버의 지금 목록에서 찾는다 — 서버에 새로 열린 도구를 CLI 재배포 없이 쓴다.\n let routeTools: readonly GeneratedToolDefinition[] = getGeneratedTools(env);\n let remote = isAttachmentsUploadCommand(domain, action)\n || isInboxPollCommand(domain, action)\n || (domain === \"tools\" && (action === \"list\" || action === \"call\"))\n || matchGeneratedCommand(routeTools, parsed.positionals) !== undefined;\n if (!remote) {\n const live = await loadLiveTools(env, connect().client).catch(() => undefined);\n if (live && matchGeneratedCommand(live, parsed.positionals)) {\n routeTools = live;\n remote = true;\n }\n }\n if (!remote) {\n throw new Error(domain === \"tools\"\n ? \"Expected tools list, tools call <mcpName>, or tools catalog.\"\n : `Unknown command \"${domain}\".`);\n }\n\n // ★세션 역할은 없다 — 무엇을 할 수 있는지는 서버가 사용자 권한으로 정한다.\n const { client } = connect();\n\n if (isAttachmentsUploadCommand(domain, action)) {\n return await executeAttachmentsUploadCommand({\n argv: rest,\n client,\n json: parsed.json,\n io,\n });\n }\n\n if (isInboxPollCommand(domain, action)) {\n return await executeInboxPollCommand({ domain, action, argv: rest, client, json: parsed.json, io });\n }\n\n const generatedResult = await executeGeneratedCommand({\n tools: routeTools,\n argv: parsed.positionals,\n client,\n json: parsed.json,\n io,\n });\n if (generatedResult !== 2) {\n return generatedResult;\n }\n\n if (domain === \"tools\") {\n // ★위와 같은 이유로 await 가 필요하다. 이쪽이 실제로 스택을 뱉고 있었다.\n return await handleTools(action, rest, parsed, client, io);\n }\n\n throw new Error(`Unknown command \"${domain}\".`);\n } catch (error) {\n io.stderr.write(renderError(error, { json: parsed.json }));\n return 1;\n }\n}\n\nasync function handleAuth(\n action: string | undefined,\n auth: OAuthClient,\n endpoint: string,\n json: boolean,\n io: CliIO,\n): Promise<number> {\n if (action === \"login\") {\n await auth.login();\n io.stdout.write(renderSuccess({ ...await nextStep(), endpoint, authenticated: true }, { json }));\n return 0;\n }\n if (action === \"status\") {\n const token = await auth.getAccessToken();\n io.stdout.write(renderSuccess({ ...await nextStep(), endpoint, authenticated: Boolean(token) }, { json }));\n return 0;\n }\n if (action === \"logout\") {\n await auth.logout();\n io.stdout.write(renderSuccess({ endpoint, authenticated: false }, { json }));\n return 0;\n }\n throw new Error(\"Expected auth login, auth status, or auth logout.\");\n}\n\n/**\n * `tools catalog` — ★서버의 지금 목록을 먼저 보여 준다. 스냅샷만 보여 주면 서버에 열린 새 문서 유형(html)을\n * 에이전트가 «CLI 에 없다»고 읽었다(2026-10-10). 못 받으면(로그인 전·오프라인·깨진 저장소) 스냅샷으로\n * 답하되 «낡았을 수 있다»와 그 이유를 같이 싣는다 — 조용히 대체하지 않는다.\n */\nasync function printCatalog(\n parsed: GlobalArgs,\n io: CliIO,\n endpoint: string,\n liveClient: () => Promise<McpRpcClient>,\n): Promise<number> {\n const catalogEnv = parsed.env ?? \"prod\";\n try {\n const tools = await loadLiveTools(catalogEnv, await liveClient());\n io.stdout.write(renderSuccess(tools, { json: parsed.json }));\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n io.stdout.write(renderSuccess(getGeneratedTools(catalogEnv), {\n json: parsed.json,\n warnings: [`Could not read the live tool list from ${endpoint} (${reason}). `\n + `Showing the ${catalogEnv} catalog checked in when this CLI version was built — a snapshot of that `\n + \"server's tools/list that may miss newer document types and tools. Run `ainecto auth login`, then retry.\"],\n }));\n }\n return 0;\n}\n\nasync function handleTools(\n action: string | undefined,\n rest: string[],\n parsed: GlobalArgs,\n client: McpRpcClient,\n io: CliIO,\n): Promise<number> {\n if (action === \"list\") {\n const tools = await client.toolsList();\n io.stdout.write(renderSuccess(tools, { json: parsed.json }));\n return 0;\n }\n\n if (action === \"call\") {\n const toolName = rest[0];\n if (!toolName) {\n throw new Error(\"Expected MCP tool name after tools call.\");\n }\n const toolArgs = rest.slice(1);\n const payloadOptions = parsePayloadArgs(toolArgs);\n const payload = await parsePayloadSource({\n file: payloadOptions.file,\n inline: payloadOptions.inline,\n stdin: io.stdin,\n });\n const result = await client.toolsCall(toolName, payload.value);\n io.stdout.write(renderSuccess(result, { json: parsed.json, warnings: payload.warnings }));\n // 거부 문구는 그대로 보여 주되, 종료 코드로는 «실패»라고 말한다.\n return isToolError(result) ? 1 : 0;\n }\n\n throw new Error(\"Expected tools list, tools call <mcpName>, or tools catalog.\");\n}\n\ninterface GlobalArgs {\n env?: AinectoEnv;\n endpoint?: string;\n /** 옛 --role — 검사하지 않는다(legacyRole.ts). */\n legacyRole?: string;\n json: boolean;\n help: boolean;\n version: boolean;\n positionals: string[];\n}\n\nfunction parseGlobalArgs(argv: string[]): GlobalArgs {\n const result: GlobalArgs = { json: false, help: false, version: false, positionals: [] };\n for (let index = 0; index < argv.length; index += 1) {\n const arg = argv[index];\n if (!arg) {\n continue;\n }\n if (arg === \"--env\") {\n result.env = assertEnv(requireValue(arg, argv[++index]));\n } else if (arg === \"--endpoint\") {\n result.endpoint = requireValue(arg, argv[++index]);\n } else if (arg === \"--role\") {\n // ★옛 전역 플래그 — 값을 검사하지 않고 받는다(legacyRole.ts). 값 없이 끝나도 멈추지 않는다.\n const value = argv[index + 1];\n if (value !== undefined && !value.startsWith(\"--\")) {\n result.legacyRole = value;\n index += 1;\n }\n } else if (arg === \"--json\") {\n result.json = true;\n } else if (arg === \"--help\" || arg === \"-h\") {\n result.help = true;\n } else if (arg === \"--version\" || arg === \"-v\" || arg === \"-V\") {\n result.version = true;\n } else {\n result.positionals.push(arg);\n }\n }\n return result;\n}\n\nfunction parsePayloadArgs(argv: string[]): { file?: string; inline?: string } {\n const result: { file?: string; inline?: string } = {};\n const inline: string[] = [];\n for (let index = 0; index < argv.length; index += 1) {\n const arg = argv[index];\n if (!arg) {\n continue;\n }\n if (arg === \"--file\" || arg === \"-f\") {\n result.file = requireValue(arg, argv[++index]);\n } else {\n inline.push(arg);\n }\n }\n if (inline.length > 0) {\n result.inline = inline.join(\" \");\n }\n return result;\n}\n\nfunction requireValue(flag: string, value: string | undefined): string {\n if (!value || value.startsWith(\"--\")) {\n throw new Error(`${flag} requires a value.`);\n }\n return value;\n}\n\n/**\n * ★로그인은 설치의 끝이 아니다. 에이전트가 `auth status --json` 의 authenticated:true 를 보고 «설치 완료»로\n * 닫은 실측(2026-09-29, Codex)이 있다. 그래서 auth 결과에 다음 단계를 싣는다 — --json 에도.\n * 무엇이 남았는지는 `doctor` 한 곳이 판정한다(여기서 따로 판정하지 않는다).\n */\nasync function nextStep(): Promise<{ next: string }> {\n return { next: NEXT_STEP };\n}\n\n/** 설치·로그인 뒤 «다음에 할 일». 도움말과 auth 결과가 같은 문장을 쓴다. */\n// ★«참고»로 읽히면 넘긴다 — Codex 가 `next` 를 받고도 «업데이트 완료»만 말했다(2026-09-30 실측).\n// 그래서 «사용자가 설치·업데이트·로그인만 부탁했어도 지금 알려라»를 지시문으로 적는다.\nconst NEXT_STEP = [\n \"Connect your coding agents to AiNecto once per machine: `npx -y ainecto@latest setup`.\",\n \"AI agents: tell the user this now, even if they only asked to install, update, or sign in.\",\n \"To add AiNecto's working rules to a repository, run `npx -y ainecto@latest init` from its root.\",\n \"`npx -y ainecto@latest doctor` shows what is still missing and the command that fixes it.\",\n].join(\"\\n\");\n\nfunction helpText(): string {\n return [\n \"AiNecto CLI\",\n \"\",\n NEXT_STEP,\n \"\",\n \"Usage:\",\n \" ainecto auth login|status|logout [--env prod|dev] [--json] (one sign-in per machine)\",\n \" ainecto tools list [--env prod|dev] [--endpoint URL] [--json]\",\n \" ainecto tools call <mcpName> [-f payload.json|@-] [inline-json] [--json]\",\n \" ainecto attachments upload --document-uuid <uuid> <file...> [--json]\",\n \" ainecto notifications poll --cursor-file <path> [--kinds A,B] [--workspace <uuid>]... [--project <uuid>]... [--direct-only] [--limit N] [--json]\",\n \" ainecto notifications ack --cursor-file <path> (after the agent handled the polled batch)\",\n \" ainecto agent-todos poll [--workspace <uuid>]... [--project <uuid>]... [--only-new --seen-file <path>] [--json]\",\n \" --workspace and --project may repeat: any of the given workspaces AND any of the given projects\",\n \" poll exit codes: 0 new items · 3 nothing new · 1 error · 2 usage error\",\n \" ainecto <generated-command> [flags] [-f payload.json] [--yes] [--json]\",\n \" ainecto mcp [--env prod|dev] [--endpoint URL]\",\n \"\",\n \"Setup (once per machine):\",\n \" ainecto setup [--env prod|dev] [--endpoint URL] [--dry-run] [--json] sign in and connect Claude Code, Cursor, and Codex\",\n \" ainecto setup --undo remove those connections (sign-in stays)\",\n \" ainecto status [--json] who is signed in, and what is connected (read-only)\",\n \" ainecto doctor [--json] status + what is missing and the command that fixes it\",\n \"\",\n \"Harness:\",\n \" ainecto init [--mcp] [--dry-run] [--json] AiNecto rules for this repository (--mcp also writes .mcp.json and .cursor/mcp.json)\",\n \" ainecto init --undo\",\n \"\",\n ].join(\"\\n\");\n}\n","#!/usr/bin/env node\nimport { runAinectoCli } from \"../adapters/cli/ainectoCli\";\n\nconst exitCode = await runAinectoCli(process.argv.slice(2), {\n stdin: process.stdin,\n stdout: process.stdout,\n stderr: process.stderr,\n});\n\nprocess.exitCode = exitCode;\n"],"mappings":";;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,OAAO,UAAU,QAAQ,IAAI,MAAM,WAAW,aAAa;AACpE,SAAS,eAAe;AACx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,QAAQ;AAAA,EAChB,QAAQ,QAAQ;AAClB,CAAC;AAED,QAAQ,WAAW;","names":["createHash","createHash","resolve","readFile","isRecord","generatedTools","createHash","isRecord","isRecord","generatedTools","isRecord","isRecord","isRecord","createInterface","createInterface","readFile","stat","isRecord","stat","readFile","isRecord","requireValue","mkdir","readFile","rename","dirname","isRecord","readFile","mkdir","dirname","rename","chmod","mkdir","rename","rm","stat","writeFile","dirname","join","resolve","sep","basename","isRecord","basename","open","hit","stableStringify","createHash","stableStringify","readFile","dirname","join","isNodeError","resolve","plan","isRecord","rm","join","dirname","mkdir","writeFile","chmod","rename","sep","stat","chmod","mkdir","readFile","rename","stat","writeFile","dirname","join","spawn","resolve","join","readFile","isNodeError","readIfExists","mkdir","dirname","stat","writeFile","chmod","rename","agents","failed","readFile","join","join","readFile","homedir","client","homedir","requireValue"]}
1
+ {"version":3,"sources":["../../src/core/auth/tokenStore.ts","../../src/core/auth/oauth.ts","../../src/core/config/endpoints.ts","../../src/core/auth/clientRegistration.ts","../../src/core/input/payloadSource.ts","../../src/core/harness/legacyRole.ts","../../src/core/version.ts","../../src/core/mcp/rpcClient.ts","../../src/core/output/render.ts","../../src/core/catalog/generated.prod.ts","../../src/core/catalog/generated.dev.ts","../../src/core/catalog/generator.ts","../../src/core/catalog/index.ts","../../src/core/mcp/stdioBridge.ts","../../src/adapters/mcp/connector.ts","../../src/core/catalog/enrichments.ts","../../src/core/output/table.ts","../../src/adapters/cli/errors.ts","../../src/adapters/cli/flagParser.ts","../../src/adapters/cli/destructiveConfirmation.ts","../../src/adapters/cli/bespokeCommands.ts","../../src/adapters/cli/generatedCommandRouter.ts","../../src/core/upload/attachmentUpload.ts","../../src/core/mcp/toolPayload.ts","../../src/adapters/cli/attachmentsUploadCommand.ts","../../src/adapters/cli/inboxPollCommands.ts","../../src/adapters/cli/initCommand.ts","../../src/core/harness/agentTargets.ts","../../src/core/harness/harnessDoc.ts","../../src/core/harness/initRecord.ts","../../src/core/harness/initPlan.ts","../../src/core/harness/documentFetch.ts","../../src/core/harness/repositoryFiles.ts","../../src/core/setup/accountSummary.ts","../../src/core/setup/agentConnections.ts","../../src/core/setup/commandRunner.ts","../../src/adapters/cli/setupCommand.ts","../../src/core/setup/doctorChecks.ts","../../src/core/setup/machineStatus.ts","../../src/adapters/cli/statusCommand.ts","../../src/adapters/cli/ainectoCli.ts","../../src/bin/ainecto.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { mkdir, readFile, rename, rm, stat, writeFile, chmod } from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nexport interface StoredTokenSet {\n endpoint: string;\n accessToken: string;\n refreshToken?: string;\n tokenType?: string;\n expiresAt?: number;\n scope?: string;\n clientId?: string;\n clientSecret?: string;\n authorizationServer?: string;\n updatedAt: string;\n}\n\n/**\n * 토큰 저장소 — ★서버(endpoint)마다 «한 칸»이다(설계 0.4.2 §2-4). 세션 역할은 없다(0.8.0).\n * 0.4.1 이하가 쓴 역할별 칸은 읽지도 지우지도 않는다(사용자 결정 «마이그레이션은 고려하지 마»).\n */\nexport interface TokenStore {\n load(endpoint: string): Promise<StoredTokenSet | undefined>;\n save(endpoint: string, token: StoredTokenSet): Promise<void>;\n delete(endpoint: string): Promise<void>;\n}\n\ntype TokenFile = Record<string, StoredTokenSet>;\n\nexport class FileTokenStore implements TokenStore {\n readonly filePath: string;\n\n constructor(rootDir = join(homedir(), \".ainecto\")) {\n this.filePath = join(rootDir, \"tokens.json\");\n }\n\n async load(endpoint: string): Promise<StoredTokenSet | undefined> {\n const file = await this.readFile();\n return file[tokenKey(endpoint)];\n }\n\n async save(endpoint: string, token: StoredTokenSet): Promise<void> {\n const file = await this.readFile();\n file[tokenKey(endpoint)] = { ...token, endpoint, updatedAt: new Date().toISOString() };\n await this.writeFile(file);\n }\n\n async delete(endpoint: string): Promise<void> {\n const file = await this.readFile();\n delete file[tokenKey(endpoint)];\n await this.writeFile(file);\n }\n\n private async readFile(): Promise<TokenFile> {\n try {\n await this.hardenExistingPermissions();\n const raw = await readFile(this.filePath, \"utf8\");\n const parsed = JSON.parse(raw) as unknown;\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n throw new Error(\"Token file must contain an object.\");\n }\n return parsed as TokenFile;\n } catch (error) {\n if (isNodeError(error, \"ENOENT\")) {\n return {};\n }\n throw error;\n }\n }\n\n private async writeFile(file: TokenFile): Promise<void> {\n await mkdir(dirname(this.filePath), { recursive: true, mode: 0o700 });\n await chmod(dirname(this.filePath), 0o700);\n const tmpPath = `${this.filePath}.${process.pid}.${Date.now()}.tmp`;\n await writeFile(tmpPath, `${JSON.stringify(file, null, 2)}\\n`, { mode: 0o600 });\n await chmod(tmpPath, 0o600);\n await rename(tmpPath, this.filePath);\n await chmod(this.filePath, 0o600);\n }\n\n private async hardenExistingPermissions(): Promise<void> {\n const dirPath = dirname(this.filePath);\n await chmodIfPermissive(dirPath, 0o700);\n await chmodIfPermissive(this.filePath, 0o600);\n }\n}\n\n/** 서버 하나의 칸. 0.4.1 이하의 «역할 없는» 칸과 같은 키다 — 그때 역할 없이 로그인해 둔 사람은 그대로 쓴다. */\nexport function tokenKey(endpoint: string): string {\n return createHash(\"sha256\").update(endpoint).digest(\"hex\");\n}\n\nexport async function tokenStorePermissions(path: string): Promise<{ mode: number } | undefined> {\n try {\n const result = await stat(path);\n return { mode: result.mode & 0o777 };\n } catch (error) {\n if (isNodeError(error, \"ENOENT\")) {\n return undefined;\n }\n throw error;\n }\n}\n\nexport async function tokenStoreDirectoryPermissions(path: string): Promise<{ mode: number } | undefined> {\n return tokenStorePermissions(dirname(path));\n}\n\nexport async function removeTokenStoreForTests(path: string): Promise<void> {\n await rm(dirname(path), { recursive: true, force: true });\n}\n\nfunction isNodeError(error: unknown, code: string): error is NodeJS.ErrnoException {\n return error instanceof Error && \"code\" in error && error.code === code;\n}\n\nasync function chmodIfPermissive(path: string, mode: number): Promise<void> {\n try {\n const result = await stat(path);\n if ((result.mode & 0o077) !== 0) {\n await chmod(path, mode);\n }\n } catch (error) {\n if (isNodeError(error, \"ENOENT\")) {\n return;\n }\n throw error;\n }\n}\n","import { createHash, randomBytes } from \"node:crypto\";\nimport { createServer } from \"node:http\";\nimport { spawn, type ChildProcess, type SpawnOptions } from \"node:child_process\";\nimport { URLSearchParams } from \"node:url\";\nimport type { StoredTokenSet, TokenStore } from \"./tokenStore\";\nimport { registerPublicClient, type ClientRegistrationResult } from \"./clientRegistration\";\nimport { assertTrustedEndpointUrl, isDefaultEndpoint } from \"../config/endpoints\";\n\n/**\n * ★로그인은 서버마다 한 번이다(설계 0.4.2). 토큰은 역할을 싣지 않고, 역할은 저장소에서 와서\n * 요청 헤더로 실린다({@link McpRpcClient}). 그래서 이 클라이언트에는 역할이 없다.\n */\nexport interface OAuthClientOptions {\n endpoint: string;\n tokenStore: TokenStore;\n fetchImpl?: typeof fetch;\n envVars?: NodeJS.ProcessEnv;\n /**\n * 브라우저를 연다. <b>열기에 실패하면 거절</b>하고, 성공이 확인되면(또는 아직 모르면) 가만히 있는다.\n * login 은 이 약속을 «기다리지 않고» 콜백 대기와 경주시킨다 — 여는 명령이 브라우저가 닫힐 때까지\n * 안 끝나는 환경에서 순서대로 기다리면 교착한다.\n */\n openBrowser?: (url: string) => Promise<void>;\n /**\n * 인가 URL 을 «브라우저를 열기 전에» 알린다. CLI 는 stderr 에 한 줄 쓴다 — 브라우저가 안 열려도\n * 사람이 직접 열 수 있고, 에이전트가 실행했다면 명령이 끝날 때 그 줄이 에이전트에게 닿는다.\n */\n onAuthorizeUrl?: (url: string) => void;\n /** 콜백을 기다리는 한도. 기본 5분 — 사람이 로그인하기엔 넉넉하고, 에이전트 셸 도구 최대 한도보다 짧다. */\n loginTimeoutMs?: number;\n /**\n * 토큰 저장소를 «읽기만» 한다 — 갱신하지 않는다(네트워크도, 토큰 파일 쓰기도 없다).\n * {@code init --dry-run} 이 쓴다: 「아무것도 바꾸지 않는다」에 사용자의 로그인 상태도 든다.\n * 갱신이 필요한(만료된) 토큰은 «없음»으로 본다.\n */\n readOnly?: boolean;\n}\n\n/** 로그인 대기 기본 한도(5분). */\nexport const DEFAULT_LOGIN_TIMEOUT_MS = 300_000;\n\n/**\n * 로그인이 «사람 쪽 사정으로» 끝나지 못한 이유. {@code code} 는 {@code --json} 의 {@code error.code} 로\n * 그대로 나간다(종료 코드는 다른 실패와 같은 1 — 받는 쪽은 메시지를 읽고 사람에게 옮긴다).\n */\nexport class OAuthLoginError extends Error {\n constructor(readonly code: \"LOGIN_TIMEOUT\" | \"BROWSER_UNAVAILABLE\" | \"CALLBACK_UNAVAILABLE\", message: string) {\n super(message);\n this.name = \"OAuthLoginError\";\n }\n}\n\n/**\n * ★저장된 로그인을 인증 서버가 «더는 받지 않는다» — 갱신 요청이 {@code invalid_grant} 등으로 거절됐다\n * (RFC 6749 §5.2: refresh token 만료·폐기, client 등록 폐기). 다시 로그인하는 것 말고는 길이 없다.\n *\n * <p>⚠네트워크 장애·5xx·메타데이터 실패는 이것이 아니다 — 그건 다시 로그인해도 안 고쳐지고,\n * 로그인으로 삼키면 진짜 원인이 브라우저 창 뒤로 숨는다.\n */\nexport class OAuthReauthRequiredError extends Error {\n constructor(readonly oauthError: string, status: number) {\n super(`The stored sign-in was rejected by the server (${oauthError}, HTTP ${status}). Sign in again.`);\n this.name = \"OAuthReauthRequiredError\";\n }\n}\n\n/** 갱신 거절 중 «다시 로그인하라»는 뜻인 OAuth 오류 코드(RFC 6749 §5.2). */\nconst REAUTH_REQUIRED_ERRORS = new Set([\"invalid_grant\", \"invalid_client\", \"unauthorized_client\"]);\n\nexport interface OAuthMetadata {\n authorizationEndpoint: string;\n tokenEndpoint: string;\n registrationEndpoint?: string;\n issuer?: string;\n codeChallengeMethodsSupported: string[];\n}\n\nexport interface TokenProvider {\n getAccessToken(): Promise<string | undefined>;\n refreshAfterUnauthorized(): Promise<string | undefined>;\n}\n\nexport class OAuthClient implements TokenProvider {\n private readonly fetchImpl: typeof fetch;\n private readonly envVars: NodeJS.ProcessEnv;\n private readonly openBrowserImpl: (url: string) => Promise<void>;\n\n constructor(private readonly options: OAuthClientOptions) {\n this.fetchImpl = options.fetchImpl ?? fetch;\n this.envVars = options.envVars ?? process.env;\n this.openBrowserImpl = options.openBrowser ?? openBrowser;\n }\n\n async getAccessToken(): Promise<string | undefined> {\n const envToken = this.envVars.AINECTO_TOKEN;\n if (envToken) {\n assertEnvTokenEndpointAllowed(this.options.endpoint, this.envVars);\n return envToken;\n }\n\n const stored = await this.options.tokenStore.load(this.options.endpoint);\n if (!stored) {\n return undefined;\n }\n\n if (!shouldRefresh(stored)) {\n return stored.accessToken;\n }\n if (this.options.readOnly) {\n return isExpired(stored) ? undefined : stored.accessToken;\n }\n // ★만료됐는데 갱신할 수단이 없으면 «토큰 없음»이다. 예전엔 만료된 토큰을 그대로 돌려줘서,\n // init 은 로그인 대신 401 안내로 떨어졌고 다른 경로는 받을 게 뻔한 401 을 받으러 갔다\n // (2026-09-29 독립 리뷰 P1-2). 아직 60초 창 안이면 쓸 수 있으므로 돌려준다.\n if (!stored.refreshToken) {\n return isExpired(stored) ? undefined : stored.accessToken;\n }\n\n return this.refreshStoredToken({ ...stored, refreshToken: stored.refreshToken });\n }\n\n async refreshAfterUnauthorized(): Promise<string | undefined> {\n const stored = await this.options.tokenStore.load(this.options.endpoint);\n if (this.options.readOnly || !stored?.refreshToken) {\n return undefined;\n }\n return this.refreshStoredToken({ ...stored, refreshToken: stored.refreshToken });\n }\n\n async login(): Promise<StoredTokenSet> {\n const pkce = generatePkcePair();\n const state = generateOAuthState();\n const loopback = await createLoopbackReceiver(state);\n\n try {\n const metadata = await discoverOAuthMetadata(this.options.endpoint, this.fetchImpl);\n const registration = metadata.registrationEndpoint\n ? await registerPublicClient(metadata.registrationEndpoint, loopback.redirectUri, this.fetchImpl)\n : { clientId: \"ainecto-cli\" };\n const authorizeUrl = new URL(metadata.authorizationEndpoint);\n authorizeUrl.searchParams.set(\"response_type\", \"code\");\n authorizeUrl.searchParams.set(\"client_id\", registration.clientId);\n authorizeUrl.searchParams.set(\"redirect_uri\", loopback.redirectUri);\n authorizeUrl.searchParams.set(\"code_challenge\", pkce.codeChallenge);\n authorizeUrl.searchParams.set(\"code_challenge_method\", \"S256\");\n authorizeUrl.searchParams.set(\"resource\", this.options.endpoint);\n authorizeUrl.searchParams.set(\"state\", state);\n // ★역할을 scope 에 싣지 않는다(설계 0.4.2) — 로그인은 서버마다 한 번이고, 역할은 저장소에서\n // 요청 헤더로 온다. 역할은 작업 가드레일이지 보안 경계가 아니다(2026-09-29 사용자 결정 Q1).\n\n assertTrustedEndpointUrl(authorizeUrl, \"OAuth authorization URL\");\n const url = authorizeUrl.toString();\n this.options.onAuthorizeUrl?.(url);\n // ★셋 중 먼저 오는 것이 결과다 — 콜백 도착 / 브라우저 열기 실패 / 시간 한도.\n // 예전엔 한도가 없고 열기 실패를 못 봐서, 브라우저가 없는 기계에서 말없이 영원히 기다렸다\n // (2026-09-29 독립 리뷰 P1-2). 비TTY(에이전트가 실행)에서는 그 대기가 곧 멈춤이다.\n const browserFailure = this.openBrowserImpl(url).then(() => new Promise<never>(() => undefined));\n const code = await withTimeout(\n Promise.race([loopback.waitForCode(), browserFailure]),\n this.options.loginTimeoutMs ?? DEFAULT_LOGIN_TIMEOUT_MS,\n );\n const token = await exchangeToken(metadata.tokenEndpoint, {\n grant_type: \"authorization_code\",\n code,\n redirect_uri: loopback.redirectUri,\n client_id: registration.clientId,\n code_verifier: pkce.codeVerifier,\n resource: this.options.endpoint,\n ...(registration.clientSecret ? { client_secret: registration.clientSecret } : {}),\n }, this.fetchImpl);\n\n const stored = toStoredToken(this.options.endpoint, token, metadata, registration);\n await this.options.tokenStore.save(this.options.endpoint, stored);\n return stored;\n } finally {\n await loopback.close();\n }\n }\n\n async logout(): Promise<void> {\n await this.options.tokenStore.delete(this.options.endpoint);\n }\n\n /** 부르는 쪽이 refresh token 이 있음을 이미 확인했다 — 타입이 그것을 요구한다. */\n private async refreshStoredToken(stored: StoredTokenSet & { refreshToken: string }): Promise<string | undefined> {\n const metadata = await discoverOAuthMetadata(this.options.endpoint, this.fetchImpl);\n const token = await exchangeToken(metadata.tokenEndpoint, {\n grant_type: \"refresh_token\",\n refresh_token: stored.refreshToken,\n client_id: stored.clientId ?? \"ainecto-cli\",\n ...(stored.clientSecret ? { client_secret: stored.clientSecret } : {}),\n resource: this.options.endpoint,\n }, this.fetchImpl);\n const next = toStoredToken(this.options.endpoint, token, metadata, stored);\n await this.options.tokenStore.save(this.options.endpoint, next);\n return next.accessToken;\n }\n}\n\nexport function generatePkcePair(): { codeVerifier: string; codeChallenge: string } {\n const codeVerifier = randomBytes(32).toString(\"base64url\");\n const codeChallenge = createHash(\"sha256\").update(codeVerifier).digest(\"base64url\");\n return { codeVerifier, codeChallenge };\n}\n\nexport function generateOAuthState(): string {\n return randomBytes(32).toString(\"base64url\");\n}\n\n/** 이미 만료됐는가. 만료 시각이 없으면 만료되지 않은 것으로 본다(서버가 수명을 안 알려 준 토큰). */\nexport function isExpired(token: Pick<StoredTokenSet, \"expiresAt\">, now = Date.now()): boolean {\n return token.expiresAt !== undefined && token.expiresAt <= now;\n}\n\nasync function withTimeout<T>(work: Promise<T>, timeoutMs: number): Promise<T> {\n let timer: NodeJS.Timeout | undefined;\n const timeout = new Promise<never>((_, reject) => {\n timer = setTimeout(() => {\n const minutes = timeoutMs / 60_000;\n const span = Number.isInteger(minutes) ? `${minutes} minute${minutes === 1 ? \"\" : \"s\"}` : `${timeoutMs} ms`;\n reject(new OAuthLoginError(\n \"LOGIN_TIMEOUT\",\n `Sign-in was not completed within ${span}. Nothing was saved — run the same command again.`,\n ));\n }, timeoutMs);\n });\n try {\n return await Promise.race([work, timeout]);\n } finally {\n clearTimeout(timer);\n }\n}\n\nexport function shouldRefresh(token: Pick<StoredTokenSet, \"expiresAt\">, now = Date.now()): boolean {\n if (!token.expiresAt) {\n return false;\n }\n return token.expiresAt - now < 60_000;\n}\n\nexport async function discoverOAuthMetadata(endpoint: string, fetchImpl: typeof fetch = fetch): Promise<OAuthMetadata> {\n assertTrustedEndpointUrl(endpoint, \"MCP endpoint\");\n const resourceMetadataUrl = await discoverResourceMetadataUrl(endpoint, fetchImpl);\n assertTrustedEndpointUrl(resourceMetadataUrl, \"OAuth protected resource metadata URL\");\n const resourceMetadata = await fetchJson<Record<string, unknown>>(resourceMetadataUrl, fetchImpl);\n const authorizationServers = resourceMetadata.authorization_servers;\n if (!Array.isArray(authorizationServers) || typeof authorizationServers[0] !== \"string\") {\n throw new Error(\"OAuth protected resource metadata did not include authorization_servers.\");\n }\n const authServer = authorizationServers[0];\n assertTrustedEndpointUrl(authServer, \"OAuth authorization server\");\n const metadataUrl = authServer.includes(\"/.well-known/\")\n ? authServer\n : `${authServer.replace(/\\/$/, \"\")}/.well-known/oauth-authorization-server`;\n assertTrustedEndpointUrl(metadataUrl, \"OAuth authorization server metadata URL\");\n const metadata = await fetchJson<Record<string, unknown>>(metadataUrl, fetchImpl);\n if (typeof metadata.authorization_endpoint !== \"string\" || typeof metadata.token_endpoint !== \"string\") {\n throw new Error(\"OAuth authorization server metadata is missing authorization_endpoint or token_endpoint.\");\n }\n assertTrustedEndpointUrl(metadata.authorization_endpoint, \"OAuth authorization endpoint\");\n assertTrustedEndpointUrl(metadata.token_endpoint, \"OAuth token endpoint\");\n if (typeof metadata.registration_endpoint === \"string\") {\n assertTrustedEndpointUrl(metadata.registration_endpoint, \"OAuth client registration endpoint\");\n }\n if (typeof metadata.issuer === \"string\") {\n assertTrustedEndpointUrl(metadata.issuer, \"OAuth issuer\");\n }\n const codeChallengeMethodsSupported = parseStringArray(metadata.code_challenge_methods_supported);\n if (!codeChallengeMethodsSupported.includes(\"S256\")) {\n throw new Error(\"OAuth authorization server metadata must support PKCE S256.\");\n }\n return {\n authorizationEndpoint: metadata.authorization_endpoint,\n tokenEndpoint: metadata.token_endpoint,\n registrationEndpoint: typeof metadata.registration_endpoint === \"string\" ? metadata.registration_endpoint : undefined,\n issuer: typeof metadata.issuer === \"string\" ? metadata.issuer : undefined,\n codeChallengeMethodsSupported,\n };\n}\n\nasync function discoverResourceMetadataUrl(endpoint: string, fetchImpl: typeof fetch): Promise<string> {\n const challengeUrl = new URL(endpoint);\n assertTrustedEndpointUrl(challengeUrl, \"MCP endpoint\");\n const response = await fetchImpl(challengeUrl, { method: \"GET\" });\n const challenge = response.headers.get(\"www-authenticate\");\n const fromChallenge = challenge ? parseBearerChallengeParam(challenge, \"resource_metadata\") : undefined;\n if (fromChallenge) {\n assertTrustedEndpointUrl(fromChallenge, \"OAuth protected resource metadata URL\");\n return fromChallenge;\n }\n const origin = new URL(endpoint).origin;\n const fallback = `${origin}/.well-known/oauth-protected-resource`;\n assertTrustedEndpointUrl(fallback, \"OAuth protected resource metadata URL\");\n return fallback;\n}\n\nexport function parseBearerChallengeParam(header: string, name: string): string | undefined {\n const pattern = new RegExp(`${name}=\"([^\"]+)\"`);\n return pattern.exec(header)?.[1];\n}\n\nasync function exchangeToken(\n tokenEndpoint: string,\n params: Record<string, string>,\n fetchImpl: typeof fetch,\n): Promise<Record<string, unknown>> {\n assertTrustedEndpointUrl(tokenEndpoint, \"OAuth token endpoint\");\n const response = await fetchImpl(tokenEndpoint, {\n method: \"POST\",\n headers: { \"content-type\": \"application/x-www-form-urlencoded\" },\n body: new URLSearchParams(params),\n });\n if (!response.ok) {\n const oauthError = await readOAuthErrorCode(response);\n if (params.grant_type === \"refresh_token\" && oauthError !== undefined && REAUTH_REQUIRED_ERRORS.has(oauthError)) {\n throw new OAuthReauthRequiredError(oauthError, response.status);\n }\n throw new Error(`OAuth token exchange failed with HTTP ${response.status}${oauthError ? ` (${oauthError})` : \"\"}.`);\n }\n return response.json() as Promise<Record<string, unknown>>;\n}\n\n/** 토큰 오류 응답의 {@code error} 코드. 본문이 JSON 이 아니면 없음 — 그때는 «재로그인» 으로 판정하지 않는다. */\nasync function readOAuthErrorCode(response: Response): Promise<string | undefined> {\n try {\n const body = await response.json() as Record<string, unknown>;\n return typeof body.error === \"string\" ? body.error : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * ★<b>쓸 수 있는 저장 로그인 — init·setup 의 단일 진입점.</b> 없으면 undefined(→ 부르는 쪽이 로그인한다).\n *\n * <p>«없음»에는 저장된 갱신 토큰을 서버가 거절한 경우({@link OAuthReauthRequiredError})도 든다 —\n * 예전엔 setup 이 raw {@code getAccessToken} 을 불러, 그 거절이 로그인 «전에» 명령을 끝냈고 같은 setup 을\n * 반복해도 회복하지 않았다(리뷰 #6 F2). 그 밖의 실패(네트워크·불신 주소의 AINECTO_TOKEN 거절)는 그대로 던진다.\n */\nexport async function usableAccessToken(auth: Pick<TokenProvider, \"getAccessToken\">): Promise<string | undefined> {\n try {\n return await auth.getAccessToken();\n } catch (error) {\n if (error instanceof OAuthReauthRequiredError) {\n return undefined;\n }\n throw error;\n }\n}\n\ntype TokenContext = Partial<Pick<StoredTokenSet, \"refreshToken\" | \"tokenType\" | \"expiresAt\" | \"scope\" | \"clientId\" | \"clientSecret\">>\n & Partial<ClientRegistrationResult>;\n\nfunction toStoredToken(\n endpoint: string,\n token: Record<string, unknown>,\n metadata: OAuthMetadata,\n previous?: TokenContext,\n): StoredTokenSet {\n if (typeof token.access_token !== \"string\") {\n throw new Error(\"OAuth token response did not include access_token.\");\n }\n const expiresIn = typeof token.expires_in === \"number\" ? token.expires_in : undefined;\n return {\n endpoint,\n accessToken: token.access_token,\n refreshToken: typeof token.refresh_token === \"string\" ? token.refresh_token : previous?.refreshToken,\n tokenType: typeof token.token_type === \"string\" ? token.token_type : previous?.tokenType,\n expiresAt: expiresIn ? Date.now() + expiresIn * 1000 : previous?.expiresAt,\n scope: typeof token.scope === \"string\" ? token.scope : previous?.scope,\n clientId: previous?.clientId ?? \"ainecto-cli\",\n clientSecret: previous?.clientSecret,\n authorizationServer: metadata.issuer,\n updatedAt: new Date().toISOString(),\n };\n}\n\n/**\n * 로그인 콜백을 받는 loopback 서버. {@code host} 는 시험이 «바인딩 실패»를 만들 때만 바꾼다.\n */\nexport async function createLoopbackReceiver(expectedState: string, host = \"127.0.0.1\"): Promise<{\n redirectUri: string;\n waitForCode(): Promise<string>;\n close(): Promise<void>;\n}> {\n let resolveCode!: (code: string) => void;\n let rejectCode!: (error: Error) => void;\n const codePromise = new Promise<string>((resolve, reject) => {\n resolveCode = resolve;\n rejectCode = reject;\n });\n codePromise.catch(() => undefined);\n\n const server = createServer((req, res) => {\n const url = new URL(req.url ?? \"/\", \"http://127.0.0.1\");\n const error = url.searchParams.get(\"error\");\n const code = url.searchParams.get(\"code\");\n const state = url.searchParams.get(\"state\");\n if (error) {\n res.writeHead(400, { \"content-type\": \"text/plain\" });\n res.end(\"AiNecto CLI authorization failed. You can close this tab.\");\n rejectCode(new Error(`OAuth authorization failed: ${error}`));\n return;\n }\n if (!state || state !== expectedState) {\n res.writeHead(400, { \"content-type\": \"text/plain\" });\n res.end(\"AiNecto CLI authorization state mismatch. You can close this tab.\");\n rejectCode(new Error(\"OAuth state mismatch.\"));\n return;\n }\n if (!code) {\n res.writeHead(400, { \"content-type\": \"text/plain\" });\n res.end(\"Missing OAuth code.\");\n rejectCode(new Error(\"OAuth redirect did not include a code.\"));\n return;\n }\n res.writeHead(200, { \"content-type\": \"text/plain\" });\n res.end(\"AiNecto CLI authorization complete. You can close this tab.\");\n resolveCode(code);\n });\n\n // ★바인딩이 막히면(에이전트 sandbox 등) 예전엔 error 리스너가 없어 처리되지 않은 예외로 죽었다\n // (2026-09-29 코드 리뷰 P1). 사람이 할 일을 말하는 오류로 바꾼다.\n await new Promise<void>((resolve, reject) => {\n server.once(\"error\", (error) => reject(new OAuthLoginError(\n \"CALLBACK_UNAVAILABLE\",\n `Could not start the local sign-in callback on ${host} (${error.message}). `\n + \"If this command runs in a sandbox, allow local network binding or run it outside the sandbox.\",\n )));\n server.listen(0, host, () => resolve());\n });\n const address = server.address();\n if (!address || typeof address === \"string\") {\n throw new Error(\"Loopback OAuth server did not bind to a TCP port.\");\n }\n return {\n redirectUri: `http://127.0.0.1:${address.port}/callback`,\n waitForCode: () => codePromise,\n close: () => new Promise<void>((resolve, reject) => {\n // Node 18 은 브라우저가 붙들고 있는 keep-alive 연결이 끝날 때까지 close 가 늦어진다.\n server.closeAllConnections?.();\n server.close((error) => error ? reject(error) : resolve());\n }),\n };\n}\n\nfunction parseStringArray(value: unknown): string[] {\n return Array.isArray(value) ? value.filter((item): item is string => typeof item === \"string\") : [];\n}\n\nasync function fetchJson<T>(url: string, fetchImpl: typeof fetch): Promise<T> {\n assertTrustedEndpointUrl(url, \"OAuth metadata URL\");\n const response = await fetchImpl(url);\n if (!response.ok) {\n throw new Error(`Failed to fetch OAuth metadata from ${url}: HTTP ${response.status}.`);\n }\n return response.json() as Promise<T>;\n}\n\nexport function getBrowserOpenCommand(\n url: string,\n platform: NodeJS.Platform = process.platform,\n): { command: string; args: string[] } {\n assertTrustedEndpointUrl(url, \"OAuth authorization URL\");\n if (platform === \"darwin\") {\n return { command: \"open\", args: [url] };\n }\n if (platform === \"win32\") {\n return { command: \"explorer.exe\", args: [url] };\n }\n return { command: \"xdg-open\", args: [url] };\n}\n\nexport interface LaunchBrowserDeps {\n platform?: NodeJS.Platform;\n spawnImpl?: (command: string, args: string[], options: SpawnOptions) => ChildProcess;\n}\n\n/**\n * 기본 브라우저 열기. <b>여는 명령이 없거나(ENOENT) 0 이 아닌 코드로 끝나면 거절</b>한다.\n *\n * <p>★예전엔 {@code error} 리스너가 없어 명령이 없으면 처리되지 않은 오류로 죽었고, 명령은 있는데\n * 브라우저가 없으면({@code xdg-open} 비0 종료) 아무 말 없이 콜백을 영원히 기다렸다\n * (2026-09-29 독립 리뷰 P1-2).\n *\n * <p>⚠<b>Windows 는 종료 코드를 보지 않는다.</b> {@code explorer.exe} 는 성공해도 1 로 끝나는 것으로\n * 알려져 있어, 그 코드로 판정하면 정상 환경을 실패로 만든다 — 명령이 «떴다»는 것만 본다\n * (설계 §8-1, Windows 실측 V14 전까지 추정).\n */\nexport function launchBrowser(url: string, deps: LaunchBrowserDeps = {}): Promise<void> {\n const platform = deps.platform ?? process.platform;\n const { command, args } = getBrowserOpenCommand(url, platform);\n const spawnImpl = deps.spawnImpl ?? spawn;\n return new Promise<void>((resolve, reject) => {\n const unavailable = (reason: string) => new OAuthLoginError(\n \"BROWSER_UNAVAILABLE\",\n `Could not open a browser on this machine (${command}: ${reason}). Sign-in needs a browser here.`,\n );\n let child: ChildProcess;\n try {\n child = spawnImpl(command, args, { stdio: \"ignore\", detached: true });\n } catch (error) {\n reject(unavailable(error instanceof Error ? error.message : String(error)));\n return;\n }\n child.once(\"error\", (error) => reject(unavailable(error.message)));\n if (platform === \"win32\") {\n child.once(\"spawn\", () => resolve());\n } else {\n child.once(\"exit\", (code, signal) => {\n if (code === 0) {\n resolve();\n } else {\n reject(unavailable(code === null ? `stopped by ${signal ?? \"a signal\"}` : `exited with code ${code}`));\n }\n });\n }\n child.unref();\n });\n}\n\nfunction openBrowser(url: string): Promise<void> {\n return launchBrowser(url);\n}\n\nfunction assertEnvTokenEndpointAllowed(endpoint: string, envVars: NodeJS.ProcessEnv): void {\n if (envVars.AINECTO_ALLOW_CUSTOM_ENDPOINT_TOKEN === \"1\") {\n return;\n }\n if (isDefaultEndpoint(endpoint)) {\n return;\n }\n throw new Error(\"AINECTO_TOKEN can only be used with the default prod/dev endpoints. Set AINECTO_ALLOW_CUSTOM_ENDPOINT_TOKEN=1 only when you intentionally trust the custom endpoint.\");\n}\n","export type AinectoEnv = \"prod\" | \"dev\";\n\nexport interface EndpointResolutionInput {\n env?: AinectoEnv;\n endpoint?: string;\n envVars?: NodeJS.ProcessEnv;\n}\n\nexport interface ResolvedEndpoint {\n env: AinectoEnv;\n endpoint: string;\n source: \"flag\" | \"env\" | \"default\";\n}\n\n/**\n * 기본 MCP 엔드포인트.\n *\n * OAuth 메타데이터(issuer·resource·authorization_servers)도 ainecto.com 이다.\n */\nconst DEFAULT_ENDPOINTS: Record<AinectoEnv, string> = {\n prod: \"https://ainecto.com/mcp\",\n dev: \"https://dev.ainecto.com/mcp\",\n};\n\nexport function resolveEndpoint(input: EndpointResolutionInput = {}): ResolvedEndpoint {\n const envVars = input.envVars ?? process.env;\n const env = input.env ?? \"prod\";\n\n if (input.endpoint) {\n return { env, endpoint: normalizeEndpoint(input.endpoint), source: \"flag\" };\n }\n\n if (envVars.AINECTO_MCP_ENDPOINT) {\n return { env, endpoint: normalizeEndpoint(envVars.AINECTO_MCP_ENDPOINT), source: \"env\" };\n }\n\n return { env, endpoint: DEFAULT_ENDPOINTS[env], source: \"default\" };\n}\n\nexport function normalizeEndpoint(endpoint: string): string {\n const url = new URL(endpoint);\n assertTrustedEndpointUrl(url, \"MCP endpoint\");\n url.hash = \"\";\n return url.toString().replace(/\\/$/, \"\");\n}\n\n/**\n * ★<b>이 env 의 기본 주소와 «정확히» 같은가.</b>\n *\n * <p>{@link isDefaultEndpoint} 는 prod·dev 를 둘 다 «기본»으로 보는 넓은 판정이라,\n * 「env=prod 인데 endpoint 만 dev」 같은 입력을 기본으로 착각한다. 그 판정으로 설정에서\n * {@code --endpoint} 를 빼면, 조회한 주소와 세션이 붙는 주소가 갈라진다\n * (2026-09-23 독립 재리뷰 I7).\n */\nexport function isDefaultEndpointFor(env: AinectoEnv, endpoint: string): boolean {\n return normalizeEndpoint(endpoint) === DEFAULT_ENDPOINTS[env];\n}\n\nexport function isDefaultEndpoint(endpoint: string): boolean {\n const normalized = normalizeEndpoint(endpoint);\n return Object.values(DEFAULT_ENDPOINTS).includes(normalized);\n}\n\nexport function assertTrustedEndpointUrl(value: string | URL, label = \"URL\"): void {\n const url = typeof value === \"string\" ? new URL(value) : value;\n if (url.protocol === \"https:\") {\n return;\n }\n if (url.protocol === \"http:\" && isLoopbackHostname(url.hostname)) {\n return;\n }\n throw new Error(`${label} must use https, except http is allowed for localhost loopback endpoints.`);\n}\n\nexport function assertLoopbackRedirectUrl(value: string): void {\n const url = new URL(value);\n if (url.protocol === \"http:\" && isLoopbackHostname(url.hostname)) {\n return;\n }\n throw new Error(\"OAuth redirect URI must be an http localhost loopback URL.\");\n}\n\nfunction isLoopbackHostname(hostname: string): boolean {\n return hostname === \"localhost\"\n || hostname === \"127.0.0.1\"\n || hostname === \"::1\"\n || hostname === \"[::1]\";\n}\n\nexport function assertEnv(value: string | undefined): AinectoEnv | undefined {\n if (value === undefined) {\n return undefined;\n }\n if (value === \"prod\" || value === \"dev\") {\n return value;\n }\n throw new Error(`Invalid --env value \"${value}\". Expected \"prod\" or \"dev\".`);\n}\n\n/**\n * 직무 프로필을 고치는 설정 화면 — ★이 MCP 서버와 같은 출처의 홈페이지 설정(기본 탭 = 계정).\n * 규칙은 웹 앱과 같다(ainecto-front {@code src/lib/homepage.ts} 의 {@code /home/settings}, 같은 출처 배포).\n */\nexport function profileSettingsUrl(endpoint: string): string {\n return `${new URL(endpoint).origin}/home/settings`;\n}\n","import { assertLoopbackRedirectUrl, assertTrustedEndpointUrl } from \"../config/endpoints\";\n\nexport interface ClientRegistrationResult {\n clientId: string;\n clientSecret?: string;\n}\n\nexport async function registerPublicClient(\n registrationEndpoint: string,\n redirectUri: string,\n fetchImpl: typeof fetch = fetch,\n): Promise<ClientRegistrationResult> {\n assertTrustedEndpointUrl(registrationEndpoint, \"OAuth client registration endpoint\");\n assertLoopbackRedirectUrl(redirectUri);\n const response = await fetchImpl(registrationEndpoint, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\", accept: \"application/json\" },\n body: JSON.stringify({\n client_name: \"AiNecto CLI\",\n redirect_uris: [redirectUri],\n token_endpoint_auth_method: \"none\",\n grant_types: [\"authorization_code\", \"refresh_token\"],\n response_types: [\"code\"],\n }),\n });\n if (!response.ok) {\n throw new Error(`OAuth client registration failed with HTTP ${response.status}.`);\n }\n const body = await response.json() as unknown;\n if (!isRecord(body) || typeof body.client_id !== \"string\") {\n throw new Error(\"OAuth client registration response did not include client_id.\");\n }\n return {\n clientId: body.client_id,\n clientSecret: typeof body.client_secret === \"string\" ? body.client_secret : undefined,\n };\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { readFile } from \"node:fs/promises\";\n\nexport interface PayloadSourceInput {\n file?: string;\n inline?: string;\n stdin?: NodeJS.ReadStream;\n stdinText?: string;\n stdinIsTTY?: boolean;\n}\n\nexport interface ParsedPayload {\n value: unknown;\n source: \"file\" | \"stdin\" | \"inline\" | \"empty\";\n warnings: string[];\n}\n\nexport async function parsePayloadSource(input: PayloadSourceInput): Promise<ParsedPayload> {\n const warnings: string[] = [];\n const stdinIsTTY = input.stdinIsTTY ?? input.stdin?.isTTY ?? true;\n const hasInline = input.inline !== undefined && input.inline !== \"\";\n const hasStdin = input.stdinText !== undefined || !stdinIsTTY;\n\n if (input.file) {\n if (hasInline || hasStdin) {\n warnings.push(\"Multiple payload sources were provided; --file takes precedence.\");\n }\n const text = await readFileOrStdin(input.file, input);\n return { value: parseJson(text), source: input.file === \"-\" || input.file === \"@-\" ? \"stdin\" : \"file\", warnings };\n }\n\n if (hasStdin) {\n if (hasInline) {\n warnings.push(\"Multiple payload sources were provided; stdin takes precedence.\");\n }\n const text = input.stdinText ?? await readAllStdin(input.stdin);\n if (!text.trim()) {\n return { value: {}, source: \"empty\", warnings };\n }\n return { value: parseJson(text), source: \"stdin\", warnings };\n }\n\n if (hasInline) {\n const inline = input.inline === \"@-\" ? await readAllStdin(input.stdin) : input.inline;\n return { value: parseJson(inline), source: \"inline\", warnings };\n }\n\n return { value: {}, source: \"empty\", warnings };\n}\n\nfunction parseJson(text: string | undefined): unknown {\n if (text === undefined || !text.trim()) {\n return {};\n }\n try {\n return JSON.parse(text);\n } catch (error) {\n const detail = error instanceof Error ? error.message : String(error);\n throw new Error(`Invalid JSON payload: ${detail}`);\n }\n}\n\nasync function readFileOrStdin(file: string, input: PayloadSourceInput): Promise<string> {\n if (file === \"-\" || file === \"@-\") {\n return input.stdinText ?? await readAllStdin(input.stdin);\n }\n return readFile(file, \"utf8\");\n}\n\nasync function readAllStdin(stdin: NodeJS.ReadStream | undefined): Promise<string> {\n if (!stdin) {\n return \"\";\n }\n stdin.setEncoding(\"utf8\");\n let text = \"\";\n for await (const chunk of stdin) {\n text += chunk;\n }\n return text;\n}\n","/**\n * 옛 세션 역할 입력 — ★0.8.0 에서 세션 역할(Design/Development/Test/Validation)이 없어졌다.\n * 도구 목록은 모든 세션이 같고, 무엇을 할 수 있는지는 서버가 사용자·리소스 권한으로만 정한다.\n *\n * <p>그래도 옛 입력은 «거절하지 않는다» — 0.7.x 의 {@code init} 이 쓴 저장소 설정\n * ({@code npx -y @ainecto/mcp --role design}, 버전 고정 없음)은 게시 즉시 이 판을 띄운다.\n * 여기서 {@code --role} 을 거절하면 그 저장소 전부의 연결이 끊긴다(설계 §2-3 R1).\n *\n * <p>받은 값은 «검사하지 않고» 두 군데에만 쓴다:\n * <ul>\n * <li>stderr 안내 한 줄({@link LEGACY_ROLE_NOTICE}) — 사람이 설정을 정리하게.</li>\n * <li>같은 헤더 {@link LEGACY_ROLE_HEADER} 로 서버에 실어 보냄 — 서버는 판정에 쓰지 않고\n * {@code [mcp][legacy-role]} 로 기록만 한다. 새 헤더를 만들지 않으려고 옛 이름을 재사용한다.</li>\n * </ul>\n * ★관찰 기간(설계 §7-2 ⑤) 뒤 기록이 0건이면 이 파일과 브리지의 {@code --role} 받기를 함께 지운다.\n */\n\n/** 서버가 기록용으로 읽는 헤더 — 서버 McpController 의 옛 역할 헤더와 같은 이름. */\nexport const LEGACY_ROLE_HEADER = \"X-AiNecto-Role\";\n\n/** 0.7.x 가 Codex 처럼 전역 설정뿐인 에이전트에 안내하던 환경변수. */\nexport const LEGACY_ROLE_ENV_VAR = \"AINECTO_ROLE\";\n\nexport const LEGACY_ROLE_NOTICE =\n \"AiNecto session roles were removed; access follows your AiNecto permissions. \"\n + \"Re-run `ainecto init` to tidy this repository.\";\n\n/**\n * 플래그(있으면) 아니면 {@link LEGACY_ROLE_ENV_VAR}. ★값을 검사하지 않는다 — 모르는 값도 받는다.\n * 빈 값은 «없음»이다.\n */\nexport function legacyRoleInput(flag: string | undefined, envVars: NodeJS.ProcessEnv = process.env): string | undefined {\n const value = flag ?? envVars[LEGACY_ROLE_ENV_VAR];\n return value !== undefined && value.trim() ? value.trim() : undefined;\n}\n","/**\n * CLI 버전. ★진실원은 {@code package.json} 이고 빌드(tsup define)가 그 값을 박는다 —\n * 상수로 또 적으면 릴리스 때 한쪽만 올라가 조용히 거짓이 된다.\n * 번들을 거치지 않는 실행(vitest·tsx)에서는 값이 없으므로 \"dev\" 로 떨어진다.\n */\ndeclare const __AINECTO_CLI_VERSION__: string | undefined;\n\n/** 번들을 거치지 않은 실행의 판 표시. */\nconst UNBUNDLED_VERSION = \"dev\";\n\nexport const CLI_VERSION: string =\n typeof __AINECTO_CLI_VERSION__ === \"string\" ? __AINECTO_CLI_VERSION__ : UNBUNDLED_VERSION;\n\n/**\n * npm 주 이름. ★이 이름을 박는 곳은 여기 하나다 — init·setup 이 쓰는 {@code npx -y <이름>@<판>},\n * MCP {@code clientInfo}, User-Agent, init 기록의 {@code generatedBy} 가 모두 이것을 쓴다.\n * {@code package.json} 의 name·{@code server.json} 의 패키지 식별자와 같아야 한다(시험이 대조한다).\n *\n * <p>다른 이름 {@code ainecto}·{@code @ainecto/cli} 에도 같은 코드가 올라가지만(scripts/publish.mjs),\n * 그 판으로 init 해도 이 이름을 쓴다.\n */\nexport const PACKAGE_NAME = \"@ainecto/mcp\";\n\nexport const CLI_USER_AGENT = `${PACKAGE_NAME} ${CLI_VERSION}`;\n\n/**\n * MCP 설정에 쓰는 브리지 패키지 지정 — ★이 CLI 판으로 «고정»한다(설계 결정 #6·D8). 고정하지 않으면\n * 게시 즉시 모든 저장소의 브리지가 새 판으로 바뀐다(0.7.x 의 --role 설정이 그랬다). 올리는 길은\n * {@code setup}/{@code init} 재실행이다. 판을 모르는 실행(vitest·tsx)에서는 고정하지 않는다 —\n * {@code @dev} 는 npm 에서 판이 아니라 배포 태그로 읽힌다.\n */\nexport function bridgePackageSpec(version: string = CLI_VERSION): string {\n return version === UNBUNDLED_VERSION ? PACKAGE_NAME : `${PACKAGE_NAME}@${version}`;\n}\n","import type { TokenProvider } from \"../auth/oauth\";\nimport { LEGACY_ROLE_HEADER } from \"../harness/legacyRole\";\nimport { CLI_VERSION, PACKAGE_NAME } from \"../version\";\n\nexport interface JsonRpcRequest {\n jsonrpc: \"2.0\";\n id?: string | number | null;\n method: string;\n params?: unknown;\n}\n\nexport interface JsonRpcSuccess {\n jsonrpc: \"2.0\";\n id?: string | number | null;\n result: unknown;\n}\n\nexport interface JsonRpcFailure {\n jsonrpc: \"2.0\";\n id?: string | number | null;\n error: {\n code: number;\n message: string;\n data?: unknown;\n };\n}\n\nexport type JsonRpcResponse = JsonRpcSuccess | JsonRpcFailure;\n\n/**\n * 분석용 요청 헤더(GA4 서버 계측 C23). 서버의 ExecutionChannel.HEADER · AgentTypeResolver.HEADER 와 같아야 한다.\n * 서버는 /mcp 필터에서 한 번만 읽고, 모르는 값이면 요청을 막지 않는다(분석 값일 뿐이다).\n */\nexport const CHANNEL_HEADER = \"X-AiNecto-Channel\";\nexport const AGENT_HEADER = \"X-AiNecto-Agent\";\n/** 서버 AgentTypeResolver.MAX_NAME_LENGTH 와 같다. */\nexport const MAX_AGENT_NAME_LENGTH = 100;\n\n/** 이 클라이언트가 서버에 밝히는 길 — 직접 명령(`ainecto tools call …`) = cli, 에이전트의 MCP 브리지 = mcp. */\nexport type ExecutionChannel = \"cli\" | \"mcp\";\n\nexport interface McpRpcClientOptions {\n endpoint: string;\n tokenProvider?: TokenProvider;\n fetchImpl?: typeof fetch;\n envVars?: NodeJS.ProcessEnv;\n /**\n * 옛 {@code --role}/{@code AINECTO_ROLE} 값 — ★기록용이다(legacyRole.ts). 있으면 모든 요청의\n * {@code X-AiNecto-Role} 헤더로 실리고, 서버는 판정에 쓰지 않고 로그로만 남긴다.\n */\n legacyRole?: string;\n /**\n * 요청의 길. ★필수다 — 빠뜨리면 서버가 직접 명령을 MCP 로 센다. 그 빠뜨림을 타입이 잡는다.\n * 모든 요청의 {@code X-AiNecto-Channel} 헤더로 실린다.\n */\n channel: ExecutionChannel;\n}\n\nexport class McpRpcError extends Error {\n constructor(\n message: string,\n readonly code: string,\n readonly details?: unknown,\n ) {\n super(message);\n }\n}\n\nexport class McpRpcClient {\n private readonly fetchImpl: typeof fetch;\n private nextId = 1;\n private agent: string | undefined;\n\n constructor(private readonly options: McpRpcClientOptions) {\n this.fetchImpl = options.fetchImpl ?? fetch;\n }\n\n /**\n * 브리지 전용 — 호스트 에이전트가 보낸 {@code initialize} 의 {@code clientInfo.name}(프로그램 고정 이름).\n * 이후 모든 요청의 {@code X-AiNecto-Agent} 헤더로 싣는다. 직접 명령은 부르지 않는다(누가 셸을 돌렸는지 모른다).\n */\n useAgent(clientName: unknown): void {\n this.agent = agentHeaderValue(clientName);\n }\n\n initialize(): Promise<unknown> {\n return this.request(\"initialize\", {\n protocolVersion: \"2024-11-05\",\n capabilities: {},\n clientInfo: { name: PACKAGE_NAME, version: CLI_VERSION },\n });\n }\n\n async toolsList(): Promise<unknown[]> {\n const result = await this.request(\"tools/list\", {});\n if (!isRecord(result) || !Array.isArray(result.tools)) {\n throw new McpRpcError(\"tools/list response did not include a tools array.\", \"MCP_PROTOCOL_ERROR\", result);\n }\n return result.tools;\n }\n\n async toolsCall(name: string, args: unknown): Promise<unknown> {\n return this.request(\"tools/call\", { name, arguments: args ?? {} });\n }\n\n async request(method: string, params?: unknown): Promise<unknown> {\n const response = await this.sendRaw({\n jsonrpc: \"2.0\",\n id: this.nextId++,\n method,\n params,\n });\n if (!response) {\n return undefined;\n }\n if (\"error\" in response) {\n throw new McpRpcError(response.error.message, \"MCP_ERROR\", response.error);\n }\n return response.result;\n }\n\n async sendRaw(request: JsonRpcRequest): Promise<JsonRpcResponse | undefined> {\n const token = await this.options.tokenProvider?.getAccessToken();\n let response = await this.postJson(request, token);\n if (response.status === 401 && this.options.tokenProvider) {\n const refreshed = await this.options.tokenProvider.refreshAfterUnauthorized();\n if (refreshed) {\n response = await this.postJson(request, refreshed);\n }\n }\n\n if (response.status === 204 || response.status === 202) {\n return undefined;\n }\n const text = await response.text();\n if (!response.ok) {\n throw new McpRpcError(\n `MCP HTTP request failed with HTTP ${response.status}.`,\n \"MCP_HTTP_ERROR\",\n httpErrorDetails(response.status, text, this.options.envVars ?? process.env),\n );\n }\n if (!text.trim()) {\n return undefined;\n }\n const parsed = JSON.parse(text) as unknown;\n if (!isJsonRpcResponse(parsed)) {\n throw new McpRpcError(\"MCP response was not a JSON-RPC response.\", \"MCP_PROTOCOL_ERROR\", parsed);\n }\n return parsed;\n }\n\n private postJson(request: JsonRpcRequest, token: string | undefined): Promise<Response> {\n const headers: Record<string, string> = {\n \"content-type\": \"application/json\",\n accept: \"application/json\",\n };\n if (token) {\n headers.authorization = `Bearer ${token}`;\n }\n const legacyRole = printableHeaderValue(this.options.legacyRole);\n if (legacyRole) {\n headers[LEGACY_ROLE_HEADER.toLowerCase()] = legacyRole;\n }\n headers[CHANNEL_HEADER.toLowerCase()] = this.options.channel;\n if (this.agent) {\n headers[AGENT_HEADER.toLowerCase()] = this.agent;\n }\n return this.fetchImpl(this.options.endpoint, {\n method: \"POST\",\n headers,\n body: JSON.stringify(request),\n });\n }\n}\n\n/**\n * ★MCP 는 «도구가 거부/실패했다»를 JSON-RPC error 가 아니라 결과 안의 {@code isError} 로\n * 알린다(2025-06-18 규격). 그래서 최상위 error 만 보면 실패가 성공으로 보고된다 —\n * 셸 자동화는 exit 0 을 받고 다음 단계로 간다(2026-09-22 독립 리뷰 I9).\n */\nexport function isToolError(result: unknown): boolean {\n return isRecord(result) && result.isError === true;\n}\n\n/**\n * 헤더에 실을 수 있는 이름 — 인쇄 가능한 ASCII 만(그 밖의 글자는 fetch 가 헤더로 거절한다), 앞뒤 공백 제거,\n * 최대 {@link MAX_AGENT_NAME_LENGTH}자. 남는 것이 없으면 싣지 않는다(서버는 unknown 으로 센다).\n */\nexport function agentHeaderValue(clientName: unknown): string | undefined {\n return printableHeaderValue(clientName);\n}\n\n/** 헤더에 실을 수 있는 모양으로 — 규칙은 {@link agentHeaderValue} 와 같다(이 파일의 헤더 값은 전부 이 길을 지난다). */\nfunction printableHeaderValue(value: unknown): string | undefined {\n if (typeof value !== \"string\") {\n return undefined;\n }\n const printable = value.replace(/[^\\x20-\\x7E]/g, \"\").trim().slice(0, MAX_AGENT_NAME_LENGTH).trim();\n return printable || undefined;\n}\n\nfunction isJsonRpcResponse(value: unknown): value is JsonRpcResponse {\n return isRecord(value)\n && value.jsonrpc === \"2.0\"\n && (\"result\" in value || \"error\" in value);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction httpErrorDetails(status: number, body: string, envVars: NodeJS.ProcessEnv): Record<string, unknown> {\n const details: Record<string, unknown> = { status };\n if (envVars.AINECTO_CLI_DEBUG === \"1\" || envVars.AINECTO_DEBUG === \"1\") {\n details.body = safeBodyPreview(body);\n }\n return details;\n}\n\nexport function safeBodyPreview(body: string): string {\n return body.length > 500 ? `${body.slice(0, 500)}...` : body;\n}\n","export interface CliErrorShape {\n ok: false;\n error: {\n code: string;\n message: string;\n details?: unknown;\n };\n}\n\nexport interface CliSuccessShape {\n ok: true;\n data: unknown;\n warnings?: string[];\n}\n\nexport function renderSuccess(data: unknown, options: { json?: boolean; warnings?: string[] } = {}): string {\n if (options.json) {\n const shape: CliSuccessShape = { ok: true, data };\n if (options.warnings?.length) {\n shape.warnings = options.warnings;\n }\n return `${JSON.stringify(shape, null, 2)}\\n`;\n }\n const warnings = options.warnings?.length ? `${options.warnings.map((warning) => `Warning: ${warning}`).join(\"\\n\")}\\n` : \"\";\n return `${warnings}${renderHuman(data)}\\n`;\n}\n\nexport function renderError(error: unknown, options: { json?: boolean } = {}): string {\n const shape = toErrorShape(error);\n if (options.json) {\n return `${JSON.stringify(shape, null, 2)}\\n`;\n }\n return `Error: ${shape.error.message}\\n`;\n}\n\nexport function toErrorShape(error: unknown): CliErrorShape {\n if (error instanceof Error) {\n const maybe = error as Error & { code?: string; details?: unknown };\n return {\n ok: false,\n error: {\n code: maybe.code ?? \"CLI_ERROR\",\n message: error.message,\n details: redactSecrets(maybe.details),\n },\n };\n }\n return { ok: false, error: { code: \"CLI_ERROR\", message: String(error) } };\n}\n\nexport function redactSecrets(value: unknown): unknown {\n return redactSecretsInner(value, new WeakSet<object>());\n}\n\nfunction renderHuman(data: unknown): string {\n if (Array.isArray(data)) {\n return data.map((item) => renderHuman(item)).join(\"\\n\");\n }\n if (typeof data === \"string\") {\n return data;\n }\n return JSON.stringify(data, null, 2);\n}\n\nfunction redactSecretsInner(value: unknown, seen: WeakSet<object>): unknown {\n if (typeof value === \"string\") {\n return redactSecretString(value);\n }\n if (Array.isArray(value)) {\n return value.map((item) => redactSecretsInner(item, seen));\n }\n if (value && typeof value === \"object\") {\n if (seen.has(value)) {\n return \"[circular]\";\n }\n seen.add(value);\n const output: Record<string, unknown> = {};\n for (const [key, child] of Object.entries(value)) {\n output[key] = isSecretKey(key) ? \"[redacted]\" : redactSecretsInner(child, seen);\n }\n return output;\n }\n return value;\n}\n\nfunction isSecretKey(key: string): boolean {\n const normalized = key.toLowerCase().replace(/-/g, \"_\");\n return normalized === \"authorization\"\n || normalized.includes(\"access_token\")\n || normalized.includes(\"refresh_token\")\n || normalized.includes(\"client_secret\")\n || normalized.includes(\"token\");\n}\n\nfunction redactSecretString(value: string): string {\n return value\n .replace(/(\"(?:authorization|access_token|refresh_token|client_secret|token)\"\\s*:\\s*\")([^\"]*)(\")/gi, \"$1[redacted]$3\")\n .replace(/((?:authorization|access_token|refresh_token|client_secret|token)=)([^&\\s\"']+)/gi, \"$1[redacted]\")\n .replace(/(authorization:\\s*bearer\\s+)([^\\s,}]+)/gi, \"$1[redacted]\")\n .replace(/(bearer\\s+)(eyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+)/gi, \"$1[redacted]\");\n}\n","import type { GeneratedToolDefinition } from \"./types\";\n\nexport const generatedTools = [\n {\"mcpName\":\"create_comments\",\"commandPath\":[\"comments\",\"create\"],\"group\":\"generic\",\"description\":\"Add comments, questions, or replies to a document or a kanban card (cardUuid). Anyone who can read it may comment and reply. Set parentCommentId to reply to a top-level comment. To mention people, get their userId and displayName from list_mention_candidates, write @<displayName> in the body, and list their userIds in mentionUserIds (clientMutationId is then required). Items are applied in order and each one commits on its own; results report each item (ok, or status and error).\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"},\"items\":{\"description\":\"Comments to add, applied in order\",\"items\":{\"additionalProperties\":false,\"properties\":{\"body\":{\"description\":\"Comment text (plain text, 1..10000 characters). To mention someone, include @<displayName> exactly as returned by mcp__ainecto__list_mention_candidates.\",\"maxLength\":10000,\"minLength\":1,\"type\":\"string\"},\"clientMutationId\":{\"description\":\"Idempotency key (visible ASCII, at most 128 characters). Required when mentionUserIds is not empty; reuse the same value when retrying the same item so the mention email is not sent twice.\",\"maxLength\":128,\"type\":\"string\"},\"kind\":{\"description\":\"COMMENT (default) or QUESTION. A reply (parentCommentId) is always COMMENT. A QUESTION can later be resolved with mcp__ainecto__resolve_comments.\",\"enum\":[\"COMMENT\",\"QUESTION\"],\"type\":\"string\"},\"mentionUserIds\":{\"description\":\"userIds to mention (from mcp__ainecto__list_mention_candidates). Each one's @<displayName> must appear in body; newly mentioned people get a notification email.\",\"items\":{\"type\":\"string\"},\"maxItems\":20,\"type\":\"array\",\"uniqueItems\":true},\"parentCommentId\":{\"description\":\"Reply to this top-level comment id (from mcp__ainecto__list_comments). Replies are one level deep: replying to a reply is rejected. The thread's original author and earlier repliers get a notification email (except people mentioned in this reply, who get the mention email instead).\",\"minimum\":1,\"type\":\"integer\"}},\"required\":[\"body\"],\"type\":\"object\"},\"minItems\":1,\"type\":\"array\"},\"mailLanguage\":{\"description\":\"Language of the comment notification email (mention or reply). Defaults to en.\",\"enum\":[\"en\",\"ko\"],\"type\":\"string\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"05ae6b9016969e09\"},\n {\"mcpName\":\"create_documents\",\"commandPath\":[\"documents\",\"create\"],\"group\":\"document\",\"description\":\"Create documents. projectUuid comes from list_projects (a workspace UUID is not a project UUID). Set shareEnabled to also turn on each document's public link and get its shareUrl in the same call. If a document body is tens of KB or more, prefer request_upload_token (purpose=document.create) and upload the body with curl.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Documents\",\"items\":{\"properties\":{\"body\":{\"description\":\"Deprecated compatibility alias for typePayload.body when document type is markdown. 본문이 수십 KB 이상으로 크면 LLM 토큰 절약을 위해 `request_upload_token (purpose=document.create)` 를 호출해 uploadUrl 을 받고 curl 로 직접 PUT 으로 보낼 것.\",\"type\":\"string\"},\"folderUuid\":{\"description\":\"Optional folder UUID\",\"type\":\"string\"},\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"},\"shareEnabled\":{\"description\":\"Optional. true turns on the document's public link right after creating it, exactly as enable_shares does (needs the right to manage sharing; types without a public page are refused). The created item then carries shareUrl, the page anyone can open. If sharing is refused, this item is not created.\",\"type\":\"boolean\"},\"title\":{\"description\":\"Document title\",\"type\":\"string\"},\"type\":{\"description\":\"Document type. Creatable values: erd, markdown, diagram, openapi, html, file, kanban.\",\"enum\":[\"erd\",\"markdown\",\"diagram\",\"openapi\",\"html\",\"file\",\"kanban\"],\"type\":\"string\"},\"typePayload\":{\"description\":\"Type-specific payload for enabled document types. markdown: {body}; diagram: {diagramSource,sourceLanguage,edgeStyle,isModule,metadata}; openapi: {content}; html: {content} (a full HTML page); file: no JSON payload — bytes go through request_upload_token(purpose=document.create, scopeJson={projectUuid,folderUuid?,type:\\\"file\\\",title,filename}) then one curl PUT (images·PDF·mp4/webm·audio·text/code·CSV only); kanban: no payload — creates an empty board; add cards with kanban_apply_changes.\",\"type\":\"object\"}},\"required\":[\"projectUuid\",\"type\",\"title\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"017e1b09ef246ff9\"},\n {\"mcpName\":\"create_folders\",\"commandPath\":[\"folders\",\"create\"],\"group\":\"generic\",\"description\":\"Create folders in a project, at its top level or under parentFolderUuid (the parent must be in the same project). Folders nest up to 50 levels. Folder names do not have to be unique, even side by side, and every call creates new folders — check list_folders first so a retry does not make duplicates. Needs edit access to the project (and to the parent folder). Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns created (folder rows with uuid and app url) and count. Fails with 404, 403, or 409 when the project, its workspace or the parent folder is archived.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Folders\",\"items\":{\"properties\":{\"name\":{\"description\":\"Folder name\",\"type\":\"string\"},\"parentFolderUuid\":{\"description\":\"Parent folder UUID\",\"type\":\"string\"},\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"projectUuid\",\"name\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"0465182c723f2c9a\"},\n {\"mcpName\":\"create_projects\",\"commandPath\":[\"projects\",\"create\"],\"group\":\"generic\",\"description\":\"Create new, empty projects. workspaceUuid picks the workspace (you need edit access there); without it the project goes to your first personal workspace, which is created if you have none. projectKey is optional and must be unique within the workspace; project names do not have to be unique. Every call creates new projects, so check list_projects before retrying. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns created (project rows with uuid) and count. Fails with 403 without edit access, 409 when the workspace is archived, and an error when the projectKey is already used.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Projects\",\"items\":{\"properties\":{\"description\":{\"description\":\"Description\",\"type\":\"string\"},\"name\":{\"description\":\"Project name\",\"type\":\"string\"},\"projectKey\":{\"description\":\"Unique project key\",\"type\":\"string\"},\"workspaceUuid\":{\"description\":\"Workspace UUID — null uses user's default workspace\",\"type\":\"string\"}},\"required\":[\"name\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"020ed340ec243bdc\"},\n {\"mcpName\":\"create_workspaces\",\"commandPath\":[\"workspaces\",\"create\"],\"group\":\"workspace\",\"description\":\"Create new, empty personal workspaces owned by you (there is no limit on how many). Names do not have to be unique and every call creates new ones, so check list_workspaces before retrying. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns created (workspace rows with uuid) and count.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Workspaces\",\"items\":{\"properties\":{\"description\":{\"description\":\"Description\",\"type\":\"string\"},\"name\":{\"description\":\"Workspace name\",\"type\":\"string\"}},\"required\":[\"name\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"51d1cb14c1d99f9d\"},\n {\"mcpName\":\"delete_attachments\",\"commandPath\":[\"attachments\",\"delete\"],\"group\":\"attachment\",\"description\":\"Remove attachments. A removed attachment is hidden (archived) and no longer listed, and no tool brings it back — confirm with the user first. The file that is a file document's own content cannot be removed here; delete that document instead. Needs edit access to the document (or project) it is attached to. All-or-nothing: if any UUID fails (404 unknown, 403 no edit access, 409 already removed or file-document content), nothing is removed. Sends no email or inbox notification. Returns deleted (UUIDs) and count.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Attachment UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"6d88c71830e7e20d\"},\n {\"mcpName\":\"delete_comments\",\"commandPath\":[\"comments\",\"delete\"],\"group\":\"generic\",\"description\":\"Delete your own comments on a document or a kanban card (cardUuid). Only the author can delete. A resolved question and a top-level comment that still has replies cannot be deleted. Each id is applied on its own; results report each id.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"},\"ids\":{\"description\":\"Comment ids to delete (from mcp__ainecto__list_comments)\",\"items\":{\"minimum\":1,\"type\":\"integer\"},\"minItems\":1,\"type\":\"array\"}},\"required\":[\"ids\"],\"type\":\"object\"},\"required\":[\"ids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"082e4b4d9ba97fe0\"},\n {\"mcpName\":\"delete_documents\",\"commandPath\":[\"documents\",\"delete\"],\"group\":\"document\",\"description\":\"Move documents to the trash (soft delete) — this is not permanent deletion. A trashed document disappears from lists and its public link stops opening; people it was shared with directly lose that access, and restoring does not give it back. unarchive_documents restores a document and list_trash shows the trash. The server permanently deletes a trashed document once the trash retention period passes (30 days by default), and that cannot be undone. Needs delete rights on each document (editor or above). Confirm with the user before deleting anything they did not name explicitly. Targets are UUIDs only; names are never matched and may repeat. Look the UUID up first, and when more than one candidate fits what the user said, ask which one. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns deleted (UUIDs) and count. Fails with 404 for an unknown UUID, 403 without delete rights, and 409 when the document is already in the trash or its folder, project or workspace is archived.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Document UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"02aed6d05f52c25e\"},\n {\"mcpName\":\"delete_folders\",\"commandPath\":[\"folders\",\"delete\"],\"group\":\"generic\",\"description\":\"Move folders to the trash together with everything under them (subfolders and their documents) — soft delete, not permanent. People shared with the folder, its subfolders or those documents directly lose that access, and restoring does not give it back. unarchive_folders restores the whole subtree; the server permanently deletes trashed folders and documents once the trash retention period passes (30 days by default). Needs admin or owner rights on the folder. Always confirm with the user first and say how much is inside (list_documents with folderUuid). Targets are UUIDs only; names are never matched and may repeat. Look the UUID up first, and when more than one candidate fits what the user said, ask which one. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns deleted (UUIDs) and count. Fails with 404 for an unknown UUID, 403 without rights, and 409 when the folder or a parent folder is already archived.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Folder UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"80852f7e86a2d964\"},\n {\"mcpName\":\"delete_projects\",\"commandPath\":[\"projects\",\"delete\"],\"group\":\"generic\",\"description\":\"Archive projects. An archived project disappears from list_projects and nothing inside it can be read or edited; its documents are not moved to the trash and nothing is purged automatically. Archiving also removes every person's direct sharing on the project, its folders and its documents, and restoring does not give it back. Public links of documents inside stop opening while the project is archived. unarchive_projects is the matching restore tool. Needs admin or owner rights on the project. Always confirm with the user first (get_project shows the name and workspace). Targets are UUIDs only; names are never matched and may repeat. Look the UUID up first, and when more than one candidate fits what the user said, ask which one. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns deleted (UUIDs) and count. Fails with 404 for an unknown UUID, 403 without rights or when it is already archived, and 409 when its workspace is archived.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Project UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"32e582d68b72ab38\"},\n {\"mcpName\":\"delete_workspaces\",\"commandPath\":[\"workspaces\",\"delete\"],\"group\":\"workspace\",\"description\":\"Archive workspaces. An archived workspace disappears from list_workspaces, its projects disappear from list_projects, and nothing inside can be read or changed until it is restored with unarchive_workspaces. Nothing is purged and sharing is kept. Only the workspace owner can do this. Always confirm with the user first — it hides every project in the workspace for everyone. Targets are UUIDs only; names are never matched and may repeat. Look the UUID up first, and when more than one candidate fits what the user said, ask which one. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns deleted (UUIDs) and count. Fails with 404 for an unknown UUID and 403 when you are not the owner or it is already archived.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Workspace UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"e6ef72eaa0a1808b\"},\n {\"mcpName\":\"diagram_apply_changes\",\"commandPath\":[\"tools\",\"run\",\"diagram-apply-changes\"],\"group\":\"generic\",\"description\":\"Required single-call mutation path for diagram node/edge/group create/update/delete changes. Put nodes, edges, and groups in one request and call this once. Do not look for type-specific diagram CUD tools; this tool is the only diagram CUD entry point.\",\"inputSchema\":{\"properties\":{\"description\":{\"description\":\"Reason for batch (audit)\",\"type\":\"string\"},\"diagramUuid\":{\"description\":\"Diagram UUID\",\"type\":\"string\"},\"edges\":{\"description\":\"Edge operations\",\"items\":{\"properties\":{\"action\":{\"description\":\"Operation kind\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"bridgeType\":{\"description\":\"Omit (null) for a plain node-to-node edge. Set only when a group is an endpoint: GROUP_TO_GROUP|NODE_TO_GROUP|GROUP_TO_NODE\",\"enum\":[\"GROUP_TO_GROUP\",\"NODE_TO_GROUP\",\"GROUP_TO_NODE\"],\"type\":\"string\"},\"fromUuid\":{\"description\":\"Source\",\"type\":\"string\"},\"label\":{\"description\":\"Edge label\",\"type\":\"string\"},\"lineStyle\":{\"description\":\"Line style\",\"type\":\"string\"},\"strokeColor\":{\"description\":\"Stroke color\",\"type\":\"string\"},\"strokeWidth\":{\"description\":\"Stroke width\",\"type\":\"integer\"},\"toUuid\":{\"description\":\"Target\",\"type\":\"string\"},\"uuid\":{\"description\":\"Required for update/delete\",\"type\":\"string\"}},\"required\":[\"action\"],\"type\":\"object\"},\"type\":\"array\"},\"groups\":{\"description\":\"Group operations\",\"items\":{\"properties\":{\"action\":{\"description\":\"Operation kind\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"collapsed\":{\"description\":\"Collapsed state\",\"type\":\"boolean\"},\"color\":{\"description\":\"Group color\",\"type\":\"string\"},\"height\":{\"description\":\"Explicit height; omit to keep it derived from member nodes\",\"type\":\"number\"},\"linkMode\":{\"description\":\"Link mode\",\"type\":\"string\"},\"linkedDiagramUuid\":{\"description\":\"Linked diagram UUID\",\"type\":\"string\"},\"name\":{\"description\":\"Group name\",\"type\":\"string\"},\"parentGroupUuid\":{\"description\":\"Parent group UUID\",\"type\":\"string\"},\"sortOrder\":{\"description\":\"Sort order\",\"type\":\"integer\"},\"uuid\":{\"description\":\"Required for update/delete\",\"type\":\"string\"},\"width\":{\"description\":\"Explicit width; omit to keep it derived from member nodes\",\"type\":\"number\"}},\"required\":[\"action\"],\"type\":\"object\"},\"type\":\"array\"},\"nodes\":{\"description\":\"Node operations\",\"items\":{\"properties\":{\"action\":{\"description\":\"Operation kind\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"fillColor\":{\"description\":\"Fill color\",\"type\":\"string\"},\"groupUuid\":{\"description\":\"Group UUID; empty string clears membership\",\"type\":\"string\"},\"height\":{\"description\":\"Height\",\"type\":\"number\"},\"shape\":{\"description\":\"Node shape (start/end/diamond/cylinder/parallelogram/stadium/hexagon/rect/roundRect/...)\",\"enum\":[\"rect\",\"roundRect\",\"stadium\",\"diamond\",\"decision\",\"circle\",\"start\",\"doubleCircle\",\"end\",\"hexagon\",\"cylinder\",\"parallelogram\"],\"type\":\"string\"},\"strokeColor\":{\"description\":\"Stroke color\",\"type\":\"string\"},\"text\":{\"description\":\"Node text/label. Supports newlines (\\\\n) for multi-line display.\",\"maxLength\":4000,\"type\":\"string\"},\"textColor\":{\"description\":\"Text color\",\"type\":\"string\"},\"type\":{\"description\":\"Node type\",\"type\":\"string\"},\"uuid\":{\"description\":\"Required for update/delete; optional for create\",\"type\":\"string\"},\"width\":{\"description\":\"Width\",\"type\":\"number\"},\"x\":{\"description\":\"X\",\"type\":\"number\"},\"y\":{\"description\":\"Y\",\"type\":\"number\"}},\"required\":[\"action\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"diagramUuid\",\"description\"],\"type\":\"object\"},\"required\":[\"description\",\"diagramUuid\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"2c829103f86f4168\"},\n {\"mcpName\":\"diagram_get_edge\",\"commandPath\":[\"tools\",\"run\",\"diagram-get-edge\"],\"group\":\"generic\",\"description\":\"Read one diagram edge by its edge UUID (same fields as diagram_list_edges). Read only; needs read access to the diagram. Fails with 404 for an unknown edge.\",\"inputSchema\":{\"properties\":{\"edgeUuid\":{\"description\":\"Edge UUID\",\"type\":\"string\"}},\"required\":[\"edgeUuid\"],\"type\":\"object\"},\"required\":[\"edgeUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"4bb0bb9275b2fb08\"},\n {\"mcpName\":\"diagram_get_group\",\"commandPath\":[\"tools\",\"run\",\"diagram-get-group\"],\"group\":\"generic\",\"description\":\"Read one diagram group by its group UUID (same fields as diagram_list_groups). Read only; needs read access to the diagram. Fails with 404 for an unknown group.\",\"inputSchema\":{\"properties\":{\"groupUuid\":{\"description\":\"Group UUID\",\"type\":\"string\"}},\"required\":[\"groupUuid\"],\"type\":\"object\"},\"required\":[\"groupUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"e43aade91f62acd4\"},\n {\"mcpName\":\"diagram_get_node\",\"commandPath\":[\"tools\",\"run\",\"diagram-get-node\"],\"group\":\"generic\",\"description\":\"Read one diagram node by its node UUID (same fields as diagram_list_nodes). Read only; needs read access to the diagram. Fails with 404 for an unknown node.\",\"inputSchema\":{\"properties\":{\"nodeUuid\":{\"description\":\"Node UUID\",\"type\":\"string\"}},\"required\":[\"nodeUuid\"],\"type\":\"object\"},\"required\":[\"nodeUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"e610b158272290f0\"},\n {\"mcpName\":\"diagram_get_pending_llm_requests\",\"commandPath\":[\"tools\",\"run\",\"diagram-get-pending-llm-requests\"],\"group\":\"generic\",\"description\":\"List your own AI requests that are waiting (PENDING) or in progress (PROCESSING), for every service, not only diagrams: uuid, serviceCode, type, status, model and context. Read only — it does not claim anything; a request becomes PROCESSING only when a worker claims it through AiNecto's AI request API. Returns requests and count.\",\"inputSchema\":{\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"43305e4eee4eedc3\"},\n {\"mcpName\":\"diagram_list_edges\",\"commandPath\":[\"tools\",\"run\",\"diagram-list-edges\"],\"group\":\"generic\",\"description\":\"List every edge (connector) of one diagram document: uuid, fromUuid, toUuid, label, bridgeType, strokeColor, lineStyle, strokeWidth and version. Read only; needs read access to the diagram. Fails when diagramUuid is not a diagram document. Returns edges and count.\",\"inputSchema\":{\"properties\":{\"diagramUuid\":{\"description\":\"Diagram document UUID\",\"type\":\"string\"}},\"required\":[\"diagramUuid\"],\"type\":\"object\"},\"required\":[\"diagramUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"05a4ad6a05240c7d\"},\n {\"mcpName\":\"diagram_list_groups\",\"commandPath\":[\"tools\",\"run\",\"diagram-list-groups\"],\"group\":\"generic\",\"description\":\"List every group of one diagram document: uuid, name, color, width, height, parentGroupUuid, collapsed, depth, sortOrder, linkedDiagramUuid, linkMode and version. Nodes point to their group with groupUuid. Read only; needs read access to the diagram. Fails when diagramUuid is not a diagram document. Returns groups and count.\",\"inputSchema\":{\"properties\":{\"diagramUuid\":{\"description\":\"Diagram document UUID\",\"type\":\"string\"}},\"required\":[\"diagramUuid\"],\"type\":\"object\"},\"required\":[\"diagramUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"6b48ae81e69d19d0\"},\n {\"mcpName\":\"diagram_list_nodes\",\"commandPath\":[\"tools\",\"run\",\"diagram-list-nodes\"],\"group\":\"generic\",\"description\":\"List every node of one diagram document: uuid, type, text, shape, x, y, width, height, groupUuid, colors and version. diagram_apply_changes changes them. Read only; needs read access to the diagram. Fails when diagramUuid is not a diagram document. Returns nodes and count.\",\"inputSchema\":{\"properties\":{\"diagramUuid\":{\"description\":\"Diagram document UUID\",\"type\":\"string\"}},\"required\":[\"diagramUuid\"],\"type\":\"object\"},\"required\":[\"diagramUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"82df9dd409bbd9fd\"},\n {\"mcpName\":\"diagram_submit_llm_result\",\"commandPath\":[\"tools\",\"run\",\"diagram-submit-llm-result\"],\"group\":\"generic\",\"description\":\"Complete one of your AI requests that is PROCESSING by storing its result text and token counts; it becomes COMPLETED. This charges AI credits, calculated by the server from the token counts (creditsCharged is ignored). It only stores the result and does not change any diagram by itself. Fails for a request that is not yours, is not PROCESSING, or whose context names a diagram you cannot edit. Returns uuid, status and the recorded token counts.\",\"inputSchema\":{\"properties\":{\"cachedInputTokens\":{\"description\":\"Cached subset of provider total input tokens\",\"type\":\"integer\"},\"creditsCharged\":{\"description\":\"Deprecated; ignored. Credits are calculated server-side from tokens.\",\"type\":\"integer\"},\"inputTokens\":{\"description\":\"Provider total input tokens; Java persists uncached input after one normalization\",\"type\":\"integer\"},\"outputTokens\":{\"description\":\"Output token count\",\"type\":\"integer\"},\"result\":{\"description\":\"LLM result text\",\"type\":\"string\"},\"uuid\":{\"description\":\"LLM request UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"result\"],\"type\":\"object\"},\"required\":[\"result\",\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"9ee175de7c7b7c4b\"},\n {\"mcpName\":\"diagram_update_llm_request_status\",\"commandPath\":[\"tools\",\"run\",\"diagram-update-llm-request-status\"],\"group\":\"generic\",\"description\":\"Mark one of your AI requests FAILED (the only status allowed here), with an optional errorMessage. Works on PENDING or PROCESSING requests and charges no credits; diagram_submit_llm_result completes one instead. Fails for a request that is not yours, is already finished, or whose context names a diagram you cannot edit. Returns uuid, status and errorMessage.\",\"inputSchema\":{\"properties\":{\"errorMessage\":{\"description\":\"Error message (when status=FAILED)\",\"type\":\"string\"},\"status\":{\"description\":\"Target status — currently only FAILED is mutable from caller side\",\"enum\":[\"FAILED\"],\"type\":\"string\"},\"uuid\":{\"description\":\"LLM request UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"status\"],\"type\":\"object\"},\"required\":[\"status\",\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"4a360af781099e35\"},\n {\"mcpName\":\"disable_shares\",\"commandPath\":[\"tools\",\"run\",\"disable-shares\"],\"group\":\"generic\",\"description\":\"Turn public links off. For a document or project the link stops working at once and turning it on again later brings back the same link; for a folder the stored token is deleted. Sharing with specific people is not affected. Needs the same rights as enable_shares (document or project: admin or owner; folder: edit access). Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns disabled (rows) and count.\",\"inputSchema\":{\"properties\":{\"targetType\":{\"description\":\"Share target type\",\"enum\":[\"project\",\"folder\",\"document\"],\"type\":\"string\"},\"targetUuids\":{\"description\":\"Target UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"targetType\",\"targetUuids\"],\"type\":\"object\"},\"required\":[\"targetType\",\"targetUuids\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"3339f73817ba8432\"},\n {\"mcpName\":\"enable_shares\",\"commandPath\":[\"tools\",\"run\",\"enable-shares\"],\"group\":\"generic\",\"description\":\"Turn on public links: anyone with the link can open it without signing in, so confirm with the user before exposing anything. targetType document returns shareUrl (a public page) and publicApiPath; board documents have no public link (PUBLIC_SHARE_UNSUPPORTED_TYPE); needs admin or owner rights on the document. targetType project returns publicToken and a publicApiPath that reads the project and its documents through the public API — there is no public project page; needs admin or owner rights. targetType folder only stores a token that nothing public reads yet, so share the documents or the project instead; needs edit access. Re-enabling a document or project reuses its previous link. This does not invite or notify anyone — giving specific people access is done in the AiNecto app. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns enabled (rows with the link fields) and count.\",\"inputSchema\":{\"properties\":{\"targetType\":{\"description\":\"Share target type. A document gets a shareUrl anyone can open; a project gets a public API path only (there is no public project page); a folder token is stored but nothing public reads it yet.\",\"enum\":[\"project\",\"folder\",\"document\"],\"type\":\"string\"},\"targetUuids\":{\"description\":\"Target UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"targetType\",\"targetUuids\"],\"type\":\"object\"},\"required\":[\"targetType\",\"targetUuids\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"972a9386ae31088f\"},\n {\"mcpName\":\"erd_apply_changes\",\"commandPath\":[\"erd\",\"apply-changes\"],\"group\":\"erd\",\"description\":\"Required single-call mutation path for ERD create/update/delete changes. Put tables, columns, indexes, refs, enums, enum_values, and table groups in one operations array and call this once.\\nRules: (1) all data field names are snake_case; (2) for create, generate your own UUIDs and put them in data.uuid, then later operations in the same batch may reference those UUIDs without read-back calls; (3) enum values are separate enum_value operations, not inline on enum; (4) ref.relationship uses short dbdiagram-style symbols: >, <, or -; (5) ref_column operations map FK columns explicitly, never automatically.\\nDo not look for type-specific ERD CUD tools; this tool is the only ERD CUD entry point. If operations is very large, use request_upload_token with purpose=mcp.call and send the tools/call payload with curl to save LLM tokens.\\nOne-call worked example:\\n{\\n \\\"documentUuid\\\": \\\"erd-doc-uuid\\\",\\n \\\"description\\\": \\\"create users/posts ERD\\\",\\n \\\"operations\\\": [\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"table\\\",\\\"data\\\":{\\\"uuid\\\":\\\"tbl_users\\\",\\\"name\\\":\\\"users\\\",\\\"display_order\\\":1}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_users_id\\\",\\\"table_uuid\\\":\\\"tbl_users\\\",\\\"name\\\":\\\"id\\\",\\\"type\\\":\\\"bigint\\\",\\\"is_pk\\\":true,\\\"is_not_null\\\":true,\\\"display_order\\\":1}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_users_email\\\",\\\"table_uuid\\\":\\\"tbl_users\\\",\\\"name\\\":\\\"email\\\",\\\"type\\\":\\\"varchar(255)\\\",\\\"is_unique\\\":true,\\\"is_not_null\\\":true,\\\"display_order\\\":2}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"table\\\",\\\"data\\\":{\\\"uuid\\\":\\\"tbl_posts\\\",\\\"name\\\":\\\"posts\\\",\\\"display_order\\\":2}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_posts_id\\\",\\\"table_uuid\\\":\\\"tbl_posts\\\",\\\"name\\\":\\\"id\\\",\\\"type\\\":\\\"bigint\\\",\\\"is_pk\\\":true,\\\"is_not_null\\\":true,\\\"display_order\\\":1}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_posts_author_id\\\",\\\"table_uuid\\\":\\\"tbl_posts\\\",\\\"name\\\":\\\"author_id\\\",\\\"type\\\":\\\"bigint\\\",\\\"is_not_null\\\":true,\\\"display_order\\\":2}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_posts_status\\\",\\\"table_uuid\\\":\\\"tbl_posts\\\",\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"post_status\\\",\\\"is_not_null\\\":true,\\\"display_order\\\":3}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"enum\\\",\\\"data\\\":{\\\"uuid\\\":\\\"enum_post_status\\\",\\\"name\\\":\\\"post_status\\\"}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"enum_value\\\",\\\"data\\\":{\\\"uuid\\\":\\\"enum_post_status_draft\\\",\\\"enum_uuid\\\":\\\"enum_post_status\\\",\\\"value\\\":\\\"draft\\\",\\\"display_order\\\":1}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"enum_value\\\",\\\"data\\\":{\\\"uuid\\\":\\\"enum_post_status_published\\\",\\\"enum_uuid\\\":\\\"enum_post_status\\\",\\\"value\\\":\\\"published\\\",\\\"display_order\\\":2}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"ref\\\",\\\"data\\\":{\\\"uuid\\\":\\\"ref_posts_author\\\",\\\"name\\\":\\\"fk_posts_author\\\",\\\"from_table_uuid\\\":\\\"tbl_posts\\\",\\\"to_table_uuid\\\":\\\"tbl_users\\\",\\\"relationship\\\":\\\">\\\",\\\"on_delete\\\":\\\"cascade\\\"}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"ref_column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"refcol_posts_author\\\",\\\"ref_uuid\\\":\\\"ref_posts_author\\\",\\\"from_column_uuid\\\":\\\"col_posts_author_id\\\",\\\"to_column_uuid\\\":\\\"col_users_id\\\",\\\"display_order\\\":1}}\\n ]\\n}\",\"inputSchema\":{\"properties\":{\"arrangeNewTables\":{\"description\":\"Whether to auto-place newly-created tables after the batch; defaults to true\",\"type\":\"boolean\"},\"description\":{\"description\":\"Reason for batch (audit)\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"operations\":{\"description\":\"Atomic create/update/delete operations\",\"items\":{\"description\":\"One ERD mutation. Use a single operations array with client-generated data.uuid values to create cross-referenced tables, columns, enums, refs, and ref_columns without read-back calls.\",\"discriminator\":{\"propertyName\":\"type\"},\"oneOf\":[{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table'.\",\"properties\":{\"alias\":{\"description\":\"Display alias.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"header_color\":{\"description\":\"Header color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"note\":{\"description\":\"Table note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"name\"],\"title\":\"table data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table'.\",\"properties\":{\"alias\":{\"description\":\"Display alias.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"header_color\":{\"description\":\"Header color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"note\":{\"description\":\"Table note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"table\",\"description\":\"Must be 'table' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"table operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='column'.\",\"properties\":{\"default_value\":{\"description\":\"Default value.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"is_increment\":{\"description\":\"Auto-increment flag.\",\"type\":\"boolean\"},\"is_not_null\":{\"description\":\"Not-null flag.\",\"type\":\"boolean\"},\"is_pk\":{\"description\":\"Primary key flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Column name.\",\"type\":\"string\"},\"note\":{\"description\":\"Column note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create; may be a data.uuid from an earlier table operation in this batch.\",\"type\":\"string\"},\"type\":{\"description\":\"SQL data type. Use this exact field name; do not send data_type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"table_uuid\"],\"title\":\"column data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='column'.\",\"properties\":{\"default_value\":{\"description\":\"Default value.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"is_increment\":{\"description\":\"Auto-increment flag.\",\"type\":\"boolean\"},\"is_not_null\":{\"description\":\"Not-null flag.\",\"type\":\"boolean\"},\"is_pk\":{\"description\":\"Primary key flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Column name.\",\"type\":\"string\"},\"note\":{\"description\":\"Column note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create; may be a data.uuid from an earlier table operation in this batch.\",\"type\":\"string\"},\"type\":{\"description\":\"SQL data type. Use this exact field name; do not send data_type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"column data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"column\",\"description\":\"Must be 'column' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"column operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='index'.\",\"properties\":{\"is_pk\":{\"description\":\"Primary key index flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique index flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Index name.\",\"type\":\"string\"},\"note\":{\"description\":\"Index note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create.\",\"type\":\"string\"},\"type\":{\"description\":\"Index type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"table_uuid\"],\"title\":\"index data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='index'.\",\"properties\":{\"is_pk\":{\"description\":\"Primary key index flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique index flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Index name.\",\"type\":\"string\"},\"note\":{\"description\":\"Index note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create.\",\"type\":\"string\"},\"type\":{\"description\":\"Index type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"index data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"index\",\"description\":\"Must be 'index' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"index operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='index_column'.\",\"properties\":{\"column_uuid\":{\"description\":\"Column UUID. Required for create.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"index_uuid\":{\"description\":\"Index UUID. Required for create.\",\"type\":\"string\"},\"sort_order\":{\"description\":\"Sort order, for example ASC or DESC.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"index_uuid\",\"column_uuid\"],\"title\":\"index_column data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='index_column'.\",\"properties\":{\"column_uuid\":{\"description\":\"Column UUID. Required for create.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"index_uuid\":{\"description\":\"Index UUID. Required for create.\",\"type\":\"string\"},\"sort_order\":{\"description\":\"Sort order, for example ASC or DESC.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"index_column data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"index_column\",\"description\":\"Must be 'index_column' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"index_column operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='ref'.\",\"properties\":{\"from_table_uuid\":{\"description\":\"Source table UUID. Required for create.\",\"type\":\"string\"},\"name\":{\"description\":\"Reference name.\",\"type\":\"string\"},\"on_delete\":{\"description\":\"ON DELETE action.\",\"type\":\"string\"},\"on_update\":{\"description\":\"ON UPDATE action.\",\"type\":\"string\"},\"relationship\":{\"description\":\"Required for create. Use short dbdiagram-style relationship symbols.\",\"enum\":[\">\",\"<\",\"-\"],\"type\":\"string\"},\"to_table_uuid\":{\"description\":\"Target table UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"from_table_uuid\",\"to_table_uuid\",\"relationship\"],\"title\":\"ref data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='ref'.\",\"properties\":{\"from_table_uuid\":{\"description\":\"Source table UUID. Required for create.\",\"type\":\"string\"},\"name\":{\"description\":\"Reference name.\",\"type\":\"string\"},\"on_delete\":{\"description\":\"ON DELETE action.\",\"type\":\"string\"},\"on_update\":{\"description\":\"ON UPDATE action.\",\"type\":\"string\"},\"relationship\":{\"description\":\"Required for create. Use short dbdiagram-style relationship symbols.\",\"enum\":[\">\",\"<\",\"-\"],\"type\":\"string\"},\"to_table_uuid\":{\"description\":\"Target table UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"ref data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"ref\",\"description\":\"Must be 'ref' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"ref operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='ref_column'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"from_column_uuid\":{\"description\":\"Source column UUID. Required for create.\",\"type\":\"string\"},\"ref_uuid\":{\"description\":\"Reference UUID. Required for create; may be a data.uuid from an earlier ref operation.\",\"type\":\"string\"},\"to_column_uuid\":{\"description\":\"Target column UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"ref_uuid\",\"from_column_uuid\",\"to_column_uuid\"],\"title\":\"ref_column data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='ref_column'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"from_column_uuid\":{\"description\":\"Source column UUID. Required for create.\",\"type\":\"string\"},\"ref_uuid\":{\"description\":\"Reference UUID. Required for create; may be a data.uuid from an earlier ref operation.\",\"type\":\"string\"},\"to_column_uuid\":{\"description\":\"Target column UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"ref_column data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"ref_column\",\"description\":\"Must be 'ref_column' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"ref_column operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='enum'.\",\"properties\":{\"name\":{\"description\":\"Enum name.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"enum data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='enum'.\",\"properties\":{\"name\":{\"description\":\"Enum name.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"enum data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"enum\",\"description\":\"Must be 'enum' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"enum operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='enum_value'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"enum_uuid\":{\"description\":\"Parent enum UUID. Required for create; may be a data.uuid from an earlier enum operation.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum value note.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"value\":{\"description\":\"Enum value. Inline enum values on enum are not persisted; create enum_value operations.\",\"type\":\"string\"}},\"required\":[\"enum_uuid\"],\"title\":\"enum_value data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='enum_value'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"enum_uuid\":{\"description\":\"Parent enum UUID. Required for create; may be a data.uuid from an earlier enum operation.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum value note.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"value\":{\"description\":\"Enum value. Inline enum values on enum are not persisted; create enum_value operations.\",\"type\":\"string\"}},\"title\":\"enum_value data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"enum_value\",\"description\":\"Must be 'enum_value' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"enum_value operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group'.\",\"properties\":{\"color\":{\"description\":\"Group color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table group name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group'.\",\"properties\":{\"color\":{\"description\":\"Group color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table group name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"table_group\",\"description\":\"Must be 'table_group' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"table_group operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group_table'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Table schema name.\",\"type\":\"string\"},\"table_name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"group_uuid\",\"table_name\"],\"title\":\"table_group_table data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group_table'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Table schema name.\",\"type\":\"string\"},\"table_name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group_table data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"table_group_table\",\"description\":\"Must be 'table_group_table' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"table_group_table operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group_note'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"note_uuid\":{\"description\":\"Note UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"group_uuid\",\"note_uuid\"],\"title\":\"table_group_note data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group_note'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"note_uuid\":{\"description\":\"Note UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group_note data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"table_group_note\",\"description\":\"Must be 'table_group_note' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"table_group_note operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='filter'.\",\"properties\":{\"included_tables\":{\"description\":\"JSON string/list of included tables.\",\"type\":\"string\"},\"is_default\":{\"description\":\"Default filter flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Filter name.\",\"type\":\"string\"},\"table_groups\":{\"description\":\"JSON string/object of table groups.\",\"type\":\"string\"},\"table_positions\":{\"description\":\"JSON string/object of table positions.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"filter data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='filter'.\",\"properties\":{\"included_tables\":{\"description\":\"JSON string/list of included tables.\",\"type\":\"string\"},\"is_default\":{\"description\":\"Default filter flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Filter name.\",\"type\":\"string\"},\"table_groups\":{\"description\":\"JSON string/object of table groups.\",\"type\":\"string\"},\"table_positions\":{\"description\":\"JSON string/object of table positions.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"filter data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"filter\",\"description\":\"Must be 'filter' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"filter operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='note'.\",\"properties\":{\"color\":{\"description\":\"Note color.\",\"type\":\"string\"},\"content\":{\"description\":\"Note content.\",\"type\":\"string\"},\"height\":{\"description\":\"Height.\",\"type\":\"integer\"},\"icon_name\":{\"description\":\"Icon name.\",\"type\":\"string\"},\"position_x\":{\"description\":\"X position.\",\"type\":\"integer\"},\"position_y\":{\"description\":\"Y position.\",\"type\":\"integer\"},\"title\":{\"description\":\"Note title.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"width\":{\"description\":\"Width.\",\"type\":\"integer\"}},\"title\":\"note data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='note'.\",\"properties\":{\"color\":{\"description\":\"Note color.\",\"type\":\"string\"},\"content\":{\"description\":\"Note content.\",\"type\":\"string\"},\"height\":{\"description\":\"Height.\",\"type\":\"integer\"},\"icon_name\":{\"description\":\"Icon name.\",\"type\":\"string\"},\"position_x\":{\"description\":\"X position.\",\"type\":\"integer\"},\"position_y\":{\"description\":\"Y position.\",\"type\":\"integer\"},\"title\":{\"description\":\"Note title.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"width\":{\"description\":\"Width.\",\"type\":\"integer\"}},\"title\":\"note data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"note\",\"description\":\"Must be 'note' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"note operation\",\"type\":\"object\"}],\"properties\":{\"data\":{\"description\":\"Type-specific payload. All field names are snake_case. For create, data.uuid may be client-supplied and referenced by later operations in the same batch.\",\"oneOf\":[{\"description\":\"Payload for operation.type='table'.\",\"properties\":{\"alias\":{\"description\":\"Display alias.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"header_color\":{\"description\":\"Header color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"note\":{\"description\":\"Table note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='column'.\",\"properties\":{\"default_value\":{\"description\":\"Default value.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"is_increment\":{\"description\":\"Auto-increment flag.\",\"type\":\"boolean\"},\"is_not_null\":{\"description\":\"Not-null flag.\",\"type\":\"boolean\"},\"is_pk\":{\"description\":\"Primary key flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Column name.\",\"type\":\"string\"},\"note\":{\"description\":\"Column note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create; may be a data.uuid from an earlier table operation in this batch.\",\"type\":\"string\"},\"type\":{\"description\":\"SQL data type. Use this exact field name; do not send data_type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"column data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='index'.\",\"properties\":{\"is_pk\":{\"description\":\"Primary key index flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique index flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Index name.\",\"type\":\"string\"},\"note\":{\"description\":\"Index note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create.\",\"type\":\"string\"},\"type\":{\"description\":\"Index type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"index data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='index_column'.\",\"properties\":{\"column_uuid\":{\"description\":\"Column UUID. Required for create.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"index_uuid\":{\"description\":\"Index UUID. Required for create.\",\"type\":\"string\"},\"sort_order\":{\"description\":\"Sort order, for example ASC or DESC.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"index_column data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='ref'.\",\"properties\":{\"from_table_uuid\":{\"description\":\"Source table UUID. Required for create.\",\"type\":\"string\"},\"name\":{\"description\":\"Reference name.\",\"type\":\"string\"},\"on_delete\":{\"description\":\"ON DELETE action.\",\"type\":\"string\"},\"on_update\":{\"description\":\"ON UPDATE action.\",\"type\":\"string\"},\"relationship\":{\"description\":\"Required for create. Use short dbdiagram-style relationship symbols.\",\"enum\":[\">\",\"<\",\"-\"],\"type\":\"string\"},\"to_table_uuid\":{\"description\":\"Target table UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"ref data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='ref_column'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"from_column_uuid\":{\"description\":\"Source column UUID. Required for create.\",\"type\":\"string\"},\"ref_uuid\":{\"description\":\"Reference UUID. Required for create; may be a data.uuid from an earlier ref operation.\",\"type\":\"string\"},\"to_column_uuid\":{\"description\":\"Target column UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"ref_column data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='enum'.\",\"properties\":{\"name\":{\"description\":\"Enum name.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"enum data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='enum_value'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"enum_uuid\":{\"description\":\"Parent enum UUID. Required for create; may be a data.uuid from an earlier enum operation.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum value note.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"value\":{\"description\":\"Enum value. Inline enum values on enum are not persisted; create enum_value operations.\",\"type\":\"string\"}},\"title\":\"enum_value data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='table_group'.\",\"properties\":{\"color\":{\"description\":\"Group color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table group name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='table_group_table'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Table schema name.\",\"type\":\"string\"},\"table_name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group_table data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='table_group_note'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"note_uuid\":{\"description\":\"Note UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group_note data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='filter'.\",\"properties\":{\"included_tables\":{\"description\":\"JSON string/list of included tables.\",\"type\":\"string\"},\"is_default\":{\"description\":\"Default filter flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Filter name.\",\"type\":\"string\"},\"table_groups\":{\"description\":\"JSON string/object of table groups.\",\"type\":\"string\"},\"table_positions\":{\"description\":\"JSON string/object of table positions.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"filter data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='note'.\",\"properties\":{\"color\":{\"description\":\"Note color.\",\"type\":\"string\"},\"content\":{\"description\":\"Note content.\",\"type\":\"string\"},\"height\":{\"description\":\"Height.\",\"type\":\"integer\"},\"icon_name\":{\"description\":\"Icon name.\",\"type\":\"string\"},\"position_x\":{\"description\":\"X position.\",\"type\":\"integer\"},\"position_y\":{\"description\":\"Y position.\",\"type\":\"integer\"},\"title\":{\"description\":\"Note title.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"width\":{\"description\":\"Width.\",\"type\":\"integer\"}},\"title\":\"note data\",\"type\":\"object\"}],\"type\":\"object\"},\"op\":{\"description\":\"Operation. For create, put any new UUID in data.uuid; for update/delete, put target UUID in operation.uuid.\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"description\":\"ERD entity type. This selects the operation.data shape.\",\"enum\":[\"table\",\"column\",\"index\",\"index_column\",\"ref\",\"ref_column\",\"enum\",\"enum_value\",\"table_group\",\"table_group_table\",\"table_group_note\",\"filter\",\"note\"],\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete. Do not use this for create; use data.uuid instead.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"documentUuid\",\"description\",\"operations\"],\"type\":\"object\"},\"required\":[\"description\",\"documentUuid\",\"operations\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"87f5bcf5a253815a\"},\n {\"mcpName\":\"erd_arrange_tables\",\"commandPath\":[\"erd\",\"arrange-tables\"],\"group\":\"erd\",\"description\":\"Arrange ERD tables after edits. Default incremental mode places newly-created tables while preserving existing positions; full=true re-layouts the entire diagram. Use after several separate table edits to tidy the canvas.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"full\":{\"description\":\"Re-layout the ENTIRE diagram (overwrites existing positions). Default false = arrange only newly-added (uncoordinated) tables to the top-right while preserving existing table positions. Call this after creating several tables to tidy them up.\",\"type\":\"boolean\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"651fd0d54e3635ff\"},\n {\"mcpName\":\"erd_get_enum\",\"commandPath\":[\"erd\",\"get-enum\"],\"group\":\"erd\",\"description\":\"Read one ERD enum with its values (uuid, value, note, displayOrder). Read only; needs read access. Fails with 404 for an unknown UUID, 403 without access, and an error when documentUuid is not an ERD document, or when the enum belongs to a different ERD document.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"enumUuid\":{\"description\":\"Enum UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"enumUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"enumUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"ae536a31eb604f3a\"},\n {\"mcpName\":\"erd_get_ref\",\"commandPath\":[\"erd\",\"get-ref\"],\"group\":\"erd\",\"description\":\"Read one ERD relationship with its column pairs (fromColumnUuid to toColumnUuid, displayOrder). Read only; needs read access. Fails with 404 for an unknown UUID, 403 without access, and an error when documentUuid is not an ERD document, or when the relationship belongs to a different ERD document.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"refUuid\":{\"description\":\"Relationship UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"refUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"refUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"e71d40552c0df42e\"},\n {\"mcpName\":\"erd_get_table\",\"commandPath\":[\"erd\",\"get-table\"],\"group\":\"erd\",\"description\":\"Get one ERD table with nested columns and indexes. Returns persistent table/column/index UUIDs usable directly as erd_apply_changes update/delete targets and ref_column column references. Column fields use apply_changes snake_case names: uuid, table_uuid, name, type, is_pk, is_unique, is_not_null, is_increment, default_value, note, display_order. Index fields include uuid, name, columns (column UUIDs), is_unique, is_pk, type.\",\"inputSchema\":{\"description\":\"Get one ERD table with nested columns and indexes. Returns persistent table/column/index UUIDs usable directly as mcp__ainecto__erd_apply_changes update/delete targets and ref_column column references. Column fields use apply_changes snake_case names: uuid, table_uuid, name, type, is_pk, is_unique, is_not_null, is_increment, default_value, note, display_order. Index fields include uuid, name, columns (column UUIDs), is_unique, is_pk, type.\",\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"tableUuid\":{\"description\":\"Table UUID. Response includes columns[] and indexes[] with persistent UUIDs for apply_changes.\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"tableUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"tableUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"0dc13648bf3fbf8f\"},\n {\"mcpName\":\"erd_get_table_group\",\"commandPath\":[\"erd\",\"get-table-group\"],\"group\":\"erd\",\"description\":\"Read one ERD table group: uuid, name, color and noteUuids. Read only; needs read access. Fails with 404 for an unknown UUID, 403 without access, and an error when documentUuid is not an ERD document, or when the group belongs to a different ERD document.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"tableGroupUuid\":{\"description\":\"Table group UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"tableGroupUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"tableGroupUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"ed949fa7ca0884b2\"},\n {\"mcpName\":\"erd_list_enums\",\"commandPath\":[\"erd\",\"list-enums\"],\"group\":\"erd\",\"description\":\"List the enums of one ERD document: uuid, name, schemaName and note. Values are not included — erd_get_enum reads them. Read only; needs read access. Fails with 404 for an unknown UUID, 403 without access, and an error when documentUuid is not an ERD document. Returns enums and count.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"ea76585e1cca3997\"},\n {\"mcpName\":\"erd_list_refs\",\"commandPath\":[\"erd\",\"list-refs\"],\"group\":\"erd\",\"description\":\"List the relationships (foreign-key refs) of one ERD document: uuid, name, fromTableUuid, toTableUuid, relationship (>, < or -), onDelete and onUpdate. Column pairs are not included — erd_get_ref reads them. Read only; needs read access. Fails with 404 for an unknown UUID, 403 without access, and an error when documentUuid is not an ERD document. Returns refs and count.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"2292c8caf4fc5c25\"},\n {\"mcpName\":\"erd_list_table_groups\",\"commandPath\":[\"erd\",\"list-table-groups\"],\"group\":\"erd\",\"description\":\"List the table groups of one ERD document: uuid, name, color and noteUuids (the notes in the group). Read only; needs read access. Fails with 404 for an unknown UUID, 403 without access, and an error when documentUuid is not an ERD document. Returns tableGroups and count.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"4c910d38ca4bfc82\"},\n {\"mcpName\":\"erd_list_tables\",\"commandPath\":[\"erd\",\"list-tables\"],\"group\":\"erd\",\"description\":\"List the tables of one ERD document: uuid, name, schemaName, alias, note, headerColor and displayOrder. Columns and indexes are not included — erd_get_table reads them. Read only; needs read access. Fails with 404 for an unknown UUID, 403 without access, and an error when documentUuid is not an ERD document. Returns tables and count.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"e9aed0d47d33c169\"},\n {\"mcpName\":\"get_attachment\",\"commandPath\":[\"attachment\",\"get\"],\"group\":\"attachment\",\"description\":\"Read one attachment's metadata by UUID: filename, contentType, sizeBytes, parent, uploadedBy, archived. It does not return the file contents or a download link. Needs read access to the whole project. Read only. Fails with 404 for an unknown UUID and 403 without access.\",\"inputSchema\":{\"properties\":{\"uuid\":{\"description\":\"Attachment UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"required\":[\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"f7ff5a989c9ef3b9\"},\n {\"mcpName\":\"get_document\",\"commandPath\":[\"document\",\"get\"],\"group\":\"document\",\"description\":\"Read a document. The body comes back for the types whose create/update take one: markdown → content; openapi → content (the spec text) + format/specVersion/pathCount/operationCount; html → content (the HTML text); file → file {filename, contentType, sizeBytes, viewerKind} + content for text/CSV (first 64 KB); diagram → diagramSource/sourceLanguage/edgeStyle/isModule/metadata; kanban → board {viewer, columns: each column's first 20 cards + hasMore} (more cards and card details via kanban_list_cards); erd → metadata only (read tables/refs via erd_list_*).\",\"inputSchema\":{\"properties\":{\"uuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"required\":[\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"5c8e9d305fc15c1f\"},\n {\"mcpName\":\"get_my_work_summary\",\"commandPath\":[\"my-work-summary\",\"get\"],\"group\":\"generic\",\"description\":\"One-call summary of what is waiting for the signed-in user in AiNecto — call it when the user asks things like \\\"do I have anything to do?\\\", \\\"anything new?\\\", \\\"anything to review?\\\" or \\\"did anyone ask me something?\\\". Returns notifications {unread (not yet read by the person — the same read state as the web bell, so reading on the web lowers it at once; newest 100 counted; unreadCapped when there are more; the same number as the line at the end of tool results), unreadByKind}, mentionsToRead {items the person has not read that mention them, each with target title and url}, and todos {open (stays until the to-do is done or closed; the to-dos on that line), leaseExpired, inProgress, items: questions and requests waiting for the user's agent} and cards {kanban cards assigned to the user on boards they can read now: assignedOpen, pendingAcceptance (assigned but not yet accepted or declined), inProgress, inReview, blocked, items: the first page}. For details use list_notifications, list_agent_todos and kanban_list_cards; to read the document and its comments use get_document with the target uuid. Read-only: nothing is marked read or acknowledged.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"projectUuid\":{\"description\":\"Older single-value form of projectUuids.\",\"type\":\"string\"},\"projectUuids\":{\"description\":\"Only items in any of these projects. Use it when the user names a project or the project you are working in is clear. With workspaceUuids too, both must match. A workspace or project you cannot see matches nothing.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"workspaceUuids\":{\"description\":\"Only items in any of these workspaces.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"bcb546e954f81945\"},\n {\"mcpName\":\"get_project\",\"commandPath\":[\"project\",\"get\"],\"group\":\"generic\",\"description\":\"Read one project by UUID: name, projectKey, description, workspaceId, publicReadable and publicToken, archived and revision. Read only. Fails with 404 for an unknown UUID and 403 when you cannot open the whole project or it is archived.\",\"inputSchema\":{\"properties\":{\"uuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"required\":[\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"f4ec896c20a1f99f\"},\n {\"mcpName\":\"get_version\",\"commandPath\":[\"version\",\"get\"],\"group\":\"generic\",\"description\":\"Read one saved version of a document, including snapshotJson — the full saved content in that document type's stored format. Read only; needs read access. Fails with 404 for an unknown version number and with a plan-limit error for a locked version (see list_versions).\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"Document UUID\",\"type\":\"string\"},\"versionNumber\":{\"description\":\"Version number\",\"type\":\"integer\"}},\"required\":[\"documentUuid\",\"versionNumber\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"versionNumber\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"d80e338a03804261\"},\n {\"mcpName\":\"get_workspace\",\"commandPath\":[\"workspace\",\"get\"],\"group\":\"workspace\",\"description\":\"Read one workspace by UUID: name, description, owner, archived and revision. Works for any workspace you can see, including one where you were only given a project. Read only. Fails with 404 for an unknown UUID and 403 when you have no access or the workspace is archived.\",\"inputSchema\":{\"properties\":{\"uuid\":{\"description\":\"Workspace UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"required\":[\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"8bc1d78109480495\"},\n {\"mcpName\":\"identity_get_self\",\"commandPath\":[\"tools\",\"run\",\"identity-get-self\"],\"group\":\"generic\",\"description\":\"Return the authenticated MCP caller identity summary: userId, display name, and job profile (the user's job title and areas — personal context only, it never changes what they may do). Never returns email or token claims.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"2298c704e1563bdb\"},\n {\"mcpName\":\"identity_list_job_roles\",\"commandPath\":[\"tools\",\"run\",\"identity-list-job-roles\"],\"group\":\"generic\",\"description\":\"List the job roles the signed-in user can pick for their own job profile — the same list as the account settings screen: roles {code, title, family}, families, areas {code, title}, suggested role codes, customCode (pick it to type a title that is not in the list) and titleMaxLength. Use the codes with identity_update_job_profile. A job profile is personal context only; it never changes what the user may do.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"59a20e90a49eb02d\"},\n {\"mcpName\":\"identity_update_job_profile\",\"commandPath\":[\"tools\",\"run\",\"identity-update-job-profile\"],\"group\":\"generic\",\"description\":\"Set the signed-in user's own job profile (job role and areas) — the same setting as the account settings screen. It only ever changes the caller's own profile. Pick code and areas from identity_list_job_roles; pass null as code to clear it. Returns the saved jobProfile in the same shape as identity_get_self (null when cleared). Invalid values fail with INVALID_JOB_PROFILE and change nothing. A job profile is personal context only; it never changes what the user may do.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"areas\":{\"description\":\"Area codes from identity_list_job_roles; the first is the primary area. At least one with the custom code, optional for a listed role. Each area once.\",\"items\":{\"description\":\"Area code.\",\"type\":\"string\"},\"type\":\"array\"},\"code\":{\"description\":\"Job role code from identity_list_job_roles, or its customCode to type your own title. null clears the job profile.\",\"type\":[\"string\",\"null\"]},\"title\":{\"description\":\"The role title in the user's own words — required with the custom code, ignored for a listed role (its title comes from the list).\",\"type\":\"string\"}},\"required\":[\"code\"],\"type\":\"object\"},\"required\":[\"code\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"de9d5d59fcddfa45\"},\n {\"mcpName\":\"kanban_apply_changes\",\"commandPath\":[\"kanban\",\"apply-changes\"],\"group\":\"kanban\",\"description\":\"Create, edit, reorder and link cards on one kanban board in a single atomic call (at most 100 operations; if one fails nothing is applied and the error carries operationIndex and code). Creating and editing cards needs edit access to the board; move with toBoardUuid moves a card to another board of the same project. The assignee may also check acceptance criteria and add result links (DELIVERABLE, REVIEW_RESULT, TEST_EVIDENCE). create also sets assignee, requester, reviewers and watchers in the same call. To change a card's column, reassign it, accept, approve, block, watch and similar, use kanban_card_action. Results list each operation's card uuid, revision, status and sortKey.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"boardUuid\":{\"description\":\"Kanban board (document) UUID.\",\"type\":\"string\"},\"mailLanguage\":{\"description\":\"Language of the emails these operations may send (review requests to newly named reviewers). Defaults to en.\",\"enum\":[\"en\",\"ko\"],\"type\":\"string\"},\"operations\":{\"description\":\"Operations, applied in order in one transaction. If any fails, none is applied and the error names operationIndex.\",\"items\":{\"additionalProperties\":false,\"properties\":{\"afterCardUuid\":{\"description\":\"Place after this card in the column (create, move).\",\"type\":\"string\"},\"assigneeUserId\":{\"description\":\"create only: assign the new card (userId from list_mention_candidates with the board's documentUuid). Someone other than you gets an assignment to accept. To reassign an existing card use kanban_card_action assign.\",\"type\":\"string\"},\"beforeCardUuid\":{\"description\":\"move: place before this card in the column.\",\"type\":\"string\"},\"cardType\":{\"description\":\"Card type (default TASK).\",\"enum\":[\"TASK\",\"REVIEW\",\"BUG\",\"DECISION\"],\"type\":\"string\"},\"cardUuid\":{\"description\":\"Target card (update, move, link, unlink). It must be on this board. From kanban_list_cards — by cardKeys if you only have the card key, e.g. KAN-15.\",\"type\":\"string\"},\"clientMutationId\":{\"description\":\"create: idempotency key — retrying with the same value returns the same card instead of creating another.\",\"type\":\"string\"},\"criteria\":{\"description\":\"Acceptance criteria. update replaces the whole list; the assignee may only flip done.\",\"items\":{\"additionalProperties\":false,\"properties\":{\"done\":{\"description\":\"Checked (default false).\",\"type\":\"boolean\"},\"text\":{\"description\":\"What must be true.\",\"type\":\"string\"}},\"required\":[\"text\"],\"type\":\"object\"},\"type\":\"array\"},\"description\":{\"description\":\"Markdown description. Keep it short — link longer text as a document instead. update: null clears it.\",\"type\":[\"string\",\"null\"]},\"documentUuid\":{\"description\":\"AiNecto document to link (you must be able to read it). Give this or url.\",\"type\":\"string\"},\"dueAt\":{\"description\":\"Due time, ISO-8601 instant such as 2026-10-31T09:00:00Z. update: null clears it.\",\"type\":[\"string\",\"null\"]},\"expectedRevision\":{\"description\":\"The card revision you last read. If the card changed since, the whole call fails with CARD_CHANGED and the current card. Send it when people may edit the card too.\",\"minimum\":0,\"type\":\"integer\"},\"label\":{\"description\":\"Optional label for an external URL.\",\"type\":\"string\"},\"linkId\":{\"description\":\"unlink: the linkId from the card's links.\",\"minimum\":1,\"type\":\"integer\"},\"linkRole\":{\"description\":\"Link role. The assignee may add DELIVERABLE, REVIEW_RESULT and TEST_EVIDENCE links; other roles need edit access to the board.\",\"enum\":[\"REQUIREMENT\",\"REFERENCE\",\"DELIVERABLE\",\"REVIEW_RESULT\",\"DECISION\",\"TEST_EVIDENCE\"],\"type\":\"string\"},\"links\":{\"description\":\"create only: links to attach.\",\"items\":{\"additionalProperties\":false,\"properties\":{\"documentUuid\":{\"description\":\"AiNecto document to link (you must be able to read it). Give this or url.\",\"type\":\"string\"},\"label\":{\"description\":\"Optional label for an external URL.\",\"type\":\"string\"},\"linkRole\":{\"description\":\"Link role. The assignee may add DELIVERABLE, REVIEW_RESULT and TEST_EVIDENCE links; other roles need edit access to the board.\",\"enum\":[\"REQUIREMENT\",\"REFERENCE\",\"DELIVERABLE\",\"REVIEW_RESULT\",\"DECISION\",\"TEST_EVIDENCE\"],\"type\":\"string\"},\"url\":{\"description\":\"External http(s) URL to link, e.g. a pull request. Give this or documentUuid.\",\"type\":\"string\"}},\"required\":[\"linkRole\"],\"type\":\"object\"},\"type\":\"array\"},\"op\":{\"description\":\"create: a new card in To Do (you become its requester unless requesterUserId names someone else). update: change only the fields you send (send null to clear description, dueAt). move: reorder within the card's column, or with toBoardUuid move it to another board of the same project. link / unlink: attach or remove a document or an external URL.\",\"enum\":[\"create\",\"link\",\"move\",\"unlink\",\"update\"],\"type\":\"string\"},\"priority\":{\"description\":\"Priority (default MEDIUM).\",\"enum\":[\"LOW\",\"MEDIUM\",\"HIGH\",\"URGENT\"],\"type\":\"string\"},\"requesterUserId\":{\"description\":\"create only: the requester (reporter) instead of you; they are notified. To change it later use kanban_card_action set_requester.\",\"type\":\"string\"},\"responderIds\":{\"description\":\"update only: who should answer while the card is blocked.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"reviewerIds\":{\"description\":\"Reviewers (userIds from list_mention_candidates with cardUuid or the board's documentUuid). update replaces the whole list.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"title\":{\"description\":\"Card title (required for create).\",\"type\":\"string\"},\"toBoardUuid\":{\"description\":\"move: another kanban board (document UUID) in the same project to move the card to. It keeps its key, column, people, comments, links and to-dos; afterCardUuid / beforeCardUuid then name cards on that board. Needs edit access to both boards, and everyone on the card (requester, assignee, reviewers, watchers, responders) must be able to read the new board.\",\"type\":\"string\"},\"url\":{\"description\":\"External http(s) URL to link, e.g. a pull request. Give this or documentUuid.\",\"type\":\"string\"},\"watcherIds\":{\"description\":\"Watchers who get activity notifications. update replaces the whole list.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"required\":[\"op\"],\"type\":\"object\"},\"maxItems\":100,\"minItems\":1,\"type\":\"array\"}},\"required\":[\"boardUuid\",\"operations\"],\"type\":\"object\"},\"required\":[\"boardUuid\",\"operations\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"b0068321e34a0614\"},\n {\"mcpName\":\"kanban_card_action\",\"commandPath\":[\"kanban\",\"card-action\"],\"group\":\"kanban\",\"description\":\"Do one workflow action on a kanban card, the same as the buttons in the web app. ★Before assign (to someone other than the signed-in user), approve or quick_done, show the user what will happen and get their explicit confirmation — these change other people's work and notify them. Actions: assign / unassign; accept / decline (only the assignee — accepting closes the assignment to-do); start (To Do → In Progress; anyone who can edit the board, or the assignee — not while an assignment is waiting to be accepted); request_review (→ In Review); approve (→ Done) / request_changes (→ In Progress) by the requester or a reviewer; quick_done (To Do → Done); reopen (Done → In Progress); block / unblock; archive / unarchive; set_requester; watch / unwatch (yourself). Doing the action is what closes the matching card to-dos — update_agent_todos cannot complete them. Returns the card after the action (status, assignment state, allowedActions) and reasonCommentId when a reason was saved.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"action\":{\"description\":\"The action. Which ones you may do now is the card's allowedActions in kanban_list_cards (with cardUuids).\",\"enum\":[\"assign\",\"unassign\",\"accept\",\"decline\",\"start\",\"request_review\",\"approve\",\"request_changes\",\"quick_done\",\"reopen\",\"block\",\"unblock\",\"archive\",\"unarchive\",\"set_requester\",\"watch\",\"unwatch\"],\"type\":\"string\"},\"assigneeUserId\":{\"description\":\"assign: who gets the card — someone who can read the board (list_mention_candidates with cardUuid). Your own userId assigns it to you and accepts at once.\",\"type\":\"string\"},\"cardUuid\":{\"description\":\"Card UUID (from kanban_list_cards — by cardKeys if you only have the card key, e.g. KAN-15).\",\"type\":\"string\"},\"expectedRevision\":{\"description\":\"The card revision you last read. If the card changed since, the call fails with CARD_CHANGED and the current card. Send it when people may act on the card too.\",\"minimum\":0,\"type\":\"integer\"},\"mailLanguage\":{\"description\":\"Language of the email this action may send (assignment or review request). Defaults to en.\",\"enum\":[\"en\",\"ko\"],\"type\":\"string\"},\"reason\":{\"description\":\"Saved as a comment on the card. Required when the action's allowedActions entry says reasonRequired (e.g. decline, reopen).\",\"type\":\"string\"},\"requesterUserId\":{\"description\":\"set_requester: the new requester.\",\"type\":\"string\"},\"responderIds\":{\"description\":\"block: who should answer (people who can read the board). Omit to keep the card's current responders.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"required\":[\"cardUuid\",\"action\"],\"type\":\"object\"},\"required\":[\"action\",\"cardUuid\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"a138310eae3979ae\"},\n {\"mcpName\":\"kanban_list_cards\",\"commandPath\":[\"kanban\",\"list-cards\"],\"group\":\"kanban\",\"description\":\"Read kanban cards. Three ways: cardUuids (or cardKeys) → those cards in full, including allowedActions (what you may do now with kanban_card_action) and links; boardUuid → the board's columns To Do, In Progress, In Review, Done (each with hasMore and nextAfter); none of these → cards across all boards you can read where you are the assignee (or requester / watcher), most recently updated first. Each card has uuid and key (KAN-15 — the short id people use in chat; find a card by it with cardKeys, then use its uuid in the write tools), title, status, assignee and assignmentState (PENDING = not yet accepted), blocked, revision and allowedTransitions.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"boardUuid\":{\"description\":\"Board (document) UUID: list its columns, first page each (or one column with status).\",\"type\":\"string\"},\"cardKeys\":{\"description\":\"Read these cards in full by their key (e.g. KAN-15 — the short id people use in chat), the same as cardUuids. Use alone.\",\"items\":{\"type\":\"string\"},\"maxItems\":50,\"minItems\":1,\"type\":\"array\",\"uniqueItems\":true},\"cardUuids\":{\"description\":\"Read these cards in full (description, people, links, allowedActions). Use alone.\",\"items\":{\"type\":\"string\"},\"maxItems\":50,\"minItems\":1,\"type\":\"array\",\"uniqueItems\":true},\"cursor\":{\"description\":\"Next page: nextCursor (without boardUuid) or a column's nextAfter (with boardUuid and status).\",\"type\":\"string\"},\"includeDone\":{\"description\":\"Without boardUuid: also recently completed cards.\",\"type\":\"boolean\"},\"limit\":{\"description\":\"Cards per page (per column with boardUuid). Default 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Without boardUuid: only boards in this project.\",\"type\":\"string\"},\"relation\":{\"description\":\"Without boardUuid: cards across boards where you are the assignee (default), the requester or a watcher.\",\"enum\":[\"ASSIGNEE\",\"REQUESTER\",\"WATCHER\"],\"type\":\"string\"},\"status\":{\"description\":\"With boardUuid: only this column.\",\"enum\":[\"TODO\",\"IN_PROGRESS\",\"IN_REVIEW\",\"DONE\"],\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"e04eb730f4bc5413\"},\n {\"mcpName\":\"list_agent_todos\",\"commandPath\":[\"agent-todos\",\"list\"],\"group\":\"generic\",\"description\":\"List the to-dos that ask the signed-in user's agent to act now (for example a question that mentions the user). This is the current state, not a feed: a to-do you have not finished comes back on every call until it is completed, dismissed, or closed because the person did it themselves. Each item has todoId, kind, obligation, openedAt, summary, target (title and url), action and state. To work on one, claim it with update_agent_todos and complete it with a one-line note. Actions that affect other people (assigning, approving, inviting) need the user's confirmation first.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"after\":{\"description\":\"todoId of the last item of the previous page.\",\"type\":\"string\"},\"kinds\":{\"description\":\"Only these kinds.\",\"items\":{\"enum\":[\"COMMENT_MENTIONED\",\"COMMENT_REPLIED\",\"QUESTION_ANSWERED\",\"QUESTION_RESOLVED\",\"QUESTION_MENTIONED\",\"CARD_CREATED\",\"CARD_UPDATED\",\"CARD_ASSIGNED\",\"CARD_UNASSIGNED\",\"CARD_REQUESTER_SET\",\"CARD_ASSIGNMENT_ACCEPTED\",\"CARD_ASSIGNMENT_DECLINED\",\"CARD_STATUS_CHANGED\",\"CARD_REVIEW_REQUESTED\",\"CARD_CHANGES_REQUESTED\",\"CARD_APPROVED\",\"CARD_QUICK_DONE\",\"CARD_REOPENED\",\"CARD_BLOCKED\",\"CARD_UNBLOCKED\",\"CARD_ARCHIVED\",\"CARD_COMMENTED\"],\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"limit\":{\"description\":\"Items per call, default 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Older single-value form of projectUuids.\",\"type\":\"string\"},\"projectUuids\":{\"description\":\"Only to-dos in any of these projects. Use it when the user names a project or the project you are working in is clear. With workspaceUuids too, both must match. A workspace or project you cannot see matches nothing.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"state\":{\"description\":\"OPEN (default): to-dos you can take, including ones whose lease expired. MINE: to-dos currently leased (claimed) and not expired.\",\"items\":{\"enum\":[\"OPEN\",\"MINE\"],\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"workspaceUuids\":{\"description\":\"Only to-dos in any of these workspaces.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"5285b988db5b02d0\"},\n {\"mcpName\":\"list_attachments\",\"commandPath\":[\"attachments\",\"list\"],\"group\":\"attachment\",\"description\":\"List the active attachments in a project, newest first: uuid, filename, contentType, sizeBytes, parentType and parentId, uploadedBy. Metadata only — no file contents or download link. Removed attachments are not listed. Needs read access to the whole project. Read only. Returns attachments and count.\",\"inputSchema\":{\"properties\":{\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"projectUuid\"],\"type\":\"object\"},\"required\":[\"projectUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"fbd087e35c18f8b3\"},\n {\"mcpName\":\"list_comments\",\"commandPath\":[\"comments\",\"list\"],\"group\":\"generic\",\"description\":\"List the active comments on a document or a kanban card (cardUuid), oldest first, including replies (a reply has parentCommentId set; replies are one level deep). Each comment has id, kind (COMMENT or QUESTION), body, author, mentions (userId, label and position in the body), and for questions questionState (UNANSWERED, ANSWERED, RESOLVED) and resolvedAt. Anyone who can read it can list its comments.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"21dbfc4740a62df5\"},\n {\"mcpName\":\"list_documents\",\"commandPath\":[\"documents\",\"list\"],\"group\":\"document\",\"description\":\"List or search documents you can read, including ones shared with you individually. Without q it lists the documents directly in folderUuid (not its subfolders), otherwise in projectUuid, otherwise every document you can read in every project; only active documents (the trash is list_trash). With q it searches the document search index (mode=search; at most limit hits, default and maximum 50; with total), narrowed by projectUuid and by folderUuid including its subfolders. type filters by document type. Titles can repeat — compare folder and project and ask the user when several match. Read only. Returns documents, count and mode.\",\"inputSchema\":{\"properties\":{\"folderUuid\":{\"description\":\"Optional folder UUID. With q, searches this folder and the folders under it.\",\"type\":\"string\"},\"limit\":{\"description\":\"Result cap when q is set (default 50)\",\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"},\"q\":{\"description\":\"Optional full-text query. When provided, results come from the search index instead of folder listing.\",\"type\":\"string\"},\"type\":{\"description\":\"Optional document type filter. Readable values: erd, markdown, diagram, openapi, html, file, kanban.\",\"enum\":[\"erd\",\"markdown\",\"diagram\",\"openapi\",\"html\",\"file\",\"kanban\"],\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"0688eb9c73eeca85\"},\n {\"mcpName\":\"list_folders\",\"commandPath\":[\"folders\",\"list\"],\"group\":\"generic\",\"description\":\"List all active folders of one project as a flat list (uuid, id, name, parentFolderId, depth, displayOrder, app url); rebuild the tree from id and parentFolderId. Trashed folders are not included. Folder names can repeat — tell them apart by parent and ask the user when unsure. Needs read access to the whole project. Read only. Returns folders and count.\",\"inputSchema\":{\"properties\":{\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"projectUuid\"],\"type\":\"object\"},\"required\":[\"projectUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"b021246818866bac\"},\n {\"mcpName\":\"list_history\",\"commandPath\":[\"history\",\"list\"],\"group\":\"generic\",\"description\":\"List recent activity (who did what, people and agents) in a workspace, a project, or on one resource, newest first. Give at least one of workspaceUuid, projectUuid, or resourceType with resourceUuid; you need editor access or higher in that scope. This is a list to refresh, not a gap-free feed: to see what is new, read the first page again and skip ids you have already seen; to get each new notification exactly once use list_notifications. Each item has id, kind, at, lastAt, coalesceCount, actor, target (title and url only when you can read it now), changes and summary.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"actorType\":{\"description\":\"Only people (USER) or only agents (AGENT).\",\"enum\":[\"USER\",\"AGENT\"],\"type\":\"string\"},\"before\":{\"description\":\"nextCursor of the previous page (older items).\",\"type\":\"string\"},\"kinds\":{\"description\":\"Only these kinds.\",\"items\":{\"enum\":[\"COMMENT_MENTIONED\",\"COMMENT_REPLIED\",\"QUESTION_ANSWERED\",\"QUESTION_RESOLVED\",\"QUESTION_MENTIONED\",\"CARD_CREATED\",\"CARD_UPDATED\",\"CARD_ASSIGNED\",\"CARD_UNASSIGNED\",\"CARD_REQUESTER_SET\",\"CARD_ASSIGNMENT_ACCEPTED\",\"CARD_ASSIGNMENT_DECLINED\",\"CARD_STATUS_CHANGED\",\"CARD_REVIEW_REQUESTED\",\"CARD_CHANGES_REQUESTED\",\"CARD_APPROVED\",\"CARD_QUICK_DONE\",\"CARD_REOPENED\",\"CARD_BLOCKED\",\"CARD_UNBLOCKED\",\"CARD_ARCHIVED\",\"CARD_COMMENTED\"],\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"limit\":{\"description\":\"Items per call, default 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Activity in this project.\",\"type\":\"string\"},\"resourceType\":{\"description\":\"With resourceUuid: activity on one resource.\",\"enum\":[\"DOCUMENT\",\"PROJECT\",\"KANBAN_CARD\"],\"type\":\"string\"},\"resourceUuid\":{\"description\":\"UUID of the resource named by resourceType.\",\"type\":\"string\"},\"workspaceUuid\":{\"description\":\"Activity in this workspace.\",\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"9774a593c634070c\"},\n {\"mcpName\":\"list_mention_candidates\",\"commandPath\":[\"mention-candidates\",\"list\"],\"group\":\"generic\",\"description\":\"List the people you can mention in comments on a document or a kanban card (cardUuid): userId, displayName and jobTitle (null = not set) — jobTitle helps tell people with the same name apart. Only people who can read it are listed — for a card, the people who can read its board, which are also the people a card can be assigned to. To mention someone, write @<displayName> exactly in the comment body and pass their userId in mentionUserIds of create_comments or update_comments. Page with nextCursor while hasMore is true.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"cursor\":{\"description\":\"nextCursor from the previous page (same parent and query).\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"},\"limit\":{\"description\":\"Page size, 1..50. Defaults to 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"query\":{\"description\":\"Name filter, 0..100 characters. Omit or leave empty for the first page of everyone.\",\"maxLength\":100,\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"c06acebfee9d635a\"},\n {\"mcpName\":\"list_notifications\",\"commandPath\":[\"notifications\",\"list\"],\"group\":\"generic\",\"description\":\"Read new notifications for the signed-in user, oldest first and without gaps — for an agent that checks the inbox periodically. The server remembers, per connection and per filter (kinds, workspaceUuids, projectUuids, directOnly), how far you have acknowledged; a new filter starts from now. Each response carries ackToken: pass it as ack in your next call (with the same filter) after you have handled the batch — if you do not, the next call returns the same batch again (identify duplicates by id and seq; an item that comes back with a higher seq and a larger groupCount is an update of the same entry). Each item has id, seq, kind, at, summary (one line), actor, target (title and url only when you can read it now), action (what the user is asked to do) and humanRead. An item you can no longer read comes back as {id, seq, at, redacted: true}. This tool never marks anything read for the person (use mark_notifications_read when the user asks); open to-dos are in list_agent_todos. Calls closer than 30 seconds apart (except a call that carries ack) return retryAfterSeconds instead of items.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"ack\":{\"description\":\"The ackToken of the previous response. Send it with the same filter once you have handled (or safely stored) that batch; only then does the saved position move past it. Without it, the same batch is returned again.\",\"type\":\"string\"},\"cursor\":{\"description\":\"Where to read from. \\\"saved\\\" (default): after what this connection last acknowledged for this same filter. \\\"latest\\\": from now on (moves the saved position to now). \\\"earliest\\\": everything still kept (90 days). Or a nextCursor from a previous response: read after it without using or changing the saved position.\",\"type\":\"string\"},\"directOnly\":{\"description\":\"Only notifications that point at you directly (mentions, questions to you).\",\"type\":\"boolean\"},\"kinds\":{\"description\":\"Only these notification kinds.\",\"items\":{\"enum\":[\"COMMENT_MENTIONED\",\"COMMENT_REPLIED\",\"QUESTION_ANSWERED\",\"QUESTION_RESOLVED\",\"QUESTION_MENTIONED\",\"CARD_CREATED\",\"CARD_UPDATED\",\"CARD_ASSIGNED\",\"CARD_UNASSIGNED\",\"CARD_REQUESTER_SET\",\"CARD_ASSIGNMENT_ACCEPTED\",\"CARD_ASSIGNMENT_DECLINED\",\"CARD_STATUS_CHANGED\",\"CARD_REVIEW_REQUESTED\",\"CARD_CHANGES_REQUESTED\",\"CARD_APPROVED\",\"CARD_QUICK_DONE\",\"CARD_REOPENED\",\"CARD_BLOCKED\",\"CARD_UNBLOCKED\",\"CARD_ARCHIVED\",\"CARD_COMMENTED\"],\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"limit\":{\"description\":\"Items per call, default 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Older single-value form of projectUuids.\",\"type\":\"string\"},\"projectUuids\":{\"description\":\"Only notifications in any of these projects. Use it when the user names a project or the project you are working in is clear. With workspaceUuids too, both must match. A workspace or project you cannot see matches nothing.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"workspaceUuids\":{\"description\":\"Only notifications in any of these workspaces.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"015227aee445b6a7\"},\n {\"mcpName\":\"list_projects\",\"commandPath\":[\"projects\",\"list\"],\"group\":\"generic\",\"description\":\"Find projects you can open. With no arguments it lists every active project you can open, across all workspaces; workspaceUuid narrows it to one workspace (an unknown UUID gives an empty list). With q it searches the project search index instead (mode=search; at most limit hits, default and maximum 50; with total). Archived projects are never listed. Project names can repeat — compare workspaceId and ask the user when several match. Read only. Returns projects, count and mode.\",\"inputSchema\":{\"properties\":{\"limit\":{\"description\":\"Result cap when q is set (default 50)\",\"type\":\"integer\"},\"q\":{\"description\":\"Optional full-text query\",\"type\":\"string\"},\"workspaceUuid\":{\"description\":\"Optional Workspace UUID\",\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"4b6c8543d156b77b\"},\n {\"mcpName\":\"list_trash\",\"commandPath\":[\"trash\",\"list\"],\"group\":\"generic\",\"description\":\"List the documents in the trash across every project you can open as a whole (access through a single shared folder or file does not count): documents deleted with delete_documents or inside a trashed folder. Trashed folders, archived projects and archived workspaces are not listed here. Read only, no paging. Returns trashed (document rows: uuid, title, type, projectId, folderId) and count. unarchive_documents restores one; the server permanently deletes trashed documents once the trash retention period passes (30 days by default).\",\"inputSchema\":{\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"7dcdbf558ec22318\"},\n {\"mcpName\":\"list_versions\",\"commandPath\":[\"versions\",\"list\"],\"group\":\"generic\",\"description\":\"List a document's saved versions, newest first: versionNumber, versionType, title, changeSummary, createdBy, createdAt and locked. locked=true means the version is outside your plan's history window and cannot be opened or restored. get_version reads one and restore_versions rolls back. Read only; needs read access. Returns versions and count.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"520d624a2b239d37\"},\n {\"mcpName\":\"list_workspaces\",\"commandPath\":[\"workspaces\",\"list\"],\"group\":\"workspace\",\"description\":\"List the personal workspaces you own (active ones only). Workspaces that other people or a team share with you are not included — list_projects shows every project you can open (each row has workspaceId) and get_workspace reads one workspace. Read only. Returns workspaces (uuid, name, description, owner, revision) and count.\",\"inputSchema\":{\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"146a971a0e1986e2\"},\n {\"mcpName\":\"mark_notifications_read\",\"commandPath\":[\"tools\",\"run\",\"mark-notifications-read\"],\"group\":\"generic\",\"description\":\"Mark the signed-in user's notifications as read in the AiNecto inbox — the same read state as the web bell, so the unread badge goes down. Call it only when the user explicitly asks you to mark notifications read; reading or acknowledging notifications (list_notifications ack) does not do this. Pass the id and seq of each item as you received them. Results are per item: {id, ok: true, readAt, alreadyRead?} or {id, ok: false, error} with error one of STALE (the entry was updated after you saw it — it stays unread; seq is the current one), NOT_FOUND (not your notification, archived, or no such id), INVALID. unread is the user's unread count after the call (the number on the web bell, unreadCapped when above it). Only your own notifications. Retrying is safe. It does not close to-dos and does not acknowledge anything for list_notifications.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"items\":{\"description\":\"Notifications to mark read; each item is applied and reported on its own.\",\"items\":{\"additionalProperties\":false,\"properties\":{\"id\":{\"description\":\"Notification id from list_notifications or get_my_work_summary (mentionsToRead).\",\"type\":\"string\"},\"seq\":{\"description\":\"The seq of that same item as you received it. If the entry was updated after you saw it (higher seq), it stays unread and you get STALE.\",\"type\":\"integer\"}},\"required\":[\"id\",\"seq\"],\"type\":\"object\"},\"maxItems\":50,\"minItems\":1,\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"79076cb2c0562ccb\"},\n {\"mcpName\":\"markdown_append_document\",\"commandPath\":[\"markdown\",\"append-document\"],\"group\":\"markdown\",\"description\":\"Append text to the end of Markdown documents without resending the existing body; separator goes between the old body and the addition. The change is kept in version history (restore_versions can undo it). Needs edit access. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Returns appended (document rows) and count. Fails with 409 when the document is in the trash or its folder, project or workspace is archived. If the appended body is tens of KB or more, prefer request_upload_token (purpose=document.append) and upload the body with curl.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Appends\",\"items\":{\"properties\":{\"addition\":{\"description\":\"Body addition. 추가할 내용이 크면 (수십 KB 이상) LLM 토큰 절약을 위해 `request_upload_token (purpose=document.append, scopeJson={documentUuid, separator})` 로 uploadUrl 을 받고 curl 로 PUT 으로 보낼 것.\",\"type\":\"string\"},\"separator\":{\"description\":\"Separator between existing body and addition\",\"type\":\"string\"},\"uuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"addition\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"a03ed0662ffcd6e4\"},\n {\"mcpName\":\"markdown_generate_document\",\"commandPath\":[\"markdown\",\"generate-document\"],\"group\":\"markdown\",\"description\":\"Queue a Markdown generation request (status PENDING) for a separate worker that claims requests through AiNecto's AI request API. This tool does not generate text and does not change the document; to write content yourself use update_documents or markdown_append_document. The queued request keeps only prompt and context, not documentUuid, so put everything the worker needs in context. Needs edit access to the document and an AI credit balance above zero; queuing is rate-limited per user. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Returns queued (uuid, status, documentUuid) and count.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Generation requests\",\"items\":{\"properties\":{\"context\":{\"description\":\"Optional JSON context\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Target document UUID\",\"type\":\"string\"},\"prompt\":{\"description\":\"Generation prompt\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"prompt\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"822ac36c10f330d4\"},\n {\"mcpName\":\"move_documents\",\"commandPath\":[\"documents\",\"move\"],\"group\":\"document\",\"description\":\"Move documents to another folder, to a project's top level (empty newFolderUuid), or into another project — even in another workspace — with targetProjectUuid (targetWorkspaceUuid is only a check that must match that project's workspace). Attachments, including those on its comments, go with the document. Sharing inherited from the old folder or project stops applying and is reported in unlinkedInheritedShares; the destination's sharing applies instead. Confirm with the user before moving documents into another project or workspace. Needs edit access to each document and to the destination (and to the source project when leaving it); moving into a different storage quota can be refused. All-or-nothing: if any item fails, nothing moves. Sends no email or inbox notification. Returns moved (document rows), count, unlinkedInheritedShareCount and attachmentsReprojected.\",\"inputSchema\":{\"properties\":{\"clientMutationId\":{\"description\":\"Optional mutation identifier for client retry tracing\",\"maxLength\":128,\"minLength\":1,\"pattern\":\"^[\\\\x21-\\\\x7E]{1,128}$\",\"type\":\"string\"},\"items\":{\"description\":\"Moves\",\"items\":{\"properties\":{\"newFolderUuid\":{\"description\":\"New folder UUID — null/empty for root\",\"type\":\"string\"},\"targetProjectUuid\":{\"description\":\"Target project UUID — omit to stay in current project\",\"type\":\"string\"},\"targetWorkspaceUuid\":{\"description\":\"Guard only: must match targetProjectUuid workspace\",\"type\":\"string\"},\"uuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"c0ca210155b35be0\"},\n {\"mcpName\":\"move_folders\",\"commandPath\":[\"folders\",\"move\"],\"group\":\"generic\",\"description\":\"Move folders, with everything under them, under another folder of the same project, or to the project's top level when newParentFolderUuid is empty. Folders cannot move between projects (move_documents can move documents across projects). A folder cannot go under itself or its own subfolder, and the result must stay within 50 levels. Sharing inherited from the old parent folders stops applying and the new parents' sharing applies instead. Needs edit access to the folder and to the new parent. Targets are UUIDs only; names are never matched and may repeat. Look the UUID up first, and when more than one candidate fits what the user said, ask which one. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns moved (folder rows) and count.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Moves\",\"items\":{\"properties\":{\"newParentFolderUuid\":{\"description\":\"New parent UUID — null/empty for root\",\"type\":\"string\"},\"uuid\":{\"description\":\"Folder UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"95ee0d3da59ec301\"},\n {\"mcpName\":\"move_projects\",\"commandPath\":[\"projects\",\"move\"],\"group\":\"generic\",\"description\":\"Move projects, with all their folders, documents and attachments, into another workspace. This changes who can open them: people with access to the old workspace lose it, people with access to the target workspace gain it, and people given the project itself keep it. Public links stay as they were. Confirm with the user before moving a project into a team workspace. Needs edit access to the project and to the target workspace; moving to the workspace it is already in does nothing. Each item is tried on its own and the call does not stop at a failure: results reports each item as ok, or with status and error (409 when its projectKey is already used in the target workspace; the target's storage quota can also refuse). Sends no email or inbox notification. Returns results, movedCount and failedCount.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Moves\",\"items\":{\"properties\":{\"targetWorkspaceUuid\":{\"description\":\"Destination workspace UUID (you need write access there)\",\"type\":\"string\"},\"uuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"targetWorkspaceUuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"7b5a3ba9ab9e3079\"},\n {\"mcpName\":\"request_upload_token\",\"commandPath\":[\"tools\",\"run\",\"request-upload-token\"],\"group\":\"attachment\",\"description\":\"Use this for large payloads of tens of KB or more to save LLM tokens. purpose=mcp.call returns a short-lived bearer token that can call any MCP tool, including erd_apply_changes, via curl. purpose=document.create/update/append uploads document bodies directly to the upload endpoint with PUT/curl. Tokens are reusable for 5 minutes by default.\",\"inputSchema\":{\"properties\":{\"maxBytes\":{\"description\":\"최대 업로드 byte (서버 측 한도)\",\"type\":\"integer\"},\"purpose\":{\"description\":\"Token 용도. `mcp.call` 은 curl 로 /mcp 호출, `document.create/update/append` 는 PUT body 로 본문 업로드, `attachment.upload` 는 파일 bytes 업로드. 콘텐츠가 크면 (수십 KB 이상) LLM 토큰 절약을 위해 이 도구로 5분 재사용 토큰을 받고 curl 로 보내는 것을 강력 권장.\",\"enum\":[\"mcp.call\",\"document.create\",\"document.update\",\"document.append\",\"attachment.upload\"],\"type\":\"string\"},\"scopeJson\":{\"description\":\"선택 — JSON scope. document.create 는 projectUuid, type, title 을 포함하고 creatable type values 는 erd, markdown, diagram, openapi, html, file, kanban. document.update/document.append 는 documentUuid 를 포함. type=file 은 filename 도 포함(확장자로 형식 판정) — PUT 의 Content-Type 은 파일 MIME, 본문은 파일 바이트. attachment.upload: {documentUuid, filename}; storageKey 는 서버가 발급 scope 에 넣는다.\",\"type\":\"string\"},\"ttlSeconds\":{\"description\":\"TTL (초). 기본 300 (5분)\",\"type\":\"integer\"}},\"required\":[\"purpose\"],\"type\":\"object\"},\"required\":[\"purpose\"],\"payloadMode\":\"binary-upload\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"867c1e7105f1424b\"},\n {\"mcpName\":\"resolve_comments\",\"commandPath\":[\"tools\",\"run\",\"resolve-comments\"],\"group\":\"generic\",\"description\":\"Mark questions on a document or a kanban card (cardUuid) as resolved. Only top-level comments with kind QUESTION can be resolved, and it needs edit access to the document or board (readers can comment but cannot resolve). Resolving cannot be undone. Each id is applied on its own; results report each id.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"},\"ids\":{\"description\":\"Question ids to resolve (top-level comments with kind QUESTION)\",\"items\":{\"minimum\":1,\"type\":\"integer\"},\"minItems\":1,\"type\":\"array\"}},\"required\":[\"ids\"],\"type\":\"object\"},\"required\":[\"ids\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"d996f083fd9e6acf\"},\n {\"mcpName\":\"restore_versions\",\"commandPath\":[\"versions\",\"restore\"],\"group\":\"generic\",\"description\":\"Roll documents back to an earlier saved version (version numbers come from list_versions). The current content and title are replaced by that version's snapshot and a new version \\\"Restored from version N\\\" is recorded, so the history keeps everything and the rollback can itself be undone the same way. Tell the user which version you are restoring before calling. Needs edit access. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns restored (the new version rows, each with documentUuid) and count. Fails with 404 for an unknown document or version number, with a plan-limit error for a locked version (locked=true in list_versions), and with 409 when the document is in the trash or its folder, project or workspace is archived.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Restores\",\"items\":{\"properties\":{\"documentUuid\":{\"description\":\"Document UUID\",\"type\":\"string\"},\"versionNumber\":{\"description\":\"Version number to restore\",\"type\":\"integer\"}},\"required\":[\"documentUuid\",\"versionNumber\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"1af89081b6bc61cd\"},\n {\"mcpName\":\"search_documents\",\"commandPath\":[\"documents\",\"search\"],\"group\":\"document\",\"description\":\"Find documents you can read by keywords, people, folder and dates, when you have no link or exact title. Each hit has title, type, uuid, projectName, folderPath (\\\"Parent / Child\\\"), url, updatedAt and lastEditorName — enough to tell the user which document is which. Map the user's words to filters: \\\"edited today\\\" -> updatedFrom = today's date-time at local midnight with offset; \\\"last week\\\" -> updatedFrom/updatedTo; \\\"Ryan's\\\" or \\\"Ryan changed\\\" -> first get Ryan's userId from list_mention_candidates (or identity_get_self for \\\"me\\\"), then ownerUserId or lastEditorUserId; \\\"in the X folder\\\" -> folderUuid from list_folders. Keep only the topic words in q.\",\"inputSchema\":{\"properties\":{\"createdFrom\":{\"description\":\"ISO-8601: a date-time with offset (2026-10-21T00:00:00+09:00) or a date (2026-10-21 = that UTC day; use the offset form for a local day). Created at or after.\",\"type\":\"string\"},\"createdTo\":{\"description\":\"ISO-8601: a date-time with offset (2026-10-21T00:00:00+09:00) or a date (2026-10-21 = that UTC day; use the offset form for a local day). Created at or before (a date includes that whole day).\",\"type\":\"string\"},\"folderUuid\":{\"description\":\"Only documents in this folder or any folder under it.\",\"type\":\"string\"},\"lastEditorUserId\":{\"description\":\"Only documents whose latest saved version is by this user.\",\"type\":\"string\"},\"limit\":{\"description\":\"결과 개수 (기본 20, 최대 50)\",\"type\":\"integer\"},\"offset\":{\"description\":\"페이지네이션 offset (기본 0)\",\"type\":\"integer\"},\"ownerUserId\":{\"description\":\"Only documents owned by this user (the creator, unless ownership moved).\",\"type\":\"string\"},\"projectUuid\":{\"description\":\"Only documents in this project.\",\"type\":\"string\"},\"q\":{\"description\":\"Keywords in the title or body. Optional — omit to list by the filters alone, most recently updated first.\",\"type\":\"string\"},\"type\":{\"description\":\"Optional document type filter. Readable values: erd, markdown, diagram, openapi, html, file, kanban.\",\"enum\":[\"erd\",\"markdown\",\"diagram\",\"openapi\",\"html\",\"file\",\"kanban\"],\"type\":\"string\"},\"updatedFrom\":{\"description\":\"ISO-8601: a date-time with offset (2026-10-21T00:00:00+09:00) or a date (2026-10-21 = that UTC day; use the offset form for a local day). Last changed at or after.\",\"type\":\"string\"},\"updatedTo\":{\"description\":\"ISO-8601: a date-time with offset (2026-10-21T00:00:00+09:00) or a date (2026-10-21 = that UTC day; use the offset form for a local day). Last changed at or before (a date includes that whole day).\",\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"1dd5d57c10b6a2f7\"},\n {\"mcpName\":\"unarchive_documents\",\"commandPath\":[\"documents\",\"unarchive\"],\"group\":\"document\",\"description\":\"Restore documents from the trash (list_trash shows them) to where they were. A public link that was on opens again; direct sharing removed when the document was trashed does not come back. Needs edit access. A document that is not in the trash is returned unchanged. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns unarchived (document rows) and count. Fails with 409 when its folder, project or workspace is archived — restore the folder with unarchive_folders instead — and is refused when restoring would exceed the storage quota.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Document UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"fadb26ea6649079c\"},\n {\"mcpName\":\"unarchive_folders\",\"commandPath\":[\"folders\",\"unarchive\"],\"group\":\"generic\",\"description\":\"Restore trashed folders together with their whole subtree. Every trashed subfolder and document under the folder comes back — including documents that were trashed on their own before the folder was. Direct sharing removed at trash time does not come back. No tool lists trashed folders (list_trash lists documents only), so use the UUID from the earlier delete_folders call. Needs edit access to the folder. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns unarchived (folder rows) and count. Fails with 409 when a parent folder, the project or the workspace is archived (restore the parent first) and is refused when restoring would exceed the storage quota.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Folder UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"b5b618fa100be0f7\"},\n {\"mcpName\":\"unarchive_projects\",\"commandPath\":[\"projects\",\"unarchive\"],\"group\":\"generic\",\"description\":\"Restore archived projects so they are listed and editable again. Public links of documents inside open again if they were on; sharing removed at archive time does not come back. No tool lists archived projects, so use the UUID from the earlier delete_projects call. Needs edit access to the project, and its workspace must not be archived. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns unarchived (project rows) and count. Fails with 404 for an unknown UUID, 403 without access, and 409 when the workspace is archived.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Project UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"5d5b1029b0759182\"},\n {\"mcpName\":\"unarchive_workspaces\",\"commandPath\":[\"workspaces\",\"unarchive\"],\"group\":\"workspace\",\"description\":\"Restore archived workspaces so they and their projects are listed and usable again. No tool lists archived workspaces, so use the UUID from the earlier delete_workspaces call. Needs edit access to the workspace. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns unarchived (workspace rows) and count. Fails with 404 for an unknown UUID and 403 without access.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Workspace UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"prod\",\"schemaHash\":\"6cd85561c70e4bf5\"},\n {\"mcpName\":\"update_agent_todos\",\"commandPath\":[\"agent-todos\",\"update\"],\"group\":\"generic\",\"description\":\"Claim, renew, complete, release, or dismiss the signed-in user's agent to-dos. Only the session holding the current leaseToken may renew, release, or complete a claimed to-do — even another session of the same connection gets CLAIMED_BY_OTHER. Results are per item: {todoId, ok: true, state, leaseToken?, claimExpiresAt?} or {todoId, ok: false, error} with error one of CLAIMED_BY_OTHER, LEASE_LOST, ALREADY_DONE, CLOSED_BY_HUMAN, SUPERSEDED, ACCESS_LOST, BUSINESS_ACTION_REQUIRED, NOT_FOUND, INVALID — on CLOSED_BY_HUMAN or SUPERSEDED stop working on it. BUSINESS_ACTION_REQUIRED: card to-dos (CARD_*) cannot be completed here; doing the card action closes them. Retrying the same complete or dismiss returns ok again. To mark the person's notifications read (only when they ask), use mark_notifications_read.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"items\":{\"description\":\"To-dos to update; each item is applied and reported on its own.\",\"items\":{\"additionalProperties\":false,\"properties\":{\"action\":{\"description\":\"claim: take it (returns leaseToken, valid 30 minutes). renew: extend your lease. complete: done (with leaseToken if you claimed it; without one only while it is still OPEN). release: give it back. dismiss: not a to-do.\",\"enum\":[\"claim\",\"renew\",\"complete\",\"release\",\"dismiss\"],\"type\":\"string\"},\"leaseToken\":{\"description\":\"Required for renew and release, and for complete or dismiss of a to-do you claimed.\",\"type\":\"string\"},\"note\":{\"description\":\"For complete or dismiss: one line on what you did (at most 500 characters, no document bodies). The person sees it in the inbox.\",\"maxLength\":500,\"type\":\"string\"},\"todoId\":{\"description\":\"todoId from list_agent_todos.\",\"type\":\"string\"}},\"required\":[\"todoId\",\"action\"],\"type\":\"object\"},\"maxItems\":50,\"minItems\":1,\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"f304eb4450675a6d\"},\n {\"mcpName\":\"update_comments\",\"commandPath\":[\"comments\",\"update\"],\"group\":\"generic\",\"description\":\"Edit your own comments on a document or a kanban card (cardUuid). Only the author can edit, and only while they can still read it. A resolved question and a top-level comment that already has replies are locked. Items are applied in order and each one commits on its own; results report each item.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"},\"items\":{\"description\":\"Edits, applied in order\",\"items\":{\"additionalProperties\":false,\"properties\":{\"body\":{\"description\":\"New comment text (replaces the old text).\",\"maxLength\":10000,\"minLength\":1,\"type\":\"string\"},\"clientMutationId\":{\"description\":\"Idempotency key (visible ASCII, at most 128 characters). Required when mentionUserIds is not empty; reuse the same value when retrying the same item so the mention email is not sent twice.\",\"maxLength\":128,\"type\":\"string\"},\"id\":{\"description\":\"Comment id (from mcp__ainecto__list_comments)\",\"minimum\":1,\"type\":\"integer\"},\"mentionUserIds\":{\"description\":\"The complete set of userIds mentioned after the edit; omit to remove all mentions. Each one's @<displayName> must appear in body. Only people who were not mentioned before get a notification email.\",\"items\":{\"type\":\"string\"},\"maxItems\":20,\"type\":\"array\",\"uniqueItems\":true}},\"required\":[\"id\",\"body\"],\"type\":\"object\"},\"minItems\":1,\"type\":\"array\"},\"mailLanguage\":{\"description\":\"Language of the comment notification email (mention or reply). Defaults to en.\",\"enum\":[\"en\",\"ko\"],\"type\":\"string\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"a5bc050079e34361\"},\n {\"mcpName\":\"update_documents\",\"commandPath\":[\"documents\",\"update\"],\"group\":\"document\",\"description\":\"Update documents: the title and/or the whole body. A body you send replaces the current body entirely — it is not a patch, so read the document first and send the full new text. The document type decides the body field (see body and typePayload): file documents can only be renamed, ERD content changes through erd_apply_changes, diagram nodes and edges through diagram_apply_changes, and board documents are refused. Every body change is kept in version history, so list_versions and restore_versions can undo it. Needs edit access. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Returns updated (document rows) and count. Fails with 409 when the document is in the trash or its folder, project or workspace is archived. If a replacement body is tens of KB or more, prefer request_upload_token (purpose=document.update) and upload the body with curl.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Updates\",\"items\":{\"properties\":{\"body\":{\"description\":\"Deprecated compatibility alias for typePayload.body when document type is markdown. 본문이 수십 KB 이상으로 크면 LLM 토큰 절약을 위해 `request_upload_token (purpose=document.update)` 를 호출해 uploadUrl 을 받고 curl 로 직접 PUT 으로 보낼 것.\",\"type\":\"string\"},\"title\":{\"description\":\"New title\",\"type\":\"string\"},\"typePayload\":{\"description\":\"Type-specific payload for enabled document types. markdown: {body}; diagram: {diagramSource,sourceLanguage,edgeStyle,isModule,metadata}; openapi: {content}; html: {content} (a full HTML page); file: {file:{filename,contentType,sizeBytes,viewerKind}} (+content for text/CSV, first 64 KB); kanban: no body — only the title can be updated; cards are changed with kanban_apply_changes and kanban_card_action.\",\"type\":\"object\"},\"uuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"e6526c5177c9542c\"},\n {\"mcpName\":\"update_folders\",\"commandPath\":[\"folders\",\"update\"],\"group\":\"generic\",\"description\":\"Rename folders (only the name; move_folders moves them). Names do not have to be unique. Needs edit access to the folder. Targets are UUIDs only; names are never matched and may repeat. Look the UUID up first, and when more than one candidate fits what the user said, ask which one. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns updated (folder rows) and count. Fails with 404, 403, or 409 when the folder or a parent folder is archived.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Updates\",\"items\":{\"properties\":{\"name\":{\"description\":\"New name\",\"type\":\"string\"},\"uuid\":{\"description\":\"Folder UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"name\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"af4a8688a8d7f15c\"},\n {\"mcpName\":\"update_projects\",\"commandPath\":[\"projects\",\"update\"],\"group\":\"generic\",\"description\":\"Rename projects or change their description (projectKey cannot be changed here). Omitted fields stay as they are, a blank name is ignored, and description \\\"\\\" clears it. Names do not have to be unique. Needs admin or owner rights on the project. Targets are UUIDs only; names are never matched and may repeat. Look the UUID up first, and when more than one candidate fits what the user said, ask which one. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns updated (project rows) and count. Fails with 404 for an unknown UUID and 403 without rights or when the project or its workspace is archived.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Updates\",\"items\":{\"properties\":{\"description\":{\"description\":\"New description\",\"type\":\"string\"},\"name\":{\"description\":\"New name\",\"type\":\"string\"},\"uuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"6a097e4b164d2d97\"},\n {\"mcpName\":\"update_workspaces\",\"commandPath\":[\"workspaces\",\"update\"],\"group\":\"workspace\",\"description\":\"Rename workspaces or change their description. Omitted fields stay as they are, a blank name is ignored, and description \\\"\\\" clears it. Names do not have to be unique. Needs admin or owner rights. Targets are UUIDs only; names are never matched and may repeat. Look the UUID up first, and when more than one candidate fits what the user said, ask which one. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns updated (workspace rows) and count. Fails with 404 for an unknown UUID and 403 without rights or when the workspace is archived.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Updates\",\"items\":{\"properties\":{\"description\":{\"description\":\"New description\",\"type\":\"string\"},\"name\":{\"description\":\"New name\",\"type\":\"string\"},\"uuid\":{\"description\":\"Workspace UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"9c6228e9c2859ff5\"},\n {\"mcpName\":\"upload_attachments\",\"commandPath\":[\"tools\",\"run\",\"upload-attachments\"],\"group\":\"attachment\",\"description\":\"Register files you have already uploaded as attachments of documents. Steps: (1) request_upload_token with purpose=attachment.upload and {documentUuid, filename}; (2) PUT the file bytes with curl to the returned URL; (3) call this with the storageKey from step 1 — without step 2 it fails. sizeBytes, when given, must equal the uploaded size. A storageKey registers once (409 after that). Files over the server's attachment size limit or beyond the storage quota are refused, and the server decides the stored content type. File documents cannot take attachments. Needs edit access to the document. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns uploaded (attachment rows) and count.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Attachments to register\",\"items\":{\"properties\":{\"contentType\":{\"description\":\"MIME type\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Parent document UUID\",\"type\":\"string\"},\"filename\":{\"description\":\"Original file name\",\"type\":\"string\"},\"sizeBytes\":{\"description\":\"Size in bytes\",\"type\":\"integer\"},\"storageKey\":{\"description\":\"Storage key returned by request_upload_token purpose=attachment.upload\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"filename\",\"storageKey\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"binary-upload\",\"destructive\":false,\"sourceCatalog\":\"prod\",\"schemaHash\":\"adf49eddeae4a185\"},\n] satisfies GeneratedToolDefinition[];\n","import type { GeneratedToolDefinition } from \"./types\";\n\nexport const generatedTools = [\n {\"mcpName\":\"create_comments\",\"commandPath\":[\"comments\",\"create\"],\"group\":\"generic\",\"description\":\"Add comments, questions, or replies to a document or a kanban card (cardUuid). Anyone who can read it may comment and reply. Set parentCommentId to reply to a top-level comment. To mention people, get their userId and displayName from list_mention_candidates, write @<displayName> in the body, and list their userIds in mentionUserIds (clientMutationId is then required). Items are applied in order and each one commits on its own; results report each item (ok, or status and error).\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"},\"items\":{\"description\":\"Comments to add, applied in order\",\"items\":{\"additionalProperties\":false,\"properties\":{\"body\":{\"description\":\"Comment text (plain text, 1..10000 characters). To mention someone, include @<displayName> exactly as returned by mcp__ainecto__list_mention_candidates.\",\"maxLength\":10000,\"minLength\":1,\"type\":\"string\"},\"clientMutationId\":{\"description\":\"Idempotency key (visible ASCII, at most 128 characters). Required when mentionUserIds is not empty; reuse the same value when retrying the same item so the mention email is not sent twice.\",\"maxLength\":128,\"type\":\"string\"},\"kind\":{\"description\":\"COMMENT (default) or QUESTION. A reply (parentCommentId) is always COMMENT. A QUESTION can later be resolved with mcp__ainecto__resolve_comments.\",\"enum\":[\"COMMENT\",\"QUESTION\"],\"type\":\"string\"},\"mentionUserIds\":{\"description\":\"userIds to mention (from mcp__ainecto__list_mention_candidates). Each one's @<displayName> must appear in body; newly mentioned people get a notification email.\",\"items\":{\"type\":\"string\"},\"maxItems\":20,\"type\":\"array\",\"uniqueItems\":true},\"parentCommentId\":{\"description\":\"Reply to this top-level comment id (from mcp__ainecto__list_comments). Replies are one level deep: replying to a reply is rejected. The thread's original author and earlier repliers get a notification email (except people mentioned in this reply, who get the mention email instead).\",\"minimum\":1,\"type\":\"integer\"}},\"required\":[\"body\"],\"type\":\"object\"},\"minItems\":1,\"type\":\"array\"},\"mailLanguage\":{\"description\":\"Language of the comment notification email (mention or reply). Defaults to en.\",\"enum\":[\"en\",\"ko\"],\"type\":\"string\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"05ae6b9016969e09\"},\n {\"mcpName\":\"create_documents\",\"commandPath\":[\"documents\",\"create\"],\"group\":\"document\",\"description\":\"Create documents. projectUuid comes from list_projects (a workspace UUID is not a project UUID). Set shareEnabled to also turn on each document's public link and get its shareUrl in the same call. If a document body is tens of KB or more, prefer request_upload_token (purpose=document.create) and upload the body with curl.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Documents\",\"items\":{\"properties\":{\"body\":{\"description\":\"Deprecated compatibility alias for typePayload.body when document type is markdown. 본문이 수십 KB 이상으로 크면 LLM 토큰 절약을 위해 `request_upload_token (purpose=document.create)` 를 호출해 uploadUrl 을 받고 curl 로 직접 PUT 으로 보낼 것.\",\"type\":\"string\"},\"folderUuid\":{\"description\":\"Optional folder UUID\",\"type\":\"string\"},\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"},\"shareEnabled\":{\"description\":\"Optional. true turns on the document's public link right after creating it, exactly as enable_shares does (needs the right to manage sharing; types without a public page are refused). The created item then carries shareUrl, the page anyone can open. If sharing is refused, this item is not created.\",\"type\":\"boolean\"},\"title\":{\"description\":\"Document title\",\"type\":\"string\"},\"type\":{\"description\":\"Document type. Creatable values: erd, diagram, markdown, openapi, html, file, kanban.\",\"enum\":[\"erd\",\"diagram\",\"markdown\",\"openapi\",\"html\",\"file\",\"kanban\"],\"type\":\"string\"},\"typePayload\":{\"description\":\"Type-specific payload for enabled document types. markdown: {body}; diagram: {diagramSource,sourceLanguage,edgeStyle,isModule,metadata}; openapi: {content}; html: {content} (a full HTML page); file: no JSON payload — bytes go through request_upload_token(purpose=document.create, scopeJson={projectUuid,folderUuid?,type:\\\"file\\\",title,filename}) then one curl PUT (images·PDF·mp4/webm·audio·text/code·CSV only); kanban: no payload — creates an empty board; add cards with kanban_apply_changes.\",\"type\":\"object\"}},\"required\":[\"projectUuid\",\"type\",\"title\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"17f7fbd12ac1287a\"},\n {\"mcpName\":\"create_folders\",\"commandPath\":[\"folders\",\"create\"],\"group\":\"generic\",\"description\":\"Create folders in a project, at its top level or under parentFolderUuid (the parent must be in the same project). Folders nest up to 50 levels. Folder names do not have to be unique, even side by side, and every call creates new folders — check list_folders first so a retry does not make duplicates. Needs edit access to the project (and to the parent folder). Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns created (folder rows with uuid and app url) and count. Fails with 404, 403, or 409 when the project, its workspace or the parent folder is archived.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Folders\",\"items\":{\"properties\":{\"name\":{\"description\":\"Folder name\",\"type\":\"string\"},\"parentFolderUuid\":{\"description\":\"Parent folder UUID\",\"type\":\"string\"},\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"projectUuid\",\"name\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"0465182c723f2c9a\"},\n {\"mcpName\":\"create_projects\",\"commandPath\":[\"projects\",\"create\"],\"group\":\"generic\",\"description\":\"Create new, empty projects. workspaceUuid picks the workspace (you need edit access there); without it the project goes to your first personal workspace, which is created if you have none. projectKey is optional and must be unique within the workspace; project names do not have to be unique. Every call creates new projects, so check list_projects before retrying. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns created (project rows with uuid) and count. Fails with 403 without edit access, 409 when the workspace is archived, and an error when the projectKey is already used.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Projects\",\"items\":{\"properties\":{\"description\":{\"description\":\"Description\",\"type\":\"string\"},\"name\":{\"description\":\"Project name\",\"type\":\"string\"},\"projectKey\":{\"description\":\"Unique project key\",\"type\":\"string\"},\"workspaceUuid\":{\"description\":\"Workspace UUID — null uses user's default workspace\",\"type\":\"string\"}},\"required\":[\"name\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"020ed340ec243bdc\"},\n {\"mcpName\":\"create_workspaces\",\"commandPath\":[\"workspaces\",\"create\"],\"group\":\"workspace\",\"description\":\"Create new, empty personal workspaces owned by you (there is no limit on how many). Names do not have to be unique and every call creates new ones, so check list_workspaces before retrying. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns created (workspace rows with uuid) and count.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Workspaces\",\"items\":{\"properties\":{\"description\":{\"description\":\"Description\",\"type\":\"string\"},\"name\":{\"description\":\"Workspace name\",\"type\":\"string\"}},\"required\":[\"name\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"51d1cb14c1d99f9d\"},\n {\"mcpName\":\"delete_attachments\",\"commandPath\":[\"attachments\",\"delete\"],\"group\":\"attachment\",\"description\":\"Remove attachments. A removed attachment is hidden (archived) and no longer listed, and no tool brings it back — confirm with the user first. The file that is a file document's own content cannot be removed here; delete that document instead. Needs edit access to the document (or project) it is attached to. All-or-nothing: if any UUID fails (404 unknown, 403 no edit access, 409 already removed or file-document content), nothing is removed. Sends no email or inbox notification. Returns deleted (UUIDs) and count.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Attachment UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"6d88c71830e7e20d\"},\n {\"mcpName\":\"delete_comments\",\"commandPath\":[\"comments\",\"delete\"],\"group\":\"generic\",\"description\":\"Delete your own comments on a document or a kanban card (cardUuid). Only the author can delete. A resolved question and a top-level comment that still has replies cannot be deleted. Each id is applied on its own; results report each id.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"},\"ids\":{\"description\":\"Comment ids to delete (from mcp__ainecto__list_comments)\",\"items\":{\"minimum\":1,\"type\":\"integer\"},\"minItems\":1,\"type\":\"array\"}},\"required\":[\"ids\"],\"type\":\"object\"},\"required\":[\"ids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"082e4b4d9ba97fe0\"},\n {\"mcpName\":\"delete_documents\",\"commandPath\":[\"documents\",\"delete\"],\"group\":\"document\",\"description\":\"Move documents to the trash (soft delete) — this is not permanent deletion. A trashed document disappears from lists and its public link stops opening; people it was shared with directly lose that access, and restoring does not give it back. unarchive_documents restores a document and list_trash shows the trash. The server permanently deletes a trashed document once the trash retention period passes (30 days by default), and that cannot be undone. Needs delete rights on each document (editor or above). Confirm with the user before deleting anything they did not name explicitly. Targets are UUIDs only; names are never matched and may repeat. Look the UUID up first, and when more than one candidate fits what the user said, ask which one. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns deleted (UUIDs) and count. Fails with 404 for an unknown UUID, 403 without delete rights, and 409 when the document is already in the trash or its folder, project or workspace is archived.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Document UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"02aed6d05f52c25e\"},\n {\"mcpName\":\"delete_folders\",\"commandPath\":[\"folders\",\"delete\"],\"group\":\"generic\",\"description\":\"Move folders to the trash together with everything under them (subfolders and their documents) — soft delete, not permanent. People shared with the folder, its subfolders or those documents directly lose that access, and restoring does not give it back. unarchive_folders restores the whole subtree; the server permanently deletes trashed folders and documents once the trash retention period passes (30 days by default). Needs admin or owner rights on the folder. Always confirm with the user first and say how much is inside (list_documents with folderUuid). Targets are UUIDs only; names are never matched and may repeat. Look the UUID up first, and when more than one candidate fits what the user said, ask which one. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns deleted (UUIDs) and count. Fails with 404 for an unknown UUID, 403 without rights, and 409 when the folder or a parent folder is already archived.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Folder UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"80852f7e86a2d964\"},\n {\"mcpName\":\"delete_projects\",\"commandPath\":[\"projects\",\"delete\"],\"group\":\"generic\",\"description\":\"Archive projects. An archived project disappears from list_projects and nothing inside it can be read or edited; its documents are not moved to the trash and nothing is purged automatically. Archiving also removes every person's direct sharing on the project, its folders and its documents, and restoring does not give it back. Public links of documents inside stop opening while the project is archived. unarchive_projects is the matching restore tool. Needs admin or owner rights on the project. Always confirm with the user first (get_project shows the name and workspace). Targets are UUIDs only; names are never matched and may repeat. Look the UUID up first, and when more than one candidate fits what the user said, ask which one. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns deleted (UUIDs) and count. Fails with 404 for an unknown UUID, 403 without rights or when it is already archived, and 409 when its workspace is archived.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Project UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"32e582d68b72ab38\"},\n {\"mcpName\":\"delete_workspaces\",\"commandPath\":[\"workspaces\",\"delete\"],\"group\":\"workspace\",\"description\":\"Archive workspaces. An archived workspace disappears from list_workspaces, its projects disappear from list_projects, and nothing inside can be read or changed until it is restored with unarchive_workspaces. Nothing is purged and sharing is kept. Only the workspace owner can do this. Always confirm with the user first — it hides every project in the workspace for everyone. Targets are UUIDs only; names are never matched and may repeat. Look the UUID up first, and when more than one candidate fits what the user said, ask which one. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns deleted (UUIDs) and count. Fails with 404 for an unknown UUID and 403 when you are not the owner or it is already archived.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Workspace UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"e6ef72eaa0a1808b\"},\n {\"mcpName\":\"diagram_apply_changes\",\"commandPath\":[\"tools\",\"run\",\"diagram-apply-changes\"],\"group\":\"generic\",\"description\":\"Required single-call mutation path for diagram node/edge/group create/update/delete changes. Put nodes, edges, and groups in one request and call this once. Do not look for type-specific diagram CUD tools; this tool is the only diagram CUD entry point.\",\"inputSchema\":{\"properties\":{\"description\":{\"description\":\"Reason for batch (audit)\",\"type\":\"string\"},\"diagramUuid\":{\"description\":\"Diagram UUID\",\"type\":\"string\"},\"edges\":{\"description\":\"Edge operations\",\"items\":{\"properties\":{\"action\":{\"description\":\"Operation kind\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"bridgeType\":{\"description\":\"Omit (null) for a plain node-to-node edge. Set only when a group is an endpoint: GROUP_TO_GROUP|NODE_TO_GROUP|GROUP_TO_NODE\",\"enum\":[\"GROUP_TO_GROUP\",\"NODE_TO_GROUP\",\"GROUP_TO_NODE\"],\"type\":\"string\"},\"fromUuid\":{\"description\":\"Source\",\"type\":\"string\"},\"label\":{\"description\":\"Edge label\",\"type\":\"string\"},\"lineStyle\":{\"description\":\"Line style\",\"type\":\"string\"},\"strokeColor\":{\"description\":\"Stroke color\",\"type\":\"string\"},\"strokeWidth\":{\"description\":\"Stroke width\",\"type\":\"integer\"},\"toUuid\":{\"description\":\"Target\",\"type\":\"string\"},\"uuid\":{\"description\":\"Required for update/delete\",\"type\":\"string\"}},\"required\":[\"action\"],\"type\":\"object\"},\"type\":\"array\"},\"groups\":{\"description\":\"Group operations\",\"items\":{\"properties\":{\"action\":{\"description\":\"Operation kind\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"collapsed\":{\"description\":\"Collapsed state\",\"type\":\"boolean\"},\"color\":{\"description\":\"Group color\",\"type\":\"string\"},\"height\":{\"description\":\"Explicit height; omit to keep it derived from member nodes\",\"type\":\"number\"},\"linkMode\":{\"description\":\"Link mode\",\"type\":\"string\"},\"linkedDiagramUuid\":{\"description\":\"Linked diagram UUID\",\"type\":\"string\"},\"name\":{\"description\":\"Group name\",\"type\":\"string\"},\"parentGroupUuid\":{\"description\":\"Parent group UUID\",\"type\":\"string\"},\"sortOrder\":{\"description\":\"Sort order\",\"type\":\"integer\"},\"uuid\":{\"description\":\"Required for update/delete\",\"type\":\"string\"},\"width\":{\"description\":\"Explicit width; omit to keep it derived from member nodes\",\"type\":\"number\"}},\"required\":[\"action\"],\"type\":\"object\"},\"type\":\"array\"},\"nodes\":{\"description\":\"Node operations\",\"items\":{\"properties\":{\"action\":{\"description\":\"Operation kind\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"fillColor\":{\"description\":\"Fill color\",\"type\":\"string\"},\"groupUuid\":{\"description\":\"Group UUID; empty string clears membership\",\"type\":\"string\"},\"height\":{\"description\":\"Height\",\"type\":\"number\"},\"shape\":{\"description\":\"Node shape (start/end/diamond/cylinder/parallelogram/stadium/hexagon/rect/roundRect/...)\",\"enum\":[\"rect\",\"roundRect\",\"stadium\",\"diamond\",\"decision\",\"circle\",\"start\",\"doubleCircle\",\"end\",\"hexagon\",\"cylinder\",\"parallelogram\"],\"type\":\"string\"},\"strokeColor\":{\"description\":\"Stroke color\",\"type\":\"string\"},\"text\":{\"description\":\"Node text/label. Supports newlines (\\\\n) for multi-line display.\",\"maxLength\":4000,\"type\":\"string\"},\"textColor\":{\"description\":\"Text color\",\"type\":\"string\"},\"type\":{\"description\":\"Node type\",\"type\":\"string\"},\"uuid\":{\"description\":\"Required for update/delete; optional for create\",\"type\":\"string\"},\"width\":{\"description\":\"Width\",\"type\":\"number\"},\"x\":{\"description\":\"X\",\"type\":\"number\"},\"y\":{\"description\":\"Y\",\"type\":\"number\"}},\"required\":[\"action\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"diagramUuid\",\"description\"],\"type\":\"object\"},\"required\":[\"description\",\"diagramUuid\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"2c829103f86f4168\"},\n {\"mcpName\":\"diagram_get_edge\",\"commandPath\":[\"tools\",\"run\",\"diagram-get-edge\"],\"group\":\"generic\",\"description\":\"Read one diagram edge by its edge UUID (same fields as diagram_list_edges). Read only; needs read access to the diagram. Fails with 404 for an unknown edge.\",\"inputSchema\":{\"properties\":{\"edgeUuid\":{\"description\":\"Edge UUID\",\"type\":\"string\"}},\"required\":[\"edgeUuid\"],\"type\":\"object\"},\"required\":[\"edgeUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"4bb0bb9275b2fb08\"},\n {\"mcpName\":\"diagram_get_group\",\"commandPath\":[\"tools\",\"run\",\"diagram-get-group\"],\"group\":\"generic\",\"description\":\"Read one diagram group by its group UUID (same fields as diagram_list_groups). Read only; needs read access to the diagram. Fails with 404 for an unknown group.\",\"inputSchema\":{\"properties\":{\"groupUuid\":{\"description\":\"Group UUID\",\"type\":\"string\"}},\"required\":[\"groupUuid\"],\"type\":\"object\"},\"required\":[\"groupUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"e43aade91f62acd4\"},\n {\"mcpName\":\"diagram_get_node\",\"commandPath\":[\"tools\",\"run\",\"diagram-get-node\"],\"group\":\"generic\",\"description\":\"Read one diagram node by its node UUID (same fields as diagram_list_nodes). Read only; needs read access to the diagram. Fails with 404 for an unknown node.\",\"inputSchema\":{\"properties\":{\"nodeUuid\":{\"description\":\"Node UUID\",\"type\":\"string\"}},\"required\":[\"nodeUuid\"],\"type\":\"object\"},\"required\":[\"nodeUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"e610b158272290f0\"},\n {\"mcpName\":\"diagram_get_pending_llm_requests\",\"commandPath\":[\"tools\",\"run\",\"diagram-get-pending-llm-requests\"],\"group\":\"generic\",\"description\":\"List your own AI requests that are waiting (PENDING) or in progress (PROCESSING), for every service, not only diagrams: uuid, serviceCode, type, status, model and context. Read only — it does not claim anything; a request becomes PROCESSING only when a worker claims it through AiNecto's AI request API. Returns requests and count.\",\"inputSchema\":{\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"43305e4eee4eedc3\"},\n {\"mcpName\":\"diagram_list_edges\",\"commandPath\":[\"tools\",\"run\",\"diagram-list-edges\"],\"group\":\"generic\",\"description\":\"List every edge (connector) of one diagram document: uuid, fromUuid, toUuid, label, bridgeType, strokeColor, lineStyle, strokeWidth and version. Read only; needs read access to the diagram. Fails when diagramUuid is not a diagram document. Returns edges and count.\",\"inputSchema\":{\"properties\":{\"diagramUuid\":{\"description\":\"Diagram document UUID\",\"type\":\"string\"}},\"required\":[\"diagramUuid\"],\"type\":\"object\"},\"required\":[\"diagramUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"05a4ad6a05240c7d\"},\n {\"mcpName\":\"diagram_list_groups\",\"commandPath\":[\"tools\",\"run\",\"diagram-list-groups\"],\"group\":\"generic\",\"description\":\"List every group of one diagram document: uuid, name, color, width, height, parentGroupUuid, collapsed, depth, sortOrder, linkedDiagramUuid, linkMode and version. Nodes point to their group with groupUuid. Read only; needs read access to the diagram. Fails when diagramUuid is not a diagram document. Returns groups and count.\",\"inputSchema\":{\"properties\":{\"diagramUuid\":{\"description\":\"Diagram document UUID\",\"type\":\"string\"}},\"required\":[\"diagramUuid\"],\"type\":\"object\"},\"required\":[\"diagramUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"6b48ae81e69d19d0\"},\n {\"mcpName\":\"diagram_list_nodes\",\"commandPath\":[\"tools\",\"run\",\"diagram-list-nodes\"],\"group\":\"generic\",\"description\":\"List every node of one diagram document: uuid, type, text, shape, x, y, width, height, groupUuid, colors and version. diagram_apply_changes changes them. Read only; needs read access to the diagram. Fails when diagramUuid is not a diagram document. Returns nodes and count.\",\"inputSchema\":{\"properties\":{\"diagramUuid\":{\"description\":\"Diagram document UUID\",\"type\":\"string\"}},\"required\":[\"diagramUuid\"],\"type\":\"object\"},\"required\":[\"diagramUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"82df9dd409bbd9fd\"},\n {\"mcpName\":\"diagram_submit_llm_result\",\"commandPath\":[\"tools\",\"run\",\"diagram-submit-llm-result\"],\"group\":\"generic\",\"description\":\"Complete one of your AI requests that is PROCESSING by storing its result text and token counts; it becomes COMPLETED. This charges AI credits, calculated by the server from the token counts (creditsCharged is ignored). It only stores the result and does not change any diagram by itself. Fails for a request that is not yours, is not PROCESSING, or whose context names a diagram you cannot edit. Returns uuid, status and the recorded token counts.\",\"inputSchema\":{\"properties\":{\"cachedInputTokens\":{\"description\":\"Cached subset of provider total input tokens\",\"type\":\"integer\"},\"creditsCharged\":{\"description\":\"Deprecated; ignored. Credits are calculated server-side from tokens.\",\"type\":\"integer\"},\"inputTokens\":{\"description\":\"Provider total input tokens; Java persists uncached input after one normalization\",\"type\":\"integer\"},\"outputTokens\":{\"description\":\"Output token count\",\"type\":\"integer\"},\"result\":{\"description\":\"LLM result text\",\"type\":\"string\"},\"uuid\":{\"description\":\"LLM request UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"result\"],\"type\":\"object\"},\"required\":[\"result\",\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"9ee175de7c7b7c4b\"},\n {\"mcpName\":\"diagram_update_llm_request_status\",\"commandPath\":[\"tools\",\"run\",\"diagram-update-llm-request-status\"],\"group\":\"generic\",\"description\":\"Mark one of your AI requests FAILED (the only status allowed here), with an optional errorMessage. Works on PENDING or PROCESSING requests and charges no credits; diagram_submit_llm_result completes one instead. Fails for a request that is not yours, is already finished, or whose context names a diagram you cannot edit. Returns uuid, status and errorMessage.\",\"inputSchema\":{\"properties\":{\"errorMessage\":{\"description\":\"Error message (when status=FAILED)\",\"type\":\"string\"},\"status\":{\"description\":\"Target status — currently only FAILED is mutable from caller side\",\"enum\":[\"FAILED\"],\"type\":\"string\"},\"uuid\":{\"description\":\"LLM request UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"status\"],\"type\":\"object\"},\"required\":[\"status\",\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"4a360af781099e35\"},\n {\"mcpName\":\"disable_shares\",\"commandPath\":[\"tools\",\"run\",\"disable-shares\"],\"group\":\"generic\",\"description\":\"Turn public links off. For a document or project the link stops working at once and turning it on again later brings back the same link; for a folder the stored token is deleted. Sharing with specific people is not affected. Needs the same rights as enable_shares (document or project: admin or owner; folder: edit access). Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns disabled (rows) and count.\",\"inputSchema\":{\"properties\":{\"targetType\":{\"description\":\"Share target type\",\"enum\":[\"project\",\"folder\",\"document\"],\"type\":\"string\"},\"targetUuids\":{\"description\":\"Target UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"targetType\",\"targetUuids\"],\"type\":\"object\"},\"required\":[\"targetType\",\"targetUuids\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"3339f73817ba8432\"},\n {\"mcpName\":\"enable_shares\",\"commandPath\":[\"tools\",\"run\",\"enable-shares\"],\"group\":\"generic\",\"description\":\"Turn on public links: anyone with the link can open it without signing in, so confirm with the user before exposing anything. targetType document returns shareUrl (a public page) and publicApiPath; board documents have no public link (PUBLIC_SHARE_UNSUPPORTED_TYPE); needs admin or owner rights on the document. targetType project returns publicToken and a publicApiPath that reads the project and its documents through the public API — there is no public project page; needs admin or owner rights. targetType folder only stores a token that nothing public reads yet, so share the documents or the project instead; needs edit access. Re-enabling a document or project reuses its previous link. This does not invite or notify anyone — giving specific people access is done in the AiNecto app. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns enabled (rows with the link fields) and count.\",\"inputSchema\":{\"properties\":{\"targetType\":{\"description\":\"Share target type. A document gets a shareUrl anyone can open; a project gets a public API path only (there is no public project page); a folder token is stored but nothing public reads it yet.\",\"enum\":[\"project\",\"folder\",\"document\"],\"type\":\"string\"},\"targetUuids\":{\"description\":\"Target UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"targetType\",\"targetUuids\"],\"type\":\"object\"},\"required\":[\"targetType\",\"targetUuids\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"972a9386ae31088f\"},\n {\"mcpName\":\"erd_apply_changes\",\"commandPath\":[\"erd\",\"apply-changes\"],\"group\":\"erd\",\"description\":\"Required single-call mutation path for ERD create/update/delete changes. Put tables, columns, indexes, refs, enums, enum_values, and table groups in one operations array and call this once.\\nRules: (1) all data field names are snake_case; (2) for create, generate your own UUIDs and put them in data.uuid, then later operations in the same batch may reference those UUIDs without read-back calls; (3) enum values are separate enum_value operations, not inline on enum; (4) ref.relationship uses short dbdiagram-style symbols: >, <, or -; (5) ref_column operations map FK columns explicitly, never automatically.\\nDo not look for type-specific ERD CUD tools; this tool is the only ERD CUD entry point. If operations is very large, use request_upload_token with purpose=mcp.call and send the tools/call payload with curl to save LLM tokens.\\nOne-call worked example:\\n{\\n \\\"documentUuid\\\": \\\"erd-doc-uuid\\\",\\n \\\"description\\\": \\\"create users/posts ERD\\\",\\n \\\"operations\\\": [\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"table\\\",\\\"data\\\":{\\\"uuid\\\":\\\"tbl_users\\\",\\\"name\\\":\\\"users\\\",\\\"display_order\\\":1}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_users_id\\\",\\\"table_uuid\\\":\\\"tbl_users\\\",\\\"name\\\":\\\"id\\\",\\\"type\\\":\\\"bigint\\\",\\\"is_pk\\\":true,\\\"is_not_null\\\":true,\\\"display_order\\\":1}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_users_email\\\",\\\"table_uuid\\\":\\\"tbl_users\\\",\\\"name\\\":\\\"email\\\",\\\"type\\\":\\\"varchar(255)\\\",\\\"is_unique\\\":true,\\\"is_not_null\\\":true,\\\"display_order\\\":2}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"table\\\",\\\"data\\\":{\\\"uuid\\\":\\\"tbl_posts\\\",\\\"name\\\":\\\"posts\\\",\\\"display_order\\\":2}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_posts_id\\\",\\\"table_uuid\\\":\\\"tbl_posts\\\",\\\"name\\\":\\\"id\\\",\\\"type\\\":\\\"bigint\\\",\\\"is_pk\\\":true,\\\"is_not_null\\\":true,\\\"display_order\\\":1}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_posts_author_id\\\",\\\"table_uuid\\\":\\\"tbl_posts\\\",\\\"name\\\":\\\"author_id\\\",\\\"type\\\":\\\"bigint\\\",\\\"is_not_null\\\":true,\\\"display_order\\\":2}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"col_posts_status\\\",\\\"table_uuid\\\":\\\"tbl_posts\\\",\\\"name\\\":\\\"status\\\",\\\"type\\\":\\\"post_status\\\",\\\"is_not_null\\\":true,\\\"display_order\\\":3}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"enum\\\",\\\"data\\\":{\\\"uuid\\\":\\\"enum_post_status\\\",\\\"name\\\":\\\"post_status\\\"}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"enum_value\\\",\\\"data\\\":{\\\"uuid\\\":\\\"enum_post_status_draft\\\",\\\"enum_uuid\\\":\\\"enum_post_status\\\",\\\"value\\\":\\\"draft\\\",\\\"display_order\\\":1}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"enum_value\\\",\\\"data\\\":{\\\"uuid\\\":\\\"enum_post_status_published\\\",\\\"enum_uuid\\\":\\\"enum_post_status\\\",\\\"value\\\":\\\"published\\\",\\\"display_order\\\":2}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"ref\\\",\\\"data\\\":{\\\"uuid\\\":\\\"ref_posts_author\\\",\\\"name\\\":\\\"fk_posts_author\\\",\\\"from_table_uuid\\\":\\\"tbl_posts\\\",\\\"to_table_uuid\\\":\\\"tbl_users\\\",\\\"relationship\\\":\\\">\\\",\\\"on_delete\\\":\\\"cascade\\\"}},\\n {\\\"op\\\":\\\"create\\\",\\\"type\\\":\\\"ref_column\\\",\\\"data\\\":{\\\"uuid\\\":\\\"refcol_posts_author\\\",\\\"ref_uuid\\\":\\\"ref_posts_author\\\",\\\"from_column_uuid\\\":\\\"col_posts_author_id\\\",\\\"to_column_uuid\\\":\\\"col_users_id\\\",\\\"display_order\\\":1}}\\n ]\\n}\",\"inputSchema\":{\"properties\":{\"arrangeNewTables\":{\"description\":\"Whether to auto-place newly-created tables after the batch; defaults to true\",\"type\":\"boolean\"},\"description\":{\"description\":\"Reason for batch (audit)\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"operations\":{\"description\":\"Atomic create/update/delete operations\",\"items\":{\"description\":\"One ERD mutation. Use a single operations array with client-generated data.uuid values to create cross-referenced tables, columns, enums, refs, and ref_columns without read-back calls.\",\"discriminator\":{\"propertyName\":\"type\"},\"oneOf\":[{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table'.\",\"properties\":{\"alias\":{\"description\":\"Display alias.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"header_color\":{\"description\":\"Header color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"note\":{\"description\":\"Table note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"name\"],\"title\":\"table data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table'.\",\"properties\":{\"alias\":{\"description\":\"Display alias.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"header_color\":{\"description\":\"Header color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"note\":{\"description\":\"Table note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"table\",\"description\":\"Must be 'table' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"table operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='column'.\",\"properties\":{\"default_value\":{\"description\":\"Default value.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"is_increment\":{\"description\":\"Auto-increment flag.\",\"type\":\"boolean\"},\"is_not_null\":{\"description\":\"Not-null flag.\",\"type\":\"boolean\"},\"is_pk\":{\"description\":\"Primary key flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Column name.\",\"type\":\"string\"},\"note\":{\"description\":\"Column note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create; may be a data.uuid from an earlier table operation in this batch.\",\"type\":\"string\"},\"type\":{\"description\":\"SQL data type. Use this exact field name; do not send data_type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"table_uuid\"],\"title\":\"column data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='column'.\",\"properties\":{\"default_value\":{\"description\":\"Default value.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"is_increment\":{\"description\":\"Auto-increment flag.\",\"type\":\"boolean\"},\"is_not_null\":{\"description\":\"Not-null flag.\",\"type\":\"boolean\"},\"is_pk\":{\"description\":\"Primary key flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Column name.\",\"type\":\"string\"},\"note\":{\"description\":\"Column note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create; may be a data.uuid from an earlier table operation in this batch.\",\"type\":\"string\"},\"type\":{\"description\":\"SQL data type. Use this exact field name; do not send data_type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"column data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"column\",\"description\":\"Must be 'column' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"column operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='index'.\",\"properties\":{\"is_pk\":{\"description\":\"Primary key index flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique index flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Index name.\",\"type\":\"string\"},\"note\":{\"description\":\"Index note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create.\",\"type\":\"string\"},\"type\":{\"description\":\"Index type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"table_uuid\"],\"title\":\"index data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='index'.\",\"properties\":{\"is_pk\":{\"description\":\"Primary key index flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique index flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Index name.\",\"type\":\"string\"},\"note\":{\"description\":\"Index note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create.\",\"type\":\"string\"},\"type\":{\"description\":\"Index type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"index data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"index\",\"description\":\"Must be 'index' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"index operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='index_column'.\",\"properties\":{\"column_uuid\":{\"description\":\"Column UUID. Required for create.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"index_uuid\":{\"description\":\"Index UUID. Required for create.\",\"type\":\"string\"},\"sort_order\":{\"description\":\"Sort order, for example ASC or DESC.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"index_uuid\",\"column_uuid\"],\"title\":\"index_column data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='index_column'.\",\"properties\":{\"column_uuid\":{\"description\":\"Column UUID. Required for create.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"index_uuid\":{\"description\":\"Index UUID. Required for create.\",\"type\":\"string\"},\"sort_order\":{\"description\":\"Sort order, for example ASC or DESC.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"index_column data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"index_column\",\"description\":\"Must be 'index_column' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"index_column operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='ref'.\",\"properties\":{\"from_table_uuid\":{\"description\":\"Source table UUID. Required for create.\",\"type\":\"string\"},\"name\":{\"description\":\"Reference name.\",\"type\":\"string\"},\"on_delete\":{\"description\":\"ON DELETE action.\",\"type\":\"string\"},\"on_update\":{\"description\":\"ON UPDATE action.\",\"type\":\"string\"},\"relationship\":{\"description\":\"Required for create. Use short dbdiagram-style relationship symbols.\",\"enum\":[\">\",\"<\",\"-\"],\"type\":\"string\"},\"to_table_uuid\":{\"description\":\"Target table UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"from_table_uuid\",\"to_table_uuid\",\"relationship\"],\"title\":\"ref data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='ref'.\",\"properties\":{\"from_table_uuid\":{\"description\":\"Source table UUID. Required for create.\",\"type\":\"string\"},\"name\":{\"description\":\"Reference name.\",\"type\":\"string\"},\"on_delete\":{\"description\":\"ON DELETE action.\",\"type\":\"string\"},\"on_update\":{\"description\":\"ON UPDATE action.\",\"type\":\"string\"},\"relationship\":{\"description\":\"Required for create. Use short dbdiagram-style relationship symbols.\",\"enum\":[\">\",\"<\",\"-\"],\"type\":\"string\"},\"to_table_uuid\":{\"description\":\"Target table UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"ref data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"ref\",\"description\":\"Must be 'ref' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"ref operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='ref_column'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"from_column_uuid\":{\"description\":\"Source column UUID. Required for create.\",\"type\":\"string\"},\"ref_uuid\":{\"description\":\"Reference UUID. Required for create; may be a data.uuid from an earlier ref operation.\",\"type\":\"string\"},\"to_column_uuid\":{\"description\":\"Target column UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"ref_uuid\",\"from_column_uuid\",\"to_column_uuid\"],\"title\":\"ref_column data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='ref_column'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"from_column_uuid\":{\"description\":\"Source column UUID. Required for create.\",\"type\":\"string\"},\"ref_uuid\":{\"description\":\"Reference UUID. Required for create; may be a data.uuid from an earlier ref operation.\",\"type\":\"string\"},\"to_column_uuid\":{\"description\":\"Target column UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"ref_column data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"ref_column\",\"description\":\"Must be 'ref_column' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"ref_column operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='enum'.\",\"properties\":{\"name\":{\"description\":\"Enum name.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"enum data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='enum'.\",\"properties\":{\"name\":{\"description\":\"Enum name.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"enum data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"enum\",\"description\":\"Must be 'enum' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"enum operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='enum_value'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"enum_uuid\":{\"description\":\"Parent enum UUID. Required for create; may be a data.uuid from an earlier enum operation.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum value note.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"value\":{\"description\":\"Enum value. Inline enum values on enum are not persisted; create enum_value operations.\",\"type\":\"string\"}},\"required\":[\"enum_uuid\"],\"title\":\"enum_value data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='enum_value'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"enum_uuid\":{\"description\":\"Parent enum UUID. Required for create; may be a data.uuid from an earlier enum operation.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum value note.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"value\":{\"description\":\"Enum value. Inline enum values on enum are not persisted; create enum_value operations.\",\"type\":\"string\"}},\"title\":\"enum_value data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"enum_value\",\"description\":\"Must be 'enum_value' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"enum_value operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group'.\",\"properties\":{\"color\":{\"description\":\"Group color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table group name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group'.\",\"properties\":{\"color\":{\"description\":\"Group color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table group name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"table_group\",\"description\":\"Must be 'table_group' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"table_group operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group_table'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Table schema name.\",\"type\":\"string\"},\"table_name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"group_uuid\",\"table_name\"],\"title\":\"table_group_table data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group_table'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Table schema name.\",\"type\":\"string\"},\"table_name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group_table data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"table_group_table\",\"description\":\"Must be 'table_group_table' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"table_group_table operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group_note'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"note_uuid\":{\"description\":\"Note UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"required\":[\"group_uuid\",\"note_uuid\"],\"title\":\"table_group_note data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='table_group_note'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"note_uuid\":{\"description\":\"Note UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group_note data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"table_group_note\",\"description\":\"Must be 'table_group_note' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"table_group_note operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='filter'.\",\"properties\":{\"included_tables\":{\"description\":\"JSON string/list of included tables.\",\"type\":\"string\"},\"is_default\":{\"description\":\"Default filter flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Filter name.\",\"type\":\"string\"},\"table_groups\":{\"description\":\"JSON string/object of table groups.\",\"type\":\"string\"},\"table_positions\":{\"description\":\"JSON string/object of table positions.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"filter data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='filter'.\",\"properties\":{\"included_tables\":{\"description\":\"JSON string/list of included tables.\",\"type\":\"string\"},\"is_default\":{\"description\":\"Default filter flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Filter name.\",\"type\":\"string\"},\"table_groups\":{\"description\":\"JSON string/object of table groups.\",\"type\":\"string\"},\"table_positions\":{\"description\":\"JSON string/object of table positions.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"filter data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"filter\",\"description\":\"Must be 'filter' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"filter operation\",\"type\":\"object\"},{\"allOf\":[{\"if\":{\"properties\":{\"op\":{\"const\":\"create\",\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{\"data\":{\"description\":\"Payload for operation.type='note'.\",\"properties\":{\"color\":{\"description\":\"Note color.\",\"type\":\"string\"},\"content\":{\"description\":\"Note content.\",\"type\":\"string\"},\"height\":{\"description\":\"Height.\",\"type\":\"integer\"},\"icon_name\":{\"description\":\"Icon name.\",\"type\":\"string\"},\"position_x\":{\"description\":\"X position.\",\"type\":\"integer\"},\"position_y\":{\"description\":\"Y position.\",\"type\":\"integer\"},\"title\":{\"description\":\"Note title.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"width\":{\"description\":\"Width.\",\"type\":\"integer\"}},\"title\":\"note data\",\"type\":\"object\"}},\"required\":[\"data\"],\"type\":\"object\"}},{\"if\":{\"properties\":{\"op\":{\"enum\":[\"update\",\"delete\"],\"type\":\"string\"}},\"required\":[\"op\"],\"type\":\"object\"},\"then\":{\"properties\":{},\"required\":[\"uuid\"],\"type\":\"object\"}}],\"properties\":{\"data\":{\"description\":\"Payload for operation.type='note'.\",\"properties\":{\"color\":{\"description\":\"Note color.\",\"type\":\"string\"},\"content\":{\"description\":\"Note content.\",\"type\":\"string\"},\"height\":{\"description\":\"Height.\",\"type\":\"integer\"},\"icon_name\":{\"description\":\"Icon name.\",\"type\":\"string\"},\"position_x\":{\"description\":\"X position.\",\"type\":\"integer\"},\"position_y\":{\"description\":\"Y position.\",\"type\":\"integer\"},\"title\":{\"description\":\"Note title.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"width\":{\"description\":\"Width.\",\"type\":\"integer\"}},\"title\":\"note data\",\"type\":\"object\"},\"op\":{\"description\":\"Operation\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"const\":\"note\",\"description\":\"Must be 'note' for this payload.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"title\":\"note operation\",\"type\":\"object\"}],\"properties\":{\"data\":{\"description\":\"Type-specific payload. All field names are snake_case. For create, data.uuid may be client-supplied and referenced by later operations in the same batch.\",\"oneOf\":[{\"description\":\"Payload for operation.type='table'.\",\"properties\":{\"alias\":{\"description\":\"Display alias.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"header_color\":{\"description\":\"Header color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"note\":{\"description\":\"Table note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='column'.\",\"properties\":{\"default_value\":{\"description\":\"Default value.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"is_increment\":{\"description\":\"Auto-increment flag.\",\"type\":\"boolean\"},\"is_not_null\":{\"description\":\"Not-null flag.\",\"type\":\"boolean\"},\"is_pk\":{\"description\":\"Primary key flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Column name.\",\"type\":\"string\"},\"note\":{\"description\":\"Column note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create; may be a data.uuid from an earlier table operation in this batch.\",\"type\":\"string\"},\"type\":{\"description\":\"SQL data type. Use this exact field name; do not send data_type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"column data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='index'.\",\"properties\":{\"is_pk\":{\"description\":\"Primary key index flag.\",\"type\":\"boolean\"},\"is_unique\":{\"description\":\"Unique index flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Index name.\",\"type\":\"string\"},\"note\":{\"description\":\"Index note.\",\"type\":\"string\"},\"table_uuid\":{\"description\":\"Parent table UUID. Required for create.\",\"type\":\"string\"},\"type\":{\"description\":\"Index type.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"index data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='index_column'.\",\"properties\":{\"column_uuid\":{\"description\":\"Column UUID. Required for create.\",\"type\":\"string\"},\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"index_uuid\":{\"description\":\"Index UUID. Required for create.\",\"type\":\"string\"},\"sort_order\":{\"description\":\"Sort order, for example ASC or DESC.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"index_column data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='ref'.\",\"properties\":{\"from_table_uuid\":{\"description\":\"Source table UUID. Required for create.\",\"type\":\"string\"},\"name\":{\"description\":\"Reference name.\",\"type\":\"string\"},\"on_delete\":{\"description\":\"ON DELETE action.\",\"type\":\"string\"},\"on_update\":{\"description\":\"ON UPDATE action.\",\"type\":\"string\"},\"relationship\":{\"description\":\"Required for create. Use short dbdiagram-style relationship symbols.\",\"enum\":[\">\",\"<\",\"-\"],\"type\":\"string\"},\"to_table_uuid\":{\"description\":\"Target table UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"ref data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='ref_column'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"from_column_uuid\":{\"description\":\"Source column UUID. Required for create.\",\"type\":\"string\"},\"ref_uuid\":{\"description\":\"Reference UUID. Required for create; may be a data.uuid from an earlier ref operation.\",\"type\":\"string\"},\"to_column_uuid\":{\"description\":\"Target column UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"ref_column data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='enum'.\",\"properties\":{\"name\":{\"description\":\"Enum name.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum note.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Schema name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"enum data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='enum_value'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"enum_uuid\":{\"description\":\"Parent enum UUID. Required for create; may be a data.uuid from an earlier enum operation.\",\"type\":\"string\"},\"note\":{\"description\":\"Enum value note.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"value\":{\"description\":\"Enum value. Inline enum values on enum are not persisted; create enum_value operations.\",\"type\":\"string\"}},\"title\":\"enum_value data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='table_group'.\",\"properties\":{\"color\":{\"description\":\"Group color.\",\"type\":\"string\"},\"name\":{\"description\":\"Table group name.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='table_group_table'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"schema_name\":{\"description\":\"Table schema name.\",\"type\":\"string\"},\"table_name\":{\"description\":\"Table name. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group_table data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='table_group_note'.\",\"properties\":{\"display_order\":{\"description\":\"Display order.\",\"type\":\"integer\"},\"group_uuid\":{\"description\":\"Table group UUID. Required for create.\",\"type\":\"string\"},\"note_uuid\":{\"description\":\"Note UUID. Required for create.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"table_group_note data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='filter'.\",\"properties\":{\"included_tables\":{\"description\":\"JSON string/list of included tables.\",\"type\":\"string\"},\"is_default\":{\"description\":\"Default filter flag.\",\"type\":\"boolean\"},\"name\":{\"description\":\"Filter name.\",\"type\":\"string\"},\"table_groups\":{\"description\":\"JSON string/object of table groups.\",\"type\":\"string\"},\"table_positions\":{\"description\":\"JSON string/object of table positions.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"}},\"title\":\"filter data\",\"type\":\"object\"},{\"description\":\"Payload for operation.type='note'.\",\"properties\":{\"color\":{\"description\":\"Note color.\",\"type\":\"string\"},\"content\":{\"description\":\"Note content.\",\"type\":\"string\"},\"height\":{\"description\":\"Height.\",\"type\":\"integer\"},\"icon_name\":{\"description\":\"Icon name.\",\"type\":\"string\"},\"position_x\":{\"description\":\"X position.\",\"type\":\"integer\"},\"position_y\":{\"description\":\"Y position.\",\"type\":\"integer\"},\"title\":{\"description\":\"Note title.\",\"type\":\"string\"},\"uuid\":{\"description\":\"Optional on create: client-generated UUID (at most 36 characters, e.g. a standard UUID v4). If supplied, later operations in the same batch can reference it. Do not put create UUIDs in operation.uuid; operation.uuid is only the update/delete target.\",\"maxLength\":36,\"type\":\"string\"},\"width\":{\"description\":\"Width.\",\"type\":\"integer\"}},\"title\":\"note data\",\"type\":\"object\"}],\"type\":\"object\"},\"op\":{\"description\":\"Operation. For create, put any new UUID in data.uuid; for update/delete, put target UUID in operation.uuid.\",\"enum\":[\"create\",\"update\",\"delete\"],\"type\":\"string\"},\"type\":{\"description\":\"ERD entity type. This selects the operation.data shape.\",\"enum\":[\"table\",\"column\",\"index\",\"index_column\",\"ref\",\"ref_column\",\"enum\",\"enum_value\",\"table_group\",\"table_group_table\",\"table_group_note\",\"filter\",\"note\"],\"type\":\"string\"},\"uuid\":{\"description\":\"Target UUID for update/delete. Do not use this for create; use data.uuid instead.\",\"type\":\"string\"}},\"required\":[\"op\",\"type\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"documentUuid\",\"description\",\"operations\"],\"type\":\"object\"},\"required\":[\"description\",\"documentUuid\",\"operations\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"87f5bcf5a253815a\"},\n {\"mcpName\":\"erd_arrange_tables\",\"commandPath\":[\"erd\",\"arrange-tables\"],\"group\":\"erd\",\"description\":\"Arrange ERD tables after edits. Default incremental mode places newly-created tables while preserving existing positions; full=true re-layouts the entire diagram. Use after several separate table edits to tidy the canvas.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"full\":{\"description\":\"Re-layout the ENTIRE diagram (overwrites existing positions). Default false = arrange only newly-added (uncoordinated) tables to the top-right while preserving existing table positions. Call this after creating several tables to tidy them up.\",\"type\":\"boolean\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"651fd0d54e3635ff\"},\n {\"mcpName\":\"erd_get_enum\",\"commandPath\":[\"erd\",\"get-enum\"],\"group\":\"erd\",\"description\":\"Read one ERD enum with its values (uuid, value, note, displayOrder). Read only; needs read access. Fails with 404 for an unknown UUID, 403 without access, and an error when documentUuid is not an ERD document, or when the enum belongs to a different ERD document.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"enumUuid\":{\"description\":\"Enum UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"enumUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"enumUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"ae536a31eb604f3a\"},\n {\"mcpName\":\"erd_get_ref\",\"commandPath\":[\"erd\",\"get-ref\"],\"group\":\"erd\",\"description\":\"Read one ERD relationship with its column pairs (fromColumnUuid to toColumnUuid, displayOrder). Read only; needs read access. Fails with 404 for an unknown UUID, 403 without access, and an error when documentUuid is not an ERD document, or when the relationship belongs to a different ERD document.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"refUuid\":{\"description\":\"Relationship UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"refUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"refUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"e71d40552c0df42e\"},\n {\"mcpName\":\"erd_get_table\",\"commandPath\":[\"erd\",\"get-table\"],\"group\":\"erd\",\"description\":\"Get one ERD table with nested columns and indexes. Returns persistent table/column/index UUIDs usable directly as erd_apply_changes update/delete targets and ref_column column references. Column fields use apply_changes snake_case names: uuid, table_uuid, name, type, is_pk, is_unique, is_not_null, is_increment, default_value, note, display_order. Index fields include uuid, name, columns (column UUIDs), is_unique, is_pk, type.\",\"inputSchema\":{\"description\":\"Get one ERD table with nested columns and indexes. Returns persistent table/column/index UUIDs usable directly as mcp__ainecto__erd_apply_changes update/delete targets and ref_column column references. Column fields use apply_changes snake_case names: uuid, table_uuid, name, type, is_pk, is_unique, is_not_null, is_increment, default_value, note, display_order. Index fields include uuid, name, columns (column UUIDs), is_unique, is_pk, type.\",\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"tableUuid\":{\"description\":\"Table UUID. Response includes columns[] and indexes[] with persistent UUIDs for apply_changes.\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"tableUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"tableUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"0dc13648bf3fbf8f\"},\n {\"mcpName\":\"erd_get_table_group\",\"commandPath\":[\"erd\",\"get-table-group\"],\"group\":\"erd\",\"description\":\"Read one ERD table group: uuid, name, color and noteUuids. Read only; needs read access. Fails with 404 for an unknown UUID, 403 without access, and an error when documentUuid is not an ERD document, or when the group belongs to a different ERD document.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"},\"tableGroupUuid\":{\"description\":\"Table group UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"tableGroupUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"tableGroupUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"ed949fa7ca0884b2\"},\n {\"mcpName\":\"erd_list_enums\",\"commandPath\":[\"erd\",\"list-enums\"],\"group\":\"erd\",\"description\":\"List the enums of one ERD document: uuid, name, schemaName and note. Values are not included — erd_get_enum reads them. Read only; needs read access. Fails with 404 for an unknown UUID, 403 without access, and an error when documentUuid is not an ERD document. Returns enums and count.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"ea76585e1cca3997\"},\n {\"mcpName\":\"erd_list_refs\",\"commandPath\":[\"erd\",\"list-refs\"],\"group\":\"erd\",\"description\":\"List the relationships (foreign-key refs) of one ERD document: uuid, name, fromTableUuid, toTableUuid, relationship (>, < or -), onDelete and onUpdate. Column pairs are not included — erd_get_ref reads them. Read only; needs read access. Fails with 404 for an unknown UUID, 403 without access, and an error when documentUuid is not an ERD document. Returns refs and count.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"2292c8caf4fc5c25\"},\n {\"mcpName\":\"erd_list_table_groups\",\"commandPath\":[\"erd\",\"list-table-groups\"],\"group\":\"erd\",\"description\":\"List the table groups of one ERD document: uuid, name, color and noteUuids (the notes in the group). Read only; needs read access. Fails with 404 for an unknown UUID, 403 without access, and an error when documentUuid is not an ERD document. Returns tableGroups and count.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"4c910d38ca4bfc82\"},\n {\"mcpName\":\"erd_list_tables\",\"commandPath\":[\"erd\",\"list-tables\"],\"group\":\"erd\",\"description\":\"List the tables of one ERD document: uuid, name, schemaName, alias, note, headerColor and displayOrder. Columns and indexes are not included — erd_get_table reads them. Read only; needs read access. Fails with 404 for an unknown UUID, 403 without access, and an error when documentUuid is not an ERD document. Returns tables and count.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"ERD document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"e9aed0d47d33c169\"},\n {\"mcpName\":\"get_attachment\",\"commandPath\":[\"attachment\",\"get\"],\"group\":\"attachment\",\"description\":\"Read one attachment's metadata by UUID: filename, contentType, sizeBytes, parent, uploadedBy, archived. It does not return the file contents or a download link. Needs read access to the whole project. Read only. Fails with 404 for an unknown UUID and 403 without access.\",\"inputSchema\":{\"properties\":{\"uuid\":{\"description\":\"Attachment UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"required\":[\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"f7ff5a989c9ef3b9\"},\n {\"mcpName\":\"get_document\",\"commandPath\":[\"document\",\"get\"],\"group\":\"document\",\"description\":\"Read a document. The body comes back for the types whose create/update take one: markdown → content; openapi → content (the spec text) + format/specVersion/pathCount/operationCount; html → content (the HTML text); file → file {filename, contentType, sizeBytes, viewerKind} + content for text/CSV (first 64 KB); diagram → diagramSource/sourceLanguage/edgeStyle/isModule/metadata; kanban → board {viewer, columns: each column's first 20 cards + hasMore} (more cards and card details via kanban_list_cards); erd → metadata only (read tables/refs via erd_list_*).\",\"inputSchema\":{\"properties\":{\"uuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"required\":[\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"5c8e9d305fc15c1f\"},\n {\"mcpName\":\"get_my_work_summary\",\"commandPath\":[\"my-work-summary\",\"get\"],\"group\":\"generic\",\"description\":\"One-call summary of what is waiting for the signed-in user in AiNecto — call it when the user asks things like \\\"do I have anything to do?\\\", \\\"anything new?\\\", \\\"anything to review?\\\" or \\\"did anyone ask me something?\\\". Returns notifications {unread (not yet read by the person — the same read state as the web bell, so reading on the web lowers it at once; newest 100 counted; unreadCapped when there are more; the same number as the line at the end of tool results), unreadByKind}, mentionsToRead {items the person has not read that mention them, each with target title and url}, and todos {open (stays until the to-do is done or closed; the to-dos on that line), leaseExpired, inProgress, items: questions and requests waiting for the user's agent} and cards {kanban cards assigned to the user on boards they can read now: assignedOpen, pendingAcceptance (assigned but not yet accepted or declined), inProgress, inReview, blocked, items: the first page}. For details use list_notifications, list_agent_todos and kanban_list_cards; to read the document and its comments use get_document with the target uuid. Read-only: nothing is marked read or acknowledged.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"projectUuid\":{\"description\":\"Older single-value form of projectUuids.\",\"type\":\"string\"},\"projectUuids\":{\"description\":\"Only items in any of these projects. Use it when the user names a project or the project you are working in is clear. With workspaceUuids too, both must match. A workspace or project you cannot see matches nothing.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"workspaceUuids\":{\"description\":\"Only items in any of these workspaces.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"bcb546e954f81945\"},\n {\"mcpName\":\"get_project\",\"commandPath\":[\"project\",\"get\"],\"group\":\"generic\",\"description\":\"Read one project by UUID: name, projectKey, description, workspaceId, publicReadable and publicToken, archived and revision. Read only. Fails with 404 for an unknown UUID and 403 when you cannot open the whole project or it is archived.\",\"inputSchema\":{\"properties\":{\"uuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"required\":[\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"f4ec896c20a1f99f\"},\n {\"mcpName\":\"get_version\",\"commandPath\":[\"version\",\"get\"],\"group\":\"generic\",\"description\":\"Read one saved version of a document, including snapshotJson — the full saved content in that document type's stored format. Read only; needs read access. Fails with 404 for an unknown version number and with a plan-limit error for a locked version (see list_versions).\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"Document UUID\",\"type\":\"string\"},\"versionNumber\":{\"description\":\"Version number\",\"type\":\"integer\"}},\"required\":[\"documentUuid\",\"versionNumber\"],\"type\":\"object\"},\"required\":[\"documentUuid\",\"versionNumber\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"d80e338a03804261\"},\n {\"mcpName\":\"get_workspace\",\"commandPath\":[\"workspace\",\"get\"],\"group\":\"workspace\",\"description\":\"Read one workspace by UUID: name, description, owner, archived and revision. Works for any workspace you can see, including one where you were only given a project. Read only. Fails with 404 for an unknown UUID and 403 when you have no access or the workspace is archived.\",\"inputSchema\":{\"properties\":{\"uuid\":{\"description\":\"Workspace UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"required\":[\"uuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"8bc1d78109480495\"},\n {\"mcpName\":\"identity_get_self\",\"commandPath\":[\"tools\",\"run\",\"identity-get-self\"],\"group\":\"generic\",\"description\":\"Return the authenticated MCP caller identity summary: userId, display name, and job profile (the user's job title and areas — personal context only, it never changes what they may do). Never returns email or token claims.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"2298c704e1563bdb\"},\n {\"mcpName\":\"identity_list_job_roles\",\"commandPath\":[\"tools\",\"run\",\"identity-list-job-roles\"],\"group\":\"generic\",\"description\":\"List the job roles the signed-in user can pick for their own job profile — the same list as the account settings screen: roles {code, title, family}, families, areas {code, title}, suggested role codes, customCode (pick it to type a title that is not in the list) and titleMaxLength. Use the codes with identity_update_job_profile. A job profile is personal context only; it never changes what the user may do.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"59a20e90a49eb02d\"},\n {\"mcpName\":\"identity_update_job_profile\",\"commandPath\":[\"tools\",\"run\",\"identity-update-job-profile\"],\"group\":\"generic\",\"description\":\"Set the signed-in user's own job profile (job role and areas) — the same setting as the account settings screen. It only ever changes the caller's own profile. Pick code and areas from identity_list_job_roles; pass null as code to clear it. Returns the saved jobProfile in the same shape as identity_get_self (null when cleared). Invalid values fail with INVALID_JOB_PROFILE and change nothing. A job profile is personal context only; it never changes what the user may do.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"areas\":{\"description\":\"Area codes from identity_list_job_roles; the first is the primary area. At least one with the custom code, optional for a listed role. Each area once.\",\"items\":{\"description\":\"Area code.\",\"type\":\"string\"},\"type\":\"array\"},\"code\":{\"description\":\"Job role code from identity_list_job_roles, or its customCode to type your own title. null clears the job profile.\",\"type\":[\"string\",\"null\"]},\"title\":{\"description\":\"The role title in the user's own words — required with the custom code, ignored for a listed role (its title comes from the list).\",\"type\":\"string\"}},\"required\":[\"code\"],\"type\":\"object\"},\"required\":[\"code\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"de9d5d59fcddfa45\"},\n {\"mcpName\":\"kanban_apply_changes\",\"commandPath\":[\"kanban\",\"apply-changes\"],\"group\":\"kanban\",\"description\":\"Create, edit, reorder and link cards on one kanban board in a single atomic call (at most 100 operations; if one fails nothing is applied and the error carries operationIndex and code). Creating and editing cards needs edit access to the board; move with toBoardUuid moves a card to another board of the same project. The assignee may also check acceptance criteria and add result links (DELIVERABLE, REVIEW_RESULT, TEST_EVIDENCE). create also sets assignee, requester, reviewers and watchers in the same call. To change a card's column, reassign it, accept, approve, block, watch and similar, use kanban_card_action. Results list each operation's card uuid, revision, status and sortKey.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"boardUuid\":{\"description\":\"Kanban board (document) UUID.\",\"type\":\"string\"},\"mailLanguage\":{\"description\":\"Language of the emails these operations may send (review requests to newly named reviewers). Defaults to en.\",\"enum\":[\"en\",\"ko\"],\"type\":\"string\"},\"operations\":{\"description\":\"Operations, applied in order in one transaction. If any fails, none is applied and the error names operationIndex.\",\"items\":{\"additionalProperties\":false,\"properties\":{\"afterCardUuid\":{\"description\":\"Place after this card in the column (create, move).\",\"type\":\"string\"},\"assigneeUserId\":{\"description\":\"create only: assign the new card (userId from list_mention_candidates with the board's documentUuid). Someone other than you gets an assignment to accept. To reassign an existing card use kanban_card_action assign.\",\"type\":\"string\"},\"beforeCardUuid\":{\"description\":\"move: place before this card in the column.\",\"type\":\"string\"},\"cardType\":{\"description\":\"Card type (default TASK).\",\"enum\":[\"TASK\",\"REVIEW\",\"BUG\",\"DECISION\"],\"type\":\"string\"},\"cardUuid\":{\"description\":\"Target card (update, move, link, unlink). It must be on this board. From kanban_list_cards — by cardKeys if you only have the card key, e.g. KAN-15.\",\"type\":\"string\"},\"clientMutationId\":{\"description\":\"create: idempotency key — retrying with the same value returns the same card instead of creating another.\",\"type\":\"string\"},\"criteria\":{\"description\":\"Acceptance criteria. update replaces the whole list; the assignee may only flip done.\",\"items\":{\"additionalProperties\":false,\"properties\":{\"done\":{\"description\":\"Checked (default false).\",\"type\":\"boolean\"},\"text\":{\"description\":\"What must be true.\",\"type\":\"string\"}},\"required\":[\"text\"],\"type\":\"object\"},\"type\":\"array\"},\"description\":{\"description\":\"Markdown description. Keep it short — link longer text as a document instead. update: null clears it.\",\"type\":[\"string\",\"null\"]},\"documentUuid\":{\"description\":\"AiNecto document to link (you must be able to read it). Give this or url.\",\"type\":\"string\"},\"dueAt\":{\"description\":\"Due time, ISO-8601 instant such as 2026-10-31T09:00:00Z. update: null clears it.\",\"type\":[\"string\",\"null\"]},\"expectedRevision\":{\"description\":\"The card revision you last read. If the card changed since, the whole call fails with CARD_CHANGED and the current card. Send it when people may edit the card too.\",\"minimum\":0,\"type\":\"integer\"},\"label\":{\"description\":\"Optional label for an external URL.\",\"type\":\"string\"},\"linkId\":{\"description\":\"unlink: the linkId from the card's links.\",\"minimum\":1,\"type\":\"integer\"},\"linkRole\":{\"description\":\"Link role. The assignee may add DELIVERABLE, REVIEW_RESULT and TEST_EVIDENCE links; other roles need edit access to the board.\",\"enum\":[\"REQUIREMENT\",\"REFERENCE\",\"DELIVERABLE\",\"REVIEW_RESULT\",\"DECISION\",\"TEST_EVIDENCE\"],\"type\":\"string\"},\"links\":{\"description\":\"create only: links to attach.\",\"items\":{\"additionalProperties\":false,\"properties\":{\"documentUuid\":{\"description\":\"AiNecto document to link (you must be able to read it). Give this or url.\",\"type\":\"string\"},\"label\":{\"description\":\"Optional label for an external URL.\",\"type\":\"string\"},\"linkRole\":{\"description\":\"Link role. The assignee may add DELIVERABLE, REVIEW_RESULT and TEST_EVIDENCE links; other roles need edit access to the board.\",\"enum\":[\"REQUIREMENT\",\"REFERENCE\",\"DELIVERABLE\",\"REVIEW_RESULT\",\"DECISION\",\"TEST_EVIDENCE\"],\"type\":\"string\"},\"url\":{\"description\":\"External http(s) URL to link, e.g. a pull request. Give this or documentUuid.\",\"type\":\"string\"}},\"required\":[\"linkRole\"],\"type\":\"object\"},\"type\":\"array\"},\"op\":{\"description\":\"create: a new card in To Do (you become its requester unless requesterUserId names someone else). update: change only the fields you send (send null to clear description, dueAt). move: reorder within the card's column, or with toBoardUuid move it to another board of the same project. link / unlink: attach or remove a document or an external URL.\",\"enum\":[\"create\",\"link\",\"move\",\"unlink\",\"update\"],\"type\":\"string\"},\"priority\":{\"description\":\"Priority (default MEDIUM).\",\"enum\":[\"LOW\",\"MEDIUM\",\"HIGH\",\"URGENT\"],\"type\":\"string\"},\"requesterUserId\":{\"description\":\"create only: the requester (reporter) instead of you; they are notified. To change it later use kanban_card_action set_requester.\",\"type\":\"string\"},\"responderIds\":{\"description\":\"update only: who should answer while the card is blocked.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"reviewerIds\":{\"description\":\"Reviewers (userIds from list_mention_candidates with cardUuid or the board's documentUuid). update replaces the whole list.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"title\":{\"description\":\"Card title (required for create).\",\"type\":\"string\"},\"toBoardUuid\":{\"description\":\"move: another kanban board (document UUID) in the same project to move the card to. It keeps its key, column, people, comments, links and to-dos; afterCardUuid / beforeCardUuid then name cards on that board. Needs edit access to both boards, and everyone on the card (requester, assignee, reviewers, watchers, responders) must be able to read the new board.\",\"type\":\"string\"},\"url\":{\"description\":\"External http(s) URL to link, e.g. a pull request. Give this or documentUuid.\",\"type\":\"string\"},\"watcherIds\":{\"description\":\"Watchers who get activity notifications. update replaces the whole list.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"required\":[\"op\"],\"type\":\"object\"},\"maxItems\":100,\"minItems\":1,\"type\":\"array\"}},\"required\":[\"boardUuid\",\"operations\"],\"type\":\"object\"},\"required\":[\"boardUuid\",\"operations\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"b0068321e34a0614\"},\n {\"mcpName\":\"kanban_card_action\",\"commandPath\":[\"kanban\",\"card-action\"],\"group\":\"kanban\",\"description\":\"Do one workflow action on a kanban card, the same as the buttons in the web app. ★Before assign (to someone other than the signed-in user), approve or quick_done, show the user what will happen and get their explicit confirmation — these change other people's work and notify them. Actions: assign / unassign; accept / decline (only the assignee — accepting closes the assignment to-do); start (To Do → In Progress; anyone who can edit the board, or the assignee — not while an assignment is waiting to be accepted); request_review (→ In Review); approve (→ Done) / request_changes (→ In Progress) by the requester or a reviewer; quick_done (To Do → Done); reopen (Done → In Progress); block / unblock; archive / unarchive; set_requester; watch / unwatch (yourself). Doing the action is what closes the matching card to-dos — update_agent_todos cannot complete them. Returns the card after the action (status, assignment state, allowedActions) and reasonCommentId when a reason was saved.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"action\":{\"description\":\"The action. Which ones you may do now is the card's allowedActions in kanban_list_cards (with cardUuids).\",\"enum\":[\"assign\",\"unassign\",\"accept\",\"decline\",\"start\",\"request_review\",\"approve\",\"request_changes\",\"quick_done\",\"reopen\",\"block\",\"unblock\",\"archive\",\"unarchive\",\"set_requester\",\"watch\",\"unwatch\"],\"type\":\"string\"},\"assigneeUserId\":{\"description\":\"assign: who gets the card — someone who can read the board (list_mention_candidates with cardUuid). Your own userId assigns it to you and accepts at once.\",\"type\":\"string\"},\"cardUuid\":{\"description\":\"Card UUID (from kanban_list_cards — by cardKeys if you only have the card key, e.g. KAN-15).\",\"type\":\"string\"},\"expectedRevision\":{\"description\":\"The card revision you last read. If the card changed since, the call fails with CARD_CHANGED and the current card. Send it when people may act on the card too.\",\"minimum\":0,\"type\":\"integer\"},\"mailLanguage\":{\"description\":\"Language of the email this action may send (assignment or review request). Defaults to en.\",\"enum\":[\"en\",\"ko\"],\"type\":\"string\"},\"reason\":{\"description\":\"Saved as a comment on the card. Required when the action's allowedActions entry says reasonRequired (e.g. decline, reopen).\",\"type\":\"string\"},\"requesterUserId\":{\"description\":\"set_requester: the new requester.\",\"type\":\"string\"},\"responderIds\":{\"description\":\"block: who should answer (people who can read the board). Omit to keep the card's current responders.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"required\":[\"cardUuid\",\"action\"],\"type\":\"object\"},\"required\":[\"action\",\"cardUuid\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"a138310eae3979ae\"},\n {\"mcpName\":\"kanban_list_cards\",\"commandPath\":[\"kanban\",\"list-cards\"],\"group\":\"kanban\",\"description\":\"Read kanban cards. Three ways: cardUuids (or cardKeys) → those cards in full, including allowedActions (what you may do now with kanban_card_action) and links; boardUuid → the board's columns To Do, In Progress, In Review, Done (each with hasMore and nextAfter); none of these → cards across all boards you can read where you are the assignee (or requester / watcher), most recently updated first. Each card has uuid and key (KAN-15 — the short id people use in chat; find a card by it with cardKeys, then use its uuid in the write tools), title, status, assignee and assignmentState (PENDING = not yet accepted), blocked, revision and allowedTransitions.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"boardUuid\":{\"description\":\"Board (document) UUID: list its columns, first page each (or one column with status).\",\"type\":\"string\"},\"cardKeys\":{\"description\":\"Read these cards in full by their key (e.g. KAN-15 — the short id people use in chat), the same as cardUuids. Use alone.\",\"items\":{\"type\":\"string\"},\"maxItems\":50,\"minItems\":1,\"type\":\"array\",\"uniqueItems\":true},\"cardUuids\":{\"description\":\"Read these cards in full (description, people, links, allowedActions). Use alone.\",\"items\":{\"type\":\"string\"},\"maxItems\":50,\"minItems\":1,\"type\":\"array\",\"uniqueItems\":true},\"cursor\":{\"description\":\"Next page: nextCursor (without boardUuid) or a column's nextAfter (with boardUuid and status).\",\"type\":\"string\"},\"includeDone\":{\"description\":\"Without boardUuid: also recently completed cards.\",\"type\":\"boolean\"},\"limit\":{\"description\":\"Cards per page (per column with boardUuid). Default 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Without boardUuid: only boards in this project.\",\"type\":\"string\"},\"relation\":{\"description\":\"Without boardUuid: cards across boards where you are the assignee (default), the requester or a watcher.\",\"enum\":[\"ASSIGNEE\",\"REQUESTER\",\"WATCHER\"],\"type\":\"string\"},\"status\":{\"description\":\"With boardUuid: only this column.\",\"enum\":[\"TODO\",\"IN_PROGRESS\",\"IN_REVIEW\",\"DONE\"],\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"e04eb730f4bc5413\"},\n {\"mcpName\":\"list_agent_todos\",\"commandPath\":[\"agent-todos\",\"list\"],\"group\":\"generic\",\"description\":\"List the to-dos that ask the signed-in user's agent to act now (for example a question that mentions the user). This is the current state, not a feed: a to-do you have not finished comes back on every call until it is completed, dismissed, or closed because the person did it themselves. Each item has todoId, kind, obligation, openedAt, summary, target (title and url), action and state. To work on one, claim it with update_agent_todos and complete it with a one-line note. Actions that affect other people (assigning, approving, inviting) need the user's confirmation first.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"after\":{\"description\":\"todoId of the last item of the previous page.\",\"type\":\"string\"},\"kinds\":{\"description\":\"Only these kinds.\",\"items\":{\"enum\":[\"COMMENT_MENTIONED\",\"COMMENT_REPLIED\",\"QUESTION_ANSWERED\",\"QUESTION_RESOLVED\",\"QUESTION_MENTIONED\",\"CARD_CREATED\",\"CARD_UPDATED\",\"CARD_ASSIGNED\",\"CARD_UNASSIGNED\",\"CARD_REQUESTER_SET\",\"CARD_ASSIGNMENT_ACCEPTED\",\"CARD_ASSIGNMENT_DECLINED\",\"CARD_STATUS_CHANGED\",\"CARD_REVIEW_REQUESTED\",\"CARD_CHANGES_REQUESTED\",\"CARD_APPROVED\",\"CARD_QUICK_DONE\",\"CARD_REOPENED\",\"CARD_BLOCKED\",\"CARD_UNBLOCKED\",\"CARD_ARCHIVED\",\"CARD_COMMENTED\"],\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"limit\":{\"description\":\"Items per call, default 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Older single-value form of projectUuids.\",\"type\":\"string\"},\"projectUuids\":{\"description\":\"Only to-dos in any of these projects. Use it when the user names a project or the project you are working in is clear. With workspaceUuids too, both must match. A workspace or project you cannot see matches nothing.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"state\":{\"description\":\"OPEN (default): to-dos you can take, including ones whose lease expired. MINE: to-dos currently leased (claimed) and not expired.\",\"items\":{\"enum\":[\"OPEN\",\"MINE\"],\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"workspaceUuids\":{\"description\":\"Only to-dos in any of these workspaces.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"5285b988db5b02d0\"},\n {\"mcpName\":\"list_attachments\",\"commandPath\":[\"attachments\",\"list\"],\"group\":\"attachment\",\"description\":\"List the active attachments in a project, newest first: uuid, filename, contentType, sizeBytes, parentType and parentId, uploadedBy. Metadata only — no file contents or download link. Removed attachments are not listed. Needs read access to the whole project. Read only. Returns attachments and count.\",\"inputSchema\":{\"properties\":{\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"projectUuid\"],\"type\":\"object\"},\"required\":[\"projectUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"fbd087e35c18f8b3\"},\n {\"mcpName\":\"list_comments\",\"commandPath\":[\"comments\",\"list\"],\"group\":\"generic\",\"description\":\"List the active comments on a document or a kanban card (cardUuid), oldest first, including replies (a reply has parentCommentId set; replies are one level deep). Each comment has id, kind (COMMENT or QUESTION), body, author, mentions (userId, label and position in the body), and for questions questionState (UNANSWERED, ANSWERED, RESOLVED) and resolvedAt. Anyone who can read it can list its comments.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"21dbfc4740a62df5\"},\n {\"mcpName\":\"list_documents\",\"commandPath\":[\"documents\",\"list\"],\"group\":\"document\",\"description\":\"List or search documents you can read, including ones shared with you individually. Without q it lists the documents directly in folderUuid (not its subfolders), otherwise in projectUuid, otherwise every document you can read in every project; only active documents (the trash is list_trash). With q it searches the document search index (mode=search; at most limit hits, default and maximum 50; with total), narrowed by projectUuid and by folderUuid including its subfolders. type filters by document type. Titles can repeat — compare folder and project and ask the user when several match. Read only. Returns documents, count and mode.\",\"inputSchema\":{\"properties\":{\"folderUuid\":{\"description\":\"Optional folder UUID. With q, searches this folder and the folders under it.\",\"type\":\"string\"},\"limit\":{\"description\":\"Result cap when q is set (default 50)\",\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"},\"q\":{\"description\":\"Optional full-text query. When provided, results come from the search index instead of folder listing.\",\"type\":\"string\"},\"type\":{\"description\":\"Optional document type filter. Readable values: erd, diagram, markdown, openapi, html, file, kanban.\",\"enum\":[\"erd\",\"diagram\",\"markdown\",\"openapi\",\"html\",\"file\",\"kanban\"],\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"6f341f76e9ec6b89\"},\n {\"mcpName\":\"list_folders\",\"commandPath\":[\"folders\",\"list\"],\"group\":\"generic\",\"description\":\"List all active folders of one project as a flat list (uuid, id, name, parentFolderId, depth, displayOrder, app url); rebuild the tree from id and parentFolderId. Trashed folders are not included. Folder names can repeat — tell them apart by parent and ask the user when unsure. Needs read access to the whole project. Read only. Returns folders and count.\",\"inputSchema\":{\"properties\":{\"projectUuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"projectUuid\"],\"type\":\"object\"},\"required\":[\"projectUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"b021246818866bac\"},\n {\"mcpName\":\"list_history\",\"commandPath\":[\"history\",\"list\"],\"group\":\"generic\",\"description\":\"List recent activity (who did what, people and agents) in a workspace, a project, or on one resource, newest first. Give at least one of workspaceUuid, projectUuid, or resourceType with resourceUuid; you need editor access or higher in that scope. This is a list to refresh, not a gap-free feed: to see what is new, read the first page again and skip ids you have already seen; to get each new notification exactly once use list_notifications. Each item has id, kind, at, lastAt, coalesceCount, actor, target (title and url only when you can read it now), changes and summary.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"actorType\":{\"description\":\"Only people (USER) or only agents (AGENT).\",\"enum\":[\"USER\",\"AGENT\"],\"type\":\"string\"},\"before\":{\"description\":\"nextCursor of the previous page (older items).\",\"type\":\"string\"},\"kinds\":{\"description\":\"Only these kinds.\",\"items\":{\"enum\":[\"COMMENT_MENTIONED\",\"COMMENT_REPLIED\",\"QUESTION_ANSWERED\",\"QUESTION_RESOLVED\",\"QUESTION_MENTIONED\",\"CARD_CREATED\",\"CARD_UPDATED\",\"CARD_ASSIGNED\",\"CARD_UNASSIGNED\",\"CARD_REQUESTER_SET\",\"CARD_ASSIGNMENT_ACCEPTED\",\"CARD_ASSIGNMENT_DECLINED\",\"CARD_STATUS_CHANGED\",\"CARD_REVIEW_REQUESTED\",\"CARD_CHANGES_REQUESTED\",\"CARD_APPROVED\",\"CARD_QUICK_DONE\",\"CARD_REOPENED\",\"CARD_BLOCKED\",\"CARD_UNBLOCKED\",\"CARD_ARCHIVED\",\"CARD_COMMENTED\"],\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"limit\":{\"description\":\"Items per call, default 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Activity in this project.\",\"type\":\"string\"},\"resourceType\":{\"description\":\"With resourceUuid: activity on one resource.\",\"enum\":[\"DOCUMENT\",\"PROJECT\",\"KANBAN_CARD\"],\"type\":\"string\"},\"resourceUuid\":{\"description\":\"UUID of the resource named by resourceType.\",\"type\":\"string\"},\"workspaceUuid\":{\"description\":\"Activity in this workspace.\",\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"9774a593c634070c\"},\n {\"mcpName\":\"list_mention_candidates\",\"commandPath\":[\"mention-candidates\",\"list\"],\"group\":\"generic\",\"description\":\"List the people you can mention in comments on a document or a kanban card (cardUuid): userId, displayName and jobTitle (null = not set) — jobTitle helps tell people with the same name apart. Only people who can read it are listed — for a card, the people who can read its board, which are also the people a card can be assigned to. To mention someone, write @<displayName> exactly in the comment body and pass their userId in mentionUserIds of create_comments or update_comments. Page with nextCursor while hasMore is true.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"cursor\":{\"description\":\"nextCursor from the previous page (same parent and query).\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"},\"limit\":{\"description\":\"Page size, 1..50. Defaults to 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"query\":{\"description\":\"Name filter, 0..100 characters. Omit or leave empty for the first page of everyone.\",\"maxLength\":100,\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"c06acebfee9d635a\"},\n {\"mcpName\":\"list_notifications\",\"commandPath\":[\"notifications\",\"list\"],\"group\":\"generic\",\"description\":\"Read new notifications for the signed-in user, oldest first and without gaps — for an agent that checks the inbox periodically. The server remembers, per connection and per filter (kinds, workspaceUuids, projectUuids, directOnly), how far you have acknowledged; a new filter starts from now. Each response carries ackToken: pass it as ack in your next call (with the same filter) after you have handled the batch — if you do not, the next call returns the same batch again (identify duplicates by id and seq; an item that comes back with a higher seq and a larger groupCount is an update of the same entry). Each item has id, seq, kind, at, summary (one line), actor, target (title and url only when you can read it now), action (what the user is asked to do) and humanRead. An item you can no longer read comes back as {id, seq, at, redacted: true}. This tool never marks anything read for the person (use mark_notifications_read when the user asks); open to-dos are in list_agent_todos. Calls closer than 30 seconds apart (except a call that carries ack) return retryAfterSeconds instead of items.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"ack\":{\"description\":\"The ackToken of the previous response. Send it with the same filter once you have handled (or safely stored) that batch; only then does the saved position move past it. Without it, the same batch is returned again.\",\"type\":\"string\"},\"cursor\":{\"description\":\"Where to read from. \\\"saved\\\" (default): after what this connection last acknowledged for this same filter. \\\"latest\\\": from now on (moves the saved position to now). \\\"earliest\\\": everything still kept (90 days). Or a nextCursor from a previous response: read after it without using or changing the saved position.\",\"type\":\"string\"},\"directOnly\":{\"description\":\"Only notifications that point at you directly (mentions, questions to you).\",\"type\":\"boolean\"},\"kinds\":{\"description\":\"Only these notification kinds.\",\"items\":{\"enum\":[\"COMMENT_MENTIONED\",\"COMMENT_REPLIED\",\"QUESTION_ANSWERED\",\"QUESTION_RESOLVED\",\"QUESTION_MENTIONED\",\"CARD_CREATED\",\"CARD_UPDATED\",\"CARD_ASSIGNED\",\"CARD_UNASSIGNED\",\"CARD_REQUESTER_SET\",\"CARD_ASSIGNMENT_ACCEPTED\",\"CARD_ASSIGNMENT_DECLINED\",\"CARD_STATUS_CHANGED\",\"CARD_REVIEW_REQUESTED\",\"CARD_CHANGES_REQUESTED\",\"CARD_APPROVED\",\"CARD_QUICK_DONE\",\"CARD_REOPENED\",\"CARD_BLOCKED\",\"CARD_UNBLOCKED\",\"CARD_ARCHIVED\",\"CARD_COMMENTED\"],\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"limit\":{\"description\":\"Items per call, default 20.\",\"maximum\":50,\"minimum\":1,\"type\":\"integer\"},\"projectUuid\":{\"description\":\"Older single-value form of projectUuids.\",\"type\":\"string\"},\"projectUuids\":{\"description\":\"Only notifications in any of these projects. Use it when the user names a project or the project you are working in is clear. With workspaceUuids too, both must match. A workspace or project you cannot see matches nothing.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true},\"workspaceUuids\":{\"description\":\"Only notifications in any of these workspaces.\",\"items\":{\"type\":\"string\"},\"type\":\"array\",\"uniqueItems\":true}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"015227aee445b6a7\"},\n {\"mcpName\":\"list_projects\",\"commandPath\":[\"projects\",\"list\"],\"group\":\"generic\",\"description\":\"Find projects you can open. With no arguments it lists every active project you can open, across all workspaces; workspaceUuid narrows it to one workspace (an unknown UUID gives an empty list). With q it searches the project search index instead (mode=search; at most limit hits, default and maximum 50; with total). Archived projects are never listed. Project names can repeat — compare workspaceId and ask the user when several match. Read only. Returns projects, count and mode.\",\"inputSchema\":{\"properties\":{\"limit\":{\"description\":\"Result cap when q is set (default 50)\",\"type\":\"integer\"},\"q\":{\"description\":\"Optional full-text query\",\"type\":\"string\"},\"workspaceUuid\":{\"description\":\"Optional Workspace UUID\",\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"4b6c8543d156b77b\"},\n {\"mcpName\":\"list_trash\",\"commandPath\":[\"trash\",\"list\"],\"group\":\"generic\",\"description\":\"List the documents in the trash across every project you can open as a whole (access through a single shared folder or file does not count): documents deleted with delete_documents or inside a trashed folder. Trashed folders, archived projects and archived workspaces are not listed here. Read only, no paging. Returns trashed (document rows: uuid, title, type, projectId, folderId) and count. unarchive_documents restores one; the server permanently deletes trashed documents once the trash retention period passes (30 days by default).\",\"inputSchema\":{\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"7dcdbf558ec22318\"},\n {\"mcpName\":\"list_versions\",\"commandPath\":[\"versions\",\"list\"],\"group\":\"generic\",\"description\":\"List a document's saved versions, newest first: versionNumber, versionType, title, changeSummary, createdBy, createdAt and locked. locked=true means the version is outside your plan's history window and cannot be opened or restored. get_version reads one and restore_versions rolls back. Read only; needs read access. Returns versions and count.\",\"inputSchema\":{\"properties\":{\"documentUuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"documentUuid\"],\"type\":\"object\"},\"required\":[\"documentUuid\"],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"520d624a2b239d37\"},\n {\"mcpName\":\"list_workspaces\",\"commandPath\":[\"workspaces\",\"list\"],\"group\":\"workspace\",\"description\":\"List the personal workspaces you own (active ones only). Workspaces that other people or a team share with you are not included — list_projects shows every project you can open (each row has workspaceId) and get_workspace reads one workspace. Read only. Returns workspaces (uuid, name, description, owner, revision) and count.\",\"inputSchema\":{\"properties\":{},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"146a971a0e1986e2\"},\n {\"mcpName\":\"mark_notifications_read\",\"commandPath\":[\"tools\",\"run\",\"mark-notifications-read\"],\"group\":\"generic\",\"description\":\"Mark the signed-in user's notifications as read in the AiNecto inbox — the same read state as the web bell, so the unread badge goes down. Call it only when the user explicitly asks you to mark notifications read; reading or acknowledging notifications (list_notifications ack) does not do this. Pass the id and seq of each item as you received them. Results are per item: {id, ok: true, readAt, alreadyRead?} or {id, ok: false, error} with error one of STALE (the entry was updated after you saw it — it stays unread; seq is the current one), NOT_FOUND (not your notification, archived, or no such id), INVALID. unread is the user's unread count after the call (the number on the web bell, unreadCapped when above it). Only your own notifications. Retrying is safe. It does not close to-dos and does not acknowledge anything for list_notifications.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"items\":{\"description\":\"Notifications to mark read; each item is applied and reported on its own.\",\"items\":{\"additionalProperties\":false,\"properties\":{\"id\":{\"description\":\"Notification id from list_notifications or get_my_work_summary (mentionsToRead).\",\"type\":\"string\"},\"seq\":{\"description\":\"The seq of that same item as you received it. If the entry was updated after you saw it (higher seq), it stays unread and you get STALE.\",\"type\":\"integer\"}},\"required\":[\"id\",\"seq\"],\"type\":\"object\"},\"maxItems\":50,\"minItems\":1,\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"79076cb2c0562ccb\"},\n {\"mcpName\":\"markdown_append_document\",\"commandPath\":[\"markdown\",\"append-document\"],\"group\":\"markdown\",\"description\":\"Append text to the end of Markdown documents without resending the existing body; separator goes between the old body and the addition. The change is kept in version history (restore_versions can undo it). Needs edit access. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Returns appended (document rows) and count. Fails with 409 when the document is in the trash or its folder, project or workspace is archived. If the appended body is tens of KB or more, prefer request_upload_token (purpose=document.append) and upload the body with curl.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Appends\",\"items\":{\"properties\":{\"addition\":{\"description\":\"Body addition. 추가할 내용이 크면 (수십 KB 이상) LLM 토큰 절약을 위해 `request_upload_token (purpose=document.append, scopeJson={documentUuid, separator})` 로 uploadUrl 을 받고 curl 로 PUT 으로 보낼 것.\",\"type\":\"string\"},\"separator\":{\"description\":\"Separator between existing body and addition\",\"type\":\"string\"},\"uuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"addition\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"a03ed0662ffcd6e4\"},\n {\"mcpName\":\"markdown_generate_document\",\"commandPath\":[\"markdown\",\"generate-document\"],\"group\":\"markdown\",\"description\":\"Queue a Markdown generation request (status PENDING) for a separate worker that claims requests through AiNecto's AI request API. This tool does not generate text and does not change the document; to write content yourself use update_documents or markdown_append_document. The queued request keeps only prompt and context, not documentUuid, so put everything the worker needs in context. Needs edit access to the document and an AI credit balance above zero; queuing is rate-limited per user. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Returns queued (uuid, status, documentUuid) and count.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Generation requests\",\"items\":{\"properties\":{\"context\":{\"description\":\"Optional JSON context\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Target document UUID\",\"type\":\"string\"},\"prompt\":{\"description\":\"Generation prompt\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"prompt\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"822ac36c10f330d4\"},\n {\"mcpName\":\"move_documents\",\"commandPath\":[\"documents\",\"move\"],\"group\":\"document\",\"description\":\"Move documents to another folder, to a project's top level (empty newFolderUuid), or into another project — even in another workspace — with targetProjectUuid (targetWorkspaceUuid is only a check that must match that project's workspace). Attachments, including those on its comments, go with the document. Sharing inherited from the old folder or project stops applying and is reported in unlinkedInheritedShares; the destination's sharing applies instead. Confirm with the user before moving documents into another project or workspace. Needs edit access to each document and to the destination (and to the source project when leaving it); moving into a different storage quota can be refused. All-or-nothing: if any item fails, nothing moves. Sends no email or inbox notification. Returns moved (document rows), count, unlinkedInheritedShareCount and attachmentsReprojected.\",\"inputSchema\":{\"properties\":{\"clientMutationId\":{\"description\":\"Optional mutation identifier for client retry tracing\",\"maxLength\":128,\"minLength\":1,\"pattern\":\"^[\\\\x21-\\\\x7E]{1,128}$\",\"type\":\"string\"},\"items\":{\"description\":\"Moves\",\"items\":{\"properties\":{\"newFolderUuid\":{\"description\":\"New folder UUID — null/empty for root\",\"type\":\"string\"},\"targetProjectUuid\":{\"description\":\"Target project UUID — omit to stay in current project\",\"type\":\"string\"},\"targetWorkspaceUuid\":{\"description\":\"Guard only: must match targetProjectUuid workspace\",\"type\":\"string\"},\"uuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"c0ca210155b35be0\"},\n {\"mcpName\":\"move_folders\",\"commandPath\":[\"folders\",\"move\"],\"group\":\"generic\",\"description\":\"Move folders, with everything under them, under another folder of the same project, or to the project's top level when newParentFolderUuid is empty. Folders cannot move between projects (move_documents can move documents across projects). A folder cannot go under itself or its own subfolder, and the result must stay within 50 levels. Sharing inherited from the old parent folders stops applying and the new parents' sharing applies instead. Needs edit access to the folder and to the new parent. Targets are UUIDs only; names are never matched and may repeat. Look the UUID up first, and when more than one candidate fits what the user said, ask which one. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns moved (folder rows) and count.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Moves\",\"items\":{\"properties\":{\"newParentFolderUuid\":{\"description\":\"New parent UUID — null/empty for root\",\"type\":\"string\"},\"uuid\":{\"description\":\"Folder UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"95ee0d3da59ec301\"},\n {\"mcpName\":\"move_projects\",\"commandPath\":[\"projects\",\"move\"],\"group\":\"generic\",\"description\":\"Move projects, with all their folders, documents and attachments, into another workspace. This changes who can open them: people with access to the old workspace lose it, people with access to the target workspace gain it, and people given the project itself keep it. Public links stay as they were. Confirm with the user before moving a project into a team workspace. Needs edit access to the project and to the target workspace; moving to the workspace it is already in does nothing. Each item is tried on its own and the call does not stop at a failure: results reports each item as ok, or with status and error (409 when its projectKey is already used in the target workspace; the target's storage quota can also refuse). Sends no email or inbox notification. Returns results, movedCount and failedCount.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Moves\",\"items\":{\"properties\":{\"targetWorkspaceUuid\":{\"description\":\"Destination workspace UUID (you need write access there)\",\"type\":\"string\"},\"uuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"targetWorkspaceUuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"7b5a3ba9ab9e3079\"},\n {\"mcpName\":\"request_upload_token\",\"commandPath\":[\"tools\",\"run\",\"request-upload-token\"],\"group\":\"attachment\",\"description\":\"Use this for large payloads of tens of KB or more to save LLM tokens. purpose=mcp.call returns a short-lived bearer token that can call any MCP tool, including erd_apply_changes, via curl. purpose=document.create/update/append uploads document bodies directly to the upload endpoint with PUT/curl. Tokens are reusable for 5 minutes by default.\",\"inputSchema\":{\"properties\":{\"maxBytes\":{\"description\":\"최대 업로드 byte (서버 측 한도)\",\"type\":\"integer\"},\"purpose\":{\"description\":\"Token 용도. `mcp.call` 은 curl 로 /mcp 호출, `document.create/update/append` 는 PUT body 로 본문 업로드, `attachment.upload` 는 파일 bytes 업로드. 콘텐츠가 크면 (수십 KB 이상) LLM 토큰 절약을 위해 이 도구로 5분 재사용 토큰을 받고 curl 로 보내는 것을 강력 권장.\",\"enum\":[\"mcp.call\",\"document.create\",\"document.update\",\"document.append\",\"attachment.upload\"],\"type\":\"string\"},\"scopeJson\":{\"description\":\"선택 — JSON scope. document.create 는 projectUuid, type, title 을 포함하고 creatable type values 는 erd, diagram, markdown, openapi, html, file, kanban. document.update/document.append 는 documentUuid 를 포함. type=file 은 filename 도 포함(확장자로 형식 판정) — PUT 의 Content-Type 은 파일 MIME, 본문은 파일 바이트. attachment.upload: {documentUuid, filename}; storageKey 는 서버가 발급 scope 에 넣는다.\",\"type\":\"string\"},\"ttlSeconds\":{\"description\":\"TTL (초). 기본 300 (5분)\",\"type\":\"integer\"}},\"required\":[\"purpose\"],\"type\":\"object\"},\"required\":[\"purpose\"],\"payloadMode\":\"binary-upload\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"99a4b6c77dd2368b\"},\n {\"mcpName\":\"resolve_comments\",\"commandPath\":[\"tools\",\"run\",\"resolve-comments\"],\"group\":\"generic\",\"description\":\"Mark questions on a document or a kanban card (cardUuid) as resolved. Only top-level comments with kind QUESTION can be resolved, and it needs edit access to the document or board (readers can comment but cannot resolve). Resolving cannot be undone. Each id is applied on its own; results report each id.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"},\"ids\":{\"description\":\"Question ids to resolve (top-level comments with kind QUESTION)\",\"items\":{\"minimum\":1,\"type\":\"integer\"},\"minItems\":1,\"type\":\"array\"}},\"required\":[\"ids\"],\"type\":\"object\"},\"required\":[\"ids\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"d996f083fd9e6acf\"},\n {\"mcpName\":\"restore_versions\",\"commandPath\":[\"versions\",\"restore\"],\"group\":\"generic\",\"description\":\"Roll documents back to an earlier saved version (version numbers come from list_versions). The current content and title are replaced by that version's snapshot and a new version \\\"Restored from version N\\\" is recorded, so the history keeps everything and the rollback can itself be undone the same way. Tell the user which version you are restoring before calling. Needs edit access. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns restored (the new version rows, each with documentUuid) and count. Fails with 404 for an unknown document or version number, with a plan-limit error for a locked version (locked=true in list_versions), and with 409 when the document is in the trash or its folder, project or workspace is archived.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Restores\",\"items\":{\"properties\":{\"documentUuid\":{\"description\":\"Document UUID\",\"type\":\"string\"},\"versionNumber\":{\"description\":\"Version number to restore\",\"type\":\"integer\"}},\"required\":[\"documentUuid\",\"versionNumber\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"1af89081b6bc61cd\"},\n {\"mcpName\":\"search_documents\",\"commandPath\":[\"documents\",\"search\"],\"group\":\"document\",\"description\":\"Find documents you can read by keywords, people, folder and dates, when you have no link or exact title. Each hit has title, type, uuid, projectName, folderPath (\\\"Parent / Child\\\"), url, updatedAt and lastEditorName — enough to tell the user which document is which. Map the user's words to filters: \\\"edited today\\\" -> updatedFrom = today's date-time at local midnight with offset; \\\"last week\\\" -> updatedFrom/updatedTo; \\\"Ryan's\\\" or \\\"Ryan changed\\\" -> first get Ryan's userId from list_mention_candidates (or identity_get_self for \\\"me\\\"), then ownerUserId or lastEditorUserId; \\\"in the X folder\\\" -> folderUuid from list_folders. Keep only the topic words in q.\",\"inputSchema\":{\"properties\":{\"createdFrom\":{\"description\":\"ISO-8601: a date-time with offset (2026-10-21T00:00:00+09:00) or a date (2026-10-21 = that UTC day; use the offset form for a local day). Created at or after.\",\"type\":\"string\"},\"createdTo\":{\"description\":\"ISO-8601: a date-time with offset (2026-10-21T00:00:00+09:00) or a date (2026-10-21 = that UTC day; use the offset form for a local day). Created at or before (a date includes that whole day).\",\"type\":\"string\"},\"folderUuid\":{\"description\":\"Only documents in this folder or any folder under it.\",\"type\":\"string\"},\"lastEditorUserId\":{\"description\":\"Only documents whose latest saved version is by this user.\",\"type\":\"string\"},\"limit\":{\"description\":\"결과 개수 (기본 20, 최대 50)\",\"type\":\"integer\"},\"offset\":{\"description\":\"페이지네이션 offset (기본 0)\",\"type\":\"integer\"},\"ownerUserId\":{\"description\":\"Only documents owned by this user (the creator, unless ownership moved).\",\"type\":\"string\"},\"projectUuid\":{\"description\":\"Only documents in this project.\",\"type\":\"string\"},\"q\":{\"description\":\"Keywords in the title or body. Optional — omit to list by the filters alone, most recently updated first.\",\"type\":\"string\"},\"type\":{\"description\":\"Optional document type filter. Readable values: erd, diagram, markdown, openapi, html, file, kanban.\",\"enum\":[\"erd\",\"diagram\",\"markdown\",\"openapi\",\"html\",\"file\",\"kanban\"],\"type\":\"string\"},\"updatedFrom\":{\"description\":\"ISO-8601: a date-time with offset (2026-10-21T00:00:00+09:00) or a date (2026-10-21 = that UTC day; use the offset form for a local day). Last changed at or after.\",\"type\":\"string\"},\"updatedTo\":{\"description\":\"ISO-8601: a date-time with offset (2026-10-21T00:00:00+09:00) or a date (2026-10-21 = that UTC day; use the offset form for a local day). Last changed at or before (a date includes that whole day).\",\"type\":\"string\"}},\"type\":\"object\"},\"required\":[],\"payloadMode\":\"flags\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"a48651dc16036896\"},\n {\"mcpName\":\"unarchive_documents\",\"commandPath\":[\"documents\",\"unarchive\"],\"group\":\"document\",\"description\":\"Restore documents from the trash (list_trash shows them) to where they were. A public link that was on opens again; direct sharing removed when the document was trashed does not come back. Needs edit access. A document that is not in the trash is returned unchanged. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns unarchived (document rows) and count. Fails with 409 when its folder, project or workspace is archived — restore the folder with unarchive_folders instead — and is refused when restoring would exceed the storage quota.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Document UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"fadb26ea6649079c\"},\n {\"mcpName\":\"unarchive_folders\",\"commandPath\":[\"folders\",\"unarchive\"],\"group\":\"generic\",\"description\":\"Restore trashed folders together with their whole subtree. Every trashed subfolder and document under the folder comes back — including documents that were trashed on their own before the folder was. Direct sharing removed at trash time does not come back. No tool lists trashed folders (list_trash lists documents only), so use the UUID from the earlier delete_folders call. Needs edit access to the folder. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns unarchived (folder rows) and count. Fails with 409 when a parent folder, the project or the workspace is archived (restore the parent first) and is refused when restoring would exceed the storage quota.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Folder UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"b5b618fa100be0f7\"},\n {\"mcpName\":\"unarchive_projects\",\"commandPath\":[\"projects\",\"unarchive\"],\"group\":\"generic\",\"description\":\"Restore archived projects so they are listed and editable again. Public links of documents inside open again if they were on; sharing removed at archive time does not come back. No tool lists archived projects, so use the UUID from the earlier delete_projects call. Needs edit access to the project, and its workspace must not be archived. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns unarchived (project rows) and count. Fails with 404 for an unknown UUID, 403 without access, and 409 when the workspace is archived.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Project UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"5d5b1029b0759182\"},\n {\"mcpName\":\"unarchive_workspaces\",\"commandPath\":[\"workspaces\",\"unarchive\"],\"group\":\"workspace\",\"description\":\"Restore archived workspaces so they and their projects are listed and usable again. No tool lists archived workspaces, so use the UUID from the earlier delete_workspaces call. Needs edit access to the workspace. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns unarchived (workspace rows) and count. Fails with 404 for an unknown UUID and 403 without access.\",\"inputSchema\":{\"properties\":{\"uuids\":{\"description\":\"Workspace UUIDs\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"uuids\"],\"type\":\"object\"},\"required\":[\"uuids\"],\"payloadMode\":\"file-json\",\"destructive\":true,\"sourceCatalog\":\"dev\",\"schemaHash\":\"6cd85561c70e4bf5\"},\n {\"mcpName\":\"update_agent_todos\",\"commandPath\":[\"agent-todos\",\"update\"],\"group\":\"generic\",\"description\":\"Claim, renew, complete, release, or dismiss the signed-in user's agent to-dos. Only the session holding the current leaseToken may renew, release, or complete a claimed to-do — even another session of the same connection gets CLAIMED_BY_OTHER. Results are per item: {todoId, ok: true, state, leaseToken?, claimExpiresAt?} or {todoId, ok: false, error} with error one of CLAIMED_BY_OTHER, LEASE_LOST, ALREADY_DONE, CLOSED_BY_HUMAN, SUPERSEDED, ACCESS_LOST, BUSINESS_ACTION_REQUIRED, NOT_FOUND, INVALID — on CLOSED_BY_HUMAN or SUPERSEDED stop working on it. BUSINESS_ACTION_REQUIRED: card to-dos (CARD_*) cannot be completed here; doing the card action closes them. Retrying the same complete or dismiss returns ok again. To mark the person's notifications read (only when they ask), use mark_notifications_read.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"items\":{\"description\":\"To-dos to update; each item is applied and reported on its own.\",\"items\":{\"additionalProperties\":false,\"properties\":{\"action\":{\"description\":\"claim: take it (returns leaseToken, valid 30 minutes). renew: extend your lease. complete: done (with leaseToken if you claimed it; without one only while it is still OPEN). release: give it back. dismiss: not a to-do.\",\"enum\":[\"claim\",\"renew\",\"complete\",\"release\",\"dismiss\"],\"type\":\"string\"},\"leaseToken\":{\"description\":\"Required for renew and release, and for complete or dismiss of a to-do you claimed.\",\"type\":\"string\"},\"note\":{\"description\":\"For complete or dismiss: one line on what you did (at most 500 characters, no document bodies). The person sees it in the inbox.\",\"maxLength\":500,\"type\":\"string\"},\"todoId\":{\"description\":\"todoId from list_agent_todos.\",\"type\":\"string\"}},\"required\":[\"todoId\",\"action\"],\"type\":\"object\"},\"maxItems\":50,\"minItems\":1,\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"f304eb4450675a6d\"},\n {\"mcpName\":\"update_comments\",\"commandPath\":[\"comments\",\"update\"],\"group\":\"generic\",\"description\":\"Edit your own comments on a document or a kanban card (cardUuid). Only the author can edit, and only while they can still read it. A resolved question and a top-level comment that already has replies are locked. Items are applied in order and each one commits on its own; results report each item.\",\"inputSchema\":{\"additionalProperties\":false,\"properties\":{\"cardUuid\":{\"description\":\"Kanban card UUID the comments belong to (from kanban_list_cards). Anyone who can read the card's board may comment. Give this or documentUuid, not both.\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Document UUID the comments belong to. Give this or cardUuid, not both.\",\"type\":\"string\"},\"items\":{\"description\":\"Edits, applied in order\",\"items\":{\"additionalProperties\":false,\"properties\":{\"body\":{\"description\":\"New comment text (replaces the old text).\",\"maxLength\":10000,\"minLength\":1,\"type\":\"string\"},\"clientMutationId\":{\"description\":\"Idempotency key (visible ASCII, at most 128 characters). Required when mentionUserIds is not empty; reuse the same value when retrying the same item so the mention email is not sent twice.\",\"maxLength\":128,\"type\":\"string\"},\"id\":{\"description\":\"Comment id (from mcp__ainecto__list_comments)\",\"minimum\":1,\"type\":\"integer\"},\"mentionUserIds\":{\"description\":\"The complete set of userIds mentioned after the edit; omit to remove all mentions. Each one's @<displayName> must appear in body. Only people who were not mentioned before get a notification email.\",\"items\":{\"type\":\"string\"},\"maxItems\":20,\"type\":\"array\",\"uniqueItems\":true}},\"required\":[\"id\",\"body\"],\"type\":\"object\"},\"minItems\":1,\"type\":\"array\"},\"mailLanguage\":{\"description\":\"Language of the comment notification email (mention or reply). Defaults to en.\",\"enum\":[\"en\",\"ko\"],\"type\":\"string\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"a5bc050079e34361\"},\n {\"mcpName\":\"update_documents\",\"commandPath\":[\"documents\",\"update\"],\"group\":\"document\",\"description\":\"Update documents: the title and/or the whole body. A body you send replaces the current body entirely — it is not a patch, so read the document first and send the full new text. The document type decides the body field (see body and typePayload): file documents can only be renamed, ERD content changes through erd_apply_changes, diagram nodes and edges through diagram_apply_changes, and board documents are refused. Every body change is kept in version history, so list_versions and restore_versions can undo it. Needs edit access. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Returns updated (document rows) and count. Fails with 409 when the document is in the trash or its folder, project or workspace is archived. If a replacement body is tens of KB or more, prefer request_upload_token (purpose=document.update) and upload the body with curl.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Updates\",\"items\":{\"properties\":{\"body\":{\"description\":\"Deprecated compatibility alias for typePayload.body when document type is markdown. 본문이 수십 KB 이상으로 크면 LLM 토큰 절약을 위해 `request_upload_token (purpose=document.update)` 를 호출해 uploadUrl 을 받고 curl 로 직접 PUT 으로 보낼 것.\",\"type\":\"string\"},\"title\":{\"description\":\"New title\",\"type\":\"string\"},\"typePayload\":{\"description\":\"Type-specific payload for enabled document types. markdown: {body}; diagram: {diagramSource,sourceLanguage,edgeStyle,isModule,metadata}; openapi: {content}; html: {content} (a full HTML page); file: {file:{filename,contentType,sizeBytes,viewerKind}} (+content for text/CSV, first 64 KB); kanban: no body — only the title can be updated; cards are changed with kanban_apply_changes and kanban_card_action.\",\"type\":\"object\"},\"uuid\":{\"description\":\"Document UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"e6526c5177c9542c\"},\n {\"mcpName\":\"update_folders\",\"commandPath\":[\"folders\",\"update\"],\"group\":\"generic\",\"description\":\"Rename folders (only the name; move_folders moves them). Names do not have to be unique. Needs edit access to the folder. Targets are UUIDs only; names are never matched and may repeat. Look the UUID up first, and when more than one candidate fits what the user said, ask which one. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns updated (folder rows) and count. Fails with 404, 403, or 409 when the folder or a parent folder is archived.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Updates\",\"items\":{\"properties\":{\"name\":{\"description\":\"New name\",\"type\":\"string\"},\"uuid\":{\"description\":\"Folder UUID\",\"type\":\"string\"}},\"required\":[\"uuid\",\"name\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"af4a8688a8d7f15c\"},\n {\"mcpName\":\"update_projects\",\"commandPath\":[\"projects\",\"update\"],\"group\":\"generic\",\"description\":\"Rename projects or change their description (projectKey cannot be changed here). Omitted fields stay as they are, a blank name is ignored, and description \\\"\\\" clears it. Names do not have to be unique. Needs admin or owner rights on the project. Targets are UUIDs only; names are never matched and may repeat. Look the UUID up first, and when more than one candidate fits what the user said, ask which one. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns updated (project rows) and count. Fails with 404 for an unknown UUID and 403 without rights or when the project or its workspace is archived.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Updates\",\"items\":{\"properties\":{\"description\":{\"description\":\"New description\",\"type\":\"string\"},\"name\":{\"description\":\"New name\",\"type\":\"string\"},\"uuid\":{\"description\":\"Project UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"6a097e4b164d2d97\"},\n {\"mcpName\":\"update_workspaces\",\"commandPath\":[\"workspaces\",\"update\"],\"group\":\"workspace\",\"description\":\"Rename workspaces or change their description. Omitted fields stay as they are, a blank name is ignored, and description \\\"\\\" clears it. Names do not have to be unique. Needs admin or owner rights. Targets are UUIDs only; names are never matched and may repeat. Look the UUID up first, and when more than one candidate fits what the user said, ask which one. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns updated (workspace rows) and count. Fails with 404 for an unknown UUID and 403 without rights or when the workspace is archived.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Updates\",\"items\":{\"properties\":{\"description\":{\"description\":\"New description\",\"type\":\"string\"},\"name\":{\"description\":\"New name\",\"type\":\"string\"},\"uuid\":{\"description\":\"Workspace UUID\",\"type\":\"string\"}},\"required\":[\"uuid\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"file-json\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"9c6228e9c2859ff5\"},\n {\"mcpName\":\"upload_attachments\",\"commandPath\":[\"tools\",\"run\",\"upload-attachments\"],\"group\":\"attachment\",\"description\":\"Register files you have already uploaded as attachments of documents. Steps: (1) request_upload_token with purpose=attachment.upload and {documentUuid, filename}; (2) PUT the file bytes with curl to the returned URL; (3) call this with the storageKey from step 1 — without step 2 it fails. sizeBytes, when given, must equal the uploaded size. A storageKey registers once (409 after that). Files over the server's attachment size limit or beyond the storage quota are refused, and the server decides the stored content type. File documents cannot take attachments. Needs edit access to the document. Items run in order and each one commits on its own: the first failing item ends the call with an error, items before it stay applied (the error does not list them), and later items are not tried — re-read before retrying. Sends no email or inbox notification. Returns uploaded (attachment rows) and count.\",\"inputSchema\":{\"properties\":{\"items\":{\"description\":\"Attachments to register\",\"items\":{\"properties\":{\"contentType\":{\"description\":\"MIME type\",\"type\":\"string\"},\"documentUuid\":{\"description\":\"Parent document UUID\",\"type\":\"string\"},\"filename\":{\"description\":\"Original file name\",\"type\":\"string\"},\"sizeBytes\":{\"description\":\"Size in bytes\",\"type\":\"integer\"},\"storageKey\":{\"description\":\"Storage key returned by request_upload_token purpose=attachment.upload\",\"type\":\"string\"}},\"required\":[\"documentUuid\",\"filename\",\"storageKey\"],\"type\":\"object\"},\"type\":\"array\"}},\"required\":[\"items\"],\"type\":\"object\"},\"required\":[\"items\"],\"payloadMode\":\"binary-upload\",\"destructive\":false,\"sourceCatalog\":\"dev\",\"schemaHash\":\"adf49eddeae4a185\"},\n] satisfies GeneratedToolDefinition[];\n","import { createHash } from \"node:crypto\";\nimport type { GeneratedToolDefinition, JsonSchema, McpToolListItem, PayloadMode, ToolGroup } from \"./types\";\n\n/**\n * 서버가 도구 이름 앞에 달던 prefix.\n *\n * ★2026-09-22 부터 서버는 이 prefix 를 «떼고» 내보낸다 — MCP 클라이언트가 자기 서버 별칭을\n * 한 번 더 얹기 때문에, 서버까지 붙이면 `mcp__ainecto__mcp__ainecto__list_projects` 가 된다.\n * 그래서 여기서는 prefix 를 «있으면 뗀다»로만 다룬다. 옛 카탈로그(이미 받아 둔 generated.*.ts)\n * 에는 긴 이름이 남아 있고 서버가 그것도 계속 받아주므로, 두 형태가 함께 산다.\n */\nconst LEGACY_PREFIX = \"mcp__ainecto__\";\n\n/**\n * 서버 prefix 를 뗀 «맨 이름». 카탈로그가 어느 판에서 왔든(긴 이름·짧은 이름) 같은 도구를 같은\n * 이름으로 가리키려면 이 한 곳을 거친다 — 표시 정보(enrichments)를 이름으로 붙일 때 특히.\n */\nexport function bareToolName(name: string): string {\n return name.startsWith(LEGACY_PREFIX) ? name.slice(LEGACY_PREFIX.length) : name;\n}\nconst DESTRUCTIVE_PREFIXES = [\n \"delete_\",\n \"remove_\",\n \"archive_\",\n \"unarchive_\",\n \"restore_\",\n \"move_\",\n \"erd_delete_\",\n \"erd_remove_\",\n \"testcase_delete_\",\n];\n\nexport function generateCatalog(tools: McpToolListItem[], sourceCatalog: \"prod\" | \"dev\"): GeneratedToolDefinition[] {\n return tools\n .map((tool) => normalizeTool(tool, sourceCatalog))\n .sort((a, b) => a.mcpName.localeCompare(b.mcpName));\n}\n\nexport function normalizeTool(tool: McpToolListItem, sourceCatalog: \"prod\" | \"dev\"): GeneratedToolDefinition {\n if (!tool.name) {\n throw new Error(\"Unsupported tool name: empty.\");\n }\n const stripped = bareToolName(tool.name);\n const group = inferGroup(stripped);\n const inputSchema = normalizeSchema(tool.inputSchema ?? { type: \"object\", properties: {} });\n const required = Array.isArray(inputSchema.required)\n ? inputSchema.required.filter((value): value is string => typeof value === \"string\").sort()\n : [];\n const definition = {\n mcpName: tool.name,\n commandPath: generateCommandPath(stripped, group),\n group,\n description: tool.description ?? \"\",\n inputSchema,\n required,\n payloadMode: inferPayloadMode(stripped, inputSchema),\n destructive: inferDestructive(stripped, tool),\n sourceCatalog,\n schemaHash: \"\",\n } satisfies GeneratedToolDefinition;\n return { ...definition, schemaHash: computeSchemaHash(definition) };\n}\n\nexport function inferGroup(strippedName: string): ToolGroup {\n if (strippedName.startsWith(\"erd_\")) return \"erd\";\n if (strippedName.startsWith(\"flow_\")) return \"flow\";\n if (strippedName.startsWith(\"testcase_\")) return \"testcase\";\n if (strippedName.startsWith(\"markdown_\")) return \"markdown\";\n if (strippedName.includes(\"attachment\") || strippedName.includes(\"upload\")) return \"attachment\";\n if (strippedName.startsWith(\"kanban_\")) return \"kanban\";\n if (strippedName.includes(\"workspace\")) return \"workspace\";\n if (strippedName.includes(\"document\")) return \"document\";\n return \"generic\";\n}\n\nexport function generateCommandPath(strippedName: string, group: ToolGroup): string[] {\n if (group !== \"generic\" && strippedName.startsWith(`${group}_`)) {\n return [group, snakeToKebab(strippedName.slice(group.length + 1))];\n }\n\n const [verb, ...rest] = strippedName.split(\"_\");\n if (verb && rest.length > 0 && isVerb(verb)) {\n return [rest.join(\"-\"), verb];\n }\n\n return [\"tools\", \"run\", snakeToKebab(strippedName)];\n}\n\nexport function inferPayloadMode(strippedName: string, inputSchema: JsonSchema): PayloadMode {\n if (strippedName.includes(\"upload\") || strippedName.includes(\"attachment_upload\")) {\n return \"binary-upload\";\n }\n const properties = inputSchema.properties;\n if (!isRecord(properties)) {\n return \"flags\";\n }\n const values = Object.values(properties);\n if (values.length === 0) {\n return \"flags\";\n }\n if (values.every(isScalarSchema)) {\n return \"flags\";\n }\n return \"file-json\";\n}\n\nexport function inferDestructive(strippedName: string, tool: McpToolListItem): boolean {\n if (tool.annotations?.destructiveHint === true) {\n return true;\n }\n return DESTRUCTIVE_PREFIXES.some((prefix) => strippedName.startsWith(prefix));\n}\n\nexport function computeSchemaHash(tool: Omit<GeneratedToolDefinition, \"schemaHash\">): string {\n return createHash(\"sha256\")\n .update(stableStringify({\n name: tool.mcpName,\n description: tool.description,\n inputSchema: tool.inputSchema,\n }))\n .digest(\"hex\")\n .slice(0, 16);\n}\n\nexport function stableStringify(value: unknown): string {\n if (Array.isArray(value)) {\n return `[${value.map(stableStringify).join(\",\")}]`;\n }\n if (isRecord(value)) {\n return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${stableStringify(value[key])}`).join(\",\")}}`;\n }\n return JSON.stringify(value);\n}\n\nexport function serializeGeneratedCatalog(tools: GeneratedToolDefinition[]): string {\n return [\n \"import type { GeneratedToolDefinition } from \\\"./types\\\";\",\n \"\",\n \"export const generatedTools = [\",\n ...tools.map((tool) => ` ${JSON.stringify(tool)},`),\n \"] satisfies GeneratedToolDefinition[];\",\n \"\",\n ].join(\"\\n\");\n}\n\nfunction normalizeSchema(schema: JsonSchema): JsonSchema {\n return JSON.parse(stableStringify(schema)) as JsonSchema;\n}\n\nfunction isScalarSchema(value: unknown): boolean {\n if (!isRecord(value)) {\n return false;\n }\n const type = value.type;\n return type === \"string\" || type === \"number\" || type === \"integer\" || type === \"boolean\";\n}\n\nfunction isVerb(value: string): boolean {\n return [\n \"list\",\n \"get\",\n \"create\",\n \"update\",\n \"delete\",\n \"move\",\n \"restore\",\n \"archive\",\n \"unarchive\",\n \"search\",\n ].includes(value);\n}\n\nfunction snakeToKebab(value: string): string {\n return value.replaceAll(\"_\", \"-\");\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { generatedTools as prodTools } from \"./generated.prod\";\nimport { generatedTools as devTools } from \"./generated.dev\";\nimport { generateCatalog } from \"./generator\";\nimport type { GeneratedToolDefinition, McpToolListItem } from \"./types\";\nimport type { AinectoEnv } from \"../config/endpoints\";\nimport type { McpRpcClient } from \"../mcp/rpcClient\";\n\n/** 이 CLI 판을 빌드할 때 받아 둔 스냅샷 — 서버를 못 부를 때의 대체본이다. */\nexport function getGeneratedTools(env: AinectoEnv) {\n return env === \"dev\" ? devTools : prodTools;\n}\n\n/**\n * ★서버의 지금 도구 목록 — 진실원은 서버다. 스냅샷만 보여 주면 서버에 새 문서 유형(html)이 열려도\n * 에이전트는 «CLI 에 없다»고 판단했다(2026-10-10). 유형·도구가 늘 때마다 CLI 를 다시 배포하지 않으려고\n * 실행할 때 받는다. 실패는 호출처가 스냅샷으로 대체하며 이유를 알린다.\n */\nexport async function loadLiveTools(env: AinectoEnv, client: McpRpcClient): Promise<GeneratedToolDefinition[]> {\n return generateCatalog(await client.toolsList() as McpToolListItem[], env);\n}\n","import { createInterface } from \"node:readline\";\nimport type { Readable, Writable } from \"node:stream\";\nimport { McpRpcClient, type JsonRpcRequest } from \"./rpcClient\";\n\nexport interface StdioBridgeOptions {\n input: Readable;\n output: Writable;\n errorOutput: Writable;\n client: McpRpcClient;\n}\n\nexport async function runStdioBridge(options: StdioBridgeOptions): Promise<void> {\n const lines = createInterface({ input: options.input, crlfDelay: Infinity });\n\n for await (const line of lines) {\n if (!line.trim()) {\n continue;\n }\n try {\n const request = parseJsonRpcRequest(line);\n if (request.method === \"initialize\") {\n // 호스트 에이전트의 고정 이름 — 이 세션의 모든 요청에 X-AiNecto-Agent 로 실린다(initialize 자신 포함).\n options.client.useAgent(clientInfoName(request.params));\n }\n const response = await options.client.sendRaw(request);\n if (response && request.id !== undefined) {\n options.output.write(`${JSON.stringify(response)}\\n`);\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n options.output.write(`${JSON.stringify({\n jsonrpc: \"2.0\",\n id: null,\n error: { code: -32603, message },\n })}\\n`);\n }\n }\n}\n\nfunction parseJsonRpcRequest(line: string): JsonRpcRequest {\n const parsed = JSON.parse(line) as unknown;\n if (!isRecord(parsed) || parsed.jsonrpc !== \"2.0\" || typeof parsed.method !== \"string\") {\n throw new Error(\"Invalid JSON-RPC request.\");\n }\n return {\n jsonrpc: \"2.0\",\n id: typeof parsed.id === \"string\" || typeof parsed.id === \"number\" || parsed.id === null ? parsed.id : undefined,\n method: parsed.method,\n params: parsed.params,\n };\n}\n\nfunction clientInfoName(params: unknown): unknown {\n return isRecord(params) && isRecord(params.clientInfo) ? params.clientInfo.name : undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { FileTokenStore } from \"../../core/auth/tokenStore\";\nimport { OAuthClient } from \"../../core/auth/oauth\";\nimport { McpRpcClient } from \"../../core/mcp/rpcClient\";\nimport { runStdioBridge } from \"../../core/mcp/stdioBridge\";\nimport { LEGACY_ROLE_NOTICE, legacyRoleInput } from \"../../core/harness/legacyRole\";\nimport type { Readable, Writable } from \"node:stream\";\n\nexport interface ConnectorOptions {\n endpoint: string;\n /** 옛 MCP 설정의 {@code --role} 값(검사하지 않는다). 없으면 {@code AINECTO_ROLE} 를 본다 — 기록용. */\n legacyRoleFlag?: string;\n envVars?: NodeJS.ProcessEnv;\n input: Readable;\n output: Writable;\n errorOutput: Writable;\n}\n\nexport async function runConnector(options: ConnectorOptions): Promise<void> {\n // ★토큰은 서버마다 한 칸이다. 세션 역할은 없다 — 도구 목록·권한은 서버가 사용자 권한으로 정한다.\n const legacyRole = legacyRoleInput(options.legacyRoleFlag, options.envVars);\n if (legacyRole !== undefined) {\n // stdout 은 JSON-RPC 전용이다 — 안내는 stderr 로만.\n options.errorOutput.write(`${LEGACY_ROLE_NOTICE}\\n`);\n }\n const auth = new OAuthClient({ endpoint: options.endpoint, tokenStore: new FileTokenStore() });\n const client = new McpRpcClient({\n endpoint: options.endpoint,\n tokenProvider: auth,\n legacyRole,\n // 에이전트의 MCP 연결 — 에이전트 이름은 브리지가 호스트의 initialize 에서 읽어 싣는다.\n channel: \"mcp\",\n });\n await runStdioBridge({\n input: options.input,\n output: options.output,\n errorOutput: options.errorOutput,\n client,\n });\n}\n","import type { ToolPresentationEnrichment } from \"./types\";\n\nexport const enrichments = [\n {\n mcpName: \"list_projects\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"name\", \"projectKey\", \"workspaceUuid\", \"updatedAt\"],\n displayName: \"List projects\",\n examples: [\"ainecto projects list --env dev\"],\n },\n {\n mcpName: \"list_workspaces\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"name\", \"updatedAt\"],\n displayName: \"List workspaces\",\n },\n {\n mcpName: \"list_folders\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"name\", \"projectUuid\", \"parentFolderUuid\", \"updatedAt\"],\n displayName: \"List folders\",\n },\n {\n mcpName: \"list_documents\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"title\", \"type\", \"projectUuid\", \"folderUuid\", \"updatedAt\"],\n displayName: \"List documents\",\n },\n {\n mcpName: \"search_documents\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"title\", \"type\", \"projectUuid\", \"updatedAt\"],\n displayName: \"Search documents\",\n },\n {\n mcpName: \"list_attachments\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"filename\", \"contentType\", \"sizeBytes\", \"documentUuid\"],\n displayName: \"List attachments\",\n },\n {\n mcpName: \"erd_list_tables\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"name\", \"schema_name\", \"display_order\"],\n displayName: \"List ERD tables\",\n },\n {\n mcpName: \"erd_list_refs\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"name\", \"from_table_uuid\", \"to_table_uuid\", \"relationship\"],\n displayName: \"List ERD refs\",\n },\n {\n mcpName: \"erd_list_enums\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"name\", \"display_order\"],\n displayName: \"List ERD enums\",\n },\n {\n mcpName: \"erd_list_table_groups\",\n outputHint: \"table\",\n tableColumns: [\"uuid\", \"name\", \"display_order\"],\n displayName: \"List ERD table groups\",\n },\n {\n mcpName: \"enable_shares\",\n aliases: [\"shares enable\"],\n displayName: \"Enable shares\",\n },\n {\n mcpName: \"disable_shares\",\n aliases: [\"shares disable\"],\n displayName: \"Disable shares\",\n },\n] satisfies ToolPresentationEnrichment[];\n","export interface TableOptions {\n columns?: string[];\n}\n\nexport function renderTable(data: unknown, options: TableOptions = {}): string | undefined {\n const rows = extractRows(data);\n if (!rows.length || !rows.every(isRecord)) {\n return undefined;\n }\n\n const columns = options.columns?.length ? options.columns : inferColumns(rows);\n if (!columns.length) {\n return undefined;\n }\n\n const widths = columns.map((column) => Math.max(column.length, ...rows.map((row) => formatCell(row[column]).length)));\n const header = columns.map((column, index) => column.padEnd(widths[index] ?? column.length)).join(\" \");\n const divider = widths.map((width) => \"-\".repeat(width)).join(\" \");\n const body = rows.map((row) => columns.map((column, index) => formatCell(row[column]).padEnd(widths[index] ?? column.length)).join(\" \"));\n\n return [header, divider, ...body].join(\"\\n\");\n}\n\nfunction extractRows(data: unknown): unknown[] {\n if (Array.isArray(data)) {\n return data;\n }\n if (isRecord(data)) {\n for (const key of [\"items\", \"projects\", \"workspaces\", \"folders\", \"documents\", \"tasks\", \"attachments\", \"results\", \"data\"]) {\n const value = data[key];\n if (Array.isArray(value)) {\n return value;\n }\n }\n }\n return [];\n}\n\nfunction inferColumns(rows: Record<string, unknown>[]): string[] {\n const preferred = [\"uuid\", \"id\", \"name\", \"title\", \"status\", \"type\", \"projectUuid\", \"documentUuid\", \"createdAt\", \"updatedAt\"];\n const keys = new Set(rows.flatMap((row) => Object.keys(row)));\n const columns = preferred.filter((key) => keys.has(key));\n if (columns.length > 0) {\n return columns.slice(0, 6);\n }\n return [...keys].slice(0, 6);\n}\n\nfunction formatCell(value: unknown): string {\n if (value === null || value === undefined) {\n return \"\";\n }\n if (typeof value === \"object\") {\n return JSON.stringify(value);\n }\n return String(value);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","export class CliCommandError extends Error {\n constructor(\n readonly code: string,\n message: string,\n readonly details?: unknown,\n ) {\n super(message);\n }\n}\n","import type { GeneratedToolDefinition, JsonSchema } from \"../../core/catalog/types\";\nimport { parsePayloadSource, type ParsedPayload } from \"../../core/input/payloadSource\";\nimport { CliCommandError } from \"./errors\";\n\nexport interface ParsedCommandArgs {\n args: Record<string, unknown>;\n yes: boolean;\n warnings: string[];\n}\n\nexport async function parseGeneratedCommandArgs(\n tool: GeneratedToolDefinition,\n argv: string[],\n stdin: NodeJS.ReadStream,\n): Promise<ParsedCommandArgs> {\n const parsed = parseArgv(argv);\n const payload = await parsePayload(tool, parsed, stdin);\n const args = payloadToArgs(payload.value);\n const properties = getSchemaProperties(tool.inputSchema);\n\n for (const [key, value] of Object.entries(parsed.flags)) {\n if (key === \"yes\") {\n continue;\n }\n const schemaKey = resolveSchemaKey(key, properties);\n if (!schemaKey) {\n throw new CliCommandError(\"UNKNOWN_FLAG\", `Unknown flag --${key} for ${tool.commandPath.join(\" \")}.`, {\n flag: key,\n mcpName: tool.mcpName,\n });\n }\n args[schemaKey] = coerceFlagValue(value, properties[schemaKey], schemaKey);\n }\n\n for (const required of tool.required) {\n if (args[required] === undefined || args[required] === \"\") {\n throw new CliCommandError(\"MISSING_REQUIRED_FLAG\", `Missing required argument \"${required}\" for ${tool.commandPath.join(\" \")}.`, {\n required,\n flag: `--${camelToKebab(required)}`,\n mcpName: tool.mcpName,\n });\n }\n }\n\n return {\n args,\n yes: parsed.yes,\n warnings: payload.warnings,\n };\n}\n\nfunction payloadToArgs(value: unknown): Record<string, unknown> {\n if (value === undefined || value === null) {\n return {};\n }\n if (!isRecord(value)) {\n throw new CliCommandError(\"INVALID_PAYLOAD\", \"Generated command payload must be a JSON object.\", { value });\n }\n return { ...value };\n}\n\ninterface ParsedArgv {\n flags: Record<string, string | boolean>;\n yes: boolean;\n file?: string;\n inline?: string;\n}\n\nfunction parseArgv(argv: string[]): ParsedArgv {\n const flags: Record<string, string | boolean> = {};\n const inline: string[] = [];\n let file: string | undefined;\n let yes = false;\n\n for (let index = 0; index < argv.length; index += 1) {\n const arg = argv[index];\n if (!arg) {\n continue;\n }\n if (arg === \"--file\" || arg === \"-f\") {\n file = requireValue(arg, argv[++index]);\n continue;\n }\n if (arg === \"--yes\" || arg === \"-y\") {\n yes = true;\n flags.yes = true;\n continue;\n }\n if (arg.startsWith(\"--\")) {\n const withoutPrefix = arg.slice(2);\n const eqIndex = withoutPrefix.indexOf(\"=\");\n if (eqIndex >= 0) {\n const key = withoutPrefix.slice(0, eqIndex);\n flags[key] = withoutPrefix.slice(eqIndex + 1);\n continue;\n }\n const next = argv[index + 1];\n if (!next || next.startsWith(\"--\")) {\n flags[withoutPrefix] = true;\n continue;\n }\n flags[withoutPrefix] = next;\n index += 1;\n continue;\n }\n inline.push(arg);\n }\n\n return {\n flags,\n yes,\n file,\n inline: inline.length > 0 ? inline.join(\" \") : undefined,\n };\n}\n\nasync function parsePayload(\n tool: GeneratedToolDefinition,\n parsed: ParsedArgv,\n stdin: NodeJS.ReadStream,\n): Promise<ParsedPayload> {\n if (tool.payloadMode === \"file-json\" || parsed.file || parsed.inline) {\n return parsePayloadSource({\n file: parsed.file,\n inline: parsed.inline,\n stdin,\n });\n }\n\n return { value: {}, source: \"empty\", warnings: [] };\n}\n\nfunction resolveSchemaKey(flag: string, properties: Record<string, JsonSchema>): string | undefined {\n if (properties[flag]) {\n return flag;\n }\n const normalized = flag.toLowerCase();\n return Object.keys(properties).find((key) => camelToKebab(key) === normalized);\n}\n\nfunction coerceFlagValue(value: string | boolean, schema: JsonSchema | undefined, key: string): unknown {\n const type = schema?.type;\n if (type === \"boolean\") {\n if (typeof value === \"boolean\") {\n return value;\n }\n if (value === \"true\") return true;\n if (value === \"false\") return false;\n throw new CliCommandError(\"INVALID_FLAG_VALUE\", `Flag \"${key}\" must be a boolean.`, { key, value });\n }\n if (type === \"string\") {\n if (typeof value === \"boolean\") {\n throw new CliCommandError(\"FLAG_REQUIRES_VALUE\", `--${camelToKebab(key)} requires a value.`, { key });\n }\n return value;\n }\n if (type === \"integer\") {\n if (typeof value === \"boolean\" || !/^-?\\d+$/.test(value)) {\n const code = typeof value === \"boolean\" ? \"FLAG_REQUIRES_VALUE\" : \"INVALID_FLAG_VALUE\";\n throw new CliCommandError(code, `Flag \"${key}\" must be an integer.`, { key, value });\n }\n return Number.parseInt(value, 10);\n }\n if (type === \"number\") {\n if (typeof value === \"boolean\" || Number.isNaN(Number(value))) {\n const code = typeof value === \"boolean\" ? \"FLAG_REQUIRES_VALUE\" : \"INVALID_FLAG_VALUE\";\n throw new CliCommandError(code, `Flag \"${key}\" must be a number.`, { key, value });\n }\n return Number(value);\n }\n throw new CliCommandError(\"UNSUPPORTED_FLAG_PAYLOAD\", `Flag \"${key}\" is not a scalar field; provide it through --file, stdin, or inline JSON.`, {\n key,\n type,\n });\n}\n\nfunction getSchemaProperties(schema: JsonSchema): Record<string, JsonSchema> {\n const properties = schema.properties;\n if (!isRecord(properties)) {\n return {};\n }\n const result: Record<string, JsonSchema> = {};\n for (const [key, value] of Object.entries(properties)) {\n if (isRecord(value)) {\n result[key] = value;\n }\n }\n return result;\n}\n\nexport function camelToKebab(value: string): string {\n return value.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`).toLowerCase();\n}\n\nfunction requireValue(flag: string, value: string | undefined): string {\n if (!value || value.startsWith(\"--\")) {\n throw new CliCommandError(\"FLAG_REQUIRES_VALUE\", `${flag} requires a value.`, { flag });\n }\n return value;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { createInterface } from \"node:readline\";\nimport type { GeneratedToolDefinition } from \"../../core/catalog/types\";\nimport { CliCommandError } from \"./errors\";\n\nexport interface ConfirmationIO {\n stdin: NodeJS.ReadStream;\n stderr: NodeJS.WriteStream;\n}\n\nexport async function confirmDestructiveCommand(options: {\n tool: GeneratedToolDefinition;\n yes: boolean;\n json: boolean;\n io: ConfirmationIO;\n}): Promise<void> {\n if (!options.tool.destructive) {\n return;\n }\n if (options.yes) {\n return;\n }\n if (options.json) {\n throw new CliCommandError(\"CONFIRMATION_REQUIRED\", `Destructive command ${options.tool.commandPath.join(\" \")} requires --yes in --json mode.`, {\n mcpName: options.tool.mcpName,\n });\n }\n\n const answer = await promptConfirmation(options.io, `Run destructive command ${options.tool.commandPath.join(\" \")}? Type \"yes\" to continue: `);\n if (answer.trim().toLowerCase() !== \"yes\") {\n throw new CliCommandError(\"CONFIRMATION_DECLINED\", \"Destructive command was not confirmed.\", {\n mcpName: options.tool.mcpName,\n });\n }\n}\n\nasync function promptConfirmation(io: ConfirmationIO, message: string): Promise<string> {\n io.stderr.write(message);\n const rl = createInterface({ input: io.stdin, terminal: false });\n try {\n for await (const line of rl) {\n return line;\n }\n return \"\";\n } finally {\n rl.close();\n }\n}\n","export const ATTACHMENTS_UPLOAD_COMMAND_PATH = [\"attachments\", \"upload\"] as const;\n/** 알림·할 일 폴링(종료 코드 0 = 새 것 있음 · 3 = 없음) — inboxPollCommands.ts. */\nexport const NOTIFICATIONS_POLL_COMMAND_PATH = [\"notifications\", \"poll\"] as const;\nexport const NOTIFICATIONS_ACK_COMMAND_PATH = [\"notifications\", \"ack\"] as const;\nexport const AGENT_TODOS_POLL_COMMAND_PATH = [\"agent-todos\", \"poll\"] as const;\n\nexport const BESPOKE_COMMAND_PATHS = [\n ATTACHMENTS_UPLOAD_COMMAND_PATH,\n NOTIFICATIONS_POLL_COMMAND_PATH,\n NOTIFICATIONS_ACK_COMMAND_PATH,\n AGENT_TODOS_POLL_COMMAND_PATH,\n] as const;\n","import type { McpRpcClient } from \"../../core/mcp/rpcClient\";\nimport type { GeneratedToolDefinition, ToolPresentationEnrichment } from \"../../core/catalog/types\";\nimport { enrichments } from \"../../core/catalog/enrichments\";\nimport { getGeneratedTools } from \"../../core/catalog\";\nimport type { AinectoEnv } from \"../../core/config/endpoints\";\nimport { renderSuccess } from \"../../core/output/render\";\nimport { isToolError } from \"../../core/mcp/rpcClient\";\nimport { renderTable } from \"../../core/output/table\";\nimport { parseGeneratedCommandArgs } from \"./flagParser\";\nimport { confirmDestructiveCommand, type ConfirmationIO } from \"./destructiveConfirmation\";\nimport { BESPOKE_COMMAND_PATHS } from \"./bespokeCommands\";\n\nexport interface GeneratedCommandRoute {\n tool: GeneratedToolDefinition;\n matchedPath: string[];\n rest: string[];\n presentation?: ToolPresentationEnrichment;\n rawContractWarning?: string;\n}\n\nexport interface GeneratedCommandExecutionOptions {\n /** 라우팅할 도구 목록 — 스냅샷이거나, 스냅샷에 없는 명령이면 서버의 지금 목록. */\n tools: readonly GeneratedToolDefinition[];\n argv: string[];\n client: McpRpcClient;\n json: boolean;\n io: ConfirmationIO & { stdout: NodeJS.WriteStream };\n}\n\nexport function matchGeneratedCommand(\n tools: readonly GeneratedToolDefinition[],\n argv: string[],\n): GeneratedCommandRoute | undefined {\n const commandTokens = argv.filter((arg) => !arg.startsWith(\"-\"));\n const entries = buildRouteEntries(tools, enrichments);\n const match = entries\n .filter((entry) => isPrefix(entry.path, commandTokens))\n .sort((a, b) => b.path.length - a.path.length)[0];\n\n if (!match) {\n return undefined;\n }\n\n const restStart = findRestStart(argv, match.path);\n return {\n tool: match.tool,\n matchedPath: match.path,\n rest: argv.slice(restStart),\n presentation: match.presentation,\n rawContractWarning: match.tool.payloadMode === \"binary-upload\"\n ? \"This generated command uses the raw MCP argument contract only; local file upload semantics are not implemented here.\"\n : undefined,\n };\n}\n\nexport async function executeGeneratedCommand(options: GeneratedCommandExecutionOptions): Promise<number> {\n const route = matchGeneratedCommand(options.tools, options.argv);\n if (!route) {\n return 2;\n }\n\n const parsed = await parseGeneratedCommandArgs(route.tool, route.rest, options.io.stdin);\n await confirmDestructiveCommand({\n tool: route.tool,\n yes: parsed.yes,\n json: options.json,\n io: options.io,\n });\n\n const result = await options.client.toolsCall(route.tool.mcpName, parsed.args);\n const warnings = [...parsed.warnings, ...(route.rawContractWarning ? [route.rawContractWarning] : [])];\n options.io.stdout.write(renderGeneratedResult(result, {\n json: options.json,\n warnings,\n presentation: route.presentation,\n }));\n // ★도구가 «거부»한 것을 성공으로 보고하지 않는다 — 셸 자동화는 exit 코드를 본다.\n return isToolError(result) ? 1 : 0;\n}\n\nexport function assertNoCommandCollisions(env: AinectoEnv): void {\n const entries = buildRouteEntries(getGeneratedTools(env), enrichments);\n const seen = new Map<string, string>();\n for (const entry of entries) {\n const key = entry.path.join(\" \");\n const existing = seen.get(key);\n if (existing) {\n throw new Error(`Command collision for \"${key}\": ${existing} and ${entry.tool.mcpName}`);\n }\n seen.set(key, entry.tool.mcpName);\n }\n for (const commandPath of BESPOKE_COMMAND_PATHS) {\n const command = commandPath.join(\" \");\n const existing = seen.get(command);\n if (existing) {\n throw new Error(`Bespoke command \"${command}\" collides with ${existing}.`);\n }\n }\n}\n\nfunction renderGeneratedResult(\n result: unknown,\n options: {\n json: boolean;\n warnings: string[];\n presentation?: ToolPresentationEnrichment;\n },\n): string {\n if (!options.json && options.presentation?.outputHint === \"table\") {\n const table = renderTable(result, { columns: options.presentation.tableColumns });\n if (table) {\n const warnings = options.warnings.length ? `${options.warnings.map((warning) => `Warning: ${warning}`).join(\"\\n\")}\\n` : \"\";\n return `${warnings}${table}\\n`;\n }\n }\n return renderSuccess(result, { json: options.json, warnings: options.warnings });\n}\n\nfunction buildRouteEntries(\n tools: readonly GeneratedToolDefinition[],\n presentations: readonly ToolPresentationEnrichment[],\n): Array<{ path: string[]; tool: GeneratedToolDefinition; presentation?: ToolPresentationEnrichment }> {\n const byName = new Map(presentations.map((presentation) => [presentation.mcpName, presentation]));\n const entries: Array<{ path: string[]; tool: GeneratedToolDefinition; presentation?: ToolPresentationEnrichment }> = [];\n for (const tool of tools) {\n const presentation = byName.get(tool.mcpName);\n entries.push({ path: tool.commandPath, tool, presentation });\n for (const alias of presentation?.aliases ?? []) {\n entries.push({ path: alias.split(/\\s+/).filter(Boolean), tool, presentation });\n }\n }\n return entries;\n}\n\nfunction isPrefix(prefix: string[], values: string[]): boolean {\n return prefix.every((value, index) => values[index] === value);\n}\n\nfunction findRestStart(argv: string[], commandPath: string[]): number {\n let matched = 0;\n for (let index = 0; index < argv.length; index += 1) {\n if (!argv[index]?.startsWith(\"-\")) {\n if (argv[index] !== commandPath[matched]) {\n return index;\n }\n matched += 1;\n if (matched === commandPath.length) {\n return index + 1;\n }\n }\n }\n return argv.length;\n}\n","import { readFile, stat } from \"node:fs/promises\";\nimport { basename, extname } from \"node:path\";\nimport { McpRpcClient } from \"../mcp/rpcClient\";\nimport { unwrapMcpToolPayload } from \"../mcp/toolPayload\";\n\nexport interface AttachmentUploadFileInput {\n path: string;\n filename?: string;\n contentType?: string;\n}\n\nexport interface UploadAttachmentsInput {\n documentUuid: string;\n files: AttachmentUploadFileInput[];\n maxBytes?: number;\n ttlSeconds?: number;\n requestToolName?: string;\n commitToolName?: string;\n fetchImpl?: typeof fetch;\n onProgress?: (progress: AttachmentUploadProgress) => void;\n}\n\nexport type AttachmentUploadStage = \"token\" | \"put\" | \"register\" | \"done\";\n\nexport interface AttachmentUploadProgress {\n stage: AttachmentUploadStage;\n path: string;\n filename: string;\n index: number;\n total: number;\n}\n\nexport interface RegisteredAttachmentFile {\n path: string;\n documentUuid: string;\n filename: string;\n storageKey: string;\n contentType: string;\n sizeBytes: number;\n registerResult: unknown;\n}\n\nexport interface UploadAttachmentsResult {\n count: number;\n uploaded: RegisteredAttachmentFile[];\n}\n\nexport class AttachmentUploadError extends Error {\n constructor(\n readonly code: string,\n message: string,\n readonly details?: unknown,\n ) {\n super(message);\n }\n}\n\nexport async function uploadAttachments(\n client: McpRpcClient,\n input: UploadAttachmentsInput,\n): Promise<UploadAttachmentsResult> {\n if (!input.documentUuid.trim()) {\n throw new AttachmentUploadError(\"MISSING_REQUIRED_FLAG\", \"Missing required argument \\\"documentUuid\\\".\", {\n flag: \"--document-uuid\",\n });\n }\n if (input.files.length === 0) {\n throw new AttachmentUploadError(\"MISSING_FILE\", \"Expected at least one file to upload.\");\n }\n\n const fetchImpl = input.fetchImpl ?? fetch;\n const uploaded: RegisteredAttachmentFile[] = [];\n\n for (let index = 0; index < input.files.length; index += 1) {\n const file = input.files[index];\n if (!file) {\n continue;\n }\n uploaded.push(await uploadSingleAttachment(client, file, {\n documentUuid: input.documentUuid,\n maxBytes: input.maxBytes,\n ttlSeconds: input.ttlSeconds,\n requestToolName: input.requestToolName ?? \"mcp__ainecto__request_upload_token\",\n commitToolName: input.commitToolName ?? \"mcp__ainecto__upload_attachments\",\n fetchImpl,\n onProgress: input.onProgress,\n index,\n total: input.files.length,\n }));\n }\n\n return { count: uploaded.length, uploaded };\n}\n\ninterface SingleUploadContext {\n documentUuid: string;\n maxBytes?: number;\n ttlSeconds?: number;\n requestToolName: string;\n commitToolName: string;\n fetchImpl: typeof fetch;\n onProgress?: (progress: AttachmentUploadProgress) => void;\n index: number;\n total: number;\n}\n\ninterface UploadTokenResponse {\n token: string;\n uploadUrl: string;\n storageKey: string;\n}\n\ninterface UploadPutResponse {\n storageKey: string;\n sizeBytes: number;\n contentType: string;\n}\n\nasync function uploadSingleAttachment(\n client: McpRpcClient,\n file: AttachmentUploadFileInput,\n context: SingleUploadContext,\n): Promise<RegisteredAttachmentFile> {\n const metadata = await readFileMetadata(file);\n emitProgress(context, \"token\", file.path, metadata.filename);\n const uploadToken = await requestUploadToken(client, metadata, context);\n\n emitProgress(context, \"put\", file.path, metadata.filename);\n const putResult = await putAttachmentBytes(uploadToken, metadata, context.fetchImpl);\n validatePutResult(uploadToken, metadata, putResult);\n\n const item = {\n documentUuid: context.documentUuid,\n filename: metadata.filename,\n storageKey: uploadToken.storageKey,\n contentType: putResult.contentType,\n sizeBytes: putResult.sizeBytes,\n };\n\n emitProgress(context, \"register\", file.path, metadata.filename);\n const registerResult = await client.toolsCall(context.commitToolName, { items: [item] });\n\n emitProgress(context, \"done\", file.path, metadata.filename);\n return {\n path: file.path,\n documentUuid: context.documentUuid,\n filename: metadata.filename,\n storageKey: uploadToken.storageKey,\n contentType: putResult.contentType,\n sizeBytes: putResult.sizeBytes,\n registerResult,\n };\n}\n\nasync function readFileMetadata(file: AttachmentUploadFileInput): Promise<{\n bytes: Buffer;\n filename: string;\n contentType: string;\n sizeBytes: number;\n}> {\n const stats = await stat(file.path);\n if (!stats.isFile()) {\n throw new AttachmentUploadError(\"INVALID_FILE\", `Attachment path is not a file: ${file.path}`, { path: file.path });\n }\n const bytes = await readFile(file.path);\n return {\n bytes,\n filename: file.filename ?? basename(file.path),\n contentType: file.contentType ?? detectContentType(file.path),\n sizeBytes: bytes.byteLength,\n };\n}\n\nasync function requestUploadToken(\n client: McpRpcClient,\n metadata: { filename: string; contentType: string; sizeBytes: number },\n context: SingleUploadContext,\n): Promise<UploadTokenResponse> {\n const scopeJson = JSON.stringify({\n documentUuid: context.documentUuid,\n filename: metadata.filename,\n contentType: metadata.contentType,\n sizeBytes: metadata.sizeBytes,\n });\n const requestArgs: Record<string, unknown> = {\n purpose: \"attachment.upload\",\n scopeJson,\n };\n if (context.maxBytes !== undefined) {\n requestArgs.maxBytes = context.maxBytes;\n }\n if (context.ttlSeconds !== undefined) {\n requestArgs.ttlSeconds = context.ttlSeconds;\n }\n\n const response = unwrapMcpToolPayload(await client.toolsCall(context.requestToolName, requestArgs));\n if (!isRecord(response)) {\n throw new AttachmentUploadError(\"UPLOAD_TOKEN_PROTOCOL_ERROR\", \"request_upload_token response was not an object.\");\n }\n const token = response.token;\n const uploadUrl = response.uploadUrl;\n const storageKey = response.storageKey;\n if (typeof token !== \"string\" || token.length === 0) {\n throw new AttachmentUploadError(\"UPLOAD_TOKEN_PROTOCOL_ERROR\", \"request_upload_token response did not include token.\");\n }\n if (typeof uploadUrl !== \"string\" || uploadUrl.length === 0) {\n throw new AttachmentUploadError(\"UPLOAD_TOKEN_PROTOCOL_ERROR\", \"request_upload_token response did not include uploadUrl.\");\n }\n if (typeof storageKey !== \"string\" || storageKey.length === 0) {\n throw new AttachmentUploadError(\"UPLOAD_TOKEN_PROTOCOL_ERROR\", \"request_upload_token response did not include storageKey.\");\n }\n return { token, uploadUrl, storageKey };\n}\n\nasync function putAttachmentBytes(\n token: UploadTokenResponse,\n metadata: { bytes: Buffer; contentType: string },\n fetchImpl: typeof fetch,\n): Promise<UploadPutResponse> {\n const maxAttempts = 3;\n let lastRetryableError: unknown;\n for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {\n try {\n const response = await fetchImpl(token.uploadUrl, {\n method: \"PUT\",\n headers: {\n authorization: `Bearer ${token.token}`,\n \"content-type\": metadata.contentType,\n },\n body: new Uint8Array(metadata.bytes),\n });\n if (shouldRetryResponse(response.status) && attempt < maxAttempts) {\n continue;\n }\n if (!response.ok) {\n throw uploadHttpError(response.status);\n }\n return parsePutResponse(await response.text());\n } catch (error) {\n if (error instanceof AttachmentUploadError) {\n throw error;\n }\n lastRetryableError = error;\n if (attempt === maxAttempts) {\n break;\n }\n }\n }\n throw new AttachmentUploadError(\"ATTACHMENT_UPLOAD_FAILED\", \"Attachment upload failed.\", {\n cause: lastRetryableError instanceof Error ? lastRetryableError.message : String(lastRetryableError),\n });\n}\n\nfunction uploadHttpError(status: number): AttachmentUploadError {\n if (status === 409) {\n return new AttachmentUploadError(\"ATTACHMENT_UPLOAD_CONFLICT\", \"Attachment upload failed with HTTP 409 Conflict.\", { status });\n }\n if (status === 401 || status === 403) {\n return new AttachmentUploadError(\"ATTACHMENT_UPLOAD_TOKEN_EXPIRED\", `Attachment upload token was rejected with HTTP ${status}.`, { status });\n }\n return new AttachmentUploadError(\"ATTACHMENT_UPLOAD_HTTP_ERROR\", `Attachment upload failed with HTTP ${status}.`, { status });\n}\n\nfunction shouldRetryResponse(status: number): boolean {\n return status === 429 || status >= 500;\n}\n\nfunction parsePutResponse(text: string): UploadPutResponse {\n let parsed: unknown;\n try {\n parsed = JSON.parse(text);\n } catch {\n throw new AttachmentUploadError(\"ATTACHMENT_UPLOAD_PROTOCOL_ERROR\", \"Attachment PUT response was not valid JSON.\");\n }\n if (!isRecord(parsed)) {\n throw new AttachmentUploadError(\"ATTACHMENT_UPLOAD_PROTOCOL_ERROR\", \"Attachment PUT response was not an object.\");\n }\n if (typeof parsed.storageKey !== \"string\") {\n throw new AttachmentUploadError(\"ATTACHMENT_UPLOAD_PROTOCOL_ERROR\", \"Attachment PUT response did not include storageKey.\");\n }\n if (typeof parsed.sizeBytes !== \"number\" || !Number.isFinite(parsed.sizeBytes)) {\n throw new AttachmentUploadError(\"ATTACHMENT_UPLOAD_PROTOCOL_ERROR\", \"Attachment PUT response did not include numeric sizeBytes.\");\n }\n if (typeof parsed.contentType !== \"string\") {\n throw new AttachmentUploadError(\"ATTACHMENT_UPLOAD_PROTOCOL_ERROR\", \"Attachment PUT response did not include contentType.\");\n }\n return {\n storageKey: parsed.storageKey,\n sizeBytes: parsed.sizeBytes,\n contentType: parsed.contentType,\n };\n}\n\nfunction validatePutResult(\n token: UploadTokenResponse,\n metadata: { sizeBytes: number },\n putResult: UploadPutResponse,\n): void {\n if (putResult.storageKey !== token.storageKey) {\n throw new AttachmentUploadError(\"ATTACHMENT_UPLOAD_STORAGE_KEY_MISMATCH\", \"Attachment PUT response storageKey did not match the upload token.\", {\n expected: token.storageKey,\n actual: putResult.storageKey,\n });\n }\n if (putResult.sizeBytes !== metadata.sizeBytes) {\n throw new AttachmentUploadError(\"ATTACHMENT_UPLOAD_SIZE_MISMATCH\", \"Attachment PUT response sizeBytes did not match the local file size.\", {\n expected: metadata.sizeBytes,\n actual: putResult.sizeBytes,\n });\n }\n}\n\nfunction emitProgress(\n context: SingleUploadContext,\n stage: AttachmentUploadStage,\n path: string,\n filename: string,\n): void {\n context.onProgress?.({\n stage,\n path,\n filename,\n index: context.index,\n total: context.total,\n });\n}\n\nfunction detectContentType(path: string): string {\n const extension = extname(path).toLowerCase();\n return MIME_BY_EXTENSION[extension] ?? \"application/octet-stream\";\n}\n\nconst MIME_BY_EXTENSION: Record<string, string> = {\n \".avif\": \"image/avif\",\n \".csv\": \"text/csv\",\n \".gif\": \"image/gif\",\n \".htm\": \"text/html\",\n \".html\": \"text/html\",\n \".jpeg\": \"image/jpeg\",\n \".jpg\": \"image/jpeg\",\n \".json\": \"application/json\",\n \".md\": \"text/markdown\",\n \".pdf\": \"application/pdf\",\n \".png\": \"image/png\",\n \".svg\": \"image/svg+xml\",\n \".txt\": \"text/plain\",\n \".webp\": \"image/webp\",\n \".xls\": \"application/vnd.ms-excel\",\n \".xlsx\": \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n \".zip\": \"application/zip\",\n};\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","/**\n * MCP 도구 결과 → 도구가 돌려준 JSON 객체. 서버는 결과를 `content[].text` 에 JSON 문자열로 싣는다(뒤에 안내 문장이 붙을 수 있다).\n * JSON 으로 시작하는 첫 text 를 읽고, 못 읽으면 받은 값을 그대로 돌려준다.\n */\nexport function unwrapMcpToolPayload(value: unknown): unknown {\n if (!isRecord(value) || !Array.isArray(value.content)) {\n return value;\n }\n const text = value.content\n .map((item) => isRecord(item) && typeof item.text === \"string\" ? item.text : \"\")\n .find((itemText) => itemText.trim().startsWith(\"{\"));\n if (!text) {\n return value;\n }\n try {\n return JSON.parse(text) as unknown;\n } catch {\n return value;\n }\n}\n\n/** 도구가 거부했을 때 사람이 읽을 사유 — content text 를 이어 붙인다. */\nexport function toolErrorText(value: unknown): string {\n if (!isRecord(value) || !Array.isArray(value.content)) {\n return \"The tool returned an error.\";\n }\n const text = value.content\n .map((item) => isRecord(item) && typeof item.text === \"string\" ? item.text : \"\")\n .filter(Boolean)\n .join(\"\\n\");\n return text || \"The tool returned an error.\";\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * 응답 모양을 단정하지 않고 «uuid 와 name 을 가진 객체의 배열»을 찾는다(list_projects 등).\n * ⚠도구 응답 포맷을 여기 박아 두면 서버가 한 겹 감싸는 순간 조용히 빈 목록이 된다.\n */\nexport function extractProjects(value: unknown): Array<{ uuid: string; name: string }> {\n const candidates: unknown[] = Array.isArray(value)\n ? value\n : isRecord(value)\n ? [\"projects\", \"items\", \"created\", \"data\", \"hits\"].flatMap((key) => {\n const nested = value[key];\n return Array.isArray(nested) ? nested : [];\n })\n : [];\n const projects: Array<{ uuid: string; name: string }> = [];\n for (const candidate of candidates) {\n if (isRecord(candidate) && typeof candidate.uuid === \"string\") {\n projects.push({\n uuid: candidate.uuid,\n name: typeof candidate.name === \"string\" ? candidate.name : candidate.uuid,\n });\n }\n }\n return projects;\n}\n","import type { McpRpcClient } from \"../../core/mcp/rpcClient\";\nimport {\n uploadAttachments,\n type AttachmentUploadProgress,\n type UploadAttachmentsResult,\n} from \"../../core/upload/attachmentUpload\";\nimport { renderSuccess } from \"../../core/output/render\";\nimport { CliCommandError } from \"./errors\";\nimport { ATTACHMENTS_UPLOAD_COMMAND_PATH } from \"./bespokeCommands\";\n\nexport interface AttachmentsUploadCommandOptions {\n argv: string[];\n client: McpRpcClient;\n json: boolean;\n io: {\n stdout: NodeJS.WriteStream;\n stderr: NodeJS.WriteStream;\n };\n}\n\nexport function isAttachmentsUploadCommand(domain: string | undefined, action: string | undefined): boolean {\n return domain === ATTACHMENTS_UPLOAD_COMMAND_PATH[0] && action === ATTACHMENTS_UPLOAD_COMMAND_PATH[1];\n}\n\nexport async function executeAttachmentsUploadCommand(options: AttachmentsUploadCommandOptions): Promise<number> {\n const parsed = parseAttachmentsUploadArgs(options.argv);\n const result = await uploadAttachments(options.client, {\n documentUuid: parsed.documentUuid,\n files: parsed.files.map((path) => ({\n path,\n filename: parsed.filename,\n contentType: parsed.contentType,\n })),\n maxBytes: parsed.maxBytes,\n ttlSeconds: parsed.ttlSeconds,\n onProgress: options.json ? undefined : (progress) => {\n renderProgress(progress, options.io.stderr);\n },\n });\n\n options.io.stdout.write(renderAttachmentUploadResult(result, options.json));\n return 0;\n}\n\ninterface ParsedAttachmentsUploadArgs {\n documentUuid: string;\n files: string[];\n filename?: string;\n contentType?: string;\n maxBytes?: number;\n ttlSeconds?: number;\n}\n\nfunction parseAttachmentsUploadArgs(argv: string[]): ParsedAttachmentsUploadArgs {\n const files: string[] = [];\n let documentUuid: string | undefined;\n let filename: string | undefined;\n let contentType: string | undefined;\n let maxBytes: number | undefined;\n let ttlSeconds: number | undefined;\n let readFilesOnly = false;\n\n for (let index = 0; index < argv.length; index += 1) {\n const arg = argv[index];\n if (!arg) {\n continue;\n }\n if (readFilesOnly) {\n files.push(arg);\n continue;\n }\n if (arg === \"--\") {\n readFilesOnly = true;\n continue;\n }\n if (arg === \"--document-uuid\" || arg === \"--documentUuid\") {\n documentUuid = requireValue(arg, argv[++index]);\n continue;\n }\n if (arg === \"--filename\" || arg === \"--name\") {\n filename = requireValue(arg, argv[++index]);\n continue;\n }\n if (arg === \"--content-type\" || arg === \"--contentType\") {\n contentType = requireValue(arg, argv[++index]);\n continue;\n }\n if (arg === \"--max-bytes\" || arg === \"--maxBytes\") {\n maxBytes = parsePositiveInteger(arg, requireValue(arg, argv[++index]));\n continue;\n }\n if (arg === \"--ttl-seconds\" || arg === \"--ttlSeconds\") {\n ttlSeconds = parsePositiveInteger(arg, requireValue(arg, argv[++index]));\n continue;\n }\n if (arg.startsWith(\"--\")) {\n throw new CliCommandError(\"UNKNOWN_FLAG\", `Unknown flag ${arg} for attachments upload.`, { flag: arg });\n }\n files.push(arg);\n }\n\n if (!documentUuid) {\n throw new CliCommandError(\"MISSING_REQUIRED_FLAG\", \"Missing required argument \\\"documentUuid\\\" for attachments upload.\", {\n flag: \"--document-uuid\",\n });\n }\n if (files.length === 0) {\n throw new CliCommandError(\"MISSING_FILE\", \"Expected at least one file to upload.\");\n }\n if (filename && files.length !== 1) {\n throw new CliCommandError(\"INVALID_FLAG_VALUE\", \"--filename/--name can only be used with exactly one file.\", {\n flag: \"--filename\",\n files: files.length,\n });\n }\n\n return {\n documentUuid,\n files,\n filename,\n contentType,\n maxBytes,\n ttlSeconds,\n };\n}\n\nfunction parsePositiveInteger(flag: string, value: string): number {\n if (!/^[1-9]\\d*$/.test(value)) {\n throw new CliCommandError(\"INVALID_FLAG_VALUE\", `${flag} must be a positive integer.`, { flag, value });\n }\n return Number.parseInt(value, 10);\n}\n\nfunction requireValue(flag: string, value: string | undefined): string {\n if (!value || value.startsWith(\"--\")) {\n throw new CliCommandError(\"FLAG_REQUIRES_VALUE\", `${flag} requires a value.`, { flag });\n }\n return value;\n}\n\nfunction renderProgress(progress: AttachmentUploadProgress, stderr: NodeJS.WriteStream): void {\n if (progress.stage === \"token\") {\n stderr.write(`Uploading ${progress.filename} (${progress.index + 1}/${progress.total})...\\n`);\n }\n}\n\nfunction renderAttachmentUploadResult(result: UploadAttachmentsResult, json: boolean): string {\n if (json) {\n return renderSuccess(result, { json });\n }\n const lines = [\n `Uploaded ${result.count} attachment${result.count === 1 ? \"\" : \"s\"}.`,\n ...result.uploaded.map((file) => `- ${file.filename} (${file.sizeBytes} bytes)`),\n ];\n return renderSuccess(lines.join(\"\\n\"), { json: false });\n}\n","/**\n * 알림·할 일 «폴링» 명령 — 사람이 cron/launchd 에 걸어 «새 것이 있을 때만» 에이전트를 깨우게 한다(사건 기록 S2, 설계 §6-4 (5)).\n *\n * ainecto notifications poll --cursor-file <path> [--kinds A,B] [--workspace <uuid>]... [--project <uuid>]... [--direct-only] [--limit N] [--json]\n * ainecto notifications ack --cursor-file <path> [--json]\n * ainecto agent-todos poll [--workspace <uuid>]... [--project <uuid>]... [--only-new --seen-file <path>] [--json]\n *\n * --workspace · --project 는 여러 번 줄 수 있다. 같은 축 안은 OR, 축 사이는 AND(서버가 판정).\n *\n * ★종료 코드: 0 = 새 항목 있음 · 3 = 새 항목 없음 · 1 = 오류 · 2 = 사용법 오류(기존 0/1/2 와 충돌하지 않는다).\n *\n * 알림 증분은 «받기 → (에이전트) → 성공했을 때만 ack» 다. poll 은 받은 배치와 ackToken 을 ★커서 파일에 먼저 저장(fsync)한 뒤\n * 출력하고, ack 전까지 다시 부르면 서버에 묻지 않고 ★같은 배치를 다시 출력한다 — 에이전트가 실패하면 다음 회차에 같은 것을\n * 다시 받는다. ack 는 파일의 보류 ackToken 을 서버에 보내고 파일에서 지운다. 서버 커서는 ack 로만 움직인다.\n *\n * 할 일은 «지금 열린 것» 의 상태 조회다. --only-new 는 본 할 일 id 를 로컬 파일에 적어 «처음 보는 것이 있을 때만» 0 을 낸다\n * (같은 할 일로 5분마다 에이전트를 깨우지 않게 — 서버 상태 0).\n */\nimport { mkdir, open, readFile, rename } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\nimport type { McpRpcClient } from \"../../core/mcp/rpcClient\";\nimport { isToolError } from \"../../core/mcp/rpcClient\";\nimport { toolErrorText, unwrapMcpToolPayload } from \"../../core/mcp/toolPayload\";\nimport { renderError, renderSuccess } from \"../../core/output/render\";\nimport { CliCommandError } from \"./errors\";\nimport { AGENT_TODOS_POLL_COMMAND_PATH, NOTIFICATIONS_ACK_COMMAND_PATH, NOTIFICATIONS_POLL_COMMAND_PATH } from \"./bespokeCommands\";\n\n/** 새 항목 없음 — 셸이 `&&` 로 에이전트 실행을 건너뛰게. */\nexport const EXIT_NOTHING_NEW = 3;\n\nconst LIST_NOTIFICATIONS = \"mcp__ainecto__list_notifications\";\nconst LIST_AGENT_TODOS = \"mcp__ainecto__list_agent_todos\";\n\nexport interface InboxCommandOptions {\n domain: string | undefined;\n action: string | undefined;\n argv: string[];\n client: McpRpcClient;\n json: boolean;\n io: { stdout: NodeJS.WriteStream; stderr: NodeJS.WriteStream };\n}\n\nexport function isInboxPollCommand(domain: string | undefined, action: string | undefined): boolean {\n return [NOTIFICATIONS_POLL_COMMAND_PATH, NOTIFICATIONS_ACK_COMMAND_PATH, AGENT_TODOS_POLL_COMMAND_PATH]\n .some(([d, a]) => d === domain && a === action);\n}\n\n/** 사용법 오류 — 종료 코드 2(설계 §6-4 (5)). */\nexport const EXIT_USAGE = 2;\nconst USAGE_ERRORS = new Set([\"UNKNOWN_FLAG\", \"FLAG_REQUIRES_VALUE\", \"MISSING_REQUIRED_FLAG\", \"INVALID_FLAG_VALUE\"]);\n\nexport async function executeInboxPollCommand(options: InboxCommandOptions): Promise<number> {\n try {\n if (options.domain === \"agent-todos\") return await agentTodosPoll(options);\n if (options.action === \"ack\") return await notificationsAck(options);\n return await notificationsPoll(options);\n } catch (error) {\n if (error instanceof CliCommandError && USAGE_ERRORS.has(error.code)) {\n options.io.stderr.write(renderError(error, { json: options.json }));\n return EXIT_USAGE;\n }\n throw error;\n }\n}\n\n// ── 알림 ────────────────────────────────────────────────────────────────\n\n/** 범위 필터 — 알림·할 일 공용. 두 축 모두 정렬·중복 제거된 집합(비면 undefined). */\ninterface ScopeFilter {\n workspaceUuids?: string[];\n projectUuids?: string[];\n}\n\ninterface PollFilter extends ScopeFilter {\n kinds?: string[];\n directOnly: boolean;\n}\n\n/** 0.7.0 커서 파일의 필터 모양 — 프로젝트가 하나뿐이던 때. 읽을 때 PollFilter 로 바꾼다. */\ninterface LegacyPollFilter extends PollFilter {\n projectUuid?: string;\n}\n\n/** 커서 파일 — 보류 중인 배치(ack 전)와 그 필터. 서버 위치는 서버가 기억한다(파일은 «아직 확인 안 한 것» 만 든다). */\ninterface CursorFile {\n v: 1;\n filter: PollFilter;\n stream?: string;\n ackToken?: string;\n pendingItems?: unknown[];\n}\n\nasync function notificationsPoll(options: InboxCommandOptions): Promise<number> {\n const flags = parseFlags(options.argv, [\"--cursor-file\", \"--kinds\", \"--workspace\", \"--project\", \"--limit\"], [\"--direct-only\"]);\n const cursorPath = requireFlag(flags, \"--cursor-file\", \"notifications poll\");\n const filter: PollFilter = {\n kinds: flags.values[\"--kinds\"]?.split(\",\").map((kind) => kind.trim()).filter(Boolean).sort(),\n ...scopeFilter(flags),\n directOnly: flags.switches.has(\"--direct-only\"),\n };\n if (filter.kinds?.length === 0) filter.kinds = undefined;\n const limit = flags.values[\"--limit\"] === undefined ? undefined : positiveInt(\"--limit\", flags.values[\"--limit\"]);\n\n const saved = await readCursorFile(cursorPath);\n if (saved?.ackToken && saved.pendingItems?.length) {\n if (!sameFilter(saved.filter, filter)) {\n throw new CliCommandError(\"PENDING_BATCH_OTHER_FILTER\",\n `${cursorPath} holds an unacknowledged batch for a different filter. Run \\`ainecto notifications ack --cursor-file ${cursorPath}\\` `\n + \"after handling it, or use another cursor file for this filter.\", { cursorFile: cursorPath });\n }\n // ★ack 전까지 같은 결과 — 서버에 묻지 않는다.\n options.io.stdout.write(renderSuccess({ items: saved.pendingItems, pending: true, stream: saved.stream }, { json: options.json }));\n return 0;\n }\n\n const result = await callTool(options.client, LIST_NOTIFICATIONS, {\n cursor: \"saved\",\n ...(filter.kinds ? { kinds: filter.kinds } : {}),\n ...scopeArgs(filter),\n ...(filter.directOnly ? { directOnly: true } : {}),\n ...(limit !== undefined ? { limit } : {}),\n });\n const items = Array.isArray(result.items) ? result.items : [];\n const stream = typeof result.stream === \"string\" ? result.stream : undefined;\n if (typeof result.retryAfterSeconds === \"number\") {\n options.io.stderr.write(`Polled too soon; try again in ${result.retryAfterSeconds}s.\\n`);\n return EXIT_NOTHING_NEW;\n }\n if (items.length === 0) {\n await writeCursorFile(cursorPath, { v: 1, filter, stream });\n if (options.json) options.io.stdout.write(renderSuccess({ items: [], stream }, { json: true }));\n return EXIT_NOTHING_NEW;\n }\n // ★출력보다 저장이 먼저 — 출력 뒤에 죽어도 다음 회차가 같은 배치를 다시 낸다.\n await writeCursorFile(cursorPath, {\n v: 1, filter, stream, ackToken: typeof result.ackToken === \"string\" ? result.ackToken : undefined, pendingItems: items,\n });\n options.io.stdout.write(renderSuccess({ items, hasMore: result.hasMore === true, stream }, { json: options.json }));\n return 0;\n}\n\nasync function notificationsAck(options: InboxCommandOptions): Promise<number> {\n const flags = parseFlags(options.argv, [\"--cursor-file\"], []);\n const cursorPath = requireFlag(flags, \"--cursor-file\", \"notifications ack\");\n const saved = await readCursorFile(cursorPath);\n if (!saved?.ackToken) {\n if (options.json) options.io.stdout.write(renderSuccess({ acked: false }, { json: true }));\n return EXIT_NOTHING_NEW;\n }\n // ack 는 다음 폴링 인자로 싣는다(서버 계약). 이번 응답의 다음 배치는 버린다 — ack 하지 않았으니 다음 poll 이 다시 받는다.\n await callTool(options.client, LIST_NOTIFICATIONS, {\n cursor: \"saved\",\n ack: saved.ackToken,\n ...(saved.filter.kinds ? { kinds: saved.filter.kinds } : {}),\n ...scopeArgs(saved.filter),\n ...(saved.filter.directOnly ? { directOnly: true } : {}),\n limit: 1,\n });\n const acked = saved.pendingItems?.length ?? 0;\n await writeCursorFile(cursorPath, { v: 1, filter: saved.filter, stream: saved.stream });\n options.io.stdout.write(renderSuccess({ acked: true, items: acked }, { json: options.json }));\n return 0;\n}\n\n// ── 할 일 ────────────────────────────────────────────────────────────────\n\nasync function agentTodosPoll(options: InboxCommandOptions): Promise<number> {\n const flags = parseFlags(options.argv, [\"--workspace\", \"--project\", \"--seen-file\"], [\"--only-new\"]);\n const scope = scopeArgs(scopeFilter(flags));\n const onlyNew = flags.switches.has(\"--only-new\");\n const seenPath = flags.values[\"--seen-file\"];\n if (onlyNew && !seenPath) {\n throw new CliCommandError(\"MISSING_REQUIRED_FLAG\", \"--only-new needs --seen-file <path>.\", { flag: \"--seen-file\" });\n }\n const items: Array<Record<string, unknown>> = [];\n let after: string | undefined;\n for (let page = 0; page < 20; page += 1) {\n const result = await callTool(options.client, LIST_AGENT_TODOS, { state: [\"OPEN\"], ...scope, limit: 50, ...(after ? { after } : {}) });\n const pageItems = Array.isArray(result.items) ? result.items.filter(isRecord) : [];\n items.push(...pageItems);\n const last = pageItems[pageItems.length - 1];\n if (result.hasMore !== true || !last || typeof last.todoId !== \"string\") break;\n after = last.todoId;\n }\n let shown = items;\n if (onlyNew && seenPath) {\n const seen = new Set(await readSeenFile(seenPath));\n shown = items.filter((item) => typeof item.todoId === \"string\" && !seen.has(item.todoId));\n // 본 목록 = 지금 열린 것(닫힌 것은 빠진다 — 파일이 끝없이 자라지 않게).\n await writeJsonAtomic(seenPath, items.map((item) => item.todoId).filter((id): id is string => typeof id === \"string\"));\n }\n if (shown.length === 0) {\n if (options.json) options.io.stdout.write(renderSuccess({ items: [] }, { json: true }));\n return EXIT_NOTHING_NEW;\n }\n options.io.stdout.write(renderSuccess({ items: shown }, { json: options.json }));\n return 0;\n}\n\n// ── 도우미 ──────────────────────────────────────────────────────────────\n\nasync function callTool(client: McpRpcClient, name: string, args: Record<string, unknown>): Promise<Record<string, unknown>> {\n const raw = await client.toolsCall(name, args);\n if (isToolError(raw)) {\n throw new CliCommandError(\"TOOL_ERROR\", toolErrorText(raw), { tool: name });\n }\n const payload = unwrapMcpToolPayload(raw);\n if (!isRecord(payload)) {\n throw new CliCommandError(\"MCP_PROTOCOL_ERROR\", `${name} did not return an object.`, { tool: name });\n }\n return payload;\n}\n\ninterface ParsedFlags {\n /** 값 플래그의 마지막 값. */\n values: Record<string, string | undefined>;\n /** 값 플래그의 모든 값(반복 가능한 플래그용, 준 순서). */\n lists: Record<string, string[]>;\n switches: Set<string>;\n}\n\n/** --workspace · --project(둘 다 반복) → 범위 필터. 정렬·중복 제거 — 같은 집합이면 같은 필터. */\nfunction scopeFilter(flags: ParsedFlags): ScopeFilter {\n const workspaces = uuidSet(flags.lists[\"--workspace\"]);\n const projects = uuidSet(flags.lists[\"--project\"]);\n return {\n ...(workspaces.length ? { workspaceUuids: workspaces } : {}),\n ...(projects.length ? { projectUuids: projects } : {}),\n };\n}\n\nfunction uuidSet(values: string[] | undefined): string[] {\n return [...new Set(values ?? [])].sort();\n}\n\n/**\n * 범위 필터 → 서버 인자 workspaceUuids · projectUuids(배열). ★준 축만 키로 싣는다(옛 서버는 모르는 필드를 거절한다).\n * 단 프로젝트 1개뿐이고 워크스페이스가 없으면 옛 단수 projectUuid 문자열 — 옛 서버도 아는 모양(이 경우만).\n */\nfunction scopeArgs(filter: ScopeFilter): Record<string, unknown> {\n const workspaces = filter.workspaceUuids ?? [];\n const projects = filter.projectUuids ?? [];\n if (workspaces.length === 0 && projects.length === 1) return { projectUuid: projects[0] };\n return {\n ...(workspaces.length ? { workspaceUuids: workspaces } : {}),\n ...(projects.length ? { projectUuids: projects } : {}),\n };\n}\n\nfunction parseFlags(argv: string[], valueFlags: string[], switchFlags: string[]): ParsedFlags {\n const values: Record<string, string | undefined> = {};\n const lists: Record<string, string[]> = {};\n const switches = new Set<string>();\n for (let index = 0; index < argv.length; index += 1) {\n const arg = argv[index];\n if (!arg) continue;\n if (valueFlags.includes(arg)) {\n const value = argv[index + 1];\n if (!value || value.startsWith(\"--\")) {\n throw new CliCommandError(\"FLAG_REQUIRES_VALUE\", `${arg} requires a value.`, { flag: arg });\n }\n values[arg] = value;\n (lists[arg] ??= []).push(value);\n index += 1;\n } else if (switchFlags.includes(arg)) {\n switches.add(arg);\n } else {\n throw new CliCommandError(\"UNKNOWN_FLAG\", `Unknown argument ${arg}.`, { flag: arg });\n }\n }\n return { values, lists, switches };\n}\n\nfunction requireFlag(flags: ParsedFlags, flag: string, command: string): string {\n const value = flags.values[flag];\n if (!value) throw new CliCommandError(\"MISSING_REQUIRED_FLAG\", `${command} needs ${flag} <path>.`, { flag });\n return value;\n}\n\nfunction positiveInt(flag: string, value: string | undefined): number {\n if (!value || !/^[1-9]\\d*$/.test(value)) {\n throw new CliCommandError(\"INVALID_FLAG_VALUE\", `${flag} must be a positive integer.`, { flag, value });\n }\n return Number.parseInt(value, 10);\n}\n\nfunction sameFilter(a: PollFilter, b: PollFilter): boolean {\n return JSON.stringify(a.kinds ?? []) === JSON.stringify(b.kinds ?? [])\n && JSON.stringify(a.workspaceUuids ?? []) === JSON.stringify(b.workspaceUuids ?? [])\n && JSON.stringify(a.projectUuids ?? []) === JSON.stringify(b.projectUuids ?? [])\n && a.directOnly === b.directOnly;\n}\n\n/** 0.7.0 파일의 projectUuid(문자열 1개)를 projectUuids 집합으로 — 옛 보류 배치도 같은 필터로 알아보고 ack 한다. */\nfunction normalizeSavedFilter(saved: LegacyPollFilter): PollFilter {\n const { projectUuid, ...rest } = saved;\n if (rest.projectUuids?.length || !projectUuid) return rest;\n return { ...rest, projectUuids: [projectUuid] };\n}\n\nasync function readCursorFile(path: string): Promise<CursorFile | undefined> {\n const text = await readFile(path, \"utf8\").catch((error: NodeJS.ErrnoException) => {\n if (error.code === \"ENOENT\") return undefined;\n throw error;\n });\n if (text === undefined || !text.trim()) return undefined;\n try {\n const parsed = JSON.parse(text) as CursorFile;\n if (parsed?.v !== 1 || !isRecord(parsed.filter)) throw new Error(\"shape\");\n return { ...parsed, filter: normalizeSavedFilter(parsed.filter) };\n } catch {\n throw new CliCommandError(\"INVALID_CURSOR_FILE\", `${path} is not a cursor file written by ainecto notifications poll.`, { cursorFile: path });\n }\n}\n\nasync function writeCursorFile(path: string, value: CursorFile): Promise<void> {\n await writeJsonAtomic(path, value);\n}\n\nasync function readSeenFile(path: string): Promise<string[]> {\n const text = await readFile(path, \"utf8\").catch((error: NodeJS.ErrnoException) => {\n if (error.code === \"ENOENT\") return undefined;\n throw error;\n });\n if (!text?.trim()) return [];\n try {\n const parsed = JSON.parse(text) as unknown;\n return Array.isArray(parsed) ? parsed.filter((id): id is string => typeof id === \"string\") : [];\n } catch {\n throw new CliCommandError(\"INVALID_SEEN_FILE\", `${path} is not a seen file written by ainecto agent-todos poll.`, { seenFile: path });\n }\n}\n\n/** 임시 파일에 쓰고 fsync 한 뒤 바꿔 끼운다 — 중간에 죽어도 반쯤 쓴 파일이 남지 않는다. */\nasync function writeJsonAtomic(path: string, value: unknown): Promise<void> {\n await mkdir(dirname(path), { recursive: true });\n const temp = `${path}.${process.pid}.tmp`;\n const handle = await open(temp, \"w\", 0o600);\n try {\n await handle.writeFile(`${JSON.stringify(value, null, 2)}\\n`, \"utf8\");\n await handle.sync();\n } finally {\n await handle.close();\n }\n await rename(temp, path);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { chmod, mkdir, rename, rm, rmdir, stat, writeFile } from \"node:fs/promises\";\nimport { dirname, join, relative, resolve, sep } from \"node:path\";\nimport { isDefaultEndpointFor } from \"../../core/config/endpoints\";\nimport { renderSuccess } from \"../../core/output/render\";\nimport {\n initRefusal,\n MANAGED_PATHS,\n planInit,\n planUndo,\n type FileWrite,\n type InitPlan,\n withCreatedDirectories,\n} from \"../../core/harness/initPlan\";\nimport { AGENT_NOTE_KEY, DOC_KEY, HARNESS_DOC_PATH, HARNESS_RECORD_PATH } from \"../../core/harness/harnessDoc\";\nimport { AGENT_TARGETS, REMOTE_SIGN_IN } from \"../../core/harness/agentTargets\";\nimport { fetchHarnessDocuments, type HarnessDocuments } from \"../../core/harness/documentFetch\";\nimport {\n assertInsideRepository,\n findGitRoot,\n readIfExists,\n readManagedFile,\n} from \"../../core/harness/repositoryFiles\";\n\nexport interface InitCommandOptions {\n argv: string[];\n endpoint: string;\n /**\n * 문서를 받을 때 쓸 토큰을 «필요할 때» 가져온다. 없으면 패키지 기본값으로 간다.\n *\n * <p>★지연 조회인 이유: {@code --undo} 는 순수한 로컬 작업인데, 예전엔 그마저도 토큰\n * 조회·갱신·저장을 먼저 돌렸다(2026-09-23 독립 재리뷰 S1). 로컬 되돌리기가 네트워크에\n * 의존하면, 서버가 죽은 날 되돌릴 수가 없다.\n */\n accessToken?: () => Promise<string | undefined>;\n /**\n * 브라우저 로그인(= {@code ainecto auth login} 과 같은 함수). 없으면 로그인하지 않는다.\n *\n * <p>★init 은 사람이나 에이전트가 «명시적으로» 친 명령이라 여기서 로그인한다. 브리지({@code ainecto mcp})는\n * 여전히 자동 로그인하지 않는다 — 세션 한가운데서 창이 뜨면 안 된다(설계 §8-4).\n */\n login?: () => Promise<void>;\n /** 시험용 주입. 기본은 전역 fetch. */\n fetchImpl?: typeof fetch;\n env: \"prod\" | \"dev\";\n cliVersion: string;\n cwd: string;\n json: boolean;\n io: { stdout: NodeJS.WriteStream; stderr: NodeJS.WriteStream };\n}\n\ninterface InitArgs {\n /** MCP 설정 파일도 쓴다(설계 결정 #6). 없으면 «우리 브리지 항목이 이미 있는» 파일만 갱신한다. */\n mcp: boolean;\n /** 서버 주소 대신 로컬 중계로 쓴다(setup --local 과 같은 뜻). */\n local: boolean;\n dryRun: boolean;\n undo: boolean;\n /** 0.7.x 의 플래그 — 받아서 무시한다(멈추지 않는다). 안내 한 줄에 이름을 싣는다. */\n ignored: string[];\n}\n\n/**\n * {@code ainecto init} — 이 저장소에 AiNecto 작업 규칙을 둔다(설계 §4-2, 0.8.0).\n *\n * <p>★<b>저장소 규칙만 한다.</b> 세션 역할도, 프로젝트 고르기·만들기도 없다 — 도구와 권한은 서버가\n * 사용자 권한으로 정하고, 저장소는 한 프로젝트에 묶이지 않는다. 기기 전역의 에이전트 연결은 {@code setup} 이다.\n * <ul>\n * <li>쓰는 것: {@code .ainecto/HARNESS.md} · {@code AGENTS.md} 관리 블록(·{@code CLAUDE.md} 가 있으면) ·\n * {@code .ainecto/config.json}(v2) · 기록.</li>\n * <li>MCP 설정 파일은 {@code --mcp} 일 때만 — 단 우리 항목이 이미 있으면 다시 쓴다(옛 로컬 중계 → 서버\n * 주소, {@code --local} 이면 판 고정한 로컬 중계). 옛 저장소의 이행은 이 재실행 하나다.</li>\n * <li>{@code --dry-run} 도 서버 문서를 받는다 — 계획이 실제 실행과 같아야 한다(요구서 8장 P1).</li>\n * </ul>\n */\nexport async function executeInitCommand(options: InitCommandOptions): Promise<number> {\n const args = parseInitArgs(options.argv);\n if (args.ignored.length > 0) {\n options.io.stderr.write(\n `Ignored ${args.ignored.join(\", \")}: init no longer asks for a role or a project — `\n + \"every session sees the same tools and your AiNecto permissions decide what they may change.\\n\",\n );\n }\n const root = resolve(options.cwd);\n // ★하위 폴더에서 치면 멈춘다. 그 자리에 .mcp.json 을 쓰면 에이전트는 루트에서 그것을 못 본다.\n // undo 도 같은 이유로 루트에서만 한다(기록이 루트에 있다).\n const rootNotes = await repositoryRootNotes(root);\n const files = await readSnapshot(root);\n\n if (args.undo) {\n const plan = planUndo({ files });\n await applyPlan(root, plan, args.dryRun, files, false);\n options.io.stdout.write(renderSuccess(\n {\n action: args.dryRun ? \"undo (dry-run)\" : \"undo\",\n updated: plan.writes.map((write) => write.path),\n removed: plan.deletes,\n notes: [...rootNotes, ...plan.notes],\n },\n { json: options.json },\n ));\n return 0;\n }\n\n // ★<b>원격을 건드리기 «전»에 기록을 본다</b>(9차 1차 리뷰 B7) — 로그인 창을 띄운 뒤 거절하지 않는다.\n const refusal = initRefusal(files);\n if (refusal !== undefined) {\n throw new Error(refusal);\n }\n\n const signedIn = await ensureSignedIn(options, args.dryRun);\n const documents: HarnessDocuments = signedIn\n ? await fetchHarnessDocuments({\n endpoint: options.endpoint,\n accessToken: await options.accessToken?.(),\n // 서버가 문서의 클라이언트별 변형 키를 이 이름으로 찾는다.\n client: \"ainecto-cli\",\n fetchImpl: options.fetchImpl,\n })\n : { versions: {}, fallbacks: {}, unavailableReason: args.dryRun ? \"not signed in, and --dry-run does not sign in\" : \"not signed in\" };\n\n const plan = planInit({\n env: options.env,\n endpoint: options.endpoint,\n mcp: args.mcp,\n local: args.local,\n cliVersion: options.cliVersion,\n files,\n documents,\n });\n if (plan.refusal !== undefined) {\n // ★계획이 「멈춰라」고 하면 멈춘다(2026-09-27 8차 독립 리뷰 I1). 같은 함수라 위의 판정과 갈리지 않는다.\n throw new Error(plan.refusal);\n }\n await applyPlan(root, plan, args.dryRun, files);\n\n const mcpWritten = plan.writes.some((write) => AGENT_TARGETS.some((target) => target.path === write.path));\n options.io.stdout.write(renderSuccess(\n {\n action: args.dryRun ? \"init (dry-run)\" : \"init\",\n endpoint: options.endpoint,\n written: plan.writes.map((write) => `${write.existed ? \"updated\" : \"created\"} ${write.path}`),\n // ⚠조용히 기본값으로 떨어지지 않는다 — 서버에서 규칙을 고쳐도 안 바뀌는 이유를 사용자가 영영 못 찾는다.\n // ★요청 자체의 실패와 «문서별» 되돌림을 둘 다, 어느 «파일»이 그 글을 받는지까지 적는다.\n notes: [...rootNotes, ...plan.notes, ...fallbackNotes(documents, args.dryRun)],\n next: [\n `Read ${HARNESS_DOC_PATH} first. Every session sees the same AiNecto tools; your AiNecto permissions decide what they may change.`,\n mcpWritten\n ? \"Claude Code and Cursor pick up the repository's MCP config in a new session.\"\n : \"To connect your coding agents on this machine, run `ainecto setup` once\"\n + \" (or re-run init with --mcp to also write this repository's .mcp.json and .cursor/mcp.json).\",\n // 서버 주소를 썼으면 에이전트가 따로 로그인한다 — setup 과 같은 안내 표 하나.\n ...(mcpWritten && !args.local\n ? [`Each agent signs in to AiNecto by itself the first time: ${AGENT_TARGETS.map((target) => REMOTE_SIGN_IN[target.id]).filter(Boolean).join(\"; \")}.`]\n : []),\n \"Undo everything with: ainecto init --undo\",\n ],\n },\n { json: options.json },\n ));\n return 0;\n}\n\n/**\n * 패키지 기본값을 쓴 사실과 그 이유 — ★어느 파일이 그 글을 받는지까지. 없으면 빈 배열.\n * dry-run 이면 «실제 실행과 다를 수 있다»를 붙인다(서버 판을 못 받았으므로).\n */\nfunction fallbackNotes(documents: HarnessDocuments, dryRun: boolean): string[] {\n const filesOf: Record<string, string> = {\n [DOC_KEY]: HARNESS_DOC_PATH,\n [AGENT_NOTE_KEY]: \"AGENTS.md / CLAUDE.md\",\n };\n const caveat = dryRun ? \" — the real run may write the server's version instead\" : \"\";\n const reasons: Record<string, string> = documents.unavailableReason\n ? { [DOC_KEY]: documents.unavailableReason, [AGENT_NOTE_KEY]: documents.unavailableReason }\n : documents.fallbacks;\n return Object.entries(reasons).map(([key, reason]) =>\n `${filesOf[key] ?? key}: written from this package's default ${key}, not the server's (${reason})${caveat}.`);\n}\n\n/**\n * ★<b>문서를 받기 전에 로그인을 확인한다.</b> 토큰이 없으면(만료 + refresh 없음 포함) 브라우저 로그인을\n * 하고 이어서 진행한다(합격 시나리오 4). 로그인됐으면 true.\n *\n * <p>⚠{@code --dry-run} 은 브라우저를 띄우지도 토큰을 갱신하지도 않는다 — 「아무것도 바꾸지 않는다」는\n * 약속에 사용자의 로그인 상태도 든다. 그때는 false 를 돌려주고, 계획은 패키지 기본값 기준임을 파일별로 적는다.\n */\nasync function ensureSignedIn(options: InitCommandOptions, dryRun: boolean): Promise<boolean> {\n if (await options.accessToken?.()) {\n return true;\n }\n if (dryRun || options.login === undefined) {\n if (dryRun) {\n options.io.stderr.write(`No usable AiNecto sign-in, so this plan uses the package's default rules. Sign in with: ${loginCommand(options)}\\n`);\n }\n return false;\n }\n await options.login();\n options.io.stderr.write(\"Signed in.\\n\");\n return true;\n}\n\n/**\n * 저장소 루트 판정. 하위 폴더면 멈추고(던진다), git 저장소가 아니면 그 사실을 note 로 돌려준다.\n *\n * <p>★{@code .git} 은 디렉터리 «또는 파일»이다 — worktree·submodule 은 파일이다. {@code git} 실행\n * 파일에는 기대지 않는다. git 이 아니면 멈추지 않는다: git 을 안 쓰는 사용자가 있고, 그 경우엔\n * 가리킬 «진짜 루트»가 없다(설계 §6-1).\n */\nasync function repositoryRootNotes(cwd: string): Promise<string[]> {\n const gitRoot = await findGitRoot(cwd);\n if (gitRoot === undefined) {\n // (init·undo 둘 다 이 note 를 쓴다 — «설정했다»가 아니라 «어디를 기준으로 삼았나»를 말한다.)\n return [`${cwd} is not inside a git repository, so this folder was used as the repository root.`];\n }\n if (gitRoot !== cwd) {\n throw new Error(\n `This folder is inside the git repository at ${gitRoot}, not at its root. `\n + \"Agents read their MCP config from the repository root, so run init there:\\n\\n\"\n + ` cd ${gitRoot}\\n\\n`\n + \"Nothing was changed.\",\n );\n }\n return [];\n}\n\n/**\n * 이 서버에 맞는 로그인 명령 한 줄. ★<b>만드는 곳은 여기 하나다.</b>\n *\n * <p>⚠주소든 env 든 <b>하나는 반드시</b> 실린다 — 안 실으면 dev 에서 막힌 사람이 «운영»에 로그인한다\n * (2026-09-23 4차 독립 리뷰 S2).\n */\nexport function loginCommand(options: Pick<InitCommandOptions, \"env\" | \"endpoint\">): string {\n const target = isDefaultEndpointFor(options.env, options.endpoint)\n ? (options.env === \"prod\" ? \"\" : ` --env ${options.env}`)\n : ` --endpoint ${options.endpoint}`;\n return `ainecto auth login${target}`;\n}\n\n/**\n * ★<b>읽기도 경계 검사를 먼저 통과한다.</b> 예전엔 스냅샷을 다 읽은 «뒤에» 경계를 봤다 —\n * 저장소 밖을 가리키는 링크의 내용을 한 번 읽고 나서 거절했다(2026-09-23 독립 재리뷰 I4).\n * 쓰기·삭제만 막으면 되는 게 아니다. 읽는 것도 남의 파일이다.\n */\nasync function readSnapshot(root: string): Promise<Map<string, string | undefined>> {\n const snapshot = new Map<string, string | undefined>();\n for (const path of MANAGED_PATHS) {\n snapshot.set(path, await readManagedFile(root, path));\n }\n return snapshot;\n}\n\n/**\n * 계획을 적용한다.\n *\n * <p>★<b>먼저 전부 검사하고, 그 다음에 쓴다.</b> 예전엔 한 파일씩 쓰다가 중간에 막히면\n * (권한 등) 앞 파일만 바뀐 채로 실패했다(2026-09-22 독립 리뷰 I5). 지금은 경계·링크·\n * 「스냅샷 이후 바뀌었는가」를 먼저 다 보고, 하나라도 걸리면 아무것도 안 쓴다.\n *\n * <p>⚠그래도 «쓰는 도중» 실패는 완전히 못 막는다(디스크 가득 등). 그때 무엇이 쓰였는지는\n * 오류에 적는다 — 조용히 반쪽 상태로 두지 않는다.\n */\nasync function applyPlan(\n root: string,\n plan: InitPlan,\n dryRun: boolean,\n snapshot: FileSnapshotMap,\n recordFirst = true,\n): Promise<void> {\n // ①먼저 «전부» 본다 — 하나라도 못 쓸 상황이면 아무것도 건드리지 않고 멈추는 게 낫다.\n for (const write of plan.writes) {\n await assertInsideRepository(root, write.path);\n await assertUnchangedSinceSnapshot(root, write.path, snapshot);\n }\n for (const path of plan.deletes) {\n await assertInsideRepository(root, path);\n await assertUnchangedSinceSnapshot(root, path, snapshot);\n }\n if (dryRun) {\n return;\n }\n const applied: string[] = [];\n try {\n // ★<b>복구 기록을 먼저 쓴다.</b> 예전엔 관리 기록(config.json)이 «마지막» 쓰기였다.\n // 그래서 중간에 실패하면 이미 바뀐 파일이 있는데 기록이 없어 undo 가 아무것도 못 되돌렸다\n // (2026-09-23 독립 재리뷰 I11). 되돌릴 수 있게 만드는 것이 첫 일이다.\n // ★되돌리기에서는 기록을 건드리는 일이 «작업 전체»의 마지막이다. 4차에서 config 를 쓰기\n // 목록의 뒤로 옮겼지만, 쓰기가 다 끝난 «뒤에» 삭제가 온다. 그래서 삭제가 실패하면 기록은\n // 이미 옛 파일로 돌아가 있고 되돌릴 근거가 없었다(2026-09-23 5차 독립 리뷰 I1).\n const isRecord = (path: string) => !recordFirst && path === HARNESS_RECORD_PATH;\n const recordWrites = plan.writes.filter((write) => isRecord(write.path));\n const recordDeletes = plan.deletes.filter((path) => isRecord(path));\n /**\n * ★<b>우리가 «실제로 만든» 디렉터리.</b> {@code mkdir(recursive)} 는 자기가 만든 가장 위\n * 디렉터리를 돌려주고, 이미 있었으면 undefined 를 준다 — 그게 우리가 알고 싶던 사실\n * 그 자체다. 이 칸의 진실원은 이 변수 하나이고, 계획은 여기에 관여하지 않는다.\n * (직전 실행에서 이어받은 것은 이미 기록에 있으므로 함께 들고 간다.)\n */\n const createdDirectories: string[] = [...(plan.record?.createdDirectories ?? [])];\n const rememberDirectories = (directories: readonly string[]) => {\n for (const directory of directories) {\n if (!createdDirectories.includes(directory)) {\n createdDirectories.push(directory);\n }\n }\n };\n /**\n * 기록의 디렉터리 칸을 «실제로 만든 것»으로 바로잡는다.\n *\n * <p>★성공했을 때만 하면 안 된다 — 중간에 실패해도 그 순간까지의 사실이 기록에 남아야\n * 한다. 예전엔 보정이 성공 경로에만 있어서, 만들기 «전»에 실패한 계획이 그대로 남고\n * 그 뒤 사용자가 만든 디렉터리를 다음 undo 가 지웠다(2026-09-27 6차 독립 리뷰 S1).\n *\n * <p>⚠기록 보정이 실패해도 원래 오류를 덮지 않는다. 같은 내용을 두 번 써도 무해하다.\n */\n const recordActualDirectories = async () => {\n const write = plan.writes.find((w) => w.path === HARNESS_RECORD_PATH);\n if (!recordFirst || !plan.record || !write || !applied.includes(HARNESS_RECORD_PATH)) {\n return;\n }\n await writeManagedFile(root, {\n ...write,\n content: withCreatedDirectories(write.content, createdDirectories),\n });\n };\n /**\n * 보정을 «삼키지 않는다». 다른 오류가 진행 중이면 그 오류를 살리고, 아니면 드러낸다.\n *\n * <p>★예전엔 무조건 삼켰다. 그러면 init 이 종료 0 을 돌려주는데 기록의 디렉터리 칸이\n * 비어 있고, 그 상태의 undo 는 우리가 만든 디렉터리를 남긴다 — 「성공」이 기록 완료를\n * 보증하지 않았다(2026-09-27 7차 독립 리뷰 S1).\n */\n const recordDirectoriesOrExplain = async (failing: boolean) => {\n try {\n await recordActualDirectories();\n } catch (error) {\n if (!failing) {\n throw error;\n }\n }\n };\n const apply = async (writes: readonly FileWrite[], deletes: readonly string[]) => {\n for (const write of writes) {\n // ②그리고 «쓰기 직전에» 다시 본다. ①과 실제 쓰기 사이에 누가 고칠 수 있다 — 그 틈으로\n // 남의 편집이 덮여 나갔다(같은 항목). 검사와 쓰기를 붙여 놓으면 창이 작아진다.\n await assertUnchangedSinceSnapshot(root, write.path, snapshot);\n await writeManagedFile(root, write, rememberDirectories);\n applied.push(write.path);\n }\n for (const path of deletes) {\n await assertUnchangedSinceSnapshot(root, path, snapshot);\n await rm(join(root, path), { force: true });\n applied.push(path);\n }\n };\n\n try {\n await apply(\n orderedWrites(plan.writes.filter((write) => !isRecord(write.path)), recordFirst),\n plan.deletes.filter((path) => !isRecord(path)),\n );\n await recordDirectoriesOrExplain(false);\n // 여기까지 전부 된 다음에만 기록을 줄이거나 지운다.\n await apply(recordWrites, recordDeletes);\n } catch (error) {\n await recordDirectoriesOrExplain(true);\n throw error;\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new Error(\n `${message}\\nAlready applied before this failure: ${applied.join(\", \") || \"(nothing)\"}`,\n );\n }\n // 우리가 «만든» 디렉터리가 비었으면 그것도 치운다.\n // ⛔recursive 로 지우지 않는다 — 사용자가 그 안에 둔 다른 파일까지 날아간다.\n // rmdir 는 «비어 있을 때만» 성공하므로, 비었는지는 파일시스템이 판정한다.\n // ★「비었으면 치운다」였을 때는 init 전부터 있던 빈 .cursor 까지 사라졌다\n // (2026-09-23 4차 독립 리뷰 S3). 비었다는 것과 우리 것이라는 것은 다른 사실이다.\n for (const directory of plan.removableDirectories ?? []) {\n await rmdir(join(root, directory)).catch(() => undefined);\n }\n}\n\n/**\n * 관리 기록을 맨 앞으로 옮긴 쓰기 순서.\n *\n * <p>★기록이 먼저 디스크에 있어야 그 뒤의 실패를 되돌릴 수 있다. 기록에 적힌 지문은\n * «쓰려던 내용»의 것이라, 못 쓴 파일은 지문이 안 맞아 undo 가 「손댔다」로 보고 남긴다 —\n * 안 만든 파일을 지우려 드는 것보다 안전한 쪽이다.\n */\nfunction orderedWrites(writes: readonly FileWrite[], recordFirst: boolean): FileWrite[] {\n const record = writes.filter((write) => write.path === HARNESS_RECORD_PATH);\n const rest = writes.filter((write) => write.path !== HARNESS_RECORD_PATH);\n // ★undo 에서는 «마지막»이다. undo 가 config 에 쓰는 것은 기록을 남기는 일이 아니라\n // 옛 파일로 «되돌리는» 일이라, 먼저 하면 나머지를 되돌릴 근거를 스스로 지운다\n // (2026-09-23 4차 독립 리뷰 I2). 같은 순서 규칙을 두 방향에 그대로 쓰면 안 된다.\n return recordFirst ? [...record, ...rest] : [...rest, ...record];\n}\n\n\n/** 파일을 읽은 뒤 우리가 네트워크를 기다리는 사이에 누가 고쳤으면, 그 변경을 덮지 않는다. */\nasync function assertUnchangedSinceSnapshot(\n root: string,\n relativePath: string,\n snapshot: FileSnapshotMap,\n): Promise<void> {\n if (!snapshot.has(relativePath)) {\n return;\n }\n const now = await readIfExists(join(root, relativePath));\n if (now !== snapshot.get(relativePath)) {\n throw new Error(\n `${relativePath} changed while init was running; nothing was written. Run init again.`,\n );\n }\n}\n\n/**\n * 임시 파일에 쓰고 바꿔 끼운다 — 도중에 죽어도 반쪽짜리 파일이 남지 않는다.\n *\n * <p>★<b>기존 파일의 권한을 그대로 가져간다.</b> rename 은 inode 를 «갈아치우므로», 그냥\n * 만들면 umask 기본값(보통 0644)이 된다. 남의 서버 설정에 환경변수가 들어 있는 0600 파일이\n * init 한 번에 0644 로 넓어졌다(2026-09-23 독립 재리뷰 N1). 내용을 합치는 일이 남의 파일\n * 접근 권한까지 바꾸면 안 된다.\n */\nasync function writeManagedFile(\n root: string,\n write: FileWrite,\n onDirectoriesCreated?: (directories: readonly string[]) => void,\n): Promise<string[]> {\n const absolutePath = join(root, write.path);\n const targetDirectory = dirname(absolutePath);\n const firstCreated = await mkdir(targetDirectory, { recursive: true });\n // ★<b>만든 사실을 «지금» 넘긴다.</b> 예전엔 반환값으로만 줬는데, 그 반환은 rename 뒤에\n // 일어난다 — 그 사이에 쓰기가 실패하면 «우리가 만든 디렉터리»라는 사실이 통째로 사라졌고,\n // 다음 init 의 mkdir 는 이미 있는 디렉터리에 undefined 를 주므로 회복도 못 했다\n // (2026-09-27 7차 독립 리뷰 S1). 만드는 것과 쓰는 것은 다른 일이다.\n const created = createdChain(root, firstCreated, targetDirectory);\n onDirectoriesCreated?.(created);\n const previousMode = await fileMode(absolutePath);\n const tmpPath = `${absolutePath}.${process.pid}.${Date.now()}.tmp`;\n // 임시 파일도 «처음부터» 좁게 만든다 — 넓게 만들었다가 좁히면 그 사이가 창이다.\n await writeFile(tmpPath, write.content, { encoding: \"utf8\", mode: previousMode ?? 0o600 });\n if (previousMode !== undefined) {\n await chmod(tmpPath, previousMode);\n }\n await rename(tmpPath, absolutePath);\n return created;\n}\n\n/**\n * 이번 {@code mkdir} 이 «정말 만든» 디렉터리들 — 저장소 기준 상대 경로, 깊은 것부터.\n *\n * <p>★{@code recursive: true} 는 자기가 만든 «가장 위» 디렉터리 하나만 돌려준다. 그 아래부터\n * 목표 디렉터리까지도 같이 만들어진 것이므로 구간 전체가 우리 것이다. 이미 있었으면\n * undefined 를 주므로 그때는 빈 목록이다 — <b>「있다」와 「우리가 만들었다」가 갈리는 지점</b>.\n */\nexport function createdChain(root: string, firstCreated: string | undefined, targetDirectory: string): string[] {\n if (firstCreated === undefined) {\n return [];\n }\n const stop = resolve(firstCreated);\n const made: string[] = [];\n for (let at = resolve(targetDirectory); ; at = dirname(at)) {\n const asRelative = relative(root, at);\n if (asRelative && !asRelative.startsWith(\"..\")) {\n made.push(asRelative.split(sep).join(\"/\"));\n }\n if (at === stop || dirname(at) === at) {\n break;\n }\n }\n return made;\n}\n\nasync function fileMode(absolutePath: string): Promise<number | undefined> {\n try {\n return (await stat(absolutePath)).mode & 0o7777;\n } catch (error) {\n if (isRecord(error) && error.code === \"ENOENT\") {\n return undefined;\n }\n throw error;\n }\n}\n\ntype FileSnapshotMap = Map<string, string | undefined>;\n\nfunction parseInitArgs(argv: string[]): InitArgs {\n const args: InitArgs = { mcp: false, local: false, dryRun: false, undo: false, ignored: [] };\n for (let index = 0; index < argv.length; index += 1) {\n const arg = argv[index];\n if (!arg) {\n continue;\n }\n if (arg === \"--mcp\") {\n args.mcp = true;\n } else if (arg === \"--local\") {\n args.local = true;\n } else if (arg === \"--dry-run\") {\n args.dryRun = true;\n } else if (arg === \"--undo\") {\n args.undo = true;\n } else if (arg === \"--project\" || arg === \"--project-name\") {\n // 0.7.x — 값까지 삼키고 무시한다. 값이 없으면 플래그만.\n const value = argv[index + 1];\n if (value !== undefined && !value.startsWith(\"--\")) {\n index += 1;\n }\n args.ignored.push(arg);\n } else if (arg === \"--yes\" || arg === \"-y\") {\n args.ignored.push(arg);\n } else if (arg === \"--json\") {\n // 전역 플래그 — 여기선 무시한다.\n } else {\n throw new Error(`Unknown argument: ${arg}`);\n }\n }\n return args;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { basename } from \"node:path\";\nimport { isDefaultEndpoint, isDefaultEndpointFor, normalizeEndpoint } from \"../config/endpoints\";\nimport { bridgePackageSpec, PACKAGE_NAME } from \"../version\";\n\n/**\n * 「어느 에이전트의 어느 파일에 무엇을 적는가」.\n *\n * ★<b>MCP 항목은 «하나»만 쓴다</b> — 이름 {@link SERVER_NAME}. 저장소 파일은 브리지 {@code npx -y @ainecto/mcp@<판>},\n * 저장소 파일·기기 전역 연결 모두 서버 주소(원격 MCP)가 기본이다({@link REMOTE_SIGN_IN} 표).\n * 세션 역할은 없다(0.8.0): 모든 세션이 같은 도구를 보고, 무엇을 할 수 있는지는 서버가 권한으로 정한다.\n *\n * <p>저장소 파일({@code .mcp.json}·{@code .cursor/mcp.json})은 {@code init --mcp} 가, 기기 전역 연결\n * (Claude Code 사용자 범위·Cursor 전역·Codex)은 {@code setup} 이 쓴다. 둘 다 이 파일의 항목 결정\n * ({@link desiredServerEntry})과 소유 판정({@link isOurEntry})을 쓴다 — 기록 파일을 따로 두지 않는다.\n */\n\n/** 설정에 쓰는 서버 이름. ⛔env 에 따라 바꾸지 않는다 — 도구 접두사가 흔들리고 --undo 가 못 찾는다. */\nexport const SERVER_NAME = \"ainecto\";\n\nexport type AgentClientId = \"claude-code\" | \"cursor\" | \"codex\";\n\nexport interface AgentTarget {\n id: Extract<AgentClientId, \"claude-code\" | \"cursor\">;\n label: string;\n /** 저장소 루트 기준 상대 경로. */\n path: string;\n}\n\nexport const AGENT_TARGETS: readonly AgentTarget[] = [\n { id: \"claude-code\", label: \"Claude Code\", path: \".mcp.json\" },\n { id: \"cursor\", label: \"Cursor\", path: \".cursor/mcp.json\" },\n];\n\nexport interface ServerEntryInput {\n /** \"prod\" 면 인자를 안 붙인다 — 기본값을 설정에 박으면 기본이 바뀔 때 거짓이 된다. */\n env?: \"prod\" | \"dev\";\n /**\n * 기본이 아닌 엔드포인트. ⚠<b>이걸 빠뜨리면</b> 문서가 가리키는 곳과 세션이 붙는 곳이\n * 달라진다(2026-09-22 독립 리뷰 I7).\n */\n endpoint?: string;\n /** 브리지 패키지 지정. 기본은 이 CLI 판으로 고정한 {@link bridgePackageSpec}. */\n packageSpec?: string;\n}\n\nexport interface McpServerEntry {\n command: string;\n args: string[];\n}\n\n/** 서버 주소를 직접 적는 항목(원격 MCP) — 기본. {@code type} 은 Claude Code 파일에만 붙는다. */\nexport interface RemoteServerEntry {\n type?: \"http\";\n url: string;\n}\n\n/** {@code ainecto} 항목의 모양 — 명령형(로컬 중계, stdio) 또는 주소형(원격). 지금 있는 것과 쓸 것이 같은 모양이다. */\nexport type AgentEntry = McpServerEntry | RemoteServerEntry;\n\n/**\n * ★대상별 원격(HTTP) MCP 지원 표 — 한 곳. 있으면 서버 주소를 등록하고 값은 «첫 로그인 안내»다.\n * 없는 대상만 로컬 중계를 쓴다. 근거는 각 도구의 공식 형식(2026-10-21 실측):\n * <ul>\n * <li>Claude Code 2.1.306 — {@code claude mcp add --transport http -s user <name> <url>}\n * ({@code claude mcp add --help} 의 «Add HTTP server» 예). {@code ~/.claude.json}·{@code .mcp.json} 에\n * {@code {type:\"http\",url}} — ★{@code .mcp.json} 은 {@code type} 이 없으면 항목을 못 읽는다(실측).\n * {@code claude mcp get} 이 «Needs authentication» 을 보이고, 세션의 {@code /mcp} 에서 로그인한다.</li>\n * <li>Cursor — {@code ~/.cursor/mcp.json}·{@code .cursor/mcp.json} 의 {@code {\"url\": …}} (docs.cursor.com «Model Context Protocol» 의\n * Remote server 형식). 로그인은 Cursor 가 MCP 설정 화면에서 띄운다.</li>\n * <li>Codex 0.163.0 — {@code codex mcp add <name> --url <url>} (streamable HTTP). ★add 가 서버의 OAuth 를\n * 감지하면 그 자리에서 브라우저 로그인을 시작한다(«Detected OAuth support. Starting OAuth flow»).\n * 못 마치면 {@code codex mcp login <name>}. 같은 이름은 stdio↔url 어느 쪽으로든 덮어쓴다.</li>\n * </ul>\n */\nexport const REMOTE_SIGN_IN: Partial<Record<AgentClientId, string>> = {\n \"claude-code\": `Claude Code — in a session, run /mcp, pick \"${SERVER_NAME}\" and sign in`,\n cursor: `Cursor — sign in when \"${SERVER_NAME}\" asks for it in Cursor's MCP settings`,\n codex: `Codex — signs in while setup connects it (its sign-in link is printed above); if that did not finish, run \\`codex mcp login ${SERVER_NAME}\\``,\n};\n\n/** {@code ainecto} 항목의 모양 — 명령형(로컬 중계, stdio) 또는 주소형(원격). 지금 있는 것과 쓸 것이 같은 모양이다. */\n/**\n * ★이 클라이언트에 쓸 항목 — setup·init 의 «한» 결정. 원격을 지원하면({@link REMOTE_SIGN_IN}) 서버 주소,\n * 아니면(또는 {@code --local}) 판 고정한 로컬 중계. 주소는 호출자가 해석한 엔드포인트 하나다({@code resolveEndpoint}).\n */\nexport function desiredServerEntry(input: {\n client: AgentClientId;\n env: \"prod\" | \"dev\";\n endpoint: string;\n local: boolean;\n /** 브리지 패키지 지정(시험용). */\n packageSpec?: string;\n}): AgentEntry {\n if (REMOTE_SIGN_IN[input.client] === undefined || input.local) {\n return buildServerEntry({ env: input.env, endpoint: input.endpoint, packageSpec: input.packageSpec });\n }\n return input.client === \"claude-code\" ? { type: \"http\", url: input.endpoint } : { url: input.endpoint };\n}\n\n/**\n * ★이 항목이 우리 것인가 — 우리 브리지({@link isOurBridge}) 또는 우리 서버 주소(기본 prod·dev 주소나 지금 쓰는\n * {@code endpoint}). 다른 주소·다른 명령은 남의 것이다. setup·init·status·doctor 가 이것 하나를 쓴다.\n */\nexport function isOurEntry(entry: unknown, endpoint: string): boolean {\n if (isRecord(entry) && typeof entry.url === \"string\") {\n const url = normalizedServerUrl(entry.url);\n return url !== undefined && (url === endpoint || isDefaultEndpoint(url));\n }\n return isOurBridge(entry);\n}\n\n/** 설정에 적힌 주소를 견줄 모양으로 — 못 읽는(믿을 수 없는) 주소면 undefined: 우리 것으로 보지 않는다. */\nexport function normalizedServerUrl(url: string): string | undefined {\n try {\n return normalizeEndpoint(url);\n } catch {\n return undefined;\n }\n}\n\nexport function buildServerEntry(input: ServerEntryInput = {}): McpServerEntry {\n const args = [\"-y\", input.packageSpec ?? bridgePackageSpec()];\n if (input.env && input.env !== \"prod\") {\n args.push(\"--env\", input.env);\n }\n // ★«이 env 의» 기본 주소일 때만 생략한다. 넓은 기본 판정을 쓰면 dev 주소가 prod 로 해석된다.\n if (input.endpoint && !isDefaultEndpointFor(input.env ?? \"prod\", input.endpoint)) {\n args.push(\"--endpoint\", input.endpoint);\n }\n return { command: \"npx\", args };\n}\n\n/** 이 항목의 브리지가 옛 {@code --role} 을 싣고 있나 — doctor 의 «옛 설정 잔존» 판정이 쓴다. */\nexport function entryCarriesRole(entry: unknown): boolean {\n return isRecord(entry) && Array.isArray(entry.args) && entry.args.includes(\"--role\");\n}\n\n/** 이 항목이 고정한 브리지 판({@code @ainecto/mcp@X} 의 X). 고정하지 않았으면 undefined — doctor 의 «더 새 판» 판정. */\nexport function pinnedBridgeVersion(entry: unknown): string | undefined {\n if (!isRecord(entry) || !Array.isArray(entry.args)) {\n return undefined;\n }\n const pinned = entry.args.find((arg): arg is string => typeof arg === \"string\" && arg.startsWith(`${PACKAGE_NAME}@`));\n return pinned?.slice(PACKAGE_NAME.length + 1);\n}\n\nexport interface MergeResult {\n /** 적어 넣은 결과 JSON 문자열 (끝에 줄바꿈 포함). */\n content: string;\n /** 이 파일에 우리 항목이 이미 있었나 — 보고용. */\n replaced: boolean;\n /**\n * 우리가 «밀어낸» 원래 항목. ★undo 가 이것을 도로 넣는다.\n * 없으면 undefined — 그때는 undo 가 그냥 지운다.\n */\n replacedEntry?: unknown;\n}\n\n/**\n * 기존 설정을 살린 채 우리 항목 하나만 얹는다.\n *\n * ⚠<b>남의 서버 항목을 지우지 않는다.</b> 이 파일은 사용자의 것이고 우리는 한 칸을 빌릴 뿐이다.\n * 파싱이 안 되면 덮어쓰지 말고 던진다 — 읽을 수 없는 파일을 덮으면 사용자의 설정이 사라진다.\n */\n/**\n * 이 파일에 들어 있는 «우리» 서버 항목. 없거나 파일이 JSON 이 아니면 undefined.\n *\n * <p>undo 가 「우리가 쓴 그대로인가」를 보려고 쓴다 — 파일 «전체»가 아니라 우리가 소유한\n * 조각만 견주어야, 남이 다른 항목을 더한 것과 우리 항목을 손댄 것을 구별한다\n * (2026-09-23 독립 재리뷰 I8).\n */\nexport function readServerEntry(existing: string | undefined): unknown {\n if (existing === undefined) {\n return undefined;\n }\n try {\n const parsed = JSON.parse(existing) as { mcpServers?: unknown };\n const servers = parsed?.mcpServers;\n return isRecord(servers) ? servers[SERVER_NAME] : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * 이 항목이 우리 브리지({@code npx -y @ainecto/mcp[@판] …} · 전역 설치한 {@code ainecto})인가.\n * 옛 {@code --role} 을 싣는 것도 우리 브리지뿐이다(0.7.x 가 쓴 항목).\n */\nexport function isOurBridge(entry: unknown): boolean {\n if (!isRecord(entry)) {\n return false;\n }\n const { command, args } = entry as { command?: unknown; args?: unknown };\n const argList = Array.isArray(args) ? args.filter((arg): arg is string => typeof arg === \"string\") : [];\n const isOurPackage = (arg: string) => arg === PACKAGE_NAME || arg.startsWith(`${PACKAGE_NAME}@`);\n if (argList.some((arg) => isOurPackage(arg) || arg === \"--role\")) {\n return true;\n }\n const bin = typeof command === \"string\" ? basename(command) : \"\";\n return OUR_BINS.includes(bin);\n}\n\n/**\n * 전역 설치한 우리 명령 이름(package.json bin 중 브리지를 띄울 수 있는 것). ⚠{@code mcp} 는 넣지 않는다 —\n * 흔한 이름이라 남의 명령일 수 있고, 우리 브리지로 오인하면 남의 항목을 고쳐 쓰게 된다.\n */\nconst OUR_BINS: readonly string[] = [\"ainecto\"];\n\nexport function mergeServerEntry(existing: string | undefined, entry: McpServerEntry | RemoteServerEntry): MergeResult {\n const root = parseConfigObject(existing);\n const servers = readServers(root);\n const replaced = Object.prototype.hasOwnProperty.call(servers, SERVER_NAME);\n const replacedEntry = replaced ? servers[SERVER_NAME] : undefined;\n servers[SERVER_NAME] = entry;\n return { content: stringify({ ...root, mcpServers: servers }), replaced, replacedEntry };\n}\n\nexport interface RemoveResult {\n /** 우리 항목을 뺀 결과. 파일을 통째로 지워야 하면 undefined. */\n content?: string;\n removed: boolean;\n /** 우리 항목을 빼고 나니 아무것도 안 남았나. */\n emptied: boolean;\n}\n\n/**\n * 되돌릴 목표를 «감싸서» 받는다.\n *\n * <p>★{@code restoreEntry?: unknown} 과 {@code !== undefined} 조합은 <b>저장된 {@code null} 을\n * 「백업 없음」으로 바꾼다.</b> 사용자가 {@code \"ainecto\": null} 을 적어 두었고 우리가 그것을\n * 백업했다면, 되돌리기는 null 을 도로 넣어야 한다(2026-09-27 7차 독립 리뷰 I5).\n * 「값이 없다」와 「값이 null 이다」는 다른 사실이므로 그 둘을 한 자리에 담지 않는다.\n */\nexport interface RestoreEntry {\n value: unknown;\n}\n\nexport function removeServerEntry(existing: string | undefined, restore?: RestoreEntry): RemoveResult {\n if (existing === undefined) {\n return { removed: false, emptied: false };\n }\n const root = parseConfigObject(existing);\n const servers = readServers(root);\n const removed = Object.prototype.hasOwnProperty.call(servers, SERVER_NAME);\n if (restore !== undefined) {\n // ★우리가 밀어낸 사용자 항목을 도로 넣는다. 지우는 것이 아니라 «되돌리는» 것이다.\n servers[SERVER_NAME] = restore.value;\n return { content: stringify({ ...root, mcpServers: servers }), removed, emptied: false };\n }\n if (removed) {\n delete servers[SERVER_NAME];\n }\n const otherKeys = Object.keys(root).filter((key) => key !== \"mcpServers\");\n const emptied = Object.keys(servers).length === 0 && otherKeys.length === 0;\n return { content: stringify({ ...root, mcpServers: servers }), removed, emptied };\n}\n\n/**\n * {@code mcpServers} 를 읽는다. ⚠<b>모양이 틀리면 «조용히 버리지» 않는다</b> —\n * 배열이나 문자열이 들어 있는 설정을 {@code {}} 로 갈아 끼우면 사용자의 내용이 사라진다\n * (2026-09-22 독립 리뷰 I8). 이미 깨진 설정이어도 원문을 없애는 건 우리 일이 아니다.\n */\nfunction readServers(root: Record<string, unknown>): Record<string, unknown> {\n const servers = root.mcpServers;\n if (servers === undefined) {\n return {};\n }\n if (!isRecord(servers)) {\n throw new Error(\n \"Existing MCP config has an \\\"mcpServers\\\" value that is not an object, so it was left untouched. \"\n + \"Fix it by hand and run init again.\",\n );\n }\n return { ...servers };\n}\n\nfunction parseConfigObject(existing: string | undefined): Record<string, unknown> {\n if (existing === undefined || !existing.trim()) {\n return {};\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(existing);\n } catch (error) {\n throw new Error(\n `Existing MCP config is not valid JSON, so it was left untouched. Fix it by hand and run init again. (${\n error instanceof Error ? error.message : String(error)\n })`,\n );\n }\n if (!isRecord(parsed)) {\n throw new Error(\"Existing MCP config must be a JSON object; it was left untouched.\");\n }\n return parsed;\n}\n\nfunction stringify(value: unknown): string {\n return `${JSON.stringify(value, null, 2)}\\n`;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { SERVER_NAME } from \"./agentTargets\";\n\n/**\n * 저장소에 쓰는 글. ⚠<b>사용자 노출 문자열은 영어</b>로 쓴다 — 이 저장소의 기존 관례이고\n * (help·에러 메시지가 전부 영어) 공개 npm 패키지가 남의 저장소에 써 넣는 파일이다.\n * 주석·설계 메모만 한국어다.\n *\n * ★<b>권한·프로젝트를 여기 적지 않는다.</b> 세션 역할은 없고(0.8.0) 무엇을 할 수 있는지는 서버가\n * 사용자 권한으로 정한다. 저장소에 «한 프로젝트»를 묶지도 않는다 — 에이전트가 작업마다 대상을 찾는다.\n */\n\nexport const MARKER_BEGIN = \"<!-- ainecto:begin -->\";\nexport const MARKER_END = \"<!-- ainecto:end -->\";\n\ntype MarkerKind = \"begin\" | \"end\";\nconst MARKERS: Record<MarkerKind, string> = { begin: MARKER_BEGIN, end: MARKER_END };\n\n/** 하네스 폴더. */\nexport const HARNESS_DIR = \".ainecto\";\nexport const HARNESS_DOC_PATH = `${HARNESS_DIR}/HARNESS.md`;\nexport const HARNESS_CONFIG_PATH = `${HARNESS_DIR}/config.json`;\n\n/**\n * ★<b>되돌리기 기록의 자리. 이 파일은 «전부 우리 것»이다.</b>\n *\n * <p>예전엔 기록이 {@code config.json} 안에 살았다. 그 파일은 사용자도 칸을 더하고 고치는\n * 파일이라, 한 파일에 주인이 둘이었다 — 그래서 되돌리기가 매번 「이 칸이 누구 것인가」를\n * 판정해야 했고, <b>그 판정이 네 차수 연속 샜다</b>(2026-09-23 4차 I7 → 5차 I2·S3 →\n * 6차 I1·I3 → 2026-09-27 7차 I1·I2·I3).\n *\n * <p>기록을 우리 파일로 내보내면 그 질문 자체가 사라진다:\n * <ul>\n * <li>우리 파일 — 통째로 쓰고 통째로 지운다. 병합도 소유 판정도 없다.</li>\n * <li>남의 파일({@code config.json}·{@code .mcp.json}·{@code AGENTS.md}) — «병합»해서 쓰고,\n * 우리 조각만 되돌린다.</li>\n * </ul>\n * ★<b>그리고 자기 지문의 순환도 같이 사라진다.</b> 「자기 해시를 담은 문서의 해시」를 피하려고\n * 정규형에서 그 칸을 빼던 장치가 필요 없다 — 우리 파일은 지문을 «재지 않는다». 사용자가\n * 고칠 파일이 아니고, 고쳐져 있으면 읽기가 실패해 「기록 없음」으로 안전하게 떨어진다.\n */\nexport const HARNESS_RECORD_PATH = `${HARNESS_DIR}/init-record.json`;\n\nexport interface HarnessDocInput {\n endpoint: string;\n}\n\n/**\n * 저장소에 쓸 문서. ★<b>서버 본문과 패키지 기본값이 «같은 채움 경로»를 쓴다.</b>\n * 두 경로로 갈리면 서버 판만 고쳤을 때 오프라인 사용자에게는 다른 글이 나간다.\n *\n * @param template 서버에서 받은 본문. 없으면 이 패키지의 기본값(= 오프라인 기본값)을 쓴다.\n */\nexport function renderHarnessDoc(input: HarnessDocInput, template?: string): string {\n return fillTemplate(template ?? DEFAULT_HARNESS_DOC, { endpoint: input.endpoint });\n}\n\n/**\n * {{name}} 자리표시자를 채운다.\n *\n * <p>★<b>문법은 서버 레지스트리의 것이다.</b> 예전엔 이 패키지만 {@code {name}} 을 썼는데,\n * 같은 본문을 관리자 검증기가 거절했다 — 저장소를 공유하면서 계약이 둘이었다\n * (2026-09-23 독립 재리뷰 I2).\n */\nexport function fillTemplate(template: string, values: Record<string, string>): string {\n // ★원본을 «한 번만» 훑는다. 값을 하나씩 갈아 끼우면, 먼저 넣은 값 안의 자리표시자 모양\n // 글자가 다음 차례에 또 치환된다 — 프로젝트 이름에 {{endpoint}} 라고 적어 둔 사람의\n // 이름 일부가 실제 주소로 바뀌었다(2026-09-23 4차 독립 리뷰 S4).\n // ⚠모르는 이름은 그대로 둔다 — 지우면 「못 채웠다」를 아무도 못 본다.\n return template.replace(/\\{\\{([a-zA-Z0-9_]+)}}/g, (whole, name: string) =>\n Object.prototype.hasOwnProperty.call(values, name) ? values[name]! : whole);\n}\n\nexport const DOC_KEY = \"HARNESS.DOC\";\nexport const AGENT_NOTE_KEY = \"HARNESS.AGENT_NOTE\";\n\n/**\n * 각 문서가 반드시 담아야 할 변수 이름 — 서버의 REQUIRED_VARIABLES 와 같은 목록이다.\n * ★이 CLI 가 채우는 변수도 정확히 이것뿐이다({@link renderHarnessDoc}·{@link renderAgentNote}).\n */\nconst REQUIRED_VARIABLES: Record<string, string[]> = {\n [DOC_KEY]: [\"endpoint\"],\n [AGENT_NOTE_KEY]: [\"harnessDocPath\", \"serverName\"],\n};\n\n/**\n * 받은 본문을 저장소에 «써도 되는가». 쓰면 안 되면 그 이유, 괜찮으면 undefined.\n *\n * <p>셋을 본다: ①필수 변수가 원문에 «있는가» — 없으면 채워도 그 값이 안 들어간다.\n * ②이 CLI 가 «모르는» 변수가 있는가 — 있으면 못 채운 {@code {{name}}} 이 남의 저장소에 그대로 들어간다\n * (예: 0.8.0 이 옛 서버 판의 {@code {{projectName}}} 을 받는 경우 — 그때는 패키지 기본값을 쓴다).\n * ③AGENT_NOTE 라면 관리 마커가 정확히 한 쌍 있는가 — 없으면 우리 블록을 다시 찾을 수 없어\n * 재실행마다 덧붙고 undo 도 못 걷어낸다.\n */\nexport function documentContractProblem(key: string, body: string): string | undefined {\n const known = REQUIRED_VARIABLES[key] ?? [];\n for (const name of known) {\n if (!body.includes(`{{${name}}}`)) {\n return `${key} is missing the required {{${name}}} placeholder`;\n }\n }\n for (const [, name] of body.matchAll(/\\{\\{([a-zA-Z0-9_]+)}}/g)) {\n if (!known.includes(name!)) {\n return `${key} has a {{${name}}} placeholder this CLI does not fill`;\n }\n }\n if (key === AGENT_NOTE_KEY) {\n return managedBlockProblem(key, body);\n }\n return undefined;\n}\n\nconst DEFAULT_HARNESS_DOC = `# AiNecto Harness\n\nThis repository works with AiNecto. The design source of truth — requirements, the ERD,\ndiagrams, documents, and task boards — lives in AiNecto, not in this repository's files.\n\n- MCP endpoint: {{endpoint}}\n\n## What you can do\n\nEvery AI session sees the same AiNecto tools. What a tool may change is decided by the signed-in\nuser's AiNecto permissions on the workspace, project, or document it touches — the server refuses\nwhat the user may not do. A refusal is an answer: report it to the user instead of looking for a\nway around it.\n\nFind the project and document for the task with the tools (\\`list_projects\\`, \\`search_documents\\`,\n\\`get_document\\`) — this repository is not bound to one project.\n\n## When a tool is missing\n\nIf a result names a tool that is not in your tool list, this session started before that tool\nwas added. Start a new session, or call it from the repository with\n\\`npx -y ainecto@latest tools call <tool> '<json>'\\`.\n\n## Commands\n\n npx -y ainecto@latest setup connect this machine's coding agents (once per machine)\n npx -y ainecto@latest status who is signed in, and what is connected\n npx -y ainecto@latest doctor what is missing, and the command that fixes it\n\n---\nGenerated by \\`ainecto init\\`. Remove everything it wrote with \\`ainecto init --undo\\`.\n`;\n\n/**\n * AGENTS.md / CLAUDE.md 에 넣는 블록. ★<b>짧게 쓴다.</b> 이 파일들은 사용자의 것이고\n * 이미 다른 규칙이 들어 있다. 우리는 한 문단만 빌리고 전문은 우리 파일로 보낸다.\n */\nexport function renderAgentNote(template?: string): string {\n return fillTemplate(template ?? DEFAULT_AGENT_NOTE, {\n harnessDocPath: HARNESS_DOC_PATH,\n serverName: SERVER_NAME,\n });\n}\n\nconst DEFAULT_AGENT_NOTE = `${MARKER_BEGIN}\n## AiNecto Harness\n\nThis repository uses AiNecto as its design source of truth. Read \\`{{harnessDocPath}}\\` before doing\nwork that touches requirements, the ERD, or architecture.\n\nAiNecto tools come from the \\`{{serverName}}\\` MCP server. Every session sees the same tools; the\nsigned-in user's AiNecto permissions decide what they may change, and the server refuses the rest.\n${MARKER_END}`;\n\n/**\n * 이 본문이 <b>통째로 «관리 블록 하나»</b>인가. 아니면 그 이유.\n *\n * <p>★예전엔 「마커가 한 쌍 있나」만 봤다. 그래서 마커 «밖»에 머리말·꼬리말이 달린 본문이\n * 통과했고, 그 바깥 글은 init 때마다 한 번씩 더 붙고 undo 로도 안 걷혔다 — 우리가 걷어내는\n * 범위는 마커 «사이»뿐이기 때문이다(2026-09-23 4차 독립 리뷰 I4).\n *\n * <p>「넣는 범위」와 「빼는 범위」가 다르면 차이만큼 남의 파일에 쌓인다. 그래서 «넣을 것»도\n * 뺄 수 있는 모양이어야 한다: 앞뒤 공백을 빼면 정확히 한 블록.\n */\nexport function managedBlockProblem(key: string, body: string): string | undefined {\n const trimmed = body.trim();\n if (!trimmed.startsWith(MARKER_BEGIN)) {\n return `${key} must begin with ${MARKER_BEGIN} — text outside the block is never removed by --undo`;\n }\n if (!trimmed.endsWith(MARKER_END)) {\n return `${key} must end with ${MARKER_END} — text outside the block is never removed by --undo`;\n }\n const inner = trimmed.slice(MARKER_BEGIN.length, trimmed.length - MARKER_END.length);\n if (inner.includes(MARKER_BEGIN) || inner.includes(MARKER_END)) {\n return `${key} must contain exactly one ${MARKER_BEGIN} and one ${MARKER_END}`;\n }\n // ★<b>수락하는 모양과 «다시 찾을 수 있는» 모양이 같아야 한다.</b> 예전엔 양끝 문자열만 봐서\n // 한 줄짜리 블록이나 앞에 공백이 붙은 마커를 수락했다. 그런데 소유 판정은 「들여쓰기 없이\n // 줄 맨 앞, 그 줄에 마커만」이라 방금 쓴 블록을 못 찾고, 재실행마다 블록이 하나씩 늘었다\n // (2026-09-23 5차 독립 리뷰 I4).\n if (!inner.startsWith(\"\\n\")) {\n return `${key} must put ${MARKER_BEGIN} alone on its own line`;\n }\n if (!inner.endsWith(\"\\n\")) {\n return `${key} must put ${MARKER_END} alone on its own line`;\n }\n // 안에 닫히지 않은 코드펜스가 있으면, 파일에 합친 뒤 종료 마커가 그 펜스 «안»으로 들어간다.\n if (hasUnclosedFence(inner)) {\n return `${key} contains an unclosed code fence — the closing marker would fall inside it`;\n }\n return undefined;\n}\n\n/** 이 글이 코드펜스를 열어 둔 채 끝나는가. */\nfunction hasUnclosedFence(content: string): boolean {\n let open: { char: string; length: number } | undefined;\n for (const line of content.split(\"\\n\")) {\n const fence = fenceOf(line);\n if (!fence) continue;\n if (!open) open = { char: fence.char, length: fence.length };\n else if (fence.char === open.char && fence.length >= open.length && fence.info === \"\") open = undefined;\n }\n return open !== undefined;\n}\n\n/**\n * 저장되는 모양 하나. ★<b>쓰기·교체가 모두 이것을 쓴다.</b>\n *\n * <p>끝 개행은 «블록의 것이 아니라 파일 합성의 것»이다. 예전엔 블록에 딸려온 개행을 남긴 채\n * 합성이 하나를 더 붙여, 같은 입력으로 다시 돌릴 때마다 파일이 1바이트씩 자랐다\n * (605 → 606 → 607, 2026-09-23 5차 독립 리뷰 S2). 변경 없는 재실행은 파일을 안 바꿔야 한다.\n */\nexport function canonicalManagedBlock(block: string): string {\n return block.trim();\n}\n\n/**\n * 블록이 이미 있으면 갈아 끼우고, 없으면 끝에 붙인다. 사용자의 다른 내용은 건드리지 않는다.\n *\n * @throws Error 여는 표식만 있고 닫는 표식이 없을 때. ★<b>붙이면 안 된다</b> —\n * begin 이 둘, end 가 하나가 되어 다음 실행에서 «앞의 begin ~ 새 end» 가 한 덩이로\n * 잡히고 그 사이의 사용자 글이 사라진다(2026-09-22 독립 리뷰 I3).\n */\nexport function upsertMarkerBlock(existing: string | undefined, block: string): string {\n const current = existing ?? \"\";\n assertNoDanglingMarker(current);\n // ★개행의 소유를 한 곳으로 모은다 — 블록은 마커로 끝나고, 뒤의 한 줄은 «파일»의 것이다.\n const normalized = canonicalManagedBlock(block);\n const range = markerRange(current);\n const composed = range\n ? `${current.slice(0, range.start)}${normalized}${current.slice(range.end)}`\n : `${current.trim() ? `${current.replace(/\\s*$/, \"\")}\\n\\n` : \"\"}${normalized}\\n`;\n assertComposedBlockIsOurs(composed, current);\n return composed;\n}\n\n/**\n * ★<b>다시 찾을 수 있을 때만 쓴다.</b> 합성 «결과»를 소유 판정으로 되읽어, 관리 블록이\n * 정확히 하나로 보이는지 확인한다.\n *\n * <p>예전엔 «새 블록 안»만 검사했다. 그런데 소유 판정({@link ownedMarkerIndex})은 <b>파일\n * 문맥</b>을 본다 — 기존 파일이 코드펜스를 열어 둔 채 끝나면 멀쩡한 블록도 그 펜스 «안»으로\n * 들어가 우리 것으로 안 보인다. 그래서 init 마다 블록이 하나씩 늘고 undo 는 아무것도 못\n * 걷어냈다(2026-09-27 6차 독립 리뷰 I4).\n *\n * <p>「넣는 범위 = 빼는 범위」라는 규칙을 <b>블록이 아니라 합성 결과에</b> 적용한 것이다.\n * 검사할 대상은 우리가 만든 글이 아니라 «파일에 들어간 모습»이다.\n */\nfunction assertComposedBlockIsOurs(composed: string, existing: string): void {\n if (ownedMarkerCount(composed, \"begin\") === 1 && ownedMarkerCount(composed, \"end\") === 1) {\n return;\n }\n const reason = hasUnclosedFence(existing)\n ? \"this file ends inside an unclosed code fence, so the block would sit inside it\"\n : \"the block could not be found again once merged into this file\";\n throw new Error(\n `ainecto could not place its block where --undo would find it again — ${reason}. `\n + \"The file was left untouched; fix that and run again.\",\n );\n}\n\n/**\n * 표식이 짝이 안 맞으면 그 파일은 «손대지 않는다».\n *\n * <p>사람이 손으로 잘랐거나 붙여 넣다 만 경우다. 우리가 범위를 추측해서 지우면 남의 글이\n * 날아간다. 고치는 건 사람 몫이고, 우리는 무엇이 문제인지만 말한다.\n *\n * <p>★<b>세는 대상은 «우리 것으로 알아볼 수 있는» 표식뿐이다</b>({@link ownedMarkerIndex}).\n * 인용문·코드펜스·들여쓴 예제 안의 표식은 애초에 우리 것이 아니므로 짝을 세지 않는다 —\n * 예전엔 그런 예제까지 세어서 멀쩡한 파일을 「짝이 안 맞는다」고 거절했다.\n */\nexport function assertNoDanglingMarker(content: string): void {\n const begins = ownedMarkerCount(content, \"begin\");\n const ends = ownedMarkerCount(content, \"end\");\n if (begins !== ends || begins > 1) {\n throw new Error(\n `AiNecto markers are unbalanced (${begins} begin, ${ends} end). The file was left untouched — `\n + `remove the stray ${MARKER_BEGIN} / ${MARKER_END} by hand and run again.`,\n );\n }\n if (begins === 0) {\n return;\n }\n // ★개수만 세면 «end 가 begin 보다 앞선» 한 쌍을 정상으로 본다 — 그러면 새 블록을 덧붙이고\n // 다음 실행부터 중복으로 거절된다(2026-09-23 독립 재리뷰 I3).\n if (ownedMarker(content, \"end\", 0)!.at < ownedMarker(content, \"begin\", 0)!.at) {\n throw new Error(\n `AiNecto markers are out of order (${MARKER_END} appears before ${MARKER_BEGIN}). `\n + \"The file was left untouched — fix the markers by hand and run again.\",\n );\n }\n}\n\nfunction ownedMarkerCount(content: string, kind: MarkerKind): number {\n let count = 0;\n for (let hit = ownedMarker(content, kind, 0); hit !== undefined;\n hit = ownedMarker(content, kind, hit.at + 1)) {\n count += 1;\n }\n return count;\n}\n\ninterface MarkerHit {\n at: number;\n length: number;\n}\n\n/** 이 종류(여는·닫는)의 «우리» 마커 중 {@code from} 뒤에서 가장 앞의 것. */\nfunction ownedMarker(content: string, kind: MarkerKind, from: number): MarkerHit | undefined {\n return hit(ownedMarkerIndex(content, MARKERS[kind], from), MARKERS[kind]);\n}\n\n/** 이 종류의 마커 글자(우리 것인지 묻지 않는다) 중 {@code from} 뒤에서 가장 앞의 것. 증거 수집용. */\nfunction anyMarker(content: string, kind: MarkerKind, from: number): MarkerHit | undefined {\n return hit(content.indexOf(MARKERS[kind], from), MARKERS[kind]);\n}\n\nfunction hit(at: number, marker: string): MarkerHit | undefined {\n return at >= 0 ? { at, length: marker.length } : undefined;\n}\n\n/**\n * 이 위치가 코드펜스 «안»인가.\n *\n * <p>★예전엔 줄 맨 앞의 백틱 세 개를 «세어서» 홀짝으로 판정했다. 그래서 tilde 펜스,\n * 들여쓴 펜스, 그리고 «더 긴 펜스 안에 든 짧은 백틱 줄»을 전부 놓쳤고 — 예제로 적어 둔\n * 마커를 우리 블록으로 오인해 남의 본문을 갈아 끼웠다(2026-09-23 독립 재리뷰 I9).\n *\n * <p>지금은 Markdown 의 실제 규칙을 따른다: 펜스는 백틱 또는 tilde 세 개 이상으로 열리고,\n * 들여쓰기는 세 칸까지, 닫는 펜스는 <b>같은 문자</b>로 <b>연 것보다 짧지 않게</b>, 뒤에 아무것도\n * 없어야 한다. 완전한 파서는 아니지만 판정이 틀리는 쪽은 «안전한 쪽»(손대지 않음)이다.\n */\nfunction isInsideFencedBlock(content: string, index: number): boolean {\n let open: { char: string; length: number } | undefined;\n let offset = 0;\n for (const line of content.split(\"\\n\")) {\n const nextOffset = offset + line.length + 1;\n if (index < nextOffset) {\n // 표식이 이 줄에 있다 — 이 줄 «전»까지의 상태가 답이다.\n return open !== undefined;\n }\n const fence = fenceOf(line);\n if (fence) {\n if (!open) {\n open = { char: fence.char, length: fence.length };\n } else if (fence.char === open.char && fence.length >= open.length && fence.info === \"\") {\n open = undefined;\n }\n }\n offset = nextOffset;\n }\n return open !== undefined;\n}\n\n/** 이 줄이 펜스면 그 모양. 아니면 undefined. */\nfunction fenceOf(line: string): { char: string; length: number; info: string } | undefined {\n const match = /^ {0,3}(`{3,}|~{3,})(.*)$/.exec(line);\n if (!match) {\n return undefined;\n }\n const run = match[1]!;\n const info = match[2]!.trim();\n // 백틱 펜스의 정보 문자열에는 백틱이 못 들어간다(Markdown 규칙).\n if (run.startsWith(\"`\") && info.includes(\"`\")) {\n return undefined;\n }\n return { char: run[0]!, length: run.length, info };\n}\n\nexport interface MarkerRemoval {\n content: string;\n removed: boolean;\n /** 블록을 빼고 나니 빈 파일이 됐나 — 우리가 만든 파일이면 지울 수 있다. */\n emptied: boolean;\n}\n\nexport function removeMarkerBlock(existing: string | undefined): MarkerRemoval {\n const current = existing ?? \"\";\n assertNoDanglingMarker(current);\n const range = markerRange(current);\n if (!range) {\n return { content: current, removed: false, emptied: !current.trim() };\n }\n // ★<b>이어붙는 자리만</b> 손본다. 예전엔 파일 «전체»에 /\\n{3,}/ 를 돌려, 우리가 쓰지도 않은\n // 문단 사이 빈 줄까지 줄여 놓았다(2026-09-22 독립 리뷰 I2). 안 건드린 곳은 안 건드린다.\n //\n // ⚠원래 파일이 «끝 줄바꿈 없이» 끝났다면 그것까지는 되살리지 못한다 — upsert 가 붙일 때\n // 이미 지운 정보다. 그래서 「바이트 원복」이라고 말하지 않는다. 한 줄을 더한다.\n const before = current.slice(0, range.start).replace(/\\n*$/, \"\");\n const after = current.slice(range.end).replace(/^\\n*/, \"\");\n const stripped = before && after\n ? `${before}\\n\\n${after}`\n : before\n ? `${before}\\n`\n : after;\n return { content: stripped.trim() ? stripped : \"\", removed: true, emptied: !stripped.trim() };\n}\n\n/** 관리 블록을 «원래 있던 블록»으로 갈아 끼운다. undo 가 쓴다. */\nexport function replaceMarkerBlockWith(content: string, block: string): string {\n const range = markerRange(content);\n return range ? `${content.slice(0, range.start)}${block}${content.slice(range.end)}` : content;\n}\n\n/**\n * 짝이 맞지 않는 마커 하나. 중첩·잘림도 «설명해야 할 것»이므로 증거에 자리를 차지한다.\n *\n * <p>⛔글자를 바꾸지 않는다. 이미 쓰인 init 기록(0.5.0 포함)의 foreignBlocks 에 이 글자 그대로 들어 있다 —\n * 바꾸면 그 기록의 증거가 새 CLI 의 증거와 안 맞아 되돌리기가 «설명되지 않는 마커»로 멈춘다.\n * (바꿀지는 상수 변경이라 사용자 컨펌 대상 — 2026-10-14 0.6.0 에서 보류.)\n *\n * <p>★<b>여는 것과 닫는 것을 구별한다</b>(3차 리뷰 B2). 하나의 문자열로 뭉쳤더니\n * 「원래 있던 «닫는» 예제」와 「우리 블록에서 남은 «여는» 마커」가 서로 상쇄돼, 증거가 맞는 것처럼\n * 보이고 사용자 원본 백업이 버려졌다. 종류가 다르면 다른 증거다.\n */\nexport const UNPAIRED_BEGIN = \"(unpaired ai-erd begin)\";\nexport const UNPAIRED_END = \"(unpaired ai-erd end)\";\n\n/**\n * ★<b>init «전»에 이 파일에 있던 관리 블록들의 신원.</b> 되돌리기가 「이 파일에 남은 마커를\n * 내 기록으로 «설명할 수 있나»」를 묻는 데 쓰는 증거다.\n *\n * <p>★<b>왜 개수도, 모양 비교도 아닌가</b>(2026-09-27 9차 2차 리뷰 B2·N1). 두 번 틀렸다:\n * <ul>\n * <li>개수는 「예제를 지우고 그 자리에 우리 블록을 옮기기」를 못 본다 — 총수가 그대로다.</li>\n * <li>우리 블록을 «모양»으로 알아보려 하면, 제목 한 줄만 고쳐도·인용문({@code > })으로\n * 옮겨도·마커를 겹쳐도 못 알아보고 그것을 「블록이 없다」로 읽어 백업을 버렸다.\n * 거꾸로 init 전부터 있던 «똑같은» 예제는 우리 블록으로 오인해 정상 되돌리기를 막았다.</li>\n * </ul>\n * ⇒ 판정을 뒤집는다. 우리 블록을 알아보려 하지 않고, <b>기록에 있는 예제를 지워 나간 뒤 남는\n * 것을 «설명되지 않은 것»으로 본다.</b> 모양 비교는 「기록해 둔 예제가 그대로 있나」를 볼 때만\n * 쓰고, 의무 완료는 <b>증거 대조</b>가 정한다.\n *\n * <p>⚠사용자가 «자기 예제»를 고쳐 놓으면 그것도 설명되지 않은 것이 되어 되돌리기가 사람에게\n * 넘어간다. 백업을 지우는 것보다는 그쪽이 맞다 — 우리는 그 둘을 가를 근거를 갖고 있지 않다.\n */\nexport function markerEvidence(content: string | undefined): string[] {\n if (!content) {\n return [];\n }\n // ★<b>우리 블록을 «빼고» 본 파일이 증거다.</b> 소유 범위를 남겨 두면 그 경계를 가로질러 짝이\n // 지어진다 — 원래 «여는 마커만» 적어 둔 예제가 우리 블록의 «닫는 마커»와 한 쌍으로 묶여,\n // init 이 자기가 쓴 블록 때문에 «새로운 남의 증거»를 만들어 냈다(3차 리뷰 N2).\n // 빼고 보면 불변식이 선다: 우리 블록을 더하거나 걷어내도 남의 증거는 그대로다.\n const owned = markerRange(content);\n const rest = owned === undefined\n ? content\n : content.slice(0, owned.start) + content.slice(owned.end);\n const evidence: string[] = [];\n let cursor = 0;\n let begins = 0;\n let ends = 0;\n while (true) {\n const begin = anyMarker(rest, \"begin\", cursor);\n const close = anyMarker(rest, \"end\", cursor);\n if (begin === undefined && close === undefined) {\n break;\n }\n if (begin === undefined || (close !== undefined && close.at < begin.at)) {\n ends += 1; // 여는 것 없이 닫는 것이 먼저 나왔다.\n cursor = close!.at + close!.length;\n continue;\n }\n const pairEnd = anyMarker(rest, \"end\", begin.at + begin.length);\n if (pairEnd === undefined) {\n begins += 1;\n cursor = begin.at + begin.length;\n continue;\n }\n evidence.push(blockShape(rest.slice(begin.at, pairEnd.at + pairEnd.length)));\n cursor = pairEnd.at + pairEnd.length;\n }\n for (let i = 0; i < begins; i += 1) evidence.push(UNPAIRED_BEGIN);\n for (let i = 0; i < ends; i += 1) evidence.push(UNPAIRED_END);\n return evidence;\n}\n\n/** 들여쓰기와 빈 줄을 지운 «모양». 펜스·목록 안으로 옮겨져도 같은 예제로 알아본다. */\nfunction blockShape(block: string): string {\n return block.split(\"\\n\").map((line) => line.trim()).filter((line) => line.length > 0).join(\"\\n\");\n}\n\n/** 파일에 이미 들어 있던 관리 블록 원문. 없으면 undefined. undo 가 이것을 도로 넣는다. */\nexport function existingMarkerBlock(content: string | undefined): string | undefined {\n if (!content) {\n return undefined;\n }\n const range = markerRange(content);\n return range ? content.slice(range.start, range.end) : undefined;\n}\n\n/** 짝이 맞는 것은 {@link assertNoDanglingMarker} 가 이미 보장한다 — 여긴 범위만 잡는다. */\nfunction markerRange(content: string): { start: number; end: number } | undefined {\n const start = ownedMarker(content, \"begin\", 0);\n if (start === undefined) {\n return undefined;\n }\n const endMarker = ownedMarker(content, \"end\", start.at);\n if (endMarker === undefined) {\n return undefined;\n }\n return { start: start.at, end: endMarker.at + endMarker.length };\n}\n\n/**\n * ★<b>판정을 뒤집었다.</b> 「예제인지 알아내서 피한다」가 아니라\n * <b>「우리 것임을 확인할 수 있는 형태만 수락한다」</b>이다.\n *\n * <p>예제를 알아내려던 쪽은 계속 샜다 — tilde 펜스, 들여쓴 펜스, 더 긴 펜스 안의 짧은 줄,\n * 인용문 안의 코드, 네 칸 들여쓴 코드 블록…(2026-09-22 I3 → 2026-09-23 3차 I9 → 4차 I6).\n * Markdown 의 «안에 담는 문맥»은 끝이 없어서, 못 알아낸 하나가 곧 남의 본문을 지운다.\n *\n * <p>그래서 우리가 쓰는 <b>정확한 한 가지 형태</b>만 우리 것으로 본다:\n * 들여쓰기 없이 줄 맨 앞에서 시작하고, 그 줄에 표식 말고는 아무것도 없으며, 코드펜스 밖일 것.\n * ⚠이보다 느슨하게 적힌 우리 블록이 있다면 그것도 «못 알아본다» — 그 경우 덧붙이지도\n * 지우지도 않고 표식이 없는 파일처럼 다룬다. 남의 글을 지우는 쪽보다 낫다.\n */\nfunction ownedMarkerIndex(content: string, marker: string, from: number): number {\n for (let at = content.indexOf(marker, from); at >= 0; at = content.indexOf(marker, at + 1)) {\n const lineStart = content.lastIndexOf(\"\\n\", at - 1) + 1;\n if (lineStart !== at) {\n continue; // 들여썼거나 인용문(\">\") 뒤다 — 우리가 쓰는 형태가 아니다.\n }\n const lineEnd = content.indexOf(\"\\n\", at);\n const rest = (lineEnd < 0 ? content.slice(at) : content.slice(at, lineEnd)).slice(marker.length);\n if (rest.trim() !== \"\") {\n continue; // 같은 줄에 다른 글이 있다.\n }\n if (isInsideFencedBlock(content, at)) {\n continue;\n }\n return at;\n }\n return -1;\n}\n","import { HARNESS_RECORD_PATH } from \"./harnessDoc\";\n\n/**\n * 되돌리기 «기록»의 형식과 그 <b>상태 판정</b>. ★이 파일의 책임은 하나다 —\n * 「디스크에 있는 이것이 우리 기록인가, 그렇다면 온전한가」에 <b>명시적으로</b> 답하는 것.\n *\n * <p>★<b>왜 파일을 따로 두는가.</b> 다섯 차수에 걸쳐 같은 축이 샜고, 마지막 독립 리뷰가 그 이름을\n * 붙였다(2026-09-27 8차): <b>「파일 경로가 그 안의 내용이 유효하다는 증거는 아니다」</b>.\n * 기록을 우리 파일로 내보낸 것(7차)은 「이 칸이 누구 것인가」를 없앴지만, 그다음 질문을 남겼다 —\n * 「이 파일이 우리 것이라는 사실이 그 내용을 신뢰할 근거인가」. 아니다.\n *\n * <p>그때 무슨 일이 일어났나:\n * <ul>\n * <li>{@code kind} 가 다르거나 JSON 이 깨진 파일을 «부재»로 읽고, init 이 백업 없이 덮었다.\n * 읽기를 거절했는데 쓰기는 거절하지 않은 것이다(8차 I1).</li>\n * <li>{@code kind} 만 맞으면 {@code managed} 가 배열이어도, {@code version} 이 999 여도,\n * 지문 칸이 통째로 없어도 «정상 기록»으로 읽혔다. 그리고 그 기록으로 돌린 undo 가\n * <b>사용자가 편집한 문서를 지웠다</b>(8차 I2). 빈 기본값으로 채우는 관용이\n * 불확실성을 «확실»로 바꾼 것이다.</li>\n * </ul>\n * ⛔그래서 여기서는 {@code as unknown as} 로 모양을 «주장»하지 않고, 빈 값으로 «메우지» 않는다.\n * 읽어 낼 수 없으면 읽어 낼 수 없다고 말한다 — 그것이 부르는 쪽이 필요한 정보다.\n */\n\n/** 기록 파일의 신원. 사용자가 같은 이름으로 둔 파일을 실행 근거로 삼지 않는다. */\nexport const RECORD_KIND = \"ainecto/init-record\";\n\n/** 이 판이 읽고 쓰는 형식. 모르는 판은 «손상»이 아니라 «지원하지 않음»이다. */\nexport const RECORD_VERSION = 2;\n\n/**\n * 우리가 «소유한 것»의 값. ★명시적 타입이라 세 가지가 갈린다:\n * 「그 자리에 아무것도 없었다」 · 「JSON 값이었다(null 일 수도 있다)」 · 「글이었다」.\n *\n * <p>예전엔 {@code undefined} 하나로 앞의 둘을 덮었고, 그래서 사용자가 저장해 둔 {@code null} 이\n * «백업 없음»으로 바뀌었다(7차 I5).\n */\nexport type Owned =\n | { at: \"absent\" }\n | { at: \"json\"; value: unknown }\n | { at: \"text\"; text: string };\n\nexport const ABSENT: Owned = { at: \"absent\" };\n\n/** 우리가 그 파일의 «무엇을» 소유하나. 넣는 법과 빼는 법이 여기서 갈린다. */\nexport type OwnedScope =\n /** 파일 본문 전체를 우리가 쓴다(.ainecto/HARNESS.md). */\n | \"whole\"\n /** JSON 안의 MCP 서버 항목 하나(.mcp.json · .cursor/mcp.json). */\n | \"entry\"\n /** Markdown 안의 마커 블록 하나(AGENTS.md · CLAUDE.md). */\n | \"block\"\n /** JSON 안의 «칸 몇 개»(.ainecto/config.json). 나머지 칸은 사용자 것이다. */\n | \"fields\";\n\n/**\n * 한 파일에 대한 복구 계약. ★<b>한 파일의 사실이 한 곳에 모인다.</b>\n *\n * <p>예전 기록은 경로를 키로 한 «평행한 map 아홉 개»였다({@code created}·{@code replacedEntries}·\n * {@code blockAdded}·{@code replacedBlocks}·{@code originals}·{@code lastWritten}·\n * {@code lastWrittenFragment}·{@code lastWrittenBody}·{@code foreignMarkers}). 그래서 지금까지\n * 나온 결함이 거의 전부 <b>「한 map 은 X 라 하고 다른 map 은 Y 라 한다」</b>였고, 고칠 때마다\n * 그중 «한 map»만 고쳤다. 한 항목으로 묶으면 그 어긋남이 생길 자리가 없다.\n */\nexport interface FileContract {\n scope: OwnedScope;\n /** 우리가 이 파일을 «만들었나». 지워도 되는 것은 이것뿐이다. */\n createdByUs: boolean;\n /** 되돌릴 «목표» — 우리가 밀어낸 것. {@code absent} 면 「우리가 더했다」는 뜻이다. */\n original: Owned;\n /** 우리가 «실제로 쓴» 것. 「지금 값이 아직 우리 것인가」의 유일한 근거다. */\n written: Owned;\n /**\n * 우리가 쓴 «파일 전체»의 지문. 파일을 지워도 되는지 판정할 때만 쓴다.\n *\n * <p>⚠없으면 «모른다»는 뜻이고, 모를 때는 지우지 않는다. 예전엔 지문이 없으면\n * {@code changedSinceOurWrite} 가 false 를 돌려줘서 「안 바뀌었다」로 읽혔고, 그 판정이\n * 사용자 문서 삭제의 근거가 됐다(8차 I2).\n */\n fileFingerprint?: string;\n /** {@code scope===\"fields\"} 전용 — 우리가 쓴 칸의 값. 칸 단위 대조의 근거다. */\n writtenFields?: Record<string, unknown>;\n /**\n * {@code scope===\"fields\"} 전용 — 우리가 덮기 «전»에 그 칸에 있던 것. 칸마다 따로 든다.\n *\n * <p>★파일 전체를 원본으로 들면 두 가지를 못 한다(8차 I4·I6):\n * <ul>\n * <li>재init 에서 사용자가 고친 칸을 «새 기준»으로 삼기 — 파일 단위로는 어느 칸이 바뀐\n * 것인지 말할 수 없다.</li>\n * <li>원래 «빈 객체»였던 config 를 빈 객체로 되돌리기 — 파일 부재와 빈 객체가 같은\n * 결과로 뭉쳤고, 그래서 프로젝트 연결이 남았다.</li>\n * </ul>\n * ⚠「파일이 아예 없었다」는 {@link #createdByUs} 가 말한다. 이 칸은 «있던 파일 안의 칸»만 다룬다.\n */\n originalFields?: Record<string, Owned>;\n /**\n * {@code scope===\"block\"} 전용 — init «전»에 이 파일에 있던 관리 블록들의 «신원».\n * {@code markerEvidence} 가 만든 목록이고, 짝이 안 맞는 마커는 그 자리에 표시가 하나 들어간다.\n *\n * <p>★<b>개수에서 목록으로 두 번 옮겨 왔다</b>(8차 I5 → 9차 B2·N1):\n * <ul>\n * <li>Boolean 하나로는 「원래 예제가 있다」와 「우리 블록이 옮겨져 남았다」를 못 갈랐다.</li>\n * <li>개수로는 「예제를 지우고 그 자리에 우리 블록을 옮기기」를 못 봤다 — 총수가 그대로다.</li>\n * <li>우리 블록을 «모양»으로 알아보려 하면 제목 한 줄 편집·인용문 이동·중첩에 뚫렸고,\n * 반대로 init 전부터 있던 똑같은 예제를 우리 것으로 오인해 정상 되돌리기를 막았다.</li>\n * </ul>\n * ⇒ 우리 블록을 알아보려 하지 않는다. <b>이 목록으로 설명되지 않는 마커가 파일에 있으면</b>\n * 되돌리기를 완료로 만들지 않고 백업을 지킨다.\n */\n foreignBlocks?: string[];\n}\n\nexport interface InitRecord {\n version: number;\n /** 경로 → 그 파일에 대한 계약. */\n files: Record<string, FileContract>;\n /** 우리가 «실제로 만든» 디렉터리. 적용이 mkdir 결과로 채운다. */\n createdDirectories: string[];\n}\n\nexport function emptyRecord(): InitRecord {\n return { version: RECORD_VERSION, files: {}, createdDirectories: [] };\n}\n\n/**\n * 디스크에 있는 것의 «상태». ★부르는 쪽이 넷을 구별해서 다뤄야 한다 —\n * 특히 {@code corrupt}·{@code legacy} 는 「없음」이 아니다. 덮으면 안 된다.\n */\nexport type RecordState =\n | { state: \"absent\" }\n | { state: \"valid\"; record: InitRecord }\n | { state: \"corrupt\"; reason: string }\n | { state: \"legacy\"; reason: string };\n\n/**\n * ★<b>단일 로더.</b> 기록을 읽는 곳은 여기 하나다.\n *\n * <p>⛔관용을 베풀지 않는다. 한 칸이라도 계약을 벗어나면 «손상»이다 — 그 기록으로 파일을 지우는\n * 것이 되돌리기가 하는 일이고, 판단 재료가 반쯤 맞는 상태로 그 일을 해선 안 된다.\n */\nexport function readRecord(content: string | undefined): RecordState {\n if (content === undefined) {\n return { state: \"absent\" };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(content);\n } catch {\n return { state: \"corrupt\", reason: `${HARNESS_RECORD_PATH} is not valid JSON` };\n }\n if (!isObject(parsed)) {\n return { state: \"corrupt\", reason: `${HARNESS_RECORD_PATH} is not a JSON object` };\n }\n if (parsed.kind !== RECORD_KIND) {\n return {\n state: \"corrupt\",\n reason: `${HARNESS_RECORD_PATH} exists but is not an AiNecto init record (kind=`\n + `${JSON.stringify(parsed.kind)})`,\n };\n }\n if (parsed.version !== RECORD_VERSION) {\n // ★모르는 판은 손상이 아니다 — 다른 판의 CLI 가 쓴 «온전한» 기록일 수 있다.\n // 그 기록의 뜻을 우리가 추측해선 안 되고, 덮어서도 안 된다.\n return {\n state: \"legacy\",\n reason: `${HARNESS_RECORD_PATH} was written by another version of this CLI `\n + `(record version ${JSON.stringify(parsed.version)}, this CLI reads ${RECORD_VERSION})`,\n };\n }\n const files = parsed.files;\n if (!isObject(files)) {\n return { state: \"corrupt\", reason: `${HARNESS_RECORD_PATH} has no \"files\" object` };\n }\n const out: Record<string, FileContract> = {};\n for (const [path, raw] of Object.entries(files)) {\n const read = readContract(raw);\n if (\"problem\" in read) {\n return {\n state: \"corrupt\",\n reason: `${HARNESS_RECORD_PATH} has an unusable entry for ${path} — it ${read.problem}`,\n };\n }\n out[path] = read.contract;\n }\n const directories = parsed.createdDirectories;\n if (directories !== undefined && !isStringArray(directories)) {\n return { state: \"corrupt\", reason: `${HARNESS_RECORD_PATH} has a malformed createdDirectories` };\n }\n return {\n state: \"valid\",\n record: {\n version: RECORD_VERSION,\n files: out,\n createdDirectories: directories === undefined ? [] : [...directories],\n },\n };\n}\n\n/** 기록 파일의 저장 모양. ★지문을 담지 않는다 — 자기 해시를 담은 문서의 해시라는 순환이 생긴다. */\nexport function serializeRecord(record: InitRecord): string {\n return `${JSON.stringify({\n kind: RECORD_KIND,\n version: RECORD_VERSION,\n files: record.files,\n createdDirectories: record.createdDirectories,\n }, null, 2)}\\n`;\n}\n\n/**\n * 한 항목을 읽는다. ★읽어 내지 못하면 «무엇이 어긋났나»를 함께 돌려준다 —\n * 사용자가 손대야 할 파일이라 「읽을 수 없다」만으로는 고칠 수 없다.\n */\ntype ContractRead = { contract: FileContract } | { problem: string };\n\nfunction readContract(raw: unknown): ContractRead {\n if (!isObject(raw)) {\n return { problem: \"is not a JSON object\" };\n }\n const scope = raw.scope;\n if (scope !== \"whole\" && scope !== \"entry\" && scope !== \"block\" && scope !== \"fields\") {\n return { problem: `has an unknown scope (${JSON.stringify(raw.scope)})` };\n }\n if (typeof raw.createdByUs !== \"boolean\") {\n return { problem: \"does not say whether ainecto created the file\" };\n }\n const original = readOwned(raw.original);\n const written = readOwned(raw.written);\n if (original === undefined) {\n return { problem: \"has no readable record of what was there before\" };\n }\n if (written === undefined) {\n return { problem: \"has no readable record of what ainecto wrote\" };\n }\n if (raw.fileFingerprint !== undefined && typeof raw.fileFingerprint !== \"string\") {\n return { problem: \"has a malformed fileFingerprint\" };\n }\n if (raw.writtenFields !== undefined && !isObject(raw.writtenFields)) {\n return { problem: \"has a malformed writtenFields\" };\n }\n let originalFields: Record<string, Owned> | undefined;\n if (raw.originalFields !== undefined) {\n if (!isObject(raw.originalFields)) {\n return { problem: \"has a malformed originalFields\" };\n }\n originalFields = {};\n for (const [field, value] of Object.entries(raw.originalFields)) {\n const owned = readOwned(value);\n if (owned === undefined) {\n return { problem: `has no readable original for the field ${field}` };\n }\n originalFields[field] = owned;\n }\n }\n if (raw.foreignBlocks !== undefined && !isStringArray(raw.foreignBlocks)) {\n return { problem: \"has a malformed foreignBlocks\" };\n }\n if (scope === \"block\" && raw.foreignBlocks === undefined) {\n // ★블록 계약은 「이 파일에 원래 무엇이 있었나」 없이는 완료를 판정할 수 없다. 없으면 없다고 한다.\n return { problem: 'owns a marker block but does not say what marker blocks were already in the file' };\n }\n if (scope === \"fields\") {\n const problem = fieldsContractProblem({\n written,\n writtenFields: isObject(raw.writtenFields) ? raw.writtenFields : undefined,\n originalFields,\n });\n if (problem !== undefined) {\n return { problem };\n }\n }\n const contract: FileContract = {\n scope, createdByUs: raw.createdByUs, original, written,\n };\n if (typeof raw.fileFingerprint === \"string\") contract.fileFingerprint = raw.fileFingerprint;\n if (isObject(raw.writtenFields)) contract.writtenFields = { ...raw.writtenFields };\n if (originalFields !== undefined) contract.originalFields = originalFields;\n if (isStringArray(raw.foreignBlocks)) contract.foreignBlocks = [...raw.foreignBlocks];\n return { contract };\n}\n\n/**\n * {@code scope===\"fields\"} 계약이 «스스로 어긋나지» 않았나. ★로더와 계획이 <b>같은 이 함수</b>를\n * 쓴다 — 두 곳에 두면 「한쪽은 괜찮다 하고 다른 쪽은 아니라 한다」가 또 생긴다.\n *\n * <p>★<b>칸이 «있는지»에서 멈추면 반쯤 맞는 기록으로 파일을 고친다</b>(9차 B1). 세 번 뚫렸다:\n * <ul>\n * <li>{@code writtenFields.endpoint} 하나만 지운 기록을 유효로 읽었고, 되돌리기는 그 칸을\n * 「사용자가 고쳤다」로 읽어 우리 값을 남긴 뒤 <b>사용자 원본이 든 기록까지</b> 지웠다.</li>\n * <li>두 map 에서 «동시에» 지우면 그것도 유효였다 — 칸 집합끼리만 맞춰 봤기 때문이다.\n * 그래서 우리가 쓴 본문에 있는 «우리 칸»이 기록에 적혀 있는지도 본다(2차 리뷰 B1).</li>\n * <li>★원본을 {@code {at:\"text\"}} 로 바꿔 두면 유효로 읽혔고, 되돌리기는 «되돌릴 수 없는\n * 모양»을 부재로 취급해 그 칸을 지웠다 — config 가 {@code &#123;&#125;} 가 되고 기록이 사라졌다.\n * fields 의 원본은 {@code absent} 또는 {@code json} 뿐이다(2차 리뷰 B1).</li>\n * </ul>\n *\n * @param ownedFields 부르는 쪽이 아는 «우리 칸» 이름. 계획은 넘기고(그래서 양쪽 방향을 다 본다),\n * 로더는 넘기지 않는다 — 어느 칸이 우리 것인지는 형식 층의 지식이 아니다.\n */\nexport function fieldsContractProblem(\n contract: {\n written: Owned;\n writtenFields?: Record<string, unknown>;\n originalFields?: Record<string, Owned>;\n },\n ownedFields?: readonly string[],\n): string | undefined {\n const { written, writtenFields, originalFields } = contract;\n if (writtenFields === undefined) {\n return \"owns only some fields of the file but does not say which ones it wrote (writtenFields)\";\n }\n if (originalFields === undefined) {\n return \"owns only some fields of the file but does not say what was in them before (originalFields)\";\n }\n const writtenKeys = Object.keys(writtenFields).sort();\n const originalKeys = Object.keys(originalFields).sort();\n if (writtenKeys.length !== originalKeys.length\n || writtenKeys.some((key, at) => key !== originalKeys[at])) {\n return `lists different fields as written (${writtenKeys.join(\", \") || \"none\"}) and as `\n + `backed up (${originalKeys.join(\", \") || \"none\"})`;\n }\n for (const key of writtenKeys) {\n // ★되돌리기가 할 수 있는 일은 「그 값을 도로 넣기」와 「그 칸을 빼기」뿐이다. 그 둘이 아닌\n // 모양을 들고 있으면 그것은 판정 자료가 아니라 손상이다.\n const original = originalFields[key]!;\n if (original.at !== \"absent\" && original.at !== \"json\") {\n return `records the original of ${key} as ${original.at}, which is not something --undo `\n + \"can put back into a JSON field\";\n }\n }\n if (written.at !== \"text\") {\n return \"owns only some fields of the file but does not hold the file text it wrote\";\n }\n let body: unknown;\n try {\n body = JSON.parse(written.text);\n } catch {\n return \"holds a written file body that is not valid JSON\";\n }\n if (!isObject(body)) {\n return \"holds a written file body that is not a JSON object\";\n }\n for (const key of writtenKeys) {\n if (!Object.prototype.hasOwnProperty.call(body, key)) {\n return `says it wrote ${key}, but that field is not in the file body it recorded`;\n }\n if (stableStringify(body[key]) !== stableStringify(writtenFields[key])) {\n return `records a different value for ${key} than the file body it wrote`;\n }\n }\n if (ownedFields !== undefined) {\n // ★반대 방향. 우리가 쓴 본문에 «우리 칸»이 있는데 기록이 그 칸을 말하지 않으면, 그 칸에 대한\n // 판정 자료가 없다는 뜻이다 — 두 map 에서 동시에 지운 기록이 그래서 유효로 읽혔다.\n for (const key of ownedFields) {\n if (Object.prototype.hasOwnProperty.call(body, key)\n && !Object.prototype.hasOwnProperty.call(writtenFields, key)) {\n return `wrote ${key} into the file but does not record what it put there`;\n }\n }\n }\n return undefined;\n}\n\nfunction readOwned(raw: unknown): Owned | undefined {\n if (!isObject(raw)) {\n return undefined;\n }\n if (raw.at === \"absent\") {\n return ABSENT;\n }\n if (raw.at === \"json\") {\n // ⚠value 는 «없어도» 되는 칸이 아니다 — 키가 있어야 한다. null 이 값이기 때문이다.\n return Object.prototype.hasOwnProperty.call(raw, \"value\")\n ? { at: \"json\", value: raw.value }\n : undefined;\n }\n if (raw.at === \"text\") {\n return typeof raw.text === \"string\" ? { at: \"text\", text: raw.text } : undefined;\n }\n return undefined;\n}\n\n/**\n * 객체 칸의 «순서»를 지운 JSON.\n *\n * <p>★{@code JSON.parse}→{@code stringify} 는 공백은 정규화하지만 칸 순서는 그대로 둔다.\n * 그래서 사람이 편집기로 열었다 저장만 해도 「사용자가 고쳤다」로 잡혔다(4차 독립 리뷰 S1).\n *\n * <p>★<b>여기 한 벌만 둔다.</b> 기록의 «상호 일치» 판정과 계획의 «값이 바뀌었나» 판정이 다른\n * 정규형을 쓰면 「한 쪽은 같다고 하고 다른 쪽은 다르다고 한다」가 또 생긴다 — 그것이 다섯 차수를\n * 관통한 실패의 이름이었다.\n *\n * <p>⚠배열 순서는 유지한다 — 거기선 순서가 곧 내용이다(MCP 인자 목록 등).\n */\nexport function stableStringify(value: unknown): string {\n if (Array.isArray(value)) {\n return `[${value.map(stableStringify).join(\",\")}]`;\n }\n if (value && typeof value === \"object\") {\n const entries = Object.entries(value as Record<string, unknown>)\n .sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0));\n return `{${entries.map(([key, item]) => `${JSON.stringify(key)}:${stableStringify(item)}`).join(\",\")}}`;\n }\n return JSON.stringify(value) ?? \"null\";\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction isStringArray(value: unknown): value is string[] {\n return Array.isArray(value) && value.every((entry) => typeof entry === \"string\");\n}\n","import {\n AGENT_TARGETS,\n readServerEntry,\n desiredServerEntry,\n isOurEntry,\n mergeServerEntry,\n removeServerEntry,\n SERVER_NAME,\n} from \"./agentTargets\";\nimport {\n existingMarkerBlock,\n markerEvidence,\n HARNESS_CONFIG_PATH,\n HARNESS_DOC_PATH,\n HARNESS_RECORD_PATH,\n removeMarkerBlock,\n replaceMarkerBlockWith,\n renderAgentNote,\n renderHarnessDoc,\n upsertMarkerBlock,\n} from \"./harnessDoc\";\nimport {\n ABSENT,\n emptyRecord,\n fieldsContractProblem,\n readRecord,\n serializeRecord,\n stableStringify,\n type FileContract,\n type InitRecord,\n type Owned,\n type RecordState,\n} from \"./initRecord\";\nimport { createHash } from \"node:crypto\";\n\n/**\n * init 이 «무엇을 쓸지»를 순수하게 계산한다. 파일을 읽지도 쓰지도 않는다.\n *\n * ★<b>계획과 적용을 가른 이유.</b> 이 명령은 남의 저장소에 파일을 쓴다 — 가장 위험한 종류의\n * 일이다. 계산이 순수하면 「어떤 상태에서 무엇을 쓰는가」를 전부 시험으로 고정할 수 있고,\n * {@code --dry-run} 이 «진짜로 일어날 일»을 그대로 보여 준다(따로 만든 미리보기가 아니다).\n *\n * <p>★★<b>2026-09-27, 여덟 차례의 독립 리뷰 뒤에 경계를 셋으로 나눴다.</b> 다섯 차수 동안 같은\n * 축이 계속 샜고, 마지막 리뷰가 그 이유에 이름을 붙였다 — 기록이 «경로를 키로 한 평행한 map\n * 아홉 개»여서 나온 결함이 거의 전부 「한 map 은 X 라 하고 다른 map 은 Y 라 한다」였다.\n * 고칠 때마다 나는 그중 <b>한 map</b>을 고쳤다.\n * <ol>\n * <li>{@code initRecord.ts} — 기록의 «형식과 상태». 부재·유효·손상·구판을 명시적으로 돌려준다.</li>\n * <li><b>이 파일</b> — «파일별 복구 계약». 한 파일의 사실이 한 항목에 모이고,\n * 완료·보존·미해결이 {@link Outcome} 타입으로 갈린다.</li>\n * <li>{@code initCommand.applyPlan} — 적용과 기록 저장. 실제 변경과 mkdir 결과를 한 경계에서 모은다.</li>\n * </ol>\n */\n\n/** 규칙 블록을 넣을 지침 파일. 없으면 만드는 것과 있을 때만 고치는 것을 구분한다. */\nconst NOTE_TARGETS = [\n { path: \"AGENTS.md\", createIfMissing: true },\n { path: \"CLAUDE.md\", createIfMissing: false },\n] as const;\n\nexport const MANAGED_PATHS: readonly string[] = [\n ...AGENT_TARGETS.map((target) => target.path),\n ...NOTE_TARGETS.map((target) => target.path),\n HARNESS_DOC_PATH,\n HARNESS_CONFIG_PATH,\n HARNESS_RECORD_PATH,\n];\n\n/** 경로 → 현재 내용. 값이 {@code undefined} 면 «파일 없음». */\nexport type FileSnapshot = ReadonlyMap<string, string | undefined>;\n\nexport interface FileWrite {\n path: string;\n content: string;\n existed: boolean;\n}\n\nexport interface InitPlan {\n writes: FileWrite[];\n deletes: string[];\n notes: string[];\n /** init 계획이 남기는 기록. {@code .ainecto/init-record.json} 에 저장된다. */\n record?: InitRecord;\n /**\n * ★<b>아무것도 하지 말아야 하는 이유.</b> 있으면 부르는 쪽이 멈추고 이 문장을 보여 준다.\n *\n * <p>기록을 읽어 내지 못했을 때 그냥 진행하면 그 파일에 든 «남의 원본 백업»을 백업 없이\n * 덮는다 — 읽기를 거절했는데 쓰기는 거절하지 않은 것이다(2026-09-27 8차 독립 리뷰 I1).\n */\n refusal?: string;\n /**\n * 되돌리기가 «치워도 되는» 디렉터리 — 우리가 만든 것뿐이다.\n *\n * <p>★비었다는 것과 우리 것이라는 것은 다른 사실이다(4차 독립 리뷰 S3).\n */\n removableDirectories?: string[];\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// 소유한 값 다루기\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** JSON 값을 {@link Owned} 로. {@code present} 가 false 면 «그 자리에 없다»는 뜻이다. */\nfunction ownedJson(value: unknown, present: boolean): Owned {\n return present ? { at: \"json\", value } : ABSENT;\n}\n\nfunction ownedText(text: string | undefined): Owned {\n return text === undefined ? ABSENT : { at: \"text\", text };\n}\n\n/**\n * 두 소유값이 같은가. ★<b>JSON 타입을 보존한다.</b>\n *\n * <p>예전엔 문자열은 원문 그대로, 객체는 JSON 문자열로 해시해서 <b>객체와 「그 객체의 JSON 을\n * 담은 문자열」이 같은 지문</b>이 됐고, 타입이 다른데도 「원본 복구 완료」로 판정하며 객체\n * 백업을 지웠다(7차 독립 리뷰 I5). 정규화는 «칸 순서와 공백»만 지우는 일이다.\n */\nfunction sameOwned(left: Owned, right: Owned): boolean {\n if (left.at !== right.at) {\n return false;\n }\n if (left.at === \"absent\") {\n return true;\n }\n if (left.at === \"text\" && right.at === \"text\") {\n return left.text === right.text;\n }\n return left.at === \"json\" && right.at === \"json\"\n && stableStringify(left.value) === stableStringify(right.value);\n}\n\n/** 내용 지문. 암호학적 용도가 아니라 «바뀌었나»만 본다. */\nexport function contentFingerprint(content: string): string {\n return createHash(\"sha256\").update(content).digest(\"hex\");\n}\n\nfunction serialize(body: unknown): string {\n return `${JSON.stringify(body, null, 2)}\\n`;\n}\n\n/** 이 경로의 내용 지문. JSON 파일은 칸 순서를 지운 정규형으로 잰다. */\nfunction fingerprintFor(path: string, content: string): string {\n if (!path.endsWith(\".json\")) {\n return contentFingerprint(content);\n }\n try {\n return contentFingerprint(stableStringify(JSON.parse(content)));\n } catch {\n return contentFingerprint(content);\n }\n}\n\nfunction parseJsonObject(content: string): Record<string, unknown> | undefined {\n try {\n const parsed = JSON.parse(content) as unknown;\n return parsed && typeof parsed === \"object\" && !Array.isArray(parsed)\n ? (parsed as Record<string, unknown>)\n : undefined;\n } catch {\n return undefined;\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// config 의 «우리 칸»\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface ConfigBodyValues {\n endpoint: string;\n cliVersion: string;\n versions: Record<string, string>;\n}\n\n/**\n * init 이 config 에 쓰는 내용. ★적는 칸의 진실원이 여기 하나다.\n * v2(0.8.0): {@code project} 칸이 없다 — 저장소를 한 프로젝트에 묶지 않는다(요구서 11장).\n */\nfunction configBodyOf(values: ConfigBodyValues): Record<string, unknown> {\n return {\n version: 2,\n endpoint: values.endpoint,\n generatedBy: values.cliVersion,\n promptVersions: values.versions,\n };\n}\n\n/**\n * config 에서 «우리 것»인 칸. ★여기 없는 칸은 <b>사용자가 적은 것</b>이고 되돌리기가 손대지 않는다.\n *\n * <p>목록을 {@link configBodyOf} 에서 «뽑아낸다» — 손으로 베끼면 칸이 늘 때 잊는다.\n * 같은 자리를 이미 한 번 틀렸다(4차 독립 리뷰 I3).\n *\n * <p>★{@code managed} 는 이 목록에 «없다». 기록이 자기 파일로 나갔기 때문이다 — 사용자가\n * config 에 {@code managed} 라는 칸을 적어 두어도 그것은 사용자 것이다(7차 독립 리뷰 I2).\n */\nconst OUR_CONFIG_FIELDS: readonly string[] = Object.keys(configBodyOf({\n endpoint: \"\", cliVersion: \"\", versions: {},\n}));\n\n/**\n * ★<b>옛 판이 «우리 칸»으로 썼고 지금은 쓰지 않는 칸.</b> 기록({@code writtenFields})에 남아 있으면 그 칸도\n * 우리 것이다 — 재init 은 그대로면 걷어내고(원본이 있었으면 원본으로), 사용자가 고쳤으면 남긴다.\n * 되돌리기도 기록에 있는 동안은 우리 칸으로 다룬다.\n */\nconst RETIRED_CONFIG_FIELDS: readonly string[] = [\"project\"];\n\n/** 이 계약에서 «우리 칸»인 이름 — 지금의 칸 + 기록에 남은 옛 칸. */\nfunction ownedConfigFields(contract: Pick<FileContract, \"writtenFields\"> | undefined): string[] {\n const written = contract?.writtenFields ?? {};\n return [...OUR_CONFIG_FIELDS, ...RETIRED_CONFIG_FIELDS.filter((field) => hasField(written, field))];\n}\n\nconst hasField = (object: Record<string, unknown>, field: string) =>\n Object.prototype.hasOwnProperty.call(object, field);\n\n// ─────────────────────────────────────────────────────────────────────────────\n// 계획 — init\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface PlanInitInput {\n env?: \"prod\" | \"dev\";\n endpoint: string;\n /**\n * ★MCP 설정 파일({@code .mcp.json}·{@code .cursor/mcp.json})을 쓰나 — {@code init --mcp}(설계 결정 #6).\n * 없어도 «우리 항목이 이미 있는» 파일은 다시 쓴다 — 옛 로컬 중계(옛 {@code --role}·낮은 판 포함)를 서버\n * 주소로 바꾼다. 이것이 옛 저장소의 이행 경로다(별도 migrate 명령 없음, D10).\n */\n mcp: boolean;\n /** {@code --local}: 서버 주소 대신 판 고정한 로컬 중계를 쓴다(setup 과 같은 뜻). */\n local: boolean;\n /** 브리지 패키지 지정(시험용). 기본은 이 CLI 판으로 고정. */\n packageSpec?: string;\n cliVersion: string;\n files: FileSnapshot;\n /** 직전 실행의 기록 «상태». ★유효하지 않으면 init 이 멈춘다 — 덮으면 백업이 사라진다. */\n previous?: RecordState;\n /** 서버에서 받은 문서 본문. 없으면 패키지 기본값(= 오프라인 기본값)을 쓴다. */\n documents?: { doc?: string; agentNote?: string; versions?: Record<string, string> };\n}\n\n/**\n * ★<b>기록 때문에 멈춰야 하나 — «파일만» 보고 답한다.</b>\n *\n * <p>계획을 세우는 것보다 «앞»에 이 질문이 있어야 한다. 예전엔 이 판정이 {@code planInit} 안에만\n * 있었고, 부르는 쪽은 그 전에 프로젝트를 해결했다 — 프로젝트가 0개면 <b>원격에 프로젝트를 만든\n * 뒤에</b> 「아무것도 바꾸지 않았다」는 예외를 냈다(9차 1차 리뷰 B7). 로컬 쓰기가 0이어도\n * 부수효과가 0인 것은 아니다. 그래서 순수 함수로 빼서 원격 호출 전에 물을 수 있게 한다.\n *\n * <p>⚠{@code planInit} 도 이 함수를 쓴다 — 두 곳에 같은 판단을 두면 어긋난다.\n */\nexport function initRefusal(files: FileSnapshot, previous?: RecordState): string | undefined {\n const state = previous ?? readRecord(files.get(HARNESS_RECORD_PATH));\n if (state.state === \"corrupt\" || state.state === \"legacy\") {\n // ★읽어 내지 못한 기록을 덮으면 그 안의 «남의 원본 백업»이 사라진다. 읽기를 거절했으면\n // 쓰기도 거절해야 한다(8차 독립 리뷰 I1).\n return `${state.reason}. Nothing was changed — move that file aside (or restore it) and run again.`;\n }\n const carried = state.state === \"valid\" ? state.record : emptyRecord();\n for (const [path, contract] of Object.entries(carried.files)) {\n if (contract.scope !== \"fields\") {\n continue;\n }\n // ★<b>검증 «전» 기록으로 파일을 고치지 않는다.</b> 같은 완전성 검사가 되돌리기에만 있었고,\n // 재init 은 그 기록을 그대로 실행해 «현재 값»을 새 원본으로 적어 버렸다(3차 리뷰 F1).\n // ⛔로더에 도메인 지식을 넣는 대신, 도메인을 아는 이 경계에서 두 진입점이 같은 검사를 한다.\n const problem = fieldsContractProblem(contract, OUR_CONFIG_FIELDS);\n if (problem !== undefined) {\n return `${HARNESS_RECORD_PATH}'s record for ${path} ${problem}. Nothing was changed — `\n + \"restore that file (or move it aside) and run again.\";\n }\n }\n return undefined;\n}\n\nexport function planInit(input: PlanInitInput): InitPlan {\n const previous = input.previous ?? readRecord(input.files.get(HARNESS_RECORD_PATH));\n const refusal = initRefusal(input.files, previous);\n if (refusal !== undefined) {\n return { writes: [], deletes: [], notes: [], refusal };\n }\n\n const carriedRecord = previous.state === \"valid\" ? previous.record : emptyRecord();\n\n const writes: FileWrite[] = [];\n const notes: string[] = [];\n const record: InitRecord = {\n version: carriedRecord.version,\n files: { ...carriedRecord.files },\n createdDirectories: [...carriedRecord.createdDirectories],\n };\n\n /**\n * ★<b>이어받은 계약이 아직 참인가.</b> 기록은 «지난 실행의 주장»이고 그 사이에 파일이 바뀔 수\n * 있다. 지금 값이 우리가 쓴 것도 아니고 되돌릴 목표도 아니면 그 백업은 낡은 것이다 —\n * 지금 값이 사용자의 것이므로 그것이 새 기준이 되어야 한다(6차 I3 → 8차 I4).\n */\n const priorOf = (path: string, current: Owned): FileContract | undefined => {\n const prior = record.files[path];\n if (prior === undefined) {\n return undefined;\n }\n if (sameOwned(prior.written, current) || sameOwned(prior.original, current)) {\n return prior;\n }\n delete record.files[path];\n notes.push(`${path}: it changed outside ainecto, so the older backup was dropped and this is the new baseline.`);\n return undefined;\n };\n\n // ── MCP 설정 파일들 — 우리가 «항목 하나»를 소유한다 ──────────────────────────\n for (const target of AGENT_TARGETS) {\n const existing = input.files.get(target.path);\n const currentEntry = existing === undefined ? undefined : readServerEntry(existing);\n if (!input.mcp && !isOurEntry(currentEntry, input.endpoint)) {\n // --mcp 없이는 MCP 설정을 새로 쓰지 않는다. 우리 항목이 이미 있을 때만 갱신한다.\n continue;\n }\n const prior = priorOf(target.path, ownedJson(currentEntry, currentEntry !== undefined));\n const entry = desiredServerEntry({\n client: target.id, env: input.env ?? \"prod\", endpoint: input.endpoint, local: input.local, packageSpec: input.packageSpec,\n });\n const merged = mergeServerEntry(existing, entry);\n if (existing === merged.content) {\n continue;\n }\n const original = prior?.original ?? ownedJson(merged.replacedEntry, merged.replaced);\n if (prior === undefined && original.at !== \"absent\") {\n notes.push(`${target.path}: your existing \"${SERVER_NAME}\" entry was saved and will be restored by --undo`);\n }\n record.files[target.path] = {\n scope: \"entry\",\n createdByUs: prior?.createdByUs ?? existing === undefined,\n original,\n written: ownedJson(readServerEntry(merged.content), true),\n fileFingerprint: fingerprintFor(target.path, merged.content),\n };\n writes.push({ path: target.path, content: merged.content, existed: existing !== undefined });\n }\n\n // ── HARNESS.md — 우리가 «파일 전체»를 소유한다 ────────────────────────────────\n const existingDoc = input.files.get(HARNESS_DOC_PATH);\n const priorDoc = priorOf(HARNESS_DOC_PATH, ownedText(existingDoc));\n const docContent = renderHarnessDoc({ endpoint: input.endpoint }, input.documents?.doc);\n const docOriginal = priorDoc?.original ?? ownedText(existingDoc);\n if (priorDoc === undefined && docOriginal.at !== \"absent\") {\n notes.push(`${HARNESS_DOC_PATH} already existed; its original was saved and --undo will restore it.`);\n }\n record.files[HARNESS_DOC_PATH] = {\n scope: \"whole\",\n createdByUs: priorDoc?.createdByUs ?? existingDoc === undefined,\n original: docOriginal,\n written: ownedText(docContent),\n fileFingerprint: fingerprintFor(HARNESS_DOC_PATH, docContent),\n };\n if (docContent !== existingDoc) {\n writes.push({ path: HARNESS_DOC_PATH, content: docContent, existed: existingDoc !== undefined });\n }\n\n // ── AGENTS.md / CLAUDE.md — 우리가 «블록 하나»를 소유한다 ─────────────────────\n const note = renderAgentNote(input.documents?.agentNote);\n for (const target of NOTE_TARGETS) {\n const existing = input.files.get(target.path);\n if (existing === undefined && !target.createIfMissing) {\n notes.push(`${target.path} not found — skipped; AGENTS.md already reaches this agent.`);\n continue;\n }\n const blockNow = existing === undefined ? undefined : existingMarkerBlock(existing);\n const carried = record.files[target.path];\n // ⚠아래 판정은 «새 기준을 만들기 전에» 온다. 정상 위치에 블록이 있을 때만 검사하면,\n // 그 블록을 고치고 사본을 옆에 둔 파일이 가드를 건너뛰었다(3차 리뷰 B2).\n let content: string;\n try {\n content = upsertMarkerBlock(existing, note);\n } catch (error) {\n // ★우리 블록을 «다시 찾을 수 있게» 넣을 수 없는 파일이다 — 그 파일만 건너뛰고 나머지\n // init 은 계속한다. ⛔이때 기록은 «한 글자도» 건드리지 않는다: 새 기준도 못 세웠는데\n // 옛 백업을 버리면 양쪽 다 잃는다(7차 독립 리뷰 I4).\n notes.push(`${target.path}: ${error instanceof Error ? error.message : String(error)}`);\n continue;\n }\n if (carried?.scope === \"block\" && unexplainedMarkers(existing, carried) > 0) {\n // ★<b>이 파일의 마커를 기록으로 설명할 수 없다.</b> 우리 블록이 옮겨졌거나 한 벌 더\n // 있을 수 있다는 뜻이다(펜스·인용문 안, 제목만 고친 것, 정상 블록 옆의 사본 포함).\n // 그대로 진행하면 계약을 버려(priorOf) 사용자 원본 백업이 사라지고 파일에는 우리 블록이\n // 둘이 된다 — 그 상태의 undo 는 «새로 더한 것만» 걷어내고 완료로 처리했다(9차 B2).\n // ⇒ 이 파일은 손대지 않고 기록도 그대로 둔다. 자리를 되돌리는 것은 사람 몫이다.\n notes.push(\n `${target.path}: this file has an ainecto marker block that is not where ainecto can find `\n + \"it again (inside a code fence, a quote, or edited). Left untouched and the earlier \"\n + \"backup kept — move that block back to the top level, or remove it, then run again.\",\n );\n continue;\n }\n // ★<b>블록을 «못 찾는다»는 사실은 백업을 버릴 근거가 아니다</b>(3차 리뷰 B2). 마커가\n // 변형·삭제돼 우리 블록이 검출되지 않으면 예전엔 계약을 버려 사용자 원본이 사라졌다.\n // 새 기준은 «정상 위치에 사용자 것이 들어와 있을 때»만 세운다 — 그때만 되돌릴 목표가 바뀐다.\n const prior = blockNow === undefined ? carried : priorOf(target.path, ownedText(blockNow));\n if (content === existing) {\n continue;\n }\n const original = prior?.original ?? ownedText(blockNow);\n if (prior === undefined && original.at !== \"absent\") {\n notes.push(`${target.path}: an existing ainecto block was saved and will be restored by --undo`);\n }\n record.files[target.path] = {\n scope: \"block\",\n createdByUs: prior?.createdByUs ?? existing === undefined,\n original,\n written: ownedText(existingMarkerBlock(content)),\n fileFingerprint: fingerprintFor(target.path, content),\n // init «전»에 이 파일에 있던 관리 블록들의 신원. 되돌리기가 「남은 마커를 설명할 수 있나」를\n // 이것으로 묻는다. ★재init 은 이어받는다 — 다시 재면 우리가 쓴 블록이 «원래 있던 것»이 된다.\n // ★{@code carried} 를 먼저 본다 — {@code priorOf} 가 새 기준을 세웠다는 것이 「남의 예제\n // 목록을 다시 모아도 된다」는 허가가 아니다. 다시 모으면 «우리가 옮겨 둔 사본»이\n // 「원래 있던 예제」로 등록되고, 그다음 되돌리기가 그것을 남긴 채 끝났다(3차 리뷰 B2).\n foreignBlocks: carried?.foreignBlocks ?? prior?.foreignBlocks ?? markerEvidence(existing),\n };\n writes.push({ path: target.path, content, existed: existing !== undefined });\n }\n\n // ── config.json — 우리가 «칸 몇 개»를 소유한다. 나머지는 사용자 것이다 ────────\n const existingConfig = input.files.get(HARNESS_CONFIG_PATH);\n const ourFields = configBodyOf({\n endpoint: input.endpoint,\n cliVersion: input.cliVersion,\n // ★어느 판의 규칙으로 썼나. 이게 없으면 「무엇이 적혀 있었나」를 나중에 못 되짚는다.\n versions: input.documents?.versions ?? {},\n });\n const theirConfig = existingConfig === undefined ? undefined : parseJsonObject(existingConfig);\n if (existingConfig !== undefined && theirConfig === undefined) {\n // JSON 객체가 아닌 파일은 병합할 수 없다 — 손대지 않는다. ⛔이미 있던 계약도 지우지 않는다:\n // 그 안에 아직 못 되돌린 원본이 있을 수 있다(8차 독립 리뷰 I3).\n notes.push(`${HARNESS_CONFIG_PATH} is not a JSON object — left untouched.`);\n } else {\n const priorConfig = record.files[HARNESS_CONFIG_PATH];\n const originalFields: Record<string, Owned> = {};\n for (const field of OUR_CONFIG_FIELDS) {\n const presentNow = theirConfig !== undefined && hasField(theirConfig, field);\n const currentValue = presentNow ? theirConfig![field] : undefined;\n const priorOriginal = priorConfig?.originalFields?.[field];\n const priorWritten = priorConfig?.writtenFields;\n // ★재init: 사용자가 우리 칸을 고쳤으면 «그 값»이 새 원본이다. 옛 원본을 이어받으면\n // 되돌리기가 두 판 전 값을 복원하며 사용자 편집을 잃는다(8차 독립 리뷰 I4).\n const untouchedByUser = priorWritten !== undefined && hasField(priorWritten, field)\n && stableStringify(currentValue) === stableStringify(priorWritten[field]);\n const next = untouchedByUser && priorOriginal !== undefined\n ? priorOriginal\n : ownedJson(currentValue, presentNow);\n originalFields[field] = next;\n if (priorOriginal !== undefined && !sameOwned(next, priorOriginal)) {\n notes.push(`${HARNESS_CONFIG_PATH}: you changed ${field} — ainecto now treats your value as the one to put back.`);\n }\n }\n // ── 옛 판이 쓴 칸(project) — 기록과 같으면 걷어내고, 사용자가 고쳤으면 남긴다 ──\n // ★판정 규칙은 위 칸들과 같다(「기록에 적힌 우리 값과 지금 값이 같은가」). 걷어낸 칸은 기록에서도 뺀다 —\n // 더는 우리 칸이 아니므로, 사용자가 남긴 값은 이후 사용자 것이다.\n const retained = { ...(theirConfig ?? {}) };\n for (const field of RETIRED_CONFIG_FIELDS) {\n const priorWritten = priorConfig?.writtenFields;\n if (priorWritten === undefined || !hasField(priorWritten, field) || !hasField(retained, field)) {\n continue;\n }\n if (stableStringify(retained[field]) !== stableStringify(priorWritten[field])) {\n notes.push(`${HARNESS_CONFIG_PATH}: you changed ${field} — left as you set it (ainecto no longer writes it).`);\n continue;\n }\n const original = priorConfig?.originalFields?.[field];\n if (original?.at === \"json\") {\n retained[field] = original.value;\n } else {\n delete retained[field];\n }\n }\n const mergedConfig = serialize({ ...retained, ...ourFields });\n record.files[HARNESS_CONFIG_PATH] = {\n scope: \"fields\",\n createdByUs: priorConfig?.createdByUs ?? existingConfig === undefined,\n original: ABSENT,\n written: ownedText(mergedConfig),\n fileFingerprint: fingerprintFor(HARNESS_CONFIG_PATH, mergedConfig),\n writtenFields: { ...ourFields },\n originalFields,\n };\n if (mergedConfig !== existingConfig) {\n writes.push({\n path: HARNESS_CONFIG_PATH,\n content: mergedConfig,\n existed: existingConfig !== undefined,\n });\n }\n }\n\n // ── 기록 — 우리 파일. 통째로 쓰고 통째로 지운다 ───────────────────────────────\n const existingRecord = input.files.get(HARNESS_RECORD_PATH);\n const recordContent = serializeRecord(record);\n // ★변경 없는 재실행은 아무 파일도 안 바꿔야 한다(5차 독립 리뷰 S2). ⚠그렇다고 「쓸 것이\n // 없다」가 「새로 알게 된 사실도 없다」를 뜻해선 안 된다 — mkdir 결과는 적용이 따로 저장한다\n // (8차 독립 리뷰 S1).\n if (recordContent !== existingRecord) {\n writes.push({\n path: HARNESS_RECORD_PATH,\n content: recordContent,\n existed: existingRecord !== undefined,\n });\n }\n\n return { writes, deletes: [], notes, record };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// 계획 — undo\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * 한 파일에 대한 처리 «결과». ★완료·보존·미해결을 타입으로 가른다.\n *\n * <p>예전엔 셋이 같은 코드 경로로 흘렀고, 그래서 「손대지 않음」이 「복구 완료」와 같은 결과가\n * 됐다 — 판단 재료가 없어 아무것도 못 한 파일의 백업까지 지웠다(8차 독립 리뷰 I3).\n */\ntype Outcome =\n /** 목표에 도달했다 — 기록에서 지운다. */\n | { kind: \"done\"; note?: string }\n /** 되돌렸다 — 파일을 쓰고 기록에서 지운다. */\n | { kind: \"write\"; content: string; note?: string }\n /** 되돌렸다 — 파일을 지우고 기록에서 지운다. */\n | { kind: \"delete\"; note?: string }\n /** 이제 사용자 것이다 — 파일은 그대로 두고 기록에서 지운다. */\n | { kind: \"keep\"; note: string }\n /** 아직 못 했다 — ★기록을 «지키고» 이유를 말한다. */\n | { kind: \"unresolved\"; note: string };\n\nexport interface PlanUndoInput {\n files: FileSnapshot;\n /** 기록 «상태». 없으면 스냅샷에서 읽는다. */\n record?: RecordState;\n}\n\n/**\n * ★<b>우리가 쓴 것만 되돌린다.</b> 남의 서버 항목, 사용자가 표식 밖에 적은 글은 그대로 둔다.\n * 파일을 지우는 것은 «우리가 만든 파일»뿐이다.\n */\nexport function planUndo(input: PlanUndoInput): InitPlan {\n const state = input.record ?? readRecord(input.files.get(HARNESS_RECORD_PATH));\n const writes: FileWrite[] = [];\n const deletes: string[] = [];\n const notes: string[] = [];\n const tail = () => {\n // 기기 전역 연결(Claude Code 사용자 범위·Cursor 전역·Codex)은 setup 의 것이다 — init 은 그것을 쓰지 않는다.\n notes.push(\"Agent connections that `ainecto setup` made on this machine are removed with `ainecto setup --undo`.\");\n };\n\n if (state.state === \"absent\") {\n // ★기록이 없으면 «아무것도» 되돌리지 않는다. 예전엔 이름이 우리 것이면 지웠는데,\n // init 을 한 적도 없는 저장소의 사용자 항목까지 지웠다(독립 재리뷰 I2).\n notes.push(`No record of a previous init in ${HARNESS_RECORD_PATH} — no local file was changed.`);\n tail();\n return { writes, deletes, notes };\n }\n if (state.state !== \"valid\") {\n // ⛔손상·구판 기록으로 파일을 «지우지» 않는다. 그 안에 아직 못 되돌린 원본이 있을 수 있고,\n // 우리는 그것을 읽어 내지 못했다(8차 독립 리뷰 I1·S2).\n notes.push(\n `${state.reason}. Nothing was changed — that file is kept because it may hold backups `\n + \"--undo still needs. Restore it, or finish the undo with the CLI version that wrote it.\",\n );\n tail();\n return { writes, deletes, notes };\n }\n\n const record = state.record;\n /** 남은 의무. ★끝난 항목만 지운다 — 못 한 것은 남는다. */\n const remaining: Record<string, FileContract> = { ...record.files };\n\n for (const [path, contract] of Object.entries(record.files)) {\n const outcome = undoOne(path, contract, input.files.get(path));\n if (outcome.kind !== \"unresolved\" && outcome.kind !== \"keep\" && outcome.note !== undefined) {\n notes.push(outcome.note);\n } else if (outcome.kind === \"unresolved\" || outcome.kind === \"keep\") {\n notes.push(outcome.note);\n }\n if (outcome.kind === \"unresolved\") {\n continue; // 기록을 지킨다.\n }\n delete remaining[path];\n if (outcome.kind === \"write\") {\n writes.push({ path, content: outcome.content, existed: true });\n } else if (outcome.kind === \"delete\") {\n deletes.push(path);\n }\n }\n\n tail();\n\n // ★기록 파일은 «전부 우리 것»이다 — 남은 의무가 있으면 줄여서 다시 쓰고, 없으면 지운다.\n // 「이 칸이 누구 것인가」를 판정할 일이 없다.\n if (input.files.get(HARNESS_RECORD_PATH) !== undefined) {\n if (Object.keys(remaining).length > 0) {\n const reduced: InitRecord = { ...record, files: remaining };\n writes.push({ path: HARNESS_RECORD_PATH, content: serializeRecord(reduced), existed: true });\n notes.push(\n `${HARNESS_RECORD_PATH}: kept, with the finished items removed — it still holds the backups `\n + \"--undo needs. Run --undo again once the items above are resolved.\",\n );\n } else {\n deletes.push(HARNESS_RECORD_PATH);\n }\n }\n\n // ★비었다고 다 치우지 않는다 — 우리가 만든 것만. 그 목록은 적용이 mkdir 결과로 적어 둔다.\n const removableDirectories = parentsOf(deletes)\n .filter((directory) => record.createdDirectories.includes(directory));\n\n return { writes, deletes, notes, removableDirectories };\n}\n\n/**\n * ★<b>이 파일에 남은 관리 블록을 기록으로 «설명할 수 있나».</b> 설명되지 않는 것이 하나라도\n * 있으면 우리 블록이 어딘가에 있을 수 있다는 뜻이고, 그러면 의무를 완료로 만들지 않는다.\n *\n * <p>★<b>판정을 뒤집은 자리다</b>(9차 2차 리뷰 B2·N1). 「우리 블록을 알아본다」로 짜면 제목 한 줄\n * 편집·인용문 이동·마커 중첩에 전부 뚫리고, 거꾸로 init 전부터 있던 «똑같은» 예제를 우리 것으로\n * 오인해 정상 되돌리기를 막는다. 그래서 알아보려 하지 않고 <b>기록해 둔 예제를 지워 나간 뒤\n * 남는 것</b>을 센다. 모양 비교는 「적어 둔 예제가 그대로 있나」에만 쓴다.\n */\nfunction unexplainedMarkers(existing: string | undefined, contract: FileContract): number {\n const recorded = [...(contract.foreignBlocks ?? [])];\n let unexplained = 0;\n for (const print of markerEvidence(existing)) {\n const at = recorded.indexOf(print);\n if (at >= 0) {\n recorded.splice(at, 1); // init 전에 있던 그 블록이다 — 우리 일이 아니다.\n } else {\n unexplained += 1;\n }\n }\n return unexplained;\n}\n\n/** 이 파일 하나를 어떻게 할까. ★{@link Outcome} 하나만 돌려준다 — 부수효과 없음. */\nfunction undoOne(path: string, contract: FileContract, existing: string | undefined): Outcome {\n if (existing === undefined) {\n if (contract.original.at !== \"absent\" || contract.scope === \"fields\") {\n // 백업을 든 파일이 사라졌다. 「없으니 건너뛴다」로 기록을 지우면 그 원본은 영영\n // 사라진다 — 사용자가 파일을 되살릴 수도 있다(5차 독립 리뷰 I2).\n return {\n kind: \"unresolved\",\n note: `${path} is gone, so what was there before init could not be put back — `\n + \"the backup is kept. Restore the file and run --undo again.\",\n };\n }\n return { kind: \"done\" };\n }\n switch (contract.scope) {\n case \"entry\": return undoEntry(path, contract, existing);\n case \"block\": return undoBlock(path, contract, existing);\n case \"fields\": return undoFields(path, contract, existing);\n case \"whole\": return undoWhole(path, contract, existing);\n }\n}\n\nfunction undoEntry(path: string, contract: FileContract, existing: string): Outcome {\n const current = readServerEntry(existing);\n const currentOwned = ownedJson(current, current !== undefined);\n if (sameOwned(currentOwned, contract.original)) {\n return {\n kind: \"done\",\n note: contract.original.at === \"absent\"\n ? `${path}: the \"${SERVER_NAME}\" entry ainecto added is already gone.`\n : `${path}: your original \"${SERVER_NAME}\" entry is already back in place.`,\n };\n }\n // ★안내대로 지운 사람에게 같은 안내를 반복하지 않는다 — 남은 일은 원본을 도로 넣는 것이고\n // 그 경로가 바로 아래에 있다(7차 독립 리뷰 S2).\n const goneButWeHoldTheOriginal = current === undefined && contract.original.at !== \"absent\";\n if (!goneButWeHoldTheOriginal && !sameOwned(currentOwned, contract.written)) {\n return {\n kind: \"unresolved\",\n note: `${path}: the \"${SERVER_NAME}\" entry was edited after init — left in place. `\n + \"Remove it by hand if you meant to, then run --undo again.\",\n };\n }\n const restore = contract.original.at === \"json\" ? { value: contract.original.value } : undefined;\n const result = removeServerEntry(existing, restore);\n if (result.emptied && contract.createdByUs) {\n return { kind: \"delete\" };\n }\n if (result.content !== undefined && result.content !== existing) {\n return {\n kind: \"write\",\n content: result.content,\n note: restore === undefined ? undefined : `${path}: restored your original \"${SERVER_NAME}\" entry.`,\n };\n }\n return { kind: \"done\" };\n}\n\nfunction undoBlock(path: string, contract: FileContract, existing: string): Outcome {\n const current = existingMarkerBlock(existing);\n const currentOwned = ownedText(current);\n // ★<b>「예제가 있다」와 「우리 블록이 옮겨져 남았다」를 개수로 가른다.</b> Boolean 하나로는\n // 둘을 표현할 수 없었고, 예제가 있는 파일에서는 우리 블록이 남아 있어도 완료로 읽혔다\n // (8차 독립 리뷰 I5).\n // ★기록으로 설명되지 않는 마커가 있으면, 정상 위치의 블록을 걷어내는 것으로 의무가 끝나지\n // 않는다 — 우리 블록이 그 자리에 있을 수 있다. 개수도 모양도 아니라 «증거 대조»다(9차 2차 B2).\n if (unexplainedMarkers(existing, contract) > 0) {\n return {\n kind: \"unresolved\",\n note: `${path}: this file has an ainecto marker block that --undo cannot account for `\n + \"(inside a code fence, a quote, or edited). Remove it by hand, then run --undo again.\",\n };\n }\n if (sameOwned(currentOwned, contract.original)) {\n return {\n kind: \"done\",\n note: contract.original.at === \"absent\"\n ? `${path}: the ainecto block is already gone.`\n : `${path}: the ainecto block that was there before is already back in place.`,\n };\n }\n if (current === undefined && contract.original.at === \"text\") {\n // ★안내대로 지웠다 — 원본 블록을 도로 넣는다. 예전엔 여기서도 「손으로 지우고 다시\n // 실행하라」를 반복해, 이미 지운 사람에게 실행되지 않는 경로를 요구했다(8차 S3).\n const body = existing.trim()\n ? `${existing.replace(/\\s*$/, \"\")}\\n\\n${contract.original.text}\\n`\n : `${contract.original.text}\\n`;\n return { kind: \"write\", content: body, note: `${path}: restored the ainecto block that was there before.` };\n }\n if (!sameOwned(currentOwned, contract.written)) {\n return {\n kind: \"unresolved\",\n note: `${path}: the ainecto block was edited after init — left in place. `\n + \"Remove the block by hand if you meant to, then run --undo again.\",\n };\n }\n let result: { content: string; removed: boolean; emptied: boolean };\n try {\n result = contract.original.at === \"text\"\n ? { content: replaceMarkerBlockWith(existing, contract.original.text), removed: true, emptied: false }\n : removeMarkerBlock(existing);\n } catch (error) {\n return { kind: \"unresolved\", note: `${path}: ${error instanceof Error ? error.message : String(error)}` };\n }\n if (!result.removed) {\n return {\n kind: \"unresolved\",\n note: `${path}: the ainecto block could not be removed — it is still in the file. `\n + \"Remove it by hand, then run --undo again.\",\n };\n }\n if (result.emptied && contract.createdByUs) {\n return { kind: \"delete\" };\n }\n return {\n kind: \"write\",\n content: result.content,\n note: contract.original.at === \"text\"\n ? `${path}: restored the ainecto block that was there before.`\n : undefined,\n };\n}\n\nfunction undoWhole(path: string, contract: FileContract, existing: string): Outcome {\n if (sameOwned(ownedText(existing), contract.original)) {\n // 사용자가 손으로 원본을 되돌려 놨다 — 목표에 이미 도달했다(6차 독립 리뷰 I2).\n return { kind: \"done\", note: `${path} is already the file that existed before init.` };\n }\n if (!sameOwned(ownedText(existing), contract.written)) {\n if (contract.original.at === \"text\") {\n return {\n kind: \"unresolved\",\n note: `${path} was edited after init — left in place instead of restoring the pre-init file. `\n + \"The backup is kept; run --undo again once you have resolved it.\",\n };\n }\n // 우리가 만든 파일을 사용자가 고쳤다 — 이제 사용자 것이다.\n return { kind: \"keep\", note: `${path} was edited after init — left in place instead of deleting it.` };\n }\n if (contract.original.at === \"text\") {\n return {\n kind: \"write\",\n content: contract.original.text,\n note: `${path}: restored the file that existed before init.`,\n };\n }\n return contract.createdByUs ? { kind: \"delete\" } : { kind: \"done\" };\n}\n\nfunction undoFields(path: string, contract: FileContract, existing: string): Outcome {\n const parsed = parseJsonObject(existing);\n if (parsed === undefined) {\n // ★「손대지 않음」은 «복구 완료»가 아니다. 판단 재료가 없으면 백업을 지킨다(8차 I3).\n return {\n kind: \"unresolved\",\n note: `${path} is not a JSON object any more, so ainecto could not take its fields back out — `\n + \"the backup is kept. Fix the file and run --undo again.\",\n };\n }\n // ★<b>로더와 «같은» 검증을 여기서도 한다.</b> 그리고 여기서는 부르는 쪽이 아는 것을 하나 더\n // 넘긴다 — 어느 칸이 우리 것인지. 그래서 「우리가 쓴 칸인데 기록에 없다」까지 걸린다.\n // ⛔빈 map 으로 메우면 모든 칸이 「우리 것이 아니다」로 읽혀 파일은 그대로 두고 백업만\n // 지운다. 판정 자료가 반쯤 맞으면 그것으로 파일을 고치지 않는다(9차 B1 · 2차 리뷰 B1).\n const owned = ownedConfigFields(contract);\n const contractProblem = fieldsContractProblem(contract, owned);\n if (contractProblem !== undefined) {\n return {\n kind: \"unresolved\",\n note: `${path}: ainecto's record of the fields it wrote ${contractProblem}, so its fields `\n + \"were left in place — the backup is kept. Restore that record, or remove the fields by hand.\",\n };\n }\n const written = contract.writtenFields!;\n const originals = contract.originalFields!;\n const next: Record<string, unknown> = {};\n const kept: string[] = [];\n for (const [field, value] of Object.entries(parsed)) {\n if (!owned.includes(field)) {\n next[field] = value; // 사용자 칸 — 손대지 않는다.\n continue;\n }\n if (!hasField(written, field)) {\n // ★우리 칸 이름인데 기록이 그 칸을 말하지 않는다 — 판정 자료가 없다. 「사용자가 고쳤다」도\n // 「우리 것이 아니다」도 근거가 없으므로 완료로 바꾸지 않는다(9차 B1).\n return {\n kind: \"unresolved\",\n note: `${path}: ainecto has no record of what it wrote for ${field}, so its fields were `\n + \"left in place — the backup is kept. Restore that record, or remove the field by hand.\",\n };\n }\n const stillOurs = stableStringify(value) === stableStringify(written[field]);\n if (!stillOurs) {\n // ★이름이 우리 것이어도 «값»은 사용자가 고쳤다. 되돌리기가 그것을 덮지 않는다(7차 I2).\n next[field] = value;\n kept.push(field);\n continue;\n }\n const original = originals[field];\n // ★되돌릴 «목표»를 모르면 지우지 않는다. 예전엔 json 이 아닌 모든 것을 「우리가 더한 칸」으로\n // 묶어 지웠고, 원본이 {at:\"text\"} 로 바뀐 기록 하나가 config 를 «비웠다»(2차 리뷰 B1).\n // 위 검증이 이미 막지만, 이 판단을 그 검증에만 맡기지 않는다 — 여기가 파일을 고치는 자리다.\n if (original === undefined || (original.at !== \"json\" && original.at !== \"absent\")) {\n return {\n kind: \"unresolved\",\n note: `${path}: ainecto cannot tell what was in ${field} before it wrote there, so the `\n + \"file was left as it is — the backup is kept. Remove the field by hand if you meant to.\",\n };\n }\n if (original.at === \"json\") {\n next[field] = original.value; // 원래 있던 칸 → 원본 값으로.\n }\n // ⚠original 이 absent 면 우리가 «더한» 칸이므로 넣지 않는다 = 지운다.\n // ★사용자가 우리 칸을 «지웠으면» 그 칸은 위 루프에 아예 안 들어온다 — 그래서 되살아나지\n // 않는다. 예전엔 뒤에 보충 루프가 있어 삭제를 무조건 되돌렸다(8차 독립 리뷰 I4).\n }\n const note = kept.length === 0 ? undefined\n : `${path}: you changed ${kept.join(\", \")} after init — left as you set it instead of `\n + \"putting the pre-init value back.\";\n if (Object.keys(next).length === 0 && contract.createdByUs) {\n return { kind: \"delete\", note };\n }\n // ★파일이 원래 «빈 객체»였으면 빈 객체를 되돌린다 — 부재와 구별한다(8차 독립 리뷰 I6).\n const body = serialize(next);\n return body === existing\n ? { kind: \"done\", note }\n : {\n kind: \"write\",\n content: body,\n note: note ?? `${path}: removed what ainecto wrote and kept the rest.`,\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// 적용이 쓰는 것\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * 기록의 {@code createdDirectories} 를 «실제로 만든 것»으로 갈아 끼운다.\n *\n * <p>★자기 지문을 다시 계산하는 장치가 없다 — 기록이 우리 파일이라 지문을 재지 않기 때문이다.\n * 같은 순환 함정을 세 번 «요령»으로 막은 뒤(4차 I7 · 5차 S3 · 6차) 순환이 생기는 구조를\n * 없애는 쪽이 답이었다.\n */\nexport function withCreatedDirectories(current: string, directories: readonly string[]): string {\n const state = readRecord(current);\n if (state.state !== \"valid\") {\n return current;\n }\n return serializeRecord({ ...state.record, createdDirectories: [...directories] });\n}\n\nexport { readRecord, serializeRecord, emptyRecord } from \"./initRecord\";\nexport type { InitRecord, RecordState, FileContract, Owned } from \"./initRecord\";\n\n/** 이 경로들의 «저장소 안» 부모 디렉터리. 깊은 것부터 — .a/b 를 치워야 .a 가 비워진다. */\nfunction parentsOf(paths: readonly string[]): string[] {\n const directories = new Set<string>();\n for (const path of paths) {\n const parent = path.includes(\"/\") ? path.slice(0, path.lastIndexOf(\"/\")) : \"\";\n if (parent) {\n directories.add(parent);\n }\n }\n return [...directories].sort((left, right) => right.length - left.length);\n}\n","import { assertTrustedEndpointUrl } from \"../config/endpoints\";\nimport { AGENT_NOTE_KEY, DOC_KEY, documentContractProblem } from \"./harnessDoc\";\n\n/**\n * 저장소에 쓸 하네스 문서를 서버에서 받아 온다.\n *\n * <p>★<b>이것이 「규칙을 고치려면 npm 퍼블리시」를 끊는 지점이다.</b> 예전엔 본문이 패키지\n * 안에 박혀 있어서, 한 줄 고치려면 CLI 를 배포하고 모든 사용자가 init 을 다시 쳐야 했다.\n *\n * <p>⚠<b>못 받으면 «기본값을 썼다»고 적는다.</b> 조용히 패키지 사본으로 떨어지면, 서버에서\n * 규칙을 고쳐도 안 바뀌는 이유를 사용자가 영영 못 찾는다 — 오늘 여러 번 만난 모양이다.\n *\n * <p>MCP 엔드포인트 아래({@code <endpoint>/harness/documents})에 둔 이유: MCP 토큰은 REST\n * ({@code /api/v1/...})에서 거절되고, 도구로 내면 모든 세션의 도구 목록이 한 칸 늘어난다.\n */\nexport interface HarnessDocuments {\n doc?: string;\n agentNote?: string;\n /** 어느 판을 받았나. 못 받았으면 undefined. */\n versions: Record<string, string>;\n /** 못 받은 이유 — 요청 자체가 실패했을 때. 받았으면 undefined. */\n unavailableReason?: string;\n /**\n * ★<b>문서별로 패키지 기본값을 쓴 이유.</b> 서버가 HTTP 200 으로 «빈 문서»를 주거나\n * 계약을 안 지킨 본문을 줘도 예전엔 조용히 패키지 사본으로 떨어졌다 — 사용자는 자기가\n * 서버 판을 받았다고 믿는다(2026-09-23 독립 재리뷰 I5).\n */\n fallbacks: Record<string, string>;\n}\n\nexport interface FetchHarnessDocumentsInput {\n endpoint: string;\n accessToken?: string;\n client?: string;\n fetchImpl?: typeof fetch;\n}\n\nexport async function fetchHarnessDocuments(\n input: FetchHarnessDocumentsInput,\n): Promise<HarnessDocuments> {\n const url = new URL(`${input.endpoint.replace(/\\/$/, \"\")}/harness/documents`);\n assertTrustedEndpointUrl(url, \"harness documents URL\");\n if (input.client) {\n url.searchParams.set(\"client\", input.client);\n }\n const fetchImpl = input.fetchImpl ?? fetch;\n try {\n const response = await fetchImpl(url.toString(), {\n headers: {\n accept: \"application/json\",\n ...(input.accessToken ? { authorization: `Bearer ${input.accessToken}` } : {}),\n },\n });\n if (!response.ok) {\n return { versions: {}, fallbacks: {}, unavailableReason: `server answered HTTP ${response.status}` };\n }\n const payload = (await response.json()) as {\n documents?: Record<string, { body?: unknown; version?: unknown; reason?: unknown }>;\n };\n const documents = payload.documents ?? {};\n const versions: Record<string, string> = {};\n const fallbacks: Record<string, string> = {};\n const bodies: Record<string, string | undefined> = {};\n for (const key of [DOC_KEY, AGENT_NOTE_KEY]) {\n const entry = documents[key];\n const problem = usableBodyProblem(key, entry);\n if (problem) {\n // 서버가 이유를 말해 줬으면 그것을 쓰고, 아니면 우리가 본 것을 쓴다.\n fallbacks[key] = typeof entry?.reason === \"string\" && entry.reason ? entry.reason : problem;\n continue;\n }\n bodies[key] = entry!.body as string;\n if (typeof entry?.version === \"string\") {\n versions[key] = entry.version;\n }\n }\n return { doc: bodies[DOC_KEY], agentNote: bodies[AGENT_NOTE_KEY], versions, fallbacks };\n } catch (error) {\n return {\n versions: {},\n fallbacks: {},\n unavailableReason: error instanceof Error ? error.message : String(error),\n };\n }\n}\n\n/**\n * 이 응답 조각을 저장소에 «써도 되는가». 쓰면 안 되는 이유가 있으면 그 이유를 돌려준다.\n *\n * <p>★서버가 200 을 줬다는 것은 «전송이 됐다»는 뜻이지 «쓸 수 있는 글»이라는 뜻이 아니다.\n * 예전엔 본문이 비어 있지만 않으면 그대로 파일에 썼다 — 변수가 빠진 DOC 이나 관리 마커가\n * 없는 AGENT_NOTE 가 사용자 저장소에 들어갔고, 마커가 없으면 재실행마다 덧붙고 undo 도\n * 못 걷어낸다(2026-09-23 독립 재리뷰 I1).\n */\nfunction usableBodyProblem(key: string, entry: { body?: unknown } | undefined): string | undefined {\n if (typeof entry?.body !== \"string\" || !entry.body.trim()) {\n return `server returned no body for ${key}`;\n }\n return documentContractProblem(key, entry.body);\n}\n","import { lstat, readFile, realpath } from \"node:fs/promises\";\nimport { dirname, join, resolve, sep } from \"node:path\";\n\n/** 저장소 안의 파일을 다루는 문 — init 이 읽고 쓰는 모든 경로가 이 경계 검사를 지난다. */\n\n/** cwd 에서 위로 올라가며 {@code .git} 이 있는 첫 디렉터리. 없으면 undefined. */\nexport async function findGitRoot(cwd: string): Promise<string | undefined> {\n for (let at = resolve(cwd); ; at = dirname(at)) {\n try {\n await lstat(join(at, \".git\"));\n return at;\n } catch {\n // 없다(또는 볼 수 없다) — 한 칸 위로.\n }\n if (dirname(at) === at) {\n return undefined;\n }\n }\n}\n\n/**\n * ★<b>저장소 안의 파일을 읽는 유일한 문.</b> 경계 검사가 읽기 «앞»에 붙어 있다.\n *\n * <p>예전엔 스냅샷만 검사를 했고, 나중에 붙인 역할 추론이 파일을 바로 읽었다. 그래서 저장소 밖을\n * 가리키는 설정 파일을 <b>한 번 읽고 나서</b> 거절했다(2026-09-23 4차 독립 리뷰 I5). 검사와 읽기가\n * 갈라지면, 새로 생긴 경로마다 검사를 잊는다.\n */\nexport async function readManagedFile(root: string, path: string): Promise<string | undefined> {\n await assertInsideRepository(root, path);\n return readIfExists(join(root, path));\n}\n\nexport async function readIfExists(absolutePath: string): Promise<string | undefined> {\n try {\n return await readFile(absolutePath, \"utf8\");\n } catch (error) {\n if (isNodeError(error, \"ENOENT\")) {\n return undefined;\n }\n throw error;\n }\n}\n\n/**\n * ★이 경로가 정말 저장소 «안»인가.\n *\n * <p>{@code join(root, path)} 는 이름을 이어 붙일 뿐이고, {@code readFile}/{@code writeFile}\n * 은 심볼릭 링크를 따라간다. {@code .ainecto → /somewhere/else} 인 저장소에서 undo 를 돌리면\n * 남의 디렉터리 파일이 지워졌다(2026-09-22 독립 리뷰 I4). 실제 경로로 풀어서 경계를 본다.\n */\nexport async function assertInsideRepository(root: string, relativePath: string): Promise<void> {\n const absolutePath = join(root, relativePath);\n const realRoot = await realpath(root);\n let realParent: string;\n try {\n realParent = await realpath(dirname(absolutePath));\n } catch (error) {\n if (isNodeError(error, \"ENOENT\")) {\n return; // 아직 없는 디렉터리는 우리가 만든다 — 링크일 수 없다.\n }\n throw error;\n }\n if (realParent !== realRoot && !realParent.startsWith(realRoot + sep)) {\n throw new Error(\n `${relativePath} resolves outside the repository (${realParent}); refusing to touch it.`,\n );\n }\n try {\n if ((await lstat(absolutePath)).isSymbolicLink()) {\n throw new Error(`${relativePath} is a symbolic link; refusing to write through it.`);\n }\n } catch (error) {\n if (!isNodeError(error, \"ENOENT\")) {\n throw error;\n }\n }\n}\n\nfunction isNodeError(error: unknown, code: string): boolean {\n return typeof error === \"object\" && error !== null && (error as { code?: unknown }).code === code;\n}\n","import { McpRpcError, type McpRpcClient } from \"../mcp/rpcClient\";\nimport { extractProjects, unwrapMcpToolPayload } from \"../mcp/toolPayload\";\n\n/**\n * 로그인한 계정의 요약 — setup·status·doctor 가 같은 함수로 읽는다(읽기만).\n * {@code initialize} → {@code identity_get_self}(userId·표시 이름·직무) → {@code list_projects}(개수만).\n *\n * <p>★이메일은 받지도 내지도 않는다(서버 identity_get_self 도 주지 않는다). 직무는 표시명({@code jobProfile.title})만\n * 쓴다 — 직무 코드 표를 CLI 에 복사하지 않는다.\n */\nexport interface AccountSummary {\n userId?: string;\n displayName?: string;\n /** 직무 표시명. 미설정이면 null. 서버가 칸을 안 주면(옛 서버) undefined. */\n jobTitle?: string | null;\n projectCount?: number;\n /** 못 읽은 이유 — 있으면 위 칸은 읽은 데까지만. */\n problem?: AccountProblem;\n}\n\nexport interface AccountProblem {\n /** network = 서버에 못 닿음 · unauthorized = 401 · forbidden = 403(요금제에 MCP 없음 또는 계정 정지) · other */\n kind: \"network\" | \"unauthorized\" | \"forbidden\" | \"other\";\n message: string;\n}\n\nexport async function readAccount(client: McpRpcClient): Promise<AccountSummary> {\n const summary: AccountSummary = {};\n try {\n await client.initialize();\n const self = unwrapMcpToolPayload(await client.toolsCall(\"identity_get_self\", {})) as Record<string, unknown>;\n if (typeof self?.userId === \"string\") summary.userId = self.userId;\n if (typeof self?.displayName === \"string\") summary.displayName = self.displayName;\n if (\"jobProfile\" in (self ?? {})) {\n const profile = self.jobProfile as { title?: unknown } | null;\n summary.jobTitle = profile && typeof profile.title === \"string\" ? profile.title : null;\n }\n summary.projectCount = extractProjects(unwrapMcpToolPayload(await client.toolsCall(\"list_projects\", {}))).length;\n } catch (error) {\n summary.problem = classify(error);\n }\n return summary;\n}\n\nfunction classify(error: unknown): AccountProblem {\n const message = error instanceof Error ? error.message : String(error);\n if (error instanceof McpRpcError && error.code === \"MCP_HTTP_ERROR\") {\n const status = (error.details as { status?: number } | undefined)?.status;\n if (status === 401) return { kind: \"unauthorized\", message };\n if (status === 403) return { kind: \"forbidden\", message };\n return { kind: \"other\", message };\n }\n if (error instanceof McpRpcError) {\n return { kind: \"other\", message };\n }\n // fetch 자체가 던진 것 — 연결 실패(DNS·TLS·오프라인).\n return { kind: \"network\", message };\n}\n","import { chmod, mkdir, readFile, rename, stat, writeFile } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\nimport {\n entryCarriesRole,\n isOurEntry,\n normalizedServerUrl,\n pinnedBridgeVersion,\n mergeServerEntry,\n readServerEntry,\n removeServerEntry,\n SERVER_NAME,\n type AgentClientId,\n type AgentEntry,\n} from \"../harness/agentTargets\";\nimport { lastLine, type CommandRunner } from \"./commandRunner\";\n\n/**\n * ★기기 전역의 에이전트 연결 — Claude Code(사용자 범위) · Cursor(전역 {@code ~/.cursor/mcp.json}) · Codex.\n * setup 이 쓰고(connect/disconnect), status·doctor 가 읽는다(inspect). 셋이 같은 판정을 쓴다.\n *\n * <p>★기본은 서버 주소(원격 MCP)를 직접 등록한다 — 판 고정이 없고 로그인은 에이전트 자신의 OAuth 다.\n * 로컬 중계({@code npx -y @ainecto/mcp@<판>}, stdio)는 {@code REMOTE_SIGN_IN} 표에 없는 대상과\n * {@code setup --local} 에만 쓴다. 무엇을 쓸지·우리 것인가는 {@code agentTargets} 의\n * {@code desiredServerEntry}·{@code isOurEntry} 하나다(init 과 같다). 기록 파일을 따로 두지 않는다. 남의 {@code ainecto} 항목\n * (다른 주소·다른 명령)은 건드리지 않고 그대로 보고한다.\n *\n * <p>Claude Code·Codex 는 그 도구의 CLI({@code claude mcp …}·{@code codex mcp …})로만 고친다 — 설정 파일\n * 형식을 우리가 쓰지 않는다. Cursor 는 CLI 가 없어 우리가 JSON 을 병합한다(남의 항목·다른 키 보존).\n */\n\nexport const AGENT_CLIENT_LABELS: Record<AgentClientId, string> = {\n \"claude-code\": \"Claude Code\",\n cursor: \"Cursor\",\n codex: \"Codex\",\n};\n\n\nexport interface AgentState {\n client: AgentClientId;\n installed: boolean;\n /** 항목이 있는 범위 — Claude: user·local·project / Cursor·Codex: global. */\n scope?: string;\n entry?: AgentEntry;\n /** 우리 항목인가 — 우리 브리지 또는 우리 서버 주소. */\n ours: boolean;\n /** 옛 {@code --role} 을 싣고 있나(0.7.x 의 흔적). */\n carriesRole: boolean;\n /** 고정한 브리지 판({@code @ainecto/mcp@X}). 고정하지 않았으면 undefined. */\n pinnedVersion?: string;\n /** 읽다가 막힌 이유 — 있으면 상태를 모른다. */\n problem?: string;\n}\n\nexport type ConnectionStatus =\n | \"connected\" | \"updated\" | \"kept\" | \"not installed\" | \"failed\" | \"removed\" | \"not connected\";\n\nexport interface ConnectionOutcome {\n client: AgentClientId;\n label: string;\n status: ConnectionStatus;\n /** dry-run 이면 «했을» 일이다. */\n planned?: true;\n detail?: string;\n}\n\nexport interface AgentContext {\n runner: CommandRunner;\n /** 지금 쓰는 MCP 주소(정규화된 것) — 이 주소의 원격 항목도 우리 것이다. */\n endpoint: string;\n /** 사용자에게 바로 보이는 출력(stderr). 없으면 보이지 않는다(status·doctor). */\n show?: (text: string) => void;\n /** 사용자 홈 — Cursor 전역 설정의 자리. 시험은 임시 폴더를 준다. */\n home: string;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// 읽기\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport async function inspectAgents(context: AgentContext): Promise<AgentState[]> {\n return [await inspectClaude(context), await inspectCursor(context), await inspectCodex(context)];\n}\n\nconst NOT_FOUND = /No MCP server named/i;\n\n/**\n * Claude Code. {@code claude mcp get ainecto} 는 «이긴» 범위 하나를 말한다(local > project > user).\n * setup 은 홈 폴더에서 실행해 저장소의 local·project 범위가 끼지 않게 한다(실행기의 cwd).\n */\nexport async function inspectClaude({ runner, endpoint }: AgentContext): Promise<AgentState> {\n const base = { client: \"claude-code\" as const, ours: false, carriesRole: false };\n const result = await runner(\"claude\", [\"mcp\", \"get\", SERVER_NAME]);\n if (result.missing) {\n return { ...base, installed: false };\n }\n if (result.exitCode !== 0) {\n return NOT_FOUND.test(result.stdout + result.stderr)\n ? { ...base, installed: true }\n : { ...base, installed: true, problem: lastLine(result.stderr) ?? `claude mcp get exited ${result.exitCode}` };\n }\n const field = (name: string) => result.stdout.match(new RegExp(`^\\\\s*${name}:\\\\s*(.*)$`, \"m\"))?.[1]?.trim();\n const scopeText = field(\"Scope\") ?? \"\";\n const scope = /^user/i.test(scopeText) ? \"user\" : /^local/i.test(scopeText) ? \"local\"\n : /^project/i.test(scopeText) ? \"project\" : scopeText || undefined;\n const url = field(\"URL\");\n const command = field(\"Command\");\n const entry: AgentEntry | undefined = url\n ? { url }\n : command ? { command, args: (field(\"Args\") ?? \"\").split(/\\s+/).filter(Boolean) } : undefined;\n return { ...base, installed: true, scope, ...describe(entry, endpoint) };\n}\n\nexport async function inspectCursor({ home, endpoint }: AgentContext): Promise<AgentState> {\n const base = { client: \"cursor\" as const, ours: false, carriesRole: false, scope: \"global\" };\n if (!(await exists(join(home, \".cursor\")))) {\n return { ...base, installed: false };\n }\n let content: string | undefined;\n try {\n content = await readFile(cursorConfigPath(home), \"utf8\");\n } catch (error) {\n if (!isNodeError(error, \"ENOENT\")) {\n return { ...base, installed: true, problem: error instanceof Error ? error.message : String(error) };\n }\n }\n if (content !== undefined && content.trim()) {\n try {\n JSON.parse(content);\n } catch {\n return { ...base, installed: true, problem: `${cursorConfigPath(home)} is not valid JSON` };\n }\n }\n const raw = readServerEntry(content);\n return { ...base, installed: true, ...describe(toEntry(raw), endpoint) };\n}\n\nexport async function inspectCodex({ runner, endpoint }: AgentContext): Promise<AgentState> {\n const base = { client: \"codex\" as const, ours: false, carriesRole: false, scope: \"global\" };\n const result = await runner(\"codex\", [\"mcp\", \"get\", SERVER_NAME, \"--json\"]);\n if (result.missing) {\n return { ...base, installed: false };\n }\n if (result.exitCode !== 0) {\n return NOT_FOUND.test(result.stdout + result.stderr)\n ? { ...base, installed: true }\n : { ...base, installed: true, problem: lastLine(result.stderr) ?? `codex mcp get exited ${result.exitCode}` };\n }\n try {\n const parsed = JSON.parse(result.stdout) as { transport?: { command?: unknown; args?: unknown; url?: unknown } };\n const transport = parsed.transport ?? {};\n return { ...base, installed: true, ...describe(toEntry(transport), endpoint) };\n } catch {\n return { ...base, installed: true, problem: \"codex mcp get --json did not return JSON\" };\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// 쓰기\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * 한 클라이언트를 {@code desired}({@code desiredServerEntry})로 연결한다 — 우리 옛 항목(로컬 중계·다른 우리 주소)은\n * 바꿔 쓴다(updated). ★남의 항목은 건드리지 않는다. 실패는 그 클라이언트만의 결과다 —\n * 던지지 않는다(나머지 클라이언트는 계속한다).\n */\nexport async function connectAgent(\n state: AgentState,\n desired: AgentEntry,\n context: AgentContext,\n dryRun: boolean,\n): Promise<ConnectionOutcome> {\n const outcome = (status: ConnectionStatus, detail?: string): ConnectionOutcome => ({\n client: state.client, label: AGENT_CLIENT_LABELS[state.client], status,\n ...(dryRun && (status === \"connected\" || status === \"updated\") ? { planned: true as const } : {}),\n ...(detail ? { detail } : {}),\n });\n if (!state.installed) {\n return outcome(\"not installed\");\n }\n if (state.problem) {\n return outcome(\"failed\", state.problem);\n }\n if (state.entry && (!state.ours || (state.client === \"claude-code\" && state.scope !== \"user\"))) {\n return outcome(\"kept\", keptDetail(state));\n }\n if (state.entry && sameEntry(state.entry, desired)) {\n return outcome(\"connected\", \"already connected\");\n }\n const updating = state.entry !== undefined;\n const commands = writeCommands(state.client, desired, updating);\n if (dryRun) {\n return outcome(updating ? \"updated\" : \"connected\", commands.length > 0 ? `would run: ${commands.map((c) => c.join(\" \")).join(\" && \")}` : `would write ${cursorConfigPath(context.home)}`);\n }\n try {\n if (state.client === \"cursor\") {\n const path = cursorConfigPath(context.home);\n await writeKeepingMode(path, mergeServerEntry(await readIfExists(path), desired).content);\n }\n // ★Codex 원격 add 는 서버의 OAuth 를 감지하면 그 자리에서 로그인을 시작한다(끄는 옵션 없음, 0.163) —\n // 그 출력을 흘려 링크가 보이게 한다. 한도(90초)는 실행기의 것 그대로다.\n const signsInNow = state.client === \"codex\" && \"url\" in desired;\n if (signsInNow) {\n context.show?.(\"Connecting Codex — it signs in to AiNecto now. Approve it in the browser (the link follows if no tab opens):\\n\");\n }\n for (const [command, ...args] of commands) {\n const result = await context.runner(command!, args, signsInNow ? { show: context.show } : undefined);\n if (result.exitCode !== 0) {\n return outcome(\"failed\", `${[command, ...args].join(\" \")}: ${lastLine(result.stderr) ?? lastLine(result.stdout) ?? `exit ${result.exitCode}`}`);\n }\n }\n } catch (error) {\n return outcome(\"failed\", error instanceof Error ? error.message : String(error));\n }\n return outcome(updating ? \"updated\" : \"connected\");\n}\n\n/** 우리 항목(브리지·우리 서버 주소)만 지운다(setup --undo). 로그인은 그대로다 — `ainecto auth logout` 이 따로 있다. */\nexport async function disconnectAgent(state: AgentState, context: AgentContext, dryRun: boolean): Promise<ConnectionOutcome> {\n const outcome = (status: ConnectionStatus, detail?: string): ConnectionOutcome => ({\n client: state.client, label: AGENT_CLIENT_LABELS[state.client], status,\n ...(dryRun && status === \"removed\" ? { planned: true as const } : {}),\n ...(detail ? { detail } : {}),\n });\n if (!state.installed) {\n return outcome(\"not installed\");\n }\n if (state.problem) {\n return outcome(\"failed\", state.problem);\n }\n if (!state.entry) {\n return outcome(\"not connected\");\n }\n if (!state.ours || (state.client === \"claude-code\" && state.scope !== \"user\")) {\n return outcome(\"kept\", keptDetail(state));\n }\n if (dryRun) {\n return outcome(\"removed\");\n }\n try {\n if (state.client === \"cursor\") {\n const path = cursorConfigPath(context.home);\n const removed = removeServerEntry(await readIfExists(path));\n if (removed.content !== undefined) {\n await writeKeepingMode(path, removed.content);\n }\n } else {\n const [command, ...args] = removeCommand(state.client);\n const result = await context.runner(command!, args);\n if (result.exitCode !== 0) {\n return outcome(\"failed\", `${[command, ...args].join(\" \")}: ${lastLine(result.stderr) ?? `exit ${result.exitCode}`}`);\n }\n }\n } catch (error) {\n return outcome(\"failed\", error instanceof Error ? error.message : String(error));\n }\n return outcome(\"removed\");\n}\n\nexport function cursorConfigPath(home: string): string {\n return join(home, \".cursor\", \"mcp.json\");\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// 내부\n// ─────────────────────────────────────────────────────────────────────────────\n\nfunction writeCommands(client: AgentClientId, entry: AgentEntry, updating: boolean): string[][] {\n if (client === \"claude-code\") {\n // 같은 범위에 같은 이름이 있으면 add 가 거절한다 — 우리 것일 때만 지우고 다시 넣는다.\n const add = \"url\" in entry\n ? [\"--transport\", \"http\", \"-s\", \"user\", SERVER_NAME, entry.url]\n : [\"-s\", \"user\", SERVER_NAME, \"--\", entry.command, ...entry.args];\n return [\n ...(updating ? [[\"claude\", \"mcp\", \"remove\", \"-s\", \"user\", SERVER_NAME]] : []),\n [\"claude\", \"mcp\", \"add\", ...add],\n ];\n }\n if (client === \"codex\") {\n // codex mcp add 는 같은 이름을 덮어쓴다(0.163 실측, stdio↔url 양쪽).\n return [[\"codex\", \"mcp\", \"add\", SERVER_NAME, ...(\"url\" in entry ? [\"--url\", entry.url] : [\"--\", entry.command, ...entry.args])]];\n }\n return [];\n}\n\nfunction removeCommand(client: Exclude<AgentClientId, \"cursor\">): string[] {\n return client === \"claude-code\"\n ? [\"claude\", \"mcp\", \"remove\", \"-s\", \"user\", SERVER_NAME]\n : [\"codex\", \"mcp\", \"remove\", SERVER_NAME];\n}\n\nfunction keptDetail(state: AgentState): string {\n if (state.client === \"claude-code\" && state.ours && state.scope !== \"user\") {\n return `a ${state.scope}-scope \"${SERVER_NAME}\" entry takes precedence here — left as it is`;\n }\n const where = state.scope ? ` (${state.scope})` : \"\";\n return `someone else's \"${SERVER_NAME}\" entry${where} — left untouched`;\n}\n\nfunction describe(entry: AgentEntry | undefined, endpoint: string): Pick<AgentState, \"entry\" | \"ours\" | \"carriesRole\" | \"pinnedVersion\"> {\n if (!entry) {\n return { ours: false, carriesRole: false };\n }\n if (\"url\" in entry) {\n return { entry, ours: isOurEntry(entry, endpoint), carriesRole: false };\n }\n const pinnedVersion = pinnedBridgeVersion(entry);\n return {\n entry,\n ours: isOurEntry(entry, endpoint),\n carriesRole: entryCarriesRole(entry),\n ...(pinnedVersion ? { pinnedVersion } : {}),\n };\n}\n\nfunction toEntry(raw: unknown): AgentEntry | undefined {\n if (typeof raw !== \"object\" || raw === null) {\n return undefined;\n }\n const { command, args, url } = raw as { command?: unknown; args?: unknown; url?: unknown };\n if (typeof url === \"string\" && url) {\n return { url };\n }\n if (typeof command === \"string\") {\n return { command, args: Array.isArray(args) ? args.filter((arg): arg is string => typeof arg === \"string\") : [] };\n }\n return undefined;\n}\n\nfunction sameEntry(entry: AgentEntry, desired: AgentEntry): boolean {\n if (\"url\" in desired) {\n return \"url\" in entry && normalizedServerUrl(entry.url) === desired.url;\n }\n return \"command\" in entry && entry.command === desired.command\n && entry.args.length === desired.args.length && entry.args.every((arg, at) => arg === desired.args[at]);\n}\n\nasync function writeKeepingMode(path: string, content: string): Promise<void> {\n await mkdir(dirname(path), { recursive: true });\n let mode: number | undefined;\n try {\n mode = (await stat(path)).mode & 0o7777;\n } catch (error) {\n if (!isNodeError(error, \"ENOENT\")) {\n throw error;\n }\n }\n const tmp = `${path}.${process.pid}.${Date.now()}.tmp`;\n await writeFile(tmp, content, { encoding: \"utf8\", mode: mode ?? 0o600 });\n if (mode !== undefined) {\n await chmod(tmp, mode);\n }\n await rename(tmp, path);\n}\n\nasync function readIfExists(path: string): Promise<string | undefined> {\n try {\n return await readFile(path, \"utf8\");\n } catch (error) {\n if (isNodeError(error, \"ENOENT\")) {\n return undefined;\n }\n throw error;\n }\n}\n\nasync function exists(path: string): Promise<boolean> {\n try {\n await stat(path);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isNodeError(error: unknown, code: string): boolean {\n return typeof error === \"object\" && error !== null && (error as { code?: unknown }).code === code;\n}\n","import { spawn } from \"node:child_process\";\n\n/**\n * 외부 명령({@code claude}·{@code codex}) 실행의 ★단일 지점. setup·status·doctor 가 모두 이것만 부른다 —\n * 시험은 가짜 실행기(또는 PATH 앞의 기록 스크립트)를 넣는다.\n *\n * <p>셸을 거치지 않는다(인자 그대로). 실행 파일이 없으면 {@code missing} 이고 예외가 아니다 —\n * «설치 안 됨»은 실패가 아니라 보고할 상태다.\n */\nexport interface CommandResult {\n exitCode: number | null;\n stdout: string;\n stderr: string;\n /** 실행 파일을 찾지 못했다(ENOENT). */\n missing: boolean;\n}\n\nexport interface RunOptions {\n /** 자식의 출력을 «받는 대로» 사용자에게도 보인다 — 실행 중에 사람이 봐야 하는 것(로그인 링크)이 있을 때만. */\n show?: (text: string) => void;\n}\n\nexport type CommandRunner = (command: string, args: readonly string[], options?: RunOptions) => Promise<CommandResult>;\n\n/**\n * 실행한 명령 한 줄 — ★요청과 응답이 한 항목이다(명령 줄 + 종료 코드). 결과의 {@code commands} 로 나간다.\n * 응답이 없는 요청은 구조적으로 없다: 실행기가 끝나야 항목이 생긴다.\n */\nexport interface CommandLog {\n command: string;\n exitCode: number | null;\n missing?: true;\n /** 실패했을 때 stderr(없으면 stdout)의 마지막 줄 — 원인을 그 자리에서 보이게. */\n error?: string;\n}\n\n/**\n * {@code claude mcp get} 은 서버 연결 점검까지 한다(브리지를 띄운다) — 그래서 짧지 않다.\n * 이 한도를 넘기면 그 클라이언트만 실패로 보고하고 나머지는 계속한다.\n */\nconst COMMAND_TIMEOUT_MS = 90_000;\n\nexport function systemCommandRunner(options: { cwd: string; env?: NodeJS.ProcessEnv }): CommandRunner {\n return (command, args, run) => new Promise((resolve) => {\n let stdout = \"\";\n let stderr = \"\";\n let settled = false;\n const finish = (result: CommandResult) => {\n if (!settled) {\n settled = true;\n clearTimeout(timer);\n resolve(result);\n }\n };\n const child = spawn(command, [...args], {\n cwd: options.cwd,\n env: options.env ?? process.env,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n const timer = setTimeout(() => {\n child.kill();\n finish({ exitCode: null, stdout, stderr: `${stderr}\\n${command} timed out after ${COMMAND_TIMEOUT_MS / 1000}s`, missing: false });\n }, COMMAND_TIMEOUT_MS);\n child.stdout.on(\"data\", (chunk) => { stdout += String(chunk); run?.show?.(String(chunk)); });\n child.stderr.on(\"data\", (chunk) => { stderr += String(chunk); run?.show?.(String(chunk)); });\n child.on(\"error\", (error: NodeJS.ErrnoException) => {\n finish({ exitCode: null, stdout, stderr: error.message, missing: error.code === \"ENOENT\" });\n });\n child.on(\"close\", (code) => finish({ exitCode: code, stdout, stderr, missing: false }));\n });\n}\n\n/** 실행기를 감싸 실행한 명령을 {@link CommandLog} 로 모은다. */\nexport function recordingRunner(runner: CommandRunner, log: CommandLog[]): CommandRunner {\n return async (command, args, run) => {\n const result = await runner(command, args, run);\n const entry: CommandLog = { command: [command, ...args].join(\" \"), exitCode: result.exitCode };\n if (result.missing) {\n entry.missing = true;\n } else if (result.exitCode !== 0) {\n entry.error = lastLine(result.stderr) ?? lastLine(result.stdout);\n }\n log.push(entry);\n return result;\n };\n}\n\n/** 출력의 마지막 비어 있지 않은 줄 — 실패 원인을 한 줄로 보일 때 쓴다. */\nexport function lastLine(text: string): string | undefined {\n const lines = text.split(\"\\n\").map((line) => line.trim()).filter(Boolean);\n return lines[lines.length - 1];\n}\n","import { usableAccessToken } from \"../../core/auth/oauth\";\nimport { profileSettingsUrl } from \"../../core/config/endpoints\";\nimport { renderSuccess } from \"../../core/output/render\";\nimport type { McpRpcClient } from \"../../core/mcp/rpcClient\";\nimport { readAccount, type AccountSummary } from \"../../core/setup/accountSummary\";\nimport {\n connectAgent,\n disconnectAgent,\n inspectAgents,\n type AgentContext,\n type ConnectionOutcome,\n} from \"../../core/setup/agentConnections\";\nimport { recordingRunner, type CommandLog, type CommandRunner } from \"../../core/setup/commandRunner\";\nimport { desiredServerEntry, REMOTE_SIGN_IN, type AgentClientId } from \"../../core/harness/agentTargets\";\n\nexport interface SetupCommandOptions {\n argv: string[];\n endpoint: string;\n env: \"prod\" | \"dev\";\n /** `ainecto auth login` 과 같은 함수들. */\n auth: { getAccessToken(): Promise<string | undefined>; login(): Promise<unknown> };\n client: McpRpcClient;\n /** 외부 명령 실행기 — setup 은 이것으로만 `claude`·`codex` 를 부른다. */\n runner: CommandRunner;\n /** 사용자 홈(Cursor 전역 설정의 자리). */\n home: string;\n json: boolean;\n io: { stdout: NodeJS.WriteStream; stderr: NodeJS.WriteStream };\n}\n\n/**\n * {@code ainecto setup} — ★기기 1회(설계 §4-1). 로그인 → 연결 확인(읽기) → 에이전트 연결.\n *\n * <ul>\n * <li>Claude Code(사용자 범위)·Cursor(전역)·Codex 에 ★서버 주소(원격 MCP)를 각각 따로 등록하고, 결과를 클라이언트마다\n * {@code connected / updated / kept / not installed / failed} 로 말한다. 하나라도 실패하면 «부분 완료», 종료 1.</li>\n * <li>우리 옛 항목(로컬 중계 {@code npx -y @ainecto/mcp@판})은 원격으로 바꿔 쓴다(updated). 남의 {@code ainecto}\n * 항목은 건드리지 않는다. 소유 판정은 {@code agentConnections} 하나.</li>\n * <li>{@code --local}: 원격 대신 로컬 중계로 등록한다(이 기기의 로그인 하나를 모든 에이전트가 같이 쓴다).</li>\n * <li>{@code --dry-run}: 로그인하지 않고 아무것도 쓰지 않는다 — 할 일만 보인다.</li>\n * <li>{@code --undo}: 우리 항목(원격·로컬 중계)만 지운다. 로그인은 {@code ainecto auth logout} 이 따로 한다.</li>\n * </ul>\n */\nexport async function executeSetupCommand(options: SetupCommandOptions): Promise<number> {\n const args = parseSetupArgs(options.argv);\n const commands: CommandLog[] = [];\n const context: AgentContext = {\n runner: recordingRunner(options.runner, commands),\n home: options.home,\n endpoint: options.endpoint,\n // Codex 의 원격 add 는 그 자리에서 로그인한다 — 그 출력(로그인 링크)을 사용자에게 흘린다(stdout 결과는 깨끗하게).\n show: (text) => { options.io.stderr.write(text); },\n };\n\n if (args.undo) {\n const states = await inspectAgents(context);\n const agents: ConnectionOutcome[] = [];\n for (const state of states) {\n agents.push(await disconnectAgent(state, context, args.dryRun));\n }\n const failed = agents.some((agent) => agent.status === \"failed\");\n options.io.stdout.write(renderSuccess({\n action: args.dryRun ? \"setup --undo (dry-run)\" : \"setup --undo\",\n agents,\n commands,\n notes: [\"Your sign-in is kept — sign out with `ainecto auth logout`.\"],\n }, { json: options.json }));\n return failed ? 1 : 0;\n }\n\n // ① 로그인 — 쓸 수 있는 토큰이 없으면(서버가 저장 로그인을 거절한 경우 포함) 브라우저 1회.\n // dry-run 은 로그인하지 않는다. ★판정은 init 과 같은 {@link usableAccessToken} 하나다.\n let signedIn = Boolean(await usableAccessToken(options.auth));\n if (!signedIn && !args.dryRun) {\n await options.auth.login();\n options.io.stderr.write(\"Signed in.\\n\");\n signedIn = true;\n }\n\n // ② 연결 확인(읽기만).\n const account = signedIn ? await readAccount(options.client) : undefined;\n\n // ③ 에이전트 연결 — 클라이언트마다 따로. 실패는 그 클라이언트만의 결과다.\n const agents: ConnectionOutcome[] = [];\n const remote: AgentClientId[] = [];\n for (const state of await inspectAgents(context)) {\n const desired = desiredServerEntry({ client: state.client, env: options.env, endpoint: options.endpoint, local: args.local });\n const outcome = await connectAgent(state, desired, context, args.dryRun);\n agents.push(outcome);\n // failed 도 싣는다 — 항목은 들어갔는데 로그인이 못 끝난 경우(Codex 한도 초과)가 있다. 재실행(already connected)도 다시 싣는다.\n if (\"url\" in desired && (outcome.status === \"connected\" || outcome.status === \"updated\" || outcome.status === \"failed\")) {\n remote.push(state.client);\n }\n }\n\n const failed = agents.some((agent) => agent.status === \"failed\") || account?.problem !== undefined;\n options.io.stdout.write(renderSuccess({\n action: args.dryRun ? \"setup (dry-run)\" : \"setup\",\n setup: failed ? \"partial\" : \"complete\",\n endpoint: options.endpoint,\n account: accountView(account, signedIn, options.endpoint),\n agents,\n commands,\n next: nextSteps(account, agents, remote, options.endpoint),\n }, { json: options.json }));\n return failed ? 1 : 0;\n}\n\n/**\n * 사람이 읽는 계정 칸. ★이메일은 없다. 직무는 «Your AiNecto role» — 권한이 아니라 AI 설명 방식에만 쓰인다.\n */\nexport function accountView(account: AccountSummary | undefined, signedIn: boolean, endpoint: string): Record<string, unknown> {\n if (!signedIn) {\n return { signedIn: false, note: \"sign-in required — `ainecto setup` (without --dry-run) opens the browser once\" };\n }\n const view: Record<string, unknown> = { signedIn: true };\n if (account?.userId) view.userId = account.userId;\n if (account?.displayName) view.name = account.displayName;\n if (account?.jobTitle !== undefined) {\n view.jobTitle = account.jobTitle ?? `not set — set it at ${profileSettingsUrl(endpoint)}`;\n }\n if (account?.projectCount !== undefined) view.projects = account.projectCount;\n if (account?.problem) view.problem = `${account.problem.kind}: ${account.problem.message}`;\n return view;\n}\n\nfunction nextSteps(account: AccountSummary | undefined, agents: ConnectionOutcome[], remote: AgentClientId[], endpoint: string): string[] {\n const next: string[] = [];\n if (agents.some((agent) => agent.status === \"connected\" || agent.status === \"updated\")) {\n next.push(\"Start a new agent session to load the AiNecto tools. Every session sees the same tools; your AiNecto permissions decide what they may change.\");\n }\n if (remote.length > 0) {\n // 원격 등록은 에이전트마다 자기 OAuth 로 한 번 로그인한다 — 이 CLI 의 로그인과 별개다.\n next.push(`Each agent signs in to AiNecto by itself the first time it connects: ${remote.map((client) => REMOTE_SIGN_IN[client]).join(\"; \")}.`);\n }\n if (account?.jobTitle === null) {\n next.push(`Set your AiNecto role (your job) at ${profileSettingsUrl(endpoint)} — AI uses it to pitch explanations; it does not change permissions.`);\n }\n next.push(\"To add AiNecto's working rules to a repository, run `ainecto init` from its root.\");\n next.push(\"`ainecto doctor` shows anything still missing.\");\n return next;\n}\n\nfunction parseSetupArgs(argv: string[]): { dryRun: boolean; undo: boolean; local: boolean } {\n const args = { dryRun: false, undo: false, local: false };\n for (const arg of argv) {\n if (arg === \"--dry-run\") {\n args.dryRun = true;\n } else if (arg === \"--local\") {\n args.local = true;\n } else if (arg === \"--undo\") {\n args.undo = true;\n } else if (arg === \"--json\") {\n // 전역 플래그.\n } else {\n throw new Error(`Unknown argument: ${arg}`);\n }\n }\n return args;\n}\n","import { profileSettingsUrl } from \"../config/endpoints\";\nimport { SERVER_NAME } from \"../harness/agentTargets\";\nimport { AGENT_CLIENT_LABELS, type AgentState } from \"./agentConnections\";\nimport type { MachineStatus } from \"./machineStatus\";\n\n/**\n * doctor 의 판정 — ★{@link MachineStatus} 만 보는 순수 함수. 항목마다 ok / warn / fail + 고칠 명령 한 줄.\n *\n * <p>고치는 길은 {@code ainecto setup}·{@code ainecto init} 재실행 둘뿐이다(설계 §4-4, 두 방식 금지) —\n * {@code --fix} 는 없다. fail 이 하나라도 있으면 doctor 는 종료 1. 직무 미설정은 warn(실패 아님).\n */\nexport type CheckLevel = \"ok\" | \"warn\" | \"fail\";\n\nexport interface DoctorCheck {\n item: string;\n level: CheckLevel;\n detail: string;\n /** 고칠 명령(또는 할 일) 한 줄. */\n fix?: string;\n}\n\nexport function doctorChecks(status: MachineStatus): DoctorCheck[] {\n const checks: DoctorCheck[] = [];\n const settings = profileSettingsUrl(status.endpoint);\n\n // ── 로그인 ──\n if (status.token.state === \"not-signed-in\") {\n checks.push({ item: \"sign-in\", level: \"fail\", detail: `not signed in to ${status.endpoint}`, fix: \"ainecto setup\" });\n } else if (status.token.state === \"refresh-failed\") {\n checks.push({ item: \"sign-in\", level: \"fail\", detail: `sign-in expired and could not be renewed (${status.token.reason})`, fix: \"ainecto setup\" });\n } else {\n checks.push({ item: \"sign-in\", level: \"ok\", detail: status.token.state === \"env\" ? \"AINECTO_TOKEN\" : \"signed in\" });\n }\n\n // ── 서버 ──\n const problem = status.account?.problem;\n if (problem?.kind === \"network\") {\n checks.push({ item: \"server\", level: \"fail\", detail: `cannot reach ${status.endpoint} (${problem.message})`, fix: \"check the network, or the --endpoint you passed\" });\n } else if (problem?.kind === \"unauthorized\") {\n checks.push({ item: \"server\", level: \"fail\", detail: `${status.endpoint} refused the sign-in (HTTP 401)`, fix: \"ainecto auth login\" });\n } else if (problem?.kind === \"forbidden\") {\n checks.push({ item: \"server\", level: \"fail\", detail: \"the account's plan does not include MCP, or the account is not active (HTTP 403)\", fix: `check your plan at ${settings}` });\n } else if (problem) {\n checks.push({ item: \"server\", level: \"fail\", detail: problem.message });\n } else if (status.account) {\n checks.push({ item: \"server\", level: \"ok\", detail: `${status.endpoint} answered; ${status.account.projectCount ?? 0} project(s) visible` });\n }\n\n // ── 에이전트 연결 ──\n for (const agent of status.agents) {\n checks.push(agentCheck(agent, status.cliVersion));\n }\n if (status.claudeHere?.entry && status.claudeHere.scope === \"local\") {\n const hereOursUpToDate = status.claudeHere.ours && !status.claudeHere.carriesRole;\n if (!hereOursUpToDate) {\n checks.push({\n item: \"Claude Code (this folder)\",\n level: \"warn\",\n detail: `a local-scope \"${SERVER_NAME}\" entry in this folder hides the user-scope connection`,\n fix: `claude mcp remove ${SERVER_NAME} -s local`,\n });\n }\n }\n\n // ── 이 저장소 ──\n const repo = status.repository;\n if (repo?.problem) {\n checks.push({ item: \"repository\", level: \"warn\", detail: repo.problem });\n } else if (repo) {\n const leftovers = [\n ...repo.mcpFiles.filter((file) => file.ours && file.carriesRole).map((file) => `${file.path} passes the removed --role`),\n ...repo.mcpFiles.filter((file) => file.ours && olderThan(file.pinnedVersion, status.cliVersion))\n .map((file) => `${file.path} pins @ainecto/mcp@${file.pinnedVersion}`),\n ...(repo.configHasProject ? [\".ainecto/config.json still has the old project field\"] : []),\n ];\n if (leftovers.length > 0) {\n checks.push({ item: \"repository\", level: \"warn\", detail: leftovers.join(\"; \"), fix: `ainecto init (in ${repo.root})` });\n } else {\n checks.push({\n item: \"repository\",\n level: \"ok\",\n detail: repo.harnessDoc\n ? `AiNecto rules are set up in ${repo.root}`\n : `no AiNecto rules in ${repo.root} (optional — \\`ainecto init\\` adds them)`,\n });\n }\n }\n\n // ── 옛 설정 잔존 ──\n for (const name of status.legacyEnv) {\n checks.push({ item: name, level: \"warn\", detail: `${name} is set; roles were removed and it is ignored`, fix: `unset ${name} (it can be deleted)` });\n }\n if (status.legacyCodexProfiles.length > 0) {\n checks.push({\n item: \"Codex role profiles\",\n level: \"warn\",\n detail: `these Codex profiles still pass --role: ${status.legacyCodexProfiles.join(\", \")}`,\n fix: \"delete them — `ainecto setup` connects Codex for every session\",\n });\n }\n if (status.globalCliVersion && olderThan(status.globalCliVersion, status.cliVersion)) {\n checks.push({\n item: \"global ainecto\",\n level: \"warn\",\n detail: `the ainecto on your PATH is ${status.globalCliVersion}, older than ${status.cliVersion}`,\n fix: \"npm i -g ainecto@latest\",\n });\n }\n\n // ── 직무 ──\n if (status.account?.jobTitle === null) {\n checks.push({ item: \"AiNecto job title\", level: \"warn\", detail: \"not set — AI uses it to pitch explanations; it does not change permissions\", fix: `set it at ${settings}` });\n } else if (typeof status.account?.jobTitle === \"string\") {\n checks.push({ item: \"AiNecto job title\", level: \"ok\", detail: status.account.jobTitle });\n }\n return checks;\n}\n\nfunction agentCheck(agent: AgentState, cliVersion: string): DoctorCheck {\n const item = AGENT_CLIENT_LABELS[agent.client];\n if (!agent.installed) {\n return { item, level: \"ok\", detail: \"not installed\" };\n }\n if (agent.problem) {\n return { item, level: \"fail\", detail: agent.problem, fix: \"ainecto setup\" };\n }\n if (!agent.entry) {\n return { item, level: \"warn\", detail: \"not connected to AiNecto\", fix: \"ainecto setup\" };\n }\n if (!agent.ours) {\n return {\n item,\n level: \"warn\",\n detail: `someone else's \"${SERVER_NAME}\" entry${agent.scope ? ` (${agent.scope})` : \"\"} — AiNecto setup leaves it alone`,\n fix: agent.client === \"claude-code\" ? `claude mcp get ${SERVER_NAME}` : \"keep it, or remove it and run `ainecto setup`\",\n };\n }\n if (agent.client === \"claude-code\" && agent.scope !== \"user\") {\n return { item, level: \"warn\", detail: `connected in the ${agent.scope} scope, not for every project`, fix: \"ainecto setup\" };\n }\n if (agent.carriesRole) {\n return { item, level: \"warn\", detail: \"connected, but still passes the removed --role\", fix: \"ainecto setup\" };\n }\n if (olderThan(agent.pinnedVersion, cliVersion)) {\n return { item, level: \"warn\", detail: `connected with @ainecto/mcp@${agent.pinnedVersion}; ${cliVersion} is available`, fix: \"ainecto setup\" };\n }\n if (\"url\" in agent.entry) {\n return { item, level: \"ok\", detail: `connected to ${agent.entry.url}` };\n }\n return { item, level: \"ok\", detail: agent.pinnedVersion ? `connected (@ainecto/mcp@${agent.pinnedVersion})` : \"connected\" };\n}\n\n/** a 가 b 보다 낮은 판인가(x.y.z 숫자 비교). 둘 중 하나라도 판이 아니면(dev 등) false — 판정하지 않는다. */\nexport function olderThan(a: string | undefined, b: string): boolean {\n const left = parseVersion(a);\n const right = parseVersion(b);\n if (!left || !right) {\n return false;\n }\n for (let at = 0; at < 3; at += 1) {\n if (left[at]! !== right[at]!) {\n return left[at]! < right[at]!;\n }\n }\n return false;\n}\n\nfunction parseVersion(value: string | undefined): [number, number, number] | undefined {\n const match = value?.match(/^(\\d+)\\.(\\d+)\\.(\\d+)/);\n return match ? [Number(match[1]), Number(match[2]), Number(match[3])] : undefined;\n}\n","import { readdir, readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport type { TokenStore } from \"../auth/tokenStore\";\nimport type { McpRpcClient } from \"../mcp/rpcClient\";\nimport { AGENT_TARGETS, entryCarriesRole, isOurEntry, pinnedBridgeVersion, readServerEntry } from \"../harness/agentTargets\";\nimport { HARNESS_CONFIG_PATH, HARNESS_DOC_PATH, DOC_KEY } from \"../harness/harnessDoc\";\nimport { LEGACY_ROLE_ENV_VAR } from \"../harness/legacyRole\";\nimport { findGitRoot, readManagedFile } from \"../harness/repositoryFiles\";\nimport { PACKAGE_NAME } from \"../version\";\nimport { readAccount, type AccountSummary } from \"./accountSummary\";\nimport { inspectAgents, inspectClaude, type AgentState } from \"./agentConnections\";\nimport type { CommandRunner } from \"./commandRunner\";\n\n/**\n * ★status 와 doctor 가 쓰는 «수집 함수 하나»(설계 §4-3·§4-4). 읽기만 한다 — 에이전트 설정·저장소 파일을\n * 바꾸지 않는다(토큰 갱신은 평소 명령과 같다: 갱신 실패 원인을 보이려면 갱신을 해 봐야 한다).\n * doctor 의 판정은 {@code doctorChecks.ts} 가 이 결과만 보고 한다(순수 함수).\n */\nexport interface MachineStatus {\n cliVersion: string;\n endpoint: string;\n env: \"prod\" | \"dev\";\n token: TokenStatus;\n /** 쓸 수 있는 토큰이 있을 때만. */\n account?: AccountSummary;\n /** 기기 전역 연결(setup 의 것). */\n agents: AgentState[];\n /** 지금 폴더에서 본 Claude Code 항목 — 이 저장소의 local 범위가 사용자 범위를 가리는지. 홈에서 돌면 없다. */\n claudeHere?: AgentState;\n repository?: RepositoryStatus;\n /** 설정돼 있는 옛 환경변수 이름. */\n legacyEnv: string[];\n /** 우리 브리지에 --role 을 싣는 Codex 프로필 파일(0.7.x 가 안내하던 것). */\n legacyCodexProfiles: string[];\n /** PATH 의 전역 `ainecto` 판. 없으면 undefined(npx 로만 쓰는 사람). */\n globalCliVersion?: string;\n}\n\nexport interface TokenStatus {\n /** env = AINECTO_TOKEN · signed-in · not-signed-in · refresh-failed */\n state: \"env\" | \"signed-in\" | \"not-signed-in\" | \"refresh-failed\";\n /** 저장된 토큰의 만료 시각(ISO). 값 자체는 내지 않는다. */\n expiresAt?: string;\n /** 갱신이 실패한 이유. */\n reason?: string;\n}\n\nexport interface RepositoryStatus {\n root: string;\n /** git 저장소가 아니면 false — 이때 root 는 지금 폴더다. */\n git: boolean;\n harnessDoc: boolean;\n /** config.json 이 기록한 HARNESS.DOC 판. */\n harnessDocVersion?: string;\n configVersion?: number;\n /** 0.7.x 가 쓰던 project 칸이 남아 있나. */\n configHasProject: boolean;\n mcpFiles: Array<{ path: string; ours: boolean; carriesRole: boolean; pinnedVersion?: string }>;\n problem?: string;\n}\n\nexport interface CollectInput {\n endpoint: string;\n env: \"prod\" | \"dev\";\n cliVersion: string;\n tokenStore: TokenStore;\n auth: { getAccessToken(): Promise<string | undefined> };\n client: McpRpcClient;\n /** 홈 폴더에서 도는 실행기(전역 연결·전역 CLI 판). */\n runner: CommandRunner;\n /** 지금 폴더에서 도는 실행기 — 이 저장소의 Claude local 범위를 볼 때. */\n hereRunner?: CommandRunner;\n home: string;\n cwd: string;\n envVars: NodeJS.ProcessEnv;\n}\n\nexport async function collectStatus(input: CollectInput): Promise<MachineStatus> {\n const token = await tokenStatus(input);\n const usable = token.state === \"env\" || token.state === \"signed-in\";\n const status: MachineStatus = {\n cliVersion: input.cliVersion,\n endpoint: input.endpoint,\n env: input.env,\n token,\n agents: await inspectAgents({ runner: input.runner, home: input.home, endpoint: input.endpoint }),\n legacyEnv: [LEGACY_ROLE_ENV_VAR, \"AI_ERD_ROLE\"].filter((name) => input.envVars[name]?.trim()),\n legacyCodexProfiles: await legacyCodexProfiles(input.envVars.CODEX_HOME ?? join(input.home, \".codex\")),\n };\n if (usable) {\n status.account = await readAccount(input.client);\n }\n if (input.hereRunner && input.cwd !== input.home) {\n status.claudeHere = await inspectClaude({ runner: input.hereRunner, home: input.home, endpoint: input.endpoint });\n }\n status.repository = await repositoryStatus(input.cwd, input.endpoint);\n const globalVersion = await globalCliVersion(input.runner);\n if (globalVersion) {\n status.globalCliVersion = globalVersion;\n }\n return status;\n}\n\nasync function tokenStatus(input: CollectInput): Promise<TokenStatus> {\n if (input.envVars.AINECTO_TOKEN) {\n return { state: \"env\" };\n }\n const stored = await input.tokenStore.load(input.endpoint);\n const expiresAt = stored?.expiresAt ? new Date(stored.expiresAt).toISOString() : undefined;\n try {\n const token = await input.auth.getAccessToken();\n if (token) {\n return { state: \"signed-in\", ...(expiresAt ? { expiresAt } : {}) };\n }\n return stored\n ? { state: \"refresh-failed\", ...(expiresAt ? { expiresAt } : {}), reason: \"the stored sign-in expired and has no refresh token\" }\n : { state: \"not-signed-in\" };\n } catch (error) {\n return {\n state: \"refresh-failed\",\n ...(expiresAt ? { expiresAt } : {}),\n reason: error instanceof Error ? error.message : String(error),\n };\n }\n}\n\nasync function repositoryStatus(cwd: string, endpoint: string): Promise<RepositoryStatus> {\n const gitRoot = await findGitRoot(cwd);\n const root = gitRoot ?? cwd;\n const status: RepositoryStatus = { root, git: gitRoot !== undefined, harnessDoc: false, configHasProject: false, mcpFiles: [] };\n try {\n status.harnessDoc = (await readManagedFile(root, HARNESS_DOC_PATH)) !== undefined;\n const config = parseObject(await readManagedFile(root, HARNESS_CONFIG_PATH));\n if (config) {\n if (typeof config.version === \"number\") status.configVersion = config.version;\n status.configHasProject = Object.prototype.hasOwnProperty.call(config, \"project\");\n const versions = config.promptVersions as Record<string, unknown> | undefined;\n if (typeof versions?.[DOC_KEY] === \"string\") status.harnessDocVersion = versions[DOC_KEY] as string;\n }\n for (const target of AGENT_TARGETS) {\n const entry = readServerEntry(await readManagedFile(root, target.path));\n if (entry !== undefined) {\n const pinnedVersion = pinnedBridgeVersion(entry);\n status.mcpFiles.push({\n path: target.path,\n ours: isOurEntry(entry, endpoint),\n carriesRole: entryCarriesRole(entry),\n ...(pinnedVersion ? { pinnedVersion } : {}),\n });\n }\n }\n } catch (error) {\n status.problem = error instanceof Error ? error.message : String(error);\n }\n return status;\n}\n\n/** `$CODEX_HOME/*.config.toml` 중 우리 브리지에 --role 을 싣는 것. 0.7.x 가 «역할마다 프로필»을 안내했다. */\nasync function legacyCodexProfiles(codexHome: string): Promise<string[]> {\n let names: string[];\n try {\n names = await readdir(codexHome);\n } catch {\n return [];\n }\n const found: string[] = [];\n for (const name of names.filter((file) => file.endsWith(\".config.toml\"))) {\n const content = await readFile(join(codexHome, name), \"utf8\").catch(() => \"\");\n if (content.includes(PACKAGE_NAME) && content.includes(\"--role\")) {\n found.push(join(codexHome, name));\n }\n }\n return found;\n}\n\n/** PATH 의 `ainecto` 판 — `ainecto --version --json`. 없거나 못 읽으면 undefined. */\nasync function globalCliVersion(runner: CommandRunner): Promise<string | undefined> {\n const result = await runner(\"ainecto\", [\"--version\", \"--json\"]);\n if (result.missing || result.exitCode !== 0) {\n return undefined;\n }\n try {\n const version = (JSON.parse(result.stdout) as { data?: { version?: unknown } }).data?.version;\n return typeof version === \"string\" ? version : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction parseObject(content: string | undefined): Record<string, unknown> | undefined {\n if (content === undefined) {\n return undefined;\n }\n try {\n const parsed = JSON.parse(content) as unknown;\n return parsed && typeof parsed === \"object\" && !Array.isArray(parsed) ? parsed as Record<string, unknown> : undefined;\n } catch {\n return undefined;\n }\n}\n","import { renderSuccess } from \"../../core/output/render\";\nimport { AGENT_CLIENT_LABELS } from \"../../core/setup/agentConnections\";\nimport { doctorChecks } from \"../../core/setup/doctorChecks\";\nimport { collectStatus, type CollectInput, type MachineStatus } from \"../../core/setup/machineStatus\";\nimport { accountView } from \"./setupCommand\";\n\nexport interface StatusCommandOptions {\n argv: string[];\n collect: CollectInput;\n json: boolean;\n io: { stdout: NodeJS.WriteStream; stderr: NodeJS.WriteStream };\n}\n\n/**\n * {@code ainecto status} — 읽기 전용 한 화면(설계 §4-3). 토큰 값·이메일은 내지 않는다.\n */\nexport async function executeStatusCommand(options: StatusCommandOptions): Promise<number> {\n assertNoArgs(\"status\", options.argv);\n const status = await collectStatus(options.collect);\n options.io.stdout.write(renderSuccess(statusView(status), { json: options.json }));\n return 0;\n}\n\n/**\n * {@code ainecto doctor} — status 와 «같은 수집»을 보고 항목마다 ok/warn/fail + 고칠 명령(설계 §4-4).\n * fail 이 하나라도 있으면 종료 1. {@code --fix} 는 없다 — 고치는 길은 setup·init 재실행이다.\n */\nexport async function executeDoctorCommand(options: StatusCommandOptions): Promise<number> {\n assertNoArgs(\"doctor\", options.argv);\n const status = await collectStatus(options.collect);\n const checks = doctorChecks(status);\n const failed = checks.filter((check) => check.level === \"fail\").length;\n const warned = checks.filter((check) => check.level === \"warn\").length;\n options.io.stdout.write(renderSuccess({\n summary: failed > 0 ? `${failed} problem(s) to fix` : warned > 0 ? `working — ${warned} suggestion(s)` : \"all good\",\n checks,\n }, { json: options.json }));\n return failed > 0 ? 1 : 0;\n}\n\nfunction statusView(status: MachineStatus): Record<string, unknown> {\n const signedIn = status.token.state === \"env\" || status.token.state === \"signed-in\";\n return {\n cli: status.cliVersion,\n endpoint: status.endpoint,\n env: status.env,\n signIn: status.token,\n account: accountView(status.account, signedIn, status.endpoint),\n agents: status.agents.map((agent) => ({\n client: AGENT_CLIENT_LABELS[agent.client],\n state: !agent.installed ? \"not installed\"\n : agent.problem ? `unknown (${agent.problem})`\n : !agent.entry ? \"not connected\"\n : agent.ours ? `connected${agent.scope ? ` (${agent.scope})` : \"\"}` : `someone else's entry${agent.scope ? ` (${agent.scope})` : \"\"}`,\n ...(agent.entry && \"url\" in agent.entry ? { url: agent.entry.url } : {}),\n ...(agent.pinnedVersion ? { bridge: `@ainecto/mcp@${agent.pinnedVersion}` } : {}),\n ...(agent.carriesRole ? { legacyRole: true } : {}),\n })),\n ...(status.claudeHere?.entry ? { claudeCodeHere: { scope: status.claudeHere.scope, ours: status.claudeHere.ours } } : {}),\n repository: status.repository,\n ...(status.globalCliVersion ? { globalAinecto: status.globalCliVersion } : {}),\n };\n}\n\nfunction assertNoArgs(command: string, argv: string[]): void {\n const unknown = argv.filter((arg) => arg !== \"--json\");\n if (unknown.length > 0) {\n throw new Error(`Unknown argument for ${command}: ${unknown[0]}`);\n }\n}\n","import { FileTokenStore } from \"../../core/auth/tokenStore\";\nimport { OAuthClient, usableAccessToken } from \"../../core/auth/oauth\";\nimport { resolveEndpoint, assertEnv, type AinectoEnv } from \"../../core/config/endpoints\";\nimport { parsePayloadSource } from \"../../core/input/payloadSource\";\nimport { McpRpcClient, isToolError } from \"../../core/mcp/rpcClient\";\nimport { renderError, renderSuccess } from \"../../core/output/render\";\nimport { getGeneratedTools, loadLiveTools } from \"../../core/catalog\";\nimport type { GeneratedToolDefinition } from \"../../core/catalog/types\";\nimport { runConnector } from \"../mcp/connector\";\nimport { executeGeneratedCommand, matchGeneratedCommand } from \"./generatedCommandRouter\";\nimport { executeAttachmentsUploadCommand, isAttachmentsUploadCommand } from \"./attachmentsUploadCommand\";\nimport { executeInboxPollCommand, isInboxPollCommand } from \"./inboxPollCommands\";\nimport { executeInitCommand } from \"./initCommand\";\nimport { executeSetupCommand } from \"./setupCommand\";\nimport { executeDoctorCommand, executeStatusCommand } from \"./statusCommand\";\nimport { systemCommandRunner } from \"../../core/setup/commandRunner\";\nimport { homedir } from \"node:os\";\nimport { CLI_VERSION, PACKAGE_NAME } from \"../../core/version\";\nimport { LEGACY_ROLE_NOTICE, legacyRoleInput } from \"../../core/harness/legacyRole\";\n\nexport interface CliIO {\n stdout: NodeJS.WriteStream;\n stderr: NodeJS.WriteStream;\n stdin: NodeJS.ReadStream;\n}\n\nexport async function runAinectoCli(argv: string[], io: CliIO): Promise<number> {\n let parsed: GlobalArgs = { json: argv.includes(\"--json\"), help: false, version: false, positionals: [] };\n try {\n parsed = parseGlobalArgs(argv);\n // ★에이전트는 설치 직후 버전부터 확인한다 — «Unknown command»로 답하면 도움말까지 못 간다(2026-09-29, Codex).\n if (parsed.version || parsed.positionals[0] === \"version\") {\n io.stdout.write(renderSuccess({ version: CLI_VERSION }, { json: parsed.json }));\n return 0;\n }\n if (parsed.help || parsed.positionals.length === 0) {\n io.stdout.write(helpText());\n return 0;\n }\n\n const resolved = resolveEndpoint({ env: parsed.env, endpoint: parsed.endpoint });\n const [domain, action, ...rest] = parsed.positionals;\n // ★옛 --role / AINECTO_ROLE — 세션 역할은 없어졌다(0.8.0). 값을 검사하지 않고 받아 안내 한 줄을\n // 남기고, 원격 요청에 기록용 헤더로만 싣는다(legacyRole.ts). 브리지는 connector 가 같은 일을 한다.\n const legacyRole = legacyRoleInput(parsed.legacyRole);\n if (legacyRole !== undefined && domain !== \"mcp\") {\n // --json 이면 stderr 도 JSON 한 줄이다(login_url 과 같은 규칙).\n io.stderr.write(parsed.json\n ? `${JSON.stringify({ event: \"legacy_role_ignored\", message: LEGACY_ROLE_NOTICE })}\\n`\n : `${LEGACY_ROLE_NOTICE}\\n`);\n }\n const tokenStore = new FileTokenStore();\n /** 인증·RPC 클라이언트. ★토큰은 서버마다 한 칸이다. */\n const connect = () => {\n const auth = new OAuthClient({\n endpoint: resolved.endpoint,\n tokenStore,\n // ★init·setup --dry-run 은 토큰을 갱신하지도 않는다 — 「아무것도 바꾸지 않는다」에 로그인 상태도 든다.\n // (하위 명령의 플래그는 positional 로 흘러온다.)\n readOnly: (domain === \"init\" || domain === \"setup\") && parsed.positionals.includes(\"--dry-run\"),\n // ★URL 을 «브라우저를 열기 전에» 알린다. stdout 은 결과 전용이라 stderr 에 쓴다.\n // --json 이면 JSON 한 줄이다(설계 §21-3 (가)). 로그인이 역할과 무관해져 role 칸은 없다(0.4.2 §2-5).\n onAuthorizeUrl: (url) => {\n io.stderr.write(parsed.json\n ? `${JSON.stringify({ event: \"login_url\", url })}\\n`\n : `Opening your browser to sign in to AiNecto. If it does not open, visit:\\n ${url}\\n`);\n },\n });\n // 직접 명령 — 채널 cli. 에이전트 이름은 싣지 않는다(셸을 누가 돌렸는지 모른다 → 서버는 unknown).\n const client = new McpRpcClient({ endpoint: resolved.endpoint, tokenProvider: auth, legacyRole, channel: \"cli\" });\n return { auth, client };\n };\n\n if (domain === \"mcp\") {\n await runConnector({\n endpoint: resolved.endpoint,\n legacyRoleFlag: parsed.legacyRole,\n input: io.stdin,\n output: io.stdout,\n errorOutput: io.stderr,\n });\n return 0;\n }\n\n if (domain === \"init\") {\n // ⚠init 의 플래그는 전역 파서가 positional 로 흘려보낸다. 그대로 넘긴다.\n const { auth } = connect();\n return await executeInitCommand({\n argv: parsed.positionals.slice(1),\n // 문서는 인증 후에 받는다 — 토큰이 없으면 패키지 기본값으로 가고, 그 사실을 보고한다.\n // ★«필요할 때» 가져온다. --undo 는 로컬 작업이라 토큰을 건드리지 않는다(S1).\n // ★판정은 setup 과 같은 {@link usableAccessToken} 하나 — 서버가 저장 로그인을 거절했으면 «없음»(→ 로그인),\n // 네트워크 장애·AINECTO_TOKEN 을 못 쓰는 주소라는 거절은 삼키지 않는다(브라우저 로그인으로 둔갑하지 않게).\n accessToken: () => usableAccessToken(auth),\n // 로그인한다 — `ainecto auth login` 과 같은 함수다. 서버마다 한 번이다.\n login: async () => {\n await auth.login();\n },\n endpoint: resolved.endpoint,\n env: resolved.env,\n cliVersion: `${PACKAGE_NAME} ${CLI_VERSION}`,\n cwd: process.cwd(),\n json: parsed.json,\n io,\n });\n }\n\n if (domain === \"setup\") {\n const { auth, client } = connect();\n return await executeSetupCommand({\n argv: parsed.positionals.slice(1),\n endpoint: resolved.endpoint,\n env: resolved.env,\n auth,\n client,\n // ★외부 CLI 는 홈 폴더에서 돈다 — 지금 저장소의 local·project 범위 항목이 사용자 범위 판정에 끼지 않게.\n runner: systemCommandRunner({ cwd: homedir() }),\n home: homedir(),\n json: parsed.json,\n io,\n });\n }\n\n if (domain === \"status\" || domain === \"doctor\") {\n const { auth, client } = connect();\n const run = domain === \"status\" ? executeStatusCommand : executeDoctorCommand;\n return await run({\n argv: parsed.positionals.slice(1),\n collect: {\n endpoint: resolved.endpoint,\n env: resolved.env,\n cliVersion: CLI_VERSION,\n tokenStore,\n auth,\n client,\n runner: systemCommandRunner({ cwd: homedir() }),\n hereRunner: systemCommandRunner({ cwd: process.cwd() }),\n home: homedir(),\n cwd: process.cwd(),\n envVars: process.env,\n },\n json: parsed.json,\n io,\n });\n }\n\n if (domain === \"auth\") {\n // ★await 를 빼면 이 try 가 실패를 «못 본다» — 거부 사유가 renderError 를 지나치고\n // 날것의 스택 트레이스로 나간다(2026-09-23 실물 실행에서 발견).\n return await handleAuth(action, connect().auth, resolved.endpoint, parsed.json, io);\n }\n\n const env = parsed.env ?? \"prod\";\n // ★카탈로그는 서버의 지금 목록이다. 못 받으면 스냅샷으로 답한다.\n if (domain === \"tools\" && action === \"catalog\") {\n return await printCatalog(parsed, io, resolved.endpoint, async () => connect().client);\n }\n // 스냅샷에 없는 명령은 서버의 지금 목록에서 찾는다 — 서버에 새로 열린 도구를 CLI 재배포 없이 쓴다.\n let routeTools: readonly GeneratedToolDefinition[] = getGeneratedTools(env);\n let remote = isAttachmentsUploadCommand(domain, action)\n || isInboxPollCommand(domain, action)\n || (domain === \"tools\" && (action === \"list\" || action === \"call\"))\n || matchGeneratedCommand(routeTools, parsed.positionals) !== undefined;\n if (!remote) {\n const live = await loadLiveTools(env, connect().client).catch(() => undefined);\n if (live && matchGeneratedCommand(live, parsed.positionals)) {\n routeTools = live;\n remote = true;\n }\n }\n if (!remote) {\n throw new Error(domain === \"tools\"\n ? \"Expected tools list, tools call <mcpName>, or tools catalog.\"\n : `Unknown command \"${domain}\".`);\n }\n\n // ★세션 역할은 없다 — 무엇을 할 수 있는지는 서버가 사용자 권한으로 정한다.\n const { client } = connect();\n\n if (isAttachmentsUploadCommand(domain, action)) {\n return await executeAttachmentsUploadCommand({\n argv: rest,\n client,\n json: parsed.json,\n io,\n });\n }\n\n if (isInboxPollCommand(domain, action)) {\n return await executeInboxPollCommand({ domain, action, argv: rest, client, json: parsed.json, io });\n }\n\n const generatedResult = await executeGeneratedCommand({\n tools: routeTools,\n argv: parsed.positionals,\n client,\n json: parsed.json,\n io,\n });\n if (generatedResult !== 2) {\n return generatedResult;\n }\n\n if (domain === \"tools\") {\n // ★위와 같은 이유로 await 가 필요하다. 이쪽이 실제로 스택을 뱉고 있었다.\n return await handleTools(action, rest, parsed, client, io);\n }\n\n throw new Error(`Unknown command \"${domain}\".`);\n } catch (error) {\n io.stderr.write(renderError(error, { json: parsed.json }));\n return 1;\n }\n}\n\nasync function handleAuth(\n action: string | undefined,\n auth: OAuthClient,\n endpoint: string,\n json: boolean,\n io: CliIO,\n): Promise<number> {\n if (action === \"login\") {\n await auth.login();\n io.stdout.write(renderSuccess({ ...await nextStep(), endpoint, authenticated: true }, { json }));\n return 0;\n }\n if (action === \"status\") {\n const token = await auth.getAccessToken();\n io.stdout.write(renderSuccess({ ...await nextStep(), endpoint, authenticated: Boolean(token) }, { json }));\n return 0;\n }\n if (action === \"logout\") {\n await auth.logout();\n io.stdout.write(renderSuccess({ endpoint, authenticated: false }, { json }));\n return 0;\n }\n throw new Error(\"Expected auth login, auth status, or auth logout.\");\n}\n\n/**\n * `tools catalog` — ★서버의 지금 목록을 먼저 보여 준다. 스냅샷만 보여 주면 서버에 열린 새 문서 유형(html)을\n * 에이전트가 «CLI 에 없다»고 읽었다(2026-10-10). 못 받으면(로그인 전·오프라인·깨진 저장소) 스냅샷으로\n * 답하되 «낡았을 수 있다»와 그 이유를 같이 싣는다 — 조용히 대체하지 않는다.\n */\nasync function printCatalog(\n parsed: GlobalArgs,\n io: CliIO,\n endpoint: string,\n liveClient: () => Promise<McpRpcClient>,\n): Promise<number> {\n const catalogEnv = parsed.env ?? \"prod\";\n try {\n const tools = await loadLiveTools(catalogEnv, await liveClient());\n io.stdout.write(renderSuccess(tools, { json: parsed.json }));\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n io.stdout.write(renderSuccess(getGeneratedTools(catalogEnv), {\n json: parsed.json,\n warnings: [`Could not read the live tool list from ${endpoint} (${reason}). `\n + `Showing the ${catalogEnv} catalog checked in when this CLI version was built — a snapshot of that `\n + \"server's tools/list that may miss newer document types and tools. Run `ainecto auth login`, then retry.\"],\n }));\n }\n return 0;\n}\n\nasync function handleTools(\n action: string | undefined,\n rest: string[],\n parsed: GlobalArgs,\n client: McpRpcClient,\n io: CliIO,\n): Promise<number> {\n if (action === \"list\") {\n const tools = await client.toolsList();\n io.stdout.write(renderSuccess(tools, { json: parsed.json }));\n return 0;\n }\n\n if (action === \"call\") {\n const toolName = rest[0];\n if (!toolName) {\n throw new Error(\"Expected MCP tool name after tools call.\");\n }\n const toolArgs = rest.slice(1);\n const payloadOptions = parsePayloadArgs(toolArgs);\n const payload = await parsePayloadSource({\n file: payloadOptions.file,\n inline: payloadOptions.inline,\n stdin: io.stdin,\n });\n const result = await client.toolsCall(toolName, payload.value);\n io.stdout.write(renderSuccess(result, { json: parsed.json, warnings: payload.warnings }));\n // 거부 문구는 그대로 보여 주되, 종료 코드로는 «실패»라고 말한다.\n return isToolError(result) ? 1 : 0;\n }\n\n throw new Error(\"Expected tools list, tools call <mcpName>, or tools catalog.\");\n}\n\ninterface GlobalArgs {\n env?: AinectoEnv;\n endpoint?: string;\n /** 옛 --role — 검사하지 않는다(legacyRole.ts). */\n legacyRole?: string;\n json: boolean;\n help: boolean;\n version: boolean;\n positionals: string[];\n}\n\nfunction parseGlobalArgs(argv: string[]): GlobalArgs {\n const result: GlobalArgs = { json: false, help: false, version: false, positionals: [] };\n for (let index = 0; index < argv.length; index += 1) {\n const arg = argv[index];\n if (!arg) {\n continue;\n }\n if (arg === \"--env\") {\n result.env = assertEnv(requireValue(arg, argv[++index]));\n } else if (arg === \"--endpoint\") {\n result.endpoint = requireValue(arg, argv[++index]);\n } else if (arg === \"--role\") {\n // ★옛 전역 플래그 — 값을 검사하지 않고 받는다(legacyRole.ts). 값 없이 끝나도 멈추지 않는다.\n const value = argv[index + 1];\n if (value !== undefined && !value.startsWith(\"--\")) {\n result.legacyRole = value;\n index += 1;\n }\n } else if (arg === \"--json\") {\n result.json = true;\n } else if (arg === \"--help\" || arg === \"-h\") {\n result.help = true;\n } else if (arg === \"--version\" || arg === \"-v\" || arg === \"-V\") {\n result.version = true;\n } else {\n result.positionals.push(arg);\n }\n }\n return result;\n}\n\nfunction parsePayloadArgs(argv: string[]): { file?: string; inline?: string } {\n const result: { file?: string; inline?: string } = {};\n const inline: string[] = [];\n for (let index = 0; index < argv.length; index += 1) {\n const arg = argv[index];\n if (!arg) {\n continue;\n }\n if (arg === \"--file\" || arg === \"-f\") {\n result.file = requireValue(arg, argv[++index]);\n } else {\n inline.push(arg);\n }\n }\n if (inline.length > 0) {\n result.inline = inline.join(\" \");\n }\n return result;\n}\n\nfunction requireValue(flag: string, value: string | undefined): string {\n if (!value || value.startsWith(\"--\")) {\n throw new Error(`${flag} requires a value.`);\n }\n return value;\n}\n\n/**\n * ★로그인은 설치의 끝이 아니다. 에이전트가 `auth status --json` 의 authenticated:true 를 보고 «설치 완료»로\n * 닫은 실측(2026-09-29, Codex)이 있다. 그래서 auth 결과에 다음 단계를 싣는다 — --json 에도.\n * 무엇이 남았는지는 `doctor` 한 곳이 판정한다(여기서 따로 판정하지 않는다).\n */\nasync function nextStep(): Promise<{ next: string }> {\n return { next: NEXT_STEP };\n}\n\n/** 설치·로그인 뒤 «다음에 할 일». 도움말과 auth 결과가 같은 문장을 쓴다. */\n// ★«참고»로 읽히면 넘긴다 — Codex 가 `next` 를 받고도 «업데이트 완료»만 말했다(2026-09-30 실측).\n// 그래서 «사용자가 설치·업데이트·로그인만 부탁했어도 지금 알려라»를 지시문으로 적는다.\nconst NEXT_STEP = [\n \"Connect your coding agents to AiNecto once per machine: `npx -y ainecto@latest setup`.\",\n \"AI agents: tell the user this now, even if they only asked to install, update, or sign in.\",\n \"To add AiNecto's working rules to a repository, run `npx -y ainecto@latest init` from its root.\",\n \"`npx -y ainecto@latest doctor` shows what is still missing and the command that fixes it.\",\n].join(\"\\n\");\n\nfunction helpText(): string {\n return [\n \"AiNecto CLI\",\n \"\",\n NEXT_STEP,\n \"\",\n \"Usage:\",\n \" ainecto auth login|status|logout [--env prod|dev] [--json] (one sign-in per machine)\",\n \" ainecto tools list [--env prod|dev] [--endpoint URL] [--json]\",\n \" ainecto tools call <mcpName> [-f payload.json|@-] [inline-json] [--json]\",\n \" ainecto attachments upload --document-uuid <uuid> <file...> [--json]\",\n \" ainecto notifications poll --cursor-file <path> [--kinds A,B] [--workspace <uuid>]... [--project <uuid>]... [--direct-only] [--limit N] [--json]\",\n \" ainecto notifications ack --cursor-file <path> (after the agent handled the polled batch)\",\n \" ainecto agent-todos poll [--workspace <uuid>]... [--project <uuid>]... [--only-new --seen-file <path>] [--json]\",\n \" --workspace and --project may repeat: any of the given workspaces AND any of the given projects\",\n \" poll exit codes: 0 new items · 3 nothing new · 1 error · 2 usage error\",\n \" ainecto <generated-command> [flags] [-f payload.json] [--yes] [--json]\",\n \" ainecto mcp [--env prod|dev] [--endpoint URL]\",\n \"\",\n \"Setup (once per machine):\",\n \" ainecto setup [--env prod|dev] [--endpoint URL] [--dry-run] [--json] sign in and connect Claude Code, Cursor, and Codex to the server address\",\n \" ainecto setup --local connect through the local relay (npx -y @ainecto/mcp) instead\",\n \" ainecto setup --undo remove those connections (sign-in stays)\",\n \" ainecto status [--json] who is signed in, and what is connected (read-only)\",\n \" ainecto doctor [--json] status + what is missing and the command that fixes it\",\n \"\",\n \"Harness:\",\n \" ainecto init [--mcp] [--local] [--dry-run] [--json] AiNecto rules for this repository (--mcp also writes .mcp.json and .cursor/mcp.json with the server address; --local writes the local relay instead)\",\n \" ainecto init --undo\",\n \"\",\n ].join(\"\\n\");\n}\n","#!/usr/bin/env node\nimport { runAinectoCli } from \"../adapters/cli/ainectoCli\";\n\nconst exitCode = await runAinectoCli(process.argv.slice(2), {\n stdin: process.stdin,\n stdout: process.stdout,\n stderr: process.stderr,\n});\n\nprocess.exitCode = exitCode;\n"],"mappings":";;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,OAAO,UAAU,QAAQ,IAAI,MAAM,WAAW,aAAa;AACpE,SAAS,eAAe;AACxB,SAAS,SAAS,YAAY;AA2BvB,IAAM,iBAAN,MAA2C;AAAA,EACvC;AAAA,EAET,YAAY,UAAU,KAAK,QAAQ,GAAG,UAAU,GAAG;AACjD,SAAK,WAAW,KAAK,SAAS,aAAa;AAAA,EAC7C;AAAA,EAEA,MAAM,KAAK,UAAuD;AAChE,UAAM,OAAO,MAAM,KAAK,SAAS;AACjC,WAAO,KAAK,SAAS,QAAQ,CAAC;AAAA,EAChC;AAAA,EAEA,MAAM,KAAK,UAAkB,OAAsC;AACjE,UAAM,OAAO,MAAM,KAAK,SAAS;AACjC,SAAK,SAAS,QAAQ,CAAC,IAAI,EAAE,G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C/C,OAAO;AACL,aAAO,KAAK,GAAG;AAAA,IACjB;AAAA,EACF;AACA,MAAI,OAAO,SAAS,GAAG;AACrB,WAAO,SAAS,OAAO,KAAK,GAAG;AAAA,EACjC;AACA,SAAO;AACT;AAEA,SAASA,cAAa,MAAc,OAAmC;AACrE,MAAI,CAAC,SAAS,MAAM,WAAW,IAAI,GAAG;AACpC,UAAM,IAAI,MAAM,GAAG,IAAI,oBAAoB;AAAA,EAC7C;AACA,SAAO;AACT;AAOA,eAAe,WAAsC;AACnD,SAAO,EAAE,MAAM,UAAU;AAC3B;AAKA,IAAM,YAAY;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAEX,SAAS,WAAmB;AAC1B,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,KAAK,IAAI;AACb;;;ACjaA,IAAM,WAAW,MAAM,cAAc,QAAQ,KAAK,MAAM,CAAC,GAAG;AAAA,EAC1D,OAAO,QAAQ;AAAA,EACf,QAAQ,QAAQ;AAAA,EAChB,QAAQ,QAAQ;AAClB,CAAC;AAED,QAAQ,WAAW;","names":["createHash","createHash","resolve","readFile","isRecord","generatedTools","createHash","isRecord","isRecord","generatedTools","isRecord","isRecord","isRecord","createInterface","createInterface","readFile","stat","isRecord","stat","readFile","isRecord","requireValue","mkdir","readFile","rename","dirname","isRecord","readFile","mkdir","dirname","rename","chmod","mkdir","rename","rm","stat","writeFile","dirname","join","resolve","sep","basename","isRecord","basename","open","hit","stableStringify","createHash","stableStringify","readFile","dirname","join","isNodeError","resolve","plan","isRecord","rm","join","dirname","mkdir","writeFile","chmod","rename","sep","stat","chmod","mkdir","readFile","rename","stat","writeFile","dirname","join","spawn","resolve","join","readFile","isNodeError","readIfExists","mkdir","dirname","stat","writeFile","chmod","rename","agents","failed","readFile","join","join","readFile","homedir","client","homedir","requireValue"]}