From 694dcfe3ccf11ca5ab15cdcda8bc989eb7d40536 Mon Sep 17 00:00:00 2001 From: Mega Mind <146339422+M3gA-Mind@users.noreply.github.com> Date: Thu, 26 Feb 2026 21:28:21 +0530 Subject: [PATCH] Feat/openclaw work - #131 (#151) * feat: add initial project structure and documentation - Introduced the GNU General Public License (GPL) v3 in LICENSE file. - Added MCP configuration in .claude/mcp.json for server integration. - Created architecture documentation in docs/ARCHITECTURE.md outlining the platform's design and components. - Defined MVP specifications in docs/MVP.md for the Telegram-based Agent Assistant. - Established API reference for team management in docs/teams-api-reference.md. - Set up basic HTML structure in public/index.html and added logo image in public/logo.png. * feat: add initial project documentation and HTML structure - Introduced CODE_OF_CONDUCT.md to establish community guidelines and standards for behavior. - Created CONTRIBUTING.md to outline contribution process, development setup, and project conventions. - Added SECURITY.md to define the security policy, supported versions, and reporting procedures for vulnerabilities. - Established basic HTML structure in index.html for the application interface. * chore: remove hello-python skill files - Deleted skill.json and skill.py files for the Hello Python example runtime skill, as they are no longer needed in the project. * feat: port tinyhuman agent runtime from ZeroClaw into Tauri backend Port daemon supervisor, health registry, security (policy, secrets, audit, pairing), agent traits, and config modules from ZeroClaw (MIT) into a new tinyhuman/ module under src-tauri/src/. The daemon auto-starts on desktop and shuts down gracefully on app exit via CancellationToken. - health: global HealthRegistry with component tracking and JSON snapshots - security/policy: SecurityPolicy with command validation, risk levels, rate limiting - security/secrets: ChaCha20-Poly1305 SecretStore with legacy XOR migration - security/audit: AuditLogger with JSON-line events and log rotation - security/pairing: PairingGuard with brute-force protection and SHA-256 hashing - security/traits: Sandbox trait + NoopSandbox - config: minimal DaemonConfig with autonomy, reliability, secrets, audit sub-configs - daemon: supervisor with health state writer emitting Tauri events - agent/traits: Provider, Tool, Memory, Observer, RuntimeAdapter traits + Noop impls - commands/tinyhuman: Tauri commands for health, security policy, encrypt/decrypt - 185 inline unit tests across all modules - README updated with custom inference/tunneling/memory positioning Co-Authored-By: Claude Opus 4.6 * feat: update README to reflect AlphaHuman Mk1 branding and enhanced description - Changed project title to "AlphaHuman Mk1" for clarity. - Revised project description to emphasize user-friendly AI capabilities and the use of the Neocortex Mk1 model. - Removed outdated sections on custom inference, tunneling, and memory, streamlining the content for better readability. * update readme * Port zeroclaw runtime into tinyhuman * Replace CLI mentions with UI language * Split gateway module into smaller units * Split channels and config schema modules * Fix tinyhuman build, tests, and tunnel integration * feat(tinyhuman): add missing modules and ui-friendly services * refactor: rename tinyhuman to alphahuman * chore: remove bottom text from Welcome component * feat(settings): add tauri command console * feat(daemon): enhance daemon mode handling and integrate rustls with ring feature * feat(settings): implement comprehensive configuration management in TauriCommandsPanel * refactor(TauriCommandsPanel): streamline error handling and enhance async function usage * feat(settings): add skill management functionality to TauriCommandsPanel * style(TauriCommandsPanel): update input styles for improved readability and user experience * feat(settings): add Skills and Agent Chat panels with navigation and integration management * feat(settings): implement browser access management in SkillsPanel and enhance AgentChatPanel with local storage functionality * Implement inference API integration in Conversations component - Added inference API service to handle chat completions and model management. - Updated Conversations component to fetch available models on mount and allow model selection. - Enhanced message sending functionality to utilize the inference API for generating responses. - Introduced state management for loading models and handling errors during API calls. - Refactored optimistic message handling and send status management for improved user experience. --------- Co-authored-by: Steven Enamakel Co-authored-by: Claude Opus 4.6 Co-authored-by: Steven Enamakel <31011319+senamakel@users.noreply.github.com> --- .../settings/panels/TauriCommandsPanel.tsx | 646 ++++++------- src/pages/Conversations.tsx | 110 ++- src/services/api/inferenceApi.ts | 99 ++ src/services/api/tunnelsApi.ts | 70 ++ src/store/threadSlice.ts | 11 + yarn.lock | 886 +++++++++++------- 6 files changed, 1150 insertions(+), 672 deletions(-) create mode 100644 src/services/api/inferenceApi.ts create mode 100644 src/services/api/tunnelsApi.ts diff --git a/src/components/settings/panels/TauriCommandsPanel.tsx b/src/components/settings/panels/TauriCommandsPanel.tsx index 48cc4a7a7..a5abc02e0 100644 --- a/src/components/settings/panels/TauriCommandsPanel.tsx +++ b/src/components/settings/panels/TauriCommandsPanel.tsx @@ -1,13 +1,13 @@ -import { useMemo, useState } from 'react'; import { + ChatBubbleLeftRightIcon, CogIcon, CpuChipIcon, - ShieldCheckIcon, - ServerIcon, - WrenchScrewdriverIcon, - ChatBubbleLeftRightIcon, DocumentTextIcon, + ServerIcon, + ShieldCheckIcon, + WrenchScrewdriverIcon, } from '@heroicons/react/24/outline'; +import { useMemo, useState } from 'react'; import SettingsHeader from '../components/SettingsHeader'; import { useSettingsNavigation } from '../hooks/useSettingsNavigation'; @@ -22,30 +22,35 @@ import { alphahumanDecryptSecret, alphahumanDoctorModels, alphahumanDoctorReport, - alphahumanGetIntegrationInfo, + alphahumanEncryptSecret, alphahumanGetConfig, + alphahumanGetIntegrationInfo, alphahumanHardwareDiscover, alphahumanHardwareIntrospect, alphahumanListIntegrations, alphahumanMigrateOpenclaw, alphahumanModelsRefresh, + alphahumanServiceInstall, + alphahumanServiceStatus, + alphahumanServiceUninstall, alphahumanUpdateGatewaySettings, alphahumanUpdateMemorySettings, alphahumanUpdateModelSettings, alphahumanUpdateRuntimeSettings, alphahumanUpdateTunnelSettings, - alphahumanServiceInstall, - alphahumanServiceStatus, - alphahumanServiceUninstall, - alphahumanEncryptSecret, isTauri, - TunnelConfig, runtimeDisableSkill, runtimeEnableSkill, runtimeIsSkillEnabled, runtimeListSkills, SkillSnapshot, + TunnelConfig, } from '../../../utils/tauriCommands'; +import SettingsHeader from '../components/SettingsHeader'; +import { useSettingsNavigation } from '../hooks/useSettingsNavigation'; +import ActionPanel, { PrimaryButton } from './components/ActionPanel'; +import InputGroup, { CheckboxField, Field } from './components/InputGroup'; +import SectionCard from './components/SectionCard'; const formatJson = (value: unknown) => JSON.stringify(value, null, 2); @@ -55,7 +60,14 @@ const TauriCommandsPanel = () => { // View mode removed - always show all sections const [expandedSections] = useState>( - new Set(['system-configuration', 'runtime-execution', 'security-data', 'network-infrastructure', 'development-operations', 'interactive-tools']) + new Set([ + 'system-configuration', + 'runtime-execution', + 'security-data', + 'network-infrastructure', + 'development-operations', + 'interactive-tools', + ]) ); // Output and error states @@ -90,9 +102,7 @@ const TauriCommandsPanel = () => { const [embeddingDims, setEmbeddingDims] = useState('1536'); const [runtimeKind, setRuntimeKind] = useState('native'); const [reasoningEnabled, setReasoningEnabled] = useState(false); - const [skills, setSkills] = useState< - Array<{ snapshot: SkillSnapshot; enabled: boolean }> - >([]); + const [skills, setSkills] = useState>([]); const [skillsLoading, setSkillsLoading] = useState(false); const [chatInput, setChatInput] = useState(''); const [chatProvider, setChatProvider] = useState(''); @@ -275,7 +285,10 @@ const TauriCommandsPanel = () => { } }; - const runWithResult = async (fn: () => Promise, operationName?: string): Promise => { + const runWithResult = async ( + fn: () => Promise, + operationName?: string + ): Promise => { setError(''); if (operationName) setOperationLoading(operationName); try { @@ -331,7 +344,9 @@ const TauriCommandsPanel = () => { setTunnelProvider((tunnel.provider as string) ?? 'none'); setCloudflareToken(((tunnel.cloudflare as Record)?.token as string) ?? ''); setNgrokToken(((tunnel.ngrok as Record)?.auth_token as string) ?? ''); - setTailscaleHostname(((tunnel.tailscale as Record)?.hostname as string) ?? ''); + setTailscaleHostname( + ((tunnel.tailscale as Record)?.hostname as string) ?? '' + ); setCustomCommand(((tunnel.custom as Record)?.start_command as string) ?? ''); const gateway = (config.gateway as Record) ?? {}; @@ -361,28 +376,16 @@ const TauriCommandsPanel = () => { const buildTunnelConfig = (): TunnelConfig => { if (tunnelProvider === 'cloudflare') { - return { - provider: 'cloudflare', - cloudflare: { token: cloudflareToken }, - }; + return { provider: 'cloudflare', cloudflare: { token: cloudflareToken } }; } if (tunnelProvider === 'ngrok') { - return { - provider: 'ngrok', - ngrok: { auth_token: ngrokToken }, - }; + return { provider: 'ngrok', ngrok: { auth_token: ngrokToken } }; } if (tunnelProvider === 'tailscale') { - return { - provider: 'tailscale', - tailscale: { hostname: tailscaleHostname || null }, - }; + return { provider: 'tailscale', tailscale: { hostname: tailscaleHostname || null } }; } if (tunnelProvider === 'custom') { - return { - provider: 'custom', - custom: { start_command: customCommand }, - }; + return { provider: 'custom', custom: { start_command: customCommand } }; } return { provider: 'none' }; }; @@ -504,37 +507,41 @@ const TauriCommandsPanel = () => { } }; - const saveTunnelSettings = () => run(() => alphahumanUpdateTunnelSettings(buildTunnelConfig()), 'saveTunnelSettings'); + const saveTunnelSettings = () => + run(() => alphahumanUpdateTunnelSettings(buildTunnelConfig()), 'saveTunnelSettings'); const saveGatewaySettings = () => - run(() => - alphahumanUpdateGatewaySettings({ - host: gatewayHost.trim() ? gatewayHost : null, - port: parseOptionalNumber(gatewayPort), - require_pairing: gatewayPairing, - allow_public_bind: gatewayPublic, - }), + run( + () => + alphahumanUpdateGatewaySettings({ + host: gatewayHost.trim() ? gatewayHost : null, + port: parseOptionalNumber(gatewayPort), + require_pairing: gatewayPairing, + allow_public_bind: gatewayPublic, + }), 'saveGatewaySettings' ); const saveMemorySettings = () => - run(() => - alphahumanUpdateMemorySettings({ - backend: memoryBackend.trim() ? memoryBackend : null, - auto_save: memoryAutoSave, - embedding_provider: embeddingProvider.trim() ? embeddingProvider : null, - embedding_model: embeddingModel.trim() ? embeddingModel : null, - embedding_dimensions: parseOptionalNumber(embeddingDims), - }), + run( + () => + alphahumanUpdateMemorySettings({ + backend: memoryBackend.trim() ? memoryBackend : null, + auto_save: memoryAutoSave, + embedding_provider: embeddingProvider.trim() ? embeddingProvider : null, + embedding_model: embeddingModel.trim() ? embeddingModel : null, + embedding_dimensions: parseOptionalNumber(embeddingDims), + }), 'saveMemorySettings' ); const saveRuntimeSettings = () => - run(() => - alphahumanUpdateRuntimeSettings({ - kind: runtimeKind.trim() ? runtimeKind : null, - reasoning_enabled: reasoningEnabled, - }), + run( + () => + alphahumanUpdateRuntimeSettings({ + kind: runtimeKind.trim() ? runtimeKind : null, + reasoning_enabled: reasoningEnabled, + }), 'saveRuntimeSettings' ); @@ -543,7 +550,7 @@ const TauriCommandsPanel = () => { try { const snapshots = await runtimeListSkills(); const enriched = await Promise.all( - snapshots.map(async (snapshot) => ({ + snapshots.map(async snapshot => ({ snapshot, enabled: await runtimeIsSkillEnabled(snapshot.skill_id), })) @@ -564,11 +571,9 @@ const TauriCommandsPanel = () => { } else { await run(() => runtimeDisableSkill(skillId), 'disableSkill'); } - setSkills((prev) => - prev.map((item) => - item.snapshot.skill_id === skillId - ? { ...item, enabled: nextEnabled } - : item + setSkills(prev => + prev.map(item => + item.snapshot.skill_id === skillId ? { ...item, enabled: nextEnabled } : item ) ); }; @@ -578,19 +583,20 @@ const TauriCommandsPanel = () => { return; } const userMessage = chatInput.trim(); - setChatLog((prev) => [...prev, { role: 'user', text: userMessage }]); + setChatLog(prev => [...prev, { role: 'user', text: userMessage }]); setChatInput(''); - const response = await runWithResult(() => - alphahumanAgentChat( - userMessage, - chatProvider.trim() ? chatProvider : undefined, - chatModel.trim() ? chatModel : undefined, - parseOptionalNumber(chatTemperature) ?? undefined - ), + const response = await runWithResult( + () => + alphahumanAgentChat( + userMessage, + chatProvider.trim() ? chatProvider : undefined, + chatModel.trim() ? chatModel : undefined, + parseOptionalNumber(chatTemperature) ?? undefined + ), 'sendChat' ); if (response) { - setChatLog((prev) => [...prev, { role: 'agent', text: response.result }]); + setChatLog(prev => [...prev, { role: 'agent', text: response.result }]); } }; @@ -616,11 +622,7 @@ const TauriCommandsPanel = () => { return (
- +
{!tauriAvailable && ( @@ -807,75 +809,64 @@ const TauriCommandsPanel = () => { collapsible={true} defaultExpanded={!isCollapsed('runtime-execution')} hasChanges={false} - loading={operationLoading === 'saveRuntimeSettings' || skillsLoading} - > - - - setRuntimeKind(event.target.value)} + loading={operationLoading === 'saveRuntimeSettings' || skillsLoading}> + + + setRuntimeKind(event.target.value)} + /> + + - - - + - - - Save Runtime Settings - - - {skillsLoading ? 'Loading Skills…' : 'Load Skills'} - - + + + Save Runtime Settings + + + {skillsLoading ? 'Loading Skills…' : 'Load Skills'} + + - {skills.length > 0 && ( -
-
Skills
-
- {skills.map((item) => ( -
-
-
{item.snapshot.name}
-
- {item.snapshot.skill_id} + {skills.length > 0 && ( +
+
Skills
+
+ {skills.map(item => ( +
+
+
{item.snapshot.name}
+
+ {item.snapshot.skill_id} +
+ toggleSkill(item.snapshot.skill_id, checked)} + className="text-xs ml-4 flex-shrink-0" + />
- - toggleSkill(item.snapshot.skill_id, checked) - } - className="text-xs ml-4 flex-shrink-0" - /> -
- ))} + ))} +
-
- )} + )}
@@ -1006,117 +997,121 @@ const TauriCommandsPanel = () => { collapsible={true} defaultExpanded={!isCollapsed('security-data')} hasChanges={false} - loading={operationLoading?.includes('Secret') || operationLoading?.includes('Models') || operationLoading?.includes('Integration')} - > -
- - -