@0xkahi/pi-qol 1.0.4 → 1.0.6
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 +35 -5
- package/assets/config.schema.json +18 -3
- package/package.json +6 -5
- package/src/constants.ts +1 -0
- package/src/extensions/context-view/capture.ts +34 -5
- package/src/extensions/context-view/context-view-controller.ts +37 -14
- package/src/extensions/context-view/index.ts +13 -6
- package/src/extensions/context-view/measure.ts +100 -27
- package/src/extensions/context-view/model.ts +13 -0
- package/src/extensions/context-view/ui/injections-view.ts +11 -11
- package/src/extensions/context-view/ui/section-preview.ts +29 -0
- package/src/extensions/context-view/ui/usage-block-layer.ts +139 -0
- package/src/extensions/context-view/ui/usage-map.ts +3 -1
- package/src/extensions/context-view/ui/usage-preview.ts +148 -0
- package/src/extensions/context-view/ui/usage-view.ts +44 -59
- package/src/extensions/context-view/usage.ts +1 -1
- package/src/extensions/custom-footer/agent-display-state.ts +60 -0
- package/src/extensions/custom-footer/footer-component.ts +22 -0
- package/src/extensions/custom-footer/index.ts +17 -1
- package/src/extensions/custom-footer/types.ts +3 -1
- package/src/schemas/custom-footer-config.schema.ts +11 -0
|
@@ -2,6 +2,7 @@ import type { ExtensionContext } from '@earendil-works/pi-coding-agent';
|
|
|
2
2
|
import type { TUI } from '@earendil-works/pi-tui';
|
|
3
3
|
import type { ConfigLoader } from '../../config-loader';
|
|
4
4
|
import type { Config } from '../../schemas/config.schema';
|
|
5
|
+
import type { AgentDisplayState } from './agent-display-state';
|
|
5
6
|
|
|
6
7
|
export type SupportedProvider = 'anthropic' | 'openai-codex';
|
|
7
8
|
|
|
@@ -11,7 +12,7 @@ export type CustomFooterDisplay = CustomFooterConfig['display'];
|
|
|
11
12
|
export type CustomFooterIcons = CustomFooterConfig['icons'];
|
|
12
13
|
|
|
13
14
|
export type FooterTheme = {
|
|
14
|
-
fg(color: 'dim' | 'error' | 'warning', text: string): string;
|
|
15
|
+
fg(color: 'accent' | 'dim' | 'error' | 'warning', text: string): string;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
export type FooterDataProvider = {
|
|
@@ -27,6 +28,7 @@ export type CustomFooterComponentDeps = {
|
|
|
27
28
|
footerData: FooterDataProvider;
|
|
28
29
|
ctx: ExtensionContext;
|
|
29
30
|
config: ConfigLoader;
|
|
31
|
+
agentDisplayState: AgentDisplayState;
|
|
30
32
|
getThinkingLevel: () => string;
|
|
31
33
|
};
|
|
32
34
|
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
import { ColorHexSchema } from './shared-config.schema';
|
|
3
3
|
|
|
4
|
+
const AgentNameSchema = z
|
|
5
|
+
.string()
|
|
6
|
+
.refine(value => value.trim().length > 0, { message: 'Agent name must not be empty' })
|
|
7
|
+
.default('DEFAULT');
|
|
8
|
+
|
|
4
9
|
const CustomFooterColorsSchema = z.object({
|
|
5
10
|
directory: ColorHexSchema.optional(),
|
|
6
11
|
modelName: ColorHexSchema.optional(),
|
|
12
|
+
agentName: ColorHexSchema.optional(),
|
|
7
13
|
anthropicUsage: ColorHexSchema.optional().default('#D97706'),
|
|
8
14
|
codexUsage: ColorHexSchema.optional().default('#10B981'),
|
|
9
15
|
});
|
|
@@ -19,6 +25,7 @@ const CustomFooterIconsSchema = z.object({
|
|
|
19
25
|
const CustomFooterDisplaySchema = z.object({
|
|
20
26
|
tokens: z.boolean().optional().default(true),
|
|
21
27
|
cache: z.boolean().optional().default(true),
|
|
28
|
+
agentName: z.boolean().optional().default(false),
|
|
22
29
|
});
|
|
23
30
|
|
|
24
31
|
const DEFAULT_CUSTOM_FOOTER_COLORS = CustomFooterColorsSchema.parse({});
|
|
@@ -30,6 +37,7 @@ export const CustomFooterConfigSchema = z.object({
|
|
|
30
37
|
colors: CustomFooterColorsSchema.default(DEFAULT_CUSTOM_FOOTER_COLORS),
|
|
31
38
|
icons: CustomFooterIconsSchema.default(DEFAULT_CUSTOM_FOOTER_ICONS),
|
|
32
39
|
display: CustomFooterDisplaySchema.default(DEFAULT_CUSTOM_FOOTER_DISPLAY),
|
|
40
|
+
defaultAgentName: AgentNameSchema,
|
|
33
41
|
});
|
|
34
42
|
export type CustomFooterConfig = z.infer<typeof CustomFooterConfigSchema>;
|
|
35
43
|
|
|
@@ -41,6 +49,7 @@ export const PartialCustomFooterConfigSchema = z.object({
|
|
|
41
49
|
.object({
|
|
42
50
|
directory: ColorHexSchema.optional(),
|
|
43
51
|
modelName: ColorHexSchema.optional(),
|
|
52
|
+
agentName: ColorHexSchema.optional(),
|
|
44
53
|
anthropicUsage: ColorHexSchema.optional(),
|
|
45
54
|
codexUsage: ColorHexSchema.optional(),
|
|
46
55
|
})
|
|
@@ -58,7 +67,9 @@ export const PartialCustomFooterConfigSchema = z.object({
|
|
|
58
67
|
.object({
|
|
59
68
|
tokens: z.boolean().optional(),
|
|
60
69
|
cache: z.boolean().optional(),
|
|
70
|
+
agentName: z.boolean().optional(),
|
|
61
71
|
})
|
|
62
72
|
.optional(),
|
|
73
|
+
defaultAgentName: AgentNameSchema.optional(),
|
|
63
74
|
});
|
|
64
75
|
export type PartialCustomFooterConfig = z.infer<typeof PartialCustomFooterConfigSchema>;
|