arco-workbench 0.1.3 → 0.1.4
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/CONTRIBUTING.md +1 -1
- package/README.md +5 -1
- package/client/dist/assets/{PhosphorBackdrop-CkVIGkeX.js → PhosphorBackdrop-CNumba2X.js} +1 -1
- package/client/dist/assets/{ThemedBackgroundShaderImpl-DHF7CnpE.js → ThemedBackgroundShaderImpl-DX5KyCt3.js} +1 -1
- package/client/dist/assets/{XtermView-SY0UcZUS.js → XtermView-DhS5g8Rt.js} +1 -1
- package/client/dist/assets/{galleryEditor-Ca4F8HiM.js → galleryEditor-fPb76Cjv.js} +1 -1
- package/client/dist/assets/index-CjkHb-_n.js +592 -0
- package/client/dist/assets/index-DIbh3ae5.css +1 -0
- package/client/dist/index.html +2 -2
- package/client/src/App.tsx +2 -0
- package/client/src/alerts/desktopAlerts.ts +13 -1
- package/client/src/brief/briefFacts.ts +22 -0
- package/client/src/brief/briefFromStore.ts +7 -2
- package/client/src/components/ArtifactMoveDialog.tsx +64 -0
- package/client/src/components/BriefControl.tsx +38 -47
- package/client/src/components/CatchMeUp.tsx +25 -25
- package/client/src/components/CheckpointActions.tsx +7 -4
- package/client/src/components/ClusterComposerButtons.tsx +6 -3
- package/client/src/components/ClusterPlanTab.tsx +15 -1
- package/client/src/components/ClusterRightPanel/AutoPickupControl.tsx +6 -2
- package/client/src/components/ClusterTab.tsx +33 -3
- package/client/src/components/ClusterTaskBoardTab.tsx +62 -8
- package/client/src/components/DialogShell.tsx +115 -0
- package/client/src/components/DocsUpdateDialog.tsx +16 -42
- package/client/src/components/ForwardMessages.tsx +28 -32
- package/client/src/components/GitDialog.tsx +52 -52
- package/client/src/components/GitOtherWork.tsx +4 -2
- package/client/src/components/HandoffDialog.tsx +19 -45
- package/client/src/components/Home/HomeView.tsx +36 -8
- package/client/src/components/Home/home.css +7 -0
- package/client/src/components/KeepButton.tsx +23 -0
- package/client/src/components/MdTuneupDialog.tsx +52 -51
- package/client/src/components/MemberCard.tsx +4 -1
- package/client/src/components/MemberPane.tsx +1 -1
- package/client/src/components/NotificationCenter.tsx +4 -3
- package/client/src/components/NotificationChannelsSettings.tsx +25 -7
- package/client/src/components/PlanCandidateBanner.tsx +111 -57
- package/client/src/components/PlanComposerDialog.tsx +55 -87
- package/client/src/components/ProjectStateNotice.tsx +60 -0
- package/client/src/components/PublicProjectBox.tsx +25 -0
- package/client/src/components/ResearchDialog.tsx +15 -24
- package/client/src/components/ReviewDialog.tsx +32 -57
- package/client/src/components/RightPanel/OutputsPanel.tsx +4 -0
- package/client/src/components/RightPanel/PlanTab.tsx +24 -2
- package/client/src/components/RightPanel/UsageTab.tsx +77 -1
- package/client/src/components/SkillEditorDialog.tsx +38 -73
- package/client/src/components/SpawnDialog.tsx +19 -41
- package/client/src/components/StorageWarnings.tsx +21 -0
- package/client/src/components/SystemHeader.tsx +2 -2
- package/client/src/components/TerminalInput.tsx +6 -2
- package/client/src/components/TidyComposer.tsx +24 -41
- package/client/src/components/TranscriptSendDialog.tsx +151 -202
- package/client/src/components/UtilityAgentPicker.tsx +4 -2
- package/client/src/components/WorkflowCreator/index.tsx +2 -0
- package/client/src/components/WorkflowView.tsx +4 -1
- package/client/src/components/clusterNeedsYou.ts +35 -3
- package/client/src/components/compare/CompareDialog.tsx +26 -2
- package/client/src/components/terminalInput/planDraft.ts +33 -4
- package/client/src/components/utilityResult.ts +5 -1
- package/client/src/explorer/ExplorerApp.tsx +5 -2
- package/client/src/explorer/PlansLens.tsx +60 -19
- package/client/src/explorer/StorageLens.tsx +275 -0
- package/client/src/explorer/launch.ts +3 -3
- package/client/src/explorer/plansGrouping.ts +15 -0
- package/client/src/help/content/cluster.tsx +42 -7
- package/client/src/help/content/composer.tsx +26 -6
- package/client/src/help/content/header.tsx +16 -14
- package/client/src/help/content/misc.tsx +141 -6
- package/client/src/help/content/rightPanel.tsx +16 -0
- package/client/src/help/content/settings.tsx +4 -4
- package/client/src/help/manualSections/actions.tsx +19 -4
- package/client/src/help/manualSections/clusters.tsx +29 -16
- package/client/src/help/manualSections/configuration.tsx +6 -4
- package/client/src/help/manualSections/maintenance.tsx +27 -5
- package/client/src/help/manualSections/plans.tsx +96 -2
- package/client/src/help/manualSections/powerFeatures.tsx +2 -2
- package/client/src/help/manualSections/reference.tsx +6 -0
- package/client/src/help/manualSections/workspace.tsx +9 -5
- package/client/src/stores/appStore.ts +10 -1
- package/client/src/stores/appStore.types.ts +2 -0
- package/client/src/stores/mdTuneupStore.ts +5 -4
- package/client/src/stores/memoryTrim.ts +18 -2
- package/client/src/stores/storageWarningStore.ts +18 -0
- package/client/src/utils/gitDialogMemory.ts +26 -0
- package/client/src/utils/historyEvents.ts +1 -0
- package/client/src/utils/homeModel.ts +19 -0
- package/client/src/utils/publicProject.ts +56 -0
- package/client/src/ws/handleServerMessage.ts +7 -2
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/CHECKPOINTS.md +2 -0
- package/docs/CLIENT.md +29 -11
- package/docs/FEATURES.md +14 -11
- package/docs/GETTING_STARTED.md +7 -7
- package/docs/GLOSSARY.md +3 -3
- package/docs/GOTCHAS.md +3 -2
- package/docs/HTTP_API.md +31 -1
- package/docs/NOTIFICATIONS.md +13 -14
- package/docs/OPERATIONS.md +27 -1
- package/docs/OPERATOR_ACTIONS.md +1 -1
- package/docs/OUTPUTS.md +9 -0
- package/docs/PERSISTENCE.md +34 -4
- package/docs/PLAN_OR_BOARD.md +7 -0
- package/docs/PRIMITIVES.md +3 -3
- package/docs/PROTOCOL.md +14 -4
- package/docs/PROTOCOL_CLUSTER.md +3 -2
- package/docs/SERVICE_MODE.md +5 -1
- package/docs/SETTINGS.md +8 -6
- package/docs/STORAGE_PLAN.md +324 -0
- package/docs/TASK_LEDGER.md +5 -4
- package/native/linux-arm64/manifest.json +1 -1
- package/node_modules/@arco/shared/dist/index.d.ts +2 -0
- package/node_modules/@arco/shared/dist/index.js +2 -0
- package/node_modules/@arco/shared/dist/protocol/autoPickup.d.ts +1 -1
- package/node_modules/@arco/shared/dist/protocol/autoPickup.js +1 -1
- package/node_modules/@arco/shared/dist/protocol/checkpoints.d.ts +1 -0
- package/node_modules/@arco/shared/dist/protocol/clusters.d.ts +2 -1
- package/node_modules/@arco/shared/dist/protocol/index.d.ts +1 -0
- package/node_modules/@arco/shared/dist/protocol/index.js +1 -0
- package/node_modules/@arco/shared/dist/protocol/mdTuneup.d.ts +6 -0
- package/node_modules/@arco/shared/dist/protocol/notifications.d.ts +2 -1
- package/node_modules/@arco/shared/dist/protocol/notifications.js +3 -2
- package/node_modules/@arco/shared/dist/protocol/plans.d.ts +2 -0
- package/node_modules/@arco/shared/dist/protocol/serverMessages.d.ts +2 -1
- package/node_modules/@arco/shared/dist/protocol/storage.d.ts +21 -0
- package/node_modules/@arco/shared/dist/protocol/storage.js +3 -0
- package/node_modules/@arco/shared/dist/protocol/tasks.d.ts +3 -0
- package/node_modules/@arco/shared/dist/protocol/utilityAgent.d.ts +2 -2
- package/node_modules/@arco/shared/dist/protocol/utilityAgent.js +2 -2
- package/node_modules/@arco/shared/dist/publicGuardrails.d.ts +7 -0
- package/node_modules/@arco/shared/dist/publicGuardrails.js +47 -0
- package/node_modules/@arco/shared/dist/publicSafetyRules.d.ts +1 -0
- package/node_modules/@arco/shared/dist/publicSafetyRules.js +6 -0
- package/node_modules/@arco/shared/package.json +1 -1
- package/package.json +3 -2
- package/scripts/packaging/arco.mjs +17 -1
- package/scripts/packaging/services.mjs +35 -5
- package/scripts/packaging/storage.mjs +125 -0
- package/scripts/packaging/update.mjs +3 -3
- package/server/dist/artifactCopy.d.ts +26 -0
- package/server/dist/artifactCopy.js +398 -0
- package/server/dist/atomicFile.d.ts +1 -0
- package/server/dist/atomicFile.js +1 -1
- package/server/dist/attention.d.ts +1 -1
- package/server/dist/attention.js +10 -13
- package/server/dist/catchUp.d.ts +2 -0
- package/server/dist/catchUp.js +46 -23
- package/server/dist/clusterPeerOps.d.ts +2 -0
- package/server/dist/clusterPeerOps.js +2 -0
- package/server/dist/clusterSnapshots.js +22 -12
- package/server/dist/eventLog.d.ts +55 -0
- package/server/dist/eventLog.js +792 -0
- package/server/dist/explorerLaunch.d.ts +4 -1
- package/server/dist/explorerLaunch.js +3 -2
- package/server/dist/explorerPlans.d.ts +4 -0
- package/server/dist/explorerPlans.js +27 -2
- package/server/dist/http/clusterRoutes.js +2 -0
- package/server/dist/http/explorerRoutes.js +2 -1
- package/server/dist/http/publicProjectRoutes.d.ts +2 -0
- package/server/dist/http/publicProjectRoutes.js +68 -0
- package/server/dist/http/router.js +6 -0
- package/server/dist/http/storageRoutes.d.ts +2 -0
- package/server/dist/http/storageRoutes.js +254 -0
- package/server/dist/http/usageStatsRoutes.js +3 -12
- package/server/dist/index.js +4 -0
- package/server/dist/keepStore.d.ts +16 -0
- package/server/dist/keepStore.js +119 -0
- package/server/dist/management/clusterActivity.js +6 -20
- package/server/dist/management/initHubLink.js +10 -43
- package/server/dist/mcp/clusterMcpTools.js +8 -1
- package/server/dist/notifications.d.ts +3 -1
- package/server/dist/notifications.js +5 -4
- package/server/dist/outputStore.d.ts +1 -0
- package/server/dist/outputStore.js +1 -1
- package/server/dist/outputs.js +39 -8
- package/server/dist/planHistory.d.ts +3 -0
- package/server/dist/planHistory.js +60 -0
- package/server/dist/primitives/runMdTuneup.d.ts +5 -1
- package/server/dist/primitives/runMdTuneup.js +43 -2
- package/server/dist/project/taskLedger.d.ts +4 -0
- package/server/dist/project/taskLedger.js +19 -0
- package/server/dist/providers/claude-native/peerTools.js +4 -0
- package/server/dist/providers/claude-native/resumeSummary.js +30 -19
- package/server/dist/providers/index.js +8 -13
- package/server/dist/providers/localProviderQueue.d.ts +2 -0
- package/server/dist/providers/localProviderQueue.js +11 -0
- package/server/dist/publicProject.d.ts +54 -0
- package/server/dist/publicProject.js +135 -0
- package/server/dist/recall/index.js +22 -23
- package/server/dist/server/broadcast.d.ts +2 -1
- package/server/dist/server/broadcast.js +56 -1
- package/server/dist/smartPickupAdapters.d.ts +7 -0
- package/server/dist/smartPickupAdapters.js +172 -8
- package/server/dist/storageActions.d.ts +50 -0
- package/server/dist/storageActions.js +326 -0
- package/server/dist/storageArchive.d.ts +24 -0
- package/server/dist/storageArchive.js +358 -0
- package/server/dist/storageOverview.d.ts +47 -0
- package/server/dist/storageOverview.js +197 -0
- package/server/dist/storageReport.d.ts +48 -0
- package/server/dist/storageReport.js +185 -0
- package/server/dist/storageWarnings.d.ts +4 -0
- package/server/dist/storageWarnings.js +96 -0
- package/server/dist/workers/limits.js +4 -1
- package/server/dist/workflowStore.d.ts +2 -0
- package/server/dist/workflowStore.js +88 -72
- package/server/dist/workflows/purgeWorkflow.d.ts +1 -0
- package/server/dist/workflows/purgeWorkflow.js +15 -2
- package/server/dist/workflows/sessionDiscovery.js +5 -17
- package/server/dist/workflows/sessionIndex.js +22 -17
- package/server/dist/ws/taskLedgerHandlers.js +8 -3
- package/server/dist/ws/workflowHandlers.js +5 -4
- package/server/package.json +1 -1
- package/server/src/artifactCopy.ts +254 -0
- package/server/src/atomicFile.ts +1 -1
- package/server/src/attention.ts +9 -10
- package/server/src/catchUp.ts +37 -15
- package/server/src/clusterPeerOps.ts +5 -0
- package/server/src/clusterSnapshots.ts +20 -13
- package/server/src/eventLog.ts +571 -0
- package/server/src/explorerLaunch.ts +3 -2
- package/server/src/explorerPlans.ts +22 -2
- package/server/src/http/clusterRoutes.ts +4 -1
- package/server/src/http/explorerRoutes.ts +2 -1
- package/server/src/http/publicProjectRoutes.ts +54 -0
- package/server/src/http/router.ts +4 -0
- package/server/src/http/storageRoutes.ts +187 -0
- package/server/src/http/usageStatsRoutes.ts +3 -11
- package/server/src/index.ts +4 -0
- package/server/src/keepStore.ts +102 -0
- package/server/src/management/clusterActivity.ts +6 -16
- package/server/src/management/initHubLink.ts +10 -39
- package/server/src/mcp/clusterMcpTools.ts +8 -2
- package/server/src/notifications.ts +4 -3
- package/server/src/outputStore.ts +5 -2
- package/server/src/outputs.ts +30 -6
- package/server/src/planHistory.ts +48 -0
- package/server/src/primitives/runMdTuneup.ts +32 -2
- package/server/src/project/taskLedger.ts +20 -0
- package/server/src/providers/claude-native/peerTools.ts +4 -0
- package/server/src/providers/claude-native/resumeSummary.ts +32 -18
- package/server/src/providers/index.ts +2 -16
- package/server/src/providers/localProviderQueue.ts +13 -0
- package/server/src/publicProject.ts +142 -0
- package/server/src/recall/index.ts +4 -9
- package/server/src/server/broadcast.ts +53 -1
- package/server/src/smartPickupAdapters.ts +128 -5
- package/server/src/storageActions.ts +216 -0
- package/server/src/storageArchive.ts +277 -0
- package/server/src/storageOverview.ts +184 -0
- package/server/src/storageReport.ts +210 -0
- package/server/src/storageWarnings.ts +84 -0
- package/server/src/workers/limits.ts +4 -1
- package/server/src/workflowStore.ts +78 -61
- package/server/src/workflows/purgeWorkflow.ts +12 -3
- package/server/src/workflows/sessionDiscovery.ts +5 -13
- package/server/src/workflows/sessionIndex.ts +5 -9
- package/server/src/ws/taskLedgerHandlers.ts +8 -3
- package/server/src/ws/workflowHandlers.ts +5 -4
- package/shared/dist/index.d.ts +2 -0
- package/shared/dist/index.js +2 -0
- package/shared/dist/protocol/autoPickup.d.ts +1 -1
- package/shared/dist/protocol/autoPickup.js +1 -1
- package/shared/dist/protocol/checkpoints.d.ts +1 -0
- package/shared/dist/protocol/clusters.d.ts +2 -1
- package/shared/dist/protocol/index.d.ts +1 -0
- package/shared/dist/protocol/index.js +1 -0
- package/shared/dist/protocol/mdTuneup.d.ts +6 -0
- package/shared/dist/protocol/notifications.d.ts +2 -1
- package/shared/dist/protocol/notifications.js +3 -2
- package/shared/dist/protocol/plans.d.ts +2 -0
- package/shared/dist/protocol/serverMessages.d.ts +2 -1
- package/shared/dist/protocol/storage.d.ts +21 -0
- package/shared/dist/protocol/storage.js +3 -0
- package/shared/dist/protocol/tasks.d.ts +3 -0
- package/shared/dist/protocol/utilityAgent.d.ts +2 -2
- package/shared/dist/protocol/utilityAgent.js +2 -2
- package/shared/dist/publicGuardrails.d.ts +7 -0
- package/shared/dist/publicGuardrails.js +47 -0
- package/shared/dist/publicSafetyRules.d.ts +1 -0
- package/shared/dist/publicSafetyRules.js +6 -0
- package/shared/src/index.ts +3 -0
- package/shared/src/protocol/autoPickup.ts +1 -1
- package/shared/src/protocol/checkpoints.ts +4 -0
- package/shared/src/protocol/clusters.ts +6 -1
- package/shared/src/protocol/index.ts +1 -0
- package/shared/src/protocol/mdTuneup.ts +5 -0
- package/shared/src/protocol/notifications.ts +6 -2
- package/shared/src/protocol/plans.ts +2 -0
- package/shared/src/protocol/serverMessages.ts +2 -0
- package/shared/src/protocol/storage.ts +35 -0
- package/shared/src/protocol/tasks.ts +6 -0
- package/shared/src/protocol/utilityAgent.ts +2 -2
- package/shared/src/publicGuardrails.ts +50 -0
- package/shared/src/publicSafetyRules.ts +5 -0
- package/client/dist/assets/index-CcNtMA2y.js +0 -546
- package/client/dist/assets/index-Dl8tYsSp.css +0 -1
|
@@ -6,7 +6,7 @@ import { useAppStore } from '../../stores/appStore';
|
|
|
6
6
|
import { useStartupStore } from '../../stores/startupStore';
|
|
7
7
|
import type { CreatorPrefill } from '../../stores/appStore.types';
|
|
8
8
|
import {
|
|
9
|
-
openWork, organizationAvailable, parseProjects, projectLabels, scanFolderOf, rootsOf, searchProjects, workForProject,
|
|
9
|
+
openWork, boundProjects, conversationStarted, organizationAvailable, parseProjects, projectLabels, scanFolderOf, rootsOf, searchProjects, workForProject,
|
|
10
10
|
type HomeProject, type HomeRoot, type OpenWorkItem,
|
|
11
11
|
} from '../../utils/homeModel';
|
|
12
12
|
import { ProjectCard } from './ProjectCard';
|
|
@@ -45,13 +45,21 @@ export function HomeView({ onResume }: { onResume?: (config: WorkflowConfig) =>
|
|
|
45
45
|
const [locationOpen, setLocationOpen] = useState(false);
|
|
46
46
|
const [location, setLocation] = useState('');
|
|
47
47
|
const [hasChatted, setHasChatted] = useState(() => localStorage.getItem('arco-home-started-chat') === '1');
|
|
48
|
+
const [savedChats, setSavedChats] = useState(0);
|
|
49
|
+
const [savedClusters, setSavedClusters] = useState(0);
|
|
50
|
+
const [guideHidden, setGuideHidden] = useState(() => localStorage.getItem('arco-home-guide-hidden') === '1');
|
|
48
51
|
useEffect(() => {
|
|
49
52
|
let alive = true;
|
|
50
53
|
void fetch('/api/chats').then(r => r.ok ? r.json() : null).then(body => {
|
|
51
|
-
if (alive && Array.isArray(body?.chats)
|
|
52
|
-
|
|
54
|
+
if (alive && Array.isArray(body?.chats)) {
|
|
55
|
+
const n = body.chats.filter((chat: { config?: { voiceOperator?: boolean } }) => !chat.config?.voiceOperator).length;
|
|
56
|
+
setSavedChats(n);
|
|
57
|
+
if (n > 0) { localStorage.setItem('arco-home-started-chat', '1'); setHasChatted(true); }
|
|
53
58
|
}
|
|
54
59
|
}).catch(() => {});
|
|
60
|
+
void fetch('/api/clusters').then(r => r.ok ? r.json() : null).then(body => {
|
|
61
|
+
if (alive && Array.isArray(body?.clusters)) setSavedClusters(body.clusters.length);
|
|
62
|
+
}).catch(() => {});
|
|
55
63
|
return () => { alive = false; };
|
|
56
64
|
}, []);
|
|
57
65
|
const settings = useAppStore(s => s.settings);
|
|
@@ -59,6 +67,9 @@ export function HomeView({ onResume }: { onResume?: (config: WorkflowConfig) =>
|
|
|
59
67
|
const [workExpanded, setWorkExpanded] = useState(false);
|
|
60
68
|
const [workColumns, setWorkColumns] = useState(3);
|
|
61
69
|
const workProbe = useRef<HTMLDivElement>(null);
|
|
70
|
+
const projectProbe = useRef<HTMLDivElement>(null);
|
|
71
|
+
const [projectColumns, setProjectColumns] = useState(3);
|
|
72
|
+
const [projectsExpanded, setProjectsExpanded] = useState(false);
|
|
62
73
|
const [addOpen, setAddOpen] = useState(false);
|
|
63
74
|
const [browserRoot, setBrowserRoot] = useState('');
|
|
64
75
|
const [activity, setActivity] = useState<Record<string, number>>({});
|
|
@@ -122,8 +133,10 @@ export function HomeView({ onResume }: { onResume?: (config: WorkflowConfig) =>
|
|
|
122
133
|
const waiting = work.filter(waitingFor).length;
|
|
123
134
|
const providerReady = anyPrimaryProviderConnected(auth, p => settings?.enabledProviders?.[p] !== false, settings?.claude?.transport);
|
|
124
135
|
const chatOpen = work.some(item => item.kind === 'chat');
|
|
136
|
+
const savedSessions = Object.values(activity).filter(at => at > 0).length;
|
|
137
|
+
const started = conversationStarted({ openWork: work.length, savedChats, savedClusters, savedSessions, remembered: hasChatted });
|
|
125
138
|
useEffect(() => { if (chatOpen && !hasChatted) { localStorage.setItem('arco-home-started-chat', '1'); setHasChatted(true); } }, [chatOpen, hasChatted]);
|
|
126
|
-
const gettingStarted = projects !== null && (!providerReady || availableProjects(projects) === 0 || !
|
|
139
|
+
const gettingStarted = projects !== null && !guideHidden && (!providerReady || availableProjects(projects) === 0 || !started);
|
|
127
140
|
const operatorName = settings?.operatorName?.trim();
|
|
128
141
|
const hour = new Date().getHours();
|
|
129
142
|
const greeting = operatorName ? `Good ${hour < 12 ? 'morning' : hour < 18 ? 'afternoon' : 'evening'}, ${operatorName}` : 'Welcome back';
|
|
@@ -160,6 +173,17 @@ export function HomeView({ onResume }: { onResume?: (config: WorkflowConfig) =>
|
|
|
160
173
|
const labels = useMemo(() => projectLabels(projects ?? []), [projects]);
|
|
161
174
|
const availableCount = (projects ?? []).filter(p => p.exists && !p.archived).length;
|
|
162
175
|
const archivedCount = (projects ?? []).filter((p) => p.archived).length;
|
|
176
|
+
const showProjects = availableCount > 0 || !gettingStarted || !!loadError || archivedCount > 0;
|
|
177
|
+
useEffect(() => {
|
|
178
|
+
const probe = projectProbe.current;
|
|
179
|
+
if (!probe || typeof ResizeObserver === 'undefined') return;
|
|
180
|
+
const measure = () => setProjectColumns(Math.max(1, getComputedStyle(probe).gridTemplateColumns.split(' ').filter(Boolean).length || 1));
|
|
181
|
+
measure();
|
|
182
|
+
const observer = new ResizeObserver(measure);
|
|
183
|
+
observer.observe(probe);
|
|
184
|
+
return () => observer.disconnect();
|
|
185
|
+
}, [showProjects]);
|
|
186
|
+
const bound = boundProjects(filtered, projectColumns, projectsExpanded, query.trim().length > 0);
|
|
163
187
|
const start = (prefill: CreatorPrefill) => openCreatorWith(prefill);
|
|
164
188
|
const openItem = (item: OpenWorkItem) => (item.kind === 'cluster' ? setActiveCluster(item.id) : setActiveJob(item.id));
|
|
165
189
|
|
|
@@ -197,10 +221,10 @@ export function HomeView({ onResume }: { onResume?: (config: WorkflowConfig) =>
|
|
|
197
221
|
<HomeStatus running={running} waiting={waiting} />
|
|
198
222
|
</header>
|
|
199
223
|
{startControls}
|
|
200
|
-
{gettingStarted && <section className="home-getting-started" aria-label="Getting started" data-help="home.getting-started"><h2>Getting started</h2><p>Three steps to your first conversation.</p><ol>
|
|
224
|
+
{gettingStarted && <section className="home-getting-started" aria-label="Getting started" data-help="home.getting-started"><button type="button" className="home-guide-hide" aria-label="Hide the getting started guide" data-help="home.getting-started-hide" onClick={() => { localStorage.setItem('arco-home-guide-hidden', '1'); setGuideHidden(true); }}>HIDE</button><h2>Getting started</h2><p>Three steps to your first conversation.</p><ol>
|
|
201
225
|
<li><span>{providerReady ? '✓' : '1'}</span><a href="#connections">Connect a provider</a></li>
|
|
202
226
|
<li><span>{availableCount ? '✓' : '2'}</span><button type="button" onClick={() => setLocationOpen(true)}>Add a project folder</button></li>
|
|
203
|
-
<li><span>{
|
|
227
|
+
<li><span>{started ? '✓' : '3'}</span><button type="button" onClick={() => start({ mode: 'chat' })}>Start a conversation</button></li>
|
|
204
228
|
</ol>{availableCount === 0 && <button type="button" onClick={() => setAddOpen(true)}>Open another folder</button>}</section>}
|
|
205
229
|
|
|
206
230
|
{work.length > 0 && <section aria-labelledby="home-open" data-help="home.open-work">
|
|
@@ -221,7 +245,7 @@ export function HomeView({ onResume }: { onResume?: (config: WorkflowConfig) =>
|
|
|
221
245
|
</section>}
|
|
222
246
|
|
|
223
247
|
|
|
224
|
-
{
|
|
248
|
+
{showProjects && <section aria-labelledby="home-projects" data-help="home.projects">
|
|
225
249
|
<div className="home-project-tools"><h2 id="home-projects">Projects</h2>
|
|
226
250
|
<label data-help="home.locations">Location <select aria-label="Location" value={location} onChange={e => { setLocation(e.target.value); setBrowserRoot(e.target.value || scanFolder || ''); }}><option value="">All locations</option>{roots?.map(root => <option key={root.path} value={root.path}>{root.name}{root.exists ? '' : ' (unavailable)'}</option>)}</select></label>
|
|
227
251
|
<button type="button" className="home-primary" data-add-location onClick={() => setLocationOpen(true)}>Add project location</button>
|
|
@@ -239,12 +263,16 @@ export function HomeView({ onResume }: { onResume?: (config: WorkflowConfig) =>
|
|
|
239
263
|
{projects && !organization && <p role="alert" className="home-feedback">Pinning, renaming, archiving and relocating are unavailable because the project record file could not be read or saved. Folders are still listed; nothing was changed.</p>}
|
|
240
264
|
{projects && availableCount === 0 && projects.length > 0 && !query && <p className="home-feedback">No available folders. Reconnect a missing location or open another folder.</p>}
|
|
241
265
|
{projects && projects.length > 0 && shown.length === 0 && <p className="home-feedback">No folder matches "{query}".</p>}
|
|
266
|
+
<div ref={projectProbe} className="home-project-probe" aria-hidden="true" />
|
|
267
|
+
<div id="home-project-list" className={bound.scrolls ? 'home-bounded expanded' : 'home-bounded'}>
|
|
242
268
|
<ul className="home-project-grid">
|
|
243
|
-
{
|
|
269
|
+
{bound.shown.map(project => <ProjectCard key={`${project.id ?? ''}|${project.path}`} project={project} label={labels.get(project.path) ?? project.name}
|
|
244
270
|
locationName={(roots?.length ?? 0) > 1 ? roots?.find(root => root.path === project.rootPath)?.name : undefined}
|
|
245
271
|
work={workForProject(project, projects ?? [], work)} organization={organization} preview={project.exists}
|
|
246
272
|
onActivity={noteActivity} onResume={session => resume(project, session)} onResumeTerminal={session => resume(project, session, true)} onOpen={openItem} onStart={start} onList={body => { if (!applyList(body)) void load(); }} announce={setListStatus} />)}
|
|
247
273
|
</ul>
|
|
274
|
+
</div>
|
|
275
|
+
{bound.toggle && <button type="button" className="home-show-all" aria-expanded={projectsExpanded} aria-controls="home-project-list" onClick={() => setProjectsExpanded(open => !open)}>{projectsExpanded ? 'Show fewer' : `Show all ${filtered.length}`}</button>}
|
|
248
276
|
|
|
249
277
|
</section>}
|
|
250
278
|
</div>
|
|
@@ -102,3 +102,10 @@
|
|
|
102
102
|
.home-project-tools label{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--color-fg-muted)}.home-project-tools select{background:var(--color-bg-elevated);color:var(--color-fg);border:1px solid var(--color-border-hairline);border-radius:4px;padding:7px}.home-project-grid{margin-top:14px}.home-card-actions{justify-content:space-between}.home-card-menu{position:relative}.home-card-menu summary{cursor:pointer;list-style:none;border:1px solid var(--color-border-hairline);border-radius:4px;padding:4px 10px}.home-card-menu>div{position:absolute;right:0;top:100%;z-index:4;min-width:150px;background:var(--color-bg-panel);border:1px solid var(--color-border-hairline);padding:6px;display:flex;flex-direction:column;box-shadow:0 8px 24px #0005}.home-card-menu>div button{text-align:left!important;background:transparent!important;border:0!important}
|
|
103
103
|
@media(max-width:650px){.home-start{grid-template-columns:1fr}.home-start button.home-start-tile{min-height:76px}.home-content{padding-top:24px}}
|
|
104
104
|
.home-work-details [data-tab-status]{margin-top:4px}
|
|
105
|
+
|
|
106
|
+
/* Project cards: same two-row bound as open work. The probe has the project
|
|
107
|
+
grid's track sizing, so its column count is the row capacity. */
|
|
108
|
+
.home-project-probe{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,340px),1fr));height:0;overflow:hidden;visibility:hidden;margin:0}
|
|
109
|
+
@media(max-width:650px){.home-project-probe{grid-template-columns:1fr}}
|
|
110
|
+
.home-getting-started{position:relative}
|
|
111
|
+
.home-guide-hide{position:absolute;top:10px;right:10px;font-size:11px;letter-spacing:1px;padding:3px 8px;background:transparent;border:1px solid var(--color-border-hairline);color:var(--color-fg-muted);cursor:pointer}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Reusable operator KEEP action. The server validates the conversation and path. */
|
|
4
|
+
export function KeepButton({ cwd, workflowId, itemPath, reason = 'operator', onKept, onError, disabled = false, children = 'KEEP', help = 'storage.keep-artifact', confirmMessage, className, style }: {
|
|
5
|
+
cwd?: string; workflowId: string; itemPath: string; reason?: 'operator' | 'size-warning';
|
|
6
|
+
onKept?: () => void; onError?: (message: string) => void; disabled?: boolean; children?: React.ReactNode; help?: string; confirmMessage?: string; className?: string; style?: React.CSSProperties;
|
|
7
|
+
}) {
|
|
8
|
+
const [busy, setBusy] = useState(false);
|
|
9
|
+
const [localError, setLocalError] = useState('');
|
|
10
|
+
const report = (message: string) => { if (onError) onError(message); else setLocalError(message); };
|
|
11
|
+
async function keep() {
|
|
12
|
+
if (confirmMessage && !window.confirm(confirmMessage)) return;
|
|
13
|
+
if (!cwd) { report('The conversation is unavailable. Open it to keep this item.'); return; }
|
|
14
|
+
setBusy(true); report('');
|
|
15
|
+
try {
|
|
16
|
+
const response = await fetch('/api/storage/keep', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ path: cwd, workflowId, itemPath, reason, confirm: true }) });
|
|
17
|
+
const result = await response.json();
|
|
18
|
+
if (!response.ok) throw new Error(result.message || result.error || 'Could not keep this item.');
|
|
19
|
+
onKept?.();
|
|
20
|
+
} catch (err) { report(err instanceof Error ? err.message : 'Could not keep this item.'); } finally { setBusy(false); }
|
|
21
|
+
}
|
|
22
|
+
return <span><button type="button" className={className} style={style} data-help={help} disabled={disabled || busy} onClick={() => void keep()}>{busy ? 'KEEPING...' : children}</button>{!onError && localError && <span role="alert">{localError}</span>}</span>;
|
|
23
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { createTwoFilesPatch } from 'diff';
|
|
3
|
+
import { DialogShell } from './DialogShell';
|
|
3
4
|
import { DiffView } from './diff/DiffView';
|
|
4
5
|
import { useMdTuneupStore, type MdTuneupEditor } from '../stores/mdTuneupStore';
|
|
5
6
|
import { useAppStore } from '../stores/appStore';
|
|
@@ -116,28 +117,50 @@ export function MdTuneupDialog({ workflowId, editor, onClose }: Props) {
|
|
|
116
117
|
? `✦ TUNE UP ${entry?.baseName ?? (queue ? queue[qIndex].split('/').pop() : 'CLAUDE.md')}`
|
|
117
118
|
: '✦ TUNE UP AGENT FILES';
|
|
118
119
|
|
|
120
|
+
const actions = !inReview
|
|
121
|
+
? (cand?.loaded && cand.candidates.length === 0 ? (
|
|
122
|
+
<> <button className="display-font" onClick={dismiss} style={btnStyle('var(--color-border-hairline)', 'var(--color-fg-muted)')}>CLOSE</button>
|
|
123
|
+
</>
|
|
124
|
+
) : cand?.loaded ? (
|
|
125
|
+
<> <button className="display-font" onClick={dismiss} style={btnStyle('var(--color-border-hairline)', 'var(--color-fg-muted)')}>CANCEL</button>
|
|
126
|
+
<button
|
|
127
|
+
className="display-font"
|
|
128
|
+
onClick={startQueue}
|
|
129
|
+
disabled={Object.values(checked).every((v) => !v)}
|
|
130
|
+
style={btnStyle('var(--color-accent-primary)', 'var(--color-accent-primary)')}
|
|
131
|
+
>
|
|
132
|
+
TUNE SELECTED ({Object.values(checked).filter(Boolean).length})
|
|
133
|
+
</button>
|
|
134
|
+
</>
|
|
135
|
+
) : null)
|
|
136
|
+
: entry?.status === 'error' ? (
|
|
137
|
+
<> <button className="display-font" onClick={more ? advance : dismiss} style={btnStyle('var(--color-border-hairline)', 'var(--color-fg-muted)')}>{more ? 'SKIP → NEXT' : 'CLOSE'}</button>
|
|
138
|
+
</>
|
|
139
|
+
) : entry?.status === 'applied' ? (
|
|
140
|
+
<> {entry.undoConflictHash ? <>
|
|
141
|
+
<button className="display-font" onClick={() => clearUndoConflict(workflowId)} style={btnStyle('var(--color-border-hairline)', 'var(--color-fg-muted)')}>KEEP CURRENT</button>
|
|
142
|
+
<button className="display-font" onClick={() => undo(workflowId, true)} style={btnStyle('var(--color-warning)', 'var(--color-warning)')}>CONFIRM UNDO</button>
|
|
143
|
+
</> : entry.undoId && <button className="display-font" onClick={() => undo(workflowId)} style={btnStyle('var(--color-warning)', 'var(--color-warning)')}>UNDO</button>}
|
|
144
|
+
<button className="display-font" onClick={more ? advance : dismiss} style={btnStyle('var(--color-accent-primary)', 'var(--color-accent-primary)')}>{more ? `NEXT: ${queue[qIndex + 1].split('/').pop()} →` : 'DONE'}</button>
|
|
145
|
+
</>
|
|
146
|
+
) : entry?.status === 'undone' ? (
|
|
147
|
+
<><button className="display-font" onClick={more ? advance : dismiss} style={btnStyle('var(--color-accent-primary)', 'var(--color-accent-primary)')}>{more ? `NEXT: ${queue[qIndex + 1].split('/').pop()} →` : 'DONE'}</button></>
|
|
148
|
+
) : entry?.status === 'proposed' ? (
|
|
149
|
+
<> <button className="display-font" onClick={more ? advance : dismiss} style={btnStyle('var(--color-border-hairline)', 'var(--color-fg-muted)')}>{more ? 'REJECT → NEXT' : 'REJECT'}</button>
|
|
150
|
+
<button className="display-font" onClick={() => accept(workflowId)} style={btnStyle('var(--color-accent-primary)', 'var(--color-accent-primary)')}>ACCEPT & BACK UP</button>
|
|
151
|
+
</>
|
|
152
|
+
) : null;
|
|
153
|
+
|
|
119
154
|
return (
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
|
|
155
|
+
<DialogShell
|
|
156
|
+
title={inReview && queue.length > 1 ? `${title} - file ${qIndex + 1} of ${queue.length}` : title}
|
|
157
|
+
dataHelp="composer.tuneup"
|
|
158
|
+
onClose={dismiss}
|
|
159
|
+
closeOnBackdrop
|
|
160
|
+
width={900}
|
|
161
|
+
zIndex={1000}
|
|
162
|
+
actions={actions}
|
|
123
163
|
>
|
|
124
|
-
<div
|
|
125
|
-
data-help="composer.tuneup"
|
|
126
|
-
onClick={(e) => e.stopPropagation()}
|
|
127
|
-
style={{
|
|
128
|
-
width: 'min(900px, calc(94vw / var(--ui-scale, 1)))', maxHeight: 'calc(88vh / var(--ui-scale, 1))', background: 'var(--color-bg)', border: '1px solid var(--color-border-bright)',
|
|
129
|
-
borderRadius: '6px', padding: '18px 20px', display: 'flex', flexDirection: 'column', gap: '12px', overflow: 'hidden',
|
|
130
|
-
}}
|
|
131
|
-
>
|
|
132
|
-
<div className="display-font glow-text-bright" style={{ fontSize: '13px', letterSpacing: '2px', color: 'var(--color-accent-primary)' }}>
|
|
133
|
-
{title}
|
|
134
|
-
{inReview && queue.length > 1 && (
|
|
135
|
-
<span style={{ marginLeft: '10px', fontSize: '10px', color: 'var(--color-fg-muted)', letterSpacing: '1px' }}>
|
|
136
|
-
FILE {qIndex + 1} OF {queue.length}
|
|
137
|
-
</span>
|
|
138
|
-
)}
|
|
139
|
-
</div>
|
|
140
|
-
|
|
141
164
|
{/* ── SELECT PHASE ── */}
|
|
142
165
|
{!inReview && (
|
|
143
166
|
<>
|
|
@@ -149,11 +172,14 @@ export function MdTuneupDialog({ workflowId, editor, onClose }: Props) {
|
|
|
149
172
|
<div style={{ fontSize: '12px', color: 'var(--color-fg-muted)', lineHeight: 1.5 }}>
|
|
150
173
|
No CLAUDE.md / CLAUDE.local.md / AGENTS.md found in this project. Nothing to tune up.
|
|
151
174
|
</div>
|
|
152
|
-
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
|
153
|
-
<button className="display-font" onClick={dismiss} style={btnStyle('var(--color-border-hairline)', 'var(--color-fg-muted)')}>CLOSE</button>
|
|
154
|
-
</div>
|
|
155
175
|
</>
|
|
156
176
|
)}
|
|
177
|
+
{cand?.loaded && !!cand.skippedLinks?.length && (
|
|
178
|
+
<div style={{ fontSize: '11px', color: 'var(--color-warning)', lineHeight: 1.5 }}>
|
|
179
|
+
Skipped linked instruction files:
|
|
180
|
+
{cand.skippedLinks.map((link) => <div key={link.path}>{link.path}: {link.reason}</div>)}
|
|
181
|
+
</div>
|
|
182
|
+
)}
|
|
157
183
|
{cand?.loaded && cand.candidates.length > 0 && (
|
|
158
184
|
<>
|
|
159
185
|
<div style={{ fontSize: '12px', color: 'var(--color-fg-muted)', lineHeight: 1.4 }}>
|
|
@@ -178,22 +204,13 @@ export function MdTuneupDialog({ workflowId, editor, onClose }: Props) {
|
|
|
178
204
|
</label>
|
|
179
205
|
<button type="button" className="display-font" onClick={() => void viewFile(c.path)} style={btnStyle('var(--color-border-hairline)', 'var(--color-fg-muted)')}>{preview?.path === c.path ? 'HIDE' : 'VIEW'}</button>
|
|
180
206
|
</div>
|
|
207
|
+
{!!c.alsoReadAs?.length && <div style={{ fontSize: '11px', color: 'var(--color-fg-muted)', paddingLeft: '24px' }}>Also read as {c.alsoReadAs.join(', ')}</div>}
|
|
181
208
|
{c.hints?.map((hint) => <div key={hint} style={{ fontSize: '11px', color: 'var(--color-warning)', paddingLeft: '24px' }}>{hint}</div>)}
|
|
209
|
+
{preview?.path === c.path && !!c.alsoReadAs?.length && <div style={{ fontSize: '11px', color: 'var(--color-fg-muted)' }}>Also read as {c.alsoReadAs.join(', ')}</div>}
|
|
182
210
|
{preview?.path === c.path && <pre style={{ whiteSpace: 'pre-wrap', overflowWrap: 'anywhere', maxHeight: 'calc(24vh / var(--ui-scale, 1))', overflowY: 'auto' }}>{preview.error ?? preview.text ?? 'Loading...'}</pre>}
|
|
183
211
|
</div>
|
|
184
212
|
))}
|
|
185
213
|
</div>
|
|
186
|
-
<div style={{ display: 'flex', justifyContent: 'flex-end', gap: '8px' }}>
|
|
187
|
-
<button className="display-font" onClick={dismiss} style={btnStyle('var(--color-border-hairline)', 'var(--color-fg-muted)')}>CANCEL</button>
|
|
188
|
-
<button
|
|
189
|
-
className="display-font"
|
|
190
|
-
onClick={startQueue}
|
|
191
|
-
disabled={Object.values(checked).every((v) => !v)}
|
|
192
|
-
style={btnStyle('var(--color-accent-primary)', 'var(--color-accent-primary)')}
|
|
193
|
-
>
|
|
194
|
-
TUNE SELECTED ({Object.values(checked).filter(Boolean).length})
|
|
195
|
-
</button>
|
|
196
|
-
</div>
|
|
197
214
|
</>
|
|
198
215
|
)}
|
|
199
216
|
</>
|
|
@@ -217,9 +234,6 @@ export function MdTuneupDialog({ workflowId, editor, onClose }: Props) {
|
|
|
217
234
|
{inReview && entry?.status === 'error' && (
|
|
218
235
|
<>
|
|
219
236
|
<div style={{ fontSize: '12px', color: 'var(--color-warning)', lineHeight: 1.5, whiteSpace: 'pre-wrap' }}>{entry.error ?? 'Tune-up failed.'}</div>
|
|
220
|
-
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
|
221
|
-
<button className="display-font" onClick={more ? advance : dismiss} style={btnStyle('var(--color-border-hairline)', 'var(--color-fg-muted)')}>{more ? 'SKIP → NEXT' : 'CLOSE'}</button>
|
|
222
|
-
</div>
|
|
223
237
|
</>
|
|
224
238
|
)}
|
|
225
239
|
|
|
@@ -235,20 +249,12 @@ export function MdTuneupDialog({ workflowId, editor, onClose }: Props) {
|
|
|
235
249
|
)}
|
|
236
250
|
{entry.undoError && <div role="alert" style={{ color: 'var(--color-warning)', fontSize: '11px' }}>{entry.undoError}</div>}
|
|
237
251
|
{entry.undoConflictHash && <div role="alert" style={{ color: 'var(--color-warning)', fontSize: '11px' }}>The file changed after ACCEPT. Confirm to replace the current text with the saved original. Arco backs up the current text first and checks it again.</div>}
|
|
238
|
-
<div style={{ display: 'flex', justifyContent: 'flex-end', gap: '8px' }}>
|
|
239
|
-
{entry.undoConflictHash ? <>
|
|
240
|
-
<button className="display-font" onClick={() => clearUndoConflict(workflowId)} style={btnStyle('var(--color-border-hairline)', 'var(--color-fg-muted)')}>KEEP CURRENT</button>
|
|
241
|
-
<button className="display-font" onClick={() => undo(workflowId, true)} style={btnStyle('var(--color-warning)', 'var(--color-warning)')}>CONFIRM UNDO</button>
|
|
242
|
-
</> : entry.undoId && <button className="display-font" onClick={() => undo(workflowId)} style={btnStyle('var(--color-warning)', 'var(--color-warning)')}>UNDO</button>}
|
|
243
|
-
<button className="display-font" onClick={more ? advance : dismiss} style={btnStyle('var(--color-accent-primary)', 'var(--color-accent-primary)')}>{more ? `NEXT: ${queue[qIndex + 1].split('/').pop()} →` : 'DONE'}</button>
|
|
244
|
-
</div>
|
|
245
252
|
</>
|
|
246
253
|
)}
|
|
247
254
|
|
|
248
255
|
{inReview && entry?.status === 'undone' && <>
|
|
249
256
|
<div style={{ fontSize: '12px', color: 'var(--color-fg)' }}>Original instruction file restored.</div>
|
|
250
257
|
{entry.safetyBackupPath && <div style={{ fontSize: '11px', color: 'var(--color-fg-muted)', wordBreak: 'break-all' }}>The replaced text was backed up to <code>{entry.safetyBackupPath}</code>.</div>}
|
|
251
|
-
<div style={{ display: 'flex', justifyContent: 'flex-end' }}><button className="display-font" onClick={more ? advance : dismiss} style={btnStyle('var(--color-accent-primary)', 'var(--color-accent-primary)')}>{more ? `NEXT: ${queue[qIndex + 1].split('/').pop()} →` : 'DONE'}</button></div>
|
|
252
258
|
</>}
|
|
253
259
|
|
|
254
260
|
{inReview && entry?.status === 'proposed' && (
|
|
@@ -269,14 +275,9 @@ export function MdTuneupDialog({ workflowId, editor, onClose }: Props) {
|
|
|
269
275
|
<div style={{ flex: 1, minHeight: 0, overflow: 'auto', border: '1px solid var(--color-border-hairline)', borderRadius: '4px' }}>
|
|
270
276
|
<DiffView patch={patch} defaultViewType="split" emptyText="No changes proposed: the file is already tight." />
|
|
271
277
|
</div>
|
|
272
|
-
<div style={{ display: 'flex', justifyContent: 'flex-end', gap: '8px' }}>
|
|
273
|
-
<button className="display-font" onClick={more ? advance : dismiss} style={btnStyle('var(--color-border-hairline)', 'var(--color-fg-muted)')}>{more ? 'REJECT → NEXT' : 'REJECT'}</button>
|
|
274
|
-
<button className="display-font" onClick={() => accept(workflowId)} style={btnStyle('var(--color-accent-primary)', 'var(--color-accent-primary)')}>ACCEPT & BACK UP</button>
|
|
275
|
-
</div>
|
|
276
278
|
</>
|
|
277
279
|
)}
|
|
278
|
-
|
|
279
|
-
</div>
|
|
280
|
+
</DialogShell>
|
|
280
281
|
);
|
|
281
282
|
}
|
|
282
283
|
|
|
@@ -28,6 +28,8 @@ interface Props {
|
|
|
28
28
|
pendingMail?: number;
|
|
29
29
|
// Click on the mail mark of an idle member with waiting mail: nudge that member.
|
|
30
30
|
onNudge?: () => void;
|
|
31
|
+
// The member was nudged and has not started its turn yet.
|
|
32
|
+
nudged?: boolean;
|
|
31
33
|
// Director card only: a finished reply the operator has not looked at yet.
|
|
32
34
|
newReply?: boolean;
|
|
33
35
|
focused: boolean;
|
|
@@ -53,7 +55,7 @@ function lastAssistantText(job: JobState | undefined): string | null {
|
|
|
53
55
|
return null;
|
|
54
56
|
}
|
|
55
57
|
|
|
56
|
-
export function MemberCard({ job, displayName, status, role, pendingMail = 0, onNudge, newReply = false, focused, onClick, dragProps, dragOver }: Props) {
|
|
58
|
+
export function MemberCard({ job, displayName, status, role, pendingMail = 0, onNudge, nudged = false, newReply = false, focused, onClick, dragProps, dragOver }: Props) {
|
|
57
59
|
const wfid = job?.id ?? '';
|
|
58
60
|
const wfidShort = wfid.slice(0, 8);
|
|
59
61
|
const busy = status === 'busy';
|
|
@@ -164,6 +166,7 @@ export function MemberCard({ job, displayName, status, role, pendingMail = 0, on
|
|
|
164
166
|
const label = `${pendingMail} ${noun} waiting; delivered at this worker's next turn${idle && onNudge ? '. Click to nudge.' : ''}`;
|
|
165
167
|
const style: CSSProperties = { flexShrink: 0, color: idle ? 'var(--color-warning)' : 'var(--color-fg-muted)', border: `1px solid ${idle ? 'var(--color-warning)' : 'var(--color-border-hairline)'}`, background: 'transparent', padding: '2px 8px', fontSize: '12px', fontWeight: 600, letterSpacing: 0, whiteSpace: 'nowrap', opacity: idle ? 1 : 0.7, fontFamily: 'inherit' };
|
|
166
168
|
const text = `\u2709 ${pendingMail}`;
|
|
169
|
+
if (idle && nudged) return <span data-help="cluster.member-mail" data-mail-state="nudged" role="status" aria-label={`${displayName} was nudged and will start its turn shortly`} title="Nudged: this member should start its turn shortly and read its mail." style={{ ...style, color: 'var(--color-accent-secondary)', borderColor: 'var(--color-accent-secondary)' }}>Nudged</span>;
|
|
167
170
|
return idle && onNudge
|
|
168
171
|
? <button type="button" data-help="cluster.member-mail" data-mail-state="idle" aria-label={label} title={label} onClick={(e) => { e.stopPropagation(); onNudge(); }} style={{ ...style, cursor: 'pointer' }}>{text}</button>
|
|
169
172
|
: <span data-help="cluster.member-mail" data-mail-state={idle ? 'idle' : 'busy'} role="status" aria-live="off" aria-label={label} title={label} style={style}>{text}</span>;
|
|
@@ -179,7 +179,7 @@ export function MemberPane({
|
|
|
179
179
|
clusterContext={clusterContext}
|
|
180
180
|
/>
|
|
181
181
|
<RuntimeStateBanner job={job} onCancel={onCancel} />
|
|
182
|
-
<div data-help="composer.plan"><PlanCandidateBanner job={job} onAttachPlan={onAttachPlan} onAttachToCluster={onAttachToCluster} /></div>
|
|
182
|
+
<div data-help="composer.plan"><PlanCandidateBanner job={job} onAttachPlan={onAttachPlan} onAttachToCluster={onAttachToCluster} onSend={onSend} /></div>
|
|
183
183
|
<NorthStarBar job={job} onUpdatePrimary={onUpdatePrimary} />
|
|
184
184
|
<TerminalInput
|
|
185
185
|
job={job}
|
|
@@ -4,11 +4,12 @@ import { WORKBENCH_NOTICE_CATEGORIES } from '@arco/shared';
|
|
|
4
4
|
import type { WorkbenchNoticeCategory, WorkbenchNoticeSeverity } from '@arco/shared';
|
|
5
5
|
|
|
6
6
|
// docs/ARCHITECTURE.md - the header notice center: a bell with an unread
|
|
7
|
-
// badge that opens the durable notice history + per-category
|
|
7
|
+
// badge that opens the durable notice history + per-category show controls.
|
|
8
8
|
// Inform-only — nothing here sends a command; the only outbound action is the
|
|
9
9
|
// mute preference (`onSetMutes`, persisted server-side).
|
|
10
10
|
|
|
11
11
|
const CATEGORY_LABEL: Record<WorkbenchNoticeCategory, string> = {
|
|
12
|
+
attention: 'Failed or waiting on you',
|
|
12
13
|
'port-change': 'Port changes',
|
|
13
14
|
'computer-watch': 'Computer watches',
|
|
14
15
|
'turn-finished': 'Turn finished',
|
|
@@ -161,13 +162,13 @@ export function NotificationCenter({ onSetMutes }: { onSetMutes: (muted: Workben
|
|
|
161
162
|
|
|
162
163
|
{/* Mute toggles */}
|
|
163
164
|
<div data-help="header.notifications" style={{ padding: '8px 10px', borderTop: '1px solid var(--color-border-hairline)' }}>
|
|
164
|
-
<div className="display-font" style={{ fontSize: '9px', letterSpacing: '1.5px', color: 'var(--color-fg-muted)', marginBottom: '6px' }}>
|
|
165
|
+
<div className="display-font" style={{ fontSize: '9px', letterSpacing: '1.5px', color: 'var(--color-fg-muted)', marginBottom: '6px' }}>SHOW IN BELL</div>
|
|
165
166
|
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '2px 10px' }}>
|
|
166
167
|
{WORKBENCH_NOTICE_CATEGORIES.map((cat) => {
|
|
167
168
|
const isMuted = muted.includes(cat);
|
|
168
169
|
return (
|
|
169
170
|
<label key={cat} style={{ display: 'flex', alignItems: 'center', gap: '5px', cursor: 'pointer', color: isMuted ? 'var(--color-fg-muted)' : 'var(--color-accent-primary-dim)' }}>
|
|
170
|
-
<input type="checkbox" checked={isMuted} onChange={() => toggleMute(cat)} style={{ cursor: 'pointer' }} />
|
|
171
|
+
<input type="checkbox" checked={!isMuted} onChange={() => toggleMute(cat)} style={{ cursor: 'pointer' }} />
|
|
171
172
|
<span style={{ fontSize: '10px' }}>{CATEGORY_LABEL[cat]}</span>
|
|
172
173
|
</label>
|
|
173
174
|
);
|
|
@@ -3,8 +3,7 @@ import { ATTENTION_KINDS, isValidNtfyTopic, normalizeNtfyServer, type AttentionK
|
|
|
3
3
|
import { useNotificationChannelsStore } from '../stores/notificationChannelsStore';
|
|
4
4
|
|
|
5
5
|
// Settings > Notifications: which events raise a desktop notification (this
|
|
6
|
-
// computer) and
|
|
7
|
-
// a box is ticked.
|
|
6
|
+
// computer) and phone messages. BELL visibility is controlled in the top bar.
|
|
8
7
|
|
|
9
8
|
const LABEL: Record<AttentionKind, { name: string; hint: string }> = {
|
|
10
9
|
finished: { name: 'A turn finished', hint: 'After a turn that ran at least 15 seconds. In a cluster, only the director by default.' },
|
|
@@ -28,9 +27,15 @@ export function NotificationChannelsSettings() {
|
|
|
28
27
|
const [token, setToken] = useState('');
|
|
29
28
|
const [note, setNote] = useState('');
|
|
30
29
|
const [testing, setTesting] = useState(false);
|
|
30
|
+
const [desktopNote, setDesktopNote] = useState('');
|
|
31
31
|
const [permission, setPermission] = useState<string>(typeof Notification === 'undefined' ? 'unsupported' : Notification.permission);
|
|
32
32
|
|
|
33
33
|
useEffect(() => { void load(); }, [load]);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const update = () => setPermission(typeof Notification === 'undefined' ? 'unsupported' : Notification.permission);
|
|
36
|
+
window.addEventListener('focus', update); document.addEventListener('visibilitychange', update);
|
|
37
|
+
return () => { window.removeEventListener('focus', update); document.removeEventListener('visibilitychange', update); };
|
|
38
|
+
}, []);
|
|
34
39
|
useEffect(() => { if (view) { setServer(view.ntfy.server); setTopic(view.ntfy.topic); } }, [view?.ntfy.server, view?.ntfy.topic]);
|
|
35
40
|
|
|
36
41
|
if (!view) return <p>{error || 'Loading notification settings...'}</p>;
|
|
@@ -46,6 +51,14 @@ export function NotificationChannelsSettings() {
|
|
|
46
51
|
}
|
|
47
52
|
await save({ ...base(), desktop: { ...view.desktop, [kind]: on } });
|
|
48
53
|
};
|
|
54
|
+
const testDesktop = () => {
|
|
55
|
+
if (typeof Notification === 'undefined') { setDesktopNote('This browser does not support desktop notifications.'); return; }
|
|
56
|
+
if (Notification.permission !== 'granted') { setDesktopNote('Browser permission is needed before a desktop notification can appear.'); return; }
|
|
57
|
+
try {
|
|
58
|
+
new Notification('Arco notification test', { body: 'Desktop notifications are available.' });
|
|
59
|
+
setDesktopNote('Test sent. Normal alerts appear only when Arco is unfocused; finished turns must run at least 15 seconds.');
|
|
60
|
+
} catch { setDesktopNote('The browser could not show the test notification. Check its site and system notification settings.'); }
|
|
61
|
+
};
|
|
49
62
|
const togglePhone = (kind: AttentionKind, on: boolean) => save({ ...base(), phone: { ...view.phone, [kind]: on } });
|
|
50
63
|
|
|
51
64
|
const addressProblem = (): string => {
|
|
@@ -76,7 +89,15 @@ export function NotificationChannelsSettings() {
|
|
|
76
89
|
return (
|
|
77
90
|
<div data-help="settings.notification-channels" style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
|
|
78
91
|
<span className="display-font" style={{ fontSize: 11, letterSpacing: 2, color: 'var(--color-accent-primary-dim)' }}>NOTIFICATIONS</span>
|
|
79
|
-
<p style={{ margin: 0 }}>Choose which events notify you and where.
|
|
92
|
+
<p style={{ margin: 0 }}>Choose which events notify you and where. Desktop and phone alerts are off until you tick them. Desktop notifications appear only while Arco is not the window you are looking at; one is shown per event, and clicking it opens that tab.</p>
|
|
93
|
+
<p style={{ margin: 0 }}>Browser permission: {permission === 'default' ? 'not asked' : permission}.</p>
|
|
94
|
+
<div style={{ display: 'flex', gap: 8 }}>
|
|
95
|
+
<button type="button" className="display-font" disabled={permission === 'unsupported' || permission === 'granted' || permission === 'denied'} onClick={async () => setPermission(await Notification.requestPermission())}>REQUEST PERMISSION</button>
|
|
96
|
+
<button type="button" className="display-font" onClick={testDesktop}>TEST DESKTOP</button>
|
|
97
|
+
</div>
|
|
98
|
+
<p style={{ margin: 0 }}>Normal desktop alerts need browser permission and an unfocused Arco window. Finished turns must run at least 15 seconds.</p>
|
|
99
|
+
<div aria-live="polite">{desktopNote}</div>
|
|
100
|
+
<p style={{ margin: 0 }}>Use SHOW IN BELL in the top bar to choose which in-app notices appear.</p>
|
|
80
101
|
<table style={{ borderCollapse: 'collapse' }}>
|
|
81
102
|
<thead><tr><th style={{ textAlign: 'left', padding: '4px 10px' }}>Event</th><th style={cell}>This computer</th><th style={cell}>Phone</th></tr></thead>
|
|
82
103
|
<tbody>
|
|
@@ -90,10 +111,7 @@ export function NotificationChannelsSettings() {
|
|
|
90
111
|
</tbody>
|
|
91
112
|
</table>
|
|
92
113
|
{permission === 'unsupported' && <p style={{ margin: 0, color: 'var(--color-fg-muted)' }}>This browser does not support desktop notifications.</p>}
|
|
93
|
-
{permission === 'denied' && <p style={{ margin: 0, color: 'var(--color-warning)' }}>This browser is blocking notifications from Arco. Allow them in the browser's site settings
|
|
94
|
-
{permission === 'default' && Object.values(view.desktop).some(Boolean) && (
|
|
95
|
-
<button type="button" className="display-font" onClick={async () => setPermission(await Notification.requestPermission())}>ALLOW IN THIS BROWSER</button>
|
|
96
|
-
)}
|
|
114
|
+
{permission === 'denied' && <p style={{ margin: 0, color: 'var(--color-warning)' }}>This browser is blocking notifications from Arco. Allow them in the browser's site settings.</p>}
|
|
97
115
|
<label style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
|
|
98
116
|
In a cluster, "a turn finished" comes from
|
|
99
117
|
<select className="arco-field" aria-label="Cluster finished source" value={view.clusterFinished} onChange={(e) => void save({ ...base(), clusterFinished: e.target.value === 'all' ? 'all' : 'director' })}>
|