From 2f073235d7f6e49570d1c0d3c88e93f961e0c58f Mon Sep 17 00:00:00 2001 From: Taylor AI Date: Thu, 8 Jan 2026 22:51:35 +0500 Subject: [PATCH] Added build plugin --- .../plugin/{dev-server-hmr.ts => build.ts} | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) rename .opencode/plugin/{dev-server-hmr.ts => build.ts} (84%) diff --git a/.opencode/plugin/dev-server-hmr.ts b/.opencode/plugin/build.ts similarity index 84% rename from .opencode/plugin/dev-server-hmr.ts rename to .opencode/plugin/build.ts index 42935e3..120a4f6 100644 --- a/.opencode/plugin/dev-server-hmr.ts +++ b/.opencode/plugin/build.ts @@ -4,36 +4,37 @@ import { Axios } from "axios"; import { promises as fs } from "fs"; import { z } from "zod"; -const { vmOrchestrationStatusUpdateUrl } = z - .object({ - vmOrchestrationStatusUpdateUrl: z.string(), - }) - .parse({ - vmOrchestrationStatusUpdateUrl: - process.env.TAYLORDB_VM_ORCHESTRATION_STATUS_UPDATE_URL, - }); +// const { vmOrchestrationStatusUpdateUrl } = z +// .object({ +// vmOrchestrationStatusUpdateUrl: z.string(), +// }) +// .parse({ +// vmOrchestrationStatusUpdateUrl: +// process.env.TAYLORDB_VM_ORCHESTRATION_STATUS_UPDATE_URL, +// }); -const axios = new Axios({ - baseURL: vmOrchestrationStatusUpdateUrl, -}); +// const axios = new Axios({ +// baseURL: vmOrchestrationStatusUpdateUrl, +// }); const updateAppStatus = async (status: "Errored" | "Active" | "Pending") => { - await axios.put( - "/", - JSON.stringify({ - status, - }), - { - headers: { - "Content-Type": "application/json", - }, - } - ); + console.log(status); + // await axios.put( + // "/", + // JSON.stringify({ + // status, + // }), + // { + // headers: { + // "Content-Type": "application/json", + // }, + // } + // ); }; const sessionRetries: Record = {}; -export const DevServerHMRPlugin: Plugin = async ({ client, $ }) => { +export const BuildPlugin: Plugin = async ({ client, $ }) => { return { event: async ({ event }) => { const isMessagedDone = @@ -52,6 +53,8 @@ export const DevServerHMRPlugin: Plugin = async ({ client, $ }) => { (await $`git status --porcelain`.quiet()).stdout.toString().trim() !== ""; + console.log({ isAnyChange }); + if (!isAnyChange || isAbortionError) { await updateAppStatus("Active"); @@ -136,6 +139,7 @@ export const DevServerHMRPlugin: Plugin = async ({ client, $ }) => { JSON.stringify(packageJson, null, 2) ); + console.log("Pushing"); await $`git add .`.quiet(); await $`GIT_AUTHOR_NAME="Taylor AI" GIT_AUTHOR_EMAIL="ai@taylordb.io" GIT_COMMITTER_NAME="Taylor AI" GIT_COMMITTER_EMAIL="ai@taylordb.io" git commit -m ${commitMessage}`.quiet(); await $`git tag v${newVersion}`.quiet();