Skip to content

Commit

Permalink
fix: Update deps, docker compose and some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zAlweNy26 committed Jul 18, 2024
1 parent 3766147 commit c61cd24
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 30 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
FROM oven/bun:1 as base
FROM oven/bun:1 AS base
WORKDIR /usr/src/app

# install dependencies into temp directory
# this will cache them and speed up future builds
FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lockb /temp/dev/
COPY /patches/ /temp/dev/patches/
RUN cd /temp/dev && bun install --frozen-lockfile

# install with --production (exclude devDependencies)
RUN mkdir -p /temp/prod
COPY package.json bun.lockb /temp/prod/
COPY /patches/ /temp/prod/patches/
RUN cd /temp/prod && bun install --frozen-lockfile --production

# copy node_modules from temp directory
Expand All @@ -20,7 +22,6 @@ COPY --from=install /temp/dev/node_modules node_modules
COPY . .

ENV NODE_ENV=production
RUN bun run build

# copy production dependencies and source code into final image
FROM base AS release
Expand Down
Binary file modified bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ services:
- ${CORE_PORT:-1865}:80
volumes:
- ./:/app
command: pnpm dev
command: bun run start
restart: unless-stopped
ccat-ts-vector-memory:
image: qdrant/qdrant:v1.8.2
image: qdrant/qdrant:v1.10.0
container_name: ccat_ts_vector_memory
environment:
- QDRANT__LOG_LEVEL=INFO
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default antfu({
markdown: false, // TODO: Temporary fix until code blocks are correctly read
ignores: ['package.json', 'dist/', 'node_modules/', 'test/mocks/'],
rules: {
'unused-imports/no-unused-vars-ts': 'warn',
'unused-imports/no-unused-vars': 'warn',
'style/max-statements-per-line': 'off',
'regexp/no-unused-capturing-group': 'warn',
'regexp/optimal-quantifier-concatenation': 'warn',
Expand Down
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@
"@elysiajs/static": "^1.0.3",
"@elysiajs/stream": "^1.0.3",
"@elysiajs/swagger": "^1.0.5",
"@langchain/anthropic": "^0.2.3",
"@langchain/anthropic": "^0.2.6",
"@langchain/azure-openai": "^0.0.11",
"@langchain/cohere": "^0.1.0",
"@langchain/community": "^0.2.17",
"@langchain/core": "^0.2.13",
"@langchain/google-genai": "^0.0.21",
"@langchain/mistralai": "^0.0.25",
"@langchain/openai": "^0.2.1",
"@langchain/cohere": "^0.2.1",
"@langchain/community": "^0.2.19",
"@langchain/core": "^0.2.17",
"@langchain/google-genai": "^0.0.23",
"@langchain/mistralai": "^0.0.26",
"@langchain/openai": "^0.2.4",
"@mgcrea/pino-pretty-compact": "^1.3.0",
"@qdrant/js-client-rest": "^1.9.0",
"@qdrant/js-client-rest": "^1.10.0",
"callsites": "^4.2.0",
"cheerio": "1.0.0-rc.12",
"chokidar": "^3.6.0",
"consola": "^3.2.3",
"console-table-printer": "^2.12.1",
"croner": "8.0.2",
"croner": "8.1.0",
"d3-dsv": "^2.0.0",
"date-fns": "^3.6.0",
"defu": "^6.1.4",
Expand All @@ -77,39 +77,39 @@
"html-to-text": "^9.0.5",
"is-docker": "^3.0.0",
"js-tiktoken": "^1.0.12",
"langchain": "^0.2.8",
"langchain": "^0.2.10",
"lodash": "^4.17.21",
"lowdb": "^7.0.1",
"mammoth": "^1.8.0",
"nodemon": "^3.1.0",
"ofetch": "^1.3.4",
"officeparser": "^4.1.1",
"pdf-parse": "^1.1.1",
"pkg-types": "^1.1.3",
"qs": "^6.12.2",
"qs": "^6.12.3",
"scule": "^1.3.0",
"turbowatch": "^2.29.4",
"uncrypto": "^0.1.3",
"zod": "^3.23.8",
"zod-to-json-schema": "^3.23.1"
},
"devDependencies": {
"@antfu/eslint-config": "^2.21.2",
"@antfu/eslint-config": "^2.23.0",
"@total-typescript/ts-reset": "^0.5.1",
"@types/bun": "^1.1.6",
"@types/lodash": "^4.17.6",
"@types/lodash": "^4.17.7",
"@types/nodemon": "^1.19.6",
"@types/qs": "^6.9.15",
"@types/ws": "^8.5.10",
"@vitest/ui": "^1.6.0",
"@types/ws": "^8.5.11",
"@vitest/ui": "^2.0.3",
"changelogen": "^0.5.5",
"eslint": "^8.57.0",
"magicast": "^0.3.4",
"nodemon": "^3.1.0",
"typescript": "^5.4.5",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^1.6.0"
"vitest": "^2.0.3"
},
"patchedDependencies": {
"[email protected].8": "patches/[email protected].8.patch"
"[email protected].10": "patches/[email protected].10.patch"
}
}
4 changes: 2 additions & 2 deletions patches/[email protected] → patches/[email protected]
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
diff --git a/dist/agents/index.d.ts b/dist/agents/index.d.ts
index f136611b5f08a3670edc3e6bda9fdb0878f9b0ee..fd85341804ac9f32f4dadc5e73dd6e7ff38e6d2c 100644
index f136611b5f08a3670edc3e6bda9fdb0878f9b0ee..58caf958f3397804764961a212614fcd03d5bb66 100644
--- a/dist/agents/index.d.ts
+++ b/dist/agents/index.d.ts
@@ -1,4 +1,4 @@
-export { Agent, type AgentArgs, BaseSingleActionAgent, BaseMultiActionAgent, RunnableAgent, LLMSingleActionAgent, type LLMSingleActionAgentInput, type OutputParserArgs, } from "./agent.js";
+export { Agent, type AgentArgs, BaseSingleActionAgent, BaseMultiActionAgent, RunnableAgent, LLMSingleActionAgent, type LLMSingleActionAgentInput, type OutputParserArgs, AgentRunnableSequence } from "./agent.js";
+export { Agent, type AgentArgs, BaseSingleActionAgent, BaseMultiActionAgent, RunnableAgent, LLMSingleActionAgent, AgentRunnableSequence, type LLMSingleActionAgentInput, type OutputParserArgs, } from "./agent.js";
export { JsonToolkit, OpenApiToolkit, RequestsToolkit, type VectorStoreInfo, VectorStoreRouterToolkit, VectorStoreToolkit, createJsonAgent, createOpenApiAgent, createVectorStoreAgent, createVectorStoreRouterAgent, } from "./toolkits/index.js";
export { Toolkit } from "./toolkits/base.js";
export { ChatAgent, type ChatAgentInput, type ChatCreatePromptArgs, } from "./chat/index.js";
Expand Down
6 changes: 3 additions & 3 deletions src/mad_hatter/core_plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "Core CCat",
"description": "The core Cat plugin used to define default hooks and tools. You don't see this plugin in the plugins folder, because it is an hidden plugin. It will be used to try out hooks and tools before they become available to other plugins. Written and delivered just for you, my furry friend.",
"author_name": "Cheshire Cat",
"author_url": "https://cheshirecat.ai",
"plugin_url": "https://github.com/cheshire-cat-ai/core",
"authorName": "Cheshire Cat",
"authorUrl": "https://cheshirecat.ai",
"pluginUrl": "https://github.com/cheshire-cat-ai/core",
"tags": ["core", "cat", "default", "hidden"],
"version": "0.0.1"
}
3 changes: 2 additions & 1 deletion src/mad_hatter/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ export class Plugin<
if (callback) {
const timeStart = performance.now()
// TODO: Improve this check
event === 'installed' || event === 'removed' ? callback(this.manifest) : callback(this.settings as any)
if (event === 'installed' || event === 'removed') callback(this.manifest)
else callback(this.settings as TODO)
const timeEnd = performance.now()
const eventTime = (timeEnd - timeStart).toFixed(2)
log.tag('bgCyanBright', 'PLUGIN', event, `event of ${this.id} executed in ${eventTime}ms`)
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export function getRandomString(length: number) {
export async function parseJson<T extends z.AnyZodObject>(text: string, schema: T, addDefaults = false) {
text = text.replace(/^```(json)?|```$/g, '').trim()
text += text.endsWith('}') ? '' : '}'
text = text.replace(/^['"]|['"]$/g, '').replace('\_', '_').replace('\-', '-')
text = text.replace(/^['"]|['"]$/g, '').replace('\\_', '_').replace('\\-', '-')
const merged = addDefaults ? defu(safeDestr(text), getZodDefaults(schema)) : safeDestr(text)
return await schema.parseAsync(merged) as z.infer<T>
}
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
},
"include": [
"./src/**/*.ts",
"./src/**/*",
"./test/**/*.ts",
"eslint.config.mjs",
"vitest.config.ts",
Expand Down

0 comments on commit c61cd24

Please sign in to comment.