pi-ohm 0.2.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 +12 -0
- package/package.json +31 -0
- package/src/extension.ts +90 -0
- package/src/manifest.ts +21 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-ohm",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "src/extension.ts",
|
|
6
|
+
"types": "src/extension.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"src/",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"pi": {
|
|
12
|
+
"extensions": [
|
|
13
|
+
"./src/extension.ts"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@mariozechner/pi-coding-agent": "^0.52.0",
|
|
18
|
+
"@pi-phm/config": "workspace:*",
|
|
19
|
+
"@pi-phm/handoff": "workspace:*",
|
|
20
|
+
"@pi-phm/painter": "workspace:*",
|
|
21
|
+
"@pi-phm/session-search": "workspace:*",
|
|
22
|
+
"@pi-phm/subagents": "workspace:*"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@mariozechner/pi-coding-agent": "*"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public",
|
|
29
|
+
"provenance": true
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/extension.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
2
|
+
import { loadOhmRuntimeConfig, registerOhmSettings } from "@pi-phm/config";
|
|
3
|
+
import registerHandoffExtension from "@pi-phm/handoff";
|
|
4
|
+
import registerSubagentsExtension from "@pi-phm/subagents";
|
|
5
|
+
import registerSessionSearchExtension from "@pi-phm/session-search";
|
|
6
|
+
import registerPainterExtension from "@pi-phm/painter";
|
|
7
|
+
import { PHM_FEATURE_PACKAGES, PHM_RECOMMENDED_NEXT } from "./manifest";
|
|
8
|
+
|
|
9
|
+
export default function registerPiPhmExtension(pi: ExtensionAPI): void {
|
|
10
|
+
registerOhmSettings(pi);
|
|
11
|
+
|
|
12
|
+
registerHandoffExtension(pi);
|
|
13
|
+
registerSubagentsExtension(pi);
|
|
14
|
+
registerSessionSearchExtension(pi);
|
|
15
|
+
registerPainterExtension(pi);
|
|
16
|
+
|
|
17
|
+
pi.registerCommand("ohm-features", {
|
|
18
|
+
description: "Show installed pi-phm feature packages and feature flags",
|
|
19
|
+
handler: async (_args, ctx) => {
|
|
20
|
+
const { config } = await loadOhmRuntimeConfig(ctx.cwd);
|
|
21
|
+
const lines = [
|
|
22
|
+
`handoff: ${config.features.handoff ? "on" : "off"}`,
|
|
23
|
+
`subagents: ${config.features.subagents ? "on" : "off"}`,
|
|
24
|
+
`sessionThreadSearch: ${config.features.sessionThreadSearch ? "on" : "off"}`,
|
|
25
|
+
`handoffVisualizer: ${config.features.handoffVisualizer ? "on" : "off"}`,
|
|
26
|
+
`painterImagegen: ${config.features.painterImagegen ? "on" : "off"}`,
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
const text = [
|
|
30
|
+
"Pi PHM bundle",
|
|
31
|
+
"",
|
|
32
|
+
"Packages:",
|
|
33
|
+
...PHM_FEATURE_PACKAGES.map((pkg) => `- ${pkg}`),
|
|
34
|
+
"",
|
|
35
|
+
"Feature flags:",
|
|
36
|
+
...lines.map((line) => `- ${line}`),
|
|
37
|
+
].join("\n");
|
|
38
|
+
|
|
39
|
+
if (!ctx.hasUI) {
|
|
40
|
+
console.log(text);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
await ctx.ui.editor("pi-phm features", text);
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
pi.registerCommand("ohm-config", {
|
|
49
|
+
description: "Inspect effective Pi PHM runtime config",
|
|
50
|
+
handler: async (_args, ctx) => {
|
|
51
|
+
const loaded = await loadOhmRuntimeConfig(ctx.cwd);
|
|
52
|
+
const text = [
|
|
53
|
+
"Pi PHM effective config",
|
|
54
|
+
"",
|
|
55
|
+
JSON.stringify(loaded.config, null, 2),
|
|
56
|
+
"",
|
|
57
|
+
`configDir: ${loaded.paths.configDir}`,
|
|
58
|
+
`projectConfigFile: ${loaded.paths.projectConfigFile}`,
|
|
59
|
+
`globalConfigFile: ${loaded.paths.globalConfigFile}`,
|
|
60
|
+
`providersConfigFile: ${loaded.paths.providersConfigFile}`,
|
|
61
|
+
`loadedFrom: ${loaded.loadedFrom.length > 0 ? loaded.loadedFrom.join(", ") : "defaults + extension settings"}`,
|
|
62
|
+
].join("\n");
|
|
63
|
+
|
|
64
|
+
if (!ctx.hasUI) {
|
|
65
|
+
console.log(text);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
await ctx.ui.editor("pi-phm config", text);
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
pi.registerCommand("ohm-missing", {
|
|
74
|
+
description: "Show likely next package candidates",
|
|
75
|
+
handler: async (_args, ctx) => {
|
|
76
|
+
const text = [
|
|
77
|
+
"Likely next packages",
|
|
78
|
+
"",
|
|
79
|
+
...PHM_RECOMMENDED_NEXT.map((item) => `- ${item.name}: ${item.reason}`),
|
|
80
|
+
].join("\n");
|
|
81
|
+
|
|
82
|
+
if (!ctx.hasUI) {
|
|
83
|
+
console.log(text);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
await ctx.ui.editor("pi-phm recommended next", text);
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
}
|
package/src/manifest.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const PHM_FEATURE_PACKAGES = [
|
|
2
|
+
"@pi-phm/handoff",
|
|
3
|
+
"@pi-phm/subagents",
|
|
4
|
+
"@pi-phm/session-search",
|
|
5
|
+
"@pi-phm/painter",
|
|
6
|
+
] as const;
|
|
7
|
+
|
|
8
|
+
export const PHM_RECOMMENDED_NEXT = [
|
|
9
|
+
{
|
|
10
|
+
name: "Modes (rush/smart/deep)",
|
|
11
|
+
reason: "Switch quality/speed profile without reconfiguring every feature package.",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: "Permissions policy layer",
|
|
15
|
+
reason: "Protect against unsafe delegated command execution in subagent workflows.",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "Skills + MCP lazy loading",
|
|
19
|
+
reason: "Keep tool/context footprint manageable as the package set grows.",
|
|
20
|
+
},
|
|
21
|
+
] as const;
|