History

hide password

Rhys Sullivan committed 8 months ago

Commit 90342491 parent bc459474 files · +19 −8Browse files

Unified · Split

4 files
  1. apps/web/src/views/add-source.tsx +4 −0
  2. package.json +1 −1
  3. packages/ai-sdk-adapter/src/example-dynamic.ts +5 −2
  4. packages/kitchen-sink/src/source-runtime.test.ts +9 −5
apps/web/src/views/add-source.tsx+4−0
@@ -1172,6 +1172,7 @@ export function AddSourcePage() { · 1171 unmodified lines
11721172 <>
11731173 <Field label="OAuth client ID" className="sm:col-span-2">
11741174 <TextInput
1175+ type="password"
11751176 value={connectForm.oauthClientId}
11761177 onChange={(v) => setFormField("oauthClientId", v)}
11771178 placeholder="1234567890-abcdef.apps.googleusercontent.com"
@@ -1179,6 +1180,7 @@ export function AddSourcePage() { · 1 unmodified line
11791180 </Field>
11801181 <Field label="OAuth client secret" className="sm:col-span-2">
11811182 <TextInput
1183+ type="password"
11821184 value={connectForm.oauthClientSecret}
11831185 onChange={(v) => setFormField("oauthClientSecret", v)}
11841186 placeholder="GOCSPX-..."
@@ -1324,6 +1326,7 @@ function Field(props: { · 139 unmodified lines
13241326 }
13251327
13261328 function TextInput(props: {
1329+ type?: "text" | "password";
13271330 value: string;
13281331 onChange: (value: string) => void;
13291332 placeholder?: string;
@@ -1331,6 +1334,7 @@ function TextInput(props: { · 1 unmodified line
13311334 }) {
13321335 return (
13331336 <input
1337+ type={props.type || "text"}
13341338 value={props.value}
13351339 onChange={(event) => props.onChange(event.target.value)}
13361340 placeholder={props.placeholder}
package.json+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 "workspaces": [
77 "packages/*",
88 "apps/*",
9− "docs"
9+ "apps/docs"
1010 ],
1111 "catalog": {
1212 "@effect/cli": "^0.73.2",
packages/ai-sdk-adapter/src/example-dynamic.ts+5−2
@@ -9,11 +9,11 @@ import { · 8 unmodified lines
99 const asToolPath = (value: string): ToolPath => value as ToolPath;
1010
1111 const catalog: ToolCatalog = {
12− listNamespaces() {
12+ listNamespaces({ limit }) {
1313 return Effect.succeed([
1414 { namespace: "src_api", displayName: "API Sources", toolCount: 6800 },
1515 { namespace: "src_mcp", displayName: "MCP Sources", toolCount: 3200 },
16− ]);
16+ ].slice(0, limit));
1717 },
1818 listTools({ namespace }) {
1919 return Effect.succeed([
@@ -35,6 +35,9 @@ const catalog: ToolCatalog = { · 15 unmodified lines
3535 outputType: "object",
3636 });
3737 },
38+ getSchemaBundle() {
39+ return Effect.succeed(null);
40+ },
3841 searchTools({ limit }) {
3942 return Effect.succeed(
4043 [
packages/kitchen-sink/src/source-runtime.test.ts+9−5
@@ -287,6 +287,10 @@ const resolveSourceCallContext = (input: { · 286 unmodified lines
287287 return { auth: { kind: "none" } };
288288 }
289289
290+ if (source.auth.kind === "oauth2_authorized_user") {
291+ throw new Error("oauth2_authorized_user auth requires persistence-backed runtime resolution");
292+ }
293+
290294 const tokenRef = source.auth.kind === "bearer"
291295 ? source.auth.token
292296 : source.auth.accessToken;
@@ -494,11 +498,11 @@ const openApiSource = (input: { · 201 unmodified lines
494498 status: "connected",
495499 enabled: true,
496500 namespace: input.namespace ?? null,
497− transport: null,
498− queryParams: null,
499− headers: null,
500− specUrl: input.specUrl ?? null,
501− defaultHeaders: null,
501+ bindingVersion: 1,
502+ binding: {
503+ specUrl: input.specUrl ?? null,
504+ defaultHeaders: null,
505+ },
502506 importAuthPolicy: "reuse_runtime",
503507 importAuth: { kind: "none" },
504508 auth: input.auth,