gentle-pi 4.8.0 → 4.9.0
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/README.md +60 -0
- package/assets/agents/gentle-ai-explore.md +1 -1
- package/assets/agents/gentle-ai-verify.md +1 -1
- package/assets/agents/gentle-ai-worker.md +10 -9
- package/assets/design-canvas/canvas-boards.js +22 -2
- package/assets/design-canvas/canvas-boot.js +3 -1
- package/assets/design-canvas/canvas-i18n-es.js +5 -0
- package/assets/design-canvas/canvas-menu.js +13 -7
- package/assets/design-canvas/canvas-messages.js +1 -1
- package/assets/design-canvas/canvas-rail.js +5 -2
- package/assets/design-canvas/canvas-store.js +3 -0
- package/assets/design-canvas/canvas-theme.js +69 -0
- package/assets/design-canvas/canvas.css +27 -2
- package/assets/design-canvas/index.html +3 -0
- package/assets/design-canvas/inspector.js +28 -5
- package/assets/design-canvas/theme-early.js +10 -0
- package/assets/migrations/agent-body-history.json +6 -0
- package/assets/orchestrator-delegation.md +1 -5
- package/assets/orchestrator-full-delegation-card.md +9 -13
- package/assets/orchestrator-full-delegation.md +2 -2
- package/assets/orchestrator-memory.md +2 -2
- package/assets/orchestrator-prompts.md +3 -31
- package/assets/orchestrator-tracking.md +6 -6
- package/assets/orchestrator-verification.md +4 -4
- package/assets/orchestrator-writer.md +12 -12
- package/assets/orchestrator.md +2 -2
- package/bin/gentle-shell.mjs +77 -1
- package/contracts/review-provider-contract-mirror/provider-contract.lock.json +7 -7
- package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/manifest.json +3 -3
- package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/orchestration/pi.md +1 -1
- package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/routing/pi.md +10 -10
- package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/generated/provider-capabilities.baseline.json +3 -3
- package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/generated/provider-roles.baseline.json +1 -1
- package/docs/assets/features/gentle-tower.png +0 -0
- package/docs/auto-permission-answers.md +1 -1
- package/docs/bundled-install.md +1 -1
- package/docs/delegated-verification.md +6 -4
- package/docs/desktop-feed.md +303 -0
- package/docs/desktop-rpc.md +703 -25
- package/docs/fast-mode.md +2 -2
- package/docs/gentle-shell-desktop.md +465 -0
- package/docs/gentle-shell.md +65 -3
- package/docs/images/desktop/chat.png +0 -0
- package/docs/images/desktop/palette.png +0 -0
- package/docs/images/desktop/todo.png +0 -0
- package/docs/install-wizard.md +1 -1
- package/docs/odd-preparation-continuity.md +1 -1
- package/docs/readme-reference.md +44 -15
- package/docs/work-continuity.md +10 -7
- package/extensions/ask-user-choice.ts +36 -18
- package/extensions/ask-user-question.ts +47 -8
- package/extensions/gentle-agents.ts +206 -37
- package/extensions/gentle-ai.ts +234 -24
- package/extensions/gentle-desktop-feed.ts +778 -0
- package/extensions/gentle-desktop-rpc.ts +145 -12
- package/extensions/gentle-herdr-desktop-status.ts +275 -0
- package/extensions/gentle-shell.ts +69 -7
- package/extensions/gentle-stats.ts +30 -1
- package/extensions/gentle-tower.ts +305 -0
- package/extensions/skill-registry.ts +13 -3
- package/herdr/RECIPE.md +157 -0
- package/herdr/keys.json +14 -0
- package/herdr/layouts/gentle-shell.json +202 -0
- package/herdr/mods/gentle-agents/icons/kind-herdr.svg +1 -0
- package/herdr/mods/gentle-agents/icons/kind-remote.svg +1 -0
- package/herdr/mods/gentle-agents/icons/kind-tui.svg +1 -0
- package/herdr/mods/gentle-agents/main.js +190 -0
- package/herdr/mods/gentle-agents/mod.json +1 -0
- package/herdr/mods/gentle-agents/snapshot.js +469 -0
- package/herdr/mods/gentle-agents/tokens.js +273 -0
- package/herdr/mods/gentle-chat/MINIMAL.md +69 -0
- package/herdr/mods/gentle-chat/actions.js +180 -0
- package/herdr/mods/gentle-chat/feed.js +321 -0
- package/herdr/mods/gentle-chat/icons/branch.svg +1 -0
- package/herdr/mods/gentle-chat/icons/chat.svg +1 -0
- package/herdr/mods/gentle-chat/icons/check.svg +1 -0
- package/herdr/mods/gentle-chat/icons/chev.svg +1 -0
- package/herdr/mods/gentle-chat/icons/clip.svg +1 -0
- package/herdr/mods/gentle-chat/icons/down.svg +1 -0
- package/herdr/mods/gentle-chat/icons/folder.svg +1 -0
- package/herdr/mods/gentle-chat/icons/kind-herdr.svg +1 -0
- package/herdr/mods/gentle-chat/icons/kind-remote.svg +1 -0
- package/herdr/mods/gentle-chat/icons/kind-tui.svg +1 -0
- package/herdr/mods/gentle-chat/icons/mark.svg +1 -0
- package/herdr/mods/gentle-chat/icons/send.svg +1 -0
- package/herdr/mods/gentle-chat/icons/shield.svg +1 -0
- package/herdr/mods/gentle-chat/icons/stop.svg +1 -0
- package/herdr/mods/gentle-chat/icons/term.svg +1 -0
- package/herdr/mods/gentle-chat/icons/user.svg +1 -0
- package/herdr/mods/gentle-chat/icons/x.svg +1 -0
- package/herdr/mods/gentle-chat/main.js +968 -0
- package/herdr/mods/gentle-chat/mod.json +1 -0
- package/herdr/mods/gentle-chat/session.js +212 -0
- package/herdr/mods/gentle-chat/snapshot.js +469 -0
- package/herdr/mods/gentle-chat/tokens.js +137 -0
- package/herdr/mods/gentle-chat/ui.js +883 -0
- package/herdr/mods/gentle-confirm/main.js +60 -0
- package/herdr/mods/gentle-confirm/mod.json +1 -0
- package/herdr/mods/gentle-inspector/actions.js +180 -0
- package/herdr/mods/gentle-inspector/icons/bolt.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/bot.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/check.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/db.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/diff.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/jobs.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/plug.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/review.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/stats.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/stop.svg +1 -0
- package/herdr/mods/gentle-inspector/icons/todo.svg +1 -0
- package/herdr/mods/gentle-inspector/main.js +500 -0
- package/herdr/mods/gentle-inspector/mod.json +1 -0
- package/herdr/mods/gentle-inspector/snapshot.js +469 -0
- package/herdr/mods/gentle-inspector/tokens.js +273 -0
- package/herdr/mods/gentle-palette/actions.js +180 -0
- package/herdr/mods/gentle-palette/icons/bolt.svg +1 -0
- package/herdr/mods/gentle-palette/icons/bot.svg +1 -0
- package/herdr/mods/gentle-palette/icons/chat.svg +1 -0
- package/herdr/mods/gentle-palette/icons/check.svg +1 -0
- package/herdr/mods/gentle-palette/icons/cmd.svg +1 -0
- package/herdr/mods/gentle-palette/icons/diff.svg +1 -0
- package/herdr/mods/gentle-palette/icons/jobs.svg +1 -0
- package/herdr/mods/gentle-palette/icons/plus.svg +1 -0
- package/herdr/mods/gentle-palette/icons/review.svg +1 -0
- package/herdr/mods/gentle-palette/icons/search.svg +1 -0
- package/herdr/mods/gentle-palette/icons/shield.svg +1 -0
- package/herdr/mods/gentle-palette/icons/stats.svg +1 -0
- package/herdr/mods/gentle-palette/icons/stop.svg +1 -0
- package/herdr/mods/gentle-palette/icons/term.svg +1 -0
- package/herdr/mods/gentle-palette/icons/todo.svg +1 -0
- package/herdr/mods/gentle-palette/main.js +333 -0
- package/herdr/mods/gentle-palette/mod.json +1 -0
- package/herdr/mods/gentle-palette/snapshot.js +469 -0
- package/herdr/mods/gentle-palette/tokens.js +273 -0
- package/herdr/mods/gentle-pane/icons/chat.svg +1 -0
- package/herdr/mods/gentle-pane/icons/close.svg +1 -0
- package/herdr/mods/gentle-pane/icons/kind-herdr.svg +1 -0
- package/herdr/mods/gentle-pane/icons/kind-remote.svg +1 -0
- package/herdr/mods/gentle-pane/icons/kind-tui.svg +1 -0
- package/herdr/mods/gentle-pane/icons/split-down.svg +1 -0
- package/herdr/mods/gentle-pane/icons/split-right.svg +1 -0
- package/herdr/mods/gentle-pane/icons/term.svg +1 -0
- package/herdr/mods/gentle-pane/icons/unzoom.svg +1 -0
- package/herdr/mods/gentle-pane/icons/zoom.svg +1 -0
- package/herdr/mods/gentle-pane/main.js +91 -0
- package/herdr/mods/gentle-pane/mod.json +1 -0
- package/herdr/mods/gentle-pane/snapshot.js +469 -0
- package/herdr/mods/gentle-pane/tokens.js +273 -0
- package/herdr/mods/gentle-sidebar/actions.js +180 -0
- package/herdr/mods/gentle-sidebar/icons/gear.svg +1 -0
- package/herdr/mods/gentle-sidebar/icons/mark.svg +1 -0
- package/herdr/mods/gentle-sidebar/icons/refresh.svg +1 -0
- package/herdr/mods/gentle-sidebar/icons/server-plus.svg +1 -0
- package/herdr/mods/gentle-sidebar/main.js +171 -0
- package/herdr/mods/gentle-sidebar/mod.json +1 -0
- package/herdr/mods/gentle-sidebar/snapshot.js +469 -0
- package/herdr/mods/gentle-sidebar/tokens.js +273 -0
- package/herdr/mods/gentle-spaces/icons/kind-herdr.svg +1 -0
- package/herdr/mods/gentle-spaces/icons/kind-remote.svg +1 -0
- package/herdr/mods/gentle-spaces/icons/kind-tui.svg +1 -0
- package/herdr/mods/gentle-spaces/icons/monitor.svg +1 -0
- package/herdr/mods/gentle-spaces/icons/plus.svg +1 -0
- package/herdr/mods/gentle-spaces/icons/server.svg +1 -0
- package/herdr/mods/gentle-spaces/machines.js +31 -0
- package/herdr/mods/gentle-spaces/main.js +299 -0
- package/herdr/mods/gentle-spaces/mod.json +1 -0
- package/herdr/mods/gentle-spaces/snapshot.js +469 -0
- package/herdr/mods/gentle-spaces/tokens.js +273 -0
- package/herdr/mods/gentle-status/actions.js +180 -0
- package/herdr/mods/gentle-status/main.js +192 -0
- package/herdr/mods/gentle-status/mod.json +1 -0
- package/herdr/mods/gentle-status/snapshot.js +469 -0
- package/herdr/mods/gentle-status/tokens.js +273 -0
- package/herdr/mods/gentle-tabs/icons/close.svg +1 -0
- package/herdr/mods/gentle-tabs/icons/kind-herdr.svg +1 -0
- package/herdr/mods/gentle-tabs/icons/kind-remote.svg +1 -0
- package/herdr/mods/gentle-tabs/icons/kind-tui.svg +1 -0
- package/herdr/mods/gentle-tabs/icons/plus.svg +1 -0
- package/herdr/mods/gentle-tabs/icons/win-close.svg +1 -0
- package/herdr/mods/gentle-tabs/icons/win-max.svg +1 -0
- package/herdr/mods/gentle-tabs/icons/win-min.svg +1 -0
- package/herdr/mods/gentle-tabs/icons/win-restore.svg +1 -0
- package/herdr/mods/gentle-tabs/main.js +171 -0
- package/herdr/mods/gentle-tabs/mod.json +1 -0
- package/herdr/mods/gentle-tabs/snapshot.js +469 -0
- package/herdr/mods/gentle-tabs/tokens.js +273 -0
- package/herdr/mods/gentle-tokens/main.js +20 -0
- package/herdr/mods/gentle-tokens/mod.json +1 -0
- package/herdr/mods/gentle-tokens/snapshot.js +469 -0
- package/herdr/mods/gentle-tokens/tokens.js +273 -0
- package/herdr/preview.png +0 -0
- package/herdr/themes/gentle-shell-dark.json +33 -0
- package/herdr/themes/gentle-shell-light.json +34 -0
- package/lib/agents-protocol.ts +2 -0
- package/lib/agents-rpc-publisher.ts +39 -12
- package/lib/agents-runner.ts +1 -0
- package/lib/auto-permission-answers.ts +2 -1
- package/lib/background-jobs.ts +22 -2
- package/lib/bounded-writer-admission.ts +1 -1
- package/lib/change-diff.ts +104 -0
- package/lib/commit-slice-signal.ts +1 -1
- package/lib/design-canvas-assets.ts +2 -0
- package/lib/desktop-agents-service.ts +31 -10
- package/lib/desktop-changes-service.ts +171 -0
- package/lib/desktop-feed-actions.ts +804 -0
- package/lib/desktop-feed-answers.ts +129 -0
- package/lib/desktop-feed-sources.ts +184 -0
- package/lib/desktop-feed-stats.ts +98 -0
- package/lib/desktop-feed-store.ts +124 -0
- package/lib/desktop-feed.ts +788 -0
- package/lib/desktop-jobs-service.ts +34 -7
- package/lib/desktop-review-service.ts +187 -0
- package/lib/desktop-rpc-agents.ts +112 -3
- package/lib/desktop-rpc-changes.ts +223 -0
- package/lib/desktop-rpc-config-watch.ts +285 -0
- package/lib/desktop-rpc-config.ts +162 -8
- package/lib/desktop-rpc-jobs.ts +118 -9
- package/lib/desktop-rpc-permissions.ts +154 -3
- package/lib/desktop-rpc-review.ts +180 -0
- package/lib/desktop-rpc-session.ts +203 -0
- package/lib/desktop-rpc-sessions.ts +250 -0
- package/lib/desktop-rpc-stats.ts +187 -0
- package/lib/desktop-rpc-updates.ts +143 -0
- package/lib/desktop-rpc.ts +116 -5
- package/lib/desktop-session-service.ts +223 -0
- package/lib/desktop-sessions-service.ts +249 -0
- package/lib/desktop-stats-service.ts +142 -0
- package/lib/desktop-updates-service.ts +268 -0
- package/lib/gentle-shell-desktop.ts +1370 -0
- package/lib/gentle-shell-launcher.ts +45 -3
- package/lib/herdr-desktop-events.ts +40 -0
- package/lib/herdr-desktop-status.ts +229 -0
- package/lib/jobs-sidebar-state.ts +5 -0
- package/lib/native-review-cli.ts +7 -0
- package/lib/openai-fast-tier.ts +1 -0
- package/lib/session-profile-freeze.ts +13 -5
- package/lib/stats-collector.ts +56 -27
- package/lib/tower-actions.ts +100 -0
- package/lib/tower-hub.ts +73 -0
- package/lib/tower-launch.ts +111 -0
- package/lib/tower-open.ts +99 -0
- package/lib/tower-presence.ts +70 -0
- package/lib/tower-server.ts +234 -0
- package/lib/tower-snapshot.ts +298 -0
- package/lib/update-status.ts +238 -0
- package/lib/verifier-settle-reminder.ts +1 -1
- package/package.json +13 -4
- package/runtime/design-canvas-assets.mjs +2 -0
- package/runtime/gentle-shell-desktop.mjs +1371 -0
- package/runtime/gentle-shell-launcher.mjs +44 -2
- package/runtime/native-review-cli.mjs +7 -0
- package/runtime/tower-actions.mjs +101 -0
- package/runtime/tower-hub.mjs +74 -0
- package/runtime/tower-launch.mjs +112 -0
- package/runtime/tower-open.mjs +100 -0
- package/runtime/tower-presence.mjs +71 -0
- package/runtime/tower-server.mjs +234 -0
- package/runtime/tower-snapshot.mjs +299 -0
- package/scripts/build-full-delegation-card.mjs +1 -21
- package/scripts/build-runtime-modules.mjs +9 -0
- package/scripts/gentle-ai-installer.mjs +10 -10
- package/scripts/verify-package-files.mjs +35 -15
- package/skills/provider-defect-report/SKILL.md +61 -0
- package/skills/rdd-defect-workflow/SKILL.md +3 -3
- package/tests/agent-prompt-diet-contract.test.ts +2 -2
- package/tests/append-system-prompt-route.test.ts +16 -5
- package/tests/ask-user-choice.test.ts +78 -21
- package/tests/ask-user-question.test.ts +59 -5
- package/tests/auto-permission-answers.test.ts +12 -1
- package/tests/background-jobs.test.ts +12 -0
- package/tests/bounded-stop-contract.test.ts +139 -26
- package/tests/change-diff.test.ts +75 -0
- package/tests/commit-slice-signal.test.ts +3 -2
- package/tests/decision-routing-contract.test.ts +390 -0
- package/tests/delegated-key-learnings-contract.test.ts +21 -28
- package/tests/delivery-b-rendered-surfaces.test.ts +32 -0
- package/tests/design-canvas-i18n.test.ts +24 -22
- package/tests/design-canvas-inspector.test.ts +67 -0
- package/tests/design-canvas-modules.test.ts +3 -2
- package/tests/design-canvas-rail.test.ts +10 -10
- package/tests/design-canvas-store.test.ts +9 -0
- package/tests/design-canvas-theme.test.ts +198 -0
- package/tests/design-canvas-tokens.test.ts +1 -1
- package/tests/desktop-feed-actions-guards.test.ts +595 -0
- package/tests/desktop-feed-actions.test.ts +761 -0
- package/tests/desktop-feed-live-work.test.ts +209 -0
- package/tests/desktop-feed-performance.test.ts +369 -0
- package/tests/desktop-feed-plan-profiles.test.ts +509 -0
- package/tests/desktop-feed-send-prompt.test.ts +303 -0
- package/tests/desktop-feed-tool-summaries.test.ts +69 -0
- package/tests/desktop-feed.test.ts +615 -0
- package/tests/desktop-rpc-agents.test.ts +428 -2
- package/tests/desktop-rpc-changes.test.ts +608 -0
- package/tests/desktop-rpc-config-watch.test.ts +1159 -0
- package/tests/desktop-rpc-config.test.ts +11 -1
- package/tests/desktop-rpc-design.test.ts +11 -1
- package/tests/desktop-rpc-jobs.test.ts +402 -5
- package/tests/desktop-rpc-permissions.test.ts +11 -1
- package/tests/desktop-rpc-review.test.ts +678 -0
- package/tests/desktop-rpc-session.test.ts +642 -0
- package/tests/desktop-rpc-sessions.test.ts +647 -0
- package/tests/desktop-rpc-stats.test.ts +431 -0
- package/tests/desktop-rpc-updates.test.ts +525 -0
- package/tests/desktop-rpc-usage.test.ts +11 -1
- package/tests/desktop-rpc.test.ts +43 -2
- package/tests/fixtures/primary-session-prompt/gentleman.golden.md +11 -13
- package/tests/fixtures/session-profile-v1/replay.ts +4 -1
- package/tests/full-delegation-closure.test.ts +20 -1
- package/tests/gentle-agents.test.ts +519 -4
- package/tests/gentle-ai-binary.test.ts +1 -1
- package/tests/gentle-ai-installer.test.ts +52 -52
- package/tests/gentle-ai.test.ts +75 -16
- package/tests/gentle-fast.test.ts +15 -0
- package/tests/gentle-herdr-desktop-status.test.ts +595 -0
- package/tests/gentle-shell-desktop-bin.test.ts +125 -0
- package/tests/gentle-shell-desktop.test.ts +927 -0
- package/tests/gentle-shell-launcher-tower.test.ts +104 -0
- package/tests/gentle-shell.test.ts +3 -0
- package/tests/gentle-tower.test.ts +578 -0
- package/tests/herdr-desktop-status.test.ts +285 -0
- package/tests/independent-recovery-delivery.test.ts +16 -4
- package/tests/installer-server.test.ts +2 -2
- package/tests/lazy-module-contradictions-contract.test.ts +27 -4
- package/tests/maintainer/desktop-rpc.maintest.ts +279 -4
- package/tests/native-review-capability-contract.test.ts +9 -1
- package/tests/no-self-pause-contract.test.ts +23 -13
- package/tests/odd-routing-canonical-ratchet.test.ts +10 -0
- package/tests/odd-routing-contract.test.ts +19 -3
- package/tests/orchestrator-budget.test.ts +3 -1
- package/tests/orchestrator-prompt-budget.test.ts +2 -1
- package/tests/orchestrator-prompt-diet-contract.test.ts +31 -3
- package/tests/package-manifest.test.ts +10 -10
- package/tests/pi-routing-measured-values.test.ts +24 -0
- package/tests/primary-session-prompt.test.ts +25 -0
- package/tests/profile-fast-tier.test.ts +66 -1
- package/tests/provider-defect-handoff.test.ts +118 -100
- package/tests/review-contract-prompt.test.ts +2 -1
- package/tests/review-due-public-boundary.test.ts +2 -1
- package/tests/sensitive-path-tools.test.ts +138 -4
- package/tests/session-profile-extension.test.ts +310 -16
- package/tests/session-profile-freeze.test.ts +26 -0
- package/tests/session-profile-v1-compat.test.ts +20 -0
- package/tests/skill-collision-prefixes.test.ts +1 -0
- package/tests/skill-contradictions-contract.test.ts +5 -3
- package/tests/skill-registry.test.ts +54 -0
- package/tests/stats-collector.test.ts +109 -2
- package/tests/support/design-canvas-dom.ts +17 -0
- package/tests/task-size-routing-contract.test.ts +7 -3
- package/tests/tower-actions.test.ts +247 -0
- package/tests/tower-artifacts.test.ts +114 -0
- package/tests/tower-open.test.ts +97 -0
- package/tests/tower-presence.test.ts +175 -0
- package/tests/tower-server.test.ts +122 -0
- package/tests/tower-snapshot.test.ts +236 -0
- package/tests/tower-web-echo.test.ts +125 -0
- package/tests/tower-web-hover.test.ts +251 -0
- package/tests/verification-scoped-stop-contract.test.ts +32 -0
- package/tests/verification-tiers-contract.test.ts +5 -5
- package/tests/verifier-settle-reminder.test.ts +2 -2
- package/tests/verify-first-launch-contract.test.ts +2 -2
- package/tests/work-continuity-contract.test.ts +83 -17
- package/tests/writer-rejection-next-step.test.ts +55 -0
- package/tests/writer-surface-authority-contract.test.ts +158 -0
- /package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/README.md +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/schemas/lens.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/schemas/refuter.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/schemas/targeted-validator.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/vectors/lens.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/vectors/refuter.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/vectors/targeted-validator.json +0 -0
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
// gentle-inspector: the right inspector of the chosen design (region 5,
|
|
2
|
+
// design/herdr-desktop/01-inspector.html `.inspector` / `.itabs` / `.ipanel`, l.271-279 and the
|
|
3
|
+
// panel rules l.191-221): a tab strip (Changes, Todo, Agents, Jobs, Review, Session) over one
|
|
4
|
+
// panel, for the focused Gentle Shell session's desktop snapshot (docs/desktop-feed.md).
|
|
5
|
+
//
|
|
6
|
+
// One mod draws the strip and the panels: Herdr 0.1.15 rejects a stack `"header": "tabs"` (L7),
|
|
7
|
+
// and a header mod would need its own copy of the snapshot reader anyway. The layout block gives
|
|
8
|
+
// the frame (372px, 1px border, radius 10, chrome background).
|
|
9
|
+
//
|
|
10
|
+
// Actions (T7, ./actions.js): Stop (subagent) and Cancel (job) ask the session's owners, as the
|
|
11
|
+
// desktop RPC does; View, Output, Open diff viewer and a change row open the TUI's own screens
|
|
12
|
+
// (/gentle:agents, /gentle:jobs, /gentle:changes) in the Terminal; Start review / Skip show the
|
|
13
|
+
// Terminal, where the review consent is answered by you; the RDD row runs
|
|
14
|
+
// `gentle-ai review mode enable|disable --scope global` after a confirmation that says it is
|
|
15
|
+
// global (every repository), as you would in a shell.
|
|
16
|
+
|
|
17
|
+
import { View, div, svg } from "gpui-kit";
|
|
18
|
+
import { v_flex, h_flex } from "gpui-base";
|
|
19
|
+
import { exec, home, shared, nextCommand } from "herdr";
|
|
20
|
+
import { tokens, eyebrow, state, bar, btn, money, sessionCost, span, clock, ago, cap, prettyModel, agentRole } from "./tokens.js";
|
|
21
|
+
import { FeedSource, machineOf } from "./snapshot.js";
|
|
22
|
+
import { sendAction, errorText, tuiCommand, showTerminal, confirm, confirmed } from "./actions.js";
|
|
23
|
+
|
|
24
|
+
const ICON = (name) => `mods/gentle-inspector/icons/${name}.svg`;
|
|
25
|
+
const TABS = [
|
|
26
|
+
{ id: "changes", label: "Changes", icon: "diff" },
|
|
27
|
+
{ id: "todo", label: "Todo", icon: "todo" },
|
|
28
|
+
{ id: "agents", label: "Agents", icon: "bot" },
|
|
29
|
+
{ id: "jobs", label: "Jobs", icon: "jobs" },
|
|
30
|
+
{ id: "review", label: "Review", icon: "review" },
|
|
31
|
+
{ id: "session", label: "Session", icon: "stats" },
|
|
32
|
+
];
|
|
33
|
+
const REVEAL = "gentle-inspector.reveal"; // set by gentle-chat's "Open in Changes"
|
|
34
|
+
const RDD_EVERY = 30000; // the RDD switch is re-read this often while the Review tab shows
|
|
35
|
+
|
|
36
|
+
// File status letter and colour (.fst.m warn, .fst.a ok).
|
|
37
|
+
// An untracked file is a new file: the artboard's "A" (l.497-498).
|
|
38
|
+
const FST = { modified: ["M", "warn"], added: ["A", "ok"], untracked: ["A", "ok"], deleted: ["D", "err"], renamed: ["R", "info"] };
|
|
39
|
+
// Subagent status → .state kind and word.
|
|
40
|
+
const AGENT = {
|
|
41
|
+
queued: ["queue", "Queued"], running: ["work", "Running"], waiting: ["need", "Waiting"],
|
|
42
|
+
completed: ["done", "Done"], failed: ["fail", "Failed"], cancelled: ["idle", "Cancelled"], timed_out: ["fail", "Timed out"],
|
|
43
|
+
};
|
|
44
|
+
// Review state → icon tone (REVIEW_SIDEBAR_LABELS in lib/review-sidebar-state.ts gives the words).
|
|
45
|
+
const REVIEW_TONE = {
|
|
46
|
+
ready: "muted", consent: "warn", forecast: "info", reviewing: "info", in_review: "info", checking: "info",
|
|
47
|
+
approved: "ok", closed: "ok", correction: "warn", declined: "muted", invalidated: "warn", unavailable: "muted", unknown: "muted",
|
|
48
|
+
};
|
|
49
|
+
const REVIEW_SHORT = { in_review: "in review", timed_out: "timed out" };
|
|
50
|
+
|
|
51
|
+
const tilde = (p) => {
|
|
52
|
+
const h = home();
|
|
53
|
+
return h && String(p).startsWith(h) ? "~" + String(p).slice(h.length) : String(p ?? "");
|
|
54
|
+
};
|
|
55
|
+
// ".worktrees/herdr-gentle-shell" for a linked worktree, else the folder's last part.
|
|
56
|
+
const worktreeName = (root) => {
|
|
57
|
+
const s = String(root ?? "");
|
|
58
|
+
const i = s.indexOf("/.worktrees/");
|
|
59
|
+
return i >= 0 ? s.slice(i + 1) : tilde(s).split("/").filter(Boolean).pop() ?? s;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default class GentleInspector extends View {
|
|
63
|
+
init(_props, cx) {
|
|
64
|
+
this.tab = TABS.some((t) => t.id === localStorage.getItem("tab")) ? localStorage.getItem("tab") : "changes";
|
|
65
|
+
this.last = null;
|
|
66
|
+
this.busy = null; // the action in flight ("job-<id>", "agent-<id>", "rdd", …)
|
|
67
|
+
this.error = null; // the last action's refusal or failure, shown under the panel
|
|
68
|
+
this.notice = null;
|
|
69
|
+
this.revealAt = 0;
|
|
70
|
+
this.reveal = null; // the changed file "Open in Changes" asked for
|
|
71
|
+
this.rdd = null; // { cwd, effective, source, at } from `gentle-ai review mode status`
|
|
72
|
+
this.source = new FeedSource();
|
|
73
|
+
this.source.start(cx);
|
|
74
|
+
this.waiting = null; // the wake-up set now (see wake): "tick" | "review" | null
|
|
75
|
+
// Commands: a confirm dialog's Confirm (the RDD switch), and tab-<id> to show a tab.
|
|
76
|
+
cx.spawn(async (cx) => {
|
|
77
|
+
for (;;) {
|
|
78
|
+
const c = String(await nextCommand());
|
|
79
|
+
try {
|
|
80
|
+
if (confirmed(c, cx)) { /* handled */ }
|
|
81
|
+
else if (c.startsWith("tab-") && TABS.some((t) => t.id === c.slice(4))) this.select(c.slice(4), cx);
|
|
82
|
+
} catch (e) {
|
|
83
|
+
this.error = String(e?.message ?? e);
|
|
84
|
+
}
|
|
85
|
+
cx.notify();
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
select(id, cx) {
|
|
91
|
+
this.tab = id;
|
|
92
|
+
localStorage.setItem("tab", id);
|
|
93
|
+
this.error = null;
|
|
94
|
+
this.notice = null;
|
|
95
|
+
cx.notify();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// ---- Actions (T7) ----
|
|
99
|
+
|
|
100
|
+
// One action at a time; its refusal shows under the panel.
|
|
101
|
+
act(key, cx, work) {
|
|
102
|
+
if (this.busy) return;
|
|
103
|
+
this.busy = key;
|
|
104
|
+
this.error = null;
|
|
105
|
+
this.notice = null;
|
|
106
|
+
cx.notify();
|
|
107
|
+
cx.spawn(async (cx) => {
|
|
108
|
+
try {
|
|
109
|
+
const line = await work(cx);
|
|
110
|
+
if (line) this.error = line;
|
|
111
|
+
} catch (e) {
|
|
112
|
+
this.error = String(e?.message ?? e);
|
|
113
|
+
}
|
|
114
|
+
this.busy = null;
|
|
115
|
+
cx.notify();
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
owner(key, kind, args, cx) {
|
|
120
|
+
this.act(key, cx, async (cx) => {
|
|
121
|
+
const r = await sendAction(cx, this.feed, kind, args);
|
|
122
|
+
return r.ok ? null : errorText(r);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// After the await, Herdr's ambient calls (run) only work from a host call: the Terminal is
|
|
127
|
+
// shown from a timer callback (T10, live: a run() right after `hc send` was ignored).
|
|
128
|
+
command(key, text, cx) {
|
|
129
|
+
const address = this.address;
|
|
130
|
+
// A session outside Herdr app (T11): its TUI screens open in its own terminal only.
|
|
131
|
+
if (!address) { this.error = "Open that session's terminal to run /commands."; cx.notify(); return; }
|
|
132
|
+
this.act(key, cx, (cx) => tuiCommand(address, this.feed, text, () => cx.timer.after(1, () => showTerminal(address))));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// No standing timer (S13): what the shown tab needs, set from render and gone once it is not.
|
|
136
|
+
// Running jobs show their elapsed time: a 1s redraw only while the Jobs tab shows one. The
|
|
137
|
+
// Review tab's RDD row reads `gentle-ai review mode status` (at most every RDD_EVERY).
|
|
138
|
+
wake(cx) {
|
|
139
|
+
const ticking = this.tab === "jobs" && (this.feed?.jobs?.running?.length ?? 0) > 0;
|
|
140
|
+
const review = this.tab === "review" && Boolean(this.feed);
|
|
141
|
+
if (review) this.readRdd(cx); // throttled there: a new project reads at once, the same one every RDD_EVERY
|
|
142
|
+
const want = ticking ? "tick" : review ? "review" : null;
|
|
143
|
+
if (!want || this.waiting === want) return;
|
|
144
|
+
const gen = (this.wakeGen = (this.wakeGen ?? 0) + 1);
|
|
145
|
+
this.waiting = want;
|
|
146
|
+
try {
|
|
147
|
+
cx.timer.after(want === "tick" ? 1000 : RDD_EVERY, (cx) => {
|
|
148
|
+
if (gen !== this.wakeGen) return;
|
|
149
|
+
this.waiting = null;
|
|
150
|
+
if (want === "tick") cx.notify(); // its render sets the next second while a job still runs
|
|
151
|
+
else this.wake(cx);
|
|
152
|
+
});
|
|
153
|
+
} catch {
|
|
154
|
+
this.waiting = null;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// `gentle-ai review mode status` for the session's project: read-only, re-read now and then.
|
|
159
|
+
readRdd(cx, force = false) {
|
|
160
|
+
const cwd = this.feed?.project?.cwd ?? this.feed?.identity?.cwd;
|
|
161
|
+
if (!cwd || this.rddLoading) return;
|
|
162
|
+
if (!force && this.rdd?.cwd === cwd && Date.now() - this.rdd.at < RDD_EVERY) return;
|
|
163
|
+
this.rddLoading = true;
|
|
164
|
+
cx.spawn(async (cx) => {
|
|
165
|
+
try {
|
|
166
|
+
const r = await exec("gentle-ai", ["review", "mode", "status", "--cwd", cwd, "--json"], { cwd, timeout: 15000 });
|
|
167
|
+
const st = r.code === 0 ? JSON.parse(r.stdout)?.status : null;
|
|
168
|
+
this.rdd = { cwd, effective: st?.effective ?? null, source: st?.source ?? null, at: Date.now() };
|
|
169
|
+
} catch {
|
|
170
|
+
this.rdd = { cwd, effective: null, source: null, at: Date.now() };
|
|
171
|
+
}
|
|
172
|
+
this.rddLoading = false;
|
|
173
|
+
cx.notify();
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// The review switch: `gentle-ai review mode enable|disable`, exactly as you would run it, after
|
|
178
|
+
// a confirmation. It is the GLOBAL switch (its default scope): every repository of this user
|
|
179
|
+
// changes, and a repository's own clone-local "off" still wins. Its own output is the answer.
|
|
180
|
+
switchRdd(cx) {
|
|
181
|
+
const cwd = this.rdd?.cwd;
|
|
182
|
+
const on = this.rdd?.effective === "on";
|
|
183
|
+
if (!cwd || this.busy) return;
|
|
184
|
+
const op = on ? "disable" : "enable";
|
|
185
|
+
const args = ["review", "mode", op, "--scope", "global", "--cwd", cwd, "--json"];
|
|
186
|
+
const shown = ["gentle-ai", ...args.map((a) => (a === cwd ? tilde(cwd) : a))].join(" ");
|
|
187
|
+
confirm("gentle-inspector", {
|
|
188
|
+
title: on ? "Turn receipt-driven review off everywhere?" : "Turn receipt-driven review on everywhere?",
|
|
189
|
+
detail: `This is the GLOBAL switch: it changes receipt-driven review for ALL your repositories, not only this one (a repository's own clone-local "off" still wins). ${on ? "Review stops gating new candidates." : "It applies to future candidates only."} Runs, as in a shell: ${shown}`,
|
|
190
|
+
height: 230,
|
|
191
|
+
}, (cx) => this.act("rdd", cx, async () => {
|
|
192
|
+
const r = await exec("gentle-ai", args, { cwd, timeout: 30000 });
|
|
193
|
+
let st = null;
|
|
194
|
+
try { st = JSON.parse(r.stdout)?.status ?? null; } catch { st = null; }
|
|
195
|
+
if (st?.effective) this.rdd = { cwd, effective: st.effective, source: st.source ?? null, at: Date.now() };
|
|
196
|
+
else this.rdd = { ...this.rdd, at: 0 }; // read it again
|
|
197
|
+
if (r.code !== 0) return (r.stderr || r.stdout || `gentle-ai review mode ${op} failed`).trim().split("\n")[0];
|
|
198
|
+
this.notice = `RDD is ${st?.effective ?? (op === "enable" ? "on" : "off")}${st?.source ? ` (${st.source})` : ""}.`;
|
|
199
|
+
return null;
|
|
200
|
+
}));
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// gentle-chat's "Open in Changes" (a shared value): show the Changes tab with that file marked.
|
|
204
|
+
takeReveal() {
|
|
205
|
+
let r = null;
|
|
206
|
+
try { r = shared(REVEAL); } catch { r = null; }
|
|
207
|
+
if (!r || typeof r !== "object" || !(r.at > this.revealAt)) return;
|
|
208
|
+
this.revealAt = r.at;
|
|
209
|
+
this.reveal = typeof r.path === "string" ? r.path : null;
|
|
210
|
+
if (TABS.some((t) => t.id === r.tab)) { this.tab = r.tab; localStorage.setItem("tab", r.tab); }
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// ---- Tab strip (.itabs / .itab) ----
|
|
214
|
+
|
|
215
|
+
counts(f) {
|
|
216
|
+
if (!f) return {};
|
|
217
|
+
const todo = f.todo?.progress;
|
|
218
|
+
const blockedTodo = (f.todo?.items ?? []).some((t) => t.state === "blocked") || (f.activity?.state === "blocked" && f.todo?.current);
|
|
219
|
+
const runningTodo = (f.todo?.items ?? []).some((t) => t.state === "in_progress");
|
|
220
|
+
const agentsActive = f.agents?.active ?? 0;
|
|
221
|
+
const jobsRunning = f.jobs?.running?.length ?? 0;
|
|
222
|
+
const review = f.review?.state;
|
|
223
|
+
return {
|
|
224
|
+
changes: [f.changes ? String(f.changes.summary?.files ?? 0) : "…", null],
|
|
225
|
+
todo: [todo?.total ? `${todo.done}/${todo.total}` : "0", blockedTodo ? "warn" : runningTodo ? "info" : null],
|
|
226
|
+
agents: [agentsActive ? `${agentsActive} run` : String(f.agents?.spend?.runs ?? 0), agentsActive ? "info" : null],
|
|
227
|
+
jobs: [jobsRunning ? `${jobsRunning} run` : String(f.jobs?.recent?.length ?? 0), jobsRunning ? "info" : null],
|
|
228
|
+
review: [review ? (REVIEW_SHORT[review] ?? review) : "none", review === "consent" ? "warn" : null],
|
|
229
|
+
session: [`${f.stats?.turns ?? 0} turns`, null],
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
strip(c, f) {
|
|
234
|
+
const counts = this.counts(f);
|
|
235
|
+
return h_flex().id("itabs").flex_none().pt(6).px(6).gap(2).border_b(1).border_color(c.line)
|
|
236
|
+
.children(TABS.map((t) => {
|
|
237
|
+
const on = this.tab === t.id;
|
|
238
|
+
const [count, tone] = counts[t.id] ?? ["", null];
|
|
239
|
+
return v_flex().id(`itab-${t.id}`).relative().flex_1().min_w(0).items_center().gap(2).pt(6).px(2).pb(7)
|
|
240
|
+
.rounded_tl(6).rounded_tr(6).text_size(11).line_height("16.5px").cursor_pointer()
|
|
241
|
+
.text_color(on ? c.text : c.muted)
|
|
242
|
+
.hover((s) => s.text_color(c.text).bg(c.selected))
|
|
243
|
+
.on_click((_e, cx) => this.select(t.id, cx))
|
|
244
|
+
.child(svg(ICON(t.icon)).size(15).flex_none())
|
|
245
|
+
.child(div().whitespace_nowrap().child(t.label))
|
|
246
|
+
.child(div().h(10.5).whitespace_nowrap().font_family(c.mono).font_weight(600).text_size(10.5).line_height("10.5px")
|
|
247
|
+
.text_color(tone ? c[tone] : c.muted).child(count))
|
|
248
|
+
// [aria-selected] box-shadow: inset 0 -2px 0 accent.
|
|
249
|
+
.when(on, (el) => el.child(div().absolute().left(0).right(0).bottom(0).h(2).bg(c.accent)));
|
|
250
|
+
}));
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// ---- Panel pieces ----
|
|
254
|
+
|
|
255
|
+
h2(c, title, right) {
|
|
256
|
+
return h_flex().flex_none().mb(10).items_center().justify_between().text_size(13).line_height("19.5px").font_weight(600).text_color(c.text)
|
|
257
|
+
.child(div().child(title))
|
|
258
|
+
.when(Boolean(right), (el) => el.child(right));
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
note(c, text) {
|
|
262
|
+
return div().text_size(12).line_height("18px").text_color(c.muted).child(text);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
kv(c, rows) {
|
|
266
|
+
return v_flex().gap(4).children(rows.map(([k, v], i) => h_flex().id(`kv-${k}-${i}`).min_w(0).overflow_hidden().whitespace_nowrap().gap(12).items_center()
|
|
267
|
+
.child(div().flex_1().min_w(0).truncate().text_color(c.muted).child(k))
|
|
268
|
+
// The value keeps its width up to 60% of the row, then ends in an ellipsis.
|
|
269
|
+
.child(div().flex_none().max_w("60%").truncate().text_right().font_family(c.mono).text_color(c.text).child(v))));
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
subhead(c, text) {
|
|
273
|
+
return div().mt(6).mb(2).child(eyebrow(c, text));
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// ---- Panels ----
|
|
277
|
+
|
|
278
|
+
changes(c, f) {
|
|
279
|
+
const ch = f.changes;
|
|
280
|
+
const head = this.h2(c, "Changes", btn(c, "open-diff", this.busy === "diff" ? "Opening…" : "Open diff viewer", {
|
|
281
|
+
onClick: (_e, cx) => this.command("diff", "/gentle:changes", cx),
|
|
282
|
+
}).tooltip("Open /gentle:changes in the Terminal"));
|
|
283
|
+
if (!ch) return [head, this.note(c, "Scanning the working tree…")];
|
|
284
|
+
const s = ch.summary ?? { files: 0, added: 0, deleted: 0 };
|
|
285
|
+
const wt = ch.worktrees?.[0];
|
|
286
|
+
const sum = h_flex().gap(10).items_baseline().text_size(13).line_height("19.5px")
|
|
287
|
+
.child(div().font_weight(600).text_color(c.text).child(s.files === 1 ? "1 file" : `${s.files} files`))
|
|
288
|
+
.child(div().font_family(c.mono).text_color(c.ok).child(`+${s.added}`))
|
|
289
|
+
.child(div().font_family(c.mono).text_color(c.err).child(`−${s.deleted}`));
|
|
290
|
+
if (!ch.files?.length) return [head, v_flex().gap(10).child(sum).child(this.note(c, "Working tree clean"))];
|
|
291
|
+
const where = wt ? h_flex().gap(4).text_size(12).line_height("18px").text_color(c.muted)
|
|
292
|
+
.child(div().flex_none().child(ch.worktrees.length > 1 ? `${ch.worktrees.length} worktrees ·` : "Worktree"))
|
|
293
|
+
.child(div().min_w(0).truncate().font_family(c.mono).text_color(c.muted).child(worktreeName(wt.root)))
|
|
294
|
+
.child(div().flex_none().child("· uncommitted")) : null;
|
|
295
|
+
const rows = ch.files.map((file, i) => {
|
|
296
|
+
const [letter, tone] = FST[file.status] ?? ["?", "muted"];
|
|
297
|
+
const path = String(file.path ?? "");
|
|
298
|
+
const cut = path.lastIndexOf("/") + 1;
|
|
299
|
+
const marked = Boolean(this.reveal) && (path === this.reveal || path.endsWith(`/${this.reveal}`) || this.reveal.endsWith(`/${path}`));
|
|
300
|
+
return h_flex().id(`file-${i}`).w_full().min_w(0).overflow_hidden().min_h(28).px(6).py(5).gap(8).items_center().rounded(6).cursor_pointer()
|
|
301
|
+
.when(marked, (el) => el.bg(c.selected))
|
|
302
|
+
.hover((s) => s.bg(c.selected)).tooltip("Open /gentle:changes in the Terminal")
|
|
303
|
+
.on_click((_e, cx) => { this.reveal = path; this.command("diff", "/gentle:changes", cx); })
|
|
304
|
+
.child(div().w(16).flex_none().font_family(c.mono).font_weight(600).text_size(11).line_height("11px").text_color(c[tone]).child(letter))
|
|
305
|
+
.child(h_flex().flex_1().min_w(0).overflow_hidden()
|
|
306
|
+
.when(cut > 0, (el) => el.child(div().flex_shrink(1).min_w(0).truncate().text_color(c.muted).child(path.slice(0, cut))))
|
|
307
|
+
.child(div().flex_none().text_color(c.text).child(path.slice(cut))))
|
|
308
|
+
// null counts: a binary or oversized new file (docs/desktop-feed.md); it shows none.
|
|
309
|
+
.when(file.added !== null, (el) => el.child(div().flex_none().font_family(c.mono).text_color(c.ok).child(`+${file.added ?? 0}`)))
|
|
310
|
+
.when(file.deleted !== null, (el) => el.child(div().flex_none().font_family(c.mono).text_color(c.err).child(`−${file.deleted ?? 0}`)));
|
|
311
|
+
});
|
|
312
|
+
return [head, v_flex().gap(10).child(sum).when(Boolean(where), (el) => el.child(where))
|
|
313
|
+
.child(v_flex().gap(1).children(rows))
|
|
314
|
+
.when(Boolean(ch.truncated), (el) => el.child(this.note(c, `Showing the first ${ch.files.length} files`)))];
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
todo(c, f) {
|
|
318
|
+
const td = f.todo ?? { items: [], progress: { done: 0, total: 0 } };
|
|
319
|
+
const head = this.h2(c, "Todo");
|
|
320
|
+
const { done = 0, total = 0 } = td.progress ?? {};
|
|
321
|
+
if (!td.items?.length) return [head, this.note(c, "No tasks in this session yet")];
|
|
322
|
+
const blocked = f.activity?.state === "blocked";
|
|
323
|
+
const items = td.items.map((t, i) => {
|
|
324
|
+
const isDone = t.state === "done";
|
|
325
|
+
const dropped = t.state === "dropped";
|
|
326
|
+
const now = t.state === "in_progress" || t.state === "blocked";
|
|
327
|
+
const tone = now ? "warn" : null; // .todo .now: warn tick, warn second line (l.205-208)
|
|
328
|
+
const tick = div().size(16).flex_none().mt(1).rounded(4).border(1.5).flex().items_center().justify_center()
|
|
329
|
+
.border_color(isDone ? c.ok : tone ? c[tone] : c.lineStrong)
|
|
330
|
+
.when(isDone, (el) => el.text_color(c.ok).child(svg(ICON("check")).size(13)))
|
|
331
|
+
.when(now, (el) => el.child(div().size(6).rounded(2).bg(c[tone ?? "warn"])));
|
|
332
|
+
const sub = t.note ?? (now && blocked ? f.activity?.blockedLabel ?? "Waiting for your answer" : null);
|
|
333
|
+
return h_flex().id(`todo-${t.id ?? i}`).px(6).py(4).gap(8).items_start()
|
|
334
|
+
.child(tick)
|
|
335
|
+
.child(v_flex().flex_1().min_w(0)
|
|
336
|
+
.child(div().text_color(isDone || dropped ? c.muted : c.text).when(isDone || dropped, (el) => el.line_through()).child(String(t.title ?? "")))
|
|
337
|
+
.when(Boolean(sub), (el) => el.child(div().text_size(11.5).line_height("17.25px").text_color(c[tone ?? "muted"]).child(String(sub)))));
|
|
338
|
+
});
|
|
339
|
+
return [head, v_flex().gap(10)
|
|
340
|
+
.child(h_flex().gap(10).items_center().text_size(13).line_height("19.5px")
|
|
341
|
+
.child(div().flex_none().font_weight(600).text_color(c.text).child(`${done} of ${total}`))
|
|
342
|
+
.child(bar(c, total ? (done / total) * 100 : 0, "ok")))
|
|
343
|
+
.child(v_flex().gap(1).children(items))
|
|
344
|
+
.when(Boolean(td.truncated), (el) => el.child(this.note(c, `Showing the first ${td.items.length} tasks`)))];
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
agents(c, f) {
|
|
348
|
+
const ag = f.agents;
|
|
349
|
+
const spent = ag?.spend?.cost ? div().font_family(c.mono).font_weight(400).text_color(c.muted).child(`${money(ag.spend.cost)} spent`) : null;
|
|
350
|
+
const head = this.h2(c, "Agents", spent);
|
|
351
|
+
if (!ag?.items?.length) return [head, this.note(c, "No subagents in this session")];
|
|
352
|
+
const cards = ag.items.map((a, i) => {
|
|
353
|
+
const [kind, word] = AGENT[a.state] ?? ["idle", cap(a.state)];
|
|
354
|
+
const live = a.state === "running" || a.state === "waiting"; // .acts only on a live subagent
|
|
355
|
+
const step = a.step && a.step !== a.state && !["running", "queued", "completed", "failed", "cancelled", "timed_out"].includes(a.step) ? ` · ${a.step}` : "";
|
|
356
|
+
return v_flex().id(`ag-${a.id ?? i}`).when(i > 0, (el) => el.mt(6)).p(8).gap(2).rounded(8).border(1).border_color(c.line)
|
|
357
|
+
.child(h_flex().gap(6).items_baseline().min_w(0).overflow_hidden().whitespace_nowrap()
|
|
358
|
+
.child(div().flex_none().font_family(c.mono).font_weight(600).text_size(10.5).line_height("16.8px").text_color(c.accent)
|
|
359
|
+
.child((a.role ? String(a.role) : agentRole(a.name)).toUpperCase()))
|
|
360
|
+
.when(Boolean(a.title), (el) => el.child(div().min_w(0).truncate().font_weight(600).text_color(c.text).child(String(a.title)))))
|
|
361
|
+
// The state and its step give way (truncate); model and spend keep their width.
|
|
362
|
+
.child(h_flex().min_w(0).overflow_hidden().whitespace_nowrap().gap(10).items_center().text_size(12).line_height("18px").text_color(c.muted)
|
|
363
|
+
.child(state(c, kind, null, div().min_w(0).truncate().child(`${word}${step}`)).flex_shrink_1().min_w(0))
|
|
364
|
+
.when(Boolean(a.model), (el) => el.child(div().flex_none().max_w("40%").truncate().child(prettyModel(String(a.model)))))
|
|
365
|
+
.when(Boolean(a.spend?.cost), (el) => el.child(div().flex_none().font_family(c.mono).child(money(a.spend.cost)))))
|
|
366
|
+
.when(live, (el) => el.child(h_flex().mt(4).gap(6)
|
|
367
|
+
.child(btn(c, `ag-view-${i}`, "View", { onClick: (_e, cx) => this.command(`view-${i}`, "/gentle:agents", cx) }).tooltip("Open /gentle:agents in the Terminal"))
|
|
368
|
+
.when(Boolean(a.id), (el) => el.child(btn(c, `ag-stop-${i}`, this.busy === `agent-${a.id}` ? "Stopping…" : "Stop", {
|
|
369
|
+
danger: true, icon: ICON("stop"), onClick: (_e, cx) => this.owner(`agent-${a.id}`, "cancel_subagent", { id: a.id }, cx),
|
|
370
|
+
}).tooltip("Stop this subagent")))));
|
|
371
|
+
});
|
|
372
|
+
return [head, v_flex().children(cards)];
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
jobs(c, f) {
|
|
376
|
+
const head = this.h2(c, "Jobs");
|
|
377
|
+
const running = f.jobs?.running ?? [];
|
|
378
|
+
const recent = f.jobs?.recent ?? [];
|
|
379
|
+
if (!running.length && !recent.length) return [head, this.note(c, "No background jobs in this session")];
|
|
380
|
+
const now = Date.now();
|
|
381
|
+
const job = (j, i, live) => {
|
|
382
|
+
let kind, word, action = null;
|
|
383
|
+
if (live) {
|
|
384
|
+
kind = "work"; word = "Running";
|
|
385
|
+
action = j.id ? btn(c, `job-cancel-${i}`, this.busy === `job-${j.id}` ? "Cancelling…" : "Cancel", {
|
|
386
|
+
danger: true, onClick: (_e, cx) => this.owner(`job-${j.id}`, "cancel_job", { id: j.id }, cx),
|
|
387
|
+
}).tooltip("Stop this background job") : null;
|
|
388
|
+
}
|
|
389
|
+
else if (j.status === "exited" && (j.exitCode ?? 0) === 0) { kind = "done"; word = "Passed"; }
|
|
390
|
+
else if (j.status === "stopped") { kind = "idle"; word = "Stopped"; }
|
|
391
|
+
else {
|
|
392
|
+
kind = "fail";
|
|
393
|
+
word = j.exitCode != null && j.exitCode !== 0 ? `Failed · exit ${j.exitCode}` : "Failed";
|
|
394
|
+
action = btn(c, `job-output-${i}`, "Output", { onClick: (_e, cx) => this.command(`output-${i}`, "/gentle:jobs", cx) })
|
|
395
|
+
.tooltip("Open /gentle:jobs in the Terminal");
|
|
396
|
+
}
|
|
397
|
+
const elapsed = live ? now - (Number(j.startedAt) || now) : j.elapsedMs;
|
|
398
|
+
return v_flex().id(`job-${live ? "r" : "f"}-${j.id ?? i}`).p(6).gap(2).rounded(6)
|
|
399
|
+
.child(h_flex().min_w(0).overflow_hidden().gap(8).items_center()
|
|
400
|
+
.child(div().flex_1().min_w(0).truncate().font_family(c.mono).text_size(12).line_height("18px").text_color(c.text).child(String(j.label ?? "")))
|
|
401
|
+
.when(Boolean(action), (el) => el.child(action)))
|
|
402
|
+
.child(h_flex().min_w(0).overflow_hidden().whitespace_nowrap().gap(10).items_center().text_size(12).line_height("18px").text_color(c.muted)
|
|
403
|
+
.child(state(c, kind, null, div().min_w(0).truncate().child(word)).flex_shrink_1().min_w(0))
|
|
404
|
+
.child(div().flex_none().font_family(c.mono).child(clock(elapsed)))
|
|
405
|
+
.when(!live && Boolean(j.endedAt), (el) => el.child(div().child(ago(j.endedAt, now)))));
|
|
406
|
+
};
|
|
407
|
+
return [head, v_flex().gap(10)
|
|
408
|
+
.when(running.length > 0, (el) => el.child(this.subhead(c, "Running")).children(running.map((j, i) => job(j, i, true))))
|
|
409
|
+
.when(recent.length > 0, (el) => el.child(this.subhead(c, "Finished")).children(recent.map((j, i) => job(j, i, false))))];
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
review(c, f) {
|
|
413
|
+
const head = this.h2(c, "Review");
|
|
414
|
+
const r = f.review;
|
|
415
|
+
const tone = r ? REVIEW_TONE[r.state] ?? "muted" : "muted";
|
|
416
|
+
const box = h_flex().p(10).gap(10).items_center().rounded(8).border(1).border_color(c.line)
|
|
417
|
+
.child(svg(ICON("review")).size(15).flex_none().text_color(c[tone]))
|
|
418
|
+
.child(v_flex().flex_1().min_w(0)
|
|
419
|
+
.child(div().font_weight(600).text_size(13).line_height("19.5px").text_color(c.text).child(r ? String(r.label || cap(r.state)) : "No review yet"))
|
|
420
|
+
.child(div().truncate().text_color(c.muted).child(r ? (r.scope ? `Candidate: ${r.scope}` : "No candidate yet") : "Nothing has asked for review in this session")));
|
|
421
|
+
const rdd = this.rddRow(c);
|
|
422
|
+
if (!r) return [head, v_flex().gap(10).child(box).child(rdd)];
|
|
423
|
+
const ask = r.state === "ready" || r.state === "consent";
|
|
424
|
+
// Review consent is yours, in the real prompt: both buttons show it in the Terminal.
|
|
425
|
+
const toPrompt = () => { if (this.address) showTerminal(this.address); else { this.error = "Answer the review consent in that session's terminal."; } };
|
|
426
|
+
return [head, v_flex().gap(10).child(box)
|
|
427
|
+
.child(this.kv(c, [["State", REVIEW_SHORT[r.state] ?? r.state]]))
|
|
428
|
+
.child(rdd)
|
|
429
|
+
.when(ask, (el) => el.child(h_flex().gap(6)
|
|
430
|
+
.child(btn(c, "review-start", "Start review", { primary: true, onClick: toPrompt }).tooltip("Answer the review consent in the Terminal"))
|
|
431
|
+
.child(btn(c, "review-skip", "Skip for this change", { onClick: toPrompt }).tooltip("Answer the review consent in the Terminal"))))];
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// The kv row "RDD on · global" (01-inspector.html l.581); the value is the switch.
|
|
435
|
+
rddRow(c) {
|
|
436
|
+
const st = this.rdd;
|
|
437
|
+
const word = this.busy === "rdd" ? "switching…" : st?.effective ? `${st.effective}${st.source ? ` · ${st.source}` : ""}` : st ? "unknown" : "…";
|
|
438
|
+
const can = Boolean(st?.effective) && !this.busy;
|
|
439
|
+
return h_flex().id("kv-rdd").gap(12).items_center()
|
|
440
|
+
.child(div().flex_1().min_w(0).truncate().text_color(c.muted).child("RDD"))
|
|
441
|
+
.child(div().id("rdd-switch").flex_none().text_right().font_family(c.mono).text_color(c.text).child(word)
|
|
442
|
+
.when(can, (el) => el.cursor_pointer().hover((s) => s.text_color(c.accentSoft))
|
|
443
|
+
.tooltip(st.effective === "on" ? "Turn receipt-driven review off for all repositories (gentle-ai review mode disable)" : "Turn receipt-driven review on for all repositories (gentle-ai review mode enable)")
|
|
444
|
+
.on_click((_e, cx) => this.switchRdd(cx))));
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
session(c, f) {
|
|
448
|
+
const st = f.stats ?? {};
|
|
449
|
+
const rows = [
|
|
450
|
+
["Turns", String(st.turns ?? 0)],
|
|
451
|
+
["Tool calls", String(st.toolCalls ?? 0)],
|
|
452
|
+
["Duration", span(st.durationMs)],
|
|
453
|
+
["Cost", sessionCost(f.cost?.total ?? st.cost)],
|
|
454
|
+
["Subagent spend", money(f.agents?.spend?.cost ?? 0)],
|
|
455
|
+
];
|
|
456
|
+
const models = (st.models ?? []).map((m) => [`${prettyModel(m.model) ?? m.model} · ${m.turns} ${m.turns === 1 ? "turn" : "turns"}`, money(m.cost)]);
|
|
457
|
+
const integrations = Array.isArray(f.integrations) ? f.integrations : null;
|
|
458
|
+
return [this.h2(c, "Session"),
|
|
459
|
+
v_flex().gap(10).child(this.kv(c, rows))
|
|
460
|
+
.when(models.length > 0, (el) => el.child(this.subhead(c, "By model")).child(this.kv(c, models))),
|
|
461
|
+
v_flex().mt(14).gap(10).child(this.subhead(c, "Integrations"))
|
|
462
|
+
.when(!integrations, (el) => el.child(this.note(c, "Engram and MCP status are not published by this session yet")))
|
|
463
|
+
.when(Boolean(integrations), (el) => el.child(v_flex().gap(1).children(integrations.map((it, i) => h_flex().id(`int-${i}`).min_w(0).overflow_hidden().min_h(28).px(6).py(5).gap(8).items_center()
|
|
464
|
+
.child(svg(ICON(/engram/i.test(it.name) ? "db" : "plug")).size(13).flex_none().text_color(c.muted))
|
|
465
|
+
.child(div().flex_1().min_w(0).truncate().child(String(it.name ?? "")))
|
|
466
|
+
.child(state(c, it.ok ? "done" : "idle", String(it.state ?? "")))))))];
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
empty(c) {
|
|
470
|
+
// S14: a Gentle Shell terminal on another machine publishes its feed there.
|
|
471
|
+
const machine = machineOf(this.address);
|
|
472
|
+
if (machine) {
|
|
473
|
+
return [v_flex().gap(6).pt(4)
|
|
474
|
+
.child(div().font_weight(600).text_size(13).line_height("19.5px").text_color(c.text).child(`Runs on ${machine}`))
|
|
475
|
+
.child(this.note(c, `Its changes, todo, agents, jobs, review and stats are published on ${machine}; this window reads this computer's desktop feed only.`))];
|
|
476
|
+
}
|
|
477
|
+
return [v_flex().gap(6).pt(4)
|
|
478
|
+
.child(div().font_weight(600).text_size(13).line_height("19.5px").text_color(c.text).child("No Gentle Shell session here"))
|
|
479
|
+
.child(this.note(c, "Focus a tab running gentle-shell to see its changes, todo, agents, jobs, review and stats."))];
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
render(cx) {
|
|
483
|
+
const c = tokens();
|
|
484
|
+
// The shown session, wherever it runs (snapshot.js targetSession, T11).
|
|
485
|
+
const shown = this.source.target(this.last);
|
|
486
|
+
if (shown) this.last = shown.key;
|
|
487
|
+
this.address = shown?.terminal?.address ?? null;
|
|
488
|
+
const f = shown?.feed ?? null;
|
|
489
|
+
this.feed = f;
|
|
490
|
+
this.takeReveal();
|
|
491
|
+
this.wake(cx);
|
|
492
|
+
const body = f ? this[this.tab](c, f) : this.empty(c);
|
|
493
|
+
const line = this.error ?? this.notice;
|
|
494
|
+
return v_flex().id("root").size_full().min_h(0).font_family(c.sans).text_color(c.text)
|
|
495
|
+
.child(this.strip(c, f))
|
|
496
|
+
.child(v_flex().id("ipanel").flex_1().min_h(0).p(14).overflow_y_scrollbar().text_size(12.5).line_height("18.75px")
|
|
497
|
+
.children(body)
|
|
498
|
+
.when(Boolean(line), (el) => el.child(div().mt(10).text_size(12).line_height("18px").text_color(this.error ? c.err : c.muted).child(line))));
|
|
499
|
+
}
|
|
500
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "place": "none", "title": "Gentle inspector" }
|