@0xkahi/pi-qol 1.0.3 → 1.0.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/package.json
CHANGED
package/src/config-loader.ts
CHANGED
|
@@ -32,6 +32,10 @@ export class ConfigLoader {
|
|
|
32
32
|
return this.config.context_view;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
getWorkmux(): Config['workmux'] {
|
|
36
|
+
return this.config.workmux;
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
initializeConfig(ctx: ExtensionContext): { success: boolean; error?: string } {
|
|
36
40
|
let merged: Config = this.defaultConfig;
|
|
37
41
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';
|
|
2
|
+
import type { ConfigLoader } from '../../config-loader';
|
|
3
|
+
|
|
4
|
+
export function activateWorkmux(pi: ExtensionAPI) {
|
|
5
|
+
function setStatus(status: string) {
|
|
6
|
+
pi.exec('workmux', ['set-window-status', status]).catch(() => {});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
pi.on('session_start', async () => {
|
|
10
|
+
setStatus('waiting');
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
pi.on('agent_start', async () => {
|
|
14
|
+
setStatus('working');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
pi.on('agent_end', async () => {
|
|
18
|
+
setStatus('done');
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function registerWorkmux(pi: ExtensionAPI, deps: { config: ConfigLoader }) {
|
|
23
|
+
let registered = false;
|
|
24
|
+
pi.on('session_start', (_event, _ctx) => {
|
|
25
|
+
if (registered || !deps.config.isEnabled('workmux')) return;
|
|
26
|
+
activateWorkmux(pi);
|
|
27
|
+
registered = true;
|
|
28
|
+
});
|
|
29
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { registerAutoSessionName } from './extensions/auto-session-name';
|
|
|
4
4
|
import { registerContextView } from './extensions/context-view';
|
|
5
5
|
import { registerCustomFooter } from './extensions/custom-footer';
|
|
6
6
|
import { registerModelSelect } from './extensions/model-select';
|
|
7
|
+
import { registerWorkmux } from './extensions/workmux';
|
|
7
8
|
|
|
8
9
|
export default function (pi: ExtensionAPI) {
|
|
9
10
|
const config = new ConfigLoader();
|
|
@@ -17,4 +18,5 @@ export default function (pi: ExtensionAPI) {
|
|
|
17
18
|
registerModelSelect(pi, { config });
|
|
18
19
|
registerCustomFooter(pi, { config });
|
|
19
20
|
registerContextView(pi, { config });
|
|
21
|
+
registerWorkmux(pi, { config });
|
|
20
22
|
}
|
|
@@ -3,6 +3,7 @@ import { AutoSessionNameConfigSchema, PartialAutoSessionNameConfigSchema } from
|
|
|
3
3
|
import { ContextViewConfigSchema, DEFAULT_CONTEXT_VIEW_CONFIG, PartialContextViewConfigSchema } from './context-view.config.schema';
|
|
4
4
|
import { CustomFooterConfigSchema, DEFAULT_CUSTOM_FOOTER_CONFIG, PartialCustomFooterConfigSchema } from './custom-footer-config.schema';
|
|
5
5
|
import { ModelSelectConfigSchema, PartialModelSelectConfigSchema } from './model-select.config.schema';
|
|
6
|
+
import { WorkmuxConfigSchema } from './workmux.config.schema';
|
|
6
7
|
|
|
7
8
|
export const ConfigSchema = z.object({
|
|
8
9
|
$schema: z.string().optional(),
|
|
@@ -21,6 +22,7 @@ export const ConfigSchema = z.object({
|
|
|
21
22
|
}),
|
|
22
23
|
custom_footer: CustomFooterConfigSchema.default(DEFAULT_CUSTOM_FOOTER_CONFIG),
|
|
23
24
|
context_view: ContextViewConfigSchema.default(DEFAULT_CONTEXT_VIEW_CONFIG),
|
|
25
|
+
workmux: WorkmuxConfigSchema.default({ enabled: false }),
|
|
24
26
|
});
|
|
25
27
|
export type Config = z.infer<typeof ConfigSchema>;
|
|
26
28
|
|
|
@@ -30,5 +32,6 @@ export const PartialConfigSchema = z.object({
|
|
|
30
32
|
model_select: PartialModelSelectConfigSchema.optional(),
|
|
31
33
|
custom_footer: PartialCustomFooterConfigSchema.optional(),
|
|
32
34
|
context_view: PartialContextViewConfigSchema.optional(),
|
|
35
|
+
workmux: WorkmuxConfigSchema.optional(),
|
|
33
36
|
});
|
|
34
37
|
export type PartialConfig = z.infer<typeof PartialConfigSchema>;
|