@parhelia/alpaca 0.3.12832 → 0.3.12833

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.
@@ -1 +1 @@
1
- {"version":3,"file":"TraceSourcesSidebar.d.ts","sourceRoot":"","sources":["../../../src/tracing/components/TraceSourcesSidebar.tsx"],"names":[],"mappings":"AASA,wBAAgB,mBAAmB,gCAiElC"}
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: "No recording session yet. Use \u201CThis browser\u201D in the toolbar to record your own requests." }))] }), _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))) }))] }))] }));
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"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parhelia/alpaca",
3
- "version": "0.3.12832",
3
+ "version": "0.3.12833",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"