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
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Activity log — shows recent Maestro events (player joins, leaves, status changes).
|
|
3
|
-
*/
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import type { MaestroEvent } from '../../types';
|
|
6
|
-
export interface ActivityLogProps {
|
|
7
|
-
events: MaestroEvent[];
|
|
8
|
-
maxVisible?: number;
|
|
9
|
-
}
|
|
10
|
-
export declare function ActivityLog({ events, maxVisible }: ActivityLogProps): React.FunctionComponentElement<{
|
|
11
|
-
flexDirection: string;
|
|
12
|
-
}> | React.CElement<{
|
|
13
|
-
flexDirection: string;
|
|
14
|
-
}, React.Component<{
|
|
15
|
-
flexDirection: string;
|
|
16
|
-
}, any, any>>;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ActivityLog = ActivityLog;
|
|
7
|
-
/**
|
|
8
|
-
* Activity log — shows recent Maestro events (player joins, leaves, status changes).
|
|
9
|
-
*/
|
|
10
|
-
const react_1 = __importDefault(require("react"));
|
|
11
|
-
const ink_context_1 = require("../ink-context");
|
|
12
|
-
const format_1 = require("../utils/format");
|
|
13
|
-
const platform_1 = require("../utils/platform");
|
|
14
|
-
function ActivityLog({ events, maxVisible = 15 }) {
|
|
15
|
-
const { Box, Text } = (0, ink_context_1.useInk)();
|
|
16
|
-
const icons = (0, platform_1.statusIcons)();
|
|
17
|
-
const visible = events.slice(-maxVisible);
|
|
18
|
-
if (visible.length === 0) {
|
|
19
|
-
return react_1.default.createElement(Box, { flexDirection: 'column' }, react_1.default.createElement(Text, { dimColor: true }, 'No events yet'));
|
|
20
|
-
}
|
|
21
|
-
return react_1.default.createElement(Box, { flexDirection: 'column' }, ...visible.map((e, i) => {
|
|
22
|
-
const time = (0, format_1.formatTime)(e.timestamp);
|
|
23
|
-
const typeLabel = (0, format_1.formatEventType)(e.type);
|
|
24
|
-
const icon = e.type === 'player_joined' ? icons.check
|
|
25
|
-
: e.type === 'player_left' ? icons.cross
|
|
26
|
-
: icons.arrow;
|
|
27
|
-
const color = e.type === 'player_joined' ? 'green'
|
|
28
|
-
: e.type === 'player_left' ? 'red'
|
|
29
|
-
: e.type === 'status_changed' ? 'yellow'
|
|
30
|
-
: 'white';
|
|
31
|
-
const detail = e.newValue
|
|
32
|
-
? ` ${icons.arrow} ${e.newValue}`
|
|
33
|
-
: '';
|
|
34
|
-
return react_1.default.createElement(Box, { key: `${e.timestamp}-${i}` }, react_1.default.createElement(Text, { dimColor: true }, `[${time}] `), react_1.default.createElement(Text, { color }, `${icon} `), react_1.default.createElement(Text, { bold: true }, e.playerId), react_1.default.createElement(Text, { dimColor: true }, ` ${typeLabel}`), react_1.default.createElement(Text, null, detail));
|
|
35
|
-
}));
|
|
36
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CommandOverlay — generic dismissible overlay for data-display commands.
|
|
3
|
-
*
|
|
4
|
-
* Renders a title and pre-formatted text content. Used by /gates, /stages,
|
|
5
|
-
* /worktree list, /recall, and /search instead of static scrollback.
|
|
6
|
-
*
|
|
7
|
-
* Performance: Single <Text> root with nested virtual-text children.
|
|
8
|
-
* Zero Yoga <Box> nodes.
|
|
9
|
-
*/
|
|
10
|
-
import React from 'react';
|
|
11
|
-
export interface CommandOverlayProps {
|
|
12
|
-
title: string;
|
|
13
|
-
content: string;
|
|
14
|
-
}
|
|
15
|
-
export declare function CommandOverlay({ title, content }: CommandOverlayProps): React.CElement<{}, React.Component<{}, any, any>>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CommandOverlay = CommandOverlay;
|
|
7
|
-
/**
|
|
8
|
-
* CommandOverlay — generic dismissible overlay for data-display commands.
|
|
9
|
-
*
|
|
10
|
-
* Renders a title and pre-formatted text content. Used by /gates, /stages,
|
|
11
|
-
* /worktree list, /recall, and /search instead of static scrollback.
|
|
12
|
-
*
|
|
13
|
-
* Performance: Single <Text> root with nested virtual-text children.
|
|
14
|
-
* Zero Yoga <Box> nodes.
|
|
15
|
-
*/
|
|
16
|
-
const react_1 = __importDefault(require("react"));
|
|
17
|
-
const ink_context_1 = require("../ink-context");
|
|
18
|
-
const theme_1 = require("../utils/theme");
|
|
19
|
-
function CommandOverlay({ title, content }) {
|
|
20
|
-
const { Text } = (0, ink_context_1.useInk)();
|
|
21
|
-
const children = [];
|
|
22
|
-
children.push(react_1.default.createElement(Text, { key: 'h', bold: true, color: theme_1.THEME.accent }, ` ${title}`));
|
|
23
|
-
children.push('\n\n');
|
|
24
|
-
// Render each line of pre-formatted content as dimmed text
|
|
25
|
-
const lines = content.split('\n');
|
|
26
|
-
for (let i = 0; i < lines.length; i++) {
|
|
27
|
-
if (i > 0)
|
|
28
|
-
children.push('\n');
|
|
29
|
-
children.push(react_1.default.createElement(Text, { key: `l-${i}`, color: theme_1.THEME.text }, ` ${lines[i]}`));
|
|
30
|
-
}
|
|
31
|
-
children.push('\n\n');
|
|
32
|
-
children.push(react_1.default.createElement(Text, { key: 'hint', color: theme_1.THEME.dim }, ' Esc to dismiss'));
|
|
33
|
-
return react_1.default.createElement(Text, null, ...children);
|
|
34
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Conductor chat panel — shows command/report history from the conductor.
|
|
3
|
-
*/
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import type { HistoryEntry } from '../../types';
|
|
6
|
-
export interface ConductorChatProps {
|
|
7
|
-
history: HistoryEntry[];
|
|
8
|
-
maxVisible?: number;
|
|
9
|
-
}
|
|
10
|
-
export declare function ConductorChat({ history, maxVisible }: ConductorChatProps): React.FunctionComponentElement<{
|
|
11
|
-
flexDirection: string;
|
|
12
|
-
}> | React.CElement<{
|
|
13
|
-
flexDirection: string;
|
|
14
|
-
}, React.Component<{
|
|
15
|
-
flexDirection: string;
|
|
16
|
-
}, any, any>>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ConductorChat = ConductorChat;
|
|
7
|
-
/**
|
|
8
|
-
* Conductor chat panel — shows command/report history from the conductor.
|
|
9
|
-
*/
|
|
10
|
-
const react_1 = __importDefault(require("react"));
|
|
11
|
-
const ink_context_1 = require("../ink-context");
|
|
12
|
-
const format_1 = require("../utils/format");
|
|
13
|
-
function ConductorChat({ history, maxVisible = 20 }) {
|
|
14
|
-
const { Box, Text } = (0, ink_context_1.useInk)();
|
|
15
|
-
const visible = history.slice(-maxVisible);
|
|
16
|
-
if (visible.length === 0) {
|
|
17
|
-
return react_1.default.createElement(Box, { flexDirection: 'column' }, react_1.default.createElement(Text, { dimColor: true }, 'No conductor activity yet'));
|
|
18
|
-
}
|
|
19
|
-
return react_1.default.createElement(Box, { flexDirection: 'column' }, ...visible.map((entry, i) => {
|
|
20
|
-
const time = (0, format_1.formatTime)(entry.timestamp);
|
|
21
|
-
const isCommand = entry.type === 'command';
|
|
22
|
-
const data = entry.data;
|
|
23
|
-
if (isCommand) {
|
|
24
|
-
return react_1.default.createElement(Box, { key: `${entry.timestamp}-${i}` }, react_1.default.createElement(Text, { dimColor: true }, `[${time}] `), react_1.default.createElement(Text, { color: 'cyan' }, `${data.source}: `), react_1.default.createElement(Text, null, data.text));
|
|
25
|
-
}
|
|
26
|
-
// Report
|
|
27
|
-
const reportColor = data.type === 'blocker' ? 'red'
|
|
28
|
-
: data.type === 'question' ? 'yellow'
|
|
29
|
-
: 'green';
|
|
30
|
-
return react_1.default.createElement(Box, { key: `${entry.timestamp}-${i}` }, react_1.default.createElement(Text, { dimColor: true }, `[${time}] `), react_1.default.createElement(Text, { color: reportColor }, `[${data.type}] `), react_1.default.createElement(Text, { bold: true }, `${data.playerId}: `), react_1.default.createElement(Text, null, data.text));
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ensemble list view — landing screen showing all ensembles.
|
|
3
|
-
* Arrow keys to navigate, Enter to drill in, q to quit.
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import type { EnsembleSummary } from '../store';
|
|
7
|
-
export interface EnsembleListViewProps {
|
|
8
|
-
ensembles: EnsembleSummary[];
|
|
9
|
-
selectedIndex: number;
|
|
10
|
-
}
|
|
11
|
-
export declare function EnsembleListView({ ensembles, selectedIndex }: EnsembleListViewProps): React.FunctionComponentElement<{
|
|
12
|
-
flexDirection: string;
|
|
13
|
-
padding: number;
|
|
14
|
-
}>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.EnsembleListView = EnsembleListView;
|
|
7
|
-
/**
|
|
8
|
-
* Ensemble list view — landing screen showing all ensembles.
|
|
9
|
-
* Arrow keys to navigate, Enter to drill in, q to quit.
|
|
10
|
-
*/
|
|
11
|
-
const react_1 = __importDefault(require("react"));
|
|
12
|
-
const ink_context_1 = require("../ink-context");
|
|
13
|
-
const platform_1 = require("../utils/platform");
|
|
14
|
-
function EnsembleListView({ ensembles, selectedIndex }) {
|
|
15
|
-
const { Box, Text } = (0, ink_context_1.useInk)();
|
|
16
|
-
const icons = (0, platform_1.statusIcons)();
|
|
17
|
-
return react_1.default.createElement(Box, { flexDirection: 'column', padding: 1 }, react_1.default.createElement(Text, { bold: true, color: 'cyan' }, 'claude-tempo ensembles'), react_1.default.createElement(Text, { dimColor: true }, 'Arrow keys to navigate, Enter to open, q to quit\n'), ensembles.length === 0
|
|
18
|
-
? react_1.default.createElement(Box, { marginTop: 1 }, react_1.default.createElement(Text, { dimColor: true }, 'No running ensembles found. Start one with `claude-tempo up`.'))
|
|
19
|
-
: react_1.default.createElement(Box, { flexDirection: 'column' },
|
|
20
|
-
// Header
|
|
21
|
-
react_1.default.createElement(Box, null, react_1.default.createElement(Text, { bold: true, dimColor: true }, ' Ensemble Players Conductor Maestro')),
|
|
22
|
-
// Rows
|
|
23
|
-
...ensembles.map((e, i) => {
|
|
24
|
-
const selected = i === selectedIndex;
|
|
25
|
-
const cursor = selected ? icons.arrow : ' ';
|
|
26
|
-
const conductorIcon = e.conductorOnline ? icons.active : icons.stale;
|
|
27
|
-
const maestroIcon = e.maestroRunning ? icons.active : icons.stale;
|
|
28
|
-
const conductorColor = e.conductorOnline ? 'green' : 'gray';
|
|
29
|
-
const maestroColor = e.maestroRunning ? 'green' : 'gray';
|
|
30
|
-
return react_1.default.createElement(Box, { key: e.name }, react_1.default.createElement(Text, { color: selected ? 'cyan' : 'white', bold: selected }, `${cursor} ${e.name.padEnd(25)} ${String(e.playerCount).padEnd(9)}`), react_1.default.createElement(Text, { color: conductorColor }, `${conductorIcon}`.padEnd(11)), react_1.default.createElement(Text, { color: maestroColor }, maestroIcon));
|
|
31
|
-
})));
|
|
32
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ensemble panel — shows all players with status icons and parts.
|
|
3
|
-
*/
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import type { MaestroPlayerInfo } from '../../types';
|
|
6
|
-
export interface EnsemblePanelProps {
|
|
7
|
-
players: MaestroPlayerInfo[];
|
|
8
|
-
maxWidth?: number;
|
|
9
|
-
}
|
|
10
|
-
export declare function EnsemblePanel({ players, maxWidth }: EnsemblePanelProps): React.FunctionComponentElement<{
|
|
11
|
-
flexDirection: string;
|
|
12
|
-
}>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.EnsemblePanel = EnsemblePanel;
|
|
7
|
-
/**
|
|
8
|
-
* Ensemble panel — shows all players with status icons and parts.
|
|
9
|
-
*/
|
|
10
|
-
const react_1 = __importDefault(require("react"));
|
|
11
|
-
const ink_context_1 = require("../ink-context");
|
|
12
|
-
const platform_1 = require("../utils/platform");
|
|
13
|
-
const format_1 = require("../utils/format");
|
|
14
|
-
function EnsemblePanel({ players, maxWidth = 40 }) {
|
|
15
|
-
const { Box, Text } = (0, ink_context_1.useInk)();
|
|
16
|
-
const icons = (0, platform_1.statusIcons)();
|
|
17
|
-
const partMaxLen = Math.max(maxWidth - 25, 10);
|
|
18
|
-
if (players.length === 0) {
|
|
19
|
-
return react_1.default.createElement(Box, { flexDirection: 'column' }, react_1.default.createElement(Text, { dimColor: true }, 'No players connected'));
|
|
20
|
-
}
|
|
21
|
-
return react_1.default.createElement(Box, { flexDirection: 'column' }, ...players.map((p) => {
|
|
22
|
-
const icon = p.isConductor ? icons.conductor
|
|
23
|
-
: p.status === 'active' ? icons.active
|
|
24
|
-
: p.status === 'stale' ? icons.stale
|
|
25
|
-
: p.status === 'pending' ? icons.pending
|
|
26
|
-
: p.status === 'blocked' ? icons.blocked
|
|
27
|
-
: p.status === 'terminated' ? icons.terminated
|
|
28
|
-
: icons.player;
|
|
29
|
-
const color = p.isConductor ? 'yellow'
|
|
30
|
-
: p.status === 'active' ? 'green'
|
|
31
|
-
: p.status === 'stale' ? 'gray'
|
|
32
|
-
: p.status === 'blocked' ? 'red'
|
|
33
|
-
: p.status === 'pending' ? 'cyan'
|
|
34
|
-
: 'white';
|
|
35
|
-
const typeSuffix = p.playerType ? ` (${p.playerType})` : '';
|
|
36
|
-
const name = `${p.playerId}${typeSuffix}`;
|
|
37
|
-
const part = (0, format_1.truncate)(p.part, partMaxLen);
|
|
38
|
-
return react_1.default.createElement(Box, { key: p.playerId, flexDirection: 'column' }, react_1.default.createElement(Box, null, react_1.default.createElement(Text, { color }, `${icon} `), react_1.default.createElement(Text, { bold: true, color }, name)), react_1.default.createElement(Text, { dimColor: true }, ` ${part}`));
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Input bar — text input for sending commands to the conductor.
|
|
3
|
-
*/
|
|
4
|
-
import React from 'react';
|
|
5
|
-
export interface InputBarProps {
|
|
6
|
-
onSubmit: (text: string) => void;
|
|
7
|
-
sending: boolean;
|
|
8
|
-
error: string | null;
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function InputBar({ onSubmit, sending, error, placeholder }: InputBarProps): React.FunctionComponentElement<{
|
|
12
|
-
flexDirection: string;
|
|
13
|
-
}>;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.InputBar = InputBar;
|
|
37
|
-
/**
|
|
38
|
-
* Input bar — text input for sending commands to the conductor.
|
|
39
|
-
*/
|
|
40
|
-
const react_1 = __importStar(require("react"));
|
|
41
|
-
const ink_context_1 = require("../ink-context");
|
|
42
|
-
function InputBar({ onSubmit, sending, error, placeholder = 'Send command to conductor...' }) {
|
|
43
|
-
const { Box, Text } = (0, ink_context_1.useInk)();
|
|
44
|
-
const [value, setValue] = (0, react_1.useState)('');
|
|
45
|
-
const handleSubmit = (0, react_1.useCallback)(() => {
|
|
46
|
-
if (value.trim() && !sending) {
|
|
47
|
-
onSubmit(value.trim());
|
|
48
|
-
setValue('');
|
|
49
|
-
}
|
|
50
|
-
}, [value, sending, onSubmit]);
|
|
51
|
-
// Simple text display — actual text input requires ink-text-input which is also ESM.
|
|
52
|
-
// For now, show the prompt. Full text input will be added when ink-text-input is integrated.
|
|
53
|
-
return react_1.default.createElement(Box, { flexDirection: 'column' }, react_1.default.createElement(Box, null, react_1.default.createElement(Text, { color: 'cyan', bold: true }, '> '), sending
|
|
54
|
-
? react_1.default.createElement(Text, { dimColor: true }, 'Sending...')
|
|
55
|
-
: react_1.default.createElement(Text, { dimColor: true }, placeholder)), error
|
|
56
|
-
? react_1.default.createElement(Text, { color: 'red' }, `Error: ${error}`)
|
|
57
|
-
: null);
|
|
58
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ScheduleOverlay — dismissible overlay showing active schedules.
|
|
3
|
-
*
|
|
4
|
-
* Performance: Single <Text> root with nested virtual-text children.
|
|
5
|
-
* Zero Yoga <Box> nodes.
|
|
6
|
-
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import type { ScheduleEntry } from '../../types';
|
|
9
|
-
export interface ScheduleOverlayProps {
|
|
10
|
-
schedules: ScheduleEntry[];
|
|
11
|
-
ensemble: string;
|
|
12
|
-
}
|
|
13
|
-
export declare function ScheduleOverlay({ schedules, ensemble }: ScheduleOverlayProps): React.CElement<{}, React.Component<{}, any, any>>;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ScheduleOverlay = ScheduleOverlay;
|
|
7
|
-
/**
|
|
8
|
-
* ScheduleOverlay — dismissible overlay showing active schedules.
|
|
9
|
-
*
|
|
10
|
-
* Performance: Single <Text> root with nested virtual-text children.
|
|
11
|
-
* Zero Yoga <Box> nodes.
|
|
12
|
-
*/
|
|
13
|
-
const react_1 = __importDefault(require("react"));
|
|
14
|
-
const ink_context_1 = require("../ink-context");
|
|
15
|
-
const theme_1 = require("../utils/theme");
|
|
16
|
-
function formatTime(ts) {
|
|
17
|
-
try {
|
|
18
|
-
const d = new Date(ts);
|
|
19
|
-
return `${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`;
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
return '??:??';
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
function formatDateTime(ts) {
|
|
26
|
-
try {
|
|
27
|
-
const d = new Date(ts);
|
|
28
|
-
const month = String(d.getMonth() + 1).padStart(2, '0');
|
|
29
|
-
const day = String(d.getDate()).padStart(2, '0');
|
|
30
|
-
return `${month}-${day} ${formatTime(ts)}`;
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
return '??';
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function formatInterval(ms) {
|
|
37
|
-
if (ms < 60000)
|
|
38
|
-
return `${Math.round(ms / 1000)}s`;
|
|
39
|
-
if (ms < 3600000)
|
|
40
|
-
return `${Math.round(ms / 60000)}m`;
|
|
41
|
-
return `${(ms / 3600000).toFixed(1)}h`;
|
|
42
|
-
}
|
|
43
|
-
const typeIcons = {
|
|
44
|
-
once: '\u23F1', // stopwatch
|
|
45
|
-
interval: '\u21BB', // clockwise arrows
|
|
46
|
-
cron: '\u23F0', // alarm clock
|
|
47
|
-
};
|
|
48
|
-
const typeLabels = {
|
|
49
|
-
once: 'one-shot',
|
|
50
|
-
interval: 'recurring',
|
|
51
|
-
cron: 'cron',
|
|
52
|
-
};
|
|
53
|
-
function ScheduleOverlay({ schedules, ensemble }) {
|
|
54
|
-
const { Text } = (0, ink_context_1.useInk)();
|
|
55
|
-
const children = [];
|
|
56
|
-
children.push(react_1.default.createElement(Text, { key: 'h', bold: true, color: theme_1.THEME.accent }, ` Schedules \u00B7 ${ensemble}`));
|
|
57
|
-
if (schedules.length === 0) {
|
|
58
|
-
children.push('\n\n');
|
|
59
|
-
children.push(react_1.default.createElement(Text, { key: 'empty', color: theme_1.THEME.dim }, ' No active schedules.'));
|
|
60
|
-
children.push('\n\n');
|
|
61
|
-
children.push(react_1.default.createElement(Text, { key: 'hint1', color: theme_1.THEME.dim }, ' Use /schedule create to set one up.'));
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
children.push(react_1.default.createElement(Text, { key: 'count', color: theme_1.THEME.dim }, ` (${schedules.length})`));
|
|
65
|
-
for (let i = 0; i < schedules.length; i++) {
|
|
66
|
-
const s = schedules[i];
|
|
67
|
-
const icon = typeIcons[s.type] || '\u21BB';
|
|
68
|
-
const label = typeLabels[s.type] || s.type;
|
|
69
|
-
children.push('\n\n');
|
|
70
|
-
// Name + type
|
|
71
|
-
children.push(react_1.default.createElement(react_1.default.Fragment, { key: `s-${i}` }, react_1.default.createElement(Text, { color: theme_1.THEME.text }, ` ${icon} `), react_1.default.createElement(Text, { bold: true, color: theme_1.THEME.text }, s.name), react_1.default.createElement(Text, { color: theme_1.THEME.dim }, ` [${label}]`)));
|
|
72
|
-
// Target
|
|
73
|
-
children.push('\n');
|
|
74
|
-
children.push(react_1.default.createElement(Text, { key: `st-${i}`, color: theme_1.THEME.dim }, ` \u2192 ${s.target}`));
|
|
75
|
-
// Message content
|
|
76
|
-
const msgPreview = s.message.length > 80 ? s.message.slice(0, 77) + '\u2026' : s.message;
|
|
77
|
-
children.push('\n');
|
|
78
|
-
children.push(react_1.default.createElement(Text, { key: `sm-${i}`, color: theme_1.THEME.dim }, ' Message: '));
|
|
79
|
-
children.push(react_1.default.createElement(Text, { key: `smv-${i}`, color: theme_1.THEME.textMuted || theme_1.THEME.dim }, `"${msgPreview}"`));
|
|
80
|
-
// Timing details
|
|
81
|
-
const timingParts = [];
|
|
82
|
-
if (s.type === 'interval' && s.interval) {
|
|
83
|
-
timingParts.push(`every ${formatInterval(s.interval)}`);
|
|
84
|
-
}
|
|
85
|
-
if (s.cronExpression) {
|
|
86
|
-
timingParts.push(`cron: ${s.cronExpression}`);
|
|
87
|
-
if (s.timezone)
|
|
88
|
-
timingParts.push(`tz: ${s.timezone}`);
|
|
89
|
-
}
|
|
90
|
-
if (s.nextFireAt) {
|
|
91
|
-
timingParts.push(`next: ${formatDateTime(s.nextFireAt)}`);
|
|
92
|
-
}
|
|
93
|
-
if (s.firedCount > 0) {
|
|
94
|
-
timingParts.push(`fired ${s.firedCount}x`);
|
|
95
|
-
}
|
|
96
|
-
if (s.remainingCount !== undefined) {
|
|
97
|
-
timingParts.push(`${s.remainingCount} remaining`);
|
|
98
|
-
}
|
|
99
|
-
if (s.until) {
|
|
100
|
-
timingParts.push(`until ${formatDateTime(s.until)}`);
|
|
101
|
-
}
|
|
102
|
-
if (timingParts.length > 0) {
|
|
103
|
-
children.push('\n');
|
|
104
|
-
children.push(react_1.default.createElement(Text, { key: `sd-${i}`, color: theme_1.THEME.dim }, ` ${timingParts.join(' \u00B7 ')}`));
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
children.push('\n\n');
|
|
109
|
-
children.push(react_1.default.createElement(Text, { key: 'hint', color: theme_1.THEME.dim }, ' /schedule create \u2014 new \u00B7 /schedule delete <name> \u2014 remove'));
|
|
110
|
-
children.push('\n');
|
|
111
|
-
children.push(react_1.default.createElement(Text, { key: 'hint2', color: theme_1.THEME.dim }, ' Esc to dismiss'));
|
|
112
|
-
return react_1.default.createElement(Text, null, ...children);
|
|
113
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Top bar — shows ensemble name, player count, and keybindings.
|
|
3
|
-
*/
|
|
4
|
-
import React from 'react';
|
|
5
|
-
export interface TopBarProps {
|
|
6
|
-
ensemble: string;
|
|
7
|
-
playerCount: number;
|
|
8
|
-
connected: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare function TopBar({ ensemble, playerCount, connected }: TopBarProps): React.FunctionComponentElement<{
|
|
11
|
-
paddingX: number;
|
|
12
|
-
}>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TopBar = TopBar;
|
|
7
|
-
/**
|
|
8
|
-
* Top bar — shows ensemble name, player count, and keybindings.
|
|
9
|
-
*/
|
|
10
|
-
const react_1 = __importDefault(require("react"));
|
|
11
|
-
const ink_context_1 = require("../ink-context");
|
|
12
|
-
function TopBar({ ensemble, playerCount, connected }) {
|
|
13
|
-
const { Box, Text, Spacer } = (0, ink_context_1.useInk)();
|
|
14
|
-
return react_1.default.createElement(Box, { paddingX: 1 }, react_1.default.createElement(Text, { bold: true, color: 'cyan' }, 'claude-tempo'), react_1.default.createElement(Text, null, ' | '), react_1.default.createElement(Text, { color: connected ? 'green' : 'red' }, ensemble), react_1.default.createElement(Text, null, ' | '), react_1.default.createElement(Text, { dimColor: true }, `${playerCount} player${playerCount !== 1 ? 's' : ''}`), react_1.default.createElement(Spacer, null), react_1.default.createElement(Text, { dimColor: true }, 'q: quit tab: switch panel'));
|
|
15
|
-
}
|
package/dist/tui/core-api.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core API for the TUI — wraps Temporal client queries to the Maestro and conductor workflows.
|
|
3
|
-
* Pure TypeScript, no Ink/React dependency. Used by hooks in the TUI layer.
|
|
4
|
-
*/
|
|
5
|
-
import { Client } from '@temporalio/client';
|
|
6
|
-
import type { MaestroPlayerInfo, MaestroEvent, MaestroPendingCommand, HistoryEntry } from '../types';
|
|
7
|
-
export interface TuiApi {
|
|
8
|
-
/** Query current player snapshot from Maestro. */
|
|
9
|
-
getPlayers(): Promise<MaestroPlayerInfo[]>;
|
|
10
|
-
/** Query event log from Maestro. */
|
|
11
|
-
getEvents(limit?: number): Promise<MaestroEvent[]>;
|
|
12
|
-
/** Query pending commands from Maestro. */
|
|
13
|
-
getPendingCommands(): Promise<MaestroPendingCommand[]>;
|
|
14
|
-
/** Send a command to the conductor via Maestro's update handler. */
|
|
15
|
-
sendCommand(text: string, source: string): Promise<string>;
|
|
16
|
-
/** Query conductor command/report history. */
|
|
17
|
-
getConductorHistory(): Promise<HistoryEntry[]>;
|
|
18
|
-
/** Check if Maestro workflow is running. */
|
|
19
|
-
isConnected(): Promise<boolean>;
|
|
20
|
-
/** Ensemble name. */
|
|
21
|
-
ensemble: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Create a TUI API instance bound to a Temporal client and ensemble.
|
|
25
|
-
*/
|
|
26
|
-
export declare function createTuiApi(client: Client, ensemble: string): TuiApi;
|
package/dist/tui/core-api.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createTuiApi = createTuiApi;
|
|
4
|
-
const config_1 = require("../config");
|
|
5
|
-
/**
|
|
6
|
-
* Create a TUI API instance bound to a Temporal client and ensemble.
|
|
7
|
-
*/
|
|
8
|
-
function createTuiApi(client, ensemble) {
|
|
9
|
-
const maestroWfId = (0, config_1.maestroWorkflowId)(ensemble);
|
|
10
|
-
const conductorWfId = (0, config_1.conductorWorkflowId)(ensemble);
|
|
11
|
-
return {
|
|
12
|
-
ensemble,
|
|
13
|
-
async getPlayers() {
|
|
14
|
-
try {
|
|
15
|
-
const handle = client.workflow.getHandle(maestroWfId);
|
|
16
|
-
return await handle.query('maestroPlayers');
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
return [];
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
async getEvents(limit) {
|
|
23
|
-
try {
|
|
24
|
-
const handle = client.workflow.getHandle(maestroWfId);
|
|
25
|
-
const events = await handle.query('maestroEvents');
|
|
26
|
-
return limit ? events.slice(-limit) : events;
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
return [];
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
async getPendingCommands() {
|
|
33
|
-
try {
|
|
34
|
-
const handle = client.workflow.getHandle(maestroWfId);
|
|
35
|
-
return await handle.query('maestroPendingCommands');
|
|
36
|
-
}
|
|
37
|
-
catch {
|
|
38
|
-
return [];
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
async sendCommand(text, source) {
|
|
42
|
-
const handle = client.workflow.getHandle(maestroWfId);
|
|
43
|
-
return await handle.executeUpdate('maestroSendCommand', {
|
|
44
|
-
args: [{ text, source }],
|
|
45
|
-
});
|
|
46
|
-
},
|
|
47
|
-
async getConductorHistory() {
|
|
48
|
-
try {
|
|
49
|
-
const handle = client.workflow.getHandle(conductorWfId);
|
|
50
|
-
return await handle.query('history');
|
|
51
|
-
}
|
|
52
|
-
catch {
|
|
53
|
-
return [];
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
async isConnected() {
|
|
57
|
-
try {
|
|
58
|
-
const handle = client.workflow.getHandle(maestroWfId);
|
|
59
|
-
const desc = await handle.describe();
|
|
60
|
-
return desc.status.name === 'RUNNING';
|
|
61
|
-
}
|
|
62
|
-
catch {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useEnsembleDiscovery = useEnsembleDiscovery;
|
|
4
|
-
/**
|
|
5
|
-
* Hook that polls for all running ensembles across the Temporal namespace.
|
|
6
|
-
* Used by the ensemble list view.
|
|
7
|
-
*/
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const DISCOVERY_INTERVAL_MS = 5000;
|
|
10
|
-
function useEnsembleDiscovery(api, taskQueue, dispatch, enabled) {
|
|
11
|
-
const apiRef = (0, react_1.useRef)(api);
|
|
12
|
-
apiRef.current = api;
|
|
13
|
-
(0, react_1.useEffect)(() => {
|
|
14
|
-
if (!enabled)
|
|
15
|
-
return;
|
|
16
|
-
const poll = async () => {
|
|
17
|
-
try {
|
|
18
|
-
const ensembles = await apiRef.current.discoverEnsembles(taskQueue);
|
|
19
|
-
dispatch({ type: 'DISCOVER_ENSEMBLES', ensembles });
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
// Silently skip failed polls
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
// Initial poll
|
|
26
|
-
poll();
|
|
27
|
-
const interval = setInterval(poll, DISCOVERY_INTERVAL_MS);
|
|
28
|
-
return () => clearInterval(interval);
|
|
29
|
-
}, [taskQueue, dispatch, enabled]);
|
|
30
|
-
}
|