@narumitw/pi-starship 0.55.1 → 0.55.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 (99) hide show
  1. package/dist/chunks/{chunk-UX6PBXVK.js → chunk-JO5PH6FN.js} +28 -110
  2. package/dist/chunks/chunk-JO5PH6FN.js.map +7 -0
  3. package/dist/chunks/{chunk-P4XMFSQW.js → chunk-YWY5RIDQ.js} +3 -7
  4. package/dist/chunks/chunk-YWY5RIDQ.js.map +7 -0
  5. package/dist/chunks/{chunk-EOGXAMTA.js → chunk-ZQZSXXPI.js} +1 -1
  6. package/dist/chunks/chunk-ZQZSXXPI.js.map +7 -0
  7. package/dist/chunks/{cloud-BKHYWCTA.js → cloud-C4VU3TX3.js} +7 -14
  8. package/dist/chunks/cloud-C4VU3TX3.js.map +7 -0
  9. package/dist/chunks/{commands-53ZO2JUK.js → commands-ATILSUVK.js} +13 -42
  10. package/dist/chunks/commands-ATILSUVK.js.map +7 -0
  11. package/dist/chunks/{deployment-RKKOEQQ2.js → deployment-FMNTYRBW.js} +6 -21
  12. package/dist/chunks/deployment-FMNTYRBW.js.map +7 -0
  13. package/dist/chunks/{development-BERD42HW.js → development-OUYXDPBS.js} +4 -8
  14. package/dist/chunks/development-OUYXDPBS.js.map +7 -0
  15. package/dist/chunks/{execution-42JTEY3N.js → execution-HJOGLMWD.js} +3 -3
  16. package/dist/chunks/execution-HJOGLMWD.js.map +7 -0
  17. package/dist/chunks/{languages-RMP6DW7H.js → languages-WXMF4GOF.js} +6 -22
  18. package/dist/chunks/languages-WXMF4GOF.js.map +7 -0
  19. package/dist/chunks/{package-LG5H7BBM.js → package-YXRZQAOV.js} +5 -14
  20. package/dist/chunks/package-YXRZQAOV.js.map +7 -0
  21. package/dist/index.ts +20 -55
  22. package/dist/index.ts.map +2 -2
  23. package/package.json +60 -61
  24. package/skills/configuring-pi-starship/scripts/apply.mjs +43 -47
  25. package/skills/configuring-pi-starship/scripts/config-path.mjs +3 -3
  26. package/skills/configuring-pi-starship/scripts/script-support.mjs +6 -6
  27. package/skills/configuring-pi-starship/scripts/validate.mjs +18 -18
  28. package/src/command-configuration.ts +267 -286
  29. package/src/command-contract.ts +6 -6
  30. package/src/command-inspector.ts +27 -27
  31. package/src/command-preset-picker.ts +45 -50
  32. package/src/command-preview.ts +153 -166
  33. package/src/commands.ts +588 -618
  34. package/src/config.ts +580 -660
  35. package/src/effective-config.ts +46 -48
  36. package/src/format/formatter.ts +211 -227
  37. package/src/format/style.ts +205 -216
  38. package/src/modules/activity.ts +74 -74
  39. package/src/modules/brand.ts +9 -9
  40. package/src/modules/cache.ts +18 -18
  41. package/src/modules/catalog.ts +79 -83
  42. package/src/modules/cloud.ts +54 -54
  43. package/src/modules/context.ts +27 -27
  44. package/src/modules/cost.ts +23 -23
  45. package/src/modules/deployment.ts +45 -45
  46. package/src/modules/development.ts +80 -81
  47. package/src/modules/directory.ts +89 -113
  48. package/src/modules/display.ts +9 -9
  49. package/src/modules/execution.ts +62 -69
  50. package/src/modules/extension-status.ts +59 -64
  51. package/src/modules/fill.ts +10 -10
  52. package/src/modules/git/branch.ts +26 -26
  53. package/src/modules/git/commit.ts +21 -23
  54. package/src/modules/git/metrics.ts +22 -22
  55. package/src/modules/git/runtime.ts +299 -334
  56. package/src/modules/git/state.ts +17 -17
  57. package/src/modules/git/status.ts +77 -79
  58. package/src/modules/git/worktree.ts +10 -12
  59. package/src/modules/github-pr.ts +20 -20
  60. package/src/modules/helpers.ts +3 -3
  61. package/src/modules/index.ts +21 -21
  62. package/src/modules/inspection.ts +101 -108
  63. package/src/modules/languages.ts +52 -59
  64. package/src/modules/model.ts +57 -67
  65. package/src/modules/package.ts +12 -12
  66. package/src/modules/provider.ts +22 -24
  67. package/src/modules/render.ts +124 -140
  68. package/src/modules/thinking.ts +27 -26
  69. package/src/modules/time.ts +10 -13
  70. package/src/modules/tokens.ts +13 -13
  71. package/src/modules/truncation.ts +14 -17
  72. package/src/modules/turn.ts +9 -9
  73. package/src/modules/types.ts +125 -132
  74. package/src/modules/workspace-helpers.ts +4 -7
  75. package/src/pi-starship.ts +567 -603
  76. package/src/presets/catalog.ts +113 -113
  77. package/src/runtime/cloud.ts +122 -150
  78. package/src/runtime/command.ts +106 -108
  79. package/src/runtime/deployment.ts +150 -179
  80. package/src/runtime/development.ts +107 -124
  81. package/src/runtime/execution.ts +110 -124
  82. package/src/runtime/github-pr.ts +223 -252
  83. package/src/runtime/helpers.ts +186 -199
  84. package/src/runtime/languages.ts +149 -180
  85. package/src/runtime/package.ts +74 -87
  86. package/src/runtime/refresh-controller.ts +82 -86
  87. package/src/runtime/types.ts +38 -38
  88. package/src/runtime/workspace.ts +108 -116
  89. package/src/usage.ts +40 -40
  90. package/dist/chunks/chunk-EOGXAMTA.js.map +0 -7
  91. package/dist/chunks/chunk-P4XMFSQW.js.map +0 -7
  92. package/dist/chunks/chunk-UX6PBXVK.js.map +0 -7
  93. package/dist/chunks/cloud-BKHYWCTA.js.map +0 -7
  94. package/dist/chunks/commands-53ZO2JUK.js.map +0 -7
  95. package/dist/chunks/deployment-RKKOEQQ2.js.map +0 -7
  96. package/dist/chunks/development-BERD42HW.js.map +0 -7
  97. package/dist/chunks/execution-42JTEY3N.js.map +0 -7
  98. package/dist/chunks/languages-RMP6DW7H.js.map +0 -7
  99. package/dist/chunks/package-LG5H7BBM.js.map +0 -7
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/runtime/cloud.ts"],
4
+ "sourcesContent": ["import { join } from \"node:path\";\nimport { parse as parseYaml } from \"yaml\";\nimport {\n exactAlias,\n isRecord,\n joinHome,\n MAX_METADATA_FILE_BYTES,\n optionBoolean,\n optionMap,\n parseIni,\n safeMetadata,\n} from \"./helpers.js\";\nimport type { CollectorContext, MutableModuleSnapshot } from \"./types.js\";\n\nexport async function collectCloud(context: CollectorContext): Promise<MutableModuleSnapshot> {\n const result: MutableModuleSnapshot = {};\n if (context.needs(\"aws\")) {\n const values = await collectAws(context);\n if (values) result.aws = values;\n }\n if (context.needs(\"gcloud\")) {\n const values = await collectGcloud(context);\n if (values) result.gcloud = values;\n }\n if (context.needs(\"azure\")) {\n const values = await collectAzure(context);\n if (values) result.azure = values;\n }\n if (context.needs(\"openstack\")) {\n const values = await collectOpenstack(context);\n if (values) result.openstack = values;\n }\n return result;\n}\n\nasync function collectAws(context: CollectorContext): Promise<Record<string, string> | undefined> {\n const env = context.input.environment;\n const profile = safeMetadata(env.AWS_PROFILE) ?? safeMetadata(env.AWS_DEFAULT_PROFILE) ?? \"default\";\n let region = safeMetadata(env.AWS_REGION) ?? safeMetadata(env.AWS_DEFAULT_REGION);\n if (!region) {\n const configPath = safeMetadata(env.AWS_CONFIG_FILE, 1_024) ?? joinHome(context.input, \".aws\", \"config\");\n const source = await context.fs.readFile(configPath, MAX_METADATA_FILE_BYTES);\n if (source) {\n const section = profile === \"default\" ? \"default\" : `profile ${profile}`;\n region = safeMetadata(parseIni(source)[section]?.region);\n }\n }\n if (profile === \"default\" && !region && !env.AWS_PROFILE && !env.AWS_DEFAULT_PROFILE) return undefined;\n const values: Record<string, string> = {\n profile: exactAlias(profile, optionMap(context, \"aws\", \"profile_aliases\")) ?? profile,\n };\n if (region) values.region = exactAlias(region, optionMap(context, \"aws\", \"region_aliases\")) ?? region;\n return values;\n}\n\nasync function collectGcloud(context: CollectorContext): Promise<Record<string, string> | undefined> {\n const env = context.input.environment;\n const directory = safeMetadata(env.CLOUDSDK_CONFIG, 1_024) ?? joinHome(context.input, \".config\", \"gcloud\");\n const active =\n safeMetadata(env.CLOUDSDK_ACTIVE_CONFIG_NAME) ??\n safeMetadata(await context.fs.readFile(join(directory, \"active_config\"), 256));\n if (!active || !/^[A-Za-z0-9_-]+$/u.test(active)) return undefined;\n const source = await context.fs.readFile(\n join(directory, \"configurations\", `config_${active}`),\n MAX_METADATA_FILE_BYTES,\n );\n if (!source) return { active };\n const document = parseIni(source);\n const account = safeMetadata(document.core?.account);\n const project = safeMetadata(document.core?.project);\n const region = safeMetadata(document.compute?.region);\n const values: Record<string, string> = { active };\n if (account) {\n values.account = account;\n const separator = account.lastIndexOf(\"@\");\n if (separator >= 0 && separator < account.length - 1) values.domain = account.slice(separator + 1);\n }\n if (project) {\n values.project = exactAlias(project, optionMap(context, \"gcloud\", \"project_aliases\")) ?? project;\n }\n if (region) values.region = exactAlias(region, optionMap(context, \"gcloud\", \"region_aliases\")) ?? region;\n return values;\n}\n\nasync function collectAzure(context: CollectorContext): Promise<Record<string, string> | undefined> {\n const directory =\n safeMetadata(context.input.environment.AZURE_CONFIG_DIR, 1_024) ?? joinHome(context.input, \".azure\");\n const source = await context.fs.readFile(join(directory, \"azureProfile.json\"), MAX_METADATA_FILE_BYTES);\n if (!source) return undefined;\n try {\n const document = JSON.parse(source.replace(/^\\uFEFF/u, \"\")) as unknown;\n const subscriptions =\n isRecord(document) && Array.isArray(document.subscriptions) ? document.subscriptions.filter(isRecord) : [];\n const selected = subscriptions.find((item) => item.isDefault === true) ?? subscriptions[0];\n const subscription = safeMetadata(selected?.name);\n if (!subscription) return undefined;\n const values: Record<string, string> = {\n subscription: exactAlias(subscription, optionMap(context, \"azure\", \"subscription_aliases\")) ?? subscription,\n };\n if (optionBoolean(context, \"azure\", \"show_username\")) {\n const user = isRecord(selected?.user) ? selected.user : undefined;\n const username = safeMetadata(user?.name);\n if (username) values.username = username;\n }\n return values;\n } catch {\n return undefined;\n }\n}\n\nasync function collectOpenstack(context: CollectorContext): Promise<Record<string, string> | undefined> {\n const env = context.input.environment;\n const cloud = safeMetadata(env.OS_CLOUD);\n let project = safeMetadata(env.OS_PROJECT_NAME);\n if (!cloud) return undefined;\n if (!project) {\n const path =\n safeMetadata(env.OS_CLIENT_CONFIG_FILE, 1_024) ?? joinHome(context.input, \".config\", \"openstack\", \"clouds.yaml\");\n const source = await context.fs.readFile(path, MAX_METADATA_FILE_BYTES);\n if (source) {\n try {\n const document = parseYaml(source) as unknown;\n const clouds = isRecord(document) && isRecord(document.clouds) ? document.clouds : undefined;\n const selected = clouds && Object.hasOwn(clouds, cloud) && isRecord(clouds[cloud]) ? clouds[cloud] : undefined;\n const auth = isRecord(selected?.auth) ? selected.auth : undefined;\n project = safeMetadata(auth?.project_name);\n } catch {\n // Malformed YAML is ignored.\n }\n }\n }\n const values: Record<string, string> = {\n cloud: exactAlias(cloud, optionMap(context, \"openstack\", \"cloud_aliases\")) ?? cloud,\n };\n if (project) {\n values.project = exactAlias(project, optionMap(context, \"openstack\", \"project_aliases\")) ?? project;\n }\n return values;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA,SAAS,YAAY;AACrB,SAAS,SAAS,iBAAiB;AAanC,eAAsB,aAAa,SAA2D;AAC5F,QAAM,SAAgC,CAAC;AACvC,MAAI,QAAQ,MAAM,KAAK,GAAG;AACxB,UAAM,SAAS,MAAM,WAAW,OAAO;AACvC,QAAI,OAAQ,QAAO,MAAM;AAAA,EAC3B;AACA,MAAI,QAAQ,MAAM,QAAQ,GAAG;AAC3B,UAAM,SAAS,MAAM,cAAc,OAAO;AAC1C,QAAI,OAAQ,QAAO,SAAS;AAAA,EAC9B;AACA,MAAI,QAAQ,MAAM,OAAO,GAAG;AAC1B,UAAM,SAAS,MAAM,aAAa,OAAO;AACzC,QAAI,OAAQ,QAAO,QAAQ;AAAA,EAC7B;AACA,MAAI,QAAQ,MAAM,WAAW,GAAG;AAC9B,UAAM,SAAS,MAAM,iBAAiB,OAAO;AAC7C,QAAI,OAAQ,QAAO,YAAY;AAAA,EACjC;AACA,SAAO;AACT;AAEA,eAAe,WAAW,SAAwE;AAChG,QAAM,MAAM,QAAQ,MAAM;AAC1B,QAAM,UAAU,aAAa,IAAI,WAAW,KAAK,aAAa,IAAI,mBAAmB,KAAK;AAC1F,MAAI,SAAS,aAAa,IAAI,UAAU,KAAK,aAAa,IAAI,kBAAkB;AAChF,MAAI,CAAC,QAAQ;AACX,UAAM,aAAa,aAAa,IAAI,iBAAiB,I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ACtG,QAAM,MAAM,QAAQ,MAAM;AAC1B,QAAM,QAAQ,aAAa,IAAI,QAAQ;AACvC,MAAI,UAAU,aAAa,IAAI,eAAe;AAC9C,MAAI,CAAC,MAAO,QAAO;AACnB,MAAI,CAAC,SAAS;AACZ,UAAM,OACJ,aAAa,IAAI,uBAAuB,IAAK,KAAK,SAAS,QAAQ,OAAO,WAAW,aAAa,aAAa;AACjH,UAAM,SAAS,MAAM,QAAQ,GAAG,SAAS,MAAM,uBAAuB;AACtE,QAAI,QAAQ;AACV,UAAI;AACF,cAAM,WAAW,UAAU,MAAM;AACjC,cAAM,SAAS,SAAS,QAAQ,KAAK,SAAS,SAAS,MAAM,IAAI,SAAS,SAAS;AACnF,cAAM,WAAW,UAAU,OAAO,OAAO,QAAQ,KAAK,KAAK,SAAS,OAAO,KAAK,CAAC,IAAI,OAAO,KAAK,IAAI;AACrG,cAAM,OAAO,SAAS,UAAU,IAAI,IAAI,SAAS,OAAO;AACxD,kBAAU,aAAa,MAAM,YAAY;AAAA,MAC3C,QAAQ;AAAA,MAER;AAAA,IACF;AAAA,EACF;AACA,QAAM,SAAiC;AAAA,IACrC,OAAO,WAAW,OAAO,UAAU,SAAS,aAAa,eAAe,CAAC,KAAK;AAAA,EAChF;AACA,MAAI,SAAS;AACX,WAAO,UAAU,WAAW,SAAS,UAAU,SAAS,aAAa,iBAAiB,CAAC,KAAK;AAAA,EAC9F;AACA,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -11,7 +11,7 @@ import {
11
11
  loadStarshipConfig,
12
12
  removeConfigDocumentIfMatches,
13
13
  validateConfigDocument
14
- } from "./chunk-UX6PBXVK.js";
14
+ } from "./chunk-JO5PH6FN.js";
15
15
 
16
16
  // src/commands.ts
17
17
  import { defineMenu, runMenu } from "@narumitw/pi-tui-kit";
@@ -52,9 +52,7 @@ async function showPreviewActionMenu(ctx, title, body, items, signal, isCurrent
52
52
  const safeWidth = Math.max(1, width);
53
53
  const terminalRows = Number.isFinite(tui.terminal.rows) ? Math.floor(tui.terminal.rows) : 24;
54
54
  const availableRows = Math.max(1, terminalRows - RESERVED_HOST_ROWS);
55
- const bodyLines = body(safeWidth).flatMap(
56
- (line) => line ? wrapTextWithAnsi(line, safeWidth) : [""]
57
- );
55
+ const bodyLines = body(safeWidth).flatMap((line) => line ? wrapTextWithAnsi(line, safeWidth) : [""]);
58
56
  const layout = allocateLayout(availableRows, items.length, bodyLines.length);
59
57
  lastViewportSize = layout.previewRows;
60
58
  lastMaximumScroll = Math.max(0, bodyLines.length - layout.previewRows);
@@ -122,10 +120,7 @@ function allocateLayout(availableRows, actionCount, bodyLineCount) {
122
120
  const titleRows = availableRows >= 3 ? 1 : 0;
123
121
  const hintRows = availableRows >= 3 ? 1 : 0;
124
122
  const minimumPreviewRows = bodyLineCount > 0 && availableRows >= 4 ? 1 : 0;
125
- const availableActionRows = Math.max(
126
- 1,
127
- availableRows - titleRows - hintRows - minimumPreviewRows
128
- );
123
+ const availableActionRows = Math.max(1, availableRows - titleRows - hintRows - minimumPreviewRows);
129
124
  const actionRows = Math.min(Math.max(1, actionCount), availableActionRows);
130
125
  let previewRows = Math.max(0, availableRows - titleRows - hintRows - actionRows);
131
126
  const positionRows = previewRows >= 2 && bodyLineCount > previewRows ? 1 : 0;
@@ -227,9 +222,7 @@ function sortedRecord(values) {
227
222
  return Object.fromEntries(sortedEntries(values));
228
223
  }
229
224
  function sortedEntries(values) {
230
- return Object.entries(values).sort(
231
- ([left], [right]) => left < right ? -1 : left > right ? 1 : 0
232
- );
225
+ return Object.entries(values).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0);
233
226
  }
234
227
 
235
228
  // src/presets/bracketed-segments.ts
@@ -1125,10 +1118,7 @@ function settingsDocumentScreen(loaded, settingsPath) {
1125
1118
  kind: "detail",
1126
1119
  title: "Settings document",
1127
1120
  lines: [
1128
- ...isHealthyMissing(loaded) ? [
1129
- "No settings document exists.",
1130
- "Built-in defaults are active; this read created no file."
1131
- ] : ["The settings document could not be loaded.", ...diagnosticLines(loaded, false)],
1121
+ ...isHealthyMissing(loaded) ? ["No settings document exists.", "Built-in defaults are active; this read created no file."] : ["The settings document could not be loaded.", ...diagnosticLines(loaded, false)],
1132
1122
  `Path: ${path}`
1133
1123
  ],
1134
1124
  hint: "back"
@@ -1222,9 +1212,7 @@ function reloadPreviewBody(ctx, options, loaded, width) {
1222
1212
  const presentation = configurationPresentation(loaded);
1223
1213
  let preview;
1224
1214
  try {
1225
- preview = options.renderPreview?.(loaded, width, ctx) ?? [
1226
- "Live preview is unavailable until the footer is ready."
1227
- ];
1215
+ preview = options.renderPreview?.(loaded, width, ctx) ?? ["Live preview is unavailable until the footer is ready."];
1228
1216
  } catch (error) {
1229
1217
  preview = [`Preview unavailable: ${safeError(formatError(error))}`];
1230
1218
  }
@@ -1239,9 +1227,7 @@ function reloadPreviewBody(ctx, options, loaded, width) {
1239
1227
  ];
1240
1228
  }
1241
1229
  function diagnosticLines(loaded, includeSummary) {
1242
- const diagnostics = loaded.diagnostics.slice(0, 8).map(
1243
- (item) => `${sanitizeTerminalText(item.path || "root")}: ${sanitizeTerminalText(item.message)}`
1244
- );
1230
+ const diagnostics = loaded.diagnostics.slice(0, 8).map((item) => `${sanitizeTerminalText(item.path || "root")}: ${sanitizeTerminalText(item.message)}`);
1245
1231
  const remaining = loaded.diagnostics.length - diagnostics.length;
1246
1232
  return [
1247
1233
  ...includeSummary ? [`Health: ${configurationHealth(loaded)}`] : [],
@@ -1325,9 +1311,7 @@ async function showPresetPicker(ctx, options) {
1325
1311
  id: preset.id,
1326
1312
  label: preset.label,
1327
1313
  description: preset.id === options.activePresetId ? `Currently applied \xB7 ${preset.description}` : preset.description,
1328
- details: [
1329
- `Selected: ${preset.label} \xB7 ${preset.requiresNerdFont ? "requires Nerd Font" : "font-safe"}`
1330
- ],
1314
+ details: [`Selected: ${preset.label} \xB7 ${preset.requiresNerdFont ? "requires Nerd Font" : "font-safe"}`],
1331
1315
  confirmationDisabled: preset.id === options.activePresetId,
1332
1316
  confirmationDisabledReason: "Already applied; press e to customize"
1333
1317
  })),
@@ -1485,9 +1469,7 @@ async function showMainMenu(ctx, options) {
1485
1469
  label: module.name,
1486
1470
  statusText: module.state,
1487
1471
  description: module.description,
1488
- searchText: [...module.variables, ...module.styleFields, ...module.displayRules].join(
1489
- " "
1490
- ),
1472
+ searchText: [...module.variables, ...module.styleFields, ...module.displayRules].join(" "),
1491
1473
  details: [
1492
1474
  `Root: ${module.rootReferenced ? "Referenced" : "Not referenced"}`,
1493
1475
  `Reachable: ${module.reachable ? "Yes" : "No"}`,
@@ -1602,10 +1584,7 @@ async function choosePreset(ctx, options, owner) {
1602
1584
  signal: owner.signal,
1603
1585
  isCurrent: owner.isCurrent,
1604
1586
  preview(preset2) {
1605
- const loaded = (options.validate ?? validateConfigDocument)(
1606
- options.settingsPath,
1607
- preset2.rawDocument
1608
- );
1587
+ const loaded = (options.validate ?? validateConfigDocument)(options.settingsPath, preset2.rawDocument);
1609
1588
  options.preview?.(loaded, ctx);
1610
1589
  }
1611
1590
  });
@@ -1619,12 +1598,7 @@ async function choosePreset(ctx, options, owner) {
1619
1598
  }
1620
1599
  const preset = getStarshipPreset(selection.presetId);
1621
1600
  try {
1622
- return await applyPreset(
1623
- ctx,
1624
- options,
1625
- preset,
1626
- selection.kind === "customize" ? "customize" : "confirm"
1627
- );
1601
+ return await applyPreset(ctx, options, preset, selection.kind === "customize" ? "customize" : "confirm");
1628
1602
  } finally {
1629
1603
  options.preview?.(void 0, ctx);
1630
1604
  }
@@ -1680,10 +1654,7 @@ async function applyPreset(ctx, options, preset, start = "review") {
1680
1654
  async function restoreBuiltIn(ctx, options) {
1681
1655
  const owner = workflowOwner(options);
1682
1656
  if (!isCurrentOwner2(owner)) return "cancel";
1683
- const validated = (options.validate ?? validateConfigDocument)(
1684
- options.settingsPath,
1685
- BUILT_IN_EXAMPLE
1686
- );
1657
+ const validated = (options.validate ?? validateConfigDocument)(options.settingsPath, BUILT_IN_EXAMPLE);
1687
1658
  const result = await reviewAndApply(ctx, options, validated, { kind: "restore" }, owner);
1688
1659
  return result === "edit" ? "cancel" : result;
1689
1660
  }
@@ -1915,4 +1886,4 @@ export {
1915
1886
  handleStarshipCommand,
1916
1887
  registerStarshipCommand
1917
1888
  };
1918
- //# sourceMappingURL=commands-53ZO2JUK.js.map
1889
+ //# sourceMappingURL=commands-ATILSUVK.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/commands.ts", "../../src/command-configuration.ts", "../../src/command-preview.ts", "../../src/effective-config.ts", "../../src/presets/bracketed-segments.ts", "../../src/presets/catppuccin-powerline.ts", "../../src/presets/gruvbox-rainbow.ts", "../../src/presets/jetpack.ts", "../../src/presets/minimal.ts", "../../src/presets/nerd-font-symbols.ts", "../../src/presets/no-empty-icons.ts", "../../src/presets/no-nerd-font.ts", "../../src/presets/no-runtime-versions.ts", "../../src/presets/pastel-powerline.ts", "../../src/presets/plain-text-symbols.ts", "../../src/presets/pure-preset.ts", "../../src/presets/tokyo-night.ts", "../../src/presets/catalog.ts", "../../src/command-inspector.ts", "../../src/command-preset-picker.ts"],
4
+ "sourcesContent": ["import type { ExtensionAPI, ExtensionCommandContext } from \"@earendil-works/pi-coding-agent\";\nimport { defineMenu, runMenu } from \"@narumitw/pi-tui-kit\";\nimport {\n type ConfigurationCommandOptions,\n configurationMenuScreen,\n configurationOverviewScreen,\n configurationPresentation,\n effectiveConfigurationScreen,\n reloadConfiguration,\n settingsDocumentScreen,\n type WorkflowOwner,\n} from \"./command-configuration.js\";\nimport { completeStarshipArguments, STARSHIP_SUBCOMMANDS } from \"./command-contract.js\";\nimport { formatFooterExplanation } from \"./command-inspector.js\";\nimport { showPresetPicker } from \"./command-preset-picker.js\";\nimport { type PreviewMenuResult, showPreviewActionMenu } from \"./command-preview.js\";\nimport {\n atomicRestoreConfigDocument,\n atomicSaveConfigDocument,\n BUILT_IN_EXAMPLE,\n type LoadedStarshipConfig,\n removeConfigDocumentIfMatches,\n validateConfigDocument,\n} from \"./config.js\";\nimport { inspectUnavailableModules, type StatuslineInspection } from \"./modules/inspection.js\";\nimport { getStarshipPreset, presetForDocument, STARSHIP_PRESETS, type StarshipPreset } from \"./presets/catalog.js\";\n\nconst MAIN_ACTIONS = {\n customize: \"customize\",\n presets: \"presets\",\n explain: \"explain\",\n modules: \"modules\",\n configuration: \"configuration\",\n help: \"help\",\n restore: \"restore\",\n} as const;\n\nconst PREVIEW_ACTIONS = {\n continue: \"continue\",\n edit: \"edit\",\n cancel: \"cancel\",\n} as const;\n\nexport interface StarshipCommandOptions extends ConfigurationCommandOptions {\n getInspection?(): StatuslineInspection | undefined;\n preview?(loaded: LoadedStarshipConfig | undefined, ctx: ExtensionCommandContext): void;\n save?: (settingsPath: string, rawDocument: string) => LoadedStarshipConfig;\n restore?: (settingsPath: string, rawDocument: string) => void;\n validate?: (settingsPath: string, rawDocument: string) => LoadedStarshipConfig;\n getMenuOwner?(): WorkflowOwner;\n}\n\ntype ReviewIntent = { kind: \"customize\" } | { kind: \"restore\" } | { kind: \"preset\"; preset: StarshipPreset };\n\nexport function registerStarshipCommand(pi: ExtensionAPI, options: StarshipCommandOptions) {\n pi.registerCommand(\"starship\", {\n description: \"Customize or inspect the native Starship-style footer\",\n getArgumentCompletions: completeStarshipArguments,\n handler: (args, ctx) => handleStarshipCommand(args, ctx, options),\n });\n}\n\nexport async function handleStarshipCommand(\n args: string,\n ctx: ExtensionCommandContext,\n options: StarshipCommandOptions,\n) {\n const normalized = args.trim();\n if (!normalized) {\n if (ctx.mode === \"tui\") await showMainMenu(ctx, options);\n else showHelp(ctx, options.settingsPath);\n return;\n }\n\n const [subcommand = \"\", ...trailing] = normalized.split(/\\s+/u);\n const route = subcommand.toLowerCase();\n if (trailing.length > 0 || !STARSHIP_SUBCOMMANDS.some((item) => item.value === route)) {\n if (canNotify(ctx)) {\n const reason =\n trailing.length > 0\n ? `Unexpected arguments for /starship ${safeText(route)}.`\n : `Unknown /starship subcommand: ${safeText(route)}.`;\n ctx.ui.notify(`${reason} Usage: /starship [settings|status|help]`, \"warning\");\n }\n return;\n }\n switch (route) {\n case \"settings\":\n await editSettings(ctx, options);\n return;\n case \"status\":\n showStatus(ctx, options);\n return;\n case \"help\":\n showHelp(ctx, options.settingsPath);\n return;\n }\n}\n\nasync function showMainMenu(ctx: ExtensionCommandContext, options: StarshipCommandOptions) {\n const fallbackController = new AbortController();\n const owner = options.getMenuOwner?.() ?? {\n signal: fallbackController.signal,\n isCurrent: () => !fallbackController.signal.aborted,\n };\n type Screen =\n | \"main\"\n | \"explain\"\n | \"modules\"\n | \"configuration\"\n | \"configuration-overview\"\n | \"configuration-effective\"\n | \"configuration-document\"\n | \"help\";\n type Action = \"customize\" | \"presets\" | \"configuration-reload\" | \"restore\";\n const menu = defineMenu<undefined, Screen, Action, ExtensionCommandContext>({\n start: \"main\",\n screens: {\n main: () => {\n const loaded = options.getLoaded();\n const presentation = configurationPresentation(loaded);\n return {\n kind: \"actions\",\n title: \"pi-starship\",\n lines: [`${presentation.state} \u00B7 ${presentation.health}`],\n items: [\n {\n id: MAIN_ACTIONS.customize,\n label: \"Customize footer\",\n description: `${presentation.state} \u00B7 preview before applying`,\n action: \"customize\",\n },\n {\n id: MAIN_ACTIONS.presets,\n label: \"Presets\",\n description: \"Browse and live-preview bundled footer starting points\",\n action: \"presets\",\n },\n {\n id: MAIN_ACTIONS.explain,\n label: \"Explain footer\",\n description: \"Why each visible module appears\",\n to: \"explain\",\n },\n {\n id: MAIN_ACTIONS.modules,\n label: \"Modules\",\n description: \"Browse supported modules and current states\",\n to: \"modules\",\n },\n {\n id: MAIN_ACTIONS.configuration,\n label: \"Configuration\",\n description: presentation.health,\n to: \"configuration\",\n },\n {\n id: MAIN_ACTIONS.help,\n label: \"Help\",\n description: \"Formats, modules, and commands\",\n to: \"help\",\n },\n {\n id: MAIN_ACTIONS.restore,\n label: \"Restore built-in\u2026\",\n description: presentation.restoreDescription,\n disabled: presentation.restoreDisabled,\n action: \"restore\",\n },\n ],\n hint: \"close\",\n };\n },\n explain: () => ({\n kind: \"review\",\n title: \"Explain footer\",\n content: formatFooterExplanation(options.getInspection?.()),\n format: { kind: \"text\" },\n viewportSize: \"adaptive\",\n hint: \"back\",\n }),\n modules: () => {\n const inspection = options.getInspection?.() ?? inspectUnavailableModules(options.getLoaded().config);\n return {\n kind: \"browse\",\n title: \"Modules\",\n items: inspection.modules.map((module) => ({\n id: module.name,\n label: module.name,\n statusText: module.state,\n description: module.description,\n searchText: [...module.variables, ...module.styleFields, ...module.displayRules].join(\" \"),\n details: [\n `Root: ${module.rootReferenced ? \"Referenced\" : \"Not referenced\"}`,\n `Reachable: ${module.reachable ? \"Yes\" : \"No\"}`,\n ...modulePreviewDetails(module.preview),\n `Reason: ${module.reason}`,\n `Variables: ${module.variables.join(\", \") || \"none\"}`,\n `Style fields: ${module.styleFields.join(\", \") || \"none\"}`,\n `Display rules: ${module.displayRules.join(\" \u00B7 \") || \"none\"}`,\n ],\n })),\n viewportSize: \"adaptive\",\n hint: \"back\",\n };\n },\n configuration: () => configurationMenuScreen(options.getLoaded()),\n \"configuration-overview\": () => configurationOverviewScreen(options.getLoaded(), options.settingsPath),\n \"configuration-effective\": () => effectiveConfigurationScreen(options.getLoaded()),\n \"configuration-document\": () => settingsDocumentScreen(options.getLoaded(), options.settingsPath),\n help: () => ({\n kind: \"detail\",\n title: \"pi-starship help\",\n lines: [\n \"Customize footer opens the TOML editor, then previews and confirms before saving.\",\n \"Presets live-previews the cursor in the footer; Enter confirms apply and e customizes first.\",\n \"Explain footer breaks down the modules currently showing from the existing snapshot.\",\n \"Modules searches every supported module and explains its current read-only state.\",\n \"Configuration separates overview, effective TOML, loaded settings text, and safe disk reload.\",\n `Settings: ${safeText(options.settingsPath)}`,\n \"Docs: https://github.com/narumiruna/pi-extensions/tree/main/packages/pi-starship\",\n ],\n hint: \"back\",\n }),\n },\n actions: {\n customize: async () => {\n const result = await editSettings(ctx, options);\n return result === \"applied\" || result === \"close\" ? { kind: \"close\" } : { kind: \"stay\" };\n },\n presets: async () => {\n const result = await choosePreset(ctx, options, owner);\n return result === \"applied\" || result === \"close\" ? { kind: \"close\" } : { kind: \"stay\" };\n },\n \"configuration-reload\": async () => {\n const result = await reloadConfiguration(ctx, options, owner);\n return result === \"close\" ? { kind: \"close\" } : { kind: \"stay\" };\n },\n restore: async () => {\n const presentation = configurationPresentation(options.getLoaded());\n if (presentation.restoreDisabled) {\n ctx.ui.notify(presentation.restoreDescription, \"info\");\n return { kind: \"stay\" };\n }\n const result = await restoreBuiltIn(ctx, options);\n return result === \"applied\" || result === \"close\" ? { kind: \"close\" } : { kind: \"stay\" };\n },\n },\n });\n try {\n await runMenu(ctx, menu, {\n getState: () => undefined,\n signal: owner.signal,\n isCurrent: owner.isCurrent,\n });\n } finally {\n fallbackController.abort(new DOMException(\"Starship menu closed\", \"AbortError\"));\n }\n}\n\nasync function editSettings(\n ctx: ExtensionCommandContext,\n options: StarshipCommandOptions,\n): Promise<\"applied\" | \"cancel\" | \"close\"> {\n const owner = workflowOwner(options);\n if (!isCurrentOwner(owner)) return \"cancel\";\n if (ctx.mode !== \"tui\") {\n if (ctx.hasUI) ctx.ui.notify(`Edit settings manually: ${options.settingsPath}`, \"info\");\n return \"cancel\";\n }\n let draft = options.getLoaded().rawDocument ?? BUILT_IN_EXAMPLE;\n while (true) {\n const edited = await ctx.ui.editor(\"Customize footer \u2014 close to preview\", draft);\n if (!isCurrentOwner(owner) || edited === undefined) return \"cancel\";\n draft = edited;\n let validated: LoadedStarshipConfig;\n try {\n validated = (options.validate ?? validateConfigDocument)(options.settingsPath, draft);\n } catch (error) {\n ctx.ui.notify(`Footer draft is invalid: ${safeText(formatError(error))}`, \"error\");\n const action = await showPreviewActionMenu(\n ctx,\n \"Configuration needs attention\",\n () => [safeText(formatError(error)), \"The current footer has not changed.\"],\n [\n { value: PREVIEW_ACTIONS.edit, label: \"Continue editing\" },\n { value: PREVIEW_ACTIONS.cancel, label: \"Discard draft\" },\n ],\n owner.signal,\n owner.isCurrent,\n );\n if (!isCurrentOwner(owner)) return \"cancel\";\n if (action?.kind === \"closed\") return \"close\";\n if (selectedPreviewAction(action) === PREVIEW_ACTIONS.edit) continue;\n return \"cancel\";\n }\n\n const result = await reviewAndApply(ctx, options, validated, { kind: \"customize\" }, owner);\n if (result === \"edit\") continue;\n return result;\n }\n}\n\nasync function choosePreset(\n ctx: ExtensionCommandContext,\n options: StarshipCommandOptions,\n owner: WorkflowOwner,\n): Promise<\"applied\" | \"cancel\" | \"close\"> {\n const activePreset = presetForDocument(options.getLoaded().rawDocument);\n const selection = await showPresetPicker(ctx, {\n presets: STARSHIP_PRESETS,\n activePresetId: activePreset?.id,\n initialPresetId: activePreset?.id ?? STARSHIP_PRESETS[0]?.id,\n signal: owner.signal,\n isCurrent: owner.isCurrent,\n preview(preset) {\n const loaded = (options.validate ?? validateConfigDocument)(options.settingsPath, preset.rawDocument);\n options.preview?.(loaded, ctx);\n },\n });\n if (!isCurrentOwner(owner)) {\n options.preview?.(undefined, ctx);\n return \"cancel\";\n }\n if (selection.kind === \"back\" || selection.kind === \"close\") {\n options.preview?.(undefined, ctx);\n return selection.kind === \"close\" ? \"close\" : \"cancel\";\n }\n\n const preset = getStarshipPreset(selection.presetId);\n try {\n return await applyPreset(ctx, options, preset, selection.kind === \"customize\" ? \"customize\" : \"confirm\");\n } finally {\n options.preview?.(undefined, ctx);\n }\n}\n\nasync function applyPreset(\n ctx: ExtensionCommandContext,\n options: StarshipCommandOptions,\n preset: StarshipPreset,\n start: \"review\" | \"confirm\" | \"customize\" = \"review\",\n): Promise<\"applied\" | \"cancel\" | \"close\"> {\n const owner = workflowOwner(options);\n if (!isCurrentOwner(owner)) return \"cancel\";\n let draft = preset.rawDocument;\n if (start === \"customize\") {\n const edited = await ctx.ui.editor(`Customize ${preset.label} preset`, draft);\n if (!isCurrentOwner(owner) || edited === undefined) return \"cancel\";\n draft = edited;\n }\n while (true) {\n let validated: LoadedStarshipConfig;\n try {\n validated = (options.validate ?? validateConfigDocument)(options.settingsPath, draft);\n } catch (error) {\n ctx.ui.notify(`Preset draft is invalid: ${safeText(formatError(error))}`, \"error\");\n const action = await showPreviewActionMenu(\n ctx,\n \"Preset needs attention\",\n () => [safeText(formatError(error)), \"The current footer has not changed.\"],\n [\n { value: PREVIEW_ACTIONS.edit, label: \"Continue editing\" },\n { value: PREVIEW_ACTIONS.cancel, label: \"Choose another preset\" },\n ],\n owner.signal,\n owner.isCurrent,\n );\n if (!isCurrentOwner(owner)) return \"cancel\";\n if (action?.kind === \"closed\") return \"close\";\n if (selectedPreviewAction(action) !== PREVIEW_ACTIONS.edit) return \"cancel\";\n const edited = await ctx.ui.editor(`Customize ${preset.label} preset`, draft);\n if (!isCurrentOwner(owner) || edited === undefined) return \"cancel\";\n draft = edited;\n continue;\n }\n\n const result = await reviewAndApply(\n ctx,\n options,\n validated,\n { kind: \"preset\", preset },\n owner,\n start === \"confirm\",\n );\n if (result !== \"edit\") return result;\n const edited = await ctx.ui.editor(`Customize ${preset.label} preset`, draft);\n if (!isCurrentOwner(owner) || edited === undefined) return \"cancel\";\n draft = edited;\n }\n}\n\nasync function restoreBuiltIn(\n ctx: ExtensionCommandContext,\n options: StarshipCommandOptions,\n): Promise<\"applied\" | \"cancel\" | \"close\"> {\n const owner = workflowOwner(options);\n if (!isCurrentOwner(owner)) return \"cancel\";\n const validated = (options.validate ?? validateConfigDocument)(options.settingsPath, BUILT_IN_EXAMPLE);\n const result = await reviewAndApply(ctx, options, validated, { kind: \"restore\" }, owner);\n return result === \"edit\" ? \"cancel\" : result;\n}\n\nasync function reviewAndApply(\n ctx: ExtensionCommandContext,\n options: StarshipCommandOptions,\n validated: LoadedStarshipConfig,\n intent: ReviewIntent,\n owner: WorkflowOwner,\n skipReview = false,\n): Promise<\"applied\" | \"edit\" | \"cancel\" | \"close\"> {\n let reviewRequired = !skipReview;\n while (true) {\n const directAttempt = !reviewRequired;\n if (reviewRequired) {\n const selection = await showPreviewActionMenu(\n ctx,\n reviewTitle(intent),\n (width) => reviewPreviewBody(ctx, options, validated, width, intent),\n [\n { value: PREVIEW_ACTIONS.continue, label: continueLabel(intent) },\n ...(intent.kind === \"restore\"\n ? []\n : [\n {\n value: PREVIEW_ACTIONS.edit,\n label: intent.kind === \"preset\" ? \"Customize before applying\" : \"Continue editing\",\n },\n ]),\n {\n value: PREVIEW_ACTIONS.cancel,\n label:\n intent.kind === \"restore\"\n ? \"Cancel\"\n : intent.kind === \"preset\"\n ? \"Choose another preset\"\n : \"Discard draft\",\n },\n ],\n owner.signal,\n owner.isCurrent,\n );\n if (!isCurrentOwner(owner)) return \"cancel\";\n if (selection?.kind === \"closed\") return \"close\";\n const selected = selectedPreviewAction(selection);\n if (selected === PREVIEW_ACTIONS.edit) return \"edit\";\n if (selected !== PREVIEW_ACTIONS.continue) return \"cancel\";\n }\n reviewRequired = true;\n\n const confirmed = await ctx.ui.confirm(\n confirmationTitle(intent),\n confirmationMessage(options.settingsPath, intent),\n );\n if (!isCurrentOwner(owner)) return \"cancel\";\n if (!confirmed) {\n if (directAttempt) return \"cancel\";\n continue;\n }\n\n const save = options.save ?? atomicSaveConfigDocument;\n const previous = options.getLoaded();\n let saved: LoadedStarshipConfig;\n try {\n saved = save(options.settingsPath, validated.rawDocument ?? BUILT_IN_EXAMPLE);\n } catch (error) {\n ctx.ui.notify(\n `Footer settings were not saved: ${safeText(formatError(error))}. The previous footer remains active.`,\n \"error\",\n );\n if (directAttempt) return \"cancel\";\n continue;\n }\n\n try {\n options.apply(saved, ctx);\n } catch (error) {\n const rollbackError = restorePreviousConfiguration(ctx, options, previous, saved);\n ctx.ui.notify(\n rollbackError\n ? `Footer settings could not be applied: ${safeText(formatError(error))}. Restoring the previous configuration also failed: ${safeText(formatError(rollbackError))}.`\n : `Footer settings could not be applied: ${safeText(formatError(error))}. The previous configuration was restored.`,\n \"error\",\n );\n if (directAttempt) return \"cancel\";\n continue;\n }\n\n const warningSuffix =\n saved.diagnostics.length > 0\n ? ` (${saved.diagnostics.length} warning${saved.diagnostics.length === 1 ? \"\" : \"s\"})`\n : \"\";\n ctx.ui.notify(`${successMessage(intent)}${warningSuffix}.`, \"info\");\n return \"applied\";\n }\n}\n\nfunction reviewTitle(intent: ReviewIntent): string {\n switch (intent.kind) {\n case \"customize\":\n return \"Footer preview\";\n case \"restore\":\n return \"Restore preview\";\n case \"preset\":\n return `${intent.preset.label} preset preview`;\n }\n}\n\nfunction continueLabel(intent: ReviewIntent): string {\n switch (intent.kind) {\n case \"customize\":\n return \"Apply changes\u2026\";\n case \"restore\":\n return \"Replace with built-in\u2026\";\n case \"preset\":\n return `Apply ${intent.preset.label} preset\u2026`;\n }\n}\n\nfunction confirmationTitle(intent: ReviewIntent): string {\n switch (intent.kind) {\n case \"customize\":\n return \"Apply footer changes?\";\n case \"restore\":\n return \"Restore built-in footer?\";\n case \"preset\":\n return `Apply ${intent.preset.label} preset?`;\n }\n}\n\nfunction confirmationMessage(settingsPath: string, intent: ReviewIntent): string {\n if (intent.kind === \"customize\") return \"Save this configuration and apply it immediately?\";\n const replacement = intent.kind === \"restore\" ? \"the built-in configuration\" : `the ${intent.preset.label} preset`;\n return `Replace ${safeText(settingsPath)} entirely with ${replacement}? All custom settings, unknown fields, and comments will be removed. No backup is kept after success.`;\n}\n\nfunction successMessage(intent: ReviewIntent): string {\n switch (intent.kind) {\n case \"customize\":\n return \"Footer settings saved and applied\";\n case \"restore\":\n return \"Built-in footer restored and applied\";\n case \"preset\":\n return `${intent.preset.label} preset saved and applied`;\n }\n}\n\nfunction modulePreviewDetails(preview: string): string[] {\n const lines = preview ? preview.split(\"\\n\") : [\"(no current preview)\"];\n return lines.map((line, index) => `${index === 0 ? \"Preview: \" : \" \"}${line}`);\n}\n\nfunction workflowOwner(options: StarshipCommandOptions): WorkflowOwner {\n if (options.getMenuOwner) return options.getMenuOwner();\n const controller = new AbortController();\n return { signal: controller.signal, isCurrent: () => true };\n}\n\nfunction isCurrentOwner(owner: WorkflowOwner): boolean {\n return !owner.signal.aborted && owner.isCurrent();\n}\n\nfunction restorePreviousConfiguration(\n ctx: ExtensionCommandContext,\n options: StarshipCommandOptions,\n previous: LoadedStarshipConfig,\n saved: LoadedStarshipConfig,\n): unknown {\n try {\n if (saved.rawDocument === undefined || saved.fileIdentity === undefined) {\n throw new Error(\"The saved settings document identity is unavailable\");\n }\n removeConfigDocumentIfMatches(options.settingsPath, saved.rawDocument, saved.fileIdentity);\n if (previous.rawDocument !== undefined) {\n (options.restore ?? atomicRestoreConfigDocument)(options.settingsPath, previous.rawDocument);\n }\n options.apply(previous, ctx);\n return undefined;\n } catch (error) {\n return error;\n }\n}\n\nfunction reviewPreviewBody(\n ctx: ExtensionCommandContext,\n options: StarshipCommandOptions,\n loaded: LoadedStarshipConfig,\n width: number,\n intent: ReviewIntent,\n): string[] {\n if (intent.kind === \"restore\") return restorePreviewBody(ctx, options, loaded, width);\n if (intent.kind === \"customize\") return previewBody(ctx, options, loaded, width);\n const current = configurationPresentation(options.getLoaded());\n return [\n `Preset: ${intent.preset.label}`,\n `Requirement: ${intent.preset.requiresNerdFont ? \"Nerd Font\" : \"No special font\"}`,\n `Current: ${current.state}`,\n `Path: ${safeText(options.settingsPath)}`,\n \"Applying replaces the entire settings document, including custom settings, unknown fields, and comments.\",\n \"No backup is kept after a successful apply.\",\n \"\",\n ...previewBody(ctx, options, loaded, width),\n ];\n}\n\nfunction restorePreviewBody(\n ctx: ExtensionCommandContext,\n options: StarshipCommandOptions,\n loaded: LoadedStarshipConfig,\n width: number,\n): string[] {\n const current = configurationPresentation(options.getLoaded());\n return [\n `Current: ${current.state}`,\n `Path: ${safeText(options.settingsPath)}`,\n \"The entire settings document will be replaced, including custom settings, unknown fields, and comments.\",\n \"No backup is kept after a successful restore.\",\n \"\",\n ...previewBody(ctx, options, loaded, width),\n ];\n}\n\nfunction previewBody(\n ctx: ExtensionCommandContext,\n options: StarshipCommandOptions,\n loaded: LoadedStarshipConfig,\n width: number,\n): string[] {\n let lines: string[];\n try {\n lines = options.renderPreview?.(loaded, width, ctx) ?? [\n \"Live preview is unavailable until the footer is ready.\",\n \"The draft is valid and can still be applied.\",\n ];\n } catch (error) {\n lines = [`Preview unavailable: ${safeText(formatError(error))}`];\n }\n const warning =\n loaded.diagnostics.length === 0\n ? \"Draft validation: Healthy\"\n : `Draft validation: ${loaded.diagnostics.length} warning${loaded.diagnostics.length === 1 ? \"\" : \"s\"}`;\n return [...lines, \"\", warning];\n}\n\nfunction selectedPreviewAction<Value extends string>(result: PreviewMenuResult<Value> | undefined): Value | null {\n return result?.kind === \"selected\" ? result.value : null;\n}\n\nfunction showStatus(ctx: ExtensionCommandContext, options: StarshipCommandOptions) {\n if (!canNotify(ctx)) return;\n const loaded = options.getLoaded();\n const diagnostics = loaded.diagnostics\n .slice(0, 5)\n .map((item) => `${safeText(item.path || \"root\")}: ${safeText(item.message)}`)\n .join(\"; \");\n ctx.ui.notify(\n [\n `pi-starship source: ${loaded.source}`,\n `path: ${options.settingsPath}`,\n diagnostics ? `warnings: ${diagnostics}` : \"warnings: none\",\n ].join(\"\\n\"),\n loaded.diagnostics.length > 0 ? \"warning\" : \"info\",\n );\n}\n\nfunction showHelp(ctx: ExtensionCommandContext, settingsPath: string) {\n if (!canNotify(ctx)) return;\n ctx.ui.notify(\n [\n \"/starship \u2014 customize, live-preview presets, explain, or inspect the footer in TUI mode\",\n \"/starship settings \u2014 customize, preview, and apply TOML\",\n \"/starship status \u2014 show source, path, and warnings\",\n \"/starship help \u2014 show this help\",\n `Settings: ${settingsPath}`,\n \"Format/module docs: https://github.com/narumiruna/pi-extensions/tree/main/packages/pi-starship\",\n ].join(\"\\n\"),\n \"info\",\n );\n}\n\nfunction canNotify(ctx: ExtensionCommandContext): boolean {\n return ctx.mode === \"tui\" || ctx.hasUI;\n}\n\nfunction safeText(value: string): string {\n return Array.from(value, (character) => {\n const codePoint = character.codePointAt(0) ?? 0;\n const unsafe =\n codePoint <= 0x08 || (codePoint >= 0x0b && codePoint <= 0x1f) || (codePoint >= 0x7f && codePoint <= 0x9f);\n return unsafe ? `\\\\u${codePoint.toString(16).padStart(4, \"0\")}` : character;\n }).join(\"\");\n}\n\nfunction formatError(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n", "import type { ExtensionCommandContext } from \"@earendil-works/pi-coding-agent\";\nimport { sanitizeTerminalText } from \"@narumitw/pi-tui-kit/terminal-text\";\nimport { type PreviewMenuResult, showPreviewActionMenu } from \"./command-preview.js\";\nimport { BUILT_IN_EXAMPLE, type LoadedStarshipConfig, loadStarshipConfig } from \"./config.js\";\nimport { serializeEffectiveConfig } from \"./effective-config.js\";\nimport { presetForDocument } from \"./presets/catalog.js\";\n\nconst RELOAD_ACTIONS = {\n apply: \"apply\",\n cancel: \"cancel\",\n} as const;\n\nexport interface WorkflowOwner {\n signal: AbortSignal;\n isCurrent(): boolean;\n}\n\nexport interface ConfigurationCommandOptions {\n getLoaded(): LoadedStarshipConfig;\n getLoadedRevision?(): number;\n apply(loaded: LoadedStarshipConfig, ctx: ExtensionCommandContext): void;\n settingsPath: string;\n renderPreview?(loaded: LoadedStarshipConfig, width: number, ctx: ExtensionCommandContext): string[];\n read?: (settingsPath: string) => LoadedStarshipConfig;\n}\n\nexport interface ConfigurationPresentation {\n state: string;\n source: string;\n health: string;\n restoreDisabled: boolean;\n restoreDescription: string;\n}\n\nexport function configurationPresentation(loaded: LoadedStarshipConfig): ConfigurationPresentation {\n const healthyMissing = isHealthyMissing(loaded);\n const savedBuiltIn = loaded.source === \"user\" && loaded.rawDocument === BUILT_IN_EXAMPLE;\n const activePreset = presetForDocument(loaded.rawDocument);\n const fallback = loaded.source === \"built-in\" && loaded.diagnostics.length > 0;\n return {\n state: healthyMissing\n ? \"Built-in defaults\"\n : savedBuiltIn\n ? \"Saved built-in configuration\"\n : activePreset\n ? `${activePreset.label} preset`\n : fallback\n ? \"Built-in fallback\"\n : \"Custom configuration\",\n source: healthyMissing\n ? \"No settings file\"\n : activePreset\n ? \"Bundled preset\"\n : loaded.source === \"user\"\n ? \"User file\"\n : \"Built-in fallback\",\n health: configurationHealth(loaded),\n restoreDisabled: healthyMissing || savedBuiltIn,\n restoreDescription: healthyMissing\n ? \"Already using defaults \u00B7 no file to replace\"\n : savedBuiltIn\n ? \"Built-in configuration already saved\"\n : fallback\n ? \"Preview before replacing invalid settings\"\n : \"Preview before replacing the document\",\n };\n}\n\nexport function configurationMenuScreen(loaded: LoadedStarshipConfig) {\n const presentation = configurationPresentation(loaded);\n return {\n kind: \"actions\" as const,\n title: \"Configuration\",\n lines: [`${presentation.state} \u00B7 ${presentation.health}`],\n items: [\n {\n id: \"configuration-overview\",\n label: \"Overview\",\n description: \"State, source, path, health, and warnings\",\n to: \"configuration-overview\" as const,\n },\n {\n id: \"configuration-effective\",\n label: \"Effective configuration\",\n description: \"Normalized public TOML currently in use\",\n to: \"configuration-effective\" as const,\n },\n {\n id: \"configuration-document\",\n label: \"Settings document\",\n description: isHealthyMissing(loaded)\n ? \"No settings file \u00B7 built-in defaults are active\"\n : \"Exact loaded UTF-8 text \u00B7 read-only\",\n to: \"configuration-document\" as const,\n },\n {\n id: \"configuration-reload\",\n label: \"Reload from disk\u2026\",\n description: \"Validate and preview external changes\",\n action: \"configuration-reload\" as const,\n },\n ],\n hint: \"back\" as const,\n };\n}\n\nexport function configurationOverviewScreen(loaded: LoadedStarshipConfig, settingsPath: string) {\n const presentation = configurationPresentation(loaded);\n return {\n kind: \"detail\" as const,\n title: \"Configuration overview\",\n lines: [\n `State: ${presentation.state}`,\n `Source: ${presentation.source}`,\n `Path: ${sanitizeTerminalText(settingsPath)}`,\n ...diagnosticLines(loaded, true),\n ],\n hint: \"back\" as const,\n };\n}\n\nexport function effectiveConfigurationScreen(loaded: LoadedStarshipConfig) {\n const presentation = configurationPresentation(loaded);\n return {\n kind: \"review\" as const,\n title: \"Effective configuration\",\n lines: [\n `${presentation.state} \u00B7 ${presentation.health}`,\n \"Normalized public TOML; comments and unknown fields are intentionally excluded.\",\n ],\n content: serializeEffectiveConfig(loaded.config),\n format: { kind: \"code\" as const, language: \"toml\" },\n viewportSize: \"adaptive\" as const,\n hint: \"back\" as const,\n };\n}\n\nexport function settingsDocumentScreen(loaded: LoadedStarshipConfig, settingsPath: string) {\n const path = sanitizeTerminalText(settingsPath);\n if (loaded.rawDocument !== undefined) {\n return {\n kind: \"review\" as const,\n title: \"Settings document\",\n lines: [\"Exact loaded UTF-8 text \u00B7 display controls sanitized \u00B7 read-only\", `Path: ${path}`],\n content: loaded.rawDocument,\n format: { kind: \"code\" as const, language: \"toml\" },\n viewportSize: \"adaptive\" as const,\n hint: \"back\" as const,\n };\n }\n return {\n kind: \"detail\" as const,\n title: \"Settings document\",\n lines: [\n ...(isHealthyMissing(loaded)\n ? [\"No settings document exists.\", \"Built-in defaults are active; this read created no file.\"]\n : [\"The settings document could not be loaded.\", ...diagnosticLines(loaded, false)]),\n `Path: ${path}`,\n ],\n hint: \"back\" as const,\n };\n}\n\nexport async function reloadConfiguration(\n ctx: ExtensionCommandContext,\n options: ConfigurationCommandOptions,\n owner: WorkflowOwner,\n): Promise<\"applied\" | \"stay\" | \"close\"> {\n if (!isCurrentOwner(owner)) return \"stay\";\n const previous = options.getLoaded();\n const revision = options.getLoadedRevision?.();\n const candidate = readReloadCandidate(options);\n if (!candidate.ok) {\n ctx.ui.notify(`Footer reload was blocked: ${safeError(candidate.error)}`, \"error\");\n return \"stay\";\n }\n if (sameLoadedDocument(previous, candidate.loaded)) {\n ctx.ui.notify(\"The current disk configuration is already loaded.\", \"info\");\n return \"stay\";\n }\n\n const selection = await showPreviewActionMenu(\n ctx,\n \"Reload preview\",\n (width) => reloadPreviewBody(ctx, options, candidate.loaded, width),\n [\n { value: RELOAD_ACTIONS.apply, label: \"Apply reloaded configuration\u2026\" },\n { value: RELOAD_ACTIONS.cancel, label: \"Cancel\" },\n ],\n owner.signal,\n owner.isCurrent,\n );\n if (!isCurrentOwner(owner) || activeRevisionChanged(options, revision)) return \"stay\";\n if (selection?.kind === \"closed\") return \"close\";\n if (selectedReloadAction(selection) !== RELOAD_ACTIONS.apply) return \"stay\";\n\n const confirmed = await ctx.ui.confirm(\n \"Apply configuration from disk?\",\n candidate.loaded.rawDocument === undefined\n ? \"Use built-in defaults for this session? No settings file will be created.\"\n : \"Apply the validated settings document to this session without changing its bytes?\",\n );\n if (!isCurrentOwner(owner) || activeRevisionChanged(options, revision) || !confirmed) {\n return \"stay\";\n }\n\n const fresh = readReloadCandidate(options);\n if (!fresh.ok) {\n ctx.ui.notify(\n `Footer reload was blocked after confirmation: ${safeError(fresh.error)}. The previous footer remains active.`,\n \"error\",\n );\n return \"stay\";\n }\n if (!sameLoadedDocument(candidate.loaded, fresh.loaded)) {\n ctx.ui.notify(\n \"The settings document changed after preview. The previous footer remains active; reload again to review the latest version.\",\n \"warning\",\n );\n return \"stay\";\n }\n\n try {\n options.apply(fresh.loaded, ctx);\n } catch (error) {\n let rollbackError: unknown;\n try {\n options.apply(previous, ctx);\n } catch (rollback) {\n rollbackError = rollback;\n }\n ctx.ui.notify(\n rollbackError\n ? `Footer reload failed: ${safeError(error)}. Restoring the previous configuration also failed: ${safeError(rollbackError)}.`\n : `Footer reload failed: ${safeError(error)}. The previous configuration was restored.`,\n \"error\",\n );\n return \"stay\";\n }\n\n const warnings = fresh.loaded.diagnostics.length;\n ctx.ui.notify(\n warnings === 0\n ? \"Footer configuration reloaded and applied.\"\n : `Footer configuration reloaded and applied with ${warnings} warning${warnings === 1 ? \"\" : \"s\"}.`,\n \"info\",\n );\n return \"applied\";\n}\n\nfunction readReloadCandidate(\n options: ConfigurationCommandOptions,\n): { ok: true; loaded: LoadedStarshipConfig } | { ok: false; error: string } {\n let loaded: LoadedStarshipConfig;\n try {\n loaded = (options.read ?? loadStarshipConfig)(options.settingsPath);\n } catch (error) {\n return { ok: false, error: formatError(error) };\n }\n const errors = loaded.diagnostics.filter((item) => item.severity === \"error\");\n if (errors.length > 0) {\n return { ok: false, error: errors.map((item) => item.message).join(\"; \") };\n }\n return { ok: true, loaded };\n}\n\nfunction reloadPreviewBody(\n ctx: ExtensionCommandContext,\n options: ConfigurationCommandOptions,\n loaded: LoadedStarshipConfig,\n width: number,\n): string[] {\n const presentation = configurationPresentation(loaded);\n let preview: string[];\n try {\n preview = options.renderPreview?.(loaded, width, ctx) ?? [\"Live preview is unavailable until the footer is ready.\"];\n } catch (error) {\n preview = [`Preview unavailable: ${safeError(formatError(error))}`];\n }\n return [\n `Candidate: ${presentation.state}`,\n `Source: ${presentation.source}`,\n `Path: ${sanitizeTerminalText(options.settingsPath)}`,\n loaded.rawDocument === undefined\n ? \"Applying uses built-in defaults and creates no settings file.\"\n : \"Applying changes only the active session; the settings document bytes stay unchanged.\",\n ...diagnosticLines(loaded, true),\n \"\",\n ...preview,\n ];\n}\n\nexport function diagnosticLines(loaded: LoadedStarshipConfig, includeSummary: boolean): string[] {\n const diagnostics = loaded.diagnostics\n .slice(0, 8)\n .map((item) => `${sanitizeTerminalText(item.path || \"root\")}: ${sanitizeTerminalText(item.message)}`);\n const remaining = loaded.diagnostics.length - diagnostics.length;\n return [\n ...(includeSummary ? [`Health: ${configurationHealth(loaded)}`] : []),\n ...(diagnostics.length > 0 ? diagnostics : [\"No configuration warnings.\"]),\n ...(remaining > 0 ? [`${remaining} additional warnings not shown.`] : []),\n ];\n}\n\nfunction configurationHealth(loaded: LoadedStarshipConfig): string {\n const errors = loaded.diagnostics.filter((item) => item.severity === \"error\").length;\n if (errors > 0) return `${errors} error${errors === 1 ? \"\" : \"s\"}`;\n const warnings = loaded.diagnostics.length;\n return warnings === 0 ? \"Healthy\" : `${warnings} warning${warnings === 1 ? \"\" : \"s\"}`;\n}\n\nfunction isHealthyMissing(loaded: LoadedStarshipConfig): boolean {\n return loaded.source === \"built-in\" && loaded.rawDocument === undefined && loaded.diagnostics.length === 0;\n}\n\nfunction sameLoadedDocument(left: LoadedStarshipConfig, right: LoadedStarshipConfig): boolean {\n return (\n left.source === right.source &&\n left.rawDocument === right.rawDocument &&\n JSON.stringify(left.diagnostics) === JSON.stringify(right.diagnostics)\n );\n}\n\nfunction activeRevisionChanged(options: ConfigurationCommandOptions, revision: number | undefined): boolean {\n return revision !== undefined && options.getLoadedRevision?.() !== revision;\n}\n\nfunction isCurrentOwner(owner: WorkflowOwner): boolean {\n return !owner.signal.aborted && owner.isCurrent();\n}\n\nfunction selectedReloadAction(\n result: PreviewMenuResult<(typeof RELOAD_ACTIONS)[keyof typeof RELOAD_ACTIONS]> | undefined,\n) {\n return result?.kind === \"selected\" ? result.value : null;\n}\n\nfunction safeError(value: unknown): string {\n return sanitizeTerminalText(typeof value === \"string\" ? value : formatError(value));\n}\n\nfunction formatError(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n", "import { stripVTControlCharacters } from \"node:util\";\nimport type { ExtensionCommandContext, KeybindingsManager } from \"@earendil-works/pi-coding-agent\";\nimport { Key, matchesKey, truncateToWidth, wrapTextWithAnsi } from \"@earendil-works/pi-tui\";\nimport { runCustomInteraction } from \"@narumitw/pi-tui-kit\";\n\nconst RESERVED_HOST_ROWS = 3;\n\nexport interface PreviewMenuItem<Value extends string> {\n value: Value;\n label: string;\n}\n\nexport type PreviewMenuResult<Value extends string> =\n | { kind: \"selected\"; value: Value }\n | { kind: \"cancelled\" }\n | { kind: \"closed\" };\n\nexport async function showPreviewActionMenu<Value extends string>(\n ctx: ExtensionCommandContext,\n title: string,\n body: (width: number) => readonly string[],\n items: readonly PreviewMenuItem<Value>[],\n signal?: AbortSignal,\n isCurrent: () => boolean = () => !signal?.aborted,\n): Promise<PreviewMenuResult<Value> | undefined> {\n if (signal?.aborted || !isCurrent()) return { kind: \"closed\" };\n const result = await runCustomInteraction<PreviewMenuResult<Value>>(ctx, {\n signal,\n isCurrent,\n create: ({ tui, theme, keybindings, complete }) => {\n let selectedIndex = 0;\n let scrollOffset = 0;\n let lastMaximumScroll = 0;\n let lastViewportSize = 1;\n let disposed = false;\n\n const requestRender = () => {\n if (!disposed) tui.requestRender();\n };\n const moveSelection = (delta: number) => {\n if (items.length === 0) return;\n selectedIndex = (selectedIndex + delta + items.length) % items.length;\n requestRender();\n };\n const movePreview = (offset: number) => {\n scrollOffset = Math.max(0, Math.min(offset, lastMaximumScroll));\n requestRender();\n };\n\n return {\n render(width: number): string[] {\n const safeWidth = Math.max(1, width);\n const terminalRows = Number.isFinite(tui.terminal.rows) ? Math.floor(tui.terminal.rows) : 24;\n const availableRows = Math.max(1, terminalRows - RESERVED_HOST_ROWS);\n const bodyLines = body(safeWidth).flatMap((line) => (line ? wrapTextWithAnsi(line, safeWidth) : [\"\"]));\n const layout = allocateLayout(availableRows, items.length, bodyLines.length);\n lastViewportSize = layout.previewRows;\n lastMaximumScroll = Math.max(0, bodyLines.length - layout.previewRows);\n scrollOffset = Math.max(0, Math.min(scrollOffset, lastMaximumScroll));\n const actionStart = actionWindowStart(selectedIndex, items.length, layout.actionRows);\n const actionLines = items.slice(actionStart, actionStart + layout.actionRows).map((item, index) => {\n const absoluteIndex = actionStart + index;\n const prefix = absoluteIndex === selectedIndex ? \"\u2192 \" : \" \";\n return theme.fg(\n absoluteIndex === selectedIndex ? \"accent\" : \"text\",\n `${prefix}${safeDisplayText(item.label)}`,\n );\n });\n const position = layout.positionRows\n ? [theme.fg(\"dim\", previewPosition(scrollOffset, layout.previewRows, bodyLines.length))]\n : [];\n const lines = [\n ...(layout.titleRows ? [theme.fg(\"accent\", theme.bold(safeDisplayText(title)))] : []),\n ...bodyLines.slice(scrollOffset, scrollOffset + layout.previewRows),\n ...position,\n ...actionLines,\n ...(layout.hintRows ? [theme.fg(\"dim\", previewHint(keybindings))] : []),\n ];\n return lines.map((line) => truncateToWidth(line, safeWidth, \"\"));\n },\n invalidate() {},\n handleInput(data: string) {\n if (disposed) return;\n if (matchesKey(data, Key.ctrl(\"c\"))) {\n complete({ kind: \"closed\" });\n } else if (keybindings.matches(data, \"tui.select.cancel\")) {\n complete({ kind: \"cancelled\" });\n } else if (keybindings.matches(data, \"tui.select.up\")) {\n moveSelection(-1);\n } else if (keybindings.matches(data, \"tui.select.down\")) {\n moveSelection(1);\n } else if (keybindings.matches(data, \"tui.select.pageUp\")) {\n movePreview(scrollOffset - lastViewportSize);\n } else if (keybindings.matches(data, \"tui.select.pageDown\")) {\n movePreview(scrollOffset + lastViewportSize);\n } else if (matchesKey(data, Key.home)) {\n movePreview(0);\n } else if (matchesKey(data, Key.end)) {\n movePreview(lastMaximumScroll);\n } else if (keybindings.matches(data, \"tui.select.confirm\")) {\n const item = items[selectedIndex];\n if (item) complete({ kind: \"selected\", value: item.value });\n }\n },\n dispose() {\n if (disposed) return;\n disposed = true;\n },\n };\n },\n });\n if (result.kind === \"completed\") return result.value;\n if (result.kind === \"error\") throw result.error;\n if (result.kind === \"stale\" && (signal?.aborted || !isCurrent())) return { kind: \"closed\" };\n return undefined;\n}\n\ninterface PreviewLayout {\n titleRows: number;\n previewRows: number;\n positionRows: number;\n actionRows: number;\n hintRows: number;\n}\n\nfunction allocateLayout(availableRows: number, actionCount: number, bodyLineCount: number): PreviewLayout {\n if (availableRows === 1) {\n return { titleRows: 0, previewRows: 0, positionRows: 0, actionRows: 1, hintRows: 0 };\n }\n const titleRows = availableRows >= 3 ? 1 : 0;\n const hintRows = availableRows >= 3 ? 1 : 0;\n const minimumPreviewRows = bodyLineCount > 0 && availableRows >= 4 ? 1 : 0;\n const availableActionRows = Math.max(1, availableRows - titleRows - hintRows - minimumPreviewRows);\n const actionRows = Math.min(Math.max(1, actionCount), availableActionRows);\n let previewRows = Math.max(0, availableRows - titleRows - hintRows - actionRows);\n const positionRows = previewRows >= 2 && bodyLineCount > previewRows ? 1 : 0;\n previewRows -= positionRows;\n return { titleRows, previewRows, positionRows, actionRows, hintRows };\n}\n\nfunction actionWindowStart(selectedIndex: number, itemCount: number, viewportSize: number): number {\n if (itemCount <= viewportSize) return 0;\n return Math.max(0, Math.min(selectedIndex, itemCount - viewportSize));\n}\n\nfunction previewPosition(offset: number, viewportSize: number, lineCount: number): string {\n if (lineCount === 0) return \"0/0\";\n return `${offset + 1}-${Math.min(lineCount, offset + viewportSize)}/${lineCount}`;\n}\n\nfunction previewHint(keybindings: Pick<KeybindingsManager, \"getKeys\">): string {\n const up = bindingText(keybindings, \"tui.select.up\");\n const down = bindingText(keybindings, \"tui.select.down\");\n const confirm = bindingText(keybindings, \"tui.select.confirm\");\n const cancel = bindingText(keybindings, \"tui.select.cancel\", \"ctrl+c\");\n const pageUp = bindingText(keybindings, \"tui.select.pageUp\");\n const pageDown = bindingText(keybindings, \"tui.select.pageDown\");\n return [\n ...(up || down ? [`${[up, down].filter(Boolean).join(\"/\")} navigate`] : []),\n ...(confirm ? [`${confirm} select`] : []),\n ...(cancel ? [`${cancel} discard`] : []),\n \"ctrl+c close\",\n ...(pageUp || pageDown ? [`${[pageUp, pageDown].filter(Boolean).join(\"/\")} preview`] : []),\n ].join(\" \u2022 \");\n}\n\nfunction bindingText(\n keybindings: Pick<KeybindingsManager, \"getKeys\">,\n binding: Parameters<KeybindingsManager[\"getKeys\"]>[0],\n excluded?: string,\n): string {\n return keybindings\n .getKeys(binding)\n .filter((key) => key !== excluded)\n .map((key) => {\n if (key === \"up\") return \"\u2191\";\n if (key === \"down\") return \"\u2193\";\n if (key === \"escape\") return \"esc\";\n if (key === \"return\") return \"enter\";\n return safeDisplayText(key);\n })\n .join(\"/\");\n}\n\nfunction safeDisplayText(value: string): string {\n return Array.from(stripVTControlCharacters(value), (character) => {\n const codePoint = character.codePointAt(0) ?? 0;\n const control = codePoint <= 0x1f || (codePoint >= 0x7f && codePoint <= 0x9f);\n return control ? \"\" : character;\n }).join(\"\");\n}\n", "import { stringify, type TomlTable, type TomlValue } from \"smol-toml\";\nimport type { StarshipConfig } from \"./config.js\";\nimport { MODULE_DEFINITIONS } from \"./modules/catalog.js\";\nimport type { ModuleOptionValue } from \"./modules/types.js\";\n\nexport function projectEffectiveConfig(config: StarshipConfig): TomlTable {\n const projected: TomlTable = {\n format: config.format,\n };\n if (config.palette !== undefined) projected.palette = config.palette;\n projected.palettes = Object.fromEntries(\n sortedEntries(config.palettes).map(([name, colors]) => [name, sortedRecord(colors)]),\n );\n for (const definition of MODULE_DEFINITIONS) {\n const module = config.modules[definition.name];\n const table: TomlTable = {\n format: module.format,\n symbol: module.symbol,\n };\n if (definition.styleDefaults) {\n if (definition.fallbackStyle) table.style = module.style;\n for (const field of Object.keys(definition.styleDefaults)) {\n table[field] = module.styles[field] ?? \"\";\n }\n } else if (!definition.displayDefaults) {\n table.style = module.style;\n }\n if (definition.displayDefaults) {\n table.display = module.display.map((entry) => ({ ...entry }));\n }\n table.disabled = module.disabled;\n for (const key of Object.keys(definition.options ?? {})) {\n table[key] = cloneOptionValue(module.options[key]);\n }\n if (definition.name === \"extension_status\") {\n table.separator = config.extensionStatus.separator;\n table.max_statuses = config.extensionStatus.maxStatuses;\n table.icons = sortedRecord(config.extensionStatus.icons);\n }\n projected[definition.name] = table;\n }\n return projected;\n}\n\nexport function serializeEffectiveConfig(config: StarshipConfig): string {\n return stringify(projectEffectiveConfig(config));\n}\n\nfunction cloneOptionValue(value: ModuleOptionValue | undefined): TomlValue {\n if (value === undefined) throw new Error(\"Missing normalized module option\");\n if (Array.isArray(value)) return [...(value as readonly string[])];\n if (typeof value === \"object\") {\n return sortedRecord(value as Readonly<Record<string, string>>);\n }\n return value;\n}\n\nfunction sortedRecord(values: Readonly<Record<string, string>>): Record<string, string> {\n return Object.fromEntries(sortedEntries(values));\n}\n\nfunction sortedEntries<Value>(values: Readonly<Record<string, Value>>): [string, Value][] {\n return Object.entries(values).sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0));\n}\n", "export const BRACKETED_SEGMENTS_PRESET = String.raw`# Font-safe bracketed segments inspired by Starship.\nformat = \"$brand$model$thinking$directory$git_branch$git_status$activity$context$time\"\n\n[brand]\nformat = '[\\[$symbol\\]]($style) '\nstyle = \"bold white\"\n\n[model]\nformat = '[\\[$symbol $model\\]]($style) '\nsymbol = \"AI\"\nstyle = \"bold blue\"\n\n[thinking]\nformat = '[\\[$symbol $level\\]]($style) '\nsymbol = \"think\"\nstyle = \"bold purple\"\n\n[directory]\nformat = '[\\[$symbol $path\\]]($style) '\nsymbol = \"dir\"\nstyle = \"cyan bold\"\n\n[git_branch]\nformat = '[\\[$symbol $branch\\]]($style) '\nsymbol = \"git\"\nstyle = \"bold purple\"\n\n[git_status]\nformat = '[\\[$all_status( $ahead_behind)\\]]($style) '\nstyle = \"red bold\"\n\n[activity]\nformat = '[\\[$text\\]]($style) '\nsymbol = \"run\"\nstyle = \"bold yellow\"\n\n[context]\nformat = '[\\[$symbol $percentage\\]]($style) '\nsymbol = \"ctx\"\n\n[time]\nformat = '[\\[$time\\]]($style)'\nsymbol = \"\"\nstyle = \"bold yellow\"\n`;\n", "export const CATPPUCCIN_POWERLINE_PRESET = `# Pi-native adaptation of Starship's Catppuccin Powerline preset.\nformat = \"[\uE0B6](red)$brand$model[\uE0B0](bg:peach fg:red)$directory[\uE0B0](bg:yellow fg:peach)$git_branch$git_status[\uE0B0](fg:yellow bg:green)$thinking$activity[\uE0B0](fg:green bg:sapphire)$context[\uE0B0](fg:sapphire bg:lavender)$time[\uE0B4](fg:lavender)\"\npalette = \"catppuccin_mocha\"\n\n[brand]\nformat = \"[ $symbol ]($style)\"\nsymbol = \"\uE285\"\nstyle = \"fg:crust bg:red bold\"\n\n[model]\nformat = \"[$model ]($style)\"\nsymbol = \"\"\nstyle = \"fg:crust bg:red bold\"\n\n[directory]\nformat = \"[ $path ]($style)\"\nsymbol = \"\"\nstyle = \"fg:crust bg:peach bold\"\ntruncation_length = 3\ntruncation_symbol = \"\u2026/\"\n\n[git_branch]\nformat = \"[ $symbol $branch ]($style)\"\nsymbol = \"\uF418\"\nstyle = \"fg:crust bg:yellow bold\"\n\n[git_status]\nformat = \"[$all_status$ahead_behind ]($style)\"\nstyle = \"fg:crust bg:yellow bold\"\n\n[thinking]\nformat = \"[ $symbol $level ]($style)\"\nsymbol = \"\uDB81\uDD1F\"\nstyle = \"fg:crust bg:green bold\"\n\n[activity]\nformat = \"[ $text ]($style)\"\nsymbol = \"\uDB81\uDC6E\"\nstyle = \"fg:crust bg:green bold\"\n\n[context]\nformat = \"[ $symbol $percentage ](fg:crust bg:sapphire bold)\"\nsymbol = \"\uDB80\uDF5B\"\n\n[[context.display]]\nthreshold = 0\nstyle = \"sapphire\"\nhidden = false\n\n[time]\nformat = \"[ \uF43A $time ]($style)\"\nsymbol = \"\"\nstyle = \"fg:crust bg:lavender bold\"\n\n[palettes.catppuccin_mocha]\nred = \"#f38ba8\"\npeach = \"#fab387\"\nyellow = \"#f9e2af\"\ngreen = \"#a6e3a1\"\nsapphire = \"#74c7ec\"\nlavender = \"#b4befe\"\ncrust = \"#11111b\"\n\n[palettes.catppuccin_frappe]\nred = \"#e78284\"\npeach = \"#ef9f76\"\nyellow = \"#e5c890\"\ngreen = \"#a6d189\"\nsapphire = \"#85c1dc\"\nlavender = \"#babbf1\"\ncrust = \"#232634\"\n\n[palettes.catppuccin_latte]\nred = \"#d20f39\"\npeach = \"#fe640b\"\nyellow = \"#df8e1d\"\ngreen = \"#40a02b\"\nsapphire = \"#209fb5\"\nlavender = \"#7287fd\"\ncrust = \"#dce0e8\"\n\n[palettes.catppuccin_macchiato]\nred = \"#ed8796\"\npeach = \"#f5a97f\"\nyellow = \"#eed49f\"\ngreen = \"#a6da95\"\nsapphire = \"#7dc4e4\"\nlavender = \"#b7bdf8\"\ncrust = \"#181926\"\n`;\n", "export const GRUVBOX_RAINBOW_PRESET = `# Pi-native adaptation of Starship's Gruvbox Rainbow preset.\nformat = \"[\uE0B6](color_orange)$brand$model[\uE0B0](bg:color_yellow fg:color_orange)$directory[\uE0B0](fg:color_yellow bg:color_aqua)$git_branch$git_status[\uE0B0](fg:color_aqua bg:color_blue)$thinking$activity[\uE0B0](fg:color_blue bg:color_bg3)$context[\uE0B0](fg:color_bg3 bg:color_bg1)$time[\uE0B4](fg:color_bg1)\"\npalette = \"gruvbox_dark\"\n\n[palettes.gruvbox_dark]\ncolor_fg0 = \"#fbf1c7\"\ncolor_bg1 = \"#3c3836\"\ncolor_bg3 = \"#665c54\"\ncolor_blue = \"#458588\"\ncolor_aqua = \"#689d6a\"\ncolor_green = \"#98971a\"\ncolor_orange = \"#d65d0e\"\ncolor_purple = \"#b16286\"\ncolor_red = \"#cc241d\"\ncolor_yellow = \"#d79921\"\n\n[brand]\nformat = \"[ $symbol ]($style)\"\nsymbol = \"\uE285\"\nstyle = \"fg:color_fg0 bg:color_orange bold\"\n\n[model]\nformat = \"[$model ]($style)\"\nsymbol = \"\"\nstyle = \"fg:color_fg0 bg:color_orange bold\"\n\n[directory]\nformat = \"[ $path ]($style)\"\nsymbol = \"\"\nstyle = \"fg:color_fg0 bg:color_yellow bold\"\ntruncation_length = 3\ntruncation_symbol = \"\u2026/\"\n\n[git_branch]\nformat = \"[ $symbol $branch ]($style)\"\nsymbol = \"\uF418\"\nstyle = \"fg:color_fg0 bg:color_aqua bold\"\n\n[git_status]\nformat = \"[$all_status$ahead_behind ]($style)\"\nstyle = \"fg:color_fg0 bg:color_aqua bold\"\n\n[thinking]\nformat = \"[ $symbol $level ]($style)\"\nsymbol = \"\uDB81\uDD1F\"\nstyle = \"fg:color_fg0 bg:color_blue bold\"\n\n[activity]\nformat = \"[ $text ]($style)\"\nsymbol = \"\uDB81\uDC6E\"\nstyle = \"fg:color_fg0 bg:color_blue bold\"\n\n[context]\nformat = \"[ $symbol $percentage ](fg:color_fg0 bg:color_bg3 bold)\"\nsymbol = \"\uDB80\uDF5B\"\n\n[[context.display]]\nthreshold = 0\nstyle = \"color_bg3\"\nhidden = false\n\n[time]\nformat = \"[ \uF43A $time ]($style)\"\nsymbol = \"\"\nstyle = \"fg:color_fg0 bg:color_bg1 bold\"\n`;\n", "export const JETPACK_PRESET = `# Pi-native adaptation of Starship's Jetpack preset.\n# Left-side session activity and right-side workspace context meet at $fill.\nformat = \"$activity$context$fill$directory$git_branch$git_state$git_status$time\"\n\n[activity]\nformat = \"[\u25C4 $text ]($style)\"\nsymbol = \"\"\nstyle = \"italic white\"\n\n[context]\nformat = \"[\u25EF $percentage]($style) \"\nsymbol = \"\"\n\n[[context.display]]\nthreshold = 0\nstyle = \"bold purple\"\nhidden = false\n\n[fill]\nsymbol = \" \"\nstyle = \"none\"\n\n[directory]\nformat = \"[$path]($style) \"\nsymbol = \"\"\nstyle = \"italic blue\"\ntruncation_length = 2\ntruncation_symbol = \"\u25A1 \"\nhome_symbol = \"\u2302\"\n\n[git_branch]\nformat = \"[$symbol$branch]($style)\"\nsymbol = \"\u25B3 \"\nstyle = \"italic bright-blue\"\ntruncation_length = 11\ntruncation_symbol = \"\u22EF\"\n\n[git_state]\nformat = \"([\u23AA$state $progress_current/$progress_total\u23A5]($style))\"\nsymbol = \"\"\nstyle = \"italic bright-purple\"\n\n[git_status]\nformat = \"([\u23AA$all_status$ahead_behind\u23A5]($style))\"\nstyle = \"bold italic bright-blue\"\n\n[time]\nformat = \"[ $time]($style)\"\nsymbol = \"\"\nstyle = \"italic dimmed white\"\n`;\n", "export const MINIMAL_PRESET = `# A compact, font-safe Pi footer.\nformat = \"$model$directory$git_branch$activity\"\n\n[model]\nformat = \"[$model]($style) \"\nsymbol = \"\"\nstyle = \"bold blue\"\n\n[directory]\nformat = \"[$path]($style) \"\nsymbol = \"\"\nstyle = \"cyan bold\"\n\n[git_branch]\nformat = \"[git:$branch]($style) \"\nsymbol = \"\"\nstyle = \"bold purple\"\n\n[activity]\nformat = \"[$text]($style)\"\nsymbol = \"*\"\nstyle = \"bold yellow\"\n`;\n", "export const NERD_FONT_SYMBOLS_PRESET = `# Balanced Pi footer with Nerd Font symbols.\nformat = \"$brand$model$thinking$directory$git_branch$git_status$activity$context$time\"\n\n[brand]\nsymbol = \"\uE285\"\n\n[model]\nsymbol = \"\uDB81\uDEA9\"\n\n[thinking]\nsymbol = \"\uDB81\uDD1F\"\n\n[directory]\nsymbol = \"\uDB80\uDE4B\"\n\n[git_branch]\nsymbol = \"\uF418\"\n\n[activity]\nsymbol = \"\uDB81\uDC6E\"\n\n[context]\nsymbol = \"\uDB80\uDF5B\"\n\n[time]\nsymbol = \"\uF43A\"\n`;\n", "export const NO_EMPTY_ICONS_PRESET = `# Pi-native adaptation of Starship's No Empty Icons preset.\n# Each label lives inside the same conditional group as its value.\nformat = \"$model$thinking$directory$git_branch$git_status$activity$context$time\"\n\n[model]\nformat = \"([model $model]($style) )\"\nsymbol = \"\"\nstyle = \"bold blue\"\n\n[thinking]\nformat = \"([thinking $level]($style) )\"\nsymbol = \"\"\nstyle = \"bold purple\"\n\n[directory]\nformat = \"([in $path]($style) )\"\nsymbol = \"\"\nstyle = \"cyan bold\"\n\n[git_branch]\nformat = \"([on $branch]($style) )\"\nsymbol = \"\"\nstyle = \"bold purple\"\n\n[git_status]\nformat = \"([$all_status$ahead_behind]($style) )\"\nstyle = \"red bold\"\n\n[activity]\nformat = \"([while $text]($style) )\"\nsymbol = \"\"\nstyle = \"bold yellow\"\n\n[context]\nformat = \"([using $percentage context]($style) )\"\nsymbol = \"\"\n\n[[context.display]]\nthreshold = 0\nstyle = \"bold green\"\nhidden = false\n\n[time]\nformat = \"([at $time]($style))\"\nsymbol = \"\"\nstyle = \"bold yellow\"\n`;\n", "export const NO_NERD_FONT_PRESET = `# Pi-native adaptation of Starship's No Nerd Font preset.\nformat = \"$brand$model$thinking$directory$git_branch$git_status$activity$context$time\"\n\n[brand]\nformat = \"[$symbol]($style) \"\nsymbol = \"\u2726\"\nstyle = \"bold white\"\n\n[model]\nformat = \"[$symbol $model]($style) \"\nsymbol = \"\u25C6\"\nstyle = \"bold blue\"\n\n[thinking]\nformat = \"[$symbol $level]($style) \"\nsymbol = \"\u25C7\"\nstyle = \"bold purple\"\n\n[directory]\nformat = \"[$symbol $path]($style) \"\nsymbol = \"\u2302\"\nstyle = \"cyan bold\"\n\n[git_branch]\nformat = \"[$symbol $branch]($style) \"\nsymbol = \"\u2387\"\nstyle = \"bold purple\"\n\n[git_status]\nformat = \"[$all_status( $ahead_behind)]($style) \"\nstyle = \"red bold\"\n\n[activity]\nformat = \"[$text]($style) \"\nsymbol = \"\u25CF\"\nstyle = \"bold yellow\"\n\n[context]\nformat = \"[$symbol $percentage]($style) \"\nsymbol = \"\u25CC\"\n\n[[context.display]]\nthreshold = 0\nstyle = \"bold green\"\nhidden = false\n\n[time]\nformat = \"[$symbol $time]($style)\"\nsymbol = \"\u25F4\"\nstyle = \"bold yellow\"\n`;\n", "export const NO_RUNTIME_VERSIONS_PRESET = `# Pi-native adaptation of Starship's No Runtime Versions preset.\n# Model and thinking modules retain presence symbols while hiding version-like details.\nformat = \"$brand$model$thinking$directory$git_branch$git_status$activity$context$time\"\n\n[brand]\nformat = \"[$symbol]($style) \"\nsymbol = \"\u03C0\"\nstyle = \"bold white\"\n\n[model]\nformat = \"[$symbol]($style) \"\nsymbol = \"AI\"\nstyle = \"bold blue\"\n\n[thinking]\nformat = \"[$symbol]($style) \"\nsymbol = \"think\"\nstyle = \"bold purple\"\n\n[directory]\nformat = \"[$path]($style) \"\nsymbol = \"\"\nstyle = \"cyan bold\"\n\n[git_branch]\nformat = \"[$symbol$branch]($style) \"\nsymbol = \"git:\"\nstyle = \"bold purple\"\n\n[git_status]\nformat = \"[$all_status( $ahead_behind)]($style) \"\nstyle = \"red bold\"\n\n[activity]\nformat = \"[$symbol]($style) \"\nsymbol = \"run\"\nstyle = \"bold yellow\"\n\n[context]\nformat = \"[$percentage]($style) \"\nsymbol = \"\"\n\n[[context.display]]\nthreshold = 0\nstyle = \"bold green\"\nhidden = false\n\n[time]\nformat = \"[$time]($style)\"\nsymbol = \"\"\nstyle = \"bold yellow\"\n`;\n", "export const PASTEL_POWERLINE_PRESET = `# Pi-native adaptation of Starship's Pastel Powerline preset.\nformat = \"[\uE0B6](#9A348E)$brand$model[\uE0B0](bg:#DA627D fg:#9A348E)$directory[\uE0B0](fg:#DA627D bg:#FCA17D)$git_branch$git_status[\uE0B0](fg:#FCA17D bg:#86BBD8)$thinking$activity[\uE0B0](fg:#86BBD8 bg:#06969A)$context[\uE0B0](fg:#06969A bg:#33658A)$time[\uE0B4](fg:#33658A)\"\n\n[brand]\nformat = \"[ $symbol ]($style)\"\nsymbol = \"\uE285\"\nstyle = \"fg:#ffffff bg:#9A348E bold\"\n\n[model]\nformat = \"[$model ]($style)\"\nsymbol = \"\"\nstyle = \"fg:#ffffff bg:#9A348E bold\"\n\n[directory]\nformat = \"[ $path ]($style)\"\nsymbol = \"\"\nstyle = \"fg:#ffffff bg:#DA627D bold\"\ntruncation_length = 3\ntruncation_symbol = \"\u2026/\"\n\n[git_branch]\nformat = \"[ $symbol $branch ]($style)\"\nsymbol = \"\uF418\"\nstyle = \"fg:#1f1f1f bg:#FCA17D bold\"\n\n[git_status]\nformat = \"[$all_status$ahead_behind ]($style)\"\nstyle = \"fg:#1f1f1f bg:#FCA17D bold\"\n\n[thinking]\nformat = \"[ $symbol $level ]($style)\"\nsymbol = \"\uDB81\uDD1F\"\nstyle = \"fg:#1f1f1f bg:#86BBD8 bold\"\n\n[activity]\nformat = \"[ $text ]($style)\"\nsymbol = \"\uDB81\uDC6E\"\nstyle = \"fg:#1f1f1f bg:#86BBD8 bold\"\n\n[context]\nformat = \"[ $symbol $percentage ](fg:#ffffff bg:#06969A bold)\"\nsymbol = \"\uDB80\uDF5B\"\n\n[[context.display]]\nthreshold = 0\nstyle = \"#06969A\"\nhidden = false\n\n[time]\nformat = \"[ \u2665 $time ]($style)\"\nsymbol = \"\"\nstyle = \"fg:#ffffff bg:#33658A bold\"\n`;\n", "export const PLAIN_TEXT_SYMBOLS_PRESET = `# Pi-native adaptation of Starship's Plain Text Symbols preset.\nformat = \"$brand$model$thinking$directory$git_branch$git_status$activity$context$time\"\n\n[brand]\nformat = \"[$symbol]($style) \"\nsymbol = \"pi\"\nstyle = \"bold white\"\n\n[model]\nformat = \"[$symbol $model]($style) \"\nsymbol = \"model\"\nstyle = \"bold blue\"\n\n[thinking]\nformat = \"[$symbol $level]($style) \"\nsymbol = \"thinking\"\nstyle = \"bold purple\"\n\n[directory]\nformat = \"[$symbol $path]($style) \"\nsymbol = \"dir\"\nstyle = \"cyan bold\"\n\n[git_branch]\nformat = \"[$symbol $branch]($style) \"\nsymbol = \"git\"\nstyle = \"bold purple\"\ntruncation_symbol = \"...\"\n\n[git_status]\nformat = \"[$all_status( $ahead_behind)]($style) \"\nstyle = \"red bold\"\n\n[activity]\nformat = \"[$text]($style) \"\nsymbol = \"active\"\nstyle = \"bold yellow\"\n\n[context]\nformat = \"[$symbol $percentage]($style) \"\nsymbol = \"context\"\n\n[[context.display]]\nthreshold = 0\nstyle = \"bold green\"\nhidden = false\n\n[time]\nformat = \"[$symbol $time]($style)\"\nsymbol = \"time\"\nstyle = \"bold yellow\"\n`;\n", "export const PURE_PRESET = `# Pi-native adaptation of Starship's Pure preset.\nformat = \"$directory$git_branch$git_state$git_status$activity\\\\n$model$thinking$context$fill$time\"\n\n[directory]\nformat = \"[$path]($style) \"\nsymbol = \"\"\nstyle = \"blue\"\n\n[git_branch]\nformat = \"[$branch]($style) \"\nsymbol = \"\"\nstyle = \"bright-black\"\n\n[git_state]\nformat = '([($state( $progress_current/$progress_total))]($style) )'\nsymbol = \"\"\nstyle = \"bright-black\"\n\n[git_status]\nformat = \"[(*$all_status)](218) [$ahead_behind]($style) \"\nstyle = \"cyan\"\n\n[activity]\nformat = \"[$text]($style) \"\nsymbol = \"\"\nstyle = \"yellow\"\n\n[model]\nformat = \"[$model]($style) \"\nsymbol = \"\"\nstyle = \"bright-black\"\n\n[thinking]\nformat = \"[$level]($style) \"\nsymbol = \"\"\nstyle = \"bright-black\"\n\n[context]\nformat = \"[$percentage]($style)\"\nsymbol = \"\"\n\n[[context.display]]\nthreshold = 0\nstyle = \"bright-black\"\nhidden = false\n\n[fill]\nsymbol = \" \"\nstyle = \"none\"\n\n[time]\nformat = \"[$time]($style)\"\nsymbol = \"\"\nstyle = \"bright-black\"\n`;\n", "export const TOKYO_NIGHT_PRESET = `# Pi-native adaptation of Starship's Tokyo Night preset.\nformat = \"[\u2591\u2592\u2593](#a3aed2)$brand$model[\uE0B4](bg:#769ff0 fg:#a3aed2)$directory[\uE0B4](fg:#769ff0 bg:#394260)$git_branch$git_status[\uE0B4](fg:#394260 bg:#212736)$thinking$activity[\uE0B4](fg:#212736 bg:#1d2230)$context$time[\uE0B4](fg:#1d2230)\"\n\n[brand]\nformat = \"[ $symbol ]($style)\"\nsymbol = \"\uE285\"\nstyle = \"fg:#090c0c bg:#a3aed2 bold\"\n\n[model]\nformat = \"[$model ]($style)\"\nsymbol = \"\"\nstyle = \"fg:#090c0c bg:#a3aed2 bold\"\n\n[directory]\nformat = \"[ $path ]($style)\"\nsymbol = \"\"\nstyle = \"fg:#e3e5e5 bg:#769ff0 bold\"\ntruncation_length = 3\ntruncation_symbol = \"\u2026/\"\n\n[git_branch]\nformat = \"[ $symbol $branch ]($style)\"\nsymbol = \"\uF418\"\nstyle = \"fg:#769ff0 bg:#394260 bold\"\n\n[git_status]\nformat = \"[$all_status$ahead_behind ]($style)\"\nstyle = \"fg:#769ff0 bg:#394260 bold\"\n\n[thinking]\nformat = \"[ $symbol $level ]($style)\"\nsymbol = \"\uDB81\uDD1F\"\nstyle = \"fg:#769ff0 bg:#212736 bold\"\n\n[activity]\nformat = \"[ $text ]($style)\"\nsymbol = \"\uDB81\uDC6E\"\nstyle = \"fg:#769ff0 bg:#212736 bold\"\n\n[context]\nformat = \"[ $symbol $percentage ](fg:#a0a9cb bg:#1d2230 bold)\"\nsymbol = \"\uDB80\uDF5B\"\n\n[[context.display]]\nthreshold = 0\nstyle = \"#1d2230\"\nhidden = false\n\n[time]\nformat = \"[\uF43A $time ]($style)\"\nsymbol = \"\"\nstyle = \"fg:#a0a9cb bg:#1d2230 bold\"\n`;\n", "import { BRACKETED_SEGMENTS_PRESET } from \"./bracketed-segments.js\";\nimport { CATPPUCCIN_POWERLINE_PRESET } from \"./catppuccin-powerline.js\";\nimport { GRUVBOX_RAINBOW_PRESET } from \"./gruvbox-rainbow.js\";\nimport { JETPACK_PRESET } from \"./jetpack.js\";\nimport { MINIMAL_PRESET } from \"./minimal.js\";\nimport { NERD_FONT_SYMBOLS_PRESET } from \"./nerd-font-symbols.js\";\nimport { NO_EMPTY_ICONS_PRESET } from \"./no-empty-icons.js\";\nimport { NO_NERD_FONT_PRESET } from \"./no-nerd-font.js\";\nimport { NO_RUNTIME_VERSIONS_PRESET } from \"./no-runtime-versions.js\";\nimport { PASTEL_POWERLINE_PRESET } from \"./pastel-powerline.js\";\nimport { PLAIN_TEXT_SYMBOLS_PRESET } from \"./plain-text-symbols.js\";\nimport { PURE_PRESET } from \"./pure-preset.js\";\nimport { TOKYO_NIGHT_PRESET } from \"./tokyo-night.js\";\n\nexport interface StarshipPreset {\n id:\n | \"minimal\"\n | \"bracketed-segments\"\n | \"catppuccin-powerline\"\n | \"gruvbox-rainbow\"\n | \"jetpack\"\n | \"nerd-font-symbols\"\n | \"no-empty-icons\"\n | \"no-nerd-font\"\n | \"no-runtime-versions\"\n | \"pastel-powerline\"\n | \"plain-text-symbols\"\n | \"pure-preset\"\n | \"tokyo-night\";\n label: string;\n description: string;\n requiresNerdFont: boolean;\n rawDocument: string;\n}\n\nexport const STARSHIP_PRESETS = [\n {\n id: \"minimal\",\n label: \"Minimal\",\n description: \"Compact Pi essentials \u00B7 font-safe\",\n requiresNerdFont: false,\n rawDocument: MINIMAL_PRESET,\n },\n {\n id: \"bracketed-segments\",\n label: \"Bracketed Segments\",\n description: \"Balanced Pi and Git details in brackets \u00B7 font-safe\",\n requiresNerdFont: false,\n rawDocument: BRACKETED_SEGMENTS_PRESET,\n },\n {\n id: \"catppuccin-powerline\",\n label: \"Catppuccin Powerline\",\n description: \"Mocha connected color blocks \u00B7 requires Nerd Font\",\n requiresNerdFont: true,\n rawDocument: CATPPUCCIN_POWERLINE_PRESET,\n },\n {\n id: \"gruvbox-rainbow\",\n label: \"Gruvbox Rainbow\",\n description: \"Warm Gruvbox connected segments \u00B7 requires Nerd Font\",\n requiresNerdFont: true,\n rawDocument: GRUVBOX_RAINBOW_PRESET,\n },\n {\n id: \"jetpack\",\n label: \"Jetpack\",\n description: \"Airy geometric left/right layout \u00B7 font-safe\",\n requiresNerdFont: false,\n rawDocument: JETPACK_PRESET,\n },\n {\n id: \"nerd-font-symbols\",\n label: \"Nerd Font Symbols\",\n description: \"Balanced default layout with icon-rich symbols \u00B7 requires Nerd Font\",\n requiresNerdFont: true,\n rawDocument: NERD_FONT_SYMBOLS_PRESET,\n },\n {\n id: \"no-empty-icons\",\n label: \"No Empty Icons\",\n description: \"Conditional labels never appear without values \u00B7 font-safe\",\n requiresNerdFont: false,\n rawDocument: NO_EMPTY_ICONS_PRESET,\n },\n {\n id: \"no-nerd-font\",\n label: \"No Nerd Font\",\n description: \"Portable Unicode symbols without private-use glyphs \u00B7 font-safe\",\n requiresNerdFont: false,\n rawDocument: NO_NERD_FONT_PRESET,\n },\n {\n id: \"no-runtime-versions\",\n label: \"No Runtime Versions\",\n description: \"Presence indicators without model or thinking details \u00B7 font-safe\",\n requiresNerdFont: false,\n rawDocument: NO_RUNTIME_VERSIONS_PRESET,\n },\n {\n id: \"pastel-powerline\",\n label: \"Pastel Powerline\",\n description: \"Pastel connected color blocks \u00B7 requires Nerd Font\",\n requiresNerdFont: true,\n rawDocument: PASTEL_POWERLINE_PRESET,\n },\n {\n id: \"plain-text-symbols\",\n label: \"Plain Text Symbols\",\n description: \"Plain words replace pictograms \u00B7 font-safe\",\n requiresNerdFont: false,\n rawDocument: PLAIN_TEXT_SYMBOLS_PRESET,\n },\n {\n id: \"pure-preset\",\n label: \"Pure Preset\",\n description: \"Clean two-line workspace and session context \u00B7 font-safe\",\n requiresNerdFont: false,\n rawDocument: PURE_PRESET,\n },\n {\n id: \"tokyo-night\",\n label: \"Tokyo Night\",\n description: \"Cool connected color blocks \u00B7 requires Nerd Font\",\n requiresNerdFont: true,\n rawDocument: TOKYO_NIGHT_PRESET,\n },\n] as const satisfies readonly StarshipPreset[];\n\nexport function getStarshipPreset(id: StarshipPreset[\"id\"]): StarshipPreset {\n const preset = STARSHIP_PRESETS.find((candidate) => candidate.id === id);\n if (!preset) throw new Error(`Unknown pi-starship preset: ${id}`);\n return preset;\n}\n\nexport function presetForDocument(rawDocument: string | undefined): StarshipPreset | undefined {\n return STARSHIP_PRESETS.find((preset) => preset.rawDocument === rawDocument);\n}\n", "import { stripVTControlCharacters } from \"node:util\";\nimport type { StatuslineInspection } from \"./modules/inspection.js\";\n\nexport function formatFooterExplanation(inspection: StatuslineInspection | undefined): string {\n if (!inspection) {\n return safeLines([\n \"Footer inspection is unavailable until the TUI footer is ready.\",\n \"No collection work was started.\",\n ]);\n }\n if (inspection.showing.length === 0) {\n return safeLines([\n \"No modules are currently showing.\",\n \"Open Modules to inspect empty, disabled, or unreachable modules.\",\n ]);\n }\n return safeLines(\n inspection.showing.flatMap((module, index) => [\n ...(index > 0 ? [\"\"] : []),\n module.name,\n ...previewLines(module.preview),\n module.description,\n ]),\n );\n}\n\nfunction previewLines(preview: string): string[] {\n const lines = preview ? preview.split(\"\\n\") : [\"(no text)\"];\n return lines.map((line, index) => `${index === 0 ? \"Value: \" : \" \"}${line}`);\n}\n\nfunction safeLines(lines: readonly string[]): string {\n return lines.map(safeDisplayText).join(\"\\n\");\n}\n\nfunction safeDisplayText(value: string): string {\n return Array.from(stripVTControlCharacters(value), (character) => {\n const codePoint = character.codePointAt(0) ?? 0;\n return codePoint <= 0x1f || (codePoint >= 0x7f && codePoint <= 0x9f) ? \"\" : character;\n }).join(\"\");\n}\n", "import type { ExtensionCommandContext } from \"@earendil-works/pi-coding-agent\";\nimport { runLiveChoice } from \"@narumitw/pi-tui-kit\";\nimport type { StarshipPreset } from \"./presets/catalog.js\";\n\nexport type PresetPickerResult =\n | { kind: \"apply\"; presetId: StarshipPreset[\"id\"] }\n | { kind: \"customize\"; presetId: StarshipPreset[\"id\"] }\n | { kind: \"back\" }\n | { kind: \"close\" };\n\nexport interface PresetPickerOptions {\n presets: readonly StarshipPreset[];\n activePresetId?: StarshipPreset[\"id\"];\n initialPresetId?: StarshipPreset[\"id\"];\n signal: AbortSignal;\n isCurrent(): boolean;\n preview(preset: StarshipPreset): void;\n}\n\nexport async function showPresetPicker(\n ctx: ExtensionCommandContext,\n options: PresetPickerOptions,\n): Promise<PresetPickerResult> {\n const current =\n options.presets.find((preset) => preset.id === options.activePresetId)?.label ?? \"Custom configuration\";\n const result = await runLiveChoice(ctx, {\n title: `Presets \u00B7 current: ${current}`,\n items: options.presets.map((preset) => ({\n id: preset.id,\n label: preset.label,\n description:\n preset.id === options.activePresetId ? `Currently applied \u00B7 ${preset.description}` : preset.description,\n details: [`Selected: ${preset.label} \u00B7 ${preset.requiresNerdFont ? \"requires Nerd Font\" : \"font-safe\"}`],\n confirmationDisabled: preset.id === options.activePresetId,\n confirmationDisabledReason: \"Already applied; press e to customize\",\n })),\n currentItemId: options.activePresetId,\n initialItemId: options.initialPresetId ?? options.activePresetId,\n viewportSize: Math.min(options.presets.length, 10),\n hint: \"back\",\n navigationLabel: \"live preview\",\n confirmLabel: \"apply\",\n shortcuts: [{ id: \"customize\", keys: [\"e\", \"shift+e\"], label: \"customize\" }],\n onSelectionChange: ({ item }) => {\n const preset = options.presets.find((candidate) => candidate.id === item.id);\n if (preset) options.preview(preset);\n },\n signal: options.signal,\n isCurrent: options.isCurrent,\n });\n if (result.kind === \"selected\") return { kind: \"apply\", presetId: result.itemId };\n if (result.kind === \"shortcut\") {\n return { kind: \"customize\", presetId: result.itemId };\n }\n if (result.kind === \"closed\" && result.reason === \"back\") return { kind: \"back\" };\n return { kind: \"close\" };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AACA,SAAS,YAAY,eAAe;;;ACApC,SAAS,4BAA4B;;;ACDrC,SAAS,gCAAgC;AAEzC,SAAS,KAAK,YAAY,iBAAiB,wBAAwB;AACnE,SAAS,4BAA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rB,QAAM,SAAS,QAAQ,UAAU;AACjC,QAAM,cAAc,OAAO,YACxB,MAAM,GAAG,CAAC,EACV,IAAI,CAAC,SAAS,GAAG,SAAS,KAAK,QAAQ,MAAM,CAAC,KAAK,SAAS,KAAK,OAAO,CAAC,EAAE,EAC3E,KAAK,IAAI;AACZ,MAAI,GAAG;AAAA,IACL;AAAA,MACE,uBAAuB,OAAO,MAAM;AAAA,MACpC,SAAS,QAAQ,YAAY;AAAA,MAC7B,cAAc,aAAa,WAAW,KAAK;AAAA,IAC7C,EAAE,KAAK,IAAI;AAAA,IACX,OAAO,YAAY,SAAS,IAAI,YAAY;AAAA,EAC9C;AACF;AAEA,SAAS,SAAS,KAA8B,cAAsB;AACpE,MAAI,CAAC,UAAU,GAAG,EAAG;AACrB,MAAI,GAAG;AAAA,IACL;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,YAAY;AAAA,MACzB;AAAA,IACF,EAAE,KAAK,IAAI;AAAA,IACX;AAAA,EACF;AACF;AAEA,SAAS,UAAU,KAAuC;AACxD,SAAO,IAAI,SAAS,SAAS,IAAI;AACnC;AAEA,SAAS,SAAS,OAAuB;AACvC,SAAO,MAAM,KAAK,OAAO,CAAC,cAAc;AACtC,UAAM,YAAY,UAAU,YAAY,CAAC,KAAK;AAC9C,UAAM,SACJ,aAAa,KAAS,aAAa,MAAQ,aAAa,MAAU,aAAa,OAAQ,aAAa;AACtG,WAAO,SAAS,MAAM,UAAU,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,KAAK;AAAA,EACpE,CAAC,EAAE,KAAK,EAAE;AACZ;AAEA,SAASA,aAAY,OAAwB;AAC3C,SAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D;",
6
+ "names": ["stripVTControlCharacters", "safeDisplayText", "isCurrentOwner", "formatError", "preset", "edited"]
7
+ }
@@ -14,7 +14,7 @@ import {
14
14
  optionStrings,
15
15
  runBounded,
16
16
  safeMetadata
17
- } from "./chunk-P4XMFSQW.js";
17
+ } from "./chunk-YWY5RIDQ.js";
18
18
 
19
19
  // src/runtime/deployment.ts
20
20
  import { extname, isAbsolute, join, resolve } from "node:path";
@@ -41,13 +41,7 @@ async function collectDocker(context) {
41
41
  const configuredFiles = optionStrings(context, "docker_context", "detect_files");
42
42
  if (!directMatch(
43
43
  entries,
44
- configuredFiles.length > 0 ? configuredFiles : [
45
- "Dockerfile",
46
- "docker-compose.yml",
47
- "docker-compose.yaml",
48
- "compose.yml",
49
- "compose.yaml"
50
- ],
44
+ configuredFiles.length > 0 ? configuredFiles : ["Dockerfile", "docker-compose.yml", "docker-compose.yaml", "compose.yml", "compose.yaml"],
51
45
  optionStrings(context, "docker_context", "detect_extensions"),
52
46
  optionStrings(context, "docker_context", "detect_folders")
53
47
  )) {
@@ -57,10 +51,7 @@ async function collectDocker(context) {
57
51
  let active = safeMetadata(context.input.environment.DOCKER_CONTEXT);
58
52
  if (!active) {
59
53
  const configDirectory = safeMetadata(context.input.environment.DOCKER_CONFIG, 1024) ?? joinHome(context.input, ".docker");
60
- const source = await context.fs.readFile(
61
- join(configDirectory, "config.json"),
62
- MAX_METADATA_FILE_BYTES
63
- );
54
+ const source = await context.fs.readFile(join(configDirectory, "config.json"), MAX_METADATA_FILE_BYTES);
64
55
  if (source) {
65
56
  try {
66
57
  const document = JSON.parse(source);
@@ -135,10 +126,7 @@ async function collectTerraform(context) {
135
126
  const output = await runBounded(context, command, ["version"]);
136
127
  const parsed = output ? parseTerraformVersion(output, command) : void 0;
137
128
  if (parsed) {
138
- values.version = formatVersion(
139
- parsed,
140
- optionString(context, "terraform", "version_format")
141
- );
129
+ values.version = formatVersion(parsed, optionString(context, "terraform", "version_format"));
142
130
  break;
143
131
  }
144
132
  }
@@ -149,10 +137,7 @@ async function terraformWorkspace(context) {
149
137
  const direct = safeMetadata(context.input.environment.TF_WORKSPACE);
150
138
  if (direct) return direct;
151
139
  const dataDirectory = safeMetadata(context.input.environment.TF_DATA_DIR, 1024);
152
- const candidate = dataDirectory ? join(
153
- isAbsolute(dataDirectory) ? dataDirectory : resolve(context.input.cwd, dataDirectory),
154
- "environment"
155
- ) : join(context.input.cwd, ".terraform", "environment");
140
+ const candidate = dataDirectory ? join(isAbsolute(dataDirectory) ? dataDirectory : resolve(context.input.cwd, dataDirectory), "environment") : join(context.input.cwd, ".terraform", "environment");
156
141
  return safeMetadata(await context.fs.readFile(candidate, 1024));
157
142
  }
158
143
  function parseTerraformVersion(output, command) {
@@ -169,4 +154,4 @@ export {
169
154
  collectDeployment,
170
155
  parseTerraformVersion
171
156
  };
172
- //# sourceMappingURL=deployment-RKKOEQQ2.js.map
157
+ //# sourceMappingURL=deployment-FMNTYRBW.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/runtime/deployment.ts"],
4
+ "sourcesContent": ["import { extname, isAbsolute, join, resolve } from \"node:path\";\nimport { parse as parseYaml } from \"yaml\";\nimport {\n directMatch,\n exactAlias,\n formatVersion,\n isRecord,\n joinHome,\n MAX_METADATA_FILE_BYTES,\n optionBoolean,\n optionMap,\n optionNumber,\n optionString,\n optionStrings,\n runBounded,\n safeMetadata,\n} from \"./helpers.js\";\nimport type { CollectorContext, MutableModuleSnapshot } from \"./types.js\";\n\nexport async function collectDeployment(context: CollectorContext): Promise<MutableModuleSnapshot> {\n const result: MutableModuleSnapshot = {};\n if (context.needs(\"docker_context\")) {\n const docker = await collectDocker(context);\n if (docker) result.docker_context = docker;\n }\n if (context.needs(\"kubernetes\")) {\n const kubernetes = await collectKubernetes(context);\n if (kubernetes) result.kubernetes = kubernetes;\n }\n if (context.needs(\"terraform\")) {\n const terraform = await collectTerraform(context);\n if (terraform) result.terraform = terraform;\n }\n return result;\n}\n\nasync function collectDocker(context: CollectorContext): Promise<Record<string, string> | undefined> {\n const entries = await context.entries();\n if (optionBoolean(context, \"docker_context\", \"only_with_files\")) {\n const configuredFiles = optionStrings(context, \"docker_context\", \"detect_files\");\n if (\n !directMatch(\n entries,\n configuredFiles.length > 0\n ? configuredFiles\n : [\"Dockerfile\", \"docker-compose.yml\", \"docker-compose.yaml\", \"compose.yml\", \"compose.yaml\"],\n optionStrings(context, \"docker_context\", \"detect_extensions\"),\n optionStrings(context, \"docker_context\", \"detect_folders\"),\n )\n ) {\n return undefined;\n }\n }\n let active = safeMetadata(context.input.environment.DOCKER_CONTEXT);\n if (!active) {\n const configDirectory =\n safeMetadata(context.input.environment.DOCKER_CONFIG, 1_024) ?? joinHome(context.input, \".docker\");\n const source = await context.fs.readFile(join(configDirectory, \"config.json\"), MAX_METADATA_FILE_BYTES);\n if (source) {\n try {\n const document = JSON.parse(source) as unknown;\n active = isRecord(document) ? safeMetadata(document.currentContext) : undefined;\n } catch {\n // Malformed metadata degrades to an empty module.\n }\n }\n }\n return active && active !== \"default\" ? { context: active } : undefined;\n}\n\nasync function collectKubernetes(context: CollectorContext): Promise<Record<string, string> | undefined> {\n const selected = safeMetadata(context.input.environment.KUBECONFIG, 4_096);\n const candidates = selected\n ? selected.split(context.input.platform === \"win32\" ? \";\" : \":\").filter(Boolean)\n : [joinHome(context.input, \".kube\", \"config\")];\n const limit = optionNumber(context, \"kubernetes\", \"max_config_files\") ?? 8;\n const contexts = new Map<string, Record<string, unknown>>();\n const clusters = new Set<string>();\n const users = new Set<string>();\n let currentContext: string | undefined;\n for (const path of candidates.slice(0, limit)) {\n const source = await context.fs.readFile(path, MAX_METADATA_FILE_BYTES);\n if (!source) continue;\n try {\n const document = parseYaml(source) as unknown;\n if (!isRecord(document)) continue;\n currentContext ??= safeMetadata(document[\"current-context\"]);\n for (const item of arrayRecords(document.contexts)) {\n const name = safeMetadata(item.name);\n if (name && !contexts.has(name) && isRecord(item.context)) contexts.set(name, item.context);\n }\n for (const item of arrayRecords(document.clusters)) {\n const name = safeMetadata(item.name);\n if (name) clusters.add(name);\n }\n for (const item of arrayRecords(document.users)) {\n const name = safeMetadata(item.name);\n if (name) users.add(name);\n }\n } catch {\n // Ignore malformed files independently.\n }\n }\n if (!currentContext) return undefined;\n const selectedContext = contexts.get(currentContext);\n const cluster = safeMetadata(selectedContext?.cluster);\n const user = safeMetadata(selectedContext?.user);\n const namespace = safeMetadata(selectedContext?.namespace) ?? \"default\";\n const values: Record<string, string> = {\n context: exactAlias(currentContext, optionMap(context, \"kubernetes\", \"context_aliases\")) ?? currentContext,\n namespace: exactAlias(namespace, optionMap(context, \"kubernetes\", \"namespace_aliases\")) ?? namespace,\n };\n if (cluster && clusters.has(cluster)) {\n values.cluster = exactAlias(cluster, optionMap(context, \"kubernetes\", \"cluster_aliases\")) ?? cluster;\n }\n if (user && users.has(user)) {\n values.user = exactAlias(user, optionMap(context, \"kubernetes\", \"user_aliases\")) ?? user;\n }\n return values;\n}\n\nasync function collectTerraform(context: CollectorContext): Promise<Record<string, string> | undefined> {\n const entries = await context.entries();\n const configuredFiles = optionStrings(context, \"terraform\", \"detect_files\");\n const configuredExtensions = optionStrings(context, \"terraform\", \"detect_extensions\");\n const configuredFolders = optionStrings(context, \"terraform\", \"detect_folders\");\n const detected =\n configuredFiles.length + configuredExtensions.length + configuredFolders.length > 0\n ? directMatch(entries, configuredFiles, configuredExtensions, configuredFolders)\n : entries.some(\n (entry) =>\n (entry.isFile && [\".tf\", \".tfplan\", \".tfstate\"].includes(extname(entry.name))) ||\n (entry.isDirectory && entry.name === \".terraform\"),\n );\n if (!detected) return undefined;\n const values: Record<string, string> = {};\n const workspace = await terraformWorkspace(context);\n if (workspace) values.workspace = workspace;\n if (context.needs(\"terraform\", \"version\")) {\n for (const command of [\"terraform\", \"tofu\"]) {\n const output = await runBounded(context, command, [\"version\"]);\n const parsed = output ? parseTerraformVersion(output, command) : undefined;\n if (parsed) {\n values.version = formatVersion(parsed, optionString(context, \"terraform\", \"version_format\"));\n break;\n }\n }\n }\n return values;\n}\n\nasync function terraformWorkspace(context: CollectorContext): Promise<string | undefined> {\n const direct = safeMetadata(context.input.environment.TF_WORKSPACE);\n if (direct) return direct;\n const dataDirectory = safeMetadata(context.input.environment.TF_DATA_DIR, 1_024);\n const candidate = dataDirectory\n ? join(isAbsolute(dataDirectory) ? dataDirectory : resolve(context.input.cwd, dataDirectory), \"environment\")\n : join(context.input.cwd, \".terraform\", \"environment\");\n return safeMetadata(await context.fs.readFile(candidate, 1_024));\n}\n\nexport function parseTerraformVersion(output: string, command: \"terraform\" | \"tofu\" | string): string | undefined {\n const escaped = command === \"tofu\" ? \"OpenTofu\" : \"Terraform\";\n const match = new RegExp(`^${escaped} v?(\\\\d+\\\\.\\\\d+\\\\.\\\\d+(?:[-+][0-9A-Za-z.-]+)?)$`, \"u\").exec(\n output.trim().split(/\\r?\\n/u)[0] ?? \"\",\n );\n return match?.[1] ? `v${match[1]}` : undefined;\n}\n\nfunction arrayRecords(value: unknown): Record<string, unknown>[] {\n return Array.isArray(value) ? value.filter(isRecord) : [];\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS,YAAY,MAAM,eAAe;AACnD,SAAS,SAAS,iBAAiB;AAkBnC,eAAsB,kBAAkB,SAA2D;AACjG,QAAM,SAAgC,CAAC;AACvC,MAAI,QAAQ,MAAM,gBAAgB,GAAG;AACnC,UAAM,SAAS,MAAM,cAAc,OAAO;AAC1C,QAAI,OAAQ,QAAO,iBAAiB;AAAA,EACtC;AACA,MAAI,QAAQ,MAAM,YAAY,GAAG;AAC/B,UAAM,aAAa,MAAM,kBAAkB,OAAO;AAClD,QAAI,WAAY,QAAO,aAAa;AAAA,EACtC;AACA,MAAI,QAAQ,MAAM,WAAW,GAAG;AAC9B,UAAM,YAAY,MAAM,iBAAiB,OAAO;AAChD,QAAI,UAAW,QAAO,YAAY;AAAA,EACpC;AACA,SAAO;AACT;AAEA,eAAe,cAAc,SAAwE;AACnG,QAAM,UAAU,MAAM,QAAQ,QAAQ;AACtC,MAAI,cAAc,SAAS,kBAAkB,iBAAiB,GAAG;AAC/D,UAAM,kBAAkB,cAAc,S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,QAAQ,MAAM,KAAK,cAAc,aAAa;AACvD,SAAO,aAAa,MAAM,QAAQ,GAAG,SAAS,WAAW,IAAK,CAAC;AACjE;AAEO,SAAS,sBAAsB,QAAgB,SAA4D;AAChH,QAAM,UAAU,YAAY,SAAS,aAAa;AAClD,QAAM,QAAQ,IAAI,OAAO,IAAI,OAAO,mDAAmD,GAAG,EAAE;AAAA,IAC1F,OAAO,KAAK,EAAE,MAAM,QAAQ,EAAE,CAAC,KAAK;AAAA,EACtC;AACA,SAAO,QAAQ,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,KAAK;AACvC;AAEA,SAAS,aAAa,OAA2C;AAC/D,SAAO,MAAM,QAAQ,KAAK,IAAI,MAAM,OAAO,QAAQ,IAAI,CAAC;AAC1D;",
6
+ "names": []
7
+ }
@@ -11,7 +11,7 @@ import {
11
11
  runBounded,
12
12
  safeMetadata,
13
13
  setString
14
- } from "./chunk-P4XMFSQW.js";
14
+ } from "./chunk-YWY5RIDQ.js";
15
15
 
16
16
  // src/runtime/development.ts
17
17
  import { join } from "node:path";
@@ -53,8 +53,7 @@ async function collectDevelopment(context) {
53
53
  if (context.needs("pixi", "version")) {
54
54
  const output = await runBounded(context, "pixi", ["--version"]);
55
55
  const version = output ? parsePixiVersion(output) : void 0;
56
- if (version)
57
- values.version = formatVersion(version, optionString(context, "pixi", "version_format"));
56
+ if (version) values.version = formatVersion(version, optionString(context, "pixi", "version_format"));
58
57
  }
59
58
  result.pixi = values;
60
59
  }
@@ -106,10 +105,7 @@ function parseDirenvStatus(output) {
106
105
  }
107
106
  }
108
107
  async function readPixiProject(context) {
109
- const source = await context.fs.readFile(
110
- join(context.input.cwd, "pixi.toml"),
111
- MAX_METADATA_FILE_BYTES
112
- );
108
+ const source = await context.fs.readFile(join(context.input.cwd, "pixi.toml"), MAX_METADATA_FILE_BYTES);
113
109
  if (!source) return void 0;
114
110
  try {
115
111
  const document = parse(source);
@@ -129,4 +125,4 @@ export {
129
125
  parseDirenvStatus,
130
126
  parseMiseHealth
131
127
  };
132
- //# sourceMappingURL=development-BERD42HW.js.map
128
+ //# sourceMappingURL=development-OUYXDPBS.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/runtime/development.ts"],
4
+ "sourcesContent": ["import { join } from \"node:path\";\nimport { parse } from \"smol-toml\";\nimport {\n directMatch,\n formatVersion,\n isRecord,\n MAX_METADATA_FILE_BYTES,\n optionBoolean,\n optionString,\n optionStrings,\n runBounded,\n safeMetadata,\n setString,\n} from \"./helpers.js\";\nimport type { CollectorContext, MutableModuleSnapshot } from \"./types.js\";\n\nexport async function collectDevelopment(context: CollectorContext): Promise<MutableModuleSnapshot> {\n const result: MutableModuleSnapshot = {};\n const directNames = [\"mise\", \"direnv\", \"pixi\"] as const;\n const needsListing = directNames.some((name) => context.needs(name));\n const entries = needsListing ? await context.entries() : [];\n\n if (context.needs(\"mise\") && detected(context, entries, \"mise\", [\"mise.toml\", \".mise.toml\", \".tool-versions\"])) {\n const values: Record<string, string> = {};\n if (context.needs(\"mise\", \"health\")) {\n const output = await runBounded(context, \"mise\", [\"doctor\"]);\n const health = output ? parseMiseHealth(output) : undefined;\n if (health) values.health = health;\n }\n result.mise = values;\n }\n\n if (context.needs(\"direnv\") && detected(context, entries, \"direnv\", [\".envrc\"])) {\n const values: Record<string, string> = {};\n if ([\"rc_path\", \"allowed\", \"loaded\"].some((variable) => context.needs(\"direnv\", variable))) {\n const output = await runBounded(context, \"direnv\", [\"status\", \"--json\"]);\n if (output) Object.assign(values, parseDirenvStatus(output));\n }\n result.direnv = values;\n }\n\n const conda = safeMetadata(context.input.environment.CONDA_DEFAULT_ENV);\n if (context.needs(\"conda\") && conda && !(optionBoolean(context, \"conda\", \"ignore_base\") && conda === \"base\")) {\n result.conda = { environment: conda };\n }\n\n if (context.needs(\"pixi\") && detected(context, entries, \"pixi\", [\"pixi.toml\", \"pixi.lock\"])) {\n const values: Record<string, string> = {};\n const environment = safeMetadata(context.input.environment.PIXI_ENVIRONMENT_NAME);\n if (environment && (environment !== \"default\" || optionBoolean(context, \"pixi\", \"show_default_environment\"))) {\n values.environment = environment;\n }\n const project = safeMetadata(context.input.environment.PIXI_PROJECT_NAME) ?? (await readPixiProject(context));\n if (project) values.project_name = project;\n if (context.needs(\"pixi\", \"version\")) {\n const output = await runBounded(context, \"pixi\", [\"--version\"]);\n const version = output ? parsePixiVersion(output) : undefined;\n if (version) values.version = formatVersion(version, optionString(context, \"pixi\", \"version_format\"));\n }\n result.pixi = values;\n }\n\n const nixState = safeMetadata(context.input.environment.IN_NIX_SHELL);\n if (context.needs(\"nix_shell\") && (nixState === \"pure\" || nixState === \"impure\")) {\n const values: Record<string, string> = { state: nixState };\n setString(values, \"name\", context.input.environment.NIX_SHELL_NAME);\n setString(values, \"level\", context.input.environment.NIX_SHELL_LEVEL);\n result.nix_shell = values;\n }\n\n if (context.needs(\"guix_shell\") && safeMetadata(context.input.environment.GUIX_ENVIRONMENT)) {\n result.guix_shell = { state: \"active\" };\n }\n return result;\n}\n\nfunction detected(\n context: CollectorContext,\n entries: Awaited<ReturnType<CollectorContext[\"entries\"]>>,\n name: \"mise\" | \"direnv\" | \"pixi\",\n defaultFiles: string[],\n): boolean {\n const files = optionStrings(context, name, \"detect_files\");\n return directMatch(\n entries,\n files.length > 0 ? files : defaultFiles,\n optionStrings(context, name, \"detect_extensions\"),\n optionStrings(context, name, \"detect_folders\"),\n );\n}\n\nexport function parseMiseHealth(output: string): string | undefined {\n const text = safeMetadata(output, 8_192)?.toLowerCase();\n if (!text) return undefined;\n if (/\\b(?:healthy|no problems found|all checks passed)\\b/u.test(text)) return \"healthy\";\n if (/\\b(?:error|unhealthy|problem|warning)\\b/u.test(text)) return \"issues\";\n return undefined;\n}\n\nexport function parseDirenvStatus(output: string): Record<string, string> {\n try {\n const document = JSON.parse(output) as unknown;\n if (!isRecord(document)) return {};\n const values: Record<string, string> = {};\n const found = isRecord(document.foundRC) ? document.foundRC : undefined;\n const loaded = isRecord(document.loadedRC) ? document.loadedRC : undefined;\n setString(values, \"rc_path\", found?.path ?? loaded?.path);\n if (typeof found?.allowed === \"number\" || typeof found?.allowed === \"boolean\") {\n values.allowed = found.allowed ? \"allowed\" : \"denied\";\n }\n if (loaded) values.loaded = \"loaded\";\n else if (found) values.loaded = \"not loaded\";\n return values;\n } catch {\n const path = /^Found RC path ([^\\r\\n]+)$/mu.exec(output)?.[1];\n return path ? { rc_path: safeMetadata(path) ?? \"\" } : {};\n }\n}\n\nasync function readPixiProject(context: CollectorContext): Promise<string | undefined> {\n const source = await context.fs.readFile(join(context.input.cwd, \"pixi.toml\"), MAX_METADATA_FILE_BYTES);\n if (!source) return undefined;\n try {\n const document = parse(source);\n const project = isRecord(document.project) ? document.project : undefined;\n const workspace = isRecord(document.workspace) ? document.workspace : undefined;\n return safeMetadata(project?.name) ?? safeMetadata(workspace?.name);\n } catch {\n return undefined;\n }\n}\n\nfunction parsePixiVersion(output: string): string | undefined {\n const match = /^(?:pixi\\s+)?(\\d+\\.\\d+\\.\\d+(?:[-+][0-9A-Za-z.-]+)?)$/u.exec(output.trim());\n return match?.[1] ? `v${match[1]}` : undefined;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA,SAAS,YAAY;AACrB,SAAS,aAAa;AAetB,eAAsB,mBAAmB,SAA2D;AAClG,QAAM,SAAgC,CAAC;AACvC,QAAM,cAAc,CAAC,QAAQ,UAAU,MAAM;AAC7C,QAAM,eAAe,YAAY,KAAK,CAAC,SAAS,QAAQ,MAAM,IAAI,CAAC;AACnE,QAAM,UAAU,eAAe,MAAM,QAAQ,QAAQ,IAAI,CAAC;AAE1D,MAAI,QAAQ,MAAM,MAAM,KAAK,SAAS,SAAS,SAAS,QAAQ,CAAC,aAAa,cAAc,gBAAgB,CAAC,GAAG;AAC9G,UAAM,SAAiC,CAAC;AACxC,QAAI,QAAQ,MAAM,QAAQ,QAAQ,GAAG;AACnC,YAAM,SAAS,MAAM,WAAW,SA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