opencode-toolbox 0.5.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 +1 -4
- package/dist/index.js +5 -65
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -207,15 +207,12 @@ Returns a comprehensive status object:
|
|
|
207
207
|
|
|
208
208
|
### /toolbox-status Slash Command
|
|
209
209
|
|
|
210
|
-
The plugin automatically creates
|
|
210
|
+
The plugin automatically creates a `/toolbox-status` slash command on first launch:
|
|
211
211
|
|
|
212
212
|
```
|
|
213
213
|
~/.config/opencode/command/toolbox-status.md
|
|
214
214
|
```
|
|
215
215
|
|
|
216
|
-
- **Auto-created** on first plugin launch
|
|
217
|
-
- **Auto-updated** when plugin version changes (tracked via `toolbox_version` in frontmatter)
|
|
218
|
-
|
|
219
216
|
Use it in OpenCode by typing `/toolbox-status` to get a formatted status report.
|
|
220
217
|
|
|
221
218
|
## Search Modes
|
package/dist/index.js
CHANGED
|
@@ -19267,7 +19267,7 @@ function tool(input) {
|
|
|
19267
19267
|
}
|
|
19268
19268
|
tool.schema = exports_external;
|
|
19269
19269
|
// src/plugin.ts
|
|
19270
|
-
import { appendFile, mkdir, writeFile,
|
|
19270
|
+
import { appendFile, mkdir, writeFile, access } from "fs/promises";
|
|
19271
19271
|
|
|
19272
19272
|
// node_modules/zod/v4/classic/external.js
|
|
19273
19273
|
var exports_external2 = {};
|
|
@@ -37911,69 +37911,18 @@ function generateSignature(tool3) {
|
|
|
37911
37911
|
}).join(", ");
|
|
37912
37912
|
return `${tool3.id.name}(${argList})`;
|
|
37913
37913
|
}
|
|
37914
|
-
// package.json
|
|
37915
|
-
var package_default = {
|
|
37916
|
-
name: "opencode-toolbox",
|
|
37917
|
-
version: "0.5.0",
|
|
37918
|
-
description: "Tool Search Tool Plugin for OpenCode - search and execute tools from MCP servers on-demand",
|
|
37919
|
-
main: "dist/index.js",
|
|
37920
|
-
module: "dist/index.js",
|
|
37921
|
-
type: "module",
|
|
37922
|
-
exports: {
|
|
37923
|
-
".": {
|
|
37924
|
-
import: "./dist/index.js",
|
|
37925
|
-
types: "./dist/index.d.ts"
|
|
37926
|
-
}
|
|
37927
|
-
},
|
|
37928
|
-
scripts: {
|
|
37929
|
-
build: "bun build src/index.ts --outdir dist --target bun",
|
|
37930
|
-
dev: "bun --hot src/index.ts",
|
|
37931
|
-
test: "bun test",
|
|
37932
|
-
"test:coverage": "bun test --coverage",
|
|
37933
|
-
typecheck: "tsc --noEmit"
|
|
37934
|
-
},
|
|
37935
|
-
files: [
|
|
37936
|
-
"dist",
|
|
37937
|
-
"README.md"
|
|
37938
|
-
],
|
|
37939
|
-
keywords: [
|
|
37940
|
-
"opencode",
|
|
37941
|
-
"plugin",
|
|
37942
|
-
"tool-search",
|
|
37943
|
-
"mcp"
|
|
37944
|
-
],
|
|
37945
|
-
license: "MIT",
|
|
37946
|
-
devDependencies: {
|
|
37947
|
-
"@types/bun": "latest",
|
|
37948
|
-
typescript: "^5.9.3"
|
|
37949
|
-
},
|
|
37950
|
-
peerDependencies: {
|
|
37951
|
-
typescript: "^5"
|
|
37952
|
-
},
|
|
37953
|
-
dependencies: {
|
|
37954
|
-
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
37955
|
-
"@opencode-ai/plugin": "latest",
|
|
37956
|
-
"jsonc-parser": "^3.3.1",
|
|
37957
|
-
zod: "^4.3.5"
|
|
37958
|
-
}
|
|
37959
|
-
};
|
|
37960
|
-
|
|
37961
37914
|
// src/plugin.ts
|
|
37962
|
-
var PLUGIN_VERSION = package_default.version;
|
|
37963
37915
|
var DEFAULT_CONFIG_PATH = `${process.env.HOME}/.config/opencode/toolbox.jsonc`;
|
|
37964
37916
|
var LOG_FILE_PATH = `${process.env.HOME}/.local/share/opencode/toolbox.log`;
|
|
37965
37917
|
var LOG_DIR = `${process.env.HOME}/.local/share/opencode`;
|
|
37966
37918
|
var COMMAND_DIR = `${process.env.HOME}/.config/opencode/command`;
|
|
37967
37919
|
var COMMAND_FILE_PATH = `${COMMAND_DIR}/toolbox-status.md`;
|
|
37968
|
-
|
|
37969
|
-
return `---
|
|
37920
|
+
var COMMAND_CONTENT = `---
|
|
37970
37921
|
description: Check toolbox plugin status and server health
|
|
37971
|
-
toolbox_version: ${PLUGIN_VERSION}
|
|
37972
37922
|
---
|
|
37973
|
-
Run toolbox_status({}) and show me the results in a readable format.
|
|
37923
|
+
Run toolbox_status({}) tool and show me the results in a readable format.
|
|
37974
37924
|
Highlight any failed servers or issues.
|
|
37975
37925
|
`;
|
|
37976
|
-
}
|
|
37977
37926
|
function parseToolName(fullName) {
|
|
37978
37927
|
const underscoreIndex = fullName.indexOf("_");
|
|
37979
37928
|
if (underscoreIndex === -1) {
|
|
@@ -38023,17 +37972,8 @@ function log(level, message, extra) {
|
|
|
38023
37972
|
mkdir(LOG_DIR, { recursive: true }).then(() => appendFile(LOG_FILE_PATH, line)).catch(() => {});
|
|
38024
37973
|
}
|
|
38025
37974
|
function ensureCommandFile() {
|
|
38026
|
-
|
|
38027
|
-
|
|
38028
|
-
const versionMatch = existing.match(/toolbox_version:\s*([^\n]+)/);
|
|
38029
|
-
const existingVersion = versionMatch?.[1]?.trim() ?? null;
|
|
38030
|
-
if (existingVersion !== PLUGIN_VERSION) {
|
|
38031
|
-
return writeFile(COMMAND_FILE_PATH, content).then(() => {
|
|
38032
|
-
log("info", `Updated /toolbox-status command (${existingVersion} -> ${PLUGIN_VERSION})`);
|
|
38033
|
-
});
|
|
38034
|
-
}
|
|
38035
|
-
}).catch(() => {
|
|
38036
|
-
mkdir(COMMAND_DIR, { recursive: true }).then(() => writeFile(COMMAND_FILE_PATH, content)).then(() => log("info", `Created /toolbox-status command (v${PLUGIN_VERSION})`)).catch(() => {});
|
|
37975
|
+
access(COMMAND_FILE_PATH).catch(() => {
|
|
37976
|
+
mkdir(COMMAND_DIR, { recursive: true }).then(() => writeFile(COMMAND_FILE_PATH, COMMAND_CONTENT)).then(() => log("info", "Created /toolbox-status command file")).catch(() => {});
|
|
38037
37977
|
});
|
|
38038
37978
|
}
|
|
38039
37979
|
var SYSTEM_PROMPT_BASE = `# Extended Toolbox
|
package/package.json
CHANGED