@narumitw/pi-ticker 0.1.6 → 0.1.7
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/CHANGELOG.md +61 -0
- package/dist/chunks/{menu-SMXTISJV.ts → menu-VSY7RYVT.ts} +2 -2
- package/dist/chunks/{tui-menu-644RY6QY.ts → tui-menu-VZ5W77VI.ts} +2 -1
- package/dist/chunks/{tui-menu-644RY6QY.ts.map → tui-menu-VZ5W77VI.ts.map} +2 -2
- package/dist/index.ts +1 -1
- package/package.json +5 -4
- package/src/tui-menu.ts +1 -0
- /package/dist/chunks/{menu-SMXTISJV.ts.map → menu-VSY7RYVT.ts.map} +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# @narumitw/pi-ticker
|
|
2
|
+
|
|
3
|
+
## 0.1.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 54f2700: Preserve fullscreen viewport capture through custom list wrappers so default and configured paging keys reach the focused list. Keep native transcript search, unrelated overlays, free-text modes, paste, and hard cancellation unchanged. Filter Kit key hints according to each screen's capture policy.
|
|
8
|
+
|
|
9
|
+
Update Recall and File Context to the current Kit dependency range. The selected consumer releases require the fixed Kit patch through Changesets dependency-floor updates.
|
|
10
|
+
- e484010: Include the existing package-root CHANGELOG.md in extension tarballs so Pi can show native update notices. Keep Changesets version headings and Pi's first-observation and collapseChangelog behavior unchanged.
|
|
11
|
+
- Updated dependencies [54f2700]
|
|
12
|
+
- Updated dependencies [6c76ef1]
|
|
13
|
+
- @narumitw/pi-tui-kit@0.69.0
|
|
14
|
+
|
|
15
|
+
## 0.1.6
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 9d3e0d7: Unreference passive refresh, debounce, expiry, and background startup timers so they do not keep the host process alive when other work has stopped. Keep normal cancellation and resource cleanup unchanged.
|
|
20
|
+
- Updated dependencies [9d3e0d7]
|
|
21
|
+
- @narumitw/pi-tui-kit@0.68.1
|
|
22
|
+
|
|
23
|
+
## 0.1.5
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [a21d39b]
|
|
28
|
+
- Updated dependencies [f68aa54]
|
|
29
|
+
- Updated dependencies [b062d21]
|
|
30
|
+
- @narumitw/pi-tui-kit@0.68.0
|
|
31
|
+
|
|
32
|
+
## 0.1.4
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- 209ff7a: Use Pi TUI Kit's existing `EditorStatusWidget` for passive editor widgets. Share the muted separator and terminal-width bounds while retaining extension-owned content, refresh scheduling, cleanup, and RPC behavior. Sanitize untrusted display values before styling and wrapping without changing raw payloads.
|
|
37
|
+
|
|
38
|
+
## 0.1.3
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- Updated dependencies [57eeae7]
|
|
43
|
+
- @narumitw/pi-tui-kit@0.67.0
|
|
44
|
+
|
|
45
|
+
## 0.1.2
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- 168248c: Reuse published TUI Kit frame metadata, masked input, configured-key syntax, and interaction ownership while retaining extension-owned settings and cancellation policy. Keep malformed Ticker key strings from suppressing valid reorder shortcuts, and drain Usage settings saves after cancellation.
|
|
50
|
+
|
|
51
|
+
## 0.1.1
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- 8abd5b7: Keep generated extension runtime graphs inside Pi's Jiti-loaded TypeScript path to avoid duplicate peer-runtime evaluation during startup. Add measured generated runtimes for Context Management, Herdr, and TypeSafe Search.
|
|
56
|
+
|
|
57
|
+
## 0.1.0
|
|
58
|
+
|
|
59
|
+
### Minor Changes
|
|
60
|
+
|
|
61
|
+
- ffa69a7: Add the Ticker extension for configurable Yahoo Finance quotes above Pi's editor.
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
async function showTickerMenu(ctx, options) {
|
|
9
9
|
if (options.signal.aborted || !options.isCurrent()) return;
|
|
10
10
|
if (ctx.mode === "tui") {
|
|
11
|
-
const { showTickerTuiMenu } = await import("./tui-menu-
|
|
11
|
+
const { showTickerTuiMenu } = await import("./tui-menu-VZ5W77VI.ts");
|
|
12
12
|
if (options.signal.aborted || !options.isCurrent()) return;
|
|
13
13
|
await showTickerTuiMenu(ctx, options);
|
|
14
14
|
return;
|
|
@@ -202,4 +202,4 @@ function orderedSymbols(selected, candidates) {
|
|
|
202
202
|
export {
|
|
203
203
|
showTickerMenu
|
|
204
204
|
};
|
|
205
|
-
//# sourceMappingURL=menu-
|
|
205
|
+
//# sourceMappingURL=menu-VSY7RYVT.ts.map
|
|
@@ -251,6 +251,7 @@ async function showTickerTuiMenu(ctx, options) {
|
|
|
251
251
|
rebuild(previousId, 0);
|
|
252
252
|
};
|
|
253
253
|
return {
|
|
254
|
+
capturesViewportInput: true,
|
|
254
255
|
render(width) {
|
|
255
256
|
const safeWidth = Number.isFinite(width) ? Math.max(0, Math.floor(width)) : 0;
|
|
256
257
|
if (safeWidth === 0) return [""];
|
|
@@ -408,4 +409,4 @@ function shortcutAvailable(keybindings, shortcut, canonicalKey) {
|
|
|
408
409
|
export {
|
|
409
410
|
showTickerTuiMenu
|
|
410
411
|
};
|
|
411
|
-
//# sourceMappingURL=tui-menu-
|
|
412
|
+
//# sourceMappingURL=tui-menu-VZ5W77VI.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/tui-menu.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ExtensionCommandContext } from \"@earendil-works/pi-coding-agent\";\nimport { fuzzyFilter, Input, Key, matchesKey, truncateToWidth } from \"@earendil-works/pi-tui\";\nimport type { TickerMenuOptions } from \"./menu.js\";\nimport { parseSymbols } from \"./settings.js\";\n\ntype TuiMenuResult = \"add\" | \"close\";\ntype TickerRow = { kind: \"ticker\"; id: string; symbol: string };\ntype ActionRow = {\n kind: \"action\";\n id: \"add\" | \"widget\" | \"refresh\";\n label: string;\n description: string;\n};\ntype Row = TickerRow | ActionRow;\n\nconst PASTE_START = \"\\u001b[200~\";\nconst PASTE_END = \"\\u001b[201~\";\n// Keep these aligned with Input.handleInput so configured editing actions beat additive reorder.\nconst RESERVED_INPUT_BINDINGS = [\n \"tui.select.up\",\n \"tui.select.down\",\n \"tui.select.pageUp\",\n \"tui.select.pageDown\",\n \"tui.select.confirm\",\n \"tui.select.cancel\",\n \"tui.editor.undo\",\n \"tui.input.submit\",\n \"tui.editor.deleteCharBackward\",\n \"tui.editor.deleteCharForward\",\n \"tui.editor.deleteWordBackward\",\n \"tui.editor.deleteWordForward\",\n \"tui.editor.deleteToLineStart\",\n \"tui.editor.deleteToLineEnd\",\n \"tui.editor.yank\",\n \"tui.editor.yankPop\",\n \"tui.editor.cursorLeft\",\n \"tui.editor.cursorRight\",\n \"tui.editor.cursorLineStart\",\n \"tui.editor.cursorLineEnd\",\n \"tui.editor.cursorWordLeft\",\n \"tui.editor.cursorWordRight\",\n] as const;\n\n// Pi TUI Kit multi-select screens do not expose in-place row-reorder shortcuts.\n// This specialized TUI keeps the same search, toggle, action, binding, and cancellation behavior\n// while RPC mode continues to use the Kit's declarative adapter in menu.ts.\nexport async function showTickerTuiMenu(ctx: ExtensionCommandContext, options: TickerMenuOptions): Promise<void> {\n const {\n canonicalizeConfiguredKey,\n formatInteractionHints,\n HorizontalRule,\n runCustomInteraction,\n sanitizeTerminalText,\n } = await import(\"@narumitw/pi-tui-kit\");\n\n while (!options.signal.aborted && options.isCurrent()) {\n const result = await runCustomInteraction<TuiMenuResult>(ctx, {\n signal: options.signal,\n isCurrent: options.isCurrent,\n onError: (errorCtx, error) => {\n if (!errorCtx.hasUI) return;\n const message = error instanceof Error ? error.message : String(error);\n errorCtx.ui.notify(sanitizeTerminalText(message), \"error\");\n },\n create: ({ tui, theme, keybindings, complete }) => {\n let symbols = [...options.getSymbols()];\n let widgetEnabled = options.getWidgetEnabled();\n const rawSearchInput = new Input();\n const searchInput = new Input();\n let selectedIndex = 0;\n let rows: Row[] = [];\n let busy = false;\n let disposed = false;\n let pasteActive = false;\n let errorMessage: string | undefined;\n let pending = Promise.resolve();\n const shortcutUp = shortcutAvailable(keybindings, \"shift+up\", canonicalizeConfiguredKey);\n const shortcutDown = shortcutAvailable(keybindings, \"shift+down\", canonicalizeConfiguredKey);\n const activationHint = (label: string) =>\n formatInteractionHints(keybindings, [{ bindings: [\"tui.select.confirm\"], keys: [\"space\"], label }]);\n const reorderKeys = [shortcutUp, shortcutDown].filter(\n (shortcut): shortcut is \"shift+up\" | \"shift+down\" => shortcut !== undefined,\n );\n const tickerDescription = `${[\n activationHint(\"removes this ticker\"),\n ...(reorderKeys.length > 0 ? [`${reorderKeys.join(\"/\")} changes its order`] : []),\n ].join(\"; \")}.`;\n const topRule = new HorizontalRule({\n label: \"Manage tickers\",\n labelAlignment: \"left\",\n ruleStyle: (text) => theme.fg(\"borderMuted\", text),\n labelStyle: (text) => theme.fg(\"accent\", text),\n });\n const bottomRule = new HorizontalRule({\n ruleStyle: (text) => theme.fg(\"borderMuted\", text),\n });\n const hint = formatInteractionHints(keybindings, [\n { bindings: [\"tui.select.up\", \"tui.select.down\"], label: \"select\" },\n ...(shortcutUp ? [{ keys: [shortcutUp], label: \"move up\" }] : []),\n ...(shortcutDown ? [{ keys: [shortcutDown], label: \"move down\" }] : []),\n { bindings: [\"tui.select.confirm\"], keys: [\"space\"], label: \"toggle/select\" },\n {\n bindings: [\"tui.select.cancel\"],\n excludeKeys: [\"ctrl+c\"],\n label: \"close\",\n },\n { keys: [\"ctrl+c\"], label: \"close\" },\n ]);\n\n const actionRows = (directSymbol?: string): ActionRow[] => [\n {\n kind: \"action\",\n id: \"add\",\n label: directSymbol ? `Add ${sanitizeTerminalText(directSymbol)}` : \"Add custom ticker\u2026\",\n description: directSymbol\n ? `${activationHint(`adds ${sanitizeTerminalText(directSymbol)} directly`)}.`\n : \"Add and select one Yahoo Finance symbol.\",\n },\n {\n kind: \"action\",\n id: \"widget\",\n label: `Widget: ${widgetEnabled ? \"On\" : \"Off\"}`,\n description: \"Show or hide the editor widget and persist this setting.\",\n },\n {\n kind: \"action\",\n id: \"refresh\",\n label: \"Refresh now\",\n description: widgetEnabled\n ? \"Fetch the selected symbols immediately.\"\n : \"Enable the widget before refreshing.\",\n },\n ];\n const buildRows = (): Row[] => {\n const tickerRows = symbols.map((symbol): TickerRow => ({ kind: \"ticker\", id: symbol, symbol }));\n const query = searchInput.getValue().toLowerCase();\n const filtered = fuzzyFilter(tickerRows, query, (row) =>\n sanitizeTerminalText(row.symbol.replaceAll(\"-\", \" \")).toLowerCase(),\n );\n const directSymbol = filtered.length === 0 ? tryDirectSymbol(rawSearchInput.getValue()) : undefined;\n return [...filtered, ...actionRows(directSymbol)];\n };\n const selectedRow = () => rows[selectedIndex];\n const rebuild = (preferredId?: string, fallbackIndex = selectedIndex) => {\n rows = buildRows();\n const preferredIndex = preferredId ? rows.findIndex((row) => row.id === preferredId) : -1;\n selectedIndex = preferredIndex >= 0 ? preferredIndex : Math.max(0, Math.min(fallbackIndex, rows.length - 1));\n tui.requestRender();\n };\n rebuild();\n\n const select = (index: number, wrap: boolean) => {\n if (rows.length === 0) return;\n selectedIndex = wrap ? (index + rows.length) % rows.length : Math.max(0, Math.min(index, rows.length - 1));\n tui.requestRender();\n };\n const persist = (\n nextSymbols: readonly string[],\n previousSymbols: readonly string[],\n preferredId: string | undefined,\n previousIndex: number,\n clearSearchOnSuccess = false,\n ) => {\n busy = true;\n errorMessage = undefined;\n symbols = [...nextSymbols];\n rebuild(preferredId, previousIndex);\n pending = (async () => {\n try {\n await options.applySymbols(symbols, options.signal);\n if (options.signal.aborted || !options.isCurrent()) return;\n symbols = [...options.getSymbols()];\n if (clearSearchOnSuccess) {\n rawSearchInput.setValue(\"\");\n searchInput.setValue(\"\");\n }\n } catch (error) {\n if (options.signal.aborted || !options.isCurrent()) return;\n symbols = [...previousSymbols];\n errorMessage = sanitizeTerminalText(error instanceof Error ? error.message : String(error));\n ctx.ui.notify(`Ticker settings were not saved: ${errorMessage}`, \"error\");\n } finally {\n busy = false;\n if (!disposed && !options.signal.aborted && options.isCurrent()) {\n rebuild(preferredId, previousIndex);\n }\n }\n })();\n };\n const persistWidgetEnabled = (nextWidgetEnabled: boolean) => {\n const previousWidgetEnabled = widgetEnabled;\n widgetEnabled = nextWidgetEnabled;\n busy = true;\n errorMessage = undefined;\n rebuild(\"widget\");\n pending = (async () => {\n try {\n await options.applyWidgetEnabled(nextWidgetEnabled, options.signal);\n if (options.signal.aborted || !options.isCurrent()) return;\n widgetEnabled = options.getWidgetEnabled();\n } catch (error) {\n if (options.signal.aborted || !options.isCurrent()) return;\n widgetEnabled = previousWidgetEnabled;\n errorMessage = sanitizeTerminalText(error instanceof Error ? error.message : String(error));\n ctx.ui.notify(`Ticker settings were not saved: ${errorMessage}`, \"error\");\n } finally {\n busy = false;\n if (!disposed && !options.signal.aborted && options.isCurrent()) rebuild(\"widget\");\n }\n })();\n };\n const toggle = () => {\n if (busy || disposed) return;\n const row = selectedRow();\n if (row?.kind !== \"ticker\") return;\n const previous = [...symbols];\n const next = symbols.filter((symbol) => symbol !== row.symbol);\n persist(next, previous, undefined, selectedIndex);\n };\n const moveTicker = (direction: -1 | 1) => {\n if (busy || disposed || rawSearchInput.getValue() || options.signal.aborted || !options.isCurrent()) {\n return;\n }\n const row = selectedRow();\n if (row?.kind !== \"ticker\") return;\n const from = symbols.indexOf(row.symbol);\n const to = from + direction;\n if (from < 0 || to < 0 || to >= symbols.length) return;\n const previous = [...symbols];\n const next = [...symbols];\n const [symbol] = next.splice(from, 1);\n if (!symbol) return;\n next.splice(to, 0, symbol);\n persist(next, previous, symbol, selectedIndex);\n };\n const activate = () => {\n if (busy || disposed) return;\n const row = selectedRow();\n if (!row) return;\n if (row.kind === \"ticker\") {\n toggle();\n return;\n }\n if (row.id === \"add\") {\n const query = rawSearchInput.getValue();\n const hasTickerMatch = rows.some((candidate) => candidate.kind === \"ticker\");\n if (query.trim() && !hasTickerMatch) {\n let symbol: string;\n try {\n symbol = parseDirectSymbol(query);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n errorMessage = sanitizeTerminalText(message);\n ctx.ui.notify(errorMessage, \"error\");\n tui.requestRender();\n return;\n }\n if (symbols.includes(symbol)) {\n ctx.ui.notify(`${symbol} is already selected.`, \"info\");\n return;\n }\n persist([...symbols, symbol], [...symbols], symbol, selectedIndex, true);\n return;\n }\n complete(\"add\");\n } else if (row.id === \"widget\") persistWidgetEnabled(!widgetEnabled);\n else options.refresh();\n };\n const handleSearch = (data: string) => {\n const previousId = selectedRow()?.id;\n errorMessage = undefined;\n rawSearchInput.handleInput(data);\n searchInput.handleInput(data);\n searchInput.setValue(sanitizeTerminalText(rawSearchInput.getValue()));\n rebuild(previousId, 0);\n };\n\n return {\n render(width: number) {\n const safeWidth = Number.isFinite(width) ? Math.max(0, Math.floor(width)) : 0;\n if (safeWidth === 0) return [\"\"];\n const viewportSize = availableRows(tui.terminal.rows, rows.length);\n const viewportStart = Math.max(\n 0,\n Math.min(selectedIndex - Math.floor(viewportSize / 2), rows.length - viewportSize),\n );\n const visibleRows = rows.slice(viewportStart, viewportStart + viewportSize);\n const content = visibleRows.map((row, offset) => {\n const index = viewportStart + offset;\n const focused = index === selectedIndex;\n const label =\n row.kind === \"ticker\"\n ? `${focused ? \"\u203A\" : \" \"} [x] ${sanitizeTerminalText(row.symbol)}`\n : `${focused ? \"\u203A\" : \" \"} ${row.label}`;\n const bounded = truncateToWidth(label, safeWidth, safeWidth > 1 ? \"\u2026\" : \"\");\n return focused ? theme.fg(\"accent\", bounded) : bounded;\n });\n if (viewportSize < rows.length) {\n content.push(theme.fg(\"dim\", truncateToWidth(` (${selectedIndex + 1}/${rows.length})`, safeWidth, \"\")));\n }\n const row = selectedRow();\n const description =\n row?.kind === \"ticker\"\n ? rawSearchInput.getValue()\n ? \"Clear search before reordering.\"\n : tickerDescription\n : row?.description;\n const status = errorMessage\n ? theme.fg(\"error\", errorMessage)\n : busy\n ? theme.fg(\"muted\", \"Saving changes\u2026\")\n : undefined;\n return [\n ...topRule.render(safeWidth),\n theme.fg(\n \"muted\",\n truncateToWidth(`${symbols.length} selected \u00B7 changes save immediately`, safeWidth, \"\"),\n ),\n ...searchInput.render(safeWidth).map((line) => truncateToWidth(line, safeWidth, \"\")),\n ...content,\n ...(description ? [theme.fg(\"dim\", truncateToWidth(` ${description}`, safeWidth, \"\"))] : []),\n ...(status ? [truncateToWidth(status, safeWidth, \"\")] : []),\n ...bottomRule.render(safeWidth),\n theme.fg(\"dim\", truncateToWidth(hint, safeWidth, \"\")),\n ];\n },\n invalidate() {\n searchInput.invalidate();\n },\n handleInput(data: string) {\n if (pasteActive || data.includes(PASTE_START)) {\n pasteActive = !data.includes(PASTE_END);\n handleSearch(data);\n return;\n }\n if (matchesKey(data, Key.ctrl(\"c\"))) {\n complete(\"close\");\n return;\n }\n if (keybindings.matches(data, \"tui.select.cancel\")) {\n complete(\"close\");\n return;\n }\n if (keybindings.matches(data, \"tui.select.up\")) {\n select(selectedIndex - 1, true);\n return;\n }\n if (keybindings.matches(data, \"tui.select.down\")) {\n select(selectedIndex + 1, true);\n return;\n }\n if (keybindings.matches(data, \"tui.select.pageUp\")) {\n select(selectedIndex - availableRows(tui.terminal.rows, rows.length), false);\n return;\n }\n if (keybindings.matches(data, \"tui.select.pageDown\")) {\n select(selectedIndex + availableRows(tui.terminal.rows, rows.length), false);\n return;\n }\n if (keybindings.matches(data, \"tui.select.confirm\") || data === \" \") {\n activate();\n return;\n }\n if (shortcutUp && matchesKey(data, shortcutUp)) {\n moveTicker(-1);\n return;\n }\n if (shortcutDown && matchesKey(data, shortcutDown)) {\n moveTicker(1);\n return;\n }\n handleSearch(data);\n },\n async waitForPending() {\n await pending;\n },\n dispose() {\n disposed = true;\n },\n get focused() {\n return searchInput.focused;\n },\n set focused(value: boolean) {\n searchInput.focused = value;\n },\n };\n },\n });\n\n if (result.kind !== \"completed\" || result.value === \"close\") return;\n const entered = await ctx.ui.input(\"Add custom ticker\", \"Yahoo symbol, for example MSFT or SOL-USD\", {\n signal: options.signal,\n });\n if (options.signal.aborted || !options.isCurrent()) return;\n if (!entered?.trim()) continue;\n try {\n const parsed = parseSymbols([entered]);\n if (parsed.length !== 1) throw new Error(\"Enter exactly one Yahoo Finance symbol.\");\n const symbol = parsed[0];\n if (!symbol) continue;\n const current = options.getSymbols();\n if (current.includes(symbol)) {\n ctx.ui.notify(`${symbol} is already selected.`, \"info\");\n continue;\n }\n await options.applySymbols([...current, symbol], options.signal);\n if (options.signal.aborted || !options.isCurrent()) return;\n } catch (error) {\n if (options.signal.aborted || !options.isCurrent()) return;\n const message = error instanceof Error ? error.message : String(error);\n ctx.ui.notify(sanitizeTerminalText(message), \"error\");\n }\n }\n}\n\nfunction parseDirectSymbol(value: string): string {\n const parsed = parseSymbols([value]);\n if (parsed.length !== 1) throw new Error(\"Enter exactly one Yahoo Finance symbol.\");\n const symbol = parsed[0];\n if (!symbol) throw new Error(\"Enter one Yahoo Finance symbol.\");\n return symbol;\n}\n\nfunction tryDirectSymbol(value: string): string | undefined {\n if (!value.trim()) return undefined;\n try {\n return parseDirectSymbol(value);\n } catch {\n return undefined;\n }\n}\n\nfunction availableRows(terminalRows: number, rowCount: number): number {\n const boundedRows = Number.isFinite(terminalRows) ? Math.max(1, Math.floor(terminalRows) - 9) : 10;\n return Math.max(1, Math.min(rowCount, boundedRows, 12));\n}\n\nfunction shortcutAvailable(\n keybindings: {\n getKeys(binding: string): readonly string[];\n },\n shortcut: \"shift+up\" | \"shift+down\",\n canonicalKey: (value: unknown) => string | undefined,\n): typeof shortcut | undefined {\n const unavailable = new Set(\n [\n \"ctrl+c\",\n \"home\",\n \"end\",\n \"space\",\n ...RESERVED_INPUT_BINDINGS.flatMap((binding) => keybindings.getKeys(binding)),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ilter, Input, Key, matchesKey, truncateToWidth } from \"@earendil-works/pi-tui\";\nimport type { TickerMenuOptions } from \"./menu.js\";\nimport { parseSymbols } from \"./settings.js\";\n\ntype TuiMenuResult = \"add\" | \"close\";\ntype TickerRow = { kind: \"ticker\"; id: string; symbol: string };\ntype ActionRow = {\n kind: \"action\";\n id: \"add\" | \"widget\" | \"refresh\";\n label: string;\n description: string;\n};\ntype Row = TickerRow | ActionRow;\n\nconst PASTE_START = \"\\u001b[200~\";\nconst PASTE_END = \"\\u001b[201~\";\n// Keep these aligned with Input.handleInput so configured editing actions beat additive reorder.\nconst RESERVED_INPUT_BINDINGS = [\n \"tui.select.up\",\n \"tui.select.down\",\n \"tui.select.pageUp\",\n \"tui.select.pageDown\",\n \"tui.select.confirm\",\n \"tui.select.cancel\",\n \"tui.editor.undo\",\n \"tui.input.submit\",\n \"tui.editor.deleteCharBackward\",\n \"tui.editor.deleteCharForward\",\n \"tui.editor.deleteWordBackward\",\n \"tui.editor.deleteWordForward\",\n \"tui.editor.deleteToLineStart\",\n \"tui.editor.deleteToLineEnd\",\n \"tui.editor.yank\",\n \"tui.editor.yankPop\",\n \"tui.editor.cursorLeft\",\n \"tui.editor.cursorRight\",\n \"tui.editor.cursorLineStart\",\n \"tui.editor.cursorLineEnd\",\n \"tui.editor.cursorWordLeft\",\n \"tui.editor.cursorWordRight\",\n] as const;\n\n// Pi TUI Kit multi-select screens do not expose in-place row-reorder shortcuts.\n// This specialized TUI keeps the same search, toggle, action, binding, and cancellation behavior\n// while RPC mode continues to use the Kit's declarative adapter in menu.ts.\nexport async function showTickerTuiMenu(ctx: ExtensionCommandContext, options: TickerMenuOptions): Promise<void> {\n const {\n canonicalizeConfiguredKey,\n formatInteractionHints,\n HorizontalRule,\n runCustomInteraction,\n sanitizeTerminalText,\n } = await import(\"@narumitw/pi-tui-kit\");\n\n while (!options.signal.aborted && options.isCurrent()) {\n const result = await runCustomInteraction<TuiMenuResult>(ctx, {\n signal: options.signal,\n isCurrent: options.isCurrent,\n onError: (errorCtx, error) => {\n if (!errorCtx.hasUI) return;\n const message = error instanceof Error ? error.message : String(error);\n errorCtx.ui.notify(sanitizeTerminalText(message), \"error\");\n },\n create: ({ tui, theme, keybindings, complete }) => {\n let symbols = [...options.getSymbols()];\n let widgetEnabled = options.getWidgetEnabled();\n const rawSearchInput = new Input();\n const searchInput = new Input();\n let selectedIndex = 0;\n let rows: Row[] = [];\n let busy = false;\n let disposed = false;\n let pasteActive = false;\n let errorMessage: string | undefined;\n let pending = Promise.resolve();\n const shortcutUp = shortcutAvailable(keybindings, \"shift+up\", canonicalizeConfiguredKey);\n const shortcutDown = shortcutAvailable(keybindings, \"shift+down\", canonicalizeConfiguredKey);\n const activationHint = (label: string) =>\n formatInteractionHints(keybindings, [{ bindings: [\"tui.select.confirm\"], keys: [\"space\"], label }]);\n const reorderKeys = [shortcutUp, shortcutDown].filter(\n (shortcut): shortcut is \"shift+up\" | \"shift+down\" => shortcut !== undefined,\n );\n const tickerDescription = `${[\n activationHint(\"removes this ticker\"),\n ...(reorderKeys.length > 0 ? [`${reorderKeys.join(\"/\")} changes its order`] : []),\n ].join(\"; \")}.`;\n const topRule = new HorizontalRule({\n label: \"Manage tickers\",\n labelAlignment: \"left\",\n ruleStyle: (text) => theme.fg(\"borderMuted\", text),\n labelStyle: (text) => theme.fg(\"accent\", text),\n });\n const bottomRule = new HorizontalRule({\n ruleStyle: (text) => theme.fg(\"borderMuted\", text),\n });\n const hint = formatInteractionHints(keybindings, [\n { bindings: [\"tui.select.up\", \"tui.select.down\"], label: \"select\" },\n ...(shortcutUp ? [{ keys: [shortcutUp], label: \"move up\" }] : []),\n ...(shortcutDown ? [{ keys: [shortcutDown], label: \"move down\" }] : []),\n { bindings: [\"tui.select.confirm\"], keys: [\"space\"], label: \"toggle/select\" },\n {\n bindings: [\"tui.select.cancel\"],\n excludeKeys: [\"ctrl+c\"],\n label: \"close\",\n },\n { keys: [\"ctrl+c\"], label: \"close\" },\n ]);\n\n const actionRows = (directSymbol?: string): ActionRow[] => [\n {\n kind: \"action\",\n id: \"add\",\n label: directSymbol ? `Add ${sanitizeTerminalText(directSymbol)}` : \"Add custom ticker\u2026\",\n description: directSymbol\n ? `${activationHint(`adds ${sanitizeTerminalText(directSymbol)} directly`)}.`\n : \"Add and select one Yahoo Finance symbol.\",\n },\n {\n kind: \"action\",\n id: \"widget\",\n label: `Widget: ${widgetEnabled ? \"On\" : \"Off\"}`,\n description: \"Show or hide the editor widget and persist this setting.\",\n },\n {\n kind: \"action\",\n id: \"refresh\",\n label: \"Refresh now\",\n description: widgetEnabled\n ? \"Fetch the selected symbols immediately.\"\n : \"Enable the widget before refreshing.\",\n },\n ];\n const buildRows = (): Row[] => {\n const tickerRows = symbols.map((symbol): TickerRow => ({ kind: \"ticker\", id: symbol, symbol }));\n const query = searchInput.getValue().toLowerCase();\n const filtered = fuzzyFilter(tickerRows, query, (row) =>\n sanitizeTerminalText(row.symbol.replaceAll(\"-\", \" \")).toLowerCase(),\n );\n const directSymbol = filtered.length === 0 ? tryDirectSymbol(rawSearchInput.getValue()) : undefined;\n return [...filtered, ...actionRows(directSymbol)];\n };\n const selectedRow = () => rows[selectedIndex];\n const rebuild = (preferredId?: string, fallbackIndex = selectedIndex) => {\n rows = buildRows();\n const preferredIndex = preferredId ? rows.findIndex((row) => row.id === preferredId) : -1;\n selectedIndex = preferredIndex >= 0 ? preferredIndex : Math.max(0, Math.min(fallbackIndex, rows.length - 1));\n tui.requestRender();\n };\n rebuild();\n\n const select = (index: number, wrap: boolean) => {\n if (rows.length === 0) return;\n selectedIndex = wrap ? (index + rows.length) % rows.length : Math.max(0, Math.min(index, rows.length - 1));\n tui.requestRender();\n };\n const persist = (\n nextSymbols: readonly string[],\n previousSymbols: readonly string[],\n preferredId: string | undefined,\n previousIndex: number,\n clearSearchOnSuccess = false,\n ) => {\n busy = true;\n errorMessage = undefined;\n symbols = [...nextSymbols];\n rebuild(preferredId, previousIndex);\n pending = (async () => {\n try {\n await options.applySymbols(symbols, options.signal);\n if (options.signal.aborted || !options.isCurrent()) return;\n symbols = [...options.getSymbols()];\n if (clearSearchOnSuccess) {\n rawSearchInput.setValue(\"\");\n searchInput.setValue(\"\");\n }\n } catch (error) {\n if (options.signal.aborted || !options.isCurrent()) return;\n symbols = [...previousSymbols];\n errorMessage = sanitizeTerminalText(error instanceof Error ? error.message : String(error));\n ctx.ui.notify(`Ticker settings were not saved: ${errorMessage}`, \"error\");\n } finally {\n busy = false;\n if (!disposed && !options.signal.aborted && options.isCurrent()) {\n rebuild(preferredId, previousIndex);\n }\n }\n })();\n };\n const persistWidgetEnabled = (nextWidgetEnabled: boolean) => {\n const previousWidgetEnabled = widgetEnabled;\n widgetEnabled = nextWidgetEnabled;\n busy = true;\n errorMessage = undefined;\n rebuild(\"widget\");\n pending = (async () => {\n try {\n await options.applyWidgetEnabled(nextWidgetEnabled, options.signal);\n if (options.signal.aborted || !options.isCurrent()) return;\n widgetEnabled = options.getWidgetEnabled();\n } catch (error) {\n if (options.signal.aborted || !options.isCurrent()) return;\n widgetEnabled = previousWidgetEnabled;\n errorMessage = sanitizeTerminalText(error instanceof Error ? error.message : String(error));\n ctx.ui.notify(`Ticker settings were not saved: ${errorMessage}`, \"error\");\n } finally {\n busy = false;\n if (!disposed && !options.signal.aborted && options.isCurrent()) rebuild(\"widget\");\n }\n })();\n };\n const toggle = () => {\n if (busy || disposed) return;\n const row = selectedRow();\n if (row?.kind !== \"ticker\") return;\n const previous = [...symbols];\n const next = symbols.filter((symbol) => symbol !== row.symbol);\n persist(next, previous, undefined, selectedIndex);\n };\n const moveTicker = (direction: -1 | 1) => {\n if (busy || disposed || rawSearchInput.getValue() || options.signal.aborted || !options.isCurrent()) {\n return;\n }\n const row = selectedRow();\n if (row?.kind !== \"ticker\") return;\n const from = symbols.indexOf(row.symbol);\n const to = from + direction;\n if (from < 0 || to < 0 || to >= symbols.length) return;\n const previous = [...symbols];\n const next = [...symbols];\n const [symbol] = next.splice(from, 1);\n if (!symbol) return;\n next.splice(to, 0, symbol);\n persist(next, previous, symbol, selectedIndex);\n };\n const activate = () => {\n if (busy || disposed) return;\n const row = selectedRow();\n if (!row) return;\n if (row.kind === \"ticker\") {\n toggle();\n return;\n }\n if (row.id === \"add\") {\n const query = rawSearchInput.getValue();\n const hasTickerMatch = rows.some((candidate) => candidate.kind === \"ticker\");\n if (query.trim() && !hasTickerMatch) {\n let symbol: string;\n try {\n symbol = parseDirectSymbol(query);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n errorMessage = sanitizeTerminalText(message);\n ctx.ui.notify(errorMessage, \"error\");\n tui.requestRender();\n return;\n }\n if (symbols.includes(symbol)) {\n ctx.ui.notify(`${symbol} is already selected.`, \"info\");\n return;\n }\n persist([...symbols, symbol], [...symbols], symbol, selectedIndex, true);\n return;\n }\n complete(\"add\");\n } else if (row.id === \"widget\") persistWidgetEnabled(!widgetEnabled);\n else options.refresh();\n };\n const handleSearch = (data: string) => {\n const previousId = selectedRow()?.id;\n errorMessage = undefined;\n rawSearchInput.handleInput(data);\n searchInput.handleInput(data);\n searchInput.setValue(sanitizeTerminalText(rawSearchInput.getValue()));\n rebuild(previousId, 0);\n };\n\n return {\n capturesViewportInput: true,\n render(width: number) {\n const safeWidth = Number.isFinite(width) ? Math.max(0, Math.floor(width)) : 0;\n if (safeWidth === 0) return [\"\"];\n const viewportSize = availableRows(tui.terminal.rows, rows.length);\n const viewportStart = Math.max(\n 0,\n Math.min(selectedIndex - Math.floor(viewportSize / 2), rows.length - viewportSize),\n );\n const visibleRows = rows.slice(viewportStart, viewportStart + viewportSize);\n const content = visibleRows.map((row, offset) => {\n const index = viewportStart + offset;\n const focused = index === selectedIndex;\n const label =\n row.kind === \"ticker\"\n ? `${focused ? \"\u203A\" : \" \"} [x] ${sanitizeTerminalText(row.symbol)}`\n : `${focused ? \"\u203A\" : \" \"} ${row.label}`;\n const bounded = truncateToWidth(label, safeWidth, safeWidth > 1 ? \"\u2026\" : \"\");\n return focused ? theme.fg(\"accent\", bounded) : bounded;\n });\n if (viewportSize < rows.length) {\n content.push(theme.fg(\"dim\", truncateToWidth(` (${selectedIndex + 1}/${rows.length})`, safeWidth, \"\")));\n }\n const row = selectedRow();\n const description =\n row?.kind === \"ticker\"\n ? rawSearchInput.getValue()\n ? \"Clear search before reordering.\"\n : tickerDescription\n : row?.description;\n const status = errorMessage\n ? theme.fg(\"error\", errorMessage)\n : busy\n ? theme.fg(\"muted\", \"Saving changes\u2026\")\n : undefined;\n return [\n ...topRule.render(safeWidth),\n theme.fg(\n \"muted\",\n truncateToWidth(`${symbols.length} selected \u00B7 changes save immediately`, safeWidth, \"\"),\n ),\n ...searchInput.render(safeWidth).map((line) => truncateToWidth(line, safeWidth, \"\")),\n ...content,\n ...(description ? [theme.fg(\"dim\", truncateToWidth(` ${description}`, safeWidth, \"\"))] : []),\n ...(status ? [truncateToWidth(status, safeWidth, \"\")] : []),\n ...bottomRule.render(safeWidth),\n theme.fg(\"dim\", truncateToWidth(hint, safeWidth, \"\")),\n ];\n },\n invalidate() {\n searchInput.invalidate();\n },\n handleInput(data: string) {\n if (pasteActive || data.includes(PASTE_START)) {\n pasteActive = !data.includes(PASTE_END);\n handleSearch(data);\n return;\n }\n if (matchesKey(data, Key.ctrl(\"c\"))) {\n complete(\"close\");\n return;\n }\n if (keybindings.matches(data, \"tui.select.cancel\")) {\n complete(\"close\");\n return;\n }\n if (keybindings.matches(data, \"tui.select.up\")) {\n select(selectedIndex - 1, true);\n return;\n }\n if (keybindings.matches(data, \"tui.select.down\")) {\n select(selectedIndex + 1, true);\n return;\n }\n if (keybindings.matches(data, \"tui.select.pageUp\")) {\n select(selectedIndex - availableRows(tui.terminal.rows, rows.length), false);\n return;\n }\n if (keybindings.matches(data, \"tui.select.pageDown\")) {\n select(selectedIndex + availableRows(tui.terminal.rows, rows.length), false);\n return;\n }\n if (keybindings.matches(data, \"tui.select.confirm\") || data === \" \") {\n activate();\n return;\n }\n if (shortcutUp && matchesKey(data, shortcutUp)) {\n moveTicker(-1);\n return;\n }\n if (shortcutDown && matchesKey(data, shortcutDown)) {\n moveTicker(1);\n return;\n }\n handleSearch(data);\n },\n async waitForPending() {\n await pending;\n },\n dispose() {\n disposed = true;\n },\n get focused() {\n return searchInput.focused;\n },\n set focused(value: boolean) {\n searchInput.focused = value;\n },\n };\n },\n });\n\n if (result.kind !== \"completed\" || result.value === \"close\") return;\n const entered = await ctx.ui.input(\"Add custom ticker\", \"Yahoo symbol, for example MSFT or SOL-USD\", {\n signal: options.signal,\n });\n if (options.signal.aborted || !options.isCurrent()) return;\n if (!entered?.trim()) continue;\n try {\n const parsed = parseSymbols([entered]);\n if (parsed.length !== 1) throw new Error(\"Enter exactly one Yahoo Finance symbol.\");\n const symbol = parsed[0];\n if (!symbol) continue;\n const current = options.getSymbols();\n if (current.includes(symbol)) {\n ctx.ui.notify(`${symbol} is already selected.`, \"info\");\n continue;\n }\n await options.applySymbols([...current, symbol], options.signal);\n if (options.signal.aborted || !options.isCurrent()) return;\n } catch (error) {\n if (options.signal.aborted || !options.isCurrent()) return;\n const message = error instanceof Error ? error.message : String(error);\n ctx.ui.notify(sanitizeTerminalText(message), \"error\");\n }\n }\n}\n\nfunction parseDirectSymbol(value: string): string {\n const parsed = parseSymbols([value]);\n if (parsed.length !== 1) throw new Error(\"Enter exactly one Yahoo Finance symbol.\");\n const symbol = parsed[0];\n if (!symbol) throw new Error(\"Enter one Yahoo Finance symbol.\");\n return symbol;\n}\n\nfunction tryDirectSymbol(value: string): string | undefined {\n if (!value.trim()) return undefined;\n try {\n return parseDirectSymbol(value);\n } catch {\n return undefined;\n }\n}\n\nfunction availableRows(terminalRows: number, rowCount: number): number {\n const boundedRows = Number.isFinite(terminalRows) ? Math.max(1, Math.floor(terminalRows) - 9) : 10;\n return Math.max(1, Math.min(rowCount, boundedRows, 12));\n}\n\nfunction shortcutAvailable(\n keybindings: {\n getKeys(binding: string): readonly string[];\n },\n shortcut: \"shift+up\" | \"shift+down\",\n canonicalKey: (value: unknown) => string | undefined,\n): typeof shortcut | undefined {\n const unavailable = new Set(\n [\n \"ctrl+c\",\n \"home\",\n \"end\",\n \"space\",\n ...RESERVED_INPUT_BINDINGS.flatMap((binding) => keybindings.getKeys(binding)),\n ].map(canonicalKey),\n );\n return unavailable.has(canonicalKey(shortcut)) ? undefined : shortcut;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;AACA,SAAS,aAAa,OAAO,KAAK,YAAY,uBAAuB;AAcrE,IAAM,cAAc;AACpB,IAAM,YAAY;AAElB,IAAM,0BAA0B;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAKA,eAAsB,kBAAkB,KAA8B,SAA2C;AAC/G,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,MAAM,OAAO,sBAAsB;AAEvC,SAAO,CAAC,QAAQ,OAAO,WAAW,QAAQ,UAAU,GAAG;AACrD,UAAM,SAAS,MAAM,qBAAoC,KAAK;AAAA,MAC5D,QAAQ,QAAQ;AAAA,MAChB,WAAW,QAAQ;AAAA,MACnB,SAAS,CAAC,UAAU,UAAU;AAC5B,YAAI,CAAC,SAAS,MAAO;AACrB,cAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AACrE,iBAAS,GAAG,OAAO,qBAAqB,OAAO,GAAG,OAAO;AAAA,MAC3D;AAAA,MACA,QAAQ,CAAC,EAAE,KAAK,OAAO,aAAa,SAAS,MAAM;AACjD,YAAI,UAAU,CAAC,GAAG,QAAQ,WAAW,CAAC;AACtC,YAAI,gBAAgB,QAAQ,iBAAiB;AAC7C,cA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EAAE,IAAI,YAAY;AAAA,EACpB;AACA,SAAO,YAAY,IAAI,aAAa,QAAQ,CAAC,IAAI,SAAY;AAC/D;",
|
|
6
6
|
"names": ["row"]
|
|
7
7
|
}
|
package/dist/index.ts
CHANGED
|
@@ -319,7 +319,7 @@ function stockTicker(pi, dependencies = {}) {
|
|
|
319
319
|
const expectedGeneration = generation;
|
|
320
320
|
if (!controller || controller.signal.aborted || !ownsSession(ctx, expectedGeneration)) return;
|
|
321
321
|
const running = (async () => {
|
|
322
|
-
const { showTickerMenu } = await import("./chunks/menu-
|
|
322
|
+
const { showTickerMenu } = await import("./chunks/menu-VSY7RYVT.ts");
|
|
323
323
|
if (controller.signal.aborted || !ownsSession(ctx, expectedGeneration)) return;
|
|
324
324
|
await showTickerMenu(ctx, {
|
|
325
325
|
signal: controller.signal,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@narumitw/pi-ticker",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Pi extension that shows configurable Yahoo Finance quotes above the editor.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"src",
|
|
21
21
|
"dist",
|
|
22
22
|
"README.md",
|
|
23
|
+
"CHANGELOG.md",
|
|
23
24
|
"LICENSE"
|
|
24
25
|
],
|
|
25
26
|
"pi": {
|
|
@@ -35,15 +36,15 @@
|
|
|
35
36
|
"prepack": "npm run build"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@narumitw/pi-tui-kit": "^0.
|
|
39
|
+
"@narumitw/pi-tui-kit": "^0.69.0"
|
|
39
40
|
},
|
|
40
41
|
"peerDependencies": {
|
|
41
42
|
"@earendil-works/pi-coding-agent": "*",
|
|
42
43
|
"@earendil-works/pi-tui": "*"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
46
|
-
"@earendil-works/pi-tui": "1.
|
|
46
|
+
"@earendil-works/pi-coding-agent": "1.5.0",
|
|
47
|
+
"@earendil-works/pi-tui": "1.5.0",
|
|
47
48
|
"@types/node": "26.6.5",
|
|
48
49
|
"esbuild": "0.28.2",
|
|
49
50
|
"typescript": "7.0.2"
|
package/src/tui-menu.ts
CHANGED
|
@@ -276,6 +276,7 @@ export async function showTickerTuiMenu(ctx: ExtensionCommandContext, options: T
|
|
|
276
276
|
};
|
|
277
277
|
|
|
278
278
|
return {
|
|
279
|
+
capturesViewportInput: true,
|
|
279
280
|
render(width: number) {
|
|
280
281
|
const safeWidth = Number.isFinite(width) ? Math.max(0, Math.floor(width)) : 0;
|
|
281
282
|
if (safeWidth === 0) return [""];
|
|
File without changes
|