@neon/tools 2.14.4 → 2.15.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 (77) hide show
  1. package/README.md +78 -1
  2. package/dist/effect.d.ts +22 -0
  3. package/dist/effect.d.ts.map +1 -0
  4. package/dist/effect.js +3 -0
  5. package/dist/generated/output.gen.d.ts +3418 -0
  6. package/dist/generated/output.gen.d.ts.map +1 -0
  7. package/dist/generated/output.gen.js +1498 -0
  8. package/dist/lib/custom/auth-config.d.ts +63 -1
  9. package/dist/lib/custom/auth-config.d.ts.map +1 -1
  10. package/dist/lib/custom/auth-config.js +21 -1
  11. package/dist/lib/custom/docs.d.ts +32 -2
  12. package/dist/lib/custom/docs.d.ts.map +1 -1
  13. package/dist/lib/custom/docs.js +16 -1
  14. package/dist/lib/custom/feedback.d.ts +7 -2
  15. package/dist/lib/custom/feedback.d.ts.map +1 -1
  16. package/dist/lib/custom/feedback.js +2 -0
  17. package/dist/lib/custom/fetch.d.ts +15 -1
  18. package/dist/lib/custom/fetch.d.ts.map +1 -1
  19. package/dist/lib/custom/fetch.js +9 -1
  20. package/dist/lib/custom/organizations.d.ts +23 -1
  21. package/dist/lib/custom/organizations.d.ts.map +1 -1
  22. package/dist/lib/custom/organizations.js +2 -0
  23. package/dist/lib/custom/resources.d.ts +15 -1
  24. package/dist/lib/custom/resources.d.ts.map +1 -1
  25. package/dist/lib/custom/resources.js +7 -1
  26. package/dist/lib/custom/sql/connection.js +1 -1
  27. package/dist/lib/custom/sql/describe-branch.d.ts +99 -1
  28. package/dist/lib/custom/sql/describe-branch.d.ts.map +1 -1
  29. package/dist/lib/custom/sql/describe-branch.js +9 -0
  30. package/dist/lib/custom/sql/inspect/inspect.d.ts +27 -1
  31. package/dist/lib/custom/sql/inspect/inspect.d.ts.map +1 -1
  32. package/dist/lib/custom/sql/inspect/inspect.js +15 -1
  33. package/dist/lib/custom/sql/migrations.d.ts +46 -2
  34. package/dist/lib/custom/sql/migrations.d.ts.map +1 -1
  35. package/dist/lib/custom/sql/migrations.js +26 -2
  36. package/dist/lib/custom/sql/query-tuning.d.ts +90 -2
  37. package/dist/lib/custom/sql/query-tuning.d.ts.map +1 -1
  38. package/dist/lib/custom/sql/query-tuning.js +28 -3
  39. package/dist/lib/custom/sql/run.d.ts +30 -3
  40. package/dist/lib/custom/sql/run.d.ts.map +1 -1
  41. package/dist/lib/custom/sql/run.js +11 -1
  42. package/dist/lib/custom/sql/schema.d.ts +76 -2
  43. package/dist/lib/custom/sql/schema.d.ts.map +1 -1
  44. package/dist/lib/custom/sql/schema.js +31 -2
  45. package/dist/lib/custom/sql/slow-queries.d.ts +15 -1
  46. package/dist/lib/custom/sql/slow-queries.d.ts.map +1 -1
  47. package/dist/lib/custom/sql/slow-queries.js +9 -1
  48. package/dist/lib/effect/errors.d.ts +51 -0
  49. package/dist/lib/effect/errors.d.ts.map +1 -0
  50. package/dist/lib/effect/errors.js +37 -0
  51. package/dist/lib/effect/tools.d.ts +56 -0
  52. package/dist/lib/effect/tools.d.ts.map +1 -0
  53. package/dist/lib/effect/tools.js +67 -0
  54. package/dist/lib/ergonomic/bind.d.ts +20 -6
  55. package/dist/lib/ergonomic/bind.d.ts.map +1 -1
  56. package/dist/lib/ergonomic/bind.js +2 -1
  57. package/dist/lib/ergonomic/catalog.d.ts +5333 -172
  58. package/dist/lib/ergonomic/catalog.d.ts.map +1 -1
  59. package/dist/lib/ergonomic/catalog.js +186 -1
  60. package/dist/lib/ergonomic/composed.d.ts +866 -12
  61. package/dist/lib/ergonomic/composed.d.ts.map +1 -1
  62. package/dist/lib/ergonomic/composed.js +34 -0
  63. package/dist/lib/mcp-json-schema.d.ts +20 -0
  64. package/dist/lib/mcp-json-schema.d.ts.map +1 -1
  65. package/dist/lib/mcp-json-schema.js +89 -1
  66. package/dist/lib/mcp-register.d.ts +1 -1
  67. package/dist/lib/mcp-register.d.ts.map +1 -1
  68. package/dist/lib/mcp-register.js +2 -1
  69. package/dist/lib/operation.d.ts +6 -1
  70. package/dist/lib/operation.d.ts.map +1 -1
  71. package/dist/mcp-v1.d.ts.map +1 -1
  72. package/dist/mcp-v1.js +3 -1
  73. package/dist/mcp.d.ts +3 -3
  74. package/dist/mcp.d.ts.map +1 -1
  75. package/dist/mcp.js +3 -3
  76. package/dist/operations.gen.d.ts +194 -194
  77. package/package.json +22 -3
@@ -164,5 +164,67 @@ export declare const getAuthConfigTool: (options: ToolClientOptions) => import("
164
164
  logs_export: {
165
165
  enabled: boolean;
166
166
  } | null;
167
- }>;
167
+ }, z.ZodObject<{
168
+ project_id: z.ZodString;
169
+ branch_id: z.ZodString;
170
+ branch_name: z.ZodString;
171
+ base_url: z.ZodNullable<z.ZodString>;
172
+ jwks_url: z.ZodString;
173
+ db_name: z.ZodString;
174
+ integration: z.ZodObject<{
175
+ auth_provider: z.ZodString;
176
+ auth_provider_project_id: z.ZodString;
177
+ branch_id: z.ZodString;
178
+ db_name: z.ZodString;
179
+ created_at: z.ZodString;
180
+ owned_by: z.ZodString;
181
+ transfer_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
182
+ jwks_url: z.ZodString;
183
+ base_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
184
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
185
+ }, z.core.$loose>;
186
+ trusted_origins: z.ZodArray<z.ZodString>;
187
+ allow_localhost: z.ZodBoolean;
188
+ auth_methods: z.ZodObject<{
189
+ email_password: z.ZodObject<{}, z.core.$loose>;
190
+ }, z.core.$loose>;
191
+ oauth_providers: z.ZodArray<z.ZodObject<{}, z.core.$loose>>;
192
+ email_provider: z.ZodUnknown;
193
+ plugins: z.ZodUnknown;
194
+ webhook: z.ZodUnknown;
195
+ logs_export: z.ZodUnknown;
196
+ _errors: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
197
+ }, z.core.$loose>> & {
198
+ outputSchema: z.ZodObject<{
199
+ project_id: z.ZodString;
200
+ branch_id: z.ZodString;
201
+ branch_name: z.ZodString;
202
+ base_url: z.ZodNullable<z.ZodString>;
203
+ jwks_url: z.ZodString;
204
+ db_name: z.ZodString;
205
+ integration: z.ZodObject<{
206
+ auth_provider: z.ZodString;
207
+ auth_provider_project_id: z.ZodString;
208
+ branch_id: z.ZodString;
209
+ db_name: z.ZodString;
210
+ created_at: z.ZodString;
211
+ owned_by: z.ZodString;
212
+ transfer_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
213
+ jwks_url: z.ZodString;
214
+ base_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
215
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
216
+ }, z.core.$loose>;
217
+ trusted_origins: z.ZodArray<z.ZodString>;
218
+ allow_localhost: z.ZodBoolean;
219
+ auth_methods: z.ZodObject<{
220
+ email_password: z.ZodObject<{}, z.core.$loose>;
221
+ }, z.core.$loose>;
222
+ oauth_providers: z.ZodArray<z.ZodObject<{}, z.core.$loose>>;
223
+ email_provider: z.ZodUnknown;
224
+ plugins: z.ZodUnknown;
225
+ webhook: z.ZodUnknown;
226
+ logs_export: z.ZodUnknown;
227
+ _errors: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
228
+ }, z.core.$loose>;
229
+ };
168
230
  //# sourceMappingURL=auth-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-config.d.ts","sourceRoot":"","sources":["../../../src/lib/custom/auth-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAON,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAGN,KAAK,iBAAiB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAEhD,eAAO,MAAM,wBAAwB;;;kBASnC,CAAC;AA0GH,eAAO,MAAM,cAAc,GAC1B,MAAM,UAAU,CAAC,IAAI,CAAC,EACtB,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,wBAAwB,CAAC,EAChD,SAAS,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyFpB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0B1D,CAAC"}
1
+ {"version":3,"file":"auth-config.d.ts","sourceRoot":"","sources":["../../../src/lib/custom/auth-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAON,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAIzB,OAAO,EAGN,KAAK,iBAAiB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAEhD,eAAO,MAAM,wBAAwB;;;kBASnC,CAAC;AA0GH,eAAO,MAAM,cAAc,GAC1B,MAAM,UAAU,CAAC,IAAI,CAAC,EACtB,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,wBAAwB,CAAC,EAChD,SAAS,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyFpB,CAAC;AAgCF,eAAO,MAAM,iBAAiB,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2B1D,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import { pathInputDescriptions } from "../../descriptions.gen.js";
2
2
  import { zGetNeonAuthPath } from "../../generated/zod.gen.js";
3
3
  import { bindTool, publishedId } from "../ergonomic/bind.js";
4
- import { NeonApiError } from "@neon/sdk";
4
+ import { NeonAuthIntegration } from "../../generated/output.gen.js";
5
5
  import * as z from "zod";
6
+ import { NeonApiError } from "@neon/sdk";
6
7
  // src/lib/custom/auth-config.ts
7
8
  const REDACTED_SECRET = "***redacted***";
8
9
  const getAuthConfigInputSchema = z.strictObject({
@@ -154,12 +155,31 @@ const readAuthConfig = async (neon, input, signal) => {
154
155
  ...Object.keys(errors).length > 0 && { _errors: errors }
155
156
  };
156
157
  };
158
+ const authConfigOutputSchema = z.looseObject({
159
+ project_id: z.string(),
160
+ branch_id: z.string(),
161
+ branch_name: z.string(),
162
+ base_url: z.string().nullable().describe("Neon Auth API base URL."),
163
+ jwks_url: z.string().describe("JWKS URL for verifying session tokens."),
164
+ db_name: z.string().describe("Database that holds the auth schema."),
165
+ integration: NeonAuthIntegration.describe("The branch's Neon Auth integration."),
166
+ trusted_origins: z.array(z.string()).describe("Domains allowed as redirect targets."),
167
+ allow_localhost: z.boolean(),
168
+ auth_methods: z.looseObject({ email_password: z.looseObject({}) }).describe("Email and password settings."),
169
+ oauth_providers: z.array(z.looseObject({})).describe("OAuth providers, secrets redacted."),
170
+ email_provider: z.unknown().describe("Email server, secrets redacted."),
171
+ plugins: z.unknown().describe("Plugin settings."),
172
+ webhook: z.unknown().describe("Webhook settings, secrets redacted."),
173
+ logs_export: z.unknown().describe("Logs export settings."),
174
+ _errors: z.record(z.string(), z.string()).nullish().describe("Settings that failed to read, by key.")
175
+ });
157
176
  const getAuthConfigTool = (options) => bindTool(options, {
158
177
  operationId: "auth.getConfig",
159
178
  id: publishedId("auth.getConfig"),
160
179
  title: "Get Neon Auth configuration",
161
180
  description: "Returns a branch's Neon Auth integration and settings: trusted origins, localhost, email and password, OAuth and email providers, plugins, webhook, and logs export, with secrets redacted. Needs Neon Auth on the branch ({{auth.create}}).",
162
181
  inputSchema: getAuthConfigInputSchema,
182
+ outputSchema: authConfigOutputSchema,
163
183
  annotations: {
164
184
  readOnlyHint: true,
165
185
  destructiveHint: false,
@@ -48,11 +48,41 @@ export declare const searchDocsTool: (options: ToolClientOptions) => import("../
48
48
  heading: string;
49
49
  excerpt: string;
50
50
  }[];
51
- }>;
51
+ }, z.ZodObject<{
52
+ hits: z.ZodArray<z.ZodObject<{
53
+ title: z.ZodString;
54
+ url: z.ZodString;
55
+ slug: z.ZodString;
56
+ category: z.ZodString;
57
+ breadcrumb: z.ZodArray<z.ZodString>;
58
+ heading: z.ZodString;
59
+ excerpt: z.ZodString;
60
+ }, z.core.$loose>>;
61
+ }, z.core.$loose>> & {
62
+ outputSchema: z.ZodObject<{
63
+ hits: z.ZodArray<z.ZodObject<{
64
+ title: z.ZodString;
65
+ url: z.ZodString;
66
+ slug: z.ZodString;
67
+ category: z.ZodString;
68
+ breadcrumb: z.ZodArray<z.ZodString>;
69
+ heading: z.ZodString;
70
+ excerpt: z.ZodString;
71
+ }, z.core.$loose>>;
72
+ }, z.core.$loose>;
73
+ };
52
74
  export declare const getDocTool: (options: ToolClientOptions) => import("../operation.js").NeonTool<z.ZodObject<{
53
75
  slug: z.ZodString;
54
76
  }, z.core.$strict>, "get_docs", {
55
77
  url: string;
56
78
  markdown: string;
57
- }>;
79
+ }, z.ZodObject<{
80
+ url: z.ZodString;
81
+ markdown: z.ZodString;
82
+ }, z.core.$loose>> & {
83
+ outputSchema: z.ZodObject<{
84
+ url: z.ZodString;
85
+ markdown: z.ZodString;
86
+ }, z.core.$loose>;
87
+ };
58
88
  //# sourceMappingURL=docs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../src/lib/custom/docs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAGN,KAAK,iBAAiB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAuB,cAAc,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,MAAM,cAAc,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2DxD,CAAC;AAOF,eAAO,MAAM,UAAU,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;CA0CpD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { bindPublicTool, publishedId } from "../ergonomic/bind.js";
2
- import { NeonClientError } from "@neon/sdk";
3
2
  import * as z from "zod";
3
+ import { NeonClientError } from "@neon/sdk";
4
4
  // src/lib/custom/docs.ts
5
5
  const DEFAULT_SITE_SEARCH_URL = "https://br-frosty-cell-a5smzg39-assistant.compute.c-1.us-east-2.aws.neon.tech/site-search";
6
6
  const DEFAULT_DOCS_BASE_URL = "https://neon.com";
@@ -67,6 +67,15 @@ const validateDocSlug = (slug) => {
67
67
  if (slug.includes("://")) throw new NeonClientError("Invalid doc slug: absolute URLs are not allowed");
68
68
  if (slug.startsWith("/")) throw new NeonClientError("Invalid doc slug: slug must not start with \"/\"");
69
69
  };
70
+ const searchDocsOutputSchema = z.looseObject({ hits: z.array(z.looseObject({
71
+ title: z.string(),
72
+ url: z.string(),
73
+ slug: z.string(),
74
+ category: z.string(),
75
+ breadcrumb: z.array(z.string()),
76
+ heading: z.string(),
77
+ excerpt: z.string()
78
+ })).describe("Matching doc sections.") });
70
79
  const searchDocsTool = (options) => {
71
80
  const url = options.siteSearchUrl ?? "https://br-frosty-cell-a5smzg39-assistant.compute.c-1.us-east-2.aws.neon.tech/site-search";
72
81
  const fetchImpl = options.fetch ?? fetch;
@@ -76,6 +85,7 @@ const searchDocsTool = (options) => {
76
85
  title: "Search Documentation",
77
86
  description: "Searches neon.com docs, API reference, PostgreSQL tutorial, guides, FAQs, changelog, and blog for ranked pages with the slug {{docs.get}} reads.",
78
87
  inputSchema: searchDocsInputSchema,
88
+ outputSchema: searchDocsOutputSchema,
79
89
  annotations: docsAnnotations,
80
90
  requiresApproval: false,
81
91
  metadata: {
@@ -109,6 +119,10 @@ const searchDocsTool = (options) => {
109
119
  return parsed.data;
110
120
  });
111
121
  };
122
+ const getDocOutputSchema = z.looseObject({
123
+ url: z.string(),
124
+ markdown: z.string().describe("The page as markdown.")
125
+ });
112
126
  const getDocTool = (options) => {
113
127
  const baseUrl = options.docsBaseUrl ?? "https://neon.com";
114
128
  const fetchImpl = options.fetch ?? fetch;
@@ -118,6 +132,7 @@ const getDocTool = (options) => {
118
132
  title: "Get Documentation Page",
119
133
  description: "Returns one neon.com page as markdown, by the slug of a {{docs.search}} hit.",
120
134
  inputSchema: getDocInputSchema,
135
+ outputSchema: getDocOutputSchema,
121
136
  annotations: docsAnnotations,
122
137
  requiresApproval: false,
123
138
  metadata: {
@@ -6,10 +6,15 @@ export declare const MAX_FEEDBACK_LENGTH = 10000;
6
6
  export declare const sendFeedbackInputSchema: z.ZodObject<{
7
7
  feedback: z.ZodString;
8
8
  }, z.core.$strict>;
9
- /** Sends only the message and `source` to the Neon feedback service: no account, project, or credential. */
10
9
  export declare const sendFeedbackTool: (options: ToolClientOptions) => import("../operation.js").NeonTool<z.ZodObject<{
11
10
  feedback: z.ZodString;
12
11
  }, z.core.$strict>, "send_feedback", {
13
12
  message: string;
14
- }>;
13
+ }, z.ZodObject<{
14
+ message: z.ZodString;
15
+ }, z.core.$loose>> & {
16
+ outputSchema: z.ZodObject<{
17
+ message: z.ZodString;
18
+ }, z.core.$loose>;
19
+ };
15
20
  //# sourceMappingURL=feedback.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../../src/lib/custom/feedback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAGN,KAAK,iBAAiB,EACtB,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,oBAAoB,gCAAgC,CAAC;AAClE,eAAO,MAAM,uBAAuB,eAAe,CAAC;AAGpD,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C,eAAO,MAAM,uBAAuB;;kBASlC,CAAC;AAEH,4GAA4G;AAC5G,eAAO,MAAM,gBAAgB,GAAI,SAAS,iBAAiB;;;;EA4D1D,CAAC"}
1
+ {"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../../src/lib/custom/feedback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAGN,KAAK,iBAAiB,EACtB,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,oBAAoB,gCAAgC,CAAC;AAClE,eAAO,MAAM,uBAAuB,eAAe,CAAC;AAGpD,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C,eAAO,MAAM,uBAAuB;;kBASlC,CAAC;AAKH,eAAO,MAAM,gBAAgB,GAAI,SAAS,iBAAiB;;;;;;;;;;CA6D1D,CAAC"}
@@ -7,6 +7,7 @@ const DEFAULT_FEEDBACK_SOURCE = "neon_tools";
7
7
  const MAX_FEEDBACK_LENGTH = 1e4;
8
8
  const sendFeedbackInputSchema = z.strictObject({ feedback: z.string().trim().min(1).max(MAX_FEEDBACK_LENGTH).describe("The feedback to send to Neon. Do not include passwords, API keys, connection strings, or other secrets.") });
9
9
  /** Sends only the message and `source` to the Neon feedback service: no account, project, or credential. */
10
+ const sendFeedbackOutputSchema = z.looseObject({ message: z.string() });
10
11
  const sendFeedbackTool = (options) => {
11
12
  const url = options.feedbackUrl ?? "https://feedback.neon.tech/";
12
13
  const source = options.feedbackSource ?? "neon_tools";
@@ -17,6 +18,7 @@ const sendFeedbackTool = (options) => {
17
18
  title: "Send Feedback",
18
19
  description: "Sends anonymous feedback text to the Neon team, with no account, project, or connection details. Only call it when the user asks to give feedback.",
19
20
  inputSchema: sendFeedbackInputSchema,
21
+ outputSchema: sendFeedbackOutputSchema,
20
22
  annotations: {
21
23
  readOnlyHint: false,
22
24
  destructiveHint: false,
@@ -398,5 +398,19 @@ export declare const fetchResourceTool: (options: ToolClientOptions) => import("
398
398
  }[][] | null;
399
399
  database_structure_error?: string | null | undefined;
400
400
  };
401
- }>;
401
+ }, z.ZodObject<{
402
+ id: z.ZodString;
403
+ title: z.ZodString;
404
+ text: z.ZodString;
405
+ url: z.ZodString;
406
+ metadata: z.ZodObject<{}, z.core.$loose>;
407
+ }, z.core.$loose>> & {
408
+ outputSchema: z.ZodObject<{
409
+ id: z.ZodString;
410
+ title: z.ZodString;
411
+ text: z.ZodString;
412
+ url: z.ZodString;
413
+ metadata: z.ZodObject<{}, z.core.$loose>;
414
+ }, z.core.$loose>;
415
+ };
402
416
  //# sourceMappingURL=fetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/lib/custom/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAmC,MAAM,WAAW,CAAC;AAC7E,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAGN,KAAK,iBAAiB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAQhE,eAAO,MAAM,wBAAwB;;kBAOnC,CAAC;AAkMH,eAAO,MAAM,aAAa,GACzB,YAAY,UAAU,CAAC,IAAI,CAAC,EAC5B,IAAI,MAAM,EACV,SAAS,wBAAwB,EACjC,YAAY,MAAM,EAClB,SAAS,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+DpB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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1,8 @@
1
1
  import { bindTool, publishedId } from "../ergonomic/bind.js";
2
2
  import { consoleBaseUrl, isAccessRefusal } from "./resources.js";
3
3
  import { describeBranch } from "./sql/describe-branch.js";
4
- import { NeonClientError } from "@neon/sdk";
5
4
  import * as z from "zod";
5
+ import { NeonClientError } from "@neon/sdk";
6
6
  // src/lib/custom/fetch.ts
7
7
  const fetchResourceInputSchema = z.strictObject({ id: z.string().min(1).describe("An id from {{resources.search}}, such as project:<project_id>.") });
8
8
  /** The first page only; a list the API refuses is empty. */
@@ -167,6 +167,13 @@ const fetchResource = async (neonClient, id, context, consoleUrl, signal) => {
167
167
  }
168
168
  throw invalidId(id);
169
169
  };
170
+ const fetchResourceOutputSchema = z.looseObject({
171
+ id: z.string(),
172
+ title: z.string(),
173
+ text: z.string().describe("The resource as markdown."),
174
+ url: z.string().describe("Console URL."),
175
+ metadata: z.looseObject({}).describe("API records: organization, members, and projects; project and branches; endpoint; or snapshot.")
176
+ });
170
177
  const fetchResourceTool = (options) => {
171
178
  const consoleUrl = consoleBaseUrl(options.baseUrl ?? "https://console.neon.tech/api/v2");
172
179
  return bindTool(options, {
@@ -175,6 +182,7 @@ const fetchResourceTool = (options) => {
175
182
  title: "Fetch",
176
183
  description: "Returns an organization, project, branch, compute, or snapshot by an id from {{resources.search}}: markdown text, console URL, and records in metadata.",
177
184
  inputSchema: fetchResourceInputSchema,
185
+ outputSchema: fetchResourceOutputSchema,
178
186
  annotations: {
179
187
  readOnlyHint: true,
180
188
  destructiveHint: false,
@@ -19,5 +19,27 @@ export declare const userOrganizationsTool: (options: ToolClientOptions) => impo
19
19
  updated_at: string;
20
20
  allow_hipaa_projects?: boolean | null | undefined;
21
21
  require_mfa?: boolean | null | undefined;
22
- }[]>;
22
+ }[], z.ZodArray<z.ZodObject<{
23
+ id: z.ZodString;
24
+ name: z.ZodString;
25
+ handle: z.ZodString;
26
+ plan: z.ZodString;
27
+ created_at: z.ZodString;
28
+ managed_by: z.ZodString;
29
+ updated_at: z.ZodString;
30
+ allow_hipaa_projects: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
31
+ require_mfa: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
32
+ }, z.core.$loose>>> & {
33
+ outputSchema: z.ZodArray<z.ZodObject<{
34
+ id: z.ZodString;
35
+ name: z.ZodString;
36
+ handle: z.ZodString;
37
+ plan: z.ZodString;
38
+ created_at: z.ZodString;
39
+ managed_by: z.ZodString;
40
+ updated_at: z.ZodString;
41
+ allow_hipaa_projects: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
42
+ require_mfa: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
43
+ }, z.core.$loose>>;
44
+ };
23
45
  //# sourceMappingURL=organizations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../../src/lib/custom/organizations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAGN,KAAK,iBAAiB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,4BAA4B;;kBAKvC,CAAC;AAEH,eAAO,MAAM,eAAe,GAC3B,QAAQ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EACpC,OAAO,MAAM,YAOb,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,SAAS,iBAAiB;;;;;;;;;;;;IAyB9D,CAAC"}
1
+ {"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../../src/lib/custom/organizations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAGN,KAAK,iBAAiB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,4BAA4B;;kBAKvC,CAAC;AAEH,eAAO,MAAM,eAAe,GAC3B,QAAQ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EACpC,OAAO,MAAM,YAOb,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B9D,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { bindTool, publishedId } from "../ergonomic/bind.js";
2
+ import { Organization } from "../../generated/output.gen.js";
2
3
  import * as z from "zod";
3
4
  // src/lib/custom/organizations.ts
4
5
  const userOrganizationsInputSchema = z.strictObject({ search: z.string().describe("Part of an organization name or id, ignoring case.").optional() });
@@ -12,6 +13,7 @@ const userOrganizationsTool = (options) => bindTool(options, {
12
13
  title: "List organizations for the current user",
13
14
  description: "Lists the organizations the user belongs to; an organization API key gets its own organization. search filters by name or id.",
14
15
  inputSchema: userOrganizationsInputSchema,
16
+ outputSchema: z.array(Organization),
15
17
  annotations: {
16
18
  readOnlyHint: true,
17
19
  openWorldHint: false
@@ -18,5 +18,19 @@ export declare const searchResourcesTool: (options: ToolClientOptions) => import
18
18
  title: string;
19
19
  url: string;
20
20
  }[];
21
- }>;
21
+ }, z.ZodObject<{
22
+ results: z.ZodArray<z.ZodObject<{
23
+ id: z.ZodString;
24
+ title: z.ZodString;
25
+ url: z.ZodString;
26
+ }, z.core.$loose>>;
27
+ }, z.core.$loose>> & {
28
+ outputSchema: z.ZodObject<{
29
+ results: z.ZodArray<z.ZodObject<{
30
+ id: z.ZodString;
31
+ title: z.ZodString;
32
+ url: z.ZodString;
33
+ }, z.core.$loose>>;
34
+ }, z.core.$loose>;
35
+ };
22
36
  //# sourceMappingURL=resources.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../src/lib/custom/resources.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAGN,KAAK,iBAAiB,EACtB,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,oBAAoB,qCAAqC,CAAC;AAGvE,eAAO,MAAM,0BAA0B;;kBAOrC,CAAC;AAQH,eAAO,MAAM,cAAc,GAAI,YAAY,MAAM,WACT,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,OAEF,CAAC;AA0HhD,eAAO,MAAM,mBAAmB,GAAI,SAAS,iBAAiB;;;;YAxIzD,MAAM;eACH,MAAM;aACR,MAAM;;EAwKX,CAAC"}
1
+ {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../src/lib/custom/resources.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAGN,KAAK,iBAAiB,EACtB,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,oBAAoB,qCAAqC,CAAC;AAGvE,eAAO,MAAM,0BAA0B;;kBAOrC,CAAC;AAQH,eAAO,MAAM,cAAc,GAAI,YAAY,MAAM,WACT,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,OAEF,CAAC;AAwIhD,eAAO,MAAM,mBAAmB,GAAI,SAAS,iBAAiB;;;;YAtJzD,MAAM;eACH,MAAM;aACR,MAAM;;;;;;;;;;;;;;;;CAuLX,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { bindTool, publishedId } from "../ergonomic/bind.js";
2
2
  import { matchesNameOrId } from "./organizations.js";
3
- import { NeonApiError } from "@neon/sdk";
4
3
  import * as z from "zod";
4
+ import { NeonApiError } from "@neon/sdk";
5
5
  import { listSharedProjects } from "@neon/sdk/raw";
6
6
  // src/lib/custom/resources.ts
7
7
  const DEFAULT_API_BASE_URL = "https://console.neon.tech/api/v2";
@@ -86,6 +86,11 @@ const searchResources = async (neon, query, consoleUrl, signal) => {
86
86
  }));
87
87
  return { results };
88
88
  };
89
+ const searchResourcesOutputSchema = z.looseObject({ results: z.array(z.looseObject({
90
+ id: z.string(),
91
+ title: z.string(),
92
+ url: z.string()
93
+ })).describe("Organizations, projects, branches, computes, and snapshots that match.") });
89
94
  const searchResourcesTool = (options) => {
90
95
  const consoleUrl = consoleBaseUrl(options.baseUrl ?? "https://console.neon.tech/api/v2");
91
96
  return bindTool(options, {
@@ -94,6 +99,7 @@ const searchResourcesTool = (options) => {
94
99
  title: "Search Neon resources",
95
100
  description: "Finds organizations, projects (including shared ones), branches, computes, and snapshots whose name or id contains query, with ids for {{resources.fetch}}. To list projects, use {{projects.list}}; for docs, {{docs.search}}.",
96
101
  inputSchema: searchResourcesInputSchema,
102
+ outputSchema: searchResourcesOutputSchema,
97
103
  annotations: {
98
104
  readOnlyHint: true,
99
105
  destructiveHint: false,
@@ -1,7 +1,7 @@
1
1
  import { pathInputDescriptions } from "../../../descriptions.gen.js";
2
- import { NeonClientError } from "@neon/sdk";
3
2
  import { neon } from "@neondatabase/serverless";
4
3
  import * as z from "zod";
4
+ import { NeonClientError } from "@neon/sdk";
5
5
  // src/lib/custom/sql/connection.ts
6
6
  const NEON_DEFAULT_DATABASE_NAME = "neondb";
7
7
  const SQL_METADATA = {
@@ -80,5 +80,103 @@ export declare const describeBranchTool: (options: ToolClientOptions) => import(
80
80
  [x: string]: unknown;
81
81
  }[][] | null;
82
82
  database_structure_error?: string | null | undefined;
83
- }>;
83
+ }, z.ZodObject<{
84
+ branch: z.ZodObject<{
85
+ id: z.ZodString;
86
+ project_id: z.ZodString;
87
+ parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
+ parent_lsn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
89
+ parent_timestamp: z.ZodOptional<z.ZodNullable<z.ZodString>>;
90
+ name: z.ZodString;
91
+ current_state: z.ZodString;
92
+ pending_state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
93
+ state_changed_at: z.ZodString;
94
+ logical_size: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
95
+ creation_source: z.ZodString;
96
+ primary: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
97
+ default: z.ZodBoolean;
98
+ protected: z.ZodBoolean;
99
+ cpu_used_sec: z.ZodNumber;
100
+ compute_time_seconds: z.ZodNumber;
101
+ active_time_seconds: z.ZodNumber;
102
+ written_data_bytes: z.ZodNumber;
103
+ data_transfer_bytes: z.ZodNumber;
104
+ created_at: z.ZodString;
105
+ updated_at: z.ZodString;
106
+ ttl_interval_seconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
107
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
108
+ last_reset_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
109
+ created_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
110
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
111
+ image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
112
+ }, z.core.$loose>>>;
113
+ init_source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
114
+ restore_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
115
+ restored_from: z.ZodOptional<z.ZodNullable<z.ZodString>>;
116
+ restored_as: z.ZodOptional<z.ZodNullable<z.ZodString>>;
117
+ restricted_actions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
118
+ name: z.ZodString;
119
+ reason: z.ZodString;
120
+ }, z.core.$loose>>>>;
121
+ recovery: z.ZodOptional<z.ZodNullable<z.ZodObject<{
122
+ deleted_at: z.ZodString;
123
+ recoverable_until: z.ZodString;
124
+ deletion_method: z.ZodString;
125
+ }, z.core.$loose>>>;
126
+ }, z.core.$loose>;
127
+ console_url: z.ZodString;
128
+ text: z.ZodString;
129
+ database_structure: z.ZodNullable<z.ZodArray<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
130
+ database_structure_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
131
+ }, z.core.$loose>> & {
132
+ outputSchema: z.ZodObject<{
133
+ branch: z.ZodObject<{
134
+ id: z.ZodString;
135
+ project_id: z.ZodString;
136
+ parent_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
137
+ parent_lsn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
138
+ parent_timestamp: z.ZodOptional<z.ZodNullable<z.ZodString>>;
139
+ name: z.ZodString;
140
+ current_state: z.ZodString;
141
+ pending_state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
142
+ state_changed_at: z.ZodString;
143
+ logical_size: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
144
+ creation_source: z.ZodString;
145
+ primary: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
146
+ default: z.ZodBoolean;
147
+ protected: z.ZodBoolean;
148
+ cpu_used_sec: z.ZodNumber;
149
+ compute_time_seconds: z.ZodNumber;
150
+ active_time_seconds: z.ZodNumber;
151
+ written_data_bytes: z.ZodNumber;
152
+ data_transfer_bytes: z.ZodNumber;
153
+ created_at: z.ZodString;
154
+ updated_at: z.ZodString;
155
+ ttl_interval_seconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
156
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
157
+ last_reset_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
158
+ created_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
159
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
160
+ image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
161
+ }, z.core.$loose>>>;
162
+ init_source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
163
+ restore_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
164
+ restored_from: z.ZodOptional<z.ZodNullable<z.ZodString>>;
165
+ restored_as: z.ZodOptional<z.ZodNullable<z.ZodString>>;
166
+ restricted_actions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
167
+ name: z.ZodString;
168
+ reason: z.ZodString;
169
+ }, z.core.$loose>>>>;
170
+ recovery: z.ZodOptional<z.ZodNullable<z.ZodObject<{
171
+ deleted_at: z.ZodString;
172
+ recoverable_until: z.ZodString;
173
+ deletion_method: z.ZodString;
174
+ }, z.core.$loose>>>;
175
+ }, z.core.$loose>;
176
+ console_url: z.ZodString;
177
+ text: z.ZodString;
178
+ database_structure: z.ZodNullable<z.ZodArray<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
179
+ database_structure_error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
180
+ }, z.core.$loose>;
181
+ };
84
182
  //# sourceMappingURL=describe-branch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"describe-branch.d.ts","sourceRoot":"","sources":["../../../../src/lib/custom/sql/describe-branch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAGN,KAAK,iBAAiB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AASnE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGrC,eAAO,MAAM,yBAAyB;;;;kBAIpC,CAAC;AAkFH,eAAO,MAAM,gBAAgB,GAC5B,YAAY,MAAM,EAClB,WAAW,MAAM,EACjB,UAAU,MAAM,WAKJ,CAAC;AAoBd,MAAM,WAAW,iBAAiB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,kBAAkB,EAAE,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;IACnC,wBAAwB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,eAAO,MAAM,cAAc,GAC1B,YAAY,UAAU,CAAC,IAAI,CAAC,EAC5B,OAAO;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,EACxE,SAAS,wBAAwB,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AAC,iBAAiB,CA6C3B,CAAC;AAaF,eAAO,MAAM,kBAAkB,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA3E/C,MAAM;UAEb,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4FZ,CAAC"}
@@ -2,6 +2,7 @@ import { pathInputDescriptions } from "../../../descriptions.gen.js";
2
2
  import { bindTool, publishedId } from "../../ergonomic/bind.js";
3
3
  import { SQL_METADATA, databaseNameField, projectIdField, resolveConnection, sqlClient } from "./connection.js";
4
4
  import { sqlReadAnnotations } from "./schema.js";
5
+ import { Branch } from "../../../generated/output.gen.js";
5
6
  import { consoleBaseUrl } from "../resources.js";
6
7
  import * as z from "zod";
7
8
  // src/lib/custom/sql/describe-branch.ts
@@ -139,6 +140,13 @@ const describeBranch = async (neonClient, input, context, consoleUrl, signal) =>
139
140
  };
140
141
  }
141
142
  };
143
+ const describeBranchOutputSchema = z.looseObject({
144
+ branch: Branch,
145
+ console_url: z.string(),
146
+ text: z.string().describe("The branch details and database tree as text."),
147
+ database_structure: z.array(z.array(z.record(z.string(), z.unknown()))).nullable().describe("`[[], treeRows]`, or null when the tree query failed."),
148
+ database_structure_error: z.string().nullish()
149
+ });
142
150
  const describeBranchTool = (options) => {
143
151
  const consoleUrl = consoleBaseUrl(options.baseUrl ?? "https://console.neon.tech/api/v2");
144
152
  return bindTool(options, {
@@ -147,6 +155,7 @@ const describeBranchTool = (options) => {
147
155
  title: "Describe Branch",
148
156
  description: "Returns a branch summary, its database names, and a tree of one database's schemas, tables, views, indexes, sequences, and functions. Starts a suspended compute. Branch record only: {{branches.get}}; table names: {{schema.listTables}}; columns: {{schema.describeTable}}.",
149
157
  inputSchema: describeBranchInputSchema,
158
+ outputSchema: describeBranchOutputSchema,
150
159
  annotations: sqlReadAnnotations,
151
160
  requiresApproval: false,
152
161
  metadata: SQL_METADATA
@@ -71,5 +71,31 @@ export declare const inspectDatabaseTool: (options: ToolClientOptions) => import
71
71
  }[];
72
72
  truncated: boolean;
73
73
  note?: string | null | undefined;
74
- }>;
74
+ }, z.ZodObject<{
75
+ check: z.ZodString;
76
+ describe: z.ZodString;
77
+ projectId: z.ZodString;
78
+ branchId: z.ZodString;
79
+ databaseName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
80
+ databases: z.ZodArray<z.ZodString>;
81
+ fields: z.ZodArray<z.ZodString>;
82
+ totalRowCount: z.ZodNumber;
83
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
84
+ truncated: z.ZodBoolean;
85
+ note: z.ZodOptional<z.ZodNullable<z.ZodString>>;
86
+ }, z.core.$loose>> & {
87
+ outputSchema: z.ZodObject<{
88
+ check: z.ZodString;
89
+ describe: z.ZodString;
90
+ projectId: z.ZodString;
91
+ branchId: z.ZodString;
92
+ databaseName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
93
+ databases: z.ZodArray<z.ZodString>;
94
+ fields: z.ZodArray<z.ZodString>;
95
+ totalRowCount: z.ZodNumber;
96
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
97
+ truncated: z.ZodBoolean;
98
+ note: z.ZodOptional<z.ZodNullable<z.ZodString>>;
99
+ }, z.core.$loose>;
100
+ };
75
101
  //# sourceMappingURL=inspect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../../../../src/lib/custom/sql/inspect/inspect.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAGN,KAAK,iBAAiB,EACtB,MAAM,4BAA4B,CAAC;AAUpC,OAAO,EAKN,KAAK,YAAY,EACjB,MAAM,cAAc,CAAC;AAItB;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;IAChD,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;gBAEjB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO;CAKhE;AAED,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;kBAsBrC,CAAC;AAyEH,eAAO,MAAM,mBAAmB,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2G5D,CAAC"}
1
+ {"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../../../../src/lib/custom/sql/inspect/inspect.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAGN,KAAK,iBAAiB,EACtB,MAAM,4BAA4B,CAAC;AAUpC,OAAO,EAKN,KAAK,YAAY,EACjB,MAAM,cAAc,CAAC;AAItB;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;IAChD,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;gBAEjB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO;CAKhE;AAED,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;kBAsBrC,CAAC;AAuFH,eAAO,MAAM,mBAAmB,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4G5D,CAAC"}