siduri 1.0.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/LICENSE +6 -0
- package/README.md +84 -0
- package/dist/builtin-manifests.d.ts +2 -0
- package/dist/builtin-manifests.js +524 -0
- package/dist/clean-machine-e2e.test.d.ts +1 -0
- package/dist/clean-machine-e2e.test.js +160 -0
- package/dist/clean-machine-smoke.test.d.ts +1 -0
- package/dist/clean-machine-smoke.test.js +165 -0
- package/dist/colors.d.ts +8 -0
- package/dist/colors.js +11 -0
- package/dist/configurators/behavior.d.ts +2 -0
- package/dist/configurators/behavior.js +77 -0
- package/dist/configurators/body.d.ts +2 -0
- package/dist/configurators/body.js +107 -0
- package/dist/configurators/brain.d.ts +6 -0
- package/dist/configurators/brain.js +80 -0
- package/dist/configurators/ear.d.ts +2 -0
- package/dist/configurators/ear.js +43 -0
- package/dist/configurators/hands.d.ts +2 -0
- package/dist/configurators/hands.js +43 -0
- package/dist/configurators/index.d.ts +24 -0
- package/dist/configurators/index.js +78 -0
- package/dist/configurators/knowledge.d.ts +6 -0
- package/dist/configurators/knowledge.js +146 -0
- package/dist/configurators/memory.d.ts +2 -0
- package/dist/configurators/memory.js +26 -0
- package/dist/configurators/mouth.d.ts +2 -0
- package/dist/configurators/mouth.js +35 -0
- package/dist/configurators/observation.d.ts +2 -0
- package/dist/configurators/observation.js +38 -0
- package/dist/configurators/types.d.ts +12 -0
- package/dist/configurators/types.js +2 -0
- package/dist/configurators/vision.d.ts +2 -0
- package/dist/configurators/vision.js +47 -0
- package/dist/configurators/voice.d.ts +2 -0
- package/dist/configurators/voice.js +373 -0
- package/dist/configurators.test.d.ts +1 -0
- package/dist/configurators.test.js +464 -0
- package/dist/db.d.ts +13 -0
- package/dist/db.js +15 -0
- package/dist/discovery.d.ts +13 -0
- package/dist/discovery.js +85 -0
- package/dist/discovery.test.d.ts +1 -0
- package/dist/discovery.test.js +69 -0
- package/dist/doctor-db.test.d.ts +1 -0
- package/dist/doctor-db.test.js +52 -0
- package/dist/doctor.d.ts +19 -0
- package/dist/doctor.js +266 -0
- package/dist/generator.d.ts +23 -0
- package/dist/generator.js +1094 -0
- package/dist/generator.test.d.ts +1 -0
- package/dist/generator.test.js +252 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +607 -0
- package/dist/manifest.d.ts +33 -0
- package/dist/manifest.js +40 -0
- package/dist/project-dir.test.d.ts +1 -0
- package/dist/project-dir.test.js +37 -0
- package/dist/providers/knowledge-hub.d.ts +44 -0
- package/dist/providers/knowledge-hub.js +162 -0
- package/dist/providers/openrouter.d.ts +32 -0
- package/dist/providers/openrouter.js +201 -0
- package/dist/release-check.d.ts +9 -0
- package/dist/release-check.js +128 -0
- package/dist/runtime-parity.test.d.ts +1 -0
- package/dist/runtime-parity.test.js +141 -0
- package/dist/schema-validator.d.ts +9 -0
- package/dist/schema-validator.js +107 -0
- package/dist/web-dist/404/index.html +1 -0
- package/dist/web-dist/404.html +1 -0
- package/dist/web-dist/__next.__PAGE__.txt +34 -0
- package/dist/web-dist/__next._full.txt +32 -0
- package/dist/web-dist/__next._tree.txt +4 -0
- package/dist/web-dist/_next/static/4aL_iP3FHsLSyHzCnRQYD/_buildManifest.js +1 -0
- package/dist/web-dist/_next/static/4aL_iP3FHsLSyHzCnRQYD/_ssgManifest.js +1 -0
- package/dist/web-dist/_next/static/chunks/136-1d10af93b770a1c8.js +52 -0
- package/dist/web-dist/_next/static/chunks/1629039a.f535b3ff45566416.js +1 -0
- package/dist/web-dist/_next/static/chunks/202.59b8eb8a8c45f711.js +1 -0
- package/dist/web-dist/_next/static/chunks/2be4ccb0.ab2975eb50b4e166.js +1 -0
- package/dist/web-dist/_next/static/chunks/411.d68b2e48424f1e47.js +1 -0
- package/dist/web-dist/_next/static/chunks/426-9f7f6e7fffd4c3c3.js +1 -0
- package/dist/web-dist/_next/static/chunks/563b947f-8e2871a2ab7cd91e.js +1 -0
- package/dist/web-dist/_next/static/chunks/92e71660.11f182d50bce2be0.js +342 -0
- package/dist/web-dist/_next/static/chunks/app/_global-error/page-bce6d30fb2b1a3b0.js +1 -0
- package/dist/web-dist/_next/static/chunks/app/_not-found/page-74658f4988eabcc7.js +1 -0
- package/dist/web-dist/_next/static/chunks/app/chat/page-ab56048b707a3ddd.js +34 -0
- package/dist/web-dist/_next/static/chunks/app/layout-14f1a3f31e58be17.js +1 -0
- package/dist/web-dist/_next/static/chunks/app/operator/page-6b2d0ba884183ad7.js +1 -0
- package/dist/web-dist/_next/static/chunks/app/page-fc4bf56cf33ae27b.js +1 -0
- package/dist/web-dist/_next/static/chunks/framework-7afb7035d9872ea0.js +1 -0
- package/dist/web-dist/_next/static/chunks/main-8553b996986f1210.js +5 -0
- package/dist/web-dist/_next/static/chunks/main-app-9e6a144626e5a5b9.js +1 -0
- package/dist/web-dist/_next/static/chunks/next/dist/client/components/builtin/app-error-bce6d30fb2b1a3b0.js +1 -0
- package/dist/web-dist/_next/static/chunks/next/dist/client/components/builtin/forbidden-bce6d30fb2b1a3b0.js +1 -0
- package/dist/web-dist/_next/static/chunks/next/dist/client/components/builtin/global-error-68ea4ac05dcaf701.js +1 -0
- package/dist/web-dist/_next/static/chunks/next/dist/client/components/builtin/not-found-bce6d30fb2b1a3b0.js +1 -0
- package/dist/web-dist/_next/static/chunks/next/dist/client/components/builtin/unauthorized-bce6d30fb2b1a3b0.js +1 -0
- package/dist/web-dist/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/dist/web-dist/_next/static/chunks/webpack-9073f434bc17ce16.js +1 -0
- package/dist/web-dist/_next/static/css/ceeb8e5596664b11.css +1 -0
- package/dist/web-dist/_not-found/__next._full.txt +17 -0
- package/dist/web-dist/_not-found/__next._not-found.__PAGE__.txt +23 -0
- package/dist/web-dist/_not-found/__next._tree.txt +3 -0
- package/dist/web-dist/_not-found/index.html +1 -0
- package/dist/web-dist/_not-found/index.txt +17 -0
- package/dist/web-dist/apple-icon.png +0 -0
- package/dist/web-dist/apple-touch-icon.png +0 -0
- package/dist/web-dist/chat/__next._full.txt +18 -0
- package/dist/web-dist/chat/__next._tree.txt +3 -0
- package/dist/web-dist/chat/__next.chat.__PAGE__.txt +24 -0
- package/dist/web-dist/chat/index.html +1 -0
- package/dist/web-dist/chat/index.txt +18 -0
- package/dist/web-dist/favicon.ico +0 -0
- package/dist/web-dist/favicon.svg +4 -0
- package/dist/web-dist/icon.svg +4 -0
- package/dist/web-dist/index.html +1 -0
- package/dist/web-dist/index.txt +32 -0
- package/dist/web-dist/live2d/live2dcubismcore.min.js +9 -0
- package/dist/web-dist/logo-circle.png +0 -0
- package/dist/web-dist/logo-circle.svg +4 -0
- package/dist/web-dist/logo-white.svg +3 -0
- package/dist/web-dist/logo.png +0 -0
- package/dist/web-dist/logo.svg +3 -0
- package/dist/web-dist/operator/__next._full.txt +18 -0
- package/dist/web-dist/operator/__next._tree.txt +3 -0
- package/dist/web-dist/operator/__next.operator.__PAGE__.txt +24 -0
- package/dist/web-dist/operator/index.html +1 -0
- package/dist/web-dist/operator/index.txt +18 -0
- package/dist/web-template.d.ts +2 -0
- package/dist/web-template.js +589 -0
- package/package.json +44 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const generator_1 = require("./generator");
|
|
4
|
+
describe('Instance Generator Composition Invariants (Phase 3)', () => {
|
|
5
|
+
const MOCK_MANIFESTS = {
|
|
6
|
+
brain: {
|
|
7
|
+
name: '@sidurijs/brain',
|
|
8
|
+
organType: 'brain',
|
|
9
|
+
version: '1.0.0',
|
|
10
|
+
displayName: 'Brain (Cognition & Planning)',
|
|
11
|
+
entrypoint: './dist/index.js',
|
|
12
|
+
factory: 'OpenRouterBrain',
|
|
13
|
+
configKey: 'brain',
|
|
14
|
+
configSchema: { type: 'object', properties: { provider: { type: 'string' }, model: { type: 'string' } } },
|
|
15
|
+
environment: [{ name: 'OPENROUTER_API_KEY', required: true, secret: true }],
|
|
16
|
+
services: [{ name: 'LLM Inference', kind: 'http_service' }],
|
|
17
|
+
},
|
|
18
|
+
hands: {
|
|
19
|
+
name: '@sidurijs/hands',
|
|
20
|
+
organType: 'hands',
|
|
21
|
+
version: '1.0.0',
|
|
22
|
+
displayName: 'Hands (MCP Tool Execution)',
|
|
23
|
+
entrypoint: './dist/index.js',
|
|
24
|
+
factory: 'DefaultHandsOrgan',
|
|
25
|
+
configKey: 'hands',
|
|
26
|
+
configSchema: { type: 'object', properties: { defaultTimeoutMs: { type: 'number' } } },
|
|
27
|
+
environment: [{ name: 'ACTION_POLICY_SECRET', required: true, secret: true }],
|
|
28
|
+
services: [],
|
|
29
|
+
},
|
|
30
|
+
archive: {
|
|
31
|
+
name: '@sidurijs/archive',
|
|
32
|
+
organType: 'archive',
|
|
33
|
+
version: '1.0.0',
|
|
34
|
+
displayName: 'Archive (Interaction Audit Ledger)',
|
|
35
|
+
entrypoint: './dist/index.js',
|
|
36
|
+
factory: 'SqliteArchiveLedger',
|
|
37
|
+
configKey: 'archive',
|
|
38
|
+
configSchema: { type: 'object', properties: { provider: { type: 'string' } } },
|
|
39
|
+
environment: [],
|
|
40
|
+
services: [],
|
|
41
|
+
database: { engine: 'sqlite' },
|
|
42
|
+
},
|
|
43
|
+
body: {
|
|
44
|
+
name: '@sidurijs/body',
|
|
45
|
+
organType: 'body',
|
|
46
|
+
version: '1.0.0',
|
|
47
|
+
displayName: 'Body (Live2D & Avatar State)',
|
|
48
|
+
entrypoint: './dist/index.js',
|
|
49
|
+
factory: 'NeutralBodyOrgan',
|
|
50
|
+
configKey: 'body',
|
|
51
|
+
configSchema: { type: 'object', properties: { provider: { type: 'string' } } },
|
|
52
|
+
environment: [],
|
|
53
|
+
services: [],
|
|
54
|
+
},
|
|
55
|
+
voice: {
|
|
56
|
+
name: '@sidurijs/voice',
|
|
57
|
+
organType: 'voice',
|
|
58
|
+
version: '1.0.0',
|
|
59
|
+
displayName: 'Voice (VOICEVOX Speech Synthesis)',
|
|
60
|
+
entrypoint: './dist/index.js',
|
|
61
|
+
factory: 'VoiceAdapter',
|
|
62
|
+
configKey: 'voice',
|
|
63
|
+
configSchema: { type: 'object', properties: { provider: { type: 'string' } } },
|
|
64
|
+
environment: [{ name: 'VOICEVOX_URL', default: 'http://localhost:50021' }],
|
|
65
|
+
services: [{ name: 'VOICEVOX', kind: 'http_service' }],
|
|
66
|
+
},
|
|
67
|
+
self: {
|
|
68
|
+
name: '@sidurijs/self',
|
|
69
|
+
organType: 'behavior',
|
|
70
|
+
version: '1.0.0',
|
|
71
|
+
displayName: 'Self (Active Persona & Directives)',
|
|
72
|
+
entrypoint: './dist/index.js',
|
|
73
|
+
factory: 'ActiveSelfCompiler',
|
|
74
|
+
configKey: 'behavior',
|
|
75
|
+
configSchema: { type: 'object', properties: { provider: { type: 'string' } } },
|
|
76
|
+
environment: [],
|
|
77
|
+
services: [],
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
test('Composition A: Brain only', () => {
|
|
81
|
+
const files = (0, generator_1.generateInstanceFiles)({
|
|
82
|
+
name: 'brain-only-agent',
|
|
83
|
+
selectedManifests: [MOCK_MANIFESTS.brain],
|
|
84
|
+
});
|
|
85
|
+
const pkg = JSON.parse(files['package.json']);
|
|
86
|
+
expect(pkg.dependencies['@sidurijs/core']).toBeDefined();
|
|
87
|
+
expect(pkg.dependencies['@sidurijs/brain']).toBeDefined();
|
|
88
|
+
expect(pkg.dependencies['@sidurijs/archive']).toBeUndefined();
|
|
89
|
+
expect(pkg.dependencies['@sidurijs/hands']).toBeUndefined();
|
|
90
|
+
expect(pkg.dependencies['@sidurijs/voice']).toBeUndefined();
|
|
91
|
+
expect(pkg.dependencies['@sidurijs/body']).toBeUndefined();
|
|
92
|
+
expect(pkg.devDependencies['@vxnus/siduri']).toBeDefined();
|
|
93
|
+
// src/index.js
|
|
94
|
+
expect(files['src/index.js']).toContain("import { OpenRouterBrain } from '@sidurijs/brain'");
|
|
95
|
+
expect(files['src/index.js']).not.toContain('@sidurijs/hands');
|
|
96
|
+
expect(files['src/index.js']).not.toContain('@sidurijs/archive');
|
|
97
|
+
expect(files['src/index.js']).not.toContain('siduri-runtime.js');
|
|
98
|
+
// siduri.config.json
|
|
99
|
+
const config = JSON.parse(files['siduri.config.json']);
|
|
100
|
+
expect(config.organs.brain).toBeDefined();
|
|
101
|
+
expect(config.organs.hands).toBeUndefined();
|
|
102
|
+
expect(config.organs.archive).toBeUndefined();
|
|
103
|
+
// .env.example
|
|
104
|
+
expect(files['.env.example']).toContain('OPENROUTER_API_KEY');
|
|
105
|
+
expect(files['.env.example']).not.toContain('DATABASE_URL');
|
|
106
|
+
expect(files['.env.example']).not.toContain('ACTION_POLICY_SECRET');
|
|
107
|
+
// No body asset scaffold
|
|
108
|
+
expect(files.createAssetsBodyDir).toBe(false);
|
|
109
|
+
});
|
|
110
|
+
test('Composition B: Brain + Hands', () => {
|
|
111
|
+
const files = (0, generator_1.generateInstanceFiles)({
|
|
112
|
+
name: 'coding-agent',
|
|
113
|
+
selectedManifests: [MOCK_MANIFESTS.brain, MOCK_MANIFESTS.hands],
|
|
114
|
+
});
|
|
115
|
+
const pkg = JSON.parse(files['package.json']);
|
|
116
|
+
expect(pkg.dependencies['@sidurijs/core']).toBeDefined();
|
|
117
|
+
expect(pkg.dependencies['@sidurijs/brain']).toBeDefined();
|
|
118
|
+
expect(pkg.dependencies['@sidurijs/hands']).toBeDefined();
|
|
119
|
+
expect(pkg.dependencies['@sidurijs/archive']).toBeUndefined();
|
|
120
|
+
// src/index.js
|
|
121
|
+
expect(files['src/index.js']).toContain("import { OpenRouterBrain } from '@sidurijs/brain'");
|
|
122
|
+
expect(files['src/index.js']).toContain("import { DefaultHandsOrgan } from '@sidurijs/hands'");
|
|
123
|
+
expect(files['src/index.js']).not.toContain('@sidurijs/archive');
|
|
124
|
+
// .env.example
|
|
125
|
+
expect(files['.env.example']).toContain('OPENROUTER_API_KEY');
|
|
126
|
+
expect(files['.env.example']).toContain('ACTION_POLICY_SECRET');
|
|
127
|
+
expect(files['.env.example']).not.toContain('DATABASE_URL');
|
|
128
|
+
expect(files.createAssetsBodyDir).toBe(false);
|
|
129
|
+
});
|
|
130
|
+
test('Composition C: Brain + Archive', () => {
|
|
131
|
+
const files = (0, generator_1.generateInstanceFiles)({
|
|
132
|
+
name: 'archive-agent',
|
|
133
|
+
selectedManifests: [MOCK_MANIFESTS.brain, MOCK_MANIFESTS.archive],
|
|
134
|
+
});
|
|
135
|
+
const pkg = JSON.parse(files['package.json']);
|
|
136
|
+
expect(pkg.dependencies['@sidurijs/core']).toBeDefined();
|
|
137
|
+
expect(pkg.dependencies['@sidurijs/brain']).toBeDefined();
|
|
138
|
+
expect(pkg.dependencies['@sidurijs/archive']).toBeDefined();
|
|
139
|
+
expect(pkg.dependencies['@sidurijs/hands']).toBeUndefined();
|
|
140
|
+
// .env.example
|
|
141
|
+
expect(files['.env.example']).toContain('OPENROUTER_API_KEY');
|
|
142
|
+
expect(files['.env.example']).not.toContain('DATABASE_URL');
|
|
143
|
+
expect(files['.env.example']).not.toContain('ACTION_POLICY_SECRET');
|
|
144
|
+
// README mentions database
|
|
145
|
+
expect(files['README.md']).toContain('siduri.sqlite');
|
|
146
|
+
expect(files['README.md']).not.toContain('PostgreSQL');
|
|
147
|
+
expect(files['README.md']).not.toContain('npx @vxnus/siduri db push');
|
|
148
|
+
});
|
|
149
|
+
test('Composition D: Full with Body', () => {
|
|
150
|
+
const files = (0, generator_1.generateInstanceFiles)({
|
|
151
|
+
name: 'companion-full',
|
|
152
|
+
selectedManifests: [
|
|
153
|
+
MOCK_MANIFESTS.brain,
|
|
154
|
+
MOCK_MANIFESTS.archive,
|
|
155
|
+
MOCK_MANIFESTS.hands,
|
|
156
|
+
MOCK_MANIFESTS.body,
|
|
157
|
+
MOCK_MANIFESTS.voice,
|
|
158
|
+
],
|
|
159
|
+
});
|
|
160
|
+
const pkg = JSON.parse(files['package.json']);
|
|
161
|
+
expect(pkg.dependencies['@sidurijs/core']).toBeDefined();
|
|
162
|
+
expect(pkg.dependencies['@sidurijs/brain']).toBeDefined();
|
|
163
|
+
expect(pkg.dependencies['@sidurijs/archive']).toBeDefined();
|
|
164
|
+
expect(pkg.dependencies['@sidurijs/hands']).toBeDefined();
|
|
165
|
+
expect(pkg.dependencies['@sidurijs/body']).toBeDefined();
|
|
166
|
+
expect(pkg.dependencies['@sidurijs/voice']).toBeDefined();
|
|
167
|
+
// Body & voice asset directories requested
|
|
168
|
+
expect(files.createAssetsBodyDir).toBe(true);
|
|
169
|
+
expect(files.createAssetsDirs).toContain('assets/body/default');
|
|
170
|
+
expect(files.createAssetsDirs).toContain('assets/voice/default');
|
|
171
|
+
// README mentions Live2D model assets & prerequisites
|
|
172
|
+
expect(files['README.md']).toContain('assets/body/default');
|
|
173
|
+
expect(files['README.md']).toContain('assets/voice/default');
|
|
174
|
+
expect(files['README.md']).toContain('Prerequisites');
|
|
175
|
+
// No docker compose generated (Docker completely removed, host-native runtime)
|
|
176
|
+
expect(files['docker-compose.yml']).toBeUndefined();
|
|
177
|
+
expect(files['README.md']).toContain('Voicevox engine executable will be securely auto-downloaded');
|
|
178
|
+
expect(pkg.scripts['services:up']).toBeUndefined();
|
|
179
|
+
expect(pkg.scripts['services:down']).toBeUndefined();
|
|
180
|
+
});
|
|
181
|
+
test('Composition E: Standalone companion never generates docker-compose.yml and validates config', () => {
|
|
182
|
+
const files = (0, generator_1.generateInstanceFiles)({
|
|
183
|
+
name: 'brain-solo',
|
|
184
|
+
selectedManifests: [MOCK_MANIFESTS.brain],
|
|
185
|
+
});
|
|
186
|
+
expect(files['docker-compose.yml']).toBeUndefined();
|
|
187
|
+
const pkg = JSON.parse(files['package.json']);
|
|
188
|
+
expect(pkg.scripts['services:up']).toBeUndefined();
|
|
189
|
+
expect(files['src/index.js']).toContain('validateCompanionConfig');
|
|
190
|
+
expect(files['public/index.html']).toBeDefined();
|
|
191
|
+
expect(files['public/index.html']).toContain('Memory Console');
|
|
192
|
+
expect(files['public/index.html']).toContain('Companion Chat');
|
|
193
|
+
});
|
|
194
|
+
test('Generated runtime server template enforces loopback binding, safe health, and path containment', () => {
|
|
195
|
+
const files = (0, generator_1.generateInstanceFiles)({
|
|
196
|
+
name: 'secure-companion',
|
|
197
|
+
selectedManifests: [MOCK_MANIFESTS.brain, MOCK_MANIFESTS.archive],
|
|
198
|
+
});
|
|
199
|
+
const srcIndexJs = files['src/index.js'];
|
|
200
|
+
// 1. Explicit loopback binding 127.0.0.1
|
|
201
|
+
expect(srcIndexJs).toContain("server.listen(Number(PORT), '127.0.0.1'");
|
|
202
|
+
expect(srcIndexJs).toContain("http://127.0.0.1:");
|
|
203
|
+
// 2. Minimal /health endpoint without config.organs or secrets
|
|
204
|
+
expect(srcIndexJs).toContain("pathname === '/health'");
|
|
205
|
+
expect(srcIndexJs).not.toContain('organs: config.organs');
|
|
206
|
+
// 3. Strict path traversal containment
|
|
207
|
+
expect(srcIndexJs).toContain('relative.startsWith(\'..\')');
|
|
208
|
+
expect(srcIndexJs).toContain('path.isAbsolute(relative)');
|
|
209
|
+
expect(srcIndexJs).toContain('decodeURIComponent');
|
|
210
|
+
// 4. Chat endpoints define payload before accessing payload.context
|
|
211
|
+
const chatEndpointIndex = srcIndexJs.indexOf("pathname === '/chat'");
|
|
212
|
+
const chatStreamEndpointIndex = srcIndexJs.indexOf("pathname === '/chat/stream'");
|
|
213
|
+
expect(chatEndpointIndex).toBeGreaterThan(-1);
|
|
214
|
+
expect(chatStreamEndpointIndex).toBeGreaterThan(-1);
|
|
215
|
+
const chatSlice = srcIndexJs.slice(chatEndpointIndex, chatStreamEndpointIndex);
|
|
216
|
+
const chatStreamSlice = srcIndexJs.slice(chatStreamEndpointIndex, chatStreamEndpointIndex + 1500);
|
|
217
|
+
expect(chatSlice).toContain("const payload = JSON.parse(body || '{}');");
|
|
218
|
+
expect(chatStreamSlice).toContain("const payload = JSON.parse(body || '{}');");
|
|
219
|
+
expect(chatSlice).toContain("channel: 'direct'");
|
|
220
|
+
expect(chatStreamSlice).toContain("channel: 'direct'");
|
|
221
|
+
});
|
|
222
|
+
test('Composition F: Brain + Self persona manifest & Teach Mode endpoints', () => {
|
|
223
|
+
const files = (0, generator_1.generateInstanceFiles)({
|
|
224
|
+
name: 'ResearchPartner',
|
|
225
|
+
selectedManifests: [MOCK_MANIFESTS.brain, MOCK_MANIFESTS.self],
|
|
226
|
+
organConfigs: {
|
|
227
|
+
behavior: {
|
|
228
|
+
provider: 'active_self',
|
|
229
|
+
mode: 'custom',
|
|
230
|
+
archetype: 'Technical Research Specialist',
|
|
231
|
+
ethos: 'analytical, thoughtful, concise',
|
|
232
|
+
directive: 'Prioritize empirical evidence and speak concisely',
|
|
233
|
+
selfPath: './assets/self/default.self',
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
});
|
|
237
|
+
// 1. Assets directory and .self file created in memory
|
|
238
|
+
expect(files.createAssetsDirs).toContain('assets/self');
|
|
239
|
+
expect(files['assets/self/default.self']).toBeDefined();
|
|
240
|
+
expect(files['assets/self/default.self']).toContain('archetype: "Technical Research Specialist"');
|
|
241
|
+
expect(files['assets/self/default.self']).toContain('ethos: "analytical, thoughtful, concise"');
|
|
242
|
+
expect(files['assets/self/default.self']).toContain('Prioritize empirical evidence and speak concisely');
|
|
243
|
+
expect(files['assets/self/default.self']).toContain('name: "ResearchPartner"');
|
|
244
|
+
// 2. src/index.js imports scanDirective and compilePersonaDocument
|
|
245
|
+
const srcIndexJs = files['src/index.js'];
|
|
246
|
+
expect(srcIndexJs).toContain("import { ActiveSelfCompiler, SqliteSelfRepository, SelfPackageParser, scanDirective, compilePersonaDocument } from '@sidurijs/self';");
|
|
247
|
+
// 3. Teach Mode endpoints are generated
|
|
248
|
+
expect(srcIndexJs).toContain("pathname === '/teach/detected-self'");
|
|
249
|
+
expect(srcIndexJs).toContain("pathname === '/teach/upload-self'");
|
|
250
|
+
expect(srcIndexJs).toContain("pathname === '/teach/install-self'");
|
|
251
|
+
});
|
|
252
|
+
});
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { OrganManifest } from './manifest';
|
|
3
|
+
export declare const CLI_VERSION = "2.1.0";
|
|
4
|
+
import { colors } from './colors';
|
|
5
|
+
export { colors };
|
|
6
|
+
export declare function printHeader(): void;
|
|
7
|
+
export declare function printSection(title: string): void;
|
|
8
|
+
export declare function printSuccess(message: string): void;
|
|
9
|
+
export declare function projectDirectoryName(value: string): string;
|
|
10
|
+
export declare function validateProjectDirectory(value: string): true | string;
|
|
11
|
+
export declare function formatReviewSummary(projectDirName: string, selectedManifests: OrganManifest[], organSummaries: Record<string, Record<string, unknown>>): string;
|
|
12
|
+
export declare function withTask<T>(label: string, task: () => Promise<T>): Promise<T>;
|
|
13
|
+
export declare function runCreateWizard(targetDir?: string, options?: {
|
|
14
|
+
localPath?: string;
|
|
15
|
+
}): Promise<void>;
|
|
16
|
+
export declare function runCliDoctor(targetDir?: string): Promise<void>;
|
|
17
|
+
export declare function runCliReset(targetDir?: string): Promise<void>;
|
|
18
|
+
export declare function runCliDb(subcommand?: string, targetDir?: string): Promise<void>;
|