mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
Update skill runtime to use QuickJS and enhance TODO list
- Updated the skill runtime documentation to reflect the transition from V8 to the Rust QuickJS runtime engine. - Modified the SkillManifest interface to specify "quickjs" as the only runtime option. - Enhanced the SkillProvider to discover skills using the QuickJS runtime and added filtering for production builds. - Expanded the TODO list with new tasks for Android version release, background processes, AI message summarization, and remaining skills implementation.
This commit is contained in:
@@ -7,3 +7,8 @@ todo
|
||||
|
||||
- integrate the payments flow properly
|
||||
skip the connect account page and goto the home page
|
||||
|
||||
[] - get android version out
|
||||
[] - get background proceeses done
|
||||
[] - get ai to summarize messages in the device and upload to the cloud
|
||||
[] - get all the remaining skills working
|
||||
|
||||
+1
-1
Submodule skills updated: 21f64b6049...0a4f7ca3d2
@@ -2,7 +2,7 @@
|
||||
* Skill runtime — higher-level wrapper around SkillTransport
|
||||
* for managing a single skill's lifecycle.
|
||||
*
|
||||
* With V8, skills are managed by the Rust runtime engine.
|
||||
* Skills are managed by the Rust QuickJS runtime engine.
|
||||
* This class wraps the transport layer to provide the same API
|
||||
* that the SkillManager expects.
|
||||
*/
|
||||
@@ -29,7 +29,7 @@ export class SkillRuntime {
|
||||
|
||||
/**
|
||||
* Set a handler for reverse RPC calls from the skill process.
|
||||
* With V8, reverse RPC is handled by bridge globals, so this
|
||||
* Reverse RPC is handled by bridge globals, so this
|
||||
* is kept for API compatibility.
|
||||
*/
|
||||
onReverseRpc(handler: ReverseRpcHandler): void {
|
||||
@@ -38,12 +38,12 @@ export class SkillRuntime {
|
||||
|
||||
|
||||
/**
|
||||
* Start the skill in the V8 runtime engine.
|
||||
* Start the skill in the QuickJS runtime engine.
|
||||
* The Rust engine handles process management, so we just tell it to start
|
||||
* and then initialize the transport for RPC routing.
|
||||
*/
|
||||
async start(): Promise<void> {
|
||||
// Start the skill in the Rust V8 runtime
|
||||
// Start the skill in the Rust QuickJS runtime
|
||||
await invoke("runtime_start_skill", { skillId: this.manifest.id });
|
||||
|
||||
// Initialize the transport for RPC routing
|
||||
|
||||
@@ -14,7 +14,7 @@ export interface SkillManifest {
|
||||
name: string;
|
||||
version: string;
|
||||
description: string;
|
||||
runtime: "python" | "node" | "deno" | "v8";
|
||||
runtime: "quickjs";
|
||||
entry?: string;
|
||||
tick_interval?: number;
|
||||
env?: string[];
|
||||
@@ -26,6 +26,8 @@ export interface SkillManifest {
|
||||
/** Platform filter. When present, only listed platforms load this skill.
|
||||
* When absent or empty, the skill is available on all platforms. */
|
||||
platforms?: SkillPlatform[];
|
||||
/** When true, skill is hidden in production builds. */
|
||||
ignoreInProduction?: boolean;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
/**
|
||||
* Skill Provider — discovers and manages skill lifecycles.
|
||||
*
|
||||
* On mount (when authenticated): discovers skills from the V8 runtime
|
||||
* On mount (when authenticated): discovers skills from the QuickJS runtime
|
||||
* engine, registers them in Redux, and auto-starts skills with completed setup.
|
||||
*
|
||||
* The Rust V8 engine handles skill discovery and auto-start independently.
|
||||
* This provider bridges the Rust engine state with the frontend Redux store.
|
||||
*/
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import { type ReactNode, useEffect, useRef } from 'react';
|
||||
@@ -13,7 +10,7 @@ import { type ReactNode, useEffect, useRef } from 'react';
|
||||
import { skillManager } from '../lib/skills/manager';
|
||||
import type { SkillManifest } from '../lib/skills/types';
|
||||
import { useAppSelector } from '../store/hooks';
|
||||
import { DEV_AUTO_LOAD_SKILL } from '../utils/config';
|
||||
import { DEV_AUTO_LOAD_SKILL, IS_DEV } from '../utils/config';
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Helpers
|
||||
@@ -21,14 +18,15 @@ import { DEV_AUTO_LOAD_SKILL } from '../utils/config';
|
||||
|
||||
async function discoverSkills(): Promise<SkillManifest[]> {
|
||||
const raw = await invoke<Array<Record<string, unknown>>>('runtime_discover_skills');
|
||||
// Map the V8 manifest format to SkillManifest
|
||||
return raw.map(m => ({
|
||||
|
||||
const manifests: SkillManifest[] = raw.map(m => ({
|
||||
id: m.id as string,
|
||||
name: m.name as string,
|
||||
version: (m.version as string) || '0.0.0',
|
||||
description: (m.description as string) || '',
|
||||
runtime: 'v8' as const,
|
||||
runtime: 'quickjs' as const,
|
||||
entry: m.entry as string | undefined,
|
||||
ignoreInProduction: (m.ignoreInProduction as boolean) ?? false,
|
||||
setup: m.setup
|
||||
? {
|
||||
required: ((m.setup as Record<string, unknown>).required as boolean) ?? false,
|
||||
@@ -36,6 +34,13 @@ async function discoverSkills(): Promise<SkillManifest[]> {
|
||||
}
|
||||
: undefined,
|
||||
}));
|
||||
|
||||
// In production, filter out skills marked as dev-only
|
||||
if (!IS_DEV) {
|
||||
return manifests.filter(m => !m.ignoreInProduction);
|
||||
}
|
||||
|
||||
return manifests;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -89,7 +94,7 @@ export default function SkillProvider({ children }: { children: ReactNode }) {
|
||||
|
||||
const init = async () => {
|
||||
try {
|
||||
// Discover skills from the V8 runtime engine
|
||||
// Discover skills from the QuickJS runtime engine
|
||||
const manifests = await discoverSkills();
|
||||
await registerAndStart(manifests);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user