From 283e1f6d759b1a76e20acaf7718de8ae73174d6c Mon Sep 17 00:00:00 2001 From: ssdeanx Date: Wed, 14 Jan 2026 15:52:42 -0500 Subject: [PATCH 1/2] feat: add convex package and generated files - Added "convex" package to package.json and package-lock.json. - Updated tsconfig.json to include convex types for TypeScript. - Created generated files for Convex API utilities: - api.d.ts - api.js - dataModel.d.ts - server.d.ts - server.js --- convex/_generated/api.d.ts | 15 ++++ convex/_generated/api.js | 23 +++++ convex/_generated/dataModel.d.ts | 60 +++++++++++++ convex/_generated/server.d.ts | 143 +++++++++++++++++++++++++++++++ convex/_generated/server.js | 93 ++++++++++++++++++++ package-lock.json | 1 + package.json | 1 + tsconfig.json | 5 ++ 8 files changed, 341 insertions(+) create mode 100644 convex/_generated/api.d.ts create mode 100644 convex/_generated/api.js create mode 100644 convex/_generated/dataModel.d.ts create mode 100644 convex/_generated/server.d.ts create mode 100644 convex/_generated/server.js diff --git a/convex/_generated/api.d.ts b/convex/_generated/api.d.ts new file mode 100644 index 0000000..416bcb2 --- /dev/null +++ b/convex/_generated/api.d.ts @@ -0,0 +1,15 @@ +/* eslint-disable */ +/** + * Generated `api` utility. + * + * THIS CODE IS AUTOMATICALLY GENERATED. + * + * To regenerate, run `npx convex dev`. + * @module + */ + +import type { AnyApi, AnyComponents } from "convex/server"; + +export declare const api: AnyApi; +export declare const internal: AnyApi; +export declare const components: AnyComponents; diff --git a/convex/_generated/api.js b/convex/_generated/api.js new file mode 100644 index 0000000..44bf985 --- /dev/null +++ b/convex/_generated/api.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +/** + * Generated `api` utility. + * + * THIS CODE IS AUTOMATICALLY GENERATED. + * + * To regenerate, run `npx convex dev`. + * @module + */ + +import { anyApi, componentsGeneric } from "convex/server"; + +/** + * A utility for referencing Convex functions in your app's API. + * + * Usage: + * ```js + * const myFunctionReference = api.myModule.myFunction; + * ``` + */ +export const api = anyApi; +export const internal = anyApi; +export const components = componentsGeneric(); diff --git a/convex/_generated/dataModel.d.ts b/convex/_generated/dataModel.d.ts new file mode 100644 index 0000000..f97fd19 --- /dev/null +++ b/convex/_generated/dataModel.d.ts @@ -0,0 +1,60 @@ +/* eslint-disable */ +/** + * Generated data model types. + * + * THIS CODE IS AUTOMATICALLY GENERATED. + * + * To regenerate, run `npx convex dev`. + * @module + */ + +import type { + DataModelFromSchemaDefinition, + DocumentByName, + TableNamesInDataModel, + SystemTableNames, +} from "convex/server"; +import type { GenericId } from "convex/values"; +import schema from "../schema.js"; + +/** + * The names of all of your Convex tables. + */ +export type TableNames = TableNamesInDataModel; + +/** + * The type of a document stored in Convex. + * + * @typeParam TableName - A string literal type of the table name (like "users"). + */ +export type Doc = DocumentByName< + DataModel, + TableName +>; + +/** + * An identifier for a document in Convex. + * + * Convex documents are uniquely identified by their `Id`, which is accessible + * on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids). + * + * Documents can be loaded using `db.get(tableName, id)` in query and mutation functions. + * + * IDs are just strings at runtime, but this type can be used to distinguish them from other + * strings when type checking. + * + * @typeParam TableName - A string literal type of the table name (like "users"). + */ +export type Id = + GenericId; + +/** + * A type describing your Convex data model. + * + * This type includes information about what tables you have, the type of + * documents stored in those tables, and the indexes defined on them. + * + * This type is used to parameterize methods like `queryGeneric` and + * `mutationGeneric` to make them type-safe. + */ +export type DataModel = DataModelFromSchemaDefinition; diff --git a/convex/_generated/server.d.ts b/convex/_generated/server.d.ts new file mode 100644 index 0000000..bec05e6 --- /dev/null +++ b/convex/_generated/server.d.ts @@ -0,0 +1,143 @@ +/* eslint-disable */ +/** + * Generated utilities for implementing server-side Convex query and mutation functions. + * + * THIS CODE IS AUTOMATICALLY GENERATED. + * + * To regenerate, run `npx convex dev`. + * @module + */ + +import { + ActionBuilder, + HttpActionBuilder, + MutationBuilder, + QueryBuilder, + GenericActionCtx, + GenericMutationCtx, + GenericQueryCtx, + GenericDatabaseReader, + GenericDatabaseWriter, +} from "convex/server"; +import type { DataModel } from "./dataModel.js"; + +/** + * Define a query in this Convex app's public API. + * + * This function will be allowed to read your Convex database and will be accessible from the client. + * + * @param func - The query function. It receives a {@link QueryCtx} as its first argument. + * @returns The wrapped query. Include this as an `export` to name it and make it accessible. + */ +export declare const query: QueryBuilder; + +/** + * Define a query that is only accessible from other Convex functions (but not from the client). + * + * This function will be allowed to read from your Convex database. It will not be accessible from the client. + * + * @param func - The query function. It receives a {@link QueryCtx} as its first argument. + * @returns The wrapped query. Include this as an `export` to name it and make it accessible. + */ +export declare const internalQuery: QueryBuilder; + +/** + * Define a mutation in this Convex app's public API. + * + * This function will be allowed to modify your Convex database and will be accessible from the client. + * + * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. + * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. + */ +export declare const mutation: MutationBuilder; + +/** + * Define a mutation that is only accessible from other Convex functions (but not from the client). + * + * This function will be allowed to modify your Convex database. It will not be accessible from the client. + * + * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. + * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. + */ +export declare const internalMutation: MutationBuilder; + +/** + * Define an action in this Convex app's public API. + * + * An action is a function which can execute any JavaScript code, including non-deterministic + * code and code with side-effects, like calling third-party services. + * They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive. + * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}. + * + * @param func - The action. It receives an {@link ActionCtx} as its first argument. + * @returns The wrapped action. Include this as an `export` to name it and make it accessible. + */ +export declare const action: ActionBuilder; + +/** + * Define an action that is only accessible from other Convex functions (but not from the client). + * + * @param func - The function. It receives an {@link ActionCtx} as its first argument. + * @returns The wrapped function. Include this as an `export` to name it and make it accessible. + */ +export declare const internalAction: ActionBuilder; + +/** + * Define an HTTP action. + * + * The wrapped function will be used to respond to HTTP requests received + * by a Convex deployment if the requests matches the path and method where + * this action is routed. Be sure to route your httpAction in `convex/http.js`. + * + * @param func - The function. It receives an {@link ActionCtx} as its first argument + * and a Fetch API `Request` object as its second. + * @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up. + */ +export declare const httpAction: HttpActionBuilder; + +/** + * A set of services for use within Convex query functions. + * + * The query context is passed as the first argument to any Convex query + * function run on the server. + * + * This differs from the {@link MutationCtx} because all of the services are + * read-only. + */ +export type QueryCtx = GenericQueryCtx; + +/** + * A set of services for use within Convex mutation functions. + * + * The mutation context is passed as the first argument to any Convex mutation + * function run on the server. + */ +export type MutationCtx = GenericMutationCtx; + +/** + * A set of services for use within Convex action functions. + * + * The action context is passed as the first argument to any Convex action + * function run on the server. + */ +export type ActionCtx = GenericActionCtx; + +/** + * An interface to read from the database within Convex query functions. + * + * The two entry points are {@link DatabaseReader.get}, which fetches a single + * document by its {@link Id}, or {@link DatabaseReader.query}, which starts + * building a query. + */ +export type DatabaseReader = GenericDatabaseReader; + +/** + * An interface to read from and write to the database within Convex mutation + * functions. + * + * Convex guarantees that all writes within a single mutation are + * executed atomically, so you never have to worry about partial writes leaving + * your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control) + * for the guarantees Convex provides your functions. + */ +export type DatabaseWriter = GenericDatabaseWriter; diff --git a/convex/_generated/server.js b/convex/_generated/server.js new file mode 100644 index 0000000..bf3d25a --- /dev/null +++ b/convex/_generated/server.js @@ -0,0 +1,93 @@ +/* eslint-disable */ +/** + * Generated utilities for implementing server-side Convex query and mutation functions. + * + * THIS CODE IS AUTOMATICALLY GENERATED. + * + * To regenerate, run `npx convex dev`. + * @module + */ + +import { + actionGeneric, + httpActionGeneric, + queryGeneric, + mutationGeneric, + internalActionGeneric, + internalMutationGeneric, + internalQueryGeneric, +} from "convex/server"; + +/** + * Define a query in this Convex app's public API. + * + * This function will be allowed to read your Convex database and will be accessible from the client. + * + * @param func - The query function. It receives a {@link QueryCtx} as its first argument. + * @returns The wrapped query. Include this as an `export` to name it and make it accessible. + */ +export const query = queryGeneric; + +/** + * Define a query that is only accessible from other Convex functions (but not from the client). + * + * This function will be allowed to read from your Convex database. It will not be accessible from the client. + * + * @param func - The query function. It receives a {@link QueryCtx} as its first argument. + * @returns The wrapped query. Include this as an `export` to name it and make it accessible. + */ +export const internalQuery = internalQueryGeneric; + +/** + * Define a mutation in this Convex app's public API. + * + * This function will be allowed to modify your Convex database and will be accessible from the client. + * + * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. + * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. + */ +export const mutation = mutationGeneric; + +/** + * Define a mutation that is only accessible from other Convex functions (but not from the client). + * + * This function will be allowed to modify your Convex database. It will not be accessible from the client. + * + * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. + * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. + */ +export const internalMutation = internalMutationGeneric; + +/** + * Define an action in this Convex app's public API. + * + * An action is a function which can execute any JavaScript code, including non-deterministic + * code and code with side-effects, like calling third-party services. + * They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive. + * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}. + * + * @param func - The action. It receives an {@link ActionCtx} as its first argument. + * @returns The wrapped action. Include this as an `export` to name it and make it accessible. + */ +export const action = actionGeneric; + +/** + * Define an action that is only accessible from other Convex functions (but not from the client). + * + * @param func - The function. It receives an {@link ActionCtx} as its first argument. + * @returns The wrapped function. Include this as an `export` to name it and make it accessible. + */ +export const internalAction = internalActionGeneric; + +/** + * Define an HTTP action. + * + * The wrapped function will be used to respond to HTTP requests received + * by a Convex deployment if the requests matches the path and method where + * this action is routed. Be sure to route your httpAction in `convex/http.js`. + * + * @param func - The function. It receives an {@link ActionCtx} as its first argument + * and a Fetch API `Request` object as its second. + * @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up. + */ +export const httpAction = httpActionGeneric; diff --git a/package-lock.json b/package-lock.json index 977cf77..2dfc0f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -93,6 +93,7 @@ "cmdk": "^1.1.1", "concurrently": "^9.2.1", "convert-csv-to-json": "^3.20.0", + "convex": "^1.31.4", "crawlee": "^3.15.3", "critters": "^0.0.25", "csv-parse": "^6.1.0", diff --git a/package.json b/package.json index c5030d4..f67cfa7 100644 --- a/package.json +++ b/package.json @@ -129,6 +129,7 @@ "cmdk": "^1.1.1", "concurrently": "^9.2.1", "convert-csv-to-json": "^3.20.0", + "convex": "^1.31.4", "crawlee": "^3.15.3", "critters": "^0.0.25", "csv-parse": "^6.1.0", diff --git a/tsconfig.json b/tsconfig.json index 0a0753c..785aee3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -59,6 +59,11 @@ "hooks/**/*.tsx", "pages/**/*.ts", "pages/**/*.tsx", + "convex/**/*.ts", + "convex/**/*.tsx", + "convex/**/*.d.ts", + "convex/mastra/**/*.ts", + "convex/**/*.js", // Tests are excluded from the main typecheck run to avoid typechecking test-only imports // that may pull in declaration files with unsupported syntax from node_modules. "types/**/*.d.ts" From 6cc3aab95ec9c0da9906d044f35e8e0987ed837f Mon Sep 17 00:00:00 2001 From: ssdeanx Date: Wed, 14 Jan 2026 18:49:26 -0500 Subject: [PATCH 2/2] Normalize imports and formatting across codebase Reorganize and standardize imports/indentation in many mastra agent, network, and tool files. Add InternalSpans where needed and expand e2b tool imports. Comment out unused/unstable defaults (e.g. autoResumeSuspendedTools) and some unused imports. Adjust lucide-react icon names and fix a minor OpenAPI MD markup detail. --- app/api-reference/openapi-schema/page.mdx | 49 +- app/workflows/components/workflow-actions.tsx | 12 +- src/mastra/a2a/codingA2ACoordinator.ts | 188 ++--- src/mastra/agents/academicResearchAgent.ts | 2 +- src/mastra/agents/acpAgent.ts | 6 +- src/mastra/agents/bgColorAgent.ts | 32 +- src/mastra/agents/businessLegalAgents.ts | 599 ++++++++-------- src/mastra/agents/calendarAgent.ts | 100 +-- src/mastra/agents/codingAgents.ts | 654 +++++++++--------- src/mastra/agents/contentStrategistAgent.ts | 135 ++-- src/mastra/agents/copywriterAgent.ts | 140 ++-- src/mastra/agents/csv_to_excalidraw.ts | 86 +-- src/mastra/agents/customerSupportAgent.ts | 44 +- src/mastra/agents/dane.ts | 421 ++++++----- src/mastra/agents/dataExportAgent.ts | 94 +-- src/mastra/agents/dataIngestionAgent.ts | 92 +-- src/mastra/agents/dataProcessingAgent.ts | 167 +++-- src/mastra/agents/editorAgent.ts | 6 +- src/mastra/agents/financialAnalysisAgent.ts | 143 ++-- src/mastra/agents/graphingAgents.ts | 620 ++++++++--------- src/mastra/agents/recharts.ts | 389 ++++++----- src/mastra/agents/reportAgent.ts | 129 ++-- src/mastra/agents/researchAgent.ts | 194 +++--- src/mastra/agents/researchPaperAgent.ts | 115 ++- src/mastra/agents/scriptWriterAgent.ts | 118 ++-- src/mastra/agents/seoAgent.ts | 44 +- src/mastra/agents/socialMediaAgent.ts | 48 +- src/mastra/agents/translationAgent.ts | 40 +- src/mastra/agents/weather-agent.ts | 6 +- src/mastra/agents/webResearchAgent.ts | 16 +- src/mastra/config/pg-storage.ts | 26 +- src/mastra/index.ts | 47 +- .../networks/businessIntelligenceNetwork.ts | 56 +- src/mastra/networks/codingTeamNetwork.ts | 218 +++--- src/mastra/networks/contentCreationNetwork.ts | 60 +- src/mastra/networks/dataPipelineNetwork.ts | 57 +- src/mastra/networks/devopsNetwork.ts | 63 +- .../networks/financialIntelligenceNetwork.ts | 72 +- src/mastra/networks/index.ts | 74 +- src/mastra/networks/learningNetwork.ts | 60 +- .../networks/marketingAutomationNetwork.ts | 54 +- .../networks/reportGenerationNetwork.ts | 66 +- .../networks/researchPipelineNetwork.ts | 60 +- src/mastra/networks/securityNetwork.ts | 54 +- 44 files changed, 2817 insertions(+), 2839 deletions(-) diff --git a/app/api-reference/openapi-schema/page.mdx b/app/api-reference/openapi-schema/page.mdx index 45ce1c3..6356851 100644 --- a/app/api-reference/openapi-schema/page.mdx +++ b/app/api-reference/openapi-schema/page.mdx @@ -9,16 +9,18 @@ This section provides a detailed reference for the OpenAPI schema definitions ut ## System -
System (2 endpoints) +
+System (2 endpoints) - **GET** `/health` - Health check endpoint (no params | 200: healthy) - **GET** `/api` - Get API status (no params | 200: success) -
+
## AI SDK -
AI SDK (3 endpoints) +
+AI SDK (3 endpoints) - **POST** `/chat/{agentId}` - Chat with agent, stream AI SDK (path: agentId; body: messages[] | 200: stream, 400: invalid input, 404: agent not found) @@ -27,11 +29,12 @@ This section provides a detailed reference for the OpenAPI schema definitions ut - **POST** `/network/{agentId}` - Execute network, stream AI SDK (path: agentId; body: messages[], runtimeContext, maxSteps | 200: stream, 404: not found) -
+
## Agents -
Agents (35 endpoints) +
+Agents (35 endpoints) - **GET** `/.well-known/{agentId}/agent-card.json` - Get agent config (path: agentId | 200: config) @@ -99,7 +102,8 @@ This section provides a detailed reference for the OpenAPI schema definitions ut ## MCP -
MCP (9 endpoints) +
+MCP (9 endpoints) - **POST** `/api/mcp/{serverId}/mcp` - MCP Streamable HTTP (path: serverId; body: {} | 200: processed, 404: not found) @@ -121,7 +125,8 @@ This section provides a detailed reference for the OpenAPI schema definitions ut ## Network Memory -
Network Memory (9 endpoints) +
+Network Memory (9 endpoints) - **GET** `/api/memory/network/status` - Network memory status (query: networkId | 200: status) @@ -146,7 +151,8 @@ This section provides a detailed reference for the OpenAPI schema definitions ut ## Memory -
Memory (12 endpoints) +
+Memory (12 endpoints) - **GET** `/api/memory/status` - Memory status - **GET** `/api/memory/config` - Memory config (query: agentId | 200: config) @@ -173,7 +179,8 @@ This section provides a detailed reference for the OpenAPI schema definitions ut ## Telemetry -
Telemetry (2 endpoints) +
+Telemetry (2 endpoints) - **GET** `/api/telemetry` - Get telemetry - **POST** `/api/telemetry` - Post telemetry @@ -182,7 +189,8 @@ This section provides a detailed reference for the OpenAPI schema definitions ut ## Observability -
Observability (3 endpoints) +
+Observability (3 endpoints) - **GET** `/api/observability/traces` - List traces - **GET** `/api/observability/traces/{traceId}` - Get trace @@ -192,7 +200,8 @@ This section provides a detailed reference for the OpenAPI schema definitions ut ## Scores -
Scores (7 endpoints) +
+Scores (7 endpoints) - **GET** `/api/observability/traces/{traceId}/{spanId}/scores` - Span scores - **GET** `/api/scores/scorers` - List scorers @@ -206,7 +215,8 @@ This section provides a detailed reference for the OpenAPI schema definitions ut ## Legacy Workflows -
Legacy Workflows (10 endpoints) +
+Legacy Workflows (10 endpoints) - **GET** `/api/workflows/legacy` - List legacy - **GET** `/api/workflows/legacy/{workflowId}` - Get legacy @@ -222,7 +232,8 @@ This section provides a detailed reference for the OpenAPI schema definitions ut ## Workflows -
Workflows (18 endpoints) +
+Workflows (18 endpoints) - **GET** `/api/workflows` - List workflows - **GET** `/api/workflows/{workflowId}` - Get workflow @@ -249,7 +260,8 @@ This section provides a detailed reference for the OpenAPI schema definitions ut ## Logs -
Logs (3 endpoints) +
+Logs (3 endpoints) - **GET** `/api/logs` - List logs - **GET** `/api/logs/transports` - List transports @@ -259,7 +271,8 @@ This section provides a detailed reference for the OpenAPI schema definitions ut ## Agent Builder -
Agent Builder (13 endpoints) +
+Agent Builder (13 endpoints) - **GET** `/api/agent-builder` - List builders - **GET** `/api/agent-builder/{actionId}` - Get action @@ -281,7 +294,8 @@ This section provides a detailed reference for the OpenAPI schema definitions ut ## Tools -
Tools (3 endpoints) +
+Tools (3 endpoints) - **GET** `/api/tools` - List tools - **GET** `/api/tools/{toolId}` - Get tool @@ -291,7 +305,8 @@ This section provides a detailed reference for the OpenAPI schema definitions ut ## Vector -
Vector (6 endpoints) +
+Vector (6 endpoints) - **POST** `/api/vector/{vectorName}/upsert` - Upsert vectors - **POST** `/api/vector/{vectorName}/create-index` - Create index diff --git a/app/workflows/components/workflow-actions.tsx b/app/workflows/components/workflow-actions.tsx index 5321c93..f5e2d49 100644 --- a/app/workflows/components/workflow-actions.tsx +++ b/app/workflows/components/workflow-actions.tsx @@ -7,10 +7,10 @@ import { DownloadIcon, CodeIcon, ExternalLinkIcon, - LayoutHorizontalIcon, - LayoutVerticalIcon, + LayoutPanelLeftIcon, + LayoutPanelTopIcon, LayoutGridIcon, -} from 'lucide-react' +} from 'lucide-react' import { useCallback } from 'react' import { useReactFlow } from '@xyflow/react' @@ -60,8 +60,8 @@ export function WorkflowActions() { className="h-8 w-8" title="Horizontal Layout" > - - + +