@agimon-ai/po-workflow 0.0.0-alpha.195 → 0.0.0-alpha.196
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/extensions/native.mjs +639 -412
- package/dist/extensions/native.mjs.map +1 -1
- package/dist/extensions/web.mjs +902 -592
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/po-runtime-identity.json +1 -1
- package/package.json +10 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createApiClient, defineActivityGroup, defineChannelFile, defineDockFace, defineFill, defineNativePlugin, defineSessionChannel, defineSessionStore, defineToolRenderer, encodeBase64, nativeApiTransport, sessionApiAddress } from "@agimon-ai/po-core/native";
|
|
1
|
+
import { createApiClient, defineActivityGroup, defineChannelFile, defineDockFace, defineFill, defineNativePlugin, defineSessionChannel, defineSessionStore, defineToolRenderer, encodeBase64, nativeApiTransport, sessionApiAddress, t, useT } from "@agimon-ai/po-core/native";
|
|
2
2
|
import { View } from "react-native-unistyles/components/native/View";
|
|
3
3
|
import { Text } from "react-native-unistyles/components/native/Text";
|
|
4
4
|
import { ScrollView } from "react-native-unistyles/components/native/ScrollView";
|
|
@@ -47,12 +47,15 @@ function jobLabel(run, job) {
|
|
|
47
47
|
*/
|
|
48
48
|
const MINUTE_MS = 6e4;
|
|
49
49
|
const HOUR_MS = 60 * MINUTE_MS;
|
|
50
|
-
function formatRunDuration(elapsedMs) {
|
|
51
|
-
if (elapsedMs < MINUTE_MS) return "<1m";
|
|
52
|
-
if (elapsedMs < HOUR_MS) return `${Math.floor(elapsedMs / MINUTE_MS)}m`;
|
|
50
|
+
function formatRunDuration(elapsedMs, t) {
|
|
51
|
+
if (elapsedMs < MINUTE_MS) return t?.("workflow.duration.lessThanMinute", "<1m") ?? "<1m";
|
|
52
|
+
if (elapsedMs < HOUR_MS) return t?.("workflow.duration.minutes", "{minutes}m", { minutes: Math.floor(elapsedMs / MINUTE_MS) }) ?? `${Math.floor(elapsedMs / MINUTE_MS)}m`;
|
|
53
53
|
const hours = Math.floor(elapsedMs / HOUR_MS);
|
|
54
54
|
const minutes = Math.floor(elapsedMs % HOUR_MS / MINUTE_MS);
|
|
55
|
-
return
|
|
55
|
+
return t?.("workflow.duration.hoursMinutes", "{hours}h {minutes}m", {
|
|
56
|
+
hours,
|
|
57
|
+
minutes: String(minutes).padStart(2, "0")
|
|
58
|
+
}) ?? `${hours}h ${String(minutes).padStart(2, "0")}m`;
|
|
56
59
|
}
|
|
57
60
|
//#endregion
|
|
58
61
|
//#region src/extensions/workspaces/sessions/(frontend)/_lib/workflowActivity.ts
|
|
@@ -412,11 +415,11 @@ function openCatalog(sessionId, prompt = "") {
|
|
|
412
415
|
if (result.ok) workflowCatalogChannel.apply(sessionId, result.data);
|
|
413
416
|
else catalog.update(sessionId, (current) => ({
|
|
414
417
|
...current,
|
|
415
|
-
warning: result.error || "The workflow catalog could not be refreshed."
|
|
418
|
+
warning: result.error || t("workflow.ui.catalogRefreshFailed", "The workflow catalog could not be refreshed.")
|
|
416
419
|
}));
|
|
417
420
|
}, () => catalog.update(sessionId, (current) => ({
|
|
418
421
|
...current,
|
|
419
|
-
warning: "The workflow catalog could not be refreshed."
|
|
422
|
+
warning: t("workflow.ui.catalogRefreshFailed", "The workflow catalog could not be refreshed.")
|
|
420
423
|
})));
|
|
421
424
|
}
|
|
422
425
|
function closeCatalog(sessionId) {
|
|
@@ -835,28 +838,31 @@ const ACTIVE_STATES = /* @__PURE__ */ new Set([
|
|
|
835
838
|
"pause_requested",
|
|
836
839
|
"paused"
|
|
837
840
|
]);
|
|
838
|
-
function attentionFor(run) {
|
|
841
|
+
function attentionFor(run, t = (_key, english, vars) => english.replace(/\{(\w+)\}/g, (match, key) => String(vars?.[key] ?? match))) {
|
|
839
842
|
if (run.waiting) {
|
|
840
843
|
const step = activeSteps(run)[0]?.step.name ?? run.position?.step;
|
|
841
844
|
return {
|
|
842
845
|
kind: "waiting",
|
|
843
|
-
text: step === void 0 ? "the run is waiting for your approval" :
|
|
846
|
+
text: step === void 0 ? t("workflow.ui.attention.waiting", "the run is waiting for your approval") : t("workflow.ui.attention.stepWaiting", "step \"{step}\" is waiting for your approval", { step })
|
|
844
847
|
};
|
|
845
848
|
}
|
|
846
849
|
if (run.stage === "error") {
|
|
847
|
-
const cause = run.errorMessage ?? "the run ended in the error stage";
|
|
850
|
+
const cause = run.errorMessage ?? t("workflow.ui.attention.error", "the run ended in the error stage");
|
|
848
851
|
return {
|
|
849
852
|
kind: "error",
|
|
850
|
-
text: run.failedJob === void 0 ? cause :
|
|
853
|
+
text: run.failedJob === void 0 ? cause : t("workflow.ui.attention.jobFailed", "job '{job}' failed: {cause}", {
|
|
854
|
+
job: run.failedJob,
|
|
855
|
+
cause
|
|
856
|
+
})
|
|
851
857
|
};
|
|
852
858
|
}
|
|
853
859
|
if (run.stale === true) return {
|
|
854
860
|
kind: "stale",
|
|
855
|
-
text: run.staleReason ?? "the process that ran this workflow is gone"
|
|
861
|
+
text: run.staleReason ?? t("workflow.ui.attention.stale", "the process that ran this workflow is gone")
|
|
856
862
|
};
|
|
857
863
|
if (run.executionState === "paused" || run.executionState === "pause_requested") return {
|
|
858
864
|
kind: "paused",
|
|
859
|
-
text: "the run is paused and will not move until it is resumed"
|
|
865
|
+
text: t("workflow.ui.attention.paused", "the run is paused and will not move until it is resumed")
|
|
860
866
|
};
|
|
861
867
|
}
|
|
862
868
|
function runState(run) {
|
|
@@ -896,6 +902,30 @@ function runSearchText(run) {
|
|
|
896
902
|
run.position?.step
|
|
897
903
|
].filter((part) => typeof part === "string").join(" ").toLowerCase();
|
|
898
904
|
}
|
|
905
|
+
/** Person-facing labels only. Keep raw states for filtering and protocol data. */
|
|
906
|
+
function workflowStateLabel(t, state) {
|
|
907
|
+
switch (state) {
|
|
908
|
+
case "pending": return t("workflow.ui.state.pending", "Pending");
|
|
909
|
+
case "running": return t("workflow.ui.state.running", "Running");
|
|
910
|
+
case "resumed": return t("workflow.ui.state.resumed", "Resumed");
|
|
911
|
+
case "completed": return t("workflow.ui.state.completed", "Completed");
|
|
912
|
+
case "failed": return t("workflow.ui.state.failed", "Failed");
|
|
913
|
+
case "skipped": return t("workflow.ui.state.skipped", "Skipped");
|
|
914
|
+
case "pause_requested": return t("workflow.ui.state.pause_requested", "Pause requested");
|
|
915
|
+
case "paused": return t("workflow.ui.state.paused", "Paused");
|
|
916
|
+
case "waiting": return t("workflow.ui.state.waiting", "Waiting");
|
|
917
|
+
case "success": return t("workflow.ui.state.success", "Success");
|
|
918
|
+
case "error": return t("workflow.ui.state.error", "Error");
|
|
919
|
+
case "interrupted": return t("workflow.ui.state.interrupted", "Interrupted");
|
|
920
|
+
case "stopped": return t("workflow.ui.state.stopped", "Stopped");
|
|
921
|
+
case "done": return t("workflow.ui.state.done", "Done");
|
|
922
|
+
case "all": return t("workflow.ui.state.all", "All");
|
|
923
|
+
case "starting": return t("workflow.ui.state.starting", "Starting");
|
|
924
|
+
case "stale": return t("workflow.ui.state.stale", "Stale");
|
|
925
|
+
case "finished": return t("workflow.ui.state.finished", "Finished");
|
|
926
|
+
default: return state;
|
|
927
|
+
}
|
|
928
|
+
}
|
|
899
929
|
//#endregion
|
|
900
930
|
//#region src/constants/dynamicWorkflow.ts
|
|
901
931
|
const DYNAMIC_WORKFLOW_CHANNEL = "dynamic_workflow_runs";
|
|
@@ -1003,34 +1033,53 @@ const WORKFLOW_STATUS = {
|
|
|
1003
1033
|
tone: "neutral"
|
|
1004
1034
|
}
|
|
1005
1035
|
};
|
|
1006
|
-
function
|
|
1036
|
+
function workflowStatusLabel(t, status) {
|
|
1037
|
+
switch (status) {
|
|
1038
|
+
case "pending": return t("workflow.dynamic.state.pending", "Pending");
|
|
1039
|
+
case "running": return t("workflow.dynamic.state.running", "Running");
|
|
1040
|
+
case "completed": return t("workflow.dynamic.state.completed", "Done");
|
|
1041
|
+
case "failed": return t("workflow.dynamic.state.failed", "Failed");
|
|
1042
|
+
case "stopped": return t("workflow.dynamic.state.stopped", "Stopped");
|
|
1043
|
+
case "skipped": return t("workflow.dynamic.state.skipped", "Skipped");
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
function groupSummary(group, t) {
|
|
1007
1047
|
const count = (status) => group.counts[status];
|
|
1008
|
-
const parts = [
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1048
|
+
const parts = [t("workflow.dynamic.runningOf", "{count} of {total} running", {
|
|
1049
|
+
count: count("running"),
|
|
1050
|
+
total: group.total
|
|
1051
|
+
}), t("workflow.dynamic.completed", "{count} done", { count: count("completed") })];
|
|
1052
|
+
if (count("failed")) parts.push(t("workflow.dynamic.failed", "{count} failed", { count: count("failed") }));
|
|
1053
|
+
if (count("stopped")) parts.push(t("workflow.dynamic.stopped", "{count} stopped", { count: count("stopped") }));
|
|
1054
|
+
if (count("skipped")) parts.push(t("workflow.dynamic.skipped", "{count} skipped", { count: count("skipped") }));
|
|
1012
1055
|
return parts.join(" · ");
|
|
1013
1056
|
}
|
|
1014
|
-
function activitySummary(runs) {
|
|
1015
|
-
if (!runs.length) return "Workflows appear here when Po starts them.";
|
|
1016
|
-
return
|
|
1057
|
+
function activitySummary(runs, t) {
|
|
1058
|
+
if (!runs.length) return t("workflow.dynamic.appears", "Workflows appear here when Po starts them.");
|
|
1059
|
+
return t("workflow.dynamic.summary", "{running} running · {finished} finished", {
|
|
1060
|
+
running: runs.filter((run) => run.status === "running").length,
|
|
1061
|
+
finished: runs.filter((run) => run.status !== "running" && run.status !== "pending").length
|
|
1062
|
+
});
|
|
1017
1063
|
}
|
|
1018
1064
|
/** One line for the dynamic workflows a workflow step's agent started, e.g. `2 dynamic runs · 1 failed`. */
|
|
1019
|
-
function stepRunsSummary(runs) {
|
|
1065
|
+
function stepRunsSummary(runs, t) {
|
|
1020
1066
|
const running = runs.filter((run) => run.status === "running").length;
|
|
1021
1067
|
const failed = runs.filter((run) => run.status === "failed").length;
|
|
1022
|
-
const parts = [
|
|
1023
|
-
if (running) parts.push(
|
|
1068
|
+
const parts = [runs.length === 1 ? t("workflow.dynamic.runs.one", "{count} dynamic run", { count: runs.length }) : t("workflow.dynamic.runs.many", "{count} dynamic runs", { count: runs.length })];
|
|
1069
|
+
if (running) parts.push(t("workflow.dynamic.running", "{count} running", { count: running }));
|
|
1024
1070
|
return {
|
|
1025
1071
|
text: parts.join(" · "),
|
|
1026
1072
|
failed
|
|
1027
1073
|
};
|
|
1028
1074
|
}
|
|
1029
|
-
function workflowDuration(startedAt, finishedAt, now = 0) {
|
|
1030
|
-
if (startedAt === void 0) return "Not started";
|
|
1075
|
+
function workflowDuration(startedAt, finishedAt, now = 0, t) {
|
|
1076
|
+
if (startedAt === void 0) return t?.("workflow.artifacts.pending", "Not started") ?? "Not started";
|
|
1031
1077
|
const seconds = Math.max(0, Math.floor(((finishedAt ?? now) - startedAt) / 1e3));
|
|
1032
|
-
if (seconds < 60) return `${seconds}s`;
|
|
1033
|
-
return
|
|
1078
|
+
if (seconds < 60) return t?.("workflow.duration.seconds", "{seconds}s", { seconds }) ?? `${seconds}s`;
|
|
1079
|
+
return t?.("workflow.duration.minutesSeconds", "{minutes}m {seconds}s", {
|
|
1080
|
+
minutes: Math.floor(seconds / 60),
|
|
1081
|
+
seconds: seconds % 60
|
|
1082
|
+
}) ?? `${Math.floor(seconds / 60)}m ${seconds % 60}s`;
|
|
1034
1083
|
}
|
|
1035
1084
|
const statusDot = (status) => status === "completed" ? "green" : status === "running" ? "yellow" : status === "failed" ? "red" : "neutral";
|
|
1036
1085
|
function activityCounts(run) {
|
|
@@ -1048,13 +1097,14 @@ function activityCounts(run) {
|
|
|
1048
1097
|
//#region src/extensions/workspaces/sessions/(frontend)/_components/WorkflowDuration.native.tsx
|
|
1049
1098
|
/** Bare workflow durations, updated without reconciling even the text leaf. */
|
|
1050
1099
|
function WorkflowDuration({ startedAt, endedAt, now, seconds = false, running = true, style }) {
|
|
1100
|
+
const t = useT();
|
|
1051
1101
|
const start = typeof startedAt === "string" ? Date.parse(startedAt) : startedAt;
|
|
1052
1102
|
const end = typeof endedAt === "string" ? Date.parse(endedAt) : endedAt;
|
|
1053
1103
|
const clock = useCallback((clockNow) => {
|
|
1054
1104
|
const at = now ?? clockNow;
|
|
1055
|
-
if (start === void 0 || !Number.isFinite(start)) return { text: seconds ? "Not started" : "" };
|
|
1105
|
+
if (start === void 0 || !Number.isFinite(start)) return { text: seconds ? t("workflow.artifacts.pending", "Not started") : "" };
|
|
1056
1106
|
if (end !== void 0 && !Number.isFinite(end)) return { text: "" };
|
|
1057
|
-
const text = seconds ? workflowDuration(start, end, at) : formatRunDuration(Math.max(0, (end ?? at) - start));
|
|
1107
|
+
const text = seconds ? workflowDuration(start, end, at, t) : formatRunDuration(Math.max(0, (end ?? at) - start), t);
|
|
1058
1108
|
return now === void 0 && running && end === void 0 ? {
|
|
1059
1109
|
text,
|
|
1060
1110
|
nextMs: seconds ? 1e3 : 1e4
|
|
@@ -1064,7 +1114,8 @@ function WorkflowDuration({ startedAt, endedAt, now, seconds = false, running =
|
|
|
1064
1114
|
end,
|
|
1065
1115
|
now,
|
|
1066
1116
|
seconds,
|
|
1067
|
-
running
|
|
1117
|
+
running,
|
|
1118
|
+
t
|
|
1068
1119
|
]);
|
|
1069
1120
|
return /* @__PURE__ */ jsx(LiveDuration, {
|
|
1070
1121
|
clock,
|
|
@@ -1074,30 +1125,31 @@ function WorkflowDuration({ startedAt, endedAt, now, seconds = false, running =
|
|
|
1074
1125
|
//#endregion
|
|
1075
1126
|
//#region src/extensions/workspaces/sessions/(frontend)/_components/DynamicWorkflowView.native.tsx
|
|
1076
1127
|
function DynamicWorkflowActivity({ runs, connected = true, onOpen }) {
|
|
1128
|
+
const t = useT();
|
|
1077
1129
|
return /* @__PURE__ */ jsxs(View, {
|
|
1078
1130
|
style: styles$9.run,
|
|
1079
1131
|
children: [
|
|
1080
1132
|
/* @__PURE__ */ jsx(Text, {
|
|
1081
1133
|
style: styles$9.dim,
|
|
1082
|
-
children: connected ? activitySummary(runs) : "Connection paused. Showing last update."
|
|
1134
|
+
children: connected ? activitySummary(runs, t) : t("workflow.extra.connectionPausedShowingLastUpdate", "Connection paused. Showing last update.")
|
|
1083
1135
|
}),
|
|
1084
1136
|
!runs.length && /* @__PURE__ */ jsxs(Button, {
|
|
1085
1137
|
variant: "ghost",
|
|
1086
1138
|
size: "card",
|
|
1087
1139
|
onPress: onOpen,
|
|
1088
|
-
accessibilityLabel: "Open dynamic workflows",
|
|
1140
|
+
accessibilityLabel: t("workflow.ui.openDynamicWorkflows", "Open dynamic workflows"),
|
|
1089
1141
|
children: [
|
|
1090
1142
|
/* @__PURE__ */ jsx(Text, {
|
|
1091
1143
|
style: styles$9.itemTitle,
|
|
1092
|
-
children: "No workflows yet"
|
|
1144
|
+
children: t("workflow.ui.noWorkflowsYet", "No workflows yet")
|
|
1093
1145
|
}),
|
|
1094
1146
|
/* @__PURE__ */ jsx(Text, {
|
|
1095
1147
|
style: styles$9.dim,
|
|
1096
|
-
children: "Idle"
|
|
1148
|
+
children: t("workflow.ui.idle", "Idle")
|
|
1097
1149
|
}),
|
|
1098
1150
|
/* @__PURE__ */ jsx(Text, {
|
|
1099
1151
|
style: styles$9.link,
|
|
1100
|
-
children: "View workflows →"
|
|
1152
|
+
children: t("workflow.ui.viewWorkflows", "View workflows →")
|
|
1101
1153
|
})
|
|
1102
1154
|
]
|
|
1103
1155
|
}),
|
|
@@ -1106,7 +1158,7 @@ function DynamicWorkflowActivity({ runs, connected = true, onOpen }) {
|
|
|
1106
1158
|
return /* @__PURE__ */ jsxs(Pressable, {
|
|
1107
1159
|
onPress: onOpen,
|
|
1108
1160
|
accessibilityRole: "button",
|
|
1109
|
-
accessibilityLabel:
|
|
1161
|
+
accessibilityLabel: t("workflow.ui.openRun", "Open {name}", { name: run.label }),
|
|
1110
1162
|
style: styles$9.activityRow,
|
|
1111
1163
|
children: [/* @__PURE__ */ jsxs(View, {
|
|
1112
1164
|
style: styles$9.inline,
|
|
@@ -1121,7 +1173,7 @@ function DynamicWorkflowActivity({ runs, connected = true, onOpen }) {
|
|
|
1121
1173
|
}),
|
|
1122
1174
|
/* @__PURE__ */ jsxs(Text, {
|
|
1123
1175
|
style: styles$9.dim,
|
|
1124
|
-
children: [
|
|
1176
|
+
children: [workflowStatusLabel(t, run.status), " ›"]
|
|
1125
1177
|
})
|
|
1126
1178
|
]
|
|
1127
1179
|
}), counts.total > 0 && /* @__PURE__ */ jsxs(View, {
|
|
@@ -1129,23 +1181,33 @@ function DynamicWorkflowActivity({ runs, connected = true, onOpen }) {
|
|
|
1129
1181
|
children: [/* @__PURE__ */ jsxs(Text, {
|
|
1130
1182
|
style: styles$9.dim,
|
|
1131
1183
|
children: [
|
|
1132
|
-
run.status === "running" ?
|
|
1184
|
+
run.status === "running" ? t("workflow.dynamic.runningOf", "{count} of {total} running", {
|
|
1185
|
+
count: counts.running,
|
|
1186
|
+
total: counts.total
|
|
1187
|
+
}) : t("workflow.ui.itemCount", "{count} items", { count: counts.total }),
|
|
1133
1188
|
" ",
|
|
1134
1189
|
"· ",
|
|
1135
1190
|
counts.done,
|
|
1136
|
-
"
|
|
1191
|
+
" ",
|
|
1192
|
+
t("workflow.ui.done.lowercase", "done"),
|
|
1137
1193
|
counts.failed > 0 && /* @__PURE__ */ jsxs(Text, {
|
|
1138
1194
|
style: styles$9.error,
|
|
1139
1195
|
children: [
|
|
1140
|
-
"
|
|
1196
|
+
" ",
|
|
1197
|
+
"· ",
|
|
1141
1198
|
counts.failed,
|
|
1142
|
-
"
|
|
1199
|
+
" ",
|
|
1200
|
+
t("workflow.ui.failed.lowercase", "failed")
|
|
1143
1201
|
]
|
|
1144
1202
|
})
|
|
1145
1203
|
]
|
|
1146
1204
|
}), /* @__PURE__ */ jsxs(View, {
|
|
1147
1205
|
style: styles$9.progress,
|
|
1148
|
-
accessibilityLabel:
|
|
1206
|
+
accessibilityLabel: t("workflow.ui.progressCounts", "{done} done, {running} running, {total} total", {
|
|
1207
|
+
done: counts.done,
|
|
1208
|
+
running: counts.running,
|
|
1209
|
+
total: counts.total
|
|
1210
|
+
}),
|
|
1149
1211
|
children: [/* @__PURE__ */ jsx(View, { style: [styles$9.progressDone, { width: `${counts.done / counts.total * 100}%` }] }), /* @__PURE__ */ jsx(View, { style: [styles$9.progressRunning, { width: `${counts.running / counts.total * 100}%` }] })]
|
|
1150
1212
|
})]
|
|
1151
1213
|
})]
|
|
@@ -1155,6 +1217,7 @@ function DynamicWorkflowActivity({ runs, connected = true, onOpen }) {
|
|
|
1155
1217
|
});
|
|
1156
1218
|
}
|
|
1157
1219
|
function PhaseTrack({ shape, phases }) {
|
|
1220
|
+
const t = useT();
|
|
1158
1221
|
if (shape.kind === "step") {
|
|
1159
1222
|
const phase = phases.find((entry) => entry.key === shape.key);
|
|
1160
1223
|
return phase ? /* @__PURE__ */ jsx(View, {
|
|
@@ -1164,7 +1227,7 @@ function PhaseTrack({ shape, phases }) {
|
|
|
1164
1227
|
children: [
|
|
1165
1228
|
phase.label,
|
|
1166
1229
|
" · ",
|
|
1167
|
-
|
|
1230
|
+
workflowStatusLabel(t, phase.status)
|
|
1168
1231
|
]
|
|
1169
1232
|
})
|
|
1170
1233
|
}) : null;
|
|
@@ -1176,7 +1239,7 @@ function PhaseTrack({ shape, phases }) {
|
|
|
1176
1239
|
style: grouped ? styles$9.phaseGroup : styles$9.phaseSequence,
|
|
1177
1240
|
children: [grouped && /* @__PURE__ */ jsx(Text, {
|
|
1178
1241
|
style: styles$9.dim,
|
|
1179
|
-
children: shape.kind === "parallel" ? "Parallel" : "Branch"
|
|
1242
|
+
children: shape.kind === "parallel" ? t("workflow.extra.parallel", "Parallel") : t("workflow.extra.branch", "Branch")
|
|
1180
1243
|
}), shape.children.map((child) => /* @__PURE__ */ jsx(PhaseTrack, {
|
|
1181
1244
|
shape: child,
|
|
1182
1245
|
phases
|
|
@@ -1184,6 +1247,7 @@ function PhaseTrack({ shape, phases }) {
|
|
|
1184
1247
|
});
|
|
1185
1248
|
}
|
|
1186
1249
|
function ItemRow({ item, run, now, defaultExpanded, onOpenAgent }) {
|
|
1250
|
+
const t = useT();
|
|
1187
1251
|
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
1188
1252
|
return /* @__PURE__ */ jsxs(View, {
|
|
1189
1253
|
style: styles$9.item,
|
|
@@ -1191,7 +1255,7 @@ function ItemRow({ item, run, now, defaultExpanded, onOpenAgent }) {
|
|
|
1191
1255
|
/* @__PURE__ */ jsxs(Pressable, {
|
|
1192
1256
|
onPress: () => setExpanded(!expanded),
|
|
1193
1257
|
accessibilityRole: "button",
|
|
1194
|
-
accessibilityLabel: `${item.label}, ${
|
|
1258
|
+
accessibilityLabel: `${item.label}, ${workflowStatusLabel(t, item.status)}`,
|
|
1195
1259
|
accessibilityState: { expanded },
|
|
1196
1260
|
style: styles$9.toggle,
|
|
1197
1261
|
children: [
|
|
@@ -1205,7 +1269,7 @@ function ItemRow({ item, run, now, defaultExpanded, onOpenAgent }) {
|
|
|
1205
1269
|
}),
|
|
1206
1270
|
/* @__PURE__ */ jsx(StatusBadge, {
|
|
1207
1271
|
tone: WORKFLOW_STATUS[item.status].tone,
|
|
1208
|
-
children:
|
|
1272
|
+
children: workflowStatusLabel(t, item.status)
|
|
1209
1273
|
})
|
|
1210
1274
|
]
|
|
1211
1275
|
}),
|
|
@@ -1235,9 +1299,9 @@ function ItemRow({ item, run, now, defaultExpanded, onOpenAgent }) {
|
|
|
1235
1299
|
now
|
|
1236
1300
|
})]
|
|
1237
1301
|
}),
|
|
1238
|
-
phase.executionStatus !== phase.status && /* @__PURE__ */
|
|
1302
|
+
phase.executionStatus !== phase.status && /* @__PURE__ */ jsx(Text, {
|
|
1239
1303
|
style: styles$9.dim,
|
|
1240
|
-
children:
|
|
1304
|
+
children: t("workflow.ui.stepExecutionState", "Step: {state}", { state: workflowStatusLabel(t, phase.executionStatus) })
|
|
1241
1305
|
}),
|
|
1242
1306
|
phase.error && /* @__PURE__ */ jsx(Text, {
|
|
1243
1307
|
accessibilityRole: phase.status === "failed" ? "alert" : void 0,
|
|
@@ -1246,24 +1310,23 @@ function ItemRow({ item, run, now, defaultExpanded, onOpenAgent }) {
|
|
|
1246
1310
|
}),
|
|
1247
1311
|
phase.agents.map((agent, index) => /* @__PURE__ */ jsxs(View, {
|
|
1248
1312
|
style: styles$9.inline,
|
|
1249
|
-
children: [/* @__PURE__ */
|
|
1313
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
1250
1314
|
variant: "link",
|
|
1251
1315
|
size: "sm",
|
|
1252
1316
|
onPress: () => onOpenAgent(agent.runId, agent.session),
|
|
1253
|
-
accessibilityLabel:
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
]
|
|
1317
|
+
accessibilityLabel: t("workflow.ui.openAgentTranscript", "Open {name} agent {number} transcript", {
|
|
1318
|
+
name: phase.label,
|
|
1319
|
+
number: index + 1
|
|
1320
|
+
}),
|
|
1321
|
+
children: t("workflow.ui.agentTranscriptNumber", "Agent {number} transcript ↗", { number: index + 1 })
|
|
1259
1322
|
}), /* @__PURE__ */ jsx(StatusBadge, {
|
|
1260
1323
|
tone: WORKFLOW_STATUS[agent.status].tone,
|
|
1261
|
-
children:
|
|
1324
|
+
children: workflowStatusLabel(t, agent.status)
|
|
1262
1325
|
})]
|
|
1263
1326
|
}, agent.runId)),
|
|
1264
1327
|
!phase.agents.length && /* @__PURE__ */ jsx(Text, {
|
|
1265
1328
|
style: styles$9.dim,
|
|
1266
|
-
children: "No agent transcript"
|
|
1329
|
+
children: t("workflow.ui.noAgentTranscript", "No agent transcript")
|
|
1267
1330
|
})
|
|
1268
1331
|
]
|
|
1269
1332
|
}, phase.key))
|
|
@@ -1272,21 +1335,26 @@ function ItemRow({ item, run, now, defaultExpanded, onOpenAgent }) {
|
|
|
1272
1335
|
});
|
|
1273
1336
|
}
|
|
1274
1337
|
function DynamicWorkflowView({ runs, now, connected = true, defaultExpandedKeys = [], onOpenAgent }) {
|
|
1338
|
+
const t = useT();
|
|
1275
1339
|
return /* @__PURE__ */ jsxs(ScrollView, {
|
|
1276
1340
|
style: styles$9.screen,
|
|
1277
1341
|
contentContainerStyle: styles$9.content,
|
|
1278
|
-
accessibilityLabel: "Dynamic workflows",
|
|
1342
|
+
accessibilityLabel: t("workflow.ui.dynamicWorkflows", "Dynamic workflows"),
|
|
1279
1343
|
children: [
|
|
1280
|
-
!connected && /* @__PURE__ */
|
|
1344
|
+
!connected && /* @__PURE__ */ jsxs(Text, {
|
|
1281
1345
|
accessibilityRole: "alert",
|
|
1282
1346
|
style: styles$9.notice,
|
|
1283
|
-
children:
|
|
1347
|
+
children: [
|
|
1348
|
+
" ",
|
|
1349
|
+
t("workflow.ui.connectionPausedTheseAreTheLastReportedWorkflowStates", "Connection paused. These are the last reported workflow states."),
|
|
1350
|
+
" "
|
|
1351
|
+
]
|
|
1284
1352
|
}),
|
|
1285
1353
|
!runs.length && /* @__PURE__ */ jsx(EmptyState, {
|
|
1286
1354
|
surface: "plain",
|
|
1287
1355
|
icon: /* @__PURE__ */ jsx(WorkflowIcon, { size: 20 }),
|
|
1288
|
-
title: "No workflows yet",
|
|
1289
|
-
description: "Workflows appear here when Po starts them. You can carry on with your conversation."
|
|
1356
|
+
title: t("workflow.ui.noWorkflowsYet", "No workflows yet"),
|
|
1357
|
+
description: t("workflow.ui.workflowsAppearHereWhenPoStartsThemYouCanCarryOnWithYourConversation", "Workflows appear here when Po starts them. You can carry on with your conversation.")
|
|
1290
1358
|
}),
|
|
1291
1359
|
runs.map((run) => /* @__PURE__ */ jsxs(View, {
|
|
1292
1360
|
style: styles$9.run,
|
|
@@ -1299,7 +1367,7 @@ function DynamicWorkflowView({ runs, now, connected = true, defaultExpandedKeys
|
|
|
1299
1367
|
children: run.label
|
|
1300
1368
|
}), /* @__PURE__ */ jsx(StatusBadge, {
|
|
1301
1369
|
tone: WORKFLOW_STATUS[run.status].tone,
|
|
1302
|
-
children:
|
|
1370
|
+
children: workflowStatusLabel(t, run.status)
|
|
1303
1371
|
})]
|
|
1304
1372
|
}),
|
|
1305
1373
|
/* @__PURE__ */ jsxs(View, {
|
|
@@ -1313,7 +1381,7 @@ function DynamicWorkflowView({ runs, now, connected = true, defaultExpandedKeys
|
|
|
1313
1381
|
now
|
|
1314
1382
|
}), /* @__PURE__ */ jsx(Text, {
|
|
1315
1383
|
style: styles$9.dim,
|
|
1316
|
-
children: run.executionStatus !== run.status ?
|
|
1384
|
+
children: run.executionStatus !== run.status ? t("workflow.ui.executionStateCaption", " · Workflow execution: {state}", { state: workflowStatusLabel(t, run.executionStatus) }) : ""
|
|
1317
1385
|
})]
|
|
1318
1386
|
}),
|
|
1319
1387
|
run.error && /* @__PURE__ */ jsx(Text, {
|
|
@@ -1331,7 +1399,7 @@ function DynamicWorkflowView({ runs, now, connected = true, defaultExpandedKeys
|
|
|
1331
1399
|
}),
|
|
1332
1400
|
/* @__PURE__ */ jsxs(Text, {
|
|
1333
1401
|
style: styles$9.dim,
|
|
1334
|
-
children: [groupSummary(group), group.concurrency ?
|
|
1402
|
+
children: [groupSummary(group, t), group.concurrency ? t("workflow.ui.concurrencyCaption", " · Up to {count} at once", { count: group.concurrency }) : ""]
|
|
1335
1403
|
}),
|
|
1336
1404
|
group.items.map((item) => /* @__PURE__ */ jsx(ItemRow, {
|
|
1337
1405
|
item,
|
|
@@ -1340,15 +1408,12 @@ function DynamicWorkflowView({ runs, now, connected = true, defaultExpandedKeys
|
|
|
1340
1408
|
defaultExpanded: defaultExpandedKeys.includes(item.key),
|
|
1341
1409
|
onOpenAgent
|
|
1342
1410
|
}, item.key)),
|
|
1343
|
-
group.truncated && /* @__PURE__ */
|
|
1411
|
+
group.truncated && /* @__PURE__ */ jsx(Text, {
|
|
1344
1412
|
style: styles$9.dim,
|
|
1345
|
-
children:
|
|
1346
|
-
|
|
1347
|
-
group.
|
|
1348
|
-
|
|
1349
|
-
group.total,
|
|
1350
|
-
" items."
|
|
1351
|
-
]
|
|
1413
|
+
children: t("workflow.ui.showingItems", "Showing {shown} of {total} items.", {
|
|
1414
|
+
shown: group.items.length,
|
|
1415
|
+
total: group.total
|
|
1416
|
+
})
|
|
1352
1417
|
})
|
|
1353
1418
|
]
|
|
1354
1419
|
}, group.key))
|
|
@@ -1553,18 +1618,21 @@ function useStepRuns(stepSessionId) {
|
|
|
1553
1618
|
* channels, so it shows once the step session's frames have arrived, e.g. after opening the step.
|
|
1554
1619
|
*/
|
|
1555
1620
|
function StepDynamicRunsNote({ stepSessionId }) {
|
|
1621
|
+
const t = useT();
|
|
1556
1622
|
const runs = useStepRuns(stepSessionId);
|
|
1557
1623
|
if (runs === void 0 || runs.length === 0) return null;
|
|
1558
|
-
const summary = stepRunsSummary(runs);
|
|
1624
|
+
const summary = stepRunsSummary(runs, t);
|
|
1559
1625
|
return /* @__PURE__ */ jsxs(Text, {
|
|
1560
1626
|
testID: `step-dynamic-note-${stepSessionId}`,
|
|
1561
1627
|
style: styles$8.summary,
|
|
1562
1628
|
children: [summary.text, summary.failed > 0 ? /* @__PURE__ */ jsxs(Text, {
|
|
1563
1629
|
style: styles$8.failed,
|
|
1564
1630
|
children: [
|
|
1565
|
-
"
|
|
1631
|
+
" ",
|
|
1632
|
+
"· ",
|
|
1566
1633
|
summary.failed,
|
|
1567
|
-
"
|
|
1634
|
+
" ",
|
|
1635
|
+
t("workflow.ui.failed.lowercase", "failed")
|
|
1568
1636
|
]
|
|
1569
1637
|
}) : null]
|
|
1570
1638
|
});
|
|
@@ -1574,10 +1642,11 @@ function StepDynamicRunsNote({ stepSessionId }) {
|
|
|
1574
1642
|
* to one summary row; the transcript beside it already holds the step session's channels.
|
|
1575
1643
|
*/
|
|
1576
1644
|
function StepDynamicRuns({ stepSessionId, openSession }) {
|
|
1645
|
+
const t = useT();
|
|
1577
1646
|
const runs = useStepRuns(stepSessionId);
|
|
1578
1647
|
const [open, setOpen] = useState(false);
|
|
1579
1648
|
if (runs === void 0 || runs.length === 0) return null;
|
|
1580
|
-
const summary = stepRunsSummary(runs);
|
|
1649
|
+
const summary = stepRunsSummary(runs, t);
|
|
1581
1650
|
return /* @__PURE__ */ jsxs(View, {
|
|
1582
1651
|
testID: "step-dynamic-runs",
|
|
1583
1652
|
style: styles$8.section(open),
|
|
@@ -1597,7 +1666,7 @@ function StepDynamicRuns({ stepSessionId, openSession }) {
|
|
|
1597
1666
|
}),
|
|
1598
1667
|
/* @__PURE__ */ jsx(Text, {
|
|
1599
1668
|
style: styles$8.title,
|
|
1600
|
-
children: "Dynamic workflows"
|
|
1669
|
+
children: t("workflow.ui.dynamicWorkflows", "Dynamic workflows")
|
|
1601
1670
|
}),
|
|
1602
1671
|
/* @__PURE__ */ jsxs(Text, {
|
|
1603
1672
|
numberOfLines: 1,
|
|
@@ -1605,9 +1674,11 @@ function StepDynamicRuns({ stepSessionId, openSession }) {
|
|
|
1605
1674
|
children: [summary.text, summary.failed > 0 ? /* @__PURE__ */ jsxs(Text, {
|
|
1606
1675
|
style: styles$8.failed,
|
|
1607
1676
|
children: [
|
|
1608
|
-
"
|
|
1677
|
+
" ",
|
|
1678
|
+
"· ",
|
|
1609
1679
|
summary.failed,
|
|
1610
|
-
"
|
|
1680
|
+
" ",
|
|
1681
|
+
t("workflow.ui.failed.lowercase", "failed")
|
|
1611
1682
|
]
|
|
1612
1683
|
}) : null]
|
|
1613
1684
|
})
|
|
@@ -1668,9 +1739,10 @@ const FILTER = {
|
|
|
1668
1739
|
done: "Finished"
|
|
1669
1740
|
};
|
|
1670
1741
|
function Status({ state }) {
|
|
1742
|
+
const t = useT();
|
|
1671
1743
|
return /* @__PURE__ */ jsx(StatusBadge, {
|
|
1672
1744
|
tone: state === "failed" || state === "error" ? "error" : state === "completed" || state === "success" ? "ok" : state === "paused" || state === "pause_requested" || state === "waiting" ? "accent" : state === "running" || state === "resumed" ? "running" : "neutral",
|
|
1673
|
-
children: state
|
|
1745
|
+
children: workflowStateLabel(t, state)
|
|
1674
1746
|
});
|
|
1675
1747
|
}
|
|
1676
1748
|
function Heading({ title, count }) {
|
|
@@ -1687,22 +1759,24 @@ function Heading({ title, count }) {
|
|
|
1687
1759
|
});
|
|
1688
1760
|
}
|
|
1689
1761
|
function Duration({ start, end, now }) {
|
|
1762
|
+
const t = useT();
|
|
1690
1763
|
return now === void 0 ? /* @__PURE__ */ jsx(WorkflowDuration, {
|
|
1691
1764
|
startedAt: start,
|
|
1692
1765
|
endedAt: end,
|
|
1693
1766
|
style: styles$7.meta
|
|
1694
1767
|
}) : /* @__PURE__ */ jsx(Text, {
|
|
1695
1768
|
style: styles$7.meta,
|
|
1696
|
-
children: start === void 0 ? "" : formatRunDuration(Math.max(0, (end === void 0 ? now : Date.parse(end)) - Date.parse(start)))
|
|
1769
|
+
children: start === void 0 ? "" : formatRunDuration(Math.max(0, (end === void 0 ? now : Date.parse(end)) - Date.parse(start)), t)
|
|
1697
1770
|
});
|
|
1698
1771
|
}
|
|
1699
1772
|
function Job({ job, now, onOpen, current }) {
|
|
1773
|
+
const t = useT();
|
|
1700
1774
|
const [open, setOpen] = useState(true);
|
|
1701
1775
|
const done = job.steps.filter((step) => step.status === "completed" || step.status === "skipped").length;
|
|
1702
1776
|
return /* @__PURE__ */ jsxs(View, { children: [
|
|
1703
1777
|
/* @__PURE__ */ jsxs(Pressable, {
|
|
1704
1778
|
accessibilityRole: "button",
|
|
1705
|
-
accessibilityLabel: `${job.name}, ${job.status}`,
|
|
1779
|
+
accessibilityLabel: `${job.name}, ${workflowStateLabel(t, job.status)}`,
|
|
1706
1780
|
accessibilityState: { expanded: open },
|
|
1707
1781
|
onPress: () => setOpen(!open),
|
|
1708
1782
|
style: styles$7.job,
|
|
@@ -1746,8 +1820,8 @@ function Job({ job, now, onOpen, current }) {
|
|
|
1746
1820
|
description: /* @__PURE__ */ jsxs(View, { children: [/* @__PURE__ */ jsx(Text, {
|
|
1747
1821
|
style: styles$7.meta,
|
|
1748
1822
|
children: [
|
|
1749
|
-
step.name === current ? "You are here" : void 0,
|
|
1750
|
-
step.status,
|
|
1823
|
+
step.name === current ? t("workflow.extra.youAreHere", "You are here") : void 0,
|
|
1824
|
+
workflowStateLabel(t, step.status),
|
|
1751
1825
|
step.group ? `∥ ${step.group}` : void 0,
|
|
1752
1826
|
step.reason
|
|
1753
1827
|
].filter(Boolean).join(" · ")
|
|
@@ -1764,18 +1838,23 @@ function Job({ job, now, onOpen, current }) {
|
|
|
1764
1838
|
}
|
|
1765
1839
|
/** Shared presentation for the run's existing native artifact browser and deterministic stories. */
|
|
1766
1840
|
function WorkflowArtifactList({ listing, error, loading = false, onOpen, onParent }) {
|
|
1841
|
+
const t = useT();
|
|
1767
1842
|
const artifacts = listing?.artifacts ?? [];
|
|
1768
1843
|
return /* @__PURE__ */ jsxs(View, {
|
|
1769
1844
|
style: styles$7.artifacts,
|
|
1770
1845
|
children: [
|
|
1771
1846
|
/* @__PURE__ */ jsx(Heading, {
|
|
1772
|
-
title: "Artifacts",
|
|
1847
|
+
title: t("workflow.ui.artifacts", "Artifacts"),
|
|
1773
1848
|
count: String(artifacts.length)
|
|
1774
1849
|
}),
|
|
1775
|
-
onParent ? /* @__PURE__ */
|
|
1850
|
+
onParent ? /* @__PURE__ */ jsxs(Button, {
|
|
1776
1851
|
variant: "ghost",
|
|
1777
1852
|
onPress: onParent,
|
|
1778
|
-
children:
|
|
1853
|
+
children: [
|
|
1854
|
+
" ",
|
|
1855
|
+
t("workflow.ui.parentDirectory", "Parent directory"),
|
|
1856
|
+
" "
|
|
1857
|
+
]
|
|
1779
1858
|
}) : null,
|
|
1780
1859
|
error ? /* @__PURE__ */ jsx(Text, {
|
|
1781
1860
|
accessibilityRole: "alert",
|
|
@@ -1784,11 +1863,11 @@ function WorkflowArtifactList({ listing, error, loading = false, onOpen, onParen
|
|
|
1784
1863
|
}) : null,
|
|
1785
1864
|
loading ? /* @__PURE__ */ jsx(Text, {
|
|
1786
1865
|
style: styles$7.reason,
|
|
1787
|
-
children: "Loading artifacts…"
|
|
1866
|
+
children: t("workflow.ui.loadingArtifacts", "Loading artifacts…")
|
|
1788
1867
|
}) : null,
|
|
1789
1868
|
artifacts.map((artifact) => /* @__PURE__ */ jsx(ListRow, {
|
|
1790
1869
|
title: artifact.path,
|
|
1791
|
-
description: artifact.state === "pending" ? "Not written yet" : artifact.state === "unreadable" ? "Cannot read this output" : artifact.description || "Run output",
|
|
1870
|
+
description: artifact.state === "pending" ? t("workflow.extra.notWrittenYet", "Not written yet") : artifact.state === "unreadable" ? t("workflow.extra.cannotReadThisOutput", "Cannot read this output") : artifact.description || t("workflow.ui.runOutput", "Run output"),
|
|
1792
1871
|
leading: artifact.kind === "directory" ? /* @__PURE__ */ jsx(FolderIcon, {
|
|
1793
1872
|
size: 18,
|
|
1794
1873
|
color: "dim"
|
|
@@ -1801,20 +1880,21 @@ function WorkflowArtifactList({ listing, error, loading = false, onOpen, onParen
|
|
|
1801
1880
|
}, artifact.path)),
|
|
1802
1881
|
!artifacts.length && !loading && !error ? /* @__PURE__ */ jsx(Text, {
|
|
1803
1882
|
style: styles$7.reason,
|
|
1804
|
-
children: "No artifacts yet."
|
|
1883
|
+
children: t("workflow.ui.noArtifactsYet", "No artifacts yet.")
|
|
1805
1884
|
}) : null
|
|
1806
1885
|
]
|
|
1807
1886
|
});
|
|
1808
1887
|
}
|
|
1809
1888
|
/** Data and callbacks only. The host owns the sheet, navigation and API transport. */
|
|
1810
1889
|
function WorkflowDockView({ run, runs, now, sheet = false, dockHeader, artifacts, busy, error, canAct = true, initialMode = "overview", onSelectRun, onOpenStep, onStop, onDelete, onLaunch, current }) {
|
|
1890
|
+
const t = useT();
|
|
1811
1891
|
const [mode, setMode] = useState(initialMode);
|
|
1812
1892
|
const [search, setSearch] = useState("");
|
|
1813
1893
|
const [filter, setFilter] = useState(FILTER.all);
|
|
1814
1894
|
const visibleRuns = runs.filter((item) => runSearchText(item).includes(search.trim().toLowerCase()) && (filter === FILTER.all || filter === FILTER.running && ["running", "paused"].includes(runFilterOf(item)) || filter === FILTER.failed && runFilterOf(item) === "failed" || filter === FILTER.done && runFilterOf(item) === "done"));
|
|
1815
1895
|
const active = run ? activeSteps(run) : [];
|
|
1816
|
-
const attention = run ? attentionFor(run) : void 0;
|
|
1817
|
-
const attentionText = attention?.kind === "paused" ? "Waiting to be resumed." : attention?.kind === "waiting" ? `${attention.text.charAt(0).toUpperCase()}${attention.text.slice(1)}.` : run?.errorMessage ?? run?.staleReason ?? (attention?.kind === "stale" ? "This run is no longer reporting progress." : attention?.text);
|
|
1896
|
+
const attention = run ? attentionFor(run, t) : void 0;
|
|
1897
|
+
const attentionText = attention?.kind === "paused" ? t("workflow.ui.attention.resumeNotice", "Waiting to be resumed.") : attention?.kind === "waiting" ? `${attention.text.charAt(0).toUpperCase()}${attention.text.slice(1)}.` : run?.errorMessage ?? run?.staleReason ?? (attention?.kind === "stale" ? t("workflow.ui.attention.staleNotice", "This run is no longer reporting progress.") : attention?.text);
|
|
1818
1898
|
const List = sheet ? SheetList : FlatList;
|
|
1819
1899
|
const header = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1820
1900
|
dockHeader,
|
|
@@ -1833,7 +1913,7 @@ function WorkflowDockView({ run, runs, now, sheet = false, dockHeader, artifacts
|
|
|
1833
1913
|
style: styles$7.row,
|
|
1834
1914
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
1835
1915
|
style: styles$7.flexMeta,
|
|
1836
|
-
children: [run.position?.job, run.position?.step].filter(Boolean).join(" › ") || (run.stage === "running" ? "Starting" : run.workflowPath)
|
|
1916
|
+
children: [run.position?.job, run.position?.step].filter(Boolean).join(" › ") || (run.stage === "running" ? t("workflow.extra.starting", "Starting") : run.workflowPath)
|
|
1837
1917
|
}), /* @__PURE__ */ jsx(Duration, {
|
|
1838
1918
|
start: run.startedAt,
|
|
1839
1919
|
end: run.finishedAt,
|
|
@@ -1843,7 +1923,12 @@ function WorkflowDockView({ run, runs, now, sheet = false, dockHeader, artifacts
|
|
|
1843
1923
|
runs.length > 1 ? /* @__PURE__ */ jsxs(Button, {
|
|
1844
1924
|
variant: "outline",
|
|
1845
1925
|
onPress: () => setMode("picker"),
|
|
1846
|
-
children: [
|
|
1926
|
+
children: [
|
|
1927
|
+
" ",
|
|
1928
|
+
t("workflow.ui.switchRun", "Switch run"),
|
|
1929
|
+
" ",
|
|
1930
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 16 })
|
|
1931
|
+
]
|
|
1847
1932
|
}) : null
|
|
1848
1933
|
]
|
|
1849
1934
|
}) : null,
|
|
@@ -1852,7 +1937,7 @@ function WorkflowDockView({ run, runs, now, sheet = false, dockHeader, artifacts
|
|
|
1852
1937
|
children: [
|
|
1853
1938
|
/* @__PURE__ */ jsx(Text, {
|
|
1854
1939
|
style: styles$7.heading,
|
|
1855
|
-
children: attention.kind === "error" ? "Run failed" : attention.kind === "stale" ? "Progress stopped" : attention.kind === "waiting" ? "Waiting for your approval" : "Paused"
|
|
1940
|
+
children: attention.kind === "error" ? t("workflow.extra.runFailed", "Run failed") : attention.kind === "stale" ? t("workflow.extra.progressStopped", "Progress stopped") : attention.kind === "waiting" ? t("workflow.extra.waitingForYourApproval", "Waiting for your approval") : t("workflow.extra.paused", "Paused")
|
|
1856
1941
|
}),
|
|
1857
1942
|
/* @__PURE__ */ jsx(Text, {
|
|
1858
1943
|
style: styles$7.body,
|
|
@@ -1860,12 +1945,12 @@ function WorkflowDockView({ run, runs, now, sheet = false, dockHeader, artifacts
|
|
|
1860
1945
|
}),
|
|
1861
1946
|
/* @__PURE__ */ jsx(Text, {
|
|
1862
1947
|
style: styles$7.meta,
|
|
1863
|
-
children: attention.kind === "paused" ? "Ask the agent in this conversation to resume it." : attention.kind === "waiting" ? "It carries on once you answer." : "Ask the agent in this conversation to diagnose or recover it."
|
|
1948
|
+
children: attention.kind === "paused" ? t("workflow.extra.askTheAgentInThisConversationToResumeIt", "Ask the agent in this conversation to resume it.") : attention.kind === "waiting" ? t("workflow.extra.itCarriesOnOnceYouAnswer", "It carries on once you answer.") : t("workflow.extra.askTheAgentInThisConversationToDiagnoseOrRecoverIt", "Ask the agent in this conversation to diagnose or recover it.")
|
|
1864
1949
|
})
|
|
1865
1950
|
]
|
|
1866
1951
|
}) : null,
|
|
1867
1952
|
active.length ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Heading, {
|
|
1868
|
-
title: "Active now",
|
|
1953
|
+
title: t("workflow.ui.activeNow", "Active now"),
|
|
1869
1954
|
count: String(active.length)
|
|
1870
1955
|
}), active.map(({ job, step }) => /* @__PURE__ */ jsx(ListRow, {
|
|
1871
1956
|
title: step.name,
|
|
@@ -1879,7 +1964,7 @@ function WorkflowDockView({ run, runs, now, sheet = false, dockHeader, artifacts
|
|
|
1879
1964
|
onPress: () => onOpenStep(job, step.name)
|
|
1880
1965
|
}, `${job}/${step.name}`))] }) : null,
|
|
1881
1966
|
run ? /* @__PURE__ */ jsx(Heading, {
|
|
1882
|
-
title: "Jobs",
|
|
1967
|
+
title: t("workflow.ui.jobs", "Jobs"),
|
|
1883
1968
|
count: `${run.jobs.filter((job) => ["completed", "skipped"].includes(job.status)).length}/${run.jobs.length}`
|
|
1884
1969
|
}) : null
|
|
1885
1970
|
] });
|
|
@@ -1888,19 +1973,27 @@ function WorkflowDockView({ run, runs, now, sheet = false, dockHeader, artifacts
|
|
|
1888
1973
|
children: [
|
|
1889
1974
|
/* @__PURE__ */ jsxs(View, {
|
|
1890
1975
|
style: styles$7.row,
|
|
1891
|
-
children: [/* @__PURE__ */
|
|
1976
|
+
children: [/* @__PURE__ */ jsxs(Text, {
|
|
1892
1977
|
accessibilityRole: "header",
|
|
1893
1978
|
style: styles$7.title,
|
|
1894
|
-
children:
|
|
1895
|
-
|
|
1979
|
+
children: [
|
|
1980
|
+
" ",
|
|
1981
|
+
t("workflow.ui.switchRun", "Switch run"),
|
|
1982
|
+
" "
|
|
1983
|
+
]
|
|
1984
|
+
}), /* @__PURE__ */ jsxs(Button, {
|
|
1896
1985
|
variant: "ghost",
|
|
1897
1986
|
onPress: () => setMode("overview"),
|
|
1898
|
-
children:
|
|
1987
|
+
children: [
|
|
1988
|
+
" ",
|
|
1989
|
+
t("workflow.ui.done", "Done"),
|
|
1990
|
+
" "
|
|
1991
|
+
]
|
|
1899
1992
|
})]
|
|
1900
1993
|
}),
|
|
1901
1994
|
/* @__PURE__ */ jsx(Input, {
|
|
1902
|
-
accessibilityLabel: "Find a run",
|
|
1903
|
-
placeholder: "Find a run",
|
|
1995
|
+
accessibilityLabel: t("workflow.ui.findARun", "Find a run"),
|
|
1996
|
+
placeholder: t("workflow.ui.findARun", "Find a run"),
|
|
1904
1997
|
value: search,
|
|
1905
1998
|
onChangeText: setSearch
|
|
1906
1999
|
}),
|
|
@@ -1917,10 +2010,10 @@ function WorkflowDockView({ run, runs, now, sheet = false, dockHeader, artifacts
|
|
|
1917
2010
|
size: "compact",
|
|
1918
2011
|
surface: "plain",
|
|
1919
2012
|
icon: /* @__PURE__ */ jsx(SearchIcon, { size: 16 }),
|
|
1920
|
-
title: "No matching runs",
|
|
1921
|
-
description: "Try another name or status.",
|
|
2013
|
+
title: t("workflow.ui.noMatchingRuns", "No matching runs"),
|
|
2014
|
+
description: t("workflow.ui.tryAnotherNameOrStatus", "Try another name or status."),
|
|
1922
2015
|
secondaryAction: {
|
|
1923
|
-
label: "Clear filters",
|
|
2016
|
+
label: t("workflow.extra.clearFilters", "Clear filters"),
|
|
1924
2017
|
onAction: () => {
|
|
1925
2018
|
setSearch("");
|
|
1926
2019
|
setFilter(FILTER.all);
|
|
@@ -1941,14 +2034,22 @@ function WorkflowDockView({ run, runs, now, sheet = false, dockHeader, artifacts
|
|
|
1941
2034
|
}) : mode === "delete" ? /* @__PURE__ */ jsxs(View, {
|
|
1942
2035
|
style: styles$7.picker,
|
|
1943
2036
|
children: [
|
|
1944
|
-
/* @__PURE__ */
|
|
2037
|
+
/* @__PURE__ */ jsxs(Text, {
|
|
1945
2038
|
accessibilityRole: "header",
|
|
1946
2039
|
style: styles$7.title,
|
|
1947
|
-
children:
|
|
2040
|
+
children: [
|
|
2041
|
+
" ",
|
|
2042
|
+
t("workflow.ui.deleteThisRun", "Delete this run?"),
|
|
2043
|
+
" "
|
|
2044
|
+
]
|
|
1948
2045
|
}),
|
|
1949
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ jsxs(Text, {
|
|
1950
2047
|
style: styles$7.body,
|
|
1951
|
-
children:
|
|
2048
|
+
children: [
|
|
2049
|
+
" ",
|
|
2050
|
+
t("workflow.ui.thisPermanentlyRemovesTheSettledRunAndItsDirectoryIncludingLogsAndArtifacts", "This permanently removes the settled run and its directory, including logs and artifacts."),
|
|
2051
|
+
" "
|
|
2052
|
+
]
|
|
1952
2053
|
}),
|
|
1953
2054
|
/* @__PURE__ */ jsx(Text, {
|
|
1954
2055
|
style: styles$7.meta,
|
|
@@ -1963,13 +2064,17 @@ function WorkflowDockView({ run, runs, now, sheet = false, dockHeader, artifacts
|
|
|
1963
2064
|
variant: "danger-outline",
|
|
1964
2065
|
disabled: !canAct || busy !== void 0 || !run || run.stage === "running",
|
|
1965
2066
|
onPress: onDelete,
|
|
1966
|
-
children: busy === "deleting" ? "Deleting…" : "Delete run"
|
|
2067
|
+
children: busy === "deleting" ? t("workflow.extra.deleting.progress", "Deleting…") : t("workflow.extra.deleteRun", "Delete run")
|
|
1967
2068
|
}),
|
|
1968
|
-
/* @__PURE__ */
|
|
2069
|
+
/* @__PURE__ */ jsxs(Button, {
|
|
1969
2070
|
variant: "ghost",
|
|
1970
2071
|
disabled: busy !== void 0,
|
|
1971
2072
|
onPress: () => setMode("overview"),
|
|
1972
|
-
children:
|
|
2073
|
+
children: [
|
|
2074
|
+
" ",
|
|
2075
|
+
t("workflow.ui.cancel", "Cancel"),
|
|
2076
|
+
" "
|
|
2077
|
+
]
|
|
1973
2078
|
})
|
|
1974
2079
|
]
|
|
1975
2080
|
}) : null;
|
|
@@ -2000,17 +2105,21 @@ function WorkflowDockView({ run, runs, now, sheet = false, dockHeader, artifacts
|
|
|
2000
2105
|
ListFooterComponent: artifacts === void 0 ? void 0 : /* @__PURE__ */ jsx(Fragment, { children: artifacts }),
|
|
2001
2106
|
ListEmptyComponent: !run ? /* @__PURE__ */ jsx(EmptyState, {
|
|
2002
2107
|
icon: /* @__PURE__ */ jsx(WorkflowIcon, { size: 20 }),
|
|
2003
|
-
title: "No workflow runs",
|
|
2004
|
-
description: "Launch a workflow to see its progress here.",
|
|
2108
|
+
title: t("workflow.ui.noWorkflowRuns", "No workflow runs"),
|
|
2109
|
+
description: t("workflow.ui.launchAWorkflowToSeeItsProgressHere", "Launch a workflow to see its progress here."),
|
|
2005
2110
|
action: {
|
|
2006
|
-
label: "Launch workflow",
|
|
2111
|
+
label: t("workflow.extra.launchWorkflow", "Launch workflow"),
|
|
2007
2112
|
onAction: onLaunch,
|
|
2008
2113
|
disabled: !canAct
|
|
2009
2114
|
}
|
|
2010
2115
|
}) : void 0
|
|
2011
|
-
}), run && current !== void 0 ? /* @__PURE__ */
|
|
2116
|
+
}), run && current !== void 0 ? /* @__PURE__ */ jsxs(Text, {
|
|
2012
2117
|
style: [styles$7.meta, styles$7.actions],
|
|
2013
|
-
children:
|
|
2118
|
+
children: [
|
|
2119
|
+
" ",
|
|
2120
|
+
t("workflow.ui.theWorkflowSessionRunsThisWorkflowSoStoppingOrDeletingItHappensThere", "The workflow session runs this workflow, so stopping or deleting it happens there."),
|
|
2121
|
+
" "
|
|
2122
|
+
]
|
|
2014
2123
|
}) : run ? /* @__PURE__ */ jsxs(View, {
|
|
2015
2124
|
style: styles$7.actions,
|
|
2016
2125
|
children: [error ? /* @__PURE__ */ jsx(Text, {
|
|
@@ -2021,7 +2130,7 @@ function WorkflowDockView({ run, runs, now, sheet = false, dockHeader, artifacts
|
|
|
2021
2130
|
variant: "danger-outline",
|
|
2022
2131
|
disabled: !canAct || busy !== void 0,
|
|
2023
2132
|
onPress: run.stage === "running" ? onStop : () => setMode("delete"),
|
|
2024
|
-
children: busy === "stopping" ? "Stopping…" : run.stage === "running" ? "Stop workflow" : "Delete run…"
|
|
2133
|
+
children: busy === "stopping" ? t("workflow.extra.stopping.progress", "Stopping…") : run.stage === "running" ? t("workflow.extra.stopWorkflow", "Stop workflow") : t("workflow.extra.deleteRun.progress", "Delete run…")
|
|
2025
2134
|
})]
|
|
2026
2135
|
}) : null] })
|
|
2027
2136
|
});
|
|
@@ -2241,6 +2350,7 @@ function readDelimitedWindow(text, delimiter, document, rowLimit, columnLimit) {
|
|
|
2241
2350
|
//#region src/extensions/workspaces/sessions/(frontend)/_components/DelimitedArtifact.native.tsx
|
|
2242
2351
|
/** Pure CSV/TSV preview shared with its design target. Labels never consume a source record. */
|
|
2243
2352
|
const DelimitedArtifact = memo(function DelimitedArtifact({ text, delimiter, initialRows = 20 }) {
|
|
2353
|
+
const t = useT();
|
|
2244
2354
|
const document = useMemo(() => indexDelimited(text, delimiter), [text, delimiter]);
|
|
2245
2355
|
const [window, setWindow] = useState({
|
|
2246
2356
|
document,
|
|
@@ -2266,27 +2376,21 @@ const DelimitedArtifact = memo(function DelimitedArtifact({ text, delimiter, ini
|
|
|
2266
2376
|
return /* @__PURE__ */ jsxs(View, {
|
|
2267
2377
|
style: styles$6.body,
|
|
2268
2378
|
children: [
|
|
2269
|
-
/* @__PURE__ */
|
|
2379
|
+
/* @__PURE__ */ jsx(Text, {
|
|
2270
2380
|
style: styles$6.meta,
|
|
2271
2381
|
accessibilityLiveRegion: "polite",
|
|
2272
|
-
children:
|
|
2273
|
-
|
|
2274
|
-
rows === 0 ? 0 : 1,
|
|
2275
|
-
"–",
|
|
2382
|
+
children: t("workflow.preview.range", "Rows {rowStart}–{rows} of {rowCount} · Columns {columnStart}–{columns} of {columnCount}", {
|
|
2383
|
+
rowStart: rows === 0 ? 0 : 1,
|
|
2276
2384
|
rows,
|
|
2277
|
-
" of ",
|
|
2278
2385
|
rowCount,
|
|
2279
|
-
|
|
2280
|
-
columns === 0 ? 0 : 1,
|
|
2281
|
-
"–",
|
|
2386
|
+
columnStart: columns === 0 ? 0 : 1,
|
|
2282
2387
|
columns,
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
]
|
|
2388
|
+
columnCount: document.columns
|
|
2389
|
+
})
|
|
2286
2390
|
}),
|
|
2287
2391
|
/* @__PURE__ */ jsx(Text, {
|
|
2288
2392
|
style: styles$6.copy,
|
|
2289
|
-
children: "Scroll within the preview. Load more rows or columns when you need them."
|
|
2393
|
+
children: t("workflow.ui.scrollWithinThePreviewLoadMoreRowsOrColumnsWhenYouNeedThem", "Scroll within the preview. Load more rows or columns when you need them.")
|
|
2290
2394
|
}),
|
|
2291
2395
|
/* @__PURE__ */ jsx(ScrollView, {
|
|
2292
2396
|
style: styles$6.preview,
|
|
@@ -2295,10 +2399,10 @@ const DelimitedArtifact = memo(function DelimitedArtifact({ text, delimiter, ini
|
|
|
2295
2399
|
horizontal: true,
|
|
2296
2400
|
children: /* @__PURE__ */ jsxs(View, { children: [/* @__PURE__ */ jsx(View, {
|
|
2297
2401
|
style: styles$6.tableRow,
|
|
2298
|
-
children: Array.from({ length: columns }, (_, column) => /* @__PURE__ */
|
|
2402
|
+
children: Array.from({ length: columns }, (_, column) => /* @__PURE__ */ jsx(Text, {
|
|
2299
2403
|
selectable: true,
|
|
2300
2404
|
style: styles$6.cell,
|
|
2301
|
-
children:
|
|
2405
|
+
children: t("workflow.preview.column", "Column {column}", { column: column + 1 })
|
|
2302
2406
|
}, column))
|
|
2303
2407
|
}), cells.map((values, row) => /* @__PURE__ */ jsx(View, {
|
|
2304
2408
|
style: styles$6.tableRow,
|
|
@@ -2318,7 +2422,7 @@ const DelimitedArtifact = memo(function DelimitedArtifact({ text, delimiter, ini
|
|
|
2318
2422
|
...current,
|
|
2319
2423
|
rows: rows + 20
|
|
2320
2424
|
}),
|
|
2321
|
-
children: rows === rowCount ? "All rows shown" :
|
|
2425
|
+
children: rows === rowCount ? t("workflow.preview.allRows", "All rows shown") : t("workflow.preview.moreRows", "Show {count} more rows", { count: Math.min(20, rowCount - rows) })
|
|
2322
2426
|
}),
|
|
2323
2427
|
/* @__PURE__ */ jsx(Button, {
|
|
2324
2428
|
variant: "ghost",
|
|
@@ -2328,7 +2432,7 @@ const DelimitedArtifact = memo(function DelimitedArtifact({ text, delimiter, ini
|
|
|
2328
2432
|
...current,
|
|
2329
2433
|
columns: columns + 8
|
|
2330
2434
|
}),
|
|
2331
|
-
children: columns === document.columns ? "All columns shown" :
|
|
2435
|
+
children: columns === document.columns ? t("workflow.preview.allColumns", "All columns shown") : t("workflow.preview.moreColumns", "Show {count} more columns", { count: Math.min(8, document.columns - columns) })
|
|
2332
2436
|
})
|
|
2333
2437
|
]
|
|
2334
2438
|
});
|
|
@@ -2399,12 +2503,13 @@ function workflowTab(run) {
|
|
|
2399
2503
|
function workflowsTab() {
|
|
2400
2504
|
return {
|
|
2401
2505
|
id: "workflows-runs",
|
|
2402
|
-
label: "Workflows",
|
|
2506
|
+
label: t("workflow.ui.workflows", "Workflows"),
|
|
2403
2507
|
retainComposer: true,
|
|
2404
2508
|
panel: WorkflowPanel
|
|
2405
2509
|
};
|
|
2406
2510
|
}
|
|
2407
2511
|
function WorkflowLauncher(props) {
|
|
2512
|
+
const t = useT();
|
|
2408
2513
|
const subscribe = useCallback((listener) => {
|
|
2409
2514
|
const sub = catalog.store.subscribe(listener);
|
|
2410
2515
|
return () => sub.unsubscribe();
|
|
@@ -2423,7 +2528,7 @@ function WorkflowLauncher(props) {
|
|
|
2423
2528
|
setSelected(void 0);
|
|
2424
2529
|
}
|
|
2425
2530
|
},
|
|
2426
|
-
children: /* @__PURE__ */ jsxs(SheetContent, { children: [/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: workflow ?
|
|
2531
|
+
children: /* @__PURE__ */ jsxs(SheetContent, { children: [/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: workflow ? t("workflow.ui.launchNamedWorkflow", "Launch {name}", { name: workflow.name }) : t("workflow.extra.launchAWorkflow", "Launch a workflow") }) }), /* @__PURE__ */ jsx(SheetBody, { children: workflow ? /* @__PURE__ */ jsx(WorkflowLaunch, {
|
|
2427
2532
|
...props,
|
|
2428
2533
|
sessionId: props.sessionId,
|
|
2429
2534
|
workflow,
|
|
@@ -2436,10 +2541,10 @@ function WorkflowLauncher(props) {
|
|
|
2436
2541
|
style: styles$5.body,
|
|
2437
2542
|
children: [
|
|
2438
2543
|
/* @__PURE__ */ jsx(Input, {
|
|
2439
|
-
accessibilityLabel: "Find a workflow",
|
|
2544
|
+
accessibilityLabel: t("workflow.ui.findAWorkflow", "Find a workflow"),
|
|
2440
2545
|
value: filter,
|
|
2441
2546
|
onChangeText: setFilter,
|
|
2442
|
-
placeholder: "Find a workflow"
|
|
2547
|
+
placeholder: t("workflow.ui.findAWorkflow", "Find a workflow")
|
|
2443
2548
|
}),
|
|
2444
2549
|
state.warning ? /* @__PURE__ */ jsx(Text, {
|
|
2445
2550
|
style: styles$5.error,
|
|
@@ -2459,23 +2564,23 @@ function WorkflowLauncher(props) {
|
|
|
2459
2564
|
state.workflows.length === 0 && !state.loaded && !state.warning ? /* @__PURE__ */ jsx(LoadingState, {
|
|
2460
2565
|
testID: "catalog-loading",
|
|
2461
2566
|
size: "compact",
|
|
2462
|
-
label: "Loading workflows"
|
|
2567
|
+
label: t("workflow.ui.loadingWorkflows", "Loading workflows")
|
|
2463
2568
|
}) : state.workflows.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
|
|
2464
2569
|
testID: "catalog-empty",
|
|
2465
2570
|
size: "compact",
|
|
2466
2571
|
surface: "plain",
|
|
2467
2572
|
icon: /* @__PURE__ */ jsx(WorkflowIcon, { size: 16 }),
|
|
2468
|
-
title: "No workflows found",
|
|
2469
|
-
description: "Add a workflow file under automations/workflows to launch it from here."
|
|
2573
|
+
title: t("workflow.ui.noWorkflowsFound", "No workflows found"),
|
|
2574
|
+
description: t("workflow.ui.addAWorkflowFileUnderAutomationsWorkflowsToLaunchItFromHere", "Add a workflow file under automations/workflows to launch it from here.")
|
|
2470
2575
|
}) : shown.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
|
|
2471
2576
|
testID: "catalog-no-match",
|
|
2472
2577
|
size: "compact",
|
|
2473
2578
|
surface: "plain",
|
|
2474
2579
|
icon: /* @__PURE__ */ jsx(SearchIcon, { size: 16 }),
|
|
2475
|
-
title: "No matching workflows",
|
|
2476
|
-
description: "Try another name, tag, or job.",
|
|
2580
|
+
title: t("workflow.ui.noMatchingWorkflows", "No matching workflows"),
|
|
2581
|
+
description: t("workflow.ui.tryAnotherNameTagOrJob", "Try another name, tag, or job."),
|
|
2477
2582
|
secondaryAction: {
|
|
2478
|
-
label: "Clear filter",
|
|
2583
|
+
label: t("workflow.extra.clearFilter", "Clear filter"),
|
|
2479
2584
|
onAction: () => setFilter("")
|
|
2480
2585
|
}
|
|
2481
2586
|
}) : null
|
|
@@ -2495,6 +2600,7 @@ function Choice({ label, options, value, onChange }) {
|
|
|
2495
2600
|
}, option))] });
|
|
2496
2601
|
}
|
|
2497
2602
|
function WorkflowLaunch({ sessionId, workflow, initialPrompt, sendSessionFrame, onClose }) {
|
|
2603
|
+
const t = useT();
|
|
2498
2604
|
const [prompt, setPrompt] = useState(initialPrompt);
|
|
2499
2605
|
const [inputs, setInputs] = useState(() => initialInputs(workflow));
|
|
2500
2606
|
const [runner, setRunner] = useState(() => initialRunner(workflow));
|
|
@@ -2519,8 +2625,8 @@ function WorkflowLaunch({ sessionId, workflow, initialPrompt, sendSessionFrame,
|
|
|
2519
2625
|
children: workflow.description
|
|
2520
2626
|
}),
|
|
2521
2627
|
/* @__PURE__ */ jsx(Textarea, {
|
|
2522
|
-
accessibilityLabel: "Workflow prompt",
|
|
2523
|
-
placeholder: "What should this workflow do?",
|
|
2628
|
+
accessibilityLabel: t("workflow.ui.workflowPrompt", "Workflow prompt"),
|
|
2629
|
+
placeholder: t("workflow.ui.whatShouldThisWorkflowDo", "What should this workflow do?"),
|
|
2524
2630
|
value: prompt,
|
|
2525
2631
|
onChangeText: setPrompt
|
|
2526
2632
|
}),
|
|
@@ -2530,7 +2636,7 @@ function WorkflowLaunch({ sessionId, workflow, initialPrompt, sendSessionFrame,
|
|
|
2530
2636
|
style: styles$5.meta,
|
|
2531
2637
|
children: [
|
|
2532
2638
|
input.name,
|
|
2533
|
-
input.required ? " (required)" : "",
|
|
2639
|
+
input.required ? t("workflow.extra.lower.required", " (required)") : "",
|
|
2534
2640
|
" · ",
|
|
2535
2641
|
input.description
|
|
2536
2642
|
]
|
|
@@ -2552,19 +2658,19 @@ function WorkflowLaunch({ sessionId, workflow, initialPrompt, sendSessionFrame,
|
|
|
2552
2658
|
})] }, input.name);
|
|
2553
2659
|
}),
|
|
2554
2660
|
workflow.runners?.length ? /* @__PURE__ */ jsx(Choice, {
|
|
2555
|
-
label: "Runner",
|
|
2661
|
+
label: t("workflow.ui.runner", "Runner"),
|
|
2556
2662
|
options: workflow.runners,
|
|
2557
2663
|
value: runner,
|
|
2558
2664
|
onChange: setRunner
|
|
2559
2665
|
}) : null,
|
|
2560
2666
|
workflow.commands?.length ? /* @__PURE__ */ jsx(Choice, {
|
|
2561
|
-
label: "Command",
|
|
2667
|
+
label: t("workflow.ui.command", "Command"),
|
|
2562
2668
|
options: workflow.commands,
|
|
2563
2669
|
value: command,
|
|
2564
2670
|
onChange: setCommand
|
|
2565
2671
|
}) : null,
|
|
2566
2672
|
workflow.choices?.length ? /* @__PURE__ */ jsx(Choice, {
|
|
2567
|
-
label: "Choice",
|
|
2673
|
+
label: t("workflow.ui.choice", "Choice"),
|
|
2568
2674
|
options: workflow.choices,
|
|
2569
2675
|
value: choice,
|
|
2570
2676
|
onChange: setChoice
|
|
@@ -2578,7 +2684,7 @@ function WorkflowLaunch({ sessionId, workflow, initialPrompt, sendSessionFrame,
|
|
|
2578
2684
|
style: styles$5.error,
|
|
2579
2685
|
children: error
|
|
2580
2686
|
}) : null,
|
|
2581
|
-
/* @__PURE__ */
|
|
2687
|
+
/* @__PURE__ */ jsxs(Button, {
|
|
2582
2688
|
testID: "launch-workflow-submit",
|
|
2583
2689
|
disabled: problems.length > 0,
|
|
2584
2690
|
onPress: () => {
|
|
@@ -2590,18 +2696,23 @@ function WorkflowLaunch({ sessionId, workflow, initialPrompt, sendSessionFrame,
|
|
|
2590
2696
|
setError(cause instanceof Error ? cause.message : String(cause));
|
|
2591
2697
|
}
|
|
2592
2698
|
},
|
|
2593
|
-
children:
|
|
2699
|
+
children: [
|
|
2700
|
+
" ",
|
|
2701
|
+
t("workflow.ui.launch", "Launch"),
|
|
2702
|
+
" "
|
|
2703
|
+
]
|
|
2594
2704
|
})
|
|
2595
2705
|
]
|
|
2596
2706
|
});
|
|
2597
2707
|
}
|
|
2598
2708
|
function WorkflowPanel(props) {
|
|
2709
|
+
const t = useT();
|
|
2599
2710
|
const state = useWorkflows(props.sessionId);
|
|
2600
2711
|
const identity = props.identity ?? state.focusedRun;
|
|
2601
2712
|
const run = state.runs.find((item) => workflowRunIdentity(item) === identity) ?? (props.identity === void 0 ? state.runs[0] : void 0);
|
|
2602
2713
|
if (props.identity !== void 0 && !run) return /* @__PURE__ */ jsx(Text, {
|
|
2603
2714
|
style: styles$5.meta,
|
|
2604
|
-
children: "This run is no longer listed."
|
|
2715
|
+
children: t("workflow.ui.thisRunIsNoLongerListed", "This run is no longer listed.")
|
|
2605
2716
|
});
|
|
2606
2717
|
return /* @__PURE__ */ jsx(WorkflowRunPanel, {
|
|
2607
2718
|
...props,
|
|
@@ -2744,7 +2855,7 @@ function WorkflowStep({ sessionId, workspace, runKey, job, step, renderSessionTr
|
|
|
2744
2855
|
children: [
|
|
2745
2856
|
job,
|
|
2746
2857
|
step === void 0 ? "" : ` › ${step}`,
|
|
2747
|
-
target === void 0 ? "" : ` · ${target.status}`
|
|
2858
|
+
target === void 0 ? "" : ` · ${workflowStateLabel(t, target.status)}`
|
|
2748
2859
|
]
|
|
2749
2860
|
}), session ? /* @__PURE__ */ jsxs(Fragment, { children: [renderSessionTranscript?.(session), /* @__PURE__ */ jsx(StepDynamicRuns, {
|
|
2750
2861
|
stepSessionId: session,
|
|
@@ -2759,6 +2870,7 @@ function WorkflowStep({ sessionId, workspace, runKey, job, step, renderSessionTr
|
|
|
2759
2870
|
});
|
|
2760
2871
|
}
|
|
2761
2872
|
function WorkflowTerminal({ sessionId, workspace, runKey, pane, renderRunnerTerminal }) {
|
|
2873
|
+
const t = useT();
|
|
2762
2874
|
const [capabilities, setCapabilities] = useState();
|
|
2763
2875
|
const [token, setToken] = useState();
|
|
2764
2876
|
const [notice, setNotice] = useState();
|
|
@@ -2826,7 +2938,7 @@ function WorkflowTerminal({ sessionId, workspace, runKey, pane, renderRunnerTerm
|
|
|
2826
2938
|
return /* @__PURE__ */ jsxs(View, {
|
|
2827
2939
|
style: styles$5.transcript,
|
|
2828
2940
|
children: [
|
|
2829
|
-
/* @__PURE__ */ jsx(Badge, { children: token ? "keyboard yours" : "watching" }),
|
|
2941
|
+
/* @__PURE__ */ jsx(Badge, { children: token ? t("workflow.extra.lower.keyboardYours", "keyboard yours") : t("workflow.extra.lower.watching", "watching") }),
|
|
2830
2942
|
capabilities?.writable ? /* @__PURE__ */ jsx(Button, {
|
|
2831
2943
|
variant: "outline",
|
|
2832
2944
|
disabled: busy,
|
|
@@ -2834,7 +2946,7 @@ function WorkflowTerminal({ sessionId, workspace, runKey, pane, renderRunnerTerm
|
|
|
2834
2946
|
if (token) setToken(void 0);
|
|
2835
2947
|
else arm();
|
|
2836
2948
|
},
|
|
2837
|
-
children: token ? "Release keyboard" : "Take control"
|
|
2949
|
+
children: token ? t("workflow.extra.releaseKeyboard", "Release keyboard") : t("workflow.extra.takeControl", "Take control")
|
|
2838
2950
|
}) : null,
|
|
2839
2951
|
/* @__PURE__ */ jsx(View, {
|
|
2840
2952
|
style: styles$5.transcript,
|
|
@@ -2846,18 +2958,18 @@ function WorkflowTerminal({ sessionId, workspace, runKey, pane, renderRunnerTerm
|
|
|
2846
2958
|
}) : null,
|
|
2847
2959
|
token && capabilities?.resizable ? /* @__PURE__ */ jsxs(View, { children: [
|
|
2848
2960
|
/* @__PURE__ */ jsx(Input, {
|
|
2849
|
-
accessibilityLabel: "Terminal columns",
|
|
2961
|
+
accessibilityLabel: t("workflow.ui.terminalColumns", "Terminal columns"),
|
|
2850
2962
|
keyboardType: "number-pad",
|
|
2851
2963
|
value: columns,
|
|
2852
2964
|
onChangeText: setColumns
|
|
2853
2965
|
}),
|
|
2854
2966
|
/* @__PURE__ */ jsx(Input, {
|
|
2855
|
-
accessibilityLabel: "Terminal rows",
|
|
2967
|
+
accessibilityLabel: t("workflow.ui.terminalRows", "Terminal rows"),
|
|
2856
2968
|
keyboardType: "number-pad",
|
|
2857
2969
|
value: rows,
|
|
2858
2970
|
onChangeText: setRows
|
|
2859
2971
|
}),
|
|
2860
|
-
/* @__PURE__ */
|
|
2972
|
+
/* @__PURE__ */ jsxs(Button, {
|
|
2861
2973
|
variant: "outline",
|
|
2862
2974
|
disabled: !Number.isInteger(Number(columns)) || !Number.isInteger(Number(rows)) || Number(columns) < 1 || Number(rows) < 1,
|
|
2863
2975
|
onPress: () => {
|
|
@@ -2865,7 +2977,11 @@ function WorkflowTerminal({ sessionId, workspace, runKey, pane, renderRunnerTerm
|
|
|
2865
2977
|
if (!lifetime.signal.aborted) setNotice(cause instanceof Error ? cause.message : String(cause));
|
|
2866
2978
|
});
|
|
2867
2979
|
},
|
|
2868
|
-
children:
|
|
2980
|
+
children: [
|
|
2981
|
+
" ",
|
|
2982
|
+
t("workflow.ui.resizeTerminal", "Resize terminal"),
|
|
2983
|
+
" "
|
|
2984
|
+
]
|
|
2869
2985
|
})
|
|
2870
2986
|
] }) : null,
|
|
2871
2987
|
notice ? /* @__PURE__ */ jsx(Text, {
|
|
@@ -2944,6 +3060,7 @@ function WorkflowArtifacts(props) {
|
|
|
2944
3060
|
});
|
|
2945
3061
|
}
|
|
2946
3062
|
function ArtifactPreview({ sessionId, workspace, runKey, path, renderFilePreview, renderMediaPreview, nativeSaveFile }) {
|
|
3063
|
+
const t = useT();
|
|
2947
3064
|
const [content, setContent] = useState();
|
|
2948
3065
|
const [error, setError] = useState();
|
|
2949
3066
|
const [raw, setRaw] = useState(false);
|
|
@@ -2995,16 +3112,24 @@ function ArtifactPreview({ sessionId, workspace, runKey, path, renderFilePreview
|
|
|
2995
3112
|
style: styles$5.title,
|
|
2996
3113
|
children: path
|
|
2997
3114
|
}),
|
|
2998
|
-
/* @__PURE__ */
|
|
3115
|
+
/* @__PURE__ */ jsxs(Button, {
|
|
2999
3116
|
variant: "outline",
|
|
3000
3117
|
disabled: !nativeSaveFile || saving,
|
|
3001
3118
|
onPress: () => void download(),
|
|
3002
|
-
children:
|
|
3119
|
+
children: [
|
|
3120
|
+
" ",
|
|
3121
|
+
t("workflow.ui.download", "Download"),
|
|
3122
|
+
" "
|
|
3123
|
+
]
|
|
3003
3124
|
}),
|
|
3004
|
-
saving ? /* @__PURE__ */
|
|
3125
|
+
saving ? /* @__PURE__ */ jsxs(Button, {
|
|
3005
3126
|
variant: "ghost",
|
|
3006
3127
|
onPress: () => downloadController.current?.abort(),
|
|
3007
|
-
children:
|
|
3128
|
+
children: [
|
|
3129
|
+
" ",
|
|
3130
|
+
t("workflow.ui.cancelDownload", "Cancel download"),
|
|
3131
|
+
" "
|
|
3132
|
+
]
|
|
3008
3133
|
}) : null,
|
|
3009
3134
|
saveNote ? /* @__PURE__ */ jsx(Text, {
|
|
3010
3135
|
style: styles$5.meta,
|
|
@@ -3018,7 +3143,7 @@ function ArtifactPreview({ sessionId, workspace, runKey, path, renderFilePreview
|
|
|
3018
3143
|
/* @__PURE__ */ jsx(Button, {
|
|
3019
3144
|
variant: "outline",
|
|
3020
3145
|
onPress: () => setRaw((value) => !value),
|
|
3021
|
-
children: raw ? "Preview" : "Raw source"
|
|
3146
|
+
children: raw ? t("workflow.extra.preview", "Preview") : t("workflow.extra.rawSource", "Raw source")
|
|
3022
3147
|
}),
|
|
3023
3148
|
!raw && /\.(md|markdown)$/i.test(path) ? /* @__PURE__ */ jsx(Markdown, { text: content.text }) : !raw && /\.(html|htm)$/i.test(path) ? renderFilePreview?.({
|
|
3024
3149
|
key: `${sessionId}:${workspace}:${runKey}:${path}`,
|
|
@@ -3030,7 +3155,7 @@ function ArtifactPreview({ sessionId, workspace, runKey, path, renderFilePreview
|
|
|
3030
3155
|
}) : /* @__PURE__ */ jsx(CodeBlock, { text: !raw && /\.json$/i.test(path) ? prettyJson(content.text) : content.text }),
|
|
3031
3156
|
content.truncated ? /* @__PURE__ */ jsx(Text, {
|
|
3032
3157
|
style: styles$5.meta,
|
|
3033
|
-
children: "This preview was truncated."
|
|
3158
|
+
children: t("workflow.ui.thisPreviewWasTruncated", "This preview was truncated.")
|
|
3034
3159
|
}) : null
|
|
3035
3160
|
] }) : content ? /* @__PURE__ */ jsx(BinaryArtifactPreview, {
|
|
3036
3161
|
sessionId,
|
|
@@ -3040,7 +3165,7 @@ function ArtifactPreview({ sessionId, workspace, runKey, path, renderFilePreview
|
|
|
3040
3165
|
renderMediaPreview
|
|
3041
3166
|
}) : /* @__PURE__ */ jsx(Text, {
|
|
3042
3167
|
style: styles$5.meta,
|
|
3043
|
-
children: "Loading preview…"
|
|
3168
|
+
children: t("workflow.ui.loadingPreview", "Loading preview…")
|
|
3044
3169
|
})
|
|
3045
3170
|
] });
|
|
3046
3171
|
return delimited ? /* @__PURE__ */ jsx(View, {
|
|
@@ -3052,6 +3177,7 @@ function ArtifactPreview({ sessionId, workspace, runKey, path, renderFilePreview
|
|
|
3052
3177
|
});
|
|
3053
3178
|
}
|
|
3054
3179
|
function BinaryArtifactPreview({ sessionId, workspace, runKey, path, renderMediaPreview }) {
|
|
3180
|
+
const t = useT();
|
|
3055
3181
|
const requestKey = JSON.stringify([
|
|
3056
3182
|
sessionId,
|
|
3057
3183
|
workspace,
|
|
@@ -3089,7 +3215,7 @@ function BinaryArtifactPreview({ sessionId, workspace, runKey, path, renderMedia
|
|
|
3089
3215
|
path
|
|
3090
3216
|
}) : /* @__PURE__ */ jsx(Text, {
|
|
3091
3217
|
style: styles$5.meta,
|
|
3092
|
-
children: error ?? "Loading preview…"
|
|
3218
|
+
children: error ?? t("workflow.ui.loadingPreview", "Loading preview…")
|
|
3093
3219
|
});
|
|
3094
3220
|
}
|
|
3095
3221
|
function prettyJson(text) {
|
|
@@ -3155,7 +3281,9 @@ function WorkflowDockPanel(props) {
|
|
|
3155
3281
|
//#region src/extensions/workspaces/(frontend)/dock/workflow.native.tsx
|
|
3156
3282
|
var workflow_native_default$1 = defineDockFace({
|
|
3157
3283
|
id: "workflow",
|
|
3158
|
-
label
|
|
3284
|
+
get label() {
|
|
3285
|
+
return t("workflow.ui.workflow", "Workflow");
|
|
3286
|
+
},
|
|
3159
3287
|
order: 20,
|
|
3160
3288
|
ownsScroll: true,
|
|
3161
3289
|
panel: WorkflowDockPanel,
|
|
@@ -3178,6 +3306,7 @@ var workflow_native_default$1 = defineDockFace({
|
|
|
3178
3306
|
* step gets no channel, so the run is also taken from its workflow session's channel.
|
|
3179
3307
|
*/
|
|
3180
3308
|
function StepParentFill({ sessionId, sessionContext, openSession, holdSessionChannels }) {
|
|
3309
|
+
const t = useT();
|
|
3181
3310
|
const step = sessionId !== null && sessionContext?.provenance === "workflow";
|
|
3182
3311
|
const parent = step ? sessionContext.parentSessionId : void 0;
|
|
3183
3312
|
useEffect(() => {
|
|
@@ -3231,20 +3360,26 @@ function StepParentFill({ sessionId, sessionContext, openSession, holdSessionCha
|
|
|
3231
3360
|
return /* @__PURE__ */ jsx(View, {
|
|
3232
3361
|
testID: "step-parent-strip",
|
|
3233
3362
|
style: styles$4.strip,
|
|
3234
|
-
children: place === void 0 ? /* @__PURE__ */
|
|
3363
|
+
children: place === void 0 ? /* @__PURE__ */ jsxs(Text, {
|
|
3235
3364
|
style: styles$4.text,
|
|
3236
3365
|
numberOfLines: 1,
|
|
3237
|
-
children:
|
|
3366
|
+
children: [
|
|
3367
|
+
" ",
|
|
3368
|
+
t("workflow.ui.stepOfAWorkflowRunThatIsNoLongerAvailable", "Step of a workflow run that is no longer available"),
|
|
3369
|
+
" "
|
|
3370
|
+
]
|
|
3238
3371
|
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Text, {
|
|
3239
3372
|
style: styles$4.text,
|
|
3240
3373
|
numberOfLines: 1,
|
|
3241
3374
|
children: [
|
|
3242
|
-
"Step of
|
|
3375
|
+
t("workflow.ui.stepOf", "Step of"),
|
|
3376
|
+
" ",
|
|
3243
3377
|
/* @__PURE__ */ jsx(Text, {
|
|
3244
3378
|
style: styles$4.name,
|
|
3245
3379
|
children: place.run.displayName
|
|
3246
3380
|
}),
|
|
3247
|
-
" ·
|
|
3381
|
+
" ·",
|
|
3382
|
+
" ",
|
|
3248
3383
|
place.jobLabel
|
|
3249
3384
|
]
|
|
3250
3385
|
}), owner === void 0 || openSession === void 0 ? null : /* @__PURE__ */ jsx(Pressable, {
|
|
@@ -3257,7 +3392,7 @@ function StepParentFill({ sessionId, sessionContext, openSession, holdSessionCha
|
|
|
3257
3392
|
},
|
|
3258
3393
|
children: /* @__PURE__ */ jsx(Text, {
|
|
3259
3394
|
style: styles$4.back,
|
|
3260
|
-
children: "Back to run"
|
|
3395
|
+
children: t("workflow.ui.backToRun", "Back to run")
|
|
3261
3396
|
})
|
|
3262
3397
|
})] })
|
|
3263
3398
|
});
|
|
@@ -3306,7 +3441,9 @@ var StepParent_conversation_strip_native_default = defineFill({ component: StepP
|
|
|
3306
3441
|
//#region src/extensions/workspaces/(frontend)/fill/Workflows.home.native.ts
|
|
3307
3442
|
var Workflows_home_native_default = defineFill({ data: {
|
|
3308
3443
|
version: 1,
|
|
3309
|
-
label
|
|
3444
|
+
get label() {
|
|
3445
|
+
return t("workflow.ui.workflows", "Workflows");
|
|
3446
|
+
},
|
|
3310
3447
|
source: "workflow_runs",
|
|
3311
3448
|
destination: "workflows",
|
|
3312
3449
|
icon: WorkflowIcon
|
|
@@ -3314,6 +3451,7 @@ var Workflows_home_native_default = defineFill({ data: {
|
|
|
3314
3451
|
//#endregion
|
|
3315
3452
|
//#region src/extensions/workspaces/sessions/(frontend)/activity-group/workflows.native.ts
|
|
3316
3453
|
var workflows_native_default = defineActivityGroup({
|
|
3454
|
+
label: (t) => t("workflow.activityGroup.label", "Workflows"),
|
|
3317
3455
|
keys: "w r",
|
|
3318
3456
|
icon: () => createElement(WorkflowIcon),
|
|
3319
3457
|
widgetKeys: ["workflow-mcp-progress", "workflow-mcp-follow"],
|
|
@@ -3350,7 +3488,7 @@ const EMPTY_RUNS = [];
|
|
|
3350
3488
|
function dynamicWorkflowTab() {
|
|
3351
3489
|
return {
|
|
3352
3490
|
id: "dynamic-workflow-runs",
|
|
3353
|
-
label: "Dynamic workflows",
|
|
3491
|
+
label: t("workflow.ui.dynamicWorkflows", "Dynamic workflows"),
|
|
3354
3492
|
panel: DynamicWorkflowPanel,
|
|
3355
3493
|
retainComposer: true
|
|
3356
3494
|
};
|
|
@@ -3358,7 +3496,7 @@ function dynamicWorkflowTab() {
|
|
|
3358
3496
|
function workflowAgentTab(runId, session) {
|
|
3359
3497
|
return {
|
|
3360
3498
|
id: `dynamic-workflow-agent-${encodeURIComponent(runId)}`,
|
|
3361
|
-
label: "Agent transcript",
|
|
3499
|
+
label: t("workflow.ui.agentTranscript", "Agent transcript"),
|
|
3362
3500
|
panel: ({ renderThread, renderSessionTranscript }) => /* @__PURE__ */ jsx(Fragment, { children: session ? renderSessionTranscript?.(runId) : renderThread(runId) }),
|
|
3363
3501
|
retainComposer: true
|
|
3364
3502
|
};
|
|
@@ -3382,6 +3520,7 @@ function DynamicWorkflowPanel({ sessionId, openTransientTab }) {
|
|
|
3382
3520
|
//#endregion
|
|
3383
3521
|
//#region src/extensions/workspaces/sessions/(frontend)/fill/_components/WorkflowsActivitySection.native.tsx
|
|
3384
3522
|
function WorkflowsActivitySection({ sessionId, openSession, openTransientTab }) {
|
|
3523
|
+
const t = useT();
|
|
3385
3524
|
const state = useWorkflows(sessionId);
|
|
3386
3525
|
const dynamicRuns = useDynamicWorkflows(sessionId)?.runs ?? [];
|
|
3387
3526
|
const [openedAt] = useState(Date.now);
|
|
@@ -3438,7 +3577,7 @@ function WorkflowsActivitySection({ sessionId, openSession, openTransientTab })
|
|
|
3438
3577
|
testID: "activity-dynamic-workflows",
|
|
3439
3578
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
3440
3579
|
style: styles$3.heading,
|
|
3441
|
-
children: "Dynamic"
|
|
3580
|
+
children: t("workflow.ui.dynamic", "Dynamic")
|
|
3442
3581
|
}), /* @__PURE__ */ jsx(DynamicWorkflowActivity, {
|
|
3443
3582
|
runs: dynamicRuns,
|
|
3444
3583
|
onOpen: () => openTransientTab(dynamicWorkflowTab())
|
|
@@ -3448,7 +3587,7 @@ function WorkflowsActivitySection({ sessionId, openSession, openTransientTab })
|
|
|
3448
3587
|
style: styles$3.idle,
|
|
3449
3588
|
children: [groups.length === 0 && dynamicRuns.length === 0 ? /* @__PURE__ */ jsx(Text, {
|
|
3450
3589
|
style: styles$3.status,
|
|
3451
|
-
children: "Idle"
|
|
3590
|
+
children: t("workflow.ui.idle", "Idle")
|
|
3452
3591
|
}) : null, /* @__PURE__ */ jsxs(Pressable, {
|
|
3453
3592
|
accessibilityRole: "button",
|
|
3454
3593
|
accessibilityState: { disabled: sessionId === null },
|
|
@@ -3461,7 +3600,7 @@ function WorkflowsActivitySection({ sessionId, openSession, openTransientTab })
|
|
|
3461
3600
|
style: styles$3.action,
|
|
3462
3601
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
3463
3602
|
style: styles$3.actionText(sessionId === null),
|
|
3464
|
-
children: "Launch a workflow"
|
|
3603
|
+
children: t("workflow.ui.launchAWorkflow", "Launch a workflow")
|
|
3465
3604
|
}), /* @__PURE__ */ jsx(ArrowRightIcon, {
|
|
3466
3605
|
size: 14,
|
|
3467
3606
|
color: sessionId === null ? "dim" : "green"
|
|
@@ -3579,9 +3718,6 @@ function detailLines(result) {
|
|
|
3579
3718
|
function firstPayload(result) {
|
|
3580
3719
|
return parseJsonRecord(textBlocks(result)[0]);
|
|
3581
3720
|
}
|
|
3582
|
-
function plural$1(count, singular, pluralForm = `${singular}s`) {
|
|
3583
|
-
return count === 1 ? singular : pluralForm;
|
|
3584
|
-
}
|
|
3585
3721
|
function line(text, tone, extra = {}) {
|
|
3586
3722
|
return {
|
|
3587
3723
|
text,
|
|
@@ -3592,8 +3728,8 @@ function line(text, tone, extra = {}) {
|
|
|
3592
3728
|
function labelValue(label, value) {
|
|
3593
3729
|
return line(`${label} ${value}`, "text");
|
|
3594
3730
|
}
|
|
3595
|
-
function hiddenLine(
|
|
3596
|
-
return line(
|
|
3731
|
+
function hiddenLine(t, count) {
|
|
3732
|
+
return line(t("workflow.result.more", "… {count} more", { count }), "dim");
|
|
3597
3733
|
}
|
|
3598
3734
|
function targetScope(args) {
|
|
3599
3735
|
const runKey = readString$1(args, "runKey");
|
|
@@ -3622,47 +3758,74 @@ function workflowNameFromPath(path) {
|
|
|
3622
3758
|
const filename = path.split("/").at(-1) ?? path;
|
|
3623
3759
|
return filename.replace(/\.workflow\.ya?ml$/u, "") || filename;
|
|
3624
3760
|
}
|
|
3625
|
-
function
|
|
3761
|
+
function callActionLabel(t, action) {
|
|
3762
|
+
switch (action) {
|
|
3763
|
+
case "list": return t("workflow.call.list", "list");
|
|
3764
|
+
case "requirements": return t("workflow.call.requirements", "requirements");
|
|
3765
|
+
case "launch": return t("workflow.call.launch", "launch");
|
|
3766
|
+
case "scaffold": return t("workflow.call.scaffold", "scaffold");
|
|
3767
|
+
case "run": return t("workflow.call.run", "run");
|
|
3768
|
+
case "status": return t("workflow.call.status", "status");
|
|
3769
|
+
case "tail": return t("workflow.call.tail", "tail");
|
|
3770
|
+
case "follow": return t("workflow.call.follow", "follow");
|
|
3771
|
+
case "open": return t("workflow.call.open", "open");
|
|
3772
|
+
case "pause": return t("workflow.call.pause", "pause");
|
|
3773
|
+
case "resume": return t("workflow.call.resume", "resume");
|
|
3774
|
+
case "stop": return t("workflow.call.stop", "stop");
|
|
3775
|
+
case "recover": return t("workflow.call.recover", "recover");
|
|
3776
|
+
case "recovery-evidence": return t("workflow.call.recoveryEvidence", "recovery-evidence");
|
|
3777
|
+
case "list-failed": return t("workflow.call.listFailed", "list-failed");
|
|
3778
|
+
case "validate": return t("workflow.call.validate", "validate");
|
|
3779
|
+
case "abandon": return t("workflow.call.abandon", "abandon");
|
|
3780
|
+
case "inspect-run": return t("workflow.call.inspectRun", "inspect-run");
|
|
3781
|
+
case "repair-run": return t("workflow.call.repairRun", "repair-run");
|
|
3782
|
+
case "help-repair": return t("workflow.call.helpRepair", "help-repair");
|
|
3783
|
+
case "list-runs": return t("workflow.call.listRuns", "list-runs");
|
|
3784
|
+
case "inspect-definition": return t("workflow.call.inspectDefinition", "inspect-definition");
|
|
3785
|
+
default: return action;
|
|
3786
|
+
}
|
|
3787
|
+
}
|
|
3788
|
+
function callMetadata(t, toolName, args) {
|
|
3626
3789
|
const values = [];
|
|
3627
3790
|
if (toolName === "list_workflows") {
|
|
3628
3791
|
const page = readNumber$1(args, "page");
|
|
3629
3792
|
const pageSize = readNumber$1(args, "pageSize");
|
|
3630
|
-
if (page !== void 0) values.push(
|
|
3631
|
-
if (pageSize !== void 0) values.push(
|
|
3632
|
-
if (readString$1(args, "filter")) values.push("filtered");
|
|
3633
|
-
const
|
|
3634
|
-
if (
|
|
3793
|
+
if (page !== void 0) values.push(t("workflow.call.page", "page {page}", { page }));
|
|
3794
|
+
if (pageSize !== void 0) values.push(t("workflow.call.pageSize", "{count}/page", { count: pageSize }));
|
|
3795
|
+
if (readString$1(args, "filter")) values.push(t("workflow.call.filtered", "filtered"));
|
|
3796
|
+
const count = readStringArray(args, "tags").length;
|
|
3797
|
+
if (count > 0) values.push(count === 1 ? t("workflow.call.tags.one", "{count} tag", { count }) : t("workflow.call.tags.many", "{count} tags", { count }));
|
|
3635
3798
|
} else if (toolName === "launch_workflow") {
|
|
3636
3799
|
const job = readString$1(args, "job");
|
|
3637
3800
|
const runner = readString$1(args, "runner");
|
|
3638
3801
|
const workspace = readString$1(args, "workspace");
|
|
3639
3802
|
const inputCount = Object.keys(asRecord$1(args.inputs) ?? {}).length;
|
|
3640
3803
|
const environmentCount = Object.keys(asRecord$1(args.env) ?? {}).length;
|
|
3641
|
-
if (workspace) values.push(
|
|
3642
|
-
if (job) values.push(
|
|
3643
|
-
if (runner) values.push(
|
|
3644
|
-
if (readBoolean(args, "dryRun")) values.push("dry run");
|
|
3645
|
-
if (readString$1(args, "prompt")) values.push("with prompt");
|
|
3646
|
-
if (inputCount > 0) values.push(
|
|
3647
|
-
if (environmentCount > 0) values.push(
|
|
3804
|
+
if (workspace) values.push(t("workflow.call.workspace", "workspace {workspace}", { workspace }));
|
|
3805
|
+
if (job) values.push(t("workflow.result.job", "job {job}", { job }));
|
|
3806
|
+
if (runner) values.push(t("workflow.call.runner", "runner {runner}", { runner }));
|
|
3807
|
+
if (readBoolean(args, "dryRun")) values.push(t("workflow.call.dryRun", "dry run"));
|
|
3808
|
+
if (readString$1(args, "prompt")) values.push(t("workflow.call.withPrompt", "with prompt"));
|
|
3809
|
+
if (inputCount > 0) values.push(inputCount === 1 ? t("workflow.child.input.one", "{count} input", { count: inputCount }) : t("workflow.child.input.many", "{count} inputs", { count: inputCount }));
|
|
3810
|
+
if (environmentCount > 0) values.push(t("workflow.call.envCount", "{count} env", { count: environmentCount }));
|
|
3648
3811
|
} else if (toolName === "scaffold_workflow") {
|
|
3649
|
-
if (readBoolean(args, "force")) values.push("overwrite allowed");
|
|
3812
|
+
if (readBoolean(args, "force")) values.push(t("workflow.call.overwriteAllowed", "overwrite allowed"));
|
|
3650
3813
|
} else {
|
|
3651
|
-
if (readString$1(args, "expectedRunId")) values.push("generation checked");
|
|
3652
|
-
if (readString$1(args, "reason")) values.push("with reason");
|
|
3653
|
-
if (readBoolean(args, "dryRun")) values.push("dry run");
|
|
3654
|
-
if (readString$1(args, "job")) values.push("job override");
|
|
3655
|
-
if (readString$1(args, "runner")) values.push("runner override");
|
|
3814
|
+
if (readString$1(args, "expectedRunId")) values.push(t("workflow.call.generationChecked", "generation checked"));
|
|
3815
|
+
if (readString$1(args, "reason")) values.push(t("workflow.call.withReason", "with reason"));
|
|
3816
|
+
if (readBoolean(args, "dryRun")) values.push(t("workflow.call.dryRun", "dry run"));
|
|
3817
|
+
if (readString$1(args, "job")) values.push(t("workflow.call.jobOverride", "job override"));
|
|
3818
|
+
if (readString$1(args, "runner")) values.push(t("workflow.call.runnerOverride", "runner override"));
|
|
3656
3819
|
}
|
|
3657
3820
|
return values;
|
|
3658
3821
|
}
|
|
3659
3822
|
/** The header beside the tool name: action, target, and the call's flags. */
|
|
3660
|
-
function workflowCallSummary(toolName, args) {
|
|
3823
|
+
function workflowCallSummary(t, toolName, args) {
|
|
3661
3824
|
const target = toolTarget(toolName, args);
|
|
3662
3825
|
return {
|
|
3663
|
-
action: toolAction(toolName, args),
|
|
3826
|
+
action: callActionLabel(t, toolAction(toolName, args)),
|
|
3664
3827
|
...target === void 0 ? {} : { target },
|
|
3665
|
-
metadata: callMetadata(toolName, args)
|
|
3828
|
+
metadata: callMetadata(t, toolName, args)
|
|
3666
3829
|
};
|
|
3667
3830
|
}
|
|
3668
3831
|
function parseCatalog(payload) {
|
|
@@ -3698,90 +3861,95 @@ function parseCatalog(payload) {
|
|
|
3698
3861
|
workflows
|
|
3699
3862
|
};
|
|
3700
3863
|
}
|
|
3701
|
-
function catalogItemLines(item, expanded) {
|
|
3864
|
+
function catalogItemLines(t, item, expanded) {
|
|
3702
3865
|
const lines = [line(`› ${item.name || workflowNameFromPath(item.path)} · ${item.path}`, "text")];
|
|
3703
3866
|
if (!expanded) return lines;
|
|
3704
3867
|
if (item.description) lines.push(line(item.description, "muted", { indent: true }));
|
|
3705
|
-
if (item.tags.length > 0) lines.push(line(
|
|
3868
|
+
if (item.tags.length > 0) lines.push(line(t("workflow.catalog.tags", "tags {tags}", { tags: item.tags.join(", ") }), "dim", { indent: true }));
|
|
3706
3869
|
return lines;
|
|
3707
3870
|
}
|
|
3708
|
-
function catalogLines(result, options) {
|
|
3871
|
+
function catalogLines(t, result, options) {
|
|
3709
3872
|
const catalog = parseCatalog(firstPayload(result));
|
|
3710
3873
|
if (!catalog) return void 0;
|
|
3711
|
-
const
|
|
3712
|
-
|
|
3874
|
+
const vars = {
|
|
3875
|
+
glyph: catalog.total > 0 ? "✓" : "○",
|
|
3876
|
+
count: catalog.total,
|
|
3877
|
+
page: catalog.page,
|
|
3878
|
+
pages: catalog.totalPages
|
|
3879
|
+
};
|
|
3880
|
+
const summary = line(catalog.total === 1 ? t("workflow.catalog.summary.one", "{glyph} {count} workflow · page {page}/{pages}", vars) : t("workflow.catalog.summary.many", "{glyph} {count} workflows · page {page}/{pages}", vars), "hi", { bold: true });
|
|
3713
3881
|
const shown = options.expanded ? catalog.workflows : catalog.workflows.slice(0, COLLAPSED_CATALOG_ROWS);
|
|
3714
|
-
const lines = [summary, ...shown.flatMap((item) => catalogItemLines(item, options.expanded))];
|
|
3882
|
+
const lines = [summary, ...shown.flatMap((item) => catalogItemLines(t, item, options.expanded))];
|
|
3715
3883
|
const hidden = catalog.workflows.length - shown.length;
|
|
3716
|
-
if (hidden > 0) lines.push(hiddenLine(hidden));
|
|
3884
|
+
if (hidden > 0) lines.push(hiddenLine(t, hidden));
|
|
3717
3885
|
if (options.expanded) {
|
|
3718
3886
|
if (catalog.tags.length > 0) {
|
|
3719
3887
|
const tags = catalog.tags.map(({ count, tag }) => `${tag} (${count})`).join(", ");
|
|
3720
|
-
lines.push(
|
|
3888
|
+
lines.push(line(t("workflow.catalog.availableTags", "available tags {tags}", { tags }), "text"));
|
|
3721
3889
|
}
|
|
3722
|
-
if (catalog.directory) lines.push(
|
|
3723
|
-
lines.push(
|
|
3890
|
+
if (catalog.directory) lines.push(line(t("workflow.catalog.directory", "directory {directory}", { directory: catalog.directory }), "text"));
|
|
3891
|
+
lines.push(line(t("workflow.catalog.pageSize", "page size {count}", { count: catalog.pageSize }), "text"));
|
|
3724
3892
|
}
|
|
3725
3893
|
return lines;
|
|
3726
3894
|
}
|
|
3727
|
-
function readWorkflowState(record) {
|
|
3895
|
+
function readWorkflowState(t, record) {
|
|
3728
3896
|
const stage = readString$1(record, "effectiveStage") ?? readString$1(record, "stage") ?? "unknown";
|
|
3729
3897
|
const outcome = readString$1(record, "effectiveOutcome") ?? readString$1(record, "outcome");
|
|
3730
3898
|
const executionState = readString$1(record, "executionState");
|
|
3731
3899
|
if (outcome === "interrupted") return {
|
|
3732
3900
|
tone: "warning",
|
|
3733
3901
|
glyph: "!",
|
|
3734
|
-
label: "interrupted"
|
|
3902
|
+
label: t("workflow.result.interrupted", "interrupted")
|
|
3735
3903
|
};
|
|
3736
3904
|
if (stage === "error" || outcome === "failed") return {
|
|
3737
3905
|
tone: "error",
|
|
3738
3906
|
glyph: "✗",
|
|
3739
|
-
label: "failed"
|
|
3907
|
+
label: t("workflow.result.failed", "failed")
|
|
3740
3908
|
};
|
|
3741
3909
|
if (stage === "completed" && outcome === "skipped") return {
|
|
3742
3910
|
tone: "muted",
|
|
3743
3911
|
glyph: "○",
|
|
3744
|
-
label: "skipped"
|
|
3912
|
+
label: t("workflow.launch.skipped", "skipped")
|
|
3745
3913
|
};
|
|
3746
3914
|
if (stage === "completed") return {
|
|
3747
3915
|
tone: "success",
|
|
3748
3916
|
glyph: "✓",
|
|
3749
|
-
label: "completed"
|
|
3917
|
+
label: t("workflow.child.state.completed", "completed")
|
|
3750
3918
|
};
|
|
3751
3919
|
if (executionState === "paused") return {
|
|
3752
3920
|
tone: "warning",
|
|
3753
3921
|
glyph: "Ⅱ",
|
|
3754
|
-
label: "paused"
|
|
3922
|
+
label: t("workflow.status.paused", "paused")
|
|
3755
3923
|
};
|
|
3756
3924
|
if (executionState === "pause_requested") return {
|
|
3757
3925
|
tone: "warning",
|
|
3758
3926
|
glyph: "◐",
|
|
3759
|
-
label: "pause requested"
|
|
3927
|
+
label: t("workflow.status.pauseRequested", "pause requested")
|
|
3760
3928
|
};
|
|
3761
3929
|
if (executionState === "resume_requested") return {
|
|
3762
3930
|
tone: "warning",
|
|
3763
3931
|
glyph: "◐",
|
|
3764
|
-
label: "resume requested"
|
|
3932
|
+
label: t("workflow.status.resumeRequested", "resume requested")
|
|
3765
3933
|
};
|
|
3766
3934
|
if (stage === "running") return {
|
|
3767
3935
|
tone: "accent",
|
|
3768
3936
|
glyph: "◐",
|
|
3769
|
-
label: "running"
|
|
3937
|
+
label: t("workflow.child.state.running", "running")
|
|
3770
3938
|
};
|
|
3771
3939
|
return {
|
|
3772
3940
|
tone: "muted",
|
|
3773
3941
|
glyph: "○",
|
|
3774
|
-
label: stage
|
|
3942
|
+
label: stage === "unknown" ? t("workflow.status.unknown", "unknown") : stage
|
|
3775
3943
|
};
|
|
3776
3944
|
}
|
|
3777
|
-
function currentActivity(record) {
|
|
3945
|
+
function currentActivity(t, record) {
|
|
3778
3946
|
const position = asRecord$1(record.position);
|
|
3779
3947
|
const cursor = asRecord$1(record.executionCursor);
|
|
3780
3948
|
const job = readString$1(position, "job") ?? readString$1(cursor, "job") ?? readString$1(record, "job");
|
|
3781
3949
|
const step = readString$1(position, "step") ?? readString$1(cursor, "stepName");
|
|
3782
3950
|
const phase = readString$1(cursor, "phase");
|
|
3783
3951
|
if (!job && !step && !phase) return void 0;
|
|
3784
|
-
return line(`[${job ?? phase ?? "workflow"}] ${step ?? phase ?? "current job"}`, "text", { indent: true });
|
|
3952
|
+
return line(`[${job ?? phase ?? t("workflow.launch.fallbackName", "workflow")}] ${step ?? phase ?? t("workflow.status.currentJob", "current job")}`, "text", { indent: true });
|
|
3785
3953
|
}
|
|
3786
3954
|
function launcherLabel(record) {
|
|
3787
3955
|
const launcher = asRecord$1(record.launcher);
|
|
@@ -3790,45 +3958,51 @@ function launcherLabel(record) {
|
|
|
3790
3958
|
const identity = readString$1(launcher, "sessionName") ?? readString$1(launcher, "workspaceId");
|
|
3791
3959
|
return identity ? `${type} ${identity}` : type;
|
|
3792
3960
|
}
|
|
3793
|
-
function workflowRecordLines(record, expanded) {
|
|
3961
|
+
function workflowRecordLines(t, record, expanded) {
|
|
3794
3962
|
const runKey = readString$1(record, "runKey");
|
|
3795
3963
|
const stage = readString$1(record, "stage");
|
|
3796
3964
|
if (!runKey || !stage) return void 0;
|
|
3797
|
-
const state = readWorkflowState(record);
|
|
3965
|
+
const state = readWorkflowState(t, record);
|
|
3966
|
+
const displayName = readString$1(record, "displayName") ?? runKey;
|
|
3967
|
+
const workspace = readString$1(record, "workspace") ?? t("workflow.status.unknown", "unknown");
|
|
3798
3968
|
const lines = [
|
|
3799
|
-
line(
|
|
3800
|
-
|
|
3801
|
-
|
|
3969
|
+
line(t("workflow.status.retrieved", "Status retrieved · {name} · workflow: {status}", {
|
|
3970
|
+
name: displayName,
|
|
3971
|
+
status: state.label
|
|
3972
|
+
}), state.tone, { bold: true }),
|
|
3973
|
+
line(t("workflow.call.workspace", "workspace {workspace}", { workspace }), "text"),
|
|
3974
|
+
line(t("workflow.status.runKey", "runKey {runKey}", { runKey }), "text")
|
|
3802
3975
|
];
|
|
3803
|
-
const activity = currentActivity(record);
|
|
3976
|
+
const activity = currentActivity(t, record);
|
|
3804
3977
|
if (activity) lines.push(activity);
|
|
3805
3978
|
const failure = readString$1(record, "errorMessage") ?? readString$1(record, "failureReason");
|
|
3806
|
-
if (failure) lines.push(line(
|
|
3979
|
+
if (failure) lines.push(line(t("workflow.status.error", "error {reason}", { reason: failure }), "error"));
|
|
3807
3980
|
const staleReason = readString$1(record, "staleReason");
|
|
3808
|
-
if (staleReason) lines.push(line(
|
|
3981
|
+
if (staleReason) lines.push(line(t("workflow.status.stale", "stale {reason}", { reason: staleReason }), "warning"));
|
|
3809
3982
|
const startedAt = readString$1(record, "startedAt");
|
|
3810
3983
|
const exitCode = readNumber$1(record, "exitCode");
|
|
3984
|
+
const runner = readString$1(record, "runner");
|
|
3811
3985
|
const conciseMetadata = [
|
|
3812
|
-
|
|
3813
|
-
readBoolean(record, "dryRun") ? "dry run" : void 0,
|
|
3814
|
-
exitCode !== void 0 ?
|
|
3815
|
-
startedAt ?
|
|
3986
|
+
runner ? t("workflow.call.runner", "runner {runner}", { runner }) : void 0,
|
|
3987
|
+
readBoolean(record, "dryRun") ? t("workflow.call.dryRun", "dry run") : void 0,
|
|
3988
|
+
exitCode !== void 0 ? t("workflow.status.exit", "exit {code}", { code: exitCode }) : void 0,
|
|
3989
|
+
startedAt ? t("workflow.status.startedAt", "started {time}", { time: statusTimestamp(startedAt) }) : void 0
|
|
3816
3990
|
].filter((value) => !!value);
|
|
3817
3991
|
if (conciseMetadata.length > 0) lines.push(line(conciseMetadata.join(" · "), "dim"));
|
|
3818
3992
|
if (!expanded) return lines;
|
|
3819
3993
|
const finishedAt = readString$1(record, "finishedAt");
|
|
3820
3994
|
const repairId = readString$1(record, "activeRepairId");
|
|
3821
3995
|
const detailedValues = [
|
|
3822
|
-
["workflow", readString$1(record, "workflowPath")],
|
|
3823
|
-
["workflow id", readString$1(record, "workflowId")],
|
|
3824
|
-
["run id", readString$1(record, "runId")],
|
|
3825
|
-
["launcher", launcherLabel(record)],
|
|
3826
|
-
["job", readString$1(record, "job")],
|
|
3827
|
-
["outcome", readString$1(record, "effectiveOutcome") ?? readString$1(record, "outcome")],
|
|
3828
|
-
["finished", finishedAt ? statusTimestamp(finishedAt) : void 0],
|
|
3996
|
+
[t("workflow.launch.fallbackName", "workflow"), readString$1(record, "workflowPath")],
|
|
3997
|
+
[t("workflow.status.workflowId", "workflow id"), readString$1(record, "workflowId")],
|
|
3998
|
+
[t("workflow.status.runId", "run id"), readString$1(record, "runId")],
|
|
3999
|
+
[t("workflow.status.launcher", "launcher"), launcherLabel(record)],
|
|
4000
|
+
[t("workflow.status.job", "job"), readString$1(record, "job")],
|
|
4001
|
+
[t("workflow.status.outcome", "outcome"), readString$1(record, "effectiveOutcome") ?? readString$1(record, "outcome")],
|
|
4002
|
+
[t("workflow.status.finished", "finished"), finishedAt ? statusTimestamp(finishedAt) : void 0],
|
|
3829
4003
|
["pid", readNumber$1(record, "pid")?.toString()],
|
|
3830
|
-
["repair", repairId ? `#${repairId}` : void 0],
|
|
3831
|
-
["worktree", readString$1(record, "worktreeBranch") ?? readString$1(record, "worktreePath")]
|
|
4004
|
+
[t("workflow.status.repair", "repair"), repairId ? `#${repairId}` : void 0],
|
|
4005
|
+
[t("workflow.status.worktree", "worktree"), readString$1(record, "worktreeBranch") ?? readString$1(record, "worktreePath")]
|
|
3832
4006
|
];
|
|
3833
4007
|
for (const [label, value] of detailedValues) if (value) lines.push(labelValue(label, value));
|
|
3834
4008
|
const jobs = record.jobs;
|
|
@@ -3837,52 +4011,63 @@ function workflowRecordLines(record, expanded) {
|
|
|
3837
4011
|
const name = readString$1(job, "name");
|
|
3838
4012
|
const status = readString$1(job, "status");
|
|
3839
4013
|
if (!name || !status) continue;
|
|
3840
|
-
lines.push(
|
|
4014
|
+
lines.push(line(t("workflow.status.jobLine", "job {name} · {status}", {
|
|
4015
|
+
name,
|
|
4016
|
+
status
|
|
4017
|
+
}), "text"));
|
|
3841
4018
|
if (!Array.isArray(job?.steps)) continue;
|
|
3842
4019
|
for (const value of job.steps) {
|
|
3843
4020
|
const step = asRecord$1(value);
|
|
3844
4021
|
const stepName = readString$1(step, "name");
|
|
3845
4022
|
const stepStatus = readString$1(step, "status");
|
|
3846
|
-
if (stepName && stepStatus) lines.push(line(
|
|
4023
|
+
if (stepName && stepStatus) lines.push(line(t("workflow.status.stepLine", "step {name} · {status}", {
|
|
4024
|
+
name: stepName,
|
|
4025
|
+
status: stepStatus
|
|
4026
|
+
}), "text", { indent: true }));
|
|
3847
4027
|
}
|
|
3848
4028
|
}
|
|
3849
4029
|
return lines;
|
|
3850
4030
|
}
|
|
3851
|
-
function statusLines(result, options) {
|
|
4031
|
+
function statusLines(t, result, options) {
|
|
3852
4032
|
const payload = firstPayload(result);
|
|
3853
4033
|
if (!payload) return void 0;
|
|
3854
|
-
return workflowRecordLines(payload, options.expanded);
|
|
4034
|
+
return workflowRecordLines(t, payload, options.expanded);
|
|
3855
4035
|
}
|
|
3856
4036
|
function nestedRequestedAt(payload) {
|
|
3857
4037
|
return readString$1(asRecord$1(payload?.request), "requestedAt") ?? readString$1(payload, "requestedAt");
|
|
3858
4038
|
}
|
|
3859
|
-
function controlLines(action, args, result, options) {
|
|
4039
|
+
function controlLines(t, action, args, result, options) {
|
|
3860
4040
|
const payload = firstPayload(result);
|
|
3861
|
-
const
|
|
4041
|
+
const runKey = targetScope(args) ?? readString$1(payload, "runKey");
|
|
3862
4042
|
const payloadWorkspace = readString$1(payload, "workspace");
|
|
3863
|
-
const
|
|
4043
|
+
const fallback = t("workflow.launch.fallbackName", "workflow");
|
|
4044
|
+
const scope = payloadWorkspace && !runKey?.includes("/") ? `${payloadWorkspace}/${runKey ?? fallback}` : runKey ?? fallback;
|
|
4045
|
+
const lines = [line(t("workflow.control.requested", "◐ {action} requested · {scope}", {
|
|
4046
|
+
action: callActionLabel(t, action),
|
|
4047
|
+
scope
|
|
4048
|
+
}), "warning", { bold: true })];
|
|
3864
4049
|
const requestedAt = nestedRequestedAt(payload);
|
|
3865
|
-
if (requestedAt) lines.push(
|
|
3866
|
-
if (options.expanded) lines.push(line("verify the transition with workflow_run status", "dim"));
|
|
4050
|
+
if (requestedAt) lines.push(line(t("workflow.control.requestedAt", "requested {time}", { time: statusTimestamp(requestedAt) }), "text"));
|
|
4051
|
+
if (options.expanded) lines.push(line(t("workflow.control.verify", "verify the transition with workflow_run status"), "dim"));
|
|
3867
4052
|
return lines;
|
|
3868
4053
|
}
|
|
3869
4054
|
function matchLine(text, pattern) {
|
|
3870
4055
|
return text.match(pattern)?.[1]?.trim();
|
|
3871
4056
|
}
|
|
3872
|
-
function launchSummary(text, args) {
|
|
4057
|
+
function launchSummary(t, text, args) {
|
|
3873
4058
|
const startedName = matchLine(text, /^Started (.+) in workspace .+\.$/mu);
|
|
3874
4059
|
const workspace = matchLine(text, /^Started .+ in workspace (.+)\.$/mu) ?? readString$1(args, "workspace");
|
|
3875
4060
|
const runKey = matchLine(text, /^Run key:\s*(.+)$/mu);
|
|
3876
4061
|
const path = readString$1(args, "workflowPath");
|
|
3877
|
-
const name = startedName ?? workflowNameFromPath(path);
|
|
3878
|
-
const scope = runKey ? workspace ? `${workspace}/${runKey}` : runKey : workspace ?? path ?? "workflow";
|
|
4062
|
+
const name = startedName ?? (path ? workflowNameFromPath(path) : t("workflow.launch.fallbackName", "workflow"));
|
|
4063
|
+
const scope = runKey ? workspace ? `${workspace}/${runKey}` : runKey : workspace ?? path ?? t("workflow.launch.fallbackName", "workflow");
|
|
3879
4064
|
if (/Workflow completed successfully/iu.test(text)) return {
|
|
3880
4065
|
name,
|
|
3881
4066
|
scope,
|
|
3882
4067
|
state: {
|
|
3883
4068
|
tone: "success",
|
|
3884
4069
|
glyph: "✓",
|
|
3885
|
-
label: "completed"
|
|
4070
|
+
label: t("workflow.child.state.completed", "completed")
|
|
3886
4071
|
}
|
|
3887
4072
|
};
|
|
3888
4073
|
if (/Workflow skipped/iu.test(text)) return {
|
|
@@ -3891,7 +4076,7 @@ function launchSummary(text, args) {
|
|
|
3891
4076
|
state: {
|
|
3892
4077
|
tone: "muted",
|
|
3893
4078
|
glyph: "○",
|
|
3894
|
-
label: "skipped"
|
|
4079
|
+
label: t("workflow.launch.skipped", "skipped")
|
|
3895
4080
|
}
|
|
3896
4081
|
};
|
|
3897
4082
|
if (/no run was registered/iu.test(text)) return {
|
|
@@ -3900,7 +4085,7 @@ function launchSummary(text, args) {
|
|
|
3900
4085
|
state: {
|
|
3901
4086
|
tone: "warning",
|
|
3902
4087
|
glyph: "◐",
|
|
3903
|
-
label: "starting · run key pending"
|
|
4088
|
+
label: t("workflow.launch.runKeyPending", "starting · run key pending")
|
|
3904
4089
|
}
|
|
3905
4090
|
};
|
|
3906
4091
|
return {
|
|
@@ -3909,17 +4094,19 @@ function launchSummary(text, args) {
|
|
|
3909
4094
|
state: {
|
|
3910
4095
|
tone: "accent",
|
|
3911
4096
|
glyph: "◐",
|
|
3912
|
-
label: runKey ? "started" : "launch accepted"
|
|
4097
|
+
label: runKey ? t("workflow.launch.started", "started") : t("workflow.launch.accepted", "launch accepted")
|
|
3913
4098
|
}
|
|
3914
4099
|
};
|
|
3915
4100
|
}
|
|
3916
|
-
function launchLines(args, result, options) {
|
|
3917
|
-
const summary = launchSummary(textBlocks(result).join("\n"), args);
|
|
4101
|
+
function launchLines(t, args, result, options) {
|
|
4102
|
+
const summary = launchSummary(t, textBlocks(result).join("\n"), args);
|
|
3918
4103
|
const lines = [line(`${summary.state.glyph} ${summary.name} · ${summary.scope} · ${summary.state.label}`, summary.state.tone, { bold: true })];
|
|
4104
|
+
const job = readString$1(args, "job");
|
|
4105
|
+
const runner = readString$1(args, "runner");
|
|
3919
4106
|
const metadata = [
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
readBoolean(args, "dryRun") ? "dry run" : void 0
|
|
4107
|
+
job ? t("workflow.result.job", "job {job}", { job }) : void 0,
|
|
4108
|
+
runner ? t("workflow.call.runner", "runner {runner}", { runner }) : void 0,
|
|
4109
|
+
readBoolean(args, "dryRun") ? t("workflow.call.dryRun", "dry run") : void 0
|
|
3923
4110
|
].filter((value) => !!value);
|
|
3924
4111
|
if (metadata.length > 0) lines.push(line(metadata.join(" · "), "dim"));
|
|
3925
4112
|
if (options.expanded) {
|
|
@@ -3945,39 +4132,30 @@ function splitEvidence(text) {
|
|
|
3945
4132
|
}
|
|
3946
4133
|
return sections;
|
|
3947
4134
|
}
|
|
3948
|
-
function recoveryEvidenceLines(args, result, options) {
|
|
4135
|
+
function recoveryEvidenceLines(t, args, result, options) {
|
|
3949
4136
|
const sections = splitEvidence(textBlocks(result).join("\n"));
|
|
3950
4137
|
const record = parseJsonRecord(sections.find((section) => section.name === "run.json")?.body.join("\n"));
|
|
3951
|
-
const recordLines = record ? workflowRecordLines(record, options.expanded) : void 0;
|
|
4138
|
+
const recordLines = record ? workflowRecordLines(t, record, options.expanded) : void 0;
|
|
3952
4139
|
const evidenceSections = sections.filter((section) => section.name !== "run.json");
|
|
3953
|
-
const scope = targetScope(args) ?? "workflow";
|
|
3954
|
-
const lines = recordLines ?? [line(
|
|
4140
|
+
const scope = targetScope(args) ?? t("workflow.launch.fallbackName", "workflow");
|
|
4141
|
+
const lines = recordLines ?? [line(t("workflow.control.evidence", "✓ recovery evidence · {scope}", { scope }), "success", { bold: true })];
|
|
3955
4142
|
const names = evidenceSections.map((section) => section.name);
|
|
3956
|
-
lines.push(names.length > 0 ?
|
|
4143
|
+
lines.push(names.length > 0 ? line(t("workflow.control.evidenceFiles", "evidence {files}", { files: names.join(", ") }), "text") : line(t("workflow.control.noEvidenceFiles", "no durable evidence files recorded"), "muted"));
|
|
3957
4144
|
if (options.expanded) for (const section of evidenceSections) {
|
|
3958
4145
|
lines.push(line(section.name, "hi", { bold: true }));
|
|
3959
4146
|
lines.push(...section.body.filter((entry) => entry.length > 0).map((entry) => line(entry, "text")));
|
|
3960
4147
|
}
|
|
3961
4148
|
return lines;
|
|
3962
4149
|
}
|
|
3963
|
-
function simpleActionLines(action, args, result, options) {
|
|
3964
|
-
const scope = targetScope(args) ?? "workflow";
|
|
3965
|
-
const
|
|
3966
|
-
follow: "following output",
|
|
3967
|
-
open: "launcher opened",
|
|
3968
|
-
recover: readBoolean(args, "dryRun") ? "recovery dry run finished" : "recovery accepted",
|
|
3969
|
-
tail: "launcher output checked"
|
|
3970
|
-
};
|
|
3971
|
-
const
|
|
3972
|
-
tone: "accent",
|
|
3973
|
-
glyph: "◐",
|
|
3974
|
-
label: actionLabel[action] ?? action
|
|
3975
|
-
} : {
|
|
3976
|
-
tone: "success",
|
|
3977
|
-
glyph: "✓",
|
|
3978
|
-
label: actionLabel[action] ?? action
|
|
3979
|
-
};
|
|
3980
|
-
const lines = [line(`${state.glyph} ${state.label} · ${scope}`, state.tone, { bold: true })];
|
|
4150
|
+
function simpleActionLines(t, action, args, result, options) {
|
|
4151
|
+
const scope = targetScope(args) ?? t("workflow.launch.fallbackName", "workflow");
|
|
4152
|
+
const label = {
|
|
4153
|
+
follow: t("workflow.control.following", "following output"),
|
|
4154
|
+
open: t("workflow.control.opened", "launcher opened"),
|
|
4155
|
+
recover: readBoolean(args, "dryRun") ? t("workflow.control.dryRunFinished", "recovery dry run finished") : t("workflow.control.recoveryAccepted", "recovery accepted"),
|
|
4156
|
+
tail: t("workflow.control.tailChecked", "launcher output checked")
|
|
4157
|
+
}[action];
|
|
4158
|
+
const lines = [line(`${action === "recover" ? "◐" : "✓"} ${label} · ${scope}`, action === "recover" ? "accent" : "success", { bold: true })];
|
|
3981
4159
|
const details = detailLines(result);
|
|
3982
4160
|
if (action === "tail") {
|
|
3983
4161
|
const workflowLine = details.find((entry) => entry.startsWith("Workflow:"));
|
|
@@ -3988,59 +4166,59 @@ function simpleActionLines(action, args, result, options) {
|
|
|
3988
4166
|
if (options.expanded) lines.push(...details.map((entry) => line(entry, "text")));
|
|
3989
4167
|
return lines;
|
|
3990
4168
|
}
|
|
3991
|
-
function failureLines(toolName, args, result, options) {
|
|
4169
|
+
function failureLines(t, toolName, args, result, options) {
|
|
3992
4170
|
const action = toolAction(toolName, args);
|
|
3993
4171
|
const target = toolTarget(toolName, args);
|
|
3994
4172
|
const details = detailLines(result);
|
|
3995
4173
|
const shown = options.expanded ? details : details.slice(0, COLLAPSED_DETAIL_LINES);
|
|
3996
|
-
const lines = [line(toolName === "workflow_run" && action === "status" ?
|
|
4174
|
+
const lines = [line(`✗ ${toolName === "workflow_run" && action === "status" ? t("workflow.result.statusLookupFailed", "Status lookup failed") : t("workflow.result.actionFailed", "{action} failed", { action: callActionLabel(t, action) })}${target ? ` · ${target}` : ""}`, "error", { bold: true }), ...shown.length > 0 ? shown.map((entry) => line(entry, "text")) : [line(t("workflow.result.unknownError", "Unknown workflow error"), "error")]];
|
|
3997
4175
|
const hidden = details.length - shown.length;
|
|
3998
|
-
if (hidden > 0) lines.push(hiddenLine(hidden));
|
|
4176
|
+
if (hidden > 0) lines.push(hiddenLine(t, hidden));
|
|
3999
4177
|
return lines;
|
|
4000
4178
|
}
|
|
4001
|
-
function partialLines(toolName, args, result) {
|
|
4179
|
+
function partialLines(t, toolName, args, result) {
|
|
4002
4180
|
const details = detailLines(result);
|
|
4003
4181
|
const shown = details.slice(-4);
|
|
4004
4182
|
const action = toolAction(toolName, args);
|
|
4005
4183
|
const target = toolTarget(toolName, args);
|
|
4006
4184
|
const hidden = details.length - shown.length;
|
|
4007
|
-
const lines = [line(`◐ ${action}${target ? ` · ${target}` : ""}`, "accent", { bold: true })];
|
|
4008
|
-
if (hidden > 0) lines.push(line(
|
|
4185
|
+
const lines = [line(`◐ ${callActionLabel(t, action)}${target ? ` · ${target}` : ""}`, "accent", { bold: true })];
|
|
4186
|
+
if (hidden > 0) lines.push(line(t("workflow.result.earlier", "… {count} earlier", { count: hidden }), "dim"));
|
|
4009
4187
|
lines.push(...shown.map((entry) => line(entry, "text")));
|
|
4010
4188
|
return lines;
|
|
4011
4189
|
}
|
|
4012
|
-
function fallbackLines(result, options) {
|
|
4190
|
+
function fallbackLines(t, result, options) {
|
|
4013
4191
|
const details = detailLines(result);
|
|
4014
|
-
if (details.length === 0) return [line("No workflow output.", "muted")];
|
|
4192
|
+
if (details.length === 0) return [line(t("workflow.result.noOutput", "No workflow output."), "muted")];
|
|
4015
4193
|
const shown = options.expanded ? details : details.slice(0, COLLAPSED_DETAIL_LINES);
|
|
4016
4194
|
const lines = shown.map((entry) => line(entry, "text"));
|
|
4017
4195
|
const hidden = details.length - shown.length;
|
|
4018
|
-
if (hidden > 0) lines.push(hiddenLine(hidden));
|
|
4196
|
+
if (hidden > 0) lines.push(hiddenLine(t, hidden));
|
|
4019
4197
|
return lines;
|
|
4020
4198
|
}
|
|
4021
4199
|
/** The body of a workflow tool card, chosen by tool, action, and result shape. */
|
|
4022
|
-
function workflowResultLines(toolName, args, result, options) {
|
|
4023
|
-
if (options.isPartial) return partialLines(toolName, args, result);
|
|
4024
|
-
if (options.isError) return failureLines(toolName, args, result, options);
|
|
4025
|
-
if (toolName === "list_workflows") return catalogLines(result, options) ?? fallbackLines(result, options);
|
|
4026
|
-
if (toolName === "launch_workflow") return launchLines(args, result, options);
|
|
4200
|
+
function workflowResultLines(t, toolName, args, result, options) {
|
|
4201
|
+
if (options.isPartial) return partialLines(t, toolName, args, result);
|
|
4202
|
+
if (options.isError) return failureLines(t, toolName, args, result, options);
|
|
4203
|
+
if (toolName === "list_workflows") return catalogLines(t, result, options) ?? fallbackLines(t, result, options);
|
|
4204
|
+
if (toolName === "launch_workflow") return launchLines(t, args, result, options);
|
|
4027
4205
|
const action = readString$1(args, "action");
|
|
4028
|
-
if (action === "status") return statusLines(result, options) ?? fallbackLines(result, options);
|
|
4029
|
-
if (action === "pause" || action === "resume" || action === "stop") return controlLines(action, args, result, options);
|
|
4030
|
-
if (action === "recovery-evidence") return recoveryEvidenceLines(args, result, options);
|
|
4031
|
-
if (action === "follow" || action === "open" || action === "recover" || action === "tail") return simpleActionLines(action, args, result, options);
|
|
4032
|
-
return fallbackLines(result, options);
|
|
4206
|
+
if (action === "status") return statusLines(t, result, options) ?? fallbackLines(t, result, options);
|
|
4207
|
+
if (action === "pause" || action === "resume" || action === "stop") return controlLines(t, action, args, result, options);
|
|
4208
|
+
if (action === "recovery-evidence") return recoveryEvidenceLines(t, args, result, options);
|
|
4209
|
+
if (action === "follow" || action === "open" || action === "recover" || action === "tail") return simpleActionLines(t, action, args, result, options);
|
|
4210
|
+
return fallbackLines(t, result, options);
|
|
4033
4211
|
}
|
|
4034
4212
|
/**
|
|
4035
4213
|
* The reason a failed call gives, for a card that shows only the reason: the
|
|
4036
4214
|
* `{ error }` payload the runtime answers a failed operation with, or the plain
|
|
4037
4215
|
* text a launch failure carries.
|
|
4038
4216
|
*/
|
|
4039
|
-
function workflowFailureReason(result, output = "") {
|
|
4217
|
+
function workflowFailureReason(t, result, output = "") {
|
|
4040
4218
|
const text = (textBlocks(result).join("\n") || output).trim();
|
|
4041
4219
|
const error = readString$1(parseJsonRecord(text), "error");
|
|
4042
4220
|
if (error) return error;
|
|
4043
|
-
return text || "Unknown workflow error";
|
|
4221
|
+
return text || t("workflow.result.unknownError", "Unknown workflow error");
|
|
4044
4222
|
}
|
|
4045
4223
|
function parseJsonValue(text) {
|
|
4046
4224
|
try {
|
|
@@ -4049,7 +4227,7 @@ function parseJsonValue(text) {
|
|
|
4049
4227
|
return;
|
|
4050
4228
|
}
|
|
4051
4229
|
}
|
|
4052
|
-
function failedRunsView(payload) {
|
|
4230
|
+
function failedRunsView(t, payload) {
|
|
4053
4231
|
if (!Array.isArray(payload)) return void 0;
|
|
4054
4232
|
const rows = payload.flatMap((value) => {
|
|
4055
4233
|
const record = asRecord$1(value);
|
|
@@ -4061,7 +4239,7 @@ function failedRunsView(payload) {
|
|
|
4061
4239
|
const outcome = readString$1(record, "outcome") ?? "failed";
|
|
4062
4240
|
const detail = [
|
|
4063
4241
|
workspace ? `${workspace}/${runKey}` : runKey,
|
|
4064
|
-
failedJob ?
|
|
4242
|
+
failedJob ? t("workflow.result.job", "job {job}", { job: failedJob }) : void 0,
|
|
4065
4243
|
updatedAt ? statusTimestamp(updatedAt) : void 0
|
|
4066
4244
|
].filter((entry) => !!entry);
|
|
4067
4245
|
return [{
|
|
@@ -4069,31 +4247,31 @@ function failedRunsView(payload) {
|
|
|
4069
4247
|
title: readString$1(record, "displayName") ?? runKey,
|
|
4070
4248
|
detail: detail.join(" · "),
|
|
4071
4249
|
chip: {
|
|
4072
|
-
label: outcome,
|
|
4250
|
+
label: outcome === "interrupted" ? t("workflow.result.interrupted", "interrupted") : outcome === "failed" ? t("workflow.result.failed", "failed") : outcome,
|
|
4073
4251
|
tone: outcome === "interrupted" ? "yellow" : "red"
|
|
4074
4252
|
}
|
|
4075
4253
|
}];
|
|
4076
4254
|
});
|
|
4077
4255
|
if (rows.length !== payload.length) return void 0;
|
|
4078
4256
|
return {
|
|
4079
|
-
headline: rows.length === 0 ? "No failed runs" :
|
|
4257
|
+
headline: rows.length === 0 ? t("workflow.result.noFailedRuns", "No failed runs") : rows.length === 1 ? t("workflow.result.failedRuns.one", "{count} failed run", { count: rows.length }) : t("workflow.result.failedRuns.many", "{count} failed runs", { count: rows.length }),
|
|
4080
4258
|
facts: [],
|
|
4081
4259
|
rows,
|
|
4082
|
-
...rows.length > 0 ? { note: "Read recovery-evidence before recover." } : {}
|
|
4260
|
+
...rows.length > 0 ? { note: t("workflow.result.recoveryAdvice", "Read recovery-evidence before recover.") } : {}
|
|
4083
4261
|
};
|
|
4084
4262
|
}
|
|
4085
|
-
function scalarText(value) {
|
|
4263
|
+
function scalarText(t, value) {
|
|
4086
4264
|
if (typeof value === "string") return inlineText(value) || void 0;
|
|
4087
4265
|
if (typeof value === "number" && Number.isFinite(value)) return String(value);
|
|
4088
|
-
if (typeof value === "boolean") return value ? "yes" : "no";
|
|
4266
|
+
if (typeof value === "boolean") return value ? t("workflow.result.yes", "yes") : t("workflow.result.no", "no");
|
|
4089
4267
|
}
|
|
4090
4268
|
/** Any JSON result as its scalar figures and list counts, or a list of rows for an array. */
|
|
4091
|
-
function workflowGenericView(payload) {
|
|
4269
|
+
function workflowGenericView(t, payload) {
|
|
4092
4270
|
if (Array.isArray(payload)) {
|
|
4093
4271
|
const rows = payload.map((value, index) => {
|
|
4094
4272
|
const record = asRecord$1(value);
|
|
4095
|
-
const scalars = Object.values(record ?? {}).flatMap((entry) => scalarText(entry) ?? []);
|
|
4096
|
-
const title = scalarText(value) ?? scalars[0] ??
|
|
4273
|
+
const scalars = Object.values(record ?? {}).flatMap((entry) => scalarText(t, entry) ?? []);
|
|
4274
|
+
const title = scalarText(t, value) ?? scalars[0] ?? t("workflow.result.itemIndex", "item {index}", { index: index + 1 });
|
|
4097
4275
|
const rest = scalars.slice(1).join(" · ");
|
|
4098
4276
|
return {
|
|
4099
4277
|
key: String(index),
|
|
@@ -4102,62 +4280,68 @@ function workflowGenericView(payload) {
|
|
|
4102
4280
|
};
|
|
4103
4281
|
});
|
|
4104
4282
|
return {
|
|
4105
|
-
headline:
|
|
4283
|
+
headline: itemCount(t, rows.length),
|
|
4106
4284
|
facts: [],
|
|
4107
4285
|
rows
|
|
4108
4286
|
};
|
|
4109
4287
|
}
|
|
4110
4288
|
const record = asRecord$1(payload) ?? {};
|
|
4111
4289
|
const facts = Object.entries(record).flatMap(([label, value]) => {
|
|
4112
|
-
const scalar = scalarText(value);
|
|
4290
|
+
const scalar = scalarText(t, value);
|
|
4113
4291
|
if (scalar !== void 0) return [{
|
|
4114
4292
|
label,
|
|
4115
4293
|
value: scalar
|
|
4116
4294
|
}];
|
|
4117
4295
|
if (Array.isArray(value)) return [{
|
|
4118
4296
|
label,
|
|
4119
|
-
value:
|
|
4297
|
+
value: itemCount(t, value.length)
|
|
4120
4298
|
}];
|
|
4121
4299
|
const nested = asRecord$1(value);
|
|
4122
4300
|
if (nested) {
|
|
4123
4301
|
const count = Object.keys(nested).length;
|
|
4124
4302
|
return [{
|
|
4125
4303
|
label,
|
|
4126
|
-
value:
|
|
4304
|
+
value: count === 1 ? t("workflow.result.fields.one", "{count} field", { count }) : t("workflow.result.fields.many", "{count} fields", { count })
|
|
4127
4305
|
}];
|
|
4128
4306
|
}
|
|
4129
4307
|
return [];
|
|
4130
4308
|
});
|
|
4131
4309
|
return {
|
|
4132
|
-
headline: facts.length === 0 ? "No details returned" : "Result",
|
|
4310
|
+
headline: facts.length === 0 ? t("workflow.result.noDetails", "No details returned") : t("workflow.result.title", "Result"),
|
|
4133
4311
|
facts,
|
|
4134
4312
|
rows: []
|
|
4135
4313
|
};
|
|
4136
4314
|
}
|
|
4315
|
+
function itemCount(t, count) {
|
|
4316
|
+
return count === 1 ? t("workflow.result.items.one", "{count} item", { count }) : t("workflow.result.items.many", "{count} items", { count });
|
|
4317
|
+
}
|
|
4137
4318
|
/**
|
|
4138
4319
|
* The laid-out form of a JSON result the toned lines would otherwise print
|
|
4139
4320
|
* as raw text, or undefined when the lines already parse it (the catalog, a
|
|
4140
4321
|
* run record, a control request) or the result is plain text.
|
|
4141
4322
|
*/
|
|
4142
|
-
function workflowStructuredView(toolName, args, result) {
|
|
4323
|
+
function workflowStructuredView(t, toolName, args, result) {
|
|
4143
4324
|
const text = textBlocks(result).join("\n").trim();
|
|
4144
4325
|
if (!text.startsWith("{") && !text.startsWith("[")) return void 0;
|
|
4145
4326
|
const payload = parseJsonValue(text);
|
|
4146
4327
|
if (payload === void 0) return void 0;
|
|
4147
4328
|
const action = readString$1(args, "action");
|
|
4148
|
-
if (toolName === "workflow_tools" && action === "list-failed") return failedRunsView(payload) ?? workflowGenericView(payload);
|
|
4329
|
+
if (toolName === "workflow_tools" && action === "list-failed") return failedRunsView(t, payload) ?? workflowGenericView(t, payload);
|
|
4149
4330
|
const record = asRecord$1(payload);
|
|
4150
4331
|
if (toolName === "list_workflows" && parseCatalog(record)) return void 0;
|
|
4151
4332
|
if (toolName === "launch_workflow") return void 0;
|
|
4152
|
-
if (action === "status" && record &&
|
|
4333
|
+
if (action === "status" && readString$1(record, "runKey") && readString$1(record, "stage")) return void 0;
|
|
4153
4334
|
if (action === "pause" || action === "resume" || action === "stop") return void 0;
|
|
4154
|
-
return workflowGenericView(payload);
|
|
4335
|
+
return workflowGenericView(t, payload);
|
|
4155
4336
|
}
|
|
4156
4337
|
/** A launched workflow is the one workflow call that reads as news; lookups and run controls stay compact. */
|
|
4157
|
-
function workflowActivity({ toolName, args, result, running, isError }) {
|
|
4338
|
+
function workflowActivity(t, { toolName, args, result, running, isError }) {
|
|
4158
4339
|
if (isError || toolName !== "launch_workflow") return [];
|
|
4159
|
-
const summary = launchSummary(textBlocks(result).join("\n"), args);
|
|
4160
|
-
return [running ?
|
|
4340
|
+
const summary = launchSummary(t, textBlocks(result).join("\n"), args);
|
|
4341
|
+
return [running ? t("workflow.launch.activityRunning", "Launching workflow {name}", { name: summary.name }) : t("workflow.launch.activitySettled", "Workflow {name}: {status}", {
|
|
4342
|
+
name: summary.name,
|
|
4343
|
+
status: summary.state.label
|
|
4344
|
+
})];
|
|
4161
4345
|
}
|
|
4162
4346
|
//#endregion
|
|
4163
4347
|
//#region src/extensions/workspaces/sessions/(frontend)/tool/_lib/workflowChildToolView.ts
|
|
@@ -4196,9 +4380,6 @@ function readNumber(record, key) {
|
|
|
4196
4380
|
const value = record?.[key];
|
|
4197
4381
|
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
4198
4382
|
}
|
|
4199
|
-
function plural(count, singular, pluralForm = `${singular}s`) {
|
|
4200
|
-
return count === 1 ? singular : pluralForm;
|
|
4201
|
-
}
|
|
4202
4383
|
function timestamp(value) {
|
|
4203
4384
|
return value.replace("T", " ").replace(/\.\d{3}Z$/u, "Z");
|
|
4204
4385
|
}
|
|
@@ -4235,13 +4416,13 @@ function criteriaResults(args) {
|
|
|
4235
4416
|
}] : [];
|
|
4236
4417
|
});
|
|
4237
4418
|
}
|
|
4238
|
-
function workflowChildSummary(toolName, args) {
|
|
4419
|
+
function workflowChildSummary(t, toolName, args) {
|
|
4239
4420
|
if (toolName === "workflow_spawn_child") {
|
|
4240
4421
|
const inputs = Object.keys(asRecord(args.inputs) ?? {}).length;
|
|
4241
4422
|
const job = readString(args, "job");
|
|
4242
4423
|
return {
|
|
4243
4424
|
...job === void 0 ? {} : { primary: job },
|
|
4244
|
-
detail: inputs > 0 ? [
|
|
4425
|
+
detail: inputs > 0 ? [inputs === 1 ? t("workflow.child.input.one", "{count} input", { count: inputs }) : t("workflow.child.input.many", "{count} inputs", { count: inputs })] : []
|
|
4245
4426
|
};
|
|
4246
4427
|
}
|
|
4247
4428
|
if (toolName === "workflow_child_status") {
|
|
@@ -4256,20 +4437,20 @@ function workflowChildSummary(toolName, args) {
|
|
|
4256
4437
|
if (results.length === 0) return { detail: [] };
|
|
4257
4438
|
const notMet = results.filter((entry) => entry.status === "not-met").length;
|
|
4258
4439
|
return {
|
|
4259
|
-
primary:
|
|
4260
|
-
detail: notMet > 0 ? [
|
|
4440
|
+
primary: results.length === 1 ? t("workflow.child.criterion.one", "{count} criterion", { count: results.length }) : t("workflow.child.criterion.many", "{count} criteria", { count: results.length }),
|
|
4441
|
+
detail: notMet > 0 ? [t("workflow.child.notMetCount", "{count} not met", { count: notMet })] : []
|
|
4261
4442
|
};
|
|
4262
4443
|
}
|
|
4263
4444
|
return { detail: [] };
|
|
4264
4445
|
}
|
|
4265
4446
|
/** What the card says while the call runs. */
|
|
4266
|
-
function workflowChildRunningLabel(toolName) {
|
|
4267
|
-
if (toolName === "workflow_spawn_child") return "Starting the child";
|
|
4268
|
-
if (toolName === "workflow_child_status") return "Reading the child";
|
|
4269
|
-
if (toolName === "workflow_children") return "Reading the children";
|
|
4270
|
-
if (toolName === "workflow_report_criteria") return "Reporting criteria";
|
|
4271
|
-
if (toolName === "workflow_review_artifacts") return "Reading the artifacts";
|
|
4272
|
-
return "Running";
|
|
4447
|
+
function workflowChildRunningLabel(t, toolName) {
|
|
4448
|
+
if (toolName === "workflow_spawn_child") return t("workflow.child.starting", "Starting the child");
|
|
4449
|
+
if (toolName === "workflow_child_status") return t("workflow.child.readingChild", "Reading the child");
|
|
4450
|
+
if (toolName === "workflow_children") return t("workflow.child.readingChildren", "Reading the children");
|
|
4451
|
+
if (toolName === "workflow_report_criteria") return t("workflow.child.reporting", "Reporting criteria");
|
|
4452
|
+
if (toolName === "workflow_review_artifacts") return t("workflow.child.readingArtifacts", "Reading the artifacts");
|
|
4453
|
+
return t("workflow.child.running", "Running");
|
|
4273
4454
|
}
|
|
4274
4455
|
const INVOCATION_CHIPS = {
|
|
4275
4456
|
running: {
|
|
@@ -4303,13 +4484,46 @@ const CRITERION_CHIPS = {
|
|
|
4303
4484
|
tone: "neutral"
|
|
4304
4485
|
}
|
|
4305
4486
|
};
|
|
4306
|
-
function
|
|
4307
|
-
|
|
4487
|
+
function translatedChip(t, chip) {
|
|
4488
|
+
switch (chip.label) {
|
|
4489
|
+
case "running": return {
|
|
4490
|
+
...chip,
|
|
4491
|
+
label: t("workflow.child.state.running", "running")
|
|
4492
|
+
};
|
|
4493
|
+
case "completed": return {
|
|
4494
|
+
...chip,
|
|
4495
|
+
label: t("workflow.child.state.completed", "completed")
|
|
4496
|
+
};
|
|
4497
|
+
case "failed": return {
|
|
4498
|
+
...chip,
|
|
4499
|
+
label: t("workflow.child.state.failed", "failed")
|
|
4500
|
+
};
|
|
4501
|
+
case "interrupted": return {
|
|
4502
|
+
...chip,
|
|
4503
|
+
label: t("workflow.child.state.interrupted", "interrupted")
|
|
4504
|
+
};
|
|
4505
|
+
case "checked": return {
|
|
4506
|
+
...chip,
|
|
4507
|
+
label: t("workflow.child.state.checked", "checked")
|
|
4508
|
+
};
|
|
4509
|
+
case "not met": return {
|
|
4510
|
+
...chip,
|
|
4511
|
+
label: t("workflow.child.state.not-met", "not met")
|
|
4512
|
+
};
|
|
4513
|
+
case "unchecked": return {
|
|
4514
|
+
...chip,
|
|
4515
|
+
label: t("workflow.child.state.unchecked", "unchecked")
|
|
4516
|
+
};
|
|
4517
|
+
default: return chip;
|
|
4518
|
+
}
|
|
4519
|
+
}
|
|
4520
|
+
function invocationChip(t, state) {
|
|
4521
|
+
return translatedChip(t, INVOCATION_CHIPS[state] ?? {
|
|
4308
4522
|
label: state,
|
|
4309
4523
|
tone: "neutral"
|
|
4310
|
-
};
|
|
4524
|
+
});
|
|
4311
4525
|
}
|
|
4312
|
-
function invocationView(value) {
|
|
4526
|
+
function invocationView(t, value) {
|
|
4313
4527
|
const record = asRecord(value);
|
|
4314
4528
|
const invocationId = readString(record, "invocationId");
|
|
4315
4529
|
const job = readString(record, "job");
|
|
@@ -4319,32 +4533,32 @@ function invocationView(value) {
|
|
|
4319
4533
|
const startedAt = readString(record, "startedAt");
|
|
4320
4534
|
const endedAt = readString(record, "endedAt");
|
|
4321
4535
|
const facts = [{
|
|
4322
|
-
label: "invocation",
|
|
4536
|
+
label: t("workflow.child.invocation", "invocation"),
|
|
4323
4537
|
value: invocationId
|
|
4324
4538
|
}];
|
|
4325
4539
|
if (startedAt) facts.push({
|
|
4326
|
-
label: "started",
|
|
4540
|
+
label: t("workflow.child.started", "started"),
|
|
4327
4541
|
value: timestamp(startedAt)
|
|
4328
4542
|
});
|
|
4329
4543
|
if (endedAt) facts.push({
|
|
4330
|
-
label: "ended",
|
|
4544
|
+
label: t("workflow.child.ended", "ended"),
|
|
4331
4545
|
value: timestamp(endedAt)
|
|
4332
4546
|
});
|
|
4333
4547
|
if (sessions.length > 0) facts.push({
|
|
4334
|
-
label: "sessions",
|
|
4548
|
+
label: t("workflow.child.sessions", "sessions"),
|
|
4335
4549
|
value: String(sessions.length)
|
|
4336
4550
|
});
|
|
4337
4551
|
const error = readString(record, "error");
|
|
4338
4552
|
return {
|
|
4339
4553
|
headline: job,
|
|
4340
|
-
chip: invocationChip(state),
|
|
4554
|
+
chip: invocationChip(t, state),
|
|
4341
4555
|
facts,
|
|
4342
4556
|
sections: [],
|
|
4343
4557
|
...error === void 0 ? {} : { error },
|
|
4344
|
-
...state === "running" ? { note: "Check back with childStatus; a started child is not a finished one." } : {}
|
|
4558
|
+
...state === "running" ? { note: t("workflow.child.checkBack", "Check back with childStatus; a started child is not a finished one.") } : {}
|
|
4345
4559
|
};
|
|
4346
4560
|
}
|
|
4347
|
-
function criterionRow(value) {
|
|
4561
|
+
function criterionRow(t, value) {
|
|
4348
4562
|
const record = asRecord(value);
|
|
4349
4563
|
const key = readString(record, "key");
|
|
4350
4564
|
const status = readString(record, "status");
|
|
@@ -4353,14 +4567,14 @@ function criterionRow(value) {
|
|
|
4353
4567
|
return {
|
|
4354
4568
|
key,
|
|
4355
4569
|
title: key,
|
|
4356
|
-
...verifiedBy === void 0 ? {} : { detail:
|
|
4357
|
-
chip: CRITERION_CHIPS[status] ?? {
|
|
4570
|
+
...verifiedBy === void 0 ? {} : { detail: t("workflow.child.verifiedBy", "verified by {name}", { name: verifiedBy }) },
|
|
4571
|
+
chip: translatedChip(t, CRITERION_CHIPS[status] ?? {
|
|
4358
4572
|
label: status,
|
|
4359
4573
|
tone: "neutral"
|
|
4360
|
-
}
|
|
4574
|
+
})
|
|
4361
4575
|
};
|
|
4362
4576
|
}
|
|
4363
|
-
function invocationRow(value) {
|
|
4577
|
+
function invocationRow(t, value) {
|
|
4364
4578
|
const record = asRecord(value);
|
|
4365
4579
|
const id = readString(record, "invocationId");
|
|
4366
4580
|
const job = readString(record, "job");
|
|
@@ -4370,62 +4584,73 @@ function invocationRow(value) {
|
|
|
4370
4584
|
key: id,
|
|
4371
4585
|
title: job,
|
|
4372
4586
|
detail: id,
|
|
4373
|
-
chip: invocationChip(state)
|
|
4587
|
+
chip: invocationChip(t, state)
|
|
4374
4588
|
};
|
|
4375
4589
|
}
|
|
4376
|
-
function childrenView(value) {
|
|
4590
|
+
function childrenView(t, value) {
|
|
4377
4591
|
const record = asRecord(value);
|
|
4378
4592
|
const lead = readString(record, "lead");
|
|
4379
4593
|
if (!record || !lead || !Array.isArray(record.criteria) || !Array.isArray(record.invocations)) return void 0;
|
|
4380
|
-
|
|
4381
|
-
const
|
|
4382
|
-
|
|
4594
|
+
let checked = 0;
|
|
4595
|
+
const criteria = record.criteria.flatMap((entry) => {
|
|
4596
|
+
const row = criterionRow(t, entry);
|
|
4597
|
+
if (!row) return [];
|
|
4598
|
+
if (readString(asRecord(entry), "status") === "checked") checked++;
|
|
4599
|
+
return [row];
|
|
4600
|
+
});
|
|
4601
|
+
const invocations = record.invocations.flatMap((entry) => invocationRow(t, entry) ?? []);
|
|
4383
4602
|
const continuations = readNumber(record, "continuations");
|
|
4384
4603
|
const maxContinuations = readNumber(record, "maxContinuations");
|
|
4385
4604
|
const facts = [{
|
|
4386
|
-
label: "lead",
|
|
4605
|
+
label: t("workflow.child.lead", "lead"),
|
|
4387
4606
|
value: lead
|
|
4388
4607
|
}];
|
|
4389
4608
|
if (continuations !== void 0 && maxContinuations !== void 0) facts.push({
|
|
4390
|
-
label: "continuations",
|
|
4609
|
+
label: t("workflow.child.continuations", "continuations"),
|
|
4391
4610
|
value: `${continuations}/${maxContinuations}`
|
|
4392
4611
|
});
|
|
4393
4612
|
const sections = [];
|
|
4394
4613
|
if (criteria.length > 0) sections.push({
|
|
4395
|
-
title: "Criteria",
|
|
4614
|
+
title: t("workflow.child.criteria", "Criteria"),
|
|
4396
4615
|
rows: criteria
|
|
4397
4616
|
});
|
|
4398
4617
|
if (invocations.length > 0) sections.push({
|
|
4399
|
-
title: "Children",
|
|
4618
|
+
title: t("workflow.child.children", "Children"),
|
|
4400
4619
|
rows: invocations
|
|
4401
4620
|
});
|
|
4402
4621
|
return {
|
|
4403
|
-
headline: criteria.length > 0 ?
|
|
4622
|
+
headline: criteria.length > 0 ? criteria.length === 1 ? t("workflow.child.checked.one", "{checked}/{count} criterion checked", {
|
|
4623
|
+
checked,
|
|
4624
|
+
count: criteria.length
|
|
4625
|
+
}) : t("workflow.child.checked.many", "{checked}/{count} criteria checked", {
|
|
4626
|
+
checked,
|
|
4627
|
+
count: criteria.length
|
|
4628
|
+
}) : invocations.length === 1 ? t("workflow.child.children.one", "{count} child", { count: invocations.length }) : t("workflow.child.children.many", "{count} children", { count: invocations.length }),
|
|
4404
4629
|
facts,
|
|
4405
4630
|
sections,
|
|
4406
|
-
...sections.length === 0 ? { note: "No children spawned yet." } : {}
|
|
4631
|
+
...sections.length === 0 ? { note: t("workflow.child.emptyChildren", "No children spawned yet.") } : {}
|
|
4407
4632
|
};
|
|
4408
4633
|
}
|
|
4409
|
-
function reportView(args) {
|
|
4634
|
+
function reportView(t, args) {
|
|
4410
4635
|
const rows = criteriaResults(args).map((entry) => ({
|
|
4411
4636
|
key: entry.key,
|
|
4412
4637
|
title: entry.key,
|
|
4413
|
-
chip: CRITERION_CHIPS[entry.status] ?? {
|
|
4638
|
+
chip: translatedChip(t, CRITERION_CHIPS[entry.status] ?? {
|
|
4414
4639
|
label: entry.status,
|
|
4415
4640
|
tone: "neutral"
|
|
4416
|
-
}
|
|
4641
|
+
})
|
|
4417
4642
|
}));
|
|
4418
4643
|
return {
|
|
4419
|
-
headline:
|
|
4644
|
+
headline: rows.length === 1 ? t("workflow.child.reported.one", "{count} criterion reported", { count: rows.length }) : t("workflow.child.reported.many", "{count} criteria reported", { count: rows.length }),
|
|
4420
4645
|
facts: [],
|
|
4421
4646
|
sections: rows.length > 0 ? [{
|
|
4422
|
-
title: "Criteria",
|
|
4647
|
+
title: t("workflow.child.criteria", "Criteria"),
|
|
4423
4648
|
rows
|
|
4424
4649
|
}] : [],
|
|
4425
|
-
note: "The lead reads these on its next look at the children."
|
|
4650
|
+
note: t("workflow.child.leadReads", "The lead reads these on its next look at the children.")
|
|
4426
4651
|
};
|
|
4427
4652
|
}
|
|
4428
|
-
function artifactsView(value) {
|
|
4653
|
+
function artifactsView(t, value) {
|
|
4429
4654
|
const record = asRecord(value);
|
|
4430
4655
|
const revision = readString(record, "revision");
|
|
4431
4656
|
const artifacts = asRecord(record?.artifacts);
|
|
@@ -4435,44 +4660,44 @@ function artifactsView(value) {
|
|
|
4435
4660
|
return {
|
|
4436
4661
|
key: name,
|
|
4437
4662
|
title: name,
|
|
4438
|
-
detail:
|
|
4663
|
+
detail: lines === 1 ? t("workflow.child.lines.one", "{count} line", { count: lines }) : t("workflow.child.lines.many", "{count} lines", { count: lines })
|
|
4439
4664
|
};
|
|
4440
4665
|
});
|
|
4441
4666
|
return {
|
|
4442
|
-
headline:
|
|
4667
|
+
headline: rows.length === 1 ? t("workflow.child.artifacts.one", "{count} artifact", { count: rows.length }) : t("workflow.child.artifacts.many", "{count} artifacts", { count: rows.length }),
|
|
4443
4668
|
facts: [{
|
|
4444
|
-
label: "revision",
|
|
4669
|
+
label: t("workflow.child.revision", "revision"),
|
|
4445
4670
|
value: revision
|
|
4446
4671
|
}],
|
|
4447
4672
|
sections: rows.length > 0 ? [{
|
|
4448
|
-
title: "Artifacts",
|
|
4673
|
+
title: t("workflow.child.artifacts", "Artifacts"),
|
|
4449
4674
|
rows
|
|
4450
4675
|
}] : [],
|
|
4451
|
-
...rows.length === 0 ? { note: "No artifacts recorded for review." } : {}
|
|
4676
|
+
...rows.length === 0 ? { note: t("workflow.child.emptyArtifacts", "No artifacts recorded for review.") } : {}
|
|
4452
4677
|
};
|
|
4453
4678
|
}
|
|
4454
|
-
function textView(result) {
|
|
4679
|
+
function textView(t, result) {
|
|
4455
4680
|
const lines = resultText(result).split("\n").map((entry) => entry.trimEnd()).filter((entry) => entry.length > 0);
|
|
4456
4681
|
return {
|
|
4457
4682
|
headline: "",
|
|
4458
4683
|
facts: [],
|
|
4459
4684
|
sections: [],
|
|
4460
|
-
text: lines.length > 0 ? lines : ["No output."]
|
|
4685
|
+
text: lines.length > 0 ? lines : [t("workflow.child.emptyOutput", "No output.")]
|
|
4461
4686
|
};
|
|
4462
4687
|
}
|
|
4463
4688
|
/** The settled result of a child tool, parsed by tool; raw text only when it does not parse. */
|
|
4464
|
-
function workflowChildView(toolName, args, result) {
|
|
4465
|
-
if (toolName === "workflow_report_criteria") return reportView(args);
|
|
4689
|
+
function workflowChildView(t, toolName, args, result) {
|
|
4690
|
+
if (toolName === "workflow_report_criteria") return reportView(t, args);
|
|
4466
4691
|
const parsed = parseResult(result);
|
|
4467
|
-
if (!parsed.ok) return textView(result);
|
|
4468
|
-
const view = toolName === "workflow_spawn_child" || toolName === "workflow_child_status" ? invocationView(parsed.value) : toolName === "workflow_children" ? childrenView(parsed.value) : toolName === "workflow_review_artifacts" ? artifactsView(parsed.value) : void 0;
|
|
4692
|
+
if (!parsed.ok) return textView(t, result);
|
|
4693
|
+
const view = toolName === "workflow_spawn_child" || toolName === "workflow_child_status" ? invocationView(t, parsed.value) : toolName === "workflow_children" ? childrenView(t, parsed.value) : toolName === "workflow_review_artifacts" ? artifactsView(t, parsed.value) : void 0;
|
|
4469
4694
|
if (view) return view;
|
|
4470
|
-
const generic = workflowGenericView(parsed.value);
|
|
4695
|
+
const generic = workflowGenericView(t, parsed.value);
|
|
4471
4696
|
return {
|
|
4472
4697
|
headline: generic.headline,
|
|
4473
4698
|
facts: generic.facts,
|
|
4474
4699
|
sections: generic.rows.length > 0 ? [{
|
|
4475
|
-
title: "Items",
|
|
4700
|
+
title: t("workflow.child.items", "Items"),
|
|
4476
4701
|
rows: generic.rows
|
|
4477
4702
|
}] : []
|
|
4478
4703
|
};
|
|
@@ -4711,8 +4936,9 @@ const TONE_STYLE = {
|
|
|
4711
4936
|
* once expanded. A failure shows only its reason.
|
|
4712
4937
|
*/
|
|
4713
4938
|
function WorkflowChildToolMessage({ toolName, args, result, output, running, isError }) {
|
|
4714
|
-
const
|
|
4715
|
-
const
|
|
4939
|
+
const t = useT();
|
|
4940
|
+
const summary = workflowChildSummary(t, toolName, args);
|
|
4941
|
+
const view = running || isError ? void 0 : workflowChildView(t, toolName, args, result);
|
|
4716
4942
|
const expandable = view !== void 0 && (view.facts.length > 0 || view.sections.length > 0 || view.error !== void 0 || view.note !== void 0 || (view.text?.length ?? 0) > 1);
|
|
4717
4943
|
return /* @__PURE__ */ jsx(MessageItem, {
|
|
4718
4944
|
tone: toolTone({
|
|
@@ -4737,12 +4963,12 @@ function WorkflowChildToolMessage({ toolName, args, result, output, running, isE
|
|
|
4737
4963
|
})
|
|
4738
4964
|
}), isError ? /* @__PURE__ */ jsx(MessageItemBody, {
|
|
4739
4965
|
testID: `tool-result-${toolName}`,
|
|
4740
|
-
children: /* @__PURE__ */ jsx(WorkflowReason, { children: workflowFailureReason(result, output) })
|
|
4966
|
+
children: /* @__PURE__ */ jsx(WorkflowReason, { children: workflowFailureReason(t, result, output) })
|
|
4741
4967
|
}) : running ? /* @__PURE__ */ jsx(MessageItemBody, {
|
|
4742
4968
|
testID: `tool-result-${toolName}`,
|
|
4743
4969
|
children: /* @__PURE__ */ jsx(MessageItemStatus, {
|
|
4744
4970
|
tone: "running",
|
|
4745
|
-
children: workflowChildRunningLabel(toolName)
|
|
4971
|
+
children: workflowChildRunningLabel(t, toolName)
|
|
4746
4972
|
})
|
|
4747
4973
|
}) : view === void 0 ? null : view.text !== void 0 ? /* @__PURE__ */ jsx(MessageItemBody, {
|
|
4748
4974
|
testID: `tool-result-${toolName}`,
|
|
@@ -4820,16 +5046,17 @@ var workflow_child_native_default = defineToolRenderer({
|
|
|
4820
5046
|
* shows only its reason; the edge and icon say it failed.
|
|
4821
5047
|
*/
|
|
4822
5048
|
function WorkflowToolMessage({ toolName, args, result, output, running, isError }) {
|
|
5049
|
+
const t = useT();
|
|
4823
5050
|
const name = workflowToolName(toolName);
|
|
4824
|
-
const summary = workflowCallSummary(name, args);
|
|
5051
|
+
const summary = workflowCallSummary(t, name, args);
|
|
4825
5052
|
const detail = [summary.target, ...summary.metadata].filter((value) => value !== void 0);
|
|
4826
|
-
const structured = running || isError ? void 0 : workflowStructuredView(name, args, result);
|
|
4827
|
-
const collapsed = workflowResultLines(name, args, result, {
|
|
5053
|
+
const structured = running || isError ? void 0 : workflowStructuredView(t, name, args, result);
|
|
5054
|
+
const collapsed = workflowResultLines(t, name, args, result, {
|
|
4828
5055
|
expanded: false,
|
|
4829
5056
|
isError,
|
|
4830
5057
|
isPartial: running
|
|
4831
5058
|
});
|
|
4832
|
-
const full = workflowResultLines(name, args, result, {
|
|
5059
|
+
const full = workflowResultLines(t, name, args, result, {
|
|
4833
5060
|
expanded: true,
|
|
4834
5061
|
isError,
|
|
4835
5062
|
isPartial: running
|
|
@@ -4859,7 +5086,7 @@ function WorkflowToolMessage({ toolName, args, result, output, running, isError
|
|
|
4859
5086
|
})
|
|
4860
5087
|
}), isError ? /* @__PURE__ */ jsx(MessageItemBody, {
|
|
4861
5088
|
testID: `tool-result-${toolName}`,
|
|
4862
|
-
children: /* @__PURE__ */ jsx(WorkflowReason, { children: workflowFailureReason(result, output) })
|
|
5089
|
+
children: /* @__PURE__ */ jsx(WorkflowReason, { children: workflowFailureReason(t, result, output) })
|
|
4863
5090
|
}) : structured !== void 0 ? /* @__PURE__ */ jsx(MessageItemBody, {
|
|
4864
5091
|
testID: `tool-result-${toolName}`,
|
|
4865
5092
|
children: /* @__PURE__ */ jsxs(View, {
|
|
@@ -4920,7 +5147,7 @@ var workflow_native_default = defineToolRenderer({
|
|
|
4920
5147
|
"scaffold_workflow"
|
|
4921
5148
|
],
|
|
4922
5149
|
message: WorkflowToolMessage,
|
|
4923
|
-
activity: workflowActivity
|
|
5150
|
+
activity: (props) => workflowActivity(t, props)
|
|
4924
5151
|
});
|
|
4925
5152
|
//#endregion
|
|
4926
5153
|
//#region generated/native.ts
|