@okrlinkhub/agent-bridge 0.1.0 → 2.0.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 +96 -127
- package/dist/cli/init.d.ts +3 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +100 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/client/index.d.ts +50 -173
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +129 -263
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/api.d.ts +4 -4
- package/dist/component/_generated/api.d.ts.map +1 -1
- package/dist/component/_generated/component.d.ts +66 -162
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/agentBridgeUtils.d.ts +8 -0
- package/dist/component/agentBridgeUtils.d.ts.map +1 -0
- package/dist/component/agentBridgeUtils.js +33 -0
- package/dist/component/agentBridgeUtils.js.map +1 -0
- package/dist/component/agents.d.ts +27 -0
- package/dist/component/agents.d.ts.map +1 -0
- package/dist/component/agents.js +94 -0
- package/dist/component/agents.js.map +1 -0
- package/dist/component/gateway.d.ts +30 -44
- package/dist/component/gateway.d.ts.map +1 -1
- package/dist/component/gateway.js +127 -132
- package/dist/component/gateway.js.map +1 -1
- package/dist/component/permissions.d.ts +30 -84
- package/dist/component/permissions.d.ts.map +1 -1
- package/dist/component/permissions.js +80 -203
- package/dist/component/permissions.js.map +1 -1
- package/dist/component/schema.d.ts +55 -153
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/schema.js +30 -80
- package/dist/component/schema.js.map +1 -1
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +2 -3
- package/dist/react/index.js.map +1 -1
- package/package.json +7 -3
- package/src/cli/init.ts +116 -0
- package/src/client/index.ts +228 -389
- package/src/component/_generated/api.ts +4 -4
- package/src/component/_generated/component.ts +79 -195
- package/src/component/agentBridgeUtils.ts +52 -0
- package/src/component/agents.ts +106 -0
- package/src/component/gateway.ts +149 -163
- package/src/component/permissions.ts +89 -259
- package/src/component/schema.ts +31 -96
- package/src/react/index.ts +5 -6
- package/dist/component/provisioning.d.ts +0 -87
- package/dist/component/provisioning.d.ts.map +0 -1
- package/dist/component/provisioning.js +0 -343
- package/dist/component/provisioning.js.map +0 -1
- package/dist/component/registry.d.ts +0 -46
- package/dist/component/registry.d.ts.map +0 -1
- package/dist/component/registry.js +0 -121
- package/dist/component/registry.js.map +0 -1
- package/src/component/provisioning.ts +0 -402
- package/src/component/registry.ts +0 -152
package/dist/client/index.js
CHANGED
|
@@ -1,308 +1,174 @@
|
|
|
1
1
|
import { httpActionGeneric } from "convex/server";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
appName;
|
|
17
|
-
defaultPermissions;
|
|
18
|
-
constructor(component, config) {
|
|
19
|
-
this.component = component;
|
|
20
|
-
this.appName = config.appName;
|
|
21
|
-
this.defaultPermissions = config.defaultPermissions ?? [
|
|
22
|
-
{ pattern: "*", permission: "deny" },
|
|
23
|
-
];
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Initialize the component configuration.
|
|
27
|
-
* Should be called once during app setup (e.g. in a seed/setup mutation).
|
|
28
|
-
*/
|
|
29
|
-
async configure(ctx) {
|
|
30
|
-
await ctx.runMutation(this.component.provisioning.configure, {
|
|
31
|
-
appName: this.appName,
|
|
32
|
-
defaultPermissions: this.defaultPermissions,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Register a function that agents can call.
|
|
37
|
-
* The host app must create the function handle via createFunctionHandle().
|
|
38
|
-
*/
|
|
39
|
-
async registerFunction(ctx, fn) {
|
|
40
|
-
return await ctx.runMutation(this.component.registry.register, {
|
|
41
|
-
appName: this.appName,
|
|
42
|
-
functionName: fn.name,
|
|
43
|
-
functionHandle: fn.handle,
|
|
44
|
-
functionType: fn.type,
|
|
45
|
-
description: fn.description,
|
|
46
|
-
});
|
|
2
|
+
export function defineAgentBridgeConfig(config) {
|
|
3
|
+
return config;
|
|
4
|
+
}
|
|
5
|
+
export function generateAgentApiKey(prefix = "abk_live") {
|
|
6
|
+
const bytes = new Uint8Array(24);
|
|
7
|
+
crypto.getRandomValues(bytes);
|
|
8
|
+
const token = Array.from(bytes)
|
|
9
|
+
.map((byte) => byte.toString(16).padStart(2, "0"))
|
|
10
|
+
.join("");
|
|
11
|
+
return `${prefix}_${token}`;
|
|
12
|
+
}
|
|
13
|
+
export function detectFunctionType(fnRef) {
|
|
14
|
+
if (!fnRef || typeof fnRef !== "object") {
|
|
15
|
+
return null;
|
|
47
16
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const id = await this.registerFunction(ctx, fn);
|
|
55
|
-
ids.push(id);
|
|
17
|
+
if ("_type" in fnRef) {
|
|
18
|
+
const candidate = fnRef._type;
|
|
19
|
+
if (candidate === "query" ||
|
|
20
|
+
candidate === "mutation" ||
|
|
21
|
+
candidate === "action") {
|
|
22
|
+
return candidate;
|
|
56
23
|
}
|
|
57
|
-
return ids;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Unregister a function.
|
|
61
|
-
*/
|
|
62
|
-
async unregisterFunction(ctx, functionName) {
|
|
63
|
-
return await ctx.runMutation(this.component.registry.unregister, {
|
|
64
|
-
appName: this.appName,
|
|
65
|
-
functionName,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* List all registered functions for this app.
|
|
70
|
-
*/
|
|
71
|
-
async listFunctions(ctx) {
|
|
72
|
-
return await ctx.runQuery(this.component.registry.listFunctions, {
|
|
73
|
-
appName: this.appName,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Generate a provisioning token (admin operation).
|
|
78
|
-
* Returns the plaintext token -- store/communicate securely!
|
|
79
|
-
*/
|
|
80
|
-
async generateProvisioningToken(ctx, opts) {
|
|
81
|
-
return await ctx.runMutation(this.component.provisioning.generateProvisioningToken, opts);
|
|
82
24
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Revoke an agent globally.
|
|
93
|
-
*/
|
|
94
|
-
async revokeAgent(ctx, opts) {
|
|
95
|
-
return await ctx.runMutation(this.component.provisioning.revokeAgent, opts);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Revoke a specific app instance for an agent.
|
|
99
|
-
*/
|
|
100
|
-
async revokeAppInstance(ctx, opts) {
|
|
101
|
-
return await ctx.runMutation(this.component.provisioning.revokeAppInstance, {
|
|
102
|
-
agentId: opts.agentId,
|
|
103
|
-
appName: this.appName,
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Set a permission for an agent.
|
|
108
|
-
*/
|
|
109
|
-
async setPermission(ctx, opts) {
|
|
110
|
-
return await ctx.runMutation(this.component.permissions.setPermission, {
|
|
111
|
-
agentId: opts.agentId,
|
|
112
|
-
appName: this.appName,
|
|
113
|
-
functionPattern: opts.functionPattern,
|
|
114
|
-
permission: opts.permission,
|
|
115
|
-
rateLimitConfig: opts.rateLimitConfig,
|
|
116
|
-
createdBy: opts.createdBy,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Remove a permission for an agent.
|
|
121
|
-
*/
|
|
122
|
-
async removePermission(ctx, opts) {
|
|
123
|
-
return await ctx.runMutation(this.component.permissions.removePermission, {
|
|
124
|
-
agentId: opts.agentId,
|
|
125
|
-
appName: this.appName,
|
|
126
|
-
functionPattern: opts.functionPattern,
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* List permissions for an agent on this app.
|
|
131
|
-
*/
|
|
132
|
-
async listPermissions(ctx, agentId) {
|
|
133
|
-
return await ctx.runQuery(this.component.permissions.listPermissions, {
|
|
134
|
-
agentId,
|
|
135
|
-
appName: this.appName,
|
|
136
|
-
});
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
export function normalizeAgentBridgeConfig(config) {
|
|
28
|
+
const functionEntries = Object.entries(config.functions);
|
|
29
|
+
if (functionEntries.length === 0) {
|
|
30
|
+
throw new Error("agent-bridge config requires at least one function");
|
|
137
31
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
32
|
+
const normalizedFunctions = {};
|
|
33
|
+
for (const [functionKey, entry] of functionEntries) {
|
|
34
|
+
if (!functionKey.trim()) {
|
|
35
|
+
throw new Error("function keys cannot be empty");
|
|
36
|
+
}
|
|
37
|
+
const metadata = config.metadata?.[functionKey];
|
|
38
|
+
const hasExplicitConfig = entry && typeof entry === "object" && "ref" in entry;
|
|
39
|
+
const ref = hasExplicitConfig
|
|
40
|
+
? entry.ref
|
|
41
|
+
: entry;
|
|
42
|
+
const explicitType = hasExplicitConfig
|
|
43
|
+
? entry.type
|
|
44
|
+
: undefined;
|
|
45
|
+
const detectedType = detectFunctionType(ref);
|
|
46
|
+
const functionType = explicitType ?? detectedType;
|
|
47
|
+
if (!functionType) {
|
|
48
|
+
throw new Error(`Cannot detect function type for "${functionKey}". Set { ref, type } explicitly in agent-bridge config.`);
|
|
49
|
+
}
|
|
50
|
+
normalizedFunctions[functionKey] = {
|
|
51
|
+
ref,
|
|
52
|
+
type: functionType,
|
|
53
|
+
metadata,
|
|
54
|
+
};
|
|
147
55
|
}
|
|
56
|
+
return { functions: normalizedFunctions };
|
|
148
57
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
* provision themselves, and check health.
|
|
154
|
-
*
|
|
155
|
-
* Must be called in the host app's `convex/http.ts` file.
|
|
156
|
-
*
|
|
157
|
-
* @example
|
|
158
|
-
* ```ts
|
|
159
|
-
* import { httpRouter } from "convex/server";
|
|
160
|
-
* import { registerRoutes } from "@okrlinkhub/agent-bridge";
|
|
161
|
-
* import { components } from "./_generated/api";
|
|
162
|
-
*
|
|
163
|
-
* const http = httpRouter();
|
|
164
|
-
* registerRoutes(http, components.agentBridge, { appName: "okr" });
|
|
165
|
-
* export default http;
|
|
166
|
-
* ```
|
|
167
|
-
*/
|
|
168
|
-
export function registerRoutes(http, component, config) {
|
|
169
|
-
const prefix = config.pathPrefix ?? "/agent-bridge";
|
|
170
|
-
// --- POST /agent-bridge/execute ---
|
|
171
|
-
// Gateway: execute a registered function on behalf of an agent
|
|
58
|
+
export function registerRoutes(http, component, bridgeConfig, options) {
|
|
59
|
+
const prefix = options?.pathPrefix ?? "/agent";
|
|
60
|
+
const normalizedConfig = normalizeAgentBridgeConfig(bridgeConfig);
|
|
61
|
+
const availableFunctionKeys = Object.keys(normalizedConfig.functions);
|
|
172
62
|
http.route({
|
|
173
63
|
path: `${prefix}/execute`,
|
|
174
64
|
method: "POST",
|
|
175
65
|
handler: httpActionGeneric(async (ctx, request) => {
|
|
66
|
+
const apiKey = request.headers.get("X-Agent-API-Key");
|
|
67
|
+
if (!apiKey) {
|
|
68
|
+
return jsonResponse({ success: false, error: "Missing API key" }, 401);
|
|
69
|
+
}
|
|
176
70
|
let body;
|
|
177
71
|
try {
|
|
178
72
|
body = await request.json();
|
|
179
73
|
}
|
|
180
74
|
catch {
|
|
181
|
-
return jsonResponse({ error: "Invalid JSON body" }, 400);
|
|
75
|
+
return jsonResponse({ success: false, error: "Invalid JSON body" }, 400);
|
|
76
|
+
}
|
|
77
|
+
const functionKey = body.functionKey?.trim();
|
|
78
|
+
if (!functionKey) {
|
|
79
|
+
return jsonResponse({ success: false, error: "Missing required field: functionKey" }, 400);
|
|
182
80
|
}
|
|
183
|
-
const
|
|
184
|
-
if (!
|
|
185
|
-
return jsonResponse({
|
|
81
|
+
const functionDef = normalizedConfig.functions[functionKey];
|
|
82
|
+
if (!functionDef) {
|
|
83
|
+
return jsonResponse({ success: false, error: `Function "${functionKey}" not found` }, 404);
|
|
186
84
|
}
|
|
187
|
-
// Step 1: Authorize the request (mutation -- validates token, checks permissions,
|
|
188
|
-
// updates counters, returns function handle)
|
|
189
85
|
const authResult = await ctx.runMutation(component.gateway.authorizeRequest, {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
86
|
+
apiKey,
|
|
87
|
+
functionKey,
|
|
88
|
+
estimatedCost: body.estimatedCost,
|
|
193
89
|
});
|
|
194
90
|
if (!authResult.authorized) {
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
agentId: authResult.agentId ?? "unknown",
|
|
201
|
-
appName: config.appName,
|
|
202
|
-
functionCalled: functionName,
|
|
203
|
-
permission: "deny",
|
|
204
|
-
errorMessage: authResult.error + detailSuffix,
|
|
205
|
-
});
|
|
206
|
-
return jsonResponse({ error: authResult.error }, authResult.statusCode);
|
|
91
|
+
const response = jsonResponse({ success: false, error: authResult.error }, authResult.statusCode);
|
|
92
|
+
if (authResult.statusCode === 429) {
|
|
93
|
+
response.headers.set("Retry-After", String(authResult.retryAfterSeconds ?? 3600));
|
|
94
|
+
}
|
|
95
|
+
return response;
|
|
207
96
|
}
|
|
208
|
-
// Step 2: Execute the function via the registered handle
|
|
209
97
|
const startTime = Date.now();
|
|
210
98
|
try {
|
|
99
|
+
const args = body.args ?? {};
|
|
211
100
|
let result;
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
result = await ctx.runAction(authResult.functionHandle, args ?? {});
|
|
221
|
-
break;
|
|
101
|
+
if (functionDef.type === "query") {
|
|
102
|
+
result = await ctx.runQuery(functionDef.ref, args);
|
|
103
|
+
}
|
|
104
|
+
else if (functionDef.type === "mutation") {
|
|
105
|
+
result = await ctx.runMutation(functionDef.ref, args);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
result = await ctx.runAction(functionDef.ref, args);
|
|
222
109
|
}
|
|
223
|
-
const durationMs = Date.now() - startTime;
|
|
224
|
-
// Step 3: Log successful access
|
|
225
110
|
await ctx.runMutation(component.gateway.logAccess, {
|
|
226
111
|
agentId: authResult.agentId,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
112
|
+
functionKey,
|
|
113
|
+
args,
|
|
114
|
+
result,
|
|
115
|
+
duration: Date.now() - startTime,
|
|
116
|
+
timestamp: Date.now(),
|
|
231
117
|
});
|
|
232
|
-
return jsonResponse({
|
|
118
|
+
return jsonResponse({ success: true, result }, 200);
|
|
233
119
|
}
|
|
234
120
|
catch (error) {
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
121
|
+
const errorMessage = error && typeof error === "object" && "message" in error
|
|
122
|
+
? error.message
|
|
123
|
+
: "Unknown error";
|
|
238
124
|
await ctx.runMutation(component.gateway.logAccess, {
|
|
239
125
|
agentId: authResult.agentId,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
});
|
|
246
|
-
return jsonResponse({ error: errorMessage }, 500);
|
|
247
|
-
}
|
|
248
|
-
}),
|
|
249
|
-
});
|
|
250
|
-
// --- POST /agent-bridge/provision ---
|
|
251
|
-
// Agent self-provisioning endpoint
|
|
252
|
-
http.route({
|
|
253
|
-
path: `${prefix}/provision`,
|
|
254
|
-
method: "POST",
|
|
255
|
-
handler: httpActionGeneric(async (ctx, request) => {
|
|
256
|
-
let body;
|
|
257
|
-
try {
|
|
258
|
-
body = await request.json();
|
|
259
|
-
}
|
|
260
|
-
catch {
|
|
261
|
-
return jsonResponse({ error: "Invalid JSON body" }, 400);
|
|
262
|
-
}
|
|
263
|
-
const { provisioningToken } = body;
|
|
264
|
-
if (!provisioningToken) {
|
|
265
|
-
return jsonResponse({ error: "Missing required field: provisioningToken" }, 400);
|
|
266
|
-
}
|
|
267
|
-
try {
|
|
268
|
-
const result = await ctx.runMutation(component.provisioning.provisionAgent, {
|
|
269
|
-
provisioningToken,
|
|
270
|
-
appName: config.appName,
|
|
126
|
+
functionKey,
|
|
127
|
+
args: body.args ?? {},
|
|
128
|
+
error: errorMessage,
|
|
129
|
+
duration: Date.now() - startTime,
|
|
130
|
+
timestamp: Date.now(),
|
|
271
131
|
});
|
|
272
|
-
return jsonResponse(
|
|
273
|
-
}
|
|
274
|
-
catch (error) {
|
|
275
|
-
const errorMessage = error instanceof Error ? error.message : "Provisioning failed";
|
|
276
|
-
return jsonResponse({ error: errorMessage }, 400);
|
|
132
|
+
return jsonResponse({ success: false, error: errorMessage }, 500);
|
|
277
133
|
}
|
|
278
134
|
}),
|
|
279
135
|
});
|
|
280
|
-
// --- GET /agent-bridge/health ---
|
|
281
|
-
// Health check endpoint
|
|
282
136
|
http.route({
|
|
283
|
-
path: `${prefix}/
|
|
137
|
+
path: `${prefix}/functions`,
|
|
284
138
|
method: "GET",
|
|
285
|
-
handler: httpActionGeneric(async (
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
timestamp: Date.now(),
|
|
293
|
-
}, 200);
|
|
294
|
-
}
|
|
295
|
-
catch {
|
|
296
|
-
return jsonResponse({
|
|
297
|
-
status: "error",
|
|
298
|
-
appName: config.appName,
|
|
299
|
-
timestamp: Date.now(),
|
|
300
|
-
}, 500);
|
|
301
|
-
}
|
|
139
|
+
handler: httpActionGeneric(async () => {
|
|
140
|
+
const functions = availableFunctionKeys.map((functionKey) => ({
|
|
141
|
+
functionKey,
|
|
142
|
+
type: normalizedConfig.functions[functionKey].type,
|
|
143
|
+
metadata: normalizedConfig.functions[functionKey].metadata,
|
|
144
|
+
}));
|
|
145
|
+
return jsonResponse({ functions }, 200);
|
|
302
146
|
}),
|
|
303
147
|
});
|
|
304
148
|
}
|
|
305
|
-
|
|
149
|
+
export async function setAgentPermissions(ctx, component, args) {
|
|
150
|
+
const availableFunctionKeys = Object.keys(args.config.functions);
|
|
151
|
+
return await ctx.runMutation(component.permissions.setAgentPermissions, {
|
|
152
|
+
agentId: args.agentId,
|
|
153
|
+
rules: args.rules,
|
|
154
|
+
availableFunctionKeys,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
export async function setFunctionOverrides(ctx, component, args) {
|
|
158
|
+
const availableFunctionKeys = Object.keys(args.config.functions);
|
|
159
|
+
return await ctx.runMutation(component.permissions.setFunctionOverrides, {
|
|
160
|
+
overrides: args.overrides,
|
|
161
|
+
availableFunctionKeys,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
export function listConfiguredFunctions(config) {
|
|
165
|
+
const normalizedConfig = normalizeAgentBridgeConfig(config);
|
|
166
|
+
return Object.entries(normalizedConfig.functions).map(([functionKey, functionDef]) => ({
|
|
167
|
+
functionKey,
|
|
168
|
+
type: functionDef.type,
|
|
169
|
+
metadata: functionDef.metadata,
|
|
170
|
+
}));
|
|
171
|
+
}
|
|
306
172
|
function jsonResponse(data, status) {
|
|
307
173
|
return new Response(JSON.stringify(data), {
|
|
308
174
|
status,
|
package/dist/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAgClD,MAAM,UAAU,uBAAuB,CACrC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IAAI,CAAC,EAAE;QACxC,MAAM;QACN,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;KAChD,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
* To regenerate, run `npx convex dev`.
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
|
+
import type * as agentBridgeUtils from "../agentBridgeUtils.js";
|
|
10
|
+
import type * as agents from "../agents.js";
|
|
9
11
|
import type * as gateway from "../gateway.js";
|
|
10
12
|
import type * as permissions from "../permissions.js";
|
|
11
|
-
import type * as provisioning from "../provisioning.js";
|
|
12
|
-
import type * as registry from "../registry.js";
|
|
13
13
|
import type { ApiFromModules, FilterApi, FunctionReference } from "convex/server";
|
|
14
14
|
declare const fullApi: ApiFromModules<{
|
|
15
|
+
agentBridgeUtils: typeof agentBridgeUtils;
|
|
16
|
+
agents: typeof agents;
|
|
15
17
|
gateway: typeof gateway;
|
|
16
18
|
permissions: typeof permissions;
|
|
17
|
-
provisioning: typeof provisioning;
|
|
18
|
-
registry: typeof registry;
|
|
19
19
|
}>;
|
|
20
20
|
/**
|
|
21
21
|
* A utility for referencing Convex functions in your app's public API.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,KAAK,MAAM,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,KAAK,WAAW,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAGvB,QAAA,MAAM,OAAO,EAAE,cAAc,CAAC;IAC5B,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,WAAW,EAAE,OAAO,WAAW,CAAC;CACjC,CAAiB,CAAC;AAEnB;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,EAAE,SAAS,CACzB,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,QAAQ,CAAC,CACjB,CAAC;AAElB;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,CAC9B,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,CACnB,CAAC;AAElB,eAAO,MAAM,UAAU,EAAqC,EAAE,CAAC"}
|