@songsid/agend 2.4.0-beta.17 → 2.4.0-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-cli-instructions.md +13 -7
- package/dist/agent-cli.js +149 -49
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-export.d.ts +3 -1
- package/dist/agent-export.js +18 -1
- package/dist/agent-export.js.map +1 -1
- package/dist/agent-whats-new.js +9 -0
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/apply-job.d.ts +2 -2
- package/dist/auth-api.js +1 -1
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/claude-code.d.ts +0 -6
- package/dist/backend/claude-code.js +29 -5
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/claude-transcript-errors.d.ts +4 -0
- package/dist/backend/claude-transcript-errors.js +5 -1
- package/dist/backend/claude-transcript-errors.js.map +1 -1
- package/dist/backend/codex-precaution.js +3 -2
- package/dist/backend/codex-precaution.js.map +1 -1
- package/dist/backend/codex.js +1 -1
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/types.d.ts +6 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/mcp-server.js +8 -2
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.d.ts +27 -1
- package/dist/channel/mcp-tools.js +77 -7
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/chat-task-refs.d.ts +61 -0
- package/dist/chat-task-refs.js +112 -0
- package/dist/chat-task-refs.js.map +1 -0
- package/dist/classic-channel-manager.d.ts +1 -1
- package/dist/classic-channel-manager.js +6 -2
- package/dist/classic-channel-manager.js.map +1 -1
- package/dist/claude-credential-launch.d.ts +6 -0
- package/dist/claude-credential-launch.js +16 -3
- package/dist/claude-credential-launch.js.map +1 -1
- package/dist/claude-credential-runner.js +3 -1
- package/dist/claude-credential-runner.js.map +1 -1
- package/dist/claude-setup-token-transport.js +25 -3
- package/dist/claude-setup-token-transport.js.map +1 -1
- package/dist/cli-audited.js +9 -8
- package/dist/cli-audited.js.map +1 -1
- package/dist/composite-tools.d.ts +11 -0
- package/dist/composite-tools.js +29 -0
- package/dist/composite-tools.js.map +1 -0
- package/dist/config-validator.js +22 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/config.js +11 -0
- package/dist/config.js.map +1 -1
- package/dist/contact-auth-policy.d.ts +1 -0
- package/dist/contact-auth-policy.js +2 -1
- package/dist/contact-auth-policy.js.map +1 -1
- package/dist/contact-auth-service.js +2 -0
- package/dist/contact-auth-service.js.map +1 -1
- package/dist/contact-auth-store.js +21 -6
- package/dist/contact-auth-store.js.map +1 -1
- package/dist/contact-auth-types.d.ts +2 -0
- package/dist/contact-auth-types.js.map +1 -1
- package/dist/daemon.d.ts +8 -0
- package/dist/daemon.js +66 -13
- package/dist/daemon.js.map +1 -1
- package/dist/darwin-memory.js +2 -1
- package/dist/darwin-memory.js.map +1 -1
- package/dist/dashboard-permissions.d.ts +1 -8
- package/dist/dashboard-permissions.js +8 -9
- package/dist/dashboard-permissions.js.map +1 -1
- package/dist/delivery-outbox.d.ts +0 -6
- package/dist/delivery-outbox.js +0 -25
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/delivery-outbox.test.js +132 -96
- package/dist/delivery-outbox.test.js.map +1 -1
- package/dist/fleet-context.d.ts +1 -0
- package/dist/fleet-manager.d.ts +60 -8
- package/dist/fleet-manager.js +404 -107
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +2 -2
- package/dist/fleet-windows-runtime.js +9 -2
- package/dist/fleet-windows-runtime.js.map +1 -1
- package/dist/fleet-yaml-stringify.d.ts +3 -0
- package/dist/fleet-yaml-stringify.js +132 -0
- package/dist/fleet-yaml-stringify.js.map +1 -0
- package/dist/general-knowledge/skills/concepts/SKILL.md +53 -4
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +4 -0
- package/dist/general-knowledge/skills/fleet-config/SKILL.md +21 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +2 -0
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +5 -1
- package/dist/general-knowledge/skills/model-discovery/SKILL.md +3 -2
- package/dist/general-knowledge/skills/persona-emoji/SKILL.md +3 -0
- package/dist/general-knowledge/skills/task-board/SKILL.md +63 -0
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +25 -2
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +48 -11
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +4 -0
- package/dist/general-knowledge/steering/core-rules.md +15 -78
- package/dist/general-role-block.d.ts +19 -0
- package/dist/general-role-block.js +56 -0
- package/dist/general-role-block.js.map +1 -0
- package/dist/general-role.d.ts +1 -1
- package/dist/general-role.js +1 -0
- package/dist/general-role.js.map +1 -1
- package/dist/host-memory.d.ts +3 -0
- package/dist/host-memory.js.map +1 -1
- package/dist/host-monitoring/darwin/collector.d.ts +18 -0
- package/dist/host-monitoring/darwin/collector.js +65 -0
- package/dist/host-monitoring/darwin/collector.js.map +1 -0
- package/dist/host-monitoring/darwin/defaults.d.ts +2 -0
- package/dist/host-monitoring/darwin/defaults.js +9 -0
- package/dist/host-monitoring/darwin/defaults.js.map +1 -0
- package/dist/host-monitoring/darwin/interpretation.d.ts +20 -0
- package/dist/host-monitoring/darwin/interpretation.js +73 -0
- package/dist/host-monitoring/darwin/interpretation.js.map +1 -0
- package/dist/host-monitoring/linux/collector.d.ts +17 -0
- package/dist/host-monitoring/linux/collector.js +55 -0
- package/dist/host-monitoring/linux/collector.js.map +1 -0
- package/dist/host-monitoring/linux/defaults.d.ts +2 -0
- package/dist/host-monitoring/linux/defaults.js +9 -0
- package/dist/host-monitoring/linux/defaults.js.map +1 -0
- package/dist/host-monitoring/linux/interpretation.d.ts +22 -0
- package/dist/host-monitoring/linux/interpretation.js +76 -0
- package/dist/host-monitoring/linux/interpretation.js.map +1 -0
- package/dist/host-monitoring/transport.d.ts +42 -0
- package/dist/host-monitoring/transport.js +101 -0
- package/dist/host-monitoring/transport.js.map +1 -0
- package/dist/host-monitoring/wsl/collector.d.ts +19 -0
- package/dist/host-monitoring/wsl/collector.js +72 -0
- package/dist/host-monitoring/wsl/collector.js.map +1 -0
- package/dist/host-monitoring/wsl/defaults.d.ts +2 -0
- package/dist/host-monitoring/wsl/defaults.js +9 -0
- package/dist/host-monitoring/wsl/defaults.js.map +1 -0
- package/dist/host-monitoring/wsl/interpretation.d.ts +22 -0
- package/dist/host-monitoring/wsl/interpretation.js +77 -0
- package/dist/host-monitoring/wsl/interpretation.js.map +1 -0
- package/dist/host-monitoring-alert-policy.d.ts +73 -0
- package/dist/host-monitoring-alert-policy.js +152 -0
- package/dist/host-monitoring-alert-policy.js.map +1 -0
- package/dist/host-monitoring-alert-resources.d.ts +11 -0
- package/dist/host-monitoring-alert-resources.js +16 -0
- package/dist/host-monitoring-alert-resources.js.map +1 -0
- package/dist/host-monitoring-alert-settings.d.ts +16 -0
- package/dist/host-monitoring-alert-settings.js +68 -0
- package/dist/host-monitoring-alert-settings.js.map +1 -0
- package/dist/host-monitoring-alert-store.d.ts +49 -0
- package/dist/host-monitoring-alert-store.js +228 -0
- package/dist/host-monitoring-alert-store.js.map +1 -0
- package/dist/host-monitoring-alert-text.d.ts +7 -0
- package/dist/host-monitoring-alert-text.js +10 -0
- package/dist/host-monitoring-alert-text.js.map +1 -0
- package/dist/host-monitoring-alerts.d.ts +79 -0
- package/dist/host-monitoring-alerts.js +276 -0
- package/dist/host-monitoring-alerts.js.map +1 -0
- package/dist/host-monitoring-defaults.d.ts +19 -0
- package/dist/host-monitoring-defaults.js +10 -0
- package/dist/host-monitoring-defaults.js.map +1 -0
- package/dist/host-monitoring-footprint-policy.d.ts +45 -0
- package/dist/host-monitoring-footprint-policy.js +150 -0
- package/dist/host-monitoring-footprint-policy.js.map +1 -0
- package/dist/host-monitoring-footprint.d.ts +42 -0
- package/dist/host-monitoring-footprint.js +169 -0
- package/dist/host-monitoring-footprint.js.map +1 -0
- package/dist/host-monitoring-history-policy.d.ts +2 -0
- package/dist/host-monitoring-history-policy.js +16 -2
- package/dist/host-monitoring-history-policy.js.map +1 -1
- package/dist/host-monitoring-history-store.js +8 -6
- package/dist/host-monitoring-history-store.js.map +1 -1
- package/dist/host-monitoring-history-worker.js +19 -3
- package/dist/host-monitoring-history-worker.js.map +1 -1
- package/dist/host-monitoring-history.d.ts +9 -0
- package/dist/host-monitoring-history.js +45 -9
- package/dist/host-monitoring-history.js.map +1 -1
- package/dist/host-monitoring-platform.d.ts +18 -70
- package/dist/host-monitoring-platform.js +14 -269
- package/dist/host-monitoring-platform.js.map +1 -1
- package/dist/host-monitoring-process-identity.d.ts +8 -0
- package/dist/host-monitoring-process-identity.js +81 -0
- package/dist/host-monitoring-process-identity.js.map +1 -0
- package/dist/host-monitoring-runtime.d.ts +8 -0
- package/dist/host-monitoring-runtime.js +18 -3
- package/dist/host-monitoring-runtime.js.map +1 -1
- package/dist/host-monitoring.d.ts +15 -0
- package/dist/host-monitoring.js.map +1 -1
- package/dist/hub/agent-catalog-model.d.ts +21 -0
- package/dist/hub/agent-catalog-model.js +9 -1
- package/dist/hub/agent-catalog-model.js.map +1 -1
- package/dist/hub/agent-catalog.d.ts +4 -1
- package/dist/hub/agent-catalog.js +11 -0
- package/dist/hub/agent-catalog.js.map +1 -1
- package/dist/hub/catalog.js +12 -0
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.js +4 -1
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +5 -0
- package/dist/hub/compose/member.js +25 -5
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +2 -0
- package/dist/hub/compose/server.js +4 -2
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/http/compose.d.ts +5 -0
- package/dist/hub/http/compose.js +25 -2
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/deps.d.ts +2 -0
- package/dist/hub/http/schema.js +4 -0
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/lapse-carry.d.ts +45 -0
- package/dist/hub/lapse-carry.js +62 -0
- package/dist/hub/lapse-carry.js.map +1 -0
- package/dist/hub/member/agent-catalog.d.ts +4 -1
- package/dist/hub/member/agent-catalog.js +15 -4
- package/dist/hub/member/agent-catalog.js.map +1 -1
- package/dist/hub/member/agent-intro.d.ts +4 -3
- package/dist/hub/member/agent-intro.js +7 -0
- package/dist/hub/member/agent-intro.js.map +1 -1
- package/dist/hub/member/exposure-api.d.ts +2 -0
- package/dist/hub/member/exposure-api.js +8 -1
- package/dist/hub/member/exposure-api.js.map +1 -1
- package/dist/hub/member/room-post.d.ts +34 -6
- package/dist/hub/member/room-post.js +30 -0
- package/dist/hub/member/room-post.js.map +1 -1
- package/dist/hub/member/sharing.d.ts +2 -0
- package/dist/hub/member/sharing.js +9 -2
- package/dist/hub/member/sharing.js.map +1 -1
- package/dist/hub/protocol.d.ts +2 -0
- package/dist/hub/room-brief-model.js +2 -1
- package/dist/hub/room-brief-model.js.map +1 -1
- package/dist/hub/rooms/agents.d.ts +2 -0
- package/dist/hub/rooms/agents.js +16 -2
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/office.d.ts +82 -0
- package/dist/hub/rooms/office.js +46 -0
- package/dist/hub/rooms/office.js.map +1 -0
- package/dist/hub/rooms/service.d.ts +66 -1
- package/dist/hub/rooms/service.js +67 -11
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +4 -0
- package/dist/hub/runtime.d.ts +1 -1
- package/dist/hub/server.js +9 -2
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/sharing-requests.d.ts +5 -2
- package/dist/hub/sharing-requests.js +19 -4
- package/dist/hub/sharing-requests.js.map +1 -1
- package/dist/instance-config-impact.js +1 -1
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.js +8 -9
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instruction-file-sizes.d.ts +46 -0
- package/dist/instruction-file-sizes.js +115 -0
- package/dist/instruction-file-sizes.js.map +1 -0
- package/dist/instructions.d.ts +35 -1
- package/dist/instructions.js +59 -33
- package/dist/instructions.js.map +1 -1
- package/dist/locale.js +16 -4
- package/dist/locale.js.map +1 -1
- package/dist/log-steps.d.ts +5 -0
- package/dist/log-steps.js +6 -2
- package/dist/log-steps.js.map +1 -1
- package/dist/memory-guidance.d.ts +5 -0
- package/dist/memory-guidance.js +14 -0
- package/dist/memory-guidance.js.map +1 -0
- package/dist/model-defaults.d.ts +5 -0
- package/dist/model-defaults.js +6 -0
- package/dist/model-defaults.js.map +1 -0
- package/dist/native-mcp.d.ts +2 -0
- package/dist/native-mcp.js +16 -6
- package/dist/native-mcp.js.map +1 -1
- package/dist/needs-you-hub.d.ts +3 -0
- package/dist/needs-you-hub.js +7 -1
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +15 -2
- package/dist/needs-you.js +6 -0
- package/dist/needs-you.js.map +1 -1
- package/dist/outbound-handlers.d.ts +3 -3
- package/dist/outbound-schemas.d.ts +3 -0
- package/dist/outbound-schemas.js +27 -26
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/public-web-gateway.js +7 -1
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/quickstart.d.ts +1 -1
- package/dist/quickstart.js +2 -3
- package/dist/quickstart.js.map +1 -1
- package/dist/remote-card-prompt.d.ts +1 -0
- package/dist/remote-card-prompt.js +1 -1
- package/dist/remote-card-prompt.js.map +1 -1
- package/dist/runtime-build-info.js +1 -1
- package/dist/runtime-build-info.js.map +1 -1
- package/dist/runtime-cli-install.js +9 -9
- package/dist/runtime-cli-install.js.map +1 -1
- package/dist/runtime-pane-mcp.js +7 -3
- package/dist/runtime-pane-mcp.js.map +1 -1
- package/dist/runtime-pane-native.js +2 -1
- package/dist/runtime-pane-native.js.map +1 -1
- package/dist/scheduler/db.js +2 -0
- package/dist/scheduler/db.js.map +1 -1
- package/dist/scheduler/task-board-mentions.d.ts +32 -0
- package/dist/scheduler/task-board-mentions.js +97 -0
- package/dist/scheduler/task-board-mentions.js.map +1 -0
- package/dist/scheduler/task-board-text.js +3 -0
- package/dist/scheduler/task-board-text.js.map +1 -1
- package/dist/scheduler/task-board.d.ts +199 -3
- package/dist/scheduler/task-board.js +492 -7
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/settings-api.d.ts +5 -1
- package/dist/settings-api.js +77 -2
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.js +5 -4
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-change.js +4 -2
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.d.ts +2 -0
- package/dist/settings-effect.js +20 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-instance-patch.js +3 -1
- package/dist/settings-instance-patch.js.map +1 -1
- package/dist/setup-host.d.ts +2 -3
- package/dist/setup-host.js +3 -5
- package/dist/setup-host.js.map +1 -1
- package/dist/setup-wizard.js +0 -2
- package/dist/setup-wizard.js.map +1 -1
- package/dist/shared-default-adoption.d.ts +24 -0
- package/dist/shared-default-adoption.js +73 -0
- package/dist/shared-default-adoption.js.map +1 -0
- package/dist/subagent-records.d.ts +2 -0
- package/dist/subagent-records.js +11 -1
- package/dist/subagent-records.js.map +1 -1
- package/dist/subagent-service.d.ts +3 -0
- package/dist/subagent-service.js +24 -4
- package/dist/subagent-service.js.map +1 -1
- package/dist/task-board-tool.d.ts +31 -0
- package/dist/task-board-tool.js +31 -0
- package/dist/task-board-tool.js.map +1 -1
- package/dist/task-board-waker.d.ts +23 -30
- package/dist/task-board-waker.js +136 -97
- package/dist/task-board-waker.js.map +1 -1
- package/dist/topic-commands.js +4 -0
- package/dist/topic-commands.js.map +1 -1
- package/dist/types.d.ts +23 -0
- package/dist/ui/agent-details-settings.js +2 -2
- package/dist/ui/agent-export-dialog.js +4 -3
- package/dist/ui/agent-export-strings.js +4 -4
- package/dist/ui/agent-page-strings.js +18 -0
- package/dist/ui/chat-activity-groups.js +1 -1
- package/dist/ui/chat-activity.js +17 -0
- package/dist/ui/chat-store.js +34 -8
- package/dist/ui/chat-task-ref-strings.js +24 -0
- package/dist/ui/chat-task-refs.js +129 -0
- package/dist/ui/claude-setup-token.js +3 -3
- package/dist/ui/contact-auth-strings.js +33 -3
- package/dist/ui/contact-authorizations.js +17 -24
- package/dist/ui/contact-grant-editor.js +50 -0
- package/dist/ui/contact-permissions.js +21 -8
- package/dist/ui/fleet-office-card.js +18 -14
- package/dist/ui/fleet-office.js +29 -17
- package/dist/ui/fleet-task-activity.js +362 -0
- package/dist/ui/fleet-task-card.js +317 -314
- package/dist/ui/fleet-task-common.js +99 -9
- package/dist/ui/fleet-task-create.js +67 -0
- package/dist/ui/fleet-task-edit.js +204 -0
- package/dist/ui/fleet-task-follow.js +123 -0
- package/dist/ui/fleet-task-menu.js +1 -1
- package/dist/ui/fleet-task-owner.js +252 -0
- package/dist/ui/fleet-task-run.js +257 -0
- package/dist/ui/fleet-task-view.js +178 -39
- package/dist/ui/fleet-task-work.js +2 -2
- package/dist/ui/fleet-tasks.js +258 -130
- package/dist/ui/host-alerts.js +23 -0
- package/dist/ui/host-footprint.js +17 -0
- package/dist/ui/host-health.js +24 -16
- package/dist/ui/host-monitoring-darwin.js +6 -0
- package/dist/ui/host-monitoring-help.js +7 -0
- package/dist/ui/host-monitoring-linux.js +6 -0
- package/dist/ui/host-monitoring-wsl.js +6 -0
- package/dist/ui/host-time.js +5 -0
- package/dist/ui/hub-agent-copy.js +2 -0
- package/dist/ui/hub-client.js +4 -0
- package/dist/ui/hub-my-agents-strings.js +2 -0
- package/dist/ui/hub-my-agents.js +17 -1
- package/dist/ui/hub-room-composer.js +108 -5
- package/dist/ui/hub-room-members-strings.js +9 -2
- package/dist/ui/hub-room-members.js +72 -15
- package/dist/ui/hub-room-office.js +191 -0
- package/dist/ui/hub-room-purpose.js +18 -2
- package/dist/ui/hub-room-settings.js +8 -1
- package/dist/ui/hub-room-strings.js +15 -0
- package/dist/ui/hub-room-thread.js +51 -15
- package/dist/ui/hub-strings.js +1 -1
- package/dist/ui/log-row.js +7 -5
- package/dist/ui/native-instance-settings.js +4 -2
- package/dist/ui/panel-chat.js +98 -17
- package/dist/ui/panel-details.js +17 -0
- package/dist/ui/panel-fleet.js +1 -1
- package/dist/ui/panel-hub.js +4 -1
- package/dist/ui/panel-needs.js +38 -18
- package/dist/ui/panel-settings.js +58 -13
- package/dist/ui/settings-apply.js +8 -3
- package/dist/ui/settings-default-model-scope.js +40 -0
- package/dist/ui/settings-default-model-strings.js +43 -0
- package/dist/ui/settings-dialogs.js +9 -5
- package/dist/ui/settings-host-alerts.js +23 -0
- package/dist/ui/settings-host-monitoring.js +10 -8
- package/dist/ui/settings-hub.js +1 -1
- package/dist/ui/settings-layout.js +7 -2
- package/dist/ui/settings-model.js +9 -5
- package/dist/ui/settings-quota-notice.js +3 -3
- package/dist/ui/settings-registry.js +3 -0
- package/dist/ui/settings-shared-strings.js +22 -0
- package/dist/ui/settings-shared.js +59 -12
- package/dist/ui/settings-strings.js +2 -4
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app.css +169 -50
- package/dist/ui/shared/chat-composer.js +7 -6
- package/dist/ui/shared/chat-render.js +63 -10
- package/dist/ui/shared/chat-strings.js +2 -2
- package/dist/ui/shared/chat-thread.js +10 -3
- package/dist/ui/shared/composer-focus.js +21 -0
- package/dist/ui/shared/hub-chat.css +30 -2
- package/dist/ui/shared/hub-rooms-u2.css +17 -0
- package/dist/ui/shared/task-board.css +406 -8
- package/dist/ui/trigger-complete.js +71 -0
- package/dist/web-api.d.ts +11 -1
- package/dist/web-api.js +324 -18
- package/dist/web-api.js.map +1 -1
- package/dist/web-chat-history.d.ts +40 -1
- package/dist/web-chat-history.js +131 -9
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-guest-access.js +4 -4
- package/dist/web-guest-access.js.map +1 -1
- package/dist/web-upload.d.ts +1 -1
- package/dist/web-upload.js.map +1 -1
- package/dist/windows-native-mcp.js +5 -2
- package/dist/windows-native-mcp.js.map +1 -1
- package/dist/workflow-templates/default.md +4 -6
- package/package.json +1 -1
|
@@ -1,71 +1,102 @@
|
|
|
1
|
-
// One card of the task board (Fleet › Tasks)
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
|
|
1
|
+
// One card of the task board (Fleet › Tasks) as a page of its own: the main column holds what
|
|
2
|
+
// the card says (title, goal, scope, definition of done, context — a field nobody filled in is folded into a small "+ Add"
|
|
3
|
+
// button, not an empty block), what its agent wrote and does (state, result and the activity, one block: a single line while
|
|
4
|
+
// there is nothing to show), the sub tasks (a bordered list with its progress and a line to add one) and the card's activity —
|
|
5
|
+
// comments, progress log and history as one timeline, the comment box last. The side column holds the properties in three
|
|
6
|
+
// groups, each a chip that opens a menu (the choice saves at once). On a phone it is one column: title, spec, agent line,
|
|
7
|
+
// sub tasks, properties, activity. The card has an address of its own (`?card=M-3`, see fleet-tasks.js), so Back returns to
|
|
8
|
+
// the board or the list it was opened from.
|
|
9
|
+
// Edits carry the version they started from, so saving over an agent's newer write is caught (409): the page then shows
|
|
10
|
+
// the newer card with the draft still open, and saving again overwrites on purpose (fleet-task-edit.js).
|
|
11
|
+
import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
6
12
|
import { t, register } from "/assets/app-i18n.js";
|
|
7
13
|
import { appStore, useStore } from "/assets/app-store.js";
|
|
8
|
-
import {
|
|
14
|
+
import { Empty, Skeleton } from "/assets/ui-states.js";
|
|
9
15
|
import { Icon } from "/assets/ui-icons.js";
|
|
16
|
+
import { Menu } from "/assets/ui-menu.js";
|
|
10
17
|
import { toast } from "/assets/ui-toast.js";
|
|
11
|
-
import {
|
|
12
|
-
import { StepButtons } from "./fleet-task-menu.js";
|
|
18
|
+
import { ProgressBar, StatusPill, Who, answerBlocked, askText, boardApi, errorText, followsSubs, hiddenWaits, moveCard, notesForPeople, relTime, scrollBox, wrapUpText, COLUMNS } from "./fleet-task-common.js";
|
|
19
|
+
import { StepButtons, movesFor } from "./fleet-task-menu.js";
|
|
20
|
+
import { Checklist, EditableText, InlineTitle, PropChip, QuickAdd } from "./fleet-task-edit.js";
|
|
21
|
+
import { Composer, Timeline } from "./fleet-task-activity.js";
|
|
22
|
+
import { AgentRun } from "./fleet-task-run.js";
|
|
23
|
+
import { LeaderRow, WatchersRow } from "./fleet-task-follow.js";
|
|
13
24
|
|
|
14
25
|
register("taskcard", {
|
|
15
26
|
en: {
|
|
16
27
|
loading: "Loading…", missing: "There is no card {0}", version: "v{0}", copyLink: "Copy this card's link", linkCopied: "Link copied",
|
|
17
28
|
conflict: "{0} changed while you were editing. The newer card is shown and your edit is still open — save again to overwrite it.",
|
|
18
|
-
|
|
19
|
-
reopen: "Reopen", cancelCard: "Cancel this card", confirmMain: "Confirm the main task",
|
|
20
|
-
assignee: "Assignee", nobody: "Unassigned", unassign: "
|
|
21
|
-
|
|
29
|
+
followsSubs: "It has sub tasks: its status follows them",
|
|
30
|
+
reopen: "Reopen", cancelCard: "Cancel this card", confirmMain: "Confirm the main task", moreActions: "More actions",
|
|
31
|
+
assignee: "Assignee", nobody: "Unassigned", unassign: "Unassigned", other: "Other…", otherTitle: "Assign to another instance", otherLabel: "The instance's name",
|
|
32
|
+
status: "Status", project: "Project", priority: "Priority", size: "Size", review: "Needs my confirmation", reviewBox: "Stop at review for my confirmation", reviewShort: "Stops at review",
|
|
22
33
|
reviewOn: "Stops at review for your confirmation", reviewOff: "Finishes without your confirmation",
|
|
23
34
|
parent: "Main task", deps: "Waits for", none: "None", edit: "Edit", depsTitle: "What {0} waits for", depsLabel: "Card numbers to finish first, separated by commas or spaces (empty: nothing)",
|
|
24
35
|
depWaiting: "Not done yet", depDone: "Done", opened: "Opened by {0} {1} · changed {2}",
|
|
25
36
|
blockedReason: "Blocked on", goal: "Goal", goalHint: "Why, and what done looks like", scope: "Scope", scopeHint: "In: … / Out: …",
|
|
26
37
|
definition: "Definition of done", acceptance: "Acceptance", context: "Context", contextHint: "Paths, related cards, decisions already made",
|
|
27
38
|
state: "State", stateHint: "Done / next / watch out (the assignee keeps it current)", result: "Result", resultHint: "Which files changed and how it was checked",
|
|
28
|
-
empty: "(empty — click to edit)", clickToEdit: "Click to edit",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
empty: "(empty — click to edit)", clickToEdit: "Click to edit", editHint: "Click away or Ctrl+Enter saves · Esc drops the change",
|
|
40
|
+
saving: "Saving…", notSaved: "Not saved — click away or press Ctrl+Enter to try again",
|
|
41
|
+
conflictInline: "This changed meanwhile. Overwrite it with your text?", overwrite: "Overwrite", discard: "Discard my change",
|
|
42
|
+
checklistEmpty: "(none yet — click to add)", editList: "Edit the list", onePerLine: "One per line; an item whose text changes is unchecked again · click away or Ctrl+Enter saves", items: "{0}/{1} items",
|
|
43
|
+
subs: "Sub tasks", quickAdd: "New sub task: type a title and press Enter (small work needs no split)",
|
|
44
|
+
activity: "Activity", activityShow: "Show", "show.all": "All", "show.comments": "Comments", "show.log": "Progress", "show.history": "History",
|
|
45
|
+
noActivity: "Nothing yet — a comment, a progress note or a change shows here", nothingHere: "Nothing of this kind yet",
|
|
46
|
+
rejectTag: "Sent back", approveTag: "Confirmed", commentTo: "Comment to {0} — @ names an instance (Ctrl+Enter sends)", commentHint: "Comment — @ names an instance (Ctrl+Enter sends)", send: "Send",
|
|
47
|
+
mentionList: "Instances to mention", boardOffShort: "task board off",
|
|
48
|
+
rowMoved: "changed status from {0} to {1}", rowAssigned: "changed assignee from {0} to {1}", activities: "{0} activities", activity1: "1 activity",
|
|
49
|
+
logTip: "A one-line work note an agent or member wrote down — not a comment",
|
|
50
|
+
evCreated: "opened it", evMoved: "{0} → {1}", evAuto: " (automatic)", evAssigned: "assignee {0} → {1}", evUpdated: "changed {0}", evCommented: "commented", evLogged: "log: {0}", evWatchers: "changed watchers: {0}",
|
|
34
51
|
fTitle: "title", fGoal: "goal", fScope: "scope", fContext: "context", fState: "state", fResult: "result", fBlockedReason: "blocked reason", fSize: "size",
|
|
35
52
|
fPriority: "priority", fNeedsReview: "needs review", fDependsOn: "dependencies", fAcceptance: "acceptance", fProjectId: "project",
|
|
36
|
-
position: "Position", moveUp: "Move up", moveDown: "Move down",
|
|
53
|
+
position: "Position", moveUp: "Move up", moveDown: "Move down", properties: "Properties", crumbs: "Where this card is", backBoard: "Back to the board", backList: "Back to the list",
|
|
37
54
|
dispatcher: "Dispatched by", dispatcherHint: "A blocked card's question goes to them first", dispatcherMe: "Me", dispatcherNone: "Nobody",
|
|
38
|
-
dispatcherPerson: "{0} (a person)",
|
|
55
|
+
dispatcherPerson: "{0} (a person)", fDispatcher: "dispatcher",
|
|
56
|
+
today: "Today", yesterday: "Yesterday", repeated: "The same, {0} times in a row",
|
|
57
|
+
groupCore: "Core", groupTeam: "Project and people", groupFlow: "Flow",
|
|
58
|
+
addGoal: "Add goal", addScope: "Add scope", addDefinition: "Add definition of done", addAcceptance: "Add acceptance", addContext: "Add context", addState: "Add state", addResult: "Add result",
|
|
59
|
+
subsDone: "{0} of {1} sub tasks done",
|
|
39
60
|
},
|
|
40
61
|
"zh-TW": {
|
|
41
62
|
loading: "載入中…", missing: "找不到 {0}", version: "v{0}", copyLink: "複製這張卡的連結", linkCopied: "已複製連結",
|
|
42
63
|
conflict: "{0} 在你編輯時被改過了。已載入最新內容,你的修改還在,再存一次就會覆蓋。",
|
|
43
|
-
|
|
44
|
-
reopen: "重新打開", cancelCard: "取消這張卡", confirmMain: "確認主任務",
|
|
45
|
-
assignee: "負責人", nobody: "沒人負責", unassign: "
|
|
46
|
-
|
|
64
|
+
followsSubs: "有子任務,狀態會跟著子任務自動變化",
|
|
65
|
+
reopen: "重新打開", cancelCard: "取消這張卡", confirmMain: "確認主任務", moreActions: "更多動作",
|
|
66
|
+
assignee: "負責人", nobody: "沒人負責", unassign: "沒人負責", other: "其他…", otherTitle: "指派給其他 Agent", otherLabel: "Agent 名稱",
|
|
67
|
+
status: "狀態", project: "專案", priority: "優先度", size: "大小", review: "待我確認", reviewBox: "做完要停在待確認,等我確認", reviewShort: "完成前停在待確認",
|
|
47
68
|
reviewOn: "做完會停在待確認,等你確認", reviewOff: "做完直接完成,不等你確認",
|
|
48
|
-
parent: "主任務", deps: "
|
|
49
|
-
depWaiting: "還沒完成", depDone: "已完成", opened: "{0}
|
|
69
|
+
parent: "主任務", deps: "相依卡片", none: "沒有", edit: "編輯", depsTitle: "{0} 的相依", depsLabel: "要先完成的卡號,用逗號或空白分開(留空=沒有相依)",
|
|
70
|
+
depWaiting: "還沒完成", depDone: "已完成", opened: "{0} 開的 · {1} · 最後更新 {2}",
|
|
50
71
|
blockedReason: "卡住原因", goal: "目標", goalHint: "為什麼做、做完是什麼樣子", scope: "範圍", scopeHint: "做:…/不做:…",
|
|
51
72
|
definition: "完成定義", acceptance: "驗收條件", context: "背景", contextHint: "檔案路徑、相關卡號、已經做的決定",
|
|
52
73
|
state: "目前狀態", stateHint: "已完成/下一步/注意(負責人會隨時覆寫)", result: "產出", resultHint: "改了哪些檔案、怎麼驗證",
|
|
53
|
-
empty: "(未填,點一下編輯)", clickToEdit: "點一下編輯",
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
74
|
+
empty: "(未填,點一下編輯)", clickToEdit: "點一下編輯", editHint: "點別處或按 Ctrl+Enter 儲存・Esc 放棄修改",
|
|
75
|
+
saving: "儲存中…", notSaved: "還沒存到 — 點別處或按 Ctrl+Enter 再試一次",
|
|
76
|
+
conflictInline: "這裡剛被別人改過。要用你的文字覆蓋嗎?", overwrite: "覆蓋", discard: "放棄我的修改",
|
|
77
|
+
checklistEmpty: "(還沒有,點一下新增)", editList: "編輯清單", onePerLine: "一行一項;改了文字的項目會變回沒勾・點別處或按 Ctrl+Enter 儲存", items: "{0}/{1} 項",
|
|
78
|
+
subs: "子任務", quickAdd: "新增子任務:輸入標題後按 Enter(小事可以不拆)",
|
|
79
|
+
activity: "動態", activityShow: "顯示", "show.all": "全部", "show.comments": "留言", "show.log": "進度", "show.history": "歷史",
|
|
80
|
+
noActivity: "還沒有動態 — 留言、進度紀錄與變更都會出現在這裡", nothingHere: "這類還沒有內容",
|
|
81
|
+
rejectTag: "退回", approveTag: "確認", commentTo: "留言給 {0} — 輸入 @ 可選 Agent(Ctrl+Enter 送出)", commentHint: "留言 — 輸入 @ 可選 Agent(Ctrl+Enter 送出)", send: "送出",
|
|
82
|
+
mentionList: "可提及的 Agent", boardOffShort: "任務板已關閉",
|
|
83
|
+
rowMoved: "把狀態從 {0} 改成 {1}", rowAssigned: "把負責人從 {0} 改成 {1}", activities: "{0} 項動態", activity1: "1 項動態",
|
|
84
|
+
logTip: "agent 或成員記下的一行工作紀錄,不是留言",
|
|
85
|
+
evCreated: "開卡", evMoved: "{0}→{1}", evAuto: "(自動)", evAssigned: "負責人 {0}→{1}", evUpdated: "修改{0}", evCommented: "留言", evLogged: "紀錄:{0}", evWatchers: "修改關注者:{0}",
|
|
59
86
|
fTitle: "標題", fGoal: "目標", fScope: "範圍", fContext: "背景", fState: "目前狀態", fResult: "產出", fBlockedReason: "卡住原因", fSize: "大小",
|
|
60
87
|
fPriority: "優先度", fNeedsReview: "需要確認", fDependsOn: "相依", fAcceptance: "驗收條件", fProjectId: "專案",
|
|
61
|
-
position: "位置", moveUp: "往上移", moveDown: "往下移",
|
|
88
|
+
position: "位置", moveUp: "往上移", moveDown: "往下移", properties: "屬性", crumbs: "這張卡的位置", backBoard: "回到看板", backList: "回到清單",
|
|
62
89
|
dispatcher: "派工", dispatcherHint: "卡住要決定的事會先通知派工者", dispatcherMe: "我", dispatcherNone: "(沒有)",
|
|
63
|
-
dispatcherPerson: "{0}(人)",
|
|
90
|
+
dispatcherPerson: "{0}(人)", fDispatcher: "派工者",
|
|
91
|
+
today: "今天", yesterday: "昨天", repeated: "連續 {0} 次相同",
|
|
92
|
+
groupCore: "核心狀態", groupTeam: "專案與協作", groupFlow: "流程控制",
|
|
93
|
+
addGoal: "新增目標", addScope: "新增範圍", addDefinition: "完成定義", addAcceptance: "驗收條件", addContext: "補充背景", addState: "目前狀態", addResult: "產出",
|
|
94
|
+
subsDone: "{0}/{1} 個子任務已完成",
|
|
64
95
|
},
|
|
65
96
|
});
|
|
66
97
|
|
|
67
|
-
const MOVES = ["open", "claimed", "blocked", "review", "done"];
|
|
68
98
|
const LIMIT = { title: 100, goal: 300, scope: 600, context: 1000, state: 500, result: 1000, blockedReason: 400, acceptanceItems: 10 };
|
|
99
|
+
const PRIORITY_CHOICES = ["urgent", "high", "normal", "low"];
|
|
69
100
|
|
|
70
101
|
/** One history line, without who and when. */
|
|
71
102
|
export function describeEvent(ev) {
|
|
@@ -76,29 +107,102 @@ export function describeEvent(ev) {
|
|
|
76
107
|
case "assigned": return t("taskcard.evAssigned", d.from || "—", d.to || "—");
|
|
77
108
|
case "updated": return t("taskcard.evUpdated", Object.keys(d.changes || {}).map((k) => fieldName(k)).join(", "));
|
|
78
109
|
case "commented": return t("taskcard.evCommented");
|
|
79
|
-
case "logged": return t("taskcard.evLogged", d.text || "");
|
|
110
|
+
case "logged": return d.watchers ? t("taskcard.evWatchers", watcherChange(d)) : t("taskcard.evLogged", d.text || "");
|
|
80
111
|
default: return ev.type;
|
|
81
112
|
}
|
|
82
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* A history line as the activity stream's thin row says it, without who and when: a sentence the name leads —
|
|
116
|
+
* "dev-a changed status from To do to In progress" — for a move and a change of assignee; every other line as `describeEvent`.
|
|
117
|
+
*/
|
|
118
|
+
export function describeRow(ev) {
|
|
119
|
+
const d = ev.data || {};
|
|
120
|
+
if (ev.type === "moved") return `${t("taskcard.rowMoved", t(`tasks.${d.from}`), t(`tasks.${d.to}`))}${d.auto ? t("taskcard.evAuto") : ""}${d.reason ? `: ${d.reason}` : ""}`;
|
|
121
|
+
if (ev.type === "assigned") return t("taskcard.rowAssigned", d.from || "—", d.to || "—");
|
|
122
|
+
return describeEvent(ev);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* A watcher change as the board wrote it (`data.watchers`: { added, removed }): "+ops, −dev-b" — the true minus sign, not a hyphen,
|
|
126
|
+
* so a narrow line never breaks between the sign and the name; the event's own text when the lists are not there.
|
|
127
|
+
*/
|
|
128
|
+
const watcherChange = (d) => {
|
|
129
|
+
const w = d.watchers || {};
|
|
130
|
+
const names = (list) => (Array.isArray(list) ? list.filter((n) => typeof n === "string") : []);
|
|
131
|
+
const parts = [...names(w.added).map((n) => `+${n}`), ...names(w.removed).map((n) => `\u2212${n}`)];
|
|
132
|
+
return parts.length ? parts.join(", ") : String(d.text || "").replace(/^watchers:\s*/, "");
|
|
133
|
+
};
|
|
83
134
|
const fieldName = (k) => { const key = `taskcard.f${k[0].toUpperCase()}${k.slice(1)}`; const s = t(key); return s === key ? k : s; };
|
|
84
135
|
|
|
136
|
+
// ── What each chip offers (pure: tests import these) ────────
|
|
137
|
+
|
|
85
138
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* this one is among them (null: nowhere to step).
|
|
139
|
+
* The statuses a card's chip lists: every column, the card's own ticked; those a person may not move it to by hand (a
|
|
140
|
+
* main task that follows its sub tasks) are listed too, disabled and saying why — `act(to)` runs a choice.
|
|
89
141
|
*/
|
|
90
|
-
export function
|
|
142
|
+
export function statusItems(card, act) {
|
|
143
|
+
if (card.status === "cancelled") return [];
|
|
144
|
+
const allowed = movesFor(card);
|
|
145
|
+
return COLUMNS.map((to) => ({
|
|
146
|
+
key: to, label: t(`tasks.${to}`), checked: to === card.status, disabled: to !== card.status && !allowed.includes(to),
|
|
147
|
+
title: to !== card.status && !allowed.includes(to) ? t("tasks.derivedMove") : undefined, onSelect: () => act(to),
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** Who a card can go to: nobody, each instance (one with the board off is listed, disabled), and Other… for any name. */
|
|
152
|
+
export function assigneeItems(card, names, boardOff, act) {
|
|
153
|
+
const all = [...new Set([...names, card.assignee].filter(Boolean))].sort((a, b) => a.localeCompare(b));
|
|
154
|
+
return [
|
|
155
|
+
{ key: "none", label: t("taskcard.unassign"), checked: !card.assignee, onSelect: () => act(null) },
|
|
156
|
+
...all.map((n) => {
|
|
157
|
+
const off = boardOff.includes(n) && n !== card.assignee;
|
|
158
|
+
return { key: `n:${n}`, label: off ? t("tasks.boardOff", n) : n, checked: card.assignee === n, disabled: off, title: off ? t("tasks.boardOffHint") : undefined, onSelect: () => act(n) };
|
|
159
|
+
}),
|
|
160
|
+
{ key: "other", label: t("taskcard.other"), onSelect: () => act("\u0000other") },
|
|
161
|
+
];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** Who dispatched a card: a person (the one at the page), nobody, or an instance. */
|
|
165
|
+
export function dispatcherItems(card, names, act) {
|
|
166
|
+
const d = card.dispatcher;
|
|
167
|
+
const isMe = !!d && d.kind === "person", isNone = !d;
|
|
168
|
+
return [
|
|
169
|
+
{ key: "me", label: t("taskcard.dispatcherMe"), checked: isMe, onSelect: () => act("\u0000me") },
|
|
170
|
+
{ key: "none", label: t("taskcard.dispatcherNone"), checked: isNone, onSelect: () => act("\u0000none") },
|
|
171
|
+
...names.map((n) => ({ key: `n:${n}`, label: n, checked: !!d && d.kind === "instance" && d.name === n, onSelect: () => act(n) })),
|
|
172
|
+
];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** The value the page sends for a dispatcher choice. */
|
|
176
|
+
export const dispatcherValue = (v) => (v === "\u0000none" ? null : v === "\u0000me" ? { kind: "person" } : { kind: "instance", name: v });
|
|
177
|
+
|
|
178
|
+
const radioItems = (list, current, label, act) => list.map((v) => ({ key: String(v), label: label(v), checked: current === v, onSelect: () => act(v) }));
|
|
179
|
+
|
|
180
|
+
// ── The page ──────────────────────────────────────────────
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* `writable`: false over a read-only link (the card is shown, nothing on it changes). `place`: up and down in its column,
|
|
184
|
+
* for touch and keyboard (null when it cannot move). `steps`: the previous and next card the page showed, and where this
|
|
185
|
+
* one is among them (null: nowhere to step). `where`: the project's name for the breadcrumb (null: none). `back`: what
|
|
186
|
+
* Back says. `onBack` returns to the board or list. `doing`: how many cards each instance has in progress (fleet-task-run.js).
|
|
187
|
+
*/
|
|
188
|
+
export function CardPage({ id, tick, projects, cards = [], boardOff = [], doing = new Map(), writable = true, place = null, steps = null, where = null, back, onBack, onOpen, onStep, reloadBoard }) {
|
|
91
189
|
const { instances } = useStore(appStore);
|
|
92
190
|
const [detail, setDetail] = useState(null);
|
|
93
191
|
const [missing, setMissing] = useState(false);
|
|
94
|
-
const [tab, setTab] = useState("comments");
|
|
95
192
|
const seq = useRef(0);
|
|
193
|
+
const cardRef = useRef(null); // the card as last read: a chip's save sends its version, whatever was drawn since
|
|
194
|
+
const chain = useRef(Promise.resolve()); // saves go one after another, each on the version the one before left
|
|
195
|
+
// The empty fields a person opened with their "+ Add" button, for this card (another card starts with none).
|
|
196
|
+
const [opened, setOpened] = useState({ id, keys: [] });
|
|
197
|
+
const openKeys = opened.id === id ? opened.keys : [];
|
|
198
|
+
const openField = (key) => setOpened((o) => ({ id, keys: [...(o.id === id ? o.keys : []).filter((k) => k !== key), key] }));
|
|
199
|
+
const closeField = (key) => setOpened((o) => (o.id === id && o.keys.includes(key) ? { id, keys: o.keys.filter((k) => k !== key) } : o));
|
|
96
200
|
|
|
97
201
|
async function load() {
|
|
98
202
|
const mine = ++seq.current;
|
|
99
203
|
try {
|
|
100
204
|
const d = await boardApi.card(id);
|
|
101
|
-
if (mine === seq.current) { setDetail(d); setMissing(false); }
|
|
205
|
+
if (mine === seq.current) { cardRef.current = d.card; setDetail(d); setMissing(false); }
|
|
102
206
|
} catch (err) {
|
|
103
207
|
if (mine !== seq.current) return;
|
|
104
208
|
if (err.status === 404 || err.status === 400) setMissing(true);
|
|
@@ -106,23 +210,52 @@ export function CardDialog({ id, tick, projects, boardOff = [], writable = true,
|
|
|
106
210
|
}
|
|
107
211
|
}
|
|
108
212
|
useEffect(() => { void load(); }, [id, tick]);
|
|
213
|
+
// The page takes the keyboard's place from the tile or row that opened it (once per card: later reads leave the focus be).
|
|
214
|
+
const head = useRef(null);
|
|
215
|
+
const focused = useRef(null);
|
|
216
|
+
useEffect(() => {
|
|
217
|
+
if (!detail || focused.current === id) return;
|
|
218
|
+
focused.current = id;
|
|
219
|
+
try { head.current?.focus({ preventScroll: true }); } catch { /* no focus API */ }
|
|
220
|
+
}, [detail, id]);
|
|
221
|
+
// A card's page starts at its top (the panel it sits in keeps its scroll from the board or the card before).
|
|
222
|
+
const root = useRef(null);
|
|
223
|
+
useEffect(() => { const box = scrollBox(root.current); if (box) box.scrollTop = 0; }, [id]);
|
|
109
224
|
|
|
110
|
-
|
|
111
|
-
|
|
225
|
+
// Esc goes back to the board — unless a box, a menu or a dialog has it.
|
|
226
|
+
useEffect(() => {
|
|
227
|
+
const onKey = (e) => {
|
|
228
|
+
if (e.key !== "Escape" || e.defaultPrevented) return;
|
|
229
|
+
const el = e.target;
|
|
230
|
+
if (el && typeof el.closest === "function" && (el.closest("dialog, [role=menu], [role=listbox]") || /^(INPUT|TEXTAREA|SELECT)$/.test(el.tagName || "") || el.isContentEditable)) return;
|
|
231
|
+
onBack();
|
|
232
|
+
};
|
|
233
|
+
document.addEventListener("keydown", onKey);
|
|
234
|
+
return () => document.removeEventListener("keydown", onKey);
|
|
235
|
+
}, [onBack]);
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* A write and what follows: its notes, the card and the board read again. Resolves "ok", "conflict" or "error" — or, with
|
|
239
|
+
* `detail`, `{ outcome, version }`, where `version` is the one the write's own answer gave the card (an edit kept open after
|
|
240
|
+
* its save is pinned to it).
|
|
241
|
+
*/
|
|
242
|
+
async function run(fn, detail = false) {
|
|
243
|
+
const done = (outcome, version) => (detail ? { outcome, version } : outcome);
|
|
112
244
|
try {
|
|
113
245
|
const r = await fn();
|
|
246
|
+
const written = r && r.card && typeof r.card.version === "number" ? r.card.version : undefined;
|
|
114
247
|
for (const n of notesForPeople(r && r.notes)) toast(n);
|
|
115
248
|
await load();
|
|
116
249
|
reloadBoard();
|
|
117
|
-
return "ok";
|
|
250
|
+
return done("ok", written);
|
|
118
251
|
} catch (err) {
|
|
119
252
|
const conflict = err.status === 409;
|
|
120
253
|
toast(conflict ? t("taskcard.conflict", id) : errorText(err), false);
|
|
121
254
|
if (conflict) await load();
|
|
122
|
-
return conflict ? "conflict" : "error";
|
|
255
|
+
return done(conflict ? "conflict" : "error");
|
|
123
256
|
}
|
|
124
257
|
}
|
|
125
|
-
/** A move from this
|
|
258
|
+
/** A move from this page: one at a time (claimed before the first await), then the card and the board read again. */
|
|
126
259
|
const moving = useRef(false);
|
|
127
260
|
const [busy, setBusy] = useState(false);
|
|
128
261
|
async function moved(start) {
|
|
@@ -133,19 +266,37 @@ export function CardDialog({ id, tick, projects, boardOff = [], writable = true,
|
|
|
133
266
|
finally { moving.current = false; setBusy(false); }
|
|
134
267
|
}
|
|
135
268
|
|
|
136
|
-
// Previous / Next: the page's cards (fleet-task-menu.js),
|
|
137
|
-
const tools = steps ? html`<${StepButtons} steps=${steps} onOpen=${onOpen} />` : null;
|
|
269
|
+
// Previous / Next: the page's cards (fleet-task-menu.js), from the first frame (no jump once the card loads).
|
|
270
|
+
const tools = steps ? html`<${StepButtons} steps=${steps} onOpen=${onStep || onOpen} />` : null;
|
|
271
|
+
const bar = (card) => html`<div class="tp-bar">
|
|
272
|
+
<button type="button" class="btn btn-ghost btn-sm tp-back" onClick=${onBack}><${Icon} name="back" size=${16} />${back}</button>
|
|
273
|
+
<nav class="tp-crumbs" aria-label=${t("taskcard.crumbs")}>${where ? html`<span class="tp-crumb">${where}</span>` : null}
|
|
274
|
+
${card && card.parent ? html`<button type="button" class="tb-link tp-crumb" onClick=${() => onOpen(card.parent.id)}><span class="tb-code">${card.parent.id}</span> ${card.parent.title}</button>` : null}
|
|
275
|
+
<span class="tp-crumb tb-code">${id}</span></nav>
|
|
276
|
+
<span class="tp-tools">${tools}${card ? card.actions : null}</span>
|
|
277
|
+
</div>`;
|
|
138
278
|
if (missing || !detail) {
|
|
139
|
-
return html
|
|
279
|
+
return html`<div class="tp" ref=${root}>${bar(null)}${missing ? html`<${Empty} icon="tasks" title=${t("taskcard.missing", id)} />` : html`<${Skeleton} lines=${6} />`}</div>`;
|
|
140
280
|
}
|
|
141
281
|
|
|
142
282
|
const { card, parent, children } = detail;
|
|
143
283
|
const isMain = card.kind === "main";
|
|
144
284
|
const derived = followsSubs(card);
|
|
145
285
|
const finished = card.status === "done" || card.status === "cancelled";
|
|
146
|
-
/** `version` guards against overwriting a newer card; null skips it (text
|
|
147
|
-
const save = (patch, version
|
|
148
|
-
|
|
286
|
+
/** `version` guards against overwriting a newer card; null skips it (text sent over a conflict on purpose). */
|
|
287
|
+
const save = (patch, version) => {
|
|
288
|
+
const job = chain.current.then(() => run(() => boardApi.update(card.id, version === null ? patch : { ...patch, version: version === undefined ? (cardRef.current || card).version : version }), true));
|
|
289
|
+
chain.current = job.catch(() => {});
|
|
290
|
+
return job;
|
|
291
|
+
};
|
|
292
|
+
const names = [...new Set([...instances.map((i) => i.name), card.assignee].filter(Boolean))].sort((a, b) => a.localeCompare(b));
|
|
293
|
+
// Only the fleet's instances can be mentioned (an assignee that has left the fleet, or a person, would wake nobody); the
|
|
294
|
+
// card's assignee comes first.
|
|
295
|
+
const fleet = instances.map((i) => i.name);
|
|
296
|
+
const mentionNames = [...(fleet.includes(card.assignee) ? [card.assignee] : []), ...fleet.filter((n) => n !== card.assignee)].map((name) => ({ name, off: boardOff.includes(name) }));
|
|
297
|
+
|
|
298
|
+
/** Who watches the card: no version (a watch is not an edit of the card), the card and the board read again after. */
|
|
299
|
+
const follow = (change) => run(() => boardApi.watchers(card.id, change));
|
|
149
300
|
|
|
150
301
|
async function chooseAssignee(value) {
|
|
151
302
|
if (value === "\u0000other") {
|
|
@@ -153,10 +304,7 @@ export function CardDialog({ id, tick, projects, boardOff = [], writable = true,
|
|
|
153
304
|
if (name) await save({ assignee: name }, null);
|
|
154
305
|
return;
|
|
155
306
|
}
|
|
156
|
-
await save({ assignee: value
|
|
157
|
-
}
|
|
158
|
-
async function chooseDispatcher(value) {
|
|
159
|
-
await save({ dispatcher: value === "\u0000none" ? null : value === "\u0000me" ? { kind: "person" } : { kind: "instance", name: value } });
|
|
307
|
+
await save({ assignee: value });
|
|
160
308
|
}
|
|
161
309
|
async function editDeps() {
|
|
162
310
|
const text = await askText({ title: t("taskcard.depsTitle", card.id), label: t("taskcard.depsLabel"), initial: card.dependsOn.join(", ") });
|
|
@@ -169,272 +317,127 @@ export function CardDialog({ id, tick, projects, boardOff = [], writable = true,
|
|
|
169
317
|
void navigator.clipboard?.writeText(u.toString()).then(() => toast(t("taskcard.linkCopied")));
|
|
170
318
|
} catch { /* no clipboard */ }
|
|
171
319
|
}
|
|
320
|
+
const projectName = (pid) => (pid === null ? t("tasks.noProject") : (projects.find((p) => p.id === pid) || {}).name || "—");
|
|
321
|
+
const can = writable;
|
|
322
|
+
const row = (label, body, cls = "") => html`<div class=${`tp-row${cls ? ` ${cls}` : ""}`}><dt>${label}</dt><dd>${body}</dd></div>`;
|
|
323
|
+
const group = (key, title, rows) => html`<div class="tp-group" role="group" aria-labelledby=${`tpg-${key}`}><h4 class="tp-group-title" id=${`tpg-${key}`}>${title}</h4><dl class="tp-props">${rows}</dl></div>`;
|
|
172
324
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
325
|
+
// The header toolbar: Previous / Next (above), the link, Mark blocked (by hand: a main task that follows its sub tasks only) and ⋯.
|
|
326
|
+
const copyBtn = html`<button type="button" class="icon-btn" title=${t("taskcard.copyLink")} aria-label=${t("taskcard.copyLink")} onClick=${copyLink}><${Icon} name="copy" size=${16} /></button>`;
|
|
327
|
+
const blockBtn = can && derived && !finished && card.status !== "blocked"
|
|
328
|
+
? html`<button type="button" class="btn btn-sm tp-block-btn" disabled=${busy} onClick=${() => moved(() => moveCard(card, "blocked"))}>${t("tasks.block")}</button>` : null;
|
|
329
|
+
const more = can && !finished ? html`<${Menu} cls="tp-more" label=${t("taskcard.moreActions")} items=${[
|
|
330
|
+
{ key: "cancel", label: t("taskcard.cancelCard"), icon: "trash", danger: true, onSelect: () => void moved(() => moveCard(card, "cancelled")) },
|
|
331
|
+
]} />` : null;
|
|
180
332
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
333
|
+
// The text fields of the spec (goal, scope, definition of done, context) and of the agent's block (state, result): one
|
|
334
|
+
// that holds text is a field; an empty one is a "+ Add" button (a writer's way in) until it is opened, and folds back into
|
|
335
|
+
// its button when it is closed still empty. Over a read-only link an empty one is simply not there.
|
|
336
|
+
const textField = (key, field, title, hint, add, limit) => ({ key, title, add, has: !!card[field],
|
|
337
|
+
body: (open) => html`<${EditableText} readOnly=${!can} value=${card[field]} limit=${limit} version=${card.version} placeholder=${hint} open=${open} onClose=${() => closeField(key)}
|
|
338
|
+
onSave=${(v, base) => save({ [field]: v }, base)} />` });
|
|
339
|
+
const parts = (defs) => {
|
|
340
|
+
const shown = [], adders = [];
|
|
341
|
+
for (const d of defs) {
|
|
342
|
+
const isOpen = openKeys.includes(d.key);
|
|
343
|
+
if (d.has || isOpen) shown.push(html`<${Field} key=${d.key} title=${d.title}>${d.body(isOpen)}</${Field}>`);
|
|
344
|
+
else if (can) adders.push(html`<button key=${d.key} type="button" class="tp-add" data-add=${d.key} onClick=${() => openField(d.key)}><${Icon} name="plus" size=${14} />${t(d.add)}</button>`);
|
|
345
|
+
}
|
|
346
|
+
return { shown, adders };
|
|
347
|
+
};
|
|
348
|
+
const spec = parts([
|
|
349
|
+
textField("goal", "goal", t("taskcard.goal"), t("taskcard.goalHint"), "taskcard.addGoal", LIMIT.goal),
|
|
350
|
+
isMain ? textField("scope", "scope", t("taskcard.scope"), t("taskcard.scopeHint"), "taskcard.addScope", LIMIT.scope) : null,
|
|
351
|
+
{ key: "definition", title: isMain ? t("taskcard.definition") : t("taskcard.acceptance"), add: isMain ? "taskcard.addDefinition" : "taskcard.addAcceptance", has: card.acceptance.length > 0,
|
|
352
|
+
body: (open) => html`<${Checklist} card=${card} readOnly=${!can} limit=${LIMIT.acceptanceItems} open=${open} onClose=${() => closeField("definition")}
|
|
353
|
+
onToggle=${(n, done) => save(done ? { check: [n] } : { uncheck: [n] })} onReplace=${(items, base) => save({ acceptance: items }, base)} />` },
|
|
354
|
+
textField("context", "context", t("taskcard.context"), t("taskcard.contextHint"), "taskcard.addContext", LIMIT.context),
|
|
355
|
+
].filter(Boolean));
|
|
356
|
+
const handoff = parts([
|
|
357
|
+
textField("state", "state", t("taskcard.state"), t("taskcard.stateHint"), "taskcard.addState", LIMIT.state),
|
|
358
|
+
textField("result", "result", t("taskcard.result"), t("taskcard.resultHint"), "taskcard.addResult", LIMIT.result),
|
|
359
|
+
]);
|
|
199
360
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
if (!now) return html`<span class="muted">${card.status === "review" ? t("tasks.review") : t("taskcard.nowNone")}</span>`;
|
|
212
|
-
return now.cards.map((c) => html`<button key=${c.id} type="button" class="tc-now" onClick=${() => onOpen(c.id)} title=${c.title}>
|
|
213
|
-
<span class=${`tb-now-label st-${now.tone}`}>${t(now.label)}</span><span class="tb-code">${c.id}</span><span class="tc-child-title">${c.title}</span>
|
|
214
|
-
<${Who} name=${c.assignee} empty=${t("tasks.nobody")} /></button>`);
|
|
215
|
-
})()}</dd>` : null}
|
|
216
|
-
<dt>${t("taskcard.dispatcher")}</dt>
|
|
217
|
-
<dd><span class="tb-who" title=${t("taskcard.dispatcherHint")}>${!card.dispatcher ? t("taskcard.dispatcherNone")
|
|
218
|
-
: card.dispatcher.kind === "person" ? t("taskcard.dispatcherPerson", card.dispatcher.name) : card.dispatcher.name}</span>
|
|
219
|
-
${writable ? html`<select class="tb-select" value="\u0000pick" aria-label=${t("taskcard.dispatcher")} title=${t("taskcard.dispatcherHint")} onChange=${(e) => { const v = e.target.value; e.target.value = "\u0000pick"; void chooseDispatcher(v); }}>
|
|
220
|
-
<option value="\u0000pick" disabled hidden>${t("taskcard.change")}</option>
|
|
221
|
-
<option value="\u0000me">${t("taskcard.dispatcherMe")}</option>
|
|
222
|
-
${card.dispatcher ? html`<option value="\u0000none">${t("taskcard.dispatcherNone")}</option>` : null}
|
|
223
|
-
${names.filter((n) => !(card.dispatcher && card.dispatcher.kind === "instance" && card.dispatcher.name === n)).map((n) => html`<option key=${n} value=${n}>${n}</option>`)}
|
|
224
|
-
</select>` : null}</dd>
|
|
225
|
-
${isMain ? html`<dt>${t("taskcard.project")}</dt>
|
|
226
|
-
<dd>${writable ? html`<select class="tb-select" value=${card.projectId === null ? "" : String(card.projectId)} aria-label=${t("taskcard.project")}
|
|
227
|
-
onChange=${(e) => void save({ projectId: e.target.value === "" ? null : Number(e.target.value) })}>
|
|
228
|
-
<option value="">${t("tasks.noProject")}</option>
|
|
229
|
-
${projects.filter((p) => !p.archived || p.id === card.projectId).map((p) => html`<option key=${p.id} value=${String(p.id)}>${p.name}</option>`)}
|
|
230
|
-
</select>` : html`<span class="tc-value">${card.projectId === null ? t("tasks.noProject") : (projects.find((p) => p.id === card.projectId) || {}).name || "—"}</span>`}</dd>` : null}
|
|
231
|
-
<dt>${t("taskcard.priority")}</dt>
|
|
232
|
-
<dd>${writable ? html`<select class="tb-select" value=${card.priority} aria-label=${t("taskcard.priority")} onChange=${(e) => void save({ priority: e.target.value })}>
|
|
233
|
-
${["urgent", "high", "normal", "low"].map((p) => html`<option key=${p} value=${p}>${t(`tasks.${p}`)}</option>`)}</select>`
|
|
234
|
-
: html`<span class="tc-value">${t(`tasks.${card.priority}`)}</span>`}</dd>
|
|
235
|
-
<dt>${t("taskcard.size")}</dt>
|
|
236
|
-
<dd>${writable ? html`<select class="tb-select" value=${card.size || ""} aria-label=${t("taskcard.size")} onChange=${(e) => void save({ size: e.target.value || null })}>
|
|
237
|
-
<option value="">${t("tasks.sizeNone")}</option>${["S", "M", "L"].map((s) => html`<option key=${s} value=${s}>${t(`tasks.size${s}`)}</option>`)}</select>`
|
|
238
|
-
: html`<span class="tc-value">${card.size ? t(`tasks.size${card.size}`) : t("tasks.sizeNone")}</span>`}</dd>
|
|
239
|
-
<dt>${t("taskcard.review")}</dt>
|
|
240
|
-
<dd>${writable ? html`<label class="tb-check"><input type="checkbox" checked=${card.needsReview} onChange=${(e) => void save({ needsReview: e.target.checked })} />${t("taskcard.reviewBox")}</label>`
|
|
241
|
-
// #2299: read-only (the public link): the values as text, not controls that look usable and are not.
|
|
242
|
-
: html`<span class="tc-value">${t(card.needsReview ? "taskcard.reviewOn" : "taskcard.reviewOff")}</span>`}</dd>
|
|
243
|
-
${parent ? html`<dt>${t("taskcard.parent")}</dt><dd><button type="button" class="tb-link" onClick=${() => onOpen(parent.id)}><span class="tb-code">${parent.id}</span> ${parent.title}</button></dd>` : null}
|
|
244
|
-
<dt>${t("taskcard.deps")}</dt>
|
|
245
|
-
<dd>${card.dependsOn.length ? card.dependsOn.map((d) => html`<button key=${d} type="button" class=${`tc-dep${card.unmetDeps.includes(d) ? " waiting" : ""}`}
|
|
246
|
-
title=${card.unmetDeps.includes(d) ? t("taskcard.depWaiting") : t("taskcard.depDone")} onClick=${() => onOpen(d)}>${d}</button>`) : html`<span class="muted">${t("taskcard.none")}</span>`}
|
|
247
|
-
${writable ? html`<button type="button" class="btn btn-ghost btn-sm" onClick=${editDeps}>${t("taskcard.edit")}</button>` : null}</dd>
|
|
248
|
-
${place && (place.up || place.down) ? html`<dt>${t("taskcard.position")}</dt>
|
|
249
|
-
<dd><button type="button" class="btn btn-ghost btn-sm" disabled=${!place.up} aria-label=${t("taskcard.moveUp")} title=${t("taskcard.moveUp")} onClick=${place.up}><${Icon} name="up" size=${16} /></button>
|
|
250
|
-
<button type="button" class="btn btn-ghost btn-sm" disabled=${!place.down} aria-label=${t("taskcard.moveDown")} title=${t("taskcard.moveDown")} onClick=${place.down}><${Icon} name="down" size=${16} /></button></dd>` : null}
|
|
251
|
-
<dt></dt>
|
|
252
|
-
<dd class="muted">${t("taskcard.opened", card.createdBy, relTime(card.createdAt), relTime(card.updatedAt))}</dd>
|
|
253
|
-
</dl>
|
|
361
|
+
// The sub tasks: a bordered list — done / total and the bar on top, the sub tasks, a line to add one at the end.
|
|
362
|
+
const prog = card.progress && card.progress.total ? card.progress : null;
|
|
363
|
+
const subs = isMain ? html`<section class="tp-subs" aria-label=${t("taskcard.subs")}>
|
|
364
|
+
<h3>${t("taskcard.subs")}</h3>
|
|
365
|
+
<div class="tc-field-body">
|
|
366
|
+
${prog ? html`<div class="tp-subs-head"><span class="tp-subs-count" title=${t("taskcard.subsDone", prog.done, prog.total)}>${prog.done} / ${prog.total}</span><${ProgressBar} progress=${prog} wide /></div>` : null}
|
|
367
|
+
${children.length ? html`<ul class="tc-children">${children.map((c) => html`<li key=${c.id}><button type="button" onClick=${() => onOpen(c.id)}>
|
|
368
|
+
<${StatusPill} status=${c.status} card=${c} /><span class="tb-code">${c.id}</span><span class="tc-child-title">${c.title}</span><span class="tb-who">${c.assignee || ""}</span></button></li>`)}</ul>` : null}
|
|
369
|
+
${finished || !can ? null : html`<${QuickAdd} placeholder=${t("taskcard.quickAdd")} limit=${LIMIT.title} onAdd=${(title) => run(() => boardApi.create({ parent: card.id, title }))} />`}
|
|
370
|
+
</div>
|
|
371
|
+
</section>` : null;
|
|
254
372
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
373
|
+
return html`<div class="tp" ref=${root} data-card=${card.id}>
|
|
374
|
+
${bar({ parent, actions: html`${copyBtn}${blockBtn}${more}` })}
|
|
375
|
+
<div class="tp-grid">
|
|
376
|
+
<div class="tp-head">
|
|
377
|
+
<div class="tp-idrow"><span class="tb-code tp-code">${card.id}</span><${StatusPill} status=${card.status} card=${card} />
|
|
378
|
+
${derived && !finished ? html`<span class="tp-derived">${t("taskcard.followsSubs")}</span>` : null}</div>
|
|
379
|
+
<div class="tc-head" ref=${head} tabindex="-1" role="heading" aria-level="2">
|
|
380
|
+
${can ? html`<${InlineTitle} value=${card.title} version=${card.version} limit=${LIMIT.title} onSave=${(title, base) => save({ title }, base)} />` : html`<h2 class="tc-title">${card.title}</h2>`}
|
|
381
|
+
</div>
|
|
382
|
+
${can ? html`<div class="tc-actions">
|
|
383
|
+
${card.status === "review" ? html`
|
|
384
|
+
<button type="button" class="btn btn-primary btn-sm" disabled=${busy} onClick=${() => moved(() => moveCard(card, "done"))}><${Icon} name="check" size=${14} />${isMain ? t("taskcard.confirmMain") : t("tasks.confirm")}</button>
|
|
385
|
+
<button type="button" class="btn btn-sm" disabled=${busy} onClick=${() => moved(() => moveCard(card, "claimed"))}>${t("tasks.sendBack")}</button>
|
|
386
|
+
${wrapUpText(card) ? html`<span class="tc-hint wrapup">${t("tasks.wrapLine", wrapUpText(card))}</span>` : null}` : null}
|
|
387
|
+
${card.status === "blocked" ? html`<button type="button" class="btn btn-primary btn-sm" disabled=${busy} onClick=${() => moved(() => answerBlocked(card))}>${t("tasks.answer")}</button>` : null}
|
|
388
|
+
${finished ? html`<button type="button" class="btn btn-sm" disabled=${busy} onClick=${() => moved(() => moveCard(card, card.status === "done" ? "claimed" : "open"))}><${Icon} name="restart" size=${14} />${t("taskcard.reopen")}</button>` : null}
|
|
389
|
+
</div>` : null}
|
|
390
|
+
</div>
|
|
264
391
|
|
|
265
|
-
|
|
266
|
-
${
|
|
267
|
-
<${
|
|
268
|
-
${
|
|
269
|
-
|
|
392
|
+
<div class="tp-body">
|
|
393
|
+
${card.status === "blocked" ? html`<${Field} title=${t("taskcard.blockedReason")} tone="blocked">
|
|
394
|
+
<${EditableText} readOnly=${!can} value=${card.blockedReason} limit=${LIMIT.blockedReason} version=${card.version} onSave=${(v, base) => save({ blockedReason: v }, base)} /></${Field}>` : null}
|
|
395
|
+
${spec.shown.length ? html`<div class="tp-spec">${spec.shown}</div>` : null}
|
|
396
|
+
${spec.adders.length ? html`<div class="tp-adders">${spec.adders}</div>` : null}
|
|
397
|
+
<${AgentRun} card=${card} detail=${detail} doing=${doing} derived=${derived} shown=${handoff.shown} adders=${handoff.adders} />
|
|
398
|
+
${subs}
|
|
399
|
+
</div>
|
|
400
|
+
|
|
401
|
+
<aside class="card tp-side" aria-label=${t("taskcard.properties")}>
|
|
402
|
+
${group("core", t("taskcard.groupCore"), html`
|
|
403
|
+
${row(t("taskcard.status"), html`<${PropChip} label=${t("taskcard.status")} items=${can ? statusItems(card, (to) => moved(() => moveCard(card, to))) : null} value=${html`<${StatusPill} status=${card.status} card=${card} />`} />`)}
|
|
404
|
+
${row(t("taskcard.assignee"), html`<${PropChip} label=${t("taskcard.assignee")} items=${can && !finished ? assigneeItems(card, names, boardOff, chooseAssignee) : null} value=${html`<${Who} name=${card.assignee} empty=${t("taskcard.nobody")} />`} />`)}
|
|
405
|
+
${row(t("taskcard.priority"), html`<${PropChip} label=${t("taskcard.priority")} value=${html`<span class=${`tp-prio p-${card.priority}`}>${t(`tasks.${card.priority}`)}</span>`}
|
|
406
|
+
items=${can ? radioItems(PRIORITY_CHOICES, card.priority, (p) => t(`tasks.${p}`), (p) => save({ priority: p })) : null} />`)}
|
|
407
|
+
${row(t("taskcard.size"), html`<${PropChip} label=${t("taskcard.size")} value=${card.size ? t(`tasks.size${card.size}`) : t("tasks.sizeNone")}
|
|
408
|
+
items=${can ? [{ key: "none", label: t("tasks.sizeNone"), checked: !card.size, onSelect: () => save({ size: null }) }, ...radioItems(["S", "M", "L"], card.size, (s) => t(`tasks.size${s}`), (s) => save({ size: s }))] : null} />`)}`)}
|
|
409
|
+
${group("team", t("taskcard.groupTeam"), html`
|
|
410
|
+
${isMain ? row(t("taskcard.project"), html`<${PropChip} label=${t("taskcard.project")} value=${projectName(card.projectId)}
|
|
411
|
+
items=${can ? [{ key: "none", label: t("tasks.noProject"), checked: card.projectId === null, onSelect: () => save({ projectId: null }) },
|
|
412
|
+
...projects.filter((p) => !p.archived || p.id === card.projectId).map((p) => ({ key: String(p.id), label: p.name, checked: card.projectId === p.id, onSelect: () => save({ projectId: p.id }) }))] : null} />`) : null}
|
|
413
|
+
${parent ? row(t("taskcard.parent"), html`<button type="button" class="tb-link" onClick=${() => onOpen(parent.id)}><span class="tb-code">${parent.id}</span> ${parent.title}</button>`) : null}
|
|
414
|
+
<${LeaderRow} detail=${detail} names=${fleet} boardOff=${boardOff} can=${can} follow=${follow} />
|
|
415
|
+
${row(t("taskcard.dispatcher"), html`<${PropChip} label=${t("taskcard.dispatcher")} items=${can ? dispatcherItems(card, names, (v) => save({ dispatcher: dispatcherValue(v) })) : null}
|
|
416
|
+
value=${html`<span class="tb-who" title=${t("taskcard.dispatcherHint")}>${!card.dispatcher ? t("taskcard.dispatcherNone") : card.dispatcher.kind === "person" ? t("taskcard.dispatcherPerson", card.dispatcher.name) : card.dispatcher.name}</span>`} />`)}
|
|
417
|
+
<${WatchersRow} detail=${detail} names=${fleet} boardOff=${boardOff} can=${can} follow=${follow} />`)}
|
|
418
|
+
${group("flow", t("taskcard.groupFlow"), html`
|
|
419
|
+
${row(t("taskcard.review"), can ? html`<label class="tp-switch"><input type="checkbox" role="switch" class="s-ui-toggle" aria-label=${t("taskcard.reviewBox")} checked=${card.needsReview} onChange=${(e) => void save({ needsReview: e.target.checked })} /><span class="tc-hint muted">${t("taskcard.reviewShort")}</span></label>`
|
|
420
|
+
// #2299: read-only: the values as text, not controls that look usable and are not.
|
|
421
|
+
: html`<span class="tc-value">${t(card.needsReview ? "taskcard.reviewOn" : "taskcard.reviewOff")}</span>`, can ? "" : "tp-block")}
|
|
422
|
+
${row(t("taskcard.deps"), html`${card.dependsOn.length ? card.dependsOn.map((d) => html`<button key=${d} type="button" class=${`tc-dep${card.unmetDeps.includes(d) ? " waiting" : ""}`}
|
|
423
|
+
title=${card.unmetDeps.includes(d) ? t("taskcard.depWaiting") : t("taskcard.depDone")} onClick=${() => onOpen(d)}>${d}</button>`) : hiddenWaits(card) ? null : html`<span class="muted">${t("taskcard.none")}</span>`}
|
|
424
|
+
${hiddenWaits(card) ? html`<span class="muted" title=${t("taskcard.depWaiting")}>${hiddenWaits(card)}</span>` : null}
|
|
425
|
+
${can ? html`<button type="button" class="btn btn-ghost btn-sm" onClick=${editDeps}>${t("taskcard.edit")}</button>` : null}`)}
|
|
426
|
+
${place && (place.up || place.down) ? row(t("taskcard.position"), html`<button type="button" class="btn btn-ghost btn-sm" disabled=${!place.up} aria-label=${t("taskcard.moveUp")} title=${t("taskcard.moveUp")} onClick=${place.up}><${Icon} name="up" size=${16} /></button>
|
|
427
|
+
<button type="button" class="btn btn-ghost btn-sm" disabled=${!place.down} aria-label=${t("taskcard.moveDown")} title=${t("taskcard.moveDown")} onClick=${place.down}><${Icon} name="down" size=${16} /></button>`) : null}`)}
|
|
428
|
+
<p class="muted tp-opened">${t("taskcard.opened", card.createdBy, relTime(card.createdAt), relTime(card.updatedAt))} · ${t("taskcard.version", card.version)}</p>
|
|
429
|
+
</aside>
|
|
270
430
|
|
|
271
|
-
<div class="
|
|
272
|
-
|
|
273
|
-
|
|
431
|
+
<div class="tp-activity">
|
|
432
|
+
<${Timeline} detail=${detail} describe=${describeRow} cards=${cards} lead=${((projects || []).find((x) => x.id === card.projectId) || {}).leadInstance || null} />
|
|
433
|
+
${can ? html`<${Composer} names=${mentionNames} assignee=${card.assignee} placeholder=${card.assignee ? t("taskcard.commentTo", card.assignee) : t("taskcard.commentHint")}
|
|
434
|
+
onSend=${(text) => run(() => boardApi.update(card.id, { comment: text }))} />` : null}
|
|
274
435
|
</div>
|
|
275
|
-
${tab === "comments" ? html`<${Comments} entries=${detail.comments} card=${card} writable=${writable} onSend=${(text) => run(() => boardApi.update(card.id, { comment: text }))} />` : null}
|
|
276
|
-
${tab === "log" ? html`<ul class="tc-feed">${detail.logs.length ? detail.logs.map((e) => html`<li key=${e.id}><span class="muted">${relTime(e.at)}</span> <b>${e.author}</b> ${e.text}</li>`)
|
|
277
|
-
: html`<li class="muted">${t("taskcard.noLog")}</li>`}</ul>` : null}
|
|
278
|
-
${tab === "history" ? html`<ul class="tc-feed">${[...detail.history].reverse().map((ev) => html`<li key=${ev.id}><span class="muted">${relTime(ev.at)}</span> <b>${ev.actor}</b> ${describeEvent(ev)}</li>`)}</ul>` : null}
|
|
279
436
|
</div>
|
|
280
|
-
|
|
437
|
+
</div>`;
|
|
281
438
|
}
|
|
282
439
|
|
|
440
|
+
/** A labelled row of the page's grid: the label in the first column, whatever it holds (a text, a list, an editor) in the second. */
|
|
283
441
|
function Field({ title, tone, children }) {
|
|
284
|
-
return html`<section class=${`tc-field${tone ? ` tone-${tone}` : ""}`}><h3>${title}</h3>${children}</section>`;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* Which version an edit started from: a save sends it, so an agent's newer write is caught (409). After a conflict
|
|
289
|
-
* the next save of the same draft overwrites on purpose (null: no check).
|
|
290
|
-
*/
|
|
291
|
-
function useEditBase(version) {
|
|
292
|
-
const [base, setBase] = useState(version);
|
|
293
|
-
return {
|
|
294
|
-
start: () => setBase(version),
|
|
295
|
-
current: () => (base === undefined ? version : base),
|
|
296
|
-
afterSave: (outcome) => { if (outcome === "conflict") setBase(null); },
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/** Focus moves into an edit box as it opens (before the next key: Esc must reach the box, not the dialog). */
|
|
301
|
-
function useAutoFocus(open) {
|
|
302
|
-
const ref = useRef(null);
|
|
303
|
-
useLayoutEffect(() => { if (open && ref.current) ref.current.focus(); }, [open]);
|
|
304
|
-
return ref;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
/** Esc leaves the edit, not the dialog. */
|
|
308
|
-
function escapeEdit(e, cancel) {
|
|
309
|
-
if (e.key !== "Escape") return false;
|
|
310
|
-
e.preventDefault();
|
|
311
|
-
e.stopPropagation();
|
|
312
|
-
cancel();
|
|
313
|
-
return true;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
function InlineTitle({ value, version, onSave }) {
|
|
317
|
-
const [draft, setDraft] = useState(null);
|
|
318
|
-
const base = useEditBase(version);
|
|
319
|
-
const ref = useAutoFocus(draft !== null);
|
|
320
|
-
if (draft === null) {
|
|
321
|
-
return html`<button type="button" class="tc-title" title=${t("taskcard.clickToEdit")} onClick=${() => { setDraft(value); base.start(); }}>${value}</button>`;
|
|
322
|
-
}
|
|
323
|
-
const commit = async () => {
|
|
324
|
-
const v = draft.trim();
|
|
325
|
-
if (!v || v === value) { setDraft(null); return; }
|
|
326
|
-
const outcome = await onSave(v, base.current());
|
|
327
|
-
base.afterSave(outcome);
|
|
328
|
-
if (outcome === "ok") setDraft(null);
|
|
329
|
-
};
|
|
330
|
-
return html`<input class="tc-title-input" value=${draft} maxlength=${LIMIT.title} ref=${ref}
|
|
331
|
-
onInput=${(e) => setDraft(e.target.value)} onBlur=${() => void commit()}
|
|
332
|
-
onKeyDown=${(e) => { if (escapeEdit(e, () => setDraft(null))) return; if (e.key === "Enter") { e.preventDefault(); void commit(); } }} />`;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
function EditableText({ value, limit, placeholder, version, readOnly = false, onSave }) {
|
|
336
|
-
const [draft, setDraft] = useState(null);
|
|
337
|
-
const [saving, setSaving] = useState(false);
|
|
338
|
-
const base = useEditBase(version);
|
|
339
|
-
const ref = useAutoFocus(draft !== null);
|
|
340
|
-
if (readOnly) return html`<p class=${`tc-text${value ? "" : " empty"}`}>${value || "—"}</p>`;
|
|
341
|
-
if (draft === null) {
|
|
342
|
-
return html`<button type="button" class=${`tc-text${value ? "" : " empty"}`} title=${t("taskcard.clickToEdit")} onClick=${() => { setDraft(value); base.start(); }}>${value || placeholder || t("taskcard.empty")}</button>`;
|
|
343
|
-
}
|
|
344
|
-
const length = [...draft].length;
|
|
345
|
-
const submit = async () => {
|
|
346
|
-
if (saving) return;
|
|
347
|
-
setSaving(true);
|
|
348
|
-
const outcome = await onSave(draft.trim(), base.current());
|
|
349
|
-
setSaving(false);
|
|
350
|
-
base.afterSave(outcome);
|
|
351
|
-
if (outcome === "ok") setDraft(null);
|
|
352
|
-
};
|
|
353
|
-
return html`<div class="tc-edit">
|
|
354
|
-
<textarea rows=${Math.min(10, Math.max(3, draft.split("\n").length + 1))} value=${draft} ref=${ref}
|
|
355
|
-
onInput=${(e) => setDraft(e.target.value)}
|
|
356
|
-
onKeyDown=${(e) => { if (escapeEdit(e, () => setDraft(null))) return; if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) { e.preventDefault(); void submit(); } }}></textarea>
|
|
357
|
-
<div class="tc-edit-bar">
|
|
358
|
-
<span class=${`tc-counter${length > limit ? " over" : ""}`}>${length}/${limit}</span>
|
|
359
|
-
<span class="muted">${t("taskcard.ctrlEnter")}</span>
|
|
360
|
-
<span class="tb-grow"></span>
|
|
361
|
-
<button type="button" class="btn btn-sm" onClick=${() => setDraft(null)}>${t("taskcard.cancel")}</button>
|
|
362
|
-
<button type="button" class="btn btn-primary btn-sm" disabled=${saving || length > limit} onClick=${submit}>${t("taskcard.save")}</button>
|
|
363
|
-
</div></div>`;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
function Checklist({ card, readOnly = false, onToggle, onReplace }) {
|
|
367
|
-
const [draft, setDraft] = useState(null);
|
|
368
|
-
// One tick at a time: each sends the version it saw, so a second tick before the first is saved would be refused.
|
|
369
|
-
// The tick being saved shows as asked meanwhile (the box does not flick back until the card is read again).
|
|
370
|
-
const [ticking, setTicking] = useState(null);
|
|
371
|
-
const tick = async (n, done) => { setTicking({ n, done }); try { await onToggle(n, done); } finally { setTicking(null); } };
|
|
372
|
-
const base = useEditBase(card.version);
|
|
373
|
-
const ref = useAutoFocus(draft !== null);
|
|
374
|
-
const start = (text) => { setDraft(text); base.start(); };
|
|
375
|
-
if (draft !== null) {
|
|
376
|
-
const items = draft.split("\n").map((l) => l.trim()).filter(Boolean);
|
|
377
|
-
const save = async () => {
|
|
378
|
-
const outcome = await onReplace(items, base.current());
|
|
379
|
-
base.afterSave(outcome);
|
|
380
|
-
if (outcome === "ok") setDraft(null);
|
|
381
|
-
};
|
|
382
|
-
return html`<div class="tc-edit">
|
|
383
|
-
<textarea rows=${Math.max(3, items.length + 1)} value=${draft} ref=${ref}
|
|
384
|
-
onInput=${(e) => setDraft(e.target.value)}
|
|
385
|
-
onKeyDown=${(e) => { if (escapeEdit(e, () => setDraft(null))) return; if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) { e.preventDefault(); void save(); } }}></textarea>
|
|
386
|
-
<div class="tc-edit-bar">
|
|
387
|
-
<span class=${`tc-counter${items.length > LIMIT.acceptanceItems ? " over" : ""}`}>${t("taskcard.items", items.length, LIMIT.acceptanceItems)}</span>
|
|
388
|
-
<span class="muted">${t("taskcard.onePerLine")}</span>
|
|
389
|
-
<span class="tb-grow"></span>
|
|
390
|
-
<button type="button" class="btn btn-sm" onClick=${() => setDraft(null)}>${t("taskcard.cancel")}</button>
|
|
391
|
-
<button type="button" class="btn btn-primary btn-sm" disabled=${items.length > LIMIT.acceptanceItems} onClick=${save}>${t("taskcard.save")}</button>
|
|
392
|
-
</div></div>`;
|
|
393
|
-
}
|
|
394
|
-
if (!card.acceptance.length) return readOnly ? html`<p class="tc-text empty">—</p>` : html`<button type="button" class="tc-text empty" onClick=${() => start("")}>${t("taskcard.checklistEmpty")}</button>`;
|
|
395
|
-
return html`<ul class="tc-checklist">${card.acceptance.map((a, i) => html`<li key=${`${i}-${a.text}`}><label class="tb-check">
|
|
396
|
-
<input type="checkbox" checked=${ticking && ticking.n === i + 1 ? ticking.done : a.done} disabled=${readOnly || !!ticking} onChange=${() => void tick(i + 1, !a.done)} /><span class=${a.done ? "done" : ""}>${a.text}</span></label></li>`)}</ul>
|
|
397
|
-
${readOnly ? null : html`<button type="button" class="btn btn-ghost btn-sm" onClick=${() => start(card.acceptance.map((a) => a.text).join("\n"))}>${t("taskcard.editList")}</button>`}`;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
function QuickAdd({ placeholder, onAdd }) {
|
|
401
|
-
const [title, setTitle] = useState("");
|
|
402
|
-
const busy = useRef(false);
|
|
403
|
-
return html`<input class="tc-quick-add" value=${title} placeholder=${placeholder} aria-label=${placeholder} maxlength=${LIMIT.title}
|
|
404
|
-
onInput=${(e) => setTitle(e.target.value)}
|
|
405
|
-
onKeyDown=${async (e) => {
|
|
406
|
-
if (e.key !== "Enter" || !title.trim() || busy.current) return;
|
|
407
|
-
e.preventDefault();
|
|
408
|
-
busy.current = true;
|
|
409
|
-
if ((await onAdd(title.trim())) === "ok") setTitle("");
|
|
410
|
-
busy.current = false;
|
|
411
|
-
}} />`;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
function Comments({ entries, card, writable = true, onSend }) {
|
|
415
|
-
const [text, setText] = useState("");
|
|
416
|
-
const [sending, setSending] = useState(false);
|
|
417
|
-
const busy = useRef(false);
|
|
418
|
-
const send = async () => {
|
|
419
|
-
if (!text.trim() || busy.current) return;
|
|
420
|
-
busy.current = true;
|
|
421
|
-
setSending(true);
|
|
422
|
-
if ((await onSend(text.trim())) === "ok") setText("");
|
|
423
|
-
setSending(false);
|
|
424
|
-
busy.current = false;
|
|
425
|
-
};
|
|
426
|
-
return html`<div class="tc-comments">
|
|
427
|
-
${entries.length ? null : html`<p class="muted">${t("taskcard.noComments")}</p>`}
|
|
428
|
-
${entries.map((e) => html`<div key=${e.id} class=${`tc-comment${e.authorKind === "person" ? " person" : ""}`}>
|
|
429
|
-
<div class="tc-comment-head"><b>${e.author}</b>
|
|
430
|
-
${e.kind === "reject" ? html`<span class="tb-tag st-blocked">${t("taskcard.rejectTag")}</span>` : null}
|
|
431
|
-
${e.kind === "approve" ? html`<span class="tb-tag st-done">${t("taskcard.approveTag")}</span>` : null}
|
|
432
|
-
<span class="muted">${relTime(e.at)}</span></div>
|
|
433
|
-
<div class="tc-comment-body">${e.text}</div></div>`)}
|
|
434
|
-
${writable ? html`<div class="tc-composer">
|
|
435
|
-
<textarea rows="2" value=${text} placeholder=${card.assignee ? t("taskcard.commentTo", card.assignee) : t("taskcard.commentHint")} aria-label=${t("taskcard.commentHint")}
|
|
436
|
-
onInput=${(e) => setText(e.target.value)}
|
|
437
|
-
onKeyDown=${(e) => { if (e.key === "Escape") { e.preventDefault(); e.stopPropagation(); e.currentTarget.blur(); return; } if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) { e.preventDefault(); void send(); } }}></textarea>
|
|
438
|
-
<button type="button" class="btn btn-primary btn-sm" disabled=${sending || !text.trim()} onClick=${send}>${t("taskcard.send")}</button>
|
|
439
|
-
</div>` : null}</div>`;
|
|
442
|
+
return html`<section class=${`tc-field${tone ? ` tone-${tone}` : ""}`}><h3>${title}</h3><div class="tc-field-body">${children}</div></section>`;
|
|
440
443
|
}
|