@agent-native/skills 0.0.0-beta-20260819155526

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 ADDED
@@ -0,0 +1,49 @@
1
+ # @agent-native/skills
2
+
3
+ Install BuilderIO skill folders into Codex and Claude skill directories.
4
+
5
+ ```bash
6
+ npx @agent-native/skills@latest add
7
+ npx @agent-native/skills@latest add --skill quick-recap --client codex --scope project --update-instructions
8
+ npx @agent-native/skills@latest add --skill visual-recap --client all --with-github-action
9
+ npx @agent-native/skills@latest add --skill visualize-repo --mode local-files
10
+ npx @agent-native/skills@latest add --skill visual-plan --mode local-files
11
+ npx @agent-native/skills@latest add --skill content --mode local-files --scope project
12
+ npx @agent-native/skills@latest update scaffold --project
13
+ ```
14
+
15
+ Use `--skill <name>` one or more times to select specific skills, or omit it in
16
+ an interactive terminal to choose from a prompt. The prompt puts `visual-plan`
17
+ `visual-recap`, and `visualize-repo` first and preselects those by default. Use
18
+ `--client codex`, `--client claude-code`, or `--client all` to choose install
19
+ targets; omitted `--client` defaults to all supported clients. For
20
+ `visual-plan`, `visual-recap`, `visualize-repo`, and `content`, use
21
+ `--mode hosted`, `--mode local-files`, or
22
+ `--mode self-hosted --mcp-url <url>` to choose hosted sharing, local-file
23
+ workflows, or your own app. Add `--update-instructions` to append an idempotent
24
+ managed block to `AGENTS.md` and/or `CLAUDE.md` for instruction-style skills.
25
+
26
+ On first run, `npx` itself may be quiet while it downloads the package before
27
+ this CLI can print anything. For unattended installs, pass explicit flags such
28
+ as `--skill`, `--client`, `--scope`, and `--no-connect` to skip prompts and
29
+ leave MCP authentication for a later `connect` command.
30
+
31
+ Skill content comes from `BuilderIO/skills@main` at install/list time for plain
32
+ skill installs. Explicit app-backed installs such as `visual-plan`,
33
+ `visual-recap`, `visualize-repo`, and `content` delegate to
34
+ `@agent-native/core` so mode selection, MCP registration, and local-files
35
+ instructions stay in one framework-owned flow.
36
+
37
+ Generated Agent Native apps and workspaces can refresh their framework-provided
38
+ `.agents/skills` from the latest installed CLI with:
39
+
40
+ ```bash
41
+ npm run skills:update
42
+ # or
43
+ npx @agent-native/core@latest skills update scaffold --project
44
+ ```
45
+
46
+ `AGENTS.md` and `.agents/skills` are the canonical files. The scaffold command
47
+ also repairs Claude compatibility links (`CLAUDE.md` and `.claude/skills`) when
48
+ the host filesystem supports them, with copy fallback where symlinks are
49
+ blocked.
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Canonical "built-in agent-native app -> MCP server" descriptor registry.
3
+ *
4
+ * This is a dependency-free mirror of the manifest data encoded in
5
+ * `@agent-native/core`'s `BUILT_IN_APP_SKILLS` object
6
+ * (`packages/core/src/cli/skills.ts`, around line 1711+). The standalone
7
+ * `@agent-native/skills` installer uses this to know which skill name maps to
8
+ * which hosted MCP server without importing the (much heavier) core CLI module.
9
+ *
10
+ * IMPORTANT: every URL / serverName / alias / authMode below MUST stay byte-for-byte
11
+ * identical to core's `BUILT_IN_APP_SKILLS`. The provenance of each value is noted
12
+ * inline as `packages/core/src/cli/skills.ts:<line>`. If core changes, update here too
13
+ * (a future sync guard test should compare the two).
14
+ */
15
+ /** Auth modes mirrored from core's `auth.mode` on each app-skill manifest. */
16
+ export type BuiltInAppAuthMode = "oauth" | "device" | "none";
17
+ /**
18
+ * Descriptor for a single built-in agent-native app and the hosted MCP server
19
+ * its skills connect to.
20
+ */
21
+ export interface BuiltInAppMcp {
22
+ /** Stable app id (matches the manifest `id` in core). */
23
+ appId: string;
24
+ /** Human-facing display name. */
25
+ displayName: string;
26
+ /** Skill names this app exports (a skill name resolves back to this app). */
27
+ skillNames: string[];
28
+ /** MCP server name used when registering the connector. */
29
+ serverName: string;
30
+ /** Hosted MCP endpoint URL (`hosted.mcpUrl`). */
31
+ mcpUrl: string;
32
+ /** Hosted app base URL (`hosted.url`). */
33
+ hostedUrl: string;
34
+ /** Alternate server names accepted for this app (`mcp.aliases`). */
35
+ aliases?: string[];
36
+ /** Auth mode for connecting the MCP server (`auth.mode`). */
37
+ authMode: BuiltInAppAuthMode;
38
+ /** True when the app ships only as a local command (no remote refresh). */
39
+ localOnly?: boolean;
40
+ /** True when the app provides a PR Visual Recap GitHub Action workflow. */
41
+ hasGithubAction?: boolean;
42
+ }
43
+ /**
44
+ * The built-in app -> MCP registry.
45
+ *
46
+ * Each entry's values are copied verbatim from core. Provenance per field is
47
+ * cited inline using the `packages/core/src/cli/skills.ts` line numbers.
48
+ */
49
+ export declare const BUILT_IN_APP_MCP: BuiltInAppMcp[];
50
+ /**
51
+ * Resolve the built-in app whose `skillNames` contains `skillName`
52
+ * (case-insensitive). Returns `undefined` when no built-in app exports it.
53
+ */
54
+ export declare function resolveAppForSkill(skillName: string): BuiltInAppMcp | undefined;
55
+ /**
56
+ * True when the given skill name maps to a built-in app with a hosted MCP
57
+ * server.
58
+ */
59
+ export declare function appHasMcp(skillName: string): boolean;
60
+ //# sourceMappingURL=built-in-apps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"built-in-apps.d.ts","sourceRoot":"","sources":["../src/built-in-apps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,8EAA8E;AAC9E,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,6DAA6D;IAC7D,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,2EAA2E;IAC3E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2EAA2E;IAC3E,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,aAAa,EA2E3C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,GAChB,aAAa,GAAG,SAAS,CAM3B;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEpD"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Canonical "built-in agent-native app -> MCP server" descriptor registry.
3
+ *
4
+ * This is a dependency-free mirror of the manifest data encoded in
5
+ * `@agent-native/core`'s `BUILT_IN_APP_SKILLS` object
6
+ * (`packages/core/src/cli/skills.ts`, around line 1711+). The standalone
7
+ * `@agent-native/skills` installer uses this to know which skill name maps to
8
+ * which hosted MCP server without importing the (much heavier) core CLI module.
9
+ *
10
+ * IMPORTANT: every URL / serverName / alias / authMode below MUST stay byte-for-byte
11
+ * identical to core's `BUILT_IN_APP_SKILLS`. The provenance of each value is noted
12
+ * inline as `packages/core/src/cli/skills.ts:<line>`. If core changes, update here too
13
+ * (a future sync guard test should compare the two).
14
+ */
15
+ /**
16
+ * The built-in app -> MCP registry.
17
+ *
18
+ * Each entry's values are copied verbatim from core. Provenance per field is
19
+ * cited inline using the `packages/core/src/cli/skills.ts` line numbers.
20
+ */
21
+ export const BUILT_IN_APP_MCP = [
22
+ {
23
+ // core skills.ts:1822 (id), :1823 (displayName)
24
+ appId: "visual-plans",
25
+ displayName: "Agent-Native Plan",
26
+ // core skills.ts:2867 (skillName "visual-plan") + extraSkills
27
+ skillNames: ["visual-plan", "visual-recap", "visualize-repo"],
28
+ // core skills.ts:1830 (mcp.serverName + mcp.aliases)
29
+ serverName: "plan",
30
+ aliases: ["agent-native-plans"],
31
+ // core skills.ts:1828 (hosted.mcpUrl)
32
+ mcpUrl: "https://plan.agent-native.com/mcp",
33
+ // core skills.ts:1827 (hosted.url)
34
+ hostedUrl: "https://plan.agent-native.com",
35
+ // core skills.ts:1832 (auth.mode)
36
+ authMode: "oauth",
37
+ // core skills.ts:3321-3322 (githubActionPath gated on knownTarget === "visual-plans")
38
+ hasGithubAction: true,
39
+ },
40
+ {
41
+ // core skills.ts:1716 (id), :1717 (displayName)
42
+ appId: "assets",
43
+ displayName: "Assets",
44
+ // core skills.ts:1713 (skillName)
45
+ skillNames: ["assets"],
46
+ // core skills.ts:1724 (mcp.serverName)
47
+ serverName: "agent-native-assets",
48
+ // core skills.ts:1722 (hosted.mcpUrl)
49
+ mcpUrl: "https://assets.agent-native.com/mcp",
50
+ // core skills.ts:1721 (hosted.url)
51
+ hostedUrl: "https://assets.agent-native.com",
52
+ // core skills.ts:1726 (auth.mode)
53
+ authMode: "oauth",
54
+ },
55
+ {
56
+ appId: "content",
57
+ displayName: "Content",
58
+ skillNames: ["content"],
59
+ serverName: "agent-native-content",
60
+ mcpUrl: "https://content.agent-native.com/mcp",
61
+ hostedUrl: "https://content.agent-native.com",
62
+ authMode: "oauth",
63
+ },
64
+ {
65
+ // core skills.ts:1762 (id), :1763 (displayName)
66
+ appId: "design",
67
+ displayName: "Design",
68
+ // core skills.ts:1759 (skillName) + Design extraSkills
69
+ skillNames: ["design-exploration", "visual-edit"],
70
+ // core skills.ts:1770 (mcp.serverName)
71
+ serverName: "agent-native-design",
72
+ // core skills.ts:1768 (hosted.mcpUrl)
73
+ mcpUrl: "https://design.agent-native.com/mcp",
74
+ // core skills.ts:1767 (hosted.url)
75
+ hostedUrl: "https://design.agent-native.com",
76
+ // core skills.ts:1772 (auth.mode)
77
+ authMode: "oauth",
78
+ },
79
+ {
80
+ // core skills.ts:1881 (id), :1882 (displayName)
81
+ appId: "context-xray",
82
+ displayName: "Context X-Ray",
83
+ // core skills.ts:1877 (skillName)
84
+ skillNames: ["context-xray"],
85
+ // core skills.ts:1889 (mcp.serverName)
86
+ serverName: "agent-native-context-xray",
87
+ // core skills.ts:1887 (hosted.mcpUrl)
88
+ mcpUrl: "https://context-xray.agent-native.com/mcp",
89
+ // core skills.ts:1886 (hosted.url)
90
+ hostedUrl: "https://context-xray.agent-native.com",
91
+ // core skills.ts:1890 (auth.mode)
92
+ authMode: "none",
93
+ // core skills.ts:1878 (localOnly: true)
94
+ localOnly: true,
95
+ },
96
+ ];
97
+ /**
98
+ * Resolve the built-in app whose `skillNames` contains `skillName`
99
+ * (case-insensitive). Returns `undefined` when no built-in app exports it.
100
+ */
101
+ export function resolveAppForSkill(skillName) {
102
+ const needle = skillName.trim().toLowerCase();
103
+ if (!needle)
104
+ return undefined;
105
+ return BUILT_IN_APP_MCP.find((app) => app.skillNames.some((name) => name.toLowerCase() === needle));
106
+ }
107
+ /**
108
+ * True when the given skill name maps to a built-in app with a hosted MCP
109
+ * server.
110
+ */
111
+ export function appHasMcp(skillName) {
112
+ return resolveAppForSkill(skillName) !== undefined;
113
+ }
114
+ //# sourceMappingURL=built-in-apps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"built-in-apps.js","sourceRoot":"","sources":["../src/built-in-apps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAgCH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAoB;IAC/C;QACE,gDAAgD;QAChD,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,mBAAmB;QAChC,8DAA8D;QAC9D,UAAU,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,gBAAgB,CAAC;QAC7D,qDAAqD;QACrD,UAAU,EAAE,MAAM;QAClB,OAAO,EAAE,CAAC,oBAAoB,CAAC;QAC/B,sCAAsC;QACtC,MAAM,EAAE,mCAAmC;QAC3C,mCAAmC;QACnC,SAAS,EAAE,+BAA+B;QAC1C,kCAAkC;QAClC,QAAQ,EAAE,OAAO;QACjB,sFAAsF;QACtF,eAAe,EAAE,IAAI;KACtB;IACD;QACE,gDAAgD;QAChD,KAAK,EA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IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CACnC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,CAC7D,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,SAAiB;IACzC,OAAO,kBAAkB,CAAC,SAAS,CAAC,KAAK,SAAS,CAAC;AACrD,CAAC","sourcesContent":["/**\n * Canonical \"built-in agent-native app -> MCP server\" descriptor registry.\n *\n * This is a dependency-free mirror of the manifest data encoded in\n * `@agent-native/core`'s `BUILT_IN_APP_SKILLS` object\n * (`packages/core/src/cli/skills.ts`, around line 1711+). The standalone\n * `@agent-native/skills` installer uses this to know which skill name maps to\n * which hosted MCP server without importing the (much heavier) core CLI module.\n *\n * IMPORTANT: every URL / serverName / alias / authMode below MUST stay byte-for-byte\n * identical to core's `BUILT_IN_APP_SKILLS`. The provenance of each value is noted\n * inline as `packages/core/src/cli/skills.ts:<line>`. If core changes, update here too\n * (a future sync guard test should compare the two).\n */\n\n/** Auth modes mirrored from core's `auth.mode` on each app-skill manifest. */\nexport type BuiltInAppAuthMode = \"oauth\" | \"device\" | \"none\";\n\n/**\n * Descriptor for a single built-in agent-native app and the hosted MCP server\n * its skills connect to.\n */\nexport interface BuiltInAppMcp {\n /** Stable app id (matches the manifest `id` in core). */\n appId: string;\n /** Human-facing display name. */\n displayName: string;\n /** Skill names this app exports (a skill name resolves back to this app). */\n skillNames: string[];\n /** MCP server name used when registering the connector. */\n serverName: string;\n /** Hosted MCP endpoint URL (`hosted.mcpUrl`). */\n mcpUrl: string;\n /** Hosted app base URL (`hosted.url`). */\n hostedUrl: string;\n /** Alternate server names accepted for this app (`mcp.aliases`). */\n aliases?: string[];\n /** Auth mode for connecting the MCP server (`auth.mode`). */\n authMode: BuiltInAppAuthMode;\n /** True when the app ships only as a local command (no remote refresh). */\n localOnly?: boolean;\n /** True when the app provides a PR Visual Recap GitHub Action workflow. */\n hasGithubAction?: boolean;\n}\n\n/**\n * The built-in app -> MCP registry.\n *\n * Each entry's values are copied verbatim from core. Provenance per field is\n * cited inline using the `packages/core/src/cli/skills.ts` line numbers.\n */\nexport const BUILT_IN_APP_MCP: BuiltInAppMcp[] = [\n {\n // core skills.ts:1822 (id), :1823 (displayName)\n appId: \"visual-plans\",\n displayName: \"Agent-Native Plan\",\n // core skills.ts:2867 (skillName \"visual-plan\") + extraSkills\n skillNames: [\"visual-plan\", \"visual-recap\", \"visualize-repo\"],\n // core skills.ts:1830 (mcp.serverName + mcp.aliases)\n serverName: \"plan\",\n aliases: [\"agent-native-plans\"],\n // core skills.ts:1828 (hosted.mcpUrl)\n mcpUrl: \"https://plan.agent-native.com/mcp\",\n // core skills.ts:1827 (hosted.url)\n hostedUrl: \"https://plan.agent-native.com\",\n // core skills.ts:1832 (auth.mode)\n authMode: \"oauth\",\n // core skills.ts:3321-3322 (githubActionPath gated on knownTarget === \"visual-plans\")\n hasGithubAction: true,\n },\n {\n // core skills.ts:1716 (id), :1717 (displayName)\n appId: \"assets\",\n displayName: \"Assets\",\n // core skills.ts:1713 (skillName)\n skillNames: [\"assets\"],\n // core skills.ts:1724 (mcp.serverName)\n serverName: \"agent-native-assets\",\n // core skills.ts:1722 (hosted.mcpUrl)\n mcpUrl: \"https://assets.agent-native.com/mcp\",\n // core skills.ts:1721 (hosted.url)\n hostedUrl: \"https://assets.agent-native.com\",\n // core skills.ts:1726 (auth.mode)\n authMode: \"oauth\",\n },\n {\n appId: \"content\",\n displayName: \"Content\",\n skillNames: [\"content\"],\n serverName: \"agent-native-content\",\n mcpUrl: \"https://content.agent-native.com/mcp\",\n hostedUrl: \"https://content.agent-native.com\",\n authMode: \"oauth\",\n },\n {\n // core skills.ts:1762 (id), :1763 (displayName)\n appId: \"design\",\n displayName: \"Design\",\n // core skills.ts:1759 (skillName) + Design extraSkills\n skillNames: [\"design-exploration\", \"visual-edit\"],\n // core skills.ts:1770 (mcp.serverName)\n serverName: \"agent-native-design\",\n // core skills.ts:1768 (hosted.mcpUrl)\n mcpUrl: \"https://design.agent-native.com/mcp\",\n // core skills.ts:1767 (hosted.url)\n hostedUrl: \"https://design.agent-native.com\",\n // core skills.ts:1772 (auth.mode)\n authMode: \"oauth\",\n },\n {\n // core skills.ts:1881 (id), :1882 (displayName)\n appId: \"context-xray\",\n displayName: \"Context X-Ray\",\n // core skills.ts:1877 (skillName)\n skillNames: [\"context-xray\"],\n // core skills.ts:1889 (mcp.serverName)\n serverName: \"agent-native-context-xray\",\n // core skills.ts:1887 (hosted.mcpUrl)\n mcpUrl: \"https://context-xray.agent-native.com/mcp\",\n // core skills.ts:1886 (hosted.url)\n hostedUrl: \"https://context-xray.agent-native.com\",\n // core skills.ts:1890 (auth.mode)\n authMode: \"none\",\n // core skills.ts:1878 (localOnly: true)\n localOnly: true,\n },\n];\n\n/**\n * Resolve the built-in app whose `skillNames` contains `skillName`\n * (case-insensitive). Returns `undefined` when no built-in app exports it.\n */\nexport function resolveAppForSkill(\n skillName: string,\n): BuiltInAppMcp | undefined {\n const needle = skillName.trim().toLowerCase();\n if (!needle) return undefined;\n return BUILT_IN_APP_MCP.find((app) =>\n app.skillNames.some((name) => name.toLowerCase() === needle),\n );\n}\n\n/**\n * True when the given skill name maps to a built-in app with a hosted MCP\n * server.\n */\nexport function appHasMcp(skillName: string): boolean {\n return resolveAppForSkill(skillName) !== undefined;\n}\n"]}
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import { runSkillsCli } from "./index.js";
3
+ runSkillsCli(process.argv.slice(2))
4
+ .then(() => {
5
+ process.exit(process.exitCode ?? 0);
6
+ })
7
+ .catch((error) => {
8
+ console.error(error instanceof Error ? error.message : String(error));
9
+ process.exit(1);
10
+ });
11
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KAChC,IAAI,CAAC,GAAG,EAAE;IACT,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC;AACtC,CAAC,CAAC;KACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACf,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport { runSkillsCli } from \"./index.js\";\n\nrunSkillsCli(process.argv.slice(2))\n .then(() => {\n process.exit(process.exitCode ?? 0);\n })\n .catch((error) => {\n console.error(error instanceof Error ? error.message : String(error));\n process.exit(1);\n });\n"]}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * MCP-server registration + authentication for `@agent-native/skills`.
3
+ *
4
+ * This is a dependency-free port of the MCP-config-writing + device-code/OAuth
5
+ * flow that lives in `@agent-native/core`'s `cli/connect.ts`. The skills package
6
+ * ships standalone (no `@agent-native/core` dependency), so this module
7
+ * re-implements just the registration surface against the shared on-disk
8
+ * writers in `./mcp-config-writers.js`. It writes the SAME config and speaks the
9
+ * SAME device-code/OAuth protocol as core.
10
+ *
11
+ * Two client families, exactly as in core:
12
+ * - OAuth-capable (Claude Code, Cursor, OpenCode, GitHub Copilot / VS Code):
13
+ * get a URL-only HTTP MCP entry (no bearer headers). The user authenticates
14
+ * in-host via standard remote MCP OAuth.
15
+ * - Device-code (codex, cowork): run the browser device-code flow against the
16
+ * descriptor's hosted URL, then write the entry WITH the minted bearer token
17
+ * + headers. Non-interactive (or no TTY) skips writing device-code configs,
18
+ * surfacing the exact `agent-native connect <url>` fallback command.
19
+ *
20
+ * Server contract (identical paths + JSON field names to core):
21
+ * POST <hostedUrl>/mcp/connect/device/start (no auth)
22
+ * body { client?, app? }
23
+ * → { device_code, user_code, verification_uri,
24
+ * verification_uri_complete, interval, expires_in }
25
+ * POST <hostedUrl>/mcp/connect/device/poll (no auth)
26
+ * body { device_code }
27
+ * → { status: "pending" }
28
+ * | { status: "approved", token, mcpUrl, serverName, mcpServerEntry }
29
+ * | { status: "expired" } | { status: "consumed" }
30
+ * | { status: "error" | "not_found", message? }
31
+ *
32
+ * Node-only. Node built-ins + global fetch only; no npm deps.
33
+ */
34
+ import { ClientId } from "./mcp-config-writers.js";
35
+ /**
36
+ * Describes one MCP server to register. `serverName` is the canonical config
37
+ * key; `aliases` are additional config keys that point at the same MCP URL
38
+ * (e.g. `plan` + `agent-native-plans`). `hostedUrl` is the deployed app origin
39
+ * the device-code flow authenticates against; `mcpUrl` is the resolved MCP
40
+ * endpoint written into the config (defaults to `<hostedUrl>/mcp`
41
+ * when only `hostedUrl` is supplied).
42
+ */
43
+ export interface McpDescriptor {
44
+ serverName: string;
45
+ mcpUrl: string;
46
+ aliases?: string[];
47
+ authMode?: "oauth" | "device" | "none";
48
+ hostedUrl?: string;
49
+ }
50
+ export interface RegisterMcpOptions {
51
+ descriptor: McpDescriptor;
52
+ clients: ClientId[];
53
+ scope: "user" | "project";
54
+ baseDir: string;
55
+ interactive: boolean;
56
+ log?: (m: string) => void;
57
+ deviceFlowTimeoutMs?: number;
58
+ deps?: {
59
+ fetchImpl?: typeof fetch;
60
+ now?: () => number;
61
+ sleep?: (ms: number) => Promise<void>;
62
+ };
63
+ }
64
+ export interface RegisterMcpResult {
65
+ written: {
66
+ client: ClientId;
67
+ file: string;
68
+ }[];
69
+ authenticated: boolean;
70
+ guidance: string[];
71
+ }
72
+ export declare function supportsRemoteMcpOAuth(client: ClientId): boolean;
73
+ /**
74
+ * Register an MCP server (plus aliases) into the requested client configs,
75
+ * authenticating device-code clients via the browser flow when interactive.
76
+ *
77
+ * Idempotent: re-running replaces the same named entries. Never throws on a
78
+ * single client/key failing — failures are collected into `guidance`.
79
+ */
80
+ export declare function registerMcpServer(opts: RegisterMcpOptions): Promise<RegisterMcpResult>;
81
+ //# sourceMappingURL=connect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,QAAQ,EAA2B,MAAM,yBAAyB,CAAC;AA8B5E;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,aAAa,CAAC;IAC1B,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,IAAI,CAAC,EAAE;QACL,SAAS,CA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