@vxnus/siduri 0.0.6 → 0.0.8
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/dist/builtin-manifests.d.ts +2 -0
- package/dist/builtin-manifests.js +433 -0
- package/dist/clean-machine-e2e.test.js +1 -1
- package/dist/configurators/behavior.d.ts +2 -0
- package/dist/configurators/behavior.js +36 -0
- package/dist/configurators/body.d.ts +2 -0
- package/dist/configurators/body.js +44 -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 +28 -0
- package/dist/configurators/hands.d.ts +2 -0
- package/dist/configurators/hands.js +27 -0
- package/dist/configurators/index.d.ts +23 -0
- package/dist/configurators/index.js +74 -0
- package/dist/configurators/knowledge.d.ts +6 -0
- package/dist/configurators/knowledge.js +100 -0
- package/dist/configurators/memory.d.ts +2 -0
- package/dist/configurators/memory.js +44 -0
- package/dist/configurators/observation.d.ts +2 -0
- package/dist/configurators/observation.js +12 -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 +39 -0
- package/dist/configurators/voice.d.ts +2 -0
- package/dist/configurators/voice.js +53 -0
- package/dist/configurators.test.d.ts +1 -0
- package/dist/configurators.test.js +275 -0
- package/dist/discovery.js +8 -0
- package/dist/discovery.test.js +7 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +137 -54
- package/dist/providers/knowledge-hub.d.ts +37 -0
- package/dist/providers/knowledge-hub.js +141 -0
- package/dist/providers/openrouter.d.ts +32 -0
- package/dist/providers/openrouter.js +201 -0
- package/dist/release-check.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { OrganManifest } from '../manifest';
|
|
2
|
+
import { OrganConfigurationResult } from './types';
|
|
3
|
+
import { BrainConfiguratorOptions } from './brain';
|
|
4
|
+
import { KnowledgeConfiguratorOptions } from './knowledge';
|
|
5
|
+
export * from './types';
|
|
6
|
+
export * from './brain';
|
|
7
|
+
export * from './knowledge';
|
|
8
|
+
export * from './memory';
|
|
9
|
+
export * from './voice';
|
|
10
|
+
export * from './body';
|
|
11
|
+
export * from './hands';
|
|
12
|
+
export * from './behavior';
|
|
13
|
+
export * from './vision';
|
|
14
|
+
export * from './ear';
|
|
15
|
+
export * from './observation';
|
|
16
|
+
export interface ConfigureOrganOptions {
|
|
17
|
+
brainOptions?: BrainConfiguratorOptions;
|
|
18
|
+
knowledgeOptions?: KnowledgeConfiguratorOptions;
|
|
19
|
+
}
|
|
20
|
+
export declare function configureOrgan(manifest: OrganManifest, context: {
|
|
21
|
+
companionName: string;
|
|
22
|
+
existingConfig?: Record<string, unknown>;
|
|
23
|
+
}, options?: ConfigureOrganOptions): Promise<OrganConfigurationResult>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.configureOrgan = configureOrgan;
|
|
18
|
+
const brain_1 = require("./brain");
|
|
19
|
+
const knowledge_1 = require("./knowledge");
|
|
20
|
+
const memory_1 = require("./memory");
|
|
21
|
+
const voice_1 = require("./voice");
|
|
22
|
+
const body_1 = require("./body");
|
|
23
|
+
const hands_1 = require("./hands");
|
|
24
|
+
const behavior_1 = require("./behavior");
|
|
25
|
+
const vision_1 = require("./vision");
|
|
26
|
+
const ear_1 = require("./ear");
|
|
27
|
+
const observation_1 = require("./observation");
|
|
28
|
+
__exportStar(require("./types"), exports);
|
|
29
|
+
__exportStar(require("./brain"), exports);
|
|
30
|
+
__exportStar(require("./knowledge"), exports);
|
|
31
|
+
__exportStar(require("./memory"), exports);
|
|
32
|
+
__exportStar(require("./voice"), exports);
|
|
33
|
+
__exportStar(require("./body"), exports);
|
|
34
|
+
__exportStar(require("./hands"), exports);
|
|
35
|
+
__exportStar(require("./behavior"), exports);
|
|
36
|
+
__exportStar(require("./vision"), exports);
|
|
37
|
+
__exportStar(require("./ear"), exports);
|
|
38
|
+
__exportStar(require("./observation"), exports);
|
|
39
|
+
async function configureOrgan(manifest, context, options = {}) {
|
|
40
|
+
const ctx = {
|
|
41
|
+
companionName: context.companionName,
|
|
42
|
+
manifest,
|
|
43
|
+
existingConfig: context.existingConfig,
|
|
44
|
+
};
|
|
45
|
+
switch (manifest.organType) {
|
|
46
|
+
case 'brain':
|
|
47
|
+
return (0, brain_1.configureBrain)(ctx, options.brainOptions);
|
|
48
|
+
case 'knowledge':
|
|
49
|
+
return (0, knowledge_1.configureKnowledge)(ctx, options.knowledgeOptions);
|
|
50
|
+
case 'memory':
|
|
51
|
+
return (0, memory_1.configureMemory)(ctx);
|
|
52
|
+
case 'voice':
|
|
53
|
+
return (0, voice_1.configureVoice)(ctx);
|
|
54
|
+
case 'body':
|
|
55
|
+
return (0, body_1.configureBody)(ctx);
|
|
56
|
+
case 'hands':
|
|
57
|
+
return (0, hands_1.configureHands)(ctx);
|
|
58
|
+
case 'behavior':
|
|
59
|
+
return (0, behavior_1.configureBehavior)(ctx);
|
|
60
|
+
case 'vision':
|
|
61
|
+
return (0, vision_1.configureVision)(ctx);
|
|
62
|
+
case 'ear':
|
|
63
|
+
return (0, ear_1.configureEar)(ctx);
|
|
64
|
+
case 'observation':
|
|
65
|
+
return (0, observation_1.configureObservation)(ctx);
|
|
66
|
+
default:
|
|
67
|
+
return {
|
|
68
|
+
config: ctx.existingConfig || {},
|
|
69
|
+
summary: {
|
|
70
|
+
Provider: manifest.displayName,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { OrganConfiguratorContext, OrganConfigurationResult } from './types';
|
|
2
|
+
import { KnowledgeHubClient } from '../providers/knowledge-hub';
|
|
3
|
+
export interface KnowledgeConfiguratorOptions {
|
|
4
|
+
client?: KnowledgeHubClient;
|
|
5
|
+
}
|
|
6
|
+
export declare function configureKnowledge(_context: OrganConfiguratorContext, options?: KnowledgeConfiguratorOptions): Promise<OrganConfigurationResult>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.configureKnowledge = configureKnowledge;
|
|
7
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
8
|
+
const knowledge_hub_1 = require("../providers/knowledge-hub");
|
|
9
|
+
async function configureKnowledge(_context, options = {}) {
|
|
10
|
+
const client = options.client || new knowledge_hub_1.KnowledgeHubClient();
|
|
11
|
+
const { source } = await inquirer_1.default.prompt({
|
|
12
|
+
type: 'list',
|
|
13
|
+
name: 'source',
|
|
14
|
+
message: 'Knowledge source?',
|
|
15
|
+
choices: [
|
|
16
|
+
{ name: 'E Knowledge Hub (Search and attach remote factual pack)', value: 'e-hub' },
|
|
17
|
+
{ name: 'Do not use knowledge', value: 'none' },
|
|
18
|
+
],
|
|
19
|
+
});
|
|
20
|
+
if (source === 'none') {
|
|
21
|
+
return {
|
|
22
|
+
config: {
|
|
23
|
+
provider: 'none',
|
|
24
|
+
},
|
|
25
|
+
summary: {
|
|
26
|
+
Source: 'Do not use knowledge',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
// E Knowledge Hub flow
|
|
31
|
+
while (true) {
|
|
32
|
+
const { packId } = await inquirer_1.default.prompt({
|
|
33
|
+
type: 'input',
|
|
34
|
+
name: 'packId',
|
|
35
|
+
message: 'Search E Knowledge Hub or enter package ID:',
|
|
36
|
+
default: '@vxnus/e-teyvat',
|
|
37
|
+
validate: (val) => val.trim().length > 0 || 'Please enter a package ID.',
|
|
38
|
+
});
|
|
39
|
+
const trimmedPackId = packId.trim();
|
|
40
|
+
let manifest;
|
|
41
|
+
try {
|
|
42
|
+
process.stdout.write('\u001b[2mSearching E Knowledge Hub...\u001b[0m');
|
|
43
|
+
manifest = await client.resolveProvider(trimmedPackId);
|
|
44
|
+
process.stdout.write('\r\u001b[32m✓\u001b[0m Checking provider manifest\n');
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
process.stdout.write('\r\u001b[33m!\u001b[0m Provider resolution failed\n');
|
|
48
|
+
console.log(`\u001b[33mReason:\u001b[0m ${err.message}\n`);
|
|
49
|
+
const { failureAction } = await inquirer_1.default.prompt({
|
|
50
|
+
type: 'list',
|
|
51
|
+
name: 'failureAction',
|
|
52
|
+
message: 'What would you like to do?',
|
|
53
|
+
choices: [
|
|
54
|
+
{ name: 'Try again / Search another provider', value: 'retry' },
|
|
55
|
+
{ name: 'Do not use knowledge', value: 'skip' },
|
|
56
|
+
{ name: 'Cancel', value: 'cancel' },
|
|
57
|
+
],
|
|
58
|
+
});
|
|
59
|
+
if (failureAction === 'retry') {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (failureAction === 'skip') {
|
|
63
|
+
return {
|
|
64
|
+
config: { provider: 'none' },
|
|
65
|
+
summary: { Source: 'Do not use knowledge' },
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
throw new Error('Knowledge configuration cancelled.');
|
|
69
|
+
}
|
|
70
|
+
// Display provider summary
|
|
71
|
+
(0, knowledge_hub_1.displayKnowledgeProviderSummary)(manifest, trimmedPackId);
|
|
72
|
+
const { confirmProvider } = await inquirer_1.default.prompt({
|
|
73
|
+
type: 'list',
|
|
74
|
+
name: 'confirmProvider',
|
|
75
|
+
message: 'Use this knowledge provider?',
|
|
76
|
+
choices: [
|
|
77
|
+
{ name: 'Yes, use this provider', value: 'yes' },
|
|
78
|
+
{ name: 'Choose another provider', value: 'retry' },
|
|
79
|
+
],
|
|
80
|
+
});
|
|
81
|
+
if (confirmProvider === 'yes') {
|
|
82
|
+
return {
|
|
83
|
+
config: {
|
|
84
|
+
provider: 'e-hub',
|
|
85
|
+
registryUrl: 'https://e.vxnus.xyz/api/v1/knowledge',
|
|
86
|
+
packId: trimmedPackId,
|
|
87
|
+
},
|
|
88
|
+
summary: {
|
|
89
|
+
Source: 'E Knowledge Hub',
|
|
90
|
+
Provider: manifest.displayName || manifest.name,
|
|
91
|
+
Package: trimmedPackId,
|
|
92
|
+
Version: manifest.version,
|
|
93
|
+
},
|
|
94
|
+
metadata: {
|
|
95
|
+
manifest,
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.configureMemory = configureMemory;
|
|
7
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
8
|
+
async function configureMemory(_context) {
|
|
9
|
+
const { database } = await inquirer_1.default.prompt({
|
|
10
|
+
type: 'list',
|
|
11
|
+
name: 'database',
|
|
12
|
+
message: 'Memory database?',
|
|
13
|
+
choices: [
|
|
14
|
+
{ name: 'PostgreSQL (FTS relational claims with ACID durability)', value: 'postgres' },
|
|
15
|
+
],
|
|
16
|
+
});
|
|
17
|
+
const { deployment } = await inquirer_1.default.prompt({
|
|
18
|
+
type: 'list',
|
|
19
|
+
name: 'deployment',
|
|
20
|
+
message: 'PostgreSQL deployment target?',
|
|
21
|
+
choices: [
|
|
22
|
+
{ name: 'Supabase (Hosted Postgres with connection pooling)', value: 'supabase' },
|
|
23
|
+
{ name: 'Neon (Serverless Postgres with branch-per-companion)', value: 'neon' },
|
|
24
|
+
{ name: 'Local PostgreSQL (Docker or system service)', value: 'local' },
|
|
25
|
+
{ name: 'Other PostgreSQL URL', value: 'other' },
|
|
26
|
+
],
|
|
27
|
+
});
|
|
28
|
+
const deploymentDisplayNames = {
|
|
29
|
+
supabase: 'Supabase',
|
|
30
|
+
neon: 'Neon',
|
|
31
|
+
local: 'Local PostgreSQL',
|
|
32
|
+
other: 'Other PostgreSQL',
|
|
33
|
+
};
|
|
34
|
+
return {
|
|
35
|
+
config: {
|
|
36
|
+
provider: database,
|
|
37
|
+
deployment,
|
|
38
|
+
},
|
|
39
|
+
summary: {
|
|
40
|
+
Database: 'PostgreSQL',
|
|
41
|
+
Deploy: deploymentDisplayNames[deployment] || deployment,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configureObservation = configureObservation;
|
|
4
|
+
async function configureObservation(_context) {
|
|
5
|
+
return {
|
|
6
|
+
config: {},
|
|
7
|
+
summary: {
|
|
8
|
+
Provider: 'Grounded Observation Ingest',
|
|
9
|
+
Deduplication: 'Cryptographic SHA-256 Hashing',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OrganManifest } from '../manifest';
|
|
2
|
+
export interface OrganConfigurationResult {
|
|
3
|
+
config: Record<string, unknown>;
|
|
4
|
+
summary?: Record<string, unknown>;
|
|
5
|
+
metadata?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export interface OrganConfiguratorContext {
|
|
8
|
+
companionName: string;
|
|
9
|
+
manifest: OrganManifest;
|
|
10
|
+
existingConfig?: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
export type OrganConfigurator = (context: OrganConfiguratorContext) => Promise<OrganConfigurationResult>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.configureVision = configureVision;
|
|
7
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
8
|
+
async function configureVision(_context) {
|
|
9
|
+
const { model } = await inquirer_1.default.prompt({
|
|
10
|
+
type: 'list',
|
|
11
|
+
name: 'model',
|
|
12
|
+
message: 'Vision model:',
|
|
13
|
+
choices: [
|
|
14
|
+
{ name: 'GPT-4 Vision / GPT-4o (Multimodal OCR & Object Inspection)', value: 'gpt-4-vision' },
|
|
15
|
+
{ name: 'Claude 3.5 Sonnet Vision', value: 'anthropic/claude-3.5-sonnet' },
|
|
16
|
+
{ name: 'Custom Vision Model', value: 'custom' },
|
|
17
|
+
],
|
|
18
|
+
});
|
|
19
|
+
let selectedModel = model;
|
|
20
|
+
if (model === 'custom') {
|
|
21
|
+
const { customModel } = await inquirer_1.default.prompt({
|
|
22
|
+
type: 'input',
|
|
23
|
+
name: 'customModel',
|
|
24
|
+
message: 'Vision Model ID:',
|
|
25
|
+
default: 'gpt-4-vision',
|
|
26
|
+
});
|
|
27
|
+
selectedModel = customModel.trim();
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
config: {
|
|
31
|
+
provider: 'openrouter',
|
|
32
|
+
model: selectedModel,
|
|
33
|
+
},
|
|
34
|
+
summary: {
|
|
35
|
+
Provider: 'OpenRouter Vision',
|
|
36
|
+
Model: selectedModel,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.configureVoice = configureVoice;
|
|
7
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
8
|
+
async function configureVoice(_context) {
|
|
9
|
+
const { provider } = await inquirer_1.default.prompt({
|
|
10
|
+
type: 'list',
|
|
11
|
+
name: 'provider',
|
|
12
|
+
message: 'Voice provider?',
|
|
13
|
+
choices: [
|
|
14
|
+
{ name: 'VOICEVOX (Local high-fidelity neural speech synthesis engine)', value: 'voicevox' },
|
|
15
|
+
{ name: 'None (Disable voice synthesis)', value: 'none' },
|
|
16
|
+
],
|
|
17
|
+
});
|
|
18
|
+
if (provider === 'none') {
|
|
19
|
+
return {
|
|
20
|
+
config: { provider: 'none' },
|
|
21
|
+
summary: { Provider: 'None (Voice disabled)' },
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const answers = await inquirer_1.default.prompt([
|
|
25
|
+
{
|
|
26
|
+
type: 'input',
|
|
27
|
+
name: 'baseUrl',
|
|
28
|
+
message: 'VOICEVOX Engine Base URL:',
|
|
29
|
+
default: 'http://localhost:50021',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
type: 'input',
|
|
33
|
+
name: 'speakerId',
|
|
34
|
+
message: 'Default Speaker ID (e.g. 1 for Zundamon, 2 for Shikoku Metan):',
|
|
35
|
+
default: '1',
|
|
36
|
+
validate: (v) => !isNaN(parseInt(v, 10)) || 'Speaker ID must be an integer.',
|
|
37
|
+
},
|
|
38
|
+
]);
|
|
39
|
+
const speakerId = parseInt(answers.speakerId, 10) || 1;
|
|
40
|
+
return {
|
|
41
|
+
config: {
|
|
42
|
+
provider: 'voicevox',
|
|
43
|
+
baseUrl: answers.baseUrl.trim(),
|
|
44
|
+
speakerId,
|
|
45
|
+
maxQueueDepth: 50,
|
|
46
|
+
},
|
|
47
|
+
summary: {
|
|
48
|
+
Provider: 'VOICEVOX',
|
|
49
|
+
'Speaker ID': speakerId,
|
|
50
|
+
'Base URL': answers.baseUrl.trim(),
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|