corporateai 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +10 -0
- package/.env.example +3 -0
- package/.github/workflows/publish-cli.yml +49 -0
- package/.mailmap +1 -0
- package/AGENTS.md +148 -0
- package/CONTRIBUTING.md +75 -0
- package/Dockerfile +59 -0
- package/Dockerfile.onboard-smoke +42 -0
- package/LICENSE +21 -0
- package/README.md +93 -0
- package/cli/esbuild.config.mjs +11 -0
- package/cli/package.json +24 -0
- package/cli/scripts/build-cli.mjs +5 -0
- package/cli/src/index.ts +27 -0
- package/docker-compose.quickstart.yml +18 -0
- package/docker-compose.untrusted-review.yml +33 -0
- package/docker-compose.yml +38 -0
- package/package.json +56 -0
- package/patches/embedded-postgres@18.1.0-beta.16.patch +0 -0
- package/pnpm-workspace.yaml +4 -0
- package/releases/.gitkeep +0 -0
- package/releases/v0.0.1.md +36 -0
- package/releases/v0.2.7.md +15 -0
- package/releases/v0.3.0.md +54 -0
- package/releases/v0.3.1.md +55 -0
- package/releases/v2026.318.0.md +66 -0
- package/releases/v2026.325.0.md +78 -0
- package/report/2026-03-13-08-46-token-optimization-implementation.md +48 -0
- package/scripts/backup-db.sh +17 -0
- package/scripts/build-npm.sh +80 -0
- package/scripts/check-forbidden-tokens.mjs +115 -0
- package/scripts/clean-onboard-git.sh +14 -0
- package/scripts/clean-onboard-npm.sh +13 -0
- package/scripts/clean-onboard-ref.sh +86 -0
- package/scripts/create-github-release.sh +99 -0
- package/scripts/dev-runner-paths.mjs +38 -0
- package/scripts/dev-runner.mjs +606 -0
- package/scripts/docker-onboard-smoke.sh +306 -0
- package/scripts/ensure-plugin-build-deps.mjs +47 -0
- package/scripts/generate-company-assets.ts +365 -0
- package/scripts/generate-npm-package-json.mjs +113 -0
- package/scripts/generate-org-chart-images.ts +694 -0
- package/scripts/generate-org-chart-satori-comparison.ts +225 -0
- package/scripts/generate-ui-package-json.mjs +31 -0
- package/scripts/kill-dev.sh +71 -0
- package/scripts/migrate-inline-env-secrets.ts +126 -0
- package/scripts/prepare-server-ui-dist.sh +22 -0
- package/scripts/provision-worktree.sh +333 -0
- package/scripts/release-lib.sh +306 -0
- package/scripts/release-package-map.mjs +169 -0
- package/scripts/release.sh +312 -0
- package/scripts/rollback-latest.sh +111 -0
- package/scripts/smoke/openclaw-docker-ui.sh +329 -0
- package/scripts/smoke/openclaw-gateway-e2e.sh +954 -0
- package/scripts/smoke/openclaw-join.sh +295 -0
- package/scripts/smoke/openclaw-sse-standalone.sh +146 -0
- package/scripts/workspace-compat.mjs +60 -0
- package/server/CHANGELOG.md +130 -0
- package/server/package.json +96 -0
- package/server/scripts/copy-onboarding-assets.mjs +10 -0
- package/server/scripts/dev-watch.ts +33 -0
- package/server/src/__tests__/activity-routes.test.ts +70 -0
- package/server/src/__tests__/adapter-models.test.ts +105 -0
- package/server/src/__tests__/adapter-session-codecs.test.ts +194 -0
- package/server/src/__tests__/agent-auth-jwt.test.ts +79 -0
- package/server/src/__tests__/agent-instructions-routes.test.ts +318 -0
- package/server/src/__tests__/agent-instructions-service.test.ts +361 -0
- package/server/src/__tests__/agent-permissions-routes.test.ts +275 -0
- package/server/src/__tests__/agent-shortname-collision.test.ts +69 -0
- package/server/src/__tests__/agent-skill-contract.test.ts +50 -0
- package/server/src/__tests__/agent-skills-routes.test.ts +462 -0
- package/server/src/__tests__/app-hmr-port.test.ts +19 -0
- package/server/src/__tests__/approval-routes-idempotency.test.ts +110 -0
- package/server/src/__tests__/approvals-service.test.ts +107 -0
- package/server/src/__tests__/assets.test.ts +250 -0
- package/server/src/__tests__/attachment-types.test.ts +97 -0
- package/server/src/__tests__/board-mutation-guard.test.ts +105 -0
- package/server/src/__tests__/budgets-service.test.ts +311 -0
- package/server/src/__tests__/claude-local-adapter-environment.test.ts +92 -0
- package/server/src/__tests__/claude-local-adapter.test.ts +31 -0
- package/server/src/__tests__/claude-local-skill-sync.test.ts +111 -0
- package/server/src/__tests__/cli-auth-routes.test.ts +230 -0
- package/server/src/__tests__/codex-local-adapter-environment.test.ts +143 -0
- package/server/src/__tests__/codex-local-adapter.test.ts +253 -0
- package/server/src/__tests__/codex-local-execute.test.ts +391 -0
- package/server/src/__tests__/codex-local-skill-injection.test.ts +175 -0
- package/server/src/__tests__/codex-local-skill-sync.test.ts +123 -0
- package/server/src/__tests__/companies-route-path-guard.test.ts +56 -0
- package/server/src/__tests__/company-branding-route.test.ts +196 -0
- package/server/src/__tests__/company-portability-routes.test.ts +175 -0
- package/server/src/__tests__/company-portability.test.ts +2186 -0
- package/server/src/__tests__/company-skills-routes.test.ts +113 -0
- package/server/src/__tests__/company-skills.test.ts +229 -0
- package/server/src/__tests__/costs-service.test.ts +226 -0
- package/server/src/__tests__/cursor-local-adapter-environment.test.ts +196 -0
- package/server/src/__tests__/cursor-local-adapter.test.ts +406 -0
- package/server/src/__tests__/cursor-local-execute.test.ts +263 -0
- package/server/src/__tests__/cursor-local-skill-injection.test.ts +104 -0
- package/server/src/__tests__/cursor-local-skill-sync.test.ts +145 -0
- package/server/src/__tests__/dev-runner-paths.test.ts +25 -0
- package/server/src/__tests__/dev-server-status.test.ts +66 -0
- package/server/src/__tests__/dev-watch-ignore.test.ts +42 -0
- package/server/src/__tests__/documents.test.ts +29 -0
- package/server/src/__tests__/error-handler.test.ts +53 -0
- package/server/src/__tests__/execution-workspace-policy.test.ts +170 -0
- package/server/src/__tests__/forbidden-tokens.test.ts +77 -0
- package/server/src/__tests__/gemini-local-adapter-environment.test.ts +135 -0
- package/server/src/__tests__/gemini-local-adapter.test.ts +190 -0
- package/server/src/__tests__/gemini-local-execute.test.ts +172 -0
- package/server/src/__tests__/gemini-local-skill-sync.test.ts +90 -0
- package/server/src/__tests__/health.test.ts +16 -0
- package/server/src/__tests__/heartbeat-process-recovery.test.ts +256 -0
- package/server/src/__tests__/heartbeat-run-summary.test.ts +33 -0
- package/server/src/__tests__/heartbeat-workspace-session.test.ts +334 -0
- package/server/src/__tests__/helpers/embedded-postgres.ts +7 -0
- package/server/src/__tests__/hire-hook.test.ts +181 -0
- package/server/src/__tests__/instance-settings-routes.test.ts +156 -0
- package/server/src/__tests__/invite-accept-gateway-defaults.test.ts +119 -0
- package/server/src/__tests__/invite-accept-replay.test.ts +92 -0
- package/server/src/__tests__/invite-expiry.test.ts +10 -0
- package/server/src/__tests__/invite-join-grants.test.ts +57 -0
- package/server/src/__tests__/invite-join-manager.test.ts +33 -0
- package/server/src/__tests__/invite-onboarding-text.test.ts +116 -0
- package/server/src/__tests__/issue-comment-reopen-routes.test.ts +146 -0
- package/server/src/__tests__/issue-goal-fallback.test.ts +99 -0
- package/server/src/__tests__/issues-checkout-wakeup.test.ts +48 -0
- package/server/src/__tests__/issues-goal-context-routes.test.ts +187 -0
- package/server/src/__tests__/issues-service.test.ts +317 -0
- package/server/src/__tests__/issues-user-context.test.ts +113 -0
- package/server/src/__tests__/log-redaction.test.ts +74 -0
- package/server/src/__tests__/monthly-spend-service.test.ts +90 -0
- package/server/src/__tests__/normalize-agent-mention-token.test.ts +41 -0
- package/server/src/__tests__/openclaw-gateway-adapter.test.ts +626 -0
- package/server/src/__tests__/openclaw-invite-prompt-route.test.ts +192 -0
- package/server/src/__tests__/opencode-local-adapter-environment.test.ts +97 -0
- package/server/src/__tests__/opencode-local-adapter.test.ts +226 -0
- package/server/src/__tests__/opencode-local-skill-sync.test.ts +91 -0
- package/server/src/__tests__/paperclip-env.test.ts +58 -0
- package/server/src/__tests__/paperclip-skill-utils.test.ts +63 -0
- package/server/src/__tests__/pi-local-adapter-environment.test.ts +102 -0
- package/server/src/__tests__/pi-local-skill-sync.test.ts +95 -0
- package/server/src/__tests__/plugin-dev-watcher.test.ts +68 -0
- package/server/src/__tests__/plugin-worker-manager.test.ts +43 -0
- package/server/src/__tests__/private-hostname-guard.test.ts +56 -0
- package/server/src/__tests__/project-shortname-resolution.test.ts +45 -0
- package/server/src/__tests__/quota-windows-service.test.ts +56 -0
- package/server/src/__tests__/quota-windows.test.ts +1109 -0
- package/server/src/__tests__/redaction.test.ts +66 -0
- package/server/src/__tests__/routines-e2e.test.ts +276 -0
- package/server/src/__tests__/routines-routes.test.ts +271 -0
- package/server/src/__tests__/routines-service.test.ts +424 -0
- package/server/src/__tests__/storage-local-provider.test.ts +78 -0
- package/server/src/__tests__/ui-branding.test.ts +82 -0
- package/server/src/__tests__/work-products.test.ts +95 -0
- package/server/src/__tests__/workspace-runtime.test.ts +1131 -0
- package/server/src/__tests__/worktree-config.test.ts +426 -0
- package/server/src/adapters/codex-models.ts +105 -0
- package/server/src/adapters/cursor-models.ts +171 -0
- package/server/src/adapters/http/execute.ts +42 -0
- package/server/src/adapters/http/index.ts +21 -0
- package/server/src/adapters/http/test.ts +116 -0
- package/server/src/adapters/index.ts +18 -0
- package/server/src/adapters/process/execute.ts +77 -0
- package/server/src/adapters/process/index.ts +24 -0
- package/server/src/adapters/process/test.ts +89 -0
- package/server/src/adapters/registry.ts +225 -0
- package/server/src/adapters/server-utils-compat.ts +57 -0
- package/server/src/adapters/types.ts +30 -0
- package/server/src/adapters/utils.ts +48 -0
- package/server/src/agent-auth-jwt.ts +141 -0
- package/server/src/app.ts +321 -0
- package/server/src/attachment-types.ts +74 -0
- package/server/src/auth/better-auth.ts +148 -0
- package/server/src/board-claim.ts +150 -0
- package/server/src/config-file.ts +17 -0
- package/server/src/config.ts +260 -0
- package/server/src/dev-server-status.ts +103 -0
- package/server/src/dev-watch-ignore.ts +36 -0
- package/server/src/errors.ts +34 -0
- package/server/src/home-paths.ts +95 -0
- package/server/src/index.ts +799 -0
- package/server/src/log-redaction.ts +146 -0
- package/server/src/middleware/auth.ts +178 -0
- package/server/src/middleware/board-mutation-guard.ts +66 -0
- package/server/src/middleware/error-handler.ts +71 -0
- package/server/src/middleware/index.ts +3 -0
- package/server/src/middleware/logger.ts +90 -0
- package/server/src/middleware/private-hostname-guard.ts +92 -0
- package/server/src/middleware/validate.ts +9 -0
- package/server/src/onboarding-assets/ceo/AGENTS.md +54 -0
- package/server/src/onboarding-assets/ceo/HEARTBEAT.md +72 -0
- package/server/src/onboarding-assets/ceo/SOUL.md +33 -0
- package/server/src/onboarding-assets/ceo/TOOLS.md +3 -0
- package/server/src/onboarding-assets/default/AGENTS.md +3 -0
- package/server/src/paths.ts +34 -0
- package/server/src/realtime/live-events-ws.ts +274 -0
- package/server/src/redaction.ts +59 -0
- package/server/src/routes/access.ts +2888 -0
- package/server/src/routes/activity.ts +89 -0
- package/server/src/routes/agents.ts +2313 -0
- package/server/src/routes/approvals.ts +346 -0
- package/server/src/routes/assets.ts +341 -0
- package/server/src/routes/authz.ts +52 -0
- package/server/src/routes/companies.ts +343 -0
- package/server/src/routes/company-skills.ts +300 -0
- package/server/src/routes/costs.ts +335 -0
- package/server/src/routes/dashboard.ts +19 -0
- package/server/src/routes/execution-workspaces.ts +182 -0
- package/server/src/routes/goals.ts +107 -0
- package/server/src/routes/health.ts +94 -0
- package/server/src/routes/index.ts +17 -0
- package/server/src/routes/instance-settings.ts +95 -0
- package/server/src/routes/issues-checkout-wakeup.ts +14 -0
- package/server/src/routes/issues.ts +1680 -0
- package/server/src/routes/llms.ts +86 -0
- package/server/src/routes/org-chart-svg.ts +777 -0
- package/server/src/routes/plugin-ui-static.ts +497 -0
- package/server/src/routes/plugins.ts +2220 -0
- package/server/src/routes/projects.ts +295 -0
- package/server/src/routes/routines.ts +300 -0
- package/server/src/routes/secrets.ts +166 -0
- package/server/src/routes/sidebar-badges.ts +52 -0
- package/server/src/secrets/external-stub-providers.ts +32 -0
- package/server/src/secrets/local-encrypted-provider.ts +135 -0
- package/server/src/secrets/provider-registry.ts +31 -0
- package/server/src/secrets/types.ts +23 -0
- package/server/src/services/access.ts +381 -0
- package/server/src/services/activity-log.ts +95 -0
- package/server/src/services/activity.ts +164 -0
- package/server/src/services/agent-instructions.ts +735 -0
- package/server/src/services/agent-permissions.ts +27 -0
- package/server/src/services/agents.ts +694 -0
- package/server/src/services/approvals.ts +273 -0
- package/server/src/services/assets.ts +23 -0
- package/server/src/services/board-auth.ts +355 -0
- package/server/src/services/budgets.ts +959 -0
- package/server/src/services/companies.ts +313 -0
- package/server/src/services/company-export-readme.ts +173 -0
- package/server/src/services/company-portability.ts +4263 -0
- package/server/src/services/company-skills.ts +2356 -0
- package/server/src/services/costs.ts +365 -0
- package/server/src/services/cron.ts +373 -0
- package/server/src/services/dashboard.ts +110 -0
- package/server/src/services/default-agent-instructions.ts +27 -0
- package/server/src/services/documents.ts +434 -0
- package/server/src/services/execution-workspace-policy.ts +210 -0
- package/server/src/services/execution-workspaces.ts +100 -0
- package/server/src/services/finance.ts +135 -0
- package/server/src/services/goals.ts +81 -0
- package/server/src/services/heartbeat-run-summary.ts +35 -0
- package/server/src/services/heartbeat.ts +3863 -0
- package/server/src/services/hire-hook.ts +114 -0
- package/server/src/services/index.ts +32 -0
- package/server/src/services/instance-settings.ts +138 -0
- package/server/src/services/issue-approvals.ts +175 -0
- package/server/src/services/issue-assignment-wakeup.ts +48 -0
- package/server/src/services/issue-goal-fallback.ts +56 -0
- package/server/src/services/issues.ts +1828 -0
- package/server/src/services/live-events.ts +55 -0
- package/server/src/services/plugin-capability-validator.ts +450 -0
- package/server/src/services/plugin-config-validator.ts +55 -0
- package/server/src/services/plugin-dev-watcher.ts +339 -0
- package/server/src/services/plugin-event-bus.ts +413 -0
- package/server/src/services/plugin-host-service-cleanup.ts +59 -0
- package/server/src/services/plugin-host-services.ts +1132 -0
- package/server/src/services/plugin-job-coordinator.ts +261 -0
- package/server/src/services/plugin-job-scheduler.ts +753 -0
- package/server/src/services/plugin-job-store.ts +466 -0
- package/server/src/services/plugin-lifecycle.ts +822 -0
- package/server/src/services/plugin-loader.ts +1955 -0
- package/server/src/services/plugin-log-retention.ts +87 -0
- package/server/src/services/plugin-manifest-validator.ts +164 -0
- package/server/src/services/plugin-registry.ts +683 -0
- package/server/src/services/plugin-runtime-sandbox.ts +222 -0
- package/server/src/services/plugin-secrets-handler.ts +355 -0
- package/server/src/services/plugin-state-store.ts +238 -0
- package/server/src/services/plugin-stream-bus.ts +81 -0
- package/server/src/services/plugin-tool-dispatcher.ts +449 -0
- package/server/src/services/plugin-tool-registry.ts +450 -0
- package/server/src/services/plugin-worker-manager.ts +1343 -0
- package/server/src/services/projects.ts +860 -0
- package/server/src/services/quota-windows.ts +65 -0
- package/server/src/services/routines.ts +1269 -0
- package/server/src/services/run-log-store.ts +156 -0
- package/server/src/services/secrets.ts +370 -0
- package/server/src/services/sidebar-badges.ts +56 -0
- package/server/src/services/work-products.ts +124 -0
- package/server/src/services/workspace-operation-log-store.ts +156 -0
- package/server/src/services/workspace-operations.ts +262 -0
- package/server/src/services/workspace-runtime.ts +1565 -0
- package/server/src/startup-banner.ts +176 -0
- package/server/src/storage/index.ts +35 -0
- package/server/src/storage/local-disk-provider.ts +89 -0
- package/server/src/storage/provider-registry.ts +18 -0
- package/server/src/storage/s3-provider.ts +153 -0
- package/server/src/storage/service.ts +131 -0
- package/server/src/storage/types.ts +63 -0
- package/server/src/ui-branding.ts +217 -0
- package/server/src/version.ts +10 -0
- package/server/src/worktree-config.ts +468 -0
- package/server/tsconfig.json +9 -0
- package/server/vitest.config.ts +7 -0
- package/skills/paperclip/SKILL.md +365 -0
- package/skills/paperclip/references/api-reference.md +647 -0
- package/skills/paperclip/references/company-skills.md +193 -0
- package/skills/paperclip-create-agent/SKILL.md +142 -0
- package/skills/paperclip-create-agent/references/api-reference.md +105 -0
- package/skills/paperclip-create-plugin/SKILL.md +102 -0
- package/skills/para-memory-files/SKILL.md +104 -0
- package/skills/para-memory-files/references/schemas.md +35 -0
- package/tests/e2e/onboarding.spec.ts +142 -0
- package/tests/e2e/playwright.config.ts +35 -0
- package/tests/release-smoke/docker-auth-onboarding.spec.ts +141 -0
- package/tests/release-smoke/playwright.config.ts +28 -0
- package/tsconfig.base.json +18 -0
- package/tsconfig.json +18 -0
- package/ui/README.md +12 -0
- package/ui/components.json +21 -0
- package/ui/index.html +47 -0
- package/ui/package.json +73 -0
- package/ui/public/android-chrome-192x192.png +0 -0
- package/ui/public/android-chrome-512x512.png +0 -0
- package/ui/public/apple-touch-icon.png +0 -0
- package/ui/public/brands/opencode-logo-dark-square.svg +18 -0
- package/ui/public/brands/opencode-logo-light-square.svg +18 -0
- package/ui/public/favicon-16x16.png +0 -0
- package/ui/public/favicon-32x32.png +0 -0
- package/ui/public/favicon.ico +0 -0
- package/ui/public/favicon.svg +9 -0
- package/ui/public/site.webmanifest +30 -0
- package/ui/public/sprites/1-D-1.png +0 -0
- package/ui/public/sprites/1-D-2.png +0 -0
- package/ui/public/sprites/1-D-3.png +0 -0
- package/ui/public/sprites/1-L-1.png +0 -0
- package/ui/public/sprites/1-R-1.png +0 -0
- package/ui/public/sprites/10-D-1.png +0 -0
- package/ui/public/sprites/10-D-2.png +0 -0
- package/ui/public/sprites/10-D-3.png +0 -0
- package/ui/public/sprites/10-L-1.png +0 -0
- package/ui/public/sprites/10-R-1.png +0 -0
- package/ui/public/sprites/11-D-1.png +0 -0
- package/ui/public/sprites/11-D-2.png +0 -0
- package/ui/public/sprites/11-D-3.png +0 -0
- package/ui/public/sprites/11-L-1.png +0 -0
- package/ui/public/sprites/11-R-1.png +0 -0
- package/ui/public/sprites/12-D-1.png +0 -0
- package/ui/public/sprites/12-D-2.png +0 -0
- package/ui/public/sprites/12-D-3.png +0 -0
- package/ui/public/sprites/12-L-1.png +0 -0
- package/ui/public/sprites/12-R-1.png +0 -0
- package/ui/public/sprites/13-D-1.png +0 -0
- package/ui/public/sprites/13-D-2.png +0 -0
- package/ui/public/sprites/13-D-3.png +0 -0
- package/ui/public/sprites/13-L-1.png +0 -0
- package/ui/public/sprites/13-R-1.png +0 -0
- package/ui/public/sprites/14-D-1.png +0 -0
- package/ui/public/sprites/14-D-2.png +0 -0
- package/ui/public/sprites/14-D-3.png +0 -0
- package/ui/public/sprites/14-L-1.png +0 -0
- package/ui/public/sprites/14-R-1.png +0 -0
- package/ui/public/sprites/2-D-1.png +0 -0
- package/ui/public/sprites/2-D-2.png +0 -0
- package/ui/public/sprites/2-D-3.png +0 -0
- package/ui/public/sprites/2-L-1.png +0 -0
- package/ui/public/sprites/2-R-1.png +0 -0
- package/ui/public/sprites/3-D-1.png +0 -0
- package/ui/public/sprites/3-D-2.png +0 -0
- package/ui/public/sprites/3-D-3.png +0 -0
- package/ui/public/sprites/3-L-1.png +0 -0
- package/ui/public/sprites/3-R-1.png +0 -0
- package/ui/public/sprites/4-D-1.png +0 -0
- package/ui/public/sprites/4-D-2.png +0 -0
- package/ui/public/sprites/4-D-3.png +0 -0
- package/ui/public/sprites/4-L-1.png +0 -0
- package/ui/public/sprites/4-R-1.png +0 -0
- package/ui/public/sprites/5-D-1.png +0 -0
- package/ui/public/sprites/5-D-2.png +0 -0
- package/ui/public/sprites/5-D-3.png +0 -0
- package/ui/public/sprites/5-L-1.png +0 -0
- package/ui/public/sprites/5-R-1.png +0 -0
- package/ui/public/sprites/6-D-1.png +0 -0
- package/ui/public/sprites/6-D-2.png +0 -0
- package/ui/public/sprites/6-D-3.png +0 -0
- package/ui/public/sprites/6-L-1.png +0 -0
- package/ui/public/sprites/6-R-1.png +0 -0
- package/ui/public/sprites/7-D-1.png +0 -0
- package/ui/public/sprites/7-D-2.png +0 -0
- package/ui/public/sprites/7-D-3.png +0 -0
- package/ui/public/sprites/7-L-1.png +0 -0
- package/ui/public/sprites/7-R-1.png +0 -0
- package/ui/public/sprites/8-D-1.png +0 -0
- package/ui/public/sprites/8-D-2.png +0 -0
- package/ui/public/sprites/8-D-3.png +0 -0
- package/ui/public/sprites/8-L-1.png +0 -0
- package/ui/public/sprites/8-R-1.png +0 -0
- package/ui/public/sprites/9-D-1.png +0 -0
- package/ui/public/sprites/9-D-2.png +0 -0
- package/ui/public/sprites/9-D-3.png +0 -0
- package/ui/public/sprites/9-L-1.png +0 -0
- package/ui/public/sprites/9-R-1.png +0 -0
- package/ui/public/sprites/ceo-lobster.png +0 -0
- package/ui/public/sw.js +42 -0
- package/ui/public/worktree-favicon-16x16.png +0 -0
- package/ui/public/worktree-favicon-32x32.png +0 -0
- package/ui/public/worktree-favicon.ico +0 -0
- package/ui/public/worktree-favicon.svg +9 -0
- package/ui/src/App.tsx +354 -0
- package/ui/src/adapters/claude-local/config-fields.tsx +138 -0
- package/ui/src/adapters/claude-local/index.ts +13 -0
- package/ui/src/adapters/codex-local/config-fields.tsx +104 -0
- package/ui/src/adapters/codex-local/index.ts +13 -0
- package/ui/src/adapters/cursor/config-fields.tsx +49 -0
- package/ui/src/adapters/cursor/index.ts +13 -0
- package/ui/src/adapters/gemini-local/config-fields.tsx +51 -0
- package/ui/src/adapters/gemini-local/index.ts +13 -0
- package/ui/src/adapters/http/build-config.ts +9 -0
- package/ui/src/adapters/http/config-fields.tsx +38 -0
- package/ui/src/adapters/http/index.ts +12 -0
- package/ui/src/adapters/http/parse-stdout.ts +5 -0
- package/ui/src/adapters/index.ts +9 -0
- package/ui/src/adapters/local-workspace-runtime-fields.tsx +5 -0
- package/ui/src/adapters/openclaw-gateway/config-fields.tsx +237 -0
- package/ui/src/adapters/openclaw-gateway/index.ts +13 -0
- package/ui/src/adapters/opencode-local/config-fields.tsx +72 -0
- package/ui/src/adapters/opencode-local/index.ts +13 -0
- package/ui/src/adapters/pi-local/config-fields.tsx +49 -0
- package/ui/src/adapters/pi-local/index.ts +13 -0
- package/ui/src/adapters/process/build-config.ts +18 -0
- package/ui/src/adapters/process/config-fields.tsx +77 -0
- package/ui/src/adapters/process/index.ts +12 -0
- package/ui/src/adapters/process/parse-stdout.ts +5 -0
- package/ui/src/adapters/registry.ts +34 -0
- package/ui/src/adapters/runtime-json-fields.tsx +122 -0
- package/ui/src/adapters/transcript.test.ts +30 -0
- package/ui/src/adapters/transcript.ts +62 -0
- package/ui/src/adapters/types.ts +34 -0
- package/ui/src/api/access.ts +160 -0
- package/ui/src/api/activity.ts +37 -0
- package/ui/src/api/agents.ts +194 -0
- package/ui/src/api/approvals.ts +25 -0
- package/ui/src/api/assets.ts +30 -0
- package/ui/src/api/auth.ts +74 -0
- package/ui/src/api/budgets.ts +21 -0
- package/ui/src/api/client.ts +50 -0
- package/ui/src/api/companies.ts +59 -0
- package/ui/src/api/companySkills.ts +55 -0
- package/ui/src/api/costs.ts +60 -0
- package/ui/src/api/dashboard.ts +7 -0
- package/ui/src/api/execution-workspaces.ts +27 -0
- package/ui/src/api/goals.ts +12 -0
- package/ui/src/api/health.ts +41 -0
- package/ui/src/api/heartbeats.ts +62 -0
- package/ui/src/api/index.ts +18 -0
- package/ui/src/api/instanceSettings.ts +19 -0
- package/ui/src/api/issues.ts +115 -0
- package/ui/src/api/plugins.ts +424 -0
- package/ui/src/api/projects.ts +34 -0
- package/ui/src/api/routines.ts +59 -0
- package/ui/src/api/secrets.ts +26 -0
- package/ui/src/api/sidebarBadges.ts +7 -0
- package/ui/src/components/AccountingModelCard.tsx +69 -0
- package/ui/src/components/ActiveAgentsPanel.tsx +157 -0
- package/ui/src/components/ActivityCharts.tsx +264 -0
- package/ui/src/components/ActivityRow.tsx +147 -0
- package/ui/src/components/AgentActionButtons.tsx +51 -0
- package/ui/src/components/AgentConfigForm.tsx +1468 -0
- package/ui/src/components/AgentIconPicker.tsx +81 -0
- package/ui/src/components/AgentProperties.tsx +107 -0
- package/ui/src/components/ApprovalCard.tsx +107 -0
- package/ui/src/components/ApprovalPayload.tsx +134 -0
- package/ui/src/components/AsciiArtAnimation.tsx +355 -0
- package/ui/src/components/BillerSpendCard.tsx +146 -0
- package/ui/src/components/BreadcrumbBar.tsx +113 -0
- package/ui/src/components/BudgetIncidentCard.tsx +101 -0
- package/ui/src/components/BudgetPolicyCard.tsx +220 -0
- package/ui/src/components/BudgetSidebarMarker.tsx +13 -0
- package/ui/src/components/ClaudeSubscriptionPanel.tsx +141 -0
- package/ui/src/components/CodexSubscriptionPanel.tsx +158 -0
- package/ui/src/components/CommandPalette.tsx +239 -0
- package/ui/src/components/CommentThread.tsx +503 -0
- package/ui/src/components/CompanyPatternIcon.tsx +212 -0
- package/ui/src/components/CompanyRail.tsx +329 -0
- package/ui/src/components/CompanySwitcher.tsx +81 -0
- package/ui/src/components/CopyText.tsx +56 -0
- package/ui/src/components/DevRestartBanner.tsx +89 -0
- package/ui/src/components/EmptyState.tsx +27 -0
- package/ui/src/components/EntityRow.tsx +69 -0
- package/ui/src/components/FilterBar.tsx +39 -0
- package/ui/src/components/FinanceBillerCard.tsx +45 -0
- package/ui/src/components/FinanceKindCard.tsx +44 -0
- package/ui/src/components/FinanceTimelineCard.tsx +72 -0
- package/ui/src/components/GoalProperties.tsx +165 -0
- package/ui/src/components/GoalTree.tsx +118 -0
- package/ui/src/components/Identity.tsx +39 -0
- package/ui/src/components/InlineEditor.tsx +248 -0
- package/ui/src/components/InlineEntitySelector.tsx +206 -0
- package/ui/src/components/InstanceSidebar.tsx +53 -0
- package/ui/src/components/IssueDocumentsSection.tsx +892 -0
- package/ui/src/components/IssueProperties.tsx +621 -0
- package/ui/src/components/IssueRow.tsx +149 -0
- package/ui/src/components/IssueWorkspaceCard.tsx +404 -0
- package/ui/src/components/IssuesList.tsx +889 -0
- package/ui/src/components/JsonSchemaForm.tsx +1048 -0
- package/ui/src/components/KanbanBoard.tsx +275 -0
- package/ui/src/components/Layout.tsx +441 -0
- package/ui/src/components/LiveRunWidget.tsx +160 -0
- package/ui/src/components/MarkdownBody.test.tsx +50 -0
- package/ui/src/components/MarkdownBody.tsx +152 -0
- package/ui/src/components/MarkdownEditor.tsx +622 -0
- package/ui/src/components/MetricCard.tsx +53 -0
- package/ui/src/components/MobileBottomNav.tsx +123 -0
- package/ui/src/components/NewAgentDialog.tsx +223 -0
- package/ui/src/components/NewGoalDialog.tsx +283 -0
- package/ui/src/components/NewIssueDialog.tsx +1473 -0
- package/ui/src/components/NewProjectDialog.tsx +451 -0
- package/ui/src/components/OnboardingWizard.tsx +1392 -0
- package/ui/src/components/OpenCodeLogoIcon.tsx +22 -0
- package/ui/src/components/PackageFileTree.tsx +318 -0
- package/ui/src/components/PageSkeleton.tsx +180 -0
- package/ui/src/components/PageTabBar.tsx +45 -0
- package/ui/src/components/PathInstructionsModal.tsx +143 -0
- package/ui/src/components/PriorityIcon.tsx +77 -0
- package/ui/src/components/ProjectProperties.tsx +1127 -0
- package/ui/src/components/PropertiesPanel.tsx +29 -0
- package/ui/src/components/ProviderQuotaCard.tsx +417 -0
- package/ui/src/components/QuotaBar.tsx +65 -0
- package/ui/src/components/ReportsToPicker.tsx +127 -0
- package/ui/src/components/ScheduleEditor.tsx +344 -0
- package/ui/src/components/ScrollToBottom.tsx +79 -0
- package/ui/src/components/Sidebar.tsx +130 -0
- package/ui/src/components/SidebarAgents.tsx +146 -0
- package/ui/src/components/SidebarNavItem.tsx +92 -0
- package/ui/src/components/SidebarProjects.tsx +234 -0
- package/ui/src/components/SidebarSection.tsx +17 -0
- package/ui/src/components/StatusBadge.tsx +15 -0
- package/ui/src/components/StatusIcon.tsx +71 -0
- package/ui/src/components/SwipeToArchive.tsx +152 -0
- package/ui/src/components/ToastViewport.tsx +99 -0
- package/ui/src/components/WorktreeBanner.tsx +25 -0
- package/ui/src/components/agent-config-defaults.ts +31 -0
- package/ui/src/components/agent-config-primitives.tsx +476 -0
- package/ui/src/components/transcript/RunTranscriptView.test.tsx +84 -0
- package/ui/src/components/transcript/RunTranscriptView.tsx +1015 -0
- package/ui/src/components/transcript/useLiveRunTranscripts.ts +297 -0
- package/ui/src/components/ui/avatar.tsx +107 -0
- package/ui/src/components/ui/badge.tsx +48 -0
- package/ui/src/components/ui/breadcrumb.tsx +109 -0
- package/ui/src/components/ui/button.tsx +64 -0
- package/ui/src/components/ui/card.tsx +92 -0
- package/ui/src/components/ui/checkbox.tsx +32 -0
- package/ui/src/components/ui/collapsible.tsx +33 -0
- package/ui/src/components/ui/command.tsx +194 -0
- package/ui/src/components/ui/dialog.tsx +156 -0
- package/ui/src/components/ui/dropdown-menu.tsx +257 -0
- package/ui/src/components/ui/input.tsx +21 -0
- package/ui/src/components/ui/label.tsx +22 -0
- package/ui/src/components/ui/popover.tsx +88 -0
- package/ui/src/components/ui/scroll-area.tsx +56 -0
- package/ui/src/components/ui/select.tsx +188 -0
- package/ui/src/components/ui/separator.tsx +28 -0
- package/ui/src/components/ui/sheet.tsx +143 -0
- package/ui/src/components/ui/skeleton.tsx +13 -0
- package/ui/src/components/ui/tabs.tsx +89 -0
- package/ui/src/components/ui/textarea.tsx +18 -0
- package/ui/src/components/ui/tooltip.tsx +57 -0
- package/ui/src/components/visual-office/AgentAvatar.tsx +99 -0
- package/ui/src/components/visual-office/OfficeViewExact.tsx +417 -0
- package/ui/src/components/visual-office/i18n.ts +52 -0
- package/ui/src/components/visual-office/office-view/CliUsagePanel.tsx +240 -0
- package/ui/src/components/visual-office/office-view/VirtualPadOverlay.tsx +104 -0
- package/ui/src/components/visual-office/office-view/buildScene-break-room.ts +248 -0
- package/ui/src/components/visual-office/office-view/buildScene-ceo-hallway.ts +345 -0
- package/ui/src/components/visual-office/office-view/buildScene-department-agent.ts +242 -0
- package/ui/src/components/visual-office/office-view/buildScene-departments.ts +360 -0
- package/ui/src/components/visual-office/office-view/buildScene-final-layers.ts +113 -0
- package/ui/src/components/visual-office/office-view/buildScene-types.ts +91 -0
- package/ui/src/components/visual-office/office-view/buildScene.ts +232 -0
- package/ui/src/components/visual-office/office-view/drawing-core.ts +374 -0
- package/ui/src/components/visual-office/office-view/drawing-furniture-a.ts +338 -0
- package/ui/src/components/visual-office/office-view/drawing-furniture-b.ts +241 -0
- package/ui/src/components/visual-office/office-view/model.ts +301 -0
- package/ui/src/components/visual-office/office-view/officeTicker.ts +455 -0
- package/ui/src/components/visual-office/office-view/officeTickerRoomAndDelivery.ts +133 -0
- package/ui/src/components/visual-office/office-view/themes-locale.ts +460 -0
- package/ui/src/components/visual-office/office-view/useCliUsage.ts +37 -0
- package/ui/src/components/visual-office/office-view/useOfficeDeliveryEffects.ts +465 -0
- package/ui/src/components/visual-office/office-view/useOfficePixiRuntime.ts +282 -0
- package/ui/src/components/visual-office/types.ts +123 -0
- package/ui/src/context/BreadcrumbContext.tsx +44 -0
- package/ui/src/context/CompanyContext.tsx +151 -0
- package/ui/src/context/DialogContext.tsx +135 -0
- package/ui/src/context/LiveUpdatesProvider.test.ts +119 -0
- package/ui/src/context/LiveUpdatesProvider.tsx +760 -0
- package/ui/src/context/PanelContext.tsx +73 -0
- package/ui/src/context/SidebarContext.tsx +43 -0
- package/ui/src/context/ThemeContext.tsx +83 -0
- package/ui/src/context/ToastContext.tsx +172 -0
- package/ui/src/fixtures/runTranscriptFixtures.ts +226 -0
- package/ui/src/hooks/useAgentOrder.ts +105 -0
- package/ui/src/hooks/useAutosaveIndicator.ts +72 -0
- package/ui/src/hooks/useCompanyPageMemory.test.ts +90 -0
- package/ui/src/hooks/useCompanyPageMemory.ts +79 -0
- package/ui/src/hooks/useDateRange.ts +120 -0
- package/ui/src/hooks/useInboxBadge.ts +132 -0
- package/ui/src/hooks/useKeyboardShortcuts.ts +40 -0
- package/ui/src/hooks/useProjectOrder.ts +106 -0
- package/ui/src/index.css +770 -0
- package/ui/src/lib/agent-icons.ts +99 -0
- package/ui/src/lib/agent-order.ts +107 -0
- package/ui/src/lib/agent-skills-state.test.ts +90 -0
- package/ui/src/lib/agent-skills-state.ts +41 -0
- package/ui/src/lib/assignees.test.ts +92 -0
- package/ui/src/lib/assignees.ts +82 -0
- package/ui/src/lib/color-contrast.ts +107 -0
- package/ui/src/lib/company-export-selection.test.ts +41 -0
- package/ui/src/lib/company-export-selection.ts +57 -0
- package/ui/src/lib/company-page-memory.ts +65 -0
- package/ui/src/lib/company-portability-sidebar.test.ts +101 -0
- package/ui/src/lib/company-portability-sidebar.ts +62 -0
- package/ui/src/lib/company-routes.ts +88 -0
- package/ui/src/lib/company-selection.test.ts +34 -0
- package/ui/src/lib/company-selection.ts +18 -0
- package/ui/src/lib/groupBy.ts +11 -0
- package/ui/src/lib/inbox.test.ts +404 -0
- package/ui/src/lib/inbox.ts +292 -0
- package/ui/src/lib/instance-settings.test.ts +26 -0
- package/ui/src/lib/instance-settings.ts +25 -0
- package/ui/src/lib/issueDetailBreadcrumb.ts +24 -0
- package/ui/src/lib/legacy-agent-config.test.ts +40 -0
- package/ui/src/lib/legacy-agent-config.ts +17 -0
- package/ui/src/lib/mention-aware-link-node.test.ts +50 -0
- package/ui/src/lib/mention-aware-link-node.ts +67 -0
- package/ui/src/lib/mention-chips.ts +168 -0
- package/ui/src/lib/mention-deletion.test.ts +87 -0
- package/ui/src/lib/mention-deletion.ts +143 -0
- package/ui/src/lib/model-utils.ts +16 -0
- package/ui/src/lib/onboarding-goal.test.ts +22 -0
- package/ui/src/lib/onboarding-goal.ts +18 -0
- package/ui/src/lib/onboarding-launch.test.ts +131 -0
- package/ui/src/lib/onboarding-launch.ts +54 -0
- package/ui/src/lib/onboarding-route.test.ts +80 -0
- package/ui/src/lib/onboarding-route.ts +51 -0
- package/ui/src/lib/portable-files.ts +42 -0
- package/ui/src/lib/project-order.ts +71 -0
- package/ui/src/lib/queryKeys.ts +140 -0
- package/ui/src/lib/recent-assignees.ts +36 -0
- package/ui/src/lib/router.tsx +76 -0
- package/ui/src/lib/routine-trigger-patch.test.ts +72 -0
- package/ui/src/lib/routine-trigger-patch.ts +31 -0
- package/ui/src/lib/status-colors.ts +108 -0
- package/ui/src/lib/timeAgo.ts +31 -0
- package/ui/src/lib/utils.ts +168 -0
- package/ui/src/lib/worktree-branding.ts +65 -0
- package/ui/src/lib/zip.test.ts +289 -0
- package/ui/src/lib/zip.ts +284 -0
- package/ui/src/main.tsx +67 -0
- package/ui/src/pages/Activity.tsx +141 -0
- package/ui/src/pages/AgentDetail.tsx +4053 -0
- package/ui/src/pages/Agents.tsx +415 -0
- package/ui/src/pages/ApprovalDetail.tsx +369 -0
- package/ui/src/pages/Approvals.tsx +132 -0
- package/ui/src/pages/Auth.tsx +180 -0
- package/ui/src/pages/BoardClaim.tsx +125 -0
- package/ui/src/pages/CliAuth.tsx +184 -0
- package/ui/src/pages/Companies.tsx +297 -0
- package/ui/src/pages/CompanyExport.tsx +1019 -0
- package/ui/src/pages/CompanyImport.tsx +1355 -0
- package/ui/src/pages/CompanySettings.tsx +661 -0
- package/ui/src/pages/CompanySkills.tsx +1171 -0
- package/ui/src/pages/Costs.tsx +1103 -0
- package/ui/src/pages/Dashboard.tsx +388 -0
- package/ui/src/pages/DesignGuide.tsx +1330 -0
- package/ui/src/pages/ExecutionWorkspaceDetail.tsx +82 -0
- package/ui/src/pages/GoalDetail.tsx +197 -0
- package/ui/src/pages/Goals.tsx +63 -0
- package/ui/src/pages/Inbox.tsx +1291 -0
- package/ui/src/pages/InstanceExperimentalSettings.tsx +139 -0
- package/ui/src/pages/InstanceGeneralSettings.tsx +104 -0
- package/ui/src/pages/InstanceSettings.tsx +284 -0
- package/ui/src/pages/InviteLanding.tsx +320 -0
- package/ui/src/pages/IssueDetail.tsx +1201 -0
- package/ui/src/pages/Issues.tsx +116 -0
- package/ui/src/pages/MyIssues.tsx +72 -0
- package/ui/src/pages/NewAgent.tsx +353 -0
- package/ui/src/pages/NotFound.tsx +66 -0
- package/ui/src/pages/Org.tsx +132 -0
- package/ui/src/pages/OrgChart.tsx +447 -0
- package/ui/src/pages/PluginManager.tsx +510 -0
- package/ui/src/pages/PluginPage.tsx +156 -0
- package/ui/src/pages/PluginSettings.tsx +836 -0
- package/ui/src/pages/ProjectDetail.tsx +633 -0
- package/ui/src/pages/Projects.tsx +87 -0
- package/ui/src/pages/RoutineDetail.tsx +1022 -0
- package/ui/src/pages/Routines.tsx +661 -0
- package/ui/src/pages/RunTranscriptUxLab.tsx +334 -0
- package/ui/src/pages/VisualOffice.tsx +243 -0
- package/ui/src/plugins/bridge-init.ts +69 -0
- package/ui/src/plugins/bridge.ts +476 -0
- package/ui/src/plugins/launchers.tsx +834 -0
- package/ui/src/plugins/slots.tsx +855 -0
- package/ui/tsconfig.json +21 -0
- package/ui/vite.config.ts +23 -0
- package/ui/vitest.config.ts +14 -0
- package/vitest.config.ts +11 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { Button } from "@/components/ui/button";
|
|
3
|
+
import { Badge } from "@/components/ui/badge";
|
|
4
|
+
import { cn, formatDateTime } from "../lib/utils";
|
|
5
|
+
import { Identity } from "../components/Identity";
|
|
6
|
+
import { StatusBadge } from "../components/StatusBadge";
|
|
7
|
+
import { RunTranscriptView, type TranscriptDensity, type TranscriptMode } from "../components/transcript/RunTranscriptView";
|
|
8
|
+
import { runTranscriptFixtureEntries, runTranscriptFixtureMeta } from "../fixtures/runTranscriptFixtures";
|
|
9
|
+
import { ExternalLink, FlaskConical, LayoutPanelLeft, MonitorCog, PanelsTopLeft, RadioTower } from "lucide-react";
|
|
10
|
+
|
|
11
|
+
type SurfaceId = "detail" | "live" | "dashboard";
|
|
12
|
+
|
|
13
|
+
const surfaceOptions: Array<{
|
|
14
|
+
id: SurfaceId;
|
|
15
|
+
label: string;
|
|
16
|
+
eyebrow: string;
|
|
17
|
+
description: string;
|
|
18
|
+
icon: typeof LayoutPanelLeft;
|
|
19
|
+
}> = [
|
|
20
|
+
{
|
|
21
|
+
id: "detail",
|
|
22
|
+
label: "Run Detail",
|
|
23
|
+
eyebrow: "Full transcript",
|
|
24
|
+
description: "The long-form run page with the `Nice | Raw` toggle and the most inspectable transcript view.",
|
|
25
|
+
icon: MonitorCog,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "live",
|
|
29
|
+
label: "Issue Widget",
|
|
30
|
+
eyebrow: "Live stream",
|
|
31
|
+
description: "The issue-detail live run widget, optimized for following an active run without leaving the task page.",
|
|
32
|
+
icon: RadioTower,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "dashboard",
|
|
36
|
+
label: "Dashboard Card",
|
|
37
|
+
eyebrow: "Dense card",
|
|
38
|
+
description: "The active-agents dashboard card, tuned for compact scanning while keeping the same transcript language.",
|
|
39
|
+
icon: PanelsTopLeft,
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
function previewEntries(surface: SurfaceId) {
|
|
44
|
+
if (surface === "dashboard") {
|
|
45
|
+
return runTranscriptFixtureEntries.slice(-9);
|
|
46
|
+
}
|
|
47
|
+
if (surface === "live") {
|
|
48
|
+
return runTranscriptFixtureEntries.slice(-14);
|
|
49
|
+
}
|
|
50
|
+
return runTranscriptFixtureEntries;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function RunDetailPreview({
|
|
54
|
+
mode,
|
|
55
|
+
streaming,
|
|
56
|
+
density,
|
|
57
|
+
}: {
|
|
58
|
+
mode: TranscriptMode;
|
|
59
|
+
streaming: boolean;
|
|
60
|
+
density: TranscriptDensity;
|
|
61
|
+
}) {
|
|
62
|
+
return (
|
|
63
|
+
<div className="overflow-hidden rounded-xl border border-border/70 bg-background/80 shadow-[0_24px_60px_rgba(15,23,42,0.08)]">
|
|
64
|
+
<div className="border-b border-border/60 bg-background/90 px-5 py-4">
|
|
65
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
66
|
+
<Badge variant="outline" className="uppercase tracking-[0.18em] text-[10px]">
|
|
67
|
+
Run Detail
|
|
68
|
+
</Badge>
|
|
69
|
+
<StatusBadge status={streaming ? "running" : "succeeded"} />
|
|
70
|
+
<span className="text-xs text-muted-foreground">
|
|
71
|
+
{formatDateTime(runTranscriptFixtureMeta.startedAt)}
|
|
72
|
+
</span>
|
|
73
|
+
</div>
|
|
74
|
+
<div className="mt-2 text-sm font-medium">
|
|
75
|
+
Transcript ({runTranscriptFixtureEntries.length})
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
<div className="max-h-[720px] overflow-y-auto bg-[radial-gradient(circle_at_top_left,rgba(8,145,178,0.08),transparent_36%),radial-gradient(circle_at_bottom_right,rgba(245,158,11,0.10),transparent_28%)] p-5">
|
|
79
|
+
<RunTranscriptView
|
|
80
|
+
entries={runTranscriptFixtureEntries}
|
|
81
|
+
mode={mode}
|
|
82
|
+
density={density}
|
|
83
|
+
streaming={streaming}
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function LiveWidgetPreview({
|
|
91
|
+
streaming,
|
|
92
|
+
mode,
|
|
93
|
+
density,
|
|
94
|
+
}: {
|
|
95
|
+
streaming: boolean;
|
|
96
|
+
mode: TranscriptMode;
|
|
97
|
+
density: TranscriptDensity;
|
|
98
|
+
}) {
|
|
99
|
+
return (
|
|
100
|
+
<div className="overflow-hidden rounded-xl border border-cyan-500/25 bg-background/85 shadow-[0_20px_50px_rgba(6,182,212,0.10)]">
|
|
101
|
+
<div className="border-b border-border/60 bg-cyan-500/[0.05] px-5 py-4">
|
|
102
|
+
<div className="text-xs font-semibold uppercase tracking-[0.2em] text-cyan-700 dark:text-cyan-300">
|
|
103
|
+
Live Runs
|
|
104
|
+
</div>
|
|
105
|
+
<div className="mt-1 text-xs text-muted-foreground">
|
|
106
|
+
Compact live transcript stream for the issue detail page.
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
<div className="px-5 py-4">
|
|
110
|
+
<div className="mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
|
|
111
|
+
<div className="min-w-0">
|
|
112
|
+
<Identity name={runTranscriptFixtureMeta.agentName} size="sm" />
|
|
113
|
+
<div className="mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
|
|
114
|
+
<span className="rounded-full border border-border/70 bg-background/70 px-2 py-1 font-mono">
|
|
115
|
+
{runTranscriptFixtureMeta.sourceRunId.slice(0, 8)}
|
|
116
|
+
</span>
|
|
117
|
+
<StatusBadge status={streaming ? "running" : "succeeded"} />
|
|
118
|
+
<span>{formatDateTime(runTranscriptFixtureMeta.startedAt)}</span>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
<span className="inline-flex items-center gap-1 rounded-full border border-border/70 bg-background/70 px-2.5 py-1 text-[11px] text-muted-foreground">
|
|
122
|
+
Open run
|
|
123
|
+
<ExternalLink className="h-3 w-3" />
|
|
124
|
+
</span>
|
|
125
|
+
</div>
|
|
126
|
+
<div className="max-h-[460px] overflow-y-auto pr-1">
|
|
127
|
+
<RunTranscriptView
|
|
128
|
+
entries={previewEntries("live")}
|
|
129
|
+
mode={mode}
|
|
130
|
+
density={density}
|
|
131
|
+
limit={density === "compact" ? 10 : 12}
|
|
132
|
+
streaming={streaming}
|
|
133
|
+
/>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function DashboardPreview({
|
|
141
|
+
streaming,
|
|
142
|
+
mode,
|
|
143
|
+
density,
|
|
144
|
+
}: {
|
|
145
|
+
streaming: boolean;
|
|
146
|
+
mode: TranscriptMode;
|
|
147
|
+
density: TranscriptDensity;
|
|
148
|
+
}) {
|
|
149
|
+
return (
|
|
150
|
+
<div className="max-w-md">
|
|
151
|
+
<div className={cn(
|
|
152
|
+
"flex h-[320px] flex-col overflow-hidden rounded-xl border shadow-[0_20px_40px_rgba(15,23,42,0.10)]",
|
|
153
|
+
streaming
|
|
154
|
+
? "border-cyan-500/25 bg-cyan-500/[0.04]"
|
|
155
|
+
: "border-border bg-background/75",
|
|
156
|
+
)}>
|
|
157
|
+
<div className="border-b border-border/60 px-4 py-4">
|
|
158
|
+
<div className="flex items-start justify-between gap-3">
|
|
159
|
+
<div className="min-w-0">
|
|
160
|
+
<div className="flex items-center gap-2">
|
|
161
|
+
<span className={cn(
|
|
162
|
+
"inline-flex h-2.5 w-2.5 rounded-full",
|
|
163
|
+
streaming ? "bg-cyan-500 shadow-[0_0_0_6px_rgba(34,211,238,0.12)]" : "bg-muted-foreground/35",
|
|
164
|
+
)} />
|
|
165
|
+
<Identity name={runTranscriptFixtureMeta.agentName} size="sm" />
|
|
166
|
+
</div>
|
|
167
|
+
<div className="mt-2 text-[11px] text-muted-foreground">
|
|
168
|
+
{streaming ? "Live now" : "Finished 2m ago"}
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
<span className="rounded-full border border-border/70 bg-background/70 px-2 py-1 text-[10px] text-muted-foreground">
|
|
172
|
+
<ExternalLink className="h-2.5 w-2.5" />
|
|
173
|
+
</span>
|
|
174
|
+
</div>
|
|
175
|
+
<div className="mt-3 rounded-lg border border-border/60 bg-background/60 px-3 py-2 text-xs text-cyan-700 dark:text-cyan-300">
|
|
176
|
+
{runTranscriptFixtureMeta.issueIdentifier} - {runTranscriptFixtureMeta.issueTitle}
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
<div className="min-h-0 flex-1 overflow-y-auto p-4">
|
|
180
|
+
<RunTranscriptView
|
|
181
|
+
entries={previewEntries("dashboard")}
|
|
182
|
+
mode={mode}
|
|
183
|
+
density={density}
|
|
184
|
+
limit={density === "compact" ? 6 : 8}
|
|
185
|
+
streaming={streaming}
|
|
186
|
+
/>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export function RunTranscriptUxLab() {
|
|
194
|
+
const [selectedSurface, setSelectedSurface] = useState<SurfaceId>("detail");
|
|
195
|
+
const [detailMode, setDetailMode] = useState<TranscriptMode>("nice");
|
|
196
|
+
const [streaming, setStreaming] = useState(true);
|
|
197
|
+
const [density, setDensity] = useState<TranscriptDensity>("comfortable");
|
|
198
|
+
|
|
199
|
+
const selected = surfaceOptions.find((option) => option.id === selectedSurface) ?? surfaceOptions[0];
|
|
200
|
+
|
|
201
|
+
return (
|
|
202
|
+
<div className="space-y-6">
|
|
203
|
+
<div className="overflow-hidden rounded-2xl border border-border/70 bg-[linear-gradient(135deg,rgba(8,145,178,0.08),transparent_28%),linear-gradient(180deg,rgba(245,158,11,0.08),transparent_40%),var(--background)] shadow-[0_28px_70px_rgba(15,23,42,0.10)]">
|
|
204
|
+
<div className="grid gap-6 lg:grid-cols-[260px_minmax(0,1fr)]">
|
|
205
|
+
<aside className="border-b border-border/60 bg-background/75 p-5 lg:border-b-0 lg:border-r">
|
|
206
|
+
<div className="mb-5">
|
|
207
|
+
<div className="inline-flex items-center gap-2 rounded-full border border-cyan-500/25 bg-cyan-500/[0.08] px-3 py-1 text-[10px] font-semibold uppercase tracking-[0.24em] text-cyan-700 dark:text-cyan-300">
|
|
208
|
+
<FlaskConical className="h-3.5 w-3.5" />
|
|
209
|
+
UX Lab
|
|
210
|
+
</div>
|
|
211
|
+
<h1 className="mt-4 text-2xl font-semibold tracking-tight">Run Transcript Fixtures</h1>
|
|
212
|
+
<p className="mt-2 text-sm text-muted-foreground">
|
|
213
|
+
Built from a real Corporate development run, then sanitized so no secrets, local paths, or environment details survive into the fixture.
|
|
214
|
+
</p>
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
<div className="space-y-2">
|
|
218
|
+
{surfaceOptions.map((option) => {
|
|
219
|
+
const Icon = option.icon;
|
|
220
|
+
return (
|
|
221
|
+
<button
|
|
222
|
+
key={option.id}
|
|
223
|
+
type="button"
|
|
224
|
+
onClick={() => setSelectedSurface(option.id)}
|
|
225
|
+
className={cn(
|
|
226
|
+
"w-full rounded-xl border px-4 py-3 text-left transition-all",
|
|
227
|
+
selectedSurface === option.id
|
|
228
|
+
? "border-cyan-500/35 bg-cyan-500/[0.10] shadow-[0_12px_24px_rgba(6,182,212,0.12)]"
|
|
229
|
+
: "border-border/70 bg-background/70 hover:border-cyan-500/20 hover:bg-cyan-500/[0.04]",
|
|
230
|
+
)}
|
|
231
|
+
>
|
|
232
|
+
<div className="flex items-start gap-3">
|
|
233
|
+
<span className="rounded-lg border border-current/15 p-2 text-cyan-700 dark:text-cyan-300">
|
|
234
|
+
<Icon className="h-4 w-4" />
|
|
235
|
+
</span>
|
|
236
|
+
<span className="min-w-0">
|
|
237
|
+
<span className="block text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
|
|
238
|
+
{option.eyebrow}
|
|
239
|
+
</span>
|
|
240
|
+
<span className="mt-1 block text-sm font-medium">{option.label}</span>
|
|
241
|
+
<span className="mt-1 block text-xs text-muted-foreground">
|
|
242
|
+
{option.description}
|
|
243
|
+
</span>
|
|
244
|
+
</span>
|
|
245
|
+
</div>
|
|
246
|
+
</button>
|
|
247
|
+
);
|
|
248
|
+
})}
|
|
249
|
+
</div>
|
|
250
|
+
</aside>
|
|
251
|
+
|
|
252
|
+
<main className="min-w-0 p-5">
|
|
253
|
+
<div className="mb-5 flex flex-col gap-4 xl:flex-row xl:items-end xl:justify-between">
|
|
254
|
+
<div>
|
|
255
|
+
<div className="text-[11px] font-semibold uppercase tracking-[0.22em] text-muted-foreground">
|
|
256
|
+
{selected.eyebrow}
|
|
257
|
+
</div>
|
|
258
|
+
<h2 className="mt-1 text-2xl font-semibold">{selected.label}</h2>
|
|
259
|
+
<p className="mt-2 max-w-2xl text-sm text-muted-foreground">
|
|
260
|
+
{selected.description}
|
|
261
|
+
</p>
|
|
262
|
+
</div>
|
|
263
|
+
|
|
264
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
265
|
+
<Badge variant="outline" className="rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.18em]">
|
|
266
|
+
Source run {runTranscriptFixtureMeta.sourceRunId.slice(0, 8)}
|
|
267
|
+
</Badge>
|
|
268
|
+
<Badge variant="outline" className="rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.18em]">
|
|
269
|
+
{runTranscriptFixtureMeta.issueIdentifier}
|
|
270
|
+
</Badge>
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
273
|
+
|
|
274
|
+
<div className="mb-5 flex flex-wrap items-center gap-2">
|
|
275
|
+
<span className="text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">
|
|
276
|
+
Controls
|
|
277
|
+
</span>
|
|
278
|
+
<div className="inline-flex rounded-full border border-border/70 bg-background/80 p-1">
|
|
279
|
+
{(["nice", "raw"] as const).map((mode) => (
|
|
280
|
+
<button
|
|
281
|
+
key={mode}
|
|
282
|
+
type="button"
|
|
283
|
+
className={cn(
|
|
284
|
+
"rounded-full px-3 py-1 text-xs font-medium capitalize transition-colors",
|
|
285
|
+
detailMode === mode ? "bg-accent text-foreground" : "text-muted-foreground hover:text-foreground",
|
|
286
|
+
)}
|
|
287
|
+
onClick={() => setDetailMode(mode)}
|
|
288
|
+
>
|
|
289
|
+
{mode}
|
|
290
|
+
</button>
|
|
291
|
+
))}
|
|
292
|
+
</div>
|
|
293
|
+
<div className="inline-flex rounded-full border border-border/70 bg-background/80 p-1">
|
|
294
|
+
{(["comfortable", "compact"] as const).map((nextDensity) => (
|
|
295
|
+
<button
|
|
296
|
+
key={nextDensity}
|
|
297
|
+
type="button"
|
|
298
|
+
className={cn(
|
|
299
|
+
"rounded-full px-3 py-1 text-xs font-medium capitalize transition-colors",
|
|
300
|
+
density === nextDensity ? "bg-accent text-foreground" : "text-muted-foreground hover:text-foreground",
|
|
301
|
+
)}
|
|
302
|
+
onClick={() => setDensity(nextDensity)}
|
|
303
|
+
>
|
|
304
|
+
{nextDensity}
|
|
305
|
+
</button>
|
|
306
|
+
))}
|
|
307
|
+
</div>
|
|
308
|
+
<Button
|
|
309
|
+
variant="outline"
|
|
310
|
+
size="sm"
|
|
311
|
+
className="rounded-full"
|
|
312
|
+
onClick={() => setStreaming((value) => !value)}
|
|
313
|
+
>
|
|
314
|
+
{streaming ? "Show settled state" : "Show streaming state"}
|
|
315
|
+
</Button>
|
|
316
|
+
</div>
|
|
317
|
+
|
|
318
|
+
{selectedSurface === "detail" ? (
|
|
319
|
+
<div className={cn(density === "compact" && "max-w-5xl")}>
|
|
320
|
+
<RunDetailPreview mode={detailMode} streaming={streaming} density={density} />
|
|
321
|
+
</div>
|
|
322
|
+
) : selectedSurface === "live" ? (
|
|
323
|
+
<div className={cn(density === "compact" && "max-w-4xl")}>
|
|
324
|
+
<LiveWidgetPreview streaming={streaming} mode={detailMode} density={density} />
|
|
325
|
+
</div>
|
|
326
|
+
) : (
|
|
327
|
+
<DashboardPreview streaming={streaming} mode={detailMode} density={density} />
|
|
328
|
+
)}
|
|
329
|
+
</main>
|
|
330
|
+
</div>
|
|
331
|
+
</div>
|
|
332
|
+
</div>
|
|
333
|
+
);
|
|
334
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { useEffect, useMemo } from "react";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { Building2 } from "lucide-react";
|
|
4
|
+
import { agentsApi } from "../api/agents";
|
|
5
|
+
import { issuesApi } from "../api/issues";
|
|
6
|
+
import { EmptyState } from "../components/EmptyState";
|
|
7
|
+
import { PageSkeleton } from "../components/PageSkeleton";
|
|
8
|
+
import { useBreadcrumbs } from "../context/BreadcrumbContext";
|
|
9
|
+
import { useCompany } from "../context/CompanyContext";
|
|
10
|
+
import { queryKeys } from "../lib/queryKeys";
|
|
11
|
+
import OfficeViewExact from "../components/visual-office/OfficeViewExact";
|
|
12
|
+
import type { Agent, Department, Task } from "../components/visual-office/types";
|
|
13
|
+
|
|
14
|
+
const DEPARTMENTS: Department[] = [
|
|
15
|
+
{
|
|
16
|
+
id: "planning",
|
|
17
|
+
name: "Planning",
|
|
18
|
+
name_ko: "기획",
|
|
19
|
+
name_ja: "企画",
|
|
20
|
+
name_zh: "规划",
|
|
21
|
+
icon: "🧭",
|
|
22
|
+
color: "#72A2D7",
|
|
23
|
+
description: "Planning department",
|
|
24
|
+
prompt: null,
|
|
25
|
+
sort_order: 1,
|
|
26
|
+
created_at: 0,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "dev",
|
|
30
|
+
name: "Development",
|
|
31
|
+
name_ko: "개발",
|
|
32
|
+
name_ja: "開発",
|
|
33
|
+
name_zh: "开发",
|
|
34
|
+
icon: "💻",
|
|
35
|
+
color: "#6BBA9F",
|
|
36
|
+
description: "Development department",
|
|
37
|
+
prompt: null,
|
|
38
|
+
sort_order: 2,
|
|
39
|
+
created_at: 0,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "design",
|
|
43
|
+
name: "Design",
|
|
44
|
+
name_ko: "디자인",
|
|
45
|
+
name_ja: "デザイン",
|
|
46
|
+
name_zh: "设计",
|
|
47
|
+
icon: "🎨",
|
|
48
|
+
color: "#B38AD8",
|
|
49
|
+
description: "Design department",
|
|
50
|
+
prompt: null,
|
|
51
|
+
sort_order: 3,
|
|
52
|
+
created_at: 0,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: "qa",
|
|
56
|
+
name: "QA",
|
|
57
|
+
name_ko: "QA",
|
|
58
|
+
name_ja: "QA",
|
|
59
|
+
name_zh: "测试",
|
|
60
|
+
icon: "🧪",
|
|
61
|
+
color: "#D5847D",
|
|
62
|
+
description: "QA department",
|
|
63
|
+
prompt: null,
|
|
64
|
+
sort_order: 4,
|
|
65
|
+
created_at: 0,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: "ops",
|
|
69
|
+
name: "Operations",
|
|
70
|
+
name_ko: "운영",
|
|
71
|
+
name_ja: "運用",
|
|
72
|
+
name_zh: "运维",
|
|
73
|
+
icon: "⚙️",
|
|
74
|
+
color: "#79B99B",
|
|
75
|
+
description: "Operations department",
|
|
76
|
+
prompt: null,
|
|
77
|
+
sort_order: 5,
|
|
78
|
+
created_at: 0,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "strategy",
|
|
82
|
+
name: "Strategy",
|
|
83
|
+
name_ko: "전략",
|
|
84
|
+
name_ja: "戦略",
|
|
85
|
+
name_zh: "战略",
|
|
86
|
+
icon: "📈",
|
|
87
|
+
color: "#D8A15E",
|
|
88
|
+
description: "Strategy department",
|
|
89
|
+
prompt: null,
|
|
90
|
+
sort_order: 6,
|
|
91
|
+
created_at: 0,
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
|
|
95
|
+
function hashString(input: string): number {
|
|
96
|
+
let hash = 0;
|
|
97
|
+
for (let i = 0; i < input.length; i += 1) {
|
|
98
|
+
hash = (hash * 31 + input.charCodeAt(i)) >>> 0;
|
|
99
|
+
}
|
|
100
|
+
return hash;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function normalizeRole(raw: unknown): Agent["role"] {
|
|
104
|
+
const value = String(raw ?? "").toLowerCase();
|
|
105
|
+
if (value.includes("lead")) return "team_leader";
|
|
106
|
+
if (value.includes("senior")) return "senior";
|
|
107
|
+
if (value.includes("intern")) return "intern";
|
|
108
|
+
return "junior";
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function normalizeStatus(raw: unknown, seed: number): Agent["status"] {
|
|
112
|
+
const value = String(raw ?? "").toLowerCase();
|
|
113
|
+
if (value === "error" || value === "terminated" || value === "offline") return "offline";
|
|
114
|
+
if (value === "running" || value === "active" || value === "working") return "working";
|
|
115
|
+
if (value === "paused") return "idle";
|
|
116
|
+
if (seed % 9 === 0) return "break";
|
|
117
|
+
return "idle";
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function normalizeTaskStatus(raw: unknown): Task["status"] {
|
|
121
|
+
const value = String(raw ?? "").toLowerCase();
|
|
122
|
+
if (value === "done" || value === "resolved" || value === "closed" || value === "canceled") return "done";
|
|
123
|
+
if (value === "review" || value === "blocked") return "review";
|
|
124
|
+
if (value === "planned" || value === "backlog") return "planned";
|
|
125
|
+
return "in_progress";
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function VisualOffice() {
|
|
129
|
+
const { selectedCompanyId } = useCompany();
|
|
130
|
+
const { setBreadcrumbs } = useBreadcrumbs();
|
|
131
|
+
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
setBreadcrumbs([{ label: "Visual Office" }]);
|
|
134
|
+
}, [setBreadcrumbs]);
|
|
135
|
+
|
|
136
|
+
const { data: agentsRaw, isLoading: agentsLoading } = useQuery({
|
|
137
|
+
queryKey: queryKeys.agents.list(selectedCompanyId!),
|
|
138
|
+
queryFn: () => agentsApi.list(selectedCompanyId!),
|
|
139
|
+
enabled: !!selectedCompanyId,
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
const { data: issuesRaw, isLoading: issuesLoading } = useQuery({
|
|
143
|
+
queryKey: queryKeys.issues.list(selectedCompanyId!),
|
|
144
|
+
queryFn: () => issuesApi.list(selectedCompanyId!),
|
|
145
|
+
enabled: !!selectedCompanyId,
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
const isLoading = agentsLoading || issuesLoading;
|
|
149
|
+
|
|
150
|
+
const officeAgents = useMemo(() => {
|
|
151
|
+
const rows = (agentsRaw ?? []) as unknown as Array<Record<string, unknown>>;
|
|
152
|
+
return rows.map((row, index) => {
|
|
153
|
+
const id = String(row.id ?? `agent-${index + 1}`);
|
|
154
|
+
const seed = hashString(id);
|
|
155
|
+
const dept = DEPARTMENTS[seed % DEPARTMENTS.length];
|
|
156
|
+
return {
|
|
157
|
+
id,
|
|
158
|
+
name: String(row.name ?? `Agent ${index + 1}`),
|
|
159
|
+
name_ko: String(row.name ?? `에이전트 ${index + 1}`),
|
|
160
|
+
name_ja: String(row.name ?? `エージェント ${index + 1}`),
|
|
161
|
+
name_zh: String(row.name ?? `智能体 ${index + 1}`),
|
|
162
|
+
department_id: dept.id,
|
|
163
|
+
role: normalizeRole(row.role),
|
|
164
|
+
cli_provider: "codex",
|
|
165
|
+
avatar_emoji: String(row.avatarEmoji ?? row.avatar_emoji ?? "🤖"),
|
|
166
|
+
sprite_number:
|
|
167
|
+
typeof row.sprite_number === "number"
|
|
168
|
+
? row.sprite_number
|
|
169
|
+
: typeof row.spriteNumber === "number"
|
|
170
|
+
? row.spriteNumber
|
|
171
|
+
: null,
|
|
172
|
+
personality: null,
|
|
173
|
+
status: normalizeStatus(row.status, seed),
|
|
174
|
+
current_task_id: null,
|
|
175
|
+
stats_tasks_done: 0,
|
|
176
|
+
stats_xp: 0,
|
|
177
|
+
created_at: Date.now(),
|
|
178
|
+
} satisfies Agent;
|
|
179
|
+
});
|
|
180
|
+
}, [agentsRaw]);
|
|
181
|
+
|
|
182
|
+
const agentById = useMemo(
|
|
183
|
+
() => new Map(officeAgents.map((agent: Agent) => [agent.id, agent] as const)),
|
|
184
|
+
[officeAgents],
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
const officeTasks = useMemo(() => {
|
|
188
|
+
const rows = (issuesRaw ?? []) as unknown as Array<Record<string, unknown>>;
|
|
189
|
+
return rows.map((row, index) => {
|
|
190
|
+
const id = String(row.id ?? `issue-${index + 1}`);
|
|
191
|
+
const assignedAgentId =
|
|
192
|
+
(typeof row.assigneeAgentId === "string" && row.assigneeAgentId) ||
|
|
193
|
+
(typeof row.assignedAgentId === "string" && row.assignedAgentId) ||
|
|
194
|
+
null;
|
|
195
|
+
const assignedAgent = assignedAgentId ? agentById.get(assignedAgentId) : undefined;
|
|
196
|
+
return {
|
|
197
|
+
id,
|
|
198
|
+
title: String(row.title ?? row.summary ?? `Task ${index + 1}`),
|
|
199
|
+
description: typeof row.description === "string" ? row.description : null,
|
|
200
|
+
department_id: assignedAgent?.department_id ?? DEPARTMENTS[index % DEPARTMENTS.length].id,
|
|
201
|
+
assigned_agent_id: assignedAgentId,
|
|
202
|
+
assigned_agent: assignedAgent,
|
|
203
|
+
status: normalizeTaskStatus(row.status),
|
|
204
|
+
priority: 2,
|
|
205
|
+
task_type: "general",
|
|
206
|
+
project_path: null,
|
|
207
|
+
result: null,
|
|
208
|
+
started_at: null,
|
|
209
|
+
completed_at: null,
|
|
210
|
+
created_at: Date.now(),
|
|
211
|
+
updated_at: Date.now(),
|
|
212
|
+
} satisfies Task;
|
|
213
|
+
});
|
|
214
|
+
}, [issuesRaw, agentById]);
|
|
215
|
+
|
|
216
|
+
if (!selectedCompanyId) {
|
|
217
|
+
return <EmptyState icon={Building2} message="Select a company to open the visual office." />;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (isLoading) {
|
|
221
|
+
return <PageSkeleton variant="dashboard" />;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return (
|
|
225
|
+
<OfficeViewExact
|
|
226
|
+
departments={DEPARTMENTS}
|
|
227
|
+
agents={officeAgents}
|
|
228
|
+
tasks={officeTasks}
|
|
229
|
+
subAgents={[]}
|
|
230
|
+
meetingPresence={[]}
|
|
231
|
+
activeMeetingTaskId={null}
|
|
232
|
+
unreadAgentIds={new Set()}
|
|
233
|
+
crossDeptDeliveries={[]}
|
|
234
|
+
ceoOfficeCalls={[]}
|
|
235
|
+
themeHighlightTargetId={null}
|
|
236
|
+
onCrossDeptDeliveryProcessed={() => {}}
|
|
237
|
+
onCeoOfficeCallProcessed={() => {}}
|
|
238
|
+
onOpenActiveMeetingMinutes={() => {}}
|
|
239
|
+
onSelectAgent={() => {}}
|
|
240
|
+
onSelectDepartment={() => {}}
|
|
241
|
+
/>
|
|
242
|
+
);
|
|
243
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin bridge initialization.
|
|
3
|
+
*
|
|
4
|
+
* Registers the host's React instances and bridge hook implementations
|
|
5
|
+
* on a global object so that the plugin module loader can inject them
|
|
6
|
+
* into plugin UI bundles at load time.
|
|
7
|
+
*
|
|
8
|
+
* Call `initPluginBridge()` once during app startup (in `main.tsx`), before
|
|
9
|
+
* any plugin UI modules are loaded.
|
|
10
|
+
*
|
|
11
|
+
* @see PLUGIN_SPEC.md §19.0.1 — Plugin UI SDK
|
|
12
|
+
* @see PLUGIN_SPEC.md §19.0.2 — Bundle Isolation
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
usePluginData,
|
|
17
|
+
usePluginAction,
|
|
18
|
+
useHostContext,
|
|
19
|
+
usePluginStream,
|
|
20
|
+
usePluginToast,
|
|
21
|
+
} from "./bridge.js";
|
|
22
|
+
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// Global bridge registry
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The global bridge registry shape.
|
|
29
|
+
*
|
|
30
|
+
* This is placed on `globalThis.__paperclipPluginBridge__` and consumed by
|
|
31
|
+
* the plugin module loader to provide implementations for external imports.
|
|
32
|
+
*/
|
|
33
|
+
export interface PluginBridgeRegistry {
|
|
34
|
+
react: unknown;
|
|
35
|
+
reactDom: unknown;
|
|
36
|
+
sdkUi: Record<string, unknown>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare global {
|
|
40
|
+
// eslint-disable-next-line no-var
|
|
41
|
+
var __paperclipPluginBridge__: PluginBridgeRegistry | undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Initialize the plugin bridge global registry.
|
|
46
|
+
*
|
|
47
|
+
* Registers the host's React, ReactDOM, and SDK UI bridge implementations
|
|
48
|
+
* on `globalThis.__paperclipPluginBridge__` so the plugin module loader
|
|
49
|
+
* can provide them to plugin bundles.
|
|
50
|
+
*
|
|
51
|
+
* @param react - The host's React module
|
|
52
|
+
* @param reactDom - The host's ReactDOM module
|
|
53
|
+
*/
|
|
54
|
+
export function initPluginBridge(
|
|
55
|
+
react: typeof import("react"),
|
|
56
|
+
reactDom: typeof import("react-dom"),
|
|
57
|
+
): void {
|
|
58
|
+
globalThis.__paperclipPluginBridge__ = {
|
|
59
|
+
react,
|
|
60
|
+
reactDom,
|
|
61
|
+
sdkUi: {
|
|
62
|
+
usePluginData,
|
|
63
|
+
usePluginAction,
|
|
64
|
+
useHostContext,
|
|
65
|
+
usePluginStream,
|
|
66
|
+
usePluginToast,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|