@newrelic/preflight 1.4.5 → 1.4.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zed-adapter.d.ts","sourceRoot":"","sources":["../../src/platforms/zed-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"zed-adapter.d.ts","sourceRoot":"","sources":["../../src/platforms/zed-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAwCpB,qBAAa,UAAW,YAAW,eAAe;IAChD,QAAQ,CAAC,YAAY,SAAS;IAExB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAaxD,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,kBAAkB;IAqBnD,WAAW,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM;IAI7C,kBAAkB,IAAI,uBAAuB;IAS7C,0BAA0B,IAAI,MAAM;IA2BpC,WAAW,IAAI,OAAO;CAQvB"}
|
|
@@ -1,22 +1,39 @@
|
|
|
1
|
+
// Maps Zed's real built-in agent tool names (confirmed via
|
|
2
|
+
// https://zed.dev/docs/ai/tools.html) to the normalized Claude Code tool
|
|
3
|
+
// vocabulary. Zed's native agent has no hook/callback mechanism (see
|
|
4
|
+
// initialize()'s comment below), so these entries are currently unreachable
|
|
5
|
+
// from the real hook pipeline — this map exists for correctness and for any
|
|
6
|
+
// future Zed hook capability, not because any Zed event reaches it today.
|
|
7
|
+
// `diagnostics`, `copy_path`, `move_path`, and `create_directory` are real
|
|
8
|
+
// Zed tools with no named Claude Code equivalent and are deliberately left
|
|
9
|
+
// unmapped (they fall through to 'Unknown' with platformToolName preserved).
|
|
1
10
|
const ZED_TOOL_MAP = {
|
|
2
|
-
open_file: 'Read',
|
|
3
11
|
read_file: 'Read',
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
edit_file: 'Edit',
|
|
7
|
-
delete_file: 'Delete',
|
|
8
|
-
search_files: 'Glob',
|
|
9
|
-
find_in_files: 'Grep',
|
|
10
|
-
search_in_file: 'Grep',
|
|
11
|
-
execute_command: 'Bash',
|
|
12
|
-
run_command: 'Bash',
|
|
13
|
-
list_files: 'Glob',
|
|
12
|
+
find_path: 'Glob',
|
|
13
|
+
grep: 'Grep',
|
|
14
14
|
list_directory: 'Glob',
|
|
15
|
+
fetch: 'WebFetch',
|
|
16
|
+
search_web: 'WebSearch',
|
|
17
|
+
edit_file: 'Edit',
|
|
18
|
+
write_file: 'Write',
|
|
19
|
+
delete_path: 'Delete',
|
|
20
|
+
terminal: 'Bash',
|
|
21
|
+
spawn_agent: 'Agent',
|
|
22
|
+
skill: 'Skill',
|
|
15
23
|
};
|
|
16
24
|
export class ZedAdapter {
|
|
17
25
|
platformName = 'zed';
|
|
18
26
|
async initialize(_config) {
|
|
19
|
-
// Zed
|
|
27
|
+
// Zed's native agent has no hook/callback mechanism for tool-call
|
|
28
|
+
// interception (confirmed: https://zed.dev/docs/ai/mcp.html — Zed
|
|
29
|
+
// supports only MCP's Tools and Prompts features, with no notification
|
|
30
|
+
// for host-side tool calls). As a Zed MCP "context server", Preflight
|
|
31
|
+
// can only receive calls Zed's agent makes to Preflight's own exposed
|
|
32
|
+
// tools — it cannot observe Zed's built-in read_file/edit_file/terminal
|
|
33
|
+
// calls. When Zed runs another coding agent (Claude Code, Cursor, etc.)
|
|
34
|
+
// as an External Agent via the Agent Client Protocol
|
|
35
|
+
// (https://zed.dev/docs/ai/external-agents.html), that agent's own
|
|
36
|
+
// native hooks already capture its tool calls independently of Zed.
|
|
20
37
|
}
|
|
21
38
|
normalizeToolCall(raw) {
|
|
22
39
|
const event = raw;
|
|
@@ -51,18 +68,27 @@ export class ZedAdapter {
|
|
|
51
68
|
getHookInstallInstructions() {
|
|
52
69
|
return [
|
|
53
70
|
'Zed Editor Setup:',
|
|
54
|
-
|
|
55
|
-
'
|
|
71
|
+
"1. Zed's native agent has no hook mechanism for tool-call capture —",
|
|
72
|
+
' Preflight configured as a Zed MCP server only sees calls made to',
|
|
73
|
+
" its own tools, not Zed's built-in read_file/edit_file/terminal calls.",
|
|
74
|
+
'2. To use Preflight as an MCP context server in Zed (for its own',
|
|
75
|
+
' observability tools), open Settings -> AI -> MCP Servers, click',
|
|
76
|
+
' "Add Server", and add:',
|
|
56
77
|
' {',
|
|
57
|
-
' "
|
|
58
|
-
'
|
|
59
|
-
'
|
|
60
|
-
'
|
|
61
|
-
'
|
|
62
|
-
'
|
|
78
|
+
' "context_servers": {',
|
|
79
|
+
' "preflight": {',
|
|
80
|
+
' "command": "npx",',
|
|
81
|
+
' "args": ["preflight", "--stdio"],',
|
|
82
|
+
' "env": {',
|
|
83
|
+
' "NEW_RELIC_LICENSE_KEY": "<your-key>",',
|
|
84
|
+
' "NEW_RELIC_ACCOUNT_ID": "<your-account-id>"',
|
|
85
|
+
' }',
|
|
86
|
+
' }',
|
|
63
87
|
' }',
|
|
64
88
|
' }',
|
|
65
|
-
'3.
|
|
89
|
+
'3. For full tool-call observability, run Claude Code (or another',
|
|
90
|
+
' already-supported platform) as a Zed External Agent instead —',
|
|
91
|
+
' its own native hooks capture tool calls independently of Zed.',
|
|
66
92
|
].join('\n');
|
|
67
93
|
}
|
|
68
94
|
isSupported() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zed-adapter.js","sourceRoot":"","sources":["../../src/platforms/zed-adapter.ts"],"names":[],"mappings":"AAOA,MAAM,YAAY,GAA2B;IAC3C,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,
|
|
1
|
+
{"version":3,"file":"zed-adapter.js","sourceRoot":"","sources":["../../src/platforms/zed-adapter.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