Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Add prompt editing [WIP]

Tomas Valentafc8b4a73d897
diff --git a/api-service/app.py b/api-service/app.py
index 8e73721f8..84b7e1b41 100644
--- a/api-service/app.py
+++ b/api-service/app.py
@@ -51,15 +51,12 @@ async def generate():
run_id = str(uuid.uuid4())
project_id = body["projectID"]
route_id = body["routeID"]
- blocks = body["blocks"]
- method = body["method"]
- route = body["route"]
model_config = body["modelConfig"]
prompt = body["prompt"]
- pprint("+++ Blocks:")
- pprint(blocks)
- pprint("--- Blocks:")
+ pprint("+++ Prompt:")
+ pprint(prompt)
+ pprint("--- Prompt:")
await db.create_deployment(run_id=run_id, project_id=project_id, route_id=route_id)
playground = None
@@ -75,21 +72,17 @@ async def generate():
)
# Create a new instance of code generator
- cg = Codegen.from_tools_and_database(
+ cg = Codegen(
# The order in which we pass tools HAS an effect on the LLM behaviour.
tools=list(tools),
model_config=model_config,
database=db,
+ prompt=prompt,
)
# Generate the code
print("Generating...", flush=True)
- await cg.generate(
- run_id=run_id,
- route=route,
- method=method,
- blocks=blocks,
- )
+ await cg.generate(run_id=run_id)
deploy_url: str | None = None
# Disable deployment if there AWS creds are not present
diff --git a/api-service/codegen/codegen.py b/api-service/codegen/codegen.py
index 32ebfa248..ff5c71776 100644
--- a/api-service/codegen/codegen.py
+++ b/api-service/codegen/codegen.py
@@ -1,8 +1,8 @@
from typing import (
List,
- List,
+ Literal,
+ TypedDict,
Any,
- Dict,
ClassVar,
Sequence,
)
@@ -20,100 +20,83 @@ from langchain.tools import BaseTool
from models import get_model, ModelConfig
from database import Database
from codegen.agent import CodegenAgent, CodegenAgentExecutor
-from codegen.prompt import (
- SYSTEM_PREFIX,
- SYSTEM_SUFFIX,
- SYSTEM_FORMAT_INSTRUCTIONS,
- HUMAN_INSTRUCTIONS_SUFFIX,
- get_human_instructions_prefix,
-)
+
+
+class PromptPart(TypedDict):
+ role: Literal["user", "system"]
+ type: str
+ content: str
class Codegen(BaseModel):
- input_variables: ClassVar[List[str]] = ["input", "agent_scratchpad", "method"]
+ input_variables: ClassVar[List[str]] = ["input", "agent_scratchpad"]
_agent: Agent = PrivateAttr()
_agent_executor: AgentExecutor = PrivateAttr()
_tools: Sequence[BaseTool] = PrivateAttr()
_llm: BaseLanguageModel = PrivateAttr()
_database: Database = PrivateAttr()
+ _prompt: List[PromptPart] = PrivateAttr()
_callback_manager: BaseCallbackManager = PrivateAttr()
def __init__(
self,
database: Database,
- callback_manager: BaseCallbackManager,
tools: Sequence[BaseTool],
- llm: BaseLanguageModel,
- agent: Agent,
+ model_config: ModelConfig,
+ prompt: List[PromptPart],
**kwargs: Any,
) -> None:
super().__init__(**kwargs)
self._database = database
- self._callback_manager = callback_manager
self._tools = tools
- self._llm = llm
- self._agent = agent
-
- self._agent_executor = CodegenAgentExecutor.from_agent_and_tools(
- agent=self._agent,
- tools=self._tools,
- verbose=True,
- callback_manager=self._callback_manager,
- )
-
- def tool_names(self):
- return [tool.name for tool in self._tools]
+ self._prompt = prompt
- @classmethod
- def from_tools_and_database(
- cls,
- tools: Sequence[BaseTool],
- model_config: ModelConfig,
- database: Database,
- ):
- callback_manager = AsyncCallbackManager(
- [
- StreamingStdOutCallbackHandler(),
- ]
+ self._callback_manager = AsyncCallbackManager(
+ [StreamingStdOutCallbackHandler()]
)
- # Assign custom callback manager to custom tools
+ # Assign custom callback manager to tools
for tool in tools:
- tool.callback_manager = callback_manager
+ tool.callback_manager = self._callback_manager
# Create the LLM
- llm = get_model(model_config, callback_manager)
+ self._llm = get_model(model_config, self._callback_manager)
print(
f"Using LLM '{model_config['provider']}' with args:\n{model_config['args']}"
)
# Create CodegenAgent
- agent = CodegenAgent.from_llm_and_tools(
- llm=llm,
+ self._agent = CodegenAgent.from_llm_and_tools(
+ llm=self._llm,
tools=tools,
- prefix=SYSTEM_PREFIX,
- suffix=SYSTEM_SUFFIX,
- format_instructions=SYSTEM_FORMAT_INSTRUCTIONS,
+ prefix=self.get_prompt_part("system", "prefix"),
+ format_instructions=self.get_prompt_part("system", "formatInstructions"),
+ suffix=self.get_prompt_part("system", "suffix"),
input_variables=Codegen.input_variables,
- callback_manager=callback_manager,
+ callback_manager=self._callback_manager,
)
- return cls(
- database=database,
- callback_manager=callback_manager,
- tools=tools,
- llm=llm,
- agent=agent,
+ self._agent_executor = CodegenAgentExecutor.from_agent_and_tools(
+ agent=self._agent,
+ tools=self._tools,
+ verbose=True,
+ callback_manager=self._callback_manager,
)
- async def generate(
- self,
- run_id: str,
- route: str,
- method: str,
- blocks: List[Dict],
- ):
+ def tool_names(self):
+ return [tool.name for tool in self._tools]
+
+ def get_prompt_part(self, role: Literal["user", "system"], type: str):
+ return next(
+ (
+ prompt
+ for prompt in self._prompt
+ if prompt["role"] == role and prompt["type"] == type
+ ),
+ )["content"]
+
+ async def generate(self, run_id: str):
self._callback_manager.add_handler(
LogsCallbackHandler(
database=self._database,
@@ -122,58 +105,12 @@ class Codegen(BaseModel):
)
)
- # Retrieve the description block.
- description_block: Dict[str, str] = next(
- b for b in blocks if b.get("type") == "Description"
- )
-
- # Retrueve the block describing the incoming request payload.
- incoming_request_block: Dict[str, str] | None = next(
- (b for b in blocks if b.get("type") == "RequestBody" and b.get("content")),
- None,
- )
-
- # Retrieve the instructions block.
- instructions_block: Dict[str, str] | None = next(
- (b for b in blocks if b.get("type") == "Instructions" and b.get("content")),
- None,
- )
-
- input_vars = {
- "description": description_block["content"],
- "request_body": f"{{\n{incoming_request_block['content']}\n}}"
- if incoming_request_block
- else None,
- "route": route,
- "method": method,
- }
-
- instructions = "Here are the instructions:"
-
- # Append the premade prefix instructions.
- for instruction in get_human_instructions_prefix(
- has_request_body=bool(incoming_request_block)
- ):
- instructions += "\n" + f"\n- {instruction['content']}"
-
- # Append the use instructions
- if instructions_block:
- instructions += (
- + "\nHere are the required implementation instructions:\n"
- + instructions_block["content"]
- )
-
- # Use the values to format the instruction string.
- instructions = instructions.format(**input_vars)
-
- print("Instructions:\n", instructions)
+ # TODO: Extract input instructions from prompt var
- # Append the premade suffix instructions.
- for inst in HUMAN_INSTRUCTIONS_SUFFIX:
- instructions += f"\n{inst}"
+ self._prompt
print("Running executor...")
await self._agent_executor.arun(
agent_scratchpad="",
- input=instructions,
+ input=self.get_prompt_part("user", "prefix"),
)
diff --git a/api-service/codegen/prompt.py b/api-service/codegen/prompt.py
deleted file mode 100644
index d37cdb996..000000000
--- a/api-service/codegen/prompt.py
+++ /dev/null
@@ -1,101 +0,0 @@
-# - ALWAYS use `import` to import packages.
-# - Make sure any code you generate is JSON escaped.
-SYSTEM_PREFIX = """You are an AI JavaScript developer assistant.
-- You are building an Express server that handles REST API.
-- The `express` package is already installed.
-- Follow the user's instructions carefully & to the letter.
-- Minimize any other prose.
-- You have access to the following tools:"""
-
-SYSTEM_FORMAT_INSTRUCTIONS = """The way you use the tools is by specifying a XML snippet.
-The XML snippet MUST have a `<action tool="$TOOL_NAME">$INPUT</action>` element with the name of the tool in the `tool` attribute and input for the tool inside the XML tag.
-
-Here is an example of a valid XML snippet:
-<action tool="$TOOL_NAME">
-$INPUT
-</action>
-
-ALWAYS use the following format:
-
-
-Thought: you should always think about what to do
-Action:
-<action tool="$TOOL_NAME">
-$INPUT
-</action>
-Observation: the result of the action
-... (this Thought/Action/Observation can repeat N times)
-Thought: I now know the final server code and can show it.
-Final Answer: the final answer"""
-
-# SYSTEM_SUFFIX = """Begin! Reminder to NEVER use tools you don't have access. Reminder to ALWAYS use the exact the action `Final Answer` when you know the final answer."""
-SYSTEM_SUFFIX = ""
-
-
-def get_human_instructions_prefix(has_request_body: bool = False):
- yield from [
- {
- "content": """The handler you are building should do the following: {description}""",
- },
- # {
- # "content": """Do not try to come up with solutions and code if you do not know. Instead, use the tool `AskHuman` to ask for help.""",
- # },
- # {
- # "content": """If you think there might be multiple paths forward, use the tool `LetHumanChoose` to choose from them.""",
- # },
- ]
-
- if has_request_body:
- yield {
- "content": """The incoming request body is JSON that looks like this:\n{request_body}""",
- }
-
- yield from [
- {
- "content": """Use this starting template:
-```
-import express from 'express';
-const app = express();
-const port = 3000;
-app.use(express.json())
-
-// TODO: Implement the {method} handler here
-
-app.listen(port, async () => {{
- console.log(`Server listening on port ${{port}}`)
-}})
-```""",
- },
- {
- "content": """The HTTP request handler is of type {method}""",
- },
- {
- "content": """The request handler MUST be on the route `{route}`""",
- },
- {
- "content": """Do not forget to use async and await""",
- },
- {
- "content": """Always test that the generated server works without bugs and errors as required by running the code and making mock `curl` requests to the server""",
- },
- {
- "content": """Generate the full required server code""",
- },
- ]
-
-
-HUMAN_INSTRUCTIONS_SUFFIX = [
- # "Do not forget to use async and await",
- # "Think about it and plan your work first.",
- # "If you think there might be multiple paths forward, use the tool `LetHumanChoose` to choose from them. Do not be confident in picking the right path forward instead of the human",
- # "If something is not working and you do not know why, use the tool `AskHuman` to ask for help",
- # "Do not use third party packages without first asking the human for permission or presenting the human with multiple alternative options",
- # # "If you do not know how to use an NPM package, DO NOT COME UP WITH IMAGINARY CODE, instead use the tool `AskHuman` to ask for help",
- # "ALWAYS run the code before you submit the answer",
- # "Generate the full required server code and and make sure it runs without any errors",
- # "ALWAYS test that the generated server works as required by making mock `curl` requests to the server",
- # # "Once all works without any bugs and errors, write the code to the file",
- # # "Deploy the code",
- # "Once you are done, output the final code as the 'Final answer:'"
- "Thought: Here is the plan of how I will go about solving this:\n",
-]
diff --git a/components/Editor/Sidebar/Prompt.tsx b/components/Editor/Sidebar/Prompt.tsx
new file mode 100644
index 000000000..53f229362
--- /dev/null
+++ b/components/Editor/Sidebar/Prompt.tsx
@@ -0,0 +1,105 @@
+import { CodeEditor, LanguageSetup } from '@devbookhq/code-editor'
+import type { Extension } from '@codemirror/state'
+
+import Text from 'components/Text'
+import { useStateStore } from 'state/StoreProvider'
+import { defaultPromptTemplate } from 'state/prompt'
+
+export interface Props {
+
+
+}
+
+const supportedLanguages: LanguageSetup[] = []
+const theme: Extension = []
+
+function Prompt({
+}: Props) {
+ const [selectors] = useStateStore()
+ const model = selectors.use.model()
+ const prompt = selectors.use.prompts().find(p =>
+ p.templateID === 'NodeJSServer' &&
+ p.provider === model.provider &&
+ p.modelName === model.name
+ )
+
+ const promptParts = prompt?.prompt || defaultPromptTemplate
+
+ const setPrompt = selectors.use.setPrompt()
+
+ return (
+ <div className="
+ flex
+ flex-col
+ ">
+ <div className="
+ flex
+ bg-slate-50
+ items-center
+ justify-between
+ border-b
+ py-3.5
+ pr-4
+ ">
+ <Text
+ text="Prompt"
+ size={Text.size.S2}
+ className="
+ uppercase
+ text-slate-400
+ font-semibold
+ px-4
+ "
+ />
+ </div>
+ <div className="
+ flex
+ flex-col
+ scroller
+ overflow-auto
+ ">
+ {promptParts.map((p, i) =>
+ <div
+ key={i}
+ className="
+ flex
+ flex-col
+ "
+ >
+ <div className="
+ flex
+ space-x-2
+ ">
+ <Text
+ text={p.role}
+ className="font-bold"
+ size={Text.size.S3}
+ />
+ <Text
+ text={p.type}
+ className="font-bold"
+ size={Text.size.S3}
+ />
+ </div>
+ <CodeEditor
+ content={p.content}
+ supportedLanguages={supportedLanguages}
+ filename="prompt"
+ theme={theme}
+ onContentChange={(content) => {
+ if (prompt) {
+ const p = prompt.prompt[i]
+ p.content = content
+
+ setPrompt('NodeJSServer', model.provider, model.name, prompt.prompt)
+ }
+ }}
+ />
+ </div>
+ )}
+ </div>
+ </div>
+ )
+}
+
+export default Prompt
diff --git a/components/Editor/Sidebar/index.tsx b/components/Editor/Sidebar/index.tsx
index d8fe080c9..0ff3494c2 100644
--- a/components/Editor/Sidebar/index.tsx
+++ b/components/Editor/Sidebar/index.tsx
@@ -7,12 +7,13 @@ import Agent from './Agent'
import Envs from './Envs'
import Model from './Model'
-import { Route, Block } from 'state/store'
+import { PromptPart, Route } from 'state/store'
import { useLatestDeployment } from 'hooks/useLatestDeployment'
import { useStateStore } from 'state/StoreProvider'
-import { html2markdown } from 'editor/schema'
import { ModelConfig, getModelConfig } from 'state/model'
import useModelProviderArgs from 'hooks/useModelProviderArgs'
+import Prompt from './Prompt'
+import { defaultPromptTemplate, evaluatePrompt } from 'state/prompt'
// import Deploy from './Deploy'
export interface Props {
@@ -25,6 +26,7 @@ export enum MenuSection {
Agent = 'Agent',
Envs = 'Envs',
Model = 'Model',
+ Prompt = 'Prompt',
// Context = 'Context',
// Deploy = 'Deploy',
}
@@ -34,6 +36,7 @@ async function handlePostGenerate(url: string, { arg }: {
projectID: string,
route: Route,
modelConfig: ModelConfig,
+ promptTemplate: PromptPart[],
envs: { key: string, value: string }[],
}
}) {
@@ -42,24 +45,15 @@ async function handlePostGenerate(url: string, { arg }: {
body: JSON.stringify({
projectID: arg.projectID,
routeID: arg.route.id,
- // Transform block with structured prose into block with plain prompt text.
- blocks: arg.route.blocks.map(b => {
- switch (b.type) {
- case 'Description':
- case 'Instructions':
- const [markdown, references] = html2markdown(b.content)
- const block: Block = {
- ...b,
- content: markdown,
- }
- return block
- default:
- return b
- }
- }),
+ prompt: evaluatePrompt(
+ arg.route.blocks,
+ arg.promptTemplate,
+ {
+ Method: arg.route.method.toLowerCase(),
+ Route: arg.route.route,
+ },
+ ),
modelConfig: arg.modelConfig,
- method: arg.route.method.toLowerCase(),
- route: arg.route.route,
envs: arg.envs,
}),
headers: {
@@ -87,6 +81,11 @@ function Sidebar({
const [selectors] = useStateStore()
const envs = selectors.use.envs()
const model = selectors.use.model()
+ const prompt = selectors.use.prompts().find(p =>
+ p.templateID === 'NodeJSServer' &&
+ p.provider === model.provider &&
+ p.modelName === model.name
+ )?.prompt || defaultPromptTemplate
const [creds] = useModelProviderArgs()
@@ -102,6 +101,7 @@ function Sidebar({
projectID: project.id,
route,
envs,
+ promptTemplate: prompt,
modelConfig: config,
})
}
@@ -141,6 +141,9 @@ function Sidebar({
{activeMenuSection === MenuSection.Model &&
<Model />
}
+ {activeMenuSection === MenuSection.Prompt &&
+ <Prompt />
+ }
{activeMenuSection === MenuSection.Agent &&
<Agent
deploy={deploy}
diff --git a/components/Editor/index.tsx b/components/Editor/index.tsx
index 7d5eac2ea..fe7df6d33 100644
--- a/components/Editor/index.tsx
+++ b/components/Editor/index.tsx
@@ -3,7 +3,7 @@ import { projects } from '@prisma/client'
import Splitter, { GutterTheme } from '@devbookhq/splitter'
import { useLocalStorage } from 'usehooks-ts'
import clsx from 'clsx'
-import { Code, Lock, Cpu } from 'lucide-react'
+import { Code, Lock, Cpu, WholeWord } from 'lucide-react'
import { useStateStore } from 'state/StoreProvider'
@@ -20,6 +20,8 @@ function getMenuSelectionIcon(selection: MenuSection) {
// return <Box size={menuIconSize} />
// case MenuSection.Deploy:
// return <Server size={menuIconSize} />
+ case MenuSection.Prompt:
+ return <WholeWord size={menuIconSize} />
case MenuSection.Envs:
return <Lock size={menuIconSize} />
case MenuSection.Model:
diff --git a/package-lock.json b/package-lock.json
index 9fb3d43c0..57fece4f2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,6 +9,7 @@
"version": "0.1.0",
"hasInstallScript": true,
"dependencies": {
+ "@devbookhq/code-editor": "^0.1.29",
"@devbookhq/splitter": "^1.4.0",
"@prisma/client": "^4.12.0",
"@supabase/auth-helpers-nextjs": "^0.5.5",
@@ -25,11 +26,11 @@
"@tiptap/starter-kit": "^2.0.0-beta.220",
"clsx": "^1.2.1",
"fuse.js": "^6.6.2",
- "handlebars": "^4.7.7",
"http-proxy-middleware": "^3.0.0-beta.1",
"human-id": "^4.0.0",
"immer": "^9.0.19",
- "lucide-react": "^0.130.1",
+ "lucide-react": "^0.161.0",
+ "mustache": "^4.2.0",
"nanoid": "^4.0.1",
"next": "13.2.3",
"next-superjson-plugin": "^0.5.6",
@@ -49,6 +50,7 @@
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.9",
+ "@types/mustache": "^4.2.2",
"@types/node": "^18.14.6",
"@types/randomcolor": "^0.5.7",
"@types/react": "^18.0.28",
@@ -79,6 +81,114 @@
"node": ">=6.9.0"
}
},
+ "node_modules/@codemirror/autocomplete": {
+ "version": "6.4.2",
+ "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.4.2.tgz",
+ "integrity": "sha512-8WE2xp+D0MpWEv5lZ6zPW1/tf4AGb358T5GWYiKEuCP8MvFfT3tH2mIF9Y2yr2e3KbHuSvsVhosiEyqCpiJhZQ==",
+ "dependencies": {
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.6.0",
+ "@lezer/common": "^1.0.0"
+ },
+ "peerDependencies": {
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0",
+ "@lezer/common": "^1.0.0"
+ }
+ },
+ "node_modules/@codemirror/commands": {
+ "version": "6.2.2",
+ "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.2.2.tgz",
+ "integrity": "sha512-s9lPVW7TxXrI/7voZ+HmD/yiAlwAYn9PH5SUVSUhsxXHhv4yl5eZ3KLntSoTynfdgVYM0oIpccQEWRBQgmNZyw==",
+ "dependencies": {
+ "@codemirror/language": "^6.0.0",
+ "@codemirror/state": "^6.2.0",
+ "@codemirror/view": "^6.0.0",
+ "@lezer/common": "^1.0.0"
+ }
+ },
+ "node_modules/@codemirror/language": {
+ "version": "6.6.0",
+ "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.6.0.tgz",
+ "integrity": "sha512-cwUd6lzt3MfNYOobdjf14ZkLbJcnv4WtndYaoBkbor/vF+rCNguMPK0IRtvZJG4dsWiaWPcK8x1VijhvSxnstg==",
+ "dependencies": {
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0",
+ "@lezer/common": "^1.0.0",
+ "@lezer/highlight": "^1.0.0",
+ "@lezer/lr": "^1.0.0",
+ "style-mod": "^4.0.0"
+ }
+ },
+ "node_modules/@codemirror/lint": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.2.1.tgz",
+ "integrity": "sha512-y1muai5U/uUPAGRyHMx9mHuHLypPcHWxzlZGknp/U5Mdb5Ol8Q5ZLp67UqyTbNFJJ3unVxZ8iX3g1fMN79S1JQ==",
+ "dependencies": {
+ "@codemirror/state": "^6.0.0",
+ "@codemirror/view": "^6.0.0",
+ "crelt": "^1.0.5"
+ }
+ },
+ "node_modules/@codemirror/state": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.2.0.tgz",
+ "integrity": "sha512-69QXtcrsc3RYtOtd+GsvczJ319udtBf1PTrr2KbLWM/e2CXUPnh0Nz9AUo8WfhSQ7GeL8dPVNUmhQVgpmuaNGA=="
+ },
+ "node_modules/@codemirror/view": {
+ "version": "6.9.4",
+ "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.9.4.tgz",
+ "integrity": "sha512-Ov2H9gwlGUxiH94zWxlLtTlyogSFaQDIYjtSEcfzgh7MkKmKVchkmr4JbtR5zBev3jY5DVtKvUC8yjd1bKW55A==",
+ "dependencies": {
+ "@codemirror/state": "^6.1.4",
+ "style-mod": "^4.0.0",
+ "w3c-keyname": "^2.2.4"
+ }
+ },
+ "node_modules/@devbookhq/code-editor": {
+ "version": "0.1.29",
+ "resolved": "https://registry.npmjs.org/@devbookhq/code-editor/-/code-editor-0.1.29.tgz",
+ "integrity": "sha512-og72FYxeMLKvAuH8Bo8i3/OMxNg+rkyGhyT9qmCLV03c6Y/1jP2yXIJe55rXQjoucVQIAn8A6IJ2SjwEREjw6w==",
+ "dependencies": {
+ "@codemirror/autocomplete": "6.4.2",
+ "@codemirror/commands": "^6.2.1",
+ "@codemirror/language": "^6.6.0",
+ "@codemirror/lint": "^6.2.0",
+ "@codemirror/state": "^6.2.0",
+ "@codemirror/view": "^6.9.1",
+ "@devbookhq/sdk": "2.6.73",
+ "@lezer/highlight": "^1.1.3",
+ "@vscode/codicons": "^0.0.32",
+ "diff": "^5.1.0",
+ "highlight.js": "^11.7.0",
+ "path-browserify": "^1.0.1",
+ "react": "^18.2.0",
+ "rehype-external-links": "^2.0.1",
+ "rehype-highlight": "^6.0.0",
+ "rehype-raw": "^6.1.1",
+ "rehype-sanitize": "^5.0.1",
+ "rehype-stringify": "^9.0.3",
+ "remark-gfm": "^3.0.1",
+ "remark-parse": "^10.0.1",
+ "remark-rehype": "^10.1.0",
+ "unified": "^10.1.2",
+ "vscode-jsonrpc": "^8.1.0",
+ "vscode-languageserver-protocol": "^3.17.3"
+ }
+ },
+ "node_modules/@devbookhq/sdk": {
+ "version": "2.6.73",
+ "resolved": "https://registry.npmjs.org/@devbookhq/sdk/-/sdk-2.6.73.tgz",
+ "integrity": "sha512-P6H9s7nfd+7i1En/MJMQBz23iQQ0Y6iZW90IxwO414MhWsgOjBFXCUL31FgHptJiJHPPU+e/0UULBs9uVMu8CA==",
+ "dependencies": {
+ "cross-fetch": "^3.1.5",
+ "normalize-path": "^3.0.0",
+ "openapi-typescript-fetch": "^1.1.3",
+ "rpc-websocket-client": "^1.1.4"
+ }
+ },
"node_modules/@devbookhq/splitter": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@devbookhq/splitter/-/splitter-1.4.0.tgz",
@@ -152,6 +262,27 @@
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==",
"dev": true
},
+ "node_modules/@lezer/common": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.0.2.tgz",
+ "integrity": "sha512-SVgiGtMnMnW3ActR8SXgsDhw7a0w0ChHSYAyAUxxrOiJ1OqYWEKk/xJd84tTSPo1mo6DXLObAJALNnd0Hrv7Ng=="
+ },
+ "node_modules/@lezer/highlight": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.1.4.tgz",
+ "integrity": "sha512-IECkFmw2l7sFcYXrV8iT9GeY4W0fU4CxX0WMwhmhMIVjoDdD1Hr6q3G2NqVtLg/yVe5n7i4menG3tJ2r4eCrPQ==",
+ "dependencies": {
+ "@lezer/common": "^1.0.0"
+ }
+ },
+ "node_modules/@lezer/lr": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.3.tgz",
+ "integrity": "sha512-JPQe3mwJlzEVqy67iQiiGozhcngbO8QBgpqZM6oL1Wj/dXckrEexpBLeFkq0edtW5IqnPRFxA24BHJni8Js69w==",
+ "dependencies": {
+ "@lezer/common": "^1.0.0"
+ }
+ },
"node_modules/@linaria/core": {
"version": "3.0.0-beta.13",
"resolved": "https://registry.npmjs.org/@linaria/core/-/core-3.0.0-beta.13.tgz",
@@ -1033,6 +1164,12 @@
"resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz",
"integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA=="
},
+ "node_modules/@types/mustache": {
+ "version": "4.2.2",
+ "resolved": "https://registry.npmjs.org/@types/mustache/-/mustache-4.2.2.tgz",
+ "integrity": "sha512-MUSpfpW0yZbTgjekDbH0shMYBUD+X/uJJJMm9LXN1d5yjl5lCY1vN/eWKD6D1tOtjA6206K0zcIPnUaFMurdNA==",
+ "dev": true
+ },
"node_modules/@types/node": {
"version": "18.14.6",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.6.tgz",
@@ -1048,6 +1185,11 @@
"resolved": "https://registry.npmjs.org/@types/object.pick/-/object.pick-1.3.2.tgz",
"integrity": "sha512-sn7L+qQ6RLPdXRoiaE7bZ/Ek+o4uICma/lBFPyJEKDTPTBP1W8u0c4baj3EiS4DiqLs+Hk+KUGvMVJtAw3ePJg=="
},
+ "node_modules/@types/parse5": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/@types/parse5/-/parse5-6.0.3.tgz",
+ "integrity": "sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g=="
+ },
"node_modules/@types/phoenix": {
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.5.5.tgz",
@@ -1199,6 +1341,11 @@
"url": "https://opencollective.com/typescript-eslint"
}
},
+ "node_modules/@vscode/codicons": {
+ "version": "0.0.32",
+ "resolved": "https://registry.npmjs.org/@vscode/codicons/-/codicons-0.0.32.tgz",
+ "integrity": "sha512-3lgSTWhAzzWN/EPURoY4ZDBEA80OPmnaknNujA3qnI4Iu7AONWd9xF3iE4L+4prIe8E3TUnLQ4pxoaFTEEZNwg=="
+ },
"node_modules/acorn": {
"version": "8.8.2",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz",
@@ -1698,6 +1845,15 @@
"url": "https://github.com/sponsors/mesqueeb"
}
},
+ "node_modules/ccount": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz",
+ "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
@@ -1735,6 +1891,24 @@
"url": "https://github.com/sponsors/wooorm"
}
},
+ "node_modules/character-entities-html4": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz",
+ "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/character-entities-legacy": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz",
+ "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/chokidar": {
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
@@ -3226,6 +3400,18 @@
"reusify": "^1.0.4"
}
},
+ "node_modules/fault": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/fault/-/fault-2.0.1.tgz",
+ "integrity": "sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==",
+ "dependencies": {
+ "format": "^0.2.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/fetch-blob": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
@@ -3335,6 +3521,14 @@
"is-callable": "^1.1.3"
}
},
+ "node_modules/format": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz",
+ "integrity": "sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==",
+ "engines": {
+ "node": ">=0.4.x"
+ }
+ },
"node_modules/formdata-polyfill": {
"version": "4.0.10",
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
@@ -3621,26 +3815,6 @@
"integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==",
"dev": true
},
- "node_modules/handlebars": {
- "version": "4.7.7",
- "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz",
- "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==",
- "dependencies": {
- "minimist": "^1.2.5",
- "neo-async": "^2.6.0",
- "source-map": "^0.6.1",
- "wordwrap": "^1.0.0"
- },
- "bin": {
- "handlebars": "bin/handlebars"
- },
- "engines": {
- "node": ">=0.4.7"
- },
- "optionalDependencies": {
- "uglify-js": "^3.1.4"
- }
- },
"node_modules/has": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
@@ -3722,6 +3896,137 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/hast-util-from-parse5": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-7.1.2.tgz",
+ "integrity": "sha512-Nz7FfPBuljzsN3tCQ4kCBKqdNhQE2l0Tn+X1ubgKBPRoiDIu1mL08Cfw4k7q71+Duyaw7DXDN+VTAp4Vh3oCOw==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "@types/unist": "^2.0.0",
+ "hastscript": "^7.0.0",
+ "property-information": "^6.0.0",
+ "vfile": "^5.0.0",
+ "vfile-location": "^4.0.0",
+ "web-namespaces": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-is-element": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-2.1.3.tgz",
+ "integrity": "sha512-O1bKah6mhgEq2WtVMk+Ta5K7pPMqsBBlmzysLdcwKVrqzZQ0CHqUPiIVspNhAG1rvxpvJjtGee17XfauZYKqVA==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "@types/unist": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-parse-selector": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-3.1.1.tgz",
+ "integrity": "sha512-jdlwBjEexy1oGz0aJ2f4GKMaVKkA9jwjr4MjAAI22E5fM/TXVZHuS5OpONtdeIkRKqAaryQ2E9xNQxijoThSZA==",
+ "dependencies": {
+ "@types/hast": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-raw": {
+ "version": "7.2.3",
+ "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-7.2.3.tgz",
+ "integrity": "sha512-RujVQfVsOrxzPOPSzZFiwofMArbQke6DJjnFfceiEbFh7S05CbPt0cYN+A5YeD3pso0JQk6O1aHBnx9+Pm2uqg==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "@types/parse5": "^6.0.0",
+ "hast-util-from-parse5": "^7.0.0",
+ "hast-util-to-parse5": "^7.0.0",
+ "html-void-elements": "^2.0.0",
+ "parse5": "^6.0.0",
+ "unist-util-position": "^4.0.0",
+ "unist-util-visit": "^4.0.0",
+ "vfile": "^5.0.0",
+ "web-namespaces": "^2.0.0",
+ "zwitch": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-sanitize": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/hast-util-sanitize/-/hast-util-sanitize-4.1.0.tgz",
+ "integrity": "sha512-Hd9tU0ltknMGRDv+d6Ro/4XKzBqQnP/EZrpiTbpFYfXv/uOhWeKc+2uajcbEvAEH98VZd7eII2PiXm13RihnLw==",
+ "dependencies": {
+ "@types/hast": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-to-html": {
+ "version": "8.0.4",
+ "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-8.0.4.tgz",
+ "integrity": "sha512-4tpQTUOr9BMjtYyNlt0P50mH7xj0Ks2xpo8M943Vykljf99HW6EzulIoJP1N3eKOSScEHzyzi9dm7/cn0RfGwA==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "@types/unist": "^2.0.0",
+ "ccount": "^2.0.0",
+ "comma-separated-tokens": "^2.0.0",
+ "hast-util-raw": "^7.0.0",
+ "hast-util-whitespace": "^2.0.0",
+ "html-void-elements": "^2.0.0",
+ "property-information": "^6.0.0",
+ "space-separated-tokens": "^2.0.0",
+ "stringify-entities": "^4.0.0",
+ "zwitch": "^2.0.4"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-to-parse5": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-7.1.0.tgz",
+ "integrity": "sha512-YNRgAJkH2Jky5ySkIqFXTQiaqcAtJyVE+D5lkN6CdtOqrnkLfGYYrEcKuHOJZlp+MwjSwuD3fZuawI+sic/RBw==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "comma-separated-tokens": "^2.0.0",
+ "property-information": "^6.0.0",
+ "space-separated-tokens": "^2.0.0",
+ "web-namespaces": "^2.0.0",
+ "zwitch": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-to-text": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/hast-util-to-text/-/hast-util-to-text-3.1.2.tgz",
+ "integrity": "sha512-tcllLfp23dJJ+ju5wCCZHVpzsQQ43+moJbqVX3jNWPB7z/KFC4FyZD6R7y94cHL6MQ33YtMZL8Z0aIXXI4XFTw==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "@types/unist": "^2.0.0",
+ "hast-util-is-element": "^2.0.0",
+ "unist-util-find-after": "^4.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/hast-util-whitespace": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz",
@@ -3731,6 +4036,30 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/hastscript": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-7.2.0.tgz",
+ "integrity": "sha512-TtYPq24IldU8iKoJQqvZOuhi5CyCQRAbvDOX0x1eW6rsHSxa/1i2CCiptNTotGHJ3VoHRGmqiv6/D3q113ikkw==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "comma-separated-tokens": "^2.0.0",
+ "hast-util-parse-selector": "^3.0.0",
+ "property-information": "^6.0.0",
+ "space-separated-tokens": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/highlight.js": {
+ "version": "11.7.0",
+ "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.7.0.tgz",
+ "integrity": "sha512-1rRqesRFhMO/PRF+G86evnyJkCgaZFOI+Z6kdj15TA18funfoqJXvgPCLSf0SWq3SRfg1j3HlDs8o4s3EGq1oQ==",
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
"node_modules/hoist-non-react-statics": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
@@ -3744,6 +4073,15 @@
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
},
+ "node_modules/html-void-elements": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-2.0.1.tgz",
+ "integrity": "sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/http-proxy": {
"version": "1.18.1",
"resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
@@ -3890,6 +4228,17 @@
"node": ">= 0.4"
}
},
+ "node_modules/is-absolute-url": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-4.0.1.tgz",
+ "integrity": "sha512-/51/TKE88Lmm7Gc4/8btclNXWS+g50wXhYJq8HWIBAGUBnoAdRu1aXeh364t/O7wXDAcTJDP8PNuNKWUDWie+A==",
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/is-arguments": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz",
@@ -4323,6 +4672,14 @@
"node": ">=0.10.0"
}
},
+ "node_modules/isomorphic-ws": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz",
+ "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==",
+ "peerDependencies": {
+ "ws": "*"
+ }
+ },
"node_modules/js-sdsl": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz",
@@ -4490,6 +4847,15 @@
"integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==",
"dev": true
},
+ "node_modules/longest-streak": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz",
+ "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/loose-envify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
@@ -4501,6 +4867,20 @@
"loose-envify": "cli.js"
}
},
+ "node_modules/lowlight": {
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/lowlight/-/lowlight-2.8.1.tgz",
+ "integrity": "sha512-HCaGL61RKc1MYzEYn3rFoGkK0yslzCVDFJEanR19rc2L0mb8i58XM55jSRbzp9jcQrFzschPlwooC0vuNitk8Q==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "fault": "^2.0.0",
+ "highlight.js": "~11.7.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
@@ -4513,9 +4893,9 @@
}
},
"node_modules/lucide-react": {
- "version": "0.130.1",
- "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.130.1.tgz",
- "integrity": "sha512-Fyyyd+ZGlZj/N8d/u9uoqFbRATI18WhynzVTjaeEqfVvsea8pYTSwBMfCg264TB2c5z9aiNAeNy67x8BiFyqXQ==",
+ "version": "0.161.0",
+ "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.161.0.tgz",
+ "integrity": "sha512-Yr0VR0l6r+t65JCE9q+rTMItWqbhF4Wn3l73PHMwxves2wDhEPH7V2JqxvqS0In/brIwiyBV90++r/rHxNK9ug==",
"peerDependencies": {
"react": "^16.5.1 || ^17.0.0 || ^18.0.0"
}
@@ -4540,6 +4920,15 @@
"markdown-it": "bin/markdown-it.js"
}
},
+ "node_modules/markdown-table": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.3.tgz",
+ "integrity": "sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/mdast-util-definitions": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-5.1.2.tgz",
@@ -4554,6 +4943,32 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/mdast-util-find-and-replace": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.2.2.tgz",
+ "integrity": "sha512-MTtdFRz/eMDHXzeK6W3dO7mXUlF82Gom4y0oOgvHhh/HXZAGvIQDUvQ0SuUx+j2tv44b8xTHOm8K/9OoRFnXKw==",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "escape-string-regexp": "^5.0.0",
+ "unist-util-is": "^5.0.0",
+ "unist-util-visit-parents": "^5.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
+ "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/mdast-util-from-markdown": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.0.tgz",
@@ -4577,44 +4992,164 @@
"url": "https://opencollective.com/unified"
}
},
- "node_modules/mdast-util-to-hast": {
- "version": "12.3.0",
- "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-12.3.0.tgz",
- "integrity": "sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==",
+ "node_modules/mdast-util-gfm": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-2.0.2.tgz",
+ "integrity": "sha512-qvZ608nBppZ4icQlhQQIAdc6S3Ffj9RGmzwUKUWuEICFnd1LVkN3EktF7ZHAgfcEdvZB5owU9tQgt99e2TlLjg==",
"dependencies": {
- "@types/hast": "^2.0.0",
- "@types/mdast": "^3.0.0",
- "mdast-util-definitions": "^5.0.0",
- "micromark-util-sanitize-uri": "^1.1.0",
- "trim-lines": "^3.0.0",
- "unist-util-generated": "^2.0.0",
- "unist-util-position": "^4.0.0",
- "unist-util-visit": "^4.0.0"
+ "mdast-util-from-markdown": "^1.0.0",
+ "mdast-util-gfm-autolink-literal": "^1.0.0",
+ "mdast-util-gfm-footnote": "^1.0.0",
+ "mdast-util-gfm-strikethrough": "^1.0.0",
+ "mdast-util-gfm-table": "^1.0.0",
+ "mdast-util-gfm-task-list-item": "^1.0.0",
+ "mdast-util-to-markdown": "^1.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
- "node_modules/mdast-util-to-string": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.1.1.tgz",
- "integrity": "sha512-tGvhT94e+cVnQt8JWE9/b3cUQZWS732TJxXHktvP+BYo62PpYD53Ls/6cC60rW21dW+txxiM4zMdc6abASvZKA==",
+ "node_modules/mdast-util-gfm-autolink-literal": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.3.tgz",
+ "integrity": "sha512-My8KJ57FYEy2W2LyNom4n3E7hKTuQk/0SES0u16tjA9Z3oFkF4RrC/hPAPgjlSpezsOvI8ObcXcElo92wn5IGA==",
"dependencies": {
- "@types/mdast": "^3.0.0"
+ "@types/mdast": "^3.0.0",
+ "ccount": "^2.0.0",
+ "mdast-util-find-and-replace": "^2.0.0",
+ "micromark-util-character": "^1.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
- "node_modules/mdn-data": {
- "version": "2.0.14",
- "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz",
- "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==",
- "dev": true
+ "node_modules/mdast-util-gfm-footnote": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-1.0.2.tgz",
+ "integrity": "sha512-56D19KOGbE00uKVj3sgIykpwKL179QsVFwx/DCW0u/0+URsryacI4MAdNJl0dh+u2PSsD9FtxPFbHCzJ78qJFQ==",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "mdast-util-to-markdown": "^1.3.0",
+ "micromark-util-normalize-identifier": "^1.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
},
- "node_modules/mdurl": {
+ "node_modules/mdast-util-gfm-strikethrough": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-1.0.3.tgz",
+ "integrity": "sha512-DAPhYzTYrRcXdMjUtUjKvW9z/FNAMTdU0ORyMcbmkwYNbKocDpdk+PX1L1dQgOID/+vVs1uBQ7ElrBQfZ0cuiQ==",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "mdast-util-to-markdown": "^1.3.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-gfm-table": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-1.0.7.tgz",
+ "integrity": "sha512-jjcpmNnQvrmN5Vx7y7lEc2iIOEytYv7rTvu+MeyAsSHTASGCCRA79Igg2uKssgOs1i1po8s3plW0sTu1wkkLGg==",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "markdown-table": "^3.0.0",
+ "mdast-util-from-markdown": "^1.0.0",
+ "mdast-util-to-markdown": "^1.3.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-gfm-task-list-item": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-1.0.2.tgz",
+ "integrity": "sha512-PFTA1gzfp1B1UaiJVyhJZA1rm0+Tzn690frc/L8vNX1Jop4STZgOE6bxUhnzdVSB+vm2GU1tIsuQcA9bxTQpMQ==",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "mdast-util-to-markdown": "^1.3.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-phrasing": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-3.0.1.tgz",
+ "integrity": "sha512-WmI1gTXUBJo4/ZmSk79Wcb2HcjPJBzM1nlI/OUWA8yk2X9ik3ffNbBGsU+09BFmXaL1IBb9fiuvq6/KMiNycSg==",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "unist-util-is": "^5.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-to-hast": {
+ "version": "12.3.0",
+ "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-12.3.0.tgz",
+ "integrity": "sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "@types/mdast": "^3.0.0",
+ "mdast-util-definitions": "^5.0.0",
+ "micromark-util-sanitize-uri": "^1.1.0",
+ "trim-lines": "^3.0.0",
+ "unist-util-generated": "^2.0.0",
+ "unist-util-position": "^4.0.0",
+ "unist-util-visit": "^4.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-to-markdown": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-1.5.0.tgz",
+ "integrity": "sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "@types/unist": "^2.0.0",
+ "longest-streak": "^3.0.0",
+ "mdast-util-phrasing": "^3.0.0",
+ "mdast-util-to-string": "^3.0.0",
+ "micromark-util-decode-string": "^1.0.0",
+ "unist-util-visit": "^4.0.0",
+ "zwitch": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdast-util-to-string": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.1.1.tgz",
+ "integrity": "sha512-tGvhT94e+cVnQt8JWE9/b3cUQZWS732TJxXHktvP+BYo62PpYD53Ls/6cC60rW21dW+txxiM4zMdc6abASvZKA==",
+ "dependencies": {
+ "@types/mdast": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/mdn-data": {
+ "version": "2.0.14",
+ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz",
+ "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==",
+ "dev": true
+ },
+ "node_modules/mdurl": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
"integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g=="
@@ -4695,6 +5230,121 @@
"uvu": "^0.5.0"
}
},
+ "node_modules/micromark-extension-gfm": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-2.0.1.tgz",
+ "integrity": "sha512-p2sGjajLa0iYiGQdT0oelahRYtMWvLjy8J9LOCxzIQsllMCGLbsLW+Nc+N4vi02jcRJvedVJ68cjelKIO6bpDA==",
+ "dependencies": {
+ "micromark-extension-gfm-autolink-literal": "^1.0.0",
+ "micromark-extension-gfm-footnote": "^1.0.0",
+ "micromark-extension-gfm-strikethrough": "^1.0.0",
+ "micromark-extension-gfm-table": "^1.0.0",
+ "micromark-extension-gfm-tagfilter": "^1.0.0",
+ "micromark-extension-gfm-task-list-item": "^1.0.0",
+ "micromark-util-combine-extensions": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/micromark-extension-gfm-autolink-literal": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-1.0.3.tgz",
+ "integrity": "sha512-i3dmvU0htawfWED8aHMMAzAVp/F0Z+0bPh3YrbTPPL1v4YAlCZpy5rBO5p0LPYiZo0zFVkoYh7vDU7yQSiCMjg==",
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-sanitize-uri": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/micromark-extension-gfm-footnote": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-1.1.0.tgz",
+ "integrity": "sha512-RWYce7j8+c0n7Djzv5NzGEGitNNYO3uj+h/XYMdS/JinH1Go+/Qkomg/rfxExFzYTiydaV6GLeffGO5qcJbMPA==",
+ "dependencies": {
+ "micromark-core-commonmark": "^1.0.0",
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-normalize-identifier": "^1.0.0",
+ "micromark-util-sanitize-uri": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/micromark-extension-gfm-strikethrough": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-1.0.5.tgz",
+ "integrity": "sha512-X0oI5eYYQVARhiNfbETy7BfLSmSilzN1eOuoRnrf9oUNsPRrWOAe9UqSizgw1vNxQBfOwL+n2610S3bYjVNi7w==",
+ "dependencies": {
+ "micromark-util-chunked": "^1.0.0",
+ "micromark-util-classify-character": "^1.0.0",
+ "micromark-util-resolve-all": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/micromark-extension-gfm-table": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-1.0.5.tgz",
+ "integrity": "sha512-xAZ8J1X9W9K3JTJTUL7G6wSKhp2ZYHrFk5qJgY/4B33scJzE2kpfRL6oiw/veJTbt7jiM/1rngLlOKPWr1G+vg==",
+ "dependencies": {
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/micromark-extension-gfm-tagfilter": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-1.0.2.tgz",
+ "integrity": "sha512-5XWB9GbAUSHTn8VPU8/1DBXMuKYT5uOgEjJb8gN3mW0PNW5OPHpSdojoqf+iq1xo7vWzw/P8bAHY0n6ijpXF7g==",
+ "dependencies": {
+ "micromark-util-types": "^1.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/micromark-extension-gfm-task-list-item": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.4.tgz",
+ "integrity": "sha512-9XlIUUVnYXHsFF2HZ9jby4h3npfX10S1coXTnV035QGPgrtNYQq3J6IfIvcCIUAJrrqBVi5BqA/LmaOMJqPwMQ==",
+ "dependencies": {
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/micromark-factory-destination": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.0.0.tgz",
@@ -5157,6 +5807,14 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
+ "node_modules/mustache": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz",
+ "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==",
+ "bin": {
+ "mustache": "bin/mustache"
+ }
+ },
"node_modules/nanoid": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.1.tgz",
@@ -5179,11 +5837,6 @@
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
"dev": true
},
- "node_modules/neo-async": {
- "version": "2.6.2",
- "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
- "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="
- },
"node_modules/next": {
"version": "13.2.3",
"resolved": "https://registry.npmjs.org/next/-/next-13.2.3.tgz",
@@ -5364,7 +6017,6 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
- "dev": true,
"engines": {
"node": ">=0.10.0"
}
@@ -5588,6 +6240,15 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/openapi-typescript-fetch": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/openapi-typescript-fetch/-/openapi-typescript-fetch-1.1.3.tgz",
+ "integrity": "sha512-smLZPck4OkKMNExcw8jMgrMOGgVGx2N/s6DbKL2ftNl77g5HfoGpZGFy79RBzU/EkaO0OZpwBnslfdBfh7ZcWg==",
+ "engines": {
+ "node": ">= 12.0.0",
+ "npm": ">= 7.0.0"
+ }
+ },
"node_modules/optionator": {
"version": "0.9.1",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
@@ -5652,6 +6313,16 @@
"node": ">=6"
}
},
+ "node_modules/parse5": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz",
+ "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw=="
+ },
+ "node_modules/path-browserify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
+ "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="
+ },
"node_modules/path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
@@ -6714,6 +7385,96 @@
"url": "https://github.com/sponsors/mysticatea"
}
},
+ "node_modules/rehype-external-links": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/rehype-external-links/-/rehype-external-links-2.0.1.tgz",
+ "integrity": "sha512-u2dNypma+ps12SJWlS23zvbqwNx0Hl24t0YHXSM/6FCZj/pqWETCO3WyyrvALv4JYvRtuPjhiv2Lpen15ESqbA==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "extend": "^3.0.0",
+ "is-absolute-url": "^4.0.0",
+ "space-separated-tokens": "^2.0.0",
+ "unified": "^10.0.0",
+ "unist-util-visit": "^4.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/rehype-highlight": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/rehype-highlight/-/rehype-highlight-6.0.0.tgz",
+ "integrity": "sha512-q7UtlFicLhetp7K48ZgZiJgchYscMma7XjzX7t23bqEJF8m6/s+viXQEe4oHjrATTIZpX7RG8CKD7BlNZoh9gw==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "hast-util-to-text": "^3.0.0",
+ "lowlight": "^2.0.0",
+ "unified": "^10.0.0",
+ "unist-util-visit": "^4.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/rehype-raw": {
+ "version": "6.1.1",
+ "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-6.1.1.tgz",
+ "integrity": "sha512-d6AKtisSRtDRX4aSPsJGTfnzrX2ZkHQLE5kiUuGOeEoLpbEulFF4hj0mLPbsa+7vmguDKOVVEQdHKDSwoaIDsQ==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "hast-util-raw": "^7.2.0",
+ "unified": "^10.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/rehype-sanitize": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/rehype-sanitize/-/rehype-sanitize-5.0.1.tgz",
+ "integrity": "sha512-da/jIOjq8eYt/1r9GN6GwxIR3gde7OZ+WV8pheu1tL8K0D9KxM2AyMh+UEfke+FfdM3PvGHeYJU0Td5OWa7L5A==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "hast-util-sanitize": "^4.0.0",
+ "unified": "^10.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/rehype-stringify": {
+ "version": "9.0.3",
+ "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-9.0.3.tgz",
+ "integrity": "sha512-kWiZ1bgyWlgOxpqD5HnxShKAdXtb2IUljn3hQAhySeak6IOQPPt6DeGnsIh4ixm7yKJWzm8TXFuC/lPfcWHJqw==",
+ "dependencies": {
+ "@types/hast": "^2.0.0",
+ "hast-util-to-html": "^8.0.0",
+ "unified": "^10.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/remark-gfm": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-3.0.1.tgz",
+ "integrity": "sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig==",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "mdast-util-gfm": "^2.0.0",
+ "micromark-extension-gfm": "^2.0.0",
+ "unified": "^10.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/remark-parse": {
"version": "10.0.1",
"resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-10.0.1.tgz",
@@ -6813,6 +7574,19 @@
"resolved": "https://registry.npmjs.org/rope-sequence/-/rope-sequence-1.3.3.tgz",
"integrity": "sha512-85aZYCxweiD5J8yTEbw+E6A27zSnLPNDL0WfPdw3YYodq7WjnTKo0q4dtyQ2gz23iPT8Q9CUyJtAaUNcTxRf5Q=="
},
+ "node_modules/rpc-websocket-client": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/rpc-websocket-client/-/rpc-websocket-client-1.1.4.tgz",
+ "integrity": "sha512-UDMVcsNDJ3WET+0EFdmseYX+60MOCA3BpgpZ5dbtiGsqHo+9uWfgNbPZ4iGDtNcX+EUhCt/Y7C0fTmUU3CkkWA==",
+ "dependencies": {
+ "isomorphic-ws": "^4.0.1",
+ "uuid": "^3.3.3",
+ "ws": "^7.1.2"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
"node_modules/run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
@@ -7047,6 +7821,7 @@
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true,
"engines": {
"node": ">=0.10.0"
}
@@ -7168,6 +7943,19 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/stringify-entities": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.3.tgz",
+ "integrity": "sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g==",
+ "dependencies": {
+ "character-entities-html4": "^2.0.0",
+ "character-entities-legacy": "^3.0.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
@@ -7201,6 +7989,11 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/style-mod": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.0.3.tgz",
+ "integrity": "sha512-78Jv8kYJdjbvRwwijtCevYADfsI0lGzYJe4mMFdceO8l75DFFDoqBhR1jVDicDRRaX4//g1u9wKeo+ztc2h1Rw=="
+ },
"node_modules/style-to-object": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-0.4.1.tgz",
@@ -7719,18 +8512,6 @@
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz",
"integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA=="
},
- "node_modules/uglify-js": {
- "version": "3.17.4",
- "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
- "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==",
- "optional": true,
- "bin": {
- "uglifyjs": "bin/uglifyjs"
- },
- "engines": {
- "node": ">=0.8.0"
- }
- },
"node_modules/unbox-primitive": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz",
@@ -7764,6 +8545,19 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/unist-util-find-after": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/unist-util-find-after/-/unist-util-find-after-4.0.1.tgz",
+ "integrity": "sha512-QO/PuPMm2ERxC6vFXEPtmAutOopy5PknD+Oq64gGwxKtk4xwo9Z97t9Av1obPmGU0IyTa6EKYUfTrK2QJS3Ozw==",
+ "dependencies": {
+ "@types/unist": "^2.0.0",
+ "unist-util-is": "^5.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/unist-util-generated": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-2.0.1.tgz",
@@ -7946,6 +8740,15 @@
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
},
+ "node_modules/uuid": {
+ "version": "3.4.0",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
+ "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
+ "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.",
+ "bin": {
+ "uuid": "bin/uuid"
+ }
+ },
"node_modules/uvu": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz",
@@ -7978,6 +8781,19 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/vfile-location": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.1.0.tgz",
+ "integrity": "sha512-YF23YMyASIIJXpktBa4vIGLJ5Gs88UB/XePgqPmTa7cDA+JeO3yclbpheQYCHjVHBn/yePzrXuygIL+xbvRYHw==",
+ "dependencies": {
+ "@types/unist": "^2.0.0",
+ "vfile": "^5.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/vfile-message": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz",
@@ -7991,11 +8807,42 @@
"url": "https://opencollective.com/unified"
}
},
+ "node_modules/vscode-jsonrpc": {
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz",
+ "integrity": "sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/vscode-languageserver-protocol": {
+ "version": "3.17.3",
+ "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz",
+ "integrity": "sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==",
+ "dependencies": {
+ "vscode-jsonrpc": "8.1.0",
+ "vscode-languageserver-types": "3.17.3"
+ }
+ },
+ "node_modules/vscode-languageserver-types": {
+ "version": "3.17.3",
+ "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz",
+ "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA=="
+ },
"node_modules/w3c-keyname": {
"version": "2.2.6",
"resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.6.tgz",
"integrity": "sha512-f+fciywl1SJEniZHD6H+kUO8gOnwIr7f4ijKA6+ZvJFjeGi1r4PDLl53Ayud9O/rk64RqgoQine0feoeOU0kXg=="
},
+ "node_modules/web-namespaces": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz",
+ "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/web-streams-polyfill": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz",
@@ -8123,11 +8970,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/wordwrap": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
- "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q=="
- },
"node_modules/wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
@@ -8163,6 +9005,26 @@
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
}
},
+ "node_modules/ws": {
+ "version": "7.5.9",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz",
+ "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==",
+ "engines": {
+ "node": ">=8.3.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": "^5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
"node_modules/xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
@@ -8264,6 +9126,15 @@
"optional": true
}
}
+ },
+ "node_modules/zwitch": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz",
+ "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
}
}
}
diff --git a/package.json b/package.json
index 248e3623f..4ea4f9e70 100644
--- a/package.json
+++ b/package.json
@@ -27,6 +27,7 @@
"vale:sync": "vale sync"
},
"dependencies": {
+ "@devbookhq/code-editor": "^0.1.29",
"@devbookhq/splitter": "^1.4.0",
"@prisma/client": "^4.12.0",
"@supabase/auth-helpers-nextjs": "^0.5.5",
@@ -43,11 +44,11 @@
"@tiptap/starter-kit": "^2.0.0-beta.220",
"clsx": "^1.2.1",
"fuse.js": "^6.6.2",
- "handlebars": "^4.7.7",
"http-proxy-middleware": "^3.0.0-beta.1",
"human-id": "^4.0.0",
"immer": "^9.0.19",
- "lucide-react": "^0.130.1",
+ "lucide-react": "^0.161.0",
+ "mustache": "^4.2.0",
"nanoid": "^4.0.1",
"next": "13.2.3",
"next-superjson-plugin": "^0.5.6",
@@ -67,6 +68,7 @@
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.9",
+ "@types/mustache": "^4.2.2",
"@types/node": "^18.14.6",
"@types/randomcolor": "^0.5.7",
"@types/react": "^18.0.28",
diff --git a/prompt/prompt.ts b/prompt/prompt.ts
deleted file mode 100644
index eb3f5b46e..000000000
--- a/prompt/prompt.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-const systemPrefix = `
-You are an AI JavaScript developer assistant.
-- You are building an Express server that handles REST API.
-- The \`express\` package is already installed.
-- Follow the user's instructions carefully & to the letter.
-- Minimize any other prose.
-- You have access to the following tools:
-`
-
-
-const systemFormatInstructions = `
-The way you use the tools is by specifying a XML snippet.
-The XML snippet MUST have a \`<action tool="$TOOL_NAME">$INPUT</action>\` element with the name of the tool in the \`tool\` attribute and input for the tool inside the XML tag.
-
-Here is an example of a valid XML snippet:
-<action tool="$TOOL_NAME">
-$INPUT
-</action>
-
-ALWAYS use the following format:
-
-
-Thought: you should always think about what to do
-Action:
-<action tool="$TOOL_NAME">
-$INPUT
-</action>
-Observation: the result of the action
-... (this Thought/Action/Observation can repeat N times)
-Thought: I now know the final server code and can show it.
-Final Answer: the final answer
-`
-
-const systemSuffix = ''
-
-
-const humanInstructionsPrefix = `
-The handler you are building should do the following: {{description}}
-Do not try to come up with solutions and code if you do not know. Instead, use the tool \`AskHuman\` to ask for help.
-If you think there might be multiple paths forward, use the tool \`LetHumanChoose\` to choose from them.
-{{#if request_body}}
-The incoming request body is JSON that looks like this:
-{{request_body}}
-{{/if}}
-Use this starting template:
-\`\`\`
-import express from 'express';
-const app = express();
-const port = 3000;
-app.use(express.json())
-
-// TODO: Implement the {method} handler here
-
-app.listen(port, async () => {{
- console.log(\`Server listening on port \${port}\`)
-}})
-\`\`\`
-The HTTP request handler is of type {{method}}
-The request handler MUST be on the route \`{{route}}\`
-Do not forget to use async and await
-Always test that the generated server works without bugs and errors as required by running the code and making mock \`curl\` requests to the server
-Generate the full required server code
-`
-
-const humanInstructionsSuffic = `
-Thought: Here is the plan of how I will go about solving this:\n
-`
-
-
-
-export function getPromptTemplate(templateID: string) {
-
-
-
-
-}
-
-
-
-
-
-export function getPrompt() {
-
-}
diff --git a/state/prompt.ts b/state/prompt.ts
new file mode 100644
index 000000000..ddcd0ad83
--- /dev/null
+++ b/state/prompt.ts
@@ -0,0 +1,136 @@
+import { html2markdown } from 'editor/schema'
+import Mustache from 'mustache'
+
+import { Block, PromptPart } from 'state/store'
+
+export const defaultPromptTemplate: PromptPart[] = [
+ {
+ role: 'system',
+ type: 'prefix',
+ content: `You are an AI JavaScript developer assistant.
+- You are building an Express server that handles REST API.
+- The \`express\` package is already installed.
+- Follow the user's instructions carefully & to the letter.
+- Minimize any other prose.
+- You have access to the following tools:
+`,
+ },
+ {
+ role: 'system',
+ type: 'instructionsFormat',
+ content: `The way you use the tools is by specifying a XML snippet.
+The XML snippet MUST have a \`<action tool="$TOOL_NAME">$INPUT</action>\` element with the name of the tool in the \`tool\` attribute and input for the tool inside the XML tag.
+
+Here is an example of a valid XML snippet:
+<action tool="$TOOL_NAME">
+$INPUT
+</action>
+
+ALWAYS use the following format:
+
+Thought: you should always think about what to do
+Action:
+<action tool="$TOOL_NAME">
+$INPUT
+</action>
+Observation: the result of the action
+... (this Thought/Action/Observation can repeat N times)
+Thought: I now know the final server code and can show it.
+Final Answer: the final answer
+`,
+ },
+ {
+ role: 'system',
+ type: 'suffix',
+ content: '',
+ },
+ {
+ role: 'user',
+ type: 'userPrefix',
+ content: `The handler you are building should do the following:
+{{Description}}
+
+Do not try to come up with solutions and code if you do not know. Instead, use the tool \`AskHuman\` to ask for help.
+If you think there might be multiple paths forward, use the tool \`LetHumanChoose\` to choose from them.
+{{#RequestBody}}
+The incoming request body is JSON that looks like this:
+\`\`\`
+{
+{{RequestBody}}
+}
+\`\`\`
+{{/RequestBody}}
+Use this starting template:
+\`\`\`
+import express from 'express';
+const app = express();
+const port = 3000;
+app.use(express.json())
+
+// TODO: Implement the {{Method}} handler here
+
+app.listen(port, async () => {
+ console.log(\`Server listening on port \${port}\`)
+})
+\`\`\`
+The HTTP request handler is of type {{Method}}
+The request handler MUST be on the route \`{{Route}}\`
+Do not forget to use async and await
+Always test that the generated server works without bugs and errors as required by running the code and making mock \`curl\` requests to the server
+Generate the full required server code
+
+{{#Instructions}}
+Here are the required implementation instructions:
+{{Instructions}}
+{{/Instructions}}
+Thought: Here is the plan of how I will go about solving this:
+`,
+ },
+]
+
+interface BlockMap {
+ [blockType: string]: string
+}
+
+export function evaluatePrompt(
+ blocks: Block[],
+ promptTemplate: PromptPart[],
+ additionalArgs: {
+ Method: string,
+ Route: string,
+ },
+) {
+ const blockMap = blocks
+ // Transform XML from ProseMirror to text
+ .map(b => {
+ switch (b.type) {
+ case 'Description':
+ case 'Instructions':
+ // TODO: Use the references to build context
+ const [markdown, references] = html2markdown(b.content)
+ const block: Block = {
+ ...b,
+ content: markdown,
+ }
+ return block
+ default:
+ return b
+ }
+ })
+ .reduce<BlockMap>((prev, curr) => {
+ prev[curr.type] = curr.content
+ return prev
+ }, {})
+
+ const evalutedPrompt = promptTemplate.map(t => {
+ return {
+ ...t,
+ content: Mustache.render(t.content, {
+ ...additionalArgs,
+ ...blockMap,
+ }),
+ }
+ })
+
+ return evalutedPrompt
+}
diff --git a/state/store.ts b/state/store.ts
index 988d9e10e..59cc83faa 100644
--- a/state/store.ts
+++ b/state/store.ts
@@ -9,6 +9,7 @@ import { Database } from 'db/supabase'
import { projectsTable } from 'db/tables'
import { ModelArgs, ModelProvider } from './model'
+import { defaultPromptTemplate } from './prompt'
export interface SelectedModel {
provider: ModelProvider
@@ -38,6 +39,19 @@ export interface Route {
id: string
}
+export interface PromptPart {
+ role: 'user' | 'system'
+ type: string
+ content: string
+}
+
+export interface ModelPrompt {
+ templateID: string
+ provider: ModelProvider
+ modelName: string
+ prompt: PromptPart[]
+}
+
export enum Method {
POST = 'post',
GET = 'get',
@@ -55,6 +69,7 @@ export interface SerializedState {
envs: { key: string, value: string }[]
routes: Route[]
model: SelectedModel
+ prompts: ModelPrompt[]
}
export interface State extends SerializedState {
@@ -65,6 +80,7 @@ export interface State extends SerializedState {
setEnvs: (envs: { key: string, value: string }[]) => void
changeEnv: (pair: { key: string, value: string }, idx: number) => void
setModel: (model: SelectedModel) => void
+ setPrompt: (templateID: string, provider: ModelProvider, modelName: string, prompt: PromptPart[]) => void
}
function createBlock(type: BlockType): Block {
@@ -96,11 +112,21 @@ function getDefaultModel(): SelectedModel {
}
}
+function getDefaultPrompts(): ModelPrompt[] {
+ return [{
+ provider: ModelProvider.OpenAI,
+ modelName: 'GPT 3.5 Turbo',
+ templateID: 'NodeJSServer',
+ prompt: defaultPromptTemplate,
+ }]
+}
+
function getDefaultState(): SerializedState {
return {
envs: [{ key: '', value: '' }],
routes: [getDefaultRoute()],
model: getDefaultModel(),
+ prompts: getDefaultPrompts(),
}
}
@@ -124,6 +150,10 @@ export function createStore(project: projects, client?: SupabaseClient<Database>
initialState.envs.push({ key: '', value: '' })
}
+ if (!initialState.prompts) {
+ initialState.prompts = []
+ }
+
// TEMPORARY: We are checking .model === string for backwards compatibility.
if (!initialState.model || typeof initialState.model === 'string') {
initialState.model = getDefaultModel()
@@ -165,6 +195,24 @@ export function createStore(project: projects, client?: SupabaseClient<Database>
changeEnv: (pair, idx) => set(state => {
state.envs[idx] = pair
}),
+ setPrompt: (templateID, provider, modelName, prompt) => set(state => {
+ const promptIdx = state.prompts.findIndex(p =>
+ p.templateID === templateID &&
+ p.provider === provider &&
+ p.modelName === modelName
+ )
+
+ if (promptIdx !== -1) {
+ state.prompts[promptIdx].prompt = prompt
+ } else {
+ state.prompts.push({
+ templateID,
+ prompt,
+ modelName,
+ provider,
+ })
+ }
+ }),
}))
const persistent = persist(immerStore, {
diff --git a/styles/global.css b/styles/global.css
index 204c1e846..b89613625 100644
--- a/styles/global.css
+++ b/styles/global.css
@@ -1,4 +1,5 @@
/* @import 'highlight.js/styles/a11y-dark.css'; */
+@import '@devbookhq/code-editor/dist/index.css';
@import './prosemirror.css';