@overlordai/server 1.0.53 → 1.0.54
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/database/migrations/001-init-schema.sql +73 -9
- package/dist/adapters/adapter.interface.d.ts +1 -4
- package/dist/adapters/adapter.interface.d.ts.map +1 -1
- package/dist/adapters/adapter.interface.js.map +1 -1
- package/dist/adapters/adapter.module.d.ts.map +1 -1
- package/dist/adapters/adapter.module.js +8 -7
- package/dist/adapters/adapter.module.js.map +1 -1
- package/dist/adapters/lark/lark-card.builder.d.ts +1 -25
- package/dist/adapters/lark/lark-card.builder.d.ts.map +1 -1
- package/dist/adapters/lark/lark-card.builder.js +6 -110
- package/dist/adapters/lark/lark-card.builder.js.map +1 -1
- package/dist/adapters/lark/lark-message.parser.d.ts +4 -4
- package/dist/adapters/lark/lark-message.parser.d.ts.map +1 -1
- package/dist/adapters/lark/lark-message.parser.js +20 -13
- package/dist/adapters/lark/lark-message.parser.js.map +1 -1
- package/dist/adapters/lark/lark-signature.d.ts.map +1 -1
- package/dist/adapters/lark/lark-signature.js +6 -0
- package/dist/adapters/lark/lark-signature.js.map +1 -1
- package/dist/adapters/lark/lark.adapter.d.ts +14 -9
- package/dist/adapters/lark/lark.adapter.d.ts.map +1 -1
- package/dist/adapters/lark/lark.adapter.js +99 -177
- package/dist/adapters/lark/lark.adapter.js.map +1 -1
- package/dist/adapters/lark/lark.controller.d.ts +10 -1
- package/dist/adapters/lark/lark.controller.d.ts.map +1 -1
- package/dist/adapters/lark/lark.controller.js +48 -14
- package/dist/adapters/lark/lark.controller.js.map +1 -1
- package/dist/adapters/slack/slack-block.builder.d.ts +8 -0
- package/dist/adapters/slack/slack-block.builder.d.ts.map +1 -0
- package/dist/adapters/slack/slack-block.builder.js +117 -0
- package/dist/adapters/slack/slack-block.builder.js.map +1 -0
- package/dist/adapters/slack/slack-message.parser.d.ts +15 -0
- package/dist/adapters/slack/slack-message.parser.d.ts.map +1 -0
- package/dist/adapters/slack/slack-message.parser.js +158 -0
- package/dist/adapters/slack/slack-message.parser.js.map +1 -0
- package/dist/adapters/slack/slack-signature.d.ts +7 -0
- package/dist/adapters/slack/slack-signature.d.ts.map +1 -0
- package/dist/adapters/slack/slack-signature.js +59 -0
- package/dist/adapters/slack/slack-signature.js.map +1 -0
- package/dist/adapters/slack/slack.adapter.d.ts +67 -13
- package/dist/adapters/slack/slack.adapter.d.ts.map +1 -1
- package/dist/adapters/slack/slack.adapter.js +468 -19
- package/dist/adapters/slack/slack.adapter.js.map +1 -1
- package/dist/adapters/slack/slack.controller.d.ts +20 -0
- package/dist/adapters/slack/slack.controller.d.ts.map +1 -0
- package/dist/adapters/slack/slack.controller.js +257 -0
- package/dist/adapters/slack/slack.controller.js.map +1 -0
- package/dist/app.module.d.ts.map +1 -1
- package/dist/app.module.js +4 -0
- package/dist/app.module.js.map +1 -1
- package/dist/auth/auth.controller.d.ts.map +1 -1
- package/dist/auth/auth.controller.js +1 -0
- package/dist/auth/auth.controller.js.map +1 -1
- package/dist/auth/auth.module.d.ts.map +1 -1
- package/dist/auth/auth.module.js +4 -5
- package/dist/auth/auth.module.js.map +1 -1
- package/dist/auth/auth.service.d.ts +9 -2
- package/dist/auth/auth.service.d.ts.map +1 -1
- package/dist/auth/auth.service.js +50 -79
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/auth/authenticated-request.d.ts +10 -0
- package/dist/auth/authenticated-request.d.ts.map +1 -0
- package/dist/auth/authenticated-request.js +3 -0
- package/dist/auth/authenticated-request.js.map +1 -0
- package/dist/auth/extract-user.middleware.d.ts.map +1 -1
- package/dist/auth/extract-user.middleware.js +2 -1
- package/dist/auth/extract-user.middleware.js.map +1 -1
- package/dist/auth/guards/jwt-auth.guard.d.ts.map +1 -1
- package/dist/auth/guards/jwt-auth.guard.js +5 -2
- package/dist/auth/guards/jwt-auth.guard.js.map +1 -1
- package/dist/auth/guards/project-role.guard.d.ts.map +1 -1
- package/dist/auth/guards/project-role.guard.js +6 -8
- package/dist/auth/guards/project-role.guard.js.map +1 -1
- package/dist/auth/jwt.strategy.d.ts +6 -3
- package/dist/auth/jwt.strategy.d.ts.map +1 -1
- package/dist/auth/jwt.strategy.js +15 -5
- package/dist/auth/jwt.strategy.js.map +1 -1
- package/dist/common/command-parser.d.ts +29 -0
- package/dist/common/command-parser.d.ts.map +1 -0
- package/dist/common/command-parser.js +133 -0
- package/dist/common/command-parser.js.map +1 -0
- package/dist/common/config.d.ts +17 -0
- package/dist/common/config.d.ts.map +1 -0
- package/dist/common/config.js +47 -0
- package/dist/common/config.js.map +1 -0
- package/dist/common/crypto.service.d.ts +4 -1
- package/dist/common/crypto.service.d.ts.map +1 -1
- package/dist/common/crypto.service.js +14 -7
- package/dist/common/crypto.service.js.map +1 -1
- package/dist/common/error-filter.d.ts +1 -0
- package/dist/common/error-filter.d.ts.map +1 -1
- package/dist/common/error-filter.js +6 -2
- package/dist/common/error-filter.js.map +1 -1
- package/dist/common/git-utils.d.ts +9 -0
- package/dist/common/git-utils.d.ts.map +1 -0
- package/dist/common/git-utils.js +41 -0
- package/dist/common/git-utils.js.map +1 -0
- package/dist/common/health.controller.d.ts.map +1 -1
- package/dist/common/health.controller.js +3 -5
- package/dist/common/health.controller.js.map +1 -1
- package/dist/common/machine-utils.d.ts +32 -0
- package/dist/common/machine-utils.d.ts.map +1 -0
- package/dist/common/machine-utils.js +12 -0
- package/dist/common/machine-utils.js.map +1 -0
- package/dist/common/pagination.d.ts +12 -5
- package/dist/common/pagination.d.ts.map +1 -1
- package/dist/common/pagination.js +27 -17
- package/dist/common/pagination.js.map +1 -1
- package/dist/common/project-validation.d.ts +7 -0
- package/dist/common/project-validation.d.ts.map +1 -0
- package/dist/common/project-validation.js +86 -0
- package/dist/common/project-validation.js.map +1 -0
- package/dist/common/rate-limit.guard.d.ts +4 -3
- package/dist/common/rate-limit.guard.d.ts.map +1 -1
- package/dist/common/rate-limit.guard.js +14 -5
- package/dist/common/rate-limit.guard.js.map +1 -1
- package/dist/common/sql-utils.d.ts +6 -0
- package/dist/common/sql-utils.d.ts.map +1 -0
- package/dist/common/sql-utils.js +11 -0
- package/dist/common/sql-utils.js.map +1 -0
- package/dist/common/string-utils.d.ts +6 -0
- package/dist/common/string-utils.d.ts.map +1 -0
- package/dist/common/string-utils.js +15 -0
- package/dist/common/string-utils.js.map +1 -0
- package/dist/common/worker-utils.d.ts +31 -0
- package/dist/common/worker-utils.d.ts.map +1 -0
- package/dist/common/worker-utils.js +12 -0
- package/dist/common/worker-utils.js.map +1 -0
- package/dist/database/base.repository.d.ts +56 -0
- package/dist/database/base.repository.d.ts.map +1 -0
- package/dist/database/base.repository.js +82 -0
- package/dist/database/base.repository.js.map +1 -0
- package/dist/database/database.service.d.ts.map +1 -1
- package/dist/database/database.service.js +9 -1
- package/dist/database/database.service.js.map +1 -1
- package/dist/database/migration-runner.d.ts.map +1 -1
- package/dist/database/migration-runner.js +2 -1
- package/dist/database/migration-runner.js.map +1 -1
- package/dist/database/repositories/audit-log.repository.d.ts.map +1 -1
- package/dist/database/repositories/audit-log.repository.js +16 -18
- package/dist/database/repositories/audit-log.repository.js.map +1 -1
- package/dist/database/repositories/bot.repository.d.ts +18 -32
- package/dist/database/repositories/bot.repository.d.ts.map +1 -1
- package/dist/database/repositories/bot.repository.js +42 -21
- package/dist/database/repositories/bot.repository.js.map +1 -1
- package/dist/database/repositories/developer-token.repository.d.ts +7 -17
- package/dist/database/repositories/developer-token.repository.d.ts.map +1 -1
- package/dist/database/repositories/developer-token.repository.js +24 -15
- package/dist/database/repositories/developer-token.repository.js.map +1 -1
- package/dist/database/repositories/developer.repository.d.ts +5 -1
- package/dist/database/repositories/developer.repository.d.ts.map +1 -1
- package/dist/database/repositories/developer.repository.js +60 -49
- package/dist/database/repositories/developer.repository.js.map +1 -1
- package/dist/database/repositories/machine.repository.d.ts.map +1 -1
- package/dist/database/repositories/machine.repository.js +2 -7
- package/dist/database/repositories/machine.repository.js.map +1 -1
- package/dist/database/repositories/notification.repository.d.ts +1 -0
- package/dist/database/repositories/notification.repository.d.ts.map +1 -1
- package/dist/database/repositories/notification.repository.js +25 -20
- package/dist/database/repositories/notification.repository.js.map +1 -1
- package/dist/database/repositories/project-member.repository.d.ts +7 -16
- package/dist/database/repositories/project-member.repository.d.ts.map +1 -1
- package/dist/database/repositories/project-member.repository.js +34 -24
- package/dist/database/repositories/project-member.repository.js.map +1 -1
- package/dist/database/repositories/project.repository.d.ts +2 -1
- package/dist/database/repositories/project.repository.d.ts.map +1 -1
- package/dist/database/repositories/project.repository.js +70 -71
- package/dist/database/repositories/project.repository.js.map +1 -1
- package/dist/database/repositories/session.repository.d.ts.map +1 -1
- package/dist/database/repositories/session.repository.js +22 -25
- package/dist/database/repositories/session.repository.js.map +1 -1
- package/dist/database/repositories/task.repository.d.ts +31 -7
- package/dist/database/repositories/task.repository.d.ts.map +1 -1
- package/dist/database/repositories/task.repository.js +134 -86
- package/dist/database/repositories/task.repository.js.map +1 -1
- package/dist/database/repositories/worker-token.repository.d.ts.map +1 -1
- package/dist/database/repositories/worker-token.repository.js +18 -16
- package/dist/database/repositories/worker-token.repository.js.map +1 -1
- package/dist/database/repositories/worker.repository.d.ts +50 -0
- package/dist/database/repositories/worker.repository.d.ts.map +1 -0
- package/dist/database/repositories/worker.repository.js +215 -0
- package/dist/database/repositories/worker.repository.js.map +1 -0
- package/dist/database/repositories/workspace.repository.d.ts +3 -2
- package/dist/database/repositories/workspace.repository.d.ts.map +1 -1
- package/dist/database/repositories/workspace.repository.js +29 -21
- package/dist/database/repositories/workspace.repository.js.map +1 -1
- package/dist/database/repository.module.d.ts +3 -0
- package/dist/database/repository.module.d.ts.map +1 -0
- package/dist/database/repository.module.js +45 -0
- package/dist/database/repository.module.js.map +1 -0
- package/dist/dispatcher/capability.service.d.ts +19 -14
- package/dist/dispatcher/capability.service.d.ts.map +1 -1
- package/dist/dispatcher/capability.service.js +77 -69
- package/dist/dispatcher/capability.service.js.map +1 -1
- package/dist/dispatcher/cleanup.service.d.ts +1 -1
- package/dist/dispatcher/cleanup.service.d.ts.map +1 -1
- package/dist/dispatcher/cleanup.service.js +13 -13
- package/dist/dispatcher/cleanup.service.js.map +1 -1
- package/dist/dispatcher/dedup.service.d.ts +17 -3
- package/dist/dispatcher/dedup.service.d.ts.map +1 -1
- package/dist/dispatcher/dedup.service.js +76 -82
- package/dist/dispatcher/dedup.service.js.map +1 -1
- package/dist/dispatcher/dispatcher.module.d.ts.map +1 -1
- package/dist/dispatcher/dispatcher.module.js +11 -18
- package/dist/dispatcher/dispatcher.module.js.map +1 -1
- package/dist/dispatcher/dispatcher.service.d.ts +14 -116
- package/dist/dispatcher/dispatcher.service.d.ts.map +1 -1
- package/dist/dispatcher/dispatcher.service.js +62 -940
- package/dist/dispatcher/dispatcher.service.js.map +1 -1
- package/dist/dispatcher/dispatcher.types.d.ts +33 -0
- package/dist/dispatcher/dispatcher.types.d.ts.map +1 -0
- package/dist/dispatcher/dispatcher.types.js +3 -0
- package/dist/dispatcher/dispatcher.types.js.map +1 -0
- package/dist/dispatcher/heartbeat.service.d.ts +17 -10
- package/dist/dispatcher/heartbeat.service.d.ts.map +1 -1
- package/dist/dispatcher/heartbeat.service.js +47 -51
- package/dist/dispatcher/heartbeat.service.js.map +1 -1
- package/dist/dispatcher/pty-relay.service.d.ts.map +1 -1
- package/dist/dispatcher/pty-relay.service.js +7 -15
- package/dist/dispatcher/pty-relay.service.js.map +1 -1
- package/dist/dispatcher/reconciler.d.ts +18 -8
- package/dist/dispatcher/reconciler.d.ts.map +1 -1
- package/dist/dispatcher/reconciler.js +219 -130
- package/dist/dispatcher/reconciler.js.map +1 -1
- package/dist/dispatcher/scheduler.service.d.ts +15 -9
- package/dist/dispatcher/scheduler.service.d.ts.map +1 -1
- package/dist/dispatcher/scheduler.service.js +95 -53
- package/dist/dispatcher/scheduler.service.js.map +1 -1
- package/dist/dispatcher/state-machine.d.ts.map +1 -1
- package/dist/dispatcher/state-machine.js +1 -5
- package/dist/dispatcher/state-machine.js.map +1 -1
- package/dist/dispatcher/task-creation.service.d.ts +30 -0
- package/dist/dispatcher/task-creation.service.d.ts.map +1 -0
- package/dist/dispatcher/task-creation.service.js +242 -0
- package/dist/dispatcher/task-creation.service.js.map +1 -0
- package/dist/dispatcher/task-lifecycle.service.d.ts +63 -0
- package/dist/dispatcher/task-lifecycle.service.d.ts.map +1 -0
- package/dist/dispatcher/task-lifecycle.service.js +584 -0
- package/dist/dispatcher/task-lifecycle.service.js.map +1 -0
- package/dist/dispatcher/task-log-batcher.d.ts.map +1 -1
- package/dist/dispatcher/task-log-batcher.js +4 -11
- package/dist/dispatcher/task-log-batcher.js.map +1 -1
- package/dist/dispatcher/worker-auth.service.d.ts +29 -0
- package/dist/dispatcher/worker-auth.service.d.ts.map +1 -0
- package/dist/dispatcher/worker-auth.service.js +296 -0
- package/dist/dispatcher/worker-auth.service.js.map +1 -0
- package/dist/dispatcher/worker-connection.manager.d.ts +15 -15
- package/dist/dispatcher/worker-connection.manager.d.ts.map +1 -1
- package/dist/dispatcher/worker-connection.manager.js +35 -43
- package/dist/dispatcher/worker-connection.manager.js.map +1 -1
- package/dist/dispatcher/worker-selector.d.ts +18 -0
- package/dist/dispatcher/worker-selector.d.ts.map +1 -0
- package/dist/dispatcher/worker-selector.js +150 -0
- package/dist/dispatcher/worker-selector.js.map +1 -0
- package/dist/events/event-types.d.ts +31 -0
- package/dist/events/event-types.d.ts.map +1 -0
- package/dist/events/event-types.js +16 -0
- package/dist/events/event-types.js.map +1 -0
- package/dist/events/events.module.d.ts +7 -0
- package/dist/events/events.module.d.ts.map +1 -0
- package/dist/events/events.module.js +26 -0
- package/dist/events/events.module.js.map +1 -0
- package/dist/main.js +22 -0
- package/dist/main.js.map +1 -1
- package/dist/notifier/debouncer.d.ts +1 -1
- package/dist/notifier/debouncer.d.ts.map +1 -1
- package/dist/notifier/debouncer.js +2 -1
- package/dist/notifier/debouncer.js.map +1 -1
- package/dist/notifier/notification-consumer.d.ts +1 -1
- package/dist/notifier/notification-consumer.d.ts.map +1 -1
- package/dist/notifier/notification-consumer.js +5 -5
- package/dist/notifier/notification-consumer.js.map +1 -1
- package/dist/notifier/notifier.module.d.ts.map +1 -1
- package/dist/notifier/notifier.module.js +0 -6
- package/dist/notifier/notifier.module.js.map +1 -1
- package/dist/notifier/notifier.service.d.ts +1 -1
- package/dist/notifier/notifier.service.d.ts.map +1 -1
- package/dist/notifier/notifier.service.js +7 -9
- package/dist/notifier/notifier.service.js.map +1 -1
- package/dist/notifier/template.service.d.ts +1 -1
- package/dist/notifier/template.service.d.ts.map +1 -1
- package/dist/notifier/template.service.js +6 -10
- package/dist/notifier/template.service.js.map +1 -1
- package/dist/redis/redis.service.d.ts.map +1 -1
- package/dist/redis/redis.service.js +2 -2
- package/dist/redis/redis.service.js.map +1 -1
- package/dist/web/admin/admin-audit.controller.d.ts.map +1 -1
- package/dist/web/admin/admin-audit.controller.js +2 -1
- package/dist/web/admin/admin-audit.controller.js.map +1 -1
- package/dist/web/admin/admin-bot.controller.d.ts +11 -48
- package/dist/web/admin/admin-bot.controller.d.ts.map +1 -1
- package/dist/web/admin/admin-bot.controller.js +50 -18
- package/dist/web/admin/admin-bot.controller.js.map +1 -1
- package/dist/web/admin/admin-developer.controller.d.ts +14 -27
- package/dist/web/admin/admin-developer.controller.d.ts.map +1 -1
- package/dist/web/admin/admin-developer.controller.js +62 -28
- package/dist/web/admin/admin-developer.controller.js.map +1 -1
- package/dist/web/admin/admin-machine.controller.d.ts +1 -8
- package/dist/web/admin/admin-machine.controller.d.ts.map +1 -1
- package/dist/web/admin/admin-machine.controller.js +3 -6
- package/dist/web/admin/admin-machine.controller.js.map +1 -1
- package/dist/web/admin/admin-project.controller.d.ts +9 -30
- package/dist/web/admin/admin-project.controller.d.ts.map +1 -1
- package/dist/web/admin/admin-project.controller.js +15 -60
- package/dist/web/admin/admin-project.controller.js.map +1 -1
- package/dist/web/admin/admin-settings.controller.d.ts +7 -10
- package/dist/web/admin/admin-settings.controller.d.ts.map +1 -1
- package/dist/web/admin/admin-settings.controller.js +14 -6
- package/dist/web/admin/admin-settings.controller.js.map +1 -1
- package/dist/web/admin/admin-token.controller.d.ts +6 -13
- package/dist/web/admin/admin-token.controller.d.ts.map +1 -1
- package/dist/web/admin/admin-token.controller.js +15 -27
- package/dist/web/admin/admin-token.controller.js.map +1 -1
- package/dist/web/admin/admin-worker.controller.d.ts +26 -0
- package/dist/web/admin/admin-worker.controller.d.ts.map +1 -0
- package/dist/web/admin/admin-worker.controller.js +184 -0
- package/dist/web/admin/admin-worker.controller.js.map +1 -0
- package/dist/web/dashboard.controller.d.ts +6 -12
- package/dist/web/dashboard.controller.d.ts.map +1 -1
- package/dist/web/dashboard.controller.js +30 -18
- package/dist/web/dashboard.controller.js.map +1 -1
- package/dist/web/dashboard.service.d.ts +21 -12
- package/dist/web/dashboard.service.d.ts.map +1 -1
- package/dist/web/dashboard.service.js +169 -119
- package/dist/web/dashboard.service.js.map +1 -1
- package/dist/web/event.gateway.d.ts +32 -0
- package/dist/web/event.gateway.d.ts.map +1 -0
- package/dist/web/event.gateway.js +168 -0
- package/dist/web/event.gateway.js.map +1 -0
- package/dist/web/frame-handlers/frame-handler.interface.d.ts +24 -0
- package/dist/web/frame-handlers/frame-handler.interface.d.ts.map +1 -0
- package/dist/web/frame-handlers/frame-handler.interface.js +3 -0
- package/dist/web/frame-handlers/frame-handler.interface.js.map +1 -0
- package/dist/web/frame-handlers/frame-handler.registry.d.ts +16 -0
- package/dist/web/frame-handlers/frame-handler.registry.d.ts.map +1 -0
- package/dist/web/frame-handlers/frame-handler.registry.js +39 -0
- package/dist/web/frame-handlers/frame-handler.registry.js.map +1 -0
- package/dist/web/frame-handlers/heartbeat.handler.d.ts +13 -0
- package/dist/web/frame-handlers/heartbeat.handler.d.ts.map +1 -0
- package/dist/web/frame-handlers/heartbeat.handler.js +35 -0
- package/dist/web/frame-handlers/heartbeat.handler.js.map +1 -0
- package/dist/web/frame-handlers/index.d.ts +7 -0
- package/dist/web/frame-handlers/index.d.ts.map +1 -0
- package/dist/web/frame-handlers/index.js +14 -0
- package/dist/web/frame-handlers/index.js.map +1 -0
- package/dist/web/frame-handlers/progress.handler.d.ts +25 -0
- package/dist/web/frame-handlers/progress.handler.d.ts.map +1 -0
- package/dist/web/frame-handlers/progress.handler.js +69 -0
- package/dist/web/frame-handlers/progress.handler.js.map +1 -0
- package/dist/web/frame-handlers/stage-confirm.handler.d.ts +15 -0
- package/dist/web/frame-handlers/stage-confirm.handler.d.ts.map +1 -0
- package/dist/web/frame-handlers/stage-confirm.handler.js +39 -0
- package/dist/web/frame-handlers/stage-confirm.handler.js.map +1 -0
- package/dist/web/frame-handlers/tunnel.handler.d.ts +10 -0
- package/dist/web/frame-handlers/tunnel.handler.d.ts.map +1 -0
- package/dist/web/frame-handlers/tunnel.handler.js +31 -0
- package/dist/web/frame-handlers/tunnel.handler.js.map +1 -0
- package/dist/web/interaction.service.d.ts +0 -4
- package/dist/web/interaction.service.d.ts.map +1 -1
- package/dist/web/interaction.service.js +0 -10
- package/dist/web/interaction.service.js.map +1 -1
- package/dist/web/machine.controller.d.ts +1 -8
- package/dist/web/machine.controller.d.ts.map +1 -1
- package/dist/web/machine.controller.js +6 -9
- package/dist/web/machine.controller.js.map +1 -1
- package/dist/web/notification.controller.d.ts +1 -8
- package/dist/web/notification.controller.d.ts.map +1 -1
- package/dist/web/notification.controller.js +3 -2
- package/dist/web/notification.controller.js.map +1 -1
- package/dist/web/profile.controller.d.ts +19 -10
- package/dist/web/profile.controller.d.ts.map +1 -1
- package/dist/web/profile.controller.js +100 -13
- package/dist/web/profile.controller.js.map +1 -1
- package/dist/web/project-member.service.d.ts +16 -0
- package/dist/web/project-member.service.d.ts.map +1 -0
- package/dist/web/project-member.service.js +90 -0
- package/dist/web/project-member.service.js.map +1 -0
- package/dist/web/project.controller.d.ts +43 -26
- package/dist/web/project.controller.d.ts.map +1 -1
- package/dist/web/project.controller.js +73 -46
- package/dist/web/project.controller.js.map +1 -1
- package/dist/web/pty.gateway.d.ts +9 -3
- package/dist/web/pty.gateway.d.ts.map +1 -1
- package/dist/web/pty.gateway.js +46 -18
- package/dist/web/pty.gateway.js.map +1 -1
- package/dist/web/search.service.d.ts +9 -2
- package/dist/web/search.service.d.ts.map +1 -1
- package/dist/web/search.service.js +53 -26
- package/dist/web/search.service.js.map +1 -1
- package/dist/web/task.controller.d.ts +15 -24
- package/dist/web/task.controller.d.ts.map +1 -1
- package/dist/web/task.controller.js +70 -53
- package/dist/web/task.controller.js.map +1 -1
- package/dist/web/tunnel.service.d.ts +74 -0
- package/dist/web/tunnel.service.d.ts.map +1 -0
- package/dist/web/tunnel.service.js +250 -0
- package/dist/web/tunnel.service.js.map +1 -0
- package/dist/web/web-event.service.d.ts +25 -0
- package/dist/web/web-event.service.d.ts.map +1 -0
- package/dist/web/web-event.service.js +116 -0
- package/dist/web/web-event.service.js.map +1 -0
- package/dist/web/web.module.d.ts.map +1 -1
- package/dist/web/web.module.js +13 -28
- package/dist/web/web.module.js.map +1 -1
- package/dist/web/worker-channel.gateway.d.ts +10 -18
- package/dist/web/worker-channel.gateway.d.ts.map +1 -1
- package/dist/web/worker-channel.gateway.js +70 -144
- package/dist/web/worker-channel.gateway.js.map +1 -1
- package/dist/web/worker-web.controller.d.ts +15 -0
- package/dist/web/worker-web.controller.d.ts.map +1 -0
- package/dist/web/worker-web.controller.js +143 -0
- package/dist/web/worker-web.controller.js.map +1 -0
- package/dist/web/worker.controller.d.ts +3 -3
- package/dist/web/worker.controller.d.ts.map +1 -1
- package/dist/web/worker.controller.js +8 -8
- package/dist/web/worker.controller.js.map +1 -1
- package/dist/web/workspace.controller.d.ts +8 -33
- package/dist/web/workspace.controller.d.ts.map +1 -1
- package/dist/web/workspace.controller.js +93 -205
- package/dist/web/workspace.controller.js.map +1 -1
- package/package.json +10 -2
- package/public/apple-touch-icon-120x120.png +0 -0
- package/public/apple-touch-icon-152x152.png +0 -0
- package/public/apple-touch-icon-180x180.png +0 -0
- package/public/assets/AccessTokensPage-DPQB2fbi.js +1 -0
- package/public/assets/AdminPage-BqVelYNu.js +1 -0
- package/public/assets/ApiReferencePage-CiGvbLxL.js +1 -0
- package/public/assets/AuditLogPage-DSo4jVYm.js +6 -0
- package/public/assets/BindPlatformPage-CTqzpOmt.js +1 -0
- package/public/assets/BotManage-CIR0rrK7.js +6 -0
- package/public/assets/CliReferencePage-C8GmlwUz.js +14 -0
- package/public/assets/DeveloperManage-r6y2AoB4.js +16 -0
- package/public/assets/EditProjectPage-7WCsNltj.js +2 -0
- package/public/assets/{EmptyState-CvmhFgWJ.js → EmptyState-D3foEiul.js} +1 -1
- package/public/assets/HomePage-D4yv4orb.js +1 -0
- package/public/assets/InfoRow-DhdTYoY9.js +1 -0
- package/public/assets/LandingPage-CqS0E2eC.js +43 -0
- package/public/assets/LoginPage-DDXkdcz_.js +1 -0
- package/public/assets/MetricBar-DMMHfS0A.js +1 -0
- package/public/assets/{NotFoundPage-BuiAS4g4.js → NotFoundPage-D5x5BrlX.js} +1 -1
- package/public/assets/OnboardingGuide-D8RyPcEd.js +1 -0
- package/public/assets/PipelineEditorPage-y2-Q8ofQ.js +3 -0
- package/public/assets/ProfilePage-DN7usHOi.js +1 -0
- package/public/assets/ProjectDetailPage-DJexg49z.js +7 -0
- package/public/assets/ProjectListPage-Bz7I2D0H.js +6 -0
- package/public/assets/QuickAuth-Dr0Q50ld.js +1 -0
- package/public/assets/{RemoveMemberConfirmDialog-DS9z6jQT.js → RemoveMemberConfirmDialog-BCrue0AP.js} +2 -2
- package/public/assets/Select-BnV8yZlD.js +6 -0
- package/public/assets/SettingsPage-HaUCcsgl.js +6 -0
- package/public/assets/{Skeleton-CcVqz28_.js → Skeleton-DUgWc2LJ.js} +1 -1
- package/public/assets/SkillPage-BInwZTQh.js +1 -0
- package/public/assets/TaskDetailPage-CfwEj1hy.js +31 -0
- package/public/assets/TaskListPage-Dh59ldSZ.js +1 -0
- package/public/assets/TaskStatusBadge-DuOoGIwE.js +1 -0
- package/public/assets/TerminalHomePage-BwXJjr-a.js +16 -0
- package/public/assets/TokenManage-B0Cpv6SO.js +1 -0
- package/public/assets/TotpSetupPage-MSCCURj9.js +9 -0
- package/public/assets/WorkerDetailPage-R2veIzKo.js +1 -0
- package/public/assets/WorkerListPage-CserMjGO.js +6 -0
- package/public/assets/WorkerSetupGuidePage-SqO2lzVa.js +11 -0
- package/public/assets/{arrow-left-CVKez32c.js → arrow-left-DklRsENx.js} +1 -1
- package/public/assets/{arrow-right-g7hTftEi.js → arrow-right-MDrzFe3K.js} +1 -1
- package/public/assets/{bot-DYvBcsZn.js → bot-DPaziJPf.js} +1 -1
- package/public/assets/{chevron-right-COxU2yxz.js → chevron-right-CqyufMDW.js} +1 -1
- package/public/assets/{copy-BGttVgA1.js → copy-BUH7P2Hf.js} +1 -1
- package/public/assets/date-BdNtiQTP.js +1 -0
- package/public/assets/{external-link-DXlCfUjE.js → external-link-ChPgQ7N_.js} +1 -1
- package/public/assets/index-BS0Fbx5V.css +1 -0
- package/public/assets/index-vL7aQJNr.js +225 -0
- package/public/assets/{key-3eDVdGih.js → key-CxvwwHnW.js} +1 -1
- package/public/assets/{loader-circle-DPm92ETj.js → loader-circle-DS5g1-Od.js} +1 -1
- package/public/assets/password-CHk45-jw.js +1 -0
- package/public/assets/{pencil-Bs3PwH2W.js → pencil-B6spIBcw.js} +1 -1
- package/public/assets/{plus-d-PLzbVX.js → plus-Bnd1Vz2Y.js} +1 -1
- package/public/assets/{rotate-ccw-Cus8CABi.js → rotate-ccw-CgcLAXNR.js} +1 -1
- package/public/assets/{scroll-text-CV3wlIy2.js → scroll-text-CecZ0Fk5.js} +1 -1
- package/public/assets/{settings-Ccijf48b.js → settings-C1uOD3PZ.js} +1 -1
- package/public/assets/status-colors-BPEUp90-.js +1 -0
- package/public/assets/string-B39tzdVK.js +1 -0
- package/public/assets/task-constants-BbFyCyKk.js +14 -0
- package/public/assets/task.store-BE6fEPu4.js +1 -0
- package/public/assets/{trash-2-bRJ-xwtq.js → trash-2-A2FsT1yG.js} +1 -1
- package/public/assets/useFetch-vGZMAvGi.js +1 -0
- package/public/assets/{users-LNQqKSEN.js → users-CEdRS_A3.js} +1 -1
- package/public/assets/wifi-D60NkK6F.js +6 -0
- package/public/assets/zap-DXw1NrWz.js +6 -0
- package/public/icon-192x192.png +0 -0
- package/public/icon-512x512.png +0 -0
- package/public/icon-maskable-192x192.png +0 -0
- package/public/icon-maskable-512x512.png +0 -0
- package/public/index.html +21 -4
- package/public/manifest.webmanifest +1 -0
- package/public/og-image.png +0 -0
- package/public/registerSW.js +1 -0
- package/public/sw.js +1 -0
- package/public/workbox-6e9b121d.js +1 -0
- package/database/migrations/002-add-indexes.sql +0 -17
- package/database/migrations/003-add-settings-table.sql +0 -4
- package/database/migrations/004-add-developer-id-index.sql +0 -5
- package/database/migrations/005-add-worker-version.sql +0 -2
- package/database/migrations/006-add-decommission-fields.sql +0 -2
- package/database/migrations/007-add-ssh-url.sql +0 -1
- package/public/assets/AccessTokensPage-Cb5hGBfN.js +0 -1
- package/public/assets/AdminPage-C7Xytkfo.js +0 -1
- package/public/assets/ApiReferencePage-DLGVc4xN.js +0 -1
- package/public/assets/AuditLogPage-BgqsUJ7x.js +0 -6
- package/public/assets/BotManage-Ds9DYQZA.js +0 -6
- package/public/assets/CliReferencePage-WXinn_69.js +0 -8
- package/public/assets/DeveloperManage-saSq3Hfx.js +0 -16
- package/public/assets/EditProjectPage-C4xWYLTo.js +0 -2
- package/public/assets/HomePage-y20pQ52r.js +0 -1
- package/public/assets/LandingPage-CB5BBbdI.js +0 -36
- package/public/assets/LoginPage-DLljhJkQ.js +0 -1
- package/public/assets/MachineDetailPage-CPm9tfdp.js +0 -1
- package/public/assets/MachineListPage-D-nhVz-m.js +0 -6
- package/public/assets/PipelineEditorPage-B9GgqAju.js +0 -3
- package/public/assets/ProfilePage-DASpeJq6.js +0 -1
- package/public/assets/ProjectDetailPage-DWZyNwTV.js +0 -7
- package/public/assets/ProjectListPage-BUMX3Dxa.js +0 -6
- package/public/assets/QuickAuth-B9mvq7ht.js +0 -1
- package/public/assets/Select-A7PXobk_.js +0 -6
- package/public/assets/SettingsPage-WGzxUbGp.js +0 -6
- package/public/assets/SkillPage-BIt2kF3W.js +0 -1
- package/public/assets/TaskDetailPage-CePyNfp6.js +0 -44
- package/public/assets/TaskListPage-MO4_PSve.js +0 -1
- package/public/assets/TaskStatusBadge-QtQUDscM.js +0 -1
- package/public/assets/TokenManage-Sf0RGymw.js +0 -1
- package/public/assets/TotpSetupPage-D-rbEYLf.js +0 -9
- package/public/assets/WorkerSetupGuidePage-D6Fv1MQo.js +0 -16
- package/public/assets/index-CDBuOPx4.js +0 -212
- package/public/assets/index-CQojj7Zu.css +0 -1
- package/public/assets/protocol-C5uQmiiB.js +0 -1
- package/public/assets/task.store-CvjSr507.js +0 -1
- /package/public/assets/{TaskDetailPage-Beg8tuEN.css → task-constants-Beg8tuEN.css} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as i,g as l}from"./index-vL7aQJNr.js";const f=i((t,c)=>({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,fetchTasks:async a=>{const s=c()._fetchTasksAbort;s&&s.abort();const o=new AbortController;t({loading:!0,error:null,_fetchTasksAbort:o});try{const r={};a!=null&&a.status&&(r.status=a.status),a!=null&&a.projectKey&&(r.projectKey=a.projectKey),a!=null&&a.cursor&&(r.cursor=a.cursor),a!=null&&a.limit&&(r.limit=String(a.limit));const n=await l.get("web/tasks",{searchParams:r,signal:o.signal}).json();a!=null&&a.cursor?t(e=>({tasks:[...e.tasks,...n.data],nextCursor:n.nextCursor??null,_fetchTasksAbort:null})):t({tasks:n.data,nextCursor:n.nextCursor??null,_fetchTasksAbort:null})}catch(r){if(r instanceof DOMException&&r.name==="AbortError")return;t({error:r instanceof Error?r.message:"Failed to fetch tasks"})}finally{t({loading:!1})}},fetchTask:async a=>{t({loading:!0,error:null});try{const s=await l.get(`web/tasks/${a}`).json();t({currentTask:s})}catch(s){t({error:s instanceof Error?s.message:"Failed to fetch task"})}finally{t({loading:!1})}},createTask:async a=>{t({error:null});try{const s=await l.post("web/tasks",{json:a}).json();return t(o=>({tasks:[s,...o.tasks]})),s}catch(s){throw t({error:s instanceof Error?s.message:"Failed to create task"}),s}},cancelTask:async a=>{t({error:null});try{await l.post(`web/tasks/${a}/cancel`);const{currentTask:s}=c();(s==null?void 0:s.id)===a&&await c().fetchTask(a)}catch(s){throw t({error:s instanceof Error?s.message:"Failed to cancel task"}),s}},reset:()=>{t({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null})}}));export{f as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./index-vL7aQJNr.js";function p(c,f){const[l,i]=e.useState(null),[d,u]=e.useState(!0),[R,a]=e.useState(null),o=e.useRef(c);o.current=c;const r=e.useRef(0),n=e.useCallback(async()=>{const s=++r.current;u(!0),a(null);try{const t=await o.current();s===r.current&&i(t)}catch(t){if(s===r.current){const g=t instanceof Error?t.message:"An unexpected error occurred";a(g)}}finally{s===r.current&&u(!1)}},f);return e.useEffect(()=>{n()},[n]),{data:l,loading:d,error:R,refetch:n}}export{p as u};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as e}from"./index-vL7aQJNr.js";/**
|
|
2
|
+
* @license lucide-react v0.469.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const t=e("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);export{t as W};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as a}from"./index-vL7aQJNr.js";/**
|
|
2
|
+
* @license lucide-react v0.469.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const e=a("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);export{e as Z};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/public/index.html
CHANGED
|
@@ -2,18 +2,35 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
6
6
|
<title>overlord</title>
|
|
7
|
+
<meta name="description" content="dispatch coding tasks across your machine fleet. ai agents execute in parallel — claude code, cursor, codex. pool subscriptions, trigger from anywhere, watch live terminal output." />
|
|
8
|
+
<meta property="og:title" content="overlord — a dev team that never sleeps" />
|
|
9
|
+
<meta property="og:description" content="turn your subscriptions and machines into a dev team that never sleeps. dispatch tasks, ai agents execute in parallel, watch live or come back to finished PRs." />
|
|
10
|
+
<meta property="og:type" content="website" />
|
|
11
|
+
<meta property="og:image" content="/og-image.png" />
|
|
12
|
+
<meta name="twitter:card" content="summary_large_image" />
|
|
13
|
+
<meta name="twitter:title" content="overlord — a dev team that never sleeps" />
|
|
14
|
+
<meta name="twitter:description" content="turn your subscriptions and machines into a dev team that never sleeps. dispatch tasks, ai agents execute in parallel, watch live or come back to finished PRs." />
|
|
15
|
+
<meta name="twitter:image" content="/og-image.png" />
|
|
7
16
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
17
|
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
18
|
+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
19
|
+
<meta name="apple-mobile-web-app-title" content="Overlord">
|
|
20
|
+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png">
|
|
21
|
+
<link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
|
|
22
|
+
<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
|
|
23
|
+
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#FAFAFA">
|
|
24
|
+
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#0C0C0C">
|
|
8
25
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
9
26
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
10
27
|
<link
|
|
11
28
|
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap"
|
|
12
29
|
rel="stylesheet"
|
|
13
30
|
/>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
15
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
16
|
-
|
|
31
|
+
<script type="module" crossorigin src="/assets/index-vL7aQJNr.js"></script>
|
|
32
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BS0Fbx5V.css">
|
|
33
|
+
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
|
17
34
|
<body>
|
|
18
35
|
<div id="root"></div>
|
|
19
36
|
</body>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"Overlord","short_name":"Overlord","description":"AI Agent Fleet Management","start_url":"/","display":"standalone","background_color":"#0C0C0C","theme_color":"#22C55E","lang":"en","scope":"/","icons":[{"src":"icon-192x192.png","sizes":"192x192","type":"image/png","purpose":"any"},{"src":"icon-512x512.png","sizes":"512x512","type":"image/png","purpose":"any"},{"src":"icon-maskable-192x192.png","sizes":"192x192","type":"image/png","purpose":"maskable"},{"src":"icon-maskable-512x512.png","sizes":"512x512","type":"image/png","purpose":"maskable"}]}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
if('serviceWorker' in navigator) {window.addEventListener('load', () => {navigator.serviceWorker.register('/sw.js', { scope: '/' })})}
|
package/public/sw.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
if(!self.define){let s,e={};const l=(l,i)=>(l=new URL(l+".js",i).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(i,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let o={};const u=s=>l(s,r),a={module:{uri:r},exports:o,require:u};e[r]=Promise.all(i.map(s=>a[s]||u(s))).then(s=>(n(...s),o))}}define(["./workbox-6e9b121d"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"og-image.png",revision:"f1563b4bdc7d1a4ab0aef864b0c2294e"},{url:"index.html",revision:"224ff6d003cc74f4f2fb98e759540846"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"apple-touch-icon-152x152.png",revision:"8cc7ef3bc3aa19c3d8a29a58646d0636"},{url:"apple-touch-icon-120x120.png",revision:"7057fb6fb60df3fcf3cd49883db13be9"},{url:"assets/zap-DXw1NrWz.js",revision:null},{url:"assets/wifi-D60NkK6F.js",revision:null},{url:"assets/users-CEdRS_A3.js",revision:null},{url:"assets/useFetch-vGZMAvGi.js",revision:null},{url:"assets/trash-2-A2FsT1yG.js",revision:null},{url:"assets/task.store-BE6fEPu4.js",revision:null},{url:"assets/task-constants-Beg8tuEN.css",revision:null},{url:"assets/task-constants-BbFyCyKk.js",revision:null},{url:"assets/string-B39tzdVK.js",revision:null},{url:"assets/status-colors-BPEUp90-.js",revision:null},{url:"assets/settings-C1uOD3PZ.js",revision:null},{url:"assets/scroll-text-CecZ0Fk5.js",revision:null},{url:"assets/rotate-ccw-CgcLAXNR.js",revision:null},{url:"assets/plus-Bnd1Vz2Y.js",revision:null},{url:"assets/pencil-B6spIBcw.js",revision:null},{url:"assets/password-CHk45-jw.js",revision:null},{url:"assets/loader-circle-DS5g1-Od.js",revision:null},{url:"assets/key-CxvwwHnW.js",revision:null},{url:"assets/index-vL7aQJNr.js",revision:null},{url:"assets/index-BS0Fbx5V.css",revision:null},{url:"assets/external-link-ChPgQ7N_.js",revision:null},{url:"assets/date-BdNtiQTP.js",revision:null},{url:"assets/copy-BUH7P2Hf.js",revision:null},{url:"assets/chevron-right-CqyufMDW.js",revision:null},{url:"assets/bot-DPaziJPf.js",revision:null},{url:"assets/arrow-right-MDrzFe3K.js",revision:null},{url:"assets/arrow-left-DklRsENx.js",revision:null},{url:"assets/WorkerSetupGuidePage-SqO2lzVa.js",revision:null},{url:"assets/WorkerListPage-CserMjGO.js",revision:null},{url:"assets/WorkerDetailPage-R2veIzKo.js",revision:null},{url:"assets/TotpSetupPage-MSCCURj9.js",revision:null},{url:"assets/TokenManage-B0Cpv6SO.js",revision:null},{url:"assets/TerminalHomePage-BwXJjr-a.js",revision:null},{url:"assets/TaskStatusBadge-DuOoGIwE.js",revision:null},{url:"assets/TaskListPage-Dh59ldSZ.js",revision:null},{url:"assets/TaskDetailPage-CfwEj1hy.js",revision:null},{url:"assets/SkillPage-BInwZTQh.js",revision:null},{url:"assets/Skeleton-DUgWc2LJ.js",revision:null},{url:"assets/SettingsPage-HaUCcsgl.js",revision:null},{url:"assets/Select-BnV8yZlD.js",revision:null},{url:"assets/RemoveMemberConfirmDialog-BCrue0AP.js",revision:null},{url:"assets/QuickAuth-Dr0Q50ld.js",revision:null},{url:"assets/ProjectListPage-Bz7I2D0H.js",revision:null},{url:"assets/ProjectDetailPage-DJexg49z.js",revision:null},{url:"assets/ProfilePage-DN7usHOi.js",revision:null},{url:"assets/PipelineEditorPage-y2-Q8ofQ.js",revision:null},{url:"assets/OnboardingGuide-D8RyPcEd.js",revision:null},{url:"assets/NotFoundPage-D5x5BrlX.js",revision:null},{url:"assets/MetricBar-DMMHfS0A.js",revision:null},{url:"assets/LoginPage-DDXkdcz_.js",revision:null},{url:"assets/LandingPage-CqS0E2eC.js",revision:null},{url:"assets/InfoRow-DhdTYoY9.js",revision:null},{url:"assets/HomePage-D4yv4orb.js",revision:null},{url:"assets/EmptyState-D3foEiul.js",revision:null},{url:"assets/EditProjectPage-7WCsNltj.js",revision:null},{url:"assets/DeveloperManage-r6y2AoB4.js",revision:null},{url:"assets/CliReferencePage-C8GmlwUz.js",revision:null},{url:"assets/BotManage-CIR0rrK7.js",revision:null},{url:"assets/BindPlatformPage-CTqzpOmt.js",revision:null},{url:"assets/AuditLogPage-DSo4jVYm.js",revision:null},{url:"assets/ApiReferencePage-CiGvbLxL.js",revision:null},{url:"assets/AdminPage-BqVelYNu.js",revision:null},{url:"assets/AccessTokensPage-DPQB2fbi.js",revision:null},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"manifest.webmanifest",revision:"c35fecd3fb20dd6d473c713737b26dd4"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("/index.html"))),s.registerRoute(/^https:\/\/fonts\.googleapis\.com/,new s.CacheFirst({cacheName:"google-fonts-stylesheets",plugins:[]}),"GET"),s.registerRoute(/^https:\/\/fonts\.gstatic\.com/,new s.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new s.ExpirationPlugin({maxEntries:10,maxAgeSeconds:31536e3})]}),"GET")});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
define(["exports"],function(t){"use strict";try{self["workbox:core:7.3.0"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:7.3.0"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class i{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class r extends i{constructor(t,e,s){super(({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)},e,s)}}class a{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)})}addCacheListener(){self.addEventListener("message",t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map(e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})}));t.waitUntil(s),t.ports&&t.ports[0]&&s.then(()=>t.ports[0].postMessage(!0))}})}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:i,route:r}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let a=r&&r.handler;const o=t.method;if(!a&&this.i.has(o)&&(a=this.i.get(o)),!a)return;let c;try{c=a.handle({url:s,request:t,event:e,params:i})}catch(t){c=Promise.reject(t)}const h=r&&r.catchHandler;return c instanceof Promise&&(this.o||h)&&(c=c.catch(async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:i})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n})),c}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const i=this.t.get(s.method)||[];for(const r of i){let i;const a=r.match({url:t,sameOrigin:e,request:s,event:n});if(a)return i=a,(Array.isArray(i)&&0===i.length||a.constructor===Object&&0===Object.keys(a).length||"boolean"==typeof a)&&(i=void 0),{route:r,params:i}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let o;const c=()=>(o||(o=new a,o.addFetchListener(),o.addCacheListener()),o);function h(t,e,n){let a;if("string"==typeof t){const s=new URL(t,location.href);a=new i(({url:t})=>t.href===s.href,e,n)}else if(t instanceof RegExp)a=new r(t,e,n);else if("function"==typeof t)a=new i(t,e,n);else{if(!(t instanceof i))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});a=t}return c().registerRoute(a),a}const u={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},l=t=>[u.prefix,t,u.suffix].filter(t=>t&&t.length>0).join("-"),f=t=>t||l(u.precache),w=t=>t||l(u.runtime);function d(t,e){const s=new URL(t);for(const t of e)s.searchParams.delete(t);return s.href}class p{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}}const y=new Set;try{self["workbox:strategies:7.3.0"]&&_()}catch(t){}function m(t){return"string"==typeof t?new Request(t):t}class g{constructor(t,e){this.h={},Object.assign(this,e),this.event=e.event,this.u=t,this.l=new p,this.p=[],this.m=[...t.plugins],this.R=new Map;for(const t of this.m)this.R.set(t,{});this.event.waitUntil(this.l.promise)}async fetch(t){const{event:e}=this;let n=m(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const i=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const r=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.u.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:r,response:t});return t}catch(t){throw i&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:i.clone(),request:r.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=m(t);let s;const{cacheName:n,matchOptions:i}=this.u,r=await this.getCacheKey(e,"read"),a=Object.assign(Object.assign({},i),{cacheName:n});s=await caches.match(r,a);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:n,matchOptions:i,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(t,e){const n=m(t);var i;await(i=0,new Promise(t=>setTimeout(t,i)));const r=await this.getCacheKey(n,"write");if(!e)throw new s("cache-put-with-no-response",{url:(a=r.url,new URL(String(a),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var a;const o=await this.v(e);if(!o)return!1;const{cacheName:c,matchOptions:h}=this.u,u=await self.caches.open(c),l=this.hasCallback("cacheDidUpdate"),f=l?await async function(t,e,s,n){const i=d(e.url,s);if(e.url===i)return t.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),a=await t.keys(e,r);for(const e of a)if(i===d(e.url,s))return t.match(e,n)}(u,r.clone(),["__WB_REVISION__"],h):null;try{await u.put(r,l?o.clone():o)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await async function(){for(const t of y)await t()}(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:c,oldResponse:f,newResponse:o.clone(),request:r,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this.h[s]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=m(await t({mode:e,request:n,event:this.event,params:this.params}));this.h[s]=n}return this.h[s]}hasCallback(t){for(const e of this.u.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.u.plugins)if("function"==typeof e[t]){const s=this.R.get(e),n=n=>{const i=Object.assign(Object.assign({},n),{state:s});return e[t](i)};yield n}}waitUntil(t){return this.p.push(t),t}async doneWaiting(){for(;this.p.length;){const t=this.p.splice(0),e=(await Promise.allSettled(t)).find(t=>"rejected"===t.status);if(e)throw e.reason}}destroy(){this.l.resolve(null)}async v(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class R{constructor(t={}){this.cacheName=w(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,n="params"in t?t.params:void 0,i=new g(this,{event:e,request:s,params:n}),r=this.q(i,s,e);return[r,this.D(r,i,s,e)]}async q(t,e,n){let i;await t.runCallbacks("handlerWillStart",{event:n,request:e});try{if(i=await this.U(e,t),!i||"error"===i.type)throw new s("no-response",{url:e.url})}catch(s){if(s instanceof Error)for(const r of t.iterateCallbacks("handlerDidError"))if(i=await r({error:s,event:n,request:e}),i)break;if(!i)throw s}for(const s of t.iterateCallbacks("handlerWillRespond"))i=await s({event:n,request:e,response:i});return i}async D(t,e,s,n){let i,r;try{i=await t}catch(r){}try{await e.runCallbacks("handlerDidRespond",{event:n,request:s,response:i}),await e.doneWaiting()}catch(t){t instanceof Error&&(r=t)}if(await e.runCallbacks("handlerDidComplete",{event:n,request:s,response:i,error:r}),e.destroy(),r)throw r}}function v(t){t.then(()=>{})}function b(){return b=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var n in s)({}).hasOwnProperty.call(s,n)&&(t[n]=s[n])}return t},b.apply(null,arguments)}let q,D;const U=new WeakMap,x=new WeakMap,L=new WeakMap,I=new WeakMap,E=new WeakMap;let C={get(t,e,s){if(t instanceof IDBTransaction){if("done"===e)return x.get(t);if("objectStoreNames"===e)return t.objectStoreNames||L.get(t);if("store"===e)return s.objectStoreNames[1]?void 0:s.objectStore(s.objectStoreNames[0])}return B(t[e])},set:(t,e,s)=>(t[e]=s,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function N(t){return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(D||(D=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(k(this),e),B(U.get(this))}:function(...e){return B(t.apply(k(this),e))}:function(e,...s){const n=t.call(k(this),e,...s);return L.set(n,e.sort?e.sort():[e]),B(n)}}function O(t){return"function"==typeof t?N(t):(t instanceof IDBTransaction&&function(t){if(x.has(t))return;const e=new Promise((e,s)=>{const n=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",r),t.removeEventListener("abort",r)},i=()=>{e(),n()},r=()=>{s(t.error||new DOMException("AbortError","AbortError")),n()};t.addEventListener("complete",i),t.addEventListener("error",r),t.addEventListener("abort",r)});x.set(t,e)}(t),e=t,(q||(q=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(t=>e instanceof t)?new Proxy(t,C):t);var e}function B(t){if(t instanceof IDBRequest)return function(t){const e=new Promise((e,s)=>{const n=()=>{t.removeEventListener("success",i),t.removeEventListener("error",r)},i=()=>{e(B(t.result)),n()},r=()=>{s(t.error),n()};t.addEventListener("success",i),t.addEventListener("error",r)});return e.then(e=>{e instanceof IDBCursor&&U.set(e,t)}).catch(()=>{}),E.set(e,t),e}(t);if(I.has(t))return I.get(t);const e=O(t);return e!==t&&(I.set(t,e),E.set(e,t)),e}const k=t=>E.get(t);const M=["get","getKey","getAll","getAllKeys","count"],T=["put","add","delete","clear"],j=new Map;function P(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(j.get(e))return j.get(e);const s=e.replace(/FromIndex$/,""),n=e!==s,i=T.includes(s);if(!(s in(n?IDBIndex:IDBObjectStore).prototype)||!i&&!M.includes(s))return;const r=async function(t,...e){const r=this.transaction(t,i?"readwrite":"readonly");let a=r.store;return n&&(a=a.index(e.shift())),(await Promise.all([a[s](...e),i&&r.done]))[0]};return j.set(e,r),r}C=(t=>b({},t,{get:(e,s,n)=>P(e,s)||t.get(e,s,n),has:(e,s)=>!!P(e,s)||t.has(e,s)}))(C);try{self["workbox:expiration:7.3.0"]&&_()}catch(t){}const W="cache-entries",S=t=>{const e=new URL(t,location.href);return e.hash="",e.href};class K{constructor(t){this.L=null,this._=t}I(t){const e=t.createObjectStore(W,{keyPath:"id"});e.createIndex("cacheName","cacheName",{unique:!1}),e.createIndex("timestamp","timestamp",{unique:!1})}C(t){this.I(t),this._&&function(t,{blocked:e}={}){const s=indexedDB.deleteDatabase(t);e&&s.addEventListener("blocked",t=>e(t.oldVersion,t)),B(s).then(()=>{})}(this._)}async setTimestamp(t,e){const s={url:t=S(t),timestamp:e,cacheName:this._,id:this.N(t)},n=(await this.getDb()).transaction(W,"readwrite",{durability:"relaxed"});await n.store.put(s),await n.done}async getTimestamp(t){const e=await this.getDb(),s=await e.get(W,this.N(t));return null==s?void 0:s.timestamp}async expireEntries(t,e){const s=await this.getDb();let n=await s.transaction(W).store.index("timestamp").openCursor(null,"prev");const i=[];let r=0;for(;n;){const s=n.value;s.cacheName===this._&&(t&&s.timestamp<t||e&&r>=e?i.push(n.value):r++),n=await n.continue()}const a=[];for(const t of i)await s.delete(W,t.id),a.push(t.url);return a}N(t){return this._+"|"+S(t)}async getDb(){return this.L||(this.L=await function(t,e,{blocked:s,upgrade:n,blocking:i,terminated:r}={}){const a=indexedDB.open(t,e),o=B(a);return n&&a.addEventListener("upgradeneeded",t=>{n(B(a.result),t.oldVersion,t.newVersion,B(a.transaction),t)}),s&&a.addEventListener("blocked",t=>s(t.oldVersion,t.newVersion,t)),o.then(t=>{r&&t.addEventListener("close",()=>r()),i&&t.addEventListener("versionchange",t=>i(t.oldVersion,t.newVersion,t))}).catch(()=>{}),o}("workbox-expiration",1,{upgrade:this.C.bind(this)})),this.L}}class A{constructor(t,e={}){this.O=!1,this.B=!1,this.k=e.maxEntries,this.M=e.maxAgeSeconds,this.T=e.matchOptions,this._=t,this.j=new K(t)}async expireEntries(){if(this.O)return void(this.B=!0);this.O=!0;const t=this.M?Date.now()-1e3*this.M:0,e=await this.j.expireEntries(t,this.k),s=await self.caches.open(this._);for(const t of e)await s.delete(t,this.T);this.O=!1,this.B&&(this.B=!1,v(this.expireEntries()))}async updateTimestamp(t){await this.j.setTimestamp(t,Date.now())}async isURLExpired(t){if(this.M){const e=await this.j.getTimestamp(t),s=Date.now()-1e3*this.M;return void 0===e||e<s}return!1}async delete(){this.B=!1,await this.j.expireEntries(1/0)}}function F(t,e){const s=e();return t.waitUntil(s),s}try{self["workbox:precaching:7.3.0"]&&_()}catch(t){}function H(t){if(!t)throw new s("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const i=new URL(n,location.href),r=new URL(n,location.href);return i.searchParams.set("__WB_REVISION__",e),{cacheKey:i.href,url:r.href}}class ${constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class G{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.P.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.P=t}}let V,J;async function Q(t,e){let n=null;if(t.url){n=new URL(t.url).origin}if(n!==self.location.origin)throw new s("cross-origin-copy-response",{origin:n});const i=t.clone(),r={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},a=e?e(r):r,o=function(){if(void 0===V){const t=new Response("");if("body"in t)try{new Response(t.body),V=!0}catch(t){V=!1}V=!1}return V}()?i.body:await i.blob();return new Response(o,a)}class z extends R{constructor(t={}){t.cacheName=f(t.cacheName),super(t),this.W=!1!==t.fallbackToNetwork,this.plugins.push(z.copyRedirectedCacheableResponsesPlugin)}async U(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.S(t,e):await this.K(t,e))}async K(t,e){let n;const i=e.params||{};if(!this.W)throw new s("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=i.integrity,r=t.integrity,a=!r||r===s;n=await e.fetch(new Request(t,{integrity:"no-cors"!==t.mode?r||s:void 0})),s&&a&&"no-cors"!==t.mode&&(this.A(),await e.cachePut(t,n.clone()))}return n}async S(t,e){this.A();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s("bad-precaching-response",{url:t.url,status:n.status});return n}A(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==z.copyRedirectedCacheableResponsesPlugin&&(n===z.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(z.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}z.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},z.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await Q(t):t};class X{constructor({cacheName:t,plugins:e=[],fallbackToNetwork:s=!0}={}){this.F=new Map,this.H=new Map,this.$=new Map,this.u=new z({cacheName:f(t),plugins:[...e,new G({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.u}precache(t){this.addToCacheList(t),this.G||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.G=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:i}=H(n),r="string"!=typeof n&&n.revision?"reload":"default";if(this.F.has(i)&&this.F.get(i)!==t)throw new s("add-to-cache-list-conflicting-entries",{firstEntry:this.F.get(i),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.$.has(t)&&this.$.get(t)!==n.integrity)throw new s("add-to-cache-list-conflicting-integrities",{url:i});this.$.set(t,n.integrity)}if(this.F.set(i,t),this.H.set(i,r),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return F(t,async()=>{const e=new $;this.strategy.plugins.push(e);for(const[e,s]of this.F){const n=this.$.get(s),i=this.H.get(e),r=new Request(e,{integrity:n,cache:i,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:r,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}})}activate(t){return F(t,async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.F.values()),n=[];for(const i of e)s.has(i.url)||(await t.delete(i),n.push(i.url));return{deletedURLs:n}})}getURLsToCacheKeys(){return this.F}getCachedURLs(){return[...this.F.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.F.get(e.href)}getIntegrityForCacheKey(t){return this.$.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}const Y=()=>(J||(J=new X),J);class Z extends i{constructor(t,e){super(({request:s})=>{const n=t.getURLsToCacheKeys();for(const i of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:i}={}){const r=new URL(t,location.href);r.hash="",yield r.href;const a=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some(t=>t.test(s))&&t.searchParams.delete(s);return t}(r,e);if(yield a.href,s&&a.pathname.endsWith("/")){const t=new URL(a.href);t.pathname+=s,yield t.href}if(n){const t=new URL(a.href);t.pathname+=".html",yield t.href}if(i){const t=i({url:r});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(i);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}},t.strategy)}}t.CacheFirst=class extends R{async U(t,e){let n,i=await e.cacheMatch(t);if(!i)try{i=await e.fetchAndCachePut(t)}catch(t){t instanceof Error&&(n=t)}if(!i)throw new s("no-response",{url:t.url,error:n});return i}},t.ExpirationPlugin=class{constructor(t={}){this.cachedResponseWillBeUsed=async({event:t,request:e,cacheName:s,cachedResponse:n})=>{if(!n)return null;const i=this.V(n),r=this.J(s);v(r.expireEntries());const a=r.updateTimestamp(e.url);if(t)try{t.waitUntil(a)}catch(t){}return i?n:null},this.cacheDidUpdate=async({cacheName:t,request:e})=>{const s=this.J(t);await s.updateTimestamp(e.url),await s.expireEntries()},this.X=t,this.M=t.maxAgeSeconds,this.Y=new Map,t.purgeOnQuotaError&&function(t){y.add(t)}(()=>this.deleteCacheAndMetadata())}J(t){if(t===w())throw new s("expire-custom-caches-only");let e=this.Y.get(t);return e||(e=new A(t,this.X),this.Y.set(t,e)),e}V(t){if(!this.M)return!0;const e=this.Z(t);if(null===e)return!0;return e>=Date.now()-1e3*this.M}Z(t){if(!t.headers.has("date"))return null;const e=t.headers.get("date"),s=new Date(e).getTime();return isNaN(s)?null:s}async deleteCacheAndMetadata(){for(const[t,e]of this.Y)await self.caches.delete(t),await e.delete();this.Y=new Map}},t.NavigationRoute=class extends i{constructor(t,{allowlist:e=[/./],denylist:s=[]}={}){super(t=>this.tt(t),t),this.et=e,this.st=s}tt({url:t,request:e}){if(e&&"navigate"!==e.mode)return!1;const s=t.pathname+t.search;for(const t of this.st)if(t.test(s))return!1;return!!this.et.some(t=>t.test(s))}},t.cleanupOutdatedCaches=function(){self.addEventListener("activate",t=>{const e=f();t.waitUntil((async(t,e="-precache-")=>{const s=(await self.caches.keys()).filter(s=>s.includes(e)&&s.includes(self.registration.scope)&&s!==t);return await Promise.all(s.map(t=>self.caches.delete(t))),s})(e).then(t=>{}))})},t.clientsClaim=function(){self.addEventListener("activate",()=>self.clients.claim())},t.createHandlerBoundToURL=function(t){return Y().createHandlerBoundToURL(t)},t.precacheAndRoute=function(t,e){!function(t){Y().precache(t)}(t),function(t){const e=Y();h(new Z(e,t))}(e)},t.registerRoute=h});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
-- 002-add-indexes.sql
|
|
2
|
-
-- All 13 indexes
|
|
3
|
-
|
|
4
|
-
CREATE INDEX idx_notifications_dev_unread ON notifications(developer_id, is_read, created_at DESC);
|
|
5
|
-
CREATE INDEX idx_tasks_status_created ON tasks(status, created_at DESC);
|
|
6
|
-
CREATE INDEX idx_tasks_machine_developer ON tasks(machine_id, developer_id);
|
|
7
|
-
CREATE INDEX idx_tasks_project ON tasks(project_key);
|
|
8
|
-
CREATE UNIQUE INDEX idx_tasks_active_fingerprint ON tasks(fingerprint)
|
|
9
|
-
WHERE fingerprint IS NOT NULL AND status IN ('QUEUED', 'ASSIGNED', 'RUNNING', 'SUSPENDED');
|
|
10
|
-
CREATE INDEX idx_task_logs_task_id ON task_logs(task_id, timestamp DESC);
|
|
11
|
-
CREATE INDEX idx_agent_sessions_task ON agent_sessions(task_id, status);
|
|
12
|
-
CREATE INDEX idx_workspaces_project ON workspaces(project_key);
|
|
13
|
-
CREATE INDEX idx_project_members_dev ON project_members(developer_id);
|
|
14
|
-
CREATE INDEX idx_project_members_project ON project_members(project_key);
|
|
15
|
-
CREATE INDEX idx_audit_logs_user_time ON audit_logs(user_id, created_at DESC);
|
|
16
|
-
CREATE INDEX idx_audit_logs_action ON audit_logs(action, created_at DESC);
|
|
17
|
-
CREATE INDEX idx_developer_tokens_dev ON developer_tokens(developer_id);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ALTER TABLE projects ADD COLUMN ssh_url TEXT;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as _,r as o,j as e,f as j,l as w,h as C,t as y,o as T,K as S}from"./index-CDBuOPx4.js";import{S as D}from"./Select-A7PXobk_.js";import{E as A}from"./EmptyState-CvmhFgWJ.js";import{T as E}from"./Skeleton-CcVqz28_.js";import{P as L}from"./plus-d-PLzbVX.js";import{C as R}from"./copy-BGttVgA1.js";import{T as M}from"./trash-2-bRJ-xwtq.js";function O({isOpen:t,onClose:i,onCreated:m}){const{t:s}=_(),[c,n]=o.useState(""),[d,x]=o.useState("never"),[u,v]=o.useState(!1),[p,l]=o.useState(""),b=[{value:"never",label:s("access_tokens.no_expiry")},{value:"30",label:s("access_tokens.days_30")},{value:"90",label:s("access_tokens.days_90")},{value:"365",label:s("access_tokens.days_365")}],h=()=>{n(""),x("never"),l(""),i()},f=async()=>{if(l(""),!c.trim()){l(s("access_tokens.token_label_required"));return}try{v(!0);const a=await j.post("web/profile/tokens",{json:{label:c.trim(),...d!=="never"&&{expiresAt:new Date(Date.now()+parseInt(d,10)*864e5).toISOString()}}}).json();n(""),x("never"),m({token:a.token,name:a.name})}catch(a){const k=a instanceof Error?a.message:s("access_tokens.failed_to_create_token");l(k)}finally{v(!1)}};return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40 bg-[var(--modal-backdrop)]",onClick:h}),e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{className:"border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text-primary)]",children:s("access_tokens.create_personal_access_token")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:s("access_tokens.tokens_authenticate_desc")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[p&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)]/30 bg-[var(--destructive)]/5 px-3 py-2 text-xs text-[var(--destructive)]",children:p}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("access_tokens.token_name")}),e.jsx("input",{type:"text",placeholder:s("access_tokens.token_name_placeholder"),value:c,onChange:a=>n(a.target.value),onKeyDown:a=>{a.key==="Enter"&&f()},className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("access_tokens.expires")}),e.jsx(D,{value:d,onChange:x,options:b})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{onClick:h,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:s("common.cancel")}),e.jsx("button",{onClick:f,disabled:u,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:s(u?"common.creating":"access_tokens.create_token")})]})]})})]}):null}function P({isOpen:t,onClose:i,onConfirm:m,tokenLabel:s,isLoading:c}){const{t:n}=_();return e.jsx(w,{isOpen:t,onClose:i,onConfirm:m,title:n("access_tokens.revoke_token_title"),message:n("access_tokens.revoke_confirm",{name:s}),confirmLabel:n("access_tokens.revoke"),confirmVariant:"danger",isLoading:c})}function $(t){if(!t)return"-";const i=new Date(t).getTime();if(Number.isNaN(i))return"-";const m=Date.now()-i,s=Math.floor(m/1e3);if(s<60)return`${s}s ago`;const c=Math.floor(s/60);if(c<60)return`${c}m ago`;const n=Math.floor(c/60);return n<24?`${n} hours ago`:`${Math.floor(n/24)}d ago`}function V(){const{t}=_(),[i,m]=o.useState([]),[s,c]=o.useState(!0),[n,d]=o.useState(!1),[x,u]=o.useState(null),[v,p]=o.useState(!1),[l,b]=o.useState(null),[h,f]=o.useState(null);C(o.useMemo(()=>e.jsxs("button",{onClick:()=>d(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black transition-opacity hover:opacity-90",children:[e.jsx(L,{className:"h-3.5 w-3.5"}),t("access_tokens.create_token")]}),[t]));const a=o.useCallback(async()=>{try{c(!0);const r=await j.get("web/profile/tokens").json();m(r)}catch{y.error(t("access_tokens.failed_to_load_tokens"))}finally{c(!1)}},[t]);o.useEffect(()=>{a()},[a]);const k=r=>{d(!1),u(r.token),p(!1),a()},g=async()=>{if(x)try{await navigator.clipboard.writeText(x),p(!0),setTimeout(()=>p(!1),2e3)}catch{}},N=async()=>{if(l)try{f(l.id),await j.post(`web/profile/tokens/${l.id}/revoke`),y.success(t("access_tokens.token_revoked")),b(null),a()}catch{y.error(t("access_tokens.failed_to_revoke_token"))}finally{f(null)}};return e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 font-mono lowercase",children:[x&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx("p",{className:"mb-2 text-xs font-medium text-[var(--warning)]",children:t("access_tokens.copy_token_warning")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 break-all rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 text-xs text-[var(--text-primary)]",children:x}),e.jsxs("button",{onClick:g,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:[v?e.jsx(T,{className:"h-3.5 w-3.5 text-[var(--accent)]"}):e.jsx(R,{className:"h-3.5 w-3.5"}),t(v?"common.copied":"common.copy")]})]}),e.jsx("div",{className:"mt-2 flex justify-end",children:e.jsx("button",{onClick:()=>u(null),className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:t("common.dismiss")})})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:s?e.jsx("div",{className:"p-4",children:e.jsx(E,{rows:3})}):i.length===0?e.jsx(A,{icon:S,title:t("access_tokens.no_tokens"),description:t("access_tokens.create_token_desc"),actionLabel:t("access_tokens.create_token"),onAction:()=>d(!0)}):e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("common.name")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("common.status")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("access_tokens.created")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("access_tokens.last_used")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("access_tokens.expires")}),e.jsx("th",{className:"px-4 py-2.5 font-normal text-right",children:t("common.actions")})]})}),e.jsx("tbody",{children:i.map(r=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0 hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"px-4 py-3 text-[var(--text-primary)]",children:r.label}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:r.status==="active"?"text-green-400":"text-[var(--text-muted)]",children:r.status})}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:new Date(r.createdAt).toLocaleDateString()}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:r.lastUsedAt?$(r.lastUsedAt):t("common.never")}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:r.expiresAt?new Date(r.expiresAt).toLocaleDateString():t("common.never")}),e.jsx("td",{className:"px-4 py-3 text-right",children:r.status==="active"&&e.jsxs("button",{onClick:()=>b(r),disabled:h===r.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(M,{className:"h-3 w-3"}),t("access_tokens.revoke")]})})]},r.id))})]})}),e.jsx(O,{isOpen:n,onClose:()=>d(!1),onCreated:k}),e.jsx(P,{isOpen:!!l,onClose:()=>b(null),onConfirm:N,tokenLabel:(l==null?void 0:l.label)??"",isLoading:h!==null})]})}export{V as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as d,e as l,d as c,K as p,r as b,j as e,w as x,O as v}from"./index-CDBuOPx4.js";import{U as f}from"./users-LNQqKSEN.js";import{B as u}from"./bot-DYvBcsZn.js";import{S as g}from"./scroll-text-CV3wlIy2.js";import{S as h}from"./settings-Ccijf48b.js";function S(){const{t:a}=d(),t=l(),o=c(),r=[{to:"/admin/developers",label:a("admin.tab_developers"),icon:f},{to:"/admin/bots",label:a("admin.tab_bots"),icon:u},{to:"/admin/tokens",label:a("admin.tab_tokens"),icon:p},{to:"/admin/audit-logs",label:a("admin.tab_audit_logs"),icon:g},{to:"/admin/settings",label:a("admin.tab_settings"),icon:h}];return b.useEffect(()=>{(t.pathname==="/admin"||t.pathname==="/admin/")&&o("/admin/developers",{replace:!0})},[t.pathname,o]),e.jsxs("div",{children:[e.jsx("div",{className:"mb-6 flex flex-nowrap gap-2 overflow-x-auto border-b border-[var(--border)] no-scrollbar",children:r.map(({to:s,label:n,icon:i})=>e.jsxs(x,{to:s,className:({isActive:m})=>`flex shrink-0 items-center gap-2 border-b-2 px-4 py-2 text-sm transition-colors ${m?"border-[var(--accent)] text-[var(--accent)]":"border-transparent text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:[e.jsx(i,{size:16}),n]},s))}),e.jsx(v,{})]})}export{S as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d,a as n,h as p,r as o,j as t}from"./index-CDBuOPx4.js";import{Q as c}from"./QuickAuth-B9mvq7ht.js";import{P as h}from"./plus-d-PLzbVX.js";import"./copy-BGttVgA1.js";const l={GET:"text-green-400",POST:"text-blue-400",PUT:"text-yellow-400",DELETE:"text-red-400"},m=[{title:"authentication",prefix:"/api/auth",endpoints:[{method:"POST",path:"/login",description:"authenticate with username + password (optional totpCode)",auth:"none",body:'{ "username": "string", "password": "string", "totpCode?": "string" }',response:'{ "accessToken": "string", "refreshToken": "string" }'},{method:"POST",path:"/refresh",description:"refresh access token (rotates refresh token)",auth:"none",body:'{ "refreshToken": "string" }',response:'{ "accessToken": "string", "refreshToken": "string" }'},{method:"POST",path:"/logout",description:"invalidate refresh token",auth:"jwt",body:'{ "refreshToken": "string" }'}]},{title:"tasks",prefix:"/api/web/tasks",endpoints:[{method:"GET",path:"",description:"list tasks with optional filters",auth:"jwt",response:'[ { "id": 1, "description": "...", "status": "RUNNING", ... } ]'},{method:"POST",path:"",description:"create a new task",auth:"jwt",body:'{ "projectKey": "string", "description": "string", "machineId?": "string" }'},{method:"GET",path:"/:id",description:"get task details",auth:"jwt"},{method:"POST",path:"/:id/cancel",description:"cancel a running task",auth:"jwt"},{method:"POST",path:"/:id/retry",description:"retry a failed task",auth:"jwt"},{method:"POST",path:"/:id/confirm-stage",description:"confirm/choose/input for suspended stage",auth:"jwt",body:'{ "stageIndex": "number", "result": "string" }'},{method:"POST",path:"/:id/pty-token",description:"get pty websocket token",auth:"jwt"}]},{title:"machines",prefix:"/api/web/machines",endpoints:[{method:"GET",path:"",description:"list all machines",auth:"jwt"},{method:"GET",path:"/:id",description:"get machine details",auth:"jwt"},{method:"GET",path:"/:id/tasks",description:"list tasks assigned to a machine",auth:"jwt"},{method:"POST",path:"/:id/drain",description:"start draining a machine",auth:"jwt"},{method:"POST",path:"/:id/undrain",description:"cancel machine drain",auth:"jwt"}]},{title:"projects",prefix:"/api/web/projects",endpoints:[{method:"GET",path:"",description:"list all projects",auth:"jwt"},{method:"GET",path:"/:key",description:"get project details",auth:"jwt"}]},{title:"profile",prefix:"/api/web/profile",endpoints:[{method:"GET",path:"",description:"get current user profile",auth:"jwt"},{method:"PUT",path:"",description:"update profile (gitName, gitEmail)",auth:"jwt",body:'{ "gitName?": "string", "gitEmail?": "string" }'},{method:"PUT",path:"/password",description:"change password",auth:"jwt",body:'{ "currentPassword": "string", "newPassword": "string" }'},{method:"POST",path:"/totp/setup",description:"initialize totp setup",auth:"jwt"},{method:"POST",path:"/totp/verify",description:"verify totp setup code",auth:"jwt",body:'{ "code": "string" }'},{method:"GET",path:"/tokens",description:"list personal access tokens",auth:"jwt"},{method:"POST",path:"/tokens",description:"create a personal access token",auth:"jwt",body:'{ "label": "string", "expiresAt?": "string" }'},{method:"POST",path:"/tokens/:id/revoke",description:"revoke a token",auth:"jwt"}]},{title:"workspaces & tunnels",prefix:"/api/web",endpoints:[{method:"GET",path:"/workspaces/:taskId",description:"get workspace for a task",auth:"jwt"},{method:"POST",path:"/workspace-tunnel/:taskId/start",description:"start a cursor remote tunnel",auth:"jwt"},{method:"POST",path:"/workspace-tunnel/:taskId/stop",description:"stop a running tunnel",auth:"jwt"},{method:"GET",path:"/workspace-tunnel/:taskId/status",description:"get tunnel status",auth:"jwt"}]},{title:"dashboard",prefix:"/api/web/dashboard",endpoints:[{method:"GET",path:"/stats",description:"get dashboard statistics",auth:"jwt"},{method:"GET",path:"/recent-tasks",description:"get recent tasks for dashboard",auth:"jwt"},{method:"GET",path:"/recent-activity",description:"get recent activity feed",auth:"jwt"}]},{title:"notifications",prefix:"/api/web/notifications",endpoints:[{method:"GET",path:"",description:"list notifications with cursor pagination",auth:"jwt"},{method:"POST",path:"/:id/read",description:"mark a notification as read",auth:"jwt"},{method:"POST",path:"/read-all",description:"mark all notifications as read",auth:"jwt"}]},{title:"search",prefix:"/api/web",endpoints:[{method:"GET",path:"/search?q=query",description:"global search across tasks, machines, projects",auth:"jwt"}]},{title:"admin — developers",prefix:"/api/admin/developers",endpoints:[{method:"GET",path:"",description:"list all developers",auth:"jwt"},{method:"POST",path:"",description:"create a developer",auth:"jwt",body:'{ "name": "string", "password": "string", "role": "string", "gitName": "string", "gitEmail": "string" }'},{method:"PUT",path:"/:id",description:"update developer",auth:"jwt"},{method:"PUT",path:"/:id/reset-totp",description:"reset developer totp",auth:"jwt"}]},{title:"admin — projects",prefix:"/api/admin/projects",endpoints:[{method:"GET",path:"",description:"list all projects",auth:"jwt"},{method:"POST",path:"",description:"create a project",auth:"jwt"},{method:"PUT",path:"/:key",description:"update project (including pipeline)",auth:"jwt"},{method:"DELETE",path:"/:key",description:"delete a project",auth:"jwt"},{method:"GET",path:"/:key/members",description:"get project members",auth:"jwt"},{method:"POST",path:"/:key/members",description:"add project member",auth:"jwt"},{method:"DELETE",path:"/:key/members?developerId=N",description:"remove project member",auth:"jwt"}]},{title:"admin — worker tokens",prefix:"/api/admin/worker-tokens",endpoints:[{method:"GET",path:"",description:"list all worker enrollment tokens",auth:"jwt"},{method:"POST",path:"",description:"generate a new worker token",auth:"jwt"},{method:"POST",path:"/:id/revoke",description:"revoke a worker token",auth:"jwt"},{method:"GET",path:"/:id/status",description:"get token status and linked machine",auth:"jwt"}]},{title:"admin — machines",prefix:"/api/admin/machines",endpoints:[{method:"GET",path:"",description:"list all machines (admin)",auth:"jwt"},{method:"PUT",path:"/:id",description:"update machine status",auth:"jwt",body:'{ "status?": "string" }'}]},{title:"admin — bots",prefix:"/api/admin/bots",endpoints:[{method:"GET",path:"",description:"list bot instances",auth:"jwt"},{method:"POST",path:"",description:"create a bot instance",auth:"jwt"},{method:"GET",path:"/:id/bindings",description:"get chat bindings for a bot",auth:"jwt"},{method:"POST",path:"/:id/bindings",description:"create a chat binding",auth:"jwt"},{method:"DELETE",path:"/:id/bindings",description:"delete a chat binding",auth:"jwt"}]},{title:"admin — audit & settings",prefix:"/api/admin",endpoints:[{method:"GET",path:"/audit-logs",description:"query audit log with filters",auth:"jwt"},{method:"GET",path:"/settings",description:"get all system settings",auth:"jwt"},{method:"PUT",path:"/settings",description:"update system settings",auth:"jwt"}]},{title:"websocket",prefix:"",endpoints:[{method:"GET",path:"WS /ws/pty/:taskId",description:'pty terminal websocket — first obtain a channel token via POST /api/web/tasks/:taskId/pty-token, then send an auth frame after connection: { type: "auth", token: "<jwt>", channelToken: "<channel-token>" }',auth:"jwt"},{method:"GET",path:"WS /api/workers/pty/:taskId",description:'worker pty websocket — auth via frame: { type: "auth", workerJwt: "<worker-jwt>", channelToken: "<channel-token>" }',auth:"worker-token"}]}];function x({ep:e,prefix:s}){const[a,i]=o.useState(!1),{t:r}=n();return t.jsxs("div",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[t.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors hover:bg-[var(--bg-input)]",onClick:()=>i(!a),children:[t.jsx("span",{className:`w-12 shrink-0 text-xs font-bold ${l[e.method]}`,children:e.method}),t.jsxs("code",{className:"flex-1 text-xs text-[var(--text-primary)] truncate",children:[s,e.path]}),t.jsxs("span",{className:"text-xs text-[var(--text-muted)] hidden sm:inline truncate max-w-[200px]",children:["// ",e.description]})]}),a&&t.jsxs("div",{className:"border-t border-[var(--border-row)] bg-[var(--bg-primary)] px-4 py-3 space-y-2",children:[t.jsxs("p",{className:"text-xs text-[var(--text-secondary)]",children:["// ",e.description]}),t.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[t.jsx("span",{className:"text-[var(--text-muted)]",children:"auth:"}),t.jsx("span",{className:e.auth==="none"?"text-[var(--text-muted)]":"text-[var(--accent)]",children:e.auth})]}),e.body&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[10px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:r("docs.request_body")}),t.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-secondary)] overflow-x-auto",children:e.body})]}),e.response&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[10px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:r("docs.response")}),t.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-secondary)] overflow-x-auto",children:e.response})]})]})]})}function g(){const e=d(),{t:s}=n();return p(o.useMemo(()=>t.jsxs("button",{onClick:()=>e("/access-tokens"),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[t.jsx(h,{className:"h-3.5 w-3.5"}),s("access_tokens.create_token")]}),[e,s])),t.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 font-mono lowercase",children:[t.jsx("div",{className:"mb-8",children:t.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("docs.api_base_url_desc",{url:"http://localhost:9000"})})}),t.jsx(c,{mode:"api"}),t.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-2",children:[t.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("docs.authentication")}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-[var(--accent)]",children:"jwt"}),t.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:["obtained via /api/auth/login — pass as ",t.jsx("code",{children:"authorization: bearer <token>"})]})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-[var(--accent)]",children:"pat"}),t.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:"personal access token — same header format, for cli/api usage"})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-yellow-400",children:"worker-token"}),t.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:"enrollment token for worker registration — used during initial handshake"})]})]}),t.jsx("div",{className:"space-y-6",children:m.map(a=>t.jsxs("div",{children:[t.jsxs("h2",{className:"mb-2 text-sm text-[var(--accent)]",children:["> ",a.title]}),t.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:a.endpoints.map((i,r)=>t.jsx(x,{ep:i,prefix:a.prefix},`${i.method}-${i.path}-${r}`))})]},a.title))})]})}export{g as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as C,a as S,r,f as k,j as e,i as L}from"./index-CDBuOPx4.js";import{S as E}from"./Select-A7PXobk_.js";import{E as T}from"./EmptyState-CvmhFgWJ.js";import{T as F}from"./Skeleton-CcVqz28_.js";import{S as A}from"./scroll-text-CV3wlIy2.js";import{C as P}from"./chevron-right-COxU2yxz.js";/**
|
|
2
|
-
* @license lucide-react v0.469.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const I=C("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);function q(){const{t:a}=S(),v=[{value:"",label:a("admin.all_actions")},{value:"login",label:a("admin.action_login")},{value:"logout",label:a("admin.action_logout")},{value:"create",label:a("admin.action_create")},{value:"update",label:a("admin.action_update")},{value:"delete",label:a("admin.action_delete")},{value:"revoke",label:a("admin.action_revoke")},{value:"reset_2fa",label:a("admin.action_reset_2fa")},{value:"generate_token",label:a("admin.action_generate_token")}],[d,h]=r.useState([]),[b,u]=r.useState(!0),[o,f]=r.useState(""),[n,g]=r.useState(""),[j,c]=r.useState(void 0),[x,m]=r.useState([]),[l,N]=r.useState(void 0),i=r.useCallback(async t=>{try{u(!0);const s={limit:"50"};t&&(s.cursor=t),o&&(s.action=o),n&&(s.user=n);const p=await k.get("admin/audit-logs",{searchParams:s}).json();h(p.data),N(p.nextCursor)}catch{}finally{u(!1)}},[o,n]);r.useEffect(()=>{c(void 0),m([]),i()},[i]);const y=()=>{l&&(m(t=>[...t,j??""]),c(l),i(l))},_=()=>{if(x.length===0)return;const t=[...x],s=t.pop();m(t),c(s||void 0),i(s||void 0)},w=t=>t.startsWith("delete")||t==="revoke"?"text-red-400":t.startsWith("create")||t==="generate_token"?"text-green-400":t.startsWith("update")||t==="reset_2fa"?"text-yellow-400":t==="login"?"text-blue-400":"text-[var(--text-secondary)]";return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.audit_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.audit_subtitle")})]}),e.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[e.jsx(E,{value:o,onChange:f,options:v}),e.jsxs("div",{className:"relative max-w-xs",children:[e.jsx(L,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:a("admin.filter_by_user"),value:n,onChange:t=>g(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]})]}),b?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(F,{rows:5})}):d.length===0?e.jsx(T,{icon:A,title:a("admin.no_audit_entries"),description:a("admin.audit_logs_appear")}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.timestamp")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.user_id")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.action")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.resource")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.detail")}),e.jsx("th",{className:"pb-2 font-normal",children:a("admin.ip")})]})}),e.jsx("tbody",{children:d.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"whitespace-nowrap py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(t.createdAt).toLocaleString()}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.userId}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:w(t.action),children:t.action})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.resource}),e.jsx("td",{className:"max-w-xs truncate py-2.5 pr-4 text-[var(--text-muted)]",children:t.detail}),e.jsx("td",{className:"py-2.5 text-[var(--text-muted)]",children:t.ip})]},t.id))})]})}),e.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("admin.showing_entries",{count:String(d.length)})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{type:"button",disabled:x.length===0,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",onClick:_,children:[e.jsx(I,{className:"h-3.5 w-3.5"}),a("common.previous")]}),e.jsxs("button",{type:"button",disabled:!l,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",onClick:y,children:[a("common.next"),e.jsx(P,{className:"h-3.5 w-3.5"})]})]})]})]})]})}export{q as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as M,a as B,r as a,j as e,X as I,f as _,l as z,t as K}from"./index-CDBuOPx4.js";import{S as P}from"./Select-A7PXobk_.js";import{T as $}from"./trash-2-bRJ-xwtq.js";import{P as D}from"./plus-d-PLzbVX.js";import{E as q}from"./EmptyState-CvmhFgWJ.js";import{T}from"./Skeleton-CcVqz28_.js";import{B as F}from"./bot-DYvBcsZn.js";import{P as O}from"./pencil-Bs3PwH2W.js";/**
|
|
2
|
-
* @license lucide-react v0.469.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const R=M("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]),U=[{value:"lark",label:"lark_(feishu)"},{value:"slack",label:"slack"}];function H({isOpen:t,onClose:h,onCreated:S,editBot:x,onEditClose:n}){const{t:o}=B(),d=!!x,[w,p]=a.useState(""),[v,j]=a.useState("lark"),[f,b]=a.useState(""),[c,u]=a.useState(""),[y,g]=a.useState(""),[N,k]=a.useState(!1),[L,m]=a.useState("");a.useEffect(()=>{t&&(x?(p(x.name),j(x.platform),b(x.appId),u(""),g("")):(p(""),j("lark"),b(""),u(""),g("")),k(!1),m(""))},[x,t]);const i=()=>{d&&n?n():h()},C=async()=>{if(m(""),!w.trim()||!f.trim()){m(o("admin.name_and_app_id_required"));return}if(!d&&!c.trim()){m(o("admin.app_secret_required"));return}const l={name:w.trim(),platform:v,appId:f.trim()};c.trim()&&(l.appSecret=c.trim()),y.trim()&&(l.webhookToken=y.trim());try{k(!0),d?await _.put(`admin/bots/${x.id}`,{json:l}).json():await _.post("admin/bots",{json:l}).json(),i(),S()}catch(E){const s=E instanceof Error?E.message:o(d?"admin.failed_to_update_bot":"admin.failed_to_create_bot");m(s)}finally{k(!1)}};return t?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[e.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]",onClick:i}),e.jsxs("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h3",{className:"text-sm text-[var(--text-primary)]",children:d?`// ${o("admin.edit_bot")}`:`// ${o("admin.create_bot")}`}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",onClick:i,children:e.jsx(I,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[L&&e.jsx("div",{className:"rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:L}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:o("admin.bot_name")}),e.jsx("input",{type:"text",placeholder:"e.g. overlord lark bot",value:w,onChange:l=>p(l.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:o("admin.platform")}),e.jsx(P,{value:v,onChange:j,options:U,disabled:d})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:o("admin.app_id")}),e.jsx("input",{type:"text",placeholder:"platform application id",value:f,onChange:l=>b(l.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:o(d?"admin.app_secret_keep_current":"admin.app_secret")}),e.jsx("input",{type:"password",placeholder:"platform application secret",value:c,onChange:l=>u(l.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:o("admin.webhook_url_optional")}),e.jsx("textarea",{placeholder:"https://...",value:y,onChange:l=>g(l.target.value),rows:2,className:"w-full resize-none rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",onClick:i,children:o("common.cancel")}),e.jsx("button",{type:"button",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:N,onClick:C,children:o(N?d?"common.saving":"common.creating":d?"common.save_changes":"common.create")})]})]})]}):null}function V({isOpen:t,bot:h,onClose:S,onUpdated:x}){const{t:n}=B(),[o,d]=a.useState([]),[w,p]=a.useState([]),[v,j]=a.useState(!1),[f,b]=a.useState(!1),[c,u]=a.useState(""),[y,g]=a.useState(""),[N,k]=a.useState(""),[L,m]=a.useState(""),i=a.useCallback(async()=>{try{const s=await _.get(`admin/bots/${h.id}/bindings`).json();d(s)}catch{}},[h.id]);a.useEffect(()=>{t&&i()},[t,i]);const C=a.useCallback(async()=>{try{const s=await _.get("web/projects").json();p(s)}catch{}},[]);a.useEffect(()=>{t&&C()},[t,C]);const l=async()=>{if(m(""),!c.trim()||!y.trim()||!N){m(n("admin.chat_binding_all_fields_required"));return}try{j(!0),await _.post(`admin/bots/${h.id}/bindings`,{json:{platformChatId:c.trim(),chatName:y.trim(),projectKey:N}}).json(),u(""),g(""),k(""),b(!1),x()}catch(s){const r=s instanceof Error?s.message:n("admin.failed_to_add_binding");m(r)}finally{j(!1)}},E=async s=>{try{await _.delete(`admin/bots/${h.id}/bindings/${s}`),d(r=>r.filter(A=>A.id!==s)),x()}catch{}};return t?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[e.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]",onClick:S}),e.jsxs("div",{className:"relative z-10 w-full max-w-[600px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h3",{className:"text-sm text-[var(--text-primary)]",children:n("admin.chat_binding_title",{name:h.name})}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",onClick:S,children:e.jsx(I,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"px-5 py-5",children:[L&&e.jsx("div",{className:"mb-4 rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:L}),o.length===0&&!f?e.jsx("p",{className:"py-4 text-center text-xs text-[var(--text-muted)]",children:n("admin.chat_binding_no_bindings")}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:n("admin.chat_name")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:n("admin.chat_id")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:n("admin.project")}),e.jsx("th",{className:"pb-2 font-normal",children:n("common.remove")})]})}),e.jsx("tbody",{children:o.map(s=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:s.chatName}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:s.platformChatId}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:s.projectKey}),e.jsx("td",{className:"py-2.5",children:e.jsx("button",{type:"button",className:"rounded-[4px] p-1.5 text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>E(s.id),children:e.jsx($,{className:"h-3.5 w-3.5"})})})]},s.id))})]})}),f&&e.jsxs("div",{className:"mt-4 space-y-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-4",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:n("admin.chat_binding_add")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:n("admin.chat_id")}),e.jsx("input",{type:"text",placeholder:n("admin.chat_binding_id_placeholder"),value:c,onChange:s=>u(s.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:n("admin.chat_name")}),e.jsx("input",{type:"text",placeholder:n("admin.chat_binding_name_placeholder"),value:y,onChange:s=>g(s.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:n("admin.project")}),e.jsx(P,{value:N,onChange:k,options:w.map(s=>({value:s.key,label:`${s.name} (${s.key})`})),placeholder:n("admin.chat_binding_select_project")})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",onClick:()=>b(!1),children:n("common.cancel")}),e.jsx("button",{type:"button",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:v,onClick:l,children:n(v?"admin.chat_binding_adding":"admin.add_binding")})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between border-t border-[var(--border)] px-5 py-4",children:[e.jsx("div",{children:!f&&e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] transition-colors",onClick:()=>b(!0),children:[e.jsx(D,{className:"h-3.5 w-3.5"}),n("admin.add_binding")]})}),e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",onClick:S,children:n("common.close")})]})]})]}):null}function te(){const{t}=B(),[h,S]=a.useState([]),[x,n]=a.useState(!0),[o,d]=a.useState(!1),[w,p]=a.useState(null),[v,j]=a.useState(null),[f,b]=a.useState(!1),[c,u]=a.useState(null),[y,g]=a.useState(!1),[N,k]=a.useState([]),[L,m]=a.useState(!0),i=a.useCallback(async()=>{try{n(!0);const r=await _.get("admin/bots").json();S(r)}catch{}finally{n(!1)}},[]),C=a.useCallback(async()=>{try{m(!0);const r=await _.get("admin/bots/all-bindings").json();k(r)}catch{}finally{m(!1)}},[]);a.useEffect(()=>{i(),C()},[i,C]);const l=async()=>{if(c){g(!0);try{await _.delete(`admin/bots/${c.id}`),b(!1),u(null),i()}catch{K.error(t("admin.failed_to_delete_bot"))}finally{g(!1)}}},E=r=>{switch(r){case"lark":return"text-blue-400";case"slack":return"text-yellow-400";default:return"text-[var(--text-secondary)]"}},s=r=>{switch(r){case"active":return"text-green-400";case"inactive":return"text-[var(--text-muted)]";case"error":return"text-red-400";default:return"text-[var(--text-muted)]"}};return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:t("admin.bots_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t("admin.bots_subtitle")})]}),e.jsxs("button",{type:"button",className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity",onClick:()=>{p(null),d(!0)},children:[e.jsx(D,{className:"h-3.5 w-3.5"}),t("admin.create_bot")]})]}),x?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(T,{rows:3})}):h.length===0?e.jsx(q,{icon:F,title:t("admin.no_bots_configured"),description:t("admin.add_bot_desc"),actionLabel:t("admin.create_bot"),onAction:()=>{p(null),d(!0)}}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:t("admin.bot_name")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:t("admin.platform")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:t("admin.app_id")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:t("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:t("common.created_at")}),e.jsx("th",{className:"pb-2 font-normal",children:t("common.actions")})]})}),e.jsx("tbody",{children:h.map(r=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:r.name}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:E(r.platform),children:r.platform})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:r.appId}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:s(r.status),children:r.status})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(r.createdAt).toLocaleDateString()}),e.jsx("td",{className:"py-2.5",children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{type:"button",className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-white/[0.05] transition-colors",title:t("common.edit"),onClick:()=>p(r),children:e.jsx(O,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-white/[0.05] transition-colors",title:t("admin.chat_bindings"),onClick:()=>j(r),children:e.jsx(R,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1.5 text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",title:t("common.delete"),onClick:()=>{u(r),b(!0)},children:e.jsx($,{className:"h-3.5 w-3.5"})})]})})]},r.id))})]})}),e.jsx(H,{isOpen:o||!!w,onClose:()=>{d(!1),p(null)},onCreated:i,editBot:w,onEditClose:()=>p(null)}),v&&e.jsx(V,{isOpen:!!v,bot:v,onClose:()=>j(null),onUpdated:()=>{i(),C()}}),e.jsx(z,{isOpen:f,onClose:()=>{b(!1),u(null)},onConfirm:l,title:t("admin.delete_bot"),message:t("admin.delete_bot_confirm",{name:(c==null?void 0:c.name)??""}),confirmLabel:t("common.delete"),confirmVariant:"danger",isLoading:y}),e.jsxs("div",{className:"mt-8",children:[e.jsxs("h2",{className:"mb-4 text-sm text-[var(--text-primary)]",children:[t("admin.chat_bindings"),e.jsx("span",{className:"ml-2 text-[var(--text-muted)]",children:t("admin.chat_bindings_subtitle")})]}),L?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(T,{rows:3})}):N.length===0?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-8 text-center",children:e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t("admin.no_chat_bindings")})}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:t("admin.bot")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:t("admin.platform")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:t("admin.chat_id")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:t("admin.chat_name")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:t("admin.project")}),e.jsx("th",{className:"pb-2 font-normal",children:t("common.created_at")})]})}),e.jsx("tbody",{children:N.map(r=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:r.botName}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:E(r.platform),children:r.platform})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:r.platformChatId}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:r.chatName??"-"}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:r.projectKey??"-"}),e.jsx("td",{className:"py-2.5 text-[var(--text-muted)]",children:new Date(r.createdAt).toLocaleDateString()})]},r.id))})]})})]})]})}export{te as default};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{d as l,a as c,h as p,r as d,j as e,C as m}from"./index-CDBuOPx4.js";import{Q as x}from"./QuickAuth-B9mvq7ht.js";import{P as u}from"./plus-d-PLzbVX.js";import{C as v}from"./copy-BGttVgA1.js";const g=[{command:"ov setup",description:"quick setup — configure server connection and authenticate in one step",usage:"ov setup [--server <url>] [--token <token>]",flags:[{flag:"--server <url>",desc:"overlord server url"},{flag:"--token <token>",desc:"personal access token (skips prompt)"}],example:`ov setup
|
|
2
|
-
> Overlord server URL: http://localhost:9000
|
|
3
|
-
> Personal Access Token: ov_pat_xxxxx
|
|
4
|
-
✓ Connected to http://localhost:9000
|
|
5
|
-
✓ Authenticated as admin (admin)`},{command:"ov login",description:"authenticate with the overlord server using a personal access token",usage:"ov login",example:`ov login
|
|
6
|
-
> Enter server URL: http://localhost:9000
|
|
7
|
-
> Enter PAT: ov_pat_xxxxx
|
|
8
|
-
✓ Logged in as admin`},{command:"ov logout",description:"clear stored credentials",usage:"ov logout"},{command:"ov whoami",description:"show current authenticated user",usage:"ov whoami"},{command:"ov task create",description:"create a new task",usage:"ov task create -d <description> [-p <project>] [--on <machine>]",flags:[{flag:"-d, --description",desc:"task description (required unless -f)"},{flag:"-p, --project",desc:"project key to assign the task to"},{flag:"--on",desc:"target machine id (optional)"},{flag:"-f, --file",desc:"create task from yaml file"}],example:'ov task create -d "fix login bug" -p overlord'},{command:"ov task list",description:"list all tasks with optional filters",usage:"ov task list [--status <status>] [-p <project>]",flags:[{flag:"--status",desc:"filter by status (RUNNING, QUEUED, COMPLETED, FAILED, CANCELLED)"},{flag:"-p, --project",desc:"filter by project key"}]},{command:"ov task show <id>",description:"show detailed information about a task",usage:"ov task show <task_id>"},{command:"ov task cancel <id>",description:"cancel a running or queued task",usage:"ov task cancel <task_id>"},{command:"ov task retry <id>",description:"retry a failed task",usage:"ov task retry <task_id>"},{command:"ov task logs <id>",description:"view task logs (streams via pty if active, fetches historical otherwise)",usage:"ov task logs <task_id> [--json]",flags:[{flag:"--json",desc:"output as json"}]},{command:"ov task confirm <id>",description:"confirm a suspended task stage",usage:"ov task confirm <task_id> --stage <index>",flags:[{flag:"--stage <index>",desc:"stage index to confirm (required)"}]},{command:"ov task choose <id> <option>",description:"submit a choice for a suspended task",usage:"ov task choose <task_id> <option> --stage <index>",flags:[{flag:"--stage <index>",desc:"stage index to respond to (required)"}]},{command:"ov task input <id> <text>",description:"submit text input for a suspended task",usage:"ov task input <task_id> <text> --stage <index>",flags:[{flag:"--stage <index>",desc:"stage index to respond to (required)"}]},{command:"ov attach <id>",description:"connect to a task pty terminal",usage:"ov attach <task_id> [--watch] [--takeover] [--session <id>]",flags:[{flag:"--watch",desc:"read-only observer mode"},{flag:"--takeover",desc:"take over pty control from current user"},{flag:"--session <id>",desc:"session id for takeover"}]},{command:"ov project list",description:"list all projects",usage:"ov project list"},{command:"ov project show <key>",description:"show project details",usage:"ov project show <project_key>"},{command:"ov machine list",description:"list all registered machines",usage:"ov machine list"},{command:"ov machine show <id>",description:"show machine details",usage:"ov machine show <machine_id>"},{command:"ov notifications",description:"view your notifications",usage:"ov notifications [--all] [--json]",flags:[{flag:"--all",desc:"show all notifications (including read)"},{flag:"--json",desc:"output as json"}]},{command:"ov notifications read <id>",description:"mark a notification as read",usage:"ov notifications read <notification_id>"},{command:"ov search <query>",description:"search across tasks, machines, and projects",usage:"ov search <query>"},{command:"ov config set <key> <value>",description:"set a configuration value",usage:"ov config set <key> <value>",flags:[{flag:"server",desc:"overlord server url"},{flag:"default-project",desc:"default project key"},{flag:"output-format",desc:"output format (table, json)"},{flag:"color",desc:"enable/disable color (true/false)"}]},{command:"ov config get <key>",description:"get a configuration value",usage:"ov config get <key>"},{command:"ov config list",description:"list all configuration values",usage:"ov config list [--json]"},{command:"ov status",description:"show server connectivity, current user, and cluster overview",usage:"ov status [--json]"},{command:"ov upgrade",description:"upgrade ov cli to the latest version",usage:"ov upgrade"}],h=[{command:"overlord install",description:"interactive server installation wizard — checks environment, configures database, creates admin account",usage:"overlord install"},{command:"overlord setup worker",description:"interactive worker setup wizard — configures connection, writes .env, registers service",usage:"overlord setup worker"},{command:"overlord start [component]",description:"start server or worker services (systemd / launchd)",usage:"overlord start [server|worker]"},{command:"overlord stop [component]",description:"stop running processes",usage:"overlord stop [server|worker]"},{command:"overlord status",description:"show process status table (pid, cpu, memory, uptime)",usage:"overlord status"},{command:"overlord logs [component]",description:"view server or worker logs",usage:"overlord logs [server|worker] [--lines <n>]"},{command:"overlord doctor",description:"run system diagnostics",usage:"overlord doctor"},{command:"overlord upgrade",description:"upgrade to the latest release",usage:"overlord upgrade"}];function o({text:a}){const[t,r]=d.useState(!1),{t:s}=c();return e.jsx("button",{onClick:async()=>{await navigator.clipboard.writeText(a),r(!0),setTimeout(()=>r(!1),2e3)},className:"rounded-[4px] p-1 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",title:s("common.copy"),children:t?e.jsx(m,{className:"h-3 w-3 text-[var(--accent)]"}):e.jsx(v,{className:"h-3 w-3"})})}function n({title:a,commands:t}){const{t:r}=c();return e.jsxs("div",{children:[e.jsxs("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:["> ",a]}),e.jsx("div",{className:"space-y-3",children:t.map(s=>e.jsxs("details",{className:"group rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("summary",{className:"flex cursor-pointer items-center justify-between px-4 py-3 hover:bg-[var(--bg-input)] transition-colors",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:s.command}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// ",s.description]})]})}),e.jsxs("div",{className:"border-t border-[var(--border)] px-4 py-3 space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:r("docs.usage")}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--text-primary)]",children:s.usage}),e.jsx(o,{text:s.usage})]})]}),s.flags&&s.flags.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:r("docs.flags")}),e.jsx("div",{className:"space-y-1",children:s.flags.map(i=>e.jsxs("div",{className:"flex items-start gap-3 text-xs",children:[e.jsx("code",{className:"shrink-0 text-[var(--accent)]",children:i.flag}),e.jsx("span",{className:"text-[var(--text-secondary)]",children:i.desc})]},i.flag))})]}),s.example&&e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:r("docs.example")}),e.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 text-xs text-[var(--text-secondary)] whitespace-pre-wrap",children:s.example})]})]})]},s.command))})]})}function b(){const a=l(),{t}=c();return p(d.useMemo(()=>e.jsxs("button",{onClick:()=>a("/access-tokens"),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[e.jsx(u,{className:"h-3.5 w-3.5"}),t("access_tokens.create_token")]}),[a,t])),e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 font-mono lowercase",children:[e.jsx("div",{className:"mb-8",children:e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t("docs.cli_tools_desc",{ov:"ov",overlord:"overlord"})})}),e.jsx(x,{mode:"cli"}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t("docs.quick_start")}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:"1. install"}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:"npm install -g @overlordai/developer-cli"}),e.jsx(o,{text:"npm install -g @overlordai/developer-cli"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:"2. setup"}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:"ov setup"}),e.jsx(o,{text:"ov setup"})]})]})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsx(n,{title:t("docs.developer_cli"),commands:g}),e.jsx(n,{title:t("docs.admin_cli"),commands:h})]}),e.jsxs("div",{className:"mt-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> ai agent skill"}),e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:"// use overlord from your ai coding assistant — claude code, cursor, windsurf, codex, and more. install the skill and your assistant can create tasks, monitor execution, and manage your fleet."}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:"install"}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:"npx skills add overlord-run/skill"}),e.jsx(o,{text:"npx skills add overlord-run/skill"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:"configure"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_SERVER=https://your-server.com"]}),e.jsx(o,{text:"export OVERLORD_SERVER=https://your-server.com"})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_TOKEN=your-token"]}),e.jsx(o,{text:"export OVERLORD_TOKEN=your-token"})]})]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// once installed, your ai agent can create tasks, check status, read logs, and manage projects on your behalf."})]})]})}export{b as default};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{c as k,a as _,r as s,j as e,X as S,f as w,u as E,i as M}from"./index-CDBuOPx4.js";import{S as D}from"./Select-A7PXobk_.js";import{E as O}from"./EmptyState-CvmhFgWJ.js";import{T}from"./Skeleton-CcVqz28_.js";import{P}from"./plus-d-PLzbVX.js";import{U as q}from"./users-LNQqKSEN.js";import{P as $}from"./pencil-Bs3PwH2W.js";import{R as F}from"./rotate-ccw-Cus8CABi.js";/**
|
|
2
|
-
* @license lucide-react v0.469.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const U=k("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
7
|
-
* @license lucide-react v0.469.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const X=k("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
|
|
12
|
-
* @license lucide-react v0.469.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const G=k("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]),H=[{value:"developer",label:"developer"},{value:"lead",label:"lead"},{value:"admin",label:"admin"}];function Z({isOpen:a,onClose:n,onCreated:c}){const{t:o}=_(),[r,x]=s.useState(""),[l,b]=s.useState(""),[m,p]=s.useState(""),[d,v]=s.useState(""),[y,u]=s.useState("developer"),[h,g]=s.useState(!1),[N,i]=s.useState(""),t=()=>{x(""),b(""),p(""),v(""),u("developer"),i("")},j=()=>{t(),n()},z=async()=>{if(i(""),!r.trim()||!l.trim()||!m.trim()||!d.trim()){i(o("admin.all_fields_required"));return}if(d.length<10||d.length>20){i(o("admin.password_length_error"));return}const f=/[a-zA-Z]/.test(d),L=/\d/.test(d),R=/[^a-zA-Z0-9]/.test(d);if(!f||!L||!R){i(o("admin.password_complexity_error"));return}try{g(!0),await w.post("admin/developers",{json:{name:r.trim(),gitName:l.trim(),gitEmail:m.trim(),password:d,role:y}}).json(),j(),c()}catch(C){const A=C instanceof Error?C.message:o("admin.failed_to_create_developer");i(A)}finally{g(!1)}};return a?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[e.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]",onClick:j}),e.jsxs("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsxs("h3",{className:"text-sm text-[var(--text-primary)]",children:["// ",o("admin.create_developer_title")]}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",onClick:j,children:e.jsx(S,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[N&&e.jsx("div",{className:"rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:N}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:o("common.name")}),e.jsx("input",{type:"text",placeholder:"e.g. jdoe",value:r,onChange:f=>x(f.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:o("profile.git_name")}),e.jsx("input",{type:"text",placeholder:"e.g. John Doe",value:l,onChange:f=>b(f.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:o("profile.git_email")}),e.jsx("input",{type:"email",placeholder:"e.g. john@example.com",value:m,onChange:f=>p(f.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:o("auth.password")}),e.jsx("input",{type:"password",placeholder:"10-20 chars, letters + digits + special",value:d,onChange:f=>v(f.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:o("admin.password_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:o("common.role")}),e.jsx(D,{value:y,onChange:u,options:H})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",onClick:j,children:o("common.cancel")}),e.jsx("button",{type:"button",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:h,onClick:z,children:o(h?"common.creating":"common.create")})]})]})]}):null}const I=[{value:"developer",label:"developer"},{value:"lead",label:"lead"},{value:"admin",label:"admin"}];function J({isOpen:a,developer:n,onClose:c,onUpdated:o}){const{t:r}=_(),x=E(i=>i.user),[l,b]=s.useState(n.name),[m,p]=s.useState(n.role),[d,v]=s.useState(!1),[y,u]=s.useState(""),g=n.id===(x==null?void 0:x.id)&&n.role==="admin"&&m!=="admin";s.useEffect(()=>{b(n.name),p(n.role),u("")},[n]);const N=async()=>{if(u(""),!l.trim()){u(r("admin.display_name_required"));return}g&&u(r("admin.demote_self_warning"));try{v(!0),await w.put(`admin/developers/${n.id}`,{json:{name:l.trim(),role:m}}).json(),c(),o()}catch(i){const t=i instanceof Error?i.message:r("admin.failed_to_update_developer");u(t)}finally{v(!1)}};return a?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[e.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]",onClick:c}),e.jsxs("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsxs("h3",{className:"text-sm text-[var(--text-primary)]",children:["// ",r("admin.edit_developer_title")]}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",onClick:c,children:e.jsx(S,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[y&&e.jsx("div",{className:"rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:y}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:r("common.name")}),e.jsx("input",{type:"text",value:n.name,readOnly:!0,disabled:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-muted)] opacity-60"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:r("admin.display_name")}),e.jsx("input",{type:"text",value:l,onChange:i=>b(i.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:r("common.role")}),e.jsx(D,{value:m,onChange:p,options:I}),g&&e.jsx("div",{className:"mt-2 rounded-[4px] border border-[var(--warning)] bg-[var(--warning)]/10 px-3 py-2 text-xs text-[var(--warning)]",children:r("admin.demote_self_inline_warning")})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",onClick:c,children:r("common.cancel")}),e.jsx("button",{type:"button",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:d,onClick:N,children:r(d?"common.saving":"common.save_changes")})]})]})]}):null}function V({isOpen:a,developer:n,onClose:c,onConfirmed:o}){const{t:r}=_(),[x,l]=s.useState(!1),[b,m]=s.useState(""),p=async()=>{m("");try{l(!0),await w.put(`admin/developers/${n.id}/reset-totp`),c(),o()}catch(d){const v=d instanceof Error?d.message:r("admin.failed_to_reset_2fa");m(v)}finally{l(!1)}};return a?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[e.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]",onClick:c}),e.jsxs("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"h-4 w-4 text-yellow-400"}),e.jsxs("h3",{className:"text-sm text-[var(--text-primary)]",children:["// ",r("admin.reset_2fa")]})]}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",onClick:c,children:e.jsx(S,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-3 px-5 py-5",children:[b&&e.jsx("div",{className:"rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:b}),e.jsxs("p",{className:"text-xs text-[var(--text-primary)]",children:[r("admin.reset_2fa_confirm_message")," ",e.jsx("span",{className:"text-[var(--accent)]",children:n.name}),"?"]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("admin.reset_2fa_audit_note")})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",onClick:c,children:r("common.cancel")}),e.jsx("button",{type:"button",className:"rounded-[4px] bg-yellow-600 px-3 py-1.5 text-xs text-white hover:opacity-90 transition-opacity disabled:opacity-50",disabled:x,onClick:p,children:r(x?"admin.resetting":"admin.reset_2fa")})]})]})]}):null}function re(){const{t:a}=_(),n=E(t=>t.user),[c,o]=s.useState([]),[r,x]=s.useState(!0),[l,b]=s.useState(""),[m,p]=s.useState(!1),[d,v]=s.useState(null),[y,u]=s.useState(null),h=s.useCallback(async()=>{try{x(!0);const t={};l&&(t.q=l);const j=await w.get("admin/developers",{searchParams:t}).json();o(j)}catch{}finally{x(!1)}},[l]);s.useEffect(()=>{h()},[h]);const g=async t=>{const j=t.status==="active"?"suspended":"active";try{await w.put(`admin/developers/${t.id}`,{json:{status:j}}),h()}catch{}},N=t=>{switch(t){case"active":return"text-green-400";case"inactive":return"text-[var(--text-muted)]";case"suspended":return"text-red-400";default:return"text-[var(--text-muted)]"}},i=t=>{switch(t){case"admin":return"text-yellow-400";case"developer":return"text-blue-400";default:return"text-[var(--text-secondary)]"}};return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.developers_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.developers_subtitle")})]}),e.jsxs("button",{type:"button",className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity",onClick:()=>p(!0),children:[e.jsx(P,{className:"h-3.5 w-3.5"}),a("admin.create_developer")]})]}),e.jsx("div",{className:"mb-4",children:e.jsxs("div",{className:"relative max-w-xs",children:[e.jsx(M,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:a("admin.search_developers"),value:l,onChange:t=>b(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]})}),r?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(T,{rows:4})}):c.length===0?e.jsx(O,{icon:q,title:a(l?"admin.no_matching_developers":"admin.no_developers_found"),description:a(l?"admin.try_adjusting_search":"admin.create_first_developer"),actionLabel:l?void 0:a("admin.create_developer"),onAction:l?void 0:()=>p(!0)}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.dev_name")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.display_name")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.role")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.totp")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("common.created_at")}),e.jsx("th",{className:"pb-2 font-normal",children:a("common.actions")})]})}),e.jsx("tbody",{children:c.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:t.name}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.gitName}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:i(t.role),children:t.role})}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:N(t.status),children:t.status})}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:t.totpEnabled?"text-green-400":"text-[var(--text-muted)]",children:t.totpEnabled?a("common.enabled"):a("common.disabled")})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(t.createdAt).toLocaleDateString()}),e.jsx("td",{className:"py-2.5",children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{type:"button",className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-white/[0.05] transition-colors",title:a("common.edit"),onClick:()=>v(t),children:e.jsx($,{className:"h-3.5 w-3.5"})}),t.id!==(n==null?void 0:n.id)&&e.jsx("button",{type:"button",className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-white/[0.05] transition-colors",title:a("admin.reset_2fa"),onClick:()=>u(t),children:e.jsx(F,{className:"h-3.5 w-3.5"})}),t.id!==(n==null?void 0:n.id)&&e.jsx("button",{type:"button",className:`rounded-[4px] p-1.5 transition-colors hover:bg-white/[0.05] ${t.status==="active"?"text-red-400 hover:text-red-300":"text-green-400 hover:text-green-300"}`,title:t.status==="active"?a("admin.deactivate"):a("admin.activate"),onClick:()=>g(t),children:t.status==="active"?e.jsx(G,{className:"h-3.5 w-3.5"}):e.jsx(X,{className:"h-3.5 w-3.5"})})]})})]},t.id))})]})}),e.jsx(Z,{isOpen:m,onClose:()=>p(!1),onCreated:h}),d&&e.jsx(J,{isOpen:!!d,developer:d,onClose:()=>v(null),onUpdated:h}),y&&e.jsx(V,{isOpen:!!y,developer:y,onClose:()=>u(null),onConfirmed:h})]})}export{re as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{m as le,d as ce,a as de,r as a,f as u,j as e,L as ie,t as N}from"./index-CDBuOPx4.js";import{G as m,A as d}from"./protocol-C5uQmiiB.js";import{S as Q}from"./Select-A7PXobk_.js";import{U as pe,A as xe,R as ue}from"./RemoveMemberConfirmDialog-DS9z6jQT.js";import{P as me}from"./plus-d-PLzbVX.js";function fe(){const{key:o}=le(),l=ce(),{t:r}=de(),[n,V]=a.useState(null),[b,Y]=a.useState([]),[Z,ee]=a.useState(!0),[C,v]=a.useState(!1),[j,w]=a.useState(""),[h,_]=a.useState(""),[S,k]=a.useState(""),[M,T]=a.useState(m.GITHUB),[U,O]=a.useState(""),[P,I]=a.useState(d.CLAUDE),[R,A]=a.useState(""),[D,$]=a.useState("50"),[E,G]=a.useState(""),[L,B]=a.useState(""),[F,J]=a.useState(""),[q,z]=a.useState("0"),[g,H]=a.useState(!1),[i,f]=a.useState(""),[te,K]=a.useState(!1),[c,y]=a.useState(null),[re,W]=a.useState(!1),p=a.useCallback(async()=>{if(o)try{const[t,x]=await Promise.all([u.get(`web/projects/${o}`).json(),u.get(`web/projects/${o}/members`).json().catch(()=>[])]);if(V(t),Y(x),w(t.name),_(t.repoUrl),k(t.sshUrl??""),T(t.gitPlatform),O(t.defaultBranch),I(t.agentType),A(t.agentCommand??""),$(String(t.maxTurns)),G(t.workspaceRoot??""),B(t.setupCommands??""),J(t.testCommand??""),z(String(t.ptyOutputFilter??0)),H(t.isDefault),t.pipeline)try{f(JSON.stringify(JSON.parse(t.pipeline),null,2))}catch{f(t.pipeline)}}catch{}finally{ee(!1)}},[o]);a.useEffect(()=>{p()},[p]);async function ae(t){if(t.preventDefault(),!n)return;v(!0);let x=null;if(i.trim())try{JSON.parse(i),x=i.trim()}catch{N.error(r("projects.invalid_pipeline_json")),v(!1);return}try{await u.put(`web/projects/${n.key}`,{json:{name:j,repoUrl:h,sshUrl:S||null,defaultBranch:U,gitPlatform:M,agentType:P,agentCommand:R||null,maxTurns:parseInt(D,10)||50,workspaceRoot:E||null,setupCommands:L||null,testCommand:F||null,ptyOutputFilter:parseInt(q,10)||0,pipeline:x}}),N.success(r("projects.project_saved")),l(`/projects/${n.key}`)}catch(X){const oe=X instanceof Error?X.message:r("projects.failed_to_save_project");N.error(oe)}finally{v(!1)}}function se(){l(`/projects/${o}`)}async function ne(){if(!(!n||!c)){W(!0);try{await u.delete(`web/projects/${n.key}/members`,{searchParams:{developerId:String(c.developerId)}}),await p()}catch{}finally{W(!1),y(null)}}}return Z?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})}):n?e.jsxs("form",{onSubmit:ae,className:"mx-auto max-w-6xl px-6 py-8",children:[e.jsxs("div",{className:"mb-2 text-xs text-[var(--text-muted)]",children:[e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>l("/projects"),children:r("projects.title")})," / ",e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>l(`/projects/${n.key}`),children:n.key})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:r("common.edit")})]}),e.jsx("h1",{className:"text-lg font-bold text-[var(--text-primary)] mb-4",children:r("projects.edit_project_title")}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_400px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.basic_info")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.key"),children:e.jsx("input",{type:"text",value:n.key,readOnly:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-muted)] outline-none opacity-60 cursor-not-allowed"})}),e.jsx(s,{label:r("projects.name"),children:e.jsx("input",{type:"text",value:j,onChange:t=>w(t.target.value),required:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.repo_url"),children:e.jsx("input",{type:"text",value:h,onChange:t=>_(t.target.value),required:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsxs(s,{label:r("projects.ssh_url"),children:[e.jsx("input",{type:"text",value:S,onChange:t=>k(t.target.value),placeholder:r("projects.ssh_url_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:r("projects.ssh_url_hint")})]}),e.jsx(s,{label:r("projects.git_platform"),children:e.jsx(Q,{value:M,onChange:t=>T(t),options:[{value:m.GITHUB,label:r("projects.github")},{value:m.GITLAB,label:r("projects.gitlab")},{value:m.GITEA,label:r("projects.gitea")}]})}),e.jsx(s,{label:r("projects.default_branch"),children:e.jsx("input",{type:"text",value:U,onChange:t=>O(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.agent_config")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.agent_type"),children:e.jsx(Q,{value:P,onChange:t=>I(t),options:[{value:d.CLAUDE,label:r("projects.claude")},{value:d.CURSOR,label:r("projects.cursor")},{value:d.CODEX,label:r("projects.codex")},{value:d.CUSTOM,label:r("projects.custom")}]})}),e.jsx(s,{label:r("projects.agent_command"),children:e.jsx("input",{type:"text",value:R,onChange:t=>A(t.target.value),placeholder:"custom agent command",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.max_turns"),children:e.jsx("input",{type:"number",value:D,onChange:t=>$(t.target.value),min:1,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.workspace_root"),children:e.jsx("input",{type:"text",value:E,onChange:t=>G(t.target.value),placeholder:"/path/to/workspace",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.environment")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.setup_commands"),children:e.jsx("textarea",{value:L,onChange:t=>B(t.target.value),rows:3,placeholder:`npm install
|
|
2
|
-
npm run build`,className:"w-full resize-y rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.post_command"),children:e.jsx("input",{type:"text",value:F,onChange:t=>J(t.target.value),placeholder:"npm test",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.security")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.pty_output_filter"),children:e.jsx("input",{type:"text",value:q,onChange:t=>z(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.git_clean"),children:e.jsx("button",{type:"button",onClick:()=>H(!g),className:`relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors ${g?"bg-[var(--accent)]":"bg-[var(--border)]"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${g?"translate-x-6":"translate-x-1"}`})})})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:r("projects.pipeline_section")}),e.jsx(ie,{to:"/projects/"+o+"/pipeline",className:"text-xs text-[var(--accent)] hover:underline",children:r("projects.edit_pipeline")})]}),e.jsx("textarea",{value:i,onChange:t=>f(t.target.value),rows:20,spellCheck:!1,placeholder:'{"stages": [], "defaults": {}}',className:"w-full resize-y rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]",style:{fontFamily:'"JetBrains Mono", monospace',textTransform:"none"}})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:r("projects.members")}),e.jsxs("button",{type:"button",onClick:()=>K(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(me,{className:"h-3.5 w-3.5"}),r("projects.add_member")]})]}),b.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("projects.no_members_yet")})]}):e.jsx("div",{className:"space-y-2",children:b.map(t=>e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-[var(--accent)]/20 text-xs font-bold text-[var(--accent)]",children:(t.developerName??String(t.developerId)).charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("span",{className:"ml-2 rounded-[4px] px-1.5 py-0.5 text-[10px] font-medium",style:{color:t.role==="maintainer"?"var(--warning)":"var(--text-secondary)",background:t.role==="maintainer"?"rgba(245,158,11,0.1)":"rgba(163,163,163,0.1)"},children:t.role})]})]}),e.jsx("button",{type:"button",onClick:()=>y(t),className:"text-[var(--destructive)] hover:opacity-70 transition-opacity","aria-label":r("projects.remove_member"),children:e.jsx(pe,{className:"h-3.5 w-3.5"})})]},t.developerId))})]})]})]}),e.jsxs("div",{className:"mt-8 flex items-center justify-end gap-3 border-t border-[var(--border)] pt-6",children:[e.jsx("button",{type:"button",onClick:se,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:r("common.discard")}),e.jsx("button",{type:"submit",disabled:C||!j||!h,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:r(C?"common.saving":"projects.save_changes")})]}),e.jsx(xe,{isOpen:te,onClose:()=>K(!1),projectKey:n.key,existingMemberIds:b.map(t=>t.developerId),onAdded:p}),e.jsx(ue,{isOpen:!!c,onClose:()=>y(null),onConfirm:ne,memberName:c?c.developerName??`#${c.developerId}`:"",loading:re})]}):e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:r("projects.project_not_found")}),e.jsx("button",{onClick:()=>l("/projects"),className:"mt-4 rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:r("projects.back_to_projects")})]})}function s({label:o,children:l}){return e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("label",{className:"w-36 shrink-0 pt-2 text-xs text-[var(--text-muted)]",children:o}),e.jsx("div",{className:"flex-1",children:l})]})}export{fe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as I,r as n,j as e,X as z,C as X,L as N,d as Q,a as $,f as u}from"./index-CDBuOPx4.js";import{M as h}from"./protocol-C5uQmiiB.js";import{T}from"./TaskStatusBadge-QtQUDscM.js";import{T as w}from"./Skeleton-CcVqz28_.js";import{C as U}from"./chevron-right-COxU2yxz.js";import{A as S}from"./arrow-right-g7hTftEi.js";function W(){return[{id:"admin_create_project",title:"create your first project",description:"set up a project with a git repo and pipeline",link:"/projects",linkLabel:"go to projects",autoDetect:!0},{id:"admin_register_worker",title:"register a worker machine",description:"generate a token and set up a worker to run tasks",link:"/machines",linkLabel:"go to machines",autoDetect:!0},{id:"admin_create_developer",title:"create a developer account",description:"add team members who can create and monitor tasks",link:"/admin/developers",linkLabel:"manage developers",autoDetect:!0},{id:"admin_first_task",title:"create your first task",description:"verify the full pipeline works end-to-end",link:"/tasks",linkLabel:"go to tasks",autoDetect:!0}]}function Z(){return[{id:"lead_view_projects",title:"view your projects",description:"check the projects assigned to you",link:"/projects",linkLabel:"go to projects"},{id:"lead_configure_pipeline",title:"configure a pipeline",description:"set up stages for your project workflow",link:"/projects",linkLabel:"go to projects"},{id:"lead_add_member",title:"add a team member",description:"invite developers to your project",link:"/projects",linkLabel:"go to projects"},{id:"lead_first_task",title:"create your first task",description:"submit a task and watch it execute",link:"/tasks",linkLabel:"go to tasks"}]}function ee(){return[{id:"dev_install_cli",title:"install the ov cli",description:"npm install -g @overlordai/developer-cli",link:"/docs/cli",linkLabel:"cli"},{id:"dev_setup_cli",title:"run ov setup",description:"connect to the server and authenticate",link:"/docs/cli",linkLabel:"setup guide"},{id:"dev_view_projects",title:"explore projects",description:"browse available projects and their pipelines",link:"/projects",linkLabel:"go to projects"},{id:"dev_first_task",title:"create your first task",description:"submit a task via web or cli",link:"/tasks",linkLabel:"go to tasks",autoDetect:!0}]}const O="overlord_onboarding";function te(){try{const r=localStorage.getItem(O);if(r)return JSON.parse(r)}catch{}return{dismissed:!1,completed:{}}}function E(r){localStorage.setItem(O,JSON.stringify(r))}function se({data:r}){const s=I(i=>{var c;return(c=i.user)==null?void 0:c.role}),[o,a]=n.useState(te),d=s==="admin"?W():s==="lead"||s==="maintainer"?Z():ee(),l=n.useCallback(i=>{if(o.completed[i.id])return!0;if(!i.autoDetect)return!1;switch(i.id){case"admin_create_project":return r.totalProjects>0;case"admin_register_worker":return r.totalMachines>0;case"admin_create_developer":return r.totalDevelopers>1;case"admin_first_task":case"dev_first_task":return r.activeTasks>0;default:return!1}},[o.completed,r]),x=d.filter(l).length,p=x===d.length,k=n.useCallback(i=>{a(c=>{const f={...c,completed:{...c.completed,[i]:!c.completed[i]}};return E(f),f})},[]),v=n.useCallback(()=>{a(i=>{const c={...i,dismissed:!0};return E(c),c})},[]);if(o.dismissed)return null;const b=Math.round(x/d.length*100);return e.jsxs("div",{className:"mb-6 md:mb-8 rounded-[4px] border border-[var(--accent)]/30 bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:"// getting started"}),e.jsxs("span",{className:"text-[10px] text-[var(--text-muted)]",children:[x,"/",d.length," completed"]})]}),e.jsx("button",{onClick:v,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",title:"dismiss",children:e.jsx(z,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"h-0.5 bg-[var(--border)]",children:e.jsx("div",{className:"h-full bg-[var(--accent)] transition-all duration-500",style:{width:`${b}%`}})}),e.jsx("div",{className:"divide-y divide-[var(--border)]",children:d.map(i=>{const c=l(i);return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 transition-colors hover:bg-[var(--bg-input)]",children:[e.jsx("button",{onClick:()=>!i.autoDetect&&k(i.id),className:`flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors ${c?"border-[var(--accent)] bg-[var(--accent)]":"border-[var(--border)] hover:border-[var(--text-muted)]"} ${i.autoDetect?"cursor-default":"cursor-pointer"}`,children:c&&e.jsx(X,{className:"h-2.5 w-2.5 text-black"})}),e.jsxs("div",{className:"flex flex-1 items-center justify-between min-w-0",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:`text-xs ${c?"text-[var(--text-muted)] line-through":"text-[var(--text-primary)]"}`,children:i.title}),e.jsx("p",{className:"text-[10px] text-[var(--text-muted)] truncate",children:i.description})]}),i.link&&!c&&e.jsxs(N,{to:i.link,className:"ml-3 flex shrink-0 items-center gap-1 text-[10px] text-[var(--accent)] hover:underline",children:[i.linkLabel," ",e.jsx(U,{className:"h-3 w-3"})]})]})]},i.id)})}),p&&e.jsxs("div",{className:"border-t border-[var(--border)] px-4 py-3 text-center",children:[e.jsx("span",{className:"text-xs text-[var(--accent)]",children:"all set! you're ready to go."}),e.jsx("button",{onClick:v,className:"ml-3 text-[10px] text-[var(--text-muted)] underline hover:text-[var(--text-primary)]",children:"dismiss"})]})]})}const ae=3e4,re=[{key:"active_tasks",labelKey:"dashboard.active_tasks"},{key:"queued_tasks",labelKey:"dashboard.queued_tasks"},{key:"online_workers",labelKey:"dashboard.online_workers"},{key:"completed_today",labelKey:"dashboard.completed_today"}],ie=["mon","tue","wed","thu","fri","sat","sun"];function L(r){if(!r)return"-";const s=new Date(r).getTime();if(Number.isNaN(s))return"-";const o=Date.now()-s,a=Math.floor(o/6e4);if(a<1)return"just now";if(a<60)return`${a}m ago`;const d=Math.floor(a/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}function ne(r,s){return r.length<=s?r:r.slice(0,s)+"..."}function le({dailyRates:r,overallRate:s}){const{t:o}=$(),a=ie.map((l,x)=>({label:l,value:r[x]??0})),d=Math.max(...a.map(l=>l.value),1);return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-3 flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-2xl font-bold text-[var(--text-primary)]",children:[s,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:o("dashboard.last_7_days")})]}),e.jsx("div",{className:"flex gap-2",style:{height:80},children:a.map(l=>{const x=d>0?Math.max(l.value/d*100,4):4;return e.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[e.jsx("div",{className:"relative w-full h-full rounded-[4px]",style:{backgroundColor:"rgba(34,197,94,0.1)"},children:e.jsx("div",{className:"absolute bottom-0 left-0 right-0 rounded-[4px]",style:{height:`${x}%`,backgroundColor:l.value>=80?"var(--accent)":l.value>=50?"var(--warning)":"var(--destructive)"}})}),e.jsx("span",{className:"shrink-0 text-[10px] text-[var(--text-muted)]",children:l.label})]},l.label)})})]})}function he(){const r=Q(),{t:s}=$(),o=I(t=>{var m;return((m=t.user)==null?void 0:m.role)==="admin"}),[a,d]=n.useState(null),[l,x]=n.useState([]),[p,k]=n.useState([]),[v,b]=n.useState([]),[i,c]=n.useState(0),[f,F]=n.useState(0),[C,K]=n.useState(!0),[P,G]=n.useState(!0),[q,B]=n.useState(!0),[H,J]=n.useState(!0),j=n.useCallback(async()=>{try{const t=await u.get("web/dashboard/stats").json();d(t)}catch{}finally{K(!1)}},[]),g=n.useCallback(async()=>{try{const t=await u.get("web/dashboard/recent-tasks",{searchParams:{limit:"5"}}).json();x(t)}catch{}finally{G(!1)}},[]),D=n.useCallback(async()=>{try{const t=await u.get("web/machines").json();k(t)}catch{}finally{B(!1)}},[]),M=n.useCallback(async()=>{try{const t=await u.get("web/dashboard/recent-activity").json();b(t)}catch{b([])}finally{J(!1)}},[]);n.useEffect(()=>{j(),g(),D(),M(),u.get("web/projects").json().then(t=>c(t.length)).catch(()=>{}),o&&u.get("admin/developers").json().then(t=>F(t.length)).catch(()=>{})},[j,g,D,M,o]);const y=n.useRef(null);n.useEffect(()=>(y.current=setInterval(()=>{j(),g()},ae),()=>{y.current&&clearInterval(y.current)}),[j,g]);const A=(a==null?void 0:a.success_rate_daily)??null,R=(a==null?void 0:a.task_success_rate_7d)??0;function V(t){switch(t){case h.ONLINE:return"var(--accent)";case h.DRAINING:return"var(--warning)";case h.OFFLINE:default:return"var(--text-muted)"}}function Y(t){switch(t){case h.ONLINE:return s("dashboard.online");case h.DRAINING:return s("dashboard.idle");case h.OFFLINE:default:return s("dashboard.offline")}}return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-6 md:py-8 font-mono",children:[e.jsx("div",{className:"mb-4 md:hidden",children:e.jsxs("span",{className:"text-base font-bold text-[var(--accent)]",children:["// ",s("dashboard.title")]})}),e.jsx("div",{className:"mb-6 md:mb-8 grid grid-cols-2 gap-3 md:gap-4 lg:grid-cols-4",children:re.map(({key:t,labelKey:m})=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-4",children:[e.jsxs("span",{className:"text-[9px] md:text-xs text-[var(--text-muted)]",children:[s(m),":"]}),C?e.jsx("div",{className:"mt-1 h-6 md:h-8 w-12 md:w-16 animate-pulse rounded bg-[var(--bg-input)]"}):e.jsx("div",{className:"mt-1 flex items-baseline gap-2",children:e.jsx("span",{className:"text-2xl md:text-3xl font-bold text-[var(--text-primary)]",children:(a==null?void 0:a[t])??0})})]},t))}),e.jsx(se,{data:{activeTasks:((a==null?void 0:a.active_tasks)??0)+((a==null?void 0:a.queued_tasks)??0),totalMachines:p.length,totalProjects:i,totalDevelopers:f}}),e.jsxs("div",{className:"mb-6 grid gap-6 lg:grid-cols-3 items-stretch",children:[e.jsx("div",{className:"hidden md:flex flex-col gap-6 lg:col-span-2",children:e.jsxs("div",{className:"flex flex-1 flex-col rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("div",{className:"border-b border-[var(--border)] px-5 py-3",children:e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:s("dashboard.task_success_rate")})}),e.jsx("div",{className:"flex flex-1 flex-col justify-center p-5",children:C?e.jsx("div",{className:"h-24 animate-pulse rounded bg-[var(--bg-input)]"}):A?e.jsx(le,{dailyRates:A,overallRate:R}):e.jsxs("div",{className:"flex flex-col items-center gap-2 py-6",children:[e.jsxs("span",{className:"text-2xl font-bold text-[var(--text-primary)]",children:[R,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s("dashboard.daily_breakdown_not_available")})]})})]})}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] md:border",children:[e.jsxs("div",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:s("dashboard.recent_tasks")}),e.jsxs(N,{to:"/tasks",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[s("common.view_all")," ",e.jsx(S,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"flex md:hidden items-center justify-between px-3 py-3",children:e.jsx("h2",{className:"text-xs font-bold text-[var(--accent)]",children:s("dashboard.recent_tasks")})}),e.jsx("div",{className:"px-3 pb-3 md:p-4",children:P?e.jsx(w,{rows:4}):l.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s("dashboard.no_tasks_yet")})]}):e.jsx("div",{className:"flex flex-col gap-2 md:gap-0",children:l.map(t=>e.jsxs("div",{onClick:()=>r(`/tasks/${t.id}`),className:"flex cursor-pointer items-center gap-3 rounded-[4px] border border-[var(--border)] p-3 transition-colors hover:bg-[var(--bg-input)] md:rounded-none md:border-0 md:border-b md:border-[var(--border-row)] md:p-0 md:py-2.5 last:md:border-b-0",children:[e.jsxs("div",{className:"flex-1 min-w-0 md:hidden",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[10px] text-[var(--text-primary)] leading-tight",style:{wordBreak:"break-word"},children:["#",t.id," ",t.description]}),e.jsx("span",{className:"shrink-0",children:e.jsx(T,{status:t.status})})]}),e.jsx("span",{className:"text-[9px] text-[var(--text-muted)] mt-1 block",children:L(t.createdAt)})]}),e.jsxs("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:["#",t.id]}),e.jsx("span",{className:"hidden md:inline flex-1 text-xs text-[var(--text-primary)] truncate",children:ne(t.description,40)}),e.jsx("span",{className:"hidden md:inline",children:e.jsx(T,{status:t.status})}),e.jsx("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:L(t.createdAt)})]},t.id))})})]})]}),e.jsxs("div",{className:"hidden md:grid gap-6 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:s("dashboard.worker_status")}),e.jsxs(N,{to:"/machines",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[s("common.view_all")," ",e.jsx(S,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:q?e.jsx(w,{rows:3}):p.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s("dashboard.no_workers_registered")})]}):e.jsx("div",{className:"flex flex-col",children:p.map(t=>e.jsxs("div",{onClick:()=>r(`/machines/${t.id}`),className:"flex cursor-pointer items-center justify-between border-b border-[var(--border-row)] py-2.5 transition-colors hover:bg-[var(--bg-input)] last:border-b-0",children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t.host??"--"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:[t.activeSlots,"/",t.maxSlots," ",s("dashboard.slots")]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs",style:{color:V(t.status)},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),Y(t.status)]})]})]},t.id))})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:s("dashboard.recent_activity")}),o&&e.jsxs(N,{to:"/admin/audit-logs",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[s("common.view_all")," ",e.jsx(S,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:H?e.jsx(w,{rows:4}):v.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s("dashboard.no_recent_activity")})]}):e.jsx("div",{className:"flex flex-col",children:v.map(t=>{const m=t.message.match(/task\s*#?(\d+)/i),_=m?m[1]:null;return e.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border-row)] py-2 last:border-b-0 ${_?"cursor-pointer hover:bg-[var(--bg-input)] transition-colors":""}`,onClick:()=>_&&r(`/tasks/${_}`),children:[e.jsx("span",{className:"shrink-0 text-xs text-[var(--text-muted)]",children:L(t.timestamp)}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:t.message})]},t.id)})})})]})]})]})}export{he as default};
|