@narumitw/pi-starship 0.65.0 → 0.65.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +322 -0
  2. package/README.md +3 -0
  3. package/dist/chunks/{chunk-S2KBLHE2.ts → chunk-3XLWHJ5Y.ts} +5 -5
  4. package/dist/chunks/chunk-3XLWHJ5Y.ts.map +7 -0
  5. package/dist/chunks/{chunk-I22B7QPQ.ts → chunk-5YA3XF7S.ts} +4 -3
  6. package/dist/chunks/chunk-5YA3XF7S.ts.map +7 -0
  7. package/dist/chunks/{chunk-D2YWQMYT.ts → chunk-PZWT7OTP.ts} +3 -3
  8. package/dist/chunks/{chunk-XTLQ4WUL.ts → chunk-QGB3NNTM.ts} +1 -1
  9. package/dist/chunks/chunk-QGB3NNTM.ts.map +7 -0
  10. package/dist/chunks/{chunk-YK4S4RRM.ts → chunk-RQY2AYI2.ts} +3 -2
  11. package/dist/chunks/chunk-RQY2AYI2.ts.map +7 -0
  12. package/dist/chunks/{cloud-J2ZOE3HE.ts → cloud-CNNWXSQ3.ts} +2 -2
  13. package/dist/chunks/{command-configuration-menu-BJYQXV2U.ts → command-configuration-menu-JHKQ5SDW.ts} +6 -3
  14. package/dist/chunks/command-configuration-menu-JHKQ5SDW.ts.map +7 -0
  15. package/dist/chunks/{command-settings-chat-42OTC7NJ.ts → command-settings-chat-RN2GDMF5.ts} +4 -4
  16. package/dist/chunks/{commands-ZL36J5TX.ts → commands-XIRYGV7S.ts} +6 -6
  17. package/dist/chunks/{deployment-NOJ2KCLI.ts → deployment-KNUSQSJ5.ts} +3 -3
  18. package/dist/chunks/{development-T3XXVVDP.ts → development-TJNVM4H2.ts} +2 -2
  19. package/dist/chunks/{execution-R2OHIP2L.ts → execution-OFQXHFAH.ts} +3 -3
  20. package/dist/chunks/{jujutsu-XLDYKSX2.ts → jujutsu-T2LTPHSY.ts} +2 -2
  21. package/dist/chunks/{languages-CBQNNYXM.ts → languages-VWXTVJ45.ts} +3 -3
  22. package/dist/chunks/{package-7KVAK3TC.ts → package-JA4CJ5DR.ts} +2 -2
  23. package/dist/chunks/{system-574MHB4R.ts → system-CDTPAQZX.ts} +2 -2
  24. package/dist/index.ts +58 -36
  25. package/dist/index.ts.map +2 -2
  26. package/package.json +6 -5
  27. package/skills/configure-pi-starship/references/module-catalog.md +2 -2
  28. package/skills/configure-pi-starship/references/modules.md +10 -2
  29. package/src/command-configuration-menu.ts +3 -0
  30. package/src/command-preview.ts +1 -0
  31. package/src/modules/catalog.ts +1 -1
  32. package/src/modules/cost.ts +2 -1
  33. package/src/modules/git/runtime.ts +33 -25
  34. package/src/modules/types.ts +1 -0
  35. package/src/pi-starship.ts +2 -0
  36. package/src/runtime/command.ts +8 -3
  37. package/src/runtime/github-pr.ts +5 -2
  38. package/src/runtime/helpers.ts +5 -4
  39. package/src/runtime/types.ts +1 -0
  40. package/src/usage.ts +17 -4
  41. package/dist/chunks/chunk-I22B7QPQ.ts.map +0 -7
  42. package/dist/chunks/chunk-S2KBLHE2.ts.map +0 -7
  43. package/dist/chunks/chunk-XTLQ4WUL.ts.map +0 -7
  44. package/dist/chunks/chunk-YK4S4RRM.ts.map +0 -7
  45. package/dist/chunks/command-configuration-menu-BJYQXV2U.ts.map +0 -7
  46. /package/dist/chunks/{chunk-D2YWQMYT.ts.map → chunk-PZWT7OTP.ts.map} +0 -0
  47. /package/dist/chunks/{cloud-J2ZOE3HE.ts.map → cloud-CNNWXSQ3.ts.map} +0 -0
  48. /package/dist/chunks/{command-settings-chat-42OTC7NJ.ts.map → command-settings-chat-RN2GDMF5.ts.map} +0 -0
  49. /package/dist/chunks/{commands-ZL36J5TX.ts.map → commands-XIRYGV7S.ts.map} +0 -0
  50. /package/dist/chunks/{deployment-NOJ2KCLI.ts.map → deployment-KNUSQSJ5.ts.map} +0 -0
  51. /package/dist/chunks/{development-T3XXVVDP.ts.map → development-TJNVM4H2.ts.map} +0 -0
  52. /package/dist/chunks/{execution-R2OHIP2L.ts.map → execution-OFQXHFAH.ts.map} +0 -0
  53. /package/dist/chunks/{jujutsu-XLDYKSX2.ts.map → jujutsu-T2LTPHSY.ts.map} +0 -0
  54. /package/dist/chunks/{languages-CBQNNYXM.ts.map → languages-VWXTVJ45.ts.map} +0 -0
  55. /package/dist/chunks/{package-7KVAK3TC.ts.map → package-JA4CJ5DR.ts.map} +0 -0
  56. /package/dist/chunks/{system-574MHB4R.ts.map → system-CDTPAQZX.ts.map} +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,322 @@
1
+ # @narumitw/pi-starship
2
+
3
+ ## 0.65.2
4
+
5
+ ### Patch Changes
6
+
7
+ - bed3e2b: Retain provider-total provenance across all session usage entries without changing numeric costs. Show the source in `/statusline status` and the optional Starship cost `$source` variable; mixed, legacy, empty, and incomplete totals remain unconfirmed.
8
+ - 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.
9
+
10
+ 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.
11
+ - 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.
12
+ - 0339567: Bound native Git command output and reject truncated Git, workspace, and pull request metadata before parsing or fallback.
13
+ - Updated dependencies [54f2700]
14
+ - Updated dependencies [6c76ef1]
15
+ - @narumitw/pi-tui-kit@0.69.0
16
+
17
+ ## 0.65.1
18
+
19
+ ### Patch Changes
20
+
21
+ - 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.
22
+ - Updated dependencies [9d3e0d7]
23
+ - @narumitw/pi-tui-kit@0.68.1
24
+
25
+ ## 0.65.0
26
+
27
+ ### Minor Changes
28
+
29
+ - 1bf8506: Add Lualine Bubbles, Eviline, Slanted Gaps, Catppuccin Tmux, Dracula Tmux, Powerlevel10k Lean, and Oh My Posh Atomic presets. Refresh the existing Pastel Powerline, Gruvbox Rainbow, and Tokyo Night layouts without changing their IDs or rewriting saved settings.
30
+
31
+ The ten layouts use local Pi and Git modules, preserve public extension statuses on a conditional line, and include font requirements and upstream attribution. Catppuccin Tmux uses one main row with workspace details on the left and session details on the right, retaining its Mocha palette and rounded labels without stacking the Pi and model pills. Shared Powerline segments retain their transitions when a companion field is hidden or unavailable. Existing copies of refreshed presets remain usable and can appear as custom configurations until explicitly replaced.
32
+
33
+ Correct Eviline backgrounds, Tokyo Night model/thinking transitions, and Jetpack progress separators. Tool names no longer add footer rows, and oversized graphemes use a width-safe ellipsis fallback. Rename the display labels No Runtime Versions to Session Indicators and Pure Preset to Pure, preserve their IDs, and correct the Bubbles description and upstream-source guidance.
34
+
35
+ ## 0.64.3
36
+
37
+ ### Patch Changes
38
+
39
+ - da96231: Keep ambiguous legacy Backspace input with the configuration chat editor instead of treating it as a cancel shortcut. Preserve explicitly encoded cancellation keys, native editing and viewport precedence, and normal response cancellation.
40
+
41
+ ## 0.64.2
42
+
43
+ ### Patch Changes
44
+
45
+ - Updated dependencies [a21d39b]
46
+ - Updated dependencies [f68aa54]
47
+ - Updated dependencies [b062d21]
48
+ - @narumitw/pi-tui-kit@0.68.0
49
+
50
+ ## 0.64.1
51
+
52
+ ### Patch Changes
53
+
54
+ - 57eeae7: Add the opt-in `createFullscreenHandoff()` resource and native test harness. Share terminal entry/exit drain, cancellation-safe restoration, keyboard-protocol recovery, owned overlay handling, and cleanup errors through public Pi TUI APIs. Keep ordinary Kit interactions unchanged.
55
+
56
+ Use the resource in Starship's configuration chat and BTW's multi-screen workspace. Keep each extension's input policy, layouts, domain state, permissions, and persistence local. BTW now waits for native input drain before entry. Changesets raises both consumer floors to the Kit API release; dependent publication requires its exact registry artifact.
57
+ - b46fd49: Put Apply first in profile actions, followed by Review TOML, Edit TOML, Duplicate, Rename, and Delete. Keep the apply confirmation and History action order unchanged.
58
+ - Updated dependencies [57eeae7]
59
+ - @narumitw/pi-tui-kit@0.67.0
60
+
61
+ ## 0.64.0
62
+
63
+ ### Minor Changes
64
+
65
+ - 31774d2: Move configuration chat to a Starship-owned `TuiAltScreen` with native `ScrollView` history and a fixed editor/preview dock. Suspend the parent TUI while the chat owns the shared terminal and restore ownership before review and save screens. Await native input drain before entering the chat and before returning to the parent. Recheck ownership after entry drain, join cancelled entry work, and restore keyboard protocols if entry is cancelled or fails.
66
+
67
+ History paging now uses `tui.altScreen.pageUp` and `tui.altScreen.pageDown` instead of `tui.editor.pageUp` and `tui.editor.pageDown`; move custom history paging bindings to the viewport actions. Agent behavior, draft permissions, and settings/profile storage are unchanged.
68
+
69
+ Align tool displays with Pi's built-in message/tool event lifecycle, including streamed arguments, partial results, native edit previews, final diffs, errors, and per-tool clicks. Seed expansion from the parent once and keep subsequent changes local across review. Restrict preview reads to the owned draft and prevent late native preview callbacks from redrawing disposed UI.
70
+
71
+ Document the intentional deviation from Pi's single-renderer guidance and the required lifecycle and physical-terminal checks. This change does not establish a diagnosis or verified fix for the originally reported wheel/key failure.
72
+
73
+ ## 0.63.0
74
+
75
+ ### Minor Changes
76
+
77
+ - 7e6690c: Restore Pi's native footer from Restore built-in… instead of saving the Starship example. Keep the previous settings bytes in History before removing the active file. Missing settings now leave the native footer active, and presets can still be applied without reloading. Native-mode previews use cached data and do not start collectors until custom settings are applied.
78
+
79
+ ### Patch Changes
80
+
81
+ - 9af45da: Align configuration-chat hints with Pi core: use lowercase key names and “to” action descriptions, and replace the ambiguous cancellation label with “esc to interrupt” when Escape is available.
82
+ - 584d57b: Keep the configuration chat open on idle Escape instead of opening a review menu. Escape still stops an active response, save shortcuts still open exact-draft review, and Ctrl+C still discards the chat.
83
+ - 06c8567: Allow scrolling configuration chat history with the mouse wheel and configured Editor page-up/page-down keys. Keep the history position stable while new output arrives and resume following output at the bottom.
84
+ - 71a7a29: Support collapsing and expanding configuration-chat tool output with Pi’s app.tools.expand action (Ctrl+O by default), without changing the main conversation. Preserve the local display state across new tool output and theme invalidation.
85
+
86
+ ## 0.62.0
87
+
88
+ ### Minor Changes
89
+
90
+ - eb69a7c: Simplify the footer menu around agent-assisted configuration, presets, profiles, and recovery. Show configuration health and warnings inline, and give the configuration chat read-only opening snapshots of loaded settings and module state. Keep the existing settings editor command and all review, confirmation, Gist, and History safeguards.
91
+ - 047c6b0: Add a separate fullscreen configuration chat with native Pi message rendering, the bundled skill, and draft-only read, write, and edit tools. Native steering, follow-up, and dequeue actions support messages submitted during a response, with undelivered input restored on cancellation or failure. A direct save shortcut opens reviewed profile creation and shows its active key on the editor border. Hard cancellation restores the active footer without redrawing a replaced session. Short gray editor-border labels show status and controls. Valid edits appear immediately without reload in a bottom-aligned footer preview; the user reviews and saves the draft as a named profile before a separate apply confirmation can change active settings, with History and conflict checks. Declining or failing application retains the saved profile.
92
+
93
+ ### Patch Changes
94
+
95
+ - 55502a4: Remove the trailing ellipsis from Configure with agent to match other menu-opening labels. Keep the existing conversation, preview, and save behavior unchanged.
96
+
97
+ ## 0.61.0
98
+
99
+ ### Minor Changes
100
+
101
+ - dee7381: Expand Git, directory, time, language, environment, and Kubernetes settings while preserving existing default footer output. Add bounded version and regex formatting, nested configuration round-tripping, and opt-in Jujutsu, system memory, and Linux battery modules. Keep collectors read-only, cancellable, and separate from rendering.
102
+
103
+ Custom version formats now use formatter variable boundaries and escapes: use `${raw}_suffix` for appended identifier text and `\$` for a literal dollar sign. The existing `v$raw` default remains unchanged.
104
+
105
+ ## 0.60.1
106
+
107
+ ### Patch Changes
108
+
109
+ - ee1b9ca: Fix the configuration skill path resolver for managed extension installs with a separate npm or Bun global Pi installation. Resolve the public Pi API beside the first Pi executable on PATH when the host peer is absent from the skill module tree, preserve the original working directory, and stop with actionable guidance instead of guessing a settings path.
110
+
111
+ ## 0.60.0
112
+
113
+ ### Minor Changes
114
+
115
+ - 8e0942f: Add `pi:<role>` color references for exact public Pi theme roles in styles and palette values. Foreground and background colors follow Pi theme switches and hot reload without reloading TOML, while style modifiers, fixed colors, defaults, and palette-key precedence remain unchanged. Invalid Pi roles report settings diagnostics in either color position.
116
+ - e7f5df0: Add named TOML profiles with live selection previews, editing, switching, renaming, duplication, and deletion. Preserve replaced settings in recovery history and expose existing skill backups without changing the active settings path or command routes.
117
+
118
+ ## 0.59.2
119
+
120
+ ### Patch Changes
121
+
122
+ - 79aca63: Enable existing TUI document search in Starship effective/raw TOML reviews, Recall non-destructive message previews, and Tool exact detail documents.
123
+
124
+ Use a verified published Kit search release without changing raw content, persistence, confirmation, navigation, or RPC pagination. New Kit copy APIs remain outside these consumer changes.
125
+ - Updated dependencies [077137a]
126
+ - Updated dependencies [9f80b89]
127
+ - Updated dependencies [efc474c]
128
+ - @narumitw/pi-tui-kit@0.66.0
129
+
130
+ ## 0.59.1
131
+
132
+ ### Patch Changes
133
+
134
+ - 2e333f1: Rename the bundled configuration skill to `configure-pi-starship`.
135
+ Use `/skill:configure-pi-starship` instead of `/skill:configuring-pi-starship`.
136
+
137
+ ## 0.59.0
138
+
139
+ ### Minor Changes
140
+
141
+ - 6d645f9: Add unlisted GitHub Gist sharing and reviewed settings import to the Configuration menu through GitHub CLI. Import validates and previews TOML before confirmed replacement, with cancellation, bounded requests, and stale-settings protection.
142
+
143
+ ## 0.58.0
144
+
145
+ ### Minor Changes
146
+
147
+ - ba40826: Allow per-status colors in `extension_status.styles` using exact Pi status keys, explicit namespace wildcards, and an optional fallback style.
148
+
149
+ ## 0.57.0
150
+
151
+ ### Minor Changes
152
+
153
+ - 229ebe9: Show raw Pi model IDs by default. Add `model.shorten_model = true` to opt in to shortening, without changing `gpt-` to `gpt `.
154
+
155
+ ## 0.56.3
156
+
157
+ ### Patch Changes
158
+
159
+ - 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.
160
+
161
+ ## 0.56.2
162
+
163
+ ### Patch Changes
164
+
165
+ - 67a3049: Adapt provider, transcript, usage, deferred-tool, and telemetry behavior to Pi's current runtime contracts, including accurate cache-warming accounting and exclusion from ordinary generation traces.
166
+
167
+ ## 0.56.1
168
+
169
+ ### Patch Changes
170
+
171
+ - a2803d2: Import the TOML parser instead of resolving it through `createRequire` so settings load under a compiled Pi binary, whose Jiti loader resolves a call-time `require` against the binary's embedded modules rather than the directory the package was installed into. The runtime build now refuses a generated chunk that resolves a package at call time, and the package has the Jiti-loader test its siblings already carry.
172
+
173
+ ## 0.56.0
174
+
175
+ ### Minor Changes
176
+
177
+ - ff31206: Add ordered exact-match style rules for the provider, model, and thinking modules.
178
+
179
+ ### Patch Changes
180
+
181
+ - 5e61ff4: Keep timestamped long-term backups when the bundled configuration skill replaces an existing pi-starship document.
182
+
183
+ ## 0.55.2
184
+
185
+ ### Patch Changes
186
+
187
+ - d365daa: Publish the updated YAML runtime dependency range.
188
+ - Updated dependencies [d365daa]
189
+ - @narumitw/pi-tui-kit@0.63.1
190
+
191
+ ## 0.55.1
192
+
193
+ ### Patch Changes
194
+
195
+ - c5c0151: Avoid periodic TUI redraw requests when cached footer snapshots are unchanged, while preserving clock updates without rescanning session history on idle ticks.
196
+
197
+ ## 0.55.0
198
+
199
+ ### Minor Changes
200
+
201
+ - f1fffcb: Bundle an authoritative configuration skill with detailed schema, module, runtime, and security references for answering pi-starship setup questions and safely editing or syntax-checking `pi-starship.toml`.
202
+
203
+ ## 0.54.0
204
+
205
+ ### Minor Changes
206
+
207
+ - b87641b: Show when Pi is waiting for blocking extension UI input and restore the underlying activity after the prompt closes.
208
+
209
+ Expose `waiting`, `$kind`, and `$title` through pi-starship's activity module.
210
+
211
+ ### Patch Changes
212
+
213
+ - 36a5ad5: Honor Pi's effective terminal capabilities when rendering pull request hyperlinks and RGB footer colors.
214
+
215
+ ## 0.53.0
216
+
217
+ ### Minor Changes
218
+
219
+ - ca3491a: Add per-level `thinking` styles that preserve the existing `style` fallback, and add exact terminal-safe `provider_aliases` for provider display names.
220
+
221
+ ## 0.52.3
222
+
223
+ ### Patch Changes
224
+
225
+ - Updated dependencies [40182e5]
226
+ - @narumitw/pi-tui-kit@0.59.0
227
+
228
+ ## 0.52.2
229
+
230
+ ### Patch Changes
231
+
232
+ - 3346683: Publish generated lazy chunks at the JavaScript paths referenced by each extension runtime so deferred menus and implementations load correctly through Pi's Jiti loader.
233
+ - Updated dependencies [b9eba3a]
234
+ - @narumitw/pi-tui-kit@0.58.0
235
+
236
+ ## 0.52.1
237
+
238
+ ### Patch Changes
239
+
240
+ - Updated dependencies [6574232]
241
+ - Updated dependencies [cddc265]
242
+ - @narumitw/pi-tui-kit@0.57.0
243
+
244
+ ## 0.52.0
245
+
246
+ ### Minor Changes
247
+
248
+ - 7a61fe5: Add nested configuration views for effective public TOML and the exact loaded settings document, plus a validated preview-and-confirm reload workflow for external edits and file removal.
249
+
250
+ ### Patch Changes
251
+
252
+ - Updated dependencies [f47364f]
253
+ - @narumitw/pi-tui-kit@0.56.1
254
+
255
+ ## 0.51.5
256
+
257
+ ### Patch Changes
258
+
259
+ - 37bf862: Load the extension from a generated split TypeScript runtime to reduce Jiti package startup work while preserving lazy command and collector boundaries.
260
+
261
+ ## 0.51.4
262
+
263
+ ### Patch Changes
264
+
265
+ - 5f0ccd3: Load lightweight Pi TUI Kit helpers without evaluating the full menu runtime during extension startup.
266
+
267
+ ## 0.51.3
268
+
269
+ ### Patch Changes
270
+
271
+ - Updated dependencies [8bead31]
272
+ - @narumitw/pi-tui-kit@0.56.0
273
+
274
+ ## 0.51.2
275
+
276
+ ### Patch Changes
277
+
278
+ - Updated dependencies [3176172]
279
+ - @narumitw/pi-tui-kit@0.55.0
280
+
281
+ ## 0.51.1
282
+
283
+ ### Patch Changes
284
+
285
+ - 11bdf1e: Update runtime dependencies for chat networking, Starship TOML parsing, and TUI syntax highlighting.
286
+ - Updated dependencies [11bdf1e]
287
+ - @narumitw/pi-tui-kit@0.54.1
288
+
289
+ ## 0.51.0
290
+
291
+ ### Minor Changes
292
+
293
+ - ff35763: Render the existing native GitHub PR `$checks`, `$review`, and `$status` variables as compact symbols and counts by default.
294
+
295
+ This is a breaking display change for custom formats that expect the previous English values; variable names and the default module format remain unchanged.
296
+
297
+ ## 0.50.3
298
+
299
+ ### Patch Changes
300
+
301
+ - c3721fd: Reuse Pi TUI Kit's display-only terminal sanitizer for model, symbol, and directory text.
302
+
303
+ ## 0.50.2
304
+
305
+ ### Patch Changes
306
+
307
+ - d403f3c: Use Pi TUI Kit's published Live Choice interaction for preset browsing while keeping active-preset customization available.
308
+
309
+ ## 0.50.1
310
+
311
+ ### Patch Changes
312
+
313
+ - 306a4e5: Use Pi TUI Kit's standard adaptive review screen for the read-only footer explanation while keeping inspection snapshots and formatting in Starship.
314
+ - Updated dependencies [4a0358b]
315
+ - Updated dependencies [93b507b]
316
+ - @narumitw/pi-tui-kit@0.53.0
317
+
318
+ ## 0.50.0
319
+
320
+ ### Minor Changes
321
+
322
+ - 46f59ba: Add four bundled Pi-native footer presets with menu browsing, live preview, optional TOML customization, confirmed atomic application, and built-in recovery.
package/README.md CHANGED
@@ -117,6 +117,9 @@ The built-in Starship example remains an editing seed; saving it enables a Stars
117
117
  Module references cover bounded regex substitutions/context rules, component version formats, Git templates/controls, clock zones/ranges, Python argv alternatives, environment detectors, requirement styling, and private-package visibility.
118
118
  The six Jujutsu/system modules require explicit `disabled = false` plus a root reference or `$all`; see [module behavior](./skills/configure-pi-starship/references/modules.md#jujutsu-modules).
119
119
 
120
+ The cost module preserves its numeric format and can show provider-total provenance through the optional `$source` variable.
121
+ See [usage semantics](./skills/configure-pi-starship/references/modules.md#usage-semantics) for `provider` versus `unconfirmed`, mixed and older sessions, and the separation from account quotas and balances.
122
+
120
123
  ## 🧠 Configuration chat
121
124
 
122
125
  Open `/starship` → **Configure with agent** to adjust the footer in a separate, temporary conversation.
@@ -179,11 +179,11 @@ async function runBounded(context, command, args) {
179
179
  signal: context.input.signal,
180
180
  environment: context.input.environment
181
181
  });
182
+ if (result.truncated) return void 0;
182
183
  if (context.input.signal?.aborted || result.code !== 0 || result.killed) return void 0;
183
- const selectedOutput = result.stdout || result.stderr;
184
- const output = Buffer.from(selectedOutput).subarray(0, MAX_COMMAND_OUTPUT_BYTES + 1);
185
- if (output.byteLength > MAX_COMMAND_OUTPUT_BYTES) return void 0;
186
- return output.toString("utf8");
184
+ if (Buffer.byteLength(result.stdout) + Buffer.byteLength(result.stderr) > MAX_COMMAND_OUTPUT_BYTES)
185
+ return void 0;
186
+ return result.stdout || result.stderr;
187
187
  } catch {
188
188
  return void 0;
189
189
  }
@@ -276,4 +276,4 @@ export {
276
276
  pathName,
277
277
  joinHome
278
278
  };
279
- //# sourceMappingURL=chunk-S2KBLHE2.ts.map
279
+ //# sourceMappingURL=chunk-3XLWHJ5Y.ts.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/format/version.ts", "../../src/runtime/helpers.ts"],
4
+ "sourcesContent": ["import { parseFormat, renderFormat } from \"./formatter.js\";\nimport { isFillChunk } from \"./style.js\";\n\n/** Use the package format grammar, without applying ANSI styles to the version value. */\nexport function formatVersion(raw: string, format: string | undefined): string {\n // Collectors historically pass versions with a leading v. Keep the existing raw value.\n const version = raw.replace(/^v/u, \"\");\n const fallback = `v${version}`;\n const template = format ?? \"v$raw\";\n if (template.length > 4_096) return fallback;\n // Only dotted numeric releases and an optional prerelease/build suffix expose components.\n // Missing components stay absent; malformed releases keep only their raw value.\n const release = /^(\\d+(?:\\.\\d+)*)(?:[-+][0-9A-Za-z.+_-]+|[A-Za-z][0-9A-Za-z.+_-]*)?$/u.exec(version)?.[1];\n const parts = release?.split(\".\").map((part) => part.replace(/^0+(?=\\d)/u, \"\"));\n try {\n return renderFormat(parseFormat(template), {\n variables: { raw: version, major: parts?.[0], minor: parts?.[1], patch: parts?.[2] },\n })\n .map((chunk) => (isFillChunk(chunk) ? \"\" : chunk.text))\n .join(\"\");\n } catch {\n return fallback;\n }\n}\n", "import { constants } from \"node:fs\";\nimport { access, type FileHandle, open, opendir, realpath, stat } from \"node:fs/promises\";\nimport { basename, delimiter, dirname, extname, join, resolve } from \"node:path\";\nimport type { CollectorContext, WorkspaceEntry, WorkspaceFileSystem, WorkspaceRefreshInput } from \"./types.js\";\n\nexport { formatVersion } from \"../format/version.js\";\n\nexport const MAX_METADATA_FILE_BYTES = 64 * 1024;\nexport const COMMAND_TIMEOUT_MS = 2_000;\n// Footer probes need only version, health, or local metadata; omit larger replies in full.\nexport const MAX_COMMAND_OUTPUT_BYTES = 64 * 1024;\nconst MAX_DIRECTORY_ENTRIES = 2_048;\nconst MAX_LABEL_LENGTH = 160;\n\nexport function createFileSystem(input: WorkspaceRefreshInput): WorkspaceFileSystem {\n const defaults: WorkspaceFileSystem = {\n async readFile(path, maxBytes) {\n if (input.signal?.aborted) return undefined;\n let handle: FileHandle | undefined;\n try {\n handle = await open(path, \"r\");\n const info = await handle.stat();\n if (!info.isFile() || info.size > maxBytes) return undefined;\n // procfs can report zero bytes and sysfs can report a nominal page size.\n // Read through EOF, not stat.size, while keeping one overflow byte.\n const buffer = Buffer.alloc(maxBytes + 1);\n let offset = 0;\n while (offset < buffer.length) {\n if (input.signal?.aborted) return undefined;\n const { bytesRead } = await handle.read(buffer, offset, buffer.length - offset, null);\n if (bytesRead === 0) break;\n offset += bytesRead;\n }\n if (input.signal?.aborted || offset > maxBytes) return undefined;\n return buffer.subarray(0, offset).toString(\"utf8\");\n } catch {\n return undefined;\n } finally {\n await handle?.close().catch(() => undefined);\n }\n },\n async readDirectory(path) {\n if (input.signal?.aborted) return [];\n const entries: WorkspaceEntry[] = [];\n try {\n const directory = await opendir(path);\n for await (const entry of directory) {\n if (input.signal?.aborted) break;\n entries.push({\n name: entry.name,\n isFile: entry.isFile(),\n isDirectory: entry.isDirectory(),\n });\n if (entries.length >= MAX_DIRECTORY_ENTRIES) break;\n }\n } catch {\n return [];\n }\n return entries;\n },\n async fileExists(path) {\n try {\n await stat(path);\n return true;\n } catch {\n return false;\n }\n },\n async realPath(path) {\n try {\n return await realpath(path);\n } catch {\n return undefined;\n }\n },\n async isWritable(path) {\n try {\n await access(path, constants.W_OK);\n return true;\n } catch (error) {\n const code = isRecord(error) ? error.code : undefined;\n return code === \"EACCES\" || code === \"EPERM\" || code === \"EROFS\" ? false : undefined;\n }\n },\n };\n return {\n ...defaults,\n ...input.fileSystem,\n ...(input.fileExists ? { fileExists: input.fileExists } : {}),\n };\n}\n\nexport function safeMetadata(value: unknown, maxLength = MAX_LABEL_LENGTH): string | undefined {\n if (typeof value !== \"string\") return undefined;\n const sanitized = Array.from(value, (character) => {\n const code = character.codePointAt(0) ?? 0;\n return code <= 0x1f || (code >= 0x7f && code <= 0x9f) || (code >= 0xd800 && code <= 0xdfff) ? \"\" : character;\n })\n .join(\"\")\n .trim();\n if (!sanitized) return undefined;\n return Array.from(sanitized).slice(0, maxLength).join(\"\");\n}\n\nexport function ownString(record: unknown, key: string): string | undefined {\n if (!isRecord(record) || !Object.hasOwn(record, key)) return undefined;\n return safeMetadata(record[key]);\n}\n\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nexport function setString(record: Record<string, string>, key: string, value: unknown): void {\n const safe = safeMetadata(value);\n if (!safe) return;\n Object.defineProperty(record, key, {\n value: safe,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n}\n\nexport function optionString(\n context: CollectorContext,\n module: Parameters<CollectorContext[\"options\"]>[0],\n key: string,\n): string | undefined {\n const value = context.options(module)[key];\n return typeof value === \"string\" ? value : undefined;\n}\n\nexport function optionBoolean(\n context: CollectorContext,\n module: Parameters<CollectorContext[\"options\"]>[0],\n key: string,\n): boolean {\n return context.options(module)[key] === true;\n}\n\nexport function optionNumber(\n context: CollectorContext,\n module: Parameters<CollectorContext[\"options\"]>[0],\n key: string,\n): number | undefined {\n const value = context.options(module)[key];\n return typeof value === \"number\" ? value : undefined;\n}\n\nexport function optionStrings(\n context: CollectorContext,\n module: Parameters<CollectorContext[\"options\"]>[0],\n key: string,\n): readonly string[] {\n const value = context.options(module)[key];\n return Array.isArray(value) && value.every((item) => typeof item === \"string\") ? value : [];\n}\n\nexport function optionMap(\n context: CollectorContext,\n module: Parameters<CollectorContext[\"options\"]>[0],\n key: string,\n): Readonly<Record<string, string>> {\n const value = context.options(module)[key];\n return isRecord(value) ? (value as Record<string, string>) : {};\n}\n\nexport function exactAlias(value: string | undefined, aliases: Readonly<Record<string, string>>) {\n if (!value) return undefined;\n return Object.hasOwn(aliases, value) ? safeMetadata(aliases[value]) : value;\n}\n\n/** Empty values count as present, as in Starship's Context::detect_env_vars. */\nexport function detectEnvironment(\n environment: Readonly<Record<string, string | undefined>>,\n names: readonly string[],\n): boolean {\n if (names.length === 0) return true;\n let hasPositive = false;\n let positiveMatch = false;\n for (const name of names) {\n const negative = name.startsWith(\"!\");\n const key = negative ? name.slice(1) : name;\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(key)) return false;\n const present = Object.hasOwn(environment, key) && typeof environment[key] === \"string\";\n if (negative && present) return false;\n if (!negative) {\n hasPositive = true;\n positiveMatch ||= present;\n }\n }\n return !hasPositive || positiveMatch;\n}\n\nexport async function runBounded(\n context: CollectorContext,\n command: string,\n args: string[],\n): Promise<string | undefined> {\n if (context.input.signal?.aborted) return undefined;\n try {\n const result = await context.input.exec(command, args, {\n cwd: context.input.cwd,\n timeout: COMMAND_TIMEOUT_MS,\n maxOutputBytes: MAX_COMMAND_OUTPUT_BYTES,\n signal: context.input.signal,\n environment: context.input.environment,\n });\n if (result.truncated) return undefined;\n if (context.input.signal?.aborted || result.code !== 0 || result.killed) return undefined;\n if (Buffer.byteLength(result.stdout) + Buffer.byteLength(result.stderr) > MAX_COMMAND_OUTPUT_BYTES)\n return undefined;\n return result.stdout || result.stderr;\n } catch {\n return undefined;\n }\n}\n\nexport function parseIni(source: string): Record<string, Record<string, string>> {\n const result: Record<string, Record<string, string>> = {};\n let section = \"\";\n for (const rawLine of source.split(/\\r?\\n/u)) {\n const line = rawLine.trim();\n if (!line || line.startsWith(\"#\") || line.startsWith(\";\")) continue;\n const sectionMatch = /^\\[([^\\]]+)\\]$/u.exec(line);\n if (sectionMatch?.[1]) {\n section = sectionMatch[1].trim();\n if (!Object.hasOwn(result, section)) setOwn(result, section, {});\n continue;\n }\n const separator = line.indexOf(\"=\");\n if (separator <= 0) continue;\n const key = line.slice(0, separator).trim();\n const value = safeMetadata(line.slice(separator + 1));\n if (!value) continue;\n if (!Object.hasOwn(result, section)) setOwn(result, section, {});\n setOwn(result[section] as Record<string, string>, key, value);\n }\n return result;\n}\n\nexport function envPathList(value: string | undefined): string[] {\n return (value ?? \"\")\n .split(delimiter)\n .map((part) => part.trim())\n .filter(Boolean);\n}\n\nexport function directMatch(\n entries: readonly WorkspaceEntry[],\n files: readonly string[],\n extensions: readonly string[],\n folders: readonly string[],\n): boolean {\n const positiveFiles = files.filter((value) => !value.startsWith(\"!\"));\n const negativeFiles = new Set(files.filter((value) => value.startsWith(\"!\")).map((v) => v.slice(1)));\n const positiveExtensions = extensions\n .filter((value) => !value.startsWith(\"!\"))\n .map((value) => value.replace(/^\\./u, \"\"));\n const negativeExtensions = new Set(\n extensions.filter((value) => value.startsWith(\"!\")).map((value) => value.slice(1).replace(/^\\./u, \"\")),\n );\n const positiveFolders = folders.filter((value) => !value.startsWith(\"!\"));\n const negativeFolders = new Set(folders.filter((value) => value.startsWith(\"!\")).map((value) => value.slice(1)));\n if (\n entries.some(\n (entry) =>\n negativeFiles.has(entry.name) ||\n (entry.isFile && negativeExtensions.has(extname(entry.name).slice(1))) ||\n (entry.isDirectory && negativeFolders.has(entry.name)),\n )\n ) {\n return false;\n }\n return entries.some(\n (entry) =>\n positiveFiles.includes(entry.name) ||\n (entry.isFile && positiveExtensions.includes(extname(entry.name).slice(1))) ||\n (entry.isDirectory && positiveFolders.includes(entry.name)),\n );\n}\n\nexport function parentDirectories(start: string, limit: number): string[] {\n const result: string[] = [];\n let current = resolve(start);\n for (let index = 0; index < limit; index += 1) {\n const parent = dirname(current);\n if (parent === current) break;\n result.push(parent);\n current = parent;\n }\n return result;\n}\n\nexport function pathName(path: string): string {\n return basename(path.replace(/[\\\\/]+$/u, \"\")) || path;\n}\n\nexport function joinHome(input: WorkspaceRefreshInput, ...parts: string[]): string {\n return join(input.homeDir, ...parts);\n}\n\nfunction setOwn<T>(record: Record<string, T>, key: string, value: T): void {\n Object.defineProperty(record, key, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n}\n"],
5
+ "mappings": ";;;;;;;;;AAIO,SAAS,cAAc,KAAa,QAAoC;AAE7E,QAAM,UAAU,IAAI,QAAQ,OAAO,EAAE;AACrC,QAAM,WAAW,IAAI,OAAO;AAC5B,QAAM,WAAW,UAAU;AAC3B,MAAI,SAAS,SAAS,KAAO,QAAO;AAGpC,QAAM,UAAU,uEAAuE,KAAK,OAAO,IAAI,CAAC;AACxG,QAAM,QAAQ,SAAS,MAAM,GAAG,EAAE,IAAI,CAAC,SAAS,KAAK,QAAQ,cAAc,EAAE,CAAC;AAC9E,MAAI;AACF,WAAO,aAAa,YAAY,QAAQ,GAAG;AAAA,MACzC,WAAW,EAAE,KAAK,SAAS,OAAO,QAAQ,CAAC,GAAG,OAAO,QAAQ,CAAC,GAAG,OAAO,QAAQ,CAAC,EAAE;AAAA,IACrF,CAAC,EACE,IAAI,CAAC,UAAW,YAAY,KAAK,IAAI,KAAK,MAAM,IAAK,EACrD,KAAK,EAAE;AAAA,EACZ,QAAQ;AACN,WAAO;AAAA,EACT;AACF;;;ACvBA,SAAS,iBAAiB;AAC1B,SAAS,QAAyB,MAAM,SAAS,UAAU,YAAY;AACvE,SAAS,UAAU,WAAW,SAAS,SAAS,MAAM,eAAe;AAK9D,IAAM,0BAA0B,KAAK;AACrC,IAAM,qBAAqB;AAE3B,IAAM,2BAA2B,KAAK;AAC7C,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AM,IAAI;AAAA,EACxD,GACA;AACA,WAAO;AAAA,EACT;AACA,SAAO,QAAQ;AAAA,IACb,CAAC,UACC,cAAc,SAAS,MAAM,IAAI,KAChC,MAAM,UAAU,mBAAmB,SAAS,QAAQ,MAAM,IAAI,EAAE,MAAM,CAAC,CAAC,KACxE,MAAM,eAAe,gBAAgB,SAAS,MAAM,IAAI;AAAA,EAC7D;AACF;AAEO,SAAS,kBAAkB,OAAe,OAAyB;AACxE,QAAM,SAAmB,CAAC;AAC1B,MAAI,UAAU,QAAQ,KAAK;AAC3B,WAAS,QAAQ,GAAG,QAAQ,OAAO,SAAS,GAAG;AAC7C,UAAM,SAAS,QAAQ,OAAO;AAC9B,QAAI,WAAW,QAAS;AACxB,WAAO,KAAK,MAAM;AAClB,cAAU;AAAA,EACZ;AACA,SAAO;AACT;AAEO,SAAS,SAAS,MAAsB;AAC7C,SAAO,SAAS,KAAK,QAAQ,YAAY,EAAE,CAAC,KAAK;AACnD;AAEO,SAAS,SAAS,UAAiC,OAAyB;AACjF,SAAO,KAAK,MAAM,SAAS,GAAG,KAAK;AACrC;AAEA,SAAS,OAAU,QAA2B,KAAa,OAAgB;AACzE,SAAO,eAAe,QAAQ,KAAK;AAAA,IACjC;AAAA,IACA,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,cAAc;AAAA,EAChB,CAAC;AACH;",
6
+ "names": []
7
+ }
@@ -396,7 +396,7 @@ var contextModule = defineModule({
396
396
  // src/modules/cost.ts
397
397
  var costModule = defineModule({
398
398
  name: "cost",
399
- variables: ["symbol", "cost", "subscription"],
399
+ variables: ["symbol", "cost", "subscription", "source"],
400
400
  defaults: {
401
401
  format: "[ $symbol \\$$cost( $subscription) ]($style)",
402
402
  symbol: "\u{1F4B8}",
@@ -415,6 +415,7 @@ var costModule = defineModule({
415
415
  },
416
416
  values: ({ runtime }) => ({
417
417
  cost: formatCost(runtime.tokenTotals.cost),
418
+ source: runtime.tokenTotals.costTotalFromProvider === true ? "provider" : "unconfirmed",
418
419
  subscription: runtime.usingSubscription ? "(sub)" : ""
419
420
  })
420
421
  });
@@ -1992,7 +1993,7 @@ var MODULE_DESCRIPTIONS = {
1992
1993
  conda: "Active Conda environment.",
1993
1994
  container: "Current container or remote development environment.",
1994
1995
  context: "Current model context-window usage.",
1995
- cost: "Reported estimated session cost or subscription state.",
1996
+ cost: "Session cost, provider-total provenance, and subscription state.",
1996
1997
  deno: "Deno version detected in the current workspace.",
1997
1998
  directory: "Current working directory.",
1998
1999
  direnv: "Current direnv loading and permission state.",
@@ -2698,4 +2699,4 @@ export {
2698
2699
  removeConfigDocumentIfMatches,
2699
2700
  activePalette
2700
2701
  };
2701
- //# sourceMappingURL=chunk-I22B7QPQ.ts.map
2702
+ //# sourceMappingURL=chunk-5YA3XF7S.ts.map