@agimon-ai/po-log 0.0.0-alpha.194 → 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/LICENSE +21 -149
- package/README.md +1 -1
- package/dist/extensions/native.mjs +97 -82
- package/dist/extensions/native.mjs.map +1 -1
- package/dist/extensions/web.mjs +359 -295
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/po-runtime-identity.json +1 -1
- package/package.json +12 -12
package/LICENSE
CHANGED
|
@@ -1,149 +1,21 @@
|
|
|
1
|
-
License
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
other Organization. Use by an individual in the course of employment
|
|
23
|
-
or engagement by an Organization is use by that Organization.
|
|
24
|
-
|
|
25
|
-
(b) Small Organization Use. Use by or on behalf of an Organization whose
|
|
26
|
-
Annual Revenue is less than USD 1,000,000.
|
|
27
|
-
|
|
28
|
-
(c) Non-profit, Education and Research Use. Use, regardless of Annual
|
|
29
|
-
Revenue, by (i) an Organization registered or recognized as a
|
|
30
|
-
non-profit or charitable organization under the laws of its
|
|
31
|
-
jurisdiction, for its non-profit purposes; (ii) an accredited school,
|
|
32
|
-
college, or university, for teaching, learning, or academic research;
|
|
33
|
-
or (iii) a publicly funded research institution, for its research.
|
|
34
|
-
|
|
35
|
-
(d) Service Provider Use. Use by a consultant, contractor, agency, or other
|
|
36
|
-
service provider, regardless of its own Annual Revenue, solely to
|
|
37
|
-
build, deploy, host, operate, or support the Licensed Work for a client
|
|
38
|
-
whose own use would be Eligible Use under (a), (b), or (c). A service
|
|
39
|
-
provider's use for its own purposes is Eligible Use only if the service
|
|
40
|
-
provider itself qualifies under (b) or (c).
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
Hosted services. Offering the Licensed Work to third parties as a hosted
|
|
44
|
-
or managed service whose primary value is the Licensed Work is Eligible
|
|
45
|
-
Use only if each such third party's own use would be Eligible Use.
|
|
46
|
-
|
|
47
|
-
Definitions. "Organization" means any company, partnership, sole
|
|
48
|
-
proprietorship, trust, association, government body, or other entity, and
|
|
49
|
-
includes an individual acting in a business or professional capacity.
|
|
50
|
-
"Affiliate" means any entity that directly or indirectly controls, is
|
|
51
|
-
controlled by, or is under common control with an Organization, where
|
|
52
|
-
"control" means ownership of more than 50% of the voting interests of an
|
|
53
|
-
entity or the power to direct its management and policies by contract or
|
|
54
|
-
otherwise. "Annual Revenue" means the total gross revenue of an
|
|
55
|
-
Organization and all of its Affiliates combined, from all sources and
|
|
56
|
-
whether or not related to the Licensed Work, for its most recently
|
|
57
|
-
completed fiscal year, or, if it has not completed a fiscal year, for the
|
|
58
|
-
twelve months before the use (or since its formation, if shorter),
|
|
59
|
-
converted into US dollars at the average exchange rate for that period.
|
|
60
|
-
Proceeds of equity or debt financing are not revenue.
|
|
61
|
-
|
|
62
|
-
Threshold. If an Organization stops qualifying under (b), its existing
|
|
63
|
-
production use remains Eligible Use for 90 days after it stops
|
|
64
|
-
qualifying, after which it must obtain a commercial license or stop
|
|
65
|
-
production use. Use that was Eligible Use when it occurred never requires
|
|
66
|
-
a commercial license after the fact.
|
|
67
|
-
Change Date: Four years from the date a version of the Licensed Work
|
|
68
|
-
is first publicly released by the Licensor.
|
|
69
|
-
Change License: Apache License, Version 2.0
|
|
70
|
-
|
|
71
|
-
For information about alternative licensing arrangements for the Licensed
|
|
72
|
-
Work, please visit: https://agimon.ai/licensing
|
|
73
|
-
|
|
74
|
-
Notice
|
|
75
|
-
|
|
76
|
-
The Business Source License (this document, or the "License") is not an Open
|
|
77
|
-
Source license. However, the Licensed Work will eventually be made available
|
|
78
|
-
under an Open Source License, as stated in this License.
|
|
79
|
-
|
|
80
|
-
-----------------------------------------------------------------------------
|
|
81
|
-
|
|
82
|
-
Business Source License 1.1
|
|
83
|
-
|
|
84
|
-
Terms
|
|
85
|
-
|
|
86
|
-
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
87
|
-
works, redistribute, and make non-production use of the Licensed Work. The
|
|
88
|
-
Licensor may make an Additional Use Grant, above, permitting limited
|
|
89
|
-
production use.
|
|
90
|
-
|
|
91
|
-
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
92
|
-
available distribution of a specific version of the Licensed Work under this
|
|
93
|
-
License, whichever comes first, the Licensor hereby grants you rights under
|
|
94
|
-
the terms of the Change License, and the rights granted in the paragraph
|
|
95
|
-
above terminate.
|
|
96
|
-
|
|
97
|
-
If your use of the Licensed Work does not comply with the requirements
|
|
98
|
-
currently in effect as described in this License, you must purchase a
|
|
99
|
-
commercial license from the Licensor, its affiliated entities, or authorized
|
|
100
|
-
resellers, or you must refrain from using the Licensed Work.
|
|
101
|
-
|
|
102
|
-
All copies of the original and modified Licensed Work, and derivative works
|
|
103
|
-
of the Licensed Work, are subject to this License. This License applies
|
|
104
|
-
separately for each version of the Licensed Work and the Change Date may vary
|
|
105
|
-
for each version of the Licensed Work released by Licensor.
|
|
106
|
-
|
|
107
|
-
You must conspicuously display this License on each original or modified copy
|
|
108
|
-
of the Licensed Work. If you receive the Licensed Work in original or
|
|
109
|
-
modified form from a third party, the terms and conditions set forth in this
|
|
110
|
-
License apply to your use of that work.
|
|
111
|
-
|
|
112
|
-
Any use of the Licensed Work in violation of this License will automatically
|
|
113
|
-
terminate your rights under this License for the current and all other
|
|
114
|
-
versions of the Licensed Work.
|
|
115
|
-
|
|
116
|
-
This License does not grant you any right in any trademark or logo of
|
|
117
|
-
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
118
|
-
Licensor as expressly required by this License).
|
|
119
|
-
|
|
120
|
-
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
121
|
-
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
122
|
-
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
123
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
124
|
-
TITLE.
|
|
125
|
-
|
|
126
|
-
MariaDB hereby grants you permission to use this License’s text to license
|
|
127
|
-
your works, and to refer to it using the trademark “Business Source License”,
|
|
128
|
-
as long as you comply with the Covenants of Licensor below.
|
|
129
|
-
|
|
130
|
-
Covenants of Licensor
|
|
131
|
-
|
|
132
|
-
In consideration of the right to use this License’s text and the “Business
|
|
133
|
-
Source License” name and trademark, Licensor covenants to MariaDB, and to all
|
|
134
|
-
other recipients of the licensed work to be provided by Licensor:
|
|
135
|
-
|
|
136
|
-
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
137
|
-
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
138
|
-
where “compatible” means that software provided under the Change License can
|
|
139
|
-
be included in a program with software provided under GPL Version 2.0 or a
|
|
140
|
-
later version. Licensor may specify additional Change Licenses without
|
|
141
|
-
limitation.
|
|
142
|
-
|
|
143
|
-
2. To either: (a) specify an additional grant of rights to use that does not
|
|
144
|
-
impose any additional restriction on the right granted in this License, as
|
|
145
|
-
the Additional Use Grant; or (b) insert the text “None”.
|
|
146
|
-
|
|
147
|
-
3. To specify a Change Date.
|
|
148
|
-
|
|
149
|
-
4. Not to modify this License in any other way.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Agimon Pty Ltd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -57,4 +57,4 @@ Maintained by [Agimon](https://agimon.ai/about).
|
|
|
57
57
|
|
|
58
58
|
## License
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
MIT. See [LICENSE](LICENSE).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineNativePlugin, defineToolRenderer } from "@agimon-ai/po-core/native";
|
|
1
|
+
import { defineNativePlugin, defineToolRenderer, 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 { Badge, CodeBlock, MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, SectionLabel, StatusBadge, collapseLines, fontOf, toolTone } from "@agimon-ai/po-native-components";
|
|
@@ -87,27 +87,27 @@ function compactNumber(value) {
|
|
|
87
87
|
}
|
|
88
88
|
const words = (value) => value.replaceAll(/[-_]/g, " ");
|
|
89
89
|
/** The header summary: the primary piece stays whole, the context may truncate. */
|
|
90
|
-
function diagnosticSummary(report) {
|
|
90
|
+
function diagnosticSummary(t, report) {
|
|
91
91
|
const context = [report.scope, report.period].flatMap((part) => part ? [words(part)] : []).join(" · ");
|
|
92
92
|
const issues = report.capturedIssues;
|
|
93
|
-
const primary = report.evidence === "unavailable" ? "Telemetry unavailable" : report.evidence === "empty" ? "Nothing captured" : issues === void 0 ? "Captured agent evidence" : issues === 0 ? "No issues" :
|
|
93
|
+
const primary = report.evidence === "unavailable" ? t("log.ui.telemetryUnavailable", "Telemetry unavailable") : report.evidence === "empty" ? t("log.ui.nothingCaptured", "Nothing captured") : issues === void 0 ? t("log.ui.capturedAgentEvidence", "Captured agent evidence") : issues === 0 ? t("log.ui.noIssues", "No issues") : issues === 1 ? t("log.ui.issueCountOne", "{count} issue", { count: issues }) : t("log.ui.issueCount", "{count} issues", { count: issues });
|
|
94
94
|
return context === "" ? { primary } : {
|
|
95
95
|
primary,
|
|
96
96
|
context
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
/** The key figures row; a figure the report did not send is left out rather than shown as zero. */
|
|
100
|
-
function diagnosticFigures(report) {
|
|
100
|
+
function diagnosticFigures(t, report) {
|
|
101
101
|
const figures = [];
|
|
102
102
|
if (report.capturedRecords !== void 0) figures.push({
|
|
103
|
-
label: "Records",
|
|
103
|
+
label: t("log.ui.records", "Records"),
|
|
104
104
|
value: report.capturedRecords.toLocaleString("en-US"),
|
|
105
105
|
failure: false
|
|
106
106
|
});
|
|
107
107
|
if (report.capturedIssues !== void 0) {
|
|
108
108
|
const failing = report.capturedIssues > 0 && report.categories.some((category) => category.failure);
|
|
109
109
|
figures.push({
|
|
110
|
-
label: "Issues",
|
|
110
|
+
label: t("log.ui.issues", "Issues"),
|
|
111
111
|
value: report.capturedIssues.toLocaleString("en-US"),
|
|
112
112
|
failure: failing
|
|
113
113
|
});
|
|
@@ -115,30 +115,30 @@ function diagnosticFigures(report) {
|
|
|
115
115
|
if (report.inputTokens !== void 0 || report.outputTokens !== void 0) {
|
|
116
116
|
const side = (value) => value === void 0 ? "?" : compactNumber(value);
|
|
117
117
|
figures.push({
|
|
118
|
-
label: "Tokens in / out",
|
|
118
|
+
label: t("log.ui.tokensInOut", "Tokens in / out"),
|
|
119
119
|
value: `${side(report.inputTokens)} / ${side(report.outputTokens)}`,
|
|
120
120
|
failure: false
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
if (report.tokenCoveragePercent !== void 0) figures.push({
|
|
124
|
-
label: "Token coverage",
|
|
124
|
+
label: t("log.ui.tokenCoverage", "Token coverage"),
|
|
125
125
|
value: `${String(report.tokenCoveragePercent)}%`,
|
|
126
126
|
failure: false
|
|
127
127
|
});
|
|
128
128
|
return figures;
|
|
129
129
|
}
|
|
130
130
|
/** The quiet note at the bottom: capture completeness, then the report's limitations. */
|
|
131
|
-
function diagnosticNote(report) {
|
|
132
|
-
const parts = [report.captureCompleteness ?
|
|
131
|
+
function diagnosticNote(t, report) {
|
|
132
|
+
const parts = [report.captureCompleteness ? t("log.ui.captureCompleteness", "Capture completeness: {value}.", { value: words(report.captureCompleteness) }) : void 0, report.limitations].filter((part) => part !== void 0);
|
|
133
133
|
return parts.length > 0 ? parts.join(" ") : void 0;
|
|
134
134
|
}
|
|
135
135
|
/** The limitation sentence an empty report leads with, so an empty window never reads as a healthy run. */
|
|
136
|
-
function emptyLimitation(report) {
|
|
137
|
-
return report.limitations?.match(EMPTY_SENTENCE)?.[0].trim() ?? "Empty data is not proof of a healthy run.";
|
|
136
|
+
function emptyLimitation(t, report) {
|
|
137
|
+
return report.limitations?.match(EMPTY_SENTENCE)?.[0].trim() ?? t("log.ui.emptyDataIsNotProofOfAHealthyRun", "Empty data is not proof of a healthy run.");
|
|
138
138
|
}
|
|
139
139
|
//#endregion
|
|
140
140
|
//#region src/extensions/workspaces/sessions/(frontend)/tool/_components/AgentDiagnosticCard.native.tsx
|
|
141
|
-
const DEFAULT_SUMMARY = "Captured agent evidence";
|
|
141
|
+
const DEFAULT_SUMMARY = () => t("log.ui.capturedAgentEvidence", "Captured agent evidence");
|
|
142
142
|
/**
|
|
143
143
|
* The diagnose_agent tool's timeline item on native, as the web's: the report
|
|
144
144
|
* as a header summary and its key figures, with categories, tools and the
|
|
@@ -146,6 +146,7 @@ const DEFAULT_SUMMARY = "Captured agent evidence";
|
|
|
146
146
|
* failed read shows only its reason in red; the header carries the failure.
|
|
147
147
|
*/
|
|
148
148
|
function AgentDiagnosticCard({ toolName, output, running, isError }) {
|
|
149
|
+
const t = useT();
|
|
149
150
|
const tone = toolTone({
|
|
150
151
|
running,
|
|
151
152
|
isError
|
|
@@ -161,7 +162,7 @@ function AgentDiagnosticCard({ toolName, output, running, isError }) {
|
|
|
161
162
|
tone,
|
|
162
163
|
children: [/* @__PURE__ */ jsx(MessageItemHeader, {
|
|
163
164
|
title: toolName,
|
|
164
|
-
children: DEFAULT_SUMMARY
|
|
165
|
+
children: DEFAULT_SUMMARY()
|
|
165
166
|
}), lines.length > 0 ? /* @__PURE__ */ jsx(MessageItemBody, { children: /* @__PURE__ */ jsx(Text, {
|
|
166
167
|
selectable: true,
|
|
167
168
|
style: [styles$1.sans, styles$1.error],
|
|
@@ -175,32 +176,33 @@ function AgentDiagnosticCard({ toolName, output, running, isError }) {
|
|
|
175
176
|
const view = collapseLines(lines, 12, expanded);
|
|
176
177
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MessageItemHeader, {
|
|
177
178
|
title: toolName,
|
|
178
|
-
children: DEFAULT_SUMMARY
|
|
179
|
+
children: DEFAULT_SUMMARY()
|
|
179
180
|
}), view.shown.length > 0 || running ? /* @__PURE__ */ jsxs(MessageItemBody, { children: [
|
|
180
181
|
view.shown.map((line, index) => /* @__PURE__ */ jsx(Text, {
|
|
181
182
|
selectable: true,
|
|
182
183
|
style: [styles$1.sans, styles$1.text],
|
|
183
184
|
children: line
|
|
184
185
|
}, `${String(index)}-${line}`)),
|
|
185
|
-
view.hidden > 0 ? /* @__PURE__ */
|
|
186
|
+
view.hidden > 0 ? /* @__PURE__ */ jsx(MessageItemStatus, {
|
|
186
187
|
expands: true,
|
|
187
|
-
children:
|
|
188
|
+
children: t("log.ui.moreLines", "{count} more lines", { count: view.hidden })
|
|
188
189
|
}) : null,
|
|
189
190
|
running ? /* @__PURE__ */ jsx(MessageItemStatus, {
|
|
190
191
|
tone: "running",
|
|
191
|
-
children: "Reading session telemetry"
|
|
192
|
+
children: t("log.ui.readingSessionTelemetry", "Reading session telemetry")
|
|
192
193
|
}) : null
|
|
193
194
|
] }) : null] });
|
|
194
195
|
}
|
|
195
196
|
});
|
|
196
197
|
}
|
|
197
198
|
function ReportCard({ toolName, tone, report }) {
|
|
198
|
-
const
|
|
199
|
-
const
|
|
200
|
-
const
|
|
199
|
+
const t = useT();
|
|
200
|
+
const summary = diagnosticSummary(t, report);
|
|
201
|
+
const figures = diagnosticFigures(t, report);
|
|
202
|
+
const note = diagnosticNote(t, report);
|
|
201
203
|
const empty = report.evidence === "empty";
|
|
202
204
|
const unavailable = report.evidence === "unavailable";
|
|
203
|
-
const sentence = emptyLimitation(report);
|
|
205
|
+
const sentence = emptyLimitation(t, report);
|
|
204
206
|
const extraNote = empty && note === sentence ? void 0 : note;
|
|
205
207
|
const quiet = empty || unavailable;
|
|
206
208
|
const details = quiet ? extraNote !== void 0 : report.categories.length > 0 || report.tools.length > 0 || note !== void 0;
|
|
@@ -224,7 +226,7 @@ function ReportCard({ toolName, tone, report }) {
|
|
|
224
226
|
style: styles$1.wrapRow,
|
|
225
227
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
226
228
|
style: [styles$1.sans, styles$1.dim],
|
|
227
|
-
children: "The session's telemetry could not be read."
|
|
229
|
+
children: t("log.ui.theSessionSTelemetryCouldNotBeRead", "The session's telemetry could not be read.")
|
|
228
230
|
}), report.code ? /* @__PURE__ */ jsx(StatusBadge, {
|
|
229
231
|
size: "xs",
|
|
230
232
|
children: /* @__PURE__ */ jsx(Text, {
|
|
@@ -236,7 +238,7 @@ function ReportCard({ toolName, tone, report }) {
|
|
|
236
238
|
style: styles$1.block,
|
|
237
239
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
238
240
|
style: [styles$1.sans, styles$1.text],
|
|
239
|
-
children: "No records were captured in this window."
|
|
241
|
+
children: t("log.ui.noRecordsWereCapturedInThisWindow", "No records were captured in this window.")
|
|
240
242
|
}), /* @__PURE__ */ jsx(Text, {
|
|
241
243
|
style: [styles$1.small, styles$1.dim],
|
|
242
244
|
children: sentence
|
|
@@ -258,7 +260,7 @@ function ReportCard({ toolName, tone, report }) {
|
|
|
258
260
|
}) : null,
|
|
259
261
|
expanded && !quiet && report.categories.length > 0 ? /* @__PURE__ */ jsxs(View, {
|
|
260
262
|
style: styles$1.section,
|
|
261
|
-
children: [/* @__PURE__ */ jsx(SectionLabel, { children: "Issues by category" }), /* @__PURE__ */ jsx(View, {
|
|
263
|
+
children: [/* @__PURE__ */ jsx(SectionLabel, { children: t("log.ui.issuesByCategory", "Issues by category") }), /* @__PURE__ */ jsx(View, {
|
|
262
264
|
style: styles$1.wrapRow,
|
|
263
265
|
children: report.categories.map((category) => /* @__PURE__ */ jsxs(Badge, {
|
|
264
266
|
tone: category.failure ? "red" : "neutral",
|
|
@@ -276,7 +278,7 @@ function ReportCard({ toolName, tone, report }) {
|
|
|
276
278
|
expanded && !quiet && report.tools.length > 0 ? /* @__PURE__ */ jsxs(View, {
|
|
277
279
|
style: styles$1.section,
|
|
278
280
|
children: [
|
|
279
|
-
/* @__PURE__ */ jsx(SectionLabel, { children: "Tools" }),
|
|
281
|
+
/* @__PURE__ */ jsx(SectionLabel, { children: t("log.ui.tools", "Tools") }),
|
|
280
282
|
/* @__PURE__ */ jsxs(View, {
|
|
281
283
|
style: styles$1.toolRow,
|
|
282
284
|
children: [
|
|
@@ -286,7 +288,7 @@ function ReportCard({ toolName, tone, report }) {
|
|
|
286
288
|
styles$1.dim,
|
|
287
289
|
styles$1.toolName
|
|
288
290
|
],
|
|
289
|
-
children: "Name"
|
|
291
|
+
children: t("log.ui.name", "Name")
|
|
290
292
|
}),
|
|
291
293
|
/* @__PURE__ */ jsx(Text, {
|
|
292
294
|
style: [
|
|
@@ -294,7 +296,7 @@ function ReportCard({ toolName, tone, report }) {
|
|
|
294
296
|
styles$1.dim,
|
|
295
297
|
styles$1.toolCalls
|
|
296
298
|
],
|
|
297
|
-
children: "Calls"
|
|
299
|
+
children: t("log.ui.calls", "Calls")
|
|
298
300
|
}),
|
|
299
301
|
/* @__PURE__ */ jsx(Text, {
|
|
300
302
|
style: [
|
|
@@ -302,7 +304,7 @@ function ReportCard({ toolName, tone, report }) {
|
|
|
302
304
|
styles$1.dim,
|
|
303
305
|
styles$1.toolTokens
|
|
304
306
|
],
|
|
305
|
-
children: "p90 turn"
|
|
307
|
+
children: t("log.ui.p90Turn", "p90 turn")
|
|
306
308
|
})
|
|
307
309
|
]
|
|
308
310
|
}),
|
|
@@ -336,13 +338,9 @@ function ReportCard({ toolName, tone, report }) {
|
|
|
336
338
|
})
|
|
337
339
|
]
|
|
338
340
|
}, tool.name)) }),
|
|
339
|
-
report.limitReached ? /* @__PURE__ */
|
|
341
|
+
report.limitReached ? /* @__PURE__ */ jsx(Text, {
|
|
340
342
|
style: [styles$1.small, styles$1.dim],
|
|
341
|
-
children:
|
|
342
|
-
"Showing the first ",
|
|
343
|
-
report.tools.length,
|
|
344
|
-
" tools."
|
|
345
|
-
]
|
|
343
|
+
children: t("log.ui.firstTools", "Showing the first {count} tools.", { count: report.tools.length })
|
|
346
344
|
}) : null
|
|
347
345
|
]
|
|
348
346
|
}) : null,
|
|
@@ -518,7 +516,7 @@ function percent(value) {
|
|
|
518
516
|
function iso(value) {
|
|
519
517
|
return typeof value === "string" && /^\d{4}-\d{2}-\d{2}T/.test(value) && Number.isFinite(Date.parse(value));
|
|
520
518
|
}
|
|
521
|
-
function scopeLabel(value) {
|
|
519
|
+
function scopeLabel(t, value) {
|
|
522
520
|
const scope = record(value);
|
|
523
521
|
if (!scope || scope.kind !== "session" && scope.kind !== "history") return void 0;
|
|
524
522
|
if (scope.sessionId !== void 0 && typeof scope.sessionId !== "string") return void 0;
|
|
@@ -527,7 +525,7 @@ function scopeLabel(value) {
|
|
|
527
525
|
if (scope.kind === "history" && (!iso(scope.startTime) || !iso(scope.endTime))) return void 0;
|
|
528
526
|
if (iso(scope.startTime) && iso(scope.endTime) && Date.parse(scope.startTime) > Date.parse(scope.endTime)) return void 0;
|
|
529
527
|
return [
|
|
530
|
-
scope.kind === "session" ? "This session" : "History",
|
|
528
|
+
scope.kind === "session" ? t("log.ui.thisSession", "This session") : t("log.ui.history", "History"),
|
|
531
529
|
scope.startTime,
|
|
532
530
|
scope.endTime,
|
|
533
531
|
scope.kind === "history" ? scope.sessionId : void 0
|
|
@@ -538,7 +536,7 @@ function matchesLogsinkTool(toolName) {
|
|
|
538
536
|
return logsinkToolNames.some((name) => name === toolName);
|
|
539
537
|
}
|
|
540
538
|
/** No reader, telemetry runtime, or schema construction crosses into the browser. */
|
|
541
|
-
function logsinkCardSummary({ toolName, args, result, output, running, isError }) {
|
|
539
|
+
function logsinkCardSummary(t, { toolName, args, result, output, running, isError }) {
|
|
542
540
|
let value = result?.details;
|
|
543
541
|
if (value === void 0 || value === null) try {
|
|
544
542
|
value = JSON.parse(output);
|
|
@@ -546,13 +544,13 @@ function logsinkCardSummary({ toolName, args, result, output, running, isError }
|
|
|
546
544
|
value = void 0;
|
|
547
545
|
}
|
|
548
546
|
const report = record(value);
|
|
549
|
-
const effectiveScope = scopeLabel(report?.scope);
|
|
547
|
+
const effectiveScope = scopeLabel(t, report?.scope);
|
|
550
548
|
const requestedScope = args.scope === "history" ? [
|
|
551
|
-
"Requested history",
|
|
549
|
+
t("log.ui.requestedHistory", "Requested history"),
|
|
552
550
|
args.startTime,
|
|
553
551
|
args.endTime,
|
|
554
552
|
args.sessionId
|
|
555
|
-
].filter((part) => typeof part === "string").join(" · ") : "This session";
|
|
553
|
+
].filter((part) => typeof part === "string").join(" · ") : t("log.ui.thisSession", "This session");
|
|
556
554
|
const evidence = value === void 0 ? output : JSON.stringify(value, null, 2);
|
|
557
555
|
const base = {
|
|
558
556
|
scope: effectiveScope ?? requestedScope,
|
|
@@ -562,20 +560,20 @@ function logsinkCardSummary({ toolName, args, result, output, running, isError }
|
|
|
562
560
|
...base,
|
|
563
561
|
scope: requestedScope,
|
|
564
562
|
state: "running",
|
|
565
|
-
heading: "Reading captured agent evidence",
|
|
566
|
-
note: "Only retained records are inspected."
|
|
563
|
+
heading: t("log.ui.readingCapturedAgentEvidence", "Reading captured agent evidence"),
|
|
564
|
+
note: t("log.ui.onlyRetainedRecordsAreInspected", "Only retained records are inspected.")
|
|
567
565
|
};
|
|
568
566
|
if (isError) return {
|
|
569
567
|
...base,
|
|
570
568
|
state: "query-error",
|
|
571
|
-
heading: "Log query could not be completed.",
|
|
572
|
-
note: "No collector changes were made."
|
|
569
|
+
heading: t("log.ui.logQueryCouldNotBeCompleted", "Log query could not be completed."),
|
|
570
|
+
note: t("log.ui.noCollectorChangesWereMade", "No collector changes were made.")
|
|
573
571
|
};
|
|
574
572
|
const unavailable = {
|
|
575
573
|
...base,
|
|
576
574
|
state: "unavailable",
|
|
577
|
-
heading: "Log summary is unavailable.",
|
|
578
|
-
note: "Inspect the retained evidence for details."
|
|
575
|
+
heading: t("log.ui.logSummaryIsUnavailable", "Log summary is unavailable."),
|
|
576
|
+
note: t("log.ui.inspectTheRetainedEvidenceForDetails", "Inspect the retained evidence for details.")
|
|
579
577
|
};
|
|
580
578
|
const data = record(report?.data);
|
|
581
579
|
if (!effectiveScope || !data) return unavailable;
|
|
@@ -587,29 +585,32 @@ function logsinkCardSummary({ toolName, args, result, output, running, isError }
|
|
|
587
585
|
const empty = {
|
|
588
586
|
...base,
|
|
589
587
|
state: "empty",
|
|
590
|
-
heading: "No captured records in this window.",
|
|
591
|
-
note: "This does not establish that the run was healthy."
|
|
588
|
+
heading: t("log.ui.noCapturedRecordsInThisWindow", "No captured records in this window."),
|
|
589
|
+
note: t("log.ui.thisDoesNotEstablishThatTheRunWasHealthy", "This does not establish that the run was healthy.")
|
|
592
590
|
};
|
|
593
591
|
switch (toolName) {
|
|
594
592
|
case "logsink_status":
|
|
595
593
|
if (data.available === false && data.reason === "missing-database") return {
|
|
596
594
|
...base,
|
|
597
595
|
state: "missing",
|
|
598
|
-
heading: "No retained log database is available.",
|
|
599
|
-
note: "No collector changes were made."
|
|
596
|
+
heading: t("log.ui.noRetainedLogDatabaseIsAvailable", "No retained log database is available."),
|
|
597
|
+
note: t("log.ui.noCollectorChangesWereMade", "No collector changes were made.")
|
|
600
598
|
};
|
|
601
599
|
return data.available === true ? {
|
|
602
600
|
...populated,
|
|
603
|
-
heading: "Retained log database is available.",
|
|
604
|
-
note: "This does not establish that the collector is capturing now."
|
|
601
|
+
heading: t("log.ui.retainedLogDatabaseIsAvailable", "Retained log database is available."),
|
|
602
|
+
note: t("log.ui.thisDoesNotEstablishThatTheCollectorIsCapturingNow", "This does not establish that the collector is capturing now.")
|
|
605
603
|
} : unavailable;
|
|
606
604
|
case "logsink_search":
|
|
607
605
|
if (!count(data.count) || !count(data.total) || typeof data.truncated !== "boolean" || !Array.isArray(data.results)) return unavailable;
|
|
608
606
|
return {
|
|
609
607
|
...data.total === 0 ? empty : populated,
|
|
610
|
-
heading: data.total === 0 ? empty.heading : "Captured log records",
|
|
611
|
-
summary:
|
|
612
|
-
|
|
608
|
+
heading: data.total === 0 ? empty.heading : t("log.ui.capturedLogRecords", "Captured log records"),
|
|
609
|
+
summary: t("log.ui.returnedRecords", "{returned} returned · {total} records", {
|
|
610
|
+
returned: data.count,
|
|
611
|
+
total: data.total
|
|
612
|
+
}),
|
|
613
|
+
note: data.truncated ? t("log.ui.resultsAreTruncated", "Results are truncated.") : data.total === 0 ? empty.note : void 0
|
|
613
614
|
};
|
|
614
615
|
case "logsink_agent_issues": {
|
|
615
616
|
if (!count(data.matchingLogs) || !count(data.uniqueIncidents) || !count(data.scanned) || !percent(data.coveragePercent) || typeof data.truncated !== "boolean" || !Array.isArray(data.issues)) return unavailable;
|
|
@@ -617,23 +618,30 @@ function logsinkCardSummary({ toolName, args, result, output, running, isError }
|
|
|
617
618
|
if (!byTool || !Object.values(byTool).every(count)) return unavailable;
|
|
618
619
|
return {
|
|
619
620
|
...data.matchingLogs === 0 ? empty : populated,
|
|
620
|
-
heading: data.matchingLogs === 0 ? "No captured agent issues in this window." : "Captured agent issues",
|
|
621
|
-
summary:
|
|
622
|
-
|
|
621
|
+
heading: data.matchingLogs === 0 ? t("log.ui.noCapturedAgentIssuesInThisWindow", "No captured agent issues in this window.") : t("log.ui.capturedAgentIssues", "Captured agent issues"),
|
|
622
|
+
summary: t("log.ui.recordIncidents", "{records} records · {incidents} incidents", {
|
|
623
|
+
records: data.matchingLogs,
|
|
624
|
+
incidents: data.uniqueIncidents
|
|
625
|
+
}),
|
|
626
|
+
coverage: t("log.ui.scanCoverage", "Coverage {percent}% · {count} scanned{notice}", {
|
|
627
|
+
percent: data.coveragePercent,
|
|
628
|
+
count: data.scanned,
|
|
629
|
+
notice: data.truncated ? t("log.ui.scanTruncated", " · Scan truncated") : ""
|
|
630
|
+
}),
|
|
623
631
|
tools: Object.entries(byTool).map(([name, n]) => ({
|
|
624
632
|
name,
|
|
625
633
|
count: n
|
|
626
634
|
})),
|
|
627
|
-
note: data.matchingLogs === 0 ? empty.note : "Repeated events may describe one incident."
|
|
635
|
+
note: data.matchingLogs === 0 ? empty.note : t("log.ui.repeatedEventsMayDescribeOneIncident", "Repeated events may describe one incident.")
|
|
628
636
|
};
|
|
629
637
|
}
|
|
630
638
|
case "logsink_trace":
|
|
631
639
|
if (!count(data.count) || typeof data.truncated !== "boolean" || !Array.isArray(data.timeline)) return unavailable;
|
|
632
640
|
return {
|
|
633
641
|
...data.count === 0 ? empty : populated,
|
|
634
|
-
heading: data.count === 0 ? empty.heading : "Captured trace timeline",
|
|
635
|
-
summary:
|
|
636
|
-
note: data.truncated ? "Timeline is truncated." : data.count === 0 ? empty.note : void 0
|
|
642
|
+
heading: data.count === 0 ? empty.heading : t("log.ui.capturedTraceTimeline", "Captured trace timeline"),
|
|
643
|
+
summary: t("log.ui.entryCount", "{count} entries", { count: data.count }),
|
|
644
|
+
note: data.truncated ? t("log.ui.timelineIsTruncated", "Timeline is truncated.") : data.count === 0 ? empty.note : void 0
|
|
637
645
|
};
|
|
638
646
|
case "logsink_stats":
|
|
639
647
|
if (!count(data.totalEntries) || !Array.isArray(data.statistics) || !data.statistics.every((row) => {
|
|
@@ -642,8 +650,14 @@ function logsinkCardSummary({ toolName, args, result, output, running, isError }
|
|
|
642
650
|
})) return unavailable;
|
|
643
651
|
return {
|
|
644
652
|
...data.totalEntries === 0 ? empty : populated,
|
|
645
|
-
heading: data.totalEntries === 0 ? empty.heading : "Retained entry statistics",
|
|
646
|
-
summary:
|
|
653
|
+
heading: data.totalEntries === 0 ? empty.heading : t("log.ui.retainedEntryStatistics", "Retained entry statistics"),
|
|
654
|
+
summary: data.statistics.length === 1 ? t("log.ui.entryGroupsOne", "{entries} entries · {groups} group", {
|
|
655
|
+
entries: data.totalEntries,
|
|
656
|
+
groups: data.statistics.length
|
|
657
|
+
}) : t("log.ui.entryGroups", "{entries} entries · {groups} groups", {
|
|
658
|
+
entries: data.totalEntries,
|
|
659
|
+
groups: data.statistics.length
|
|
660
|
+
}),
|
|
647
661
|
tools: data.statistics.map((row) => {
|
|
648
662
|
const group = row;
|
|
649
663
|
return {
|
|
@@ -656,19 +670,23 @@ function logsinkCardSummary({ toolName, args, result, output, running, isError }
|
|
|
656
670
|
if (!count(data.count) || typeof data.truncated !== "boolean" || !Array.isArray(data.services) || !data.services.every((service) => typeof service === "string")) return unavailable;
|
|
657
671
|
return {
|
|
658
672
|
...data.count === 0 ? empty : populated,
|
|
659
|
-
heading: data.count === 0 ? empty.heading : "Services with retained records",
|
|
660
|
-
summary:
|
|
661
|
-
note: data.truncated ? "Service list is truncated." : data.count === 0 ? empty.note : void 0
|
|
673
|
+
heading: data.count === 0 ? empty.heading : t("log.ui.servicesWithRetainedRecords", "Services with retained records"),
|
|
674
|
+
summary: data.count === 1 ? t("log.ui.serviceCountOne", "{count} service", { count: data.count }) : t("log.ui.serviceCount", "{count} services", { count: data.count }),
|
|
675
|
+
note: data.truncated ? t("log.ui.serviceListIsTruncated", "Service list is truncated.") : data.count === 0 ? empty.note : void 0
|
|
662
676
|
};
|
|
663
677
|
case "logsink_metrics": {
|
|
664
678
|
const totals = record(data.totals);
|
|
665
679
|
if (!totals || !count(totals.totalRecords) || !count(totals.totalTokens) || !count(totals.issueCount) || !percent(totals.tokenCoveragePercent)) return unavailable;
|
|
666
680
|
return {
|
|
667
681
|
...totals.totalRecords === 0 ? empty : populated,
|
|
668
|
-
heading: totals.totalRecords === 0 ? empty.heading : "Captured usage and issues",
|
|
669
|
-
summary:
|
|
670
|
-
|
|
671
|
-
|
|
682
|
+
heading: totals.totalRecords === 0 ? empty.heading : t("log.ui.capturedUsageAndIssues", "Captured usage and issues"),
|
|
683
|
+
summary: t("log.ui.usageSummary", "{records} records · {tokens} tokens · {issues} issues", {
|
|
684
|
+
records: totals.totalRecords,
|
|
685
|
+
tokens: totals.totalTokens,
|
|
686
|
+
issues: totals.issueCount
|
|
687
|
+
}),
|
|
688
|
+
coverage: t("log.ui.tokenCoveragePercent", "Token coverage {percent}%", { percent: totals.tokenCoveragePercent }),
|
|
689
|
+
note: t("log.ui.toolCostNotice", "{notice}Tool turn costs are not exclusive per-tool token shares.", { notice: totals.totalRecords === 0 ? `${empty.note} ` : "" })
|
|
672
690
|
};
|
|
673
691
|
}
|
|
674
692
|
default: return unavailable;
|
|
@@ -681,8 +699,9 @@ function logsinkCardSummary({ toolName, args, result, output, running, isError }
|
|
|
681
699
|
* same summary (heading, counts, coverage, per-tool counts) and the evidence on expand.
|
|
682
700
|
*/
|
|
683
701
|
function LogsinkToolCard(props) {
|
|
702
|
+
const t = useT();
|
|
684
703
|
const { toolName, running, isError } = props;
|
|
685
|
-
const fixture = logsinkCardSummary(props);
|
|
704
|
+
const fixture = logsinkCardSummary(t, props);
|
|
686
705
|
const missing = fixture.state === "missing";
|
|
687
706
|
const neutral = missing || fixture.state === "unavailable";
|
|
688
707
|
return /* @__PURE__ */ jsx(MessageItem, {
|
|
@@ -694,7 +713,7 @@ function LogsinkToolCard(props) {
|
|
|
694
713
|
defaultExpanded: false,
|
|
695
714
|
children: ({ expanded }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MessageItemHeader, {
|
|
696
715
|
title: toolName,
|
|
697
|
-
badge: isError ? "Query failed" : missing ? "No data" : void 0,
|
|
716
|
+
badge: isError ? t("log.ui.queryFailed", "Query failed") : missing ? t("log.ui.noData", "No data") : void 0,
|
|
698
717
|
children: /* @__PURE__ */ jsx(Text, {
|
|
699
718
|
numberOfLines: 1,
|
|
700
719
|
style: [
|
|
@@ -731,13 +750,9 @@ function LogsinkToolCard(props) {
|
|
|
731
750
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
732
751
|
style: styles.mono,
|
|
733
752
|
children: tool.name
|
|
734
|
-
}), /* @__PURE__ */
|
|
753
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
735
754
|
style: styles.dim,
|
|
736
|
-
children:
|
|
737
|
-
" ",
|
|
738
|
-
tool.count,
|
|
739
|
-
" occurrences"
|
|
740
|
-
]
|
|
755
|
+
children: t("log.ui.occurrences", "{count} occurrences", { count: tool.count })
|
|
741
756
|
})]
|
|
742
757
|
}, tool.name))
|
|
743
758
|
}) : null,
|
|
@@ -747,14 +762,14 @@ function LogsinkToolCard(props) {
|
|
|
747
762
|
}) : null,
|
|
748
763
|
running ? /* @__PURE__ */ jsx(MessageItemStatus, {
|
|
749
764
|
tone: "running",
|
|
750
|
-
children: "Reading telemetry"
|
|
765
|
+
children: t("log.ui.readingTelemetry", "Reading telemetry")
|
|
751
766
|
}) : null,
|
|
752
767
|
fixture.evidence ? /* @__PURE__ */ jsxs(View, {
|
|
753
768
|
style: [styles.block, styles.divided],
|
|
754
769
|
children: [/* @__PURE__ */ jsx(MessageItemStatus, {
|
|
755
770
|
expands: true,
|
|
756
771
|
glyph: expanded ? "⌄" : "›",
|
|
757
|
-
children: expanded ? "Hide evidence" : "Show evidence"
|
|
772
|
+
children: expanded ? t("log.ui.hideEvidence", "Hide evidence") : t("log.ui.showEvidence", "Show evidence")
|
|
758
773
|
}), expanded ? /* @__PURE__ */ jsx(CodeBlock, {
|
|
759
774
|
text: fixture.evidence,
|
|
760
775
|
language: "json"
|