diff --git a/.gitignore b/.gitignore index 00d9c71..795ae92 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ node_modules dist .env -.env* .npmrc tsconfig.tsbuildinfo .DS_Store \ No newline at end of file diff --git a/examples/get-started/.env.example b/examples/get-started/.env.example new file mode 100644 index 0000000..3e12a19 --- /dev/null +++ b/examples/get-started/.env.example @@ -0,0 +1,8 @@ +# Restack Engine + +RESTACK_ENGINE_ID= +RESTACK_ENGINE_ADDRESS= +RESTACK_ENGINE_API_KEY= + +# Restack Cloud +RESTACK_CLOUD_TOKEN= \ No newline at end of file diff --git a/examples/get-started/package.json b/examples/get-started/package.json index 9cec6f9..1a99bb6 100644 --- a/examples/get-started/package.json +++ b/examples/get-started/package.json @@ -1,7 +1,7 @@ { "name": "@restackio/get-started", "version": "1.0.12", - "description": "Get started with Restack AI SDK", + "description": "Get started with the Restack AI TypeScript library", "bin": { "get-started": "bin/get-started.mjs" }, @@ -19,20 +19,22 @@ ], "license": "MIT", "dependencies": { - "@restackio/ai": "^0.0.75", - "@restackio/integrations-openai": "^0.0.24", + "@restackio/ai": "^0.0.80", "@temporalio/workflow": "^1.11.2", "nodemon": "^2.0.22", "ts-node": "^10.9.2", "wait-on": "^8.0.1" }, "scripts": { + "dev": "nodemon src/services.ts", "build-bin": "pnpm tsup --outDir bin --format esm bin/get-started.ts", "service": "ts-node src/services.ts", - "schedule": "ts-node scheduleWorkflow.ts" + "schedule": "ts-node scheduleWorkflow.ts", + "clean": "rm -rf node_modules" }, "devDependencies": { "@clack/prompts": "^0.7.0", + "@types/node": "^22.8.1", "tsup": "8.3.0", "typescript": "5.6.2" }, diff --git a/examples/get-started/pnpm-lock.yaml b/examples/get-started/pnpm-lock.yaml index 17eaef3..da96ec9 100644 --- a/examples/get-started/pnpm-lock.yaml +++ b/examples/get-started/pnpm-lock.yaml @@ -12,11 +12,8 @@ importers: .: dependencies: '@restackio/ai': - specifier: ^0.0.75 - version: 0.0.75(esbuild@0.23.1) - '@restackio/integrations-openai': - specifier: ^0.0.24 - version: 0.0.24 + specifier: ^0.0.80 + version: 0.0.80(esbuild@0.23.1) '@temporalio/workflow': specifier: ^1.11.2 version: 1.11.3 @@ -25,7 +22,7 @@ importers: version: 2.0.22 ts-node: specifier: ^10.9.2 - version: 10.9.2(@swc/core@1.7.39)(@types/node@22.7.9)(typescript@5.6.2) + version: 10.9.2(@swc/core@1.7.39)(@types/node@22.8.1)(typescript@5.6.2) wait-on: specifier: ^8.0.1 version: 8.0.1 @@ -33,6 +30,9 @@ importers: '@clack/prompts': specifier: ^0.7.0 version: 0.7.0 + '@types/node': + specifier: ^22.8.1 + version: 22.8.1 tsup: specifier: 8.3.0 version: 8.3.0(@swc/core@1.7.39)(typescript@5.6.2) @@ -296,13 +296,10 @@ packages: '@protobufjs/utf8@1.1.0': resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} - '@restackio/ai@0.0.75': - resolution: {integrity: sha512-Q3IKIJHseWM+CDoZWvgPmuv15ryZkHsCY2jq6FbdnW44MMjOOcI3QUbpZJPHLGlLZ5ucnSbQxiZBvHDDnOZfVQ==} + '@restackio/ai@0.0.80': + resolution: {integrity: sha512-igmdZOTPm70lB7QWTrp7hg1M/btsTIlWUqvZbPD9bbECCrVjsyOxlvqmZuL7fxkKfa2OR0H4P9TO5VLyEwCztQ==} engines: {node: '>=20'} - '@restackio/integrations-openai@0.0.24': - resolution: {integrity: sha512-CqkZaLobYV+mfTjTz0vcRctb16JA0KclHC3h1aKjJiylB5ht3LigC0tYWJaApDBSvUbMoA7v5QueWR9Q8fJslQ==} - '@rollup/wasm-node@4.24.0': resolution: {integrity: sha512-LL6oALR6fKG6GihtH0K0uWLAl19Q/QJst+oKJT1VWwFo4sPLA0/7JeZaSqrpFWq8OPloiKx/NDG4BWppFSX2vQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -432,14 +429,8 @@ packages: '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - '@types/node-fetch@2.6.11': - resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} - - '@types/node@18.19.59': - resolution: {integrity: sha512-vizm2EqwV/7Zay+A6J3tGl9Lhr7CjZe2HmWS988sefiEmsyP9CeXEleho6i4hJk/8UtZAo0bWN4QPZZr83RxvQ==} - - '@types/node@22.7.9': - resolution: {integrity: sha512-jrTfRC7FM6nChvU7X2KqcrgquofrWLFDeYC1hKfwNWomVvrn7JIksqf344WN2X/y8xrgqBd2dJATZV4GbatBfg==} + '@types/node@22.8.1': + resolution: {integrity: sha512-k6Gi8Yyo8EtrNtkHXutUu2corfDf9su95VYVP10aGYMMROM6SAItZi0w1XszA6RtWTHSVp5OeFof37w0IEqCQg==} '@webassemblyjs/ast@1.12.1': resolution: {integrity: sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==} @@ -510,10 +501,6 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - agentkeepalive@4.5.0: - resolution: {integrity: sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==} - engines: {node: '>= 8.0.0'} - ajv-keywords@3.5.2: resolution: {integrity: sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==} peerDependencies: @@ -755,17 +742,10 @@ packages: resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} engines: {node: '>=14'} - form-data-encoder@1.7.2: - resolution: {integrity: sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==} - form-data@4.0.1: resolution: {integrity: sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==} engines: {node: '>= 6'} - formdata-node@4.4.1: - resolution: {integrity: sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==} - engines: {node: '>= 12.20'} - fs-monkey@1.0.6: resolution: {integrity: sha512-b1FMfwetIKymC0eioW7mTywihSQE4oLzQn1dB6rZB5fx/3NpNEdAWeCSMB+60/AeT0TCXsxzAlcYVEFCTAksWg==} @@ -812,9 +792,6 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} - humanize-ms@1.2.1: - resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} - hyperdyperid@1.2.0: resolution: {integrity: sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==} engines: {node: '>=10.18'} @@ -956,19 +933,6 @@ packages: neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - node-domexception@1.0.0: - resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} - engines: {node: '>=10.5.0'} - - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - node-releases@2.0.18: resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==} @@ -993,15 +957,6 @@ packages: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} - openai@4.68.2: - resolution: {integrity: sha512-Ys3Jl9vkBUFtrFj4pgrF7rMte4JNekZoMgI6dWkkpOIwNUKGkc4I8jTqv86LB+TcoqkTPzV6DS269dPR9ILWsQ==} - hasBin: true - peerDependencies: - zod: ^3.23.8 - peerDependenciesMeta: - zod: - optional: true - package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} @@ -1239,9 +1194,6 @@ packages: resolution: {integrity: sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==} hasBin: true - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - tr46@1.0.1: resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} @@ -1302,9 +1254,6 @@ packages: undefsafe@2.0.5: resolution: {integrity: sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==} - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - undici-types@6.19.8: resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} @@ -1336,13 +1285,6 @@ packages: resolution: {integrity: sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==} engines: {node: '>=10.13.0'} - web-streams-polyfill@4.0.0-beta.3: - resolution: {integrity: sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==} - engines: {node: '>= 14'} - - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - webidl-conversions@4.0.2: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} @@ -1360,9 +1302,6 @@ packages: webpack-cli: optional: true - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - whatwg-url@7.1.0: resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} @@ -1587,7 +1526,7 @@ snapshots: '@protobufjs/utf8@1.1.0': {} - '@restackio/ai@0.0.75(esbuild@0.23.1)': + '@restackio/ai@0.0.80(esbuild@0.23.1)': dependencies: '@temporalio/activity': 1.11.3 '@temporalio/client': 1.11.3 @@ -1599,13 +1538,6 @@ snapshots: - uglify-js - webpack-cli - '@restackio/integrations-openai@0.0.24': - dependencies: - openai: 4.68.2 - transitivePeerDependencies: - - encoding - - zod - '@rollup/wasm-node@4.24.0': dependencies: '@types/estree': 1.0.6 @@ -1747,16 +1679,7 @@ snapshots: '@types/json-schema@7.0.15': {} - '@types/node-fetch@2.6.11': - dependencies: - '@types/node': 22.7.9 - form-data: 4.0.1 - - '@types/node@18.19.59': - dependencies: - undici-types: 5.26.5 - - '@types/node@22.7.9': + '@types/node@22.8.1': dependencies: undici-types: 6.19.8 @@ -1854,10 +1777,6 @@ snapshots: acorn@8.13.0: {} - agentkeepalive@4.5.0: - dependencies: - humanize-ms: 1.2.1 - ajv-keywords@3.5.2(ajv@6.12.6): dependencies: ajv: 6.12.6 @@ -2089,19 +2008,12 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 - form-data-encoder@1.7.2: {} - form-data@4.0.1: dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 mime-types: 2.1.35 - formdata-node@4.4.1: - dependencies: - node-domexception: 1.0.0 - web-streams-polyfill: 4.0.0-beta.3 - fs-monkey@1.0.6: {} fsevents@2.3.3: @@ -2136,10 +2048,6 @@ snapshots: human-signals@2.1.0: {} - humanize-ms@1.2.1: - dependencies: - ms: 2.1.3 - hyperdyperid@1.2.0: {} iconv-lite@0.6.3: @@ -2176,7 +2084,7 @@ snapshots: jest-worker@27.5.1: dependencies: - '@types/node': 22.7.9 + '@types/node': 22.8.1 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -2255,12 +2163,6 @@ snapshots: neo-async@2.6.2: {} - node-domexception@1.0.0: {} - - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - node-releases@2.0.18: {} nodemon@2.0.22: @@ -2288,18 +2190,6 @@ snapshots: dependencies: mimic-fn: 2.1.0 - openai@4.68.2: - dependencies: - '@types/node': 18.19.59 - '@types/node-fetch': 2.6.11 - abort-controller: 3.0.0 - agentkeepalive: 4.5.0 - form-data-encoder: 1.7.2 - formdata-node: 4.4.1 - node-fetch: 2.7.0 - transitivePeerDependencies: - - encoding - package-json-from-dist@1.0.1: {} path-key@3.1.1: {} @@ -2337,7 +2227,7 @@ snapshots: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 22.7.9 + '@types/node': 22.8.1 long: 5.2.3 proxy-from-env@1.1.0: {} @@ -2507,8 +2397,6 @@ snapshots: touch@3.1.1: {} - tr46@0.0.3: {} - tr46@1.0.1: dependencies: punycode: 2.3.1 @@ -2521,14 +2409,14 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-node@10.9.2(@swc/core@1.7.39)(@types/node@22.7.9)(typescript@5.6.2): + ts-node@10.9.2(@swc/core@1.7.39)(@types/node@22.8.1)(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.7.9 + '@types/node': 22.8.1 acorn: 8.13.0 acorn-walk: 8.3.4 arg: 4.1.3 @@ -2574,8 +2462,6 @@ snapshots: undefsafe@2.0.5: {} - undici-types@5.26.5: {} - undici-types@6.19.8: {} unionfs@4.5.4: @@ -2611,10 +2497,6 @@ snapshots: glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 - web-streams-polyfill@4.0.0-beta.3: {} - - webidl-conversions@3.0.1: {} - webidl-conversions@4.0.2: {} webpack-sources@3.2.3: {} @@ -2649,11 +2531,6 @@ snapshots: - esbuild - uglify-js - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - whatwg-url@7.1.0: dependencies: lodash.sortby: 4.7.0 diff --git a/examples/get-started/tsconfig.json b/examples/get-started/tsconfig.json index b1c84c5..896a619 100644 --- a/examples/get-started/tsconfig.json +++ b/examples/get-started/tsconfig.json @@ -1,18 +1,23 @@ { - "compilerOptions": { - "module": "commonjs", - "esModuleInterop": true, - "target": "ES2022", - "noImplicitAny": true, - "moduleResolution": "node", - "sourceMap": true, - "types": ["node"], - "outDir": "dist", - "baseUrl": ".", - "paths": { - "*": ["node_modules/*"] - } - }, - "exclude": ["node_modules"] - } - + "compilerOptions": { + "module": "commonjs", + "esModuleInterop": true, + "target": "ES2022", + "noImplicitAny": true, + "moduleResolution": "node", + "sourceMap": true, + "types": [ + "node" + ], + "outDir": "dist", + "baseUrl": ".", + "paths": { + "*": [ + "node_modules/*" + ] + } + }, + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/examples/nextjs/.env.Example b/examples/nextjs/.env.Example new file mode 100644 index 0000000..ef05ee5 --- /dev/null +++ b/examples/nextjs/.env.Example @@ -0,0 +1,7 @@ +# Restack + +RESTACK_ENGINE_ID= +RESTACK_ENGINE_ADDRESS= +RESTACK_ENGINE_API_KEY= + +RESTACK_CLOUD_TOKEN= \ No newline at end of file diff --git a/examples/nextjs/README.md b/examples/nextjs/README.md index e215bc4..5d331e3 100644 --- a/examples/nextjs/README.md +++ b/examples/nextjs/README.md @@ -20,17 +20,30 @@ You can start editing the page by modifying `app/page.tsx`. The page auto-update This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. -## Learn More +# Install Restack Web UI -To learn more about Next.js, take a look at the following resources: +To install the Restack Web UI, you can use Docker. +``` +docker run -d --pull always --name studio -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main +``` +# Schedule Restack workflow from NextJS frontend + +The example is a NextJS application with front and backend. You can schedule the workflow example from the user interface. + +![Example UI](./restack-examples-ts-nextjs.png) + +When the client successfully schedules the workflow, you can see the started workflow in the Restack Web UI. You should see the following screen: + +![Success Web UI](./restack-examples-ts-nextjs-web-ui.png) + +Now you can add a backend to the example. In other examples, you can see how to ideally structure the backend app with workflows, functions and services. + +## Deploy on Restack -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. +To deploy this Next.js application on Restack, you can use the provided `restack_up.mjs` script. This script utilizes the Restack Cloud SDK to define and deploy your application stack. It sets up the necessary environment variables and configures the Next.js application for deployment. -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! +To get started, ensure you have the required Restack Cloud credentials and environment variables set up. Then, run the script to initiate the deployment process. -## Deploy on Vercel +For more detailed information on deploying your repository to Restack, refer to the [Restack Cloud deployment documentation](https://docs.restack.io/restack-cloud/deployrepo). -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. diff --git a/examples/nextjs/package.json b/examples/nextjs/package.json index cf15bda..8894dc2 100644 --- a/examples/nextjs/package.json +++ b/examples/nextjs/package.json @@ -10,7 +10,7 @@ "clean": "rm -rf node_modules" }, "dependencies": { - "@restackio/ai": "^0.0.75", + "@restackio/ai": "^0.0.80", "next": "14.2.13", "react": "^18", "react-dom": "^18" diff --git a/examples/nextjs/pnpm-lock.yaml b/examples/nextjs/pnpm-lock.yaml index aac6b0c..c177c99 100644 --- a/examples/nextjs/pnpm-lock.yaml +++ b/examples/nextjs/pnpm-lock.yaml @@ -9,41 +9,41 @@ importers: .: dependencies: '@restackio/ai': - specifier: ^0.0.75 - version: 0.0.75(@swc/helpers@0.5.11) + specifier: ^0.0.80 + version: 0.0.80(@swc/helpers@0.5.11) next: specifier: 14.2.13 version: 14.2.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: - specifier: ^18.3.1 + specifier: ^18 version: 18.3.1 react-dom: - specifier: ^18.3.1 + specifier: ^18 version: 18.3.1(react@18.3.1) devDependencies: '@types/node': - specifier: ^20.16.10 + specifier: ^20 version: 20.16.10 '@types/react': - specifier: ^18.3.11 + specifier: ^18 version: 18.3.11 '@types/react-dom': - specifier: ^18.3.0 + specifier: ^18 version: 18.3.0 eslint: - specifier: ^8.57.1 + specifier: ^8 version: 8.57.1 eslint-config-next: specifier: 14.2.13 version: 14.2.13(eslint@8.57.1)(typescript@5.6.2) postcss: - specifier: ^8.4.47 + specifier: ^8 version: 8.4.47 tailwindcss: - specifier: ^3.4.13 + specifier: ^3.4.1 version: 3.4.13 typescript: - specifier: ^5.6.2 + specifier: ^5 version: 5.6.2 packages: @@ -248,8 +248,8 @@ packages: '@protobufjs/utf8@1.1.0': resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} - '@restackio/ai@0.0.75': - resolution: {integrity: sha512-Q3IKIJHseWM+CDoZWvgPmuv15ryZkHsCY2jq6FbdnW44MMjOOcI3QUbpZJPHLGlLZ5ucnSbQxiZBvHDDnOZfVQ==} + '@restackio/ai@0.0.80': + resolution: {integrity: sha512-igmdZOTPm70lB7QWTrp7hg1M/btsTIlWUqvZbPD9bbECCrVjsyOxlvqmZuL7fxkKfa2OR0H4P9TO5VLyEwCztQ==} engines: {node: '>=20'} '@rtsao/scc@1.1.0': @@ -2199,7 +2199,7 @@ snapshots: '@protobufjs/utf8@1.1.0': {} - '@restackio/ai@0.0.75(@swc/helpers@0.5.11)': + '@restackio/ai@0.0.80(@swc/helpers@0.5.11)': dependencies: '@temporalio/activity': 1.11.2 '@temporalio/client': 1.11.2 diff --git a/examples/nextjs/restack-examples-ts-nextjs-web-ui.png b/examples/nextjs/restack-examples-ts-nextjs-web-ui.png new file mode 100644 index 0000000..4adb8a9 Binary files /dev/null and b/examples/nextjs/restack-examples-ts-nextjs-web-ui.png differ diff --git a/examples/nextjs/restack-examples-ts-nextjs.png b/examples/nextjs/restack-examples-ts-nextjs.png new file mode 100644 index 0000000..e20db8e Binary files /dev/null and b/examples/nextjs/restack-examples-ts-nextjs.png differ diff --git a/examples/hello/.env.example b/examples/openai/.env.example similarity index 100% rename from examples/hello/.env.example rename to examples/openai/.env.example diff --git a/examples/hello/Dockerfile b/examples/openai/Dockerfile similarity index 100% rename from examples/hello/Dockerfile rename to examples/openai/Dockerfile diff --git a/examples/hello/package.json b/examples/openai/package.json similarity index 81% rename from examples/hello/package.json rename to examples/openai/package.json index f3b729a..e447d28 100644 --- a/examples/hello/package.json +++ b/examples/openai/package.json @@ -1,7 +1,7 @@ { "name": "sdk-example-ts", "version": "1.0.0", - "description": "", + "description": "Basic OpenAI example", "main": "index.js", "scripts": { "start": "ts-node src/services.ts", @@ -9,7 +9,7 @@ "dev": "pnpm start.watch", "build": "tsc --build", "clean": "rm -rf node_modules", - "workflow": "ts-node ./scheduleWorkflow.ts", + "schedule": "ts-node ./scheduleWorkflow.ts", "restack-up": "node restack_up.mjs" }, "nodemonConfig": { @@ -22,8 +22,8 @@ ] }, "dependencies": { - "@restackio/integrations-openai": "^0.0.23", - "@restackio/ai": "^0.0.75", + "@restackio/integrations-openai": "^0.0.29", + "@restackio/ai": "^0.0.80", "@temporalio/workflow": "^1.11.2", "dotenv": "^16.4.5", "zod": "^3.23.8", diff --git a/examples/hello/pnpm-lock.yaml b/examples/openai/pnpm-lock.yaml similarity index 99% rename from examples/hello/pnpm-lock.yaml rename to examples/openai/pnpm-lock.yaml index 663b4c8..ec88546 100644 --- a/examples/hello/pnpm-lock.yaml +++ b/examples/openai/pnpm-lock.yaml @@ -9,11 +9,11 @@ importers: .: dependencies: '@restackio/ai': - specifier: ^0.0.75 - version: 0.0.75 + specifier: ^0.0.80 + version: 0.0.80 '@restackio/integrations-openai': - specifier: ^0.0.23 - version: 0.0.23(zod@3.23.8) + specifier: ^0.0.29 + version: 0.0.29(zod@3.23.8) '@temporalio/workflow': specifier: ^1.11.2 version: 1.11.2 @@ -28,10 +28,10 @@ importers: version: 3.23.3(zod@3.23.8) devDependencies: '@restackio/restack-sdk-cloud-ts': - specifier: ^1.0.16 + specifier: ^1.0.15 version: 1.0.16 '@types/node': - specifier: ^20.16.10 + specifier: ^20.16.9 version: 20.16.10 nodemon: specifier: ^2.0.22 @@ -178,12 +178,12 @@ packages: resolution: {integrity: sha512-IlfnMo8c6qHBRag2K6OnUwP6OflQYuzDk1XlocpvnbwPwDnni8Zgzz1f4xRJvcfxpJETKIHCscWXSGMjVLNfvg==} engines: {node: '>=20'} - '@restackio/ai@0.0.75': - resolution: {integrity: sha512-Q3IKIJHseWM+CDoZWvgPmuv15ryZkHsCY2jq6FbdnW44MMjOOcI3QUbpZJPHLGlLZ5ucnSbQxiZBvHDDnOZfVQ==} + '@restackio/ai@0.0.80': + resolution: {integrity: sha512-igmdZOTPm70lB7QWTrp7hg1M/btsTIlWUqvZbPD9bbECCrVjsyOxlvqmZuL7fxkKfa2OR0H4P9TO5VLyEwCztQ==} engines: {node: '>=20'} - '@restackio/integrations-openai@0.0.23': - resolution: {integrity: sha512-cTKk3mirbn25i4S/wG5b0o6gAoiPojkHptIP0q/C0aTLysm/Ps0daL4cVY/Q0hXmKfXLQ9+rxHkJOLS5zhMYrw==} + '@restackio/integrations-openai@0.0.29': + resolution: {integrity: sha512-pZmU9aeLW/yno2jtReSYyC+20tHCEmpInkwtYG3LZpmwWgyiUmz2hjxlnZ2H1r5WQQWL9xUvV2TOrk3dCKfg0A==} '@restackio/restack-sdk-cloud-ts@1.0.16': resolution: {integrity: sha512-oIanzD6ym6c+hZ6eMJozTaIxGmMn1hPZRwogzz4v2hdd40IpdbwuHc98bPrHjswS1rZa+vjPjLbKoSuLlZloOQ==} @@ -1321,7 +1321,7 @@ snapshots: - uglify-js - webpack-cli - '@restackio/ai@0.0.75': + '@restackio/ai@0.0.80': dependencies: '@temporalio/activity': 1.11.2 '@temporalio/client': 1.11.2 @@ -1333,7 +1333,7 @@ snapshots: - uglify-js - webpack-cli - '@restackio/integrations-openai@0.0.23(zod@3.23.8)': + '@restackio/integrations-openai@0.0.29(zod@3.23.8)': dependencies: openai: 4.67.1(zod@3.23.8) transitivePeerDependencies: diff --git a/examples/hello/readme.md b/examples/openai/readme.md similarity index 52% rename from examples/hello/readme.md rename to examples/openai/readme.md index 9f98582..b358663 100644 --- a/examples/hello/readme.md +++ b/examples/openai/readme.md @@ -9,6 +9,13 @@ nvm use 20 brew install pnpm +# Install Restack Web UI + +To install the Restack Web UI, you can use Docker. +``` +docker run -d --pull always --name studio -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main +``` + # Start pods Where all your code is defined, including workflow steps. @@ -25,7 +32,7 @@ Your code will be running in pods and syncing with Restack engine to execute wor In another shell: -pnpm workflow +pnpm schedule Will schedule to start example workflow immediately. @@ -44,6 +51,12 @@ flowchart TD P2 -->|sends status output | E ``` -# Deploy +## Deploy on Restack pnpm restack-up + +To deploy the application on Restack, you can use the provided `restack_up.mjs` script. This script utilizes the Restack Cloud SDK to define and deploy your application stack. It sets up the necessary environment variables and configures the application for deployment. + +To get started, ensure you have the required Restack Cloud credentials and environment variables set up. Then, run the script to initiate the deployment process. + +For more detailed information on deploying your repository to Restack, refer to the [Restack Cloud deployment documentation](https://docs.restack.io/restack-cloud/deployrepo). \ No newline at end of file diff --git a/examples/hello/restack_up.mjs b/examples/openai/restack_up.mjs similarity index 100% rename from examples/hello/restack_up.mjs rename to examples/openai/restack_up.mjs diff --git a/examples/hello/scheduleWorkflow.ts b/examples/openai/scheduleWorkflow.ts similarity index 100% rename from examples/hello/scheduleWorkflow.ts rename to examples/openai/scheduleWorkflow.ts diff --git a/examples/hello/src/client.ts b/examples/openai/src/client.ts similarity index 100% rename from examples/hello/src/client.ts rename to examples/openai/src/client.ts diff --git a/examples/hello/src/functions/goodbye.ts b/examples/openai/src/functions/goodbye.ts similarity index 100% rename from examples/hello/src/functions/goodbye.ts rename to examples/openai/src/functions/goodbye.ts diff --git a/examples/hello/src/functions/index.ts b/examples/openai/src/functions/index.ts similarity index 100% rename from examples/hello/src/functions/index.ts rename to examples/openai/src/functions/index.ts diff --git a/examples/hello/src/services.ts b/examples/openai/src/services.ts similarity index 100% rename from examples/hello/src/services.ts rename to examples/openai/src/services.ts diff --git a/examples/hello/src/workflows/hello.ts b/examples/openai/src/workflows/hello.ts similarity index 100% rename from examples/hello/src/workflows/hello.ts rename to examples/openai/src/workflows/hello.ts diff --git a/examples/hello/src/workflows/index.ts b/examples/openai/src/workflows/index.ts similarity index 100% rename from examples/hello/src/workflows/index.ts rename to examples/openai/src/workflows/index.ts diff --git a/examples/hello/tsconfig.json b/examples/openai/tsconfig.json similarity index 100% rename from examples/hello/tsconfig.json rename to examples/openai/tsconfig.json diff --git a/examples/posthog/package.json b/examples/posthog/package.json index c4a0cc3..f92d54f 100644 --- a/examples/posthog/package.json +++ b/examples/posthog/package.json @@ -8,16 +8,16 @@ "dev": "ts-node-dev --respawn --transpile-only src/services.ts", "build": "tsc --build", "clean": "rm -rf node_modules", - "workflow": "ts-node ./scheduleWorkflow.ts", + "schedule": "ts-node ./scheduleWorkflow.ts", "restack-up": "node restack_up.mjs" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { - "@restackio/integrations-linear": "^0.0.3", - "@restackio/integrations-openai": "^0.0.23", - "@restackio/ai": "^0.0.75", + "@restackio/integrations-linear": "^0.0.6", + "@restackio/integrations-openai": "^0.0.29", + "@restackio/ai": "^0.0.80", "@temporalio/workflow": "1.11.1", "dotenv": "^16.4.5", "typescript": "^5.6.2", diff --git a/examples/posthog/pnpm-lock.yaml b/examples/posthog/pnpm-lock.yaml index 6172c6e..89dc720 100644 --- a/examples/posthog/pnpm-lock.yaml +++ b/examples/posthog/pnpm-lock.yaml @@ -9,14 +9,14 @@ importers: .: dependencies: '@restackio/ai': - specifier: ^0.0.75 - version: 0.0.75 + specifier: ^0.0.80 + version: 0.0.80 '@restackio/integrations-linear': - specifier: ^0.0.3 - version: 0.0.3 + specifier: ^0.0.6 + version: 0.0.6 '@restackio/integrations-openai': - specifier: ^0.0.23 - version: 0.0.23(zod@3.23.8) + specifier: ^0.0.29 + version: 0.0.29(zod@3.23.8) '@temporalio/workflow': specifier: 1.11.1 version: 1.11.1 @@ -160,15 +160,15 @@ packages: '@protobufjs/utf8@1.1.0': resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} - '@restackio/ai@0.0.75': - resolution: {integrity: sha512-Q3IKIJHseWM+CDoZWvgPmuv15ryZkHsCY2jq6FbdnW44MMjOOcI3QUbpZJPHLGlLZ5ucnSbQxiZBvHDDnOZfVQ==} + '@restackio/ai@0.0.80': + resolution: {integrity: sha512-igmdZOTPm70lB7QWTrp7hg1M/btsTIlWUqvZbPD9bbECCrVjsyOxlvqmZuL7fxkKfa2OR0H4P9TO5VLyEwCztQ==} engines: {node: '>=20'} - '@restackio/integrations-linear@0.0.3': - resolution: {integrity: sha512-eb+Uq71aPW6IV7+rV8fBwmgGOtutD1WKwJoOwPgPsKQ6sm5V3WH+1A60vR35/Y54h8k1ZD5X4Fmz9qslOAlaXA==} + '@restackio/integrations-linear@0.0.6': + resolution: {integrity: sha512-ZM4kqNFz4pStcl+m3VnoVlO3pW+hZOM9gUH7OSnGAROJciqgHg7FY6cmHeH9prT1194WsvgeAUzQtvwwudjPEA==} - '@restackio/integrations-openai@0.0.23': - resolution: {integrity: sha512-cTKk3mirbn25i4S/wG5b0o6gAoiPojkHptIP0q/C0aTLysm/Ps0daL4cVY/Q0hXmKfXLQ9+rxHkJOLS5zhMYrw==} + '@restackio/integrations-openai@0.0.29': + resolution: {integrity: sha512-pZmU9aeLW/yno2jtReSYyC+20tHCEmpInkwtYG3LZpmwWgyiUmz2hjxlnZ2H1r5WQQWL9xUvV2TOrk3dCKfg0A==} '@restackio/restack-sdk-cloud-ts@1.0.5': resolution: {integrity: sha512-xAVoEBwuHNZo0OZQskThIwzj3ln8m2lJRlhKl7CYhJdGeUTK4Fo0zwrg31i9Wz0JnInXgWwGYYro8gcrpb3nYg==} @@ -298,9 +298,6 @@ packages: '@types/node@22.5.5': resolution: {integrity: sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==} - '@types/qs@6.9.16': - resolution: {integrity: sha512-7i+zxXdPD0T4cKDuxCUXJ4wHcsJLwENa6Z3dCu8cfCK743OGy5Nu1RmAGqDPsoTDINVEcdXKRvR/zre+P2Ku1A==} - '@types/strip-bom@3.0.0': resolution: {integrity: sha512-xevGOReSYGM7g/kUBZzPqCrR/KYAo+F0yiPc85WFTJa0MSLtyFTVTU6cJu/aV4mid7IffDIWqo69THF2o4JiEQ==} @@ -438,10 +435,6 @@ packages: resolution: {integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==} engines: {node: '>=18'} - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - caniuse-lite@1.0.30001660: resolution: {integrity: sha512-GacvNTTuATm26qC74pt+ad1fW15mlQ/zuTzzY1ZoIzECTP8HURDfF43kNxPgf7H1jmelCBQTTbBNxdSXOA7Bqg==} @@ -502,10 +495,6 @@ packages: resolution: {integrity: sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==} engines: {node: '>=18'} - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - define-lazy-prop@3.0.0: resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} engines: {node: '>=12'} @@ -535,14 +524,6 @@ packages: resolution: {integrity: sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==} engines: {node: '>=10.13.0'} - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - es-module-lexer@1.5.4: resolution: {integrity: sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==} @@ -613,10 +594,6 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -628,9 +605,6 @@ packages: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Glob versions prior to v9 are no longer supported - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} @@ -646,17 +620,6 @@ packages: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} @@ -815,10 +778,6 @@ packages: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} - object-inspect@1.13.2: - resolution: {integrity: sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==} - engines: {node: '>= 0.4'} - once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} @@ -826,8 +785,8 @@ packages: resolution: {integrity: sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==} engines: {node: '>=18'} - openai@4.61.0: - resolution: {integrity: sha512-xkygRBRLIUumxzKGb1ug05pWmJROQsHkGuj/N6Jiw2dj0dI19JvbFpErSZKmJ/DA+0IvpcugZqCAyk8iLpyM6Q==} + openai@4.68.4: + resolution: {integrity: sha512-LRinV8iU9VQplkr25oZlyrsYGPGasIwYN8KFMAAFTHHLHjHhejtJ5BALuLFrkGzY4wfbKhOhuT+7lcHZ+F3iEA==} hasBin: true peerDependencies: zod: ^3.23.8 @@ -867,10 +826,6 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} - qs@6.13.0: - resolution: {integrity: sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==} - engines: {node: '>=0.6'} - randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} @@ -916,14 +871,6 @@ packages: serialize-javascript@6.0.2: resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - side-channel@1.0.6: - resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} - engines: {node: '>= 0.4'} - simple-git@3.26.0: resolution: {integrity: sha512-5tbkCSzuskR6uA7uA23yjasmA0RzugVo8QM2bpsnxkrgP13eisFT7TMS4a+xKEJvbmr4qf+l0WT3eKa9IxxUyw==} @@ -1300,7 +1247,7 @@ snapshots: '@protobufjs/utf8@1.1.0': {} - '@restackio/ai@0.0.75': + '@restackio/ai@0.0.80': dependencies: '@temporalio/activity': 1.11.1 '@temporalio/client': 1.11.1 @@ -1312,15 +1259,15 @@ snapshots: - uglify-js - webpack-cli - '@restackio/integrations-linear@0.0.3': + '@restackio/integrations-linear@0.0.6': dependencies: '@linear/sdk': 29.0.0 transitivePeerDependencies: - encoding - '@restackio/integrations-openai@0.0.23(zod@3.23.8)': + '@restackio/integrations-openai@0.0.29(zod@3.23.8)': dependencies: - openai: 4.61.0(zod@3.23.8) + openai: 4.68.4(zod@3.23.8) transitivePeerDependencies: - encoding - zod @@ -1476,8 +1423,6 @@ snapshots: dependencies: undici-types: 6.19.8 - '@types/qs@6.9.16': {} - '@types/strip-bom@3.0.0': {} '@types/strip-json-comments@0.0.30': {} @@ -1636,14 +1581,6 @@ snapshots: dependencies: run-applescript: 7.0.0 - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - caniuse-lite@1.0.30001660: {} cargo-cp-artifact@0.1.9: {} @@ -1702,12 +1639,6 @@ snapshots: bundle-name: 4.1.0 default-browser-id: 5.0.0 - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - define-lazy-prop@3.0.0: {} delayed-stream@1.0.0: {} @@ -1729,12 +1660,6 @@ snapshots: graceful-fs: 4.2.11 tapable: 2.2.1 - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - es-module-lexer@1.5.4: {} escalade@3.2.0: {} @@ -1788,14 +1713,6 @@ snapshots: get-caller-file@2.0.5: {} - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - glob-parent@5.1.2: dependencies: is-glob: 4.0.3 @@ -1811,10 +1728,6 @@ snapshots: once: 1.4.0 path-is-absolute: 1.0.1 - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - graceful-fs@4.2.11: {} graphql@15.9.0: {} @@ -1823,14 +1736,6 @@ snapshots: has-flag@4.0.0: {} - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - hasown@2.0.2: dependencies: function-bind: 1.1.2 @@ -1963,8 +1868,6 @@ snapshots: normalize-path@3.0.0: {} - object-inspect@1.13.2: {} - once@1.4.0: dependencies: wrappy: 1.0.2 @@ -1976,17 +1879,15 @@ snapshots: is-inside-container: 1.0.0 is-wsl: 3.1.0 - openai@4.61.0(zod@3.23.8): + openai@4.68.4(zod@3.23.8): dependencies: '@types/node': 18.19.50 '@types/node-fetch': 2.6.11 - '@types/qs': 6.9.16 abort-controller: 3.0.0 agentkeepalive: 4.5.0 form-data-encoder: 1.7.2 formdata-node: 4.4.1 node-fetch: 2.7.0 - qs: 6.13.0 optionalDependencies: zod: 3.23.8 transitivePeerDependencies: @@ -2025,10 +1926,6 @@ snapshots: punycode@2.3.1: {} - qs@6.13.0: - dependencies: - side-channel: 1.0.6 - randombytes@2.1.0: dependencies: safe-buffer: 5.2.1 @@ -2071,22 +1968,6 @@ snapshots: dependencies: randombytes: 2.1.0 - set-function-length@1.2.2: - dependencies: - define-data-property: 1.1.4 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - gopd: 1.0.1 - has-property-descriptors: 1.0.2 - - side-channel@1.0.6: - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - get-intrinsic: 1.2.4 - object-inspect: 1.13.2 - simple-git@3.26.0: dependencies: '@kwsites/file-exists': 1.1.1 diff --git a/examples/posthog/readme.md b/examples/posthog/readme.md index d9708c8..286027f 100644 --- a/examples/posthog/readme.md +++ b/examples/posthog/readme.md @@ -7,6 +7,13 @@ And OpenAI O1-preview to reason and create a digest in Markdown. By default we retrieve all recodings from last 24 hours, so by scheduling the workflow to run every day we get a digest of all new recordings. +# Install Restack Web UI + +To install the Restack Web UI, you can use Docker. +``` +docker run -d --pull always --name studio -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main +``` + # Install dependencies pnpm i @@ -21,8 +28,14 @@ pnpm dev # Schedule digest workflow with -pnpm workflow +pnpm schedule -# deploy +## Deploy on Restack pnpm restack-up + +To deploy the application on Restack, you can use the provided `restack_up.mjs` script. This script utilizes the Restack Cloud SDK to define and deploy your application stack. It sets up the necessary environment variables and configures the application for deployment. + +To get started, ensure you have the required Restack Cloud credentials and environment variables set up. Then, run the script to initiate the deployment process. + +For more detailed information on deploying your repository to Restack, refer to the [Restack Cloud deployment documentation](https://docs.restack.io/restack-cloud/deployrepo). diff --git a/examples/voice/package.json b/examples/voice/package.json index fb1f60e..b2d44a9 100644 --- a/examples/voice/package.json +++ b/examples/voice/package.json @@ -18,11 +18,11 @@ "license": "ISC", "dependencies": { "@deepgram/sdk": "^3.6.0", - "@restackio/integrations-deepgram": "^0.0.8", - "@restackio/integrations-openai": "^0.0.3", - "@restackio/integrations-twilio": "^0.0.5", - "@restackio/integrations-websocket": "^0.0.12", - "@restackio/ai": "^0.0.75", + "@restackio/integrations-deepgram": "^0.0.11", + "@restackio/integrations-openai": "^0.0.29", + "@restackio/integrations-twilio": "^0.0.8", + "@restackio/integrations-websocket": "^0.0.15", + "@restackio/ai": "^0.0.80", "@temporalio/workflow": "1.11.1", "cors": "^2.8.5", "dotenv": "^16.4.5", diff --git a/examples/voice/pnpm-lock.yaml b/examples/voice/pnpm-lock.yaml index 5e5834a..f3868b8 100644 --- a/examples/voice/pnpm-lock.yaml +++ b/examples/voice/pnpm-lock.yaml @@ -9,23 +9,23 @@ importers: .: dependencies: '@deepgram/sdk': - specifier: ^3.8.0 + specifier: ^3.6.0 version: 3.8.0(bufferutil@4.0.8)(encoding@0.1.12) '@restackio/ai': - specifier: ^0.0.75 - version: 0.0.75 + specifier: ^0.0.80 + version: 0.0.80 '@restackio/integrations-deepgram': - specifier: ^0.0.8 - version: 0.0.8(bufferutil@4.0.8)(encoding@0.1.12) + specifier: ^0.0.11 + version: 0.0.11(bufferutil@4.0.8)(encoding@0.1.12) '@restackio/integrations-openai': - specifier: ^0.0.3 - version: 0.0.3(encoding@0.1.12)(zod@3.23.8) + specifier: ^0.0.29 + version: 0.0.29(encoding@0.1.12)(zod@3.23.8) '@restackio/integrations-twilio': - specifier: ^0.0.5 - version: 0.0.5 + specifier: ^0.0.8 + version: 0.0.8 '@restackio/integrations-websocket': - specifier: ^0.0.12 - version: 0.0.12(bufferutil@4.0.8) + specifier: ^0.0.15 + version: 0.0.15(bufferutil@4.0.8) '@temporalio/workflow': specifier: 1.11.1 version: 1.11.1 @@ -39,13 +39,13 @@ importers: specifier: ^4.21.0 version: 4.21.0 openai: - specifier: ^4.67.1 + specifier: ^4.59.0 version: 4.67.1(encoding@0.1.12)(zod@3.23.8) ts-node: specifier: ^10.9.2 version: 10.9.2(@swc/core@1.7.26)(@types/node@22.7.4)(typescript@5.6.2) twilio: - specifier: ^5.3.3 + specifier: ^5.3.0 version: 5.3.3 typescript: specifier: ^5.6.2 @@ -65,7 +65,7 @@ importers: version: 4.0.8 devDependencies: '@restackio/restack-sdk-cloud-ts': - specifier: ^1.0.16 + specifier: ^1.0.5 version: 1.0.16 '@types/cors': specifier: ^2.8.17 @@ -74,7 +74,7 @@ importers: specifier: ^4.17.21 version: 4.17.21 '@types/node': - specifier: ^22.7.4 + specifier: ^22.5.4 version: 22.7.4 '@types/uuid': specifier: ^10.0.0 @@ -83,7 +83,7 @@ importers: specifier: ^8.5.12 version: 8.5.12 nodemon: - specifier: ^3.1.7 + specifier: ^3.1.4 version: 3.1.7 ts-node-dev: specifier: ^2.0.0 @@ -193,25 +193,26 @@ packages: '@protobufjs/utf8@1.1.0': resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} - '@restackio/ai@0.0.75': - resolution: {integrity: sha512-Q3IKIJHseWM+CDoZWvgPmuv15ryZkHsCY2jq6FbdnW44MMjOOcI3QUbpZJPHLGlLZ5ucnSbQxiZBvHDDnOZfVQ==} + '@restackio/ai@0.0.80': + resolution: {integrity: sha512-igmdZOTPm70lB7QWTrp7hg1M/btsTIlWUqvZbPD9bbECCrVjsyOxlvqmZuL7fxkKfa2OR0H4P9TO5VLyEwCztQ==} engines: {node: '>=20'} - '@restackio/integrations-deepgram@0.0.8': - resolution: {integrity: sha512-99GHdrP0dt4UsYYAySLWQFzAOx469FzmmXXwvpbmbQ4ZELavmyR4QMxxs1IGWvL9B1kMq2kdUyvJyVt9q48H/w==} + '@restackio/integrations-deepgram@0.0.11': + resolution: {integrity: sha512-7qqmIo5EjYRB2bXRygOz/DI926+4ar3h9831T+pSRD38SWTlpvwiNThnBEIBKb4vuxB96ulDsQznQTvmzMNVFA==} - '@restackio/integrations-openai@0.0.3': - resolution: {integrity: sha512-kp/b0tbKxWM/lkbK2Vi6l6nnh3u3oJ6R+EXmFyxkKNOTlBz4e+XfXKFodz0PWXZtQuXzi8mGA/+SYqxb93Z9ZA==} + '@restackio/integrations-openai@0.0.29': + resolution: {integrity: sha512-pZmU9aeLW/yno2jtReSYyC+20tHCEmpInkwtYG3LZpmwWgyiUmz2hjxlnZ2H1r5WQQWL9xUvV2TOrk3dCKfg0A==} - '@restackio/integrations-twilio@0.0.5': - resolution: {integrity: sha512-olepmD/snHYPHJ62iRsHTrPC/zFDaWtqQICwyDZub6jkTKULtMkjospNmNZ3xT/pZ/sCx0yqW/2rGl97D88kmQ==} + '@restackio/integrations-twilio@0.0.8': + resolution: {integrity: sha512-7On5khfVd7w7q2OFQCp3XBNkw8wll/rcHGnrpXwcBII+dacnuKp4l9x8qxTCTaOkmGsXJcvq3c3x8jZHaXB7yA==} - '@restackio/integrations-websocket@0.0.12': - resolution: {integrity: sha512-6fWEjmpNGwo4qE+p2Mm/aGNjHMFvsFkddt/QA/cQMuASLRG9D1ohApfckpy/4zpyYkjNBJq/GWQnXbeJnFzskw==} + '@restackio/integrations-websocket@0.0.15': + resolution: {integrity: sha512-RjJhGn9ej45mfR1mqeZyCOZKR8N5fImQvkLfbfSlaIl1IbWN2pY0dkXV/0urEHbX12dAunQhsGvlalRDsma1Cg==} '@restackio/restack-sdk-cloud-ts@1.0.16': resolution: {integrity: sha512-oIanzD6ym6c+hZ6eMJozTaIxGmMn1hPZRwogzz4v2hdd40IpdbwuHc98bPrHjswS1rZa+vjPjLbKoSuLlZloOQ==} engines: {node: '>=18'} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. '@swc/core-darwin-arm64@1.7.26': resolution: {integrity: sha512-FF3CRYTg6a7ZVW4yT9mesxoVVZTrcSWtmZhxKCYJX9brH4CS/7PRPjAKNk6kzWgWuRoglP7hkjQcd6EpMcZEAw==} @@ -1655,7 +1656,7 @@ snapshots: '@protobufjs/utf8@1.1.0': {} - '@restackio/ai@0.0.75': + '@restackio/ai@0.0.80': dependencies: '@temporalio/activity': 1.11.2 '@temporalio/client': 1.11.2 @@ -1667,7 +1668,7 @@ snapshots: - uglify-js - webpack-cli - '@restackio/integrations-deepgram@0.0.8(bufferutil@4.0.8)(encoding@0.1.12)': + '@restackio/integrations-deepgram@0.0.11(bufferutil@4.0.8)(encoding@0.1.12)': dependencies: '@deepgram/sdk': 3.8.0(bufferutil@4.0.8)(encoding@0.1.12) transitivePeerDependencies: @@ -1675,21 +1676,21 @@ snapshots: - encoding - utf-8-validate - '@restackio/integrations-openai@0.0.3(encoding@0.1.12)(zod@3.23.8)': + '@restackio/integrations-openai@0.0.29(encoding@0.1.12)(zod@3.23.8)': dependencies: openai: 4.67.1(encoding@0.1.12)(zod@3.23.8) transitivePeerDependencies: - encoding - zod - '@restackio/integrations-twilio@0.0.5': + '@restackio/integrations-twilio@0.0.8': dependencies: twilio: 5.3.3 transitivePeerDependencies: - debug - supports-color - '@restackio/integrations-websocket@0.0.12(bufferutil@4.0.8)': + '@restackio/integrations-websocket@0.0.15(bufferutil@4.0.8)': dependencies: ws: 8.18.0(bufferutil@4.0.8) transitivePeerDependencies: diff --git a/examples/voice/readme.md b/examples/voice/readme.md index bc06401..2db2036 100644 --- a/examples/voice/readme.md +++ b/examples/voice/readme.md @@ -7,6 +7,13 @@ Add OPENAI_API_KEY and DEEPGRAM_API_KEY keys in .env pnpm dev-server pnpm dev-services +# Install Restack Web UI + +To install the Restack Web UI, you can use Docker. +``` +docker run -d --pull always --name studio -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main +``` + # Use frontend with browser microphone: https://github.com/restackio/voice-frontend