@quandev104/pi-style 0.1.2 → 0.1.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.
- package/CHANGELOG.md +21 -0
- package/README.md +1 -2
- package/dist/extensions/pi-style.js +5919 -4966
- package/dist/extensions/pi-style.js.map +1 -1
- package/extension-src/pi-style/app/command-service.ts +2 -2
- package/extension-src/pi-style/app/index.ts +0 -1
- package/extension-src/pi-style/domain/config-authorization.ts +1 -2
- package/extension-src/pi-style/domain/config-normalization.ts +3 -3
- package/extension-src/pi-style/domain/config-types.ts +2 -2
- package/extension-src/pi-style/domain/status.ts +1 -1
- package/extension-src/pi-style/domain/theme.ts +3 -0
- package/extension-src/pi-style/features/messages/index.ts +2 -8
- package/extension-src/pi-style/features/tools/boxed/bash.ts +663 -45
- package/extension-src/pi-style/features/tools/boxed/batch.ts +459 -0
- package/extension-src/pi-style/features/tools/boxed/edit.ts +28 -2
- package/extension-src/pi-style/features/tools/boxed/fallback.ts +47 -4
- package/extension-src/pi-style/features/tools/boxed/find.ts +48 -48
- package/extension-src/pi-style/features/tools/boxed/grep.ts +161 -89
- package/extension-src/pi-style/features/tools/boxed/index.ts +4 -0
- package/extension-src/pi-style/features/tools/boxed/ls.ts +39 -47
- package/extension-src/pi-style/features/tools/boxed/output-tree.ts +368 -0
- package/extension-src/pi-style/features/tools/boxed/quick-edit.ts +25 -4
- package/extension-src/pi-style/features/tools/boxed/read.ts +32 -189
- package/extension-src/pi-style/features/tools/boxed/session-config.ts +70 -4
- package/extension-src/pi-style/features/tools/boxed/shared.ts +41 -1
- package/extension-src/pi-style/features/tools/boxed/write.ts +105 -47
- package/extension-src/pi-style/features/tools/index.ts +14 -0
- package/extension-src/pi-style/pi/compatibility-coordinator.ts +4 -26
- package/extension-src/pi-style/pi/compatibility-probe.ts +3 -33
- package/extension-src/pi-style/pi/compatibility-registry.ts +0 -1
- package/extension-src/pi-style/pi/config-session.ts +0 -2
- package/extension-src/pi-style/pi/index.ts +35 -1
- package/extension-src/pi-style/pi/session-coordinator.ts +47 -3
- package/extension-src/pi-style/shared/box.ts +117 -26
- package/extension-src/pi-style/shared/theme-extras.ts +0 -2
- package/package.json +1 -1
|
@@ -45,9 +45,9 @@ const allowedPaths = new Set([
|
|
|
45
45
|
"editor.frame",
|
|
46
46
|
"editor.showMetadata",
|
|
47
47
|
"messages.enabled",
|
|
48
|
-
"messages.userPrefix",
|
|
49
48
|
"messages.assistantPrefix",
|
|
50
49
|
"messages.specialBlocks",
|
|
50
|
+
"messages.hideThinkingLabel",
|
|
51
51
|
"tools.enabled",
|
|
52
52
|
"tools.style",
|
|
53
53
|
"tools.maxCollapsedLines",
|
|
@@ -74,9 +74,9 @@ function validatePathValue(path: string, value: unknown): boolean {
|
|
|
74
74
|
"editor.enabled",
|
|
75
75
|
"editor.showMetadata",
|
|
76
76
|
"messages.enabled",
|
|
77
|
-
"messages.userPrefix",
|
|
78
77
|
"messages.assistantPrefix",
|
|
79
78
|
"messages.specialBlocks",
|
|
79
|
+
"messages.hideThinkingLabel",
|
|
80
80
|
"tools.enabled",
|
|
81
81
|
"tools.showElapsed",
|
|
82
82
|
"tools.dimOutput",
|
|
@@ -311,7 +311,6 @@ export function createPiStyleApp(
|
|
|
311
311
|
status: operational.installations?.status ?? "unknown",
|
|
312
312
|
editor: operational.installations?.editor ?? "unknown",
|
|
313
313
|
startup: operational.installations?.startup ?? "unknown",
|
|
314
|
-
userMessage: operational.compatibility?.userMessage ?? "unknown",
|
|
315
314
|
assistantMessage: operational.compatibility?.assistantMessage ?? "unknown",
|
|
316
315
|
specialBlocks: operational.compatibility?.specialBlocks ?? "unknown",
|
|
317
316
|
tools: operational.compatibility?.tools ?? "unknown",
|
|
@@ -4,7 +4,7 @@ export interface TierCAuthorizationInput {
|
|
|
4
4
|
readonly certifiedHost: boolean;
|
|
5
5
|
readonly coreFlag: boolean;
|
|
6
6
|
readonly surfaceFlag: boolean;
|
|
7
|
-
readonly surface: "messages" | "tools" | "
|
|
7
|
+
readonly surface: "messages" | "tools" | "assistantMessage" | "specialBlocks";
|
|
8
8
|
readonly config: NormalizedPiStyleConfig;
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -12,7 +12,6 @@ export interface TierCAuthorizationInput {
|
|
|
12
12
|
export function isTierCAuthorized(input: TierCAuthorizationInput): boolean {
|
|
13
13
|
if (!input.certifiedHost || !input.coreFlag || !input.surfaceFlag || !input.config.enabled) return false;
|
|
14
14
|
if (input.surface === "tools") return input.config.tools.enabled;
|
|
15
|
-
if (input.surface === "userMessage") return input.config.messages.enabled && input.config.messages.userPrefix;
|
|
16
15
|
if (input.surface === "assistantMessage")
|
|
17
16
|
return input.config.messages.enabled && input.config.messages.assistantPrefix;
|
|
18
17
|
if (input.surface === "specialBlocks") return input.config.messages.enabled && input.config.messages.specialBlocks;
|
|
@@ -28,7 +28,7 @@ export const DEFAULT_CONFIG: NormalizedPiStyleConfig = Object.freeze({
|
|
|
28
28
|
contextBarWidth: 10,
|
|
29
29
|
}),
|
|
30
30
|
editor: Object.freeze({ enabled: true, style: "compact", frame: "auto", showMetadata: false }),
|
|
31
|
-
messages: Object.freeze({ enabled: true,
|
|
31
|
+
messages: Object.freeze({ enabled: true, assistantPrefix: true, specialBlocks: true, hideThinkingLabel: true }),
|
|
32
32
|
tools: Object.freeze({
|
|
33
33
|
enabled: true,
|
|
34
34
|
style: "compact-box",
|
|
@@ -159,9 +159,9 @@ export function normalizeConfig(
|
|
|
159
159
|
}),
|
|
160
160
|
messages: Object.freeze({
|
|
161
161
|
enabled: bool(messages.enabled, defaults.messages.enabled),
|
|
162
|
-
userPrefix: bool(messages.userPrefix, defaults.messages.userPrefix),
|
|
163
162
|
assistantPrefix: bool(messages.assistantPrefix, defaults.messages.assistantPrefix),
|
|
164
163
|
specialBlocks: bool(messages.specialBlocks, defaults.messages.specialBlocks),
|
|
164
|
+
hideThinkingLabel: bool(messages.hideThinkingLabel, defaults.messages.hideThinkingLabel),
|
|
165
165
|
}),
|
|
166
166
|
tools: Object.freeze({
|
|
167
167
|
enabled: bool(tools.enabled, defaults.tools.enabled),
|
|
@@ -213,9 +213,9 @@ const BOOL_PATHS = new Set([
|
|
|
213
213
|
"editor.enabled",
|
|
214
214
|
"editor.showMetadata",
|
|
215
215
|
"messages.enabled",
|
|
216
|
-
"messages.userPrefix",
|
|
217
216
|
"messages.assistantPrefix",
|
|
218
217
|
"messages.specialBlocks",
|
|
218
|
+
"messages.hideThinkingLabel",
|
|
219
219
|
"tools.enabled",
|
|
220
220
|
"tools.showElapsed",
|
|
221
221
|
"tools.dimOutput",
|
|
@@ -32,7 +32,7 @@ export interface PiStyleConfig {
|
|
|
32
32
|
contextBarWidth?: number;
|
|
33
33
|
};
|
|
34
34
|
editor?: { enabled?: boolean; style?: string; frame?: string; showMetadata?: boolean };
|
|
35
|
-
messages?: { enabled?: boolean;
|
|
35
|
+
messages?: { enabled?: boolean; assistantPrefix?: boolean; specialBlocks?: boolean; hideThinkingLabel?: boolean };
|
|
36
36
|
tools?: {
|
|
37
37
|
enabled?: boolean;
|
|
38
38
|
style?: string;
|
|
@@ -79,7 +79,7 @@ export interface NormalizedPiStyleConfig {
|
|
|
79
79
|
contextBarWidth: number;
|
|
80
80
|
};
|
|
81
81
|
readonly editor: { enabled: boolean; style: EditorStyle; frame: EditorFrame; showMetadata: boolean };
|
|
82
|
-
readonly messages: { enabled: boolean;
|
|
82
|
+
readonly messages: { enabled: boolean; assistantPrefix: boolean; specialBlocks: boolean; hideThinkingLabel: boolean };
|
|
83
83
|
readonly tools: {
|
|
84
84
|
enabled: boolean;
|
|
85
85
|
style: string;
|
|
@@ -254,7 +254,7 @@ export function createBuiltinSegments(): ReadonlyMap<StatusSegmentId, StatusSegm
|
|
|
254
254
|
const token = contextBarToken(percent);
|
|
255
255
|
const window = snapshot.context?.windowTokens;
|
|
256
256
|
const label = `ctx${window !== undefined ? ` (${formatTokens(window)})` : ""}:`;
|
|
257
|
-
const width = (options
|
|
257
|
+
const width = (options.context_bar?.width as number | undefined) ?? CONTEXT_BAR_WIDTH;
|
|
258
258
|
return {
|
|
259
259
|
visible: true,
|
|
260
260
|
content: `${theme.apply("muted", label)} ${theme.apply(token, contextBar(percent, width))} ${theme.apply(token, `${Math.round(percent)}%`)}`,
|
|
@@ -107,6 +107,7 @@ const GLYPHS = {
|
|
|
107
107
|
powerlineRight: "\uE0B2",
|
|
108
108
|
powerlineThinLeft: "\uE0B1",
|
|
109
109
|
powerlineThinRight: "\uE0B3",
|
|
110
|
+
batchOpen: "\u{F111}",
|
|
110
111
|
},
|
|
111
112
|
unicode: {
|
|
112
113
|
pi: "π",
|
|
@@ -118,6 +119,7 @@ const GLYPHS = {
|
|
|
118
119
|
powerlineRight: "‹",
|
|
119
120
|
powerlineThinLeft: "│",
|
|
120
121
|
powerlineThinRight: "│",
|
|
122
|
+
batchOpen: "●",
|
|
121
123
|
},
|
|
122
124
|
ascii: {
|
|
123
125
|
pi: "pi",
|
|
@@ -129,6 +131,7 @@ const GLYPHS = {
|
|
|
129
131
|
powerlineRight: "<",
|
|
130
132
|
powerlineThinLeft: "|",
|
|
131
133
|
powerlineThinRight: "|",
|
|
134
|
+
batchOpen: "v",
|
|
132
135
|
},
|
|
133
136
|
} as const;
|
|
134
137
|
|
|
@@ -174,29 +174,23 @@ function prefixNative(lines: unknown, width: number, prefix: string): string[] |
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
export type MessageDecorationSnapshot = Readonly<{
|
|
177
|
-
userPrefix: string;
|
|
178
177
|
assistantPrefix: string;
|
|
179
|
-
userEnabled: boolean;
|
|
180
178
|
assistantEnabled: boolean;
|
|
181
179
|
}>;
|
|
182
180
|
|
|
183
181
|
export function decorateMessageRender(
|
|
184
|
-
subtype: "native-user-message" | "native-assistant-message",
|
|
185
182
|
original: unknown,
|
|
186
183
|
instance: object,
|
|
187
184
|
args: unknown[],
|
|
188
185
|
snapshot: MessageDecorationSnapshot = {
|
|
189
|
-
userPrefix: "❯ ",
|
|
190
186
|
assistantPrefix: "│ ",
|
|
191
|
-
userEnabled: true,
|
|
192
187
|
assistantEnabled: true,
|
|
193
188
|
},
|
|
194
189
|
): unknown {
|
|
195
190
|
if (typeof original !== "function") return undefined;
|
|
196
191
|
const width = typeof args[0] === "number" ? args[0] : 0;
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
if (!enabled) return Reflect.apply(original, instance, args);
|
|
192
|
+
const prefix = snapshot.assistantPrefix;
|
|
193
|
+
if (!snapshot.assistantEnabled) return Reflect.apply(original, instance, args);
|
|
200
194
|
if (width <= visibleWidth(prefix)) return Reflect.apply(original, instance, args);
|
|
201
195
|
// Exactly one native invocation. If the reduced render cannot be certified, the
|
|
202
196
|
// already-obtained result is the only safe fallback; retrying can mutate state.
|