style(opencode): format tool definitions

This commit is contained in:
2026-06-07 17:08:17 +08:00
parent 9d4e5486e9
commit ba46258845
9 changed files with 116 additions and 54 deletions
+18 -12
View File
@@ -1,6 +1,7 @@
import { tool } from "@opencode-ai/plugin";
const internalBaseUrl = process.env.TJWATER_AGENT_INTERNAL_BASE_URL ?? "http://127.0.0.1:8787";
const internalBaseUrl =
process.env.TJWATER_AGENT_INTERNAL_BASE_URL ?? "http://127.0.0.1:8787";
const internalToken = process.env.TJWATER_AGENT_INTERNAL_TOKEN ?? "";
export default tool({
@@ -9,7 +10,9 @@ export default tool({
args: {
reason: tool.schema
.string()
.describe("Why this local render payload should be persisted as a render_ref."),
.describe(
"Why this local render payload should be persisted as a render_ref.",
),
file_path: tool.schema
.string()
.describe(
@@ -17,17 +20,20 @@ export default tool({
),
},
async execute(args, context) {
const response = await fetch(`${internalBaseUrl}/internal/tools/store-render-ref`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-agent-internal-token": internalToken,
const response = await fetch(
`${internalBaseUrl}/internal/tools/store-render-ref`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
"x-agent-internal-token": internalToken,
},
body: JSON.stringify({
session_id: context.sessionID,
file_path: args.file_path,
}),
},
body: JSON.stringify({
session_id: context.sessionID,
file_path: args.file_path,
}),
});
);
const text = await response.text();
if (!response.ok) {