@a1st/aix-core 0.0.6 → 0.0.12
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/README.md +6 -6
- package/dist/editors/adapters/claude-code.js +3 -3
- package/dist/editors/adapters/claude-code.js.map +1 -1
- package/dist/editors/adapters/codex.d.ts +25 -7
- package/dist/editors/adapters/codex.d.ts.map +1 -1
- package/dist/editors/adapters/codex.js +82 -10
- package/dist/editors/adapters/codex.js.map +1 -1
- package/dist/editors/adapters/{vscode.d.ts → copilot.d.ts} +6 -6
- package/dist/editors/adapters/copilot.d.ts.map +1 -0
- package/dist/editors/adapters/{vscode.js → copilot.js} +12 -12
- package/dist/editors/adapters/copilot.js.map +1 -0
- package/dist/editors/adapters/index.d.ts +1 -1
- package/dist/editors/adapters/index.d.ts.map +1 -1
- package/dist/editors/adapters/index.js +1 -1
- package/dist/editors/adapters/index.js.map +1 -1
- package/dist/editors/import.d.ts.map +1 -1
- package/dist/editors/import.js +31 -8
- package/dist/editors/import.js.map +1 -1
- package/dist/editors/index.d.ts +1 -1
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +1 -1
- package/dist/editors/index.js.map +1 -1
- package/dist/editors/install.js +2 -2
- package/dist/editors/install.js.map +1 -1
- package/dist/editors/strategies/claude-code/hooks.d.ts.map +1 -1
- package/dist/editors/strategies/claude-code/hooks.js +35 -5
- package/dist/editors/strategies/claude-code/hooks.js.map +1 -1
- package/dist/editors/strategies/codex/index.d.ts +1 -1
- package/dist/editors/strategies/codex/index.d.ts.map +1 -1
- package/dist/editors/strategies/codex/index.js +1 -1
- package/dist/editors/strategies/codex/index.js.map +1 -1
- package/dist/editors/strategies/codex/mcp.d.ts +0 -10
- package/dist/editors/strategies/codex/mcp.d.ts.map +1 -1
- package/dist/editors/strategies/codex/mcp.js +13 -27
- package/dist/editors/strategies/codex/mcp.js.map +1 -1
- package/dist/editors/strategies/codex/prompts.d.ts +1 -1
- package/dist/editors/strategies/codex/prompts.js +2 -2
- package/dist/editors/strategies/codex/prompts.js.map +1 -1
- package/dist/editors/strategies/codex/rules.d.ts +3 -2
- package/dist/editors/strategies/codex/rules.d.ts.map +1 -1
- package/dist/editors/strategies/codex/rules.js +5 -4
- package/dist/editors/strategies/codex/rules.js.map +1 -1
- package/dist/editors/strategies/copilot/hooks.d.ts +14 -0
- package/dist/editors/strategies/copilot/hooks.d.ts.map +1 -0
- package/dist/editors/strategies/copilot/hooks.js +95 -0
- package/dist/editors/strategies/copilot/hooks.js.map +1 -0
- package/dist/editors/strategies/copilot/index.d.ts +5 -0
- package/dist/editors/strategies/copilot/index.d.ts.map +1 -0
- package/dist/editors/strategies/copilot/index.js +5 -0
- package/dist/editors/strategies/copilot/index.js.map +1 -0
- package/dist/editors/strategies/{vscode → copilot}/mcp.d.ts +2 -2
- package/dist/editors/strategies/copilot/mcp.d.ts.map +1 -0
- package/dist/editors/strategies/{vscode → copilot}/mcp.js +4 -4
- package/dist/editors/strategies/copilot/mcp.js.map +1 -0
- package/dist/editors/strategies/{vscode → copilot}/prompts.d.ts +5 -5
- package/dist/editors/strategies/copilot/prompts.d.ts.map +1 -0
- package/dist/editors/strategies/{vscode → copilot}/prompts.js +6 -6
- package/dist/editors/strategies/copilot/prompts.js.map +1 -0
- package/dist/editors/strategies/{vscode → copilot}/rules.d.ts +2 -2
- package/dist/editors/strategies/copilot/rules.d.ts.map +1 -0
- package/dist/editors/strategies/{vscode → copilot}/rules.js +5 -5
- package/dist/editors/strategies/copilot/rules.js.map +1 -0
- package/dist/editors/strategies/cursor/hooks.d.ts.map +1 -1
- package/dist/editors/strategies/cursor/hooks.js +11 -0
- package/dist/editors/strategies/cursor/hooks.js.map +1 -1
- package/dist/editors/strategies/index.d.ts +1 -1
- package/dist/editors/strategies/index.d.ts.map +1 -1
- package/dist/editors/strategies/index.js +1 -1
- package/dist/editors/strategies/index.js.map +1 -1
- package/dist/editors/strategies/shared/native-skills.d.ts +1 -1
- package/dist/editors/strategies/shared/native-skills.js +1 -1
- package/dist/editors/strategies/shared/no-hooks.d.ts +1 -1
- package/dist/editors/strategies/shared/no-hooks.js +1 -1
- package/dist/editors/strategies/shared/no-mcp.d.ts +1 -1
- package/dist/editors/strategies/shared/no-mcp.js +1 -1
- package/dist/editors/types.d.ts +1 -1
- package/dist/editors/types.d.ts.map +1 -1
- package/dist/frontmatter-parser.d.ts +1 -1
- package/dist/frontmatter-parser.js +3 -3
- package/dist/frontmatter-parser.js.map +1 -1
- package/dist/global/processor.d.ts.map +1 -1
- package/dist/global/processor.js +27 -12
- package/dist/global/processor.js.map +1 -1
- package/dist/global/types.d.ts +2 -0
- package/dist/global/types.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/editors/adapters/vscode.d.ts.map +0 -1
- package/dist/editors/adapters/vscode.js.map +0 -1
- package/dist/editors/strategies/vscode/index.d.ts +0 -4
- package/dist/editors/strategies/vscode/index.d.ts.map +0 -1
- package/dist/editors/strategies/vscode/index.js +0 -4
- package/dist/editors/strategies/vscode/index.js.map +0 -1
- package/dist/editors/strategies/vscode/mcp.d.ts.map +0 -1
- package/dist/editors/strategies/vscode/mcp.js.map +0 -1
- package/dist/editors/strategies/vscode/prompts.d.ts.map +0 -1
- package/dist/editors/strategies/vscode/prompts.js.map +0 -1
- package/dist/editors/strategies/vscode/rules.d.ts.map +0 -1
- package/dist/editors/strategies/vscode/rules.js.map +0 -1
|
@@ -4,22 +4,47 @@
|
|
|
4
4
|
const EVENT_MAP = {
|
|
5
5
|
pre_tool_use: 'PreToolUse',
|
|
6
6
|
post_tool_use: 'PostToolUse',
|
|
7
|
-
|
|
7
|
+
pre_file_read: 'PreToolUse',
|
|
8
|
+
post_file_read: 'PostToolUse',
|
|
9
|
+
pre_file_write: 'PreToolUse',
|
|
10
|
+
post_file_write: 'PostToolUse',
|
|
11
|
+
pre_command: 'PreToolUse',
|
|
8
12
|
post_command: 'PostToolUse',
|
|
13
|
+
pre_mcp_tool: 'PreToolUse',
|
|
14
|
+
post_mcp_tool: 'PostToolUse',
|
|
9
15
|
session_start: 'SessionStart',
|
|
10
16
|
session_end: 'SessionEnd',
|
|
11
17
|
agent_stop: 'Stop',
|
|
12
18
|
pre_prompt: 'UserPromptSubmit',
|
|
13
19
|
};
|
|
14
20
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
21
|
+
* Tool-name matchers to inject for events that target a specific Claude Code tool.
|
|
22
|
+
* Events not listed here use the user-supplied matcher (or empty string for all tools).
|
|
23
|
+
*/
|
|
24
|
+
const TOOL_MATCHER_MAP = {
|
|
25
|
+
pre_command: 'Bash',
|
|
26
|
+
post_command: 'Bash',
|
|
27
|
+
pre_file_read: 'Read',
|
|
28
|
+
post_file_read: 'Read',
|
|
29
|
+
pre_file_write: 'Write|Edit',
|
|
30
|
+
post_file_write: 'Write|Edit',
|
|
31
|
+
pre_mcp_tool: 'mcp__.*',
|
|
32
|
+
post_mcp_tool: 'mcp__.*',
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Events that Claude Code supports.
|
|
17
36
|
*/
|
|
18
37
|
const SUPPORTED_EVENTS = new Set([
|
|
19
38
|
'pre_tool_use',
|
|
20
39
|
'post_tool_use',
|
|
40
|
+
'pre_file_read',
|
|
41
|
+
'post_file_read',
|
|
42
|
+
'pre_file_write',
|
|
43
|
+
'post_file_write',
|
|
21
44
|
'pre_command',
|
|
22
45
|
'post_command',
|
|
46
|
+
'pre_mcp_tool',
|
|
47
|
+
'post_mcp_tool',
|
|
23
48
|
'session_start',
|
|
24
49
|
'session_end',
|
|
25
50
|
'agent_stop',
|
|
@@ -46,14 +71,19 @@ export class ClaudeCodeHooksStrategy {
|
|
|
46
71
|
if (!claudeEvent) {
|
|
47
72
|
continue;
|
|
48
73
|
}
|
|
49
|
-
|
|
50
|
-
|
|
74
|
+
const toolMatcher = TOOL_MATCHER_MAP[event];
|
|
75
|
+
const mapped = matchers.map((matcher) => ({
|
|
76
|
+
matcher: toolMatcher ?? matcher.matcher ?? '',
|
|
51
77
|
hooks: matcher.hooks.map((hook) => ({
|
|
52
78
|
type: 'command',
|
|
53
79
|
command: hook.command,
|
|
54
80
|
...(hook.timeout && { timeout: hook.timeout }),
|
|
55
81
|
})),
|
|
56
82
|
}));
|
|
83
|
+
if (!claudeHooks[claudeEvent]) {
|
|
84
|
+
claudeHooks[claudeEvent] = [];
|
|
85
|
+
}
|
|
86
|
+
claudeHooks[claudeEvent].push(...mapped);
|
|
57
87
|
}
|
|
58
88
|
return JSON.stringify({ hooks: claudeHooks }, null, 2) + '\n';
|
|
59
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../../src/editors/strategies/claude-code/hooks.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,SAAS,GAA2B;IACvC,YAAY,EAAE,YAAY;IAC1B,aAAa,EAAE,aAAa;IAC5B,
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../../src/editors/strategies/claude-code/hooks.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,SAAS,GAA2B;IACvC,YAAY,EAAE,YAAY;IAC1B,aAAa,EAAE,aAAa;IAC5B,aAAa,EAAE,YAAY;IAC3B,cAAc,EAAE,aAAa;IAC7B,cAAc,EAAE,YAAY;IAC5B,eAAe,EAAE,aAAa;IAC9B,WAAW,EAAE,YAAY;IACzB,YAAY,EAAE,aAAa;IAC3B,YAAY,EAAE,YAAY;IAC1B,aAAa,EAAE,aAAa;IAC5B,aAAa,EAAE,cAAc;IAC7B,WAAW,EAAE,YAAY;IACzB,UAAU,EAAE,MAAM;IAClB,UAAU,EAAE,kBAAkB;CAChC,CAAC;AAEF;;;GAGG;AACH,MAAM,gBAAgB,GAA2B;IAC9C,WAAW,EAAE,MAAM;IACnB,YAAY,EAAE,MAAM;IACpB,aAAa,EAAE,MAAM;IACrB,cAAc,EAAE,MAAM;IACtB,cAAc,EAAE,YAAY;IAC5B,e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AI,EAAE,SAAkB;oBACxB,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;iBAChD,CAAC,CAAC;aACL,CAAC,CAAC,CAAC;YAEJ,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC7B,WAAW,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC;YACjC,CAAC;YACD,WAAW,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;IACjE,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/codex/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/codex/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editors/strategies/codex/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editors/strategies/codex/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
import type { McpServerConfig } from '@a1st/aix-schema';
|
|
2
1
|
import { GlobalMcpStrategy } from '../shared/global-mcp.js';
|
|
3
|
-
/**
|
|
4
|
-
* Parse Codex's config.toml format for MCP servers.
|
|
5
|
-
* Uses confbox for TOML parsing. Outputs shorthand config without defaults.
|
|
6
|
-
*/
|
|
7
|
-
declare function parseCodexMcp(content: string): Promise<{
|
|
8
|
-
mcp: Record<string, McpServerConfig>;
|
|
9
|
-
warnings: string[];
|
|
10
|
-
}>;
|
|
11
2
|
/**
|
|
12
3
|
* Codex MCP strategy. Uses global-only config at ~/.codex/config.toml.
|
|
13
4
|
*/
|
|
14
5
|
export declare class CodexMcpStrategy extends GlobalMcpStrategy {
|
|
15
6
|
constructor();
|
|
16
7
|
}
|
|
17
|
-
export { parseCodexMcp };
|
|
18
8
|
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/codex/mcp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/codex/mcp.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAgF5D;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,iBAAiB;;CAUtD"}
|
|
@@ -1,43 +1,40 @@
|
|
|
1
|
+
import { parseTOML, stringifyTOML } from 'confbox';
|
|
1
2
|
import { GlobalMcpStrategy } from '../shared/global-mcp.js';
|
|
2
3
|
/**
|
|
3
4
|
* Format MCP config for Codex's config.toml format.
|
|
4
5
|
* Codex uses TOML with [mcp_servers.name] sections.
|
|
5
6
|
*/
|
|
6
7
|
function formatCodexMcp(mcp) {
|
|
7
|
-
const
|
|
8
|
+
const mcpServers = {};
|
|
8
9
|
for (const [name, serverConfig] of Object.entries(mcp)) {
|
|
9
10
|
if (serverConfig.enabled === false) {
|
|
10
11
|
continue;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
+
const server = {};
|
|
13
14
|
if ('command' in serverConfig) {
|
|
14
|
-
|
|
15
|
+
server.command = serverConfig.command;
|
|
15
16
|
if (serverConfig.args && serverConfig.args.length > 0) {
|
|
16
|
-
|
|
17
|
-
lines.push(`args = [${argsStr}]`);
|
|
17
|
+
server.args = serverConfig.args;
|
|
18
18
|
}
|
|
19
19
|
if (serverConfig.env && Object.keys(serverConfig.env).length > 0) {
|
|
20
|
-
|
|
21
|
-
for (const [key, value] of Object.entries(serverConfig.env)) {
|
|
22
|
-
lines.push(`${key} = "${value}"`);
|
|
23
|
-
}
|
|
20
|
+
server.env = serverConfig.env;
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
23
|
else if ('url' in serverConfig) {
|
|
27
|
-
|
|
24
|
+
server.url = serverConfig.url;
|
|
28
25
|
}
|
|
29
|
-
|
|
26
|
+
mcpServers[name] = server;
|
|
30
27
|
}
|
|
31
|
-
return
|
|
28
|
+
return stringifyTOML({ mcp_servers: mcpServers });
|
|
32
29
|
}
|
|
33
30
|
/**
|
|
34
31
|
* Parse Codex's config.toml format for MCP servers.
|
|
35
|
-
*
|
|
32
|
+
* Outputs shorthand config without defaults.
|
|
36
33
|
*/
|
|
37
|
-
|
|
34
|
+
function parseCodexMcp(content) {
|
|
38
35
|
const mcp = {}, warnings = [];
|
|
39
36
|
try {
|
|
40
|
-
const
|
|
37
|
+
const config = parseTOML(content), servers = config.mcp_servers ?? {};
|
|
41
38
|
for (const [name, server] of Object.entries(servers)) {
|
|
42
39
|
const s = server;
|
|
43
40
|
if (s.command) {
|
|
@@ -65,16 +62,6 @@ async function parseCodexMcp(content) {
|
|
|
65
62
|
}
|
|
66
63
|
return { mcp, warnings };
|
|
67
64
|
}
|
|
68
|
-
/**
|
|
69
|
-
* Synchronous wrapper for parseCodexMcp that returns empty on parse failure.
|
|
70
|
-
* Used for the McpStrategy interface which expects sync parsing.
|
|
71
|
-
*/
|
|
72
|
-
function parseCodexMcpSync(_content) {
|
|
73
|
-
return {
|
|
74
|
-
mcp: {},
|
|
75
|
-
warnings: ['Codex TOML parsing requires async - use parseCodexMcp instead'],
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
65
|
/**
|
|
79
66
|
* Codex MCP strategy. Uses global-only config at ~/.codex/config.toml.
|
|
80
67
|
*/
|
|
@@ -85,9 +72,8 @@ export class CodexMcpStrategy extends GlobalMcpStrategy {
|
|
|
85
72
|
globalConfigPath: '.codex/config.toml',
|
|
86
73
|
format: 'toml',
|
|
87
74
|
formatFn: formatCodexMcp,
|
|
88
|
-
parseFn:
|
|
75
|
+
parseFn: parseCodexMcp,
|
|
89
76
|
});
|
|
90
77
|
}
|
|
91
78
|
}
|
|
92
|
-
export { parseCodexMcp };
|
|
93
79
|
//# sourceMappingURL=mcp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../../src/editors/strategies/codex/mcp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D;;;GAGG;AACH,SAAS,cAAc,CAAC,GAAoC;IACzD,MAAM,
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../../src/editors/strategies/codex/mcp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAy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CAAC;YAClE,CAAC;QACJ,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACZ,QAAQ,CAAC,IAAI,CAAC,gCAAiC,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,iBAAiB;IACpD;QACG,KAAK,CAAC;YACH,MAAM,EAAE,OAAO;YACf,gBAAgB,EAAE,oBAAoB;YACtC,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,cAAc;YACxB,OAAO,EAAE,aAAa;SACxB,CAAC,CAAC;IACN,CAAC;CACH"}
|
|
@@ -35,7 +35,7 @@ export declare class CodexPromptsStrategy implements PromptsStrategy {
|
|
|
35
35
|
}>;
|
|
36
36
|
/**
|
|
37
37
|
* Detect if content appears to be in Codex's prompt frontmatter format.
|
|
38
|
-
* Codex prompts use `description:` and optionally `argument-hint:` fields (similar to
|
|
38
|
+
* Codex prompts use `description:` and optionally `argument-hint:` fields (similar to GitHub Copilot).
|
|
39
39
|
*/
|
|
40
40
|
detectFormat(content: string): boolean;
|
|
41
41
|
/**
|
|
@@ -81,7 +81,7 @@ export class CodexPromptsStrategy {
|
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* Detect if content appears to be in Codex's prompt frontmatter format.
|
|
84
|
-
* Codex prompts use `description:` and optionally `argument-hint:` fields (similar to
|
|
84
|
+
* Codex prompts use `description:` and optionally `argument-hint:` fields (similar to GitHub Copilot).
|
|
85
85
|
*/
|
|
86
86
|
detectFormat(content) {
|
|
87
87
|
const { frontmatter, hasFrontmatter } = extractFrontmatter(content);
|
|
@@ -89,7 +89,7 @@ export class CodexPromptsStrategy {
|
|
|
89
89
|
return false;
|
|
90
90
|
}
|
|
91
91
|
const lines = frontmatter.split('\n');
|
|
92
|
-
// Codex uses description/argument-hint but NOT mode/tools (
|
|
92
|
+
// Codex uses description/argument-hint but NOT mode/tools (GitHub Copilot) or allowed-tools (Claude)
|
|
93
93
|
return parseYamlValue(lines, 'description') !== undefined
|
|
94
94
|
&& parseYamlValue(lines, 'mode') === undefined
|
|
95
95
|
&& parseYamlValue(lines, 'tools') === undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../../src/editors/strategies/codex/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAG7B,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAEnF;;;GAGG;AACH,MAAM,OAAO,oBAAoB;IAC9B;;OAEG;IACH,WAAW;QACR,OAAO,IAAI,CAAC;IACf,CAAC;IAED;;OAEG;IACH,YAAY;QACT,OAAO,IAAI,CAAC;IACf,CAAC;IAED,aAAa;QACV,OAAO,EAAE,CAAC;IACb,CAAC;IAED,gBAAgB;QACb,OAAO,KAAK,CAAC;IAChB,CAAC;IAED,oBAAoB;QACjB,OAAO,gBAAgB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,qBAAqB;QAClB,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC;IACvD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAAC,IAAY;QAC5B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,GAAG,IAAI,KAAK,CAAC,CAAC;QAEpE,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU,CAAC,IAAY;QAC1B,MAA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,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IACxC,CAAC;IAED;;;OAGG;IACH,YAAY,CAAC,OAAe;QACzB,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAEpE,IAAI,CAAC,cAAc,EAAE,CAAC;YACnB,OAAO,KAAK,CAAC;QAChB,CAAC;QAED,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEtC,
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../../src/editors/strategies/codex/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAG7B,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAEnF;;;GAGG;AACH,MAAM,OAAO,oBAAoB;IAC9B;;OAEG;IACH,WAAW;QACR,OAAO,IAAI,CAAC;IACf,CAAC;IAED;;OAEG;IACH,YAAY;QACT,OAAO,IAAI,CAAC;IACf,CAAC;IAED,aAAa;QACV,OAAO,EAAE,CAAC;IACb,CAAC;IAED,gBAAgB;QACb,OAAO,KAAK,CAAC;IAChB,CAAC;IAED,oBAAoB;QACjB,OAAO,gBAAgB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,qBAAqB;QAClB,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC;IACvD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAAC,IAAY;QAC5B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE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W;YACX,YAAY;SACd,CAAC;IACL,CAAC;CACH"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { RulesStrategy } from '../types.js';
|
|
2
2
|
import type { EditorRule } from '../../types.js';
|
|
3
3
|
/**
|
|
4
|
-
* Codex CLI rules strategy. Uses
|
|
5
|
-
*
|
|
4
|
+
* Codex CLI rules strategy. Uses `AGENTS.md` files at the project root (and optionally in
|
|
5
|
+
* subdirectories for glob-scoped rules). Plain markdown, no frontmatter. The adapter handles
|
|
6
|
+
* bucketing rules into per-directory files.
|
|
6
7
|
*/
|
|
7
8
|
export declare class CodexRulesStrategy implements RulesStrategy {
|
|
8
9
|
getRulesDir(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/codex/rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/codex/rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,aAAa;IACrD,WAAW,IAAI,MAAM;IAKrB,gBAAgB,IAAI,MAAM;IAI1B,kBAAkB,IAAI,MAAM,GAAG,IAAI;IAInC,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE;IAS1E,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM;CActC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Codex CLI rules strategy. Uses
|
|
3
|
-
*
|
|
2
|
+
* Codex CLI rules strategy. Uses `AGENTS.md` files at the project root (and optionally in
|
|
3
|
+
* subdirectories for glob-scoped rules). Plain markdown, no frontmatter. The adapter handles
|
|
4
|
+
* bucketing rules into per-directory files.
|
|
4
5
|
*/
|
|
5
6
|
export class CodexRulesStrategy {
|
|
6
7
|
getRulesDir() {
|
|
7
|
-
// Codex uses AGENTS.md at the
|
|
8
|
-
return '';
|
|
8
|
+
// Codex uses AGENTS.md at the project root, one level above the .codex config dir
|
|
9
|
+
return '..';
|
|
9
10
|
}
|
|
10
11
|
getFileExtension() {
|
|
11
12
|
return '.md';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../../../src/editors/strategies/codex/rules.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../../../src/editors/strategies/codex/rules.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IAC5B,WAAW;QACR,kFAAkF;QAClF,OAAO,IAAI,CAAC;IACf,CAAC;IAED,gBAAgB;QACb,OAAO,KAAK,CAAC;IAChB,CAAC;IAED,kBAAkB;QACf,OAAO,kBAAkB,CAAC;IAC7B,CAAC;IAED,gBAAgB,CAAC,OAAe;QAC7B,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,IAAI,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;YAClB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAClC,CAAC;IAED,UAAU,CAAC,IAAgB;QACxB,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,gDAAgD;QAChD,+FAA+F;QAC/F,MAAM,wBAAwB,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAElE,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,wBAAwB,EAAE,CAAC;YAC1C,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QACrC,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;CACH"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HooksConfig } from '@a1st/aix-schema';
|
|
2
|
+
import type { HooksStrategy } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* GitHub Copilot hooks strategy. Writes hooks to `.github/hooks/hooks.json`.
|
|
5
|
+
* Translates generic ai.json event names to GitHub Copilot's PascalCase format.
|
|
6
|
+
* Uses the same matcher-based structure as Claude Code hooks.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CopilotHooksStrategy implements HooksStrategy {
|
|
9
|
+
isSupported(): boolean;
|
|
10
|
+
getConfigPath(): string;
|
|
11
|
+
getUnsupportedEvents(hooks: HooksConfig): string[];
|
|
12
|
+
formatConfig(hooks: HooksConfig): string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/copilot/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA2DjD;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,aAAa;IACvD,WAAW,IAAI,OAAO;IAItB,aAAa,IAAI,MAAM;IAKvB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,EAAE;IAIlD,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM;CA4B1C"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map from generic ai.json hook events to GitHub Copilot's PascalCase event names.
|
|
3
|
+
* GitHub Copilot supports 8 events: SessionStart, UserPromptSubmit, PreToolUse,
|
|
4
|
+
* PostToolUse, PreCompact, SubagentStart, SubagentStop, Stop.
|
|
5
|
+
*/
|
|
6
|
+
const EVENT_MAP = {
|
|
7
|
+
pre_tool_use: 'PreToolUse',
|
|
8
|
+
post_tool_use: 'PostToolUse',
|
|
9
|
+
pre_file_read: 'PreToolUse',
|
|
10
|
+
post_file_read: 'PostToolUse',
|
|
11
|
+
pre_file_write: 'PreToolUse',
|
|
12
|
+
post_file_write: 'PostToolUse',
|
|
13
|
+
pre_command: 'PreToolUse',
|
|
14
|
+
post_command: 'PostToolUse',
|
|
15
|
+
pre_mcp_tool: 'PreToolUse',
|
|
16
|
+
post_mcp_tool: 'PostToolUse',
|
|
17
|
+
session_start: 'SessionStart',
|
|
18
|
+
agent_stop: 'Stop',
|
|
19
|
+
pre_prompt: 'UserPromptSubmit',
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Tool-name matchers to inject for events that target a specific GitHub Copilot tool.
|
|
23
|
+
* GitHub Copilot uses the same tool naming convention as Claude Code for hook matchers.
|
|
24
|
+
* Events not listed here use the user-supplied matcher (or empty string for all tools).
|
|
25
|
+
*/
|
|
26
|
+
const TOOL_MATCHER_MAP = {
|
|
27
|
+
pre_command: 'Bash',
|
|
28
|
+
post_command: 'Bash',
|
|
29
|
+
pre_file_read: 'Read',
|
|
30
|
+
post_file_read: 'Read',
|
|
31
|
+
pre_file_write: 'Write|Edit',
|
|
32
|
+
post_file_write: 'Write|Edit',
|
|
33
|
+
pre_mcp_tool: 'mcp__.*',
|
|
34
|
+
post_mcp_tool: 'mcp__.*',
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Events that GitHub Copilot supports.
|
|
38
|
+
* GitHub Copilot does not support `session_end`.
|
|
39
|
+
*/
|
|
40
|
+
const SUPPORTED_EVENTS = new Set([
|
|
41
|
+
'pre_tool_use',
|
|
42
|
+
'post_tool_use',
|
|
43
|
+
'pre_file_read',
|
|
44
|
+
'post_file_read',
|
|
45
|
+
'pre_file_write',
|
|
46
|
+
'post_file_write',
|
|
47
|
+
'pre_command',
|
|
48
|
+
'post_command',
|
|
49
|
+
'pre_mcp_tool',
|
|
50
|
+
'post_mcp_tool',
|
|
51
|
+
'session_start',
|
|
52
|
+
'agent_stop',
|
|
53
|
+
'pre_prompt',
|
|
54
|
+
]);
|
|
55
|
+
/**
|
|
56
|
+
* GitHub Copilot hooks strategy. Writes hooks to `.github/hooks/hooks.json`.
|
|
57
|
+
* Translates generic ai.json event names to GitHub Copilot's PascalCase format.
|
|
58
|
+
* Uses the same matcher-based structure as Claude Code hooks.
|
|
59
|
+
*/
|
|
60
|
+
export class CopilotHooksStrategy {
|
|
61
|
+
isSupported() {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
getConfigPath() {
|
|
65
|
+
// GitHub Copilot hooks live in .github/hooks/, not in .vscode/
|
|
66
|
+
return '../.github/hooks/hooks.json';
|
|
67
|
+
}
|
|
68
|
+
getUnsupportedEvents(hooks) {
|
|
69
|
+
return Object.keys(hooks).filter((event) => !SUPPORTED_EVENTS.has(event));
|
|
70
|
+
}
|
|
71
|
+
formatConfig(hooks) {
|
|
72
|
+
const copilotHooks = {};
|
|
73
|
+
for (const [event, matchers] of Object.entries(hooks)) {
|
|
74
|
+
const copilotEvent = EVENT_MAP[event];
|
|
75
|
+
if (!copilotEvent) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
const toolMatcher = TOOL_MATCHER_MAP[event];
|
|
79
|
+
const mapped = matchers.map((matcher) => ({
|
|
80
|
+
matcher: toolMatcher ?? matcher.matcher ?? '',
|
|
81
|
+
hooks: matcher.hooks.map((hook) => ({
|
|
82
|
+
type: 'command',
|
|
83
|
+
command: hook.command,
|
|
84
|
+
...(hook.timeout && { timeout: hook.timeout }),
|
|
85
|
+
})),
|
|
86
|
+
}));
|
|
87
|
+
if (!copilotHooks[copilotEvent]) {
|
|
88
|
+
copilotHooks[copilotEvent] = [];
|
|
89
|
+
}
|
|
90
|
+
copilotHooks[copilotEvent].push(...mapped);
|
|
91
|
+
}
|
|
92
|
+
return JSON.stringify({ hooks: copilotHooks }, null, 2) + '\n';
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../../src/editors/strategies/copilot/hooks.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,SAAS,GAA2B;IACvC,YAAY,EAAE,YAAY;IAC1B,aAAa,EAAE,aAAa;IAC5B,aAAa,EAAE,YAAY;IAC3B,cAAc,EAAE,aAAa;IAC7B,cAAc,EAAE,YAAY;IAC5B,eAAe,EAAE,aAAa;IAC9B,WAAW,EAAE,YAAY;IACzB,YAAY,EAAE,aAAa;IAC3B,YAAY,EAAE,YAAY;IAC1B,aAAa,EAAE,aAAa;IAC5B,aAAa,EAAE,cAAc;IAC7B,UAAU,EAAE,MAAM;IAClB,UAAU,EAAE,kBAAkB;CAChC,CAAC;AAEF;;;;GAIG;AACH,MAAM,gBAAgB,GAA2B;IAC9C,WAAW,EAAE,MAAM;IACnB,YAAY,EAAE,MAAM;IACpB,aAAa,EAAE,MAAM;IACrB,cAAc,EAAE,MAAM;IACtB,cAAc,EAAE,YAAY;IAC5B,eAAe,EAAE,YAAY;IAC7B,YAAY,EAAE,SAAS;IACvB,aAAa,EAAE,SAAS;CAC1B,CAAC;AAEF;;;GAGG;AACH,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC;IAC9B,cAAc;IACd,eAAe;IACf,eAAe;IACf,gBAAgB;IAChB,gBAAgB;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YAEJ,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC/B,YAAY,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;YACnC,CAAC;YACD,YAAY,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;QAC9C,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;IAClE,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/copilot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editors/strategies/copilot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { McpServerConfig } from '@a1st/aix-schema';
|
|
2
2
|
import type { McpStrategy } from '../types.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* GitHub Copilot MCP strategy. GitHub Copilot uses `mcp.json` with a `servers` object (not `mcpServers`).
|
|
5
5
|
* Project-level config goes to `.vscode/mcp.json`.
|
|
6
6
|
*/
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class CopilotMcpStrategy implements McpStrategy {
|
|
8
8
|
isSupported(): boolean;
|
|
9
9
|
getConfigPath(): string;
|
|
10
10
|
getGlobalMcpConfigPath(): string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/copilot/mcp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C;;;GAGG;AACH,qBAAa,kBAAmB,YAAW,WAAW;IACnD,WAAW,IAAI,OAAO;IAItB,aAAa,IAAI,MAAM;IAIvB,sBAAsB,IAAI,MAAM,GAAG,IAAI;IAUvC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,MAAM;IA2B1D,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG;QACpC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QACrC,QAAQ,EAAE,MAAM,EAAE,CAAC;KACrB;CA2CH"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { platform } from 'node:os';
|
|
2
2
|
import { getTransport } from '../../../mcp/normalize.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* GitHub Copilot MCP strategy. GitHub Copilot uses `mcp.json` with a `servers` object (not `mcpServers`).
|
|
5
5
|
* Project-level config goes to `.vscode/mcp.json`.
|
|
6
6
|
*/
|
|
7
|
-
export class
|
|
7
|
+
export class CopilotMcpStrategy {
|
|
8
8
|
isSupported() {
|
|
9
9
|
return true;
|
|
10
10
|
}
|
|
@@ -72,12 +72,12 @@ export class VSCodeMcpStrategy {
|
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
else {
|
|
75
|
-
warnings.push(`Skipping
|
|
75
|
+
warnings.push(`Skipping GitHub Copilot MCP server "${name}": unknown format`);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
catch (err) {
|
|
80
|
-
warnings.push(`Failed to parse
|
|
80
|
+
warnings.push(`Failed to parse GitHub Copilot MCP config: ${err.message}`);
|
|
81
81
|
}
|
|
82
82
|
return { mcp, warnings };
|
|
83
83
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../../src/editors/strategies/copilot/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAC5B,WAAW;QACR,OAAO,IAAI,CAAC;IACf,CAAC;IAED,aAAa;QACV,OAAO,UAAU,CAAC;IACrB,CAAC;IAED,sBAAsB;QACnB,MAAM,KAAK,GAA2B;YACnC,MAAM,EAAE,gDAAgD;YACxD,KAAK,EAAE,4BAA4B;YACnC,KAAK,EAAE,oCAAoC;SAC7C,CAAC;QAEF,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC;IACpC,CAAC;IAED,YAAY,CAAC,GAAoC;QAC9C,MAAM,OAAO,GAA4B,EAAE,CAAC;QAE5C,KAAK,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YACtD,IAAI,YAAY,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;gBAClC,SAAS;YACZ,CAAC;YAED,MAAM,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;YAE7C,IAAI,SAAS,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gBAC9B,OAAO,CAAC,IAAI,CAAC,GAAG;oBACb,OAAO,EAAE,SAAS,CAAC,OAAO;oBAC1B,IAAI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CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;4BAC3E,CAAC,CAAC,SAAS;wBACjB,OAAO,EAAE,IAAI;wBACb,SAAS,EAAE,IAAI;wBACf,gBAAgB,EAAE,IAAI;wBACtB,WAAW,EAAE,CAAC;qBAChB,CAAC;gBACL,CAAC;qBAAM,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC;oBACrC,GAAG,CAAC,IAAI,CAAC,GAAG;wBACT,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;wBAClB,cAAc,EAAE,KAAK;wBACrB,OAAO,EAAE,IAAI;wBACb,SAAS,EAAE,IAAI;wBACf,gBAAgB,EAAE,IAAI;wBACtB,WAAW,EAAE,CAAC;qBAChB,CAAC;gBACL,CAAC;qBAAM,CAAC;oBACL,QAAQ,CAAC,IAAI,CAAC,uCAAuC,IAAI,mBAAmB,CAAC,CAAC;gBACjF,CAAC;YACJ,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACZ,QAAQ,CAAC,IAAI,CAAC,8CAA+C,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QACzF,CAAC;QAED,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;IAC5B,CAAC;CACH"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { EditorPrompt } from '../../types.js';
|
|
2
2
|
import type { ParsedPromptFrontmatter, PromptsStrategy } from '../types.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* GitHub Copilot prompts strategy. Uses markdown files with YAML frontmatter in `.github/prompts/`.
|
|
5
5
|
* Files use `.prompt.md` extension. Supports `description` and `argument-hint` frontmatter fields.
|
|
6
6
|
*/
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class CopilotPromptsStrategy implements PromptsStrategy {
|
|
8
8
|
isSupported(): boolean;
|
|
9
9
|
getPromptsDir(): string;
|
|
10
10
|
getFileExtension(): string;
|
|
@@ -15,12 +15,12 @@ export declare class VSCodePromptsStrategy implements PromptsStrategy {
|
|
|
15
15
|
warnings: string[];
|
|
16
16
|
}>;
|
|
17
17
|
/**
|
|
18
|
-
* Detect if content appears to be in
|
|
19
|
-
*
|
|
18
|
+
* Detect if content appears to be in GitHub Copilot's prompt frontmatter format.
|
|
19
|
+
* GitHub Copilot prompts use `mode:` or `tools:` fields.
|
|
20
20
|
*/
|
|
21
21
|
detectFormat(content: string): boolean;
|
|
22
22
|
/**
|
|
23
|
-
* Parse
|
|
23
|
+
* Parse GitHub Copilot-specific frontmatter into unified format.
|
|
24
24
|
* Extracts `description` and `argument-hint` fields.
|
|
25
25
|
*/
|
|
26
26
|
parseFrontmatter(rawContent: string): ParsedPromptFrontmatter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../../src/editors/strategies/copilot/prompts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG5E;;;GAGG;AACH,qBAAa,sBAAuB,YAAW,eAAe;IAC3D,WAAW,IAAI,OAAO;IAItB,aAAa,IAAI,MAAM;IAKvB,gBAAgB,IAAI,MAAM;IAI1B,oBAAoB,IAAI,MAAM,GAAG,IAAI;IAUrC,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM;IAyBpC,kBAAkB,CACrB,KAAK,EAAE,MAAM,EAAE,EACf,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAC/C,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAiDnE;;;OAGG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IActC;;;OAGG;IACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,uBAAuB;CAiB/D"}
|
|
@@ -2,15 +2,15 @@ import pMap from 'p-map';
|
|
|
2
2
|
import { platform } from 'node:os';
|
|
3
3
|
import { extractFrontmatter, parseYamlValue } from '../../../frontmatter-utils.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* GitHub Copilot prompts strategy. Uses markdown files with YAML frontmatter in `.github/prompts/`.
|
|
6
6
|
* Files use `.prompt.md` extension. Supports `description` and `argument-hint` frontmatter fields.
|
|
7
7
|
*/
|
|
8
|
-
export class
|
|
8
|
+
export class CopilotPromptsStrategy {
|
|
9
9
|
isSupported() {
|
|
10
10
|
return true;
|
|
11
11
|
}
|
|
12
12
|
getPromptsDir() {
|
|
13
|
-
//
|
|
13
|
+
// GitHub Copilot prompt files go in .github/prompts/, not in .vscode/
|
|
14
14
|
return '../.github/prompts';
|
|
15
15
|
}
|
|
16
16
|
getFileExtension() {
|
|
@@ -79,8 +79,8 @@ export class VSCodePromptsStrategy {
|
|
|
79
79
|
return { prompts, warnings };
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
|
-
* Detect if content appears to be in
|
|
83
|
-
*
|
|
82
|
+
* Detect if content appears to be in GitHub Copilot's prompt frontmatter format.
|
|
83
|
+
* GitHub Copilot prompts use `mode:` or `tools:` fields.
|
|
84
84
|
*/
|
|
85
85
|
detectFormat(content) {
|
|
86
86
|
const { frontmatter, hasFrontmatter } = extractFrontmatter(content);
|
|
@@ -91,7 +91,7 @@ export class VSCodePromptsStrategy {
|
|
|
91
91
|
return hasMode || hasTools;
|
|
92
92
|
}
|
|
93
93
|
/**
|
|
94
|
-
* Parse
|
|
94
|
+
* Parse GitHub Copilot-specific frontmatter into unified format.
|
|
95
95
|
* Extracts `description` and `argument-hint` fields.
|
|
96
96
|
*/
|
|
97
97
|
parseFrontmatter(rawContent) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../../src/editors/strategies/copilot/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,OAAO,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAEnF;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IAChC,WAAW;QACR,OAAO,IAAI,CAAC;IACf,CAAC;IAED,aAAa;QACV,sEAAsE;QACtE,OAAO,oBAAoB,CAAC;IAC/B,CAAC;IAED,gBAAgB;QACb,OAAO,YAAY,CAAC;IACvB,CAAC;IAED,oBAAoB;QACjB,MAAM,KAAK,GAA2B;YACnC,MAAM,EAAE,+CAA+C;YACvD,KAAK,EAAE,2BAA2B;YAClC,KAAK,EAAE,mCAAmC;SAC5C,CAAC;QAEF,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC;IACpC,CAAC;IAED,YAAY,CAAC,MAAoB;QAC9B,MAAM,WAAW,GAA2B,EAAE,CAAC;QAE/C,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACtB,WAAW,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;QAChD,CAAC;QAED,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACvB,WAAW,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC;QACtD,CAAC;QAED,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAClB,KAAK,M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