@parhelia/alpaca 0.4.12818 → 0.4.12871
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/GraphQL.js +1 -1
- package/dist/GraphiQLPanel.js +1 -1
- package/dist/componentCommands.js +2 -2
- package/dist/tracing/components/CaptureCompleteness.js +1 -1
- package/dist/tracing/components/LogsTab.js +1 -1
- package/dist/tracing/components/TraceSourcesSidebar.d.ts.map +1 -1
- package/dist/tracing/components/TraceSourcesSidebar.js +4 -2
- package/dist/tracing/components/TracingTitlebar.js +1 -1
- package/package.json +1 -1
package/dist/GraphQL.js
CHANGED
|
@@ -184,7 +184,7 @@ export function GraphQL() {
|
|
|
184
184
|
setQuery(newQuery);
|
|
185
185
|
setAiGeneratedQuery(newQuery);
|
|
186
186
|
};
|
|
187
|
-
return (_jsxs("div", { className: "relative flex h-full min-h-0 flex-col overflow-hidden text-xs", children: [aiGeneratedQuery && aiGeneratedQuery !== query && (_jsxs("div", { className: "shrink-0 flex items-center gap-2 border-b border-feedback-orange bg-feedback-orange-light p-2 text-xs", children: [_jsx("span", { className: "text-feedback-orange", children: "AI generated a new query" }), _jsx(ActionButton, { onClick: () => applyQueryToEditor(aiGeneratedQuery), className: "p-1 text-xs", variant: "outline", children: "Apply" }), _jsx(ActionButton, { onClick: () => setAiGeneratedQuery(""), className: "p-1", variant: "ghost", children: "x" })] })), _jsx(GraphiQLPanel, { item: currentItem, itemLabel: baseItemLabel, query: query, variables: graphiqlVariables, onQueryChange: setQuery, onVariablesChange: setGraphiqlVariables, onExecutionResult: () => { }, headerActions: _jsx(TooltipProvider, { delayDuration: 300, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs(ActionButton, { variant: "outline", className: "h-8 w-8 rounded-full p-0", onClick: () => {
|
|
187
|
+
return (_jsxs("div", { className: "relative flex h-full min-h-0 flex-col overflow-hidden text-xs", children: [aiGeneratedQuery && aiGeneratedQuery !== query && (_jsxs("div", { className: "shrink-0 flex items-center gap-2 border-b border-feedback-orange/30 bg-feedback-orange-light p-2 text-xs", children: [_jsx("span", { className: "text-feedback-orange", children: "AI generated a new query" }), _jsx(ActionButton, { onClick: () => applyQueryToEditor(aiGeneratedQuery), className: "p-1 text-xs", variant: "outline", children: "Apply" }), _jsx(ActionButton, { onClick: () => setAiGeneratedQuery(""), className: "p-1", variant: "ghost", children: "x" })] })), _jsx(GraphiQLPanel, { item: currentItem, itemLabel: baseItemLabel, query: query, variables: graphiqlVariables, onQueryChange: setQuery, onVariablesChange: setGraphiqlVariables, onExecutionResult: () => { }, headerActions: _jsx(TooltipProvider, { delayDuration: 300, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs(ActionButton, { variant: "outline", className: "h-8 w-8 rounded-full p-0", onClick: () => {
|
|
188
188
|
editContext?.executeCommand?.({
|
|
189
189
|
command: createAgentCommand,
|
|
190
190
|
data: {
|
package/dist/GraphiQLPanel.js
CHANGED
|
@@ -203,5 +203,5 @@ export function GraphiQLPanel({ item, query, variables, onQueryChange, onVariabl
|
|
|
203
203
|
.alpaca-graphiql-shell .graphiql-logo {
|
|
204
204
|
display: none;
|
|
205
205
|
}
|
|
206
|
-
` }), _jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-border-default bg-neutral-grey-5 px-3 py-2 text-xs text-neutral-grey-50", children: [_jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [_jsxs("span", { children: ["Base item: ", _jsx("span", { className: "font-mono", children: itemLabel || item.id })] }), _jsxs("span", { children: [item.language, " v", item.version] })] }), headerActions && (_jsx("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: headerActions }))] }), !!lastTransportMessage && (_jsx("div", { className: "border-b border-feedback-orange bg-feedback-orange-light px-3 py-2 text-xs text-feedback-orange", children: lastTransportMessage })), schemaResult.error && (_jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-feedback-red bg-feedback-red-light px-3 py-2 text-xs text-feedback-red", children: [_jsx("span", { children: schemaResult.error }), _jsxs(ActionButton, { className: "shrink-0", disabled: isRefreshingSchema, isLoading: isRefreshingSchema, loadingText: "Retrying", onClick: handleRefreshSchema, variant: "outline", children: [_jsx(RefreshCw, { strokeWidth: 1, className: "h-3.5 w-3.5" }), _jsx("span", { children: "Retry" })] })] })), _jsx("div", { className: "alpaca-graphiql-shell min-h-0 flex-1 bg-white [&_.graphiql-container]:h-full", children: _jsx(GraphiQLIDE, { className: "h-full", fetcher: fetcher, schema: graphiqlSchema, forcedTheme: "light", initialQuery: query, initialVariables: variables, initialHeaders: "", onEditQuery: onQueryChange, onEditVariables: onVariablesChange, onEditHeaders: handleEditHeaders, isHeadersEditorEnabled: false, defaultEditorToolsVisibility: "variables", plugins: plugins, children: _jsx(GraphiQLSyncBridge, { query: query, variables: variables }) }) })] }));
|
|
206
|
+
` }), _jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-border-default bg-neutral-grey-5 px-3 py-2 text-xs text-neutral-grey-50", children: [_jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [_jsxs("span", { children: ["Base item: ", _jsx("span", { className: "font-mono", children: itemLabel || item.id })] }), _jsxs("span", { children: [item.language, " v", item.version] })] }), headerActions && (_jsx("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: headerActions }))] }), !!lastTransportMessage && (_jsx("div", { className: "border-b border-feedback-orange/30 bg-feedback-orange-light px-3 py-2 text-xs text-feedback-orange", children: lastTransportMessage })), schemaResult.error && (_jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-feedback-red bg-feedback-red-light px-3 py-2 text-xs text-feedback-red", children: [_jsx("span", { children: schemaResult.error }), _jsxs(ActionButton, { className: "shrink-0", disabled: isRefreshingSchema, isLoading: isRefreshingSchema, loadingText: "Retrying", onClick: handleRefreshSchema, variant: "outline", children: [_jsx(RefreshCw, { strokeWidth: 1, className: "h-3.5 w-3.5" }), _jsx("span", { children: "Retry" })] })] })), _jsx("div", { className: "alpaca-graphiql-shell min-h-0 flex-1 bg-white [&_.graphiql-container]:h-full", children: _jsx(GraphiQLIDE, { className: "h-full", fetcher: fetcher, schema: graphiqlSchema, forcedTheme: "light", initialQuery: query, initialVariables: variables, initialHeaders: "", onEditQuery: onQueryChange, onEditVariables: onVariablesChange, onEditHeaders: handleEditHeaders, isHeadersEditorEnabled: false, defaultEditorToolsVisibility: "variables", plugins: plugins, children: _jsx(GraphiQLSyncBridge, { query: query, variables: variables }) }) })] }));
|
|
207
207
|
}
|
|
@@ -19,7 +19,7 @@ async function getLinkToMasterCommand(components, editContext) {
|
|
|
19
19
|
if (components.some((c) => c.layoutId && !editContext.showLayoutComponents)) {
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
22
|
-
return getCheckboxCommand(components, editContext, "componentLinkedToMasterLanguage", "Linked
|
|
22
|
+
return getCheckboxCommand(components, editContext, "componentLinkedToMasterLanguage", "Linked to master language");
|
|
23
23
|
}
|
|
24
24
|
async function getInheritChildrenFromMasterCommand(components, editContext) {
|
|
25
25
|
if (!components.length)
|
|
@@ -32,7 +32,7 @@ async function getInheritChildrenFromMasterCommand(components, editContext) {
|
|
|
32
32
|
if (components.some((c) => c.layoutId && !editContext.showLayoutComponents)) {
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
|
-
return getCheckboxCommand(components, editContext, "inheritChildrenFromMasterLanguage", "Inherit
|
|
35
|
+
return getCheckboxCommand(components, editContext, "inheritChildrenFromMasterLanguage", "Inherit children from master");
|
|
36
36
|
}
|
|
37
37
|
async function getCheckboxCommand(components, editContext, fieldName, label) {
|
|
38
38
|
const datasourceItems = components
|
|
@@ -22,5 +22,5 @@ export function CaptureCompleteness({ source, story }) {
|
|
|
22
22
|
].filter(Boolean);
|
|
23
23
|
if (!notes.length)
|
|
24
24
|
return null;
|
|
25
|
-
return _jsx("div", { className: "border-b border-
|
|
25
|
+
return _jsx("div", { className: "border-b border-feedback-orange/30 bg-feedback-orange-light px-4 py-2 text-xs text-feedback-orange", role: "status", children: notes.join(" · ") });
|
|
26
26
|
}
|
|
@@ -98,7 +98,7 @@ export function LogsTab({ sessionId, story, jumpMs, onJumpConsumed, }) {
|
|
|
98
98
|
.join("\n");
|
|
99
99
|
return (_jsxs("div", { className: "flex h-full min-h-0 flex-col", "data-testid": "alpaca-trace-logs", "data-mode": sessionMode ? "session" : "story", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2 border-b border-border-default px-3 py-2", children: [_jsx("div", { className: "flex items-center gap-1", "data-testid": "alpaca-trace-level-chips", children: LOG_LEVELS.map((level) => (_jsx("button", { type: "button", onClick: () => toggleLevel(level), className: cls("rounded border px-1.5 py-0.5 text-2xs uppercase tracking-wide", levels.includes(level)
|
|
100
100
|
? "border-highlight-100 bg-highlight-10 text-neutral-grey-100"
|
|
101
|
-
: "border-border-default text-neutral-grey-50 hover:bg-neutral-grey-5"), "data-testid": `alpaca-trace-level-${level}`, children: level }, level))) }), _jsx(Select, { size: "xs", options: scopeOptions, value: scopePrefix, onValueChange: setScopePrefix, maxWidth: 260, searchable: true, "data-testid": "alpaca-trace-scope-select" }), _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search messages", size: "sm", className: "min-w-[140px] flex-1", testId: "alpaca-trace-logs-search" }), _jsx(Button, { variant: "outline", size: "xs", onClick: () => setRelative((v) => !v), "data-testid": "alpaca-trace-time-mode", children: relative ? "+relative" : "absolute" }), _jsx(CopyButton, { textToCopy: copyAll, iconOnly: true })] }), page?.evicted && (_jsxs("div", { className: "border-b border-feedback-orange/
|
|
101
|
+
: "border-border-default text-neutral-grey-50 hover:bg-neutral-grey-5"), "data-testid": `alpaca-trace-level-${level}`, children: level }, level))) }), _jsx(Select, { size: "xs", options: scopeOptions, value: scopePrefix, onValueChange: setScopePrefix, maxWidth: 260, searchable: true, "data-testid": "alpaca-trace-scope-select" }), _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search messages", size: "sm", className: "min-w-[140px] flex-1", testId: "alpaca-trace-logs-search" }), _jsx(Button, { variant: "outline", size: "xs", onClick: () => setRelative((v) => !v), "data-testid": "alpaca-trace-time-mode", children: relative ? "+relative" : "absolute" }), _jsx(CopyButton, { textToCopy: copyAll, iconOnly: true })] }), page?.evicted && (_jsxs("div", { className: "border-b border-feedback-orange/30 bg-feedback-orange-light px-3 py-1 text-2xs text-feedback-orange", "data-testid": "alpaca-trace-evicted", children: [page.evictedCount, " entries were lost to the rolling buffer. Persist sessions you want to keep."] })), _jsx(InlineError, { message: error }), _jsx("div", { className: "min-h-0 flex-1 overflow-auto", children: entries.length === 0 ? (_jsx(EmptyHint, { title: loading ? "Loading…" : "No log entries", children: !loading && (levels.length < LOG_LEVELS.length || scopePrefix || debouncedSearch
|
|
102
102
|
? "Nothing matches the current filters."
|
|
103
103
|
: story && !story.available.logs
|
|
104
104
|
? "Logs were not persisted for this story."
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TraceSourcesSidebar.d.ts","sourceRoot":"","sources":["../../../src/tracing/components/TraceSourcesSidebar.tsx"],"names":[],"mappings":"AASA,wBAAgB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"TraceSourcesSidebar.d.ts","sourceRoot":"","sources":["../../../src/tracing/components/TraceSourcesSidebar.tsx"],"names":[],"mappings":"AASA,wBAAgB,mBAAmB,gCAmElC"}
|
|
@@ -27,7 +27,9 @@ export function TraceSourcesSidebar() {
|
|
|
27
27
|
.filter((s) => s.kind === "restored")
|
|
28
28
|
.sort((a, b) => (b.lastActivity ?? "").localeCompare(a.lastActivity ?? ""));
|
|
29
29
|
const hasGlobal = sessions.some((s) => s.kind === "global");
|
|
30
|
-
return (_jsxs("div", { className: "flex h-full min-h-0 flex-col overflow-auto text-xs", "data-testid": "alpaca-trace-sources", children: [hasInstanceChoice(state) && _jsx(Group, { title: "Instance", hint: "Sources and stories are read from this Sitecore instance", children: _jsx(InstanceSwitcher, { className: "px-3 pb-1" }) }), !status && (_jsx("div", { className: "p-3 text-neutral-grey-50", children: state.statusError ? "Status unavailable." : "Loading sources…" })), status && (_jsxs(_Fragment, { children: [_jsxs(Group, { title: "Sessions", children: [!hasGlobal && (_jsxs("div", { className: "flex items-center gap-2 px-3 py-1.5 text-neutral-grey-50", children: [_jsx(KindIcon, { kind: "global", className: "text-neutral-grey-15" }), _jsx("span", { className: "flex-1", children: "Global" }), _jsx("span", { className: "text-2xs", children: "off" })] })), sessions.map((source) => (_jsx(SourceRow, { source: source }, source.id))), sessions.length === 0 && hasGlobal === false && (_jsx("div", { className: "px-3 py-1.5 text-2xs text-neutral-grey-50", children:
|
|
30
|
+
return (_jsxs("div", { className: "flex h-full min-h-0 flex-col overflow-auto text-xs", "data-testid": "alpaca-trace-sources", children: [hasInstanceChoice(state) && _jsx(Group, { title: "Instance", hint: "Sources and stories are read from this Sitecore instance", children: _jsx(InstanceSwitcher, { className: "px-3 pb-1" }) }), !status && (_jsx("div", { className: "p-3 text-neutral-grey-50", children: state.statusError ? "Status unavailable." : "Loading sources…" })), status && (_jsxs(_Fragment, { children: [_jsxs(Group, { title: "Sessions", children: [!hasGlobal && (_jsxs("div", { className: "flex items-center gap-2 px-3 py-1.5 text-neutral-grey-50", children: [_jsx(KindIcon, { kind: "global", className: "text-neutral-grey-15" }), _jsx("span", { className: "flex-1", children: "Global" }), _jsx("span", { className: "text-2xs", children: "off" })] })), sessions.map((source) => (_jsx(SourceRow, { source: source }, source.id))), sessions.length === 0 && hasGlobal === false && (_jsx("div", { className: "px-3 py-1.5 text-2xs text-neutral-grey-50", children: state.selectedInstance === "local"
|
|
31
|
+
? "No recording session yet. Use “This browser” in the toolbar to record your own requests."
|
|
32
|
+
: "No recording session yet. Use “Global” in the toolbar to record this instance." }))] }), _jsxs(Group, { title: "Streams", hint: "Background groups: startup, insert options, publishing, scheduled jobs", children: [streams.length === 0 && _jsx("div", { className: "px-3 py-1.5 text-2xs text-neutral-grey-50", children: "No streams yet." }), streams.map((source) => (_jsx(SourceRow, { source: source }, source.id)))] }), restored.length > 0 && (_jsx(Group, { title: "Restored", hint: "Loaded from trace storage; read-only", children: restored.map((source) => (_jsx(SourceRow, { source: source }, source.id))) }))] }))] }));
|
|
31
33
|
}
|
|
32
34
|
function Group({ title, hint, children }) {
|
|
33
35
|
return (_jsxs("div", { className: "border-b border-border-default py-1 last:border-b-0", children: [_jsx("div", { className: "flex items-baseline justify-between px-3 pt-2 pb-1", title: hint, children: _jsx("span", { className: "text-2xs font-medium uppercase tracking-wide text-neutral-grey-50", children: title }) }), children] }));
|
|
@@ -49,7 +51,7 @@ function SourceRow({ source }) {
|
|
|
49
51
|
caps,
|
|
50
52
|
]
|
|
51
53
|
.filter(Boolean)
|
|
52
|
-
.join("\n"), children: [_jsxs("span", { className: "relative shrink-0", children: [_jsx(KindIcon, { kind: source.kind, className: selected ? "text-highlight-100" : "text-neutral-grey-50" }), recording && (_jsx("span", { className: "absolute -right-0.5 -bottom-0.5 h-2 w-2 animate-pulse rounded-full bg-feedback-green ring-2 ring-background" }))] }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate", children: source.name }), _jsxs("span", { className: "block truncate text-2xs text-neutral-grey-50", children: [source.storyCount, " ", source.storyCount === 1 ? "story" : "stories", source.lastActivity ? ` · ${formatRelativeTime(source.lastActivity)}` : "", caps ? ` · ${caps}` : ""] })] }), _jsx(ProblemCounts, { errorCount: source.errorCount, warnCount: source.warnCount, onErrorClick: () => traceActions.focusProblems("error", { sourceId: source.id }), onWarnClick: () => traceActions.focusProblems("warn", { sourceId: source.id }) }), _jsx("span", { onClick: (event) => event.stopPropagation(), children: _jsxs(Menu, { align: "end", trigger: _jsx("button", { type: "button", className: "rounded p-0.5 text-neutral-grey-50 opacity-0 group-hover:opacity-100 hover:bg-neutral-grey-10 data-[state=open]:opacity-100", "aria-label": "Source actions", "data-testid": "alpaca-trace-source-menu", children: _jsx(MoreHorizontal, { className: "h-4 w-4", strokeWidth: 1.5 }) }), children: [source.isRecordable && source.kind === "personal" && !attached && (_jsx(MenuItem, { onClick: () => void traceActions.attach(source.id), children: "Attach this browser" })), attached && _jsx(MenuItem, { onClick: () => void traceActions.detach(), children: "Detach this browser" }), source.kind !== "restored" && source.kind !== "capture" && (_jsx(MenuItem, { onClick: () => traceActions.openCaptureFilter(source.id), testId: "alpaca-trace-source-capture-filter", children: "Capture filter\u2026" })), _jsx(MenuItem, { onClick: () => confirm?.({
|
|
54
|
+
.join("\n"), children: [_jsxs("span", { className: "relative shrink-0", children: [_jsx(KindIcon, { kind: source.kind, className: selected ? "text-highlight-100" : "text-neutral-grey-50" }), recording && (_jsx("span", { className: "absolute -right-0.5 -bottom-0.5 h-2 w-2 animate-pulse rounded-full bg-feedback-green ring-2 ring-background" }))] }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate", children: source.name }), _jsxs("span", { className: "block truncate text-2xs text-neutral-grey-50", children: [source.storyCount, " ", source.storyCount === 1 ? "story" : "stories", source.lastActivity ? ` · ${formatRelativeTime(source.lastActivity)}` : "", caps ? ` · ${caps}` : ""] })] }), _jsx(ProblemCounts, { errorCount: source.errorCount, warnCount: source.warnCount, onErrorClick: () => traceActions.focusProblems("error", { sourceId: source.id }), onWarnClick: () => traceActions.focusProblems("warn", { sourceId: source.id }) }), _jsx("span", { onClick: (event) => event.stopPropagation(), children: _jsxs(Menu, { align: "end", trigger: _jsx("button", { type: "button", className: "rounded p-0.5 text-neutral-grey-50 opacity-0 group-hover:opacity-100 hover:bg-neutral-grey-10 data-[state=open]:opacity-100", "aria-label": "Source actions", "data-testid": "alpaca-trace-source-menu", children: _jsx(MoreHorizontal, { className: "h-4 w-4", strokeWidth: 1.5 }) }), children: [state.selectedInstance === "local" && source.isRecordable && source.kind === "personal" && !attached && (_jsx(MenuItem, { onClick: () => void traceActions.attach(source.id), children: "Attach this browser" })), attached && _jsx(MenuItem, { onClick: () => void traceActions.detach(), children: "Detach this browser" }), source.kind !== "restored" && source.kind !== "capture" && (_jsx(MenuItem, { onClick: () => traceActions.openCaptureFilter(source.id), testId: "alpaca-trace-source-capture-filter", children: "Capture filter\u2026" })), _jsx(MenuItem, { onClick: () => confirm?.({
|
|
53
55
|
header: "Reset source",
|
|
54
56
|
message: `Drop all stories of “${source.name}”?`,
|
|
55
57
|
acceptLabel: "Reset",
|
|
@@ -34,7 +34,7 @@ export function TracingTitlebar() {
|
|
|
34
34
|
accept: () => {
|
|
35
35
|
void traceActions.deleteSession(attachment.sessionId, false);
|
|
36
36
|
},
|
|
37
|
-
}), testId: "alpaca-tracing-detach-delete", children: "Detach and delete session\u2026" })] })) : (_jsxs(MenuItem, { onClick: () => void traceActions.recordMySession(), testId: "alpaca-tracing-record-my-session", children: ["Record my session", _jsx("span", { className: "block text-2xs text-neutral-grey-50", children: "Traces every request this browser makes to this instance." })] })) }) }), _jsx(Menu, { testId: "alpaca-tracing-global-menu", trigger: _jsx(Indicator, { icon: _jsx(Globe, { className: "h-3.5 w-3.5", strokeWidth: 1.5 }), on: !!status?.globalEnabled, onTone: "warning", label: "Global", value: status?.globalEnabled ? countdown : "off" }), children: status?.globalEnabled ? (_jsxs(_Fragment, { children: [support.keep === "capture" ? _jsxs(_Fragment, { children: [_jsx(MenuItem, { onClick: () => void traceActions.stopGlobal(), testId: "alpaca-tracing-stop-global", children: "Stop and keep capture" }), _jsx(MenuItem, { destructive: true, onClick: () => confirm({ header: "Discard recording", message: "Discard this instance's active recording and its evidence?", acceptLabel: "Discard", accept: () => { void traceActions.disableGlobal(); } }), children: "Discard\u2026" })] }) : _jsx(MenuItem, { onClick: () => confirm({ header: "Stop recording", message: "Stop this instance's recording? The recorded stories are discarded. Keeping stopped recordings is not available on this instance.", acceptLabel: "Stop", accept: () => { void traceActions.disableGlobal(); } }), testId: "alpaca-tracing-stop-global", children: "Stop recording\u2026" }), support.autoOff && [5, 10, 30, 60].filter(minutes => minutes <= (recording?.maxAutoOffMinutes ?? 60)).map(minutes => _jsxs(MenuItem, { onClick: () => void traceActions.setAutoOff(minutes), children: ["Stop in ", minutes, " min"] }, minutes))] })) : (_jsxs(_Fragment, { children: [support.autoOff && [5, 10, 30, 60].filter(minutes => minutes <= (recording?.maxAutoOffMinutes ?? 60)).map(minutes => _jsxs(MenuItem, { onClick: () => void traceActions.enableGlobal(minutes), children: ["Record everything for ", minutes, " min\u2026"] }, minutes)), !remote && _jsx(MenuItem, { onClick: () => void traceActions.enableGlobal(null), children: "Record everything until stopped\u2026" })] })) }), status && _jsx(InstanceLine, { status: status })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [_jsx(SimpleIconButton, { icon: _jsx(Crosshair, { className: "h-5 w-5", strokeWidth: 1 }), label: state.follow ? "Stop following the newest story" : "Follow the newest story", size: "large", selected: state.follow, onClick: () => traceActions.setFollow(!state.follow), "data-testid": "alpaca-tracing-follow" }), _jsx(SimpleIconButton, { icon: _jsx(Save, { className: "h-5 w-5", strokeWidth: 1 }), label: !status?.storageAvailable
|
|
37
|
+
}), testId: "alpaca-tracing-detach-delete", children: "Detach and delete session\u2026" })] })) : (_jsxs(MenuItem, { onClick: () => void traceActions.recordMySession(), testId: "alpaca-tracing-record-my-session", children: ["Record my session", _jsx("span", { className: "block text-2xs text-neutral-grey-50", children: "Traces every request this browser makes to this instance." })] })) }) }), _jsx(Menu, { testId: "alpaca-tracing-global-menu", trigger: _jsx(Indicator, { icon: _jsx(Globe, { className: "h-3.5 w-3.5", strokeWidth: 1.5 }), on: !!status?.globalEnabled, onTone: "warning", label: "Global", value: status?.globalEnabled ? countdown : "off" }), children: status?.globalEnabled ? (_jsxs(_Fragment, { children: [support.keep === "capture" ? _jsxs(_Fragment, { children: [_jsx(MenuItem, { onClick: () => void traceActions.stopGlobal(), testId: "alpaca-tracing-stop-global", children: "Stop and keep capture" }), _jsx(MenuItem, { destructive: true, onClick: () => confirm({ header: "Discard recording", message: "Discard this instance's active recording and its evidence?", acceptLabel: "Discard", accept: () => { void traceActions.disableGlobal(); } }), children: "Discard\u2026" })] }) : _jsx(MenuItem, { onClick: () => confirm({ header: "Stop recording", message: "Stop this instance's recording? The recorded stories are discarded. Keeping stopped recordings is not available on this instance.", acceptLabel: "Stop", accept: () => { void traceActions.disableGlobal(); } }), testId: "alpaca-tracing-stop-global", children: "Stop recording\u2026" }), support.autoOff && [5, 10, 30, 60].filter(minutes => minutes <= (recording?.maxAutoOffMinutes ?? 60)).map(minutes => _jsxs(MenuItem, { onClick: () => void traceActions.setAutoOff(minutes), children: ["Stop in ", minutes, " min"] }, minutes))] })) : (_jsxs(_Fragment, { children: [support.autoOff && [5, 10, 30, 60].filter(minutes => minutes <= (recording?.maxAutoOffMinutes ?? 60)).map(minutes => _jsxs(MenuItem, { onClick: () => void traceActions.enableGlobal(minutes), children: ["Record everything for ", minutes, " min\u2026"] }, minutes)), (!remote || !support.autoOff) && _jsx(MenuItem, { onClick: () => void traceActions.enableGlobal(null), children: "Record everything until stopped\u2026" })] })) }), status && _jsx(InstanceLine, { status: status })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [_jsx(SimpleIconButton, { icon: _jsx(Crosshair, { className: "h-5 w-5", strokeWidth: 1 }), label: state.follow ? "Stop following the newest story" : "Follow the newest story", size: "large", selected: state.follow, onClick: () => traceActions.setFollow(!state.follow), "data-testid": "alpaca-tracing-follow" }), _jsx(SimpleIconButton, { icon: _jsx(Save, { className: "h-5 w-5", strokeWidth: 1 }), label: !status?.storageAvailable
|
|
38
38
|
? "Trace storage is not installed on this instance"
|
|
39
39
|
: source?.kind === "global" && !support.persistGlobal ? "Persisting the global recording is not available on this instance"
|
|
40
40
|
: source?.kind === "capture" && status.storageOutdated ? "Update Alpaca.Tracing.Storage to persist captures"
|