@zcy2nn/agent-forge 1.0.2 → 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/dist/tui.js +7 -4
- package/package.json +1 -1
package/dist/tui.js
CHANGED
|
@@ -33,6 +33,8 @@ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports,
|
|
|
33
33
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
34
34
|
|
|
35
35
|
// src/tui.ts
|
|
36
|
+
import { readFileSync as readFileSync2 } from "node:fs";
|
|
37
|
+
import { fileURLToPath } from "node:url";
|
|
36
38
|
import { createElement, insert, setProp } from "@opentui/solid";
|
|
37
39
|
|
|
38
40
|
// src/config/constants.ts
|
|
@@ -143,9 +145,10 @@ function recordTuiAgentModel(input) {
|
|
|
143
145
|
var PLUGIN_NAME = "agent-forge";
|
|
144
146
|
var FALLBACK_SIDEBAR_AGENTS = SUBAGENT_NAMES.filter((agent) => agent !== "councillor" && agent !== "council" && !DEFAULT_DISABLED_AGENTS.includes(agent));
|
|
145
147
|
var BORDER = { type: "single" };
|
|
146
|
-
|
|
148
|
+
function readPackageVersion() {
|
|
147
149
|
try {
|
|
148
|
-
const
|
|
150
|
+
const pkgPath = fileURLToPath(new URL("../package.json", import.meta.url));
|
|
151
|
+
const packageJson = JSON.parse(readFileSync2(pkgPath, "utf8"));
|
|
149
152
|
return typeof packageJson.version === "string" ? packageJson.version : undefined;
|
|
150
153
|
} catch {
|
|
151
154
|
return;
|
|
@@ -219,7 +222,7 @@ function renderSidebar(snapshot, version, theme) {
|
|
|
219
222
|
var plugin = {
|
|
220
223
|
id: `${PLUGIN_NAME}:tui`,
|
|
221
224
|
tui: async (api, _options, meta) => {
|
|
222
|
-
const version = meta.version ??
|
|
225
|
+
const version = meta.version ?? readPackageVersion() ?? "dev";
|
|
223
226
|
let snapshot = readTuiSnapshot();
|
|
224
227
|
const renderTimer = setInterval(async () => {
|
|
225
228
|
try {
|
|
@@ -233,7 +236,7 @@ var plugin = {
|
|
|
233
236
|
api.slots.register({
|
|
234
237
|
order: 900,
|
|
235
238
|
slots: {
|
|
236
|
-
sidebar_content() {
|
|
239
|
+
sidebar_content(_ctx, _props) {
|
|
237
240
|
return renderSidebar(snapshot, version, api.theme.current);
|
|
238
241
|
}
|
|
239
242
|
}
|
package/package.json
CHANGED