pi-umbra 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -4
- package/node_modules/@shikijs/cli/dist/cli.d.mts +13 -6
- package/node_modules/@shikijs/cli/dist/cli.mjs +32 -27
- package/node_modules/@shikijs/cli/dist/{code-to-ansi-BNrZay-4.mjs → code-to-ansi-Dmm_CuZ9.mjs} +15 -7
- package/node_modules/@shikijs/cli/dist/index.d.mts +24 -3
- package/node_modules/@shikijs/cli/dist/index.mjs +1 -1
- package/node_modules/@shikijs/cli/package.json +3 -3
- package/node_modules/@shikijs/core/dist/index.d.mts +28 -28
- package/node_modules/@shikijs/core/dist/index.mjs +15 -12
- package/node_modules/@shikijs/core/package.json +4 -4
- package/node_modules/@shikijs/engine-javascript/dist/{engine-compile-Bdn9ihA2.d.mts → engine-compile-CtqiSkRk.d.mts} +5 -0
- package/node_modules/@shikijs/engine-javascript/dist/engine-compile.d.mts +1 -1
- package/node_modules/@shikijs/engine-javascript/dist/engine-compile.mjs +2 -4
- package/node_modules/@shikijs/engine-javascript/dist/engine-raw.d.mts +2 -3
- package/node_modules/@shikijs/engine-javascript/dist/engine-raw.mjs +2 -4
- package/node_modules/@shikijs/engine-javascript/dist/index.d.mts +1 -1
- package/node_modules/@shikijs/engine-javascript/dist/index.mjs +1 -1
- package/node_modules/@shikijs/engine-javascript/dist/string-TLTPtCPs.mjs +115 -0
- package/node_modules/@shikijs/engine-javascript/package.json +3 -3
- package/node_modules/@shikijs/engine-oniguruma/package.json +3 -3
- package/node_modules/@shikijs/langs/dist/ada.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/ahk.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/beancount.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/coq.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/csharp.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/css.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/dart.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/dotenv.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/emacs-lisp.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/gn.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/handlebars.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/julia.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/latex.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/luau.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/marko.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/moonbit.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/nextflow-groovy.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/nextflow.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/nushell.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/php.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/powershell.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/ruby.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/rust.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/sql.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/svelte.mjs +1 -1
- package/node_modules/@shikijs/langs/dist/twig.mjs +3 -3
- package/node_modules/@shikijs/langs/dist/typespec.mjs +1 -1
- package/node_modules/@shikijs/langs/package.json +3 -3
- package/node_modules/@shikijs/primitive/dist/index.d.mts +31 -32
- package/node_modules/@shikijs/primitive/dist/index.mjs +2 -1
- package/node_modules/@shikijs/primitive/package.json +3 -3
- package/node_modules/@shikijs/themes/dist/monokai.mjs +1 -1
- package/node_modules/@shikijs/themes/dist/one-dark-pro.mjs +1 -1
- package/node_modules/@shikijs/themes/dist/red.mjs +1 -1
- package/node_modules/@shikijs/themes/dist/solarized-dark.mjs +1 -1
- package/node_modules/@shikijs/themes/dist/solarized-light.mjs +1 -1
- package/node_modules/@shikijs/themes/package.json +3 -3
- package/node_modules/@shikijs/types/dist/index.d.mts +76 -76
- package/node_modules/@shikijs/types/package.json +1 -1
- package/node_modules/pi-umbra-copy-chat/README.md +4 -7
- package/node_modules/pi-umbra-copy-chat/extensions/umbra-copy-chat.ts +16 -54
- package/node_modules/pi-umbra-copy-chat/package.json +1 -1
- package/node_modules/pi-umbra-help/checks/umbra-help.check.ts +10 -1
- package/node_modules/pi-umbra-help/extensions/umbra-help.ts +31 -0
- package/node_modules/pi-umbra-help/package.json +1 -1
- package/node_modules/pi-umbra-inputbar/README.md +1 -1
- package/node_modules/pi-umbra-inputbar/extensions/umbra-inputbar.ts +1 -1
- package/node_modules/pi-umbra-inputbar/package.json +2 -2
- package/node_modules/pi-umbra-shimmer/package.json +1 -1
- package/node_modules/pi-umbra-shimmer/patch.mjs +23 -21
- package/node_modules/pi-umbra-skill-matcher/package.json +1 -1
- package/node_modules/pi-umbra-skill-matcher/patch.mjs +7 -0
- package/node_modules/pi-umbra-subagents/README.md +24 -6
- package/node_modules/pi-umbra-subagents/extensions/umbra-subagents/bar/bar-line.ts +250 -102
- package/node_modules/pi-umbra-subagents/extensions/umbra-subagents/bar.check.ts +133 -66
- package/node_modules/pi-umbra-subagents/extensions/umbra-subagents/bar.ts +59 -27
- package/node_modules/pi-umbra-subagents/extensions/umbra-subagents/fan/index.ts +53 -8
- package/node_modules/pi-umbra-subagents/extensions/umbra-subagents/fan/spec.ts +24 -14
- package/node_modules/pi-umbra-subagents/extensions/umbra-subagents/fan/store.check.ts +132 -5
- package/node_modules/pi-umbra-subagents/extensions/umbra-subagents/fan/store.ts +156 -64
- package/node_modules/pi-umbra-subagents/extensions/umbra-subagents/fan/worktree.ts +156 -0
- package/node_modules/pi-umbra-subagents/extensions/umbra-subagents/panel.ts +1 -1
- package/node_modules/pi-umbra-subagents/extensions/umbra-subagents/skills/delegate/state.ts +19 -0
- package/node_modules/pi-umbra-subagents/extensions/umbra-subagents/skills/fan/SKILL.md +25 -4
- package/node_modules/pi-umbra-subagents/package.json +2 -2
- package/node_modules/pi-umbra-theme/checks/umbra-background.check.ts +7 -1
- package/node_modules/pi-umbra-theme/extensions/umbra-background.ts +2 -1
- package/node_modules/pi-umbra-theme/package.json +3 -3
- package/node_modules/shiki/dist/bundle-full.d.mts +4 -4
- package/node_modules/shiki/dist/bundle-web.d.mts +9 -9
- package/node_modules/shiki/dist/types.d.mts +3 -3
- package/node_modules/shiki/package.json +10 -10
- package/package.json +9 -12
- package/node_modules/@shikijs/engine-javascript/dist/scanner-DX8LRFGE.mjs +0 -77
- package/node_modules/pi-umbra-rename/LICENSE +0 -21
- package/node_modules/pi-umbra-rename/README.md +0 -18
- package/node_modules/pi-umbra-rename/checks/umbra-rename.check.ts +0 -55
- package/node_modules/pi-umbra-rename/extensions/umbra-rename.ts +0 -22
- package/node_modules/pi-umbra-rename/package.json +0 -36
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
import { Element, Root } from "hast";
|
|
2
2
|
import { FontStyle, IGrammar, IRawGrammar as RawGrammar, IRawTheme as RawTheme, IRawThemeSetting, IRawThemeSetting as RawThemeSetting, OnigScanner, OnigString, StateStack } from "@shikijs/vscode-textmate";
|
|
3
3
|
//#region src/utils.d.ts
|
|
4
|
-
type Awaitable<T> = T | Promise<T>;
|
|
5
|
-
type MaybeGetter<T> = Awaitable<MaybeModule<T>> | (() => Awaitable<MaybeModule<T>>);
|
|
6
|
-
type MaybeModule<T> = T | {
|
|
4
|
+
export type Awaitable<T> = T | Promise<T>;
|
|
5
|
+
export type MaybeGetter<T> = Awaitable<MaybeModule<T>> | (() => Awaitable<MaybeModule<T>>);
|
|
6
|
+
export type MaybeModule<T> = T | {
|
|
7
7
|
default: T;
|
|
8
8
|
};
|
|
9
|
-
type MaybeArray<T> = T | T[];
|
|
10
|
-
type RequireKeys<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
9
|
+
export type MaybeArray<T> = T | T[];
|
|
10
|
+
export type RequireKeys<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
11
11
|
interface Nothing {}
|
|
12
12
|
/**
|
|
13
13
|
* type StringLiteralUnion<'foo'> = 'foo' | string
|
|
14
14
|
* This has auto completion whereas `'foo' | string` doesn't
|
|
15
15
|
* Adapted from https://github.com/microsoft/TypeScript/issues/29729
|
|
16
16
|
*/
|
|
17
|
-
type StringLiteralUnion<T extends U, U = string> = T | (U & Nothing);
|
|
17
|
+
export type StringLiteralUnion<T extends U, U = string> = T | (U & Nothing);
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/engines.d.ts
|
|
20
|
-
interface PatternScanner extends OnigScanner {}
|
|
21
|
-
interface RegexEngineString extends OnigString {}
|
|
20
|
+
export interface PatternScanner extends OnigScanner {}
|
|
21
|
+
export interface RegexEngineString extends OnigString {}
|
|
22
22
|
/**
|
|
23
23
|
* Engine for RegExp matching and scanning.
|
|
24
24
|
*/
|
|
25
|
-
interface RegexEngine {
|
|
25
|
+
export interface RegexEngine {
|
|
26
26
|
createScanner: (patterns: (string | RegExp)[]) => PatternScanner;
|
|
27
27
|
createString: (s: string) => RegexEngineString;
|
|
28
28
|
}
|
|
29
|
-
interface WebAssemblyInstantiator {
|
|
29
|
+
export interface WebAssemblyInstantiator {
|
|
30
30
|
(importObject: Record<string, Record<string, WebAssembly.ImportValue>> | undefined): Promise<WebAssemblyInstance>;
|
|
31
31
|
}
|
|
32
|
-
type WebAssemblyInstance = WebAssembly.WebAssemblyInstantiatedSource | WebAssembly.Instance | WebAssembly.Instance['exports'];
|
|
33
|
-
type OnigurumaLoadOptions = {
|
|
32
|
+
export type WebAssemblyInstance = WebAssembly.WebAssemblyInstantiatedSource | WebAssembly.Instance | WebAssembly.Instance['exports'];
|
|
33
|
+
export type OnigurumaLoadOptions = {
|
|
34
34
|
instantiator: WebAssemblyInstantiator;
|
|
35
35
|
} | {
|
|
36
36
|
default: WebAssemblyInstantiator;
|
|
37
37
|
} | {
|
|
38
38
|
data: ArrayBufferView | ArrayBuffer | Response;
|
|
39
39
|
};
|
|
40
|
-
type LoadWasmOptionsPlain = OnigurumaLoadOptions | WebAssemblyInstantiator | ArrayBufferView | ArrayBuffer | Response;
|
|
41
|
-
type LoadWasmOptions = Awaitable<LoadWasmOptionsPlain> | (() => Awaitable<LoadWasmOptionsPlain>);
|
|
40
|
+
export type LoadWasmOptionsPlain = OnigurumaLoadOptions | WebAssemblyInstantiator | ArrayBufferView | ArrayBuffer | Response;
|
|
41
|
+
export type LoadWasmOptions = Awaitable<LoadWasmOptionsPlain> | (() => Awaitable<LoadWasmOptionsPlain>);
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/textmate.d.ts
|
|
44
|
-
interface Grammar extends IGrammar {
|
|
44
|
+
export interface Grammar extends IGrammar {
|
|
45
45
|
name: string;
|
|
46
46
|
}
|
|
47
47
|
//#endregion
|
|
48
48
|
//#region src/langs.d.ts
|
|
49
|
-
type PlainTextLanguage = 'text' | 'plaintext' | 'txt' | 'plain';
|
|
50
|
-
type AnsiLanguage = 'ansi';
|
|
51
|
-
type SpecialLanguage = PlainTextLanguage | AnsiLanguage;
|
|
52
|
-
type LanguageInput = MaybeGetter<MaybeArray<LanguageRegistration>>;
|
|
53
|
-
type ResolveBundleKey<T extends string> = [T] extends [never] ? string : T;
|
|
54
|
-
interface LanguageRegistration extends RawGrammar {
|
|
49
|
+
export type PlainTextLanguage = 'text' | 'plaintext' | 'txt' | 'plain';
|
|
50
|
+
export type AnsiLanguage = 'ansi';
|
|
51
|
+
export type SpecialLanguage = PlainTextLanguage | AnsiLanguage;
|
|
52
|
+
export type LanguageInput = MaybeGetter<MaybeArray<LanguageRegistration>>;
|
|
53
|
+
export type ResolveBundleKey<T extends string> = [T] extends [never] ? string : T;
|
|
54
|
+
export interface LanguageRegistration extends RawGrammar {
|
|
55
55
|
name: string;
|
|
56
56
|
scopeName: string;
|
|
57
57
|
displayName?: string;
|
|
@@ -80,24 +80,24 @@ interface LanguageRegistration extends RawGrammar {
|
|
|
80
80
|
*/
|
|
81
81
|
injectTo?: string[];
|
|
82
82
|
}
|
|
83
|
-
interface BundledLanguageInfo {
|
|
83
|
+
export interface BundledLanguageInfo {
|
|
84
84
|
id: string;
|
|
85
85
|
name: string;
|
|
86
86
|
import: DynamicImportLanguageRegistration;
|
|
87
87
|
aliases?: string[];
|
|
88
88
|
}
|
|
89
|
-
type DynamicImportLanguageRegistration = () => Promise<{
|
|
89
|
+
export type DynamicImportLanguageRegistration = () => Promise<{
|
|
90
90
|
default: LanguageRegistration[];
|
|
91
91
|
}>;
|
|
92
92
|
//#endregion
|
|
93
93
|
//#region src/decorations.d.ts
|
|
94
|
-
interface DecorationOptions {
|
|
94
|
+
export interface DecorationOptions {
|
|
95
95
|
/**
|
|
96
96
|
* Custom decorations to wrap highlighted tokens with.
|
|
97
97
|
*/
|
|
98
98
|
decorations?: DecorationItem[];
|
|
99
99
|
}
|
|
100
|
-
interface DecorationItem {
|
|
100
|
+
export interface DecorationItem {
|
|
101
101
|
/**
|
|
102
102
|
* Start offset or position of the decoration.
|
|
103
103
|
*/
|
|
@@ -128,27 +128,27 @@ interface DecorationItem {
|
|
|
128
128
|
*/
|
|
129
129
|
alwaysWrap?: boolean;
|
|
130
130
|
}
|
|
131
|
-
interface ResolvedDecorationItem extends Omit<DecorationItem, 'start' | 'end'> {
|
|
131
|
+
export interface ResolvedDecorationItem extends Omit<DecorationItem, 'start' | 'end'> {
|
|
132
132
|
start: ResolvedPosition;
|
|
133
133
|
end: ResolvedPosition;
|
|
134
134
|
}
|
|
135
|
-
type DecorationTransformType = 'wrapper' | 'line' | 'token';
|
|
136
|
-
interface Position {
|
|
135
|
+
export type DecorationTransformType = 'wrapper' | 'line' | 'token';
|
|
136
|
+
export interface Position {
|
|
137
137
|
line: number;
|
|
138
138
|
character: number;
|
|
139
139
|
}
|
|
140
|
-
type Offset = number;
|
|
141
|
-
type OffsetOrPosition = Position | Offset;
|
|
142
|
-
interface ResolvedPosition extends Position {
|
|
140
|
+
export type Offset = number;
|
|
141
|
+
export type OffsetOrPosition = Position | Offset;
|
|
142
|
+
export interface ResolvedPosition extends Position {
|
|
143
143
|
offset: Offset;
|
|
144
144
|
}
|
|
145
145
|
//#endregion
|
|
146
146
|
//#region src/themes.d.ts
|
|
147
|
-
type SpecialTheme = 'none';
|
|
148
|
-
type ThemeInput = MaybeGetter<ThemeRegistrationAny>;
|
|
149
|
-
interface ThemeRegistrationRaw extends RawTheme, Partial<Omit<ThemeRegistration, 'name' | 'settings'>> {}
|
|
150
|
-
interface ThemeRegistration extends Partial<ThemeRegistrationResolved> {}
|
|
151
|
-
interface ThemeRegistrationResolved extends RawTheme {
|
|
147
|
+
export type SpecialTheme = 'none';
|
|
148
|
+
export type ThemeInput = MaybeGetter<ThemeRegistrationAny>;
|
|
149
|
+
export interface ThemeRegistrationRaw extends RawTheme, Partial<Omit<ThemeRegistration, 'name' | 'settings'>> {}
|
|
150
|
+
export interface ThemeRegistration extends Partial<ThemeRegistrationResolved> {}
|
|
151
|
+
export interface ThemeRegistrationResolved extends RawTheme {
|
|
152
152
|
/**
|
|
153
153
|
* Theme name
|
|
154
154
|
*/
|
|
@@ -218,11 +218,11 @@ interface ThemeRegistrationResolved extends RawTheme {
|
|
|
218
218
|
*/
|
|
219
219
|
semanticTokenColors?: Record<string, string>;
|
|
220
220
|
}
|
|
221
|
-
type ThemeRegistrationAny = ThemeRegistrationRaw | ThemeRegistration | ThemeRegistrationResolved;
|
|
222
|
-
type DynamicImportThemeRegistration = () => Promise<{
|
|
221
|
+
export type ThemeRegistrationAny = ThemeRegistrationRaw | ThemeRegistration | ThemeRegistrationResolved;
|
|
222
|
+
export type DynamicImportThemeRegistration = () => Promise<{
|
|
223
223
|
default: ThemeRegistration;
|
|
224
224
|
}>;
|
|
225
|
-
interface BundledThemeInfo {
|
|
225
|
+
export interface BundledThemeInfo {
|
|
226
226
|
id: string;
|
|
227
227
|
displayName: string;
|
|
228
228
|
type: 'light' | 'dark';
|
|
@@ -235,7 +235,7 @@ interface BundledThemeInfo {
|
|
|
235
235
|
*
|
|
236
236
|
* It's used to highlight code snippets that are part of the target language.
|
|
237
237
|
*/
|
|
238
|
-
interface GrammarState {
|
|
238
|
+
export interface GrammarState {
|
|
239
239
|
readonly lang: string;
|
|
240
240
|
readonly theme: string;
|
|
241
241
|
readonly themes: string[];
|
|
@@ -245,12 +245,12 @@ interface GrammarState {
|
|
|
245
245
|
getInternalStack: (theme?: string) => StateStack | undefined;
|
|
246
246
|
getScopes: (theme?: string) => string[] | undefined;
|
|
247
247
|
}
|
|
248
|
-
interface CodeToTokensBaseOptions<Languages extends string = string, Themes extends string = string> extends TokenizeWithThemeOptions {
|
|
248
|
+
export interface CodeToTokensBaseOptions<Languages extends string = string, Themes extends string = string> extends TokenizeWithThemeOptions {
|
|
249
249
|
lang?: Languages | SpecialLanguage;
|
|
250
250
|
theme?: Themes | ThemeRegistrationAny | SpecialTheme;
|
|
251
251
|
}
|
|
252
|
-
type CodeToTokensOptions<Languages extends string = string, Themes extends string = string> = Omit<CodeToTokensBaseOptions<Languages, Themes>, 'theme'> & CodeOptionsThemes<Themes>;
|
|
253
|
-
interface CodeToTokensWithThemesOptions<Languages = string, Themes = string> extends TokenizeWithThemeOptions {
|
|
252
|
+
export type CodeToTokensOptions<Languages extends string = string, Themes extends string = string> = Omit<CodeToTokensBaseOptions<Languages, Themes>, 'theme'> & CodeOptionsThemes<Themes>;
|
|
253
|
+
export interface CodeToTokensWithThemesOptions<Languages = string, Themes = string> extends TokenizeWithThemeOptions {
|
|
254
254
|
lang?: Languages | SpecialLanguage;
|
|
255
255
|
/**
|
|
256
256
|
* A map of color names to themes.
|
|
@@ -269,11 +269,11 @@ interface CodeToTokensWithThemesOptions<Languages = string, Themes = string> ext
|
|
|
269
269
|
*/
|
|
270
270
|
themes: Partial<Record<string, Themes | ThemeRegistrationAny | SpecialTheme>>;
|
|
271
271
|
}
|
|
272
|
-
interface ThemedTokenScopeExplanation {
|
|
272
|
+
export interface ThemedTokenScopeExplanation {
|
|
273
273
|
scopeName: string;
|
|
274
274
|
themeMatches?: IRawThemeSetting[];
|
|
275
275
|
}
|
|
276
|
-
interface ThemedTokenExplanation {
|
|
276
|
+
export interface ThemedTokenExplanation {
|
|
277
277
|
content: string;
|
|
278
278
|
scopes: ThemedTokenScopeExplanation[];
|
|
279
279
|
}
|
|
@@ -331,8 +331,8 @@ interface ThemedTokenExplanation {
|
|
|
331
331
|
* }
|
|
332
332
|
* ```
|
|
333
333
|
*/
|
|
334
|
-
interface ThemedToken extends TokenStyles, TokenBase {}
|
|
335
|
-
interface TokenBase {
|
|
334
|
+
export interface ThemedToken extends TokenStyles, TokenBase {}
|
|
335
|
+
export interface TokenBase {
|
|
336
336
|
/**
|
|
337
337
|
* The content of the token
|
|
338
338
|
*/
|
|
@@ -357,7 +357,7 @@ interface TokenBase {
|
|
|
357
357
|
*/
|
|
358
358
|
explanation?: ThemedTokenExplanation[];
|
|
359
359
|
}
|
|
360
|
-
interface TokenStyles {
|
|
360
|
+
export interface TokenStyles {
|
|
361
361
|
/**
|
|
362
362
|
* 6 or 8 digit hex code representation of the token's color
|
|
363
363
|
*/
|
|
@@ -381,13 +381,13 @@ interface TokenStyles {
|
|
|
381
381
|
*/
|
|
382
382
|
htmlAttrs?: Record<string, string>;
|
|
383
383
|
}
|
|
384
|
-
interface ThemedTokenWithVariants extends TokenBase {
|
|
384
|
+
export interface ThemedTokenWithVariants extends TokenBase {
|
|
385
385
|
/**
|
|
386
386
|
* An object of color name to token styles
|
|
387
387
|
*/
|
|
388
388
|
variants: Record<string, TokenStyles>;
|
|
389
389
|
}
|
|
390
|
-
interface TokenizeWithThemeOptions {
|
|
390
|
+
export interface TokenizeWithThemeOptions {
|
|
391
391
|
/**
|
|
392
392
|
* Include explanation of why a token is given a color.
|
|
393
393
|
*
|
|
@@ -434,7 +434,7 @@ interface TokenizeWithThemeOptions {
|
|
|
434
434
|
/**
|
|
435
435
|
* Result of `codeToTokens`, an object with 2D array of tokens and meta info like background and foreground color.
|
|
436
436
|
*/
|
|
437
|
-
interface TokensResult {
|
|
437
|
+
export interface TokensResult {
|
|
438
438
|
/**
|
|
439
439
|
* 2D array of tokens, first dimension is lines, second dimension is tokens in a line.
|
|
440
440
|
*/
|
|
@@ -463,29 +463,29 @@ interface TokensResult {
|
|
|
463
463
|
}
|
|
464
464
|
//#endregion
|
|
465
465
|
//#region src/transformers.d.ts
|
|
466
|
-
interface TransformerOptions {
|
|
466
|
+
export interface TransformerOptions {
|
|
467
467
|
/**
|
|
468
468
|
* Transformers for the Shiki pipeline.
|
|
469
469
|
*/
|
|
470
470
|
transformers?: ShikiTransformer[];
|
|
471
471
|
}
|
|
472
|
-
interface ShikiTransformerContextMeta {}
|
|
472
|
+
export interface ShikiTransformerContextMeta {}
|
|
473
473
|
/**
|
|
474
474
|
* Common transformer context for all transformers hooks
|
|
475
475
|
*/
|
|
476
|
-
interface ShikiTransformerContextCommon {
|
|
476
|
+
export interface ShikiTransformerContextCommon {
|
|
477
477
|
meta: ShikiTransformerContextMeta;
|
|
478
478
|
options: CodeToHastOptions;
|
|
479
479
|
codeToHast: (code: string, options: CodeToHastOptions) => Root;
|
|
480
480
|
codeToTokens: (code: string, options: CodeToTokensOptions) => TokensResult;
|
|
481
481
|
}
|
|
482
|
-
interface ShikiTransformerContextSource extends ShikiTransformerContextCommon {
|
|
482
|
+
export interface ShikiTransformerContextSource extends ShikiTransformerContextCommon {
|
|
483
483
|
readonly source: string;
|
|
484
484
|
}
|
|
485
485
|
/**
|
|
486
486
|
* Transformer context for HAST related hooks
|
|
487
487
|
*/
|
|
488
|
-
interface ShikiTransformerContext extends ShikiTransformerContextSource {
|
|
488
|
+
export interface ShikiTransformerContext extends ShikiTransformerContextSource {
|
|
489
489
|
readonly tokens: ThemedToken[][];
|
|
490
490
|
readonly root: Root;
|
|
491
491
|
readonly pre: Element;
|
|
@@ -499,7 +499,7 @@ interface ShikiTransformerContext extends ShikiTransformerContextSource {
|
|
|
499
499
|
*/
|
|
500
500
|
addClassToHast: (hast: Element, className: string | string[]) => Element;
|
|
501
501
|
}
|
|
502
|
-
interface ShikiTransformer {
|
|
502
|
+
export interface ShikiTransformer {
|
|
503
503
|
/**
|
|
504
504
|
* Name of the transformer
|
|
505
505
|
*/
|
|
@@ -555,7 +555,7 @@ interface ShikiTransformer {
|
|
|
555
555
|
}
|
|
556
556
|
//#endregion
|
|
557
557
|
//#region src/options.d.ts
|
|
558
|
-
interface HighlighterCoreOptions<Sync extends boolean = false> {
|
|
558
|
+
export interface HighlighterCoreOptions<Sync extends boolean = false> {
|
|
559
559
|
/**
|
|
560
560
|
* Custom RegExp engine.
|
|
561
561
|
*/
|
|
@@ -579,7 +579,7 @@ interface HighlighterCoreOptions<Sync extends boolean = false> {
|
|
|
579
579
|
*/
|
|
580
580
|
warnings?: boolean;
|
|
581
581
|
}
|
|
582
|
-
interface BundledHighlighterOptions<L extends string, T extends string> extends Pick<HighlighterCoreOptions, 'warnings'> {
|
|
582
|
+
export interface BundledHighlighterOptions<L extends string, T extends string> extends Pick<HighlighterCoreOptions, 'warnings'> {
|
|
583
583
|
/**
|
|
584
584
|
* Custom RegExp engine.
|
|
585
585
|
*/
|
|
@@ -602,10 +602,10 @@ interface BundledHighlighterOptions<L extends string, T extends string> extends
|
|
|
602
602
|
*/
|
|
603
603
|
langAlias?: Record<string, StringLiteralUnion<L>>;
|
|
604
604
|
}
|
|
605
|
-
interface CodeOptionsSingleTheme<Themes extends string = string> {
|
|
605
|
+
export interface CodeOptionsSingleTheme<Themes extends string = string> {
|
|
606
606
|
theme: ThemeRegistrationAny | StringLiteralUnion<Themes>;
|
|
607
607
|
}
|
|
608
|
-
interface CodeOptionsMultipleThemes<Themes extends string = string> {
|
|
608
|
+
export interface CodeOptionsMultipleThemes<Themes extends string = string> {
|
|
609
609
|
/**
|
|
610
610
|
* A map of color names to themes.
|
|
611
611
|
* This allows you to specify multiple themes for the generated code.
|
|
@@ -671,9 +671,9 @@ interface CodeOptionsMultipleThemes<Themes extends string = string> {
|
|
|
671
671
|
*/
|
|
672
672
|
cssVariablePrefix?: string;
|
|
673
673
|
}
|
|
674
|
-
type CodeOptionsThemes<Themes extends string = string> = CodeOptionsSingleTheme<Themes> | CodeOptionsMultipleThemes<Themes>;
|
|
675
|
-
type CodeToHastOptions<Languages extends string = string, Themes extends string = string> = CodeToHastOptionsCommon<Languages> & CodeOptionsThemes<Themes> & CodeOptionsMeta;
|
|
676
|
-
interface CodeToHastOptionsCommon<Languages extends string = string> extends TransformerOptions, DecorationOptions, Pick<TokenizeWithThemeOptions, 'colorReplacements' | 'tokenizeMaxLineLength' | 'tokenizeTimeLimit' | 'grammarState' | 'grammarContextCode' | 'includeExplanation'> {
|
|
674
|
+
export type CodeOptionsThemes<Themes extends string = string> = CodeOptionsSingleTheme<Themes> | CodeOptionsMultipleThemes<Themes>;
|
|
675
|
+
export type CodeToHastOptions<Languages extends string = string, Themes extends string = string> = CodeToHastOptionsCommon<Languages> & CodeOptionsThemes<Themes> & CodeOptionsMeta;
|
|
676
|
+
export interface CodeToHastOptionsCommon<Languages extends string = string> extends TransformerOptions, DecorationOptions, Pick<TokenizeWithThemeOptions, 'colorReplacements' | 'tokenizeMaxLineLength' | 'tokenizeTimeLimit' | 'grammarState' | 'grammarContextCode' | 'includeExplanation'> {
|
|
677
677
|
/**
|
|
678
678
|
* Data to be added to the root `<pre>` element.
|
|
679
679
|
*/
|
|
@@ -723,7 +723,7 @@ interface CodeToHastOptionsCommon<Languages extends string = string> extends Tra
|
|
|
723
723
|
*/
|
|
724
724
|
tabindex?: number | string | false;
|
|
725
725
|
}
|
|
726
|
-
interface CodeOptionsMeta {
|
|
726
|
+
export interface CodeOptionsMeta {
|
|
727
727
|
/**
|
|
728
728
|
* Meta data passed to Shiki, usually used by plugin integrations to pass the code block header.
|
|
729
729
|
*
|
|
@@ -741,21 +741,21 @@ interface CodeOptionsMeta {
|
|
|
741
741
|
[key: string]: any;
|
|
742
742
|
};
|
|
743
743
|
}
|
|
744
|
-
interface CodeToHastRenderOptionsCommon extends TransformerOptions, Omit<TokensResult, 'tokens'> {
|
|
744
|
+
export interface CodeToHastRenderOptionsCommon extends TransformerOptions, Omit<TokensResult, 'tokens'> {
|
|
745
745
|
lang?: string;
|
|
746
746
|
langId?: string;
|
|
747
747
|
}
|
|
748
|
-
type CodeToHastRenderOptions = CodeToHastRenderOptionsCommon & CodeToHastOptions;
|
|
748
|
+
export type CodeToHastRenderOptions = CodeToHastRenderOptionsCommon & CodeToHastOptions;
|
|
749
749
|
//#endregion
|
|
750
750
|
//#region src/highlighter.d.ts
|
|
751
751
|
/**
|
|
752
752
|
* Type of object that can be bound to a grammar state
|
|
753
753
|
*/
|
|
754
|
-
type GrammarStateMapKey = Root | ThemedToken[][];
|
|
754
|
+
export type GrammarStateMapKey = Root | ThemedToken[][];
|
|
755
755
|
/**
|
|
756
756
|
* Internal context of Shiki, core textmate logic
|
|
757
757
|
*/
|
|
758
|
-
interface ShikiPrimitive<BundledLangKeys extends string = never, BundledThemeKeys extends string = never> {
|
|
758
|
+
export interface ShikiPrimitive<BundledLangKeys extends string = never, BundledThemeKeys extends string = never> {
|
|
759
759
|
/**
|
|
760
760
|
* Load a theme to the highlighter, so later it can be used synchronously.
|
|
761
761
|
*/
|
|
@@ -816,7 +816,7 @@ interface ShikiPrimitive<BundledLangKeys extends string = never, BundledThemeKey
|
|
|
816
816
|
/**
|
|
817
817
|
* Generic instance interface of Shiki
|
|
818
818
|
*/
|
|
819
|
-
interface HighlighterGeneric<BundledLangKeys extends string, BundledThemeKeys extends string> extends ShikiPrimitive<BundledLangKeys, BundledThemeKeys> {
|
|
819
|
+
export interface HighlighterGeneric<BundledLangKeys extends string, BundledThemeKeys extends string> extends ShikiPrimitive<BundledLangKeys, BundledThemeKeys> {
|
|
820
820
|
/**
|
|
821
821
|
* Get highlighted code in HTML string
|
|
822
822
|
*/
|
|
@@ -869,11 +869,11 @@ interface HighlighterGeneric<BundledLangKeys extends string, BundledThemeKeys ex
|
|
|
869
869
|
/**
|
|
870
870
|
* The fine-grained core Shiki highlighter instance.
|
|
871
871
|
*/
|
|
872
|
-
type HighlighterCore = HighlighterGeneric<never, never>;
|
|
872
|
+
export type HighlighterCore = HighlighterGeneric<never, never>;
|
|
873
873
|
/**
|
|
874
874
|
* Options for creating a bundled highlighter.
|
|
875
875
|
*/
|
|
876
|
-
interface CreateBundledHighlighterOptions<BundledLangs extends string, BundledThemes extends string> {
|
|
876
|
+
export interface CreateBundledHighlighterOptions<BundledLangs extends string, BundledThemes extends string> {
|
|
877
877
|
langs: Record<BundledLangs, LanguageInput>;
|
|
878
878
|
themes: Record<BundledThemes, ThemeInput>;
|
|
879
879
|
engine: () => Awaitable<RegexEngine>;
|
|
@@ -881,14 +881,14 @@ interface CreateBundledHighlighterOptions<BundledLangs extends string, BundledTh
|
|
|
881
881
|
/**
|
|
882
882
|
* @deprecated Use `CreateBundledHighlighterOptions` instead.
|
|
883
883
|
*/
|
|
884
|
-
interface CreatedBundledHighlighterOptions<BundledLangs extends string, BundledThemes extends string> extends CreateBundledHighlighterOptions<BundledLangs, BundledThemes> {}
|
|
884
|
+
export interface CreatedBundledHighlighterOptions<BundledLangs extends string, BundledThemes extends string> extends CreateBundledHighlighterOptions<BundledLangs, BundledThemes> {}
|
|
885
885
|
//#endregion
|
|
886
886
|
//#region src/bundle-factory.d.ts
|
|
887
|
-
type CreateHighlighterFactory<L extends string, T extends string> = (options: BundledHighlighterOptions<L, T>) => Promise<HighlighterGeneric<L, T>>;
|
|
887
|
+
export type CreateHighlighterFactory<L extends string, T extends string> = (options: BundledHighlighterOptions<L, T>) => Promise<HighlighterGeneric<L, T>>;
|
|
888
888
|
//#endregion
|
|
889
889
|
//#region src/error.d.ts
|
|
890
|
-
declare class ShikiError extends Error {
|
|
890
|
+
export declare class ShikiError extends Error {
|
|
891
891
|
constructor(message: string);
|
|
892
892
|
}
|
|
893
893
|
//#endregion
|
|
894
|
-
export {
|
|
894
|
+
export type { RawGrammar, RawTheme, RawThemeSetting };
|
|
@@ -47,12 +47,9 @@ When it is done, pi shows the size, for example `42 KB on the clipboard.`
|
|
|
47
47
|
|
|
48
48
|
## Clipboard
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
| Windows | `clip` |
|
|
55
|
-
|
|
56
|
-
On Wayland, change the `linux` entry of the `COPY` table in the extension to `["wl-copy"]`.
|
|
50
|
+
The text goes through pi's own clipboard writer, the one `/copy` uses: `wl-copy`, `xclip` or
|
|
51
|
+
`xsel` on Linux, the native clipboard on macOS and Windows, and OSC 52 over SSH. When none
|
|
52
|
+
works, pi says which program to install. pi caps OSC 52 at about 73 KB of text, so over SSH a long
|
|
53
|
+
session may be too big to copy.
|
|
57
54
|
|
|
58
55
|
MIT.
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { readFileSync } from "node:fs";
|
|
3
|
-
import { platform } from "node:os";
|
|
4
|
-
import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
1
|
+
import { copyToClipboard, type ExtensionAPI, type ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
5
2
|
|
|
6
3
|
// /umb-copy-chat puts this session on the clipboard as markdown, in full, and does nothing else.
|
|
7
4
|
// No file is written, no model turn is spent, nothing is uploaded.
|
|
@@ -26,30 +23,9 @@ const PREAMBLE = `> Kaydedilmiş bir pi oturumu, bağlam olarak yapıştırıld
|
|
|
26
23
|
> da terk edilmiş olabilir), \`## call\` / \`## result\` gerçekten çalışmış araç
|
|
27
24
|
> çağrıları. Oku, sonra asıl isteği bekle.`;
|
|
28
25
|
|
|
29
|
-
// One copy command per platform. On Linux this is the X11 one; swap it for
|
|
30
|
-
// ["wl-copy"] on a Wayland session.
|
|
31
|
-
const COPY: Record<string, string[]> = {
|
|
32
|
-
win32: ["clip"],
|
|
33
|
-
darwin: ["pbcopy"],
|
|
34
|
-
linux: ["xclip", "-selection", "clipboard"],
|
|
35
|
-
};
|
|
36
|
-
|
|
37
26
|
type Block = { type: string; text?: string; thinking?: string; name?: string; arguments?: unknown };
|
|
38
27
|
type Message = { role: string; content: unknown; toolName?: string; isError?: boolean };
|
|
39
|
-
type Entry = {
|
|
40
|
-
|
|
41
|
-
/** The turns still on the board. */
|
|
42
|
-
// A rewind (pi's /fork) does not delete anything: it writes the new turn with its parentId
|
|
43
|
-
// pointing at an older message, and the turns it walked back over stay in the file. Reading
|
|
44
|
-
// the lines in order would hand the reader both the abandoned attempt and the one that
|
|
45
|
-
// replaced it, with nothing marking which is which. Walking parentId back from the last
|
|
46
|
-
// entry is what the runtime itself is showing on screen.
|
|
47
|
-
export const activeBranch = (rows: Entry[]): Entry[] => {
|
|
48
|
-
const byId = new Map(rows.map((row) => [row.id, row]));
|
|
49
|
-
const chain: Entry[] = [];
|
|
50
|
-
for (let row = rows[rows.length - 1]; row !== undefined; row = byId.get(row.parentId ?? "")) chain.unshift(row);
|
|
51
|
-
return chain;
|
|
52
|
-
};
|
|
28
|
+
type Entry = { type?: string; timestamp?: string; message?: Message };
|
|
53
29
|
|
|
54
30
|
/** `2026-09-07 00:31` the first time and on each new day, `00:31` in between. */
|
|
55
31
|
export const stamp = (iso: string, lastDay: string | undefined): [string, string] => {
|
|
@@ -81,15 +57,13 @@ const textOf = (content: unknown): string =>
|
|
|
81
57
|
.join("")
|
|
82
58
|
.trim();
|
|
83
59
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
.map((line) => JSON.parse(line) as Entry);
|
|
89
|
-
|
|
60
|
+
/** The branch on screen, as pi hands it over: root to leaf, the turns a rewind or a /tree walked
|
|
61
|
+
* back over already left out. Taken from pi rather than from the session file, because only pi
|
|
62
|
+
* knows the leaf after a /tree with no new message yet. */
|
|
63
|
+
export const transcribe = (branch: Entry[]): string => {
|
|
90
64
|
const out: string[] = [];
|
|
91
65
|
let day: string | undefined;
|
|
92
|
-
for (const row of
|
|
66
|
+
for (const row of branch) {
|
|
93
67
|
// session, model_change, thinking_level_change, custom_message and session_info.
|
|
94
68
|
if (row.type !== "message" || row.message === undefined) continue;
|
|
95
69
|
const { role, content, toolName, isError } = row.message;
|
|
@@ -121,34 +95,22 @@ export const transcribe = (jsonl: string): string => {
|
|
|
121
95
|
return out.join("\n");
|
|
122
96
|
};
|
|
123
97
|
|
|
124
|
-
const copy = (text: string) =>
|
|
125
|
-
new Promise<boolean>((resolve) => {
|
|
126
|
-
const argv = COPY[platform()];
|
|
127
|
-
if (!argv) return resolve(false);
|
|
128
|
-
const child = spawn(argv[0] as string, argv.slice(1));
|
|
129
|
-
// A missing binary arrives as an "error" event, not a throw, so both paths resolve.
|
|
130
|
-
child.on("error", () => resolve(false));
|
|
131
|
-
child.on("close", (code) => resolve(code === 0));
|
|
132
|
-
child.stdin.end(text);
|
|
133
|
-
});
|
|
134
|
-
|
|
135
98
|
export default function (pi: ExtensionAPI) {
|
|
136
99
|
pi.registerCommand("umb-copy-chat", {
|
|
137
100
|
description: "Copy this whole session to the clipboard as markdown",
|
|
138
101
|
handler: async (_args: string, ctx: ExtensionCommandContext) => {
|
|
139
|
-
const
|
|
140
|
-
if (!sessionFile) return ctx.ui.notify("No session file yet - send one message first.", "warning");
|
|
141
|
-
|
|
142
|
-
const body = transcribe(readFileSync(sessionFile, "utf8"));
|
|
102
|
+
const body = transcribe(ctx.sessionManager.getBranch() as Entry[]);
|
|
143
103
|
if (body === "") return ctx.ui.notify("Nothing to copy yet.", "warning");
|
|
144
104
|
|
|
145
105
|
const markdown = `${PREAMBLE}\n\n${body}`;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
106
|
+
// pi's own /copy writer: wl-copy, xclip, xsel, the native clipboard or OSC 52, whichever
|
|
107
|
+
// works here. It throws with the install hint when none does.
|
|
108
|
+
try {
|
|
109
|
+
await copyToClipboard(markdown);
|
|
110
|
+
} catch (error) {
|
|
111
|
+
return ctx.ui.notify(error instanceof Error ? error.message : String(error), "error");
|
|
112
|
+
}
|
|
113
|
+
ctx.ui.notify(`${Math.max(1, Math.round(markdown.length / 1024))} KB on the clipboard.`, "info");
|
|
152
114
|
},
|
|
153
115
|
});
|
|
154
116
|
}
|
|
@@ -6,6 +6,7 @@ import assert from "node:assert";
|
|
|
6
6
|
import { type Facts, PROBES, announcesTruecolor, diagnose, renderDoctor, renderHelp, shadowed } from "../extensions/umbra-help.ts";
|
|
7
7
|
|
|
8
8
|
const clean: Facts = {
|
|
9
|
+
packages: ["pi-umbra", "pi-claude-bridge"],
|
|
9
10
|
patches: Object.fromEntries(PROBES.map((probe) => [probe.id, true])),
|
|
10
11
|
commands: ["umb-shimmer", "umb-bg", "umb-help"],
|
|
11
12
|
skillRoots: [{ root: "/a", names: ["adhd"] }],
|
|
@@ -112,4 +113,12 @@ assert.match(help, /"background": "auto"/, "the live settings, not a description
|
|
|
112
113
|
assert.match(help, /umb-doctor/, "and a pointer to the other half");
|
|
113
114
|
assert.match(renderHelp([], {}, "dark"), /No umb- command is registered/);
|
|
114
115
|
|
|
115
|
-
|
|
116
|
+
// A package umbra dropped still loads without a word from pi, so the doctor names it.
|
|
117
|
+
const stale = diagnose(at({ packages: ["pi-umbra", "pi-umbra-rename"] }));
|
|
118
|
+
assert.equal(stale.length, 1, "a retired package listed in settings is reported");
|
|
119
|
+
assert.match(stale[0]!.title, /pi-umbra-rename is no longer part of umbra/);
|
|
120
|
+
assert.match(stale[0]!.detail, /pi remove npm:pi-umbra-rename/, "with the command that removes it");
|
|
121
|
+
const loose = diagnose(at({ commands: [...clean.commands, "umb-rename"] }));
|
|
122
|
+
assert.match(loose[0]!.detail, /still registered by something/, "a leftover file is found by its command");
|
|
123
|
+
|
|
124
|
+
console.log("umbra-help.check.ts ok - diagnose 14 cases, truecolor 7, shadowed 4, help 6");
|
|
@@ -49,7 +49,15 @@ export const PROBES: Probe[] = [
|
|
|
49
49
|
},
|
|
50
50
|
];
|
|
51
51
|
|
|
52
|
+
// Packages that were umbra once and are not any more, with what replaced them. An install that
|
|
53
|
+
// still carries one runs code nobody maintains, and pi never says so: the package loads fine.
|
|
54
|
+
export const RETIRED: { name: string; command: string; why: string }[] = [
|
|
55
|
+
{ name: "pi-umbra-rename", command: "umb-rename", why: "pi's own /name sets the session name and the terminal title since pi 1.0" },
|
|
56
|
+
];
|
|
57
|
+
|
|
52
58
|
export type Facts = {
|
|
59
|
+
/** The npm packages listed in the global and the project settings, without the `npm:` prefix. */
|
|
60
|
+
packages: string[];
|
|
53
61
|
/** Probe id to whether its marker is in place. */
|
|
54
62
|
patches: Record<string, boolean>;
|
|
55
63
|
/** The umb- commands this session actually registered. */
|
|
@@ -86,6 +94,18 @@ export const shadowed = (roots: Facts["skillRoots"]): { name: string; winner: st
|
|
|
86
94
|
export const diagnose = (facts: Facts): Finding[] => {
|
|
87
95
|
const findings: Finding[] = [];
|
|
88
96
|
|
|
97
|
+
for (const retired of RETIRED) {
|
|
98
|
+
const listed = facts.packages.includes(retired.name);
|
|
99
|
+
if (!listed && !facts.commands.includes(retired.command)) continue;
|
|
100
|
+
findings.push({
|
|
101
|
+
level: "warn",
|
|
102
|
+
title: `${retired.name} is no longer part of umbra`,
|
|
103
|
+
detail: listed
|
|
104
|
+
? `${retired.why}. Remove it: pi remove npm:${retired.name}`
|
|
105
|
+
: `${retired.why}, but /${retired.command} is still registered by something. Delete the file that adds it.`,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
89
109
|
for (const probe of PROBES) {
|
|
90
110
|
if (facts.patches[probe.id] !== false) continue;
|
|
91
111
|
// A patch nothing depends on is not a fault. Only say so when the feature is installed.
|
|
@@ -210,9 +230,20 @@ export const gather = (cwd: string, theme: string, commands: Command[]): Facts =
|
|
|
210
230
|
for (const probe of PROBES) patches[probe.id] = has(chunks, probe.marker);
|
|
211
231
|
}
|
|
212
232
|
|
|
233
|
+
// Settings list a package as "npm:name", "npm:name@1.2" or { source: "npm:name" }.
|
|
234
|
+
const packages = [join(AGENT, "settings.json"), join(cwd, ".pi", "settings.json")].flatMap((file) => {
|
|
235
|
+
try {
|
|
236
|
+
const list = (JSON.parse(readFileSync(file, "utf8")).packages ?? []) as (string | { source?: string })[];
|
|
237
|
+
return list.map((entry) => (typeof entry === "string" ? entry : (entry.source ?? "")));
|
|
238
|
+
} catch {
|
|
239
|
+
return [];
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
|
|
213
243
|
// The order pi resolves them in, which is the order that decides a collision.
|
|
214
244
|
const roots = [join(AGENT, "skills"), join(cwd, ".pi", "skills"), join(homedir(), ".agents", "skills")];
|
|
215
245
|
return {
|
|
246
|
+
packages: packages.filter((source) => source.startsWith("npm:")).map((source) => source.slice(4).replace(/(.)@.*$/, "$1")),
|
|
216
247
|
patches,
|
|
217
248
|
commands: commands.map((command) => command.name),
|
|
218
249
|
skillRoots: roots.map((root) => ({ root, names: namesIn(root) })).filter((entry) => entry.names.length > 0),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-umbra-help",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Two commands over the pi-umbra family: /umb-help lists what is installed and how to configure it, /umb-doctor reports the faults that would otherwise stay silent.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -33,7 +33,7 @@ The colour is kept in `~/.pi/agent/input-color` and applies to every session.
|
|
|
33
33
|
|
|
34
34
|
## Session name
|
|
35
35
|
|
|
36
|
-
The name set with `/name`
|
|
36
|
+
The name set with `/name` sits at the right end of the top border and shows
|
|
37
37
|
on the next repaint. When the border has no room for it, it is left out.
|
|
38
38
|
|
|
39
39
|
## For extension authors
|