@agimon-ai/po-workflow 0.0.0-alpha.226 → 0.0.0-alpha.227
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 +13 -31
- package/dist/extensions/native.mjs.map +1 -1
- package/dist/extensions/web.mjs +71 -51
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/po-runtime-identity.json +1 -1
- package/locales/vi.json +5 -3
- package/locales/zh-CN.json +5 -3
- package/package.json +11 -11
|
@@ -2,7 +2,7 @@ import { createApiClient, defineActivityGroup, defineChannelFile, defineDockFace
|
|
|
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";
|
|
5
|
-
import { ArrowRightIcon, Badge, Button, ChevronDownIcon, ChevronRightIcon, CodeBlock, Dot, EmptyState, FileIcon, FolderIcon, Input, Label, ListRow, LiveDuration, LoadingState, Markdown, MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, SearchIcon, SegmentedControl, Select, Sheet, SheetBody, SheetContent, SheetHeader, SheetList, SheetTitle, Spinner, StatusBadge, Switch, Textarea, WorkflowIcon, fontOf, toolTone } from "@agimon-ai/po-native-components";
|
|
5
|
+
import { ArrowRightIcon, Badge, Button, ChevronDownIcon, ChevronRightIcon, CodeBlock, Dot, EmptyState, FileIcon, FolderIcon, InfoStrip, Input, Label, ListRow, LiveDuration, LoadingState, Markdown, MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, SearchIcon, SegmentedControl, Select, Sheet, SheetBody, SheetContent, SheetHeader, SheetList, SheetTitle, Spinner, StatusBadge, Switch, Textarea, WorkflowIcon, fontOf, toolTone } from "@agimon-ai/po-native-components";
|
|
6
6
|
import { createElement, memo, useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
7
7
|
import { StyleSheet } from "react-native-unistyles";
|
|
8
8
|
import { Pressable } from "react-native-unistyles/components/native/Pressable";
|
|
@@ -84,7 +84,7 @@ function pendingLaunchName(workflowPath) {
|
|
|
84
84
|
function detailOf(run, tone, t) {
|
|
85
85
|
if (tone === "paused") return t("workflow.ui.activity.pausedDetail", "paused; resume it from the owning session");
|
|
86
86
|
if (tone === "waiting") return t("workflow.ui.activity.waitingDetail", "waiting for your approval");
|
|
87
|
-
if (tone === "failed") return run.
|
|
87
|
+
if (tone === "failed") return run.failedJob === void 0 ? t("workflow.ui.workflowRunProblem", "Po couldn’t finish this workflow run.") : t("workflow.ui.activity.jobFailedDetail", "job '{job}' failed", { job: run.failedJob });
|
|
88
88
|
if (tone === "running") {
|
|
89
89
|
if (run.position === void 0) return t("workflow.ui.activity.startingDetail", "starting");
|
|
90
90
|
return run.position.step === void 0 ? run.position.job : `${run.position.job} · ${run.position.step}`;
|
|
@@ -930,7 +930,7 @@ function attentionFor(run, t = (_key, english, vars) => english.replace(/\{(\w+)
|
|
|
930
930
|
};
|
|
931
931
|
}
|
|
932
932
|
if (run.stage === "error") {
|
|
933
|
-
const cause =
|
|
933
|
+
const cause = t("workflow.ui.workflowRunProblem", "Po couldn’t finish this workflow run.");
|
|
934
934
|
return {
|
|
935
935
|
kind: "error",
|
|
936
936
|
text: run.failedJob === void 0 ? cause : t("workflow.ui.attention.jobFailed", "job '{job}' failed: {cause}", {
|
|
@@ -1527,10 +1527,10 @@ function ItemRow({ item, run, now, defaultExpanded, onOpenAgent }) {
|
|
|
1527
1527
|
style: styles$10.dim,
|
|
1528
1528
|
children: t("workflow.ui.stepExecutionState", "Step: {state}", { state: workflowStatusLabel(t, phase.executionStatus) })
|
|
1529
1529
|
}),
|
|
1530
|
-
phase.
|
|
1531
|
-
accessibilityRole:
|
|
1532
|
-
style:
|
|
1533
|
-
children:
|
|
1530
|
+
phase.status === "failed" && /* @__PURE__ */ jsx(Text, {
|
|
1531
|
+
accessibilityRole: "alert",
|
|
1532
|
+
style: styles$10.error,
|
|
1533
|
+
children: t("workflow.ui.workflowStepProblem", "Po couldn’t finish this step.")
|
|
1534
1534
|
}),
|
|
1535
1535
|
phase.agents.map((agent, index) => /* @__PURE__ */ jsxs(View, {
|
|
1536
1536
|
style: styles$10.inline,
|
|
@@ -1565,15 +1565,7 @@ function DynamicWorkflowView({ runs, now, connected = true, defaultExpandedKeys
|
|
|
1565
1565
|
contentContainerStyle: styles$10.content,
|
|
1566
1566
|
accessibilityLabel: t("workflow.ui.dynamicWorkflows", "Dynamic workflows"),
|
|
1567
1567
|
children: [
|
|
1568
|
-
!connected && /* @__PURE__ */
|
|
1569
|
-
accessibilityRole: "alert",
|
|
1570
|
-
style: styles$10.notice,
|
|
1571
|
-
children: [
|
|
1572
|
-
" ",
|
|
1573
|
-
t("workflow.ui.connectionPausedTheseAreTheLastReportedWorkflowStates", "Connection paused. These are the last reported workflow states."),
|
|
1574
|
-
" "
|
|
1575
|
-
]
|
|
1576
|
-
}),
|
|
1568
|
+
!connected && /* @__PURE__ */ jsx(InfoStrip, { message: t("workflow.ui.connectionPausedTheseAreTheLastReportedWorkflowStates", "Connection paused. These are the last reported workflow states.") }),
|
|
1577
1569
|
!runs.length && /* @__PURE__ */ jsx(EmptyState, {
|
|
1578
1570
|
surface: "plain",
|
|
1579
1571
|
icon: /* @__PURE__ */ jsx(WorkflowIcon, { size: 20 }),
|
|
@@ -1608,10 +1600,10 @@ function DynamicWorkflowView({ runs, now, connected = true, defaultExpandedKeys
|
|
|
1608
1600
|
children: t("workflow.ui.executionStateCaption", " · Execution: {state}", { state: workflowStatusLabel(t, run.executionStatus) })
|
|
1609
1601
|
})]
|
|
1610
1602
|
}),
|
|
1611
|
-
run.
|
|
1603
|
+
run.status === "failed" && /* @__PURE__ */ jsx(Text, {
|
|
1612
1604
|
accessibilityRole: run.status === "failed" ? "alert" : void 0,
|
|
1613
1605
|
style: run.status === "failed" ? styles$10.error : styles$10.dim,
|
|
1614
|
-
children: run.
|
|
1606
|
+
children: t("workflow.ui.workflowRunProblem", "Po couldn’t finish this workflow run.")
|
|
1615
1607
|
}),
|
|
1616
1608
|
run.groups.map((group) => /* @__PURE__ */ jsxs(View, {
|
|
1617
1609
|
style: styles$10.group,
|
|
@@ -1752,17 +1744,6 @@ const styles$10 = StyleSheet.create((theme) => ({
|
|
|
1752
1744
|
lineHeight: theme.lineHeight.sm,
|
|
1753
1745
|
uni__dependencies: [0]
|
|
1754
1746
|
},
|
|
1755
|
-
notice: {
|
|
1756
|
-
borderWidth: 1,
|
|
1757
|
-
borderColor: theme.colors.border,
|
|
1758
|
-
borderRadius: theme.borderRadius.md,
|
|
1759
|
-
padding: theme.spacing(3),
|
|
1760
|
-
color: theme.colors.dim,
|
|
1761
|
-
fontFamily: fontOf(theme.fontFamily.sans),
|
|
1762
|
-
fontSize: theme.fontSize.base,
|
|
1763
|
-
lineHeight: theme.lineHeight.base,
|
|
1764
|
-
uni__dependencies: [0]
|
|
1765
|
-
},
|
|
1766
1747
|
group: {
|
|
1767
1748
|
minWidth: 0,
|
|
1768
1749
|
borderWidth: 1,
|
|
@@ -2328,7 +2309,7 @@ function WorkflowDockView({ run, runs, now, sheet = false, dockHeader, artifacts
|
|
|
2328
2309
|
const failedStep = run ? failedStepLocation(run) : void 0;
|
|
2329
2310
|
const live = run ? isLive(run) : false;
|
|
2330
2311
|
const effectiveMode = mode === "stop" && !live ? "overview" : mode === "delete" && (!run || live) ? "overview" : mode;
|
|
2331
|
-
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?.
|
|
2312
|
+
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?.staleReason ?? (attention?.kind === "stale" ? t("workflow.ui.attention.staleNotice", "This run is no longer reporting progress.") : attention?.text);
|
|
2332
2313
|
const List = sheet ? SheetList : FlatList;
|
|
2333
2314
|
const header = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2334
2315
|
dockHeader,
|
|
@@ -4425,10 +4406,11 @@ function useDynamicWorkflows(sessionId) {
|
|
|
4425
4406
|
}, []);
|
|
4426
4407
|
return useSyncExternalStore(subscribe, () => dynamicWorkflows.select(dynamicWorkflows.store.state, sessionId));
|
|
4427
4408
|
}
|
|
4428
|
-
function DynamicWorkflowPanel({ sessionId, openTransientTab }) {
|
|
4409
|
+
function DynamicWorkflowPanel({ sessionId, openTransientTab, connected = sessionId !== null }) {
|
|
4429
4410
|
const snapshot = useDynamicWorkflows(sessionId);
|
|
4430
4411
|
return /* @__PURE__ */ jsx(DynamicWorkflowView, {
|
|
4431
4412
|
runs: snapshot?.runs ?? EMPTY_RUNS,
|
|
4413
|
+
connected,
|
|
4432
4414
|
onOpenAgent: (runId, session) => {
|
|
4433
4415
|
if (sessionId !== null) openTransientTab(workflowAgentTab(runId, session));
|
|
4434
4416
|
}
|