agents-inc 0.170.1 → 0.170.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/{chunk-BMRUNMPV.js → chunk-2YA4DDRM.js} +35 -35
- package/dist/chunk-2YA4DDRM.js.map +1 -0
- package/dist/{chunk-44TE3RKH.js → chunk-3ED3KHHD.js} +5 -4
- package/dist/chunk-3ED3KHHD.js.map +1 -0
- package/dist/{chunk-3G7X2WKI.js → chunk-5BNX73OU.js} +18 -38
- package/dist/chunk-5BNX73OU.js.map +1 -0
- package/dist/{chunk-7RDMTR64.js → chunk-66AEVERM.js} +785 -256
- package/dist/chunk-66AEVERM.js.map +1 -0
- package/dist/{chunk-PJWGTNOX.js → chunk-7C3PFRBU.js} +144 -186
- package/dist/chunk-7C3PFRBU.js.map +1 -0
- package/dist/{chunk-52HDHJ7I.js → chunk-AUNRHWH4.js} +32 -21
- package/dist/chunk-AUNRHWH4.js.map +1 -0
- package/dist/{chunk-KOLDW6SF.js → chunk-BBDGYJHX.js} +2 -2
- package/dist/chunk-BBDGYJHX.js.map +1 -0
- package/dist/{chunk-SZYQISA2.js → chunk-ELV5WDS3.js} +43 -29
- package/dist/chunk-ELV5WDS3.js.map +1 -0
- package/dist/{chunk-MQ6CGZNJ.js → chunk-GAKVZNTX.js} +1879 -2019
- package/dist/chunk-GAKVZNTX.js.map +1 -0
- package/dist/chunk-GEMW5RQ2.js +1169 -0
- package/dist/chunk-GEMW5RQ2.js.map +1 -0
- package/dist/{chunk-NQW25DCF.js → chunk-GHHJYNAN.js} +1 -7
- package/dist/chunk-GHHJYNAN.js.map +1 -0
- package/dist/{chunk-WTWMGH2C.js → chunk-HACRR422.js} +2 -2
- package/dist/chunk-HACRR422.js.map +1 -0
- package/dist/{chunk-F2BHT5C4.js → chunk-IWY5IR4F.js} +129 -151
- package/dist/chunk-IWY5IR4F.js.map +1 -0
- package/dist/{chunk-JFLVEFFP.js → chunk-KIK5EZYD.js} +1 -1
- package/dist/chunk-KIK5EZYD.js.map +1 -0
- package/dist/{chunk-USVBYQSQ.js → chunk-O4LN3HFI.js} +16 -6
- package/dist/chunk-O4LN3HFI.js.map +1 -0
- package/dist/{chunk-RIPSGNLU.js → chunk-OCAVW6N5.js} +3 -3
- package/dist/chunk-OCAVW6N5.js.map +1 -0
- package/dist/{chunk-4AAOOAIN.js → chunk-P6CYS4JK.js} +2 -2
- package/dist/chunk-P6CYS4JK.js.map +1 -0
- package/dist/chunk-PLFANHRZ.js +35 -0
- package/dist/chunk-PLFANHRZ.js.map +1 -0
- package/dist/{chunk-6ZRH5RHC.js → chunk-PMUZR4XO.js} +4 -4
- package/dist/chunk-PMUZR4XO.js.map +1 -0
- package/dist/{chunk-F5EBEATU.js → chunk-PSUTNOQ2.js} +34 -46
- package/dist/chunk-PSUTNOQ2.js.map +1 -0
- package/dist/chunk-RIK45Q4I.js +103 -0
- package/dist/chunk-RIK45Q4I.js.map +1 -0
- package/dist/{chunk-HED2DAXZ.js → chunk-THO7LO5B.js} +5 -5
- package/dist/chunk-THO7LO5B.js.map +1 -0
- package/dist/{chunk-OYJQUA3D.js → chunk-YGDWHDOY.js} +31 -13
- package/dist/chunk-YGDWHDOY.js.map +1 -0
- package/dist/{chunk-NCWDK6L7.js → chunk-YXKTY5WM.js} +254 -379
- package/dist/chunk-YXKTY5WM.js.map +1 -0
- package/dist/{chunk-NEZ4OAOL.js → chunk-ZEGM3MVR.js} +3 -5
- package/dist/chunk-ZEGM3MVR.js.map +1 -0
- package/dist/commands/build/marketplace.js +46 -46
- package/dist/commands/build/marketplace.js.map +1 -1
- package/dist/commands/build/plugins.js +25 -28
- package/dist/commands/build/plugins.js.map +1 -1
- package/dist/commands/compile.js +87 -178
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/doctor.js +510 -360
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +451 -357
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +144 -125
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/init.js +20 -27
- package/dist/commands/list.js +39 -55
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/marketplace.js +6 -11
- package/dist/commands/new/marketplace.js.map +1 -1
- package/dist/commands/search.js +35 -32
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/share.js +17 -77
- package/dist/commands/share.js.map +1 -1
- package/dist/commands/uninstall.js +159 -222
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +9 -32
- package/dist/commands/update.js.map +1 -1
- package/dist/components/common/prompt-confirm.js +2 -2
- package/dist/components/common/removal-plan-confirm.js +2 -2
- package/dist/components/common/scroll-affordance.js +2 -2
- package/dist/components/common/select-list.js +2 -2
- package/dist/components/common/skill-agent-summary.js +4 -4
- package/dist/components/common/spinner.js +2 -4
- package/dist/components/common/summary-panel.js +5 -5
- package/dist/components/common/summary-panel.js.map +1 -1
- package/dist/config-exports.js +7 -3
- package/dist/config-exports.js.map +1 -1
- package/dist/hooks/init.js +18 -19
- package/dist/hooks/init.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/load-agent-defs-6QUUMGHK.js +14 -0
- package/dist/recompile-project-agents-I33KQJFB.js +65 -0
- package/dist/recompile-project-agents-I33KQJFB.js.map +1 -0
- package/dist/{source-loader-C5SQXZXI.js → source-loader-TTJVW2ER.js} +5 -5
- package/dist/src/agents/developer/ai-developer/playbook.md +2 -5
- package/dist/src/agents/developer/api-developer/playbook.md +2 -5
- package/dist/src/agents/developer/cli-developer/playbook.md +2 -5
- package/dist/src/agents/developer/web-developer/playbook.md +2 -5
- package/dist/src/agents/meta/agent-summoner/output.md +2 -2
- package/dist/src/agents/meta/agent-summoner/playbook.md +1 -13
- package/dist/src/agents/meta/codex-keeper/critical-requirements.md +2 -5
- package/dist/src/agents/meta/convention-keeper/critical-requirements.md +2 -4
- package/dist/src/agents/tester/ai-tester/critical-requirements.md +1 -2
- package/dist/src/agents/tester/ai-tester/playbook.md +2 -0
- package/dist/src/agents/tester/api-tester/critical-requirements.md +1 -2
- package/dist/src/agents/tester/api-tester/playbook.md +2 -0
- package/dist/src/agents/tester/cli-tester/critical-requirements.md +1 -2
- package/dist/src/agents/tester/cli-tester/playbook.md +2 -0
- package/dist/src/agents/tester/web-tester/critical-requirements.md +1 -2
- package/dist/src/agents/tester/web-tester/playbook.md +2 -0
- package/package.json +9 -8
- package/src/agents/developer/ai-developer/playbook.md +2 -5
- package/src/agents/developer/api-developer/playbook.md +2 -5
- package/src/agents/developer/cli-developer/playbook.md +2 -5
- package/src/agents/developer/web-developer/playbook.md +2 -5
- package/src/agents/meta/agent-summoner/output.md +2 -2
- package/src/agents/meta/agent-summoner/playbook.md +1 -13
- package/src/agents/meta/codex-keeper/critical-requirements.md +2 -5
- package/src/agents/meta/convention-keeper/critical-requirements.md +2 -4
- package/src/agents/tester/ai-tester/critical-requirements.md +1 -2
- package/src/agents/tester/ai-tester/playbook.md +2 -0
- package/src/agents/tester/api-tester/critical-requirements.md +1 -2
- package/src/agents/tester/api-tester/playbook.md +2 -0
- package/src/agents/tester/cli-tester/critical-requirements.md +1 -2
- package/src/agents/tester/cli-tester/playbook.md +2 -0
- package/src/agents/tester/web-tester/critical-requirements.md +1 -2
- package/src/agents/tester/web-tester/playbook.md +2 -0
- package/src/schemas/project-config.schema.json +0 -3
- package/src/schemas/project-source-config.schema.json +0 -6
- package/dist/chunk-3G7X2WKI.js.map +0 -1
- package/dist/chunk-44TE3RKH.js.map +0 -1
- package/dist/chunk-4AAOOAIN.js.map +0 -1
- package/dist/chunk-52HDHJ7I.js.map +0 -1
- package/dist/chunk-6HNXYYVF.js +0 -373
- package/dist/chunk-6HNXYYVF.js.map +0 -1
- package/dist/chunk-6ZRH5RHC.js.map +0 -1
- package/dist/chunk-7RDMTR64.js.map +0 -1
- package/dist/chunk-BMRUNMPV.js.map +0 -1
- package/dist/chunk-CLPUWOSA.js +0 -46
- package/dist/chunk-CLPUWOSA.js.map +0 -1
- package/dist/chunk-F2BHT5C4.js.map +0 -1
- package/dist/chunk-F5EBEATU.js.map +0 -1
- package/dist/chunk-HED2DAXZ.js.map +0 -1
- package/dist/chunk-JFLVEFFP.js.map +0 -1
- package/dist/chunk-KOLDW6SF.js.map +0 -1
- package/dist/chunk-MQ6CGZNJ.js.map +0 -1
- package/dist/chunk-NCWDK6L7.js.map +0 -1
- package/dist/chunk-NEZ4OAOL.js.map +0 -1
- package/dist/chunk-NIHUOWE4.js +0 -106
- package/dist/chunk-NIHUOWE4.js.map +0 -1
- package/dist/chunk-NQW25DCF.js.map +0 -1
- package/dist/chunk-OYJQUA3D.js.map +0 -1
- package/dist/chunk-PJWGTNOX.js.map +0 -1
- package/dist/chunk-RIPSGNLU.js.map +0 -1
- package/dist/chunk-SZYQISA2.js.map +0 -1
- package/dist/chunk-USVBYQSQ.js.map +0 -1
- package/dist/chunk-V3KTSP3Q.js +0 -940
- package/dist/chunk-V3KTSP3Q.js.map +0 -1
- package/dist/chunk-WTWMGH2C.js.map +0 -1
- package/dist/load-agent-defs-YMDWBFDP.js +0 -14
- package/dist/recompile-project-agents-SZ76WNTW.js +0 -18
- package/dist/source-loader-C5SQXZXI.js.map +0 -1
- /package/dist/{load-agent-defs-YMDWBFDP.js.map → load-agent-defs-6QUUMGHK.js.map} +0 -0
- /package/dist/{recompile-project-agents-SZ76WNTW.js.map → source-loader-TTJVW2ER.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/lib/hosts/claude-project-trust.ts","../src/cli/lib/hosts/codex-project-trust.ts","../src/cli/lib/hosts/codex-compile-notices.ts","../src/cli/lib/hosts/host-compile-notices.ts"],"sourcesContent":["import path from \"path\";\nimport { realpath } from \"fs/promises\";\n\nimport { z } from \"zod\";\n\nimport { agentCodec, agentsDir, claudeStateFile } from \"../installation/install-layout.js\";\nimport { isHomeDirectory } from \"../installation/is-home-directory.js\";\nimport { fileExists, glob, readFile, readFileOptional } from \"../../utils/fs.js\";\nimport type { Provider } from \"../../consts.js\";\n\n/**\n * Whether Claude Code will run the completion gate a PROJECT installation just compiled — and the\n * line that says so when it will not.\n *\n * **Every writing sub-agent carries one.** Compile gives each sub-agent holding `Write` or `Edit` a\n * `Stop` hook that runs the project's typecheck (`withCompletionGate` in `@workspace/compile`'s\n * `agent-source.ts`), unless the sub-agent declares a `Stop` or `SubagentStop` hook of its own,\n * which is then its completion gate instead. Either way it is one frontmatter line: `hooks:` and a\n * JSON record holding at least one hook under that event — a key holding an empty list states no\n * gate, which is how compile's `declaresOwnGate` reads it too.\n *\n * **A project sub-agent's hooks run only in a folder the user has trusted.** Read from the shipped\n * binary 2.1.288 and watched under a scratch HOME on 2026-10-03:\n *\n * - **The record.** Claude Code keeps the answer in `~/.claude.json` as\n * `projects[<key>].hasTrustDialogAccepted`, where the key is the folder's git repository root —\n * the main checkout's root for a linked worktree — or the folder itself outside any repository.\n * Accepting the prompt writes that key, and the hook gate for `<project>/.claude/agents/` reads\n * it, exactly. Absent or `false`, the sub-agent loads, its prompt loads, and its completion gate\n * is dropped, logged only to Claude Code's own diagnostics.\n * - **The prompt.** Claude Code skips it when any folder from this one up to its repository root —\n * or up to `/` outside one — is recorded as trusted. So below a trusted plain folder it never\n * asks, while the gate still reads the folder's own key and keeps the hooks off.\n *\n * **So the install says it, and only while it is true.** Owner, 2026-09-26: _\"yes ofc\"_ to telling\n * the user. It is the Claude sibling of `codex-project-trust.ts`, and it READS the host's state and\n * never writes it — accepting the dialog is the user's act. A global installation needs nothing:\n * Claude Code trusts `~/.claude/agents/` unconditionally, and that folder is also the project\n * agents directory of a run from the home directory, so such a run says nothing either.\n */\n\n/** The part of `~/.claude.json` this reads. Every other project's record is left unparsed. */\nconst claudeStateSchema = z.object({ projects: z.record(z.string(), z.unknown()) });\n\n/** One project's record, answering only the question asked of it. */\nconst trustedProjectSchema = z.object({ hasTrustDialogAccepted: z.literal(true) });\n\n/**\n * The frontmatter line a completion gate is written on: `hooks:` with `Stop` or `SubagentStop` as a\n * key holding at least one definition. A line naming only other events is a hook, and nothing this\n * notice is about; an empty list under the key states no gate. The template writes the record\n * through Liquid's `json` filter, compact, which is why the key and its first `{` are adjacent.\n */\nconst STOP_HOOK_LINE = /^hooks:\\s*\\{.*\"(Stop|SubagentStop)\":\\[\\{/m;\nconst FRONTMATTER_FENCE = \"---\";\n\n/** The entry whose presence makes a folder a repository root, and a linked worktree's pointer. */\nconst GIT_ENTRY = \".git\";\nconst GITDIR_PREFIX = \"gitdir:\";\n/** What a linked worktree's own git directory holds, and where the main repository keeps it. */\nconst COMMONDIR_FILE = \"commondir\";\nconst BACK_LINK_FILE = \"gitdir\";\nconst WORKTREES_DIR = \"worktrees\";\n\n/**\n * How Claude Code stands toward a project folder: trusted, untrusted and asking, or untrusted and\n * never asking — a folder above it is trusted — which leaves only the record itself to set.\n */\ntype ClaudeTrust =\n | { readonly kind: \"trusted\" }\n | { readonly kind: \"asks\" }\n | { readonly kind: \"never asks\"; readonly recordKey: string };\n\n/** Whether `~/.claude.json` records `folder` as trusted. */\ntype TrustRecord = (folder: string) => boolean;\n\n/**\n * The notice a Claude install owes when this project holds sub-agents carrying a completion gate\n * and the folder is not trusted, as lines — empty for every other provider, for a run from the\n * home directory, for a trusted project, and for one whose sub-agents carry none.\n */\nexport async function claudeCompileNotices(\n provider: Provider,\n projectDir: string,\n): Promise<string[]> {\n if (provider !== \"claude\") return [];\n if (isHomeDirectory(projectDir)) return [];\n\n const withAStopHook = await projectAgentsWithAStopHook(projectDir);\n if (withAStopHook.length === 0) return [];\n\n const trust = await claudeTrustOf(projectDir);\n switch (trust.kind) {\n case \"trusted\":\n return [];\n case \"asks\":\n return [claudeProjectNeedsTrustMessage(projectDir, withAStopHook.length)];\n case \"never asks\":\n return [claudeProjectNeverAskedMessage(trust.recordKey, withAStopHook.length)];\n default: {\n const _exhaustive: never = trust;\n return _exhaustive;\n }\n }\n}\n\n/**\n * The line itself. It names the folder and the remedy, because the failure it warns about prints\n * nothing anywhere a user would read.\n */\nexport function claudeProjectNeedsTrustMessage(projectDir: string, count: number): string {\n return (\n `Claude Code runs a project sub-agent's completion gate (its Stop hook — the project's ` +\n `typecheck, unless the sub-agent declares its own) only once you trust the folder: open ` +\n `Claude Code in ${projectDir} and accept the trust prompt. Until then, ${completionGates(count)} ` +\n `will not run, and nothing will say so.`\n );\n}\n\n/**\n * The line for a folder Claude Code will never ask about, naming the one remedy left — the one\n * Claude Code's own diagnostic gives.\n */\nexport function claudeProjectNeverAskedMessage(recordKey: string, count: number): string {\n return (\n `Claude Code runs ${completionGates(count)} only once you trust the folder, and will not ask ` +\n `here: set projects[${JSON.stringify(recordKey)}].hasTrustDialogAccepted to true in ` +\n `${claudeStateFile()}.`\n );\n}\n\nfunction completionGates(count: number): string {\n return count === 1 ? \"1 sub-agent's completion gate\" : `${count} sub-agents' completion gates`;\n}\n\n/** Reads the project's trust the way Claude Code does: by its record's key, then by its prompt. */\nasync function claudeTrustOf(projectDir: string): Promise<ClaudeTrust> {\n const [isTrusted, repositoryRoot] = await Promise.all([\n trustRecord(),\n gitRepositoryRoot(projectDir),\n ]);\n const recordKey =\n repositoryRoot === undefined ? projectDir : await canonicalRepositoryRoot(repositoryRoot);\n if (isTrusted(recordKey)) return { kind: \"trusted\" };\n\n const promptSuppressed = foldersUpTo(projectDir, repositoryRoot).some(isTrusted);\n return promptSuppressed ? { kind: \"never asks\", recordKey } : { kind: \"asks\" };\n}\n\n/**\n * The trust record in `~/.claude.json`. Anything it cannot read counts as untrusted, which is the\n * safe direction: the cost of a wrong \"untrusted\" is one line of advice, and the cost of a wrong\n * \"trusted\" is a completion gate nobody knows is off.\n */\nasync function trustRecord(): Promise<TrustRecord> {\n const stateFile = claudeStateFile();\n if (!(await fileExists(stateFile))) return () => false;\n\n const state = claudeStateSchema.safeParse(parsedOrUndefined(await readFile(stateFile)));\n if (!state.success) return () => false;\n\n const { projects } = state.data;\n return (folder) => trustedProjectSchema.safeParse(projects[folder]).success;\n}\n\nfunction parsedOrUndefined(json: string): unknown {\n try {\n return JSON.parse(json);\n } catch {\n return undefined;\n }\n}\n\n/** `folder` and each folder above it, nearest first, up to `top` — or to the filesystem root. */\nfunction foldersUpTo(folder: string, top?: string): string[] {\n const parent = path.dirname(folder);\n if (folder === top || parent === folder) return [folder];\n return [folder, ...foldersUpTo(parent, top)];\n}\n\n/** The nearest folder at or above `folder` holding a `.git` entry, as Claude Code finds it. */\nasync function gitRepositoryRoot(folder: string): Promise<string | undefined> {\n const candidates = foldersUpTo(folder);\n const holdsGit = await Promise.all(\n candidates.map((candidate) => fileExists(path.join(candidate, GIT_ENTRY))),\n );\n return candidates.find((_, index) => holdsGit[index]);\n}\n\n/**\n * The root Claude Code keys a repository by: the main checkout's, where `root` is a linked\n * worktree — its `.git` file points into `<main>/.git/worktrees/`, and that directory points back —\n * and `root` itself otherwise, a `.git` directory or a pointer that does not check out included.\n */\nasync function canonicalRepositoryRoot(root: string): Promise<string> {\n // A `.git` directory reads as empty, as a missing file does.\n const pointer = (await readFileOptional(path.join(root, GIT_ENTRY))).trim();\n if (!pointer.startsWith(GITDIR_PREFIX)) return root;\n\n const gitDir = path.resolve(root, pointer.slice(GITDIR_PREFIX.length).trim());\n const [commonDir, backLink] = await Promise.all([\n pathRecordedIn(gitDir, COMMONDIR_FILE),\n pathRecordedIn(gitDir, BACK_LINK_FILE),\n ]);\n const isLinkedWorktree =\n path.dirname(gitDir) === path.join(commonDir, WORKTREES_DIR) &&\n (await pointsBackAt(backLink, root));\n if (!isLinkedWorktree) return root;\n\n // A worktree of a bare repository is keyed by the bare repository's own folder.\n return path.basename(commonDir) === GIT_ENTRY ? path.dirname(commonDir) : commonDir;\n}\n\n/** The path a git bookkeeping file in `dir` holds, resolved against `dir`; `dir` if it is absent. */\nasync function pathRecordedIn(dir: string, file: string): Promise<string> {\n return path.resolve(dir, (await readFileOptional(path.join(dir, file))).trim());\n}\n\n/** Whether a worktree's back-link names `root`'s own `.git`, both read through symlinks. */\nasync function pointsBackAt(backLink: string, root: string): Promise<boolean> {\n const [linked, realRoot] = await Promise.all([\n realpathOrUndefined(backLink),\n realpathOrUndefined(root),\n ]);\n return realRoot !== undefined && linked === path.join(realRoot, GIT_ENTRY);\n}\n\nasync function realpathOrUndefined(file: string): Promise<string | undefined> {\n try {\n return await realpath(file);\n } catch {\n return undefined;\n }\n}\n\n/** The compiled sub-agents in this project's own agents directory that carry a completion gate. */\nasync function projectAgentsWithAStopHook(projectDir: string): Promise<string[]> {\n const dir = agentsDir(\"claude\", \"project\", projectDir);\n const files = await glob(agentCodec(\"claude\").listGlob, dir);\n const carriers = await Promise.all(\n files.map(async (file) => ((await carriesAStopHook(path.join(dir, file))) ? [file] : [])),\n );\n return carriers.flat();\n}\n\nasync function carriesAStopHook(agentFile: string): Promise<boolean> {\n const [, frontmatter = \"\"] = (await readFile(agentFile)).split(FRONTMATTER_FENCE);\n return STOP_HOOK_LINE.test(frontmatter);\n}\n","import path from \"path\";\n\nimport { codexGlobalConfigFile } from \"../installation/install-layout.js\";\nimport { ensureDir, fileExists, readFile, writeFile } from \"../../utils/fs.js\";\n\n/**\n * The trust a PROJECT installation's agent roles need before Codex reads them — written by the\n * install, and said.\n *\n * **Registration is gated on one line in a file this CLI does not own.** A role at\n * `<project>/.codex/agents/<anything>.toml` reaches the model only while the user's GLOBAL\n * `$CODEX_HOME/config.toml` holds `[projects.\"<exact absolute path>\"] trust_level = \"trusted\"`.\n * Four kill switches were each measured on the pinned 0.155.1, and every one produces nothing\n * with NO warning anywhere: no `[projects]` entry; `trust_level = \"untrusted\"`, which beats a\n * permissive sandbox flag; a trailing slash on the path key; and the entry declared in the\n * project's OWN `.codex/config.toml`, which Codex refuses as self-authorisation.\n *\n * **So the install WRITES it, and prints exactly what it wrote.** Owner, 2026-09-26: _\"it should be\n * automated on install\"_ (CLI-893): the user chose a project install on their own machine, and a\n * project install Codex never reads is the silent failure this product exists to prevent. _Until\n * then this module detected the missing entry and printed the line for the user to add, on the\n * grounds that writing it would be the product granting itself trust; the disclosure is what\n * answers that now._\n *\n * **It never overrides an answer the user already gave.** An entry for this exact path with any\n * other `trust_level` — `\"untrusted\"` above all — is theirs, and is reported rather than changed.\n * And it is a STATE rather than a banner: a project already trusted is told nothing.\n */\n\n/** The key Codex reads a project's trust from, and the only value that registers anything. */\nconst TRUST_KEY = \"trust_level\";\nconst TRUSTED = \"trusted\";\n\n/** What {@link trustCodexProject} found, and what it did about it. */\nexport type CodexProjectTrust =\n | { readonly kind: \"already trusted\" }\n | { readonly kind: \"trusted now\"; readonly configFile: string }\n | {\n readonly kind: \"left as the user set it\";\n readonly configFile: string;\n readonly level: string;\n };\n\n/**\n * Trusts `projectDir` in the user's GLOBAL Codex config, unless it already is or they said otherwise.\n *\n * **Merged, never rewritten**: every line of the file is theirs and is carried through unchanged.\n * Where their file already holds `[projects.\"<dir>\"]` with no `trust_level` under it, the key goes\n * INTO that table, because a second table for the same path is a duplicate Codex refuses to parse\n * — taking every setting in the file with it.\n *\n * The path is written as `path.resolve` spells it: absolute, with no trailing separator, which is\n * the one spelling Codex matches.\n */\nexport async function trustCodexProject(projectDir: string): Promise<CodexProjectTrust> {\n const configFile = codexGlobalConfigFile();\n const dir = path.resolve(projectDir);\n const config = (await fileExists(configFile)) ? await readFile(configFile) : \"\";\n\n if (declaresTrust(config, dir)) return { kind: \"already trusted\" };\n\n const level = declaredLevel(config, dir);\n if (level !== undefined) return { kind: \"left as the user set it\", configFile, level };\n\n await ensureDir(path.dirname(configFile));\n await writeFile(configFile, withTrustFor(config, dir));\n return { kind: \"trusted now\", configFile };\n}\n\n/**\n * The line the install prints for what {@link trustCodexProject} did, or nothing when it did\n * nothing. It names the project, the file and the line, because a trust entry is the kind of\n * write a user has to be able to see and undo.\n */\nexport function codexProjectTrustMessage(\n projectDir: string,\n trust: CodexProjectTrust,\n): string | undefined {\n const table = `[projects.\"${path.resolve(projectDir)}\"]`;\n\n switch (trust.kind) {\n case \"already trusted\":\n return undefined;\n case \"trusted now\":\n return (\n `Trusted this project in your Codex configuration, so Codex reads its sub-agents: added ` +\n `${table} with ${TRUST_KEY} = \"${TRUSTED}\" to ${trust.configFile}.`\n );\n case \"left as the user set it\":\n return (\n `Codex reads this project's sub-agents only once it is trusted, and ${trust.configFile} ` +\n `sets ${TRUST_KEY} = \"${trust.level}\" under ${table}. Left as you set it — change it to ` +\n `\"${TRUSTED}\" for Codex to read them.`\n );\n default: {\n const _exhaustive: never = trust;\n return _exhaustive;\n }\n }\n}\n\n/**\n * Whether `config` trusts `projectDir`, in either spelling Codex accepts.\n *\n * Hand-read rather than parsed: this package declares no TOML reader, the question is one key\n * under one exactly-named table, and a whole parser would have to be right about every other\n * construct in a file we never write. Both forms below were what the measurement wrote and read\n * back; anything else reads as untrusted, which is the safe direction — the cost of a false\n * negative is one notice a user can ignore, and the cost of a false positive is silence about the\n * thing that makes their sub-agents invisible.\n */\nfunction declaresTrust(config: string, projectDir: string): boolean {\n const lines = config.split(\"\\n\").map((line) => line.trim());\n\n return trustsUnderTableHeader(lines, projectDir) || lines.includes(dottedTrustLine(projectDir));\n}\n\n/** `[projects.\"<dir>\"]` with `trust_level = \"trusted\"` under it, before the next table. */\nfunction trustsUnderTableHeader(lines: readonly string[], projectDir: string): boolean {\n const header = lines.indexOf(projectTableHeader(projectDir));\n if (header === -1) return false;\n\n return linesUnderTableHeader(lines, header).includes(trustAssignment());\n}\n\n/** Everything after a table header and before the next one — that table's body. */\nfunction linesUnderTableHeader(lines: readonly string[], header: number): readonly string[] {\n const after = lines.slice(header + 1);\n const nextTable = after.findIndex(opensATable);\n\n return nextTable === -1 ? after : after.slice(0, nextTable);\n}\n\nfunction opensATable(line: string): boolean {\n return line.startsWith(\"[\");\n}\n\nfunction projectTableHeader(projectDir: string): string {\n return `[projects.\"${projectDir}\"]`;\n}\n\n/** `projects.\"<dir>\".trust_level = \"trusted\"` written as one dotted key. */\nfunction dottedTrustLine(projectDir: string): string {\n return `projects.\"${projectDir}\".${trustAssignment()}`;\n}\n\nfunction trustAssignment(): string {\n return `${TRUST_KEY} = \"${TRUSTED}\"`;\n}\n\n/** A `trust_level` line: its key, then the quoted level. */\nconst TRUST_LEVEL_LINE = new RegExp(`^${TRUST_KEY}\\\\s*=\\\\s*\"([^\"]*)\"$`);\n\n/**\n * The `trust_level` the user's file gives this exact project, in either spelling, when it gives\n * one at all — the answer {@link trustCodexProject} must not overwrite.\n */\nfunction declaredLevel(config: string, projectDir: string): string | undefined {\n const lines = config.split(\"\\n\").map((line) => line.trim());\n const header = lines.indexOf(projectTableHeader(projectDir));\n const underHeader = header === -1 ? [] : linesUnderTableHeader(lines, header);\n const dottedPrefix = `projects.\"${projectDir}\".`;\n const dotted = lines\n .filter((line) => line.startsWith(dottedPrefix))\n .map((line) => line.slice(dottedPrefix.length));\n\n return [...underHeader, ...dotted]\n .map((line) => TRUST_LEVEL_LINE.exec(line)?.[1])\n .find((level) => level !== undefined);\n}\n\n/**\n * `config` with this project trusted: the key added under the project's existing table where the\n * file has one, and a new table at the end where it does not.\n */\nfunction withTrustFor(config: string, projectDir: string): string {\n const lines = config.split(\"\\n\");\n const header = lines.findIndex((line) => line.trim() === projectTableHeader(projectDir));\n\n if (header !== -1) {\n return [...lines.slice(0, header + 1), trustAssignment(), ...lines.slice(header + 1)].join(\n \"\\n\",\n );\n }\n\n const theirs = config.trimEnd();\n const table = `${projectTableHeader(projectDir)}\\n${trustAssignment()}\\n`;\n return theirs === \"\" ? table : `${theirs}\\n\\n${table}`;\n}\n","import {\n agentsLeftOutOfCodexMessage,\n unexpressibleOnCodexMessage,\n} from \"@workspace/compile/agent-source\";\n\nimport { codexProjectTrustMessage, trustCodexProject } from \"./codex-project-trust.js\";\nimport { agentCodec, agentsDir } from \"../installation/install-layout.js\";\nimport { glob } from \"../../utils/fs.js\";\nimport type { Provider } from \"../../consts.js\";\n\n/**\n * What a Codex compile owes the user, once per RUN.\n *\n * Three facts, each true of the whole installation rather than of one sub-agent or one scope, and\n * each invisible anywhere else:\n *\n * 1. **Two sub-agents are absent.** All seventeen shipped stacks list both summoners, so this\n * fires on every Codex install — which is exactly why it is one line for both rather than one\n * per agent (two lines, forever) or one per stack (seventeen).\n * 2. **Six settings have no Codex expression.** The renderer omits them because Codex's\n * deserializer drops the whole file on an unlisted key, and an omission nobody is told about is\n * a sub-agent whose permission mode or preloaded skills silently stopped applying. Sixteen\n * sub-agents across two scopes would be thirty-two lines of one fact.\n * 3. **A project's roles are unread until the project is trusted**, so the install trusts it in the\n * user's global Codex config and says exactly what it wrote (owner, 2026-09-26, CLI-893) — or,\n * where the user already set another `trust_level`, leaves it and says so.\n *\n * They are three separate sentences and do not merge: folded together, a user cannot tell whether\n * their reviewer exists from whether its tool list applies.\n *\n * Returned as lines rather than printed, so the two commands that compile — `init` and `compile` —\n * say the same thing in the same order, and neither can acquire a fourth sentence the other\n * does not have.\n */\nexport async function codexCompileNotices(\n provider: Provider,\n projectDir: string,\n): Promise<string[]> {\n if (provider !== \"codex\") return [];\n\n return [\n agentsLeftOutOfCodexMessage(),\n unexpressibleOnCodexMessage(),\n ...(await trustNotice(projectDir)),\n ];\n}\n\n/**\n * The project's trust, written where it is needed, and the line that says what was done.\n *\n * Conditioned on role files actually being in the project's agents directory rather than on what\n * this run compiled, because the question is about the tree as it stands: a global-only\n * installation has no project roles for a trust entry to unlock, and writing one would grant\n * trust to a directory with nothing in it for Codex to read.\n *\n * Silent once the entry is there, which is what makes it a STATE rather than a banner.\n */\nasync function trustNotice(projectDir: string): Promise<string[]> {\n if (!(await holdsProjectRoles(projectDir))) return [];\n\n const said = codexProjectTrustMessage(projectDir, await trustCodexProject(projectDir));\n return said === undefined ? [] : [said];\n}\n\n/** Whether this project's own Codex agents directory holds any role file at all. */\nasync function holdsProjectRoles(projectDir: string): Promise<boolean> {\n const roles = await glob(agentCodec(\"codex\").listGlob, agentsDir(\"codex\", \"project\", projectDir));\n\n return roles.length > 0;\n}\n","import { claudeCompileNotices } from \"./claude-project-trust.js\";\nimport { codexCompileNotices } from \"./codex-compile-notices.js\";\nimport type { Provider } from \"../../consts.js\";\n\n/**\n * Everything an install owes the user about its host once the compile is done, as lines — the one\n * place `init` and `compile` both get them from, so the two cannot say different things about one\n * tree.\n *\n * On Codex: the sub-agents left out, the settings a role cannot carry, and the project trust entry\n * (`codexCompileNotices`). On Claude: the trust dialog, while a project's sub-agents, whose\n * completion gate Claude Code drops in an untrusted folder, sit in one it has not been told to\n * trust (`claudeCompileNotices`). Each provider's half is empty on the other.\n */\nexport async function hostCompileNotices(\n provider: Provider,\n projectDir: string,\n): Promise<string[]> {\n return [\n ...(await codexCompileNotices(provider, projectDir)),\n ...(await claudeCompileNotices(provider, projectDir)),\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,UAAU;AACjB,SAAS,gBAAgB;AAEzB,SAAS,SAAS;AAuClB,IAAM,oBAAoB,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,EAAE,CAAC;AAGlF,IAAM,uBAAuB,EAAE,OAAO,EAAE,wBAAwB,EAAE,QAAQ,IAAI,EAAE,CAAC;AAQjF,IAAM,iBAAiB;AACvB,IAAM,oBAAoB;AAG1B,IAAM,YAAY;AAClB,IAAM,gBAAgB;AAEtB,IAAM,iBAAiB;AACvB,IAAM,iBAAiB;AACvB,IAAM,gBAAgB;AAmBtB,eAAsB,qBACpB,UACA,YACmB;AACnB,MAAI,aAAa,SAAU,QAAO,CAAC;AACnC,MAAI,gBAAgB,UAAU,EAAG,QAAO,CAAC;AAEzC,QAAM,gBAAgB,MAAM,2BAA2B,UAAU;AACjE,MAAI,cAAc,WAAW,EAAG,QAAO,CAAC;AAExC,QAAM,QAAQ,MAAM,cAAc,UAAU;AAC5C,UAAQ,MAAM,MAAM;AAAA,IAClB,KAAK;AACH,aAAO,CAAC;AAAA,IACV,KAAK;AACH,aAAO,CAAC,+BAA+B,YAAY,cAAc,MAAM,CAAC;AAAA,IAC1E,KAAK;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AAO;AAAA,IACL,4BAA4B;AAAA,IAC5B,4BAA4B;AAAA,IAC5B,GAAI,MAAM,YAAY,UAAU;AAAA,EAClC;AACF;AAYA,eAAe,YAAY,YAAuC;AAChE,MAAI,CAAE,MAAM,kBAAkB,UAAU,EAAI,QAAO,CAAC;AAEpD,QAAM,OAAO,yBAAyB,YAAY,MAAM,kBAAkB,UAAU,CAAC;AACrF,SAAO,SAAS,SAAY,CAAC,IAAI,CAAC,IAAI;AACxC;AAGA,eAAe,kBAAkB,YAAsC;AACrE,QAAM,QAAQ,MAAM,KAAK,WAAW,OAAO,EAAE,UAAU,UAAU,SAAS,WAAW,UAAU,CAAC;AAEhG,SAAO,MAAM,SAAS;AACxB;;;ACvDA,eAAsB,mBACpB,UACA,YACmB;AACnB,SAAO;AAAA,IACL,GAAI,MAAM,oBAAoB,UAAU,UAAU;AAAA,IAClD,GAAI,MAAM,qBAAqB,UAAU,UAAU;AAAA,EACrD;AACF;","names":["path","path"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/lib/operations/project/load-agent-defs.ts"],"sourcesContent":["import { getAgentDefinitions } from \"../../agents/index.js\";\nimport { loadMergedAgents } from \"../../loading/index.js\";\nimport type { AgentDefinition, AgentName, AgentSourcePaths } from \"../../../types/index.js\";\n\nexport type AgentDefs = {\n /**\n * The CLI's own sub-agent definitions — every `metadata.yaml` under its `src/agents/`, and\n * nothing a marketplace declares.\n */\n agents: Partial<Record<AgentName, AgentDefinition>>;\n /** The sourcePath used to load agent partials (for compilation). */\n sourcePath: string;\n /** Full agent source paths (agentsDir, sourcePath). */\n agentSourcePaths: AgentSourcePaths;\n};\n\n/**\n * The single definition of which sub-agents exist.\n *\n * Every path that emits the sub-agent unions in a `config-types.ts` derives its roster from here,\n * and so does every compile pass, because the answer has to be the same one: agent partials\n * resolve under {@link getAgentDefinitions}' local branch, and the generated `AGENT_NAMES` is\n * built by `scripts/generate-source-types.ts` from that same `src/agents/` directory. A roster\n * that included a marketplace's own sub-agents would put a literal in `AgentName` that nothing\n * downstream can honour (owner ruling 2026-08-21).\n *\n * It takes no arguments because there is nothing here for a caller to vary: agent partials\n * ship with the CLI, so {@link getAgentDefinitions} is always asked for its local branch.\n *\n * That local branch answers `sourcePath: PROJECT_ROOT`, so {@link loadMergedAgents} below is\n * handed the CLI's own root as its \"source\" and both of its sides read the same directory. The\n * merge is real and degenerate, which is why this used to be documented as \"CLI defaults plus\n * source overrides\" — a sentence describing an argument this function has not taken for some\n * time. The wiring was the intent; the sentence was the fossil.\n */\nexport async function loadAgentDefs(): Promise<AgentDefs> {\n const agentSourcePaths = await getAgentDefinitions();\n const agents = await loadMergedAgents(agentSourcePaths.sourcePath);\n\n return {\n agents,\n sourcePath: agentSourcePaths.sourcePath,\n agentSourcePaths,\n };\n}\n"],"mappings":";;;;;;;;;AAmCA,eAAsB,gBAAoC;AACxD,QAAM,mBAAmB,MAAM,oBAAoB;AACnD,QAAM,SAAS,MAAM,iBAAiB,iBAAiB,UAAU;AAEjE,SAAO;AAAA,IACL;AAAA,IACA,YAAY,iBAAiB;AAAA,IAC7B;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/components/render.ts"],"sourcesContent":["import { render as inkRender, type Instance, type RenderOptions } from \"ink\";\nimport type { ReactNode } from \"react\";\n\n/**\n * Every Ink render in the CLI goes through here, for one rule: a real terminal\n * is not a guess.\n *\n * Ink decides whether it is interactive by consulting CI environment variables\n * (`is-in-ci`) before it looks at the stream it was handed, and under CI it\n * buffers every frame and writes only at exit. For a spinner that is cosmetic;\n * for anything awaiting input it is fatal — the screen the user must answer is\n * never painted. That exact failure ran one CI suite for 49 minutes, because\n * the e2e harness hands the child a genuine pseudo-terminal while the runner's\n * environment says CI.\n *\n * So: when the destination stream is a TTY, say `interactive: true` out loud\n * and the CI guess never happens. When it is not — piped output, redirected\n * logs, genuine CI without a terminal — pass nothing and Ink's own detection\n * keeps its non-interactive behaviour. An explicit `interactive` from a caller\n * always wins; the spread order is what guarantees it.\n */\nexport function render(node: ReactNode, options?: RenderOptions): Instance {\n const stdout = options?.stdout ?? process.stdout;\n return inkRender(node, {\n ...(stdout.isTTY && { interactive: true }),\n ...options,\n });\n}\n"],"mappings":";;;AAAA,SAAS,UAAU,iBAAoD;AAqBhE,SAAS,OAAO,MAAiB,SAAmC;AACzE,QAAM,SAAS,SAAS,UAAU,QAAQ;AAC1C,SAAO,UAAU,MAAM;AAAA,IACrB,GAAI,OAAO,SAAS,EAAE,aAAa,KAAK;AAAA,IACxC,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/components/common/scroll-affordance.tsx"],"sourcesContent":["import { Box, Text } from \"ink\";\nimport React from \"react\";\nimport { SCROLL_VIEWPORT } from \"../../consts.js\";\n\nexport type ScrollAffordanceProps = {\n /** Content lines scrolled off the top of the viewport. */\n hiddenAbove: number;\n /** Content lines that do not fit below the viewport. */\n hiddenBelow: number;\n};\n\nfunction formatHiddenCounts(hiddenAbove: number, hiddenBelow: number): string {\n return [\n hiddenAbove > 0 ? `${hiddenAbove} more above` : null,\n hiddenBelow > 0 ? `${hiddenBelow} more below` : null,\n ]\n .filter((part) => part !== null)\n .join(\" \");\n}\n\n/**\n * One pinned line telling the user the viewport is clipping content.\n *\n * Render this as a SIBLING of the clipped viewport, never inside it: a\n * viewport that clips its own overflow would clip this line too. Its fixed\n * `SCROLL_INDICATOR_HEIGHT` row is taken out of the space the viewport grows\n * into, so the viewport shrinks by exactly one row while the affordance shows.\n */\nexport const ScrollAffordance: React.FC<ScrollAffordanceProps> = ({ hiddenAbove, hiddenBelow }) => {\n if (hiddenAbove <= 0 && hiddenBelow <= 0) return null;\n\n return (\n <Box height={SCROLL_VIEWPORT.SCROLL_INDICATOR_HEIGHT} flexShrink={0}>\n <Text dimColor>{formatHiddenCounts(hiddenAbove, hiddenBelow)}</Text>\n </Box>\n );\n};\n"],"mappings":";;;;;;AAAA,SAAS,KAAK,YAAY;AAC1B,OAAkB;AAgCZ;AAtBN,SAAS,mBAAmB,aAAqB,aAA6B;AAC5E,SAAO;AAAA,IACL,cAAc,IAAI,GAAG,WAAW,gBAAgB;AAAA,IAChD,cAAc,IAAI,GAAG,WAAW,gBAAgB;AAAA,EAClD,EACG,OAAO,CAAC,SAAS,SAAS,IAAI,EAC9B,KAAK,KAAK;AACf;AAUO,IAAM,mBAAoD,CAAC,EAAE,aAAa,YAAY,MAAM;AACjG,MAAI,eAAe,KAAK,eAAe,EAAG,QAAO;AAEjD,SACE,oBAAC,OAAI,QAAQ,gBAAgB,yBAAyB,YAAY,GAChE,8BAAC,QAAK,UAAQ,MAAE,6BAAmB,aAAa,WAAW,GAAE,GAC/D;AAEJ;","names":[]}
|