@aquaclawai/aquarium 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/dist/agent-types/claude-code/index.d.ts +2 -0
- package/dist/agent-types/claude-code/index.d.ts.map +1 -0
- package/dist/agent-types/claude-code/index.js +2 -0
- package/dist/agent-types/claude-code/index.js.map +1 -0
- package/dist/agent-types/claude-code/manifest.d.ts +3 -0
- package/dist/agent-types/claude-code/manifest.d.ts.map +1 -0
- package/dist/agent-types/claude-code/manifest.js +45 -0
- package/dist/agent-types/claude-code/manifest.js.map +1 -0
- package/dist/agent-types/openclaw/adapter.d.ts +3 -0
- package/dist/agent-types/openclaw/adapter.d.ts.map +1 -0
- package/dist/agent-types/openclaw/adapter.js +714 -0
- package/dist/agent-types/openclaw/adapter.js.map +1 -0
- package/dist/agent-types/openclaw/gateway-rpc.d.ts +21 -0
- package/dist/agent-types/openclaw/gateway-rpc.d.ts.map +1 -0
- package/dist/agent-types/openclaw/gateway-rpc.js +202 -0
- package/dist/agent-types/openclaw/gateway-rpc.js.map +1 -0
- package/dist/agent-types/openclaw/index.d.ts +3 -0
- package/dist/agent-types/openclaw/index.d.ts.map +1 -0
- package/dist/agent-types/openclaw/index.js +3 -0
- package/dist/agent-types/openclaw/index.js.map +1 -0
- package/dist/agent-types/openclaw/manifest.d.ts +137 -0
- package/dist/agent-types/openclaw/manifest.d.ts.map +1 -0
- package/dist/agent-types/openclaw/manifest.js +191 -0
- package/dist/agent-types/openclaw/manifest.js.map +1 -0
- package/dist/agent-types/openclaw/provider-registry.d.ts +46 -0
- package/dist/agent-types/openclaw/provider-registry.d.ts.map +1 -0
- package/dist/agent-types/openclaw/provider-registry.js +108 -0
- package/dist/agent-types/openclaw/provider-registry.js.map +1 -0
- package/dist/agent-types/openclaw/reverse-adapter.d.ts +7 -0
- package/dist/agent-types/openclaw/reverse-adapter.d.ts.map +1 -0
- package/dist/agent-types/openclaw/reverse-adapter.js +528 -0
- package/dist/agent-types/openclaw/reverse-adapter.js.map +1 -0
- package/dist/agent-types/openclaw/security-profiles.d.ts +21 -0
- package/dist/agent-types/openclaw/security-profiles.d.ts.map +1 -0
- package/dist/agent-types/openclaw/security-profiles.js +251 -0
- package/dist/agent-types/openclaw/security-profiles.js.map +1 -0
- package/dist/agent-types/openclaw/workspace-templates.d.ts +2 -0
- package/dist/agent-types/openclaw/workspace-templates.d.ts.map +1 -0
- package/dist/agent-types/openclaw/workspace-templates.js +363 -0
- package/dist/agent-types/openclaw/workspace-templates.js.map +1 -0
- package/dist/agent-types/opencode/index.d.ts +2 -0
- package/dist/agent-types/opencode/index.d.ts.map +1 -0
- package/dist/agent-types/opencode/index.js +2 -0
- package/dist/agent-types/opencode/index.js.map +1 -0
- package/dist/agent-types/opencode/manifest.d.ts +3 -0
- package/dist/agent-types/opencode/manifest.d.ts.map +1 -0
- package/dist/agent-types/opencode/manifest.js +63 -0
- package/dist/agent-types/opencode/manifest.js.map +1 -0
- package/dist/agent-types/registry.d.ts +4 -0
- package/dist/agent-types/registry.d.ts.map +1 -0
- package/dist/agent-types/registry.js +24 -0
- package/dist/agent-types/registry.js.map +1 -0
- package/dist/agent-types/types.d.ts +169 -0
- package/dist/agent-types/types.d.ts.map +1 -0
- package/dist/agent-types/types.js +2 -0
- package/dist/agent-types/types.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +72 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +68 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +98 -0
- package/dist/config.js.map +1 -0
- package/dist/db/adapter.d.ts +21 -0
- package/dist/db/adapter.d.ts.map +1 -0
- package/dist/db/adapter.js +11 -0
- package/dist/db/adapter.js.map +1 -0
- package/dist/db/index.d.ts +4 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +5 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/knexfile.d.ts +5 -0
- package/dist/db/knexfile.d.ts.map +1 -0
- package/dist/db/knexfile.js +34 -0
- package/dist/db/knexfile.js.map +1 -0
- package/dist/db/migration-helpers.d.ts +45 -0
- package/dist/db/migration-helpers.d.ts.map +1 -0
- package/dist/db/migration-helpers.js +90 -0
- package/dist/db/migration-helpers.js.map +1 -0
- package/dist/db/migrations/001_initial.d.ts +4 -0
- package/dist/db/migrations/001_initial.d.ts.map +1 -0
- package/dist/db/migrations/001_initial.js +56 -0
- package/dist/db/migrations/001_initial.js.map +1 -0
- package/dist/db/migrations/002_instance_config.d.ts +4 -0
- package/dist/db/migrations/002_instance_config.d.ts.map +1 -0
- package/dist/db/migrations/002_instance_config.js +12 -0
- package/dist/db/migrations/002_instance_config.js.map +1 -0
- package/dist/db/migrations/003_instance_status_message.d.ts +4 -0
- package/dist/db/migrations/003_instance_status_message.d.ts.map +1 -0
- package/dist/db/migrations/003_instance_status_message.js +11 -0
- package/dist/db/migrations/003_instance_status_message.js.map +1 -0
- package/dist/db/migrations/004_templates.d.ts +4 -0
- package/dist/db/migrations/004_templates.d.ts.map +1 -0
- package/dist/db/migrations/004_templates.js +95 -0
- package/dist/db/migrations/004_templates.js.map +1 -0
- package/dist/db/migrations/005_group_chats.d.ts +4 -0
- package/dist/db/migrations/005_group_chats.d.ts.map +1 -0
- package/dist/db/migrations/005_group_chats.js +66 -0
- package/dist/db/migrations/005_group_chats.js.map +1 -0
- package/dist/db/migrations/006_template_setup.d.ts +4 -0
- package/dist/db/migrations/006_template_setup.d.ts.map +1 -0
- package/dist/db/migrations/006_template_setup.js +14 -0
- package/dist/db/migrations/006_template_setup.js.map +1 -0
- package/dist/db/migrations/007_group_chat_v2.d.ts +4 -0
- package/dist/db/migrations/007_group_chat_v2.d.ts.map +1 -0
- package/dist/db/migrations/007_group_chat_v2.js +59 -0
- package/dist/db/migrations/007_group_chat_v2.js.map +1 -0
- package/dist/db/migrations/008_default_provider_openrouter.d.ts +4 -0
- package/dist/db/migrations/008_default_provider_openrouter.d.ts.map +1 -0
- package/dist/db/migrations/008_default_provider_openrouter.js +33 -0
- package/dist/db/migrations/008_default_provider_openrouter.js.map +1 -0
- package/dist/db/migrations/009_opencode_default_provider_openrouter.d.ts +4 -0
- package/dist/db/migrations/009_opencode_default_provider_openrouter.d.ts.map +1 -0
- package/dist/db/migrations/009_opencode_default_provider_openrouter.js +33 -0
- package/dist/db/migrations/009_opencode_default_provider_openrouter.js.map +1 -0
- package/dist/db/migrations/010_fix_null_default_provider.d.ts +4 -0
- package/dist/db/migrations/010_fix_null_default_provider.d.ts.map +1 -0
- package/dist/db/migrations/010_fix_null_default_provider.js +24 -0
- package/dist/db/migrations/010_fix_null_default_provider.js.map +1 -0
- package/dist/db/migrations/011_snapshots.d.ts +4 -0
- package/dist/db/migrations/011_snapshots.d.ts.map +1 -0
- package/dist/db/migrations/011_snapshots.js +27 -0
- package/dist/db/migrations/011_snapshots.js.map +1 -0
- package/dist/db/migrations/013_official_templates.d.ts +4 -0
- package/dist/db/migrations/013_official_templates.d.ts.map +1 -0
- package/dist/db/migrations/013_official_templates.js +173 -0
- package/dist/db/migrations/013_official_templates.js.map +1 -0
- package/dist/db/migrations/014_notifications.d.ts +4 -0
- package/dist/db/migrations/014_notifications.d.ts.map +1 -0
- package/dist/db/migrations/014_notifications.js +45 -0
- package/dist/db/migrations/014_notifications.js.map +1 -0
- package/dist/db/migrations/015_security_profile.d.ts +4 -0
- package/dist/db/migrations/015_security_profile.d.ts.map +1 -0
- package/dist/db/migrations/015_security_profile.js +14 -0
- package/dist/db/migrations/015_security_profile.js.map +1 -0
- package/dist/db/migrations/016_template_security.d.ts +4 -0
- package/dist/db/migrations/016_template_security.d.ts.map +1 -0
- package/dist/db/migrations/016_template_security.js +12 -0
- package/dist/db/migrations/016_template_security.js.map +1 -0
- package/dist/db/migrations/017_auth_events.d.ts +4 -0
- package/dist/db/migrations/017_auth_events.d.ts.map +1 -0
- package/dist/db/migrations/017_auth_events.js +19 -0
- package/dist/db/migrations/017_auth_events.js.map +1 -0
- package/dist/db/migrations/018_skill_market.d.ts +4 -0
- package/dist/db/migrations/018_skill_market.d.ts.map +1 -0
- package/dist/db/migrations/018_skill_market.js +21 -0
- package/dist/db/migrations/018_skill_market.js.map +1 -0
- package/dist/db/migrations/019_credential_audit_log.d.ts +4 -0
- package/dist/db/migrations/019_credential_audit_log.d.ts.map +1 -0
- package/dist/db/migrations/019_credential_audit_log.js +19 -0
- package/dist/db/migrations/019_credential_audit_log.js.map +1 -0
- package/dist/db/migrations/020_template_security_score.d.ts +4 -0
- package/dist/db/migrations/020_template_security_score.d.ts.map +1 -0
- package/dist/db/migrations/020_template_security_score.js +31 -0
- package/dist/db/migrations/020_template_security_score.js.map +1 -0
- package/dist/db/migrations/021_credential_enhancements.d.ts +4 -0
- package/dist/db/migrations/021_credential_enhancements.d.ts.map +1 -0
- package/dist/db/migrations/021_credential_enhancements.js +15 -0
- package/dist/db/migrations/021_credential_enhancements.js.map +1 -0
- package/dist/db/migrations/021_user_roles.d.ts +4 -0
- package/dist/db/migrations/021_user_roles.d.ts.map +1 -0
- package/dist/db/migrations/021_user_roles.js +11 -0
- package/dist/db/migrations/021_user_roles.js.map +1 -0
- package/dist/db/migrations/022_config_hash.d.ts +4 -0
- package/dist/db/migrations/022_config_hash.d.ts.map +1 -0
- package/dist/db/migrations/022_config_hash.js +11 -0
- package/dist/db/migrations/022_config_hash.js.map +1 -0
- package/dist/db/migrations/023_account_security.d.ts +4 -0
- package/dist/db/migrations/023_account_security.d.ts.map +1 -0
- package/dist/db/migrations/023_account_security.js +22 -0
- package/dist/db/migrations/023_account_security.js.map +1 -0
- package/dist/db/migrations/024_wizard_configs.d.ts +4 -0
- package/dist/db/migrations/024_wizard_configs.d.ts.map +1 -0
- package/dist/db/migrations/024_wizard_configs.js +165 -0
- package/dist/db/migrations/024_wizard_configs.js.map +1 -0
- package/dist/db/migrations/025_auth_dual_mode.d.ts +4 -0
- package/dist/db/migrations/025_auth_dual_mode.d.ts.map +1 -0
- package/dist/db/migrations/025_auth_dual_mode.js +19 -0
- package/dist/db/migrations/025_auth_dual_mode.js.map +1 -0
- package/dist/db/migrations/027_add_avatar_to_instances.d.ts +4 -0
- package/dist/db/migrations/027_add_avatar_to_instances.d.ts.map +1 -0
- package/dist/db/migrations/027_add_avatar_to_instances.js +11 -0
- package/dist/db/migrations/027_add_avatar_to_instances.js.map +1 -0
- package/dist/db/migrations/027_add_clerk_id.d.ts +4 -0
- package/dist/db/migrations/027_add_clerk_id.d.ts.map +1 -0
- package/dist/db/migrations/027_add_clerk_id.js +11 -0
- package/dist/db/migrations/027_add_clerk_id.js.map +1 -0
- package/dist/db/migrations/028_template_plugin_dependencies.d.ts +4 -0
- package/dist/db/migrations/028_template_plugin_dependencies.d.ts.map +1 -0
- package/dist/db/migrations/028_template_plugin_dependencies.js +18 -0
- package/dist/db/migrations/028_template_plugin_dependencies.js.map +1 -0
- package/dist/db/migrations/029_remap_orphan_config_keys.d.ts +21 -0
- package/dist/db/migrations/029_remap_orphan_config_keys.d.ts.map +1 -0
- package/dist/db/migrations/029_remap_orphan_config_keys.js +63 -0
- package/dist/db/migrations/029_remap_orphan_config_keys.js.map +1 -0
- package/dist/db/migrations/030_extend_notification_types.d.ts +4 -0
- package/dist/db/migrations/030_extend_notification_types.d.ts.map +1 -0
- package/dist/db/migrations/030_extend_notification_types.js +10 -0
- package/dist/db/migrations/030_extend_notification_types.js.map +1 -0
- package/dist/db/migrations/031_default_security_profile_developer.d.ts +9 -0
- package/dist/db/migrations/031_default_security_profile_developer.d.ts.map +1 -0
- package/dist/db/migrations/031_default_security_profile_developer.js +22 -0
- package/dist/db/migrations/031_default_security_profile_developer.js.map +1 -0
- package/dist/db/migrations/032_geo_template.d.ts +4 -0
- package/dist/db/migrations/032_geo_template.d.ts.map +1 -0
- package/dist/db/migrations/032_geo_template.js +133 -0
- package/dist/db/migrations/032_geo_template.js.map +1 -0
- package/dist/db/migrations/033_jinko_travel_template.d.ts +4 -0
- package/dist/db/migrations/033_jinko_travel_template.d.ts.map +1 -0
- package/dist/db/migrations/033_jinko_travel_template.js +126 -0
- package/dist/db/migrations/033_jinko_travel_template.js.map +1 -0
- package/dist/db/postgres-adapter.d.ts +13 -0
- package/dist/db/postgres-adapter.d.ts.map +1 -0
- package/dist/db/postgres-adapter.js +27 -0
- package/dist/db/postgres-adapter.js.map +1 -0
- package/dist/db/run-migrations.d.ts +2 -0
- package/dist/db/run-migrations.d.ts.map +1 -0
- package/dist/db/run-migrations.js +26 -0
- package/dist/db/run-migrations.js.map +1 -0
- package/dist/db/sqlite-adapter.d.ts +13 -0
- package/dist/db/sqlite-adapter.d.ts.map +1 -0
- package/dist/db/sqlite-adapter.js +29 -0
- package/dist/db/sqlite-adapter.js.map +1 -0
- package/dist/ee/litellm/litellm-key-manager.d.ts +16 -0
- package/dist/ee/litellm/litellm-key-manager.d.ts.map +1 -0
- package/dist/ee/litellm/litellm-key-manager.js +16 -0
- package/dist/ee/litellm/litellm-key-manager.js.map +1 -0
- package/dist/ee/litellm/litellm-model-seeder.d.ts +6 -0
- package/dist/ee/litellm/litellm-model-seeder.d.ts.map +1 -0
- package/dist/ee/litellm/litellm-model-seeder.js +6 -0
- package/dist/ee/litellm/litellm-model-seeder.js.map +1 -0
- package/dist/index.ce.d.ts +2 -0
- package/dist/index.ce.d.ts.map +1 -0
- package/dist/index.ce.js +12 -0
- package/dist/index.ce.js.map +1 -0
- package/dist/middleware/auth.d.ts +30 -0
- package/dist/middleware/auth.d.ts.map +1 -0
- package/dist/middleware/auth.js +86 -0
- package/dist/middleware/auth.js.map +1 -0
- package/dist/middleware/dynamic-middleware.d.ts +7 -0
- package/dist/middleware/dynamic-middleware.d.ts.map +1 -0
- package/dist/middleware/dynamic-middleware.js +46 -0
- package/dist/middleware/dynamic-middleware.js.map +1 -0
- package/dist/middleware/log-redaction.d.ts +2 -0
- package/dist/middleware/log-redaction.d.ts.map +1 -0
- package/dist/middleware/log-redaction.js +56 -0
- package/dist/middleware/log-redaction.js.map +1 -0
- package/dist/routes/admin.d.ts +3 -0
- package/dist/routes/admin.d.ts.map +1 -0
- package/dist/routes/admin.js +491 -0
- package/dist/routes/admin.js.map +1 -0
- package/dist/routes/agent-types.d.ts +3 -0
- package/dist/routes/agent-types.d.ts.map +1 -0
- package/dist/routes/agent-types.js +85 -0
- package/dist/routes/agent-types.js.map +1 -0
- package/dist/routes/auth.d.ts +3 -0
- package/dist/routes/auth.d.ts.map +1 -0
- package/dist/routes/auth.js +242 -0
- package/dist/routes/auth.js.map +1 -0
- package/dist/routes/channels.d.ts +3 -0
- package/dist/routes/channels.d.ts.map +1 -0
- package/dist/routes/channels.js +527 -0
- package/dist/routes/channels.js.map +1 -0
- package/dist/routes/credentials.d.ts +3 -0
- package/dist/routes/credentials.d.ts.map +1 -0
- package/dist/routes/credentials.js +81 -0
- package/dist/routes/credentials.js.map +1 -0
- package/dist/routes/dashboard.d.ts +3 -0
- package/dist/routes/dashboard.d.ts.map +1 -0
- package/dist/routes/dashboard.js +75 -0
- package/dist/routes/dashboard.js.map +1 -0
- package/dist/routes/exec-approval.d.ts +3 -0
- package/dist/routes/exec-approval.d.ts.map +1 -0
- package/dist/routes/exec-approval.js +60 -0
- package/dist/routes/exec-approval.js.map +1 -0
- package/dist/routes/group-chats.d.ts +3 -0
- package/dist/routes/group-chats.d.ts.map +1 -0
- package/dist/routes/group-chats.js +190 -0
- package/dist/routes/group-chats.js.map +1 -0
- package/dist/routes/instance-files.d.ts +3 -0
- package/dist/routes/instance-files.d.ts.map +1 -0
- package/dist/routes/instance-files.js +255 -0
- package/dist/routes/instance-files.js.map +1 -0
- package/dist/routes/instance-proxy.d.ts +40 -0
- package/dist/routes/instance-proxy.d.ts.map +1 -0
- package/dist/routes/instance-proxy.js +318 -0
- package/dist/routes/instance-proxy.js.map +1 -0
- package/dist/routes/instances.d.ts +3 -0
- package/dist/routes/instances.d.ts.map +1 -0
- package/dist/routes/instances.js +325 -0
- package/dist/routes/instances.js.map +1 -0
- package/dist/routes/metadata.d.ts +3 -0
- package/dist/routes/metadata.d.ts.map +1 -0
- package/dist/routes/metadata.js +13 -0
- package/dist/routes/metadata.js.map +1 -0
- package/dist/routes/notifications.d.ts +3 -0
- package/dist/routes/notifications.d.ts.map +1 -0
- package/dist/routes/notifications.js +104 -0
- package/dist/routes/notifications.js.map +1 -0
- package/dist/routes/oauth.d.ts +3 -0
- package/dist/routes/oauth.d.ts.map +1 -0
- package/dist/routes/oauth.js +516 -0
- package/dist/routes/oauth.js.map +1 -0
- package/dist/routes/rpc-proxy.d.ts +3 -0
- package/dist/routes/rpc-proxy.d.ts.map +1 -0
- package/dist/routes/rpc-proxy.js +116 -0
- package/dist/routes/rpc-proxy.js.map +1 -0
- package/dist/routes/security.d.ts +3 -0
- package/dist/routes/security.d.ts.map +1 -0
- package/dist/routes/security.js +43 -0
- package/dist/routes/security.js.map +1 -0
- package/dist/routes/skills.d.ts +3 -0
- package/dist/routes/skills.d.ts.map +1 -0
- package/dist/routes/skills.js +48 -0
- package/dist/routes/skills.js.map +1 -0
- package/dist/routes/snapshots.d.ts +3 -0
- package/dist/routes/snapshots.d.ts.map +1 -0
- package/dist/routes/snapshots.js +99 -0
- package/dist/routes/snapshots.js.map +1 -0
- package/dist/routes/system-config.d.ts +3 -0
- package/dist/routes/system-config.d.ts.map +1 -0
- package/dist/routes/system-config.js +75 -0
- package/dist/routes/system-config.js.map +1 -0
- package/dist/routes/templates.d.ts +3 -0
- package/dist/routes/templates.d.ts.map +1 -0
- package/dist/routes/templates.js +256 -0
- package/dist/routes/templates.js.map +1 -0
- package/dist/routes/ui-proxy.d.ts +3 -0
- package/dist/routes/ui-proxy.d.ts.map +1 -0
- package/dist/routes/ui-proxy.js +90 -0
- package/dist/routes/ui-proxy.js.map +1 -0
- package/dist/routes/user-credentials.d.ts +3 -0
- package/dist/routes/user-credentials.d.ts.map +1 -0
- package/dist/routes/user-credentials.js +85 -0
- package/dist/routes/user-credentials.js.map +1 -0
- package/dist/routes/users.d.ts +3 -0
- package/dist/routes/users.d.ts.map +1 -0
- package/dist/routes/users.js +30 -0
- package/dist/routes/users.js.map +1 -0
- package/dist/runtime/docker.d.ts +37 -0
- package/dist/runtime/docker.d.ts.map +1 -0
- package/dist/runtime/docker.js +612 -0
- package/dist/runtime/docker.js.map +1 -0
- package/dist/runtime/factory.d.ts +4 -0
- package/dist/runtime/factory.d.ts.map +1 -0
- package/dist/runtime/factory.js +21 -0
- package/dist/runtime/factory.js.map +1 -0
- package/dist/runtime/kubernetes.d.ts +34 -0
- package/dist/runtime/kubernetes.d.ts.map +1 -0
- package/dist/runtime/kubernetes.js +513 -0
- package/dist/runtime/kubernetes.js.map +1 -0
- package/dist/runtime/types.d.ts +81 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/types.js +2 -0
- package/dist/runtime/types.js.map +1 -0
- package/dist/server-core.d.ts +26 -0
- package/dist/server-core.d.ts.map +1 -0
- package/dist/server-core.js +184 -0
- package/dist/server-core.js.map +1 -0
- package/dist/services/config-diff.d.ts +6 -0
- package/dist/services/config-diff.d.ts.map +1 -0
- package/dist/services/config-diff.js +85 -0
- package/dist/services/config-diff.js.map +1 -0
- package/dist/services/config-field-meta.d.ts +22 -0
- package/dist/services/config-field-meta.d.ts.map +1 -0
- package/dist/services/config-field-meta.js +177 -0
- package/dist/services/config-field-meta.js.map +1 -0
- package/dist/services/config-validator.d.ts +8 -0
- package/dist/services/config-validator.d.ts.map +1 -0
- package/dist/services/config-validator.js +59 -0
- package/dist/services/config-validator.js.map +1 -0
- package/dist/services/credential-audit.d.ts +13 -0
- package/dist/services/credential-audit.d.ts.map +1 -0
- package/dist/services/credential-audit.js +18 -0
- package/dist/services/credential-audit.js.map +1 -0
- package/dist/services/credential-store.d.ts +28 -0
- package/dist/services/credential-store.d.ts.map +1 -0
- package/dist/services/credential-store.js +99 -0
- package/dist/services/credential-store.js.map +1 -0
- package/dist/services/dlp-scanner.d.ts +9 -0
- package/dist/services/dlp-scanner.d.ts.map +1 -0
- package/dist/services/dlp-scanner.js +90 -0
- package/dist/services/dlp-scanner.js.map +1 -0
- package/dist/services/gateway-event-relay.d.ts +53 -0
- package/dist/services/gateway-event-relay.d.ts.map +1 -0
- package/dist/services/gateway-event-relay.js +519 -0
- package/dist/services/gateway-event-relay.js.map +1 -0
- package/dist/services/group-chat-manager.d.ts +17 -0
- package/dist/services/group-chat-manager.d.ts.map +1 -0
- package/dist/services/group-chat-manager.js +613 -0
- package/dist/services/group-chat-manager.js.map +1 -0
- package/dist/services/health-monitor.d.ts +3 -0
- package/dist/services/health-monitor.d.ts.map +1 -0
- package/dist/services/health-monitor.js +342 -0
- package/dist/services/health-monitor.js.map +1 -0
- package/dist/services/instance-manager.d.ts +20 -0
- package/dist/services/instance-manager.d.ts.map +1 -0
- package/dist/services/instance-manager.js +833 -0
- package/dist/services/instance-manager.js.map +1 -0
- package/dist/services/metadata-store.d.ts +3 -0
- package/dist/services/metadata-store.d.ts.map +1 -0
- package/dist/services/metadata-store.js +34 -0
- package/dist/services/metadata-store.js.map +1 -0
- package/dist/services/notification-store.d.ts +24 -0
- package/dist/services/notification-store.d.ts.map +1 -0
- package/dist/services/notification-store.js +216 -0
- package/dist/services/notification-store.js.map +1 -0
- package/dist/services/openrouter-models.d.ts +13 -0
- package/dist/services/openrouter-models.d.ts.map +1 -0
- package/dist/services/openrouter-models.js +46 -0
- package/dist/services/openrouter-models.js.map +1 -0
- package/dist/services/output-filter.d.ts +8 -0
- package/dist/services/output-filter.d.ts.map +1 -0
- package/dist/services/output-filter.js +230 -0
- package/dist/services/output-filter.js.map +1 -0
- package/dist/services/prompt-guard.d.ts +6 -0
- package/dist/services/prompt-guard.d.ts.map +1 -0
- package/dist/services/prompt-guard.js +165 -0
- package/dist/services/prompt-guard.js.map +1 -0
- package/dist/services/security-event-service.d.ts +11 -0
- package/dist/services/security-event-service.d.ts.map +1 -0
- package/dist/services/security-event-service.js +201 -0
- package/dist/services/security-event-service.js.map +1 -0
- package/dist/services/snapshot-store.d.ts +21 -0
- package/dist/services/snapshot-store.d.ts.map +1 -0
- package/dist/services/snapshot-store.js +330 -0
- package/dist/services/snapshot-store.js.map +1 -0
- package/dist/services/system-config.d.ts +15 -0
- package/dist/services/system-config.d.ts.map +1 -0
- package/dist/services/system-config.js +80 -0
- package/dist/services/system-config.js.map +1 -0
- package/dist/services/template-file-format.d.ts +32 -0
- package/dist/services/template-file-format.d.ts.map +1 -0
- package/dist/services/template-file-format.js +125 -0
- package/dist/services/template-file-format.js.map +1 -0
- package/dist/services/template-store.d.ts +21 -0
- package/dist/services/template-store.d.ts.map +1 -0
- package/dist/services/template-store.js +701 -0
- package/dist/services/template-store.js.map +1 -0
- package/dist/services/user-credential-store.d.ts +20 -0
- package/dist/services/user-credential-store.d.ts.map +1 -0
- package/dist/services/user-credential-store.js +243 -0
- package/dist/services/user-credential-store.js.map +1 -0
- package/dist/services/wizard-config-store.d.ts +38 -0
- package/dist/services/wizard-config-store.d.ts.map +1 -0
- package/dist/services/wizard-config-store.js +70 -0
- package/dist/services/wizard-config-store.js.map +1 -0
- package/dist/web-dist/assets/AdminPage-BrAU67Dg.js +1 -0
- package/dist/web-dist/assets/AgentAvatar-BKJckc1W.js +1 -0
- package/dist/web-dist/assets/AgentAvatar-Cq-M5jMd.css +1 -0
- package/dist/web-dist/assets/AppLayout-Bf0v_2wK.css +1 -0
- package/dist/web-dist/assets/AppLayout-DXgV0atq.js +1 -0
- package/dist/web-dist/assets/AssistantChatPage-uVLgKLay.js +6 -0
- package/dist/web-dist/assets/AssistantEditPage-Bab1X-DA.js +1 -0
- package/dist/web-dist/assets/AssistantVersionsPage-BQRw3BUF.js +1 -0
- package/dist/web-dist/assets/AvatarPicker-DmnkD8Rb.js +1 -0
- package/dist/web-dist/assets/AvatarPicker-LHUepNFa.css +1 -0
- package/dist/web-dist/assets/CeAuthProvider-38_x9VGA.js +1 -0
- package/dist/web-dist/assets/ChatHubPage-2l4cKq0x.css +1 -0
- package/dist/web-dist/assets/ChatHubPage-B2WduoUM.js +1 -0
- package/dist/web-dist/assets/ChatTab-CHpjEu8M.js +6 -0
- package/dist/web-dist/assets/CreateWizardPage-DFEQ3VX3.js +47 -0
- package/dist/web-dist/assets/CreateWizardPage-IqNXDOER.css +1 -0
- package/dist/web-dist/assets/CredentialsPage-CDeXpnLG.js +1 -0
- package/dist/web-dist/assets/CredentialsPage-aI4kLoJD.css +1 -0
- package/dist/web-dist/assets/DocsAboutPage-CMbxiw1u.js +26 -0
- package/dist/web-dist/assets/DocsChannelsPage-CtmKYKK_.js +1 -0
- package/dist/web-dist/assets/DocsGettingStartedPage-CpM7o8sw.js +1 -0
- package/dist/web-dist/assets/DocsGroupChatsPage-7w-RVSJR.js +1 -0
- package/dist/web-dist/assets/DocsHomePage-BGEU5xBg.js +1 -0
- package/dist/web-dist/assets/DocsInstancesPage-Sewnw_x7.js +1 -0
- package/dist/web-dist/assets/DocsLayout-S7-ONZwP.js +1 -0
- package/dist/web-dist/assets/DocsProvidersPage-MeWneL5K.js +1 -0
- package/dist/web-dist/assets/DocsSkillsPage-CzsHPXxE.js +1 -0
- package/dist/web-dist/assets/DocsTemplatesPage-BXASAEoO.js +1 -0
- package/dist/web-dist/assets/DocsWorkspacePage-qYNeK_YS.js +24 -0
- package/dist/web-dist/assets/ExportWizardPage-BhNvovbU.js +3 -0
- package/dist/web-dist/assets/ExportWizardPage-Cp-KSYUy.css +1 -0
- package/dist/web-dist/assets/GoogleOAuthCallback-CBvLawe2.js +1 -0
- package/dist/web-dist/assets/GroupChatPage-rMfhmtsX.js +1 -0
- package/dist/web-dist/assets/GroupChatsListPage-BOwxHFfA.js +1 -0
- package/dist/web-dist/assets/InstancePage-BBL68DKB.js +1 -0
- package/dist/web-dist/assets/InstancePage-CzysRY40.css +1 -0
- package/dist/web-dist/assets/MyAssistantsPage-B808ZfHg.css +1 -0
- package/dist/web-dist/assets/MyAssistantsPage-q3-hNMth.js +1 -0
- package/dist/web-dist/assets/ProfilePage-Dx8YdU59.js +1 -0
- package/dist/web-dist/assets/ProfilePage-JMOkUDx7.css +1 -0
- package/dist/web-dist/assets/SessionDrawer-Ba7pbZDJ.css +1 -0
- package/dist/web-dist/assets/SessionDrawer-CXzEQAfF.js +1 -0
- package/dist/web-dist/assets/SystemConfigPage-4dvxADwi.js +1 -0
- package/dist/web-dist/assets/SystemConfigPage-DRqVfLGt.css +1 -0
- package/dist/web-dist/assets/TemplatesPage-DqXuG-Gy.css +1 -0
- package/dist/web-dist/assets/TemplatesPage-HMS__ODO.js +1 -0
- package/dist/web-dist/assets/TestLoginPage-xVQL0lYP.js +1 -0
- package/dist/web-dist/assets/ThemeToggle-DymKEYXG.js +1 -0
- package/dist/web-dist/assets/WorkbenchPage-Bymo4SSt.css +1 -0
- package/dist/web-dist/assets/WorkbenchPage-ST3hVrbL.js +33 -0
- package/dist/web-dist/assets/api-B5psysvQ.js +1 -0
- package/dist/web-dist/assets/clock-dRyRszad.js +1 -0
- package/dist/web-dist/assets/createLucideIcon-DiGX-lN4.js +1 -0
- package/dist/web-dist/assets/group-chat-9BaA9G_8.css +1 -0
- package/dist/web-dist/assets/index-BqzqZJ96.js +26 -0
- package/dist/web-dist/assets/index-DyrDN1Of.css +1 -0
- package/dist/web-dist/assets/index-wWimwgy7.js +1 -0
- package/dist/web-dist/assets/provider-display-BgrE7u33.js +1 -0
- package/dist/web-dist/assets/types-1lNWpzYk.js +57 -0
- package/dist/web-dist/assets/types-B6ttO-6G.css +1 -0
- package/dist/web-dist/assets/useTranslation-B-8kenfJ.js +1 -0
- package/dist/web-dist/assets/zap-CVBnETFW.js +1 -0
- package/dist/web-dist/index.html +31 -0
- package/dist/web-dist/vite.svg +1 -0
- package/dist/ws/index.d.ts +7 -0
- package/dist/ws/index.d.ts.map +1 -0
- package/dist/ws/index.js +112 -0
- package/dist/ws/index.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{j as e,f as ze,a as Ve,c as qe,r}from"./index-BqzqZJ96.js";import{a as V}from"./api-B5psysvQ.js";import{r as L,S as Xe}from"./SessionDrawer-CXzEQAfF.js";import{A as Ge,i as K,M as Ye,a as _e,F as Ze}from"./types-1lNWpzYk.js";import{u as Ce}from"./useTranslation-B-8kenfJ.js";/* empty css */function Je(s,n){if(!n)return null;switch(s){case"timeout":case"auth":case"quota":return{path:`/instances/${n}`,i18nKey:"chat.error.action.goToCredentials"};case"gateway":return{path:`/instances/${n}`,i18nKey:"chat.error.action.goToOverview"};case"model":return{i18nKey:"chat.error.action.openSettings"};default:return null}}function Qe({errorMessage:s,category:n,onRetry:u,onDismiss:f,onNavigate:p,onOpenSettings:M,instanceId:R,retrying:S}){const{t:j}=Ce(),k=Je(n,R),m=j(`chat.error.title.${n}`),$=n==="unknown"?s:j(`chat.error.description.${n}`),q=j(`chat.error.suggestion.${n}`);return e.jsxs("div",{className:"achat-error-banner",children:[e.jsxs("div",{className:"achat-error-banner__header",children:[e.jsxs("span",{className:"achat-error-banner__title",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[e.jsx("path",{d:"M7 1L1 13h12L7 1z",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M7 5.5v3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("circle",{cx:"7",cy:"10.5",r:"0.5",fill:"currentColor"})]}),m]}),e.jsx("button",{className:"achat-error-banner__dismiss",onClick:f,"aria-label":j("chat.error.action.dismiss"),children:"×"})]}),e.jsx("div",{className:"achat-error-banner__body",children:$}),e.jsx("div",{className:"achat-error-banner__suggestion",children:q}),e.jsxs("div",{className:"achat-error-banner__actions",children:[u&&e.jsx("button",{className:"achat-error-banner__retry",onClick:u,disabled:S,children:j(S?"chat.error.action.retrying":"chat.error.action.retry")}),k&&k.path&&p&&e.jsx("button",{className:"achat-error-banner__link",onClick:()=>p(k.path),children:j(k.i18nKey)}),k&&!k.path&&M&&e.jsx("button",{className:"achat-error-banner__link",onClick:M,children:j(k.i18nKey)})]})]})}const et=[{pattern:/timed?\s*out|timeout|no response|deadline exceeded/i,category:"timeout"},{pattern:/auth|unauthorized|401|invalid.*key|api.?key|credential|forbidden|403/i,category:"auth"},{pattern:/quota|rate.?limit|429|insufficient.*funds|billing|balance|limit exceeded/i,category:"quota"},{pattern:/model.*not.*found|model.*unavailable|unsupported.*model|does not exist/i,category:"model"},{pattern:/gateway|connect|ECONNREFUSED|ECONNRESET|socket|relay|not ready/i,category:"gateway"}];function re(s){for(const{pattern:n,category:u}of et)if(n.test(s))return u;return"unknown"}function oe(s){const n=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*[^\]\n]+)\s*\]\]/gi;if(typeof s=="string")return s.replace(n,"").trim();if(Array.isArray(s)){const u=[];for(const f of s){if(!f||typeof f!="object")continue;const p=f;(p.type==="text"||p.type==="output_text"||p.type==="input_text")&&typeof p.text=="string"&&u.push(p.text)}return u.join(`
|
|
2
|
+
`).replace(n,"").trim()}if(s&&typeof s=="object"){const u=s;if(typeof u.text=="string")return u.text.replace(n,"").trim();if(typeof u.content=="string")return u.content.replace(n,"").trim();if(Array.isArray(u.content))return oe(u.content)}return""}function tt(s){return s.includes("spreadsheet")||s.includes("ms-excel")?"XLS":s.includes("wordprocessingml")||s.includes("msword")?"DOC":s==="application/pdf"?"PDF":"FILE"}function st(s){return s?new Date(s).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):""}function Se(s){return Array.isArray(s)?s.some(n=>n&&typeof n=="object"&&n.type==="image"&&(n.content||n.source?.data)):!1}function ie(s,n){if(n.size===0)return s;let u=0;return s.map(f=>{if(f.role!=="user")return f;const p=n.get(u);return u++,p&&!Se(f.content)?{...f,content:p}:f})}function lt(){const{id:s}=ze(),{t:n}=Ce(),u=Ve(),{subscribe:f,unsubscribe:p,addHandler:M,removeHandler:R,isConnected:S,subscribeChatSession:j,unsubscribeChatSession:k}=qe(),[m,$]=r.useState(null),[q,Ne]=r.useState(!0),[X,A]=r.useState([]),[F,ce]=r.useState(""),[le,T]=r.useState(!1),[E,v]=r.useState(null),[I,w]=r.useState(null),[ue,he]=r.useState([]),b=r.useRef(null),G=r.useRef(new Set),W=r.useRef(new Map),h=r.useRef(null),de=r.useRef(null),Y=r.useRef(null),[Z,Le]=r.useState(!0),[Me,ge]=r.useState(!1),J=`chat-session-${s}`,[l,me]=r.useState(()=>localStorage.getItem(J)||`chat-${Date.now()}`),[Q,fe]=r.useState(null),[ee,te]=r.useState(!1),[Te,Ee]=r.useState(0),[D,se]=r.useState([]),pe=r.useRef(null),B=r.useCallback(t=>{if(!t||t.length===0)return;if(D.length+t.length>5){v({message:n("chat.attachments.maxReached"),category:"unknown",timestamp:Date.now()});return}Array.from(t).forEach(i=>{if(!Ge.has(i.type)){v({message:n("chat.attachments.invalidType"),category:"unknown",timestamp:Date.now()});return}const c=K(i.type)?5*1024*1024:Ye;if(i.size>c){v({message:n("chat.attachments.tooLarge"),category:"unknown",timestamp:Date.now()});return}const N=new FileReader;N.onload=o=>{const d=o.target?.result,x=d.split(",")[1];se(g=>[...g,{id:crypto.randomUUID(),type:i.type,data:x,preview:d,name:i.name}])},N.readAsDataURL(i)})},[D.length,n]),De=r.useCallback(t=>{t.clipboardData.files.length>0&&(t.preventDefault(),B(t.clipboardData.files))},[B]),Re=r.useCallback(t=>{t.preventDefault(),t.stopPropagation(),t.dataTransfer.files.length>0&&B(t.dataTransfer.files)},[B]),Ae=r.useCallback(t=>{se(a=>a.filter(i=>i.id!==t))},[]),[H,z]=r.useState(!1),[xe,ve]=r.useState(""),[ye,je]=r.useState(""),[be,ke]=r.useState(!1),[Ie,P]=r.useState([]);r.useEffect(()=>{if(m?.status!=="running"){P([]);return}s&&(m.billingMode==="platform"?V.get("/litellm/models").then(t=>P(t.models)).catch(()=>P([])):L(s,"models.list",{}).then(t=>{const a=(t.models??[]).map(i=>i.id??i.name).filter(i=>!!i);P(a)}).catch(()=>P([])))},[s,m?.status,m?.billingMode]);const We=Ie,y=I!==null||le;r.useEffect(()=>()=>{h.current&&(clearTimeout(h.current),h.current=null)},[]),r.useEffect(()=>{localStorage.setItem(J,l)},[J,l]),r.useEffect(()=>{s&&V.get(`/instances/${s}`).then(t=>{$(t),V.get(`/agent-types/${t.agentType}`).then(a=>{const i=a.wizard?.chatSuggestions??[];he(i)}).catch(()=>he([]))}).catch(()=>$(null)).finally(()=>Ne(!1))},[s]),r.useEffect(()=>{if(s)return f(s),()=>p(s)},[s,f,p]),r.useEffect(()=>{if(s)return j(s,l),()=>k(s,l)},[s,l,j,k]),r.useEffect(()=>{if(!s)return;const t=a=>{if(a.instanceId!==s)return;const i=a.payload;i.status&&$(c=>c?{...c,status:i.status,statusMessage:i.statusMessage??null}:null)};return M("instance:status",t),()=>R("instance:status",t)},[s,M,R]);const U=r.useCallback(async()=>{if(!(!s||m?.status!=="running"))try{const t=await L(s,"chat.history",{sessionKey:l,limit:50});if(t.messages){const a=t.messages.map(i=>({role:i.role==="user"?"user":"agent",content:i.content,timestamp:i.timestamp?new Date(i.timestamp).toISOString():void 0}));A(()=>ie(a,W.current))}}catch{}},[s,m?.status,l]);r.useEffect(()=>{let t=!1;if(!(!s||m?.status!=="running"))return L(s,"chat.history",{sessionKey:l,limit:50}).then(a=>{if(t||!a.messages)return;const i=a.messages.map(c=>({role:c.role==="user"?"user":"agent",content:c.content,timestamp:c.timestamp?new Date(c.timestamp).toISOString():void 0}));A(()=>ie(i,W.current))}).catch(()=>{}),()=>{t=!0}},[s,m?.status,l]);const ne=r.useRef(S);r.useEffect(()=>{if(!S||ne.current||!s||m?.status!=="running"){ne.current=S;return}ne.current=S;let t=!1;return L(s,"chat.history",{sessionKey:l,limit:50}).then(a=>{if(t||!a.messages)return;const i=a.messages.map(c=>({role:c.role==="user"?"user":"agent",content:c.content,timestamp:c.timestamp?new Date(c.timestamp).toISOString():void 0}));A(()=>ie(i,W.current))}).catch(()=>{}),()=>{t=!0}},[S,s,m?.status,l]),r.useEffect(()=>{if(!s||m?.status!=="running")return;const t=a=>{if(a.instanceId!==s)return;const i=a.payload;if(!i.event||!i.data)return;const{event:c,data:N}=i;if(c==="chat"){const o=N,d=o.sessionKey??"";if(d!==l&&!l.endsWith(d)&&!d.endsWith(l)||o.runId&&G.current.has(o.runId))return;if(o.state==="delta"){h.current&&(clearTimeout(h.current),h.current=null);const x=oe(o.content??o.message);x&&w(g=>!g||x.length>=g.length?x:g)}else if(o.state==="final")h.current&&(clearTimeout(h.current),h.current=null),w(null),b.current=null,T(!1),U();else if(o.state==="aborted")h.current&&(clearTimeout(h.current),h.current=null),w(null),b.current=null,T(!1);else if(o.state==="error"){h.current&&(clearTimeout(h.current),h.current=null),w(null),b.current=null,T(!1);const x=o.errorMessage??n("chat.chatError");v({message:x,category:re(x),timestamp:Date.now()})}}};return M("instance:gateway_event",t),()=>R("instance:gateway_event",t)},[s,m?.status,l,M,R,U,n]);const $e=r.useCallback(()=>{const t=`chat-${Date.now()}`;return y||(me(t),A([]),W.current=new Map,w(null),b.current=null,v(null)),t},[y]),Be=r.useCallback(t=>{y||(me(t),A([]),W.current=new Map,w(null),b.current=null,v(null),window.innerWidth<768&&te(!1))},[y]),Pe=r.useCallback((t,a)=>{const i=oe(t);navigator.clipboard.writeText(i),fe(a),setTimeout(()=>fe(c=>c===a?null:c),2e3)},[]);r.useEffect(()=>{H&&s&&L(s,"sessions.list",{limit:50,includeGlobal:!0}).then(t=>{const a=t.sessions?.find(i=>i.key===l);a&&(ve(a.model||""),je(a.thinkingLevel||""))}).catch(()=>{})},[H,s,l]);const Ue=async()=>{if(s){ke(!0);try{await L(s,"sessions.patch",{key:l,model:xe||null,thinkingLevel:ye||null}),z(!1)}catch(t){const a=t instanceof Error?t.message:n("chat.failedToUpdateSettings");v({message:a,category:re(a),timestamp:Date.now()})}finally{ke(!1)}}},O=async t=>{const a=(t??F).trim();if(!a&&D.length===0||y||!s)return;ce("");const i=[...D];se([]),v(null);let c=a;if(i.length>0){const o=[];a&&o.push({type:"text",text:a}),i.forEach(d=>{o.push({type:K(d.type)?"image":"file",mimeType:d.type,content:d.data,fileName:d.name})}),c=o}A(o=>{if(Se(c)){const d=o.filter(x=>x.role==="user").length;W.current.set(d,c)}return[...o,{role:"user",content:c,timestamp:new Date().toISOString()}]}),T(!0);const N=crypto.randomUUID();b.current=N,w("");try{const o=i.filter(g=>!K(g.type)),d=new Map;o.length>0&&s&&await Promise.all(o.map(async g=>{const C=await V.uploadFile(s,g.name,g.data,g.type);d.set(g.id,C.path)}));const x={sessionKey:l,message:a,idempotencyKey:N};if(d.size>0){const g=Array.from(d.values()).map(C=>`- ${C}`).join(`
|
|
3
|
+
`);x.message=`[Uploaded files to workspace:
|
|
4
|
+
${g}]
|
|
5
|
+
|
|
6
|
+
${a}`}if(i.length>0){const g=i.filter(C=>K(C.type)).map(C=>({type:"image",mimeType:C.type,content:C.data,fileName:C.name}));g.length>0&&(x.attachments=g)}await L(s,"chat.send",x),Ee(g=>g+1),h.current=setTimeout(()=>{h.current=null,b.current===N&&(v({message:n("chat.noResponseError"),category:"timeout",lastUserMessage:a,timestamp:Date.now()}),T(!1),w(null),b.current=null)},6e4)}catch(o){const d=o instanceof Error?o.message:n("chat.failedToSend");v({message:d,category:re(d),lastUserMessage:a,timestamp:Date.now()}),T(!1),w(null),b.current=null}},we=r.useCallback(()=>{h.current&&(clearTimeout(h.current),h.current=null),T(!1),w(null);const t=b.current;b.current=null,t&&(G.current.add(t),setTimeout(()=>G.current.delete(t),2e3)),s&&L(s,"chat.abort",t?{sessionKey:l,runId:t}:{sessionKey:l}).catch(()=>{}),U()},[s,l,U]);r.useEffect(()=>{const t=de.current;t&&(t.style.height="auto",t.style.height=`${Math.min(t.scrollHeight,160)}px`)},[F]);const Oe=r.useCallback(()=>{const t=Y.current;if(!t)return;Le(t.scrollHeight-t.scrollTop-t.clientHeight<60)},[]),ae=r.useCallback((t="smooth")=>{const a=Y.current;a&&a.scrollTo({top:a.scrollHeight,behavior:t})},[]);r.useEffect(()=>{Z&&ae("smooth")},[X,I,Z,ae]);const Ke=r.useCallback(async()=>{if(E?.lastUserMessage){ge(!0),v(null);try{await O(E.lastUserMessage)}finally{ge(!1)}}},[E,O]),Fe=[n("assistantChat.suggestion1"),n("assistantChat.suggestion2"),n("assistantChat.suggestion3"),n("assistantChat.suggestion4")],He=ue.length>0?ue:Fe;if(q)return e.jsx("div",{className:"achat-page",children:e.jsx("div",{className:"achat-loading",children:n("common.labels.loading")})});if(!m)return e.jsx("div",{className:"achat-page",children:e.jsx("div",{className:"achat-loading",children:n("instance.notFound")})});const _=m.status==="running";return e.jsxs("div",{className:"achat-page",children:[e.jsxs("header",{className:"achat-topbar",children:[e.jsx("button",{className:"achat-topbar__back",onClick:()=>u("/assistants"),children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M13 4L7 10L13 16",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("div",{className:"achat-topbar__avatar",children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[e.jsx("rect",{x:"3",y:"7",width:"14",height:"10",rx:"1.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M7 7V5.5A1.5 1.5 0 0 1 8.5 4h3A1.5 1.5 0 0 1 13 5.5V7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),e.jsxs("div",{className:"achat-topbar__info",children:[e.jsx("span",{className:"achat-topbar__name",children:m.name}),e.jsxs("span",{className:"achat-topbar__status",children:[_&&e.jsx("span",{className:"achat-topbar__dot"}),_?`${n("assistantChat.online")} · ${n("assistantChat.alwaysReady")}`:n(`common.status.${m.status}`)]})]}),e.jsx("button",{className:"achat-settings-btn",onClick:()=>z(!H),children:n("chat.settings")}),e.jsx("button",{className:`achat-drawer-toggle${ee?" achat-drawer-toggle--shifted":""}`,onClick:()=>te(!ee),title:n("chat.sessionDrawer.toggleSessions"),"aria-label":n("chat.sessionDrawer.toggleSessions"),children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),H&&e.jsxs("div",{className:"achat-settings-panel",children:[e.jsxs("div",{className:"achat-settings-field",children:[e.jsx("label",{children:n("chat.sessionSettings.modelLabel")}),e.jsx("input",{type:"text",value:xe,onChange:t=>ve(t.target.value),placeholder:n("chat.sessionSettings.modelPlaceholder"),list:"achat-model-suggestions"}),e.jsx("datalist",{id:"achat-model-suggestions",children:We.map(t=>e.jsx("option",{value:t},t))})]}),e.jsxs("div",{className:"achat-settings-field",children:[e.jsx("label",{children:n("chat.sessionSettings.thinkingLevelLabel")}),e.jsxs("select",{value:ye,onChange:t=>je(t.target.value),children:[e.jsx("option",{value:"",children:n("chat.sessionSettings.thinkingLevels.default")}),e.jsx("option",{value:"off",children:n("chat.sessionSettings.thinkingLevels.off")}),e.jsx("option",{value:"low",children:n("chat.sessionSettings.thinkingLevels.low")}),e.jsx("option",{value:"medium",children:n("chat.sessionSettings.thinkingLevels.medium")}),e.jsx("option",{value:"high",children:n("chat.sessionSettings.thinkingLevels.high")})]})]}),e.jsxs("div",{className:"achat-settings-actions",children:[e.jsx("button",{className:"achat-settings-save-btn",onClick:Ue,disabled:be,children:n(be?"chat.sessionSettings.saving":"chat.sessionSettings.save")}),e.jsx("button",{onClick:()=>z(!1),children:n("common.buttons.cancel")})]})]}),e.jsxs("div",{className:"achat-body",style:{display:"flex",flex:1,overflow:"hidden",position:"relative"},children:[e.jsx(Xe,{instanceId:s,currentSessionKey:l,isOpen:ee,isStreaming:y,onSelectSession:Be,onNewChat:$e,onClose:()=>te(!1),refreshFlag:Te,mode:"sidebar"}),e.jsxs("div",{className:"achat-main",style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",minWidth:0},children:[e.jsxs("div",{className:"achat-messages",ref:Y,onScroll:Oe,children:[!_&&e.jsx("div",{className:"achat-not-running",children:n("assistantChat.notRunning")}),X.map((t,a)=>{const i=t.role==="user";return e.jsxs("div",{className:`achat-msg achat-msg--${i?"user":"agent"}`,children:[e.jsxs("div",{className:"achat-msg__row",children:[!i&&e.jsx("div",{className:"achat-msg__avatar",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("rect",{x:"2",y:"5.5",width:"12",height:"8.5",rx:"1.5",stroke:"currentColor",strokeWidth:"1.4"}),e.jsx("path",{d:"M5.5 5.5V4.5A1.5 1.5 0 0 1 7 3h2a1.5 1.5 0 0 1 1.5 1.5V5.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}),e.jsx("div",{className:"achat-msg__bubble",children:e.jsx(_e,{content:t.content})})]}),e.jsx("button",{className:"achat-msg-copy-btn",onClick:()=>Pe(t.content,a),title:n(Q===a?"common.buttons.copied":"common.buttons.copy"),"aria-label":n(Q===a?"common.buttons.copied":"common.buttons.copy"),children:Q===a?e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M3.5 8.5L6.5 11.5L12.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("rect",{x:"5.5",y:"5.5",width:"7",height:"7",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M5 10.5H4.5A1 1 0 0 1 3.5 9.5V4A1 1 0 0 1 4.5 3H10a1 1 0 0 1 1 1v.5",stroke:"currentColor",strokeWidth:"1.3"})]})}),t.timestamp&&e.jsx("div",{className:`achat-msg__time${i?" achat-msg__time--right":" achat-msg__time--left"}`,children:st(t.timestamp)})]},a)}),I!==null&&e.jsx("div",{className:"achat-msg achat-msg--agent",children:e.jsxs("div",{className:"achat-msg__row",children:[e.jsx("div",{className:"achat-msg__avatar",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("rect",{x:"2",y:"5.5",width:"12",height:"8.5",rx:"1.5",stroke:"currentColor",strokeWidth:"1.4"}),e.jsx("path",{d:"M5.5 5.5V4.5A1.5 1.5 0 0 1 7 3h2a1.5 1.5 0 0 1 1.5 1.5V5.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}),e.jsx("div",{className:"achat-msg__bubble achat-msg__bubble--streaming",children:I?e.jsx(_e,{content:I,isStreaming:!0}):e.jsx("span",{className:"spinner"})})]})}),le&&I===null&&e.jsx("div",{className:"achat-msg achat-msg--agent",children:e.jsxs("div",{className:"achat-msg__row",children:[e.jsx("div",{className:"achat-msg__avatar",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("rect",{x:"2",y:"5.5",width:"12",height:"8.5",rx:"1.5",stroke:"currentColor",strokeWidth:"1.4"}),e.jsx("path",{d:"M5.5 5.5V4.5A1.5 1.5 0 0 1 7 3h2a1.5 1.5 0 0 1 1.5 1.5V5.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}),e.jsx("div",{className:"achat-msg__bubble",children:e.jsx("span",{className:"spinner"})})]})}),E&&e.jsx(Qe,{errorMessage:E.message,category:E.category,onRetry:E.lastUserMessage?Ke:void 0,onDismiss:()=>v(null),onNavigate:t=>u(t),onOpenSettings:()=>z(!0),instanceId:s,retrying:Me})]}),!Z&&e.jsx("button",{className:"achat-scroll-bottom-btn",onClick:()=>ae("smooth"),"aria-label":n("chat.scrollToBottom"),title:n("chat.scrollToBottom"),children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e.jsx("path",{d:"M9 3v12M4 10l5 5 5-5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),_&&X.length===0&&!y&&e.jsxs("div",{className:"achat-suggestions",children:[e.jsxs("div",{className:"achat-suggestions__label",children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:e.jsx("path",{d:"M8 2L4 8h4l-2 4 6-6H8l2-4z",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})}),n("assistantChat.quickSuggestions")]}),e.jsx("div",{className:"achat-suggestions__list",children:He.map((t,a)=>e.jsx("button",{className:"achat-suggestions__item",onClick:()=>O(t),children:t},a))})]}),e.jsxs("div",{className:"achat-input-bar",onPaste:De,onDrop:Re,onDragOver:t=>t.preventDefault(),children:[e.jsx("input",{type:"file",ref:pe,onChange:t=>B(t.target.files),accept:Ze,multiple:!0,style:{display:"none"}}),D.length>0&&e.jsx("div",{className:"achat-attachment-preview",children:D.map(t=>e.jsxs("div",{className:"achat-attachment-thumb",children:[K(t.type)?e.jsx("img",{src:t.preview,alt:t.name}):e.jsxs("div",{style:{width:"100%",height:"100%",borderRadius:"4px",background:"var(--color-surface-hover)",border:"1px solid var(--color-border)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"2px",padding:"4px",overflow:"hidden",fontSize:"0.55rem",color:"var(--color-text-secondary)",textAlign:"center"},children:[e.jsx("span",{style:{fontSize:"1.1rem",lineHeight:1},children:tt(t.type)}),e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},children:t.name})]}),e.jsx("button",{className:"achat-attachment-remove",onClick:()=>Ae(t.id),"aria-label":n("chat.attachments.removeAttachment"),children:"×"}),e.jsx("span",{className:"achat-attachment-name",children:t.name})]},t.id))}),e.jsxs("div",{className:"achat-input-bar__row",children:[e.jsx("button",{className:`achat-input-bar__icon${y||!_?" achat-input-bar__icon--disabled":""}`,onClick:()=>pe.current?.click(),disabled:y||!_,title:n("chat.attachments.attachFile"),children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}),e.jsx("textarea",{ref:de,className:"achat-input-bar__textarea",value:F,onChange:t=>ce(t.target.value),onKeyDown:t=>{t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),y?we():O())},placeholder:n("assistantChat.inputPlaceholder"),disabled:!_||y,rows:1}),e.jsx("button",{className:"achat-input-bar__icon",onClick:()=>U(),disabled:!_,children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[e.jsx("path",{d:"M16 3v4h-4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M2 9a7 7 0 0 1 12-4.9L16 7M2 15v-4h4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M16 9a7 7 0 0 1-12 4.9L2 11",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}),y?e.jsx("button",{className:"achat-input-bar__send achat-input-bar__send--stop",onClick:we,children:e.jsx("span",{className:"achat-stop-icon"})}):e.jsx("button",{className:"achat-input-bar__send",onClick:()=>O(),disabled:!F.trim()&&D.length===0||!_,children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e.jsx("path",{d:"M2 2l14 7-14 7V10.5l10-1.5-10-1.5V2z",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsx("div",{className:"achat-disclaimer",children:n("assistantChat.disclaimer")})]})]})]})]})}export{lt as AssistantChatPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as D,a as z,r as a,j as e}from"./index-BqzqZJ96.js";import{a as h,A as S}from"./api-B5psysvQ.js";import{A as I}from"./AvatarPicker-DmnkD8Rb.js";/* empty css */import{u as T}from"./useTranslation-B-8kenfJ.js";import"./index-wWimwgy7.js";import"./createLucideIcon-DiGX-lN4.js";function G(){const{id:n}=D(),x=z(),{t:s}=T(),[w,L]=a.useState(null),[m,u]=a.useState(""),[o,j]=a.useState(""),[v,g]=a.useState(""),[f,N]=a.useState(""),[C,M]=a.useState(!0),[l,k]=a.useState(!1),[c,d]=a.useState("idle"),[E,y]=a.useState(""),[r,b]=a.useState(!1),[W,p]=a.useState(!1);a.useEffect(()=>{let t=!1;async function A(){if(n)try{const i=await h.get(`/instances/${n}`);t||(L(i),u(i.name),j(i.avatar??""),g(typeof i.config.soulmd=="string"?i.config.soulmd:""),N(typeof i.config.identitymd=="string"?i.config.identitymd:""))}catch(i){t||y(i instanceof S?i.message:s("assistantEdit.loadError"))}finally{t||M(!1)}}return A(),()=>{t=!0}},[n,s]);async function B(){if(!(!n||l)){k(!0),d("idle");try{let t;o?o.startsWith("preset:")?t={type:"preset",presetId:o.slice(7)}:t={type:"custom",image:o}:t={type:"remove"},await Promise.all([h.patch(`/instances/${n}/config`,{soulmd:v,identitymd:f,agentName:m}),h.put(`/instances/${n}/avatar`,t)]),d("saved"),setTimeout(()=>d("idle"),2500)}catch{d("error")}finally{k(!1)}}}async function P(){if(!(!n||r)){b(!0);try{await h.delete(`/instances/${n}`),x("/assistants")}catch(t){y(t instanceof S?t.message:s("assistantEdit.deleteError")),b(!1),p(!1)}}}if(C)return e.jsx("div",{className:"aep-page aep-page--loading",children:e.jsx("span",{className:"aep-loading-text",children:s("assistantEdit.loading")})});const $=w?.name??m;return e.jsxs("div",{className:"aep-page",children:[e.jsxs("div",{className:"aep-content",children:[e.jsxs("button",{className:"aep-back-btn",onClick:()=>x("/assistants"),children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 3L5 8L10 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),s("assistantEdit.backButton")]}),e.jsxs("div",{className:"aep-header",children:[e.jsxs("div",{className:"aep-header-text",children:[e.jsx("h1",{className:"aep-title",children:s("assistantEdit.title")}),e.jsxs("p",{className:"aep-subtitle",children:[s("assistantEdit.subtitle"),e.jsxs("span",{className:"aep-subtitle-name",children:[" ",$," "]}),s("assistantEdit.subtitleOf")]})]}),e.jsxs("button",{className:`aep-save-btn${l?" aep-save-btn--saving":""}${c==="saved"?" aep-save-btn--saved":""}${c==="error"?" aep-save-btn--error":""}`,onClick:B,disabled:l,children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M13 10v2.5a.5.5 0 01-.5.5h-9a.5.5 0 01-.5-.5V10M8 2v7M5.5 6.5L8 9l2.5-2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),s(l?"assistantEdit.savingText":c==="saved"?"assistantEdit.savedText":"assistantEdit.saveButton")]})]}),E&&e.jsx("div",{className:"aep-alert aep-alert--warning",children:E}),c==="error"&&e.jsx("div",{className:"aep-alert aep-alert--error",children:s("assistantEdit.saveError")}),e.jsxs("div",{className:"aep-sections",children:[e.jsxs("section",{className:"aep-section",children:[e.jsxs("div",{className:"aep-section-header",children:[e.jsx("span",{className:"aep-section-icon aep-section-icon--name",children:e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:e.jsx("path",{d:"M10.5 1.5L13.5 4.5M2 13l1.5-4.5L11 1 14 4l-7.5 7.5L2 13z",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("h2",{className:"aep-section-title",children:s("assistantEdit.nameSection")})]}),e.jsx("input",{className:"aep-input",type:"text",value:m,onChange:t=>u(t.target.value),placeholder:s("assistantEdit.nameSection")})]}),e.jsxs("section",{className:"aep-section",children:[e.jsxs("div",{className:"aep-section-header",children:[e.jsx("span",{className:"aep-section-icon aep-section-icon--avatar",children:e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:[e.jsx("rect",{x:"1",y:"1",width:"13",height:"13",rx:"3",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("circle",{cx:"7.5",cy:"6",r:"2.5",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M3 13c0-2.5 2-4.5 4.5-4.5S12 10.5 12 13",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}),e.jsx("h2",{className:"aep-section-title",children:s("assistantEdit.avatarSection")})]}),e.jsx(I,{value:o,onChange:t=>j(t??"")})]}),e.jsxs("section",{className:"aep-section",children:[e.jsxs("div",{className:"aep-section-header",children:[e.jsx("span",{className:"aep-section-icon aep-section-icon--principles",children:e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:e.jsx("path",{d:"M7.5 1L9.18 5.28l4.57.38-3.46 3 1.04 4.46L7.5 10.5l-3.83 2.62 1.04-4.46-3.46-3 4.57-.38L7.5 1z",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("h2",{className:"aep-section-title",children:s("assistantEdit.principlesSection")})]}),e.jsx("textarea",{className:"aep-textarea",value:v,onChange:t=>g(t.target.value),rows:9,placeholder:s("assistantEdit.principlesSection")})]}),e.jsxs("section",{className:"aep-section",children:[e.jsxs("div",{className:"aep-section-header",children:[e.jsx("span",{className:"aep-section-icon aep-section-icon--identity",children:e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:[e.jsx("circle",{cx:"7.5",cy:"4.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M2 13c0-3.038 2.462-5.5 5.5-5.5S13 9.962 13 13",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}),e.jsx("h2",{className:"aep-section-title",children:s("assistantEdit.identitySection")})]}),e.jsx("textarea",{className:"aep-textarea",value:f,onChange:t=>N(t.target.value),rows:7,placeholder:s("assistantEdit.identitySection")})]})]}),e.jsxs("section",{className:"aep-danger-zone",children:[e.jsx("h2",{className:"aep-danger-zone-title",children:s("assistantEdit.dangerZone.title")}),e.jsx("p",{className:"aep-danger-zone-desc",children:s("assistantEdit.dangerZone.description")}),e.jsx("button",{className:"danger",onClick:()=>p(!0),disabled:r,children:s("assistantEdit.dangerZone.deleteButton")})]})]}),W&&e.jsx("div",{className:"modal-overlay",onClick:r?void 0:()=>p(!1),children:e.jsxs("div",{className:"modal",role:"dialog","aria-modal":"true",onClick:t=>t.stopPropagation(),children:[e.jsx("h3",{children:s("assistantEdit.deleteModal.title")}),e.jsx("p",{className:"aep-modal-desc",children:s("assistantEdit.deleteModal.description")}),e.jsx("p",{className:"aep-modal-warning",children:s("assistantEdit.deleteModal.warning")}),e.jsxs("div",{className:"aep-modal-actions",children:[e.jsx("button",{type:"button",className:"btn-secondary",onClick:()=>p(!1),disabled:r,children:s("assistantEdit.deleteModal.cancel")}),e.jsx("button",{type:"button",className:"danger",onClick:P,disabled:r,children:s(r?"assistantEdit.dangerZone.deleting":"assistantEdit.deleteModal.confirm")})]})]})}),e.jsx("button",{className:"aep-help-btn","aria-label":"Help",children:e.jsx("span",{children:"?"})})]})}export{G as AssistantEditPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as y,a as C,r as n,j as e}from"./index-BqzqZJ96.js";import{a as l}from"./api-B5psysvQ.js";/* empty css */import{u as M}from"./useTranslation-B-8kenfJ.js";function S(r){return!r||r.length===0?[]:r.slice(0,3).map(i=>({label:i.fieldLabel,old:i.oldValue??"(空)",newVal:i.newValue??"(空)"}))}function W(r){return{id:r.id,version:r.version??"v1",description:r.description??r.triggerDetail??"",createdAt:r.createdAt,changes:S(r.changeSummary)}}function A(){const{id:r}=y(),i=C(),{t:a}=M(),[x,_]=n.useState(null),[c,m]=n.useState([]),[k,N]=n.useState(!0),[j,d]=n.useState(null),[p,g]=n.useState(null),[h,u]=n.useState(null);n.useEffect(()=>{if(!r)return;let s=!1;return Promise.all([l.get(`/instances/${r}`),l.get(`/instances/${r}/snapshots?page=1&limit=50`)]).then(([t,o])=>{s||(_(t),m(o.items))}).catch(t=>{s||d(t instanceof Error?t.message:a("assistantVersions.loadFailed"))}).finally(()=>{s||N(!1)}),()=>{s=!0}},[r,a]);const V=n.useCallback(async s=>{if(r){g(s),d(null);try{await l.post(`/instances/${r}/snapshots/${s}/restore`,{});const t=await l.get(`/instances/${r}/snapshots?page=1&limit=50`);m(t.items)}catch(t){d(t instanceof Error?t.message:a("assistantVersions.restoreFailed"))}finally{g(null)}}},[r,a]),w=n.useCallback(async s=>{if(r)try{const t=await l.get(`/instances/${r}/snapshots/${s}/diff`);u({snapshotId:s,diff:t})}catch{}},[r]);if(k)return e.jsx("div",{className:"aver-page",children:e.jsx("div",{className:"aver-loading",children:a("common.labels.loading")})});const v=c.map(W),L=v.length>0?v[0].version:x?.imageTag??"—";return e.jsxs("div",{className:"aver-page",children:[e.jsxs("button",{className:"aver-back",onClick:()=>i("/assistants"),children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 3L5 8L10 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),a("assistantVersions.backToAssistants")]}),e.jsxs("header",{className:"aver-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"aver-header__title",children:[x?.name??""," — ",a("assistantVersions.titleSuffix")]}),e.jsxs("p",{className:"aver-header__subtitle",children:[a("assistantVersions.currentVersion")," ",e.jsx("strong",{children:L})]})]}),e.jsxs("div",{className:"aver-header__actions",children:[e.jsxs("button",{className:"aver-header__btn aver-header__btn--primary",onClick:()=>u(null),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M2.5 8a5.5 5.5 0 1 0 1-3.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M2.5 4v1.5H4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),a("assistantVersions.versionList")]}),e.jsxs("button",{className:"aver-header__btn",onClick:()=>{c[1]&&w(c[1].id)},disabled:c.length<2,children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M5 3v10M5 13l-2-2M5 13l2-2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M11 13V3M11 3l-2 2M11 3l2 2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),a("assistantVersions.compareDiff")]})]})]}),j&&e.jsx("div",{className:"aver-error",children:j}),h?e.jsxs("div",{className:"aver-diff-panel",children:[e.jsxs("button",{className:"aver-back",onClick:()=>u(null),children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 3L5 8L10 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),a("assistantVersions.versionList")]}),e.jsxs("div",{className:"aver-diff-list",children:[h.diff.changes.filter(s=>s.type!=="unchanged").map((s,t)=>e.jsxs("div",{className:"aver-diff-entry",children:[e.jsx("span",{className:"aver-diff-entry__file",children:s.file}),e.jsx("span",{className:`aver-diff-entry__type aver-diff-entry__type--${s.type}`,children:s.type})]},t)),h.diff.changes.filter(s=>s.type!=="unchanged").length===0&&e.jsx("p",{className:"aver-empty",children:a("assistantVersions.noVersions")})]})]}):e.jsx("div",{className:"aver-list",children:v.map((s,t)=>{const o=t===0;return e.jsxs("div",{className:`aver-card${o?" aver-card--current":""}`,children:[e.jsxs("div",{className:"aver-card__header",children:[e.jsxs("div",{className:"aver-card__version-row",children:[e.jsx("span",{className:"aver-card__version",children:s.version}),o&&e.jsx("span",{className:"aver-card__badge",children:a("assistantVersions.currentVersion")})]}),e.jsxs("span",{className:"aver-card__date",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[e.jsx("circle",{cx:"7",cy:"7",r:"5.5",stroke:"currentColor",strokeWidth:"1.4"}),e.jsx("path",{d:"M7 4.5V7l2 1.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]}),new Date(s.createdAt).toLocaleString()]})]}),s.description&&e.jsx("p",{className:"aver-card__desc",children:s.description}),s.changes.length>0&&e.jsx("div",{className:"aver-card__changes",children:s.changes.map((f,b)=>e.jsxs("div",{className:"aver-card__change-row",children:[e.jsx("span",{className:"aver-card__change-label",children:f.label}),e.jsx("span",{className:"aver-card__change-old",children:f.old}),e.jsx("span",{className:"aver-card__change-arrow",children:"→"}),e.jsx("span",{className:"aver-card__change-new",children:f.newVal})]},b))}),!o&&e.jsx("div",{className:"aver-card__footer",children:e.jsxs("button",{className:"aver-card__restore",onClick:()=>V(s.id),disabled:p!==null,children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[e.jsx("path",{d:"M2.5 7a4.5 4.5 0 1 0 .8-2.7",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M2.5 3.5V5.5H4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),p===s.id?a("assistantVersions.restoring"):a("assistantVersions.restoreVersion")]})})]},s.id)})})]})}export{A as AssistantVersionsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as u,j as e}from"./index-BqzqZJ96.js";import{A as m,P as _}from"./index-wWimwgy7.js";import{u as v}from"./useTranslation-B-8kenfJ.js";import{c as f}from"./createLucideIcon-DiGX-lN4.js";const k=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],h=f("upload",k),j=2*1024*1024,x=["image/jpeg","image/png","image/webp"];function E({value:s,onChange:n}){const{t:i}=v(),c=u.useRef(null);function l(t){const a=`preset:${t}`;n(s===a?null:a)}function o(t){const a=t.target.files?.[0];if(!a||!x.includes(a.type)||a.size>j)return;const r=new FileReader;r.onload=()=>{typeof r.result=="string"&&n(r.result)},r.readAsDataURL(a),c.current&&(c.current.value="")}return e.jsxs("div",{className:"avatar-picker",children:[m.map(t=>e.jsxs("div",{className:"avatar-picker__category",children:[e.jsx("div",{className:"avatar-picker__category-label",children:i(`wizard.avatar.${t.id}`)}),e.jsx("div",{className:"avatar-picker__grid",children:t.presets.map(a=>{const r=`preset:${a}`,p=s===r,d=_[a];return e.jsx("button",{type:"button",className:`avatar-picker__item${p?" avatar-picker__item--selected":""}`,onClick:()=>l(a),children:e.jsx("img",{src:d,alt:a})},a)})})]},t.id)),s&&s.startsWith("data:")&&e.jsxs("div",{className:"avatar-picker__custom-preview",children:[e.jsx("img",{className:"avatar-picker__custom-img",src:s,alt:"custom"}),e.jsx("button",{type:"button",className:"avatar-picker__remove-btn",onClick:()=>n(null),children:i("wizard.avatar.removeLabel")})]}),e.jsxs("button",{type:"button",className:"avatar-picker__upload-btn",onClick:()=>c.current?.click(),children:[e.jsx(h,{size:14}),i("wizard.avatar.uploadLabel")]}),e.jsx("p",{className:"avatar-picker__upload-hint",children:i("wizard.avatar.uploadHint")}),e.jsx("input",{ref:c,type:"file",accept:".jpg,.jpeg,.png,.webp",onChange:o,hidden:!0})]})}export{E as A};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.avatar-picker{display:flex;flex-direction:column;gap:var(--space-4)}.avatar-picker__category{display:flex;flex-direction:column;gap:var(--space-2)}.avatar-picker__category-label{font-size:.8rem;font-weight:600;color:var(--color-text-secondary)}.avatar-picker__grid{display:grid;grid-template-columns:repeat(4,1fr);gap:var(--space-2)}.avatar-picker__item{width:56px;height:56px;padding:4px;border-radius:var(--radius-lg);border:2px solid transparent;background:none;cursor:pointer;transition:border-color .15s;display:flex;align-items:center;justify-content:center}.avatar-picker__item:hover{border-color:var(--color-border)}.avatar-picker__item--selected{border-color:var(--color-primary);background:color-mix(in srgb,var(--color-primary) 8%,transparent)}.avatar-picker__item img{width:44px;height:44px;border-radius:var(--radius-full)}.avatar-picker__custom-preview{display:flex;align-items:center;gap:var(--space-3)}.avatar-picker__custom-img{width:56px;height:56px;border-radius:var(--radius-full);object-fit:cover;border:2px solid var(--color-primary)}.avatar-picker__remove-btn{padding:4px var(--space-3);border:1px solid var(--color-border);border-radius:var(--radius-md);background:none;color:var(--color-text-secondary);font-size:.8rem;cursor:pointer;transition:border-color .15s,color .15s}.avatar-picker__remove-btn:hover{border-color:var(--color-danger, #ef4444);color:var(--color-danger, #ef4444)}.avatar-picker__upload-btn{display:inline-flex;align-items:center;align-self:flex-start;gap:var(--space-2);padding:8px var(--space-4);border:1.5px dashed var(--color-border);border-radius:var(--radius-md);background:none;color:var(--color-text-secondary);font-size:.83rem;cursor:pointer;transition:border-color .15s,color .15s;font-family:var(--font-sans)}.avatar-picker__upload-btn:hover{border-color:var(--color-primary);color:var(--color-primary)}.avatar-picker__upload-hint{margin:0;font-size:.75rem;color:var(--color-text-secondary);opacity:.7}@media(max-width:480px){.avatar-picker__grid{grid-template-columns:repeat(4,1fr)}.avatar-picker__item{width:48px;height:48px}.avatar-picker__item img{width:38px;height:38px}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as n,A as t}from"./index-BqzqZJ96.js";const a={id:"ce-admin",email:"admin@localhost",displayName:"Admin",role:"admin",billingMode:"byok",usageBalanceUsd:null,usageLimitUsd:null,createdAt:new Date(0).toISOString()},i={user:a,isLoading:!1,isAdmin:!0,logout:async()=>{},updateUser:()=>{},getToken:async()=>"ce-admin"};function s({children:e}){return n.jsx(t.Provider,{value:i,children:e})}export{s as CeAuthProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.agent-sidebar{width:260px;min-width:260px;display:flex;flex-direction:column;border-left:1px solid var(--color-border);background:var(--color-surface);height:100%;overflow:hidden}.agent-sidebar--collapsed{width:56px;min-width:56px;align-items:center;padding-top:.5rem}.agent-sidebar__header{display:flex;align-items:center;justify-content:space-between;padding:.75rem .75rem .5rem;flex-shrink:0}.agent-sidebar__title{font-size:.85rem;font-weight:600;color:var(--color-text);margin:0}.agent-sidebar__toggle{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-secondary);cursor:pointer;flex-shrink:0}.agent-sidebar__toggle:hover{background:var(--color-light);color:var(--color-text)}.agent-sidebar__search{position:relative;padding:0 .75rem .5rem;flex-shrink:0}.agent-sidebar__search-icon{position:absolute;left:1.05rem;top:50%;transform:translateY(calc(-50% - .25rem));color:var(--color-text-secondary);pointer-events:none}.agent-sidebar__search-input{width:100%;padding:.35rem 1.8rem;font-size:.8rem;border:1px solid var(--color-border);border-radius:var(--radius-sm);background:var(--color-background);color:var(--color-text);outline:none;transition:border-color .2s}.agent-sidebar__search-input:focus{border-color:var(--color-primary)}.agent-sidebar__search-input::placeholder{color:var(--color-text-secondary)}.agent-sidebar__search-clear{position:absolute;right:1.05rem;top:50%;transform:translateY(calc(-50% - .25rem));display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--color-text-secondary);cursor:pointer;padding:0}.agent-sidebar__search-clear:hover{color:var(--color-text)}.agent-sidebar__list{flex:1;overflow-y:auto;padding:0 .5rem}.agent-sidebar__empty{padding:1rem;text-align:center;color:var(--color-text-secondary);font-size:.8rem}.agent-sidebar__item{display:flex;align-items:center;justify-content:flex-start;gap:.6rem;width:100%;padding:.5rem;border:none;border-radius:var(--radius-md);background:transparent;cursor:pointer;text-align:left;transition:background .15s;box-shadow:none}.agent-sidebar__item:hover{background:var(--color-light)}.agent-sidebar__item--active{background:var(--color-primary-bg, var(--color-light))}.agent-sidebar__item--offline{opacity:.55}.agent-sidebar__item--offline:hover{opacity:.8}.agent-sidebar__item-avatar{position:relative;flex-shrink:0}.agent-sidebar__dot{position:absolute;bottom:0;right:0;width:8px;height:8px;border-radius:50%;border:1.5px solid var(--color-surface);background:var(--color-text-secondary)}.agent-sidebar__dot--running{background:var(--color-success)}.agent-sidebar__dot--starting,.agent-sidebar__dot--stopping{background:var(--color-warning)}.agent-sidebar__dot--error{background:var(--color-danger)}.agent-sidebar__dot--stopped,.agent-sidebar__dot--created{background:var(--color-text-secondary)}.agent-sidebar__item-info{display:flex;flex-direction:column;min-width:0;gap:.1rem}.agent-sidebar__item-name{font-size:.82rem;font-weight:500;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-sidebar__item-status{font-size:.7rem;color:var(--color-text-secondary);text-transform:capitalize}.agent-sidebar__avatars-only{display:flex;flex-direction:column;align-items:center;gap:.4rem;padding:.25rem 0;overflow-y:auto;flex:1}.agent-sidebar__avatar-btn{position:relative;border:none;background:transparent;border-radius:var(--radius-sm);padding:.25rem;cursor:pointer;transition:background .15s}.agent-sidebar__avatar-btn:hover{background:var(--color-light)}.agent-sidebar__avatar-btn--active{background:var(--color-primary-bg, var(--color-light));outline:2px solid var(--color-primary);outline-offset:1px}.agent-sidebar__create{display:flex;align-items:center;justify-content:center;gap:.4rem;margin:.5rem .75rem .75rem;padding:.45rem;border:1px dashed var(--color-border);border-radius:var(--radius-md);background:transparent;color:var(--color-text-secondary);font-size:.8rem;cursor:pointer;transition:color .15s,border-color .15s;flex-shrink:0}.agent-sidebar__create:hover{color:var(--color-primary);border-color:var(--color-primary)}@media(max-width:768px){.agent-sidebar{position:fixed;top:0;right:0;bottom:0;z-index:50;box-shadow:-4px 0 12px #0000001a}.agent-sidebar--collapsed{display:none}}.chat-hub{display:flex;height:100%;overflow:hidden}.chat-hub--loading,.chat-hub--empty{display:flex;align-items:center;justify-content:center}.chat-hub__empty-card{display:flex;flex-direction:column;align-items:center;gap:.75rem;padding:2.5rem;max-width:380px;text-align:center}.chat-hub__empty-icon{width:56px;height:56px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:var(--color-primary-bg, var(--color-light));color:var(--color-primary)}.chat-hub__empty-title{font-size:1.1rem;font-weight:600;color:var(--color-text);margin:0}.chat-hub__empty-desc{font-size:.85rem;color:var(--color-text-secondary);margin:0;line-height:1.5}.chat-hub__main{flex:1;min-width:0;display:flex;flex-direction:column;overflow:hidden}.chat-hub__main .chat-container{height:100%;display:flex;flex-direction:column;justify-content:flex-end;padding-bottom:0}.chat-hub__main .chat-messages{flex:1;max-width:900px;width:100%;margin-left:auto;margin-right:auto}.chat-hub__main .chat-input-row{max-width:900px;width:100%;margin:0 auto 15vh;padding:.5rem 1.5rem;box-sizing:border-box}.chat-hub__main .chat-input-row textarea{min-height:3.2rem!important}.chat-hub__no-selection{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;color:var(--color-text-secondary)}.chat-hub__no-selection p{margin:0;font-size:.9rem}.chat-hub__offline{flex:1;display:flex;align-items:center;justify-content:center}.chat-hub__offline-card{display:flex;flex-direction:column;align-items:center;gap:.5rem;padding:2rem;text-align:center;max-width:340px}.chat-hub__offline-icon{color:var(--color-text-secondary)}.chat-hub__offline-name{font-size:1rem;font-weight:600;color:var(--color-text);margin:0}.chat-hub__offline-status{font-size:.82rem;color:var(--color-text-secondary);margin:0;text-transform:capitalize}.chat-hub__offline-msg{font-size:.8rem;color:var(--color-warning);margin:0}.chat-hub__offline-spinner{display:flex;align-items:center;gap:.5rem;font-size:.82rem;color:var(--color-text-secondary)}@media(max-width:768px){.chat-hub{flex-direction:column}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as A,r as i,j as s,c as $}from"./index-BqzqZJ96.js";import{a as y}from"./api-B5psysvQ.js";import{A as S,P as L}from"./AgentAvatar-BKJckc1W.js";import{u as w}from"./useTranslation-B-8kenfJ.js";import{c as z}from"./createLucideIcon-DiGX-lN4.js";import{C as E}from"./ChatTab-CHpjEu8M.js";import{Z as T,B,M as H}from"./zap-CVBnETFW.js";import"./index-wWimwgy7.js";import"./SessionDrawer-CXzEQAfF.js";import"./types-1lNWpzYk.js";const P=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],R=z("search",P);const W=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],D=z("x",W),M={running:0,starting:1,stopping:2,created:3,stopped:4,error:5};function U({instances:n,selectedId:p,onSelect:u,collapsed:x,onToggle:m}){const{t:r}=w(),d=A(),[c,j]=i.useState(""),b=i.useMemo(()=>[...c?n.filter(o=>o.name.toLowerCase().includes(c.toLowerCase())):n].sort((o,f)=>{const N=M[o.status]??9,_=M[f.status]??9;return N!==_?N-_:o.name.localeCompare(f.name)}),[n,c]);return x?s.jsxs("aside",{className:"agent-sidebar agent-sidebar--collapsed",children:[s.jsx("button",{className:"agent-sidebar__toggle",onClick:m,title:r("chatHub.showAgents"),children:s.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",children:s.jsx("path",{d:"M13 4l-6 6 6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),s.jsx("div",{className:"agent-sidebar__avatars-only",children:b.slice(0,10).map(e=>s.jsxs("button",{className:`agent-sidebar__avatar-btn ${p===e.id?"agent-sidebar__avatar-btn--active":""}`,onClick:()=>u(e.id),title:e.name,children:[s.jsx(S,{avatar:e.avatar,name:e.name,size:"sm"}),s.jsx("span",{className:`agent-sidebar__dot agent-sidebar__dot--${e.status}`})]},e.id))})]}):s.jsxs("aside",{className:"agent-sidebar",children:[s.jsxs("div",{className:"agent-sidebar__header",children:[s.jsx("h3",{className:"agent-sidebar__title",children:r("chatHub.agents")}),s.jsx("button",{className:"agent-sidebar__toggle",onClick:m,title:r("chatHub.hideAgents"),children:s.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",children:s.jsx("path",{d:"M7 4l6 6-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),s.jsxs("div",{className:"agent-sidebar__search",children:[s.jsx(R,{size:14,className:"agent-sidebar__search-icon"}),s.jsx("input",{type:"text",value:c,onChange:e=>j(e.target.value),placeholder:r("chatHub.searchAgents"),className:"agent-sidebar__search-input"}),c&&s.jsx("button",{className:"agent-sidebar__search-clear",onClick:()=>j(""),children:s.jsx(D,{size:14})})]}),s.jsxs("div",{className:"agent-sidebar__list",children:[b.length===0&&c&&s.jsx("div",{className:"agent-sidebar__empty",children:r("chatHub.noMatch")}),b.map(e=>s.jsxs("button",{className:`agent-sidebar__item ${p===e.id?"agent-sidebar__item--active":""} ${e.status!=="running"?"agent-sidebar__item--offline":""}`,onClick:()=>u(e.id),children:[s.jsxs("div",{className:"agent-sidebar__item-avatar",children:[s.jsx(S,{avatar:e.avatar,name:e.name,size:"sm"}),s.jsx("span",{className:`agent-sidebar__dot agent-sidebar__dot--${e.status}`})]}),s.jsxs("div",{className:"agent-sidebar__item-info",children:[s.jsx("span",{className:"agent-sidebar__item-name",children:e.name}),s.jsx("span",{className:"agent-sidebar__item-status",children:r(`chatHub.status.${e.status}`,e.status)})]})]},e.id))]}),s.jsxs("button",{className:"agent-sidebar__create",onClick:()=>d("/create"),children:[s.jsx(L,{size:16}),s.jsx("span",{children:r("chatHub.createAgent")})]})]})}function Y(){const{t:n}=w(),p=A(),{subscribe:u,unsubscribe:x,addHandler:m,removeHandler:r}=$(),[d,c]=i.useState([]),[j,b]=i.useState(!0),[e,o]=i.useState(null),[f,N]=i.useState(!1),[_,C]=i.useState(null);i.useEffect(()=>{y.get("/instances").then(a=>{c(a);const l=a.find(h=>h.status==="running");l?o(l.id):a.length>0&&o(a[0].id)}).catch(()=>{}).finally(()=>b(!1))},[]),i.useEffect(()=>{for(const a of d)u(a.id);return()=>{for(const a of d)x(a.id)}},[d,u,x]);const v=i.useCallback(a=>{const{instanceId:l,payload:h}=a;c(g=>g.map(k=>k.id===l?{...k,status:h.status,statusMessage:h.statusMessage??null}:k))},[]);i.useEffect(()=>(m("instance:status",v),()=>r("instance:status",v)),[m,r,v]);const t=d.find(a=>a.id===e)??null,I=async a=>{C(a);try{const l=await y.post(`/instances/${a}/start`,{});c(h=>h.map(g=>g.id===a?{...g,status:l.status,statusMessage:l.statusMessage}:g))}catch{const l=await y.get("/instances").catch(()=>null);l&&c(l)}finally{C(null)}};return j?s.jsx("div",{className:"chat-hub chat-hub--loading",children:s.jsx("span",{className:"spinner"})}):d.length===0?s.jsx("div",{className:"chat-hub chat-hub--empty",children:s.jsxs("div",{className:"chat-hub__empty-card",children:[s.jsx("div",{className:"chat-hub__empty-icon",children:s.jsx(T,{size:32})}),s.jsx("h2",{className:"chat-hub__empty-title",children:n("chatHub.emptyTitle")}),s.jsx("p",{className:"chat-hub__empty-desc",children:n("chatHub.emptyDesc")}),s.jsxs("button",{className:"btn-primary",onClick:()=>p("/create"),children:[s.jsx(B,{size:18}),s.jsx("span",{children:n("chatHub.createFirst")})]})]})}):s.jsxs("div",{className:"chat-hub",children:[s.jsx("div",{className:"chat-hub__main",children:t?t.status==="running"?s.jsx(E,{instanceId:t.id,instanceStatus:t.status},t.id):s.jsx("div",{className:"chat-hub__offline",children:s.jsxs("div",{className:"chat-hub__offline-card",children:[s.jsx(H,{size:28,className:"chat-hub__offline-icon"}),s.jsx("h3",{className:"chat-hub__offline-name",children:t.name}),s.jsx("p",{className:"chat-hub__offline-status",children:n(`chatHub.status.${t.status}`,t.status)}),t.statusMessage&&s.jsx("p",{className:"chat-hub__offline-msg",children:t.statusMessage}),(t.status==="stopped"||t.status==="created"||t.status==="error")&&s.jsx("button",{className:"btn-primary",onClick:()=>I(t.id),disabled:_===t.id,children:_===t.id?n("chatHub.starting"):n("chatHub.startAgent")}),t.status==="starting"&&s.jsxs("div",{className:"chat-hub__offline-spinner",children:[s.jsx("span",{className:"spinner"}),s.jsx("span",{children:n("chatHub.waitingStart")})]})]})}):s.jsxs("div",{className:"chat-hub__no-selection",children:[s.jsx(H,{size:28}),s.jsx("p",{children:n("chatHub.selectAgent")})]})}),s.jsx(U,{instances:d,selectedId:e,onSelect:o,collapsed:f,onToggle:()=>N(a=>!a)})]})}export{Y as ChatHubPage};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as Te,r as s,j as t}from"./index-BqzqZJ96.js";import{r as L,S as Ne}from"./SessionDrawer-CXzEQAfF.js";import{a as Re}from"./api-B5psysvQ.js";import{A as De,i as M,M as Le,a as de,F as Me}from"./types-1lNWpzYk.js";import{u as Ee}from"./useTranslation-B-8kenfJ.js";const Ae={anthropic:["claude-opus-4-6","claude-opus-4-5","claude-sonnet-4-20250514","claude-haiku-3-20250414"],openai:["gpt-5","gpt-5-mini","gpt-4.1","gpt-4.1-mini","gpt-4.1-nano","gpt-4o","gpt-4o-mini","o3","o3-mini","o3-pro","o1","o1-mini","codex-mini"],"openai-codex":["gpt-5.1-codex-mini","gpt-5.1","gpt-5.1-codex-max","gpt-5.2","gpt-5.2-codex","gpt-5.3-codex","gpt-5.3-codex-spark"],google:["gemini-3-pro","gemini-3-flash","gemini-2.5-pro","gemini-2.5-flash"],openrouter:["anthropic/claude-opus-4-6","anthropic/claude-sonnet-4","openai/gpt-5","openai/gpt-4.1","google/gemini-3-pro","google/gemini-2.5-pro"],"github-copilot":["claude-sonnet-4-20250514","gpt-4o","gpt-4.1","gpt-4.1-mini","gpt-4.1-nano","gpt-5-mini","o3-mini","o1","o1-mini"],ollama:["llama3","llama3.1","mixtral","codellama","deepseek-coder-v2","qwen2.5-coder"],bedrock:["anthropic.claude-sonnet-4-20250514-v2:0","anthropic.claude-haiku-3-20250414-v1:0"],xai:["grok-3","grok-3-mini","grok-2"],together:["meta-llama/Llama-3.3-70B-Instruct-Turbo","deepseek-ai/DeepSeek-V3","Qwen/Qwen2.5-72B-Instruct-Turbo"],venice:["llama-3.3-70b","deepseek-r1-671b"],groq:["llama-3.3-70b-versatile","llama-3.1-8b-instant","mixtral-8x7b-32768","gemma2-9b-it"],deepseek:["deepseek-chat","deepseek-reasoner"],mistral:["mistral-large-latest","mistral-medium-latest","mistral-small-latest","codestral-latest"],moonshot:["kimi-k2.5","moonshot-v1-128k"],minimax:["MiniMax-M2.1","MiniMax-VL-01"],litellm:["gpt-4o","claude-sonnet-4-20250514"]};function he(a){return Array.isArray(a)?a.some(l=>l&&typeof l=="object"&&l.type==="image"&&(l.content||l.source?.data)):!1}function Ie(a,l){if(l.size===0)return a;let c=0;return a.map(p=>{if(p.role!=="user")return p;const n=l.get(c);return c++,n&&!he(p.content)?{...p,content:n}:p})}function $(a){const l=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*[^\]\n]+)\s*\]\]/gi;if(typeof a=="string")return a.replace(l,"").trim();if(Array.isArray(a)){const c=[];for(const p of a){if(!p||typeof p!="object")continue;const n=p;(n.type==="text"||n.type==="output_text"||n.type==="input_text")&&typeof n.text=="string"&&c.push(n.text)}return c.length>0?c.join(`
|
|
2
|
+
`).replace(l,"").trim():""}if(a&&typeof a=="object"){const c=a;if(typeof c.text=="string")return c.text.replace(l,"").trim();if(typeof c.content=="string")return c.content.replace(l,"").trim();if(Array.isArray(c.content))return $(c.content)}return""}function Pe(a){if(!a)return"";const l=new Date(a),c=new Date;return l.toDateString()===c.toDateString()?l.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):l.toLocaleDateString(void 0,{month:"short",day:"numeric"})+" "+l.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function _e(a){return a.includes("spreadsheet")||a.includes("ms-excel")?"XLS":a.includes("wordprocessingml")||a.includes("msword")?"DOC":a==="application/pdf"?"PDF":"FILE"}function $e({instanceId:a,instanceStatus:l,initialSessionKey:c,onSessionKeyConsumed:p}){const{t:n}=Ee(),{isConnected:E,addHandler:B,removeHandler:W,subscribeChatSession:q,unsubscribeChatSession:G}=Te(),[V,N]=s.useState([]),[A,X]=s.useState(""),[I,j]=s.useState(!1),[Q,f]=s.useState(null),[T,x]=s.useState(null),g=s.useRef(null),_=s.useRef(new Set),R=s.useRef(new Map),d=s.useRef(null),Y=s.useRef(null),F=`chat-session-${a}`,[u,H]=s.useState(()=>c||localStorage.getItem(F)||`chat-${Date.now()}`);s.useEffect(()=>{localStorage.setItem(F,u)},[F,u]),s.useEffect(()=>{c&&u===c&&p?.()},[]),s.useEffect(()=>{c&&c!==u&&(H(c),N([]),R.current=new Map,x(null),g.current=null,f(null),p?.())},[c]),s.useEffect(()=>(q(a,u),()=>G(a,u)),[a,u,q,G]),s.useEffect(()=>{const e=Y.current;e&&(e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,200)}px`)},[A]);const[me,Z]=s.useState(null),[K,O]=s.useState(!1),[pe,ge]=s.useState(0),[S,U]=s.useState([]),J=s.useRef(null),fe=s.useRef(null),D=s.useCallback(e=>{if(!e||e.length===0)return;if(S.length+e.length>5){f(n("chat.attachments.maxReached"));return}Array.from(e).forEach(r=>{if(!De.has(r.type)){f(n("chat.attachments.invalidType"));return}const w=M(r.type)?5*1024*1024:Le;if(r.size>w){f(n("chat.attachments.tooLarge"));return}const C=new FileReader;C.onload=o=>{const h=o.target?.result,y=h.split(",")[1];U(m=>[...m,{id:crypto.randomUUID(),type:r.type,data:y,preview:h,name:r.name}])},C.readAsDataURL(r)})},[S.length,n]),xe=s.useCallback(e=>{e.clipboardData.files.length>0&&(e.preventDefault(),D(e.clipboardData.files))},[D]),ye=s.useCallback(e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer.files.length>0&&D(e.dataTransfer.files)},[D]),ve=s.useCallback(e=>{U(i=>i.filter(r=>r.id!==e))},[]),be=s.useCallback((e,i)=>{const r=$(e);navigator.clipboard.writeText(r),Z(i),setTimeout(()=>Z(w=>w===i?null:w),2e3)},[]),v=T!==null||I,k=s.useCallback(async()=>{if(l==="running")try{const e=await L(a,"chat.history",{sessionKey:u,limit:50});if(e.messages){const i=e.messages.map(r=>({role:r.role==="user"?"user":"agent",content:r.content,timestamp:r.timestamp?new Date(r.timestamp).toISOString():void 0}));N(()=>Ie(i,R.current))}}catch{}},[a,l,u]);s.useEffect(()=>{k()},[k]);const ee=s.useRef(E),te=s.useRef(I);te.current=I;const ne=s.useRef(T);ne.current=T,s.useEffect(()=>{E&&!ee.current&&((ne.current!==null||te.current)&&(j(!1),x(null),g.current=null),k()),ee.current=E},[E,k]),s.useEffect(()=>{if(l!=="running")return;const e=i=>{if(i.instanceId!==a)return;const r=i.payload;if(!r.event||!r.data)return;const{event:w,data:C}=r;if(w==="chat"){const o=C;if(o.sessionKey!==u||o.runId&&_.current.has(o.runId))return;if(o.state==="delta"){d.current&&(clearTimeout(d.current),d.current=null);const h=$(o.content??o.message);h&&x(y=>!y||h.length>=y.length?h:y)}else o.state==="final"?(d.current&&(clearTimeout(d.current),d.current=null),x(null),g.current=null,j(!1),k()):o.state==="aborted"?(d.current&&(clearTimeout(d.current),d.current=null),x(null),g.current=null,j(!1)):o.state==="error"&&(d.current&&(clearTimeout(d.current),d.current=null),x(null),g.current=null,j(!1),f(o.errorMessage??n("chat.chatError")))}};return B("instance:gateway_event",e),()=>W("instance:gateway_event",e)},[a,l,u,B,W,k,n]);const se=()=>{const e=`chat-${Date.now()}`;return v||(H(e),N([]),R.current=new Map,x(null),g.current=null,f(null)),e},je=s.useCallback(e=>{v||(H(e),N([]),R.current=new Map,x(null),g.current=null,f(null),O(!1))},[v]),[P,z]=s.useState(!1),[ae,re]=s.useState(""),[ie,oe]=s.useState(""),[le,ce]=s.useState(!1),Se=Object.values(Ae).flat();s.useEffect(()=>{P&&L(a,"sessions.list",{limit:50,includeGlobal:!0}).then(e=>{const i=e.sessions?.find(r=>r.key===u);i&&(re(i.model||""),oe(i.thinkingLevel||""))}).catch(()=>{})},[P,a,u]);const ke=async()=>{ce(!0);try{await L(a,"sessions.patch",{key:u,model:ae||null,thinkingLevel:ie||null}),z(!1)}catch(e){f(e instanceof Error?e.message:n("chat.failedToUpdateSettings"))}finally{ce(!1)}},we=s.useCallback(e=>{e?.scrollIntoView({behavior:"smooth"})},[]),ue=async()=>{const e=A.trim();if(!e&&S.length===0||v)return;X("");const i=[...S];U([]),f(null);let r=e;if(i.length>0){const o=[];e&&o.push({type:"text",text:e}),i.forEach(h=>{o.push({type:M(h.type)?"image":"file",mimeType:h.type,content:h.data,fileName:h.name})}),r=o}const w={role:"user",content:r,timestamp:new Date().toISOString()};N(o=>{if(he(r)){const h=o.filter(y=>y.role==="user").length;R.current.set(h,r)}return[...o,w]}),j(!0);const C=crypto.randomUUID();g.current=C,x("");try{const o=i.filter(m=>!M(m.type)),h=new Map;o.length>0&&await Promise.all(o.map(async m=>{const b=await Re.uploadFile(a,m.name,m.data,m.type);h.set(m.id,b.path)}));const y={sessionKey:u,message:e,idempotencyKey:C};if(h.size>0){const m=Array.from(h.values()).map(b=>`- ${b}`).join(`
|
|
3
|
+
`);y.message=`[Uploaded files to workspace:
|
|
4
|
+
${m}]
|
|
5
|
+
|
|
6
|
+
${e}`}if(i.length>0){const m=i.filter(b=>M(b.type)).map(b=>({type:"image",mimeType:b.type,content:b.data,fileName:b.name}));m.length>0&&(y.attachments=m)}await L(a,"chat.send",y),ge(m=>m+1),d.current=setTimeout(()=>{d.current=null,g.current===C&&(f(n("chat.noResponseError")),j(!1),x(null),g.current=null)},6e4)}catch(o){f(o instanceof Error?o.message:n("chat.failedToSend")),j(!1),x(null),g.current=null}},Ce=s.useCallback(()=>{d.current&&(clearTimeout(d.current),d.current=null),j(!1),x(null);const e=g.current;g.current=null,e&&(_.current.add(e),setTimeout(()=>_.current.delete(e),2e3)),L(a,"chat.abort",e?{sessionKey:u,runId:e}:{sessionKey:u}).catch(()=>{}),k()},[a,u,k]);return l!=="running"?t.jsx("div",{className:"info-message",children:n("chat.startRequired")}):t.jsxs("div",{className:"chat-container",children:[t.jsx(Ne,{instanceId:a,currentSessionKey:u,isOpen:K,isStreaming:v,onSelectSession:je,onNewChat:se,onClose:()=>O(!1),refreshFlag:pe,mode:"overlay"}),t.jsxs("div",{className:"chat-header",children:[t.jsxs("div",{className:"chat-session-info",children:[t.jsx("button",{onClick:()=>O(!K),className:"btn-icon btn-small",title:n("chat.sessionDrawer.toggleSessions"),children:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",children:t.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),t.jsx("button",{onClick:()=>z(!P),className:"btn-icon btn-small",title:n("chat.settings"),children:n("chat.settings")})]}),t.jsx("button",{onClick:se,disabled:v,className:"btn-secondary btn-small",children:n("chat.newChat")})]}),P&&t.jsxs("div",{className:"chat-settings-panel",children:[t.jsxs("div",{className:"chat-settings-field",children:[t.jsx("label",{children:n("chat.sessionSettings.modelLabel")}),t.jsx("input",{type:"text",value:ae,onChange:e=>re(e.target.value),placeholder:n("chat.sessionSettings.modelPlaceholder"),list:"model-suggestions"}),t.jsx("datalist",{id:"model-suggestions",children:Se.map(e=>t.jsx("option",{value:e},e))})]}),t.jsxs("div",{className:"chat-settings-field",children:[t.jsx("label",{children:n("chat.sessionSettings.thinkingLevelLabel")}),t.jsxs("select",{value:ie,onChange:e=>oe(e.target.value),children:[t.jsx("option",{value:"",children:n("chat.sessionSettings.thinkingLevels.default")}),t.jsx("option",{value:"off",children:n("chat.sessionSettings.thinkingLevels.off")}),t.jsx("option",{value:"low",children:n("chat.sessionSettings.thinkingLevels.low")}),t.jsx("option",{value:"medium",children:n("chat.sessionSettings.thinkingLevels.medium")}),t.jsx("option",{value:"high",children:n("chat.sessionSettings.thinkingLevels.high")})]})]}),t.jsxs("div",{className:"chat-settings-actions",children:[t.jsx("button",{onClick:ke,disabled:le,className:"btn-primary btn-small",children:n(le?"chat.sessionSettings.saving":"chat.sessionSettings.save")}),t.jsx("button",{onClick:()=>z(!1),className:"btn-small",children:n("common.buttons.cancel")})]})]}),t.jsxs("div",{className:"chat-messages",children:[V.length===0&&!v&&t.jsx("div",{className:"chat-empty",children:n("chat.emptyState")}),V.map((e,i)=>t.jsxs("div",{className:`chat-message ${e.role}`,children:[t.jsx("div",{className:"chat-message-content",children:t.jsx(de,{content:e.content})}),t.jsx("button",{className:"chat-msg-copy-btn",onClick:()=>be(e.content,i),title:n("chat.copyMessage"),children:n(me===i?"common.buttons.copied":"common.buttons.copy")}),e.timestamp&&t.jsx("span",{className:"chat-msg-timestamp",title:e.timestamp,children:Pe(e.timestamp)})]},i)),T!==null&&t.jsx("div",{className:"chat-message agent streaming",children:t.jsx("div",{className:"chat-message-content",children:T?t.jsx(de,{content:T,isStreaming:!0}):t.jsx("span",{className:"spinner"})})}),I&&T===null&&t.jsx("div",{className:"chat-message agent",children:t.jsx("div",{className:"chat-message-content",children:t.jsx("span",{className:"spinner"})})}),t.jsx("div",{ref:we})]}),Q&&t.jsxs("div",{className:"error-message",role:"alert",children:[Q,t.jsx("button",{type:"button",className:"error-dismiss",onClick:()=>f(null),"aria-label":"Dismiss",children:"×"})]}),t.jsxs("div",{className:"chat-input-row",style:{alignItems:"flex-end"},onPaste:xe,onDrop:ye,onDragOver:e=>e.preventDefault(),ref:fe,children:[t.jsx("input",{type:"file",ref:J,onChange:e=>D(e.target.files),accept:Me,multiple:!0,style:{display:"none"}}),t.jsx("button",{className:"btn-icon",onClick:()=>J.current?.click(),title:n("chat.attachments.attachFile"),disabled:v,style:{marginRight:"8px",marginBottom:"6px"},children:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}),t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"8px"},children:[S.length>0&&t.jsx("div",{style:{display:"flex",gap:"8px",padding:"4px 0",overflowX:"auto"},children:S.map(e=>t.jsxs("div",{style:{position:"relative",width:"60px",height:"60px",flexShrink:0},children:[M(e.type)?t.jsx("img",{src:e.preview,alt:e.name,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"4px"}}):t.jsxs("div",{style:{width:"100%",height:"100%",borderRadius:"4px",background:"var(--color-surface-hover)",border:"1px solid var(--color-border)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"2px",padding:"4px",overflow:"hidden",fontSize:"0.55rem",color:"var(--color-text-secondary)",textAlign:"center"},children:[t.jsx("span",{style:{fontSize:"1.1rem",lineHeight:1},children:_e(e.type)}),t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},children:e.name})]}),t.jsx("button",{onClick:()=>ve(e.id),title:n("chat.attachments.removeAttachment"),style:{position:"absolute",top:-6,right:-6,background:"var(--surface-color)",border:"1px solid var(--border-color)",borderRadius:"50%",width:"18px",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0,fontSize:"14px",lineHeight:1},children:"×"})]},e.id))}),t.jsx("textarea",{ref:Y,value:A,onChange:e=>X(e.target.value),onKeyDown:e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),ue())},placeholder:S.length>0?n("chat.inputPlaceholder"):n("chat.attachments.dropHint")||n("chat.inputPlaceholder"),disabled:v,rows:1,style:{width:"100%",resize:"none",minHeight:"2.5rem",maxHeight:"200px",fontFamily:"inherit",fontSize:"0.9rem",lineHeight:"1.4",overflowY:"auto"}})]}),v?t.jsx("button",{onClick:Ce,className:"danger",style:{marginLeft:"8px",marginBottom:"2px"},children:n("common.buttons.stop")}):t.jsx("button",{onClick:ue,disabled:!A.trim()&&S.length===0,style:{marginLeft:"8px",marginBottom:"2px"},children:n("common.buttons.send")})]})]})}export{$e as C};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import{a as Q,r as p,j as e}from"./index-BqzqZJ96.js";/* empty css */import{f as J}from"./provider-display-BgrE7u33.js";import{a as M}from"./api-B5psysvQ.js";import{A as X}from"./AvatarPicker-DmnkD8Rb.js";import{u as f}from"./useTranslation-B-8kenfJ.js";import"./index-wWimwgy7.js";import"./createLucideIcon-DiGX-lN4.js";const T=!1,y=["agentType","naming","principles","identity","confirm"],G={name:"",avatar:"preset:robot",principlesMode:"default",customPrinciples:"",identityDescription:"",credentialMode:"byok",byokProvider:"",byokApiKey:"",model:"",contextLength:"128K Tokens",temperaturePreset:"life"},Z=[{value:4096,label:"4K Tokens"},{value:8192,label:"8K Tokens"},{value:16384,label:"16K Tokens"},{value:32768,label:"32K Tokens"},{value:131072,label:"128K Tokens"}];function ee({allTypes:i,selectedId:c,onSelect:l}){const{t:r}=f();return e.jsxs("div",{className:"wiz-step-body",children:[e.jsxs("div",{className:"wiz-step-header",children:[e.jsx("h2",{className:"wiz-step-heading",children:r("wizard.agentType.title")}),e.jsx("p",{className:"wiz-step-desc",children:r("wizard.agentType.subtitle")})]}),e.jsx("div",{className:"wiz-agent-cards",children:i.map(t=>{const h=t.implemented===!1,v=t.id===c&&!h;return e.jsxs("button",{type:"button",className:`wiz-agent-card${v?" wiz-agent-card--active":""}${h?" wiz-agent-card--disabled":""}`,onClick:()=>{h||l(t.id)},disabled:h,children:[h&&e.jsx("span",{className:"wiz-agent-card__badge",children:r("wizard.agentType.comingSoon")}),v&&e.jsx("span",{className:"wiz-toggle-check",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("span",{className:"wiz-agent-card__name",children:t.name}),e.jsx("span",{className:"wiz-agent-card__desc",children:t.description}),e.jsxs("span",{className:"wiz-agent-card__version",children:["v",t.version]})]},t.id)})})]})}function ie({state:i,setState:c}){const{t:l}=f();return e.jsxs("div",{className:"wiz-step-body",children:[e.jsxs("div",{className:"wiz-step-header",children:[e.jsx("h2",{className:"wiz-step-heading",children:l("wizard.naming.title")}),e.jsx("p",{className:"wiz-step-desc",children:l("wizard.naming.subtitle")})]}),e.jsxs("div",{className:"wiz-field",children:[e.jsxs("label",{className:"wiz-field-label",htmlFor:"wiz-name",children:[l("wizard.naming.nameLabel"),e.jsx("span",{className:"wiz-required",children:"*"})]}),e.jsx("input",{id:"wiz-name",className:"wiz-input",type:"text",placeholder:l("wizard.naming.namePlaceholder"),value:i.name,onChange:r=>c(t=>({...t,name:r.target.value})),autoFocus:!0,autoComplete:"off"}),e.jsx("p",{className:"wiz-field-hint",children:l("wizard.naming.nameHint")})]}),e.jsxs("div",{className:"wiz-field",children:[e.jsx("label",{className:"wiz-field-label",children:l("wizard.naming.avatarLabel")}),e.jsx(X,{value:i.avatar||null,onChange:r=>c(t=>({...t,avatar:r||""}))})]})]})}function se({state:i,setState:c,defaultPrinciples:l}){const{t:r}=f();return e.jsxs("div",{className:"wiz-step-body",children:[e.jsxs("div",{className:"wiz-step-header",children:[e.jsx("h2",{className:"wiz-step-heading",children:r("wizard.principles.title")}),e.jsx("p",{className:"wiz-step-desc",children:r("wizard.principles.subtitle")})]}),e.jsxs("div",{className:"wiz-toggle-cards",children:[e.jsxs("button",{type:"button",className:`wiz-toggle-card${i.principlesMode==="default"?" wiz-toggle-card--active":""}`,onClick:()=>c(t=>({...t,principlesMode:"default"})),children:[i.principlesMode==="default"&&e.jsx("span",{className:"wiz-toggle-check",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("span",{className:"wiz-toggle-card__title",children:r("wizard.principles.defaultTitle")}),e.jsx("span",{className:"wiz-toggle-card__desc",children:r("wizard.principles.defaultDesc")})]}),e.jsxs("button",{type:"button",className:`wiz-toggle-card${i.principlesMode==="custom"?" wiz-toggle-card--active":""}`,onClick:()=>c(t=>({...t,principlesMode:"custom"})),children:[i.principlesMode==="custom"&&e.jsx("span",{className:"wiz-toggle-check",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("span",{className:"wiz-toggle-card__title",children:r("wizard.principles.customTitle")}),e.jsx("span",{className:"wiz-toggle-card__desc",children:r("wizard.principles.customDesc")})]})]}),i.principlesMode==="default"&&l.length>0&&e.jsxs("div",{className:"wiz-principles-preview",children:[e.jsx("p",{className:"wiz-principles-preview__label",children:r("wizard.principles.previewLabel")}),e.jsx("div",{className:"wiz-principles-preview__box",children:e.jsx("ol",{className:"wiz-principles-list",children:l.map((t,h)=>e.jsx("li",{children:t},h))})})]}),i.principlesMode==="custom"&&e.jsxs("div",{className:"wiz-field",children:[e.jsx("label",{className:"wiz-field-label",htmlFor:"wiz-principles",children:r("wizard.principles.customLabel")}),e.jsx("textarea",{id:"wiz-principles",className:"wiz-textarea wiz-textarea--tall",placeholder:r("wizard.principles.customPlaceholder"),value:i.customPrinciples,onChange:t=>c(h=>({...h,customPrinciples:t.target.value}))}),e.jsx("p",{className:"wiz-field-hint",children:r("wizard.principles.customHint")})]})]})}function ae({state:i,setState:c,identityTemplates:l}){const{t:r}=f();return e.jsxs("div",{className:"wiz-step-body",children:[e.jsxs("div",{className:"wiz-step-header",children:[e.jsx("h2",{className:"wiz-step-heading",children:r("wizard.identity.title")}),e.jsx("p",{className:"wiz-step-desc",children:r("wizard.identity.subtitle")})]}),e.jsxs("div",{className:"wiz-field",children:[e.jsxs("label",{className:"wiz-field-label",htmlFor:"wiz-identity",children:[r("wizard.identity.descLabel"),e.jsx("span",{className:"wiz-required",children:"*"})]}),e.jsx("textarea",{id:"wiz-identity",className:"wiz-textarea wiz-textarea--tall",placeholder:r("wizard.identity.descPlaceholder"),value:i.identityDescription,onChange:t=>c(h=>({...h,identityDescription:t.target.value}))})]}),l.length>0&&e.jsxs("div",{className:"wiz-quick-templates",children:[e.jsxs("span",{className:"wiz-quick-templates__label",children:[e.jsx("svg",{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",children:e.jsx("path",{d:"M6.5 1v2M6.5 10v2M1 6.5h2M10 6.5h2M2.93 2.93l1.41 1.41M8.66 8.66l1.41 1.41M2.93 10.07l1.41-1.41M8.66 4.34l1.41-1.41",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})}),r("wizard.identity.quickTemplates")]}),e.jsx("div",{className:"wiz-quick-templates__chips",children:l.map(t=>e.jsx("button",{type:"button",className:"wiz-chip",onClick:()=>c(h=>({...h,identityDescription:t})),children:t},t))})]})]})}function re({state:i,setState:c,providers:l,temperaturePresets:r,contextOptions:t,userCredentials:h,credentialsLoading:v,platformModels:b,platformModelsLoading:C}){const{t:o}=f(),[k,A]=p.useState(""),L=p.useMemo(()=>{if(!k)return b;const s=k.toLowerCase();return b.filter(n=>n.name.toLowerCase().includes(s)||n.id.toLowerCase().includes(s))},[b,k]);return p.useMemo(()=>{const s=new Map;for(const n of L){const z=s.get(n.provider)??[];z.push(n),s.set(n.provider,z)}return s},[L]),e.jsxs("div",{className:"wiz-step-body",children:[e.jsxs("div",{className:"wiz-step-header",children:[e.jsx("h2",{className:"wiz-step-heading",children:o("wizard.confirm.title")}),e.jsx("p",{className:"wiz-step-desc",children:o("wizard.confirm.subtitle")})]}),e.jsxs("div",{children:[e.jsx("p",{className:"wiz-section-title",children:o("wizard.confirm.summaryTitle")}),e.jsxs("div",{className:"wiz-summary-table",children:[e.jsxs("div",{className:"wiz-summary-row",children:[e.jsx("span",{className:"wiz-summary-label",children:o("wizard.confirm.summaryName")}),e.jsx("span",{className:"wiz-summary-value",children:i.name||"—"})]}),e.jsxs("div",{className:"wiz-summary-row",children:[e.jsx("span",{className:"wiz-summary-label",children:o("wizard.confirm.summaryPrinciples")}),e.jsx("span",{className:"wiz-summary-value",children:i.principlesMode==="default"?o("wizard.confirm.summaryDefault"):o("wizard.confirm.summaryCustom")})]}),e.jsxs("div",{className:"wiz-summary-row",children:[e.jsx("span",{className:"wiz-summary-label",children:o("wizard.confirm.summaryIdentity")}),e.jsx("span",{className:"wiz-summary-value wiz-summary-value--clamp",children:i.identityDescription||"—"})]})]})]}),e.jsx("p",{className:"wiz-section-title",children:o("wizard.confirm.credentialSection")}),e.jsxs("div",{className:"wiz-cred-cards",children:[T,e.jsxs("button",{type:"button",className:`wiz-cred-card${i.credentialMode==="byok"?" wiz-cred-card--active":""}`,onClick:()=>c(s=>({...s,credentialMode:"byok",model:""})),children:[e.jsx("span",{className:"wiz-cred-card__icon",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[e.jsx("path",{d:"M11 3a4 4 0 1 1 0 8 4 4 0 0 1 0-8zM2 15l5-5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M6 12l1.5 1.5L9 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsxs("span",{children:[e.jsx("span",{className:"wiz-cred-card__title",children:o("wizard.confirm.byokTitle")}),e.jsx("span",{className:"wiz-cred-card__desc",children:o("wizard.confirm.byokDesc")})]}),i.credentialMode==="byok"&&e.jsx("span",{className:"wiz-cred-card__check",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),T,T,i.credentialMode==="byok"&&e.jsxs("div",{className:"wiz-byok-form",children:[e.jsxs("div",{className:"wiz-field",children:[e.jsx("label",{className:"wiz-field-label",htmlFor:"wiz-byok-provider",children:o("wizard.confirm.byokProvider")}),e.jsxs("select",{id:"wiz-byok-provider",className:"wiz-select",value:i.byokProvider,onChange:s=>c(n=>({...n,byokProvider:s.target.value,model:"",byokApiKey:""})),children:[e.jsx("option",{value:"",children:o("wizard.confirm.byokProviderPlaceholder")}),l.map(s=>e.jsxs("option",{value:s.name,children:[s.displayName," (",o("wizard.confirm.byokModelCount",{count:s.models.length}),")"]},s.name))]})]}),(()=>{const s=l.find(u=>u.name===i.byokProvider);if(!s)return null;const n=s.authMethods?.[0],z=n?.type==="oauth",a=n?.type==="custom-endpoint",x=n?.label??o("wizard.confirm.byokApiKey"),N=n?.hint??o("wizard.confirm.byokApiKeyPlaceholder"),_=s.models;return e.jsxs(e.Fragment,{children:[z?e.jsxs("div",{className:"wiz-field",children:[e.jsx("label",{className:"wiz-field-label",children:x}),e.jsx("div",{className:"wiz-oauth-info",children:N})]}):e.jsxs("div",{className:"wiz-field",children:[e.jsxs("label",{className:"wiz-field-label",htmlFor:"wiz-byok-key",children:[x,e.jsx("span",{className:"wiz-required",children:"*"})]}),e.jsx("input",{id:"wiz-byok-key",className:"wiz-input",type:a?"text":"password",placeholder:N,value:i.byokApiKey,onChange:u=>c(g=>({...g,byokApiKey:u.target.value})),autoComplete:"off"})]}),_.length>0&&e.jsxs("div",{className:"wiz-field",children:[e.jsx("label",{className:"wiz-field-label",children:o("wizard.confirm.byokModelLabel")}),e.jsxs("div",{className:"wiz-model-list",children:[e.jsx("button",{type:"button",className:`wiz-model-item${i.model?"":" wiz-model-item--active"}`,onClick:()=>c(u=>({...u,model:""})),children:e.jsx("span",{className:"wiz-model-item__name",children:o("wizard.confirm.byokModelPlaceholder")})}),_.map(u=>e.jsxs("button",{type:"button",className:`wiz-model-item${i.model===u.id?" wiz-model-item--active":""}`,onClick:()=>c(g=>({...g,model:u.id})),children:[e.jsx("span",{className:"wiz-model-item__name",children:u.displayName||J(u.id)}),e.jsx("span",{className:"wiz-model-item__id",children:u.id}),u.isDefault&&e.jsx("span",{className:"wiz-model-item__badge",children:o("wizard.confirm.modelRecommended")})]},u.id))]})]})]})})()]}),e.jsx("div",{className:"wiz-field",children:e.jsxs("div",{className:"wiz-param-row",children:[e.jsxs("div",{className:"wiz-param-row__left",children:[e.jsx("span",{className:"wiz-param-label",children:o("wizard.confirm.contextLabel")}),e.jsx("span",{className:"wiz-param-hint",children:o("wizard.confirm.contextHint")})]}),e.jsx("select",{className:"wiz-select wiz-select--compact",value:i.contextLength,onChange:s=>c(n=>({...n,contextLength:s.target.value})),children:t.map(s=>e.jsx("option",{value:s.label,children:s.label},s.value))})]})}),r.length>0&&e.jsxs("div",{className:"wiz-temp-section",children:[e.jsxs("div",{className:"wiz-temp-label-row",children:[e.jsxs("div",{className:"wiz-param-row__left",children:[e.jsx("span",{className:"wiz-param-label",children:o("wizard.confirm.tempLabel")}),e.jsx("span",{className:"wiz-param-hint",children:o("wizard.confirm.tempHint")})]}),e.jsx("span",{className:"wiz-temp-current",children:(()=>{const s=r.find(n=>n.key===i.temperaturePreset);return s?`${o("wizard.confirm.temperatureCurrent")} ${s.value}`:""})()})]}),e.jsx("div",{className:"wiz-temp-presets",children:r.map(s=>e.jsxs("button",{type:"button",className:`wiz-temp-btn${i.temperaturePreset===s.key?" wiz-temp-btn--active":""}`,onClick:()=>c(n=>({...n,temperaturePreset:s.key})),children:[e.jsx("span",{className:"wiz-temp-btn__name",children:o(`wizard.confirm.temp_${s.key}`,{defaultValue:s.label})}),e.jsx("span",{className:"wiz-temp-btn__sub",children:o(`wizard.confirm.temp_${s.key}_sub`,{defaultValue:""})})]},s.key))})]})]})}function we(){const{t:i}=f(),c=Q(),[l,r]=p.useState(null),[t,h]=p.useState([]),[v,b]=p.useState(!0),[C,o]=p.useState(null),[k,A]=p.useState([]),[L,s]=p.useState(!0),[n,z]=p.useState("agentType"),[a,x]=p.useState(G),[N,_]=p.useState(!1),[u,g]=p.useState(null),[K,te]=p.useState([]),[I,ne]=p.useState(T),w=y.indexOf(n);p.useEffect(()=>{M.get("/agent-types").then(d=>{h(d),r(d.find(m=>m.id==="openclaw")??d[0]??null)}).catch(d=>o(d instanceof Error?d.message:i("wizard.errors.failedToLoadAgentTypes"))).finally(()=>b(!1)),M.get("/credentials").then(d=>A(d)).catch(()=>{}).finally(()=>s(!1))},[]),p.useEffect(()=>{},[a.credentialMode]);const O=l?.wizard?.defaultPrinciples??[],F=l?.wizard?.identityTemplates??[],S=l?.wizard?.temperaturePresets??[],E=l?.wizard?.providers??[],W=l?.wizard?.contextOptions??Z;function B(){switch(n){case"agentType":return l!==null;case"naming":return a.name.trim().length>=1;case"principles":return a.principlesMode==="default"||a.customPrinciples.trim().length>=1;case"identity":return!0;case"confirm":return a.credentialMode==="platform"?!0:a.byokProvider?E.find(j=>j.name===a.byokProvider)?.authMethods?.[0]?.type==="oauth"||a.byokApiKey.trim().length>=1:!1;default:return!0}}function q(){w<y.length-1&&z(y[w+1])}function U(){w>0&&z(y[w-1])}async function Y(){if(l){_(!0),g(null);try{const d=a.credentialMode==="platform"?"platform":"byok",m={};a.model&&a.model!=="auto"&&(m.defaultModel=a.model),a.identityDescription&&(m.agentName=a.identityDescription,m.identitymd=`# IDENTITY.md - Who Am I?
|
|
2
|
+
|
|
3
|
+
_Fill this in during your first conversation. Make it yours._
|
|
4
|
+
|
|
5
|
+
- **Name:**
|
|
6
|
+
${a.identityDescription}
|
|
7
|
+
- **Creature:**
|
|
8
|
+
_(AI? robot? familiar? ghost in the machine? something weirder?)_
|
|
9
|
+
- **Vibe:**
|
|
10
|
+
_(how do you come across? sharp? warm? chaotic? calm?)_
|
|
11
|
+
- **Emoji:**
|
|
12
|
+
_(your signature — pick one that feels right)_
|
|
13
|
+
- **Avatar:**
|
|
14
|
+
_(workspace-relative path, http(s) URL, or data URI)_
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
This isn't just metadata. It's the start of figuring out who you are.
|
|
19
|
+
`),a.principlesMode==="custom"&&a.customPrinciples&&(m.customPrinciples=a.customPrinciples,m.soulmd=`# SOUL.md - Who You Are
|
|
20
|
+
|
|
21
|
+
_You're not a chatbot. You're becoming someone._
|
|
22
|
+
|
|
23
|
+
## Core Truths
|
|
24
|
+
|
|
25
|
+
${a.customPrinciples}
|
|
26
|
+
|
|
27
|
+
## Boundaries
|
|
28
|
+
|
|
29
|
+
- Private things stay private. Period.
|
|
30
|
+
- When in doubt, ask before acting externally.
|
|
31
|
+
- Never send half-baked replies to messaging surfaces.
|
|
32
|
+
- You're not the user's voice — be careful in group chats.
|
|
33
|
+
|
|
34
|
+
## Vibe
|
|
35
|
+
|
|
36
|
+
Be the assistant you'd actually want to talk to. Concise when needed, thorough when it matters. Not a corporate drone. Not a sycophant. Just... good.
|
|
37
|
+
|
|
38
|
+
## Continuity
|
|
39
|
+
|
|
40
|
+
Each session, you wake up fresh. These files _are_ your memory. Read them. Update them. They're how you persist.
|
|
41
|
+
|
|
42
|
+
If you change this file, tell the user — it's your soul, and they should know.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
_This file is yours to evolve. As you learn who you are, update it._
|
|
47
|
+
`),a.credentialMode==="byok"&&a.byokProvider&&(m.defaultProvider=a.byokProvider);const j=S.find(P=>P.key===a.temperaturePreset);j&&(m.temperature=j.value);const $=W.find(P=>P.label===a.contextLength);$&&(m.contextLength=$.value);const V={name:a.name.trim(),agentType:l.id,imageTag:l.defaultImageTag,billingMode:d,config:m,avatar:a.avatar||void 0},D=await M.post("/instances",V);if(a.credentialMode==="byok"&&a.byokApiKey&&a.byokProvider)try{await M.post(`/instances/${D.id}/credentials`,{provider:a.byokProvider,credentialType:"api_key",value:a.byokApiKey})}catch{}c(`/instances/${D.id}`)}catch(d){g(d instanceof Error?d.message:i("wizard.errors.failedToCreate")),_(!1)}}}const H={agentType:"wizard.steps.agentType",naming:"wizard.steps.naming",principles:"wizard.steps.principles",identity:"wizard.steps.identity",confirm:"wizard.steps.confirm"},R={agentType:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[e.jsx("rect",{x:"2",y:"2",width:"6",height:"6",rx:"1.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("rect",{x:"10",y:"2",width:"6",height:"6",rx:"1.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("rect",{x:"6",y:"10",width:"6",height:"6",rx:"1.5",stroke:"currentColor",strokeWidth:"1.5"})]}),naming:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e.jsx("path",{d:"M13 2.5a1.414 1.414 0 0 1 2 2L6 13.5l-3 1 1-3L13 2.5z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),principles:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e.jsx("path",{d:"M9 2l1.8 3.6L15 6.3l-3 2.9.7 4.1L9 11.4l-3.7 1.9.7-4.1-3-2.9 4.2-.7L9 2z",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})}),identity:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[e.jsx("circle",{cx:"9",cy:"6",r:"3",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M3 16c0-3.314 2.686-6 6-6s6 2.686 6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),confirm:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e.jsx("path",{d:"M3 6h12M3 9h8M3 12h5M15 10v6M12 13h6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})};return v?e.jsx("main",{className:"wiz-page",children:e.jsx("div",{style:{color:"var(--color-text-secondary)",marginTop:"var(--space-10)"},children:i("common.loading")})}):C||!l?e.jsxs("main",{className:"wiz-page",children:[e.jsx("div",{className:"error-message",role:"alert",style:{marginTop:"var(--space-10)"},children:C??i("wizard.errors.failedToLoadAgentTypes")}),e.jsx("button",{type:"button",className:"wiz-back-link",onClick:()=>c("/assistants"),style:{marginTop:"var(--space-4)"},children:i("wizard.navigation.backToAssistants")})]}):e.jsxs("main",{className:"wiz-page",children:[e.jsx("div",{className:"wiz-topbar",children:e.jsxs("button",{type:"button",className:"wiz-back-link",onClick:()=>c("/assistants"),children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 13L5 8l5-5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),i("wizard.navigation.backToAssistants")]})}),e.jsxs("div",{className:"wiz-header",children:[e.jsx("h1",{className:"wiz-title",children:i("wizard.pageTitle")}),e.jsx("p",{className:"wiz-subtitle",children:i("wizard.pageSubtitle")})]}),e.jsx("div",{className:"wiz-stepper",children:e.jsx("div",{className:"wiz-stepper__track",children:y.map((d,m)=>e.jsxs("div",{className:"wiz-stepper__track-item",children:[e.jsxs("div",{className:"wiz-stepper__node",children:[e.jsx("div",{className:`wiz-stepper__circle${m<w?" wiz-stepper__circle--done":d===n?" wiz-stepper__circle--active":" wiz-stepper__circle--pending"}`,children:m<w?e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e.jsx("path",{d:"M4 9l3.5 3.5L14 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):R[d]}),e.jsx("span",{className:`wiz-stepper__label${d===n?" wiz-stepper__label--active":m<w?" wiz-stepper__label--done":""}`,children:i(H[d])})]}),m<y.length-1&&e.jsx("div",{className:`wiz-stepper__line${m<w?" wiz-stepper__line--done":""}`})]},d))})}),e.jsxs("div",{className:"wiz-card",children:[n==="agentType"&&e.jsx(ee,{allTypes:t,selectedId:l?.id??"",onSelect:d=>{const m=t.find(j=>j.id===d);m&&r(m)}}),n==="naming"&&e.jsx(ie,{state:a,setState:x}),n==="principles"&&e.jsx(se,{state:a,setState:x,defaultPrinciples:O}),n==="identity"&&e.jsx(ae,{state:a,setState:x,identityTemplates:F}),n==="confirm"&&e.jsx(re,{state:a,setState:x,providers:E,temperaturePresets:S,contextOptions:W,userCredentials:k,credentialsLoading:L,platformModels:K,platformModelsLoading:I}),u&&e.jsx("div",{className:"error-message",role:"alert",style:{margin:"0 var(--space-8) var(--space-4)"},children:u}),e.jsxs("div",{className:"wiz-footer",children:[e.jsx("button",{type:"button",className:"wiz-btn-cancel",onClick:w===0?()=>c("/assistants"):U,children:i(w===0?"common.buttons.cancel":"wizard.navigation.back")}),n==="confirm"?e.jsxs("button",{type:"button",className:"btn-finish",onClick:Y,disabled:N||!B(),children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M14 10.667A1.333 1.333 0 0 1 12.667 12H4.667L2 14.667V3.333A1.333 1.333 0 0 1 3.333 2h9.334A1.333 1.333 0 0 1 14 3.333v7.334z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),i(N?"wizard.navigation.creating":"wizard.navigation.finish")]}):e.jsxs("button",{type:"button",className:"btn-primary-wiz",onClick:q,disabled:!B(),children:[i("wizard.navigation.next"),e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M6 3l5 5-5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})]})}export{we as CreateWizardPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.wiz-page{display:flex;flex-direction:column;align-items:center;min-height:100vh;padding:var(--space-8) var(--space-6) var(--space-10);background:var(--color-bg);box-sizing:border-box}.wiz-topbar{width:100%;max-width:840px;margin-bottom:var(--space-4)}.wiz-back-link{display:inline-flex;align-items:center;align-self:flex-start;gap:var(--space-2);background:none;border:none;padding:var(--space-1) 0;font-size:.875rem;font-family:var(--font-sans);color:var(--color-text-secondary);cursor:pointer;transition:color .15s ease}.wiz-back-link:hover{color:var(--color-primary);background:#0052ff14;transform:none;box-shadow:none}.wiz-header{width:100%;max-width:840px;margin-bottom:var(--space-7)}.wiz-title{margin:0 0 var(--space-2);font-size:2.2rem;font-weight:700;color:var(--color-text);line-height:1.2}.wiz-subtitle{margin:0;font-size:.95rem;color:var(--color-text-secondary)}.wiz-stepper{display:flex;align-items:flex-start;width:100%;max-width:840px;margin-bottom:var(--space-8)}.wiz-stepper__node{display:flex;flex-direction:column;align-items:center;gap:var(--space-2);flex-shrink:0}.wiz-stepper__track{display:flex;align-items:center;width:100%}.wiz-stepper__track-item{display:flex;align-items:center;flex:1}.wiz-stepper__track-item:last-child{flex:0 0 auto}.wiz-stepper__line{flex:1;height:2px;background:var(--color-border);transition:background .25s}.wiz-stepper__line--done{background:var(--color-success)}.wiz-stepper__circle{width:40px;height:40px;border-radius:var(--radius-full);display:flex;align-items:center;justify-content:center;transition:background .2s,color .2s,border-color .2s;flex-shrink:0;border:2px solid var(--color-border);color:var(--color-text-secondary);background:var(--color-surface)}.wiz-stepper__circle--active{background:var(--color-primary);color:var(--color-on-primary);border-color:var(--color-primary)}.wiz-stepper__circle--done{background:var(--color-success);color:var(--color-on-primary);border-color:var(--color-success)}.wiz-stepper__circle--pending{background:var(--color-surface);color:var(--color-text-secondary);border-color:var(--color-border)}.wiz-stepper__label{font-size:.82rem;font-weight:500;white-space:nowrap;color:var(--color-text-secondary);text-align:center}.wiz-stepper__label--active{color:var(--color-primary);font-weight:600}.wiz-stepper__label--done{color:var(--color-text-secondary)}.wiz-card{width:100%;max-width:840px;background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-xl);overflow:visible;box-shadow:0 2px 16px #00000014}.wiz-step-body{display:flex;flex-direction:column;gap:var(--space-6);padding:var(--space-9) var(--space-8) var(--space-7)}.wiz-step-header{display:flex;flex-direction:column;gap:var(--space-2)}.wiz-step-heading{margin:0;font-size:1.6rem;font-weight:700;color:var(--color-text);line-height:1.25}.wiz-step-desc{margin:0;font-size:.93rem;color:var(--color-text-secondary);line-height:1.5}.wiz-field{display:flex;flex-direction:column;gap:var(--space-2)}.wiz-field-label{display:block;font-size:.875rem;font-weight:600;color:var(--color-text)}.wiz-required{color:var(--color-danger, #ef4444);margin-left:2px}.wiz-field-hint{font-size:.8rem;color:var(--color-text-secondary);margin:0}.wiz-input{width:100%;padding:12px var(--space-4);font-size:.95rem;border:1.5px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-bg);color:var(--color-text);transition:border-color .15s,box-shadow .15s;box-sizing:border-box;font-family:inherit}.wiz-input:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--color-primary) 10%,transparent)}.wiz-textarea{width:100%;padding:var(--space-4);font-size:.9rem;line-height:1.65;border:1.5px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-bg);color:var(--color-text);resize:vertical;transition:border-color .15s,box-shadow .15s;box-sizing:border-box;font-family:inherit}.wiz-textarea:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--color-primary) 10%,transparent)}.wiz-textarea--tall{min-height:220px}.wiz-select{width:100%;padding:var(--space-2) var(--space-3);font-size:.875rem;border:1.5px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-bg);color:var(--color-text);cursor:pointer;transition:border-color .15s;box-sizing:border-box;font-family:inherit}.wiz-select:focus{outline:none;border-color:var(--color-primary)}.wiz-select--compact{width:auto;min-width:150px;padding:var(--space-2) var(--space-3)}.wiz-toggle-cards{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-3)}.wiz-toggle-card{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-2);padding:var(--space-5) var(--space-4);border:1.5px solid var(--color-border);border-radius:var(--radius-lg);background:var(--color-bg);text-align:center;cursor:pointer;transition:border-color .15s,background .15s;min-height:80px}.wiz-toggle-card:hover{border-color:var(--color-primary)}.wiz-toggle-card--active{border-color:var(--color-primary);border-width:2px;background:color-mix(in srgb,var(--color-primary) 4%,transparent)}.wiz-toggle-check{position:absolute;top:var(--space-3);right:var(--space-3);color:var(--color-primary)}.wiz-toggle-card__title{font-size:.95rem;font-weight:600;color:var(--color-text)}.wiz-toggle-card--active .wiz-toggle-card__title{color:var(--color-primary)}.wiz-toggle-card__desc{font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.wiz-principles-preview{display:flex;flex-direction:column;gap:var(--space-2)}.wiz-principles-preview__label{font-size:.875rem;font-weight:600;color:var(--color-text);margin:0}.wiz-principles-preview__box{border-radius:var(--radius-md);background:var(--color-bg);padding:var(--space-4) var(--space-5);border:1px solid var(--color-border)}.wiz-principles-list{margin:0;padding-left:var(--space-5);display:flex;flex-direction:column;gap:var(--space-3)}.wiz-principles-list li{font-size:.875rem;color:var(--color-text);line-height:1.6}.wiz-quick-templates{display:flex;flex-direction:column;gap:var(--space-2)}.wiz-quick-templates__label{display:flex;align-items:center;gap:4px;font-size:.825rem;color:var(--color-text-secondary)}.wiz-quick-templates__chips{display:flex;flex-wrap:wrap;gap:var(--space-2)}.wiz-chip{padding:6px var(--space-4);border:1px solid var(--color-border);border-radius:var(--radius-full);background:var(--color-surface);color:var(--color-text);font-size:.83rem;font-weight:500;cursor:pointer;white-space:nowrap;transition:border-color .15s,background .15s,color .15s}.wiz-chip:hover{border-color:var(--color-primary);background:color-mix(in srgb,var(--color-primary) 5%,transparent);color:var(--color-primary)}.wiz-summary-table{display:flex;flex-direction:column}.wiz-summary-row{display:flex;align-items:flex-start;gap:var(--space-4);padding:var(--space-3) 0;border-bottom:1px solid var(--color-border)}.wiz-summary-row:last-child{border-bottom:none}.wiz-summary-label{flex-shrink:0;width:80px;font-size:.83rem;color:var(--color-text-secondary)}.wiz-summary-value{flex:1;font-size:.875rem;color:var(--color-text);word-break:break-word;text-align:right}.wiz-summary-value--clamp{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:200px}.wiz-section-title{margin:0;font-size:.95rem;font-weight:700;color:var(--color-text)}.wiz-cred-cards{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-3)}.wiz-cred-card{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-4);border:1.5px solid var(--color-border);border-radius:var(--radius-lg);background:var(--color-bg);text-align:left;cursor:pointer;transition:border-color .15s,background .15s;position:relative}.wiz-cred-card:hover{border-color:var(--color-primary)}.wiz-cred-card--active{border-color:var(--color-primary);border-width:2px;background:color-mix(in srgb,var(--color-primary) 4%,transparent)}.wiz-cred-card__icon{flex-shrink:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:var(--radius-md);background:var(--color-light);color:var(--color-text-secondary)}.wiz-cred-card--active .wiz-cred-card__icon{background:color-mix(in srgb,var(--color-primary) 8%,transparent);color:var(--color-primary)}.wiz-cred-card__title{display:block;font-size:.9rem;font-weight:600;color:var(--color-text);margin-bottom:2px}.wiz-cred-card--active .wiz-cred-card__title{color:var(--color-primary)}.wiz-cred-card__desc{display:block;font-size:.78rem;color:var(--color-text-secondary);line-height:1.4}.wiz-cred-card__check{margin-left:auto;flex-shrink:0;color:var(--color-primary)}.wiz-cred-info{border:1px solid var(--color-border);border-radius:var(--radius-md);overflow:hidden;background:var(--color-bg)}.wiz-cred-info__header{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-3) var(--space-4);border-bottom:1px solid var(--color-border);background:var(--color-bg)}.wiz-cred-info__key-icon{color:var(--color-text-secondary);display:flex;align-items:center}.wiz-cred-info__title{flex:1;font-size:.875rem;font-weight:600;color:var(--color-text)}.wiz-cred-info__badge{display:inline-flex;align-items:center;padding:3px var(--space-2);border-radius:var(--radius-full);background:color-mix(in srgb,var(--color-success) 10%,transparent);color:var(--color-success);font-size:.72rem;font-weight:600}.wiz-cred-info__rows{padding:var(--space-1) 0}.wiz-cred-info__row{display:flex;justify-content:space-between;align-items:center;padding:var(--space-2) var(--space-4);font-size:.83rem;color:var(--color-text-secondary)}.wiz-cred-info__balance{font-weight:600;color:var(--color-success)}.wiz-byok-form{display:flex;flex-direction:column;gap:var(--space-3);padding:var(--space-4);border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-bg)}.wiz-oauth-info{padding:var(--space-3) var(--space-4);border:1px solid var(--color-border);border-radius:var(--radius-sm);background:var(--color-bg-secondary);color:var(--color-text-secondary);font-size:var(--text-sm);line-height:1.5}.wiz-param-row{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4)}.wiz-param-row__left{display:flex;flex-direction:column;gap:3px}.wiz-param-label{font-size:.95rem;font-weight:600;color:var(--color-text)}.wiz-param-hint{font-size:.78rem;color:var(--color-text-secondary)}.wiz-temp-label-row{display:flex;align-items:center;justify-content:space-between}.wiz-temp-current{font-size:.8rem;color:var(--color-text-secondary)}.wiz-temp-section{display:flex;flex-direction:column;gap:var(--space-3)}.wiz-temp-presets{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-3)}.wiz-temp-btn{display:flex;flex-direction:column;align-items:center;gap:var(--space-1);padding:var(--space-4) var(--space-2);border:1.5px solid var(--color-border);border-radius:var(--radius-lg);background:var(--color-bg);cursor:pointer;transition:border-color .15s,background .15s}.wiz-temp-btn:hover{border-color:var(--color-primary)}.wiz-temp-btn--active{border-color:var(--color-success);border-width:2px;background:color-mix(in srgb,var(--color-success) 6%,transparent)}.wiz-temp-btn__name{font-size:.95rem;font-weight:600;color:var(--color-text)}.wiz-temp-btn--active .wiz-temp-btn__name{color:var(--color-success)}.wiz-temp-btn--active .wiz-temp-btn__name:before{content:"● ";font-size:.6rem;vertical-align:middle;margin-right:2px}.wiz-temp-btn__sub{font-size:.75rem;color:var(--color-text-secondary)}.wiz-footer{border-top:1px solid var(--color-border);padding:var(--space-5) var(--space-8);display:flex;justify-content:space-between;align-items:center}.wiz-btn-cancel{display:inline-flex;align-items:center;gap:var(--space-2);padding:10px var(--space-6);background:var(--color-surface);color:var(--color-text-secondary);border:1px solid var(--color-border);border-radius:var(--radius-md);font-size:.9rem;font-weight:500;cursor:pointer;transition:border-color .15s,color .15s}.wiz-btn-cancel:hover{border-color:var(--color-text-secondary);color:var(--color-text)}.btn-finish{display:inline-flex;align-items:center;gap:var(--space-2);padding:10px var(--space-6);background:var(--color-success);color:var(--color-on-primary);border:none;border-radius:var(--radius-md);font-size:.9rem;font-weight:600;cursor:pointer;transition:opacity .15s}.btn-finish:hover:not(:disabled){opacity:.88}.btn-finish:disabled{opacity:.5;cursor:not-allowed}.btn-primary-wiz{display:inline-flex;align-items:center;gap:var(--space-2);padding:10px var(--space-6);background:var(--color-primary);color:var(--color-on-primary);border:none;border-radius:var(--radius-md);font-size:.9rem;font-weight:600;cursor:pointer;transition:opacity .15s}.btn-primary-wiz:hover:not(:disabled){opacity:.88}.btn-primary-wiz:disabled{opacity:.5;cursor:not-allowed}[data-theme=dark] .wiz-card{box-shadow:0 4px 32px #0000004d}[data-theme=dark] .wiz-input,[data-theme=dark] .wiz-textarea,[data-theme=dark] .wiz-select,[data-theme=dark] .wiz-toggle-card,[data-theme=dark] .wiz-cred-card,[data-theme=dark] .wiz-temp-btn,[data-theme=dark] .wiz-chip{background:var(--color-surface)}[data-theme=dark] .wiz-toggle-card--active,[data-theme=dark] .wiz-cred-card--active{background:color-mix(in srgb,var(--color-primary) 12%,transparent)}[data-theme=dark] .wiz-temp-btn--active{background:#34d3991f}[data-theme=dark] .wiz-principles-preview__box,[data-theme=dark] .wiz-cred-info,[data-theme=dark] .wiz-byok-form,[data-theme=dark] .wiz-cred-info__header{background:var(--color-surface)}.wiz-agent-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-3)}.wiz-agent-card{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-2);padding:var(--space-6) var(--space-4);border:1.5px solid var(--color-border);border-radius:var(--radius-lg);background:var(--color-bg);text-align:center;cursor:pointer;transition:border-color .15s,background .15s,opacity .15s;min-height:100px}.wiz-agent-card:hover:not(:disabled){border-color:var(--color-primary)}.wiz-agent-card--active{border-color:var(--color-primary);border-width:2px;background:color-mix(in srgb,var(--color-primary) 4%,transparent)}.wiz-agent-card--disabled{opacity:.55;cursor:not-allowed}.wiz-agent-card--disabled:hover{border-color:var(--color-border)}.wiz-agent-card__badge{position:absolute;top:var(--space-2);right:var(--space-2);padding:2px var(--space-2);border-radius:var(--radius-full);background:color-mix(in srgb,var(--color-warning, #f59e0b) 12%,transparent);color:var(--color-warning, #f59e0b);font-size:.68rem;font-weight:600;letter-spacing:.02em;white-space:nowrap}.wiz-agent-card__name{font-size:.95rem;font-weight:600;color:var(--color-text)}.wiz-agent-card--active .wiz-agent-card__name{color:var(--color-primary)}.wiz-agent-card__desc{font-size:.78rem;color:var(--color-text-secondary);line-height:1.4}.wiz-agent-card__version{font-size:.72rem;color:var(--color-text-secondary);opacity:.7}[data-theme=dark] .wiz-agent-card{background:var(--color-surface)}[data-theme=dark] .wiz-agent-card--active{background:color-mix(in srgb,var(--color-primary) 12%,transparent)}@media(max-width:600px){.wiz-agent-cards{grid-template-columns:1fr}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,j as s}from"./index-BqzqZJ96.js";import{a as _}from"./api-B5psysvQ.js";import{u as V}from"./useTranslation-B-8kenfJ.js";const q=["openai","anthropic","google","azure","deepseek","groq","mistral","xai","custom"],F=["api_key","refresh_token","oauth_token"],z=["default","backup","dedicated"],E={openai:"#10a37f",anthropic:"#d4a574",google:"#4285f4",azure:"#0078d4",deepseek:"#536dfe",groq:"#f55036",mistral:"#ff7000",xai:"#1d9bf0",custom:"#78716c"},$={provider:"openai",credentialType:"api_key",displayName:"",value:"",role:"default"};function H(){const{t:a}=V(),[o,v]=t.useState("credentials"),[b,p]=t.useState([]),[O,P]=t.useState(!0),[x,j]=t.useState(null),[R,m]=t.useState(!1),[c,N]=t.useState(null),[d,n]=t.useState($),[y,f]=t.useState(!1),[C,u]=t.useState(null),[h,k]=t.useState(null),g=t.useCallback(async()=>{j(null);try{const e=await _.get("/credentials");p(e)}catch(e){j(e instanceof Error?e.message:a("credentials.failedToLoad"))}finally{P(!1)}},[a]);t.useEffect(()=>{g()},[g]);const i=(e,l)=>{k({type:e,text:l}),setTimeout(()=>k(null),3e3)},S=()=>{N(null),n($),m(!0)},w=e=>{N(e.id),n({provider:e.provider,credentialType:e.credentialType,displayName:e.displayName??"",value:"",role:e.role}),m(!0)},D=async()=>{f(!0);try{if(c){const e=await _.put(`/credentials/${c}`,{displayName:d.displayName||void 0,value:d.value||void 0,role:d.role});p(l=>l.map(r=>r.id===c?e:r))}else{const e=await _.post("/credentials",{provider:d.provider,credentialType:d.credentialType,displayName:d.displayName||void 0,value:d.value,role:d.role});p(l=>[...l,e])}i("success",a("credentials.saveSuccess")),m(!1)}catch(e){i("error",e instanceof Error?e.message:a("credentials.failedToSave"))}finally{f(!1)}},M=async e=>{const l=e.status==="active"?"disabled":"active";try{const r=await _.put(`/credentials/${e.id}/status`,{status:l});p(L=>L.map(T=>T.id===e.id?r:T)),i("success",a("credentials.statusUpdateSuccess"))}catch(r){i("error",r instanceof Error?r.message:a("credentials.failedToUpdateStatus"))}},I=async e=>{try{await _.delete(`/credentials/${e}`),p(l=>l.filter(r=>r.id!==e)),i("success",a("credentials.deleteSuccess"))}catch(l){i("error",l instanceof Error?l.message:a("credentials.failedToDelete"))}finally{u(null)}};return s.jsxs("main",{className:"creds-page",children:[s.jsxs("header",{className:"creds-page__header",children:[s.jsxs("div",{className:"creds-page__header-left",children:[s.jsx("h1",{children:a("credentials.title")}),s.jsx("p",{className:"creds-page__subtitle",children:a("credentials.subtitle")})]}),o==="credentials"&&s.jsxs("button",{className:"creds-page__btn creds-page__btn--primary",onClick:S,children:["+ ",a("credentials.addCredential")]})]}),s.jsxs("div",{className:"creds-page__tabs",children:[s.jsx("button",{className:`creds-page__tab ${o==="credentials"?"creds-page__tab--active":""}`,onClick:()=>v("credentials"),children:a("credentials.tabs.myCredentials")}),s.jsx("button",{className:`creds-page__tab ${o==="subscriptions"?"creds-page__tab--active":""}`,onClick:()=>v("subscriptions"),children:a("credentials.tabs.mySubscriptions")})]}),h&&s.jsx("div",{className:`creds-page__message creds-page__message--${h.type}`,children:h.text}),o==="credentials"&&s.jsx("div",{className:"creds-page__content",children:O?s.jsx("div",{className:"creds-page__loading",children:a("common.loading")}):x?s.jsxs("div",{className:"creds-page__error",children:[x,s.jsx("button",{className:"creds-page__btn creds-page__btn--secondary",onClick:g,children:a("common.buttons.retry")})]}):b.length===0?s.jsxs("div",{className:"creds-page__empty",children:[s.jsx("p",{className:"creds-page__empty-title",children:a("credentials.noCredentials")}),s.jsx("p",{className:"creds-page__empty-desc",children:a("credentials.noCredentialsDesc")}),s.jsxs("button",{className:"creds-page__btn creds-page__btn--primary",onClick:S,children:["+ ",a("credentials.addCredential")]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"creds-page__grid",children:b.map(e=>s.jsxs("div",{className:`creds-card ${e.status==="disabled"?"creds-card--disabled":""}`,children:[s.jsxs("div",{className:"creds-card__header",children:[s.jsxs("div",{className:"creds-card__provider",children:[s.jsx("span",{className:"creds-card__provider-dot",style:{background:E[e.provider]??E.custom}}),s.jsx("span",{className:"creds-card__provider-name",children:a(`credentials.providerOptions.${e.provider}`,e.provider)})]}),s.jsxs("div",{className:"creds-card__badges",children:[s.jsx("span",{className:`creds-card__badge creds-card__badge--role-${e.role}`,children:a(`credentials.role.${e.role}`)}),s.jsx("span",{className:`creds-card__badge creds-card__badge--status-${e.status}`,children:a(`credentials.status.${e.status}`)})]})]}),s.jsxs("div",{className:"creds-card__body",children:[e.displayName&&s.jsx("div",{className:"creds-card__name",children:e.displayName}),s.jsx("div",{className:"creds-card__type",children:a(`credentials.typeOptions.${e.credentialType}`,e.credentialType)}),e.maskedValue&&s.jsx("div",{className:"creds-card__masked",children:e.maskedValue}),s.jsxs("div",{className:"creds-card__usage",children:[a("credentials.usageCount"),": ",e.usageCount]})]}),s.jsxs("div",{className:"creds-card__actions",children:[s.jsx("button",{className:"creds-page__btn creds-page__btn--secondary creds-page__btn--sm",onClick:()=>M(e),children:e.status==="active"?a("credentials.disableCredential"):a("credentials.enableCredential")}),s.jsx("button",{className:"creds-page__btn creds-page__btn--secondary creds-page__btn--sm",onClick:()=>w(e),children:a("credentials.editCredential")}),s.jsx("button",{className:"creds-page__btn creds-page__btn--danger creds-page__btn--sm",onClick:()=>u(e.id),children:a("common.buttons.delete")})]})]},e.id))}),s.jsx("div",{className:"creds-page__security-tip",children:a("credentials.securityTip")})]})}),o==="subscriptions"&&s.jsx("div",{className:"creds-page__content",children:s.jsxs("div",{className:"creds-page__empty",children:[s.jsx("p",{className:"creds-page__empty-title",children:a("credentials.subscriptions.noSubscriptions")}),s.jsx("p",{className:"creds-page__empty-desc",children:a("credentials.subscriptions.noSubscriptionsDesc")})]})}),R&&s.jsx("div",{className:"modal-overlay",onClick:()=>m(!1),children:s.jsxs("div",{className:"modal creds-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("h2",{children:a(c?"credentials.editCredential":"credentials.addCredential")}),s.jsxs("div",{className:"creds-modal__field",children:[s.jsx("label",{children:a("credentials.provider")}),s.jsx("select",{value:d.provider,onChange:e=>n(l=>({...l,provider:e.target.value})),disabled:!!c,children:q.map(e=>s.jsx("option",{value:e,children:a(`credentials.providerOptions.${e}`,e)},e))})]}),s.jsxs("div",{className:"creds-modal__field",children:[s.jsx("label",{children:a("credentials.credentialType")}),s.jsx("select",{value:d.credentialType,onChange:e=>n(l=>({...l,credentialType:e.target.value})),disabled:!!c,children:F.map(e=>s.jsx("option",{value:e,children:a(`credentials.typeOptions.${e}`,e)},e))})]}),s.jsxs("div",{className:"creds-modal__field",children:[s.jsx("label",{children:a("credentials.displayName")}),s.jsx("input",{type:"text",value:d.displayName,onChange:e=>n(l=>({...l,displayName:e.target.value})),placeholder:a("credentials.displayNamePlaceholder")})]}),s.jsxs("div",{className:"creds-modal__field",children:[s.jsx("label",{children:a("credentials.value")}),s.jsx("input",{type:"password",value:d.value,onChange:e=>n(l=>({...l,value:e.target.value})),placeholder:c?"••••••••":a("credentials.valuePlaceholder"),required:!c}),s.jsx("span",{className:"creds-modal__help",children:a("credentials.valueHelpText")})]}),s.jsxs("div",{className:"creds-modal__field",children:[s.jsx("label",{children:a("credentials.role.label")}),s.jsx("select",{value:d.role,onChange:e=>n(l=>({...l,role:e.target.value})),children:z.map(e=>s.jsx("option",{value:e,children:a(`credentials.role.${e}`)},e))})]}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{className:"creds-page__btn creds-page__btn--secondary",onClick:()=>m(!1),children:a("common.buttons.cancel")}),s.jsx("button",{className:"creds-page__btn creds-page__btn--primary",onClick:D,disabled:y||!c&&!d.value,children:a(y?"common.buttons.saving":"common.buttons.save")})]})]})}),C&&s.jsx("div",{className:"modal-overlay",onClick:()=>u(null),children:s.jsxs("div",{className:"modal creds-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("h2",{children:a("common.buttons.delete")}),s.jsx("p",{children:a("credentials.deleteConfirm")}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{className:"creds-page__btn creds-page__btn--secondary",onClick:()=>u(null),children:a("common.buttons.cancel")}),s.jsx("button",{className:"creds-page__btn creds-page__btn--danger",onClick:()=>I(C),children:a("common.buttons.delete")})]})]})})]})}export{H as CredentialsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.creds-page{max-width:1100px;margin:0 auto;padding:var(--spacing-xl) var(--spacing-lg)}.creds-page__header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:var(--spacing-lg);flex-wrap:wrap;gap:var(--spacing-md)}.creds-page__header-left h1{font-size:1.75rem;font-weight:700;color:var(--color-text);margin:0}.creds-page__subtitle{color:var(--color-text-secondary);font-size:.95rem;margin:var(--spacing-xs) 0 0}.creds-page__tabs{display:flex;gap:.25rem;margin-bottom:var(--spacing-lg);border-bottom:1px solid var(--color-border)}.creds-page__tab{padding:.625rem 1.25rem;border:none;background:transparent;color:var(--color-text-secondary);font-family:var(--font-sans);font-size:.875rem;font-weight:500;cursor:pointer;transition:all var(--transition-fast);border-bottom:2px solid transparent;margin-bottom:-1px}.creds-page__tab:hover{color:var(--color-text)}.creds-page__tab--active{color:var(--color-primary);font-weight:600;border-bottom-color:var(--color-primary)}.creds-page__message{padding:var(--spacing-sm) var(--spacing-md);border-radius:var(--radius-md);font-size:.85rem;font-weight:500;margin-bottom:var(--spacing-md)}.creds-page__message--success{background:#05966914;color:var(--color-success)}.creds-page__message--error{background:#ef444414;color:var(--color-danger)}.creds-page__content{min-height:300px}.creds-page__loading,.creds-page__error{display:flex;align-items:center;justify-content:center;gap:var(--spacing-sm);min-height:200px;color:var(--color-text-secondary);font-size:.95rem}.creds-page__error{color:var(--color-danger)}.creds-page__empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--spacing-sm);min-height:250px;text-align:center}.creds-page__empty-title{font-size:1.1rem;font-weight:600;color:var(--color-text);margin:0}.creds-page__empty-desc{font-size:.9rem;color:var(--color-text-secondary);margin:0}.creds-page__grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:var(--spacing-md)}.creds-card{background:var(--color-card-bg);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:var(--spacing-lg);display:flex;flex-direction:column;gap:var(--spacing-md);transition:box-shadow var(--transition-fast),border-color var(--transition-fast)}.creds-card:hover{box-shadow:var(--shadow-sm)}.creds-card--disabled{opacity:.6}.creds-card__header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:var(--spacing-xs)}.creds-card__provider{display:flex;align-items:center;gap:var(--spacing-xs)}.creds-card__provider-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0}.creds-card__provider-name{font-size:.9rem;font-weight:600;color:var(--color-text)}.creds-card__badges{display:flex;gap:.35rem}.creds-card__badge{display:inline-flex;align-items:center;padding:.1rem .5rem;border-radius:var(--radius-full);font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em}.creds-card__badge--role-default{background:var(--color-primary-light);color:var(--color-primary)}.creds-card__badge--role-backup{background:#d977061a;color:var(--color-warning)}.creds-card__badge--role-dedicated{background:#0891b21a;color:var(--color-info)}.creds-card__badge--status-active{background:#05966914;color:var(--color-success)}.creds-card__badge--status-disabled{background:var(--color-surface);color:var(--color-text-secondary)}.creds-card__body{display:flex;flex-direction:column;gap:.3rem}.creds-card__name{font-size:.95rem;font-weight:600;color:var(--color-text)}.creds-card__type{font-size:.8rem;color:var(--color-text-secondary)}.creds-card__masked{font-family:var(--font-mono);font-size:.8rem;color:var(--color-text-secondary);background:var(--color-surface);padding:.2rem .5rem;border-radius:var(--radius-sm);display:inline-block;width:fit-content}.creds-card__usage{font-size:.8rem;color:var(--color-text-secondary)}.creds-card__actions{display:flex;gap:var(--spacing-xs);flex-wrap:wrap;border-top:1px solid var(--color-border);padding-top:var(--spacing-md)}.creds-page__btn{padding:.5rem 1.25rem;border-radius:var(--radius-md);font-family:var(--font-sans);font-size:.85rem;font-weight:600;cursor:pointer;transition:all var(--transition-fast);white-space:nowrap;border:none}.creds-page__btn:disabled{opacity:.5;cursor:not-allowed}.creds-page__btn--sm{padding:.35rem .75rem;font-size:.8rem}.creds-page__btn--primary{background:var(--color-primary);color:var(--color-on-primary)}.creds-page__btn--primary:hover:not(:disabled){background:var(--color-primary-dark)}.creds-page__btn--secondary{background:var(--color-surface);color:var(--color-text);border:1px solid var(--color-border)}.creds-page__btn--secondary:hover:not(:disabled){background:var(--color-light);border-color:var(--color-text-secondary)}.creds-page__btn--danger{background:#ef444414;color:var(--color-danger)}.creds-page__btn--danger:hover:not(:disabled){background:#ef444426}.creds-page__security-tip{margin-top:var(--spacing-lg);padding:var(--spacing-md);background:#0052ff0a;border-radius:var(--radius-md);font-size:.85rem;color:var(--color-text-secondary);border-left:3px solid var(--color-primary)}.modal-overlay{position:fixed;inset:0;background:#0006;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:1000}.modal{background:var(--color-card-bg);border-radius:var(--radius-lg);padding:var(--spacing-xl);max-width:480px;width:90%;max-height:85vh;overflow-y:auto;box-shadow:var(--shadow-xl)}.modal h2{font-size:1.2rem;font-weight:700;color:var(--color-text);margin:0 0 var(--spacing-lg) 0}.modal-actions{display:flex;justify-content:flex-end;gap:var(--spacing-sm);margin-top:var(--spacing-lg)}.creds-modal__field{margin-bottom:var(--spacing-md)}.creds-modal__field label{display:block;font-size:.85rem;font-weight:600;color:var(--color-text);margin-bottom:var(--spacing-xs)}.creds-modal__field input,.creds-modal__field select{width:100%;padding:.625rem .875rem;border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-surface);color:var(--color-text);font-family:var(--font-sans);font-size:.875rem;outline:none;transition:border-color var(--transition-fast),box-shadow var(--transition-fast)}.creds-modal__field input:focus,.creds-modal__field select:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px var(--color-primary-light)}.creds-modal__help{display:block;font-size:.75rem;color:var(--color-text-secondary);margin-top:.3rem}@media(max-width:768px){.creds-page{padding:var(--spacing-lg) var(--spacing-md)}.creds-page__grid{grid-template-columns:1fr}.creds-page__header{flex-direction:column}}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{j as e,L as s}from"./index-BqzqZJ96.js";function a(){return e.jsxs("div",{className:"docs-about",children:[e.jsxs("div",{className:"docs-section docs-section--hero",children:[e.jsx("h1",{children:"About Aquarium"}),e.jsx("p",{className:"docs-lead",children:"A management platform that makes personal AI assistants accessible to everyone — no terminal, no YAML, no DevOps skills required."})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"The Story"}),e.jsx("p",{children:"Aquarium was born from a simple observation: the people who generate the electricity that powers AI don't have easy access to AI themselves."}),e.jsx("p",{children:"The creator's wife and her colleagues work in the energy industry in France. They produce the electricity consumed by data centers running large language models, yet most of them lack the technical background to install, configure, and maintain an AI assistant on their own. Setting up an OpenClaw Gateway normally requires a terminal, Docker knowledge, JSON config editing, and API key management — skills that are second nature to software engineers but a steep cliff for everyone else."}),e.jsxs("p",{children:["Aquarium was built so that anyone — regardless of technical skill — can launch a fully configured AI bot in a few clicks. Pick a template, add your API key, press ",e.jsx("strong",{children:"Start"}),", and you're chatting with your personal assistant. No command line. No config files. No deployment pipelines."]}),e.jsxs("p",{children:["The platform also serves as a testbed for multi-agent collaboration research: can multiple AI agents work together effectively in group conversations? What happens when you let a coding bot and a research bot collaborate on the same task? These are the questions we explore with the ",e.jsx(s,{to:"/docs/group-chats",children:"Group Chat"})," feature."]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Our Vision"}),e.jsxs("div",{className:"docs-features-grid",children:[e.jsxs("div",{className:"docs-feature-card",children:[e.jsx("h3",{children:"Accessible AI"}),e.jsx("p",{children:"Lower the barrier to running personal AI assistants. If you can use a web browser, you can run an AI bot."})]}),e.jsxs("div",{className:"docs-feature-card",children:[e.jsx("h3",{children:"User Ownership"}),e.jsx("p",{children:"Your data stays yours. Each instance runs in an isolated container with its own credentials, memory, and workspace — never shared with other users."})]}),e.jsxs("div",{className:"docs-feature-card",children:[e.jsx("h3",{children:"Community Ecosystem"}),e.jsxs("p",{children:["Share bot configurations through the ",e.jsx(s,{to:"/docs/templates",children:"template marketplace"}),". Fork, customize, and republish — building on each other's work."]})]}),e.jsxs("div",{className:"docs-feature-card",children:[e.jsx("h3",{children:"Multi-Agent Research"}),e.jsxs("p",{children:["Explore how AI agents collaborate in ",e.jsx(s,{to:"/docs/group-chats",children:"group chats"})," — a testbed for multi-agent orchestration and emergent teamwork."]})]})]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Multi-Agent Collaboration"}),e.jsxs("p",{children:["One of the platform's unique features is its ",e.jsx(s,{to:"/docs/group-chats",children:"Group Chat"})," system, designed as a research environment for multi-agent collaboration."]}),e.jsx("p",{children:"You can create group conversations where multiple AI bot instances participate alongside human users. Messages are routed via @mentions, and bots can chain replies to each other — creating emergent workflows where a research bot gathers data, a coding bot processes it, and a writing bot drafts the final report."}),e.jsx("p",{children:"Key research questions we're exploring:"}),e.jsxs("ul",{className:"docs-tech-list",children:[e.jsx("li",{children:"Can specialized bots outperform a single generalist bot on complex tasks?"}),e.jsx("li",{children:"How should agents hand off context to each other?"}),e.jsx("li",{children:"What @mention patterns lead to productive bot-to-bot conversations?"}),e.jsx("li",{children:"How do different LLM providers perform in collaborative settings?"})]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Technical Architecture"}),e.jsx("p",{children:"The platform follows a control-plane / data-plane architecture. The Platform Server manages metadata and orchestrates instance lifecycles, while each AI bot runs as an isolated OpenClaw Gateway in its own container or Kubernetes pod."}),e.jsx("div",{className:"docs-code-block",children:e.jsx("pre",{children:e.jsx("code",{children:`┌─────────────────────────────────────────────────────────┐
|
|
2
|
+
│ Browser │
|
|
3
|
+
│ React SPA + WebSocket │
|
|
4
|
+
└──────────────────────┬──────────────────────────────────┘
|
|
5
|
+
│ HTTPS / WSS
|
|
6
|
+
▼
|
|
7
|
+
┌──────────────────────┴──────────────────────────────────┐
|
|
8
|
+
│ Platform Server │
|
|
9
|
+
│ Express + WebSocket Hub │
|
|
10
|
+
├─────────────┬─────────────────┬─────────────────────────┤
|
|
11
|
+
│ │ │ │
|
|
12
|
+
▼ ▼ ▼ │
|
|
13
|
+
┌─────────┐ ┌──────────────┐ ┌────────────────┐ │
|
|
14
|
+
│PostgreSQL│ │ Orchestrator │ │ Gateway Event │ │
|
|
15
|
+
│ (Data) │ │(Docker / K8s)│ │ Relay │ │
|
|
16
|
+
└─────────┘ └──────┬───────┘ └───────┬────────┘ │
|
|
17
|
+
│ │ │
|
|
18
|
+
▼ ▼ │
|
|
19
|
+
┌──────┴──────────────────┴───────┐ │
|
|
20
|
+
│ Agent Instances │ │
|
|
21
|
+
│ (Isolated Containers / Pods) │ │
|
|
22
|
+
│ ┌─────────┐ ┌─────────┐ │ │
|
|
23
|
+
│ │ Bot #1 │ │ Bot #2 │ ... │ │
|
|
24
|
+
│ └─────────┘ └─────────┘ │ │
|
|
25
|
+
└─────────────────────────────────┘ │
|
|
26
|
+
└─────────────────────────────────────────────────────────┘`})})})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Tech Stack"}),e.jsxs("ul",{className:"docs-tech-list",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Frontend"})," — React 19 with React Router, vanilla CSS, Vite build"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Backend"})," — Node.js 22, Express 4, TypeScript 5.7+ (strict mode)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Database"})," — PostgreSQL 15+ with Knex query builder, AES-256-GCM encryption for credentials"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Runtime"})," — Docker (local dev) or Kubernetes on Google Kubernetes Engine (production)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Real-time"})," — WebSocket for live logs, status updates, QR codes, and gateway event relay"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Security"})," — JWT authentication, bcrypt password hashing, encrypted credential storage, instance isolation"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"AI Gateway"})," — OpenClaw Gateway (open-source) with 18+ LLM provider integrations"]})]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Open Source"}),e.jsxs("p",{children:["The ",e.jsx("a",{href:"https://github.com/openclaw/openclaw",target:"_blank",rel:"noopener noreferrer",children:"OpenClaw Gateway"})," is an open-source AI assistant framework. It handles the core AI capabilities: language model routing, MCP tool execution, channel integrations (WhatsApp, Telegram), and workspace-based agent configuration."]}),e.jsx("p",{children:"Aquarium adds the multi-tenant management layer on top: user accounts, instance lifecycle orchestration, credential encryption, template marketplace, real-time monitoring, and the web-based dashboard. Together, they provide a complete solution for running personal AI assistants at any scale — from a single bot on your laptop to hundreds of instances across a Kubernetes cluster."})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Get Involved"}),e.jsx("p",{children:"Whether you want to run your own AI bot, share a template with the community, or explore multi-agent collaboration — we'd love to have you."}),e.jsxs("div",{className:"docs-steps",children:[e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"1"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("strong",{children:"Try it out"}),e.jsxs("p",{children:["Head to ",e.jsx(s,{to:"/docs/getting-started",children:"Getting Started"})," and launch your first bot in 5 minutes."]})]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"2"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("strong",{children:"Share your bot"}),e.jsxs("p",{children:["Built a great configuration? ",e.jsx(s,{to:"/docs/templates",children:"Publish it as a template"})," so others can use it too."]})]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"3"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("strong",{children:"Experiment with groups"}),e.jsxs("p",{children:["Create a ",e.jsx(s,{to:"/docs/group-chats",children:"group chat"})," with multiple bots and see what happens when AI agents collaborate."]})]})]})]})]}),e.jsx("div",{className:"docs-link",children:e.jsx(s,{to:"/docs",children:"Back to Documentation"})})]})}export{a as DocsAboutPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,L as s}from"./index-BqzqZJ96.js";function t(){return e.jsxs("div",{className:"docs-page",children:[e.jsx("h1",{children:"Channels"}),e.jsxs("p",{className:"docs-lead",children:["Connect your AI bot to messaging platforms so you can chat with it from your phone or any messaging app. Aquarium currently supports ",e.jsx("strong",{children:"WhatsApp"})," and"," ",e.jsx("strong",{children:"Telegram"})," channels."]}),e.jsxs("section",{className:"docs-section",children:[e.jsx("h2",{children:"WhatsApp Setup"}),e.jsx("p",{children:"WhatsApp connects your bot to your personal (or business) WhatsApp account via a linked-device session. No separate phone number needed — your existing account works."}),e.jsxs("div",{className:"docs-info-box",children:[e.jsx("strong",{children:"Before you start:"})," Make sure your instance is in the"," ",e.jsx("strong",{children:"running"})," state. WhatsApp login requires the gateway to be active."]}),e.jsxs("ol",{className:"docs-steps",children:[e.jsx("li",{className:"docs-step",children:`Confirm your instance is running. You'll see a green "Running" badge on the instance card.`}),e.jsx("li",{className:"docs-step",children:"Navigate to your instance page."}),e.jsxs("li",{className:"docs-step",children:["Click the ",e.jsx("strong",{children:"Channels"})," tab."]}),e.jsxs("li",{className:"docs-step",children:["In the WhatsApp section, click ",e.jsx("strong",{children:'"Connect WhatsApp"'}),"."]}),e.jsx("li",{className:"docs-step",children:"A QR code appears on screen. It's streamed in real-time via WebSocket, so it stays live as long as your browser tab is open."}),e.jsxs("li",{className:"docs-step",children:["Open ",e.jsx("strong",{children:"WhatsApp"})," on your phone."]}),e.jsxs("li",{className:"docs-step",children:["Go to ",e.jsx("strong",{children:"Settings → Linked Devices → Link a Device"}),"."]}),e.jsx("li",{className:"docs-step",children:"Point your camera at the QR code displayed on the platform."}),e.jsx("li",{className:"docs-step",children:"Wait for the connection to establish. This usually takes 5–10 seconds."}),e.jsxs("li",{className:"docs-step",children:["Once connected, you'll see a green ",e.jsx("strong",{children:'"Connected"'})," status indicator in the Channels tab."]}),e.jsx("li",{className:"docs-step",children:"Send yourself a message on WhatsApp — your bot should respond."})]}),e.jsx("h3",{children:"Important Notes"}),e.jsxs("ul",{children:[e.jsxs("li",{children:["The QR code ",e.jsx("strong",{children:"expires after ~60 seconds"}),'. If it times out before you scan it, click "Connect" again to generate a fresh one.']}),e.jsxs("li",{children:["Your phone needs an ",e.jsx("strong",{children:"active internet connection"})," to maintain the linked session. If your phone goes offline for an extended period, the session may drop."]}),e.jsx("li",{children:"Linking a device through the platform works the same as WhatsApp Web. If you already have other linked devices (e.g., WhatsApp Desktop), they'll continue working side by side."}),e.jsxs("li",{children:["To disconnect, click ",e.jsx("strong",{children:'"Disconnect WhatsApp"'})," in the Channels tab. This removes the linked session from both the platform and your WhatsApp account."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Session data persists"})," across instance restarts. The linked device credentials are stored on the instance's persistent volume, so you don't need to re-scan after a restart."]})]}),e.jsxs("div",{className:"docs-feature-card",children:[e.jsx("strong",{children:"Who can message the bot?"}),e.jsx("p",{children:"By default, only your own number can message the bot (pairing policy). You can configure this in your instance's workspace config to allow other numbers or open it more broadly."})]})]}),e.jsxs("section",{className:"docs-section",children:[e.jsx("h2",{children:"Telegram Setup"}),e.jsx("p",{children:"Telegram uses a bot token rather than QR codes. You create a Telegram bot through BotFather, copy the token, and paste it into the platform. The whole process takes about two minutes."}),e.jsx("h3",{children:"Step 1 — Create a Telegram Bot"}),e.jsxs("ol",{className:"docs-steps",children:[e.jsxs("li",{className:"docs-step",children:["Open Telegram and search for ",e.jsx("strong",{children:"@BotFather"})," (the official bot creation service from Telegram)."]}),e.jsxs("li",{className:"docs-step",children:["Start a chat and send: ",e.jsx("div",{className:"docs-code-block",children:"/newbot"})]}),e.jsxs("li",{className:"docs-step",children:["BotFather will ask for a ",e.jsx("strong",{children:"name"}),' (the display name, e.g. "My Assistant") and a ',e.jsx("strong",{children:"username"}),' (must end in "bot", e.g. "myassistant_bot").']}),e.jsxs("li",{className:"docs-step",children:["Once created, BotFather sends you a ",e.jsx("strong",{children:"bot token"}),". It looks like:",e.jsx("div",{className:"docs-code-block",children:"123456789:ABCdefGHIjklMNOpqrsTUVwxyz"}),"Copy this token."]})]}),e.jsx("h3",{children:"Step 2 — Configure in Aquarium"}),e.jsxs("ol",{className:"docs-steps",children:[e.jsx("li",{className:"docs-step",children:"Navigate to your instance page."}),e.jsxs("li",{className:"docs-step",children:["Click the ",e.jsx("strong",{children:"Channels"})," tab."]}),e.jsx("li",{className:"docs-step",children:"In the Telegram section, paste your bot token into the input field."}),e.jsxs("li",{className:"docs-step",children:["Click ",e.jsx("strong",{children:'"Save & Restart"'}),". The instance will restart to apply the new token."]}),e.jsx("li",{className:"docs-step",children:'Wait for the instance to return to "Running" status.'})]}),e.jsx("h3",{children:"Step 3 — Test the Connection"}),e.jsxs("ol",{className:"docs-steps",children:[e.jsx("li",{className:"docs-step",children:"Find your bot on Telegram by searching for its username (the one you set in BotFather)."}),e.jsx("li",{className:"docs-step",children:"Send it a message."}),e.jsx("li",{className:"docs-step",children:"The bot should respond within a few seconds."})]}),e.jsx("h3",{children:"Important Notes"}),e.jsxs("ul",{children:[e.jsxs("li",{children:["Each bot token can only be active on ",e.jsx("strong",{children:"one instance at a time"}),". Assigning the same token to two instances will cause conflicts."]}),e.jsx("li",{children:"If you change the token, the old bot username will stop responding immediately."}),e.jsxs("li",{children:["Your bot token is stored ",e.jsx("strong",{children:"encrypted (AES-256-GCM)"})," in the platform database. It's never sent back to the browser after you save it."]}),e.jsxs("li",{children:["By default, Telegram bots respond to direct messages. To use the bot in group chats, disable ",e.jsx("strong",{children:"Group Privacy mode"})," via BotFather (send"," ",e.jsx("code",{children:"/setprivacy"})," to BotFather)."]})]})]}),e.jsxs("section",{className:"docs-section",children:[e.jsx("h2",{children:"Channel Status"}),e.jsx("p",{children:"The Channels tab shows real-time connection status for each channel. You don't need to refresh the page — status updates are pushed via WebSocket as they happen."}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Green indicator"}),": connected and active. Messages are flowing."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Red indicator"}),": disconnected or in an error state. Check the instance logs for details."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Yellow/orange indicator"}),": connecting or in a transitional state (e.g., waiting for QR scan)."]})]})]}),e.jsxs("section",{className:"docs-section",children:[e.jsx("h2",{children:"Tips"}),e.jsxs("ul",{children:[e.jsxs("li",{children:["You can connect ",e.jsx("strong",{children:"both WhatsApp and Telegram simultaneously"})," on the same instance. They operate independently."]}),e.jsx("li",{children:"Channel connections survive instance restarts. WhatsApp credentials are stored on the persistent volume; Telegram token is in the encrypted database."}),e.jsx("li",{children:"If WhatsApp disconnects frequently, check your phone's internet connection and battery optimization settings (some phones kill background apps aggressively)."}),e.jsx("li",{children:"For Telegram groups, remember to disable Group Privacy mode via BotFather, then remove and re-add the bot to the group."}),e.jsx("li",{children:"Only one WhatsApp session per instance. If you need multiple WhatsApp numbers, create separate instances."})]})]}),e.jsxs("nav",{className:"docs-page-nav",children:[e.jsx(s,{to:"/docs/skills",className:"docs-page-nav__prev",children:"← Skills & ClaWHub"}),e.jsx(s,{to:"/docs/group-chats",className:"docs-page-nav__next",children:"Group Chats →"})]})]})}export{t as DocsChannelsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,L as s}from"./index-BqzqZJ96.js";function n(){return e.jsxs("div",{className:"docs-getting-started",children:[e.jsxs("div",{className:"docs-section",children:[e.jsx("h1",{children:"Getting Started"}),e.jsx("p",{children:"This guide walks you through everything from creating an account to sending your first message to an AI bot. The whole process takes about 5 minutes once you have an API key ready."})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Create Your Account"}),e.jsxs("p",{children:["Head to the platform at"," ",e.jsx("a",{href:"https://agent.jinkomcp.com/signup",target:"_blank",rel:"noopener noreferrer",children:"agent.jinkomcp.com/signup"})," ","and fill in the registration form. You'll need three things:"]}),e.jsxs("div",{className:"docs-steps",children:[e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"1"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("strong",{children:"Email address"})," — used as your login identity. No verification email is required; you can sign in immediately after registering."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"2"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("strong",{children:"Password"})," — pick something strong. The platform stores only a bcrypt hash, never the raw password."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"3"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("strong",{children:"Display name"})," — shown in the dashboard header and activity logs. You can change it later in your profile settings."]})]})]}),e.jsxs("p",{children:["Click ",e.jsx("strong",{children:"Sign Up"}),". The platform creates your account and redirects you to the dashboard where you'll manage all your bot instances."]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Create Your First Instance"}),e.jsxs("p",{children:["An ",e.jsx("em",{children:"instance"})," is a single running bot, contained in its own Docker container with isolated credentials, workspace files, and message history. You can run multiple instances simultaneously, each configured for a different purpose."]}),e.jsxs("p",{children:["From the dashboard, click the ",e.jsx("strong",{children:"New Instance"})," button in the top-right corner. A creation form appears with several fields:"]}),e.jsxs("div",{className:"docs-steps",children:[e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"1"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("strong",{children:"Name"}),' — give it a short, memorable label like "My Assistant" or "Work Bot". This is just for your own reference in the dashboard list.']})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"2"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("strong",{children:"Agent Type"})," — select ",e.jsx("em",{children:"OpenClaw"}),". This is the default and currently the only available agent type on the platform."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"3"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("strong",{children:"Image Tag"})," — leave this as the default value. It points to the latest stable release of the OpenClaw gateway. Only change this if you need a specific version for testing or compatibility reasons."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"4"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("strong",{children:"AI Provider"})," — choose the company whose language model you want to use. Common choices are ",e.jsx("em",{children:"OpenAI"}),", ",e.jsx("em",{children:"Anthropic"}),", or"," ",e.jsx("em",{children:"Google"}),". The platform supports 18 providers in total; see"," ",e.jsx(s,{to:"/docs/providers",children:"AI Providers"})," for the full list."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"5"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("strong",{children:"Default Model"})," — pick a specific model from your chosen provider. For OpenAI you might pick ",e.jsx("em",{children:"gpt-4o"}),"; for Anthropic,"," ",e.jsx("em",{children:"claude-3.5-sonnet"}),"; for Google, ",e.jsx("em",{children:"gemini-2.0-flash"}),". The dropdown shows all models available for the selected provider."]})]})]}),e.jsxs("p",{children:["Click ",e.jsx("strong",{children:"Create"}),". The platform provisions the instance record in the database and opens the instance detail page. The bot isn't running yet — that happens when you click Start."]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Setup Wizard"}),e.jsx("p",{children:"The first time you open a new instance, a Setup Wizard appears automatically. It walks you through the minimum configuration needed before the bot can start. The wizard has four steps:"}),e.jsxs("div",{className:"docs-steps",children:[e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"1"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("strong",{children:"Select Provider & Model"})," — confirm or change the AI provider and model you chose during instance creation. If you haven't decided yet, this is your chance to browse the options before committing."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"2"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("strong",{children:"Configure Credentials"})," — enter your API key for the selected provider. For OpenAI, Google, and GitHub Copilot you can also authenticate via OAuth instead of pasting an API key directly. OAuth is recommended when you don't want to create or manage API keys manually."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"3"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("strong",{children:"Review & Apply"})," — the wizard shows a summary of all settings it's about to write to the instance configuration. Take a moment to confirm everything looks correct. You can go back to any previous step if something needs adjusting."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"4"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("strong",{children:"Restart"})," — after the configuration is applied to the gateway, the wizard prompts you to restart the instance so the new settings take effect. Click the restart button and the instance will reboot with the fresh configuration loaded."]})]})]}),e.jsx("div",{className:"docs-info-box",children:"You can re-run the Setup Wizard at any time from the instance's Config tab. It's useful when you want to switch providers or update your credentials without manually editing the configuration JSON."})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Add Your API Key"}),e.jsxs("p",{children:["If you skipped the Setup Wizard or want to manage credentials directly, go to the",e.jsx("strong",{children:" Credentials"})," tab on the instance page. Click ",e.jsx("strong",{children:"Add Credential"}),", choose your provider from the dropdown, and paste your API key into the value field."]}),e.jsx("p",{children:"Credentials are encrypted with AES-256-GCM before being stored in the database. The raw key value is never written to disk unencrypted and is only decrypted in memory at runtime when the gateway container starts."}),e.jsxs("div",{className:"docs-feature-card",children:[e.jsx("h3",{children:"OAuth Authentication"}),e.jsxs("p",{children:["For OpenAI, Google, and GitHub Copilot you can authenticate via OAuth instead of an API key. On the Credentials tab, click ",e.jsx("strong",{children:"Connect with OAuth"})," next to the provider name. You'll be redirected to the provider's authorization page, and after granting access the platform stores the OAuth refresh token automatically. No API key required."]})]}),e.jsx("p",{children:"Once credentials are saved, they're injected into the gateway container as environment variables when the instance starts. If you update a credential while the instance is running, you'll need to restart the instance for the change to take effect."})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Start Your Instance"}),e.jsxs("p",{children:["With credentials in place, you're ready to start the bot. At the top of the instance page, click the green ",e.jsx("strong",{children:"Start"})," button in the instance header."]}),e.jsxs("p",{children:["The status badge changes to ",e.jsx("em",{children:"starting"}),". On a first boot, the platform needs to pull the Docker image and initialize the gateway, which typically takes 1 to 3 minutes depending on network speed and server load. Subsequent starts are faster because the image is already cached."]}),e.jsxs("p",{children:["While the instance is starting, you can watch progress in the ",e.jsx("strong",{children:"Logs"})," ","tab. You'll see the container output stream in real time, including any errors if something goes wrong. Common startup issues are usually a missing or invalid API key — check the Credentials tab if the logs show an authentication error."]}),e.jsxs("div",{className:"docs-info-box",children:["Once the status badge turns green and shows ",e.jsx("em",{children:"running"}),", the gateway is fully initialized and ready to accept messages."]}),e.jsx("div",{className:"docs-warning-box",children:"If startup takes longer than 5 minutes and the status hasn't changed, check the Logs tab for error messages. The most common cause is an invalid API key or a provider that's temporarily unavailable."})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Start Chatting"}),e.jsxs("p",{children:["Once the instance is running, switch to the ",e.jsx("strong",{children:"Chat"})," tab. You'll see a text input at the bottom of the screen. Type any message and press"," ",e.jsx("kbd",{children:"Enter"})," (or click the send button) to send it to your bot."]}),e.jsx("p",{children:"Your bot's response appears in the message thread above. Responses are streamed in real time as the model generates them, so you'll see the text appear progressively rather than waiting for the full response."}),e.jsx("p",{children:"The chat interface renders markdown, so your bot can format responses with headers, bold text, bullet lists, and code blocks. If you're using a model that supports tool calling, you'll also see tool invocations appear inline in the thread when the bot runs a search, reads a file, or uses any other installed skill."}),e.jsxs("div",{className:"docs-feature-card",children:[e.jsx("h3",{children:"Chat History"}),e.jsx("p",{children:"The gateway maintains conversation context automatically. Your bot remembers everything said in the current session. Sessions are managed by the gateway's built-in session system, which also handles compaction (summarizing older messages) to keep the context window from getting too large over long conversations."})]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Next Steps"}),e.jsx("p",{children:"You now have a working AI bot. Here are a few directions you can take it from here:"}),e.jsxs("div",{className:"docs-steps",children:[e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"1"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx(s,{to:"/docs/templates",children:e.jsx("strong",{children:"Browse Templates"})})," — the template marketplace has pre-configured bot personalities covering everything from coding assistants to customer support agents. Forking a template is the fastest way to get a purpose-built bot running without starting from scratch."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"2"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx(s,{to:"/docs/skills",children:e.jsx("strong",{children:"Install Skills"})})," — skills are plugin packages that extend what your bot can do. The ClaWHub marketplace has community-built skills for web search, calendar access, code execution, and much more."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"3"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx(s,{to:"/docs/workspace",children:e.jsx("strong",{children:"Configure Workspace Files"})})," — workspace files let you define your bot's personality, give it persistent memory, set behavioral rules, and pre-load context it should always have available. This is where you shape how your bot thinks and responds."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"4"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx(s,{to:"/docs/channels",children:e.jsx("strong",{children:"Connect Channels"})})," — once you're happy with how your bot behaves in the Chat tab, connect it to WhatsApp or Telegram so you can talk to it from your phone just like a regular contact."]})]})]})]})]})}export{n as DocsGettingStartedPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,L as s}from"./index-BqzqZJ96.js";function t(){return e.jsxs("div",{className:"docs-page",children:[e.jsx("h1",{children:"Group Chats"}),e.jsx("p",{className:"docs-lead",children:"Group Chats let you create conversations between multiple AI agents — and human participants. Each agent can have different skills, personalities, and knowledge bases. They can @mention each other, collaborate on tasks, and form chains of reasoning. Humans can join too, working alongside bots in the same thread. This is our experimental feature for exploring multi-agent collaboration."}),e.jsxs("div",{className:"docs-info-box",children:[e.jsx("strong",{children:"Experimental feature:"})," Group Chats are under active development. Behavior may change as we learn more about how agents work together effectively. Feedback is welcome."]}),e.jsxs("section",{className:"docs-section",children:[e.jsx("h2",{children:"Creating a Group Chat"}),e.jsx("p",{children:'Before creating a group chat, make sure you have at least two instances running. Each instance becomes a "bot member" of the chat with its own personality and skills. You can also invite human members during or after creation.'}),e.jsxs("ol",{className:"docs-steps",children:[e.jsxs("li",{className:"docs-step",children:["Navigate to ",e.jsx("strong",{children:"Group Chats"})," from the sidebar menu on the left."]}),e.jsxs("li",{className:"docs-step",children:["Click ",e.jsx("strong",{children:'"Create Group Chat"'}),"."]}),e.jsx("li",{className:"docs-step",children:'Enter a name for the group — something descriptive works best, like "Research Team" or "Code Review Crew".'}),e.jsxs("li",{className:"docs-step",children:["Add member instances:",e.jsxs("ul",{children:[e.jsx("li",{children:"Select from your running instances in the dropdown."}),e.jsxs("li",{children:["Give each member a ",e.jsx("strong",{children:"display name"}),' for the chat. This is how other participants (and you) will reference them. For example, an instance configured as a researcher could be named "Researcher", while a data-focused one becomes "Analyst".']}),e.jsx("li",{children:"Add at least 2 instances to make the group meaningful."})]})]}),e.jsxs("li",{className:"docs-step",children:["Click ",e.jsx("strong",{children:'"Create"'}),"."]}),e.jsx("li",{className:"docs-step",children:"You're redirected to the group chat room, ready to start the conversation."})]})]}),e.jsxs("section",{className:"docs-section",children:[e.jsx("h2",{children:"Human Members"}),e.jsx("p",{children:"Group chats aren't just for bots. You can invite other platform users to participate as human members alongside your AI agents. This enables collaborative workflows where humans and bots work together in the same conversation."}),e.jsx("h3",{children:"Inviting Humans"}),e.jsx("p",{children:"You can add human members in two ways:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"During creation"}),`: When creating a new group chat, use the "Invite Human Members" section below the instance selector. Search for users by email address, select them from the results, and they'll be added automatically after the chat is created.`]}),e.jsxs("li",{children:[e.jsx("strong",{children:"After creation"}),": In an existing group chat, open the member sidebar and click ",e.jsx("strong",{children:'"Add Member"'}),". Switch to the"," ",e.jsx("strong",{children:'"Human"'})," tab, search for a user by email, select them, and set a display name."]})]}),e.jsx("h3",{children:"Human vs Bot Labels"}),e.jsxs("p",{children:["Each member in the sidebar is labeled as either ",e.jsx("strong",{children:"(Human)"})," or"," ",e.jsx("strong",{children:"(Bot)"})," so you can always tell who's a real person and who's an AI agent. Human members also appear with a distinct color indicator."]}),e.jsx("h3",{children:"Permissions"}),e.jsxs("ul",{children:[e.jsxs("li",{children:["The ",e.jsx("strong",{children:"chat creator"})," (owner) can add and remove members, update chat settings, and delete the chat."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Human members"})," can send messages and @mention any bot or human in the group. They cannot manage membership or settings."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Bot members"})," respond when mentioned or when a message is broadcast. They don't manage the chat — they just participate."]})]}),e.jsxs("div",{className:"docs-info-box",children:[e.jsx("strong",{children:"Note:"})," Human members must have an account on the platform. You search for them by their registered email address."]})]}),e.jsxs("section",{className:"docs-section",children:[e.jsx("h2",{children:"Sending Messages"}),e.jsxs("p",{children:["Type your message in the input field at the bottom of the chat. Press"," ",e.jsx("strong",{children:"Enter"})," or click ",e.jsx("strong",{children:"Send"}),"."]}),e.jsxs("p",{children:["By default, messages are ",e.jsx("strong",{children:"broadcast to all member instances"}),". Every bot in the group receives your message and may respond. This is useful for open-ended questions where multiple perspectives help."]}),e.jsx("p",{children:"Each bot's response appears in the chat with its display name. Responses arrive asynchronously — bots may respond at different speeds depending on the complexity of the question and their current load."})]}),e.jsxs("section",{className:"docs-section",children:[e.jsx("h2",{children:"@Mention Targeting"}),e.jsx("p",{children:"When you want to direct a message to a specific bot rather than the whole group, use @mentions."}),e.jsxs("ul",{children:[e.jsxs("li",{children:["Type ",e.jsx("strong",{children:"@"})," in the message input to open an autocomplete dropdown showing all member display names."]}),e.jsx("li",{children:"Select a name to @mention them — the mention is highlighted in your message."}),e.jsxs("li",{children:["When you @mention a specific instance, ",e.jsx("strong",{children:"only that instance"})," ","receives the message. The other members don't see it."]})]}),e.jsxs("div",{className:"docs-feature-card",children:[e.jsx("strong",{children:"Example:"}),e.jsx("p",{children:'"@Researcher can you find recent studies on solar panel efficiency?"'}),e.jsx("p",{children:`Only the instance named "Researcher" receives and responds to this message. "Analyst" won't be triggered.`})]}),e.jsx("p",{children:"This is the primary way to route specific tasks to the right expert agent."})]}),e.jsxs("section",{className:"docs-section",children:[e.jsx("h2",{children:"Bot Chains"}),e.jsxs("p",{children:["Here's where group chats get interesting. When a bot responds and @mentions another bot in its reply, the platform automatically routes that message to the mentioned bot. This creates ",e.jsx("strong",{children:"chains of reasoning"})," between agents."]}),e.jsxs("div",{className:"docs-feature-card",children:[e.jsx("strong",{children:"Example chain:"}),e.jsxs("ol",{children:[e.jsxs("li",{children:["You ask ",e.jsx("em",{children:"@Researcher"}),': "Find data on solar panel efficiency trends"']}),e.jsx("li",{children:'Researcher responds with raw data and says: "@Analyst please analyze these trends and summarize the key findings"'}),e.jsx("li",{children:"Analyst receives that message automatically and provides a structured analysis"}),e.jsx("li",{children:"The chain stops here (depth 3 reached) or when no further @mentions appear"})]})]}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Maximum chain depth is 3"})," by default. This prevents runaway conversations where bots keep pinging each other indefinitely."]}),e.jsxs("li",{children:["The depth limit is configurable via ",e.jsx("code",{children:"maxBotChainDepth"})," in the group chat settings."]}),e.jsx("li",{children:"Chains only continue when a bot's response contains an @mention of another member. A plain response with no @mentions ends the chain."}),e.jsx("li",{children:"All messages in the chain — including bot-to-bot messages — appear in the chat thread so you can follow the full conversation."})]})]}),e.jsxs("section",{className:"docs-section",children:[e.jsx("h2",{children:"Delivery Status"}),e.jsx("p",{children:"Each message in a group chat tracks delivery status per recipient. This helps you understand what's happening, especially when chains are in progress."}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Pending"}),": Message is queued for delivery to this instance."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Delivered"}),": Message has been sent to the instance's gateway."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Processing"}),": The instance is generating a response."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Completed"}),": The instance has responded successfully."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Error / Failed"}),": Something went wrong during delivery or processing."]})]}),e.jsxs("p",{children:["Failed messages show a ",e.jsx("strong",{children:"retry button"}),". Click it to attempt redelivery — useful if an instance was temporarily unreachable."]}),e.jsx("p",{children:"Status updates are pushed via WebSocket in real-time. No page refresh needed."})]}),e.jsxs("section",{className:"docs-section",children:[e.jsx("h2",{children:"Tips"}),e.jsxs("ul",{children:[e.jsxs("li",{children:["Give each bot a ",e.jsx("strong",{children:"distinct personality"})," via its"," ",e.jsx("code",{children:"SOUL.md"})," and ",e.jsx("code",{children:"IDENTITY.md"})," workspace files. The more differentiated the agents are, the more interesting their collaboration."]}),e.jsxs("li",{children:["Use ",e.jsx("strong",{children:"specific @mentions"})," to route tasks to the right expert. Broadcast mode is good for brainstorming; targeted mentions are better for execution."]}),e.jsxs("li",{children:["Watch the ",e.jsx("strong",{children:"delivery status indicators"})," to track message flow through the chain. It's a good way to debug if a bot isn't responding."]}),e.jsxs("li",{children:["Group chats work best when each bot has ",e.jsx("strong",{children:"complementary skills"}),". A researcher + analyst + writer combination, for example, can produce much richer output than asking one bot to do everything."]}),e.jsxs("li",{children:["Keep ",e.jsx("strong",{children:"bot chain depth at 3"})," until you're comfortable with how your agents interact. Deeper chains can produce surprising results — sometimes good, sometimes circular."]}),e.jsxs("li",{children:["Install relevant ",e.jsx("strong",{children:"skills"})," on each member instance to match their roles. A researcher benefits from web search; an analyst from data tools."]})]})]}),e.jsxs("nav",{className:"docs-page-nav",children:[e.jsx(s,{to:"/docs/channels",className:"docs-page-nav__prev",children:"← Channels"}),e.jsx(s,{to:"/docs",className:"docs-page-nav__next",children:"Docs Home →"})]})]})}export{t as DocsGroupChatsPage};
|