arco-workbench 0.2.5 → 0.2.7

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.
Files changed (33) hide show
  1. package/client/dist/assets/{PhosphorBackdrop-CLILIwOQ.js → PhosphorBackdrop-Df7xl7fv.js} +1 -1
  2. package/client/dist/assets/{ThemedBackgroundShaderImpl-B87chcb5.js → ThemedBackgroundShaderImpl-HQHu9fmC.js} +1 -1
  3. package/client/dist/assets/{XtermView-BP_j7WSN.js → XtermView-BlQ7QADf.js} +1 -1
  4. package/client/dist/assets/{galleryEditor-B90phoBI.js → galleryEditor-Db_t1HrV.js} +1 -1
  5. package/client/dist/assets/{index-BfPp1Oup.js → index-BPeBsjq5.js} +99 -99
  6. package/client/dist/index.html +1 -1
  7. package/client/src/components/UpdateAction.tsx +43 -16
  8. package/client/src/help/content/cluster.tsx +1 -1
  9. package/client/src/help/content/header.tsx +7 -3
  10. package/client/src/help/content/settings.tsx +2 -2
  11. package/client/src/help/manualSections/clusters.tsx +2 -1
  12. package/client/src/help/manualSections/maintenance.tsx +10 -7
  13. package/docs/DOCKER.md +4 -3
  14. package/docs/GLOSSARY.md +1 -1
  15. package/docs/OPERATIONS.md +32 -16
  16. package/docs/PROTOCOL_CLUSTER.md +1 -1
  17. package/docs/SETTINGS.md +8 -7
  18. package/node_modules/@arco/shared/dist/clusterCoordination.js +1 -1
  19. package/node_modules/@arco/shared/package.json +1 -1
  20. package/package.json +3 -2
  21. package/scripts/packaging/arco.mjs +17 -3
  22. package/scripts/packaging/update-process.mjs +160 -0
  23. package/scripts/packaging/update.mjs +50 -11
  24. package/server/dist/clusterDirector.js +1 -2
  25. package/server/dist/providers/claude-native/worker.js +6 -5
  26. package/server/dist/updateManager.d.ts +6 -1
  27. package/server/dist/updateManager.js +87 -20
  28. package/server/package.json +1 -1
  29. package/server/src/clusterDirector.ts +1 -2
  30. package/server/src/providers/claude-native/worker.ts +6 -5
  31. package/server/src/updateManager.ts +62 -18
  32. package/shared/dist/clusterCoordination.js +1 -1
  33. package/shared/src/clusterCoordination.ts +1 -1
@@ -9,7 +9,7 @@
9
9
  <link rel="preconnect" href="https://fonts.googleapis.com" />
10
10
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
11
11
  <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&family=Share+Tech+Mono&display=swap" rel="stylesheet" />
12
- <script type="module" crossorigin src="/assets/index-BfPp1Oup.js"></script>
12
+ <script type="module" crossorigin src="/assets/index-BPeBsjq5.js"></script>
13
13
  <link rel="stylesheet" crossorigin href="/assets/index-CVJVD2Vn.css">
14
14
  </head>
15
15
  <body>
@@ -4,18 +4,21 @@ import { confirmationSurfaceSize, WorkSurfaceControls } from './workSurface/Work
4
4
  import { useEffect, useId, useRef, useState } from 'react';
5
5
  import { useAppUpdateStore } from '../stores/appUpdateStore';
6
6
 
7
- type State = { mode: 'service' | 'foreground' | 'docker'; platform?: string; packaged?: boolean; result: { outcome: string; message?: string; attemptId?: string } | null };
7
+ type State = { mode: 'service' | 'foreground' | 'docker'; canUpdate?: boolean; platform?: string; packaged?: boolean; result: { outcome: string; message?: string; attemptId?: string } | null };
8
8
  export function UpdateAction({ latest, url, autoConfirm = false }: { latest: string | null; url: string | null; autoConfirm?: boolean }) {
9
9
  const surface = useRef<HTMLDivElement>(null);
10
10
  const [state, setState] = useState<State | null>(null);
11
+ const [lookup, setLookup] = useState<'checking' | 'failed'>('checking');
12
+ const [retry, setRetry] = useState(0);
11
13
  const [confirm, setConfirm] = useState<string | null>(null);
12
14
  const [pending, setPending] = useState(false);
13
15
  const [message, setMessage] = useState('');
14
16
  const [resultMessage, setResultMessage] = useState('');
15
- const [fallback, setFallback] = useState(false);
16
17
  const resultSurfaceId = useId();
17
18
  const ownsResult = useAppUpdateStore((s) => s.resultSurfaces[0] === resultSurfaceId);
19
+ const updating = useAppUpdateStore((s) => s.updating);
18
20
  const hasState = state !== null;
21
+ const canUpdate = state?.canUpdate ?? state?.mode === 'service';
19
22
  useEffect(() => {
20
23
  if (!hasState) return;
21
24
  // An open control owns the result instead of the global notice. Starting an
@@ -37,46 +40,69 @@ export function UpdateAction({ latest, url, autoConfirm = false }: { latest: str
37
40
  }, [pending]);
38
41
  const asked = useRef(false);
39
42
  useEffect(() => {
40
- if (autoConfirm && !asked.current && state?.mode === 'service' && latest) { asked.current = true; setConfirm(latest); }
41
- }, [autoConfirm, state, latest]);
43
+ if (autoConfirm && !asked.current && canUpdate && latest) { asked.current = true; setConfirm(latest); }
44
+ }, [autoConfirm, canUpdate, latest]);
42
45
  useEffect(() => {
43
46
  if (confirm !== null && confirm !== latest) setConfirm(null);
44
47
  }, [confirm, latest]);
45
48
  useEffect(() => {
46
49
  let live = true; let request = 0;
50
+ let controller: AbortController | undefined;
47
51
  const refresh = async () => {
52
+ if (controller) return;
48
53
  const sequence = ++request;
54
+ const current = new AbortController();
55
+ controller = current;
56
+ const timeout = setTimeout(() => current.abort(), 8000);
49
57
  try {
50
- const response = await fetch('/api/update-manager');
51
- if (!response.ok) return;
58
+ const response = await fetch('/api/update-manager', { signal: current.signal });
59
+ if (!response.ok) throw new Error('Install mode unavailable');
52
60
  const next = await response.json() as State;
53
- if (!live || sequence !== request || !['service', 'foreground', 'docker'].includes(next.mode)) return;
61
+ if (!live || sequence !== request) return;
62
+ if (!next || !['service', 'foreground', 'docker'].includes(next.mode)) throw new Error('Install mode unavailable');
54
63
  setState(next);
55
64
  if (next.result?.outcome === 'running') { setResultMessage(''); setPending(true); }
56
65
  else if (next.result?.outcome === 'updated' || next.result?.outcome === 'failed' || next.result?.outcome === 'unchanged') {
57
66
  if (startedAttempt.current === null || (startedAttempt.current && next.result.attemptId !== startedAttempt.current)) return;
58
- if (next.result.outcome === 'updated' && startedAttempt.current) void checkBuild();
67
+ if (next.result.outcome === 'updated' && startedAttempt.current) {
68
+ void checkBuild();
69
+ void useAppUpdateStore.getState().refresh().catch(() => {});
70
+ }
59
71
  startedAttempt.current = undefined;
72
+ useAppUpdateStore.getState().setUpdating(false);
60
73
  setPending(false); setMessage(''); setResultMessage(next.result.message || (next.result.outcome === 'updated' ? 'Update complete.' : next.result.outcome === 'unchanged' ? 'Already on the newest release.' : 'Update failed.'));
61
74
  } else setResultMessage('');
62
- } catch { /* reconnect retries on the next poll */ }
75
+ } catch {
76
+ if (live && sequence === request) {
77
+ if (!pending && !useAppUpdateStore.getState().updating) setState(null);
78
+ setConfirm(null); setLookup('failed');
79
+ }
80
+ } finally { clearTimeout(timeout); if (controller === current) controller = undefined; }
63
81
  };
64
82
  void refresh();
65
83
  const timer = setInterval(() => { void refresh(); }, pending ? 2000 : 30_000);
66
- return () => { live = false; clearInterval(timer); };
67
- }, [pending]);
84
+ return () => { live = false; controller?.abort(); clearInterval(timer); };
85
+ }, [pending, retry]);
68
86
  const start = async () => {
69
87
  useAppUpdateStore.getState().showResultAt(resultSurfaceId, true);
70
88
  startedAttempt.current = null;
71
- setConfirm(null); setPending(true); setFallback(false); setResultMessage(''); setMessage('Starting update. Arco will reconnect after restart.');
89
+ setConfirm(null); setPending(true); setResultMessage(''); setMessage('Starting update. Arco will reconnect after restart.');
72
90
  try {
73
91
  const response = await fetch('/api/update-manager', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ expectedLatest: latest }) });
74
92
  const result = await response.json();
75
93
  if (!response.ok) throw new Error(result.error || 'Could not start update.');
76
94
  startedAttempt.current = typeof result.attemptId === 'string' ? result.attemptId : undefined;
77
- } catch (error) { startedAttempt.current = undefined; setPending(false); setFallback(true); setMessage(error instanceof Error ? error.message : 'Could not start update.'); }
95
+ } catch (error) { startedAttempt.current = undefined; setPending(false); setMessage(error instanceof Error ? error.message : 'Could not start update.'); }
78
96
  };
79
- if (!state) return null;
97
+ if (pending || updating) return <div data-help="settings.update-action" style={{ marginTop: 8 }}>
98
+ <div role="status">{message || 'Update in progress. Arco will reconnect after restart.'}</div>
99
+ </div>;
100
+ if (!state) return <div data-help="settings.update-action" style={{ marginTop: 8 }}>
101
+ <div role="status">{lookup === 'checking' ? 'Checking how Arco is installed...' : 'Could not check how Arco is installed.'}</div>
102
+ <p>If installed with npm, finish active turns, then run <code>arco update</code> in a separate terminal on the Arco host and follow its restart instructions. For other installations, see Update instructions.</p>
103
+ <button type="button" onClick={() => { setLookup('checking'); setRetry(value => value + 1); }}>RETRY</button>{' '}
104
+ <a href="https://github.com/ghreprimand/arco/blob/main/docs/OPERATIONS.md#updating-arco" target="_blank" rel="noopener noreferrer">Update instructions</a>
105
+ </div>;
80
106
  const dockerTag = latest && /^v\d+\.\d+\.\d+$/.test(latest) ? latest : null;
81
107
  const command = state.mode === 'docker'
82
108
  ? dockerTag ? `git fetch --tags origin && git checkout --detach ${dockerTag} && docker compose up -d --build` : null
@@ -87,13 +113,14 @@ export function UpdateAction({ latest, url, autoConfirm = false }: { latest: str
87
113
  void navigator.clipboard.writeText(value).then(() => setMessage('Command copied.'), () => setMessage('Could not copy the command.'));
88
114
  };
89
115
  return <div data-help="settings.update-action" style={{ marginTop: 8 }}>
90
- {state.mode === 'service' && latest ? <button type="button" disabled={pending} onClick={() => setConfirm(latest)}>UPDATE AND RESTART</button> : <>
116
+ {canUpdate && latest && <button type="button" disabled={pending} onClick={() => setConfirm(latest)}>UPDATE AND RESTART</button>}
117
+ {!canUpdate && <>
118
+ {state.mode === 'docker' && <p>Update this deployment from its container host.</p>}
91
119
  {state.mode === 'foreground' && state.platform === 'win32' && <div>Stop Arco before updating, then run {state.packaged ? 'arco start' : 'npm start'}.</div>}
92
120
  {state.mode === 'foreground' && state.platform === 'darwin' && <div>Restart the foreground process or the configured launchd job after updating.</div>}
93
121
  {command ? <><code>{command}</code>{' '}
94
122
  <button type="button" onClick={() => copy(command)}>COPY COMMAND</button>{powershellCommand && <button type="button" onClick={() => copy(powershellCommand)}>COPY POWERSHELL COMMAND</button>}</> : <span>Check for a release to get the Docker update command.</span>}
95
123
  </>}
96
- {fallback && <div><code>{state.packaged ? 'arco update' : 'npm run arco:update'}</code>{' '}<button type="button" onClick={() => copy(state.packaged ? 'arco update' : 'npm run arco:update')}>COPY COMMAND</button></div>}
97
124
  {message && <div role="status">{message}</div>}
98
125
  {ownsResult && resultMessage && <div role="status">{resultMessage}</div>}
99
126
  {confirm !== null && confirm === latest && createPortal(<div role="dialog" aria-modal="true" aria-label="Confirm update" style={{ position: 'fixed', inset: 0, zIndex: 10000, background: 'rgba(0,0,0,.6)', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
@@ -647,7 +647,7 @@ export const clusterHelp: Record<string, HelpEntry> = {
647
647
  },
648
648
  'cluster.right-panel.role-set': {
649
649
  title: 'Set role',
650
- body: <><p>Opens the role list: DIRECTOR, BUILDER, REVIEWER, RESEARCHER, TESTER, DOCUMENTER, ADVISOR and DESIGNER, plus CLEAR and CUSTOM. The current role is highlighted. ADVISOR gives a second opinion on request, states uncertainty, changes no files, assigns no work and lands nothing. DESIGNER designs screens, states, wording and accessibility, prototypes and reviews UI; builders implement it. Both report via peer_send. When an Advisor is present, the Director consults it before a design decision or when evidence is thin; the Director keeps the decision. These hints guide the agent and do not enforce file access.</p><p>A bare filename in a cluster conversation also searches member artifacts when the project and current member have no match. The viewer names the owner, offers a choice for several matches, or names the folders searched.</p><p>The Director reads the diff and checks that project-required checks ran, without inventing a gate or permanent incident rule. Before blocking work, it states what a user would lose. A cluster may have only one director, so director choices are unavailable, with the reason shown, while another member holds that role.</p><p>Standard LM Studio, Strata and DeepSeek members receive their assigned role and shared plan. Blind members retain restricted context without the shared plan.</p></>,
650
+ body: <><p>Opens the role list: DIRECTOR, BUILDER, REVIEWER, RESEARCHER, TESTER, DOCUMENTER, ADVISOR and DESIGNER, plus CLEAR and CUSTOM. The current role is highlighted. ADVISOR gives a second opinion on request, states uncertainty, changes no files, assigns no work and lands nothing. DESIGNER designs screens, states, wording and accessibility, prototypes and reviews UI; builders implement it. Both report via peer_send. When an Advisor is present, the Director consults it before a design decision or when evidence is thin; the Director keeps the decision. These hints guide the agent and do not enforce file access.</p><p>A bare filename in a cluster conversation also searches member artifacts when the project and current member have no match. The viewer names the owner, offers a choice for several matches, or names the folders searched.</p><p>The Director reads the diff and checks that project-required checks ran, without inventing a gate or permanent incident rule. Before blocking work, it states what a user would lose.</p><p>Set how the Director should handle long checks and when to end its turn in the project instructions or give those directions in chat. A cluster may have only one director, so director choices are unavailable, with the reason shown, while another member holds that role.</p><p>Standard LM Studio, Strata and DeepSeek members receive their assigned role and shared plan. Blind members retain restricted context without the shared plan.</p></>,
651
651
  manualSection: 'cluster-roles',
652
652
  },
653
653
  'cluster.right-panel.role-preset': {
@@ -462,8 +462,7 @@ export const headerHelp: Record<string, HelpEntry> = {
462
462
  notice only hides the notice.
463
463
  </p>
464
464
  <p>
465
- Click it with an update available to open the Confirm update dialog
466
- (or the copyable command on installs that cannot update themselves).
465
+ Click it with an update available to open the update controls.
467
466
  Otherwise it opens the running and latest known version, the last
468
467
  check time, <C>CHECK NOW</C>, a release-notes link and a link to
469
468
  Settings &gt; Advanced &gt; CLI and runtime versions. While an update
@@ -471,7 +470,12 @@ export const headerHelp: Record<string, HelpEntry> = {
471
470
  appears here; select <C>UPDATE AND RESTART</C> to open confirmation.
472
471
  Packaged installs check npm. Source and Docker installs check GitHub.
473
472
  A failed check marks any previous release as stale. Use <C>CHECK NOW</C>{' '}
474
- to retry. A package download failure leaves Arco running.
473
+ to retry. If the install mode cannot be checked, use <C>RETRY</C> or
474
+ open Update instructions.
475
+ Global npm installs offer the action when launched through <C>arco start</C>
476
+ or the per-user service. A package download failure leaves Arco
477
+ running. After reconnect, check the running version here. Other
478
+ launch modes show a command to copy for the host.
475
479
  With release checks off it shows the
476
480
  running version only.
477
481
  </p>
@@ -606,7 +606,7 @@ export const settingsHelp: Record<string, HelpEntry> = {
606
606
  'settings.update-action': {
607
607
  title: 'Update Arco',
608
608
  manualSection: 'arco-updates',
609
- body: <p>In a packaged user service on Linux, macOS or Windows, or a Linux source user service, confirm UPDATE AND RESTART to install the newest release. Packaged services download the archive before stopping running turns. After restart, a page without unsaved work reloads automatically when needed; otherwise RELOAD stays available. On Windows, an update stops only the matching service command and home configuration, and refuses to proceed if the stop cannot be verified. Other run modes show a command to copy and run in a terminal.</p>,
609
+ body: <p>In a global npm install launched through arco start or the per-user service on Linux, macOS or Windows, confirm UPDATE AND RESTART to install the newest release. The updater stages and checks the package before stopping running turns. After restart, check the running version. A page without unsaved work reloads automatically when needed; otherwise RELOAD stays available. Linux source user services also offer the action. Other launch modes show a command to copy for the host. If Arco cannot check the install mode, use RETRY or open Update instructions.</p>,
610
610
  },
611
611
  'settings.update-result': {
612
612
  title: 'Update result',
@@ -616,7 +616,7 @@ export const settingsHelp: Record<string, HelpEntry> = {
616
616
  'settings.app-updates': {
617
617
  title: 'Arco releases',
618
618
  manualSection: 'arco-updates',
619
- body: <p>Shows the running version and latest release. CHECK NOW refreshes release information. Packaged installs check npm. Source and Docker installs check GitHub. A failed check identifies the source and marks any previous release as stale. Use CHECK NOW to retry. Check for new releases controls the automatic check; ARCO_UPDATE_CHECK=0 overrides it. UPDATE AND RESTART is available in packaged user services on Linux, macOS and Windows and in Linux source user services after confirmation; other run modes show a copyable command. No update runs automatically.</p>,
619
+ body: <p>Shows the running version and latest release. CHECK NOW refreshes release information. Packaged installs check npm. Source and Docker installs check GitHub. A failed check identifies the source and marks any previous release as stale. Use CHECK NOW to retry. Check for new releases controls the automatic check; ARCO_UPDATE_CHECK=0 overrides it. UPDATE AND RESTART is available after confirmation for global npm installs using arco start or the per-user service on Linux, macOS and Windows, and for Linux source user services. No update runs automatically.</p>,
620
620
  },
621
621
  'settings.app-window-browser': {
622
622
  title: 'App window browser',
@@ -1226,7 +1226,8 @@ export const clusters: Section[] = [
1226
1226
  requested review and landing review stay unchanged.
1227
1227
  </p>
1228
1228
  <p>
1229
- The Director keeps waits under 60 seconds and delegates long checks.
1229
+ The Director stays available and follows operator and project instructions
1230
+ on how to handle long checks and when to end the turn.
1230
1231
  Other members and standalone agents wait for results their reports need,
1231
1232
  in steps of at most 120 seconds, repeated as needed. Between waits,
1232
1233
  members check peer mail and act on it. They report when the result arrives.
@@ -223,6 +223,10 @@ export const maintenance: Section[] = [
223
223
  lookup fails, Arco names the source and marks any previous result as stale.
224
224
  Use CHECK NOW to retry.
225
225
  </p>
226
+ <p>
227
+ If the install mode cannot be checked, use RETRY or open Update instructions.
228
+ After reconnect, open the version box to check the running release.
229
+ </p>
226
230
  <Sub>Settings row and automatic checks</Sub>
227
231
  <p>
228
232
  Settings &gt; Advanced &gt; CLI and runtime versions includes an{' '}
@@ -243,17 +247,16 @@ export const maintenance: Section[] = [
243
247
  <Table
244
248
  headers={['Install mode', 'Update action']}
245
249
  rows={[
246
- ['Packaged user service on Linux, macOS or Windows', <><strong>UPDATE AND RESTART</strong> after confirmation</>],
250
+ ['Global npm install using arco start or the per-user service on Linux, macOS or Windows', <><strong>UPDATE AND RESTART</strong> after confirmation</>],
247
251
  ['Linux source user service', <><strong>UPDATE AND RESTART</strong> after confirmation</>],
248
- ['Other modes', 'A copyable command'],
252
+ ['Docker or other unsupported launches', 'Copy the update command and run it on the host'],
249
253
  ]}
250
254
  />
251
255
  <p>
252
- For a packaged service, the action runs the packaged{' '}
253
- <Code>arco update</Code> path. Arco downloads the exact package before stopping
254
- the service. A download failure leaves Arco running. If installation fails,
255
- Arco restores the previous package and restarts the service. If recovery fails,
256
- keep the snapshot identified in the result and follow its instructions.
256
+ For a global npm install, Arco stages and checks the exact package before
257
+ stopping. A download failure leaves Arco running. If the new release cannot
258
+ start, the updater attempts to restore the previous package and restart it.
259
+ If neither release starts, recovery needs access to the host.
257
260
  </p>
258
261
  <p>
259
262
  Do not start or restart Arco while an update runs. On Linux this cancels the
package/docs/DOCKER.md CHANGED
@@ -274,9 +274,10 @@ docker compose up -d --build
274
274
  ```
275
275
 
276
276
  Updates interrupt active turns; keep the existing volume and project mounts.
277
- Arco's own update action does not replace a container: in Docker it shows these
278
- host commands for the newest release tag (COPY COMMAND, COPY POWERSHELL
279
- COMMAND) instead, and the update script refuses to run inside the container.
277
+ The browser cannot replace the container. **COPY COMMAND** and
278
+ **COPY POWERSHELL COMMAND** give the commands for the newest release tag.
279
+ Run them on the container host. The update script refuses to run inside
280
+ the container.
280
281
 
281
282
  ### Verification smoke
282
283
 
package/docs/GLOSSARY.md CHANGED
@@ -79,7 +79,7 @@ Also: **inline artifact** - fenced `arco-artifact` blocks the primary emits duri
79
79
 
80
80
  **Designer** - A cluster role responsible for how screens look and read, including layout, states, wording and accessibility. It prototypes and reviews UI; builders implement the screens.
81
81
 
82
- **Director** - A cluster member whose role hint is `DIRECTOR` (one of the eight canonical `clusterRolePresets`; roles beginning with Director or Coordinator also count). By convention, the director owns the task graph: it creates and links tasks, assigns workers, monitors progress, and reads synthesis results. The director contract also requires staying available to the operator: hand the project's checks to the Tester (or a Builder when there is no Tester), hand CI watching to the change's author, and never sleep or poll inside a turn for more than 60 seconds. A cluster may have at most one director; create, role change, replace and preset save refuse a second. The Director reads the diff and checks that project-required checks ran, without inventing gates or permanent rules from one-off incidents. Before blocking work, the Director states what a user would lose. The role remains a system-prompt hint for day-to-day behavior, and a met sign-off closes a task when Board auto-done is on, while direct terminal status changes remain operator-only. See `docs/PROTOCOL_CLUSTER.md`.
82
+ **Director** - A cluster member whose role hint is `DIRECTOR` (one of the eight canonical `clusterRolePresets`; roles beginning with Director or Coordinator also count). By convention, the director owns the task graph: it creates and links tasks, assigns workers, monitors progress, and reads synthesis results. The Director stays available to the operator and follows operator and project instructions on waiting for long checks, handing them off, and ending the turn. A cluster may have at most one director; create, role change, replace and preset save refuse a second. The Director reads the diff and checks that project-required checks ran, without inventing gates or permanent rules from one-off incidents. Before blocking work, the Director states what a user would lose. The role remains a system-prompt hint for day-to-day behavior, and a met sign-off closes a task when Board auto-done is on, while direct terminal status changes remain operator-only. See `docs/PROTOCOL_CLUSTER.md`.
83
83
 
84
84
  **Dispatcher** - The operator-armed server-side daemon (`server/src/taskDispatcher.ts`) that deterministically assigns `ready` tasks to idle cluster members. Two modes: `cluster_dispatch_once` (one-shot sweep) and an armed daemon (persistent, toggled via `cluster_dispatch_toggle`). Eligibility: task status `ready`, no open run at the per-member cap, matching member capability. Creates a claim + run before firing the synthetic worker turn. Default OFF; persisted in cluster meta; no double-dispatch on server restart.
85
85
 
@@ -239,7 +239,10 @@ running version. When a newer release is known it turns into an accent box with
239
239
  an up arrow and the new version, stays that way after the toast is dismissed,
240
240
  opens the update dialog on click, and shows UPDATING while an update runs.
241
241
  A release found by CHECK NOW appears in the version box; select UPDATE AND
242
- RESTART to open its confirmation.
242
+ RESTART to open its confirmation. If Arco cannot determine the install mode,
243
+ select **RETRY** or open **Update instructions** for the installation in use.
244
+ The browser offers an update once it identifies a supported running
245
+ installation. Other launch modes show the existing host commands.
243
246
 
244
247
  ### Packaged install
245
248
 
@@ -257,23 +260,36 @@ arco update
257
260
  The command installs the latest stable package. It refuses linked checkouts and
258
261
  downgrades, snapshots the existing package for rollback, and stops the service
259
262
  before replacement. Stopping first is required on Windows because loaded native
260
- modules cannot be replaced safely. A packaged service can instead use
261
- **UPDATE AND RESTART** from the version box, the release toast, or Settings on
262
- Linux, macOS, and Windows. The action interrupts running turns and reports
263
- completion or rollback after reconnect.
263
+ modules cannot be replaced safely. With a global npm install, use
264
+ **UPDATE AND RESTART** from the version box, the release toast, or Settings
265
+ when Arco runs as its per-user service or through `arco start` on Linux, macOS,
266
+ or Windows. Confirmation names the release and warns that running turns stop.
267
+ The updater keeps the Arco home and address and restarts through the same
268
+ service or the npm launcher. After a foreground update, the replacement
269
+ process continues outside the original terminal. After reconnect, open the
270
+ version box to see the running release.
271
+
272
+ An older packaged service that already offers **UPDATE AND RESTART** can use
273
+ that action to install the first release with foreground updates. A foreground
274
+ process running v0.2.6 or earlier has no GUI action that can install the new
275
+ updater. Its existing maintenance path must be used once. The browser also
276
+ does not update npm exec caches, project-local packages, linked installs or
277
+ custom supervisors.
264
278
 
265
279
  Packaged installs check npm's public latest version. The release notes link
266
280
  opens the matching GitHub tag. If a check fails, the version box and Settings
267
281
  identify the source that could not be checked and mark any previous release as
268
282
  stale. Use **CHECK NOW** to retry. The updater checks npm again before
269
283
  downloading. If the latest version has changed, confirm the new version first.
270
- The updater downloads the exact package archive before it stops the service.
271
- A download failure leaves Arco running and can be retried. Installation uses the
272
- downloaded archive. npm can still fetch missing dependencies during installation.
273
-
274
- If installation fails, the updater restores the previous package and restarts
275
- the service. If recovery fails, follow the result message and keep the previous
276
- package snapshot it identifies. This snapshot covers the installed program.
284
+ The GUI updater stages the exact package and checks its native runtime before
285
+ stopping Arco. A download failure leaves Arco running and can be retried.
286
+ Installation uses the downloaded archive.
287
+
288
+ If installation fails or the replacement does not become ready on the original
289
+ address, the GUI updater attempts to restore and restart the previous package.
290
+ It waits for the managed replacement to exit before restoring files. It keeps
291
+ the snapshot if it cannot confirm the exit. If both releases fail to start,
292
+ recovery needs access to the host. The snapshot covers the program.
277
293
  Arco's saved data stays in its existing home. Source and Docker installs
278
294
  continue to follow GitHub releases.
279
295
 
@@ -434,10 +450,10 @@ npm run arco:update -- --ref v1.2.3
434
450
 
435
451
  Settings > Advanced > CLI and runtime versions and the release toast also offer
436
452
  **UPDATE AND RESTART** for a Linux source user service. Confirmation names the
437
- release, links its notes and warns that running turns stop. Other source run
438
- modes show a copyable command. The browser can only request the newest release;
439
- selecting a commit is a terminal operation. If a separate service cannot be
440
- launched, use the terminal command.
453
+ release, links its notes and warns that running turns stop. Source foreground
454
+ and custom supervised launches still need their host-side update procedure.
455
+ The browser can only request the newest release. Selecting a commit is a
456
+ terminal operation.
441
457
 
442
458
  ### Docker
443
459
 
@@ -484,7 +484,7 @@ Operator edited a member's work-size hint from the Members sub-tab. `tier` is on
484
484
 
485
485
  ### `cluster_efficiency_set` ->
486
486
 
487
- Efficiency guides coordination and testing. Balanced, the default for new clusters, asks for one lowest-level test per real fault, tests for the changed area per change, and the full check once before a release. Browser tests cover journeys that need a real screen, one per journey rather than layout, theme or size permutations. New suites, gates, test tooling and CI checks need operator approval, using the operator-question tool where available. The full check should take about ten minutes; longer runs prompt a proposal to cut work before adding tests. Flaky tests are fixed or deleted, not retried. Lean runs only changed-area tests and adds tests only for faults found; the full check runs only when requested. Thorough tests new behaviour and faults, runs neighbouring tests and the full check before handover. Every level sorts product faults from test faults and states what a user would lose before a failure blocks work; product faults and faulty tests are fixed, while cosmetic or momentary faults are noted. Project rules and plans take precedence over these instructions for testing, commits, documentation and delivery alike. Safety checks, message guards, requested review and landing review remain unchanged. Supported members receive the testing directive each turn; Antigravity CLI receives the operator-visible instructions described under Gemini members. Directors assign complete outcomes, read the accepted diff and check that project-required checks ran; they do not invent gates or make one-off incidents into permanent rules or tests without the operator. Directors classify each failed check as a product fault or a fault in a test, housekeeping rule or CI service. Product faults are fixed. Faulty tests or rules are fixed, skipped on that system with a stated reason, or deleted so checks go green and can be trusted; red checks are neither ignored nor released over. A job dropped by the CI service is rerun alone. CI stays small enough to pass in one run and contains checks whose failures tell the operator something about the product. Housekeeping findings warn instead of failing a run. Peers report what was done, what ran and what remains uncovered. Before reporting work as done, a member checks it against the project's own rules (agent instructions and contributing rules: how commits land, changelog, documentation) and, where an assignment conflicts with them, follows the project's rules and says so. A Director never assigns what the project's rules forbid; it states the delivery they require and asks the operator before any exception. The Tester runs project checks and tests peer work where a real fault is likely, modifying test files only. Long checks go to peers; Directors never run builds, tests or CI waits themselves or wait more than 60 seconds inside a turn. Nudges, mail notices and auto-pickup follow the testing directive without adding checks.
487
+ Efficiency guides coordination and testing. Balanced, the default for new clusters, asks for one lowest-level test per real fault, tests for the changed area per change, and the full check once before a release. Browser tests cover journeys that need a real screen, one per journey rather than layout, theme or size permutations. New suites, gates, test tooling and CI checks need operator approval, using the operator-question tool where available. The full check should take about ten minutes; longer runs prompt a proposal to cut work before adding tests. Flaky tests are fixed or deleted, not retried. Lean runs only changed-area tests and adds tests only for faults found; the full check runs only when requested. Thorough tests new behaviour and faults, runs neighbouring tests and the full check before handover. Every level sorts product faults from test faults and states what a user would lose before a failure blocks work; product faults and faulty tests are fixed, while cosmetic or momentary faults are noted. Project rules and plans take precedence over these instructions for testing, commits, documentation and delivery alike. Safety checks, message guards, requested review and landing review remain unchanged. Supported members receive the testing directive each turn; Antigravity CLI receives the operator-visible instructions described under Gemini members. Directors assign complete outcomes, read the accepted diff and check that project-required checks ran; they do not invent gates or make one-off incidents into permanent rules or tests without the operator. Directors classify each failed check as a product fault or a fault in a test, housekeeping rule or CI service. Product faults are fixed. Faulty tests or rules are fixed, skipped on that system with a stated reason, or deleted so checks go green and can be trusted; red checks are neither ignored nor released over. A job dropped by the CI service is rerun alone. CI stays small enough to pass in one run and contains checks whose failures tell the operator something about the product. Housekeeping findings warn instead of failing a run. Peers report what was done, what ran and what remains uncovered. Before reporting work as done, a member checks it against the project's own rules (agent instructions and contributing rules: how commits land, changelog, documentation) and, where an assignment conflicts with them, follows the project's rules and says so. A Director never assigns what the project's rules forbid; it states the delivery they require and asks the operator before any exception. The Tester runs project checks and tests peer work where a real fault is likely, modifying test files only. Directors stay responsive and follow operator and project instructions on long checks and when to end a turn. They may wait for results, hand off checks, or continue other approved work as the workflow requires. Nudges, mail notices and auto-pickup follow the testing directive without adding checks.
488
488
 
489
489
  Non-Director members and standalone agents wait inside their turns for build, test or CI results needed by their reports. Each command or polling step lasts at most 120 seconds and may be repeated as long as the job needs. Between waits they check and act on new messages, using `peer_read` in a cluster. They report after the result arrives. After a progress report or an answer while assigned work remains, non-Director members and standalone agents continue that work in the same turn; they end the turn only when it is done or with one stated blocker. If blocked or if a job clearly cannot finish within a reasonable time, they name what they await and say that a nudge is needed before ending the turn. This instruction change adds no completion wake or waiting-status display. The provider prompt supplies the wait rule once. Cluster coordination and the Director contract do not repeat it. Local-provider baselines stay role-neutral until turn preparation or handoff prewarm resolves the member role.
490
490
 
package/docs/SETTINGS.md CHANGED
@@ -142,13 +142,14 @@ The release toast provides **OPEN RELEASE**, the update action and **DISMISS**.
142
142
  Dismissal saves `updateCheckDismissed` for that version globally and survives
143
143
  reloads; a newer version can notify again. The checkbox saves `updateCheck`.
144
144
  The server first checks 30 seconds after boot, then every six hours. It never
145
- downloads or installs updates automatically. Packaged services on Linux, macOS,
146
- and Windows offer **UPDATE AND RESTART** from the version box, toast, or Settings
147
- when npm reports a newer stable version. The updater rechecks the target and
148
- downloads the exact package before stopping the service. If the download fails, Arco stays running.
149
- If installation fails, the result reports whether the old package and service
150
- were restored. Linux source user services offer the same action. Other run
151
- modes show a copyable command.
145
+ downloads or installs updates automatically. Global npm installs on Linux,
146
+ macOS and Windows offer **UPDATE AND RESTART** through `arco start` or the
147
+ per-user service when npm reports a newer stable version. The updater stages
148
+ and checks the exact package before stopping Arco. After reconnect, the
149
+ version box shows the running version. If startup fails, the package updater
150
+ attempts to restore the previous release. Linux source user services also
151
+ offer **UPDATE AND RESTART**. Other launch modes show a copyable update
152
+ command for the host.
152
153
 
153
154
  ### Project location migration
154
155
 
@@ -1,7 +1,7 @@
1
1
  // Shared deterministic coordination wording for worker prompts and operator nudges.
2
2
  import { CLUSTER_EFFICIENCY_ADDENDUM_MAX } from './protocol/clusters.js';
3
3
  export const isClusterDirector = (role) => /^\s*(?:director|coordinator)\b/i.test(role ?? '');
4
- const DIRECTOR_TURN_WAIT = 'Do not wait inside a turn for long-running checks: never sleep or poll for more than 60 seconds at a time. Start long runs in the background or hand them off, report what is running, and end the turn.';
4
+ const DIRECTOR_TURN_WAIT = 'For Directors and Coordinators: stay available to the operator. Follow operator and project instructions on long checks and when to end the turn.';
5
5
  export const AGENT_TURN_WAIT = 'For standalone agents and non-Director cluster members: when a report depends on a build, test run or CI result, wait inside the turn in steps of at most 120 seconds each, repeated as many times as the job needs. Use a foreground command within the tool timeout or check a background run between steps. Between waits, check for new messages (peer_read in a cluster) and act on them. Report when the result is in. End the turn early only when blocked or when the job clearly cannot finish within a reasonable time; then state in one line what you are waiting on and that you need a nudge. When you report progress or answer a question while assigned work is unfinished, continue that work in the same turn; end the turn only when it is done or with one stated blocker.';
6
6
  /** Blocked reasons that ask the operator (not a peer) for a decision or action.
7
7
  * Shared by the board's BLOCKED badge and the Director's open-work block so
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arco/shared",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "node-pty": "1.1.0"
5
5
  },
6
6
  "name": "arco-workbench",
7
- "version": "0.2.5",
7
+ "version": "0.2.7",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/ghreprimand/arco.git"
@@ -39,6 +39,7 @@
39
39
  "scripts/packaging/service-logs.mjs",
40
40
  "scripts/packaging/native-repair.mjs",
41
41
  "scripts/packaging/update.mjs",
42
+ "scripts/packaging/update-process.mjs",
42
43
  "scripts/packaging/storage.mjs",
43
44
  "native",
44
45
  "LICENSE"
@@ -67,7 +68,7 @@
67
68
  "word-extractor": "1.0.4",
68
69
  "ws": "8.22.0",
69
70
  "xlsx": "0.20.3",
70
- "@arco/shared": "0.2.5"
71
+ "@arco/shared": "0.2.7"
71
72
  },
72
73
  "bundleDependencies": [
73
74
  "@arco/shared",
@@ -158,13 +158,26 @@ async function main() {
158
158
  return;
159
159
  }
160
160
  if (command === 'package-update') {
161
- const [expected, resultFile, task, attemptId] = args;
161
+ const [expected, resultFile, task, attemptId, runningPid, runningVersion, port, host] = args;
162
162
  if (!/^v\d+\.\d+\.\d+$/.test(expected || '') || !resultFile || basename(resultFile) !== 'update-result.json' || resolve(resultFile) !== resultFile || !/^[a-f0-9-]{36}$/.test(attemptId || '')) throw new Error('Invalid package update request.');
163
163
  const writeResult = (result) => writeUpdateResult(resultFile, attemptId, result);
164
164
  process.env.ARCO_HOME = dirname(resultFile);
165
- await new Promise((resolve) => setTimeout(resolve, 1500));
166
165
  try {
167
- const result = await updatePackage(manifest, root, { expected });
166
+ const attempt = JSON.parse(readFileSync(resultFile, 'utf8'));
167
+ if (attempt.attemptId !== attemptId || attempt.outcome !== 'running' || attempt.target !== expected) throw new Error('The update request is no longer active.');
168
+ let result;
169
+ if (runningPid) {
170
+ if (attempt.fromVersion !== runningVersion || !port || !host) throw new Error('Invalid running installation details.');
171
+ process.env.ARCO_PORT = port;
172
+ process.env.ARCO_HOST = host;
173
+ const { updateRunningPackage } = await import('./update-process.mjs');
174
+ const checkStagedNative = (entry) => {
175
+ const probe = spawnSync(process.execPath, [entry, 'package-check-native'], { timeout: 15_000, stdio: 'ignore', windowsHide: true });
176
+ if (probe.error || probe.status !== 0) throw new Error('The installed release failed the native runtime check.');
177
+ };
178
+ result = await updateRunningPackage({ root, manifest, expected, pid: Number(runningPid), runningVersion,
179
+ managed: Boolean(task), checkNative: checkStagedNative, service: serviceAction });
180
+ } else result = await updatePackage(manifest, root, { expected });
168
181
  writeResult(result);
169
182
  } catch (error) {
170
183
  try { writeResult({ outcome: 'failed', message: error instanceof Error ? error.message : String(error) }); } catch { /* retain diagnostics if the result cannot be written */ }
@@ -177,6 +190,7 @@ async function main() {
177
190
  }
178
191
  return;
179
192
  }
193
+ if (command === 'package-check-native') { requireSupportedNode(); checkNative(); return; }
180
194
  if (command === 'update') { if (args.length) throw new Error('arco update takes no arguments.'); const result = await updatePackage(manifest, root); console.log(result.message); return; }
181
195
  throw new Error(`Unknown command: ${command}. Run arco --help.`);
182
196
  }