一、软件介绍
文末提供程序和源码下载
Shinkai 开源应用程序在 Web 浏览器中解锁了一流 LLM (AI) 支持的全部功能/自动化。它允许创建多个代理,每个代理都连接到本地或第三方LLMs(例如 OpenAI GPT),这些代理具有权限(意味着安全)访问权限,可以在您访问的每个网页中采取行动。
有一个名为 Shinkai Node 的配套存储库,它允许您在任何地方将节点设置为 Shinkai Network 的中心单元,处理代理管理、作业处理和安全通信等任务。你可以在这里找到它
二、Projects 项目
Apps 应用程序
- shinkai-visor: Shinkai Visor is a chrome extension to interact with shinkai-node.
shinkai-visor:Shinkai Visor 是一个与 shinkai-node 交互的 chrome 扩展。 - shinkai-desktop: Shinkai Desktop is a desktop app to interact with shinkai-node.
shinkai-desktop:Shinkai Desktop 是一个与 shinkai-node 交互的桌面应用程序。
三、Libs 库
- shinkai-message-ts: Typescript library that implements the features and networking layer to enable systems to interact with shinkai-nodes.
shinkai-message-ts:Typescript 库,实现功能和网络层,使系统能够与 shinkai-nodes 交互。 - shinkai-node-state: Typescript library which using @tanstack/react-query enables apps to interact with shinkai-node managing the state, caching and evictions.
shinkai-node-state:使用 @tanstack/react-query 的 Typescript 库使应用程序能够与管理状态、缓存和驱逐的 shinkai-node 进行交互。 - shinkai-ui: React UI library to build shinkai apps.
shinkai-ui:用于构建 shinkai 应用的 React UI 库。
四、Getting started 开始
To get started first clone this repo:
要开始使用,请先克隆此存储库:
<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>$ git clone https://github.com/dcSpark/shinkai-apps
</code></span></span></span></span>
Download side binaries: 下载端二进制文件:
Macos Macos 的
<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>ARCH="aarch64-apple-darwin" \
OLLAMA_VERSION="v0.6.8" \
SHINKAI_NODE_VERSION="v1.0.2" \
npx ts-node ./ci-scripts/download-side-binaries.ts
</code></span></span></span></span>
Linux Linux的
<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>ARCH="x86_64-unknown-linux-gnu" \
OLLAMA_VERSION="v0.6.8" \
SHINKAI_NODE_VERSION="v1.0.2" \
npx ts-node ./ci-scripts/download-side-binaries.ts
</code></span></span></span></span>
Windows 窗户
<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>$ENV:OLLAMA_VERSION="v0.6.8";
$ENV:SHINKAI_NODE_VERSION="v1.0.2";
$ENV:ARCH="x86_64-pc-windows-msvc";
npx ts-node ./ci-scripts/download-side-binaries.ts
</code></span></span></span></span>
Run one of the projects
运行其中一个项目
Once you have done that simply use npm
to compile/serve it yourself:
一旦你完成了这些,只需自己使用 npm
来编译/提供它:
<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>cd shinkai-apps
nvm use
npm ci
npx nx serve {project-name} # IE: npx nx serve shinkai-desktop
</code></span></span></span></span>
Project specific configurations
项目特定配置
shinkai-visor: As this is a Chrome Extension, after build, developers needs to load it in chrome:
shinkai-visor: 由于这是一个 Chrome 扩展,构建后,开发人员需要在 chrome 中加载它:- Open Chrome. 打开 Chrome。
- Navigate to
chrome://extensions
. 导航到chrome://extensions
。 - Enable Developer mode. 启用 Developer mode。
- Click Load unpacked. 单击 Load unpacked(加载解压缩)。
- Select the
./dist/apps/shinkai-visor
folder which contains the output of the building process using commands likenpx nx serve shinkai-visor
.
使用命令(如npx nx serve shinkai-visor
)选择包含构建过程输出的./dist/apps/shinkai-visor
文件夹。
shinkai-desktop: For development and building purposes
shinkai-desktop:用于开发和构建目的- Run as a Desktop App using Vite: Run
npx nx serve:tauri shinkai-desktop
and it will automatically launch the Shinkai Desktop application.
使用 Vite 作为桌面应用程序运行:运行npx nx serve:tauri shinkai-desktop
,它将自动启动 Shinkai 桌面应用程序。 - Run as a Web App: Run
npx nx serve shinkai-desktop
and open a browser and navigate tohttp://localhost:1420
.
作为 Web 应用程序运行:运行npx nx serve shinkai-desktop
并打开浏览器,然后导航到http://localhost:1420
。
- Run as a Desktop App using Vite: Run
Useful Commands 有用的命令
Every command, if it's needed, build projects and it's dependencies according to the project dependency tree inferred from imports between them.
如果需要,每个命令都会根据从它们之间的导入推断出的项目依赖关系树来构建项目及其依赖关系。
Run a single task
运行单个任务Command:
npx nx [target] [project-name]
命令:npx nx [target] [project-name]
Params: 参数:
- target: build | serve | lint | test | e2e
目标: 构建 |服务 |棉绒 |测试 |E2E
IE: IE:
npx nx build shinkai-visor
npx nx lint shinkai-message-ts
npx nx e2e shinkai-visor
npx nx serve shinkai-desktop
- target: build | serve | lint | test | e2e
Run many tasks 运行许多任务
Command:
npx nx run-many --target=[target]
命令:npx nx run-many --target=[target]
Params: 参数:
- target: build | serve | lint | test | e2e
目标: 构建 |服务 |棉绒 |测试 |E2E
IE: IE:
npx nx run-many --target=build
npx nx run-many --target=lint
npx nx run-many --target=test
npx nx run-many --target=e2e
npx nx run-many --target=serve
- target: build | serve | lint | test | e2e
Run on affected projects
在受影响的项目上运行Command:
npx nx affected --target=[target]
命令:npx nx affected --target=[target]
Params: 参数:
- target: build | serve | lint | test | e2e
目标: 构建 |服务 |棉绒 |测试 |E2E
IE: IE:
npx nx affected --target=build
- target: build | serve | lint | test | e2e
When you build a project, NX builds a cache (to make it faster), if you want to skip it just add the parameter
--skip-nx-cache
to the previous commands.
当您构建项目时,NX 会构建一个缓存(以使其更快),如果您想跳过它,只需将参数--skip-nx-cache
添加到前面的命令中即可。
Create a dev build
创建开发版本NODE_OPTIONS="--max_old_space_size=8192" npx nx build shinkai-desktop --config="./src-tauri/tauri.conf.development.json"
Update ollama models repository
更新 ollama 模型存储库npx ts-node ./ci-scripts/generate-ollama-models-repository.ts
五、Dev conventions 开发约定
Monorepo Monorepo 的
To orchestrate all the tasks, dependencies and hierarchy between different projects, this repository uses NX as a monorepo tooling.
为了协调不同项目之间的所有任务、依赖关系和层次结构,此存储库使用 NX 作为 monorepo 工具。
Third party dependencies 第三方依赖项
All projects share the same base of dependencies defined ./package.json
file found in the root of the repository. Nested package json files are used just to override or extends base attributes.
所有项目共享在存储库根目录中找到的相同依赖项定义 ./package.json
文件库。嵌套的包 json 文件仅用于覆盖或扩展基本属性。
UI Libraries UI 库
To build the UI there are 3 core libraries:
要构建 UI,有 3 个核心库:
- radix to have base unstyled components.
radix 具有基本无样式组件。 - shadcn to obtain ready to use components.
shadcn 获取现成的组件。 - tailwindcss to implement css customizations, structures, layouts and helpers.
tailwindcss 来实现 CSS 自定义、结构、布局和帮助程序。
State management 状态管理
To implement state management there are two different libraries:
要实现状态管理,有两种不同的库:
- zustand: To implement UI State
zustand:实现 UI 状态 - react-query: To implement data state
react-query:实现数据状态
六、软件下载
本文信息来源于GitHub作者地址:https://github.com/dcSpark/shinkai-apps