nexusmind 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.js +17 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +20 -0
- package/package.json +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# ColoBot
|
|
2
|
+
|
|
3
|
+
自带安全守护的 AI Agent 框架 — 多模态 AI × 安全母 Agent × 许可证系统
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install colobot
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 快速开始
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { AgentRuntime, Sentinel, CharterManager } from 'colobot'
|
|
15
|
+
|
|
16
|
+
// 创建 Agent 运行时
|
|
17
|
+
const agent = new AgentRuntime({
|
|
18
|
+
provider: 'anthropic',
|
|
19
|
+
model: 'claude-sonnet-4-6',
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
// 启用安全守护
|
|
23
|
+
const sentinel = new Sentinel({
|
|
24
|
+
enableInputScan: true,
|
|
25
|
+
enableOutputScan: true,
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
// 申请许可证解锁能力
|
|
29
|
+
const charter = new CharterManager()
|
|
30
|
+
await charter.apply('academic', '论文写作')
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## CLI 使用
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# 安装后直接使用
|
|
37
|
+
npx colobot chat "你好"
|
|
38
|
+
|
|
39
|
+
# 或全局安装后
|
|
40
|
+
npm install -g colobot
|
|
41
|
+
colobot chat "帮我写一段代码"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 包组成
|
|
45
|
+
|
|
46
|
+
| 包 | 说明 |
|
|
47
|
+
|---|---|
|
|
48
|
+
| @colobot/core | Agent 运行时核心 |
|
|
49
|
+
| @colobot/sentinel | 安全守护(输入输出扫描、进程守护) |
|
|
50
|
+
| @colobot/charter | 许可证系统(定义 AI 能力边界) |
|
|
51
|
+
| @colobot/types | 共享类型定义 |
|
|
52
|
+
|
|
53
|
+
## 许可证
|
|
54
|
+
|
|
55
|
+
AGPL-3.0
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* ColoBot CLI 入口
|
|
4
|
+
* 代理到 @nexusmind/core 的 CLI
|
|
5
|
+
*/
|
|
6
|
+
import { spawn } from 'child_process';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
import { dirname, join } from 'path';
|
|
9
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const cliPath = join(__dirname, '..', '..', 'core', 'dist', 'cli.js');
|
|
11
|
+
const child = spawn('node', [cliPath, ...process.argv.slice(2)], {
|
|
12
|
+
stdio: 'inherit',
|
|
13
|
+
shell: false,
|
|
14
|
+
});
|
|
15
|
+
child.on('exit', (code) => {
|
|
16
|
+
process.exit(code ?? 0);
|
|
17
|
+
});
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ColoBot - 自带安全守护的 AI Agent 框架
|
|
3
|
+
*
|
|
4
|
+
* 这是伞包,重新导出所有子包的功能
|
|
5
|
+
*/
|
|
6
|
+
export { AgentRuntime } from '@nexusmind/core';
|
|
7
|
+
export type { RunOptions, RunResult, AgentConfig } from '@nexusmind/core';
|
|
8
|
+
export { OpenAIProvider, AnthropicProvider, MockProvider, MiniMaxProvider } from '@nexusmind/core';
|
|
9
|
+
export type { LLMProvider, LLMResponse } from '@nexusmind/core';
|
|
10
|
+
export { ToolRegistry } from '@nexusmind/core';
|
|
11
|
+
export type { ToolContext, ToolResult } from '@nexusmind/types';
|
|
12
|
+
export { SQLiteStore, createAutoStore } from '@nexusmind/core';
|
|
13
|
+
export { ConfigManager } from '@nexusmind/core';
|
|
14
|
+
export type { CoreConfig } from '@nexusmind/core';
|
|
15
|
+
export { HealthCheck } from '@nexusmind/core';
|
|
16
|
+
export { GracefulShutdown } from '@nexusmind/core';
|
|
17
|
+
export { Sentinel, CharterGuard } from '@nexusmind/sentinel';
|
|
18
|
+
export type { SentinelConfig } from '@nexusmind/sentinel';
|
|
19
|
+
export { CharterManager, ACADEMIC_CHARTER, LEGAL_CHARTER, LONGDOC_CHARTER } from '@nexusmind/charter';
|
|
20
|
+
export type { CharterDefinition, CharterInstance } from '@nexusmind/charter';
|
|
21
|
+
export type { LLMMessage, ContentBlock, TextContent, ToolCall, Skill, } from '@nexusmind/types';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ColoBot - 自带安全守护的 AI Agent 框架
|
|
3
|
+
*
|
|
4
|
+
* 这是伞包,重新导出所有子包的功能
|
|
5
|
+
*/
|
|
6
|
+
// Core - 核心运行时
|
|
7
|
+
export { AgentRuntime } from '@nexusmind/core';
|
|
8
|
+
// Core - Providers
|
|
9
|
+
export { OpenAIProvider, AnthropicProvider, MockProvider, MiniMaxProvider } from '@nexusmind/core';
|
|
10
|
+
// Core - Tools
|
|
11
|
+
export { ToolRegistry } from '@nexusmind/core';
|
|
12
|
+
// Core - Memory
|
|
13
|
+
export { SQLiteStore, createAutoStore } from '@nexusmind/core';
|
|
14
|
+
// Core - Config
|
|
15
|
+
export { ConfigManager } from '@nexusmind/core';
|
|
16
|
+
export { GracefulShutdown } from '@nexusmind/core';
|
|
17
|
+
// Sentinel - 安全守护
|
|
18
|
+
export { Sentinel, CharterGuard } from '@nexusmind/sentinel';
|
|
19
|
+
// Charter - 许可证系统
|
|
20
|
+
export { CharterManager, ACADEMIC_CHARTER, LEGAL_CHARTER, LONGDOC_CHARTER } from '@nexusmind/charter';
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nexusmind",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "自带安全守护的 AI Agent 框架 — 多模态 AI × 安全守护 × 许可证系统",
|
|
5
|
+
"license": "AGPL-3.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"nexusmind": "./dist/cli.js"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://github.com/nexusmind/nexusmind.git",
|
|
25
|
+
"directory": "packages/nexusmind"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc",
|
|
29
|
+
"test": "vitest run"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@nexusmind/core": "*",
|
|
33
|
+
"@nexusmind/types": "*",
|
|
34
|
+
"@nexusmind/charter": "*",
|
|
35
|
+
"@nexusmind/sentinel": "*"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"typescript": "^5.6.0",
|
|
39
|
+
"vitest": "^2.0.0"
|
|
40
|
+
}
|
|
41
|
+
}
|