agent-tempo 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +253 -219
- package/LICENSE +21 -21
- package/README.md +293 -289
- package/assets/icon-dark.svg +9 -9
- package/assets/icon.svg +9 -9
- package/assets/logo-dark.svg +11 -11
- package/assets/logo-light.svg +11 -11
- package/dashboard/README.md +91 -91
- package/dashboard/dist/assets/{index-D6Xyje_n.js → index-jmYe6rmS.js} +2 -2
- package/dashboard/dist/assets/index-jmYe6rmS.js.map +1 -0
- package/dashboard/dist/index.html +20 -20
- package/dashboard/package.json +47 -47
- package/dist/activities/outbox.d.ts +30 -1
- package/dist/activities/outbox.js +96 -3
- package/dist/adapters/base.js +5 -0
- package/dist/adapters/copilot/adapter.js +12 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/adapters/index.js +7 -0
- package/dist/adapters/pi/adapter.d.ts +2 -0
- package/dist/adapters/pi/adapter.js +43 -0
- package/dist/adapters/pi/index.d.ts +16 -0
- package/dist/adapters/pi/index.js +10 -0
- package/dist/cli/global-wrapper.d.ts +19 -0
- package/dist/cli/global-wrapper.js +169 -0
- package/dist/cli/help-text.js +97 -97
- package/dist/cli/startup.js +11 -0
- package/dist/cli/upgrade-command.js +81 -81
- package/dist/cli.js +12 -0
- package/dist/client/core.js +9 -2
- package/dist/client/interface.d.ts +6 -0
- package/dist/config.d.ts +79 -0
- package/dist/config.js +74 -0
- package/dist/daemon.js +37 -1
- package/dist/http/aggregate.d.ts +22 -1
- package/dist/http/aggregate.js +41 -0
- package/dist/http/auth.d.ts +94 -8
- package/dist/http/auth.js +93 -9
- package/dist/http/body.d.ts +4 -1
- package/dist/http/body.js +6 -3
- package/dist/http/event-bus.js +1 -0
- package/dist/http/event-types.d.ts +34 -2
- package/dist/http/event-types.js +1 -0
- package/dist/http/gate-audit.d.ts +12 -0
- package/dist/http/gate-audit.js +95 -0
- package/dist/http/gate-registry.d.ts +167 -0
- package/dist/http/gate-registry.js +163 -0
- package/dist/http/gate-routes.d.ts +48 -0
- package/dist/http/gate-routes.js +102 -0
- package/dist/http/ingest-registry.d.ts +30 -0
- package/dist/http/ingest-registry.js +108 -0
- package/dist/http/inner-loop-routes.d.ts +66 -0
- package/dist/http/inner-loop-routes.js +182 -0
- package/dist/http/inner-loop.d.ts +92 -0
- package/dist/http/inner-loop.js +155 -0
- package/dist/http/server.d.ts +38 -3
- package/dist/http/server.js +211 -6
- package/dist/http/snapshot.d.ts +6 -0
- package/dist/http/snapshot.js +6 -0
- package/dist/pi/cue-pump.d.ts +61 -0
- package/dist/pi/cue-pump.js +95 -0
- package/dist/pi/extension.d.ts +45 -0
- package/dist/pi/extension.js +407 -0
- package/dist/pi/gate-client.d.ts +54 -0
- package/dist/pi/gate-client.js +136 -0
- package/dist/pi/headless.d.ts +85 -0
- package/dist/pi/headless.js +224 -0
- package/dist/pi/index.d.ts +28 -0
- package/dist/pi/index.js +43 -0
- package/dist/pi/inner-loop-client.d.ts +67 -0
- package/dist/pi/inner-loop-client.js +164 -0
- package/dist/pi/inner-loop-publisher.d.ts +187 -0
- package/dist/pi/inner-loop-publisher.js +236 -0
- package/dist/pi/lazy-proxy.d.ts +37 -0
- package/dist/pi/lazy-proxy.js +55 -0
- package/dist/pi/mission-control/actions.d.ts +48 -0
- package/dist/pi/mission-control/actions.js +98 -0
- package/dist/pi/mission-control/board.d.ts +53 -0
- package/dist/pi/mission-control/board.js +104 -0
- package/dist/pi/mission-control/extension.d.ts +44 -0
- package/dist/pi/mission-control/extension.js +251 -0
- package/dist/pi/mission-control/index.d.ts +15 -0
- package/dist/pi/mission-control/index.js +32 -0
- package/dist/pi/mission-control/inner-tail.d.ts +48 -0
- package/dist/pi/mission-control/inner-tail.js +76 -0
- package/dist/pi/mission-control/pi-ui.d.ts +43 -0
- package/dist/pi/mission-control/pi-ui.js +10 -0
- package/dist/pi/mission-control/render.d.ts +6 -0
- package/dist/pi/mission-control/render.js +95 -0
- package/dist/pi/phase-driver.d.ts +74 -0
- package/dist/pi/phase-driver.js +122 -0
- package/dist/pi/pi-types.d.ts +208 -0
- package/dist/pi/pi-types.js +21 -0
- package/dist/pi/probe.d.ts +80 -0
- package/dist/pi/probe.js +154 -0
- package/dist/pi/render-tools.d.ts +17 -0
- package/dist/pi/render-tools.js +51 -0
- package/dist/pi/reset-pump.d.ts +47 -0
- package/dist/pi/reset-pump.js +85 -0
- package/dist/pi/tool-capability.d.ts +60 -0
- package/dist/pi/tool-capability.js +156 -0
- package/dist/pi/workflow-client.d.ts +158 -0
- package/dist/pi/workflow-client.js +289 -0
- package/dist/pi/zod-to-typebox.d.ts +74 -0
- package/dist/pi/zod-to-typebox.js +191 -0
- package/dist/scripts/verify-daemon-isolation-guard.js +24 -24
- package/dist/server-tools.d.ts +2 -0
- package/dist/server-tools.js +50 -46
- package/dist/server.js +4 -0
- package/dist/spawn.d.ts +55 -0
- package/dist/spawn.js +84 -12
- package/dist/tools/agent-types.d.ts +2 -2
- package/dist/tools/agent-types.js +22 -17
- package/dist/tools/attachment-info.d.ts +2 -2
- package/dist/tools/attachment-info.js +38 -33
- package/dist/tools/broadcast.d.ts +2 -2
- package/dist/tools/broadcast.js +69 -64
- package/dist/tools/cancel-stage.d.ts +2 -2
- package/dist/tools/cancel-stage.js +20 -15
- package/dist/tools/clear-state.d.ts +2 -2
- package/dist/tools/clear-state.js +25 -20
- package/dist/tools/coat-check-evict.d.ts +2 -2
- package/dist/tools/coat-check-evict.js +30 -25
- package/dist/tools/coat-check-get.d.ts +2 -2
- package/dist/tools/coat-check-get.js +39 -34
- package/dist/tools/coat-check-list.d.ts +2 -2
- package/dist/tools/coat-check-list.js +48 -43
- package/dist/tools/coat-check-put.d.ts +2 -2
- package/dist/tools/coat-check-put.js +41 -36
- package/dist/tools/cue.d.ts +2 -2
- package/dist/tools/cue.js +57 -52
- package/dist/tools/descriptor.d.ts +72 -0
- package/dist/tools/descriptor.js +39 -0
- package/dist/tools/destroy.d.ts +2 -2
- package/dist/tools/destroy.js +153 -148
- package/dist/tools/ensemble.d.ts +2 -2
- package/dist/tools/ensemble.js +71 -66
- package/dist/tools/evaluate-gate.d.ts +2 -2
- package/dist/tools/evaluate-gate.js +33 -27
- package/dist/tools/fetch-state.d.ts +2 -2
- package/dist/tools/fetch-state.js +43 -38
- package/dist/tools/gates.d.ts +2 -2
- package/dist/tools/gates.js +39 -34
- package/dist/tools/hosts.d.ts +2 -2
- package/dist/tools/hosts.js +25 -20
- package/dist/tools/listen.d.ts +2 -2
- package/dist/tools/listen.js +23 -18
- package/dist/tools/load-lineup.d.ts +2 -2
- package/dist/tools/load-lineup.js +324 -319
- package/dist/tools/migrate.d.ts +2 -2
- package/dist/tools/migrate.js +45 -40
- package/dist/tools/pause.d.ts +2 -2
- package/dist/tools/pause.js +34 -29
- package/dist/tools/play.d.ts +2 -2
- package/dist/tools/play.js +53 -48
- package/dist/tools/quality-gate.d.ts +2 -2
- package/dist/tools/quality-gate.js +26 -21
- package/dist/tools/recall.d.ts +2 -2
- package/dist/tools/recall.js +32 -27
- package/dist/tools/recruit.d.ts +2 -2
- package/dist/tools/recruit.js +325 -256
- package/dist/tools/release.d.ts +2 -2
- package/dist/tools/release.js +85 -80
- package/dist/tools/report.d.ts +2 -2
- package/dist/tools/report.js +28 -23
- package/dist/tools/reset.d.ts +3 -0
- package/dist/tools/reset.js +51 -0
- package/dist/tools/restart.d.ts +2 -2
- package/dist/tools/restart.js +51 -46
- package/dist/tools/restore.d.ts +2 -2
- package/dist/tools/restore.js +76 -71
- package/dist/tools/save-lineup.d.ts +2 -2
- package/dist/tools/save-lineup.js +32 -27
- package/dist/tools/save-state.d.ts +2 -2
- package/dist/tools/save-state.js +43 -38
- package/dist/tools/schedule.d.ts +2 -2
- package/dist/tools/schedule.js +133 -128
- package/dist/tools/schedules.d.ts +2 -2
- package/dist/tools/schedules.js +41 -36
- package/dist/tools/set-ensemble-description.d.ts +2 -2
- package/dist/tools/set-ensemble-description.js +26 -21
- package/dist/tools/set-name.d.ts +2 -2
- package/dist/tools/set-name.js +38 -33
- package/dist/tools/set-part.d.ts +2 -2
- package/dist/tools/set-part.js +20 -15
- package/dist/tools/shutdown.d.ts +2 -2
- package/dist/tools/shutdown.js +39 -34
- package/dist/tools/stage.d.ts +2 -2
- package/dist/tools/stage.js +28 -23
- package/dist/tools/stages.d.ts +2 -2
- package/dist/tools/stages.js +36 -31
- package/dist/tools/unschedule.d.ts +2 -2
- package/dist/tools/unschedule.js +30 -25
- package/dist/tools/who-am-i.d.ts +2 -2
- package/dist/tools/who-am-i.js +36 -31
- package/dist/tools/worktree.d.ts +2 -2
- package/dist/tools/worktree.js +134 -129
- package/dist/tui/index.js +6 -6
- package/dist/types.d.ts +47 -2
- package/dist/types.js +1 -1
- package/dist/utils/default-part.js +1 -0
- package/dist/utils/grpc-shutdown-guard.d.ts +52 -0
- package/dist/utils/grpc-shutdown-guard.js +88 -0
- package/dist/utils/sdk-probe.d.ts +23 -0
- package/dist/utils/sdk-probe.js +46 -7
- package/dist/worker.d.ts +3 -1
- package/dist/worker.js +6 -2
- package/dist/workflows/session.js +70 -2
- package/dist/workflows/signals.d.ts +32 -2
- package/dist/workflows/signals.js +25 -2
- package/examples/agents/tempo-composer.md +56 -56
- package/examples/agents/tempo-conductor.md +117 -117
- package/examples/agents/tempo-critic.md +73 -73
- package/examples/agents/tempo-improv.md +74 -74
- package/examples/agents/tempo-liner.md +75 -75
- package/examples/agents/tempo-roadie.md +61 -61
- package/examples/agents/tempo-soloist.md +71 -71
- package/examples/agents/tempo-tuner.md +94 -94
- package/examples/ensembles/tempo-big-band.yaml +146 -146
- package/examples/ensembles/tempo-dev-team.yaml +58 -58
- package/examples/ensembles/tempo-headless-jam.yaml +77 -77
- package/examples/ensembles/tempo-jam-session.yaml +41 -41
- package/examples/ensembles/tempo-mock-jam.yaml +79 -79
- package/examples/ensembles/tempo-review-squad.yaml +32 -32
- package/package.json +176 -173
- package/packaging/launchd/com.agent.tempo.plist +46 -46
- package/packaging/systemd/agent-tempo.service +32 -32
- package/packaging/windows/install-task.ps1 +71 -71
- package/scenarios/conductor-recruit-mock.yaml +33 -33
- package/scenarios/echo-roundtrip.yaml +15 -15
- package/scenarios/multi-player-handoff.yaml +38 -38
- package/scenarios/recruit-cascade.yaml +38 -38
- package/scenarios/two-player-conversation.yaml +33 -33
- package/workflow-bundle.js +97 -6
- package/dashboard/dist/assets/index-D6Xyje_n.js.map +0 -1
- package/dist/activities/claude-stop.d.ts +0 -21
- package/dist/activities/claude-stop.js +0 -94
- package/dist/channel.d.ts +0 -3
- package/dist/channel.js +0 -48
- package/dist/copilot-bridge.d.ts +0 -22
- package/dist/copilot-bridge.js +0 -565
- package/dist/scripts/258-spotcheck.js +0 -303
- package/dist/tools/detach.d.ts +0 -4
- package/dist/tools/detach.js +0 -45
- package/dist/tools/encore.d.ts +0 -4
- package/dist/tools/encore.js +0 -31
- package/dist/tools/helpers.d.ts +0 -21
- package/dist/tools/helpers.js +0 -25
- package/dist/tools/pause-ensemble.d.ts +0 -4
- package/dist/tools/pause-ensemble.js +0 -58
- package/dist/tools/resume-ensemble.d.ts +0 -4
- package/dist/tools/resume-ensemble.js +0 -79
- package/dist/tools/stop.d.ts +0 -4
- package/dist/tools/stop.js +0 -29
- package/dist/tui/client.d.ts +0 -6
- package/dist/tui/client.js +0 -9
- package/dist/tui/components/ActivityLog.d.ts +0 -16
- package/dist/tui/components/ActivityLog.js +0 -36
- package/dist/tui/components/CommandOverlay.d.ts +0 -15
- package/dist/tui/components/CommandOverlay.js +0 -34
- package/dist/tui/components/ConductorChat.d.ts +0 -16
- package/dist/tui/components/ConductorChat.js +0 -32
- package/dist/tui/components/EnsembleListView.d.ts +0 -14
- package/dist/tui/components/EnsembleListView.js +0 -32
- package/dist/tui/components/EnsemblePanel.d.ts +0 -12
- package/dist/tui/components/EnsemblePanel.js +0 -40
- package/dist/tui/components/InputBar.d.ts +0 -13
- package/dist/tui/components/InputBar.js +0 -58
- package/dist/tui/components/ScheduleOverlay.d.ts +0 -13
- package/dist/tui/components/ScheduleOverlay.js +0 -113
- package/dist/tui/components/TopBar.d.ts +0 -12
- package/dist/tui/components/TopBar.js +0 -15
- package/dist/tui/core-api.d.ts +0 -26
- package/dist/tui/core-api.js +0 -67
- package/dist/tui/hooks/useEnsembleDiscovery.d.ts +0 -3
- package/dist/tui/hooks/useEnsembleDiscovery.js +0 -30
- package/dist/tui/hooks/useMaestroPoller.d.ts +0 -3
- package/dist/tui/hooks/useMaestroPoller.js +0 -36
- package/dist/tui/hooks/useSendCommand.d.ts +0 -7
- package/dist/tui/hooks/useSendCommand.js +0 -29
- package/dist/utils/bg-preflight.d.ts +0 -25
- package/dist/utils/bg-preflight.js +0 -154
package/dist/tools/migrate.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
1
|
import { Client, WorkflowHandle } from '@temporalio/client';
|
|
3
2
|
import { Config } from '../config';
|
|
4
|
-
|
|
3
|
+
import { type TempoToolDescriptor } from './descriptor';
|
|
4
|
+
export declare function buildMigrateTool(client: Client, config: Config, getPlayerId: () => string, handle: WorkflowHandle): TempoToolDescriptor;
|
package/dist/tools/migrate.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.buildMigrateTool = buildMigrateTool;
|
|
4
4
|
/**
|
|
5
5
|
* `migrate` — sugar for `restart --host=<h>` per design §9.6.
|
|
6
6
|
*
|
|
@@ -16,45 +16,50 @@ exports.registerMigrateTool = registerMigrateTool;
|
|
|
16
16
|
*/
|
|
17
17
|
const zod_1 = require("zod");
|
|
18
18
|
const signals_1 = require("../workflows/signals");
|
|
19
|
-
const
|
|
19
|
+
const descriptor_1 = require("./descriptor");
|
|
20
20
|
const restart_1 = require("./restart");
|
|
21
21
|
const validation_1 = require("../utils/validation");
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
22
|
+
function buildMigrateTool(client, config, getPlayerId, handle) {
|
|
23
|
+
return {
|
|
24
|
+
name: 'migrate',
|
|
25
|
+
description: 'Migrate a session to a different host — sugar for `restart` with a required `host`. Reaps the current attachment, claims fresh on the target host, spawns a new adapter. Cross-host routing (per-host task queues) is honored automatically. When `force=true` AND the target is currently on a different host, `confirmStealFromHost` must match that hostname (design §16.5).',
|
|
26
|
+
params: {
|
|
27
|
+
playerId: zod_1.z.string().max(validation_1.PLAYER_NAME_MAX).describe('The player name to migrate'),
|
|
28
|
+
host: zod_1.z.string().min(1).describe('Target hostname — required'),
|
|
29
|
+
fresh: zod_1.z.boolean().optional().describe('Skip context replay (default false)'),
|
|
30
|
+
force: zod_1.z.boolean().optional().describe('Steal a live attachment via forceDetach (default false)'),
|
|
31
|
+
contextMessages: zod_1.z.number().min(0).max(validation_1.RESTART_CONTEXT_MESSAGES_MAX).optional().describe('Number of recent messages to include in context (default 10)'),
|
|
32
|
+
confirmStealFromHost: zod_1.z.string().optional().describe('Required when `force=true` and the target\'s current attachment is on a different host (design §16.5 Option B).'),
|
|
33
|
+
},
|
|
34
|
+
handler: async (args) => {
|
|
35
|
+
const input = args;
|
|
36
|
+
const nameError = (0, validation_1.validatePlayerName)(input.playerId);
|
|
37
|
+
if (nameError)
|
|
38
|
+
return (0, descriptor_1.fail)(nameError);
|
|
39
|
+
if (!input.host || !input.host.trim()) {
|
|
40
|
+
return (0, descriptor_1.fail)('`host` is required for migrate. Use `restart` (without host) to restart on the session\'s current host.');
|
|
41
|
+
}
|
|
42
|
+
// Shared cross-host guard with `restart` — same rules, same copy-paste
|
|
43
|
+
// error messages (§16.5).
|
|
44
|
+
const guardError = await (0, restart_1.enforceYesStealGuard)(client, config.ensemble, input.playerId, input);
|
|
45
|
+
if (guardError)
|
|
46
|
+
return (0, descriptor_1.fail)(guardError);
|
|
47
|
+
try {
|
|
48
|
+
const entry = {
|
|
49
|
+
type: 'restart',
|
|
50
|
+
targetPlayerId: input.playerId,
|
|
51
|
+
invokerPlayerId: getPlayerId(),
|
|
52
|
+
host: input.host,
|
|
53
|
+
...(input.fresh !== undefined ? { fresh: input.fresh } : {}),
|
|
54
|
+
...(input.force !== undefined ? { force: input.force } : {}),
|
|
55
|
+
...(input.contextMessages !== undefined ? { contextMessages: input.contextMessages } : {}),
|
|
56
|
+
};
|
|
57
|
+
const entryId = await handle.executeUpdate(signals_1.submitOutboxUpdate, { args: [entry] });
|
|
58
|
+
return (0, descriptor_1.ok)(`Migrate queued for **${input.playerId}** → ${input.host}. (outbox: ${entryId})`);
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
return (0, descriptor_1.fail)(`Failed to migrate: ${(0, descriptor_1.formatError)(err)}`);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
};
|
|
60
65
|
}
|
package/dist/tools/pause.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
1
|
import { Client } from '@temporalio/client';
|
|
3
2
|
import { Config } from '../config';
|
|
4
|
-
|
|
3
|
+
import { type TempoToolDescriptor } from './descriptor';
|
|
4
|
+
export declare function buildPauseTool(client: Client, config: Config, getPlayerId: () => string): TempoToolDescriptor;
|
package/dist/tools/pause.js
CHANGED
|
@@ -1,36 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.buildPauseTool = buildPauseTool;
|
|
4
4
|
const signals_1 = require("../workflows/signals");
|
|
5
|
-
const
|
|
5
|
+
const descriptor_1 = require("./descriptor");
|
|
6
6
|
const ensemble_ops_1 = require("../utils/ensemble-ops");
|
|
7
7
|
const log = (...args) => console.error('[agent-tempo:pause]', ...args);
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
.
|
|
27
|
-
|
|
8
|
+
function buildPauseTool(client, config, getPlayerId) {
|
|
9
|
+
return {
|
|
10
|
+
name: 'pause',
|
|
11
|
+
description: 'Pause all sessions in the ensemble — locks outbox dispatch and pauses the scheduler. Stop commands still go through. Use `play` to unpause.',
|
|
12
|
+
params: {},
|
|
13
|
+
handler: async () => {
|
|
14
|
+
try {
|
|
15
|
+
const [toggle, sessions] = await Promise.all([
|
|
16
|
+
(0, ensemble_ops_1.pauseMaestroAndScheduler)(client, config.ensemble),
|
|
17
|
+
(0, ensemble_ops_1.signalAllSessions)(client, config.ensemble, signals_1.setPausedSignal.name, true),
|
|
18
|
+
]);
|
|
19
|
+
const bits = [
|
|
20
|
+
`Ensemble **${config.ensemble}** paused.`,
|
|
21
|
+
`${sessions.sent} session(s) paused`,
|
|
22
|
+
];
|
|
23
|
+
if (toggle.maestro)
|
|
24
|
+
bits.push('maestro paused');
|
|
25
|
+
if (toggle.scheduler)
|
|
26
|
+
bits.push('scheduler paused');
|
|
27
|
+
if (sessions.failed > 0) {
|
|
28
|
+
const errs = sessions.perSession
|
|
29
|
+
.filter((p) => p.outcome === 'failed')
|
|
30
|
+
.map((p) => ` - ${p.playerId}: ${'error' in p ? p.error : ''}`);
|
|
31
|
+
bits.push(`Errors:\n${errs.join('\n')}`);
|
|
32
|
+
}
|
|
33
|
+
log(`Paused ensemble "${config.ensemble}" by ${getPlayerId()}`);
|
|
34
|
+
return (0, descriptor_1.ok)(bits.join('\n'));
|
|
28
35
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
+
catch (err) {
|
|
37
|
+
return (0, descriptor_1.fail)(`Failed to pause ensemble: ${(0, descriptor_1.formatError)(err)}`);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
};
|
|
36
41
|
}
|
package/dist/tools/play.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
1
|
import { Client } from '@temporalio/client';
|
|
3
2
|
import { Config } from '../config';
|
|
4
|
-
|
|
3
|
+
import { type TempoToolDescriptor } from './descriptor';
|
|
4
|
+
export declare function buildPlayTool(client: Client, config: Config, getPlayerId: () => string): TempoToolDescriptor;
|
package/dist/tools/play.js
CHANGED
|
@@ -1,57 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.buildPlayTool = buildPlayTool;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const signals_1 = require("../workflows/signals");
|
|
6
|
-
const
|
|
6
|
+
const descriptor_1 = require("./descriptor");
|
|
7
7
|
const ensemble_ops_1 = require("../utils/ensemble-ops");
|
|
8
8
|
const log = (...args) => console.error('[agent-tempo:play]', ...args);
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
9
|
+
function buildPlayTool(client, config, getPlayerId) {
|
|
10
|
+
return {
|
|
11
|
+
name: 'play',
|
|
12
|
+
description: 'Resume all paused sessions in the ensemble — unlocks outbox dispatch and resumes the scheduler. Buffered outbox entries will be dispatched. Pass `release: true` to also release any held sessions (deliver deferred task messages and unlock their outboxes) in the same call.',
|
|
13
|
+
params: {
|
|
14
|
+
release: zod_1.z.boolean().optional().describe('Also release any held sessions (deliver deferred task messages and unlock outboxes). Safe to call when no sessions are held — it is a no-op on those. Default: false.'),
|
|
15
|
+
},
|
|
16
|
+
handler: async (args) => {
|
|
17
|
+
const release = args.release === true;
|
|
18
|
+
try {
|
|
19
|
+
// Unpause everything in parallel: maestro + scheduler + every session.
|
|
20
|
+
const [toggle, sessions] = await Promise.all([
|
|
21
|
+
(0, ensemble_ops_1.unpauseMaestroAndScheduler)(client, config.ensemble),
|
|
22
|
+
(0, ensemble_ops_1.signalAllSessions)(client, config.ensemble, signals_1.setPausedSignal.name, false),
|
|
23
|
+
]);
|
|
24
|
+
// `releaseHeld` is idempotent — safe to fan out to everyone. Keep it
|
|
25
|
+
// AFTER the unpause so sessions aren't releasing while paused.
|
|
26
|
+
let releasedCount = 0;
|
|
27
|
+
const releaseErrors = [];
|
|
28
|
+
if (release) {
|
|
29
|
+
const released = await (0, ensemble_ops_1.signalAllSessions)(client, config.ensemble,
|
|
30
|
+
// typed constant → `'releaseHeld'` string name, matches the session handler
|
|
31
|
+
signals_1.releaseHeldSignal.name, undefined);
|
|
32
|
+
releasedCount = released.sent;
|
|
33
|
+
for (const p of released.perSession) {
|
|
34
|
+
if (p.outcome === 'failed')
|
|
35
|
+
releaseErrors.push(`${p.playerId} release: ${'error' in p ? p.error : ''}`);
|
|
36
|
+
}
|
|
32
37
|
}
|
|
38
|
+
const bits = [
|
|
39
|
+
`Ensemble **${config.ensemble}** resumed.`,
|
|
40
|
+
`${sessions.sent} session(s) resumed`,
|
|
41
|
+
];
|
|
42
|
+
if (release)
|
|
43
|
+
bits.push(`${releasedCount} session(s) signalled for release`);
|
|
44
|
+
if (toggle.maestro)
|
|
45
|
+
bits.push('maestro resumed');
|
|
46
|
+
if (toggle.scheduler)
|
|
47
|
+
bits.push('scheduler resumed');
|
|
48
|
+
const failedUnpause = sessions.perSession
|
|
49
|
+
.filter((p) => p.outcome === 'failed')
|
|
50
|
+
.map((p) => ` - ${p.playerId}: ${'error' in p ? p.error : ''}`);
|
|
51
|
+
const allErrors = [...failedUnpause, ...releaseErrors.map((e) => ` - ${e}`)];
|
|
52
|
+
if (allErrors.length > 0)
|
|
53
|
+
bits.push(`Errors:\n${allErrors.join('\n')}`);
|
|
54
|
+
log(`Resumed ensemble "${config.ensemble}" by ${getPlayerId()}${release ? ' (with release)' : ''}`);
|
|
55
|
+
return (0, descriptor_1.ok)(bits.join('\n'));
|
|
33
56
|
}
|
|
34
|
-
|
|
35
|
-
`
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
bits.push(`${releasedCount} session(s) signalled for release`);
|
|
40
|
-
if (toggle.maestro)
|
|
41
|
-
bits.push('maestro resumed');
|
|
42
|
-
if (toggle.scheduler)
|
|
43
|
-
bits.push('scheduler resumed');
|
|
44
|
-
const failedUnpause = sessions.perSession
|
|
45
|
-
.filter((p) => p.outcome === 'failed')
|
|
46
|
-
.map((p) => ` - ${p.playerId}: ${'error' in p ? p.error : ''}`);
|
|
47
|
-
const allErrors = [...failedUnpause, ...releaseErrors.map((e) => ` - ${e}`)];
|
|
48
|
-
if (allErrors.length > 0)
|
|
49
|
-
bits.push(`Errors:\n${allErrors.join('\n')}`);
|
|
50
|
-
log(`Resumed ensemble "${config.ensemble}" by ${getPlayerId()}${release ? ' (with release)' : ''}`);
|
|
51
|
-
return (0, helpers_1.ok)(bits.join('\n'));
|
|
52
|
-
}
|
|
53
|
-
catch (err) {
|
|
54
|
-
return (0, helpers_1.fail)(`Failed to resume ensemble: ${(0, helpers_1.formatError)(err)}`);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
+
catch (err) {
|
|
58
|
+
return (0, descriptor_1.fail)(`Failed to resume ensemble: ${(0, descriptor_1.formatError)(err)}`);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
};
|
|
57
62
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
1
|
import { WorkflowHandle } from '@temporalio/client';
|
|
3
|
-
|
|
2
|
+
import { type TempoToolDescriptor } from './descriptor';
|
|
3
|
+
export declare function buildQualityGateTool(handle: WorkflowHandle, getPlayerId: () => string): TempoToolDescriptor;
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.buildQualityGateTool = buildQualityGateTool;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const descriptor_1 = require("./descriptor");
|
|
6
6
|
const validation_1 = require("../utils/validation");
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
7
|
+
function buildQualityGateTool(handle, getPlayerId) {
|
|
8
|
+
return {
|
|
9
|
+
name: 'quality_gate',
|
|
10
|
+
description: 'Define or replace a quality gate for a task. Each gate has a list of criteria that must pass before the task is considered complete. Conductor only.',
|
|
11
|
+
params: {
|
|
12
|
+
task: zod_1.z.string().max(validation_1.GATE_TASK_MAX).describe('Unique task name for this gate (e.g. "pr-review", "deploy-staging")'),
|
|
13
|
+
criteria: zod_1.z.array(zod_1.z.string().max(validation_1.GATE_CRITERION_TEXT_MAX)).min(1).max(validation_1.GATE_CRITERIA_MAX).describe('List of criteria that must be evaluated (e.g. ["Tests pass", "No lint errors", "Code reviewed"])'),
|
|
14
|
+
},
|
|
15
|
+
handler: async (args) => {
|
|
16
|
+
const { task, criteria } = args;
|
|
17
|
+
try {
|
|
18
|
+
await handle.signal('setQualityGate', {
|
|
19
|
+
task,
|
|
20
|
+
criteria,
|
|
21
|
+
createdBy: getPlayerId(),
|
|
22
|
+
});
|
|
23
|
+
const lines = criteria.map((c, i) => ` ${i}. [ ] ${c}`);
|
|
24
|
+
return (0, descriptor_1.ok)(`Quality gate **${task}** set with ${criteria.length} criteria:\n${lines.join('\n')}`);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
return (0, descriptor_1.fail)(`Failed to set quality gate: ${(0, descriptor_1.formatError)(err)}`);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
};
|
|
26
31
|
}
|
package/dist/tools/recall.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
1
|
import { WorkflowHandle } from '@temporalio/client';
|
|
3
|
-
|
|
2
|
+
import { type TempoToolDescriptor } from './descriptor';
|
|
3
|
+
export declare function buildRecallTool(handle: WorkflowHandle, getPlayerId: () => string): TempoToolDescriptor;
|
package/dist/tools/recall.js
CHANGED
|
@@ -1,32 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.buildRecallTool = buildRecallTool;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const descriptor_1 = require("./descriptor");
|
|
6
6
|
const recall_format_1 = require("../utils/recall-format");
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
7
|
+
function buildRecallTool(handle, getPlayerId) {
|
|
8
|
+
return {
|
|
9
|
+
name: 'recall',
|
|
10
|
+
description: 'Read your own message history. Shows received messages by default; use includeSent to also see outgoing messages. `offset` pages the timeline; `previewLength` truncates bodies (unset = full text).',
|
|
11
|
+
params: {
|
|
12
|
+
limit: zod_1.z.number().min(1).max(100).optional().describe('Max messages to return (default 20, max 100)'),
|
|
13
|
+
offset: zod_1.z.number().int().min(0).optional().describe('Skip N messages for paging (default 0)'),
|
|
14
|
+
previewLength: zod_1.z.number().int().min(1).optional().describe('Truncate each body to N chars + "…"; omit for full text'),
|
|
15
|
+
since: zod_1.z.string().optional().describe('Only show messages at or after this ISO timestamp'),
|
|
16
|
+
from: zod_1.z.string().optional().describe('Filter received messages by sender name'),
|
|
17
|
+
includeSent: zod_1.z.boolean().optional().describe('Include sent messages in the timeline (default: false)'),
|
|
18
|
+
},
|
|
19
|
+
handler: async (args) => {
|
|
20
|
+
const { limit, offset, previewLength, since, from: fromFilter, includeSent } = args;
|
|
21
|
+
// Validate `since` up-front so the formatter never sees a garbage date.
|
|
22
|
+
if (since && Number.isNaN(Date.parse(since))) {
|
|
23
|
+
return (0, descriptor_1.fail)(`Invalid ISO timestamp for "since": ${since}`);
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
const received = await handle.query('allMessages');
|
|
27
|
+
const sent = includeSent ? await handle.query('allSentMessages') : [];
|
|
28
|
+
const timeline = (0, recall_format_1.buildTimeline)(received, sent, Boolean(includeSent));
|
|
29
|
+
const rendered = (0, recall_format_1.formatRecall)(timeline, { limit, offset, previewLength, since, from: fromFilter });
|
|
30
|
+
return (0, descriptor_1.ok)(rendered.text);
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
return (0, descriptor_1.fail)(`Failed to recall messages: ${(0, descriptor_1.formatError)(err)}`);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
};
|
|
32
37
|
}
|
package/dist/tools/recruit.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
1
|
import { Client, WorkflowHandle } from '@temporalio/client';
|
|
3
2
|
import { Config } from '../config';
|
|
4
3
|
import { AgentType } from '../types';
|
|
5
4
|
import type { HostInfo } from '../types';
|
|
5
|
+
import { type TempoToolDescriptor } from './descriptor';
|
|
6
6
|
/**
|
|
7
7
|
* #274 M15 — dep-injection surface on the recruit tool registrar.
|
|
8
8
|
*
|
|
@@ -13,7 +13,7 @@ import type { HostInfo } from '../types';
|
|
|
13
13
|
export interface RegisterRecruitToolDeps {
|
|
14
14
|
listHostsFn?: (client: Client) => Promise<HostInfo[]>;
|
|
15
15
|
}
|
|
16
|
-
export declare function
|
|
16
|
+
export declare function buildRecruitTool(client: Client, config: Config, getPlayerId: () => string, handle: WorkflowHandle, ownAgentType?: AgentType, deps?: RegisterRecruitToolDeps): TempoToolDescriptor;
|
|
17
17
|
/**
|
|
18
18
|
* Given a host liveness+profile snapshot, validate that `targetHost` is
|
|
19
19
|
* (a) known, (b) recruit-ready, and (c) advertises support for
|