@linghun/tui 0.1.1 → 0.1.2
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/agent-completion-finalizer.js +3 -3
- package/dist/background-control-runtime.js +52 -52
- package/dist/cache-command-runtime.js +3 -3
- package/dist/capability-runtime.js +32 -32
- package/dist/{chunk-TJLC3QAS.js → chunk-36ZWUJQS.js} +1 -1
- package/dist/{chunk-624A7BBJ.js → chunk-3MRYQO7X.js} +4 -4
- package/dist/{chunk-QJTET7EZ.js → chunk-3PG7I3LA.js} +4 -4
- package/dist/{chunk-J7ZE2JKP.js → chunk-42ZZUF7P.js} +3 -3
- package/dist/{chunk-DTK5NBTV.js → chunk-4BFCUJX6.js} +95 -11
- package/dist/{chunk-YH6UIHNF.js → chunk-4QWCNMP6.js} +2 -2
- package/dist/{chunk-WKMBK5UP.js → chunk-4TO2LDMP.js} +1 -1
- package/dist/{chunk-5CXN4JLE.js → chunk-5IFNLTOF.js} +4 -4
- package/dist/{chunk-W3KHJNSH.js → chunk-6CHUZ2NF.js} +2 -2
- package/dist/{chunk-I3NTAIMF.js → chunk-6DBBXNEG.js} +3 -3
- package/dist/{chunk-GDQQNPBP.js → chunk-6GXIGN5W.js} +1 -1
- package/dist/{chunk-QLRTQHTR.js → chunk-6JGRNES6.js} +2 -2
- package/dist/{chunk-WOBNOBB5.js → chunk-7BHMBWG2.js} +3 -3
- package/dist/{chunk-KO64OFSG.js → chunk-7C6T7RKJ.js} +1 -1
- package/dist/{chunk-RFSSKGCE.js → chunk-7R4YXN7Z.js} +176 -37
- package/dist/{chunk-LDABZV5V.js → chunk-7RZE45OT.js} +1 -1
- package/dist/{chunk-MLUIOBKL.js → chunk-7ZMDQZ22.js} +4 -4
- package/dist/{chunk-X7A22JHP.js → chunk-A4H3UTJZ.js} +1 -1
- package/dist/{chunk-QG2FJ3NR.js → chunk-AGI6GFFL.js} +3 -3
- package/dist/{chunk-D3UTL2QX.js → chunk-ATY7WBIT.js} +1 -1
- package/dist/{chunk-ZOSK2UEU.js → chunk-BBK5BA5C.js} +99 -117
- package/dist/{chunk-SRZIA6B4.js → chunk-BNC4F63N.js} +1 -1
- package/dist/{chunk-4E56DWEZ.js → chunk-CJRJR7TP.js} +4 -4
- package/dist/{chunk-SILJJAK2.js → chunk-DIDRFIIW.js} +1 -1
- package/dist/{chunk-HIIYRATQ.js → chunk-EKYXI6C7.js} +11 -7
- package/dist/{chunk-Y5ZV47XC.js → chunk-FGGY5KNM.js} +7 -7
- package/dist/{chunk-APJIC2O5.js → chunk-GTIZNO5O.js} +84 -0
- package/dist/{chunk-UOHZQIVL.js → chunk-GXFYUZAM.js} +1 -1
- package/dist/{chunk-DDXS2RDZ.js → chunk-HGCTHBUY.js} +1 -1
- package/dist/{chunk-QTDGRZMZ.js → chunk-HJOC5WUV.js} +1 -1
- package/dist/{chunk-DYDTLRHB.js → chunk-HPIHFENG.js} +2 -2
- package/dist/{chunk-SYBNJZEL.js → chunk-HPMBSOQ4.js} +1 -1
- package/dist/{chunk-LIPZJNXS.js → chunk-HPQ2IHOW.js} +4 -4
- package/dist/{chunk-KOULRCYJ.js → chunk-HZ5XNKWS.js} +1 -1
- package/dist/{chunk-4K6UB524.js → chunk-IPZZGDUU.js} +1 -1
- package/dist/{chunk-6CI6TKLN.js → chunk-JAVRQ3LM.js} +1 -1
- package/dist/{chunk-VCSRBS47.js → chunk-JLAJZPOC.js} +1 -1
- package/dist/{chunk-UN53MBAR.js → chunk-JY3LI63F.js} +2 -2
- package/dist/{chunk-RMLTVKOY.js → chunk-L4YVE3RG.js} +2 -2
- package/dist/{chunk-P277M7Z5.js → chunk-LBC75QAB.js} +1 -1
- package/dist/{chunk-F6TVBCZV.js → chunk-LWW2IAFC.js} +1 -1
- package/dist/{chunk-L2GU3PWU.js → chunk-NK4NMYF5.js} +49 -7
- package/dist/{chunk-MXPBYB54.js → chunk-O2U4XQVM.js} +2 -2
- package/dist/{chunk-LQTVYUT3.js → chunk-OJTMM5CV.js} +2 -2
- package/dist/{chunk-HW2TBXVK.js → chunk-OPVRII63.js} +1 -1
- package/dist/{chunk-CDVYF7RU.js → chunk-OSFBVVEP.js} +4 -4
- package/dist/{chunk-F43AMWLZ.js → chunk-PDTJVJVD.js} +1 -1
- package/dist/{chunk-UDQT5CWK.js → chunk-PI6T2AGS.js} +1 -1
- package/dist/{chunk-AZU7HXIT.js → chunk-PPUOHBAK.js} +17 -17
- package/dist/{chunk-33E6RDCY.js → chunk-QD4SCW4A.js} +229 -192
- package/dist/{chunk-SOPYWTFV.js → chunk-RRUI3VWQ.js} +1 -1
- package/dist/{chunk-IN42UISW.js → chunk-SRJ4XWOR.js} +10 -5
- package/dist/{chunk-6RJVTUWI.js → chunk-T6UOCF5D.js} +5 -1
- package/dist/{chunk-VTQL23UM.js → chunk-TVNWAEJR.js} +1 -1
- package/dist/chunk-TY4KIVA6.js +50 -0
- package/dist/{chunk-UT2TYK2A.js → chunk-TYTVAFGB.js} +1 -1
- package/dist/{chunk-OMZYPQVA.js → chunk-UGYFQF6M.js} +1 -1
- package/dist/{chunk-VAGL7CNR.js → chunk-UIKN3CDF.js} +4 -4
- package/dist/{chunk-JGDIO2NF.js → chunk-UO3KYTBU.js} +1 -1
- package/dist/{chunk-KI7C6ZOD.js → chunk-VIJ7GDKI.js} +1 -1
- package/dist/{chunk-NKFKOEYX.js → chunk-WCMHJ6SS.js} +1 -1
- package/dist/{chunk-EORRZP3F.js → chunk-WX2OTJXL.js} +1 -1
- package/dist/{chunk-BOV4K7FP.js → chunk-WXTHKLNH.js} +9 -1
- package/dist/{chunk-CRQORMFF.js → chunk-X37FSYAX.js} +1 -1
- package/dist/{chunk-XWRHWM4H.js → chunk-X7E34LKV.js} +11 -11
- package/dist/chunk-X7HMDZZQ.js +85 -0
- package/dist/{chunk-CD54BQJ5.js → chunk-YDTJ7UBG.js} +4 -4
- package/dist/{chunk-K56D3X7S.js → chunk-YKOXJQGX.js} +34 -2
- package/dist/{chunk-7TYK55JT.js → chunk-YLOJWSHB.js} +5 -5
- package/dist/{chunk-O6MKVGVK.js → chunk-YMEMN5FG.js} +1 -1
- package/dist/chunk-YQNK7HK3.js +87 -0
- package/dist/{chunk-KJVHLTQR.js → chunk-Z265MCGC.js} +12 -8
- package/dist/{chunk-3BPKJMIV.js → chunk-ZF36LULR.js} +4 -4
- package/dist/{chunk-JJQETFCR.js → chunk-ZJDPYOTK.js} +4 -4
- package/dist/{chunk-RM5QMOFY.js → chunk-ZKPQ4KLK.js} +1 -1
- package/dist/command-panel-runtime.js +31 -31
- package/dist/compact-cache-command-runtime.js +52 -52
- package/dist/compact-preflight-runtime.js +20 -20
- package/dist/connector-runtime.js +33 -33
- package/dist/deep-compact-runtime.js +6 -6
- package/dist/deferred-tools-catalog.js +5 -5
- package/dist/details-status-runtime.js +31 -31
- package/dist/evidence-runtime.d.ts.map +1 -1
- package/dist/evidence-runtime.js +11 -11
- package/dist/extension-command-runtime.js +6 -6
- package/dist/extension-slash-runtime.js +32 -32
- package/dist/failure-learning-command-runtime.js +33 -33
- package/dist/failure-learning-presenter.js +4 -4
- package/dist/failure-learning-runtime.js +3 -3
- package/dist/final-answer-gate.js +2 -2
- package/dist/git-command-runtime.js +32 -32
- package/dist/handoff-session-runtime.js +8 -8
- package/dist/index-result-presenter.js +5 -5
- package/dist/index-runtime.js +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +65 -59
- package/dist/job-agent-command-runtime.js +31 -31
- package/dist/job-runner-presenter.js +3 -3
- package/dist/job-runtime.js +8 -8
- package/dist/mcp-index-command-runtime.js +4 -4
- package/dist/mcp-index-runtime.js +36 -36
- package/dist/mcp-sse-runtime.js +3 -3
- package/dist/mcp-stdio-runtime.js +3 -3
- package/dist/memory-command-runtime.js +33 -33
- package/dist/memory-extraction-runtime.js +3 -3
- package/dist/memory-rules-runtime.js +3 -3
- package/dist/model-command-runtime.js +32 -32
- package/dist/model-loop-runtime.d.ts +1 -1
- package/dist/model-loop-runtime.d.ts.map +1 -1
- package/dist/model-loop-runtime.js +1 -1
- package/dist/model-prompt-runtime.js +10 -10
- package/dist/model-stream-runtime.js +52 -52
- package/dist/model-tool-runtime.d.ts +1 -0
- package/dist/model-tool-runtime.d.ts.map +1 -1
- package/dist/model-tool-runtime.js +54 -52
- package/dist/pending-details-presenter.js +3 -3
- package/dist/permission-approval-runtime.js +52 -52
- package/dist/permission-continuation-runtime.d.ts.map +1 -1
- package/dist/permission-continuation-runtime.js +4 -4
- package/dist/process-command-runtime.js +3 -3
- package/dist/provider-loop-runtime.js +3 -3
- package/dist/remote-command-runtime.js +32 -32
- package/dist/runner-runtime.js +7 -7
- package/dist/runtime-status-presenter.js +3 -3
- package/dist/runtime-status-snapshot.js +4 -4
- package/dist/shell/components/AgentProgressTree.js +2 -2
- package/dist/shell/components/BackgroundTaskOverlay.js +2 -2
- package/dist/shell/components/BtwPanel.js +2 -2
- package/dist/shell/components/CommandPanel.js +2 -2
- package/dist/shell/components/Composer.d.ts +16 -2
- package/dist/shell/components/Composer.d.ts.map +1 -1
- package/dist/shell/components/Composer.js +9 -7
- package/dist/shell/components/ConfigPanel.js +2 -2
- package/dist/shell/components/HelpPanel.js +2 -2
- package/dist/shell/components/HistorySearchPanel.js +2 -2
- package/dist/shell/components/MessageMarkdown.d.ts +23 -0
- package/dist/shell/components/MessageMarkdown.d.ts.map +1 -1
- package/dist/shell/components/MessageMarkdown.js +5 -3
- package/dist/shell/components/MouseInputRouter.js +5 -80
- package/dist/shell/components/OutputLine.d.ts.map +1 -1
- package/dist/shell/components/OutputLine.js +5 -3
- package/dist/shell/components/ProductBlock.d.ts.map +1 -1
- package/dist/shell/components/ProductBlock.js +4 -4
- package/dist/shell/components/ScrollViewport.js +3 -82
- package/dist/shell/components/SessionsPanel.js +2 -2
- package/dist/shell/components/ShellApp.d.ts.map +1 -1
- package/dist/shell/components/ShellApp.js +28 -23
- package/dist/shell/components/SlashSuggestions.js +2 -2
- package/dist/shell/components/StatusFooter.js +2 -2
- package/dist/shell/components/StatusTray.d.ts.map +1 -1
- package/dist/shell/components/StatusTray.js +2 -1
- package/dist/shell/components/StructuredDiff.js +2 -2
- package/dist/shell/components/TaskListView.js +2 -2
- package/dist/shell/components/TaskSuggestionBar.js +2 -2
- package/dist/shell/components/WorkflowProgressView.js +2 -2
- package/dist/shell/components/useAnchoredCursor.d.ts +6 -9
- package/dist/shell/components/useAnchoredCursor.d.ts.map +1 -1
- package/dist/shell/components/useAnchoredCursor.js +1 -1
- package/dist/shell/ink-renderer.d.ts.map +1 -1
- package/dist/shell/ink-renderer.js +28 -23
- package/dist/shell/models/transcript-selection-state.js +2 -2
- package/dist/shell/plain-renderer.d.ts.map +1 -1
- package/dist/shell/plain-renderer.js +2 -2
- package/dist/shell/text-utils.d.ts +16 -0
- package/dist/shell/text-utils.d.ts.map +1 -1
- package/dist/shell/text-utils.js +3 -1
- package/dist/shell/view-model.js +14 -14
- package/dist/slash-command-runtime.js +52 -52
- package/dist/slash-dispatch.js +4 -4
- package/dist/startup-runtime.js +2 -2
- package/dist/tool-output-presenter.d.ts.map +1 -1
- package/dist/tool-output-presenter.js +1 -1
- package/dist/tui-agent-job-runtime.js +10 -10
- package/dist/tui-details-runtime.js +9 -9
- package/dist/tui-memory-runtime.js +5 -5
- package/dist/tui-output-surface.js +15 -15
- package/dist/tui-permission-runtime.js +5 -5
- package/dist/tui-state-runtime.js +4 -4
- package/dist/verification-command-runtime.js +11 -11
- package/dist/workflow-command-runtime.js +31 -31
- package/package.json +4 -4
- package/dist/chunk-GW5YDCRZ.js +0 -42
|
@@ -5,6 +5,14 @@ type ComposerProps = {
|
|
|
5
5
|
view: ShellViewModel;
|
|
6
6
|
onInput: (event: ShellInputEvent) => void | Promise<void>;
|
|
7
7
|
capability: TerminalCapability;
|
|
8
|
+
layout?: ComposerLayout;
|
|
9
|
+
};
|
|
10
|
+
export type ComposerLayout = {
|
|
11
|
+
width: number;
|
|
12
|
+
paddingLeft: number;
|
|
13
|
+
paddingRight: number;
|
|
14
|
+
prefixWidth: number;
|
|
15
|
+
minContentWidth: number;
|
|
8
16
|
};
|
|
9
17
|
export type EditBuffer = {
|
|
10
18
|
/** Characters stored as an array (supports CJK/emoji correctly). */
|
|
@@ -48,6 +56,7 @@ export declare function bufferMoveVisualUp(buf: EditBuffer, maxWidth?: number):
|
|
|
48
56
|
/** Move cursor down one soft-wrapped visual row, preserving display column. */
|
|
49
57
|
export declare function bufferMoveVisualDown(buf: EditBuffer, maxWidth?: number): EditBuffer;
|
|
50
58
|
export declare function sanitizeComposerInput(value: string): string;
|
|
59
|
+
export declare function sanitizeComposerPasteInput(value: string): string;
|
|
51
60
|
export type InputHistory = {
|
|
52
61
|
entries: string[];
|
|
53
62
|
position: number;
|
|
@@ -110,20 +119,25 @@ export declare function isDoublePressWithin(lastPressAt: number, now: number, wi
|
|
|
110
119
|
export declare function shouldUnstickSlashHidden(prevHead: string, nextText: string, nextHead: string): boolean;
|
|
111
120
|
export declare function isMultilineEnterSequence(input: string): boolean;
|
|
112
121
|
export declare const OWNER_PASTE_THRESHOLD = 16;
|
|
113
|
-
export declare function Composer({ view, onInput, capability }: ComposerProps): React.ReactNode;
|
|
122
|
+
export declare function Composer({ view, onInput, capability, layout }: ComposerProps): React.ReactNode;
|
|
114
123
|
export type ComposerRenderResult = {
|
|
115
124
|
lines: string[];
|
|
125
|
+
visualLines: Array<{
|
|
126
|
+
prefix: string;
|
|
127
|
+
text: string;
|
|
128
|
+
}>;
|
|
116
129
|
truncatedAbove: number;
|
|
117
130
|
truncatedBelow: number;
|
|
118
131
|
cursorCol: number;
|
|
119
132
|
cursorRow: number;
|
|
120
133
|
};
|
|
121
|
-
export declare function formatComposerRenderLines({ buffer, placeholder, masking, noColor, maxWidth, }: {
|
|
134
|
+
export declare function formatComposerRenderLines({ buffer, placeholder, masking, noColor, maxWidth, layout, }: {
|
|
122
135
|
buffer: EditBuffer;
|
|
123
136
|
placeholder: string;
|
|
124
137
|
masking: boolean;
|
|
125
138
|
noColor: boolean;
|
|
126
139
|
maxWidth?: number;
|
|
140
|
+
layout?: ComposerLayout;
|
|
127
141
|
}): ComposerRenderResult;
|
|
128
142
|
/**
|
|
129
143
|
* Split a rendered composer line at a target display column for inline cursor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Composer.d.ts","sourceRoot":"","sources":["../../../src/shell/components/Composer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiB/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAIpE,OAAO,KAAK,EAGV,eAAe,EACf,cAAc,EAEf,MAAM,aAAa,CAAC;AAIrB,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,UAAU,EAAE,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"Composer.d.ts","sourceRoot":"","sources":["../../../src/shell/components/Composer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiB/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAIpE,OAAO,KAAK,EAGV,eAAe,EACf,cAAc,EAEf,MAAM,aAAa,CAAC;AAIrB,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,UAAU,EAAE,kBAAkB,CAAC;IAC/B,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,C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;CAAE,GAC1D;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEvB;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,WAAW,GACf,gBAAgB,CAiClB"}
|
|
@@ -34,27 +34,28 @@ import {
|
|
|
34
34
|
isNavigationKey,
|
|
35
35
|
isVerticalNavigationKey,
|
|
36
36
|
sanitizeComposerInput,
|
|
37
|
+
sanitizeComposerPasteInput,
|
|
37
38
|
selectInputOwner,
|
|
38
39
|
shouldEnterPastePath,
|
|
39
40
|
shouldOwnerBePaste,
|
|
40
41
|
shouldUnstickSlashHidden,
|
|
41
42
|
splitLineAtDisplayCol
|
|
42
|
-
} from "../../chunk-
|
|
43
|
+
} from "../../chunk-BBK5BA5C.js";
|
|
43
44
|
import "../../chunk-JBLVBO3U.js";
|
|
44
|
-
import "../../chunk-
|
|
45
|
-
import "../../chunk-
|
|
45
|
+
import "../../chunk-TY4KIVA6.js";
|
|
46
|
+
import "../../chunk-OPVRII63.js";
|
|
46
47
|
import "../../chunk-F46N43MG.js";
|
|
47
48
|
import "../../chunk-P4CPRJLI.js";
|
|
48
49
|
import "../../chunk-YPQFSFYK.js";
|
|
49
50
|
import "../../chunk-TFZEFIQT.js";
|
|
50
51
|
import "../../chunk-GC55DMZV.js";
|
|
51
|
-
import "../../chunk-
|
|
52
|
-
import "../../chunk-
|
|
52
|
+
import "../../chunk-IPZZGDUU.js";
|
|
53
|
+
import "../../chunk-VIJ7GDKI.js";
|
|
53
54
|
import "../../chunk-PGNALDEH.js";
|
|
54
55
|
import "../../chunk-6SMM5CMP.js";
|
|
55
56
|
import "../../chunk-K4FSYBSY.js";
|
|
56
|
-
import "../../chunk-
|
|
57
|
-
import "../../chunk-
|
|
57
|
+
import "../../chunk-UGYFQF6M.js";
|
|
58
|
+
import "../../chunk-GTIZNO5O.js";
|
|
58
59
|
export {
|
|
59
60
|
Composer,
|
|
60
61
|
OWNER_PASTE_THRESHOLD,
|
|
@@ -91,6 +92,7 @@ export {
|
|
|
91
92
|
isNavigationKey,
|
|
92
93
|
isVerticalNavigationKey,
|
|
93
94
|
sanitizeComposerInput,
|
|
95
|
+
sanitizeComposerPasteInput,
|
|
94
96
|
selectInputOwner,
|
|
95
97
|
shouldEnterPastePath,
|
|
96
98
|
shouldOwnerBePaste,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "../../chunk-GC55DMZV.js";
|
|
4
4
|
import {
|
|
5
5
|
fitText
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-GTIZNO5O.js";
|
|
7
7
|
|
|
8
8
|
// src/shell/components/HistorySearchPanel.tsx
|
|
9
9
|
import { Box, Text } from "@linghun/ink-runtime";
|
|
@@ -47,7 +47,7 @@ function HistorySearchPanel({
|
|
|
47
47
|
children: [
|
|
48
48
|
/* @__PURE__ */ jsxs(Text, { children: [
|
|
49
49
|
/* @__PURE__ */ jsx(Text, { color: theme.accent, bold: true, children: hint.prefix }),
|
|
50
|
-
/* @__PURE__ */ jsx(Text, { children: query || "" })
|
|
50
|
+
/* @__PURE__ */ jsx(Text, { children: fitText(query || "", Math.max(8, innerWidth - hint.prefix.length)) })
|
|
51
51
|
] }),
|
|
52
52
|
visible.length === 0 ? /* @__PURE__ */ jsx(Text, { color: theme.dim ?? theme.muted, dimColor: true, children: hint.empty }) : visible.map((entry, idx) => {
|
|
53
53
|
const active = idx === cursor;
|
|
@@ -15,11 +15,34 @@ export type MessageMarkdownProps = {
|
|
|
15
15
|
selectionLineRanges?: ProductBlockSelectionRange[];
|
|
16
16
|
isStreaming?: boolean;
|
|
17
17
|
};
|
|
18
|
+
type InlineToken = {
|
|
19
|
+
kind: "text";
|
|
20
|
+
value: string;
|
|
21
|
+
} | {
|
|
22
|
+
kind: "code";
|
|
23
|
+
value: string;
|
|
24
|
+
} | {
|
|
25
|
+
kind: "bold";
|
|
26
|
+
value: string;
|
|
27
|
+
} | {
|
|
28
|
+
kind: "italic";
|
|
29
|
+
value: string;
|
|
30
|
+
} | {
|
|
31
|
+
kind: "link";
|
|
32
|
+
value: string;
|
|
33
|
+
href: string;
|
|
34
|
+
};
|
|
18
35
|
type MarkdownRenderSegment = {
|
|
19
36
|
kind: "markdown" | "diff";
|
|
20
37
|
text: string;
|
|
21
38
|
};
|
|
22
39
|
export declare function __testSplitRawDiffSections(text: string): MarkdownRenderSegment[];
|
|
40
|
+
export declare function __testWrapInlineMarkdownRows(value: string, wrapWidth: number): Array<Array<{
|
|
41
|
+
kind: InlineToken["kind"];
|
|
42
|
+
value: string;
|
|
43
|
+
sourceStart: number;
|
|
44
|
+
sourceEnd: number;
|
|
45
|
+
}>>;
|
|
23
46
|
export declare function MessageMarkdown({ text, theme, dim, tone, wrapWidth, selectionLineIndexes, selectionLineRanges, isStreaming, }: MessageMarkdownProps): React.ReactNode;
|
|
24
47
|
export type StreamingMarkdownState = {
|
|
25
48
|
stablePrefix: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageMarkdown.d.ts","sourceRoot":"","sources":["../../../src/shell/components/MessageMarkdown.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAK9D,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,GAAG,KAAK,CAAC,SAAS,CAElB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,GAAG,OA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3,16 +3,18 @@ import {
|
|
|
3
3
|
MessageResponseProvider,
|
|
4
4
|
StreamingMarkdown,
|
|
5
5
|
__testSplitRawDiffSections,
|
|
6
|
+
__testWrapInlineMarkdownRows,
|
|
6
7
|
splitStreamingMarkdownForRender,
|
|
7
8
|
useInMessageResponse
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
9
|
+
} from "../../chunk-4BFCUJX6.js";
|
|
10
|
+
import "../../chunk-PDTJVJVD.js";
|
|
11
|
+
import "../../chunk-GTIZNO5O.js";
|
|
11
12
|
export {
|
|
12
13
|
MessageMarkdown,
|
|
13
14
|
MessageResponseProvider,
|
|
14
15
|
StreamingMarkdown,
|
|
15
16
|
__testSplitRawDiffSections,
|
|
17
|
+
__testWrapInlineMarkdownRows,
|
|
16
18
|
splitStreamingMarkdownForRender,
|
|
17
19
|
useInMessageResponse
|
|
18
20
|
};
|
|
@@ -1,84 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
isXtermJsTerminal
|
|
9
|
-
} from "../../chunk-DICVLZHH.js";
|
|
10
|
-
|
|
11
|
-
// src/shell/components/MouseInputRouter.tsx
|
|
12
|
-
import {
|
|
13
|
-
useWheelInput,
|
|
14
|
-
useMouseInput,
|
|
15
|
-
useTerminalInput
|
|
16
|
-
} from "@linghun/ink-runtime";
|
|
17
|
-
import { useCallback, useMemo, useRef } from "react";
|
|
18
|
-
function MouseInputRouter({
|
|
19
|
-
active,
|
|
20
|
-
scroll,
|
|
21
|
-
selectionActive = true,
|
|
22
|
-
onInput
|
|
23
|
-
}) {
|
|
24
|
-
const accelerator = useMemo(() => {
|
|
25
|
-
const base = Number.parseInt(process.env.LINGHUN_SCROLL_SPEED ?? "1", 10) || 1;
|
|
26
|
-
const terminalType = isXtermJsTerminal() ? "xterm.js" : "native";
|
|
27
|
-
return new WheelAccelerator({ base, terminalType });
|
|
28
|
-
}, []);
|
|
29
|
-
const scrollRef = useRef(scroll);
|
|
30
|
-
scrollRef.current = scroll;
|
|
31
|
-
const dispatchScroll = useCallback(
|
|
32
|
-
(delta) => {
|
|
33
|
-
onInput({ type: "transcript-scroll", delta });
|
|
34
|
-
},
|
|
35
|
-
[onInput]
|
|
36
|
-
);
|
|
37
|
-
const accumulateScroll = useScrollRuntime(dispatchScroll);
|
|
38
|
-
useWheelInput(
|
|
39
|
-
useCallback(
|
|
40
|
-
(event) => {
|
|
41
|
-
const step = accelerator.recordEvent(Date.now(), event.direction, scrollRef.current?.viewportHeight);
|
|
42
|
-
if (step !== 0) {
|
|
43
|
-
accumulateScroll(event.direction === "up" ? step : -step);
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
[accelerator, accumulateScroll]
|
|
47
|
-
),
|
|
48
|
-
{ isActive: active }
|
|
49
|
-
);
|
|
50
|
-
useMouseInput(
|
|
51
|
-
useCallback(
|
|
52
|
-
(event) => {
|
|
53
|
-
if (!selectionActive) return;
|
|
54
|
-
onInput({
|
|
55
|
-
type: "transcript-mouse",
|
|
56
|
-
event: {
|
|
57
|
-
x: Math.max(0, event.x - 1),
|
|
58
|
-
y: Math.max(0, event.y - 1),
|
|
59
|
-
button: event.button === 0 || event.button === 3 ? "left" : "other",
|
|
60
|
-
action: event.action === "press" ? "down" : event.action === "release" ? "up" : event.action
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
[onInput, selectionActive]
|
|
65
|
-
),
|
|
66
|
-
{ isActive: active }
|
|
67
|
-
);
|
|
68
|
-
useTerminalInput(
|
|
69
|
-
useCallback(
|
|
70
|
-
(event) => {
|
|
71
|
-
if (event.kind !== "terminal-response") return;
|
|
72
|
-
if (event.response !== "\x1B[O") return;
|
|
73
|
-
if (!selectionActive) return;
|
|
74
|
-
onInput({ type: "transcript-mouse", event: { x: 0, y: 0, button: "left", action: "focus-out" } });
|
|
75
|
-
},
|
|
76
|
-
[onInput, selectionActive]
|
|
77
|
-
),
|
|
78
|
-
{ isActive: active }
|
|
79
|
-
);
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
2
|
+
MouseInputRouter
|
|
3
|
+
} from "../../chunk-X7HMDZZQ.js";
|
|
4
|
+
import "../../chunk-PGWW3DVE.js";
|
|
5
|
+
import "../../chunk-LL7LBRDL.js";
|
|
6
|
+
import "../../chunk-DICVLZHH.js";
|
|
82
7
|
export {
|
|
83
8
|
MouseInputRouter
|
|
84
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutputLine.d.ts","sourceRoot":"","sources":["../../../src/shell/components/OutputLine.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"OutputLine.d.ts","sourceRoot":"","sources":["../../../src/shell/components/OutputLine.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9C,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,UAAU,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CAC9B,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,OAAO,EACP,OAAO,EACP,SAAS,EACT,WAAkB,EAClB,KAAK,EACL,aAAa,EACb,QAAkB,GACnB,EAAE,eAAe,GAAG,KAAK,CAAC,SAAS,CA8BnC"}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
import { Box, Text } from "@linghun/ink-runtime";
|
|
11
11
|
import { useMemo } from "react";
|
|
12
12
|
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
var OUTPUT_LINE_PADDING_LEFT = 2;
|
|
13
14
|
function OutputLine({
|
|
14
15
|
content,
|
|
15
16
|
verbose,
|
|
@@ -20,18 +21,19 @@ function OutputLine({
|
|
|
20
21
|
terminalWidth,
|
|
21
22
|
language = "zh-CN"
|
|
22
23
|
}) {
|
|
24
|
+
const contentWidth = Math.max(8, terminalWidth - OUTPUT_LINE_PADDING_LEFT);
|
|
23
25
|
const formattedContent = useMemo(() => {
|
|
24
26
|
let formatted = tryJsonFormatContent(content);
|
|
25
27
|
if (linkifyUrls) {
|
|
26
28
|
formatted = linkifyUrlsInText(formatted);
|
|
27
29
|
}
|
|
28
30
|
if (!verbose) {
|
|
29
|
-
formatted = renderTruncatedContent(formatted,
|
|
31
|
+
formatted = renderTruncatedContent(formatted, contentWidth, language);
|
|
30
32
|
}
|
|
31
33
|
return formatted;
|
|
32
|
-
}, [content, verbose, linkifyUrls,
|
|
34
|
+
}, [content, verbose, linkifyUrls, contentWidth, language]);
|
|
33
35
|
const color = isError ? theme.error : isWarning ? theme.warning : void 0;
|
|
34
|
-
return /* @__PURE__ */ jsx(Box, { paddingLeft:
|
|
36
|
+
return /* @__PURE__ */ jsx(Box, { paddingLeft: OUTPUT_LINE_PADDING_LEFT, children: /* @__PURE__ */ jsx(Text, { color, children: formattedContent }) });
|
|
35
37
|
}
|
|
36
38
|
export {
|
|
37
39
|
OutputLine
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductBlock.d.ts","sourceRoot":"","sources":["../../../src/shell/components/ProductBlock.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAoB,qBAAqB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductBlock.d.ts","sourceRoot":"","sources":["../../../src/shell/components/ProductBlock.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAoB,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAoE3E,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,KAAK,EACL,QAAkB,GACnB,EAAE;IACD,KAAK,EAAE,qBAAqB,CAAC;IAC7B,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CAC9B,GAAG,KAAK,CAAC,SAAS,CAuPlB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ProductBlock
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-Z265MCGC.js";
|
|
4
4
|
import "../../chunk-MOJL4X4L.js";
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-4BFCUJX6.js";
|
|
6
|
+
import "../../chunk-PDTJVJVD.js";
|
|
7
7
|
import "../../chunk-L5GOCMZP.js";
|
|
8
8
|
import "../../chunk-GC55DMZV.js";
|
|
9
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-GTIZNO5O.js";
|
|
10
10
|
export {
|
|
11
11
|
ProductBlock
|
|
12
12
|
};
|
|
@@ -1,86 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
|
|
5
|
-
// src/shell/components/ScrollViewport.tsx
|
|
6
|
-
import { Box } from "@linghun/ink-runtime";
|
|
7
|
-
import { useEffect, useRef, useState } from "react";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
function TranscriptViewport({
|
|
10
|
-
scroll,
|
|
11
|
-
virtualRange,
|
|
12
|
-
onOverflowChange,
|
|
13
|
-
onMeasure,
|
|
14
|
-
onGeometry,
|
|
15
|
-
children
|
|
16
|
-
}) {
|
|
17
|
-
const viewportRef = useRef(null);
|
|
18
|
-
const contentRef = useRef(null);
|
|
19
|
-
const [maxOffset, setMaxOffset] = useState(0);
|
|
20
|
-
const maxOffsetRef = useRef(0);
|
|
21
|
-
const lastReportedOverflow = useRef(void 0);
|
|
22
|
-
const lastReportedMeasure = useRef(void 0);
|
|
23
|
-
const lastReportedGeometry = useRef(void 0);
|
|
24
|
-
const lastDimKey = useRef("");
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
const viewportNode = viewportRef.current?.yogaNode;
|
|
27
|
-
const contentNode = contentRef.current?.yogaNode;
|
|
28
|
-
if (!viewportNode || !contentNode) return;
|
|
29
|
-
const viewportHeight = viewportNode.getComputedHeight();
|
|
30
|
-
const viewportWidth = viewportNode.getComputedWidth();
|
|
31
|
-
const measuredContentHeight = contentNode.getComputedHeight();
|
|
32
|
-
const contentHeight = virtualRange?.estimatedContentHeight ?? measuredContentHeight;
|
|
33
|
-
const dimKey = `${viewportHeight}:${contentHeight}`;
|
|
34
|
-
if (dimKey === lastDimKey.current) return;
|
|
35
|
-
lastDimKey.current = dimKey;
|
|
36
|
-
const nextMax = Math.max(0, Math.floor(contentHeight - viewportHeight));
|
|
37
|
-
const nextOffset = computeScrollViewportOffset(nextMax, scroll);
|
|
38
|
-
const measureKey = `${viewportHeight}:${contentHeight}`;
|
|
39
|
-
if (onMeasure && lastReportedMeasure.current !== measureKey) {
|
|
40
|
-
lastReportedMeasure.current = measureKey;
|
|
41
|
-
onMeasure({ viewportHeight, contentHeight });
|
|
42
|
-
}
|
|
43
|
-
if (onGeometry) {
|
|
44
|
-
const origin = computeAbsolutePosition(viewportRef.current);
|
|
45
|
-
const geometry = {
|
|
46
|
-
x: Math.floor(origin.x),
|
|
47
|
-
y: Math.floor(origin.y),
|
|
48
|
-
width: Math.floor(viewportWidth),
|
|
49
|
-
height: Math.floor(viewportHeight),
|
|
50
|
-
contentHeight: Math.floor(contentHeight),
|
|
51
|
-
topOffset: nextOffset.topOffset
|
|
52
|
-
};
|
|
53
|
-
const geometryKey = `${geometry.x}:${geometry.y}:${geometry.width}:${geometry.height}:${geometry.contentHeight}:${geometry.topOffset}`;
|
|
54
|
-
if (lastReportedGeometry.current !== geometryKey) {
|
|
55
|
-
lastReportedGeometry.current = geometryKey;
|
|
56
|
-
onGeometry(geometry);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
if (maxOffsetRef.current !== nextMax) {
|
|
60
|
-
maxOffsetRef.current = nextMax;
|
|
61
|
-
setMaxOffset(nextMax);
|
|
62
|
-
}
|
|
63
|
-
const hasOverflow = nextMax > 0;
|
|
64
|
-
if (onOverflowChange && lastReportedOverflow.current !== hasOverflow) {
|
|
65
|
-
lastReportedOverflow.current = hasOverflow;
|
|
66
|
-
onOverflowChange(hasOverflow);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
const { marginTop } = computeScrollViewportOffset(maxOffset, scroll);
|
|
70
|
-
const contentMarginTop = virtualRange && virtualRange.estimatedContentHeight > 0 ? marginTop + virtualRange.topSpacer : marginTop;
|
|
71
|
-
return /* @__PURE__ */ jsx(Box, { ref: viewportRef, flexDirection: "column", flexGrow: 1, minHeight: 0, overflow: "hidden", children: /* @__PURE__ */ jsx(Box, { ref: contentRef, flexDirection: "column", flexShrink: 0, marginTop: contentMarginTop, children }) });
|
|
72
|
-
}
|
|
73
|
-
function computeAbsolutePosition(node) {
|
|
74
|
-
let current = node ?? void 0;
|
|
75
|
-
let x = 0;
|
|
76
|
-
let y = 0;
|
|
77
|
-
while (current?.yogaNode) {
|
|
78
|
-
x += current.yogaNode.getComputedLeft();
|
|
79
|
-
y += current.yogaNode.getComputedTop();
|
|
80
|
-
current = current.parentNode;
|
|
81
|
-
}
|
|
82
|
-
return { x, y };
|
|
83
|
-
}
|
|
2
|
+
TranscriptViewport
|
|
3
|
+
} from "../../chunk-YQNK7HK3.js";
|
|
4
|
+
import "../../chunk-JPXSFZFC.js";
|
|
84
5
|
export {
|
|
85
6
|
TranscriptViewport
|
|
86
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShellApp.d.ts","sourceRoot":"","sources":["../../../src/shell/components/ShellApp.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,OAAO,KAAK,EAAE,eAAe,EAAoC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ShellApp.d.ts","sourceRoot":"","sources":["../../../src/shell/components/ShellApp.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,OAAO,KAAK,EAAE,eAAe,EAAoC,MAAM,aAAa,CAAC;AAqBrF,wBAAgB,QAAQ,CAAC,EACvB,UAAU,EACV,UAAU,GACX,EAAE;IACD,UAAU,EAAE,eAAe,CAAC;IAC5B,UAAU,EAAE,kBAAkB,CAAC;CAChC,GAAG,KAAK,CAAC,SAAS,CAoElB"}
|
|
@@ -1,45 +1,50 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ShellApp
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-QD4SCW4A.js";
|
|
4
|
+
import "../../chunk-RRUI3VWQ.js";
|
|
5
|
+
import "../../chunk-T6UOCF5D.js";
|
|
6
|
+
import "../../chunk-UO3KYTBU.js";
|
|
7
|
+
import "../../chunk-X37FSYAX.js";
|
|
8
8
|
import "../../chunk-SQIBPLLV.js";
|
|
9
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-7C6T7RKJ.js";
|
|
10
10
|
import "../../chunk-JLCPHVBN.js";
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-Z265MCGC.js";
|
|
12
|
+
import "../../chunk-YQNK7HK3.js";
|
|
13
|
+
import "../../chunk-4QWCNMP6.js";
|
|
14
|
+
import "../../chunk-BBK5BA5C.js";
|
|
14
15
|
import "../../chunk-JBLVBO3U.js";
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
16
|
+
import "../../chunk-TY4KIVA6.js";
|
|
17
|
+
import "../../chunk-OPVRII63.js";
|
|
18
|
+
import "../../chunk-JLAJZPOC.js";
|
|
18
19
|
import "../../chunk-MOJL4X4L.js";
|
|
19
|
-
import "../../chunk-
|
|
20
|
-
import "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
20
|
+
import "../../chunk-ATY7WBIT.js";
|
|
21
|
+
import "../../chunk-4BFCUJX6.js";
|
|
22
|
+
import "../../chunk-PDTJVJVD.js";
|
|
22
23
|
import "../../chunk-L5GOCMZP.js";
|
|
23
|
-
import "../../chunk-
|
|
24
|
-
import "../../chunk-
|
|
25
|
-
import "../../chunk-
|
|
26
|
-
import "../../chunk-
|
|
24
|
+
import "../../chunk-X7HMDZZQ.js";
|
|
25
|
+
import "../../chunk-PGWW3DVE.js";
|
|
26
|
+
import "../../chunk-LL7LBRDL.js";
|
|
27
|
+
import "../../chunk-36ZWUJQS.js";
|
|
28
|
+
import "../../chunk-JAVRQ3LM.js";
|
|
29
|
+
import "../../chunk-LWW2IAFC.js";
|
|
30
|
+
import "../../chunk-GXFYUZAM.js";
|
|
27
31
|
import "../../chunk-F46N43MG.js";
|
|
28
32
|
import "../../chunk-CFMSB6ST.js";
|
|
29
33
|
import "../../chunk-XFPNU42I.js";
|
|
30
34
|
import "../../chunk-P4CPRJLI.js";
|
|
31
35
|
import "../../chunk-YPQFSFYK.js";
|
|
36
|
+
import "../../chunk-JPXSFZFC.js";
|
|
32
37
|
import "../../chunk-TFZEFIQT.js";
|
|
33
38
|
import "../../chunk-GC55DMZV.js";
|
|
34
39
|
import "../../chunk-DICVLZHH.js";
|
|
35
|
-
import "../../chunk-
|
|
40
|
+
import "../../chunk-IPZZGDUU.js";
|
|
36
41
|
import "../../chunk-RBOQJFIZ.js";
|
|
37
|
-
import "../../chunk-
|
|
42
|
+
import "../../chunk-VIJ7GDKI.js";
|
|
38
43
|
import "../../chunk-PGNALDEH.js";
|
|
39
44
|
import "../../chunk-6SMM5CMP.js";
|
|
40
45
|
import "../../chunk-K4FSYBSY.js";
|
|
41
|
-
import "../../chunk-
|
|
42
|
-
import "../../chunk-
|
|
46
|
+
import "../../chunk-UGYFQF6M.js";
|
|
47
|
+
import "../../chunk-GTIZNO5O.js";
|
|
43
48
|
export {
|
|
44
49
|
ShellApp
|
|
45
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusTray.d.ts","sourceRoot":"","sources":["../../../src/shell/components/StatusTray.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"StatusTray.d.ts","sourceRoot":"","sources":["../../../src/shell/components/StatusTray.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,KAAK,EACL,KAAK,GACN,EAAE;IACD,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,KAAK,CAAC,SAAS,CAYlB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TaskListView
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-UO3KYTBU.js";
|
|
4
4
|
import "../../chunk-GC55DMZV.js";
|
|
5
5
|
import "../../chunk-RBOQJFIZ.js";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-GTIZNO5O.js";
|
|
7
7
|
export {
|
|
8
8
|
TaskListView
|
|
9
9
|
};
|