procsi 0.2.6
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 +665 -0
- package/README.md +587 -0
- package/dist/cli/commands/clear.d.ts +3 -0
- package/dist/cli/commands/clear.d.ts.map +1 -0
- package/dist/cli/commands/clear.js +30 -0
- package/dist/cli/commands/clear.js.map +1 -0
- package/dist/cli/commands/daemon.d.ts +3 -0
- package/dist/cli/commands/daemon.d.ts.map +1 -0
- package/dist/cli/commands/daemon.js +59 -0
- package/dist/cli/commands/daemon.js.map +1 -0
- package/dist/cli/commands/debug-dump.d.ts +27 -0
- package/dist/cli/commands/debug-dump.d.ts.map +1 -0
- package/dist/cli/commands/debug-dump.js +102 -0
- package/dist/cli/commands/debug-dump.js.map +1 -0
- package/dist/cli/commands/helpers.d.ts +18 -0
- package/dist/cli/commands/helpers.d.ts.map +1 -0
- package/dist/cli/commands/helpers.js +34 -0
- package/dist/cli/commands/helpers.js.map +1 -0
- package/dist/cli/commands/init.d.ts +9 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +28 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/intercept.d.ts +9 -0
- package/dist/cli/commands/intercept.d.ts.map +1 -0
- package/dist/cli/commands/intercept.js +121 -0
- package/dist/cli/commands/intercept.js.map +1 -0
- package/dist/cli/commands/interceptors.d.ts +3 -0
- package/dist/cli/commands/interceptors.d.ts.map +1 -0
- package/dist/cli/commands/interceptors.js +163 -0
- package/dist/cli/commands/interceptors.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +3 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +24 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/off.d.ts +8 -0
- package/dist/cli/commands/off.d.ts.map +1 -0
- package/dist/cli/commands/off.js +34 -0
- package/dist/cli/commands/off.js.map +1 -0
- package/dist/cli/commands/on.d.ts +9 -0
- package/dist/cli/commands/on.d.ts.map +1 -0
- package/dist/cli/commands/on.js +121 -0
- package/dist/cli/commands/on.js.map +1 -0
- package/dist/cli/commands/project.d.ts +3 -0
- package/dist/cli/commands/project.d.ts.map +1 -0
- package/dist/cli/commands/project.js +15 -0
- package/dist/cli/commands/project.js.map +1 -0
- package/dist/cli/commands/restart.d.ts +3 -0
- package/dist/cli/commands/restart.d.ts.map +1 -0
- package/dist/cli/commands/restart.js +35 -0
- package/dist/cli/commands/restart.js.map +1 -0
- package/dist/cli/commands/status.d.ts +3 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +66 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/stop.d.ts +3 -0
- package/dist/cli/commands/stop.d.ts.map +1 -0
- package/dist/cli/commands/stop.js +24 -0
- package/dist/cli/commands/stop.js.map +1 -0
- package/dist/cli/commands/tui.d.ts +3 -0
- package/dist/cli/commands/tui.d.ts.map +1 -0
- package/dist/cli/commands/tui.js +36 -0
- package/dist/cli/commands/tui.js.map +1 -0
- package/dist/cli/commands/vars.d.ts +36 -0
- package/dist/cli/commands/vars.d.ts.map +1 -0
- package/dist/cli/commands/vars.js +207 -0
- package/dist/cli/commands/vars.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +37 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/tui/App.d.ts +15 -0
- package/dist/cli/tui/App.d.ts.map +1 -0
- package/dist/cli/tui/App.js +544 -0
- package/dist/cli/tui/App.js.map +1 -0
- package/dist/cli/tui/components/AccordionContent.d.ts +28 -0
- package/dist/cli/tui/components/AccordionContent.d.ts.map +1 -0
- package/dist/cli/tui/components/AccordionContent.js +87 -0
- package/dist/cli/tui/components/AccordionContent.js.map +1 -0
- package/dist/cli/tui/components/AccordionPanel.d.ts +38 -0
- package/dist/cli/tui/components/AccordionPanel.d.ts.map +1 -0
- package/dist/cli/tui/components/AccordionPanel.js +110 -0
- package/dist/cli/tui/components/AccordionPanel.js.map +1 -0
- package/dist/cli/tui/components/AccordionSection.d.ts +32 -0
- package/dist/cli/tui/components/AccordionSection.d.ts.map +1 -0
- package/dist/cli/tui/components/AccordionSection.js +41 -0
- package/dist/cli/tui/components/AccordionSection.js.map +1 -0
- package/dist/cli/tui/components/BodyView.d.ts +14 -0
- package/dist/cli/tui/components/BodyView.d.ts.map +1 -0
- package/dist/cli/tui/components/BodyView.js +39 -0
- package/dist/cli/tui/components/BodyView.js.map +1 -0
- package/dist/cli/tui/components/ExportModal.d.ts +34 -0
- package/dist/cli/tui/components/ExportModal.d.ts.map +1 -0
- package/dist/cli/tui/components/ExportModal.js +109 -0
- package/dist/cli/tui/components/ExportModal.js.map +1 -0
- package/dist/cli/tui/components/FilterBar.d.ts +21 -0
- package/dist/cli/tui/components/FilterBar.d.ts.map +1 -0
- package/dist/cli/tui/components/FilterBar.js +155 -0
- package/dist/cli/tui/components/FilterBar.js.map +1 -0
- package/dist/cli/tui/components/HeadersView.d.ts +13 -0
- package/dist/cli/tui/components/HeadersView.d.ts.map +1 -0
- package/dist/cli/tui/components/HeadersView.js +8 -0
- package/dist/cli/tui/components/HeadersView.js.map +1 -0
- package/dist/cli/tui/components/HelpModal.d.ts +13 -0
- package/dist/cli/tui/components/HelpModal.d.ts.map +1 -0
- package/dist/cli/tui/components/HelpModal.js +78 -0
- package/dist/cli/tui/components/HelpModal.js.map +1 -0
- package/dist/cli/tui/components/HintContent.d.ts +25 -0
- package/dist/cli/tui/components/HintContent.d.ts.map +1 -0
- package/dist/cli/tui/components/HintContent.js +44 -0
- package/dist/cli/tui/components/HintContent.js.map +1 -0
- package/dist/cli/tui/components/InfoModal.d.ts +15 -0
- package/dist/cli/tui/components/InfoModal.d.ts.map +1 -0
- package/dist/cli/tui/components/InfoModal.js +17 -0
- package/dist/cli/tui/components/InfoModal.js.map +1 -0
- package/dist/cli/tui/components/JsonExplorerModal.d.ts +24 -0
- package/dist/cli/tui/components/JsonExplorerModal.d.ts.map +1 -0
- package/dist/cli/tui/components/JsonExplorerModal.js +311 -0
- package/dist/cli/tui/components/JsonExplorerModal.js.map +1 -0
- package/dist/cli/tui/components/Modal.d.ts +26 -0
- package/dist/cli/tui/components/Modal.d.ts.map +1 -0
- package/dist/cli/tui/components/Modal.js +15 -0
- package/dist/cli/tui/components/Modal.js.map +1 -0
- package/dist/cli/tui/components/Panel.d.ts +19 -0
- package/dist/cli/tui/components/Panel.d.ts.map +1 -0
- package/dist/cli/tui/components/Panel.js +37 -0
- package/dist/cli/tui/components/Panel.js.map +1 -0
- package/dist/cli/tui/components/RequestDetails.d.ts +16 -0
- package/dist/cli/tui/components/RequestDetails.d.ts.map +1 -0
- package/dist/cli/tui/components/RequestDetails.js +23 -0
- package/dist/cli/tui/components/RequestDetails.js.map +1 -0
- package/dist/cli/tui/components/RequestList.d.ts +21 -0
- package/dist/cli/tui/components/RequestList.d.ts.map +1 -0
- package/dist/cli/tui/components/RequestList.js +30 -0
- package/dist/cli/tui/components/RequestList.js.map +1 -0
- package/dist/cli/tui/components/RequestListItem.d.ts +36 -0
- package/dist/cli/tui/components/RequestListItem.d.ts.map +1 -0
- package/dist/cli/tui/components/RequestListItem.js +130 -0
- package/dist/cli/tui/components/RequestListItem.js.map +1 -0
- package/dist/cli/tui/components/SaveModal.d.ts +30 -0
- package/dist/cli/tui/components/SaveModal.d.ts.map +1 -0
- package/dist/cli/tui/components/SaveModal.js +95 -0
- package/dist/cli/tui/components/SaveModal.js.map +1 -0
- package/dist/cli/tui/components/StatusBar.d.ts +39 -0
- package/dist/cli/tui/components/StatusBar.d.ts.map +1 -0
- package/dist/cli/tui/components/StatusBar.js +53 -0
- package/dist/cli/tui/components/StatusBar.js.map +1 -0
- package/dist/cli/tui/components/TextViewerModal.d.ts +19 -0
- package/dist/cli/tui/components/TextViewerModal.d.ts.map +1 -0
- package/dist/cli/tui/components/TextViewerModal.js +227 -0
- package/dist/cli/tui/components/TextViewerModal.js.map +1 -0
- package/dist/cli/tui/hooks/useBodyExport.d.ts +26 -0
- package/dist/cli/tui/hooks/useBodyExport.d.ts.map +1 -0
- package/dist/cli/tui/hooks/useBodyExport.js +173 -0
- package/dist/cli/tui/hooks/useBodyExport.js.map +1 -0
- package/dist/cli/tui/hooks/useExport.d.ts +29 -0
- package/dist/cli/tui/hooks/useExport.d.ts.map +1 -0
- package/dist/cli/tui/hooks/useExport.js +64 -0
- package/dist/cli/tui/hooks/useExport.js.map +1 -0
- package/dist/cli/tui/hooks/useRequests.d.ts +26 -0
- package/dist/cli/tui/hooks/useRequests.d.ts.map +1 -0
- package/dist/cli/tui/hooks/useRequests.js +131 -0
- package/dist/cli/tui/hooks/useRequests.js.map +1 -0
- package/dist/cli/tui/hooks/useSaveBinary.d.ts +26 -0
- package/dist/cli/tui/hooks/useSaveBinary.d.ts.map +1 -0
- package/dist/cli/tui/hooks/useSaveBinary.js +165 -0
- package/dist/cli/tui/hooks/useSaveBinary.js.map +1 -0
- package/dist/cli/tui/hooks/useSpinner.d.ts +5 -0
- package/dist/cli/tui/hooks/useSpinner.d.ts.map +1 -0
- package/dist/cli/tui/hooks/useSpinner.js +25 -0
- package/dist/cli/tui/hooks/useSpinner.js.map +1 -0
- package/dist/cli/tui/hooks/useStdoutDimensions.d.ts +11 -0
- package/dist/cli/tui/hooks/useStdoutDimensions.d.ts.map +1 -0
- package/dist/cli/tui/hooks/useStdoutDimensions.js +29 -0
- package/dist/cli/tui/hooks/useStdoutDimensions.js.map +1 -0
- package/dist/cli/tui/utils/binary.d.ts +24 -0
- package/dist/cli/tui/utils/binary.d.ts.map +1 -0
- package/dist/cli/tui/utils/binary.js +152 -0
- package/dist/cli/tui/utils/binary.js.map +1 -0
- package/dist/cli/tui/utils/clipboard.d.ts +9 -0
- package/dist/cli/tui/utils/clipboard.d.ts.map +1 -0
- package/dist/cli/tui/utils/clipboard.js +58 -0
- package/dist/cli/tui/utils/clipboard.js.map +1 -0
- package/dist/cli/tui/utils/content-type.d.ts +8 -0
- package/dist/cli/tui/utils/content-type.d.ts.map +1 -0
- package/dist/cli/tui/utils/content-type.js +10 -0
- package/dist/cli/tui/utils/content-type.js.map +1 -0
- package/dist/cli/tui/utils/curl.d.ts +9 -0
- package/dist/cli/tui/utils/curl.d.ts.map +1 -0
- package/dist/cli/tui/utils/curl.js +54 -0
- package/dist/cli/tui/utils/curl.js.map +1 -0
- package/dist/cli/tui/utils/filters.d.ts +6 -0
- package/dist/cli/tui/utils/filters.d.ts.map +1 -0
- package/dist/cli/tui/utils/filters.js +13 -0
- package/dist/cli/tui/utils/filters.js.map +1 -0
- package/dist/cli/tui/utils/formatters.d.ts +49 -0
- package/dist/cli/tui/utils/formatters.d.ts.map +1 -0
- package/dist/cli/tui/utils/formatters.js +200 -0
- package/dist/cli/tui/utils/formatters.js.map +1 -0
- package/dist/cli/tui/utils/har.d.ts +75 -0
- package/dist/cli/tui/utils/har.d.ts.map +1 -0
- package/dist/cli/tui/utils/har.js +117 -0
- package/dist/cli/tui/utils/har.js.map +1 -0
- package/dist/cli/tui/utils/json-tree.d.ts +69 -0
- package/dist/cli/tui/utils/json-tree.d.ts.map +1 -0
- package/dist/cli/tui/utils/json-tree.js +339 -0
- package/dist/cli/tui/utils/json-tree.js.map +1 -0
- package/dist/cli/tui/utils/open-external.d.ts +17 -0
- package/dist/cli/tui/utils/open-external.d.ts.map +1 -0
- package/dist/cli/tui/utils/open-external.js +57 -0
- package/dist/cli/tui/utils/open-external.js.map +1 -0
- package/dist/cli/tui/utils/syntax-highlight.d.ts +16 -0
- package/dist/cli/tui/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/cli/tui/utils/syntax-highlight.js +64 -0
- package/dist/cli/tui/utils/syntax-highlight.js.map +1 -0
- package/dist/daemon/control.d.ts +21 -0
- package/dist/daemon/control.d.ts.map +1 -0
- package/dist/daemon/control.js +311 -0
- package/dist/daemon/control.js.map +1 -0
- package/dist/daemon/htpx-client.d.ts +8 -0
- package/dist/daemon/htpx-client.d.ts.map +1 -0
- package/dist/daemon/htpx-client.js +25 -0
- package/dist/daemon/htpx-client.js.map +1 -0
- package/dist/daemon/index.d.ts +3 -0
- package/dist/daemon/index.d.ts.map +1 -0
- package/dist/daemon/index.js +178 -0
- package/dist/daemon/index.js.map +1 -0
- package/dist/daemon/interceptor-loader.d.ts +30 -0
- package/dist/daemon/interceptor-loader.d.ts.map +1 -0
- package/dist/daemon/interceptor-loader.js +249 -0
- package/dist/daemon/interceptor-loader.js.map +1 -0
- package/dist/daemon/interceptor-runner.d.ts +39 -0
- package/dist/daemon/interceptor-runner.d.ts.map +1 -0
- package/dist/daemon/interceptor-runner.js +312 -0
- package/dist/daemon/interceptor-runner.js.map +1 -0
- package/dist/daemon/procsi-client.d.ts +8 -0
- package/dist/daemon/procsi-client.d.ts.map +1 -0
- package/dist/daemon/procsi-client.js +25 -0
- package/dist/daemon/procsi-client.js.map +1 -0
- package/dist/daemon/proxy.d.ts +34 -0
- package/dist/daemon/proxy.d.ts.map +1 -0
- package/dist/daemon/proxy.js +213 -0
- package/dist/daemon/proxy.js.map +1 -0
- package/dist/daemon/storage.d.ts +130 -0
- package/dist/daemon/storage.d.ts.map +1 -0
- package/dist/daemon/storage.js +761 -0
- package/dist/daemon/storage.js.map +1 -0
- package/dist/interceptors.d.ts +2 -0
- package/dist/interceptors.d.ts.map +1 -0
- package/dist/interceptors.js +2 -0
- package/dist/interceptors.js.map +1 -0
- package/dist/mcp/server.d.ts +110 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +806 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/overrides/node.d.ts +30 -0
- package/dist/overrides/node.d.ts.map +1 -0
- package/dist/overrides/node.js +66 -0
- package/dist/overrides/node.js.map +1 -0
- package/dist/shared/config.d.ts +21 -0
- package/dist/shared/config.d.ts.map +1 -0
- package/dist/shared/config.js +83 -0
- package/dist/shared/config.js.map +1 -0
- package/dist/shared/content-type.d.ts +64 -0
- package/dist/shared/content-type.d.ts.map +1 -0
- package/dist/shared/content-type.js +145 -0
- package/dist/shared/content-type.js.map +1 -0
- package/dist/shared/control-client.d.ts +144 -0
- package/dist/shared/control-client.d.ts.map +1 -0
- package/dist/shared/control-client.js +272 -0
- package/dist/shared/control-client.js.map +1 -0
- package/dist/shared/daemon.d.ts +33 -0
- package/dist/shared/daemon.d.ts.map +1 -0
- package/dist/shared/daemon.js +231 -0
- package/dist/shared/daemon.js.map +1 -0
- package/dist/shared/logger.d.ts +47 -0
- package/dist/shared/logger.d.ts.map +1 -0
- package/dist/shared/logger.js +200 -0
- package/dist/shared/logger.js.map +1 -0
- package/dist/shared/project.d.ts +76 -0
- package/dist/shared/project.d.ts.map +1 -0
- package/dist/shared/project.js +185 -0
- package/dist/shared/project.js.map +1 -0
- package/dist/shared/proxy-info.d.ts +10 -0
- package/dist/shared/proxy-info.d.ts.map +1 -0
- package/dist/shared/proxy-info.js +15 -0
- package/dist/shared/proxy-info.js.map +1 -0
- package/dist/shared/types.d.ts +128 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +5 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/shared/version.d.ts +5 -0
- package/dist/shared/version.d.ts.map +1 -0
- package/dist/shared/version.js +21 -0
- package/dist/shared/version.js.map +1 -0
- package/package.json +113 -0
- package/skills/procsi/SKILL.md +228 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Filter bar for narrowing displayed requests by search text, HTTP method, and status range.
|
|
4
|
+
* Activated by '/' in the main TUI — maintains local state until Enter confirms.
|
|
5
|
+
*
|
|
6
|
+
* Tab/Shift+Tab cycles focus between three fields: search, method, status.
|
|
7
|
+
* When focused on search, all keys are text input.
|
|
8
|
+
* When focused on method/status, left/right arrows cycle the value.
|
|
9
|
+
*/
|
|
10
|
+
import { useState, useEffect, useRef } from "react";
|
|
11
|
+
import { Box, Text, useInput } from "ink";
|
|
12
|
+
const METHOD_CYCLE = ["GET", "POST", "PUT", "PATCH", "DELETE"];
|
|
13
|
+
const STATUS_CYCLE = ["2xx", "3xx", "4xx", "5xx"];
|
|
14
|
+
const MAX_SEARCH_LENGTH = 200;
|
|
15
|
+
const FILTER_DEBOUNCE_MS = 150;
|
|
16
|
+
const FIELD_ORDER = ["search", "method", "status"];
|
|
17
|
+
export function FilterBar({ isActive, filter, onFilterChange, onClose, onCancel, width, }) {
|
|
18
|
+
const [search, setSearch] = useState(filter.search ?? "");
|
|
19
|
+
// Note: these initialisers only run on mount. This is safe because App.tsx
|
|
20
|
+
// conditionally renders FilterBar ({showFilter && <FilterBar />}), so it
|
|
21
|
+
// unmounts on close and remounts with fresh state on reopen.
|
|
22
|
+
const [methodIndex, setMethodIndex] = useState(() => {
|
|
23
|
+
if (filter.methods && filter.methods.length === 1) {
|
|
24
|
+
const method = filter.methods[0];
|
|
25
|
+
const idx = METHOD_CYCLE.findIndex((m) => m === method);
|
|
26
|
+
// offset by 1 because index 0 in our cycling means "all" (no filter)
|
|
27
|
+
return idx >= 0 ? idx + 1 : 0;
|
|
28
|
+
}
|
|
29
|
+
return 0;
|
|
30
|
+
});
|
|
31
|
+
const [statusIndex, setStatusIndex] = useState(() => {
|
|
32
|
+
if (filter.statusRange) {
|
|
33
|
+
const idx = STATUS_CYCLE.findIndex((s) => s === filter.statusRange);
|
|
34
|
+
return idx >= 0 ? idx + 1 : 0;
|
|
35
|
+
}
|
|
36
|
+
return 0;
|
|
37
|
+
});
|
|
38
|
+
const [focusedField, setFocusedField] = useState("search");
|
|
39
|
+
function buildFilter() {
|
|
40
|
+
const result = {};
|
|
41
|
+
if (search.trim()) {
|
|
42
|
+
result.search = search.trim();
|
|
43
|
+
}
|
|
44
|
+
if (methodIndex > 0) {
|
|
45
|
+
const method = METHOD_CYCLE[methodIndex - 1];
|
|
46
|
+
if (method) {
|
|
47
|
+
result.methods = [method];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (statusIndex > 0) {
|
|
51
|
+
const status = STATUS_CYCLE[statusIndex - 1];
|
|
52
|
+
if (status) {
|
|
53
|
+
result.statusRange = status;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
const debounceRef = useRef(null);
|
|
59
|
+
// Stable reference to buildFilter for use in the debounce effect
|
|
60
|
+
const buildFilterRef = useRef(buildFilter);
|
|
61
|
+
buildFilterRef.current = buildFilter;
|
|
62
|
+
// Live debounced filter application
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (debounceRef.current) {
|
|
65
|
+
clearTimeout(debounceRef.current);
|
|
66
|
+
}
|
|
67
|
+
debounceRef.current = setTimeout(() => {
|
|
68
|
+
onFilterChange(buildFilterRef.current());
|
|
69
|
+
}, FILTER_DEBOUNCE_MS);
|
|
70
|
+
return () => {
|
|
71
|
+
if (debounceRef.current) {
|
|
72
|
+
clearTimeout(debounceRef.current);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}, [search, methodIndex, statusIndex, onFilterChange]);
|
|
76
|
+
// Cleanup debounce timer on unmount
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
return () => {
|
|
79
|
+
if (debounceRef.current) {
|
|
80
|
+
clearTimeout(debounceRef.current);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}, []);
|
|
84
|
+
function cycleField(setter, length, direction) {
|
|
85
|
+
setter((prev) => {
|
|
86
|
+
const total = length + 1; // +1 for the "ALL" option at index 0
|
|
87
|
+
return (prev + direction + total) % total;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
useInput((input, key) => {
|
|
91
|
+
if (key.escape) {
|
|
92
|
+
if (onCancel) {
|
|
93
|
+
onCancel();
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
onClose();
|
|
97
|
+
}
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (key.return) {
|
|
101
|
+
// Filter already applied live — just close the bar
|
|
102
|
+
onClose();
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
// Tab/Shift+Tab cycles focus between fields
|
|
106
|
+
if (key.tab) {
|
|
107
|
+
setFocusedField((prev) => {
|
|
108
|
+
const currentIdx = FIELD_ORDER.indexOf(prev);
|
|
109
|
+
const direction = key.shift ? -1 : 1;
|
|
110
|
+
const nextIdx = (currentIdx + direction + FIELD_ORDER.length) % FIELD_ORDER.length;
|
|
111
|
+
return FIELD_ORDER[nextIdx] ?? "search";
|
|
112
|
+
});
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
// Field-specific input handling
|
|
116
|
+
if (focusedField === "search") {
|
|
117
|
+
if (key.backspace || key.delete) {
|
|
118
|
+
setSearch((prev) => prev.slice(0, -1));
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
// Only accept single characters to filter out mouse escape sequences
|
|
122
|
+
// which arrive as multi-character strings from ink-mouse.
|
|
123
|
+
if (input && input.length === 1 && !key.ctrl && !key.meta) {
|
|
124
|
+
setSearch((prev) => {
|
|
125
|
+
if (prev.length >= MAX_SEARCH_LENGTH)
|
|
126
|
+
return prev;
|
|
127
|
+
return prev + input;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (focusedField === "method") {
|
|
133
|
+
if (key.rightArrow || key.downArrow) {
|
|
134
|
+
cycleField(setMethodIndex, METHOD_CYCLE.length, 1);
|
|
135
|
+
}
|
|
136
|
+
else if (key.leftArrow || key.upArrow) {
|
|
137
|
+
cycleField(setMethodIndex, METHOD_CYCLE.length, -1);
|
|
138
|
+
}
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (focusedField === "status") {
|
|
142
|
+
if (key.rightArrow || key.downArrow) {
|
|
143
|
+
cycleField(setStatusIndex, STATUS_CYCLE.length, 1);
|
|
144
|
+
}
|
|
145
|
+
else if (key.leftArrow || key.upArrow) {
|
|
146
|
+
cycleField(setStatusIndex, STATUS_CYCLE.length, -1);
|
|
147
|
+
}
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
}, { isActive });
|
|
151
|
+
const currentMethod = methodIndex > 0 ? METHOD_CYCLE[methodIndex - 1] : "ALL";
|
|
152
|
+
const currentStatus = statusIndex > 0 ? STATUS_CYCLE[statusIndex - 1] : "ALL";
|
|
153
|
+
return (_jsxs(Box, { borderStyle: "single", borderBottom: true, borderTop: false, borderLeft: false, borderRight: false, paddingX: 1, width: width, height: 2, children: [_jsx(Text, { color: "cyan", bold: true, children: "/" }), _jsxs(Text, { children: [" ", search] }), isActive && focusedField === "search" && _jsx(Text, { color: "cyan", children: "\u2588" }), _jsx(Text, { color: "gray", children: " " }), _jsx(Text, { dimColor: true, children: "method:" }), _jsx(Text, { color: methodIndex > 0 ? "yellow" : "white", bold: focusedField === "method", underline: focusedField === "method", children: currentMethod }), _jsx(Text, { color: "gray", children: " " }), _jsx(Text, { dimColor: true, children: "status:" }), _jsx(Text, { color: statusIndex > 0 ? "yellow" : "white", bold: focusedField === "status", underline: focusedField === "status", children: currentStatus }), _jsx(Text, { color: "gray", children: " " }), _jsx(Text, { dimColor: true, children: "Tab=switch Enter=close Esc=cancel" })] }));
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=FilterBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterBar.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/FilterBar.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AAEH,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAG1C,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CA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,KAAK,EAAC,MAAM,uBAAS,EACrE,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,IAAI,GAAQ,EAChC,KAAC,IAAI,IAAC,QAAQ,8BAAe,EAC7B,KAAC,IAAI,IACH,KAAK,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAC3C,IAAI,EAAE,YAAY,KAAK,QAAQ,EAC/B,SAAS,EAAE,YAAY,KAAK,QAAQ,YAEnC,aAAa,GACT,EACP,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,IAAI,GAAQ,EAChC,KAAC,IAAI,IAAC,QAAQ,8BAAe,EAC7B,KAAC,IAAI,IACH,KAAK,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAC3C,IAAI,EAAE,YAAY,KAAK,QAAQ,EAC/B,SAAS,EAAE,YAAY,KAAK,QAAQ,YAEnC,aAAa,GACT,EACP,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,IAAI,GAAQ,EAChC,KAAC,IAAI,IAAC,QAAQ,wDAAyC,IACnD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Display HTTP headers in a formatted view.
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
interface HeadersViewProps {
|
|
6
|
+
title: string;
|
|
7
|
+
headers: Record<string, string> | undefined;
|
|
8
|
+
maxLines?: number;
|
|
9
|
+
scrollOffset?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function HeadersView({ title, headers, maxLines, scrollOffset, }: HeadersViewProps): React.ReactElement;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=HeadersView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeadersView.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/HeadersView.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,QAAQ,EACR,YAAgB,GACjB,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CA2BvC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
export function HeadersView({ title, headers, maxLines, scrollOffset = 0, }) {
|
|
4
|
+
const entries = headers ? Object.entries(headers) : [];
|
|
5
|
+
const visibleEntries = maxLines !== undefined ? entries.slice(scrollOffset, scrollOffset + maxLines) : entries;
|
|
6
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, color: "yellow", children: title }), entries.length === 0 ? (_jsx(Text, { dimColor: true, children: "No headers" })) : (visibleEntries.map(([name, value]) => (_jsxs(Box, { children: [_jsx(Text, { color: "cyan", children: name }), _jsx(Text, { children: ": " }), _jsx(Text, { children: value })] }, name)))), maxLines !== undefined && entries.length > maxLines && (_jsxs(Text, { dimColor: true, children: ["... and ", entries.length - maxLines, " more"] }))] }));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=HeadersView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeadersView.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/HeadersView.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAShC,MAAM,UAAU,WAAW,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,QAAQ,EACR,YAAY,GAAG,CAAC,GACC;IACjB,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAEvD,MAAM,cAAc,GAClB,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAE1F,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,QAAQ,YACtB,KAAK,GACD,EACN,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CACtB,KAAC,IAAI,IAAC,QAAQ,iCAAkB,CACjC,CAAC,CAAC,CAAC,CACF,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CACpC,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,IAAI,GAAQ,EAChC,KAAC,IAAI,qBAAU,EACf,KAAC,IAAI,cAAE,KAAK,GAAQ,KAHZ,IAAI,CAIR,CACP,CAAC,CACH,EACA,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,QAAQ,IAAI,CACtD,MAAC,IAAI,IAAC,QAAQ,+BAAU,OAAO,CAAC,MAAM,GAAG,QAAQ,aAAa,CAC/D,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Full-screen help overlay showing all keyboard shortcuts.
|
|
3
|
+
* Replaces the main TUI when active (terminals don't support true overlays).
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
export interface HelpModalProps {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function HelpModal({ width, height, onClose, isActive, }: HelpModalProps): React.ReactElement;
|
|
13
|
+
//# sourceMappingURL=HelpModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpModal.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/HelpModal.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAiFD,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,MAAM,EACN,OAAO,EACP,QAAe,GAChB,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CA+CrC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useInput } from "ink";
|
|
3
|
+
const HELP_SECTIONS = [
|
|
4
|
+
{
|
|
5
|
+
title: "Navigation",
|
|
6
|
+
entries: [
|
|
7
|
+
{ key: "j / ↓", description: "Move down" },
|
|
8
|
+
{ key: "k / ↑", description: "Move up" },
|
|
9
|
+
{ key: "g", description: "Jump to first item" },
|
|
10
|
+
{ key: "G", description: "Jump to last item" },
|
|
11
|
+
{ key: "Ctrl+u / Ctrl+d", description: "Half page up / down" },
|
|
12
|
+
{ key: "Ctrl+f / Ctrl+b", description: "Full page down / up" },
|
|
13
|
+
{ key: "Tab", description: "Next panel/section" },
|
|
14
|
+
{ key: "Shift+Tab", description: "Previous panel/section" },
|
|
15
|
+
{ key: "1-5", description: "Jump to section" },
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
title: "Actions",
|
|
20
|
+
entries: [
|
|
21
|
+
{ key: "Enter", description: "View body content" },
|
|
22
|
+
{ key: "c", description: "Copy as cURL" },
|
|
23
|
+
{ key: "H", description: "Export HAR" },
|
|
24
|
+
{ key: "y", description: "Copy body to clipboard" },
|
|
25
|
+
{ key: "s", description: "Export body content" },
|
|
26
|
+
{ key: "u", description: "Toggle full URL" },
|
|
27
|
+
{ key: "/", description: "Filter requests" },
|
|
28
|
+
{ key: "r", description: "Refresh" },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
title: "JSON Explorer",
|
|
33
|
+
entries: [
|
|
34
|
+
{ key: "j / k", description: "Navigate tree" },
|
|
35
|
+
{ key: "Ctrl+u / Ctrl+d", description: "Half page up / down" },
|
|
36
|
+
{ key: "Ctrl+f / Ctrl+b", description: "Full page down / up" },
|
|
37
|
+
{ key: "Enter / l", description: "Toggle node" },
|
|
38
|
+
{ key: "h", description: "Collapse node" },
|
|
39
|
+
{ key: "e / c", description: "Expand / collapse all" },
|
|
40
|
+
{ key: "/", description: "Filter by path" },
|
|
41
|
+
{ key: "n / N", description: "Next / previous match" },
|
|
42
|
+
{ key: "y", description: "Copy value" },
|
|
43
|
+
{ key: "q / Esc", description: "Close explorer" },
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
title: "Text Viewer",
|
|
48
|
+
entries: [
|
|
49
|
+
{ key: "j / k", description: "Scroll line by line" },
|
|
50
|
+
{ key: "Ctrl+u / Ctrl+d", description: "Scroll half page" },
|
|
51
|
+
{ key: "Ctrl+f / Ctrl+b", description: "Full page down / up" },
|
|
52
|
+
{ key: "Space", description: "Page down" },
|
|
53
|
+
{ key: "g / G", description: "Jump to top / bottom" },
|
|
54
|
+
{ key: "/", description: "Search text" },
|
|
55
|
+
{ key: "n / N", description: "Next / previous match" },
|
|
56
|
+
{ key: "y", description: "Copy to clipboard" },
|
|
57
|
+
{ key: "q / Esc", description: "Close viewer" },
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
title: "General",
|
|
62
|
+
entries: [
|
|
63
|
+
{ key: "i", description: "Proxy connection info" },
|
|
64
|
+
{ key: "?", description: "Toggle help" },
|
|
65
|
+
{ key: "q", description: "Quit" },
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
const KEY_COLUMN_WIDTH = 16;
|
|
70
|
+
export function HelpModal({ width, height, onClose, isActive = true, }) {
|
|
71
|
+
useInput((_input, key) => {
|
|
72
|
+
if (_input === "?" || key.escape) {
|
|
73
|
+
onClose();
|
|
74
|
+
}
|
|
75
|
+
}, { isActive });
|
|
76
|
+
return (_jsxs(Box, { flexDirection: "column", width: width, height: height, alignItems: "center", justifyContent: "center", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "cyan", bold: true, children: "Keyboard Shortcuts" }) }), HELP_SECTIONS.map((section) => (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Box, { marginBottom: 0, children: _jsx(Text, { bold: true, color: "yellow", children: section.title }) }), section.entries.map((entry) => (_jsxs(Box, { children: [_jsx(Box, { width: KEY_COLUMN_WIDTH, children: _jsx(Text, { color: "cyan", children: entry.key }) }), _jsx(Text, { children: entry.description })] }, entry.key)))] }, section.title))), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Press ? or Escape to close" }) })] }));
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=HelpModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpModal.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/HelpModal.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAmB1C,MAAM,aAAa,GAAkB;IACnC;QACE,KAAK,EAAE,YAAY;QACnB,OAAO,EAAE;YACP,EAAE,GAAG,EA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,YAAE,KAAK,CAAC,GAAG,GAAQ,GACjC,EACN,KAAC,IAAI,cAAE,KAAK,CAAC,WAAW,GAAQ,KAJxB,KAAK,CAAC,GAAG,CAKb,CACP,CAAC,KAbM,OAAO,CAAC,KAAK,CAcjB,CACP,CAAC,EAEF,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,QAAQ,iDAAkC,GAC5C,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared hint rendering used by StatusBar and modal hint bars.
|
|
3
|
+
* Renders "key action │ key action │ …" with coloured styling
|
|
4
|
+
* and drops hints from the right when they exceed the available width.
|
|
5
|
+
*/
|
|
6
|
+
import React from "react";
|
|
7
|
+
export interface HintItem {
|
|
8
|
+
key: string;
|
|
9
|
+
action: string;
|
|
10
|
+
}
|
|
11
|
+
interface HintContentProps {
|
|
12
|
+
hints: HintItem[];
|
|
13
|
+
/** Available character width for the hints. When omitted, all hints are shown. */
|
|
14
|
+
availableWidth?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Renders a list of key hints with consistent styling:
|
|
18
|
+
* cyan bold keys, dim actions, dim separators.
|
|
19
|
+
* Drops hints from the right and appends "…" when they don't fit.
|
|
20
|
+
*
|
|
21
|
+
* Returns a `<Text>` element — nest inside another `<Text>` or use directly.
|
|
22
|
+
*/
|
|
23
|
+
export declare function HintContent({ hints, availableWidth }: HintContentProps): React.ReactElement;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=HintContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HintContent.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/HintContent.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,gBAAgB;IACxB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,kFAAkF;IAClF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AASD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CAqC3F"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Shared hint rendering used by StatusBar and modal hint bars.
|
|
4
|
+
* Renders "key action │ key action │ …" with coloured styling
|
|
5
|
+
* and drops hints from the right when they exceed the available width.
|
|
6
|
+
*/
|
|
7
|
+
import React, { useMemo } from "react";
|
|
8
|
+
import { Text } from "ink";
|
|
9
|
+
const SEPARATOR_WIDTH = 3; // " │ "
|
|
10
|
+
/** Width in visible characters of a single hint: "key action" */
|
|
11
|
+
function hintWidth(hint) {
|
|
12
|
+
return hint.key.length + 1 + hint.action.length;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Renders a list of key hints with consistent styling:
|
|
16
|
+
* cyan bold keys, dim actions, dim separators.
|
|
17
|
+
* Drops hints from the right and appends "…" when they don't fit.
|
|
18
|
+
*
|
|
19
|
+
* Returns a `<Text>` element — nest inside another `<Text>` or use directly.
|
|
20
|
+
*/
|
|
21
|
+
export function HintContent({ hints, availableWidth }) {
|
|
22
|
+
const { fittingHints, truncated } = useMemo(() => {
|
|
23
|
+
if (availableWidth === undefined)
|
|
24
|
+
return { fittingHints: hints, truncated: false };
|
|
25
|
+
let remaining = availableWidth;
|
|
26
|
+
const fitting = [];
|
|
27
|
+
for (let i = 0; i < hints.length; i++) {
|
|
28
|
+
const hint = hints[i];
|
|
29
|
+
if (!hint)
|
|
30
|
+
break;
|
|
31
|
+
const w = hintWidth(hint) + (i < hints.length - 1 ? SEPARATOR_WIDTH : 0);
|
|
32
|
+
if (w <= remaining) {
|
|
33
|
+
fitting.push(hint);
|
|
34
|
+
remaining -= w;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return { fittingHints: fitting, truncated: true };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return { fittingHints: fitting, truncated: false };
|
|
41
|
+
}, [hints, availableWidth]);
|
|
42
|
+
return (_jsxs(Text, { children: [fittingHints.map((hint, index) => (_jsxs(React.Fragment, { children: [_jsx(Text, { color: "cyan", bold: true, children: hint.key }), _jsxs(Text, { dimColor: true, children: [" ", hint.action] }), index < fittingHints.length - 1 && _jsx(Text, { dimColor: true, children: " \u2502 " })] }, hint.key))), truncated && _jsx(Text, { dimColor: true, children: "\u2026" })] }));
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=HintContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HintContent.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/HintContent.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAa3B,MAAM,eAAe,GAAG,CAAC,CAAC,CAAC,QAAQ;AAEnC,iEAAiE;AACjE,SAAS,SAAS,CAAC,IAAc;IAC/B,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;AAClD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,cAAc,EAAoB;IACrE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE;QAC/C,IAAI,cAAc,KAAK,SAAS;YAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC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AI,KAAC,IAAI,IAAC,QAAQ,6BAAS,IAChC,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Full-screen info overlay showing proxy connection details.
|
|
3
|
+
* Replaces the main TUI when active (terminals don't support true overlays).
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
export interface InfoModalProps {
|
|
7
|
+
proxyPort: number | undefined;
|
|
8
|
+
caCertPath: string;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
isActive?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function InfoModal({ proxyPort, caCertPath, width, height, onClose, isActive, }: InfoModalProps): React.ReactElement;
|
|
15
|
+
//# sourceMappingURL=InfoModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoModal.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/InfoModal.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAID,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,UAAU,EACV,KAAK,EACL,MAAM,EACN,OAAO,EACP,QAAe,GAChB,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CA0FrC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useInput } from "ink";
|
|
3
|
+
import { buildProxyInfo } from "../../../shared/proxy-info.js";
|
|
4
|
+
const KEY_COLUMN_WIDTH = 24;
|
|
5
|
+
export function InfoModal({ proxyPort, caCertPath, width, height, onClose, isActive = true, }) {
|
|
6
|
+
useInput((input, key) => {
|
|
7
|
+
if (input === "i" || key.escape) {
|
|
8
|
+
onClose();
|
|
9
|
+
}
|
|
10
|
+
}, { isActive });
|
|
11
|
+
if (proxyPort === undefined) {
|
|
12
|
+
return (_jsxs(Box, { flexDirection: "column", width: width, height: height, alignItems: "center", justifyContent: "center", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "cyan", bold: true, children: "Proxy Connection Details" }) }), _jsx(Text, { color: "yellow", children: "Proxy is not running" }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, children: ["Run", " ", _jsx(Text, { color: "cyan", children: "eval $(procsi vars)" }), " ", "to start the proxy"] }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Press i or Escape to close" }) })] }));
|
|
13
|
+
}
|
|
14
|
+
const info = buildProxyInfo(proxyPort, caCertPath);
|
|
15
|
+
return (_jsxs(Box, { flexDirection: "column", width: width, height: height, alignItems: "center", justifyContent: "center", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "cyan", bold: true, children: "Proxy Connection Details" }) }), _jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [_jsx(Box, { width: KEY_COLUMN_WIDTH, children: _jsx(Text, { bold: true, children: "Proxy URL:" }) }), _jsx(Text, { color: "green", children: info.proxyUrl })] }), _jsxs(Box, { children: [_jsx(Box, { width: KEY_COLUMN_WIDTH, children: _jsx(Text, { bold: true, children: "CA certificate:" }) }), _jsx(Text, { color: "green", children: info.caCertPath })] })] }), _jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Box, { marginBottom: 0, children: _jsx(Text, { bold: true, color: "yellow", children: "Environment variables" }) }), info.envBlock.split("\n").map((line) => (_jsx(Text, { dimColor: true, children: line }, line)))] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Press i or Escape to close" }) })] }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=InfoModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoModal.js","sourceRoot":"","sources":["../../../../src/cli/tui/components/InfoModal.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAW/D,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B,MAAM,UAAU,SAAS,CAAC,EACxB,SAAS,EACT,UAAU,EACV,KAAK,EACL,MAAM,EACN,OAAO,EACP,QAAQ,GAAG,IAAI,GACA;IACf,QAAQ,CACN,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACb,IAAI,KAAK,KAAK,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YAChC,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC,EACD,EAAE,QAAQ,EAAE,CACb,CAAC;IAEF,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,CACL,MAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAC,QAAQ,EACnB,cAAc,EAAC,QAAQ,aAEvB,KAAC,GAAG,IAAC,YAAY,EAAE,CAAC,YAClB,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,IAAI,+CAEhB,GACH,EAEN,KAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,qCAA4B,EAChD,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,MAAC,IAAI,IAAC,QAAQ,0BACR,GAAG,EACP,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,oCAA2B,EAC5C,GAAG,0BACC,GACH,EAEN,KAAC,GAAG,IA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,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,QAAQ,iDAAkC,GAC5C,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Full-screen modal for exploring JSON bodies as a collapsible tree.
|
|
3
|
+
* Replaces the main TUI when active (terminals don't support true overlays).
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
export interface JsonExplorerModalProps {
|
|
7
|
+
/** Pre-parsed JSON data */
|
|
8
|
+
data: unknown;
|
|
9
|
+
/** Display title, e.g. "Response Body" */
|
|
10
|
+
title: string;
|
|
11
|
+
/** Content-type for display in header */
|
|
12
|
+
contentType: string;
|
|
13
|
+
/** Body size in bytes for display in header */
|
|
14
|
+
bodySize: number;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
/** For TTY check (same pattern as other modals) */
|
|
19
|
+
isActive?: boolean;
|
|
20
|
+
/** Status message callback — used to show copy feedback */
|
|
21
|
+
onStatus?: (message: string) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare function JsonExplorerModal({ data, title, contentType, bodySize, width, height, onClose, isActive, onStatus, }: JsonExplorerModalProps): React.ReactElement;
|
|
24
|
+
//# sourceMappingURL=JsonExplorerModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JsonExplorerModal.d.ts","sourceRoot":"","sources":["../../../../src/cli/tui/components/JsonExplorerModal.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAA4D,MAAM,OAAO,CAAC;AA8BjF,MAAM,WAAW,sBAAsB;IACrC,2BAA2B;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAkBD,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,KAAK,EACL,MAAM,EACN,OAAO,EACP,QAAe,EACf,QAAQ,GACT,EAAE,sBAAsB,GAAG,KAAK,CAAC,YAAY,CAkU7C"}
|