@narumitw/pi-starship 0.49.3 → 0.49.4

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 (84) hide show
  1. package/README.md +2 -4
  2. package/package.json +4 -8
  3. package/src/command-contract.ts +13 -0
  4. package/src/command-inspector.ts +198 -0
  5. package/src/command-preview.ts +206 -0
  6. package/src/commands.ts +575 -0
  7. package/src/config.ts +794 -0
  8. package/src/format/formatter.ts +275 -0
  9. package/src/format/style.ts +278 -0
  10. package/src/index.ts +1 -1
  11. package/src/modules/activity.ts +38 -0
  12. package/src/modules/brand.ts +13 -0
  13. package/src/modules/cache.ts +23 -0
  14. package/src/modules/catalog.ts +124 -0
  15. package/src/modules/cloud.ts +74 -0
  16. package/src/modules/context.ts +33 -0
  17. package/src/modules/cost.ts +31 -0
  18. package/src/modules/deployment.ts +61 -0
  19. package/src/modules/development.ts +112 -0
  20. package/src/modules/directory.ts +151 -0
  21. package/src/modules/display.ts +14 -0
  22. package/src/modules/execution.ts +84 -0
  23. package/src/modules/extension-status.ts +93 -0
  24. package/src/modules/fill.ts +14 -0
  25. package/src/modules/git/branch.ts +31 -0
  26. package/src/modules/git/commit.ts +29 -0
  27. package/src/modules/git/metrics.ts +26 -0
  28. package/src/modules/git/runtime.ts +415 -0
  29. package/src/modules/git/state.ts +21 -0
  30. package/src/modules/git/status.ts +87 -0
  31. package/src/modules/git/worktree.ts +16 -0
  32. package/src/modules/github-pr.ts +24 -0
  33. package/src/modules/helpers.ts +5 -0
  34. package/src/modules/index.ts +31 -0
  35. package/src/modules/inspection.ts +138 -0
  36. package/src/modules/languages.ts +87 -0
  37. package/src/modules/model.ts +85 -0
  38. package/src/modules/package.ts +17 -0
  39. package/src/modules/provider.ts +13 -0
  40. package/src/modules/render.ts +166 -0
  41. package/src/modules/terminal.ts +60 -0
  42. package/src/modules/thinking.ts +13 -0
  43. package/src/modules/time.ts +20 -0
  44. package/src/modules/tokens.ts +18 -0
  45. package/src/modules/truncation.ts +37 -0
  46. package/src/modules/turn.ts +13 -0
  47. package/src/modules/types.ts +189 -0
  48. package/src/modules/workspace-helpers.ts +10 -0
  49. package/src/pi-starship.ts +609 -0
  50. package/src/runtime/cloud.ts +166 -0
  51. package/src/runtime/command.ts +123 -0
  52. package/src/runtime/deployment.ts +201 -0
  53. package/src/runtime/development.ts +153 -0
  54. package/src/runtime/execution.ts +151 -0
  55. package/src/runtime/github-pr.ts +332 -0
  56. package/src/runtime/helpers.ts +274 -0
  57. package/src/runtime/languages.ts +205 -0
  58. package/src/runtime/package.ts +112 -0
  59. package/src/runtime/refresh-controller.ts +107 -0
  60. package/src/runtime/types.ts +63 -0
  61. package/src/runtime/workspace.ts +147 -0
  62. package/src/usage.ts +53 -0
  63. package/dist/chunks/chunk-CKNSOLSW.ts +0 -10
  64. package/dist/chunks/chunk-CKNSOLSW.ts.map +0 -7
  65. package/dist/chunks/chunk-G2GG2V6Q.ts +0 -218
  66. package/dist/chunks/chunk-G2GG2V6Q.ts.map +0 -7
  67. package/dist/chunks/chunk-Q6DLIM7H.ts +0 -2492
  68. package/dist/chunks/chunk-Q6DLIM7H.ts.map +0 -7
  69. package/dist/chunks/cloud-JBSZWTB6.ts +0 -142
  70. package/dist/chunks/cloud-JBSZWTB6.ts.map +0 -7
  71. package/dist/chunks/commands-BSQZ2R4M.ts +0 -757
  72. package/dist/chunks/commands-BSQZ2R4M.ts.map +0 -7
  73. package/dist/chunks/deployment-ZNYM4B6W.ts +0 -172
  74. package/dist/chunks/deployment-ZNYM4B6W.ts.map +0 -7
  75. package/dist/chunks/development-TNWZ5SRC.ts +0 -132
  76. package/dist/chunks/development-TNWZ5SRC.ts.map +0 -7
  77. package/dist/chunks/execution-QHAP4U33.ts +0 -132
  78. package/dist/chunks/execution-QHAP4U33.ts.map +0 -7
  79. package/dist/chunks/languages-DPWDCH6Q.ts +0 -184
  80. package/dist/chunks/languages-DPWDCH6Q.ts.map +0 -7
  81. package/dist/chunks/package-MXN2YFLX.ts +0 -104
  82. package/dist/chunks/package-MXN2YFLX.ts.map +0 -7
  83. package/dist/pi-starship.ts +0 -1350
  84. package/dist/pi-starship.ts.map +0 -7
@@ -0,0 +1,63 @@
1
+ import type { StarshipConfig } from "../config.js";
2
+ import type { ModuleName } from "../modules/catalog.js";
3
+ import type { WorkspaceSnapshot } from "../modules/types.js";
4
+
5
+ export interface WorkspaceExecResult {
6
+ stdout: string;
7
+ stderr: string;
8
+ code: number;
9
+ killed: boolean;
10
+ }
11
+
12
+ export type WorkspaceExec = (
13
+ command: string,
14
+ args: string[],
15
+ options: {
16
+ cwd: string;
17
+ timeout: number;
18
+ maxOutputBytes: number;
19
+ signal?: AbortSignal;
20
+ environment: Readonly<Record<string, string | undefined>>;
21
+ },
22
+ ) => Promise<WorkspaceExecResult>;
23
+
24
+ export interface WorkspaceEntry {
25
+ name: string;
26
+ isFile: boolean;
27
+ isDirectory: boolean;
28
+ }
29
+
30
+ export interface WorkspaceFileSystem {
31
+ readFile(path: string, maxBytes: number): Promise<string | undefined>;
32
+ readDirectory(path: string): Promise<readonly WorkspaceEntry[]>;
33
+ fileExists(path: string): Promise<boolean>;
34
+ }
35
+
36
+ export interface WorkspaceRefreshInput {
37
+ cwd: string;
38
+ config: StarshipConfig;
39
+ environment: Readonly<Record<string, string | undefined>>;
40
+ homeDir: string;
41
+ platform: NodeJS.Platform;
42
+ hostname: string;
43
+ username: string;
44
+ exec: WorkspaceExec;
45
+ fileSystem?: Partial<WorkspaceFileSystem>;
46
+ fileExists?(path: string): Promise<boolean>;
47
+ reason?: "initial" | "event" | "periodic";
48
+ previous?: WorkspaceSnapshot;
49
+ signal?: AbortSignal;
50
+ }
51
+
52
+ export interface CollectorContext {
53
+ input: WorkspaceRefreshInput;
54
+ fs: WorkspaceFileSystem;
55
+ requirements: ReadonlyMap<ModuleName, ReadonlySet<string>>;
56
+ entries(): Promise<readonly WorkspaceEntry[]>;
57
+ options(name: ModuleName): Readonly<Record<string, unknown>>;
58
+ needs(name: ModuleName, variable?: string): boolean;
59
+ }
60
+
61
+ export const PRIVATE_STYLE_SELECTOR = "__pi_style_selector";
62
+
63
+ export type MutableModuleSnapshot = Record<string, Record<string, string>>;
@@ -0,0 +1,147 @@
1
+ import type { ModuleName } from "../modules/catalog.js";
2
+ import { reachableModuleRequirements } from "../modules/render.js";
3
+ import type { WorkspaceSnapshot } from "../modules/types.js";
4
+ import { createFileSystem } from "./helpers.js";
5
+ import {
6
+ type CollectorContext,
7
+ type MutableModuleSnapshot,
8
+ PRIVATE_STYLE_SELECTOR,
9
+ type WorkspaceEntry,
10
+ type WorkspaceRefreshInput,
11
+ } from "./types.js";
12
+
13
+ export type { WorkspaceExec, WorkspaceExecResult, WorkspaceRefreshInput } from "./types.js";
14
+
15
+ export async function collectWorkspaceSnapshot(
16
+ input: WorkspaceRefreshInput,
17
+ ): Promise<WorkspaceSnapshot> {
18
+ const requirements = reachableModuleRequirements(input.config);
19
+ if (input.signal?.aborted || !hasWorkspaceRequirement(requirements)) return freezeSnapshot({});
20
+ const fs = createFileSystem(input);
21
+ let listing: Promise<readonly WorkspaceEntry[]> | undefined;
22
+ const context: CollectorContext = {
23
+ input,
24
+ fs,
25
+ requirements,
26
+ entries() {
27
+ listing ??= fs.readDirectory(input.cwd);
28
+ return listing;
29
+ },
30
+ options(name) {
31
+ return input.config.modules[name].options;
32
+ },
33
+ needs(name, variable) {
34
+ const variables = requirements.get(name);
35
+ return Boolean(variables && (variable === undefined || variables.has(variable)));
36
+ },
37
+ };
38
+ const modules: MutableModuleSnapshot = {};
39
+ if (requirements.has("package")) {
40
+ const { collectPackage } = await import("./package.js");
41
+ if (input.signal?.aborted) return freezeSnapshot({});
42
+ const packageValues = await collectPackage(context);
43
+ if (input.signal?.aborted) return freezeSnapshot({});
44
+ if (packageValues) modules.package = packageValues;
45
+ }
46
+ for (const descriptor of COLLECTOR_GROUPS) {
47
+ if (!descriptor.modules.some((name) => requirements.has(name))) continue;
48
+ if (input.signal?.aborted) return freezeSnapshot({});
49
+ const collector = await descriptor.load();
50
+ if (input.signal?.aborted) return freezeSnapshot({});
51
+ mergeModules(modules, await collector(context));
52
+ }
53
+ return input.signal?.aborted ? freezeSnapshot({}) : freezeSnapshot(modules);
54
+ }
55
+
56
+ export function workspaceSnapshotEqual(
57
+ left: WorkspaceSnapshot | undefined,
58
+ right: WorkspaceSnapshot | undefined,
59
+ ): boolean {
60
+ return JSON.stringify(left) === JSON.stringify(right);
61
+ }
62
+
63
+ function hasWorkspaceRequirement(
64
+ requirements: ReadonlyMap<ModuleName, ReadonlySet<string>>,
65
+ ): boolean {
66
+ return [...requirements.keys()].some((name) => !BUILT_IN_ONLY_MODULES.has(name));
67
+ }
68
+
69
+ type WorkspaceCollector = (context: CollectorContext) => Promise<MutableModuleSnapshot>;
70
+
71
+ const COLLECTOR_GROUPS: readonly {
72
+ modules: readonly ModuleName[];
73
+ load(): Promise<WorkspaceCollector>;
74
+ }[] = [
75
+ {
76
+ modules: ["nodejs", "python", "rust", "golang", "bun", "deno"],
77
+ load: async () => (await import("./languages.js")).collectLanguages,
78
+ },
79
+ {
80
+ modules: ["mise", "direnv", "pixi", "conda", "nix_shell", "guix_shell"],
81
+ load: async () => (await import("./development.js")).collectDevelopment,
82
+ },
83
+ {
84
+ modules: ["docker_context", "kubernetes", "terraform"],
85
+ load: async () => (await import("./deployment.js")).collectDeployment,
86
+ },
87
+ {
88
+ modules: ["aws", "gcloud", "azure", "openstack"],
89
+ load: async () => (await import("./cloud.js")).collectCloud,
90
+ },
91
+ {
92
+ modules: ["container", "hostname", "os", "username"],
93
+ load: async () => (await import("./execution.js")).collectExecution,
94
+ },
95
+ ];
96
+
97
+ const BUILT_IN_ONLY_MODULES = new Set<ModuleName>([
98
+ "brand",
99
+ "provider",
100
+ "model",
101
+ "thinking",
102
+ "directory",
103
+ "git_worktree",
104
+ "git_branch",
105
+ "github_pr",
106
+ "git_commit",
107
+ "git_state",
108
+ "git_metrics",
109
+ "git_status",
110
+ "activity",
111
+ "context",
112
+ "tokens",
113
+ "cost",
114
+ "time",
115
+ "turn",
116
+ "fill",
117
+ "extension_status",
118
+ ]);
119
+
120
+ function mergeModules(target: MutableModuleSnapshot, source: MutableModuleSnapshot): void {
121
+ for (const [name, values] of Object.entries(source)) {
122
+ Object.defineProperty(target, name, {
123
+ value: values,
124
+ writable: true,
125
+ enumerable: true,
126
+ configurable: true,
127
+ });
128
+ }
129
+ }
130
+
131
+ function freezeSnapshot(modules: MutableModuleSnapshot): WorkspaceSnapshot {
132
+ const styleSelectors: Record<string, string> = {};
133
+ for (const [name, values] of Object.entries(modules)) {
134
+ const selector = Object.hasOwn(values, PRIVATE_STYLE_SELECTOR)
135
+ ? values[PRIVATE_STYLE_SELECTOR]
136
+ : undefined;
137
+ delete values[PRIVATE_STYLE_SELECTOR];
138
+ if (selector !== undefined) styleSelectors[name] = selector;
139
+ Object.freeze(values);
140
+ }
141
+ return Object.freeze({
142
+ modules: Object.freeze(modules),
143
+ ...(Object.keys(styleSelectors).length > 0
144
+ ? { styleSelectors: Object.freeze(styleSelectors) }
145
+ : {}),
146
+ });
147
+ }
package/src/usage.ts ADDED
@@ -0,0 +1,53 @@
1
+ import type { SessionEntry } from "@earendil-works/pi-coding-agent";
2
+
3
+ interface UsageLike {
4
+ input?: number;
5
+ output?: number;
6
+ cacheRead?: number;
7
+ cacheWrite?: number;
8
+ cost?: { total?: number };
9
+ }
10
+
11
+ export interface FooterUsageSummary {
12
+ input: number;
13
+ output: number;
14
+ cacheRead: number;
15
+ cacheWrite: number;
16
+ cost: number;
17
+ latestCacheHitRate?: number;
18
+ }
19
+
20
+ export function summarizeFooterUsage(entries: readonly SessionEntry[]): FooterUsageSummary {
21
+ const totals: FooterUsageSummary = {
22
+ input: 0,
23
+ output: 0,
24
+ cacheRead: 0,
25
+ cacheWrite: 0,
26
+ cost: 0,
27
+ };
28
+
29
+ for (const entry of entries) {
30
+ let usage: UsageLike | undefined;
31
+ if (entry.type === "message" && entry.message.role === "assistant") {
32
+ usage = entry.message.usage;
33
+ const input = usage.input ?? 0;
34
+ const cacheRead = usage.cacheRead ?? 0;
35
+ const cacheWrite = usage.cacheWrite ?? 0;
36
+ const promptTokens = input + cacheRead + cacheWrite;
37
+ totals.latestCacheHitRate = promptTokens > 0 ? (cacheRead / promptTokens) * 100 : undefined;
38
+ } else if (entry.type === "message" && entry.message.role === "toolResult") {
39
+ usage = entry.message.usage;
40
+ } else if (entry.type === "compaction" || entry.type === "branch_summary") {
41
+ usage = entry.usage;
42
+ }
43
+ if (!usage) continue;
44
+
45
+ totals.input += usage.input ?? 0;
46
+ totals.output += usage.output ?? 0;
47
+ totals.cacheRead += usage.cacheRead ?? 0;
48
+ totals.cacheWrite += usage.cacheWrite ?? 0;
49
+ totals.cost += usage.cost?.total ?? 0;
50
+ }
51
+
52
+ return totals;
53
+ }
@@ -1,10 +0,0 @@
1
- // @generated by scripts/build-runtime.mjs; do not edit.
2
- // @ts-nocheck -- generated JavaScript uses a .ts extension so Pi routes chunks through Jiti.
3
-
4
- // src/runtime/types.ts
5
- var PRIVATE_STYLE_SELECTOR = "__pi_style_selector";
6
-
7
- export {
8
- PRIVATE_STYLE_SELECTOR
9
- };
10
- //# sourceMappingURL=chunk-CKNSOLSW.ts.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/runtime/types.ts"],
4
- "sourcesContent": ["import type { StarshipConfig } from \"../config.js\";\nimport type { ModuleName } from \"../modules/catalog.js\";\nimport type { WorkspaceSnapshot } from \"../modules/types.js\";\n\nexport interface WorkspaceExecResult {\n\tstdout: string;\n\tstderr: string;\n\tcode: number;\n\tkilled: boolean;\n}\n\nexport type WorkspaceExec = (\n\tcommand: string,\n\targs: string[],\n\toptions: {\n\t\tcwd: string;\n\t\ttimeout: number;\n\t\tmaxOutputBytes: number;\n\t\tsignal?: AbortSignal;\n\t\tenvironment: Readonly<Record<string, string | undefined>>;\n\t},\n) => Promise<WorkspaceExecResult>;\n\nexport interface WorkspaceEntry {\n\tname: string;\n\tisFile: boolean;\n\tisDirectory: boolean;\n}\n\nexport interface WorkspaceFileSystem {\n\treadFile(path: string, maxBytes: number): Promise<string | undefined>;\n\treadDirectory(path: string): Promise<readonly WorkspaceEntry[]>;\n\tfileExists(path: string): Promise<boolean>;\n}\n\nexport interface WorkspaceRefreshInput {\n\tcwd: string;\n\tconfig: StarshipConfig;\n\tenvironment: Readonly<Record<string, string | undefined>>;\n\thomeDir: string;\n\tplatform: NodeJS.Platform;\n\thostname: string;\n\tusername: string;\n\texec: WorkspaceExec;\n\tfileSystem?: Partial<WorkspaceFileSystem>;\n\tfileExists?(path: string): Promise<boolean>;\n\treason?: \"initial\" | \"event\" | \"periodic\";\n\tprevious?: WorkspaceSnapshot;\n\tsignal?: AbortSignal;\n}\n\nexport interface CollectorContext {\n\tinput: WorkspaceRefreshInput;\n\tfs: WorkspaceFileSystem;\n\trequirements: ReadonlyMap<ModuleName, ReadonlySet<string>>;\n\tentries(): Promise<readonly WorkspaceEntry[]>;\n\toptions(name: ModuleName): Readonly<Record<string, unknown>>;\n\tneeds(name: ModuleName, variable?: string): boolean;\n}\n\nexport const PRIVATE_STYLE_SELECTOR = \"__pi_style_selector\";\n\nexport type MutableModuleSnapshot = Record<string, Record<string, string>>;\n"],
5
- "mappings": ";;;;AA4DO,IAAM,yBAAyB;",
6
- "names": []
7
- }
@@ -1,218 +0,0 @@
1
- // @generated by scripts/build-runtime.mjs; do not edit.
2
- // @ts-nocheck -- generated JavaScript uses a .ts extension so Pi routes chunks through Jiti.
3
-
4
- // src/runtime/helpers.ts
5
- import { open, opendir, stat } from "node:fs/promises";
6
- import { basename, delimiter, dirname, extname, join, resolve } from "node:path";
7
- var MAX_METADATA_FILE_BYTES = 64 * 1024;
8
- var COMMAND_TIMEOUT_MS = 2e3;
9
- var MAX_COMMAND_OUTPUT_BYTES = 64 * 1024;
10
- var MAX_DIRECTORY_ENTRIES = 2048;
11
- var MAX_LABEL_LENGTH = 160;
12
- function createFileSystem(input) {
13
- const defaults = {
14
- async readFile(path, maxBytes) {
15
- let handle;
16
- try {
17
- handle = await open(path, "r");
18
- const info = await handle.stat();
19
- if (!info.isFile() || info.size > maxBytes) return void 0;
20
- const buffer = Buffer.alloc(Math.min(maxBytes + 1, Number(info.size) + 1));
21
- const { bytesRead } = await handle.read(buffer, 0, buffer.length, 0);
22
- if (bytesRead > maxBytes) return void 0;
23
- return buffer.subarray(0, bytesRead).toString("utf8");
24
- } catch {
25
- return void 0;
26
- } finally {
27
- await handle?.close().catch(() => void 0);
28
- }
29
- },
30
- async readDirectory(path) {
31
- const entries = [];
32
- try {
33
- const directory = await opendir(path);
34
- for await (const entry of directory) {
35
- entries.push({
36
- name: entry.name,
37
- isFile: entry.isFile(),
38
- isDirectory: entry.isDirectory()
39
- });
40
- if (entries.length >= MAX_DIRECTORY_ENTRIES) break;
41
- }
42
- } catch {
43
- return [];
44
- }
45
- return entries;
46
- },
47
- async fileExists(path) {
48
- try {
49
- await stat(path);
50
- return true;
51
- } catch {
52
- return false;
53
- }
54
- }
55
- };
56
- return {
57
- ...defaults,
58
- ...input.fileSystem,
59
- ...input.fileExists ? { fileExists: input.fileExists } : {}
60
- };
61
- }
62
- function safeMetadata(value, maxLength = MAX_LABEL_LENGTH) {
63
- if (typeof value !== "string") return void 0;
64
- const sanitized = Array.from(value, (character) => {
65
- const code = character.codePointAt(0) ?? 0;
66
- return code <= 31 || code >= 127 && code <= 159 || code >= 55296 && code <= 57343 ? "" : character;
67
- }).join("").trim();
68
- if (!sanitized) return void 0;
69
- return Array.from(sanitized).slice(0, maxLength).join("");
70
- }
71
- function isRecord(value) {
72
- return typeof value === "object" && value !== null && !Array.isArray(value);
73
- }
74
- function setString(record, key, value) {
75
- const safe = safeMetadata(value);
76
- if (!safe) return;
77
- Object.defineProperty(record, key, {
78
- value: safe,
79
- writable: true,
80
- enumerable: true,
81
- configurable: true
82
- });
83
- }
84
- function optionString(context, module, key) {
85
- const value = context.options(module)[key];
86
- return typeof value === "string" ? value : void 0;
87
- }
88
- function optionBoolean(context, module, key) {
89
- return context.options(module)[key] === true;
90
- }
91
- function optionNumber(context, module, key) {
92
- const value = context.options(module)[key];
93
- return typeof value === "number" ? value : void 0;
94
- }
95
- function optionStrings(context, module, key) {
96
- const value = context.options(module)[key];
97
- return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : [];
98
- }
99
- function optionMap(context, module, key) {
100
- const value = context.options(module)[key];
101
- return isRecord(value) ? value : {};
102
- }
103
- function exactAlias(value, aliases) {
104
- if (!value) return void 0;
105
- return Object.hasOwn(aliases, value) ? safeMetadata(aliases[value]) : value;
106
- }
107
- function formatVersion(raw, format) {
108
- return (format ?? "v$raw").replaceAll("$raw", raw.replace(/^v/u, ""));
109
- }
110
- async function runBounded(context, command, args) {
111
- try {
112
- const result = await context.input.exec(command, args, {
113
- cwd: context.input.cwd,
114
- timeout: COMMAND_TIMEOUT_MS,
115
- maxOutputBytes: MAX_COMMAND_OUTPUT_BYTES,
116
- signal: context.input.signal,
117
- environment: context.input.environment
118
- });
119
- if (result.code !== 0 || result.killed) return void 0;
120
- const selectedOutput = result.stdout || result.stderr;
121
- const output = Buffer.from(selectedOutput).subarray(0, MAX_COMMAND_OUTPUT_BYTES + 1);
122
- if (output.byteLength > MAX_COMMAND_OUTPUT_BYTES) return void 0;
123
- return output.toString("utf8");
124
- } catch {
125
- return void 0;
126
- }
127
- }
128
- function parseIni(source) {
129
- const result = {};
130
- let section = "";
131
- for (const rawLine of source.split(/\r?\n/u)) {
132
- const line = rawLine.trim();
133
- if (!line || line.startsWith("#") || line.startsWith(";")) continue;
134
- const sectionMatch = /^\[([^\]]+)\]$/u.exec(line);
135
- if (sectionMatch?.[1]) {
136
- section = sectionMatch[1].trim();
137
- if (!Object.hasOwn(result, section)) setOwn(result, section, {});
138
- continue;
139
- }
140
- const separator = line.indexOf("=");
141
- if (separator <= 0) continue;
142
- const key = line.slice(0, separator).trim();
143
- const value = safeMetadata(line.slice(separator + 1));
144
- if (!value) continue;
145
- if (!Object.hasOwn(result, section)) setOwn(result, section, {});
146
- setOwn(result[section], key, value);
147
- }
148
- return result;
149
- }
150
- function directMatch(entries, files, extensions, folders) {
151
- const positiveFiles = files.filter((value) => !value.startsWith("!"));
152
- const negativeFiles = new Set(
153
- files.filter((value) => value.startsWith("!")).map((v) => v.slice(1))
154
- );
155
- const positiveExtensions = extensions.filter((value) => !value.startsWith("!")).map((value) => value.replace(/^\./u, ""));
156
- const negativeExtensions = new Set(
157
- extensions.filter((value) => value.startsWith("!")).map((value) => value.slice(1).replace(/^\./u, ""))
158
- );
159
- const positiveFolders = folders.filter((value) => !value.startsWith("!"));
160
- const negativeFolders = new Set(
161
- folders.filter((value) => value.startsWith("!")).map((value) => value.slice(1))
162
- );
163
- if (entries.some(
164
- (entry) => negativeFiles.has(entry.name) || entry.isFile && negativeExtensions.has(extname(entry.name).slice(1)) || entry.isDirectory && negativeFolders.has(entry.name)
165
- )) {
166
- return false;
167
- }
168
- return entries.some(
169
- (entry) => positiveFiles.includes(entry.name) || entry.isFile && positiveExtensions.includes(extname(entry.name).slice(1)) || entry.isDirectory && positiveFolders.includes(entry.name)
170
- );
171
- }
172
- function parentDirectories(start, limit) {
173
- const result = [];
174
- let current = resolve(start);
175
- for (let index = 0; index < limit; index += 1) {
176
- const parent = dirname(current);
177
- if (parent === current) break;
178
- result.push(parent);
179
- current = parent;
180
- }
181
- return result;
182
- }
183
- function pathName(path) {
184
- return basename(path.replace(/[\\/]+$/u, "")) || path;
185
- }
186
- function joinHome(input, ...parts) {
187
- return join(input.homeDir, ...parts);
188
- }
189
- function setOwn(record, key, value) {
190
- Object.defineProperty(record, key, {
191
- value,
192
- writable: true,
193
- enumerable: true,
194
- configurable: true
195
- });
196
- }
197
-
198
- export {
199
- MAX_METADATA_FILE_BYTES,
200
- createFileSystem,
201
- safeMetadata,
202
- isRecord,
203
- setString,
204
- optionString,
205
- optionBoolean,
206
- optionNumber,
207
- optionStrings,
208
- optionMap,
209
- exactAlias,
210
- formatVersion,
211
- runBounded,
212
- parseIni,
213
- directMatch,
214
- parentDirectories,
215
- pathName,
216
- joinHome
217
- };
218
- //# sourceMappingURL=chunk-G2GG2V6Q.ts.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/runtime/helpers.ts"],
4
- "sourcesContent": ["import { type FileHandle, open, opendir, stat } from \"node:fs/promises\";\nimport { basename, delimiter, dirname, extname, join, resolve } from \"node:path\";\nimport type {\n\tCollectorContext,\n\tWorkspaceEntry,\n\tWorkspaceFileSystem,\n\tWorkspaceRefreshInput,\n} from \"./types.js\";\n\nexport const MAX_METADATA_FILE_BYTES = 64 * 1024;\nexport const COMMAND_TIMEOUT_MS = 2_000;\nexport const MAX_COMMAND_OUTPUT_BYTES = 64 * 1024;\nconst MAX_DIRECTORY_ENTRIES = 2_048;\nconst MAX_LABEL_LENGTH = 160;\n\nexport function createFileSystem(input: WorkspaceRefreshInput): WorkspaceFileSystem {\n\tconst defaults: WorkspaceFileSystem = {\n\t\tasync readFile(path, maxBytes) {\n\t\t\tlet handle: FileHandle | undefined;\n\t\t\ttry {\n\t\t\t\thandle = await open(path, \"r\");\n\t\t\t\tconst info = await handle.stat();\n\t\t\t\tif (!info.isFile() || info.size > maxBytes) return undefined;\n\t\t\t\tconst buffer = Buffer.alloc(Math.min(maxBytes + 1, Number(info.size) + 1));\n\t\t\t\tconst { bytesRead } = await handle.read(buffer, 0, buffer.length, 0);\n\t\t\t\tif (bytesRead > maxBytes) return undefined;\n\t\t\t\treturn buffer.subarray(0, bytesRead).toString(\"utf8\");\n\t\t\t} catch {\n\t\t\t\treturn undefined;\n\t\t\t} finally {\n\t\t\t\tawait handle?.close().catch(() => undefined);\n\t\t\t}\n\t\t},\n\t\tasync readDirectory(path) {\n\t\t\tconst entries: WorkspaceEntry[] = [];\n\t\t\ttry {\n\t\t\t\tconst directory = await opendir(path);\n\t\t\t\tfor await (const entry of directory) {\n\t\t\t\t\tentries.push({\n\t\t\t\t\t\tname: entry.name,\n\t\t\t\t\t\tisFile: entry.isFile(),\n\t\t\t\t\t\tisDirectory: entry.isDirectory(),\n\t\t\t\t\t});\n\t\t\t\t\tif (entries.length >= MAX_DIRECTORY_ENTRIES) break;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\treturn entries;\n\t\t},\n\t\tasync fileExists(path) {\n\t\t\ttry {\n\t\t\t\tawait stat(path);\n\t\t\t\treturn true;\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t};\n\treturn {\n\t\t...defaults,\n\t\t...input.fileSystem,\n\t\t...(input.fileExists ? { fileExists: input.fileExists } : {}),\n\t};\n}\n\nexport function safeMetadata(value: unknown, maxLength = MAX_LABEL_LENGTH): string | undefined {\n\tif (typeof value !== \"string\") return undefined;\n\tconst sanitized = Array.from(value, (character) => {\n\t\tconst code = character.codePointAt(0) ?? 0;\n\t\treturn code <= 0x1f || (code >= 0x7f && code <= 0x9f) || (code >= 0xd800 && code <= 0xdfff)\n\t\t\t? \"\"\n\t\t\t: character;\n\t})\n\t\t.join(\"\")\n\t\t.trim();\n\tif (!sanitized) return undefined;\n\treturn Array.from(sanitized).slice(0, maxLength).join(\"\");\n}\n\nexport function ownString(record: unknown, key: string): string | undefined {\n\tif (!isRecord(record) || !Object.hasOwn(record, key)) return undefined;\n\treturn safeMetadata(record[key]);\n}\n\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nexport function setString(record: Record<string, string>, key: string, value: unknown): void {\n\tconst safe = safeMetadata(value);\n\tif (!safe) return;\n\tObject.defineProperty(record, key, {\n\t\tvalue: safe,\n\t\twritable: true,\n\t\tenumerable: true,\n\t\tconfigurable: true,\n\t});\n}\n\nexport function optionString(\n\tcontext: CollectorContext,\n\tmodule: Parameters<CollectorContext[\"options\"]>[0],\n\tkey: string,\n): string | undefined {\n\tconst value = context.options(module)[key];\n\treturn typeof value === \"string\" ? value : undefined;\n}\n\nexport function optionBoolean(\n\tcontext: CollectorContext,\n\tmodule: Parameters<CollectorContext[\"options\"]>[0],\n\tkey: string,\n): boolean {\n\treturn context.options(module)[key] === true;\n}\n\nexport function optionNumber(\n\tcontext: CollectorContext,\n\tmodule: Parameters<CollectorContext[\"options\"]>[0],\n\tkey: string,\n): number | undefined {\n\tconst value = context.options(module)[key];\n\treturn typeof value === \"number\" ? value : undefined;\n}\n\nexport function optionStrings(\n\tcontext: CollectorContext,\n\tmodule: Parameters<CollectorContext[\"options\"]>[0],\n\tkey: string,\n): readonly string[] {\n\tconst value = context.options(module)[key];\n\treturn Array.isArray(value) && value.every((item) => typeof item === \"string\") ? value : [];\n}\n\nexport function optionMap(\n\tcontext: CollectorContext,\n\tmodule: Parameters<CollectorContext[\"options\"]>[0],\n\tkey: string,\n): Readonly<Record<string, string>> {\n\tconst value = context.options(module)[key];\n\treturn isRecord(value) ? (value as Record<string, string>) : {};\n}\n\nexport function exactAlias(value: string | undefined, aliases: Readonly<Record<string, string>>) {\n\tif (!value) return undefined;\n\treturn Object.hasOwn(aliases, value) ? safeMetadata(aliases[value]) : value;\n}\n\nexport function formatVersion(raw: string, format: string | undefined): string {\n\treturn (format ?? \"v$raw\").replaceAll(\"$raw\", raw.replace(/^v/u, \"\"));\n}\n\nexport async function runBounded(\n\tcontext: CollectorContext,\n\tcommand: string,\n\targs: string[],\n): Promise<string | undefined> {\n\ttry {\n\t\tconst result = await context.input.exec(command, args, {\n\t\t\tcwd: context.input.cwd,\n\t\t\ttimeout: COMMAND_TIMEOUT_MS,\n\t\t\tmaxOutputBytes: MAX_COMMAND_OUTPUT_BYTES,\n\t\t\tsignal: context.input.signal,\n\t\t\tenvironment: context.input.environment,\n\t\t});\n\t\tif (result.code !== 0 || result.killed) return undefined;\n\t\tconst selectedOutput = result.stdout || result.stderr;\n\t\tconst output = Buffer.from(selectedOutput).subarray(0, MAX_COMMAND_OUTPUT_BYTES + 1);\n\t\tif (output.byteLength > MAX_COMMAND_OUTPUT_BYTES) return undefined;\n\t\treturn output.toString(\"utf8\");\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport function parseIni(source: string): Record<string, Record<string, string>> {\n\tconst result: Record<string, Record<string, string>> = {};\n\tlet section = \"\";\n\tfor (const rawLine of source.split(/\\r?\\n/u)) {\n\t\tconst line = rawLine.trim();\n\t\tif (!line || line.startsWith(\"#\") || line.startsWith(\";\")) continue;\n\t\tconst sectionMatch = /^\\[([^\\]]+)\\]$/u.exec(line);\n\t\tif (sectionMatch?.[1]) {\n\t\t\tsection = sectionMatch[1].trim();\n\t\t\tif (!Object.hasOwn(result, section)) setOwn(result, section, {});\n\t\t\tcontinue;\n\t\t}\n\t\tconst separator = line.indexOf(\"=\");\n\t\tif (separator <= 0) continue;\n\t\tconst key = line.slice(0, separator).trim();\n\t\tconst value = safeMetadata(line.slice(separator + 1));\n\t\tif (!value) continue;\n\t\tif (!Object.hasOwn(result, section)) setOwn(result, section, {});\n\t\tsetOwn(result[section] as Record<string, string>, key, value);\n\t}\n\treturn result;\n}\n\nexport function envPathList(value: string | undefined): string[] {\n\treturn (value ?? \"\")\n\t\t.split(delimiter)\n\t\t.map((part) => part.trim())\n\t\t.filter(Boolean);\n}\n\nexport function directMatch(\n\tentries: readonly WorkspaceEntry[],\n\tfiles: readonly string[],\n\textensions: readonly string[],\n\tfolders: readonly string[],\n): boolean {\n\tconst positiveFiles = files.filter((value) => !value.startsWith(\"!\"));\n\tconst negativeFiles = new Set(\n\t\tfiles.filter((value) => value.startsWith(\"!\")).map((v) => v.slice(1)),\n\t);\n\tconst positiveExtensions = extensions\n\t\t.filter((value) => !value.startsWith(\"!\"))\n\t\t.map((value) => value.replace(/^\\./u, \"\"));\n\tconst negativeExtensions = new Set(\n\t\textensions\n\t\t\t.filter((value) => value.startsWith(\"!\"))\n\t\t\t.map((value) => value.slice(1).replace(/^\\./u, \"\")),\n\t);\n\tconst positiveFolders = folders.filter((value) => !value.startsWith(\"!\"));\n\tconst negativeFolders = new Set(\n\t\tfolders.filter((value) => value.startsWith(\"!\")).map((value) => value.slice(1)),\n\t);\n\tif (\n\t\tentries.some(\n\t\t\t(entry) =>\n\t\t\t\tnegativeFiles.has(entry.name) ||\n\t\t\t\t(entry.isFile && negativeExtensions.has(extname(entry.name).slice(1))) ||\n\t\t\t\t(entry.isDirectory && negativeFolders.has(entry.name)),\n\t\t)\n\t) {\n\t\treturn false;\n\t}\n\treturn entries.some(\n\t\t(entry) =>\n\t\t\tpositiveFiles.includes(entry.name) ||\n\t\t\t(entry.isFile && positiveExtensions.includes(extname(entry.name).slice(1))) ||\n\t\t\t(entry.isDirectory && positiveFolders.includes(entry.name)),\n\t);\n}\n\nexport function parentDirectories(start: string, limit: number): string[] {\n\tconst result: string[] = [];\n\tlet current = resolve(start);\n\tfor (let index = 0; index < limit; index += 1) {\n\t\tconst parent = dirname(current);\n\t\tif (parent === current) break;\n\t\tresult.push(parent);\n\t\tcurrent = parent;\n\t}\n\treturn result;\n}\n\nexport function pathName(path: string): string {\n\treturn basename(path.replace(/[\\\\/]+$/u, \"\")) || path;\n}\n\nexport function joinHome(input: WorkspaceRefreshInput, ...parts: string[]): string {\n\treturn join(input.homeDir, ...parts);\n}\n\nfunction setOwn<T>(record: Record<string, T>, key: string, value: T): void {\n\tObject.defineProperty(record, key, {\n\t\tvalue,\n\t\twritable: true,\n\t\tenumerable: true,\n\t\tconfigurable: true,\n\t});\n}\n"],
5
- "mappings": ";;;;AAAA,SAA0B,MAAM,SAAS,YAAY;AACrD,SAAS,UAAU,WAAW,SAAS,SAAS,MAAM,eAAe;AAQ9D,IAAM,0BAA0B,KAAK;AACrC,IAAM,qBAAqB;AAC3B,IAAM,2BAA2B,KAAK;AAC7C,IAAM,wBAAwB;AAC9B,IAAM,mBAAmB;AAElB,SAAS,iBAAiB,OAAmD;AACnF,QAAM,WAAgC;AAAA,IACrC,MAAM,SAAS,MAAM,UAAU;AAC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