@agimon-ai/po-help 0.0.0-alpha.73 → 0.0.0-alpha.75
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 +624 -0
- package/dist/extensions/native.mjs.map +1 -0
- package/dist/extensions/web.mjs +432 -19
- package/dist/extensions/web.mjs.map +1 -1
- package/package.json +35 -8
|
@@ -0,0 +1,624 @@
|
|
|
1
|
+
import { defineNativePlugin, defineToolRenderer } from "@agimon-ai/po-core/native";
|
|
2
|
+
import { View } from "react-native-unistyles/components/native/View";
|
|
3
|
+
import { Text } from "react-native-unistyles/components/native/Text";
|
|
4
|
+
import { Badge, CheckIcon, MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, SectionLabel, collapseLines, fontOf, toolTone } from "@agimon-ai/po-native-components";
|
|
5
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/extensions/workspaces/sessions/(frontend)/tool/_lib/helpStatusView.ts
|
|
8
|
+
const ACTIVATIONS = /* @__PURE__ */ new Set([
|
|
9
|
+
"inactive",
|
|
10
|
+
"activating",
|
|
11
|
+
"active",
|
|
12
|
+
"degraded"
|
|
13
|
+
]);
|
|
14
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
15
|
+
const count = (value) => typeof value === "number" && Number.isInteger(value) && value >= 0 ? value : void 0;
|
|
16
|
+
const text = (value) => typeof value === "string" && value.trim() !== "" ? value.trim() : void 0;
|
|
17
|
+
const records = (value) => Array.isArray(value) ? value.filter(isRecord) : [];
|
|
18
|
+
/** The tool's output as lines, blank lines dropped, as the web card shows them. */
|
|
19
|
+
function helpOutputLines(output) {
|
|
20
|
+
return output.split("\n").filter((line) => line.trim() !== "");
|
|
21
|
+
}
|
|
22
|
+
function capabilities(value) {
|
|
23
|
+
return records(value).flatMap((raw) => {
|
|
24
|
+
const name = text(raw.name);
|
|
25
|
+
if (name === void 0) return [];
|
|
26
|
+
const source = text(raw.source);
|
|
27
|
+
const reason = text(raw.reason);
|
|
28
|
+
return [{
|
|
29
|
+
name,
|
|
30
|
+
active: raw.active === true,
|
|
31
|
+
...source ? { source } : {},
|
|
32
|
+
...reason ? { reason } : {}
|
|
33
|
+
}];
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function parseStatus(raw) {
|
|
37
|
+
const activation = text(raw.activation);
|
|
38
|
+
if (activation === void 0 || !ACTIVATIONS.has(activation)) return null;
|
|
39
|
+
const counts = isRecord(raw.counts) ? raw.counts : {};
|
|
40
|
+
const toolCount = count(counts.tools);
|
|
41
|
+
return {
|
|
42
|
+
kind: "status",
|
|
43
|
+
activation,
|
|
44
|
+
skillCount: count(counts.skills) ?? null,
|
|
45
|
+
...toolCount === void 0 ? {} : { toolCount },
|
|
46
|
+
skills: capabilities(raw.skills),
|
|
47
|
+
tools: capabilities(raw.tools),
|
|
48
|
+
diagnostics: records(raw.diagnostics).flatMap((entry) => {
|
|
49
|
+
const code = text(entry.code);
|
|
50
|
+
if (code === void 0) return [];
|
|
51
|
+
const source = text(entry.source);
|
|
52
|
+
return [{
|
|
53
|
+
code,
|
|
54
|
+
...source ? { source } : {}
|
|
55
|
+
}];
|
|
56
|
+
}),
|
|
57
|
+
packages: records(raw.packages).flatMap((entry) => {
|
|
58
|
+
const packageName = text(entry.packageName);
|
|
59
|
+
if (packageName === void 0) return [];
|
|
60
|
+
const fields = {
|
|
61
|
+
scope: text(entry.scope),
|
|
62
|
+
stage: text(entry.stage),
|
|
63
|
+
reason: text(entry.reason)
|
|
64
|
+
};
|
|
65
|
+
const previous = text(entry.previous);
|
|
66
|
+
return [{
|
|
67
|
+
packageName,
|
|
68
|
+
...Object.fromEntries(Object.entries(fields).filter(([, value]) => value !== void 0)),
|
|
69
|
+
...previous && previous !== "none" ? { previous } : {}
|
|
70
|
+
}];
|
|
71
|
+
}),
|
|
72
|
+
truncated: raw.truncated === true
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function parseSetup(raw) {
|
|
76
|
+
const status = text(raw.status);
|
|
77
|
+
if (status !== "checks-passed" && status !== "issues-found") return null;
|
|
78
|
+
const selection = isRecord(raw.appliedSelection) ? raw.appliedSelection : {};
|
|
79
|
+
const majorMode = text(selection.majorMode);
|
|
80
|
+
const profile = text(selection.profile);
|
|
81
|
+
const limitations = text(raw.limitations);
|
|
82
|
+
return {
|
|
83
|
+
kind: "setup",
|
|
84
|
+
passed: status === "checks-passed",
|
|
85
|
+
...majorMode ? { majorMode } : {},
|
|
86
|
+
domains: Array.isArray(selection.domains) ? selection.domains.flatMap((value) => text(value) ?? []) : [],
|
|
87
|
+
...profile ? { profile } : {},
|
|
88
|
+
checks: records(raw.checks).flatMap((entry) => {
|
|
89
|
+
const area = text(entry.area);
|
|
90
|
+
if (area === void 0) return [];
|
|
91
|
+
const problemCount = count(entry.problemCount);
|
|
92
|
+
const guidance = text(entry.guidance);
|
|
93
|
+
return [{
|
|
94
|
+
area,
|
|
95
|
+
passed: entry.status === "passed",
|
|
96
|
+
...problemCount === void 0 ? {} : { problemCount },
|
|
97
|
+
...guidance ? { guidance } : {}
|
|
98
|
+
}];
|
|
99
|
+
}),
|
|
100
|
+
skipped: Array.isArray(raw.skipped) ? raw.skipped.flatMap((value) => text(value) ?? []) : [],
|
|
101
|
+
...limitations ? { limitations } : {}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/** The report a help diagnostic tool returned, or its raw lines when the output is not a report. */
|
|
105
|
+
function helpToolView(output) {
|
|
106
|
+
let parsed;
|
|
107
|
+
try {
|
|
108
|
+
parsed = JSON.parse(output);
|
|
109
|
+
} catch {
|
|
110
|
+
return {
|
|
111
|
+
kind: "text",
|
|
112
|
+
lines: helpOutputLines(output)
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
if (isRecord(parsed)) {
|
|
116
|
+
const view = parseStatus(parsed) ?? parseSetup(parsed);
|
|
117
|
+
if (view !== null) return view;
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
kind: "text",
|
|
121
|
+
lines: helpOutputLines(output)
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
const plural = (n, word) => `${String(n)} ${word}${n === 1 ? "" : "s"}`;
|
|
125
|
+
/** The header's primary piece: what the report concluded. */
|
|
126
|
+
function helpHeadline(view) {
|
|
127
|
+
if (view.kind === "setup") {
|
|
128
|
+
if (view.passed) return "Checks passed";
|
|
129
|
+
const failed = view.checks.filter((check) => !check.passed).length;
|
|
130
|
+
return failed > 0 ? `${plural(failed, "area")} failed` : "Issues found";
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
inactive: "Help off",
|
|
134
|
+
activating: "Help activating",
|
|
135
|
+
active: "Help active",
|
|
136
|
+
degraded: "Help degraded"
|
|
137
|
+
}[view.activation];
|
|
138
|
+
}
|
|
139
|
+
/** The key figures shown while the card is collapsed. */
|
|
140
|
+
function helpFigures(view) {
|
|
141
|
+
if (view.kind === "setup") {
|
|
142
|
+
const failed = view.checks.filter((check) => !check.passed).length;
|
|
143
|
+
return [
|
|
144
|
+
{
|
|
145
|
+
label: "Checks passed",
|
|
146
|
+
value: `${String(view.checks.length - failed)}/${String(view.checks.length)}`,
|
|
147
|
+
tone: "text"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
label: "Failed",
|
|
151
|
+
value: String(failed),
|
|
152
|
+
tone: failed > 0 ? "error" : "text"
|
|
153
|
+
},
|
|
154
|
+
...view.skipped.length > 0 ? [{
|
|
155
|
+
label: "Skipped",
|
|
156
|
+
value: String(view.skipped.length),
|
|
157
|
+
tone: "warning"
|
|
158
|
+
}] : []
|
|
159
|
+
];
|
|
160
|
+
}
|
|
161
|
+
if (view.activation === "inactive") return [];
|
|
162
|
+
return [
|
|
163
|
+
{
|
|
164
|
+
label: "Skills",
|
|
165
|
+
value: view.skillCount === null ? "pending" : String(view.skillCount),
|
|
166
|
+
tone: "text"
|
|
167
|
+
},
|
|
168
|
+
...view.toolCount === void 0 ? [] : [{
|
|
169
|
+
label: "Tools",
|
|
170
|
+
value: String(view.toolCount),
|
|
171
|
+
tone: "text"
|
|
172
|
+
}],
|
|
173
|
+
...view.diagnostics.length > 0 ? [{
|
|
174
|
+
label: "Diagnostics",
|
|
175
|
+
value: String(view.diagnostics.length),
|
|
176
|
+
tone: "warning"
|
|
177
|
+
}] : [],
|
|
178
|
+
...view.packages.length > 0 ? [{
|
|
179
|
+
label: "Failed packages",
|
|
180
|
+
value: String(view.packages.length),
|
|
181
|
+
tone: "error"
|
|
182
|
+
}] : []
|
|
183
|
+
];
|
|
184
|
+
}
|
|
185
|
+
/** A quiet sentence for the states that have no figures to explain themselves. */
|
|
186
|
+
function helpStateNote(view) {
|
|
187
|
+
if (view.activation === "inactive") return "Help mode is off in this session.";
|
|
188
|
+
if (view.activation === "activating") return "Skills are counted once the session is ready.";
|
|
189
|
+
}
|
|
190
|
+
/** Whether the card has detail to show on expand. */
|
|
191
|
+
function helpHasDetail(view) {
|
|
192
|
+
if (view.kind === "setup") return view.checks.length > 0 || view.skipped.length > 0 || view.limitations !== void 0;
|
|
193
|
+
return view.skills.length > 0 || view.tools.length > 0 || view.diagnostics.length > 0 || view.packages.length > 0 || view.truncated;
|
|
194
|
+
}
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/extensions/workspaces/sessions/(frontend)/tool/_components/HelpStatusCard.native.tsx
|
|
197
|
+
/** The web card's summary, kept while there is no report to summarise. */
|
|
198
|
+
const DEFAULT_SUMMARY = "Help diagnostics";
|
|
199
|
+
/**
|
|
200
|
+
* The help_status and diagnose_setup timeline item on native. The web card
|
|
201
|
+
* prints the tool's JSON as lines; here the report is laid out instead: the
|
|
202
|
+
* outcome in the header, key figures in the body, and the lists on expand.
|
|
203
|
+
* Output that does not parse keeps the web card's raw lines. A failed call
|
|
204
|
+
* shows only its reason in red; the header carries the failure.
|
|
205
|
+
*/
|
|
206
|
+
function HelpStatusCard({ toolName, output, running, isError }) {
|
|
207
|
+
const tone = toolTone({
|
|
208
|
+
running,
|
|
209
|
+
isError
|
|
210
|
+
});
|
|
211
|
+
const view = running || isError ? null : helpToolView(output);
|
|
212
|
+
if (view !== null && view.kind !== "text") return /* @__PURE__ */ jsx(ReportCard, {
|
|
213
|
+
toolName,
|
|
214
|
+
tone,
|
|
215
|
+
view
|
|
216
|
+
});
|
|
217
|
+
const lines = view?.lines ?? helpOutputLines(output);
|
|
218
|
+
if (isError) return /* @__PURE__ */ jsxs(MessageItem, {
|
|
219
|
+
tone,
|
|
220
|
+
children: [/* @__PURE__ */ jsx(MessageItemHeader, {
|
|
221
|
+
title: toolName,
|
|
222
|
+
children: DEFAULT_SUMMARY
|
|
223
|
+
}), lines.length > 0 ? /* @__PURE__ */ jsx(MessageItemBody, { children: /* @__PURE__ */ jsx(Text, {
|
|
224
|
+
selectable: true,
|
|
225
|
+
style: [styles.sans, styles.error],
|
|
226
|
+
children: lines.join("\n")
|
|
227
|
+
}) }) : null]
|
|
228
|
+
});
|
|
229
|
+
return /* @__PURE__ */ jsx(MessageItem, {
|
|
230
|
+
tone,
|
|
231
|
+
expandable: lines.length > 12,
|
|
232
|
+
children: ({ expanded }) => {
|
|
233
|
+
const shown = collapseLines(lines, 12, expanded);
|
|
234
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MessageItemHeader, {
|
|
235
|
+
title: toolName,
|
|
236
|
+
children: DEFAULT_SUMMARY
|
|
237
|
+
}), shown.shown.length > 0 || running ? /* @__PURE__ */ jsxs(MessageItemBody, { children: [
|
|
238
|
+
shown.shown.map((line, index) => /* @__PURE__ */ jsx(Text, {
|
|
239
|
+
selectable: true,
|
|
240
|
+
style: [styles.sans, styles.text],
|
|
241
|
+
children: line
|
|
242
|
+
}, `${String(index)}-${line}`)),
|
|
243
|
+
shown.hidden > 0 ? /* @__PURE__ */ jsxs(MessageItemStatus, {
|
|
244
|
+
expands: true,
|
|
245
|
+
children: [shown.hidden, " more lines"]
|
|
246
|
+
}) : null,
|
|
247
|
+
running ? /* @__PURE__ */ jsx(MessageItemStatus, {
|
|
248
|
+
tone: "running",
|
|
249
|
+
children: "Inspecting this session"
|
|
250
|
+
}) : null
|
|
251
|
+
] }) : null] });
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
function ReportCard({ toolName, tone, view }) {
|
|
256
|
+
const figures = helpFigures(view);
|
|
257
|
+
const note = view.kind === "status" ? helpStateNote(view) : void 0;
|
|
258
|
+
return /* @__PURE__ */ jsx(MessageItem, {
|
|
259
|
+
tone,
|
|
260
|
+
expandable: helpHasDetail(view),
|
|
261
|
+
children: ({ expanded }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MessageItemHeader, {
|
|
262
|
+
title: toolName,
|
|
263
|
+
children: /* @__PURE__ */ jsx(View, {
|
|
264
|
+
testID: `tool-call-${toolName}`,
|
|
265
|
+
style: styles.summary,
|
|
266
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
267
|
+
numberOfLines: 1,
|
|
268
|
+
style: [styles.sans, styles.primary],
|
|
269
|
+
children: helpHeadline(view)
|
|
270
|
+
})
|
|
271
|
+
})
|
|
272
|
+
}), /* @__PURE__ */ jsxs(MessageItemBody, {
|
|
273
|
+
testID: `tool-result-${toolName}`,
|
|
274
|
+
style: styles.body,
|
|
275
|
+
children: [
|
|
276
|
+
note !== void 0 ? /* @__PURE__ */ jsx(Text, {
|
|
277
|
+
style: [styles.small, styles.dim],
|
|
278
|
+
children: note
|
|
279
|
+
}) : null,
|
|
280
|
+
figures.length > 0 ? /* @__PURE__ */ jsx(View, {
|
|
281
|
+
style: styles.figures,
|
|
282
|
+
children: figures.map((figure) => /* @__PURE__ */ jsxs(View, {
|
|
283
|
+
style: styles.figure,
|
|
284
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
285
|
+
numberOfLines: 1,
|
|
286
|
+
style: [styles.small, styles.dim],
|
|
287
|
+
children: figure.label
|
|
288
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
289
|
+
numberOfLines: 1,
|
|
290
|
+
style: [styles.value, figure.tone === "error" ? styles.error : figure.tone === "warning" ? styles.warning : styles.hi],
|
|
291
|
+
children: figure.value
|
|
292
|
+
})]
|
|
293
|
+
}, figure.label))
|
|
294
|
+
}) : null,
|
|
295
|
+
expanded ? view.kind === "status" ? /* @__PURE__ */ jsx(StatusDetail, { view }) : /* @__PURE__ */ jsx(SetupDetail, { view }) : null
|
|
296
|
+
]
|
|
297
|
+
})] })
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
function StatusDetail({ view }) {
|
|
301
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
302
|
+
view.packages.length > 0 ? /* @__PURE__ */ jsxs(View, {
|
|
303
|
+
style: styles.section,
|
|
304
|
+
children: [/* @__PURE__ */ jsx(SectionLabel, { children: "Failed packages" }), view.packages.map((entry, index) => /* @__PURE__ */ jsxs(View, {
|
|
305
|
+
style: styles.entry,
|
|
306
|
+
children: [
|
|
307
|
+
/* @__PURE__ */ jsxs(View, {
|
|
308
|
+
style: styles.row,
|
|
309
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
310
|
+
numberOfLines: 1,
|
|
311
|
+
style: [
|
|
312
|
+
styles.mono,
|
|
313
|
+
styles.text,
|
|
314
|
+
styles.name
|
|
315
|
+
],
|
|
316
|
+
children: entry.packageName
|
|
317
|
+
}), entry.stage !== void 0 ? /* @__PURE__ */ jsxs(Text, {
|
|
318
|
+
numberOfLines: 1,
|
|
319
|
+
style: [
|
|
320
|
+
styles.small,
|
|
321
|
+
styles.faint,
|
|
322
|
+
styles.trail
|
|
323
|
+
],
|
|
324
|
+
children: [entry.stage, entry.scope !== void 0 ? ` · ${entry.scope}` : ""]
|
|
325
|
+
}) : null]
|
|
326
|
+
}),
|
|
327
|
+
entry.reason !== void 0 ? /* @__PURE__ */ jsx(Text, {
|
|
328
|
+
selectable: true,
|
|
329
|
+
style: [styles.small, styles.error],
|
|
330
|
+
children: entry.reason
|
|
331
|
+
}) : null,
|
|
332
|
+
entry.previous !== void 0 ? /* @__PURE__ */ jsxs(Text, {
|
|
333
|
+
style: [styles.small, styles.faint],
|
|
334
|
+
children: ["Previous build ", entry.previous]
|
|
335
|
+
}) : null
|
|
336
|
+
]
|
|
337
|
+
}, `${entry.packageName}-${String(index)}`))]
|
|
338
|
+
}) : null,
|
|
339
|
+
view.diagnostics.length > 0 ? /* @__PURE__ */ jsxs(View, {
|
|
340
|
+
style: styles.section,
|
|
341
|
+
children: [/* @__PURE__ */ jsx(SectionLabel, { children: "Diagnostics" }), view.diagnostics.map((entry, index) => /* @__PURE__ */ jsxs(View, {
|
|
342
|
+
style: styles.row,
|
|
343
|
+
children: [/* @__PURE__ */ jsx(Badge, {
|
|
344
|
+
tone: "yellow",
|
|
345
|
+
size: "xs",
|
|
346
|
+
children: entry.code
|
|
347
|
+
}), entry.source !== void 0 ? /* @__PURE__ */ jsx(Text, {
|
|
348
|
+
numberOfLines: 1,
|
|
349
|
+
ellipsizeMode: "head",
|
|
350
|
+
style: [
|
|
351
|
+
styles.mono,
|
|
352
|
+
styles.dim,
|
|
353
|
+
styles.trail
|
|
354
|
+
],
|
|
355
|
+
children: entry.source
|
|
356
|
+
}) : null]
|
|
357
|
+
}, `${entry.code}-${String(index)}`))]
|
|
358
|
+
}) : null,
|
|
359
|
+
/* @__PURE__ */ jsx(CapabilityList, {
|
|
360
|
+
label: "Skills",
|
|
361
|
+
rows: view.skills
|
|
362
|
+
}),
|
|
363
|
+
/* @__PURE__ */ jsx(CapabilityList, {
|
|
364
|
+
label: "Tools",
|
|
365
|
+
rows: view.tools
|
|
366
|
+
}),
|
|
367
|
+
view.truncated ? /* @__PURE__ */ jsx(Text, {
|
|
368
|
+
style: [styles.small, styles.faint],
|
|
369
|
+
children: "The tool capped its lists; more exist."
|
|
370
|
+
}) : null
|
|
371
|
+
] });
|
|
372
|
+
}
|
|
373
|
+
function CapabilityList({ label, rows }) {
|
|
374
|
+
if (rows.length === 0) return null;
|
|
375
|
+
const shown = rows.slice(0, 10);
|
|
376
|
+
return /* @__PURE__ */ jsxs(View, {
|
|
377
|
+
style: styles.section,
|
|
378
|
+
children: [
|
|
379
|
+
/* @__PURE__ */ jsx(SectionLabel, { children: label }),
|
|
380
|
+
shown.map((row, index) => /* @__PURE__ */ jsxs(View, {
|
|
381
|
+
style: styles.row,
|
|
382
|
+
children: [
|
|
383
|
+
/* @__PURE__ */ jsx(Text, {
|
|
384
|
+
numberOfLines: 1,
|
|
385
|
+
style: [
|
|
386
|
+
styles.mono,
|
|
387
|
+
row.active ? styles.text : styles.dim,
|
|
388
|
+
styles.name
|
|
389
|
+
],
|
|
390
|
+
children: row.name
|
|
391
|
+
}),
|
|
392
|
+
!row.active ? /* @__PURE__ */ jsx(Badge, {
|
|
393
|
+
size: "xs",
|
|
394
|
+
style: styles.chip,
|
|
395
|
+
children: row.reason ?? "inactive"
|
|
396
|
+
}) : null,
|
|
397
|
+
row.source !== void 0 ? /* @__PURE__ */ jsx(Text, {
|
|
398
|
+
numberOfLines: 1,
|
|
399
|
+
ellipsizeMode: "head",
|
|
400
|
+
style: [
|
|
401
|
+
styles.small,
|
|
402
|
+
styles.faint,
|
|
403
|
+
styles.trail
|
|
404
|
+
],
|
|
405
|
+
children: row.source
|
|
406
|
+
}) : null
|
|
407
|
+
]
|
|
408
|
+
}, `${row.name}-${String(index)}`)),
|
|
409
|
+
rows.length > shown.length ? /* @__PURE__ */ jsxs(Text, {
|
|
410
|
+
style: [styles.small, styles.faint],
|
|
411
|
+
children: [
|
|
412
|
+
"and ",
|
|
413
|
+
rows.length - shown.length,
|
|
414
|
+
" more"
|
|
415
|
+
]
|
|
416
|
+
}) : null
|
|
417
|
+
]
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
function SetupDetail({ view }) {
|
|
421
|
+
const selection = [
|
|
422
|
+
...view.majorMode !== void 0 ? [`mode ${view.majorMode}`] : [],
|
|
423
|
+
...view.domains.map((domain) => `domain ${domain}`),
|
|
424
|
+
...view.profile !== void 0 ? [`profile ${view.profile}`] : []
|
|
425
|
+
];
|
|
426
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
427
|
+
selection.length > 0 ? /* @__PURE__ */ jsxs(View, {
|
|
428
|
+
style: styles.section,
|
|
429
|
+
children: [/* @__PURE__ */ jsx(SectionLabel, { children: "Selection" }), /* @__PURE__ */ jsx(View, {
|
|
430
|
+
style: styles.wrapRow,
|
|
431
|
+
children: selection.map((item) => /* @__PURE__ */ jsx(Badge, {
|
|
432
|
+
size: "xs",
|
|
433
|
+
children: item
|
|
434
|
+
}, item))
|
|
435
|
+
})]
|
|
436
|
+
}) : null,
|
|
437
|
+
view.checks.length > 0 ? /* @__PURE__ */ jsxs(View, {
|
|
438
|
+
style: styles.section,
|
|
439
|
+
children: [/* @__PURE__ */ jsx(SectionLabel, { children: "Checks" }), view.checks.map((check) => /* @__PURE__ */ jsxs(View, {
|
|
440
|
+
style: styles.entry,
|
|
441
|
+
children: [/* @__PURE__ */ jsxs(View, {
|
|
442
|
+
style: styles.row,
|
|
443
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
444
|
+
numberOfLines: 1,
|
|
445
|
+
style: [
|
|
446
|
+
styles.mono,
|
|
447
|
+
styles.text,
|
|
448
|
+
styles.area
|
|
449
|
+
],
|
|
450
|
+
children: check.area
|
|
451
|
+
}), check.passed ? /* @__PURE__ */ jsx(CheckIcon, {
|
|
452
|
+
size: 14,
|
|
453
|
+
color: "green"
|
|
454
|
+
}) : /* @__PURE__ */ jsx(Text, {
|
|
455
|
+
numberOfLines: 1,
|
|
456
|
+
style: [
|
|
457
|
+
styles.small,
|
|
458
|
+
styles.error,
|
|
459
|
+
styles.trail
|
|
460
|
+
],
|
|
461
|
+
children: check.problemCount === void 0 ? "failed" : `${String(check.problemCount)} problem${check.problemCount === 1 ? "" : "s"}`
|
|
462
|
+
})]
|
|
463
|
+
}), !check.passed && check.guidance !== void 0 ? /* @__PURE__ */ jsxs(Text, {
|
|
464
|
+
numberOfLines: 1,
|
|
465
|
+
style: [styles.small, styles.faint],
|
|
466
|
+
children: ["Guide: ", check.guidance]
|
|
467
|
+
}) : null]
|
|
468
|
+
}, check.area))]
|
|
469
|
+
}) : null,
|
|
470
|
+
view.skipped.length > 0 ? /* @__PURE__ */ jsxs(View, {
|
|
471
|
+
style: styles.section,
|
|
472
|
+
children: [/* @__PURE__ */ jsx(SectionLabel, { children: "Skipped" }), view.skipped.map((item) => /* @__PURE__ */ jsx(Text, {
|
|
473
|
+
style: [styles.small, styles.warning],
|
|
474
|
+
children: item
|
|
475
|
+
}, item))]
|
|
476
|
+
}) : null,
|
|
477
|
+
view.limitations !== void 0 ? /* @__PURE__ */ jsx(Text, {
|
|
478
|
+
style: [styles.small, styles.faint],
|
|
479
|
+
children: view.limitations
|
|
480
|
+
}) : null
|
|
481
|
+
] });
|
|
482
|
+
}
|
|
483
|
+
/** Numbers line up down a column. */
|
|
484
|
+
const TABULAR = ["tabular-nums"];
|
|
485
|
+
const styles = StyleSheet.create((theme) => ({
|
|
486
|
+
summary: {
|
|
487
|
+
flex: 1,
|
|
488
|
+
flexDirection: "row",
|
|
489
|
+
alignItems: "center",
|
|
490
|
+
gap: theme.spacing(1.5),
|
|
491
|
+
minWidth: 0,
|
|
492
|
+
uni__dependencies: [0]
|
|
493
|
+
},
|
|
494
|
+
primary: {
|
|
495
|
+
flexShrink: 0,
|
|
496
|
+
maxWidth: "70%",
|
|
497
|
+
color: theme.colors.text,
|
|
498
|
+
uni__dependencies: [0]
|
|
499
|
+
},
|
|
500
|
+
body: {
|
|
501
|
+
gap: theme.spacing(4),
|
|
502
|
+
uni__dependencies: [0]
|
|
503
|
+
},
|
|
504
|
+
section: {
|
|
505
|
+
gap: theme.spacing(2),
|
|
506
|
+
uni__dependencies: [0]
|
|
507
|
+
},
|
|
508
|
+
entry: {
|
|
509
|
+
gap: theme.spacing(.5),
|
|
510
|
+
uni__dependencies: [0]
|
|
511
|
+
},
|
|
512
|
+
row: {
|
|
513
|
+
flexDirection: "row",
|
|
514
|
+
alignItems: "center",
|
|
515
|
+
gap: theme.spacing(2),
|
|
516
|
+
minWidth: 0,
|
|
517
|
+
uni__dependencies: [0]
|
|
518
|
+
},
|
|
519
|
+
wrapRow: {
|
|
520
|
+
flexDirection: "row",
|
|
521
|
+
flexWrap: "wrap",
|
|
522
|
+
alignItems: "center",
|
|
523
|
+
gap: theme.spacing(2),
|
|
524
|
+
uni__dependencies: [0]
|
|
525
|
+
},
|
|
526
|
+
name: {
|
|
527
|
+
flexShrink: 1,
|
|
528
|
+
minWidth: 0
|
|
529
|
+
},
|
|
530
|
+
area: {
|
|
531
|
+
flex: 1,
|
|
532
|
+
minWidth: 0
|
|
533
|
+
},
|
|
534
|
+
chip: { flexShrink: 0 },
|
|
535
|
+
trail: {
|
|
536
|
+
flex: 1,
|
|
537
|
+
minWidth: 0,
|
|
538
|
+
textAlign: "right"
|
|
539
|
+
},
|
|
540
|
+
figures: {
|
|
541
|
+
flexDirection: "row",
|
|
542
|
+
flexWrap: "wrap",
|
|
543
|
+
rowGap: theme.spacing(3),
|
|
544
|
+
uni__dependencies: [0]
|
|
545
|
+
},
|
|
546
|
+
figure: {
|
|
547
|
+
width: "50%",
|
|
548
|
+
gap: theme.spacing(.5),
|
|
549
|
+
paddingRight: theme.spacing(2),
|
|
550
|
+
uni__dependencies: [0]
|
|
551
|
+
},
|
|
552
|
+
sans: {
|
|
553
|
+
fontFamily: fontOf(theme.fontFamily.sans),
|
|
554
|
+
fontSize: theme.fontSize.base,
|
|
555
|
+
lineHeight: theme.lineHeight.base,
|
|
556
|
+
uni__dependencies: [0]
|
|
557
|
+
},
|
|
558
|
+
small: {
|
|
559
|
+
fontFamily: fontOf(theme.fontFamily.sans),
|
|
560
|
+
fontSize: theme.fontSize.sm,
|
|
561
|
+
lineHeight: theme.lineHeight.sm,
|
|
562
|
+
uni__dependencies: [0]
|
|
563
|
+
},
|
|
564
|
+
mono: {
|
|
565
|
+
fontFamily: fontOf(theme.fontFamily.mono),
|
|
566
|
+
fontSize: theme.fontSize.sm,
|
|
567
|
+
lineHeight: theme.lineHeight.sm,
|
|
568
|
+
uni__dependencies: [0]
|
|
569
|
+
},
|
|
570
|
+
value: {
|
|
571
|
+
fontFamily: fontOf(theme.fontFamily.sans),
|
|
572
|
+
fontSize: theme.fontSize.lg,
|
|
573
|
+
lineHeight: theme.lineHeight.lg,
|
|
574
|
+
fontWeight: theme.fontWeight.semibold,
|
|
575
|
+
fontVariant: TABULAR,
|
|
576
|
+
uni__dependencies: [0]
|
|
577
|
+
},
|
|
578
|
+
text: {
|
|
579
|
+
color: theme.colors.text,
|
|
580
|
+
uni__dependencies: [0]
|
|
581
|
+
},
|
|
582
|
+
hi: {
|
|
583
|
+
color: theme.colors.hi,
|
|
584
|
+
uni__dependencies: [0]
|
|
585
|
+
},
|
|
586
|
+
dim: {
|
|
587
|
+
color: theme.colors.dim,
|
|
588
|
+
uni__dependencies: [0]
|
|
589
|
+
},
|
|
590
|
+
faint: {
|
|
591
|
+
color: theme.colors.faint,
|
|
592
|
+
uni__dependencies: [0]
|
|
593
|
+
},
|
|
594
|
+
warning: {
|
|
595
|
+
color: theme.colors.yellow,
|
|
596
|
+
uni__dependencies: [0]
|
|
597
|
+
},
|
|
598
|
+
error: {
|
|
599
|
+
color: theme.colors.red,
|
|
600
|
+
uni__dependencies: [0]
|
|
601
|
+
}
|
|
602
|
+
}));
|
|
603
|
+
//#endregion
|
|
604
|
+
//#region src/extensions/workspaces/sessions/(frontend)/tool/help-status.native.tsx
|
|
605
|
+
var help_status_native_default = defineToolRenderer({
|
|
606
|
+
tools: ["help_status", "diagnose_setup"],
|
|
607
|
+
message: HelpStatusCard
|
|
608
|
+
});
|
|
609
|
+
//#endregion
|
|
610
|
+
//#region generated/native.ts
|
|
611
|
+
const via = (identity, value) => value === void 0 ? void 0 : {
|
|
612
|
+
...identity,
|
|
613
|
+
...value
|
|
614
|
+
};
|
|
615
|
+
const nativePlugin = defineNativePlugin({
|
|
616
|
+
id: "help",
|
|
617
|
+
session: { get toolRenderers() {
|
|
618
|
+
return [via({ tools: ["help_status"] }, help_status_native_default)];
|
|
619
|
+
} }
|
|
620
|
+
});
|
|
621
|
+
//#endregion
|
|
622
|
+
export { nativePlugin };
|
|
623
|
+
|
|
624
|
+
//# sourceMappingURL=native.mjs.map
|