Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Update DB types; Remove broken ask human tool code (TODO)

Tomas Valentaac560ac97b45
diff --git a/api-service/.openapi-generator/FILES b/api-service/.openapi-generator/FILES
index 1c7c670ef..79cae4f14 100644
--- a/api-service/.openapi-generator/FILES
+++ b/api-service/.openapi-generator/FILES
@@ -17,7 +17,6 @@ playground_client/docs/ProcessResponse.md
playground_client/docs/ReadFilesystemFileResponse.md
playground_client/docs/SessionResponse.md
playground_client/docs/StartProcessParams.md
-playground_client/docs/ToolsLogOutput.md
playground_client/docs/WriteFilesystemFileRequest.md
playground_client/docs/WriteProcessStdinRequest.md
playground_client/exceptions.py
@@ -35,7 +34,6 @@ playground_client/models/process_response.py
playground_client/models/read_filesystem_file_response.py
playground_client/models/session_response.py
playground_client/models/start_process_params.py
-playground_client/models/tools_log_output.py
playground_client/models/write_filesystem_file_request.py
playground_client/models/write_process_stdin_request.py
playground_client/rest.py
@@ -54,7 +52,6 @@ playground_client/test/test_process_response.py
playground_client/test/test_read_filesystem_file_response.py
playground_client/test/test_session_response.py
playground_client/test/test_start_process_params.py
-playground_client/test/test_tools_log_output.py
playground_client/test/test_write_filesystem_file_request.py
playground_client/test/test_write_process_stdin_request.py
playground_client_README.md
diff --git a/api-service/deployment/manager.py b/api-service/deployment/manager.py
index c17d325c7..a488b8813 100644
--- a/api-service/deployment/manager.py
+++ b/api-service/deployment/manager.py
@@ -5,11 +5,12 @@ from pydantic import BaseModel
from agent.base import AgentBase, AgentConfig, AgentInteractionRequest
-class AgentDeployment(BaseModel):
- id: str
- agent: AgentBase
- status: Literal["running", "stopped"] = "stopped"
- interaction_requests: List[AgentInteractionRequest] = []
+class AgentDeployment:
+ def __init__(self, id: str, agent: AgentBase):
+ self.id = id
+ self.agent = agent
+ self.status: Literal["running", "stopped"] = "stopped"
+ self.interaction_requests: List[AgentInteractionRequest] = []
async def start(self):
await self.agent.start()
@@ -19,8 +20,6 @@ class AgentDeployment(BaseModel):
await self.agent.stop()
self.status = "stopped"
-
-
class AgentDeploymentManager(BaseModel):
"""
diff --git a/api-service/playground/package-lock.json b/api-service/playground/package-lock.json
index 872f23c7e..0546462a7 100644
--- a/api-service/playground/package-lock.json
+++ b/api-service/playground/package-lock.json
@@ -10,8 +10,6 @@
"license": "MIT",
"dependencies": {
"@devbookhq/sdk": "^2.6.74",
- "@supabase/supabase-js": "^2.12.0",
- "dotenv": "^16.0.3",
"express": "^4.18.2",
"morgan": "^1.10.0",
"node-cache": "^5.1.2",
@@ -391,61 +389,6 @@
"node": ">=12"
}
},
- "node_modules/@supabase/functions-js": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.1.0.tgz",
- "integrity": "sha512-vRziB+AqRXRaGHjEFHwBo0kuNDTuAxI7VUeqU24Fe86ISoD8YEQm0dGdpleJEcqgDGWaO6pxT1tfj1BRY5PwMg==",
- "dependencies": {
- "cross-fetch": "^3.1.5"
- }
- },
- "node_modules/@supabase/gotrue-js": {
- "version": "2.20.1",
- "resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.20.1.tgz",
- "integrity": "sha512-TvXAhLpB/ghLAMNRX5Du3EAc9t0W1w9OFKFn9FNgX3mCAvyhJOni2DVdeSYas4xKbUuyMt4Mp3NDSculLtD0DA==",
- "dependencies": {
- "cross-fetch": "^3.1.5"
- }
- },
- "node_modules/@supabase/postgrest-js": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.5.0.tgz",
- "integrity": "sha512-YaU1HBE43Ba+FGmnXuvK+xYeHylkDKd04PYeKDUCoE2bUHoxSDqnjHbOwmLjnusGZi3X1MrFeUH1Wwb4bHYyIg==",
- "dependencies": {
- "cross-fetch": "^3.1.5"
- }
- },
- "node_modules/@supabase/realtime-js": {
- "version": "2.7.1",
- "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.7.1.tgz",
- "integrity": "sha512-WC0yPArBF/wPXwxKWTrRSMWWnFQCbhhUsX0u42x4OqUdDJtow6rzvDIZHWFZLh85UUBYIQ2++AabSNgzd3ubQg==",
- "dependencies": {
- "@types/phoenix": "^1.5.4",
- "@types/websocket": "^1.0.3",
- "websocket": "^1.0.34"
- }
- },
- "node_modules/@supabase/storage-js": {
- "version": "2.4.0",
- "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.4.0.tgz",
- "integrity": "sha512-uCT6WjeZsyxH/Br1MnXieJnXrYxS3DpIkdNxEFTKCoaPX/KZ2t62v++R2IMNB/XGI1LMuJfN5wM28uuK6DMpfw==",
- "dependencies": {
- "cross-fetch": "^3.1.5"
- }
- },
- "node_modules/@supabase/supabase-js": {
- "version": "2.15.0",
- "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.15.0.tgz",
- "integrity": "sha512-gtgq8Tyb4AJoTGeUH3EISOiobdSYwUPcjV+mqL8zGMND+mfqh6l90fnxVPxepnIFXeppJh67YIFTu2bZhr6AMA==",
- "dependencies": {
- "@supabase/functions-js": "^2.1.0",
- "@supabase/gotrue-js": "^2.18.1",
- "@supabase/postgrest-js": "^1.1.1",
- "@supabase/realtime-js": "^2.7.1",
- "@supabase/storage-js": "^2.4.0",
- "cross-fetch": "^3.1.5"
- }
- },
"node_modules/@tsoa/cli": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@tsoa/cli/-/cli-5.1.1.tgz",
@@ -570,11 +513,6 @@
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz",
"integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q=="
},
- "node_modules/@types/phoenix": {
- "version": "1.5.5",
- "resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.5.5.tgz",
- "integrity": "sha512-1eWWT19k0L4ZiTvdXjAvJ9KvW0B8SdiVftQmFPJGTEx78Q4PCSIQDpz+EfkFVR1N4U9gREjlW4JXL8YCIlY0bw=="
- },
"node_modules/@types/qs": {
"version": "6.9.7",
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz",
@@ -594,14 +532,6 @@
"@types/node": "*"
}
},
- "node_modules/@types/websocket": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.5.tgz",
- "integrity": "sha512-NbsqiNX9CnEfC1Z0Vf4mE1SgAJ07JnRYcNex7AJ9zAVzmiGHmjKFEk7O4TJIsgv2B1sLEb6owKFZrACwdYngsQ==",
- "dependencies": {
- "@types/node": "*"
- }
- },
"node_modules/abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
@@ -788,6 +718,8 @@
"resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz",
"integrity": "sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==",
"hasInstallScript": true,
+ "optional": true,
+ "peer": true,
"dependencies": {
"node-gyp-build": "^4.3.0"
},
@@ -979,15 +911,6 @@
"node-fetch": "2.6.7"
}
},
- "node_modules/d": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
- "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
- "dependencies": {
- "es5-ext": "^0.10.50",
- "type": "^1.0.1"
- }
- },
"node_modules/date-fns": {
"version": "2.29.3",
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.29.3.tgz",
@@ -1049,14 +972,6 @@
"npm": "1.2.8000 || >= 1.4.16"
}
},
- "node_modules/dotenv": {
- "version": "16.0.3",
- "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
- "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==",
- "engines": {
- "node": ">=12"
- }
- },
"node_modules/ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
@@ -1195,39 +1110,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/es5-ext": {
- "version": "0.10.62",
- "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz",
- "integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==",
- "hasInstallScript": true,
- "dependencies": {
- "es6-iterator": "^2.0.3",
- "es6-symbol": "^3.1.3",
- "next-tick": "^1.1.0"
- },
- "engines": {
- "node": ">=0.10"
- }
- },
- "node_modules/es6-iterator": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
- "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==",
- "dependencies": {
- "d": "1",
- "es5-ext": "^0.10.35",
- "es6-symbol": "^3.1.1"
- }
- },
- "node_modules/es6-symbol": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
- "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
- "dependencies": {
- "d": "^1.0.1",
- "ext": "^1.1.2"
- }
- },
"node_modules/esbuild": {
"version": "0.17.15",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.15.tgz",
@@ -1327,19 +1209,6 @@
"node": ">= 0.10.0"
}
},
- "node_modules/ext": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz",
- "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==",
- "dependencies": {
- "type": "^2.7.2"
- }
- },
- "node_modules/ext/node_modules/type": {
- "version": "2.7.2",
- "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz",
- "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw=="
- },
"node_modules/fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
@@ -1980,11 +1849,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/is-typedarray": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
- "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA=="
- },
"node_modules/is-weakref": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz",
@@ -2178,11 +2042,6 @@
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="
},
- "node_modules/next-tick": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz",
- "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ=="
- },
"node_modules/node-cache": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/node-cache/-/node-cache-5.1.2.tgz",
@@ -2217,6 +2076,8 @@
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz",
"integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==",
+ "optional": true,
+ "peer": true,
"bin": {
"node-gyp-build": "bin.js",
"node-gyp-build-optional": "optional.js",
@@ -2887,11 +2748,6 @@
"yarn": ">=1.9.4"
}
},
- "node_modules/type": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",
- "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg=="
- },
"node_modules/type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
@@ -2917,14 +2773,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/typedarray-to-buffer": {
- "version": "3.1.5",
- "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz",
- "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==",
- "dependencies": {
- "is-typedarray": "^1.0.0"
- }
- },
"node_modules/typescript": {
"version": "4.9.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
@@ -2990,6 +2838,8 @@
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz",
"integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==",
"hasInstallScript": true,
+ "optional": true,
+ "peer": true,
"dependencies": {
"node-gyp-build": "^4.3.0"
},
@@ -3026,22 +2876,6 @@
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
},
- "node_modules/websocket": {
- "version": "1.0.34",
- "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz",
- "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==",
- "dependencies": {
- "bufferutil": "^4.0.1",
- "debug": "^2.2.0",
- "es5-ext": "^0.10.50",
- "typedarray-to-buffer": "^3.1.5",
- "utf-8-validate": "^5.0.2",
- "yaeti": "^0.0.6"
- },
- "engines": {
- "node": ">=4.0.0"
- }
- },
"node_modules/whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
@@ -3139,14 +2973,6 @@
"node": ">=10"
}
},
- "node_modules/yaeti": {
- "version": "0.0.6",
- "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz",
- "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==",
- "engines": {
- "node": ">=0.10.32"
- }
- },
"node_modules/yamljs": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/yamljs/-/yamljs-0.3.0.tgz",
diff --git a/api-service/playground/package.json b/api-service/playground/package.json
index 35515b4fb..0c7a03a43 100644
--- a/api-service/playground/package.json
+++ b/api-service/playground/package.json
@@ -1,11 +1,8 @@
{
"name": "playground",
"version": "1.0.0",
- "license": "MIT",
"dependencies": {
"@devbookhq/sdk": "^2.6.74",
- "@supabase/supabase-js": "^2.12.0",
- "dotenv": "^16.0.3",
"express": "^4.18.2",
"morgan": "^1.10.0",
"node-cache": "^5.1.2",
@@ -29,4 +26,4 @@
"build": "./scripts/build.js",
"start": "node lib/server.js"
}
-}
+}
\ No newline at end of file
diff --git a/api-service/playground/src/data/createDeferredPromise.ts b/api-service/playground/src/data/createDeferredPromise.ts
deleted file mode 100644
index 724cc9eb0..000000000
--- a/api-service/playground/src/data/createDeferredPromise.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-export function createDeferredPromise<T = void>() {
- let resolve: ((value: T) => void)
- let reject: ((reason?: any) => void)
- const promise = new Promise<T>((res, rej) => {
- resolve = res
- reject = rej
- })
-
- return {
- resolve: resolve!,
- reject: reject!,
- promise,
- }
-}
diff --git a/api-service/playground/src/data/logOutput.ts b/api-service/playground/src/data/logOutput.ts
deleted file mode 100644
index 426e6b5ff..000000000
--- a/api-service/playground/src/data/logOutput.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-import { RealtimeChannel, createClient } from '@supabase/supabase-js'
-
-import { Database } from './supabase'
-import { createDeferredPromise } from './createDeferredPromise'
-
-import * as dotenv from 'dotenv'
-
-dotenv.config({
- path: '../../.env',
-})
-
-const client = createClient<Database>(process.env.NEXT_PUBLIC_SUPABASE_URL!, process.env.SUPABASE_SERVICE_ROLE_KEY!)
-
-export const projectsTable = 'projects'
-export const deploymentsTable = 'deployments'
-export const routesTable = 'routes'
-
-function checkForResponse(payloadList: any[]): string | null {
- // Get the last log from the deployment logs.
- const payload = payloadList.length > 0 ? payloadList[payloadList.length - 1] : undefined
-
- if (!payload) {
- return null
- }
-
- if (payload.type === 'tool' &&
- (payload.tool_name === 'AskHuman' || payload.tool_name === 'LetHumanChoose') &&
- payload.tool_output
- ) {
- return payload.tool_output
- }
- return null
-}
-
-export async function waitForLogOutput({ runID }: { runID: string }) {
- const { resolve, promise } = createDeferredPromise<string>()
-
- let updateSub: RealtimeChannel | undefined
-
- try {
- setTimeout(() => {
- resolve('Timeout')
- }, 3600000) // 1 hour
-
- // Subscribe to the changes in the deployment.
- updateSub = client.channel('any-server')
- .on('postgres_changes',
- {
- event: 'UPDATE',
- schema: 'public',
- table: deploymentsTable,
- filter: `id=eq.${runID}`,
- }, payload => {
- const response = checkForResponse(payload.new.logs as any)
- console.log('Wait for log output', response)
- if (response) {
- resolve(response)
- }
- })
- .subscribe()
-
- // We fetch the deployment and check if the response is already there
- // because it may arrive before we subscribed and that would mean the subscribe would never trigger.
- const deployment = await client
- .from(deploymentsTable)
- .select('*')
- .eq('id', runID)
- .single()
-
- const response = checkForResponse(deployment?.data?.logs as any)
-
- if (response) {
- resolve(response)
- }
- } catch (err) {
- resolve('Error retrieving log output')
- }
- const response = await promise
- updateSub?.unsubscribe()
- return response
-}
\ No newline at end of file
diff --git a/api-service/playground/src/data/supabase.ts b/api-service/playground/src/data/supabase.ts
deleted file mode 100644
index f28cb5146..000000000
--- a/api-service/playground/src/data/supabase.ts
+++ /dev/null
@@ -1,118 +0,0 @@
-export type Json =
- | string
- | number
- | boolean
- | null
- | { [key: string]: Json }
- | Json[]
-
-export interface Database {
- public: {
- Tables: {
- deployments: {
- Row: {
- created_at: string
- id: string
- logs: Json[] | null
- logs_raw: string | null
- project_id: string
- route_id: string
- state: Database["public"]["Enums"]["deployment_state"] | null
- url: string | null
- }
- Insert: {
- created_at?: string
- id?: string
- logs?: Json[] | null
- logs_raw?: string | null
- project_id: string
- route_id: string
- state?: Database["public"]["Enums"]["deployment_state"] | null
- url?: string | null
- }
- Update: {
- created_at?: string
- id?: string
- logs?: Json[] | null
- logs_raw?: string | null
- project_id?: string
- route_id?: string
- state?: Database["public"]["Enums"]["deployment_state"] | null
- url?: string | null
- }
- }
- projects: {
- Row: {
- created_at: string
- data: Json | null
- id: string
- name: string
- team_id: string
- }
- Insert: {
- created_at?: string
- data?: Json | null
- id?: string
- name?: string
- team_id: string
- }
- Update: {
- created_at?: string
- data?: Json | null
- id?: string
- name?: string
- team_id?: string
- }
- }
- teams: {
- Row: {
- created_at: string
- id: string
- is_default: boolean | null
- name: string
- }
- Insert: {
- created_at?: string
- id?: string
- is_default?: boolean | null
- name?: string
- }
- Update: {
- created_at?: string
- id?: string
- is_default?: boolean | null
- name?: string
- }
- }
- users_teams: {
- Row: {
- created_at: string
- team_id: string
- user_id: string
- }
- Insert: {
- created_at?: string
- team_id: string
- user_id: string
- }
- Update: {
- created_at?: string
- team_id?: string
- user_id?: string
- }
- }
- }
- Views: {
- [_ in never]: never
- }
- Functions: {
- [_ in never]: never
- }
- Enums: {
- deployment_state: "generating" | "deploying" | "finished" | "error"
- }
- CompositeTypes: {
- [_ in never]: never
- }
- }
-}
diff --git a/api-service/playground/src/data/toolsController.ts b/api-service/playground/src/data/toolsController.ts
deleted file mode 100644
index f9d47a13e..000000000
--- a/api-service/playground/src/data/toolsController.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import {
- Controller,
- Get,
- Route,
- Query,
-} from 'tsoa'
-import { waitForLogOutput } from './logOutput'
-
-interface ToolsLogOutput {
- response: string
-}
-
-@Route('tools')
-export class ToolsController extends Controller {
- @Get('logOutput')
- public async waitForLogOutput(
- @Query() runID: string,
- ): Promise<ToolsLogOutput> {
- const response = await waitForLogOutput({
- runID,
- })
-
- return {
- response,
- }
- }
-}
diff --git a/api-service/playground/src/generated/routes.ts b/api-service/playground/src/generated/routes.ts
index a82329f3f..d68fe511d 100644
--- a/api-service/playground/src/generated/routes.ts
+++ b/api-service/playground/src/generated/routes.ts
@@ -3,8 +3,6 @@
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
import { Controller, ValidationService, FieldErrors, ValidateError, TsoaRoute, HttpStatusCodeLiteral, TsoaResponse, fetchMiddlewares } from '@tsoa/runtime';
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
-import { ToolsController } from './../data/toolsController';
-// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
import { FilesystemController } from './../sessions/filesystemController';
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
import { ProcessController } from './../sessions/processesController';
@@ -15,14 +13,6 @@ import type { RequestHandler, Router } from 'express';
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
const models: TsoaRoute.Models = {
- "ToolsLogOutput": {
- "dataType": "refObject",
- "properties": {
- "response": {"dataType":"string","required":true},
- },
- "additionalProperties": false,
- },
- // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"EntryInfo": {
"dataType": "refObject",
"properties": {
@@ -138,31 +128,6 @@ export function RegisterRoutes(app: Router) {
// NOTE: If you do not see routes for all of your controllers in this file, then you might not have informed tsoa of where to look
// Please look into the "controllerPathGlobs" config option described in the readme: https://github.com/lukeautry/tsoa
// ###########################################################################################################
- app.get('/tools/logOutput',
- ...(fetchMiddlewares<RequestHandler>(ToolsController)),
- ...(fetchMiddlewares<RequestHandler>(ToolsController.prototype.waitForLogOutput)),
-
- function ToolsController_waitForLogOutput(request: any, response: any, next: any) {
- const args = {
- runID: {"in":"query","name":"runID","required":true,"dataType":"string"},
- };
-
- // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
-
- let validatedArgs: any[] = [];
- try {
- validatedArgs = getValidatedArgs(args, request, response);
-
- const controller = new ToolsController();
-
-
- const promise = controller.waitForLogOutput.apply(controller, validatedArgs as any);
- promiseHandler(controller, promise, response, undefined, next);
- } catch (err) {
- return next(err);
- }
- });
- // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.get('/sessions/:sessionID/filesystem/dir',
...(fetchMiddlewares<RequestHandler>(FilesystemController)),
...(fetchMiddlewares<RequestHandler>(FilesystemController.prototype.listFilesystemDir)),
diff --git a/api-service/playground/swagger.json b/api-service/playground/swagger.json
index 8a1a54167..fdd3925df 100644
--- a/api-service/playground/swagger.json
+++ b/api-service/playground/swagger.json
@@ -6,18 +6,6 @@
"requestBodies": {},
"responses": {},
"schemas": {
- "ToolsLogOutput": {
- "properties": {
- "response": {
- "type": "string"
- }
- },
- "required": [
- "response"
- ],
- "type": "object",
- "additionalProperties": false
- },
"EntryInfo": {
"properties": {
"isDir": {
@@ -230,34 +218,6 @@
},
"openapi": "3.0.0",
"paths": {
- "/tools/logOutput": {
- "get": {
- "operationId": "WaitForLogOutput",
- "responses": {
- "200": {
- "description": "Ok",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ToolsLogOutput"
- }
- }
- }
- }
- },
- "security": [],
- "parameters": [
- {
- "in": "query",
- "name": "runID",
- "required": true,
- "schema": {
- "type": "string"
- }
- }
- ]
- }
- },
"/sessions/{sessionID}/filesystem/dir": {
"get": {
"operationId": "ListFilesystemDir",
diff --git a/api-service/playground_client/__init__.py b/api-service/playground_client/__init__.py
index 93971009e..a0fea5b24 100644
--- a/api-service/playground_client/__init__.py
+++ b/api-service/playground_client/__init__.py
@@ -42,6 +42,5 @@ from playground_client.models.process_response import ProcessResponse
from playground_client.models.read_filesystem_file_response import ReadFilesystemFileResponse
from playground_client.models.session_response import SessionResponse
from playground_client.models.start_process_params import StartProcessParams
-from playground_client.models.tools_log_output import ToolsLogOutput
from playground_client.models.write_filesystem_file_request import WriteFilesystemFileRequest
from playground_client.models.write_process_stdin_request import WriteProcessStdinRequest
diff --git a/api-service/playground_client/api/default_api.py b/api-service/playground_client/api/default_api.py
index 10620d8b0..5c10cf5e2 100644
--- a/api-service/playground_client/api/default_api.py
+++ b/api-service/playground_client/api/default_api.py
@@ -27,7 +27,6 @@ from playground_client.models.process_response import ProcessResponse
from playground_client.models.read_filesystem_file_response import ReadFilesystemFileResponse
from playground_client.models.session_response import SessionResponse
from playground_client.models.start_process_params import StartProcessParams
-from playground_client.models.tools_log_output import ToolsLogOutput
from playground_client.models.write_filesystem_file_request import WriteFilesystemFileRequest
from playground_client.models.write_process_stdin_request import WriteProcessStdinRequest
@@ -1526,147 +1525,6 @@ class DefaultApi(object):
collection_formats=_collection_formats,
_request_auth=_params.get('_request_auth'))
- @validate_arguments
- def wait_for_log_output(self, run_id : StrictStr, **kwargs) -> ToolsLogOutput: # noqa: E501
- """wait_for_log_output # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.wait_for_log_output(run_id, async_req=True)
- >>> result = thread.get()
-
- :param run_id: (required)
- :type run_id: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: ToolsLogOutput
- """
- kwargs['_return_http_data_only'] = True
- return self.wait_for_log_output_with_http_info(run_id, **kwargs) # noqa: E501
-
- @validate_arguments
- def wait_for_log_output_with_http_info(self, run_id : StrictStr, **kwargs): # noqa: E501
- """wait_for_log_output # noqa: E501
-
- This method makes a synchronous HTTP request by default. To make an
- asynchronous HTTP request, please pass async_req=True
-
- >>> thread = api.wait_for_log_output_with_http_info(run_id, async_req=True)
- >>> result = thread.get()
-
- :param run_id: (required)
- :type run_id: str
- :param async_req: Whether to execute the request asynchronously.
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
- :param _request_timeout: timeout setting for this request. If one
- number provided, it will be total request
- timeout. It can also be a pair (tuple) of
- (connection, read) timeouts.
- :param _request_auth: set to override the auth_settings for an a single
- request; this effectively ignores the authentication
- in the spec for a single request.
- :type _request_auth: dict, optional
- :type _content_type: string, optional: force content-type for the request
- :return: Returns the result object.
- If the method is called asynchronously,
- returns the request thread.
- :rtype: tuple(ToolsLogOutput, status_code(int), headers(HTTPHeaderDict))
- """
-
- _params = locals()
-
- _all_params = [
- 'run_id'
- ]
- _all_params.extend(
- [
- 'async_req',
- '_return_http_data_only',
- '_preload_content',
- '_request_timeout',
- '_request_auth',
- '_content_type',
- '_headers'
- ]
- )
-
- # validate the arguments
- for _key, _val in _params['kwargs'].items():
- if _key not in _all_params:
- raise ApiTypeError(
- "Got an unexpected keyword argument '%s'"
- " to method wait_for_log_output" % _key
- )
- _params[_key] = _val
- del _params['kwargs']
-
- _collection_formats = {}
-
- # process the path parameters
- _path_params = {}
-
- # process the query parameters
- _query_params = []
- if _params.get('run_id') is not None: # noqa: E501
- _query_params.append(('runID', _params['run_id']))
-
- # process the header parameters
- _header_params = dict(_params.get('_headers', {}))
-
- # process the form parameters
- _form_params = []
- _files = {}
-
- # process the body parameter
- _body_params = None
-
- # set the HTTP header `Accept`
- _header_params['Accept'] = self.api_client.select_header_accept(
- ['application/json']) # noqa: E501
-
- # authentication setting
- _auth_settings = [] # noqa: E501
-
- _response_types_map = {
- '200': "ToolsLogOutput",
- }
-
- return self.api_client.call_api(
- '/tools/logOutput', 'GET',
- _path_params,
- _query_params,
- _header_params,
- body=_body_params,
- post_params=_form_params,
- files=_files,
- response_types_map=_response_types_map,
- auth_settings=_auth_settings,
- async_req=_params.get('async_req'),
- _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
- _preload_content=_params.get('_preload_content', True),
- _request_timeout=_params.get('_request_timeout'),
- collection_formats=_collection_formats,
- _request_auth=_params.get('_request_auth'))
-
@validate_arguments
def write_filesystem_file(self, session_id : StrictStr, path : StrictStr, write_filesystem_file_request : WriteFilesystemFileRequest, **kwargs) -> None: # noqa: E501
"""write_filesystem_file # noqa: E501
diff --git a/api-service/playground_client/docs/DefaultApi.md b/api-service/playground_client/docs/DefaultApi.md
index 96c11a87c..e37fb0a22 100644
--- a/api-service/playground_client/docs/DefaultApi.md
+++ b/api-service/playground_client/docs/DefaultApi.md
@@ -14,7 +14,6 @@ Method | HTTP request | Description
[**read_filesystem_file**](DefaultApi.md#read_filesystem_file) | **GET** /sessions/{sessionID}/filesystem/file |
[**start_process**](DefaultApi.md#start_process) | **POST** /sessions/{sessionID}/processes |
[**stop_process**](DefaultApi.md#stop_process) | **DELETE** /sessions/{sessionID}/processes/{processID} |
-[**wait_for_log_output**](DefaultApi.md#wait_for_log_output) | **GET** /tools/logOutput |
[**write_filesystem_file**](DefaultApi.md#write_filesystem_file) | **PUT** /sessions/{sessionID}/filesystem/file |
[**write_process_stdin**](DefaultApi.md#write_process_stdin) | **POST** /sessions/{sessionID}/processes/{processID}/stdin |
@@ -643,67 +642,6 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-# **wait_for_log_output**
-> ToolsLogOutput wait_for_log_output(run_id)
-
-
-
-### Example
-
-```python
-from __future__ import print_function
-import time
-import os
-import playground_client
-from playground_client.rest import ApiException
-from pprint import pprint
-# Defining the host is optional and defaults to https://localhost:49160
-# See configuration.py for a list of all supported configuration parameters.
-configuration = playground_client.Configuration(
- host = "https://localhost:49160"
-)
-
-
-# Enter a context with an instance of the API client
-with playground_client.ApiClient(configuration) as api_client:
- # Create an instance of the API class
- api_instance = playground_client.DefaultApi(api_client)
- run_id = 'run_id_example' # str |
-
- try:
- api_response = api_instance.wait_for_log_output(run_id)
- print("The response of DefaultApi->wait_for_log_output:\n")
- pprint(api_response)
- except Exception as e:
- print("Exception when calling DefaultApi->wait_for_log_output: %s\n" % e)
-```
-
-### Parameters
-
-Name | Type | Description | Notes
-------------- | ------------- | ------------- | -------------
- **run_id** | **str**| |
-
-### Return type
-
-[**ToolsLogOutput**](ToolsLogOutput.md)
-
-### Authorization
-
-No authorization required
-
-### HTTP request headers
-
- - **Content-Type**: Not defined
- - **Accept**: application/json
-
-### HTTP response details
-| Status code | Description | Response headers |
-|-------------|-------------|------------------|
-**200** | Ok | - |
-
-[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
-
# **write_filesystem_file**
> write_filesystem_file(session_id, path, write_filesystem_file_request)
diff --git a/api-service/playground_client/docs/ToolsLogOutput.md b/api-service/playground_client/docs/ToolsLogOutput.md
deleted file mode 100644
index 0b041952c..000000000
--- a/api-service/playground_client/docs/ToolsLogOutput.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# ToolsLogOutput
-
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**response** | **str** | |
-
-## Example
-
-```python
-from playground_client.models.tools_log_output import ToolsLogOutput
-
-# TODO update the JSON string below
-json = "{}"
-# create an instance of ToolsLogOutput from a JSON string
-tools_log_output_instance = ToolsLogOutput.from_json(json)
-# print the JSON string representation of the object
-print ToolsLogOutput.to_json()
-
-# convert the object into a dict
-tools_log_output_dict = tools_log_output_instance.to_dict()
-# create an instance of ToolsLogOutput from a dict
-tools_log_output_form_dict = tools_log_output.from_dict(tools_log_output_dict)
-```
-[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
-
diff --git a/api-service/playground_client/models/__init__.py b/api-service/playground_client/models/__init__.py
index 0860d861b..6f28cbd47 100644
--- a/api-service/playground_client/models/__init__.py
+++ b/api-service/playground_client/models/__init__.py
@@ -27,6 +27,5 @@ from playground_client.models.process_response import ProcessResponse
from playground_client.models.read_filesystem_file_response import ReadFilesystemFileResponse
from playground_client.models.session_response import SessionResponse
from playground_client.models.start_process_params import StartProcessParams
-from playground_client.models.tools_log_output import ToolsLogOutput
from playground_client.models.write_filesystem_file_request import WriteFilesystemFileRequest
from playground_client.models.write_process_stdin_request import WriteProcessStdinRequest
diff --git a/api-service/playground_client/models/tools_log_output.py b/api-service/playground_client/models/tools_log_output.py
deleted file mode 100644
index 5204de95a..000000000
--- a/api-service/playground_client/models/tools_log_output.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# coding: utf-8
-
-"""
- playground
-
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import annotations
-from inspect import getfullargspec
-import pprint
-import re # noqa: F401
-import json
-
-
-
-from pydantic import BaseModel, StrictStr
-
-class ToolsLogOutput(BaseModel):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
- """
- response: StrictStr = ...
- __properties = ["response"]
-
- class Config:
- allow_population_by_field_name = True
- validate_assignment = True
-
- def to_str(self) -> str:
- """Returns the string representation of the model using alias"""
- return pprint.pformat(self.dict(by_alias=True))
-
- def to_json(self) -> str:
- """Returns the JSON representation of the model using alias"""
- return json.dumps(self.to_dict())
-
- @classmethod
- def from_json(cls, json_str: str) -> ToolsLogOutput:
- """Create an instance of ToolsLogOutput from a JSON string"""
- return cls.from_dict(json.loads(json_str))
-
- def to_dict(self):
- """Returns the dictionary representation of the model using alias"""
- _dict = self.dict(by_alias=True,
- exclude={
- },
- exclude_none=True)
- return _dict
-
- @classmethod
- def from_dict(cls, obj: dict) -> ToolsLogOutput:
- """Create an instance of ToolsLogOutput from a dict"""
- if obj is None:
- return None
-
- if type(obj) is not dict:
- return ToolsLogOutput.parse_obj(obj)
-
- # raise errors for additional fields in the input
- for _key in obj.keys():
- if _key not in cls.__properties:
- raise ValueError("Error due to additional fields (not defined in ToolsLogOutput) in the input: " + obj)
-
- _obj = ToolsLogOutput.parse_obj({
- "response": obj.get("response")
- })
- return _obj
-
diff --git a/api-service/playground_client/test/test_default_api.py b/api-service/playground_client/test/test_default_api.py
index 31844860d..96722de6c 100644
--- a/api-service/playground_client/test/test_default_api.py
+++ b/api-service/playground_client/test/test_default_api.py
@@ -88,12 +88,6 @@ class TestDefaultApi(unittest.TestCase):
"""
pass
- def test_wait_for_log_output(self):
- """Test case for wait_for_log_output
-
- """
- pass
-
def test_write_filesystem_file(self):
"""Test case for write_filesystem_file
diff --git a/api-service/playground_client/test/test_tools_log_output.py b/api-service/playground_client/test/test_tools_log_output.py
deleted file mode 100644
index 4115f7b32..000000000
--- a/api-service/playground_client/test/test_tools_log_output.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# coding: utf-8
-
-"""
- playground
-
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
-
- The version of the OpenAPI document: 1.0.0
- Generated by: https://openapi-generator.tech
-"""
-
-
-from __future__ import absolute_import
-
-import unittest
-import datetime
-
-import playground_client
-from playground_client.models.tools_log_output import ToolsLogOutput # noqa: E501
-from playground_client.rest import ApiException
-
-class TestToolsLogOutput(unittest.TestCase):
- """ToolsLogOutput unit test stubs"""
-
- def setUp(self):
- pass
-
- def tearDown(self):
- pass
-
- def make_instance(self, include_optional):
- """Test ToolsLogOutput
- include_option is a boolean, when False only required
- params are included, when True both required and
- optional params are included """
- # uncomment below to create an instance of `ToolsLogOutput`
- """
- model = playground_client.models.tools_log_output.ToolsLogOutput() # noqa: E501
- if include_optional :
- return ToolsLogOutput(
- response = ''
- )
- else :
- return ToolsLogOutput(
- response = '',
- )
- """
-
- def testToolsLogOutput(self):
- """Test ToolsLogOutput"""
- # inst_req_only = self.make_instance(include_optional=False)
- # inst_req_and_optional = self.make_instance(include_optional=True)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/api-service/playground_client_README.md b/api-service/playground_client_README.md
index 76b8c2c34..3e73372cf 100644
--- a/api-service/playground_client_README.md
+++ b/api-service/playground_client_README.md
@@ -74,7 +74,6 @@ Class | Method | HTTP request | Description
*DefaultApi* | [**read_filesystem_file**](playground_client/docs/DefaultApi.md#read_filesystem_file) | **GET** /sessions/{sessionID}/filesystem/file |
*DefaultApi* | [**start_process**](playground_client/docs/DefaultApi.md#start_process) | **POST** /sessions/{sessionID}/processes |
*DefaultApi* | [**stop_process**](playground_client/docs/DefaultApi.md#stop_process) | **DELETE** /sessions/{sessionID}/processes/{processID} |
-*DefaultApi* | [**wait_for_log_output**](playground_client/docs/DefaultApi.md#wait_for_log_output) | **GET** /tools/logOutput |
*DefaultApi* | [**write_filesystem_file**](playground_client/docs/DefaultApi.md#write_filesystem_file) | **PUT** /sessions/{sessionID}/filesystem/file |
*DefaultApi* | [**write_process_stdin**](playground_client/docs/DefaultApi.md#write_process_stdin) | **POST** /sessions/{sessionID}/processes/{processID}/stdin |
@@ -94,7 +93,6 @@ Class | Method | HTTP request | Description
- [ReadFilesystemFileResponse](playground_client/docs/ReadFilesystemFileResponse.md)
- [SessionResponse](playground_client/docs/SessionResponse.md)
- [StartProcessParams](playground_client/docs/StartProcessParams.md)
- - [ToolsLogOutput](playground_client/docs/ToolsLogOutput.md)
- [WriteFilesystemFileRequest](playground_client/docs/WriteFilesystemFileRequest.md)
- [WriteProcessStdinRequest](playground_client/docs/WriteProcessStdinRequest.md)
diff --git a/components/Editor/Sidebar/Agent/index.tsx b/components/Editor/Sidebar/Agent/index.tsx
index d1fdaa68a..e267f58e9 100644
--- a/components/Editor/Sidebar/Agent/index.tsx
+++ b/components/Editor/Sidebar/Agent/index.tsx
@@ -43,7 +43,6 @@ function Agent({
run,
}: Props) {
const [selectedTab, setSelectedTab] = useState(0)
- // const client = useSupabaseClient<Database>()
const tabsCss = useTabs(tabsProps)
const [selectors] = useStateStore()
const router = useRouter()
@@ -52,28 +51,6 @@ function Agent({
const modelConfig = selectors.use.getSelectedModelConfig()()
const missingCreds = modelConfig ? getMissingCreds(modelConfig?.provider, creds) : []
- // async function saveAnswer({
- // logID,
- // answer,
- // toolName,
- // }: { logID: string, answer: string, toolName: ToolName }) {
- // if (!agentRun?.runID) return
- // if (!logs) return
-
- // const modifiedLogs = produce(logs, ls => {
- // const log = ls.find(l => l.id === logID)
- // if (log && log.type === LogType.Tool && log.tool_name === toolName) {
- // log.tool_output = answer
- // }
- // })
-
- // await client
- // .from(deploymentsTable)
- // .update({ logs: modifiedLogs as any })
- // .eq('id', agentRun.runID)
- // .single()
- // }
-
async function onEdit(edit: StepEdit) {
if (!steps || !agentRun) return
const editedSteps = AgentConnection.resolveStepsEdit(steps, edit)
diff --git a/components/Editor/Sidebar/index.tsx b/components/Editor/Sidebar/index.tsx
index 0762d09af..478ad3f3e 100644
--- a/components/Editor/Sidebar/index.tsx
+++ b/components/Editor/Sidebar/index.tsx
@@ -1,5 +1,5 @@
import clsx from 'clsx'
-import { projects, deployments } from '@prisma/client'
+import { projects } from '@prisma/client'
import { useStateStore } from 'state/StoreProvider'
import { getModelArgs } from 'state/model'
@@ -16,9 +16,7 @@ import { MenuSection } from '../SidebarMenu'
export interface Props {
- project: projects & {
- deployments: deployments[];
- }
+ project: projects
activeMenuSection?: MenuSection
}
@@ -39,9 +37,7 @@ function Sidebar({
const [creds] = useModelProviderArgs()
- // TODO: Change logs to steps in db
- const lastRunLogs = project.deployments.length === 1 ? project.deployments[0] : undefined
- const steps = newSteps || lastRunLogs?.logs as Step[] | undefined
+ const steps = newSteps || project.development_logs as unknown as Step[] | undefined
async function run() {
if (!modelConfig) {
diff --git a/components/Editor/index.tsx b/components/Editor/index.tsx
index aa91606bc..b4755df9b 100644
--- a/components/Editor/index.tsx
+++ b/components/Editor/index.tsx
@@ -1,5 +1,5 @@
import { useCallback, useRef, useState } from 'react'
-import { projects, deployments } from '@prisma/client'
+import { projects } from '@prisma/client'
import Splitter, { GutterTheme } from '@devbookhq/splitter'
import { useLocalStorage } from 'usehooks-ts'
@@ -9,9 +9,7 @@ import SidebarMenu, { MenuSection } from './SidebarMenu'
import Template from './Template'
export interface Props {
- project: projects & {
- deployments: deployments[];
- }
+ project: projects
}
function Editor({ project }: Props) {
diff --git a/db/supabase.ts b/db/supabase.ts
index a845a6afc..308fd094d 100644
--- a/db/supabase.ts
+++ b/db/supabase.ts
@@ -11,6 +11,7 @@ export interface Database {
Tables: {
deployments: {
Row: {
+ config: Json | null
created_at: string
id: string
logs: Json[] | null
@@ -21,6 +22,7 @@ export interface Database {
url: string | null
}
Insert: {
+ config?: Json | null
created_at?: string
id?: string
logs?: Json[] | null
@@ -31,6 +33,7 @@ export interface Database {
url?: string | null
}
Update: {
+ config?: Json | null
created_at?: string
id?: string
logs?: Json[] | null
@@ -45,6 +48,7 @@ export interface Database {
Row: {
created_at: string
data: Json | null
+ development_logs: Json[] | null
id: string
name: string
team_id: string
@@ -52,6 +56,7 @@ export interface Database {
Insert: {
created_at?: string
data?: Json | null
+ development_logs?: Json[] | null
id?: string
name?: string
team_id: string
@@ -59,6 +64,7 @@ export interface Database {
Update: {
created_at?: string
data?: Json | null
+ development_logs?: Json[] | null
id?: string
name?: string
team_id?: string
diff --git a/pages/[projectID].tsx b/pages/[projectID].tsx
index ad1386fe6..9ebf31615 100644
--- a/pages/[projectID].tsx
+++ b/pages/[projectID].tsx
@@ -3,7 +3,7 @@ import { createServerSupabaseClient } from '@supabase/auth-helpers-nextjs'
import { useSupabaseClient } from '@supabase/auth-helpers-react'
import type { ParsedUrlQuery } from 'querystring'
-import { prisma, projects, deployments } from 'db/prisma'
+import { prisma, projects } from 'db/prisma'
import Editor from 'components/Editor'
import { StoreProvider } from 'state/StoreProvider'
import { Database } from 'db/supabase'
@@ -50,14 +50,6 @@ export const getServerSideProps: GetServerSideProps<Props, PathProps> = async (c
equals: projectID,
},
},
- include: {
- deployments: {
- take: 1,
- orderBy: {
- created_at: 'desc',
- },
- },
- },
},
},
},
@@ -85,9 +77,7 @@ export const getServerSideProps: GetServerSideProps<Props, PathProps> = async (c
}
interface Props {
- project: projects & {
- deployments: deployments[];
- }
+ project: projects
}
function EditorPage({ project }: Props) {
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index 22655ad7c..f2f1d779d 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -102,7 +102,6 @@ model refresh_tokens {
@@index([instance_id, user_id])
@@index([parent])
@@index([session_id, revoked])
- @@index([token])
@@schema("auth")
}
@@ -260,19 +259,21 @@ model deployments {
state deployment_state?
url String?
logs_raw String? @default("")
+ config Json?
projects projects @relation(fields: [project_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
@@schema("public")
}
model projects {
- id String @id(map: "ai_api_pkey") @default("")
- created_at DateTime @default(now()) @db.Timestamptz(6)
- data Json?
- team_id String @db.Uuid
- name String @default("")
- deployments deployments[]
- teams teams @relation(fields: [team_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
+ id String @id(map: "ai_api_pkey") @default("")
+ created_at DateTime @default(now()) @db.Timestamptz(6)
+ data Json?
+ team_id String @db.Uuid
+ name String @default("")
+ development_logs Json[]
+ deployments deployments[]
+ teams teams @relation(fields: [team_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
@@schema("public")
}
@@ -288,8 +289,10 @@ model flow_state {
provider_refresh_token String?
created_at DateTime? @db.Timestamptz(6)
updated_at DateTime? @db.Timestamptz(6)
+ authentication_method String
@@index([auth_code], map: "idx_auth_code")
+ @@index([user_id, authentication_method], map: "idx_user_id_auth_method")
@@schema("auth")
}
diff --git a/supabase/migrations/1680452567_name.sql b/supabase/migrations/1680452567_name.sql
index 88cf74c8c..0e3614e25 100644
--- a/supabase/migrations/1680452567_name.sql
+++ b/supabase/migrations/1680452567_name.sql
@@ -88,14 +88,13 @@ CREATE TABLE "public"."deployments" (
"route_id" "text",
"state" "public"."deployment_state",
"url" "text",
- "logs_raw" "text" DEFAULT ''::"text"
+ "logs_raw" "text" DEFAULT ''::"text",
+ "config" "jsonb"
);
-ALTER publication supabase_realtime
-ADD TABLE "public"."deployments";
-
ALTER TABLE ONLY "public"."deployments" REPLICA IDENTITY FULL;
+
ALTER TABLE "public"."deployments" OWNER TO "postgres";
--
@@ -107,12 +106,12 @@ CREATE TABLE "public"."projects" (
"created_at" timestamp with time zone DEFAULT "now"() NOT NULL,
"data" "jsonb",
"team_id" "uuid" NOT NULL,
- "name" "text" DEFAULT ''::"text" NOT NULL
+ "name" "text" DEFAULT ''::"text" NOT NULL,
+ "development_logs" "jsonb"[]
);
-ALTER TABLE "public"."projects" OWNER TO "postgres";
-
+ALTER TABLE "public"."projects" OWNER TO "postgres";
--
-- Name: teams; Type: TABLE; Schema: public; Owner: postgres
@@ -125,9 +124,8 @@ CREATE TABLE "public"."teams" (
"name" "text" DEFAULT ''::"text" NOT NULL
);
-ALTER TABLE "public"."teams" OWNER TO "postgres";
-
+ALTER TABLE "public"."teams" OWNER TO "postgres";
--
-- Name: users_teams; Type: TABLE; Schema: public; Owner: postgres
@@ -142,7 +140,6 @@ CREATE TABLE "public"."users_teams" (
ALTER TABLE "public"."users_teams" OWNER TO "postgres";
-
--
-- Name: projects ai_api_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
@@ -944,5 +941,4 @@ ALTER DEFAULT PRIVILEGES FOR ROLE "postgres" IN SCHEMA "public" GRANT ALL ON TAB
-- PostgreSQL database dump complete
--
-
RESET ALL;