diff --git a/posthog/.env.example b/posthog/.env.example index 4f09782..9ff8c1f 100644 --- a/posthog/.env.example +++ b/posthog/.env.example @@ -4,6 +4,7 @@ POSTHOG_API_KEY= POSTHOG_PROJECT_ID= POSTHOG_HOST=https://us.posthog.com OPENAI_API_KEY= +LINEAR_API_KEY= # (Optional) Restack Cloud - You only need to set these if you are using Restack Cloud diff --git a/posthog/Dockerfile b/posthog/Dockerfile index da467da..7034904 100644 --- a/posthog/Dockerfile +++ b/posthog/Dockerfile @@ -1,44 +1,43 @@ # ------- Image ---------- -FROM node:20-bullseye-slim AS installer - -RUN apt-get update \ - && apt-get install -y ca-certificates \ - && rm -rf /var/lib/apt/lists/* - -COPY ./package.json ./app/package.json -COPY ./tsconfig.json ./app/tsconfig.json - - -WORKDIR /app - -RUN npm install - -# ------- Builder ---------- - -FROM node:20-bullseye-slim AS builder -WORKDIR /app -COPY --from=installer /app . -COPY ./src ./src - -RUN npm run build - -# ------- Runner ---------- - -FROM node:20-bullseye-slim AS runner - -RUN apt-get update \ - && apt-get install -y ca-certificates \ - && rm -rf /var/lib/apt/lists/* - -RUN addgroup --system --gid 1001 service -RUN adduser --system --uid 1001 service -USER service - -WORKDIR /app - -COPY --from=builder /app . - -ENV NODE_OPTIONS=”--max-old-space-size=4096″ - -CMD ["node", "dist/services"] \ No newline at end of file + FROM node:20-bullseye-slim AS installer + + RUN apt-get update \ + && apt-get install -y ca-certificates \ + && rm -rf /var/lib/apt/lists/* + + COPY ./package.json ./app/package.json + COPY ./tsconfig.json ./app/tsconfig.json + + WORKDIR /app + + RUN npm install + + # ------- Builder ---------- + + FROM node:20-bullseye-slim AS builder + WORKDIR /app + COPY --from=installer /app . + COPY ./src ./src + + RUN npm run build + + # ------- Runner ---------- + + FROM node:20-bullseye-slim AS runner + + RUN apt-get update \ + && apt-get install -y ca-certificates \ + && rm -rf /var/lib/apt/lists/* + + RUN addgroup --system --gid 1001 service + RUN adduser --system --uid 1001 service + USER service + + WORKDIR /app + + COPY --from=builder /app . + + ENV NODE_OPTIONS="--max-old-space-size=4096" + + CMD ["node", "dist/services"] \ No newline at end of file diff --git a/posthog/package.json b/posthog/package.json index 20a631a..4fadd61 100644 --- a/posthog/package.json +++ b/posthog/package.json @@ -8,29 +8,34 @@ "dev": "ts-node-dev --respawn --transpile-only src/services.ts", "build": "tsc --build", "clean": "rm -rf node_modules", + "restack-engine": "docker run -d --pull always --name restack -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main", + "docker:build": "docker build -t posthog .", + "docker:run": "docker run -d -p 4000:4000 posthog", "schedule": "ts-node ./scheduleWorkflow.ts", - "restack-up": "node restack_up.mjs" + "restack-up": "dotenv -e .env -- tsx restack_up.mjs" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { - "@restackio/ai": "^0.0.85", - "@restackio/integrations-linear": "^0.0.8", - "@restackio/integrations-openai": "^0.0.34", - "@temporalio/workflow": "1.11.1", - "dotenv": "^16.4.5", - "typescript": "^5.6.2", - "uuid": "^10.0.0", - "zod": "^3.23.8", - "zod-to-json-schema": "^3.23.3" + "@restackio/ai": "0.0.86", + "@temporalio/workflow": "1.11.2", + "@linear/sdk": "29.0.0", + "dotenv": "16.4.5", + "openai": "4.71.1", + "typescript": "5.6.2", + "uuid": "10.0.0", + "zod": "3.23.8", + "zod-to-json-schema": "3.23.3", + "tsx": "4.19.2" }, "devDependencies": { - "@restackio/cloud": "^1.0.19", - "@types/node": "^22.5.5", - "@types/uuid": "^10.0.0", - "nodemon": "^3.1.4", - "ts-node": "^10.9.2", - "ts-node-dev": "^2.0.0" + "@restackio/cloud": "1.0.21", + "@types/node": "22.5.5", + "@types/uuid": "10.0.0", + "dotenv-cli": "7.4.4", + "nodemon": "3.1.4", + "ts-node": "10.9.2", + "ts-node-dev": "2.0.0" } } diff --git a/posthog/pnpm-lock.yaml b/posthog/pnpm-lock.yaml index cac55b3..43f9d61 100644 --- a/posthog/pnpm-lock.yaml +++ b/posthog/pnpm-lock.yaml @@ -8,52 +8,58 @@ importers: .: dependencies: + '@linear/sdk': + specifier: 29.0.0 + version: 29.0.0 '@restackio/ai': - specifier: ^0.0.85 - version: 0.0.85 - '@restackio/integrations-linear': - specifier: ^0.0.8 - version: 0.0.8 - '@restackio/integrations-openai': - specifier: ^0.0.34 - version: 0.0.34(zod@3.23.8) + specifier: 0.0.86 + version: 0.0.86 '@temporalio/workflow': - specifier: 1.11.1 - version: 1.11.1 + specifier: 1.11.2 + version: 1.11.2 dotenv: - specifier: ^16.4.5 + specifier: 16.4.5 version: 16.4.5 + openai: + specifier: 4.71.1 + version: 4.71.1(zod@3.23.8) + tsx: + specifier: 4.19.2 + version: 4.19.2 typescript: - specifier: ^5.6.2 - version: 5.6.3 + specifier: 5.6.2 + version: 5.6.2 uuid: - specifier: ^10.0.0 + specifier: 10.0.0 version: 10.0.0 zod: - specifier: ^3.23.8 + specifier: 3.23.8 version: 3.23.8 zod-to-json-schema: - specifier: ^3.23.3 - version: 3.23.5(zod@3.23.8) + specifier: 3.23.3 + version: 3.23.3(zod@3.23.8) devDependencies: '@restackio/cloud': - specifier: ^1.0.19 - version: 1.0.19 + specifier: 1.0.21 + version: 1.0.21 '@types/node': - specifier: ^22.5.5 - version: 22.9.1 + specifier: 22.5.5 + version: 22.5.5 '@types/uuid': - specifier: ^10.0.0 + specifier: 10.0.0 version: 10.0.0 + dotenv-cli: + specifier: 7.4.4 + version: 7.4.4 nodemon: - specifier: ^3.1.4 - version: 3.1.7 + specifier: 3.1.4 + version: 3.1.4 ts-node: - specifier: ^10.9.2 - version: 10.9.2(@swc/core@1.9.3)(@types/node@22.9.1)(typescript@5.6.3) + specifier: 10.9.2 + version: 10.9.2(@swc/core@1.9.3)(@types/node@22.5.5)(typescript@5.6.2) ts-node-dev: - specifier: ^2.0.0 - version: 2.0.0(@swc/core@1.9.3)(@types/node@22.9.1)(typescript@5.6.3) + specifier: 2.0.0 + version: 2.0.0(@swc/core@1.9.3)(@types/node@22.5.5)(typescript@5.6.2) packages: @@ -61,6 +67,150 @@ packages: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} + '@esbuild/aix-ppc64@0.23.1': + resolution: {integrity: sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.23.1': + resolution: {integrity: sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.23.1': + resolution: {integrity: sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.23.1': + resolution: {integrity: sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.23.1': + resolution: {integrity: sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.23.1': + resolution: {integrity: sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.23.1': + resolution: {integrity: sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.23.1': + resolution: {integrity: sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.23.1': + resolution: {integrity: sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.23.1': + resolution: {integrity: sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.23.1': + resolution: {integrity: sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.23.1': + resolution: {integrity: sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.23.1': + resolution: {integrity: sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.23.1': + resolution: {integrity: sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.23.1': + resolution: {integrity: sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.23.1': + resolution: {integrity: sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.23.1': + resolution: {integrity: sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-x64@0.23.1': + resolution: {integrity: sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.23.1': + resolution: {integrity: sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.23.1': + resolution: {integrity: sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/sunos-x64@0.23.1': + resolution: {integrity: sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.23.1': + resolution: {integrity: sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.23.1': + resolution: {integrity: sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.23.1': + resolution: {integrity: sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + '@graphql-typed-document-node/core@3.2.0': resolution: {integrity: sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==} peerDependencies: @@ -160,20 +310,14 @@ packages: '@protobufjs/utf8@1.1.0': resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} - '@restackio/ai@0.0.85': - resolution: {integrity: sha512-UWDcywhNjcTn7TbgqJL1ahzpf722RZV57rnR/b5s48eMgUHZNNxMJWDvCYIW5IZKEvzLp124iu0FNrV9UbKTpA==} + '@restackio/ai@0.0.86': + resolution: {integrity: sha512-i4krGAb6mGRhk+5+H81uUK+mfu8DDBGtqb+HaSDq2uXDflrmbO+CrNbMfv5WMQKH6GMjM/RNw5CO7f6be48CsA==} engines: {node: '>=20'} - '@restackio/cloud@1.0.19': - resolution: {integrity: sha512-UJNfM4di6qGa3EqAZzUdcrGjK6tIj2YmQbGZouBZjpHDqG3kbzMZkgNPcW/UsCp0HYCKS36pUmDy6m1GkMFgNQ==} + '@restackio/cloud@1.0.21': + resolution: {integrity: sha512-KZTl9vww0eGoAVf7TKmOIk9fJ+OIlLzwjLzJb2tILFsye08nvmEvVM5KW8oCxyeXxtAyATYsysqs626XND5p1g==} engines: {node: '>=18'} - '@restackio/integrations-linear@0.0.8': - resolution: {integrity: sha512-e27BeNtZ0MtYNTOJdX84u5f2Q+ei9n1j2L5KMQZ8IDi3h2LuPziid3e/1xwYt2InZG4GU0rfNXYcJOxOzRtvOg==} - - '@restackio/integrations-openai@0.0.34': - resolution: {integrity: sha512-lXI9nHCDHZmSV52CFqVxpbO0egEQC4daLI9u+P8OxrUcCAfsPfgItO35hHi+orUubUGcQJAN4NdB3bTr2xqqeQ==} - '@swc/core-darwin-arm64@1.9.3': resolution: {integrity: sha512-hGfl/KTic/QY4tB9DkTbNuxy5cV4IeejpPD4zo+Lzt4iLlDWIeANL4Fkg67FiVceNJboqg48CUX+APhDHO5G1w==} engines: {node: '>=10'} @@ -255,8 +399,8 @@ packages: '@temporalio/client@1.11.5': resolution: {integrity: sha512-Q8hFqxyf41MQmCeyxcGpbiMyuxhilvG8FScFwSbFs8ZZPZykNcpr5o+TOowLWzGWAL5f2bIKETh/eXDZpZvY7g==} - '@temporalio/common@1.11.1': - resolution: {integrity: sha512-8fQwmYHMakSbqMX26FNfiLwBwVwsMNbGmVfGaFOqy72QZuUiXxgmImXQhK6ir1ieeH8bLyY5laAosB4W6VPBAA==} + '@temporalio/common@1.11.2': + resolution: {integrity: sha512-2bUDFGhxWG7uLROkA0aP5oy6NPSmL+mPttObecMAXQqOs7Hb4s1o9uBQ98nojy25zauzvx5btIO/H+5UxUXfOQ==} '@temporalio/common@1.11.5': resolution: {integrity: sha512-6cgGTAT+jSKKwCPOoUDIseJuDroP7cEIAX/pYpNBRGvfj+lpU8GitSVsPEZTVoMQ400otzBa1n80aH8bnOLVTw==} @@ -264,8 +408,8 @@ packages: '@temporalio/core-bridge@1.11.5': resolution: {integrity: sha512-1IzxtPrndR99golP1yZnvsOHU9QP5o9KdNtM/W5VxChFc0ihmeZpisptgfYyqa9VaO/Bs9wEoSmH6fCSB9knTQ==} - '@temporalio/proto@1.11.1': - resolution: {integrity: sha512-qTNSsU88IOJbv6lhWyW0qAHAYg4euEW/NNPgAp5ohfPkqaw+/j51QABO9E6m/KQwMZ6x43z2JjQRS37aC6Psiw==} + '@temporalio/proto@1.11.2': + resolution: {integrity: sha512-h7Iw5hmUf8dGaozpk3WyRuOB5ZzBaFensfocK2eGui15ocNvtAb/aLFsxVJ6xOtryOsHTkgRam5BBZi0NOj+cA==} '@temporalio/proto@1.11.5': resolution: {integrity: sha512-LjRGQdLRpRxDp2NSyNyhCp7JLaUlMY2T+hAeGfueR5cOVZxHXTO8TXnnjimi0UM1knyA6sW3yNJCNieKlCcASg==} @@ -274,8 +418,8 @@ packages: resolution: {integrity: sha512-WeIK/2ZQMCFVz89FeSa081kMDeHbyL0yZf335Rn0my2l0TcWWoHjVI9kQGuEAuP6fke/sCCQxpcxJ8EvEMHX8w==} engines: {node: '>= 16.0.0'} - '@temporalio/workflow@1.11.1': - resolution: {integrity: sha512-aTfoHPc6O/7UioOSe+PHmpzLZveG2qn0VI/snlclPFs8VO8r5hcbXb5jYeuzCi26mm7Z+Dxmf2hCK77tJlPeKg==} + '@temporalio/workflow@1.11.2': + resolution: {integrity: sha512-2E9hNKkeboOcdOddC/hd/bXL5kCfw2BgxskuPX8ipr6o8nQ7DaVFQapn+jEuw0pn7A5mLpPuNqF94vnZ4E37gQ==} '@temporalio/workflow@1.11.5': resolution: {integrity: sha512-U0kGoQ6bttEiT59km+cpeSxVr2Bq8ZHmlurP2N+9nQdxa10RsMqrp5YQrJQfg7KrfrYbeY1HyJBQ7Ljy1FrOtQ==} @@ -310,8 +454,8 @@ packages: '@types/node@18.19.64': resolution: {integrity: sha512-955mDqvO2vFf/oL7V3WiUtiz+BugyX8uVbaT2H8oj3+8dRyH2FLiNdowe7eNqRM7IOIZvzDH76EoAT+gwm6aIQ==} - '@types/node@22.9.1': - resolution: {integrity: sha512-p8Yy/8sw1caA8CdRIQBG5tiLHmxtQKObCijiAa9Ez+d4+PRffM4054xbju0msf+cvhJpnFEeNjxmVT/0ipktrg==} + '@types/node@22.5.5': + resolution: {integrity: sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==} '@types/strip-bom@3.0.0': resolution: {integrity: sha512-xevGOReSYGM7g/kUBZzPqCrR/KYAo+F0yiPc85WFTJa0MSLtyFTVTU6cJu/aV4mid7IffDIWqo69THF2o4JiEQ==} @@ -488,6 +632,10 @@ packages: create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + debug@4.3.7: resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} engines: {node: '>=6.0'} @@ -517,6 +665,14 @@ packages: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} + dotenv-cli@7.4.4: + resolution: {integrity: sha512-XkBYCG0tPIes+YZr4SpfFv76SQrV/LeCE8CI7JSEMi3VR9MvTihCGTOtbIexD6i2mXF+6px7trb1imVCXSNMDw==} + hasBin: true + + dotenv-expand@10.0.0: + resolution: {integrity: sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==} + engines: {node: '>=12'} + dotenv@16.4.5: resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} engines: {node: '>=12'} @@ -537,6 +693,11 @@ packages: es-module-lexer@1.5.4: resolution: {integrity: sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==} + esbuild@0.23.1: + resolution: {integrity: sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==} + engines: {node: '>=18'} + hasBin: true + escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} @@ -604,6 +765,9 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} + get-tsconfig@4.8.1: + resolution: {integrity: sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==} + glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -697,6 +861,9 @@ packages: resolution: {integrity: sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==} engines: {node: '>=16'} + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + isexe@3.1.1: resolution: {integrity: sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==} engines: {node: '>=16'} @@ -779,8 +946,8 @@ packages: node-releases@2.0.18: resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==} - nodemon@3.1.7: - resolution: {integrity: sha512-hLj7fuMow6f0lbB0cD14Lz2xNjwsyruH251Pk4t/yIitCFJbmY1myuLlHm/q06aST4jg6EgAh74PIBBrRqpVAQ==} + nodemon@3.1.4: + resolution: {integrity: sha512-wjPBbFhtpJwmIeY2yP7QF+UKzPfltVGtfce1g/bB15/8vCGZj8uxD62b/b9M9/WVgme0NZudpownKN+c0plXlQ==} engines: {node: '>=10'} hasBin: true @@ -795,8 +962,8 @@ packages: resolution: {integrity: sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==} engines: {node: '>=18'} - openai@4.73.0: - resolution: {integrity: sha512-NZstV77w3CEol9KQTRBRQ15+Sw6nxVTicAULSjYO4wn9E5gw72Mtp3fAVaBFXyyVPws4241YmFG6ya4L8v03tA==} + openai@4.71.1: + resolution: {integrity: sha512-C6JNMaQ1eijM0lrjiRUL3MgThVP5RdwNAghpbJFdW0t11LzmyqON8Eh8MuUuEZ+CeD6bgYl2Fkn2BoptVxv9Ug==} hasBin: true peerDependencies: zod: ^3.23.8 @@ -808,6 +975,10 @@ packages: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} @@ -847,6 +1018,9 @@ packages: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} + resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + resolve@1.22.8: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} hasBin: true @@ -881,6 +1055,14 @@ packages: serialize-javascript@6.0.2: resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + simple-git@3.27.0: resolution: {integrity: sha512-ivHoFS9Yi9GY49ogc6/YAi3Fl9ROnF4VyubNylgCkA+RVqLaKWnDSzXOVzya8csELIaWaYNutsEuAhZrtOjozA==} @@ -1036,12 +1218,17 @@ packages: tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + tsx@4.19.2: + resolution: {integrity: sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==} + engines: {node: '>=18.0.0'} + hasBin: true + type-fest@2.19.0: resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} engines: {node: '>=12.20'} - typescript@5.6.3: - resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==} + typescript@5.6.2: + resolution: {integrity: sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==} engines: {node: '>=14.17'} hasBin: true @@ -1108,6 +1295,11 @@ packages: whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + which@4.0.0: resolution: {integrity: sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==} engines: {node: ^16.13.0 || >=18.0.0} @@ -1143,8 +1335,8 @@ packages: yup@1.4.0: resolution: {integrity: sha512-wPbgkJRCqIf+OHyiTBQoJiP5PFuAXaWiJK6AmYkzQAh5/c2K9hzSApBZG5wV9KoKSePF7sAxmNSvh/13YHkFDg==} - zod-to-json-schema@3.23.5: - resolution: {integrity: sha512-5wlSS0bXfF/BrL4jPAbz9da5hDlDptdEppYfe+x4eIJ7jioqKG9uUxOwPzqof09u/XeVdrgFu29lZi+8XNDJtA==} + zod-to-json-schema@3.23.3: + resolution: {integrity: sha512-TYWChTxKQbRJp5ST22o/Irt9KC5nj7CdBKYB/AosCRdj/wxEMvv4NNaj9XVUHDOIp53ZxArGhnw5HMZziPFjog==} peerDependencies: zod: ^3.23.3 @@ -1157,6 +1349,78 @@ snapshots: dependencies: '@jridgewell/trace-mapping': 0.3.9 + '@esbuild/aix-ppc64@0.23.1': + optional: true + + '@esbuild/android-arm64@0.23.1': + optional: true + + '@esbuild/android-arm@0.23.1': + optional: true + + '@esbuild/android-x64@0.23.1': + optional: true + + '@esbuild/darwin-arm64@0.23.1': + optional: true + + '@esbuild/darwin-x64@0.23.1': + optional: true + + '@esbuild/freebsd-arm64@0.23.1': + optional: true + + '@esbuild/freebsd-x64@0.23.1': + optional: true + + '@esbuild/linux-arm64@0.23.1': + optional: true + + '@esbuild/linux-arm@0.23.1': + optional: true + + '@esbuild/linux-ia32@0.23.1': + optional: true + + '@esbuild/linux-loong64@0.23.1': + optional: true + + '@esbuild/linux-mips64el@0.23.1': + optional: true + + '@esbuild/linux-ppc64@0.23.1': + optional: true + + '@esbuild/linux-riscv64@0.23.1': + optional: true + + '@esbuild/linux-s390x@0.23.1': + optional: true + + '@esbuild/linux-x64@0.23.1': + optional: true + + '@esbuild/netbsd-x64@0.23.1': + optional: true + + '@esbuild/openbsd-arm64@0.23.1': + optional: true + + '@esbuild/openbsd-x64@0.23.1': + optional: true + + '@esbuild/sunos-x64@0.23.1': + optional: true + + '@esbuild/win32-arm64@0.23.1': + optional: true + + '@esbuild/win32-ia32@0.23.1': + optional: true + + '@esbuild/win32-x64@0.23.1': + optional: true + '@graphql-typed-document-node/core@3.2.0(graphql@15.9.0)': dependencies: graphql: 15.9.0 @@ -1257,7 +1521,7 @@ snapshots: '@protobufjs/utf8@1.1.0': {} - '@restackio/ai@0.0.85': + '@restackio/ai@0.0.86': dependencies: '@temporalio/activity': 1.11.5 '@temporalio/client': 1.11.5 @@ -1269,7 +1533,7 @@ snapshots: - uglify-js - webpack-cli - '@restackio/cloud@1.0.19': + '@restackio/cloud@1.0.21': dependencies: chalk: 4.1.2 dotenv: 16.4.5 @@ -1280,19 +1544,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@restackio/integrations-linear@0.0.8': - dependencies: - '@linear/sdk': 29.0.0 - transitivePeerDependencies: - - encoding - - '@restackio/integrations-openai@0.0.34(zod@3.23.8)': - dependencies: - openai: 4.73.0(zod@3.23.8) - transitivePeerDependencies: - - encoding - - zod - '@swc/core-darwin-arm64@1.9.3': optional: true @@ -1359,9 +1610,9 @@ snapshots: long: 5.2.3 uuid: 9.0.1 - '@temporalio/common@1.11.1': + '@temporalio/common@1.11.2': dependencies: - '@temporalio/proto': 1.11.1 + '@temporalio/proto': 1.11.2 long: 5.2.3 ms: 3.0.0-canary.1 proto3-json-serializer: 2.0.2 @@ -1380,7 +1631,7 @@ snapshots: cargo-cp-artifact: 0.1.9 which: 4.0.0 - '@temporalio/proto@1.11.1': + '@temporalio/proto@1.11.2': dependencies: long: 5.2.3 protobufjs: 7.4.0 @@ -1415,10 +1666,10 @@ snapshots: - uglify-js - webpack-cli - '@temporalio/workflow@1.11.1': + '@temporalio/workflow@1.11.2': dependencies: - '@temporalio/common': 1.11.1 - '@temporalio/proto': 1.11.1 + '@temporalio/common': 1.11.2 + '@temporalio/proto': 1.11.2 '@temporalio/workflow@1.11.5': dependencies: @@ -1449,14 +1700,14 @@ snapshots: '@types/node-fetch@2.6.12': dependencies: - '@types/node': 22.9.1 + '@types/node': 22.5.5 form-data: 4.0.1 '@types/node@18.19.64': dependencies: undici-types: 5.26.5 - '@types/node@22.9.1': + '@types/node@22.5.5': dependencies: undici-types: 6.19.8 @@ -1659,6 +1910,12 @@ snapshots: create-require@1.1.1: {} + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + debug@4.3.7(supports-color@5.5.0): dependencies: ms: 2.1.3 @@ -1678,6 +1935,15 @@ snapshots: diff@4.0.2: {} + dotenv-cli@7.4.4: + dependencies: + cross-spawn: 7.0.6 + dotenv: 16.4.5 + dotenv-expand: 10.0.0 + minimist: 1.2.8 + + dotenv-expand@10.0.0: {} + dotenv@16.4.5: {} dynamic-dedupe@0.3.0: @@ -1695,6 +1961,33 @@ snapshots: es-module-lexer@1.5.4: {} + esbuild@0.23.1: + optionalDependencies: + '@esbuild/aix-ppc64': 0.23.1 + '@esbuild/android-arm': 0.23.1 + '@esbuild/android-arm64': 0.23.1 + '@esbuild/android-x64': 0.23.1 + '@esbuild/darwin-arm64': 0.23.1 + '@esbuild/darwin-x64': 0.23.1 + '@esbuild/freebsd-arm64': 0.23.1 + '@esbuild/freebsd-x64': 0.23.1 + '@esbuild/linux-arm': 0.23.1 + '@esbuild/linux-arm64': 0.23.1 + '@esbuild/linux-ia32': 0.23.1 + '@esbuild/linux-loong64': 0.23.1 + '@esbuild/linux-mips64el': 0.23.1 + '@esbuild/linux-ppc64': 0.23.1 + '@esbuild/linux-riscv64': 0.23.1 + '@esbuild/linux-s390x': 0.23.1 + '@esbuild/linux-x64': 0.23.1 + '@esbuild/netbsd-x64': 0.23.1 + '@esbuild/openbsd-arm64': 0.23.1 + '@esbuild/openbsd-x64': 0.23.1 + '@esbuild/sunos-x64': 0.23.1 + '@esbuild/win32-arm64': 0.23.1 + '@esbuild/win32-ia32': 0.23.1 + '@esbuild/win32-x64': 0.23.1 + escalade@3.2.0: {} eslint-scope@5.1.1: @@ -1746,6 +2039,10 @@ snapshots: get-caller-file@2.0.5: {} + get-tsconfig@4.8.1: + dependencies: + resolve-pkg-maps: 1.0.0 + glob-parent@5.1.2: dependencies: is-glob: 4.0.3 @@ -1822,6 +2119,8 @@ snapshots: dependencies: is-inside-container: 1.0.0 + isexe@2.0.0: {} + isexe@3.1.1: {} isomorphic-unfetch@3.1.0: @@ -1833,7 +2132,7 @@ snapshots: jest-worker@27.5.1: dependencies: - '@types/node': 22.9.1 + '@types/node': 22.5.5 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -1886,7 +2185,7 @@ snapshots: node-releases@2.0.18: {} - nodemon@3.1.7: + nodemon@3.1.4: dependencies: chokidar: 3.6.0 debug: 4.3.7(supports-color@5.5.0) @@ -1912,7 +2211,7 @@ snapshots: is-inside-container: 1.0.0 is-wsl: 3.1.0 - openai@4.73.0(zod@3.23.8): + openai@4.71.1(zod@3.23.8): dependencies: '@types/node': 18.19.64 '@types/node-fetch': 2.6.12 @@ -1928,6 +2227,8 @@ snapshots: path-is-absolute@1.0.1: {} + path-key@3.1.1: {} + path-parse@1.0.7: {} picocolors@1.1.1: {} @@ -1952,7 +2253,7 @@ snapshots: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 22.9.1 + '@types/node': 22.5.5 long: 5.2.3 pstree.remy@1.1.8: {} @@ -1969,6 +2270,8 @@ snapshots: require-directory@2.1.1: {} + resolve-pkg-maps@1.0.0: {} + resolve@1.22.8: dependencies: is-core-module: 2.15.1 @@ -2001,6 +2304,12 @@ snapshots: dependencies: randombytes: 2.1.0 + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@3.0.0: {} + simple-git@3.27.0: dependencies: '@kwsites/file-exists': 1.1.1 @@ -2106,7 +2415,7 @@ snapshots: tree-kill@1.2.2: {} - ts-node-dev@2.0.0(@swc/core@1.9.3)(@types/node@22.9.1)(typescript@5.6.3): + ts-node-dev@2.0.0(@swc/core@1.9.3)(@types/node@22.5.5)(typescript@5.6.2): dependencies: chokidar: 3.6.0 dynamic-dedupe: 0.3.0 @@ -2116,29 +2425,29 @@ snapshots: rimraf: 2.7.1 source-map-support: 0.5.21 tree-kill: 1.2.2 - ts-node: 10.9.2(@swc/core@1.9.3)(@types/node@22.9.1)(typescript@5.6.3) + ts-node: 10.9.2(@swc/core@1.9.3)(@types/node@22.5.5)(typescript@5.6.2) tsconfig: 7.0.0 - typescript: 5.6.3 + typescript: 5.6.2 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' - '@types/node' - ts-node@10.9.2(@swc/core@1.9.3)(@types/node@22.9.1)(typescript@5.6.3): + ts-node@10.9.2(@swc/core@1.9.3)(@types/node@22.5.5)(typescript@5.6.2): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 22.9.1 + '@types/node': 22.5.5 acorn: 8.14.0 acorn-walk: 8.3.4 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.6.3 + typescript: 5.6.2 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 optionalDependencies: @@ -2153,9 +2462,16 @@ snapshots: tslib@2.8.1: {} + tsx@4.19.2: + dependencies: + esbuild: 0.23.1 + get-tsconfig: 4.8.1 + optionalDependencies: + fsevents: 2.3.3 + type-fest@2.19.0: {} - typescript@5.6.3: {} + typescript@5.6.2: {} undefsafe@2.0.5: {} @@ -2231,6 +2547,10 @@ snapshots: tr46: 0.0.3 webidl-conversions: 3.0.1 + which@2.0.2: + dependencies: + isexe: 2.0.0 + which@4.0.0: dependencies: isexe: 3.1.1 @@ -2268,7 +2588,7 @@ snapshots: toposort: 2.0.2 type-fest: 2.19.0 - zod-to-json-schema@3.23.5(zod@3.23.8): + zod-to-json-schema@3.23.3(zod@3.23.8): dependencies: zod: 3.23.8 diff --git a/posthog/restack_up.mjs b/posthog/restack_up.mjs index 7c5300c..de81359 100644 --- a/posthog/restack_up.mjs +++ b/posthog/restack_up.mjs @@ -6,16 +6,16 @@ const main = async () => { const restackEngineEnvs = [ { - name: "RESTACK_ENGINE_ENV_ID", - value: process.env.RESTACK_ENGINE_ENV_ID, + name: "RESTACK_ENGINE_ID", + value: process.env.RESTACK_ENGINE_ID, }, { - name: "RESTACK_ENGINE_ENV_ADDRESS", - value: process.env.RESTACK_ENGINE_ENV_ADDRESS, + name: "RESTACK_ENGINE_ADDRESS", + value: process.env.RESTACK_ENGINE_ADDRESS, }, { - name: "RESTACK_ENGINE_ENV_API_KEY", - value: process.env.RESTACK_ENGINE_ENV_API_KEY, + name: "RESTACK_ENGINE_API_KEY", + value: process.env.RESTACK_ENGINE_API_KEY, }, ]; @@ -25,17 +25,55 @@ const main = async () => { dockerBuildContext: "posthog", environmentVariables: [ ...restackEngineEnvs, - ...Object.keys(process.env).map((key) => ({ - name: key, - value: process.env[key], - })), + { + name: "POSTHOG_API_KEY", + value: process.env.POSTHOG_API_KEY, + }, + { + name: "POSTHOG_PROJECT_ID", + value: process.env.POSTHOG_PROJECT_ID, + }, + { + name: "POSTHOG_HOST", + value: process.env.POSTHOG_HOST, + }, + { + name: "OPENAI_API_KEY", + value: process.env.OPENAI_API_KEY, + }, + { + name: "LINEAR_API_KEY", + value: process.env.LINEAR_API_KEY, + }, + { + name: "LINEAR_TEAM_ID", + value: process.env.LINEAR_TEAM_ID, + }, ], }; + const engine = { + name: 'restack_engine', + image: 'ghcr.io/restackio/restack:main', + portMapping: [ + { + port: 5233, + path: '/', + name: 'engine-frontend', + }, + { + port: 6233, + path: '/api', + name: 'engine-api', + }, + ], + environmentVariables: [...restackEngineEnvs], + }; + await restackCloudClient.stack({ name: "posthog-example", previewEnabled: false, - applications: [servicesApp], + applications: [servicesApp, engine], }); await restackCloudClient.up(); diff --git a/posthog/src/functions/index.ts b/posthog/src/functions/index.ts index f412531..8780164 100644 --- a/posthog/src/functions/index.ts +++ b/posthog/src/functions/index.ts @@ -1,2 +1,5 @@ +export * from "./linear"; +export * from "./openai"; export * from "./posthog"; export * from "./utils"; + diff --git a/posthog/src/functions/linear/createComment.ts b/posthog/src/functions/linear/createComment.ts new file mode 100644 index 0000000..591e17f --- /dev/null +++ b/posthog/src/functions/linear/createComment.ts @@ -0,0 +1,27 @@ +import { FunctionFailure, log } from "@restackio/ai/function"; +import { CommentCreateInput } from "@linear/sdk/dist/_generated_documents"; +import { linearClient } from "./utils/client"; + +export async function linearCreateComment({ + comment, + apiKey, +}: { + comment: CommentCreateInput; + apiKey?: string; +}) { + if (!comment) { + throw FunctionFailure.nonRetryable("No comment"); + } + + try { + const linear = linearClient({ apiKey }); + + const result = await linear.createComment(comment); + + log.debug("result", { result }); + + return result; + } catch (error) { + throw new Error(`Linear error ${error}`); + } +} diff --git a/posthog/src/functions/linear/createIssue.ts b/posthog/src/functions/linear/createIssue.ts new file mode 100644 index 0000000..6b5dab6 --- /dev/null +++ b/posthog/src/functions/linear/createIssue.ts @@ -0,0 +1,27 @@ +import { FunctionFailure, log } from "@restackio/ai/function"; +import { IssueCreateInput } from "@linear/sdk/dist/_generated_documents"; +import { linearClient } from "./utils/client"; + +export async function linearCreateIssue({ + issue, + apiKey, +}: { + issue: IssueCreateInput; + apiKey?: string; +}) { + if (!issue) { + throw FunctionFailure.nonRetryable("No issue"); + } + + try { + const linear = linearClient({ apiKey }); + + const result = await linear.createIssue(issue); + + log.debug("result", { result }); + + return result; + } catch (error) { + throw new Error(`Fal error ${error}`); + } +} diff --git a/posthog/src/functions/linear/index.ts b/posthog/src/functions/linear/index.ts new file mode 100644 index 0000000..fc7d70d --- /dev/null +++ b/posthog/src/functions/linear/index.ts @@ -0,0 +1,2 @@ +export * from "./createComment"; +export * from "./createIssue"; diff --git a/posthog/src/functions/linear/utils/client.ts b/posthog/src/functions/linear/utils/client.ts new file mode 100644 index 0000000..22f8789 --- /dev/null +++ b/posthog/src/functions/linear/utils/client.ts @@ -0,0 +1,18 @@ +import { LinearClient } from "@linear/sdk"; +import "dotenv/config"; + +let clientLinear: LinearClient; + +export function linearClient({ + apiKey = process.env.LINEAR_API_KEY, +}: { + apiKey?: string; +}) { + if (!apiKey) { + throw new Error("API key is required to create Linear client."); + } + if (!clientLinear) { + clientLinear = new LinearClient({ apiKey }); + } + return clientLinear; +} diff --git a/posthog/src/functions/openai/chat/completionsBase.ts b/posthog/src/functions/openai/chat/completionsBase.ts new file mode 100644 index 0000000..0889059 --- /dev/null +++ b/posthog/src/functions/openai/chat/completionsBase.ts @@ -0,0 +1,92 @@ +import { FunctionFailure, log } from "@restackio/ai/function"; +import OpenAI from "openai/index"; +import { ChatCompletionCreateParamsNonStreaming } from "openai/resources/chat/completions"; +import { openaiClient } from "../utils/client"; +import { openaiCost, Price } from "../utils/cost"; +import { ChatCompletion, ChatModel } from "openai/resources/index"; + +export type UsageOutput = { tokens: number; cost: number }; + +export type OpenAIChatInput = { + userContent: string; + systemContent?: string; + model?: ChatModel; + jsonSchema?: { + name: string; + schema: Record; + }; + price?: Price; + apiKey?: string; + params?: ChatCompletionCreateParamsNonStreaming; + tools?: OpenAI.Chat.Completions.ChatCompletionTool[]; + toolChoice?: OpenAI.Chat.Completions.ChatCompletionToolChoiceOption; +}; + +export const openaiChatCompletionsBase = async ({ + userContent, + systemContent = "", + model = "gpt-4o-mini", + jsonSchema, + price, + apiKey, + params, + tools, + toolChoice, +}: OpenAIChatInput): Promise<{ result: ChatCompletion; cost?: number }> => { + try { + const openai = openaiClient({ apiKey }); + + const isO1Model = model.startsWith("o1-"); + + const o1ModelParams = { + temperature: 1, + top_p: 1, + frequency_penalty: 0, + presence_penalty: 0, + }; + + const chatParams: ChatCompletionCreateParamsNonStreaming = { + messages: [ + ...(systemContent ? [{ role: "system" as const, content: systemContent }] : []), + { role: "user" as const, content: userContent }, + ...(params?.messages ?? []), + ], + ...(jsonSchema && { + response_format: { + type: "json_schema", + json_schema: { + name: jsonSchema.name, + strict: true, + schema: jsonSchema.schema, + }, + }, + }), + model, + ...(tools && { tools }), + ...(toolChoice && { tool_choice: toolChoice }), + ...params, + ...(isO1Model && o1ModelParams), + }; + + log.debug("OpenAI chat completion params", { + chatParams, + }); + + const completion = await openai.chat.completions.create(chatParams); + + return { + result: completion, + cost: + price && + openaiCost({ + price, + tokensCount: { + input: completion.usage?.prompt_tokens ?? 0, + output: completion.usage?.completion_tokens ?? 0, + }, + }), + }; + } catch (error) { + throw FunctionFailure.nonRetryable(`Error OpenAI chat: ${error}`); + } +}; \ No newline at end of file diff --git a/posthog/src/functions/openai/chat/completionsStream.ts b/posthog/src/functions/openai/chat/completionsStream.ts new file mode 100644 index 0000000..bcd9097 --- /dev/null +++ b/posthog/src/functions/openai/chat/completionsStream.ts @@ -0,0 +1,193 @@ +import OpenAI from "openai/index"; +import { ChatCompletionChunk } from "openai/resources/chat/completions"; + +import Restack from "@restackio/ai"; +import { currentWorkflow, log } from "@restackio/ai/function"; + +import { StreamEvent, ToolCallEvent } from "../types/events"; + +import { aggregateStreamChunks } from "../utils/aggregateStream"; +import { mergeToolCalls } from "../utils/mergeToolCalls"; +import { openaiClient } from "../utils/client"; +import { openaiCost, Price } from "../utils/cost"; +import { SendWorkflowEvent } from "@restackio/ai/event"; +import { ChatModel } from "openai/resources/index"; + +export async function openaiChatCompletionsStream({ + model = "gpt-4o-mini", + userName, + newMessage, + assistantName, + messages = [], + tools, + toolEvent, + streamAtCharacter, + streamEvent, + apiKey, + price, +}: { + model?: ChatModel; + userName?: string; + newMessage?: string; + assistantName?: string; + messages?: OpenAI.Chat.Completions.ChatCompletionMessageParam[]; + tools?: OpenAI.Chat.Completions.ChatCompletionTool[]; + toolEvent?: { + workflowEventName: string; + workflow?: SendWorkflowEvent["workflow"]; + }; + streamAtCharacter?: string; + streamEvent?: { + workflowEventName: string; + workflow?: SendWorkflowEvent["workflow"]; + }; + apiKey?: string; + price?: Price; +}) { + const restack = new Restack(); + const workflow = currentWorkflow().workflowExecution; + + log.debug("workflow", { workflow }); + + if (newMessage) { + messages.push({ + role: "user", + name: userName, + content: newMessage, + }); + } + + const openai = openaiClient({ apiKey }); + const chatStream = await openai.chat.completions.create({ + model: model, + messages, + tools, + stream: true, + stream_options: { + include_usage: true, + }, + }); + + const [stream, streamEnd] = chatStream.tee(); + const readableStream = streamEnd.toReadableStream() as unknown as ReadableStream; + const aggregatedStream = await aggregateStreamChunks(readableStream); + + let finishReason: ChatCompletionChunk.Choice["finish_reason"]; + let response: ChatCompletionChunk.Choice.Delta["content"] = ""; + let tokensCountInput = 0; + let tokensCountOutput = 0; + + for await (const chunk of stream) { + let content = chunk.choices[0]?.delta?.content || ""; + finishReason = chunk.choices[0]?.finish_reason; + tokensCountInput += chunk.usage?.prompt_tokens ?? 0; + tokensCountOutput += chunk.usage?.completion_tokens ?? 0; + + if (finishReason === "tool_calls") { + const { toolCalls } = mergeToolCalls(aggregatedStream); + await Promise.all( + toolCalls.map((toolCall) => { + if (toolEvent) { + const functionArguments = JSON.parse( + toolCall.function?.arguments ?? "" + ); + + const input: ToolCallEvent = { + ...toolCall, + function: { + name: toolCall.function?.name ?? "", + input: functionArguments, + }, + assistantName, + }; + + if (toolEvent) { + const workflowEvent = { + event: { + name: toolEvent.workflowEventName, + input, + }, + workflow: { + ...workflow, + ...toolEvent.workflow, + }, + }; + log.debug("toolEvent sendWorkflowEvent", { workflowEvent }); + + restack.sendWorkflowEvent(workflowEvent); + } + } + }) + ); + return { + result: { + messages, + toolCalls, + }, + cost: + price && + openaiCost({ + price, + tokensCount: { + input: tokensCountInput, + output: tokensCountOutput, + }, + }), + }; + } else { + response += content; + if ( + content.trim().slice(-1) === streamAtCharacter || + finishReason === "stop" + ) { + if (response.length) { + const input: StreamEvent = { + chunkId: chunk.id, + response, + assistantName, + isLast: finishReason === "stop", + }; + if (streamEvent) { + const workflowEvent = { + event: { + name: streamEvent.workflowEventName, + input, + }, + workflow: { + ...workflow, + ...streamEvent.workflow, + }, + }; + log.debug("streamEvent sendWorkflowEvent", { workflowEvent }); + restack.sendWorkflowEvent(workflowEvent); + } + } + } + + if (finishReason === "stop") { + const newMessage: OpenAI.Chat.Completions.ChatCompletionMessageParam = { + content: response, + role: "assistant", + name: assistantName, + }; + + messages.push(newMessage); + + return { + result: { + messages, + }, + cost: + price && + openaiCost({ + price, + tokensCount: { + input: tokensCountInput, + output: tokensCountOutput, + }, + }), + }; + } + } + } +} diff --git a/posthog/src/functions/openai/chat/index.ts b/posthog/src/functions/openai/chat/index.ts new file mode 100644 index 0000000..3cb4077 --- /dev/null +++ b/posthog/src/functions/openai/chat/index.ts @@ -0,0 +1,2 @@ +export * from "./completionsBase"; +export * from "./completionsStream"; diff --git a/posthog/src/functions/openai/index.ts b/posthog/src/functions/openai/index.ts new file mode 100644 index 0000000..6a947d6 --- /dev/null +++ b/posthog/src/functions/openai/index.ts @@ -0,0 +1,2 @@ +export * from "./chat"; +export * from "./thread"; diff --git a/posthog/src/functions/openai/thread/createAssistant.ts b/posthog/src/functions/openai/thread/createAssistant.ts new file mode 100644 index 0000000..f893399 --- /dev/null +++ b/posthog/src/functions/openai/thread/createAssistant.ts @@ -0,0 +1,34 @@ +import { ChatModel } from "openai/resources/index"; +import { FunctionFailure } from "@restackio/ai/function"; +import { Assistant, AssistantTool } from "openai/resources/beta/index"; + +import { openaiClient } from "../utils/client"; + +export async function createAssistant({ + apiKey, + name, + instructions, + model = "gpt-4o-mini", + tools = [], +}: { + apiKey: string; + name: string; + instructions: string; + tools?: AssistantTool[]; + model: ChatModel; +}): Promise { + try { + const openai = openaiClient({ apiKey }); + + const assistant = await openai.beta.assistants.create({ + name, + instructions, + model, + tools, + }); + + return assistant; + } catch (error) { + throw FunctionFailure.nonRetryable(`Error creating assistant: ${error}`); + } +} diff --git a/posthog/src/functions/openai/thread/createMessageOnThread.ts b/posthog/src/functions/openai/thread/createMessageOnThread.ts new file mode 100644 index 0000000..63b4a24 --- /dev/null +++ b/posthog/src/functions/openai/thread/createMessageOnThread.ts @@ -0,0 +1,28 @@ +import OpenAI from "openai/index"; +import { FunctionFailure } from "@restackio/ai/function"; + +import { openaiClient } from "../utils/client"; + +export async function createMessageOnThread({ + apiKey, + threadId, + content, + role, +}: { + apiKey: string; + threadId: string; + content: string; + role: OpenAI.Beta.Threads.MessageCreateParams["role"]; +}) { + try { + const openai = openaiClient({ apiKey }); + await openai.beta.threads.messages.create(threadId, { + role, + content, + }); + } catch (error) { + throw FunctionFailure.nonRetryable( + `Error creating message thread: ${error}` + ); + } +} diff --git a/posthog/src/functions/openai/thread/createThread.ts b/posthog/src/functions/openai/thread/createThread.ts new file mode 100644 index 0000000..5d29652 --- /dev/null +++ b/posthog/src/functions/openai/thread/createThread.ts @@ -0,0 +1,19 @@ +import { FunctionFailure } from "@restackio/ai/function"; +import { Thread } from "openai/resources/beta/index"; + +import { openaiClient } from "../utils/client"; + +export async function createThread({ + apiKey, +}: { + apiKey: string; +}): Promise { + try { + const openai = openaiClient({ apiKey }); + const thread = await openai.beta.threads.create(); + + return thread; + } catch (error) { + throw FunctionFailure.nonRetryable(`Error creating thread: ${error}`); + } +} diff --git a/posthog/src/functions/openai/thread/index.ts b/posthog/src/functions/openai/thread/index.ts new file mode 100644 index 0000000..0ef24eb --- /dev/null +++ b/posthog/src/functions/openai/thread/index.ts @@ -0,0 +1,4 @@ +export * from "./createAssistant"; +export * from "./createMessageOnThread"; +export * from "./createThread"; +export * from "./runThread"; diff --git a/posthog/src/functions/openai/thread/runThread.ts b/posthog/src/functions/openai/thread/runThread.ts new file mode 100644 index 0000000..57d17e6 --- /dev/null +++ b/posthog/src/functions/openai/thread/runThread.ts @@ -0,0 +1,31 @@ +import { FunctionFailure } from "@restackio/ai/function"; +import { Stream } from "openai/streaming"; +import { AssistantStreamEvent } from "openai/resources/beta/index"; +import { Run } from "openai/resources/beta/threads/runs/index"; + +import { openaiClient } from "../utils/client"; + +export async function runThread({ + apiKey, + threadId, + assistantId, + stream = false, +}: { + apiKey: string; + threadId: string; + assistantId: string; + stream: boolean; +}): Promise | Run> { + try { + const openai = openaiClient({ apiKey }); + + const run = await openai.beta.threads.runs.create(threadId, { + assistant_id: assistantId, + ...(stream && { stream }), + }); + + return run; + } catch (error) { + throw FunctionFailure.nonRetryable(`Error running thread: ${error}`); + } +} \ No newline at end of file diff --git a/posthog/src/functions/openai/types/events.ts b/posthog/src/functions/openai/types/events.ts new file mode 100644 index 0000000..44b071b --- /dev/null +++ b/posthog/src/functions/openai/types/events.ts @@ -0,0 +1,17 @@ +import OpenAI from "openai/index"; + +export type StreamEvent = { + chunkId?: string; + response: string; + assistantName?: string; + isLast: boolean; +}; + +export type ToolCallEvent = + OpenAI.Chat.Completions.ChatCompletionChunk.Choice.Delta.ToolCall & { + function: { + name: string; + input: JSON; + }; + assistantName?: string; + }; diff --git a/posthog/src/functions/openai/types/index.ts b/posthog/src/functions/openai/types/index.ts new file mode 100644 index 0000000..1784004 --- /dev/null +++ b/posthog/src/functions/openai/types/index.ts @@ -0,0 +1 @@ +export * from "./events"; diff --git a/posthog/src/functions/openai/utils/aggregateStream.ts b/posthog/src/functions/openai/utils/aggregateStream.ts new file mode 100644 index 0000000..18a7d74 --- /dev/null +++ b/posthog/src/functions/openai/utils/aggregateStream.ts @@ -0,0 +1,26 @@ +export async function aggregateStreamChunks(stream: ReadableStream) { + const reader = stream.getReader(); + const chunks: Uint8Array[] = []; + + while (true) { + const { done, value } = await reader.read(); + if (done) break; + if (value) chunks.push(value); + } + + const aggregated = new Uint8Array( + chunks.reduce((acc, chunk) => acc + chunk.length, 0) + ); + let offset = 0; + for (const chunk of chunks) { + aggregated.set(chunk, offset); + offset += chunk.length; + } + + const textContent = new TextDecoder().decode(aggregated); + const jsonObjects = textContent + .split("\n") + .filter((line) => line.trim()) + .map((line) => JSON.parse(line)); + return jsonObjects; +} diff --git a/posthog/src/functions/openai/utils/client.ts b/posthog/src/functions/openai/utils/client.ts new file mode 100644 index 0000000..77fd385 --- /dev/null +++ b/posthog/src/functions/openai/utils/client.ts @@ -0,0 +1,21 @@ +import OpenAI from "openai/index"; +import "dotenv/config"; + +let openaiInstance: OpenAI | null = null; + +export const openaiClient = ({ + apiKey = process.env.OPENAI_API_KEY, +}: { + apiKey?: string; +}): OpenAI => { + if (!apiKey) { + throw new Error("API key is required to create OpenAI client."); + } + + if (!openaiInstance) { + openaiInstance = new OpenAI({ + apiKey, + }); + } + return openaiInstance; +}; diff --git a/posthog/src/functions/openai/utils/cost.ts b/posthog/src/functions/openai/utils/cost.ts new file mode 100644 index 0000000..2724ab6 --- /dev/null +++ b/posthog/src/functions/openai/utils/cost.ts @@ -0,0 +1,24 @@ +export type TokensCount = { + input: number; + output: number; +}; + +export type Price = { + input: number; + output: number; +}; +export const openaiCost = ({ + tokensCount, + price, +}: { + tokensCount: TokensCount; + price: Price; +}): number => { + let cost = 0; + const { input: inputTokens, output: outputTokens } = tokensCount; + const { input: inputPrice, output: outputPrice } = price; + + cost = inputTokens * inputPrice + outputTokens * outputPrice; + + return cost; +}; diff --git a/posthog/src/functions/openai/utils/index.ts b/posthog/src/functions/openai/utils/index.ts new file mode 100644 index 0000000..0707ebb --- /dev/null +++ b/posthog/src/functions/openai/utils/index.ts @@ -0,0 +1,4 @@ +export * from "./aggregateStream"; +export * from "./client"; +export * from "./cost"; +export * from "./mergeToolCalls"; diff --git a/posthog/src/functions/openai/utils/mergeToolCalls.ts b/posthog/src/functions/openai/utils/mergeToolCalls.ts new file mode 100644 index 0000000..600170f --- /dev/null +++ b/posthog/src/functions/openai/utils/mergeToolCalls.ts @@ -0,0 +1,31 @@ +import OpenAI from "openai/index"; +import { ChatCompletionChunk } from "openai/resources/chat/completions.mjs"; + +export function mergeToolCalls(aggregatedStream: ChatCompletionChunk[]) { + const toolCalls: OpenAI.Chat.Completions.ChatCompletionChunk.Choice.Delta.ToolCall[] = + []; + + aggregatedStream.forEach((chunk) => { + chunk.choices.forEach((choice) => { + if (choice.delta.tool_calls) { + choice.delta.tool_calls.forEach((toolCall) => { + const lastToolCall = toolCalls[toolCalls.length - 1]; + if (toolCall.id) { + toolCalls.push({ + ...toolCall, + function: { ...toolCall.function, arguments: "" }, + }); + } else if ( + lastToolCall && + lastToolCall.function && + toolCall.function?.arguments + ) { + lastToolCall.function.arguments += toolCall.function.arguments; + } + }); + } + }); + }); + + return { toolCalls }; +} diff --git a/posthog/src/services.ts b/posthog/src/services.ts index 0d5fdc8..c67612b 100644 --- a/posthog/src/services.ts +++ b/posthog/src/services.ts @@ -5,10 +5,12 @@ import { posthogBlobChunks, posthogSessionEvents, workflowSendEvent, + linearCreateComment, + linearCreateIssue, + openaiChatCompletionsBase, + openaiChatCompletionsStream, } from "./functions"; -import { openaiService } from "@restackio/integrations-openai"; import { client } from "./client"; -import { linearService } from "@restackio/integrations-linear"; async function services() { const workflowsPath = require.resolve("./workflows"); @@ -36,9 +38,36 @@ async function services() { rateLimit: 240 * 60, }, }), - openaiService({ client }), - openaiService({ client, taskQueueSuffix: "-beta" }), - linearService({ client }), + client.startService({ + taskQueue: "openai", + functions: { + openaiChatCompletionsBase, + openaiChatCompletionsStream, + }, + options: { + rateLimit: 240 * 60, + }, + }), + client.startService({ + taskQueue: "openai-beta", + functions: { + openaiChatCompletionsBase, + openaiChatCompletionsStream, + }, + options: { + rateLimit: 240 * 60, + }, + }), + client.startService({ + taskQueue: "linear", + functions: { + linearCreateComment, + linearCreateIssue, + }, + options: { + rateLimit: 240 * 60, + }, + }), ]); console.log("Services running successfully."); diff --git a/posthog/src/workflows/chunk.ts b/posthog/src/workflows/chunk.ts index 67d7f6c..aba3865 100644 --- a/posthog/src/workflows/chunk.ts +++ b/posthog/src/workflows/chunk.ts @@ -1,7 +1,5 @@ import { log, step } from "@restackio/ai/workflow"; import * as functions from "../functions"; -import * as openaiFunctions from "@restackio/integrations-openai/functions"; -import { openaiTaskQueue } from "@restackio/integrations-openai/taskQueue"; import z from "zod"; import zodToJsonSchema from "zod-to-json-schema"; @@ -43,8 +41,8 @@ export async function chunkWorkflow({ schema: zodToJsonSchema(chunkSummarySchema), }; - const { cost, result } = await step({ - taskQueue: openaiTaskQueue, + const { cost, result } = await step({ + taskQueue: "openai", }).openaiChatCompletionsBase({ systemContent: "You are a helpful assistant that summarizes posthog recordings. Here is the snapshot blob of it", diff --git a/posthog/src/workflows/digest.ts b/posthog/src/workflows/digest.ts index 700ce7c..96d1f6c 100644 --- a/posthog/src/workflows/digest.ts +++ b/posthog/src/workflows/digest.ts @@ -1,10 +1,6 @@ import { executeChild, step } from "@restackio/ai/workflow"; import { recordingWorkflow } from "./recording"; import * as functions from "../functions"; -import * as openaiFunctions from "@restackio/integrations-openai/functions"; -import { openaiTaskQueue } from "@restackio/integrations-openai/taskQueue"; -import * as linearFunctions from "@restackio/integrations-linear/functions"; -import { linearTaskQueue } from "@restackio/integrations-linear/taskQueue"; export async function digestWorkflow({ projectId, @@ -60,8 +56,8 @@ export async function digestWorkflow({ // Create a digest from all the chunks summaries - const { cost, result } = await step({ - taskQueue: `${openaiTaskQueue}-beta`, + const { cost, result } = await step({ + taskQueue: `openai-beta`, }).openaiChatCompletionsBase({ model: "o1-preview", userContent: ` @@ -88,8 +84,8 @@ export async function digestWorkflow({ const digest = result.choices[0].message.content; if (linearTeamId) { - const linearResult = await step({ - taskQueue: linearTaskQueue, + const linearResult = await step({ + taskQueue: `linear`, }).linearCreateIssue({ issue: { teamId: linearTeamId, diff --git a/posthog/src/workflows/recording.ts b/posthog/src/workflows/recording.ts index f73d318..eed1652 100644 --- a/posthog/src/workflows/recording.ts +++ b/posthog/src/workflows/recording.ts @@ -4,8 +4,6 @@ import { condition, log, step } from "@restackio/ai/workflow"; import z from "zod"; import { ChunkSummary } from "./chunk"; import zodToJsonSchema from "zod-to-json-schema"; -import * as openaiFunctions from "@restackio/integrations-openai/functions"; -import { openaiTaskQueue } from "@restackio/integrations-openai/taskQueue"; export type ChunkSummaryEvent = { recordingId: string; @@ -107,8 +105,8 @@ export async function recordingWorkflow({ schema: zodToJsonSchema(recordingSummarySchema), }; - const { cost, result } = await step({ - taskQueue: openaiTaskQueue, + const { cost, result } = await step({ + taskQueue: "openai", }).openaiChatCompletionsBase({ systemContent: "You are a helpful assistant that summarizes posthog recordings.",