oomi-ai 0.2.50 → 0.3.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 +203 -507
- package/agent_instructions.md +244 -253
- package/bin/oomi-ai.js +4026 -5795
- package/bin/sessionBridgeState.js +78 -78
- package/lib/openclawPaths.js +70 -71
- package/lib/openclawProfile.js +216 -216
- package/lib/personaApiClient.js +133 -303
- package/lib/spokenMetadata.js +137 -137
- package/openclaw.extension.js +341 -341
- package/openclaw.plugin.json +17 -17
- package/package.json +59 -59
- package/persona-app/README.md +27 -0
- package/persona-app/registry/v1.json +63 -0
- package/persona-app/schema/persona-app.v1.schema.json +90 -0
- package/skills/oomi/SKILL.md +165 -182
- package/skills/oomi/agent_instructions.md +99 -80
- package/lib/channelPluginClient.js +0 -119
- package/lib/openclawDevGateway.js +0 -384
- package/lib/personaJobExecutor.js +0 -139
- package/lib/personaJobPoller.js +0 -112
- package/lib/personaPortAllocator.js +0 -36
- package/lib/personaRuntimeManager.js +0 -496
- package/lib/personaRuntimeProcess.js +0 -924
- package/lib/personaRuntimeRegistry.js +0 -67
- package/lib/personaRuntimeSupervisor.js +0 -330
- package/lib/scaffold.js +0 -108
- package/lib/template.js +0 -45
- package/skills/oomi/config.json +0 -3
- package/skills/oomi/scripts/get_avatar_capabilities.py +0 -40
- package/skills/oomi/scripts/get_data.py +0 -49
- package/skills/oomi/scripts/install_agent_instructions.py +0 -78
- package/skills/oomi/scripts/send_goal.py +0 -53
- package/skills/oomi/scripts/sync.py +0 -46
- package/skills/oomi/setup.py +0 -41
- package/templates/persona-app/.env.example +0 -8
- package/templates/persona-app/README.md +0 -58
- package/templates/persona-app/eslint.config.js +0 -28
- package/templates/persona-app/index.html +0 -18
- package/templates/persona-app/oomi.runtime.json +0 -13
- package/templates/persona-app/package.json +0 -44
- package/templates/persona-app/persona/brief.md +0 -14
- package/templates/persona-app/persona.json +0 -14
- package/templates/persona-app/public/manifest.webmanifest +0 -8
- package/templates/persona-app/public/oomi.health.json +0 -6
- package/templates/persona-app/src/App.css +0 -379
- package/templates/persona-app/src/App.tsx +0 -17
- package/templates/persona-app/src/index.css +0 -53
- package/templates/persona-app/src/main.tsx +0 -23
- package/templates/persona-app/src/pages/HomePage.tsx +0 -127
- package/templates/persona-app/src/pages/ScenePage.tsx +0 -158
- package/templates/persona-app/src/persona/config.ts +0 -6
- package/templates/persona-app/src/persona/notes.ts +0 -10
- package/templates/persona-app/src/spatial.ts +0 -82
- package/templates/persona-app/src/vite-env.d.ts +0 -3
- package/templates/persona-app/template.json +0 -13
- package/templates/persona-app/tsconfig.app.json +0 -23
- package/templates/persona-app/tsconfig.json +0 -7
- package/templates/persona-app/tsconfig.node.json +0 -21
- package/templates/persona-app/vendor/webspatial/FORK.md +0 -6
- package/templates/persona-app/vendor/webspatial/core-sdk/LICENSE +0 -21
- package/templates/persona-app/vendor/webspatial/core-sdk/dist/iife/index.d.ts +0 -906
- package/templates/persona-app/vendor/webspatial/core-sdk/dist/iife/index.global.js +0 -75
- package/templates/persona-app/vendor/webspatial/core-sdk/dist/iife/index.global.js.map +0 -1
- package/templates/persona-app/vendor/webspatial/core-sdk/dist/index.d.ts +0 -906
- package/templates/persona-app/vendor/webspatial/core-sdk/dist/index.js +0 -3131
- package/templates/persona-app/vendor/webspatial/core-sdk/dist/index.js.map +0 -1
- package/templates/persona-app/vendor/webspatial/core-sdk/package.json +0 -45
- package/templates/persona-app/vendor/webspatial/react-sdk/LICENSE +0 -21
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/default/index.d.ts +0 -365
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/default/index.js +0 -4167
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/default/index.js.map +0 -1
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/jsx/jsx-dev-runtime.d.ts +0 -82
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/jsx/jsx-dev-runtime.js +0 -66
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/jsx/jsx-dev-runtime.js.map +0 -1
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/jsx/jsx-dev-runtime.web.d.ts +0 -2
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/jsx/jsx-dev-runtime.web.js +0 -18
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/jsx/jsx-dev-runtime.web.js.map +0 -1
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/jsx/jsx-runtime.d.ts +0 -5
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/jsx/jsx-runtime.js +0 -66
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/jsx/jsx-runtime.js.map +0 -1
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/jsx/jsx-runtime.web.d.ts +0 -1
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/jsx/jsx-runtime.web.js +0 -18
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/jsx/jsx-runtime.web.js.map +0 -1
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/web/index.d.ts +0 -365
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/web/index.js +0 -4207
- package/templates/persona-app/vendor/webspatial/react-sdk/dist/web/index.js.map +0 -1
- package/templates/persona-app/vendor/webspatial/react-sdk/package.json +0 -94
- package/templates/persona-app/vite.config.ts +0 -31
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
const WS_CONNECTING = 0;
|
|
2
|
-
const WS_OPEN = 1;
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Ensure session state exists so client frames can be buffered before client.open arrives.
|
|
6
|
-
*/
|
|
7
|
-
export function ensureSessionBridge({ sessions, sessionId, createSocket }) {
|
|
8
|
-
const id = String(sessionId || '').trim();
|
|
9
|
-
if (!id) return null;
|
|
10
|
-
|
|
11
|
-
const existing = sessions.get(id);
|
|
12
|
-
if (existing) return existing;
|
|
13
|
-
|
|
14
|
-
const socket = createSocket(id);
|
|
15
|
-
const next = {
|
|
16
|
-
socket,
|
|
17
|
-
queue: [],
|
|
18
|
-
connectAccepted: false,
|
|
19
|
-
waitingForConnect: [],
|
|
20
|
-
};
|
|
21
|
-
sessions.set(id, next);
|
|
22
|
-
return next;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Forward a frame to the gateway socket or queue it while connecting.
|
|
27
|
-
*/
|
|
28
|
-
export function forwardFrameToSession(sessionBridge, frameText, options = {}) {
|
|
29
|
-
if (!sessionBridge || !sessionBridge.socket || typeof frameText !== 'string' || !frameText) {
|
|
30
|
-
return 'dropped';
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (options.requiresConnectAccepted === true && sessionBridge.connectAccepted !== true) {
|
|
34
|
-
if (!Array.isArray(sessionBridge.waitingForConnect)) {
|
|
35
|
-
sessionBridge.waitingForConnect = [];
|
|
36
|
-
}
|
|
37
|
-
sessionBridge.waitingForConnect.push(frameText);
|
|
38
|
-
return 'waiting_for_connect';
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const { socket } = sessionBridge;
|
|
42
|
-
if (socket.readyState === WS_OPEN) {
|
|
43
|
-
socket.send(frameText);
|
|
44
|
-
return 'sent';
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (socket.readyState === WS_CONNECTING) {
|
|
48
|
-
sessionBridge.queue.push(frameText);
|
|
49
|
-
return 'queued';
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return 'dropped';
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function flushWaitingForConnect(sessionBridge) {
|
|
56
|
-
if (!sessionBridge) return [];
|
|
57
|
-
|
|
58
|
-
sessionBridge.connectAccepted = true;
|
|
59
|
-
const pending = Array.isArray(sessionBridge.waitingForConnect)
|
|
60
|
-
? sessionBridge.waitingForConnect.splice(0, sessionBridge.waitingForConnect.length)
|
|
61
|
-
: [];
|
|
62
|
-
|
|
63
|
-
return pending.map((frameText) => ({
|
|
64
|
-
frameText,
|
|
65
|
-
result: forwardFrameToSession(sessionBridge, frameText),
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function flushSessionQueue(sessionBridge) {
|
|
70
|
-
if (!sessionBridge || !sessionBridge.socket) return;
|
|
71
|
-
const socket = sessionBridge.socket;
|
|
72
|
-
while (sessionBridge.queue.length > 0 && socket.readyState === WS_OPEN) {
|
|
73
|
-
const nextFrame = sessionBridge.queue.shift();
|
|
74
|
-
if (typeof nextFrame === 'string' && nextFrame) {
|
|
75
|
-
socket.send(nextFrame);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
1
|
+
const WS_CONNECTING = 0;
|
|
2
|
+
const WS_OPEN = 1;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Ensure session state exists so client frames can be buffered before client.open arrives.
|
|
6
|
+
*/
|
|
7
|
+
export function ensureSessionBridge({ sessions, sessionId, createSocket }) {
|
|
8
|
+
const id = String(sessionId || '').trim();
|
|
9
|
+
if (!id) return null;
|
|
10
|
+
|
|
11
|
+
const existing = sessions.get(id);
|
|
12
|
+
if (existing) return existing;
|
|
13
|
+
|
|
14
|
+
const socket = createSocket(id);
|
|
15
|
+
const next = {
|
|
16
|
+
socket,
|
|
17
|
+
queue: [],
|
|
18
|
+
connectAccepted: false,
|
|
19
|
+
waitingForConnect: [],
|
|
20
|
+
};
|
|
21
|
+
sessions.set(id, next);
|
|
22
|
+
return next;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Forward a frame to the gateway socket or queue it while connecting.
|
|
27
|
+
*/
|
|
28
|
+
export function forwardFrameToSession(sessionBridge, frameText, options = {}) {
|
|
29
|
+
if (!sessionBridge || !sessionBridge.socket || typeof frameText !== 'string' || !frameText) {
|
|
30
|
+
return 'dropped';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (options.requiresConnectAccepted === true && sessionBridge.connectAccepted !== true) {
|
|
34
|
+
if (!Array.isArray(sessionBridge.waitingForConnect)) {
|
|
35
|
+
sessionBridge.waitingForConnect = [];
|
|
36
|
+
}
|
|
37
|
+
sessionBridge.waitingForConnect.push(frameText);
|
|
38
|
+
return 'waiting_for_connect';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const { socket } = sessionBridge;
|
|
42
|
+
if (socket.readyState === WS_OPEN) {
|
|
43
|
+
socket.send(frameText);
|
|
44
|
+
return 'sent';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (socket.readyState === WS_CONNECTING) {
|
|
48
|
+
sessionBridge.queue.push(frameText);
|
|
49
|
+
return 'queued';
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return 'dropped';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function flushWaitingForConnect(sessionBridge) {
|
|
56
|
+
if (!sessionBridge) return [];
|
|
57
|
+
|
|
58
|
+
sessionBridge.connectAccepted = true;
|
|
59
|
+
const pending = Array.isArray(sessionBridge.waitingForConnect)
|
|
60
|
+
? sessionBridge.waitingForConnect.splice(0, sessionBridge.waitingForConnect.length)
|
|
61
|
+
: [];
|
|
62
|
+
|
|
63
|
+
return pending.map((frameText) => ({
|
|
64
|
+
frameText,
|
|
65
|
+
result: forwardFrameToSession(sessionBridge, frameText),
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function flushSessionQueue(sessionBridge) {
|
|
70
|
+
if (!sessionBridge || !sessionBridge.socket) return;
|
|
71
|
+
const socket = sessionBridge.socket;
|
|
72
|
+
while (sessionBridge.queue.length > 0 && socket.readyState === WS_OPEN) {
|
|
73
|
+
const nextFrame = sessionBridge.queue.shift();
|
|
74
|
+
if (typeof nextFrame === 'string' && nextFrame) {
|
|
75
|
+
socket.send(nextFrame);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
package/lib/openclawPaths.js
CHANGED
|
@@ -1,87 +1,86 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import os from 'node:os';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
|
|
5
|
-
function trimString(value) {
|
|
6
|
-
return typeof value === 'string' ? value.trim() : '';
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
function trimString(value) {
|
|
6
|
+
return typeof value === 'string' ? value.trim() : '';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function isWindowsAbsolutePath(value) {
|
|
10
|
+
return /^[A-Za-z]:[\\/]/.test(value) || /^\\\\[^\\]+\\[^\\]+/.test(value);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function resolveConfiguredPath(value) {
|
|
14
|
+
if (process.platform !== 'win32' && isWindowsAbsolutePath(value)) {
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return path.resolve(value);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function resolveOpenclawHome() {
|
|
22
|
+
const explicitHome = trimString(process.env.OPENCLAW_HOME);
|
|
23
|
+
if (explicitHome) {
|
|
24
|
+
return resolveConfiguredPath(explicitHome);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return path.join(os.homedir(), '.openclaw');
|
|
28
|
+
}
|
|
29
|
+
|
|
18
30
|
export function resolveOpenclawWorkspaceRoot() {
|
|
19
31
|
const explicitWorkspace = trimString(process.env.OPENCLAW_WORKSPACE);
|
|
20
32
|
if (explicitWorkspace) {
|
|
21
|
-
return
|
|
33
|
+
return resolveConfiguredPath(explicitWorkspace);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const openclawHome = resolveOpenclawHome();
|
|
37
|
+
const managedWorkspace = path.join(openclawHome, 'workspace');
|
|
38
|
+
if (fs.existsSync(managedWorkspace)) {
|
|
39
|
+
return managedWorkspace;
|
|
22
40
|
}
|
|
23
|
-
|
|
24
|
-
const openclawHome = resolveOpenclawHome();
|
|
25
|
-
const managedWorkspace = path.join(openclawHome, 'workspace');
|
|
26
|
-
if (fs.existsSync(managedWorkspace)) {
|
|
27
|
-
return managedWorkspace;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return openclawHome;
|
|
31
|
-
}
|
|
32
41
|
|
|
33
|
-
|
|
34
|
-
return resolveOpenclawPath('personas');
|
|
42
|
+
return openclawHome;
|
|
35
43
|
}
|
|
36
44
|
|
|
37
45
|
export function resolveOpenclawPath(...parts) {
|
|
38
46
|
return path.join(resolveOpenclawHome(), ...parts);
|
|
39
47
|
}
|
|
40
|
-
|
|
41
|
-
export function resolveOpenclawConfigCandidates() {
|
|
42
|
-
return [
|
|
43
|
-
resolveOpenclawPath('
|
|
44
|
-
resolveOpenclawPath('
|
|
45
|
-
];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
+
|
|
49
|
+
export function resolveOpenclawConfigCandidates() {
|
|
50
|
+
return [
|
|
51
|
+
resolveOpenclawPath('openclaw.json'),
|
|
52
|
+
resolveOpenclawPath('clawdbot.json'),
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
|
|
48
56
|
export function resolveOpenclawSkillsDir() {
|
|
49
57
|
return resolveOpenclawPath('skills');
|
|
50
58
|
}
|
|
51
59
|
|
|
52
|
-
export function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
export function resolveOpenclawIdentityPath() {
|
|
61
|
+
return resolveOpenclawPath('identity', 'device.json');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function resolveOpenclawUpdateStatePath() {
|
|
65
|
+
return resolveOpenclawPath('oomi-ai-update-check.json');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function resolveOpenclawBridgeStatePath() {
|
|
69
|
+
return resolveOpenclawPath('oomi-bridge.json');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function resolveOpenclawBridgeStatusPath() {
|
|
73
|
+
return resolveOpenclawPath('oomi-bridge-status.json');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function resolveOpenclawBridgeLockPath() {
|
|
77
|
+
return resolveOpenclawPath('oomi-bridge.lock');
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function resolveOpenclawBridgeLiveLogPath() {
|
|
81
|
+
return resolveOpenclawPath('logs', 'oomi-bridge-live.log');
|
|
82
|
+
}
|
|
57
83
|
|
|
58
|
-
|
|
84
|
+
export function resolveOpenclawProfilePath(fileName = 'oomi-openclaw-profile.json') {
|
|
85
|
+
return resolveOpenclawPath(fileName);
|
|
59
86
|
}
|
|
60
|
-
|
|
61
|
-
export function resolveOpenclawIdentityPath() {
|
|
62
|
-
return resolveOpenclawPath('identity', 'device.json');
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function resolveOpenclawUpdateStatePath() {
|
|
66
|
-
return resolveOpenclawPath('oomi-ai-update-check.json');
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function resolveOpenclawBridgeStatePath() {
|
|
70
|
-
return resolveOpenclawPath('oomi-bridge.json');
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export function resolveOpenclawBridgeStatusPath() {
|
|
74
|
-
return resolveOpenclawPath('oomi-bridge-status.json');
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export function resolveOpenclawBridgeLockPath() {
|
|
78
|
-
return resolveOpenclawPath('oomi-bridge.lock');
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export function resolveOpenclawBridgeLiveLogPath() {
|
|
82
|
-
return resolveOpenclawPath('logs', 'oomi-bridge-live.log');
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export function resolveOpenclawProfilePath(fileName = 'oomi-openclaw-profile.json') {
|
|
86
|
-
return resolveOpenclawPath(fileName);
|
|
87
|
-
}
|