@patchen0518/agentbrew 1.2.5 → 1.3.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-state.js","sourceRoot":"","sources":["../src/sync-state.ts"],"names":[],"mappings":";;;;;;AAkBA,kDAEC;AAED,0CAqBC;AAED,0CAIC;AAjDD,4CAAoB;AACpB,gDAAwB;AACxB,qCAAuC;AAE1B,QAAA,kBAAkB,GAAG,oBAAoB,CAAC;AAcvD,SAAgB,mBAAmB,CAAC,QAAiB;IACnD,OAAO,cAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAA,oBAAW,GAAE,EAAE,0BAAkB,CAAC,CAAC;AAClE,CAAC;AAED,SAAgB,eAAe,CAAC,QAAiB;IAC/C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,mBAAmB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QAChF,iEAAiE;QACjE,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;YAC9B,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACvJ,CAAC;QACD,OAAO;YACL,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,EAAE;YACxB,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,EAAE;YACxB,QAAQ,EAAE,GAAG,CAAC,QAAQ,IAAI,EAAE;YAC5B,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,KAAK;YAC3B,SAAS,EAAE,GAAG,CAAC,SAAS,IAAI,KAAK;YACjC,WAAW,EAAE,GAAG,CAAC,WAAW,IAAI,EAAE;YAClC,QAAQ,EAAE,GAAG,CAAC,QAAQ,IAAI,KAAK;YAC/B,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE;YACpB,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,KAAK;SAC9B,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC/I,CAAC;AACH,CAAC;AAED,SAAgB,eAAe,CAAC,KAAkB,EAAE,QAAiB;IACnE,MAAM,CAAC,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACxC,YAAE,CAAC,SAAS,CAAC,cAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACnD,YAAE,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AAC/D,CAAC"}
package/dist/sync.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { PackageInfo } from './registry';
2
+ import { AgentSkillConfig } from './agent-registry';
2
3
  export interface SkillEntry {
3
4
  packageName: string;
4
5
  skillName: string;
@@ -17,68 +18,28 @@ export interface SkillSyncResult {
17
18
  */
18
19
  export declare function extractSkillEntries(packages: PackageInfo[]): SkillEntry[];
19
20
  /**
20
- * Symlinks each skill directory into ~/.claude/skills/<pkgName>-<skillName>
21
- * so Claude Code can discover them as invocable skills.
21
+ * Generic skill sync for any agent in AGENT_SKILL_REGISTRY.
22
22
  */
23
- export declare function syncSkillsToClaudeCode(skills: SkillEntry[], brewRoot?: string): SkillSyncResult[];
23
+ export declare function syncSkillsToAgent(agent: AgentSkillConfig, skills: SkillEntry[], brewRoot?: string): SkillSyncResult[];
24
24
  /**
25
- * Removes all skill symlinks previously created by syncSkillsToClaudeCode.
25
+ * Generic skill unsync for any agent in AGENT_SKILL_REGISTRY.
26
26
  */
27
+ export declare function unsyncSkillsFromAgent(agent: AgentSkillConfig, brewRoot?: string): SkillSyncResult[];
28
+ export declare function syncSkillsToClaudeCode(skills: SkillEntry[], brewRoot?: string): SkillSyncResult[];
27
29
  export declare function unsyncSkillsFromClaudeCode(brewRoot?: string): SkillSyncResult[];
28
- /**
29
- * Registers skills with Gemini CLI by creating an agentbrew extension at
30
- * ~/.gemini/extensions/agentbrew/ and symlinking each skill's directory into
31
- * ~/.gemini/extensions/agentbrew/skills/<pkgName>-<skillName>.
32
- */
33
30
  export declare function syncSkillsToGeminiCLI(skills: SkillEntry[], brewRoot?: string): SkillSyncResult[];
34
- /**
35
- * Removes Gemini CLI skill symlinks, the extension manifest, and the
36
- * agentbrew extension entry from extension-enablement.json.
37
- */
38
31
  export declare function unsyncSkillsFromGeminiCLI(brewRoot?: string): SkillSyncResult[];
39
- /**
40
- * Symlinks each skill directory into ~/.codeium/windsurf/skills/<pkgName>-<skillName>
41
- * so Windsurf can discover them.
42
- */
43
32
  export declare function syncSkillsToWindsurf(skills: SkillEntry[], brewRoot?: string): SkillSyncResult[];
44
- /**
45
- * Removes all Windsurf skill symlinks previously created by syncSkillsToWindsurf.
46
- */
47
33
  export declare function unsyncSkillsFromWindsurf(brewRoot?: string): SkillSyncResult[];
48
- /**
49
- * Symlinks each skill directory into ~/.gemini/antigravity-cli/skills/<pkgName>-<skillName>
50
- * so Antigravity CLI can auto-discover them.
51
- */
52
34
  export declare function syncSkillsToAntigravityCLI(skills: SkillEntry[], brewRoot?: string): SkillSyncResult[];
53
- /**
54
- * Removes all Antigravity CLI skill symlinks previously created by syncSkillsToAntigravityCLI.
55
- */
56
35
  export declare function unsyncSkillsFromAntigravityCLI(brewRoot?: string): SkillSyncResult[];
36
+ export declare function syncSkillsToKiro(skills: SkillEntry[], brewRoot?: string): SkillSyncResult[];
37
+ export declare function unsyncSkillsFromKiro(brewRoot?: string): SkillSyncResult[];
57
38
  /**
58
39
  * Removes symlinks whose targets no longer exist (e.g. after a package is uninstalled).
59
40
  * Call after `agentbrew uninstall` to prevent stale entries.
60
41
  */
61
42
  export declare function cleanOrphanSkills(brewRoot?: string): SkillSyncResult[];
62
- /**
63
- * Adds agentbrew to ~/.cursor/mcp.json so Cursor can discover MCP tools directly.
64
- * Merges into any existing config without disturbing other servers.
65
- */
66
- export declare function syncMcpServerToCursor(brewRoot?: string): SkillSyncResult[];
67
- /**
68
- * Removes the agentbrew entry from ~/.cursor/mcp.json.
69
- * Leaves other servers intact; removes the file only if it becomes empty.
70
- */
71
- export declare function unsyncMcpServerFromCursor(brewRoot?: string): SkillSyncResult[];
72
- /**
73
- * Adds agentbrew to ~/.codex/config.toml so Codex CLI can discover MCP tools directly.
74
- * Appends the [mcp_servers.agentbrew] section without disturbing existing content.
75
- */
76
- export declare function syncMcpServerToCodex(brewRoot?: string): SkillSyncResult[];
77
- /**
78
- * Removes the agentbrew entry from ~/.codex/config.toml.
79
- * Leaves the file in place; other sections are untouched.
80
- */
81
- export declare function unsyncMcpServerFromCodex(brewRoot?: string): SkillSyncResult[];
82
43
  /**
83
44
  * Writes a single skills index file to ~/.cursor/rules/agentbrew-skills-index.md
84
45
  * listing all AgentBrew skills with paths for on-demand discovery.
@@ -89,72 +50,5 @@ export declare function syncSkillsToCursor(skills: SkillEntry[], brewRoot?: stri
89
50
  * Removes the AgentBrew skills index file from ~/.cursor/rules/.
90
51
  */
91
52
  export declare function unsyncSkillsFromCursor(brewRoot?: string): SkillSyncResult[];
92
- /**
93
- * Symlinks each skill directory into ~/.kiro/skills/<pkgName>-<skillName>
94
- * so Kiro can discover them as invocable skills.
95
- */
96
- export declare function syncSkillsToKiro(skills: SkillEntry[], brewRoot?: string): SkillSyncResult[];
97
- /**
98
- * Removes all Kiro skill symlinks previously created by syncSkillsToKiro.
99
- */
100
- export declare function unsyncSkillsFromKiro(brewRoot?: string): SkillSyncResult[];
101
- /**
102
- * Adds agentbrew to ~/.kiro/settings/mcp.json so Kiro can discover MCP tools directly.
103
- * Merges into any existing config without disturbing other servers.
104
- */
105
- export declare function syncMcpServerToKiro(brewRoot?: string): SkillSyncResult[];
106
- /**
107
- * Removes the agentbrew entry from ~/.kiro/settings/mcp.json.
108
- * Leaves other servers intact; removes the file only if it becomes empty.
109
- */
110
- export declare function unsyncMcpServerFromKiro(brewRoot?: string): SkillSyncResult[];
111
- export declare const MARKER_START = "<!-- agentbrew:shared:start -->";
112
- export declare const MARKER_END = "<!-- agentbrew:shared:end -->";
113
- export declare const INSTRUCTIONS_FILE = "INSTRUCTIONS.md";
114
- export interface AgentTarget {
115
- name: string;
116
- /** Absolute path to the agent's global config file. null = UI-managed; print manual instructions instead. */
117
- configPath: string | null;
118
- /** When true, agentbrew owns the entire file (no markers needed; overwrite entirely). */
119
- isFileOwned: boolean;
120
- /** Shown in sync output when configPath is null. */
121
- manualInstructions?: string;
122
- /**
123
- * Optional YAML/text block prepended verbatim at the very start of owned files.
124
- * Used for agents that require frontmatter before any other content (e.g. Kiro steering files).
125
- */
126
- frontmatter?: string;
127
- /**
128
- * For isFileOwned targets, the top-level agent directory to check for existence before
129
- * creating the config file. If the directory doesn't exist, the target is skipped (agent
130
- * not installed). Without this, agentbrew would create the directory and file unconditionally.
131
- */
132
- agentRootDir?: string;
133
- }
134
- export declare function getDefaultTargets(): AgentTarget[];
135
- export declare function getInstructionsPath(brewRoot?: string): string;
136
- export declare function buildInjectedSection(content: string): string;
137
- /**
138
- * Injects (or updates) the agentbrew section in a file.
139
- * Creates the file and any parent directories if they don't exist.
140
- */
141
- export declare function injectIntoFile(filePath: string, content: string): 'created' | 'updated' | 'unchanged';
142
- /**
143
- * Removes the agentbrew section from a file, leaving surrounding content intact.
144
- */
145
- export declare function removeFromFile(filePath: string): 'removed' | 'not_found' | 'no_section';
146
- export interface SyncResult {
147
- agent: string;
148
- status: 'created' | 'updated' | 'unchanged' | 'skipped' | 'manual' | 'removed' | 'not_found' | 'no_section';
149
- path?: string;
150
- note?: string;
151
- }
152
- /**
153
- * Syncs ~/.agentbrew/INSTRUCTIONS.md into each target agent's global config file.
154
- * Accepts an optional `targets` override (used in tests).
155
- */
156
- export declare function syncInstructions(targets?: AgentTarget[], brewRoot?: string): SyncResult[];
157
- /**
158
- * Removes the agentbrew section from all target agent config files.
159
- */
160
- export declare function unsyncInstructions(targets?: AgentTarget[]): SyncResult[];
53
+ export { syncMcpServerToCursor, unsyncMcpServerFromCursor, syncMcpServerToCodex, unsyncMcpServerFromCodex, syncMcpServerToKiro, unsyncMcpServerFromKiro, } from './sync-mcp';
54
+ export { MARKER_START, MARKER_END, INSTRUCTIONS_FILE, AgentTarget, SyncResult, getDefaultTargets, getInstructionsPath, buildInjectedSection, injectIntoFile, removeFromFile, syncInstructions, unsyncInstructions, } from './sync-instructions';