agent-tempo 1.2.0 → 1.3.1

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 (98) hide show
  1. package/CLAUDE.md +219 -219
  2. package/LICENSE +21 -21
  3. package/README.md +289 -289
  4. package/assets/icon-dark.svg +9 -9
  5. package/assets/icon.svg +9 -9
  6. package/assets/logo-dark.svg +11 -11
  7. package/assets/logo-light.svg +11 -11
  8. package/dashboard/README.md +91 -91
  9. package/dashboard/dist/assets/index-D6Xyje_n.js.map +1 -1
  10. package/dashboard/dist/index.html +19 -19
  11. package/dashboard/package.json +47 -47
  12. package/dist/adapters/copilot/adapter.js +12 -1
  13. package/dist/cli/global-wrapper.d.ts +19 -0
  14. package/dist/cli/global-wrapper.js +169 -0
  15. package/dist/cli/help-text.js +97 -97
  16. package/dist/cli/startup.js +11 -0
  17. package/dist/cli/upgrade-command.js +81 -81
  18. package/dist/cli.js +12 -0
  19. package/dist/daemon.js +5 -0
  20. package/dist/scripts/verify-daemon-isolation-guard.js +24 -24
  21. package/dist/server.js +4 -0
  22. package/dist/spawn.js +12 -12
  23. package/dist/tools/coat-check-evict.js +2 -2
  24. package/dist/tools/coat-check-get.js +2 -2
  25. package/dist/tools/coat-check-put.js +4 -4
  26. package/dist/tools/fetch-state.js +2 -2
  27. package/dist/tools/save-state.js +13 -13
  28. package/dist/utils/grpc-shutdown-guard.d.ts +52 -0
  29. package/dist/utils/grpc-shutdown-guard.js +88 -0
  30. package/examples/agents/tempo-composer.md +56 -56
  31. package/examples/agents/tempo-conductor.md +117 -117
  32. package/examples/agents/tempo-critic.md +73 -73
  33. package/examples/agents/tempo-improv.md +74 -74
  34. package/examples/agents/tempo-liner.md +75 -75
  35. package/examples/agents/tempo-roadie.md +61 -61
  36. package/examples/agents/tempo-soloist.md +71 -71
  37. package/examples/agents/tempo-tuner.md +94 -94
  38. package/examples/ensembles/tempo-big-band.yaml +146 -146
  39. package/examples/ensembles/tempo-dev-team.yaml +58 -58
  40. package/examples/ensembles/tempo-headless-jam.yaml +77 -77
  41. package/examples/ensembles/tempo-jam-session.yaml +41 -41
  42. package/examples/ensembles/tempo-mock-jam.yaml +79 -79
  43. package/examples/ensembles/tempo-review-squad.yaml +32 -32
  44. package/package.json +173 -173
  45. package/packaging/launchd/com.agent.tempo.plist +46 -46
  46. package/packaging/systemd/agent-tempo.service +32 -32
  47. package/packaging/windows/install-task.ps1 +71 -71
  48. package/scenarios/conductor-recruit-mock.yaml +33 -33
  49. package/scenarios/echo-roundtrip.yaml +15 -15
  50. package/scenarios/multi-player-handoff.yaml +38 -38
  51. package/scenarios/recruit-cascade.yaml +38 -38
  52. package/scenarios/two-player-conversation.yaml +33 -33
  53. package/workflow-bundle.js +1 -1
  54. package/dist/activities/claude-stop.d.ts +0 -21
  55. package/dist/activities/claude-stop.js +0 -94
  56. package/dist/channel.d.ts +0 -3
  57. package/dist/channel.js +0 -48
  58. package/dist/copilot-bridge.d.ts +0 -22
  59. package/dist/copilot-bridge.js +0 -565
  60. package/dist/scripts/258-spotcheck.js +0 -303
  61. package/dist/tools/detach.d.ts +0 -4
  62. package/dist/tools/detach.js +0 -45
  63. package/dist/tools/encore.d.ts +0 -4
  64. package/dist/tools/encore.js +0 -31
  65. package/dist/tools/pause-ensemble.d.ts +0 -4
  66. package/dist/tools/pause-ensemble.js +0 -58
  67. package/dist/tools/resume-ensemble.d.ts +0 -4
  68. package/dist/tools/resume-ensemble.js +0 -79
  69. package/dist/tools/stop.d.ts +0 -4
  70. package/dist/tools/stop.js +0 -29
  71. package/dist/tui/client.d.ts +0 -6
  72. package/dist/tui/client.js +0 -9
  73. package/dist/tui/components/ActivityLog.d.ts +0 -16
  74. package/dist/tui/components/ActivityLog.js +0 -36
  75. package/dist/tui/components/CommandOverlay.d.ts +0 -15
  76. package/dist/tui/components/CommandOverlay.js +0 -34
  77. package/dist/tui/components/ConductorChat.d.ts +0 -16
  78. package/dist/tui/components/ConductorChat.js +0 -32
  79. package/dist/tui/components/EnsembleListView.d.ts +0 -14
  80. package/dist/tui/components/EnsembleListView.js +0 -32
  81. package/dist/tui/components/EnsemblePanel.d.ts +0 -12
  82. package/dist/tui/components/EnsemblePanel.js +0 -40
  83. package/dist/tui/components/InputBar.d.ts +0 -13
  84. package/dist/tui/components/InputBar.js +0 -58
  85. package/dist/tui/components/ScheduleOverlay.d.ts +0 -13
  86. package/dist/tui/components/ScheduleOverlay.js +0 -113
  87. package/dist/tui/components/TopBar.d.ts +0 -12
  88. package/dist/tui/components/TopBar.js +0 -15
  89. package/dist/tui/core-api.d.ts +0 -26
  90. package/dist/tui/core-api.js +0 -67
  91. package/dist/tui/hooks/useEnsembleDiscovery.d.ts +0 -3
  92. package/dist/tui/hooks/useEnsembleDiscovery.js +0 -30
  93. package/dist/tui/hooks/useMaestroPoller.d.ts +0 -3
  94. package/dist/tui/hooks/useMaestroPoller.js +0 -36
  95. package/dist/tui/hooks/useSendCommand.d.ts +0 -7
  96. package/dist/tui/hooks/useSendCommand.js +0 -29
  97. package/dist/utils/bg-preflight.d.ts +0 -25
  98. package/dist/utils/bg-preflight.js +0 -154
@@ -1,21 +1,21 @@
1
- <!doctype html>
2
- <html lang="en" data-theme="dark" data-density="6" data-accent="terracotta">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <meta name="color-scheme" content="dark light" />
7
- <meta name="description" content="agent-tempo Maestro Dashboard" />
8
- <title>agent-tempo · Maestro</title>
9
- <link rel="preconnect" href="https://fonts.googleapis.com" />
10
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
11
- <link
12
- rel="stylesheet"
13
- href="https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500&display=swap"
14
- />
1
+ <!doctype html>
2
+ <html lang="en" data-theme="dark" data-density="6" data-accent="terracotta">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <meta name="color-scheme" content="dark light" />
7
+ <meta name="description" content="agent-tempo Maestro Dashboard" />
8
+ <title>agent-tempo · Maestro</title>
9
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
10
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
11
+ <link
12
+ rel="stylesheet"
13
+ href="https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500&display=swap"
14
+ />
15
15
  <script type="module" crossorigin src="/dashboard/assets/index-D6Xyje_n.js"></script>
16
16
  <link rel="stylesheet" crossorigin href="/dashboard/assets/index-CB78ToNE.css">
17
- </head>
18
- <body>
19
- <div id="root"></div>
20
- </body>
21
- </html>
17
+ </head>
18
+ <body>
19
+ <div id="root"></div>
20
+ </body>
21
+ </html>
@@ -1,47 +1,47 @@
1
- {
2
- "name": "agent-tempo-dashboard",
3
- "private": true,
4
- "version": "1.2.0",
5
- "type": "module",
6
- "description": "Web dashboard for agent-tempo. Bundled into the npm package; served by the daemon at /dashboard/*.",
7
- "scripts": {
8
- "dev": "vite",
9
- "build": "tsc -b && vite build",
10
- "build:overflow": "tsc -b && vite build --mode overflow",
11
- "preview": "vite preview",
12
- "lint": "eslint src/ tests/",
13
- "test": "vitest run",
14
- "test:watch": "vitest",
15
- "test:e2e": "playwright test",
16
- "test:e2e:install": "playwright install chromium",
17
- "test:overflow": "playwright test --config tests-overflow/playwright.config.ts"
18
- },
19
- "dependencies": {
20
- "@radix-ui/react-dialog": "~1.1.15",
21
- "@tanstack/react-query": "5.100.5",
22
- "react": "19.2.5",
23
- "react-dom": "19.2.5",
24
- "react-router-dom": "7.14.2",
25
- "zustand": "^5.0.0"
26
- },
27
- "devDependencies": {
28
- "@eslint/js": "^9.0.0",
29
- "@playwright/test": "^1.50.0",
30
- "@tailwindcss/vite": "4.2.4",
31
- "@testing-library/dom": "^10.0.0",
32
- "@testing-library/jest-dom": "^6.6.0",
33
- "@testing-library/react": "^16.1.0",
34
- "@types/node": "^22.0.0",
35
- "@types/react": "^19.2.0",
36
- "@types/react-dom": "^19.2.0",
37
- "@typescript-eslint/parser": "^8.0.0",
38
- "@vitejs/plugin-react": "^5.0.0",
39
- "eslint": "^9.0.0",
40
- "eslint-plugin-react-hooks": "^5.1.0",
41
- "jsdom": "^25.0.0",
42
- "tailwindcss": "4.2.4",
43
- "typescript": "^5.7.0",
44
- "vite": "8.0.10",
45
- "vitest": "^2.1.9"
46
- }
47
- }
1
+ {
2
+ "name": "agent-tempo-dashboard",
3
+ "private": true,
4
+ "version": "1.3.1",
5
+ "type": "module",
6
+ "description": "Web dashboard for agent-tempo. Bundled into the npm package; served by the daemon at /dashboard/*.",
7
+ "scripts": {
8
+ "dev": "vite",
9
+ "build": "tsc -b && vite build",
10
+ "build:overflow": "tsc -b && vite build --mode overflow",
11
+ "preview": "vite preview",
12
+ "lint": "eslint src/ tests/",
13
+ "test": "vitest run",
14
+ "test:watch": "vitest",
15
+ "test:e2e": "playwright test",
16
+ "test:e2e:install": "playwright install chromium",
17
+ "test:overflow": "playwright test --config tests-overflow/playwright.config.ts"
18
+ },
19
+ "dependencies": {
20
+ "@radix-ui/react-dialog": "~1.1.15",
21
+ "@tanstack/react-query": "5.100.5",
22
+ "react": "19.2.5",
23
+ "react-dom": "19.2.5",
24
+ "react-router-dom": "7.14.2",
25
+ "zustand": "^5.0.0"
26
+ },
27
+ "devDependencies": {
28
+ "@eslint/js": "^9.0.0",
29
+ "@playwright/test": "^1.50.0",
30
+ "@tailwindcss/vite": "4.2.4",
31
+ "@testing-library/dom": "^10.0.0",
32
+ "@testing-library/jest-dom": "^6.6.0",
33
+ "@testing-library/react": "^16.1.0",
34
+ "@types/node": "^22.0.0",
35
+ "@types/react": "^19.2.0",
36
+ "@types/react-dom": "^19.2.0",
37
+ "@typescript-eslint/parser": "^8.0.0",
38
+ "@vitejs/plugin-react": "^5.0.0",
39
+ "eslint": "^9.0.0",
40
+ "eslint-plugin-react-hooks": "^5.1.0",
41
+ "jsdom": "^25.0.0",
42
+ "tailwindcss": "4.2.4",
43
+ "typescript": "^5.7.0",
44
+ "vite": "8.0.10",
45
+ "vitest": "^2.1.9"
46
+ }
47
+ }
@@ -274,6 +274,7 @@ class CopilotSdkAttachment extends base_1.SdkAttachment {
274
274
  // Spawn Copilot SDK client and session
275
275
  const copilotClient = new CopilotClient({
276
276
  logLevel: 'debug',
277
+ workingDirectory: workDir,
277
278
  env: {
278
279
  ...cleanEnv(),
279
280
  ...(process.env.GITHUB_TOKEN ? { GITHUB_TOKEN: process.env.GITHUB_TOKEN } : {}),
@@ -286,7 +287,6 @@ class CopilotSdkAttachment extends base_1.SdkAttachment {
286
287
  // All tool calls are auto-approved by design — the bridge operator accepts
287
288
  // this when launching the bridge process.
288
289
  onPermissionRequest: approveAll,
289
- workingDirectory: workDir,
290
290
  mcpServers: {
291
291
  'agent-tempo': {
292
292
  command: serverCommand,
@@ -302,6 +302,17 @@ class CopilotSdkAttachment extends base_1.SdkAttachment {
302
302
  // `--append-system-prompt` argv. Behavior here is unchanged.
303
303
  content: (0, system_prompt_1.buildSdkSystemPrompt)({ ensemble: config.ensemble }),
304
304
  },
305
+ hooks: {
306
+ // Auto-allow agent-tempo MCP tools to skip the permission prompt round-trip.
307
+ // This eliminates the permission.requested → handler → approval cycle for
308
+ // every MCP tool call, reducing latency.
309
+ onPreToolUse: async (input) => {
310
+ if (input.toolName?.startsWith('mcp__agent-tempo__')) {
311
+ return { permissionDecision: 'allow' };
312
+ }
313
+ return undefined;
314
+ },
315
+ },
305
316
  excludedTools: ['write_powershell', 'read_powershell', 'list_powershell'],
306
317
  ...(model ? { model } : {}),
307
318
  };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Refresh the entrypoint pointer so the global wrapper resolves to the
3
+ * currently-running binary. Called on every successful CLI boot — cheap
4
+ * (one `writeFileSync`) and idempotent.
5
+ */
6
+ export declare function refreshEntrypoint(): void;
7
+ /**
8
+ * Ensure the wrapper scripts exist. Called once per binary version (guarded
9
+ * by the bootstrap cache). Returns `true` if a PATH hint should be shown
10
+ * to the user (i.e., the bin dir is not yet on PATH).
11
+ */
12
+ export declare function provisionWrapperScripts(): {
13
+ created: boolean;
14
+ needsPathHint: boolean;
15
+ };
16
+ /**
17
+ * Returns a one-liner PATH hint appropriate for the current platform/shell.
18
+ */
19
+ export declare function getPathHint(): string;
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.refreshEntrypoint = refreshEntrypoint;
4
+ exports.provisionWrapperScripts = provisionWrapperScripts;
5
+ exports.getPathHint = getPathHint;
6
+ /**
7
+ * Global wrapper provisioning — ensures `agent-tempo` is runnable from any
8
+ * shell without requiring `npx` or manual PATH surgery.
9
+ *
10
+ * **Strategy**: Write a thin wrapper script into `~/.agent-tempo/bin/` that
11
+ * reads an entrypoint pointer file (`.entrypoint`) to locate the real
12
+ * `dist/cli.js`. Every successful CLI boot refreshes the pointer so
13
+ * reinstalls (npm, pnpm, yarn — any package manager) auto-heal without
14
+ * user intervention.
15
+ *
16
+ * Cross-platform: emits a POSIX shell script + a `.cmd` for Windows.
17
+ *
18
+ * **Non-breaking**: If `agent-tempo` already resolves on PATH to a location
19
+ * outside `~/.agent-tempo/bin/` (e.g. npm global install), the wrapper is
20
+ * still written but the PATH hint is suppressed.
21
+ */
22
+ const fs_1 = require("fs");
23
+ const path_1 = require("path");
24
+ const os_1 = require("os");
25
+ /** Resolved CLI entrypoint — the `dist/cli.js` of the running binary. */
26
+ const THIS_CLI_JS = (0, path_1.resolve)(__dirname, '..', 'cli.js');
27
+ /**
28
+ * Wrapper bin directory. Lives inside the agent-tempo home so it follows
29
+ * the same dev-mode / home-override semantics, but we hardcode `~/.agent-tempo`
30
+ * here because the wrapper must be stable across dev/prod modes — it's a
31
+ * user-facing PATH entry that shouldn't move.
32
+ */
33
+ function getWrapperBinDir() {
34
+ return (0, path_1.join)((0, os_1.homedir)(), '.agent-tempo', 'bin');
35
+ }
36
+ const ENTRYPOINT_FILENAME = '.entrypoint';
37
+ // ─── Unix wrapper ────────────────────────────────────────────────────────
38
+ /* eslint-disable no-useless-escape */
39
+ const UNIX_WRAPPER = [
40
+ '#!/bin/sh',
41
+ '# Auto-generated by agent-tempo. Do not edit manually.',
42
+ '# This wrapper resolves the agent-tempo CLI entrypoint dynamically so',
43
+ '# reinstalls (npm/pnpm/yarn) auto-heal without re-linking.',
44
+ 'set -e',
45
+ 'SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"',
46
+ `ENTRYPOINT_FILE="\${SCRIPT_DIR}/${ENTRYPOINT_FILENAME}"`,
47
+ 'if [ ! -f "$ENTRYPOINT_FILE" ]; then',
48
+ ' echo "agent-tempo: entrypoint not configured. Run \'npx agent-tempo\' once to repair." >&2',
49
+ ' exit 1',
50
+ 'fi',
51
+ 'ENTRYPOINT="$(cat "$ENTRYPOINT_FILE")"',
52
+ 'if [ ! -f "$ENTRYPOINT" ]; then',
53
+ ' echo "agent-tempo: entrypoint stale ($ENTRYPOINT). Run \'npx agent-tempo\' once to repair." >&2',
54
+ ' exit 1',
55
+ 'fi',
56
+ 'exec node "$ENTRYPOINT" "$@"',
57
+ '',
58
+ ].join('\n');
59
+ // ─── Windows wrapper ─────────────────────────────────────────────────────
60
+ const WIN_WRAPPER = [
61
+ '@echo off',
62
+ 'rem Auto-generated by agent-tempo. Do not edit manually.',
63
+ 'setlocal enabledelayedexpansion',
64
+ 'set "SCRIPT_DIR=%~dp0"',
65
+ `set "ENTRYPOINT_FILE=%SCRIPT_DIR%${ENTRYPOINT_FILENAME}"`,
66
+ 'if not exist "%ENTRYPOINT_FILE%" (',
67
+ ' echo agent-tempo: entrypoint not configured. Run "npx agent-tempo" once to repair. >&2',
68
+ ' exit /b 1',
69
+ ')',
70
+ 'set /p ENTRYPOINT=<"%ENTRYPOINT_FILE%"',
71
+ 'if not exist "%ENTRYPOINT%" (',
72
+ ' echo agent-tempo: entrypoint stale. Run "npx agent-tempo" once to repair. >&2',
73
+ ' exit /b 1',
74
+ ')',
75
+ 'node "%ENTRYPOINT%" %*',
76
+ '',
77
+ ].join('\r\n');
78
+ // ─── Public API ──────────────────────────────────────────────────────────
79
+ /**
80
+ * Refresh the entrypoint pointer so the global wrapper resolves to the
81
+ * currently-running binary. Called on every successful CLI boot — cheap
82
+ * (one `writeFileSync`) and idempotent.
83
+ */
84
+ function refreshEntrypoint() {
85
+ try {
86
+ const binDir = getWrapperBinDir();
87
+ (0, fs_1.mkdirSync)(binDir, { recursive: true });
88
+ const pointerPath = (0, path_1.join)(binDir, ENTRYPOINT_FILENAME);
89
+ const current = safeRead(pointerPath);
90
+ // Skip write if already correct — avoids unnecessary disk churn.
91
+ if (current === THIS_CLI_JS)
92
+ return;
93
+ // Atomic write-then-rename: a torn `.entrypoint` would break the wrapper
94
+ // until the next CLI boot, so stage into a tmp file and rename into place.
95
+ // `renameSync` is atomic on POSIX and at least better-than-torn on Windows.
96
+ const tmp = pointerPath + '.tmp';
97
+ (0, fs_1.writeFileSync)(tmp, THIS_CLI_JS, 'utf8');
98
+ (0, fs_1.renameSync)(tmp, pointerPath);
99
+ }
100
+ catch {
101
+ // Best-effort — never throw from a convenience provisioning step.
102
+ }
103
+ }
104
+ /**
105
+ * Ensure the wrapper scripts exist. Called once per binary version (guarded
106
+ * by the bootstrap cache). Returns `true` if a PATH hint should be shown
107
+ * to the user (i.e., the bin dir is not yet on PATH).
108
+ */
109
+ function provisionWrapperScripts() {
110
+ try {
111
+ const binDir = getWrapperBinDir();
112
+ (0, fs_1.mkdirSync)(binDir, { recursive: true });
113
+ const unixPath = (0, path_1.join)(binDir, 'agent-tempo');
114
+ const cmdPath = (0, path_1.join)(binDir, 'agent-tempo.cmd');
115
+ let created = false;
116
+ // Write Unix wrapper if missing or outdated.
117
+ if (!(0, fs_1.existsSync)(unixPath) || safeRead(unixPath) !== UNIX_WRAPPER) {
118
+ (0, fs_1.writeFileSync)(unixPath, UNIX_WRAPPER, { mode: 0o755 });
119
+ created = true;
120
+ }
121
+ // Ensure executable even if content matches (chmod may have been lost).
122
+ try {
123
+ (0, fs_1.chmodSync)(unixPath, 0o755);
124
+ }
125
+ catch { /* Windows — no-op */ }
126
+ // Write Windows wrapper if missing or outdated.
127
+ if (!(0, fs_1.existsSync)(cmdPath) || safeRead(cmdPath) !== WIN_WRAPPER) {
128
+ (0, fs_1.writeFileSync)(cmdPath, WIN_WRAPPER);
129
+ created = true;
130
+ }
131
+ // Write the entrypoint pointer.
132
+ refreshEntrypoint();
133
+ // Determine if PATH hint is needed.
134
+ const needsPathHint = !isBinDirOnPath(binDir);
135
+ return { created, needsPathHint };
136
+ }
137
+ catch {
138
+ return { created: false, needsPathHint: false };
139
+ }
140
+ }
141
+ /**
142
+ * Returns a one-liner PATH hint appropriate for the current platform/shell.
143
+ */
144
+ function getPathHint() {
145
+ const binDir = getWrapperBinDir();
146
+ if (process.platform === 'win32') {
147
+ return `Add to PATH: setx PATH "%PATH%;${binDir}"`;
148
+ }
149
+ // Unix — suggest the export for both bash and zsh.
150
+ return `Add to PATH: export PATH="${binDir}:$PATH" (add to ~/.zshrc or ~/.bashrc)`;
151
+ }
152
+ // ─── Internals ───────────────────────────────────────────────────────────
153
+ function safeRead(filePath) {
154
+ try {
155
+ return (0, fs_1.readFileSync)(filePath, 'utf8');
156
+ }
157
+ catch {
158
+ return undefined;
159
+ }
160
+ }
161
+ function isBinDirOnPath(binDir) {
162
+ const pathEnv = process.env.PATH || process.env.Path || '';
163
+ const sep = process.platform === 'win32' ? ';' : ':';
164
+ const dirs = pathEnv.split(sep);
165
+ // Windows filesystem paths are case-insensitive; normalize before comparing
166
+ // so `C:\Users\X\...` and `c:\users\x\...` don't produce a spurious PATH hint.
167
+ const norm = (p) => process.platform === 'win32' ? (0, path_1.resolve)(p).toLowerCase() : (0, path_1.resolve)(p);
168
+ return dirs.some((d) => norm(d) === norm(binDir));
169
+ }
@@ -57,102 +57,102 @@ const types_1 = require("../types");
57
57
  // adding a new adapter automatically updates this surface.
58
58
  const AGENT_OPTIONS = types_1.AGENT_TYPES.join('|');
59
59
  function printHelp() {
60
- console.log(`
61
- ${out.bold('agent-tempo')} — Multi-session Claude Code coordination via Temporal
62
-
63
- ${out.bold('Getting started:')}
64
- ${out.cyan('agent-tempo up')} Start infrastructure, then launch the TUI with ${out.dim('agent-tempo')}
65
-
66
- ${out.bold('Usage:')}
67
- agent-tempo Launch the TUI (auto-provisions + opens home view)
68
- agent-tempo <ensemble> Launch the TUI directly into an ensemble view
69
- agent-tempo <command> [options]
70
-
71
- ${out.bold('Commands:')}
72
- ${out.cyan('up')} Start infrastructure only — Temporal, daemon, MCP registration
73
- ${out.cyan('down')} Stop infrastructure; workflows stay parked for the next ${out.dim('up')}
74
- ${out.cyan('down --destroy [-y]')} Terminate every workflow across every ensemble, then stop infrastructure
75
- ${out.cyan('server')} Start the Temporal dev server and register search attributes
76
- ${out.cyan('status')} [ensemble] Show active sessions and Temporal health
77
- ${out.cyan('ensemble')} <sub> Manage saved ensemble lineups (save/list/show)
78
- ${out.cyan('broadcast')} <message> Send a message to all active players
79
- ${out.cyan('destroy')} <ensemble> [-y] Terminate every workflow in one ensemble (typed confirmation)
80
- ${out.cyan('attachment-info')} <name> Inspect the V2 attachment phase + current holder
81
- ${out.cyan('recall')} <name> Read a player's message history (--limit/--offset/--preview/--from/--since/--include-sent/--json)
82
- ${out.cyan('hosts')} List daemons polling this Temporal namespace with advertised capabilities (--all/--json)
83
- ${out.cyan('refresh-host-profile')} Re-advertise this daemon's capability profile to the global Maestro
84
- ${out.cyan('restore')} <ensemble> Restore orphaned sessions in one ensemble on this host (--all-hosts for cluster-view listing)
85
- ${out.cyan('release')} [ensemble] Release all held players (unlock outbox, deliver messages)
86
- ${out.cyan('agent-types')} <sub> Manage player type definitions (list/show/init)
87
- ${out.cyan('daemon')} <sub> Manage the worker daemon (start/stop/status/logs)
88
- ${out.cyan('dashboard')} Open the web dashboard (--no-open / --pair / --json)
89
- ${out.cyan('upgrade')} [version] Upgrade agent-tempo to latest (or specific version)
90
- ${out.cyan('config')} Configure Temporal connection settings
91
- ${out.cyan('init')} Register MCP server globally (or --project for .mcp.json)
92
- ${out.cyan('preflight')} Run preflight checks only
93
- ${out.cyan('help')} Show this help message
94
-
95
- ${out.bold('Removed — use the TUI:')}
96
- ${out.dim('stop / restart / detach / migrate')} → ${out.dim('/destroy · /restart · /shutdown')}
97
- ${out.dim('conduct / start / recruit / disband')} → ${out.dim('launch `agent-tempo` · /recruit · /destroy')}
98
- ${out.dim('resume')} → ${out.dim('/play')}
99
- See https://github.com/vinceblank/agent-tempo/issues/285 for the full migration table.
100
-
101
- ${out.bold('Connection options (all commands):')}
102
- --temporal-address <addr> Temporal server address (default: localhost:7233)
103
- --temporal-namespace <ns> Temporal namespace (default: default)
104
- --temporal-api-key <key> Temporal API key (for Temporal Cloud)
105
- --temporal-tls-cert <path> Path to TLS client certificate
106
- --temporal-tls-key <path> Path to TLS client key
107
-
108
- ${out.bold('Other options:')}
109
- --name <name> Set session window name (up only)
110
- --agent <name> Agent type to spawn — ${AGENT_OPTIONS} (default: from config; up)
111
- --dev Use the dev profile (~/.agent-tempo-dev, port 8474, namespace agent-tempo-dev)
112
- --skip-preflight Skip preflight checks
113
- --background Run Temporal in background (server only)
114
- --project Use per-project .mcp.json instead of global (init only)
115
- --keep-mcp Don't remove MCP config (down only)
116
- --keep-daemon Don't stop the worker daemon (down only)
117
- --destroy Also terminate every workflow (down only)
118
- --kill-shared-temporal Tear down the Temporal dev server even if the other profile is active (down only, #423)
119
- -y, --yes Skip confirmation prompt (down --destroy, destroy)
120
- --lineup <name|file> Load ensemble lineup by name or file path (up)
121
- --scenario <name|path> Force every mock player in the lineup into mockMode:scripted with this scenario (dev-mode-only, up + --lineup)
122
- --no-hold Skip startup hold (requires --lineup on up)
123
- --ensemble <name> Target a specific ensemble (broadcast, destroy, restore)
124
- --all-hosts List cross-host orphans across the whole namespace (restore — read-only, #151)
125
- -d, --dir <path> Target directory (default: cwd)
126
-
127
- ${out.bold('Config command:')}
128
- ${out.dim('agent-tempo config')} Interactive connection setup
129
- ${out.dim('agent-tempo config show')} Show resolved config
130
- ${out.dim('agent-tempo config set <k> <v>')} Set a config value
131
-
132
- Settings are saved to ~/.agent-tempo/config.json.
133
- Also reads ~/.config/temporalio/temporal.yaml as a fallback.
134
-
135
- ${out.bold('Resolution order:')} CLI flag > env var > config file > temporal CLI config > default
136
-
137
- ${out.bold('First time? Run this:')}
138
- ${out.dim('cd your-project')}
139
- ${out.dim('agent-tempo up')}
140
- ${out.dim('agent-tempo')} # Launch the TUI
141
-
142
- ${out.bold('Typical workflow:')}
143
- ${out.dim('agent-tempo up')} Start infrastructure (once per host)
144
- ${out.dim('agent-tempo')} Launch the TUI
145
- ${out.dim('agent-tempo status myband')} Check who's active in an ensemble
146
-
147
- ${out.bold('Environment:')}
148
- AGENT_TEMPO_ENSEMBLE Default ensemble name (fallback: "default")
149
- TEMPORAL_ADDRESS Default Temporal address (fallback: localhost:7233)
150
- TEMPORAL_NAMESPACE Default Temporal namespace (fallback: "default")
151
- TEMPORAL_API_KEY Temporal API key
152
- TEMPORAL_TLS_CERT_PATH Path to TLS client certificate
153
- TEMPORAL_TLS_KEY_PATH Path to TLS client key
154
- AGENT_TEMPO_DEFAULT_AGENT Default agent type: claude or copilot (fallback: claude)
155
- AGENT_TEMPO_DEV_MODE Set to "1" or "true" to enable the dev profile (alternative to --dev)
156
- AGENT_TEMPO_HOME_OVERRIDE Override the home dir entirely (escape hatch for triple-isolated envs)
60
+ console.log(`
61
+ ${out.bold('agent-tempo')} — Multi-session Claude Code coordination via Temporal
62
+
63
+ ${out.bold('Getting started:')}
64
+ ${out.cyan('agent-tempo up')} Start infrastructure, then launch the TUI with ${out.dim('agent-tempo')}
65
+
66
+ ${out.bold('Usage:')}
67
+ agent-tempo Launch the TUI (auto-provisions + opens home view)
68
+ agent-tempo <ensemble> Launch the TUI directly into an ensemble view
69
+ agent-tempo <command> [options]
70
+
71
+ ${out.bold('Commands:')}
72
+ ${out.cyan('up')} Start infrastructure only — Temporal, daemon, MCP registration
73
+ ${out.cyan('down')} Stop infrastructure; workflows stay parked for the next ${out.dim('up')}
74
+ ${out.cyan('down --destroy [-y]')} Terminate every workflow across every ensemble, then stop infrastructure
75
+ ${out.cyan('server')} Start the Temporal dev server and register search attributes
76
+ ${out.cyan('status')} [ensemble] Show active sessions and Temporal health
77
+ ${out.cyan('ensemble')} <sub> Manage saved ensemble lineups (save/list/show)
78
+ ${out.cyan('broadcast')} <message> Send a message to all active players
79
+ ${out.cyan('destroy')} <ensemble> [-y] Terminate every workflow in one ensemble (typed confirmation)
80
+ ${out.cyan('attachment-info')} <name> Inspect the V2 attachment phase + current holder
81
+ ${out.cyan('recall')} <name> Read a player's message history (--limit/--offset/--preview/--from/--since/--include-sent/--json)
82
+ ${out.cyan('hosts')} List daemons polling this Temporal namespace with advertised capabilities (--all/--json)
83
+ ${out.cyan('refresh-host-profile')} Re-advertise this daemon's capability profile to the global Maestro
84
+ ${out.cyan('restore')} <ensemble> Restore orphaned sessions in one ensemble on this host (--all-hosts for cluster-view listing)
85
+ ${out.cyan('release')} [ensemble] Release all held players (unlock outbox, deliver messages)
86
+ ${out.cyan('agent-types')} <sub> Manage player type definitions (list/show/init)
87
+ ${out.cyan('daemon')} <sub> Manage the worker daemon (start/stop/status/logs)
88
+ ${out.cyan('dashboard')} Open the web dashboard (--no-open / --pair / --json)
89
+ ${out.cyan('upgrade')} [version] Upgrade agent-tempo to latest (or specific version)
90
+ ${out.cyan('config')} Configure Temporal connection settings
91
+ ${out.cyan('init')} Register MCP server globally (or --project for .mcp.json)
92
+ ${out.cyan('preflight')} Run preflight checks only
93
+ ${out.cyan('help')} Show this help message
94
+
95
+ ${out.bold('Removed — use the TUI:')}
96
+ ${out.dim('stop / restart / detach / migrate')} → ${out.dim('/destroy · /restart · /shutdown')}
97
+ ${out.dim('conduct / start / recruit / disband')} → ${out.dim('launch `agent-tempo` · /recruit · /destroy')}
98
+ ${out.dim('resume')} → ${out.dim('/play')}
99
+ See https://github.com/vinceblank/agent-tempo/issues/285 for the full migration table.
100
+
101
+ ${out.bold('Connection options (all commands):')}
102
+ --temporal-address <addr> Temporal server address (default: localhost:7233)
103
+ --temporal-namespace <ns> Temporal namespace (default: default)
104
+ --temporal-api-key <key> Temporal API key (for Temporal Cloud)
105
+ --temporal-tls-cert <path> Path to TLS client certificate
106
+ --temporal-tls-key <path> Path to TLS client key
107
+
108
+ ${out.bold('Other options:')}
109
+ --name <name> Set session window name (up only)
110
+ --agent <name> Agent type to spawn — ${AGENT_OPTIONS} (default: from config; up)
111
+ --dev Use the dev profile (~/.agent-tempo-dev, port 8474, namespace agent-tempo-dev)
112
+ --skip-preflight Skip preflight checks
113
+ --background Run Temporal in background (server only)
114
+ --project Use per-project .mcp.json instead of global (init only)
115
+ --keep-mcp Don't remove MCP config (down only)
116
+ --keep-daemon Don't stop the worker daemon (down only)
117
+ --destroy Also terminate every workflow (down only)
118
+ --kill-shared-temporal Tear down the Temporal dev server even if the other profile is active (down only, #423)
119
+ -y, --yes Skip confirmation prompt (down --destroy, destroy)
120
+ --lineup <name|file> Load ensemble lineup by name or file path (up)
121
+ --scenario <name|path> Force every mock player in the lineup into mockMode:scripted with this scenario (dev-mode-only, up + --lineup)
122
+ --no-hold Skip startup hold (requires --lineup on up)
123
+ --ensemble <name> Target a specific ensemble (broadcast, destroy, restore)
124
+ --all-hosts List cross-host orphans across the whole namespace (restore — read-only, #151)
125
+ -d, --dir <path> Target directory (default: cwd)
126
+
127
+ ${out.bold('Config command:')}
128
+ ${out.dim('agent-tempo config')} Interactive connection setup
129
+ ${out.dim('agent-tempo config show')} Show resolved config
130
+ ${out.dim('agent-tempo config set <k> <v>')} Set a config value
131
+
132
+ Settings are saved to ~/.agent-tempo/config.json.
133
+ Also reads ~/.config/temporalio/temporal.yaml as a fallback.
134
+
135
+ ${out.bold('Resolution order:')} CLI flag > env var > config file > temporal CLI config > default
136
+
137
+ ${out.bold('First time? Run this:')}
138
+ ${out.dim('cd your-project')}
139
+ ${out.dim('agent-tempo up')}
140
+ ${out.dim('agent-tempo')} # Launch the TUI
141
+
142
+ ${out.bold('Typical workflow:')}
143
+ ${out.dim('agent-tempo up')} Start infrastructure (once per host)
144
+ ${out.dim('agent-tempo')} Launch the TUI
145
+ ${out.dim('agent-tempo status myband')} Check who's active in an ensemble
146
+
147
+ ${out.bold('Environment:')}
148
+ AGENT_TEMPO_ENSEMBLE Default ensemble name (fallback: "default")
149
+ TEMPORAL_ADDRESS Default Temporal address (fallback: localhost:7233)
150
+ TEMPORAL_NAMESPACE Default Temporal namespace (fallback: "default")
151
+ TEMPORAL_API_KEY Temporal API key
152
+ TEMPORAL_TLS_CERT_PATH Path to TLS client certificate
153
+ TEMPORAL_TLS_KEY_PATH Path to TLS client key
154
+ AGENT_TEMPO_DEFAULT_AGENT Default agent type: claude or copilot (fallback: claude)
155
+ AGENT_TEMPO_DEV_MODE Set to "1" or "true" to enable the dev profile (alternative to --dev)
156
+ AGENT_TEMPO_HOME_OVERRIDE Override the home dir entirely (escape hatch for triple-isolated envs)
157
157
  `);
158
158
  }
@@ -134,6 +134,7 @@ const TTL_60S = 60 * 1000;
134
134
  // (#605 consolidated the two duplicated literals).
135
135
  // ─────────────────────────────────────────────────────────────────────────
136
136
  const sa_preflight_1 = require("./sa-preflight");
137
+ const global_wrapper_1 = require("./global-wrapper");
137
138
  // ─────────────────────────────────────────────────────────────────────────
138
139
  // Semver-aware outdated-version badge rendering (#289 pin item 4)
139
140
  // ─────────────────────────────────────────────────────────────────────────
@@ -624,6 +625,16 @@ async function bootstrap(args) {
624
625
  // Steps 1–5: fail-fast on step 1 so we don't try to register MCP on an
625
626
  // incompatible Node. Each step mutates the cache in-place.
626
627
  const preflight = await stepPreflight(cache, now);
628
+ // Provision the global wrapper scripts (`~/.agent-tempo/bin/agent-tempo`)
629
+ // so the command is accessible without `npx`. Runs once per binary version
630
+ // (guarded by cache wipe on version change). Best-effort, non-blocking.
631
+ if (preflight.status !== 'failed') {
632
+ const { needsPathHint } = (0, global_wrapper_1.provisionWrapperScripts)();
633
+ if (needsPathHint) {
634
+ // Emit a one-time hint to stderr (won't pollute --json output).
635
+ process.stderr.write(`\n hint: ${(0, global_wrapper_1.getPathHint)()}\n\n`);
636
+ }
637
+ }
627
638
  // Steps 2 + 3 are independent (MCP config is local fs/shell; Temporal
628
639
  // reachability is network), so run them in parallel — up to ~300ms
629
640
  // cold-path savings when the claude-mcp-list shell-out is slow.