/** Canonical, machine-readable WRN language capabilities. */
export const WRN_LANGUAGE_VERSION = "0.6";

export const WRN_ROOT_KINDS = [
  "page",
  "component",
  "layout",
  "global-store",
  "page-store",
] as const;
export const WRN_ROOT_MEMBERS = [
  "layout",
  "runtime",
  "hydrate",
  "client",
  "types",
  "props",
  "outputs",
  "state",
  "shared",
  "server",
  "computed",
  "effect",
  "watch",
  "lifecycle",
  "view",
  "seo",
  "security",
  "load",
  "action",
  "api",
  "ssr",
  "realtime",
  "style",
  "functions",
  "persist",
] as const;

export const WRN_HYDRATION_STRATEGIES = ["load", "idle", "visible", "interaction", "none"] as const;

export const WRN_RUNTIME_TARGETS = [
  "server",
  "client",
  "universal",
  "edge",
  "worker",
  "service-worker",
] as const;

export type WrnRootKind = (typeof WRN_ROOT_KINDS)[number];
export type WrnRootMember = (typeof WRN_ROOT_MEMBERS)[number];
export type WrnHydrationStrategy = (typeof WRN_HYDRATION_STRATEGIES)[number] | `media:${string}`;
export type WrnRuntimeTarget = (typeof WRN_RUNTIME_TARGETS)[number];

export const WRN_DIAGNOSTIC_CODES = {
  parse: "WRN-PARSE-001",
  root: "WRN-PARSE-ROOT",
  member: "WRN-PARSE-MEMBER",
  propInitializer: "WRN-PROP-INITIALIZER",
  stateInitializer: "WRN-STATE-INITIALIZER",
  watchUndeclared: "WRN-WATCH-UNDECLARED",
  duplicateSymbol: "WRN-SYMBOL-DUPLICATE",
  invalidHydration: "WRN-HYDRATE-STRATEGY",
  invalidRuntime: "WRN-RUNTIME-TARGET",
  serverInteractive: "WRN-RUNTIME-SERVER-INTERACTIVE",
  accessibility: "WRN-A11Y-001",
  import: "WRN-IMPORT-001",
  function: "WRN-FUNCTION-001",
  client: "WRN-CLIENT-001",
  server: "WRN-SERVER-001",
  output: "WRN-OUTPUT-001",
  type: "WRN-TYPE-001",
  state: "WRN-STATE-001",
  component: "WRN-COMPONENT-001",
  template: "WRN-TEMPLATE-001",
  store: "WRN-STORE-001",
  persist: "WRN-PERSIST-001",
  rpc: "WRN-RPC-001",
  hydration: "WRN-HYDRATION-001",
  migration: "WRN-MIGRATION-001",
} as const;
