feat(opencode): migrate agent runtime to v2

This commit is contained in:
2026-08-04 16:56:04 +08:00
parent 07016451d6
commit 764a1f4e82
33 changed files with 1662 additions and 1057 deletions
+44
View File
@@ -0,0 +1,44 @@
import apply_layer_style from "../tools/apply_layer_style.js";
import geocode from "../tools/geocode.js";
import locate_features from "../tools/locate_features.js";
import memory_manager from "../tools/memory_manager.js";
import render_junctions from "../tools/render_junctions.js";
import session_search from "../tools/session_search.js";
import show_chart from "../tools/show_chart.js";
import skill_manager from "../tools/skill_manager.js";
import store_render_ref from "../tools/store_render_ref.js";
import tjwater_cli from "../tools/tjwater_cli.js";
import view_history from "../tools/view_history.js";
import view_scada from "../tools/view_scada.js";
import web_search from "../tools/web_search.js";
import zoom_to_map from "../tools/zoom_to_map.js";
import { Plugin } from "@opencode-ai/plugin";
const definitions = {
apply_layer_style,
geocode,
locate_features,
memory_manager,
render_junctions,
session_search,
show_chart,
skill_manager,
store_render_ref,
tjwater_cli,
view_history,
view_scada,
web_search,
zoom_to_map,
};
export default Plugin.define({
id: "tjwater-tools",
async setup(context) {
const registration = await context.tool.transform((tools) => {
for (const [name, definition] of Object.entries(definitions)) {
tools.add({ name, ...definition });
}
});
return () => registration.dispose();
},
});