'use strict';

var chunkZ7LCIYK7_cjs = require('./chunk-Z7LCIYK7.cjs');
var chunkN54Q3AQR_cjs = require('./chunk-N54Q3AQR.cjs');
var chunk64ITUOXI_cjs = require('./chunk-64ITUOXI.cjs');
var v4 = require('zod/v4');

function isReservedThreadMetadataKey(key) {
  return key === "currentModelId" || key === "currentModeId" || key === "observerModelId" || key === "reflectorModelId" || key === "observationThreshold" || key === "reflectionThreshold" || key === "tokenUsage" || key.startsWith("modeModelId_");
}
function getAgentControllerOrThrow(mastra, controllerId) {
  const controller = mastra.getAgentController?.(controllerId);
  if (!controller) {
    throw new chunk64ITUOXI_cjs.HTTPException(404, { message: `agent controller "${controllerId}" not found` });
  }
  return controller;
}
async function getSession(controller, resourceId, tags) {
  await controller.init();
  return controller.createSession({ resourceId, id: resourceId, ownerId: controller.id, tags });
}
var controllerIdPathParams = v4.z.object({ controllerId: v4.z.string() });
var sessionPathParams = v4.z.object({ controllerId: v4.z.string(), resourceId: v4.z.string() });
var createSessionBodySchema = v4.z.object({
  resourceId: v4.z.string(),
  tags: v4.z.record(v4.z.string(), v4.z.string()).optional()
});
var sendMessageBodySchema = v4.z.object({ message: v4.z.string() });
var steerBodySchema = v4.z.object({ message: v4.z.string() });
var toolApprovalBodySchema = v4.z.object({
  toolCallId: v4.z.string(),
  approved: v4.z.boolean()
});
var toolSuspensionBodySchema = v4.z.object({
  toolCallId: v4.z.string(),
  // Free-form resume payload. For ask_user this is a string (or string[] for
  // multi-select); for submit_plan it's `{ action, feedback? }`; for
  // request_access it's "Yes"/"No".
  resumeData: v4.z.any()
});
var switchModeBodySchema = v4.z.object({ modeId: v4.z.string() });
var switchModelBodySchema = v4.z.object({
  modelId: v4.z.string(),
  scope: v4.z.enum(["global", "thread"]).optional(),
  modeId: v4.z.string().optional()
});
var switchThreadBodySchema = v4.z.object({ threadId: v4.z.string() });
var createThreadBodySchema = v4.z.object({ title: v4.z.string().optional() });
var renameThreadBodySchema = v4.z.object({ title: v4.z.string() });
var threadPathParams = v4.z.object({ controllerId: v4.z.string(), resourceId: v4.z.string(), threadId: v4.z.string() });
var cloneThreadBodySchema = v4.z.object({
  sourceThreadId: v4.z.string().optional(),
  title: v4.z.string().optional()
});
var listMessagesQuerySchema = v4.z.object({ limit: v4.z.coerce.number().optional() });
var listThreadsQuerySchema = v4.z.object({
  limit: v4.z.coerce.number().optional(),
  tags: v4.z.preprocess((value) => {
    if (typeof value !== "string" || value.length === 0) return void 0;
    try {
      return JSON.parse(value);
    } catch {
      return void 0;
    }
  }, v4.z.record(v4.z.string(), v4.z.string()).optional()).optional()
});
var followUpBodySchema = v4.z.object({ message: v4.z.string() });
var sendNotificationBodySchema = v4.z.object({
  source: v4.z.string(),
  kind: v4.z.string(),
  summary: v4.z.string(),
  priority: v4.z.enum(["low", "medium", "high", "urgent"]).optional(),
  payload: v4.z.any().optional(),
  sourceId: v4.z.string().optional(),
  dedupeKey: v4.z.string().optional(),
  coalesceKey: v4.z.string().optional(),
  attributes: v4.z.record(v4.z.string(), v4.z.unknown()).optional(),
  metadata: v4.z.record(v4.z.string(), v4.z.unknown()).optional()
});
var listAgentControllersResponseSchema = v4.z.object({
  agentControllers: v4.z.array(v4.z.object({ id: v4.z.string() }))
});
var createSessionResponseSchema = v4.z.object({
  controllerId: v4.z.string(),
  resourceId: v4.z.string(),
  threadId: v4.z.string().optional()
});
var ackResponseSchema = v4.z.object({ ok: v4.z.boolean() });
var omProgressSummarySchema = v4.z.object({
  status: v4.z.string(),
  pendingTokens: v4.z.number(),
  threshold: v4.z.number(),
  thresholdPercent: v4.z.number(),
  observationTokens: v4.z.number(),
  reflectionThreshold: v4.z.number(),
  reflectionThresholdPercent: v4.z.number(),
  /** Tokens the next observation will remove from the message window. */
  projectedMessageRemoval: v4.z.number(),
  /** Tokens the next reflection is projected to save. */
  projectedReflectionSavings: v4.z.number()
});
var sessionSettingsSchema = v4.z.object({
  yolo: v4.z.boolean(),
  thinkingLevel: v4.z.enum(["off", "low", "medium", "high", "xhigh"]),
  notifications: v4.z.enum(["off", "bell", "system", "both"]),
  smartEditing: v4.z.boolean()
});
var sessionStateResponseSchema = v4.z.object({
  controllerId: v4.z.string(),
  resourceId: v4.z.string(),
  threadId: v4.z.string().optional(),
  modeId: v4.z.string(),
  modelId: v4.z.string(),
  omProgress: omProgressSummarySchema.optional(),
  tokenUsage: v4.z.record(v4.z.string(), v4.z.unknown()).optional(),
  settings: sessionSettingsSchema.optional()
});
var listModesResponseSchema = v4.z.object({
  modes: v4.z.array(v4.z.object({ id: v4.z.string(), name: v4.z.string().optional() }))
});
var listThreadsResponseSchema = v4.z.object({
  threads: v4.z.array(
    v4.z.object({
      id: v4.z.string(),
      title: v4.z.string().optional(),
      updatedAt: v4.z.string().optional(),
      /** The session scoping tags stamped on this thread (e.g. `{ projectPath }`). */
      tags: v4.z.record(v4.z.string(), v4.z.string()).optional()
    })
  )
});
var threadResponseSchema = v4.z.object({
  id: v4.z.string(),
  title: v4.z.string().optional(),
  resourceId: v4.z.string().optional(),
  createdAt: v4.z.string().optional(),
  updatedAt: v4.z.string().optional()
});
var messageContentSchema = v4.z.object({
  type: v4.z.string()
}).passthrough();
var listMessagesResponseSchema = v4.z.object({
  messages: v4.z.array(
    v4.z.object({
      id: v4.z.string(),
      role: v4.z.enum(["user", "assistant", "system"]),
      content: v4.z.array(messageContentSchema),
      createdAt: v4.z.string().optional()
    })
  )
});
var listModelsResponseSchema = v4.z.object({
  models: v4.z.array(
    v4.z.object({
      id: v4.z.string(),
      provider: v4.z.string(),
      modelName: v4.z.string(),
      hasApiKey: v4.z.boolean(),
      useCount: v4.z.number()
    })
  )
});
var workspaceStatusResponseSchema = v4.z.object({
  hasWorkspace: v4.z.boolean(),
  isReady: v4.z.boolean()
});
var omRecordResponseSchema = v4.z.object({
  record: v4.z.any().optional()
});
var permissionPolicyEnum = v4.z.enum(["allow", "ask", "deny"]);
var toolCategoryEnum = v4.z.enum(["read", "edit", "execute", "mcp", "other"]);
var permissionRulesResponseSchema = v4.z.object({
  categories: v4.z.record(v4.z.string(), permissionPolicyEnum).optional(),
  tools: v4.z.record(v4.z.string(), permissionPolicyEnum).optional()
});
var setCategoryPermissionBodySchema = v4.z.object({
  category: toolCategoryEnum,
  policy: permissionPolicyEnum
});
var setToolPermissionBodySchema = v4.z.object({
  toolName: v4.z.string(),
  policy: permissionPolicyEnum
});
var LIST_AGENT_CONTROLLERS_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "GET",
  path: "/agent-controller",
  responseType: "json",
  responseSchema: listAgentControllersResponseSchema,
  summary: "List agent controllers",
  description: "Lists the agent controllers hosted on this Mastra instance.",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:read",
  handler: async ({ mastra }) => {
    try {
      const ids = /* @__PURE__ */ new Set();
      if (mastra.listAgentControllers) {
        for (const id of Object.keys(mastra.listAgentControllers())) ids.add(id);
      }
      return { agentControllers: Array.from(ids).map((id) => ({ id })) };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error listing agent controllers");
    }
  }
});
var CREATE_AGENT_CONTROLLER_SESSION_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "POST",
  path: "/agent-controller/:controllerId/sessions",
  responseType: "json",
  pathParamSchema: controllerIdPathParams,
  bodySchema: createSessionBodySchema,
  responseSchema: createSessionResponseSchema,
  summary: "Create or resume a controller session",
  description: "Creates a session for the given resourceId, or returns the existing one (get-or-create), so reconnects resume the conversation.",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, tags }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId, tags);
      return {
        controllerId,
        resourceId,
        threadId: session.thread.getId() ?? void 0
      };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error creating controller session");
    }
  }
});
var STREAM_AGENT_CONTROLLER_SESSION_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "GET",
  path: "/agent-controller/:controllerId/sessions/:resourceId/stream",
  responseType: "stream",
  streamFormat: "sse",
  sseFlushOnConnect: true,
  pathParamSchema: sessionPathParams,
  summary: "Stream controller session events",
  description: "Subscribes to a session\u2019s event bus and streams events to the client over SSE.",
  tags: ["AgentController", "Streaming"],
  requiresAuth: true,
  requiresPermission: "agent-controller:read",
  handler: async ({ mastra, controllerId, resourceId, abortSignal }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      let cleanedUp = false;
      let heartbeat;
      let unsubscribe;
      const clearHeartbeat = () => {
        if (heartbeat) {
          clearTimeout(heartbeat);
          heartbeat = void 0;
        }
      };
      const cleanup = (controller2) => {
        if (cleanedUp) return;
        cleanedUp = true;
        clearHeartbeat();
        unsubscribe?.();
        if (controller2) {
          try {
            controller2.close();
          } catch {
          }
        }
      };
      return new ReadableStream({
        start(controller2) {
          const scheduleHeartbeat = () => {
            if (cleanedUp) return;
            clearHeartbeat();
            heartbeat = setTimeout(() => {
              heartbeat = void 0;
              if (cleanedUp) return;
              try {
                controller2.enqueue(": heartbeat\n\n");
              } catch {
                cleanup();
                return;
              }
              scheduleHeartbeat();
            }, 25e3);
          };
          unsubscribe = session.subscribe((event) => {
            if (cleanedUp) return;
            try {
              controller2.enqueue(event);
              scheduleHeartbeat();
            } catch {
              cleanup();
            }
          });
          const abortCleanup = () => cleanup(controller2);
          abortSignal?.addEventListener("abort", abortCleanup, { once: true });
          scheduleHeartbeat();
        },
        cancel() {
          cleanup();
        }
      });
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error streaming controller session");
    }
  }
});
var SEND_AGENT_CONTROLLER_MESSAGE_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "POST",
  path: "/agent-controller/:controllerId/sessions/:resourceId/messages",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: sendMessageBodySchema,
  responseSchema: ackResponseSchema,
  summary: "Send a message to a controller session",
  description: "Sends a user message to the session. The reply streams as events on the session\u2019s SSE stream.",
  tags: ["AgentController", "Streaming"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, message }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      void session.sendMessage({ content: message });
      return { ok: true };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error sending controller message");
    }
  }
});
var ABORT_AGENT_CONTROLLER_SESSION_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "POST",
  path: "/agent-controller/:controllerId/sessions/:resourceId/abort",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  responseSchema: ackResponseSchema,
  summary: "Abort a controller session run",
  description: "Aborts the in-flight run for the session, if any.",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      session.abort();
      return { ok: true };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error aborting controller session");
    }
  }
});
var AGENT_CONTROLLER_TOOL_APPROVAL_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "POST",
  path: "/agent-controller/:controllerId/sessions/:resourceId/tool-approval",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: toolApprovalBodySchema,
  responseSchema: ackResponseSchema,
  summary: "Respond to a controller tool approval",
  description: "Approves or declines a pending tool call surfaced by the session.",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, toolCallId, approved }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      session.respondToToolApproval({ toolCallId, decision: approved ? "approve" : "decline" });
      return { ok: true };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error responding to controller tool approval");
    }
  }
});
var AGENT_CONTROLLER_TOOL_SUSPENSION_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "POST",
  path: "/agent-controller/:controllerId/sessions/:resourceId/tool-suspension",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: toolSuspensionBodySchema,
  responseSchema: ackResponseSchema,
  summary: "Respond to a suspended controller tool",
  description: "Resumes a suspended interactive tool (ask_user, request_access, submit_plan) with the provided resume data.",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, toolCallId, resumeData }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      await session.respondToToolSuspension({ toolCallId, resumeData });
      return { ok: true };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error responding to controller tool suspension");
    }
  }
});
var STEER_AGENT_CONTROLLER_SESSION_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "POST",
  path: "/agent-controller/:controllerId/sessions/:resourceId/steer",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: steerBodySchema,
  responseSchema: ackResponseSchema,
  summary: "Steer the in-flight run",
  description: "Injects a message into the running turn (interjection) without starting a new run.",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, message }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      void session.steer({ content: message });
      return { ok: true };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error steering controller session");
    }
  }
});
var SWITCH_AGENT_CONTROLLER_MODE_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "POST",
  path: "/agent-controller/:controllerId/sessions/:resourceId/mode",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: switchModeBodySchema,
  responseSchema: ackResponseSchema,
  summary: "Switch the session mode",
  description: "Switches the active mode (e.g. build, plan) for the session.",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, modeId }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      await session.mode.switch({ modeId });
      return { ok: true };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error switching controller mode");
    }
  }
});
var SWITCH_AGENT_CONTROLLER_MODEL_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "POST",
  path: "/agent-controller/:controllerId/sessions/:resourceId/model",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: switchModelBodySchema,
  responseSchema: ackResponseSchema,
  summary: "Switch the session model",
  description: "Switches the model for the session, scoped to the thread by default.",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, modelId, scope, modeId }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      await session.model.switch({ modelId, scope, modeId });
      return { ok: true };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error switching controller model");
    }
  }
});
var SWITCH_AGENT_CONTROLLER_THREAD_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "POST",
  path: "/agent-controller/:controllerId/sessions/:resourceId/thread",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: switchThreadBodySchema,
  responseSchema: ackResponseSchema,
  summary: "Switch the session thread",
  description: "Switches the session to an existing thread (rebinding its stream and state).",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, threadId }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      await session.thread.switch({ threadId });
      return { ok: true };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error switching controller thread");
    }
  }
});
var GET_AGENT_CONTROLLER_SESSION_STATE_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "GET",
  path: "/agent-controller/:controllerId/sessions/:resourceId",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  responseSchema: sessionStateResponseSchema,
  summary: "Get session state",
  description: "Returns the current mode, model, and thread for the session (for initial UI hydration).",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:read",
  handler: async ({ mastra, controllerId, resourceId }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      const ds = session.displayState.get();
      const om = ds.omProgress;
      const reflectionSavings = om.buffered.reflection.inputObservationTokens - om.buffered.reflection.observationTokens;
      const st = session.state.get();
      const oneOf = (value, allowed, fallback) => allowed.includes(value) ? value : fallback;
      return {
        controllerId,
        resourceId,
        threadId: session.thread.getId() ?? void 0,
        modeId: session.mode.get(),
        modelId: session.model.get(),
        omProgress: {
          status: om.status,
          pendingTokens: om.pendingTokens,
          threshold: om.threshold,
          thresholdPercent: om.thresholdPercent,
          observationTokens: om.observationTokens,
          reflectionThreshold: om.reflectionThreshold,
          reflectionThresholdPercent: om.reflectionThresholdPercent,
          projectedMessageRemoval: om.buffered.observations.projectedMessageRemoval,
          projectedReflectionSavings: reflectionSavings > 0 ? reflectionSavings : 0
        },
        tokenUsage: ds.tokenUsage,
        settings: {
          yolo: st.yolo === true,
          thinkingLevel: oneOf(st.thinkingLevel, ["off", "low", "medium", "high", "xhigh"], "off"),
          notifications: oneOf(st.notifications, ["off", "bell", "system", "both"], "off"),
          smartEditing: st.smartEditing !== false
        }
      };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error reading controller session state");
    }
  }
});
var LIST_AGENT_CONTROLLER_MODES_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "GET",
  path: "/agent-controller/:controllerId/modes",
  responseType: "json",
  pathParamSchema: controllerIdPathParams,
  responseSchema: listModesResponseSchema,
  summary: "List controller modes",
  description: "Lists the modes configured on the controller (e.g. build, plan).",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:read",
  handler: async ({ mastra, controllerId }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      return {
        modes: controller.listModes().map((mode) => ({ id: mode.id, name: mode.name }))
      };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error listing controller modes");
    }
  }
});
var LIST_AGENT_CONTROLLER_THREADS_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "GET",
  path: "/agent-controller/:controllerId/sessions/:resourceId/threads",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  queryParamSchema: listThreadsQuerySchema,
  responseSchema: listThreadsResponseSchema,
  summary: "List session threads",
  description: "Lists the threads for the session\u2019s resource, most-recently-updated first. Pass `limit` to return only the newest N (e.g. for a sidebar). Pass `tags` (a JSON-encoded object) to scope the list to threads matching every tag \u2014 e.g. `{ projectPath }` so git worktrees sharing a resourceId each see only their own threads.",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:read",
  handler: async ({ mastra, controllerId, resourceId, limit, tags }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      const threads = await session.thread.list();
      const getTags = (t) => {
        const metadata = t.metadata ?? {};
        const result = {};
        for (const [key, value] of Object.entries(metadata)) {
          if (typeof value === "string" && !isReservedThreadMetadataKey(key)) result[key] = value;
        }
        return result;
      };
      const tagEntries = tags ? Object.entries(tags).filter(([key]) => !isReservedThreadMetadataKey(key)) : [];
      const scoped = tagEntries.length > 0 ? threads.filter((t) => {
        const metadata = t.metadata ?? {};
        return tagEntries.every(([key, value]) => metadata[key] === value);
      }) : threads;
      const toTime = (t) => (t.updatedAt ?? t.createdAt)?.getTime() ?? 0;
      const sorted = [...scoped].sort((a, b) => toTime(b) - toTime(a));
      const max = Number(limit);
      const limited = Number.isFinite(max) && max > 0 ? sorted.slice(0, max) : sorted;
      return {
        threads: limited.map((t) => {
          const threadTags = getTags(t);
          return {
            id: t.id,
            title: t.title,
            tags: Object.keys(threadTags).length > 0 ? threadTags : void 0,
            updatedAt: t.updatedAt instanceof Date ? t.updatedAt.toISOString() : void 0
          };
        })
      };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error listing controller threads");
    }
  }
});
var SEND_AGENT_CONTROLLER_NOTIFICATION_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "POST",
  path: "/agent-controller/:controllerId/sessions/:resourceId/notifications",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: sendNotificationBodySchema,
  responseSchema: v4.z.object({
    accepted: v4.z.boolean(),
    notificationId: v4.z.string().optional(),
    decision: v4.z.string().optional(),
    runId: v4.z.string().optional()
  }),
  summary: "Send a notification signal to a session",
  description: "Delivers a notification to the session\u2019s current agent/thread. The agent\u2019s delivery policy determines whether the notification wakes an idle thread, is summarised, or is persisted for later.",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({
    mastra,
    controllerId,
    resourceId,
    source,
    kind,
    summary,
    priority,
    payload,
    sourceId,
    dedupeKey,
    coalesceKey,
    attributes,
    metadata
  }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      const result = await session.sendNotificationSignal({
        source,
        kind,
        summary,
        priority,
        payload,
        sourceId,
        dedupeKey,
        coalesceKey,
        attributes,
        metadata
      });
      return {
        accepted: result.accepted !== void 0,
        notificationId: result.record?.id,
        decision: result.decision?.action,
        runId: result.runId
      };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error sending controller notification");
    }
  }
});
var CREATE_AGENT_CONTROLLER_THREAD_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "POST",
  path: "/agent-controller/:controllerId/sessions/:resourceId/threads",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: createThreadBodySchema,
  responseSchema: threadResponseSchema,
  summary: "Create a new thread",
  description: "Creates a new thread in the session (unbinds the previous thread, binds the new one).",
  tags: ["AgentController", "Threads"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, title }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      const thread = await session.thread.create({ title });
      return {
        id: thread.id,
        title: thread.title,
        resourceId: thread.resourceId,
        createdAt: thread.createdAt instanceof Date ? thread.createdAt.toISOString() : void 0,
        updatedAt: thread.updatedAt instanceof Date ? thread.updatedAt.toISOString() : void 0
      };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error creating controller thread");
    }
  }
});
var DELETE_AGENT_CONTROLLER_THREAD_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "DELETE",
  path: "/agent-controller/:controllerId/sessions/:resourceId/threads/:threadId",
  responseType: "json",
  pathParamSchema: threadPathParams,
  responseSchema: ackResponseSchema,
  summary: "Delete a thread",
  description: "Deletes a thread. If the deleted thread is the active one, the session is unbound.",
  tags: ["AgentController", "Threads"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, threadId }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      await session.thread.delete({ threadId });
      return { ok: true };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error deleting controller thread");
    }
  }
});
var RENAME_AGENT_CONTROLLER_THREAD_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "PUT",
  path: "/agent-controller/:controllerId/sessions/:resourceId/threads/:threadId",
  responseType: "json",
  pathParamSchema: threadPathParams,
  bodySchema: renameThreadBodySchema,
  responseSchema: ackResponseSchema,
  summary: "Rename a thread",
  description: "Renames the specified thread.",
  tags: ["AgentController", "Threads"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, threadId, title }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      if (session.thread.getId() !== threadId) {
        await session.thread.switch({ threadId });
      }
      await session.thread.rename({ title });
      return { ok: true };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error renaming controller thread");
    }
  }
});
var CLONE_AGENT_CONTROLLER_THREAD_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "POST",
  path: "/agent-controller/:controllerId/sessions/:resourceId/threads/clone",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: cloneThreadBodySchema,
  responseSchema: threadResponseSchema,
  summary: "Clone a thread",
  description: "Clones a thread (and its messages). The session binds to the new clone.",
  tags: ["AgentController", "Threads"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, sourceThreadId, title }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      const thread = await session.thread.clone({ sourceThreadId, title });
      return {
        id: thread.id,
        title: thread.title,
        resourceId: thread.resourceId,
        createdAt: thread.createdAt instanceof Date ? thread.createdAt.toISOString() : void 0,
        updatedAt: thread.updatedAt instanceof Date ? thread.updatedAt.toISOString() : void 0
      };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error cloning controller thread");
    }
  }
});
var LIST_AGENT_CONTROLLER_THREAD_MESSAGES_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "GET",
  path: "/agent-controller/:controllerId/sessions/:resourceId/threads/:threadId/messages",
  responseType: "json",
  pathParamSchema: threadPathParams,
  queryParamSchema: listMessagesQuerySchema,
  responseSchema: listMessagesResponseSchema,
  summary: "List thread messages",
  description: "Lists messages for a specific thread. Returns most recent messages first.",
  tags: ["AgentController", "Threads"],
  requiresAuth: true,
  requiresPermission: "agent-controller:read",
  handler: async ({ mastra, controllerId, resourceId, threadId, limit }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      const messages = await session.thread.listMessages({ threadId, limit });
      return {
        messages: messages.map((m) => ({
          id: m.id,
          role: m.role,
          content: m.content,
          createdAt: m.createdAt instanceof Date ? m.createdAt.toISOString() : void 0
        }))
      };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error listing controller thread messages");
    }
  }
});
var FOLLOW_UP_AGENT_CONTROLLER_SESSION_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "POST",
  path: "/agent-controller/:controllerId/sessions/:resourceId/follow-up",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: followUpBodySchema,
  responseSchema: ackResponseSchema,
  summary: "Queue a follow-up message",
  description: "Queues a follow-up message. If the session is idle it sends immediately; if a run is active it queues for after completion.",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, message }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      void session.followUp({ content: message });
      return { ok: true };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error queuing controller follow-up");
    }
  }
});
var LIST_AGENT_CONTROLLER_MODELS_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "GET",
  path: "/agent-controller/:controllerId/models",
  responseType: "json",
  pathParamSchema: controllerIdPathParams,
  responseSchema: listModelsResponseSchema,
  summary: "List available models",
  description: "Lists all models available on this controller (with auth status and use counts).",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:read",
  handler: async ({ mastra, controllerId }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      await controller.init();
      const models = await controller.listAvailableModels();
      return {
        models: models.map((m) => ({
          id: m.id,
          provider: m.provider,
          modelName: m.modelName,
          hasApiKey: m.hasApiKey,
          useCount: m.useCount
        }))
      };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error listing controller models");
    }
  }
});
var GET_AGENT_CONTROLLER_WORKSPACE_STATUS_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "GET",
  path: "/agent-controller/:controllerId/workspace",
  responseType: "json",
  pathParamSchema: controllerIdPathParams,
  responseSchema: workspaceStatusResponseSchema,
  summary: "Get workspace status",
  description: "Returns whether the controller has a workspace configured and whether it is ready.",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:read",
  handler: async ({ mastra, controllerId }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      await controller.init();
      return {
        hasWorkspace: controller.hasWorkspace(),
        isReady: controller.isWorkspaceReady()
      };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error reading controller workspace status");
    }
  }
});
var GET_AGENT_CONTROLLER_OM_RECORD_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "GET",
  path: "/agent-controller/:controllerId/sessions/:resourceId/om",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  responseSchema: omRecordResponseSchema,
  summary: "Get observational memory record",
  description: "Returns the current observational memory record for the session\u2019s thread/resource.",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:read",
  handler: async ({ mastra, controllerId, resourceId }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      const record = await controller.getObservationalMemoryRecord(session);
      return { record: record ?? void 0 };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error reading controller OM record");
    }
  }
});
var SET_AGENT_CONTROLLER_RESOURCE_ID_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "POST",
  path: "/agent-controller/:controllerId/sessions/:resourceId/resource",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: v4.z.object({ newResourceId: v4.z.string() }),
  responseSchema: ackResponseSchema,
  summary: "Change the session resource ID",
  description: "Updates the session\u2019s resource identity (e.g. when a user logs in).",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, newResourceId }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      await controller.setResourceId(session, { resourceId: newResourceId });
      return { ok: true };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error setting controller resource ID");
    }
  }
});
var GET_AGENT_CONTROLLER_RESOURCE_IDS_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "GET",
  path: "/agent-controller/:controllerId/sessions/:resourceId/resources",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  responseSchema: v4.z.object({ resourceIds: v4.z.array(v4.z.string()) }),
  summary: "Get known resource IDs",
  description: "Lists the resource IDs known to this session (from threads).",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:read",
  handler: async ({ mastra, controllerId, resourceId }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      const resourceIds = await controller.getKnownResourceIds(session);
      return { resourceIds };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error listing controller resource IDs");
    }
  }
});
var setGoalBodySchema = v4.z.object({
  objective: v4.z.string(),
  judgeModelId: v4.z.string().optional(),
  maxRuns: v4.z.number().optional()
});
var updateGoalBodySchema = v4.z.object({
  judgeModelId: v4.z.string().optional(),
  maxRuns: v4.z.number().optional(),
  status: v4.z.enum(["active", "paused", "done"]).optional()
});
var goalRecordSchema = v4.z.object({
  id: v4.z.string().optional(),
  objective: v4.z.string(),
  status: v4.z.enum(["active", "paused", "done"]),
  runsUsed: v4.z.number(),
  maxRuns: v4.z.number().optional(),
  judgeModelId: v4.z.string().optional(),
  startedAt: v4.z.number(),
  updatedAt: v4.z.number(),
  pausedReason: v4.z.string().optional()
});
var goalResponseSchema = v4.z.object({ goal: goalRecordSchema.optional() });
function getAgentForSession(controller, session) {
  return controller.getCurrentAgent(session);
}
var GET_AGENT_CONTROLLER_GOAL_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "GET",
  path: "/agent-controller/:controllerId/sessions/:resourceId/goal",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  responseSchema: goalResponseSchema,
  summary: "Get the current goal",
  description: "Returns the active/paused/done goal objective for the session\u2019s thread, if any.",
  tags: ["AgentController", "Goals"],
  requiresAuth: true,
  requiresPermission: "agent-controller:read",
  handler: async ({ mastra, controllerId, resourceId }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      const threadId = session.thread.getId();
      if (!threadId) return { goal: void 0 };
      const agent = getAgentForSession(controller, session);
      const record = await agent.getObjective({ threadId });
      return { goal: record ?? void 0 };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error reading controller goal");
    }
  }
});
var SET_AGENT_CONTROLLER_GOAL_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "POST",
  path: "/agent-controller/:controllerId/sessions/:resourceId/goal",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: setGoalBodySchema,
  responseSchema: goalResponseSchema,
  summary: "Set a goal",
  description: "Sets a new objective for the session\u2019s thread. The agent\u2019s in-loop goal judge evaluates progress after each turn.",
  tags: ["AgentController", "Goals"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, objective, judgeModelId, maxRuns }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      const threadId = session.thread.getId();
      if (!threadId) throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "session has no active thread" });
      const agent = getAgentForSession(controller, session);
      const record = await agent.setObjective(objective, {
        threadId,
        resourceId: session.identity.getResourceId(),
        ...judgeModelId ? { judgeModelId } : {},
        ...maxRuns != null ? { maxRuns } : {}
      });
      return { goal: record ?? void 0 };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error setting controller goal");
    }
  }
});
var UPDATE_AGENT_CONTROLLER_GOAL_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "PUT",
  path: "/agent-controller/:controllerId/sessions/:resourceId/goal",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: updateGoalBodySchema,
  responseSchema: goalResponseSchema,
  summary: "Update goal options",
  description: "Updates the judge model, max runs, or status of the active goal. No-op when no goal is set.",
  tags: ["AgentController", "Goals"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, judgeModelId, maxRuns, status }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      const threadId = session.thread.getId();
      if (!threadId) throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "session has no active thread" });
      const agent = getAgentForSession(controller, session);
      const record = await agent.updateObjectiveOptions({
        threadId,
        ...judgeModelId !== void 0 ? { judgeModelId } : {},
        ...maxRuns !== void 0 ? { maxRuns } : {},
        ...status !== void 0 ? { status } : {}
      });
      return { goal: record ?? void 0 };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error updating controller goal");
    }
  }
});
var CLEAR_AGENT_CONTROLLER_GOAL_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "DELETE",
  path: "/agent-controller/:controllerId/sessions/:resourceId/goal",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  responseSchema: ackResponseSchema,
  summary: "Clear the goal",
  description: "Removes the active goal from the session\u2019s thread.",
  tags: ["AgentController", "Goals"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      const threadId = session.thread.getId();
      if (!threadId) throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "session has no active thread" });
      const agent = getAgentForSession(controller, session);
      await agent.clearObjective({ threadId });
      return { ok: true };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error clearing controller goal");
    }
  }
});
var GET_AGENT_CONTROLLER_PERMISSIONS_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "GET",
  path: "/agent-controller/:controllerId/sessions/:resourceId/permissions",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  responseSchema: permissionRulesResponseSchema,
  summary: "Get permission rules",
  description: "Returns the current permission rules (per-category and per-tool policies) for the session.",
  tags: ["AgentController", "Permissions"],
  requiresAuth: true,
  requiresPermission: "agent-controller:read",
  handler: async ({ mastra, controllerId, resourceId }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      const rules = session.permissions.getRules();
      return {
        categories: rules.categories,
        tools: rules.tools
      };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error getting controller permissions");
    }
  }
});
var SET_AGENT_CONTROLLER_CATEGORY_PERMISSION_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "PUT",
  path: "/agent-controller/:controllerId/sessions/:resourceId/permissions/category",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: setCategoryPermissionBodySchema,
  responseSchema: ackResponseSchema,
  summary: "Set permission for a tool category",
  description: "Sets the approval policy (allow/ask/deny) for all tools in a category.",
  tags: ["AgentController", "Permissions"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, category, policy }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      await session.permissions.setForCategory({ category, policy });
      return { ok: true };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error setting controller category permission");
    }
  }
});
var SET_AGENT_CONTROLLER_TOOL_PERMISSION_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "PUT",
  path: "/agent-controller/:controllerId/sessions/:resourceId/permissions/tool",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: setToolPermissionBodySchema,
  responseSchema: ackResponseSchema,
  summary: "Set permission for a specific tool",
  description: "Sets the approval policy (allow/ask/deny) for a specific tool by name. Per-tool overrides take precedence over category policies.",
  tags: ["AgentController", "Permissions"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, toolName, policy }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      await session.permissions.setForTool({ toolName, policy });
      return { ok: true };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error setting controller tool permission");
    }
  }
});
var setSessionStateBodySchema = v4.z.object({ state: v4.z.record(v4.z.string(), v4.z.unknown()) });
var SET_AGENT_CONTROLLER_SESSION_STATE_ROUTE = chunkN54Q3AQR_cjs.createRoute({
  method: "PUT",
  path: "/agent-controller/:controllerId/sessions/:resourceId/state",
  responseType: "json",
  pathParamSchema: sessionPathParams,
  bodySchema: setSessionStateBodySchema,
  responseSchema: ackResponseSchema,
  summary: "Set session state",
  description: "Merges the provided key-value pairs into the session state. Existing keys not in the payload are preserved.",
  tags: ["AgentController"],
  requiresAuth: true,
  requiresPermission: "agent-controller:execute",
  handler: async ({ mastra, controllerId, resourceId, state }) => {
    try {
      const controller = getAgentControllerOrThrow(mastra, controllerId);
      const session = await getSession(controller, resourceId);
      await session.state.set(state);
      return { ok: true };
    } catch (error) {
      return chunkZ7LCIYK7_cjs.handleError(error, "error setting controller session state");
    }
  }
});

exports.ABORT_AGENT_CONTROLLER_SESSION_ROUTE = ABORT_AGENT_CONTROLLER_SESSION_ROUTE;
exports.AGENT_CONTROLLER_TOOL_APPROVAL_ROUTE = AGENT_CONTROLLER_TOOL_APPROVAL_ROUTE;
exports.AGENT_CONTROLLER_TOOL_SUSPENSION_ROUTE = AGENT_CONTROLLER_TOOL_SUSPENSION_ROUTE;
exports.CLEAR_AGENT_CONTROLLER_GOAL_ROUTE = CLEAR_AGENT_CONTROLLER_GOAL_ROUTE;
exports.CLONE_AGENT_CONTROLLER_THREAD_ROUTE = CLONE_AGENT_CONTROLLER_THREAD_ROUTE;
exports.CREATE_AGENT_CONTROLLER_SESSION_ROUTE = CREATE_AGENT_CONTROLLER_SESSION_ROUTE;
exports.CREATE_AGENT_CONTROLLER_THREAD_ROUTE = CREATE_AGENT_CONTROLLER_THREAD_ROUTE;
exports.DELETE_AGENT_CONTROLLER_THREAD_ROUTE = DELETE_AGENT_CONTROLLER_THREAD_ROUTE;
exports.FOLLOW_UP_AGENT_CONTROLLER_SESSION_ROUTE = FOLLOW_UP_AGENT_CONTROLLER_SESSION_ROUTE;
exports.GET_AGENT_CONTROLLER_GOAL_ROUTE = GET_AGENT_CONTROLLER_GOAL_ROUTE;
exports.GET_AGENT_CONTROLLER_OM_RECORD_ROUTE = GET_AGENT_CONTROLLER_OM_RECORD_ROUTE;
exports.GET_AGENT_CONTROLLER_PERMISSIONS_ROUTE = GET_AGENT_CONTROLLER_PERMISSIONS_ROUTE;
exports.GET_AGENT_CONTROLLER_RESOURCE_IDS_ROUTE = GET_AGENT_CONTROLLER_RESOURCE_IDS_ROUTE;
exports.GET_AGENT_CONTROLLER_SESSION_STATE_ROUTE = GET_AGENT_CONTROLLER_SESSION_STATE_ROUTE;
exports.GET_AGENT_CONTROLLER_WORKSPACE_STATUS_ROUTE = GET_AGENT_CONTROLLER_WORKSPACE_STATUS_ROUTE;
exports.LIST_AGENT_CONTROLLERS_ROUTE = LIST_AGENT_CONTROLLERS_ROUTE;
exports.LIST_AGENT_CONTROLLER_MODELS_ROUTE = LIST_AGENT_CONTROLLER_MODELS_ROUTE;
exports.LIST_AGENT_CONTROLLER_MODES_ROUTE = LIST_AGENT_CONTROLLER_MODES_ROUTE;
exports.LIST_AGENT_CONTROLLER_THREADS_ROUTE = LIST_AGENT_CONTROLLER_THREADS_ROUTE;
exports.LIST_AGENT_CONTROLLER_THREAD_MESSAGES_ROUTE = LIST_AGENT_CONTROLLER_THREAD_MESSAGES_ROUTE;
exports.RENAME_AGENT_CONTROLLER_THREAD_ROUTE = RENAME_AGENT_CONTROLLER_THREAD_ROUTE;
exports.SEND_AGENT_CONTROLLER_MESSAGE_ROUTE = SEND_AGENT_CONTROLLER_MESSAGE_ROUTE;
exports.SEND_AGENT_CONTROLLER_NOTIFICATION_ROUTE = SEND_AGENT_CONTROLLER_NOTIFICATION_ROUTE;
exports.SET_AGENT_CONTROLLER_CATEGORY_PERMISSION_ROUTE = SET_AGENT_CONTROLLER_CATEGORY_PERMISSION_ROUTE;
exports.SET_AGENT_CONTROLLER_GOAL_ROUTE = SET_AGENT_CONTROLLER_GOAL_ROUTE;
exports.SET_AGENT_CONTROLLER_RESOURCE_ID_ROUTE = SET_AGENT_CONTROLLER_RESOURCE_ID_ROUTE;
exports.SET_AGENT_CONTROLLER_SESSION_STATE_ROUTE = SET_AGENT_CONTROLLER_SESSION_STATE_ROUTE;
exports.SET_AGENT_CONTROLLER_TOOL_PERMISSION_ROUTE = SET_AGENT_CONTROLLER_TOOL_PERMISSION_ROUTE;
exports.STEER_AGENT_CONTROLLER_SESSION_ROUTE = STEER_AGENT_CONTROLLER_SESSION_ROUTE;
exports.STREAM_AGENT_CONTROLLER_SESSION_ROUTE = STREAM_AGENT_CONTROLLER_SESSION_ROUTE;
exports.SWITCH_AGENT_CONTROLLER_MODEL_ROUTE = SWITCH_AGENT_CONTROLLER_MODEL_ROUTE;
exports.SWITCH_AGENT_CONTROLLER_MODE_ROUTE = SWITCH_AGENT_CONTROLLER_MODE_ROUTE;
exports.SWITCH_AGENT_CONTROLLER_THREAD_ROUTE = SWITCH_AGENT_CONTROLLER_THREAD_ROUTE;
exports.UPDATE_AGENT_CONTROLLER_GOAL_ROUTE = UPDATE_AGENT_CONTROLLER_GOAL_ROUTE;
//# sourceMappingURL=chunk-57BKC4ZW.cjs.map
//# sourceMappingURL=chunk-57BKC4ZW.cjs.map