agents-inc 0.172.0 → 0.174.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +68 -0
- package/dist/{chunk-6LUTY35Q.js → chunk-3PJZ4QNJ.js} +7 -7
- package/dist/{chunk-255DGUCH.js → chunk-6PGXTLA4.js} +12 -6
- package/dist/{chunk-255DGUCH.js.map → chunk-6PGXTLA4.js.map} +1 -1
- package/dist/{chunk-KCLBLK3F.js → chunk-7BHDKEGK.js} +3 -3
- package/dist/{chunk-7OG635DK.js → chunk-AIBVAYHS.js} +6 -2
- package/dist/{chunk-7OG635DK.js.map → chunk-AIBVAYHS.js.map} +1 -1
- package/dist/{chunk-5MGRHS2G.js → chunk-APWMMZOK.js} +42 -25
- package/dist/chunk-APWMMZOK.js.map +1 -0
- package/dist/{chunk-VILFCMRN.js → chunk-E45IT3HC.js} +368 -123
- package/dist/chunk-E45IT3HC.js.map +1 -0
- package/dist/{chunk-MOL2J5HS.js → chunk-ECPFYHDX.js} +2 -2
- package/dist/{chunk-LUKDDHSI.js → chunk-EFXVYQGT.js} +4 -4
- package/dist/{chunk-G7NUK3BF.js → chunk-FQF6VHO3.js} +29 -19
- package/dist/chunk-FQF6VHO3.js.map +1 -0
- package/dist/chunk-H5E6IO2L.js +116 -0
- package/dist/chunk-H5E6IO2L.js.map +1 -0
- package/dist/{chunk-3R3LHA4Q.js → chunk-I3WF6L43.js} +2 -2
- package/dist/{chunk-7ZOWSCAO.js → chunk-IAQFZFWD.js} +4 -4
- package/dist/{chunk-NISWBQNS.js → chunk-IXVGBUWI.js} +5 -5
- package/dist/{chunk-MBIOZ5LW.js → chunk-ORO2T4K2.js} +19 -5
- package/dist/chunk-ORO2T4K2.js.map +1 -0
- package/dist/{chunk-A3ZAXL5T.js → chunk-QCX66KBM.js} +3 -3
- package/dist/{chunk-6CRA46YO.js → chunk-R7GKQBZJ.js} +44 -21
- package/dist/chunk-R7GKQBZJ.js.map +1 -0
- package/dist/{chunk-Y23MP2OC.js → chunk-REHVGFJE.js} +5 -5
- package/dist/{chunk-5PPB6HT6.js → chunk-TVEDNGVP.js} +2 -2
- package/dist/{chunk-MHAQWMNJ.js → chunk-WUSEZFER.js} +1 -5
- package/dist/{chunk-MHAQWMNJ.js.map → chunk-WUSEZFER.js.map} +1 -1
- package/dist/commands/build/marketplace.js +4 -4
- package/dist/commands/build/plugins.js +6 -6
- package/dist/commands/compile.js +12 -12
- package/dist/commands/doctor.js +33 -15
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +56 -59
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +25 -30
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/init.js +17 -18
- package/dist/commands/list.js +41 -16
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/marketplace.js +4 -4
- package/dist/commands/search.js +9 -9
- package/dist/commands/share.js +9 -9
- package/dist/commands/uninstall.js +61 -56
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +6 -6
- package/dist/components/common/select-list.js +2 -2
- package/dist/components/common/skill-agent-summary.js +3 -3
- package/dist/components/common/summary-panel.js +4 -7
- package/dist/hooks/init.js +57 -33
- package/dist/hooks/init.js.map +1 -1
- package/dist/load-agent-defs-5U5KAURA.js +14 -0
- package/dist/{recompile-project-agents-5A44NJRD.js → recompile-project-agents-KYK44C24.js} +8 -8
- package/dist/{source-loader-LQNRI5UZ.js → source-loader-G5I4RNUP.js} +4 -4
- package/package.json +1 -1
- package/dist/chunk-33JICQD5.js +0 -196
- package/dist/chunk-33JICQD5.js.map +0 -1
- package/dist/chunk-5MGRHS2G.js.map +0 -1
- package/dist/chunk-6CRA46YO.js.map +0 -1
- package/dist/chunk-G7NUK3BF.js.map +0 -1
- package/dist/chunk-MBIOZ5LW.js.map +0 -1
- package/dist/chunk-N33AKFLR.js +0 -24
- package/dist/chunk-N33AKFLR.js.map +0 -1
- package/dist/chunk-VILFCMRN.js.map +0 -1
- package/dist/components/common/scroll-affordance.js +0 -9
- package/dist/load-agent-defs-54VIKN4T.js +0 -14
- package/dist/source-loader-LQNRI5UZ.js.map +0 -1
- /package/dist/{chunk-6LUTY35Q.js.map → chunk-3PJZ4QNJ.js.map} +0 -0
- /package/dist/{chunk-KCLBLK3F.js.map → chunk-7BHDKEGK.js.map} +0 -0
- /package/dist/{chunk-MOL2J5HS.js.map → chunk-ECPFYHDX.js.map} +0 -0
- /package/dist/{chunk-LUKDDHSI.js.map → chunk-EFXVYQGT.js.map} +0 -0
- /package/dist/{chunk-3R3LHA4Q.js.map → chunk-I3WF6L43.js.map} +0 -0
- /package/dist/{chunk-7ZOWSCAO.js.map → chunk-IAQFZFWD.js.map} +0 -0
- /package/dist/{chunk-NISWBQNS.js.map → chunk-IXVGBUWI.js.map} +0 -0
- /package/dist/{chunk-A3ZAXL5T.js.map → chunk-QCX66KBM.js.map} +0 -0
- /package/dist/{chunk-Y23MP2OC.js.map → chunk-REHVGFJE.js.map} +0 -0
- /package/dist/{chunk-5PPB6HT6.js.map → chunk-TVEDNGVP.js.map} +0 -0
- /package/dist/{components/common/scroll-affordance.js.map → load-agent-defs-5U5KAURA.js.map} +0 -0
- /package/dist/{recompile-project-agents-5A44NJRD.js.map → recompile-project-agents-KYK44C24.js.map} +0 -0
- /package/dist/{load-agent-defs-54VIKN4T.js.map → source-loader-G5I4RNUP.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,74 @@ Each release has detailed notes in its own file under [`changelogs/`](./changelo
|
|
|
7
7
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
8
8
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
9
9
|
|
|
10
|
+
## [0.174.0] - 2026-10-24
|
|
11
|
+
|
|
12
|
+
**Every summary names a skill by the display name its install recorded, `init --from` and `edit --from` stop when a marketplace refuses the version check, every command says an old `.claude-src/` is ignored, and the editor says when an account's stacks could not be read, with Retry**
|
|
13
|
+
|
|
14
|
+
- REPO-44: the standards, the journey page and the findings follow the code.
|
|
15
|
+
- REPO-45: the git rule in both `CLAUDE.md` files names its one exception, a `commit-plan` skill run.
|
|
16
|
+
- CLI-963: `init --from` and `edit --from` record each skill's display name in `config.ts`, and every summary names a skill by it, then by the catalogue's name, then by its id.
|
|
17
|
+
- CLI-959: `list` at a terminal shows each skill by the name its install recorded, plugins included.
|
|
18
|
+
- CLI-978: piped `list` names each skill on its own line, with its scope.
|
|
19
|
+
- CLI-954: `uninstall`'s panel names a kept global copy and a local-marketplace plugin by name, where it printed the id.
|
|
20
|
+
- CLI-960: `uninstall`'s panel header names the marketplace of what it removes, or of what it keeps when it removes no skill.
|
|
21
|
+
- CLI-973: the line naming what a sub-agent gains or loses under `edit --from`'s panel names each skill as the panel does.
|
|
22
|
+
- CLI-975: `edit --from` asks the plugin host once, not twice, when a skill changes both mode and scope.
|
|
23
|
+
- CLI-946: a 404 or 403 from the version check stops `init --from` and `edit --from` with exit 1, leaving everything as it was.
|
|
24
|
+
- CLI-958: they stop on every 4xx but 405; on a 5xx or 405 they keep the saved copy and warn once a run.
|
|
25
|
+
- CLI-962: `compile`, `search`, `eject` and `uninstall` keep the saved copy over a refusal, warning on a 5xx or 405 only.
|
|
26
|
+
- CLI-966: offline with only giget's saved tarball left, every load but `doctor`'s warns that it is using the cached copy.
|
|
27
|
+
- CLI-931: every command prints one line to stderr for each place holding an old `.claude-src/`: it is ignored, and which folder agents-inc reads.
|
|
28
|
+
- CLI-965: that line names `.agents-inc/codex/` for a root whose installation is Codex.
|
|
29
|
+
- CLI-967: on a run given `--provider`, that line names that provider's folder.
|
|
30
|
+
- CLI-968: a run no longer inherits the provider an earlier run in the same process named.
|
|
31
|
+
- CLI-977: without `--provider`, HOME's line names HOME's folder for the project's tool.
|
|
32
|
+
- CLI-969: a bare `list` under a HOME holding one installation no longer says it "holds 1 installations".
|
|
33
|
+
- CLI-964: the findings check gives the same verdict in a clean `git archive` as in a checkout, so publishing needs no extra files copied in.
|
|
34
|
+
- CLI-980: `generate:types:check` without the skills checkout stops with one line naming the folder it looked in.
|
|
35
|
+
- CLI-947: the summary panel's scrolling code is gone; its output is unchanged.
|
|
36
|
+
- CLI-948: `clean-code-standards.md` 15.19 says how to ask a library that can answer from its own cache which it did.
|
|
37
|
+
- CLI-949: the editor's preview crossing spec gets a row setting both sources for the model.
|
|
38
|
+
- CLI-950: doctor's row patterns in the e2e specs are built once, by `doctorRow`.
|
|
39
|
+
- CLI-951: a spec that counts a rate limiter stubs it and pins the callers its key separates and merges.
|
|
40
|
+
- CLI-952: the editor standard says to ask which saved configuration was read, never the stored marketplace choice.
|
|
41
|
+
- CLI-953: the stack-switch question's cost is covered with a restore waiting and with a shared link open.
|
|
42
|
+
- CLI-955: the resize specs wait for the settled frame instead of reading it once after a delay.
|
|
43
|
+
- CLI-956: every path, URL, id and mirrored text in a spec's pattern goes through one tested escaper, `matchedAsWritten`.
|
|
44
|
+
- CLI-961: the test fixtures write each skill's real display name, so specs assert names where the CLI prints names.
|
|
45
|
+
- CLI-974: eleven `edit --from` plugin specs check what each run left behind, not only what it printed.
|
|
46
|
+
- CLI-976: the compile and `init --from` spec files check what each run left behind.
|
|
47
|
+
- EDITOR-103: an account's saved stack that fails to load with nothing unsaved says `Couldn't load this stack.`, with Retry.
|
|
48
|
+
- EDITOR-104: that click and its Retry read through the account store, so the stack's tile lights and no false "discarding" is shown.
|
|
49
|
+
- EDITOR-108: while an account's stack list cannot be read, `Couldn't load your saved stacks.` shows with Retry, and the grid shows this browser's saves.
|
|
50
|
+
- EDITOR-106: a list that could not be read no longer counts as an empty account, so no save is carried in again.
|
|
51
|
+
- EDITOR-110: a Retry that works hands keyboard focus to the stack it loaded or to the Stacks grid.
|
|
52
|
+
- EDITOR-101: pressing the skill option already in effect saves nothing and reports nothing.
|
|
53
|
+
- EDITOR-105: applying a stack already in effect saves nothing and reports nothing.
|
|
54
|
+
- EDITOR-107: "already in effect" is judged by value, whatever the key order.
|
|
55
|
+
- EDITOR-102: a "nothing saved" test checks both that the state is unchanged and that nothing was written.
|
|
56
|
+
- EDITOR-109: every editor store action is filed by what a second identical call does, checked by a census spec.
|
|
57
|
+
- EDITOR-85: the owed-save dialog, Escape in a skill's options panel and Apply on a proposal put keyboard focus where it was.
|
|
58
|
+
- CLI-979: known gap. When `edit --from` at home drops a skill whose plugin came from another marketplace, the plugin stays installed. The fix waits on the owner's card `q-cli-979-fix`.
|
|
59
|
+
- CLI-971: known gap. A project config that declares nothing, under a HOME holding both tools, is counted as an installation by the refusal and `list`, while commands skip it. The fix is queued.
|
|
60
|
+
- CLI-982: known gap. `init --from` that cannot write the project's config leaves a half-install. Waiting on the owner's card `q-cli-init-half-install`.
|
|
61
|
+
|
|
62
|
+
See [changelogs/0.174.0.md](./changelogs/0.174.0.md) for full details.
|
|
63
|
+
|
|
64
|
+
## [0.173.0] - 2026-10-23
|
|
65
|
+
|
|
66
|
+
**`doctor` downloads each marketplace on every run, the editor keeps a saved configuration per marketplace and its stack-switch question waits for the stack, and a sub-agent goes off with its last skill**
|
|
67
|
+
|
|
68
|
+
- REPO-44:
|
|
69
|
+
- The editor keeps a saved configuration per marketplace: loading another opens its own and leaves the one on screen saved with its marketplace, and a saved stack built on another marketplace loads that marketplace first.
|
|
70
|
+
- The question before an account's saved stack replaces changes waits for the stack and offers Retry when it cannot load. A sub-agent whose last skill goes switches off with the toast on a link the CLI minted.
|
|
71
|
+
- `doctor` passes a project holding a Claude and a Codex installation, and `doctor` and `uninstall` use the project's own provider's global where a home holds both. A marketplace skill with no `displayName` is skipped with a warning and the rest of the marketplace loads.
|
|
72
|
+
- CLI-925: `doctor` downloads each marketplace on every run, fails its row when only giget's saved tarball came back, and says when it replaced a saved copy that differed.
|
|
73
|
+
- CLI-915: the editor's preview shows a link's own description over its stack's, as the install does.
|
|
74
|
+
- CLI-865: the panel and terminal-poll specs wait for their settled result instead of sampling once after a fixed delay.
|
|
75
|
+
|
|
76
|
+
See [changelogs/0.173.0.md](./changelogs/0.173.0.md) for full details.
|
|
77
|
+
|
|
10
78
|
## [0.172.0] - 2026-10-22
|
|
11
79
|
|
|
12
80
|
**`init --from`, `edit --from` and `uninstall` show the summary panel at the question, the editor names the sub-agents a skill switches and holds a project link's global entries, links are version 7, and agentsinc.sh/ opens the editor**
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
arrivedAsText,
|
|
5
5
|
jsonBodyOrUndefined,
|
|
6
6
|
retryAfterSeconds
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QCX66KBM.js";
|
|
8
8
|
import {
|
|
9
9
|
withoutExcludedAssignments
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EFXVYQGT.js";
|
|
11
11
|
import {
|
|
12
12
|
readCarriedSkills
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-IAQFZFWD.js";
|
|
14
14
|
import {
|
|
15
15
|
ERROR_MESSAGES,
|
|
16
16
|
directoryExists,
|
|
@@ -21,13 +21,13 @@ import {
|
|
|
21
21
|
loadProjectConfigFromDir,
|
|
22
22
|
readForkedFromMetadata,
|
|
23
23
|
resolveInstallPaths
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-E45IT3HC.js";
|
|
25
25
|
import {
|
|
26
26
|
plural,
|
|
27
27
|
truncateText,
|
|
28
28
|
typedEntries,
|
|
29
29
|
typedValues
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-AIBVAYHS.js";
|
|
31
31
|
import {
|
|
32
32
|
CLI_INVOKE_COMMAND,
|
|
33
33
|
DEFAULT_PUBLIC_SOURCE_NAME,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
activeAgentScopeMap,
|
|
39
39
|
activeSkillScopeMap,
|
|
40
40
|
seedModelSchema
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-WUSEZFER.js";
|
|
42
42
|
|
|
43
43
|
// src/cli/lib/seed/installation-payload.ts
|
|
44
44
|
import os from "os";
|
|
@@ -371,4 +371,4 @@ export {
|
|
|
371
371
|
skillsAuthoredHere,
|
|
372
372
|
publishSeedConfig
|
|
373
373
|
};
|
|
374
|
-
//# sourceMappingURL=chunk-
|
|
374
|
+
//# sourceMappingURL=chunk-3PJZ4QNJ.js.map
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
readFileOptional,
|
|
15
15
|
unexpressibleOnCodexMessage,
|
|
16
16
|
writeFile
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-E45IT3HC.js";
|
|
18
18
|
|
|
19
19
|
// src/cli/lib/hosts/claude-project-trust.ts
|
|
20
20
|
import path from "path";
|
|
@@ -226,13 +226,19 @@ async function holdsProjectRoles(projectDir) {
|
|
|
226
226
|
|
|
227
227
|
// src/cli/lib/hosts/host-compile-notices.ts
|
|
228
228
|
async function hostCompileNotices(provider, projectDir) {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
229
|
+
switch (provider) {
|
|
230
|
+
case "claude":
|
|
231
|
+
return claudeCompileNotices(provider, projectDir);
|
|
232
|
+
case "codex":
|
|
233
|
+
return codexCompileNotices(provider, projectDir);
|
|
234
|
+
default: {
|
|
235
|
+
const _exhaustive = provider;
|
|
236
|
+
return _exhaustive;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
233
239
|
}
|
|
234
240
|
|
|
235
241
|
export {
|
|
236
242
|
hostCompileNotices
|
|
237
243
|
};
|
|
238
|
-
//# sourceMappingURL=chunk-
|
|
244
|
+
//# sourceMappingURL=chunk-6PGXTLA4.js.map
|
|
@@ -1 +1 @@
|
|
|
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 { extractFrontmatter } from \"../../utils/frontmatter.js\";\nimport type { Provider } from \"../../consts.js\";\n\n/**\n * Warns when Claude Code will drop a project sub-agent's hooks, on every event: project hooks run\n * only once `~/.claude.json` records `projects[<key>].hasTrustDialogAccepted`, keyed by the git\n * repository root (a linked worktree's main checkout). Reads that state, never writes it.\n */\n\nconst claudeStateSchema = z.object({ projects: z.record(z.string(), z.unknown()) });\n\nconst trustedProjectSchema = z.object({ hasTrustDialogAccepted: z.literal(true) });\n\n/** Claude Code reads only a top-level `hooks:` key: event name to its definitions. */\nconst declaredHooksSchema = z.object({ hooks: z.record(z.string(), z.array(z.unknown())) });\n\nconst GIT_ENTRY = \".git\";\nconst GITDIR_PREFIX = \"gitdir:\";\nconst COMMONDIR_FILE = \"commondir\";\nconst BACK_LINK_FILE = \"gitdir\";\nconst WORKTREES_DIR = \"worktrees\";\n\n/** \"never asks\": a folder above is trusted, so no prompt appears and only the record can fix it. */\ntype ClaudeTrust =\n | { readonly kind: \"trusted\" }\n | { readonly kind: \"asks\" }\n | { readonly kind: \"never asks\"; readonly recordKey: string };\n\ntype TrustRecord = (folder: string) => boolean;\n\n/** Empty from the home directory: `~/.claude/agents/` is trusted unconditionally. */\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 agentsWithHooks = await countProjectAgentsDeclaringHooks(projectDir);\n if (agentsWithHooks === 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, agentsWithHooks)];\n case \"never asks\":\n return [claudeProjectNeverAskedMessage(trust.recordKey, agentsWithHooks)];\n default: {\n const _exhaustive: never = trust;\n return _exhaustive;\n }\n }\n}\n\nexport function claudeProjectNeedsTrustMessage(projectDir: string, count: number): string {\n return (\n `Claude Code runs a project sub-agent's hooks only once you trust the folder: open Claude ` +\n `Code in ${projectDir} and accept the trust prompt. Until then, ${hooksOf(count)} will not ` +\n `run, and nothing will say so.`\n );\n}\n\nexport function claudeProjectNeverAskedMessage(recordKey: string, count: number): string {\n return (\n `Claude Code runs ${hooksOf(count)} only once you trust the folder, and will not ask here: ` +\n `set projects[${JSON.stringify(recordKey)}].hasTrustDialogAccepted to true in ` +\n `${claudeStateFile()}.`\n );\n}\n\nfunction hooksOf(count: number): string {\n return count === 1 ? \"1 sub-agent's hooks\" : `${count} sub-agents' hooks`;\n}\n\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/** Unreadable counts as untrusted: a wrong \"untrusted\" costs one line of advice. */\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\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\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 * A linked worktree (`.git` file pointing into `<main>/.git/worktrees/`, which points back) is\n * keyed by its main checkout; anything else by `root` itself.\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\nasync function pathRecordedIn(dir: string, file: string): Promise<string> {\n return path.resolve(dir, (await readFileOptional(path.join(dir, file))).trim());\n}\n\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\nasync function countProjectAgentsDeclaringHooks(projectDir: string): Promise<number> {\n const dir = agentsDir(\"claude\", \"project\", projectDir);\n const files = await glob(agentCodec(\"claude\").listGlob, dir);\n const agents = await Promise.all(files.map((file) => readFile(path.join(dir, file))));\n return agents.filter(declaresAHook).length;\n}\n\n/** An event with no definition runs nothing, so it is not a hook to warn about. */\nfunction declaresAHook(agentMarkdown: string): boolean {\n const frontmatter = declaredHooksSchema.safeParse(extractFrontmatter(agentMarkdown));\n return (\n frontmatter.success &&\n Object.values(frontmatter.data.hooks).some((definitions) => definitions.length > 0)\n );\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 * Codex reads `<project>/.codex/agents/*.toml` only while the GLOBAL `config.toml` holds\n * `[projects.\"<abs path>\"] trust_level = \"trusted\"`, failing silently otherwise. The install writes\n * that entry and says so, but never overrides a level the user already set.\n */\n\nconst TRUST_KEY = \"trust_level\";\nconst TRUSTED = \"trusted\";\nconst TRUST_ASSIGNMENT = `${TRUST_KEY} = \"${TRUSTED}\"`;\n\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 * Merged into the user's file, never rewritten: a second table for the same path would make Codex\n * refuse the whole file. `path.resolve` gives the one spelling Codex matches (no trailing slash).\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\nexport function codexProjectTrustMessage(\n projectDir: string,\n trust: CodexProjectTrust,\n): string | undefined {\n const table = projectTableHeader(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/** Hand-read, not TOML-parsed; any other spelling reads as untrusted, the safe direction. */\nfunction declaresTrust(config: string, projectDir: string): boolean {\n return linesForProject(config, projectDir).includes(TRUST_ASSIGNMENT);\n}\n\nconst TRUST_LEVEL_LINE = new RegExp(`^${TRUST_KEY}\\\\s*=\\\\s*\"([^\"]*)\"$`);\n\n/** The user's own `trust_level` for this project, which is never overwritten. */\nfunction declaredLevel(config: string, projectDir: string): string | undefined {\n return linesForProject(config, projectDir)\n .map((line) => TRUST_LEVEL_LINE.exec(line)?.[1])\n .find((level) => level !== undefined);\n}\n\n/** Trimmed: the lines under the project's table header, then its dotted keys with the prefix cut. */\nfunction linesForProject(config: string, projectDir: string): string[] {\n const lines = config.split(\"\\n\").map((line) => line.trim());\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 [...linesUnderProjectTable(lines, projectDir), ...dotted];\n}\n\nfunction linesUnderProjectTable(lines: readonly string[], projectDir: string): readonly string[] {\n const header = lines.indexOf(projectTableHeader(projectDir));\n if (header === -1) return [];\n\n const after = lines.slice(header + 1);\n const nextTable = after.findIndex(opensATable);\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\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), TRUST_ASSIGNMENT, ...lines.slice(header + 1)].join(\"\\n\");\n }\n\n const theirs = config.trimEnd();\n const table = `${projectTableHeader(projectDir)}\\n${TRUST_ASSIGNMENT}\\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/** Once per run, not per sub-agent or scope: each notice is true of the whole installation. */\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/** Only when role files exist: trusting a project with nothing for Codex to read grants nothing. */\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\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/** The one source `init` and `compile` share, so they cannot say different things. */\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,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AAS,KAAK,KAAK,MAAM,mBAAmB,UAAU,CAAC;AAEvF,MAAI,WAAW,IAAI;AACjB,WAAO,CAAC,GAAG,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,kBAAkB,GAAG,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,KAAK,IAAI;AAAA,EAChG;AAEA,QAAM,SAAS,OAAO,QAAQ;AAC9B,QAAM,QAAQ,GAAG,mBAAmB,UAAU,CAAC;AAAA,EAAK,gBAAgB;AAAA;AACpE,SAAO,WAAW,KAAK,QAAQ,GAAG,MAAM;AAAA;AAAA,EAAO,KAAK;AACtD;;;AChHA,eAAsB,oBACpB,UACA,YACmB;AACnB,MAAI,aAAa,QAAS,QAAO,CAAC;AAElC,SAAO;AAAA,IACL,4BAA4B;AAAA,IAC5B,4BAA4B;AAAA,IAC5B,GAAI,MAAM,YAAY,UAAU;AAAA,EAClC;AACF;AAGA,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;AAEA,eAAe,kBAAkB,YAAsC;AACrE,QAAM,QAAQ,MAAM,KAAK,WAAW,OAAO,EAAE,UAAU,UAAU,SAAS,WAAW,UAAU,CAAC;AAEhG,SAAO,MAAM,SAAS;AACxB;;;AC/BA,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
|
+
{"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 { extractFrontmatter } from \"../../utils/frontmatter.js\";\nimport type { Provider } from \"../../consts.js\";\n\n/**\n * Warns when Claude Code will drop a project sub-agent's hooks, on every event: project hooks run\n * only once `~/.claude.json` records `projects[<key>].hasTrustDialogAccepted`, keyed by the git\n * repository root (a linked worktree's main checkout). Reads that state, never writes it.\n */\n\nconst claudeStateSchema = z.object({ projects: z.record(z.string(), z.unknown()) });\n\nconst trustedProjectSchema = z.object({ hasTrustDialogAccepted: z.literal(true) });\n\n/** Claude Code reads only a top-level `hooks:` key: event name to its definitions. */\nconst declaredHooksSchema = z.object({ hooks: z.record(z.string(), z.array(z.unknown())) });\n\nconst GIT_ENTRY = \".git\";\nconst GITDIR_PREFIX = \"gitdir:\";\nconst COMMONDIR_FILE = \"commondir\";\nconst BACK_LINK_FILE = \"gitdir\";\nconst WORKTREES_DIR = \"worktrees\";\n\n/** \"never asks\": a folder above is trusted, so no prompt appears and only the record can fix it. */\ntype ClaudeTrust =\n | { readonly kind: \"trusted\" }\n | { readonly kind: \"asks\" }\n | { readonly kind: \"never asks\"; readonly recordKey: string };\n\ntype TrustRecord = (folder: string) => boolean;\n\n/** Empty from the home directory: `~/.claude/agents/` is trusted unconditionally. */\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 agentsWithHooks = await countProjectAgentsDeclaringHooks(projectDir);\n if (agentsWithHooks === 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, agentsWithHooks)];\n case \"never asks\":\n return [claudeProjectNeverAskedMessage(trust.recordKey, agentsWithHooks)];\n default: {\n const _exhaustive: never = trust;\n return _exhaustive;\n }\n }\n}\n\nexport function claudeProjectNeedsTrustMessage(projectDir: string, count: number): string {\n return (\n `Claude Code runs a project sub-agent's hooks only once you trust the folder: open Claude ` +\n `Code in ${projectDir} and accept the trust prompt. Until then, ${hooksOf(count)} will not ` +\n `run, and nothing will say so.`\n );\n}\n\nexport function claudeProjectNeverAskedMessage(recordKey: string, count: number): string {\n return (\n `Claude Code runs ${hooksOf(count)} only once you trust the folder, and will not ask here: ` +\n `set projects[${JSON.stringify(recordKey)}].hasTrustDialogAccepted to true in ` +\n `${claudeStateFile()}.`\n );\n}\n\nfunction hooksOf(count: number): string {\n return count === 1 ? \"1 sub-agent's hooks\" : `${count} sub-agents' hooks`;\n}\n\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/** Unreadable counts as untrusted: a wrong \"untrusted\" costs one line of advice. */\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\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\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 * A linked worktree (`.git` file pointing into `<main>/.git/worktrees/`, which points back) is\n * keyed by its main checkout; anything else by `root` itself.\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\nasync function pathRecordedIn(dir: string, file: string): Promise<string> {\n return path.resolve(dir, (await readFileOptional(path.join(dir, file))).trim());\n}\n\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\nasync function countProjectAgentsDeclaringHooks(projectDir: string): Promise<number> {\n const dir = agentsDir(\"claude\", \"project\", projectDir);\n const files = await glob(agentCodec(\"claude\").listGlob, dir);\n const agents = await Promise.all(files.map((file) => readFile(path.join(dir, file))));\n return agents.filter(declaresAHook).length;\n}\n\n/** An event with no definition runs nothing, so it is not a hook to warn about. */\nfunction declaresAHook(agentMarkdown: string): boolean {\n const frontmatter = declaredHooksSchema.safeParse(extractFrontmatter(agentMarkdown));\n return (\n frontmatter.success &&\n Object.values(frontmatter.data.hooks).some((definitions) => definitions.length > 0)\n );\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 * Codex reads `<project>/.codex/agents/*.toml` only while the GLOBAL `config.toml` holds\n * `[projects.\"<abs path>\"] trust_level = \"trusted\"`, failing silently otherwise. The install writes\n * that entry and says so, but never overrides a level the user already set.\n */\n\nconst TRUST_KEY = \"trust_level\";\nconst TRUSTED = \"trusted\";\nconst TRUST_ASSIGNMENT = `${TRUST_KEY} = \"${TRUSTED}\"`;\n\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 * Merged into the user's file, never rewritten: a second table for the same path would make Codex\n * refuse the whole file. `path.resolve` gives the one spelling Codex matches (no trailing slash).\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\nexport function codexProjectTrustMessage(\n projectDir: string,\n trust: CodexProjectTrust,\n): string | undefined {\n const table = projectTableHeader(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/** Hand-read, not TOML-parsed; any other spelling reads as untrusted, the safe direction. */\nfunction declaresTrust(config: string, projectDir: string): boolean {\n return linesForProject(config, projectDir).includes(TRUST_ASSIGNMENT);\n}\n\nconst TRUST_LEVEL_LINE = new RegExp(`^${TRUST_KEY}\\\\s*=\\\\s*\"([^\"]*)\"$`);\n\n/** The user's own `trust_level` for this project, which is never overwritten. */\nfunction declaredLevel(config: string, projectDir: string): string | undefined {\n return linesForProject(config, projectDir)\n .map((line) => TRUST_LEVEL_LINE.exec(line)?.[1])\n .find((level) => level !== undefined);\n}\n\n/** Trimmed: the lines under the project's table header, then its dotted keys with the prefix cut. */\nfunction linesForProject(config: string, projectDir: string): string[] {\n const lines = config.split(\"\\n\").map((line) => line.trim());\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 [...linesUnderProjectTable(lines, projectDir), ...dotted];\n}\n\nfunction linesUnderProjectTable(lines: readonly string[], projectDir: string): readonly string[] {\n const header = lines.indexOf(projectTableHeader(projectDir));\n if (header === -1) return [];\n\n const after = lines.slice(header + 1);\n const nextTable = after.findIndex(opensATable);\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\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), TRUST_ASSIGNMENT, ...lines.slice(header + 1)].join(\"\\n\");\n }\n\n const theirs = config.trimEnd();\n const table = `${projectTableHeader(projectDir)}\\n${TRUST_ASSIGNMENT}\\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/** Once per run, not per sub-agent or scope: each notice is true of the whole installation. */\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/** Only when role files exist: trusting a project with nothing for Codex to read grants nothing. */\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\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/** The one source `init` and `compile` share, so they cannot say different things. */\nexport async function hostCompileNotices(\n provider: Provider,\n projectDir: string,\n): Promise<string[]> {\n switch (provider) {\n case \"claude\":\n return claudeCompileNotices(provider, projectDir);\n case \"codex\":\n return codexCompileNotices(provider, projectDir);\n default: {\n const _exhaustive: never = provider;\n return _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1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
getLocalAgentDefinitions
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IXVGBUWI.js";
|
|
5
5
|
import {
|
|
6
6
|
loadMergedAgents
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-E45IT3HC.js";
|
|
8
8
|
|
|
9
9
|
// src/cli/lib/operations/project/load-agent-defs.ts
|
|
10
10
|
async function loadAgentDefs() {
|
|
@@ -20,4 +20,4 @@ async function loadAgentDefs() {
|
|
|
20
20
|
export {
|
|
21
21
|
loadAgentDefs
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-7BHDKEGK.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
seatCatalog
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WUSEZFER.js";
|
|
5
5
|
|
|
6
6
|
// src/cli/utils/string.ts
|
|
7
7
|
var OSC = /\u001B\][\s\S]*?(?:\u0007|\u001B\\|$)/;
|
|
@@ -9349,6 +9349,9 @@ function getSkillById(id) {
|
|
|
9349
9349
|
function getSkillDisplayName(id) {
|
|
9350
9350
|
return inertLine(matrix.skills[id]?.displayName ?? id);
|
|
9351
9351
|
}
|
|
9352
|
+
function getSkillEntryDisplayName(entry) {
|
|
9353
|
+
return entry.displayName === void 0 ? getSkillDisplayName(entry.id) : inertLine(entry.displayName);
|
|
9354
|
+
}
|
|
9352
9355
|
function getCategoryDomain(category) {
|
|
9353
9356
|
return matrix.categories[category]?.domain;
|
|
9354
9357
|
}
|
|
@@ -9378,10 +9381,11 @@ export {
|
|
|
9378
9381
|
initializeMatrix,
|
|
9379
9382
|
getSkillById,
|
|
9380
9383
|
getSkillDisplayName,
|
|
9384
|
+
getSkillEntryDisplayName,
|
|
9381
9385
|
getCategoryDomain,
|
|
9382
9386
|
typedEntries,
|
|
9383
9387
|
typedKeys,
|
|
9384
9388
|
typedFromEntries,
|
|
9385
9389
|
typedValues
|
|
9386
9390
|
};
|
|
9387
|
-
//# sourceMappingURL=chunk-
|
|
9391
|
+
//# sourceMappingURL=chunk-AIBVAYHS.js.map
|