@songsid/agend 2.4.0-beta.26 → 2.4.0-beta.28
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 +2 -1
- package/dist/agent-cli.js +6 -0
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-endpoint.d.ts +1 -0
- package/dist/agent-endpoint.js +5 -0
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-whats-new.js +4 -0
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/backend/kiro-auth-store.d.ts +15 -2
- package/dist/backend/kiro-auth-store.js +64 -0
- package/dist/backend/kiro-auth-store.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/adapters/discord.js +4 -4
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.js +3 -3
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/ipc-bridge.d.ts +7 -0
- package/dist/channel/ipc-bridge.js +45 -11
- package/dist/channel/ipc-bridge.js.map +1 -1
- package/dist/channel/mcp-server.js +3 -1
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.js +6 -4
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/claude-turn-boundaries.d.ts +15 -0
- package/dist/claude-turn-boundaries.js +88 -0
- package/dist/claude-turn-boundaries.js.map +1 -0
- package/dist/cli.js +35 -2
- package/dist/cli.js.map +1 -1
- package/dist/contact-auth-service.js +3 -0
- package/dist/contact-auth-service.js.map +1 -1
- package/dist/contact-auth-store.d.ts +16 -0
- package/dist/contact-auth-store.js +61 -1
- package/dist/contact-auth-store.js.map +1 -1
- package/dist/daemon.d.ts +76 -4
- package/dist/daemon.js +621 -115
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.d.ts +145 -7
- package/dist/delivery-outbox.js +373 -8
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/detached-fleet-stop.d.ts +40 -0
- package/dist/detached-fleet-stop.js +126 -0
- package/dist/detached-fleet-stop.js.map +1 -0
- package/dist/fleet-lock.d.ts +5 -0
- package/dist/fleet-lock.js +21 -2
- package/dist/fleet-lock.js.map +1 -1
- package/dist/fleet-manager.d.ts +499 -5
- package/dist/fleet-manager.js +2917 -217
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +39 -3
- package/dist/fleet-windows-runtime.js +208 -30
- package/dist/fleet-windows-runtime.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +5 -0
- package/dist/general-knowledge/skills/hub/SKILL.md +5 -1
- package/dist/general-knowledge/skills/task-board/SKILL.md +14 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +96 -26
- package/dist/hub/admin-dashboard.js +1 -1
- package/dist/hub/admin-dashboard.js.map +1 -1
- package/dist/hub/agent-catalog.d.ts +1 -1
- package/dist/hub/agent-catalog.js +4 -3
- package/dist/hub/agent-catalog.js.map +1 -1
- package/dist/hub/agent-intro.d.ts +1 -1
- package/dist/hub/agent-intro.js +1 -1
- package/dist/hub/agent-intro.js.map +1 -1
- package/dist/hub/agent-pictures.d.ts +1 -1
- package/dist/hub/agent-pictures.js +4 -3
- package/dist/hub/agent-pictures.js.map +1 -1
- package/dist/hub/catalog.d.ts +2 -2
- package/dist/hub/catalog.js +16 -13
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.js +9 -2
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.js +8 -1
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.js +4 -2
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/fleet-updates.d.ts +2 -2
- package/dist/hub/fleet-updates.js +7 -5
- package/dist/hub/fleet-updates.js.map +1 -1
- package/dist/hub/fleet-versions.d.ts +1 -1
- package/dist/hub/fleet-versions.js +3 -2
- package/dist/hub/fleet-versions.js.map +1 -1
- package/dist/hub/http/compose.js +57 -30
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/schema.js +4 -1
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/join/service.d.ts +6 -0
- package/dist/hub/join/service.js +10 -0
- package/dist/hub/join/service.js.map +1 -1
- package/dist/hub/member/room-ask.js +2 -0
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-post.d.ts +4 -0
- package/dist/hub/member/room-post.js +26 -1
- package/dist/hub/member/room-post.js.map +1 -1
- package/dist/hub/protocol.d.ts +58 -0
- package/dist/hub/protocol.js +3 -2
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/quota.d.ts +2 -2
- package/dist/hub/quota.js +6 -4
- package/dist/hub/quota.js.map +1 -1
- package/dist/hub/read-statement.d.ts +6 -0
- package/dist/hub/read-statement.js +33 -0
- package/dist/hub/read-statement.js.map +1 -0
- package/dist/hub/recommendations.d.ts +1 -1
- package/dist/hub/recommendations.js +3 -2
- package/dist/hub/recommendations.js.map +1 -1
- package/dist/hub/representative.d.ts +2 -0
- package/dist/hub/representative.js +8 -4
- package/dist/hub/representative.js.map +1 -1
- package/dist/hub/roles/clock.d.ts +1 -1
- package/dist/hub/roles/clock.js +9 -7
- package/dist/hub/roles/clock.js.map +1 -1
- package/dist/hub/roles/read.d.ts +4 -0
- package/dist/hub/roles/read.js +37 -7
- package/dist/hub/roles/read.js.map +1 -1
- package/dist/hub/room-history-model.d.ts +87 -0
- package/dist/hub/room-history-model.js +14 -0
- package/dist/hub/room-history-model.js.map +1 -0
- package/dist/hub/rooms/agents.d.ts +1 -1
- package/dist/hub/rooms/agents.js +3 -2
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/history.d.ts +8 -0
- package/dist/hub/rooms/history.js +31 -0
- package/dist/hub/rooms/history.js.map +1 -0
- package/dist/hub/rooms/schema.d.ts +2 -0
- package/dist/hub/rooms/schema.js +4 -0
- package/dist/hub/rooms/schema.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +35 -19
- package/dist/hub/rooms/service.js +105 -26
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/server.js +10 -3
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/session-epoch.js +2 -1
- package/dist/hub/session-epoch.js.map +1 -1
- package/dist/hub/settings-directory-decision.js +14 -7
- package/dist/hub/settings-directory-decision.js.map +1 -1
- package/dist/hub/settings-member-address-decision.js +3 -2
- package/dist/hub/settings-member-address-decision.js.map +1 -1
- package/dist/hub/settings-web-address-decision.js +2 -1
- package/dist/hub/settings-web-address-decision.js.map +1 -1
- package/dist/hub/store.d.ts +5 -0
- package/dist/hub/store.js +28 -5
- package/dist/hub/store.js.map +1 -1
- package/dist/hub/types.d.ts +2 -2
- package/dist/hub-agent-incarnation-record.d.ts +24 -0
- package/dist/hub-agent-incarnation-record.js +46 -0
- package/dist/hub-agent-incarnation-record.js.map +1 -0
- package/dist/human-delivery-receipts.d.ts +16 -4
- package/dist/human-delivery-receipts.js +26 -5
- package/dist/human-delivery-receipts.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +9 -3
- package/dist/instance-lifecycle.js +27 -10
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +1 -1
- package/dist/local-pane-endpoint.d.ts +14 -0
- package/dist/local-pane-endpoint.js +32 -0
- package/dist/local-pane-endpoint.js.map +1 -1
- package/dist/locale.js +68 -4
- package/dist/locale.js.map +1 -1
- package/dist/native-agent-admission.js +9 -0
- package/dist/native-agent-admission.js.map +1 -1
- package/dist/native-exec-context.d.ts +11 -0
- package/dist/native-exec-context.js +18 -0
- package/dist/native-exec-context.js.map +1 -0
- package/dist/native-exec-input.d.ts +56 -0
- package/dist/native-exec-input.js +89 -0
- package/dist/native-exec-input.js.map +1 -0
- package/dist/native-mcp.d.ts +9 -1
- package/dist/native-mcp.js +29 -7
- package/dist/native-mcp.js.map +1 -1
- package/dist/native-pane-lifecycle.d.ts +3 -0
- package/dist/native-pane-lifecycle.js +2 -0
- package/dist/native-pane-lifecycle.js.map +1 -1
- package/dist/native-pane-manager.d.ts +18 -0
- package/dist/native-pane-manager.js +85 -8
- package/dist/native-pane-manager.js.map +1 -1
- package/dist/needs-you.d.ts +2 -1
- package/dist/needs-you.js.map +1 -1
- package/dist/outbound-handlers.d.ts +1 -0
- package/dist/outbound-handlers.js +9 -3
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +8 -0
- package/dist/outbound-schemas.js +6 -2
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/public-web-gateway.js +3 -1
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/recover.cjs +1 -0
- package/dist/reply-buttons-controller.d.ts +1 -0
- package/dist/reply-buttons-controller.js +1 -1
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/request-contact-gate.d.ts +2 -0
- package/dist/request-contact-gate.js +8 -3
- package/dist/request-contact-gate.js.map +1 -1
- package/dist/request-context-activation.d.ts +29 -0
- package/dist/request-context-activation.js +85 -0
- package/dist/request-context-activation.js.map +1 -0
- package/dist/request-context-admission.d.ts +22 -0
- package/dist/request-context-admission.js +12 -0
- package/dist/request-context-admission.js.map +1 -0
- package/dist/request-context-boot.d.ts +35 -0
- package/dist/request-context-boot.js +97 -0
- package/dist/request-context-boot.js.map +1 -0
- package/dist/request-context-call.d.ts +3 -0
- package/dist/request-context-call.js.map +1 -1
- package/dist/request-context-compatibility.js +10 -2
- package/dist/request-context-compatibility.js.map +1 -1
- package/dist/request-context-continuation.d.ts +6 -0
- package/dist/request-context-continuation.js +24 -0
- package/dist/request-context-continuation.js.map +1 -0
- package/dist/request-context-control-api.d.ts +119 -0
- package/dist/request-context-control-api.js +179 -0
- package/dist/request-context-control-api.js.map +1 -0
- package/dist/request-context-control-copy.d.ts +3 -0
- package/dist/request-context-control-copy.js +7 -0
- package/dist/request-context-control-copy.js.map +1 -0
- package/dist/request-context-controller.d.ts +44 -0
- package/dist/request-context-controller.js +129 -0
- package/dist/request-context-controller.js.map +1 -0
- package/dist/request-context-delivery-resolver.d.ts +13 -0
- package/dist/request-context-delivery-resolver.js +30 -0
- package/dist/request-context-delivery-resolver.js.map +1 -0
- package/dist/request-context-drain-projection.d.ts +8 -0
- package/dist/request-context-drain-projection.js +40 -0
- package/dist/request-context-drain-projection.js.map +1 -0
- package/dist/request-context-drain.d.ts +22 -0
- package/dist/request-context-drain.js +139 -7
- package/dist/request-context-drain.js.map +1 -1
- package/dist/request-context-enable-offer.d.ts +13 -0
- package/dist/request-context-enable-offer.js +31 -0
- package/dist/request-context-enable-offer.js.map +1 -0
- package/dist/request-context-exec-owner.d.ts +39 -0
- package/dist/request-context-exec-owner.js +128 -0
- package/dist/request-context-exec-owner.js.map +1 -0
- package/dist/request-context-go-back-view.d.ts +1 -0
- package/dist/request-context-go-back-view.js +17 -0
- package/dist/request-context-go-back-view.js.map +1 -0
- package/dist/request-context-helper-readiness.d.ts +14 -0
- package/dist/request-context-helper-readiness.js +23 -0
- package/dist/request-context-helper-readiness.js.map +1 -0
- package/dist/request-context-helper.d.ts +20 -0
- package/dist/request-context-helper.js +41 -0
- package/dist/request-context-helper.js.map +1 -0
- package/dist/request-context-hub-resolver.d.ts +29 -0
- package/dist/request-context-hub-resolver.js +90 -0
- package/dist/request-context-hub-resolver.js.map +1 -0
- package/dist/request-context-human-resolver.d.ts +20 -0
- package/dist/request-context-human-resolver.js +77 -0
- package/dist/request-context-human-resolver.js.map +1 -0
- package/dist/request-context-human.d.ts +112 -0
- package/dist/request-context-human.js +176 -0
- package/dist/request-context-human.js.map +1 -0
- package/dist/request-context-inputs.d.ts +21 -0
- package/dist/request-context-inputs.js +63 -0
- package/dist/request-context-inputs.js.map +1 -0
- package/dist/request-context-installation.d.ts +117 -0
- package/dist/request-context-installation.js +328 -0
- package/dist/request-context-installation.js.map +1 -0
- package/dist/request-context-knowledge.d.ts +5 -0
- package/dist/request-context-knowledge.js +32 -0
- package/dist/request-context-knowledge.js.map +1 -0
- package/dist/request-context-migration.d.ts +11 -0
- package/dist/request-context-migration.js +16 -3
- package/dist/request-context-migration.js.map +1 -1
- package/dist/request-context-native-human.d.ts +20 -0
- package/dist/request-context-native-human.js +91 -0
- package/dist/request-context-native-human.js.map +1 -0
- package/dist/request-context-native-output.d.ts +15 -0
- package/dist/request-context-native-output.js +46 -0
- package/dist/request-context-native-output.js.map +1 -0
- package/dist/request-context-native-result.d.ts +15 -0
- package/dist/request-context-native-result.js +46 -0
- package/dist/request-context-native-result.js.map +1 -0
- package/dist/request-context-off.d.ts +22 -0
- package/dist/request-context-off.js +77 -0
- package/dist/request-context-off.js.map +1 -0
- package/dist/request-context-outside-label.d.ts +5 -0
- package/dist/request-context-outside-label.js +28 -0
- package/dist/request-context-outside-label.js.map +1 -0
- package/dist/request-context-pane.d.ts +8 -0
- package/dist/request-context-pane.js +19 -0
- package/dist/request-context-pane.js.map +1 -1
- package/dist/request-context-pending-work.d.ts +11 -0
- package/dist/request-context-pending-work.js +43 -0
- package/dist/request-context-pending-work.js.map +1 -0
- package/dist/request-context-policy.d.ts +17 -1
- package/dist/request-context-policy.js +84 -6
- package/dist/request-context-policy.js.map +1 -1
- package/dist/request-context-readiness.d.ts +49 -0
- package/dist/request-context-readiness.js +64 -0
- package/dist/request-context-readiness.js.map +1 -0
- package/dist/request-context-recovery.d.ts +6 -2
- package/dist/request-context-recovery.js +25 -0
- package/dist/request-context-recovery.js.map +1 -1
- package/dist/request-context-relay.d.ts +2 -2
- package/dist/request-context-relay.js +10 -10
- package/dist/request-context-relay.js.map +1 -1
- package/dist/request-context-reply-pending.d.ts +16 -0
- package/dist/request-context-reply-pending.js +77 -0
- package/dist/request-context-reply-pending.js.map +1 -0
- package/dist/request-context-resolution.d.ts +35 -0
- package/dist/request-context-resolution.js +86 -0
- package/dist/request-context-resolution.js.map +1 -0
- package/dist/request-context-retirement.d.ts +21 -0
- package/dist/request-context-retirement.js +16 -0
- package/dist/request-context-retirement.js.map +1 -0
- package/dist/request-context-start.d.ts +15 -0
- package/dist/request-context-start.js +2 -0
- package/dist/request-context-start.js.map +1 -0
- package/dist/request-context-turns.d.ts +1 -1
- package/dist/request-context-turns.js +3 -2
- package/dist/request-context-turns.js.map +1 -1
- package/dist/request-context-unproved-label.d.ts +4 -0
- package/dist/request-context-unproved-label.js +25 -0
- package/dist/request-context-unproved-label.js.map +1 -0
- package/dist/request-context-update-guard.d.ts +15 -0
- package/dist/request-context-update-guard.js +54 -0
- package/dist/request-context-update-guard.js.map +1 -0
- package/dist/request-context-work.d.ts +50 -0
- package/dist/request-context-work.js +178 -0
- package/dist/request-context-work.js.map +1 -0
- package/dist/request-hub-context.d.ts +1 -0
- package/dist/request-hub-output.d.ts +2 -0
- package/dist/request-hub-output.js +12 -0
- package/dist/request-hub-output.js.map +1 -1
- package/dist/retained-human-control.d.ts +11 -0
- package/dist/retained-human-control.js +11 -0
- package/dist/retained-human-control.js.map +1 -0
- package/dist/runtime-build-info.js +1 -1
- package/dist/runtime-build-info.js.map +1 -1
- package/dist/runtime-cli.js +1 -1
- package/dist/runtime-cli.js.map +1 -1
- package/dist/runtime-client-store.js +7 -1
- package/dist/runtime-client-store.js.map +1 -1
- package/dist/runtime-client.js +15 -3
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-coordinator.d.ts +23 -0
- package/dist/runtime-coordinator.js +103 -4
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-pane-mcp.d.ts +9 -0
- package/dist/runtime-pane-mcp.js +22 -2
- package/dist/runtime-pane-mcp.js.map +1 -1
- package/dist/runtime-protocol.d.ts +2 -0
- package/dist/runtime-protocol.js.map +1 -1
- package/dist/runtime-update-controller.js +1 -1
- package/dist/runtime-update-controller.js.map +1 -1
- package/dist/runtime-windows-bridge.d.ts +8 -0
- package/dist/runtime-windows-bridge.js +50 -3
- package/dist/runtime-windows-bridge.js.map +1 -1
- package/dist/scheduler/db.js +9 -0
- package/dist/scheduler/db.js.map +1 -1
- package/dist/scheduler/task-board-text.d.ts +3 -6
- package/dist/scheduler/task-board-text.js +15 -10
- package/dist/scheduler/task-board-text.js.map +1 -1
- package/dist/scheduler/task-board-unread.d.ts +90 -0
- package/dist/scheduler/task-board-unread.js +192 -0
- package/dist/scheduler/task-board-unread.js.map +1 -0
- package/dist/scheduler/task-board.d.ts +324 -6
- package/dist/scheduler/task-board.js +786 -47
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/service-install-handover.d.ts +52 -0
- package/dist/service-install-handover.js +50 -0
- package/dist/service-install-handover.js.map +1 -0
- package/dist/service-installer.d.ts +12 -0
- package/dist/service-installer.js +24 -10
- package/dist/service-installer.js.map +1 -1
- package/dist/settings-api.d.ts +2 -0
- package/dist/settings-api.js +4 -0
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +1 -0
- package/dist/settings-baseline.js +5 -4
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-confirmation.d.ts +2 -0
- package/dist/settings-confirmation.js +6 -0
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.d.ts +2 -0
- package/dist/settings-effect.js +59 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +3 -0
- package/dist/settings-http-confirmation.js +29 -0
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-route-lifetime.d.ts +3 -1
- package/dist/settings-route-lifetime.js +15 -5
- package/dist/settings-route-lifetime.js.map +1 -1
- package/dist/settings-transaction.d.ts +3 -2
- package/dist/settings-transaction.js.map +1 -1
- package/dist/task-board-tool.js +24 -3
- package/dist/task-board-tool.js.map +1 -1
- package/dist/task-board-waker.d.ts +53 -2
- package/dist/task-board-waker.js +183 -12
- package/dist/task-board-waker.js.map +1 -1
- package/dist/tips.js +1 -1
- package/dist/tips.js.map +1 -1
- package/dist/tool-permissions.js +3 -3
- package/dist/tool-permissions.js.map +1 -1
- package/dist/tool-receipt-output.d.ts +6 -6
- package/dist/transcript-monitor.d.ts +6 -1
- package/dist/transcript-monitor.js +59 -4
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-turns.d.ts +3 -0
- package/dist/transcript-turns.js +5 -0
- package/dist/transcript-turns.js.map +1 -1
- package/dist/turn-reply-guard.d.ts +16 -1
- package/dist/turn-reply-guard.js +20 -2
- package/dist/turn-reply-guard.js.map +1 -1
- package/dist/ui/app.html +2 -2
- package/dist/ui/contact-auth-strings.js +6 -6
- package/dist/ui/contact-authorizations.js +19 -1
- package/dist/ui/contact-grant-editor.js +71 -11
- package/dist/ui/contact-needs.js +27 -8
- package/dist/ui/contact-permissions.js +25 -8
- package/dist/ui/contact-tool-groups.js +1 -1
- package/dist/ui/fleet-task-activity.js +164 -24
- package/dist/ui/fleet-task-card.js +77 -13
- package/dist/ui/fleet-task-common.js +14 -0
- package/dist/ui/fleet-task-flow.js +353 -0
- package/dist/ui/fleet-task-md.js +1 -1
- package/dist/ui/fleet-task-run.js +98 -22
- package/dist/ui/fleet-task-thread.js +245 -0
- package/dist/ui/fleet-task-unread.js +100 -0
- package/dist/ui/fleet-task-view.js +6 -5
- package/dist/ui/fleet-task-wake.js +140 -0
- package/dist/ui/fleet-tasks.js +13 -6
- package/dist/ui/hub-client.js +3 -0
- package/dist/ui/hub-room-members.js +4 -2
- package/dist/ui/hub-room-settings-strings.js +8 -0
- package/dist/ui/hub-room-settings.js +32 -0
- package/dist/ui/hub-room-thread.js +7 -1
- package/dist/ui/icons/hub-apple-touch-icon.png +0 -0
- package/dist/ui/icons/hub-favicon.ico +0 -0
- package/dist/ui/icons/hub-favicon.svg +10 -0
- package/dist/ui/icons/hub-icon-192.png +0 -0
- package/dist/ui/icons/hub-icon-512.png +0 -0
- package/dist/ui/icons/hub-icon-maskable-192.png +0 -0
- package/dist/ui/icons/hub-icon-maskable-512.png +0 -0
- package/dist/ui/icons/hub-maskable.svg +12 -0
- package/dist/ui/panel-hub.js +14 -3
- package/dist/ui/panel-needs.js +2 -1
- package/dist/ui/panel-settings.js +2 -1
- package/dist/ui/panel-windows-cli.js +2 -2
- package/dist/ui/request-contact-card.js +287 -0
- package/dist/ui/request-contact-client.js +83 -0
- package/dist/ui/request-contact-page.js +78 -0
- package/dist/ui/request-context-control.js +209 -0
- package/dist/ui/settings-registry.js +2 -0
- package/dist/ui/settings-update.js +3 -2
- package/dist/ui/shared/access-overview.css +1 -1
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-install.js +2 -2
- package/dist/ui/shared/app-shell.js +17 -4
- package/dist/ui/shared/app-stream.js +4 -1
- package/dist/ui/shared/app-update.js +2 -1
- package/dist/ui/shared/app.css +101 -10
- package/dist/ui/shared/app.js +19 -2
- package/dist/ui/shared/task-board.css +164 -0
- package/dist/ui/shared/ui-icons.js +3 -0
- package/dist/ui/shared/ui-states.js +6 -0
- package/dist/ui/shared/update-card-ui.js +178 -11
- package/dist/ui/shared/view-strings.js +18 -0
- package/dist/ui/shared/web-authorize.js +1 -1
- package/dist/ui/task-unread.js +70 -0
- package/dist/ui/windows-cli-catalog.js +33 -6
- package/dist/update-card.d.ts +1 -1
- package/dist/update-card.js +7 -7
- package/dist/update-card.js.map +1 -1
- package/dist/update-fix.d.ts +66 -0
- package/dist/update-fix.js +67 -0
- package/dist/update-fix.js.map +1 -0
- package/dist/update-goback.js +15 -3
- package/dist/update-goback.js.map +1 -1
- package/dist/update-readiness.d.ts +2 -0
- package/dist/update-readiness.js +5 -1
- package/dist/update-readiness.js.map +1 -1
- package/dist/update-snapshot-scope.js +1 -0
- package/dist/update-snapshot-scope.js.map +1 -1
- package/dist/usage/i18n-keys.d.ts +1 -1
- package/dist/usage/i18n-keys.js +9 -0
- package/dist/usage/i18n-keys.js.map +1 -1
- package/dist/usage/providers.d.ts +3 -11
- package/dist/usage/providers.js +93 -131
- package/dist/usage/providers.js.map +1 -1
- package/dist/web-api.d.ts +49 -1
- package/dist/web-api.js +234 -13
- package/dist/web-api.js.map +1 -1
- package/dist/web-chat-history.d.ts +2 -0
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-icons.d.ts +9 -3
- package/dist/web-icons.js +62 -5
- package/dist/web-icons.js.map +1 -1
- package/dist/web-update.d.ts +9 -0
- package/dist/windows-agents.d.ts +24 -2
- package/dist/windows-agents.js +110 -4
- package/dist/windows-agents.js.map +1 -1
- package/dist/windows-cli-api.js +4 -2
- package/dist/windows-cli-api.js.map +1 -1
- package/dist/windows-cli-worker.js +9 -1
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/windows-cli.d.ts +55 -1
- package/dist/windows-cli.js +147 -17
- package/dist/windows-cli.js.map +1 -1
- package/dist/windows-shortcuts.d.ts +3 -22
- package/dist/windows-shortcuts.js +5 -45
- package/dist/windows-shortcuts.js.map +1 -1
- package/dist/workflow-templates/default.md +3 -2
- package/dist/wsl-host.d.ts +52 -0
- package/dist/wsl-host.js +97 -0
- package/dist/wsl-host.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
// Who has the baton on a main task (Fleet › Tasks › a card; docs/design/task-board.md, "Live state and handoffs"). A main task follows its
|
|
2
|
+
// sub tasks, so its own status says little: "In progress" is a status, not a sign that an agent is working. This page's pieces say what is
|
|
3
|
+
// really happening, one line per sub task, in the person's words (`subLine`: the whole sentence, and a short label for the sub tasks' rows):
|
|
4
|
+
// · a sub task its assignee is working on: what it is doing now — "dev · Edit src/game.js" (the chat's own activity feed, `tool_progress`,
|
|
5
|
+
// an admin only) or, without steps, the state alone — "dev · Running". In the sub tasks' list the row itself says it: its title shimmers
|
|
6
|
+
// (still with reduced motion) and the sentence is the row's tooltip; the steps are the main task's "Agent activity" block's to show;
|
|
7
|
+
// · one waiting for another: "Waits for S-1" — then, when S-1 is done, the baton: "Handed to dev" → "dev read it" → running;
|
|
8
|
+
// · one that cannot go on: blocked, the assignee waiting for the person, looking stuck, idle, offline or paused, or the hand-over that did
|
|
9
|
+
// not arrive (the task board is off, the notice was lost).
|
|
10
|
+
// The same lines summarise the main task's "Agent activity" block (the whole sentence), the other states are a short label in the sub task's own
|
|
11
|
+
// row (no second line), and a handoff is a row of the main task's activity ("S-1 done → handed to dev to start S-2" and how far it got).
|
|
12
|
+
//
|
|
13
|
+
// Nothing here is stored by the page. The state is the same inference as the card's "Running" (`runOf`, fleet-task-run.js — an agent is one
|
|
14
|
+
// continuing session, so "working" says it is busy, not that it is on this very card); the hand-over's delivery is what the card read carries
|
|
15
|
+
// (`handoffs`, only for a session that can write, never of an instance kept out of sight); the steps are the chat's own feed, held only while
|
|
16
|
+
// a sub task is running and the viewer is an admin whose agent has `tool_progress` on — otherwise the state alone. No style attribute (the CSP).
|
|
17
|
+
import { html, useEffect, useState } from "/assets/app-html.js";
|
|
18
|
+
import { t, register } from "/assets/app-i18n.js";
|
|
19
|
+
import { appStore, createStore, useStore } from "/assets/app-store.js";
|
|
20
|
+
import { Icon } from "/assets/ui-icons.js";
|
|
21
|
+
import { activityDrawCtx, activityOffered, activityPrefs, activitySnapshot, observeActivity } from "./chat-activity.js";
|
|
22
|
+
import { stepLine } from "./log-row.js";
|
|
23
|
+
import { StatusPill, relTime, waitsList, waitsOn } from "./fleet-task-common.js";
|
|
24
|
+
import { instanceStates, liveGroupOf, runOf, runUnclaimed } from "./fleet-task-run.js";
|
|
25
|
+
|
|
26
|
+
register("taskflow", {
|
|
27
|
+
en: {
|
|
28
|
+
running: "Running", needs: "waiting for you", stuck: "looks stuck", idle: "idle", busyN: "busy with {0} cards", busyTip: "{0} has {1} cards in progress, so what it is doing now may belong to another of them",
|
|
29
|
+
runningTip: "From {0}'s state: an agent is one continuing session, so it may be busy with something else",
|
|
30
|
+
waitsFor: "Waits for {0}", readyNobody: "Ready to start — nobody is assigned", readyFor: "Ready — {0} has not started it yet", blocked: "Blocked", blockedOn: "Blocked: {0}",
|
|
31
|
+
sending: "Handed to {0}", queued: "Waiting for {0} to take it", offline: "{0} is offline — it gets this when it is back", paused: "{0} is paused — it gets this when it is resumed",
|
|
32
|
+
delivered: "Delivered to {0} — waiting for it to start", read: "{0} read it — waiting for it to start",
|
|
33
|
+
unclaimed: "not claimed yet", unclaimedLate: "still not claimed", unclaimedTip: "{0} is working and this is the card it was given, but it has not moved it to In progress (claimed it): what it is doing now is probably this card.",
|
|
34
|
+
unclaimedLateTip: "{0} has been working for a while without claiming this card. Ask it to claim it (task claim), or move the card to In progress yourself — the board never moves it for an agent.",
|
|
35
|
+
failed: "Could not hand it to {0}", uncertain: "Not sure {0} got it", withdrawn: "The notice to {0} was withdrawn: the card changed again, and {0} hears its new state",
|
|
36
|
+
"skip.board_off": "{0}'s task board is off, so it was not told", "skip.not_taken": "The notice to {0} could not be queued", "skip.lost": "The notice to {0} was lost (AgEnD restarted before it was sent)",
|
|
37
|
+
"skip.other": "{0} was not told",
|
|
38
|
+
handedAfter: "{0} done → handed to {1} to start {2}", handedReady: "{2} can start → handed to {1}", handedAssigned: "{2} handed to {1}", started: "{0} started {1}", startedNeutral: "{0} started",
|
|
39
|
+
handoffLabel: "A sub task handed on", linesLabel: "What the sub tasks are doing", openCard: "Open {0}", more: "+{0} more", tipWorking: "{0} · {1}",
|
|
40
|
+
chipWaits: "Waits for {0}", chipReady: "Ready", chipBlocked: "Blocked", chipNeeds: "Waiting for you", chipStuck: "Looks stuck", chipIdle: "Idle", chipBusy: "Busy · {0} cards",
|
|
41
|
+
chipSending: "Handed to {0}", chipQueued: "Waiting", chipOffline: "{0} offline", chipPaused: "{0} paused", chipDelivered: "Delivered", chipRead: "Read",
|
|
42
|
+
chipFailed: "Not sent", chipUncertain: "Not sure it arrived", chipWithdrawn: "Withdrawn", chipNotTold: "Not told", chipUnclaimed: "Not claimed yet", chipUnclaimedLate: "Still not claimed",
|
|
43
|
+
},
|
|
44
|
+
"zh-TW": {
|
|
45
|
+
running: "執行中", needs: "等你回應", stuck: "似乎卡住", idle: "閒置", busyN: "忙碌中({0} 張卡)", busyTip: "{0} 同時有 {1} 張卡在進行中,目前的動作可能屬於其中另一張",
|
|
46
|
+
runningTip: "由 {0} 目前的狀態推論:Agent 只有一個連續的對話,可能在處理別的事",
|
|
47
|
+
waitsFor: "等 {0}", readyNobody: "可以開始,但還沒有人負責", readyFor: "可以開始,等 {0} 接手", blocked: "卡住了", blockedOn: "卡住:{0}",
|
|
48
|
+
sending: "已交給 {0}", queued: "等 {0} 接手", offline: "{0} 離線,上線後就會收到", paused: "{0} 已暫停,恢復後就會收到",
|
|
49
|
+
delivered: "已送達 {0},等它開始", read: "{0} 已讀,等它開始",
|
|
50
|
+
unclaimed: "尚未認領", unclaimedLate: "還是沒有認領", unclaimedTip: "{0} 正在執行,而這是交給它的卡,但它還沒有把卡片移到進行中(沒有認領):它現在做的很可能就是這張。",
|
|
51
|
+
unclaimedLateTip: "{0} 已經做了一陣子,卻還沒認領這張卡。請它認領(task claim),或你自己把卡片移到進行中——系統不會替 agent 改狀態。",
|
|
52
|
+
failed: "沒有送達 {0}", uncertain: "無法確認 {0} 是否收到", withdrawn: "給 {0} 的通知已撤回:卡片又有變動,{0} 會從新的通知得知最新狀態",
|
|
53
|
+
"skip.board_off": "{0} 的任務板是關閉的,沒有通知它", "skip.not_taken": "給 {0} 的通知沒能排入傳送", "skip.lost": "給 {0} 的通知遺失了(送出前 AgEnD 重新啟動)",
|
|
54
|
+
"skip.other": "沒有通知 {0}",
|
|
55
|
+
handedAfter: "{0} 完成 → 已交給 {1} 開始 {2}", handedReady: "{2} 可以開始 → 已交給 {1}", handedAssigned: "已把 {2} 交給 {1}", started: "{0} 已開始 {1}", startedNeutral: "{0} 已開始",
|
|
56
|
+
handoffLabel: "子任務的交接", linesLabel: "各子任務目前的狀況", openCard: "開啟 {0}", more: "還有 {0} 項", tipWorking: "{0} · {1}",
|
|
57
|
+
chipWaits: "等 {0}", chipReady: "可以開始", chipBlocked: "卡住了", chipNeeds: "等你回應", chipStuck: "似乎卡住", chipIdle: "閒置", chipBusy: "忙碌中({0} 張)",
|
|
58
|
+
chipSending: "已交給 {0}", chipQueued: "等它接手", chipOffline: "{0} 離線", chipPaused: "{0} 已暫停", chipDelivered: "已送達", chipRead: "已讀",
|
|
59
|
+
chipFailed: "沒送達", chipUncertain: "不確定是否送達", chipWithdrawn: "已撤回", chipNotTold: "沒通知到", chipUnclaimed: "尚未認領", chipUnclaimedLate: "還是沒認領",
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// ── What a line says (pure: tests import these) ───────────
|
|
64
|
+
|
|
65
|
+
/** The strongest first, for the main task's summary: working, then what needs a person, then what was handed on, then what is quiet. */
|
|
66
|
+
export const LINE_RANK = { running: 0, needs: 1, stuck: 2, busy: 3, blocked: 4, handed: 5, idle: 6, ready: 7, waiting: 8 };
|
|
67
|
+
/** The notices that are still on their way: the page reads the card again soon while any is. */
|
|
68
|
+
const MOVING = ["sending", "queued", "delivered"];
|
|
69
|
+
/** The reasons a hand-over was not sent that have words of their own; the rest read "{0} was not told". */
|
|
70
|
+
const SKIP_WORDS = new Set(["board_off", "not_taken", "lost"]);
|
|
71
|
+
|
|
72
|
+
/** A card's newest handoff to its current assignee (the page's `handoffs`), or null — an older one to someone else is not the baton now. */
|
|
73
|
+
export function latestHandoff(handoffs, card) {
|
|
74
|
+
let found = null;
|
|
75
|
+
for (const h of handoffs || []) if (h && h.card === card.id && h.to === card.assignee && (!found || h.id > found.id)) found = h;
|
|
76
|
+
return found;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The notice has been taken (or nothing is known of it), so a working instance may be on the card; one still on its way, failed or held back has not got it. */
|
|
80
|
+
export function handoffAllows(h) {
|
|
81
|
+
return !h || h.state === "delivered" || h.state === "read" || h.state === "unknown" || (h.state === "skipped" && h.skip === "not_waiting");
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** An instance that has been working this long on a card it has not claimed is flagged: asked to claim, or the person moves it. */
|
|
85
|
+
export const UNCLAIMED_GRACE_MS = 90_000;
|
|
86
|
+
/** While a "not claimed yet" line is on the page it is looked at again this often, so it turns into the flagged one without waiting for the store to change. */
|
|
87
|
+
export const CLOCK_MS = 30_000;
|
|
88
|
+
|
|
89
|
+
/** Redraws the caller every `ms` while `on` — no timer at all otherwise. */
|
|
90
|
+
function useClock(on, ms = CLOCK_MS) {
|
|
91
|
+
const [, tick] = useState(0);
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
if (!on) return undefined;
|
|
94
|
+
const handle = setInterval(() => tick((n) => n + 1), ms);
|
|
95
|
+
return () => clearInterval(handle);
|
|
96
|
+
}, [on, ms]);
|
|
97
|
+
}
|
|
98
|
+
/** Whether a line says "not claimed yet" and may still turn into the flagged one. */
|
|
99
|
+
const turning = (line) => !!line && line.kind === "running" && !!line.unclaimed && !line.late;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* A handoff in words: `{ tone, text, chip, tip? }`, or null when there is nothing to say (the card no longer waited on it, the delivery has no
|
|
103
|
+
* record any more). `chip`: the short label of the sub tasks' rows. `tone`: `wait` (on its way), `ok` (taken), `busy` (its instance is working), `bad` (not sent), `muted` (withdrawn).
|
|
104
|
+
* `states`: the instances' dot states by name (`instanceStates`): offline and paused are the page's inference, as under a comment.
|
|
105
|
+
*/
|
|
106
|
+
export function handoffText(h, states) {
|
|
107
|
+
if (!h) return null;
|
|
108
|
+
const to = h.to;
|
|
109
|
+
const state = states && states.get ? states.get(to) : undefined;
|
|
110
|
+
switch (h.state) {
|
|
111
|
+
case "skipped": return h.skip === "not_waiting" ? null : { tone: "bad", text: t(`taskflow.skip.${SKIP_WORDS.has(h.skip) ? h.skip : "other"}`, to), chip: t("taskflow.chipNotTold") };
|
|
112
|
+
case "failed": return { tone: "bad", text: t("taskflow.failed", to), chip: t("taskflow.chipFailed") };
|
|
113
|
+
case "uncertain": return { tone: "bad", text: t("taskflow.uncertain", to), chip: t("taskflow.chipUncertain") };
|
|
114
|
+
case "withdrawn": return { tone: "muted", text: t("taskflow.withdrawn", to), chip: t("taskflow.chipWithdrawn") };
|
|
115
|
+
case "sending": return { tone: "wait", text: t("taskflow.sending", to), chip: t("taskflow.chipSending", to) };
|
|
116
|
+
case "queued": {
|
|
117
|
+
const off = state === "stopped" || state === "crashed", paused = state === "paused";
|
|
118
|
+
return { tone: "wait", text: t(off ? "taskflow.offline" : paused ? "taskflow.paused" : "taskflow.queued", to), chip: off ? t("taskflow.chipOffline", to) : paused ? t("taskflow.chipPaused", to) : t("taskflow.chipQueued") };
|
|
119
|
+
}
|
|
120
|
+
// (An instance that is working is not "working on this card" here: when it probably is, the card says so as a running line — `subLine`,
|
|
121
|
+
// `runUnclaimed` — and when it cannot be known, the notice's own state is all that is said: never "working" beside "not started".)
|
|
122
|
+
case "delivered": case "read": return { tone: "ok", text: t(h.state === "read" ? "taskflow.read" : "taskflow.delivered", to), chip: t(h.state === "read" ? "taskflow.chipRead" : "taskflow.chipDelivered") };
|
|
123
|
+
default: return null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* What a sub task says, or null: `{ kind, tone, text, chip?, tip?, spin?, who }` — see this file's head. `text` is the whole sentence (the main task's block lists it, the
|
|
129
|
+
* row's tooltip starts with it); `chip` the short label of the row (none for a sub task that is running: its title shimmers); `tip` explains. `ctx`: { handoffs, states, doing, live(name) → the step line }.
|
|
130
|
+
*/
|
|
131
|
+
export function subLine(card, ctx) {
|
|
132
|
+
const who = card.assignee || "";
|
|
133
|
+
if (card.status === "claimed") {
|
|
134
|
+
const run = who ? runOf(card, { states: ctx.states, doing: ctx.doing }) : null;
|
|
135
|
+
if (!run) return null;
|
|
136
|
+
if (run.state === "working" && run.shared) { const text = `${who} · ${t("taskflow.busyN", run.shared)}`; return { kind: "busy", tone: "muted", who, text, chip: t("taskflow.chipBusy", run.shared), tip: `${text}\n${t("taskflow.busyTip", who, run.shared)}` }; }
|
|
137
|
+
if (run.state === "working") {
|
|
138
|
+
const doing = (ctx.live && ctx.live(who)) || "";
|
|
139
|
+
const text = `${who} · ${doing || t("taskflow.running")}`;
|
|
140
|
+
return { kind: "running", tone: "busy", who, spin: true, text, tip: `${text}\n${t("taskflow.runningTip", who)}` };
|
|
141
|
+
}
|
|
142
|
+
if (run.state === "needs") return { kind: "needs", tone: "warn", who, text: `${who} · ${t("taskflow.needs")}`, chip: t("taskflow.chipNeeds") };
|
|
143
|
+
if (run.state === "stuck") return { kind: "stuck", tone: "bad", who, text: `${who} · ${t("taskflow.stuck")}`, chip: t("taskflow.chipStuck") };
|
|
144
|
+
return { kind: "idle", tone: "muted", who, text: `${who} · ${t("taskflow.idle")}`, chip: t("taskflow.chipIdle") };
|
|
145
|
+
}
|
|
146
|
+
if (card.status === "blocked") return { kind: "blocked", tone: "bad", who, text: card.blockedReason ? t("taskflow.blockedOn", card.blockedReason) : t("taskflow.blocked"), chip: t("taskflow.chipBlocked") };
|
|
147
|
+
if (card.status !== "open") return null;
|
|
148
|
+
if (waitsOn(card)) { const list = waitsList(card, ", "); return { kind: "waiting", tone: "wait", who, text: t("taskflow.waitsFor", list), chip: t("taskflow.chipWaits", list) }; }
|
|
149
|
+
if (!who) return { kind: "ready", tone: "wait", who, text: t("taskflow.readyNobody"), chip: t("taskflow.chipReady") };
|
|
150
|
+
const latest = latestHandoff(ctx.handoffs, card);
|
|
151
|
+
// The card is still open, but its assignee is working and probably on it (it was given the card, can start, has nothing in progress): it did not
|
|
152
|
+
// claim it. A running line, with the step, marked "not claimed" — and flagged once it has gone on a while.
|
|
153
|
+
if (handoffAllows(latest) && runUnclaimed(card, ctx)) {
|
|
154
|
+
const doing = (ctx.live && ctx.live(who)) || "";
|
|
155
|
+
const since = Math.max(Date.parse(latest && latest.at) || 0, Date.parse(card.handedAt) || 0, Date.parse(card.updatedAt) || 0);
|
|
156
|
+
const late = since > 0 && (ctx.now || Date.now()) - since > UNCLAIMED_GRACE_MS;
|
|
157
|
+
const text = `${who} · ${doing || t("taskflow.running")} (${t(late ? "taskflow.unclaimedLate" : "taskflow.unclaimed")})`;
|
|
158
|
+
return { kind: "running", tone: late ? "warn" : "busy", who, spin: true, unclaimed: true, late, text, chip: t(late ? "taskflow.chipUnclaimedLate" : "taskflow.chipUnclaimed"),
|
|
159
|
+
tip: `${text}\n${t(late ? "taskflow.unclaimedLateTip" : "taskflow.unclaimedTip", who)}` };
|
|
160
|
+
}
|
|
161
|
+
const said = handoffText(latest, ctx.states);
|
|
162
|
+
return said ? { kind: "handed", who, ...said } : { kind: "ready", tone: "wait", who, text: t("taskflow.readyFor", who), chip: t("taskflow.chipReady") };
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** What the main task's block lists: a sub task someone is on, something that needs a person, a hand-over on its way or failed. A sub task that only waits, or is ready with no record of a hand-over, is the list's row, not the block's. */
|
|
166
|
+
const SUMMARISED = new Set(["running", "needs", "stuck", "busy", "blocked", "handed", "idle"]);
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* The lines the main task's "Agent activity" block says: what its sub tasks are doing, the strongest first (running, waiting for you, stuck,
|
|
170
|
+
* busy, blocked, handed on, idle). At most `max`, and how many more there were. `{ lines: [{ card, line }], more }`; no line when nothing is going on
|
|
171
|
+
* (every sub task done, cancelled, waiting, or ready with nobody told) — the block is then its one quiet line.
|
|
172
|
+
*/
|
|
173
|
+
export function mainLines(subs, ctx, max = 4) {
|
|
174
|
+
const all = [];
|
|
175
|
+
for (const card of subs || []) {
|
|
176
|
+
if (card.status === "cancelled" || card.status === "done") continue;
|
|
177
|
+
const line = subLine(card, ctx);
|
|
178
|
+
if (line && SUMMARISED.has(line.kind)) all.push({ card, line });
|
|
179
|
+
}
|
|
180
|
+
const pick = all.map((x, i) => ({ ...x, i })).sort((a, b) => LINE_RANK[a.line.kind] - LINE_RANK[b.line.kind] || a.i - b.i);
|
|
181
|
+
return { lines: pick.slice(0, max).map(({ card, line }) => ({ card, line })), more: Math.max(0, pick.length - max) };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* How a handoff was followed by its card starting: the card's move to in progress at or after it (a sub task's, from the main task's sub events; its own,
|
|
186
|
+
* from its history) — `{ at, by }`, `by` the one who moved it (the instance it was handed to, or someone else) — or null.
|
|
187
|
+
*/
|
|
188
|
+
export function startedAfter(h, detail) {
|
|
189
|
+
const at = Date.parse(h.at) || 0;
|
|
190
|
+
const moves = [];
|
|
191
|
+
for (const e of (detail && detail.subEvents) || []) if (e.card === h.card) moves.push({ at: e.at, by: e.actor, to: e.data && e.data.to });
|
|
192
|
+
if (detail && detail.card && detail.card.id === h.card) for (const e of detail.history || []) if (e.type === "moved") moves.push({ at: e.at, by: e.actor, to: e.data && e.data.to });
|
|
193
|
+
const hit = moves.filter((m) => m.to === "claimed" && (Date.parse(m.at) || 0) >= at - 1000).sort((a, b) => (Date.parse(a.at) || 0) - (Date.parse(b.at) || 0))[0];
|
|
194
|
+
return hit ? { at: hit.at, by: hit.by || "" } : null;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* A handoff as the activity stream says it (pure: tests import it): the sentence — "S-1 done → handed to dev to start S-2" — and, under it,
|
|
199
|
+
* where it stands: the card started (`done`) — "dev started S-2", or just "S-2 started" when someone other than the instance it was handed to moved it
|
|
200
|
+
* (a person, another instance: the page does not say the baton-holder did what it did not) — or what `handoffText` says. `started`: `startedAfter`'s.
|
|
201
|
+
*/
|
|
202
|
+
export function batonOf(h, states, started) {
|
|
203
|
+
const lead = h.why === "assigned" ? t("taskflow.handedAssigned", "", h.to, h.card)
|
|
204
|
+
: h.after ? t("taskflow.handedAfter", h.after, h.to, h.card) : t("taskflow.handedReady", "", h.to, h.card);
|
|
205
|
+
const said = handoffText(h, states); // (its short label is the sub tasks' rows': not here)
|
|
206
|
+
const status = started ? { tone: "done", text: started.by === h.to ? t("taskflow.started", h.to, h.card) : t("taskflow.startedNeutral", h.card) } : said && { tone: said.tone, text: said.text, ...(said.tip ? { tip: said.tip } : {}) };
|
|
207
|
+
return { lead, status };
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** Whether any handoff has a notice still on its way, so that the page reads the card again soon (see `wakesMoving`). */
|
|
211
|
+
export function handoffsMoving(detail, now = Date.now()) {
|
|
212
|
+
for (const h of (detail && detail.handoffs) || []) if (MOVING.includes(h.state) && now - (Date.parse(h.at) || 0) <= 3 * 60_000) return true;
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/** The instances a card's handoffs were made to, for the page to read their states of. */
|
|
217
|
+
export const handoffNames = (detail) => [...new Set(((detail && detail.handoffs) || []).map((h) => h.to))];
|
|
218
|
+
|
|
219
|
+
// ── The steps of the sub tasks that are running ───────────
|
|
220
|
+
|
|
221
|
+
/** Bumped when a feed read something: what draws a step line redraws (the card page itself does not). */
|
|
222
|
+
export const liveFeeds = createStore({ n: 0 });
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* The line "what it is doing now" of an instance, from the steps the chat's feed holds (`observeActivity`): the newest step the way the chat's
|
|
226
|
+
* activity block says it ("Edit src/game.js"), or the backend's own phase ("Reasoning…") when no call is running. Empty — the state alone — when
|
|
227
|
+
* there is nothing to draw from: not an admin, the agent's tool_progress is off, its backend offers no steps, or nothing was written yet.
|
|
228
|
+
*/
|
|
229
|
+
export function liveLineOf(name) {
|
|
230
|
+
const snap = activitySnapshot(name);
|
|
231
|
+
const group = snap ? liveGroupOf(snap, { since: 0, busy: true }) : null;
|
|
232
|
+
if (!group) return "";
|
|
233
|
+
const draw = activityDrawCtx(name);
|
|
234
|
+
const items = group.items.filter((s) => draw.thinking || s.kind !== "thinking");
|
|
235
|
+
const last = items[items.length - 1];
|
|
236
|
+
const callRunning = !!last && last.kind === "tool" && last.status === "running";
|
|
237
|
+
if (group.phase && !callRunning) { const key = `act.ph_${group.phase}`; const word = t(key); if (word !== key) return word; }
|
|
238
|
+
return last ? stepLine(last, draw.paths) : "";
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/** Holds the feeds of these instances while they are running a sub task and the viewer may see steps; says nothing itself. */
|
|
242
|
+
export function FeedWatch({ names }) {
|
|
243
|
+
const key = [...new Set(names)].sort().join("\u0000");
|
|
244
|
+
useEffect(() => {
|
|
245
|
+
if (!key) return undefined;
|
|
246
|
+
const feeds = key.split("\u0000").map((name) => observeActivity(name, {
|
|
247
|
+
changed: () => liveFeeds.set((s) => ({ n: s.n + 1 })),
|
|
248
|
+
streamOn: appStore.get().streamOn,
|
|
249
|
+
polling: () => globalThis.document?.body?.dataset?.webTransport === "poll" || appStore.get().connection === "polling",
|
|
250
|
+
wantThinking: () => activityPrefs.get().thinking,
|
|
251
|
+
working: () => true,
|
|
252
|
+
}));
|
|
253
|
+
for (const f of feeds) f.start();
|
|
254
|
+
return () => { for (const f of feeds) f.stop(); };
|
|
255
|
+
}, [key]);
|
|
256
|
+
return null;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* The context the lines are drawn from: the sub tasks' `handoffs`, their instances' states (read now: the page draws again with the store), how
|
|
261
|
+
* many cards each has in progress and which open cards it could start (`doing`, `ready`: the board's), and the step line of a running one (only when this viewer is offered steps).
|
|
262
|
+
*/
|
|
263
|
+
export function flowContext(subs, handoffs, doing, ready = null) {
|
|
264
|
+
const names = [...new Set((subs || []).map((c) => c.assignee).filter(Boolean))];
|
|
265
|
+
const offered = activityOffered() && activityPrefs.get().on;
|
|
266
|
+
return { handoffs: handoffs || [], states: instanceStates(appStore.get(), names), doing, ready, live: offered ? liveLineOf : () => "", now: Date.now() };
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/** The instances whose steps this page should hold: those running a sub task (and not shared with another card), when steps are offered. */
|
|
270
|
+
export function watchedNames(subs, ctx) {
|
|
271
|
+
if (!(activityOffered() && activityPrefs.get().on)) return [];
|
|
272
|
+
return (subs || []).filter((c) => { const l = subLine(c, { ...ctx, live: () => "" }); return !!l && l.kind === "running"; }).map((c) => c.assignee);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// ── What is drawn ─────────────────────────────────────────
|
|
276
|
+
|
|
277
|
+
const ICON = { wait: "clock", ok: "check", done: "check", busy: "clock", bad: "alert", warn: "alert", muted: "info" };
|
|
278
|
+
|
|
279
|
+
/** One line's content: a turning ring while it is running, an icon otherwise, then the words (the whole text in the tooltip). */
|
|
280
|
+
export function LineBody({ line }) {
|
|
281
|
+
return html`${line.spin ? html`<span class="out-spin tf-spin" aria-hidden="true"></span>` : html`<${Icon} name=${line.kind === "handed" ? "forward" : ICON[line.tone] || "info"} size=${13} />`}<span class="tf-says">${line.text}</span>`;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** The short label beside a sub task's title (inside the row's button: the whole row opens the card); the whole sentence is the row's tooltip. */
|
|
285
|
+
export function RowChip({ line }) {
|
|
286
|
+
if (!line || !line.chip) return null;
|
|
287
|
+
return html`<span class=${`tf-chip tf-${line.tone}`}>${line.chip}</span>`;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* The sub tasks list: a row each of status, number, title and who. What is happening is in the row — no second line: a sub task its agent is running
|
|
292
|
+
* has its title shimmer (still with reduced motion; the row is tinted as a running board row is), any other state is a short label beside the title, and the
|
|
293
|
+
* whole sentence (with the step, for an admin whose agent has tool progress on) is the row's tooltip. While a sub task is running and steps are offered,
|
|
294
|
+
* the page holds its instance's feed (`FeedWatch`) — the main task's "Agent activity" block shows the steps. `children`: the card read's sub tasks; `handoffs`: the card read's.
|
|
295
|
+
*/
|
|
296
|
+
export function SubRows({ children, handoffs, doing, ready = null, onOpen }) {
|
|
297
|
+
useStore(appStore);
|
|
298
|
+
useStore(liveFeeds);
|
|
299
|
+
const ctx = flowContext(children, handoffs, doing, ready);
|
|
300
|
+
const lines = children.map((c) => subLine(c, ctx));
|
|
301
|
+
useClock(lines.some(turning));
|
|
302
|
+
return html`<${FeedWatch} names=${watchedNames(children, ctx)} />
|
|
303
|
+
<ul class="tc-children">${children.map((c, i) => {
|
|
304
|
+
const line = lines[i], running = !!line && line.kind === "running";
|
|
305
|
+
return html`<li key=${c.id}><button type="button" class=${running ? "is-running" : undefined} title=${line ? line.tip || line.text : undefined} data-line=${line ? line.kind : undefined} onClick=${() => onOpen(c.id)}>
|
|
306
|
+
<${StatusPill} status=${c.status} card=${c} /><span class="tb-code">${c.id}</span>
|
|
307
|
+
<span class="tc-child-title"><span class=${running ? "tf-shimmer" : undefined}>${c.title}</span><${RowChip} line=${line} /></span><span class="tb-who">${c.assignee || ""}</span></button></li>`;
|
|
308
|
+
})}</ul>`;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/** The main task's "Agent activity" lines: one per sub task that has something going on, the sub task's number opens it. */
|
|
312
|
+
export function FlowLines({ subs, handoffs, doing, ready = null, onOpen }) {
|
|
313
|
+
useStore(liveFeeds);
|
|
314
|
+
const ctx = flowContext(subs, handoffs, doing, ready);
|
|
315
|
+
const { lines, more } = mainLines(subs, ctx);
|
|
316
|
+
useClock(lines.some((x) => turning(x.line)));
|
|
317
|
+
if (!lines.length) return null;
|
|
318
|
+
return html`<ul class="tf-lines" aria-label=${t("taskflow.linesLabel")}>${lines.map(({ card, line }) => html`<li key=${card.id} class=${`tf-item tf-${line.tone} tf-k-${line.kind}`} title=${line.tip || line.text}>
|
|
319
|
+
<${LineBody} line=${line} /><button type="button" class="tb-link tb-code tf-card" title=${t("taskflow.openCard", card.id)} onClick=${() => onOpen(card.id)}>${card.id}</button></li>`)}
|
|
320
|
+
${more ? html`<li class="tf-extra muted">${t("taskflow.more", more)}</li>` : null}</ul>`;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/** Whether the main task has lines to show, for its block to open (the block itself draws `FlowLines`). */
|
|
324
|
+
export const hasFlow = (subs, handoffs, doing, ready = null) => mainLines(subs, flowContext(subs, handoffs, doing, ready)).lines.length > 0;
|
|
325
|
+
|
|
326
|
+
/** A handoff in the activity stream: a row that is never folded away — the sentence, its time, and where it stands under it. */
|
|
327
|
+
export function BatonEntry({ entry, states, runFor = null }) {
|
|
328
|
+
useStore(liveFeeds); // the step line moves with the feed: only this row redraws, not the stream
|
|
329
|
+
const run = runFor ? runFor(entry) : null;
|
|
330
|
+
useClock(turning(run));
|
|
331
|
+
const { lead, status: handed } = batonOf(entry.h, states, entry.started);
|
|
332
|
+
// The card is still open but its agent is running on it (not claimed): the row says so, with the step, instead of where the notice stands.
|
|
333
|
+
const status = !entry.started && run ? { tone: run.tone, text: run.text, tip: run.tip, spin: true } : handed;
|
|
334
|
+
return html`<li class="tl-item tl-baton" data-baton=${entry.h.card} aria-label=${t("taskflow.handoffLabel")}>
|
|
335
|
+
<div class="tl-line"><span class="tl-mark" aria-hidden="true"><${Icon} name="forward" size=${14} /></span>
|
|
336
|
+
<span class="tl-sentence">${lead}</span>
|
|
337
|
+
<time class="muted tl-time" dateTime=${entry.at}>${relTime(entry.at)}</time></div>
|
|
338
|
+
${status ? html`<ul class="tl-wakes tf-wakes"><li class=${`tl-wake wk-${status.tone}`} title=${status.tip || undefined}>${status.spin ? html`<span class="out-spin tf-spin" aria-hidden="true"></span>` : html`<${Icon} name=${ICON[status.tone] || "info"} size=${13} cls=${status.tone === "busy" ? "wk-spin" : ""} />`}<span>${status.text}</span></li></ul>` : null}
|
|
339
|
+
</li>`;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* The running line of the card a handoff row is about, when that is its newest handoff to its current assignee and the assignee is running on it
|
|
344
|
+
* without having claimed it (`subLine`'s running, unclaimed) — else null. The card is the card read's own or one of its children.
|
|
345
|
+
*/
|
|
346
|
+
export function batonRun(h, detail, doing, ready) {
|
|
347
|
+
const card = detail && (detail.card && detail.card.id === h.card ? detail.card : ((detail.children || []).find((c) => c.id === h.card) || null));
|
|
348
|
+
if (!card || card.status !== "open") return null;
|
|
349
|
+
const latest = latestHandoff(detail.handoffs, card);
|
|
350
|
+
if (!latest || latest.id !== h.id) return null;
|
|
351
|
+
const line = subLine(card, flowContext([card], detail.handoffs, doing, ready));
|
|
352
|
+
return line && line.kind === "running" && line.unclaimed ? line : null;
|
|
353
|
+
}
|
package/dist/ui/fleet-task-md.js
CHANGED
|
@@ -14,7 +14,7 @@ export const commentHtml = (text) => {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
/** The chat's copy: the clipboard, else a hidden text area (a plain-http page has no clipboard API). */
|
|
17
|
-
async function copyText(text) {
|
|
17
|
+
export async function copyText(text) {
|
|
18
18
|
try { if (navigator.clipboard && globalThis.isSecureContext) { await navigator.clipboard.writeText(text); return true; } } catch { /* fall back */ }
|
|
19
19
|
const ta = document.createElement("textarea"); ta.value = text; ta.setAttribute("readonly", ""); ta.className = "offscreen";
|
|
20
20
|
document.body.appendChild(ta); ta.select();
|
|
@@ -18,7 +18,7 @@ import { chatPath, detailsPath } from "/assets/app-route.js";
|
|
|
18
18
|
import { Icon } from "/assets/ui-icons.js";
|
|
19
19
|
import { ActivityBlock, activityDrawCtx, activityOffered, activityPrefs, activitySnapshot, observeActivity } from "./chat-activity.js";
|
|
20
20
|
import { SHOWN, TIME_SLACK_MS, hasSubstance } from "./chat-activity-groups.js";
|
|
21
|
-
import { Who } from "./fleet-task-common.js";
|
|
21
|
+
import { Who, waitsOn } from "./fleet-task-common.js";
|
|
22
22
|
|
|
23
23
|
register("taskrun", {
|
|
24
24
|
en: {
|
|
@@ -30,6 +30,8 @@ register("taskrun", {
|
|
|
30
30
|
noSteps: "This agent's runtime does not offer its steps.",
|
|
31
31
|
waiting: "Not started: {0} will update this once it takes the card", waitingNobody: "Not started: whoever takes the card will update this",
|
|
32
32
|
viaSubs: "The work is in its sub tasks: each one's agent updates its own card", nothingYet: "No state or result written yet",
|
|
33
|
+
runningUnclaimed: "Running · not claimed", unclaimedTip: "{0} is working and this is the card it was given, but it has not moved it to In progress (it did not claim it): what it is doing now is probably this card",
|
|
34
|
+
unclaimedNote: "{0} is working and has this card, but has not claimed it — the board shows work only once a card is in progress.",
|
|
33
35
|
},
|
|
34
36
|
"zh-TW": {
|
|
35
37
|
title: "Agent 活動", running: "執行中", needs: "等你回應", stuck: "似乎卡住", idle: "閒置", sharedMark: "忙碌中 · {0} 張卡", byAgent: "Agent", byAgentTip: "由 Agent 做的",
|
|
@@ -40,6 +42,8 @@ register("taskrun", {
|
|
|
40
42
|
noSteps: "這個 Agent 的執行環境沒有提供步驟。",
|
|
41
43
|
waiting: "待啟動:{0} 接手後會在這裡更新", waitingNobody: "待啟動:有人接手後會在這裡更新",
|
|
42
44
|
viaSubs: "工作在子任務裡:各子任務的 Agent 會在自己的卡上更新", nothingYet: "還沒有目前狀態或產出",
|
|
45
|
+
runningUnclaimed: "執行中・尚未認領", unclaimedTip: "{0} 正在執行,而這是交給它的卡,但它還沒有把卡片移到進行中(沒有認領):它現在做的很可能就是這張",
|
|
46
|
+
unclaimedNote: "{0} 正在執行,手上有這張卡,但還沒有認領——卡片要移到進行中,板子才會顯示有人在做。",
|
|
43
47
|
},
|
|
44
48
|
});
|
|
45
49
|
|
|
@@ -62,6 +66,22 @@ export function inProgressBy(cards) {
|
|
|
62
66
|
return out;
|
|
63
67
|
}
|
|
64
68
|
|
|
69
|
+
/**
|
|
70
|
+
* The open cards each instance has that it could start now — nothing left to wait for (the card's own `unmetDeps`, and one it cannot see) —
|
|
71
|
+
* by name, as card numbers. A main task that follows its sub tasks aside (its sub tasks are the work). With `inProgressBy`, what says whether a
|
|
72
|
+
* working instance with nothing in progress is probably on its one open card (`runUnclaimed`).
|
|
73
|
+
*/
|
|
74
|
+
export function readyOpenBy(cards) {
|
|
75
|
+
const out = new Map();
|
|
76
|
+
for (const c of Array.isArray(cards) ? cards : []) {
|
|
77
|
+
if (!c || c.status !== "open" || !c.assignee) continue;
|
|
78
|
+
if (c.kind === "main" && c.progress && c.progress.total > 0) continue;
|
|
79
|
+
if (waitsOn(c)) continue;
|
|
80
|
+
out.set(c.assignee, [...(out.get(c.assignee) || []), c.id]);
|
|
81
|
+
}
|
|
82
|
+
return out;
|
|
83
|
+
}
|
|
84
|
+
|
|
65
85
|
/**
|
|
66
86
|
* The state of each named instance the viewer sees (`dotState`: working, needs, stuck, idle, stopped…), as a map by name —
|
|
67
87
|
* read from the dashboard's store state `{ instances, exec, awaiting }`. A name the viewer does not see is not in it.
|
|
@@ -71,24 +91,73 @@ export function instanceStates(store, names) {
|
|
|
71
91
|
const instances = (store && store.instances) || [];
|
|
72
92
|
for (const name of names) {
|
|
73
93
|
const it = instances.find((i) => i.name === name);
|
|
74
|
-
if (it)
|
|
94
|
+
if (it) { const state = dotState(it, ((store && store.exec) || {})[name], ((store && store.awaiting) || {})[name]); out.set(name, state); noteState(name, state); }
|
|
75
95
|
}
|
|
76
96
|
return out;
|
|
77
97
|
}
|
|
78
98
|
|
|
99
|
+
// When THIS page saw an instance start working (it was not working, then it was): `runUnclaimed` does not take work that began before a card was
|
|
100
|
+
// handed over for work on it (a chat, another job). Nothing is stored or sent: a page opened while the instance is already working has no start
|
|
101
|
+
// (undefined: it cannot say, and does not hold that against the card). Updated wherever a state is read.
|
|
102
|
+
const lastSeen = new Map();
|
|
103
|
+
const workStarts = new Map();
|
|
104
|
+
function noteState(name, state) {
|
|
105
|
+
const was = lastSeen.get(name);
|
|
106
|
+
lastSeen.set(name, state);
|
|
107
|
+
if (state !== "working") workStarts.delete(name);
|
|
108
|
+
else if (was !== undefined && was !== "working" && !workStarts.has(name)) workStarts.set(name, Date.now());
|
|
109
|
+
}
|
|
110
|
+
/** Tests only: what this page has seen of the instances' states. */
|
|
111
|
+
export function forgetWorkStarts() { lastSeen.clear(); workStarts.clear(); }
|
|
112
|
+
/** When this page saw `name` start working (epoch ms), or undefined. */
|
|
113
|
+
export const workStartOf = (name) => workStarts.get(name);
|
|
114
|
+
|
|
115
|
+
/** A working instance began before the card was handed to it this long ago (clock slack) is not taken to be on that card. */
|
|
116
|
+
const HAND_SLACK_MS = 10_000;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* What an instance is doing on a card that is still open, though it is working: it was given the card (the board told it — `card.handedAt`),
|
|
120
|
+
* can start it, has nothing in progress and no other open card it could be on, and did not start working before it was handed the card — so what
|
|
121
|
+
* it is doing now is probably this card, which it has not claimed. An INFERENCE like `runOf`'s (an agent is one continuing session): `{ instance,
|
|
122
|
+
* state: "working", shared: 0, unclaimed: true }`, or null. An agent once worked for six minutes on an assigned card without claiming it, and
|
|
123
|
+
* the board said nothing; the notice now asks it to claim first, and this says what it cannot hide. Not an agent that is only chatting: a card the
|
|
124
|
+
* board never handed it (no `handedAt`) is not evidence, and neither is work this page saw begin before the hand-over (`workStartOf`).
|
|
125
|
+
* `ctx`: { states, doing, ready, workStart? } — `readyOpenBy` of the board; without `ready` (a caller from before) there is no such run;
|
|
126
|
+
* `workStart` (a Map by name) stands in for what this page observed.
|
|
127
|
+
*/
|
|
128
|
+
export function runUnclaimed(card, ctx) {
|
|
129
|
+
const name = card && card.assignee;
|
|
130
|
+
if (!name || !ctx || card.status !== "open" || waitsOn(card)) return null;
|
|
131
|
+
if (card.kind === "main" && card.progress && card.progress.total > 0) return null;
|
|
132
|
+
const handed = Date.parse(card.handedAt || "");
|
|
133
|
+
if (!Number.isFinite(handed)) return null; // the board never handed it to this instance: not evidence
|
|
134
|
+
if (!(ctx.states && ctx.states.get(name) === "working")) return null;
|
|
135
|
+
if (((ctx.doing && ctx.doing.get(name)) || 0) > 0) return null; // a card in progress is its work
|
|
136
|
+
const mine = ctx.ready && ctx.ready.get(name);
|
|
137
|
+
if (!mine || mine.length !== 1 || mine[0] !== card.id) return null; // none, or several it could be on: nothing says which
|
|
138
|
+
const began = ctx.workStart ? ctx.workStart.get(name) : workStartOf(name);
|
|
139
|
+
if (began !== undefined && began < handed - HAND_SLACK_MS) return null; // it was already at work before the card came: that work is something else
|
|
140
|
+
return { instance: name, state: "working", shared: 0, unclaimed: true };
|
|
141
|
+
}
|
|
142
|
+
|
|
79
143
|
/**
|
|
80
|
-
* What a card's assignee is doing on it, or null (nothing to say): { instance, state: working | needs | stuck | idle, shared }
|
|
144
|
+
* What a card's assignee is doing on it, or null (nothing to say): { instance, state: working | needs | stuck | idle, shared, unclaimed? }
|
|
81
145
|
* — `shared`: how many cards the assignee has in progress when that is more than this one (then which one it is on is
|
|
82
|
-
* not known), else 0
|
|
83
|
-
*
|
|
84
|
-
*
|
|
146
|
+
* not known), else 0; `unclaimed`: it is working on the card it was given without having claimed it (`runUnclaimed`). Only a card in progress
|
|
147
|
+
* has one (or an open one the working assignee probably is on), and only while its assignee is an instance the viewer sees, running.
|
|
148
|
+
* A main task that follows its sub tasks has its running sub tasks' (the strongest, a claimed one first); `subs`: the ones the page shows.
|
|
149
|
+
* `ctx`: { states, doing, ready } — `instanceStates` of the instances with a card in progress or open, `inProgressBy` and `readyOpenBy` of the board.
|
|
85
150
|
*/
|
|
86
151
|
export function runOf(card, ctx, subs = []) {
|
|
87
|
-
if (!card
|
|
152
|
+
if (!card) return null;
|
|
88
153
|
if (card.kind === "main" && card.progress && card.progress.total > 0) {
|
|
89
|
-
|
|
154
|
+
if (card.status !== "claimed" && card.status !== "open") return null;
|
|
155
|
+
const runs = (subs || []).map((s) => runOf(s, ctx)).filter(Boolean)
|
|
156
|
+
.sort((a, b) => RUN_RANK[a.state] - RUN_RANK[b.state] || (a.unclaimed ? 1 : 0) - (b.unclaimed ? 1 : 0));
|
|
90
157
|
return runs[0] || null;
|
|
91
158
|
}
|
|
159
|
+
if (card.status === "open") return runUnclaimed(card, ctx);
|
|
160
|
+
if (card.status !== "claimed") return null;
|
|
92
161
|
const name = card.assignee;
|
|
93
162
|
if (!name || !ctx) return null;
|
|
94
163
|
const state = ctx.states && ctx.states.get(name);
|
|
@@ -101,7 +170,7 @@ export function runOf(card, ctx, subs = []) {
|
|
|
101
170
|
const signature = (states) => [...states].map(([name, state]) => `${name}\u0000${state}`).sort().join("\u0001");
|
|
102
171
|
|
|
103
172
|
/**
|
|
104
|
-
* What the board needs to say "running" on every tile and row: `{ states, doing }` for `runOf`. ONE read of the dashboard's
|
|
173
|
+
* What the board needs to say "running" on every tile and row: `{ states, doing, ready }` for `runOf`. ONE read of the dashboard's
|
|
105
174
|
* store for the whole board, and only of the instances that have a card in progress (the only ones a mark can name):
|
|
106
175
|
* it redraws when one of THOSE states changes, not on every store change (a status poll, a message) — a tile or a row
|
|
107
176
|
* subscribes to nothing. Computed from the store as it is at each draw, so a card that came in progress is never drawn
|
|
@@ -109,16 +178,18 @@ const signature = (states) => [...states].map(([name, state]) => `${name}\u0000$
|
|
|
109
178
|
*/
|
|
110
179
|
export function useRunContext(cards) {
|
|
111
180
|
const doing = useMemo(() => inProgressBy(cards), [cards]);
|
|
181
|
+
const ready = useMemo(() => readyOpenBy(cards), [cards]);
|
|
182
|
+
const names = useMemo(() => [...new Set([...doing.keys(), ...ready.keys()])], [doing, ready]);
|
|
112
183
|
const [, redraw] = useState(0);
|
|
113
|
-
const states = instanceStates(appStore.get(),
|
|
184
|
+
const states = instanceStates(appStore.get(), names);
|
|
114
185
|
const drawn = useRef("");
|
|
115
186
|
drawn.current = signature(states);
|
|
116
187
|
useEffect(() => {
|
|
117
|
-
const changed = () => signature(instanceStates(appStore.get(),
|
|
188
|
+
const changed = () => signature(instanceStates(appStore.get(), names)) !== drawn.current;
|
|
118
189
|
if (changed()) redraw((n) => n + 1); // moved between the draw and this subscription
|
|
119
190
|
return appStore.subscribe(() => { if (changed()) redraw((n) => n + 1); });
|
|
120
|
-
}, [
|
|
121
|
-
return useMemo(() => ({ states, doing }), [doing, drawn.current]);
|
|
191
|
+
}, [names]);
|
|
192
|
+
return useMemo(() => ({ states, doing, ready }), [doing, ready, drawn.current]);
|
|
122
193
|
}
|
|
123
194
|
|
|
124
195
|
/**
|
|
@@ -164,8 +235,8 @@ const stateWord = (state) => t(`taskrun.${state === "working" ? "running" : stat
|
|
|
164
235
|
/** "Running" (or "Busy · N cards", "Needs you", "Looks stuck") beside a tile's or a row's number; idle says nothing there. */
|
|
165
236
|
export function RunMark({ run }) {
|
|
166
237
|
if (!run || run.state === "idle") return null;
|
|
167
|
-
const word = run.state === "working" && run.shared ? t("taskrun.sharedMark", run.shared) : stateWord(run.state);
|
|
168
|
-
return html`<span class=${`tr-mark s-${run.state}${run.shared ? " shared" : ""}`} title=${`${run.instance}: ${word}`}>
|
|
238
|
+
const word = run.unclaimed ? t("taskrun.runningUnclaimed") : run.state === "working" && run.shared ? t("taskrun.sharedMark", run.shared) : stateWord(run.state);
|
|
239
|
+
return html`<span class=${`tr-mark s-${run.state}${run.shared ? " shared" : ""}${run.unclaimed ? " unclaimed" : ""}`} title=${run.unclaimed ? t("taskrun.unclaimedTip", run.instance) : `${run.instance}: ${word}`}>
|
|
169
240
|
<span class="tr-dot" aria-hidden="true"></span>${word}</span>`;
|
|
170
241
|
}
|
|
171
242
|
|
|
@@ -198,9 +269,10 @@ function useFeed(name, on, busy) {
|
|
|
198
269
|
* card, work that lives in its sub tasks, or just that nothing is written. `run`: this card's `runOf`, if any — an assignee
|
|
199
270
|
* that has the card in progress and is idle says so (the one thing it can know).
|
|
200
271
|
*/
|
|
201
|
-
export function handoffNote(card, { derived = false, run = null } = {}) {
|
|
272
|
+
export function handoffNote(card, { derived = false, run = null, baton = "" } = {}) {
|
|
202
273
|
if (run && run.state === "idle") return t("taskrun.idleNote", run.instance);
|
|
203
|
-
|
|
274
|
+
// `baton`: where the card stands in the hand-over (waits for S-1, handed to dev, dev read it…) — fleet-task-flow.js's line for it.
|
|
275
|
+
if (card.status === "open") return baton || (card.assignee ? t("taskrun.waiting", card.assignee) : t("taskrun.waitingNobody"));
|
|
204
276
|
return derived ? t("taskrun.viaSubs") : t("taskrun.nothingYet");
|
|
205
277
|
}
|
|
206
278
|
|
|
@@ -211,24 +283,26 @@ export function handoffNote(card, { derived = false, run = null } = {}) {
|
|
|
211
283
|
* conversation stays). With a state or result, or while the assignee is working, it opens up: who, their state, the way to their
|
|
212
284
|
* conversation, the live steps (an admin, tool progress on), then the fields (`shown`) and the buttons for the empty ones.
|
|
213
285
|
* `doing`: `inProgressBy` of the board. `derived`: a main task that follows its sub tasks has no agent of its own (its sub
|
|
214
|
-
* tasks' pages do), whatever its assignee field says.
|
|
286
|
+
* tasks' pages do), whatever its assignee field says — what they are doing is `flow` (fleet-task-flow.js's `FlowLines`, drawn when
|
|
287
|
+
* `flowOn`: a sub task is running, waiting for the person, handed on…), and without it the block is the one quiet line. `baton`: a card
|
|
288
|
+
* that waits to start says where the hand-over stands, in words (`handoffNote`).
|
|
215
289
|
*/
|
|
216
|
-
export function AgentRun({ card, detail, doing, derived = false, shown = [], adders = [] }) {
|
|
290
|
+
export function AgentRun({ card, detail, doing, ready = null, derived = false, shown = [], adders = [], flow = null, flowOn = false, baton = "" }) {
|
|
217
291
|
const store = useStore(appStore); // one card's page: one subscription
|
|
218
292
|
useStore(activityPrefs);
|
|
219
293
|
const name = !derived && card.assignee ? card.assignee : null;
|
|
220
294
|
const it = name ? (store.instances || []).find((i) => i.name === name) : null;
|
|
221
|
-
const run = it ? runOf(card, { states: instanceStates(store, [name]), doing }) : null;
|
|
295
|
+
const run = it ? runOf(card, { states: instanceStates(store, [name]), doing, ready }) : null;
|
|
222
296
|
const live = !!run && run.state !== "idle";
|
|
223
297
|
const offered = live && activityOffered() && activityPrefs.get().on;
|
|
224
298
|
useFeed(name, offered, live);
|
|
225
299
|
const chat = it ? html`<a class="btn btn-sm tr-open" href=${chatPath(name)} title=${t("taskrun.openChatTip", name)}><${Icon} name="chat" size=${14} />${t("taskrun.openChat")}</a>` : null;
|
|
226
300
|
const extras = adders.length ? html`<span class="tp-adders">${adders}</span>` : null;
|
|
227
|
-
if (!live && !shown.length) {
|
|
301
|
+
if (!live && !shown.length && !flowOn) {
|
|
228
302
|
return html`<section class="tr-run tp-agent is-strip" aria-label=${t("taskrun.title")}>
|
|
229
303
|
<span class="tp-agent-icon" aria-hidden="true"><${Icon} name="bot" size=${16} /></span>
|
|
230
304
|
<span class="tr-title">${t("taskrun.title")}</span>
|
|
231
|
-
<span class="tp-agent-note">${handoffNote(card, { derived, run })}</span>
|
|
305
|
+
<span class="tp-agent-note">${handoffNote(card, { derived, run, baton })}</span>
|
|
232
306
|
<span class="tb-grow"></span>${extras}${chat}
|
|
233
307
|
</section>`;
|
|
234
308
|
}
|
|
@@ -246,8 +320,10 @@ export function AgentRun({ card, detail, doing, derived = false, shown = [], add
|
|
|
246
320
|
<span class="tb-grow"></span>
|
|
247
321
|
${chat}
|
|
248
322
|
</div>
|
|
323
|
+
${flowOn ? flow : null}
|
|
249
324
|
${run && run.state === "idle" ? html`<p class="muted tr-note">${t("taskrun.idleNote", name)}</p>` : null}
|
|
250
325
|
${run && run.shared ? html`<p class="muted tr-note">${t("taskrun.sharedNote", name, run.shared)}</p>` : null}
|
|
326
|
+
${run && run.unclaimed ? html`<p class="tr-note tr-unclaimed">${t("taskrun.unclaimedNote", name)}</p>` : null}
|
|
251
327
|
${group ? html`<${ActivityBlock} group=${group} ctx=${activityDrawCtx(name)} />` : null}
|
|
252
328
|
${off ? html`<p class="muted tr-note">${t("taskrun.stepsOff", name)} <a class="link" href=${detailsPath(name)}>${t("taskrun.stepsOffLink")}</a></p>` : null}
|
|
253
329
|
${none ? html`<p class="muted tr-note">${t("taskrun.noSteps")}</p>` : null}
|