@cat-kit/agent-context 1.0.5 → 1.0.6
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/adapters/tool-targets.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/shared/fs.js +1 -1
- package/dist/stats.html +1 -1
- package/package.json +1 -1
- package/src/cli.ts +7 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{existsSync as e}from"node:fs";import{resolve as t}from"node:path";const n={claude:{id:`claude`,name:`Claude Code`,rootDir:`.claude/commands`,fileExtension:`.md`,supportsFrontmatter:!0,commandSeparator:`:`,commandPrefix:`/`},codex:{id:`codex`,name:`Codex`,rootDir:`.codex/commands`,fileExtension:`.md`,supportsFrontmatter:!0,commandSeparator:`-`,commandPrefix:`/`},cursor:{id:`cursor`,name:`Cursor`,rootDir:`.cursor/commands`,fileExtension:`.md`,supportsFrontmatter:!1,commandSeparator:`-`,commandPrefix:`/`},antigravity:{id:`antigravity`,name:`Antigravity`,rootDir:`.agents`,fileExtension:`.md`,supportsFrontmatter:!0,commandSeparator:`-`,commandPrefix:`/`},copilot:{id:`copilot`,name:`GitHub Copilot`,rootDir:`.github/prompts`,fileExtension:`.prompt.md`,supportsFrontmatter:!0,commandSeparator:`-`,commandPrefix:`#`}},r=[`claude`,`codex`,`cursor`,`antigravity`,`copilot`],i=[`init`,`plan`,`replan`,`implement`,`patch`,`done`];function a(){return r.map(e=>({id:e,name:n[e].name}))}function o(e){let t=e.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean);if(t.length===0)return[...r];let n=[];for(let e of t){if(!u(e))throw Error(`不支持的工具标识: ${e}。可选值: ${r.join(`, `)}`);n.includes(e)||n.push(e)}return n}function s(e){return(e&&e.length>0?e:r).map(e=>({...n[e]}))}function c(t){return r.filter(r=>{let a=n[r],o=l(a,t);return i.some(t=>e(o.commandFile(t)))})}function l(e,n){let r=t(n,e.rootDir),i=e.fileExtension;if(e.commandSeparator===`:`){let e=t(r,`ac`);return{commandFile:n=>t(e,`${n}${i}`)}}return{commandFile:e=>t(r,`ac-${e}${i}`)}}function u(e){return Object.hasOwn(n,e)}export{r as DEFAULT_TOOL_ORDER,c as detectConfiguredToolIds,a as getToolChoices,o as parseToolIds,s as resolveToolTargets,l as resolveWorkflowPaths};
|
|
2
2
|
//# sourceMappingURL=tool-targets.js.map
|
package/dist/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{setupCommand as e}from"./commands/setup.js";import{updateCommand as t}from"./commands/update.js";import{
|
|
2
|
+
import{setupCommand as e}from"./commands/setup.js";import{updateCommand as t}from"./commands/update.js";import{readFileSync as n}from"node:fs";import{Command as r}from"commander";const i=JSON.parse(n(new URL(`../package.json`,import.meta.url),`utf8`)),a=typeof i.version==`string`?i.version:`0.0.0`,o=new r;o.name(`agent-context`).description(`Agent Context 工作流生成工具`).version(a),o.command(`setup`).description(`初始化工作流命令`).option(`--tools <tools>`,`指定目标工具,逗号分隔:claude,codex,cursor,antigravity,copilot`).option(`--yes`,`非交互模式预留参数(当前版本无需确认)`).option(`--check`,`仅检查是否存在待更新内容,不写入文件`).action(e),o.command(`update`).description(`更新工作流命令`).option(`--tools <tools>`,`指定目标工具,逗号分隔:claude,codex,cursor,antigravity,copilot`).option(`--yes`,`非交互模式预留参数(当前版本无需确认)`).option(`--check`,`仅检查是否存在待更新内容,不写入文件`).action(t),o.parseAsync().catch(e=>{let t=e instanceof Error?e.message:String(e);console.error(`\n❌ ${t}`),process.exitCode=1});export{};
|
|
3
3
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from 'commander'\n\nimport { setupCommand } from './commands/setup'\nimport { updateCommand } from './commands/update'\n\nconst program = new Command()\n\nprogram.name('agent-context').description('Agent Context 工作流生成工具').version(
|
|
1
|
+
{"version":3,"file":"cli.js","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { readFileSync } from 'node:fs'\nimport { Command } from 'commander'\n\nimport { setupCommand } from './commands/setup'\nimport { updateCommand } from './commands/update'\n\nconst packageJson = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')) as {\n version?: string\n}\nconst packageVersion = typeof packageJson.version === 'string' ? packageJson.version : '0.0.0'\n\nconst program = new Command()\n\nprogram.name('agent-context').description('Agent Context 工作流生成工具').version(packageVersion)\n\nprogram\n .command('setup')\n .description('初始化工作流命令')\n .option('--tools <tools>', '指定目标工具,逗号分隔:claude,codex,cursor,antigravity,copilot')\n .option('--yes', '非交互模式预留参数(当前版本无需确认)')\n .option('--check', '仅检查是否存在待更新内容,不写入文件')\n .action(setupCommand)\n\nprogram\n .command('update')\n .description('更新工作流命令')\n .option('--tools <tools>', '指定目标工具,逗号分隔:claude,codex,cursor,antigravity,copilot')\n .option('--yes', '非交互模式预留参数(当前版本无需确认)')\n .option('--check', '仅检查是否存在待更新内容,不写入文件')\n .action(updateCommand)\n\nprogram.parseAsync().catch((error: unknown) => {\n const message = error instanceof Error ? error.message : String(error)\n console.error(`\\n❌ ${message}`) // eslint-disable-line no-console\n process.exitCode = 1\n})\n"],"mappings":";mLAQA,MAAM,EAAc,KAAK,MAAM,EAAa,IAAI,IAAI,kBAAmB,OAAO,KAAK,IAAI,CAAE,OAAO,CAAC,CAG3F,EAAiB,OAAO,EAAY,SAAY,SAAW,EAAY,QAAU,QAEjF,EAAU,IAAI,EAEpB,EAAQ,KAAK,gBAAgB,CAAC,YAAY,wBAAwB,CAAC,QAAQ,EAAe,CAE1F,EACG,QAAQ,QAAQ,CAChB,YAAY,WAAW,CACvB,OAAO,kBAAmB,sDAAsD,CAChF,OAAO,QAAS,sBAAsB,CACtC,OAAO,UAAW,qBAAqB,CACvC,OAAO,EAAa,CAEvB,EACG,QAAQ,SAAS,CACjB,YAAY,UAAU,CACtB,OAAO,kBAAmB,sDAAsD,CAChF,OAAO,QAAS,sBAAsB,CACtC,OAAO,UAAW,qBAAqB,CACvC,OAAO,EAAc,CAExB,EAAQ,YAAY,CAAC,MAAO,GAAmB,CAC7C,IAAM,EAAU,aAAiB,MAAQ,EAAM,QAAU,OAAO,EAAM,CACtE,QAAQ,MAAM,OAAO,IAAU,CAC/B,QAAQ,SAAW,GACnB"}
|
package/dist/shared/fs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{existsSync as e}from"node:fs";import{dirname as t}from"node:path";import{mkdir as n,readFile as r,writeFile as i}from"node:fs/promises";async function a(r,a){let s={created:[],updated:[],unchanged:[],changed:[]};for(let c of r){let r=e(c.path),l=await o(c,r);if(!l.changed){s.unchanged.push(c.path);continue}a||(await n(t(c.path),{recursive:!0}),await i(c.path,l.content,`utf-8`)),s.changed.push(c.path),r?s.updated.push(c.path):s.created.push(c.path)}return s}async function o(e,t){let n=s(e.body);return t?{content:n,changed:await r(e.path,`utf-8`)!==n}:{content:n,changed:!0}}function s(e){return e.endsWith(`
|
|
2
2
|
`)?e:`${e}\n`}export{a as applyManagedMutations};
|
|
3
3
|
//# sourceMappingURL=fs.js.map
|
package/dist/stats.html
CHANGED
|
@@ -4930,7 +4930,7 @@ var drawChart = (function (exports) {
|
|
|
4930
4930
|
</script>
|
|
4931
4931
|
<script>
|
|
4932
4932
|
/*<!--*/
|
|
4933
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"cli.d.ts","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/cli.d.ts","uid":"
|
|
4933
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"cli.d.ts","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/cli.d.ts","uid":"bf41b863-1"}]},{"name":"cli.js","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/cli.ts","uid":"bf41b863-3"}]},{"name":"adapters/tool-targets.js","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/adapters/tool-targets.ts","uid":"bf41b863-5"}]},{"name":"commands/setup.js","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/commands/setup.ts","uid":"bf41b863-7"}]},{"name":"commands/shared.js","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/commands/shared.ts","uid":"bf41b863-9"}]},{"name":"commands/update.js","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/commands/update.ts","uid":"bf41b863-11"}]},{"name":"domain/workflow-content.js","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-content.ts","uid":"bf41b863-13"}]},{"name":"domain/workflow-context.js","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-context.ts","uid":"bf41b863-15"}]},{"name":"domain/workflow-templates/done.js","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-templates/done.ts","uid":"bf41b863-17"}]},{"name":"domain/workflow-templates/implement.js","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-templates/implement.ts","uid":"bf41b863-19"}]},{"name":"domain/workflow-templates/init.js","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-templates/init.ts","uid":"bf41b863-21"}]},{"name":"domain/workflow-templates/patch.js","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-templates/patch.ts","uid":"bf41b863-23"}]},{"name":"domain/workflow-templates/plan.js","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-templates/plan.ts","uid":"bf41b863-25"}]},{"name":"domain/workflow-templates/replan.js","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-templates/replan.ts","uid":"bf41b863-27"}]},{"name":"generators/workflow.js","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/generators/workflow.ts","uid":"bf41b863-29"}]},{"name":"runtime/execute.js","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/runtime/execute.ts","uid":"bf41b863-31"}]},{"name":"shared/fs.js","children":[{"name":"home/whj/codes/cat-kit/packages/agent-context/src/shared/fs.ts","uid":"bf41b863-33"}]}],"isRoot":true},"nodeParts":{"bf41b863-1":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-0"},"bf41b863-3":{"renderedLength":1231,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-2"},"bf41b863-5":{"renderedLength":2841,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-4"},"bf41b863-7":{"renderedLength":1002,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-6"},"bf41b863-9":{"renderedLength":973,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-8"},"bf41b863-11":{"renderedLength":752,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-10"},"bf41b863-13":{"renderedLength":340,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-12"},"bf41b863-15":{"renderedLength":926,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-14"},"bf41b863-17":{"renderedLength":1638,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-16"},"bf41b863-19":{"renderedLength":2036,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-18"},"bf41b863-21":{"renderedLength":2170,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-20"},"bf41b863-23":{"renderedLength":1811,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-22"},"bf41b863-25":{"renderedLength":2476,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-24"},"bf41b863-27":{"renderedLength":1720,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-26"},"bf41b863-29":{"renderedLength":468,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-28"},"bf41b863-31":{"renderedLength":750,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-30"},"bf41b863-33":{"renderedLength":1128,"gzipLength":0,"brotliLength":0,"metaUid":"bf41b863-32"}},"nodeMetas":{"bf41b863-0":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/cli.d.ts","moduleParts":{"cli.d.ts":"bf41b863-1"},"imported":[],"importedBy":[],"isEntry":true},"bf41b863-2":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/cli.ts","moduleParts":{"cli.js":"bf41b863-3"},"imported":[{"uid":"bf41b863-34"},{"uid":"bf41b863-35"},{"uid":"bf41b863-6"},{"uid":"bf41b863-10"}],"importedBy":[],"isEntry":true},"bf41b863-4":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/adapters/tool-targets.ts","moduleParts":{"adapters/tool-targets.js":"bf41b863-5"},"imported":[{"uid":"bf41b863-37"},{"uid":"bf41b863-34"}],"importedBy":[{"uid":"bf41b863-6"},{"uid":"bf41b863-10"},{"uid":"bf41b863-30"},{"uid":"bf41b863-28"}]},"bf41b863-6":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/commands/setup.ts","moduleParts":{"commands/setup.js":"bf41b863-7"},"imported":[{"uid":"bf41b863-36"},{"uid":"bf41b863-4"},{"uid":"bf41b863-30"},{"uid":"bf41b863-8"}],"importedBy":[{"uid":"bf41b863-2"}]},"bf41b863-8":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/commands/shared.ts","moduleParts":{"commands/shared.js":"bf41b863-9"},"imported":[{"uid":"bf41b863-37"}],"importedBy":[{"uid":"bf41b863-6"},{"uid":"bf41b863-10"}]},"bf41b863-10":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/commands/update.ts","moduleParts":{"commands/update.js":"bf41b863-11"},"imported":[{"uid":"bf41b863-4"},{"uid":"bf41b863-30"},{"uid":"bf41b863-8"}],"importedBy":[{"uid":"bf41b863-2"}]},"bf41b863-12":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-content.ts","moduleParts":{"domain/workflow-content.js":"bf41b863-13"},"imported":[{"uid":"bf41b863-39"}],"importedBy":[{"uid":"bf41b863-28"}]},"bf41b863-14":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-context.ts","moduleParts":{"domain/workflow-context.js":"bf41b863-15"},"imported":[],"importedBy":[{"uid":"bf41b863-39"},{"uid":"bf41b863-20"},{"uid":"bf41b863-24"},{"uid":"bf41b863-26"},{"uid":"bf41b863-18"},{"uid":"bf41b863-22"},{"uid":"bf41b863-16"}]},"bf41b863-16":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-templates/done.ts","moduleParts":{"domain/workflow-templates/done.js":"bf41b863-17"},"imported":[{"uid":"bf41b863-14"}],"importedBy":[{"uid":"bf41b863-39"}]},"bf41b863-18":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-templates/implement.ts","moduleParts":{"domain/workflow-templates/implement.js":"bf41b863-19"},"imported":[{"uid":"bf41b863-14"}],"importedBy":[{"uid":"bf41b863-39"}]},"bf41b863-20":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-templates/init.ts","moduleParts":{"domain/workflow-templates/init.js":"bf41b863-21"},"imported":[{"uid":"bf41b863-14"}],"importedBy":[{"uid":"bf41b863-39"}]},"bf41b863-22":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-templates/patch.ts","moduleParts":{"domain/workflow-templates/patch.js":"bf41b863-23"},"imported":[{"uid":"bf41b863-14"}],"importedBy":[{"uid":"bf41b863-39"}]},"bf41b863-24":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-templates/plan.ts","moduleParts":{"domain/workflow-templates/plan.js":"bf41b863-25"},"imported":[{"uid":"bf41b863-14"}],"importedBy":[{"uid":"bf41b863-39"}]},"bf41b863-26":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-templates/replan.ts","moduleParts":{"domain/workflow-templates/replan.js":"bf41b863-27"},"imported":[{"uid":"bf41b863-14"}],"importedBy":[{"uid":"bf41b863-39"}]},"bf41b863-28":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/generators/workflow.ts","moduleParts":{"generators/workflow.js":"bf41b863-29"},"imported":[{"uid":"bf41b863-4"},{"uid":"bf41b863-12"}],"importedBy":[{"uid":"bf41b863-30"}]},"bf41b863-30":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/runtime/execute.ts","moduleParts":{"runtime/execute.js":"bf41b863-31"},"imported":[{"uid":"bf41b863-4"},{"uid":"bf41b863-28"},{"uid":"bf41b863-32"}],"importedBy":[{"uid":"bf41b863-6"},{"uid":"bf41b863-10"}]},"bf41b863-32":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/shared/fs.ts","moduleParts":{"shared/fs.js":"bf41b863-33"},"imported":[{"uid":"bf41b863-37"},{"uid":"bf41b863-34"},{"uid":"bf41b863-38"}],"importedBy":[{"uid":"bf41b863-30"}]},"bf41b863-34":{"id":"node:fs","moduleParts":{},"imported":[],"importedBy":[{"uid":"bf41b863-2"},{"uid":"bf41b863-4"},{"uid":"bf41b863-32"}]},"bf41b863-35":{"id":"commander","moduleParts":{},"imported":[],"importedBy":[{"uid":"bf41b863-2"}]},"bf41b863-36":{"id":"@inquirer/prompts","moduleParts":{},"imported":[],"importedBy":[{"uid":"bf41b863-6"}]},"bf41b863-37":{"id":"node:path","moduleParts":{},"imported":[],"importedBy":[{"uid":"bf41b863-4"},{"uid":"bf41b863-8"},{"uid":"bf41b863-32"}]},"bf41b863-38":{"id":"node:fs/promises","moduleParts":{},"imported":[],"importedBy":[{"uid":"bf41b863-32"}]},"bf41b863-39":{"id":"/home/whj/codes/cat-kit/packages/agent-context/src/domain/workflow-templates/index.ts","moduleParts":{},"imported":[{"uid":"bf41b863-14"},{"uid":"bf41b863-20"},{"uid":"bf41b863-24"},{"uid":"bf41b863-26"},{"uid":"bf41b863-18"},{"uid":"bf41b863-22"},{"uid":"bf41b863-16"}],"importedBy":[{"uid":"bf41b863-12"}]}},"env":{"rollup":"4.23.0"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
|
|
4934
4934
|
|
|
4935
4935
|
const run = () => {
|
|
4936
4936
|
const width = window.innerWidth;
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import { readFileSync } from 'node:fs'
|
|
3
4
|
import { Command } from 'commander'
|
|
4
5
|
|
|
5
6
|
import { setupCommand } from './commands/setup'
|
|
6
7
|
import { updateCommand } from './commands/update'
|
|
7
8
|
|
|
9
|
+
const packageJson = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')) as {
|
|
10
|
+
version?: string
|
|
11
|
+
}
|
|
12
|
+
const packageVersion = typeof packageJson.version === 'string' ? packageJson.version : '0.0.0'
|
|
13
|
+
|
|
8
14
|
const program = new Command()
|
|
9
15
|
|
|
10
|
-
program.name('agent-context').description('Agent Context 工作流生成工具').version(
|
|
16
|
+
program.name('agent-context').description('Agent Context 工作流生成工具').version(packageVersion)
|
|
11
17
|
|
|
12
18
|
program
|
|
13
19
|
.command('setup')
|