veryfront 0.1.218 → 0.1.220

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 (34) hide show
  1. package/esm/cli/commands/init/config-generator.d.ts +13 -1
  2. package/esm/cli/commands/init/config-generator.d.ts.map +1 -1
  3. package/esm/cli/commands/init/config-generator.js +15 -1
  4. package/esm/cli/commands/init/init-command.d.ts.map +1 -1
  5. package/esm/cli/commands/init/init-command.js +9 -2
  6. package/esm/deno.d.ts +0 -1
  7. package/esm/deno.js +1 -2
  8. package/esm/src/agent/ag-ui-detached-start.d.ts +98 -0
  9. package/esm/src/agent/ag-ui-detached-start.d.ts.map +1 -0
  10. package/esm/src/agent/ag-ui-detached-start.js +299 -0
  11. package/esm/src/agent/index.d.ts +1 -0
  12. package/esm/src/agent/index.d.ts.map +1 -1
  13. package/esm/src/agent/index.js +1 -0
  14. package/esm/src/integrations/_data.js +1 -1
  15. package/esm/src/integrations/schema.d.ts +1 -0
  16. package/esm/src/integrations/schema.d.ts.map +1 -1
  17. package/esm/src/integrations/schema.js +8 -0
  18. package/esm/src/server/runtime-handler/request-tracker.d.ts.map +1 -1
  19. package/esm/src/server/runtime-handler/request-tracker.js +5 -6
  20. package/esm/src/server/runtime-handler/request-utils.d.ts.map +1 -1
  21. package/esm/src/server/runtime-handler/request-utils.js +1 -0
  22. package/esm/src/utils/version-constant.d.ts +1 -1
  23. package/esm/src/utils/version-constant.js +1 -1
  24. package/package.json +1 -1
  25. package/src/cli/commands/init/config-generator.ts +33 -0
  26. package/src/cli/commands/init/init-command.ts +9 -2
  27. package/src/deno.js +1 -2
  28. package/src/src/agent/ag-ui-detached-start.ts +453 -0
  29. package/src/src/agent/index.ts +8 -0
  30. package/src/src/integrations/_data.ts +1 -1
  31. package/src/src/integrations/schema.ts +8 -0
  32. package/src/src/server/runtime-handler/request-tracker.ts +5 -7
  33. package/src/src/server/runtime-handler/request-utils.ts +1 -0
  34. package/src/src/utils/version-constant.ts +1 -1
@@ -1,2 +1,14 @@
1
- export declare function createPackageJson(projectDir: string, projectName?: string): Promise<void>;
1
+ export interface CreatePackageJsonOptions {
2
+ /**
3
+ * Selected integrations whose `connector.json#npmDependencies` should be
4
+ * merged into the generated project's `package.json#dependencies`.
5
+ * First declaration wins on version collisions; framework pins
6
+ * (react, react-dom, veryfront, zod) always take precedence.
7
+ */
8
+ integrations?: Array<{
9
+ name: string;
10
+ npmDependencies?: Record<string, string>;
11
+ }>;
12
+ }
13
+ export declare function createPackageJson(projectDir: string, projectName?: string, options?: CreatePackageJsonOptions): Promise<void>;
2
14
  //# sourceMappingURL=config-generator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-generator.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/config-generator.ts"],"names":[],"mappings":"AAOA,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,MAAM,EAClB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAuCf"}
1
+ {"version":3,"file":"config-generator.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/config-generator.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC1C,CAAC,CAAC;CACJ;AAED,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,MAAM,EAClB,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,IAAI,CAAC,CA0Df"}
@@ -3,7 +3,7 @@ import { join } from "../../../src/platform/compat/path/index.js";
3
3
  import { createFileSystem } from "../../../src/platform/index.js";
4
4
  // Keep init scaffold aligned with current framework default React major/minor.
5
5
  const DEFAULT_INIT_REACT_VERSION = "19.1.1";
6
- export async function createPackageJson(projectDir, projectName) {
6
+ export async function createPackageJson(projectDir, projectName, options = {}) {
7
7
  const fs = createFileSystem();
8
8
  // Read any existing package.json (e.g. from template) to merge dependencies
9
9
  let templateDeps = {};
@@ -12,6 +12,19 @@ export async function createPackageJson(projectDir, projectName) {
12
12
  const existing = JSON.parse(await fs.readTextFile(pkgPath));
13
13
  templateDeps = existing.dependencies ?? {};
14
14
  }
15
+ // Merge per-integration deps. First declaration wins; collisions are logged.
16
+ const integrationDeps = {};
17
+ for (const integration of options.integrations ?? []) {
18
+ for (const [pkg, range] of Object.entries(integration.npmDependencies ?? {})) {
19
+ if (pkg in integrationDeps) {
20
+ if (integrationDeps[pkg] !== range) {
21
+ logger.warn(`[init] ${integration.name} requested ${pkg}@${range} but ${pkg}@${integrationDeps[pkg]} is already pinned by an earlier integration - keeping the earlier pin`);
22
+ }
23
+ continue;
24
+ }
25
+ integrationDeps[pkg] = range;
26
+ }
27
+ }
15
28
  const dirName = projectDir.split(/[/\\]/).pop();
16
29
  const packageJson = {
17
30
  name: projectName ?? dirName ?? "veryfront-project",
@@ -27,6 +40,7 @@ export async function createPackageJson(projectDir, projectName) {
27
40
  },
28
41
  dependencies: {
29
42
  ...templateDeps,
43
+ ...integrationDeps,
30
44
  react: `^${DEFAULT_INIT_REACT_VERSION}`,
31
45
  "react-dom": `^${DEFAULT_INIT_REACT_VERSION}`,
32
46
  veryfront: `^${VERSION}`,
@@ -1 +1 @@
1
- {"version":3,"file":"init-command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/init-command.ts"],"names":[],"mappings":"AAAA;;;iCAGiC;AAUjC,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,YAAY,CAAC;AAmK5D;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA2XrE"}
1
+ {"version":3,"file":"init-command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/init-command.ts"],"names":[],"mappings":"AAAA;;;iCAGiC;AAUjC,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,YAAY,CAAC;AAmK5D;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAkYrE"}
@@ -210,6 +210,7 @@ export async function initCommand(options) {
210
210
  }
211
211
  const allEnvVars = templateConfig?.envVars ? [...templateConfig.envVars] : [];
212
212
  const featureTips = [];
213
+ let loadedIntegrations = [];
213
214
  if (features.length) {
214
215
  const { ordered, errors } = await resolveFeatures(features);
215
216
  if (errors.length) {
@@ -242,7 +243,8 @@ export async function initCommand(options) {
242
243
  const baseConfig = await loadIntegrationBaseConfig();
243
244
  if (baseConfig?.envVars)
244
245
  allEnvVars.push(...baseConfig.envVars);
245
- const { integrations: loadedIntegrations, files: integrationFiles, errors: integrationErrors, } = await loadIntegrations(integrations);
246
+ const { integrations: resolvedIntegrations, files: integrationFiles, errors: integrationErrors, } = await loadIntegrations(integrations);
247
+ loadedIntegrations = resolvedIntegrations;
246
248
  if (integrationErrors.length) {
247
249
  for (const error of integrationErrors)
248
250
  logger.warn(error);
@@ -280,7 +282,12 @@ export async function initCommand(options) {
280
282
  }
281
283
  // Skip in quiet/TUI mode since local dev uses CDN and package.json can cause hydration issues
282
284
  if (!options.quiet) {
283
- await createPackageJson(projectDir, projectName);
285
+ await createPackageJson(projectDir, projectName, {
286
+ integrations: loadedIntegrations.map((integration) => ({
287
+ name: integration.config.name,
288
+ npmDependencies: integration.config.npmDependencies,
289
+ })),
290
+ });
284
291
  }
285
292
  if (allEnvVars.length) {
286
293
  const envResult = await promptForEnvVars(dedupeEnvVars(allEnvVars), {
package/esm/deno.d.ts CHANGED
@@ -251,7 +251,6 @@ declare namespace _default {
251
251
  "tailwindcss/plugin": string;
252
252
  "tailwindcss/defaultTheme": string;
253
253
  "tailwindcss/colors": string;
254
- pg: string;
255
254
  "@opentelemetry/api": string;
256
255
  "@opentelemetry/core": string;
257
256
  "@opentelemetry/context-async-hooks": string;
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.218",
3
+ "version": "0.1.220",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "workspace": [
@@ -264,7 +264,6 @@ export default {
264
264
  "tailwindcss/plugin": "https://esm.sh/tailwindcss@4.2.2/plugin",
265
265
  "tailwindcss/defaultTheme": "https://esm.sh/tailwindcss@4.2.2/defaultTheme",
266
266
  "tailwindcss/colors": "https://esm.sh/tailwindcss@4.2.2/colors",
267
- "pg": "npm:pg@8.13.1",
268
267
  "@opentelemetry/api": "npm:@opentelemetry/api@1.9.0",
269
268
  "@opentelemetry/core": "npm:@opentelemetry/core@2.6.0",
270
269
  "@opentelemetry/context-async-hooks": "npm:@opentelemetry/context-async-hooks@2.6.0",
@@ -0,0 +1,98 @@
1
+ import { z } from "zod";
2
+ import { type RunResumeSessionManager } from "./runtime/index.js";
3
+ import type { Agent } from "./types.js";
4
+ type AgUiResumeValue = {
5
+ result: unknown;
6
+ isError: boolean;
7
+ };
8
+ type AgUiContextValue = Record<string, unknown> | ((request: Request) => Record<string, unknown> | Promise<Record<string, unknown>>);
9
+ export declare const AgUiDetachedStartRequestSchema: z.ZodObject<{
10
+ messages: z.ZodArray<z.ZodObject<{
11
+ id: z.ZodString;
12
+ role: z.ZodEnum<{
13
+ tool: "tool";
14
+ user: "user";
15
+ assistant: "assistant";
16
+ system: "system";
17
+ }>;
18
+ parts: z.ZodDefault<z.ZodArray<z.ZodObject<{
19
+ type: z.ZodString;
20
+ }, z.core.$loose>>>;
21
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
22
+ createdAt: z.ZodOptional<z.ZodString>;
23
+ }, z.core.$strip>>;
24
+ tools: z.ZodDefault<z.ZodArray<z.ZodObject<{
25
+ name: z.ZodString;
26
+ description: z.ZodOptional<z.ZodString>;
27
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
28
+ }, z.core.$strip>>>;
29
+ context: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
30
+ type: z.ZodLiteral<"text">;
31
+ title: z.ZodOptional<z.ZodString>;
32
+ text: z.ZodString;
33
+ }, z.core.$strip>, z.ZodObject<{
34
+ type: z.ZodLiteral<"json">;
35
+ title: z.ZodOptional<z.ZodString>;
36
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
37
+ }, z.core.$strip>, z.ZodObject<{
38
+ type: z.ZodLiteral<"resource">;
39
+ title: z.ZodOptional<z.ZodString>;
40
+ uri: z.ZodString;
41
+ mimeType: z.ZodOptional<z.ZodString>;
42
+ text: z.ZodOptional<z.ZodString>;
43
+ }, z.core.$strip>], "type">>>;
44
+ forwardedProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
45
+ model: z.ZodOptional<z.ZodString>;
46
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
47
+ threadId: z.ZodString;
48
+ runId: z.ZodString;
49
+ }, z.core.$strip>;
50
+ export declare const AgUiDetachedStartAcceptedSchema: z.ZodObject<{
51
+ accepted: z.ZodLiteral<true>;
52
+ duplicate: z.ZodBoolean;
53
+ runId: z.ZodString;
54
+ threadId: z.ZodString;
55
+ }, z.core.$strip>;
56
+ export type AgUiDetachedStartRequest = z.infer<typeof AgUiDetachedStartRequestSchema>;
57
+ export type AgUiDetachedStartAccepted = z.infer<typeof AgUiDetachedStartAcceptedSchema>;
58
+ interface AgUiDetachedStartExecutionInput {
59
+ request: AgUiDetachedStartRequest;
60
+ requestOrCtx: unknown;
61
+ rawRequest: Request;
62
+ context: Record<string, unknown>;
63
+ abortSignal: AbortSignal;
64
+ }
65
+ type AgUiDetachedExecutionStarter = (input: AgUiDetachedStartExecutionInput) => Promise<void> | void;
66
+ interface AgUiDetachedStartHandlerOptionsBase {
67
+ sessionManager: RunResumeSessionManager<AgUiResumeValue>;
68
+ context?: AgUiContextValue;
69
+ startDetachedExecution?: AgUiDetachedExecutionStarter;
70
+ onAccepted?: (input: {
71
+ request: AgUiDetachedStartRequest;
72
+ runId: string;
73
+ threadId: string;
74
+ }) => Promise<void> | void;
75
+ onDuplicate?: (input: {
76
+ request: AgUiDetachedStartRequest;
77
+ runId: string;
78
+ threadId: string;
79
+ }) => Promise<void> | void;
80
+ onFinish?: (input: {
81
+ runId: string;
82
+ threadId: string;
83
+ }) => Promise<void> | void;
84
+ onError?: (input: {
85
+ runId: string;
86
+ threadId: string;
87
+ error: unknown;
88
+ }) => Promise<void> | void;
89
+ }
90
+ export type AgUiDetachedStartHandlerOptions = (AgUiDetachedStartHandlerOptionsBase & {
91
+ agent: Agent;
92
+ }) | (AgUiDetachedStartHandlerOptionsBase & {
93
+ agent?: undefined;
94
+ startDetachedExecution: AgUiDetachedExecutionStarter;
95
+ });
96
+ export declare function createAgUiDetachedStartHandler(options: AgUiDetachedStartHandlerOptions): (requestOrCtx: unknown) => Promise<Response>;
97
+ export {};
98
+ //# sourceMappingURL=ag-ui-detached-start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ag-ui-detached-start.d.ts","sourceRoot":"","sources":["../../../src/src/agent/ag-ui-detached-start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,KAAK,EAAW,MAAM,YAAY,CAAC;AAMjD,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,gBAAgB,GACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvB,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,C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AAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAChF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAChG;AAED,MAAM,MAAM,+BAA+B,GACvC,CAAC,mCAAmC,GAAG;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC,GACxD,CAAC,mCAAmC,GAAG;IACvC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,sBAAsB,EAAE,4BAA4B,CAAC;CACtD,CAAC,CAAC;AA0BL,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,+BAA+B,GACvC,CAAC,YAAY,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAwH9C"}
@@ -0,0 +1,299 @@
1
+ import { z } from "zod";
2
+ import { INVALID_ARGUMENT } from "../errors/index.js";
3
+ import { SKILL_TOOL_IDS } from "../skill/types.js";
4
+ import { toolRegistry } from "../tool/index.js";
5
+ import { streamDataStreamEvents } from "./data-stream.js";
6
+ import { AgUiRequestSchema } from "./ag-ui-handler.js";
7
+ import { AgentRuntime, RunAlreadyExistsError, } from "./runtime/index.js";
8
+ const AGENT_ID_PATTERN = /^[a-zA-Z0-9_-]+$/;
9
+ const AG_UI_DETACHED_RUN_ID_SCHEMA = z.string().min(1).max(128).regex(AGENT_ID_PATTERN);
10
+ const MAX_TEXT_PART_LENGTH = 10_000;
11
+ function isRecord(value) {
12
+ return typeof value === "object" && value !== null && !Array.isArray(value);
13
+ }
14
+ function normalizeToolArgs(part) {
15
+ if (isRecord(part.args))
16
+ return part.args;
17
+ if (isRecord(part.input))
18
+ return part.input;
19
+ return {};
20
+ }
21
+ function normalizeMessagePart(part) {
22
+ if (part.type === "text" && typeof part.text === "string" &&
23
+ part.text.length <= MAX_TEXT_PART_LENGTH) {
24
+ return { type: "text", text: part.text };
25
+ }
26
+ if (part.type === "tool_call" && typeof part.id === "string" && typeof part.name === "string") {
27
+ return {
28
+ type: "tool-call",
29
+ toolCallId: part.id,
30
+ toolName: part.name,
31
+ args: normalizeToolArgs(part),
32
+ };
33
+ }
34
+ if (part.type === "tool-call" &&
35
+ typeof part.toolCallId === "string" &&
36
+ typeof part.toolName === "string") {
37
+ return {
38
+ type: "tool-call",
39
+ toolCallId: part.toolCallId,
40
+ toolName: part.toolName,
41
+ args: normalizeToolArgs(part),
42
+ };
43
+ }
44
+ if (typeof part.type === "string" &&
45
+ part.type.startsWith("tool-") &&
46
+ part.type !== "tool-result" &&
47
+ typeof part.toolCallId === "string" &&
48
+ typeof part.toolName === "string") {
49
+ return {
50
+ type: part.type,
51
+ toolCallId: part.toolCallId,
52
+ toolName: part.toolName,
53
+ args: normalizeToolArgs(part),
54
+ };
55
+ }
56
+ if (part.type === "tool_result" && typeof part.tool_call_id === "string") {
57
+ return {
58
+ type: "tool-result",
59
+ toolCallId: part.tool_call_id,
60
+ toolName: typeof part.tool_name === "string" ? part.tool_name : "unknown",
61
+ result: "output" in part ? part.output : undefined,
62
+ };
63
+ }
64
+ if (part.type === "tool-result" && typeof part.toolCallId === "string") {
65
+ return {
66
+ type: "tool-result",
67
+ toolCallId: part.toolCallId,
68
+ toolName: typeof part.toolName === "string" ? part.toolName : "unknown",
69
+ result: "result" in part ? part.result : undefined,
70
+ };
71
+ }
72
+ return null;
73
+ }
74
+ function normalizeMessages(messages) {
75
+ return messages.map((message) => ({
76
+ id: message.id,
77
+ role: message.role,
78
+ parts: message.parts
79
+ .map((part) => normalizeMessagePart(part))
80
+ .filter((part) => part !== null),
81
+ ...(message.createdAt ? { timestamp: Date.parse(message.createdAt) || undefined } : {}),
82
+ ...(message.metadata ? { metadata: message.metadata } : {}),
83
+ }));
84
+ }
85
+ function isRequest(obj) {
86
+ return (typeof obj === "object" &&
87
+ obj !== null &&
88
+ "json" in obj &&
89
+ typeof obj.json === "function" &&
90
+ "url" in obj &&
91
+ typeof obj.url === "string" &&
92
+ "method" in obj &&
93
+ typeof obj.method === "string");
94
+ }
95
+ function extractRequest(requestOrCtx) {
96
+ if (isRequest(requestOrCtx))
97
+ return requestOrCtx;
98
+ if (typeof requestOrCtx === "object" && requestOrCtx !== null && "request" in requestOrCtx) {
99
+ const candidate = requestOrCtx.request;
100
+ if (isRequest(candidate))
101
+ return candidate;
102
+ }
103
+ throw INVALID_ARGUMENT.create({
104
+ detail: "Invalid handler argument: expected Request or APIContext",
105
+ });
106
+ }
107
+ function buildStreamContext(request, baseContext, threadId, runId) {
108
+ return {
109
+ ...baseContext,
110
+ threadId,
111
+ runId,
112
+ agUi: {
113
+ context: request.context,
114
+ forwardedProps: request.forwardedProps,
115
+ },
116
+ };
117
+ }
118
+ function createInjectedAgUiTool(runId, tool, sessionManager) {
119
+ return {
120
+ id: tool.name,
121
+ type: "function",
122
+ description: tool.description ?? tool.name,
123
+ inputSchema: z.record(z.string(), z.unknown()),
124
+ inputSchemaJson: (tool.parameters ??
125
+ { type: "object", properties: {}, additionalProperties: true }),
126
+ execute: async (_input, context) => {
127
+ const toolCallId = typeof context?.toolCallId === "string" ? context.toolCallId : null;
128
+ if (!toolCallId) {
129
+ throw new Error(`Missing toolCallId for injected tool "${tool.name}"`);
130
+ }
131
+ sessionManager.prepareForSignal(runId, toolCallId);
132
+ const submitted = await sessionManager.waitForSignal(runId, toolCallId);
133
+ if (submitted.isError) {
134
+ throw new Error(typeof submitted.result === "string"
135
+ ? submitted.result
136
+ : JSON.stringify(submitted.result));
137
+ }
138
+ return submitted.result;
139
+ },
140
+ };
141
+ }
142
+ function buildMergedTools(agent, request, sessionManager) {
143
+ const injectedTools = Object.fromEntries(request.tools.map((tool) => [
144
+ tool.name,
145
+ createInjectedAgUiTool(request.runId, tool, sessionManager),
146
+ ]));
147
+ if (!agent.config.tools) {
148
+ return Object.keys(injectedTools).length > 0 ? injectedTools : undefined;
149
+ }
150
+ if (agent.config.tools === true) {
151
+ const merged = {};
152
+ for (const [toolId] of toolRegistry.getAll()) {
153
+ if (!agent.config.skills && SKILL_TOOL_IDS.has(toolId)) {
154
+ continue;
155
+ }
156
+ merged[toolId] = true;
157
+ }
158
+ return { ...merged, ...injectedTools };
159
+ }
160
+ return { ...agent.config.tools, ...injectedTools };
161
+ }
162
+ async function resolveContextValue(value, request) {
163
+ if (typeof value === "function") {
164
+ return await value(request);
165
+ }
166
+ return value ?? {};
167
+ }
168
+ function scheduleDetachedTask(requestOrCtx, task) {
169
+ if (typeof requestOrCtx === "object" &&
170
+ requestOrCtx !== null &&
171
+ "waitUntil" in requestOrCtx &&
172
+ typeof requestOrCtx.waitUntil === "function") {
173
+ (requestOrCtx.waitUntil)(task);
174
+ return;
175
+ }
176
+ void task;
177
+ }
178
+ async function drainRuntimeStream(stream) {
179
+ for await (const _event of streamDataStreamEvents(stream)) {
180
+ continue;
181
+ }
182
+ }
183
+ export const AgUiDetachedStartRequestSchema = AgUiRequestSchema.extend({
184
+ threadId: z.string().uuid(),
185
+ runId: AG_UI_DETACHED_RUN_ID_SCHEMA,
186
+ });
187
+ export const AgUiDetachedStartAcceptedSchema = z.object({
188
+ accepted: z.literal(true),
189
+ duplicate: z.boolean(),
190
+ runId: AG_UI_DETACHED_RUN_ID_SCHEMA,
191
+ threadId: z.string().uuid(),
192
+ });
193
+ async function startDefaultDetachedExecution(input) {
194
+ const runtime = new AgentRuntime(input.agent.id, {
195
+ ...input.agent.config,
196
+ tools: buildMergedTools(input.agent, input.request, input.sessionManager),
197
+ });
198
+ const runtimeStream = await runtime.stream(normalizeMessages(input.request.messages), buildStreamContext(input.request, input.context, input.request.threadId, input.request.runId), undefined, input.request.model, input.request.maxOutputTokens, input.abortSignal);
199
+ await drainRuntimeStream(runtimeStream);
200
+ }
201
+ export function createAgUiDetachedStartHandler(options) {
202
+ if (!options.agent && !options.startDetachedExecution) {
203
+ throw new Error("Detached AG-UI start requires either an agent or startDetachedExecution handler.");
204
+ }
205
+ return async function POST(requestOrCtx) {
206
+ const request = extractRequest(requestOrCtx);
207
+ try {
208
+ const parsed = AgUiDetachedStartRequestSchema.parse(await request.json());
209
+ const context = await resolveContextValue(options.context, request);
210
+ try {
211
+ const abortSignal = options.sessionManager.startRun({
212
+ runId: parsed.runId,
213
+ threadId: parsed.threadId,
214
+ });
215
+ await options.onAccepted?.({
216
+ request: parsed,
217
+ runId: parsed.runId,
218
+ threadId: parsed.threadId,
219
+ });
220
+ const detachedTask = (async () => {
221
+ try {
222
+ if (options.startDetachedExecution) {
223
+ await options.startDetachedExecution({
224
+ request: parsed,
225
+ requestOrCtx,
226
+ rawRequest: request,
227
+ context,
228
+ abortSignal,
229
+ });
230
+ }
231
+ else if (options.agent) {
232
+ await startDefaultDetachedExecution({
233
+ agent: options.agent,
234
+ request: parsed,
235
+ context,
236
+ abortSignal,
237
+ sessionManager: options.sessionManager,
238
+ });
239
+ }
240
+ else {
241
+ throw new Error("Detached AG-UI start configuration became invalid during execution.");
242
+ }
243
+ options.sessionManager.completeRun(parsed.runId);
244
+ await options.onFinish?.({
245
+ runId: parsed.runId,
246
+ threadId: parsed.threadId,
247
+ });
248
+ }
249
+ catch (error) {
250
+ options.sessionManager.failRun(parsed.runId);
251
+ await options.onError?.({
252
+ runId: parsed.runId,
253
+ threadId: parsed.threadId,
254
+ error,
255
+ });
256
+ }
257
+ })().catch(() => undefined);
258
+ scheduleDetachedTask(requestOrCtx, detachedTask);
259
+ return Response.json({
260
+ accepted: true,
261
+ duplicate: false,
262
+ runId: parsed.runId,
263
+ threadId: parsed.threadId,
264
+ }, { status: 202 });
265
+ }
266
+ catch (error) {
267
+ if (error instanceof RunAlreadyExistsError) {
268
+ await options.onDuplicate?.({
269
+ request: parsed,
270
+ runId: parsed.runId,
271
+ threadId: parsed.threadId,
272
+ });
273
+ return Response.json({
274
+ accepted: true,
275
+ duplicate: true,
276
+ runId: parsed.runId,
277
+ threadId: parsed.threadId,
278
+ }, { status: 202 });
279
+ }
280
+ options.sessionManager.failRun(parsed.runId);
281
+ throw error;
282
+ }
283
+ }
284
+ catch (error) {
285
+ if (error instanceof z.ZodError) {
286
+ return Response.json({
287
+ error: "Invalid AG-UI detached start request",
288
+ details: error.issues.map((issue) => ({
289
+ path: issue.path,
290
+ message: issue.message,
291
+ })),
292
+ }, { status: 400 });
293
+ }
294
+ return Response.json({
295
+ error: error instanceof Error ? error.message : "Internal detached start failed",
296
+ }, { status: 500 });
297
+ }
298
+ };
299
+ }
@@ -88,6 +88,7 @@ export { type AgUiRuntimeContextItem, AgUiRuntimeContextItemSchema, type AgUiRun
88
88
  export { type AgUiBrowserEncodedEvent, type AgUiBrowserEncoderState, type AgUiBrowserRunFinishedMetadata, type AgUiRuntimeStreamEvent, createAgUiBrowserEncoderState, finalizeAgUiBrowserEvents, mapRuntimeStreamEventToAgUiBrowserEvents, } from "./ag-ui-browser-encoder.js";
89
89
  export { mergeToolCallInput, mergeToolInputDelta, parseDataStreamSseEvents, parseToolInputObject, streamDataStreamEvents, stripLeadingEmptyObjectPlaceholder, } from "./data-stream.js";
90
90
  export { expandAllowedRemoteToolNames, getProviderNativeToolNames, type ProviderNativeToolInventoryOptions, } from "./provider-native-tool-inventory.js";
91
+ export { type AgUiDetachedStartAccepted, AgUiDetachedStartAcceptedSchema, type AgUiDetachedStartHandlerOptions, type AgUiDetachedStartRequest, AgUiDetachedStartRequestSchema, createAgUiDetachedStartHandler, } from "./ag-ui-detached-start.js";
91
92
  export { type AgUiCancelHandlerOptions, type AgUiResumeHandlerOptions, type AgUiResumeSignal, AgUiResumeSignalSchema, createAgUiCancelHandler, createAgUiResumeHandler, } from "./ag-ui-run-control.js";
92
93
  export { type AgUiContextItem, type AgUiHandlerConfigWithAgent, type AgUiHandlerOptions, type AgUiInjectedTool, type AgUiRequest, AgUiRequestSchema, createAgUiHandler, } from "./ag-ui-handler.js";
93
94
  export { type HumanInputField, type HumanInputFieldInput, HumanInputFieldSchema, type HumanInputOption, HumanInputOptionSchema, type HumanInputPendingRequest, HumanInputPendingRequestSchema, type HumanInputRequest, type HumanInputRequestInput, HumanInputRequestSchema, type HumanInputResult, HumanInputResultSchema, HumanInputResumeError, InvalidHumanInputResultError, waitForHumanInput, type WaitForHumanInputOptions, } from "./human-input.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,OAAO,yBAAyB,CAAC;AAGjC,YAAY,EACV,KAAK,EACL,WAAW,EACX,YAAY,EACZ,eAAe,EACf,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,OAAO,IAAI,YAAY,EACvB,WAAW,EACX,aAAa,EACb,WAAW,EACX,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEnF,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,KAAK,MAAM,EACX,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,WAAW,EACX,KAAK,iBAAiB,EACtB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,WAAW,EACX,cAAc,EACd,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,K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BAAqB,EACrB,4BAA4B,EAC5B,iBAAiB,EACjB,KAAK,wBAAwB,GAC9B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,8BAA8B,EACnC,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,OAAO,yBAAyB,CAAC;AAGjC,YAAY,EACV,KAAK,EACL,WAAW,EACX,YAAY,EACZ,eAAe,EACf,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,OAAO,IAAI,YAAY,EACvB,WAAW,EACX,aAAa,EACb,WAAW,EACX,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEnF,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,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,EACpB,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,KAAK,wBAAwB,EAC7B,8BAA8B,EAC9B,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,EAC5B,iBAAiB,EACjB,KAAK,wBAAwB,GAC9B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,8BAA8B,EACnC,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC"}
@@ -87,6 +87,7 @@ export { AgUiRuntimeContextItemSchema, AgUiRuntimeInjectedToolSchema, AgUiRuntim
87
87
  export { createAgUiBrowserEncoderState, finalizeAgUiBrowserEvents, mapRuntimeStreamEventToAgUiBrowserEvents, } from "./ag-ui-browser-encoder.js";
88
88
  export { mergeToolCallInput, mergeToolInputDelta, parseDataStreamSseEvents, parseToolInputObject, streamDataStreamEvents, stripLeadingEmptyObjectPlaceholder, } from "./data-stream.js";
89
89
  export { expandAllowedRemoteToolNames, getProviderNativeToolNames, } from "./provider-native-tool-inventory.js";
90
+ export { AgUiDetachedStartAcceptedSchema, AgUiDetachedStartRequestSchema, createAgUiDetachedStartHandler, } from "./ag-ui-detached-start.js";
90
91
  export { AgUiResumeSignalSchema, createAgUiCancelHandler, createAgUiResumeHandler, } from "./ag-ui-run-control.js";
91
92
  export { AgUiRequestSchema, createAgUiHandler, } from "./ag-ui-handler.js";
92
93
  export { HumanInputFieldSchema, HumanInputOptionSchema, HumanInputPendingRequestSchema, HumanInputRequestSchema, HumanInputResultSchema, HumanInputResumeError, InvalidHumanInputResultError, waitForHumanInput, } from "./human-input.js";
@@ -24,7 +24,7 @@ export const connectors = [
24
24
  { "name": "mailchimp", "displayName": "Mailchimp", "icon": "mailchimp.svg", "description": "Manage email campaigns, lists, and subscribers in Mailchimp", "auth": { "type": "oauth2", "provider": "mailchimp", "authorizationUrl": "https://login.mailchimp.com/oauth2/authorize", "tokenUrl": "https://login.mailchimp.com/oauth2/token", "scopes": [], "requiredApis": [{ "name": "Mailchimp API", "enableUrl": "https://admin.mailchimp.com/account/oauth2/" }] }, "envVars": [{ "name": "MAILCHIMP_CLIENT_ID", "description": "Mailchimp OAuth Client ID", "required": true, "sensitive": false, "docsUrl": "https://mailchimp.com/developer/marketing/guides/access-user-data-oauth-2/" }, { "name": "MAILCHIMP_CLIENT_SECRET", "description": "Mailchimp OAuth Client Secret", "required": true, "sensitive": true, "docsUrl": "https://mailchimp.com/developer/marketing/guides/access-user-data-oauth-2/" }], "tools": [{ "id": "list-campaigns", "name": "List Campaigns", "description": "List all email campaigns in Mailchimp", "requiresWrite": false }, { "id": "get-campaign", "name": "Get Campaign", "description": "Get details of a specific campaign", "requiresWrite": false }, { "id": "list-lists", "name": "List Audience Lists", "description": "List all audience lists (mailing lists) in Mailchimp", "requiresWrite": false }, { "id": "get-list", "name": "Get Audience List", "description": "Get details of a specific audience list", "requiresWrite": false }, { "id": "list-members", "name": "List Members", "description": "List subscribers/members in an audience list", "requiresWrite": false }], "prompts": [{ "id": "campaign-stats", "title": "Show campaign stats", "prompt": "Show me the performance statistics for my recent email campaigns in Mailchimp.", "category": "marketing", "icon": "chart" }, { "id": "list-subscribers", "title": "List subscribers", "prompt": "Show me the subscribers in my main email list with their subscription status.", "category": "marketing", "icon": "users" }], "suggestedWith": ["slack", "notion", "hubspot"] },
25
25
  { "name": "mixpanel", "displayName": "Mixpanel", "icon": "mixpanel.svg", "description": "Track events, analyze funnels, and understand user behavior with Mixpanel analytics", "auth": { "type": "api-key", "requiredApis": [{ "name": "Mixpanel API", "enableUrl": "https://mixpanel.com/settings/project" }], "keyName": "MIXPANEL_PROJECT_TOKEN" }, "envVars": [{ "name": "MIXPANEL_PROJECT_TOKEN", "description": "Mixpanel Project Token for event tracking", "required": true, "sensitive": true, "docsUrl": "https://docs.mixpanel.com/docs/tracking-methods/id-management/authentication" }, { "name": "MIXPANEL_API_SECRET", "description": "Mixpanel API Secret for data export and query operations", "required": true, "sensitive": true, "docsUrl": "https://developer.mixpanel.com/reference/authentication" }, { "name": "MIXPANEL_PROJECT_ID", "description": "Mixpanel Project ID (found in project settings)", "required": true, "sensitive": false, "docsUrl": "https://docs.mixpanel.com/docs/admin/organizations-projects/manage-projects" }], "tools": [{ "id": "track-event", "name": "Track Event", "description": "Track a custom event in Mixpanel with properties", "requiresWrite": true }, { "id": "query-events", "name": "Query Events", "description": "Query and export event data from Mixpanel", "requiresWrite": false }, { "id": "get-funnel", "name": "Get Funnel", "description": "Retrieve funnel analysis data to understand conversion rates", "requiresWrite": false }, { "id": "get-retention", "name": "Get Retention", "description": "Analyze user retention cohorts over time", "requiresWrite": false }, { "id": "list-cohorts", "name": "List Cohorts", "description": "List all user cohorts defined in your Mixpanel project", "requiresWrite": false }], "prompts": [{ "id": "event-analysis", "title": "Event analysis", "prompt": "Show me the most important events tracked in my Mixpanel project over the last 7 days and their trends.", "category": "analytics", "icon": "chart" }, { "id": "funnel-performance", "title": "Funnel performance", "prompt": "Analyze my key conversion funnels and identify where users are dropping off.", "category": "analytics", "icon": "funnel" }, { "id": "retention-insights", "title": "Retention insights", "prompt": "Give me insights about user retention and cohort behavior over the past month.", "category": "analytics", "icon": "users" }], "suggestedWith": ["slack", "analytics", "monitoring"] },
26
26
  { "name": "monday", "displayName": "Monday.com", "icon": "monday.svg", "description": "Manage projects, tasks, and workflows in Monday.com", "auth": { "type": "oauth2", "provider": "monday", "authorizationUrl": "https://auth.monday.com/oauth2/authorize", "tokenUrl": "https://auth.monday.com/oauth2/token", "scopes": ["me:read", "boards:read", "boards:write"], "requiredApis": [{ "name": "Monday.com Developers", "enableUrl": "https://monday.com/developers/apps" }] }, "envVars": [{ "name": "MONDAY_CLIENT_ID", "description": "Monday.com OAuth Client ID", "required": true, "sensitive": false, "docsUrl": "https://developer.monday.com/apps/docs/oauth" }, { "name": "MONDAY_CLIENT_SECRET", "description": "Monday.com OAuth Client Secret", "required": true, "sensitive": true, "docsUrl": "https://developer.monday.com/apps/docs/oauth" }], "tools": [{ "id": "list-boards", "name": "List Boards", "description": "List all boards in the workspace", "requiresWrite": false }, { "id": "list-items", "name": "List Items", "description": "List items in a board", "requiresWrite": false }, { "id": "get-item", "name": "Get Item", "description": "Get details of a specific item", "requiresWrite": false }, { "id": "create-item", "name": "Create Item", "description": "Create a new item in a board", "requiresWrite": true }, { "id": "update-item", "name": "Update Item", "description": "Update an existing item", "requiresWrite": true }], "prompts": [{ "id": "my-items", "title": "Show my items", "prompt": "List all items assigned to me in Monday.com with their status and due dates.", "category": "productivity", "icon": "list" }, { "id": "create-item", "title": "Create an item", "prompt": "Create a new item with a name, status, and assign it to someone.", "category": "productivity", "icon": "plus" }], "suggestedWith": ["slack", "notion", "asana"] },
27
- { "name": "neon", "displayName": "Neon", "icon": "neon.svg", "description": "Manage Neon Postgres projects, branches, and execute database queries", "auth": { "type": "api-key", "requiredApis": [{ "name": "Neon Management API", "enableUrl": "https://console.neon.tech/app/settings/api-keys" }], "tokenName": "API Key", "docsUrl": "https://neon.tech/docs/manage/api-keys" }, "envVars": [{ "name": "NEON_API_KEY", "description": "Neon API Key for Management API access", "required": true, "sensitive": true, "docsUrl": "https://neon.tech/docs/manage/api-keys" }, { "name": "DATABASE_URL", "description": "PostgreSQL connection string for database queries", "required": true, "sensitive": true, "docsUrl": "https://neon.tech/docs/connect/connect-from-any-app" }], "tools": [{ "id": "list-projects", "name": "List Projects", "description": "List all Neon projects in your account", "requiresWrite": false }, { "id": "list-branches", "name": "List Branches", "description": "List all branches for a specific project", "requiresWrite": false }, { "id": "query-database", "name": "Query Database", "description": "Execute SQL queries against the connected database", "requiresWrite": false }, { "id": "list-tables", "name": "List Tables", "description": "List all tables in the connected database", "requiresWrite": false }, { "id": "describe-table", "name": "Describe Table", "description": "Get detailed schema information for a specific table", "requiresWrite": false }], "prompts": [{ "id": "check-db-status", "title": "Check database status", "prompt": "Show me the status of my Neon projects and their branches.", "category": "database", "icon": "database" }, { "id": "explore-schema", "title": "Explore database schema", "prompt": "List all tables in my database and show me the schema for the main tables.", "category": "database", "icon": "table" }, { "id": "query-data", "title": "Query database", "prompt": "Help me query my database to find specific data.", "category": "database", "icon": "search" }], "suggestedWith": ["stripe", "clerk", "vercel"] },
27
+ { "name": "neon", "displayName": "Neon", "icon": "neon.svg", "description": "Manage Neon Postgres projects, branches, and execute database queries", "auth": { "type": "api-key", "requiredApis": [{ "name": "Neon Management API", "enableUrl": "https://console.neon.tech/app/settings/api-keys" }], "tokenName": "API Key", "docsUrl": "https://neon.tech/docs/manage/api-keys" }, "envVars": [{ "name": "NEON_API_KEY", "description": "Neon API Key for Management API access", "required": true, "sensitive": true, "docsUrl": "https://neon.tech/docs/manage/api-keys" }, { "name": "DATABASE_URL", "description": "PostgreSQL connection string for database queries", "required": true, "sensitive": true, "docsUrl": "https://neon.tech/docs/connect/connect-from-any-app" }], "npmDependencies": { "pg": "^8.13.1" }, "tools": [{ "id": "list-projects", "name": "List Projects", "description": "List all Neon projects in your account", "requiresWrite": false }, { "id": "list-branches", "name": "List Branches", "description": "List all branches for a specific project", "requiresWrite": false }, { "id": "query-database", "name": "Query Database", "description": "Execute SQL queries against the connected database", "requiresWrite": false }, { "id": "list-tables", "name": "List Tables", "description": "List all tables in the connected database", "requiresWrite": false }, { "id": "describe-table", "name": "Describe Table", "description": "Get detailed schema information for a specific table", "requiresWrite": false }], "prompts": [{ "id": "check-db-status", "title": "Check database status", "prompt": "Show me the status of my Neon projects and their branches.", "category": "database", "icon": "database" }, { "id": "explore-schema", "title": "Explore database schema", "prompt": "List all tables in my database and show me the schema for the main tables.", "category": "database", "icon": "table" }, { "id": "query-data", "title": "Query database", "prompt": "Help me query my database to find specific data.", "category": "database", "icon": "search" }], "suggestedWith": ["stripe", "clerk", "vercel"] },
28
28
  { "name": "notion", "displayName": "Notion", "icon": "notion.svg", "description": "Search, read, and create pages in Notion workspaces", "auth": { "type": "oauth2", "provider": "notion", "authorizationUrl": "https://api.notion.com/v1/oauth/authorize", "tokenUrl": "https://api.notion.com/v1/oauth/token", "scopes": [], "tokenAuthMethod": "basic", "requiredApis": [{ "name": "Notion Integration", "enableUrl": "https://www.notion.so/my-integrations" }] }, "envVars": [{ "name": "NOTION_CLIENT_ID", "description": "Notion OAuth Client ID (from your integration)", "required": true, "sensitive": false, "docsUrl": "https://www.notion.so/my-integrations" }, { "name": "NOTION_CLIENT_SECRET", "description": "Notion OAuth Client Secret", "required": true, "sensitive": true, "docsUrl": "https://www.notion.so/my-integrations" }], "tools": [{ "id": "search-notion", "name": "Search Notion", "description": "Search pages and databases in the workspace", "requiresWrite": false }, { "id": "read-page", "name": "Read Page", "description": "Read the content of a Notion page", "requiresWrite": false }, { "id": "create-page", "name": "Create Page", "description": "Create a new page in a database or as a subpage", "requiresWrite": true }, { "id": "query-database", "name": "Query Database", "description": "Query a Notion database with filters and sorts", "requiresWrite": false }], "prompts": [{ "id": "search-docs", "title": "Search my docs", "prompt": "Search my Notion workspace for relevant documentation or notes about a topic.", "category": "productivity", "icon": "search" }, { "id": "summarize-page", "title": "Summarize a page", "prompt": "Read and summarize a specific Notion page. Extract the key points and action items.", "category": "productivity", "icon": "document" }, { "id": "create-meeting-notes", "title": "Create meeting notes", "prompt": "Create a new meeting notes page with today's date, attendees, agenda, and action items sections.", "category": "productivity", "icon": "plus" }], "suggestedWith": ["gmail", "slack", "calendar"] },
29
29
  { "name": "onedrive", "displayName": "OneDrive", "icon": "onedrive.svg", "description": "Access and manage files in Microsoft OneDrive", "auth": { "type": "oauth2", "provider": "microsoft", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", "tokenUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/token", "scopes": ["Files.Read", "Files.ReadWrite", "Files.Read.All", "Files.ReadWrite.All", "offline_access"], "tokenAuthMethod": "body", "requiredApis": [{ "name": "Microsoft Graph API", "enableUrl": "https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade" }] }, "envVars": [{ "name": "MICROSOFT_CLIENT_ID", "description": "Microsoft Azure App Client ID (shared with Outlook/Teams/SharePoint)", "required": true, "sensitive": false, "docsUrl": "https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade" }, { "name": "MICROSOFT_CLIENT_SECRET", "description": "Microsoft Azure App Client Secret", "required": true, "sensitive": true, "docsUrl": "https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade" }], "tools": [{ "id": "list-files", "name": "List Files", "description": "List files and folders in a OneDrive folder", "requiresWrite": false }, { "id": "search-files", "name": "Search Files", "description": "Search for files and folders in OneDrive by name or content", "requiresWrite": false }, { "id": "upload-file", "name": "Upload File", "description": "Upload or update a file in OneDrive", "requiresWrite": true }, { "id": "download-file", "name": "Download File", "description": "Download file content from OneDrive", "requiresWrite": false }], "prompts": [{ "id": "search-documents", "title": "Search documents", "prompt": "Search for documents in OneDrive and summarize their content.", "category": "productivity", "icon": "search" }, { "id": "list-recent-files", "title": "List recent files", "prompt": "Show me the most recently modified files in my OneDrive.", "category": "productivity", "icon": "document" }, { "id": "organize-files", "title": "Organize files", "prompt": "Help me organize and manage files in my OneDrive storage.", "category": "productivity", "icon": "folder" }, { "id": "backup-file", "title": "Backup a file", "prompt": "Upload and backup a file to my OneDrive storage.", "category": "productivity", "icon": "upload" }], "suggestedWith": ["outlook", "teams", "sharepoint"] },
30
30
  { "name": "outlook", "displayName": "Microsoft Outlook", "icon": "outlook.svg", "description": "Read, send, and manage Outlook emails", "auth": { "type": "oauth2", "provider": "microsoft", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", "tokenUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/token", "scopes": ["Mail.Read", "Mail.Send", "Mail.ReadWrite", "offline_access"], "tokenAuthMethod": "body", "requiredApis": [{ "name": "Microsoft Graph API", "enableUrl": "https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade" }] }, "envVars": [{ "name": "MICROSOFT_CLIENT_ID", "description": "Microsoft Azure App Client ID (Application ID)", "required": true, "sensitive": false, "docsUrl": "https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade" }, { "name": "MICROSOFT_CLIENT_SECRET", "description": "Microsoft Azure App Client Secret", "required": true, "sensitive": true, "docsUrl": "https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade" }], "tools": [{ "id": "list-emails", "name": "List Emails", "description": "List recent emails from inbox or a specific folder", "requiresWrite": false }, { "id": "get-email", "name": "Get Email", "description": "Get detailed information about a specific email", "requiresWrite": false }, { "id": "send-email", "name": "Send Email", "description": "Send a new email message", "requiresWrite": true }, { "id": "search-emails", "name": "Search Emails", "description": "Search emails by query, subject, sender, or date", "requiresWrite": false }, { "id": "list-folders", "name": "List Folders", "description": "List all mail folders in the mailbox", "requiresWrite": false }], "prompts": [{ "id": "check-emails", "title": "Check my emails", "prompt": "List my recent unread emails and summarize the most important ones.", "category": "productivity", "icon": "mail" }, { "id": "search-emails", "title": "Search my emails", "prompt": "Search my emails for specific topics, senders, or date ranges.", "category": "productivity", "icon": "search" }, { "id": "draft-email", "title": "Draft an email", "prompt": "Help me draft a professional email with proper formatting and tone.", "category": "productivity", "icon": "compose" }], "suggestedWith": ["teams", "calendar", "gmail"] },
@@ -356,6 +356,7 @@ export declare const IntegrationConfigSchema: z.ZodObject<{
356
356
  docsUrl: z.ZodOptional<z.ZodString>;
357
357
  default: z.ZodOptional<z.ZodString>;
358
358
  }, z.core.$strip>>>;
359
+ npmDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
359
360
  tools: z.ZodArray<z.ZodObject<{
360
361
  id: z.ZodOptional<z.ZodString>;
361
362
  name: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/src/integrations/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuDxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA2B,CAAC;AAE9D,eAAO,MAAM,YAAY;;;;;;;;iBAQvB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;iBAO3B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyB5B,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;iBAMzC,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;;;;;;iBAK7C,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBASpC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOhC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;iBAMlC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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