profclaw 0.0.1-beta.1
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/.env.example +215 -0
- package/CHANGELOG.md +49 -0
- package/CONTRIBUTING.md +119 -0
- package/Dockerfile +107 -0
- package/LICENSE +661 -0
- package/README.md +196 -0
- package/config/agents.yml +55 -0
- package/config/budget.yml +15 -0
- package/config/pricing.yml +46 -0
- package/config/settings.yml +168 -0
- package/dist/adapters/claude-code.d.ts +46 -0
- package/dist/adapters/claude-code.js +215 -0
- package/dist/adapters/index.d.ts +4 -0
- package/dist/adapters/index.js +4 -0
- package/dist/adapters/ollama.d.ts +45 -0
- package/dist/adapters/ollama.js +277 -0
- package/dist/adapters/openclaw.d.ts +60 -0
- package/dist/adapters/openclaw.js +289 -0
- package/dist/adapters/registry.d.ts +56 -0
- package/dist/adapters/registry.js +163 -0
- package/dist/agents/executor.d.ts +78 -0
- package/dist/agents/executor.js +657 -0
- package/dist/agents/index.d.ts +10 -0
- package/dist/agents/index.js +27 -0
- package/dist/agents/stop-conditions.d.ts +108 -0
- package/dist/agents/stop-conditions.js +299 -0
- package/dist/agents/types.d.ts +185 -0
- package/dist/agents/types.js +14 -0
- package/dist/ai/embedding-service.d.ts +96 -0
- package/dist/ai/embedding-service.js +333 -0
- package/dist/auth/api-tokens.d.ts +71 -0
- package/dist/auth/api-tokens.js +235 -0
- package/dist/auth/auth-service.d.ts +75 -0
- package/dist/auth/auth-service.js +557 -0
- package/dist/auth/device-identity.d.ts +96 -0
- package/dist/auth/device-identity.js +250 -0
- package/dist/auth/github-oauth.d.ts +20 -0
- package/dist/auth/github-oauth.js +59 -0
- package/dist/auth/jira-oauth.d.ts +25 -0
- package/dist/auth/jira-oauth.js +75 -0
- package/dist/auth/linear-oauth.d.ts +21 -0
- package/dist/auth/linear-oauth.js +59 -0
- package/dist/auth/middleware.d.ts +44 -0
- package/dist/auth/middleware.js +190 -0
- package/dist/auth/pairing-codes.d.ts +109 -0
- package/dist/auth/pairing-codes.js +274 -0
- package/dist/auth/password.d.ts +53 -0
- package/dist/auth/password.js +126 -0
- package/dist/auth/qr-pairing.d.ts +36 -0
- package/dist/auth/qr-pairing.js +138 -0
- package/dist/auth/slack-oauth.d.ts +31 -0
- package/dist/auth/slack-oauth.js +80 -0
- package/dist/backup/index.d.ts +50 -0
- package/dist/backup/index.js +184 -0
- package/dist/browser/adapters.d.ts +25 -0
- package/dist/browser/adapters.js +32 -0
- package/dist/browser/cli.d.ts +19 -0
- package/dist/browser/cli.js +277 -0
- package/dist/browser/compression.d.ts +32 -0
- package/dist/browser/compression.js +269 -0
- package/dist/browser/extensions.d.ts +144 -0
- package/dist/browser/extensions.js +251 -0
- package/dist/browser/index.d.ts +37 -0
- package/dist/browser/index.js +43 -0
- package/dist/browser/refs.d.ts +46 -0
- package/dist/browser/refs.js +120 -0
- package/dist/browser/search.d.ts +36 -0
- package/dist/browser/search.js +193 -0
- package/dist/browser/service.d.ts +94 -0
- package/dist/browser/service.js +358 -0
- package/dist/browser/snapshot.d.ts +19 -0
- package/dist/browser/snapshot.js +250 -0
- package/dist/browser/tools.d.ts +259 -0
- package/dist/browser/tools.js +463 -0
- package/dist/browser/types.d.ts +134 -0
- package/dist/browser/types.js +17 -0
- package/dist/chat/agentic-executor.d.ts +108 -0
- package/dist/chat/agentic-executor.js +739 -0
- package/dist/chat/api-key-detector.d.ts +41 -0
- package/dist/chat/api-key-detector.js +290 -0
- package/dist/chat/auto-reply.d.ts +90 -0
- package/dist/chat/auto-reply.js +272 -0
- package/dist/chat/conversations.d.ts +91 -0
- package/dist/chat/conversations.js +297 -0
- package/dist/chat/execution/audit.d.ts +192 -0
- package/dist/chat/execution/audit.js +323 -0
- package/dist/chat/execution/executor.d.ts +56 -0
- package/dist/chat/execution/executor.js +654 -0
- package/dist/chat/execution/guardrails.d.ts +98 -0
- package/dist/chat/execution/guardrails.js +571 -0
- package/dist/chat/execution/index.d.ts +61 -0
- package/dist/chat/execution/index.js +129 -0
- package/dist/chat/execution/model-capability.d.ts +34 -0
- package/dist/chat/execution/model-capability.js +96 -0
- package/dist/chat/execution/process-pool.d.ts +110 -0
- package/dist/chat/execution/process-pool.js +290 -0
- package/dist/chat/execution/pty.d.ts +92 -0
- package/dist/chat/execution/pty.js +285 -0
- package/dist/chat/execution/rate-limiter.d.ts +87 -0
- package/dist/chat/execution/rate-limiter.js +305 -0
- package/dist/chat/execution/registry.d.ts +54 -0
- package/dist/chat/execution/registry.js +220 -0
- package/dist/chat/execution/sandbox.d.ts +109 -0
- package/dist/chat/execution/sandbox.js +684 -0
- package/dist/chat/execution/secrets.d.ts +45 -0
- package/dist/chat/execution/secrets.js +338 -0
- package/dist/chat/execution/security.d.ts +179 -0
- package/dist/chat/execution/security.js +739 -0
- package/dist/chat/execution/self-correction.d.ts +162 -0
- package/dist/chat/execution/self-correction.js +557 -0
- package/dist/chat/execution/session-manager.d.ts +79 -0
- package/dist/chat/execution/session-manager.js +356 -0
- package/dist/chat/execution/session-spawn/config.d.ts +37 -0
- package/dist/chat/execution/session-spawn/config.js +83 -0
- package/dist/chat/execution/session-spawn/index.d.ts +10 -0
- package/dist/chat/execution/session-spawn/index.js +10 -0
- package/dist/chat/execution/session-spawn/manager.d.ts +35 -0
- package/dist/chat/execution/session-spawn/manager.js +418 -0
- package/dist/chat/execution/session-spawn/types.d.ts +117 -0
- package/dist/chat/execution/session-spawn/types.js +16 -0
- package/dist/chat/execution/smart-prompts.d.ts +34 -0
- package/dist/chat/execution/smart-prompts.js +151 -0
- package/dist/chat/execution/stream-results.d.ts +65 -0
- package/dist/chat/execution/stream-results.js +156 -0
- package/dist/chat/execution/tool-router.d.ts +76 -0
- package/dist/chat/execution/tool-router.js +296 -0
- package/dist/chat/execution/tools/agents-list.d.ts +49 -0
- package/dist/chat/execution/tools/agents-list.js +165 -0
- package/dist/chat/execution/tools/browser.d.ts +12 -0
- package/dist/chat/execution/tools/browser.js +14 -0
- package/dist/chat/execution/tools/canvas.d.ts +61 -0
- package/dist/chat/execution/tools/canvas.js +150 -0
- package/dist/chat/execution/tools/complete-task.d.ts +72 -0
- package/dist/chat/execution/tools/complete-task.js +104 -0
- package/dist/chat/execution/tools/cron-tool.d.ts +204 -0
- package/dist/chat/execution/tools/cron-tool.js +680 -0
- package/dist/chat/execution/tools/discord-actions.d.ts +120 -0
- package/dist/chat/execution/tools/discord-actions.js +361 -0
- package/dist/chat/execution/tools/exec.d.ts +43 -0
- package/dist/chat/execution/tools/exec.js +223 -0
- package/dist/chat/execution/tools/file-ops.d.ts +175 -0
- package/dist/chat/execution/tools/file-ops.js +723 -0
- package/dist/chat/execution/tools/git.d.ts +143 -0
- package/dist/chat/execution/tools/git.js +395 -0
- package/dist/chat/execution/tools/github.d.ts +42 -0
- package/dist/chat/execution/tools/github.js +184 -0
- package/dist/chat/execution/tools/glinr-ops.d.ts +202 -0
- package/dist/chat/execution/tools/glinr-ops.js +694 -0
- package/dist/chat/execution/tools/image-analyze.d.ts +29 -0
- package/dist/chat/execution/tools/image-analyze.js +127 -0
- package/dist/chat/execution/tools/index.d.ts +64 -0
- package/dist/chat/execution/tools/index.js +245 -0
- package/dist/chat/execution/tools/integrations.d.ts +109 -0
- package/dist/chat/execution/tools/integrations.js +237 -0
- package/dist/chat/execution/tools/link-understand.d.ts +34 -0
- package/dist/chat/execution/tools/link-understand.js +307 -0
- package/dist/chat/execution/tools/maintenance.d.ts +29 -0
- package/dist/chat/execution/tools/maintenance.js +105 -0
- package/dist/chat/execution/tools/memory-tools.d.ts +76 -0
- package/dist/chat/execution/tools/memory-tools.js +278 -0
- package/dist/chat/execution/tools/openai-image-gen.d.ts +51 -0
- package/dist/chat/execution/tools/openai-image-gen.js +212 -0
- package/dist/chat/execution/tools/profclaw-ops.d.ts +204 -0
- package/dist/chat/execution/tools/profclaw-ops.js +665 -0
- package/dist/chat/execution/tools/session-spawn.d.ts +146 -0
- package/dist/chat/execution/tools/session-spawn.js +544 -0
- package/dist/chat/execution/tools/session-status.d.ts +38 -0
- package/dist/chat/execution/tools/session-status.js +185 -0
- package/dist/chat/execution/tools/sessions-list.d.ts +49 -0
- package/dist/chat/execution/tools/sessions-list.js +153 -0
- package/dist/chat/execution/tools/sessions-send.d.ts +48 -0
- package/dist/chat/execution/tools/sessions-send.js +207 -0
- package/dist/chat/execution/tools/sessions-spawn.d.ts +51 -0
- package/dist/chat/execution/tools/sessions-spawn.js +137 -0
- package/dist/chat/execution/tools/slack-actions.d.ts +90 -0
- package/dist/chat/execution/tools/slack-actions.js +272 -0
- package/dist/chat/execution/tools/subagent-orchestrate.d.ts +66 -0
- package/dist/chat/execution/tools/subagent-orchestrate.js +313 -0
- package/dist/chat/execution/tools/system.d.ts +121 -0
- package/dist/chat/execution/tools/system.js +415 -0
- package/dist/chat/execution/tools/telegram-actions.d.ts +126 -0
- package/dist/chat/execution/tools/telegram-actions.js +339 -0
- package/dist/chat/execution/tools/test-run.d.ts +43 -0
- package/dist/chat/execution/tools/test-run.js +391 -0
- package/dist/chat/execution/tools/tts-speak.d.ts +39 -0
- package/dist/chat/execution/tools/tts-speak.js +199 -0
- package/dist/chat/execution/tools/web-fetch.d.ts +42 -0
- package/dist/chat/execution/tools/web-fetch.js +247 -0
- package/dist/chat/execution/tools/web-search.d.ts +53 -0
- package/dist/chat/execution/tools/web-search.js +130 -0
- package/dist/chat/execution/types.d.ts +337 -0
- package/dist/chat/execution/types.js +8 -0
- package/dist/chat/execution/workflows/built-in.d.ts +10 -0
- package/dist/chat/execution/workflows/built-in.js +249 -0
- package/dist/chat/execution/workflows/executor.d.ts +13 -0
- package/dist/chat/execution/workflows/executor.js +259 -0
- package/dist/chat/execution/workflows/index.d.ts +5 -0
- package/dist/chat/execution/workflows/index.js +5 -0
- package/dist/chat/execution/workflows/trigger.d.ts +15 -0
- package/dist/chat/execution/workflows/trigger.js +111 -0
- package/dist/chat/execution/workflows/types.d.ts +80 -0
- package/dist/chat/execution/workflows/types.js +2 -0
- package/dist/chat/failover/error.d.ts +73 -0
- package/dist/chat/failover/error.js +412 -0
- package/dist/chat/failover/index.d.ts +10 -0
- package/dist/chat/failover/index.js +11 -0
- package/dist/chat/failover/model-fallback.d.ts +97 -0
- package/dist/chat/failover/model-fallback.js +328 -0
- package/dist/chat/failover/types.d.ts +47 -0
- package/dist/chat/failover/types.js +8 -0
- package/dist/chat/format/chunk.d.ts +59 -0
- package/dist/chat/format/chunk.js +253 -0
- package/dist/chat/format/index.d.ts +7 -0
- package/dist/chat/format/index.js +7 -0
- package/dist/chat/format/tool-result-formatter.d.ts +30 -0
- package/dist/chat/format/tool-result-formatter.js +177 -0
- package/dist/chat/group.d.ts +232 -0
- package/dist/chat/group.js +311 -0
- package/dist/chat/index.d.ts +21 -0
- package/dist/chat/index.js +30 -0
- package/dist/chat/memory.d.ts +108 -0
- package/dist/chat/memory.js +343 -0
- package/dist/chat/message-handler.d.ts +38 -0
- package/dist/chat/message-handler.js +274 -0
- package/dist/chat/proactive/index.d.ts +167 -0
- package/dist/chat/proactive/index.js +721 -0
- package/dist/chat/prompt-adapter.d.ts +52 -0
- package/dist/chat/prompt-adapter.js +245 -0
- package/dist/chat/providers/dingtalk/index.d.ts +69 -0
- package/dist/chat/providers/dingtalk/index.js +225 -0
- package/dist/chat/providers/discord/index.d.ts +264 -0
- package/dist/chat/providers/discord/index.js +657 -0
- package/dist/chat/providers/feishu/index.d.ts +97 -0
- package/dist/chat/providers/feishu/index.js +362 -0
- package/dist/chat/providers/googlechat/index.d.ts +269 -0
- package/dist/chat/providers/googlechat/index.js +634 -0
- package/dist/chat/providers/imessage/index.d.ts +61 -0
- package/dist/chat/providers/imessage/index.js +166 -0
- package/dist/chat/providers/index.d.ts +76 -0
- package/dist/chat/providers/index.js +430 -0
- package/dist/chat/providers/irc/index.d.ts +101 -0
- package/dist/chat/providers/irc/index.js +557 -0
- package/dist/chat/providers/line/index.d.ts +113 -0
- package/dist/chat/providers/line/index.js +434 -0
- package/dist/chat/providers/matrix/index.d.ts +161 -0
- package/dist/chat/providers/matrix/index.js +559 -0
- package/dist/chat/providers/mattermost/index.d.ts +106 -0
- package/dist/chat/providers/mattermost/index.js +425 -0
- package/dist/chat/providers/msteams/index.d.ts +198 -0
- package/dist/chat/providers/msteams/index.js +694 -0
- package/dist/chat/providers/nextcloud/index.d.ts +52 -0
- package/dist/chat/providers/nextcloud/index.js +156 -0
- package/dist/chat/providers/nostr/index.d.ts +60 -0
- package/dist/chat/providers/nostr/index.js +200 -0
- package/dist/chat/providers/qq/index.d.ts +57 -0
- package/dist/chat/providers/qq/index.js +260 -0
- package/dist/chat/providers/registry.d.ts +89 -0
- package/dist/chat/providers/registry.js +213 -0
- package/dist/chat/providers/signal/index.d.ts +88 -0
- package/dist/chat/providers/signal/index.js +357 -0
- package/dist/chat/providers/slack/index.d.ts +52 -0
- package/dist/chat/providers/slack/index.js +477 -0
- package/dist/chat/providers/synology/index.d.ts +50 -0
- package/dist/chat/providers/synology/index.js +138 -0
- package/dist/chat/providers/telegram/index.d.ts +148 -0
- package/dist/chat/providers/telegram/index.js +492 -0
- package/dist/chat/providers/tlon/index.d.ts +44 -0
- package/dist/chat/providers/tlon/index.js +243 -0
- package/dist/chat/providers/twitch/index.d.ts +79 -0
- package/dist/chat/providers/twitch/index.js +349 -0
- package/dist/chat/providers/types.d.ts +437 -0
- package/dist/chat/providers/types.js +14 -0
- package/dist/chat/providers/webchat/index.d.ts +38 -0
- package/dist/chat/providers/webchat/index.js +214 -0
- package/dist/chat/providers/wecom/index.d.ts +62 -0
- package/dist/chat/providers/wecom/index.js +228 -0
- package/dist/chat/providers/whatsapp/index.d.ts +147 -0
- package/dist/chat/providers/whatsapp/index.js +396 -0
- package/dist/chat/providers/zalo/index.d.ts +54 -0
- package/dist/chat/providers/zalo/index.js +158 -0
- package/dist/chat/providers/zalo-personal/index.d.ts +53 -0
- package/dist/chat/providers/zalo-personal/index.js +212 -0
- package/dist/chat/skills.d.ts +82 -0
- package/dist/chat/skills.js +410 -0
- package/dist/chat/system-prompts.d.ts +76 -0
- package/dist/chat/system-prompts.js +407 -0
- package/dist/chat/tool-handler.d.ts +57 -0
- package/dist/chat/tool-handler.js +336 -0
- package/dist/chat/tools.d.ts +373 -0
- package/dist/chat/tools.js +512 -0
- package/dist/cli/commands/agent.d.ts +3 -0
- package/dist/cli/commands/agent.js +108 -0
- package/dist/cli/commands/auth.d.ts +12 -0
- package/dist/cli/commands/auth.js +301 -0
- package/dist/cli/commands/browser.d.ts +3 -0
- package/dist/cli/commands/browser.js +138 -0
- package/dist/cli/commands/canvas.d.ts +3 -0
- package/dist/cli/commands/canvas.js +155 -0
- package/dist/cli/commands/channels.d.ts +3 -0
- package/dist/cli/commands/channels.js +167 -0
- package/dist/cli/commands/chat.d.ts +9 -0
- package/dist/cli/commands/chat.js +360 -0
- package/dist/cli/commands/completion.d.ts +3 -0
- package/dist/cli/commands/completion.js +170 -0
- package/dist/cli/commands/config.d.ts +3 -0
- package/dist/cli/commands/config.js +193 -0
- package/dist/cli/commands/cost.d.ts +3 -0
- package/dist/cli/commands/cost.js +134 -0
- package/dist/cli/commands/daemon.d.ts +3 -0
- package/dist/cli/commands/daemon.js +381 -0
- package/dist/cli/commands/devices.d.ts +3 -0
- package/dist/cli/commands/devices.js +150 -0
- package/dist/cli/commands/doctor.d.ts +3 -0
- package/dist/cli/commands/doctor.js +295 -0
- package/dist/cli/commands/logs.d.ts +3 -0
- package/dist/cli/commands/logs.js +139 -0
- package/dist/cli/commands/mcp.d.ts +15 -0
- package/dist/cli/commands/mcp.js +157 -0
- package/dist/cli/commands/memory.d.ts +3 -0
- package/dist/cli/commands/memory.js +170 -0
- package/dist/cli/commands/models.d.ts +3 -0
- package/dist/cli/commands/models.js +197 -0
- package/dist/cli/commands/nodes.d.ts +3 -0
- package/dist/cli/commands/nodes.js +193 -0
- package/dist/cli/commands/onboard.d.ts +13 -0
- package/dist/cli/commands/onboard.js +360 -0
- package/dist/cli/commands/plugin.d.ts +15 -0
- package/dist/cli/commands/plugin.js +226 -0
- package/dist/cli/commands/provider.d.ts +16 -0
- package/dist/cli/commands/provider.js +320 -0
- package/dist/cli/commands/security.d.ts +3 -0
- package/dist/cli/commands/security.js +180 -0
- package/dist/cli/commands/serve.d.ts +3 -0
- package/dist/cli/commands/serve.js +179 -0
- package/dist/cli/commands/session.d.ts +3 -0
- package/dist/cli/commands/session.js +172 -0
- package/dist/cli/commands/setup.d.ts +13 -0
- package/dist/cli/commands/setup.js +636 -0
- package/dist/cli/commands/skill.d.ts +15 -0
- package/dist/cli/commands/skill.js +191 -0
- package/dist/cli/commands/status.d.ts +3 -0
- package/dist/cli/commands/status.js +71 -0
- package/dist/cli/commands/summary.d.ts +3 -0
- package/dist/cli/commands/summary.js +160 -0
- package/dist/cli/commands/task.d.ts +3 -0
- package/dist/cli/commands/task.js +170 -0
- package/dist/cli/commands/ticket.d.ts +3 -0
- package/dist/cli/commands/ticket.js +421 -0
- package/dist/cli/commands/tools.d.ts +9 -0
- package/dist/cli/commands/tools.js +508 -0
- package/dist/cli/commands/tui.d.ts +3 -0
- package/dist/cli/commands/tui.js +158 -0
- package/dist/cli/commands/tunnel.d.ts +3 -0
- package/dist/cli/commands/tunnel.js +135 -0
- package/dist/cli/commands/webhooks.d.ts +3 -0
- package/dist/cli/commands/webhooks.js +191 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.js +127 -0
- package/dist/cli/utils/api.d.ts +17 -0
- package/dist/cli/utils/api.js +63 -0
- package/dist/cli/utils/config.d.ts +31 -0
- package/dist/cli/utils/config.js +81 -0
- package/dist/cli/utils/output.d.ts +58 -0
- package/dist/cli/utils/output.js +148 -0
- package/dist/core/deployment.d.ts +30 -0
- package/dist/core/deployment.js +114 -0
- package/dist/core/sandbox-config.d.ts +63 -0
- package/dist/core/sandbox-config.js +148 -0
- package/dist/costs/budget.d.ts +28 -0
- package/dist/costs/budget.js +57 -0
- package/dist/costs/persistence.d.ts +77 -0
- package/dist/costs/persistence.js +210 -0
- package/dist/costs/pricing.d.ts +16 -0
- package/dist/costs/pricing.js +39 -0
- package/dist/costs/token-tracker.d.ts +34 -0
- package/dist/costs/token-tracker.js +141 -0
- package/dist/cron/heartbeat.d.ts +23 -0
- package/dist/cron/heartbeat.js +109 -0
- package/dist/cron/index.d.ts +22 -0
- package/dist/cron/index.js +37 -0
- package/dist/cron/issue-poller.d.ts +15 -0
- package/dist/cron/issue-poller.js +174 -0
- package/dist/cron/scheduler.d.ts +315 -0
- package/dist/cron/scheduler.js +1008 -0
- package/dist/cron/stale-checker.d.ts +16 -0
- package/dist/cron/stale-checker.js +61 -0
- package/dist/cron/templates.d.ts +107 -0
- package/dist/cron/templates.js +395 -0
- package/dist/diagnostics/exporters.d.ts +21 -0
- package/dist/diagnostics/exporters.js +138 -0
- package/dist/diagnostics/index.d.ts +10 -0
- package/dist/diagnostics/index.js +9 -0
- package/dist/diagnostics/middleware.d.ts +12 -0
- package/dist/diagnostics/middleware.js +58 -0
- package/dist/diagnostics/tracer.d.ts +133 -0
- package/dist/diagnostics/tracer.js +257 -0
- package/dist/discovery/index.d.ts +8 -0
- package/dist/discovery/index.js +7 -0
- package/dist/discovery/mdns.d.ts +40 -0
- package/dist/discovery/mdns.js +249 -0
- package/dist/gateway/index.d.ts +35 -0
- package/dist/gateway/index.js +36 -0
- package/dist/gateway/router.d.ts +110 -0
- package/dist/gateway/router.js +649 -0
- package/dist/gateway/types.d.ts +275 -0
- package/dist/gateway/types.js +2 -0
- package/dist/gateway/workflows.d.ts +37 -0
- package/dist/gateway/workflows.js +748 -0
- package/dist/hooks/agent-webhook.d.ts +277 -0
- package/dist/hooks/agent-webhook.js +197 -0
- package/dist/hooks/index.d.ts +13 -0
- package/dist/hooks/index.js +15 -0
- package/dist/hooks/prompt-submit.d.ts +45 -0
- package/dist/hooks/prompt-submit.js +111 -0
- package/dist/hooks/schemas.d.ts +563 -0
- package/dist/hooks/schemas.js +108 -0
- package/dist/hooks/session-end.d.ts +25 -0
- package/dist/hooks/session-end.js +153 -0
- package/dist/hooks/tool-use.d.ts +41 -0
- package/dist/hooks/tool-use.js +201 -0
- package/dist/hooks/types.d.ts +76 -0
- package/dist/hooks/types.js +7 -0
- package/dist/integrations/cloudflare-tunnel.d.ts +78 -0
- package/dist/integrations/cloudflare-tunnel.js +268 -0
- package/dist/integrations/github-client.d.ts +27 -0
- package/dist/integrations/github-client.js +79 -0
- package/dist/integrations/github-projects.d.ts +97 -0
- package/dist/integrations/github-projects.js +433 -0
- package/dist/integrations/github-ticket-sync.d.ts +82 -0
- package/dist/integrations/github-ticket-sync.js +352 -0
- package/dist/integrations/github.d.ts +11 -0
- package/dist/integrations/github.js +241 -0
- package/dist/integrations/jira-client.d.ts +30 -0
- package/dist/integrations/jira-client.js +67 -0
- package/dist/integrations/jira.d.ts +13 -0
- package/dist/integrations/jira.js +108 -0
- package/dist/integrations/linear-client.d.ts +23 -0
- package/dist/integrations/linear-client.js +52 -0
- package/dist/integrations/linear.d.ts +15 -0
- package/dist/integrations/linear.js +312 -0
- package/dist/integrations/tailscale.d.ts +68 -0
- package/dist/integrations/tailscale.js +173 -0
- package/dist/integrations/web-search.d.ts +112 -0
- package/dist/integrations/web-search.js +287 -0
- package/dist/intelligence/index.d.ts +8 -0
- package/dist/intelligence/index.js +8 -0
- package/dist/intelligence/ollama.d.ts +50 -0
- package/dist/intelligence/ollama.js +213 -0
- package/dist/intelligence/rules.d.ts +39 -0
- package/dist/intelligence/rules.js +308 -0
- package/dist/labels/index.d.ts +93 -0
- package/dist/labels/index.js +248 -0
- package/dist/mcp/browser-tools.d.ts +10 -0
- package/dist/mcp/browser-tools.js +16 -0
- package/dist/mcp/client.d.ts +54 -0
- package/dist/mcp/client.js +153 -0
- package/dist/mcp/index.d.ts +12 -0
- package/dist/mcp/index.js +13 -0
- package/dist/mcp/server.d.ts +40 -0
- package/dist/mcp/server.js +826 -0
- package/dist/mcp/tool-adapter.d.ts +49 -0
- package/dist/mcp/tool-adapter.js +193 -0
- package/dist/memory/experience-store.d.ts +121 -0
- package/dist/memory/experience-store.js +439 -0
- package/dist/memory/index.d.ts +8 -0
- package/dist/memory/index.js +25 -0
- package/dist/memory/memory-service.d.ts +312 -0
- package/dist/memory/memory-service.js +1172 -0
- package/dist/memory/memory-watcher.d.ts +116 -0
- package/dist/memory/memory-watcher.js +239 -0
- package/dist/middleware/logging.d.ts +34 -0
- package/dist/middleware/logging.js +184 -0
- package/dist/middleware/rate-limit.d.ts +29 -0
- package/dist/middleware/rate-limit.js +91 -0
- package/dist/notifications/in-app.d.ts +28 -0
- package/dist/notifications/in-app.js +53 -0
- package/dist/notifications/index.d.ts +3 -0
- package/dist/notifications/index.js +3 -0
- package/dist/notifications/push.d.ts +74 -0
- package/dist/notifications/push.js +175 -0
- package/dist/notifications/slack.d.ts +32 -0
- package/dist/notifications/slack.js +157 -0
- package/dist/plugins/clawhub.d.ts +70 -0
- package/dist/plugins/clawhub.js +260 -0
- package/dist/plugins/loader.d.ts +23 -0
- package/dist/plugins/loader.js +140 -0
- package/dist/plugins/marketplace.d.ts +77 -0
- package/dist/plugins/marketplace.js +275 -0
- package/dist/plugins/registry.d.ts +122 -0
- package/dist/plugins/registry.js +352 -0
- package/dist/plugins/sandbox.d.ts +77 -0
- package/dist/plugins/sandbox.js +287 -0
- package/dist/plugins/scaffolder.d.ts +28 -0
- package/dist/plugins/scaffolder.js +409 -0
- package/dist/plugins/sdk.d.ts +35 -0
- package/dist/plugins/sdk.js +8 -0
- package/dist/plugins/search/brave.d.ts +9 -0
- package/dist/plugins/search/brave.js +157 -0
- package/dist/plugins/search/duckduckgo.d.ts +9 -0
- package/dist/plugins/search/duckduckgo.js +171 -0
- package/dist/plugins/search/index.d.ts +13 -0
- package/dist/plugins/search/index.js +23 -0
- package/dist/plugins/search/searxng.d.ts +9 -0
- package/dist/plugins/search/searxng.js +170 -0
- package/dist/plugins/search/serper.d.ts +9 -0
- package/dist/plugins/search/serper.js +135 -0
- package/dist/plugins/search/tavily.d.ts +9 -0
- package/dist/plugins/search/tavily.js +146 -0
- package/dist/plugins/types.d.ts +174 -0
- package/dist/plugins/types.js +8 -0
- package/dist/projects/index.d.ts +133 -0
- package/dist/projects/index.js +897 -0
- package/dist/projects/types.d.ts +444 -0
- package/dist/projects/types.js +207 -0
- package/dist/providers/adapters/anthropic.d.ts +26 -0
- package/dist/providers/adapters/anthropic.js +306 -0
- package/dist/providers/adapters/base.d.ts +53 -0
- package/dist/providers/adapters/base.js +99 -0
- package/dist/providers/adapters/ollama.d.ts +30 -0
- package/dist/providers/adapters/ollama.js +292 -0
- package/dist/providers/ai-sdk.d.ts +178 -0
- package/dist/providers/ai-sdk.js +1552 -0
- package/dist/providers/core/index.d.ts +8 -0
- package/dist/providers/core/index.js +10 -0
- package/dist/providers/core/models.d.ts +31 -0
- package/dist/providers/core/models.js +949 -0
- package/dist/providers/core/types.d.ts +117 -0
- package/dist/providers/core/types.js +83 -0
- package/dist/providers/index.d.ts +7 -0
- package/dist/providers/index.js +7 -0
- package/dist/providers/registry.d.ts +93 -0
- package/dist/providers/registry.js +228 -0
- package/dist/providers/schema-utils.d.ts +23 -0
- package/dist/providers/schema-utils.js +545 -0
- package/dist/providers/types.d.ts +609 -0
- package/dist/providers/types.js +279 -0
- package/dist/queue/failure-handler.d.ts +93 -0
- package/dist/queue/failure-handler.js +379 -0
- package/dist/queue/index.d.ts +23 -0
- package/dist/queue/index.js +86 -0
- package/dist/queue/memory-queue.d.ts +30 -0
- package/dist/queue/memory-queue.js +429 -0
- package/dist/queue/notifications.d.ts +6 -0
- package/dist/queue/notifications.js +128 -0
- package/dist/queue/task-queue.d.ts +55 -0
- package/dist/queue/task-queue.js +518 -0
- package/dist/queue/webhook-queue.d.ts +47 -0
- package/dist/queue/webhook-queue.js +158 -0
- package/dist/routes/agents.d.ts +4 -0
- package/dist/routes/agents.js +45 -0
- package/dist/routes/auth.d.ts +19 -0
- package/dist/routes/auth.js +492 -0
- package/dist/routes/backup.d.ts +6 -0
- package/dist/routes/backup.js +71 -0
- package/dist/routes/chat.d.ts +10 -0
- package/dist/routes/chat.js +1678 -0
- package/dist/routes/clawhub.d.ts +8 -0
- package/dist/routes/clawhub.js +89 -0
- package/dist/routes/costs.d.ts +4 -0
- package/dist/routes/costs.js +78 -0
- package/dist/routes/cron.d.ts +11 -0
- package/dist/routes/cron.js +708 -0
- package/dist/routes/devices.d.ts +9 -0
- package/dist/routes/devices.js +490 -0
- package/dist/routes/discord.d.ts +15 -0
- package/dist/routes/discord.js +524 -0
- package/dist/routes/dlq.d.ts +4 -0
- package/dist/routes/dlq.js +64 -0
- package/dist/routes/gateway.d.ts +4 -0
- package/dist/routes/gateway.js +253 -0
- package/dist/routes/health.d.ts +29 -0
- package/dist/routes/health.js +296 -0
- package/dist/routes/hooks.d.ts +4 -0
- package/dist/routes/hooks.js +170 -0
- package/dist/routes/import.d.ts +9 -0
- package/dist/routes/import.js +540 -0
- package/dist/routes/index.d.ts +38 -0
- package/dist/routes/index.js +39 -0
- package/dist/routes/integrations.d.ts +10 -0
- package/dist/routes/integrations.js +200 -0
- package/dist/routes/labels.d.ts +8 -0
- package/dist/routes/labels.js +240 -0
- package/dist/routes/mcp.d.ts +14 -0
- package/dist/routes/mcp.js +125 -0
- package/dist/routes/memory.d.ts +10 -0
- package/dist/routes/memory.js +622 -0
- package/dist/routes/notifications.d.ts +9 -0
- package/dist/routes/notifications.js +154 -0
- package/dist/routes/oobe.d.ts +10 -0
- package/dist/routes/oobe.js +405 -0
- package/dist/routes/openapi.d.ts +9 -0
- package/dist/routes/openapi.js +537 -0
- package/dist/routes/plugins.d.ts +8 -0
- package/dist/routes/plugins.js +108 -0
- package/dist/routes/projects.d.ts +8 -0
- package/dist/routes/projects.js +592 -0
- package/dist/routes/push.d.ts +8 -0
- package/dist/routes/push.js +75 -0
- package/dist/routes/search.d.ts +4 -0
- package/dist/routes/search.js +189 -0
- package/dist/routes/security.d.ts +10 -0
- package/dist/routes/security.js +189 -0
- package/dist/routes/settings.d.ts +4 -0
- package/dist/routes/settings.js +119 -0
- package/dist/routes/setup.d.ts +11 -0
- package/dist/routes/setup.js +525 -0
- package/dist/routes/skills.d.ts +13 -0
- package/dist/routes/skills.js +152 -0
- package/dist/routes/slack.d.ts +12 -0
- package/dist/routes/slack.js +999 -0
- package/dist/routes/states.d.ts +8 -0
- package/dist/routes/states.js +123 -0
- package/dist/routes/stats.d.ts +6 -0
- package/dist/routes/stats.js +369 -0
- package/dist/routes/summaries.d.ts +4 -0
- package/dist/routes/summaries.js +344 -0
- package/dist/routes/sync.d.ts +13 -0
- package/dist/routes/sync.js +268 -0
- package/dist/routes/tasks.d.ts +4 -0
- package/dist/routes/tasks.js +473 -0
- package/dist/routes/telegram.d.ts +14 -0
- package/dist/routes/telegram.js +420 -0
- package/dist/routes/tickets.d.ts +4 -0
- package/dist/routes/tickets.js +1090 -0
- package/dist/routes/tokens.d.ts +4 -0
- package/dist/routes/tokens.js +83 -0
- package/dist/routes/tools.d.ts +14 -0
- package/dist/routes/tools.js +790 -0
- package/dist/routes/tunnels.d.ts +8 -0
- package/dist/routes/tunnels.js +145 -0
- package/dist/routes/users.d.ts +15 -0
- package/dist/routes/users.js +998 -0
- package/dist/routes/voice.d.ts +8 -0
- package/dist/routes/voice.js +127 -0
- package/dist/routes/webchat.d.ts +11 -0
- package/dist/routes/webchat.js +173 -0
- package/dist/routes/webhook-dedup.d.ts +11 -0
- package/dist/routes/webhook-dedup.js +49 -0
- package/dist/routes/webhooks.d.ts +4 -0
- package/dist/routes/webhooks.js +71 -0
- package/dist/routes/whatsapp.d.ts +14 -0
- package/dist/routes/whatsapp.js +391 -0
- package/dist/security/audit-scanner.d.ts +32 -0
- package/dist/security/audit-scanner.js +217 -0
- package/dist/security/fs-guard.d.ts +41 -0
- package/dist/security/fs-guard.js +206 -0
- package/dist/security/prompt-guard.d.ts +47 -0
- package/dist/security/prompt-guard.js +198 -0
- package/dist/security/ssrf-guard.d.ts +38 -0
- package/dist/security/ssrf-guard.js +266 -0
- package/dist/security/types.d.ts +92 -0
- package/dist/security/types.js +8 -0
- package/dist/server/route-loader.d.ts +15 -0
- package/dist/server/route-loader.js +135 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.js +835 -0
- package/dist/settings/index.d.ts +841 -0
- package/dist/settings/index.js +451 -0
- package/dist/skills/compiler.d.ts +83 -0
- package/dist/skills/compiler.js +358 -0
- package/dist/skills/frontmatter.d.ts +33 -0
- package/dist/skills/frontmatter.js +175 -0
- package/dist/skills/index.d.ts +19 -0
- package/dist/skills/index.js +24 -0
- package/dist/skills/installer.d.ts +22 -0
- package/dist/skills/installer.js +220 -0
- package/dist/skills/loader.d.ts +72 -0
- package/dist/skills/loader.js +484 -0
- package/dist/skills/prompt-builder.d.ts +48 -0
- package/dist/skills/prompt-builder.js +135 -0
- package/dist/skills/registry.d.ts +115 -0
- package/dist/skills/registry.js +225 -0
- package/dist/skills/types.d.ts +202 -0
- package/dist/skills/types.js +24 -0
- package/dist/states/index.d.ts +64 -0
- package/dist/states/index.js +142 -0
- package/dist/storage/adapter.d.ts +146 -0
- package/dist/storage/adapter.js +2 -0
- package/dist/storage/index.d.ts +48 -0
- package/dist/storage/index.js +135 -0
- package/dist/storage/libsql.d.ts +99 -0
- package/dist/storage/libsql.js +1873 -0
- package/dist/storage/migrations.d.ts +65 -0
- package/dist/storage/migrations.js +289 -0
- package/dist/storage/schema.d.ts +10185 -0
- package/dist/storage/schema.js +1113 -0
- package/dist/summaries/extractor.d.ts +56 -0
- package/dist/summaries/extractor.js +377 -0
- package/dist/summaries/index.d.ts +13 -0
- package/dist/summaries/index.js +14 -0
- package/dist/summaries/storage.d.ts +51 -0
- package/dist/summaries/storage.js +101 -0
- package/dist/summaries/templates.d.ts +68 -0
- package/dist/summaries/templates.js +245 -0
- package/dist/sync/adapters/base.d.ts +42 -0
- package/dist/sync/adapters/base.js +142 -0
- package/dist/sync/adapters/github.d.ts +45 -0
- package/dist/sync/adapters/github.js +445 -0
- package/dist/sync/adapters/linear.d.ts +40 -0
- package/dist/sync/adapters/linear.js +434 -0
- package/dist/sync/config.d.ts +388 -0
- package/dist/sync/config.js +281 -0
- package/dist/sync/engine.d.ts +112 -0
- package/dist/sync/engine.js +623 -0
- package/dist/sync/index.d.ts +31 -0
- package/dist/sync/index.js +34 -0
- package/dist/sync/integration.d.ts +53 -0
- package/dist/sync/integration.js +231 -0
- package/dist/sync/types.d.ts +249 -0
- package/dist/sync/types.js +30 -0
- package/dist/tickets/index.d.ts +139 -0
- package/dist/tickets/index.js +1406 -0
- package/dist/tickets/types.d.ts +817 -0
- package/dist/tickets/types.js +310 -0
- package/dist/tools/adapters.d.ts +56 -0
- package/dist/tools/adapters.js +183 -0
- package/dist/tools/index.d.ts +66 -0
- package/dist/tools/index.js +105 -0
- package/dist/tools/types.d.ts +117 -0
- package/dist/tools/types.js +20 -0
- package/dist/types/agent.d.ts +101 -0
- package/dist/types/agent.js +2 -0
- package/dist/types/errors.d.ts +150 -0
- package/dist/types/errors.js +338 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +3 -0
- package/dist/types/summary.d.ts +638 -0
- package/dist/types/summary.js +137 -0
- package/dist/types/task.d.ts +123 -0
- package/dist/types/task.js +46 -0
- package/dist/utils/ai-cache.d.ts +72 -0
- package/dist/utils/ai-cache.js +204 -0
- package/dist/utils/ai-inference.d.ts +57 -0
- package/dist/utils/ai-inference.js +190 -0
- package/dist/utils/ai-responder.d.ts +44 -0
- package/dist/utils/ai-responder.js +272 -0
- package/dist/utils/circuit-breaker.d.ts +139 -0
- package/dist/utils/circuit-breaker.js +281 -0
- package/dist/utils/config-loader.d.ts +12 -0
- package/dist/utils/config-loader.js +44 -0
- package/dist/utils/crypto.d.ts +10 -0
- package/dist/utils/crypto.js +59 -0
- package/dist/utils/env-validator.d.ts +44 -0
- package/dist/utils/env-validator.js +236 -0
- package/dist/utils/file-lock.d.ts +85 -0
- package/dist/utils/file-lock.js +204 -0
- package/dist/utils/logger.d.ts +153 -0
- package/dist/utils/logger.js +282 -0
- package/dist/utils/metrics.d.ts +183 -0
- package/dist/utils/metrics.js +345 -0
- package/dist/utils/security.d.ts +90 -0
- package/dist/utils/security.js +347 -0
- package/dist/voice/index.d.ts +79 -0
- package/dist/voice/index.js +144 -0
- package/dist/voice/stt/whisper.d.ts +13 -0
- package/dist/voice/stt/whisper.js +116 -0
- package/dist/voice/tts/elevenlabs.d.ts +18 -0
- package/dist/voice/tts/elevenlabs.js +178 -0
- package/dist/voice/tts/openai-tts.d.ts +19 -0
- package/dist/voice/tts/openai-tts.js +127 -0
- package/dist/voice/tts/system.d.ts +26 -0
- package/dist/voice/tts/system.js +146 -0
- package/dist/voice/wake-word.d.ts +44 -0
- package/dist/voice/wake-word.js +145 -0
- package/docker-compose.yml +222 -0
- package/package.json +154 -0
- package/profclaw.mjs +24 -0
- package/skills/1password/SKILL.md +155 -0
- package/skills/api-tester/SKILL.md +177 -0
- package/skills/apple-notes/SKILL.md +167 -0
- package/skills/apple-reminders/SKILL.md +178 -0
- package/skills/bear-notes/SKILL.md +166 -0
- package/skills/blogwatcher/SKILL.md +177 -0
- package/skills/camsnap/SKILL.md +130 -0
- package/skills/code-generation/SKILL.md +139 -0
- package/skills/code-review/SKILL.md +116 -0
- package/skills/coding-agent/SKILL.md +184 -0
- package/skills/cron-manager/SKILL.md +141 -0
- package/skills/debug-helper/SKILL.md +134 -0
- package/skills/docker-ops/SKILL.md +246 -0
- package/skills/file-manager/SKILL.md +160 -0
- package/skills/git-workflow/SKILL.md +171 -0
- package/skills/github-issues/SKILL.md +244 -0
- package/skills/gog/SKILL.md +191 -0
- package/skills/goplaces/SKILL.md +156 -0
- package/skills/healthcheck/SKILL.md +270 -0
- package/skills/himalaya/SKILL.md +165 -0
- package/skills/mcp-discovery/SKILL.md +109 -0
- package/skills/memory-manager/SKILL.md +151 -0
- package/skills/model-usage/SKILL.md +177 -0
- package/skills/nano-banana-pro/SKILL.md +214 -0
- package/skills/nano-pdf/SKILL.md +165 -0
- package/skills/notion/SKILL.md +147 -0
- package/skills/obsidian/SKILL.md +163 -0
- package/skills/openai-image-gen/SKILL.md +194 -0
- package/skills/openai-whisper/SKILL.md +98 -0
- package/skills/openai-whisper-api/SKILL.md +130 -0
- package/skills/openhue/SKILL.md +203 -0
- package/skills/oracle/SKILL.md +236 -0
- package/skills/phone-control/SKILL.md +201 -0
- package/skills/profclaw-assistant/SKILL.md +81 -0
- package/skills/profclaw-projects/SKILL.md +68 -0
- package/skills/profclaw-tickets/SKILL.md +91 -0
- package/skills/session-logs/SKILL.md +216 -0
- package/skills/sherpa-onnx-tts/SKILL.md +134 -0
- package/skills/skill-creator/SKILL.md +183 -0
- package/skills/songsee/SKILL.md +170 -0
- package/skills/spotify-player/SKILL.md +254 -0
- package/skills/summarize/SKILL.md +155 -0
- package/skills/system-admin/SKILL.md +179 -0
- package/skills/things-mac/SKILL.md +179 -0
- package/skills/tmux/SKILL.md +170 -0
- package/skills/trello/SKILL.md +154 -0
- package/skills/video-frames/SKILL.md +127 -0
- package/skills/weather/SKILL.md +186 -0
- package/skills/web-research/SKILL.md +128 -0
- package/skills/xurl/SKILL.md +198 -0
- package/ui/README.md +73 -0
- package/ui/dist/assets/ActivityView-CkPgKhwm.js +1 -0
- package/ui/dist/assets/AgentList-C3SVdeEz.js +1 -0
- package/ui/dist/assets/AnalyticsDashboard-DVU--vlP.js +1 -0
- package/ui/dist/assets/AreaChart-B5qMEGWj.js +1 -0
- package/ui/dist/assets/CartesianChart-B50bcUJi.js +36 -0
- package/ui/dist/assets/ChatView-BZFJs7w_.js +10 -0
- package/ui/dist/assets/CostsDashboard-ChfH8BlG.js +1 -0
- package/ui/dist/assets/EstimateSelect-CLpB4NQO.js +1 -0
- package/ui/dist/assets/FloatingChatbot-CBzBY9a0.js +2 -0
- package/ui/dist/assets/InviteCodeManagement-DsbdPa6W.js +2 -0
- package/ui/dist/assets/ProjectDetail-BEM3tFXg.js +2 -0
- package/ui/dist/assets/ProjectDetail-D1-0B2xV.css +1 -0
- package/ui/dist/assets/ProjectIcon-CN1FmFAk.js +1 -0
- package/ui/dist/assets/ProjectList-DSDaNhxQ.js +4 -0
- package/ui/dist/assets/Settings-dPVcqC_d.js +6 -0
- package/ui/dist/assets/StatusIndicator-DA3NAo_b.js +1 -0
- package/ui/dist/assets/SummaryDetail-Bjnf9lT8.js +27 -0
- package/ui/dist/assets/SummaryList-ENwKDBKW.js +1 -0
- package/ui/dist/assets/TaskDetail-DnwG6MzB.js +1 -0
- package/ui/dist/assets/TaskList-D9Ug_HiV.js +1 -0
- package/ui/dist/assets/TicketBoard-CviH1571.js +1 -0
- package/ui/dist/assets/TicketDetail-8Jk8O-33.js +1 -0
- package/ui/dist/assets/TicketList-B-iV4rRA.js +1 -0
- package/ui/dist/assets/UserManagement-CPZ8s7s2.js +2 -0
- package/ui/dist/assets/ViewSwitcher-BUyOOWDI.js +1 -0
- package/ui/dist/assets/alert-dialog-BOmnTkN-.js +7 -0
- package/ui/dist/assets/archive-D5my9zOG.js +1 -0
- package/ui/dist/assets/badge-B4ov81_m.js +1 -0
- package/ui/dist/assets/brain-C53ElFLD.js +1 -0
- package/ui/dist/assets/bug-D0TJoCYn.js +1 -0
- package/ui/dist/assets/calendar-BkWIhKa1.js +1 -0
- package/ui/dist/assets/chevron-up-BRTtndUZ.js +1 -0
- package/ui/dist/assets/circle-x-BN89YhbS.js +1 -0
- package/ui/dist/assets/constants-fc7TFI7u.js +1 -0
- package/ui/dist/assets/cpu-B41x1-vV.js +1 -0
- package/ui/dist/assets/database-D9Cnfmzj.js +1 -0
- package/ui/dist/assets/defineProperty-CoXUr7_6.js +2 -0
- package/ui/dist/assets/dialog-DrWB4EYD.js +1 -0
- package/ui/dist/assets/element-adapter-DL0DQilL.js +4 -0
- package/ui/dist/assets/ellipsis-NuUWekvu.js +1 -0
- package/ui/dist/assets/ellipsis-vertical-BueMfuCw.js +1 -0
- package/ui/dist/assets/file-code-HR9829Jc.js +1 -0
- package/ui/dist/assets/folder-open-C_7oYEqe.js +1 -0
- package/ui/dist/assets/funnel-B5gmNXGf.js +1 -0
- package/ui/dist/assets/git-branch-BRMiJmV3.js +1 -0
- package/ui/dist/assets/git-commit-horizontal-CXOUQeJI.js +1 -0
- package/ui/dist/assets/globe-CCspjvus.js +1 -0
- package/ui/dist/assets/hash-g3102kPC.js +1 -0
- package/ui/dist/assets/history-CNqcBBrV.js +1 -0
- package/ui/dist/assets/index-27mTPKuh.js +1 -0
- package/ui/dist/assets/index-BMx3fH-e.js +1 -0
- package/ui/dist/assets/index-C9jNQXzL.js +1 -0
- package/ui/dist/assets/index-CEZ6R2Uw.js +7 -0
- package/ui/dist/assets/index-DURTouJI.js +1 -0
- package/ui/dist/assets/index-WclMPci1.css +1 -0
- package/ui/dist/assets/index-kb4AJXUB.js +67 -0
- package/ui/dist/assets/layers-CLXiHN6o.js +1 -0
- package/ui/dist/assets/layout-dashboard-B07MFhBs.js +1 -0
- package/ui/dist/assets/lightbulb-B2dgG5ks.js +1 -0
- package/ui/dist/assets/link-2-BxNmr9hL.js +1 -0
- package/ui/dist/assets/markdown-renderer-CjU6hBcW.js +36 -0
- package/ui/dist/assets/message-square-Bf2-CVbt.js +1 -0
- package/ui/dist/assets/pencil-D096Ey62.js +1 -0
- package/ui/dist/assets/play-DfdcSI3x.js +1 -0
- package/ui/dist/assets/popover-BV0QJDQq.js +1 -0
- package/ui/dist/assets/progress-DjPEDJfI.js +1 -0
- package/ui/dist/assets/rocket-CPsTc-5G.js +1 -0
- package/ui/dist/assets/select-LsO16slr.js +1 -0
- package/ui/dist/assets/send-BDYBZDUZ.js +1 -0
- package/ui/dist/assets/server-B3k6noce.js +1 -0
- package/ui/dist/assets/settings-2-Cu4xTjhG.js +1 -0
- package/ui/dist/assets/sheet-BScLnPKX.js +1 -0
- package/ui/dist/assets/shield-check-CQqkwufI.js +1 -0
- package/ui/dist/assets/shield-off-ZFruH9KO.js +1 -0
- package/ui/dist/assets/skeleton-CtkIA_MU.js +1 -0
- package/ui/dist/assets/smartphone-DnoksVkc.js +1 -0
- package/ui/dist/assets/square-uD9ZHMfW.js +1 -0
- package/ui/dist/assets/switch-MQPnwGJK.js +1 -0
- package/ui/dist/assets/table-B8cqlywA.js +1 -0
- package/ui/dist/assets/tag-wEJQRWlV.js +1 -0
- package/ui/dist/assets/textarea-D5LJCOGl.js +1 -0
- package/ui/dist/assets/timer-mbGHegmr.js +1 -0
- package/ui/dist/assets/tooltip-Df1CunSp.js +1 -0
- package/ui/dist/assets/trash-2-B4oAXsX-.js +1 -0
- package/ui/dist/assets/trending-up-BGWxvlmZ.js +1 -0
- package/ui/dist/assets/wand-sparkles-CZy4xvL3.js +1 -0
- package/ui/dist/assets/wrench-ByZkjO6m.js +1 -0
- package/ui/dist/audio-worklets/vad-processor.js +132 -0
- package/ui/dist/brand/profclaw-appicon-192.png +0 -0
- package/ui/dist/brand/profclaw-appicon-512.png +0 -0
- package/ui/dist/brand/profclaw-appicon-shadow.svg +51 -0
- package/ui/dist/brand/profclaw-appicon.svg +50 -0
- package/ui/dist/brand/profclaw-favicon-coral-bg-128.png +0 -0
- package/ui/dist/brand/profclaw-favicon-coral-bg-64.png +0 -0
- package/ui/dist/brand/profclaw-favicon-coral-bg.svg +52 -0
- package/ui/dist/brand/profclaw-favicon-coral-body-128.png +0 -0
- package/ui/dist/brand/profclaw-favicon-coral-body.svg +41 -0
- package/ui/dist/brand/profclaw-favicon-shadow-128.png +0 -0
- package/ui/dist/brand/profclaw-favicon-shadow-64.png +0 -0
- package/ui/dist/brand/profclaw-favicon-shadow.svg +51 -0
- package/ui/dist/brand/profclaw-mark-coral-256.png +0 -0
- package/ui/dist/brand/profclaw-mark-coral-64.png +0 -0
- package/ui/dist/brand/profclaw-mark-coral.svg +31 -0
- package/ui/dist/brand/profclaw-mono-white.svg +18 -0
- package/ui/dist/brand/profclaw-text-dark.svg +18 -0
- package/ui/dist/brand/profclaw-text-light.svg +18 -0
- package/ui/dist/brand/profclaw-wordmark-dark.svg +48 -0
- package/ui/dist/brand/profclaw-wordmark-light.svg +48 -0
- package/ui/dist/brand/safari-pinned-tab.svg +15 -0
- package/ui/dist/favicon/android-chrome-192x192.png +0 -0
- package/ui/dist/favicon/android-chrome-384x384.png +0 -0
- package/ui/dist/favicon/android-chrome-512x512.png +0 -0
- package/ui/dist/favicon/apple-touch-icon.png +0 -0
- package/ui/dist/favicon/browserconfig.xml +9 -0
- package/ui/dist/favicon/favicon-16x16.png +0 -0
- package/ui/dist/favicon/favicon-32x32.png +0 -0
- package/ui/dist/favicon/favicon.ico +0 -0
- package/ui/dist/favicon/mstile-150x150.png +0 -0
- package/ui/dist/favicon/safari-pinned-tab.svg +46 -0
- package/ui/dist/favicon/site.webmanifest +22 -0
- package/ui/dist/index.html +32 -0
- package/ui/dist/manifest.json +49 -0
- package/ui/dist/sw.js +124 -0
- package/ui/dist/vite.svg +1 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{_ as Ae,a as J,b as ge}from"./defineProperty-CoXUr7_6.js";function Se(e){if(Array.isArray(e))return e}function Ee(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,a,i,o,l=[],u=!0,c=!1;try{if(i=(t=t.call(e)).next,r!==0)for(;!(u=(n=i.call(t)).done)&&(l.push(n.value),l.length!==r);u=!0);}catch(v){c=!0,a=v}finally{try{if(!u&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}function Pe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ye(e,r){return Se(e)||Ee(e,r)||Ae(e,r)||Pe()}var B={},R={},ee;function me(){if(ee)return R;ee=1,Object.defineProperty(R,"__esModule",{value:!0}),R.bind=void 0;function e(r,t){var n=t.type,a=t.listener,i=t.options;return r.addEventListener(n,a,i),function(){r.removeEventListener(n,a,i)}}return R.bind=e,R}var C={},te;function je(){if(te)return C;te=1;var e=C&&C.__assign||function(){return e=Object.assign||function(i){for(var o,l=1,u=arguments.length;l<u;l++){o=arguments[l];for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&(i[c]=o[c])}return i},e.apply(this,arguments)};Object.defineProperty(C,"__esModule",{value:!0}),C.bindAll=void 0;var r=me();function t(i){if(!(typeof i>"u"))return typeof i=="boolean"?{capture:i}:i}function n(i,o){if(o==null)return i;var l=e(e({},i),{options:e(e({},t(o)),t(i.options))});return l}function a(i,o,l){var u=o.map(function(c){var v=n(c,l);return(0,r.bind)(i,v)});return function(){u.forEach(function(v){return v()})}}return C.bindAll=a,C}var re;function xe(){return re||(re=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var r=me();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return r.bind}});var t=je();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return t.bindAll}})})(B)),B}var F=xe(),be="data-pdnd-honey-pot";function he(e){return e instanceof Element&&e.hasAttribute(be)}function De(e){var r=document.elementsFromPoint(e.x,e.y),t=ye(r,2),n=t[0],a=t[1];return n?he(n)?a??null:n:null}var Ie=2147483647;function ne(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function ae(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?ne(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ne(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var k=2,ie=k/2;function Ce(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function Me(e){return{x:e.x-ie,y:e.y-ie}}function Fe(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function Ke(e){return{x:Math.min(e.x,window.innerWidth-k),y:Math.min(e.y,window.innerHeight-k)}}function oe(e){var r=e.client,t=Ke(Fe(Me(Ce(r))));return DOMRect.fromRect({x:t.x,y:t.y,width:k,height:k})}function ue(e){var r=e.clientRect;return{left:"".concat(r.left,"px"),top:"".concat(r.top,"px"),width:"".concat(r.width,"px"),height:"".concat(r.height,"px")}}function He(e){var r=e.client,t=e.clientRect;return r.x>=t.x&&r.x<=t.x+t.width&&r.y>=t.y&&r.y<=t.y+t.height}function Re(e){var r=e.initial,t=document.createElement("div");t.setAttribute(be,"true");var n=oe({client:r});Object.assign(t.style,ae(ae({backgroundColor:"transparent",position:"fixed",padding:0,margin:0,boxSizing:"border-box"},ue({clientRect:n})),{},{pointerEvents:"auto",zIndex:Ie})),document.body.appendChild(t);var a=F.bind(window,{type:"pointermove",listener:function(o){var l={x:o.clientX,y:o.clientY};n=oe({client:l}),Object.assign(t.style,ue({clientRect:n}))},options:{capture:!0}});return function(o){var l=o.current;if(a(),He({client:l,clientRect:n})){t.remove();return}function u(){c(),t.remove()}var c=F.bindAll(window,[{type:"pointerdown",listener:u},{type:"pointermove",listener:u},{type:"focusin",listener:u},{type:"focusout",listener:u},{type:"dragstart",listener:u},{type:"dragenter",listener:u},{type:"dragover",listener:u}],{capture:!0})}}function We(){var e=null;function r(){return e=null,F.bind(window,{type:"pointermove",listener:function(a){e={x:a.clientX,y:a.clientY}},options:{capture:!0}})}function t(){var n=null;return function(i){var o=i.eventName,l=i.payload;if(o==="onDragStart"){var u=l.location.initial.input,c=e??{x:u.clientX,y:u.clientY};n=Re({initial:c})}if(o==="onDrop"){var v,f=l.location.current.input;(v=n)===null||v===void 0||v({current:{x:f.clientX,y:f.clientY}}),n=null,e=null}}}return{bindEvents:r,getOnPostDispatch:t}}function K(e){var r=null;return function(){if(!r){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var o=e.apply(this,a);r={result:o}}return r.result}}var ke=K(function(){return navigator.userAgent.includes("Firefox")}),Q=K(function(){var r=navigator,t=r.userAgent;return t.includes("AppleWebKit")&&!t.includes("Chrome")}),z={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};function Le(e){var r=e.dragLeave;return Q()?r.hasOwnProperty(z.isLeavingWindow):!1}(function(){if(typeof window>"u"||!Q())return;function r(){return{enterCount:0,isOverWindow:!1}}var t=r();function n(){t=r()}F.bindAll(window,[{type:"dragstart",listener:function(){t.enterCount=0,t.isOverWindow=!0}},{type:"drop",listener:n},{type:"dragend",listener:n},{type:"dragenter",listener:function(i){!t.isOverWindow&&t.enterCount===0&&(i[z.isEnteringWindow]=!0),t.isOverWindow=!0,t.enterCount++}},{type:"dragleave",listener:function(i){t.enterCount--,t.isOverWindow&&t.enterCount===0&&(i[z.isLeavingWindow]=!0,t.isOverWindow=!1)}}],{capture:!0})})();function Ne(e){return"nodeName"in e}function Ue(e){return Ne(e)&&e.ownerDocument!==document}function Be(e){var r=e.dragLeave,t=r.type,n=r.relatedTarget;return t!=="dragleave"?!1:Q()?Le({dragLeave:r}):n==null?!0:ke()?Ue(n):n instanceof HTMLIFrameElement}function Xe(e){var r=e.onDragEnd;return[{type:"pointermove",listener:(function(){var t=0;return function(){if(t<20){t++;return}r()}})()},{type:"pointerdown",listener:r}]}function W(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var Ye=function(r){var t=[],n=null,a=function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];t=l,!n&&(n=requestAnimationFrame(function(){n=null,r.apply(void 0,t)}))};return a.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},a},X=Ye(function(e){return e()}),L=(function(){var e=null;function r(n){var a=requestAnimationFrame(function(){e=null,n()});e={frameId:a,fn:n}}function t(){e&&(cancelAnimationFrame(e.frameId),e.fn(),e=null)}return{schedule:r,flush:t}})();function qe(e){var r=e.source,t=e.initial,n=e.dispatchEvent,a={dropTargets:[]};function i(l){n(l),a={dropTargets:l.payload.location.current.dropTargets}}var o={start:function(u){var c=u.nativeSetDragImage,v={current:t,previous:a,initial:t};i({eventName:"onGenerateDragPreview",payload:{source:r,location:v,nativeSetDragImage:c}}),L.schedule(function(){i({eventName:"onDragStart",payload:{source:r,location:v}})})},dragUpdate:function(u){var c=u.current;L.flush(),X.cancel(),i({eventName:"onDropTargetChange",payload:{source:r,location:{initial:t,previous:a,current:c}}})},drag:function(u){var c=u.current;X(function(){L.flush();var v={initial:t,previous:a,current:c};i({eventName:"onDrag",payload:{source:r,location:v}})})},drop:function(u){var c=u.current,v=u.updatedSourcePayload;L.flush(),X.cancel(),i({eventName:"onDrop",payload:{source:v??r,location:{current:c,previous:a,initial:t}}})}};return o}var G={isActive:!1};function Oe(){return!G.isActive}function $e(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function ze(e){var r=e.current,t=e.next;if(r.length!==t.length)return!0;for(var n=0;n<r.length;n++)if(r[n].element!==t[n].element)return!0;return!1}function Ge(e){var r=e.event,t=e.dragType,n=e.getDropTargetsOver,a=e.dispatchEvent;if(!Oe())return;var i=Ze({event:r,dragType:t,getDropTargetsOver:n});G.isActive=!0;var o={current:i};Y({event:r,current:i.dropTargets});var l=qe({source:t.payload,dispatchEvent:a,initial:i});function u(d){var s=ze({current:o.current.dropTargets,next:d.dropTargets});o.current=d,s&&l.dragUpdate({current:o.current})}function c(d){var s=W(d),g=he(d.target)?De({x:s.clientX,y:s.clientY}):d.target,y=n({target:g,input:s,source:t.payload,current:o.current.dropTargets});y.length&&(d.preventDefault(),Y({event:d,current:y})),u({dropTargets:y,input:s})}function v(){o.current.dropTargets.length&&u({dropTargets:[],input:o.current.input}),l.drop({current:o.current,updatedSourcePayload:null}),f()}function f(){G.isActive=!1,w()}var w=F.bindAll(window,[{type:"dragover",listener:function(s){c(s),l.drag({current:o.current})}},{type:"dragenter",listener:c},{type:"dragleave",listener:function(s){Be({dragLeave:s})&&(u({input:o.current.input,dropTargets:[]}),t.startedFrom==="external"&&v())}},{type:"drop",listener:function(s){if(o.current={dropTargets:o.current.dropTargets,input:W(s)},!o.current.dropTargets.length){v();return}s.preventDefault(),Y({event:s,current:o.current.dropTargets}),l.drop({current:o.current,updatedSourcePayload:t.type==="external"?t.getDropPayload(s):null}),f()}},{type:"dragend",listener:function(s){o.current={dropTargets:o.current.dropTargets,input:W(s)},v()}}].concat(ge(Xe({onDragEnd:v}))),{capture:!0});l.start({nativeSetDragImage:$e(r)})}function Y(e){var r,t=e.event,n=e.current,a=(r=n[0])===null||r===void 0?void 0:r.dropEffect;a!=null&&t.dataTransfer&&(t.dataTransfer.dropEffect=a)}function Ze(e){var r=e.event,t=e.dragType,n=e.getDropTargetsOver,a=W(r);if(t.startedFrom==="external")return{input:a,dropTargets:[]};var i=n({input:a,source:t.payload,target:r.target,current:[]});return{input:a,dropTargets:i}}var le={canStart:Oe,start:Ge},Z=new Map;function Je(e){var r=e.typeKey,t=e.mount,n=Z.get(r);if(n)return n.usageCount++,n;var a={typeKey:r,unmount:t(),usageCount:1};return Z.set(r,a),a}function Qe(e){var r=Je(e);return function(){r.usageCount--,!(r.usageCount>0)&&(r.unmount(),Z.delete(e.typeKey))}}function V(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return function(){r.forEach(function(a){return a()})}}function we(e,r){var t=r.attribute,n=r.value;return e.setAttribute(t,n),function(){return e.removeAttribute(t)}}function ce(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function I(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?ce(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ce(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function q(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Ve(e))||r){t&&(e=t);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var c=t.next();return o=c.done,c},e:function(c){l=!0,i=c},f:function(){try{o||t.return==null||t.return()}finally{if(l)throw i}}}}function Ve(e,r){if(e){if(typeof e=="string")return de(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?de(e,r):void 0}}function de(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function $(e){return e.slice(0).reverse()}function _e(e){var r=e.typeKey,t=e.defaultDropEffect,n=new WeakMap,a="data-drop-target-for-".concat(r),i="[".concat(a,"]");function o(d){return n.set(d.element,d),function(){return n.delete(d.element)}}function l(d){var s=V(we(d.element,{attribute:a,value:"true"}),o(d));return K(s)}function u(d){var s,g,y,T,m=d.source,h=d.target,b=d.input,O=d.result,p=O===void 0?[]:O;if(h==null)return p;if(!(h instanceof Element))return h instanceof Node?u({source:m,target:h.parentElement,input:b,result:p}):p;var P=h.closest(i);if(P==null)return p;var D=n.get(P);if(D==null)return p;var S={input:b,source:m,element:D.element};if(D.canDrop&&!D.canDrop(S))return u({source:m,target:D.element.parentElement,input:b,result:p});var E=(s=(g=D.getData)===null||g===void 0?void 0:g.call(D,S))!==null&&s!==void 0?s:{},j=(y=(T=D.getDropEffect)===null||T===void 0?void 0:T.call(D,S))!==null&&y!==void 0?y:t,A={data:E,element:D.element,dropEffect:j,isActiveDueToStickiness:!1};return u({source:m,target:D.element.parentElement,input:b,result:[].concat(ge(p),[A])})}function c(d){var s=d.eventName,g=d.payload,y=q(g.location.current.dropTargets),T;try{for(y.s();!(T=y.n()).done;){var m,h=T.value,b=n.get(h.element),O=I(I({},g),{},{self:h});b==null||(m=b[s])===null||m===void 0||m.call(b,O)}}catch(p){y.e(p)}finally{y.f()}}var v={onGenerateDragPreview:c,onDrag:c,onDragStart:c,onDrop:c,onDropTargetChange:function(s){var g=s.payload,y=new Set(g.location.current.dropTargets.map(function(H){return H.element})),T=new Set,m=q(g.location.previous.dropTargets),h;try{for(m.s();!(h=m.n()).done;){var b,O=h.value;T.add(O.element);var p=n.get(O.element),P=y.has(O.element),D=I(I({},g),{},{self:O});if(p==null||(b=p.onDropTargetChange)===null||b===void 0||b.call(p,D),!P){var S;p==null||(S=p.onDragLeave)===null||S===void 0||S.call(p,D)}}}catch(H){m.e(H)}finally{m.f()}var E=q(g.location.current.dropTargets),j;try{for(E.s();!(j=E.n()).done;){var A,M,U=j.value;if(!T.has(U.element)){var _=I(I({},g),{},{self:U}),x=n.get(U.element);x==null||(A=x.onDropTargetChange)===null||A===void 0||A.call(x,_),x==null||(M=x.onDragEnter)===null||M===void 0||M.call(x,_)}}}catch(H){E.e(H)}finally{E.f()}}};function f(d){v[d.eventName](d)}function w(d){var s=d.source,g=d.target,y=d.input,T=d.current,m=u({source:s,target:g,input:y});if(m.length>=T.length)return m;for(var h=$(T),b=$(m),O=[],p=0;p<h.length;p++){var P,D=h[p],S=b[p];if(S!=null){O.push(S);continue}var E=O[p-1],j=h[p-1];if(E?.element!==j?.element)break;var A=n.get(D.element);if(!A)break;var M={input:y,source:s,element:A.element};if(A.canDrop&&!A.canDrop(M)||!((P=A.getIsSticky)!==null&&P!==void 0&&P.call(A,M)))break;O.push(I(I({},D),{},{isActiveDueToStickiness:!0}))}return $(O)}return{dropTargetForConsumers:l,getIsOver:w,dispatchEvent:f}}function et(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=tt(e))||r){t&&(e=t);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var c=t.next();return o=c.done,c},e:function(c){l=!0,i=c},f:function(){try{o||t.return==null||t.return()}finally{if(l)throw i}}}}function tt(e,r){if(e){if(typeof e=="string")return se(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?se(e,r):void 0}}function se(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function fe(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function rt(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?fe(Object(t),!0).forEach(function(n){J(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fe(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function nt(){var e=new Set,r=null;function t(i){r&&(!i.canMonitor||i.canMonitor(r.canMonitorArgs))&&r.active.add(i)}function n(i){var o=rt({},i);e.add(o),t(o);function l(){e.delete(o),r&&r.active.delete(o)}return K(l)}function a(i){var o=i.eventName,l=i.payload;if(o==="onGenerateDragPreview"){r={canMonitorArgs:{initial:l.location.initial,source:l.source},active:new Set};var u=et(e),c;try{for(u.s();!(c=u.n()).done;){var v=c.value;t(v)}}catch(y){u.e(y)}finally{u.f()}}if(r){for(var f=Array.from(r.active),w=0,d=f;w<d.length;w++){var s=d[w];if(r.active.has(s)){var g;(g=s[o])===null||g===void 0||g.call(s,l)}}o==="onDrop"&&(r.active.clear(),r=null)}}return{dispatchEvent:a,monitorForConsumers:n}}function at(e){var r=e.typeKey,t=e.mount,n=e.dispatchEventToSource,a=e.onPostDispatch,i=e.defaultDropEffect,o=nt(),l=_e({typeKey:r,defaultDropEffect:i});function u(f){n?.(f),l.dispatchEvent(f),o.dispatchEvent(f),a?.(f)}function c(f){var w=f.event,d=f.dragType;le.start({event:w,dragType:d,getDropTargetsOver:l.getIsOver,dispatchEvent:u})}function v(){function f(){var w={canStart:le.canStart,start:c};return t(w)}return Qe({typeKey:r,mount:f})}return{registerUsage:v,dropTarget:l.dropTargetForConsumers,monitor:o.monitorForConsumers}}var it=K(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),ot="pdnd:android-fallback",ve="text/plain",ut="text/uri-list",lt="application/vnd.pdnd",N=new WeakMap;function ct(e){return N.set(e.element,e),function(){N.delete(e.element)}}var pe=We(),Te=at({typeKey:"element",defaultDropEffect:"move",mount:function(r){return V(pe.bindEvents(),F.bind(document,{type:"dragstart",listener:function(n){var a,i,o,l,u,c;if(r.canStart(n)&&!n.defaultPrevented&&n.dataTransfer){var v=n.target;if(v instanceof HTMLElement){var f=N.get(v);if(f){var w=W(n),d={element:f.element,dragHandle:(a=f.dragHandle)!==null&&a!==void 0?a:null,input:w};if(f.canDrag&&!f.canDrag(d)){n.preventDefault();return}if(f.dragHandle){var s=De({x:w.clientX,y:w.clientY});if(!f.dragHandle.contains(s)){n.preventDefault();return}}var g=(i=(o=f.getInitialDataForExternal)===null||o===void 0?void 0:o.call(f,d))!==null&&i!==void 0?i:null;if(g)for(var y=0,T=Object.entries(g);y<T.length;y++){var m=ye(T[y],2),h=m[0],b=m[1];n.dataTransfer.setData(h,b??"")}it()&&!n.dataTransfer.types.includes(ve)&&!n.dataTransfer.types.includes(ut)&&n.dataTransfer.setData(ve,ot),n.dataTransfer.setData(lt,"");var O={element:f.element,dragHandle:(l=f.dragHandle)!==null&&l!==void 0?l:null,data:(u=(c=f.getInitialData)===null||c===void 0?void 0:c.call(f,d))!==null&&u!==void 0?u:{}},p={type:"element",payload:O,startedFrom:"internal"};r.start({event:n,dragType:p})}}}}}))},dispatchEventToSource:function(r){var t,n,a=r.eventName,i=r.payload;(t=N.get(i.source.element))===null||t===void 0||(n=t[a])===null||n===void 0||n.call(t,i)},onPostDispatch:pe.getOnPostDispatch()}),st=Te.dropTarget;function ft(e){var r=V(Te.registerUsage(),ct(e),we(e.element,{attribute:"draggable",value:"true"}));return K(r)}export{st as a,V as c,ft as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c}from"./index-kb4AJXUB.js";const e=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],r=c("ellipsis",e);export{r as E};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c}from"./index-kb4AJXUB.js";const e=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],r=c("ellipsis-vertical",e);export{r as E};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./index-kb4AJXUB.js";const a=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],t=e("file-code",a);export{t as F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a}from"./index-kb4AJXUB.js";const o=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],c=a("folder-open",o);export{c as F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c}from"./index-kb4AJXUB.js";const e=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],o=c("funnel",e);export{o as F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c}from"./index-kb4AJXUB.js";const e=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],y=c("git-branch",e);export{y as G};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o}from"./index-kb4AJXUB.js";const c=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],t=o("git-commit-horizontal",c);export{t as G};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c}from"./index-kb4AJXUB.js";const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],a=c("globe",e);export{a as G};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./index-kb4AJXUB.js";const y=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],o=e("hash",y);export{o as H};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o}from"./index-kb4AJXUB.js";const t=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],a=o("history",t);export{a as H};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,h as s,G as r,_ as o,k as t,N as i}from"./index-kb4AJXUB.js";function l(){return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"border-b border-border bg-card/50 backdrop-blur-sm sticky top-0 z-10",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-4 flex items-center justify-between",children:[e.jsxs(s,{to:"/",className:"flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(r,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:"Back to profClaw"})]}),void 0]})}),e.jsxs("main",{className:"max-w-4xl mx-auto px-6 py-12",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[e.jsx("div",{className:"h-12 w-12 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx(o,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Privacy Policy"}),e.jsx("p",{className:"text-muted-foreground",children:"Last updated: February 2026"})]})]}),e.jsxs("div",{className:"prose prose-neutral dark:prose-invert max-w-none",children:[e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"1. Introduction"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:'profClaw ("we", "our", or "us") is committed to protecting your privacy. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you use our AI task management platform.'})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"2. Information We Collect"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 border border-border",children:[e.jsx("h3",{className:"font-medium mb-2",children:"Account Information"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Email address, name, and authentication data when you create an account or sign in via GitHub OAuth."})]}),e.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 border border-border",children:[e.jsx("h3",{className:"font-medium mb-2",children:"Task & Project Data"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Tasks, tickets, projects, and AI-generated summaries you create within the platform."})]}),e.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 border border-border",children:[e.jsx("h3",{className:"font-medium mb-2",children:"Usage Data"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Token usage, API calls, and interaction data for cost tracking and service improvement."})]}),e.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 border border-border",children:[e.jsx("h3",{className:"font-medium mb-2",children:"AI Provider Credentials"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"API keys you provide for AI services (Anthropic, OpenAI, etc.) are stored encrypted and used only to make requests on your behalf."})]})]})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"3. How We Use Your Information"}),e.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground",children:[e.jsx("li",{children:"To provide and maintain our service"}),e.jsx("li",{children:"To route tasks to AI agents and track their execution"}),e.jsx("li",{children:"To calculate and display token costs"}),e.jsx("li",{children:"To sync with external platforms (Jira, Linear, GitHub) when connected"}),e.jsx("li",{children:"To improve our platform based on usage patterns"})]})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"4. Data Storage & Security"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Your data is stored locally in SQLite by default. When using cloud sync features, data is encrypted in transit and at rest. API keys are stored with encryption and are never logged or exposed."})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"5. Third-Party Services"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"We integrate with AI providers (Anthropic, OpenAI, Google, etc.) and project management tools (GitHub, Jira, Linear). Your data shared with these services is governed by their respective privacy policies."})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"6. Your Rights"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"You can export, delete, or modify your data at any time through the Settings page. For data deletion requests, contact us at the address below."})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"7. Contact Us"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["For questions about this Privacy Policy, contact us at:"," ",e.jsx("a",{href:"mailto:support@profclaw.dev",className:"text-primary hover:underline",children:"support@profclaw.dev"})]})]})]}),e.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:e.jsx(s,{to:"/",children:e.jsxs(t,{variant:"outline",className:"gap-2",children:[e.jsx(r,{className:"h-4 w-4"}),"Back to Dashboard"]})})})]})]})}function c(){return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"border-b border-border bg-card/50 backdrop-blur-sm sticky top-0 z-10",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-4 flex items-center justify-between",children:[e.jsxs(s,{to:"/",className:"flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(r,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:"Back to profClaw"})]}),void 0]})}),e.jsxs("main",{className:"max-w-4xl mx-auto px-6 py-12",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[e.jsx("div",{className:"h-12 w-12 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx(i,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Terms of Service"}),e.jsx("p",{className:"text-muted-foreground",children:"Last updated: February 2026"})]})]}),e.jsxs("div",{className:"prose prose-neutral dark:prose-invert max-w-none",children:[e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"1. Acceptance of Terms"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:'By accessing or using profClaw ("the Service"), you agree to be bound by these Terms of Service. If you do not agree to these terms, please do not use the Service.'})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"2. Description of Service"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"profClaw is an AI-native task management and agent orchestration platform. It allows users to create, track, and manage tasks that can be executed by various AI agents, with bi-directional sync to external project management tools."})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"3. User Accounts"}),e.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground",children:[e.jsx("li",{children:"You must provide accurate information when creating an account"}),e.jsx("li",{children:"You are responsible for maintaining the security of your account credentials"}),e.jsx("li",{children:"You are responsible for all activities under your account"}),e.jsx("li",{children:"You must notify us immediately of any unauthorized use"})]})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"4. API Keys & Third-Party Services"}),e.jsx("div",{className:"p-4 rounded-lg bg-amber-500/10 border border-amber-500/30 mb-4",children:e.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-400 font-medium",children:"Important: You are responsible for your own API keys and usage costs"})}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"When you provide API keys for AI providers (Anthropic, OpenAI, Google, etc.), you are responsible for compliance with those providers' terms of service and for any costs incurred. profClaw is not responsible for charges from third-party AI providers."})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"5. Acceptable Use"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"You agree not to use the Service to:"}),e.jsxs("ul",{className:"list-disc list-inside space-y-2 text-muted-foreground",children:[e.jsx("li",{children:"Violate any laws or regulations"}),e.jsx("li",{children:"Generate harmful, illegal, or abusive content via AI agents"}),e.jsx("li",{children:"Attempt to bypass security measures or rate limits"}),e.jsx("li",{children:"Interfere with the proper functioning of the Service"}),e.jsx("li",{children:"Access other users' data without authorization"})]})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"6. Tool Execution & Security"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"profClaw provides tool execution capabilities for AI agents. By enabling tools, you acknowledge that AI-generated commands will be executed on your behalf. Always review tool executions, especially those modifying files or systems."})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"7. Intellectual Property"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"You retain ownership of all content you create within profClaw. AI-generated content is subject to the terms of the underlying AI provider. profClaw's software and branding remain our property."})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"8. Limitation of Liability"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:'profClaw is provided "as is" without warranties. We are not liable for any damages arising from your use of the Service, including but not limited to AI-generated outputs, tool execution results, or integration failures.'})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"9. Changes to Terms"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"We may update these Terms from time to time. Continued use of the Service after changes constitutes acceptance of the new Terms."})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"10. Contact"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["For questions about these Terms, contact us at:"," ",e.jsx("a",{href:"mailto:support@profclaw.dev",className:"text-primary hover:underline",children:"support@profclaw.dev"})]})]})]}),e.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:e.jsx(s,{to:"/",children:e.jsxs(t,{variant:"outline",className:"gap-2",children:[e.jsx(r,{className:"h-4 w-4"}),"Back to Dashboard"]})})})]})]})}export{l as PrivacyPolicy,c as TermsOfService};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as le,r,K as ue,C as G,g as J,j as e,i as l,D as Fe,x as Ie,k as D,y as Oe,z,Z as xe,aw as is,R as re,u as Ne,L as ne,U as he,m as O,n as ze,S as qe,a1 as hs,M as ps,ay as gs,o as K,P as fs,O as Ms,l as Rs,p as g,aK as Je,aj as Ds,I as C,v as we,_ as As,be as Ps,A as Fs,X as Is,w as Os}from"./index-kb4AJXUB.js";import{A as Js,a as Ls,b as zs,c as qs,d as _s,e as $s,f as Hs,g as Us}from"./alert-dialog-BOmnTkN-.js";import{M as Ce}from"./message-square-Bf2-CVbt.js";import{W as Y}from"./wrench-ByZkjO6m.js";import{G as Se}from"./globe-CCspjvus.js";import{A as _e}from"./archive-D5my9zOG.js";import{C as ae}from"./circle-x-BN89YhbS.js";import{E as Ks}from"./ellipsis-vertical-BueMfuCw.js";import{P as Gs}from"./pencil-D096Ey62.js";import{H as Qs}from"./history-CNqcBBrV.js";import{P as ke}from"./play-DfdcSI3x.js";import{T as bs}from"./trash-2-B4oAXsX-.js";import{T as vs}from"./tag-wEJQRWlV.js";import{T as pe,C as De,I as Le,S as Ws}from"./timer-mbGHegmr.js";import{D as $e,b as He,c as Ue,d as Ke,a as Bs}from"./dialog-DrWB4EYD.js";import{S as js}from"./settings-2-Cu4xTjhG.js";import{L as Vs}from"./link-2-BxNmr9hL.js";import{W as Ys}from"./wand-sparkles-CZy4xvL3.js";import{G as Xs}from"./git-branch-BRMiJmV3.js";import{D as Zs}from"./database-D9Cnfmzj.js";import{F as et}from"./file-code-HR9829Jc.js";import{C as Te}from"./calendar-BkWIhKa1.js";import{L as st}from"./lightbulb-B2dgG5ks.js";import{T as tt}from"./trending-up-BGWxvlmZ.js";import{F as at}from"./funnel-B5gmNXGf.js";const rt=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],nt=le("archive-restore",rt);const lt=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],it=le("hard-drive",lt);const ot=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],ct=le("megaphone",ot);const dt=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],ge=le("pause",dt);const mt=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],os=le("refresh-ccw",mt);const xt=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],ut=le("sliders-horizontal",xt),ht={http:Se,tool:Y,script:ue,message:Ce},pt={active:{color:"text-green-500",bg:"bg-green-500/10",icon:G,label:"Active"},paused:{color:"text-amber-500",bg:"bg-amber-500/10",icon:ge,label:"Paused"},completed:{color:"text-blue-500",bg:"bg-blue-500/10",icon:G,label:"Completed"},failed:{color:"text-red-500",bg:"bg-red-500/10",icon:ae,label:"Failed"},archived:{color:"text-muted-foreground",bg:"bg-muted/50",icon:_e,label:"Archived"}},gt={color:"text-muted-foreground",bg:"bg-muted/50",icon:J,label:"Unknown"};function ft(t){if(!t)return"Not scheduled";const o=new Date(t),f=new Date,i=o.getTime()-f.getTime();return i<0?"Overdue":i<6e4?"In less than a minute":i<36e5?`In ${Math.round(i/6e4)} min`:i<864e5?`In ${Math.round(i/36e5)} hours`:o.toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function bt(t){if(!t)return"Never";const o=new Date(t),i=new Date().getTime()-o.getTime();return i<6e4?"Just now":i<36e5?`${Math.round(i/6e4)} min ago`:i<864e5?`${Math.round(i/36e5)} hours ago`:o.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function vt({job:t,onTrigger:o,onPause:f,onResume:i,onDelete:j,onViewHistory:h,onEdit:N,onArchive:c,onRestore:b}){const[d,m]=r.useState(!1),x=ht[t.jobType]||Y,u=pt[t.status]||gt,P=u.icon,w=t.status==="archived",L=async()=>{m(!0);try{await o(t.id)}finally{m(!1)}},k=t.runCount>0?Math.round(t.successCount/t.runCount*100):0;return e.jsxs("div",{className:"group relative rounded-2xl border border-border/50 bg-card/50 backdrop-blur-sm p-4 hover:border-border hover:shadow-lg transition-all duration-200",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[e.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[e.jsx("div",{className:l("h-10 w-10 rounded-xl flex items-center justify-center shrink-0",u.bg),children:e.jsx(x,{className:l("h-5 w-5",u.color)})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-sm truncate",children:t.name}),t.description&&e.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:t.description})]})]}),e.jsxs(Fe,{children:[e.jsx(Ie,{asChild:!0,children:e.jsx(D,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 opacity-0 group-hover:opacity-100",children:e.jsx(Ks,{className:"h-4 w-4"})})}),e.jsxs(Oe,{align:"end",className:"w-48",children:[!w&&e.jsxs(e.Fragment,{children:[e.jsxs(z,{onClick:L,disabled:d,children:[e.jsx(xe,{className:"h-4 w-4 mr-2"}),"Run Now"]}),N&&e.jsxs(z,{onClick:()=>N(t),children:[e.jsx(Gs,{className:"h-4 w-4 mr-2"}),"Edit Job"]})]}),e.jsxs(z,{onClick:()=>h(t.id),children:[e.jsx(Qs,{className:"h-4 w-4 mr-2"}),"View History"]}),e.jsx(is,{}),!w&&t.status==="active"&&e.jsxs(z,{onClick:()=>f(t.id),children:[e.jsx(ge,{className:"h-4 w-4 mr-2"}),"Pause Job"]}),!w&&t.status==="paused"&&e.jsxs(z,{onClick:()=>i(t.id),children:[e.jsx(ke,{className:"h-4 w-4 mr-2"}),"Resume Job"]}),w&&b&&e.jsxs(z,{onClick:()=>b(t.id),children:[e.jsx(nt,{className:"h-4 w-4 mr-2"}),"Restore Job"]}),e.jsx(is,{}),!w&&c&&e.jsxs(z,{onClick:()=>c(t.id),className:"text-amber-500 focus:text-amber-500",children:[e.jsx(_e,{className:"h-4 w-4 mr-2"}),"Archive Job"]}),e.jsxs(z,{onClick:()=>j(t.id),className:"text-red-500 focus:text-red-500",children:[e.jsx(bs,{className:"h-4 w-4 mr-2"}),"Delete Permanently"]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsxs("span",{className:l("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold",u.bg,u.color),children:[e.jsx(P,{className:"h-3 w-3"}),u.label]}),e.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:t.cronExpression||`Every ${Math.round((t.intervalMs||0)/1e3)}s`})]}),t.labels&&t.labels.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1 mb-3",children:[t.labels.slice(0,3).map(F=>e.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded bg-primary/10 text-primary text-[9px]",children:[e.jsx(vs,{className:"h-2.5 w-2.5"}),F]},F)),t.labels.length>3&&e.jsxs("span",{className:"text-[9px] text-muted-foreground",children:["+",t.labels.length-3]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-3",children:[e.jsxs("div",{className:"text-center p-2 rounded-lg bg-muted/50",children:[e.jsx("div",{className:"text-lg font-bold",children:t.runCount}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Total Runs"})]}),e.jsxs("div",{className:"text-center p-2 rounded-lg bg-muted/50",children:[e.jsxs("div",{className:l("text-lg font-bold",k>=80?"text-green-500":k>=50?"text-amber-500":"text-red-500"),children:[k,"%"]}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Success"})]}),e.jsxs("div",{className:"text-center p-2 rounded-lg bg-muted/50",children:[e.jsx("div",{className:"text-lg font-bold text-red-500",children:t.failureCount}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Failures"})]})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground border-t border-border/50 pt-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(J,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:["Last: ",bt(t.lastRunAt)]}),t.lastRunStatus&&e.jsx("span",{className:l("h-1.5 w-1.5 rounded-full",t.lastRunStatus==="success"?"bg-green-500":"bg-red-500")})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(pe,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:ft(t.nextRunAt)})]})]}),e.jsx(D,{variant:"outline",size:"sm",className:"w-full mt-3 h-8 text-xs",onClick:L,disabled:d||t.status==="completed",children:d?e.jsxs(e.Fragment,{children:[e.jsx(re,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}),"Running..."]}):e.jsxs(e.Fragment,{children:[e.jsx(xe,{className:"h-3.5 w-3.5 mr-1.5"}),"Run Now"]})})]})}const jt={pending:{color:"text-amber-500",bg:"bg-amber-500/10",icon:J,label:"Pending"},running:{color:"text-blue-500",bg:"bg-blue-500/10",icon:ne,label:"Running"},success:{color:"text-green-500",bg:"bg-green-500/10",icon:G,label:"Success"},failure:{color:"text-red-500",bg:"bg-red-500/10",icon:ae,label:"Failed"},error:{color:"text-red-500",bg:"bg-red-500/10",icon:ae,label:"Error"},timeout:{color:"text-orange-500",bg:"bg-orange-500/10",icon:he,label:"Timeout"},cancelled:{color:"text-muted-foreground",bg:"bg-muted/50",icon:ae,label:"Cancelled"}},yt={color:"text-muted-foreground",bg:"bg-muted/50",icon:he,label:"Unknown"};function Nt(t){return t?t<1e3?`${t}ms`:t<6e4?`${(t/1e3).toFixed(1)}s`:`${Math.round(t/6e4)}m ${Math.round(t%6e4/1e3)}s`:"-"}function wt(t){return new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function kt({jobId:t,jobName:o,open:f,onOpenChange:i}){const{data:j,isLoading:h,error:N,refetch:c}=Ne({queryKey:["cron-history",t],queryFn:()=>O.cron.history(t,50),enabled:!!t&&f,refetchInterval:5e3}),b=j?.history||[],d=j?.job;return e.jsx($e,{open:f,onOpenChange:i,children:e.jsxs(He,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[e.jsx(Ue,{className:"flex-shrink-0",children:e.jsxs(Ke,{className:"flex items-center gap-2",children:[e.jsx(ue,{className:"h-5 w-5 text-primary"}),"Job History: ",o||t?.slice(0,8)]})}),d&&e.jsxs("div",{className:"flex items-center gap-4 p-3 rounded-xl bg-muted/50 border border-border/50 mb-4",children:[e.jsxs("div",{className:"flex-1 text-center",children:[e.jsx("div",{className:"text-2xl font-bold",children:d.runCount}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Total Runs"})]}),e.jsx("div",{className:"h-8 w-px bg-border"}),e.jsxs("div",{className:"flex-1 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-green-500",children:d.successCount}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Successes"})]}),e.jsx("div",{className:"h-8 w-px bg-border"}),e.jsxs("div",{className:"flex-1 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-red-500",children:d.failureCount}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Failures"})]}),e.jsx("div",{className:"h-8 w-px bg-border"}),e.jsxs("div",{className:"flex-1 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold",children:[d.runCount>0?Math.round(d.successCount/d.runCount*100):0,"%"]}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Success Rate"})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto -mx-6 px-6",children:h?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx(ne,{className:"h-8 w-8 animate-spin text-primary mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading history..."})]}):N?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx(he,{className:"h-8 w-8 text-red-500 mb-3"}),e.jsx("p",{className:"text-sm text-red-500",children:"Failed to load history"}),e.jsxs(D,{variant:"outline",size:"sm",onClick:()=>c(),className:"mt-3",children:[e.jsx(re,{className:"h-4 w-4 mr-2"}),"Retry"]})]}):b.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx(J,{className:"h-8 w-8 text-muted-foreground mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No runs yet"}),e.jsx("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"History will appear here after the first execution"})]}):e.jsx("div",{className:"space-y-2",children:b.map((m,x)=>{const u=jt[m.status]||yt,P=u.icon,w=m.status==="running";return e.jsxs("div",{className:l("rounded-xl border p-3 transition-colors",x===0?"border-primary/30 bg-primary/5":"border-border/50 bg-card/50"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:l("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold",u.bg,u.color),children:[e.jsx(P,{className:l("h-3 w-3",w&&"animate-spin")}),u.label]}),x===0&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[9px] font-medium bg-primary/10 text-primary",children:"Latest"})]}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(pe,{className:"h-3.5 w-3.5"}),Nt(m.durationMs)]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(J,{className:"h-3.5 w-3.5"}),wt(m.startedAt)]})]})]}),(m.output||m.error)&&e.jsx("div",{className:l("mt-2 p-2 rounded-lg text-xs font-mono overflow-x-auto",m.error?"bg-red-500/10 text-red-400":"bg-muted/50 text-muted-foreground"),children:e.jsx("pre",{className:"whitespace-pre-wrap break-words max-h-32 overflow-y-auto",children:m.error||m.output})})]},m.id)})})}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-border/50 mt-4",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing ",b.length," runs"]}),e.jsxs(D,{variant:"outline",size:"sm",onClick:()=>c(),children:[e.jsx(re,{className:"h-3.5 w-3.5 mr-1.5"}),"Refresh"]})]})]})})}const V=[{id:"type",label:"Type",icon:qe,description:"What kind of job?"},{id:"schedule",label:"Schedule",icon:J,description:"When to run?"},{id:"config",label:"Configure",icon:js,description:"Job details"},{id:"review",label:"Review",icon:hs,description:"Confirm & create"}],cs=[{id:"health-check",name:"Health Check",category:"monitoring",icon:ps,description:"Monitor service health with HTTP pings",jobType:"http",suggestedCron:"*/5 * * * *",payload:{url:"https://your-api.com/health",method:"GET"},guide:"Regularly checks if your service is responding. Great for uptime monitoring."},{id:"db-backup",name:"Database Backup",category:"maintenance",icon:it,description:"Schedule automated database backups",jobType:"script",suggestedCron:"0 2 * * *",payload:{command:"pg_dump",args:["-h","localhost","mydb"]},guide:"Runs daily at 2 AM. Adjust the command for your database type.",warning:"Ensure backup storage has sufficient space."},{id:"git-sync",name:"Git Repository Sync",category:"development",icon:re,description:"Pull latest changes from remote",jobType:"tool",suggestedCron:"*/30 * * * *",payload:{tool:"git_pull",params:{branch:"main"}},guide:"Keeps local repositories in sync with remote."},{id:"slack-standup",name:"Daily Standup Reminder",category:"notifications",icon:ct,description:"Send daily standup reminders to Slack",jobType:"message",suggestedCron:"0 9 * * 1-5",payload:{channel:"#team",message:"Good morning! Time for standup!"},guide:"Sends at 9 AM on weekdays. Change channel and message as needed."},{id:"api-sync",name:"External API Sync",category:"integration",icon:Vs,description:"Sync data from external APIs",jobType:"http",suggestedCron:"0 */4 * * *",payload:{url:"https://api.example.com/sync",method:"POST",headers:{"Content-Type":"application/json"}},guide:"Runs every 4 hours. Add authentication headers if required."},{id:"cleanup",name:"Cleanup Old Files",category:"maintenance",icon:bs,description:"Remove temporary and old files",jobType:"script",suggestedCron:"0 3 * * 0",payload:{command:"find",args:["/tmp","-mtime","+7","-delete"]},guide:"Runs weekly on Sunday at 3 AM.",warning:"Double-check paths before enabling to avoid data loss."},{id:"report-gen",name:"Generate Reports",category:"analytics",icon:gs,description:"Generate and send automated reports",jobType:"tool",suggestedCron:"0 8 * * 1",payload:{tool:"generate_report",params:{type:"weekly",format:"pdf"}},guide:"Generates weekly reports every Monday at 8 AM."},{id:"webhook-trigger",name:"Webhook Trigger",category:"integration",icon:xe,description:"Trigger external webhooks on schedule",jobType:"http",suggestedCron:"0 */6 * * *",payload:{url:"https://hooks.example.com/trigger",method:"POST",body:{event:"scheduled"}},guide:"Triggers every 6 hours. Customize the webhook URL and payload."}],Ct=[{id:"all",label:"All",icon:qe},{id:"monitoring",label:"Monitoring",icon:hs},{id:"maintenance",label:"Maintenance",icon:Y},{id:"development",label:"Development",icon:Xs},{id:"notifications",label:"Notifications",icon:Je},{id:"integration",label:"Integration",icon:Ds},{id:"analytics",label:"Analytics",icon:Zs}],te=[{type:"http",label:"HTTP Request",icon:Se,description:"Call an API endpoint",color:"from-blue-500/20 to-cyan-500/20",examples:["Sync data from API","Health checks","Webhook triggers"],defaultPayload:{url:"https://api.example.com/endpoint",method:"POST",headers:{}},guide:"Make HTTP requests to external services. Supports GET, POST, PUT, DELETE methods."},{type:"tool",label:"Tool Execution",icon:Y,description:"Run a profClaw tool",color:"from-indigo-500/20 to-pink-500/20",examples:["Git operations","File sync","Database backups"],defaultPayload:{tool:"git_status",params:{}},guide:"Execute any registered profClaw tool with custom parameters."},{type:"script",label:"Shell Script",icon:ue,description:"Execute a command",color:"from-green-500/20 to-emerald-500/20",examples:["Build scripts","Cleanup tasks","System checks"],defaultPayload:{command:'echo "Hello World"',args:[]},guide:"Run shell commands on the server. Use with caution.",warning:"Scripts run with server permissions. Avoid sensitive operations."},{type:"message",label:"Notification",icon:Ce,description:"Send a message",color:"from-orange-500/20 to-amber-500/20",examples:["Daily standup reminder","Status reports","Alerts"],defaultPayload:{channel:"#general",message:"Scheduled notification"},guide:"Send messages to Slack channels, email, or webhooks."}],St=[{type:"cron",label:"Cron",icon:J,description:"Classic cron syntax"},{type:"interval",label:"Interval",icon:pe,description:"Every X seconds"},{type:"oneshot",label:"One-Time",icon:Te,description:"Run once"},{type:"event",label:"Event",icon:xe,description:"On trigger"}],ys=[{label:"Every minute",value:"* * * * *",humanize:"Runs every minute"},{label:"Every 5 min",value:"*/5 * * * *",humanize:"Runs every 5 minutes"},{label:"Every 15 min",value:"*/15 * * * *",humanize:"Runs every 15 minutes"},{label:"Hourly",value:"0 * * * *",humanize:"Runs at the start of every hour"},{label:"Daily midnight",value:"0 0 * * *",humanize:"Runs daily at midnight"},{label:"Weekdays 9am",value:"0 9 * * 1-5",humanize:"Runs at 9am on weekdays"}],Ae=[{label:"30 sec",value:30,humanize:"Every 30 seconds"},{label:"1 min",value:60,humanize:"Every minute"},{label:"5 min",value:300,humanize:"Every 5 minutes"},{label:"15 min",value:900,humanize:"Every 15 minutes"},{label:"30 min",value:1800,humanize:"Every 30 minutes"},{label:"1 hour",value:3600,humanize:"Every hour"}],Tt=[{type:"webhook",label:"Webhook",description:"HTTP webhook endpoint"},{type:"ticket",label:"Ticket",description:"Ticket changes"},{type:"github",label:"GitHub",description:"Push, PR, issues"},{type:"file",label:"File",description:"File changes"}];function _({children:t,type:o="info"}){const f={info:"bg-blue-500/10 border-blue-500/20 text-blue-700 dark:text-blue-300",warning:"bg-amber-500/10 border-amber-500/20 text-amber-700 dark:text-amber-300",tip:"bg-green-500/10 border-green-500/20 text-green-700 dark:text-green-300"},j={info:Le,warning:he,tip:st}[o];return e.jsxs("div",{className:l("flex items-start gap-2 p-3 rounded-lg border text-xs",f[o]),children:[e.jsx(j,{className:"h-4 w-4 shrink-0 mt-0.5"}),e.jsx("div",{children:t})]})}function Pe({children:t,content:o}){return e.jsxs("span",{className:"relative group",children:[t,e.jsx("span",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 rounded bg-popover border text-xs whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-50",children:o})]})}function ds(t){const o=ys.find(b=>b.value===t);if(o)return o.humanize;const f=t.split(" ");if(f.length!==5)return`Cron: ${t}`;const[i,j,h,N,c]=f;return i.startsWith("*/")&&j==="*"&&h==="*"&&N==="*"&&c==="*"?`Every ${i.slice(2)} minutes`:i==="0"&&j.startsWith("*/")&&h==="*"&&N==="*"&&c==="*"?`Every ${j.slice(2)} hours`:i==="0"&&j==="0"&&h==="*"&&N==="*"&&c==="*"?"Daily at midnight":`Cron: ${t}`}function Et(t){try{return{valid:!0,parsed:JSON.parse(t)}}catch{return{valid:!1,error:"Invalid JSON syntax"}}}function ms({open:t,onOpenChange:o}){const f=ze(),[i,j]=r.useState(!1),h=t??i,N=o??j,[c,b]=r.useState("simple"),[d,m]=r.useState("type"),x=V.findIndex(s=>s.id===d),[u,P]=r.useState("all"),[w,L]=r.useState(""),[k,F]=r.useState(""),[p,$]=r.useState(null),[v,E]=r.useState(null),[M,q]=r.useState("*/5 * * * *"),[A,H]=r.useState(300),[T,n]=r.useState(""),[R,fe]=r.useState(""),[U,be]=r.useState("webhook"),[ve,je]=r.useState("{}"),[Q,X]=r.useState("{}"),[I,Z]=r.useState(null),[a,ee]=r.useState("UTC"),[ie,Ge]=r.useState(!0),[Ee,Qe]=r.useState(3),[Me,We]=r.useState("exponential"),[oe,Be]=r.useState(!1),[W,Ve]=r.useState(""),[Ye,Xe]=r.useState(!1),[Ze,es]=r.useState(!0),[ss,ts]=r.useState(!1),[ce,as]=r.useState(null),[Re,rs]=r.useState(null),de=r.useMemo(()=>Et(Q),[Q]),{data:Ns}=Ne({queryKey:["cron-templates"],queryFn:()=>O.cron.listTemplates?.()||Promise.resolve({templates:[]}),enabled:h}),ns=Ns?.templates||[],ws=r.useMemo(()=>u==="all"?cs:cs.filter(s=>s.category===u),[u]);r.useEffect(()=>{if(p&&!I){const s=te.find(y=>y.type===p);s&&X(JSON.stringify(s.defaultPayload,null,2))}},[p,I]);const ls=s=>{if(I?.id===s.id){Z(null);return}Z(s),L(s.name),F(s.description),$(s.jobType),X(JSON.stringify(s.payload,null,2)),s.suggestedCron&&(E("cron"),q(s.suggestedCron))},se=K({mutationFn:()=>{const s=JSON.parse(Q);let y;v==="oneshot"&&T&&R&&(y=new Date(`${T}T${R}`).toISOString());let S;if(v==="event")try{S={type:U,config:JSON.parse(ve)}}catch{S={type:U,config:{}}}let B;return c==="advanced"&&oe&&W&&(B={channels:[{type:W.includes("@")?"email":W.startsWith("http")?"webhook":"slack",target:W,onSuccess:Ye,onFailure:Ze}]}),O.cron.create({name:w,description:k||void 0,jobType:p,cronExpression:v==="cron"?M:void 0,intervalMs:v==="interval"?A*1e3:void 0,runAt:y,eventTrigger:S,payload:s,timezone:c==="advanced"?a:"UTC",deleteOnComplete:v==="oneshot"?ss:void 0,retryPolicy:c==="advanced"?{enabled:ie,maxRetries:Ee,backoff:Me}:void 0,delivery:B,maxRuns:c==="advanced"&&ce||void 0,maxFailures:c==="advanced"&&Re||void 0})},onSuccess:()=>{f.invalidateQueries({queryKey:["cron-jobs"]}),f.invalidateQueries({queryKey:["cron-stats"]}),N(!1),ks()}}),ks=()=>{m("type"),b("simple"),P("all"),L(""),F(""),$(null),E(null),q("*/5 * * * *"),H(300),n(""),fe(""),be("webhook"),je("{}"),X("{}"),Z(null),ee("UTC"),Ge(!0),Qe(3),We("exponential"),Be(!1),Ve(""),Xe(!1),es(!0),ts(!1),as(null),rs(null)},Cs=r.useMemo(()=>{switch(d){case"type":return p!==null;case"schedule":return v?v==="oneshot"?T&&R:!0:!1;case"config":return w.trim().length>0&&de.valid;case"review":return!0;default:return!1}},[d,p,v,T,R,w,de]),Ss=()=>{x<V.length-1&&m(V[x+1].id)},Ts=()=>{x>0&&m(V[x-1].id)},Es=r.useMemo(()=>{switch(v){case"cron":return ds(M);case"interval":return Ae.find(s=>s.value===A)?.humanize||`Every ${A} seconds`;case"oneshot":return T&&R?`Once at ${new Date(`${T}T${R}`).toLocaleString()}`:"One-time (not scheduled)";case"event":return`On ${U} event`;default:return"Not configured"}},[v,M,A,T,R,U]),ye=te.find(s=>s.type===p);return e.jsxs($e,{open:h,onOpenChange:N,children:[e.jsx(Bs,{asChild:!0,children:e.jsxs(D,{className:"gap-2 shadow-lg shadow-primary/20 hover:shadow-primary/30 transition-shadow",children:[e.jsx(fs,{className:"h-4 w-4"}),"Create Job"]})}),e.jsxs(He,{className:"max-w-4xl w-[90vw] max-h-[85vh] my-8 flex flex-col p-0 overflow-hidden [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",children:[e.jsxs("div",{className:"border-b border-border/20 bg-linear-to-r from-primary/5 to-transparent",children:[e.jsx(Ue,{className:"px-6 pt-5 pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(Ke,{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-xl bg-primary/10",children:e.jsx(J,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("span",{className:"block",children:"Create Scheduled Job"}),e.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:V[x].description})]})]}),e.jsxs("div",{className:"flex items-center gap-1 p-1 rounded-lg bg-muted",children:[e.jsxs("button",{onClick:()=>b("simple"),className:l("flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-all",c==="simple"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.jsx(Ys,{className:"h-3 w-3"}),"Simple"]}),e.jsxs("button",{onClick:()=>b("advanced"),className:l("flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-all",c==="advanced"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.jsx(ut,{className:"h-3 w-3"}),"Advanced"]})]})]})}),e.jsx("div",{className:"px-6 pb-4",children:e.jsx("div",{className:"flex items-center gap-2",children:V.map((s,y)=>{const S=s.icon,B=s.id===d,me=y<x;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>y<=x&&m(s.id),disabled:y>x,className:l("flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-medium transition-all",B&&"bg-primary text-primary-foreground shadow-md shadow-primary/30",me&&"bg-primary/20 text-primary hover:bg-primary/30",!B&&!me&&"bg-muted text-muted-foreground",y>x&&"opacity-50 cursor-not-allowed"),children:[me?e.jsx(Ms,{className:"h-3 w-3"}):e.jsx(S,{className:"h-3 w-3"}),e.jsx("span",{className:"hidden sm:inline",children:s.label})]}),y<V.length-1&&e.jsx(Rs,{className:l("h-4 w-4",y<x?"text-primary":"text-muted-foreground/50")})]},s.id)})})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",children:[d==="type"&&e.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-right-4 duration-300",children:[c==="simple"&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx(g,{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Quick Start Templates"}),e.jsx(Pe,{content:"Pre-configured jobs for common tasks",children:e.jsx(De,{className:"h-3.5 w-3.5 text-muted-foreground cursor-help"})})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-4",children:Ct.map(s=>{const y=s.icon,S=u===s.id;return e.jsxs("button",{onClick:()=>P(s.id),className:l("flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[10px] font-medium transition-all",S?"bg-foreground text-background shadow-sm":"bg-muted text-muted-foreground hover:bg-muted/80"),children:[e.jsx(y,{className:"h-3 w-3"}),s.label]},s.id)})}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:ws.map(s=>{const y=s.icon;return e.jsxs("button",{onClick:()=>ls(s),className:l("flex items-start gap-3 p-3 rounded-xl text-left transition-all hover:scale-[1.01]",I?.id===s.id?"bg-primary/5 ring-2 ring-primary/20":"bg-muted/30 hover:bg-muted/50"),children:[e.jsx("div",{className:l("p-1.5 rounded-lg shrink-0",I?.id===s.id?"bg-primary/20 text-primary":"bg-muted text-muted-foreground"),children:e.jsx(y,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:s.name}),e.jsx("div",{className:"text-[10px] text-muted-foreground line-clamp-2",children:s.description})]})]},s.id)})}),ns.length>0&&e.jsxs("div",{className:"mt-4 pt-4 border-t",children:[e.jsx(g,{className:"text-xs text-muted-foreground",children:"Your Templates"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:ns.slice(0,4).map(s=>e.jsxs("button",{onClick:()=>ls(s),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-muted/30 hover:bg-muted/50 text-xs",children:[e.jsx(et,{className:"h-3 w-3 text-primary"}),s.name]},s.id))})]}),e.jsx("div",{className:"mt-4",children:e.jsx(_,{type:"tip",children:"Select a template to get started quickly, or choose a job type below for custom configuration."})})]}),e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center justify-between mb-3",children:e.jsx(g,{className:"text-xs uppercase tracking-wider text-muted-foreground",children:c==="simple"?"Or Choose Job Type":"Job Type"})}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:te.map(s=>{const y=s.icon,S=p===s.type;return e.jsxs("button",{onClick:()=>{$(s.type),Z(null)},className:l("relative overflow-hidden group p-4 rounded-2xl text-left transition-all duration-200",S?"bg-primary/5 ring-2 ring-primary/20 scale-[1.02]":"bg-muted/30 hover:bg-muted/50 hover:scale-[1.01]"),children:[e.jsx("div",{className:l("absolute inset-0 bg-linear-to-br opacity-0 transition-opacity",s.color,S&&"opacity-100","group-hover:opacity-50")}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:l("p-2 rounded-lg transition-colors",S?"bg-primary text-primary-foreground":"bg-muted"),children:e.jsx(y,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:l("font-semibold",S&&"text-primary"),children:s.label}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s.description})]}),S&&e.jsx(G,{className:"h-5 w-5 text-primary"})]}),c==="advanced"&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-3",children:s.examples.map((B,me)=>e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-muted/80 text-[10px] text-muted-foreground",children:B},me))})]})]},s.type)})}),ye&&e.jsxs("div",{className:"mt-4 space-y-2",children:[e.jsx(_,{type:"info",children:ye.guide}),ye.warning&&e.jsx(_,{type:"warning",children:ye.warning})]})]})]}),d==="schedule"&&e.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-right-4 duration-300",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"When to Run?"}),e.jsx("div",{className:"grid grid-cols-4 gap-2 mt-3",children:St.map(s=>{const y=s.icon,S=v===s.type;return e.jsxs("button",{onClick:()=>E(s.type),className:l("flex flex-col items-center gap-2 p-4 rounded-xl transition-all",S?"bg-primary/5 ring-2 ring-primary/20":"bg-muted/30 hover:bg-muted/50"),children:[e.jsx(y,{className:l("h-6 w-6",S?"text-primary":"text-muted-foreground")}),e.jsx("span",{className:l("text-xs font-medium",S&&"text-primary"),children:s.label})]},s.type)})})]}),v==="cron"&&e.jsxs("div",{className:"space-y-4 animate-in fade-in duration-200",children:[e.jsxs("div",{children:[e.jsx(g,{htmlFor:"cron",children:"Cron Expression"}),e.jsx(C,{id:"cron",placeholder:"*/5 * * * *",value:M,onChange:s=>q(s.target.value),className:"mt-2 font-mono text-sm"}),e.jsx("div",{className:"mt-2 px-3 py-2 rounded-lg bg-primary/5 border border-primary/20",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-primary",children:[e.jsx(ke,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:ds(M)})]})})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-xs text-muted-foreground",children:"Presets"}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:ys.map(s=>e.jsx("button",{onClick:()=>q(s.value),className:l("px-3 py-1.5 rounded-lg text-xs font-medium transition-all",M===s.value?"bg-primary text-primary-foreground shadow-md":"bg-muted hover:bg-muted/80"),children:s.label},s.value))})]}),e.jsxs(_,{type:"info",children:["Cron format: ",e.jsx("code",{className:"font-mono bg-muted px-1 rounded",children:"minute hour day month weekday"}),e.jsx("br",{}),"Use ",e.jsx("code",{className:"font-mono bg-muted px-1 rounded",children:"*"})," for any value, ",e.jsx("code",{className:"font-mono bg-muted px-1 rounded",children:"*/N"})," for every N units."]})]}),v==="interval"&&e.jsxs("div",{className:"space-y-4 animate-in fade-in duration-200",children:[e.jsxs("div",{children:[e.jsx(g,{htmlFor:"interval",children:"Interval (seconds)"}),e.jsx(C,{id:"interval",type:"number",min:1,value:A,onChange:s=>H(parseInt(s.target.value)||60),className:"mt-2"}),e.jsx("div",{className:"mt-2 px-3 py-2 rounded-lg bg-primary/5 border border-primary/20",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-primary",children:[e.jsx(pe,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:Ae.find(s=>s.value===A)?.humanize||`Every ${A} seconds`})]})})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:Ae.map(s=>e.jsx("button",{onClick:()=>H(s.value),className:l("px-3 py-1.5 rounded-lg text-xs font-medium transition-all",A===s.value?"bg-primary text-primary-foreground shadow-md":"bg-muted hover:bg-muted/80"),children:s.label},s.value))})]}),v==="oneshot"&&e.jsxs("div",{className:"space-y-4 animate-in fade-in duration-200",children:[e.jsxs("div",{children:[e.jsx(g,{children:"Run At"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-2",children:[e.jsxs("div",{children:[e.jsx(C,{type:"date",value:T,onChange:s=>n(s.target.value),min:new Date().toISOString().split("T")[0]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Date"})]}),e.jsxs("div",{children:[e.jsx(C,{type:"time",value:R,onChange:s=>fe(s.target.value)}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Time"})]})]}),T&&R&&e.jsx("div",{className:"mt-2 px-3 py-2 rounded-lg bg-primary/5 border border-primary/20",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-primary",children:[e.jsx(Te,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:new Date(`${T}T${R}`).toLocaleString()})]})})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:ss,onChange:s=>ts(s.target.checked),className:"rounded"}),e.jsx("span",{className:"text-muted-foreground",children:"Auto-delete after completion"})]}),e.jsx(_,{type:"info",children:"One-shot jobs run exactly once at the specified time and can optionally be deleted afterward."})]}),v==="event"&&e.jsxs("div",{className:"space-y-4 animate-in fade-in duration-200",children:[e.jsxs("div",{children:[e.jsx(g,{children:"Event Type"}),e.jsx("div",{className:"grid grid-cols-4 gap-2 mt-2",children:Tt.map(s=>e.jsxs("button",{onClick:()=>be(s.type),className:l("flex flex-col items-center p-3 rounded-xl text-center transition-all",U===s.type?"bg-primary/5 ring-2 ring-primary/20":"bg-muted/30 hover:bg-muted/50"),children:[e.jsx("span",{className:l("text-xs font-medium",U===s.type&&"text-primary"),children:s.label}),e.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:s.description})]},s.type))})]}),c==="advanced"&&e.jsxs("div",{children:[e.jsx(g,{htmlFor:"eventConfig",children:"Event Config (JSON)"}),e.jsx(C,{id:"eventConfig",placeholder:'{"source": "webhook"}',value:ve,onChange:s=>je(s.target.value),className:"mt-2 font-mono text-xs"})]}),e.jsx(_,{type:"info",children:"Event-triggered jobs run when specific events occur, like webhooks or file changes."})]}),c==="advanced"&&v==="cron"&&e.jsxs("div",{children:[e.jsx(g,{htmlFor:"timezone",children:"Timezone"}),e.jsx(C,{id:"timezone",placeholder:"UTC",value:a,onChange:s=>ee(s.target.value),className:"mt-2"}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"Default: UTC. Use IANA timezone names (e.g., America/New_York)."})]})]}),d==="config"&&e.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-right-4 duration-300",children:[I?.guide&&e.jsxs(_,{type:"tip",children:[e.jsxs("strong",{children:[I.name,":"]})," ",I.guide]}),I?.warning&&e.jsx(_,{type:"warning",children:I.warning}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(g,{htmlFor:"name",className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Job Name *"}),e.jsx(C,{id:"name",placeholder:"e.g., Sync GitHub Issues",value:w,onChange:s=>L(s.target.value),className:"mt-2 text-lg font-medium"})]}),e.jsxs("div",{children:[e.jsx(g,{htmlFor:"description",className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Description"}),e.jsx(C,{id:"description",placeholder:"What this job does...",value:k,onChange:s=>F(s.target.value),className:"mt-2"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx(g,{htmlFor:"payload",className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Payload (JSON)"}),de.valid?e.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-600",children:[e.jsx(G,{className:"h-3 w-3"})," Valid"]}):e.jsxs("span",{className:"flex items-center gap-1 text-xs text-red-500",children:[e.jsx(we,{className:"h-3 w-3"})," ",de.error]})]}),e.jsx("textarea",{id:"payload",value:Q,onChange:s=>X(s.target.value),className:l("w-full p-4 rounded-xl bg-muted/40 font-mono text-sm resize-none h-32 transition-colors focus:outline-none focus:ring-1 focus:ring-primary/30",!de.valid&&"ring-1 ring-red-500"),placeholder:'{"url": "https://..."}'})]}),c==="advanced"&&e.jsxs("div",{className:"p-4 rounded-xl bg-muted/30 space-y-4",children:[e.jsxs("div",{className:"text-xs uppercase tracking-wider text-muted-foreground font-medium flex items-center gap-2",children:[e.jsx(js,{className:"h-3.5 w-3.5"}),"Advanced Options"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(os,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm",children:"Retry on failure"})]}),e.jsx("input",{type:"checkbox",checked:ie,onChange:s=>Ge(s.target.checked),className:"rounded"})]}),ie&&e.jsxs("div",{className:"grid grid-cols-2 gap-3 pl-6",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-xs",children:"Max Retries"}),e.jsx(C,{type:"number",min:1,max:10,value:Ee,onChange:s=>Qe(parseInt(s.target.value)||3),className:"mt-1 h-8 text-xs"})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-xs",children:"Backoff"}),e.jsxs("select",{value:Me,onChange:s=>We(s.target.value),className:"w-full mt-1 h-8 px-2 rounded-md border bg-background text-xs",children:[e.jsx("option",{value:"exponential",children:"Exponential"}),e.jsx("option",{value:"linear",children:"Linear"}),e.jsx("option",{value:"fixed",children:"Fixed"})]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Je,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm",children:"Send notifications"})]}),e.jsx("input",{type:"checkbox",checked:oe,onChange:s=>Be(s.target.checked),className:"rounded"})]}),oe&&e.jsxs("div",{className:"pl-6 space-y-2",children:[e.jsx(C,{placeholder:"Slack channel, webhook URL, or email",value:W,onChange:s=>Ve(s.target.value),className:"text-xs"}),e.jsxs("div",{className:"flex items-center gap-4 text-xs",children:[e.jsxs("label",{className:"flex items-center gap-1",children:[e.jsx("input",{type:"checkbox",checked:Ye,onChange:s=>Xe(s.target.checked),className:"rounded"}),"On success"]}),e.jsxs("label",{className:"flex items-center gap-1",children:[e.jsx("input",{type:"checkbox",checked:Ze,onChange:s=>es(s.target.checked),className:"rounded"}),"On failure"]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsxs(g,{className:"text-xs flex items-center gap-1",children:["Max Runs",e.jsx(Pe,{content:"Stop after N runs",children:e.jsx(De,{className:"h-3 w-3"})})]}),e.jsx(C,{type:"number",min:1,placeholder:"Unlimited",value:ce||"",onChange:s=>as(s.target.value?parseInt(s.target.value):null),className:"mt-1 h-8 text-xs"})]}),e.jsxs("div",{children:[e.jsxs(g,{className:"text-xs flex items-center gap-1",children:["Max Failures",e.jsx(Pe,{content:"Pause after N consecutive failures",children:e.jsx(De,{className:"h-3 w-3"})})]}),e.jsx(C,{type:"number",min:1,placeholder:"Unlimited",value:Re||"",onChange:s=>rs(s.target.value?parseInt(s.target.value):null),className:"mt-1 h-8 text-xs"})]})]})]})]}),d==="review"&&e.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-right-4 duration-300",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-linear-to-br from-primary/20 to-primary/5 mb-3",children:e.jsx(G,{className:"h-8 w-8 text-primary"})}),e.jsx("h3",{className:"text-lg font-semibold",children:"Ready to Create"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Review your job configuration"})]}),e.jsxs("div",{className:"p-5 rounded-2xl bg-linear-to-br from-muted/50 to-transparent space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Job Name"}),e.jsx("div",{className:"text-lg font-semibold mt-1",children:w||"Untitled Job"}),k&&e.jsx("div",{className:"text-sm text-muted-foreground mt-0.5",children:k})]}),p&&e.jsx("div",{className:l("p-2 rounded-lg",p==="http"&&"bg-blue-500/20",p==="tool"&&"bg-indigo-500/20",p==="script"&&"bg-green-500/20",p==="message"&&"bg-orange-500/20"),children:te.find(s=>s.type===p)?.icon&&(()=>{const s=te.find(y=>y.type===p).icon;return e.jsx(s,{className:"h-5 w-5"})})()})]}),e.jsx("hr",{className:"border-border/50"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Type"}),e.jsx("div",{className:"text-sm font-medium mt-1",children:te.find(s=>s.type===p)?.label})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Schedule"}),e.jsx("div",{className:"text-sm font-medium mt-1",children:Es})]})]}),e.jsx("hr",{className:"border-border/50"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-2",children:"Payload"}),e.jsx("pre",{className:"p-3 rounded-lg bg-muted/50 text-xs font-mono overflow-x-auto max-h-24",children:Q})]}),c==="advanced"&&(ie||oe||ce||Re)&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"border-border/50"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[ie&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full bg-muted text-xs",children:[e.jsx(os,{className:"h-3 w-3"}),Ee,"x ",Me," retries"]}),oe&&W&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full bg-muted text-xs",children:[e.jsx(Je,{className:"h-3 w-3"}),"Notify: ",W.slice(0,15),"..."]}),ce&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full bg-muted text-xs",children:[e.jsx(As,{className:"h-3 w-3"}),"Max ",ce," runs"]})]})]})]}),p==="script"&&e.jsxs(_,{type:"warning",children:[e.jsx("strong",{children:"Security Notice:"})," Script jobs execute shell commands with server permissions. Ensure your command is safe before creating."]}),se.isError&&e.jsxs("div",{className:"flex items-center gap-2 p-4 rounded-xl bg-red-500/10 border border-red-500/20 text-red-500 text-sm",children:[e.jsx(we,{className:"h-5 w-5 shrink-0"}),e.jsx("span",{children:se.error instanceof Error?se.error.message:"Failed to create job"})]})]})]}),e.jsxs("div",{className:"border-t border-border/20 p-4 flex items-center justify-between bg-muted/30",children:[e.jsxs(D,{variant:"ghost",onClick:x===0?()=>N(!1):Ts,className:"gap-2",children:[e.jsx(Ps,{className:"h-4 w-4"}),x===0?"Cancel":"Back"]}),d==="review"?e.jsx(D,{onClick:()=>se.mutate(),disabled:se.isPending,className:"gap-2 min-w-35 shadow-lg shadow-primary/20",children:se.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(qe,{className:"h-4 w-4"}),"Create Job"]})}):e.jsxs(D,{onClick:Ss,disabled:!Cs,className:"gap-2",children:["Continue",e.jsx(Fs,{className:"h-4 w-4"})]})]})]})]})}const Mt=[{value:"http",label:"HTTP Request",icon:Se},{value:"tool",label:"Tool Execution",icon:Y},{value:"script",label:"Shell Script",icon:ue},{value:"message",label:"Notification",icon:Ce}],Rt=[{label:"1 min",value:"* * * * *"},{label:"5 min",value:"*/5 * * * *"},{label:"15 min",value:"*/15 * * * *"},{label:"30 min",value:"*/30 * * * *"},{label:"Hourly",value:"0 * * * *"},{label:"Daily",value:"0 0 * * *"},{label:"Weekly",value:"0 0 * * 0"}];function Dt(t){return{"* * * * *":"Every minute","*/5 * * * *":"Every 5 minutes","*/15 * * * *":"Every 15 minutes","*/30 * * * *":"Every 30 minutes","0 * * * *":"Every hour","0 0 * * *":"Daily at midnight","0 0 * * 0":"Weekly on Sunday","0 9 * * 1-5":"Weekdays at 9 AM"}[t]||t}function At({type:t,children:o}){const f={info:{icon:Le,bg:"bg-blue-500/10",border:"border-blue-500/20",text:"text-blue-400"},warning:{icon:we,bg:"bg-amber-500/10",border:"border-amber-500/20",text:"text-amber-400"},tip:{icon:Le,bg:"bg-green-500/10",border:"border-green-500/20",text:"text-green-400"}},{icon:i,bg:j,border:h,text:N}=f[t];return e.jsxs("div",{className:l("flex items-start gap-2 p-3 rounded-lg border text-xs",j,h,N),children:[e.jsx(i,{className:"h-4 w-4 shrink-0 mt-0.5"}),e.jsx("div",{children:o})]})}function Pt({job:t,open:o,onOpenChange:f}){const i=ze(),[j,h]=r.useState(""),[N,c]=r.useState(""),[b,d]=r.useState("cron"),[m,x]=r.useState("*/5 * * * *"),[u,P]=r.useState(300),[w,L]=r.useState("{}"),[k,F]=r.useState([]),[p,$]=r.useState(""),[v,E]=r.useState("active");r.useEffect(()=>{t&&(h(t.name),c(t.description||""),d(t.cronExpression?"cron":"interval"),x(t.cronExpression||"*/5 * * * *"),P(t.intervalMs?Math.round(t.intervalMs/1e3):300),L(JSON.stringify(t.payload||{},null,2)),F(t.labels||[]),E(t.status==="paused"?"paused":"active"))},[t]);const M=K({mutationFn:()=>{if(!t)throw new Error("No job to update");const n=JSON.parse(w);return O.cron.update(t.id,{name:j,description:N||void 0,cronExpression:b==="cron"?m:void 0,intervalMs:b==="interval"?u*1e3:void 0,payload:n,labels:k,status:v})},onSuccess:()=>{i.invalidateQueries({queryKey:["cron-jobs"]}),i.invalidateQueries({queryKey:["cron-stats"]}),f(!1)}}),q=j.trim().length>0&&(b==="cron"&&m.trim().length>0||b==="interval"&&u>=1),A=()=>{const n=p.trim().toLowerCase();n&&!k.includes(n)&&(F([...k,n]),$(""))},H=n=>{F(k.filter(R=>R!==n))};if(!t)return null;const T=Mt.find(n=>n.value===t.jobType)?.icon||Y;return e.jsx($e,{open:o,onOpenChange:f,children:e.jsxs(He,{className:"max-w-2xl max-h-[85vh] flex flex-col overflow-hidden",children:[e.jsx(Ue,{children:e.jsxs(Ke,{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-xl bg-primary/10",children:e.jsx(T,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("span",{className:"block",children:"Edit Scheduled Job"}),e.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:[t.jobType.toUpperCase()," • Created ",new Date(t.createdAt).toLocaleDateString()]})]})]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto space-y-6 py-4",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(g,{htmlFor:"name",children:"Job Name"}),e.jsx(C,{id:"name",value:j,onChange:n=>h(n.target.value),placeholder:"My Scheduled Job",className:"mt-1.5"})]}),e.jsxs("div",{children:[e.jsx(g,{htmlFor:"description",children:"Description (optional)"}),e.jsx(C,{id:"description",value:N,onChange:n=>c(n.target.value),placeholder:"What this job does...",className:"mt-1.5"})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-xs uppercase tracking-wider text-muted-foreground mb-2 block",children:"Status"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:()=>E("active"),className:l("flex items-center gap-2 px-4 py-2 rounded-xl border transition-all",v==="active"?"border-green-500/50 bg-green-500/10 text-green-500":"border-border/50 hover:border-border"),children:[e.jsx(ke,{className:"h-4 w-4"}),"Active"]}),e.jsxs("button",{onClick:()=>E("paused"),className:l("flex items-center gap-2 px-4 py-2 rounded-xl border transition-all",v==="paused"?"border-amber-500/50 bg-amber-500/10 text-amber-500":"border-border/50 hover:border-border"),children:[e.jsx(ge,{className:"h-4 w-4"}),"Paused"]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-xs uppercase tracking-wider text-muted-foreground mb-2 block",children:"Schedule"}),e.jsxs("div",{className:"flex gap-2 mb-4",children:[e.jsxs("button",{onClick:()=>d("cron"),className:l("flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-all",b==="cron"?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"),children:[e.jsx(J,{className:"h-4 w-4"}),"Cron"]}),e.jsxs("button",{onClick:()=>d("interval"),className:l("flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-all",b==="interval"?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"),children:[e.jsx(pe,{className:"h-4 w-4"}),"Interval"]})]}),b==="cron"?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(C,{value:m,onChange:n=>x(n.target.value),placeholder:"*/5 * * * *",className:"font-mono"}),e.jsx("div",{className:"mt-2 px-3 py-2 rounded-lg bg-primary/5 border border-primary/20",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-primary",children:[e.jsx(ke,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:Dt(m)})]})})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:Rt.map(n=>e.jsx("button",{onClick:()=>x(n.value),className:l("px-3 py-1.5 rounded-lg text-xs font-medium transition-all",m===n.value?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"),children:n.label},n.value))})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Every"}),e.jsx(C,{type:"number",min:1,value:u,onChange:n=>P(parseInt(n.target.value)||60),className:"w-24"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"seconds"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:[30,60,300,600,1800,3600].map(n=>e.jsx("button",{onClick:()=>P(n),className:l("px-3 py-1.5 rounded-lg text-xs font-medium transition-all",u===n?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"),children:n<60?`${n}s`:n<3600?`${n/60}m`:`${n/3600}h`},n))})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-xs uppercase tracking-wider text-muted-foreground mb-2 block",children:"Labels"}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:k.map(n=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-lg bg-primary/10 text-primary text-xs",children:[e.jsx(vs,{className:"h-3 w-3"}),n,e.jsx("button",{onClick:()=>H(n),className:"ml-1 hover:text-red-500",children:e.jsx(Is,{className:"h-3 w-3"})})]},n))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(C,{value:p,onChange:n=>$(n.target.value),placeholder:"Add label...",className:"flex-1",onKeyDown:n=>n.key==="Enter"&&(n.preventDefault(),A())}),e.jsx(D,{variant:"outline",size:"sm",onClick:A,disabled:!p.trim(),children:e.jsx(fs,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{children:[e.jsx(g,{htmlFor:"payload",children:"Payload (JSON)"}),e.jsx("textarea",{id:"payload",value:w,onChange:n=>L(n.target.value),rows:6,className:"w-full mt-1.5 px-3 py-2 rounded-lg border border-border bg-background font-mono text-sm resize-none focus:outline-none focus:ring-2 focus:ring-primary/50"}),e.jsx(At,{type:"info",children:"Payload is specific to job type. HTTP jobs need url/method, tool jobs need tool/params."})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t",children:[e.jsx(D,{variant:"ghost",onClick:()=>f(!1),children:"Cancel"}),e.jsx(D,{onClick:()=>M.mutate(),disabled:!q||M.isPending,className:"gap-2",children:M.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"h-4 w-4 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ws,{className:"h-4 w-4"}),"Save Changes"]})})]}),M.isError&&e.jsxs("div",{className:"mt-2 p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:[e.jsx(we,{className:"h-4 w-4 inline mr-2"}),M.error.message]})]})})}const xs=[{value:"all",label:"All Status",icon:J},{value:"active",label:"Active",icon:G},{value:"paused",label:"Paused",icon:ge},{value:"completed",label:"Completed",icon:G},{value:"failed",label:"Failed",icon:ae},{value:"archived",label:"Archived",icon:_e}],us=[{value:"all",label:"All Types",icon:Te},{value:"http",label:"HTTP",icon:Se},{value:"tool",label:"Tool",icon:Y},{value:"script",label:"Script",icon:ue},{value:"message",label:"Message",icon:Ce}];function na(){const t=ze(),[o,f]=r.useState(""),[i,j]=r.useState("all"),[h,N]=r.useState("all"),[c,b]=r.useState(null),[d,m]=r.useState(""),[x,u]=r.useState(null),[P,w]=r.useState(null),{data:L,isLoading:k,error:F,refetch:p}=Ne({queryKey:["cron-jobs",i,h],queryFn:()=>O.cron.list({status:i!=="all"?i:void 0,jobType:h!=="all"?h:void 0,limit:100}),refetchInterval:1e4}),{data:$}=Ne({queryKey:["cron-stats"],queryFn:()=>O.cron.stats(),refetchInterval:3e4}),v=L?.jobs||[],E=$?.stats,M=v.filter(a=>o?a.name.toLowerCase().includes(o.toLowerCase())||a.description?.toLowerCase().includes(o.toLowerCase()):!0),q=K({mutationFn:a=>O.cron.trigger(a),onSuccess:()=>{t.invalidateQueries({queryKey:["cron-jobs"]})}}),A=K({mutationFn:a=>O.cron.pause(a),onSuccess:()=>{t.invalidateQueries({queryKey:["cron-jobs"]}),t.invalidateQueries({queryKey:["cron-stats"]})}}),H=K({mutationFn:a=>O.cron.resume(a),onSuccess:()=>{t.invalidateQueries({queryKey:["cron-jobs"]}),t.invalidateQueries({queryKey:["cron-stats"]})}}),T=K({mutationFn:a=>O.cron.delete(a),onSuccess:()=>{t.invalidateQueries({queryKey:["cron-jobs"]}),t.invalidateQueries({queryKey:["cron-stats"]}),u(null)}}),n=K({mutationFn:a=>O.cron.archive(a),onSuccess:()=>{t.invalidateQueries({queryKey:["cron-jobs"]}),t.invalidateQueries({queryKey:["cron-stats"]})}}),R=K({mutationFn:a=>O.cron.restore(a),onSuccess:()=>{t.invalidateQueries({queryKey:["cron-jobs"]}),t.invalidateQueries({queryKey:["cron-stats"]})}}),fe=r.useCallback(a=>{q.mutate(a)},[q]),U=r.useCallback(a=>{A.mutate(a)},[A]),be=r.useCallback(a=>{H.mutate(a)},[H]),ve=r.useCallback(a=>{b(a.id),m(a.name)},[]),je=r.useCallback(a=>{u(a)},[]),Q=r.useCallback(a=>{w(a)},[]),X=r.useCallback(a=>{n.mutate(a)},[n]),I=r.useCallback(a=>{R.mutate(a)},[R]),Z=()=>{x&&T.mutate(x)};return F?e.jsxs("div",{className:"glass rounded-[28px] p-12 text-center",children:[e.jsx(he,{className:"h-12 w-12 mx-auto text-red-400 mb-4"}),e.jsx("p",{className:"text-lg font-bold text-red-400",children:"Error loading scheduled jobs"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:F.message}),e.jsxs(D,{variant:"outline",onClick:()=>p(),className:"mt-4",children:[e.jsx(re,{className:"h-4 w-4 mr-2"}),"Retry"]})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[e.jsx(J,{className:"h-6 w-6 text-primary"}),"Scheduled Jobs"]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Manage automated tasks with cron schedules or fixed intervals"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(D,{variant:"outline",size:"sm",onClick:()=>p(),disabled:k,children:[e.jsx(re,{className:l("h-4 w-4 mr-2",k&&"animate-spin")}),"Refresh"]}),e.jsx(ms,{})]})]}),E&&e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:[e.jsxs("div",{className:"glass rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mb-1",children:[e.jsx(Te,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs",children:"Total Jobs"})]}),e.jsx("div",{className:"text-2xl font-bold",children:E.total})]}),e.jsxs("div",{className:"glass rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-green-500 mb-1",children:[e.jsx(ps,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs",children:"Active"})]}),e.jsx("div",{className:"text-2xl font-bold text-green-500",children:E.active})]}),e.jsxs("div",{className:"glass rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-amber-500 mb-1",children:[e.jsx(ge,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs",children:"Paused"})]}),e.jsx("div",{className:"text-2xl font-bold text-amber-500",children:E.paused})]}),e.jsxs("div",{className:"glass rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mb-1",children:[e.jsx(xe,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs",children:"Total Runs"})]}),e.jsx("div",{className:"text-2xl font-bold",children:E.totalRuns})]}),e.jsxs("div",{className:"glass rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-green-500 mb-1",children:[e.jsx(tt,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs",children:"Successes"})]}),e.jsx("div",{className:"text-2xl font-bold text-green-500",children:E.totalSuccesses})]}),e.jsxs("div",{className:"glass rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-red-500 mb-1",children:[e.jsx(ae,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs",children:"Failures"})]}),e.jsx("div",{className:"text-2xl font-bold text-red-500",children:E.totalFailures})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-sm",children:[e.jsx(Os,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(C,{placeholder:"Search jobs...",value:o,onChange:a=>f(a.target.value),className:"pl-10 bg-white/5 border-white/10 rounded-xl"})]}),e.jsxs(Fe,{children:[e.jsx(Ie,{asChild:!0,children:e.jsxs(D,{variant:"outline",size:"sm",className:"gap-2",children:[e.jsx(at,{className:"h-4 w-4"}),xs.find(a=>a.value===i)?.label]})}),e.jsx(Oe,{align:"start",children:xs.map(a=>{const ee=a.icon;return e.jsxs(z,{onClick:()=>j(a.value),className:l(i===a.value&&"bg-primary/10"),children:[e.jsx(ee,{className:"h-4 w-4 mr-2"}),a.label]},a.value)})})]}),e.jsxs(Fe,{children:[e.jsx(Ie,{asChild:!0,children:e.jsxs(D,{variant:"outline",size:"sm",className:"gap-2",children:[e.jsx(gs,{className:"h-4 w-4"}),us.find(a=>a.value===h)?.label]})}),e.jsx(Oe,{align:"start",children:us.map(a=>{const ee=a.icon;return e.jsxs(z,{onClick:()=>N(a.value),className:l(h===a.value&&"bg-primary/10"),children:[e.jsx(ee,{className:"h-4 w-4 mr-2"}),a.label]},a.value)})})]})]}),k?e.jsxs("div",{className:"glass rounded-[28px] p-12 flex flex-col items-center justify-center",children:[e.jsx(ne,{className:"h-8 w-8 animate-spin text-primary mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading scheduled jobs..."})]}):M.length===0?e.jsxs("div",{className:"glass rounded-[28px] p-12 text-center",children:[e.jsx(J,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-semibold mb-1",children:o||i!=="all"||h!=="all"?"No jobs match your filters":"No scheduled jobs yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:o||i!=="all"||h!=="all"?"Try adjusting your search or filters":"Create your first scheduled job to automate tasks"}),!(o||i!=="all"||h!=="all")&&e.jsx(ms,{})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:M.map(a=>e.jsx(vt,{job:a,onTrigger:fe,onPause:U,onResume:be,onDelete:je,onViewHistory:()=>ve(a),onEdit:Q,onArchive:X,onRestore:I},a.id))}),e.jsx(kt,{jobId:c,jobName:d,open:!!c,onOpenChange:a=>!a&&b(null)}),e.jsx(Pt,{job:P,open:!!P,onOpenChange:a=>!a&&w(null)}),e.jsx(Js,{open:!!x,onOpenChange:a=>!a&&u(null),children:e.jsxs(Ls,{children:[e.jsxs(zs,{children:[e.jsx(qs,{children:"Delete Scheduled Job?"}),e.jsx(_s,{children:"This will permanently delete this job and all its run history. This action cannot be undone."})]}),e.jsxs($s,{children:[e.jsx(Hs,{children:"Cancel"}),e.jsx(Us,{onClick:Z,className:"bg-red-500 hover:bg-red-600",disabled:T.isPending,children:T.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"h-4 w-4 mr-2 animate-spin"}),"Deleting..."]}):"Delete Job"})]})]})})]})}export{ms as CreateJobModal,na as CronDashboard,Pt as EditJobModal,vt as JobCard,kt as JobHistoryModal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as Q,u as A,n as w,o as b,m as f,r as p,j as e,b as i,f as c,k as j,H as k,ak as y,i as C,U as L,g as D,a5 as I,R as v,t as h}from"./index-kb4AJXUB.js";import{B as q}from"./badge-B4ov81_m.js";import{S as z}from"./skeleton-CtkIA_MU.js";import{C as B}from"./circle-x-BN89YhbS.js";import{C as K}from"./chevron-up-BRTtndUZ.js";import{T as M}from"./trash-2-B4oAXsX-.js";const E=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],U=Q("skull",E);function _(){return A({queryKey:["dlq"],queryFn:()=>f.dlq.list(),refetchInterval:1e4})}function H(){const t=w();return b({mutationFn:n=>f.dlq.retry(n),onSuccess:()=>{t.invalidateQueries({queryKey:["dlq"]}),t.invalidateQueries({queryKey:["tasks"]})}})}function X(){const t=w();return b({mutationFn:n=>f.dlq.remove(n),onSuccess:()=>{t.invalidateQueries({queryKey:["dlq"]})}})}function G({task:t,onRetry:n,onRemove:u,isRetrying:o,isRemoving:x}){const[l,m]=p.useState(!1);return e.jsx(i,{className:"glass rounded-[20px] overflow-hidden border-red-500/10 group hover-lift transition-liquid",children:e.jsx(c,{className:"p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"h-8 w-8 rounded-xl bg-red-500/10 flex items-center justify-center flex-shrink-0",children:e.jsx(B,{className:"h-4 w-4 text-red-400"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-bold truncate",children:t.title}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(D,{className:"h-3 w-3"}),new Date(t.failedAt).toLocaleString()]}),e.jsxs(q,{variant:"secondary",className:"text-[9px] px-1.5 py-0",children:[t.attempts," ",t.attempts===1?"attempt":"attempts"]})]})]})]}),e.jsx("button",{onClick:()=>m(!l),className:"w-full text-left",children:e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[l?e.jsx(K,{className:"h-3 w-3"}):e.jsx(I,{className:"h-3 w-3"}),e.jsx("span",{className:C("transition-all",l?"":"truncate"),children:t.error})]})}),l&&e.jsx("div",{className:"mt-3 p-3 rounded-xl bg-red-500/5 border border-red-500/10",children:e.jsx("pre",{className:"text-[10px] text-red-300 whitespace-pre-wrap font-mono overflow-x-auto",children:t.error})})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsxs(j,{variant:"outline",size:"sm",className:"h-8 rounded-xl text-[11px] font-bold border-green-500/20 text-green-400 hover:bg-green-500/10",onClick:n,disabled:o,children:[o?e.jsx(v,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}):e.jsx(k,{className:"h-3.5 w-3.5 mr-1.5"}),"Retry"]}),e.jsxs(j,{variant:"outline",size:"sm",className:"h-8 rounded-xl text-[11px] font-bold border-red-500/20 text-red-400 hover:bg-red-500/10",onClick:u,disabled:x,children:[x?e.jsx(v,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}):e.jsx(M,{className:"h-3.5 w-3.5 mr-1.5"}),"Remove"]})]})]})})})}function Z(){const{data:t,isLoading:n,error:u}=_(),o=H(),x=X(),[l,m]=p.useState(new Set),[R,g]=p.useState(new Set),N=async s=>{m(r=>new Set(r).add(s));try{await o.mutateAsync(s),h.success("Task queued for retry")}catch{h.error("Failed to retry task")}finally{m(r=>{const d=new Set(r);return d.delete(s),d})}},S=async s=>{g(r=>new Set(r).add(s));try{await x.mutateAsync(s),h.success("Task removed from DLQ")}catch{h.error("Failed to remove task")}finally{g(r=>{const d=new Set(r);return d.delete(s),d})}},T=async()=>{if(t?.tasks)for(const s of t.tasks)await N(s.id)};if(n)return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Failed Tasks"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading dead letter queue..."})]}),e.jsx("div",{className:"space-y-4",children:[1,2,3].map(s=>e.jsx(z,{className:"h-24 rounded-[20px] skeleton-glass"},s))})]});if(u)return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Failed Tasks"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Dead Letter Queue"})]}),e.jsx(i,{className:"glass rounded-[28px] border-red-500/10",children:e.jsx(c,{className:"p-8 text-center",children:e.jsx("p",{className:"text-red-400",children:"Failed to load dead letter queue"})})})]});const F=t?.tasks??[],a=t?.count??0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Failed Tasks"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Tasks that failed processing and need attention."})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[a>0&&e.jsxs(j,{variant:"outline",size:"sm",className:"rounded-xl text-[11px] font-bold",onClick:T,children:[e.jsx(k,{className:"h-3.5 w-3.5 mr-1.5"}),"Retry All (",a,")"]}),e.jsx("div",{className:C("flex items-center gap-2 px-4 py-2 rounded-full glass border-white/10",a>0?"border-red-500/20":"border-green-500/20"),children:a>0?e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"h-4 w-4 text-red-400"}),e.jsxs("span",{className:"text-[10px] font-bold uppercase tracking-widest text-red-400",children:[a," Failed"]})]}):e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"h-4 w-4 text-green-400"}),e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-green-400",children:"All Clear"})]})})]})]}),a>0&&e.jsx(i,{className:"glass rounded-[24px] border-yellow-500/10 overflow-hidden",children:e.jsx(c,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"h-12 w-12 rounded-2xl bg-gradient-to-br from-yellow-500 to-orange-600 flex items-center justify-center shadow-lg shadow-yellow-500/20",children:e.jsx(L,{className:"h-6 w-6 text-white"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold",children:"Attention Required"}),e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[a," ",a===1?"task has":"tasks have"," failed and been moved to the dead letter queue. Review the errors and retry or remove them."]})]})]})})}),a===0?e.jsx(i,{className:"glass rounded-[28px] border-white/5",children:e.jsx(c,{className:"p-12",children:e.jsxs("div",{className:"flex flex-col items-center justify-center text-center",children:[e.jsx("div",{className:"h-20 w-20 rounded-full glass-heavy flex items-center justify-center mb-6 border border-green-500/20",children:e.jsx(y,{className:"h-10 w-10 text-green-400"})}),e.jsx("h3",{className:"text-xl font-bold mb-2",children:"No Failed Tasks"}),e.jsx("p",{className:"text-muted-foreground max-w-md",children:"All tasks are processing normally. Failed tasks will appear here if any agent encounters an error during execution."})]})})}):e.jsx("div",{className:"space-y-3",children:F.map(s=>e.jsx(G,{task:s,onRetry:()=>N(s.id),onRemove:()=>S(s.id),isRetrying:l.has(s.id),isRemoving:R.has(s.id)},s.id))}),e.jsx(i,{className:"glass rounded-[24px] border-white/5",children:e.jsx(c,{className:"p-6",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"h-10 w-10 rounded-xl glass-heavy flex items-center justify-center flex-shrink-0",children:e.jsx(q,{variant:"secondary",className:"text-[10px] px-2 py-0.5",children:"?"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-bold",children:"About the Dead Letter Queue"}),e.jsxs("ul",{className:"text-[12px] text-muted-foreground space-y-1.5 list-disc list-inside",children:[e.jsx("li",{children:"Tasks are moved here after failing multiple retry attempts"}),e.jsxs("li",{children:[e.jsx("strong",{children:"Retry"})," puts the task back in the main queue for another attempt"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Remove"})," permanently deletes the task from the queue"]}),e.jsx("li",{children:"Check the error message to understand why the task failed"})]})]})]})})})]})}export{Z as DLQDashboard,_ as useDLQTasks,X as useRemoveDLQTask,H as useRetryDLQTask};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{u as S,m as T,j as e,i as x,r as j,K as g,O as f,Q as b,b as d,f as c,d as N,Z as z,e as v,$ as E,aj as u,k as w,J as I,t as O}from"./index-kb4AJXUB.js";import{B as L}from"./badge-B4ov81_m.js";import{S as U}from"./skeleton-CtkIA_MU.js";import{S as H}from"./StatusIndicator-DA3NAo_b.js";import{L as B}from"./link-2-BxNmr9hL.js";function P(){return S({queryKey:["integrations","status"],queryFn:()=>T.integrations.status(),staleTime:6e4})}function R({children:s,language:t,filename:r,showLineNumbers:a=!1,className:n}){const[l,i]=j.useState(!1),o=async()=>{await navigator.clipboard.writeText(s),i(!0),setTimeout(()=>i(!1),2e3)},k=s.trim().split(`
|
|
2
|
+
`);return e.jsxs("div",{className:x("rounded-xl overflow-hidden border border-zinc-800",n),children:[(r||t)&&e.jsxs("div",{className:"bg-zinc-900 px-4 py-2 flex items-center justify-between border-b border-zinc-800",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{className:"h-4 w-4 text-zinc-500"}),e.jsx("span",{className:"text-xs font-medium text-zinc-400",children:r||t})]}),e.jsx(p,{copied:l,onCopy:o})]}),e.jsxs("div",{className:"relative bg-zinc-950 group",children:[!r&&!t&&e.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(p,{copied:l,onCopy:o})}),e.jsx("pre",{className:"p-4 overflow-x-auto",children:e.jsx("code",{className:"text-sm font-mono text-zinc-200 leading-relaxed",children:a?k.map((C,h)=>e.jsxs("div",{className:"flex",children:[e.jsx("span",{className:"select-none w-8 text-zinc-600 text-right pr-4",children:h+1}),e.jsx("span",{children:C||" "})]},h)):s.trim()})})]})]})}function F({children:s,className:t}){return e.jsx("code",{className:x("relative rounded bg-zinc-900 px-[0.4rem] py-[0.2rem] font-mono text-sm text-zinc-200",t),children:s})}function p({copied:s,onCopy:t}){return e.jsx("button",{onClick:t,className:x("flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-colors",s?"bg-emerald-500/20 text-emerald-400":"bg-zinc-800 text-zinc-400 hover:text-zinc-200 hover:bg-zinc-700"),children:s?e.jsxs(e.Fragment,{children:[e.jsx(f,{className:"h-3 w-3"}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"h-3 w-3"}),"Copy"]})})}const W={github:E,jira:()=>e.jsx("svg",{viewBox:"0 0 24 24",className:"h-full w-full",fill:"currentColor",children:e.jsx("path",{d:"M11.75 0a11.75 11.75 0 1 0 0 23.5 11.75 11.75 0 0 0 0-23.5zM3.29 12.94l7.63-7.63a.65.65 0 0 1 .94 0l.47.47-6.2 6.2a.65.65 0 0 0 0 .94l.94.94a.65.65 0 0 0 .94 0l6.2-6.2.47.47a.65.65 0 0 1 0 .94l-7.63 7.63a1.29 1.29 0 0 1-1.88 0l-1.88-1.88a1.29 1.29 0 0 1 0-1.88z"})}),linear:()=>e.jsx("svg",{viewBox:"0 0 24 24",className:"h-full w-full",fill:"currentColor",children:e.jsx("path",{d:"M3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12ZM12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1ZM7 12L12 7V10.5H17V13.5H12V17L7 12Z"})})},Z={github:"from-gray-700 to-gray-900",jira:"from-blue-600 to-blue-800",linear:"from-indigo-500 to-indigo-600"};function y({text:s,label:t}){const[r,a]=j.useState(!1),n=()=>{navigator.clipboard.writeText(s),a(!0),O.success(`${t} copied to clipboard`),setTimeout(()=>a(!1),2e3)};return e.jsx(w,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-lg",onClick:n,children:r?e.jsx(f,{className:"h-3.5 w-3.5 text-green-500"}):e.jsx(b,{className:"h-3.5 w-3.5"})})}function q({name:s,icon:t,description:r,configured:a,webhookUrl:n,oauthUrl:l}){const i=W[t]||u,o=Z[t]||"from-gray-500 to-gray-700";return e.jsxs(d,{className:"glass rounded-[24px] overflow-hidden border-white/5 group hover-lift transition-liquid",children:[e.jsx(N,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:x("h-10 w-10 rounded-xl flex items-center justify-center bg-gradient-to-br shadow-lg",o),children:e.jsx("div",{className:"h-5 w-5 text-white",children:e.jsx(i,{})})}),e.jsxs("div",{children:[e.jsx(v,{className:"text-base font-bold",children:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:r})]})]}),e.jsx(H,{status:a?"online":"offline",label:a?"CONFIGURED":"NOT SET",showLabel:!0})]})}),e.jsxs(c,{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-widest text-muted-foreground flex items-center gap-1.5",children:[e.jsx(u,{className:"h-3 w-3"}),"Webhook URL"]}),e.jsxs("div",{className:"flex items-center gap-2 p-2.5 rounded-xl glass-heavy border border-white/5",children:[e.jsx("code",{className:"flex-1 text-[11px] text-muted-foreground truncate font-mono",children:n}),e.jsx(y,{text:n,label:"Webhook URL"})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-white/5",children:[e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"OAuth Connect"}),e.jsxs(w,{variant:"outline",size:"sm",className:"h-8 rounded-xl text-[11px] font-bold",onClick:()=>window.open(l,"_blank"),disabled:!a,children:[e.jsx(I,{className:"h-3.5 w-3.5 mr-1.5"}),a?"Connect":"Setup Required"]})]})]})]})}function m({name:s,endpoint:t,description:r}){return e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-2xl glass-heavy border border-white/5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-8 w-8 rounded-lg glass flex items-center justify-center",children:e.jsx(g,{className:"h-4 w-4 text-indigo-400"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold",children:s}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:r})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"text-[10px] text-muted-foreground font-mono px-2 py-1 rounded-lg bg-black/20 max-w-[200px] truncate",children:t}),e.jsx(y,{text:t,label:"Endpoint"})]})]})}function _(){const{data:s,isLoading:t,error:r}=P();if(t)return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Integrations"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading webhook status..."})]}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(i=>e.jsx(U,{className:"h-48 rounded-[24px] skeleton-glass"},i))})]});if(r)return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Integrations"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Webhook and OAuth configuration"})]}),e.jsx(d,{className:"glass rounded-[28px] border-red-500/10",children:e.jsx(c,{className:"p-8 text-center",children:e.jsx("p",{className:"text-red-400",children:"Failed to load integration status"})})})]});const a=s?.integrations??{},n=s?.hookEndpoints,l=Object.values(a).filter(i=>i.configured).length;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Integrations"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Webhook and OAuth configuration for external services."})]}),e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 rounded-full glass border-white/10",children:[e.jsx(B,{className:"h-4 w-4 text-blue-400"}),e.jsxs("span",{className:"text-[10px] font-bold uppercase tracking-widest",children:[l,"/",Object.keys(a).length," Connected"]})]})]}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:Object.entries(a).map(([i,o])=>e.jsx(q,{name:o.name,icon:o.icon,description:o.description,configured:o.configured,webhookUrl:o.webhookUrl,oauthUrl:o.oauthUrl},i))}),e.jsxs(d,{className:"glass rounded-[28px] border-white/5",children:[e.jsx(N,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-xl flex items-center justify-center bg-gradient-to-br from-orange-500 to-red-600 shadow-lg",children:e.jsx(z,{className:"h-5 w-5 text-white"})}),e.jsxs("div",{children:[e.jsx(v,{className:"text-lg font-bold",children:"Claude Code Hooks"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Zero-token activity tracking endpoints"})]})]})}),e.jsxs(c,{className:"space-y-3",children:[n&&e.jsxs(e.Fragment,{children:[e.jsx(m,{name:"Tool Use Hook",endpoint:n.toolUse,description:"POST after each tool call"}),e.jsx(m,{name:"Session End Hook",endpoint:n.sessionEnd,description:"POST when session completes"}),e.jsx(m,{name:"Prompt Submit Hook",endpoint:n.promptSubmit,description:"POST on user prompt"})]}),e.jsxs("div",{className:"mt-4 p-4 rounded-2xl bg-muted/50 border border-border",children:[e.jsx("p",{className:"text-[11px] font-bold uppercase tracking-widest text-muted-foreground mb-2",children:"Quick Setup"}),e.jsxs("p",{className:"text-[12px] text-muted-foreground mb-3",children:["Add this to your ",e.jsx(F,{children:"~/.claude/settings.json"}),":"]}),e.jsx(R,{filename:"~/.claude/settings.json",language:"json",children:`{
|
|
3
|
+
"hooks": {
|
|
4
|
+
"PostToolUse": "curl -X POST ${n?.toolUse||"http://localhost:3000/api/hook/tool-use"}",
|
|
5
|
+
"Stop": "curl -X POST ${n?.sessionEnd||"http://localhost:3000/api/hook/session-end"}"
|
|
6
|
+
}
|
|
7
|
+
}`})]})]})]}),e.jsx(d,{className:"glass rounded-[24px] border-white/5",children:e.jsx(c,{className:"p-6",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"h-10 w-10 rounded-xl glass-heavy flex items-center justify-center flex-shrink-0",children:e.jsx(L,{variant:"secondary",className:"text-[10px] px-2 py-0.5",children:"?"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-bold",children:"How to configure integrations"}),e.jsxs("ol",{className:"text-[12px] text-muted-foreground space-y-1.5 list-decimal list-inside",children:[e.jsx("li",{children:"Set the required environment variables (CLIENT_ID and CLIENT_SECRET)"}),e.jsx("li",{children:"Copy the webhook URL and add it to your service's webhook settings"}),e.jsx("li",{children:"Use the OAuth connect button to authenticate your account"}),e.jsx("li",{children:"Tasks will automatically be created from issues and tickets"})]})]})]})})})]})}export{_ as WebhookStatus,P as useIntegrationsStatus};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as O,r as m,u as v,o as Z,m as u,j as e,M as X,g as _,b as r,d as n,e as c,f as d,Z as J,ak as S,am as N,p as y,I as Y,k as ee}from"./index-kb4AJXUB.js";import{B as l}from"./badge-B4ov81_m.js";import{T as se}from"./textarea-D5LJCOGl.js";import{S as M,a as q,b as A,c as D,d as w}from"./select-LsO16slr.js";import{P as te}from"./progress-DjPEDJfI.js";import{C as R}from"./circle-x-BN89YhbS.js";import{S as ae}from"./server-B3k6noce.js";import{T as le}from"./trending-up-BGWxvlmZ.js";import"./chevron-up-BRTtndUZ.js";function he(){const k=O(),[o,L]=m.useState(""),[C,F]=m.useState(""),[h,E]=m.useState("__auto__"),[j,P]=m.useState("__auto__"),[a,$]=m.useState(null),{data:K,isLoading:B}=v({queryKey:["gateway","agents"],queryFn:()=>u.gateway.agents(),refetchInterval:3e4}),{data:I,isLoading:W}=v({queryKey:["gateway","workflows"],queryFn:()=>u.gateway.workflows()}),{data:Q}=v({queryKey:["gateway","config"],queryFn:()=>u.gateway.config()}),{data:U,isLoading:z}=v({queryKey:["gateway","status"],queryFn:()=>u.gateway.status(),refetchInterval:5e3}),b=Z({mutationFn:s=>u.gateway.execute(s),onSuccess:s=>{$(s),k.invalidateQueries({queryKey:["tasks"]}),k.invalidateQueries({queryKey:["stats"]})}}),G=()=>{if(!o.trim())return;const s={task:{title:o,prompt:C||o,source:"gateway-ui",priority:3},workflow:h&&h!=="__auto__"?h:void 0,preferredAgent:j&&j!=="__auto__"?j:void 0,autonomous:!0};b.mutate(s)},x=K?.agents||[],g=I?.workflows||[],V=Q?.config,t=U,H=s=>{const i=Math.floor(s/1e3),f=Math.floor(i/60),p=Math.floor(f/60),T=Math.floor(p/24);return T>0?`${T}d ${p%24}h`:p>0?`${p}h ${f%60}m`:f>0?`${f}m ${i%60}s`:`${i}s`};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Gateway"}),e.jsx("p",{className:"text-muted-foreground",children:"Execute tasks through the unified routing system"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[z?e.jsx(l,{variant:"secondary",children:"Checking..."}):t?.status.online?e.jsxs(l,{variant:"default",className:"gap-1",children:[e.jsx(X,{className:"h-3 w-3"}),"Online"]}):e.jsxs(l,{variant:"destructive",className:"gap-1",children:[e.jsx(R,{className:"h-3 w-3"}),"Offline"]}),t&&e.jsxs(l,{variant:"outline",className:"gap-1",children:[e.jsx(_,{className:"h-3 w-3"}),H(t.status.uptime)]})]})]}),t&&e.jsxs(r,{className:"shadow-elevated",children:[e.jsx(n,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(c,{className:"flex items-center gap-2",children:[e.jsx(ae,{className:"h-5 w-5"}),"Gateway Status"]}),e.jsxs(l,{variant:t.status.activeRequests>0?"default":"secondary",children:[t.status.activeRequests," active request",t.status.activeRequests!==1?"s":""]})]})}),e.jsxs(d,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Capacity Utilization"}),e.jsxs("span",{className:"font-medium",children:[t.status.utilizationPercent,"%"]})]}),e.jsx(te,{value:t.status.utilizationPercent,className:"h-2"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.status.activeRequests," / ",t.status.maxConcurrent," concurrent slots used"]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1 text-muted-foreground text-xs mb-1",children:[e.jsx(J,{className:"h-3 w-3"}),"Total Tasks"]}),e.jsx("div",{className:"text-xl font-bold",children:t.metrics.totalTasks})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1 text-muted-foreground text-xs mb-1",children:[e.jsx(S,{className:"h-3 w-3"}),"Success Rate"]}),e.jsxs("div",{className:"text-xl font-bold",children:[t.metrics.successRate,"%"]})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1 text-muted-foreground text-xs mb-1",children:[e.jsx(_,{className:"h-3 w-3"}),"Avg Duration"]}),e.jsx("div",{className:"text-xl font-bold",children:t.metrics.averageDurationMs>6e4?`${Math.round(t.metrics.averageDurationMs/6e4)}m`:`${Math.round(t.metrics.averageDurationMs/1e3)}s`})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1 text-muted-foreground text-xs mb-1",children:[e.jsx(le,{className:"h-3 w-3"}),"Total Load"]}),e.jsx("div",{className:"text-xl font-bold",children:t.agents.totalLoad})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"font-medium",children:"Connected Agents"}),e.jsxs("span",{className:"text-muted-foreground",children:[t.agents.healthy,"/",t.agents.total," healthy"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.agents.list.map(s=>e.jsxs(l,{variant:s.healthy?"outline":"destructive",className:"gap-1",children:[s.healthy?e.jsx(S,{className:"h-3 w-3 text-green-500"}):e.jsx(R,{className:"h-3 w-3"}),s.name,s.load>0&&e.jsxs("span",{className:"text-xs opacity-70",children:["(",s.load,")"]}),s.latencyMs!==void 0&&e.jsxs("span",{className:"text-xs opacity-70",children:[s.latencyMs,"ms"]})]},s.type)),t.agents.list.length===0&&e.jsx("span",{className:"text-sm text-muted-foreground",children:"No agents connected"})]})]})]})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsxs(r,{children:[e.jsx(n,{className:"pb-2",children:e.jsx(c,{className:"text-sm font-medium",children:"Available Agents"})}),e.jsxs(d,{children:[e.jsx("div",{className:"text-2xl font-bold",children:x.length}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.filter(s=>s.health.healthy).length," healthy"]})]})]}),e.jsxs(r,{children:[e.jsx(n,{className:"pb-2",children:e.jsx(c,{className:"text-sm font-medium",children:"Workflows"})}),e.jsxs(d,{children:[e.jsx("div",{className:"text-2xl font-bold",children:g.length}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Available templates"})]})]}),e.jsxs(r,{children:[e.jsx(n,{className:"pb-2",children:e.jsx(c,{className:"text-sm font-medium",children:"Config"})}),e.jsxs(d,{children:[e.jsx("div",{className:"text-2xl font-bold",children:V?.enableScoring?"Smart":"Basic"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Routing mode"})]})]})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsxs(r,{children:[e.jsxs(n,{children:[e.jsx(c,{children:"Execute Task"}),e.jsx(N,{children:"Route a task through the gateway for intelligent agent selection"})]}),e.jsxs(d,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{htmlFor:"title",children:"Task Title"}),e.jsx(Y,{id:"title",placeholder:"Fix authentication bug",value:o,onChange:s=>L(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{htmlFor:"prompt",children:"Task Prompt (optional)"}),e.jsx(se,{id:"prompt",placeholder:"Detailed description of the task...",value:C,onChange:s=>F(s.target.value),rows:3})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Workflow"}),e.jsxs(M,{value:h,onValueChange:E,children:[e.jsx(q,{children:e.jsx(A,{placeholder:"Auto-detect"})}),e.jsxs(D,{children:[e.jsx(w,{value:"__auto__",children:"Auto-detect"}),g.map(s=>e.jsx(w,{value:s.type,children:s.name},s.type))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(y,{children:"Preferred Agent"}),e.jsxs(M,{value:j,onValueChange:P,children:[e.jsx(q,{children:e.jsx(A,{placeholder:"Auto-select"})}),e.jsxs(D,{children:[e.jsx(w,{value:"__auto__",children:"Auto-select"}),x.map(s=>e.jsxs(w,{value:s.type,disabled:!s.health.healthy,children:[s.name," ",!s.health.healthy&&"(unhealthy)"]},s.type))]})]})]})]}),e.jsx(ee,{onClick:G,disabled:!o.trim()||b.isPending,className:"w-full",children:b.isPending?"Executing...":"Execute Task"})]})]}),e.jsxs(r,{children:[e.jsxs(n,{children:[e.jsx(c,{children:"Execution Result"}),e.jsx(N,{children:a?"Last execution result":"Execute a task to see results"})]}),e.jsx(d,{children:a?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(l,{variant:a.success?"default":"destructive",children:a.success?"Success":"Failed"}),a.agent&&e.jsx(l,{variant:"outline",children:a.agent}),a.workflow&&e.jsx(l,{variant:"secondary",children:a.workflow})]}),a.routing&&e.jsxs("div",{className:"rounded-lg bg-muted p-3 space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:"Routing Decision"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:a.routing.reason}),a.routing.scores.length>0&&e.jsxs("div",{className:"mt-2 space-y-1",children:[e.jsx("div",{className:"text-xs font-medium",children:"Scores:"}),a.routing.scores.map(s=>e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{children:s.agent}),e.jsx("span",{className:"font-mono",children:s.score.toFixed(1)})]},s.agent))]})]}),a.metrics&&e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"Total"}),e.jsxs("div",{className:"font-mono text-sm",children:[(a.metrics.totalDuration/1e3).toFixed(2),"s"]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"Routing"}),e.jsxs("div",{className:"font-mono text-sm",children:[a.metrics.routingDuration,"ms"]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"Execution"}),e.jsxs("div",{className:"font-mono text-sm",children:[(a.metrics.executionDuration/1e3).toFixed(2),"s"]})]})]}),a.error&&e.jsx("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:a.error})]}):e.jsx("div",{className:"flex h-32 items-center justify-center text-muted-foreground",children:"No execution yet"})})]})]}),e.jsxs(r,{children:[e.jsxs(n,{children:[e.jsx(c,{children:"Available Agents"}),e.jsx(N,{children:"Agents registered with the gateway for task execution"})]}),e.jsx(d,{children:B?e.jsx("div",{className:"text-muted-foreground",children:"Loading agents..."}):x.length===0?e.jsx("div",{className:"text-muted-foreground",children:"No agents available"}):e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:x.map(s=>e.jsxs("div",{className:"rounded-lg bg-card/50 shadow-sm p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"font-medium",children:s.name}),e.jsx(l,{variant:s.health.healthy?"default":"destructive",children:s.health.healthy?"Healthy":"Unhealthy"})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s.description}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[s.capabilities.slice(0,4).map(i=>e.jsx(l,{variant:"outline",className:"text-xs",children:i},i)),s.capabilities.length>4&&e.jsxs(l,{variant:"outline",className:"text-xs",children:["+",s.capabilities.length-4]})]}),s.health.latencyMs!==void 0&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Latency: ",s.health.latencyMs,"ms"]})]},s.type))})})]}),e.jsxs(r,{children:[e.jsxs(n,{children:[e.jsx(c,{children:"Workflow Templates"}),e.jsx(N,{children:"Pre-defined workflows for common task types"})]}),e.jsx(d,{children:W?e.jsx("div",{className:"text-muted-foreground",children:"Loading workflows..."}):g.length===0?e.jsx("div",{className:"text-muted-foreground",children:"No workflows available"}):e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:g.map(s=>e.jsxs("div",{className:"rounded-lg bg-card/50 shadow-sm p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"font-medium",children:s.name}),e.jsxs(l,{variant:"secondary",children:[s.steps," steps"]})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s.description}),e.jsx("div",{className:"flex flex-wrap gap-1",children:s.requiredCapabilities.map(i=>e.jsx(l,{variant:"outline",className:"text-xs",children:i},i))}),s.defaultTimeoutMs&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Timeout: ",Math.round(s.defaultTimeoutMs/1e3/60),"min"]})]},s.type))})})]})]})}export{he as GatewayDashboard};
|