@gitkraken/agent-tools 0.0.0-stage → 0.2.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/LICENSE +19 -0
  3. package/README.md +163 -2
  4. package/dist/agents.d.ts +52 -0
  5. package/dist/agents.js +1 -0
  6. package/dist/config.d.ts +69 -0
  7. package/dist/config.js +1 -0
  8. package/dist/file-change.d.ts +28 -0
  9. package/dist/file-change.js +1 -0
  10. package/dist/hooks/claude.d.ts +16 -0
  11. package/dist/hooks/claude.js +3 -0
  12. package/dist/hooks/errors.d.ts +10 -0
  13. package/dist/hooks/errors.js +1 -0
  14. package/dist/hooks/events.d.ts +73 -0
  15. package/dist/hooks/events.js +1 -0
  16. package/dist/hooks/install.d.ts +15 -0
  17. package/dist/hooks/install.js +1 -0
  18. package/dist/hooks/results.d.ts +30 -0
  19. package/dist/hooks/results.js +1 -0
  20. package/dist/hooks/templates.d.ts +15 -0
  21. package/dist/hooks/templates.js +278 -0
  22. package/dist/hooks/writers.d.ts +18 -0
  23. package/dist/hooks/writers.js +1 -0
  24. package/dist/index.d.ts +18 -0
  25. package/dist/index.js +1 -0
  26. package/dist/mcp/cli-install-command.d.ts +27 -0
  27. package/dist/mcp/cli-install-command.js +1 -0
  28. package/dist/mcp/clients.d.ts +96 -0
  29. package/dist/mcp/clients.js +1 -0
  30. package/dist/mcp/config-entry.d.ts +15 -0
  31. package/dist/mcp/config-entry.js +1 -0
  32. package/dist/mcp/index.d.ts +7 -0
  33. package/dist/mcp/index.js +1 -0
  34. package/dist/mcp/installer.d.ts +130 -0
  35. package/dist/mcp/installer.js +3 -0
  36. package/dist/mcp/jsonc-edit.d.ts +43 -0
  37. package/dist/mcp/jsonc-edit.js +3 -0
  38. package/dist/mcp/opencode-layout.d.ts +54 -0
  39. package/dist/mcp/opencode-layout.js +1 -0
  40. package/dist/mcp/toml-read.d.ts +11 -0
  41. package/dist/mcp/toml-read.js +1 -0
  42. package/dist/mcp/toml-safety.d.ts +7 -0
  43. package/dist/mcp/toml-safety.js +1 -0
  44. package/dist/mcp/toml-splice.d.ts +16 -0
  45. package/dist/mcp/toml-splice.js +11 -0
  46. package/dist/mcp/uninstaller.d.ts +41 -0
  47. package/dist/mcp/uninstaller.js +1 -0
  48. package/dist/skills/index.d.ts +4 -0
  49. package/dist/skills/index.js +1 -0
  50. package/dist/skills/install.d.ts +126 -0
  51. package/dist/skills/install.js +1 -0
  52. package/dist/skills/manifest.d.ts +56 -0
  53. package/dist/skills/manifest.js +1 -0
  54. package/dist/skills/skill-dirs.d.ts +22 -0
  55. package/dist/skills/skill-dirs.js +1 -0
  56. package/dist/testing/index.d.ts +2 -0
  57. package/dist/testing/index.js +1 -0
  58. package/dist/testing/memory-fs.d.ts +22 -0
  59. package/dist/testing/memory-fs.js +1 -0
  60. package/package.json +39 -3
@@ -0,0 +1 @@
1
+ import{joinPath as e}from"../config.js";const t=[`claude-code`,`opencode`,`cursor`,`codex`,`copilot`,`antigravity`,`pi`,`augment`,`grok`];function n(){return[...t]}function r(e){return t.includes(e)}function i(t){return t.paths.piAgentDir||e(t.paths.home,`.pi`,`agent`)}function a(t){return t.paths.grokHome||e(t.paths.home,`.grok`)}function o(t,n){switch(t){case`claude-code`:return n.paths.claudeConfigDir?e(n.paths.claudeConfigDir,`skills`):e(n.paths.home,`.claude`,`skills`);case`opencode`:return e(n.paths.configHome,`opencode`,`skills`);case`cursor`:return e(n.paths.home,`.cursor`,`skills`);case`codex`:return e(n.paths.home,`.agents`,`skills`);case`copilot`:return n.paths.copilotHome?e(n.paths.copilotHome,`skills`):e(n.paths.home,`.copilot`,`skills`);case`antigravity`:return e(n.paths.home,`.gemini`,`config`,`skills`);case`pi`:return e(i(n),`skills`);case`augment`:return e(n.paths.home,`.augment`,`skills`);case`grok`:return e(a(n),`skills`);default:throw Error(`"${t}" is not a supported client`)}}export{n as allSkillAgents,r as isSkillAgentSupported,o as skillDir};
@@ -0,0 +1,2 @@
1
+ import { MemoryFileSystem } from "./memory-fs.js";
2
+ export { MemoryFileSystem };
@@ -0,0 +1 @@
1
+ import{MemoryFileSystem as e}from"./memory-fs.js";export{e as MemoryFileSystem};
@@ -0,0 +1,22 @@
1
+ import { FileSystemPort } from "@gitkraken/shared-tools";
2
+
3
+ //#region src/testing/memory-fs.d.ts
4
+ /** In-memory {@link FileSystemPort}, for a host's own tests driving `installMcp`/`installSkill` and friends without touching a real filesystem. */
5
+ declare class MemoryFileSystem implements FileSystemPort {
6
+ private readonly files;
7
+ private readonly directories;
8
+ constructor(seed?: Record<string, string>);
9
+ readFile(path: string): Promise<string | null>;
10
+ writeFile(path: string, content: string, _options?: {
11
+ mode?: number;
12
+ }): Promise<void>;
13
+ remove(path: string, options?: {
14
+ recursive?: boolean;
15
+ }): Promise<void>;
16
+ readDir(path: string): Promise<string[] | null>;
17
+ /** Full path -> content snapshot, for assertions in a host's own tests. Not part of {@link FileSystemPort}. */
18
+ snapshot(): Record<string, string>;
19
+ private addParentDirectories;
20
+ }
21
+ //#endregion
22
+ export { MemoryFileSystem };
@@ -0,0 +1 @@
1
+ var e=class{files=new Map;directories=new Set([`/`]);constructor(e){if(e)for(let[n,r]of Object.entries(e)){let e=t(n);this.files.set(e,r),this.addParentDirectories(e)}}async readFile(e){return this.files.get(t(e))??null}async writeFile(e,n,r){let i=t(e);this.files.set(i,n),this.addParentDirectories(i)}async remove(e,n){let r=t(e),i=`${r}/`;if(this.files.has(r)){this.files.delete(r);return}if(!this.directories.has(r))return;if(!n?.recursive){if((await this.readDir(r))?.length)throw Error(`directory not empty: ${r}`);r!==`/`&&this.directories.delete(r);return}let a=r===`/`?`/`:i;for(let e of this.files.keys())e.startsWith(a)&&this.files.delete(e);for(let e of this.directories)(e===r||e.startsWith(a))&&e!==`/`&&this.directories.delete(e)}async readDir(e){let n=t(e);if(!this.directories.has(n))return null;let r=n===`/`?`/`:`${n}/`,i=new Set;for(let e of[...this.files.keys(),...this.directories])if(e.startsWith(r)){let t=e.slice(r.length);t&&i.add(t.split(`/`)[0])}return[...i]}snapshot(){return Object.fromEntries(this.files)}addParentDirectories(e){for(let t=0;t<e.length-1;t++)e[t]===`/`&&(t===0?this.directories.add(`/`):(t===2&&/^[A-Za-z]:$/.test(e.slice(0,t)),this.directories.add(e.slice(0,t))))}};function t(e){let t=e;for(;t.endsWith(`/`)&&t.length>1;)t=t.slice(0,-1);return t}export{e as MemoryFileSystem};
package/package.json CHANGED
@@ -1,6 +1,42 @@
1
1
  {
2
2
  "name": "@gitkraken/agent-tools",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0",
4
+ "description": "Host configuration and path helpers for AI coding agent integrations, with an in-memory filesystem for testing.",
5
+ "license": "SEE LICENSE IN LICENSE",
6
+ "author": "Axosoft, LLC dba GitKraken",
7
+ "engines": {
8
+ "node": ">= 22"
9
+ },
10
+ "type": "module",
11
+ "sideEffects": false,
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/index.js"
16
+ },
17
+ "./testing": {
18
+ "types": "./dist/testing/index.d.ts",
19
+ "default": "./dist/testing/index.js"
20
+ }
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "CHANGELOG.md"
25
+ ],
26
+ "dependencies": {
27
+ "jsonc-parser": "^3.3.1",
28
+ "smol-toml": "^1.9.0",
29
+ "@gitkraken/shared-tools": "^0.3.0"
30
+ },
31
+ "devDependencies": {
32
+ "@types/node": "^22.0.0",
33
+ "typescript": "^6.0.2",
34
+ "vitest": "^4.1.1"
35
+ },
36
+ "scripts": {
37
+ "build": "tsdown --config-loader=unrun",
38
+ "build:dev": "tsdown --config tsdown.dev.config.ts --config-loader=unrun",
39
+ "typecheck": "tsc --noEmit",
40
+ "test": "vitest run"
41
+ }
6
42
  }