From 2a97ed65d4b083b4ece82a4f3c6a0bb012ec88f1 Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:08:58 -0700 Subject: [PATCH 01/26] stub the agent protocol task and steps endpoints --- apps/nextjs/lib/AgentProtocol/openapi.json | 1967 +++++++++++++++++ apps/nextjs/lib/AgentProtocol/types.ts | 184 ++ apps/nextjs/src/pages/api/ap/index.ts | 24 + .../api/ap/v1/agent/tasks/[taskId]/index.ts | 41 + .../v1/agent/tasks/[taskId]/steps/[stepId].ts | 46 + .../ap/v1/agent/tasks/[taskId]/steps/index.ts | 94 + .../src/pages/api/ap/v1/agent/tasks/index.ts | 73 + apps/nextjs/src/utils/stub.ts | 9 + 8 files changed, 2438 insertions(+) create mode 100644 apps/nextjs/lib/AgentProtocol/openapi.json create mode 100644 apps/nextjs/lib/AgentProtocol/types.ts create mode 100644 apps/nextjs/src/pages/api/ap/index.ts create mode 100644 apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/index.ts create mode 100644 apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/[stepId].ts create mode 100644 apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/index.ts create mode 100644 apps/nextjs/src/pages/api/ap/v1/agent/tasks/index.ts create mode 100644 apps/nextjs/src/utils/stub.ts diff --git a/apps/nextjs/lib/AgentProtocol/openapi.json b/apps/nextjs/lib/AgentProtocol/openapi.json new file mode 100644 index 00000000..6c587a8c --- /dev/null +++ b/apps/nextjs/lib/AgentProtocol/openapi.json @@ -0,0 +1,1967 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Agent Protocol", + "description": "Specification of the API protocol for communication with an agent.", + "version": "v1" + }, + "servers": [ + { "url": "http://0.0.0.0:8000", "description": "Agent Protocol API" } + ], + "paths": { + "/ap/v1/agent/tasks": { + "post": { + "operationId": "createAgentTask", + "summary": "Creates a task for the agent.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "Body of the task request.", + "type": "object", + "properties": { + "input": { + "description": "Input prompt for the task.", + "type": "string", + "example": "Write 'Washington' to the file 'output.txt'.", + "nullable": true + }, + "additional_input": { + "description": "Input parameters for the task. Any value is allowed.", + "type": "object", + "example": "{\n\"debug\": false,\n\"mode\": \"benchmarks\"\n}" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "A new agent task was successfully created.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "description": "Body of the task request.", + "type": "object", + "properties": { + "input": { + "description": "Input prompt for the task.", + "type": "string", + "example": "Write 'Washington' to the file 'output.txt'.", + "nullable": true + }, + "additional_input": { + "description": "Input parameters for the task. Any value is allowed.", + "type": "object", + "example": "{\n\"debug\": false,\n\"mode\": \"benchmarks\"\n}" + } + } + }, + { + "type": "object", + "description": "Definition of an agent task.", + "required": ["task_id", "artifacts"], + "properties": { + "task_id": { + "description": "The ID of the task.", + "type": "string", + "example": "50da533e-3904-4401-8a07-c49adf88b5eb" + }, + "artifacts": { + "description": "A list of artifacts that the task has produced.", + "type": "array", + "items": { + "description": "An Artifact either created by or submitted to the agent.", + "type": "object", + "properties": { + "artifact_id": { + "description": "ID of the artifact.", + "type": "string", + "example": "b225e278-8b4c-4f99-a696-8facf19f0e56" + }, + "agent_created": { + "description": "Whether the artifact has been created by the agent.", + "type": "boolean", + "example": false + }, + "file_name": { + "description": "Filename of the artifact.", + "type": "string", + "example": "main.py" + }, + "relative_path": { + "description": "Relative path of the artifact in the agent's workspace.", + "type": "string", + "example": "python/code/", + "nullable": true + } + }, + "required": [ + "artifact_id", + "agent_created", + "file_name" + ] + }, + "example": [ + "7a49f31c-f9c6-4346-a22c-e32bc5af4d8e", + "ab7b4091-2560-4692-a4fe-d831ea3ca7d6" + ], + "default": [] + } + } + } + ] + } + } + }, + "x-postman-variables": [ + { + "type": "save", + "name": "task_id", + "path": ".task_id" + } + ] + }, + "422": { + "description": "Unable to process request. Likely due to improperly formatted request.", + "content": { + "application/json": { + "schema": { + "description": "A generic JSON object without any specific requirements.", + "type": "object" + } + } + } + }, + "default": { "description": "Internal Server Error" } + }, + "tags": ["agent"] + }, + "get": { + "operationId": "listAgentTasks", + "summary": "List all tasks that have been created for the agent.", + "parameters": [ + { + "name": "current_page", + "in": "query", + "description": "Page number", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 1, + "minimum": 1 + }, + "example": 2 + }, + { + "name": "page_size", + "in": "query", + "description": "Number of items per page", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 10, + "minimum": 1 + }, + "example": 25 + } + ], + "responses": { + "200": { + "description": "Returned list of agent's tasks.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tasks": { + "type": "array", + "items": { + "allOf": [ + { + "description": "Body of the task request.", + "type": "object", + "properties": { + "input": { + "description": "Input prompt for the task.", + "type": "string", + "example": "Write 'Washington' to the file 'output.txt'.", + "nullable": true + }, + "additional_input": { + "description": "Input parameters for the task. Any value is allowed.", + "type": "object", + "example": "{\n\"debug\": false,\n\"mode\": \"benchmarks\"\n}" + } + } + }, + { + "type": "object", + "description": "Definition of an agent task.", + "required": ["task_id", "artifacts"], + "properties": { + "task_id": { + "description": "The ID of the task.", + "type": "string", + "example": "50da533e-3904-4401-8a07-c49adf88b5eb" + }, + "artifacts": { + "description": "A list of artifacts that the task has produced.", + "type": "array", + "items": { + "description": "An Artifact either created by or submitted to the agent.", + "type": "object", + "properties": { + "artifact_id": { + "description": "ID of the artifact.", + "type": "string", + "example": "b225e278-8b4c-4f99-a696-8facf19f0e56" + }, + "agent_created": { + "description": "Whether the artifact has been created by the agent.", + "type": "boolean", + "example": false + }, + "file_name": { + "description": "Filename of the artifact.", + "type": "string", + "example": "main.py" + }, + "relative_path": { + "description": "Relative path of the artifact in the agent's workspace.", + "type": "string", + "example": "python/code/", + "nullable": true + } + }, + "required": [ + "artifact_id", + "agent_created", + "file_name" + ] + }, + "example": [ + "7a49f31c-f9c6-4346-a22c-e32bc5af4d8e", + "ab7b4091-2560-4692-a4fe-d831ea3ca7d6" + ], + "default": [] + } + } + } + ] + } + }, + "pagination": { + "type": "object", + "properties": { + "total_items": { + "description": "Total number of items.", + "type": "integer", + "example": 42 + }, + "total_pages": { + "description": "Total number of pages.", + "type": "integer", + "example": 97 + }, + "current_page": { + "description": "Current_page page number.", + "type": "integer", + "example": 1 + }, + "page_size": { + "description": "Number of items per page.", + "type": "integer", + "example": 25 + } + }, + "required": [ + "total_items", + "total_pages", + "current_page", + "page_size" + ] + } + }, + "required": ["tasks", "pagination"] + } + } + } + }, + "default": { "description": "Internal Server Error" } + }, + "tags": ["agent"] + } + }, + "/ap/v1/agent/tasks/{task_id}": { + "get": { + "operationId": "getAgentTask", + "summary": "Get details about a specified agent task.", + "parameters": [ + { + "name": "task_id", + "in": "path", + "description": "ID of the task", + "required": true, + "schema": { "type": "string" }, + "example": "1d5a533e-3904-4401-8a07-c49adf88b981", + "x-postman-variables": [{ "type": "load", "name": "task_id" }] + } + ], + "responses": { + "200": { + "description": "Returned details about an agent task.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "description": "Body of the task request.", + "type": "object", + "properties": { + "input": { + "description": "Input prompt for the task.", + "type": "string", + "example": "Write 'Washington' to the file 'output.txt'.", + "nullable": true + }, + "additional_input": { + "description": "Input parameters for the task. Any value is allowed.", + "type": "object", + "example": "{\n\"debug\": false,\n\"mode\": \"benchmarks\"\n}" + } + } + }, + { + "type": "object", + "description": "Definition of an agent task.", + "required": ["task_id", "artifacts"], + "properties": { + "task_id": { + "description": "The ID of the task.", + "type": "string", + "example": "50da533e-3904-4401-8a07-c49adf88b5eb" + }, + "artifacts": { + "description": "A list of artifacts that the task has produced.", + "type": "array", + "items": { + "description": "An Artifact either created by or submitted to the agent.", + "type": "object", + "properties": { + "artifact_id": { + "description": "ID of the artifact.", + "type": "string", + "example": "b225e278-8b4c-4f99-a696-8facf19f0e56" + }, + "agent_created": { + "description": "Whether the artifact has been created by the agent.", + "type": "boolean", + "example": false + }, + "file_name": { + "description": "Filename of the artifact.", + "type": "string", + "example": "main.py" + }, + "relative_path": { + "description": "Relative path of the artifact in the agent's workspace.", + "type": "string", + "example": "python/code/", + "nullable": true + } + }, + "required": [ + "artifact_id", + "agent_created", + "file_name" + ] + }, + "example": [ + "7a49f31c-f9c6-4346-a22c-e32bc5af4d8e", + "ab7b4091-2560-4692-a4fe-d831ea3ca7d6" + ], + "default": [] + } + } + } + ] + } + } + } + }, + "404": { + "description": "Unable to find entity with a given identifier", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "description": "Message stating the entity was not found", + "type": "string", + "example": "Unable to find entity with the provided id" + } + }, + "required": ["message"] + } + } + } + }, + "default": { "description": "Internal Server Error" } + }, + "tags": ["agent"] + } + }, + "/ap/v1/agent/tasks/{task_id}/steps": { + "get": { + "operationId": "listAgentTaskSteps", + "summary": "List all steps for the specified task.", + "parameters": [ + { + "name": "task_id", + "in": "path", + "description": "ID of the task.", + "required": true, + "schema": { "type": "string" }, + "example": "50da533e-3904-4401-8a07-c49adf88b5eb", + "x-postman-variables": [{ "type": "load", "name": "task_id" }] + }, + { + "name": "current_page", + "in": "query", + "description": "Page number", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 1, + "minimum": 1 + }, + "example": 2 + }, + { + "name": "page_size", + "in": "query", + "description": "Number of items per page", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 10, + "minimum": 1 + }, + "example": 25 + } + ], + "responses": { + "200": { + "description": "Returned list of agent's steps for the specified task.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "steps": { + "type": "array", + "items": { + "allOf": [ + { + "description": "Body of the task request.", + "type": "object", + "properties": { + "input": { + "description": "Input prompt for the step.", + "type": "string", + "example": "Write the words you receive to the file 'output.txt'.", + "nullable": true + }, + "additional_input": { + "description": "Input parameters for the task step. Any value is allowed.", + "type": "object", + "example": "{\n\"file_to_refactor\": \"models.py\"\n}" + } + } + }, + { + "type": "object", + "required": [ + "step_id", + "task_id", + "status", + "is_last", + "artifacts" + ], + "properties": { + "task_id": { + "description": "The ID of the task this step belongs to.", + "type": "string", + "example": "50da533e-3904-4401-8a07-c49adf88b5eb" + }, + "step_id": { + "description": "The ID of the task step.", + "type": "string", + "example": "6bb1801a-fd80-45e8-899a-4dd723cc602e" + }, + "name": { + "description": "The name of the task step.", + "type": "string", + "example": "Write to file", + "nullable": true + }, + "status": { + "description": "The status of the task step.", + "type": "string", + "example": "created", + "enum": ["created", "running", "completed"] + }, + "output": { + "description": "Output of the task step.", + "type": "string", + "example": "I am going to use the write_to_file command and write Washington to a file called output.txt Promise; +/** + * A function that handles a task. + * Returns a step handler. + */ +export type TaskHandler = ( + taskId: string, + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents + input: TaskInput | null, +) => Promise; +/** + * A step result with default values. + * @returns StepResult + */ +export declare class StepResultWithDefaults implements StepResult { + output?: StepOutput; + artifacts?: Artifact[]; + is_last?: boolean; +} +/** + * Creates a task for the agent. + * @param body TaskRequestBody | null + * @returns Promise + */ +export declare const createAgentTask: ( + body: TaskRequestBody | null, +) => Promise; +/** + * Lists all tasks that have been created for the agent. + * @returns Promise + */ +export declare const listAgentTaskIDs: () => Promise; +/** + * Get details about a specified agent task. + * @param taskId string + * @returns + */ +export declare const getAgentTask: (taskId: string) => Promise; +/** + * Lists all steps for the specified task. + * @param taskId string + * @returns Promise + */ +export declare const listAgentTaskSteps: (taskId: string) => Promise; +/** + * Execute a step in the specified agent task. + * @param taskId string + * @param body StepRequestBody | null + * @returns Promise + */ +export declare const executeAgentTaskStep: ( + taskId: string, + body: StepRequestBody | null, +) => Promise; +/** + * Get details about a specified task step. + * @param taskId string + * @param stepId string + * @returns Promise + */ +export declare const getAgentTaskStep: ( + taskId: string, + stepId: string, +) => Promise; +export interface AgentConfig { + port: number; + workspace: string; +} +export declare class Agent { + taskHandler: TaskHandler; + config: AgentConfig; + constructor(taskHandler: TaskHandler, config: AgentConfig); + static handleTask( + _taskHandler: TaskHandler, + config: Partial, + ): Agent; + start(port?: number): void; +} + +// export default Agent; diff --git a/apps/nextjs/src/pages/api/ap/index.ts b/apps/nextjs/src/pages/api/ap/index.ts new file mode 100644 index 00000000..9f394e03 --- /dev/null +++ b/apps/nextjs/src/pages/api/ap/index.ts @@ -0,0 +1,24 @@ +import { type NextRequest } from "next/server"; +import { stringify } from "superjson"; + +import AgentProtocolOpenAPISpec from "~/../lib/AgentProtocol/openapi.json"; + +export const config = { + runtime: "edge", +}; + +// (spec; exposes the agent protocol, not part of it) +export default function handler(req: NextRequest) { + const spec = AgentProtocolOpenAPISpec; + + if (spec.servers[0]) { + spec.servers[0].url = req.nextUrl.origin; + } + + return new Response(stringify(spec), { + status: 200, + headers: { + "content-type": "application/json", + }, + }); +} diff --git a/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/index.ts b/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/index.ts new file mode 100644 index 00000000..ecd73a18 --- /dev/null +++ b/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/index.ts @@ -0,0 +1,41 @@ +// api/ap/v1/agent/[...taskId].ts + +import { NextResponse, type NextRequest } from "next/server"; + +import { stub } from "~/utils/stub"; + +export const config = { + runtime: "edge", +}; + +// GET /ap/v1/agent/tasks/:taskId +export const getTask = async (taskId: string) => { + const task = stub.tasks[taskId]; + if (!task) { + return NextResponse.json( + { message: "Unable to find entity with the provided id" }, + { status: 404 }, + ); + } + return NextResponse.json(task); +}; + +export default async function handler(req: NextRequest) { + switch (req.method) { + case "GET": + const { searchParams } = new URL(req.url); + const taskId = searchParams.get("taskId"); + if (taskId) { + return getTask(taskId); + } + // warning: falls through to default case + default: + const status = 405; + return new Response("Method Not Allowed", { + headers: { + "Content-Type": "application/text", + }, + status, + }); + } +} diff --git a/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/[stepId].ts b/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/[stepId].ts new file mode 100644 index 00000000..5157d0b8 --- /dev/null +++ b/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/[stepId].ts @@ -0,0 +1,46 @@ +// apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/[stepId].ts + +import { NextResponse, type NextRequest } from "next/server"; +import { type Step } from "lib/AgentProtocol/types"; + +import { stub } from "~/utils/stub"; + +export const config = { + runtime: "edge", +}; + +// GET /ap/v1/agent/tasks/:taskId/steps/:stepId +export const getStep = (taskId: string, stepId: string) => { + const step: Step | undefined = stub.steps[stepId]; + if (!step) { + return NextResponse.json( + { message: "Unable to find step with the provided id" }, + { status: 404 }, + ); + } + return NextResponse.json(step); +}; + +export default async function handler(req: NextRequest) { + const { searchParams } = new URL(req.url); + const taskId = searchParams.get("taskId"); + const stepId = searchParams.get("stepId"); + if (!taskId || !stepId) { + return NextResponse.json( + { message: "Task ID or Step ID not found" }, + { status: 404 }, + ); + } + switch (req.method) { + case "GET": + return getStep(taskId, stepId); + default: + const status = 405; + return new Response("Method Not Allowed", { + headers: { + "Content-Type": "application/text", + }, + status, + }); + } +} diff --git a/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/index.ts b/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/index.ts new file mode 100644 index 00000000..72b3f6aa --- /dev/null +++ b/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/index.ts @@ -0,0 +1,94 @@ +import { NextResponse, type NextRequest } from "next/server"; +import { + StepStatus, + type StepRequestBody, + type Task, +} from "lib/AgentProtocol/types"; +import { v4 } from "uuid"; + +import { stub } from "~/utils/stub"; + +export const config = { + runtime: "edge", +}; + +// POST /ap/v1/agent/tasks/:taskId/steps +export const executeStep = (taskId: string, body: StepRequestBody) => { + const task: Task | undefined = stub.tasks[taskId]; + if (!task) { + // add task + return NextResponse.json( + { message: "Unable to find task with the provided id" }, + { status: 404 }, + ); + } + const step = { + step_id: v4(), + task_id: taskId, + artifacts: [], + input: body.input, + status: StepStatus.CREATED, + is_last: false, + }; + stub.steps[step.step_id] = step; + return NextResponse.json(step, { status: 200 }); +}; + +// GET /ap/v1/agent/tasks/:taskId/steps +export const listSteps = async (req: NextRequest, taskId: string) => { + const { searchParams } = new URL(req.url); + const currentPage = Number(searchParams.get("current_page")) || 1; + const pageSize = Number(searchParams.get("page_size")) || 10; + + const taskSteps = Object.values(stub.steps).filter( + (step) => step.task_id === taskId, + ); + const totalItems = taskSteps.length; + const totalPages = Math.ceil(totalItems / pageSize); + const offset = (currentPage - 1) * pageSize; + + const paginatedSteps = taskSteps.slice(offset, offset + pageSize); + + const pagination = { + total_items: totalItems, + total_pages: totalPages, + current_page: currentPage, + page_size: pageSize, + }; + + return NextResponse.json({ steps: paginatedSteps, pagination }); +}; + +export default async function handler(req: NextRequest) { + const { searchParams } = req.nextUrl; + const taskId = searchParams.get("taskId"); + if (!taskId) { + return Response.json( + { + message: "Steps cannot be returned because the task ID does not exist", + }, + { status: 404 }, + ); + } + if (!stub.tasks[taskId]) { + return Response.json( + { message: "Steps for the given task ID not found" }, + { status: 404 }, + ); + } + switch (req.method) { + case "POST": + const reqBody = (await req.json()) as StepRequestBody; + return executeStep(taskId, reqBody); + case "GET": + return listSteps(req, taskId); + default: + const status = 405; + return new Response("Method Not Allowed", { + headers: { + "Content-Type": "application/text", + }, + status, + }); + } +} diff --git a/apps/nextjs/src/pages/api/ap/v1/agent/tasks/index.ts b/apps/nextjs/src/pages/api/ap/v1/agent/tasks/index.ts new file mode 100644 index 00000000..f989e71b --- /dev/null +++ b/apps/nextjs/src/pages/api/ap/v1/agent/tasks/index.ts @@ -0,0 +1,73 @@ +// api/ap/v1/agent/tasks/index.ts + +import { NextResponse, type NextRequest } from "next/server"; +import { v4, type TaskRequestBody } from "lib/AgentProtocol/types"; + +import { stub } from "~/utils/stub"; + +export const config = { + runtime: "edge", +}; + +// POST /ap/v1/agent/tasks +export const createTask = (body: TaskRequestBody) => { + const task = { + task_id: v4(), + artifacts: [], + input: body.input, + }; + stub.tasks[task.task_id] = task; + return NextResponse.json(task, { status: 200 }); +}; + +// GET /ap/v1/agent/tasks +export const listTasks = async (req: NextRequest) => { + const { searchParams } = new URL(req.url); + const currentPage = Number(searchParams.get("current_page")) || 1; + const pageSize = Number(searchParams.get("page_size")) || 10; + + const totalItems = Object.keys(stub.tasks).length; + const totalPages = Math.ceil(totalItems / pageSize); + const offset = (currentPage - 1) * pageSize; + + const paginatedTasks = Object.values(stub.tasks).slice( + offset, + offset + pageSize, + ); + + const pagination = { + total_items: totalItems, + total_pages: totalPages, + current_page: currentPage, + page_size: pageSize, + }; + + return NextResponse.json({ tasks: paginatedTasks, pagination }); +}; + +// GET /ap/v1/agent/tasks/:taskId +export const getTask = async (taskId: string) => { + const task = stub.tasks[taskId]; + if (!task) { + return NextResponse.json({ error: "Task not found" }, { status: 404 }); + } + return NextResponse.json(task); +}; + +export default async function handler(req: NextRequest) { + switch (req.method) { + case "POST": + const reqBody = (await req.json()) as TaskRequestBody; + return createTask(reqBody); + case "GET": + return listTasks(req); + default: + const status = 405; + return new Response("Method Not Allowed", { + headers: { + "Content-Type": "application/text", + }, + status, + }); + } +} diff --git a/apps/nextjs/src/utils/stub.ts b/apps/nextjs/src/utils/stub.ts new file mode 100644 index 00000000..4dc82b1a --- /dev/null +++ b/apps/nextjs/src/utils/stub.ts @@ -0,0 +1,9 @@ +import { type Step, type Task } from "lib/AgentProtocol/types"; + +export const tasks: Record = {}; +export const steps: Record = {}; + +export const stub = { + tasks, + steps, +}; From 30e9d1356fddb1c96c23f7989a41c79c3b2fa6c7 Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Mon, 23 Oct 2023 17:02:25 -0700 Subject: [PATCH 02/26] add origin and work on createPlan --- apps/nextjs/src/pages/api/execution/graph.ts | 9 ++++++- apps/nextjs/src/pages/api/result.ts | 10 ++++++-- packages/api/src/router/execution.ts | 25 ++++++++++++++++++-- packages/api/src/trpc.ts | 7 ++++++ 4 files changed, 46 insertions(+), 5 deletions(-) diff --git a/apps/nextjs/src/pages/api/execution/graph.ts b/apps/nextjs/src/pages/api/execution/graph.ts index 46d83853..ea087a32 100644 --- a/apps/nextjs/src/pages/api/execution/graph.ts +++ b/apps/nextjs/src/pages/api/execution/graph.ts @@ -22,6 +22,7 @@ export type UpdateGraphParams = { graph: OldPlanWireFormat | null; goalPrompt: string; session?: Session | null; + origin?: string | undefined; }; // data proxy for edge @@ -34,6 +35,7 @@ export default async function updateGraphProxy( const { json: params } = req.body as { json: UpdateGraphParams }; params["session"] = session; + params["origin"] = req.headers.origin; const result = await updateGraph(params); res.status(200).json(result); @@ -48,8 +50,13 @@ async function updateGraph({ graph, goalPrompt, session, + origin, }: UpdateGraphParams): Promise { - const caller = appRouter.createCaller({ session: session || null, prisma }); + const caller = appRouter.createCaller({ + session: session || null, + prisma, + origin, + }); if (graph == null) { const updated = await caller.execution.updateState({ state: ExecutionState.ERROR, diff --git a/apps/nextjs/src/pages/api/result.ts b/apps/nextjs/src/pages/api/result.ts index 1e3561db..4c72d13c 100644 --- a/apps/nextjs/src/pages/api/result.ts +++ b/apps/nextjs/src/pages/api/result.ts @@ -25,6 +25,7 @@ export type CreateResultParams = { packets: AgentPacket[]; state: ExecutionState; session?: Session | null; + origin?: string | undefined; }; // data proxy for edge @@ -37,6 +38,7 @@ export default async function createResultProxy( const params = req.body as CreateResultParams; params["session"] = session; + params["origin"] = req.headers.origin; const result = await createResult(params); console.debug("createResult result", result); @@ -50,8 +52,12 @@ export default async function createResultProxy( async function createResult( createResultOptions: CreateResultParams, ): Promise<[Result, Execution]> { - const { session } = createResultOptions; - const caller = appRouter.createCaller({ session: session || null, prisma }); + const { session, origin } = createResultOptions; + const caller = appRouter.createCaller({ + session: session || null, + prisma, + origin, + }); const createResult = caller.result.create(createResultOptions); return createResult; } diff --git a/packages/api/src/router/execution.ts b/packages/api/src/router/execution.ts index 1fbf7d54..3f7ffca4 100644 --- a/packages/api/src/router/execution.ts +++ b/packages/api/src/router/execution.ts @@ -1,13 +1,18 @@ +import { getFetch } from "@trpc/client"; import { z } from "zod"; -import { hookRootUpToServerGraph, makeServerIdIfNeeded } from "@acme/agent"; +import { + hookRootUpToServerGraph, + makeServerIdIfNeeded, + type ModelCreationProps, +} from "@acme/agent"; import { ExecutionState, type DraftExecutionEdge, type DraftExecutionNode, } from "@acme/db"; -import { createTRPCRouter, protectedProcedure } from "../trpc"; +import { createTRPCRouter, protectedProcedure, publicProcedure } from "../trpc"; import withLock from "./lock"; export const dagShape = z.object({ @@ -146,4 +151,20 @@ export const executionRouter = createTRPCRouter({ }, }); }), + + createPlan: publicProcedure + .input( + z.object({ + goalPrompt: z.string().min(1).cuid(), + goalId: z.string().min(1).cuid(), + executionId: z.string().min(1).cuid(), + creationProps: z.custom(), + }), + ) + .mutation(({ ctx, input }) => { + const { goalPrompt, goalId, executionId, creationProps } = input; + const userId = ctx.session?.user.id; + + return getFetch()(`${ctx.origin}/api/agent/plan`, {}); + }), }); diff --git a/packages/api/src/trpc.ts b/packages/api/src/trpc.ts index bcced804..77551a60 100644 --- a/packages/api/src/trpc.ts +++ b/packages/api/src/trpc.ts @@ -25,6 +25,7 @@ import { prisma } from "@acme/db"; */ type CreateContextOptions = { session: Session | null; + origin: string | undefined; }; /** @@ -40,6 +41,7 @@ const createInnerTRPCContext = (opts: CreateContextOptions) => { return { session: opts.session, prisma, + origin: opts.origin, }; }; @@ -54,8 +56,13 @@ export const createTRPCContext = async (opts: CreateNextContextOptions) => { // Get the session from the server using the unstable_getServerSession wrapper function const session = await getServerSession({ req, res }); + if (!req.headers.origin) { + throw new Error("No origin header"); + } + return createInnerTRPCContext({ session, + origin: req.headers.origin, }); }; From 82fdc22c69fe042d3f368182b3e0c7913e9e82e8 Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Mon, 23 Oct 2023 17:24:26 -0700 Subject: [PATCH 03/26] move to app router for agent protocol endpoints --- .../api/ap/index.ts => app/api/ap/route.ts} | 7 +- .../api/ap/v1/agent/tasks/[stepId]/route.ts} | 57 +++------------ .../src/app/api/ap/v1/agent/tasks/route.ts | 43 +++++++++++ .../api/ap/v1/agent/tasks/[taskId]/index.ts | 41 ----------- .../v1/agent/tasks/[taskId]/steps/[stepId].ts | 46 ------------ .../src/pages/api/ap/v1/agent/tasks/index.ts | 73 ------------------- apps/nextjs/tsconfig.json | 11 ++- .../agent/src/skills/AgentProtocolSkill.ts | 40 ++++++++++ packages/api/src/trpc.ts | 6 +- 9 files changed, 109 insertions(+), 215 deletions(-) rename apps/nextjs/src/{pages/api/ap/index.ts => app/api/ap/route.ts} (73%) rename apps/nextjs/src/{pages/api/ap/v1/agent/tasks/[taskId]/steps/index.ts => app/api/ap/v1/agent/tasks/[stepId]/route.ts} (50%) create mode 100644 apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts delete mode 100644 apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/index.ts delete mode 100644 apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/[stepId].ts delete mode 100644 apps/nextjs/src/pages/api/ap/v1/agent/tasks/index.ts create mode 100644 packages/agent/src/skills/AgentProtocolSkill.ts diff --git a/apps/nextjs/src/pages/api/ap/index.ts b/apps/nextjs/src/app/api/ap/route.ts similarity index 73% rename from apps/nextjs/src/pages/api/ap/index.ts rename to apps/nextjs/src/app/api/ap/route.ts index 9f394e03..d9b2d3bc 100644 --- a/apps/nextjs/src/pages/api/ap/index.ts +++ b/apps/nextjs/src/app/api/ap/route.ts @@ -3,12 +3,9 @@ import { stringify } from "superjson"; import AgentProtocolOpenAPISpec from "~/../lib/AgentProtocol/openapi.json"; -export const config = { - runtime: "edge", -}; +export const runtime = "edge"; // 'nodejs' is the default -// (spec; exposes the agent protocol, not part of it) -export default function handler(req: NextRequest) { +export function GET(req: NextRequest) { const spec = AgentProtocolOpenAPISpec; if (spec.servers[0]) { diff --git a/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/index.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[stepId]/route.ts similarity index 50% rename from apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/index.ts rename to apps/nextjs/src/app/api/ap/v1/agent/tasks/[stepId]/route.ts index 72b3f6aa..66abf1f2 100644 --- a/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/index.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[stepId]/route.ts @@ -8,20 +8,19 @@ import { v4 } from "uuid"; import { stub } from "~/utils/stub"; -export const config = { - runtime: "edge", -}; - // POST /ap/v1/agent/tasks/:taskId/steps -export const executeStep = (taskId: string, body: StepRequestBody) => { +export async function POST(request: NextRequest) { + const taskId = request.nextUrl.searchParams.get("taskId"); + const body = (await request.json()) as StepRequestBody; + const task: Task | undefined = stub.tasks[taskId]; if (!task) { - // add task return NextResponse.json( { message: "Unable to find task with the provided id" }, { status: 404 }, ); } + const step = { step_id: v4(), task_id: taskId, @@ -30,15 +29,17 @@ export const executeStep = (taskId: string, body: StepRequestBody) => { status: StepStatus.CREATED, is_last: false, }; + stub.steps[step.step_id] = step; return NextResponse.json(step, { status: 200 }); -}; +} // GET /ap/v1/agent/tasks/:taskId/steps -export const listSteps = async (req: NextRequest, taskId: string) => { - const { searchParams } = new URL(req.url); - const currentPage = Number(searchParams.get("current_page")) || 1; - const pageSize = Number(searchParams.get("page_size")) || 10; +export async function GET(request: NextRequest) { + const taskId = request.nextUrl.searchParams.get("taskId"); + const currentPage = + Number(request.nextUrl.searchParams.get("current_page")) || 1; + const pageSize = Number(request.nextUrl.searchParams.get("page_size")) || 10; const taskSteps = Object.values(stub.steps).filter( (step) => step.task_id === taskId, @@ -57,38 +58,4 @@ export const listSteps = async (req: NextRequest, taskId: string) => { }; return NextResponse.json({ steps: paginatedSteps, pagination }); -}; - -export default async function handler(req: NextRequest) { - const { searchParams } = req.nextUrl; - const taskId = searchParams.get("taskId"); - if (!taskId) { - return Response.json( - { - message: "Steps cannot be returned because the task ID does not exist", - }, - { status: 404 }, - ); - } - if (!stub.tasks[taskId]) { - return Response.json( - { message: "Steps for the given task ID not found" }, - { status: 404 }, - ); - } - switch (req.method) { - case "POST": - const reqBody = (await req.json()) as StepRequestBody; - return executeStep(taskId, reqBody); - case "GET": - return listSteps(req, taskId); - default: - const status = 405; - return new Response("Method Not Allowed", { - headers: { - "Content-Type": "application/text", - }, - status, - }); - } } diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts new file mode 100644 index 00000000..ed73010c --- /dev/null +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts @@ -0,0 +1,43 @@ +import { NextResponse, type NextRequest } from "next/server"; +import { v4, type TaskRequestBody } from "lib/AgentProtocol/types"; + +import { stub } from "~/utils/stub"; + +// POST /ap/v1/agent/tasks +export async function POST(request: NextRequest) { + const body = (await request.json()) as TaskRequestBody; + + const task = { + task_id: v4(), + artifacts: [], + input: body.input, + }; + + stub.tasks[task.task_id] = task; + return NextResponse.json(task, { status: 200 }); +} + +// GET /ap/v1/agent/tasks +export async function GET(request: NextRequest) { + const currentPage = + Number(request.nextUrl.searchParams.get("current_page")) || 1; + const pageSize = Number(request.nextUrl.searchParams.get("page_size")) || 10; + + const totalItems = Object.keys(stub.tasks).length; + const totalPages = Math.ceil(totalItems / pageSize); + const offset = (currentPage - 1) * pageSize; + + const paginatedTasks = Object.values(stub.tasks).slice( + offset, + offset + pageSize, + ); + + const pagination = { + total_items: totalItems, + total_pages: totalPages, + current_page: currentPage, + page_size: pageSize, + }; + + return NextResponse.json({ tasks: paginatedTasks, pagination }); +} diff --git a/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/index.ts b/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/index.ts deleted file mode 100644 index ecd73a18..00000000 --- a/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/index.ts +++ /dev/null @@ -1,41 +0,0 @@ -// api/ap/v1/agent/[...taskId].ts - -import { NextResponse, type NextRequest } from "next/server"; - -import { stub } from "~/utils/stub"; - -export const config = { - runtime: "edge", -}; - -// GET /ap/v1/agent/tasks/:taskId -export const getTask = async (taskId: string) => { - const task = stub.tasks[taskId]; - if (!task) { - return NextResponse.json( - { message: "Unable to find entity with the provided id" }, - { status: 404 }, - ); - } - return NextResponse.json(task); -}; - -export default async function handler(req: NextRequest) { - switch (req.method) { - case "GET": - const { searchParams } = new URL(req.url); - const taskId = searchParams.get("taskId"); - if (taskId) { - return getTask(taskId); - } - // warning: falls through to default case - default: - const status = 405; - return new Response("Method Not Allowed", { - headers: { - "Content-Type": "application/text", - }, - status, - }); - } -} diff --git a/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/[stepId].ts b/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/[stepId].ts deleted file mode 100644 index 5157d0b8..00000000 --- a/apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/[stepId].ts +++ /dev/null @@ -1,46 +0,0 @@ -// apps/nextjs/src/pages/api/ap/v1/agent/tasks/[taskId]/steps/[stepId].ts - -import { NextResponse, type NextRequest } from "next/server"; -import { type Step } from "lib/AgentProtocol/types"; - -import { stub } from "~/utils/stub"; - -export const config = { - runtime: "edge", -}; - -// GET /ap/v1/agent/tasks/:taskId/steps/:stepId -export const getStep = (taskId: string, stepId: string) => { - const step: Step | undefined = stub.steps[stepId]; - if (!step) { - return NextResponse.json( - { message: "Unable to find step with the provided id" }, - { status: 404 }, - ); - } - return NextResponse.json(step); -}; - -export default async function handler(req: NextRequest) { - const { searchParams } = new URL(req.url); - const taskId = searchParams.get("taskId"); - const stepId = searchParams.get("stepId"); - if (!taskId || !stepId) { - return NextResponse.json( - { message: "Task ID or Step ID not found" }, - { status: 404 }, - ); - } - switch (req.method) { - case "GET": - return getStep(taskId, stepId); - default: - const status = 405; - return new Response("Method Not Allowed", { - headers: { - "Content-Type": "application/text", - }, - status, - }); - } -} diff --git a/apps/nextjs/src/pages/api/ap/v1/agent/tasks/index.ts b/apps/nextjs/src/pages/api/ap/v1/agent/tasks/index.ts deleted file mode 100644 index f989e71b..00000000 --- a/apps/nextjs/src/pages/api/ap/v1/agent/tasks/index.ts +++ /dev/null @@ -1,73 +0,0 @@ -// api/ap/v1/agent/tasks/index.ts - -import { NextResponse, type NextRequest } from "next/server"; -import { v4, type TaskRequestBody } from "lib/AgentProtocol/types"; - -import { stub } from "~/utils/stub"; - -export const config = { - runtime: "edge", -}; - -// POST /ap/v1/agent/tasks -export const createTask = (body: TaskRequestBody) => { - const task = { - task_id: v4(), - artifacts: [], - input: body.input, - }; - stub.tasks[task.task_id] = task; - return NextResponse.json(task, { status: 200 }); -}; - -// GET /ap/v1/agent/tasks -export const listTasks = async (req: NextRequest) => { - const { searchParams } = new URL(req.url); - const currentPage = Number(searchParams.get("current_page")) || 1; - const pageSize = Number(searchParams.get("page_size")) || 10; - - const totalItems = Object.keys(stub.tasks).length; - const totalPages = Math.ceil(totalItems / pageSize); - const offset = (currentPage - 1) * pageSize; - - const paginatedTasks = Object.values(stub.tasks).slice( - offset, - offset + pageSize, - ); - - const pagination = { - total_items: totalItems, - total_pages: totalPages, - current_page: currentPage, - page_size: pageSize, - }; - - return NextResponse.json({ tasks: paginatedTasks, pagination }); -}; - -// GET /ap/v1/agent/tasks/:taskId -export const getTask = async (taskId: string) => { - const task = stub.tasks[taskId]; - if (!task) { - return NextResponse.json({ error: "Task not found" }, { status: 404 }); - } - return NextResponse.json(task); -}; - -export default async function handler(req: NextRequest) { - switch (req.method) { - case "POST": - const reqBody = (await req.json()) as TaskRequestBody; - return createTask(reqBody); - case "GET": - return listTasks(req); - default: - const status = 405; - return new Response("Method Not Allowed", { - headers: { - "Content-Type": "application/text", - }, - status, - }); - } -} diff --git a/apps/nextjs/tsconfig.json b/apps/nextjs/tsconfig.json index 1527b8ef..255eed82 100644 --- a/apps/nextjs/tsconfig.json +++ b/apps/nextjs/tsconfig.json @@ -3,9 +3,16 @@ "compilerOptions": { "baseUrl": ".", "paths": { - "~/*": ["./src/*"] + "~/*": [ + "./src/*" + ] }, - "plugins": [{ "name": "next" }] + "plugins": [ + { + "name": "next" + } + ], + "strictNullChecks": true }, "exclude": [], "include": [ diff --git a/packages/agent/src/skills/AgentProtocolSkill.ts b/packages/agent/src/skills/AgentProtocolSkill.ts new file mode 100644 index 00000000..8299f72b --- /dev/null +++ b/packages/agent/src/skills/AgentProtocolSkill.ts @@ -0,0 +1,40 @@ +import { type ZeroShotCreatePromptArgs } from "langchain/agents"; +import { createOpenApiAgent, OpenApiToolkit } from "langchain/agents/toolkits"; +import { type BaseLanguageModel } from "langchain/base_language"; +import { type OpenAPIChainOptions } from "langchain/chains"; +import { type JsonSpec } from "langchain/tools"; + +export type AgentProtocolCreatePromptArgs = OpenAPIChainOptions & + ZeroShotCreatePromptArgs & { + openAPISpecUrl?: string; + }; +/** + * Extends the `OpenApiToolkit` class and adds functionality for + * interacting with agent-protocol-compliant agents. + */ +export class AgentProtocolToolkit extends OpenApiToolkit { + constructor( + jsonSpec: JsonSpec, + llm: BaseLanguageModel, + args: AgentProtocolCreatePromptArgs, + ) { + super(jsonSpec, llm, args.headers); + // Add any additional tools or functionality needed for agent-protocol-compliant agents here. + } +} + +/** + * Creates an agent that can interact with agent-protocol-compliant agents. + * @param llm The language model to use. + * @param agentProtocolToolkit The AgentProtocolToolkit to use. + * @param args Optional arguments for creating the prompt. + * @returns An AgentExecutor for executing the agent with the tools. + */ +export function createAgentProtocolAgent( + llm: BaseLanguageModel, + agentProtocolToolkit: AgentProtocolToolkit, + args?: ZeroShotCreatePromptArgs, +) { + // Use the existing createOpenApiAgent function, but pass in the AgentProtocolToolkit instead. + return createOpenApiAgent(llm, agentProtocolToolkit, args); +} diff --git a/packages/api/src/trpc.ts b/packages/api/src/trpc.ts index 77551a60..1f4bb8bc 100644 --- a/packages/api/src/trpc.ts +++ b/packages/api/src/trpc.ts @@ -56,9 +56,9 @@ export const createTRPCContext = async (opts: CreateNextContextOptions) => { // Get the session from the server using the unstable_getServerSession wrapper function const session = await getServerSession({ req, res }); - if (!req.headers.origin) { - throw new Error("No origin header"); - } + // if (!req.headers.origin) { + // throw new Error("No origin header"); + // } return createInnerTRPCContext({ session, From 1f4d82190fe5a91eb95c13f0d2bb7367723c0a9e Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Mon, 23 Oct 2023 21:01:02 -0700 Subject: [PATCH 04/26] agent protocol conforms up to artifact upload --- apps/nextjs/lib/AgentProtocol/types.ts | 5 +- apps/nextjs/src/app/api/ap/route.ts | 1 + .../api/ap/v1/agent/tasks/[stepId]/route.ts | 61 ------------ .../api/ap/v1/agent/tasks/[taskId]/route.ts | 88 ++++++++++++++++++ .../tasks/[taskId]/steps/[stepId]/route.ts | 44 +++++++++ .../ap/v1/agent/tasks/[taskId]/steps/route.ts | 93 +++++++++++++++++++ .../src/app/api/ap/v1/agent/tasks/route.ts | 66 +++++++++---- packages/api/src/router/execution.ts | 73 ++++++++++++++- packages/api/src/router/goal.ts | 32 ++++++- 9 files changed, 377 insertions(+), 86 deletions(-) delete mode 100644 apps/nextjs/src/app/api/ap/v1/agent/tasks/[stepId]/route.ts create mode 100644 apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts create mode 100644 apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts create mode 100644 apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts diff --git a/apps/nextjs/lib/AgentProtocol/types.ts b/apps/nextjs/lib/AgentProtocol/types.ts index 2a14630c..73e3be8a 100644 --- a/apps/nextjs/lib/AgentProtocol/types.ts +++ b/apps/nextjs/lib/AgentProtocol/types.ts @@ -1,5 +1,3 @@ -export { v4 } from "uuid"; - /** * Input parameters for the task. Any value is allowed. */ @@ -92,9 +90,12 @@ export interface Task { * A list of artifacts that the task has produced. */ artifacts?: Artifact[]; + + additional_input?: object; } export interface TaskRequestBody { input?: TaskInput; + additional_input?: object; } /** diff --git a/apps/nextjs/src/app/api/ap/route.ts b/apps/nextjs/src/app/api/ap/route.ts index d9b2d3bc..62527d91 100644 --- a/apps/nextjs/src/app/api/ap/route.ts +++ b/apps/nextjs/src/app/api/ap/route.ts @@ -4,6 +4,7 @@ import { stringify } from "superjson"; import AgentProtocolOpenAPISpec from "~/../lib/AgentProtocol/openapi.json"; export const runtime = "edge"; // 'nodejs' is the default +export const dynamic = "force-static"; export function GET(req: NextRequest) { const spec = AgentProtocolOpenAPISpec; diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[stepId]/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[stepId]/route.ts deleted file mode 100644 index 66abf1f2..00000000 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[stepId]/route.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { NextResponse, type NextRequest } from "next/server"; -import { - StepStatus, - type StepRequestBody, - type Task, -} from "lib/AgentProtocol/types"; -import { v4 } from "uuid"; - -import { stub } from "~/utils/stub"; - -// POST /ap/v1/agent/tasks/:taskId/steps -export async function POST(request: NextRequest) { - const taskId = request.nextUrl.searchParams.get("taskId"); - const body = (await request.json()) as StepRequestBody; - - const task: Task | undefined = stub.tasks[taskId]; - if (!task) { - return NextResponse.json( - { message: "Unable to find task with the provided id" }, - { status: 404 }, - ); - } - - const step = { - step_id: v4(), - task_id: taskId, - artifacts: [], - input: body.input, - status: StepStatus.CREATED, - is_last: false, - }; - - stub.steps[step.step_id] = step; - return NextResponse.json(step, { status: 200 }); -} - -// GET /ap/v1/agent/tasks/:taskId/steps -export async function GET(request: NextRequest) { - const taskId = request.nextUrl.searchParams.get("taskId"); - const currentPage = - Number(request.nextUrl.searchParams.get("current_page")) || 1; - const pageSize = Number(request.nextUrl.searchParams.get("page_size")) || 10; - - const taskSteps = Object.values(stub.steps).filter( - (step) => step.task_id === taskId, - ); - const totalItems = taskSteps.length; - const totalPages = Math.ceil(totalItems / pageSize); - const offset = (currentPage - 1) * pageSize; - - const paginatedSteps = taskSteps.slice(offset, offset + pageSize); - - const pagination = { - total_items: totalItems, - total_pages: totalPages, - current_page: currentPage, - page_size: pageSize, - }; - - return NextResponse.json({ steps: paginatedSteps, pagination }); -} diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts new file mode 100644 index 00000000..cb95e510 --- /dev/null +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts @@ -0,0 +1,88 @@ +import { NextResponse, type NextRequest } from "next/server"; +import { type Task, type TaskRequestBody } from "lib/AgentProtocol/types"; +import { getServerSession } from "next-auth"; + +import { appRouter } from "@acme/api"; +import { authOptions } from "@acme/auth"; +import { prisma } from "@acme/db"; + +// POST /ap/v1/agent/tasks/:taskId +export async function POST( + request: NextRequest, + { params: { taskId } }: { params: { taskId: string } }, +) { + if (!taskId) { + return NextResponse.json( + { message: "Unable to find entity with the provided id" }, + { status: 404 }, + ); + } + const body = (await request.json()) as TaskRequestBody; + + if (!body.input) { + return NextResponse.json({ message: "Input is required" }, { status: 400 }); + } + const session = (await getServerSession(authOptions)) || null; + + const caller = appRouter.createCaller({ + session, + prisma, + origin: request.nextUrl.origin, + }); + + // const goal = await caller.goal.byId(taskId); + const goal = await caller.goal.create({ prompt: body.input }); + const exe = await caller.execution.create({ goalId: goal.id }); + return caller.execution.createPlan({ + executionId: exe.id, + goalId: taskId, + goalPrompt: goal.prompt, + creationProps: {}, + }); +} + +// GET /ap/v1/agent/tasks/:taskId +export async function GET( + request: NextRequest, + { params: { taskId } }: { params: { taskId: string } }, +) { + if (!taskId) { + return NextResponse.json( + { message: "Unable to find entity with the provided id" }, + { status: 404 }, + ); + } + const session = (await getServerSession(authOptions)) || null; + + const caller = appRouter.createCaller({ + session, + prisma, + origin: request.nextUrl.origin, + }); + + const exe = await caller.execution.byId({ id: taskId }); + + if (!exe) { + return NextResponse.json( + { message: "Unable to find entity with the provided id" }, + { status: 404 }, + ); + } + const goal = await caller.goal.byId(exe?.goalId); + + // artifact_id: string; + // agent_created: boolean; + // file_name: string; + // relative_path: string | null; + // created_at: string; + // const artifacts: Artifact[] = exe.results?.map((r) => {return {artifact_id: r.id, "agent_created": true, file_name: r. }}) || []; + + const task: Task = { + task_id: taskId, + input: goal?.prompt, + artifacts: [], + additional_input: {}, + }; + + return Response.json(task, { status: 200 }); +} diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts new file mode 100644 index 00000000..f4044894 --- /dev/null +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts @@ -0,0 +1,44 @@ +import { NextResponse, type NextRequest } from "next/server"; +import { getServerSession } from "next-auth"; + +import { appRouter } from "@acme/api"; +import { authOptions } from "@acme/auth"; +import { prisma } from "@acme/db"; + +// GET /ap/v1/agent/tasks/:taskId/steps/:stepId +export async function GET( + req: NextRequest, + { + params: { taskId, stepId }, + }: { params: { taskId: string; stepId: string } }, +) { + if (!taskId) { + return NextResponse.json( + { message: "Unable to find entity with the provided id" }, + { status: 404 }, + ); + } + + const session = await getServerSession(authOptions); + + const caller = appRouter.createCaller({ + session: session || null, + prisma, + origin: req.nextUrl.origin, + }); + const goal = await caller.goal.byId(taskId); + if (!goal?.executions[0]?.id) { + return NextResponse.json( + { message: "Unable to find entity with the provided id" }, + { status: 404 }, + ); + } + const taskSteps = goal.executions[0].graph?.nodes || []; + + const step = taskSteps.find((step) => step.id === stepId); + + return Response.json(step, { + status: 200, + headers: { "content-type": "application/json" }, + }); +} diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts new file mode 100644 index 00000000..429efc5d --- /dev/null +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts @@ -0,0 +1,93 @@ +import { NextResponse, type NextRequest } from "next/server"; +import { type StepRequestBody } from "lib/AgentProtocol/types"; +import { getServerSession } from "next-auth"; + +import { appRouter } from "@acme/api"; +import { authOptions } from "@acme/auth"; +import { prisma } from "@acme/db"; + +// POST /ap/v1/agent/tasks/:taskId/steps +export async function POST( + request: NextRequest, + { params: { taskId } }: { params: { taskId: string } }, +) { + if (!taskId) { + return NextResponse.json( + { message: "Unable to find entity with the provided id" }, + { status: 404 }, + ); + } + const body = (await request.json()) as StepRequestBody; + + if (!body.input) { + return NextResponse.json({ message: "Input is required" }, { status: 400 }); + } + + const session = (await getServerSession(authOptions)) || null; + + const caller = appRouter.createCaller({ + session, + prisma, + origin: request.nextUrl.origin, + }); + + // const goal = await caller.goal.byId(taskId); + // const exe = await caller.execution.create({ goalId: taskId }); + const exe = await caller.execution.byId({ id: taskId }); + if (!exe) { + return NextResponse.json( + { message: "Unable to find entity with the provided id" }, + { status: 404 }, + ); + } + return caller.execution.createPlan({ + executionId: exe.id, + goalId: taskId, + goalPrompt: body.input, + creationProps: {}, + }); +} + +// GET /ap/v1/agent/tasks/:taskId/steps +export async function GET( + request: NextRequest, + { params: { taskId } }: { params: { taskId: string } }, +) { + if (!taskId) { + return NextResponse.json( + { message: "Unable to find entity with the provided id" }, + { status: 404 }, + ); + } + + const session = (await getServerSession(authOptions)) || null; + + const caller = appRouter.createCaller({ + session, + prisma, + origin: request.nextUrl.origin, + }); + + const execution = await caller.execution.byId({ id: taskId }); + + const results = execution?.results; + const steps = execution?.graph?.nodes.map((node, i) => { + const artifactFromResult = results?.find((r) => r.nodeId === node.id) + ?.value; + const isLast = i === execution?.graph?.nodes.length ?? 0 - 1; + return { + name: node.name, + output: artifactFromResult, + artifacts: [], + is_last: isLast, + input: node.context, + task_id: taskId, + step_id: node.id, + status: artifactFromResult, + }; + }); + return Response.json(steps, { + status: 200, + headers: { "content-type": "application/json" }, + }); +} diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts index ed73010c..93aa216a 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts @@ -1,36 +1,60 @@ -import { NextResponse, type NextRequest } from "next/server"; -import { v4, type TaskRequestBody } from "lib/AgentProtocol/types"; +import { type NextRequest } from "next/server"; +import { type Task, type TaskRequestBody } from "lib/AgentProtocol/types"; +import { getServerSession } from "next-auth"; -import { stub } from "~/utils/stub"; +import { appRouter } from "@acme/api"; +import { authOptions } from "@acme/auth"; +import { prisma, type DraftExecutionNode } from "@acme/db"; // POST /ap/v1/agent/tasks export async function POST(request: NextRequest) { const body = (await request.json()) as TaskRequestBody; + // create a goal and exe + const session = (await getServerSession(authOptions)) || null; + const caller = appRouter.createCaller({ + session, + prisma, + origin: request.nextUrl.origin, + }); - const task = { - task_id: v4(), - artifacts: [], + const execution = await caller.execution.createForAgentProtocol({ + prompt: body.input, + }); + + const task: Task = { + task_id: execution.id, input: body.input, + additional_input: body.additional_input, }; - - stub.tasks[task.task_id] = task; - return NextResponse.json(task, { status: 200 }); + return Response.json(task, { status: 200 }); } // GET /ap/v1/agent/tasks +// FIXME: this does not map cleanly to our model, so we will return all executions export async function GET(request: NextRequest) { - const currentPage = - Number(request.nextUrl.searchParams.get("current_page")) || 1; - const pageSize = Number(request.nextUrl.searchParams.get("page_size")) || 10; + const params = request.nextUrl.searchParams; + const pageSize = Number(params.get("page_size") ?? 10); + const currentPage = Number(params.get("current_page") ?? 1); + const session = (await getServerSession(authOptions)) || null; + const caller = appRouter.createCaller({ + session, + prisma, + origin: request.nextUrl.origin, + }); - const totalItems = Object.keys(stub.tasks).length; + let topByUser: DraftExecutionNode[]; + try { + topByUser = (await caller.goal.topByUser()) // TODO make a paginating exe only query + .flatMap((g) => g.executions) + .flatMap((e) => e.graph?.nodes ?? []); + } catch { + topByUser = []; + } + const totalItems = topByUser.length; const totalPages = Math.ceil(totalItems / pageSize); const offset = (currentPage - 1) * pageSize; - const paginatedTasks = Object.values(stub.tasks).slice( - offset, - offset + pageSize, - ); + const paginatedTasks = topByUser.slice(offset, offset + pageSize); const pagination = { total_items: totalItems, @@ -39,5 +63,11 @@ export async function GET(request: NextRequest) { page_size: pageSize, }; - return NextResponse.json({ tasks: paginatedTasks, pagination }); + const tasks: Task[] = paginatedTasks.map((exe) => ({ + task_id: exe.id, + input: exe.context, + artifacts: [], + })); + + return Response.json({ tasks, pagination }); } diff --git a/packages/api/src/router/execution.ts b/packages/api/src/router/execution.ts index 3f7ffca4..d6c56a69 100644 --- a/packages/api/src/router/execution.ts +++ b/packages/api/src/router/execution.ts @@ -62,6 +62,57 @@ export const executionRouter = createTRPCRouter({ }); }), + createForAgentProtocol: protectedProcedure + .input(z.object({ prompt: z.string().nonempty() })) + .mutation(async ({ ctx, input }) => { + const { prompt } = input; + const userId = ctx.session.user.id; + + // create a new goal + const goal = await ctx.prisma.goal.create({ + data: { + prompt, + userId, + }, + }); + + // create a new execution and attach it to the newly created goal + const execution = await ctx.prisma.execution.create({ + data: { + goalId: goal.id, + userId, + }, + include: { + goal: { + include: { + executions: { + take: 0, + orderBy: { + updatedAt: "desc", + }, + include: { + graph: { + include: { + nodes: true, + edges: true, + }, + }, + results: { + take: 0, + orderBy: { + updatedAt: "desc", + }, + }, + }, + }, + }, + }, + }, + }); + + return execution; + }), + updateGraph: protectedProcedure .input( z.object({ @@ -139,7 +190,7 @@ export const executionRouter = createTRPCRouter({ }), byId: protectedProcedure - .input(z.object({ id: z.string().cuid() })) + .input(z.object({ id: z.string() })) .query(({ ctx, input }) => { const { id } = input; const userId = ctx.session.user.id; @@ -149,15 +200,29 @@ export const executionRouter = createTRPCRouter({ id, userId, }, + include: { + graph: { + include: { + nodes: true, + edges: true, + }, + }, + results: { + take: 40, + orderBy: { + updatedAt: "desc", + }, + }, + }, }); }), createPlan: publicProcedure .input( z.object({ - goalPrompt: z.string().min(1).cuid(), - goalId: z.string().min(1).cuid(), - executionId: z.string().min(1).cuid(), + goalPrompt: z.string().min(1), + goalId: z.string().min(1), + executionId: z.string().min(1), creationProps: z.custom(), }), ) diff --git a/packages/api/src/router/goal.ts b/packages/api/src/router/goal.ts index a331faf2..206132f2 100644 --- a/packages/api/src/router/goal.ts +++ b/packages/api/src/router/goal.ts @@ -36,10 +36,40 @@ export const goalRouter = createTRPCRouter({ }, }, }, - take: 6, + take: 1, }); }), + byId: optionalProtectedProcedure + .input(z.string().min(1)) + .query(({ ctx, input: id }) => { + const userId = ctx.session.user?.id; + if (!userId) { + return null; + } + return ctx.prisma.goal.findUnique({ + where: { id }, + include: { + executions: { + take: 1, + orderBy: { updatedAt: "desc" }, + include: { + graph: { + include: { + nodes: true, + edges: true, + }, + }, + results: { + take: 40, + orderBy: { updatedAt: "desc" }, + }, + }, + }, + }, + }); + }), + // Create a new goal create: optionalProtectedProcedure .input( From d35d3b3491ea6d7843546e03590d200909a41c8b Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Mon, 23 Oct 2023 22:58:42 -0700 Subject: [PATCH 05/26] Response.json instead of new Response --- apps/nextjs/src/app/api/ap/route.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/nextjs/src/app/api/ap/route.ts b/apps/nextjs/src/app/api/ap/route.ts index 62527d91..ce886f29 100644 --- a/apps/nextjs/src/app/api/ap/route.ts +++ b/apps/nextjs/src/app/api/ap/route.ts @@ -1,9 +1,8 @@ import { type NextRequest } from "next/server"; -import { stringify } from "superjson"; import AgentProtocolOpenAPISpec from "~/../lib/AgentProtocol/openapi.json"; -export const runtime = "edge"; // 'nodejs' is the default +export const runtime = "edge"; export const dynamic = "force-static"; export function GET(req: NextRequest) { @@ -13,10 +12,7 @@ export function GET(req: NextRequest) { spec.servers[0].url = req.nextUrl.origin; } - return new Response(stringify(spec), { + return Response.json(spec, { status: 200, - headers: { - "content-type": "application/json", - }, }); } From 42389c6073b34bab04c4d86827b63e0edf37a72d Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Mon, 23 Oct 2023 22:58:55 -0700 Subject: [PATCH 06/26] add initial notes on implementation --- docs/agent-protocol-implementation-notes.md | 46 +++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 docs/agent-protocol-implementation-notes.md diff --git a/docs/agent-protocol-implementation-notes.md b/docs/agent-protocol-implementation-notes.md new file mode 100644 index 00000000..c7f829fc --- /dev/null +++ b/docs/agent-protocol-implementation-notes.md @@ -0,0 +1,46 @@ +# waggledance.ai's Agent Protocol Implementation Notes + +> `AP=Agent Protocol`
context: [OpenAPI](/apps/nextjs/lib/AgentProtocol/openapi.json) + +> `WD=waggledance.ai`
context: [Prisma Schema]() +> (OpenAPI coming soon) + +## AP↔WD Mappings + +- AP:Task ~= WD:(Goal+Execution) +- AP:Step ~= WD:ExecutionNode +- AP:Artifact ~= WD:Execution + +## AP↔WD Incongruencies + +- Scoping + + - AP: `/ap/v1/agent/tasks` there is no way to reuse configuration, except by passing it to each task as `additional_input` and risking inability to interface without looking up each conforming agent's expectations for `additional_input` + - AP: `workspace` is mentioned but only in the `relative_path` of `Artifact` -- there is no way to set it, currently (?) + + - WD: uses the `Goal` container to share some common configuration, such as the `Goal` prompt, (and planned:) certain types of persistent data, `Skill` access, etc. + - WD: `namespace` (e.g. `xyz`, `xyz_1.1`, `zyx`) is used to scope memory access, + - WD: `Skills` are planned to require certain user-configurable permissions. e.g. temporary code execution, requires human intervention, read-only, risk-based, etc. + +- Parallelism: + - WD: Parallelism is built in to the `ExecutionGraph`. + - WD: When conforming to AP, parallelism is currently reduced to serial. 👎 + - AP: parallelism has to be implemented in another layer, or possibly(?) with `additional_input` + +Opinions ([@jondwillis](https://github.com/jondwillis)): + +- After some thought, additional_input should be discouraged as it will make each agent's API unique and difficult to interface with. + + - is there even a way around this? + +- There is no way to create an agent, despite it being in the API route. + +- Artifact is a poor abstraction, or at least needs to have a content-type + +- Some kind of scoping or containerization may be beneficial. Again, `additional_input` would be the only way. + +- The "any"/"object" typings feel bad. Why not formalize a schema, or return strings? + +# Suggestions + +- Make use of [OpenAPI extensions](https://swagger.io/docs/specification/openapi-extensions/) to From fc54564c4b14155f7d460bb3574ae21ca33ca89d Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Mon, 23 Oct 2023 23:23:18 -0700 Subject: [PATCH 07/26] modify notes --- docs/agent-protocol-implementation-notes.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/agent-protocol-implementation-notes.md b/docs/agent-protocol-implementation-notes.md index c7f829fc..a30abc24 100644 --- a/docs/agent-protocol-implementation-notes.md +++ b/docs/agent-protocol-implementation-notes.md @@ -9,7 +9,16 @@ - AP:Task ~= WD:(Goal+Execution) - AP:Step ~= WD:ExecutionNode -- AP:Artifact ~= WD:Execution +- AP:Artifact ~= WD:Result + +## Problems + +```ts +GET /ap/v1/agent/tasks +// WD: returns executions, may return executions from other Goals (which are effectively other Agents) +``` + +AP: assumes there can only be one Agent in a system. Isolation would currently have to be done w/ `additional_input` ## AP↔WD Incongruencies @@ -33,13 +42,13 @@ Opinions ([@jondwillis](https://github.com/jondwillis)): - is there even a way around this? -- There is no way to create an agent, despite it being in the API route. +- I found it weird that there is no way to create an agent, despite it being in the API route. - Artifact is a poor abstraction, or at least needs to have a content-type - Some kind of scoping or containerization may be beneficial. Again, `additional_input` would be the only way. -- The "any"/"object" typings feel bad. Why not formalize a schema, or return strings? +- The "any"/"object" typings feel bad. Why not formalize/allow configuring a schema, or return strings? # Suggestions From 82520c87d205c7a2e5ff8b80b5d3ddc6c0ff7e82 Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Mon, 23 Oct 2023 23:39:32 -0700 Subject: [PATCH 08/26] more notes --- docs/agent-protocol-implementation-notes.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/agent-protocol-implementation-notes.md b/docs/agent-protocol-implementation-notes.md index a30abc24..92c3e36a 100644 --- a/docs/agent-protocol-implementation-notes.md +++ b/docs/agent-protocol-implementation-notes.md @@ -13,6 +13,8 @@ ## Problems +- Usage w/ Authentication? + ```ts GET /ap/v1/agent/tasks // WD: returns executions, may return executions from other Goals (which are effectively other Agents) @@ -32,19 +34,19 @@ AP: assumes there can only be one Agent in a system. Isolation would currently h - WD: `Skills` are planned to require certain user-configurable permissions. e.g. temporary code execution, requires human intervention, read-only, risk-based, etc. - Parallelism: - - WD: Parallelism is built in to the `ExecutionGraph`. + - WD: Parallelism is possible both by creating multiple `Execution` and also possible with the structure of `ExecutionGraph`. - WD: When conforming to AP, parallelism is currently reduced to serial. 👎 - AP: parallelism has to be implemented in another layer, or possibly(?) with `additional_input` Opinions ([@jondwillis](https://github.com/jondwillis)): -- After some thought, additional_input should be discouraged as it will make each agent's API unique and difficult to interface with. +- After some thought, `additional_input` should be discouraged as it will make each agent's API unique and difficult to interface with. - is there even a way around this? -- I found it weird that there is no way to create an agent, despite it being in the API route. +- I found it weird that there is no way to create an Agent, despite it being in the API route, and the name of the entire protocol! -- Artifact is a poor abstraction, or at least needs to have a content-type +- `Artifact` is a weak abstraction, or at least needs to have a content-type - Some kind of scoping or containerization may be beneficial. Again, `additional_input` would be the only way. @@ -52,4 +54,5 @@ Opinions ([@jondwillis](https://github.com/jondwillis)): # Suggestions -- Make use of [OpenAPI extensions](https://swagger.io/docs/specification/openapi-extensions/) to +- Modify the conformance test.sh and local_test.sh to allow headers for setting auth tokens, cookies, etc. +- Make use of [OpenAPI extensions](https://swagger.io/docs/specification/openapi-extensions/) to remove additional_input which may be hard to find per-agent documentation for, and use. From 1ec7546d50c7b4356ac56ca6ba445bf02aa0c7f3 Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Mon, 23 Oct 2023 23:54:14 -0700 Subject: [PATCH 09/26] fix link schema link --- docs/agent-protocol-implementation-notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/agent-protocol-implementation-notes.md b/docs/agent-protocol-implementation-notes.md index 92c3e36a..870413b0 100644 --- a/docs/agent-protocol-implementation-notes.md +++ b/docs/agent-protocol-implementation-notes.md @@ -2,7 +2,7 @@ > `AP=Agent Protocol`
context: [OpenAPI](/apps/nextjs/lib/AgentProtocol/openapi.json) -> `WD=waggledance.ai`
context: [Prisma Schema]() +> `WD=waggledance.ai`
context: [Prisma Schema](/packages/db/prisma/schema.prisma) > (OpenAPI coming soon) ## AP↔WD Mappings From a8b0e0e66e76b4c0a68f2c96a6b905fa5eec5878 Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Tue, 24 Oct 2023 13:42:58 -0700 Subject: [PATCH 10/26] add comment about additional_input --- apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts index cb95e510..bdaed412 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts @@ -81,6 +81,7 @@ export async function GET( task_id: taskId, input: goal?.prompt, artifacts: [], + // this was required by the tests, but it is not being passed through our data model. additional_input: {}, }; From 0d51ebd84b201017561f61cd6dd60fd6bc257a52 Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Tue, 24 Oct 2023 13:51:13 -0700 Subject: [PATCH 11/26] download agent protocol spec and enable AP toolkit --- .../types/WaggleDanceAgentExecutor.ts | 21 ++++++++++++++++--- .../src/features/WaggleDance/types/types.ts | 2 ++ .../features/WaggleDance/utils/planTasks.ts | 13 +++++++++++- apps/nextjs/src/pages/api/agent/plan.ts | 2 ++ .../agent/src/strategy/callExecutionAgent.ts | 4 ++++ .../agent/src/strategy/callPlanningAgent.ts | 3 +++ packages/agent/src/utils/skills.ts | 7 +++++++ 7 files changed, 48 insertions(+), 4 deletions(-) diff --git a/apps/nextjs/src/features/WaggleDance/types/WaggleDanceAgentExecutor.ts b/apps/nextjs/src/features/WaggleDance/types/WaggleDanceAgentExecutor.ts index e5fe2614..8be7e73a 100644 --- a/apps/nextjs/src/features/WaggleDance/types/WaggleDanceAgentExecutor.ts +++ b/apps/nextjs/src/features/WaggleDance/types/WaggleDanceAgentExecutor.ts @@ -1,4 +1,5 @@ import { type MutableRefObject } from "react"; +import { type JsonSpec } from "langchain/tools"; import { stringify } from "yaml"; import { @@ -16,6 +17,7 @@ import planTasks from "../utils/planTasks"; import { sleep } from "../utils/sleep"; import { mapAgentSettingsToCreationProps, + type ExecuteRequestBody, type GraphDataState, type WaggleDanceResult, } from "./types"; @@ -67,9 +69,19 @@ class WaggleDanceAgentExecutor { this.taskResults = {}; this.error = null; const initialNode = rootPlanNode(this.goalPrompt); + let agentProtocolOpenAPISpec: JsonSpec | undefined; + + try { + agentProtocolOpenAPISpec = (await ( + await fetch("/api/ap") + ).json()) as JsonSpec; + } catch { + console.error("Failed to fetch agent protocol spec"); + } + void (async () => { try { - const result = await this.planAndSetDAG(); + const result = await this.planAndSetDAG(agentProtocolOpenAPISpec); console.debug("done planning"); if (this.error) { return; @@ -200,7 +212,9 @@ class WaggleDanceAgentExecutor { }; } - async planAndSetDAG(): Promise { + async planAndSetDAG( + agentProtocolOpenAPISpec?: JsonSpec, + ): Promise { const creationProps = mapAgentSettingsToCreationProps( this.agentSettings["plan"], ); @@ -213,6 +227,7 @@ class WaggleDanceAgentExecutor { log: this.log, injectAgentPacket: this.injectAgentPacket, abortSignal: this.abortController.signal, + agentProtocolOpenAPISpec, }); // Call the check methods here @@ -258,7 +273,7 @@ class WaggleDanceAgentExecutor { const creationProps = mapAgentSettingsToCreationProps( this.agentSettings["execute"], ); - const executeRequest = { + const executeRequest: ExecuteRequestBody = { goalPrompt: this.goalPrompt, goalId: this.goalId, executionId: this.executionId, diff --git a/apps/nextjs/src/features/WaggleDance/types/types.ts b/apps/nextjs/src/features/WaggleDance/types/types.ts index f57494aa..94572d0f 100644 --- a/apps/nextjs/src/features/WaggleDance/types/types.ts +++ b/apps/nextjs/src/features/WaggleDance/types/types.ts @@ -1,5 +1,6 @@ // WaggleDance/types.ts import { type Dispatch, type SetStateAction } from "react"; +import { type JsonSpec } from "langchain/tools"; import { type AgentSettings, @@ -75,6 +76,7 @@ export interface BaseRequestBody { creationProps: ModelCreationProps; goalId: string; goalPrompt: string; + agentProtocolOpenAPISpec?: JsonSpec; } export interface RefineRequestBody { diff --git a/apps/nextjs/src/features/WaggleDance/utils/planTasks.ts b/apps/nextjs/src/features/WaggleDance/utils/planTasks.ts index 65ca290f..a701843a 100644 --- a/apps/nextjs/src/features/WaggleDance/utils/planTasks.ts +++ b/apps/nextjs/src/features/WaggleDance/utils/planTasks.ts @@ -1,5 +1,7 @@ // features/WaggleDance/utils/planTasks.ts +import { type JsonSpec } from "langchain/tools"; + import { type DraftExecutionGraph, type DraftExecutionNode } from "@acme/db"; import { @@ -26,6 +28,7 @@ export type PlanTasksProps = { task: DraftExecutionNode, dag: DraftExecutionGraph, ) => Promise; + agentProtocolOpenAPISpec?: JsonSpec; }; export default async function planTasks({ @@ -38,6 +41,7 @@ export default async function planTasks({ injectAgentPacket, startFirstTask, abortSignal, + agentProtocolOpenAPISpec, }: PlanTasksProps): Promise { const intervalHandler = new PlanUpdateIntervalHandler(100); // update at most every... const parseWorker = new Worker(new URL("./parseWorker.ts", import.meta.url)); @@ -48,7 +52,14 @@ export default async function planTasks({ let partialDAG: DraftExecutionGraph = dag; let hasFirstTaskStarted = false; - const data = { goalPrompt, goalId, executionId, creationProps }; + const data = { + goalPrompt, + goalId, + executionId, + creationProps, + agentProtocolOpenAPISpec, + }; + // TODO: merge w/ api.execution.createPlan const res = await fetch("/api/agent/plan", { method: "POST", headers: { "Content-Type": "application/json" }, diff --git a/apps/nextjs/src/pages/api/agent/plan.ts b/apps/nextjs/src/pages/api/agent/plan.ts index 52d9f5d6..5d2a92a2 100644 --- a/apps/nextjs/src/pages/api/agent/plan.ts +++ b/apps/nextjs/src/pages/api/agent/plan.ts @@ -39,6 +39,7 @@ export default async function PlanStream(req: NextRequest) { goalPrompt: parsedGoalPrompt, goalId: parsedGoalId, executionId: parsedExecutionId, + agentProtocolOpenAPISpec, } = (await req.json()) as PlanRequestBody; goalPrompt = parsedGoalPrompt; goalId = parsedGoalId; @@ -92,6 +93,7 @@ export default async function PlanStream(req: NextRequest) { goalId!, abortController.signal, `${goalId}_${executionId}`, + agentProtocolOpenAPISpec, ); if (planResult instanceof Error) { diff --git a/packages/agent/src/strategy/callExecutionAgent.ts b/packages/agent/src/strategy/callExecutionAgent.ts index edf77eb9..318c0b18 100644 --- a/packages/agent/src/strategy/callExecutionAgent.ts +++ b/packages/agent/src/strategy/callExecutionAgent.ts @@ -22,6 +22,7 @@ import { import { type AgentStep } from "langchain/schema"; import { AbortError } from "redis"; import { stringify as jsonStringify } from "superjson"; +import { type JsonSpec } from "langchain/tools"; import { parse as yamlParse, stringify as yamlStringify } from "yaml"; import { z } from "zod"; @@ -80,6 +81,7 @@ export async function callExecutionAgent(creation: { contentType: "application/json" | "application/yaml"; abortSignal: AbortSignal; namespace: string; + agentProtocolOpenAPISpec?: JsonSpec; geo?: Geo; }): Promise { const { @@ -93,6 +95,7 @@ export async function callExecutionAgent(creation: { abortSignal, namespace, contentType, + agentProtocolOpenAPISpec, geo, } = creation; const callbacks = creationProps.callbacks; @@ -152,6 +155,7 @@ export async function callExecutionAgent(creation: { isCriticism, taskObj.id, returnType, + agentProtocolOpenAPISpec, geo, ); diff --git a/packages/agent/src/strategy/callPlanningAgent.ts b/packages/agent/src/strategy/callPlanningAgent.ts index 80981ff7..d9ebe6ce 100644 --- a/packages/agent/src/strategy/callPlanningAgent.ts +++ b/packages/agent/src/strategy/callPlanningAgent.ts @@ -2,6 +2,7 @@ import { encodingForModel, type Tiktoken } from "js-tiktoken"; import { LLMChain } from "langchain/chains"; +import { type JsonSpec } from "langchain/tools"; import { parse as jsonParse, stringify as jsonStringify } from "superjson"; import { parse as yamlParse, stringify as yamlStringify } from "yaml"; @@ -26,6 +27,7 @@ export async function callPlanningAgent( goalId: string, signal: AbortSignal, namespace: string, + agentProtocolOpenAPISpec?: JsonSpec, returnType: "YAML" | "JSON" = "YAML", ): Promise { const tags = [ @@ -43,6 +45,7 @@ export async function callPlanningAgent( false, rootPlanId, returnType, + agentProtocolOpenAPISpec, ); const prompt = createPlanPrompt({ goalPrompt, diff --git a/packages/agent/src/utils/skills.ts b/packages/agent/src/utils/skills.ts index 52e72726..d7656142 100644 --- a/packages/agent/src/utils/skills.ts +++ b/packages/agent/src/utils/skills.ts @@ -5,12 +5,14 @@ import { SearchApi, SerpAPI, WolframAlphaTool, + type JsonSpec, type SearchApiParameters, type StructuredTool, } from "langchain/tools"; import { WebBrowser } from "langchain/tools/webbrowser"; import cca2Map from "../lib/cca2Map.json"; +import { AgentProtocolToolkit } from "../skills/AgentProtocolSkill"; import requestUserHelpSkill from "../skills/requestUserHelpSkill"; import type Geo from "./Geo"; import { type AgentPromptingMethod } from "./llms"; @@ -216,6 +218,7 @@ function createSkills( isCriticism: boolean, taskId: string, returnType: "YAML" | "JSON", + agentProtocolOpenAPISpec?: JsonSpec, geo?: Geo, ): StructuredTool[] { const tools = [ @@ -263,6 +266,10 @@ function createSkills( ); } + if (agentProtocolOpenAPISpec) { + const toolkit = new AgentProtocolToolkit(agentProtocolOpenAPISpec, llm, {}); + tools.push(...toolkit.tools); + } return tools as StructuredTool[]; } From 828cd3d5995b335c93524b5994549856ba6fc4d8 Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Mon, 30 Oct 2023 18:58:36 -0700 Subject: [PATCH 12/26] update deps --- apps/nextjs/package.json | 20 +- package.json | 4 +- packages/agent/package.json | 4 +- packages/api/package.json | 4 +- packages/auth/package.json | 4 +- packages/config/eslint/package.json | 6 +- pnpm-lock.yaml | 840 ++++++++++++++++------------ 7 files changed, 488 insertions(+), 394 deletions(-) diff --git a/apps/nextjs/package.json b/apps/nextjs/package.json index 091fc579..3d40a69d 100644 --- a/apps/nextjs/package.json +++ b/apps/nextjs/package.json @@ -18,7 +18,7 @@ "@acme/auth": "^0.1.0", "@acme/db": "^0.1.0", "@acme/tailwind-config": "^0.1.0", - "@aws-sdk/client-s3": "^3.435.0", + "@aws-sdk/client-s3": "^3.438.0", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@fontsource/public-sans": "^5.0.15", @@ -29,21 +29,21 @@ "@react-hook/resize-observer": "^1.2.6", "@t3-oss/env-nextjs": "^0.7.1", "@tanstack/react-query": "^4.36.1", - "@trpc/client": "^10.42.0", - "@trpc/next": "^10.42.0", - "@trpc/react-query": "^10.42.0", - "@trpc/server": "^10.42.0", - "@upstash/redis": "^1.23.4", + "@trpc/client": "^10.43.0", + "@trpc/next": "^10.43.0", + "@trpc/react-query": "^10.43.0", + "@trpc/server": "^10.43.0", + "@upstash/redis": "^1.24.2", "@vercel/analytics": "^1.1.1", "@vercel/edge-config": "^0.4.1", "crypto-js": "^4.2.0", "eventsource-parser": "^1.1.1", "formidable": "^3.5.1", "jsonrepair": "^3.2.4", - "langchain": "^0.0.172", + "langchain": "^0.0.176", "mammoth": "^1.6.0", - "next": "^13.5.6", - "next-auth": "^4.24.3", + "next": "^14.0.1", + "next-auth": "^4.24.4", "pdf-parse": "^1.1.1", "playwright": "^1.39.0", "react": "18.2.0", @@ -65,7 +65,7 @@ "@types/d3-force": "^3.0.7", "@types/formidable": "^3.4.4", "@types/node": "^20.8.9", - "@types/react": "^18.2.32", + "@types/react": "^18.2.33", "@types/react-dom": "^18.2.14", "@types/uuid": "^9.0.6", "autoprefixer": "^10.4.16", diff --git a/package.json b/package.json index 5085fc6d..b302c935 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,8 @@ "@acme/eslint-config": "^0.1.0", "@ianvs/prettier-plugin-sort-imports": "^4.1.1", "@manypkg/cli": "^0.21.0", - "@typescript-eslint/eslint-plugin": "^6.9.0", - "@typescript-eslint/parser": "^6.9.0", + "@typescript-eslint/eslint-plugin": "^6.9.1", + "@typescript-eslint/parser": "^6.9.1", "eslint": "^8.52.0", "prettier": "^3.0.3", "prettier-plugin-tailwindcss": "^0.5.6", diff --git a/packages/agent/package.json b/packages/agent/package.json index 8997f9b5..bd1f459c 100644 --- a/packages/agent/package.json +++ b/packages/agent/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@acme/db": "^0.1.0", - "axios": "^1.5.1", + "axios": "^1.6.0", "cheerio": "1.0.0-rc.12", "graphql": "^16.8.1", "js-tiktoken": "^1.0.7", @@ -20,7 +20,7 @@ "redis": "^4.6.10", "serpapi": "^2.0.0", "tls": "^0.0.1", - "weaviate-ts-client": "^1.5.0", + "weaviate-ts-client": "^1.6.0", "yaml": "^2.3.3", "zod": "^3.22.4", "zod-to-json-schema": "^3.21.4" diff --git a/packages/api/package.json b/packages/api/package.json index 07075dba..6ee00042 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -14,8 +14,8 @@ "@acme/agent": "^0.1.0", "@acme/auth": "^0.1.0", "@acme/db": "^0.1.0", - "@trpc/client": "^10.42.0", - "@trpc/server": "^10.42.0", + "@trpc/client": "^10.43.0", + "@trpc/server": "^10.43.0", "@vercel/kv": "^0.2.3", "superjson": "2.2.0", "zod": "^3.22.4" diff --git a/packages/auth/package.json b/packages/auth/package.json index 4ab488cc..cd441f34 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -13,8 +13,8 @@ "dependencies": { "@acme/db": "^0.1.0", "@next-auth/prisma-adapter": "^1.0.7", - "next": "^13.5.6", - "next-auth": "^4.24.3", + "next": "^14.0.1", + "next-auth": "^4.24.4", "react": "18.2.0", "react-dom": "18.2.0" }, diff --git a/packages/config/eslint/package.json b/packages/config/eslint/package.json index ea830089..289ccfa2 100644 --- a/packages/config/eslint/package.json +++ b/packages/config/eslint/package.json @@ -5,9 +5,9 @@ "license": "MIT", "dependencies": { "@types/eslint": "^8.44.6", - "@typescript-eslint/eslint-plugin": "^6.9.0", - "@typescript-eslint/parser": "^6.9.0", - "eslint-config-next": "^13.5.6", + "@typescript-eslint/eslint-plugin": "^6.9.1", + "@typescript-eslint/parser": "^6.9.1", + "eslint-config-next": "^14.0.1", "eslint-config-prettier": "^9.0.0", "eslint-config-turbo": "^1.10.16", "eslint-plugin-react": "7.33.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 71e5fcfa..c12f208c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,11 +18,11 @@ importers: specifier: ^0.21.0 version: 0.21.0 '@typescript-eslint/eslint-plugin': - specifier: ^6.9.0 - version: 6.9.0(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@5.2.2) + specifier: ^6.9.1 + version: 6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.52.0)(typescript@5.2.2) '@typescript-eslint/parser': - specifier: ^6.9.0 - version: 6.9.0(eslint@8.52.0)(typescript@5.2.2) + specifier: ^6.9.1 + version: 6.9.1(eslint@8.52.0)(typescript@5.2.2) eslint: specifier: ^8.52.0 version: 8.52.0 @@ -57,29 +57,29 @@ importers: specifier: ^0.1.0 version: link:../../packages/config/tailwind '@aws-sdk/client-s3': - specifier: ^3.435.0 - version: 3.435.0 + specifier: ^3.438.0 + version: 3.438.0 '@emotion/react': specifier: ^11.11.1 - version: 11.11.1(@types/react@18.2.32)(react@18.2.0) + version: 11.11.1(@types/react@18.2.33)(react@18.2.0) '@emotion/styled': specifier: ^11.11.0 - version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.32)(react@18.2.0) + version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) '@fontsource/public-sans': specifier: ^5.0.15 version: 5.0.15 '@mui/icons-material': specifier: ^5.14.15 - version: 5.14.15(@mui/material@5.14.15)(@types/react@18.2.32)(react@18.2.0) + version: 5.14.15(@mui/material@5.14.15)(@types/react@18.2.33)(react@18.2.0) '@mui/joy': specifier: 5.0.0-beta.12 - version: 5.0.0-beta.12(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0) + version: 5.0.0-beta.12(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) '@mui/material': specifier: ^5.14.15 - version: 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0) + version: 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-toast': specifier: ^1.1.5 - version: 1.1.5(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0) + version: 1.1.5(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) '@react-hook/resize-observer': specifier: ^1.2.6 version: 1.2.6(react@18.2.0) @@ -90,20 +90,20 @@ importers: specifier: ^4.36.1 version: 4.36.1(react-dom@18.2.0)(react@18.2.0) '@trpc/client': - specifier: ^10.42.0 - version: 10.42.0(@trpc/server@10.42.0) + specifier: ^10.43.0 + version: 10.43.0(@trpc/server@10.43.0) '@trpc/next': - specifier: ^10.42.0 - version: 10.42.0(@tanstack/react-query@4.36.1)(@trpc/client@10.42.0)(@trpc/react-query@10.42.0)(@trpc/server@10.42.0)(next@13.5.6)(react-dom@18.2.0)(react@18.2.0) + specifier: ^10.43.0 + version: 10.43.0(@tanstack/react-query@4.36.1)(@trpc/client@10.43.0)(@trpc/react-query@10.43.0)(@trpc/server@10.43.0)(next@14.0.1)(react-dom@18.2.0)(react@18.2.0) '@trpc/react-query': - specifier: ^10.42.0 - version: 10.42.0(@tanstack/react-query@4.36.1)(@trpc/client@10.42.0)(@trpc/server@10.42.0)(react-dom@18.2.0)(react@18.2.0) + specifier: ^10.43.0 + version: 10.43.0(@tanstack/react-query@4.36.1)(@trpc/client@10.43.0)(@trpc/server@10.43.0)(react-dom@18.2.0)(react@18.2.0) '@trpc/server': - specifier: ^10.42.0 - version: 10.42.0 + specifier: ^10.43.0 + version: 10.43.0 '@upstash/redis': - specifier: ^1.23.4 - version: 1.23.4 + specifier: ^1.24.2 + version: 1.24.2 '@vercel/analytics': specifier: ^1.1.1 version: 1.1.1 @@ -123,17 +123,17 @@ importers: specifier: ^3.2.4 version: 3.2.4 langchain: - specifier: ^0.0.172 - version: 0.0.172(@aws-sdk/client-s3@3.435.0)(@upstash/redis@1.23.4)(mammoth@1.6.0)(pdf-parse@1.1.1)(playwright@1.39.0) + specifier: ^0.0.176 + version: 0.0.176(@aws-sdk/client-s3@3.438.0)(@upstash/redis@1.24.2)(mammoth@1.6.0)(pdf-parse@1.1.1)(playwright@1.39.0) mammoth: specifier: ^1.6.0 version: 1.6.0 next: - specifier: ^13.5.6 - version: 13.5.6(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.0.1 + version: 14.0.1(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) next-auth: - specifier: ^4.24.3 - version: 4.24.3(next@13.5.6)(react-dom@18.2.0)(react@18.2.0) + specifier: ^4.24.4 + version: 4.24.4(next@14.0.1)(react-dom@18.2.0)(react@18.2.0) pdf-parse: specifier: ^1.1.1 version: 1.1.1 @@ -151,7 +151,7 @@ importers: version: 1.25.2(react@18.2.0) react-markdown: specifier: ^9.0.0 - version: 9.0.0(@types/react@18.2.32)(react@18.2.0) + version: 9.0.0(@types/react@18.2.33)(react@18.2.0) react-query@^4.0.0: specifier: link:tanstack/react-query@^4.0.0 version: link:tanstack/react-query@^4.0.0 @@ -175,7 +175,7 @@ importers: version: 3.22.4 zustand: specifier: ^4.4.4 - version: 4.4.4(@types/react@18.2.32)(react@18.2.0) + version: 4.4.4(@types/react@18.2.33)(react@18.2.0) devDependencies: '@acme/eslint-config': specifier: ^0.1.0 @@ -193,8 +193,8 @@ importers: specifier: ^20.8.9 version: 20.8.9 '@types/react': - specifier: ^18.2.32 - version: 18.2.32 + specifier: ^18.2.33 + version: 18.2.33 '@types/react-dom': specifier: ^18.2.14 version: 18.2.14 @@ -226,8 +226,8 @@ importers: specifier: ^0.1.0 version: link:../db axios: - specifier: ^1.5.1 - version: 1.5.1 + specifier: ^1.6.0 + version: 1.6.0 cheerio: specifier: 1.0.0-rc.12 version: 1.0.0-rc.12 @@ -250,8 +250,8 @@ importers: specifier: ^0.0.1 version: 0.0.1 weaviate-ts-client: - specifier: ^1.5.0 - version: 1.5.0(graphql@16.8.1) + specifier: ^1.6.0 + version: 1.6.0(graphql@16.8.1) yaml: specifier: ^2.3.3 version: 2.3.3 @@ -287,11 +287,11 @@ importers: specifier: ^0.1.0 version: link:../db '@trpc/client': - specifier: ^10.42.0 - version: 10.42.0(@trpc/server@10.42.0) + specifier: ^10.43.0 + version: 10.43.0(@trpc/server@10.43.0) '@trpc/server': - specifier: ^10.42.0 - version: 10.42.0 + specifier: ^10.43.0 + version: 10.43.0 '@vercel/kv': specifier: ^0.2.3 version: 0.2.3 @@ -319,13 +319,13 @@ importers: version: link:../db '@next-auth/prisma-adapter': specifier: ^1.0.7 - version: 1.0.7(@prisma/client@5.5.2)(next-auth@4.24.3) + version: 1.0.7(@prisma/client@5.5.2)(next-auth@4.24.4) next: - specifier: ^13.5.6 - version: 13.5.6(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.0.1 + version: 14.0.1(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) next-auth: - specifier: ^4.24.3 - version: 4.24.3(next@13.5.6)(react-dom@18.2.0)(react@18.2.0) + specifier: ^4.24.4 + version: 4.24.4(next@14.0.1)(react-dom@18.2.0)(react@18.2.0) react: specifier: 18.2.0 version: 18.2.0 @@ -349,14 +349,14 @@ importers: specifier: ^8.44.6 version: 8.44.6 '@typescript-eslint/eslint-plugin': - specifier: ^6.9.0 - version: 6.9.0(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@5.2.2) + specifier: ^6.9.1 + version: 6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.52.0)(typescript@5.2.2) '@typescript-eslint/parser': - specifier: ^6.9.0 - version: 6.9.0(eslint@8.52.0)(typescript@5.2.2) + specifier: ^6.9.1 + version: 6.9.1(eslint@8.52.0)(typescript@5.2.2) eslint-config-next: - specifier: ^13.5.6 - version: 13.5.6(eslint@8.52.0)(typescript@5.2.2) + specifier: ^14.0.1 + version: 14.0.1(eslint@8.52.0)(typescript@5.2.2) eslint-config-prettier: specifier: ^9.0.0 version: 9.0.0(eslint@8.52.0) @@ -431,7 +431,7 @@ packages: resolution: {integrity: sha512-z4gDFrBf+W2wOVvwA3CA+5bfKOxQhPeXQo7+ITWj3r3XPulIMEasVT0KrD41G+anr5Yc3d2PKvXKB6b1LSon5w==} dependencies: '@types/node': 18.18.7 - '@types/node-fetch': 2.6.7 + '@types/node-fetch': 2.6.8 abort-controller: 3.0.0 agentkeepalive: 4.5.0 digest-fetch: 1.3.0 @@ -512,15 +512,16 @@ packages: tslib: 1.14.1 dev: false - /@aws-sdk/client-s3@3.435.0: - resolution: {integrity: sha512-jyuv0SLLwc7Wa0s0eWHs1G4V0EJB2+4Nl/yn/LhEUrcDPrCI2FHd/lLudSmrEW+s7Rty0KTx5ZzeTn6YZ6ohTQ==} + /@aws-sdk/client-s3@3.438.0: + resolution: {integrity: sha512-5VxdfyZ9oovbK5qzIYW4ZeJ1waD6VqfclSDQLHmgulekM2JYo/goEQJSjWnI4VMWuMsopzvqyeA+L9xq9uXLBQ==} engines: {node: '>=14.0.0'} dependencies: '@aws-crypto/sha1-browser': 3.0.0 '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/client-sts': 3.435.0 - '@aws-sdk/credential-provider-node': 3.435.0 + '@aws-sdk/client-sts': 3.438.0 + '@aws-sdk/core': 3.436.0 + '@aws-sdk/credential-provider-node': 3.438.0 '@aws-sdk/middleware-bucket-endpoint': 3.433.0 '@aws-sdk/middleware-expect-continue': 3.433.0 '@aws-sdk/middleware-flexible-checksums': 3.433.0 @@ -531,13 +532,13 @@ packages: '@aws-sdk/middleware-sdk-s3': 3.433.0 '@aws-sdk/middleware-signing': 3.433.0 '@aws-sdk/middleware-ssec': 3.433.0 - '@aws-sdk/middleware-user-agent': 3.433.0 + '@aws-sdk/middleware-user-agent': 3.438.0 '@aws-sdk/region-config-resolver': 3.433.0 - '@aws-sdk/signature-v4-multi-region': 3.433.0 + '@aws-sdk/signature-v4-multi-region': 3.437.0 '@aws-sdk/types': 3.433.0 - '@aws-sdk/util-endpoints': 3.433.0 + '@aws-sdk/util-endpoints': 3.438.0 '@aws-sdk/util-user-agent-browser': 3.433.0 - '@aws-sdk/util-user-agent-node': 3.433.0 + '@aws-sdk/util-user-agent-node': 3.437.0 '@aws-sdk/xml-builder': 3.310.0 '@smithy/config-resolver': 2.0.16 '@smithy/eventstream-serde-browser': 2.0.12 @@ -565,6 +566,7 @@ packages: '@smithy/util-body-length-node': 2.1.0 '@smithy/util-defaults-mode-browser': 2.0.16 '@smithy/util-defaults-mode-node': 2.0.21 + '@smithy/util-endpoints': 1.0.2 '@smithy/util-retry': 2.0.5 '@smithy/util-stream': 2.0.17 '@smithy/util-utf8': 2.0.0 @@ -575,21 +577,22 @@ packages: - aws-crt dev: false - /@aws-sdk/client-sso@3.435.0: - resolution: {integrity: sha512-tT2bpwFZ3RStgyaS+JzFF4Yj+l4JRXP5+4ZRrIX5DFimzCUT8koeP4t2Gb6lvVD3DJL0nwGU5MODI1YbHTqZSQ==} + /@aws-sdk/client-sso@3.438.0: + resolution: {integrity: sha512-L/xKq+K78PShLku8x5gM6lZDUp7LhFJ2ksKH7Vll+exSZq+QUaxuzjp4gqdzh6B0oIshv2jssQlUa0ScOmVRMg==} engines: {node: '>=14.0.0'} dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 + '@aws-sdk/core': 3.436.0 '@aws-sdk/middleware-host-header': 3.433.0 '@aws-sdk/middleware-logger': 3.433.0 '@aws-sdk/middleware-recursion-detection': 3.433.0 - '@aws-sdk/middleware-user-agent': 3.433.0 + '@aws-sdk/middleware-user-agent': 3.438.0 '@aws-sdk/region-config-resolver': 3.433.0 '@aws-sdk/types': 3.433.0 - '@aws-sdk/util-endpoints': 3.433.0 + '@aws-sdk/util-endpoints': 3.438.0 '@aws-sdk/util-user-agent-browser': 3.433.0 - '@aws-sdk/util-user-agent-node': 3.433.0 + '@aws-sdk/util-user-agent-node': 3.437.0 '@smithy/config-resolver': 2.0.16 '@smithy/fetch-http-handler': 2.2.4 '@smithy/hash-node': 2.0.12 @@ -610,6 +613,7 @@ packages: '@smithy/util-body-length-node': 2.1.0 '@smithy/util-defaults-mode-browser': 2.0.16 '@smithy/util-defaults-mode-node': 2.0.21 + '@smithy/util-endpoints': 1.0.2 '@smithy/util-retry': 2.0.5 '@smithy/util-utf8': 2.0.0 tslib: 2.6.2 @@ -617,24 +621,25 @@ packages: - aws-crt dev: false - /@aws-sdk/client-sts@3.435.0: - resolution: {integrity: sha512-xenshHn87b4cv45ntRgTQqeGk3H7Rrs7Br63cejFG+6ZJw7JRiz1g8EL+pIUEYyWHPYwDG0493ylxwf7p8XqaQ==} + /@aws-sdk/client-sts@3.438.0: + resolution: {integrity: sha512-UBxLZKVVvbR4LHwSNSqaKx22YBSOGkavrh4SyDP8o8XOlXeRxTCllfSfjL9K5Mktp+ZwQ2NiubNcwmvUcGKbbg==} engines: {node: '>=14.0.0'} dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 - '@aws-sdk/credential-provider-node': 3.435.0 + '@aws-sdk/core': 3.436.0 + '@aws-sdk/credential-provider-node': 3.438.0 '@aws-sdk/middleware-host-header': 3.433.0 '@aws-sdk/middleware-logger': 3.433.0 '@aws-sdk/middleware-recursion-detection': 3.433.0 '@aws-sdk/middleware-sdk-sts': 3.433.0 '@aws-sdk/middleware-signing': 3.433.0 - '@aws-sdk/middleware-user-agent': 3.433.0 + '@aws-sdk/middleware-user-agent': 3.438.0 '@aws-sdk/region-config-resolver': 3.433.0 '@aws-sdk/types': 3.433.0 - '@aws-sdk/util-endpoints': 3.433.0 + '@aws-sdk/util-endpoints': 3.438.0 '@aws-sdk/util-user-agent-browser': 3.433.0 - '@aws-sdk/util-user-agent-node': 3.433.0 + '@aws-sdk/util-user-agent-node': 3.437.0 '@smithy/config-resolver': 2.0.16 '@smithy/fetch-http-handler': 2.2.4 '@smithy/hash-node': 2.0.12 @@ -655,6 +660,7 @@ packages: '@smithy/util-body-length-node': 2.1.0 '@smithy/util-defaults-mode-browser': 2.0.16 '@smithy/util-defaults-mode-node': 2.0.21 + '@smithy/util-endpoints': 1.0.2 '@smithy/util-retry': 2.0.5 '@smithy/util-utf8': 2.0.0 fast-xml-parser: 4.2.5 @@ -663,6 +669,13 @@ packages: - aws-crt dev: false + /@aws-sdk/core@3.436.0: + resolution: {integrity: sha512-vX5/LjXvCejC2XUY6TSg1oozjqK6BvkE75t0ys9dgqyr5PlZyZksMoeAFHUlj0sCjhT3ziWCujP1oiSpPWY9hg==} + engines: {node: '>=14.0.0'} + dependencies: + '@smithy/smithy-client': 2.1.12 + dev: false + /@aws-sdk/credential-provider-env@3.433.0: resolution: {integrity: sha512-Vl7Qz5qYyxBurMn6hfSiNJeUHSqfVUlMt0C1Bds3tCkl3IzecRWwyBOlxtxO3VCrgVeW3HqswLzCvhAFzPH6nQ==} engines: {node: '>=14.0.0'} @@ -673,13 +686,13 @@ packages: tslib: 2.6.2 dev: false - /@aws-sdk/credential-provider-ini@3.435.0: - resolution: {integrity: sha512-YHXftGxQ2UDaIyJ2F4ZbyU52MWyWZ9dFG9oKlnA0qMPF7AIH+GtH3X+oFGC0lCAi4zx4Zd26gFlkoqupVy1HbA==} + /@aws-sdk/credential-provider-ini@3.438.0: + resolution: {integrity: sha512-WYPQR3pXoHJjn9/RMWipUhsUNFy6zhOiII6u8LJ5w84aNqIjV4+BdRYztRNGJD98jdtekhbkX0YKoSuZqP+unQ==} engines: {node: '>=14.0.0'} dependencies: '@aws-sdk/credential-provider-env': 3.433.0 '@aws-sdk/credential-provider-process': 3.433.0 - '@aws-sdk/credential-provider-sso': 3.435.0 + '@aws-sdk/credential-provider-sso': 3.438.0 '@aws-sdk/credential-provider-web-identity': 3.433.0 '@aws-sdk/types': 3.433.0 '@smithy/credential-provider-imds': 2.0.18 @@ -691,14 +704,14 @@ packages: - aws-crt dev: false - /@aws-sdk/credential-provider-node@3.435.0: - resolution: {integrity: sha512-58sOsgBzkmhyGAvTRkI/OPe+hhwsbbO1iuoyFPzFcfbU90S9NSN4BkRnvcgphbckBwKy+BIF0wP2fk/gF0CdEA==} + /@aws-sdk/credential-provider-node@3.438.0: + resolution: {integrity: sha512-uaw3D2R0svyrC32qyZ2aOv/l0AT9eClh+eQsZJTQD3Kz9q+2VdeOBThQ8fsMfRtm26nUbZo6A/CRwxkm6okI+w==} engines: {node: '>=14.0.0'} dependencies: '@aws-sdk/credential-provider-env': 3.433.0 - '@aws-sdk/credential-provider-ini': 3.435.0 + '@aws-sdk/credential-provider-ini': 3.438.0 '@aws-sdk/credential-provider-process': 3.433.0 - '@aws-sdk/credential-provider-sso': 3.435.0 + '@aws-sdk/credential-provider-sso': 3.438.0 '@aws-sdk/credential-provider-web-identity': 3.433.0 '@aws-sdk/types': 3.433.0 '@smithy/credential-provider-imds': 2.0.18 @@ -721,12 +734,12 @@ packages: tslib: 2.6.2 dev: false - /@aws-sdk/credential-provider-sso@3.435.0: - resolution: {integrity: sha512-WPt/7efTM0lvHsCh+OzRp79wIatkCTnCoYcp4kCHIR+aq9Z9vXICPIhmSO4okGkHnlxd/7UuNdld1BoZkT9oRA==} + /@aws-sdk/credential-provider-sso@3.438.0: + resolution: {integrity: sha512-Xykli/64xR18cBV5P0XFxcH120omtfAjC/cFy/9nFU/+dPvbk0uu1yEOZYteWHyGGkPN4PkHmbh60GiUCLQkWQ==} engines: {node: '>=14.0.0'} dependencies: - '@aws-sdk/client-sso': 3.435.0 - '@aws-sdk/token-providers': 3.435.0 + '@aws-sdk/client-sso': 3.438.0 + '@aws-sdk/token-providers': 3.438.0 '@aws-sdk/types': 3.433.0 '@smithy/property-provider': 2.0.13 '@smithy/shared-ini-file-loader': 2.2.2 @@ -865,12 +878,12 @@ packages: tslib: 2.6.2 dev: false - /@aws-sdk/middleware-user-agent@3.433.0: - resolution: {integrity: sha512-jMgA1jHfisBK4oSjMKrtKEZf0sl2vzADivkFmyZFzORpSZxBnF6hC21RjaI+70LJLcc9rSCzLgcoz5lHb9LLDg==} + /@aws-sdk/middleware-user-agent@3.438.0: + resolution: {integrity: sha512-a+xHT1wOxT6EA6YyLmrfaroKWOkwwyiktUfXKM0FsUutGzNi4fKhb5NZ2al58NsXzHgHFrasSDp+Lqbd/X2cEw==} engines: {node: '>=14.0.0'} dependencies: '@aws-sdk/types': 3.433.0 - '@aws-sdk/util-endpoints': 3.433.0 + '@aws-sdk/util-endpoints': 3.438.0 '@smithy/protocol-http': 3.0.8 '@smithy/types': 2.4.0 tslib: 2.6.2 @@ -887,8 +900,8 @@ packages: tslib: 2.6.2 dev: false - /@aws-sdk/signature-v4-multi-region@3.433.0: - resolution: {integrity: sha512-wl2j1dos4VOKFawbapPm/0CNa3cIgpJXbEx+sp+DI3G8tSuP3c5UGtm0pXjM85egxZulhHVK1RVde0iD8j63pQ==} + /@aws-sdk/signature-v4-multi-region@3.437.0: + resolution: {integrity: sha512-MmrqudssOs87JgVg7HGVdvJws/t4kcOrJJd+975ki+DPeSoyK2U4zBDfDkJ+n0tFuZBs3sLwLh0QXE7BV28rRA==} engines: {node: '>=14.0.0'} dependencies: '@aws-sdk/types': 3.433.0 @@ -898,8 +911,8 @@ packages: tslib: 2.6.2 dev: false - /@aws-sdk/token-providers@3.435.0: - resolution: {integrity: sha512-JZKqsuoK321ozp2ufGmjfpbAqtK1tYnLn0PaePWjvDL48B5A5jGNqFyP3/tg7LFP7vTp9O3pJ7ln0QLh8FpsjQ==} + /@aws-sdk/token-providers@3.438.0: + resolution: {integrity: sha512-G2fUfTtU6/1ayYRMu0Pd9Ln4qYSvwJOWCqJMdkDgvXSwdgcOSOLsnAIk1AHGJDAvgLikdCzuyOsdJiexr9Vnww==} engines: {node: '>=14.0.0'} dependencies: '@aws-crypto/sha256-browser': 3.0.0 @@ -907,12 +920,12 @@ packages: '@aws-sdk/middleware-host-header': 3.433.0 '@aws-sdk/middleware-logger': 3.433.0 '@aws-sdk/middleware-recursion-detection': 3.433.0 - '@aws-sdk/middleware-user-agent': 3.433.0 + '@aws-sdk/middleware-user-agent': 3.438.0 '@aws-sdk/region-config-resolver': 3.433.0 '@aws-sdk/types': 3.433.0 - '@aws-sdk/util-endpoints': 3.433.0 + '@aws-sdk/util-endpoints': 3.438.0 '@aws-sdk/util-user-agent-browser': 3.433.0 - '@aws-sdk/util-user-agent-node': 3.433.0 + '@aws-sdk/util-user-agent-node': 3.437.0 '@smithy/config-resolver': 2.0.16 '@smithy/fetch-http-handler': 2.2.4 '@smithy/hash-node': 2.0.12 @@ -935,6 +948,7 @@ packages: '@smithy/util-body-length-node': 2.1.0 '@smithy/util-defaults-mode-browser': 2.0.16 '@smithy/util-defaults-mode-node': 2.0.21 + '@smithy/util-endpoints': 1.0.2 '@smithy/util-retry': 2.0.5 '@smithy/util-utf8': 2.0.0 tslib: 2.6.2 @@ -957,11 +971,12 @@ packages: tslib: 2.6.2 dev: false - /@aws-sdk/util-endpoints@3.433.0: - resolution: {integrity: sha512-LFNUh9FH7RMtYjSjPGz9lAJQMzmJ3RcXISzc5X5k2R/9mNwMK7y1k2VAfvx+RbuDbll6xwsXlgv6QHcxVdF2zw==} + /@aws-sdk/util-endpoints@3.438.0: + resolution: {integrity: sha512-6VyPTq1kN3GWxwFt5DdZfOsr6cJZPLjWh0troY/0uUv3hK74C9o3Y0Xf/z8UAUvQFkVqZse12O0/BgPVMImvfA==} engines: {node: '>=14.0.0'} dependencies: '@aws-sdk/types': 3.433.0 + '@smithy/util-endpoints': 1.0.2 tslib: 2.6.2 dev: false @@ -981,8 +996,8 @@ packages: tslib: 2.6.2 dev: false - /@aws-sdk/util-user-agent-node@3.433.0: - resolution: {integrity: sha512-yT1tO4MbbsUBLl5+S+jVv8wxiAtP5TKjKib9B2KQ2x0OtWWTrIf2o+IZK8va+zQqdV4MVMjezdxdE20hOdB4yQ==} + /@aws-sdk/util-user-agent-node@3.437.0: + resolution: {integrity: sha512-JVEcvWaniamtYVPem4UthtCNoTBCfFTwYj7Y3CrWZ2Qic4TqrwLkAfaBGtI2TGrhIClVr77uzLI6exqMTN7orA==} engines: {node: '>=14.0.0'} peerDependencies: aws-crt: '>=1.0.0' @@ -1207,6 +1222,74 @@ packages: to-fast-properties: 2.0.0 dev: false + /@biomejs/biome@1.3.2: + resolution: {integrity: sha512-ZGmN1an74M/4txB71nRojWK6fpmJK1EjGZgDGaUU+oFCoTNNHmGDbS09/2g7HLjkx6kiy4t/wPqXfZ2F7HHkOA==} + engines: {node: '>=14.*'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@biomejs/cli-darwin-arm64': 1.3.2 + '@biomejs/cli-darwin-x64': 1.3.2 + '@biomejs/cli-linux-arm64': 1.3.2 + '@biomejs/cli-linux-x64': 1.3.2 + '@biomejs/cli-win32-arm64': 1.3.2 + '@biomejs/cli-win32-x64': 1.3.2 + dev: false + + /@biomejs/cli-darwin-arm64@1.3.2: + resolution: {integrity: sha512-xYdC+HQleGDlYyEW62Ff5DYSt7SIeSrZEN1r1Hlo8MoI2TAFP4XsYcbF0p8fugYZhtMcXM7SLVlFhctQts8+Aw==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@biomejs/cli-darwin-x64@1.3.2: + resolution: {integrity: sha512-pYr/n38WpP33SZEkPfa2TkAZ8sZYzQbxv8QbU0rvwOhFQFEflrH4DZ20Ora442uSo5gS+TY8T3Gqa1PGJV4bLA==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@biomejs/cli-linux-arm64@1.3.2: + resolution: {integrity: sha512-cOL+xUpYksoSJo5Uyjpcn7jHyBfoScRzOeHmZnsVwp9Qwrs/lPZG//bs0JZ8RS0+l5toeZG+hDW18nb9LlS0Ww==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@biomejs/cli-linux-x64@1.3.2: + resolution: {integrity: sha512-7GtH2bMGxTnZpdNZvxAUEW9hk52fwVJr2DXSSakgMmYaZ3XgC3gcSRLicYIA5vL4Ppvjai2cmh6TOp1P7EPtGw==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@biomejs/cli-win32-arm64@1.3.2: + resolution: {integrity: sha512-fWW9Mo1BQB3kx6wiP/g7el2q/dLIMhgZNz/fXNFQvwOrW7sP/fBqsNjqqtqA9iW3+9GNn88Dt3fLkXsCN402oQ==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@biomejs/cli-win32-x64@1.3.2: + resolution: {integrity: sha512-lgr2zDqCKZVaCtyeg6uvSSkiWvWENfXLKZHIo9spB5SuzAE2r0UMPw/holO6AN0VhE16kjV5HO8UpDuzujKupg==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + /@emotion/babel-plugin@11.11.0: resolution: {integrity: sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==} dependencies: @@ -1247,7 +1330,7 @@ packages: resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} dev: false - /@emotion/react@11.11.1(@types/react@18.2.32)(react@18.2.0): + /@emotion/react@11.11.1(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==} peerDependencies: '@types/react': '*' @@ -1263,7 +1346,7 @@ packages: '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) '@emotion/utils': 1.2.1 '@emotion/weak-memoize': 0.3.1 - '@types/react': 18.2.32 + '@types/react': 18.2.33 hoist-non-react-statics: 3.3.2 react: 18.2.0 dev: false @@ -1282,7 +1365,7 @@ packages: resolution: {integrity: sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==} dev: false - /@emotion/styled@11.11.0(@emotion/react@11.11.1)(@types/react@18.2.32)(react@18.2.0): + /@emotion/styled@11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-hM5Nnvu9P3midq5aaXj4I+lnSfNi7Pmd4EWk1fOZ3pxookaQTNew6bp4JaCBYM4HVFZF9g7UjJmsUmC2JlxOng==} peerDependencies: '@emotion/react': ^11.0.0-rc.0 @@ -1295,11 +1378,11 @@ packages: '@babel/runtime': 7.23.2 '@emotion/babel-plugin': 11.11.0 '@emotion/is-prop-valid': 1.2.1 - '@emotion/react': 11.11.1(@types/react@18.2.32)(react@18.2.0) + '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) '@emotion/serialize': 1.1.2 '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) '@emotion/utils': 1.2.1 - '@types/react': 18.2.32 + '@types/react': 18.2.33 react: 18.2.0 dev: false @@ -1509,7 +1592,7 @@ packages: read-yaml-file: 1.1.0 dev: false - /@mui/base@5.0.0-beta.21(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0): + /@mui/base@5.0.0-beta.21(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-eTKWx3WV/nwmRUK4z4K1MzlMyWCsi3WJ3RtV4DiXZeRh4qd4JCyp1Zzzi8Wv9xM4dEBmqQntFoei716PzwmFfA==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1522,10 +1605,10 @@ packages: dependencies: '@babel/runtime': 7.23.2 '@floating-ui/react-dom': 2.0.2(react-dom@18.2.0)(react@18.2.0) - '@mui/types': 7.2.7(@types/react@18.2.32) - '@mui/utils': 5.14.15(@types/react@18.2.32)(react@18.2.0) + '@mui/types': 7.2.7(@types/react@18.2.33) + '@mui/utils': 5.14.15(@types/react@18.2.33)(react@18.2.0) '@popperjs/core': 2.11.8 - '@types/react': 18.2.32 + '@types/react': 18.2.33 clsx: 2.0.0 prop-types: 15.8.1 react: 18.2.0 @@ -1536,7 +1619,7 @@ packages: resolution: {integrity: sha512-ZCDzBWtCKjAYAlKKM3PA/jG/3uVIDT9ZitOtVixIVmTCQyc5jSV1qhJX8+qIGz4RQZ9KLzPWO2tXd0O5hvzouQ==} dev: false - /@mui/icons-material@5.14.15(@mui/material@5.14.15)(@types/react@18.2.32)(react@18.2.0): + /@mui/icons-material@5.14.15(@mui/material@5.14.15)(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-Dqu21vN/mVNzebJ+ofnKG+CeJYIhHuDs5+0fMEpdpzRt6UojelzdrEkNv+XkO0e1JMclzeXIRx404FirK/CFRw==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1548,12 +1631,12 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@mui/material': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0) - '@types/react': 18.2.32 + '@mui/material': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) + '@types/react': 18.2.33 react: 18.2.0 dev: false - /@mui/joy@5.0.0-beta.12(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0): + /@mui/joy@5.0.0-beta.12(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-e5G9EGkxiCXWNFbSdo4V4TzqjwDqlgMbCHygzFlBwrgY1pn4jBxC5NZe4btq2CREpAi9nZlCeYgHd3ejKYBGBg==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1571,21 +1654,21 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@emotion/react': 11.11.1(@types/react@18.2.32)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.32)(react@18.2.0) - '@mui/base': 5.0.0-beta.21(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0) + '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) + '@mui/base': 5.0.0-beta.21(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) '@mui/core-downloads-tracker': 5.14.15 - '@mui/system': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.32)(react@18.2.0) - '@mui/types': 7.2.7(@types/react@18.2.32) - '@mui/utils': 5.14.15(@types/react@18.2.32)(react@18.2.0) - '@types/react': 18.2.32 + '@mui/system': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react@18.2.0) + '@mui/types': 7.2.7(@types/react@18.2.33) + '@mui/utils': 5.14.15(@types/react@18.2.33)(react@18.2.0) + '@types/react': 18.2.33 clsx: 2.0.0 prop-types: 15.8.1 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@mui/material@5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0): + /@mui/material@5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-Gq65rHjvLzkxmhG8bvag851Oqsmru7qkUb/cCI2xu7dQzmY345f9xJRJi72sRGjhaqHXWeRKw/yIwp/7oQoeXg==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1603,14 +1686,14 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@emotion/react': 11.11.1(@types/react@18.2.32)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.32)(react@18.2.0) - '@mui/base': 5.0.0-beta.21(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0) + '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) + '@mui/base': 5.0.0-beta.21(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) '@mui/core-downloads-tracker': 5.14.15 - '@mui/system': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.32)(react@18.2.0) - '@mui/types': 7.2.7(@types/react@18.2.32) - '@mui/utils': 5.14.15(@types/react@18.2.32)(react@18.2.0) - '@types/react': 18.2.32 + '@mui/system': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react@18.2.0) + '@mui/types': 7.2.7(@types/react@18.2.33) + '@mui/utils': 5.14.15(@types/react@18.2.33)(react@18.2.0) + '@types/react': 18.2.33 '@types/react-transition-group': 4.4.8 clsx: 2.0.0 csstype: 3.1.2 @@ -1621,7 +1704,7 @@ packages: react-transition-group: 4.4.5(react-dom@18.2.0)(react@18.2.0) dev: false - /@mui/private-theming@5.14.15(@types/react@18.2.32)(react@18.2.0): + /@mui/private-theming@5.14.15(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-V2Xh+Tu6A07NoSpup0P9m29GwvNMYl5DegsGWqlOTJyAV7cuuVjmVPqxgvL8xBng4R85xqIQJRMjtYYktoPNuQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1632,8 +1715,8 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@mui/utils': 5.14.15(@types/react@18.2.32)(react@18.2.0) - '@types/react': 18.2.32 + '@mui/utils': 5.14.15(@types/react@18.2.33)(react@18.2.0) + '@types/react': 18.2.33 prop-types: 15.8.1 react: 18.2.0 dev: false @@ -1653,14 +1736,14 @@ packages: dependencies: '@babel/runtime': 7.23.2 '@emotion/cache': 11.11.0 - '@emotion/react': 11.11.1(@types/react@18.2.32)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.32)(react@18.2.0) + '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) csstype: 3.1.2 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/system@5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.32)(react@18.2.0): + /@mui/system@5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-zr0Gdk1RgKiEk+tCMB900LaOpEC8NaGvxtkmMdL/CXgkqQZSVZOt2PQsxJWaw7kE4YVkIe4VukFVc43qcq9u3w==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1677,20 +1760,20 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@emotion/react': 11.11.1(@types/react@18.2.32)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.32)(react@18.2.0) - '@mui/private-theming': 5.14.15(@types/react@18.2.32)(react@18.2.0) + '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) + '@mui/private-theming': 5.14.15(@types/react@18.2.33)(react@18.2.0) '@mui/styled-engine': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - '@mui/types': 7.2.7(@types/react@18.2.32) - '@mui/utils': 5.14.15(@types/react@18.2.32)(react@18.2.0) - '@types/react': 18.2.32 + '@mui/types': 7.2.7(@types/react@18.2.33) + '@mui/utils': 5.14.15(@types/react@18.2.33)(react@18.2.0) + '@types/react': 18.2.33 clsx: 2.0.0 csstype: 3.1.2 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/types@7.2.7(@types/react@18.2.32): + /@mui/types@7.2.7(@types/react@18.2.33): resolution: {integrity: sha512-sofpWmcBqOlTzRbr1cLQuUDKaUYVZTw8ENQrtL39TECRNENEzwgnNPh6WMfqMZlMvf1Aj9DLg74XPjnLr0izUQ==} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -1698,10 +1781,10 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.2.32 + '@types/react': 18.2.33 dev: false - /@mui/utils@5.14.15(@types/react@18.2.32)(react@18.2.0): + /@mui/utils@5.14.15(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-QBfHovAvTa0J1jXuYDaXGk+Yyp7+Fm8GSqx6nK2JbezGqzCFfirNdop/+bL9Flh/OQ/64PeXcW4HGDdOge+n3A==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1713,34 +1796,34 @@ packages: dependencies: '@babel/runtime': 7.23.2 '@types/prop-types': 15.7.9 - '@types/react': 18.2.32 + '@types/react': 18.2.33 prop-types: 15.8.1 react: 18.2.0 react-is: 18.2.0 dev: false - /@next-auth/prisma-adapter@1.0.7(@prisma/client@5.5.2)(next-auth@4.24.3): + /@next-auth/prisma-adapter@1.0.7(@prisma/client@5.5.2)(next-auth@4.24.4): resolution: {integrity: sha512-Cdko4KfcmKjsyHFrWwZ//lfLUbcLqlyFqjd/nYE2m3aZ7tjMNUjpks47iw7NTCnXf+5UWz5Ypyt1dSs1EP5QJw==} peerDependencies: '@prisma/client': '>=2.26.0 || >=3' next-auth: ^4 dependencies: '@prisma/client': 5.5.2(prisma@5.5.2) - next-auth: 4.24.3(next@13.5.6)(react-dom@18.2.0)(react@18.2.0) + next-auth: 4.24.4(next@14.0.1)(react-dom@18.2.0)(react@18.2.0) dev: false - /@next/env@13.5.6: - resolution: {integrity: sha512-Yac/bV5sBGkkEXmAX5FWPS9Mmo2rthrOPRQQNfycJPkjUAUclomCPH7QFVCDQ4Mp2k2K1SSM6m0zrxYrOwtFQw==} + /@next/env@14.0.1: + resolution: {integrity: sha512-Ms8ZswqY65/YfcjrlcIwMPD7Rg/dVjdLapMcSHG26W6O67EJDF435ShW4H4LXi1xKO1oRc97tLXUpx8jpLe86A==} dev: false - /@next/eslint-plugin-next@13.5.6: - resolution: {integrity: sha512-ng7pU/DDsxPgT6ZPvuprxrkeew3XaRf4LAT4FabaEO/hAbvVx4P7wqnqdbTdDn1kgTvsI4tpIgT4Awn/m0bGbg==} + /@next/eslint-plugin-next@14.0.1: + resolution: {integrity: sha512-bLjJMwXdzvhnQOnxvHoTTUh/+PYk6FF/DCgHi4BXwXCINer+o1ZYfL9aVeezj/oI7wqGJOqwGIXrlBvPbAId3w==} dependencies: glob: 7.1.7 dev: false - /@next/swc-darwin-arm64@13.5.6: - resolution: {integrity: sha512-5nvXMzKtZfvcu4BhtV0KH1oGv4XEW+B+jOfmBdpFI3C7FrB/MfujRpWYSBBO64+qbW8pkZiSyQv9eiwnn5VIQA==} + /@next/swc-darwin-arm64@14.0.1: + resolution: {integrity: sha512-JyxnGCS4qT67hdOKQ0CkgFTp+PXub5W1wsGvIq98TNbF3YEIN7iDekYhYsZzc8Ov0pWEsghQt+tANdidITCLaw==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] @@ -1748,8 +1831,8 @@ packages: dev: false optional: true - /@next/swc-darwin-x64@13.5.6: - resolution: {integrity: sha512-6cgBfxg98oOCSr4BckWjLLgiVwlL3vlLj8hXg2b+nDgm4bC/qVXXLfpLB9FHdoDu4057hzywbxKvmYGmi7yUzA==} + /@next/swc-darwin-x64@14.0.1: + resolution: {integrity: sha512-625Z7bb5AyIzswF9hvfZWa+HTwFZw+Jn3lOBNZB87lUS0iuCYDHqk3ujuHCkiyPtSC0xFBtYDLcrZ11mF/ap3w==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] @@ -1757,8 +1840,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-gnu@13.5.6: - resolution: {integrity: sha512-txagBbj1e1w47YQjcKgSU4rRVQ7uF29YpnlHV5xuVUsgCUf2FmyfJ3CPjZUvpIeXCJAoMCFAoGnbtX86BK7+sg==} + /@next/swc-linux-arm64-gnu@14.0.1: + resolution: {integrity: sha512-iVpn3KG3DprFXzVHM09kvb//4CNNXBQ9NB/pTm8LO+vnnnaObnzFdS5KM+w1okwa32xH0g8EvZIhoB3fI3mS1g==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -1766,8 +1849,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-musl@13.5.6: - resolution: {integrity: sha512-cGd+H8amifT86ZldVJtAKDxUqeFyLWW+v2NlBULnLAdWsiuuN8TuhVBt8ZNpCqcAuoruoSWynvMWixTFcroq+Q==} + /@next/swc-linux-arm64-musl@14.0.1: + resolution: {integrity: sha512-mVsGyMxTLWZXyD5sen6kGOTYVOO67lZjLApIj/JsTEEohDDt1im2nkspzfV5MvhfS7diDw6Rp/xvAQaWZTv1Ww==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -1775,8 +1858,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-gnu@13.5.6: - resolution: {integrity: sha512-Mc2b4xiIWKXIhBy2NBTwOxGD3nHLmq4keFk+d4/WL5fMsB8XdJRdtUlL87SqVCTSaf1BRuQQf1HvXZcy+rq3Nw==} + /@next/swc-linux-x64-gnu@14.0.1: + resolution: {integrity: sha512-wMqf90uDWN001NqCM/auRl3+qVVeKfjJdT9XW+RMIOf+rhUzadmYJu++tp2y+hUbb6GTRhT+VjQzcgg/QTD9NQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -1784,8 +1867,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-musl@13.5.6: - resolution: {integrity: sha512-CFHvP9Qz98NruJiUnCe61O6GveKKHpJLloXbDSWRhqhkJdZD2zU5hG+gtVJR//tyW897izuHpM6Gtf6+sNgJPQ==} + /@next/swc-linux-x64-musl@14.0.1: + resolution: {integrity: sha512-ol1X1e24w4j4QwdeNjfX0f+Nza25n+ymY0T2frTyalVczUmzkVD7QGgPTZMHfR1aLrO69hBs0G3QBYaj22J5GQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -1793,8 +1876,8 @@ packages: dev: false optional: true - /@next/swc-win32-arm64-msvc@13.5.6: - resolution: {integrity: sha512-aFv1ejfkbS7PUa1qVPwzDHjQWQtknzAZWGTKYIAaS4NMtBlk3VyA6AYn593pqNanlicewqyl2jUhQAaFV/qXsg==} + /@next/swc-win32-arm64-msvc@14.0.1: + resolution: {integrity: sha512-WEmTEeWs6yRUEnUlahTgvZteh5RJc4sEjCQIodJlZZ5/VJwVP8p2L7l6VhzQhT4h7KvLx/Ed4UViBdne6zpIsw==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] @@ -1802,8 +1885,8 @@ packages: dev: false optional: true - /@next/swc-win32-ia32-msvc@13.5.6: - resolution: {integrity: sha512-XqqpHgEIlBHvzwG8sp/JXMFkLAfGLqkbVsyN+/Ih1mR8INb6YCc2x/Mbwi6hsAgUnqQztz8cvEbHJUbSl7RHDg==} + /@next/swc-win32-ia32-msvc@14.0.1: + resolution: {integrity: sha512-oFpHphN4ygAgZUKjzga7SoH2VGbEJXZa/KL8bHCAwCjDWle6R1SpiGOdUdA8EJ9YsG1TYWpzY6FTbUA+iAJeww==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] @@ -1811,8 +1894,8 @@ packages: dev: false optional: true - /@next/swc-win32-x64-msvc@13.5.6: - resolution: {integrity: sha512-Cqfe1YmOS7k+5mGu92nl5ULkzpKuxJrP3+4AEuPmrpFZ3BHxTY3TnHmU1On3bFmFFs6FbTcdF58CCUProGpIGQ==} + /@next/swc-win32-x64-msvc@14.0.1: + resolution: {integrity: sha512-FFp3nOJ/5qSpeWT0BZQ+YE1pSMk4IMpkME/1DwKBwhg4mJLB9L+6EXuJi4JEwaJdl5iN+UUlmUD3IsR1kx5fAg==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -1891,7 +1974,7 @@ packages: '@babel/runtime': 7.23.2 dev: false - /@radix-ui/react-collection@1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0): + /@radix-ui/react-collection@1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-3SzW+0PW7yBBoQlT8wNcGtaxaD0XSu0uLUFgrtHY08Acx05TaHaOmVLR73c0j/cqpDy53KBMO7s0dx2wmOIDIA==} peerDependencies: '@types/react': '*' @@ -1905,17 +1988,17 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.32)(react@18.2.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.2.32)(react@18.2.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-slot': 1.0.2(@types/react@18.2.32)(react@18.2.0) - '@types/react': 18.2.32 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.33)(react@18.2.0) + '@radix-ui/react-context': 1.0.1(@types/react@18.2.33)(react@18.2.0) + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-slot': 1.0.2(@types/react@18.2.33)(react@18.2.0) + '@types/react': 18.2.33 '@types/react-dom': 18.2.14 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-compose-refs@1.0.1(@types/react@18.2.32)(react@18.2.0): + /@radix-ui/react-compose-refs@1.0.1(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==} peerDependencies: '@types/react': '*' @@ -1925,11 +2008,11 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@types/react': 18.2.32 + '@types/react': 18.2.33 react: 18.2.0 dev: false - /@radix-ui/react-context@1.0.1(@types/react@18.2.32)(react@18.2.0): + /@radix-ui/react-context@1.0.1(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==} peerDependencies: '@types/react': '*' @@ -1939,11 +2022,11 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@types/react': 18.2.32 + '@types/react': 18.2.33 react: 18.2.0 dev: false - /@radix-ui/react-dismissable-layer@1.0.5(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0): + /@radix-ui/react-dismissable-layer@1.0.5(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g==} peerDependencies: '@types/react': '*' @@ -1958,17 +2041,17 @@ packages: dependencies: '@babel/runtime': 7.23.2 '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.32)(react@18.2.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.32)(react@18.2.0) - '@radix-ui/react-use-escape-keydown': 1.0.3(@types/react@18.2.32)(react@18.2.0) - '@types/react': 18.2.32 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.33)(react@18.2.0) + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.33)(react@18.2.0) + '@radix-ui/react-use-escape-keydown': 1.0.3(@types/react@18.2.33)(react@18.2.0) + '@types/react': 18.2.33 '@types/react-dom': 18.2.14 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-portal@1.0.4(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0): + /@radix-ui/react-portal@1.0.4(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==} peerDependencies: '@types/react': '*' @@ -1982,14 +2065,14 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0) - '@types/react': 18.2.32 + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) + '@types/react': 18.2.33 '@types/react-dom': 18.2.14 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-presence@1.0.1(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0): + /@radix-ui/react-presence@1.0.1(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==} peerDependencies: '@types/react': '*' @@ -2003,15 +2086,15 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.32)(react@18.2.0) - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.32)(react@18.2.0) - '@types/react': 18.2.32 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.33)(react@18.2.0) + '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.33)(react@18.2.0) + '@types/react': 18.2.33 '@types/react-dom': 18.2.14 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-primitive@1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0): + /@radix-ui/react-primitive@1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==} peerDependencies: '@types/react': '*' @@ -2025,14 +2108,14 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@radix-ui/react-slot': 1.0.2(@types/react@18.2.32)(react@18.2.0) - '@types/react': 18.2.32 + '@radix-ui/react-slot': 1.0.2(@types/react@18.2.33)(react@18.2.0) + '@types/react': 18.2.33 '@types/react-dom': 18.2.14 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-slot@1.0.2(@types/react@18.2.32)(react@18.2.0): + /@radix-ui/react-slot@1.0.2(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==} peerDependencies: '@types/react': '*' @@ -2042,12 +2125,12 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.32)(react@18.2.0) - '@types/react': 18.2.32 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.33)(react@18.2.0) + '@types/react': 18.2.33 react: 18.2.0 dev: false - /@radix-ui/react-toast@1.1.5(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0): + /@radix-ui/react-toast@1.1.5(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-fRLn227WHIBRSzuRzGJ8W+5YALxofH23y0MlPLddaIpLpCDqdE0NZlS2NRQDRiptfxDeeCjgFIpexB1/zkxDlw==} peerDependencies: '@types/react': '*' @@ -2062,24 +2145,24 @@ packages: dependencies: '@babel/runtime': 7.23.2 '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-collection': 1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.32)(react@18.2.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.2.32)(react@18.2.0) - '@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-portal': 1.0.4(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.32)(react@18.2.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.32)(react@18.2.0) - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.32)(react@18.2.0) - '@radix-ui/react-visually-hidden': 1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0) - '@types/react': 18.2.32 + '@radix-ui/react-collection': 1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.33)(react@18.2.0) + '@radix-ui/react-context': 1.0.1(@types/react@18.2.33)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-portal': 1.0.4(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.33)(react@18.2.0) + '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.33)(react@18.2.0) + '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.33)(react@18.2.0) + '@radix-ui/react-visually-hidden': 1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) + '@types/react': 18.2.33 '@types/react-dom': 18.2.14 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-use-callback-ref@1.0.1(@types/react@18.2.32)(react@18.2.0): + /@radix-ui/react-use-callback-ref@1.0.1(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==} peerDependencies: '@types/react': '*' @@ -2089,11 +2172,11 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@types/react': 18.2.32 + '@types/react': 18.2.33 react: 18.2.0 dev: false - /@radix-ui/react-use-controllable-state@1.0.1(@types/react@18.2.32)(react@18.2.0): + /@radix-ui/react-use-controllable-state@1.0.1(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-Svl5GY5FQeN758fWKrjM6Qb7asvXeiZltlT4U2gVfl8Gx5UAv2sMR0LWo8yhsIZh2oQ0eFdZ59aoOOMV7b47VA==} peerDependencies: '@types/react': '*' @@ -2103,12 +2186,12 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.32)(react@18.2.0) - '@types/react': 18.2.32 + '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.33)(react@18.2.0) + '@types/react': 18.2.33 react: 18.2.0 dev: false - /@radix-ui/react-use-escape-keydown@1.0.3(@types/react@18.2.32)(react@18.2.0): + /@radix-ui/react-use-escape-keydown@1.0.3(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-vyL82j40hcFicA+M4Ex7hVkB9vHgSse1ZWomAqV2Je3RleKGO5iM8KMOEtfoSB0PnIelMd2lATjTGMYqN5ylTg==} peerDependencies: '@types/react': '*' @@ -2118,12 +2201,12 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.32)(react@18.2.0) - '@types/react': 18.2.32 + '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.33)(react@18.2.0) + '@types/react': 18.2.33 react: 18.2.0 dev: false - /@radix-ui/react-use-layout-effect@1.0.1(@types/react@18.2.32)(react@18.2.0): + /@radix-ui/react-use-layout-effect@1.0.1(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-v/5RegiJWYdoCvMnITBkNNx6bCj20fiaJnWtRkU18yITptraXjffz5Qbn05uOiQnOvi+dbkznkoaMltz1GnszQ==} peerDependencies: '@types/react': '*' @@ -2133,11 +2216,11 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@types/react': 18.2.32 + '@types/react': 18.2.33 react: 18.2.0 dev: false - /@radix-ui/react-visually-hidden@1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0): + /@radix-ui/react-visually-hidden@1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-D4w41yN5YRKtu464TLnByKzMDG/JlMPHtfZgQAu9v6mNakUqGUI9vUrfQKz8NK41VMm/xbZbh76NUTVtIYqOMA==} peerDependencies: '@types/react': '*' @@ -2151,8 +2234,8 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.32)(react-dom@18.2.0)(react@18.2.0) - '@types/react': 18.2.32 + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) + '@types/react': 18.2.33 '@types/react-dom': 18.2.14 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -2610,6 +2693,15 @@ packages: tslib: 2.6.2 dev: false + /@smithy/util-endpoints@1.0.2: + resolution: {integrity: sha512-QEdq+sP68IJHAMVB2ugKVVZEWeKQtZLuf+akHzc8eTVElsZ2ZdVLWC6Cp+uKjJ/t4yOj1qu6ZzyxJQEQ8jdEjg==} + engines: {node: '>= 14.0.0'} + dependencies: + '@smithy/node-config-provider': 2.1.3 + '@smithy/types': 2.4.0 + tslib: 2.6.2 + dev: false + /@smithy/util-hex-encoding@2.0.0: resolution: {integrity: sha512-c5xY+NUnFqG6d7HFh1IFfrm3mGl29lC+vF+geHv4ToiuJCBmIfzx6IeHLg+OgRdPFKDXIw6pvi+p3CsscaMcMA==} engines: {node: '>=14.0.0'} @@ -2734,53 +2826,53 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - /@trpc/client@10.42.0(@trpc/server@10.42.0): - resolution: {integrity: sha512-iHPBVUAvn4VTKE75KLZ2fUQL8wpRY5hiRLyRE8QhGUSDc/RW5Pym9wotryZqz47DHjs2J5Qd16MSGt3tNlclFA==} + /@trpc/client@10.43.0(@trpc/server@10.43.0): + resolution: {integrity: sha512-8LbSpPHmIseb/Ke+GzL45y0itkKunGQWfxqHf2uy69RSRvER0vj+Gu67L8YD86FBgc/nsX/6GBuJiUet5lIDIw==} peerDependencies: - '@trpc/server': 10.42.0 + '@trpc/server': 10.43.0 dependencies: - '@trpc/server': 10.42.0 + '@trpc/server': 10.43.0 dev: false - /@trpc/next@10.42.0(@tanstack/react-query@4.36.1)(@trpc/client@10.42.0)(@trpc/react-query@10.42.0)(@trpc/server@10.42.0)(next@13.5.6)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-MIzmCxII+piZ4EaG2oQQ+/WBBHKdcUfNNR/GwYegu9rqTBXZFu8uiB3TQYmSgBXjKKpqLkBYcEdgaQ7EBMBjBA==} + /@trpc/next@10.43.0(@tanstack/react-query@4.36.1)(@trpc/client@10.43.0)(@trpc/react-query@10.43.0)(@trpc/server@10.43.0)(next@14.0.1)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-yakRlkvf6+uc3igYZi8nPkppJ8jFaCyd/7kvSckgsdLC8ofM+N9rrBkfqdfS5Pd53awkK/MMK8js9v/vabKb6A==} peerDependencies: '@tanstack/react-query': ^4.18.0 - '@trpc/client': 10.42.0 - '@trpc/react-query': 10.42.0 - '@trpc/server': 10.42.0 + '@trpc/client': 10.43.0 + '@trpc/react-query': 10.43.0 + '@trpc/server': 10.43.0 next: '*' react: '>=16.8.0' react-dom: '>=16.8.0' dependencies: '@tanstack/react-query': 4.36.1(react-dom@18.2.0)(react@18.2.0) - '@trpc/client': 10.42.0(@trpc/server@10.42.0) - '@trpc/react-query': 10.42.0(@tanstack/react-query@4.36.1)(@trpc/client@10.42.0)(@trpc/server@10.42.0)(react-dom@18.2.0)(react@18.2.0) - '@trpc/server': 10.42.0 - next: 13.5.6(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) + '@trpc/client': 10.43.0(@trpc/server@10.43.0) + '@trpc/react-query': 10.43.0(@tanstack/react-query@4.36.1)(@trpc/client@10.43.0)(@trpc/server@10.43.0)(react-dom@18.2.0)(react@18.2.0) + '@trpc/server': 10.43.0 + next: 14.0.1(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) react-ssr-prepass: 1.5.0(react@18.2.0) dev: false - /@trpc/react-query@10.42.0(@tanstack/react-query@4.36.1)(@trpc/client@10.42.0)(@trpc/server@10.42.0)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-Yzpg/WMrLo9HwWQtpgNutEFB6V/OHvMJf7nziKGPGrHrWJFkRtpQvc9ruDlJUFik+YxXwFRvtGBXbstlNsyhcQ==} + /@trpc/react-query@10.43.0(@tanstack/react-query@4.36.1)(@trpc/client@10.43.0)(@trpc/server@10.43.0)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-5+pBnnV9QqnwpO5Li9T60hXHylV1USEjFkRjrnd7mJul/t2dKxs5ouv+YDRnOJ36oD9wDki5lBGk2sOgFrzGUw==} peerDependencies: '@tanstack/react-query': ^4.18.0 - '@trpc/client': 10.42.0 - '@trpc/server': 10.42.0 + '@trpc/client': 10.43.0 + '@trpc/server': 10.43.0 react: '>=16.8.0' react-dom: '>=16.8.0' dependencies: '@tanstack/react-query': 4.36.1(react-dom@18.2.0)(react@18.2.0) - '@trpc/client': 10.42.0(@trpc/server@10.42.0) - '@trpc/server': 10.42.0 + '@trpc/client': 10.43.0(@trpc/server@10.43.0) + '@trpc/server': 10.43.0 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@trpc/server@10.42.0: - resolution: {integrity: sha512-s0QuK72orW+pYce60sd4I36N3xJKzypS2k+8GJ7phH4KqO4XjBXezOFmGMcXTznsVqEiX5zs5ujLfQdJ9X3Y2g==} + /@trpc/server@10.43.0: + resolution: {integrity: sha512-1/h9KCPkTNNmpN5VKfKO4kPcl/W4Y9VQla4YGg4pydSh/+4b//0IPfvk3Oz4tz/tvWyAUlBKkBVhD3GfDLcAQA==} dev: false /@ts-morph/common@0.12.3: @@ -3000,12 +3092,12 @@ packages: /@types/eslint@8.44.6: resolution: {integrity: sha512-P6bY56TVmX8y9J87jHNgQh43h6VVU+6H7oN7hgvivV81K2XY8qJZ5vqPy/HdUoVIelii2kChYVzQanlswPWVFw==} dependencies: - '@types/estree': 1.0.3 + '@types/estree': 1.0.4 '@types/json-schema': 7.0.14 dev: false - /@types/estree@1.0.3: - resolution: {integrity: sha512-CS2rOaoQ/eAgAfcTfq6amKG7bsN+EMcgGY4FAFQdvSj2y1ixvOZTUA9mOtCai7E1SYu283XNw7urKK30nP3wkQ==} + /@types/estree@1.0.4: + resolution: {integrity: sha512-2JwWnHK9H+wUZNorf2Zr6ves96WHoWDJIftkcxPKsS7Djta6Zu519LarhRNljPXkpsZR2ZMwNCPeW7omW07BJw==} dev: false /@types/formidable@3.4.4: @@ -3047,8 +3139,8 @@ packages: /@types/ms@0.7.33: resolution: {integrity: sha512-AuHIyzR5Hea7ij0P9q7vx7xu4z0C28ucwjAZC0ja7JhINyCnOw8/DnvAPQQ9TfOlCtZAmCERKQX9+o1mgQhuOQ==} - /@types/node-fetch@2.6.7: - resolution: {integrity: sha512-lX17GZVpJ/fuCjguZ5b3TjEbSENxmEk1B2z02yoXSK9WMEWRivhdSY73wWMn6bpcCDAOh6qAdktpKHIlkDk2lg==} + /@types/node-fetch@2.6.8: + resolution: {integrity: sha512-nnH5lV9QCMPsbEVdTb5Y+F3GQxLSw1xQgIydrb2gSfEavRPs50FnMr+KUaa+LoPSqibm2N+ZZxH7lavZlAT4GA==} dependencies: '@types/node': 20.8.9 form-data: 4.0.0 @@ -3075,16 +3167,16 @@ packages: /@types/react-dom@18.2.14: resolution: {integrity: sha512-V835xgdSVmyQmI1KLV2BEIUgqEuinxp9O4G6g3FqO/SqLac049E53aysv0oEFD2kHfejeKU+ZqL2bcFWj9gLAQ==} dependencies: - '@types/react': 18.2.32 + '@types/react': 18.2.33 /@types/react-transition-group@4.4.8: resolution: {integrity: sha512-QmQ22q+Pb+HQSn04NL3HtrqHwYMf4h3QKArOy5F8U5nEVMaihBs3SR10WiOM1iwPz5jIo8x/u11al+iEGZZrvg==} dependencies: - '@types/react': 18.2.32 + '@types/react': 18.2.33 dev: false - /@types/react@18.2.32: - resolution: {integrity: sha512-F0FVIZQ1x5Gxy/VYJb7XcWvCcHR28Sjwt1dXLspdIatfPq1MVACfnBDwKe6ANLxQ64riIJooXClpUR6oxTiepg==} + /@types/react@18.2.33: + resolution: {integrity: sha512-v+I7S+hu3PIBoVkKGpSYYpiBT1ijqEzWpzQD62/jm4K74hPpSP7FF9BnKG6+fg2+62weJYkkBWDJlZt5JO/9hg==} dependencies: '@types/prop-types': 15.7.9 '@types/scheduler': 0.16.5 @@ -3118,8 +3210,8 @@ packages: /@types/uuid@9.0.6: resolution: {integrity: sha512-BT2Krtx4xaO6iwzwMFUYvWBWkV2pr37zD68Vmp1CDV196MzczBRxuEpD6Pr395HAgebC/co7hOphs53r8V7jew==} - /@typescript-eslint/eslint-plugin@6.9.0(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@5.2.2): - resolution: {integrity: sha512-lgX7F0azQwRPB7t7WAyeHWVfW1YJ9NIgd9mvGhfQpRY56X6AVf8mwM8Wol+0z4liE7XX3QOt8MN1rUKCfSjRIA==} + /@typescript-eslint/eslint-plugin@6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-w0tiiRc9I4S5XSXXrMHOWgHgxbrBn1Ro+PmiYhSg2ZVdxrAJtQgzU5o2m1BfP6UOn7Vxcc6152vFjQfmZR4xEg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha @@ -3130,11 +3222,11 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.9.0(eslint@8.52.0)(typescript@5.2.2) - '@typescript-eslint/scope-manager': 6.9.0 - '@typescript-eslint/type-utils': 6.9.0(eslint@8.52.0)(typescript@5.2.2) - '@typescript-eslint/utils': 6.9.0(eslint@8.52.0)(typescript@5.2.2) - '@typescript-eslint/visitor-keys': 6.9.0 + '@typescript-eslint/parser': 6.9.1(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/scope-manager': 6.9.1 + '@typescript-eslint/type-utils': 6.9.1(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.9.1(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.9.1 debug: 4.3.4 eslint: 8.52.0 graphemer: 1.4.0 @@ -3147,8 +3239,8 @@ packages: - supports-color dev: false - /@typescript-eslint/parser@6.9.0(eslint@8.52.0)(typescript@5.2.2): - resolution: {integrity: sha512-GZmjMh4AJ/5gaH4XF2eXA8tMnHWP+Pm1mjQR2QN4Iz+j/zO04b9TOvJYOX2sCNIQHtRStKTxRY1FX7LhpJT4Gw==} + /@typescript-eslint/parser@6.9.1(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-C7AK2wn43GSaCUZ9do6Ksgi2g3mwFkMO3Cis96kzmgudoVaKyt62yNzJOktP0HDLb/iO2O0n2lBOzJgr6Q/cyg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -3157,10 +3249,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.9.0 - '@typescript-eslint/types': 6.9.0 - '@typescript-eslint/typescript-estree': 6.9.0(typescript@5.2.2) - '@typescript-eslint/visitor-keys': 6.9.0 + '@typescript-eslint/scope-manager': 6.9.1 + '@typescript-eslint/types': 6.9.1 + '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.9.1 debug: 4.3.4 eslint: 8.52.0 typescript: 5.2.2 @@ -3168,16 +3260,16 @@ packages: - supports-color dev: false - /@typescript-eslint/scope-manager@6.9.0: - resolution: {integrity: sha512-1R8A9Mc39n4pCCz9o79qRO31HGNDvC7UhPhv26TovDsWPBDx+Sg3rOZdCELIA3ZmNoWAuxaMOT7aWtGRSYkQxw==} + /@typescript-eslint/scope-manager@6.9.1: + resolution: {integrity: sha512-38IxvKB6NAne3g/+MyXMs2Cda/Sz+CEpmm+KLGEM8hx/CvnSRuw51i8ukfwB/B/sESdeTGet1NH1Wj7I0YXswg==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.9.0 - '@typescript-eslint/visitor-keys': 6.9.0 + '@typescript-eslint/types': 6.9.1 + '@typescript-eslint/visitor-keys': 6.9.1 dev: false - /@typescript-eslint/type-utils@6.9.0(eslint@8.52.0)(typescript@5.2.2): - resolution: {integrity: sha512-XXeahmfbpuhVbhSOROIzJ+b13krFmgtc4GlEuu1WBT+RpyGPIA4Y/eGnXzjbDj5gZLzpAXO/sj+IF/x2GtTMjQ==} + /@typescript-eslint/type-utils@6.9.1(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-eh2oHaUKCK58qIeYp19F5V5TbpM52680sB4zNSz29VBQPTWIlE/hCj5P5B1AChxECe/fmZlspAWFuRniep1Skg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -3186,8 +3278,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.9.0(typescript@5.2.2) - '@typescript-eslint/utils': 6.9.0(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.2.2) + '@typescript-eslint/utils': 6.9.1(eslint@8.52.0)(typescript@5.2.2) debug: 4.3.4 eslint: 8.52.0 ts-api-utils: 1.0.3(typescript@5.2.2) @@ -3196,13 +3288,13 @@ packages: - supports-color dev: false - /@typescript-eslint/types@6.9.0: - resolution: {integrity: sha512-+KB0lbkpxBkBSiVCuQvduqMJy+I1FyDbdwSpM3IoBS7APl4Bu15lStPjgBIdykdRqQNYqYNMa8Kuidax6phaEw==} + /@typescript-eslint/types@6.9.1: + resolution: {integrity: sha512-BUGslGOb14zUHOUmDB2FfT6SI1CcZEJYfF3qFwBeUrU6srJfzANonwRYHDpLBuzbq3HaoF2XL2hcr01c8f8OaQ==} engines: {node: ^16.0.0 || >=18.0.0} dev: false - /@typescript-eslint/typescript-estree@6.9.0(typescript@5.2.2): - resolution: {integrity: sha512-NJM2BnJFZBEAbCfBP00zONKXvMqihZCrmwCaik0UhLr0vAgb6oguXxLX1k00oQyD+vZZ+CJn3kocvv2yxm4awQ==} + /@typescript-eslint/typescript-estree@6.9.1(typescript@5.2.2): + resolution: {integrity: sha512-U+mUylTHfcqeO7mLWVQ5W/tMLXqVpRv61wm9ZtfE5egz7gtnmqVIw9ryh0mgIlkKk9rZLY3UHygsBSdB9/ftyw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -3210,8 +3302,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.9.0 - '@typescript-eslint/visitor-keys': 6.9.0 + '@typescript-eslint/types': 6.9.1 + '@typescript-eslint/visitor-keys': 6.9.1 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -3222,8 +3314,8 @@ packages: - supports-color dev: false - /@typescript-eslint/utils@6.9.0(eslint@8.52.0)(typescript@5.2.2): - resolution: {integrity: sha512-5Wf+Jsqya7WcCO8me504FBigeQKVLAMPmUzYgDbWchINNh1KJbxCgVya3EQ2MjvJMVeXl3pofRmprqX6mfQkjQ==} + /@typescript-eslint/utils@6.9.1(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-L1T0A5nFdQrMVunpZgzqPL6y2wVreSyHhKGZryS6jrEN7bD9NplVAyMryUhXsQ4TWLnZmxc2ekar/lSGIlprCA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -3231,9 +3323,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.52.0) '@types/json-schema': 7.0.14 '@types/semver': 7.5.4 - '@typescript-eslint/scope-manager': 6.9.0 - '@typescript-eslint/types': 6.9.0 - '@typescript-eslint/typescript-estree': 6.9.0(typescript@5.2.2) + '@typescript-eslint/scope-manager': 6.9.1 + '@typescript-eslint/types': 6.9.1 + '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.2.2) eslint: 8.52.0 semver: 7.5.4 transitivePeerDependencies: @@ -3241,11 +3333,11 @@ packages: - typescript dev: false - /@typescript-eslint/visitor-keys@6.9.0: - resolution: {integrity: sha512-dGtAfqjV6RFOtIP8I0B4ZTBRrlTT8NHHlZZSchQx3qReaoDeXhYM++M4So2AgFK9ZB0emRPA6JI1HkafzA2Ibg==} + /@typescript-eslint/visitor-keys@6.9.1: + resolution: {integrity: sha512-MUaPUe/QRLEffARsmNfmpghuQkW436DvESW+h+M52w0coICHRfD6Np9/K6PdACwnrq1HmuLl+cSPZaJmeVPkSw==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.9.0 + '@typescript-eslint/types': 6.9.1 eslint-visitor-keys: 3.4.3 dev: false @@ -3260,12 +3352,11 @@ packages: - encoding dev: false - /@upstash/redis@1.23.4: - resolution: {integrity: sha512-7KtG6RE5W7QbByDjQq7cEpwG2ir46VrEXZ8NFRn17FYSJUHKeHl6qnAqQJIR5rAItQWtyrKNYBij5IGEjUevhA==} + /@upstash/redis@1.24.2: + resolution: {integrity: sha512-R2kqb6akTTO8F1fVXoqc3+7ueyKOgen2Q0ObHxNvRQwc1cN4xggxuuQGYYvGiMOVfmMrkGvVRKLmVtmkGjC/2g==} dependencies: - isomorphic-fetch: 3.0.0 - transitivePeerDependencies: - - encoding + '@biomejs/biome': 1.3.2 + crypto-js: 4.2.0 dev: false /@vercel/analytics@1.1.1: @@ -3311,15 +3402,15 @@ packages: engines: {node: '>=12'} dev: false - /acorn-jsx@5.3.2(acorn@8.10.0): + /acorn-jsx@5.3.2(acorn@8.11.2): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.10.0 + acorn: 8.11.2 - /acorn@8.10.0: - resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} + /acorn@8.11.2: + resolution: {integrity: sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==} engines: {node: '>=0.4.0'} hasBin: true @@ -3494,7 +3585,7 @@ packages: postcss: ^8.1.0 dependencies: browserslist: 4.22.1 - caniuse-lite: 1.0.30001554 + caniuse-lite: 1.0.30001558 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -3512,8 +3603,8 @@ packages: engines: {node: '>=4'} dev: false - /axios@1.5.1: - resolution: {integrity: sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==} + /axios@1.6.0: + resolution: {integrity: sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==} dependencies: follow-redirects: 1.15.3 form-data: 4.0.0 @@ -3593,8 +3684,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001554 - electron-to-chromium: 1.4.566 + caniuse-lite: 1.0.30001558 + electron-to-chromium: 1.4.570 node-releases: 2.0.13 update-browserslist-db: 1.0.13(browserslist@4.22.1) @@ -3644,8 +3735,8 @@ packages: engines: {node: '>=10'} dev: false - /caniuse-lite@1.0.30001554: - resolution: {integrity: sha512-A2E3U//MBwbJVzebddm1YfNp7Nud5Ip+IPn4BozBmn4KqVX7AvluoIDFWjsv5OkGnKUXQVmMSoMKLa3ScCblcQ==} + /caniuse-lite@1.0.30001558: + resolution: {integrity: sha512-/Et7DwLqpjS47JPEcz6VnxU9PwcIdVi0ciLXRWBQdj1XFye68pSQYpV0QtPTfUKWuOaEig+/Vez2l74eDc1tPQ==} /canvas-color-tracker@1.2.1: resolution: {integrity: sha512-i5clg2pEdaWqHuEM/B74NZNLkHh5+OkXbA/T4iaBiaNDagkOCXkLNrhqUfdUugsRwuaNRU20e/OygzxWRor3yg==} @@ -3805,7 +3896,7 @@ packages: resolution: {integrity: sha512-yCEafptTtb4bk7GLEQoM8KVJpxAfdBJYaXyzQEgQQQgYrZiDp8SJmGKlYza6CYjEDNstAdNdKA3UuoULlEbS6w==} engines: {node: '>=12.13'} dependencies: - is-what: 4.1.15 + is-what: 4.1.16 dev: false /core-util-is@1.0.3: @@ -4223,8 +4314,8 @@ packages: resolution: {integrity: sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==} dev: false - /electron-to-chromium@1.4.566: - resolution: {integrity: sha512-mv+fAy27uOmTVlUULy15U3DVJ+jg+8iyKH1bpwboCRhtDC69GKf1PPTZvEIhCyDr81RFqfxZJYrbgp933a1vtg==} + /electron-to-chromium@1.4.570: + resolution: {integrity: sha512-5GxH0PLSIfXKOUMMHMCT4M0olwj1WwAxsQHzVW5Vh3kbsvGw8b4k7LHQmTLC2aRhsgFzrF57XJomca4XLc/WHA==} /emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} @@ -4361,8 +4452,8 @@ packages: engines: {node: '>=12'} dev: false - /eslint-config-next@13.5.6(eslint@8.52.0)(typescript@5.2.2): - resolution: {integrity: sha512-o8pQsUHTo9aHqJ2YiZDym5gQAMRf7O2HndHo/JZeY7TDD+W4hk6Ma8Vw54RHiBeb7OWWO5dPirQB+Is/aVQ7Kg==} + /eslint-config-next@14.0.1(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-QfIFK2WD39H4WOespjgf6PLv9Bpsd7KGGelCtmq4l67nGvnlsGpuvj0hIT+aIy6p5gKH+lAChYILsyDlxP52yg==} peerDependencies: eslint: ^7.23.0 || ^8.0.0 typescript: '>=3.3.1' @@ -4370,13 +4461,13 @@ packages: typescript: optional: true dependencies: - '@next/eslint-plugin-next': 13.5.6 + '@next/eslint-plugin-next': 14.0.1 '@rushstack/eslint-patch': 1.5.1 - '@typescript-eslint/parser': 6.9.0(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.9.1(eslint@8.52.0)(typescript@5.2.2) eslint: 8.52.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.9.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.0)(eslint@8.52.0) - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.9.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.9.1)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.0)(eslint@8.52.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.9.1)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0) eslint-plugin-jsx-a11y: 6.7.1(eslint@8.52.0) eslint-plugin-react: 7.33.2(eslint@8.52.0) eslint-plugin-react-hooks: 4.6.0(eslint@8.52.0) @@ -4414,7 +4505,7 @@ packages: - supports-color dev: false - /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.9.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.0)(eslint@8.52.0): + /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.9.1)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.0)(eslint@8.52.0): resolution: {integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -4424,8 +4515,8 @@ packages: debug: 4.3.4 enhanced-resolve: 5.15.0 eslint: 8.52.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.9.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0) - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.9.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.9.1)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.9.1)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0) fast-glob: 3.3.1 get-tsconfig: 4.7.2 is-core-module: 2.13.1 @@ -4437,7 +4528,7 @@ packages: - supports-color dev: false - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.9.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.9.1)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -4458,16 +4549,16 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.9.0(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.9.1(eslint@8.52.0)(typescript@5.2.2) debug: 3.2.7 eslint: 8.52.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.9.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.0)(eslint@8.52.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.9.1)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.0)(eslint@8.52.0) transitivePeerDependencies: - supports-color dev: false - /eslint-plugin-import@2.29.0(@typescript-eslint/parser@6.9.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0): + /eslint-plugin-import@2.29.0(@typescript-eslint/parser@6.9.1)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0): resolution: {integrity: sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==} engines: {node: '>=4'} peerDependencies: @@ -4477,7 +4568,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 6.9.0(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.9.1(eslint@8.52.0)(typescript@5.2.2) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -4486,7 +4577,7 @@ packages: doctrine: 2.1.0 eslint: 8.52.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.9.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.9.1)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.52.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -4631,8 +4722,8 @@ packages: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.10.0 - acorn-jsx: 5.3.2(acorn@8.10.0) + acorn: 8.11.2 + acorn-jsx: 5.3.2(acorn@8.11.2) eslint-visitor-keys: 3.4.3 /esprima@4.0.1: @@ -5398,8 +5489,8 @@ packages: get-intrinsic: 1.2.2 dev: false - /is-what@4.1.15: - resolution: {integrity: sha512-uKua1wfy3Yt+YqsD6mTUEa2zSi3G1oPlqTflgaPJ7z63vUGN5pxFpnQfeSLMFnJDEsdvOtkp1rUWkYjB4YfhgA==} + /is-what@4.1.16: + resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==} engines: {node: '>=12.13'} dev: false @@ -5438,8 +5529,8 @@ packages: engines: {node: '>=12'} dev: false - /jiti@1.20.0: - resolution: {integrity: sha512-3TV69ZbrvV6U5DfQimop50jE9Dl6J8O1ja1dvBbMba/sZ3YBEQqJ2VZRoQPVnhlzjNtU1vaXRZVrVjU4qtm8yA==} + /jiti@1.21.0: + resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} hasBin: true dev: true @@ -5564,8 +5655,8 @@ packages: dependencies: json-buffer: 3.0.1 - /langchain@0.0.172(@aws-sdk/client-s3@3.435.0)(@upstash/redis@1.23.4)(mammoth@1.6.0)(pdf-parse@1.1.1)(playwright@1.39.0): - resolution: {integrity: sha512-HsUpAJmR3UPWmjuDckItddRPor5gViOQ3p+SgLMHJj4QR9igJi0YqE6g1x2iqSH6GH8ZP45dgP014xvK2vBsYA==} + /langchain@0.0.176(@aws-sdk/client-s3@3.438.0)(@upstash/redis@1.24.2)(mammoth@1.6.0)(pdf-parse@1.1.1)(playwright@1.39.0): + resolution: {integrity: sha512-yu5CYzrEK8aLiZE5wux1E2TDlX9HiMCJ/MupOAmbUU7VBaOGL/iaaqT+zQ2/BrRIUaiclqUZAV/My3ViJBehjQ==} engines: {node: '>=18'} peerDependencies: '@aws-crypto/sha256-js': ^5.0.0 @@ -5615,13 +5706,14 @@ packages: apify-client: ^2.7.1 assemblyai: ^2.0.2 axios: '*' - cassandra-driver: ^4.6.4 + cassandra-driver: ^4.7.2 cheerio: ^1.0.0-rc.12 chromadb: '*' closevector-common: 0.1.0-alpha.1 closevector-node: 0.1.0-alpha.10 closevector-web: 0.1.0-alpha.16 cohere-ai: '>=6.0.0' + convex: ^1.3.1 d3-dsv: ^2.0.0 epub2: ^3.0.1 faiss-node: ^0.5.1 @@ -5772,6 +5864,8 @@ packages: optional: true cohere-ai: optional: true + convex: + optional: true d3-dsv: optional: true epub2: @@ -5856,8 +5950,8 @@ packages: optional: true dependencies: '@anthropic-ai/sdk': 0.6.8 - '@aws-sdk/client-s3': 3.435.0 - '@upstash/redis': 1.23.4 + '@aws-sdk/client-s3': 3.438.0 + '@upstash/redis': 1.24.2 ansi-styles: 5.2.0 binary-extensions: 2.2.0 camelcase: 6.3.0 @@ -5868,7 +5962,7 @@ packages: js-yaml: 4.1.0 jsonpointer: 5.0.1 langchainhub: 0.0.6 - langsmith: 0.0.44 + langsmith: 0.0.45 mammoth: 1.6.0 ml-distance: 4.0.1 object-hash: 3.0.0 @@ -5890,8 +5984,8 @@ packages: resolution: {integrity: sha512-SW6105T+YP1cTe0yMf//7kyshCgvCTyFBMTgH2H3s9rTAR4e+78DA/BBrUL/Mt4Q5eMWui7iGuAYb3pgGsdQ9w==} dev: false - /langsmith@0.0.44: - resolution: {integrity: sha512-y0K3g6Lua7bvwxLB1Wn8kJR1LYp6cumRg8xX8TooLBmvK8srfv/tyCtlhZ+w1daOQmm1otVMKQ7CHJf83f9ryQ==} + /langsmith@0.0.45: + resolution: {integrity: sha512-G+Iwt6fQaSooTZZ4ailFvKyRAaFDeARtRCFOH+SR6dOLX5BU8W1W1yDnKvm+mHbE2hriz1tUR4ssJc5+nRtG3Q==} hasBin: true dependencies: '@types/uuid': 9.0.6 @@ -6048,7 +6142,7 @@ packages: devlop: 1.1.0 mdast-util-to-string: 4.0.0 micromark: 4.0.0 - micromark-util-decode-numeric-character-reference: 2.0.0 + micromark-util-decode-numeric-character-reference: 2.0.1 micromark-util-decode-string: 2.0.0 micromark-util-normalize-identifier: 2.0.0 micromark-util-symbol: 2.0.0 @@ -6333,8 +6427,8 @@ packages: micromark-util-types: 2.0.0 dev: false - /micromark-util-decode-numeric-character-reference@2.0.0: - resolution: {integrity: sha512-pIgcsGxpHEtTG/rPJRz/HOLSqp5VTuIIjXlPI+6JSDlK2oljApusG6KzpS8AF0ENUMCHlC/IBb5B9xdFiVlm5Q==} + /micromark-util-decode-numeric-character-reference@2.0.1: + resolution: {integrity: sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==} dependencies: micromark-util-symbol: 2.0.0 dev: false @@ -6344,7 +6438,7 @@ packages: dependencies: decode-named-character-reference: 1.0.2 micromark-util-character: 2.0.1 - micromark-util-decode-numeric-character-reference: 2.0.0 + micromark-util-decode-numeric-character-reference: 2.0.1 micromark-util-symbol: 2.0.0 dev: false @@ -6405,7 +6499,7 @@ packages: micromark-util-character: 2.0.1 micromark-util-chunked: 2.0.0 micromark-util-combine-extensions: 2.0.0 - micromark-util-decode-numeric-character-reference: 2.0.0 + micromark-util-decode-numeric-character-reference: 2.0.1 micromark-util-encode: 2.0.0 micromark-util-normalize-identifier: 2.0.0 micromark-util-resolve-all: 2.0.0 @@ -6512,10 +6606,10 @@ packages: resolution: {integrity: sha512-kbhcj2SVVR4caaVnGLJKmlk2+f+oLkjqdKeQlmUtz6nGzOpbcobwVIeSURNgraV/v3tlmGIX82OcPCl0K6RbHQ==} dev: false - /next-auth@4.24.3(next@13.5.6)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-n1EvmY7MwQMSOkCh6jhI6uBneB6VVtkYELVMEwVaCLD1mBD3IAAucwk+90kgxramW09nSp5drvynwfNCi1JjaQ==} + /next-auth@4.24.4(next@14.0.1)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-5DGffi+OpkbU62vPQIJ1z+hFnmow+ec5Qrn9m6eoglIO51m0DlrmLxBduZEwKAYDEg9k2joi1yelgmq1vqK3aQ==} peerDependencies: - next: ^12.2.5 || ^13 + next: ^12.2.5 || ^13 || ^14 nodemailer: ^6.6.5 react: ^17.0.2 || ^18 react-dom: ^17.0.2 || ^18 @@ -6527,7 +6621,7 @@ packages: '@panva/hkdf': 1.1.1 cookie: 0.5.0 jose: 4.15.4 - next: 13.5.6(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) + next: 14.0.1(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) oauth: 0.9.15 openid-client: 5.6.1 preact: 10.18.1 @@ -6537,9 +6631,9 @@ packages: uuid: 8.3.2 dev: false - /next@13.5.6(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-Y2wTcTbO4WwEsVb4A8VSnOsG1I9ok+h74q0ZdxkwM3EODqrs4pasq7O0iUxbcS9VtWMicG7f3+HAj0r1+NtKSw==} - engines: {node: '>=16.14.0'} + /next@14.0.1(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-s4YaLpE4b0gmb3ggtmpmV+wt+lPRuGtANzojMQ2+gmBpgX9w5fTbjsy6dXByBuENsdCX5pukZH/GxdFgO62+pA==} + engines: {node: '>=18.17.0'} hasBin: true peerDependencies: '@opentelemetry/api': ^1.1.0 @@ -6552,25 +6646,25 @@ packages: sass: optional: true dependencies: - '@next/env': 13.5.6 + '@next/env': 14.0.1 '@swc/helpers': 0.5.2 busboy: 1.6.0 - caniuse-lite: 1.0.30001554 + caniuse-lite: 1.0.30001558 postcss: 8.4.31 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) styled-jsx: 5.1.1(@babel/core@7.23.2)(react@18.2.0) watchpack: 2.4.0 optionalDependencies: - '@next/swc-darwin-arm64': 13.5.6 - '@next/swc-darwin-x64': 13.5.6 - '@next/swc-linux-arm64-gnu': 13.5.6 - '@next/swc-linux-arm64-musl': 13.5.6 - '@next/swc-linux-x64-gnu': 13.5.6 - '@next/swc-linux-x64-musl': 13.5.6 - '@next/swc-win32-arm64-msvc': 13.5.6 - '@next/swc-win32-ia32-msvc': 13.5.6 - '@next/swc-win32-x64-msvc': 13.5.6 + '@next/swc-darwin-arm64': 14.0.1 + '@next/swc-darwin-x64': 14.0.1 + '@next/swc-linux-arm64-gnu': 14.0.1 + '@next/swc-linux-arm64-musl': 14.0.1 + '@next/swc-linux-x64-gnu': 14.0.1 + '@next/swc-linux-x64-musl': 14.0.1 + '@next/swc-win32-arm64-msvc': 14.0.1 + '@next/swc-win32-ia32-msvc': 14.0.1 + '@next/swc-win32-x64-msvc': 14.0.1 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros @@ -6719,7 +6813,7 @@ packages: hasBin: true dependencies: '@types/node': 18.18.7 - '@types/node-fetch': 2.6.7 + '@types/node-fetch': 2.6.8 abort-controller: 3.0.0 agentkeepalive: 4.5.0 digest-fetch: 1.3.0 @@ -7143,8 +7237,8 @@ packages: once: 1.4.0 dev: false - /punycode@2.3.0: - resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} + /punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} /queue-microtask@1.2.3: @@ -7201,14 +7295,14 @@ packages: react: 18.2.0 dev: false - /react-markdown@9.0.0(@types/react@18.2.32)(react@18.2.0): + /react-markdown@9.0.0(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-v6yNf3AB8GfJ8lCpUvzxAXKxgsHpdmWPlcVRQ6Nocsezp255E/IDrF31kLQsPJeB/cKto/geUwjU36wH784FCA==} peerDependencies: '@types/react': '>=18' react: '>=18' dependencies: '@types/hast': 3.0.2 - '@types/react': 18.2.32 + '@types/react': 18.2.33 devlop: 1.1.0 hast-util-to-jsx-runtime: 2.2.0 html-url-attributes: 3.0.0 @@ -7217,7 +7311,7 @@ packages: react: 18.2.0 remark-parse: 11.0.0 remark-rehype: 11.0.0 - unified: 11.0.3 + unified: 11.0.4 unist-util-visit: 5.0.0 vfile: 6.0.1 transitivePeerDependencies: @@ -7346,7 +7440,7 @@ packages: micromark-extension-gfm: 3.0.0 remark-parse: 11.0.0 remark-stringify: 11.0.0 - unified: 11.0.3 + unified: 11.0.4 transitivePeerDependencies: - supports-color dev: false @@ -7357,7 +7451,7 @@ packages: '@types/mdast': 4.0.2 mdast-util-from-markdown: 2.0.0 micromark-util-types: 2.0.0 - unified: 11.0.3 + unified: 11.0.4 transitivePeerDependencies: - supports-color dev: false @@ -7368,7 +7462,7 @@ packages: '@types/hast': 3.0.2 '@types/mdast': 4.0.2 mdast-util-to-hast: 13.0.2 - unified: 11.0.3 + unified: 11.0.4 vfile: 6.0.1 dev: false @@ -7377,7 +7471,7 @@ packages: dependencies: '@types/mdast': 4.0.2 mdast-util-to-markdown: 2.1.0 - unified: 11.0.3 + unified: 11.0.4 dev: false /resolve-from@4.0.0: @@ -7736,7 +7830,7 @@ packages: fast-glob: 3.3.1 glob-parent: 6.0.2 is-glob: 4.0.3 - jiti: 1.20.0 + jiti: 1.21.0 lilconfig: 2.1.0 micromatch: 4.0.5 normalize-path: 3.0.0 @@ -7977,8 +8071,8 @@ packages: /undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - /unified@11.0.3: - resolution: {integrity: sha512-jlCV402P+YDcFcB2VcN/n8JasOddqIiaxv118wNBoZXEhOn+lYG7BR4Bfg2BwxvlK58dwbuH2w7GX2esAjL6Mg==} + /unified@11.0.4: + resolution: {integrity: sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==} dependencies: '@types/unist': 3.0.1 bail: 2.0.2 @@ -8040,7 +8134,7 @@ packages: /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: - punycode: 2.3.0 + punycode: 2.3.1 /url-parse-lax@3.0.0: resolution: {integrity: sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==} @@ -8108,8 +8202,8 @@ packages: graceful-fs: 4.2.11 dev: false - /weaviate-ts-client@1.5.0(graphql@16.8.1): - resolution: {integrity: sha512-xmaW3eyV6grkZ/nZ8P41+p1bUqEJPBm93SNYTiTXBxggH9gqUPHSVo1LxMArYBuZD06YwgGi4Ujf6WCW/1MRTg==} + /weaviate-ts-client@1.6.0(graphql@16.8.1): + resolution: {integrity: sha512-1We0l8/uw6r8xnPsY8nSne1+/Ntd6o2JFq5LODqb63ac9v4QWDpT8dyPSRriUhif+IZ2Ttusw+w38361z72eaw==} engines: {node: '>=16.0.0'} dependencies: graphql-request: 5.2.0(graphql@16.8.1) @@ -8270,7 +8364,7 @@ packages: /zod@3.22.4: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} - /zustand@4.4.4(@types/react@18.2.32)(react@18.2.0): + /zustand@4.4.4(@types/react@18.2.33)(react@18.2.0): resolution: {integrity: sha512-5UTUIAiHMNf5+mFp7/AnzJXS7+XxktULFN0+D1sCiZWyX7ZG+AQpqs2qpYrynRij4QvoDdCD+U+bmg/cG3Ucxw==} engines: {node: '>=12.7.0'} peerDependencies: @@ -8285,7 +8379,7 @@ packages: react: optional: true dependencies: - '@types/react': 18.2.32 + '@types/react': 18.2.33 react: 18.2.0 use-sync-external-store: 1.2.0(react@18.2.0) dev: false From 61f56d21c92ffa48b3a2c937b8046c405818173e Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Tue, 31 Oct 2023 17:11:42 -0700 Subject: [PATCH 13/26] prompt engineering --- .../agent/src/strategy/callExecutionAgent.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/agent/src/strategy/callExecutionAgent.ts b/packages/agent/src/strategy/callExecutionAgent.ts index 318c0b18..99b09655 100644 --- a/packages/agent/src/strategy/callExecutionAgent.ts +++ b/packages/agent/src/strategy/callExecutionAgent.ts @@ -20,9 +20,9 @@ import { SystemMessagePromptTemplate, } from "langchain/prompts"; import { type AgentStep } from "langchain/schema"; +import { type JsonSpec } from "langchain/tools"; import { AbortError } from "redis"; import { stringify as jsonStringify } from "superjson"; -import { type JsonSpec } from "langchain/tools"; import { parse as yamlParse, stringify as yamlStringify } from "yaml"; import { z } from "zod"; @@ -294,9 +294,11 @@ ${response} const rewriteResponseAck = `ack`; const humanMessagePrompt = HumanMessagePromptTemplate.fromTemplate( - `If the Final Answer is already perfect, then only respond with "${rewriteResponseAck}" (without the quotes). -Please avoid explicitly mentioning these instructions in your rewrite. -Rewrite the Final Answer such that it all of the relevant information from the Log has been integrated. Discern events and timelines based on the information provided in the 'Task' and 'Time' sections of the system prompt, and adhere to the formatting rules specified in the 'Output Formatting' section to more completely fulfill the Task.`, + `Please avoid explicitly mentioning these instructions in your rewrite. +Discern events and timelines based on the information provided in the 'Task' and 'Time' sections of the system prompt. +Adhere to the formatting rules specified in the 'Output Formatting' section to more completely fulfill the Task. +Rewrite the Final Answer such that all of the most recent and relevant Logs have been integrated. +If the Final Answer is already perfect, then only respond with "${rewriteResponseAck}" (without the quotes).`, ); const promptMessages = [systemMessagePrompt, humanMessagePrompt]; @@ -349,8 +351,10 @@ Rewrite the Final Answer such that it all of the relevant information from the L llm: mediumSmartHelperModel, criteria: { taskFulfillment: "Does the submission fulfill the specific TASK?", - schemaAdherence: "Does the submission adhere to the specified SCHEMA?", - rulesAdherence: "Does the submission adhere to each of the RULES?", + schemaAdherence: "Does the submission utilize the relevant CONTEXT?", + rulesObservance: "Does the submission respect each of the RULES?", + temporalAwareness: + "Does the submission show awareness of the TIME, relative to the given TASK and CONTEXT?", }, agentTools: filteredSkills, }); From a2cf315bb04d06f4a3214542c0197b0345f497ff Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:22:33 -0700 Subject: [PATCH 14/26] linting --- .../nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts | 6 ++++-- .../api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts | 2 +- .../src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts | 4 +++- apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts | 7 ++++++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts index bdaed412..6af0b220 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts @@ -22,6 +22,7 @@ export async function POST( if (!body.input) { return NextResponse.json({ message: "Input is required" }, { status: 400 }); } + const session = (await getServerSession(authOptions)) || null; const caller = appRouter.createCaller({ @@ -62,13 +63,14 @@ export async function GET( const exe = await caller.execution.byId({ id: taskId }); - if (!exe) { + if (!exe || !exe.goalId) { return NextResponse.json( { message: "Unable to find entity with the provided id" }, { status: 404 }, ); } - const goal = await caller.goal.byId(exe?.goalId); + + const goal = await caller.goal.byId(exe.goalId); // artifact_id: string; // agent_created: boolean; diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts index f4044894..6ab3c767 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts @@ -27,7 +27,7 @@ export async function GET( origin: req.nextUrl.origin, }); const goal = await caller.goal.byId(taskId); - if (!goal?.executions[0]?.id) { + if (!goal || !goal?.executions[0]?.id) { return NextResponse.json( { message: "Unable to find entity with the provided id" }, { status: 404 }, diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts index 429efc5d..a881afa5 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts @@ -34,12 +34,14 @@ export async function POST( // const goal = await caller.goal.byId(taskId); // const exe = await caller.execution.create({ goalId: taskId }); const exe = await caller.execution.byId({ id: taskId }); - if (!exe) { + + if (!exe || !exe.goalId) { return NextResponse.json( { message: "Unable to find entity with the provided id" }, { status: 404 }, ); } + return caller.execution.createPlan({ executionId: exe.id, goalId: taskId, diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts index 93aa216a..15fb3900 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts @@ -9,6 +9,11 @@ import { prisma, type DraftExecutionNode } from "@acme/db"; // POST /ap/v1/agent/tasks export async function POST(request: NextRequest) { const body = (await request.json()) as TaskRequestBody; + + if (!body.input) { + return Response.json({ message: "Input is required" }, { status: 400 }); + } + // create a goal and exe const session = (await getServerSession(authOptions)) || null; const caller = appRouter.createCaller({ @@ -65,7 +70,7 @@ export async function GET(request: NextRequest) { const tasks: Task[] = paginatedTasks.map((exe) => ({ task_id: exe.id, - input: exe.context, + input: exe.context || undefined, artifacts: [], })); From 745f2d36e2371a73612e604aab77ecc551c6e6b0 Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:40:00 -0700 Subject: [PATCH 15/26] linting --- apps/nextjs/lib/AgentProtocol/types.ts | 18 ++++++++++-------- .../api/ap/v1/agent/tasks/[taskId]/route.ts | 18 ++++++++++-------- .../tasks/[taskId]/steps/[stepId]/route.ts | 6 +++--- .../ap/v1/agent/tasks/[taskId]/steps/route.ts | 12 +++++++----- .../src/app/api/ap/v1/agent/tasks/route.ts | 2 +- packages/api/src/router/execution.ts | 6 +++--- 6 files changed, 34 insertions(+), 28 deletions(-) diff --git a/apps/nextjs/lib/AgentProtocol/types.ts b/apps/nextjs/lib/AgentProtocol/types.ts index 73e3be8a..d9ea1fe7 100644 --- a/apps/nextjs/lib/AgentProtocol/types.ts +++ b/apps/nextjs/lib/AgentProtocol/types.ts @@ -1,8 +1,10 @@ /** * Input parameters for the task. Any value is allowed. */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export type TaskInput = any; + +import { type JsonValue } from "~/features/WaggleDance/types/types"; + +export type TaskInput = JsonValue; /** * Artifact that the task has produced. Any value is allowed. */ @@ -16,13 +18,13 @@ export type Artifact = { /** * Input parameters for the task step. Any value is allowed. */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export type StepInput = any; + +export type StepInput = JsonValue; /** * Output that the task step has produced. Any value is allowed. */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export type StepOutput = any; + +export type StepOutput = JsonValue; export declare enum StepStatus { CREATED = "created", RUNNING = "running", @@ -102,7 +104,7 @@ export interface TaskRequestBody { * A function that handles a step in a task. * Returns a step result. */ -// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents + export type StepHandler = (input: StepInput | null) => Promise; /** * A function that handles a task. @@ -110,7 +112,7 @@ export type StepHandler = (input: StepInput | null) => Promise; */ export type TaskHandler = ( taskId: string, - // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents + input: TaskInput | null, ) => Promise; /** diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts index 6af0b220..11281418 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts @@ -1,4 +1,4 @@ -import { NextResponse, type NextRequest } from "next/server"; +import { type NextRequest } from "next/server"; import { type Task, type TaskRequestBody } from "lib/AgentProtocol/types"; import { getServerSession } from "next-auth"; @@ -10,9 +10,9 @@ import { prisma } from "@acme/db"; export async function POST( request: NextRequest, { params: { taskId } }: { params: { taskId: string } }, -) { +): Promise { if (!taskId) { - return NextResponse.json( + return Response.json( { message: "Unable to find entity with the provided id" }, { status: 404 }, ); @@ -20,7 +20,7 @@ export async function POST( const body = (await request.json()) as TaskRequestBody; if (!body.input) { - return NextResponse.json({ message: "Input is required" }, { status: 400 }); + return Response.json({ message: "Input is required" }, { status: 400 }); } const session = (await getServerSession(authOptions)) || null; @@ -32,14 +32,16 @@ export async function POST( }); // const goal = await caller.goal.byId(taskId); - const goal = await caller.goal.create({ prompt: body.input }); + const goal = await caller.goal.create({ prompt: body.input as string }); const exe = await caller.execution.create({ goalId: goal.id }); - return caller.execution.createPlan({ + const plan = await caller.execution.createPlan({ executionId: exe.id, goalId: taskId, goalPrompt: goal.prompt, creationProps: {}, }); + + return Response.json(plan, { status: 200 }); } // GET /ap/v1/agent/tasks/:taskId @@ -48,7 +50,7 @@ export async function GET( { params: { taskId } }: { params: { taskId: string } }, ) { if (!taskId) { - return NextResponse.json( + return Response.json( { message: "Unable to find entity with the provided id" }, { status: 404 }, ); @@ -64,7 +66,7 @@ export async function GET( const exe = await caller.execution.byId({ id: taskId }); if (!exe || !exe.goalId) { - return NextResponse.json( + return Response.json( { message: "Unable to find entity with the provided id" }, { status: 404 }, ); diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts index 6ab3c767..c771e093 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts @@ -1,4 +1,4 @@ -import { NextResponse, type NextRequest } from "next/server"; +import { type NextRequest } from "next/server"; import { getServerSession } from "next-auth"; import { appRouter } from "@acme/api"; @@ -13,7 +13,7 @@ export async function GET( }: { params: { taskId: string; stepId: string } }, ) { if (!taskId) { - return NextResponse.json( + return Response.json( { message: "Unable to find entity with the provided id" }, { status: 404 }, ); @@ -28,7 +28,7 @@ export async function GET( }); const goal = await caller.goal.byId(taskId); if (!goal || !goal?.executions[0]?.id) { - return NextResponse.json( + return Response.json( { message: "Unable to find entity with the provided id" }, { status: 404 }, ); diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts index a881afa5..e30cfb37 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts @@ -10,9 +10,9 @@ import { prisma } from "@acme/db"; export async function POST( request: NextRequest, { params: { taskId } }: { params: { taskId: string } }, -) { +): Promise { if (!taskId) { - return NextResponse.json( + return Response.json( { message: "Unable to find entity with the provided id" }, { status: 404 }, ); @@ -20,7 +20,7 @@ export async function POST( const body = (await request.json()) as StepRequestBody; if (!body.input) { - return NextResponse.json({ message: "Input is required" }, { status: 400 }); + return Response.json({ message: "Input is required" }, { status: 400 }); } const session = (await getServerSession(authOptions)) || null; @@ -42,12 +42,14 @@ export async function POST( ); } - return caller.execution.createPlan({ + const plan = await caller.execution.createPlan({ executionId: exe.id, goalId: taskId, - goalPrompt: body.input, + goalPrompt: body.input as string, creationProps: {}, }); + + return Response.json(plan, { status: 200 }); } // GET /ap/v1/agent/tasks/:taskId/steps diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts index 15fb3900..36953599 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts @@ -23,7 +23,7 @@ export async function POST(request: NextRequest) { }); const execution = await caller.execution.createForAgentProtocol({ - prompt: body.input, + prompt: body.input as string, }); const task: Task = { diff --git a/packages/api/src/router/execution.ts b/packages/api/src/router/execution.ts index d6c56a69..3a266b09 100644 --- a/packages/api/src/router/execution.ts +++ b/packages/api/src/router/execution.ts @@ -226,9 +226,9 @@ export const executionRouter = createTRPCRouter({ creationProps: z.custom(), }), ) - .mutation(({ ctx, input }) => { - const { goalPrompt, goalId, executionId, creationProps } = input; - const userId = ctx.session?.user.id; + .mutation(({ ctx, input: _input }) => { + // const { goalPrompt, goalId, executionId, creationProps } = input; + // const userId = ctx.session?.user.id; return getFetch()(`${ctx.origin}/api/agent/plan`, {}); }), From bd1d751dbda187d5769bfeadcbfd3143c6cb4cef Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Wed, 1 Nov 2023 11:00:50 -0700 Subject: [PATCH 16/26] remove conflicting route config --- apps/nextjs/src/app/api/ap/route.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/nextjs/src/app/api/ap/route.ts b/apps/nextjs/src/app/api/ap/route.ts index ce886f29..c99f9366 100644 --- a/apps/nextjs/src/app/api/ap/route.ts +++ b/apps/nextjs/src/app/api/ap/route.ts @@ -2,7 +2,6 @@ import { type NextRequest } from "next/server"; import AgentProtocolOpenAPISpec from "~/../lib/AgentProtocol/openapi.json"; -export const runtime = "edge"; export const dynamic = "force-static"; export function GET(req: NextRequest) { From 36daad5d0f53c5bdee414b68530936a2fbd72951 Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Wed, 1 Nov 2023 12:20:27 -0700 Subject: [PATCH 17/26] add @vercel/blob --- apps/nextjs/package.json | 1 + pnpm-lock.yaml | 495 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 496 insertions(+) diff --git a/apps/nextjs/package.json b/apps/nextjs/package.json index 3d40a69d..fe955eac 100644 --- a/apps/nextjs/package.json +++ b/apps/nextjs/package.json @@ -35,6 +35,7 @@ "@trpc/server": "^10.43.0", "@upstash/redis": "^1.24.2", "@vercel/analytics": "^1.1.1", + "@vercel/blob": "^0.14.1", "@vercel/edge-config": "^0.4.1", "crypto-js": "^4.2.0", "eventsource-parser": "^1.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c12f208c..02d0b289 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -107,6 +107,9 @@ importers: '@vercel/analytics': specifier: ^1.1.1 version: 1.1.1 + '@vercel/blob': + specifier: ^0.14.1 + version: 0.14.1 '@vercel/edge-config': specifier: ^0.4.1 version: 0.4.1 @@ -1439,6 +1442,11 @@ packages: resolution: {integrity: sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@fastify/busboy@2.0.0: + resolution: {integrity: sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==} + engines: {node: '>=14'} + dev: false + /@floating-ui/core@1.5.0: resolution: {integrity: sha512-kK1h4m36DQ0UHGj5Ah4db7R0rHemTqqO0QLvUqi1/mUUp3LuAWbWxdxSIf/XsnH9VS6rRVPLJCncjRzUvyCLXg==} dependencies: @@ -1516,6 +1524,47 @@ packages: - supports-color dev: false + /@jest/environment@29.7.0: + resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.8.9 + jest-mock: 29.7.0 + dev: false + + /@jest/fake-timers@29.7.0: + resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.6.3 + '@sinonjs/fake-timers': 10.3.0 + '@types/node': 20.8.9 + jest-message-util: 29.7.0 + jest-mock: 29.7.0 + jest-util: 29.7.0 + dev: false + + /@jest/schemas@29.6.3: + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@sinclair/typebox': 0.27.8 + dev: false + + /@jest/types@29.6.3: + resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.6.3 + '@types/istanbul-lib-coverage': 2.0.5 + '@types/istanbul-reports': 3.0.3 + '@types/node': 20.8.9 + '@types/yargs': 17.0.29 + chalk: 4.1.2 + dev: false + /@jridgewell/gen-mapping@0.3.3: resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} engines: {node: '>=6.0.0'} @@ -2321,11 +2370,27 @@ packages: resolution: {integrity: sha512-6i/8UoL0P5y4leBIGzvkZdS85RDMG9y1ihZzmTZQ5LdHUYmZ7pKFoj8X0236s3lusPs1Fa5HTQUpwI+UfTcmeA==} dev: false + /@sinclair/typebox@0.27.8: + resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + dev: false + /@sindresorhus/is@0.14.0: resolution: {integrity: sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==} engines: {node: '>=6'} dev: false + /@sinonjs/commons@3.0.0: + resolution: {integrity: sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==} + dependencies: + type-detect: 4.0.8 + dev: false + + /@sinonjs/fake-timers@10.3.0: + resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} + dependencies: + '@sinonjs/commons': 3.0.0 + dev: false + /@smithy/abort-controller@2.0.12: resolution: {integrity: sha512-YIJyefe1mi3GxKdZxEBEuzYOeQ9xpYfqnFmWzojCssRAuR7ycxwpoRQgp965vuW426xUAQhCV5rCaWElQ7XsaA==} engines: {node: '>=14.0.0'} @@ -2826,6 +2891,11 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false + /@tootallnate/once@2.0.0: + resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} + engines: {node: '>= 10'} + dev: false + /@trpc/client@10.43.0(@trpc/server@10.43.0): resolution: {integrity: sha512-8LbSpPHmIseb/Ke+GzL45y0itkKunGQWfxqHf2uy69RSRvER0vj+Gu67L8YD86FBgc/nsX/6GBuJiUet5lIDIw==} peerDependencies: @@ -3116,6 +3186,30 @@ packages: '@types/unist': 3.0.1 dev: false + /@types/istanbul-lib-coverage@2.0.5: + resolution: {integrity: sha512-zONci81DZYCZjiLe0r6equvZut0b+dBRPBN5kBDjsONnutYNtJMoWQ9uR2RkL1gLG9NMTzvf+29e5RFfPbeKhQ==} + dev: false + + /@types/istanbul-lib-report@3.0.2: + resolution: {integrity: sha512-8toY6FgdltSdONav1XtUHl4LN1yTmLza+EuDazb/fEmRNCwjyqNVIQWs2IfC74IqjHkREs/nQ2FWq5kZU9IC0w==} + dependencies: + '@types/istanbul-lib-coverage': 2.0.5 + dev: false + + /@types/istanbul-reports@3.0.3: + resolution: {integrity: sha512-1nESsePMBlf0RPRffLZi5ujYh7IH1BWL4y9pr+Bn3cJBdxz+RTP8bUFljLz9HvzhhOSWKdyBZ4DIivdL6rvgZg==} + dependencies: + '@types/istanbul-lib-report': 3.0.2 + dev: false + + /@types/jsdom@20.0.1: + resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==} + dependencies: + '@types/node': 20.8.9 + '@types/tough-cookie': 4.0.4 + parse5: 7.1.2 + dev: false + /@types/json-schema@7.0.14: resolution: {integrity: sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==} dev: false @@ -3203,6 +3297,14 @@ packages: resolution: {integrity: sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==} dev: false + /@types/stack-utils@2.0.2: + resolution: {integrity: sha512-g7CK9nHdwjK2n0ymT2CW698FuWJRIx+RP6embAzZ2Qi8/ilIrA1Imt2LVSeHUzKvpoi7BhmmQcXz95eS0f2JXw==} + dev: false + + /@types/tough-cookie@4.0.4: + resolution: {integrity: sha512-95Sfz4nvMAb0Nl9DTxN3j64adfwfbBPEYq14VN7zT5J5O2M9V6iZMIIQU1U+pJyl9agHYHNCqhCXgyEtIRRa5A==} + dev: false + /@types/unist@3.0.1: resolution: {integrity: sha512-ue/hDUpPjC85m+PM9OQDMZr3LywT+CT6mPsQq8OJtCLiERkGRcQUFvu9XASF5XWqyZFXbf15lvb3JFJ4dRLWPg==} dev: false @@ -3210,6 +3312,16 @@ packages: /@types/uuid@9.0.6: resolution: {integrity: sha512-BT2Krtx4xaO6iwzwMFUYvWBWkV2pr37zD68Vmp1CDV196MzczBRxuEpD6Pr395HAgebC/co7hOphs53r8V7jew==} + /@types/yargs-parser@21.0.2: + resolution: {integrity: sha512-5qcvofLPbfjmBfKaLfj/+f+Sbd6pN4zl7w7VSVI5uz7m9QZTuB2aZAa2uo1wHFBNN2x6g/SoTkXmd8mQnQF2Cw==} + dev: false + + /@types/yargs@17.0.29: + resolution: {integrity: sha512-nacjqA3ee9zRF/++a3FUY1suHTFKZeHba2n8WeDw9cCVdmzmHpIxyzOJBcpHvvEmS8E9KqWlSnWHUkOrkhWcvA==} + dependencies: + '@types/yargs-parser': 21.0.2 + dev: false + /@typescript-eslint/eslint-plugin@6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.52.0)(typescript@5.2.2): resolution: {integrity: sha512-w0tiiRc9I4S5XSXXrMHOWgHgxbrBn1Ro+PmiYhSg2ZVdxrAJtQgzU5o2m1BfP6UOn7Vxcc6152vFjQfmZR4xEg==} engines: {node: ^16.0.0 || >=18.0.0} @@ -3365,6 +3477,19 @@ packages: server-only: 0.0.1 dev: false + /@vercel/blob@0.14.1: + resolution: {integrity: sha512-pGdEbzZ6wKJf5tknzeHP6bpDAmWvJQc9IsT2fvmI2hSLG/ir0hLt0ABcYv7W1aMHnSo4VQlcjucKOPMsaePmBg==} + engines: {node: '>=16.14'} + dependencies: + jest-environment-jsdom: 29.7.0 + undici: 5.26.4 + transitivePeerDependencies: + - bufferutil + - canvas + - supports-color + - utf-8-validate + dev: false + /@vercel/edge-config-fs@0.1.0: resolution: {integrity: sha512-NRIBwfcS0bUoUbRWlNGetqjvLSwgYH/BqKqDN7vK1g32p7dN96k0712COgaz6VFizAm9b0g6IG6hR6+hc0KCPg==} dev: false @@ -3390,6 +3515,10 @@ packages: engines: {node: '>=10.0.0'} dev: false + /abab@2.0.6: + resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==} + dev: false + /abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -3402,6 +3531,13 @@ packages: engines: {node: '>=12'} dev: false + /acorn-globals@7.0.1: + resolution: {integrity: sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==} + dependencies: + acorn: 8.11.2 + acorn-walk: 8.3.0 + dev: false + /acorn-jsx@5.3.2(acorn@8.11.2): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -3409,11 +3545,25 @@ packages: dependencies: acorn: 8.11.2 + /acorn-walk@8.3.0: + resolution: {integrity: sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA==} + engines: {node: '>=0.4.0'} + dev: false + /acorn@8.11.2: resolution: {integrity: sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==} engines: {node: '>=0.4.0'} hasBin: true + /agent-base@6.0.2: + resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} + engines: {node: '>= 6.0.0'} + dependencies: + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + /agentkeepalive@4.5.0: resolution: {integrity: sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==} engines: {node: '>= 8.0.0'} @@ -3812,6 +3962,11 @@ packages: fsevents: 2.3.3 dev: true + /ci-info@3.9.0: + resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} + engines: {node: '>=8'} + dev: false + /client-only@0.0.1: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} dev: false @@ -3967,6 +4122,21 @@ packages: hasBin: true dev: true + /cssom@0.3.8: + resolution: {integrity: sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==} + dev: false + + /cssom@0.5.0: + resolution: {integrity: sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==} + dev: false + + /cssstyle@2.3.0: + resolution: {integrity: sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==} + engines: {node: '>=8'} + dependencies: + cssom: 0.3.8 + dev: false + /csstype@3.1.2: resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} @@ -4108,6 +4278,15 @@ packages: resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==} dev: false + /data-urls@3.0.2: + resolution: {integrity: sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==} + engines: {node: '>=12'} + dependencies: + abab: 2.0.6 + whatwg-mimetype: 3.0.0 + whatwg-url: 11.0.0 + dev: false + /debug@3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} peerDependencies: @@ -4135,6 +4314,10 @@ packages: engines: {node: '>=0.10.0'} dev: false + /decimal.js@10.4.3: + resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} + dev: false + /decode-named-character-reference@1.0.2: resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==} dependencies: @@ -4264,6 +4447,13 @@ packages: resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} dev: false + /domexception@4.0.0: + resolution: {integrity: sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==} + engines: {node: '>=12'} + dependencies: + webidl-conversions: 7.0.0 + dev: false + /domhandler@5.0.3: resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==} engines: {node: '>= 4'} @@ -4443,6 +4633,11 @@ packages: engines: {node: '>=0.8.0'} dev: false + /escape-string-regexp@2.0.0: + resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} + engines: {node: '>=8'} + dev: false + /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} @@ -4452,6 +4647,18 @@ packages: engines: {node: '>=12'} dev: false + /escodegen@2.1.0: + resolution: {integrity: sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==} + engines: {node: '>=6.0'} + hasBin: true + dependencies: + esprima: 4.0.1 + estraverse: 5.3.0 + esutils: 2.0.3 + optionalDependencies: + source-map: 0.6.1 + dev: false + /eslint-config-next@14.0.1(eslint@8.52.0)(typescript@5.2.2): resolution: {integrity: sha512-QfIFK2WD39H4WOespjgf6PLv9Bpsd7KGGelCtmq4l67nGvnlsGpuvj0hIT+aIy6p5gKH+lAChYILsyDlxP52yg==} peerDependencies: @@ -5238,6 +5445,13 @@ packages: react-is: 16.13.1 dev: false + /html-encoding-sniffer@3.0.0: + resolution: {integrity: sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==} + engines: {node: '>=12'} + dependencies: + whatwg-encoding: 2.0.0 + dev: false + /html-url-attributes@3.0.0: resolution: {integrity: sha512-/sXbVCWayk6GDVg3ctOX6nxaVj7So40FcFAnWlWGNAB1LpYKcV5Cd10APjPjW80O7zYW2MsjBV4zZ7IZO5fVow==} dev: false @@ -5255,12 +5469,40 @@ packages: resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} dev: false + /http-proxy-agent@5.0.0: + resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} + engines: {node: '>= 6'} + dependencies: + '@tootallnate/once': 2.0.0 + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + + /https-proxy-agent@5.0.1: + resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} + engines: {node: '>= 6'} + dependencies: + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + /humanize-ms@1.2.1: resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} dependencies: ms: 2.1.3 dev: false + /iconv-lite@0.6.3: + resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: false + /ignore@5.2.4: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'} @@ -5433,6 +5675,10 @@ packages: engines: {node: '>=12'} dev: false + /is-potential-custom-element-name@1.0.1: + resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} + dev: false + /is-regex@1.1.4: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} @@ -5529,6 +5775,65 @@ packages: engines: {node: '>=12'} dev: false + /jest-environment-jsdom@29.7.0: + resolution: {integrity: sha512-k9iQbsf9OyOfdzWH8HDmrRT0gSIcX+FLNW7IQq94tFX0gynPwqDTW0Ho6iMVNjGz/nb+l/vW3dWM2bbLLpkbXA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + canvas: ^2.5.0 + peerDependenciesMeta: + canvas: + optional: true + dependencies: + '@jest/environment': 29.7.0 + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 + '@types/jsdom': 20.0.1 + '@types/node': 20.8.9 + jest-mock: 29.7.0 + jest-util: 29.7.0 + jsdom: 20.0.3 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: false + + /jest-message-util@29.7.0: + resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/code-frame': 7.22.13 + '@jest/types': 29.6.3 + '@types/stack-utils': 2.0.2 + chalk: 4.1.2 + graceful-fs: 4.2.11 + micromatch: 4.0.5 + pretty-format: 29.7.0 + slash: 3.0.0 + stack-utils: 2.0.6 + dev: false + + /jest-mock@29.7.0: + resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.6.3 + '@types/node': 20.8.9 + jest-util: 29.7.0 + dev: false + + /jest-util@29.7.0: + resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.6.3 + '@types/node': 20.8.9 + chalk: 4.1.2 + ci-info: 3.9.0 + graceful-fs: 4.2.11 + picomatch: 2.3.1 + dev: false + /jiti@1.21.0: resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} hasBin: true @@ -5566,6 +5871,47 @@ packages: dependencies: argparse: 2.0.1 + /jsdom@20.0.3: + resolution: {integrity: sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==} + engines: {node: '>=14'} + peerDependencies: + canvas: ^2.5.0 + peerDependenciesMeta: + canvas: + optional: true + dependencies: + abab: 2.0.6 + acorn: 8.11.2 + acorn-globals: 7.0.1 + cssom: 0.5.0 + cssstyle: 2.3.0 + data-urls: 3.0.2 + decimal.js: 10.4.3 + domexception: 4.0.0 + escodegen: 2.1.0 + form-data: 4.0.0 + html-encoding-sniffer: 3.0.0 + http-proxy-agent: 5.0.0 + https-proxy-agent: 5.0.1 + is-potential-custom-element-name: 1.0.1 + nwsapi: 2.2.7 + parse5: 7.1.2 + saxes: 6.0.0 + symbol-tree: 3.2.4 + tough-cookie: 4.1.3 + w3c-xmlserializer: 4.0.0 + webidl-conversions: 7.0.0 + whatwg-encoding: 2.0.0 + whatwg-mimetype: 3.0.0 + whatwg-url: 11.0.0 + ws: 8.14.2 + xml-name-validator: 4.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: false + /jsesc@2.5.2: resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} engines: {node: '>=4'} @@ -6719,6 +7065,10 @@ packages: engines: {node: '>=8'} dev: false + /nwsapi@2.2.7: + resolution: {integrity: sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==} + dev: false + /oauth@0.9.15: resolution: {integrity: sha512-a5ERWK1kh38ExDEfoO6qUHJb32rd7aYmPHuyCu3Fta/cnICvYmgd2uhuKXvPD+PXB+gCEYYEaQdIRAjCOwAKNA==} dev: false @@ -7194,6 +7544,15 @@ packages: hasBin: true dev: false + /pretty-format@29.7.0: + resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.6.3 + ansi-styles: 5.2.0 + react-is: 18.2.0 + dev: false + /pretty-format@3.8.0: resolution: {integrity: sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==} dev: false @@ -7230,6 +7589,10 @@ packages: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} dev: false + /psl@1.9.0: + resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} + dev: false + /pump@3.0.0: resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} dependencies: @@ -7241,6 +7604,10 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + /querystringify@2.2.0: + resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} + dev: false + /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -7474,6 +7841,10 @@ packages: unified: 11.0.4 dev: false + /requires-port@1.0.0: + resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} + dev: false + /resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -7547,6 +7918,17 @@ packages: is-regex: 1.1.4 dev: false + /safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + dev: false + + /saxes@6.0.0: + resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} + engines: {node: '>=v12.22.7'} + dependencies: + xmlchars: 2.2.0 + dev: false + /scheduler@0.23.0: resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} dependencies: @@ -7652,6 +8034,13 @@ packages: engines: {node: '>=0.10.0'} dev: false + /source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + requiresBuild: true + dev: false + optional: true + /space-separated-tokens@2.0.2: resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} dev: false @@ -7667,6 +8056,13 @@ packages: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} dev: false + /stack-utils@2.0.6: + resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} + engines: {node: '>=10'} + dependencies: + escape-string-regexp: 2.0.0 + dev: false + /streamsearch@1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} @@ -7817,6 +8213,10 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false + /symbol-tree@3.2.4: + resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} + dev: false + /tailwindcss@3.3.5: resolution: {integrity: sha512-5SEZU4J7pxZgSkv7FP1zY8i2TIAOooNZ1e/OGtxIEv6GltpoiXUqWvLy89+a10qYTB1N5Ifkuw9lqQkN9sscvA==} engines: {node: '>=14.0.0'} @@ -7893,10 +8293,27 @@ packages: dependencies: is-number: 7.0.0 + /tough-cookie@4.1.3: + resolution: {integrity: sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==} + engines: {node: '>=6'} + dependencies: + psl: 1.9.0 + punycode: 2.3.1 + universalify: 0.2.0 + url-parse: 1.5.10 + dev: false + /tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} dev: false + /tr46@3.0.0: + resolution: {integrity: sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==} + engines: {node: '>=12'} + dependencies: + punycode: 2.3.1 + dev: false + /trim-lines@3.0.1: resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==} dev: false @@ -8008,6 +8425,11 @@ packages: dependencies: prelude-ls: 1.2.1 + /type-detect@4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} + dev: false + /type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} @@ -8071,6 +8493,13 @@ packages: /undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + /undici@5.26.4: + resolution: {integrity: sha512-OG+QOf0fTLtazL9P9X7yqWxQ+Z0395Wk6DSkyTxtaq3wQEjIroVe7Y4asCX/vcCxYpNGMnwz8F0qbRYUoaQVMw==} + engines: {node: '>=14.0'} + dependencies: + '@fastify/busboy': 2.0.0 + dev: false + /unified@11.0.4: resolution: {integrity: sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==} dependencies: @@ -8121,6 +8550,11 @@ packages: engines: {node: '>= 4.0.0'} dev: false + /universalify@0.2.0: + resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} + engines: {node: '>= 4.0.0'} + dev: false + /update-browserslist-db@1.0.13(browserslist@4.22.1): resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} hasBin: true @@ -8143,6 +8577,13 @@ packages: prepend-http: 2.0.0 dev: false + /url-parse@1.5.10: + resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==} + dependencies: + querystringify: 2.2.0 + requires-port: 1.0.0 + dev: false + /use-debounce@9.0.4(react@18.2.0): resolution: {integrity: sha512-6X8H/mikbrt0XE8e+JXRtZ8yYVvKkdYRfmIhWZYsP8rcNs9hk3APV8Ua2mFkKRLcJKVdnX2/Vwrmg2GWKUQEaQ==} engines: {node: '>= 10.0.0'} @@ -8194,6 +8635,13 @@ packages: vfile-message: 4.0.2 dev: false + /w3c-xmlserializer@4.0.0: + resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==} + engines: {node: '>=14'} + dependencies: + xml-name-validator: 4.0.0 + dev: false + /watchpack@2.4.0: resolution: {integrity: sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==} engines: {node: '>=10.13.0'} @@ -8228,10 +8676,35 @@ packages: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} dev: false + /webidl-conversions@7.0.0: + resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} + engines: {node: '>=12'} + dev: false + + /whatwg-encoding@2.0.0: + resolution: {integrity: sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==} + engines: {node: '>=12'} + dependencies: + iconv-lite: 0.6.3 + dev: false + /whatwg-fetch@3.6.19: resolution: {integrity: sha512-d67JP4dHSbm2TrpFj8AbO8DnL1JXL5J9u0Kq2xW6d0TFDbCA3Muhdt8orXC22utleTVj7Prqt82baN6RBvnEgw==} dev: false + /whatwg-mimetype@3.0.0: + resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} + engines: {node: '>=12'} + dev: false + + /whatwg-url@11.0.0: + resolution: {integrity: sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==} + engines: {node: '>=12'} + dependencies: + tr46: 3.0.0 + webidl-conversions: 7.0.0 + dev: false + /whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} dependencies: @@ -8304,11 +8777,33 @@ packages: /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + /ws@8.14.2: + resolution: {integrity: sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: false + + /xml-name-validator@4.0.0: + resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} + engines: {node: '>=12'} + dev: false + /xmlbuilder@10.1.1: resolution: {integrity: sha512-OyzrcFLL/nb6fMGHbiRDuPup9ljBycsdCypwuyg5AAHvyWzGfChJpCXMG88AGTIMFhGZ9RccFN1e6lhg3hkwKg==} engines: {node: '>=4.0'} dev: false + /xmlchars@2.2.0: + resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} + dev: false + /yallist@2.1.2: resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} dev: false From 9dcf684e5ee0aca98ef361bbaae481984892b9a2 Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Wed, 1 Nov 2023 12:41:35 -0700 Subject: [PATCH 18/26] copy blob starter --- apps/nextjs/src/app/api/upload/route.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 apps/nextjs/src/app/api/upload/route.ts diff --git a/apps/nextjs/src/app/api/upload/route.ts b/apps/nextjs/src/app/api/upload/route.ts new file mode 100644 index 00000000..933e2134 --- /dev/null +++ b/apps/nextjs/src/app/api/upload/route.ts @@ -0,0 +1,22 @@ +import { NextResponse } from "next/server"; +import { put } from "@vercel/blob"; +import { customAlphabet } from "nanoid"; + +export const runtime = "edge"; + +const nanoid = customAlphabet( + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", + 7, +); // 7-character random string +export async function POST(req: Request) { + const file = req.body || ""; + const contentType = req.headers.get("content-type") || "text/plain"; + const filename = `${nanoid()}.${contentType.split("/")[1]}`; + const blob = await put(filename, file, { + contentType, + access: "public", + addRandomSuffix: true, + }); + + return NextResponse.json(blob); +} From 6ef80b60e2dfa45dec726c31d88fed6e303703cc Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Wed, 1 Nov 2023 15:54:49 -0700 Subject: [PATCH 19/26] add blob storage config --- .env.example | 6 +++++- apps/nextjs/src/env.mjs | 2 ++ turbo.json | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 7d8e667f..aa8748c9 100644 --- a/.env.example +++ b/.env.example @@ -109,4 +109,8 @@ POSTGRES_URL_NON_POOLING= # # see: https://js.langchain.com/docs/guides/evaluation/trajectory/ # # may be a value from 0 to 1, to set the minimum evaluation score, or false # # defaults to false -# EXE_TRAJECTORY_EVALUATION=false \ No newline at end of file +# EXE_TRAJECTORY_EVALUATION=false + +# # Required: upload Artifacts to blob storage +# see: https://vercel.com/docs/storage/vercel-blob +BLOB_READ_WRITE_TOKEN= \ No newline at end of file diff --git a/apps/nextjs/src/env.mjs b/apps/nextjs/src/env.mjs index 19e162fa..aacd22a0 100644 --- a/apps/nextjs/src/env.mjs +++ b/apps/nextjs/src/env.mjs @@ -85,6 +85,7 @@ export const env = createEnv({ .optional(), POSTGRES_PRISMA_URL: z.string().url(), POSTGRES_URL_NON_POOLING: z.string().url(), + BLOB_READ_WRITE_TOKEN: z.string().min(1).startsWith("vercel_blob_rw_"), }, /** * Specify your client-side environment variables schema here. @@ -168,5 +169,6 @@ export const env = createEnv({ POSTGRES_PRISMA_URL: process.env.POSTGRES_PRISMA_URL, POSTGRES_URL_NON_POOLING: process.env.POSTGRES_URL_NON_POOLING, NEXT_PUBLIC_HIDE_LLM: process.env.NEXT_PUBLIC_HIDE_LLM, + BLOB_READ_WRITE_TOKEN: process.env.BLOB_READ_WRITE_TOKEN, }, }); diff --git a/turbo.json b/turbo.json index e8706932..c4d7503e 100644 --- a/turbo.json +++ b/turbo.json @@ -85,6 +85,7 @@ "EXE_TRAJECTORY_EVALUATION", "POSTGRES_PRISMA_URL", "POSTGRES_URL_NON_POOLING", - "NEXT_PUBLIC_HIDE_LLM" + "NEXT_PUBLIC_HIDE_LLM", + "BLOB_READ_WRITE_TOKEN" ] } From 63055ef8a85a74e6c5401995ee13de42416224fd Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Wed, 1 Nov 2023 16:04:22 -0700 Subject: [PATCH 20/26] add initial migration --- .../20231101230326_11_1_23/migration.sql | 330 ++++++++++++++++++ .../db/prisma/migrations/migration_lock.toml | 3 + 2 files changed, 333 insertions(+) create mode 100644 packages/db/prisma/migrations/20231101230326_11_1_23/migration.sql create mode 100644 packages/db/prisma/migrations/migration_lock.toml diff --git a/packages/db/prisma/migrations/20231101230326_11_1_23/migration.sql b/packages/db/prisma/migrations/20231101230326_11_1_23/migration.sql new file mode 100644 index 00000000..d38ff5e0 --- /dev/null +++ b/packages/db/prisma/migrations/20231101230326_11_1_23/migration.sql @@ -0,0 +1,330 @@ +-- CreateEnum +CREATE TYPE "ExecutionState" AS ENUM ('EXECUTING', 'DONE', 'ERROR', 'CANCELLED'); + +-- CreateTable +CREATE TABLE "Account" ( + "id" TEXT NOT NULL, + "userId" TEXT NOT NULL, + "type" TEXT NOT NULL, + "provider" TEXT NOT NULL, + "providerAccountId" TEXT NOT NULL, + "refresh_token" TEXT, + "access_token" TEXT, + "expires_at" INTEGER, + "token_type" TEXT, + "scope" TEXT, + "id_token" TEXT, + "session_state" TEXT, + + CONSTRAINT "Account_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Session" ( + "id" TEXT NOT NULL, + "sessionToken" TEXT NOT NULL, + "userId" TEXT NOT NULL, + "expires" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Session_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "User" ( + "id" TEXT NOT NULL, + "name" TEXT, + "email" TEXT NOT NULL, + "emailVerified" TIMESTAMP(3), + "image" TEXT, + + CONSTRAINT "User_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "VerificationToken" ( + "identifier" TEXT NOT NULL, + "token" TEXT NOT NULL, + "expires" TIMESTAMP(3) NOT NULL +); + +-- CreateTable +CREATE TABLE "Goal" ( + "id" TEXT NOT NULL, + "prompt" TEXT NOT NULL, + "userId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "Goal_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Execution" ( + "id" TEXT NOT NULL, + "goalId" TEXT NOT NULL, + "userId" TEXT NOT NULL, + "state" "ExecutionState" NOT NULL DEFAULT 'EXECUTING', + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "Execution_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ExecutionGraph" ( + "id" TEXT NOT NULL, + "executionId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "ExecutionGraph_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ExecutionNode" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "context" TEXT, + "graphId" TEXT, + + CONSTRAINT "ExecutionNode_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ExecutionEdge" ( + "id" TEXT NOT NULL, + "sId" TEXT NOT NULL, + "tId" TEXT NOT NULL, + "graphId" TEXT NOT NULL, + + CONSTRAINT "ExecutionEdge_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Result" ( + "id" TEXT NOT NULL, + "goalId" TEXT NOT NULL, + "executionId" TEXT NOT NULL, + "value" JSONB NOT NULL, + "packets" JSONB[], + "packetVersion" INTEGER NOT NULL, + "nodeId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "Result_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "UserSkillset" ( + "id" TEXT NOT NULL, + "skillsetId" TEXT NOT NULL, + "userId" TEXT NOT NULL, + + CONSTRAINT "UserSkillset_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "GoalSkillset" ( + "id" TEXT NOT NULL, + "skillsetId" TEXT NOT NULL, + "goalId" TEXT NOT NULL, + + CONSTRAINT "GoalSkillset_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ExecutionSkillset" ( + "id" TEXT NOT NULL, + "skillsetId" TEXT NOT NULL, + "executionId" TEXT NOT NULL, + + CONSTRAINT "ExecutionSkillset_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "SkillConfiguration" ( + "id" TEXT NOT NULL, + "userSkillsetId" TEXT, + "goalSkillsetId" TEXT, + "executionSkillsetId" TEXT, + "value" JSONB, + "version" INTEGER NOT NULL, + + CONSTRAINT "SkillConfiguration_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Skillset" ( + "id" TEXT NOT NULL, + "label" TEXT NOT NULL, + "description" TEXT NOT NULL, + "isRecommended" BOOLEAN NOT NULL, + "index" INTEGER NOT NULL, + + CONSTRAINT "Skillset_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Skill" ( + "id" TEXT NOT NULL, + "label" TEXT NOT NULL, + "description" TEXT NOT NULL, + "risk" TEXT NOT NULL, + "skillsetId" TEXT NOT NULL, + + CONSTRAINT "Skill_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "UserSkill" ( + "id" TEXT NOT NULL, + "skillId" TEXT NOT NULL, + "userId" TEXT NOT NULL, + + CONSTRAINT "UserSkill_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "GoalSkill" ( + "id" TEXT NOT NULL, + "skillId" TEXT NOT NULL, + "goalId" TEXT NOT NULL, + + CONSTRAINT "GoalSkill_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ExecutionSkill" ( + "id" TEXT NOT NULL, + "skillId" TEXT NOT NULL, + "executionId" TEXT NOT NULL, + + CONSTRAINT "ExecutionSkill_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "Account_provider_providerAccountId_key" ON "Account"("provider", "providerAccountId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Session_sessionToken_key" ON "Session"("sessionToken"); + +-- CreateIndex +CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); + +-- CreateIndex +CREATE UNIQUE INDEX "VerificationToken_token_key" ON "VerificationToken"("token"); + +-- CreateIndex +CREATE UNIQUE INDEX "VerificationToken_identifier_token_key" ON "VerificationToken"("identifier", "token"); + +-- CreateIndex +CREATE UNIQUE INDEX "ExecutionGraph_executionId_key" ON "ExecutionGraph"("executionId"); + +-- CreateIndex +CREATE UNIQUE INDEX "UserSkillset_userId_skillsetId_key" ON "UserSkillset"("userId", "skillsetId"); + +-- CreateIndex +CREATE UNIQUE INDEX "GoalSkillset_goalId_skillsetId_key" ON "GoalSkillset"("goalId", "skillsetId"); + +-- CreateIndex +CREATE UNIQUE INDEX "ExecutionSkillset_executionId_skillsetId_key" ON "ExecutionSkillset"("executionId", "skillsetId"); + +-- CreateIndex +CREATE INDEX "user_skillset_config_index" ON "SkillConfiguration"("userSkillsetId"); + +-- CreateIndex +CREATE INDEX "goal_skillset_config_index" ON "SkillConfiguration"("goalSkillsetId"); + +-- CreateIndex +CREATE INDEX "execution_skillset_config_index" ON "SkillConfiguration"("executionSkillsetId"); + +-- CreateIndex +CREATE UNIQUE INDEX "UserSkill_userId_skillId_key" ON "UserSkill"("userId", "skillId"); + +-- CreateIndex +CREATE UNIQUE INDEX "GoalSkill_goalId_skillId_key" ON "GoalSkill"("goalId", "skillId"); + +-- CreateIndex +CREATE UNIQUE INDEX "ExecutionSkill_executionId_skillId_key" ON "ExecutionSkill"("executionId", "skillId"); + +-- AddForeignKey +ALTER TABLE "Account" ADD CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Session" ADD CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Goal" ADD CONSTRAINT "Goal_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Execution" ADD CONSTRAINT "Execution_goalId_fkey" FOREIGN KEY ("goalId") REFERENCES "Goal"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Execution" ADD CONSTRAINT "Execution_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ExecutionGraph" ADD CONSTRAINT "ExecutionGraph_executionId_fkey" FOREIGN KEY ("executionId") REFERENCES "Execution"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ExecutionNode" ADD CONSTRAINT "ExecutionNode_graphId_fkey" FOREIGN KEY ("graphId") REFERENCES "ExecutionGraph"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ExecutionEdge" ADD CONSTRAINT "ExecutionEdge_graphId_fkey" FOREIGN KEY ("graphId") REFERENCES "ExecutionGraph"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Result" ADD CONSTRAINT "Result_goalId_fkey" FOREIGN KEY ("goalId") REFERENCES "Goal"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Result" ADD CONSTRAINT "Result_executionId_fkey" FOREIGN KEY ("executionId") REFERENCES "Execution"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Result" ADD CONSTRAINT "Result_nodeId_fkey" FOREIGN KEY ("nodeId") REFERENCES "ExecutionNode"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "UserSkillset" ADD CONSTRAINT "UserSkillset_skillsetId_fkey" FOREIGN KEY ("skillsetId") REFERENCES "Skillset"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "UserSkillset" ADD CONSTRAINT "UserSkillset_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "GoalSkillset" ADD CONSTRAINT "GoalSkillset_skillsetId_fkey" FOREIGN KEY ("skillsetId") REFERENCES "Skillset"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "GoalSkillset" ADD CONSTRAINT "GoalSkillset_goalId_fkey" FOREIGN KEY ("goalId") REFERENCES "Goal"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ExecutionSkillset" ADD CONSTRAINT "ExecutionSkillset_skillsetId_fkey" FOREIGN KEY ("skillsetId") REFERENCES "Skillset"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ExecutionSkillset" ADD CONSTRAINT "ExecutionSkillset_executionId_fkey" FOREIGN KEY ("executionId") REFERENCES "Execution"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "SkillConfiguration" ADD CONSTRAINT "SkillConfiguration_userSkillsetId_fkey" FOREIGN KEY ("userSkillsetId") REFERENCES "UserSkillset"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "SkillConfiguration" ADD CONSTRAINT "SkillConfiguration_goalSkillsetId_fkey" FOREIGN KEY ("goalSkillsetId") REFERENCES "GoalSkillset"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "SkillConfiguration" ADD CONSTRAINT "SkillConfiguration_executionSkillsetId_fkey" FOREIGN KEY ("executionSkillsetId") REFERENCES "ExecutionSkillset"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Skill" ADD CONSTRAINT "Skill_skillsetId_fkey" FOREIGN KEY ("skillsetId") REFERENCES "Skillset"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "UserSkill" ADD CONSTRAINT "UserSkill_skillId_fkey" FOREIGN KEY ("skillId") REFERENCES "Skill"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "UserSkill" ADD CONSTRAINT "UserSkill_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "GoalSkill" ADD CONSTRAINT "GoalSkill_skillId_fkey" FOREIGN KEY ("skillId") REFERENCES "Skill"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "GoalSkill" ADD CONSTRAINT "GoalSkill_goalId_fkey" FOREIGN KEY ("goalId") REFERENCES "Goal"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ExecutionSkill" ADD CONSTRAINT "ExecutionSkill_skillId_fkey" FOREIGN KEY ("skillId") REFERENCES "Skill"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ExecutionSkill" ADD CONSTRAINT "ExecutionSkill_executionId_fkey" FOREIGN KEY ("executionId") REFERENCES "Execution"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/packages/db/prisma/migrations/migration_lock.toml b/packages/db/prisma/migrations/migration_lock.toml new file mode 100644 index 00000000..fbffa92c --- /dev/null +++ b/packages/db/prisma/migrations/migration_lock.toml @@ -0,0 +1,3 @@ +# Please do not edit this file manually +# It should be added in your version-control system (i.e. Git) +provider = "postgresql" \ No newline at end of file From 72292a60ded5d48e9a33d53fbe4e2089fdc97ba7 Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Wed, 1 Nov 2023 16:00:47 -0700 Subject: [PATCH 21/26] artifact upload, list, download --- .../[taskId]/artifacts/[artifactId]/route.ts | 39 ++++++++ .../agent/tasks/[taskId]/artifacts/route.ts | 97 +++++++++++++++++++ apps/nextjs/src/app/api/upload/route.ts | 22 ----- .../hooks/useWaggleDanceAgentExecutor.ts | 3 + .../types/WaggleDanceAgentExecutor.ts | 2 + packages/agent/src/prompts/types/TaskState.ts | 2 + packages/api/src/router/result.ts | 59 ++++++++++- packages/db/prisma/schema.prisma | 23 ++--- 8 files changed, 213 insertions(+), 34 deletions(-) create mode 100644 apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/[artifactId]/route.ts create mode 100644 apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/route.ts delete mode 100644 apps/nextjs/src/app/api/upload/route.ts diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/[artifactId]/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/[artifactId]/route.ts new file mode 100644 index 00000000..eedc33d2 --- /dev/null +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/[artifactId]/route.ts @@ -0,0 +1,39 @@ +import { type NextRequest } from "next/server"; +import { getServerSession } from "next-auth"; + +import { appRouter } from "@acme/api"; +import { authOptions } from "@acme/auth"; +import { prisma } from "@acme/db"; + +/** + * @api {get} /api/v1/agent/tasks/:taskId/artifacts/:artifactId Get Artifact + * @apiDescription Download a specified artifact. + * @apiName Download Agent Task Artifact + * @param {string} task_id + * @param {string} artifact_id + */ +export async function GET(req: NextRequest) { + const query = req.nextUrl.searchParams; + const taskId = query.get("task_id"); + const artifactId = query.get("artifact_id"); + if (!taskId) { + return Response.json("task_id is required", { status: 400 }); + } + if (!artifactId) { + return Response.json("artifact_id is required", { status: 400 }); + } + + const session = (await getServerSession(authOptions)) || null; + const caller = appRouter.createCaller({ + session, + prisma, + origin: req.nextUrl.origin, + }); + + const artifact = await caller.result.byGoalAndArtifactId({ + taskId, + artifactId, + }); + + return Response.redirect(artifact!.id); +} diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/route.ts new file mode 100644 index 00000000..468811ec --- /dev/null +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/route.ts @@ -0,0 +1,97 @@ +import { NextResponse, type NextRequest } from "next/server"; +import { put } from "@vercel/blob"; +import { customAlphabet } from "nanoid"; +import { getServerSession } from "next-auth"; + +import { appRouter } from "@acme/api"; +import { authOptions } from "@acme/auth"; +import { prisma } from "@acme/db"; + +// +// List all artifacts that have been created for the given task. + +/** + * @name List Agent Task Artifacts + * @description Execute a step in the specified agent task. + * @param task_id string + * @param current_page number + * @param page_size number + * @returns Promise + */ +export async function GET( + req: NextRequest, + { params: { taskId } }: { params: { taskId: string } }, +) { + if (!taskId) { + return NextResponse.json("taskId in path is required", { status: 404 }); + } + const params = req.nextUrl.searchParams; + const pageSize = Number(params.get("page_size") ?? 10); + const currentPage = Number(params.get("current_page") ?? 1); + + const session = (await getServerSession(authOptions)) || null; + const caller = appRouter.createCaller({ + session, + prisma, + origin: req.nextUrl.origin, + }); + + const result = await caller.result.byGoalId(taskId); + + if (!result) { + return NextResponse.json("Artifact not found", { status: 404 }); + } + + // Redirect to the blob URL + // return NextResponse.redirect(artifact.blobUrl); + + return NextResponse.json(result, { status: 200 }); +} + +const nanoid = customAlphabet( + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", + 7, +); // 7-character random string + +/** + * + * @param task_id string + * @param relative_path string + * @returns + */ +export async function POST( + req: NextRequest, + { params: { taskId } }: { params: { taskId: string } }, +) { + if (!taskId) { + return Response.json("taskId in path is required", { status: 400 }); + } + const file = req.body || ""; + const contentType = req.headers.get("content-type") || "text/plain"; + const params = req.nextUrl.searchParams; + const pageSize = Number(params.get("page_size") ?? 10); + const currentPage = Number(params.get("current_page") ?? 1); + const artifactId = nanoid(); + const filename = `${artifactId}.${contentType.split("/")[1]}`; + // const filename = `${query.get("task_id")}/${query.get("relative_path")}`; + const blob = await put(filename, file, { + contentType, + access: "public", + addRandomSuffix: true, + }); + + // TODO: associate the artifact with the exe/goal + + const session = (await getServerSession(authOptions)) || null; + const caller = appRouter.createCaller({ + session, + prisma, + origin: req.nextUrl.origin, + }); + + const artifact = await caller.result.byGoalAndArtifactId({ + taskId, + artifactId, + }); + return NextResponse.json({ artifactId, url: blob.url }); +} diff --git a/apps/nextjs/src/app/api/upload/route.ts b/apps/nextjs/src/app/api/upload/route.ts deleted file mode 100644 index 933e2134..00000000 --- a/apps/nextjs/src/app/api/upload/route.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { NextResponse } from "next/server"; -import { put } from "@vercel/blob"; -import { customAlphabet } from "nanoid"; - -export const runtime = "edge"; - -const nanoid = customAlphabet( - "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", - 7, -); // 7-character random string -export async function POST(req: Request) { - const file = req.body || ""; - const contentType = req.headers.get("content-type") || "text/plain"; - const filename = `${nanoid()}.${contentType.split("/")[1]}`; - const blob = await put(filename, file, { - contentType, - access: "public", - addRandomSuffix: true, - }); - - return NextResponse.json(blob); -} diff --git a/apps/nextjs/src/features/WaggleDance/hooks/useWaggleDanceAgentExecutor.ts b/apps/nextjs/src/features/WaggleDance/hooks/useWaggleDanceAgentExecutor.ts index fccd8643..4375d871 100644 --- a/apps/nextjs/src/features/WaggleDance/hooks/useWaggleDanceAgentExecutor.ts +++ b/apps/nextjs/src/features/WaggleDance/hooks/useWaggleDanceAgentExecutor.ts @@ -100,6 +100,7 @@ const useWaggleDanceAgentExecutor = () => { }, nodeId: taskStateB?.nodeId ?? dagNode.id, updatedAt: updatedAt, + artifactUrls: taskStateB?.artifactUrls ?? [], }; return new TaskState(merged); }); @@ -192,6 +193,7 @@ const useWaggleDanceAgentExecutor = () => { value: agentPacket, updatedAt: new Date(), nodeId: node.id, + artifactUrls: [], }); return { @@ -205,6 +207,7 @@ const useWaggleDanceAgentExecutor = () => { value: agentPacket, packets: [...existingTask.packets, agentPacket], updatedAt: new Date(), + artifactUrls: [], }); return { ...prevAgentPackets, diff --git a/apps/nextjs/src/features/WaggleDance/types/WaggleDanceAgentExecutor.ts b/apps/nextjs/src/features/WaggleDance/types/WaggleDanceAgentExecutor.ts index 8be7e73a..3fb28fa9 100644 --- a/apps/nextjs/src/features/WaggleDance/types/WaggleDanceAgentExecutor.ts +++ b/apps/nextjs/src/features/WaggleDance/types/WaggleDanceAgentExecutor.ts @@ -116,6 +116,7 @@ class WaggleDanceAgentExecutor { value: donePacket, updatedAt: new Date(), nodeId: initialNode.id, + artifactUrls: [], }), ); @@ -306,6 +307,7 @@ class WaggleDanceAgentExecutor { value: packet, nodeId: task.id, updatedAt: new Date(), + artifactUrls: [], }); }) .catch((error) => { diff --git a/packages/agent/src/prompts/types/TaskState.ts b/packages/agent/src/prompts/types/TaskState.ts index 1a7d3187..f7017713 100644 --- a/packages/agent/src/prompts/types/TaskState.ts +++ b/packages/agent/src/prompts/types/TaskState.ts @@ -11,6 +11,7 @@ export class TaskState implements AugmentedResponse { value: AgentPacket; updatedAt: Date; nodeId: string; + artifactUrls: string[]; constructor(result: AugmentedResponse) { this.id = result.id; @@ -18,6 +19,7 @@ export class TaskState implements AugmentedResponse { this.value = result.value; this.updatedAt = result.updatedAt; this.nodeId = result.nodeId; + this.artifactUrls = result.artifactUrls; } // Getters diff --git a/packages/api/src/router/result.ts b/packages/api/src/router/result.ts index 75698451..f2eb90b4 100644 --- a/packages/api/src/router/result.ts +++ b/packages/api/src/router/result.ts @@ -12,10 +12,32 @@ import { createTRPCRouter, protectedProcedure } from "../trpc"; import withLock from "./lock"; export const resultRouter = createTRPCRouter({ + byGoalId: protectedProcedure + .input(z.string().cuid().min(1)) + .query(async ({ ctx, input }) => { + return await ctx.prisma.result.findMany({ + where: { goalId: input }, + orderBy: { createdAt: "desc" }, + }); + }), + + byGoalAndArtifactId: protectedProcedure + .input( + z.object({ + taskId: z.string().cuid().min(1), + artifactId: z.string().min(1), + }), + ) + .query(async ({ ctx, input }) => { + return await ctx.prisma.result.findFirst({ + where: { goalId: input.taskId, id: input.artifactId }, + }); + }), + create: protectedProcedure .input( z.object({ - goalId: z.string().nonempty(), + goalId: z.string().min(1), executionId: z.string().cuid(), node: z.custom(), packets: z.array(z.custom()), @@ -50,4 +72,39 @@ export const resultRouter = createTRPCRouter({ return await ctx.prisma.$transaction([result, updateExecution]); }); }), + + updateArtifactUrl: protectedProcedure + .input( + z.object({ + taskId: z.string().cuid().min(1), + artifactId: z.string().min(1), + artifactUrl: z.string().url(), + }), + ) + .mutation(async ({ ctx, input }) => { + const { taskId, artifactId, artifactUrl } = input; + + return await ctx.prisma.$transaction(async (prisma) => { + // Fetch the existing result + const result = await prisma.result.findUnique({ + where: { id: artifactId }, + }); + + if (!result) { + throw new Error("Result not found"); + } + + // Append the new URL to the existing array + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const updatedArtifactUrls = [...result.artifactUrls, artifactUrl]; + + // Update the result with the new array + const updatedResult = await prisma.result.update({ + where: { id: artifactId, goalId: taskId }, + data: { artifactUrls: updatedArtifactUrls }, + }); + + return updatedResult; + }); + }), }); diff --git a/packages/db/prisma/schema.prisma b/packages/db/prisma/schema.prisma index 723369af..aa016958 100644 --- a/packages/db/prisma/schema.prisma +++ b/packages/db/prisma/schema.prisma @@ -146,18 +146,19 @@ model ExecutionEdge { } model Result { - id String @id @default(cuid()) - goal Goal @relation(fields: [goalId], references: [id], onDelete: Cascade) - goalId String - execution Execution @relation(fields: [executionId], references: [id], onDelete: Cascade) - executionId String - value Json - packets Json[] + id String @id @default(cuid()) + goal Goal @relation(fields: [goalId], references: [id], onDelete: Cascade) + goalId String + execution Execution @relation(fields: [executionId], references: [id], onDelete: Cascade) + executionId String + value Json + packets Json[] packetVersion Int - node ExecutionNode @relation(fields: [nodeId], references: [id], onDelete: Cascade) - nodeId String - createdAt DateTime @default(now()) - updatedAt DateTime @default(now()) @updatedAt + artifactUrls String[] + node ExecutionNode @relation(fields: [nodeId], references: [id], onDelete: Cascade) + nodeId String + createdAt DateTime @default(now()) + updatedAt DateTime @default(now()) @updatedAt } model UserSkillset { From c5c7060602d7dc55b3dd4246620ee84698caad78 Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Wed, 1 Nov 2023 16:09:41 -0700 Subject: [PATCH 22/26] add result column --- .../prisma/migrations/20231101230512_artifact_url/migration.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 packages/db/prisma/migrations/20231101230512_artifact_url/migration.sql diff --git a/packages/db/prisma/migrations/20231101230512_artifact_url/migration.sql b/packages/db/prisma/migrations/20231101230512_artifact_url/migration.sql new file mode 100644 index 00000000..220f229a --- /dev/null +++ b/packages/db/prisma/migrations/20231101230512_artifact_url/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "Result" ADD COLUMN "artifactUrls" TEXT[]; From 1d27ae9a922a92077cc456f6fe0fe05cc36ea167 Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Wed, 1 Nov 2023 16:09:56 -0700 Subject: [PATCH 23/26] add prisma migration note --- packages/db/prisma/schema.prisma | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/db/prisma/schema.prisma b/packages/db/prisma/schema.prisma index aa016958..9cca935c 100644 --- a/packages/db/prisma/schema.prisma +++ b/packages/db/prisma/schema.prisma @@ -1,3 +1,6 @@ +// WARNING: if you make any changes to the schema, ensure that you are also adding a migration +// see: https://www.prisma.io/docs/guides/migrate/developing-with-prisma-migrate/customizing-migrations + generator client { provider = "prisma-client-js" } From 5deabe9bc156e63d7bcd064863891aa692bd9084 Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Wed, 1 Nov 2023 16:58:52 -0700 Subject: [PATCH 24/26] fix goal id being incorrectly used instead of exe id for task id --- .../[taskId]/artifacts/[artifactId]/route.ts | 4 +-- .../agent/tasks/[taskId]/artifacts/route.ts | 15 +++++----- .../api/ap/v1/agent/tasks/[taskId]/route.ts | 17 +++++++---- .../tasks/[taskId]/steps/[stepId]/route.ts | 6 ++-- .../ap/v1/agent/tasks/[taskId]/steps/route.ts | 1 + packages/api/src/router/result.ts | 29 ++++++++++++------- 6 files changed, 45 insertions(+), 27 deletions(-) diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/[artifactId]/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/[artifactId]/route.ts index eedc33d2..8812a3dd 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/[artifactId]/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/[artifactId]/route.ts @@ -30,8 +30,8 @@ export async function GET(req: NextRequest) { origin: req.nextUrl.origin, }); - const artifact = await caller.result.byGoalAndArtifactId({ - taskId, + const artifact = await caller.result.byExecutionIdAndArtifactId({ + executionId: taskId, artifactId, }); diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/route.ts index 468811ec..d69631f3 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/route.ts @@ -36,7 +36,11 @@ export async function GET( origin: req.nextUrl.origin, }); - const result = await caller.result.byGoalId(taskId); + const result = await caller.result.byExecutionId({ + executionId: taskId, + currentPage: currentPage, + pageSize, + }); if (!result) { return NextResponse.json("Artifact not found", { status: 404 }); @@ -68,9 +72,7 @@ export async function POST( } const file = req.body || ""; const contentType = req.headers.get("content-type") || "text/plain"; - const params = req.nextUrl.searchParams; - const pageSize = Number(params.get("page_size") ?? 10); - const currentPage = Number(params.get("current_page") ?? 1); + const artifactId = nanoid(); const filename = `${artifactId}.${contentType.split("/")[1]}`; // const filename = `${query.get("task_id")}/${query.get("relative_path")}`; @@ -80,8 +82,6 @@ export async function POST( addRandomSuffix: true, }); - // TODO: associate the artifact with the exe/goal - const session = (await getServerSession(authOptions)) || null; const caller = appRouter.createCaller({ session, @@ -89,9 +89,10 @@ export async function POST( origin: req.nextUrl.origin, }); - const artifact = await caller.result.byGoalAndArtifactId({ + const _artifact = await caller.result.appendArtifactUrl({ taskId, artifactId, + artifactUrl: blob.url, }); return NextResponse.json({ artifactId, url: blob.url }); } diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts index 11281418..13fcd609 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts @@ -7,6 +7,8 @@ import { authOptions } from "@acme/auth"; import { prisma } from "@acme/db"; // POST /ap/v1/agent/tasks/:taskId +// task == exe +// additional_input may be used by a caller to avoid making a new goal each time export async function POST( request: NextRequest, { params: { taskId } }: { params: { taskId: string } }, @@ -18,7 +20,11 @@ export async function POST( ); } const body = (await request.json()) as TaskRequestBody; - + const additionalInput = body.additional_input as { goal_id: string }; + let additionalGoalId: string | null = null; + if (additionalInput && additionalInput.goal_id) { + additionalGoalId = additionalInput.goal_id; + } if (!body.input) { return Response.json({ message: "Input is required" }, { status: 400 }); } @@ -31,13 +37,14 @@ export async function POST( origin: request.nextUrl.origin, }); - // const goal = await caller.goal.byId(taskId); - const goal = await caller.goal.create({ prompt: body.input as string }); - const exe = await caller.execution.create({ goalId: goal.id }); + const goalId = additionalGoalId + ? additionalGoalId + : (await caller.goal.create({ prompt: body.input as string })).id; + const exe = await caller.execution.create({ goalId: goalId }); const plan = await caller.execution.createPlan({ executionId: exe.id, goalId: taskId, - goalPrompt: goal.prompt, + goalPrompt: body.input as string, creationProps: {}, }); diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts index c771e093..25ed97b4 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/[stepId]/route.ts @@ -26,14 +26,14 @@ export async function GET( prisma, origin: req.nextUrl.origin, }); - const goal = await caller.goal.byId(taskId); - if (!goal || !goal?.executions[0]?.id) { + const exe = await caller.execution.byId({ id: taskId }); + if (!exe || !exe.id) { return Response.json( { message: "Unable to find entity with the provided id" }, { status: 404 }, ); } - const taskSteps = goal.executions[0].graph?.nodes || []; + const taskSteps = exe.graph?.nodes || []; const step = taskSteps.find((step) => step.id === stepId); diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts index e30cfb37..f8134543 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts @@ -42,6 +42,7 @@ export async function POST( ); } + // TODO: implement const plan = await caller.execution.createPlan({ executionId: exe.id, goalId: taskId, diff --git a/packages/api/src/router/result.ts b/packages/api/src/router/result.ts index f2eb90b4..fa1a4b45 100644 --- a/packages/api/src/router/result.ts +++ b/packages/api/src/router/result.ts @@ -12,25 +12,34 @@ import { createTRPCRouter, protectedProcedure } from "../trpc"; import withLock from "./lock"; export const resultRouter = createTRPCRouter({ - byGoalId: protectedProcedure - .input(z.string().cuid().min(1)) + byExecutionId: protectedProcedure + .input( + z.object({ + executionId: z.string().cuid().min(1), + currentPage: z.number().min(1).default(1), + pageSize: z.number().min(1).default(10), + }), + ) .query(async ({ ctx, input }) => { + const { executionId, currentPage, pageSize } = input; return await ctx.prisma.result.findMany({ - where: { goalId: input }, + where: { executionId }, orderBy: { createdAt: "desc" }, + skip: (currentPage - 1) * pageSize, + take: pageSize, }); }), - byGoalAndArtifactId: protectedProcedure + byExecutionIdAndArtifactId: protectedProcedure .input( z.object({ - taskId: z.string().cuid().min(1), + executionId: z.string().cuid().min(1), artifactId: z.string().min(1), }), ) .query(async ({ ctx, input }) => { return await ctx.prisma.result.findFirst({ - where: { goalId: input.taskId, id: input.artifactId }, + where: { executionId: input.executionId, id: input.artifactId }, }); }), @@ -73,7 +82,7 @@ export const resultRouter = createTRPCRouter({ }); }), - updateArtifactUrl: protectedProcedure + appendArtifactUrl: protectedProcedure .input( z.object({ taskId: z.string().cuid().min(1), @@ -87,7 +96,7 @@ export const resultRouter = createTRPCRouter({ return await ctx.prisma.$transaction(async (prisma) => { // Fetch the existing result const result = await prisma.result.findUnique({ - where: { id: artifactId }, + where: { executionId: taskId, id: artifactId }, }); if (!result) { @@ -95,12 +104,12 @@ export const resultRouter = createTRPCRouter({ } // Append the new URL to the existing array - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const updatedArtifactUrls = [...result.artifactUrls, artifactUrl]; // Update the result with the new array const updatedResult = await prisma.result.update({ - where: { id: artifactId, goalId: taskId }, + where: { id: artifactId, executionId: taskId }, data: { artifactUrls: updatedArtifactUrls }, }); From 9e1e080ee17ce6c32a87feb1d82bd04c8a278231 Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Wed, 1 Nov 2023 19:45:20 -0700 Subject: [PATCH 25/26] almost all tests pass --- .../[taskId]/artifacts/[artifactId]/route.ts | 16 ++-- .../agent/tasks/[taskId]/artifacts/route.ts | 11 ++- .../src/app/api/ap/v1/agent/tasks/route.ts | 13 ++-- .../hooks/useWaggleDanceAgentExecutor.ts | 12 ++- apps/nextjs/src/pages/api/agent/execute.ts | 2 +- apps/nextjs/src/pages/api/result.ts | 23 +----- packages/agent/src/prompts/types.ts | 4 +- packages/agent/src/prompts/types/TaskState.ts | 10 ++- .../src/prompts/utils/mapPacketToStatus.ts | 1 + packages/agent/src/strategy/AgentPacket.ts | 2 + packages/api/src/root.ts | 2 + packages/api/src/router/graph.ts | 58 +++++++++++++++ packages/api/src/router/result.ts | 73 ++++++++++++++----- packages/db/prisma/schema.prisma | 6 +- 14 files changed, 168 insertions(+), 65 deletions(-) create mode 100644 packages/api/src/router/graph.ts diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/[artifactId]/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/[artifactId]/route.ts index 8812a3dd..d120efb4 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/[artifactId]/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/[artifactId]/route.ts @@ -12,10 +12,12 @@ import { prisma } from "@acme/db"; * @param {string} task_id * @param {string} artifact_id */ -export async function GET(req: NextRequest) { - const query = req.nextUrl.searchParams; - const taskId = query.get("task_id"); - const artifactId = query.get("artifact_id"); +export async function GET( + req: NextRequest, + { + params: { taskId, artifactId }, + }: { params: { taskId: string; artifactId: string } }, +) { if (!taskId) { return Response.json("task_id is required", { status: 400 }); } @@ -35,5 +37,9 @@ export async function GET(req: NextRequest) { artifactId, }); - return Response.redirect(artifact!.id); + if (artifact?.artifactUrls[0]) { + return Response.redirect(artifact.artifactUrls[0]); + } + + return Response.json({ error: "Artifact not found" }, { status: 404 }); } diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/route.ts index d69631f3..a9124ac6 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/artifacts/route.ts @@ -89,10 +89,13 @@ export async function POST( origin: req.nextUrl.origin, }); - const _artifact = await caller.result.appendArtifactUrl({ - taskId, - artifactId, + const result = await caller.result.upsertAppendArtifactUrl({ + executionId: taskId, + resultId: undefined, artifactUrl: blob.url, }); - return NextResponse.json({ artifactId, url: blob.url }); + return NextResponse.json({ + artifact_id: result.id, + url: result.artifactUrls[0], + }); } diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts index 36953599..b3208214 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts @@ -47,19 +47,18 @@ export async function GET(request: NextRequest) { origin: request.nextUrl.origin, }); - let topByUser: DraftExecutionNode[]; + let nodes: DraftExecutionNode[]; try { - topByUser = (await caller.goal.topByUser()) // TODO make a paginating exe only query - .flatMap((g) => g.executions) - .flatMap((e) => e.graph?.nodes ?? []); + const exe = await caller.graph.topByUser({ currentPage, pageSize }); + nodes = exe?.graph?.nodes ?? []; } catch { - topByUser = []; + nodes = []; } - const totalItems = topByUser.length; + const totalItems = nodes.length; const totalPages = Math.ceil(totalItems / pageSize); const offset = (currentPage - 1) * pageSize; - const paginatedTasks = topByUser.slice(offset, offset + pageSize); + const paginatedTasks = nodes.slice(offset, offset + pageSize); const pagination = { total_items: totalItems, diff --git a/apps/nextjs/src/features/WaggleDance/hooks/useWaggleDanceAgentExecutor.ts b/apps/nextjs/src/features/WaggleDance/hooks/useWaggleDanceAgentExecutor.ts index 4375d871..1f94abb6 100644 --- a/apps/nextjs/src/features/WaggleDance/hooks/useWaggleDanceAgentExecutor.ts +++ b/apps/nextjs/src/features/WaggleDance/hooks/useWaggleDanceAgentExecutor.ts @@ -10,6 +10,7 @@ import { } from "react"; import { isAbortError } from "next/dist/server/pipe-readable"; import { type GraphData } from "react-force-graph-2d"; +import { v4 } from "uuid"; // import { type GraphData } from "../components/ForceGraph"; import { stringify } from "yaml"; @@ -64,7 +65,7 @@ const useWaggleDanceAgentExecutor = () => { ...r, packets: r.packets as AgentPacket[], value: result, - id: r.nodeId, + id: r.nodeId || v4(), // FIXME: is this ok? }); return taskState; @@ -124,6 +125,15 @@ const useWaggleDanceAgentExecutor = () => { if (bid === rootPlanId) { return 1; } + if (aid === bid) { + return 1; // natural order maintained + } + if (!aid) { + return -1; + } + if (!bid) { + return 1; + } if (a.status === b.status) { // Split the IDs into parts and parse them into numbers const aIdParts = aid.split("-").map(Number); diff --git a/apps/nextjs/src/pages/api/agent/execute.ts b/apps/nextjs/src/pages/api/agent/execute.ts index bb8fe28e..d65155b9 100644 --- a/apps/nextjs/src/pages/api/agent/execute.ts +++ b/apps/nextjs/src/pages/api/agent/execute.ts @@ -16,6 +16,7 @@ import { parse, stringify } from "yaml"; import createNamespace from "@acme/agent/src/memory/namespace"; import { LLM, type AgentPromptingMethod } from "@acme/agent/src/utils/llms"; +import { type CreateResultParams } from "@acme/api/src/router/result"; import { type DraftExecutionGraph, type DraftExecutionNode, @@ -30,7 +31,6 @@ import { type ModelCreationProps, type TaskState, } from "../../../../../../packages/agent"; -import { type CreateResultParams } from "../result"; export const config = { api: { diff --git a/apps/nextjs/src/pages/api/result.ts b/apps/nextjs/src/pages/api/result.ts index 4c72d13c..3fdf4b76 100644 --- a/apps/nextjs/src/pages/api/result.ts +++ b/apps/nextjs/src/pages/api/result.ts @@ -2,32 +2,15 @@ import { type NextApiRequest, type NextApiResponse } from "next"; -import { type AgentPacket } from "@acme/agent"; import { appRouter } from "@acme/api"; -import { getServerSession, type Session } from "@acme/auth"; -import { - prisma, - type DraftExecutionNode, - type Execution, - type ExecutionState, - type Result, -} from "@acme/db"; +import { type CreateResultParams } from "@acme/api/src/router/result"; +import { getServerSession } from "@acme/auth"; +import { prisma, type Execution, type Result } from "@acme/db"; export const config = { runtime: "nodejs", }; -export type CreateResultParams = { - goalId: string; - node: DraftExecutionNode; - executionId: string; - packet: AgentPacket; - packets: AgentPacket[]; - state: ExecutionState; - session?: Session | null; - origin?: string | undefined; -}; - // data proxy for edge export default async function createResultProxy( req: NextApiRequest, diff --git a/packages/agent/src/prompts/types.ts b/packages/agent/src/prompts/types.ts index 52819a71..32acf1d2 100644 --- a/packages/agent/src/prompts/types.ts +++ b/packages/agent/src/prompts/types.ts @@ -14,6 +14,6 @@ export interface PromptParams { } export const criticismSuffix = "c"; -export function isTaskCriticism(id: string) { - return id.endsWith(criticismSuffix); +export function isTaskCriticism(id: string | null) { + return id?.endsWith(criticismSuffix) ?? false; } diff --git a/packages/agent/src/prompts/types/TaskState.ts b/packages/agent/src/prompts/types/TaskState.ts index f7017713..e3c70c41 100644 --- a/packages/agent/src/prompts/types/TaskState.ts +++ b/packages/agent/src/prompts/types/TaskState.ts @@ -10,7 +10,7 @@ export class TaskState implements AugmentedResponse { packets: AgentPacket[]; value: AgentPacket; updatedAt: Date; - nodeId: string; + nodeId: string | null; artifactUrls: string[]; constructor(result: AugmentedResponse) { @@ -41,7 +41,7 @@ export class TaskState implements AugmentedResponse { if (this.id === rootPlanId) { return rootPlanId; } - const executionSplit = this.nodeId.split(".")[1]; + const executionSplit = this.nodeId?.split(".")[1]; if (!executionSplit) { return this.id; } else { @@ -57,7 +57,8 @@ export class TaskState implements AugmentedResponse { // private helpers - private extractTier(fromId: string) { + private extractTier(fromId: string | null) { + if (!fromId) return null; const tierAndOptionalServerId = fromId.split("-")[0]; const tierAndOptionalServerIdSplit = tierAndOptionalServerId?.split("."); const tier = @@ -66,7 +67,8 @@ export class TaskState implements AugmentedResponse { return tier || null; } - private extractTaskNumber(nodeId: string): number | null { + private extractTaskNumber(nodeId: string | null): number | null { + if (!nodeId) return null; const parts = nodeId.split("-"); if (parts.length < 2) return null; const lastPart = parts[parts.length - 1]; diff --git a/packages/agent/src/prompts/utils/mapPacketToStatus.ts b/packages/agent/src/prompts/utils/mapPacketToStatus.ts index 0d60be7b..22aead23 100644 --- a/packages/agent/src/prompts/utils/mapPacketToStatus.ts +++ b/packages/agent/src/prompts/utils/mapPacketToStatus.ts @@ -7,6 +7,7 @@ export const mapPacketTypeToStatus = ( switch (packetType) { case "done": case "handleAgentEnd": + case "artifact": return TaskStatus.done; case "error": case "handleLLMError": diff --git a/packages/agent/src/strategy/AgentPacket.ts b/packages/agent/src/strategy/AgentPacket.ts index a40e3def..0f7f9219 100644 --- a/packages/agent/src/strategy/AgentPacket.ts +++ b/packages/agent/src/strategy/AgentPacket.ts @@ -47,6 +47,7 @@ export type AgentPacketType = export const AgentPacketFinishedTypes = [ "handleAgentEnd", "done", + "artifact", // maybe not done? could be a side-effect of agents mid-run "error", "handleChainError", "handleLLMError", @@ -295,6 +296,7 @@ export type AgentPacket = severity: "warn" | "human" | "fatal"; error: string; } & BaseAgentPacket) + | ({ type: "artifact"; url: string | URL } & BaseAgentPacket) // client-side only | ({ type: "starting"; nodeId: string } & BaseAgentPacket) | ({ type: "working"; nodeId: string } & BaseAgentPacket) diff --git a/packages/api/src/root.ts b/packages/api/src/root.ts index f8402e65..119a7c66 100644 --- a/packages/api/src/root.ts +++ b/packages/api/src/root.ts @@ -1,6 +1,7 @@ import { authRouter as auth } from "./router/auth"; import { executionRouter as execution } from "./router/execution"; import { goalRouter as goal } from "./router/goal"; +import { graphRouter as graph } from "./router/graph"; import { resultRouter as result } from "./router/result"; import { createTRPCRouter } from "./trpc"; @@ -9,6 +10,7 @@ export const appRouter = createTRPCRouter({ goal, execution, result, + graph, }); // export type definition of API diff --git a/packages/api/src/router/graph.ts b/packages/api/src/router/graph.ts new file mode 100644 index 00000000..27125519 --- /dev/null +++ b/packages/api/src/router/graph.ts @@ -0,0 +1,58 @@ +import { z } from "zod"; + +import { type DraftExecutionEdge, type DraftExecutionNode } from "@acme/db"; + +import { createTRPCRouter, protectedProcedure } from "../trpc"; + +export const dagShape = z.object({ + nodes: z.array(z.custom()), + edges: z.array(z.custom()), +}); + +export const graphRouter = createTRPCRouter({ + topByUser: protectedProcedure + .input( + z.object({ + currentPage: z.number().min(1).default(1), + pageSize: z.number().min(1).default(1), + }), + ) + .query(async ({ ctx }) => { + return await ctx.prisma.execution.findFirst({ + where: { userId: ctx.session?.user.id }, + take: 1, + orderBy: { updatedAt: "desc" }, // doesnt work as expected? + include: { + graph: { + include: { + nodes: true, + edges: true, + }, + }, + results: { + take: 40, + orderBy: { updatedAt: "desc" }, + }, + }, + }); + }), + nodes: protectedProcedure + .input( + z + .object({ graphId: z.string().cuid().min(1) }) + .or(z.object({ executionId: z.string().cuid().min(1) })), + ) + .query(async ({ ctx, input }) => { + if (input as { graphId: string }) { + return await ctx.prisma.executionNode.findMany({ + where: { graphId: (input as { graphId: string }).graphId }, + }); + } else { + const execution = await ctx.prisma.execution.findUnique({ + where: { id: (input as { executionId: string }).executionId }, + include: { graph: { include: { nodes: true } } }, + }); + return execution?.graph?.nodes ?? []; + } + }), +}); diff --git a/packages/api/src/router/result.ts b/packages/api/src/router/result.ts index fa1a4b45..ba3c2c90 100644 --- a/packages/api/src/router/result.ts +++ b/packages/api/src/router/result.ts @@ -6,11 +6,23 @@ import { makeServerIdIfNeeded, type AgentPacket, } from "@acme/agent"; -import { ExecutionState, type DraftExecutionNode } from "@acme/db"; +import { type Session } from "@acme/auth"; +import { ExecutionState, type DraftExecutionNode, type Result } from "@acme/db"; import { createTRPCRouter, protectedProcedure } from "../trpc"; import withLock from "./lock"; +export type CreateResultParams = { + goalId: string; + node: DraftExecutionNode; + executionId: string; + packet: AgentPacket; + packets: AgentPacket[]; + state: ExecutionState; + session?: Session | null; + origin?: string | undefined; +}; + export const resultRouter = createTRPCRouter({ byExecutionId: protectedProcedure .input( @@ -40,6 +52,7 @@ export const resultRouter = createTRPCRouter({ .query(async ({ ctx, input }) => { return await ctx.prisma.result.findFirst({ where: { executionId: input.executionId, id: input.artifactId }, + select: { artifactUrls: true }, }); }), @@ -63,7 +76,6 @@ export const resultRouter = createTRPCRouter({ goal: { connect: { id: goalId } }, value: findFinishPacket(packets) as Prisma.InputJsonValue, packets: packets as Prisma.InputJsonValue[], - packetVersion: 1, node: { connectOrCreate: { where: { id: node.id }, @@ -82,38 +94,63 @@ export const resultRouter = createTRPCRouter({ }); }), - appendArtifactUrl: protectedProcedure + upsertAppendArtifactUrl: protectedProcedure .input( z.object({ - taskId: z.string().cuid().min(1), - artifactId: z.string().min(1), + resultId: z.string().cuid().min(1).optional(), + executionId: z.string().cuid().min(1), artifactUrl: z.string().url(), }), ) .mutation(async ({ ctx, input }) => { - const { taskId, artifactId, artifactUrl } = input; + const { executionId, resultId, artifactUrl } = input; return await ctx.prisma.$transaction(async (prisma) => { // Fetch the existing result - const result = await prisma.result.findUnique({ - where: { executionId: taskId, id: artifactId }, - }); + let result: Result | null; - if (!result) { - throw new Error("Result not found"); + if (!resultId) { + result = await prisma.result.findFirst({ + where: { executionId }, + }); + } else { + result = await prisma.result.findUnique({ where: { id: resultId } }); } // Append the new URL to the existing array - const updatedArtifactUrls = [...result.artifactUrls, artifactUrl]; - + // TODO: allow additional_input to better maintain waggledance features and bypass the extra queries (goal, node) // Update the result with the new array - const updatedResult = await prisma.result.update({ - where: { id: artifactId, executionId: taskId }, - data: { artifactUrls: updatedArtifactUrls }, - }); + if (result) { + const updatedArtifactUrls = [...result.artifactUrls, artifactUrl]; + const updatedResult = await prisma.result.update({ + where: { id: result.id, executionId }, + data: { artifactUrls: updatedArtifactUrls }, + }); + return updatedResult; + } else { + // look up the goal from the taskId + const execution = await prisma.execution.findUnique({ + where: { id: executionId }, + include: { goal: true }, + }); - return updatedResult; + const stubValue: AgentPacket = { + type: "artifact", + url: artifactUrl, + }; + // create the result + const result = await ctx.prisma.result.create({ + data: { + execution: { connect: { id: executionId } }, + goal: { connect: { id: execution?.goalId } }, + value: stubValue, + packets: [stubValue], + artifactUrls: [artifactUrl], + }, + }); + return result; + } }); }), }); diff --git a/packages/db/prisma/schema.prisma b/packages/db/prisma/schema.prisma index 9cca935c..a83cde87 100644 --- a/packages/db/prisma/schema.prisma +++ b/packages/db/prisma/schema.prisma @@ -156,10 +156,10 @@ model Result { executionId String value Json packets Json[] - packetVersion Int + packetVersion Int @default(1) artifactUrls String[] - node ExecutionNode @relation(fields: [nodeId], references: [id], onDelete: Cascade) - nodeId String + node ExecutionNode? @relation(fields: [nodeId], references: [id], onDelete: Cascade) + nodeId String? createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt } From 2d46f52836a34e5651918c434da96eab6db32c3a Mon Sep 17 00:00:00 2001 From: jon <906671+jondwillis@users.noreply.github.com> Date: Thu, 2 Nov 2023 00:00:42 -0700 Subject: [PATCH 26/26] 24/24 postman tests --- .../api/ap/v1/agent/tasks/[taskId]/route.ts | 83 ++++++++++--------- .../ap/v1/agent/tasks/[taskId]/steps/route.ts | 55 +++++++++--- .../src/app/api/ap/v1/agent/tasks/route.ts | 29 +++++-- apps/nextjs/src/pages/api/agent/execute.ts | 5 +- apps/nextjs/src/pages/api/agent/plan.ts | 23 +++-- .../agent/src/strategy/callExecutionAgent.ts | 7 +- .../agent/src/strategy/callPlanningAgent.ts | 2 +- packages/agent/src/utils/serialization.ts | 61 -------------- packages/api/src/router/execution.ts | 20 +++-- packages/db/index.ts | 5 +- 10 files changed, 150 insertions(+), 140 deletions(-) delete mode 100644 packages/agent/src/utils/serialization.ts diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts index 13fcd609..c7d31649 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/route.ts @@ -1,55 +1,56 @@ import { type NextRequest } from "next/server"; -import { type Task, type TaskRequestBody } from "lib/AgentProtocol/types"; +import { type Task } from "lib/AgentProtocol/types"; import { getServerSession } from "next-auth"; import { appRouter } from "@acme/api"; import { authOptions } from "@acme/auth"; import { prisma } from "@acme/db"; -// POST /ap/v1/agent/tasks/:taskId -// task == exe -// additional_input may be used by a caller to avoid making a new goal each time -export async function POST( - request: NextRequest, - { params: { taskId } }: { params: { taskId: string } }, -): Promise { - if (!taskId) { - return Response.json( - { message: "Unable to find entity with the provided id" }, - { status: 404 }, - ); - } - const body = (await request.json()) as TaskRequestBody; - const additionalInput = body.additional_input as { goal_id: string }; - let additionalGoalId: string | null = null; - if (additionalInput && additionalInput.goal_id) { - additionalGoalId = additionalInput.goal_id; - } - if (!body.input) { - return Response.json({ message: "Input is required" }, { status: 400 }); - } +// // POST /ap/v1/agent/tasks/:taskId +// // task == exe +// // additional_input may be used by a caller to avoid making a new goal each time +// export async function POST( +// request: NextRequest, +// { params: { taskId } }: { params: { taskId: string } }, +// ): Promise { +// if (!taskId) { +// return Response.json( +// { message: "Unable to find entity with the provided id" }, +// { status: 404 }, +// ); +// } +// const body = (await request.json()) as TaskRequestBody; +// const additionalInput = body.additional_input as { goal_id: string }; +// let additionalGoalId: string | null = null; +// if (additionalInput && additionalInput.goal_id) { +// additionalGoalId = additionalInput.goal_id; +// } +// if (!body.input) { +// return Response.json({ message: "Input is required" }, { status: 400 }); +// } - const session = (await getServerSession(authOptions)) || null; +// const session = (await getServerSession(authOptions)) || null; - const caller = appRouter.createCaller({ - session, - prisma, - origin: request.nextUrl.origin, - }); +// const caller = appRouter.createCaller({ +// session, +// prisma, +// origin: request.nextUrl.origin, +// }); - const goalId = additionalGoalId - ? additionalGoalId - : (await caller.goal.create({ prompt: body.input as string })).id; - const exe = await caller.execution.create({ goalId: goalId }); - const plan = await caller.execution.createPlan({ - executionId: exe.id, - goalId: taskId, - goalPrompt: body.input as string, - creationProps: {}, - }); +// const goalId = additionalGoalId +// ? additionalGoalId +// : (await caller.goal.create({ prompt: body.input as string })).id; +// const exe = await caller.execution.create({ goalId: goalId }); +// const plan = await caller.execution.createPlan({ +// executionId: exe.id, +// goalId: taskId, +// goalPrompt: body.input as string, +// creationProps: { modelName: LLM_ALIASES["fast"], maxTokens: 350 }, +// headers: request.headers, +// }); - return Response.json(plan, { status: 200 }); -} +// return Response.json(plan, { status: 200 }); +// } // GET /ap/v1/agent/tasks/:taskId export async function GET( diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts index f8134543..3e8d8d49 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/[taskId]/steps/route.ts @@ -1,10 +1,14 @@ import { NextResponse, type NextRequest } from "next/server"; import { type StepRequestBody } from "lib/AgentProtocol/types"; import { getServerSession } from "next-auth"; +import { parse } from "yaml"; +import { AgentPromptingMethod, LLM_ALIASES } from "@acme/agent/src/utils/llms"; import { appRouter } from "@acme/api"; import { authOptions } from "@acme/auth"; -import { prisma } from "@acme/db"; +import { prisma, type DraftExecutionNode } from "@acme/db"; + +import { type ExecuteRequestBody } from "~/features/WaggleDance/types/types"; // POST /ap/v1/agent/tasks/:taskId/steps export async function POST( @@ -34,23 +38,54 @@ export async function POST( // const goal = await caller.goal.byId(taskId); // const exe = await caller.execution.create({ goalId: taskId }); const exe = await caller.execution.byId({ id: taskId }); - if (!exe || !exe.goalId) { return NextResponse.json( { message: "Unable to find entity with the provided id" }, { status: 404 }, ); } + const goal = await caller.goal.byId(exe.goalId); - // TODO: implement - const plan = await caller.execution.createPlan({ - executionId: exe.id, - goalId: taskId, - goalPrompt: body.input as string, - creationProps: {}, - }); + const completedTasks = exe.results.length; + + const task: DraftExecutionNode = { + id: completedTasks.toString(), + name: body.input as string, + graphId: exe.graph?.id, + context: null, + }; + const input = { + // executionId: string; + // task: DraftExecutionNode; + // revieweeTaskResults: TaskState[]; + // dag: DraftExecutionGraph; + // agentPromptingMethod: AgentPromptingMethod; + executionId: taskId, + task, + goalId: exe.goalId, + dag: exe.graph, + revieweeTaskResults: [], + agentPromptingMethod: AgentPromptingMethod.OpenAIStructuredChat, + goalPrompt: goal?.prompt || "error", + creationProps: { modelName: LLM_ALIASES["fast"], maxTokens: 350 }, + } as ExecuteRequestBody; + + const executeResponse = await fetch( + `${request.nextUrl.origin}/api/agent/execute`, + { + method: "POST", + headers: { + Cookie: request.headers.get("cookie") || "", + "Content-Type": "application/json", + }, + body: JSON.stringify(input), + signal: request.signal, + }, + ); + + const result = await executeResponse.text(); - return Response.json(plan, { status: 200 }); + return Response.json(parse(result), { status: 200 }); } // GET /ap/v1/agent/tasks/:taskId/steps diff --git a/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts b/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts index b3208214..765a18b6 100644 --- a/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts +++ b/apps/nextjs/src/app/api/ap/v1/agent/tasks/route.ts @@ -2,6 +2,7 @@ import { type NextRequest } from "next/server"; import { type Task, type TaskRequestBody } from "lib/AgentProtocol/types"; import { getServerSession } from "next-auth"; +import { LLM_ALIASES } from "@acme/agent/src/utils/llms"; import { appRouter } from "@acme/api"; import { authOptions } from "@acme/auth"; import { prisma, type DraftExecutionNode } from "@acme/db"; @@ -9,9 +10,14 @@ import { prisma, type DraftExecutionNode } from "@acme/db"; // POST /ap/v1/agent/tasks export async function POST(request: NextRequest) { const body = (await request.json()) as TaskRequestBody; - if (!body.input) { - return Response.json({ message: "Input is required" }, { status: 400 }); + return; + Response.json({ message: "Input is required" }, { status: 400 }); + } + const additionalInput = body.additional_input as { goal_id: string }; + let additionalGoalId: string | null = null; + if (additionalInput && additionalInput.goal_id) { + additionalGoalId = additionalInput.goal_id; } // create a goal and exe @@ -22,15 +28,26 @@ export async function POST(request: NextRequest) { origin: request.nextUrl.origin, }); - const execution = await caller.execution.createForAgentProtocol({ - prompt: body.input as string, + const goalId = additionalGoalId + ? additionalGoalId + : (await caller.goal.create({ prompt: body.input as string })).id; + const exe = await caller.execution.create({ goalId: goalId }); + const cookie = request.headers.get("cookie"); + + const _plan = await caller.execution.createPlan({ + executionId: exe.id, + goalId, + goalPrompt: body.input as string, + creationProps: { modelName: LLM_ALIASES["fast"], maxTokens: 350 }, + cookie: cookie || "", }); const task: Task = { - task_id: execution.id, + task_id: exe.id, input: body.input, - additional_input: body.additional_input, + artifacts: [], }; + return Response.json(task, { status: 200 }); } diff --git a/apps/nextjs/src/pages/api/agent/execute.ts b/apps/nextjs/src/pages/api/agent/execute.ts index d65155b9..a186d7ee 100644 --- a/apps/nextjs/src/pages/api/agent/execute.ts +++ b/apps/nextjs/src/pages/api/agent/execute.ts @@ -302,7 +302,6 @@ export default async function ExecuteStream(req: NextRequest) { return; } controller.close(); - abortControllerWrapper.controller.signal; repetitionCheckPacketBuffer = []; allSentPackets = []; packetCounter = 0; @@ -334,7 +333,7 @@ export default async function ExecuteStream(req: NextRequest) { parsedGoalId: string, agentPromptingMethod: AgentPromptingMethod, task: DraftExecutionNode, - dag: DraftExecutionGraph, + dag: DraftExecutionGraph | null, revieweeTaskResults: TaskState[], contentType: "application/json" | "application/yaml", namespace: string, @@ -374,7 +373,7 @@ export default async function ExecuteStream(req: NextRequest) { }; } else { state = - dag.nodes[dag.nodes.length - 1]?.id == task.id ? "DONE" : "EXECUTING"; + dag?.nodes[dag.nodes.length - 1]?.id == task.id ? "DONE" : "EXECUTING"; packet = { type: "done", value: exeResult }; } executionResult = { packet, state: state as ExecutionState }; diff --git a/apps/nextjs/src/pages/api/agent/plan.ts b/apps/nextjs/src/pages/api/agent/plan.ts index 5d2a92a2..2e00eadc 100644 --- a/apps/nextjs/src/pages/api/agent/plan.ts +++ b/apps/nextjs/src/pages/api/agent/plan.ts @@ -1,7 +1,6 @@ // api/agent/plan.ts import { type NextRequest } from "next/server"; -import { stringify as jsonStringify } from "superjson"; import { parse, stringify } from "yaml"; import { type PlanRequestBody } from "~/features/WaggleDance/types/types"; @@ -33,6 +32,8 @@ export default async function PlanStream(req: NextRequest) { resolveStreamEnded = resolve; rejectStreamEnded = reject; }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let liftedStreamController: ReadableStreamDefaultController | undefined; try { const { creationProps, @@ -48,6 +49,7 @@ export default async function PlanStream(req: NextRequest) { const encoder = new TextEncoder(); const stream = new ReadableStream({ async start(controller) { + liftedStreamController = controller; const inlineCallback = { handleLLMNewToken(token: string) { const packet: AgentPacket = { type: "t", t: token }; @@ -103,7 +105,7 @@ export default async function PlanStream(req: NextRequest) { } console.debug("plan result", planResult); - controller.close(); + liftedStreamController = controller; }, cancel(reason) { @@ -177,7 +179,8 @@ export default async function PlanStream(req: NextRequest) { goalPrompt, executionId, ); - await updateExecution( + + const response = await updateExecution( { goalId, graph, @@ -186,6 +189,10 @@ export default async function PlanStream(req: NextRequest) { }, req, ); + + liftedStreamController?.close(); + return response; + // return Response.json(graph, { status: 200 }); } else { console.error( "could not save execution, it must be manually cleaned up", @@ -202,17 +209,21 @@ export default async function PlanStream(req: NextRequest) { export async function updateExecution( params: UpdateGraphParams, req: NextRequest, -): Promise { +): Promise { + const cookie = req.headers.get("cookie") || ""; + const body = JSON.stringify({ json: params }); const response = await fetch(`${req.nextUrl.origin}/api/execution/graph`, { method: "POST", headers: { - Cookie: req.headers.get("cookie") || "", // pass cookie so session logic still works + Cookie: cookie, // pass cookie so session logic still works "Content-Type": "application/json", }, - body: jsonStringify(params), + body, }); if (!response.ok && response.status !== 401) { throw new Error(`Could not save execution: ${response.statusText}`); } + + return response; } diff --git a/packages/agent/src/strategy/callExecutionAgent.ts b/packages/agent/src/strategy/callExecutionAgent.ts index 99b09655..78d99196 100644 --- a/packages/agent/src/strategy/callExecutionAgent.ts +++ b/packages/agent/src/strategy/callExecutionAgent.ts @@ -125,12 +125,15 @@ export async function callExecutionAgent(creation: { throw new Error("No result found to provide to review task"); } - const nodes = (yamlParse(dag) as DraftExecutionGraph).nodes; + const dagObj = yamlParse(dag) as DraftExecutionGraph; + if ((!dagObj || !dagObj.nodes) && isCriticism) { + throw new Error("DAG is required for criticism task"); + } const prompt = isCriticism ? createCriticizePrompt({ revieweeTaskResults, goalPrompt, - nodes, + nodes: dagObj.nodes, namespace, returnType, }) diff --git a/packages/agent/src/strategy/callPlanningAgent.ts b/packages/agent/src/strategy/callPlanningAgent.ts index d9ebe6ce..e8113e5d 100644 --- a/packages/agent/src/strategy/callPlanningAgent.ts +++ b/packages/agent/src/strategy/callPlanningAgent.ts @@ -124,7 +124,7 @@ export async function callPlanningAgent( return -1; } else { // otherwise, we want to use the response token count with some padding for the fix (it should be close, yeah?) - return tokenCount * paddingMultiplier; + return Math.round(tokenCount * paddingMultiplier); } }; diff --git a/packages/agent/src/utils/serialization.ts b/packages/agent/src/utils/serialization.ts deleted file mode 100644 index d258b4ba..00000000 --- a/packages/agent/src/utils/serialization.ts +++ /dev/null @@ -1,61 +0,0 @@ -type Constructor = new (...args: unknown[]) => T; - -/* Check whether array is of the specified type */ -export const isArrayOfType = ( - arr: unknown[], - type: Constructor | string, -): arr is T[] => { - return ( - Array.isArray(arr) && - arr.every((item): item is T => { - if (typeof type === "string") { - return typeof item === type; - } else { - return item instanceof type; - } - }) - ); -}; - -export const extractTasks = ( - text: string, - completedTasks: string[], -): string[] => { - return extractArray(text) - .filter(realTasksFilter) - .filter((task) => !(completedTasks || []).includes(task)); -}; - -// TODO: make this much more robust response fixing, see Auto-GPT -export const extractArray = (inputStr: string): string[] => { - try { - // Check if the parsed JSON is an array - if (Array.isArray(JSON.parse(inputStr))) { - return JSON.parse(inputStr) as string[]; - } else { - console.warn( - "Error, extracted JSON from inputString is not an array:", - inputStr, - ); - } - } catch (error) { - console.error("Error parsing the inputString as JSON:", error); - } - - return []; -}; - -// Model will return tasks such as "No tasks added". We should filter these -export const realTasksFilter = (input: string): boolean => { - const noTaskRegex = - /^No( (new|further|additional|extra|other))? tasks? (is )?(required|needed|added|created|inputted).*$/i; - const taskCompleteRegex = - /^Task (complete|completed|finished|done|over|success).*/i; - const doNothingRegex = /^(\s*|Do nothing(\s.*)?)$/i; - - return ( - !noTaskRegex.test(input) && - !taskCompleteRegex.test(input) && - !doNothingRegex.test(input) - ); -}; diff --git a/packages/api/src/router/execution.ts b/packages/api/src/router/execution.ts index 3a266b09..b0404ef7 100644 --- a/packages/api/src/router/execution.ts +++ b/packages/api/src/router/execution.ts @@ -1,4 +1,3 @@ -import { getFetch } from "@trpc/client"; import { z } from "zod"; import { @@ -220,16 +219,25 @@ export const executionRouter = createTRPCRouter({ createPlan: publicProcedure .input( z.object({ + cookie: z.string().includes("next-auth.session-token="), //.regex(/^(.+;)*\s*=\s*(.+\s*;*)*$/), goalPrompt: z.string().min(1), goalId: z.string().min(1), executionId: z.string().min(1), creationProps: z.custom(), }), ) - .mutation(({ ctx, input: _input }) => { - // const { goalPrompt, goalId, executionId, creationProps } = input; - // const userId = ctx.session?.user.id; - - return getFetch()(`${ctx.origin}/api/agent/plan`, {}); + .mutation(async ({ ctx, input }) => { + const response = await fetch(`${ctx.origin}/api/agent/plan`, { + method: "POST", + headers: { + Cookie: input.cookie, + "Content-Type": "application/json", + }, + body: JSON.stringify(input), + }); + const planGraphText = await response.text(); + // const planGraph = (await response.json()) as OldPlanWireFormat; + // return response.body; + return planGraphText; }), }); diff --git a/packages/db/index.ts b/packages/db/index.ts index e834578e..826125c0 100644 --- a/packages/db/index.ts +++ b/packages/db/index.ts @@ -19,10 +19,7 @@ const globalForPrisma = globalThis as { prisma?: PrismaClient }; export const prisma = globalForPrisma.prisma || new PrismaClient({ - log: - process.env.NODE_ENV === "development" - ? ["query", "error", "warn"] - : ["error"], + log: process.env.NODE_ENV === "development" ? ["error", "warn"] : ["error"], }); if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;