@cleocode/caamp 2026.10.27 → 2026.11.1-canary.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -82,7 +82,7 @@ import {
82
82
  validateRecommendationCriteria,
83
83
  validateSkill,
84
84
  writeConfig
85
- } from "./chunk-I22NHDGG.js";
85
+ } from "./chunk-273JW7EU.js";
86
86
  import {
87
87
  EmbeddedDeliveryDowngradeError,
88
88
  HITL_REQUEST_FALLBACK,
@@ -142,7 +142,7 @@ import {
142
142
  resolveGlobalInstructionPath,
143
143
  resolveInstructionDelivery,
144
144
  writeAgentFileToAllProviders
145
- } from "./chunk-2RZGY4XT.js";
145
+ } from "./chunk-SM53FT2Y.js";
146
146
  import {
147
147
  JsonConfigParseError,
148
148
  assertNotTornRead,
@@ -195,6 +195,159 @@ import {
195
195
  } from "./chunk-5INWYMO4.js";
196
196
  import "./chunk-PZ5AY32C.js";
197
197
 
198
+ // src/core/agents/agent-definitions.ts
199
+ var AGENT_DEFINITION_MARKER = "# Generated by CLEO (cleo init / cleo upgrade). Edits are overwritten; copy the file under another name to customise.";
200
+ function parseQuoted(raw, key) {
201
+ const value = JSON.parse(raw);
202
+ if (typeof value !== "string") throw new Error(`agent definition: bad string for "${key}"`);
203
+ return value;
204
+ }
205
+ function parseValue(raw, key) {
206
+ const v = raw.trim();
207
+ if (v === "true") return true;
208
+ if (v === "false") return false;
209
+ if (v.startsWith('"')) return parseQuoted(v, key);
210
+ if (v.startsWith("[")) {
211
+ if (!v.endsWith("]")) throw new Error(`agent definition: unterminated list for "${key}"`);
212
+ return v.slice(1, -1).split(",").map((item) => item.trim()).filter((item) => item.length > 0).map((item) => item.startsWith('"') ? parseQuoted(item, key) : item);
213
+ }
214
+ return v;
215
+ }
216
+ function requireString(props, key) {
217
+ const value = props.get(key);
218
+ if (typeof value !== "string" || value.length === 0) {
219
+ throw new Error(`agent definition: "${key}" must be a non-empty string`);
220
+ }
221
+ return value;
222
+ }
223
+ function optionalList(props, key) {
224
+ const value = props.get(key);
225
+ if (value === void 0) return void 0;
226
+ if (!Array.isArray(value)) throw new Error(`agent definition: "${key}" must be a list`);
227
+ return value;
228
+ }
229
+ var KNOWN_KEYS = /* @__PURE__ */ new Set([
230
+ "role",
231
+ "description",
232
+ "prompt",
233
+ "tools",
234
+ "denied-tools",
235
+ "background"
236
+ ]);
237
+ function parseAgentDefinition(cant) {
238
+ const fm = cant.match(/^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/);
239
+ if (!fm || !/^kind:\s*agent\s*$/m.test(fm[1] ?? "")) {
240
+ throw new Error('agent definition: frontmatter with "kind: agent" is required');
241
+ }
242
+ const lines = (fm[2] ?? "").split("\n");
243
+ const start = lines.findIndex((l) => /^agent\s+[\w-]+:\s*$/.test(l));
244
+ if (start < 0) throw new Error('agent definition: no "agent <name>:" block');
245
+ const name = (lines[start] ?? "").replace(/^agent\s+/, "").replace(/:\s*$/, "");
246
+ const props = /* @__PURE__ */ new Map();
247
+ for (const line of lines.slice(start + 1)) {
248
+ if (line.trim() === "" || line.trim().startsWith("#")) continue;
249
+ if (!line.startsWith(" ")) break;
250
+ const m = line.match(/^ {2}([\w-]+):\s+(.+)$/);
251
+ if (!m) throw new Error(`agent definition: unsupported line "${line.trim()}"`);
252
+ const key = m[1] ?? "";
253
+ if (!KNOWN_KEYS.has(key)) throw new Error(`agent definition: unknown key "${key}"`);
254
+ props.set(key, parseValue(m[2] ?? "", key));
255
+ }
256
+ const role = requireString(props, "role");
257
+ if (role !== "lead" && role !== "worker") {
258
+ throw new Error(`agent definition: role must be "lead" or "worker", got "${role}"`);
259
+ }
260
+ const background = props.get("background");
261
+ if (background !== void 0 && typeof background !== "boolean") {
262
+ throw new Error('agent definition: "background" must be true or false');
263
+ }
264
+ const tools = optionalList(props, "tools");
265
+ const deniedTools = optionalList(props, "denied-tools");
266
+ return {
267
+ name,
268
+ role,
269
+ description: requireString(props, "description"),
270
+ prompt: requireString(props, "prompt"),
271
+ ...tools ? { tools } : {},
272
+ ...deniedTools ? { deniedTools } : {},
273
+ ...background !== void 0 ? { background } : {}
274
+ };
275
+ }
276
+ var OPENCODE_PERMISSION = {
277
+ Bash: "bash",
278
+ Edit: "edit",
279
+ Write: "edit",
280
+ MultiEdit: "edit",
281
+ NotebookEdit: "edit",
282
+ WebFetch: "webfetch",
283
+ WebSearch: "websearch"
284
+ };
285
+ function renderClaude(def) {
286
+ const fm = [
287
+ "---",
288
+ AGENT_DEFINITION_MARKER,
289
+ `name: ${def.name}`,
290
+ `description: ${JSON.stringify(def.description)}`
291
+ ];
292
+ if (def.tools) fm.push(`tools: ${JSON.stringify(def.tools.join(", "))}`);
293
+ if (def.deniedTools) fm.push(`disallowedTools: ${JSON.stringify(def.deniedTools.join(", "))}`);
294
+ if (def.background !== void 0) fm.push(`background: ${def.background}`);
295
+ const servers = Object.entries(def.mcpServers ?? {});
296
+ if (servers.length > 0) {
297
+ fm.push("mcpServers:");
298
+ for (const [name, server] of servers) {
299
+ fm.push(` - ${name}:`, " type: stdio");
300
+ fm.push(` command: ${JSON.stringify(server.command)}`);
301
+ fm.push(` args: ${JSON.stringify(server.args)}`);
302
+ }
303
+ }
304
+ fm.push("---");
305
+ return `${fm.join("\n")}
306
+
307
+ ${def.prompt}
308
+ `;
309
+ }
310
+ function agentDefinitionUnsupportedReason(def, format) {
311
+ if (format === "claude-code") return void 0;
312
+ if (def.tools || Object.keys(def.mcpServers ?? {}).length > 0) {
313
+ return "OpenCode agent files cannot restrict tools to an allow-list or declare per-agent MCP servers";
314
+ }
315
+ return void 0;
316
+ }
317
+ function renderOpenCode(def) {
318
+ const unsupported = agentDefinitionUnsupportedReason(def, "opencode");
319
+ if (unsupported) throw new Error(`agent definition "${def.name}": ${unsupported}`);
320
+ const fm = [
321
+ "---",
322
+ AGENT_DEFINITION_MARKER,
323
+ `description: ${JSON.stringify(def.description)}`,
324
+ // A lead converses with the owner (primary); a worker is dispatched (subagent).
325
+ `mode: ${def.role === "lead" ? "primary" : "subagent"}`
326
+ ];
327
+ const keys = /* @__PURE__ */ new Set();
328
+ for (const tool of def.deniedTools ?? []) {
329
+ const key = OPENCODE_PERMISSION[tool];
330
+ if (!key) throw new Error(`agent definition: no OpenCode permission gates "${tool}"`);
331
+ keys.add(key);
332
+ }
333
+ if (keys.size > 0) {
334
+ fm.push("permission:");
335
+ for (const key of [...keys].sort()) fm.push(` ${key}: deny`);
336
+ }
337
+ fm.push("---");
338
+ return `${fm.join("\n")}
339
+
340
+ ${def.prompt}
341
+ `;
342
+ }
343
+ function renderAgentDefinition(def, format) {
344
+ const content = format === "claude-code" ? renderClaude(def) : renderOpenCode(def);
345
+ return { fileName: `${def.name}.md`, content };
346
+ }
347
+ function isGeneratedAgentDefinition(content) {
348
+ return content.includes(AGENT_DEFINITION_MARKER);
349
+ }
350
+
198
351
  // src/core/artifacts/validation.ts
199
352
  import { posix } from "path";
200
353
  var CLEO_ARTIFACT_BUDGETS = Object.freeze({
@@ -535,7 +688,7 @@ function shouldOverrideSkill(skillName, incomingSource, existingEntry) {
535
688
  return true;
536
689
  }
537
690
  async function validateInstructionIntegrity(providers, projectDir, scope, expectedContent) {
538
- const { checkAllInjections: checkAllInjections2 } = await import("./injector-3SMMI2FO.js");
691
+ const { checkAllInjections: checkAllInjections2 } = await import("./injector-QYCEN5H2.js");
539
692
  const results = await checkAllInjections2(providers, projectDir, scope, expectedContent);
540
693
  const issues = [];
541
694
  for (const result of results) {
@@ -562,6 +715,7 @@ async function validateInstructionIntegrity(providers, projectDir, scope, expect
562
715
  return issues;
563
716
  }
564
717
  export {
718
+ AGENT_DEFINITION_MARKER,
565
719
  CANONICAL_HOOK_EVENTS,
566
720
  CLEO_ARTIFACT_BUDGETS,
567
721
  CLEO_ARTIFACT_REQUIREMENTS,
@@ -579,6 +733,7 @@ export {
579
733
  RECOMMENDATION_ERROR_CODES,
580
734
  SkillInstallError,
581
735
  _resetPlatformPathsCache,
736
+ agentDefinitionUnsupportedReason,
582
737
  assertCleoShippedBuildShape,
583
738
  assertNotTornRead,
584
739
  blockPattern,
@@ -681,6 +836,7 @@ export {
681
836
  isCaampOwnedSkill,
682
837
  isEmbeddedDelivery,
683
838
  isExclusivityMode,
839
+ isGeneratedAgentDefinition,
684
840
  isHomeProject,
685
841
  isMarketplaceScoped,
686
842
  isQuiet,
@@ -692,6 +848,7 @@ export {
692
848
  mergeBlockBodies,
693
849
  normalizeMarkers,
694
850
  normalizeRecommendationCriteria,
851
+ parseAgentDefinition,
695
852
  parseBlocks,
696
853
  parseCaampBlocks,
697
854
  parseInjectionContent,
@@ -712,6 +869,7 @@ export {
712
869
  removeMcpServerFromAll,
713
870
  removeSkill,
714
871
  removeSkillFromLock,
872
+ renderAgentDefinition,
715
873
  repairContent,
716
874
  repairInstructionFiles,
717
875
  replaceDirectoryFromSource,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/artifacts/validation.ts","../src/core/skills/integrity.ts"],"sourcesContent":["/**\n * Pure semantic validation of npm-produced package inventories.\n *\n * Code placed in `packages/caamp/` per Package-Boundary Check — verified\n * against AGENTS.md. No filesystem, process, model, or runtime-store access.\n */\n\nimport { posix } from 'node:path';\nimport type {\n PackageArtifactBudgets,\n PackageArtifactFile,\n PackageArtifactInventory,\n PackageArtifactIssue,\n PackageArtifactPolicy,\n PackageArtifactRequirement,\n PackageArtifactValidation,\n PackageFilesEntry,\n} from '@cleocode/contracts/package-artifact';\n\n/** Existing CLI upper budgets: 20 MiB packed, 36 MiB unpacked, and 800 files. */\nexport const CLEO_ARTIFACT_BUDGETS: Readonly<PackageArtifactBudgets> = Object.freeze({\n packedBytes: 20 * 1024 * 1024,\n unpackedBytes: 36 * 1024 * 1024,\n fileCount: 800,\n});\n\n/**\n * The JavaScript files `build.mjs` declares for the published CLI: the CLI\n * bundle, the provider hook runtime that `bin/cleo.js` imports directly for\n * `cleo hook heavy-command` (T12983), skipping the CLI bootstrap, and the\n * detached dist-tags check the CLI spawns for its update notice (T13137), and\n * the shared project-hook adapter hot path (T13344). Any\n * other `.js` under `dist/` is development output.\n */\nconst CLEO_SHIPPED_JS_ENTRIES: ReadonlySet<string> = new Set([\n 'dist/cli/index.js',\n 'dist/cli/hook-entry.js',\n 'dist/cli/update-check-entry.js',\n 'dist/cli/project-hook-entry.js',\n]);\n\n/**\n * A code-split chunk of the CLI bundle (T13126): `dist/cli/<name>-<HASH>.js`,\n * where `<HASH>` is esbuild's 8-character content hash.\n *\n * `build.mjs` bundles the CLI with `splitting` so each `import()` loads its own\n * chunk instead of the whole CLI and all of CORE at startup. Its\n * `CLEO_CHUNK_NAMES` (`cli/[name]-[hash]`) writes every chunk directly beside\n * `cli/index.js`; change both together. A chunk in any other directory is not\n * build output and stays rejected. `<name>` is the source file's basename in\n * any case (T13159): a source file named `TaskCard.ts` must not fail the\n * artifact check.\n */\nexport const CLEO_CLI_CHUNK_PATTERN: RegExp = /^dist\\/cli\\/[A-Za-z0-9_.-]+-[A-Z0-9]{8}\\.js$/;\n\n/** Required CLI and adapter-node resources, independent of historical byte/file-count floors. */\nexport const CLEO_ARTIFACT_REQUIREMENTS: readonly PackageArtifactRequirement[] = Object.freeze([\n { id: 'cli-entry', path: 'dist/cli/index.js', match: 'exact' },\n { id: 'cli-hook-entry', path: 'dist/cli/hook-entry.js', match: 'exact' },\n { id: 'cli-update-check-entry', path: 'dist/cli/update-check-entry.js', match: 'exact' },\n { id: 'cli-project-hook-entry', path: 'dist/cli/project-hook-entry.js', match: 'exact' },\n { id: 'studio-server-entry', path: 'studio-dist/index.js', match: 'exact' },\n { id: 'studio-handler', path: 'studio-dist/handler.js', match: 'exact' },\n { id: 'studio-server', path: 'studio-dist/server/index.js', match: 'exact' },\n { id: 'studio-manifest', path: 'studio-dist/server/manifest.js', match: 'exact' },\n {\n id: 'studio-client-start',\n path: 'studio-dist/client/_app/immutable/entry/start.*.js',\n match: 'glob',\n },\n {\n id: 'studio-client-app',\n path: 'studio-dist/client/_app/immutable/entry/app.*.js',\n match: 'glob',\n },\n]);\n\nconst SHA256 = /^[a-f0-9]{64}$/;\nconst GLOB = /[*?{}[\\]]|[+@!]\\(/;\n\nfunction pathProblem(path: string): string | null {\n if (!path || path.trim() !== path) return 'Path is empty or has surrounding whitespace.';\n if (path.includes('\\\\') || /[\\x00-\\x1f\\x7f]/.test(path))\n return 'Path is not a portable POSIX package path.';\n if (posix.isAbsolute(path) || /^[A-Za-z]:/.test(path))\n return 'Path must be relative to the package.';\n if (path.split('/').some((part) => !part || part === '.' || part === '..')) {\n return 'Path must not contain empty, current-directory, or parent-directory segments.';\n }\n return null;\n}\n\n/**\n * Classify a manifest files entry without evaluating exclusions as disk paths.\n *\n * @param entry - Original npm manifest entry.\n * @returns Classification only; actual selected content must come from the packer.\n * @example\n * ```ts\n * classifyPackageFilesEntry('!dist/index.js.map').kind; // 'exclusion'\n * ```\n */\nexport function classifyPackageFilesEntry(entry: string): PackageFilesEntry {\n const exclusion = entry.startsWith('!');\n const pattern = (exclusion ? entry.slice(1) : entry).replace(/^\\.\\//, '').replace(/\\/$/, '');\n const reason = pattern.startsWith('!')\n ? 'Repeated exclusion markers are not assessed.'\n : pathProblem(pattern);\n return {\n entry,\n pattern,\n kind: reason ? 'invalid' : exclusion ? 'exclusion' : GLOB.test(pattern) ? 'glob' : 'literal',\n reason,\n };\n}\n\nfunction fileProblems(file: PackageArtifactFile): string[] {\n const problems: string[] = [];\n const pathError = pathProblem(file.path);\n if (pathError) problems.push(pathError);\n if (!Number.isSafeInteger(file.size) || file.size < 0)\n problems.push('File size must be a nonnegative safe integer.');\n if (file.sha256 !== undefined && !SHA256.test(file.sha256))\n problems.push('File SHA-256 must be 64 lowercase hexadecimal characters.');\n return problems;\n}\n\n/**\n * Validate nonempty semantic resources, inventory identity, expected hashes and upper budgets.\n *\n * @param inventory - Packer-produced evidence or an explicitly identified fixture.\n * @param policy - Independently specified resources, expected files and cost ceilings.\n * @returns A copied evidence receipt; valid means only the supplied checks passed.\n * @example\n * ```ts\n * const result = validatePackageArtifact(inventory, {\n * requirements: CLEO_ARTIFACT_REQUIREMENTS,\n * budgets: CLEO_ARTIFACT_BUDGETS,\n * });\n * // result.runtime remains 'not-assessed', even when result.valid is true.\n * ```\n */\nexport function validatePackageArtifact(\n inventory: PackageArtifactInventory,\n policy: PackageArtifactPolicy,\n): PackageArtifactValidation {\n const issues: PackageArtifactIssue[] = [];\n const add = (code: PackageArtifactIssue['code'], subject: string, message: string): void => {\n issues.push({ code, subject, message });\n };\n if (!inventory.packageName.trim() || !inventory.version.trim()) {\n add('invalid-inventory', 'identity', 'Package name and version must be recorded.');\n }\n if (!['npm-pack', 'npm-pack-dry-run', 'fixture'].includes(inventory.source)) {\n add('invalid-inventory', 'source', 'Inventory provenance is not recognized.');\n }\n if (!Number.isSafeInteger(inventory.packedBytes) || inventory.packedBytes < 0) {\n add('invalid-inventory', 'packedBytes', 'Packed bytes must be a nonnegative safe integer.');\n }\n if (inventory.tarballSha256 !== undefined && !SHA256.test(inventory.tarballSha256)) {\n add(\n 'invalid-inventory',\n 'tarballSha256',\n 'Tarball SHA-256 must be 64 lowercase hexadecimal characters.',\n );\n }\n if (inventory.source === 'npm-pack-dry-run' && inventory.tarballSha256 !== undefined) {\n add(\n 'invalid-inventory',\n 'tarballSha256',\n 'A dry run cannot establish a retained tarball hash.',\n );\n }\n const files = new Map<string, PackageArtifactFile>();\n let unpackedBytes: number | null = 0;\n for (const file of inventory.files) {\n for (const problem of fileProblems(file)) add('invalid-inventory', file.path, problem);\n if (files.has(file.path)) add('invalid-inventory', file.path, 'Duplicate inventory path.');\n files.set(file.path, file);\n if (unpackedBytes !== null) {\n const total: number = unpackedBytes + file.size;\n unpackedBytes = Number.isSafeInteger(total) && file.size >= 0 ? total : null;\n }\n }\n if (unpackedBytes === null)\n add('invalid-inventory', 'unpackedBytes', 'File bytes cannot be safely totaled.');\n const entries = (policy.filesEntries ?? []).map(classifyPackageFilesEntry);\n for (const entry of entries) {\n if (entry.reason) add('invalid-policy', entry.entry, entry.reason);\n }\n if (!policy.requirements.length)\n add('invalid-policy', 'requirements', 'At least one semantic content requirement is required.');\n const ids = new Set<string>();\n const requirements = policy.requirements.map((requirement) => {\n const invalid = pathProblem(requirement.path);\n const duplicate = ids.has(requirement.id);\n ids.add(requirement.id);\n if (\n !requirement.id.trim() ||\n duplicate ||\n invalid ||\n !['exact', 'glob'].includes(requirement.match)\n ) {\n add(\n 'invalid-policy',\n requirement.id,\n invalid ?? 'Requirement identity or match mode is invalid or duplicated.',\n );\n return { id: requirement.id, matchedPaths: [], satisfied: false };\n }\n const matches = inventory.files.filter((file) =>\n requirement.match === 'exact'\n ? file.path === requirement.path\n : posix.matchesGlob(file.path, requirement.path),\n );\n if (!matches.length)\n add(\n 'missing',\n requirement.id,\n `Required resource ${requirement.path} is absent from the selected inventory.`,\n );\n for (const file of matches) {\n if (file.size === 0) add('empty', file.path, `Required resource ${requirement.id} is empty.`);\n }\n return {\n id: requirement.id,\n matchedPaths: matches.map((file) => file.path),\n satisfied: matches.length > 0 && matches.every((file) => file.size > 0),\n };\n });\n for (const pattern of policy.forbiddenPatterns ?? []) {\n const invalid = pathProblem(pattern);\n if (invalid) {\n add('invalid-policy', pattern, invalid);\n continue;\n }\n for (const file of inventory.files) {\n if (posix.matchesGlob(file.path, pattern))\n add('forbidden', file.path, `Selected file matches forbidden pattern ${pattern}.`);\n }\n }\n let hashComparison: PackageArtifactValidation['hashComparison'] = 'not-requested';\n for (const expected of policy.expectedFiles ?? []) {\n const problems = fileProblems(expected);\n for (const problem of problems) add('invalid-policy', expected.path, problem);\n const actual = files.get(expected.path);\n if (!actual) add('missing', expected.path, 'An independently expected file is missing.');\n else if (actual.size !== expected.size)\n add('mismatch', expected.path, 'File bytes differ from independently expected inventory.');\n if (expected.sha256 !== undefined) {\n if (hashComparison !== 'failed') hashComparison = 'matched';\n if (problems.length || actual?.sha256 !== expected.sha256) {\n hashComparison = 'failed';\n add(\n 'mismatch',\n expected.path,\n 'Actual hash is missing or differs from the independently expected SHA-256.',\n );\n }\n }\n }\n for (const [field, limit] of Object.entries(policy.budgets)) {\n if (!Number.isSafeInteger(limit) || limit < 0)\n add('invalid-policy', field, 'Budget must be a nonnegative safe integer.');\n }\n if (inventory.packedBytes > policy.budgets.packedBytes)\n add('budget', 'packedBytes', 'Packed bytes exceed the configured upper budget.');\n if (unpackedBytes !== null && unpackedBytes > policy.budgets.unpackedBytes)\n add('budget', 'unpackedBytes', 'Unpacked bytes exceed the configured upper budget.');\n if (inventory.files.length > policy.budgets.fileCount)\n add('budget', 'fileCount', 'Selected file count exceeds the configured upper budget.');\n return {\n valid: issues.length === 0,\n inventory: { ...inventory, files: inventory.files.map((file) => ({ ...file })) },\n unpackedBytes,\n issues,\n filesEntries: entries,\n requirements,\n hashComparison,\n runtime: 'not-assessed',\n limitations: [\n 'Manifest entries are classified only; the supplied packer inventory is the content authority.',\n 'Hashes are recorded and compared to supplied expected evidence; this validator does not read or authenticate tarball bytes.',\n 'Installability, module/dependency resolution, local-reference closure and native/dynamic runtime behavior are not assessed.',\n ],\n };\n}\n\n/**\n * Reject declaration and stray JavaScript output absent from the published CLI\n * bundle: only `build.mjs`'s declared entries (the CLI bundle and the hook\n * runtime) and their code-split chunks ({@link CLEO_CLI_CHUNK_PATTERN}) may ship\n * as `.js` under `dist/`.\n *\n * @param files - Actual selected package files, not a development directory listing.\n * @returns Concrete build-shape failures; this does not load the bundle.\n * @example\n * ```ts\n * assertCleoShippedBuildShape([{ path: 'dist/cli/index.js', size: 1 }]); // []\n * ```\n */\nexport function assertCleoShippedBuildShape(files: readonly PackageArtifactFile[]): string[] {\n const reasons: string[] = [];\n const dist = files.filter((file) => file.path.startsWith('dist/'));\n const declarations = dist.filter(\n (file) => file.path.endsWith('.d.ts') || file.path.endsWith('.d.ts.map'),\n );\n if (declarations.length)\n reasons.push(\n `${declarations.length} declaration file(s) under dist/ — the esbuild bundle emits none`,\n );\n const stray = dist.filter(\n (file) =>\n file.path.endsWith('.js') &&\n !CLEO_SHIPPED_JS_ENTRIES.has(file.path) &&\n !CLEO_CLI_CHUNK_PATTERN.test(file.path),\n );\n if (stray.length)\n reasons.push(\n `${stray.length} .js file(s) under dist/ outside the declared entries ${[...CLEO_SHIPPED_JS_ENTRIES].join(', ')} and their chunks, e.g. ${stray[0]?.path}`,\n );\n return reasons;\n}\n","/**\n * Skill integrity checking\n *\n * Validates that installed skills have intact symlinks, correct canonical paths,\n * and enforces ct-* prefix priority for CAAMP-shipped skills.\n */\n\nimport { existsSync, lstatSync, readlinkSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport { resolveSkillsRoot } from '@cleocode/core/skills/skill-root.js';\nimport type { LockEntry, Provider } from '../../types.js';\nimport { readLockFile } from '../lock-utils.js';\nimport { resolveProviderSkillsDirs } from '../paths/standard.js';\n\n/** CAAMP-reserved skill prefix. Skills with this prefix are owned by CAAMP. */\nconst CAAMP_SKILL_PREFIX = 'ct-';\n\n/**\n * Status of a single skill's integrity check.\n *\n * @public\n */\nexport type SkillIntegrityStatus =\n | 'intact'\n | 'broken-symlink'\n | 'missing-canonical'\n | 'missing-link'\n | 'not-tracked'\n | 'tampered';\n\n/**\n * Result of checking a single skill's integrity.\n *\n * @public\n */\nexport interface SkillIntegrityResult {\n /** Skill name. */\n name: string;\n /** Overall integrity status. */\n status: SkillIntegrityStatus;\n /** Whether the canonical directory exists. */\n canonicalExists: boolean;\n /** Expected canonical path from lock file. */\n canonicalPath: string | null;\n /** Provider link statuses — which agents have valid symlinks. */\n linkStatuses: Array<{\n providerId: string;\n linkPath: string;\n exists: boolean;\n isSymlink: boolean;\n pointsToCanonical: boolean;\n }>;\n /** Whether this is a CAAMP-reserved (ct-*) skill. */\n isCaampOwned: boolean;\n /** Human-readable issue description, if any. */\n issue?: string;\n}\n\n/**\n * Check whether a skill name is reserved by CAAMP (ct-* prefix).\n *\n * @remarks\n * Skills with the `ct-` prefix are considered CAAMP-owned and receive\n * special treatment during installation conflict resolution.\n *\n * @param skillName - Skill name to check\n * @returns `true` if the skill name starts with `ct-`\n *\n * @example\n * ```typescript\n * isCaampOwnedSkill(\"ct-research-agent\"); // true\n * isCaampOwnedSkill(\"my-custom-skill\"); // false\n * ```\n *\n * @public\n */\nexport function isCaampOwnedSkill(skillName: string): boolean {\n return skillName.startsWith(CAAMP_SKILL_PREFIX);\n}\n\n/**\n * Check the integrity of a single installed skill.\n *\n * @remarks\n * Validates that the canonical directory exists on disk, the lock file entry\n * matches the actual state, and symlinks from provider skill directories\n * point to the canonical path.\n *\n * @param skillName - Name of the skill to check\n * @param providers - Providers to check symlinks for\n * @param scope - Whether to check global or project links\n * @param projectDir - Project directory (for project scope)\n * @returns Integrity check result\n *\n * @example\n * ```typescript\n * const result = await checkSkillIntegrity(\"ct-research-agent\", providers, \"global\");\n * if (result.status !== \"intact\") {\n * console.log(`Issue: ${result.issue}`);\n * }\n * ```\n *\n * @public\n */\nexport async function checkSkillIntegrity(\n skillName: string,\n providers: Provider[],\n scope: 'global' | 'project' = 'global',\n projectDir?: string,\n): Promise<SkillIntegrityResult> {\n const lock = await readLockFile();\n const entry = lock.skills[skillName];\n const isCaampOwned = isCaampOwnedSkill(skillName);\n\n // Not tracked in lock file\n if (!entry) {\n const canonicalPath = join(resolveSkillsRoot(), skillName);\n return {\n name: skillName,\n status: 'not-tracked',\n canonicalExists: existsSync(canonicalPath),\n canonicalPath: null,\n linkStatuses: [],\n isCaampOwned,\n issue: 'Skill is not tracked in the CAAMP lock file',\n };\n }\n\n const canonicalPath = entry.canonicalPath;\n const canonicalExists = existsSync(canonicalPath);\n\n // Check symlinks for each provider\n const linkStatuses: SkillIntegrityResult['linkStatuses'] = [];\n\n for (const provider of providers) {\n const targetDirs = resolveProviderSkillsDirs(provider, scope, projectDir);\n for (const skillsDir of targetDirs) {\n if (!skillsDir) continue;\n\n const linkPath = join(skillsDir, skillName);\n const exists = existsSync(linkPath);\n let isSymlink = false;\n let pointsToCanonical = false;\n\n if (exists) {\n try {\n const stat = lstatSync(linkPath);\n isSymlink = stat.isSymbolicLink();\n if (isSymlink) {\n const target = resolve(readlinkSync(linkPath));\n pointsToCanonical = target === resolve(canonicalPath);\n }\n } catch {\n // Can't stat — treat as broken\n }\n }\n\n linkStatuses.push({\n providerId: provider.id,\n linkPath,\n exists,\n isSymlink,\n pointsToCanonical,\n });\n }\n }\n\n // Determine overall status\n if (!canonicalExists) {\n return {\n name: skillName,\n status: 'missing-canonical',\n canonicalExists,\n canonicalPath,\n linkStatuses,\n isCaampOwned,\n issue: `Canonical directory missing: ${canonicalPath}`,\n };\n }\n\n const brokenLinks = linkStatuses.filter((l) => !l.exists);\n const tamperedLinks = linkStatuses.filter((l) => l.exists && !l.pointsToCanonical);\n\n if (tamperedLinks.length > 0) {\n return {\n name: skillName,\n status: 'tampered',\n canonicalExists,\n canonicalPath,\n linkStatuses,\n isCaampOwned,\n issue: `${tamperedLinks.length} link(s) do not point to canonical path`,\n };\n }\n\n if (brokenLinks.length > 0) {\n return {\n name: skillName,\n status: 'broken-symlink',\n canonicalExists,\n canonicalPath,\n linkStatuses,\n isCaampOwned,\n issue: `${brokenLinks.length} symlink(s) missing`,\n };\n }\n\n return {\n name: skillName,\n status: 'intact',\n canonicalExists,\n canonicalPath,\n linkStatuses,\n isCaampOwned,\n };\n}\n\n/**\n * Check integrity of all tracked skills.\n *\n * @remarks\n * Iterates over every skill in the lock file and runs\n * {@link checkSkillIntegrity} on each.\n *\n * @param providers - Providers to check symlinks for\n * @param scope - Whether to check global or project links\n * @param projectDir - Project directory (for project scope)\n * @returns Map of skill name to integrity result\n *\n * @example\n * ```typescript\n * const results = await checkAllSkillIntegrity(providers);\n * for (const [name, result] of results) {\n * console.log(`${name}: ${result.status}`);\n * }\n * ```\n *\n * @public\n */\nexport async function checkAllSkillIntegrity(\n providers: Provider[],\n scope: 'global' | 'project' = 'global',\n projectDir?: string,\n): Promise<Map<string, SkillIntegrityResult>> {\n const lock = await readLockFile();\n const results = new Map<string, SkillIntegrityResult>();\n\n for (const skillName of Object.keys(lock.skills)) {\n const result = await checkSkillIntegrity(skillName, providers, scope, projectDir);\n results.set(skillName, result);\n }\n\n return results;\n}\n\n/**\n * Resolve a skill name conflict where a user-installed skill collides\n * with a CAAMP-owned (ct-*) skill.\n *\n * @remarks\n * CAAMP-owned skills always win. Returns `true` if the incoming skill\n * should take precedence over the existing installation.\n *\n * @param skillName - Skill name to check\n * @param incomingSource - Source of the incoming skill installation\n * @param existingEntry - Existing lock entry, if any\n * @returns `true` if the incoming installation should proceed\n *\n * @example\n * ```typescript\n * const proceed = shouldOverrideSkill(\"ct-research-agent\", \"library\", existingEntry);\n * if (proceed) {\n * // Safe to install/override\n * }\n * ```\n *\n * @public\n */\nexport function shouldOverrideSkill(\n skillName: string,\n incomingSource: string,\n existingEntry: LockEntry | undefined,\n): boolean {\n // No existing entry — always allow\n if (!existingEntry) return true;\n\n // For ct-* skills, CAAMP package source always wins\n if (isCaampOwnedSkill(skillName)) {\n // If incoming is from CAAMP package (library source), it always wins\n if (existingEntry.sourceType === 'library') return true;\n // If existing is from CAAMP but incoming is user, CAAMP wins (block user)\n return true;\n }\n\n // Non-ct-* skills: user always wins\n return true;\n}\n\n/**\n * Validate instruction file injection status across all providers.\n *\n * @remarks\n * Checks that CAAMP blocks exist and are current in all relevant\n * instruction files (CLAUDE.md, AGENTS.md, GEMINI.md).\n *\n * @param providers - Providers to check\n * @param projectDir - Project directory\n * @param scope - Whether to check global or project files\n * @param expectedContent - Expected CAAMP block content\n * @returns Array of file paths with issues\n *\n * @example\n * ```typescript\n * const issues = await validateInstructionIntegrity(providers, process.cwd(), \"project\");\n * for (const issue of issues) {\n * console.log(`${issue.providerId}: ${issue.issue} (${issue.file})`);\n * }\n * ```\n *\n * @public\n */\nexport async function validateInstructionIntegrity(\n providers: Provider[],\n projectDir: string,\n scope: 'project' | 'global',\n expectedContent?: string,\n): Promise<Array<{ file: string; providerId: string; issue: string }>> {\n const { checkAllInjections } = await import('../instructions/injector.js');\n const results = await checkAllInjections(providers, projectDir, scope, expectedContent);\n const issues: Array<{ file: string; providerId: string; issue: string }> = [];\n\n for (const result of results) {\n if (result.status === 'missing') {\n issues.push({\n file: result.file,\n providerId: result.provider,\n issue: 'Instruction file does not exist',\n });\n } else if (result.status === 'none') {\n issues.push({\n file: result.file,\n providerId: result.provider,\n issue: 'No CAAMP injection block found',\n });\n } else if (result.status === 'outdated') {\n issues.push({\n file: result.file,\n providerId: result.provider,\n issue: 'CAAMP injection block is outdated',\n });\n }\n }\n\n return issues;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAAS,aAAa;AAaf,IAAM,wBAA0D,OAAO,OAAO;AAAA,EACnF,aAAa,KAAK,OAAO;AAAA,EACzB,eAAe,KAAK,OAAO;AAAA,EAC3B,WAAW;AACb,CAAC;AAUD,IAAM,0BAA+C,oBAAI,IAAI;AAAA,EAC3D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAcM,IAAM,yBAAiC;AAGvC,IAAM,6BAAoE,OAAO,OAAO;AAAA,EAC7F,EAAE,IAAI,aAAa,MAAM,qBAAqB,OAAO,QAAQ;AAAA,EAC7D,EAAE,IAAI,kBAAkB,MAAM,0BAA0B,OAAO,QAAQ;AAAA,EACvE,EAAE,IAAI,0BAA0B,MAAM,kCAAkC,OAAO,QAAQ;AAAA,EACvF,EAAE,IAAI,0BAA0B,MAAM,kCAAkC,OAAO,QAAQ;AAAA,EACvF,EAAE,IAAI,uBAAuB,MAAM,wBAAwB,OAAO,QAAQ;AAAA,EAC1E,EAAE,IAAI,kBAAkB,MAAM,0BAA0B,OAAO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QAAM,SAAqE,CAAC;AAE5E,aAAW,UAAU,SAAS;AAC5B,QAAI,OAAO,WAAW,WAAW;AAC/B,aAAO,KAAK;AAAA,QACV,MAAM,OAAO;AAAA,QACb,YAAY,OAAO;AAAA,QACnB,OAAO;AAAA,MACT,CAAC;AAAA,IACH,WAAW,OAAO,WAAW,QAAQ;AACnC,aAAO,KAAK;AAAA,QACV,MAAM,OAAO;AAAA,QACb,YAAY,OAAO;AAAA,QACnB,OAAO;AAAA,MACT,CAAC;AAAA,IACH,WAAW,OAAO,WAAW,YAAY;AACvC,aAAO,KAAK;AAAA,QACV,MAAM,OAAO;AAAA,QACb,YAAY,OAAO;AAAA,QACnB,OAAO;AAAA,MACT,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AACT;","names":["canonicalPath","checkAllInjections"]}
1
+ {"version":3,"sources":["../src/core/agents/agent-definitions.ts","../src/core/artifacts/validation.ts","../src/core/skills/integrity.ts"],"sourcesContent":["/**\n * Canonical agent definitions rendered into provider agent files (T14378).\n *\n * The canonical lead and worker live as `.cant` files in `@cleocode/agents`\n * (`definitions/`). They use a flat subset of the CANT agent grammar: one\n * `agent <name>:` block whose properties are single-line `key: value` pairs\n * (quoted strings, `true`/`false`, or `[a, b]` lists). This reader needs no\n * native addon, so delivery works on every OS and in any project.\n *\n * Each provider that loads project agent files declares where and in which\n * format in the registry (`agentDefinitions`); this module renders one\n * definition into that format.\n *\n * @task T14378\n * @epic T14351\n */\n\nimport type { AgentDefinitionFormat } from '../registry/types.js';\n\n/**\n * A canonical agent definition read from a `.cant` file.\n *\n * @public\n */\nexport interface AgentDefinition {\n /** Agent name (kebab-case); also the rendered file's base name. */\n name: string;\n /** Declared role: `lead` agents talk to the owner and dispatch; `worker` agents do the work. */\n role: 'lead' | 'worker';\n /** When the harness should use this agent. */\n description: string;\n /** System prompt. */\n prompt: string;\n /** Tool allowlist; absent means every tool the harness offers. */\n tools?: string[];\n /** Tools the agent must never get, removed even when inherited. */\n deniedTools?: string[];\n /** Whether the agent always runs as a background task. */\n background?: boolean;\n /**\n * MCP stdio servers started for this agent only, keyed by server name.\n * Set by delivery (the lead's command runner, T14374), not by `.cant` files.\n */\n mcpServers?: Record<string, AgentMcpServer>;\n}\n\n/**\n * An MCP stdio server an agent definition starts for itself.\n *\n * @public\n */\nexport interface AgentMcpServer {\n /** Executable to start. */\n command: string;\n /** Arguments, passed without a shell. */\n args: string[];\n}\n\n/**\n * A rendered provider agent file.\n *\n * @public\n */\nexport interface RenderedAgentDefinition {\n /** File name inside the provider's agent directory. */\n fileName: string;\n /** Full file content. */\n content: string;\n}\n\n/**\n * Line CAAMP writes into every agent file it renders. A file without it is\n * owned by the user and is never overwritten.\n *\n * @public\n */\nexport const AGENT_DEFINITION_MARKER =\n '# Generated by CLEO (cleo init / cleo upgrade). Edits are overwritten; copy the file under another name to customise.';\n\ntype CantValue = string | boolean | string[];\n\n/** Decode a double-quoted CANT string (JSON string escapes). */\nfunction parseQuoted(raw: string, key: string): string {\n const value: unknown = JSON.parse(raw);\n if (typeof value !== 'string') throw new Error(`agent definition: bad string for \"${key}\"`);\n return value;\n}\n\n/** Parse one single-line CANT property value. */\nfunction parseValue(raw: string, key: string): CantValue {\n const v = raw.trim();\n if (v === 'true') return true;\n if (v === 'false') return false;\n if (v.startsWith('\"')) return parseQuoted(v, key);\n if (v.startsWith('[')) {\n if (!v.endsWith(']')) throw new Error(`agent definition: unterminated list for \"${key}\"`);\n return v\n .slice(1, -1)\n .split(',')\n .map((item) => item.trim())\n .filter((item) => item.length > 0)\n .map((item) => (item.startsWith('\"') ? parseQuoted(item, key) : item));\n }\n return v;\n}\n\nfunction requireString(props: Map<string, CantValue>, key: string): string {\n const value = props.get(key);\n if (typeof value !== 'string' || value.length === 0) {\n throw new Error(`agent definition: \"${key}\" must be a non-empty string`);\n }\n return value;\n}\n\nfunction optionalList(props: Map<string, CantValue>, key: string): string[] | undefined {\n const value = props.get(key);\n if (value === undefined) return undefined;\n if (!Array.isArray(value)) throw new Error(`agent definition: \"${key}\" must be a list`);\n return value;\n}\n\nconst KNOWN_KEYS = new Set([\n 'role',\n 'description',\n 'prompt',\n 'tools',\n 'denied-tools',\n 'background',\n]);\n\n/**\n * Read a canonical agent definition from `.cant` content.\n *\n * @param cant - Raw `.cant` file content (frontmatter `kind: agent`).\n * @returns The definition.\n * @throws When the file is not a flat agent definition, a key is unknown, or a\n * required key (`role`, `description`, `prompt`) is missing.\n *\n * @example\n * ```typescript\n * const def = parseAgentDefinition(readFileSync('cleo-lead.cant', 'utf-8'));\n * def.role; // 'lead'\n * ```\n *\n * @public\n */\nexport function parseAgentDefinition(cant: string): AgentDefinition {\n const fm = cant.match(/^---\\s*\\n([\\s\\S]*?)\\n---\\s*\\n([\\s\\S]*)$/);\n if (!fm || !/^kind:\\s*agent\\s*$/m.test(fm[1] ?? '')) {\n throw new Error('agent definition: frontmatter with \"kind: agent\" is required');\n }\n const lines = (fm[2] ?? '').split('\\n');\n const start = lines.findIndex((l) => /^agent\\s+[\\w-]+:\\s*$/.test(l));\n if (start < 0) throw new Error('agent definition: no \"agent <name>:\" block');\n const name = (lines[start] ?? '').replace(/^agent\\s+/, '').replace(/:\\s*$/, '');\n\n const props = new Map<string, CantValue>();\n for (const line of lines.slice(start + 1)) {\n if (line.trim() === '' || line.trim().startsWith('#')) continue;\n if (!line.startsWith(' ')) break;\n const m = line.match(/^ {2}([\\w-]+):\\s+(.+)$/);\n if (!m) throw new Error(`agent definition: unsupported line \"${line.trim()}\"`);\n const key = m[1] ?? '';\n if (!KNOWN_KEYS.has(key)) throw new Error(`agent definition: unknown key \"${key}\"`);\n props.set(key, parseValue(m[2] ?? '', key));\n }\n\n const role = requireString(props, 'role');\n if (role !== 'lead' && role !== 'worker') {\n throw new Error(`agent definition: role must be \"lead\" or \"worker\", got \"${role}\"`);\n }\n const background = props.get('background');\n if (background !== undefined && typeof background !== 'boolean') {\n throw new Error('agent definition: \"background\" must be true or false');\n }\n const tools = optionalList(props, 'tools');\n const deniedTools = optionalList(props, 'denied-tools');\n return {\n name,\n role,\n description: requireString(props, 'description'),\n prompt: requireString(props, 'prompt'),\n ...(tools ? { tools } : {}),\n ...(deniedTools ? { deniedTools } : {}),\n ...(background !== undefined ? { background } : {}),\n };\n}\n\n/** OpenCode permission key gating each denied Claude-style tool name. */\nconst OPENCODE_PERMISSION: Readonly<Record<string, string>> = {\n Bash: 'bash',\n Edit: 'edit',\n Write: 'edit',\n MultiEdit: 'edit',\n NotebookEdit: 'edit',\n WebFetch: 'webfetch',\n WebSearch: 'websearch',\n};\n\nfunction renderClaude(def: AgentDefinition): string {\n const fm = [\n '---',\n AGENT_DEFINITION_MARKER,\n `name: ${def.name}`,\n `description: ${JSON.stringify(def.description)}`,\n ];\n if (def.tools) fm.push(`tools: ${JSON.stringify(def.tools.join(', '))}`);\n if (def.deniedTools) fm.push(`disallowedTools: ${JSON.stringify(def.deniedTools.join(', '))}`);\n if (def.background !== undefined) fm.push(`background: ${def.background}`);\n const servers = Object.entries(def.mcpServers ?? {});\n if (servers.length > 0) {\n // Inline per-agent servers: a list of single-key maps (Claude Code sub-agent docs).\n fm.push('mcpServers:');\n for (const [name, server] of servers) {\n fm.push(` - ${name}:`, ' type: stdio');\n fm.push(` command: ${JSON.stringify(server.command)}`);\n fm.push(` args: ${JSON.stringify(server.args)}`);\n }\n }\n fm.push('---');\n return `${fm.join('\\n')}\\n\\n${def.prompt}\\n`;\n}\n\n/**\n * Why a format cannot express a definition, or `undefined` when it can.\n *\n * The OpenCode format writes only `permission` denies: it has no tool\n * allow-list and no per-agent MCP servers, so a definition with `tools` or\n * `mcpServers` would get every other tool there (global MCP tools, `task`).\n * Such a definition is not delivered to that provider (T14374).\n *\n * @param def - The canonical definition, as delivered.\n * @param format - The provider's format (registry `agentDefinitions.format`).\n * @returns The reason, or `undefined` when {@link renderAgentDefinition} can render it.\n *\n * @example\n * ```typescript\n * agentDefinitionUnsupportedReason(lead, 'opencode'); // 'OpenCode agent files cannot ...'\n * ```\n *\n * @public\n */\nexport function agentDefinitionUnsupportedReason(\n def: AgentDefinition,\n format: AgentDefinitionFormat,\n): string | undefined {\n if (format === 'claude-code') return undefined;\n if (def.tools || Object.keys(def.mcpServers ?? {}).length > 0) {\n return 'OpenCode agent files cannot restrict tools to an allow-list or declare per-agent MCP servers';\n }\n return undefined;\n}\n\nfunction renderOpenCode(def: AgentDefinition): string {\n const unsupported = agentDefinitionUnsupportedReason(def, 'opencode');\n if (unsupported) throw new Error(`agent definition \"${def.name}\": ${unsupported}`);\n const fm = [\n '---',\n AGENT_DEFINITION_MARKER,\n `description: ${JSON.stringify(def.description)}`,\n // A lead converses with the owner (primary); a worker is dispatched (subagent).\n `mode: ${def.role === 'lead' ? 'primary' : 'subagent'}`,\n ];\n const keys = new Set<string>();\n for (const tool of def.deniedTools ?? []) {\n const key = OPENCODE_PERMISSION[tool];\n if (!key) throw new Error(`agent definition: no OpenCode permission gates \"${tool}\"`);\n keys.add(key);\n }\n if (keys.size > 0) {\n fm.push('permission:');\n for (const key of [...keys].sort()) fm.push(` ${key}: deny`);\n }\n fm.push('---');\n return `${fm.join('\\n')}\\n\\n${def.prompt}\\n`;\n}\n\n/**\n * Render a canonical definition into a provider's agent-file format.\n *\n * @param def - The canonical definition.\n * @param format - The provider's format (registry `agentDefinitions.format`).\n * @returns File name and content; the content carries {@link AGENT_DEFINITION_MARKER}.\n * @throws When a denied tool has no equivalent in the target format, so a\n * lead is never written with a tool it must not have.\n *\n * @example\n * ```typescript\n * renderAgentDefinition(lead, 'claude-code').fileName; // 'cleo-lead.md'\n * ```\n *\n * @public\n */\nexport function renderAgentDefinition(\n def: AgentDefinition,\n format: AgentDefinitionFormat,\n): RenderedAgentDefinition {\n const content = format === 'claude-code' ? renderClaude(def) : renderOpenCode(def);\n return { fileName: `${def.name}.md`, content };\n}\n\n/**\n * Whether an agent file was written by CAAMP (and may be refreshed).\n *\n * @param content - The file's current content.\n *\n * @public\n */\nexport function isGeneratedAgentDefinition(content: string): boolean {\n return content.includes(AGENT_DEFINITION_MARKER);\n}\n","/**\n * Pure semantic validation of npm-produced package inventories.\n *\n * Code placed in `packages/caamp/` per Package-Boundary Check — verified\n * against AGENTS.md. No filesystem, process, model, or runtime-store access.\n */\n\nimport { posix } from 'node:path';\nimport type {\n PackageArtifactBudgets,\n PackageArtifactFile,\n PackageArtifactInventory,\n PackageArtifactIssue,\n PackageArtifactPolicy,\n PackageArtifactRequirement,\n PackageArtifactValidation,\n PackageFilesEntry,\n} from '@cleocode/contracts/package-artifact';\n\n/** Existing CLI upper budgets: 20 MiB packed, 36 MiB unpacked, and 800 files. */\nexport const CLEO_ARTIFACT_BUDGETS: Readonly<PackageArtifactBudgets> = Object.freeze({\n packedBytes: 20 * 1024 * 1024,\n unpackedBytes: 36 * 1024 * 1024,\n fileCount: 800,\n});\n\n/**\n * The JavaScript files `build.mjs` declares for the published CLI: the CLI\n * bundle, the provider hook runtime that `bin/cleo.js` imports directly for\n * `cleo hook heavy-command` (T12983), skipping the CLI bootstrap, and the\n * detached dist-tags check the CLI spawns for its update notice (T13137), and\n * the shared project-hook adapter hot path (T13344). Any\n * other `.js` under `dist/` is development output.\n */\nconst CLEO_SHIPPED_JS_ENTRIES: ReadonlySet<string> = new Set([\n 'dist/cli/index.js',\n 'dist/cli/hook-entry.js',\n 'dist/cli/update-check-entry.js',\n 'dist/cli/project-hook-entry.js',\n]);\n\n/**\n * A code-split chunk of the CLI bundle (T13126): `dist/cli/<name>-<HASH>.js`,\n * where `<HASH>` is esbuild's 8-character content hash.\n *\n * `build.mjs` bundles the CLI with `splitting` so each `import()` loads its own\n * chunk instead of the whole CLI and all of CORE at startup. Its\n * `CLEO_CHUNK_NAMES` (`cli/[name]-[hash]`) writes every chunk directly beside\n * `cli/index.js`; change both together. A chunk in any other directory is not\n * build output and stays rejected. `<name>` is the source file's basename in\n * any case (T13159): a source file named `TaskCard.ts` must not fail the\n * artifact check.\n */\nexport const CLEO_CLI_CHUNK_PATTERN: RegExp = /^dist\\/cli\\/[A-Za-z0-9_.-]+-[A-Z0-9]{8}\\.js$/;\n\n/** Required CLI and adapter-node resources, independent of historical byte/file-count floors. */\nexport const CLEO_ARTIFACT_REQUIREMENTS: readonly PackageArtifactRequirement[] = Object.freeze([\n { id: 'cli-entry', path: 'dist/cli/index.js', match: 'exact' },\n { id: 'cli-hook-entry', path: 'dist/cli/hook-entry.js', match: 'exact' },\n { id: 'cli-update-check-entry', path: 'dist/cli/update-check-entry.js', match: 'exact' },\n { id: 'cli-project-hook-entry', path: 'dist/cli/project-hook-entry.js', match: 'exact' },\n { id: 'studio-server-entry', path: 'studio-dist/index.js', match: 'exact' },\n { id: 'studio-handler', path: 'studio-dist/handler.js', match: 'exact' },\n { id: 'studio-server', path: 'studio-dist/server/index.js', match: 'exact' },\n { id: 'studio-manifest', path: 'studio-dist/server/manifest.js', match: 'exact' },\n {\n id: 'studio-client-start',\n path: 'studio-dist/client/_app/immutable/entry/start.*.js',\n match: 'glob',\n },\n {\n id: 'studio-client-app',\n path: 'studio-dist/client/_app/immutable/entry/app.*.js',\n match: 'glob',\n },\n]);\n\nconst SHA256 = /^[a-f0-9]{64}$/;\nconst GLOB = /[*?{}[\\]]|[+@!]\\(/;\n\nfunction pathProblem(path: string): string | null {\n if (!path || path.trim() !== path) return 'Path is empty or has surrounding whitespace.';\n if (path.includes('\\\\') || /[\\x00-\\x1f\\x7f]/.test(path))\n return 'Path is not a portable POSIX package path.';\n if (posix.isAbsolute(path) || /^[A-Za-z]:/.test(path))\n return 'Path must be relative to the package.';\n if (path.split('/').some((part) => !part || part === '.' || part === '..')) {\n return 'Path must not contain empty, current-directory, or parent-directory segments.';\n }\n return null;\n}\n\n/**\n * Classify a manifest files entry without evaluating exclusions as disk paths.\n *\n * @param entry - Original npm manifest entry.\n * @returns Classification only; actual selected content must come from the packer.\n * @example\n * ```ts\n * classifyPackageFilesEntry('!dist/index.js.map').kind; // 'exclusion'\n * ```\n */\nexport function classifyPackageFilesEntry(entry: string): PackageFilesEntry {\n const exclusion = entry.startsWith('!');\n const pattern = (exclusion ? entry.slice(1) : entry).replace(/^\\.\\//, '').replace(/\\/$/, '');\n const reason = pattern.startsWith('!')\n ? 'Repeated exclusion markers are not assessed.'\n : pathProblem(pattern);\n return {\n entry,\n pattern,\n kind: reason ? 'invalid' : exclusion ? 'exclusion' : GLOB.test(pattern) ? 'glob' : 'literal',\n reason,\n };\n}\n\nfunction fileProblems(file: PackageArtifactFile): string[] {\n const problems: string[] = [];\n const pathError = pathProblem(file.path);\n if (pathError) problems.push(pathError);\n if (!Number.isSafeInteger(file.size) || file.size < 0)\n problems.push('File size must be a nonnegative safe integer.');\n if (file.sha256 !== undefined && !SHA256.test(file.sha256))\n problems.push('File SHA-256 must be 64 lowercase hexadecimal characters.');\n return problems;\n}\n\n/**\n * Validate nonempty semantic resources, inventory identity, expected hashes and upper budgets.\n *\n * @param inventory - Packer-produced evidence or an explicitly identified fixture.\n * @param policy - Independently specified resources, expected files and cost ceilings.\n * @returns A copied evidence receipt; valid means only the supplied checks passed.\n * @example\n * ```ts\n * const result = validatePackageArtifact(inventory, {\n * requirements: CLEO_ARTIFACT_REQUIREMENTS,\n * budgets: CLEO_ARTIFACT_BUDGETS,\n * });\n * // result.runtime remains 'not-assessed', even when result.valid is true.\n * ```\n */\nexport function validatePackageArtifact(\n inventory: PackageArtifactInventory,\n policy: PackageArtifactPolicy,\n): PackageArtifactValidation {\n const issues: PackageArtifactIssue[] = [];\n const add = (code: PackageArtifactIssue['code'], subject: string, message: string): void => {\n issues.push({ code, subject, message });\n };\n if (!inventory.packageName.trim() || !inventory.version.trim()) {\n add('invalid-inventory', 'identity', 'Package name and version must be recorded.');\n }\n if (!['npm-pack', 'npm-pack-dry-run', 'fixture'].includes(inventory.source)) {\n add('invalid-inventory', 'source', 'Inventory provenance is not recognized.');\n }\n if (!Number.isSafeInteger(inventory.packedBytes) || inventory.packedBytes < 0) {\n add('invalid-inventory', 'packedBytes', 'Packed bytes must be a nonnegative safe integer.');\n }\n if (inventory.tarballSha256 !== undefined && !SHA256.test(inventory.tarballSha256)) {\n add(\n 'invalid-inventory',\n 'tarballSha256',\n 'Tarball SHA-256 must be 64 lowercase hexadecimal characters.',\n );\n }\n if (inventory.source === 'npm-pack-dry-run' && inventory.tarballSha256 !== undefined) {\n add(\n 'invalid-inventory',\n 'tarballSha256',\n 'A dry run cannot establish a retained tarball hash.',\n );\n }\n const files = new Map<string, PackageArtifactFile>();\n let unpackedBytes: number | null = 0;\n for (const file of inventory.files) {\n for (const problem of fileProblems(file)) add('invalid-inventory', file.path, problem);\n if (files.has(file.path)) add('invalid-inventory', file.path, 'Duplicate inventory path.');\n files.set(file.path, file);\n if (unpackedBytes !== null) {\n const total: number = unpackedBytes + file.size;\n unpackedBytes = Number.isSafeInteger(total) && file.size >= 0 ? total : null;\n }\n }\n if (unpackedBytes === null)\n add('invalid-inventory', 'unpackedBytes', 'File bytes cannot be safely totaled.');\n const entries = (policy.filesEntries ?? []).map(classifyPackageFilesEntry);\n for (const entry of entries) {\n if (entry.reason) add('invalid-policy', entry.entry, entry.reason);\n }\n if (!policy.requirements.length)\n add('invalid-policy', 'requirements', 'At least one semantic content requirement is required.');\n const ids = new Set<string>();\n const requirements = policy.requirements.map((requirement) => {\n const invalid = pathProblem(requirement.path);\n const duplicate = ids.has(requirement.id);\n ids.add(requirement.id);\n if (\n !requirement.id.trim() ||\n duplicate ||\n invalid ||\n !['exact', 'glob'].includes(requirement.match)\n ) {\n add(\n 'invalid-policy',\n requirement.id,\n invalid ?? 'Requirement identity or match mode is invalid or duplicated.',\n );\n return { id: requirement.id, matchedPaths: [], satisfied: false };\n }\n const matches = inventory.files.filter((file) =>\n requirement.match === 'exact'\n ? file.path === requirement.path\n : posix.matchesGlob(file.path, requirement.path),\n );\n if (!matches.length)\n add(\n 'missing',\n requirement.id,\n `Required resource ${requirement.path} is absent from the selected inventory.`,\n );\n for (const file of matches) {\n if (file.size === 0) add('empty', file.path, `Required resource ${requirement.id} is empty.`);\n }\n return {\n id: requirement.id,\n matchedPaths: matches.map((file) => file.path),\n satisfied: matches.length > 0 && matches.every((file) => file.size > 0),\n };\n });\n for (const pattern of policy.forbiddenPatterns ?? []) {\n const invalid = pathProblem(pattern);\n if (invalid) {\n add('invalid-policy', pattern, invalid);\n continue;\n }\n for (const file of inventory.files) {\n if (posix.matchesGlob(file.path, pattern))\n add('forbidden', file.path, `Selected file matches forbidden pattern ${pattern}.`);\n }\n }\n let hashComparison: PackageArtifactValidation['hashComparison'] = 'not-requested';\n for (const expected of policy.expectedFiles ?? []) {\n const problems = fileProblems(expected);\n for (const problem of problems) add('invalid-policy', expected.path, problem);\n const actual = files.get(expected.path);\n if (!actual) add('missing', expected.path, 'An independently expected file is missing.');\n else if (actual.size !== expected.size)\n add('mismatch', expected.path, 'File bytes differ from independently expected inventory.');\n if (expected.sha256 !== undefined) {\n if (hashComparison !== 'failed') hashComparison = 'matched';\n if (problems.length || actual?.sha256 !== expected.sha256) {\n hashComparison = 'failed';\n add(\n 'mismatch',\n expected.path,\n 'Actual hash is missing or differs from the independently expected SHA-256.',\n );\n }\n }\n }\n for (const [field, limit] of Object.entries(policy.budgets)) {\n if (!Number.isSafeInteger(limit) || limit < 0)\n add('invalid-policy', field, 'Budget must be a nonnegative safe integer.');\n }\n if (inventory.packedBytes > policy.budgets.packedBytes)\n add('budget', 'packedBytes', 'Packed bytes exceed the configured upper budget.');\n if (unpackedBytes !== null && unpackedBytes > policy.budgets.unpackedBytes)\n add('budget', 'unpackedBytes', 'Unpacked bytes exceed the configured upper budget.');\n if (inventory.files.length > policy.budgets.fileCount)\n add('budget', 'fileCount', 'Selected file count exceeds the configured upper budget.');\n return {\n valid: issues.length === 0,\n inventory: { ...inventory, files: inventory.files.map((file) => ({ ...file })) },\n unpackedBytes,\n issues,\n filesEntries: entries,\n requirements,\n hashComparison,\n runtime: 'not-assessed',\n limitations: [\n 'Manifest entries are classified only; the supplied packer inventory is the content authority.',\n 'Hashes are recorded and compared to supplied expected evidence; this validator does not read or authenticate tarball bytes.',\n 'Installability, module/dependency resolution, local-reference closure and native/dynamic runtime behavior are not assessed.',\n ],\n };\n}\n\n/**\n * Reject declaration and stray JavaScript output absent from the published CLI\n * bundle: only `build.mjs`'s declared entries (the CLI bundle and the hook\n * runtime) and their code-split chunks ({@link CLEO_CLI_CHUNK_PATTERN}) may ship\n * as `.js` under `dist/`.\n *\n * @param files - Actual selected package files, not a development directory listing.\n * @returns Concrete build-shape failures; this does not load the bundle.\n * @example\n * ```ts\n * assertCleoShippedBuildShape([{ path: 'dist/cli/index.js', size: 1 }]); // []\n * ```\n */\nexport function assertCleoShippedBuildShape(files: readonly PackageArtifactFile[]): string[] {\n const reasons: string[] = [];\n const dist = files.filter((file) => file.path.startsWith('dist/'));\n const declarations = dist.filter(\n (file) => file.path.endsWith('.d.ts') || file.path.endsWith('.d.ts.map'),\n );\n if (declarations.length)\n reasons.push(\n `${declarations.length} declaration file(s) under dist/ — the esbuild bundle emits none`,\n );\n const stray = dist.filter(\n (file) =>\n file.path.endsWith('.js') &&\n !CLEO_SHIPPED_JS_ENTRIES.has(file.path) &&\n !CLEO_CLI_CHUNK_PATTERN.test(file.path),\n );\n if (stray.length)\n reasons.push(\n `${stray.length} .js file(s) under dist/ outside the declared entries ${[...CLEO_SHIPPED_JS_ENTRIES].join(', ')} and their chunks, e.g. ${stray[0]?.path}`,\n );\n return reasons;\n}\n","/**\n * Skill integrity checking\n *\n * Validates that installed skills have intact symlinks, correct canonical paths,\n * and enforces ct-* prefix priority for CAAMP-shipped skills.\n */\n\nimport { existsSync, lstatSync, readlinkSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport { resolveSkillsRoot } from '@cleocode/core/skills/skill-root.js';\nimport type { LockEntry, Provider } from '../../types.js';\nimport { readLockFile } from '../lock-utils.js';\nimport { resolveProviderSkillsDirs } from '../paths/standard.js';\n\n/** CAAMP-reserved skill prefix. Skills with this prefix are owned by CAAMP. */\nconst CAAMP_SKILL_PREFIX = 'ct-';\n\n/**\n * Status of a single skill's integrity check.\n *\n * @public\n */\nexport type SkillIntegrityStatus =\n | 'intact'\n | 'broken-symlink'\n | 'missing-canonical'\n | 'missing-link'\n | 'not-tracked'\n | 'tampered';\n\n/**\n * Result of checking a single skill's integrity.\n *\n * @public\n */\nexport interface SkillIntegrityResult {\n /** Skill name. */\n name: string;\n /** Overall integrity status. */\n status: SkillIntegrityStatus;\n /** Whether the canonical directory exists. */\n canonicalExists: boolean;\n /** Expected canonical path from lock file. */\n canonicalPath: string | null;\n /** Provider link statuses — which agents have valid symlinks. */\n linkStatuses: Array<{\n providerId: string;\n linkPath: string;\n exists: boolean;\n isSymlink: boolean;\n pointsToCanonical: boolean;\n }>;\n /** Whether this is a CAAMP-reserved (ct-*) skill. */\n isCaampOwned: boolean;\n /** Human-readable issue description, if any. */\n issue?: string;\n}\n\n/**\n * Check whether a skill name is reserved by CAAMP (ct-* prefix).\n *\n * @remarks\n * Skills with the `ct-` prefix are considered CAAMP-owned and receive\n * special treatment during installation conflict resolution.\n *\n * @param skillName - Skill name to check\n * @returns `true` if the skill name starts with `ct-`\n *\n * @example\n * ```typescript\n * isCaampOwnedSkill(\"ct-research-agent\"); // true\n * isCaampOwnedSkill(\"my-custom-skill\"); // false\n * ```\n *\n * @public\n */\nexport function isCaampOwnedSkill(skillName: string): boolean {\n return skillName.startsWith(CAAMP_SKILL_PREFIX);\n}\n\n/**\n * Check the integrity of a single installed skill.\n *\n * @remarks\n * Validates that the canonical directory exists on disk, the lock file entry\n * matches the actual state, and symlinks from provider skill directories\n * point to the canonical path.\n *\n * @param skillName - Name of the skill to check\n * @param providers - Providers to check symlinks for\n * @param scope - Whether to check global or project links\n * @param projectDir - Project directory (for project scope)\n * @returns Integrity check result\n *\n * @example\n * ```typescript\n * const result = await checkSkillIntegrity(\"ct-research-agent\", providers, \"global\");\n * if (result.status !== \"intact\") {\n * console.log(`Issue: ${result.issue}`);\n * }\n * ```\n *\n * @public\n */\nexport async function checkSkillIntegrity(\n skillName: string,\n providers: Provider[],\n scope: 'global' | 'project' = 'global',\n projectDir?: string,\n): Promise<SkillIntegrityResult> {\n const lock = await readLockFile();\n const entry = lock.skills[skillName];\n const isCaampOwned = isCaampOwnedSkill(skillName);\n\n // Not tracked in lock file\n if (!entry) {\n const canonicalPath = join(resolveSkillsRoot(), skillName);\n return {\n name: skillName,\n status: 'not-tracked',\n canonicalExists: existsSync(canonicalPath),\n canonicalPath: null,\n linkStatuses: [],\n isCaampOwned,\n issue: 'Skill is not tracked in the CAAMP lock file',\n };\n }\n\n const canonicalPath = entry.canonicalPath;\n const canonicalExists = existsSync(canonicalPath);\n\n // Check symlinks for each provider\n const linkStatuses: SkillIntegrityResult['linkStatuses'] = [];\n\n for (const provider of providers) {\n const targetDirs = resolveProviderSkillsDirs(provider, scope, projectDir);\n for (const skillsDir of targetDirs) {\n if (!skillsDir) continue;\n\n const linkPath = join(skillsDir, skillName);\n const exists = existsSync(linkPath);\n let isSymlink = false;\n let pointsToCanonical = false;\n\n if (exists) {\n try {\n const stat = lstatSync(linkPath);\n isSymlink = stat.isSymbolicLink();\n if (isSymlink) {\n const target = resolve(readlinkSync(linkPath));\n pointsToCanonical = target === resolve(canonicalPath);\n }\n } catch {\n // Can't stat — treat as broken\n }\n }\n\n linkStatuses.push({\n providerId: provider.id,\n linkPath,\n exists,\n isSymlink,\n pointsToCanonical,\n });\n }\n }\n\n // Determine overall status\n if (!canonicalExists) {\n return {\n name: skillName,\n status: 'missing-canonical',\n canonicalExists,\n canonicalPath,\n linkStatuses,\n isCaampOwned,\n issue: `Canonical directory missing: ${canonicalPath}`,\n };\n }\n\n const brokenLinks = linkStatuses.filter((l) => !l.exists);\n const tamperedLinks = linkStatuses.filter((l) => l.exists && !l.pointsToCanonical);\n\n if (tamperedLinks.length > 0) {\n return {\n name: skillName,\n status: 'tampered',\n canonicalExists,\n canonicalPath,\n linkStatuses,\n isCaampOwned,\n issue: `${tamperedLinks.length} link(s) do not point to canonical path`,\n };\n }\n\n if (brokenLinks.length > 0) {\n return {\n name: skillName,\n status: 'broken-symlink',\n canonicalExists,\n canonicalPath,\n linkStatuses,\n isCaampOwned,\n issue: `${brokenLinks.length} symlink(s) missing`,\n };\n }\n\n return {\n name: skillName,\n status: 'intact',\n canonicalExists,\n canonicalPath,\n linkStatuses,\n isCaampOwned,\n };\n}\n\n/**\n * Check integrity of all tracked skills.\n *\n * @remarks\n * Iterates over every skill in the lock file and runs\n * {@link checkSkillIntegrity} on each.\n *\n * @param providers - Providers to check symlinks for\n * @param scope - Whether to check global or project links\n * @param projectDir - Project directory (for project scope)\n * @returns Map of skill name to integrity result\n *\n * @example\n * ```typescript\n * const results = await checkAllSkillIntegrity(providers);\n * for (const [name, result] of results) {\n * console.log(`${name}: ${result.status}`);\n * }\n * ```\n *\n * @public\n */\nexport async function checkAllSkillIntegrity(\n providers: Provider[],\n scope: 'global' | 'project' = 'global',\n projectDir?: string,\n): Promise<Map<string, SkillIntegrityResult>> {\n const lock = await readLockFile();\n const results = new Map<string, SkillIntegrityResult>();\n\n for (const skillName of Object.keys(lock.skills)) {\n const result = await checkSkillIntegrity(skillName, providers, scope, projectDir);\n results.set(skillName, result);\n }\n\n return results;\n}\n\n/**\n * Resolve a skill name conflict where a user-installed skill collides\n * with a CAAMP-owned (ct-*) skill.\n *\n * @remarks\n * CAAMP-owned skills always win. Returns `true` if the incoming skill\n * should take precedence over the existing installation.\n *\n * @param skillName - Skill name to check\n * @param incomingSource - Source of the incoming skill installation\n * @param existingEntry - Existing lock entry, if any\n * @returns `true` if the incoming installation should proceed\n *\n * @example\n * ```typescript\n * const proceed = shouldOverrideSkill(\"ct-research-agent\", \"library\", existingEntry);\n * if (proceed) {\n * // Safe to install/override\n * }\n * ```\n *\n * @public\n */\nexport function shouldOverrideSkill(\n skillName: string,\n incomingSource: string,\n existingEntry: LockEntry | undefined,\n): boolean {\n // No existing entry — always allow\n if (!existingEntry) return true;\n\n // For ct-* skills, CAAMP package source always wins\n if (isCaampOwnedSkill(skillName)) {\n // If incoming is from CAAMP package (library source), it always wins\n if (existingEntry.sourceType === 'library') return true;\n // If existing is from CAAMP but incoming is user, CAAMP wins (block user)\n return true;\n }\n\n // Non-ct-* skills: user always wins\n return true;\n}\n\n/**\n * Validate instruction file injection status across all providers.\n *\n * @remarks\n * Checks that CAAMP blocks exist and are current in all relevant\n * instruction files (CLAUDE.md, AGENTS.md, GEMINI.md).\n *\n * @param providers - Providers to check\n * @param projectDir - Project directory\n * @param scope - Whether to check global or project files\n * @param expectedContent - Expected CAAMP block content\n * @returns Array of file paths with issues\n *\n * @example\n * ```typescript\n * const issues = await validateInstructionIntegrity(providers, process.cwd(), \"project\");\n * for (const issue of issues) {\n * console.log(`${issue.providerId}: ${issue.issue} (${issue.file})`);\n * }\n * ```\n *\n * @public\n */\nexport async function validateInstructionIntegrity(\n providers: Provider[],\n projectDir: string,\n scope: 'project' | 'global',\n expectedContent?: string,\n): Promise<Array<{ file: string; providerId: string; issue: string }>> {\n const { checkAllInjections } = await import('../instructions/injector.js');\n const results = await checkAllInjections(providers, projectDir, scope, expectedContent);\n const issues: Array<{ file: string; providerId: string; issue: string }> = [];\n\n for (const result of results) {\n if (result.status === 'missing') {\n issues.push({\n file: result.file,\n providerId: result.provider,\n issue: 'Instruction file does not exist',\n });\n } else if (result.status === 'none') {\n issues.push({\n file: result.file,\n providerId: result.provider,\n issue: 'No CAAMP injection block found',\n });\n } else if (result.status === 'outdated') {\n issues.push({\n file: result.file,\n providerId: result.provider,\n issue: 'CAAMP injection block is outdated',\n });\n }\n }\n\n return issues;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EO,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,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAwBA,eAAsB,uBACpB,WACA,QAA8B,UAC9B,YAC4C;AAC5C,QAAM,OAAO,MAAM,aAAa;AAChC,QAAM,UAAU,oBAAI,IAAkC;AAEtD,aAAW,aAAa,OAAO,KAAK,KAAK,MAAM,GAAG;AAChD,UAAM,SAAS,MAAM,oBAAoB,WAAW,WAAW,OAAO,UAAU;AAChF,YAAQ,IAAI,WAAW,MAAM;AAAA,EAC/B;AAEA,SAAO;AACT;AAyBO,SAAS,oBACd,WACA,gBACA,eACS;AAET,MAAI,CAAC,cAAe,QAAO;AAG3B,MAAI,kBAAkB,SAAS,GAAG;AAEhC,QAAI,cAAc,eAAe,UAAW,QAAO;AAEnD,WAAO;AAAA,EACT;AAGA,SAAO;AACT;AAyBA,eAAsB,6BACpB,WACA,YACA,OACA,iBACqE;AACrE,QAAM,EAAE,oBAAAC,oBAAmB,IAAI,MAAM,OAAO,wBAA6B;AACzE,QAAM,UAAU,MAAMA,oBAAmB,WAAW,YAAY,OAAO,eAAe;AACtF,QAAM,SAAqE,CAAC;AAE5E,aAAW,UAAU,SAAS;AAC5B,QAAI,OAAO,WAAW,WAAW;AAC/B,aAAO,KAAK;AAAA,QACV,MAAM,OAAO;AAAA,QACb,YAAY,OAAO;AAAA,QACnB,OAAO;AAAA,MACT,CAAC;AAAA,IACH,WAAW,OAAO,WAAW,QAAQ;AACnC,aAAO,KAAK;AAAA,QACV,MAAM,OAAO;AAAA,QACb,YAAY,OAAO;AAAA,QACnB,OAAO;AAAA,MACT,CAAC;AAAA,IACH,WAAW,OAAO,WAAW,YAAY;AACvC,aAAO,KAAK;AAAA,QACV,MAAM,OAAO;AAAA,QACb,YAAY,OAAO;AAAA,QACnB,OAAO;AAAA,MACT,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AACT;","names":["canonicalPath","checkAllInjections"]}
@@ -16,7 +16,7 @@ import {
16
16
  repairInstructionFiles,
17
17
  resolveGlobalInstructionPath,
18
18
  writeAgentFileToAllProviders
19
- } from "./chunk-2RZGY4XT.js";
19
+ } from "./chunk-SM53FT2Y.js";
20
20
  import "./chunk-D6CWC4BX.js";
21
21
  import "./chunk-5INWYMO4.js";
22
22
  import "./chunk-PZ5AY32C.js";
@@ -39,4 +39,4 @@ export {
39
39
  resolveGlobalInstructionPath,
40
40
  writeAgentFileToAllProviders
41
41
  };
42
- //# sourceMappingURL=injector-3SMMI2FO.js.map
42
+ //# sourceMappingURL=injector-QYCEN5H2.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleocode/caamp",
3
- "version": "2026.10.27",
3
+ "version": "2026.11.1-canary.10",
4
4
  "description": "Central AI Agent Managed Packages - unified provider registry and package manager for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -58,14 +58,14 @@
58
58
  "jsonc-parser": "^3.3.1",
59
59
  "picocolors": "^1.1.1",
60
60
  "simple-git": "3.33.0",
61
- "@cleocode/cant": "2026.10.27",
62
- "@cleocode/contracts": "2026.10.27",
63
- "@cleocode/core": "2026.10.27",
64
- "@cleocode/lafs": "2026.10.27",
65
- "@cleocode/paths": "2026.10.27"
61
+ "@cleocode/cant": "2026.11.1-canary.10",
62
+ "@cleocode/contracts": "2026.11.1-canary.10",
63
+ "@cleocode/core": "2026.11.1-canary.10",
64
+ "@cleocode/lafs": "2026.11.1-canary.10",
65
+ "@cleocode/paths": "2026.11.1-canary.10"
66
66
  },
67
67
  "peerDependencies": {
68
- "@cleocode/core": "2026.10.27"
68
+ "@cleocode/core": "2026.11.1-canary.10"
69
69
  },
70
70
  "peerDependenciesMeta": {
71
71
  "@cleocode/core": {
@@ -19,6 +19,10 @@
19
19
  ],
20
20
  "pathSkills": "$HOME/.claude/skills",
21
21
  "pathProjectSkills": ".claude/skills",
22
+ "agentDefinitions": {
23
+ "pathProject": ".claude/agents",
24
+ "format": "claude-code"
25
+ },
22
26
  "detection": {
23
27
  "methods": [
24
28
  "binary",
@@ -396,6 +400,10 @@
396
400
  ],
397
401
  "pathSkills": "$CONFIG/opencode/skills",
398
402
  "pathProjectSkills": ".opencode/skills",
403
+ "agentDefinitions": {
404
+ "pathProject": ".opencode/agents",
405
+ "format": "opencode"
406
+ },
399
407
  "detection": {
400
408
  "methods": [
401
409
  "binary"