@erdoai/cli 0.283.0 → 0.284.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/dist/index.js +24 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2941,6 +2941,26 @@ async function promptLine(question) {
|
|
|
2941
2941
|
}
|
|
2942
2942
|
}
|
|
2943
2943
|
|
|
2944
|
+
// src/mcp-header-input.ts
|
|
2945
|
+
function parseMCPHeaders(values) {
|
|
2946
|
+
const entries = /* @__PURE__ */ new Map();
|
|
2947
|
+
const names = /* @__PURE__ */ new Set();
|
|
2948
|
+
for (const header of values) {
|
|
2949
|
+
const separator = header.indexOf(":");
|
|
2950
|
+
if (separator < 1) throw new Error("invalid --mcp-header; expected Name: value");
|
|
2951
|
+
const name = header.slice(0, separator).trim();
|
|
2952
|
+
const value = header.slice(separator + 1).trim();
|
|
2953
|
+
if (!/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(name) || /[\r\n\0]/.test(value)) {
|
|
2954
|
+
throw new Error("invalid --mcp-header name or value");
|
|
2955
|
+
}
|
|
2956
|
+
const key = name.toLowerCase();
|
|
2957
|
+
if (names.has(key)) throw new Error("duplicate --mcp-header name");
|
|
2958
|
+
names.add(key);
|
|
2959
|
+
entries.set(name, value);
|
|
2960
|
+
}
|
|
2961
|
+
return Object.fromEntries(entries);
|
|
2962
|
+
}
|
|
2963
|
+
|
|
2944
2964
|
// src/integration-credential-input.ts
|
|
2945
2965
|
var PROMPT_FIELD = /^[A-Za-z0-9_.-]+$/;
|
|
2946
2966
|
async function resolveIntegrationCredentials(options) {
|
|
@@ -11182,7 +11202,7 @@ integrationsCmd.command("apps [query]").description("Search connectable apps (na
|
|
|
11182
11202
|
fail(e);
|
|
11183
11203
|
}
|
|
11184
11204
|
});
|
|
11185
|
-
integrationsCmd.command("connect <app>").description("Connect an app \u2014 pass credentials with -c or --prompt-credential, or omit them to get a browser connect URL for OAuth apps").option("-c, --credential <key=value...>", "credential field, e.g. -c api_key=\u2026 (repeatable); rejected by OAuth apps, which have no credential to pass", (v, acc) => acc.concat(v), []).option("--prompt-credential <field>", "prompt securely for a credential field (repeatable; interactive terminals only)", (v, acc) => acc.concat(v), []).option("-n, --name <name>", "display name for the connection").option("--rotate", "replace the credentials of the app's existing connection instead of adding a second one \u2014 for a key that was rotated at the provider; requires -c
|
|
11205
|
+
integrationsCmd.command("connect <app>").option("--mcp-url <url>", "Streamable HTTP MCP endpoint; use with app=mcp and --name").option("--mcp-header <header>", "static MCP header as Name: value (repeatable); --rotate replaces all headers", (v, acc) => acc.concat(v), []).option("--member-access <read_only|full>", "access for shared MCP members (default read_only)").description("Connect an app \u2014 pass credentials with -c or --prompt-credential, or omit them to get a browser connect URL for OAuth apps").option("-c, --credential <key=value...>", "credential field, e.g. -c api_key=\u2026 (repeatable); rejected by OAuth apps, which have no credential to pass", (v, acc) => acc.concat(v), []).option("--prompt-credential <field>", "prompt securely for a credential field (repeatable; interactive terminals only)", (v, acc) => acc.concat(v), []).option("-n, --name <name>", "display name for the connection").option("--rotate", "replace the credentials of the app's existing connection instead of adding a second one \u2014 for a key that was rotated at the provider; requires -c, --prompt-credential or MCP headers").option("--share", "share the connection with the whole organization instead of keeping it private to you \u2014 for org-level credentials teammates and agents should see").option(
|
|
11186
11206
|
"--provide-to-managed",
|
|
11187
11207
|
"let the organizations you manage use this connection as if it were their own \u2014 for a vendor key your agency pays for. Key-authenticated native integrations only, connected in a manager organization"
|
|
11188
11208
|
).option(
|
|
@@ -11207,6 +11227,9 @@ integrationsCmd.command("connect <app>").description("Connect an app \u2014 pass
|
|
|
11207
11227
|
const res = await new ErdoClient().connectIntegration({
|
|
11208
11228
|
app,
|
|
11209
11229
|
name: opts.name,
|
|
11230
|
+
mcp_url: opts.mcpUrl,
|
|
11231
|
+
mcp_headers: opts.mcpHeader.length ? parseMCPHeaders(opts.mcpHeader) : app === "mcp" && opts.rotate ? {} : void 0,
|
|
11232
|
+
member_access: opts.memberAccess,
|
|
11210
11233
|
credentials,
|
|
11211
11234
|
rotate_credentials: opts.rotate || void 0,
|
|
11212
11235
|
share_with_org: opts.share || void 0,
|