@guuey/config 0.1.0 → 0.1.2

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.
@@ -1,123 +0,0 @@
1
- /**
2
- * `mcpProxies` — Guuey hosted overlay shape for managed MCP relays.
3
- *
4
- * Relocated 2026-04-21 from `@ggui-ai/protocol/types/mcp-proxy.ts` as
5
- * part of the OSS split §8.2 classification fix. These types describe
6
- * a GUUEY HOSTING CONCEPT (a managed proxy that relays MCP calls with
7
- * upstream OAuth linking), not a vendor-neutral protocol shape, and
8
- * therefore belong in the closed `@guuey/config`
9
- * package alongside the rest of `guuey.json`.
10
- *
11
- * ## The classification decision
12
- *
13
- * `mcpProxies` is the declaration block a developer adds to
14
- * `guuey.json` to tell Guuey hosting: *"on behalf of this project,
15
- * relay these external MCP providers, using this OAuth linking
16
- * config, exposing these discovered servers."* That is
17
- * platform-layer plumbing — Guuey runs the relay, handles the
18
- * credential storage, dispatches the discovery — and it does not
19
- * describe anything an OSS-only `ggui` deployment emits or consumes.
20
- *
21
- * Per §8.2: the OSS `ggui` server does NOT read `guuey.json`.
22
- * Consumers that need overlay values (the closed `guuey` CLI,
23
- * Guuey-hosted Lambdas, the Guuey-internal control-plane UI) are
24
- * the only call sites allowed to import from this package. Open
25
- * packages that historically read `mcpProxies` (`@ggui-ai/server`'s
26
- * Claude-passthrough feature) retain their feature code but inline
27
- * the minimal structural shape they actually use — it stays a
28
- * Guuey-platform plumbing path, not a protocol contract.
29
- *
30
- * ## Scope of this module
31
- *
32
- * - {@link McpProxyLinkingConfig} — upstream OAuth config for
33
- * proxies that relay calls on behalf of an external account
34
- * (e.g. Claude.ai). Keys surface in the Guuey control plane's
35
- * credential-linking UI.
36
- * - {@link McpProxyConfig} — a single proxy's discovery + proxy
37
- * URL pattern + optional server filter + optional linking block.
38
- * - {@link McpProxiesConfig} — the top-level record keyed by
39
- * proxy id (`claude_ai`, `guuey`, future `omo`...). Exactly the
40
- * shape `guuey.json#mcpProxies` carries.
41
- *
42
- * ## Vendor-neutral constants stay in `@ggui-ai/protocol`
43
- *
44
- * Claude.ai-specific constants and discovery-response wire types
45
- * (`CLAUDE_AI_*`, `DiscoveredMcpServer`, `ClaudeAiDiscoveryResponse`)
46
- * remain in `@ggui-ai/protocol/types/mcp-proxy.ts` — those describe
47
- * Anthropic's public API, not Guuey-overlay config.
48
- *
49
- * ## Strictness
50
- *
51
- * Zod validation matches the rest of `guuey.json`: strict objects,
52
- * non-empty strings, URL validation on linking endpoints. Unknown
53
- * keys on nested objects fail parse (prevents silent drift toward
54
- * a "what else can we stuff into guuey.json" shape).
55
- */
56
- import { z } from 'zod';
57
- /**
58
- * OAuth linking config for proxies that relay on behalf of an
59
- * external account. Omit for proxies where Guuey session auth is
60
- * the only identity needed (e.g. a Guuey-native proxy).
61
- */
62
- declare const McpProxyLinkingSchema: z.ZodObject<{
63
- authUrl: z.ZodURL;
64
- tokenUrl: z.ZodURL;
65
- scopes: z.ZodArray<z.ZodString>;
66
- clientId: z.ZodOptional<z.ZodString>;
67
- manualRedirectUrl: z.ZodOptional<z.ZodURL>;
68
- }, z.core.$strict>;
69
- /**
70
- * Configuration for a single MCP proxy in `guuey.json#mcpProxies`.
71
- *
72
- * `discovery` + `proxy` are both URL-valued, but `proxy` is a URL
73
- * PATTERN (contains `{server_id}` which is substituted at call
74
- * time). Both are validated as URLs — `{server_id}` is accepted
75
- * by URL parsers as opaque path segment.
76
- */
77
- declare const McpProxyConfigSchema: z.ZodObject<{
78
- discovery: z.ZodURL;
79
- proxy: z.ZodURL;
80
- linking: z.ZodOptional<z.ZodObject<{
81
- authUrl: z.ZodURL;
82
- tokenUrl: z.ZodURL;
83
- scopes: z.ZodArray<z.ZodString>;
84
- clientId: z.ZodOptional<z.ZodString>;
85
- manualRedirectUrl: z.ZodOptional<z.ZodURL>;
86
- }, z.core.$strict>>;
87
- servers: z.ZodOptional<z.ZodArray<z.ZodString>>;
88
- }, z.core.$strict>;
89
- /**
90
- * The `mcpProxies` section of `guuey.json`. Keys are proxy
91
- * identifiers (`claude_ai`, `guuey`, future `omo`, …).
92
- *
93
- * Record shape intentionally — new proxy ids are additive; a fixed
94
- * literal union here would force a schema change every time a new
95
- * hosted-relay integration lands.
96
- */
97
- export declare const McpProxiesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
98
- discovery: z.ZodURL;
99
- proxy: z.ZodURL;
100
- linking: z.ZodOptional<z.ZodObject<{
101
- authUrl: z.ZodURL;
102
- tokenUrl: z.ZodURL;
103
- scopes: z.ZodArray<z.ZodString>;
104
- clientId: z.ZodOptional<z.ZodString>;
105
- manualRedirectUrl: z.ZodOptional<z.ZodURL>;
106
- }, z.core.$strict>>;
107
- servers: z.ZodOptional<z.ZodArray<z.ZodString>>;
108
- }, z.core.$strict>>;
109
- /** Linking block type derived from the zod schema. */
110
- export type McpProxyLinkingConfig = z.infer<typeof McpProxyLinkingSchema>;
111
- /** Single-proxy config type derived from the zod schema. */
112
- export type McpProxyConfig = z.infer<typeof McpProxyConfigSchema>;
113
- /** Full `mcpProxies` overlay type derived from the zod schema. */
114
- export type McpProxiesConfig = z.infer<typeof McpProxiesSchema>;
115
- /**
116
- * Parse a raw JSON value into a validated {@link McpProxiesConfig}.
117
- * Throws a `ZodError` on invalid input.
118
- */
119
- export declare function parseMcpProxies(raw: unknown): McpProxiesConfig;
120
- /** Safe-parse variant — see {@link parseMcpProxies}. */
121
- export declare function safeParseMcpProxies(raw: unknown): ReturnType<typeof McpProxiesSchema.safeParse>;
122
- export {};
123
- //# sourceMappingURL=mcp-proxy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-proxy.d.ts","sourceRoot":"","sources":["../src/mcp-proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,QAAA,MAAM,qBAAqB;;;;;;kBAuBzB,CAAC;AAEH;;;;;;;GAOG;AACH,QAAA,MAAM,oBAAoB;;;;;;;;;;;kBAmBxB,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;mBAG5B,CAAC;AAEF,sDAAsD;AACtD,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E,4DAA4D;AAC5D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,kEAAkE;AAClE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,CAE9D;AAED,wDAAwD;AACxD,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,OAAO,GACX,UAAU,CAAC,OAAO,gBAAgB,CAAC,SAAS,CAAC,CAE/C"}
package/dist/mcp-proxy.js DELETED
@@ -1,133 +0,0 @@
1
- /**
2
- * `mcpProxies` — Guuey hosted overlay shape for managed MCP relays.
3
- *
4
- * Relocated 2026-04-21 from `@ggui-ai/protocol/types/mcp-proxy.ts` as
5
- * part of the OSS split §8.2 classification fix. These types describe
6
- * a GUUEY HOSTING CONCEPT (a managed proxy that relays MCP calls with
7
- * upstream OAuth linking), not a vendor-neutral protocol shape, and
8
- * therefore belong in the closed `@guuey/config`
9
- * package alongside the rest of `guuey.json`.
10
- *
11
- * ## The classification decision
12
- *
13
- * `mcpProxies` is the declaration block a developer adds to
14
- * `guuey.json` to tell Guuey hosting: *"on behalf of this project,
15
- * relay these external MCP providers, using this OAuth linking
16
- * config, exposing these discovered servers."* That is
17
- * platform-layer plumbing — Guuey runs the relay, handles the
18
- * credential storage, dispatches the discovery — and it does not
19
- * describe anything an OSS-only `ggui` deployment emits or consumes.
20
- *
21
- * Per §8.2: the OSS `ggui` server does NOT read `guuey.json`.
22
- * Consumers that need overlay values (the closed `guuey` CLI,
23
- * Guuey-hosted Lambdas, the Guuey-internal control-plane UI) are
24
- * the only call sites allowed to import from this package. Open
25
- * packages that historically read `mcpProxies` (`@ggui-ai/server`'s
26
- * Claude-passthrough feature) retain their feature code but inline
27
- * the minimal structural shape they actually use — it stays a
28
- * Guuey-platform plumbing path, not a protocol contract.
29
- *
30
- * ## Scope of this module
31
- *
32
- * - {@link McpProxyLinkingConfig} — upstream OAuth config for
33
- * proxies that relay calls on behalf of an external account
34
- * (e.g. Claude.ai). Keys surface in the Guuey control plane's
35
- * credential-linking UI.
36
- * - {@link McpProxyConfig} — a single proxy's discovery + proxy
37
- * URL pattern + optional server filter + optional linking block.
38
- * - {@link McpProxiesConfig} — the top-level record keyed by
39
- * proxy id (`claude_ai`, `guuey`, future `omo`...). Exactly the
40
- * shape `guuey.json#mcpProxies` carries.
41
- *
42
- * ## Vendor-neutral constants stay in `@ggui-ai/protocol`
43
- *
44
- * Claude.ai-specific constants and discovery-response wire types
45
- * (`CLAUDE_AI_*`, `DiscoveredMcpServer`, `ClaudeAiDiscoveryResponse`)
46
- * remain in `@ggui-ai/protocol/types/mcp-proxy.ts` — those describe
47
- * Anthropic's public API, not Guuey-overlay config.
48
- *
49
- * ## Strictness
50
- *
51
- * Zod validation matches the rest of `guuey.json`: strict objects,
52
- * non-empty strings, URL validation on linking endpoints. Unknown
53
- * keys on nested objects fail parse (prevents silent drift toward
54
- * a "what else can we stuff into guuey.json" shape).
55
- */
56
- import { z } from 'zod';
57
- /**
58
- * OAuth linking config for proxies that relay on behalf of an
59
- * external account. Omit for proxies where Guuey session auth is
60
- * the only identity needed (e.g. a Guuey-native proxy).
61
- */
62
- const McpProxyLinkingSchema = z.strictObject({
63
- /** OAuth authorize endpoint. */
64
- authUrl: z.url(),
65
- /** OAuth token endpoint. */
66
- tokenUrl: z.url(),
67
- /**
68
- * OAuth scopes to request. Empty array means "use the upstream's
69
- * default scope set"; it does NOT mean "no scopes at all."
70
- */
71
- scopes: z.array(z.string().min(1)),
72
- /**
73
- * OAuth client_id to use. When omitted, the proxy uses a
74
- * well-known public client_id (e.g. Claude Code's registered
75
- * client for Claude.ai).
76
- */
77
- clientId: z.string().min(1).optional(),
78
- /**
79
- * Manual redirect URL for environments without a localhost
80
- * callback. The upstream AS redirects here and renders the
81
- * authorization code for the user to copy-paste. Used by
82
- * production web flows.
83
- */
84
- manualRedirectUrl: z.url().optional(),
85
- });
86
- /**
87
- * Configuration for a single MCP proxy in `guuey.json#mcpProxies`.
88
- *
89
- * `discovery` + `proxy` are both URL-valued, but `proxy` is a URL
90
- * PATTERN (contains `{server_id}` which is substituted at call
91
- * time). Both are validated as URLs — `{server_id}` is accepted
92
- * by URL parsers as opaque path segment.
93
- */
94
- const McpProxyConfigSchema = z.strictObject({
95
- /** Discovery URL — fetches available MCP servers for this proxy. */
96
- discovery: z.url(),
97
- /**
98
- * Proxy URL pattern — `{server_id}` is substituted with the
99
- * discovered server id at relay time. Validated as URL; the
100
- * placeholder survives URL parsing as an opaque path segment.
101
- */
102
- proxy: z.url(),
103
- /**
104
- * OAuth linking config for upstream account linking. Omit for
105
- * Guuey-native proxies where the session token is sufficient.
106
- */
107
- linking: McpProxyLinkingSchema.optional(),
108
- /**
109
- * Filter which discovered servers to expose, matched by display
110
- * name. When omitted, all discovered servers are exposed.
111
- */
112
- servers: z.array(z.string().min(1)).optional(),
113
- });
114
- /**
115
- * The `mcpProxies` section of `guuey.json`. Keys are proxy
116
- * identifiers (`claude_ai`, `guuey`, future `omo`, …).
117
- *
118
- * Record shape intentionally — new proxy ids are additive; a fixed
119
- * literal union here would force a schema change every time a new
120
- * hosted-relay integration lands.
121
- */
122
- export const McpProxiesSchema = z.record(z.string().min(1), McpProxyConfigSchema);
123
- /**
124
- * Parse a raw JSON value into a validated {@link McpProxiesConfig}.
125
- * Throws a `ZodError` on invalid input.
126
- */
127
- export function parseMcpProxies(raw) {
128
- return McpProxiesSchema.parse(raw);
129
- }
130
- /** Safe-parse variant — see {@link parseMcpProxies}. */
131
- export function safeParseMcpProxies(raw) {
132
- return McpProxiesSchema.safeParse(raw);
133
- }
@@ -1,173 +0,0 @@
1
- /**
2
- * `mcpServers` — Guuey hosted overlay shape for relayed MCP server
3
- * declarations.
4
- *
5
- * Relocated 2026-04-21 from `@ggui-ai/protocol/types/credential.ts`
6
- * as part of the OSS split §8.2 classification fix (mirror of the
7
- * 2026-04-21 `mcp-proxy` split). The `McpServerAuthConfig` type
8
- * previously lived in the open protocol package with a docstring
9
- * that said "Auth config in guuey.json mcpServers entries" — an
10
- * overlay-shape type in an open package, exactly the pattern the
11
- * mcp-proxy split closed.
12
- *
13
- * ## The classification decision
14
- *
15
- * `mcpServers` is the declaration block a developer adds to
16
- * `guuey.json` to tell Guuey hosting: *"for this project, relay
17
- * these HTTP MCP servers through the Guuey bridge, authenticating
18
- * each via the credential stored under this `serviceId`."* That is
19
- * platform-layer plumbing — the Guuey bridge registers the
20
- * declaration with the Guuey-hosted WebSocket gateway, and the
21
- * Guuey mcp-proxy Lambda resolves `auth.serviceId` against the
22
- * platform's UserCredential store. An OSS-only `ggui serve`
23
- * deployment has no analog for `auth.serviceId` because there is no
24
- * Guuey credential store.
25
- *
26
- * Per §8.2: the OSS `ggui` server does NOT read `guuey.json`.
27
- * Consumers that need this overlay value (the closed `guuey` CLI's
28
- * `guuey dev` command, the closed `@guuey/bridge` package, Guuey-
29
- * hosted Lambdas) are the only call sites allowed to import from
30
- * this package. Open packages that historically read
31
- * `McpServerAuthConfig` (`@ggui-ai/server`'s auth-relay code) now
32
- * inline the minimal structural shape they actually use.
33
- *
34
- * ## Scope of this module
35
- *
36
- * - {@link CredentialInjection} + {@link CredentialInjectionConfig}
37
- * — runtime injection-mode descriptors, used here as
38
- * `McpServerAuth.injection` and also exported from
39
- * `@ggui-ai/protocol/types/credential.ts` for cloud-side runtime
40
- * consumers. The overlap is intentional and minor (10 lines of
41
- * literal-union type) — duplicating inline keeps this private
42
- * package dep-minimal (zod-only). If the two ever drift, the
43
- * consolidation fix is to add `@ggui-ai/protocol` as a workspace
44
- * dep here; today the duplication is cheaper than that cross-
45
- * boundary edge.
46
- * - {@link McpServerAuthConfig} — auth block on a single
47
- * `mcpServers` entry. `serviceId` references the Guuey
48
- * credential store; `preInject` + `injection` tune how the relay
49
- * writes the placeholder.
50
- * - {@link McpServerEntryConfig} — a single mcpServers entry
51
- * (`{ url, auth? }`). `url` is the HTTP MCP server endpoint.
52
- * - {@link McpServersConfig} — the top-level record keyed by MCP
53
- * server name (`gmail`, `calendar`, future `slack`, …). Exactly
54
- * the shape `guuey.json#mcpServers` carries.
55
- *
56
- * ## Strictness
57
- *
58
- * Zod validation matches the rest of `guuey.json`: strict objects,
59
- * non-empty strings, URL validation on `url`. Unknown keys on
60
- * nested objects fail parse (prevents silent drift toward a "what
61
- * else can we stuff into guuey.json" shape).
62
- */
63
- import { z } from 'zod';
64
- /**
65
- * Injection mode — how the Guuey mcp-proxy splices the resolved
66
- * credential into the outbound HTTP request to the upstream MCP
67
- * server. Duplicated minor from
68
- * `@ggui-ai/protocol/types/credential.ts#CredentialInjection`; see
69
- * module docstring for the duplication rationale.
70
- */
71
- declare const CredentialInjectionSchema: z.ZodEnum<{
72
- bearer_header: "bearer_header";
73
- api_key_header: "api_key_header";
74
- query_param: "query_param";
75
- custom_header: "custom_header";
76
- }>;
77
- /** Full injection config — `mode` + per-mode tunables. */
78
- declare const CredentialInjectionConfigSchema: z.ZodObject<{
79
- mode: z.ZodEnum<{
80
- bearer_header: "bearer_header";
81
- api_key_header: "api_key_header";
82
- query_param: "query_param";
83
- custom_header: "custom_header";
84
- }>;
85
- headerName: z.ZodOptional<z.ZodString>;
86
- paramName: z.ZodOptional<z.ZodString>;
87
- }, z.core.$strict>;
88
- /**
89
- * Auth block on a single `mcpServers` entry. All fields are
90
- * optional at the block level — a server without `auth` is relayed
91
- * without credential injection (public MCP endpoint).
92
- */
93
- declare const McpServerAuthSchema: z.ZodObject<{
94
- serviceId: z.ZodString;
95
- preInject: z.ZodOptional<z.ZodBoolean>;
96
- injection: z.ZodOptional<z.ZodObject<{
97
- mode: z.ZodEnum<{
98
- bearer_header: "bearer_header";
99
- api_key_header: "api_key_header";
100
- query_param: "query_param";
101
- custom_header: "custom_header";
102
- }>;
103
- headerName: z.ZodOptional<z.ZodString>;
104
- paramName: z.ZodOptional<z.ZodString>;
105
- }, z.core.$strict>>;
106
- scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
107
- }, z.core.$strict>;
108
- /**
109
- * A single `mcpServers` entry. `url` is the HTTP MCP server
110
- * endpoint; `auth` scopes the credential injection.
111
- */
112
- declare const McpServerEntrySchema: z.ZodObject<{
113
- url: z.ZodURL;
114
- auth: z.ZodOptional<z.ZodObject<{
115
- serviceId: z.ZodString;
116
- preInject: z.ZodOptional<z.ZodBoolean>;
117
- injection: z.ZodOptional<z.ZodObject<{
118
- mode: z.ZodEnum<{
119
- bearer_header: "bearer_header";
120
- api_key_header: "api_key_header";
121
- query_param: "query_param";
122
- custom_header: "custom_header";
123
- }>;
124
- headerName: z.ZodOptional<z.ZodString>;
125
- paramName: z.ZodOptional<z.ZodString>;
126
- }, z.core.$strict>>;
127
- scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
128
- }, z.core.$strict>>;
129
- }, z.core.$strict>;
130
- /**
131
- * The `mcpServers` section of `guuey.json`. Keys are MCP server
132
- * display names (`gmail`, `calendar`, future `slack`, …) —
133
- * arbitrary strings, by design. New servers are additive; a fixed
134
- * literal union would force a schema change every time a new MCP
135
- * server integration lands.
136
- */
137
- export declare const McpServersSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
138
- url: z.ZodURL;
139
- auth: z.ZodOptional<z.ZodObject<{
140
- serviceId: z.ZodString;
141
- preInject: z.ZodOptional<z.ZodBoolean>;
142
- injection: z.ZodOptional<z.ZodObject<{
143
- mode: z.ZodEnum<{
144
- bearer_header: "bearer_header";
145
- api_key_header: "api_key_header";
146
- query_param: "query_param";
147
- custom_header: "custom_header";
148
- }>;
149
- headerName: z.ZodOptional<z.ZodString>;
150
- paramName: z.ZodOptional<z.ZodString>;
151
- }, z.core.$strict>>;
152
- scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
153
- }, z.core.$strict>>;
154
- }, z.core.$strict>>;
155
- /** Runtime injection-mode descriptor type. */
156
- export type CredentialInjection = z.infer<typeof CredentialInjectionSchema>;
157
- /** Injection-config block type. */
158
- export type CredentialInjectionConfig = z.infer<typeof CredentialInjectionConfigSchema>;
159
- /** Auth-block type on an `mcpServers` entry. */
160
- export type McpServerAuthConfig = z.infer<typeof McpServerAuthSchema>;
161
- /** Single-entry type inside the `mcpServers` record. */
162
- export type McpServerEntryConfig = z.infer<typeof McpServerEntrySchema>;
163
- /** Full `mcpServers` overlay type derived from the zod schema. */
164
- export type McpServersConfig = z.infer<typeof McpServersSchema>;
165
- /**
166
- * Parse a raw JSON value into a validated {@link McpServersConfig}.
167
- * Throws a `ZodError` on invalid input.
168
- */
169
- export declare function parseMcpServers(raw: unknown): McpServersConfig;
170
- /** Safe-parse variant — see {@link parseMcpServers}. */
171
- export declare function safeParseMcpServers(raw: unknown): ReturnType<typeof McpServersSchema.safeParse>;
172
- export {};
173
- //# sourceMappingURL=mcp-servers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-servers.d.ts","sourceRoot":"","sources":["../src/mcp-servers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AACH,QAAA,MAAM,yBAAyB;;;;;EAK7B,CAAC;AAEH,0DAA0D;AAC1D,QAAA,MAAM,+BAA+B;;;;;;;;;kBAMnC,CAAC;AAEH;;;;GAIG;AACH,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;kBA4BvB,CAAC;AAEH;;;GAGG;AACH,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;kBAKxB,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;mBAG5B,CAAC;AAEF,8CAA8C;AAC9C,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,mCAAmC;AACnC,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AAEF,gDAAgD;AAChD,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,wDAAwD;AACxD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,kEAAkE;AAClE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,CAE9D;AAED,wDAAwD;AACxD,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,OAAO,GACX,UAAU,CAAC,OAAO,gBAAgB,CAAC,SAAS,CAAC,CAE/C"}
@@ -1,147 +0,0 @@
1
- /**
2
- * `mcpServers` — Guuey hosted overlay shape for relayed MCP server
3
- * declarations.
4
- *
5
- * Relocated 2026-04-21 from `@ggui-ai/protocol/types/credential.ts`
6
- * as part of the OSS split §8.2 classification fix (mirror of the
7
- * 2026-04-21 `mcp-proxy` split). The `McpServerAuthConfig` type
8
- * previously lived in the open protocol package with a docstring
9
- * that said "Auth config in guuey.json mcpServers entries" — an
10
- * overlay-shape type in an open package, exactly the pattern the
11
- * mcp-proxy split closed.
12
- *
13
- * ## The classification decision
14
- *
15
- * `mcpServers` is the declaration block a developer adds to
16
- * `guuey.json` to tell Guuey hosting: *"for this project, relay
17
- * these HTTP MCP servers through the Guuey bridge, authenticating
18
- * each via the credential stored under this `serviceId`."* That is
19
- * platform-layer plumbing — the Guuey bridge registers the
20
- * declaration with the Guuey-hosted WebSocket gateway, and the
21
- * Guuey mcp-proxy Lambda resolves `auth.serviceId` against the
22
- * platform's UserCredential store. An OSS-only `ggui serve`
23
- * deployment has no analog for `auth.serviceId` because there is no
24
- * Guuey credential store.
25
- *
26
- * Per §8.2: the OSS `ggui` server does NOT read `guuey.json`.
27
- * Consumers that need this overlay value (the closed `guuey` CLI's
28
- * `guuey dev` command, the closed `@guuey/bridge` package, Guuey-
29
- * hosted Lambdas) are the only call sites allowed to import from
30
- * this package. Open packages that historically read
31
- * `McpServerAuthConfig` (`@ggui-ai/server`'s auth-relay code) now
32
- * inline the minimal structural shape they actually use.
33
- *
34
- * ## Scope of this module
35
- *
36
- * - {@link CredentialInjection} + {@link CredentialInjectionConfig}
37
- * — runtime injection-mode descriptors, used here as
38
- * `McpServerAuth.injection` and also exported from
39
- * `@ggui-ai/protocol/types/credential.ts` for cloud-side runtime
40
- * consumers. The overlap is intentional and minor (10 lines of
41
- * literal-union type) — duplicating inline keeps this private
42
- * package dep-minimal (zod-only). If the two ever drift, the
43
- * consolidation fix is to add `@ggui-ai/protocol` as a workspace
44
- * dep here; today the duplication is cheaper than that cross-
45
- * boundary edge.
46
- * - {@link McpServerAuthConfig} — auth block on a single
47
- * `mcpServers` entry. `serviceId` references the Guuey
48
- * credential store; `preInject` + `injection` tune how the relay
49
- * writes the placeholder.
50
- * - {@link McpServerEntryConfig} — a single mcpServers entry
51
- * (`{ url, auth? }`). `url` is the HTTP MCP server endpoint.
52
- * - {@link McpServersConfig} — the top-level record keyed by MCP
53
- * server name (`gmail`, `calendar`, future `slack`, …). Exactly
54
- * the shape `guuey.json#mcpServers` carries.
55
- *
56
- * ## Strictness
57
- *
58
- * Zod validation matches the rest of `guuey.json`: strict objects,
59
- * non-empty strings, URL validation on `url`. Unknown keys on
60
- * nested objects fail parse (prevents silent drift toward a "what
61
- * else can we stuff into guuey.json" shape).
62
- */
63
- import { z } from 'zod';
64
- /**
65
- * Injection mode — how the Guuey mcp-proxy splices the resolved
66
- * credential into the outbound HTTP request to the upstream MCP
67
- * server. Duplicated minor from
68
- * `@ggui-ai/protocol/types/credential.ts#CredentialInjection`; see
69
- * module docstring for the duplication rationale.
70
- */
71
- const CredentialInjectionSchema = z.enum([
72
- 'bearer_header',
73
- 'api_key_header',
74
- 'query_param',
75
- 'custom_header',
76
- ]);
77
- /** Full injection config — `mode` + per-mode tunables. */
78
- const CredentialInjectionConfigSchema = z.strictObject({
79
- mode: CredentialInjectionSchema,
80
- /** Header name for `api_key_header` / `custom_header`. Default: `X-API-Key`. */
81
- headerName: z.string().min(1).optional(),
82
- /** Query param name for `query_param`. Default: `api_key`. */
83
- paramName: z.string().min(1).optional(),
84
- });
85
- /**
86
- * Auth block on a single `mcpServers` entry. All fields are
87
- * optional at the block level — a server without `auth` is relayed
88
- * without credential injection (public MCP endpoint).
89
- */
90
- const McpServerAuthSchema = z.strictObject({
91
- /**
92
- * Service ID referenced against the Guuey platform's
93
- * UserCredential store. This is a Guuey-platform concept — an
94
- * OSS-only deployment has no equivalent lookup.
95
- */
96
- serviceId: z.string().min(1),
97
- /**
98
- * Pre-inject placeholder before the first upstream request
99
- * (skips the 401 → consent → retry dance for cases where the
100
- * user has already linked the credential). Default: `false`.
101
- */
102
- preInject: z.boolean().optional(),
103
- /**
104
- * Override the injection mode. Falls back to the
105
- * `McpServiceConfig` table entry keyed by `serviceId`, which
106
- * defaults to `bearer_header`.
107
- */
108
- injection: CredentialInjectionConfigSchema.optional(),
109
- /**
110
- * Optional OAuth scope hint forwarded to the hosted bridge at
111
- * connect time. The platform consumes this when minting tokens
112
- * against the upstream MCP server. Preserved here (2026-04-21)
113
- * for wire-compat with `@guuey/bridge`'s existing inline shape,
114
- * which flows `auth.scopes` through the bridge WebSocket config
115
- * message.
116
- */
117
- scopes: z.array(z.string().min(1)).optional(),
118
- });
119
- /**
120
- * A single `mcpServers` entry. `url` is the HTTP MCP server
121
- * endpoint; `auth` scopes the credential injection.
122
- */
123
- const McpServerEntrySchema = z.strictObject({
124
- /** HTTP MCP server endpoint. */
125
- url: z.url(),
126
- /** Optional auth block — omit for public endpoints. */
127
- auth: McpServerAuthSchema.optional(),
128
- });
129
- /**
130
- * The `mcpServers` section of `guuey.json`. Keys are MCP server
131
- * display names (`gmail`, `calendar`, future `slack`, …) —
132
- * arbitrary strings, by design. New servers are additive; a fixed
133
- * literal union would force a schema change every time a new MCP
134
- * server integration lands.
135
- */
136
- export const McpServersSchema = z.record(z.string().min(1), McpServerEntrySchema);
137
- /**
138
- * Parse a raw JSON value into a validated {@link McpServersConfig}.
139
- * Throws a `ZodError` on invalid input.
140
- */
141
- export function parseMcpServers(raw) {
142
- return McpServersSchema.parse(raw);
143
- }
144
- /** Safe-parse variant — see {@link parseMcpServers}. */
145
- export function safeParseMcpServers(raw) {
146
- return McpServersSchema.safeParse(raw);
147
- }