@hue-run/sdk 0.11.0 → 0.11.1
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/CLI.md +22 -16
- package/dist/cli/mcp.d.ts +14 -13
- package/dist/cli/mcp.js +49 -48
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CLI.md
CHANGED
|
@@ -42,7 +42,7 @@ project manifest are refused because managers can update ancestor locks; Python
|
|
|
42
42
|
The generated `hue.setup.mjs` or `hue_setup.py` always selects `captureContent: false` /
|
|
43
43
|
`capture_content=False`. For a supported application, setup installs the dependency and adds the
|
|
44
44
|
managed import and middleware registration to the existing entrypoint; an unreferenced helper is
|
|
45
|
-
not a completed integration. TypeScript uses `@hue-run/sdk@0.11.
|
|
45
|
+
not a completed integration. TypeScript uses `@hue-run/sdk@0.11.1`, `@opentelemetry/api@1.9.1` and
|
|
46
46
|
`@opentelemetry/context-async-hooks@2.11.0`; Python setup uses its separately tested package pin.
|
|
47
47
|
Content capture requires an ordinary account-managed key and a later explicit application decision.
|
|
48
48
|
|
|
@@ -187,7 +187,7 @@ for staging). Hue's Settings page does not show these snippets; this command kee
|
|
|
187
187
|
- `key` (the default, except for `conductor`) references the `HUE_MCP_KEY` environment variable,
|
|
188
188
|
which `hue login` stores in `.env.hue`. A key value is never written.
|
|
189
189
|
- `oauth` configures the URL only. The client opens Hue in a browser, where you sign in and
|
|
190
|
-
approve the connection; no key
|
|
190
|
+
approve the connection; no key is involved. A new sign-in connection has **Read and
|
|
191
191
|
write** access to every active project in the organization you choose, within your role, so an
|
|
192
192
|
agent first calls `list_projects` and passes the chosen project's id as `project_id`. It is available
|
|
193
193
|
for `claude-code`, `codex` and `conductor`. Hue does not yet accept Cursor's sign-in callback, so
|
|
@@ -198,28 +198,34 @@ tools whatever the key allows. A project key, with or without it, keeps reaching
|
|
|
198
198
|
With `--auth oauth` it is refused: a sign-in connection has **Read and write** access, so use a
|
|
199
199
|
**Read** project key for read-only access.
|
|
200
200
|
|
|
201
|
-
`--toolsets <names>`
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
because
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
selection.
|
|
201
|
+
`--toolsets <names>` chooses the tools the connection lists: `all`, `observe` (the production
|
|
202
|
+
reads: projects, traces, spans and their recorded content, sessions, trace checks, intents and
|
|
203
|
+
documentation), or the groups `project`, `traces`, `evals`, `environments`, `intents` and `docs`,
|
|
204
|
+
comma-separated. The selection is added to the URL as `?toolsets=<names>`, for a key or a sign-in
|
|
205
|
+
configuration alike. Without `--toolsets`, `claude-code`, `codex` and `conductor` select `all`,
|
|
206
|
+
because those agents defer MCP tools behind their own tool search; `cursor`, which caps the tools
|
|
207
|
+
it loads, selects `observe`; the other clients list Hue's default. The default is the production
|
|
208
|
+
reads plus `search_hue_tools`, which finds every other tool the connection can call, and
|
|
209
|
+
`execute_hue_tool` and `execute_hue_write_tool`, which call one by name (the write executor only
|
|
210
|
+
with write access), so nothing is out of reach. `--toolsets` replaces a selection already in
|
|
211
|
+
`--url`, and a selection in `--url` is kept without it. Unknown names are refused rather than
|
|
212
|
+
passed on, because Hue ignores them and would list its default. `get_project_context` is always
|
|
213
|
+
listed and reports the selection.
|
|
212
214
|
|
|
213
215
|
| Client | Key (`--auth key`) | Sign-in (`--auth oauth`) |
|
|
214
216
|
| --- | --- | --- |
|
|
215
217
|
| `claude-code` | Merges `mcpServers.hue` into `./.mcp.json`. `--scope user` runs `claude mcp add --transport http --scope user hue URL --header 'Authorization: Bearer ${HUE_MCP_KEY}'` when `claude` is on `PATH`, otherwise prints it. | Merges `mcpServers.hue` with only `type` and `url` into `./.mcp.json`; `--scope user` runs `claude mcp add --transport http --scope user hue URL`. Then run `/mcp` in Claude Code, select `hue` and choose **Authenticate**. |
|
|
216
|
-
| `codex` | Runs `codex mcp add hue --url URL --bearer-token-env-var HUE_MCP_KEY`, or prints the `[mcp_servers.hue]` TOML block for `~/.codex/config.toml`. | Runs `codex mcp add hue --url URL`, which can start sign-in right away; `codex mcp login hue` starts or repeats it. |
|
|
218
|
+
| `codex` | Runs `codex mcp add hue --url URL --bearer-token-env-var HUE_MCP_KEY`, or prints the `[mcp_servers.hue]` TOML block for `~/.codex/config.toml`. | Runs `codex mcp add hue --url URL`, which can start sign-in right away; `codex mcp login hue` starts or repeats it. The printed TOML block keeps its URL bare and sends the selection as the `X-Hue-MCP-Toolsets` header. |
|
|
217
219
|
| `conductor` | Runs the Claude Code user-scope and Codex key commands above. | The default: runs `claude mcp add --transport http --scope user hue URL` and `codex mcp add hue --url URL`. Then use `hue`'s authentication action in Conductor's MCP status (the plug icon or `/mcp-status`). |
|
|
218
220
|
| `cursor` | Merges `mcpServers.hue` into `./.cursor/mcp.json` with `${env:HUE_MCP_KEY}`. | Refused. |
|
|
219
221
|
| `vscode` | Merges `servers.hue` and the `hue-mcp-key` password input into `./.vscode/mcp.json`. | Refused. |
|
|
220
222
|
| `windsurf` | Prints the `serverUrl` snippet for `~/.codeium/windsurf/mcp_config.json`; nothing is written to the home directory. | Refused. |
|
|
221
223
|
| `gemini` | Runs `gemini mcp add --scope user --transport http hue URL --header 'Authorization: Bearer ${HUE_MCP_KEY}'`, or prints it. | Refused. |
|
|
222
224
|
|
|
225
|
+
Every Codex TOML block sets `supports_parallel_tool_calls = true`, so Codex runs Hue's independent
|
|
226
|
+
calls in parallel rather than one at a time. `codex mcp add` has no option for it, so after
|
|
227
|
+
registering with Codex the command names the line to add under `[mcp_servers.hue]`.
|
|
228
|
+
|
|
223
229
|
Conductor has no MCP configuration of its own: its Claude Code and Codex agents read their user
|
|
224
230
|
configuration in every workspace, so `conductor` registers the server at user scope with each CLI
|
|
225
231
|
on `PATH` and prints the command for a CLI that is missing. A failing CLI does not stop the other;
|
|
@@ -406,7 +412,7 @@ node packages/sdk-typescript/scripts/verify-package.mjs --artifacts-dir .artifac
|
|
|
406
412
|
# Set project to an existing supported fixture; use the same directory on resume.
|
|
407
413
|
project=/absolute/path/to/supported-fixture
|
|
408
414
|
node packages/sdk-typescript/scripts/verify-setup-live.mjs \
|
|
409
|
-
--archive .artifacts/typescript/hue-run-sdk-0.11.
|
|
415
|
+
--archive .artifacts/typescript/hue-run-sdk-0.11.1.tgz \
|
|
410
416
|
--origin https://STAGING_ORIGIN \
|
|
411
417
|
--project "$project" --command setup \
|
|
412
418
|
--evidence .context/setup-staging-before-claim.json
|
|
@@ -417,7 +423,7 @@ the private local handoff and finish the real browser claim, then reconcile the
|
|
|
417
423
|
|
|
418
424
|
```sh
|
|
419
425
|
node packages/sdk-typescript/scripts/verify-setup-live.mjs \
|
|
420
|
-
--archive .artifacts/typescript/hue-run-sdk-0.11.
|
|
426
|
+
--archive .artifacts/typescript/hue-run-sdk-0.11.1.tgz \
|
|
421
427
|
--origin https://STAGING_ORIGIN \
|
|
422
428
|
--project "$project" --command claim \
|
|
423
429
|
--evidence .context/setup-staging-after-claim.json
|
package/dist/cli/mcp.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* `hue mcp install`: writes or prints the coding-agent configuration for Hue's MCP server. The
|
|
3
3
|
* shapes are those of Hue's published connection guide (https://docs.hue.run/agents/mcp-server),
|
|
4
4
|
* kept as a separate copy here. Key configurations reference the `HUE_MCP_KEY` environment
|
|
5
|
-
* variable (or a VS Code password input); sign-in configurations hold
|
|
6
|
-
* never written.
|
|
5
|
+
* variable (or a VS Code password input); sign-in configurations hold no credential. A key value
|
|
6
|
+
* is never written.
|
|
7
7
|
*/
|
|
8
8
|
/** Streams, environment and working directory for {@link runMcpCommand}; tests inject these. */
|
|
9
9
|
export interface McpCommandIo {
|
|
@@ -23,9 +23,12 @@ export declare const DEFAULT_MCP_URL = "https://mcp.hue.run/mcp";
|
|
|
23
23
|
export declare const MCP_VERIFY_PROMPT = "Use the Hue MCP: call list_projects and confirm which project to inspect. Then call get_project_context and show that project's traces from the last 24 hours that need attention or have errors, with links; if there are none, show its 5 most recent traces. For an organization connection, pass the project's id as project_id on each call after list_projects.";
|
|
24
24
|
/** Toolset names Hue's MCP server accepts: `all`, its catalog groups and the `observe` profile. */
|
|
25
25
|
export declare const MCP_TOOLSETS: readonly ["all", "observe", "project", "traces", "evals", "environments", "intents", "docs"];
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* The header form of `?toolsets=`. Only the sign-in Codex TOML uses it, as Hue's guide does, to
|
|
28
|
+
* keep that URL bare; every other configuration carries the selection in its URL.
|
|
29
|
+
*/
|
|
27
30
|
export declare const TOOLSETS_HEADER = "X-Hue-MCP-Toolsets";
|
|
28
|
-
export declare const MCP_USAGE = "Usage: hue mcp install --client <claude-code|codex|conductor|cursor|vscode|windsurf|gemini>\n [--auth key|oauth] [--read-only] [--toolsets NAMES] [--url URL]\n [--scope project|user] [--dry-run] [--print]\n\nConfigure a coding agent to use the Hue MCP server. A key configuration references the\nHUE_MCP_KEY environment variable; a key value is never written. A sign-in configuration holds\nonly the URL: the client opens Hue in a browser, where you approve access to the projects of\none organization.\n\nOptions:\n --client NAME Coding agent to configure (required)\n --auth MODE key: reference HUE_MCP_KEY (the default, except for conductor)\n oauth: URL only, sign in with Hue in the client (claude-code, codex and\n conductor; the default for conductor)\n --read-only key only: add ?read_only=true to the URL so write tools are hidden. A\n sign-in connection has Read and write access; use a Read key for read-only\n --toolsets NAMES\n
|
|
31
|
+
export declare const MCP_USAGE = "Usage: hue mcp install --client <claude-code|codex|conductor|cursor|vscode|windsurf|gemini>\n [--auth key|oauth] [--read-only] [--toolsets NAMES] [--url URL]\n [--scope project|user] [--dry-run] [--print]\n\nConfigure a coding agent to use the Hue MCP server. A key configuration references the\nHUE_MCP_KEY environment variable; a key value is never written. A sign-in configuration holds\nonly the URL: the client opens Hue in a browser, where you approve access to the projects of\none organization.\n\nOptions:\n --client NAME Coding agent to configure (required)\n --auth MODE key: reference HUE_MCP_KEY (the default, except for conductor)\n oauth: URL only, sign in with Hue in the client (claude-code, codex and\n conductor; the default for conductor)\n --read-only key only: add ?read_only=true to the URL so write tools are hidden. A\n sign-in connection has Read and write access; use a Read key for read-only\n --toolsets NAMES\n Tools to list, comma-separated: all, observe (production reads),\n project, traces, evals, environments, intents or docs, added to the\n URL as ?toolsets=. Defaults: all for claude-code, codex and conductor,\n which search their own tools; observe for cursor. Without a selection\n Hue lists the production reads and search_hue_tools, which reaches\n every other tool\n --url URL Hue MCP endpoint (default https://mcp.hue.run/mcp)\n --scope SCOPE claude-code only: project writes .mcp.json (default); user runs\n `claude mcp add --scope user`\n --dry-run Print the resulting file content or commands without writing or running\n --print Print the configuration snippet only\n -h, --help Show this help\n\nFiles: claude-code .mcp.json, cursor .cursor/mcp.json, vscode .vscode/mcp.json (relative to the\ncurrent directory). codex and gemini use their own CLI when it is on PATH; windsurf prints the\nsnippet for its user configuration file. conductor registers the server for its Claude Code\n(user scope) and Codex agents with their CLIs, printing the command for a CLI not on PATH.";
|
|
29
32
|
/**
|
|
30
33
|
* A URL as a POSIX shell word for printed commands: `?` is a zsh glob and `&` ends a command, so a
|
|
31
34
|
* URL with a query (such as `?read_only=true`) is single-quoted. Executed commands pass argv.
|
|
@@ -87,16 +90,14 @@ export declare function renderMcpSnippets(url: string): {
|
|
|
87
90
|
};
|
|
88
91
|
};
|
|
89
92
|
/**
|
|
90
|
-
* Sign-in snippets: the
|
|
91
|
-
* and
|
|
93
|
+
* Sign-in snippets: the server URL and nothing secret. The client discovers Hue's OAuth metadata
|
|
94
|
+
* from it and sends it, query included, on every request; the token's resource ignores the query,
|
|
95
|
+
* so `?toolsets=` selects tools here as it does for a key.
|
|
92
96
|
*/
|
|
93
|
-
export declare function renderMcpSignInSnippets(url: string
|
|
97
|
+
export declare function renderMcpSignInSnippets(url: string): {
|
|
94
98
|
claudeCodeServer: {
|
|
95
99
|
type: string;
|
|
96
100
|
url: string;
|
|
97
|
-
headers?: {
|
|
98
|
-
"X-Hue-MCP-Toolsets": string;
|
|
99
|
-
} | undefined;
|
|
100
101
|
};
|
|
101
102
|
claudeCodeProjectJson: string;
|
|
102
103
|
claudeCodeCli: {
|
|
@@ -111,7 +112,7 @@ export declare function renderMcpSignInSnippets(url: string, toolsets?: string):
|
|
|
111
112
|
};
|
|
112
113
|
/**
|
|
113
114
|
* Parses a comma-separated `--toolsets` value into Hue's canonical form, or returns an error.
|
|
114
|
-
* Unknown names are refused: Hue ignores them and would list
|
|
115
|
+
* Unknown names are refused: Hue ignores them and would list its default, hiding a typo.
|
|
115
116
|
*/
|
|
116
117
|
export declare function parseToolsets(value: string): {
|
|
117
118
|
toolsets: string;
|
|
@@ -119,8 +120,8 @@ export declare function parseToolsets(value: string): {
|
|
|
119
120
|
error: string;
|
|
120
121
|
};
|
|
121
122
|
/**
|
|
122
|
-
* `?toolsets=` lists only the selected tools
|
|
123
|
-
*
|
|
123
|
+
* `?toolsets=` lists only the selected tools; commas stay readable. Without a selection the
|
|
124
|
+
* parameter is removed, so the connection lists Hue's default.
|
|
124
125
|
*/
|
|
125
126
|
export declare function toolsetsMcpUrl(url: string, toolsets: string | undefined): string;
|
|
126
127
|
/** `?read_only=true` hides and rejects Hue's write tools for any key. */
|
package/dist/cli/mcp.js
CHANGED
|
@@ -48,10 +48,26 @@ export const MCP_TOOLSETS = [
|
|
|
48
48
|
"intents",
|
|
49
49
|
"docs",
|
|
50
50
|
];
|
|
51
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* The header form of `?toolsets=`. Only the sign-in Codex TOML uses it, as Hue's guide does, to
|
|
53
|
+
* keep that URL bare; every other configuration carries the selection in its URL.
|
|
54
|
+
*/
|
|
52
55
|
export const TOOLSETS_HEADER = "X-Hue-MCP-Toolsets";
|
|
53
|
-
/**
|
|
54
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Toolsets a client's configuration selects unless `--toolsets` says otherwise. Claude Code,
|
|
58
|
+
* Codex and Conductor's agents defer MCP tools behind their own tool search, so listing every tool
|
|
59
|
+
* costs them little. Cursor caps the tools it loads, so it names the production reads. The other
|
|
60
|
+
* clients list Hue's default: the production reads, and `search_hue_tools` with its executors,
|
|
61
|
+
* which reach every other tool.
|
|
62
|
+
*/
|
|
63
|
+
const DEFAULT_TOOLSETS = {
|
|
64
|
+
"claude-code": "all",
|
|
65
|
+
codex: "all",
|
|
66
|
+
conductor: "all",
|
|
67
|
+
cursor: "observe",
|
|
68
|
+
};
|
|
69
|
+
/** Codex runs a server's tool calls one at a time without it; each Hue call is independent. */
|
|
70
|
+
const CODEX_PARALLEL = "supports_parallel_tool_calls = true";
|
|
55
71
|
export const MCP_USAGE = `Usage: hue mcp install --client <claude-code|codex|conductor|cursor|vscode|windsurf|gemini>
|
|
56
72
|
[--auth key|oauth] [--read-only] [--toolsets NAMES] [--url URL]
|
|
57
73
|
[--scope project|user] [--dry-run] [--print]
|
|
@@ -69,10 +85,12 @@ Options:
|
|
|
69
85
|
--read-only key only: add ?read_only=true to the URL so write tools are hidden. A
|
|
70
86
|
sign-in connection has Read and write access; use a Read key for read-only
|
|
71
87
|
--toolsets NAMES
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
88
|
+
Tools to list, comma-separated: all, observe (production reads),
|
|
89
|
+
project, traces, evals, environments, intents or docs, added to the
|
|
90
|
+
URL as ?toolsets=. Defaults: all for claude-code, codex and conductor,
|
|
91
|
+
which search their own tools; observe for cursor. Without a selection
|
|
92
|
+
Hue lists the production reads and search_hue_tools, which reaches
|
|
93
|
+
every other tool
|
|
76
94
|
--url URL Hue MCP endpoint (default ${DEFAULT_MCP_URL})
|
|
77
95
|
--scope SCOPE claude-code only: project writes .mcp.json (default); user runs
|
|
78
96
|
\`claude mcp add --scope user\`
|
|
@@ -143,7 +161,7 @@ export function renderMcpSnippets(url) {
|
|
|
143
161
|
args: ["mcp", "add", SERVER_NAME, "--url", url, "--bearer-token-env-var", ENV_VAR],
|
|
144
162
|
display: `codex mcp add ${SERVER_NAME} --url ${shellWord(url)} --bearer-token-env-var ${ENV_VAR}`,
|
|
145
163
|
},
|
|
146
|
-
codexToml: `[mcp_servers.${SERVER_NAME}]\nurl = "${url}"\nbearer_token_env_var = "${ENV_VAR}"\n`,
|
|
164
|
+
codexToml: `[mcp_servers.${SERVER_NAME}]\nurl = "${url}"\nbearer_token_env_var = "${ENV_VAR}"\n${CODEX_PARALLEL}\n`,
|
|
147
165
|
vscodeServer,
|
|
148
166
|
vscodeInput,
|
|
149
167
|
vscodeJson: json({ servers: { [SERVER_NAME]: vscodeServer }, inputs: [vscodeInput] }),
|
|
@@ -169,41 +187,31 @@ export function renderMcpSnippets(url) {
|
|
|
169
187
|
};
|
|
170
188
|
}
|
|
171
189
|
/**
|
|
172
|
-
* Sign-in snippets: the
|
|
173
|
-
* and
|
|
190
|
+
* Sign-in snippets: the server URL and nothing secret. The client discovers Hue's OAuth metadata
|
|
191
|
+
* from it and sends it, query included, on every request; the token's resource ignores the query,
|
|
192
|
+
* so `?toolsets=` selects tools here as it does for a key.
|
|
174
193
|
*/
|
|
175
|
-
export function renderMcpSignInSnippets(url
|
|
176
|
-
const
|
|
177
|
-
const claudeCodeServer = { type: "http", url
|
|
178
|
-
const headerArgs = toolsets ? ["--header", `${TOOLSETS_HEADER}: ${toolsets}`] : [];
|
|
194
|
+
export function renderMcpSignInSnippets(url) {
|
|
195
|
+
const toolsets = new URL(url).searchParams.get("toolsets");
|
|
196
|
+
const claudeCodeServer = { type: "http", url };
|
|
179
197
|
return {
|
|
180
198
|
claudeCodeServer,
|
|
181
199
|
claudeCodeProjectJson: json({ mcpServers: { [SERVER_NAME]: claudeCodeServer } }),
|
|
182
200
|
claudeCodeCli: {
|
|
183
|
-
args: [
|
|
184
|
-
|
|
185
|
-
"add",
|
|
186
|
-
"--transport",
|
|
187
|
-
"http",
|
|
188
|
-
"--scope",
|
|
189
|
-
"user",
|
|
190
|
-
SERVER_NAME,
|
|
191
|
-
url,
|
|
192
|
-
...headerArgs,
|
|
193
|
-
],
|
|
194
|
-
display: `claude mcp add --transport http --scope user ${SERVER_NAME} ${shellWord(url)}${toolsets ? ` --header '${TOOLSETS_HEADER}: ${toolsets}'` : ""}`,
|
|
201
|
+
args: ["mcp", "add", "--transport", "http", "--scope", "user", SERVER_NAME, url],
|
|
202
|
+
display: `claude mcp add --transport http --scope user ${SERVER_NAME} ${shellWord(url)}`,
|
|
195
203
|
},
|
|
196
|
-
// `codex mcp add` cannot store a header; the TOML carries it and the next steps say so.
|
|
197
204
|
codexCli: {
|
|
198
205
|
args: ["mcp", "add", SERVER_NAME, "--url", url],
|
|
199
206
|
display: `codex mcp add ${SERVER_NAME} --url ${shellWord(url)}`,
|
|
200
207
|
},
|
|
201
|
-
|
|
208
|
+
// The header form of the same selection, for a TOML entry that keeps its URL bare.
|
|
209
|
+
codexToml: `[mcp_servers.${SERVER_NAME}]\nurl = "${toolsetsMcpUrl(url, undefined)}"\n${toolsets ? `http_headers = { "${TOOLSETS_HEADER}" = "${toolsets}" }\n` : ""}${CODEX_PARALLEL}\n`,
|
|
202
210
|
};
|
|
203
211
|
}
|
|
204
212
|
/**
|
|
205
213
|
* Parses a comma-separated `--toolsets` value into Hue's canonical form, or returns an error.
|
|
206
|
-
* Unknown names are refused: Hue ignores them and would list
|
|
214
|
+
* Unknown names are refused: Hue ignores them and would list its default, hiding a typo.
|
|
207
215
|
*/
|
|
208
216
|
export function parseToolsets(value) {
|
|
209
217
|
const names = [...new Set(value.split(",").map((name) => name.trim()))];
|
|
@@ -217,8 +225,8 @@ export function parseToolsets(value) {
|
|
|
217
225
|
return { toolsets: names.join(",") };
|
|
218
226
|
}
|
|
219
227
|
/**
|
|
220
|
-
* `?toolsets=` lists only the selected tools
|
|
221
|
-
*
|
|
228
|
+
* `?toolsets=` lists only the selected tools; commas stay readable. Without a selection the
|
|
229
|
+
* parameter is removed, so the connection lists Hue's default.
|
|
222
230
|
*/
|
|
223
231
|
export function toolsetsMcpUrl(url, toolsets) {
|
|
224
232
|
const parsed = new URL(url);
|
|
@@ -405,10 +413,10 @@ function displayPath(cwd, path) {
|
|
|
405
413
|
}
|
|
406
414
|
const notOnPath = (executable, label) => `${executable} is not on PATH. Run this where ${label} is installed:`;
|
|
407
415
|
/** `auth: "oauth"` is only planned for {@link OAUTH_CLIENTS}; the caller refuses the others. */
|
|
408
|
-
function planFor(client, auth, scope, url
|
|
416
|
+
function planFor(client, auth, scope, url) {
|
|
409
417
|
const snippets = renderMcpSnippets(url);
|
|
410
418
|
// Claude Code and Codex take the same plan shape with or without a key.
|
|
411
|
-
const shared = auth === "oauth" ? renderMcpSignInSnippets(url
|
|
419
|
+
const shared = auth === "oauth" ? renderMcpSignInSnippets(url) : snippets;
|
|
412
420
|
const claudeUser = {
|
|
413
421
|
executable: "claude",
|
|
414
422
|
label: "Claude Code",
|
|
@@ -479,7 +487,7 @@ function planFor(client, auth, scope, url, toolsets) {
|
|
|
479
487
|
}
|
|
480
488
|
}
|
|
481
489
|
}
|
|
482
|
-
function nextSteps(client, auth
|
|
490
|
+
function nextSteps(client, auth) {
|
|
483
491
|
const label = CLIENT_LABELS[client];
|
|
484
492
|
const approve = "Sign in to Hue and approve the connection. It can read and write every active project in the organization you choose, within your role; for read-only access, use a Read project key with --auth key.";
|
|
485
493
|
let lines;
|
|
@@ -510,9 +518,9 @@ function nextSteps(client, auth, toolsets) {
|
|
|
510
518
|
" set -a; . ./.env.hue; set +a",
|
|
511
519
|
`An app started from the Dock or a launcher does not see that shell's variables; start ${label} from the shell${OAUTH_CLIENTS.includes(client) ? ", or sign in instead with --auth oauth" : ""}.`,
|
|
512
520
|
];
|
|
513
|
-
// `codex mcp add`
|
|
514
|
-
if (
|
|
515
|
-
lines.push(`
|
|
521
|
+
// `codex mcp add` has no option for it, so a registered server gets the line by hand.
|
|
522
|
+
if (client === "codex" || client === "conductor")
|
|
523
|
+
lines.push(`If codex mcp add registered ${SERVER_NAME}, add this line under [mcp_servers.${SERVER_NAME}] in ~/.codex/config.toml so Codex runs Hue's tool calls in parallel:`, ` ${CODEX_PARALLEL}`);
|
|
516
524
|
return [...lines, "Then ask your agent:", ` ${MCP_VERIFY_PROMPT}`];
|
|
517
525
|
}
|
|
518
526
|
/**
|
|
@@ -570,11 +578,8 @@ export async function runMcpCommand(argv, io = {}) {
|
|
|
570
578
|
return fail("A sign-in connection has Read and write access and cannot be made read-only by its URL. For read-only access, use a Read project key (--auth key), or add --read-only to a key configuration.", 2);
|
|
571
579
|
if (parsed.values["read-only"])
|
|
572
580
|
url = readOnlyMcpUrl(url);
|
|
573
|
-
// Toolsets are not part of the protected resource either: a sign-in URL stays bare.
|
|
574
|
-
if (auth === "oauth" && new URL(url).searchParams.has("toolsets"))
|
|
575
|
-
return fail("Leave toolsets off a sign-in URL; --toolsets sends them in a header instead.", 2);
|
|
576
581
|
// --toolsets wins over a selection already in --url, which wins over the client's default.
|
|
577
|
-
// Both sources are validated: Hue ignores an unknown name and would list
|
|
582
|
+
// Both sources are validated: Hue ignores an unknown name and would list its default.
|
|
578
583
|
const requested = parsed.values.toolsets ?? new URL(url).searchParams.get("toolsets");
|
|
579
584
|
let toolsets = DEFAULT_TOOLSETS[clientId];
|
|
580
585
|
if (requested !== null) {
|
|
@@ -583,17 +588,13 @@ export async function runMcpCommand(argv, io = {}) {
|
|
|
583
588
|
return fail(`${parsed.values.toolsets === undefined ? "In --url: " : ""}${selected.error}\n\n${MCP_USAGE}`, 2);
|
|
584
589
|
toolsets = selected.toolsets;
|
|
585
590
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
toolsets = undefined;
|
|
589
|
-
if (auth === "key")
|
|
590
|
-
url = toolsetsMcpUrl(url, toolsets);
|
|
591
|
-
const plan = planFor(clientId, auth, scope, url, auth === "oauth" ? toolsets : undefined);
|
|
591
|
+
url = toolsetsMcpUrl(url, toolsets);
|
|
592
|
+
const plan = planFor(clientId, auth, scope, url);
|
|
592
593
|
if (parsed.values.print) {
|
|
593
594
|
stdout.write(plan.snippet);
|
|
594
595
|
return 0;
|
|
595
596
|
}
|
|
596
|
-
const steps = nextSteps(clientId, auth
|
|
597
|
+
const steps = nextSteps(clientId, auth);
|
|
597
598
|
if (plan.kind === "manual") {
|
|
598
599
|
out(plan.hint);
|
|
599
600
|
stdout.write(plan.snippet);
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Package version shared by the instrumentation scope and the export User-Agent. */
|
|
2
|
-
export declare const sdkVersion = "0.11.
|
|
2
|
+
export declare const sdkVersion = "0.11.1";
|
package/dist/version.js
CHANGED