@aligndottech/cli 0.47.1 → 0.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +9 -18
- package/dist/cli.js.map +1 -1
- package/dist/commands/agents.d.ts +20 -0
- package/dist/commands/agents.d.ts.map +1 -0
- package/dist/commands/agents.js +62 -0
- package/dist/commands/agents.js.map +1 -0
- package/dist/commands/ai.d.ts +11 -0
- package/dist/commands/ai.d.ts.map +1 -0
- package/dist/commands/ai.js +121 -0
- package/dist/commands/ai.js.map +1 -0
- package/dist/commands/default-action.js +2 -2
- package/dist/commands/default-action.js.map +1 -1
- package/dist/commands/registry.d.ts.map +1 -1
- package/dist/commands/registry.js +7 -0
- package/dist/commands/registry.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +53 -191
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/use.js +1 -1
- package/dist/commands/use.js.map +1 -1
- package/dist/commands/why.d.ts.map +1 -1
- package/dist/commands/why.js +21 -0
- package/dist/commands/why.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/ask-key-offer.d.ts +38 -0
- package/dist/lib/ask-key-offer.d.ts.map +1 -0
- package/dist/lib/ask-key-offer.js +130 -0
- package/dist/lib/ask-key-offer.js.map +1 -0
- package/dist/lib/config.d.ts +25 -24
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +37 -45
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/launch/adapters/amp.d.ts +18 -0
- package/dist/lib/launch/adapters/amp.d.ts.map +1 -0
- package/dist/lib/launch/adapters/amp.js +29 -0
- package/dist/lib/launch/adapters/amp.js.map +1 -0
- package/dist/lib/launch/adapters/claude-code.d.ts +8 -0
- package/dist/lib/launch/adapters/claude-code.d.ts.map +1 -1
- package/dist/lib/launch/adapters/claude-code.js.map +1 -1
- package/dist/lib/launch/adapters/codex.d.ts +17 -0
- package/dist/lib/launch/adapters/codex.d.ts.map +1 -0
- package/dist/lib/launch/adapters/codex.js +44 -0
- package/dist/lib/launch/adapters/codex.js.map +1 -0
- package/dist/lib/launch/adapters/copilot.d.ts +17 -0
- package/dist/lib/launch/adapters/copilot.d.ts.map +1 -0
- package/dist/lib/launch/adapters/copilot.js +29 -0
- package/dist/lib/launch/adapters/copilot.js.map +1 -0
- package/dist/lib/launch/adapters/droid.d.ts +19 -0
- package/dist/lib/launch/adapters/droid.d.ts.map +1 -0
- package/dist/lib/launch/adapters/droid.js +38 -0
- package/dist/lib/launch/adapters/droid.js.map +1 -0
- package/dist/lib/launch/adapters/gemini-cli.d.ts +25 -0
- package/dist/lib/launch/adapters/gemini-cli.d.ts.map +1 -0
- package/dist/lib/launch/adapters/gemini-cli.js +73 -0
- package/dist/lib/launch/adapters/gemini-cli.js.map +1 -0
- package/dist/lib/launch/adapters/grok-build.d.ts +16 -0
- package/dist/lib/launch/adapters/grok-build.d.ts.map +1 -0
- package/dist/lib/launch/adapters/grok-build.js +25 -0
- package/dist/lib/launch/adapters/grok-build.js.map +1 -0
- package/dist/lib/launch/adapters/kiro.d.ts +17 -0
- package/dist/lib/launch/adapters/kiro.d.ts.map +1 -0
- package/dist/lib/launch/adapters/kiro.js +25 -0
- package/dist/lib/launch/adapters/kiro.js.map +1 -0
- package/dist/lib/launch/adapters/qwen.d.ts +25 -0
- package/dist/lib/launch/adapters/qwen.d.ts.map +1 -0
- package/dist/lib/launch/adapters/qwen.js +67 -0
- package/dist/lib/launch/adapters/qwen.js.map +1 -0
- package/dist/lib/launch/agents.d.ts +16 -3
- package/dist/lib/launch/agents.d.ts.map +1 -1
- package/dist/lib/launch/agents.js +26 -4
- package/dist/lib/launch/agents.js.map +1 -1
- package/dist/lib/launch/amp-state.d.ts +21 -0
- package/dist/lib/launch/amp-state.d.ts.map +1 -0
- package/dist/lib/launch/amp-state.js +61 -0
- package/dist/lib/launch/amp-state.js.map +1 -0
- package/dist/lib/launch/codex-state.d.ts +31 -0
- package/dist/lib/launch/codex-state.d.ts.map +1 -0
- package/dist/lib/launch/codex-state.js +92 -0
- package/dist/lib/launch/codex-state.js.map +1 -0
- package/dist/lib/launch/config-writes.d.ts +7 -1
- package/dist/lib/launch/config-writes.d.ts.map +1 -1
- package/dist/lib/launch/config-writes.js +60 -7
- package/dist/lib/launch/config-writes.js.map +1 -1
- package/dist/lib/launch/copilot-state.d.ts +19 -0
- package/dist/lib/launch/copilot-state.d.ts.map +1 -0
- package/dist/lib/launch/copilot-state.js +51 -0
- package/dist/lib/launch/copilot-state.js.map +1 -0
- package/dist/lib/launch/detect.d.ts.map +1 -1
- package/dist/lib/launch/detect.js +2 -1
- package/dist/lib/launch/detect.js.map +1 -1
- package/dist/lib/launch/droid-state.d.ts +24 -0
- package/dist/lib/launch/droid-state.d.ts.map +1 -0
- package/dist/lib/launch/droid-state.js +74 -0
- package/dist/lib/launch/droid-state.js.map +1 -0
- package/dist/lib/launch/gemini-state.d.ts +32 -0
- package/dist/lib/launch/gemini-state.d.ts.map +1 -0
- package/dist/lib/launch/gemini-state.js +59 -0
- package/dist/lib/launch/gemini-state.js.map +1 -0
- package/dist/lib/launch/gemini-trust.d.ts +26 -0
- package/dist/lib/launch/gemini-trust.d.ts.map +1 -0
- package/dist/lib/launch/gemini-trust.js +103 -0
- package/dist/lib/launch/gemini-trust.js.map +1 -0
- package/dist/lib/launch/grok-state.d.ts +42 -0
- package/dist/lib/launch/grok-state.d.ts.map +1 -0
- package/dist/lib/launch/grok-state.js +128 -0
- package/dist/lib/launch/grok-state.js.map +1 -0
- package/dist/lib/launch/install.d.ts +33 -0
- package/dist/lib/launch/install.d.ts.map +1 -0
- package/dist/lib/launch/install.js +48 -0
- package/dist/lib/launch/install.js.map +1 -0
- package/dist/lib/launch/kiro-state.d.ts +22 -0
- package/dist/lib/launch/kiro-state.d.ts.map +1 -0
- package/dist/lib/launch/kiro-state.js +59 -0
- package/dist/lib/launch/kiro-state.js.map +1 -0
- package/dist/lib/launch/launch-files.d.ts +15 -0
- package/dist/lib/launch/launch-files.d.ts.map +1 -1
- package/dist/lib/launch/launch-files.js +64 -4
- package/dist/lib/launch/launch-files.js.map +1 -1
- package/dist/lib/launch/launch.d.ts +61 -6
- package/dist/lib/launch/launch.d.ts.map +1 -1
- package/dist/lib/launch/launch.js +98 -31
- package/dist/lib/launch/launch.js.map +1 -1
- package/dist/lib/launch/layer-files.d.ts +12 -0
- package/dist/lib/launch/layer-files.d.ts.map +1 -0
- package/dist/lib/launch/layer-files.js +43 -0
- package/dist/lib/launch/layer-files.js.map +1 -0
- package/dist/lib/launch/pick-agent.d.ts +12 -5
- package/dist/lib/launch/pick-agent.d.ts.map +1 -1
- package/dist/lib/launch/pick-agent.js +47 -19
- package/dist/lib/launch/pick-agent.js.map +1 -1
- package/dist/lib/launch/picker-options.d.ts +30 -0
- package/dist/lib/launch/picker-options.d.ts.map +1 -0
- package/dist/lib/launch/picker-options.js +42 -0
- package/dist/lib/launch/picker-options.js.map +1 -0
- package/dist/lib/launch/prompts.d.ts +11 -0
- package/dist/lib/launch/prompts.d.ts.map +1 -0
- package/dist/lib/launch/prompts.js +27 -0
- package/dist/lib/launch/prompts.js.map +1 -0
- package/dist/lib/launch/qwen-state.d.ts +30 -0
- package/dist/lib/launch/qwen-state.d.ts.map +1 -0
- package/dist/lib/launch/qwen-state.js +57 -0
- package/dist/lib/launch/qwen-state.js.map +1 -0
- package/dist/lib/launch/qwen-trust.d.ts +24 -0
- package/dist/lib/launch/qwen-trust.d.ts.map +1 -0
- package/dist/lib/launch/qwen-trust.js +100 -0
- package/dist/lib/launch/qwen-trust.js.map +1 -0
- package/dist/lib/launch/registry/agents/amp.d.ts +3 -0
- package/dist/lib/launch/registry/agents/amp.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/amp.js +14 -0
- package/dist/lib/launch/registry/agents/amp.js.map +1 -0
- package/dist/lib/launch/registry/agents/claude-code.js +1 -1
- package/dist/lib/launch/registry/agents/claude-code.js.map +1 -1
- package/dist/lib/launch/registry/agents/codex.d.ts.map +1 -1
- package/dist/lib/launch/registry/agents/codex.js +4 -2
- package/dist/lib/launch/registry/agents/codex.js.map +1 -1
- package/dist/lib/launch/registry/agents/copilot.d.ts +3 -0
- package/dist/lib/launch/registry/agents/copilot.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/copilot.js +11 -0
- package/dist/lib/launch/registry/agents/copilot.js.map +1 -0
- package/dist/lib/launch/registry/agents/cursor.js +1 -1
- package/dist/lib/launch/registry/agents/cursor.js.map +1 -1
- package/dist/lib/launch/registry/agents/droid.d.ts +3 -0
- package/dist/lib/launch/registry/agents/droid.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/droid.js +13 -0
- package/dist/lib/launch/registry/agents/droid.js.map +1 -0
- package/dist/lib/launch/registry/agents/gemini-cli.d.ts.map +1 -1
- package/dist/lib/launch/registry/agents/gemini-cli.js +4 -2
- package/dist/lib/launch/registry/agents/gemini-cli.js.map +1 -1
- package/dist/lib/launch/registry/agents/grok-build.d.ts +3 -0
- package/dist/lib/launch/registry/agents/grok-build.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/grok-build.js +14 -0
- package/dist/lib/launch/registry/agents/grok-build.js.map +1 -0
- package/dist/lib/launch/registry/agents/kiro.d.ts +3 -0
- package/dist/lib/launch/registry/agents/kiro.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/kiro.js +11 -0
- package/dist/lib/launch/registry/agents/kiro.js.map +1 -0
- package/dist/lib/launch/registry/agents/opencode.js +1 -1
- package/dist/lib/launch/registry/agents/opencode.js.map +1 -1
- package/dist/lib/launch/registry/agents/pi.js +1 -1
- package/dist/lib/launch/registry/agents/pi.js.map +1 -1
- package/dist/lib/launch/registry/agents/qwen.d.ts +3 -0
- package/dist/lib/launch/registry/agents/qwen.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/qwen.js +11 -0
- package/dist/lib/launch/registry/agents/qwen.js.map +1 -0
- package/dist/lib/launch/registry/index.d.ts +4 -1
- package/dist/lib/launch/registry/index.d.ts.map +1 -1
- package/dist/lib/launch/registry/index.js +11 -2
- package/dist/lib/launch/registry/index.js.map +1 -1
- package/dist/lib/launch/registry/types.d.ts +18 -2
- package/dist/lib/launch/registry/types.d.ts.map +1 -1
- package/dist/lib/launch/run-agent.d.ts +15 -0
- package/dist/lib/launch/run-agent.d.ts.map +1 -1
- package/dist/lib/launch/run-agent.js +23 -2
- package/dist/lib/launch/run-agent.js.map +1 -1
- package/dist/lib/launch/strict-entry.d.ts +49 -0
- package/dist/lib/launch/strict-entry.d.ts.map +1 -0
- package/dist/lib/launch/strict-entry.js +108 -0
- package/dist/lib/launch/strict-entry.js.map +1 -0
- package/dist/lib/llm-providers.d.ts +66 -0
- package/dist/lib/llm-providers.d.ts.map +1 -0
- package/dist/lib/llm-providers.js +150 -0
- package/dist/lib/llm-providers.js.map +1 -0
- package/dist/lib/local-llm.d.ts +63 -12
- package/dist/lib/local-llm.d.ts.map +1 -1
- package/dist/lib/local-llm.js +229 -104
- package/dist/lib/local-llm.js.map +1 -1
- package/dist/lib/safe-config-write.d.ts +12 -1
- package/dist/lib/safe-config-write.d.ts.map +1 -1
- package/dist/lib/safe-config-write.js +123 -7
- package/dist/lib/safe-config-write.js.map +1 -1
- package/dist/lib/startup-env.d.ts +8 -0
- package/dist/lib/startup-env.d.ts.map +1 -0
- package/dist/lib/startup-env.js +8 -0
- package/dist/lib/startup-env.js.map +1 -0
- package/package.json +3 -2
|
@@ -2,6 +2,8 @@ import type { ConfigWrite } from '../config-writes.js';
|
|
|
2
2
|
export interface LaunchFile {
|
|
3
3
|
name: string;
|
|
4
4
|
content: string;
|
|
5
|
+
/** File mode, for a file that copies something of the user's (Gemini's system settings). */
|
|
6
|
+
mode?: number;
|
|
5
7
|
}
|
|
6
8
|
/** What to run: pure data, so the builder is testable without spawning anything. */
|
|
7
9
|
export interface LaunchSpec {
|
|
@@ -11,6 +13,12 @@ export interface LaunchSpec {
|
|
|
11
13
|
env: Record<string, string>;
|
|
12
14
|
/** Launch files the args point at. Commands and text only, never secrets. */
|
|
13
15
|
files: LaunchFile[];
|
|
16
|
+
/** Tidy `<prefix>*` launch files: refresh `keep`, delete `remove`, and age out the rest (pruneLaunchFiles). */
|
|
17
|
+
prune?: {
|
|
18
|
+
prefix: string;
|
|
19
|
+
keep?: string;
|
|
20
|
+
remove?: string;
|
|
21
|
+
};
|
|
14
22
|
/** Lines align prints to stderr before launching (why an injection was skipped). */
|
|
15
23
|
notes?: string[];
|
|
16
24
|
/** Files in the user's own agent config to add to ONCE (C4). Applied after the dry-run exit, never before. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/claude-code.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/claude-code.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,4FAA4F;IAC5F,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,oFAAoF;AACpF,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,6EAA6E;IAC7E,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,+GAA+G;IAC/G,KAAK,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3D,oFAAoF;IACpF,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,8GAA8G;IAC9G,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,+FAA+F;IAC/F,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB,0DAA0D;IAC1D,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACjC;AAWD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,aAAa,GAAG,UAAU,CAmB9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAqCtD;;;;GAIG;AACH,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAE3C,MAAM,IAAI,GAAG,CAAC,KAAc,EAAU,EAAE,CAAC,GAAG,IAAI,CAAC,S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,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;QAChF,IAAI,CAAC,IAAI,CAAC,6BAA6B,EAAE,CAAC,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC,CAAC;IACjF,CAAC;IACD,IAAI,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QACrB,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,UAAU,EAAE,EAAE,CAAC,oBAAoB,CAAC,EAAE,gBAAgB,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;QAC5I,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AlignLocalState } from '../strict-entry.js';
|
|
2
|
+
import type { LaunchContext, LaunchSpec } from './claude-code.js';
|
|
3
|
+
export interface CodexLaunchContext extends Pick<LaunchContext, 'passthrough'>, AlignLocalState {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Codex, per session, nothing written to the user's own config (codex-cli 0.153.0):
|
|
7
|
+
* `-c key=value` overrides one config value for this run, parsed as TOML, and leaves every
|
|
8
|
+
* other `mcp_servers` table in place. So align-local is two overrides, and the user's own
|
|
9
|
+
* servers still load beside it (verified with `codex -c ... mcp list`).
|
|
10
|
+
*
|
|
11
|
+
* ORDER: our -c flags go FIRST. `-c` is a root option, and codex reads root options before the
|
|
12
|
+
* `[PROMPT]` or `<COMMAND>` that follows them, so in front it applies to a bare session, to
|
|
13
|
+
* `exec`, `resume` and every other subcommand, and it can never land after a user's `--`, where
|
|
14
|
+
* it would be read as a prompt.
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildCodexLaunch(c: CodexLaunchContext): LaunchSpec;
|
|
17
|
+
//# sourceMappingURL=codex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/codex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,EAAE,eAAe;CAAG;AAelG;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,kBAAkB,GAAG,UAAU,CAiBlE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { alignServerEntry } from '../../mcp-setup.js';
|
|
2
|
+
/** Same reason as the Claude adapter: never shadow a user's own `align` server. */
|
|
3
|
+
const INJECTED_SERVER_NAME = 'align-local';
|
|
4
|
+
/**
|
|
5
|
+
* A TOML literal string. Single quotes, not JSON's double quotes: on Windows an npm `codex.cmd`
|
|
6
|
+
* runs through cmd.exe, and runAgent refuses any arg holding `"`. A literal string has no
|
|
7
|
+
* escapes, so a value holding `'` or a newline cannot be written this way; ours never do.
|
|
8
|
+
*/
|
|
9
|
+
function tomlLiteral(value) {
|
|
10
|
+
if (/['\n\r]/.test(value))
|
|
11
|
+
throw new Error(`cannot pass ${JSON.stringify(value)} to codex -c as a TOML literal string`);
|
|
12
|
+
return `'${value}'`;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Codex, per session, nothing written to the user's own config (codex-cli 0.153.0):
|
|
16
|
+
* `-c key=value` overrides one config value for this run, parsed as TOML, and leaves every
|
|
17
|
+
* other `mcp_servers` table in place. So align-local is two overrides, and the user's own
|
|
18
|
+
* servers still load beside it (verified with `codex -c ... mcp list`).
|
|
19
|
+
*
|
|
20
|
+
* ORDER: our -c flags go FIRST. `-c` is a root option, and codex reads root options before the
|
|
21
|
+
* `[PROMPT]` or `<COMMAND>` that follows them, so in front it applies to a bare session, to
|
|
22
|
+
* `exec`, `resume` and every other subcommand, and it can never land after a user's `--`, where
|
|
23
|
+
* it would be read as a prompt.
|
|
24
|
+
*/
|
|
25
|
+
export function buildCodexLaunch(c) {
|
|
26
|
+
const injected = [];
|
|
27
|
+
const notes = [];
|
|
28
|
+
if (c.conflict) {
|
|
29
|
+
// -c can set keys but never remove one: injecting would launch a merged, repo-shaped server.
|
|
30
|
+
notes.push(`${c.conflict} redefines the align-local MCP server, so Align's graph is off for this Codex session. Remove that entry to use the graph here.`);
|
|
31
|
+
}
|
|
32
|
+
else if (c.overridden.length > 0 || !c.present) {
|
|
33
|
+
const { command, args } = alignServerEntry('mcpServers', 'local');
|
|
34
|
+
const key = `mcp_servers.${INJECTED_SERVER_NAME}`;
|
|
35
|
+
injected.push('-c', `${key}.command=${tomlLiteral(command)}`, '-c', `${key}.args=[${args.map(tomlLiteral).join(',')}]`);
|
|
36
|
+
if (c.overridden.length > 0) {
|
|
37
|
+
// The table holds only command/args/enabled, so these three overrides replace all of it.
|
|
38
|
+
injected.push('-c', `${key}.enabled=true`);
|
|
39
|
+
notes.push(`Replaced the align-local MCP server in ${c.overridden.join(', ')} with Align's own for this Codex session.`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return { bin: 'codex', args: [...injected, ...c.passthrough], env: { ALIGN_WRAPPED: '1' }, files: [], ...(notes.length > 0 ? { notes } : {}) };
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=codex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAg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,CAAC,0CAA0C,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;QAC3H,CAAC;IACH,CAAC;IACD,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,QAAQ,EAAE,GAAG,CAAC,CAAC,WAAW,CAAC,EAAE,GAAG,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACjJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AlignLocalState } from '../strict-entry.js';
|
|
2
|
+
import type { LaunchContext, LaunchSpec } from './claude-code.js';
|
|
3
|
+
export interface CopilotLaunchContext extends Pick<LaunchContext, 'passthrough' | 'cachePath'>, AlignLocalState {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* GitHub Copilot CLI, per session, nothing written to the user's own config (copilot 1.0.95,
|
|
7
|
+
* `copilot --help`): `--additional-mcp-config <json>` takes "JSON string or file path (prefix
|
|
8
|
+
* with @) ... augments config from ~/.copilot/mcp-config.json for this session". So align-local
|
|
9
|
+
* goes in a launch file and the user's own servers still load. COPILOT_HOME is never set: that
|
|
10
|
+
* dir also holds the user's auth.
|
|
11
|
+
*
|
|
12
|
+
* ORDER: the flag goes FIRST. It is a root option: `copilot --additional-mcp-config @f mcp list`
|
|
13
|
+
* is accepted and `copilot mcp list --additional-mcp-config @f` is refused by the subcommand
|
|
14
|
+
* (both checked on 1.0.95), and in front it can never land after a user's `--`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildCopilotLaunch(c: CopilotLaunchContext): LaunchSpec;
|
|
17
|
+
//# sourceMappingURL=copilot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot.d.ts","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/copilot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,aAAa,EAAE,aAAa,GAAG,WAAW,CAAC,EAAE,eAAe;CAAG;AAMlH;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,oBAAoB,GAAG,UAAU,CAWtE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { alignServerEntry } from '../../mcp-setup.js';
|
|
2
|
+
/** Same reason as the Claude adapter: never shadow a user's own `align` server. */
|
|
3
|
+
const INJECTED_SERVER_NAME = 'align-local';
|
|
4
|
+
const MCP_FILE = 'copilot-mcp.json';
|
|
5
|
+
/**
|
|
6
|
+
* GitHub Copilot CLI, per session, nothing written to the user's own config (copilot 1.0.95,
|
|
7
|
+
* `copilot --help`): `--additional-mcp-config <json>` takes "JSON string or file path (prefix
|
|
8
|
+
* with @) ... augments config from ~/.copilot/mcp-config.json for this session". So align-local
|
|
9
|
+
* goes in a launch file and the user's own servers still load. COPILOT_HOME is never set: that
|
|
10
|
+
* dir also holds the user's auth.
|
|
11
|
+
*
|
|
12
|
+
* ORDER: the flag goes FIRST. It is a root option: `copilot --additional-mcp-config @f mcp list`
|
|
13
|
+
* is accepted and `copilot mcp list --additional-mcp-config @f` is refused by the subcommand
|
|
14
|
+
* (both checked on 1.0.95), and in front it can never land after a user's `--`.
|
|
15
|
+
*/
|
|
16
|
+
export function buildCopilotLaunch(c) {
|
|
17
|
+
const injected = [];
|
|
18
|
+
const files = [];
|
|
19
|
+
const notes = [];
|
|
20
|
+
if (c.conflict) {
|
|
21
|
+
notes.push(`${c.conflict} redefines the align-local MCP server, so Align's graph is off for this Copilot session. Remove that entry to use the graph here.`);
|
|
22
|
+
}
|
|
23
|
+
else if (!c.present) {
|
|
24
|
+
files.push({ name: MCP_FILE, content: `${JSON.stringify({ mcpServers: { [INJECTED_SERVER_NAME]: alignServerEntry('copilot', 'local') } }, null, 2)}\n` });
|
|
25
|
+
injected.push('--additional-mcp-config', `@${c.cachePath(MCP_FILE)}`);
|
|
26
|
+
}
|
|
27
|
+
return { bin: 'copilot', args: [...injected, ...c.passthrough], env: { ALIGN_WRAPPED: '1' }, files, ...(notes.length > 0 ? { notes } : {}) };
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=copilot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/copilot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAMtD,mFAAmF;AACnF,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAC3C,MAAM,QAAQ,GAAG,kBAAkB,CAAC;AAEpC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAAC,CAAuB;IACxD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,KAAK,GAAwB,EAAE,CAAC;IACtC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,mIAAmI,CAAC,CAAC;IAC/J,CAAC;SAAM,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACtB,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,EAAE,CAAC,oBAAoB,CAAC,EAAE,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAC1J,QAAQ,CAAC,IAAI,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,GAAG,QAAQ,EAAE,GAAG,CAAC,CAAC,WAAW,CAAC,EAAE,GAAG,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC/I,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DroidProjectState } from '../droid-state.js';
|
|
2
|
+
import type { LaunchContext, LaunchSpec } from './claude-code.js';
|
|
3
|
+
export interface DroidLaunchContext extends Pick<LaunchContext, 'passthrough' | 'cachePath'>, DroidProjectState {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Factory Droid, per session, nothing written to the user's own config (droid 0.237.0):
|
|
7
|
+
* `--settings <path>` is a "runtime settings file merged for this process only", and its `mcp`
|
|
8
|
+
* key takes the mcp.json shape. Droid lists that server as `[runtime]` beside the user's own,
|
|
9
|
+
* and the runtime definition wins a same-named one (verified with `droid --settings f mcp list`).
|
|
10
|
+
* The instructions go in with `--append-system-prompt-file` unless an AGENTS.md already holds them.
|
|
11
|
+
*
|
|
12
|
+
* A user who runs Droid with their own runtime settings keeps them: Droid takes one, so align
|
|
13
|
+
* adds no second file and says so in one line.
|
|
14
|
+
*
|
|
15
|
+
* ORDER: our flags go FIRST. They are root options (`droid --settings f mcp list` is accepted),
|
|
16
|
+
* so in front they apply to a bare session and to `exec`, and never land after a user's `--`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildDroidLaunch(c: DroidLaunchContext): LaunchSpec;
|
|
19
|
+
//# sourceMappingURL=droid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"droid.d.ts","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/droid.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAc,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9E,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,aAAa,EAAE,aAAa,GAAG,WAAW,CAAC,EAAE,iBAAiB;CAAG;AAMlH;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,kBAAkB,GAAG,UAAU,CAgBlE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { alignNudgeBody } from '../../agent-rules.js';
|
|
2
|
+
import { alignServerEntry } from '../../mcp-setup.js';
|
|
3
|
+
/** Same reason as the Claude adapter: never shadow a user's own `align` server. */
|
|
4
|
+
const INJECTED_SERVER_NAME = 'align-local';
|
|
5
|
+
const SETTINGS_FILE = 'droid-settings.json';
|
|
6
|
+
/**
|
|
7
|
+
* Factory Droid, per session, nothing written to the user's own config (droid 0.237.0):
|
|
8
|
+
* `--settings <path>` is a "runtime settings file merged for this process only", and its `mcp`
|
|
9
|
+
* key takes the mcp.json shape. Droid lists that server as `[runtime]` beside the user's own,
|
|
10
|
+
* and the runtime definition wins a same-named one (verified with `droid --settings f mcp list`).
|
|
11
|
+
* The instructions go in with `--append-system-prompt-file` unless an AGENTS.md already holds them.
|
|
12
|
+
*
|
|
13
|
+
* A user who runs Droid with their own runtime settings keeps them: Droid takes one, so align
|
|
14
|
+
* adds no second file and says so in one line.
|
|
15
|
+
*
|
|
16
|
+
* ORDER: our flags go FIRST. They are root options (`droid --settings f mcp list` is accepted),
|
|
17
|
+
* so in front they apply to a bare session and to `exec`, and never land after a user's `--`.
|
|
18
|
+
*/
|
|
19
|
+
export function buildDroidLaunch(c) {
|
|
20
|
+
const injected = [];
|
|
21
|
+
const files = [];
|
|
22
|
+
const notes = [];
|
|
23
|
+
if (c.ownSettings !== undefined) {
|
|
24
|
+
notes.push(`Droid is using your own runtime settings (${c.ownSettings}), so Align did not add its graph tools to this session.`);
|
|
25
|
+
}
|
|
26
|
+
else if (c.overridden.length > 0 || !c.present) {
|
|
27
|
+
files.push({ name: SETTINGS_FILE, content: `${JSON.stringify({ mcp: { mcpServers: { [INJECTED_SERVER_NAME]: alignServerEntry('vscode', 'local') } } }, null, 2)}\n` });
|
|
28
|
+
injected.push('--settings', c.cachePath(SETTINGS_FILE));
|
|
29
|
+
if (c.overridden.length > 0)
|
|
30
|
+
notes.push(`Droid will use Align's own align-local MCP server this session, not the one in ${c.overridden.join(', ')}.`);
|
|
31
|
+
}
|
|
32
|
+
if (!c.projectHasBlock) {
|
|
33
|
+
files.push({ name: 'align-instructions.md', content: `${alignNudgeBody()}\n` });
|
|
34
|
+
injected.push('--append-system-prompt-file', c.cachePath('align-instructions.md'));
|
|
35
|
+
}
|
|
36
|
+
return { bin: 'droid', args: [...injected, ...c.passthrough], env: { ALIGN_WRAPPED: '1' }, files, ...(notes.length > 0 ? { notes } : {}) };
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=droid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"droid.js","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/droid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAMtD,mFAAmF;AACnF,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAC3C,MAAM,aAAa,GAAG,qBAAqB,CAAC;AAE5C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB,CAAC,CAAqB;IACpD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,KAAK,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AG,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC7I,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type GeminiProjectState } from '../gemini-state.js';
|
|
2
|
+
import type { LaunchContext, LaunchSpec } from './claude-code.js';
|
|
3
|
+
export interface GeminiLaunchContext extends Pick<LaunchContext, 'passthrough' | 'cachePath'>, GeminiProjectState {
|
|
4
|
+
/** The environment the child will inherit: the user's own GEMINI_CLI_* are read from here. */
|
|
5
|
+
env: Record<string, string | undefined>;
|
|
6
|
+
platform: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const GEMINI_TRUST_NOTE = "Gemini turns off MCP servers, Align's included, in folders you haven't trusted. Trust this folder in Gemini to use the graph here.";
|
|
9
|
+
/**
|
|
10
|
+
* Gemini CLI, per session, nothing written to the user's own config (gemini 0.58.0):
|
|
11
|
+
* GEMINI_CLI_SYSTEM_SETTINGS_PATH names the system settings file, and Gemini MERGES its
|
|
12
|
+
* mcpServers with the user's (verified: `gemini mcp list` shows both). That variable REPLACES
|
|
13
|
+
* the system file Gemini would otherwise read (the user's own value, or the platform default an
|
|
14
|
+
* admin may have filled), so align points it at a COPY of that file with align-local added,
|
|
15
|
+
* never at a file of align's alone. Gemini also derives system-defaults.json from that file's
|
|
16
|
+
* directory, so the original location is pinned with GEMINI_CLI_SYSTEM_DEFAULTS_PATH unless the
|
|
17
|
+
* user set it. A system file align cannot read or parse is never replaced: no injection, and
|
|
18
|
+
* one line saying why (the same rule as OpenCode's OPENCODE_CONFIG_CONTENT).
|
|
19
|
+
*
|
|
20
|
+
* Trust: Gemini turns off every MCP server in a folder it does not trust. align says so in one
|
|
21
|
+
* line and never trusts a folder for the user (no --skip-trust, no GEMINI_CLI_TRUST_WORKSPACE).
|
|
22
|
+
* Instructions come from the managed GEMINI.md block. Pass-through args are the whole of the args.
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildGeminiLaunch(c: GeminiLaunchContext): LaunchSpec;
|
|
25
|
+
//# sourceMappingURL=gemini-cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gemini-cli.d.ts","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/gemini-cli.ts"],"names":[],"mappings":"AACA,OAAO,EAA+B,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG1F,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,aAAa,EAAE,aAAa,GAAG,WAAW,CAAC,EAAE,kBAAkB;IAC/G,8FAA8F;IAC9F,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAKD,eAAO,MAAM,iBAAiB,uIAAuI,CAAC;AActK;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,mBAAmB,GAAG,UAAU,CAkCpE"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { alignServerEntry } from '../../mcp-setup.js';
|
|
2
|
+
import { COPY_PREFIX, geminiCopyName } from '../gemini-state.js';
|
|
3
|
+
import { geminiSystemDefaultsPath } from '../gemini-trust.js';
|
|
4
|
+
import { parseJsonc } from '../strict-entry.js';
|
|
5
|
+
/** Same reason as the Claude adapter: never shadow a user's own `align` server. */
|
|
6
|
+
const INJECTED_SERVER_NAME = 'align-local';
|
|
7
|
+
export const GEMINI_TRUST_NOTE = "Gemini turns off MCP servers, Align's included, in folders you haven't trusted. Trust this folder in Gemini to use the graph here.";
|
|
8
|
+
const isObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
9
|
+
/** The system settings (JSONC, as Gemini reads them) as an object we can add to, or null when we must not touch them. */
|
|
10
|
+
function parseTheirs(text) {
|
|
11
|
+
if (text === null)
|
|
12
|
+
return {};
|
|
13
|
+
const parsed = parseJsonc(text);
|
|
14
|
+
if (!parsed)
|
|
15
|
+
return null;
|
|
16
|
+
if (parsed['mcpServers'] !== undefined && !isObject(parsed['mcpServers']))
|
|
17
|
+
return null;
|
|
18
|
+
return parsed;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Gemini CLI, per session, nothing written to the user's own config (gemini 0.58.0):
|
|
22
|
+
* GEMINI_CLI_SYSTEM_SETTINGS_PATH names the system settings file, and Gemini MERGES its
|
|
23
|
+
* mcpServers with the user's (verified: `gemini mcp list` shows both). That variable REPLACES
|
|
24
|
+
* the system file Gemini would otherwise read (the user's own value, or the platform default an
|
|
25
|
+
* admin may have filled), so align points it at a COPY of that file with align-local added,
|
|
26
|
+
* never at a file of align's alone. Gemini also derives system-defaults.json from that file's
|
|
27
|
+
* directory, so the original location is pinned with GEMINI_CLI_SYSTEM_DEFAULTS_PATH unless the
|
|
28
|
+
* user set it. A system file align cannot read or parse is never replaced: no injection, and
|
|
29
|
+
* one line saying why (the same rule as OpenCode's OPENCODE_CONFIG_CONTENT).
|
|
30
|
+
*
|
|
31
|
+
* Trust: Gemini turns off every MCP server in a folder it does not trust. align says so in one
|
|
32
|
+
* line and never trusts a folder for the user (no --skip-trust, no GEMINI_CLI_TRUST_WORKSPACE).
|
|
33
|
+
* Instructions come from the managed GEMINI.md block. Pass-through args are the whole of the args.
|
|
34
|
+
*/
|
|
35
|
+
export function buildGeminiLaunch(c) {
|
|
36
|
+
const env = { ALIGN_WRAPPED: '1' };
|
|
37
|
+
const files = [];
|
|
38
|
+
const notes = [];
|
|
39
|
+
const copy = geminiCopyName(c.systemSettings.path);
|
|
40
|
+
let injected = false;
|
|
41
|
+
if (c.overridden.length > 0 || !c.present) {
|
|
42
|
+
const theirs = c.systemSettings.unreadable ? null : parseTheirs(c.systemSettings.text);
|
|
43
|
+
if (!theirs) {
|
|
44
|
+
notes.push(`Gemini's system settings file ${c.systemSettings.path} is not readable JSON with an object "mcpServers", so Align's graph tools were not added to this session. Fix the file, or point GEMINI_CLI_SYSTEM_SETTINGS_PATH at one that is.`);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
// Set unconditionally: a canonical align-local here would have made `present` true with
|
|
48
|
+
// nothing overridden, so whatever is under this name now is replaced by ours.
|
|
49
|
+
const merged = { ...theirs, mcpServers: { ...(theirs['mcpServers'] ?? {}), [INJECTED_SERVER_NAME]: alignServerEntry('mcpServers', 'local') } };
|
|
50
|
+
// 0600: the copy carries whatever the admin's system file holds.
|
|
51
|
+
files.push({ name: copy, content: `${JSON.stringify(merged, null, 2)}\n`, mode: 0o600 });
|
|
52
|
+
env['GEMINI_CLI_SYSTEM_SETTINGS_PATH'] = c.cachePath(copy);
|
|
53
|
+
if (!c.env['GEMINI_CLI_SYSTEM_DEFAULTS_PATH'])
|
|
54
|
+
env['GEMINI_CLI_SYSTEM_DEFAULTS_PATH'] = geminiSystemDefaultsPath(c.systemSettings.path, c.platform);
|
|
55
|
+
if (c.overridden.length > 0)
|
|
56
|
+
notes.push(`Gemini will use Align's own align-local MCP server this session, not the one in ${c.overridden.join(', ')}.`);
|
|
57
|
+
injected = true;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (c.trust === 'untrusted' || c.trust === 'unknown')
|
|
61
|
+
notes.push(GEMINI_TRUST_NOTE);
|
|
62
|
+
return {
|
|
63
|
+
bin: 'gemini',
|
|
64
|
+
args: [...c.passthrough],
|
|
65
|
+
env,
|
|
66
|
+
files,
|
|
67
|
+
// This source's copy is refreshed when used and removed when not. Other sources' copies may
|
|
68
|
+
// belong to a concurrent session, so they only age out (pruneLaunchFiles).
|
|
69
|
+
prune: { prefix: COPY_PREFIX, ...(injected ? { keep: copy } : { remove: copy }) },
|
|
70
|
+
...(notes.length > 0 ? { notes } : {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ACpJ,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;gBAAE,KAAK,CAAC,IAAI,CAAC,mFAAmF,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACvJ,QAAQ,GAAG,IAAI,CAAC;QAClB,CAAC;IACH,CAAC;IACD,IAAI,CAAC,CAAC,KAAK,KAAK,WAAW,IAAI,CAAC,CAAC,KAAK,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACpF,OAAO;QACL,GAAG,EAAE,QAAQ;QACb,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC;QACxB,GAAG;QACH,KAAK;QACL,4FAA4F;QAC5F,2EAA2E;QAC3E,KAAK,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE;QACjF,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACvC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GrokProjectState } from '../grok-state.js';
|
|
2
|
+
import type { LaunchContext, LaunchSpec } from './claude-code.js';
|
|
3
|
+
export interface GrokLaunchContext extends Pick<LaunchContext, 'passthrough'>, GrokProjectState {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Grok Build (xAI's `grok`), written ONCE: grok 1.0.50 has no per-session MCP input (no flag in
|
|
7
|
+
* its CLI source; the GROK_CONFIG overlay is allowlisted and excludes `mcp_servers`), so the
|
|
8
|
+
* `[mcp_servers.align-local]` table is appended once to `$GROK_HOME/config.toml` inside an
|
|
9
|
+
* align-owned marked block, by the safe writer, with an exact `align use --undo` (verified in a
|
|
10
|
+
* sandbox: `grok mcp list` then shows the user's servers and align-local).
|
|
11
|
+
*
|
|
12
|
+
* No flags are injected: no `--trust`, Grok's folder trust stays the user's decision.
|
|
13
|
+
* Instructions come from AGENTS.md / CLAUDE.md, which Grok reads.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildGrokLaunch(c: GrokLaunchContext): LaunchSpec;
|
|
16
|
+
//# sourceMappingURL=grok-build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grok-build.d.ts","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/grok-build.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,EAAE,gBAAgB;CAAG;AAIlG;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,iBAAiB,GAAG,UAAU,CAUhE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { alignServerEntry } from '../../mcp-setup.js';
|
|
2
|
+
const INJECTED_SERVER_NAME = 'align-local';
|
|
3
|
+
/**
|
|
4
|
+
* Grok Build (xAI's `grok`), written ONCE: grok 1.0.50 has no per-session MCP input (no flag in
|
|
5
|
+
* its CLI source; the GROK_CONFIG overlay is allowlisted and excludes `mcp_servers`), so the
|
|
6
|
+
* `[mcp_servers.align-local]` table is appended once to `$GROK_HOME/config.toml` inside an
|
|
7
|
+
* align-owned marked block, by the safe writer, with an exact `align use --undo` (verified in a
|
|
8
|
+
* sandbox: `grok mcp list` then shows the user's servers and align-local).
|
|
9
|
+
*
|
|
10
|
+
* No flags are injected: no `--trust`, Grok's folder trust stays the user's decision.
|
|
11
|
+
* Instructions come from AGENTS.md / CLAUDE.md, which Grok reads.
|
|
12
|
+
*/
|
|
13
|
+
export function buildGrokLaunch(c) {
|
|
14
|
+
const writes = [];
|
|
15
|
+
const notes = [];
|
|
16
|
+
if (c.conflict) {
|
|
17
|
+
notes.push(`${c.conflict} defines its own align-local MCP server, so Align did not add its graph to Grok Build. Remove that entry to use the graph.`);
|
|
18
|
+
}
|
|
19
|
+
else if (!c.present) {
|
|
20
|
+
const { command, args } = alignServerEntry('mcpServers', 'local');
|
|
21
|
+
writes.push({ kind: 'toml-mcp-entry', file: c.configFile, topKey: 'mcp_servers', name: INJECTED_SERVER_NAME, entry: { command, args } });
|
|
22
|
+
}
|
|
23
|
+
return { bin: 'grok', args: [...c.passthrough], env: { ALIGN_WRAPPED: '1' }, files: [], ...(writes.length > 0 ? { writes } : {}), ...(notes.length > 0 ? { notes } : {}) };
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=grok-build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grok-build.js","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/grok-build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAOtD,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAE3C;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,CAAoB;IAClD,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,4HAA4H,CAAC,CAAC;IACxJ,CAAC;SAAM,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACtB,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAC,YAAY,EAAE,OAAO,CAAwC,CAAC;QACzG,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IAC3I,CAAC;IACD,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,EAAE,GAAG,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC7K,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { KiroProjectState } from '../kiro-state.js';
|
|
2
|
+
import type { LaunchContext, LaunchSpec } from './claude-code.js';
|
|
3
|
+
export interface KiroLaunchContext extends Pick<LaunchContext, 'passthrough'>, KiroProjectState {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Kiro CLI, written ONCE, from its docs only: no per-session MCP input is documented, so the
|
|
7
|
+
* `align-local` entry goes into the user's global `~/.kiro/settings/mcp.json` by the safe writer,
|
|
8
|
+
* once, with an exact `align use --undo`.
|
|
9
|
+
*
|
|
10
|
+
* Deliberately NOT a custom agent file launched with `--agent`: an agent file declares its own
|
|
11
|
+
* tools, and whether it keeps the user's own MCP servers and default tools could not be checked
|
|
12
|
+
* against a binary (no npm package; the installer is a script, which align never runs). An agent
|
|
13
|
+
* that silently hid the user's tools would be worse than none. No flags are injected: no
|
|
14
|
+
* `--trust-all-tools`, Kiro's own approval stays the user's. Instructions come from AGENTS.md.
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildKiroLaunch(c: KiroLaunchContext): LaunchSpec;
|
|
17
|
+
//# sourceMappingURL=kiro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kiro.d.ts","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/kiro.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,EAAE,gBAAgB;CAAG;AAIlG;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,iBAAiB,GAAG,UAAU,CAShE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { alignServerEntry } from '../../mcp-setup.js';
|
|
2
|
+
const INJECTED_SERVER_NAME = 'align-local';
|
|
3
|
+
/**
|
|
4
|
+
* Kiro CLI, written ONCE, from its docs only: no per-session MCP input is documented, so the
|
|
5
|
+
* `align-local` entry goes into the user's global `~/.kiro/settings/mcp.json` by the safe writer,
|
|
6
|
+
* once, with an exact `align use --undo`.
|
|
7
|
+
*
|
|
8
|
+
* Deliberately NOT a custom agent file launched with `--agent`: an agent file declares its own
|
|
9
|
+
* tools, and whether it keeps the user's own MCP servers and default tools could not be checked
|
|
10
|
+
* against a binary (no npm package; the installer is a script, which align never runs). An agent
|
|
11
|
+
* that silently hid the user's tools would be worse than none. No flags are injected: no
|
|
12
|
+
* `--trust-all-tools`, Kiro's own approval stays the user's. Instructions come from AGENTS.md.
|
|
13
|
+
*/
|
|
14
|
+
export function buildKiroLaunch(c) {
|
|
15
|
+
const writes = [];
|
|
16
|
+
const notes = [];
|
|
17
|
+
if (c.conflict) {
|
|
18
|
+
notes.push(`${c.conflict} defines its own align-local MCP server, so Align did not add its graph to Kiro. Remove that entry to use the graph.`);
|
|
19
|
+
}
|
|
20
|
+
else if (!c.present) {
|
|
21
|
+
writes.push({ kind: 'mcp-entry', file: c.mcpFile, topKey: 'mcpServers', name: INJECTED_SERVER_NAME, entry: alignServerEntry('mcpServers', 'local') });
|
|
22
|
+
}
|
|
23
|
+
return { bin: 'kiro-cli', args: [...c.passthrough], env: { ALIGN_WRAPPED: '1' }, files: [], ...(writes.length > 0 ? { writes } : {}), ...(notes.length > 0 ? { notes } : {}) };
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=kiro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kiro.js","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/kiro.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAOtD,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAE3C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAC,CAAoB;IAClD,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,sHAAsH,CAAC,CAAC;IAClJ,CAAC;SAAM,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACtB,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,gBAAgB,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IACxJ,CAAC;IACD,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,EAAE,GAAG,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACjL,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type QwenProjectState } from '../qwen-state.js';
|
|
2
|
+
import type { LaunchContext, LaunchSpec } from './claude-code.js';
|
|
3
|
+
export interface QwenLaunchContext extends Pick<LaunchContext, 'passthrough' | 'cachePath'>, QwenProjectState {
|
|
4
|
+
/** The environment the child will inherit: the user's own QWEN_CODE_* are read from here. */
|
|
5
|
+
env: Record<string, string | undefined>;
|
|
6
|
+
platform: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const QWEN_TRUST_NOTE = "Qwen Code turns off MCP servers, Align's included, in folders you haven't trusted. Trust this folder in Qwen Code to use the graph here.";
|
|
9
|
+
/**
|
|
10
|
+
* Qwen Code, per session, nothing written to the user's own config (qwen-code 0.25.0, a Gemini
|
|
11
|
+
* CLI fork with the same mechanism): QWEN_CODE_SYSTEM_SETTINGS_PATH names the system settings
|
|
12
|
+
* file, read LAST and merged shallowly, so align points it at a 0600 COPY of the file Qwen would
|
|
13
|
+
* otherwise read with align-local added (verified: `qwen mcp list` then shows the user's servers
|
|
14
|
+
* and align-local, and align's entry replaces a user or workspace align-local whole). The
|
|
15
|
+
* original system-defaults location is pinned with QWEN_CODE_SYSTEM_DEFAULTS_PATH unless the
|
|
16
|
+
* user set it. A system file align cannot read or parse is never replaced: no injection, one line.
|
|
17
|
+
*
|
|
18
|
+
* Not `--mcp-config`: Qwen has one, but how it ranks against a same-named server in a settings
|
|
19
|
+
* layer was not established, and the system tier's rank was.
|
|
20
|
+
*
|
|
21
|
+
* Trust: off by default in Qwen; when on, an untrusted folder gets MCP turned off, and align says
|
|
22
|
+
* so in one line. It never trusts a folder for the user. Pass-through args are the whole of the args.
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildQwenLaunch(c: QwenLaunchContext): LaunchSpec;
|
|
25
|
+
//# sourceMappingURL=qwen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qwen.d.ts","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/qwen.ts"],"names":[],"mappings":"AACA,OAAO,EAAkC,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzF,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,aAAa,EAAE,aAAa,GAAG,WAAW,CAAC,EAAE,gBAAgB;IAC3G,6FAA6F;IAC7F,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAKD,eAAO,MAAM,eAAe,6IAA6I,CAAC;AAa1K;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,iBAAiB,GAAG,UAAU,CA6BhE"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { alignServerEntry } from '../../mcp-setup.js';
|
|
2
|
+
import { QWEN_COPY_PREFIX, qwenCopyName } from '../qwen-state.js';
|
|
3
|
+
import { qwenSystemDefaultsPath } from '../qwen-trust.js';
|
|
4
|
+
import { parseJsonc } from '../strict-entry.js';
|
|
5
|
+
/** Same reason as the Claude adapter: never shadow a user's own `align` server. */
|
|
6
|
+
const INJECTED_SERVER_NAME = 'align-local';
|
|
7
|
+
export const QWEN_TRUST_NOTE = "Qwen Code turns off MCP servers, Align's included, in folders you haven't trusted. Trust this folder in Qwen Code to use the graph here.";
|
|
8
|
+
const isObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
9
|
+
function parseTheirs(text) {
|
|
10
|
+
if (text === null)
|
|
11
|
+
return {};
|
|
12
|
+
const parsed = parseJsonc(text);
|
|
13
|
+
if (!parsed)
|
|
14
|
+
return null;
|
|
15
|
+
if (parsed['mcpServers'] !== undefined && !isObject(parsed['mcpServers']))
|
|
16
|
+
return null;
|
|
17
|
+
return parsed;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Qwen Code, per session, nothing written to the user's own config (qwen-code 0.25.0, a Gemini
|
|
21
|
+
* CLI fork with the same mechanism): QWEN_CODE_SYSTEM_SETTINGS_PATH names the system settings
|
|
22
|
+
* file, read LAST and merged shallowly, so align points it at a 0600 COPY of the file Qwen would
|
|
23
|
+
* otherwise read with align-local added (verified: `qwen mcp list` then shows the user's servers
|
|
24
|
+
* and align-local, and align's entry replaces a user or workspace align-local whole). The
|
|
25
|
+
* original system-defaults location is pinned with QWEN_CODE_SYSTEM_DEFAULTS_PATH unless the
|
|
26
|
+
* user set it. A system file align cannot read or parse is never replaced: no injection, one line.
|
|
27
|
+
*
|
|
28
|
+
* Not `--mcp-config`: Qwen has one, but how it ranks against a same-named server in a settings
|
|
29
|
+
* layer was not established, and the system tier's rank was.
|
|
30
|
+
*
|
|
31
|
+
* Trust: off by default in Qwen; when on, an untrusted folder gets MCP turned off, and align says
|
|
32
|
+
* so in one line. It never trusts a folder for the user. Pass-through args are the whole of the args.
|
|
33
|
+
*/
|
|
34
|
+
export function buildQwenLaunch(c) {
|
|
35
|
+
const env = { ALIGN_WRAPPED: '1' };
|
|
36
|
+
const files = [];
|
|
37
|
+
const notes = [];
|
|
38
|
+
const copy = qwenCopyName(c.systemSettings.path);
|
|
39
|
+
let injected = false;
|
|
40
|
+
if (c.overridden.length > 0 || !c.present) {
|
|
41
|
+
const theirs = c.systemSettings.unreadable ? null : parseTheirs(c.systemSettings.text);
|
|
42
|
+
if (!theirs) {
|
|
43
|
+
notes.push(`Qwen Code's system settings file ${c.systemSettings.path} is not readable JSON with an object "mcpServers", so Align's graph tools were not added to this session. Fix the file, or point QWEN_CODE_SYSTEM_SETTINGS_PATH at one that is.`);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
const merged = { ...theirs, mcpServers: { ...(theirs['mcpServers'] ?? {}), [INJECTED_SERVER_NAME]: alignServerEntry('mcpServers', 'local') } };
|
|
47
|
+
files.push({ name: copy, content: `${JSON.stringify(merged, null, 2)}\n`, mode: 0o600 });
|
|
48
|
+
env['QWEN_CODE_SYSTEM_SETTINGS_PATH'] = c.cachePath(copy);
|
|
49
|
+
if (!c.env['QWEN_CODE_SYSTEM_DEFAULTS_PATH'])
|
|
50
|
+
env['QWEN_CODE_SYSTEM_DEFAULTS_PATH'] = qwenSystemDefaultsPath(c.systemSettings.path, c.platform);
|
|
51
|
+
if (c.overridden.length > 0)
|
|
52
|
+
notes.push(`Qwen Code will use Align's own align-local MCP server this session, not the one in ${c.overridden.join(', ')}.`);
|
|
53
|
+
injected = true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (c.trust === 'untrusted' || c.trust === 'unknown')
|
|
57
|
+
notes.push(QWEN_TRUST_NOTE);
|
|
58
|
+
return {
|
|
59
|
+
bin: 'qwen',
|
|
60
|
+
args: [...c.passthrough],
|
|
61
|
+
env,
|
|
62
|
+
files,
|
|
63
|
+
prune: { prefix: QWEN_COPY_PREFIX, ...(injected ? { keep: copy } : { remove: copy }) },
|
|
64
|
+
...(notes.length > 0 ? { notes } : {}),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=qwen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qwen.js","sourceRoot":"","sources":["../../../../src/lib/launch/adapters/qwen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAyB,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE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E,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC;QACxB,GAAG;QACH,KAAK;QACL,KAAK,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE;QACtF,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACvC,CAAC;AACJ,CAAC"}
|
|
@@ -1,21 +1,34 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LaunchAgentId } from './registry/types.js';
|
|
2
2
|
export interface LaunchAgent {
|
|
3
|
-
name:
|
|
3
|
+
name: LaunchAgentId;
|
|
4
4
|
label: string;
|
|
5
5
|
bin: string;
|
|
6
6
|
/** per-session: nothing written to the user's config. written-once: later phases. */
|
|
7
7
|
injection: 'per-session' | 'written-once';
|
|
8
8
|
/** A launch target today. Later phases flip more entries to true; nothing else changes. */
|
|
9
9
|
supported: boolean;
|
|
10
|
+
/** The install command or URL, as text. The structured form is on the registry spec. */
|
|
10
11
|
install: string;
|
|
11
12
|
}
|
|
12
13
|
export declare const LAUNCH_AGENTS: readonly LaunchAgent[];
|
|
13
14
|
export declare function agentByName(name: string | undefined): LaunchAgent | undefined;
|
|
14
15
|
export declare const supportedAgents: () => LaunchAgent[];
|
|
16
|
+
/**
|
|
17
|
+
* Which agent to take when several are installed and nobody can be asked (no terminal, or
|
|
18
|
+
* --approve). The agents launchable before wave A keep their old order, Claude Code first, so a
|
|
19
|
+
* scripted first run picks what it picked before; the wave A agents come after them.
|
|
20
|
+
*/
|
|
21
|
+
export declare const PICK_PRIORITY: readonly LaunchAgentId[];
|
|
22
|
+
/** The agents launchable before wave A. */
|
|
23
|
+
export declare const PRE_WAVE_A: ReadonlySet<LaunchAgentId>;
|
|
24
|
+
/** The agents launchable before wave B (wave A included). */
|
|
25
|
+
export declare const PRE_WAVE_B: ReadonlySet<LaunchAgentId>;
|
|
26
|
+
export declare function byPriority(agents: LaunchAgent[]): LaunchAgent[];
|
|
15
27
|
/**
|
|
16
28
|
* The agent's binary on PATH, and where. Only `bin` is accepted: for Cursor that is `cursor-agent`,
|
|
17
29
|
* which its installer always creates. Cursor's docs also call the command `agent`, but that name
|
|
18
|
-
* is too generic to run on a guess, so a bare `agent` on PATH is not Cursor.
|
|
30
|
+
* is too generic to run on a guess, so a bare `agent` on PATH is not Cursor. A spec whose `bin` is
|
|
31
|
+
* generic (Grok Build's `grok`) also names `acceptsBin`, and a `bin` it refuses is not installed.
|
|
19
32
|
*/
|
|
20
33
|
export declare function resolveAgentBin(a: LaunchAgent, find: (bin: string, env: Record<string, string | undefined>, platform: string) => string | null, env: Record<string, string | undefined>, platform: string): {
|
|
21
34
|
bin: string;
|