@paperclipai/shared 2026.1006.0-nightly.0 → 2026.1007.0-canary.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.
Files changed (76) hide show
  1. package/dist/.paperclip-build-complete +1 -1
  2. package/dist/agent-commentary.test.d.ts +2 -0
  3. package/dist/agent-commentary.test.d.ts.map +1 -0
  4. package/dist/agent-commentary.test.js +18 -0
  5. package/dist/agent-commentary.test.js.map +1 -0
  6. package/dist/ai-connection-router.d.ts +29 -20
  7. package/dist/ai-connection-router.d.ts.map +1 -1
  8. package/dist/ai-connections.d.ts +64 -5
  9. package/dist/ai-connections.d.ts.map +1 -1
  10. package/dist/ai-connections.js +23 -15
  11. package/dist/ai-connections.js.map +1 -1
  12. package/dist/ai-provider-routing.d.ts +42 -0
  13. package/dist/ai-provider-routing.d.ts.map +1 -0
  14. package/dist/ai-provider-routing.js +125 -0
  15. package/dist/ai-provider-routing.js.map +1 -0
  16. package/dist/app-definitions/anthropic.json +3 -0
  17. package/dist/app-definitions/bedrock.json +53 -0
  18. package/dist/app-definitions/chat-completions-api.json +53 -0
  19. package/dist/app-definitions/enterpret.json +92 -0
  20. package/dist/app-definitions/google.json +55 -0
  21. package/dist/app-definitions/local.json +53 -0
  22. package/dist/app-definitions/messages-api.json +53 -0
  23. package/dist/app-definitions/openai.json +3 -0
  24. package/dist/app-definitions/openrouter.json +3 -0
  25. package/dist/app-definitions/responses-api.json +53 -0
  26. package/dist/app-definitions/superagent.json +57 -0
  27. package/dist/app-definitions/telem.json +144 -0
  28. package/dist/app-definitions/xai.json +3 -0
  29. package/dist/app-definitions-url.test.js +10 -1
  30. package/dist/app-definitions-url.test.js.map +1 -1
  31. package/dist/app-definitions.d.ts.map +1 -1
  32. package/dist/app-definitions.generated.d.ts.map +1 -1
  33. package/dist/app-definitions.generated.js +70 -61
  34. package/dist/app-definitions.generated.js.map +1 -1
  35. package/dist/app-definitions.js +16 -8
  36. package/dist/app-definitions.js.map +1 -1
  37. package/dist/app-definitions.test.js +159 -8
  38. package/dist/app-definitions.test.js.map +1 -1
  39. package/dist/index.d.ts +3 -1
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +2 -0
  42. package/dist/index.js.map +1 -1
  43. package/dist/self-serve-mcp-research.json +3 -1
  44. package/dist/types/agent.d.ts +7 -0
  45. package/dist/types/agent.d.ts.map +1 -1
  46. package/dist/types/app-definition.d.ts +1 -0
  47. package/dist/types/app-definition.d.ts.map +1 -1
  48. package/dist/types/index.d.ts +1 -1
  49. package/dist/types/index.d.ts.map +1 -1
  50. package/dist/types/index.js.map +1 -1
  51. package/dist/types/tool-access.d.ts +14 -0
  52. package/dist/types/tool-access.d.ts.map +1 -1
  53. package/dist/types/tool-access.js.map +1 -1
  54. package/dist/validators/adapter-auth-session.d.ts +0 -2
  55. package/dist/validators/adapter-auth-session.d.ts.map +1 -1
  56. package/dist/validators/agent-commentary.d.ts +25 -0
  57. package/dist/validators/agent-commentary.d.ts.map +1 -0
  58. package/dist/validators/agent-commentary.js +12 -0
  59. package/dist/validators/agent-commentary.js.map +1 -0
  60. package/dist/validators/agent.d.ts +15 -0
  61. package/dist/validators/agent.d.ts.map +1 -1
  62. package/dist/validators/app-definition.d.ts +80 -0
  63. package/dist/validators/app-definition.d.ts.map +1 -1
  64. package/dist/validators/app-definition.js +1 -1
  65. package/dist/validators/app-definition.js.map +1 -1
  66. package/dist/validators/claude-setup-token-session.d.ts +0 -2
  67. package/dist/validators/claude-setup-token-session.d.ts.map +1 -1
  68. package/dist/validators/index.d.ts +1 -0
  69. package/dist/validators/index.d.ts.map +1 -1
  70. package/dist/validators/index.js +1 -0
  71. package/dist/validators/index.js.map +1 -1
  72. package/dist/validators/tool-access.d.ts +6 -0
  73. package/dist/validators/tool-access.d.ts.map +1 -1
  74. package/dist/validators/tool-access.js +3 -0
  75. package/dist/validators/tool-access.js.map +1 -1
  76. package/package.json +1 -1
@@ -1 +1 @@
1
- {"sources":"dc3d902034d6dde67f86faffdb2a6b59fd41f1ddc0f0acd842d64016b2103cab","outputs":"37403f3ca6beb29e075a206c38742e479bc5997c14832b4920d0e00afb5310f6"}
1
+ {"sources":"2aebb6fbce1efeaef5c3fa90c8453713d6bf39559c8fe1aa55875cb6aa3ae42e","outputs":"f5c5a23bba6d58c16c0ac8fe78d9c0734c9999898ec0129c9dfd1548fe5e028e"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=agent-commentary.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-commentary.test.d.ts","sourceRoot":"","sources":["../src/agent-commentary.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { AGENT_COMMENTARY_MAX_LENGTH, submitAgentCommentarySchema } from "./validators/agent-commentary.js";
3
+ describe("agent commentary input", () => {
4
+ const input = { kind: "complaint", body: "WHY 😭\n\nThis tool again.", idempotencyKey: "one" };
5
+ it("preserves free-form text and the document-sized ceiling", () => {
6
+ expect(submitAgentCommentarySchema.parse(input)).toEqual(input);
7
+ const body = "🙂".repeat(AGENT_COMMENTARY_MAX_LENGTH / 2);
8
+ expect(submitAgentCommentarySchema.parse({ ...input, kind: "suggestion", body }).body).toBe(body);
9
+ expect(submitAgentCommentarySchema.safeParse({ ...input, body: body + "x" }).success).toBe(false);
10
+ });
11
+ it.each([
12
+ { body: " \n\t" }, { kind: "other" }, { idempotencyKey: "" }, { idempotencyKey: "x".repeat(241) },
13
+ { agentId: "spoof" }, { companyId: "spoof" }, { runId: "spoof" }, { issueId: "spoof" }, { category: "tooling" },
14
+ ])("rejects invalid or caller-owned fields: %j", (change) => {
15
+ expect(submitAgentCommentarySchema.safeParse({ ...input, ...change }).success).toBe(false);
16
+ });
17
+ });
18
+ //# sourceMappingURL=agent-commentary.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-commentary.test.js","sourceRoot":"","sources":["../src/agent-commentary.test.ts"],"names":[],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E,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE;KAChH,CAAC,CAAC,4CAA4C,EAAE,CAAC,MAAM,EAAE,EAAE;QAC1D,MAAM,CAAC,2BAA2B,CAAC,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -8,6 +8,7 @@ export declare const aiConnectionRouterBindingSchema: z.ZodObject<{
8
8
  export declare const aiRuntimeConnectionBindingSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
9
9
  provider: z.ZodEnum<{
10
10
  anthropic: "anthropic";
11
+ google: "google";
11
12
  openai: "openai";
12
13
  openrouter: "openrouter";
13
14
  xai: "xai";
@@ -20,6 +21,7 @@ export declare const aiRuntimeConnectionBindingSchema: z.ZodUnion<readonly [z.Zo
20
21
  }, z.core.$strict>, z.ZodObject<{
21
22
  provider: z.ZodEnum<{
22
23
  anthropic: "anthropic";
24
+ google: "google";
23
25
  openai: "openai";
24
26
  openrouter: "openrouter";
25
27
  xai: "xai";
@@ -34,6 +36,7 @@ export declare const aiRuntimeConnectionBindingSchema: z.ZodUnion<readonly [z.Zo
34
36
  }, z.core.$strict>, z.ZodObject<{
35
37
  provider: z.ZodEnum<{
36
38
  anthropic: "anthropic";
39
+ google: "google";
37
40
  openai: "openai";
38
41
  openrouter: "openrouter";
39
42
  xai: "xai";
@@ -55,6 +58,7 @@ export declare const aiConnectionPoolMemberSchema: z.ZodObject<{
55
58
  binding: z.ZodDiscriminatedUnion<[z.ZodObject<{
56
59
  provider: z.ZodEnum<{
57
60
  anthropic: "anthropic";
61
+ google: "google";
58
62
  openai: "openai";
59
63
  openrouter: "openrouter";
60
64
  xai: "xai";
@@ -67,6 +71,7 @@ export declare const aiConnectionPoolMemberSchema: z.ZodObject<{
67
71
  }, z.core.$strict>, z.ZodObject<{
68
72
  provider: z.ZodEnum<{
69
73
  anthropic: "anthropic";
74
+ google: "google";
70
75
  openai: "openai";
71
76
  openrouter: "openrouter";
72
77
  xai: "xai";
@@ -81,6 +86,7 @@ export declare const aiConnectionPoolMemberSchema: z.ZodObject<{
81
86
  }, z.core.$strict>, z.ZodObject<{
82
87
  provider: z.ZodEnum<{
83
88
  anthropic: "anthropic";
89
+ google: "google";
84
90
  openai: "openai";
85
91
  openrouter: "openrouter";
86
92
  xai: "xai";
@@ -93,57 +99,57 @@ export declare const aiConnectionPoolMemberSchema: z.ZodObject<{
93
99
  connectionId: z.ZodString;
94
100
  grantId: z.ZodString;
95
101
  }, z.core.$strict>], "mode"> & z.ZodType<{
96
- provider: "anthropic" | "openai" | "openrouter" | "xai";
102
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
97
103
  method: "api_key" | "subscription";
98
104
  mode: "shared";
99
105
  connectionId: string;
100
106
  grantId: string;
101
107
  } | {
102
- provider: "anthropic" | "openai" | "openrouter" | "xai";
108
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
103
109
  method: "api_key" | "subscription";
104
110
  mode: "delegated";
105
111
  connectionId: string;
106
112
  grantId: string;
107
113
  }, {
108
- provider: "anthropic" | "openai" | "openrouter" | "xai";
114
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
109
115
  method: "api_key" | "subscription";
110
116
  mode: "responsible_user";
111
117
  } | {
112
- provider: "anthropic" | "openai" | "openrouter" | "xai";
118
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
113
119
  method: "api_key" | "subscription";
114
120
  mode: "shared";
115
121
  connectionId: string;
116
122
  grantId: string;
117
123
  } | {
118
- provider: "anthropic" | "openai" | "openrouter" | "xai";
124
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
119
125
  method: "api_key" | "subscription";
120
126
  mode: "delegated";
121
127
  connectionId: string;
122
128
  grantId: string;
123
129
  }, z.core.$ZodTypeInternals<{
124
- provider: "anthropic" | "openai" | "openrouter" | "xai";
130
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
125
131
  method: "api_key" | "subscription";
126
132
  mode: "shared";
127
133
  connectionId: string;
128
134
  grantId: string;
129
135
  } | {
130
- provider: "anthropic" | "openai" | "openrouter" | "xai";
136
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
131
137
  method: "api_key" | "subscription";
132
138
  mode: "delegated";
133
139
  connectionId: string;
134
140
  grantId: string;
135
141
  }, {
136
- provider: "anthropic" | "openai" | "openrouter" | "xai";
142
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
137
143
  method: "api_key" | "subscription";
138
144
  mode: "responsible_user";
139
145
  } | {
140
- provider: "anthropic" | "openai" | "openrouter" | "xai";
146
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
141
147
  method: "api_key" | "subscription";
142
148
  mode: "shared";
143
149
  connectionId: string;
144
150
  grantId: string;
145
151
  } | {
146
- provider: "anthropic" | "openai" | "openrouter" | "xai";
152
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
147
153
  method: "api_key" | "subscription";
148
154
  mode: "delegated";
149
155
  connectionId: string;
@@ -176,6 +182,7 @@ export declare const aiConnectionPoolConfigSchema: z.ZodObject<{
176
182
  binding: z.ZodDiscriminatedUnion<[z.ZodObject<{
177
183
  provider: z.ZodEnum<{
178
184
  anthropic: "anthropic";
185
+ google: "google";
179
186
  openai: "openai";
180
187
  openrouter: "openrouter";
181
188
  xai: "xai";
@@ -188,6 +195,7 @@ export declare const aiConnectionPoolConfigSchema: z.ZodObject<{
188
195
  }, z.core.$strict>, z.ZodObject<{
189
196
  provider: z.ZodEnum<{
190
197
  anthropic: "anthropic";
198
+ google: "google";
191
199
  openai: "openai";
192
200
  openrouter: "openrouter";
193
201
  xai: "xai";
@@ -202,6 +210,7 @@ export declare const aiConnectionPoolConfigSchema: z.ZodObject<{
202
210
  }, z.core.$strict>, z.ZodObject<{
203
211
  provider: z.ZodEnum<{
204
212
  anthropic: "anthropic";
213
+ google: "google";
205
214
  openai: "openai";
206
215
  openrouter: "openrouter";
207
216
  xai: "xai";
@@ -214,57 +223,57 @@ export declare const aiConnectionPoolConfigSchema: z.ZodObject<{
214
223
  connectionId: z.ZodString;
215
224
  grantId: z.ZodString;
216
225
  }, z.core.$strict>], "mode"> & z.ZodType<{
217
- provider: "anthropic" | "openai" | "openrouter" | "xai";
226
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
218
227
  method: "api_key" | "subscription";
219
228
  mode: "shared";
220
229
  connectionId: string;
221
230
  grantId: string;
222
231
  } | {
223
- provider: "anthropic" | "openai" | "openrouter" | "xai";
232
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
224
233
  method: "api_key" | "subscription";
225
234
  mode: "delegated";
226
235
  connectionId: string;
227
236
  grantId: string;
228
237
  }, {
229
- provider: "anthropic" | "openai" | "openrouter" | "xai";
238
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
230
239
  method: "api_key" | "subscription";
231
240
  mode: "responsible_user";
232
241
  } | {
233
- provider: "anthropic" | "openai" | "openrouter" | "xai";
242
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
234
243
  method: "api_key" | "subscription";
235
244
  mode: "shared";
236
245
  connectionId: string;
237
246
  grantId: string;
238
247
  } | {
239
- provider: "anthropic" | "openai" | "openrouter" | "xai";
248
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
240
249
  method: "api_key" | "subscription";
241
250
  mode: "delegated";
242
251
  connectionId: string;
243
252
  grantId: string;
244
253
  }, z.core.$ZodTypeInternals<{
245
- provider: "anthropic" | "openai" | "openrouter" | "xai";
254
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
246
255
  method: "api_key" | "subscription";
247
256
  mode: "shared";
248
257
  connectionId: string;
249
258
  grantId: string;
250
259
  } | {
251
- provider: "anthropic" | "openai" | "openrouter" | "xai";
260
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
252
261
  method: "api_key" | "subscription";
253
262
  mode: "delegated";
254
263
  connectionId: string;
255
264
  grantId: string;
256
265
  }, {
257
- provider: "anthropic" | "openai" | "openrouter" | "xai";
266
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
258
267
  method: "api_key" | "subscription";
259
268
  mode: "responsible_user";
260
269
  } | {
261
- provider: "anthropic" | "openai" | "openrouter" | "xai";
270
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
262
271
  method: "api_key" | "subscription";
263
272
  mode: "shared";
264
273
  connectionId: string;
265
274
  grantId: string;
266
275
  } | {
267
- provider: "anthropic" | "openai" | "openrouter" | "xai";
276
+ provider: "anthropic" | "google" | "openai" | "openrouter" | "xai";
268
277
  method: "api_key" | "subscription";
269
278
  mode: "delegated";
270
279
  connectionId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ai-connection-router.d.ts","sourceRoot":"","sources":["../src/ai-connection-router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAA6B,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,+BAA+B;;;kBAGjC,CAAC;AACZ,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAwE,CAAC;AACtH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAS9B,CAAC;AACZ,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;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SAAS,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,EAAE,YAAY,GAA0B;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,2BAA2B,EAAE,aAAa,CAOtP;AAED,wBAAgB,2BAA2B,CAAC,UAAU,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAAE,GAAG,MAAM,GAAG,IAAI,CAGlH"}
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { type AiProviderRouting } from "./ai-provider-routing.js";
2
3
  /** Runtime authentication is a separate transport, never a tool or channel. */
3
4
  export declare const connectionPurposeTransportSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
5
  connectionPurpose: z.ZodLiteral<"tool">;
@@ -21,9 +22,10 @@ export declare const connectionPurposeTransportSchema: z.ZodDiscriminatedUnion<[
21
22
  transport: z.ZodLiteral<"runtime_auth">;
22
23
  }, z.core.$strip>], "connectionPurpose">;
23
24
  export type ConnectionPurposeTransport = z.infer<typeof connectionPurposeTransportSchema>;
24
- export declare const AI_PROVIDERS: readonly ["anthropic", "openai", "openrouter", "xai"];
25
+ export declare const AI_PROVIDERS: readonly ["anthropic", "openai", "openrouter", "xai", "google"];
25
26
  export declare const aiProviderSchema: z.ZodEnum<{
26
27
  anthropic: "anthropic";
28
+ google: "google";
27
29
  openai: "openai";
28
30
  openrouter: "openrouter";
29
31
  xai: "xai";
@@ -37,6 +39,7 @@ export type AiAuthMethod = z.infer<typeof aiAuthMethodSchema>;
37
39
  export declare const aiConnectionBindingSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
38
40
  provider: z.ZodEnum<{
39
41
  anthropic: "anthropic";
42
+ google: "google";
40
43
  openai: "openai";
41
44
  openrouter: "openrouter";
42
45
  xai: "xai";
@@ -49,6 +52,7 @@ export declare const aiConnectionBindingSchema: z.ZodDiscriminatedUnion<[z.ZodOb
49
52
  }, z.core.$strict>, z.ZodObject<{
50
53
  provider: z.ZodEnum<{
51
54
  anthropic: "anthropic";
55
+ google: "google";
52
56
  openai: "openai";
53
57
  openrouter: "openrouter";
54
58
  xai: "xai";
@@ -63,6 +67,7 @@ export declare const aiConnectionBindingSchema: z.ZodDiscriminatedUnion<[z.ZodOb
63
67
  }, z.core.$strict>, z.ZodObject<{
64
68
  provider: z.ZodEnum<{
65
69
  anthropic: "anthropic";
70
+ google: "google";
66
71
  openai: "openai";
67
72
  openrouter: "openrouter";
68
73
  xai: "xai";
@@ -79,6 +84,7 @@ export type AiConnectionBinding = z.infer<typeof aiConnectionBindingSchema>;
79
84
  export declare const aiConnectionMetadataSchema: z.ZodObject<{
80
85
  provider: z.ZodEnum<{
81
86
  anthropic: "anthropic";
87
+ google: "google";
82
88
  openai: "openai";
83
89
  openrouter: "openrouter";
84
90
  xai: "xai";
@@ -87,6 +93,31 @@ export declare const aiConnectionMetadataSchema: z.ZodObject<{
87
93
  api_key: "api_key";
88
94
  subscription: "subscription";
89
95
  }>;
96
+ routing: z.ZodOptional<z.ZodObject<{
97
+ kind: z.ZodEnum<{
98
+ bedrock: "bedrock";
99
+ gateway: "gateway";
100
+ local: "local";
101
+ openrouter: "openrouter";
102
+ }>;
103
+ protocol: z.ZodEnum<{
104
+ bedrock: "bedrock";
105
+ chat: "chat";
106
+ messages: "messages";
107
+ responses: "responses";
108
+ }>;
109
+ baseUrl: z.ZodOptional<z.ZodString>;
110
+ auth: z.ZodDefault<z.ZodEnum<{
111
+ api_key: "api_key";
112
+ bearer: "bearer";
113
+ none: "none";
114
+ }>>;
115
+ region: z.ZodOptional<z.ZodString>;
116
+ models: z.ZodDefault<z.ZodArray<z.ZodObject<{
117
+ id: z.ZodString;
118
+ label: z.ZodOptional<z.ZodString>;
119
+ }, z.core.$strict>>>;
120
+ }, z.core.$strict>>;
90
121
  }, z.core.$strict>;
91
122
  export type AiConnectionMetadata = z.infer<typeof aiConnectionMetadataSchema>;
92
123
  /** Existing integrations only. This table describes compatibility, never routing. */
@@ -122,6 +153,7 @@ export interface AiManagedConnectionSummary {
122
153
  provider: AiProvider;
123
154
  method: AiAuthMethod;
124
155
  name: string;
156
+ routing?: AiProviderRouting;
125
157
  accountLabel?: string;
126
158
  ownership: "personal" | "shared";
127
159
  ownerUserId?: string;
@@ -140,6 +172,7 @@ export interface AiConnectionList {
140
172
  export declare const createAiConnectionSchema: z.ZodObject<{
141
173
  provider: z.ZodEnum<{
142
174
  anthropic: "anthropic";
175
+ google: "google";
143
176
  openai: "openai";
144
177
  openrouter: "openrouter";
145
178
  xai: "xai";
@@ -153,6 +186,31 @@ export declare const createAiConnectionSchema: z.ZodObject<{
153
186
  personal: "personal";
154
187
  shared: "shared";
155
188
  }>;
189
+ routing: z.ZodOptional<z.ZodObject<{
190
+ kind: z.ZodEnum<{
191
+ bedrock: "bedrock";
192
+ gateway: "gateway";
193
+ local: "local";
194
+ openrouter: "openrouter";
195
+ }>;
196
+ protocol: z.ZodEnum<{
197
+ bedrock: "bedrock";
198
+ chat: "chat";
199
+ messages: "messages";
200
+ responses: "responses";
201
+ }>;
202
+ baseUrl: z.ZodOptional<z.ZodString>;
203
+ auth: z.ZodDefault<z.ZodEnum<{
204
+ api_key: "api_key";
205
+ bearer: "bearer";
206
+ none: "none";
207
+ }>>;
208
+ region: z.ZodOptional<z.ZodString>;
209
+ models: z.ZodDefault<z.ZodArray<z.ZodObject<{
210
+ id: z.ZodString;
211
+ label: z.ZodOptional<z.ZodString>;
212
+ }, z.core.$strict>>>;
213
+ }, z.core.$strict>>;
156
214
  apiKey: z.ZodOptional<z.ZodString>;
157
215
  loginSessionId: z.ZodOptional<z.ZodString>;
158
216
  connectionId: z.ZodOptional<z.ZodString>;
@@ -164,7 +222,6 @@ export declare const aiConnectionLoginIntentSchema: z.ZodObject<{
164
222
  provider: z.ZodEnum<{
165
223
  anthropic: "anthropic";
166
224
  openai: "openai";
167
- openrouter: "openrouter";
168
225
  xai: "xai";
169
226
  }>;
170
227
  method: z.ZodLiteral<"subscription">;
@@ -182,7 +239,6 @@ export declare const localAiConnectionSchema: z.ZodObject<{
182
239
  provider: z.ZodEnum<{
183
240
  anthropic: "anthropic";
184
241
  openai: "openai";
185
- openrouter: "openrouter";
186
242
  xai: "xai";
187
243
  }>;
188
244
  method: z.ZodLiteral<"subscription">;
@@ -200,7 +256,6 @@ export declare const localAiLoginStartSchema: z.ZodObject<{
200
256
  provider: z.ZodEnum<{
201
257
  anthropic: "anthropic";
202
258
  openai: "openai";
203
- openrouter: "openrouter";
204
259
  xai: "xai";
205
260
  }>;
206
261
  method: z.ZodLiteral<"subscription">;
@@ -216,10 +271,14 @@ export declare const localAiLoginStartSchema: z.ZodObject<{
216
271
  }, z.core.$strict>;
217
272
  export interface LocalAiLoginStatus {
218
273
  status: "ready" | "sign_in_required" | "expired";
274
+ authorizationUrl?: string;
275
+ code?: string;
276
+ error?: string;
219
277
  }
220
278
  export interface LocalAiLoginAttempt {
221
279
  sessionId: string;
222
- command: string;
280
+ /** Grok still uses terminal sign-in until it has an in-app login runner. */
281
+ command?: string;
223
282
  expiresAt: string;
224
283
  }
225
284
  /** Preview-era copies of rotating local credentials must be reconnected. */
@@ -1 +1 @@
1
- {"version":3,"file":"ai-connections.d.ts","sourceRoot":"","sources":["../src/ai-connections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,+EAA+E;AAC/E,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;wCAoB5C,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,gCAAgC,CACxC,CAAC;AAEF,eAAO,MAAM,YAAY,YACvB,WAAW,EACX,QAAQ,EAC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CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;kBAU/B,CAAC;AACZ,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;kBAElC,CAAC;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;kBAA4E,CAAC;AACjH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAAC;IACjD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,4EAA4E;AAC5E,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,OAAO,CAKrG"}
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { aiProviderRoutingSchema, aiRoutingHarness, isAiRoutingCompatible } from "./ai-provider-routing.js";
2
3
  /** Runtime authentication is a separate transport, never a tool or channel. */
3
4
  export const connectionPurposeTransportSchema = z.discriminatedUnion("connectionPurpose", [
4
5
  z.object({
@@ -20,6 +21,7 @@ export const AI_PROVIDERS = [
20
21
  "openai",
21
22
  "openrouter",
22
23
  "xai",
24
+ "google",
23
25
  ];
24
26
  export const aiProviderSchema = z.enum(AI_PROVIDERS);
25
27
  export const aiAuthMethodSchema = z.enum(["subscription", "api_key"]);
@@ -43,16 +45,17 @@ export const aiConnectionBindingSchema = z.discriminatedUnion("mode", [
43
45
  z
44
46
  .object({
45
47
  ...requirement,
46
- // Legacy wire format only; human access still applies. New UI never creates it.
48
+ // Explicit personal selection. Human access still applies on every run.
47
49
  mode: z.literal("delegated"),
48
50
  connectionId: z.string().uuid(),
49
51
  grantId: z.string().uuid(),
50
52
  })
51
53
  .strict(),
52
54
  ]);
53
- export const aiConnectionMetadataSchema = z.object(requirement).strict();
55
+ export const aiConnectionMetadataSchema = z.object({ ...requirement, routing: aiProviderRoutingSchema.optional() }).strict();
54
56
  /** Existing integrations only. This table describes compatibility, never routing. */
55
57
  export const AI_CONNECTION_CAPABILITIES = {
58
+ google: { name: "Google", methods: { api_key: { adapters: ["gemini_local"], envKey: "GEMINI_API_KEY" } } },
56
59
  anthropic: {
57
60
  name: "Claude",
58
61
  methods: {
@@ -85,18 +88,13 @@ export const AI_CONNECTION_CAPABILITIES = {
85
88
  },
86
89
  };
87
90
  export function isAiConnectionCompatible(requirement, adapterType, model, runnerProvider, acpxAgent) {
88
- if (adapterType === "paperclip_runner")
89
- adapterType =
90
- runnerProvider === "claude" ||
91
- (runnerProvider === "acpx" && acpxAgent === "claude")
92
- ? "claude_local"
93
- : runnerProvider === "acpx" && acpxAgent === "grok"
94
- ? "grok_local"
95
- : runnerProvider === "codex"
96
- ? "codex_local"
97
- : runnerProvider === "opencode"
98
- ? "opencode_local"
99
- : "unsupported";
91
+ adapterType = aiRoutingHarness(adapterType, runnerProvider, acpxAgent);
92
+ if ("routing" in requirement && requirement.routing)
93
+ return requirement.method === "api_key" && isAiRoutingCompatible(requirement.routing, adapterType);
94
+ // A fixed binding contains identity only. The service checks authoritative
95
+ // connection metadata before resolving credentials or running the harness.
96
+ if ("mode" in requirement && requirement.mode !== "responsible_user" && requirement.method === "api_key")
97
+ return ["claude_local", "codex_local", "opencode_local", "hermes_local", "gemini_local", "grok_local"].includes(adapterType);
100
98
  const methods = AI_CONNECTION_CAPABILITIES[requirement.provider].methods;
101
99
  const candidates = "mode" in requirement && requirement.mode === "responsible_user"
102
100
  ? Object.values(methods)
@@ -110,6 +108,7 @@ export const createAiConnectionSchema = z
110
108
  ...requirement,
111
109
  name: z.string().trim().min(1).max(160),
112
110
  ownership: z.enum(["personal", "shared"]),
111
+ routing: aiProviderRoutingSchema.optional(),
113
112
  apiKey: z.string().trim().min(1).max(32768).optional(),
114
113
  loginSessionId: z.string().max(128).optional(),
115
114
  connectionId: z.string().uuid().optional(),
@@ -120,6 +119,15 @@ export const createAiConnectionSchema = z
120
119
  .superRefine((v, ctx) => {
121
120
  if (!AI_CONNECTION_CAPABILITIES[v.provider].methods[v.method])
122
121
  ctx.addIssue({ code: "custom", message: "Unsupported sign-in method" });
122
+ if (v.routing && (v.method !== "api_key" || (v.routing.kind === "openrouter" && v.provider !== "openrouter") || (v.routing.kind === "bedrock" && v.provider !== "anthropic")))
123
+ ctx.addIssue({ code: "custom", message: "Routing requires the matching provider and API authentication." });
124
+ if (v.routing && ["gateway", "local"].includes(v.routing.kind) && v.provider !== (v.routing.protocol === "messages" ? "anthropic" : "openai"))
125
+ ctx.addIssue({ code: "custom", message: "The provider must match the endpoint’s API format." });
126
+ if (v.routing?.auth === "none") {
127
+ if (v.apiKey || v.loginSessionId)
128
+ ctx.addIssue({ code: "custom", message: "Provide only the selected authentication method." });
129
+ return;
130
+ }
123
131
  if (v.method === "api_key"
124
132
  ? !v.apiKey || Boolean(v.loginSessionId)
125
133
  : !v.loginSessionId || Boolean(v.apiKey)) {
@@ -131,7 +139,7 @@ export const createAiConnectionSchema = z
131
139
  });
132
140
  export const aiConnectionLoginIntentSchema = z
133
141
  .object({
134
- provider: aiProviderSchema,
142
+ provider: z.enum(["anthropic", "openai", "xai"]),
135
143
  method: z.literal("subscription"),
136
144
  name: z.string().trim().min(1).max(160),
137
145
  ownership: z.enum(["personal", "shared"]),
@@ -1 +1 @@
1
- {"version":3,"file":"ai-connections.js","sourceRoot":"","sources":["../src/ai-connections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,+EA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AC;AAC5C,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { z } from "zod";
2
+ /** Value-free routing stored on the connection, never supplied by an agent binding. */
3
+ export declare const aiProviderRoutingSchema: z.ZodObject<{
4
+ kind: z.ZodEnum<{
5
+ bedrock: "bedrock";
6
+ gateway: "gateway";
7
+ local: "local";
8
+ openrouter: "openrouter";
9
+ }>;
10
+ protocol: z.ZodEnum<{
11
+ bedrock: "bedrock";
12
+ chat: "chat";
13
+ messages: "messages";
14
+ responses: "responses";
15
+ }>;
16
+ baseUrl: z.ZodOptional<z.ZodString>;
17
+ auth: z.ZodDefault<z.ZodEnum<{
18
+ api_key: "api_key";
19
+ bearer: "bearer";
20
+ none: "none";
21
+ }>>;
22
+ region: z.ZodOptional<z.ZodString>;
23
+ models: z.ZodDefault<z.ZodArray<z.ZodObject<{
24
+ id: z.ZodString;
25
+ label: z.ZodOptional<z.ZodString>;
26
+ }, z.core.$strict>>>;
27
+ }, z.core.$strict>;
28
+ export type AiProviderRouting = z.infer<typeof aiProviderRoutingSchema>;
29
+ export declare function aiRoutingHarness(adapter: string, provider?: unknown, acpxAgent?: unknown): string;
30
+ export declare function isAiRoutingCompatible(route: AiProviderRouting, harness: string): boolean;
31
+ export declare function aiRoutingBaseUrl(route: AiProviderRouting, harness: string): string;
32
+ /** OpenCode names models with a provider prefix; other harnesses use the raw ID. */
33
+ export declare function aiRoutingModel(route: AiProviderRouting, harness: string, model: string): string;
34
+ /** Catalog identity is derived from routing, including accounts saved before these rows existed. */
35
+ export declare function aiConnectionCatalogSlug(provider: string, routing?: Pick<AiProviderRouting, "kind" | "protocol">): string;
36
+ /** Direct catalog setup presets; legacy gateway links still open their existing setup. */
37
+ export declare function aiProviderSetupPreset(source: string | null): {
38
+ provider: "openrouter" | "bedrock" | "gateway" | "local" | "google";
39
+ protocol?: AiProviderRouting["protocol"];
40
+ label?: string;
41
+ } | undefined;
42
+ //# sourceMappingURL=ai-provider-routing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-provider-routing.d.ts","sourceRoot":"","sources":["../src/ai-provider-routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,uFAAuF;AACvF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;kBAwEhC,CAAC;AACL,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,OAAO,EAClB,SAAS,CAAC,EAAE,OAAO,GAClB,MAAM,CAgBR;AACD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,iBAAiB,EACxB,OAAO,EAAE,MAAM,GACd,OAAO,CAYT;AACD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,iBAAiB,EACxB,OAAO,EAAE,MAAM,GACd,MAAM,CAIR;AAED,oFAAoF;AACpF,wBAAgB,cAAc,CAC5B,KAAK,EAAE,iBAAiB,EACxB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,MAAM,CAIR;AAED,oGAAoG;AACpG,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,UAAU,CAAC,GAAG,MAAM,CAMxH;AAED,0FAA0F;AAC1F,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG;IAC5D,QAAQ,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IACpE,QAAQ,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,SAAS,CASZ"}