From 6d93d69b2927e45cf9144b4c871081c6ef4aabef Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 20:22:11 +0000 Subject: [PATCH 1/4] Work in progress --- src/routeTree.gen.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts index 0fe84b5..0bb5aca 100644 --- a/src/routeTree.gen.ts +++ b/src/routeTree.gen.ts @@ -670,3 +670,12 @@ const rootRouteChildren: RootRouteChildren = { export const routeTree = rootRouteImport ._addFileChildren(rootRouteChildren) ._addFileTypes() + +import type { getRouter } from './router.tsx' +import type { createStart } from '@tanstack/react-start' +declare module '@tanstack/react-start' { + interface Register { + ssr: true + router: Awaited> + } +} From 26980f813af44caa84907be8e8cbdab29352f1f7 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 20:26:32 +0000 Subject: [PATCH 2/4] Changes Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com> --- supabase/functions/_shared/railway.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/supabase/functions/_shared/railway.ts b/supabase/functions/_shared/railway.ts index 414d021..7d4cd11 100644 --- a/supabase/functions/_shared/railway.ts +++ b/supabase/functions/_shared/railway.ts @@ -347,8 +347,12 @@ export async function listRailwayServiceDomains(opts: { environmentId: string; projectId?: string | null; }): Promise<{ serviceDomains: RailwayServiceDomainInfo[]; customDomains: RailwayServiceDomainInfo[] }> { + if (!opts.projectId) { + throw new Error("projectId is required to list Railway service domains"); + } + const query = ` - query Domains($environmentId: String!, $serviceId: String!, $projectId: String) { + query Domains($environmentId: String!, $serviceId: String!, $projectId: String!) { domains(environmentId: $environmentId, serviceId: $serviceId, projectId: $projectId) { serviceDomains { id @@ -375,7 +379,7 @@ export async function listRailwayServiceDomains(opts: { { environmentId: opts.environmentId, serviceId: opts.serviceId, - projectId: opts.projectId ?? null, + projectId: opts.projectId, }, opts.token, ); From 054890d3c7e132f47b784c253a69ba4bb0702ced Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 20:26:51 +0000 Subject: [PATCH 3/4] Changes Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com> --- src/routeTree.gen.ts | 9 --------- supabase/functions/provision-agent/index.ts | 2 ++ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts index 0bb5aca..0fe84b5 100644 --- a/src/routeTree.gen.ts +++ b/src/routeTree.gen.ts @@ -670,12 +670,3 @@ const rootRouteChildren: RootRouteChildren = { export const routeTree = rootRouteImport ._addFileChildren(rootRouteChildren) ._addFileTypes() - -import type { getRouter } from './router.tsx' -import type { createStart } from '@tanstack/react-start' -declare module '@tanstack/react-start' { - interface Register { - ssr: true - router: Awaited> - } -} diff --git a/supabase/functions/provision-agent/index.ts b/supabase/functions/provision-agent/index.ts index 58b5687..1159bb2 100644 --- a/supabase/functions/provision-agent/index.ts +++ b/supabase/functions/provision-agent/index.ts @@ -6,6 +6,7 @@ import { createClient } from "https://esm.sh/@supabase/supabase-js@2.45.4"; import { corsHeaders } from "../_shared/cors.ts"; import { + HERMES_START_COMMAND, createRailwayService, configureRailwayService, deployRailwayService, @@ -280,6 +281,7 @@ Deno.serve(async (req) => { projectId: pool.railway_project_id, image: "ghcr.io/domfelipe/hermes-agent-custom:latest", variables: envVars, + startCommand: HERMES_START_COMMAND, }); console.log(`[provision-agent] serviço configurado com ${Object.keys(envVars).length} env vars`); From 9ab8037342b919025620f78bec5a629725b71b9c Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 20:26:59 +0000 Subject: [PATCH 4/4] Changes Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com> --- supabase/functions/provision-agent/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/supabase/functions/provision-agent/index.ts b/supabase/functions/provision-agent/index.ts index 1159bb2..3e2724c 100644 --- a/supabase/functions/provision-agent/index.ts +++ b/supabase/functions/provision-agent/index.ts @@ -502,6 +502,17 @@ async function handleUpdateExistingService( }); console.log(`[provision-agent:update] variáveis atualizadas (${Object.keys(variables).length})`); + await configureRailwayService({ + token: RAILWAY_API_TOKEN!, + serviceId: railwayServiceId, + environmentId, + projectId, + image: "ghcr.io/domfelipe/hermes-agent-custom:latest", + variables: {}, + startCommand: HERMES_START_COMMAND, + }); + console.log(`[provision-agent:update] imagem/start command reconciliados`); + await deployRailwayService({ token: RAILWAY_API_TOKEN!, serviceId: railwayServiceId,