@coresource/hz 0.1.4 → 0.1.5
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/dist/hz.mjs +27 -4
- package/package.json +1 -1
package/dist/hz.mjs
CHANGED
|
@@ -642,9 +642,6 @@ function normalizeMissionMilestones(value) {
|
|
|
642
642
|
};
|
|
643
643
|
});
|
|
644
644
|
}
|
|
645
|
-
function truncateMissionId(missionId, limit = 12) {
|
|
646
|
-
return missionId.length > limit ? `${missionId.slice(0, limit)}\u2026` : missionId;
|
|
647
|
-
}
|
|
648
645
|
function formatMissionState(state) {
|
|
649
646
|
switch (state) {
|
|
650
647
|
case "completed":
|
|
@@ -740,7 +737,7 @@ function registerMissionListCommand(mission, context, dependencies = {}) {
|
|
|
740
737
|
context.stdout,
|
|
741
738
|
["Mission ID", "State", "Created", "Features", "Assertions"],
|
|
742
739
|
missions.map((missionSummary) => [
|
|
743
|
-
plainCell(
|
|
740
|
+
plainCell(missionSummary.missionId),
|
|
744
741
|
coloredCell(
|
|
745
742
|
formatMissionState(missionSummary.state),
|
|
746
743
|
missionSummary.state
|
|
@@ -2918,6 +2915,32 @@ function registerMissionLifecycleCommands(mission, context, dependencies = {}) {
|
|
|
2918
2915
|
dependencies
|
|
2919
2916
|
);
|
|
2920
2917
|
});
|
|
2918
|
+
mission.command("watch").description("Watch a mission's live progress").argument("[missionId]").action(async (missionId, _options, command) => {
|
|
2919
|
+
const homeDir = resolveLifecycleHomeDir(context);
|
|
2920
|
+
const resolved = await resolveMissionId(missionId, context, command, homeDir);
|
|
2921
|
+
const { apiClient, authConfig } = await createMissionClientContext(
|
|
2922
|
+
context,
|
|
2923
|
+
command,
|
|
2924
|
+
dependencies,
|
|
2925
|
+
homeDir
|
|
2926
|
+
);
|
|
2927
|
+
const monitorResult = await monitorMission({
|
|
2928
|
+
apiClient,
|
|
2929
|
+
apiKey: authConfig.apiKey,
|
|
2930
|
+
createSpinner: dependencies.createSpinner,
|
|
2931
|
+
createWebSocket: dependencies.createWebSocket,
|
|
2932
|
+
endpoint: authConfig.endpoint,
|
|
2933
|
+
missionId: resolved,
|
|
2934
|
+
promptInput: dependencies.promptInput,
|
|
2935
|
+
promptSelect: dependencies.promptSelect,
|
|
2936
|
+
registerSignalHandler: dependencies.registerSignalHandler,
|
|
2937
|
+
sleep: dependencies.sleep,
|
|
2938
|
+
stdout: context.stdout
|
|
2939
|
+
});
|
|
2940
|
+
if (monitorResult.exitCode !== 0) {
|
|
2941
|
+
throw new CommanderError(monitorResult.exitCode, "mission-monitor", "");
|
|
2942
|
+
}
|
|
2943
|
+
});
|
|
2921
2944
|
}
|
|
2922
2945
|
|
|
2923
2946
|
// src/commands/mission-run.ts
|