{"version":3,"file":"agents.mjs","names":[],"sources":["../../src/commands/agents.ts"],"sourcesContent":["import { defineCommand } from \"citty\";\nimport { consola } from \"consola\";\nimport { isHarnessId, listHarnesses } from \"../registry.ts\";\nimport { agentsSync } from \"../tool-operations.ts\";\nimport { formatArgs, report } from \"./output.ts\";\n\nexport default defineCommand({\n  meta: { description: \"Manage the shared global instructions file across harnesses\" },\n  subCommands: {\n    sync: defineCommand({\n      meta: {\n        description:\n          \"Link global instructions and declared companions (agents.jsonc: source, companions, excludes)\",\n      },\n      args: {\n        id: { type: \"positional\" as const, description: \"Harness id\", required: false },\n        check: {\n          type: \"boolean\" as const,\n          description: \"Report what would change without writing anything\",\n        },\n        ...formatArgs,\n      },\n      run({ args }) {\n        const id = args.id === undefined ? undefined : (args.id as string);\n        if (id !== undefined && !isHarnessId(id)) {\n          consola.error(`Unknown harness: ${id}\\nKnown: ${listHarnesses().join(\", \")}`);\n          process.exit(1);\n        }\n        report(agentsSync(id, args.check === true), args);\n      },\n    }),\n  },\n});\n"],"mappings":";;;;;;AAMA,IAAA,iBAAe,cAAc;CAC3B,MAAM,EAAE,aAAa,8DAA8D;CACnF,aAAa,EACX,MAAM,cAAc;EAClB,MAAM,EACJ,aACE,gGACJ;EACA,MAAM;GACJ,IAAI;IAAE,MAAM;IAAuB,aAAa;IAAc,UAAU;GAAM;GAC9E,OAAO;IACL,MAAM;IACN,aAAa;GACf;GACA,GAAG;EACL;EACA,IAAI,EAAE,QAAQ;GACZ,MAAM,KAAK,KAAK,OAAO,KAAA,IAAY,KAAA,IAAa,KAAK;GACrD,IAAI,OAAO,KAAA,KAAa,CAAC,YAAY,EAAE,GAAG;IACxC,QAAQ,MAAM,oBAAoB,GAAG,WAAW,cAAc,CAAC,CAAC,KAAK,IAAI,GAAG;IAC5E,QAAQ,KAAK,CAAC;GAChB;GACA,OAAO,WAAW,IAAI,KAAK,UAAU,IAAI,GAAG,IAAI;EAClD;CACF,CAAC,EACH;AACF,CAAC"}