import { FAVORITE_STORED_SKILL_ROUTE, UNFAVORITE_STORED_SKILL_ROUTE } from './chunk-P5NXUYGE.js';
import { LIST_STORED_SKILLS_ROUTE, GET_STORED_SKILL_ROUTE, CREATE_STORED_SKILL_ROUTE, UPDATE_STORED_SKILL_ROUTE, DELETE_STORED_SKILL_ROUTE, PUBLISH_STORED_SKILL_ROUTE } from './chunk-EZWVRD45.js';
import { LIST_STORED_WORKSPACES_ROUTE, GET_STORED_WORKSPACE_ROUTE, CREATE_STORED_WORKSPACE_ROUTE, UPDATE_STORED_WORKSPACE_ROUTE, DELETE_STORED_WORKSPACE_ROUTE } from './chunk-H7UZ44VA.js';
import { GET_SYSTEM_PACKAGES_ROUTE, GET_API_SCHEMA_ROUTE } from './chunk-7RFYUCSO.js';
import { LIST_TOOL_PROVIDERS_ROUTE, LIST_TOOL_PROVIDER_TOOLKITS_ROUTE, LIST_TOOL_PROVIDER_TOOLS_ROUTE, GET_TOOL_PROVIDER_TOOL_SCHEMA_ROUTE, AUTHORIZE_TOOL_PROVIDER_ROUTE, GET_TOOL_PROVIDER_AUTH_STATUS_ROUTE, TOOL_PROVIDER_CONNECTION_STATUS_ROUTE, LIST_TOOL_PROVIDER_CONNECTIONS_ROUTE, LIST_TOOL_PROVIDER_CONNECTION_FIELDS_ROUTE, DISCONNECT_TOOL_PROVIDER_CONNECTION_ROUTE, UPDATE_TOOL_PROVIDER_CONNECTION_ROUTE, GET_TOOL_PROVIDER_CONNECTION_USAGE_ROUTE, GET_TOOL_PROVIDER_HEALTH_ROUTE } from './chunk-POM4VGLJ.js';
import { LIST_SCORER_VERSIONS_ROUTE, CREATE_SCORER_VERSION_ROUTE, COMPARE_SCORER_VERSIONS_ROUTE, GET_SCORER_VERSION_ROUTE, ACTIVATE_SCORER_VERSION_ROUTE, RESTORE_SCORER_VERSION_ROUTE, DELETE_SCORER_VERSION_ROUTE } from './chunk-BALLHDVH.js';
import { FAVORITE_STORED_AGENT_ROUTE, UNFAVORITE_STORED_AGENT_ROUTE } from './chunk-Z5YBWU6K.js';
import { LIST_STORED_AGENTS_ROUTE, PREVIEW_INSTRUCTIONS_ROUTE, GET_STORED_AGENT_DEPENDENTS_ROUTE, EXPORT_STORED_AGENT_ROUTE, OPEN_STORED_AGENT_CHANGE_REQUEST_ROUTE, GET_STORED_AGENT_ROUTE, CREATE_STORED_AGENT_ROUTE, UPDATE_STORED_AGENT_ROUTE, DELETE_STORED_AGENT_ROUTE } from './chunk-DAMJJAHO.js';
import { LIST_STORED_MCP_CLIENTS_ROUTE, GET_STORED_MCP_CLIENT_ROUTE, CREATE_STORED_MCP_CLIENT_ROUTE, UPDATE_STORED_MCP_CLIENT_ROUTE, DELETE_STORED_MCP_CLIENT_ROUTE } from './chunk-7ICIPSVS.js';
import { LIST_STORED_PROMPT_BLOCKS_ROUTE, GET_STORED_PROMPT_BLOCK_ROUTE, CREATE_STORED_PROMPT_BLOCK_ROUTE, UPDATE_STORED_PROMPT_BLOCK_ROUTE, DELETE_STORED_PROMPT_BLOCK_ROUTE } from './chunk-KRZJLGGN.js';
import { LIST_STORED_SCORERS_ROUTE, GET_STORED_SCORER_ROUTE, CREATE_STORED_SCORER_ROUTE, UPDATE_STORED_SCORER_ROUTE, DELETE_STORED_SCORER_ROUTE } from './chunk-YAB4SRG2.js';
import { LIST_PROCESSOR_PROVIDERS_ROUTE, GET_PROCESSOR_PROVIDER_ROUTE } from './chunk-YBVHGMK4.js';
import { LIST_PROCESSORS_ROUTE, GET_PROCESSOR_BY_ID_ROUTE, EXECUTE_PROCESSOR_ROUTE } from './chunk-LBY32Z7C.js';
import { LIST_PROMPT_BLOCK_VERSIONS_ROUTE, CREATE_PROMPT_BLOCK_VERSION_ROUTE, COMPARE_PROMPT_BLOCK_VERSIONS_ROUTE, GET_PROMPT_BLOCK_VERSION_ROUTE, ACTIVATE_PROMPT_BLOCK_VERSION_ROUTE, RESTORE_PROMPT_BLOCK_VERSION_ROUTE, DELETE_PROMPT_BLOCK_VERSION_ROUTE } from './chunk-LZJM4JTY.js';
import { LIST_SCHEDULES_ROUTE, GET_SCHEDULE_ROUTE, LIST_SCHEDULE_TRIGGERS_ROUTE, PAUSE_SCHEDULE_ROUTE, RESUME_SCHEDULE_ROUTE } from './chunk-RCXVCPAD.js';
import { LIST_MCP_CLIENT_VERSIONS_ROUTE, CREATE_MCP_CLIENT_VERSION_ROUTE, COMPARE_MCP_CLIENT_VERSIONS_ROUTE, GET_MCP_CLIENT_VERSION_ROUTE, ACTIVATE_MCP_CLIENT_VERSION_ROUTE, RESTORE_MCP_CLIENT_VERSION_ROUTE, DELETE_MCP_CLIENT_VERSION_ROUTE } from './chunk-6ZQIEZFG.js';
import { LIST_DATASETS_ROUTE, CREATE_DATASET_ROUTE, GET_DATASET_ROUTE, UPDATE_DATASET_ROUTE, DELETE_DATASET_ROUTE, LIST_ITEMS_ROUTE, ADD_ITEM_ROUTE, BATCH_INSERT_ITEMS_ROUTE, BATCH_DELETE_ITEMS_ROUTE, GET_ITEM_ROUTE, UPDATE_ITEM_ROUTE, DELETE_ITEM_ROUTE, LIST_DATASET_VERSIONS_ROUTE, LIST_ITEM_VERSIONS_ROUTE, GET_ITEM_VERSION_ROUTE, LIST_ALL_EXPERIMENTS_ROUTE, EXPERIMENT_REVIEW_SUMMARY_ROUTE, LIST_EXPERIMENTS_ROUTE, TRIGGER_EXPERIMENT_ROUTE, GET_EXPERIMENT_ROUTE, LIST_EXPERIMENT_RESULTS_ROUTE, UPDATE_EXPERIMENT_RESULT_ROUTE, COMPARE_EXPERIMENTS_ROUTE, GENERATE_ITEMS_ROUTE, CLUSTER_FAILURES_ROUTE } from './chunk-XFAG2VCC.js';
import { GET_EDITOR_BUILDER_SETTINGS_ROUTE, GET_EDITOR_BUILDER_AVAILABLE_MODELS_ROUTE, GET_INFRASTRUCTURE_STATUS_ROUTE } from './chunk-M6GURVJO.js';
import { LIST_HEARTBEATS_ROUTE, GET_HEARTBEAT_ROUTE, CREATE_HEARTBEAT_ROUTE, UPDATE_HEARTBEAT_ROUTE, DELETE_HEARTBEAT_ROUTE, PAUSE_HEARTBEAT_ROUTE, RESUME_HEARTBEAT_ROUTE, RUN_HEARTBEAT_ROUTE } from './chunk-4DVFBBKV.js';
import { LIST_AGENT_VERSIONS_ROUTE, CREATE_AGENT_VERSION_ROUTE, COMPARE_AGENT_VERSIONS_ROUTE, GET_AGENT_VERSION_ROUTE, ACTIVATE_AGENT_VERSION_ROUTE, RESTORE_AGENT_VERSION_ROUTE, DELETE_AGENT_VERSION_ROUTE } from './chunk-ET6QFYJQ.js';
import { BACKGROUND_TASK_STREAM_ROUTE, LIST_BACKGROUND_TASKS_ROUTE, GET_BACKGROUND_TASK_ROUTE } from './chunk-S2JGT2GI.js';
import { LIST_BUILDER_REGISTRIES_ROUTE, BUILDER_REGISTRY_SEARCH_ROUTE, BUILDER_REGISTRY_POPULAR_ROUTE, BUILDER_REGISTRY_PREVIEW_ROUTE, BUILDER_REGISTRY_INSTALL_ROUTE } from './chunk-ERCBJA5A.js';
import { LIST_CHANNEL_PLATFORMS_ROUTE, LIST_CHANNEL_INSTALLATIONS_ROUTE, CONNECT_CHANNEL_ROUTE, DISCONNECT_CHANNEL_ROUTE } from './chunk-Z5DHV2QW.js';
import { UPSERT_VECTORS_ROUTE, CREATE_INDEX_ROUTE, QUERY_VECTORS_ROUTE, LIST_INDEXES_ROUTE, DESCRIBE_INDEX_ROUTE, DELETE_INDEX_ROUTE, LIST_VECTORS_ROUTE, LIST_EMBEDDERS_ROUTE } from './chunk-DRIJ6W3Z.js';
import { GET_SPEAKERS_ROUTE, GET_SPEAKERS_DEPRECATED_ROUTE, GENERATE_SPEECH_ROUTE, GENERATE_SPEECH_DEPRECATED_ROUTE, TRANSCRIBE_SPEECH_ROUTE, TRANSCRIBE_SPEECH_DEPRECATED_ROUTE, GET_LISTENER_ROUTE } from './chunk-LQZHT5U7.js';
import { LIST_WORKSPACES_ROUTE, GET_WORKSPACE_ROUTE, WORKSPACE_FS_ROUTES, WORKSPACE_SEARCH_ROUTES, WORKSPACE_SKILLS_ROUTES, WORKSPACE_SKILLS_SH_ROUTES } from './chunk-NUPNOKI2.js';
import { EXECUTE_AGENT_TOOL_ROUTE, GET_AGENT_TOOL_ROUTE, LIST_TOOLS_ROUTE, GET_TOOL_BY_ID_ROUTE, EXECUTE_TOOL_ROUTE } from './chunk-UZQ2ZJUF.js';
import { LIST_SCORERS_ROUTE, GET_SCORER_ROUTE, LIST_SCORES_BY_RUN_ID_ROUTE, LIST_SCORES_BY_SCORER_ID_ROUTE, LIST_SCORES_BY_ENTITY_ID_ROUTE, SAVE_SCORE_ROUTE } from './chunk-2B3T4FDQ.js';
import { CREATE_RESPONSE_ROUTE, GET_RESPONSE_ROUTE, DELETE_RESPONSE_ROUTE } from './chunk-W5Q374VQ.js';
import { LIST_MCP_SERVERS_ROUTE, GET_MCP_SERVER_DETAIL_ROUTE, LIST_MCP_SERVER_TOOLS_ROUTE, GET_MCP_SERVER_TOOL_DETAIL_ROUTE, EXECUTE_MCP_SERVER_TOOL_ROUTE, LIST_MCP_SERVER_RESOURCES_ROUTE, READ_MCP_SERVER_RESOURCE_ROUTE, MCP_HTTP_TRANSPORT_ROUTE, MCP_SSE_TRANSPORT_ROUTE, MCP_SSE_MESSAGES_ROUTE } from './chunk-3VNAOZ3S.js';
import { GET_MEMORY_STATUS_ROUTE, GET_MEMORY_CONFIG_ROUTE, GET_OBSERVATIONAL_MEMORY_ROUTE, AWAIT_BUFFER_STATUS_ROUTE, LIST_THREADS_ROUTE, GET_THREAD_BY_ID_ROUTE, LIST_MESSAGES_ROUTE, GET_WORKING_MEMORY_ROUTE, SAVE_MESSAGES_ROUTE, CREATE_THREAD_ROUTE, UPDATE_THREAD_ROUTE, DELETE_THREAD_ROUTE, CLONE_THREAD_ROUTE, UPDATE_WORKING_MEMORY_ROUTE, DELETE_MESSAGES_ROUTE, SEARCH_MEMORY_ROUTE, GET_MEMORY_STATUS_NETWORK_ROUTE, LIST_THREADS_NETWORK_ROUTE, GET_THREAD_BY_ID_NETWORK_ROUTE, LIST_MESSAGES_NETWORK_ROUTE, SAVE_MESSAGES_NETWORK_ROUTE, CREATE_THREAD_NETWORK_ROUTE, UPDATE_THREAD_NETWORK_ROUTE, DELETE_THREAD_NETWORK_ROUTE, DELETE_MESSAGES_NETWORK_ROUTE } from './chunk-GIQJF7ZM.js';
import { LIST_TRACES_ROUTE, LIST_TRACES_LIGHT_ROUTE, LIST_BRANCHES_ROUTE, GET_BRANCH_ROUTE, GET_TRACE_ROUTE, GET_TRACE_LIGHT_ROUTE, GET_SPAN_ROUTE, GET_TRACE_TRAJECTORY_ROUTE, SCORE_TRACES_ROUTE, LIST_SCORES_BY_SPAN_ROUTE } from './chunk-LLVTDE4P.js';
import { LIST_METRICS, LIST_LOGS, LIST_SCORES, CREATE_SCORE, GET_SCORE, GET_SCORE_AGGREGATE, GET_SCORE_BREAKDOWN, GET_SCORE_TIME_SERIES, GET_SCORE_PERCENTILES, LIST_FEEDBACK, CREATE_FEEDBACK, GET_FEEDBACK_AGGREGATE, GET_FEEDBACK_BREAKDOWN, GET_FEEDBACK_TIME_SERIES, GET_FEEDBACK_PERCENTILES, GET_METRIC_AGGREGATE, GET_METRIC_BREAKDOWN, GET_METRIC_TIME_SERIES, GET_METRIC_PERCENTILES, GET_METRIC_NAMES, GET_METRIC_LABEL_KEYS, GET_METRIC_LABEL_VALUES, GET_ENTITY_TYPES, GET_ENTITY_NAMES, GET_SERVICE_NAMES, GET_ENVIRONMENTS, GET_TAGS } from './chunk-Z354XOPM.js';
import { CREATE_CONVERSATION_ROUTE, GET_CONVERSATION_ROUTE, GET_CONVERSATION_ITEMS_ROUTE, DELETE_CONVERSATION_ROUTE } from './chunk-4HSM2TU2.js';
import { LIST_LOG_TRANSPORTS_ROUTE, LIST_LOGS_ROUTE, LIST_LOGS_BY_RUN_ID_ROUTE } from './chunk-JXUL45J6.js';
import { GET_AGENT_CARD_ROUTE, AGENT_EXECUTION_ROUTE } from './chunk-UY3PA3YA.js';
import { LIST_AGENTS_ROUTE, GET_PROVIDERS_ROUTE, GET_AGENT_BY_ID_ROUTE, CLONE_AGENT_ROUTE, GENERATE_AGENT_ROUTE, GENERATE_AGENT_VNEXT_ROUTE, STREAM_GENERATE_ROUTE, STREAM_UNTIL_IDLE_GENERATE_ROUTE, STREAM_GENERATE_VNEXT_DEPRECATED_ROUTE, OBSERVE_AGENT_STREAM_ROUTE, SEND_AGENT_MESSAGE_ROUTE, QUEUE_AGENT_MESSAGE_ROUTE, SEND_AGENT_SIGNAL_ROUTE, ABORT_AGENT_THREAD_ROUTE, SUBSCRIBE_AGENT_THREAD_ROUTE, APPROVE_TOOL_CALL_ROUTE, SEND_TOOL_APPROVAL_ROUTE, LIST_SUSPENDED_RUNS_ROUTE, DECLINE_TOOL_CALL_ROUTE, RESUME_STREAM_ROUTE, APPROVE_TOOL_CALL_GENERATE_ROUTE, DECLINE_TOOL_CALL_GENERATE_ROUTE, APPROVE_NETWORK_TOOL_CALL_ROUTE, DECLINE_NETWORK_TOOL_CALL_ROUTE, RESUME_STREAM_UNTIL_IDLE_ROUTE, STREAM_NETWORK_ROUTE, UPDATE_AGENT_MODEL_ROUTE, RESET_AGENT_MODEL_ROUTE, REORDER_AGENT_MODEL_LIST_ROUTE, UPDATE_AGENT_MODEL_IN_MODEL_LIST_ROUTE, ENHANCE_INSTRUCTIONS_ROUTE, GET_AGENT_SKILL_ROUTE, STREAM_VNEXT_DEPRECATED_ROUTE, STREAM_UI_MESSAGE_VNEXT_DEPRECATED_ROUTE, STREAM_UI_MESSAGE_DEPRECATED_ROUTE, GENERATE_LEGACY_ROUTE, STREAM_GENERATE_LEGACY_ROUTE } from './chunk-5NBDNR2B.js';
import { AUTH_ROUTES } from './chunk-CCT2USYM.js';
import { LIST_AGENT_BUILDER_ACTIONS_ROUTE, GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE, LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE, GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE, CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE, STREAM_AGENT_BUILDER_ACTION_ROUTE, STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE, START_ASYNC_AGENT_BUILDER_ACTION_ROUTE, START_AGENT_BUILDER_ACTION_RUN_ROUTE, OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE, OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE, RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE, RESUME_NO_WAIT_AGENT_BUILDER_ACTION_ROUTE, RESUME_AGENT_BUILDER_ACTION_ROUTE, RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE, CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE } from './chunk-ETVWGZSU.js';
import { LIST_WORKFLOWS_ROUTE, GET_WORKFLOW_BY_ID_ROUTE, LIST_WORKFLOW_RUNS_ROUTE, GET_WORKFLOW_RUN_BY_ID_ROUTE, DELETE_WORKFLOW_RUN_BY_ID_ROUTE, CREATE_WORKFLOW_RUN_ROUTE, STREAM_WORKFLOW_ROUTE, RESUME_STREAM_WORKFLOW_ROUTE, START_ASYNC_WORKFLOW_ROUTE, START_WORKFLOW_RUN_ROUTE, OBSERVE_STREAM_WORKFLOW_ROUTE, RESUME_ASYNC_WORKFLOW_ROUTE, RESUME_NO_WAIT_WORKFLOW_ROUTE, RESUME_WORKFLOW_ROUTE, CANCEL_WORKFLOW_RUN_ROUTE, TIME_TRAVEL_WORKFLOW_ROUTE, TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE, TIME_TRAVEL_STREAM_WORKFLOW_ROUTE, RESTART_WORKFLOW_ROUTE, RESTART_ASYNC_WORKFLOW_ROUTE, RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE, RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE, EXECUTE_WORKFLOW_STEP_ROUTE, RECEIVE_WORKFLOW_EVENT_ROUTE, STREAM_LEGACY_WORKFLOW_ROUTE, OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE } from './chunk-TQBIGT3Q.js';
import { LIST_AGENT_CONTROLLERS_ROUTE, LIST_AGENT_CONTROLLER_MODES_ROUTE, LIST_AGENT_CONTROLLER_MODELS_ROUTE, CREATE_AGENT_CONTROLLER_SESSION_ROUTE, GET_AGENT_CONTROLLER_SESSION_STATE_ROUTE, LIST_AGENT_CONTROLLER_THREADS_ROUTE, CREATE_AGENT_CONTROLLER_THREAD_ROUTE, DELETE_AGENT_CONTROLLER_THREAD_ROUTE, RENAME_AGENT_CONTROLLER_THREAD_ROUTE, CLONE_AGENT_CONTROLLER_THREAD_ROUTE, LIST_AGENT_CONTROLLER_THREAD_MESSAGES_ROUTE, STREAM_AGENT_CONTROLLER_SESSION_ROUTE, SEND_AGENT_CONTROLLER_MESSAGE_ROUTE, STEER_AGENT_CONTROLLER_SESSION_ROUTE, FOLLOW_UP_AGENT_CONTROLLER_SESSION_ROUTE, ABORT_AGENT_CONTROLLER_SESSION_ROUTE, AGENT_CONTROLLER_TOOL_APPROVAL_ROUTE, AGENT_CONTROLLER_TOOL_SUSPENSION_ROUTE, SWITCH_AGENT_CONTROLLER_MODE_ROUTE, SWITCH_AGENT_CONTROLLER_MODEL_ROUTE, SWITCH_AGENT_CONTROLLER_THREAD_ROUTE, SEND_AGENT_CONTROLLER_NOTIFICATION_ROUTE, GET_AGENT_CONTROLLER_WORKSPACE_STATUS_ROUTE, GET_AGENT_CONTROLLER_OM_RECORD_ROUTE, SET_AGENT_CONTROLLER_RESOURCE_ID_ROUTE, GET_AGENT_CONTROLLER_RESOURCE_IDS_ROUTE, GET_AGENT_CONTROLLER_GOAL_ROUTE, SET_AGENT_CONTROLLER_GOAL_ROUTE, UPDATE_AGENT_CONTROLLER_GOAL_ROUTE, CLEAR_AGENT_CONTROLLER_GOAL_ROUTE, GET_AGENT_CONTROLLER_PERMISSIONS_ROUTE, SET_AGENT_CONTROLLER_CATEGORY_PERMISSION_ROUTE, SET_AGENT_CONTROLLER_TOOL_PERMISSION_ROUTE, SET_AGENT_CONTROLLER_SESSION_STATE_ROUTE } from './chunk-HK4SJHYT.js';

// src/server/server-adapter/routes/permissions.ts
var METHOD_TO_ACTION = {
  GET: "read",
  POST: "write",
  // Default for POST, may be overridden to 'execute'
  PUT: "write",
  PATCH: "write",
  DELETE: "delete"
};
var EXECUTE_PATTERNS = [
  "/generate",
  "/stream",
  "/execute",
  "/start",
  "/resume",
  "/restart",
  "/cancel",
  "/approve",
  "/decline",
  "/speak",
  "/listen",
  "/query",
  "/search",
  "/observe",
  "/time-travel",
  "/enhance",
  "/clone"
];
var PUBLISH_PATTERNS = ["/publish", "/activate", "/restore"];
var STORED_RESOURCE_SEGMENTS = {
  agents: "stored-agents",
  "mcp-clients": "stored-mcp-clients",
  "prompt-blocks": "stored-prompt-blocks",
  scorers: "stored-scorers",
  skills: "stored-skills",
  workspaces: "stored-workspaces"
};
function extractResource(path) {
  const segments = path.replace(/^\//, "").split("/");
  if (segments.length === 0) {
    return null;
  }
  const firstSegment = segments[0];
  if (firstSegment === "stored" && segments[1]) {
    return STORED_RESOURCE_SEGMENTS[segments[1]] ?? null;
  }
  if (firstSegment === ".well-known") {
    return "a2a";
  }
  return firstSegment || null;
}
function deriveAction(method, path) {
  const upperMethod = method.toUpperCase();
  if (upperMethod === "POST") {
    if (path.startsWith("/stored/")) {
      const isPublishOperation = PUBLISH_PATTERNS.some((pattern) => path.endsWith(pattern));
      if (isPublishOperation) {
        return "publish";
      }
    }
    const isExecuteOperation = EXECUTE_PATTERNS.some((pattern) => path.includes(pattern));
    return isExecuteOperation ? "execute" : "write";
  }
  return METHOD_TO_ACTION[upperMethod] || "read";
}
function derivePermission(route) {
  if (route.method === "ALL") {
    return null;
  }
  const resource = extractResource(route.path);
  if (!resource) {
    return null;
  }
  const action = deriveAction(route.method, route.path);
  return `${resource}:${action}`;
}
function getEffectivePermission(route) {
  if (route.requiresAuth === false) {
    return null;
  }
  if (route.requiresPermission) {
    return route.requiresPermission;
  }
  return derivePermission(route);
}

// src/server/server-adapter/routes/a2a.ts
var A2A_ROUTES = [GET_AGENT_CARD_ROUTE, AGENT_EXECUTION_ROUTE];

// src/server/server-adapter/routes/agent-builder.ts
var AGENT_BUILDER_ROUTES = [
  LIST_AGENT_BUILDER_ACTIONS_ROUTE,
  GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE,
  LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE,
  GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE,
  CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE,
  STREAM_AGENT_BUILDER_ACTION_ROUTE,
  STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE,
  START_ASYNC_AGENT_BUILDER_ACTION_ROUTE,
  START_AGENT_BUILDER_ACTION_RUN_ROUTE,
  OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE,
  OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE,
  RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE,
  RESUME_NO_WAIT_AGENT_BUILDER_ACTION_ROUTE,
  RESUME_AGENT_BUILDER_ACTION_ROUTE,
  RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE,
  CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE
];

// src/server/server-adapter/routes/agent-controller.ts
var AGENT_CONTROLLER_ROUTES = [
  LIST_AGENT_CONTROLLERS_ROUTE,
  LIST_AGENT_CONTROLLER_MODES_ROUTE,
  LIST_AGENT_CONTROLLER_MODELS_ROUTE,
  CREATE_AGENT_CONTROLLER_SESSION_ROUTE,
  GET_AGENT_CONTROLLER_SESSION_STATE_ROUTE,
  LIST_AGENT_CONTROLLER_THREADS_ROUTE,
  CREATE_AGENT_CONTROLLER_THREAD_ROUTE,
  DELETE_AGENT_CONTROLLER_THREAD_ROUTE,
  RENAME_AGENT_CONTROLLER_THREAD_ROUTE,
  CLONE_AGENT_CONTROLLER_THREAD_ROUTE,
  LIST_AGENT_CONTROLLER_THREAD_MESSAGES_ROUTE,
  STREAM_AGENT_CONTROLLER_SESSION_ROUTE,
  SEND_AGENT_CONTROLLER_MESSAGE_ROUTE,
  STEER_AGENT_CONTROLLER_SESSION_ROUTE,
  FOLLOW_UP_AGENT_CONTROLLER_SESSION_ROUTE,
  ABORT_AGENT_CONTROLLER_SESSION_ROUTE,
  AGENT_CONTROLLER_TOOL_APPROVAL_ROUTE,
  AGENT_CONTROLLER_TOOL_SUSPENSION_ROUTE,
  SWITCH_AGENT_CONTROLLER_MODE_ROUTE,
  SWITCH_AGENT_CONTROLLER_MODEL_ROUTE,
  SWITCH_AGENT_CONTROLLER_THREAD_ROUTE,
  SEND_AGENT_CONTROLLER_NOTIFICATION_ROUTE,
  GET_AGENT_CONTROLLER_WORKSPACE_STATUS_ROUTE,
  GET_AGENT_CONTROLLER_OM_RECORD_ROUTE,
  SET_AGENT_CONTROLLER_RESOURCE_ID_ROUTE,
  GET_AGENT_CONTROLLER_RESOURCE_IDS_ROUTE,
  GET_AGENT_CONTROLLER_GOAL_ROUTE,
  SET_AGENT_CONTROLLER_GOAL_ROUTE,
  UPDATE_AGENT_CONTROLLER_GOAL_ROUTE,
  CLEAR_AGENT_CONTROLLER_GOAL_ROUTE,
  GET_AGENT_CONTROLLER_PERMISSIONS_ROUTE,
  SET_AGENT_CONTROLLER_CATEGORY_PERMISSION_ROUTE,
  SET_AGENT_CONTROLLER_TOOL_PERMISSION_ROUTE,
  SET_AGENT_CONTROLLER_SESSION_STATE_ROUTE
];

// src/server/server-adapter/routes/agents.ts
var AGENTS_ROUTES = [
  // ============================================================================
  // Agent Core Routes
  // ============================================================================
  LIST_AGENTS_ROUTE,
  GET_PROVIDERS_ROUTE,
  GET_AGENT_BY_ID_ROUTE,
  CLONE_AGENT_ROUTE,
  // ============================================================================
  // Voice Routes
  // ============================================================================
  GET_SPEAKERS_ROUTE,
  GET_SPEAKERS_DEPRECATED_ROUTE,
  // ============================================================================
  // Agent Execution Routes
  // ============================================================================
  GENERATE_AGENT_ROUTE,
  GENERATE_AGENT_VNEXT_ROUTE,
  STREAM_GENERATE_ROUTE,
  STREAM_UNTIL_IDLE_GENERATE_ROUTE,
  STREAM_GENERATE_VNEXT_DEPRECATED_ROUTE,
  // ============================================================================
  // Resumable Stream Routes
  // ============================================================================
  OBSERVE_AGENT_STREAM_ROUTE,
  SEND_AGENT_MESSAGE_ROUTE,
  QUEUE_AGENT_MESSAGE_ROUTE,
  SEND_AGENT_SIGNAL_ROUTE,
  ABORT_AGENT_THREAD_ROUTE,
  SUBSCRIBE_AGENT_THREAD_ROUTE,
  // ============================================================================
  // Tool Routes
  // ============================================================================
  EXECUTE_AGENT_TOOL_ROUTE,
  APPROVE_TOOL_CALL_ROUTE,
  SEND_TOOL_APPROVAL_ROUTE,
  LIST_SUSPENDED_RUNS_ROUTE,
  DECLINE_TOOL_CALL_ROUTE,
  RESUME_STREAM_ROUTE,
  APPROVE_TOOL_CALL_GENERATE_ROUTE,
  DECLINE_TOOL_CALL_GENERATE_ROUTE,
  APPROVE_NETWORK_TOOL_CALL_ROUTE,
  DECLINE_NETWORK_TOOL_CALL_ROUTE,
  RESUME_STREAM_UNTIL_IDLE_ROUTE,
  // ============================================================================
  // Network Routes
  // ============================================================================
  STREAM_NETWORK_ROUTE,
  // ============================================================================
  // Model Management Routes
  // ============================================================================
  UPDATE_AGENT_MODEL_ROUTE,
  RESET_AGENT_MODEL_ROUTE,
  REORDER_AGENT_MODEL_LIST_ROUTE,
  UPDATE_AGENT_MODEL_IN_MODEL_LIST_ROUTE,
  // ============================================================================
  // Instruction Enhancement Routes
  // ============================================================================
  ENHANCE_INSTRUCTIONS_ROUTE,
  // ============================================================================
  // Agent Tool Routes
  // ============================================================================
  GET_AGENT_TOOL_ROUTE,
  // ============================================================================
  // Agent Skill Routes
  // ============================================================================
  GET_AGENT_SKILL_ROUTE,
  // ============================================================================
  // Voice/Speech Routes
  // ============================================================================
  GENERATE_SPEECH_ROUTE,
  GENERATE_SPEECH_DEPRECATED_ROUTE,
  TRANSCRIBE_SPEECH_ROUTE,
  TRANSCRIBE_SPEECH_DEPRECATED_ROUTE,
  GET_LISTENER_ROUTE,
  // ============================================================================
  // Deprecated Routes
  // ============================================================================
  STREAM_VNEXT_DEPRECATED_ROUTE,
  STREAM_UI_MESSAGE_VNEXT_DEPRECATED_ROUTE,
  STREAM_UI_MESSAGE_DEPRECATED_ROUTE
];

// src/server/server-adapter/routes/background-tasks.ts
var BACKGROUND_TASK_ROUTES = [
  BACKGROUND_TASK_STREAM_ROUTE,
  LIST_BACKGROUND_TASKS_ROUTE,
  GET_BACKGROUND_TASK_ROUTE
];

// src/server/server-adapter/routes/channels.ts
var CHANNELS_ROUTES = [
  LIST_CHANNEL_PLATFORMS_ROUTE,
  LIST_CHANNEL_INSTALLATIONS_ROUTE,
  CONNECT_CHANNEL_ROUTE,
  DISCONNECT_CHANNEL_ROUTE
];

// src/server/server-adapter/routes/conversations.ts
var CONVERSATIONS_ROUTES = [
  CREATE_CONVERSATION_ROUTE,
  GET_CONVERSATION_ROUTE,
  GET_CONVERSATION_ITEMS_ROUTE,
  DELETE_CONVERSATION_ROUTE
];

// src/server/server-adapter/routes/datasets.ts
var DATASETS_ROUTES = [
  // Dataset CRUD
  LIST_DATASETS_ROUTE,
  CREATE_DATASET_ROUTE,
  GET_DATASET_ROUTE,
  UPDATE_DATASET_ROUTE,
  DELETE_DATASET_ROUTE,
  // Item list and add
  LIST_ITEMS_ROUTE,
  ADD_ITEM_ROUTE,
  // Batch operations - MUST come before item-specific routes to avoid /items/batch matching /items/:itemId
  BATCH_INSERT_ITEMS_ROUTE,
  BATCH_DELETE_ITEMS_ROUTE,
  // Item-specific CRUD (uses :itemId param)
  GET_ITEM_ROUTE,
  UPDATE_ITEM_ROUTE,
  DELETE_ITEM_ROUTE,
  // Version operations
  LIST_DATASET_VERSIONS_ROUTE,
  LIST_ITEM_VERSIONS_ROUTE,
  GET_ITEM_VERSION_ROUTE,
  // All experiments (cross-dataset) - MUST come before dataset-scoped experiments
  LIST_ALL_EXPERIMENTS_ROUTE,
  // Experiment review summary (cross-dataset) - MUST come before dataset-scoped experiments
  EXPERIMENT_REVIEW_SUMMARY_ROUTE,
  // Experiment operations (dataset-scoped)
  LIST_EXPERIMENTS_ROUTE,
  TRIGGER_EXPERIMENT_ROUTE,
  GET_EXPERIMENT_ROUTE,
  LIST_EXPERIMENT_RESULTS_ROUTE,
  UPDATE_EXPERIMENT_RESULT_ROUTE,
  // Analytics
  COMPARE_EXPERIMENTS_ROUTE,
  // AI generation
  GENERATE_ITEMS_ROUTE,
  // Failure analysis
  CLUSTER_FAILURES_ROUTE
];

// src/server/server-adapter/routes/editor-builder.ts
var EDITOR_BUILDER_ROUTES = [
  GET_EDITOR_BUILDER_SETTINGS_ROUTE,
  GET_EDITOR_BUILDER_AVAILABLE_MODELS_ROUTE,
  GET_INFRASTRUCTURE_STATUS_ROUTE,
  LIST_BUILDER_REGISTRIES_ROUTE,
  BUILDER_REGISTRY_SEARCH_ROUTE,
  BUILDER_REGISTRY_POPULAR_ROUTE,
  BUILDER_REGISTRY_PREVIEW_ROUTE,
  BUILDER_REGISTRY_INSTALL_ROUTE
];

// src/server/server-adapter/routes/heartbeats.ts
var HEARTBEATS_ROUTES = [
  LIST_HEARTBEATS_ROUTE,
  GET_HEARTBEAT_ROUTE,
  CREATE_HEARTBEAT_ROUTE,
  UPDATE_HEARTBEAT_ROUTE,
  DELETE_HEARTBEAT_ROUTE,
  PAUSE_HEARTBEAT_ROUTE,
  RESUME_HEARTBEAT_ROUTE,
  RUN_HEARTBEAT_ROUTE
];

// src/server/server-adapter/routes/legacy.ts
var LEGACY_ROUTES = [
  // ============================================================================
  // Legacy Agent Routes
  // ============================================================================
  GENERATE_LEGACY_ROUTE,
  STREAM_GENERATE_LEGACY_ROUTE,
  // ============================================================================
  // Legacy Workflow Routes
  // ============================================================================
  STREAM_LEGACY_WORKFLOW_ROUTE,
  OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE
];

// src/server/server-adapter/routes/logs.ts
var LOGS_ROUTES = [LIST_LOG_TRANSPORTS_ROUTE, LIST_LOGS_ROUTE, LIST_LOGS_BY_RUN_ID_ROUTE];

// src/server/server-adapter/routes/mcp.ts
var MCP_ROUTES = [
  // ============================================================================
  // MCP Server Registry Routes
  // ============================================================================
  LIST_MCP_SERVERS_ROUTE,
  GET_MCP_SERVER_DETAIL_ROUTE,
  // ============================================================================
  // MCP Server Tool Routes
  // ============================================================================
  LIST_MCP_SERVER_TOOLS_ROUTE,
  GET_MCP_SERVER_TOOL_DETAIL_ROUTE,
  EXECUTE_MCP_SERVER_TOOL_ROUTE,
  // ============================================================================
  // MCP Server Resource Routes
  // ============================================================================
  LIST_MCP_SERVER_RESOURCES_ROUTE,
  READ_MCP_SERVER_RESOURCE_ROUTE,
  // ============================================================================
  // MCP Transport Routes (handled by adapters)
  // ============================================================================
  MCP_HTTP_TRANSPORT_ROUTE,
  MCP_SSE_TRANSPORT_ROUTE,
  MCP_SSE_MESSAGES_ROUTE
];

// src/server/server-adapter/routes/memory.ts
var MEMORY_ROUTES = [
  GET_MEMORY_STATUS_ROUTE,
  GET_MEMORY_CONFIG_ROUTE,
  GET_OBSERVATIONAL_MEMORY_ROUTE,
  AWAIT_BUFFER_STATUS_ROUTE,
  LIST_THREADS_ROUTE,
  GET_THREAD_BY_ID_ROUTE,
  LIST_MESSAGES_ROUTE,
  GET_WORKING_MEMORY_ROUTE,
  SAVE_MESSAGES_ROUTE,
  CREATE_THREAD_ROUTE,
  UPDATE_THREAD_ROUTE,
  DELETE_THREAD_ROUTE,
  CLONE_THREAD_ROUTE,
  UPDATE_WORKING_MEMORY_ROUTE,
  DELETE_MESSAGES_ROUTE,
  SEARCH_MEMORY_ROUTE,
  GET_MEMORY_STATUS_NETWORK_ROUTE,
  LIST_THREADS_NETWORK_ROUTE,
  GET_THREAD_BY_ID_NETWORK_ROUTE,
  LIST_MESSAGES_NETWORK_ROUTE,
  SAVE_MESSAGES_NETWORK_ROUTE,
  CREATE_THREAD_NETWORK_ROUTE,
  UPDATE_THREAD_NETWORK_ROUTE,
  DELETE_THREAD_NETWORK_ROUTE,
  DELETE_MESSAGES_NETWORK_ROUTE
];

// src/server/server-adapter/routes/observability.ts
var OBSERVABILITY_ROUTES = [
  // Legacy
  LIST_TRACES_ROUTE,
  LIST_TRACES_LIGHT_ROUTE,
  LIST_BRANCHES_ROUTE,
  GET_BRANCH_ROUTE,
  GET_TRACE_ROUTE,
  GET_TRACE_LIGHT_ROUTE,
  GET_SPAN_ROUTE,
  GET_TRACE_TRAJECTORY_ROUTE,
  SCORE_TRACES_ROUTE,
  LIST_SCORES_BY_SPAN_ROUTE,
  // New observability routes
  LIST_METRICS,
  LIST_LOGS,
  LIST_SCORES,
  CREATE_SCORE,
  GET_SCORE,
  GET_SCORE_AGGREGATE,
  GET_SCORE_BREAKDOWN,
  GET_SCORE_TIME_SERIES,
  GET_SCORE_PERCENTILES,
  LIST_FEEDBACK,
  CREATE_FEEDBACK,
  GET_FEEDBACK_AGGREGATE,
  GET_FEEDBACK_BREAKDOWN,
  GET_FEEDBACK_TIME_SERIES,
  GET_FEEDBACK_PERCENTILES,
  GET_METRIC_AGGREGATE,
  GET_METRIC_BREAKDOWN,
  GET_METRIC_TIME_SERIES,
  GET_METRIC_PERCENTILES,
  GET_METRIC_NAMES,
  GET_METRIC_LABEL_KEYS,
  GET_METRIC_LABEL_VALUES,
  GET_ENTITY_TYPES,
  GET_ENTITY_NAMES,
  GET_SERVICE_NAMES,
  GET_ENVIRONMENTS,
  GET_TAGS
];

// src/server/server-adapter/routes/processor-providers.ts
var PROCESSOR_PROVIDER_ROUTES = [LIST_PROCESSOR_PROVIDERS_ROUTE, GET_PROCESSOR_PROVIDER_ROUTE];

// src/server/server-adapter/routes/processors.ts
var PROCESSORS_ROUTES = [LIST_PROCESSORS_ROUTE, GET_PROCESSOR_BY_ID_ROUTE, EXECUTE_PROCESSOR_ROUTE];

// src/server/server-adapter/routes/responses.ts
var RESPONSES_ROUTES = [CREATE_RESPONSE_ROUTE, GET_RESPONSE_ROUTE, DELETE_RESPONSE_ROUTE];

// src/server/server-adapter/routes/schedules.ts
var SCHEDULES_ROUTES = [
  LIST_SCHEDULES_ROUTE,
  GET_SCHEDULE_ROUTE,
  LIST_SCHEDULE_TRIGGERS_ROUTE,
  PAUSE_SCHEDULE_ROUTE,
  RESUME_SCHEDULE_ROUTE
];

// src/server/server-adapter/routes/scorers.ts
var SCORES_ROUTES = [
  LIST_SCORERS_ROUTE,
  GET_SCORER_ROUTE,
  LIST_SCORES_BY_RUN_ID_ROUTE,
  LIST_SCORES_BY_SCORER_ID_ROUTE,
  LIST_SCORES_BY_ENTITY_ID_ROUTE,
  SAVE_SCORE_ROUTE
];

// src/server/server-adapter/routes/stored-agents.ts
var STORED_AGENTS_ROUTES = [
  // ============================================================================
  // Stored Agents CRUD Routes
  // IMPORTANT: Routes with literal paths (e.g., /preview-instructions) must come
  // BEFORE routes with path parameters (e.g., /:storedAgentId) to ensure correct matching.
  // ============================================================================
  LIST_STORED_AGENTS_ROUTE,
  PREVIEW_INSTRUCTIONS_ROUTE,
  // Must be before GET_STORED_AGENT_ROUTE
  GET_STORED_AGENT_DEPENDENTS_ROUTE,
  // Must be before GET_STORED_AGENT_ROUTE (longer literal)
  EXPORT_STORED_AGENT_ROUTE,
  // Must be before GET_STORED_AGENT_ROUTE
  OPEN_STORED_AGENT_CHANGE_REQUEST_ROUTE,
  // Must be before GET_STORED_AGENT_ROUTE
  GET_STORED_AGENT_ROUTE,
  CREATE_STORED_AGENT_ROUTE,
  UPDATE_STORED_AGENT_ROUTE,
  DELETE_STORED_AGENT_ROUTE,
  // ============================================================================
  // Agent Versions Routes
  // IMPORTANT: Routes with literal paths (e.g., /compare) must come BEFORE
  // routes with path parameters (e.g., /:versionId) to ensure correct matching.
  // ============================================================================
  LIST_AGENT_VERSIONS_ROUTE,
  CREATE_AGENT_VERSION_ROUTE,
  COMPARE_AGENT_VERSIONS_ROUTE,
  // Must be before GET_AGENT_VERSION_ROUTE
  GET_AGENT_VERSION_ROUTE,
  ACTIVATE_AGENT_VERSION_ROUTE,
  RESTORE_AGENT_VERSION_ROUTE,
  DELETE_AGENT_VERSION_ROUTE,
  // ============================================================================
  // Favorites (EE)
  // ============================================================================
  FAVORITE_STORED_AGENT_ROUTE,
  UNFAVORITE_STORED_AGENT_ROUTE
];

// src/server/server-adapter/routes/stored-mcp-clients.ts
var STORED_MCP_CLIENTS_ROUTES = [
  // Stored MCP Clients CRUD Routes
  LIST_STORED_MCP_CLIENTS_ROUTE,
  GET_STORED_MCP_CLIENT_ROUTE,
  CREATE_STORED_MCP_CLIENT_ROUTE,
  UPDATE_STORED_MCP_CLIENT_ROUTE,
  DELETE_STORED_MCP_CLIENT_ROUTE,
  // MCP Client Versions Routes
  // IMPORTANT: Routes with literal paths (e.g., /compare) must come BEFORE
  // routes with path parameters (e.g., /:versionId) to ensure correct matching.
  LIST_MCP_CLIENT_VERSIONS_ROUTE,
  CREATE_MCP_CLIENT_VERSION_ROUTE,
  COMPARE_MCP_CLIENT_VERSIONS_ROUTE,
  GET_MCP_CLIENT_VERSION_ROUTE,
  ACTIVATE_MCP_CLIENT_VERSION_ROUTE,
  RESTORE_MCP_CLIENT_VERSION_ROUTE,
  DELETE_MCP_CLIENT_VERSION_ROUTE
];

// src/server/server-adapter/routes/stored-prompt-blocks.ts
var STORED_PROMPT_BLOCKS_ROUTES = [
  // Stored Prompt Blocks CRUD Routes
  LIST_STORED_PROMPT_BLOCKS_ROUTE,
  GET_STORED_PROMPT_BLOCK_ROUTE,
  CREATE_STORED_PROMPT_BLOCK_ROUTE,
  UPDATE_STORED_PROMPT_BLOCK_ROUTE,
  DELETE_STORED_PROMPT_BLOCK_ROUTE,
  // Prompt Block Versions Routes
  // IMPORTANT: Routes with literal paths (e.g., /compare) must come BEFORE
  // routes with path parameters (e.g., /:versionId) to ensure correct matching.
  LIST_PROMPT_BLOCK_VERSIONS_ROUTE,
  CREATE_PROMPT_BLOCK_VERSION_ROUTE,
  COMPARE_PROMPT_BLOCK_VERSIONS_ROUTE,
  GET_PROMPT_BLOCK_VERSION_ROUTE,
  ACTIVATE_PROMPT_BLOCK_VERSION_ROUTE,
  RESTORE_PROMPT_BLOCK_VERSION_ROUTE,
  DELETE_PROMPT_BLOCK_VERSION_ROUTE
];

// src/server/server-adapter/routes/stored-scorers.ts
var STORED_SCORERS_ROUTES = [
  // Stored Scorers CRUD Routes
  LIST_STORED_SCORERS_ROUTE,
  GET_STORED_SCORER_ROUTE,
  CREATE_STORED_SCORER_ROUTE,
  UPDATE_STORED_SCORER_ROUTE,
  DELETE_STORED_SCORER_ROUTE,
  // Scorer Versions Routes
  // IMPORTANT: Routes with literal paths (e.g., /compare) must come BEFORE
  // routes with path parameters (e.g., /:versionId) to ensure correct matching.
  LIST_SCORER_VERSIONS_ROUTE,
  CREATE_SCORER_VERSION_ROUTE,
  COMPARE_SCORER_VERSIONS_ROUTE,
  GET_SCORER_VERSION_ROUTE,
  ACTIVATE_SCORER_VERSION_ROUTE,
  RESTORE_SCORER_VERSION_ROUTE,
  DELETE_SCORER_VERSION_ROUTE
];

// src/server/server-adapter/routes/stored-skills.ts
var STORED_SKILLS_ROUTES = [
  // Stored Skills CRUD Routes
  LIST_STORED_SKILLS_ROUTE,
  GET_STORED_SKILL_ROUTE,
  CREATE_STORED_SKILL_ROUTE,
  UPDATE_STORED_SKILL_ROUTE,
  DELETE_STORED_SKILL_ROUTE,
  // Publish
  PUBLISH_STORED_SKILL_ROUTE,
  // Favorites (EE)
  FAVORITE_STORED_SKILL_ROUTE,
  UNFAVORITE_STORED_SKILL_ROUTE
];

// src/server/server-adapter/routes/stored-workspaces.ts
var STORED_WORKSPACES_ROUTES = [
  // Stored Workspaces CRUD Routes
  LIST_STORED_WORKSPACES_ROUTE,
  GET_STORED_WORKSPACE_ROUTE,
  CREATE_STORED_WORKSPACE_ROUTE,
  UPDATE_STORED_WORKSPACE_ROUTE,
  DELETE_STORED_WORKSPACE_ROUTE
];

// src/server/server-adapter/routes/system.ts
var SYSTEM_ROUTES = [GET_SYSTEM_PACKAGES_ROUTE, GET_API_SCHEMA_ROUTE];

// src/server/server-adapter/routes/tool-providers.ts
var TOOL_PROVIDER_ROUTES = [
  LIST_TOOL_PROVIDERS_ROUTE,
  LIST_TOOL_PROVIDER_TOOLKITS_ROUTE,
  LIST_TOOL_PROVIDER_TOOLS_ROUTE,
  GET_TOOL_PROVIDER_TOOL_SCHEMA_ROUTE,
  AUTHORIZE_TOOL_PROVIDER_ROUTE,
  GET_TOOL_PROVIDER_AUTH_STATUS_ROUTE,
  TOOL_PROVIDER_CONNECTION_STATUS_ROUTE,
  LIST_TOOL_PROVIDER_CONNECTIONS_ROUTE,
  LIST_TOOL_PROVIDER_CONNECTION_FIELDS_ROUTE,
  DISCONNECT_TOOL_PROVIDER_CONNECTION_ROUTE,
  UPDATE_TOOL_PROVIDER_CONNECTION_ROUTE,
  GET_TOOL_PROVIDER_CONNECTION_USAGE_ROUTE,
  GET_TOOL_PROVIDER_HEALTH_ROUTE
];

// src/server/server-adapter/routes/tools.ts
var TOOLS_ROUTES = [LIST_TOOLS_ROUTE, GET_TOOL_BY_ID_ROUTE, EXECUTE_TOOL_ROUTE];

// src/server/server-adapter/routes/vectors.ts
var VECTORS_ROUTES = [
  UPSERT_VECTORS_ROUTE,
  CREATE_INDEX_ROUTE,
  QUERY_VECTORS_ROUTE,
  LIST_INDEXES_ROUTE,
  DESCRIBE_INDEX_ROUTE,
  DELETE_INDEX_ROUTE,
  LIST_VECTORS_ROUTE,
  LIST_EMBEDDERS_ROUTE
];

// src/server/server-adapter/routes/workflows.ts
var WORKFLOWS_ROUTES = [
  LIST_WORKFLOWS_ROUTE,
  GET_WORKFLOW_BY_ID_ROUTE,
  LIST_WORKFLOW_RUNS_ROUTE,
  GET_WORKFLOW_RUN_BY_ID_ROUTE,
  DELETE_WORKFLOW_RUN_BY_ID_ROUTE,
  CREATE_WORKFLOW_RUN_ROUTE,
  STREAM_WORKFLOW_ROUTE,
  RESUME_STREAM_WORKFLOW_ROUTE,
  START_ASYNC_WORKFLOW_ROUTE,
  START_WORKFLOW_RUN_ROUTE,
  OBSERVE_STREAM_WORKFLOW_ROUTE,
  RESUME_ASYNC_WORKFLOW_ROUTE,
  RESUME_NO_WAIT_WORKFLOW_ROUTE,
  RESUME_WORKFLOW_ROUTE,
  CANCEL_WORKFLOW_RUN_ROUTE,
  TIME_TRAVEL_WORKFLOW_ROUTE,
  TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE,
  TIME_TRAVEL_STREAM_WORKFLOW_ROUTE,
  RESTART_WORKFLOW_ROUTE,
  RESTART_ASYNC_WORKFLOW_ROUTE,
  RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE,
  RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE,
  EXECUTE_WORKFLOW_STEP_ROUTE,
  RECEIVE_WORKFLOW_EVENT_ROUTE
];

// src/server/server-adapter/routes/workspace.ts
var WORKSPACE_ROUTES = [
  // List all workspaces route (at /api/workspaces)
  LIST_WORKSPACES_ROUTE,
  // Get workspace route (at /api/workspaces/:workspaceId)
  GET_WORKSPACE_ROUTE,
  // Filesystem routes (at /api/workspaces/:workspaceId/fs/*)
  ...WORKSPACE_FS_ROUTES,
  // Search routes (at /api/workspaces/:workspaceId/search, /api/workspaces/:workspaceId/index)
  ...WORKSPACE_SEARCH_ROUTES,
  // Skills routes (search must come before parameterized routes)
  ...WORKSPACE_SKILLS_ROUTES,
  // skills.sh proxy routes (at /api/workspaces/:workspaceId/skills-sh/*)
  ...WORKSPACE_SKILLS_SH_ROUTES
];

// src/server/server-adapter/routes/index.ts
var SERVER_ROUTES = [
  ...AGENTS_ROUTES,
  ...AUTH_ROUTES,
  ...WORKFLOWS_ROUTES,
  ...TOOLS_ROUTES,
  ...PROCESSORS_ROUTES,
  ...RESPONSES_ROUTES,
  ...CONVERSATIONS_ROUTES,
  ...MEMORY_ROUTES,
  ...SCORES_ROUTES,
  ...OBSERVABILITY_ROUTES,
  ...LOGS_ROUTES,
  ...VECTORS_ROUTES,
  ...A2A_ROUTES,
  ...WORKSPACE_ROUTES,
  ...LEGACY_ROUTES,
  ...MCP_ROUTES,
  ...STORED_AGENTS_ROUTES,
  ...STORED_MCP_CLIENTS_ROUTES,
  ...STORED_PROMPT_BLOCKS_ROUTES,
  ...STORED_SCORERS_ROUTES,
  ...STORED_WORKSPACES_ROUTES,
  ...STORED_SKILLS_ROUTES,
  ...TOOL_PROVIDER_ROUTES,
  ...PROCESSOR_PROVIDER_ROUTES,
  ...SYSTEM_ROUTES,
  ...DATASETS_ROUTES,
  ...BACKGROUND_TASK_ROUTES,
  ...EDITOR_BUILDER_ROUTES,
  ...AGENT_BUILDER_ROUTES,
  ...SCHEDULES_ROUTES,
  ...HEARTBEATS_ROUTES,
  ...CHANNELS_ROUTES,
  ...AGENT_CONTROLLER_ROUTES
];

export { SERVER_ROUTES, deriveAction, derivePermission, extractResource, getEffectivePermission };
//# sourceMappingURL=chunk-KYATWPF6.js.map
//# sourceMappingURL=chunk-KYATWPF6.js.map