@yiyi_zhang/laoshi 0.1.1 → 0.2.0-beta.2
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/CHANGELOG.md +32 -0
- package/adapters/cli/adapter.ts +53 -0
- package/adapters/cli/cli-runtime.ts +402 -0
- package/adapters/cli/drivers.ts +146 -0
- package/adapters/cli/install.mjs +28 -0
- package/adapters/cli/skill/setup.md +8 -0
- package/adapters/dsh/plugin/index.mjs +1 -1
- package/adapters/dsh/plugin/package.json +1 -1
- package/adapters/mogao/adapter.ts +47 -0
- package/adapters/mogao/install.mjs +31 -0
- package/adapters/mogao/make-expert.mjs +64 -0
- package/adapters/mogao/mogao-runtime.ts +506 -0
- package/adapters/mogao/skill/setup.md +21 -0
- package/adapters/paseo/adapter.ts +1 -1
- package/adapters/paseo/install.mjs +17 -5
- package/adapters/paseo/migrate.ts +267 -0
- package/adapters/paseo/plugin/OVERVIEW.md +9 -0
- package/adapters/paseo/plugin/client/config.tsx +216 -0
- package/adapters/paseo/plugin/client/data.ts +85 -0
- package/adapters/paseo/plugin/client/detail.tsx +342 -0
- package/adapters/paseo/plugin/client/format.ts +173 -0
- package/adapters/paseo/plugin/client/inbox.tsx +190 -0
- package/adapters/paseo/plugin/client/live.ts +161 -0
- package/adapters/paseo/plugin/client/markdown.tsx +220 -0
- package/adapters/paseo/plugin/client/models.tsx +117 -0
- package/adapters/paseo/plugin/client/nav.ts +22 -0
- package/adapters/paseo/plugin/client/overview.tsx +103 -0
- package/adapters/paseo/plugin/client/panel.tsx +56 -0
- package/adapters/paseo/plugin/client/review.tsx +80 -0
- package/adapters/paseo/plugin/client/row.tsx +63 -0
- package/adapters/paseo/plugin/client/settings.tsx +92 -0
- package/adapters/paseo/plugin/client/sidebar.tsx +27 -0
- package/adapters/paseo/plugin/client/stats.tsx +138 -0
- package/adapters/paseo/plugin/client/ui.tsx +278 -0
- package/adapters/paseo/plugin/client/web.ts +34 -0
- package/adapters/paseo/plugin/index.client.tsx +66 -0
- package/adapters/paseo/plugin/index.server.ts +61 -0
- package/adapters/paseo/plugin/package.json +22 -0
- package/adapters/paseo/plugin/paseo-plugin.json +6 -0
- package/adapters/paseo/plugin/server/handlers.ts +69 -0
- package/adapters/paseo/plugin/server/req.ts +105 -0
- package/adapters/paseo/plugin/shared/contracts.ts +286 -0
- package/adapters/paseo/plugin/shared/rk-colors.ts +35 -0
- package/adapters/paseo/plugin/tsconfig.json +16 -0
- package/adapters/paseo/plugin-cmd.mjs +233 -0
- package/bin/install.mjs +12 -5
- package/bin/req.mjs +18 -2
- package/contracts/README.md +1 -1
- package/contracts/agent-runtime.md +5 -2
- package/contracts/cli-json.md +4 -3
- package/contracts/notifier-event.md +2 -2
- package/contracts/state.md +2 -0
- package/contracts/usage-record.md +3 -3
- package/docs/design/adapter-guide.md +2 -1
- package/docs/design/cli-adapter.md +75 -0
- package/docs/design/compat-migration.md +2 -0
- package/docs/design/mogao-expert.md +103 -0
- package/docs/guide//345/234/250/346/221/270/351/253/230/344/270/212/344/275/277/347/224/250.md +132 -0
- package/docs/guide//345/256/211/350/243/205/344/270/216/345/215/207/347/272/247.md +32 -3
- package/docs/guide//347/273/264/346/212/244/350/200/205/346/214/207/345/215/227.md +4 -2
- package/docs/guide//351/241/271/347/233/256/345/256/232/345/210/266/344/270/216/350/277/220/350/241/214/350/247/204/345/210/231.md +1 -1
- package/engine/src/api.ts +9 -5
- package/engine/src/code-review.ts +2 -2
- package/engine/src/control.ts +6 -6
- package/engine/src/danger-guard.ts +7 -0
- package/engine/src/doctor.ts +4 -3
- package/engine/src/features.ts +2 -2
- package/engine/src/identity.ts +16 -1
- package/engine/src/integration-cmd.ts +2 -2
- package/engine/src/launch.ts +44 -6
- package/engine/src/locations.ts +15 -1
- package/engine/src/main.ts +6 -1
- package/engine/src/messages.ts +1 -1
- package/engine/src/permission-cmd.ts +56 -0
- package/engine/src/platform.ts +7 -0
- package/engine/src/preflight.ts +2 -2
- package/engine/src/runtime-loader.ts +16 -0
- package/engine/src/runtime.ts +5 -0
- package/engine/src/skills-render.ts +10 -6
- package/engine/src/state.ts +25 -1
- package/engine/src/words.ts +1 -1
- package/package.json +2 -1
- package/site-dist/404.html +2 -2
- package/site-dist/assets/{app.Df99UgrJ.js → app.D2ywvSfZ.js} +1 -1
- package/site-dist/assets/changelog.md.EDul9PkX.js +1 -0
- package/site-dist/assets/changelog.md.EDul9PkX.lean.js +1 -0
- package/site-dist/assets/chunks/@localSearchIndexroot.Dr_jsw66.js +1 -0
- package/site-dist/assets/chunks/{VPLocalSearchBox.IEhP6Gw5.js → VPLocalSearchBox.ClWffKqN.js} +1 -1
- package/site-dist/assets/chunks/{theme.DHubfO7g.js → theme.tbt16E5a.js} +2 -2
- package/site-dist/assets/guide_cli.md.BrXllHw9.js +2 -0
- package/site-dist/assets/guide_cli.md.BrXllHw9.lean.js +2 -0
- package/site-dist/assets/{guide_getting-started.md.BZTWiHhH.js → guide_getting-started.md.qAp5hWCl.js} +1 -1
- package/site-dist/assets/{guide_getting-started.md.BZTWiHhH.lean.js → guide_getting-started.md.qAp5hWCl.lean.js} +1 -1
- package/site-dist/assets/guide_install.md.By4WxsJG.js +24 -0
- package/site-dist/assets/guide_install.md.By4WxsJG.lean.js +24 -0
- package/site-dist/assets/guide_maintainer.md.Da1ffqxm.js +1 -0
- package/site-dist/assets/guide_maintainer.md.Da1ffqxm.lean.js +1 -0
- package/site-dist/assets/guide_mogao.md.S0eln1Pr.js +10 -0
- package/site-dist/assets/guide_mogao.md.S0eln1Pr.lean.js +10 -0
- package/site-dist/assets/{guide_project.md.BIcaDhdS.js → guide_project.md.B2cmf8YF.js} +1 -1
- package/site-dist/assets/{guide_project.md.BIcaDhdS.lean.js → guide_project.md.B2cmf8YF.lean.js} +1 -1
- package/site-dist/assets/reference_contracts_agent-runtime.md.DPE2FJFc.js +1 -0
- package/site-dist/assets/{reference_contracts_agent-runtime.md.Bu8q-uGl.lean.js → reference_contracts_agent-runtime.md.DPE2FJFc.lean.js} +1 -1
- package/site-dist/assets/reference_contracts_cli-json.md.D6vfWOD9.js +1 -0
- package/site-dist/assets/reference_contracts_cli-json.md.D6vfWOD9.lean.js +1 -0
- package/site-dist/assets/{reference_contracts_index.md.dqNwNs6U.js → reference_contracts_index.md.B5P4FjRk.js} +1 -1
- package/site-dist/assets/{reference_contracts_index.md.dqNwNs6U.lean.js → reference_contracts_index.md.B5P4FjRk.lean.js} +1 -1
- package/site-dist/assets/{reference_contracts_notifier-event.md.D6we9wWS.js → reference_contracts_notifier-event.md.BeR8iODP.js} +1 -1
- package/site-dist/assets/{reference_contracts_notifier-event.md.D6we9wWS.lean.js → reference_contracts_notifier-event.md.BeR8iODP.lean.js} +1 -1
- package/site-dist/assets/reference_contracts_state.md.DLygjkfs.js +1 -0
- package/site-dist/assets/reference_contracts_usage-record.md.CgfMoYp0.js +10 -0
- package/site-dist/assets/reference_contracts_usage-record.md.CgfMoYp0.lean.js +10 -0
- package/site-dist/assets/{reference_design_adapter-guide.md.BSziZJSM.js → reference_design_adapter-guide.md.B_P-spS5.js} +2 -2
- package/site-dist/assets/{reference_design_adapter-guide.md.BSziZJSM.lean.js → reference_design_adapter-guide.md.B_P-spS5.lean.js} +2 -2
- package/site-dist/assets/reference_design_cli-adapter.md.pJy3x6Un.js +13 -0
- package/site-dist/assets/reference_design_cli-adapter.md.pJy3x6Un.lean.js +13 -0
- package/site-dist/changelog.html +5 -5
- package/site-dist/guide/cli.html +31 -0
- package/site-dist/guide/dsh.html +5 -5
- package/site-dist/guide/getting-started.html +5 -5
- package/site-dist/guide/how-it-works.html +4 -4
- package/site-dist/guide/index.html +4 -4
- package/site-dist/guide/install.html +13 -8
- package/site-dist/guide/intranet.html +5 -5
- package/site-dist/guide/maintainer.html +5 -5
- package/site-dist/guide/mogao.html +39 -0
- package/site-dist/guide/phases.html +4 -4
- package/site-dist/guide/project.html +6 -6
- package/site-dist/guide/user.html +4 -4
- package/site-dist/hashmap.json +1 -1
- package/site-dist/index.html +4 -4
- package/site-dist/reference/adr/0001-new-repo-core-and-adapters.html +4 -4
- package/site-dist/reference/adr/0002-two-orchestration-modes.html +4 -4
- package/site-dist/reference/adr/0003-generate-once-then-lock.html +4 -4
- package/site-dist/reference/adr/0004-external-contracts-stay-stable.html +4 -4
- package/site-dist/reference/adr/0005-skill-names.html +4 -4
- package/site-dist/reference/adr/0006-deterministic-engine-platform-capabilities.html +4 -4
- package/site-dist/reference/adr/0007-one-install-many-repos.html +4 -4
- package/site-dist/reference/adr/0008-capability-sources-and-platform-plugin.html +4 -4
- package/site-dist/reference/adr/index.html +4 -4
- package/site-dist/reference/commands.html +4 -4
- package/site-dist/reference/config.html +4 -4
- package/site-dist/reference/contracts/agent-runtime.html +5 -5
- package/site-dist/reference/contracts/cli-json.html +5 -5
- package/site-dist/reference/contracts/feature-files.html +4 -4
- package/site-dist/reference/contracts/index.html +5 -5
- package/site-dist/reference/contracts/notifier-event.html +6 -6
- package/site-dist/reference/contracts/result-file.html +4 -4
- package/site-dist/reference/contracts/spec.html +4 -4
- package/site-dist/reference/contracts/state.html +5 -5
- package/site-dist/reference/contracts/usage-record.html +6 -6
- package/site-dist/reference/contracts/verify.html +4 -4
- package/site-dist/reference/design/adapter-guide.html +6 -6
- package/site-dist/reference/design/architecture.html +4 -4
- package/site-dist/reference/design/builtin-capabilities.html +4 -4
- package/site-dist/reference/design/cli-adapter.html +42 -0
- package/site-dist/reference/design/platform-vocabulary.html +4 -4
- package/site-dist/reference/scope.html +4 -4
- package/skills/laoshi/SKILL.md +3 -0
- package/skills/laoshi-doctor/SKILL.md +2 -0
- package/skills/laoshi-retro/SKILL.md +2 -0
- package/skills/laoshi-setup/SKILL.md +3 -0
- package/site-dist/assets/changelog.md.Df8vFhjK.js +0 -1
- package/site-dist/assets/changelog.md.Df8vFhjK.lean.js +0 -1
- package/site-dist/assets/chunks/@localSearchIndexroot.n-0kN-N0.js +0 -1
- package/site-dist/assets/guide_install.md.D7NiiOPu.js +0 -19
- package/site-dist/assets/guide_install.md.D7NiiOPu.lean.js +0 -19
- package/site-dist/assets/guide_maintainer.md.C-Vt-DdK.js +0 -1
- package/site-dist/assets/guide_maintainer.md.C-Vt-DdK.lean.js +0 -1
- package/site-dist/assets/reference_contracts_agent-runtime.md.Bu8q-uGl.js +0 -1
- package/site-dist/assets/reference_contracts_cli-json.md.Bonk0m6-.js +0 -1
- package/site-dist/assets/reference_contracts_cli-json.md.Bonk0m6-.lean.js +0 -1
- package/site-dist/assets/reference_contracts_state.md.DVHC4opX.js +0 -1
- package/site-dist/assets/reference_contracts_usage-record.md.CQI2chqh.js +0 -10
- package/site-dist/assets/reference_contracts_usage-record.md.CQI2chqh.lean.js +0 -10
- /package/site-dist/assets/{reference_contracts_state.md.DVHC4opX.lean.js → reference_contracts_state.md.DLygjkfs.lean.js} +0 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
// "等你处理" (1.12): everything that is waiting for a person, at the top, each with what to do and
|
|
2
|
+
// how long it has waited. Answers and plan confirmations can be given right here: an answer is
|
|
3
|
+
// passed to the requirement's chat (laoshi reply), the same as typing it there.
|
|
4
|
+
import type { PluginHostProps } from "@getpaseo/plugin/client";
|
|
5
|
+
import { TextInput, useToast } from "@getpaseo/plugin/client/react-native";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
import { Text, View } from "react-native";
|
|
8
|
+
import type { Attention, Requirement } from "../shared/contracts";
|
|
9
|
+
import { useAction, usePreferences } from "./data";
|
|
10
|
+
import { facts } from "./format";
|
|
11
|
+
import { ReviewButton } from "./review";
|
|
12
|
+
import { AttentionIcon, Badge, Button, Eyebrow, useStyles } from "./ui";
|
|
13
|
+
|
|
14
|
+
type Theme = PluginHostProps["theme"];
|
|
15
|
+
type Layout = PluginHostProps["layout"];
|
|
16
|
+
|
|
17
|
+
const KIND: Record<Exclude<Attention, null>, { label: string; tone: "needs" | "danger" | "muted"; icon: string; todo: string }> = {
|
|
18
|
+
approval: { icon: "PenTool", label: "确认方案", tone: "needs", todo: "方案已通过审核。看一下“做完后会看到什么”,没问题就确认,开始写代码;要改就写下来。" },
|
|
19
|
+
business: { icon: "MessagesSquare", label: "回答问题", tone: "needs", todo: "方案审核有问题只有你能决定,回答后开发会接着进行。" },
|
|
20
|
+
permission: { icon: "ShieldCheck", label: "批准权限", tone: "needs", todo: "有一个步骤在等你允许它做一项操作,批准前会一直停在这里。打开这个 agent,在它的对话里选择允许或拒绝;拿不准时请开发同事看一下。" },
|
|
21
|
+
interrupted: { icon: "OctagonAlert", label: "已中断", tone: "danger", todo: "开发中断了,自动处理没能解决。看一下原因,能继续就继续。" },
|
|
22
|
+
not_completed: { icon: "CircleDashed", label: "没有完成", tone: "muted", todo: "流水线结束了,但有部分没有做完。完成报告里写了原因和建议。" },
|
|
23
|
+
not_started: { icon: "Play", label: "还没开始开发", tone: "needs", todo: "需求说明已经确认,但开发没有开始。确认无误就点“开始开发”,进展会发回谈需求的那个对话。" },
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** Plain waiting time: "等了 3 小时". */
|
|
27
|
+
export function waited(since: string, now = Date.now()): string {
|
|
28
|
+
const m = (now - Date.parse(since)) / 60_000;
|
|
29
|
+
if (!Number.isFinite(m) || m < 1) return "刚刚";
|
|
30
|
+
if (m < 60) return `等了 ${Math.round(m)} 分钟`;
|
|
31
|
+
if (m < 48 * 60) return `等了 ${Math.round(m / 60)} 小时`;
|
|
32
|
+
return `等了 ${Math.round(m / 60 / 24)} 天`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Longest-waiting first: the oldest decision is the one holding things up most. */
|
|
36
|
+
export function inboxItems(items: Requirement[]): Requirement[] {
|
|
37
|
+
return items
|
|
38
|
+
.filter((r) => r.attention)
|
|
39
|
+
.sort((a, b) => (a.waiting?.since ?? a.updatedAt).localeCompare(b.waiting?.since ?? b.updatedAt));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function InboxCard({ theme, layout, item, open, readOnly, openAgent }: { theme: Theme; layout: Layout; item: Requirement; open(): void; readOnly: boolean; openAgent?: (agentId: string) => void }) {
|
|
43
|
+
const s = useStyles(theme, layout.compact);
|
|
44
|
+
const run = useAction();
|
|
45
|
+
const toast = useToast();
|
|
46
|
+
const [writing, setWriting] = useState(item.attention === "business");
|
|
47
|
+
const [text, setText] = useState("");
|
|
48
|
+
const kind = KIND[item.attention!];
|
|
49
|
+
const w = item.waiting;
|
|
50
|
+
const repo = item.sourceRepo ?? item.repo;
|
|
51
|
+
|
|
52
|
+
const act = async (action: "approve" | "resume" | "reply" | "start") => {
|
|
53
|
+
try {
|
|
54
|
+
const result = await run.mutateAsync({ action, repo, featureDir: item.featureDir, ...(action === "reply" ? { text } : {}) });
|
|
55
|
+
const first = result.message.split("\n").find((l) => l.trim()) ?? "";
|
|
56
|
+
if (result.ok) {
|
|
57
|
+
toast.show(first || "已完成", { variant: "success", durationMs: 4000 });
|
|
58
|
+
setText("");
|
|
59
|
+
} else toast.error(first || "没有完成");
|
|
60
|
+
} catch (error) {
|
|
61
|
+
toast.error((error as Error).message);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<View style={[s.card, { gap: 10 }]}>
|
|
67
|
+
<View style={{ flexDirection: "row", alignItems: "flex-start", gap: 12 }}>
|
|
68
|
+
<AttentionIcon theme={theme} icon={kind.icon} tone={kind.tone} />
|
|
69
|
+
<View style={{ flex: 1, minWidth: 0, gap: 2 }}>
|
|
70
|
+
<View style={[s.row, { justifyContent: "space-between" }]}>
|
|
71
|
+
<Text style={[s.text, { fontWeight: "600", fontSize: 15, flexShrink: 1 }]}>{item.title}</Text>
|
|
72
|
+
<Text style={s.mono}>{waited(w?.since ?? item.updatedAt)}</Text>
|
|
73
|
+
</View>
|
|
74
|
+
<View style={s.row}>
|
|
75
|
+
<Badge theme={theme} tone={kind.tone}>
|
|
76
|
+
{kind.label}
|
|
77
|
+
</Badge>
|
|
78
|
+
</View>
|
|
79
|
+
</View>
|
|
80
|
+
</View>
|
|
81
|
+
<Text style={s.muted}>
|
|
82
|
+
{facts(item)}
|
|
83
|
+
{w?.card ? ` · 卡片 ${w.card.system} ${w.card.id}${w.card.requester ? `(${w.card.requester})` : ""}` : ""}
|
|
84
|
+
</Text>
|
|
85
|
+
<Text style={s.text}>{kind.todo}</Text>
|
|
86
|
+
|
|
87
|
+
{(item.attention === "business" || item.attention === "permission") && w && w.questions.length > 0 ? (
|
|
88
|
+
<View style={{ gap: 4 }}>
|
|
89
|
+
{item.attention === "permission" ? <Text style={s.muted}>{w.reason}。要批准的操作:</Text> : null}
|
|
90
|
+
{w.questions.map((q, i) => (
|
|
91
|
+
<Text key={i} style={s.text}>
|
|
92
|
+
{i + 1}. {q}
|
|
93
|
+
</Text>
|
|
94
|
+
))}
|
|
95
|
+
</View>
|
|
96
|
+
) : null}
|
|
97
|
+
{item.attention === "interrupted" && w?.reason ? (
|
|
98
|
+
<Text style={s.danger} numberOfLines={4}>
|
|
99
|
+
{w.reason}
|
|
100
|
+
</Text>
|
|
101
|
+
) : null}
|
|
102
|
+
{item.attention === "not_started" && w?.reason ? <Text style={s.text}>{w.reason}</Text> : null}
|
|
103
|
+
|
|
104
|
+
{readOnly ? (
|
|
105
|
+
<View style={s.row}>
|
|
106
|
+
<Button theme={theme} label="查看详情" onPress={open} />
|
|
107
|
+
<Text style={s.muted}>插件设置为只读,请在对话中处理</Text>
|
|
108
|
+
</View>
|
|
109
|
+
) : (
|
|
110
|
+
<>
|
|
111
|
+
{item.attention === "approval" && item.hasPrototype ? <Text style={s.text}>这个方案有界面原型:在原型上点选要改的地方,比写文字说得清楚。</Text> : null}
|
|
112
|
+
{writing && w?.canReply ? (
|
|
113
|
+
<View style={{ gap: 8 }}>
|
|
114
|
+
<TextInput
|
|
115
|
+
value={text}
|
|
116
|
+
onChangeText={setText}
|
|
117
|
+
multiline
|
|
118
|
+
placeholder={item.attention === "approval" ? "写下要改的地方,例如:按钮放在右上角" : w.questions.length > 1 ? "按编号回答,例如:1. 只有新订单显示 2. 不需要" : "写下你的回答"}
|
|
119
|
+
placeholderTextColor={theme.colors.foregroundMuted}
|
|
120
|
+
style={{
|
|
121
|
+
minHeight: 72,
|
|
122
|
+
padding: 10,
|
|
123
|
+
borderRadius: 8,
|
|
124
|
+
borderWidth: 1,
|
|
125
|
+
borderColor: theme.colors.border,
|
|
126
|
+
backgroundColor: theme.colors.surface0,
|
|
127
|
+
color: theme.colors.foreground,
|
|
128
|
+
fontSize: 14,
|
|
129
|
+
textAlignVertical: "top",
|
|
130
|
+
}}
|
|
131
|
+
/>
|
|
132
|
+
{w.card ? <Text style={s.muted}>也可以在卡片的“需求方回复”区回答,效果一样。</Text> : null}
|
|
133
|
+
</View>
|
|
134
|
+
) : null}
|
|
135
|
+
<View style={s.row}>
|
|
136
|
+
{item.attention === "approval" ? (
|
|
137
|
+
<>
|
|
138
|
+
{item.hasPrototype ? <ReviewButton theme={theme} repo={repo} featureDir={item.featureDir} title={item.title} waiting /> : null}
|
|
139
|
+
<Button theme={theme} primary={!item.hasPrototype} label={run.isPending ? "正在执行…" : "确认方案"} disabled={run.isPending} onPress={() => void act("approve")} />
|
|
140
|
+
{w?.canReply ? (
|
|
141
|
+
writing ? (
|
|
142
|
+
<Button theme={theme} label="发送修改意见" disabled={run.isPending || !text.trim()} onPress={() => void act("reply")} />
|
|
143
|
+
) : (
|
|
144
|
+
<Button theme={theme} label="提修改意见" onPress={() => setWriting(true)} />
|
|
145
|
+
)
|
|
146
|
+
) : null}
|
|
147
|
+
</>
|
|
148
|
+
) : null}
|
|
149
|
+
{item.attention === "business" && w?.canReply ? (
|
|
150
|
+
<Button theme={theme} primary label={run.isPending ? "正在发送…" : "发送回答"} disabled={run.isPending || !text.trim()} onPress={() => void act("reply")} />
|
|
151
|
+
) : null}
|
|
152
|
+
{item.attention === "permission" && w?.agentId && openAgent ? <Button theme={theme} primary label="打开这个 agent" onPress={() => openAgent(w.agentId!)} /> : null}
|
|
153
|
+
{item.attention === "interrupted" ? (
|
|
154
|
+
<Button theme={theme} primary label={run.isPending ? "正在执行…" : "继续"} disabled={run.isPending} onPress={() => void act("resume")} />
|
|
155
|
+
) : null}
|
|
156
|
+
{item.attention === "not_started" && w?.canStart ? (
|
|
157
|
+
<Button theme={theme} primary label={run.isPending ? "正在开始…" : "开始开发"} disabled={run.isPending} onPress={() => void act("start")} />
|
|
158
|
+
) : null}
|
|
159
|
+
<Button theme={theme} label={item.attention === "approval" ? "看方案和确认预览" : item.attention === "not_completed" ? "看完成报告" : "查看详情"} onPress={open} />
|
|
160
|
+
</View>
|
|
161
|
+
</>
|
|
162
|
+
)}
|
|
163
|
+
</View>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function Inbox({ theme, layout, items, open, openAgent }: { theme: Theme; layout: Layout; items: Requirement[]; open(item: Requirement): void; openAgent?: (agentId: string) => void }) {
|
|
168
|
+
const s = useStyles(theme, layout.compact);
|
|
169
|
+
const { readOnly } = usePreferences();
|
|
170
|
+
const waiting = inboxItems(items);
|
|
171
|
+
return (
|
|
172
|
+
<View style={{ gap: 10 }}>
|
|
173
|
+
<View>
|
|
174
|
+
<Eyebrow theme={theme} accent right={<Text style={s.muted}>{waiting.length > 0 ? "等你处理 · 等得最久的在前" : "等你处理"}</Text>}>
|
|
175
|
+
NEEDS YOU · {waiting.length}
|
|
176
|
+
</Eyebrow>
|
|
177
|
+
</View>
|
|
178
|
+
{waiting.length === 0 ? (
|
|
179
|
+
<View style={[s.card, { flexDirection: "row", alignItems: "center", gap: 8 }]}>
|
|
180
|
+
<Badge theme={theme} tone="success" icon="CircleCheck">
|
|
181
|
+
没有
|
|
182
|
+
</Badge>
|
|
183
|
+
<Text style={s.muted}>现在没有需要你处理的事。需要你确认或回答时,会出现在这里。</Text>
|
|
184
|
+
</View>
|
|
185
|
+
) : (
|
|
186
|
+
waiting.map((item) => <InboxCard key={item.key} theme={theme} layout={layout} item={item} open={() => open(item)} readOnly={readOnly} openAgent={openAgent} />)
|
|
187
|
+
)}
|
|
188
|
+
</View>
|
|
189
|
+
);
|
|
190
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// Buttons that follow Paseo's agents and workspaces (registered outside React):
|
|
2
|
+
// - a pill on every step agent of a requirement: which requirement, opens it;
|
|
3
|
+
// - a header button on every workspace that has requirements: how many need a person.
|
|
4
|
+
import type { PluginButtonRegistration, PluginClientContext } from "@getpaseo/plugin/client";
|
|
5
|
+
import { listRpc, type Requirement } from "../shared/contracts";
|
|
6
|
+
import { inWorkspace } from "./panel";
|
|
7
|
+
|
|
8
|
+
/** The step agents' labels (laoshi's runtime sets them when it starts a step). */
|
|
9
|
+
const PIPELINE_LABEL = "requirement-pipeline";
|
|
10
|
+
|
|
11
|
+
interface AgentLike {
|
|
12
|
+
id: string;
|
|
13
|
+
workspaceId?: string | null;
|
|
14
|
+
labels?: Record<string, string> | null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface WorkspaceLike {
|
|
18
|
+
id: string;
|
|
19
|
+
workspaceDirectory?: string;
|
|
20
|
+
projectRootPath?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function contributeLive(client: PluginClientContext): () => void {
|
|
24
|
+
const lifetime = new AbortController();
|
|
25
|
+
const pills = new Map<string, PluginButtonRegistration>();
|
|
26
|
+
const headers = new Map<string, PluginButtonRegistration>();
|
|
27
|
+
const workspaces = new Map<string, WorkspaceLike>();
|
|
28
|
+
let requirements: Requirement[] = [];
|
|
29
|
+
|
|
30
|
+
// ----- pills on step agents
|
|
31
|
+
const registerAgent = (agent: AgentLike) => {
|
|
32
|
+
pills.get(agent.id)?.remove();
|
|
33
|
+
pills.delete(agent.id);
|
|
34
|
+
const name = agent.labels?.[PIPELINE_LABEL];
|
|
35
|
+
if (lifetime.signal.aborted || !name || !agent.workspaceId) return;
|
|
36
|
+
pills.set(
|
|
37
|
+
agent.id,
|
|
38
|
+
client.addComposerPill({
|
|
39
|
+
id: "requirement",
|
|
40
|
+
workspaceId: agent.workspaceId,
|
|
41
|
+
agentId: agent.id,
|
|
42
|
+
button: {
|
|
43
|
+
title: `打开需求 ${name}`,
|
|
44
|
+
icon: "ClipboardList",
|
|
45
|
+
label: "需求",
|
|
46
|
+
behavior: { kind: "action", onPress: () => client.openScreen({ screenId: "requirement", params: { name } }) },
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
void client.paseo.agents
|
|
52
|
+
.list({ subscribe: {}, signal: lifetime.signal })
|
|
53
|
+
.then(({ subscription }) => {
|
|
54
|
+
subscription.subscribe({
|
|
55
|
+
snapshot: ({ entries }) => {
|
|
56
|
+
for (const pill of pills.values()) pill.remove();
|
|
57
|
+
pills.clear();
|
|
58
|
+
for (const { agent } of entries) registerAgent(agent as AgentLike);
|
|
59
|
+
},
|
|
60
|
+
update: (message) => {
|
|
61
|
+
if (message.type !== "agent_update") return;
|
|
62
|
+
const update = message.payload;
|
|
63
|
+
if (update.kind === "remove") {
|
|
64
|
+
pills.get(update.agentId)?.remove();
|
|
65
|
+
pills.delete(update.agentId);
|
|
66
|
+
} else registerAgent(update.agent as AgentLike);
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
return undefined;
|
|
70
|
+
})
|
|
71
|
+
.catch((error: Error) => {
|
|
72
|
+
if (!lifetime.signal.aborted) console.error("[laoshi] 读取 agent 列表失败", error);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// ----- header buttons on workspaces with requirements
|
|
76
|
+
const refreshHeaders = () => {
|
|
77
|
+
for (const [id, ws] of workspaces) {
|
|
78
|
+
const mine = inWorkspace(requirements, ws.workspaceDirectory ?? ws.projectRootPath, id);
|
|
79
|
+
const existing = headers.get(id);
|
|
80
|
+
if (mine.length === 0) {
|
|
81
|
+
existing?.remove();
|
|
82
|
+
headers.delete(id);
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
const waiting = mine.filter((r) => r.attention).length;
|
|
86
|
+
const label = waiting > 0 ? `需求 · 待处理 ${waiting}` : `需求 ${mine.length}`;
|
|
87
|
+
if (existing) existing.update({ label });
|
|
88
|
+
else
|
|
89
|
+
headers.set(
|
|
90
|
+
id,
|
|
91
|
+
client.addHeaderButton({
|
|
92
|
+
id: "requirements",
|
|
93
|
+
workspaceId: id,
|
|
94
|
+
button: {
|
|
95
|
+
title: "这个工作区的需求",
|
|
96
|
+
icon: "ClipboardList",
|
|
97
|
+
label,
|
|
98
|
+
behavior: { kind: "action", onPress: () => client.openPanel("requirements", { workspaceId: id }) },
|
|
99
|
+
},
|
|
100
|
+
}),
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
for (const [id, button] of headers) {
|
|
104
|
+
if (!workspaces.has(id)) {
|
|
105
|
+
button.remove();
|
|
106
|
+
headers.delete(id);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
const poll = async () => {
|
|
111
|
+
try {
|
|
112
|
+
requirements = await client.rpc(listRpc, {});
|
|
113
|
+
refreshHeaders();
|
|
114
|
+
} catch {
|
|
115
|
+
// laoshi missing or too old: the overview explains; no header buttons meanwhile.
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
let releaseWorkspaces: (() => void) | null = null;
|
|
119
|
+
void client.paseo.workspaces
|
|
120
|
+
.list({ subscribe: {} })
|
|
121
|
+
.then(({ subscription }) => {
|
|
122
|
+
// The workspace list takes no abort signal: release it here or at cleanup.
|
|
123
|
+
releaseWorkspaces = () => void subscription.release().catch(() => undefined);
|
|
124
|
+
if (lifetime.signal.aborted) {
|
|
125
|
+
releaseWorkspaces();
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
subscription.subscribe({
|
|
129
|
+
snapshot: ({ entries }) => {
|
|
130
|
+
workspaces.clear();
|
|
131
|
+
for (const ws of entries) workspaces.set(ws.id, ws as WorkspaceLike);
|
|
132
|
+
refreshHeaders();
|
|
133
|
+
},
|
|
134
|
+
update: (message) => {
|
|
135
|
+
if (message.type !== "workspace_update") return;
|
|
136
|
+
const update = message.payload as { kind: string; workspace?: WorkspaceLike; workspaceId?: string; id?: string };
|
|
137
|
+
if (update.kind === "upsert" && update.workspace) workspaces.set(update.workspace.id, update.workspace);
|
|
138
|
+
else {
|
|
139
|
+
const id = update.workspaceId ?? update.id;
|
|
140
|
+
if (id) workspaces.delete(id);
|
|
141
|
+
}
|
|
142
|
+
refreshHeaders();
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
return undefined;
|
|
146
|
+
})
|
|
147
|
+
.catch((error: Error) => {
|
|
148
|
+
if (!lifetime.signal.aborted) console.error("[laoshi] 读取工作区列表失败", error);
|
|
149
|
+
});
|
|
150
|
+
void poll();
|
|
151
|
+
const timer = setInterval(() => void poll(), 30_000);
|
|
152
|
+
|
|
153
|
+
return () => {
|
|
154
|
+
lifetime.abort();
|
|
155
|
+
releaseWorkspaces?.();
|
|
156
|
+
clearInterval(timer);
|
|
157
|
+
for (const b of [...pills.values(), ...headers.values()]) b.remove();
|
|
158
|
+
pills.clear();
|
|
159
|
+
headers.clear();
|
|
160
|
+
};
|
|
161
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// A small Markdown renderer for the requirement documents (spec, design, report…): headings,
|
|
2
|
+
// paragraphs, lists, task lists, tables, code blocks, quotes, rules, and inline bold, code and
|
|
3
|
+
// links. React Native only, colors from the theme, so it reads the same on desktop, web and phones.
|
|
4
|
+
import type { PluginHostProps } from "@getpaseo/plugin/client";
|
|
5
|
+
import { ExternalLink } from "@getpaseo/plugin/client/ui";
|
|
6
|
+
import { type ReactNode, useMemo } from "react";
|
|
7
|
+
import { ScrollView, Text, View } from "react-native";
|
|
8
|
+
import { rk } from "./ui";
|
|
9
|
+
|
|
10
|
+
type Theme = PluginHostProps["theme"];
|
|
11
|
+
|
|
12
|
+
export type Block =
|
|
13
|
+
| { kind: "heading"; level: number; text: string }
|
|
14
|
+
| { kind: "paragraph"; text: string }
|
|
15
|
+
| { kind: "list"; ordered: boolean; items: Array<{ text: string; depth: number; checked: boolean | null }> }
|
|
16
|
+
| { kind: "code"; text: string }
|
|
17
|
+
| { kind: "quote"; text: string }
|
|
18
|
+
| { kind: "table"; header: string[]; rows: string[][] }
|
|
19
|
+
| { kind: "rule" };
|
|
20
|
+
|
|
21
|
+
const LIST = /^(\s*)([-*+]|\d+[.)])\s+(\[[ xX]\]\s+)?(.*)$/;
|
|
22
|
+
|
|
23
|
+
function cells(line: string): string[] {
|
|
24
|
+
return line
|
|
25
|
+
.trim()
|
|
26
|
+
.replace(/^\|/, "")
|
|
27
|
+
.replace(/\|$/, "")
|
|
28
|
+
.replace(/\\\|/g, "\u0000")
|
|
29
|
+
.split("|")
|
|
30
|
+
.map((c) => c.trim().replace(/\u0000/g, "|"));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** A tab-separated file (decisions.tsv, lessons.tsv) as a Markdown table. */
|
|
34
|
+
export function tsvToMarkdown(tsv: string): string {
|
|
35
|
+
const rows = tsv.replace(/\r\n?/g, "\n").split("\n").filter((l) => l.trim());
|
|
36
|
+
if (rows.length === 0) return "";
|
|
37
|
+
const line = (r: string) => `| ${r.split("\t").map((c) => c.replace(/\|/g, "\\|")).join(" | ")} |`;
|
|
38
|
+
return [line(rows[0]), `|${rows[0].split("\t").map(() => " --- ").join("|")}|`, ...rows.slice(1).map(line)].join("\n");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Splits Markdown into blocks. Anything it does not recognise stays a paragraph. */
|
|
42
|
+
export function parseMarkdown(source: string): Block[] {
|
|
43
|
+
const lines = source.replace(/\r\n?/g, "\n").split("\n");
|
|
44
|
+
const blocks: Block[] = [];
|
|
45
|
+
let i = 0;
|
|
46
|
+
while (i < lines.length) {
|
|
47
|
+
const line = lines.at(i)!;
|
|
48
|
+
if (!line.trim()) {
|
|
49
|
+
i++;
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
const fence = /^\s*(```|~~~)/.exec(line);
|
|
53
|
+
if (fence) {
|
|
54
|
+
const body: string[] = [];
|
|
55
|
+
i++;
|
|
56
|
+
while (i < lines.length && !lines.at(i)!.trim().startsWith(fence[1])) body.push(lines.at(i++)!);
|
|
57
|
+
i++;
|
|
58
|
+
blocks.push({ kind: "code", text: body.join("\n") });
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
const heading = /^(#{1,6})\s+(.*?)\s*#*\s*$/.exec(line);
|
|
62
|
+
if (heading) {
|
|
63
|
+
blocks.push({ kind: "heading", level: heading[1].length, text: heading[2] });
|
|
64
|
+
i++;
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (/^\s*([-*_])(\s*\1){2,}\s*$/.test(line)) {
|
|
68
|
+
blocks.push({ kind: "rule" });
|
|
69
|
+
i++;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (line.trim().startsWith("|") && i + 1 < lines.length && /^\s*\|?\s*:?-{2,}/.test(lines.at(i + 1)!)) {
|
|
73
|
+
const header = cells(line);
|
|
74
|
+
const rows: string[][] = [];
|
|
75
|
+
i += 2;
|
|
76
|
+
while (i < lines.length && lines.at(i)!.trim().startsWith("|")) rows.push(cells(lines.at(i++)!));
|
|
77
|
+
blocks.push({ kind: "table", header, rows });
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if (/^\s*>/.test(line)) {
|
|
81
|
+
const body: string[] = [];
|
|
82
|
+
while (i < lines.length && /^\s*>/.test(lines.at(i)!)) body.push(lines.at(i++)!.replace(/^\s*>\s?/, ""));
|
|
83
|
+
blocks.push({ kind: "quote", text: body.join("\n") });
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (LIST.test(line)) {
|
|
87
|
+
const ordered = /^\s*\d/.test(line);
|
|
88
|
+
const items: Array<{ text: string; depth: number; checked: boolean | null }> = [];
|
|
89
|
+
while (i < lines.length) {
|
|
90
|
+
const m = LIST.exec(lines.at(i)!);
|
|
91
|
+
if (m) {
|
|
92
|
+
items.push({ text: m[4], depth: Math.min(3, Math.floor(m[1].replace(/\t/g, " ").length / 2)), checked: m[3] ? /x/i.test(m[3]) : null });
|
|
93
|
+
i++;
|
|
94
|
+
} else if (lines.at(i)!.trim() && /^\s{2,}/.test(lines.at(i)!) && items.length > 0) {
|
|
95
|
+
items.at(-1)!.text += ` ${lines.at(i++)!.trim()}`;
|
|
96
|
+
} else break;
|
|
97
|
+
}
|
|
98
|
+
blocks.push({ kind: "list", ordered, items });
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
const body: string[] = [];
|
|
102
|
+
while (i < lines.length && lines.at(i)!.trim() && !/^(#{1,6}\s|\s*```|\s*~~~|\s*>|\s*\|)/.test(lines.at(i)!) && !LIST.test(lines.at(i)!)) body.push(lines.at(i++)!.trim());
|
|
103
|
+
blocks.push({ kind: "paragraph", text: body.join(" ") });
|
|
104
|
+
}
|
|
105
|
+
return blocks;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** Inline **bold**, `code` and [links](https://…). */
|
|
109
|
+
export function inline(text: string, theme: Theme, key = "i"): ReactNode[] {
|
|
110
|
+
const out: ReactNode[] = [];
|
|
111
|
+
const pattern = /(\*\*([^*]+)\*\*|`([^`]+)`|\[([^\]]+)\]\(([^)\s]+)\))/g;
|
|
112
|
+
let last = 0;
|
|
113
|
+
let n = 0;
|
|
114
|
+
for (let m = pattern.exec(text); m; m = pattern.exec(text)) {
|
|
115
|
+
if (m.index > last) out.push(text.slice(last, m.index));
|
|
116
|
+
if (m[2] !== undefined) {
|
|
117
|
+
out.push(
|
|
118
|
+
<Text key={`${key}-${n++}`} style={{ fontWeight: "600" }}>
|
|
119
|
+
{m[2]}
|
|
120
|
+
</Text>,
|
|
121
|
+
);
|
|
122
|
+
} else if (m[3] !== undefined) {
|
|
123
|
+
out.push(
|
|
124
|
+
<Text key={`${key}-${n++}`} style={{ fontFamily: "monospace", backgroundColor: theme.colors.surface2 }}>
|
|
125
|
+
{m[3]}
|
|
126
|
+
</Text>,
|
|
127
|
+
);
|
|
128
|
+
} else if (m[5] && /^https?:\/\//.test(m[5])) {
|
|
129
|
+
out.push(
|
|
130
|
+
<ExternalLink key={`${key}-${n++}`} href={m[5]}>
|
|
131
|
+
{m[4]}
|
|
132
|
+
</ExternalLink>,
|
|
133
|
+
);
|
|
134
|
+
} else {
|
|
135
|
+
// A link to another file in the repository: show its text and where it points.
|
|
136
|
+
out.push(
|
|
137
|
+
<Text key={`${key}-${n++}`} style={{ color: rk(theme).brandText }}>
|
|
138
|
+
{m[4]}
|
|
139
|
+
</Text>,
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
last = m.index + m[0].length;
|
|
143
|
+
}
|
|
144
|
+
if (last < text.length) out.push(text.slice(last));
|
|
145
|
+
return out;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export function Markdown({ theme, source }: { theme: Theme; source: string }) {
|
|
149
|
+
const blocks = useMemo(() => parseMarkdown(source), [source]);
|
|
150
|
+
const text = { color: theme.colors.foreground, fontSize: 14, lineHeight: 21 };
|
|
151
|
+
const muted = { color: theme.colors.foregroundMuted };
|
|
152
|
+
return (
|
|
153
|
+
<View style={{ gap: 10 }}>
|
|
154
|
+
{blocks.map((b, i) => {
|
|
155
|
+
switch (b.kind) {
|
|
156
|
+
case "heading":
|
|
157
|
+
return (
|
|
158
|
+
<Text key={i} selectable style={{ ...text, fontWeight: "600", fontSize: b.level === 1 ? 20 : b.level === 2 ? 17 : 15, marginTop: i === 0 ? 0 : 6 }}>
|
|
159
|
+
{inline(b.text, theme, `h${i}`)}
|
|
160
|
+
</Text>
|
|
161
|
+
);
|
|
162
|
+
case "paragraph":
|
|
163
|
+
return (
|
|
164
|
+
<Text key={i} selectable style={text}>
|
|
165
|
+
{inline(b.text, theme, `p${i}`)}
|
|
166
|
+
</Text>
|
|
167
|
+
);
|
|
168
|
+
case "list":
|
|
169
|
+
return (
|
|
170
|
+
<View key={i} style={{ gap: 4 }}>
|
|
171
|
+
{b.items.map((item, j) => (
|
|
172
|
+
<View key={j} style={{ flexDirection: "row", gap: 6, paddingLeft: item.depth * 16 }}>
|
|
173
|
+
<Text style={{ ...text, ...muted, minWidth: 16 }}>{item.checked === null ? (b.ordered ? `${j + 1}.` : "•") : item.checked ? "☑" : "☐"}</Text>
|
|
174
|
+
<Text selectable style={{ ...text, flex: 1 }}>
|
|
175
|
+
{inline(item.text, theme, `l${i}-${j}`)}
|
|
176
|
+
</Text>
|
|
177
|
+
</View>
|
|
178
|
+
))}
|
|
179
|
+
</View>
|
|
180
|
+
);
|
|
181
|
+
case "code":
|
|
182
|
+
return (
|
|
183
|
+
<ScrollView key={i} horizontal style={{ backgroundColor: theme.colors.surface2, borderRadius: 8 }}>
|
|
184
|
+
<Text selectable style={{ ...text, fontFamily: "monospace", fontSize: 13, padding: 10 }}>
|
|
185
|
+
{b.text}
|
|
186
|
+
</Text>
|
|
187
|
+
</ScrollView>
|
|
188
|
+
);
|
|
189
|
+
case "quote":
|
|
190
|
+
return (
|
|
191
|
+
<View key={i} style={{ borderLeftWidth: 3, borderLeftColor: theme.colors.border, paddingLeft: 10 }}>
|
|
192
|
+
<Text selectable style={{ ...text, ...muted }}>
|
|
193
|
+
{inline(b.text, theme, `q${i}`)}
|
|
194
|
+
</Text>
|
|
195
|
+
</View>
|
|
196
|
+
);
|
|
197
|
+
case "rule":
|
|
198
|
+
return <View key={i} style={{ height: 1, backgroundColor: theme.colors.border }} />;
|
|
199
|
+
case "table":
|
|
200
|
+
return (
|
|
201
|
+
<ScrollView key={i} horizontal>
|
|
202
|
+
<View style={{ borderColor: theme.colors.border, borderWidth: 1, borderRadius: 6 }}>
|
|
203
|
+
{[b.header, ...b.rows].map((row, r) => (
|
|
204
|
+
<View key={r} style={{ flexDirection: "row", backgroundColor: r === 0 ? theme.colors.surface1 : undefined, borderTopWidth: r === 0 ? 0 : 1, borderTopColor: theme.colors.border }}>
|
|
205
|
+
{b.header.map((_, c) => (
|
|
206
|
+
<Text key={c} selectable style={{ ...text, fontSize: 13, fontWeight: r === 0 ? "600" : "400", width: 180, padding: 8 }}>
|
|
207
|
+
{inline(row.at(c) ?? "", theme, `t${i}-${r}-${c}`)}
|
|
208
|
+
</Text>
|
|
209
|
+
))}
|
|
210
|
+
</View>
|
|
211
|
+
))}
|
|
212
|
+
</View>
|
|
213
|
+
</ScrollView>
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
return null;
|
|
217
|
+
})}
|
|
218
|
+
</View>
|
|
219
|
+
);
|
|
220
|
+
}
|