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/shutdown.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.buildShutdownTool = buildShutdownTool;
|
|
4
4
|
/**
|
|
5
5
|
* `shutdown` — graceful ensemble-wide teardown (#287).
|
|
6
6
|
*
|
|
@@ -14,41 +14,46 @@ exports.registerShutdownTool = registerShutdownTool;
|
|
|
14
14
|
*/
|
|
15
15
|
const zod_1 = require("zod");
|
|
16
16
|
const signals_1 = require("../workflows/signals");
|
|
17
|
-
const
|
|
17
|
+
const descriptor_1 = require("./descriptor");
|
|
18
18
|
const validation_1 = require("../utils/validation");
|
|
19
19
|
const ensemble_ops_1 = require("../utils/ensemble-ops");
|
|
20
20
|
const log = (...args) => console.error('[agent-tempo:shutdown]', ...args);
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
bits.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.
|
|
45
|
-
|
|
21
|
+
function buildShutdownTool(client, config, getPlayerId) {
|
|
22
|
+
return {
|
|
23
|
+
name: 'shutdown',
|
|
24
|
+
description: 'Gracefully shut down the ensemble: request detach on every session, pause the scheduler, and pause the maestro. Workflows survive in `detached` phase. Pair with `restore` to come back up, or `destroy` (no player arg) to terminate. Does not touch your own session.',
|
|
25
|
+
params: {
|
|
26
|
+
deadlineMs: zod_1.z.number().min(0).max(validation_1.MAX_DETACH_DEADLINE_MS).optional().describe(`Max drain time per session before force-detach (default ${validation_1.DEFAULT_RESTART_DETACH_DEADLINE_MS}, max ${validation_1.MAX_DETACH_DEADLINE_MS}).`),
|
|
27
|
+
},
|
|
28
|
+
handler: async (args) => {
|
|
29
|
+
const { deadlineMs = validation_1.DEFAULT_RESTART_DETACH_DEADLINE_MS } = args;
|
|
30
|
+
const callerId = getPlayerId();
|
|
31
|
+
try {
|
|
32
|
+
// Pause maestro + scheduler in parallel with the session fan-out —
|
|
33
|
+
// they're independent and draining adapters won't mind if the
|
|
34
|
+
// scheduler keeps firing for a few ms longer.
|
|
35
|
+
const [toggle, fanout] = await Promise.all([
|
|
36
|
+
(0, ensemble_ops_1.pauseMaestroAndScheduler)(client, config.ensemble),
|
|
37
|
+
(0, ensemble_ops_1.signalAllSessions)(client, config.ensemble, signals_1.requestDetachSignal.name, { reason: 'user-stop', deadlineMs }, { skip: (playerId) => playerId === callerId }),
|
|
38
|
+
]);
|
|
39
|
+
const summaryLine = `${fanout.sent} detaching, ${fanout.skipped} skipped, ${fanout.failed} failed`;
|
|
40
|
+
const bits = [`Ensemble **${config.ensemble}** shutting down.`, summaryLine];
|
|
41
|
+
if (toggle.maestro)
|
|
42
|
+
bits.push('maestro paused');
|
|
43
|
+
if (toggle.scheduler)
|
|
44
|
+
bits.push('scheduler paused');
|
|
45
|
+
if (fanout.failed > 0) {
|
|
46
|
+
const errs = fanout.perSession
|
|
47
|
+
.filter((p) => p.outcome === 'failed')
|
|
48
|
+
.map((p) => ` - ${p.playerId}: ${'error' in p ? p.error : ''}`);
|
|
49
|
+
bits.push(`Errors:\n${errs.join('\n')}`);
|
|
50
|
+
}
|
|
51
|
+
log(`Shutdown requested by ${callerId} in "${config.ensemble}": ${summaryLine}`);
|
|
52
|
+
return (0, descriptor_1.ok)(bits.join('\n'));
|
|
46
53
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
+
catch (err) {
|
|
55
|
+
return (0, descriptor_1.fail)(`Failed to shut down ensemble: ${(0, descriptor_1.formatError)(err)}`);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
};
|
|
54
59
|
}
|
package/dist/tools/stage.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 buildStageTool(handle: WorkflowHandle, getPlayerId: () => string): TempoToolDescriptor;
|
package/dist/tools/stage.js
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.buildStageTool = buildStageTool;
|
|
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
|
-
name:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
7
|
+
function buildStageTool(handle, getPlayerId) {
|
|
8
|
+
return {
|
|
9
|
+
name: 'stage',
|
|
10
|
+
description: 'Create a pipeline stage tracking N players. When all players report, a completion message is auto-injected. Conductor only.',
|
|
11
|
+
params: {
|
|
12
|
+
name: zod_1.z.string().max(validation_1.STAGE_NAME_MAX).describe('Unique stage name (e.g. "code-review", "testing")'),
|
|
13
|
+
players: zod_1.z.array(zod_1.z.string().regex(validation_1.PLAYER_NAME_REGEX)).min(1).max(validation_1.STAGE_PLAYERS_MAX).describe('Player names to track in this stage'),
|
|
14
|
+
failurePolicy: zod_1.z.enum(['halt', 'continue']).optional().describe('What to do when a player reports a blocker. "halt" (default) fails the stage immediately; "continue" waits for all players.'),
|
|
15
|
+
},
|
|
16
|
+
handler: async (args) => {
|
|
17
|
+
const { name, players, failurePolicy } = args;
|
|
18
|
+
try {
|
|
19
|
+
await handle.signal('setStage', {
|
|
20
|
+
name,
|
|
21
|
+
players,
|
|
22
|
+
failurePolicy,
|
|
23
|
+
createdBy: getPlayerId(),
|
|
24
|
+
});
|
|
25
|
+
const playerList = players.map((p) => ` - ${p}`).join('\n');
|
|
26
|
+
return (0, descriptor_1.ok)(`Stage **${name}** created tracking ${players.length} player(s) [policy: ${failurePolicy || 'halt'}]:\n${playerList}`);
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
return (0, descriptor_1.fail)(`Failed to create stage: ${(0, descriptor_1.formatError)(err)}`);
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
};
|
|
28
33
|
}
|
package/dist/tools/stages.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 buildStagesTool(handle: WorkflowHandle): TempoToolDescriptor;
|
package/dist/tools/stages.js
CHANGED
|
@@ -1,35 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
3
|
+
exports.buildStagesTool = buildStagesTool;
|
|
4
|
+
const descriptor_1 = require("./descriptor");
|
|
5
|
+
function buildStagesTool(handle) {
|
|
6
|
+
return {
|
|
7
|
+
name: 'stages',
|
|
8
|
+
description: 'List all pipeline stages and their status. Shows which players have reported, who is still waiting, and stage completion status. Conductor only.',
|
|
9
|
+
params: {},
|
|
10
|
+
handler: async () => {
|
|
11
|
+
try {
|
|
12
|
+
const stages = await handle.query('stages');
|
|
13
|
+
if (stages.length === 0) {
|
|
14
|
+
return (0, descriptor_1.ok)('No stages defined.');
|
|
15
|
+
}
|
|
16
|
+
const lines = stages.map((s) => {
|
|
17
|
+
const statusIcon = s.status === 'complete' ? '\u2714'
|
|
18
|
+
: s.status === 'failed' ? '\u2718'
|
|
19
|
+
: s.status === 'cancelled' ? '\u2212'
|
|
20
|
+
: '\u25CB';
|
|
21
|
+
const playerLines = s.players.map((p) => {
|
|
22
|
+
const pIcon = p.status === 'reported' ? '\u2714'
|
|
23
|
+
: p.status === 'blocked' ? '\u2718'
|
|
24
|
+
: '\u25CB';
|
|
25
|
+
const detail = p.reportedAt ? ` (${p.reportType})` : '';
|
|
26
|
+
return ` ${pIcon} ${p.playerId}${detail}`;
|
|
27
|
+
});
|
|
28
|
+
return [
|
|
29
|
+
`${statusIcon} **${s.name}** [${s.status}] (policy: ${s.failurePolicy})`,
|
|
30
|
+
...playerLines,
|
|
31
|
+
].join('\n');
|
|
23
32
|
});
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
catch (err) {
|
|
32
|
-
return (0, helpers_1.fail)(`Failed to query stages: ${(0, helpers_1.formatError)(err)}`);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
33
|
+
return (0, descriptor_1.ok)(lines.join('\n\n'));
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
return (0, descriptor_1.fail)(`Failed to query stages: ${(0, descriptor_1.formatError)(err)}`);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
};
|
|
35
40
|
}
|
|
@@ -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 buildUnscheduleTool(client: Client, config: Config): TempoToolDescriptor;
|
package/dist/tools/unschedule.js
CHANGED
|
@@ -1,35 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.buildUnscheduleTool = buildUnscheduleTool;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const common_1 = require("@temporalio/common");
|
|
6
6
|
const config_1 = require("../config");
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
name:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// Only treat WorkflowNotFoundError as "no scheduler" — other errors (network, etc.)
|
|
18
|
-
// should propagate so callers get an accurate error message.
|
|
7
|
+
const descriptor_1 = require("./descriptor");
|
|
8
|
+
function buildUnscheduleTool(client, config) {
|
|
9
|
+
return {
|
|
10
|
+
name: 'unschedule',
|
|
11
|
+
description: 'Remove a named schedule. The schedule stops firing immediately.',
|
|
12
|
+
params: {
|
|
13
|
+
name: zod_1.z.string().describe('Name of the schedule to remove'),
|
|
14
|
+
},
|
|
15
|
+
handler: async (args) => {
|
|
16
|
+
const { name } = args;
|
|
19
17
|
try {
|
|
20
|
-
|
|
18
|
+
const wfId = (0, config_1.schedulerWorkflowId)(config.ensemble);
|
|
19
|
+
const handle = client.workflow.getHandle(wfId);
|
|
20
|
+
// Check if the scheduler workflow is running before signaling.
|
|
21
|
+
// Only treat WorkflowNotFoundError as "no scheduler" — other errors (network, etc.)
|
|
22
|
+
// should propagate so callers get an accurate error message.
|
|
23
|
+
try {
|
|
24
|
+
await handle.describe();
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
if (err instanceof common_1.WorkflowNotFoundError) {
|
|
28
|
+
return (0, descriptor_1.ok)('No scheduler is running — there are no schedules to remove.');
|
|
29
|
+
}
|
|
30
|
+
throw err;
|
|
31
|
+
}
|
|
32
|
+
await handle.signal('removeSchedule', name);
|
|
33
|
+
return (0, descriptor_1.ok)(`Schedule **${name}** removed.`);
|
|
21
34
|
}
|
|
22
35
|
catch (err) {
|
|
23
|
-
|
|
24
|
-
return (0, helpers_1.ok)('No scheduler is running — there are no schedules to remove.');
|
|
25
|
-
}
|
|
26
|
-
throw err;
|
|
36
|
+
return (0, descriptor_1.fail)(`Failed to remove schedule: ${(0, descriptor_1.formatError)(err)}`);
|
|
27
37
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
catch (err) {
|
|
32
|
-
return (0, helpers_1.fail)(`Failed to remove schedule: ${(0, helpers_1.formatError)(err)}`);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
38
|
+
},
|
|
39
|
+
};
|
|
35
40
|
}
|
package/dist/tools/who-am-i.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { WorkflowHandle } from '@temporalio/client';
|
|
2
|
-
import {
|
|
3
|
-
export declare function
|
|
2
|
+
import { type TempoToolDescriptor } from './descriptor';
|
|
3
|
+
export declare function buildWhoAmITool(handle: WorkflowHandle, getPlayerId: () => string): TempoToolDescriptor;
|
package/dist/tools/who-am-i.js
CHANGED
|
@@ -1,34 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
phase
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
3
|
+
exports.buildWhoAmITool = buildWhoAmITool;
|
|
4
|
+
const descriptor_1 = require("./descriptor");
|
|
5
|
+
function buildWhoAmITool(handle, getPlayerId) {
|
|
6
|
+
return {
|
|
7
|
+
name: 'who_am_i',
|
|
8
|
+
description: 'Get your identity, role, and session details',
|
|
9
|
+
params: {},
|
|
10
|
+
handler: async () => {
|
|
11
|
+
const metadata = await handle.query('getMetadata');
|
|
12
|
+
const part = await handle.query('getPart');
|
|
13
|
+
// Attachment phase is authoritative post-#175/#176 (replaced legacy status).
|
|
14
|
+
let phase;
|
|
15
|
+
try {
|
|
16
|
+
const info = await handle.query('attachmentInfo');
|
|
17
|
+
phase = info.phase;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
// Older workflows pre-dating the attachment lifecycle may not support this query.
|
|
21
|
+
phase = undefined;
|
|
22
|
+
}
|
|
23
|
+
const lines = [
|
|
24
|
+
`**Name:** ${metadata.playerId}`,
|
|
25
|
+
metadata.playerType ? `**Type:** ${metadata.playerType}` : null,
|
|
26
|
+
metadata.playerTypeDescription ? `**Description:** ${metadata.playerTypeDescription}` : null,
|
|
27
|
+
`**Ensemble:** ${metadata.ensemble}`,
|
|
28
|
+
`**Role:** ${metadata.isConductor ? 'Conductor' : 'Player'}`,
|
|
29
|
+
metadata.recruitedBy ? `**Recruited by:** ${metadata.recruitedBy}` : null,
|
|
30
|
+
`**Part:** ${part}`,
|
|
31
|
+
`**Directory:** ${metadata.workDir}`,
|
|
32
|
+
`**Host:** ${metadata.hostname}`,
|
|
33
|
+
metadata.gitBranch ? `**Branch:** ${metadata.gitBranch}` : null,
|
|
34
|
+
`**Phase:** ${phase ?? 'unknown'}`,
|
|
35
|
+
].filter(Boolean);
|
|
36
|
+
return (0, descriptor_1.ok)(lines.join('\n'));
|
|
37
|
+
},
|
|
38
|
+
};
|
|
34
39
|
}
|
package/dist/tools/worktree.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 buildWorktreeTool(client: Client, config: Config, handle: WorkflowHandle, getPlayerId: () => string): TempoToolDescriptor;
|