@astrosheep/keiyaku 4.5.2 → 4.5.3
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/build/integrations/marketplace/plugins/keiyaku/.claude-plugin/plugin.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/.codex-plugin/plugin.json +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/package.json +4 -1
- package/build/integrations/pi/keiyaku.ts +19 -11
- package/package.json +1 -1
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keiyaku-harness",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./opencode.js",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"pi-package"
|
|
8
8
|
],
|
|
9
9
|
"pi": {
|
|
10
|
+
"extensions": [
|
|
11
|
+
"../../../pi/keiyaku.ts"
|
|
12
|
+
],
|
|
10
13
|
"skills": [
|
|
11
14
|
"./skills"
|
|
12
15
|
]
|
|
@@ -100,7 +100,7 @@ function overlay(lines: readonly string[], theme: Theme, done: () => void) {
|
|
|
100
100
|
if (data === "\u001b" || data === "q" || data === "Q" || data === "\r") done();
|
|
101
101
|
},
|
|
102
102
|
render(width: number): string[] {
|
|
103
|
-
const inner = Math.max(
|
|
103
|
+
const inner = Math.max(1, Math.min(100, width - 2));
|
|
104
104
|
const border = theme.fg("border", "+");
|
|
105
105
|
const rule = theme.fg("border", "-".repeat(inner));
|
|
106
106
|
return [
|
|
@@ -124,23 +124,31 @@ export default function keiyakuExtension(pi: ExtensionAPI): void {
|
|
|
124
124
|
const refresh = async (ctx: Pick<ExtensionContext, "hasUI" | "ui">): Promise<void> => {
|
|
125
125
|
if (!ctx.hasUI) return;
|
|
126
126
|
refreshInFlight ??= (async () => {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
127
|
+
try {
|
|
128
|
+
const result = await run(pi, ["status", "--json"]);
|
|
129
|
+
const report = parseReport(result);
|
|
130
|
+
if (report === undefined) {
|
|
131
|
+
const diagnostic = result.stderr.trim() || "status unavailable";
|
|
132
|
+
ctx.ui.setWidget("keiyaku", [`Keiyaku · ${lineForWidth(diagnostic, 100)}`]);
|
|
133
|
+
} else ctx.ui.setWidget("keiyaku", [summary(report)]);
|
|
134
|
+
} catch {
|
|
135
|
+
ctx.ui.setWidget("keiyaku", ["Keiyaku · status unavailable"]);
|
|
136
|
+
}
|
|
133
137
|
})().finally(() => {
|
|
134
138
|
refreshInFlight = undefined;
|
|
135
139
|
});
|
|
136
140
|
await refreshInFlight;
|
|
137
141
|
};
|
|
138
142
|
|
|
139
|
-
|
|
140
|
-
|
|
143
|
+
const scheduleRefresh = (ctx: Pick<ExtensionContext, "hasUI" | "ui">): void => {
|
|
144
|
+
void refresh(ctx).catch(() => undefined);
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
pi.on("session_start", (_event, ctx) => {
|
|
148
|
+
scheduleRefresh(ctx);
|
|
141
149
|
});
|
|
142
|
-
pi.on("
|
|
143
|
-
|
|
150
|
+
pi.on("agent_end", (_event, ctx) => {
|
|
151
|
+
scheduleRefresh(ctx);
|
|
144
152
|
});
|
|
145
153
|
pi.registerCommand("keiyaku", {
|
|
146
154
|
description: "Open the Kanshi world status",
|