opencode-dev-framework 0.4.0 → 0.5.1
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 +58 -42
- package/dist/block-store.d.ts +7 -23
- package/dist/block-store.js +7 -61
- package/dist/detect.js +1 -1
- package/dist/format-status.d.ts +8 -0
- package/dist/format-status.js +37 -12
- package/dist/gate.d.ts +5 -5
- package/dist/gate.js +5 -5
- package/dist/harness.d.ts +6 -8
- package/dist/harness.js +6 -8
- package/dist/index.d.ts +22 -13
- package/dist/index.js +148 -138
- package/dist/lint.d.ts +5 -3
- package/dist/lint.js +8 -5
- package/dist/registry.d.ts +6 -9
- package/dist/runtime-status.d.ts +29 -0
- package/dist/runtime-status.js +75 -0
- package/package.json +1 -1
- package/tui.tsx +32 -4
package/tui.tsx
CHANGED
|
@@ -4,7 +4,8 @@ import { Plugin } from "@opencode/plugin/tui";
|
|
|
4
4
|
import { changeProfile, verifyGate } from "./dist/commands.js";
|
|
5
5
|
import { loadConfig } from "./dist/config.js";
|
|
6
6
|
import { runCommand } from "./dist/host.js";
|
|
7
|
-
import { renderConfigStatus, renderHelp } from "./dist/format-status.js";
|
|
7
|
+
import { renderConfigStatus, renderHelp, renderRuntimeStatus } from "./dist/format-status.js";
|
|
8
|
+
import { readRuntimeStatus } from "./dist/runtime-status.js";
|
|
8
9
|
import type { Profile } from "./dist/types.js";
|
|
9
10
|
|
|
10
11
|
const PROFILES: Profile[] = ["off", "advisory", "standard", "strict"];
|
|
@@ -39,10 +40,17 @@ export default Plugin.define({
|
|
|
39
40
|
run: () => {
|
|
40
41
|
const dir = getDirectory();
|
|
41
42
|
const config = loadConfig(dir);
|
|
42
|
-
|
|
43
|
+
// The dialog title already carries the heading; drop the
|
|
44
|
+
// duplicated first line from the shared text renderer.
|
|
45
|
+
const message = renderConfigStatus(config).split("\n").slice(2).join("\n");
|
|
46
|
+
const shown = ctx.ui.dialog.alert({
|
|
43
47
|
title: "opencode-dev-framework status",
|
|
44
|
-
message
|
|
48
|
+
message,
|
|
45
49
|
});
|
|
50
|
+
// Presentation is core-owned (alert takes no layout opts);
|
|
51
|
+
// large+centered is the available lever for long content.
|
|
52
|
+
ctx.ui.dialog.set({ size: "large", centered: true });
|
|
53
|
+
void shown;
|
|
46
54
|
},
|
|
47
55
|
},
|
|
48
56
|
{
|
|
@@ -92,6 +100,24 @@ export default Plugin.define({
|
|
|
92
100
|
}
|
|
93
101
|
},
|
|
94
102
|
},
|
|
103
|
+
{
|
|
104
|
+
id: "df-runtime",
|
|
105
|
+
title: "dev-framework runtime",
|
|
106
|
+
description: "Show plugin version and live hook/gate runtime state",
|
|
107
|
+
group: "dev-framework",
|
|
108
|
+
palette: true,
|
|
109
|
+
slash: { name: "df-runtime" },
|
|
110
|
+
run: async () => {
|
|
111
|
+
const dir = getDirectory();
|
|
112
|
+
const snapshot = await readRuntimeStatus(dir);
|
|
113
|
+
const shown = ctx.ui.dialog.alert({
|
|
114
|
+
title: "dev-framework runtime",
|
|
115
|
+
message: renderRuntimeStatus(snapshot),
|
|
116
|
+
});
|
|
117
|
+
ctx.ui.dialog.set({ size: "large", centered: true });
|
|
118
|
+
await shown;
|
|
119
|
+
},
|
|
120
|
+
},
|
|
95
121
|
{
|
|
96
122
|
id: "df-verify",
|
|
97
123
|
title: "dev-framework verify",
|
|
@@ -103,10 +129,12 @@ export default Plugin.define({
|
|
|
103
129
|
const dir = getDirectory();
|
|
104
130
|
const config = loadConfig(dir);
|
|
105
131
|
const { summary, report } = await verifyGate(runCommand, dir, config);
|
|
106
|
-
|
|
132
|
+
const shown = ctx.ui.dialog.alert({
|
|
107
133
|
title: report.ok ? "dev-framework gate passed" : "dev-framework gate failed",
|
|
108
134
|
message: summary,
|
|
109
135
|
});
|
|
136
|
+
ctx.ui.dialog.set({ size: "large", centered: true });
|
|
137
|
+
await shown;
|
|
110
138
|
ctx.ui.toast.show({ message: summary, variant: report.ok ? "success" : "error" });
|
|
111
139
|
},
|
|
112
140
|
},
|