@neon/tools 2.9.0 → 2.10.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.
- package/README.md +1 -1
- package/dist/lib/ergonomic/catalog.d.ts +25 -0
- package/dist/lib/ergonomic/catalog.d.ts.map +1 -1
- package/dist/lib/ergonomic/catalog.js +2 -1
- package/dist/lib/ergonomic/composed.d.ts +38 -0
- package/dist/lib/ergonomic/composed.d.ts.map +1 -1
- package/dist/lib/ergonomic/composed.js +42 -2
- package/dist/lib/ergonomic/ids.d.ts +2 -2
- package/dist/lib/ergonomic/ids.d.ts.map +1 -1
- package/dist/lib/ergonomic/ids.js +7 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -114,7 +114,7 @@ An abort `signal` on `execute` or a wait timeout stops the poll, not the create:
|
|
|
114
114
|
|
|
115
115
|
`metadata.method` and `metadata.path` name the first request; extra readiness GETs are not listed there.
|
|
116
116
|
|
|
117
|
-
These public client methods are not tools: `operations.waitFor`, `postgres.roles.password`, `storage.objects.get`, and `
|
|
117
|
+
These public client methods are not tools: `operations.waitFor`, `postgres.roles.password`, `storage.objects.get`, `credentials.reveal`, `logs.loki.labels`, and `logs.loki.labelValues`. Waiting is what the write tools already do. Loki labels are the log fields, so `logs.fields` and `logs.fieldValues` are the discovery tools for both `logs.query` and `logs.loki.queryRange`; the latter returns Loki's response, with lines grouped by stream labels, and nanosecond timestamp strings. `realtime.secret` is a GET that requires approval: it returns the branch's Realtime secret, which an application backend seals queries with. After `realtime.rotateSecret`, it returns the new value once `pending` is `false`. `projects.create` and `branches.create` return the created resource without a connection string; `createAndConnect` returns a URI. `triggers.create` and `triggers.update` take the OpenAPI discriminator as a nested `body` field. `credentials.rotate` requires approval and is not idempotent: a lost success already replaced the secret; create a replacement and revoke the rotated credential.
|
|
118
118
|
|
|
119
119
|
## Roles
|
|
120
120
|
|
|
@@ -2519,6 +2519,31 @@ export declare const toolFactories: {
|
|
|
2519
2519
|
values: string[];
|
|
2520
2520
|
is_truncated: boolean;
|
|
2521
2521
|
}>;
|
|
2522
|
+
"logs.loki.queryRange": (options: ToolClientOptions) => import("../operation.js").NeonTool<z.ZodObject<{
|
|
2523
|
+
project_id: z.ZodString;
|
|
2524
|
+
branch_id: z.ZodString;
|
|
2525
|
+
query: z.ZodString;
|
|
2526
|
+
since: z.ZodOptional<z.ZodString>;
|
|
2527
|
+
start: z.ZodOptional<z.ZodString>;
|
|
2528
|
+
end: z.ZodOptional<z.ZodString>;
|
|
2529
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
2530
|
+
direction: z.ZodOptional<z.ZodEnum<{
|
|
2531
|
+
forward: "forward";
|
|
2532
|
+
backward: "backward";
|
|
2533
|
+
}>>;
|
|
2534
|
+
}, z.core.$strict>, "query_range_logs_loki", {
|
|
2535
|
+
status: "success";
|
|
2536
|
+
data: {
|
|
2537
|
+
resultType: "streams";
|
|
2538
|
+
result: {
|
|
2539
|
+
stream: {
|
|
2540
|
+
[x: string]: string;
|
|
2541
|
+
};
|
|
2542
|
+
values: string[][];
|
|
2543
|
+
}[];
|
|
2544
|
+
};
|
|
2545
|
+
warnings?: string[] | null | undefined;
|
|
2546
|
+
}>;
|
|
2522
2547
|
"snapshots.list": (options: ToolClientOptions) => import("../operation.js").NeonTool<z.ZodObject<{
|
|
2523
2548
|
project_id: z.ZodString;
|
|
2524
2549
|
}, z.core.$strict>, "list_snapshots", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/lib/ergonomic/catalog.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAMN,KAAK,iBAAiB,EACtB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/lib/ergonomic/catalog.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+/D6C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { decodeBase64 } from "../binary.js";
|
|
2
2
|
import { bindTool, collectObjectList, collectPages, fromGenerated, publishedId } from "./bind.js";
|
|
3
|
-
import { compareSchemaTool, connectionStringTool, createBranchAndConnectTool, createBranchTool, createProjectAndConnectTool, createProjectTool, createRoleTool, getDefaultTool, resetFromParentTool, restoreSnapshotTool, setScheduleTool } from "./composed.js";
|
|
3
|
+
import { compareSchemaTool, connectionStringTool, createBranchAndConnectTool, createBranchTool, createProjectAndConnectTool, createProjectTool, createRoleTool, getDefaultTool, lokiQueryRangeTool, resetFromParentTool, restoreSnapshotTool, setScheduleTool } from "./composed.js";
|
|
4
4
|
import * as z from "zod";
|
|
5
5
|
// src/lib/ergonomic/catalog.ts
|
|
6
6
|
const logReadAnnotations = {
|
|
@@ -784,6 +784,7 @@ const toolFactories = {
|
|
|
784
784
|
limit: input.limit
|
|
785
785
|
}, { signal })
|
|
786
786
|
}),
|
|
787
|
+
"logs.loki.queryRange": lokiQueryRangeTool,
|
|
787
788
|
"snapshots.list": (options) => fromGenerated(options, {
|
|
788
789
|
id: "snapshots.list",
|
|
789
790
|
generated: "listSnapshots",
|
|
@@ -157,6 +157,44 @@ export declare const compareSchemaInputSchema: z.ZodObject<{
|
|
|
157
157
|
base_lsn: z.ZodOptional<z.ZodString>;
|
|
158
158
|
base_timestamp: z.ZodOptional<z.ZodISODateTime>;
|
|
159
159
|
}, z.core.$strict>;
|
|
160
|
+
export declare const lokiQueryRangeInputSchema: z.ZodObject<{
|
|
161
|
+
project_id: z.ZodString;
|
|
162
|
+
branch_id: z.ZodString;
|
|
163
|
+
query: z.ZodString;
|
|
164
|
+
since: z.ZodOptional<z.ZodString>;
|
|
165
|
+
start: z.ZodOptional<z.ZodString>;
|
|
166
|
+
end: z.ZodOptional<z.ZodString>;
|
|
167
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
direction: z.ZodOptional<z.ZodEnum<{
|
|
169
|
+
forward: "forward";
|
|
170
|
+
backward: "backward";
|
|
171
|
+
}>>;
|
|
172
|
+
}, z.core.$strict>;
|
|
173
|
+
export declare const lokiQueryRangeTool: (options: ToolClientOptions) => import("../operation.js").NeonTool<z.ZodObject<{
|
|
174
|
+
project_id: z.ZodString;
|
|
175
|
+
branch_id: z.ZodString;
|
|
176
|
+
query: z.ZodString;
|
|
177
|
+
since: z.ZodOptional<z.ZodString>;
|
|
178
|
+
start: z.ZodOptional<z.ZodString>;
|
|
179
|
+
end: z.ZodOptional<z.ZodString>;
|
|
180
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
181
|
+
direction: z.ZodOptional<z.ZodEnum<{
|
|
182
|
+
forward: "forward";
|
|
183
|
+
backward: "backward";
|
|
184
|
+
}>>;
|
|
185
|
+
}, z.core.$strict>, "query_range_logs_loki", {
|
|
186
|
+
status: "success";
|
|
187
|
+
data: {
|
|
188
|
+
resultType: "streams";
|
|
189
|
+
result: {
|
|
190
|
+
stream: {
|
|
191
|
+
[x: string]: string;
|
|
192
|
+
};
|
|
193
|
+
values: string[][];
|
|
194
|
+
}[];
|
|
195
|
+
};
|
|
196
|
+
warnings?: string[] | null | undefined;
|
|
197
|
+
}>;
|
|
160
198
|
export declare const connectionStringInputSchema: z.ZodObject<{
|
|
161
199
|
project_id: z.ZodString;
|
|
162
200
|
branch_id: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composed.d.ts","sourceRoot":"","sources":["../../../src/lib/ergonomic/composed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAyB,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAsD1E,eAAO,MAAM,uBAAuB;;;;;;;;;;kBAqBjC,CAAC;AAEJ,eAAO,MAAM,iCAAiC;;;;;;;;;;kBAM5C,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAEnC,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAG7C,CAAC;AAEH,eAAO,MAAM,qBAAqB;;kBAEhC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;kBAOrC,CAAC;AAIH,eAAO,MAA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AoB,GAAI,SAAS,iBAAiB;;;;;;;yDA0C7D,CAAC;AAEH,eAAO,MAAM,cAAc,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;EA8CvD,CAAC;AAEH,eAAO,MAAM,mBAAmB,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+B5D,CAAC;AAEH,eAAO,MAAM,eAAe,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;;mDA6BxD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { zBackupScheduleItem, zBranchCreateRequest, zBranchRestoreRequest, zComputeUnit, zCreateProjectBody, zCreateProjectBranchPath, zCreateProjectBranchRoleBody, zCreateProjectBranchRolePath, zGetConnectionUriPath, zGetConnectionUriQuery, zGetProjectBranchSchemaComparisonPath, zGetProjectBranchSchemaComparisonQuery, zListProjectBranchesPath, zRestoreProjectBranchPath, zRestoreSnapshotBody, zRestoreSnapshotPath, zSetSnapshotSchedulePath, zSuspendTimeoutSeconds } from "../../generated/zod.gen.js";
|
|
1
|
+
import { zBackupScheduleItem, zBranchCreateRequest, zBranchRestoreRequest, zComputeUnit, zCreateProjectBody, zCreateProjectBranchPath, zCreateProjectBranchRoleBody, zCreateProjectBranchRolePath, zGetConnectionUriPath, zGetConnectionUriQuery, zGetProjectBranchSchemaComparisonPath, zGetProjectBranchSchemaComparisonQuery, zListProjectBranchesPath, zQueryProjectBranchLogsPath, zRestoreProjectBranchPath, zRestoreSnapshotBody, zRestoreSnapshotPath, zSetSnapshotSchedulePath, zSuspendTimeoutSeconds } from "../../generated/zod.gen.js";
|
|
2
2
|
import { bindTool, publishedId } from "./bind.js";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
// src/lib/ergonomic/composed.ts
|
|
@@ -67,6 +67,46 @@ const compareSchemaInputSchema = z.strictObject({
|
|
|
67
67
|
base_lsn: compareQuery.base_lsn,
|
|
68
68
|
base_timestamp: compareQuery.base_timestamp
|
|
69
69
|
});
|
|
70
|
+
const lokiQueryRangeInputSchema = z.strictObject({
|
|
71
|
+
project_id: zQueryProjectBranchLogsPath.shape.project_id,
|
|
72
|
+
branch_id: zQueryProjectBranchLogsPath.shape.branch_id,
|
|
73
|
+
query: z.string().min(1).describe("LogQL stream selector with optional line filters, e.g. {entity_type=\"function\"} |= \"error\". The source label is entity_type. No parsers, formatting stages, or metric queries."),
|
|
74
|
+
since: z.string().describe("Lookback as a Go duration such as 30m or 24h, ending at end or now. Defaults to 1h. start takes precedence.").optional(),
|
|
75
|
+
start: z.string().describe("Window start as RFC 3339 or Unix nanoseconds.").optional(),
|
|
76
|
+
end: z.string().describe("Window end as RFC 3339 or Unix nanoseconds. Defaults to now.").optional(),
|
|
77
|
+
limit: z.number().int().positive().describe("Maximum log lines. The server enforces its own cap.").optional(),
|
|
78
|
+
direction: z.enum(["forward", "backward"]).describe("backward (default) is newest first.").optional()
|
|
79
|
+
});
|
|
80
|
+
const lokiQueryRangeTool = (options) => bindTool(options, {
|
|
81
|
+
operationId: "logs.loki.queryRange",
|
|
82
|
+
id: publishedId("logs.loki.queryRange"),
|
|
83
|
+
title: "Query branch logs (Loki)",
|
|
84
|
+
description: "Run a LogQL range query on the branch's Loki-compatible read API. Returns Loki's response: data.result groups lines by stream labels; each value is [nanosecond timestamp string, line]. No cursor: a result with limit lines, or the 10,000-line server cap (no warning), may be incomplete, so narrow the window or selector. For structured filters and cursor pagination use the logs query tool. The log fields tools list label names and values.",
|
|
85
|
+
inputSchema: lokiQueryRangeInputSchema,
|
|
86
|
+
annotations: {
|
|
87
|
+
readOnlyHint: true,
|
|
88
|
+
destructiveHint: false,
|
|
89
|
+
idempotentHint: true,
|
|
90
|
+
openWorldHint: false
|
|
91
|
+
},
|
|
92
|
+
requiresApproval: false,
|
|
93
|
+
metadata: {
|
|
94
|
+
method: "GET",
|
|
95
|
+
path: "/telemetry/v1/projects/{project_id}/branches/{branch_id}/loki/api/v1/query_range",
|
|
96
|
+
stability: "beta",
|
|
97
|
+
deprecated: false,
|
|
98
|
+
tags: ["Branch"]
|
|
99
|
+
}
|
|
100
|
+
}, (neon, input, signal) => neon.logs.loki.queryRange({
|
|
101
|
+
projectId: input.project_id,
|
|
102
|
+
branchId: input.branch_id,
|
|
103
|
+
query: input.query,
|
|
104
|
+
since: input.since,
|
|
105
|
+
start: input.start,
|
|
106
|
+
end: input.end,
|
|
107
|
+
limit: input.limit,
|
|
108
|
+
direction: input.direction
|
|
109
|
+
}, { signal }));
|
|
70
110
|
const connectionStringInputSchema = z.strictObject({
|
|
71
111
|
project_id: zGetConnectionUriPath.shape.project_id,
|
|
72
112
|
branch_id: zGetConnectionUriQuery.shape.branch_id,
|
|
@@ -355,4 +395,4 @@ const setScheduleTool = (options) => bindTool(options, {
|
|
|
355
395
|
branchId: input.branch_id,
|
|
356
396
|
schedule: input.schedule
|
|
357
397
|
}, { signal }));
|
|
358
|
-
export { compareSchemaInputSchema, compareSchemaTool, connectionStringInputSchema, connectionStringTool, createBranchAndConnectInputSchema, createBranchAndConnectTool, createBranchInputSchema, createBranchTool, createProjectAndConnectInputSchema, createProjectAndConnectTool, createProjectInputSchema, createProjectTool, createRoleInputSchema, createRoleTool, getDefaultInputSchema, getDefaultTool, resetFromParentInputSchema, resetFromParentTool, restoreSnapshotInputSchema, restoreSnapshotTool, setScheduleInputSchema, setScheduleTool };
|
|
398
|
+
export { compareSchemaInputSchema, compareSchemaTool, connectionStringInputSchema, connectionStringTool, createBranchAndConnectInputSchema, createBranchAndConnectTool, createBranchInputSchema, createBranchTool, createProjectAndConnectInputSchema, createProjectAndConnectTool, createProjectInputSchema, createProjectTool, createRoleInputSchema, createRoleTool, getDefaultInputSchema, getDefaultTool, lokiQueryRangeInputSchema, lokiQueryRangeTool, resetFromParentInputSchema, resetFromParentTool, restoreSnapshotInputSchema, restoreSnapshotTool, setScheduleInputSchema, setScheduleTool };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const hiddenToolIds: readonly ["operations.waitFor", "postgres.roles.password", "storage.objects.get", "credentials.reveal"];
|
|
1
|
+
export declare const hiddenToolIds: readonly ["operations.waitFor", "postgres.roles.password", "storage.objects.get", "credentials.reveal", "logs.loki.labels", "logs.loki.labelValues"];
|
|
2
2
|
export type HiddenToolId = (typeof hiddenToolIds)[number];
|
|
3
|
-
export declare const toolIds: readonly ["projects.list", "projects.count", "projects.get", "projects.create", "projects.createAndConnect", "projects.update", "projects.delete", "projects.recover", "projects.transfer", "projects.transferFromUser", "projects.permissions.list", "projects.permissions.grant", "projects.permissions.revoke", "projects.members.list", "projects.members.setRole", "projects.members.removeRole", "branches.list", "branches.get", "branches.create", "branches.createAndConnect", "branches.update", "branches.delete", "branches.getDefault", "branches.setDefault", "branches.resetFromParent", "branches.compareSchema", "branches.finalizeRestore", "postgres.connectionString", "postgres.endpoints.list", "postgres.endpoints.listByBranch", "postgres.endpoints.get", "postgres.endpoints.create", "postgres.endpoints.update", "postgres.endpoints.delete", "postgres.endpoints.start", "postgres.endpoints.suspend", "postgres.endpoints.restart", "postgres.roles.list", "postgres.roles.get", "postgres.roles.create", "postgres.roles.delete", "postgres.roles.resetPassword", "postgres.databases.list", "postgres.databases.get", "postgres.databases.create", "postgres.databases.update", "postgres.databases.delete", "postgres.dataApi.get", "postgres.dataApi.create", "postgres.dataApi.update", "postgres.dataApi.delete", "storage.get", "storage.buckets.list", "storage.buckets.create", "storage.buckets.delete", "storage.objects.list", "storage.objects.delete", "storage.objects.deleteByPrefix", "storage.objects.presign", "functions.list", "functions.get", "functions.update", "functions.delete", "functions.deploy", "functions.customDomains.list", "functions.customDomains.register", "functions.customDomains.delete", "triggers.list", "triggers.get", "triggers.create", "triggers.update", "triggers.delete", "credentials.list", "credentials.create", "credentials.revoke", "credentials.rotate", "aiGateway.get", "realtime.get", "realtime.enable", "realtime.disable", "realtime.secret", "realtime.rotateSecret", "logs.query", "logs.fields", "logs.fieldValues", "snapshots.list", "snapshots.create", "snapshots.update", "snapshots.delete", "snapshots.restore", "snapshots.getSchedule", "snapshots.setSchedule", "operations.list", "operations.get", "auth.get", "auth.create", "auth.disable", "auth.updateConfig", "auth.oauthProviders.list", "auth.oauthProviders.add", "auth.oauthProviders.update", "auth.oauthProviders.delete", "auth.oauthServer.get", "auth.oauthServer.update", "auth.oauthClients.list", "auth.oauthClients.get", "auth.oauthClients.create", "auth.oauthClients.update", "auth.oauthClients.delete", "auth.oauthClients.rotateSecret", "auth.trustedDomains.list", "auth.trustedDomains.add", "auth.trustedDomains.delete", "auth.users.create", "auth.users.delete", "auth.users.updateRole", "auth.allowLocalhost.get", "auth.allowLocalhost.update", "auth.emailAndPassword.get", "auth.emailAndPassword.update", "auth.emailProvider.get", "auth.emailProvider.update", "auth.emailProvider.sendTest", "auth.plugins.get", "auth.plugins.magicLink.update", "auth.plugins.organization.update", "auth.plugins.phoneNumber.get", "auth.plugins.phoneNumber.update", "auth.webhooks.get", "auth.webhooks.update", "consumption.perProject", "consumption.perProjectV2", "consumption.perBranchV2", "apiKeys.list", "apiKeys.create", "apiKeys.revoke", "organizations.get", "organizations.members.list", "organizations.members.get", "organizations.members.update", "organizations.members.remove", "organizations.invitations.list", "organizations.invitations.create", "organizations.spendingLimit.get", "organizations.spendingLimit.set", "organizations.spendingLimit.delete", "organizations.apiKeys.list", "organizations.apiKeys.create", "organizations.apiKeys.revoke", "regions.list", "user.me", "user.organizations"];
|
|
3
|
+
export declare const toolIds: readonly ["projects.list", "projects.count", "projects.get", "projects.create", "projects.createAndConnect", "projects.update", "projects.delete", "projects.recover", "projects.transfer", "projects.transferFromUser", "projects.permissions.list", "projects.permissions.grant", "projects.permissions.revoke", "projects.members.list", "projects.members.setRole", "projects.members.removeRole", "branches.list", "branches.get", "branches.create", "branches.createAndConnect", "branches.update", "branches.delete", "branches.getDefault", "branches.setDefault", "branches.resetFromParent", "branches.compareSchema", "branches.finalizeRestore", "postgres.connectionString", "postgres.endpoints.list", "postgres.endpoints.listByBranch", "postgres.endpoints.get", "postgres.endpoints.create", "postgres.endpoints.update", "postgres.endpoints.delete", "postgres.endpoints.start", "postgres.endpoints.suspend", "postgres.endpoints.restart", "postgres.roles.list", "postgres.roles.get", "postgres.roles.create", "postgres.roles.delete", "postgres.roles.resetPassword", "postgres.databases.list", "postgres.databases.get", "postgres.databases.create", "postgres.databases.update", "postgres.databases.delete", "postgres.dataApi.get", "postgres.dataApi.create", "postgres.dataApi.update", "postgres.dataApi.delete", "storage.get", "storage.buckets.list", "storage.buckets.create", "storage.buckets.delete", "storage.objects.list", "storage.objects.delete", "storage.objects.deleteByPrefix", "storage.objects.presign", "functions.list", "functions.get", "functions.update", "functions.delete", "functions.deploy", "functions.customDomains.list", "functions.customDomains.register", "functions.customDomains.delete", "triggers.list", "triggers.get", "triggers.create", "triggers.update", "triggers.delete", "credentials.list", "credentials.create", "credentials.revoke", "credentials.rotate", "aiGateway.get", "realtime.get", "realtime.enable", "realtime.disable", "realtime.secret", "realtime.rotateSecret", "logs.query", "logs.fields", "logs.fieldValues", "logs.loki.queryRange", "snapshots.list", "snapshots.create", "snapshots.update", "snapshots.delete", "snapshots.restore", "snapshots.getSchedule", "snapshots.setSchedule", "operations.list", "operations.get", "auth.get", "auth.create", "auth.disable", "auth.updateConfig", "auth.oauthProviders.list", "auth.oauthProviders.add", "auth.oauthProviders.update", "auth.oauthProviders.delete", "auth.oauthServer.get", "auth.oauthServer.update", "auth.oauthClients.list", "auth.oauthClients.get", "auth.oauthClients.create", "auth.oauthClients.update", "auth.oauthClients.delete", "auth.oauthClients.rotateSecret", "auth.trustedDomains.list", "auth.trustedDomains.add", "auth.trustedDomains.delete", "auth.users.create", "auth.users.delete", "auth.users.updateRole", "auth.allowLocalhost.get", "auth.allowLocalhost.update", "auth.emailAndPassword.get", "auth.emailAndPassword.update", "auth.emailProvider.get", "auth.emailProvider.update", "auth.emailProvider.sendTest", "auth.plugins.get", "auth.plugins.magicLink.update", "auth.plugins.organization.update", "auth.plugins.phoneNumber.get", "auth.plugins.phoneNumber.update", "auth.webhooks.get", "auth.webhooks.update", "consumption.perProject", "consumption.perProjectV2", "consumption.perBranchV2", "apiKeys.list", "apiKeys.create", "apiKeys.revoke", "organizations.get", "organizations.members.list", "organizations.members.get", "organizations.members.update", "organizations.members.remove", "organizations.invitations.list", "organizations.invitations.create", "organizations.spendingLimit.get", "organizations.spendingLimit.set", "organizations.spendingLimit.delete", "organizations.apiKeys.list", "organizations.apiKeys.create", "organizations.apiKeys.revoke", "regions.list", "user.me", "user.organizations"];
|
|
4
4
|
export type NeonToolId = (typeof toolIds)[number];
|
|
5
5
|
export declare const isNeonToolId: (id: string) => id is NeonToolId;
|
|
6
6
|
export declare const unpublishedToolError: (id: string) => TypeError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../../src/lib/ergonomic/ids.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../../src/lib/ergonomic/ids.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,sJAOhB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,eAAO,MAAM,OAAO,+tHA0JV,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAElD,eAAO,MAAM,YAAY,GAAI,IAAI,MAAM,KAAG,EAAE,IAAI,UACJ,CAAC;AAc7C,eAAO,MAAM,oBAAoB,GAAI,IAAI,MAAM,KAAG,SAOjD,CAAC"}
|
|
@@ -3,7 +3,9 @@ const hiddenToolIds = [
|
|
|
3
3
|
"operations.waitFor",
|
|
4
4
|
"postgres.roles.password",
|
|
5
5
|
"storage.objects.get",
|
|
6
|
-
"credentials.reveal"
|
|
6
|
+
"credentials.reveal",
|
|
7
|
+
"logs.loki.labels",
|
|
8
|
+
"logs.loki.labelValues"
|
|
7
9
|
];
|
|
8
10
|
const toolIds = [
|
|
9
11
|
"projects.list",
|
|
@@ -91,6 +93,7 @@ const toolIds = [
|
|
|
91
93
|
"logs.query",
|
|
92
94
|
"logs.fields",
|
|
93
95
|
"logs.fieldValues",
|
|
96
|
+
"logs.loki.queryRange",
|
|
94
97
|
"snapshots.list",
|
|
95
98
|
"snapshots.create",
|
|
96
99
|
"snapshots.update",
|
|
@@ -164,7 +167,9 @@ const hiddenToolHint = {
|
|
|
164
167
|
"operations.waitFor": "Write tools wait for readiness. operations.waitFor is not a tool.",
|
|
165
168
|
"postgres.roles.password": "Role passwords are not published as a tool.",
|
|
166
169
|
"storage.objects.get": "Object bytes are not published as a tool.",
|
|
167
|
-
"credentials.reveal": "Credential secrets are not published as a tool."
|
|
170
|
+
"credentials.reveal": "Credential secrets are not published as a tool.",
|
|
171
|
+
"logs.loki.labels": "Loki labels are the log fields. Use logs.fields to discover them.",
|
|
172
|
+
"logs.loki.labelValues": "Loki label values are log field values. Use logs.fieldValues to list them."
|
|
168
173
|
};
|
|
169
174
|
const unpublishedToolError = (id) => {
|
|
170
175
|
if (hiddenToolIds.includes(id)) return /* @__PURE__ */ new TypeError(`Neon tool "${id}" is not published. ${hiddenToolHint[id]}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neon/tools",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "Agent tools for the Neon SDK ergonomic client, compatible with MCP, Eve, and Mastra.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"neon",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
],
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"zod": "^4.5.4",
|
|
72
|
-
"@neon/sdk": "7.
|
|
72
|
+
"@neon/sdk": "7.11.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@hey-api/openapi-ts": "0.98.2",
|