@temmo/cli 0.0.0 → 0.19.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/.claude-plugin/marketplace.json +14 -0
- package/.claude-plugin/plugin.json +16 -0
- package/.codex-plugin/plugin.json +30 -0
- package/.cursor-plugin/plugin.json +22 -0
- package/.mcp.json +18 -0
- package/LICENSE +202 -0
- package/README.md +82 -2
- package/THIRD_PARTY_NOTICES +32 -0
- package/commands/afk.md +17 -0
- package/deploy/build-ui.mjs +65 -0
- package/deploy/claude/README.md +16 -0
- package/deploy/claude/auto-mode.json +31 -0
- package/deploy/postgres/compose.yaml +26 -0
- package/deploy/temmo-runner.service +24 -0
- package/deploy/verify-ui.mjs +15 -0
- package/harness-core/README.md +27 -0
- package/harness-core/bin/harness.mjs +17 -0
- package/harness-core/package.json +10 -0
- package/harness-core/stage.mjs +108 -0
- package/harness-core/stages/commit.md +7 -0
- package/harness-core/stages/pr.md +7 -0
- package/harness-core/stages/push.md +7 -0
- package/hooks/codex-hooks.json +14 -0
- package/hooks/cursor-hooks.json +17 -0
- package/hooks/hooks.json +27 -0
- package/lib/acp/permission.js +72 -0
- package/lib/acp/sessionConfig.js +109 -0
- package/lib/activity.js +244 -0
- package/lib/agent-guard.js +72 -0
- package/lib/agents-route.js +55 -0
- package/lib/agents.js +213 -0
- package/lib/agui.js +255 -0
- package/lib/alerts.js +36 -0
- package/lib/analyze-otlp.js +46 -0
- package/lib/analyze-run-code.js +397 -0
- package/lib/analyze-sources.js +372 -0
- package/lib/approval-card.js +54 -0
- package/lib/approval-cli.js +53 -0
- package/lib/approval-request.js +81 -0
- package/lib/approval-signer.js +48 -0
- package/lib/approvals.js +295 -0
- package/lib/attachment-cache.js +236 -0
- package/lib/attachment.js +63 -0
- package/lib/blocked.js +20 -0
- package/lib/build-review.js +90 -0
- package/lib/builder/cli.js +90 -0
- package/lib/builder/policy.js +176 -0
- package/lib/builder/recover.js +189 -0
- package/lib/builder/run.js +240 -0
- package/lib/builder/settle.js +198 -0
- package/lib/builder/stage.js +240 -0
- package/lib/builder/state.js +73 -0
- package/lib/builder/supervisor.js +289 -0
- package/lib/builder-clean.js +223 -0
- package/lib/builder-code.cjs +67 -0
- package/lib/builder.js +9 -0
- package/lib/bus-postgres.js +281 -0
- package/lib/bus.js +349 -0
- package/lib/catalog/author.js +278 -0
- package/lib/catalog/dot.js +426 -0
- package/lib/catalog/pattern-model.js +193 -0
- package/lib/catalog/patterns.js +324 -0
- package/lib/catalog/projects.js +83 -0
- package/lib/catalog/records.js +2 -0
- package/lib/catalog/roster.js +70 -0
- package/lib/catalog/team-files.js +49 -0
- package/lib/catalog/teams.js +109 -0
- package/lib/claude-socket.js +333 -0
- package/lib/cli.js +741 -0
- package/lib/code-mode.js +45 -0
- package/lib/code-read-policy.yaml +9 -0
- package/lib/code-run.js +461 -0
- package/lib/codex-compact.js +141 -0
- package/lib/compaction.js +21 -0
- package/lib/config.js +424 -0
- package/lib/cursor-trace.js +248 -0
- package/lib/deep-link.js +20 -0
- package/lib/deliver-push.js +120 -0
- package/lib/delivery.js +28 -0
- package/lib/deploy-tree.js +227 -0
- package/lib/durable.js +404 -0
- package/lib/factory-tick.js +32 -0
- package/lib/family.js +63 -0
- package/lib/fetch-origin.js +53 -0
- package/lib/format.js +133 -0
- package/lib/harness-surface-cli.js +153 -0
- package/lib/harness-surface.js +486 -0
- package/lib/harness.js +271 -0
- package/lib/hook.mjs +291 -0
- package/lib/idle.js +40 -0
- package/lib/install-cursor.js +115 -0
- package/lib/install-opencode.js +105 -0
- package/lib/job.js +82 -0
- package/lib/land-cli.js +319 -0
- package/lib/land-member.js +64 -0
- package/lib/land.js +320 -0
- package/lib/lessons.js +223 -0
- package/lib/limit-alert.js +423 -0
- package/lib/limits.js +284 -0
- package/lib/machine-prompt.js +19 -0
- package/lib/merge-sweep.js +149 -0
- package/lib/messaging.js +1002 -0
- package/lib/mission-cli.js +103 -0
- package/lib/mission.js +241 -0
- package/lib/mode.js +215 -0
- package/lib/models.js +114 -0
- package/lib/names.js +86 -0
- package/lib/opencode-api.js +57 -0
- package/lib/opencode-plugin.mjs +313 -0
- package/lib/operator-token.js +78 -0
- package/lib/operator.js +187 -0
- package/lib/pad-activity.js +143 -0
- package/lib/pad-fresh.js +44 -0
- package/lib/pad.js +198 -0
- package/lib/pattern-cli.js +120 -0
- package/lib/pattern-compiler.js +68 -0
- package/lib/pattern-runs.js +795 -0
- package/lib/pattern-stall.js +58 -0
- package/lib/pattern-tick.js +45 -0
- package/lib/pattern-workflow.js +69 -0
- package/lib/pi-extension.mjs +98 -0
- package/lib/pi.js +57 -0
- package/lib/plugin-copy.js +76 -0
- package/lib/pm-review.js +32 -0
- package/lib/pm-workspace.js +87 -0
- package/lib/postgres.js +115 -0
- package/lib/pr-card.js +34 -0
- package/lib/probe.js +295 -0
- package/lib/process.js +67 -0
- package/lib/project-pause.js +23 -0
- package/lib/prune.js +793 -0
- package/lib/questions.js +250 -0
- package/lib/receipts.js +63 -0
- package/lib/reflect.js +962 -0
- package/lib/rename-migration.js +118 -0
- package/lib/run-terminal.js +437 -0
- package/lib/runner-request.js +33 -0
- package/lib/sandbox-app.js +120 -0
- package/lib/sandbox-claims.js +258 -0
- package/lib/sandbox-cli.js +188 -0
- package/lib/sandbox-hosts-cli.js +68 -0
- package/lib/sandbox-hosts.js +94 -0
- package/lib/sandbox-pr.js +102 -0
- package/lib/sandbox-proposal.js +367 -0
- package/lib/sandbox-tools.js +143 -0
- package/lib/sandbox.js +501 -0
- package/lib/schedule-session.js +68 -0
- package/lib/session-activity.js +67 -0
- package/lib/session-events.js +94 -0
- package/lib/sessions/control.js +244 -0
- package/lib/sessions/git-refs.js +265 -0
- package/lib/sessions/launch.js +359 -0
- package/lib/sessions/registry.js +450 -0
- package/lib/sessions/scope.js +111 -0
- package/lib/setup.js +377 -0
- package/lib/signed-approval.js +225 -0
- package/lib/slash.js +167 -0
- package/lib/spawn-cli.js +45 -0
- package/lib/spawn.js +107 -0
- package/lib/start-limit.js +58 -0
- package/lib/state.js +24 -0
- package/lib/stop.js +308 -0
- package/lib/store-read.js +62 -0
- package/lib/store.js +252 -0
- package/lib/subagent-guard.js +240 -0
- package/lib/surfaces/channel-post.js +43 -0
- package/lib/surfaces/instructions.js +15 -0
- package/lib/surfaces/mcp-reload.js +144 -0
- package/lib/surfaces/ops.js +629 -0
- package/lib/surfaces/render-mcp.js +33 -0
- package/lib/surfaces/run-terminal-ops.js +40 -0
- package/lib/surfaces/sandbox-ops.js +36 -0
- package/lib/surfaces/schema.js +7 -0
- package/lib/surfaces/task-view.js +90 -0
- package/lib/surfaces/types.js +4 -0
- package/lib/task-cli.js +274 -0
- package/lib/task-order.js +34 -0
- package/lib/task-order.mjs +2 -0
- package/lib/task-route.js +125 -0
- package/lib/tasks.js +631 -0
- package/lib/team-permission.js +34 -0
- package/lib/team-templates/blitz/team.dot +9 -0
- package/lib/team-templates/factory/team.dot +26 -0
- package/lib/team-templates/feature/team.dot +14 -0
- package/lib/team-templates/fix-and-review/team.dot +12 -0
- package/lib/team-templates/product/team.dot +16 -0
- package/lib/team-templates/release/team.dot +7 -0
- package/lib/team-templates/review/team.dot +6 -0
- package/lib/terminal-draft.js +42 -0
- package/lib/thread-branch.js +82 -0
- package/lib/thread-channel-store.js +181 -0
- package/lib/thread-channels.js +116 -0
- package/lib/thread-listening.js +20 -0
- package/lib/thread-routes.js +91 -0
- package/lib/threads.js +441 -0
- package/lib/tool-api.js +33 -0
- package/lib/transcript.js +98 -0
- package/lib/ui-build-output.js +19 -0
- package/lib/ui-capabilities.js +90 -0
- package/lib/usage.js +182 -0
- package/lib/vendor/mcp-sdk.d.mts +4 -0
- package/lib/vendor/mcp-sdk.mjs +17046 -0
- package/lib/waiter.js +127 -0
- package/lib/workflows.js +546 -0
- package/lib/worktree-setup.js +86 -0
- package/package.json +112 -1
- package/runner/adapters/claude.js +465 -0
- package/runner/adapters/cli-sandbox.js +277 -0
- package/runner/adapters/codex.js +675 -0
- package/runner/adapters/cursor.mjs +937 -0
- package/runner/adapters/fake.js +119 -0
- package/runner/adapters/opencode-sandbox.js +370 -0
- package/runner/adapters/opencode.js +486 -0
- package/runner/adapters/pi-sandbox.js +134 -0
- package/runner/adapters/pi.js +364 -0
- package/runner/client.js +40 -0
- package/runner/contract.js +129 -0
- package/runner/control.js +178 -0
- package/runner/delivery.js +184 -0
- package/runner/factory-tick.mjs +10 -0
- package/runner/lock.js +41 -0
- package/runner/main.mjs +118 -0
- package/runner/pattern-tick.mjs +16 -0
- package/runner/publish.js +113 -0
- package/runner/runner.js +2612 -0
- package/runner/sandbox-run.mjs +239 -0
- package/runner/schedules.js +294 -0
- package/runner/task-wake.js +59 -0
- package/scripts/ai-collab +3 -0
- package/scripts/ai-collab-bus.mjs +4 -0
- package/scripts/ai-collab-code-mcp.mjs +3 -0
- package/scripts/ai-collab-hook +3 -0
- package/scripts/ai-collab-hook.mjs +3 -0
- package/scripts/ai-collab-mcp-tools.mjs +2 -0
- package/scripts/ai-collab-mcp.mjs +3 -0
- package/scripts/ai-collab.mjs +3 -0
- package/scripts/install-cursor.mjs +11 -0
- package/scripts/install-opencode.mjs +10 -0
- package/scripts/temmo +3 -0
- package/scripts/temmo-bus.mjs +151 -0
- package/scripts/temmo-code-mcp.mjs +63 -0
- package/scripts/temmo-hook +3 -0
- package/scripts/temmo-hook.mjs +201 -0
- package/scripts/temmo-mcp-tools.mjs +22 -0
- package/scripts/temmo-mcp.mjs +27 -0
- package/scripts/temmo.mjs +4 -0
- package/skills/antislop/SKILL.md +701 -0
- package/skills/antislop/VERSION +1 -0
- package/skills/antislop-code/SKILL.md +128 -0
- package/skills/antislop-human/LICENSE-web-quality-skills +21 -0
- package/skills/antislop-human/SKILL.md +204 -0
- package/skills/antislop-human/contrast-check.py +168 -0
- package/skills/antislop-human/contrast-mcp.py +125 -0
- package/skills/antislop-human/references/A11Y-PATTERNS.md +249 -0
- package/skills/antislop-human/references/WCAG.md +127 -0
- package/skills/antislop-layoutmobile/SKILL.md +170 -0
- package/skills/antislop-ui/LICENSE-web-quality-skills +21 -0
- package/skills/antislop-ui/SKILL.md +351 -0
- package/skills/antislop-ui/references/CORE-WEB-VITALS.md +181 -0
- package/skills/antislop-ui/references/WEB-BASELINE.md +28 -0
- package/skills/harness-surface/SKILL.md +42 -0
- package/skills/land/SKILL.md +32 -0
- package/skills/memory-file/SKILL.md +39 -0
- package/skills/temmo/SKILL.md +101 -0
- package/skills/temmo/references/role-programs.md +47 -0
- package/skills/ui-sdk/SKILL.md +56 -0
- package/skills/ui-sdk/references/agent-ready.md +136 -0
- package/skills/ui-sdk/references/build-interface.md +187 -0
- package/skills/ui-sdk/references/create-component.md +88 -0
- package/skills/ui-sdk/references/patterns.md +246 -0
- package/skills/ui-sdk/references/styles.md +66 -0
- package/skills/ui-sdk/references/testing.md +172 -0
- package/skills/ui-sdk/references/web-components.md +78 -0
- package/tools/screen-state.mjs +119 -0
- package/tools/smoke-ui.mjs +540 -0
- package/web/app/activity.jsx +251 -0
- package/web/app/agent-mark.tsx +43 -0
- package/web/app/alert-level.jsx +16 -0
- package/web/app/api/[action]/route.js +8 -0
- package/web/app/api/auth/[step]/route.js +12 -0
- package/web/app/api/events/route.js +8 -0
- package/web/app/api/file/[name]/route.js +8 -0
- package/web/app/api/land/route.js +12 -0
- package/web/app/api/lessons/route.js +8 -0
- package/web/app/api/push/key/route.js +8 -0
- package/web/app/api/push/subscribe/route.js +12 -0
- package/web/app/api/push/test/route.js +8 -0
- package/web/app/api/refs/route.js +8 -0
- package/web/app/api/review-diff/route.js +8 -0
- package/web/app/api/schedules/route.js +8 -0
- package/web/app/api/thread-diff/route.js +8 -0
- package/web/app/api/version/route.js +6 -0
- package/web/app/cards.jsx +189 -0
- package/web/app/chat-api.js +82 -0
- package/web/app/chat-composer.jsx +313 -0
- package/web/app/chat-console.jsx +691 -0
- package/web/app/chat-image.tsx +61 -0
- package/web/app/chat-message.jsx +122 -0
- package/web/app/chat-shared.jsx +59 -0
- package/web/app/chat-sidebar.jsx +25 -0
- package/web/app/chat-stream.js +127 -0
- package/web/app/chat.jsx +31 -0
- package/web/app/compactions.jsx +57 -0
- package/web/app/composer-actions.tsx +87 -0
- package/web/app/decisions.jsx +53 -0
- package/web/app/fonts/OFL-hanken-grotesk.txt +93 -0
- package/web/app/fonts/OFL-ibm-plex-mono.txt +93 -0
- package/web/app/fonts/hanken-grotesk-latin-wght-normal.woff2 +0 -0
- package/web/app/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/web/app/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/web/app/globals.css +199 -0
- package/web/app/home.jsx +246 -0
- package/web/app/icon.svg +1 -0
- package/web/app/land-panel.jsx +63 -0
- package/web/app/land-reviews.jsx +20 -0
- package/web/app/layout.jsx +17 -0
- package/web/app/lessons.tsx +76 -0
- package/web/app/logo.tsx +13 -0
- package/web/app/logos.jsx +16 -0
- package/web/app/manifest.js +8 -0
- package/web/app/mode-menu.tsx +46 -0
- package/web/app/new-session.jsx +275 -0
- package/web/app/notify.jsx +180 -0
- package/web/app/outcomes.tsx +94 -0
- package/web/app/page.jsx +9 -0
- package/web/app/pattern-graph.jsx +75 -0
- package/web/app/patterns-page.jsx +293 -0
- package/web/app/phone-nav.tsx +36 -0
- package/web/app/progress-feed.tsx +33 -0
- package/web/app/providers.tsx +27 -0
- package/web/app/quote.jsx +15 -0
- package/web/app/run-card.tsx +200 -0
- package/web/app/run-requests.tsx +148 -0
- package/web/app/scheduled.jsx +105 -0
- package/web/app/session-panel.tsx +174 -0
- package/web/app/session-toolbar.tsx +180 -0
- package/web/app/shadcn.css +638 -0
- package/web/app/shipped.jsx +49 -0
- package/web/app/subagent-runs.jsx +31 -0
- package/web/app/task-graph.jsx +67 -0
- package/web/app/tasks-strip.tsx +36 -0
- package/web/app/tasks.jsx +375 -0
- package/web/app/team-author.jsx +145 -0
- package/web/app/team-editor.jsx +88 -0
- package/web/app/thread-agents.tsx +32 -0
- package/web/app/thread-place.tsx +9 -0
- package/web/app/thread-sessions.tsx +149 -0
- package/web/app/thread-sidebar.tsx +418 -0
- package/web/app/thread-switcher.tsx +27 -0
- package/web/app/tool-diff.jsx +94 -0
- package/web/components/a2ui/controls.jsx +36 -0
- package/web/components/a2ui/option-picker.jsx +23 -0
- package/web/components/a2ui/script.tsx +121 -0
- package/web/components/a2ui/surface.jsx +81 -0
- package/web/components/chat/thread.jsx +50 -0
- package/web/components/script-text.tsx +42 -0
- package/web/components/ui/avatar.jsx +115 -0
- package/web/components/ui/badge.jsx +47 -0
- package/web/components/ui/button.jsx +63 -0
- package/web/components/ui/chat-container.jsx +52 -0
- package/web/components/ui/choice-list.tsx +72 -0
- package/web/components/ui/code-block.jsx +60 -0
- package/web/components/ui/copy-button.tsx +41 -0
- package/web/components/ui/dropdown-menu.jsx +257 -0
- package/web/components/ui/markdown.jsx +84 -0
- package/web/components/ui/message.jsx +28 -0
- package/web/components/ui/popover.jsx +33 -0
- package/web/components/ui/scroll-button.jsx +34 -0
- package/web/components/ui/select.jsx +189 -0
- package/web/components/ui/sheet.jsx +152 -0
- package/web/components/ui/sonner.jsx +10 -0
- package/web/components/ui/tabs.jsx +88 -0
- package/web/components/ui/textarea.jsx +20 -0
- package/web/components/ui/tooltip.jsx +56 -0
- package/web/components.json +24 -0
- package/web/instrumentation.js +8 -0
- package/web/lib/a2ui-catalog.js +34 -0
- package/web/lib/a2ui-pr.js +76 -0
- package/web/lib/a2ui-run-catalog.js +18 -0
- package/web/lib/a2ui-run.js +93 -0
- package/web/lib/a2ui.js +262 -0
- package/web/lib/activity-rows.js +275 -0
- package/web/lib/agent-detail.js +5 -0
- package/web/lib/alert-level.js +44 -0
- package/web/lib/approval-mode.js +22 -0
- package/web/lib/chat-turns.js +174 -0
- package/web/lib/child-subagents.js +16 -0
- package/web/lib/compaction-view.js +48 -0
- package/web/lib/composer-actions.js +40 -0
- package/web/lib/context-view.js +57 -0
- package/web/lib/fuzzy.js +26 -0
- package/web/lib/highlight.js +44 -0
- package/web/lib/lessons-view.js +23 -0
- package/web/lib/mentions.js +16 -0
- package/web/lib/message-routing.js +105 -0
- package/web/lib/new-session.js +85 -0
- package/web/lib/operator-messages.js +28 -0
- package/web/lib/pattern-graph.js +165 -0
- package/web/lib/pattern-view.js +33 -0
- package/web/lib/pending-summary.js +18 -0
- package/web/lib/permission-modes.js +30 -0
- package/web/lib/project-feed.js +107 -0
- package/web/lib/quote.js +7 -0
- package/web/lib/reply-quote.js +31 -0
- package/web/lib/scheduled.js +79 -0
- package/web/lib/selection.js +110 -0
- package/web/lib/send-confirmation.js +22 -0
- package/web/lib/session-dead.js +10 -0
- package/web/lib/session-state.js +132 -0
- package/web/lib/sidebar.js +15 -0
- package/web/lib/slash-commands.js +164 -0
- package/web/lib/start-default.js +35 -0
- package/web/lib/start-mode.js +35 -0
- package/web/lib/stream-views.js +49 -0
- package/web/lib/subagent-state.js +20 -0
- package/web/lib/task-board.js +54 -0
- package/web/lib/task-graph.js +183 -0
- package/web/lib/task-tags.js +41 -0
- package/web/lib/team-editor.js +10 -0
- package/web/lib/thread-groups.js +86 -0
- package/web/lib/threads.js +28 -0
- package/web/lib/tool-diff.js +273 -0
- package/web/lib/ui-events.js +58 -0
- package/web/lib/utils.js +5 -0
- package/web/lib/view-memory.js +25 -0
- package/web/next.config.mjs +37 -0
- package/web/postcss.config.mjs +1 -0
- package/web/proxy.js +25 -0
- package/web/public/sw.js +39 -0
- package/web/server/auth.js +178 -0
- package/web/server/dispatch.js +293 -0
- package/web/server/history.js +56 -0
- package/web/server/hosted.js +58 -0
- package/web/server/hub.js +126 -0
- package/web/server/instance.js +5 -0
- package/web/server/land-reviews.js +64 -0
- package/web/server/push.js +148 -0
- package/web/server/run-terminal.js +79 -0
- package/web/server/schedules.js +38 -0
- package/web/server/shipped.js +51 -0
- package/web/server/task-board.js +71 -0
- package/web/server/threads.js +209 -0
- package/web/server/ui.js +2937 -0
- package/web/tsconfig.base.json +16 -0
- package/web/tsconfig.json +9 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { Button } from "@/components/ui/button";
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
import { toDot, toGraph } from "@/lib/pattern-graph";
|
|
5
|
+
import { SCOPE_LABELS, canCopy, canDelete, handoffLine, firedCounts, pendingEvents, runsOf } from "@/lib/pattern-view";
|
|
6
|
+
import { SuspensionCard } from "./cards";
|
|
7
|
+
import { ConfirmButton, HandoffDiagram, RoleGraph } from "./pattern-graph";
|
|
8
|
+
import { TeamAuthor } from "./team-author";
|
|
9
|
+
import { TeamEditor } from "./team-editor";
|
|
10
|
+
|
|
11
|
+
const clock = new Intl.DateTimeFormat(undefined, { dateStyle: "medium", timeStyle: "short" });
|
|
12
|
+
|
|
13
|
+
function Tag({ children, tone = "" }) {
|
|
14
|
+
return <span className={cn("shrink-0 rounded border px-1.5 text-xs font-medium", tone || "text-muted-foreground")}>{children}</span>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function describe(pattern) {
|
|
18
|
+
if (pattern.legacy) return `team · ${pattern.roles.length} member${pattern.roles.length === 1 ? "" : "s"}, no handoffs`;
|
|
19
|
+
return pattern.description || "No description yet.";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function shortAddress(address) {
|
|
23
|
+
return address ? address.replace(/#[a-f0-9]{6}[a-f0-9]*$/, "#…") : "not started";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function RunRow({ run, open }) {
|
|
27
|
+
return <li>
|
|
28
|
+
<button type="button" onClick={() => open(run)} className="flex w-full flex-col gap-0.5 rounded-lg border px-2 py-1.5 text-left text-xs hover:bg-sidebar-accent">
|
|
29
|
+
<span className="flex justify-between gap-2 font-mono">
|
|
30
|
+
<span className="truncate">{run.pattern}</span>
|
|
31
|
+
<span className={cn("shrink-0", run.status === "failed" ? "text-destructive" : "text-muted-foreground")}>{run.status}</span>
|
|
32
|
+
</span>
|
|
33
|
+
<span className="text-muted-foreground">active {run.active} · {run.handoffs?.length ?? 0} handoffs · {clock.format(new Date(run.startedAt ?? 0))}</span>
|
|
34
|
+
</button>
|
|
35
|
+
</li>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function TeamRoster({ pattern, members, editing, go, act, busy, disabled, notice }) {
|
|
39
|
+
const [text, setText] = useState(members.join("\n"));
|
|
40
|
+
const roster = text.split(/\r?\n/).map(member => member.trim()).filter(Boolean);
|
|
41
|
+
const savingDisabled = disabled || Boolean(busy) || !roster.length;
|
|
42
|
+
return <div className="mx-auto flex w-full max-w-3xl flex-col gap-4 px-3 py-4 text-sm">
|
|
43
|
+
<div className="flex items-center gap-2">
|
|
44
|
+
<h2 className="font-mono text-base font-semibold">@{pattern.name}</h2>
|
|
45
|
+
<Tag>{pattern.removable ? "project team" : "global team"}</Tag>
|
|
46
|
+
</div>
|
|
47
|
+
{notice && <p role="alert" className="text-xs text-destructive">{notice}</p>}
|
|
48
|
+
{editing ? <form className="flex flex-col gap-3" onSubmit={event => {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
if (savingDisabled) return;
|
|
51
|
+
act("edit", { editTeam: true, team: pattern.name, members: roster }, () => go({ pattern: pattern.name }));
|
|
52
|
+
}}>
|
|
53
|
+
<label className="flex flex-col gap-1">
|
|
54
|
+
Members
|
|
55
|
+
<span className="text-xs text-muted-foreground">One harness or harness:model per line.</span>
|
|
56
|
+
<textarea className="rounded-lg border bg-background p-2 font-mono" rows={6} value={text}
|
|
57
|
+
disabled={Boolean(busy)} onChange={event => setText(event.target.value)}/>
|
|
58
|
+
</label>
|
|
59
|
+
<div className="flex gap-2">
|
|
60
|
+
<Button type="submit" size="sm" disabled={savingDisabled}>Save roster</Button>
|
|
61
|
+
<Button type="button" size="sm" variant="outline" disabled={Boolean(busy)} onClick={() => go({ pattern: pattern.name })}>Cancel</Button>
|
|
62
|
+
</div>
|
|
63
|
+
</form> : <>
|
|
64
|
+
<section className="flex flex-col gap-2">
|
|
65
|
+
<h3 className="text-xs font-medium text-muted-foreground">Members</h3>
|
|
66
|
+
<ul className="flex flex-col gap-1.5">
|
|
67
|
+
{members.map((member, index) => <li key={index} className="rounded-lg border p-2 font-mono text-xs">{member}</li>)}
|
|
68
|
+
</ul>
|
|
69
|
+
</section>
|
|
70
|
+
{pattern.removable && <div className="flex gap-2">
|
|
71
|
+
<Button type="button" size="sm" variant="outline" disabled={disabled || Boolean(busy)}
|
|
72
|
+
onClick={() => go({ pattern: pattern.name, edit: "1" })}>Edit roster</Button>
|
|
73
|
+
<ConfirmButton label="Delete" question={`Delete team ${pattern.name}?`} confirmLabel="Delete" disabled={disabled || Boolean(busy)}
|
|
74
|
+
onConfirm={() => act("delete", { deletePattern: pattern.name }, () => go({}))}/>
|
|
75
|
+
</div>}
|
|
76
|
+
</>}
|
|
77
|
+
</div>;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function PatternInspect({ pattern, own, go, act, busy, disabled, notice, raw }) {
|
|
81
|
+
const graph = toGraph(pattern);
|
|
82
|
+
return <div className="mx-auto flex w-full max-w-3xl flex-col gap-4 px-3 py-4 text-sm">
|
|
83
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
84
|
+
<h2 className="min-w-0 truncate font-mono text-base font-semibold">@{pattern.name}</h2>
|
|
85
|
+
<Tag>{SCOPE_LABELS[pattern.source] ?? pattern.source}</Tag>
|
|
86
|
+
{pattern.invalid && <Tag tone="border-destructive text-destructive">invalid</Tag>}
|
|
87
|
+
</div>
|
|
88
|
+
<p className="text-muted-foreground">{describe(pattern)}</p>
|
|
89
|
+
{pattern.invalid && <p className="rounded-lg border border-destructive/40 bg-destructive/10 px-2 py-1.5 text-xs text-destructive">{pattern.invalid}</p>}
|
|
90
|
+
{canCopy(pattern.source) && <p className="text-xs text-muted-foreground">Read-only. Copy it to the project to change it.</p>}
|
|
91
|
+
|
|
92
|
+
<section className="flex flex-col gap-2">
|
|
93
|
+
<h3 className="text-xs font-medium text-muted-foreground">Roles</h3>
|
|
94
|
+
<ul className="flex flex-col gap-1.5">
|
|
95
|
+
{pattern.roles.map(role => <li key={role.id} className="rounded-lg border p-2 text-xs">
|
|
96
|
+
<div className="flex flex-wrap gap-2 font-mono"><span className="font-semibold">{role.id}</span><span className="text-muted-foreground">{[role.harness, role.model].filter(Boolean).join(" · ")}</span></div>
|
|
97
|
+
<p className="mt-1 text-muted-foreground">{role.responsibility || "No responsibility."}</p>
|
|
98
|
+
</li>)}
|
|
99
|
+
</ul>
|
|
100
|
+
</section>
|
|
101
|
+
|
|
102
|
+
<section className="flex flex-col gap-2">
|
|
103
|
+
<h3 className="text-xs font-medium text-muted-foreground">Graph</h3>
|
|
104
|
+
<div className="rounded-xl bg-card shadow-surface p-2"><RoleGraph graph={graph} label={`Graph of ${pattern.name}`}/></div>
|
|
105
|
+
{pattern.handoffs.length ? <HandoffDiagram handoffs={pattern.handoffs}/> : <p className="text-xs text-muted-foreground">No handoffs. A team starts its members directly.</p>}
|
|
106
|
+
</section>
|
|
107
|
+
|
|
108
|
+
<section className="flex flex-col gap-2">
|
|
109
|
+
<h3 className="text-xs font-medium text-muted-foreground">Definition</h3>
|
|
110
|
+
<div className="flex gap-2">
|
|
111
|
+
<Button type="button" size="sm" variant={raw ? "outline" : "default"} onClick={() => go({ pattern: pattern.name })}>Graph</Button>
|
|
112
|
+
<Button type="button" size="sm" variant={raw ? "default" : "outline"} onClick={() => go({ pattern: pattern.name, raw: "1" })}>Raw</Button>
|
|
113
|
+
{pattern.editable && <Button type="button" size="sm" variant="outline" onClick={() => go({ pattern: pattern.name, edit: "1" })}>Edit</Button>}
|
|
114
|
+
{!pattern.legacy && !pattern.invalid && (pattern.source === "project" || pattern.source === "global") && <Button type="button" size="sm" variant="outline" onClick={() => go({ author: "1", pattern: pattern.name })}>Refine with agent</Button>}
|
|
115
|
+
</div>
|
|
116
|
+
{raw && <pre className="overflow-x-auto rounded-xl border bg-muted/40 p-3 font-mono text-xs leading-relaxed">{pattern.dot || toDot(graph, pattern.name)}</pre>}
|
|
117
|
+
</section>
|
|
118
|
+
|
|
119
|
+
<section className="flex flex-col gap-2">
|
|
120
|
+
<h3 className="text-xs font-medium text-muted-foreground">Runs</h3>
|
|
121
|
+
{own.length ? <ul className="flex flex-col gap-1.5">{own.map(run => <RunRow key={run.id} run={run} open={item => go({ run: item.id })}/>)}</ul>
|
|
122
|
+
: <p className="text-xs text-muted-foreground">No runs of this pattern yet.</p>}
|
|
123
|
+
</section>
|
|
124
|
+
|
|
125
|
+
{notice && <p role="alert" className="text-xs text-destructive">{notice}</p>}
|
|
126
|
+
<div className="flex flex-wrap gap-2">
|
|
127
|
+
{canCopy(pattern.source) && <Button type="button" size="sm" disabled={disabled || Boolean(busy)} onClick={() => act("copy", { copyPattern: pattern.name }, () => go({ pattern: pattern.name }))}>
|
|
128
|
+
Copy to project</Button>}
|
|
129
|
+
{canDelete(pattern) && <ConfirmButton label="Delete" question={`Delete ${pattern.legacy ? "team" : "pattern"} ${pattern.name}?`} confirmLabel="Delete" disabled={disabled || Boolean(busy)}
|
|
130
|
+
onConfirm={() => act("delete", { deletePattern: pattern.name }, () => go({}))}/>}
|
|
131
|
+
</div>
|
|
132
|
+
</div>;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function PatternsPage({ data, project, selected, navigate, call, disabled, models = {} }) {
|
|
136
|
+
const [busy, setBusy] = useState("");
|
|
137
|
+
const [notice, setNotice] = useState("");
|
|
138
|
+
const patterns = [...(data.patterns ?? [])].sort((a, b) => a.name.localeCompare(b.name));
|
|
139
|
+
const runs = data.runs ?? [];
|
|
140
|
+
const go = next => navigate({ project, level: "patterns", ...next });
|
|
141
|
+
// A notice or a pending action belongs to the view it began in; moving to another pattern or run clears both.
|
|
142
|
+
const view = selected.run || `${selected.pattern ?? ""}:${selected.edit ?? ""}`;
|
|
143
|
+
useEffect(() => { setNotice(""); setBusy(""); }, [view]);
|
|
144
|
+
|
|
145
|
+
async function act(label, payload, after) {
|
|
146
|
+
setBusy(label); setNotice("");
|
|
147
|
+
const result = await call({ project, ...payload });
|
|
148
|
+
setBusy("");
|
|
149
|
+
if (result?.error) { setNotice(result.error); return; }
|
|
150
|
+
after?.(result);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (selected.run) {
|
|
154
|
+
const run = runs.find(item => item.id === selected.run);
|
|
155
|
+
if (!run) return <p className="py-16 text-center text-sm text-muted-foreground">Run {selected.run} is not in the last 20 runs.</p>;
|
|
156
|
+
// Keyed on the handoff count so the operator's chosen event resets after each advance.
|
|
157
|
+
return <RunView key={run.id + ":" + (run.handoffs?.length ?? 0)} run={run} data={data} go={go} act={act} busy={busy} disabled={disabled} notice={notice}/>;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const current = patterns.find(item => item.name === selected.pattern);
|
|
161
|
+
if (current?.legacy && !selected.author && selected.edit !== "new") {
|
|
162
|
+
if (selected.edit && !current.removable) return <p className="py-16 text-center text-sm text-muted-foreground">Global team rosters are read-only.</p>;
|
|
163
|
+
const members = data.teams?.find(team => team.id === current.name)?.members ?? [];
|
|
164
|
+
return <TeamRoster key={project + ":" + view} pattern={current} members={members} editing={Boolean(selected.edit)}
|
|
165
|
+
go={go} act={act} busy={busy} disabled={disabled} notice={notice}/>;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (selected.edit) {
|
|
169
|
+
const pattern = selected.edit === "new" ? null : current;
|
|
170
|
+
if (selected.edit !== "new" && !pattern?.editable) return <p className="py-16 text-center text-sm text-muted-foreground">Only a project pattern can be edited here.</p>;
|
|
171
|
+
// The author composer hands over the name typed there; the editor still starts a new team.
|
|
172
|
+
return <TeamEditor key={selected.edit + (selected.pattern || selected.authorName || "")} pattern={selected.edit === "new" ? null : pattern} initialName={selected.authorName || ""} templates={data.templates ?? []} project={project} call={call} go={go} disabled={disabled}/>;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (selected.author) {
|
|
176
|
+
const editing = selected.pattern ? patterns.find(item => item.name === selected.pattern) : null;
|
|
177
|
+
if (selected.pattern && !editing) return <p className="py-16 text-center text-sm text-muted-foreground">Unknown pattern "{selected.pattern}".</p>;
|
|
178
|
+
// Only a project team file or a project pattern can be replaced in place; other sources are read-only here.
|
|
179
|
+
const canRefine = editing && !editing.legacy && !editing.invalid && (editing.source === "project" || editing.source === "global");
|
|
180
|
+
if (editing && !canRefine) return <p className="py-16 text-center text-sm text-muted-foreground">{`${SCOPE_LABELS[editing.source] ?? editing.source} patterns are read-only here; copy it to the project or start a new team.`}</p>;
|
|
181
|
+
return <TeamAuthor key={selected.pattern || "new"} templates={data.templates ?? []} pattern={editing} project={project} call={call} go={go} disabled={disabled} startable={data.startable ?? []} models={models} authorDefault={data.authorDefault}/>;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (selected.pattern) {
|
|
185
|
+
const pattern = current;
|
|
186
|
+
if (!pattern) return <p className="py-16 text-center text-sm text-muted-foreground">Unknown pattern "{selected.pattern}".</p>;
|
|
187
|
+
return <PatternInspect pattern={pattern} own={runsOf(runs, pattern.name)} go={go} act={act} busy={busy} disabled={disabled} notice={notice} raw={selected.raw}/>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const projectCount = patterns.filter(item => !item.legacy).length;
|
|
191
|
+
const running = runs.filter(run => run.status === "running").length;
|
|
192
|
+
return <div className="mx-auto flex w-full max-w-3xl flex-col gap-4 px-3 py-4 text-sm">
|
|
193
|
+
<div className="flex flex-wrap items-center justify-between gap-2">
|
|
194
|
+
<p className="text-xs text-muted-foreground">{projectCount} patterns · {patterns.length - projectCount} teams · {running} running</p>
|
|
195
|
+
<div className="flex flex-wrap gap-2">
|
|
196
|
+
<Button type="button" size="sm" disabled={disabled} onClick={() => go({ author: "1" })}>Describe a team</Button>
|
|
197
|
+
<Button type="button" size="sm" variant="outline" disabled={disabled} onClick={() => go({ edit: "new" })}>New team</Button>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
{notice && <p role="alert" className="text-xs text-destructive">{notice}</p>}
|
|
201
|
+
{!patterns.length && <p className="py-8 text-center text-muted-foreground">No patterns or teams yet.</p>}
|
|
202
|
+
<ul className="flex flex-col gap-1.5">
|
|
203
|
+
{patterns.map(pattern => <li key={pattern.name}>
|
|
204
|
+
<button type="button" onClick={() => go({ pattern: pattern.name })} className="flex w-full flex-col gap-1 rounded-xl border px-3 py-2 text-left hover:bg-sidebar-accent">
|
|
205
|
+
<span className="flex flex-wrap items-center gap-2">
|
|
206
|
+
<span className="min-w-0 truncate font-mono font-medium">@{pattern.name}</span>
|
|
207
|
+
<Tag>{SCOPE_LABELS[pattern.source] ?? pattern.source}</Tag>
|
|
208
|
+
{pattern.invalid && <Tag tone="border-destructive text-destructive">invalid</Tag>}
|
|
209
|
+
</span>
|
|
210
|
+
<span className={cn("truncate text-xs", pattern.description || pattern.legacy ? "text-muted-foreground" : "italic text-muted-foreground")}>{describe(pattern)}</span>
|
|
211
|
+
<span className="font-mono text-xs text-muted-foreground">{pattern.roles.map(role => role.id).join(" → ")}</span>
|
|
212
|
+
</button>
|
|
213
|
+
</li>)}
|
|
214
|
+
</ul>
|
|
215
|
+
{runs.length > 0 && <section className="flex flex-col gap-2">
|
|
216
|
+
<h2 className="text-xs font-medium text-muted-foreground">Recent runs</h2>
|
|
217
|
+
<ul className="flex flex-col gap-1.5">{runs.map(run => <RunRow key={run.id} run={run} open={item => go({ run: item.id })}/>)}</ul>
|
|
218
|
+
</section>}
|
|
219
|
+
</div>;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function RunView({ run, data, go, act, busy, disabled, notice }) {
|
|
223
|
+
const definition = run.definition ?? { roles: [], handoffs: [] };
|
|
224
|
+
const events = pendingEvents(run);
|
|
225
|
+
const [event, setEvent] = useState(events[0] ?? "");
|
|
226
|
+
const [note, setNote] = useState("");
|
|
227
|
+
const active = definition.roles.find(role => role.id === run.active);
|
|
228
|
+
const fired = firedCounts(run);
|
|
229
|
+
return <div className="mx-auto flex w-full max-w-3xl flex-col gap-4 px-3 py-4 text-sm">
|
|
230
|
+
<div className="flex flex-col gap-1">
|
|
231
|
+
<p className="text-xs text-muted-foreground">Run {run.id} · <button type="button" className="underline-offset-2 hover:underline" onClick={() => go({ pattern: run.pattern })}>@{run.pattern}</button></p>
|
|
232
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
233
|
+
<h2 className="font-semibold">{run.status}</h2>
|
|
234
|
+
<span className="text-xs text-muted-foreground">active {run.active}{active?.harness ? ` · ${active.harness}` : ""}</span>
|
|
235
|
+
</div>
|
|
236
|
+
<p className="text-xs">{run.task}</p>
|
|
237
|
+
{run.error && <p role="alert" className="text-xs text-destructive">{run.error}</p>}
|
|
238
|
+
</div>
|
|
239
|
+
|
|
240
|
+
<div className="rounded-xl bg-card shadow-surface p-2"><RoleGraph graph={toGraph(definition)} active={run.status === "running" ? run.active : ""} used={run} label={`Run ${run.id} graph`}/></div>
|
|
241
|
+
|
|
242
|
+
<section className="flex flex-col gap-2">
|
|
243
|
+
<h3 className="text-xs font-medium text-muted-foreground">Roles</h3>
|
|
244
|
+
<ul className="flex flex-col gap-1.5 text-xs">
|
|
245
|
+
{definition.roles.map(role => {
|
|
246
|
+
const address = run.sessions?.[role.id] ?? "";
|
|
247
|
+
const agent = data.agents?.find(item => item.id === address);
|
|
248
|
+
const entered = (run.handoffs ?? []).filter(handoff => handoff.to === role.id).length;
|
|
249
|
+
return <li key={role.id} className="flex flex-wrap items-center gap-2 rounded-lg border px-2 py-1.5">
|
|
250
|
+
<span className="font-mono font-semibold">{role.id}</span>
|
|
251
|
+
{run.active === role.id && run.status === "running" && <Tag tone="border-primary text-primary">active</Tag>}
|
|
252
|
+
<span className="font-mono text-muted-foreground">{shortAddress(address)}</span>
|
|
253
|
+
{address && <span className={agent?.online ? "text-emerald-700 dark:text-emerald-400" : "text-muted-foreground"}>{agent?.online ? "online" : "offline"}</span>}
|
|
254
|
+
<span className="ml-auto text-muted-foreground">entered {entered}</span>
|
|
255
|
+
</li>;
|
|
256
|
+
})}
|
|
257
|
+
</ul>
|
|
258
|
+
{definition.handoffs.some(handoff => handoff.cap !== undefined) && <ul className="flex flex-col gap-1 text-xs">
|
|
259
|
+
{definition.handoffs.filter(handoff => handoff.cap !== undefined).map(handoff => <li key={handoff.on + handoff.from} className="flex flex-wrap justify-between gap-2 font-mono">
|
|
260
|
+
<span>{handoff.from} → {handoff.to} "{handoff.on}"</span>
|
|
261
|
+
<span className={fired(handoff) >= handoff.cap ? "text-destructive" : "text-muted-foreground"}>{fired(handoff)}/{handoff.cap}</span>
|
|
262
|
+
</li>)}
|
|
263
|
+
</ul>}
|
|
264
|
+
</section>
|
|
265
|
+
|
|
266
|
+
<section className="flex flex-col gap-2">
|
|
267
|
+
<h3 className="text-xs font-medium text-muted-foreground">Handoffs</h3>
|
|
268
|
+
{run.handoffs?.length ? <ol className="flex flex-col gap-2 border-l pl-3 text-xs">
|
|
269
|
+
{run.handoffs.map(handoff => <li key={handoff.seq} className="flex flex-col gap-0.5">
|
|
270
|
+
<span className="font-mono">{handoffLine(handoff)}</span>
|
|
271
|
+
<span className="text-muted-foreground">{clock.format(new Date(handoff.at ?? 0))}{handoff.note ? ` · ${handoff.note}` : ""}</span>
|
|
272
|
+
</li>)}
|
|
273
|
+
</ol> : <p className="text-xs text-muted-foreground">No handoffs yet.</p>}
|
|
274
|
+
</section>
|
|
275
|
+
|
|
276
|
+
{run.status === "suspended" && run.suspension && <SuspensionCard key={run.suspension.id} suspension={run.suspension}
|
|
277
|
+
disabled={disabled || Boolean(busy)}
|
|
278
|
+
resume={() => act("advance", { advanceRun: run.id, advanceConfirmation: run.suspension.id }, () => go({ run: run.id }))}/>}
|
|
279
|
+
{run.status === "running" && <section className="flex flex-col gap-2 rounded-xl border p-3">
|
|
280
|
+
<h3 className="text-xs font-medium">Operator advance</h3>
|
|
281
|
+
<p className="text-xs text-muted-foreground">Takes the active role's handoff without its session. The handoff is recorded with your login.</p>
|
|
282
|
+
{events.length ? <div className="flex flex-wrap gap-2">
|
|
283
|
+
<select aria-label="Event" className="rounded border bg-background px-2 py-1 text-xs" value={event} onChange={e => setEvent(e.target.value)}>
|
|
284
|
+
{events.map(item => <option key={item} value={item}>{item}</option>)}
|
|
285
|
+
</select>
|
|
286
|
+
<input aria-label="Note" className="min-w-0 flex-1 rounded border bg-background px-2 py-1 text-xs" placeholder="note (optional)" maxLength={1000} value={note} onChange={e => setNote(e.target.value)}/>
|
|
287
|
+
<ConfirmButton label="Advance" question={`Advance ${run.active} on "${event}"?`} confirmLabel="Advance" disabled={disabled || Boolean(busy)}
|
|
288
|
+
onConfirm={() => act("advance", { advanceRun: run.id, advanceEvent: event, advanceNote: note }, () => go({ run: run.id }))}/>
|
|
289
|
+
</div> : <p className="text-xs text-muted-foreground">No handoff leaves {run.active}.</p>}
|
|
290
|
+
</section>}
|
|
291
|
+
{notice && <p role="alert" className="text-xs text-destructive">{notice}</p>}
|
|
292
|
+
</div>;
|
|
293
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
// The phone's bottom bar: Threads, Decisions, Tasks and Menu, one tap from every screen. Hidden from md up, where the sidebar holds them.
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import { Inbox, ListTodo, PanelLeft, Settings2 } from "lucide-react";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
import { SidebarMenu, sidebarProject, type SidebarProps } from "./thread-sidebar";
|
|
7
|
+
|
|
8
|
+
const TAB = "relative flex min-h-14 min-w-0 flex-1 flex-col items-center justify-center gap-0.5 rounded-md text-xs text-muted-foreground hover:text-foreground focus-visible:-outline-offset-2 active:bg-sidebar-accent aria-[current=page]:font-medium aria-[current=page]:text-foreground";
|
|
9
|
+
const MENU_TAB = TAB + " data-open:bg-sidebar-accent data-open:text-foreground";
|
|
10
|
+
|
|
11
|
+
function Tab({ label, name, icon, current, onClick, title, children }: { label: string; name?: string; icon: ReactNode; current: boolean; onClick: () => void; title?: string; children?: ReactNode }) {
|
|
12
|
+
return <button type="button" data-phone-tab={label} aria-label={name} aria-current={current ? "page" : undefined} onClick={onClick} title={title} className={TAB}>
|
|
13
|
+
<span className="relative">{icon}{children}</span>
|
|
14
|
+
<span>{label}</span>
|
|
15
|
+
</button>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function PhoneNav({ sidebar, threadsOpen, openThreads, waiting }: {
|
|
19
|
+
sidebar: SidebarProps; threadsOpen: boolean; openThreads: () => void; waiting: boolean;
|
|
20
|
+
}) {
|
|
21
|
+
const { selected, navigate, decisions } = sidebar;
|
|
22
|
+
const project = sidebarProject(sidebar.data, selected);
|
|
23
|
+
const on = (level: string) => !threadsOpen && selected.level === level;
|
|
24
|
+
return <nav aria-label="Sections" className="flex shrink-0 gap-1 bg-sidebar px-1 pb-[env(safe-area-inset-bottom)] text-sidebar-foreground shadow-[0_-1px_0_var(--sidebar-border)] md:hidden">
|
|
25
|
+
<Tab label="Threads" current={threadsOpen} onClick={openThreads} title={waiting ? "Sessions waiting on you" : undefined} icon={<PanelLeft aria-hidden className="size-5"/>}>
|
|
26
|
+
{waiting && <span aria-hidden className="absolute -right-1 -top-0.5 size-2 rounded-full bg-primary"/>}
|
|
27
|
+
</Tab>
|
|
28
|
+
<Tab label="Decisions" name={decisions > 0 ? `Decisions, ${decisions} waiting` : undefined} current={on("inbox")} onClick={() => navigate({ level: "inbox" })} icon={<Inbox aria-hidden className="size-5"/>}>
|
|
29
|
+
{decisions > 0 && <span aria-hidden className="absolute -right-3 -top-1.5 min-w-4 rounded-full bg-primary px-1 text-center text-[0.6875rem] font-medium leading-4 tabular-nums text-primary-foreground">
|
|
30
|
+
{decisions}
|
|
31
|
+
</span>}
|
|
32
|
+
</Tab>
|
|
33
|
+
{project && <Tab label="Tasks" current={on("tasks")} onClick={() => navigate({ project, level: "tasks" })} icon={<ListTodo aria-hidden className="size-5"/>}/>}
|
|
34
|
+
<SidebarMenu {...sidebar} placement={{ trigger: MENU_TAB, dot: "absolute right-[calc(50%-0.9rem)] top-2.5", side: "top", align: "end", children: <><Settings2 aria-hidden className="size-5"/><span>Menu</span></> }}/>
|
|
35
|
+
</nav>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
// Recent progress: agents' milestone posts (send_to_all progress=true) across projects, newest first, each linking to its thread or session.
|
|
3
|
+
import { ageOf } from "@/lib/task-board";
|
|
4
|
+
import { selectionHash } from "@/lib/selection";
|
|
5
|
+
|
|
6
|
+
export type ProgressPost = { id: string; time: number; from: string; body: string; project: string; thread?: { id: string; title: string } };
|
|
7
|
+
type Agent = { id: string; name?: string; project?: string };
|
|
8
|
+
|
|
9
|
+
const peerOf = (address: string) => address.split("#")[0];
|
|
10
|
+
|
|
11
|
+
/** Where a post links: its thread when the session sits in one, else the session's chat. */
|
|
12
|
+
function placeOf(post: ProgressPost) {
|
|
13
|
+
return post.thread ? selectionHash({ project: post.project, level: "thread", thread: post.thread.id })
|
|
14
|
+
: selectionHash({ project: post.project, level: "session", harness: peerOf(post.from), session: post.from });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function ProgressFeed({ posts, agents = [], now }: { posts: ProgressPost[]; agents?: Agent[]; now: number }) {
|
|
18
|
+
const names = new Map(agents.map(agent => [agent.id, agent.name]));
|
|
19
|
+
return <section aria-label="Recent progress" className="flex min-w-0 flex-col gap-3">
|
|
20
|
+
<h2 className="text-sm font-semibold">Newest first · {posts.length}</h2>
|
|
21
|
+
{!posts.length && <p className="text-sm text-muted-foreground">No progress posts yet. Agents post milestones in AFK mode.</p>}
|
|
22
|
+
{posts.length > 0 && <ol className="flex min-w-0 flex-col divide-y rounded-2xl bg-card shadow-surface px-3 [overflow-wrap:anywhere]">
|
|
23
|
+
{posts.map(post => <li key={post.project + ":" + post.id} className="flex min-w-0 flex-col gap-1 py-2.5">
|
|
24
|
+
<p className="text-xs text-muted-foreground">
|
|
25
|
+
{post.project}{" · "}<a className="underline" href={"#" + placeOf(post)}>{post.thread?.title || names.get(post.from) || post.from}</a>
|
|
26
|
+
{post.thread && <> · {names.get(post.from) || post.from}</>}
|
|
27
|
+
{" · "}<time dateTime={new Date(post.time * 1000).toISOString()} title={new Date(post.time * 1000).toLocaleString()}>{ageOf(post.time * 1000, now)} ago</time>
|
|
28
|
+
</p>
|
|
29
|
+
<p className="whitespace-pre-wrap text-sm">{post.body}</p>
|
|
30
|
+
</li>)}
|
|
31
|
+
</ol>}
|
|
32
|
+
</section>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, type ReactNode } from "react";
|
|
3
|
+
import type { createAgent } from "@ui-sdk/react/agent";
|
|
4
|
+
import { ThemeProvider } from "next-themes";
|
|
5
|
+
import { TooltipProvider } from "@/components/ui/tooltip";
|
|
6
|
+
import { Toaster } from "@/components/ui/sonner";
|
|
7
|
+
|
|
8
|
+
declare global {
|
|
9
|
+
interface Window {
|
|
10
|
+
temmoTestBridge?: ReturnType<typeof createAgent>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function Providers({ nonce, children }: { nonce?: string; children: ReactNode }) {
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (process.env.NEXT_PUBLIC_TEMMO_TEST_BRIDGE === "1") {
|
|
17
|
+
void import("@ui-sdk/react/agent").then(({ createAgent }) => {
|
|
18
|
+
window.temmoTestBridge ??= createAgent();
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}, []);
|
|
22
|
+
|
|
23
|
+
return <ThemeProvider attribute="class" defaultTheme="dark" enableSystem disableTransitionOnChange nonce={nonce}>
|
|
24
|
+
<TooltipProvider>{children}</TooltipProvider>
|
|
25
|
+
<Toaster/>
|
|
26
|
+
</ThemeProvider>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { quoteText } from "@/lib/quote";
|
|
2
|
+
|
|
3
|
+
const QUOTE_CLASS = "flex max-w-full min-w-0 items-baseline gap-1.5 rounded-lg border-l-2 border-primary/50 bg-muted/60 px-2 py-1 text-left text-xs text-muted-foreground";
|
|
4
|
+
|
|
5
|
+
/** The replied message above a reply's body; a tap scrolls to the original. A quote without an id stays static. */
|
|
6
|
+
export function Quote({ quote, label }) {
|
|
7
|
+
const content = <>
|
|
8
|
+
<span className="shrink-0 font-medium text-foreground">{label}</span>
|
|
9
|
+
<span className="min-w-0 truncate">{quoteText(quote.body)}</span>
|
|
10
|
+
</>;
|
|
11
|
+
if (!quote.id) return <div data-quote="" className={QUOTE_CLASS}>{content}</div>;
|
|
12
|
+
const id = CSS.escape(quote.id);
|
|
13
|
+
const scroll = () => document.querySelector('[data-message-id="' + id + '"], [data-reply-id="' + id + '"]')?.scrollIntoView({ block: "center" });
|
|
14
|
+
return <button type="button" data-quote={quote.id} onClick={scroll} title="Go to the replied message" className={QUOTE_CLASS}>{content}</button>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Drawer, DrawerBackdrop, DrawerClose, DrawerContent, DrawerDescription, DrawerTitle } from "@ui-sdk/react/drawer";
|
|
3
|
+
import { Maximize2, X } from "lucide-react";
|
|
4
|
+
import type { ReactNode } from "react";
|
|
5
|
+
import { CARD } from "@/components/a2ui/surface";
|
|
6
|
+
import { CHECK_TEXT, type Check, Lines, lineCount, useScriptCheck } from "@/components/script-text";
|
|
7
|
+
import { Badge } from "@/components/ui/badge";
|
|
8
|
+
import { Button } from "@/components/ui/button";
|
|
9
|
+
import { CopyButton } from "@/components/ui/copy-button";
|
|
10
|
+
import { runOutcome } from "@/lib/a2ui-run";
|
|
11
|
+
import { decidedLabel } from "@/lib/run-row";
|
|
12
|
+
import { cn } from "@/lib/utils";
|
|
13
|
+
|
|
14
|
+
export type RunRequest = {
|
|
15
|
+
id: string;
|
|
16
|
+
session: string;
|
|
17
|
+
cwd: string;
|
|
18
|
+
reason: string;
|
|
19
|
+
script: string;
|
|
20
|
+
sha256: string;
|
|
21
|
+
status: string;
|
|
22
|
+
expiresAt: number;
|
|
23
|
+
timeoutS?: number;
|
|
24
|
+
by?: string;
|
|
25
|
+
exitCode?: number | null;
|
|
26
|
+
signal?: string | null;
|
|
27
|
+
timedOut?: boolean;
|
|
28
|
+
error?: string;
|
|
29
|
+
stdoutTail?: string;
|
|
30
|
+
stderrTail?: string;
|
|
31
|
+
};
|
|
32
|
+
/** How much a card shows; RunRequests steps it down until every card fits the strip whole. */
|
|
33
|
+
export type Density = { preview: number; output: number; reasonLines: 1 | 2; actionsInHeader: boolean; cwd: boolean };
|
|
34
|
+
export type Focus = "reason" | "script" | "stdout" | "stderr";
|
|
35
|
+
export type Decide = (request: RunRequest, decision: "run" | "reject", sha256?: string) => void;
|
|
36
|
+
|
|
37
|
+
export const FULL: Density = { preview: 3, output: 6, reasonLines: 2, actionsInHeader: false, cwd: true };
|
|
38
|
+
const TAP = "focus-visible:outline-2 focus-visible:outline-ring";
|
|
39
|
+
|
|
40
|
+
const expires = (request: RunRequest) => new Date(request.expiresAt).toISOString().slice(11, 16) + " UTC";
|
|
41
|
+
const textLines = (text: string) => text.split("\n");
|
|
42
|
+
|
|
43
|
+
/** The chip for a run's state: waiting (accent), failed (red) or the decided label. */
|
|
44
|
+
export function RunChip({ request, waiting }: { request: RunRequest; waiting?: boolean }) {
|
|
45
|
+
const label = waiting ? "waiting" : decidedLabel(request);
|
|
46
|
+
return <Badge variant={label === "failed" ? "destructive" : "outline"} className={cn("h-5 shrink-0 px-2 text-xs font-medium",
|
|
47
|
+
label === "waiting" || label === "running" ? "border-primary/40 bg-primary/10 text-primary" : label !== "failed" && "text-muted-foreground")}>{label}</Badge>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** cwd on one line, cut from the start so the folder names nearest the script stay in view. */
|
|
51
|
+
function Cwd({ cwd }: { cwd: string }) {
|
|
52
|
+
return <p className="flex min-w-0 items-baseline gap-2 text-xs" title={cwd}>
|
|
53
|
+
<span className="shrink-0 font-medium text-muted-foreground">cwd</span>
|
|
54
|
+
<span className="min-w-0 truncate text-left font-mono [direction:rtl]"><bdi>{cwd}</bdi></span>
|
|
55
|
+
</p>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** "label · N lines" with copy and Show all, which opens the text in the run's sheet. */
|
|
59
|
+
function TextRow({ label, text, show }: { label: string; text: string; show: () => void }) {
|
|
60
|
+
return <div className="flex min-w-0 items-center gap-1">
|
|
61
|
+
<span className="min-w-0 flex-1 truncate text-xs font-medium text-muted-foreground">{label} · {lineCount(textLines(text))}</span>
|
|
62
|
+
{/* The negative margin keeps 44px tap targets without spacing the rows apart. */}
|
|
63
|
+
<div className="-my-1.5 flex shrink-0 items-center">
|
|
64
|
+
<CopyButton text={text}/>
|
|
65
|
+
<button type="button" aria-label={"Show all of " + label} onClick={show}
|
|
66
|
+
className={cn("flex h-9 items-center gap-1 rounded-md px-2 text-xs font-medium text-foreground hover:bg-accent pointer-coarse:h-11", TAP)}>
|
|
67
|
+
<Maximize2 aria-hidden className="size-3.5"/>Show all
|
|
68
|
+
</button>
|
|
69
|
+
</div>
|
|
70
|
+
</div>;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Up to count lines, one row each (long lines end in an ellipsis), from the start of a script or the end of output. */
|
|
74
|
+
function Preview({ text, count, tail }: { text: string; count: number; tail?: boolean }) {
|
|
75
|
+
const lines = textLines(text);
|
|
76
|
+
const from = tail ? Math.max(0, lines.length - count) : 0;
|
|
77
|
+
const shown = lines.slice(from, from + count);
|
|
78
|
+
const gutter = String(from + shown.length).length + "ch";
|
|
79
|
+
return <pre className="rounded-md border bg-muted/40 px-2 py-1 font-mono text-xs leading-4">{shown.map((line, i) =>
|
|
80
|
+
<span key={i} className="flex gap-2">
|
|
81
|
+
<span aria-hidden style={{ width: gutter }} className="shrink-0 text-right text-muted-foreground/70 select-none">{from + i + 1}</span>
|
|
82
|
+
<span className="min-h-[1lh] min-w-0 truncate whitespace-pre">{line}</span>
|
|
83
|
+
</span>)}</pre>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** The server's sha256 and whether the browser's digest of the shown script matches it; the card shows its first 7 digits. */
|
|
87
|
+
function Hash({ request, check, full }: { request: RunRequest; check: Check; full?: boolean }) {
|
|
88
|
+
const tone = cn("font-mono text-xs text-muted-foreground", check === "differs" && "font-semibold text-destructive");
|
|
89
|
+
if (full) return <p className={cn(tone, "break-all")}>sha256 {request.sha256} · {CHECK_TEXT[check]}</p>;
|
|
90
|
+
return <p className={cn(tone, "flex min-w-0 gap-1")}>
|
|
91
|
+
<span className="shrink-0" title={request.sha256}>sha256 {request.sha256.slice(0, 7)}…</span>
|
|
92
|
+
<span className="shrink-0">·</span>
|
|
93
|
+
<span className="min-w-0 truncate font-sans" title={CHECK_TEXT[check]}>{CHECK_TEXT[check]}</span>
|
|
94
|
+
</p>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function Actions({ request, hex, decide, disabled }: { request: RunRequest; hex: string; decide?: Decide; disabled?: boolean }) {
|
|
98
|
+
return <div className="flex shrink-0 justify-end gap-2">
|
|
99
|
+
<Button type="button" variant="outline" size="sm" className="h-11 rounded-md px-4 sm:h-8" disabled={disabled || !decide}
|
|
100
|
+
onClick={() => decide?.(request, "reject")}>Reject</Button>
|
|
101
|
+
<Button type="button" size="sm" className="h-11 rounded-md px-4 sm:h-8" disabled={disabled || !decide || !hex}
|
|
102
|
+
title={hex ? undefined : "Run waits for the browser's hash of the script to match"} onClick={() => decide?.(request, "run", hex)}>Run</Button>
|
|
103
|
+
</div>;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** A run waiting for Run or Reject: heading, reason, cwd, the script's line count and hash check, then the buttons.
|
|
107
|
+
* Opened from its row (inRow), it leaves the heading and reason to the row above it. */
|
|
108
|
+
export function PendingCard({ request, density, decide, disabled, open, inRow }: {
|
|
109
|
+
request: RunRequest; density: Density; decide?: Decide; disabled?: boolean; open: (focus: Focus) => void; inRow?: boolean;
|
|
110
|
+
}) {
|
|
111
|
+
const { check, hex } = useScriptCheck(request.script, request.sha256);
|
|
112
|
+
const actions = <Actions request={request} hex={hex} decide={decide} disabled={disabled}/>;
|
|
113
|
+
return <section data-run-card={request.id} inert={disabled || undefined} aria-label={"Run in terminal: " + request.reason}
|
|
114
|
+
className={cn(CARD, "flex flex-col gap-1.5 border-primary/50 py-2.5", disabled && "opacity-60")}>
|
|
115
|
+
{!inRow && <><header className="flex min-h-5 min-w-0 items-center gap-2">
|
|
116
|
+
<h3 className="min-w-0 flex-1 truncate text-sm font-medium">Run in terminal</h3>
|
|
117
|
+
{!density.actionsInHeader && <span className="shrink-0 text-xs text-muted-foreground">Expires {expires(request)}</span>}
|
|
118
|
+
<RunChip request={request} waiting/>
|
|
119
|
+
{density.actionsInHeader && actions}
|
|
120
|
+
</header>
|
|
121
|
+
<button type="button" onClick={() => open("reason")} className={cn("rounded-sm text-left text-sm", density.reasonLines === 1 ? "line-clamp-1" : "line-clamp-2", TAP)}>
|
|
122
|
+
{request.reason}
|
|
123
|
+
</button></>}
|
|
124
|
+
<Cwd cwd={request.cwd}/>
|
|
125
|
+
<TextRow label="Script" text={request.script} show={() => open("script")}/>
|
|
126
|
+
<Hash request={request} check={check}/>
|
|
127
|
+
{density.preview > 0 && <Preview text={request.script} count={density.preview}/>}
|
|
128
|
+
{(inRow || !density.actionsInHeader) && actions}
|
|
129
|
+
</section>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** A finished, refused or running run as opened from its row: cwd, one button per text (script, stdout, stderr) that opens
|
|
133
|
+
* it in the sheet, and the tail of the output that tells the outcome (stderr of a failed run, else stdout). */
|
|
134
|
+
export function DecidedCard({ request, density, open }: { request: RunRequest; density: Density; open: (focus: Focus) => void }) {
|
|
135
|
+
const texts = ([["Script", request.script, "script"], ["stdout", request.stdoutTail, "stdout"], ["stderr", request.stderrTail, "stderr"]] as const)
|
|
136
|
+
.filter(([, text]) => text);
|
|
137
|
+
const tail = decidedLabel(request) === "failed" && request.stderrTail ? request.stderrTail : request.stdoutTail;
|
|
138
|
+
return <section data-run-card={request.id} className={cn(CARD, "flex flex-col gap-1.5 py-2.5")}>
|
|
139
|
+
{density.cwd && <Cwd cwd={request.cwd}/>}
|
|
140
|
+
<div className="-mx-2 -my-1 flex min-w-0 flex-wrap">
|
|
141
|
+
{texts.map(([label, text, focus]) => <button key={label} type="button" aria-label={"Show all of " + label} onClick={() => open(focus)}
|
|
142
|
+
className={cn("flex h-9 min-w-0 items-center gap-1 rounded-md px-2 text-xs font-medium text-muted-foreground hover:bg-accent hover:text-foreground pointer-coarse:h-11", TAP)}>
|
|
143
|
+
<Maximize2 aria-hidden className="size-3 shrink-0"/><span className="truncate">{label} · {lineCount(textLines(String(text)))}</span>
|
|
144
|
+
</button>)}
|
|
145
|
+
</div>
|
|
146
|
+
{tail && density.output > 0 && <Preview text={tail} count={density.output} tail/>}
|
|
147
|
+
</section>;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function Section({ label, text, focus, tail, children }: { label: string; text: string; focus: boolean; tail?: boolean; children?: ReactNode }) {
|
|
151
|
+
// Output opens at its last line, anything else at its heading.
|
|
152
|
+
const scroll = (node: HTMLElement | null) => { if (node && focus) requestAnimationFrame(() => node.scrollIntoView({ block: tail ? "end" : "start" })); };
|
|
153
|
+
return <section ref={scroll} className="flex flex-col gap-1.5 scroll-mt-2">
|
|
154
|
+
<div className="flex items-center gap-2">
|
|
155
|
+
<h3 className="min-w-0 flex-1 font-mono text-xs font-medium">{label} · {lineCount(textLines(text))}</h3>
|
|
156
|
+
<CopyButton text={text}/>
|
|
157
|
+
</div>
|
|
158
|
+
{children}
|
|
159
|
+
<pre tabIndex={0} aria-label={label} className={cn("rounded-md border bg-muted/40 px-3 py-2 font-mono text-xs leading-5", TAP)}><Lines lines={textLines(text)}/></pre>
|
|
160
|
+
</section>;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** Everything about one run in a bottom sheet: the full reason, cwd, the whole script with its sha256 check, and output; Run and Reject while it waits. */
|
|
164
|
+
export function RunSheet({ request, waiting, focus, close, decide, disabled }: {
|
|
165
|
+
request: RunRequest; waiting: boolean; focus: Focus; close: () => void; decide?: Decide; disabled?: boolean;
|
|
166
|
+
}) {
|
|
167
|
+
const { check, hex } = useScriptCheck(request.script, request.sha256);
|
|
168
|
+
const outcome = request.status === "pending" ? (waiting ? "" : "Expired before anyone ran it") : runOutcome(request);
|
|
169
|
+
return <Drawer open onOpenChange={(next: boolean) => { if (!next) close(); }}>
|
|
170
|
+
<DrawerBackdrop className="bg-black/30"/>
|
|
171
|
+
<DrawerContent initialFocus="content" className="flex h-[92dvh] w-full flex-col rounded-t-3xl bg-card shadow-raised">
|
|
172
|
+
<div aria-hidden className="mx-auto mt-2 h-1.5 w-10 shrink-0 rounded-full bg-muted-foreground/30"/>
|
|
173
|
+
<header className="flex shrink-0 items-center gap-2 border-b px-4 pt-1 pb-2">
|
|
174
|
+
<DrawerTitle className="min-w-0 flex-1 truncate text-base font-medium">Run in terminal</DrawerTitle>
|
|
175
|
+
<RunChip request={request} waiting={waiting}/>
|
|
176
|
+
<DrawerClose aria-label="Close" className={cn("grid size-11 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground", TAP)}>
|
|
177
|
+
<X aria-hidden className="size-4"/>
|
|
178
|
+
</DrawerClose>
|
|
179
|
+
</header>
|
|
180
|
+
<div className="flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto overscroll-contain px-4 py-3">
|
|
181
|
+
<div ref={node => { if (node && focus === "reason") node.scrollIntoView({ block: "start" }); }} className="flex flex-col gap-1.5">
|
|
182
|
+
<DrawerDescription className="text-sm text-foreground [overflow-wrap:anywhere]">{request.reason}</DrawerDescription>
|
|
183
|
+
<dl className="grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs">
|
|
184
|
+
<dt className="text-muted-foreground">From</dt><dd className="min-w-0 break-all">{request.session}</dd>
|
|
185
|
+
<dt className="text-muted-foreground">cwd</dt><dd className="min-w-0 font-mono break-all">{request.cwd}</dd>
|
|
186
|
+
{waiting && <><dt className="text-muted-foreground">Expires</dt>
|
|
187
|
+
<dd>{expires(request)}{request.timeoutS ? ` · times out after ${request.timeoutS} s` : ""}</dd></>}
|
|
188
|
+
{outcome && <><dt className="text-muted-foreground">Outcome</dt><dd className="min-w-0">{outcome}</dd></>}
|
|
189
|
+
</dl>
|
|
190
|
+
</div>
|
|
191
|
+
<Section label="Script" text={request.script} focus={focus === "script"}><Hash request={request} check={check} full/></Section>
|
|
192
|
+
{request.stdoutTail && <Section label="stdout" text={request.stdoutTail} focus={focus === "stdout"} tail/>}
|
|
193
|
+
{request.stderrTail && <Section label="stderr" text={request.stderrTail} focus={focus === "stderr"} tail/>}
|
|
194
|
+
</div>
|
|
195
|
+
{waiting && <footer className="shrink-0 border-t px-4 py-3">
|
|
196
|
+
<Actions request={request} hex={hex} disabled={disabled} decide={decide && ((...args) => { close(); decide(...args); })}/>
|
|
197
|
+
</footer>}
|
|
198
|
+
</DrawerContent>
|
|
199
|
+
</Drawer>;
|
|
200
|
+
}
|