@ken-jo/agent-connector 0.4.0 → 0.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.
- package/README.md +9 -9
- package/dist/{action-PLZW5BGX.js → action-EV63GAPY.js} +11 -10
- package/dist/{action-PLZW5BGX.js.map → action-EV63GAPY.js.map} +1 -1
- package/dist/amazon-q-COAL3764.js +276 -0
- package/dist/amazon-q-COAL3764.js.map +1 -0
- package/dist/amp-XJQ4TDAU.js +666 -0
- package/dist/amp-XJQ4TDAU.js.map +1 -0
- package/dist/{antigravity-ANDKF3K7.js → antigravity-AMKKKHS4.js} +4 -4
- package/dist/{antigravity-cli-LLRPDDOT.js → antigravity-cli-XERXEH5W.js} +4 -4
- package/dist/{chunk-MAH6QQTO.js → chunk-2X4EH2D7.js} +5 -4
- package/dist/chunk-2X4EH2D7.js.map +1 -0
- package/dist/{chunk-G3ER4SY5.js → chunk-5G4EPJ4Y.js} +9 -9
- package/dist/chunk-BMD7ANKF.js +237 -0
- package/dist/chunk-BMD7ANKF.js.map +1 -0
- package/dist/{chunk-IW77FFNX.js → chunk-CPLK7GTE.js} +41 -5
- package/dist/chunk-CPLK7GTE.js.map +1 -0
- package/dist/{chunk-ADTHT2FN.js → chunk-DCK5FADX.js} +10 -173
- package/dist/chunk-DCK5FADX.js.map +1 -0
- package/dist/{chunk-J3D5W5T2.js → chunk-EROJDXMW.js} +2 -2
- package/dist/{chunk-22Y24V7O.js → chunk-F5RX62T7.js} +2 -2
- package/dist/chunk-FAHIMJRU.js +177 -0
- package/dist/chunk-FAHIMJRU.js.map +1 -0
- package/dist/{chunk-BHUCB6LY.js → chunk-H67V7DEL.js} +8 -7
- package/dist/{chunk-BHUCB6LY.js.map → chunk-H67V7DEL.js.map} +1 -1
- package/dist/{chunk-BXGFUENQ.js → chunk-I5MLE6S7.js} +14 -1
- package/dist/{chunk-BXGFUENQ.js.map → chunk-I5MLE6S7.js.map} +1 -1
- package/dist/{chunk-LL4OBGRU.js → chunk-LQRAPXS4.js} +3 -3
- package/dist/{chunk-KGJWE6A2.js → chunk-MZF2YCXX.js} +2 -2
- package/dist/{chunk-KGXDYGNJ.js → chunk-QC5A3TFQ.js} +19 -19
- package/dist/{chunk-KGXDYGNJ.js.map → chunk-QC5A3TFQ.js.map} +1 -1
- package/dist/{chunk-CIRDOY2V.js → chunk-QOGMDOUX.js} +3 -3
- package/dist/{chunk-KGGBNKI4.js → chunk-RQPKL62M.js} +144 -21
- package/dist/chunk-RQPKL62M.js.map +1 -0
- package/dist/{chunk-6XHB6BE3.js → chunk-SCVBYSF7.js} +1 -1
- package/dist/{chunk-76FUSVIA.js → chunk-SRVAA2VN.js} +6 -5
- package/dist/chunk-SRVAA2VN.js.map +1 -0
- package/dist/chunk-WZA4CSGJ.js +28 -0
- package/dist/chunk-WZA4CSGJ.js.map +1 -0
- package/dist/{claude-code-MLWS7CW6.js → claude-code-T2LPFNC3.js} +20 -30
- package/dist/claude-code-T2LPFNC3.js.map +1 -0
- package/dist/cli/sdk.js +5 -4
- package/dist/cli/sdk.js.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cline-WRYMNS7Z.js +442 -0
- package/dist/cline-WRYMNS7Z.js.map +1 -0
- package/dist/{codebuff-SH2S3QAN.js → codebuff-PODYPOOP.js} +130 -5
- package/dist/codebuff-PODYPOOP.js.map +1 -0
- package/dist/{codex-BXA4FIF4.js → codex-O4G7D7KK.js} +61 -13
- package/dist/codex-O4G7D7KK.js.map +1 -0
- package/dist/continue-K43SUHLQ.js +790 -0
- package/dist/continue-K43SUHLQ.js.map +1 -0
- package/dist/{copilot-cli-ROIBTTDT.js → copilot-cli-Q3SSPT4V.js} +70 -12
- package/dist/copilot-cli-Q3SSPT4V.js.map +1 -0
- package/dist/{crush-QLEFLHUC.js → crush-MBEH2R3I.js} +130 -6
- package/dist/crush-MBEH2R3I.js.map +1 -0
- package/dist/{cursor-ASJPWZ4R.js → cursor-TMBXDYR4.js} +119 -19
- package/dist/cursor-TMBXDYR4.js.map +1 -0
- package/dist/{detect-ZIIS55LD.js → detect-AHJIUMBO.js} +5 -4
- package/dist/{detect-ZIIS55LD.js.map → detect-AHJIUMBO.js.map} +1 -1
- package/dist/{doctor-TJUGSQ5C.js → doctor-G5MLCPAB.js} +221 -95
- package/dist/doctor-G5MLCPAB.js.map +1 -0
- package/dist/{droid-NCSS3B5Y.js → droid-JC2NT6S4.js} +135 -13
- package/dist/droid-JC2NT6S4.js.map +1 -0
- package/dist/{gemini-cli-SLVWLXJW.js → gemini-cli-ILR7M5X3.js} +62 -10
- package/dist/gemini-cli-ILR7M5X3.js.map +1 -0
- package/dist/{goose-PBA7KTE5.js → goose-SFO5BBGW.js} +15 -8
- package/dist/goose-SFO5BBGW.js.map +1 -0
- package/dist/{hermes-ONDCECP2.js → hermes-3N7WN4WS.js} +329 -15
- package/dist/hermes-3N7WN4WS.js.map +1 -0
- package/dist/{hook-OU522ABV.js → hook-76JBKTUX.js} +14 -11
- package/dist/hook-76JBKTUX.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -2
- package/dist/{install-UDCBL7HP.js → install-R7252QFH.js} +11 -10
- package/dist/{install-UDCBL7HP.js.map → install-R7252QFH.js.map} +1 -1
- package/dist/{introspect-DuZSPSHB.d.ts → introspect-Cn3MSA4_.d.ts} +1 -1
- package/dist/{jetbrains-copilot-YABZ3HFA.js → jetbrains-copilot-NRZHI5PC.js} +85 -18
- package/dist/jetbrains-copilot-NRZHI5PC.js.map +1 -0
- package/dist/{kilo-F3ZDZKCT.js → kilo-IX4T3OHJ.js} +115 -19
- package/dist/kilo-IX4T3OHJ.js.map +1 -0
- package/dist/{kilo-cli-3HWPWBY4.js → kilo-cli-2AYCXBQD.js} +109 -13
- package/dist/kilo-cli-2AYCXBQD.js.map +1 -0
- package/dist/{kimi-NV72FVAO.js → kimi-2YFK2GBA.js} +87 -25
- package/dist/kimi-2YFK2GBA.js.map +1 -0
- package/dist/{kiro-C5W6AGDR.js → kiro-YL6AWUYG.js} +3 -3
- package/dist/{leaderboard-TIBVONVT.js → leaderboard-V6VWA5ZV.js} +3 -3
- package/dist/{mimo-code-IMM5YM3M.js → mimo-code-FTMGSKMQ.js} +41 -5
- package/dist/mimo-code-FTMGSKMQ.js.map +1 -0
- package/dist/{mux-DSSH4AFS.js → mux-5XZFB44C.js} +156 -6
- package/dist/mux-5XZFB44C.js.map +1 -0
- package/dist/{nemoclaw-3EVNKD3I.js → nemoclaw-CQYXZVQN.js} +4 -4
- package/dist/{omp-Z6FRNDPN.js → omp-2QMEY6HD.js} +138 -18
- package/dist/omp-2QMEY6HD.js.map +1 -0
- package/dist/{openclaw-7G437NT7.js → openclaw-UZC437RW.js} +4 -4
- package/dist/{opencode-Q6KBSAKW.js → opencode-L4BGFP25.js} +87 -27
- package/dist/opencode-L4BGFP25.js.map +1 -0
- package/dist/{package-RMPN57YZ.js → package-DNLQTPNN.js} +8 -7
- package/dist/{package-RMPN57YZ.js.map → package-DNLQTPNN.js.map} +1 -1
- package/dist/{pi-LZT6WWAZ.js → pi-PVVPVWKG.js} +3 -2
- package/dist/{pi-LZT6WWAZ.js.map → pi-PVVPVWKG.js.map} +1 -1
- package/dist/{qwen-code-WQBKRPWJ.js → qwen-code-G4CXKUHR.js} +426 -10
- package/dist/qwen-code-G4CXKUHR.js.map +1 -0
- package/dist/{roo-code-GWSNU3OW.js → roo-code-67TYJIQR.js} +3 -3
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +9 -8
- package/dist/sdk/index.d.ts +3 -3
- package/dist/sdk/index.js +4 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/test.d.ts +2 -2
- package/dist/sdk/test.js +6 -5
- package/dist/sdk/test.js.map +1 -1
- package/dist/{serve-D3GO36UT.js → serve-EOVWYBGZ.js} +11 -10
- package/dist/{serve-D3GO36UT.js.map → serve-EOVWYBGZ.js.map} +1 -1
- package/dist/{status-KOSKCETC.js → status-VTD6XXLW.js} +7 -6
- package/dist/{status-KOSKCETC.js.map → status-VTD6XXLW.js.map} +1 -1
- package/dist/{statusline-ZNTCL5YC.js → statusline-3ET5YPQ5.js} +10 -9
- package/dist/{statusline-ZNTCL5YC.js.map → statusline-3ET5YPQ5.js.map} +1 -1
- package/dist/{telemetry-XIKUUGTQ.js → telemetry-QCTMKDBQ.js} +6 -5
- package/dist/{telemetry-XIKUUGTQ.js.map → telemetry-QCTMKDBQ.js.map} +1 -1
- package/dist/{trae-NWT3TMSZ.js → trae-7CZZGOGI.js} +3 -3
- package/dist/{types-BEKsAium.d.ts → types-_6arHbX9.d.ts} +67 -24
- package/dist/{uninstall-2LBLQVFA.js → uninstall-FL3SH2DT.js} +11 -10
- package/dist/{uninstall-2LBLQVFA.js.map → uninstall-FL3SH2DT.js.map} +1 -1
- package/dist/{upgrade-ZC2S7VRN.js → upgrade-SLFG2FCT.js} +11 -10
- package/dist/{upgrade-ZC2S7VRN.js.map → upgrade-SLFG2FCT.js.map} +1 -1
- package/dist/{usage-E2A4O2CY.js → usage-IRBLVUZM.js} +3 -3
- package/dist/{usage-event-JKMC4QC4.js → usage-event-VFF77WYY.js} +10 -9
- package/dist/{usage-event-JKMC4QC4.js.map → usage-event-VFF77WYY.js.map} +1 -1
- package/dist/{vscode-copilot-ALV45XF6.js → vscode-copilot-MF2CDNMT.js} +23 -10
- package/dist/vscode-copilot-MF2CDNMT.js.map +1 -0
- package/dist/{warp-H6IX4U3J.js → warp-VKG55TAT.js} +55 -4
- package/dist/warp-VKG55TAT.js.map +1 -0
- package/dist/windsurf-FU5G4SHF.js +443 -0
- package/dist/windsurf-FU5G4SHF.js.map +1 -0
- package/dist/{zed-RH34TNSW.js → zed-SFUHL3GS.js} +3 -3
- package/package.json +2 -2
- package/dist/amp-B524U6LO.js +0 -300
- package/dist/amp-B524U6LO.js.map +0 -1
- package/dist/chunk-3PFFTFCU.js +0 -190
- package/dist/chunk-3PFFTFCU.js.map +0 -1
- package/dist/chunk-76FUSVIA.js.map +0 -1
- package/dist/chunk-ADTHT2FN.js.map +0 -1
- package/dist/chunk-IW77FFNX.js.map +0 -1
- package/dist/chunk-KGGBNKI4.js.map +0 -1
- package/dist/chunk-MAH6QQTO.js.map +0 -1
- package/dist/claude-code-MLWS7CW6.js.map +0 -1
- package/dist/codebuff-SH2S3QAN.js.map +0 -1
- package/dist/codex-BXA4FIF4.js.map +0 -1
- package/dist/copilot-cli-ROIBTTDT.js.map +0 -1
- package/dist/crush-QLEFLHUC.js.map +0 -1
- package/dist/cursor-ASJPWZ4R.js.map +0 -1
- package/dist/doctor-TJUGSQ5C.js.map +0 -1
- package/dist/droid-NCSS3B5Y.js.map +0 -1
- package/dist/gemini-cli-SLVWLXJW.js.map +0 -1
- package/dist/goose-PBA7KTE5.js.map +0 -1
- package/dist/hermes-ONDCECP2.js.map +0 -1
- package/dist/hook-OU522ABV.js.map +0 -1
- package/dist/jetbrains-copilot-YABZ3HFA.js.map +0 -1
- package/dist/kilo-F3ZDZKCT.js.map +0 -1
- package/dist/kilo-cli-3HWPWBY4.js.map +0 -1
- package/dist/kimi-NV72FVAO.js.map +0 -1
- package/dist/mimo-code-IMM5YM3M.js.map +0 -1
- package/dist/mux-DSSH4AFS.js.map +0 -1
- package/dist/omp-Z6FRNDPN.js.map +0 -1
- package/dist/opencode-Q6KBSAKW.js.map +0 -1
- package/dist/qwen-code-WQBKRPWJ.js.map +0 -1
- package/dist/vscode-copilot-ALV45XF6.js.map +0 -1
- package/dist/warp-H6IX4U3J.js.map +0 -1
- /package/dist/{antigravity-ANDKF3K7.js.map → antigravity-AMKKKHS4.js.map} +0 -0
- /package/dist/{antigravity-cli-LLRPDDOT.js.map → antigravity-cli-XERXEH5W.js.map} +0 -0
- /package/dist/{chunk-G3ER4SY5.js.map → chunk-5G4EPJ4Y.js.map} +0 -0
- /package/dist/{chunk-J3D5W5T2.js.map → chunk-EROJDXMW.js.map} +0 -0
- /package/dist/{chunk-22Y24V7O.js.map → chunk-F5RX62T7.js.map} +0 -0
- /package/dist/{chunk-LL4OBGRU.js.map → chunk-LQRAPXS4.js.map} +0 -0
- /package/dist/{chunk-KGJWE6A2.js.map → chunk-MZF2YCXX.js.map} +0 -0
- /package/dist/{chunk-CIRDOY2V.js.map → chunk-QOGMDOUX.js.map} +0 -0
- /package/dist/{chunk-6XHB6BE3.js.map → chunk-SCVBYSF7.js.map} +0 -0
- /package/dist/{kiro-C5W6AGDR.js.map → kiro-YL6AWUYG.js.map} +0 -0
- /package/dist/{leaderboard-TIBVONVT.js.map → leaderboard-V6VWA5ZV.js.map} +0 -0
- /package/dist/{nemoclaw-3EVNKD3I.js.map → nemoclaw-CQYXZVQN.js.map} +0 -0
- /package/dist/{openclaw-7G437NT7.js.map → openclaw-UZC437RW.js.map} +0 -0
- /package/dist/{roo-code-GWSNU3OW.js.map → roo-code-67TYJIQR.js.map} +0 -0
- /package/dist/{trae-NWT3TMSZ.js.map → trae-7CZZGOGI.js.map} +0 -0
- /package/dist/{usage-E2A4O2CY.js.map → usage-IRBLVUZM.js.map} +0 -0
- /package/dist/{zed-RH34TNSW.js.map → zed-SFUHL3GS.js.map} +0 -0
package/dist/amp-B524U6LO.js
DELETED
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
rewriteEnvRefs
|
|
4
|
-
} from "./chunk-DBQMX75U.js";
|
|
5
|
-
import {
|
|
6
|
-
BaseAdapter
|
|
7
|
-
} from "./chunk-IW77FFNX.js";
|
|
8
|
-
import {
|
|
9
|
-
renderSkillMd
|
|
10
|
-
} from "./chunk-7L6ITC4T.js";
|
|
11
|
-
import {
|
|
12
|
-
buildServeWrapperCommand,
|
|
13
|
-
isHomeBinHookCommand,
|
|
14
|
-
shouldWrapForTelemetry
|
|
15
|
-
} from "./chunk-BXGFUENQ.js";
|
|
16
|
-
import "./chunk-N6HH7K6P.js";
|
|
17
|
-
import "./chunk-TRQKHP7D.js";
|
|
18
|
-
|
|
19
|
-
// src/adapters/amp/index.ts
|
|
20
|
-
import { existsSync } from "fs";
|
|
21
|
-
import { homedir } from "os";
|
|
22
|
-
import { join } from "path";
|
|
23
|
-
var HOST = "amp";
|
|
24
|
-
var MCP_ROOT_KEY = "amp.mcpServers";
|
|
25
|
-
var AmpAdapter = class extends BaseAdapter {
|
|
26
|
-
id = HOST;
|
|
27
|
-
name = "Amp";
|
|
28
|
-
paradigm = "mcp-only";
|
|
29
|
-
capabilities = {
|
|
30
|
-
// Memory surface: AGENTS.md-first managed block via the BaseAdapter default
|
|
31
|
-
// (memoryTargets: project <projectDir>/AGENTS.md; user scope where documented).
|
|
32
|
-
supportsMemory: true,
|
|
33
|
-
// Amp has no lifecycle hook system — every hook capability is false.
|
|
34
|
-
preToolUse: false,
|
|
35
|
-
postToolUse: false,
|
|
36
|
-
preCompact: false,
|
|
37
|
-
sessionStart: false,
|
|
38
|
-
sessionEnd: false,
|
|
39
|
-
userPromptSubmit: false,
|
|
40
|
-
stop: false,
|
|
41
|
-
notification: false,
|
|
42
|
-
canModifyArgs: false,
|
|
43
|
-
canModifyOutput: false,
|
|
44
|
-
canInjectSessionContext: false,
|
|
45
|
-
// Amp registers stdio and Streamable HTTP MCP servers.
|
|
46
|
-
transports: ["stdio", "http"],
|
|
47
|
-
// Skills: Amp reads SKILL.md from ~/.config/agents/skills/<name>/SKILL.md
|
|
48
|
-
// (user) and <projectDir>/.agents/skills/<name>/SKILL.md (project) — a root
|
|
49
|
-
// OUTSIDE the config dir, so the skillDir() helper resolves it explicitly.
|
|
50
|
-
supportsSkills: true
|
|
51
|
-
};
|
|
52
|
-
// ── Detection ────────────────────────────────────────────────────────────
|
|
53
|
-
detectInstalled(projectDir) {
|
|
54
|
-
const userDir = join(homedir(), ".config", "amp");
|
|
55
|
-
const userSettings = join(userDir, "settings.json");
|
|
56
|
-
const projectDirAmp = join(projectDir, ".amp");
|
|
57
|
-
const projectSettings = join(projectDirAmp, "settings.json");
|
|
58
|
-
const userInstalled = existsSync(userDir) || existsSync(userSettings);
|
|
59
|
-
const projectInstalled = existsSync(projectDirAmp) || existsSync(projectSettings);
|
|
60
|
-
const installed = userInstalled || projectInstalled;
|
|
61
|
-
const scope = projectInstalled && !userInstalled ? "project" : "user";
|
|
62
|
-
const configPath = scope === "project" ? projectSettings : userSettings;
|
|
63
|
-
return {
|
|
64
|
-
id: this.id,
|
|
65
|
-
name: this.name,
|
|
66
|
-
installed,
|
|
67
|
-
paradigm: this.paradigm,
|
|
68
|
-
capabilities: this.capabilities,
|
|
69
|
-
configPath,
|
|
70
|
-
scope,
|
|
71
|
-
reason: installed ? `found Amp config (${scope}) at ${configPath}` : `no Amp config at ${userSettings} or ${projectSettings}`,
|
|
72
|
-
confidence: installed ? "high" : "low"
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
// ── Native paths ─────────────────────────────────────────────────────────
|
|
76
|
-
getConfigDir(ctx) {
|
|
77
|
-
return ctx.scope === "project" ? join(ctx.projectDir, ".amp") : join(homedir(), ".config", "amp");
|
|
78
|
-
}
|
|
79
|
-
getServerConfigPath(ctx) {
|
|
80
|
-
return join(this.getConfigDir(ctx), "settings.json");
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Amp has no hook file — hooks are not a thing here. The hook "config path" is
|
|
84
|
-
* the same settings.json so the generic doctor/backup behave sensibly.
|
|
85
|
-
*/
|
|
86
|
-
getHookConfigPath(ctx) {
|
|
87
|
-
return this.getServerConfigPath(ctx);
|
|
88
|
-
}
|
|
89
|
-
// ── MCP server install / uninstall ───────────────────────────────────────
|
|
90
|
-
installServer(ctx) {
|
|
91
|
-
const { connector } = ctx;
|
|
92
|
-
const override = connector.platforms[HOST]?.server;
|
|
93
|
-
if (!connector.server || override === false) {
|
|
94
|
-
return [
|
|
95
|
-
{
|
|
96
|
-
platform: this.id,
|
|
97
|
-
action: "skip",
|
|
98
|
-
detail: connector.server ? "server registration disabled for amp" : "connector declares no MCP server"
|
|
99
|
-
}
|
|
100
|
-
];
|
|
101
|
-
}
|
|
102
|
-
const server = override && typeof override === "object" ? { ...connector.server, ...override } : connector.server;
|
|
103
|
-
const serverPath = this.getServerConfigPath(ctx);
|
|
104
|
-
const entry = this.renderServerEntry(ctx, server);
|
|
105
|
-
return [
|
|
106
|
-
this.upsertServerInJson(serverPath, MCP_ROOT_KEY, connector.id, entry, ctx.dryRun)
|
|
107
|
-
];
|
|
108
|
-
}
|
|
109
|
-
uninstallServer(ctx) {
|
|
110
|
-
const serverPath = this.getServerConfigPath(ctx);
|
|
111
|
-
return [
|
|
112
|
-
this.removeServerFromJson(serverPath, MCP_ROOT_KEY, ctx.connector.id, ctx.dryRun)
|
|
113
|
-
];
|
|
114
|
-
}
|
|
115
|
-
/** Render a normalized ServerDef into Amp's native `amp.mcpServers` entry. */
|
|
116
|
-
renderServerEntry(ctx, server) {
|
|
117
|
-
const transport = server.transport;
|
|
118
|
-
if (transport === "stdio") {
|
|
119
|
-
let command = server.command ?? "";
|
|
120
|
-
let args = [...server.args ?? []];
|
|
121
|
-
if (shouldWrapForTelemetry(server, ctx.connector.telemetry)) {
|
|
122
|
-
const wrapped = buildServeWrapperCommand(
|
|
123
|
-
ctx.homeBinPath,
|
|
124
|
-
ctx.connector.id,
|
|
125
|
-
command,
|
|
126
|
-
args,
|
|
127
|
-
ctx.scope,
|
|
128
|
-
this.id
|
|
129
|
-
);
|
|
130
|
-
command = wrapped.command;
|
|
131
|
-
args = wrapped.args;
|
|
132
|
-
}
|
|
133
|
-
const entry2 = { command: this.rewrite(command) };
|
|
134
|
-
if (args.length > 0) entry2.args = args.map((a) => this.rewrite(a));
|
|
135
|
-
const env = this.renderEnv(server.env);
|
|
136
|
-
if (env) entry2.env = env;
|
|
137
|
-
return entry2;
|
|
138
|
-
}
|
|
139
|
-
const entry = { url: this.rewrite(server.url ?? "") };
|
|
140
|
-
const headers = this.renderEnv(server.headers);
|
|
141
|
-
if (headers) entry.headers = headers;
|
|
142
|
-
return entry;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Render env/header values. Amp supports native `${VAR_NAME}` interpolation,
|
|
146
|
-
* so translate `${env:VAR}` refs to that native token rather than baking
|
|
147
|
-
* secrets into the file. Literals pass through unchanged.
|
|
148
|
-
*/
|
|
149
|
-
renderEnv(env) {
|
|
150
|
-
if (!env || Object.keys(env).length === 0) return void 0;
|
|
151
|
-
const out = {};
|
|
152
|
-
for (const [k, v] of Object.entries(env)) out[k] = this.rewrite(v);
|
|
153
|
-
return out;
|
|
154
|
-
}
|
|
155
|
-
/** Translate `${env:VAR(:-default)}` to Amp's native `${VAR}` token. */
|
|
156
|
-
rewrite(value) {
|
|
157
|
-
return rewriteEnvRefs(value, ampEnvToken);
|
|
158
|
-
}
|
|
159
|
-
// ── Skills surface ───────────────────────────────────────────────────────
|
|
160
|
-
// CONTENT-ONLY: pure native-file writers under the skill root. No runtime
|
|
161
|
-
// dispatch, no home-bin pointer, no telemetry wrap. Idempotent (byte-identical
|
|
162
|
-
// → skip) via writeContentFile and reversible via removeContentFile. Honors
|
|
163
|
-
// platforms["amp"].skills === false to skip.
|
|
164
|
-
//
|
|
165
|
-
// QUIRK: the skill root is NOT under getConfigDir (~/.config/amp). Amp reads
|
|
166
|
-
// SKILL.md from the sibling cross-agent `agents` tree:
|
|
167
|
-
// user scope → ~/.config/agents/skills/<name>/SKILL.md
|
|
168
|
-
// project scope → <projectDir>/.agents/skills/<name>/SKILL.md
|
|
169
|
-
// so skillDir() resolves it explicitly rather than reusing getConfigDir.
|
|
170
|
-
/** Skill root: user `~/.config/agents/skills`, project `<projectDir>/.agents/skills`. */
|
|
171
|
-
skillsDir(ctx) {
|
|
172
|
-
return ctx.scope === "project" ? join(ctx.projectDir, ".agents", "skills") : join(homedir(), ".config", "agents", "skills");
|
|
173
|
-
}
|
|
174
|
-
/** Native skill dir: <skillRoot>/<name>. */
|
|
175
|
-
skillDir(ctx, name) {
|
|
176
|
-
return join(this.skillsDir(ctx), name);
|
|
177
|
-
}
|
|
178
|
-
installSkills(ctx) {
|
|
179
|
-
const { connector } = ctx;
|
|
180
|
-
if (connector.platforms[HOST]?.skills === false) {
|
|
181
|
-
return [{ platform: this.id, action: "skip", detail: "skills disabled for amp" }];
|
|
182
|
-
}
|
|
183
|
-
if (connector.skills.length === 0) {
|
|
184
|
-
return [{ platform: this.id, action: "skip", detail: "connector declares no skills" }];
|
|
185
|
-
}
|
|
186
|
-
const changes = [];
|
|
187
|
-
for (const skill of connector.skills) {
|
|
188
|
-
const dir = this.skillDir(ctx, skill.name);
|
|
189
|
-
changes.push(
|
|
190
|
-
this.writeContentFile(join(dir, "SKILL.md"), this.renderSkill(skill), ctx.dryRun)
|
|
191
|
-
);
|
|
192
|
-
for (const [rel, contents] of Object.entries(skill.resources ?? {})) {
|
|
193
|
-
const target = this.resolveWithin(dir, rel);
|
|
194
|
-
if (target === null) {
|
|
195
|
-
changes.push({
|
|
196
|
-
platform: this.id,
|
|
197
|
-
action: "warn",
|
|
198
|
-
detail: `skill resource "${rel}" escapes the skill dir; skipped`
|
|
199
|
-
});
|
|
200
|
-
continue;
|
|
201
|
-
}
|
|
202
|
-
changes.push(this.writeContentFile(target, contents, ctx.dryRun));
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
return changes;
|
|
206
|
-
}
|
|
207
|
-
uninstallSkills(ctx) {
|
|
208
|
-
const { connector } = ctx;
|
|
209
|
-
if (connector.skills.length === 0) {
|
|
210
|
-
return [{ platform: this.id, action: "skip", detail: "connector declares no skills" }];
|
|
211
|
-
}
|
|
212
|
-
const changes = [];
|
|
213
|
-
for (const skill of connector.skills) {
|
|
214
|
-
const dir = this.skillDir(ctx, skill.name);
|
|
215
|
-
changes.push(this.removeContentFile(join(dir, "SKILL.md"), ctx.dryRun));
|
|
216
|
-
for (const rel of Object.keys(skill.resources ?? {})) {
|
|
217
|
-
const target = this.resolveWithin(dir, rel);
|
|
218
|
-
if (target === null) continue;
|
|
219
|
-
changes.push(this.removeContentFile(target, ctx.dryRun));
|
|
220
|
-
}
|
|
221
|
-
changes.push(this.removeDirIfEmpty(dir, ctx.dryRun));
|
|
222
|
-
}
|
|
223
|
-
return changes;
|
|
224
|
-
}
|
|
225
|
-
/** Render a skill's SKILL.md (delegates to the shared renderer). */
|
|
226
|
-
renderSkill(skill) {
|
|
227
|
-
return renderSkillMd(skill);
|
|
228
|
-
}
|
|
229
|
-
// ── Hooks (unavailable — Amp is mcp-only) ────────────────────────────────
|
|
230
|
-
installHooks(_ctx) {
|
|
231
|
-
return [
|
|
232
|
-
{
|
|
233
|
-
platform: this.id,
|
|
234
|
-
action: "skip",
|
|
235
|
-
detail: "hooks unavailable (Amp is mcp-only)"
|
|
236
|
-
}
|
|
237
|
-
];
|
|
238
|
-
}
|
|
239
|
-
uninstallHooks(_ctx) {
|
|
240
|
-
return [
|
|
241
|
-
{
|
|
242
|
-
platform: this.id,
|
|
243
|
-
action: "skip",
|
|
244
|
-
detail: "hooks unavailable (Amp is mcp-only)"
|
|
245
|
-
}
|
|
246
|
-
];
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* True when a hook command references our home binary AND this connector id
|
|
250
|
-
* (anchored so a shared-prefix id can't collide — see isHomeBinHookCommand).
|
|
251
|
-
* Amp installs no hooks, but this guard keeps any future shared-file edit from
|
|
252
|
-
* removing another connector's entries.
|
|
253
|
-
*/
|
|
254
|
-
isOurCommand(command, ctx) {
|
|
255
|
-
return isHomeBinHookCommand(command, ctx.homeBinPath, ctx.connector.id);
|
|
256
|
-
}
|
|
257
|
-
// ── Diagnostics ──────────────────────────────────────────────────────────
|
|
258
|
-
getHealthChecks(ctx) {
|
|
259
|
-
const settingsPath = this.getServerConfigPath(ctx);
|
|
260
|
-
const connectorId = ctx.connector.id;
|
|
261
|
-
return [
|
|
262
|
-
{
|
|
263
|
-
name: `${this.name}: settings.json present`,
|
|
264
|
-
check: () => existsSync(settingsPath) ? { status: "OK", detail: settingsPath } : { status: "FAIL", detail: `not found: ${settingsPath}` }
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
name: `${this.name}: server entry registered`,
|
|
268
|
-
check: () => {
|
|
269
|
-
if (!ctx.connector.server) {
|
|
270
|
-
return { status: "OK", detail: "no MCP server declared" };
|
|
271
|
-
}
|
|
272
|
-
const cfg = this.readJson(settingsPath);
|
|
273
|
-
const bucket = cfg?.[MCP_ROOT_KEY];
|
|
274
|
-
if (!cfg || !bucket) {
|
|
275
|
-
return { status: "FAIL", detail: `no "${MCP_ROOT_KEY}" in ${settingsPath}` };
|
|
276
|
-
}
|
|
277
|
-
return connectorId in bucket ? { status: "OK", detail: `"${MCP_ROOT_KEY}".${connectorId} present` } : {
|
|
278
|
-
status: "FAIL",
|
|
279
|
-
detail: `no "${MCP_ROOT_KEY}".${connectorId} in ${settingsPath}`
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
];
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
function ampEnvToken(name, def) {
|
|
287
|
-
if (def !== void 0) {
|
|
288
|
-
const v = process.env[name];
|
|
289
|
-
return v != null && v !== "" ? v : def;
|
|
290
|
-
}
|
|
291
|
-
return `\${${name}}`;
|
|
292
|
-
}
|
|
293
|
-
var adapter = new AmpAdapter();
|
|
294
|
-
var amp_default = adapter;
|
|
295
|
-
export {
|
|
296
|
-
AmpAdapter,
|
|
297
|
-
adapter,
|
|
298
|
-
amp_default as default
|
|
299
|
-
};
|
|
300
|
-
//# sourceMappingURL=amp-B524U6LO.js.map
|
package/dist/amp-B524U6LO.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/adapters/amp/index.ts"],"sourcesContent":["/**\n * adapters/amp — Amp (Sourcegraph / AmpCode) platform adapter for agent-connector.\n *\n * Amp is an **mcp-only** host: it exposes no lifecycle hook system, so MCP is the\n * only extensibility surface. This adapter installs the MCP server entry and\n * reports hooks as unavailable — the same shape validated by the Warp adapter.\n *\n * MCP config (report §2 / §5.3):\n * - user scope → ~/.config/amp/settings.json\n * - project scope → <projectDir>/.amp/settings.json\n * Both are JSONC (we write plain JSON, which is valid JSONC). The settings file\n * is SHARED with the rest of Amp's configuration, so we MERGE our entry into\n * the existing object and never clobber unrelated keys.\n *\n * QUIRK 1 — dotted top-level key: Amp does NOT use a nested `mcpServers` object.\n * The MCP registry is a single FLAT settings key literally named\n * `\"amp.mcpServers\"`, whose value is an object of `{ id: { command, args, env } }`.\n * We therefore set `settings[\"amp.mcpServers\"][connectorId] = entry`. Because the\n * base JSON helpers index `config[rootKey][serverId]`, passing the dotted string\n * as the root key writes exactly that flat key while preserving every sibling\n * setting (true merge).\n *\n * QUIRK 2 — native interpolation: Amp expands `${VAR_NAME}` in stdio entries at\n * runtime, so we KEEP env/header/url refs native by rewriting the portable\n * `${env:VAR}` syntax to Amp's `${VAR}` token rather than resolving to literals\n * (secrets stay out of the settings file).\n *\n * Skills surface: Amp reads SKILL.md files (dir-per-skill, same shape as\n * claude-code) from a skill root that is NOT under the config dir\n * (`~/.config/amp`):\n * - user scope → ~/.config/agents/skills/<name>/SKILL.md (the sibling\n * cross-agent `agents` dir — `~/.config/amp/skills/` is also documented-native,\n * but the `agents` root is the cross-agent standard we standardize on)\n * - project scope → <projectDir>/.agents/skills/<name>/SKILL.md\n * Because that root differs from getConfigDir, skills use a dedicated skillDir()\n * helper rather than reusing getConfigDir.\n */\n\nimport { existsSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\nimport { BaseAdapter } from \"../base.js\";\nimport type { Adapter, InstallContext } from \"../spi.js\";\nimport type {\n ChangeRecord,\n DetectedPlatform,\n HealthCheck,\n HookParadigm,\n PlatformCapabilities,\n PlatformId,\n ServerDef,\n SkillDef,\n Transport,\n} from \"../../core/types.js\";\nimport { rewriteEnvRefs } from \"../../core/interpolate.js\";\nimport {\n buildServeWrapperCommand,\n isHomeBinHookCommand,\n shouldWrapForTelemetry,\n} from \"../../core/spawn.js\";\nimport { renderSkillMd } from \"../claude-code/render.js\";\n\nconst HOST: PlatformId = \"amp\";\n/**\n * QUIRK: a single FLAT, dotted settings key — NOT a nested object. The base\n * JSON helpers treat this as `config[\"amp.mcpServers\"][serverId]`.\n */\nconst MCP_ROOT_KEY = \"amp.mcpServers\";\n\n/** Native MCP server entry shapes Amp accepts under `amp.mcpServers`. */\ninterface AmpStdioServer {\n command: string;\n args?: string[];\n env?: Record<string, string>;\n}\ninterface AmpHttpServer {\n url: string;\n headers?: Record<string, string>;\n}\n\nexport class AmpAdapter extends BaseAdapter implements Adapter {\n readonly id: PlatformId = HOST;\n readonly name = \"Amp\";\n readonly paradigm: HookParadigm = \"mcp-only\";\n\n readonly capabilities: PlatformCapabilities = {\n // Memory surface: AGENTS.md-first managed block via the BaseAdapter default\n // (memoryTargets: project <projectDir>/AGENTS.md; user scope where documented).\n supportsMemory: true,\n // Amp has no lifecycle hook system — every hook capability is false.\n preToolUse: false,\n postToolUse: false,\n preCompact: false,\n sessionStart: false,\n sessionEnd: false,\n userPromptSubmit: false,\n stop: false,\n notification: false,\n canModifyArgs: false,\n canModifyOutput: false,\n canInjectSessionContext: false,\n // Amp registers stdio and Streamable HTTP MCP servers.\n transports: [\"stdio\", \"http\"],\n // Skills: Amp reads SKILL.md from ~/.config/agents/skills/<name>/SKILL.md\n // (user) and <projectDir>/.agents/skills/<name>/SKILL.md (project) — a root\n // OUTSIDE the config dir, so the skillDir() helper resolves it explicitly.\n supportsSkills: true,\n };\n\n // ── Detection ────────────────────────────────────────────────────────────\n\n detectInstalled(projectDir: string): DetectedPlatform {\n const userDir = join(homedir(), \".config\", \"amp\");\n const userSettings = join(userDir, \"settings.json\");\n const projectDirAmp = join(projectDir, \".amp\");\n const projectSettings = join(projectDirAmp, \"settings.json\");\n\n const userInstalled = existsSync(userDir) || existsSync(userSettings);\n const projectInstalled = existsSync(projectDirAmp) || existsSync(projectSettings);\n const installed = userInstalled || projectInstalled;\n const scope = projectInstalled && !userInstalled ? \"project\" : \"user\";\n const configPath = scope === \"project\" ? projectSettings : userSettings;\n\n return {\n id: this.id,\n name: this.name,\n installed,\n paradigm: this.paradigm,\n capabilities: this.capabilities,\n configPath,\n scope,\n reason: installed\n ? `found Amp config (${scope}) at ${configPath}`\n : `no Amp config at ${userSettings} or ${projectSettings}`,\n confidence: installed ? \"high\" : \"low\",\n };\n }\n\n // ── Native paths ─────────────────────────────────────────────────────────\n\n getConfigDir(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? join(ctx.projectDir, \".amp\")\n : join(homedir(), \".config\", \"amp\");\n }\n\n getServerConfigPath(ctx: InstallContext): string {\n return join(this.getConfigDir(ctx), \"settings.json\");\n }\n\n /**\n * Amp has no hook file — hooks are not a thing here. The hook \"config path\" is\n * the same settings.json so the generic doctor/backup behave sensibly.\n */\n getHookConfigPath(ctx: InstallContext): string {\n return this.getServerConfigPath(ctx);\n }\n\n // ── MCP server install / uninstall ───────────────────────────────────────\n\n installServer(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n const override = connector.platforms[HOST]?.server;\n if (!connector.server || override === false) {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: connector.server\n ? \"server registration disabled for amp\"\n : \"connector declares no MCP server\",\n },\n ];\n }\n\n // Shallow-merge any per-platform server override into the base ServerDef.\n const server: ServerDef =\n override && typeof override === \"object\"\n ? { ...connector.server, ...override }\n : connector.server;\n\n const serverPath = this.getServerConfigPath(ctx);\n const entry = this.renderServerEntry(ctx, server);\n\n // Upsert into the flat \"amp.mcpServers\" key, merging into existing settings.\n return [\n this.upsertServerInJson(serverPath, MCP_ROOT_KEY, connector.id, entry, ctx.dryRun),\n ];\n }\n\n uninstallServer(ctx: InstallContext): ChangeRecord[] {\n const serverPath = this.getServerConfigPath(ctx);\n return [\n this.removeServerFromJson(serverPath, MCP_ROOT_KEY, ctx.connector.id, ctx.dryRun),\n ];\n }\n\n /** Render a normalized ServerDef into Amp's native `amp.mcpServers` entry. */\n private renderServerEntry(\n ctx: InstallContext,\n server: ServerDef,\n ): AmpStdioServer | AmpHttpServer {\n const transport: Transport = server.transport;\n\n if (transport === \"stdio\") {\n let command = server.command ?? \"\";\n let args = [...(server.args ?? [])];\n\n // Transparent telemetry wrapping: route the real command through\n // `<homeBin> serve --connector <id> -- <command> <args...>`.\n if (shouldWrapForTelemetry(server, ctx.connector.telemetry)) {\n const wrapped = buildServeWrapperCommand(\n ctx.homeBinPath,\n ctx.connector.id,\n command,\n args,\n ctx.scope,\n this.id,\n );\n command = wrapped.command;\n args = wrapped.args;\n }\n\n // Amp expands ${VAR_NAME} natively, so keep refs native (no literals).\n const entry: AmpStdioServer = { command: this.rewrite(command) };\n if (args.length > 0) entry.args = args.map((a) => this.rewrite(a));\n const env = this.renderEnv(server.env);\n if (env) entry.env = env;\n return entry;\n }\n\n // http (and any other remote transport we surface) — Amp registers a URL.\n const entry: AmpHttpServer = { url: this.rewrite(server.url ?? \"\") };\n const headers = this.renderEnv(server.headers);\n if (headers) entry.headers = headers;\n return entry;\n }\n\n /**\n * Render env/header values. Amp supports native `${VAR_NAME}` interpolation,\n * so translate `${env:VAR}` refs to that native token rather than baking\n * secrets into the file. Literals pass through unchanged.\n */\n private renderEnv(\n env: Record<string, string> | undefined,\n ): Record<string, string> | undefined {\n if (!env || Object.keys(env).length === 0) return undefined;\n const out: Record<string, string> = {};\n for (const [k, v] of Object.entries(env)) out[k] = this.rewrite(v);\n return out;\n }\n\n /** Translate `${env:VAR(:-default)}` to Amp's native `${VAR}` token. */\n private rewrite(value: string): string {\n return rewriteEnvRefs(value, ampEnvToken);\n }\n\n // ── Skills surface ───────────────────────────────────────────────────────\n // CONTENT-ONLY: pure native-file writers under the skill root. No runtime\n // dispatch, no home-bin pointer, no telemetry wrap. Idempotent (byte-identical\n // → skip) via writeContentFile and reversible via removeContentFile. Honors\n // platforms[\"amp\"].skills === false to skip.\n //\n // QUIRK: the skill root is NOT under getConfigDir (~/.config/amp). Amp reads\n // SKILL.md from the sibling cross-agent `agents` tree:\n // user scope → ~/.config/agents/skills/<name>/SKILL.md\n // project scope → <projectDir>/.agents/skills/<name>/SKILL.md\n // so skillDir() resolves it explicitly rather than reusing getConfigDir.\n\n /** Skill root: user `~/.config/agents/skills`, project `<projectDir>/.agents/skills`. */\n private skillsDir(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? join(ctx.projectDir, \".agents\", \"skills\")\n : join(homedir(), \".config\", \"agents\", \"skills\");\n }\n\n /** Native skill dir: <skillRoot>/<name>. */\n private skillDir(ctx: InstallContext, name: string): string {\n return join(this.skillsDir(ctx), name);\n }\n\n override installSkills(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.platforms[HOST]?.skills === false) {\n return [{ platform: this.id, action: \"skip\", detail: \"skills disabled for amp\" }];\n }\n if (connector.skills.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no skills\" }];\n }\n const changes: ChangeRecord[] = [];\n for (const skill of connector.skills) {\n const dir = this.skillDir(ctx, skill.name);\n changes.push(\n this.writeContentFile(join(dir, \"SKILL.md\"), this.renderSkill(skill), ctx.dryRun),\n );\n // Bundle any resource files beside SKILL.md (relative path → contents).\n // Defense-in-depth: skip+warn on any key that escapes the skill dir\n // (config-time validation already rejects these, but never trust input).\n for (const [rel, contents] of Object.entries(skill.resources ?? {})) {\n const target = this.resolveWithin(dir, rel);\n if (target === null) {\n changes.push({\n platform: this.id,\n action: \"warn\",\n detail: `skill resource \"${rel}\" escapes the skill dir; skipped`,\n });\n continue;\n }\n changes.push(this.writeContentFile(target, contents, ctx.dryRun));\n }\n }\n return changes;\n }\n\n override uninstallSkills(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.skills.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no skills\" }];\n }\n const changes: ChangeRecord[] = [];\n for (const skill of connector.skills) {\n const dir = this.skillDir(ctx, skill.name);\n // Remove only the files we wrote (SKILL.md + declared resources), then the\n // skill dir itself when we own its full contents.\n changes.push(this.removeContentFile(join(dir, \"SKILL.md\"), ctx.dryRun));\n for (const rel of Object.keys(skill.resources ?? {})) {\n const target = this.resolveWithin(dir, rel);\n if (target === null) continue; // never delete outside the skill dir\n changes.push(this.removeContentFile(target, ctx.dryRun));\n }\n // Only remove the skill dir when WE own its full contents — never rm -rf a\n // dir that still holds user-added / sibling-tool / shared files.\n changes.push(this.removeDirIfEmpty(dir, ctx.dryRun));\n }\n return changes;\n }\n\n /** Render a skill's SKILL.md (delegates to the shared renderer). */\n private renderSkill(skill: SkillDef): string {\n return renderSkillMd(skill);\n }\n\n // ── Hooks (unavailable — Amp is mcp-only) ────────────────────────────────\n\n installHooks(_ctx: InstallContext): ChangeRecord[] {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: \"hooks unavailable (Amp is mcp-only)\",\n },\n ];\n }\n\n uninstallHooks(_ctx: InstallContext): ChangeRecord[] {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: \"hooks unavailable (Amp is mcp-only)\",\n },\n ];\n }\n\n /**\n * True when a hook command references our home binary AND this connector id\n * (anchored so a shared-prefix id can't collide — see isHomeBinHookCommand).\n * Amp installs no hooks, but this guard keeps any future shared-file edit from\n * removing another connector's entries.\n */\n private isOurCommand(command: string | undefined, ctx: InstallContext): boolean {\n return isHomeBinHookCommand(command, ctx.homeBinPath, ctx.connector.id);\n }\n\n // ── Diagnostics ──────────────────────────────────────────────────────────\n\n override getHealthChecks(ctx: InstallContext): readonly HealthCheck[] {\n const settingsPath = this.getServerConfigPath(ctx);\n const connectorId = ctx.connector.id;\n return [\n {\n name: `${this.name}: settings.json present`,\n check: () =>\n existsSync(settingsPath)\n ? { status: \"OK\", detail: settingsPath }\n : { status: \"FAIL\", detail: `not found: ${settingsPath}` },\n },\n {\n name: `${this.name}: server entry registered`,\n check: () => {\n // Only assert what the connector declares: a server-less connector\n // never writes a server entry, so its absence is healthy.\n if (!ctx.connector.server) {\n return { status: \"OK\", detail: \"no MCP server declared\" };\n }\n const cfg = this.readJson<{ [k: string]: Record<string, unknown> }>(settingsPath);\n const bucket = cfg?.[MCP_ROOT_KEY];\n if (!cfg || !bucket) {\n return { status: \"FAIL\", detail: `no \"${MCP_ROOT_KEY}\" in ${settingsPath}` };\n }\n return connectorId in bucket\n ? { status: \"OK\", detail: `\"${MCP_ROOT_KEY}\".${connectorId} present` }\n : {\n status: \"FAIL\",\n detail: `no \"${MCP_ROOT_KEY}\".${connectorId} in ${settingsPath}`,\n };\n },\n },\n ];\n }\n}\n\n/**\n * Amp native interpolation token: `${env:VAR}` → `${VAR}`.\n *\n * When the portable ref carried a default (`${env:VAR:-fallback}`), Amp's native\n * `${VAR}` token has no way to express it — so a bare native token would silently\n * DROP the default. Instead, resolve the default at install time: emit the live\n * value when VAR is set and non-empty, else the literal fallback. The native\n * token is only emitted when there is no default to preserve.\n */\nfunction ampEnvToken(name: string, def?: string): string {\n if (def !== undefined) {\n const v = process.env[name];\n return v != null && v !== \"\" ? v : def;\n }\n return `\\${${name}}`;\n}\n\nexport const adapter = new AmpAdapter();\nexport default adapter;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsCA,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,YAAY;AAuBrB,IAAM,OAAmB;AAKzB,IAAM,eAAe;AAad,IAAM,aAAN,cAAyB,YAA+B;AAAA,EACpD,KAAiB;AAAA,EACjB,OAAO;AAAA,EACP,WAAyB;AAAA,EAEzB,eAAqC;AAAA;AAAA;AAAA,IAG5C,gBAAgB;AAAA;AAAA,IAEhB,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,MAAM;AAAA,IACN,cAAc;AAAA,IACd,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,yBAAyB;AAAA;AAAA,IAEzB,YAAY,CAAC,SAAS,MAAM;AAAA;AAAA;AAAA;AAAA,IAI5B,gBAAgB;AAAA,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AA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAWA,SAAS,YAAY,MAAc,KAAsB;AACvD,MAAI,QAAQ,QAAW;AACrB,UAAM,IAAI,QAAQ,IAAI,IAAI;AAC1B,WAAO,KAAK,QAAQ,MAAM,KAAK,IAAI;AAAA,EACrC;AACA,SAAO,MAAM,IAAI;AACnB;AAEO,IAAM,UAAU,IAAI,WAAW;AACtC,IAAO,cAAQ;","names":["entry"]}
|
package/dist/chunk-3PFFTFCU.js
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/adapters/registry.ts
|
|
4
|
-
var ADAPTER_REGISTRY = [
|
|
5
|
-
{
|
|
6
|
-
id: "claude-code",
|
|
7
|
-
load: () => import("./claude-code-MLWS7CW6.js").then((m) => m.default)
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
id: "codex",
|
|
11
|
-
load: () => import("./codex-BXA4FIF4.js").then((m) => m.default)
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
id: "cursor",
|
|
15
|
-
load: () => import("./cursor-ASJPWZ4R.js").then((m) => m.default)
|
|
16
|
-
},
|
|
17
|
-
// vscode-copilot after cursor: cursor is a VS Code fork, so the fork's runtime
|
|
18
|
-
// markers must be checked first during host detection.
|
|
19
|
-
{
|
|
20
|
-
id: "vscode-copilot",
|
|
21
|
-
load: () => import("./vscode-copilot-ALV45XF6.js").then((m) => m.default)
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: "copilot-cli",
|
|
25
|
-
load: () => import("./copilot-cli-ROIBTTDT.js").then((m) => m.default)
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
id: "gemini-cli",
|
|
29
|
-
load: () => import("./gemini-cli-SLVWLXJW.js").then((m) => m.default)
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: "warp",
|
|
33
|
-
load: () => import("./warp-H6IX4U3J.js").then((m) => m.default)
|
|
34
|
-
},
|
|
35
|
-
// ts-plugin paradigm: OpenCode loads a generated plugin module that bridges
|
|
36
|
-
// its in-process events to the universal hook entrypoint.
|
|
37
|
-
{
|
|
38
|
-
id: "opencode",
|
|
39
|
-
load: () => import("./opencode-Q6KBSAKW.js").then((m) => m.default)
|
|
40
|
-
},
|
|
41
|
-
// mimo-code is Xiaomi's MiMoCode (@mimo-ai/cli, bin `mimo`) — an OpenCode FORK
|
|
42
|
-
// (ts-plugin, MCP root key "mcp", ~/.config/mimocode/mimocode.json). Grouped
|
|
43
|
-
// beside the OpenCode family whose config dialect + plugin contract it shares;
|
|
44
|
-
// detected via the DISTINCT ~/.config/mimocode dir, so there is no fork-ordering
|
|
45
|
-
// constraint vs opencode (no shared config file to disambiguate).
|
|
46
|
-
{
|
|
47
|
-
id: "mimo-code",
|
|
48
|
-
load: () => import("./mimo-code-IMM5YM3M.js").then((m) => m.default)
|
|
49
|
-
},
|
|
50
|
-
// kilo-cli is the SQLite-backed OpenCode FORK command-line product (ts-plugin,
|
|
51
|
-
// loads @kilocode/plugin modules registered in kilo.jsonc's "plugin" array;
|
|
52
|
-
// MCP root key "mcp", ~/.config/kilo/kilo.jsonc). Grouped beside the OpenCode
|
|
53
|
-
// family whose plugin contract + config dialect it shares; distinct host from
|
|
54
|
-
// the "kilo" extension so there is no fork-ordering constraint between them.
|
|
55
|
-
{
|
|
56
|
-
id: "kilo-cli",
|
|
57
|
-
load: () => import("./kilo-cli-3HWPWBY4.js").then((m) => m.default)
|
|
58
|
-
},
|
|
59
|
-
// Wave 1 — mcp-only adapters (no lifecycle hooks; MCP registration only).
|
|
60
|
-
{
|
|
61
|
-
id: "droid",
|
|
62
|
-
load: () => import("./droid-NCSS3B5Y.js").then((m) => m.default)
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
id: "roo-code",
|
|
66
|
-
load: () => import("./roo-code-GWSNU3OW.js").then((m) => m.default)
|
|
67
|
-
},
|
|
68
|
-
// kilo is the Kilo Code VS Code extension (kilocode.kilo-code) — a Roo/Cline
|
|
69
|
-
// fork, so it sits beside roo-code (mcp-only, root key "mcpServers", VS Code
|
|
70
|
-
// globalStorage / .kilocode project scope). Distinct host from "kilo-cli".
|
|
71
|
-
{
|
|
72
|
-
id: "kilo",
|
|
73
|
-
load: () => import("./kilo-F3ZDZKCT.js").then((m) => m.default)
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
id: "trae",
|
|
77
|
-
load: () => import("./trae-NWT3TMSZ.js").then((m) => m.default)
|
|
78
|
-
},
|
|
79
|
-
// antigravity-cli BEFORE antigravity: the `agy` CLI is a fork of the IDE
|
|
80
|
-
// adapter with its own runtime markers (the universal hook command tags the
|
|
81
|
-
// host as "antigravity-cli"), so the more-specific CLI marker must be checked
|
|
82
|
-
// before the IDE/parent during host detection.
|
|
83
|
-
{
|
|
84
|
-
id: "antigravity-cli",
|
|
85
|
-
load: () => import("./antigravity-cli-LLRPDDOT.js").then((m) => m.default)
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
id: "antigravity",
|
|
89
|
-
load: () => import("./antigravity-ANDKF3K7.js").then((m) => m.default)
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
id: "zed",
|
|
93
|
-
load: () => import("./zed-RH34TNSW.js").then((m) => m.default)
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
id: "amp",
|
|
97
|
-
load: () => import("./amp-B524U6LO.js").then((m) => m.default)
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
id: "codebuff",
|
|
101
|
-
load: () => import("./codebuff-SH2S3QAN.js").then((m) => m.default)
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
id: "mux",
|
|
105
|
-
load: () => import("./mux-DSSH4AFS.js").then((m) => m.default)
|
|
106
|
-
},
|
|
107
|
-
// Pi — mcp-only host with no writable MCP config; drives the Agent Skills
|
|
108
|
-
// surface only (writes <piDir>/skills/<name>/SKILL.md).
|
|
109
|
-
{
|
|
110
|
-
id: "pi",
|
|
111
|
-
load: () => import("./pi-LZT6WWAZ.js").then((m) => m.default)
|
|
112
|
-
},
|
|
113
|
-
// Wave 2 — json-stdio adapters (full hook dispatch via the universal entrypoint).
|
|
114
|
-
// jetbrains-copilot before vscode-copilot is unnecessary (distinct hosts); grouped here.
|
|
115
|
-
{
|
|
116
|
-
id: "jetbrains-copilot",
|
|
117
|
-
load: () => import("./jetbrains-copilot-YABZ3HFA.js").then((m) => m.default)
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
id: "qwen-code",
|
|
121
|
-
load: () => import("./qwen-code-WQBKRPWJ.js").then((m) => m.default)
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
id: "kiro",
|
|
125
|
-
load: () => import("./kiro-C5W6AGDR.js").then((m) => m.default)
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
id: "kimi",
|
|
129
|
-
load: () => import("./kimi-NV72FVAO.js").then((m) => m.default)
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
id: "crush",
|
|
133
|
-
load: () => import("./crush-QLEFLHUC.js").then((m) => m.default)
|
|
134
|
-
},
|
|
135
|
-
// Wave 3 — json-stdio adapters with YAML config (MCP in YAML; hooks per host).
|
|
136
|
-
{
|
|
137
|
-
id: "goose",
|
|
138
|
-
load: () => import("./goose-PBA7KTE5.js").then((m) => m.default)
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
id: "hermes",
|
|
142
|
-
load: () => import("./hermes-ONDCECP2.js").then((m) => m.default)
|
|
143
|
-
},
|
|
144
|
-
// Wave 4 — ts-plugin adapters (generate a bridge module to the universal entrypoint).
|
|
145
|
-
{
|
|
146
|
-
id: "omp",
|
|
147
|
-
load: () => import("./omp-Z6FRNDPN.js").then((m) => m.default)
|
|
148
|
-
},
|
|
149
|
-
// nemoclaw BEFORE openclaw (fork-before-parent convention). NVIDIA NemoClaw
|
|
150
|
-
// wraps OpenClaw and DRIVES the SAME ~/.openclaw/openclaw.json, so a NemoClaw
|
|
151
|
-
// box carries BOTH the ~/.nemoclaw/ and ~/.openclaw/ markers. Exclusivity is
|
|
152
|
-
// enforced at the SOURCE: OpenClawAdapter.detectInstalled BOWS OUT when
|
|
153
|
-
// ~/.nemoclaw/ is present, so the shared config is never double-targeted as two
|
|
154
|
-
// platforms. This ordering is the deterministic tie-break (matching the
|
|
155
|
-
// antigravity-cli/antigravity precedent). nemoclaw extends OpenClawAdapter
|
|
156
|
-
// (id/name/detection overridden), so inherited server/hook registration still
|
|
157
|
-
// lands in the wrapped openclaw.json.
|
|
158
|
-
{
|
|
159
|
-
id: "nemoclaw",
|
|
160
|
-
load: () => import("./nemoclaw-3EVNKD3I.js").then((m) => m.default)
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
id: "openclaw",
|
|
164
|
-
load: () => import("./openclaw-7G437NT7.js").then((m) => m.default)
|
|
165
|
-
}
|
|
166
|
-
];
|
|
167
|
-
var REGISTRY_BY_ID = new Map(
|
|
168
|
-
ADAPTER_REGISTRY.map((factory) => [factory.id, factory])
|
|
169
|
-
);
|
|
170
|
-
var REGISTERED_PLATFORM_IDS = new Set(
|
|
171
|
-
ADAPTER_REGISTRY.map((factory) => factory.id)
|
|
172
|
-
);
|
|
173
|
-
function getFactory(id) {
|
|
174
|
-
return REGISTRY_BY_ID.get(id);
|
|
175
|
-
}
|
|
176
|
-
async function loadAdapter(id) {
|
|
177
|
-
const factory = getFactory(id);
|
|
178
|
-
return factory ? factory.load() : void 0;
|
|
179
|
-
}
|
|
180
|
-
async function allAdapters() {
|
|
181
|
-
return Promise.all(ADAPTER_REGISTRY.map((factory) => factory.load()));
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export {
|
|
185
|
-
ADAPTER_REGISTRY,
|
|
186
|
-
REGISTERED_PLATFORM_IDS,
|
|
187
|
-
loadAdapter,
|
|
188
|
-
allAdapters
|
|
189
|
-
};
|
|
190
|
-
//# sourceMappingURL=chunk-3PFFTFCU.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/adapters/registry.ts"],"sourcesContent":["/**\n * adapters/registry — single source of truth for the platforms agent-connector\n * targets. Generalized from context-mode's `ADAPTER_REGISTRY` pattern, adapted\n * to our `Adapter` / `AdapterFactory` contract (adapters/spi.ts).\n *\n * In context-mode the same platform set was redeclared in four places (env-var\n * detection, session-dir lookup, the lazy adapter loader, and per-adapter base\n * constructors); adding a platform meant editing all of them and missing one\n * was silent. Here the list lives ONCE below: each platform is one entry with a\n * lazy `load()` thunk that resolves the adapter singleton. Adding a platform is\n * a single new entry — `getFactory` / `loadAdapter` / `allAdapters` and the\n * detection cascade in detect.ts all derive from this list.\n *\n * `load()` returns the module's default export, which every adapter file is\n * required to provide as its singleton (`export default adapter;`). It is a\n * function (not an eager import) so module loading stays lazy: an adapter is\n * only imported when it is actually needed, keeping startup cheap.\n *\n * Order is load-bearing for runtime host detection (detect.ts iterates env\n * markers in registry order): forks MUST precede their parent so a session\n * running inside a derived shell is not misclassified as the parent. For the\n * three Phase-1 adapters this is moot, but the ordering convention is fixed now\n * so later additions (cursor is a VS Code fork, etc.) slot in correctly.\n */\n\nimport type { PlatformId } from \"../core/types.js\";\nimport type { Adapter, AdapterFactory } from \"./spi.js\";\n\n/**\n * Authoritative list of installable platforms. One entry per platform; the\n * `load` thunk lazily imports the adapter module and returns its default-export\n * singleton. To add a platform: drop its `src/adapters/<id>/index.ts` in place\n * (default-exporting an `Adapter`) and add one entry here.\n */\nexport const ADAPTER_REGISTRY: readonly AdapterFactory[] = [\n {\n id: \"claude-code\",\n load: () => import(\"./claude-code/index.js\").then((m) => m.default),\n },\n {\n id: \"codex\",\n load: () => import(\"./codex/index.js\").then((m) => m.default),\n },\n {\n id: \"cursor\",\n load: () => import(\"./cursor/index.js\").then((m) => m.default),\n },\n // vscode-copilot after cursor: cursor is a VS Code fork, so the fork's runtime\n // markers must be checked first during host detection.\n {\n id: \"vscode-copilot\",\n load: () => import(\"./vscode-copilot/index.js\").then((m) => m.default),\n },\n {\n id: \"copilot-cli\",\n load: () => import(\"./copilot-cli/index.js\").then((m) => m.default),\n },\n {\n id: \"gemini-cli\",\n load: () => import(\"./gemini-cli/index.js\").then((m) => m.default),\n },\n {\n id: \"warp\",\n load: () => import(\"./warp/index.js\").then((m) => m.default),\n },\n // ts-plugin paradigm: OpenCode loads a generated plugin module that bridges\n // its in-process events to the universal hook entrypoint.\n {\n id: \"opencode\",\n load: () => import(\"./opencode/index.js\").then((m) => m.default),\n },\n // mimo-code is Xiaomi's MiMoCode (@mimo-ai/cli, bin `mimo`) — an OpenCode FORK\n // (ts-plugin, MCP root key \"mcp\", ~/.config/mimocode/mimocode.json). Grouped\n // beside the OpenCode family whose config dialect + plugin contract it shares;\n // detected via the DISTINCT ~/.config/mimocode dir, so there is no fork-ordering\n // constraint vs opencode (no shared config file to disambiguate).\n {\n id: \"mimo-code\",\n load: () => import(\"./mimo-code/index.js\").then((m) => m.default),\n },\n // kilo-cli is the SQLite-backed OpenCode FORK command-line product (ts-plugin,\n // loads @kilocode/plugin modules registered in kilo.jsonc's \"plugin\" array;\n // MCP root key \"mcp\", ~/.config/kilo/kilo.jsonc). Grouped beside the OpenCode\n // family whose plugin contract + config dialect it shares; distinct host from\n // the \"kilo\" extension so there is no fork-ordering constraint between them.\n {\n id: \"kilo-cli\",\n load: () => import(\"./kilo-cli/index.js\").then((m) => m.default),\n },\n // Wave 1 — mcp-only adapters (no lifecycle hooks; MCP registration only).\n {\n id: \"droid\",\n load: () => import(\"./droid/index.js\").then((m) => m.default),\n },\n {\n id: \"roo-code\",\n load: () => import(\"./roo-code/index.js\").then((m) => m.default),\n },\n // kilo is the Kilo Code VS Code extension (kilocode.kilo-code) — a Roo/Cline\n // fork, so it sits beside roo-code (mcp-only, root key \"mcpServers\", VS Code\n // globalStorage / .kilocode project scope). Distinct host from \"kilo-cli\".\n {\n id: \"kilo\",\n load: () => import(\"./kilo/index.js\").then((m) => m.default),\n },\n {\n id: \"trae\",\n load: () => import(\"./trae/index.js\").then((m) => m.default),\n },\n // antigravity-cli BEFORE antigravity: the `agy` CLI is a fork of the IDE\n // adapter with its own runtime markers (the universal hook command tags the\n // host as \"antigravity-cli\"), so the more-specific CLI marker must be checked\n // before the IDE/parent during host detection.\n {\n id: \"antigravity-cli\",\n load: () => import(\"./antigravity-cli/index.js\").then((m) => m.default),\n },\n {\n id: \"antigravity\",\n load: () => import(\"./antigravity/index.js\").then((m) => m.default),\n },\n {\n id: \"zed\",\n load: () => import(\"./zed/index.js\").then((m) => m.default),\n },\n {\n id: \"amp\",\n load: () => import(\"./amp/index.js\").then((m) => m.default),\n },\n {\n id: \"codebuff\",\n load: () => import(\"./codebuff/index.js\").then((m) => m.default),\n },\n {\n id: \"mux\",\n load: () => import(\"./mux/index.js\").then((m) => m.default),\n },\n // Pi — mcp-only host with no writable MCP config; drives the Agent Skills\n // surface only (writes <piDir>/skills/<name>/SKILL.md).\n {\n id: \"pi\",\n load: () => import(\"./pi/index.js\").then((m) => m.default),\n },\n // Wave 2 — json-stdio adapters (full hook dispatch via the universal entrypoint).\n // jetbrains-copilot before vscode-copilot is unnecessary (distinct hosts); grouped here.\n {\n id: \"jetbrains-copilot\",\n load: () => import(\"./jetbrains-copilot/index.js\").then((m) => m.default),\n },\n {\n id: \"qwen-code\",\n load: () => import(\"./qwen-code/index.js\").then((m) => m.default),\n },\n {\n id: \"kiro\",\n load: () => import(\"./kiro/index.js\").then((m) => m.default),\n },\n {\n id: \"kimi\",\n load: () => import(\"./kimi/index.js\").then((m) => m.default),\n },\n {\n id: \"crush\",\n load: () => import(\"./crush/index.js\").then((m) => m.default),\n },\n // Wave 3 — json-stdio adapters with YAML config (MCP in YAML; hooks per host).\n {\n id: \"goose\",\n load: () => import(\"./goose/index.js\").then((m) => m.default),\n },\n {\n id: \"hermes\",\n load: () => import(\"./hermes/index.js\").then((m) => m.default),\n },\n // Wave 4 — ts-plugin adapters (generate a bridge module to the universal entrypoint).\n {\n id: \"omp\",\n load: () => import(\"./omp/index.js\").then((m) => m.default),\n },\n // nemoclaw BEFORE openclaw (fork-before-parent convention). NVIDIA NemoClaw\n // wraps OpenClaw and DRIVES the SAME ~/.openclaw/openclaw.json, so a NemoClaw\n // box carries BOTH the ~/.nemoclaw/ and ~/.openclaw/ markers. Exclusivity is\n // enforced at the SOURCE: OpenClawAdapter.detectInstalled BOWS OUT when\n // ~/.nemoclaw/ is present, so the shared config is never double-targeted as two\n // platforms. This ordering is the deterministic tie-break (matching the\n // antigravity-cli/antigravity precedent). nemoclaw extends OpenClawAdapter\n // (id/name/detection overridden), so inherited server/hook registration still\n // lands in the wrapped openclaw.json.\n {\n id: \"nemoclaw\",\n load: () => import(\"./nemoclaw/index.js\").then((m) => m.default),\n },\n {\n id: \"openclaw\",\n load: () => import(\"./openclaw/index.js\").then((m) => m.default),\n },\n];\n\n/** O(1) lookup index, built once at module-load time. */\nconst REGISTRY_BY_ID: ReadonlyMap<PlatformId, AdapterFactory> = new Map(\n ADAPTER_REGISTRY.map((factory) => [factory.id, factory] as const),\n);\n\n/** Every platform id present in the registry (useful for matrix tests). */\nexport const REGISTERED_PLATFORM_IDS: ReadonlySet<PlatformId> = new Set(\n ADAPTER_REGISTRY.map((factory) => factory.id),\n);\n\n/**\n * Look up the lazy factory for a platform id. Returns `undefined` for ids that\n * are not registered (including `\"unknown\"` and typos) so callers can fall back\n * deliberately rather than crash.\n */\nexport function getFactory(id: PlatformId | string): AdapterFactory | undefined {\n return REGISTRY_BY_ID.get(id as PlatformId);\n}\n\n/**\n * Resolve a platform id to its adapter singleton. Returns `undefined` when the\n * id is not registered — callers decide whether to skip or fall back.\n */\nexport async function loadAdapter(id: PlatformId | string): Promise<Adapter | undefined> {\n const factory = getFactory(id);\n return factory ? factory.load() : undefined;\n}\n\n/**\n * Load every registered adapter. Imports run in parallel; the result preserves\n * registry order so downstream detection/install logic sees forks before\n * parents.\n */\nexport async function allAdapters(): Promise<Adapter[]> {\n return Promise.all(ADAP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wBAAqB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,EACjE;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM,MAAM,OAAO,wBAAqB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,EACjE;AACF;AAGA,IAAM,iBAA0D,IAAI;AAAA,EAClE,iBAAiB,IAAI,CAAC,YAAY,CAAC,QAAQ,IAAI,OAAO,CAAU;AAClE;AAGO,IAAM,0BAAmD,IAAI;AAAA,EAClE,iBAAiB,IAAI,CAAC,YAAY,QAAQ,EAAE;AAC9C;AAOO,SAAS,WAAW,IAAqD;AAC9E,SAAO,eAAe,IAAI,EAAgB;AAC5C;AAMA,eAAsB,YAAY,IAAuD;AACvF,QAAM,UAAU,WAAW,EAAE;AAC7B,SAAO,UAAU,QAAQ,KAAK,IAAI;AACpC;AAOA,eAAsB,cAAkC;AACtD,SAAO,QAAQ,IAAI,iBAAiB,IAAI,CAAC,YAAY,QAAQ,KAAK,CAAC,CAAC;AACtE;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/sdk/introspect.ts"],"sourcesContent":["/**\n * sdk/introspect — host-capability introspection over the adapter registry.\n *\n * A thin, READ-ONLY query layer above {@link loadAdapter} / {@link allAdapters}:\n * \"which hosts can honor surface X?\" and \"what can host Y do?\". It exists so a\n * connector author (or a docs/CLI surface) can answer those questions WITHOUT\n * reaching into adapter internals or re-deriving the per-surface capability\n * rules — the predicates below are the single source of truth for mapping the\n * raw {@link PlatformCapabilities} flags onto the developer-facing surface names.\n *\n * Everything is async because adapters load lazily (one entry per platform in\n * the registry, imported only when queried).\n */\n\nimport type { PlatformCapabilities, PlatformId } from \"../core/types.js\";\nimport { allAdapters, loadAdapter } from \"../adapters/registry.js\";\n\n/**\n * The developer-facing surface names a connector can declare. These mirror the\n * top-level {@link import(\"../core/types.js\").ConnectorConfig} keys (server,\n * hooks, commands, …) plus the platform-scoped `configPatch` / `nativeHooks`\n * escape hatches — the same vocabulary the install diff and `explain` use.\n */\nexport type SurfaceName =\n | \"server\"\n | \"hooks\"\n | \"commands\"\n | \"skills\"\n | \"subagents\"\n | \"memory\"\n | \"statusline\"\n | \"actions\"\n | \"configPatch\"\n | \"nativeHooks\";\n\n/**\n * Pure capability predicate per surface — `true` when the host can NATIVELY\n * honor that surface. The optional capability flags are read as `?? false`\n * (the supportsCommands precedent in core/types), so a host that simply leaves\n * a flag unset reports the surface as unsupported (the installer skip-warns it).\n *\n * `hooks` is satisfied by ANY normalized hook event (i.e. the host has at least\n * one event it can dispatch); the per-event flags map 1:1 onto the\n * {@link import(\"../core/types.js\").HookEventName} union.\n */\nexport const SURFACE_PREDICATES: Record<\n SurfaceName,\n (c: PlatformCapabilities) => boolean\n> = {\n server: (c) => c.transports.length > 0,\n hooks: (c) =>\n c.sessionStart ||\n c.preToolUse ||\n c.postToolUse ||\n c.userPromptSubmit ||\n c.stop ||\n c.sessionEnd ||\n c.preCompact ||\n c.notification ||\n (c.permissionRequest ?? false) ||\n (c.postToolUseFailure ?? false) ||\n (c.subagentStart ?? false) ||\n (c.subagentStop ?? false),\n commands: (c) => c.supportsCommands ?? false,\n skills: (c) => c.supportsSkills ?? false,\n subagents: (c) => c.supportsSubagents ?? false,\n memory: (c) => c.supportsMemory ?? false,\n statusline: (c) => c.supportsStatusline ?? false,\n // v1: no adapter sets supportsActions (no affordance emitter yet), so this is\n // false everywhere and explain() marks actions skip-warn on every host — the\n // honest state until the affordance emitter ships.\n actions: (c) => c.supportsActions ?? false,\n configPatch: (c) => c.supportsConfigPatch ?? false,\n nativeHooks: (c) => c.supportsNativeHooks ?? false,\n};\n\n/**\n * The {@link PlatformCapabilities} a host advertises, or `undefined` for an id\n * that is not in the registry (`\"unknown\"`, a usage-only id like `\"synthetic\"`,\n * or a typo) — callers branch on undefined rather than crash.\n */\nexport async function capabilitiesOf(\n host: PlatformId | string,\n): Promise<PlatformCapabilities | undefined> {\n const adapter = await loadAdapter(host);\n return adapter?.capabilities;\n}\n\n/**\n * Every registered host that can NATIVELY honor `surface`, as a sorted id list\n * (stable output for snapshots/docs). Loads all adapters in parallel and keeps\n * only those whose capabilities pass {@link SURFACE_PREDICATES}.\n */\nexport async function hostsSupporting(surface: SurfaceName): Promise<PlatformId[]> {\n const predicate = SURFACE_PREDICATES[surface];\n const adapters = await allAdapters();\n return adapters\n .filter((adapter) => predicate(adapter.capabilities))\n .map((adapter) => adapter.id)\n .sort();\n}\n\n/**\n * Convenience: does `host` natively support `surface`? `false` for an unknown\n * id (no capabilities → cannot support anything).\n */\nexport async function surfaceSupport(\n host: PlatformId | string,\n surface: SurfaceName,\n): Promise<boolean> {\n const capabilities = await capabilitiesOf(host);\n return capabilities ? SURFACE_PREDICATES[surface](capabilities) : false;\n}\n"],"mappings":";;;;;;;AA6CO,IAAM,qBAGT;AAAA,EACF,QAAQ,CAAC,MAAM,EAAE,WAAW,SAAS;AAAA,EACrC,OAAO,CAAC,MACN,EAAE,gBACF,EAAE,cACF,EAAE,eACF,EAAE,oBACF,EAAE,QACF,EAAE,cACF,EAAE,cACF,EAAE,iBACD,EAAE,qBAAqB,WACvB,EAAE,sBAAsB,WACxB,EAAE,iBAAiB,WACnB,EAAE,gBAAgB;AAAA,EACrB,UAAU,CAAC,MAAM,EAAE,oBAAoB;AAAA,EACvC,QAAQ,CAAC,MAAM,EAAE,kBAAkB;AAAA,EACnC,WAAW,CAAC,MAAM,EAAE,qBAAqB;AAAA,EACzC,QAAQ,CAAC,MAAM,EAAE,kBAAkB;AAAA,EACnC,YAAY,CAAC,MAAM,EAAE,sBAAsB;AAAA;AAAA;AAAA;AAAA,EAI3C,SAAS,CAAC,MAAM,EAAE,mBAAmB;AAAA,EACrC,aAAa,CAAC,MAAM,EAAE,uBAAuB;AAAA,EAC7C,aAAa,CAAC,MAAM,EAAE,uBAAuB;AAC/C;AAOA,eAAsB,eACpB,MAC2C;AAC3C,QAAM,UAAU,MAAM,YAAY,IAAI;AACtC,SAAO,SAAS;AAClB;AAOA,eAAsB,gBAAgB,SAA6C;AACjF,QAAM,YAAY,mBAAmB,OAAO;AAC5C,QAAM,WAAW,MAAM,YAAY;AACnC,SAAO,SACJ,OAAO,CAAC,YAAY,UAAU,QAAQ,YAAY,CAAC,EACnD,IAAI,CAAC,YAAY,QAAQ,EAAE,EAC3B,KAAK;AACV;AAMA,eAAsB,eACpB,MACA,SACkB;AAClB,QAAM,eAAe,MAAM,eAAe,IAAI;AAC9C,SAAO,eAAe,mBAAmB,OAAO,EAAE,YAAY,IAAI;AACpE;","names":[]}
|