@zitadel/cli 0.1.0-alpha.15 → 0.1.0-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +2 -2
  2. package/SKILLS.md +15 -6
  3. package/dist/commands/apply.mjs +8 -5
  4. package/dist/commands/apply.mjs.map +1 -1
  5. package/dist/commands/doctor.mjs +7 -7
  6. package/dist/commands/eject.mjs +17 -5
  7. package/dist/commands/eject.mjs.map +1 -1
  8. package/dist/commands/logs.mjs +2 -2
  9. package/dist/commands/plan.mjs +8 -5
  10. package/dist/commands/plan.mjs.map +1 -1
  11. package/dist/commands/reset.mjs +2 -2
  12. package/dist/commands/schemas/list.mjs +3 -3
  13. package/dist/commands/setup.mjs +128 -34
  14. package/dist/commands/setup.mjs.map +1 -1
  15. package/dist/commands/start.mjs +4 -4
  16. package/dist/commands/status.mjs +40 -9
  17. package/dist/commands/status.mjs.map +1 -1
  18. package/dist/commands/stop.mjs +3 -3
  19. package/dist/{docker-D7BSD5C9.mjs → docker-BbX0yOpg.mjs} +2 -2
  20. package/dist/{docker-D7BSD5C9.mjs.map → docker-BbX0yOpg.mjs.map} +1 -1
  21. package/dist/{docker-guidance-mcTT3_0E.mjs → docker-guidance-3UZESTfb.mjs} +2 -2
  22. package/dist/{docker-guidance-mcTT3_0E.mjs.map → docker-guidance-3UZESTfb.mjs.map} +1 -1
  23. package/dist/{environment-BQF7LeCz.mjs → environment-ABj1IWZt.mjs} +1 -1
  24. package/dist/{environment-BQF7LeCz.mjs.map → environment-ABj1IWZt.mjs.map} +1 -1
  25. package/dist/journey-guidance-E_3_UwGt.mjs +29 -0
  26. package/dist/journey-guidance-E_3_UwGt.mjs.map +1 -0
  27. package/dist/{oclif-Bm-FkF6z.mjs → oclif-SjHLB_XK.mjs} +17 -35
  28. package/dist/oclif-SjHLB_XK.mjs.map +1 -0
  29. package/dist/{orca-CpXj_XsA.mjs → orca-_TmrJQMw.mjs} +209 -163
  30. package/dist/orca-_TmrJQMw.mjs.map +1 -0
  31. package/dist/{ports-CxBKS1ga.mjs → ports-XujDtA47.mjs} +1 -1
  32. package/dist/{ports-CxBKS1ga.mjs.map → ports-XujDtA47.mjs.map} +1 -1
  33. package/dist/{processes-BVqYsxT8.mjs → processes-p2PPbKGG.mjs} +1 -1
  34. package/dist/{processes-BVqYsxT8.mjs.map → processes-p2PPbKGG.mjs.map} +1 -1
  35. package/dist/{project-Dk7V0xka.mjs → project-DXc7q4wN.mjs} +2 -2
  36. package/dist/{project-Dk7V0xka.mjs.map → project-DXc7q4wN.mjs.map} +1 -1
  37. package/dist/{sync-CYuHVQT5.mjs → sync-Bu_iLIbb.mjs} +148 -30
  38. package/dist/sync-Bu_iLIbb.mjs.map +1 -0
  39. package/oclif.manifest.json +12 -1
  40. package/package.json +5 -5
  41. package/dist/oclif-Bm-FkF6z.mjs.map +0 -1
  42. package/dist/orca-CpXj_XsA.mjs.map +0 -1
  43. package/dist/sync-CYuHVQT5.mjs.map +0 -1
@@ -1,6 +1,7 @@
1
- import { C as isObject, E as ZitadelError, T as stableStringify, n as DEFAULT_SERVER, w as parseJsonObject, x as MANAGED_MARKER, y as npmDistTagForCliVersion } from "./oclif-Bm-FkF6z.mjs";
1
+ import { C as isObject, E as ZitadelError, T as stableStringify, b as publicCliCommand, n as DEFAULT_SERVER, w as parseJsonObject, x as MANAGED_MARKER, y as npmDistTagForCliVersion } from "./oclif-SjHLB_XK.mjs";
2
2
  import { chmod, mkdir, readFile, readdir, rename, rm, stat, writeFile } from "node:fs/promises";
3
3
  import { basename, dirname, join } from "node:path";
4
+ import { META_SCHEMA_DIR, metaSchemaFiles } from "@zitadel/config/meta-schemas";
4
5
  import { builders, generateCode, parseModule } from "magicast";
5
6
  import { spawnSync } from "node:child_process";
6
7
  //#region src/lib/orca/detectors/package-json.ts
@@ -551,6 +552,94 @@ function deepMerge(target, patch) {
551
552
  return out;
552
553
  }
553
554
  //#endregion
555
+ //#region src/lib/orca/patchers/rule/guidance.ts
556
+ /**
557
+ * Scaffolded guidance for humans (`README.md`) and agents (`AGENTS.md`):
558
+ * the golden journey from a fresh scaffold to a customized, published
559
+ * login — so the project explains its own next step without the docs
560
+ * site. Both files are edited via a marker-fenced managed section, so
561
+ * setup never clobbers what a developer (or another tool) wrote and a
562
+ * rerun replaces only its own section.
563
+ */
564
+ const MARKER_BEGIN = "<!-- zitadel:guidance:begin -->";
565
+ const MARKER_END = "<!-- zitadel:guidance:end -->";
566
+ /**
567
+ * Insert or replace the managed guidance section in `source`. A missing
568
+ * file becomes `header` + section; an existing section (marker pair) is
569
+ * replaced in place; anything else gets the section appended. Pure and
570
+ * idempotent — the file-writer skips the write when output equals input.
571
+ */
572
+ function upsertGuidanceSection(source, section, header) {
573
+ const block = `${MARKER_BEGIN}\n${section}\n${MARKER_END}\n`;
574
+ if (source === void 0 || source.trim() === "") return `${header}${block}`;
575
+ const begin = source.indexOf(MARKER_BEGIN);
576
+ const end = source.indexOf(MARKER_END);
577
+ if (begin !== -1 && end > begin) return `${source.slice(0, begin)}${block}${source.slice(end + 29).replace(/^\n/, "")}`;
578
+ return `${source.replace(/\n*$/, "\n\n")}${block}`;
579
+ }
580
+ /**
581
+ * Remove the managed guidance section (markers inclusive) from `source` —
582
+ * the inverse of {@link upsertGuidanceSection}, for `eject`. Content outside
583
+ * the markers is preserved byte-for-byte; a missing or malformed marker pair
584
+ * returns `source` unchanged.
585
+ */
586
+ function removeGuidanceSection(source) {
587
+ const begin = source.indexOf(MARKER_BEGIN);
588
+ const end = source.indexOf(MARKER_END);
589
+ if (begin === -1 || end <= begin) return source;
590
+ return `${source.slice(0, begin)}${source.slice(end + 29).replace(/^\n/, "")}`;
591
+ }
592
+ /** The agent-facing golden path, written into `AGENTS.md`. */
593
+ function agentsGuidanceSection(ctx) {
594
+ const plan = publicCliCommand("plan", ctx.cliVersion);
595
+ const apply = publicCliCommand("apply", ctx.cliVersion);
596
+ const passkeyVerifyNote = ctx.preset === "passkey-first" ? " Agents: automated browsers can't complete passkey ceremonies — verify the loop via the email/password fallback actions, or attach a CDP WebAuthn virtual authenticator." : "";
597
+ return `## Authentication (Zitadel)
598
+
599
+ This app's login is managed by Zitadel. Local config is the source of truth; never change auth behavior by editing generated route files.
600
+
601
+ The golden path:
602
+
603
+ 1. Start the dev server and open ${ctx.issuer}/login — **exactly this origin, not 127.0.0.1**. Passkeys and the origin allowlist are bound to it. (Freshly scaffolded apps also redirect / there; pre-existing apps keep their homepage.)
604
+ 2. Prove the loop in a real browser: register a user → sign out → sign in → /profile shows signed in.${passkeyVerifyNote}
605
+ 3. Customize by editing local config:
606
+ - \`.zitadel/schemas/*.json\` — what a user is (fields, required, auth methods). See \`.zitadel/schemas/README.md\`.
607
+ - \`.zitadel/flows/*.json\` — which screen collects which field/credential and how steps transition. See \`.zitadel/flows/README.md\`.
608
+ 4. Preview, then publish:
609
+ - \`${plan}\`
610
+ - \`${apply}\`
611
+ - Agents: append \`--non-interactive --json\` to both. \`plan\` validates flow invariants with the server's own rules **before** anything uploads — fix what it reports and re-run.
612
+
613
+ Machine-readable dialect (read these before authoring flow or schema edits):
614
+
615
+ - Flow files carry \`"$schema": "../meta/flow-definition.json"\` — the flow dialect spec (steps, actions and their kinds, transitions, reserved outcomes like \`user_not_found\`). Editors validate against it.
616
+ - \`.zitadel/meta/user-schema.json\` (with its companions \`user-property.json\`, \`auth-methods.json\`, \`auth-method.json\`) specifies the user-schema dialect (\`x-auth-methods\`, \`x-unique\`, property constraints).
617
+ - Worked flow examples: https://github.com/zitadel/nextgen/tree/main/api/openapi/endpoints/flow_definitions/examples
618
+
619
+ Never edit \`.zitadel/state.json\` (sync bookkeeping) or \`.zitadel/secret\` (credentials, git-ignored). Keep \`.zitadel/local/\` out of source control.`;
620
+ }
621
+ /** The human-facing summary appended to the app `README.md`. */
622
+ function readmeGuidanceSection(ctx) {
623
+ const plan = publicCliCommand("plan", ctx.cliVersion);
624
+ const apply = publicCliCommand("apply", ctx.cliVersion);
625
+ return `## Authentication (Zitadel)
626
+
627
+ Login for this app is managed by [Zitadel](https://zitadel.com). Try it: start the dev server, open ${ctx.issuer}/login (use this exact origin — passkeys are bound to it), register a user, sign out, and sign in again.
628
+
629
+ To change what the login collects or how sign-in works, edit the files under \`.zitadel/schemas/\` and \`.zitadel/flows/\` (each folder has a README), then:
630
+
631
+ \`\`\`sh
632
+ ${plan}
633
+ ${apply}
634
+ \`\`\``;
635
+ }
636
+ /** Full-file header used when `AGENTS.md` does not exist yet. */
637
+ const AGENTS_HEADER = `# AGENTS.md
638
+
639
+ Guidance for AI agents working in this repository.
640
+
641
+ `;
642
+ //#endregion
554
643
  //#region src/lib/orca/patchers/rule/reclaim.ts
555
644
  /**
556
645
  * The subset of a patcher plan's operations that `doctor --fix` re-applies:
@@ -605,7 +694,8 @@ var AbstractRulePatcher = class {
605
694
  directories: [".zitadel"],
606
695
  envBackups: [".env.local"],
607
696
  dependencies: this.routeDeps(view),
608
- configEdits: this.routeConfigEdits(view)
697
+ configEdits: this.routeConfigEdits(view),
698
+ guidanceFiles: ["AGENTS.md", "README.md"]
609
699
  };
610
700
  }
611
701
  /**
@@ -705,6 +795,25 @@ var AbstractRulePatcher = class {
705
795
  framework: ctx.framework.id,
706
796
  resources: {}
707
797
  })}\n`
798
+ },
799
+ {
800
+ kind: "mkdir",
801
+ path: META_SCHEMA_DIR
802
+ },
803
+ ...metaSchemaFiles().map((file) => ({
804
+ kind: "write",
805
+ path: `${META_SCHEMA_DIR}/${file.name}`,
806
+ contents: `${JSON.stringify(file.body, null, 2)}\n`
807
+ })),
808
+ {
809
+ kind: "edit",
810
+ path: "AGENTS.md",
811
+ edit: (source) => upsertGuidanceSection(source, agentsGuidanceSection(ctx), AGENTS_HEADER)
812
+ },
813
+ {
814
+ kind: "edit",
815
+ path: "README.md",
816
+ edit: (source) => upsertGuidanceSection(source, readmeGuidanceSection(ctx), "")
708
817
  }
709
818
  ];
710
819
  }
@@ -722,7 +831,8 @@ function projectConfig(ctx) {
722
831
  renderer: ctx.rendererId,
723
832
  attribution: "visible"
724
833
  },
725
- environments
834
+ environments,
835
+ ...ctx.preset === void 0 ? {} : { preset: ctx.preset }
726
836
  };
727
837
  }
728
838
  /** Normalizes a server URL to its origin, falling back to {@link DEFAULT_SERVER}. */
@@ -930,7 +1040,7 @@ const PROXY_PATH = "/__nextgen";
930
1040
  */
931
1041
  function appComponentTemplate(projectId) {
932
1042
  return `${MANAGED_MARKER}
933
- import { Component } from "@angular/core";
1043
+ import { Component, OnInit } from "@angular/core";
934
1044
  import {
935
1045
  ZitadelLoginComponent,
936
1046
  ZitadelSessionComponent,
@@ -943,12 +1053,18 @@ import {
943
1053
  imports: [ZitadelLoginComponent, ZitadelSessionComponent],
944
1054
  templateUrl: "./app.html",
945
1055
  })
946
- export class App {
1056
+ export class App implements OnInit {
947
1057
  protected readonly project = configureZitadel({
948
1058
  projectId: ${JSON.stringify(projectId)},
949
1059
  proxyPath: "${PROXY_PATH}",
950
1060
  });
951
1061
  protected readonly path = window.location.pathname;
1062
+
1063
+ ngOnInit(): void {
1064
+ if (this.path === "/") {
1065
+ window.location.replace("/login");
1066
+ }
1067
+ }
952
1068
  }
953
1069
  `;
954
1070
  }
@@ -958,19 +1074,7 @@ export class App {
958
1074
  */
959
1075
  function appTemplateHtml() {
960
1076
  return `<!-- ${MANAGED_MARKER} -->
961
- @if (path === '/') {
962
- <main style="position:fixed;inset:0;padding:48px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;background:#0f0f11;color-scheme:dark;color:#f4f4f6;font-family:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;line-height:1.5;letter-spacing:normal;text-align:center">
963
- <section style="width:100%;max-width:560px">
964
- <p style="margin:0 0 12px;color:#9ca3af;font-size:14px">Zitadel auth</p>
965
- <h1 style="margin:0 0 24px;font-size:32px;line-height:1.15;font-weight:600;color:#f4f4f6">Sign in, create an account, or open your profile.</h1>
966
- <div style="display:flex;flex-wrap:wrap;gap:12px;justify-content:center">
967
- <a href="/login" style="padding:10px 16px;border-radius:8px;background:#f4f4f6;color:#0f0f11;text-decoration:none;font-weight:600;font-size:14px">Sign in</a>
968
- <a href="/register" style="padding:10px 16px;border-radius:8px;border:1px solid #3f3f46;color:#f4f4f6;text-decoration:none;font-weight:600;font-size:14px">Create account</a>
969
- <a href="/profile" style="padding:10px 16px;border-radius:8px;border:1px solid #3f3f46;color:#f4f4f6;text-decoration:none;font-weight:600;font-size:14px">Profile</a>
970
- </div>
971
- </section>
972
- </main>
973
- } @else if (path.startsWith('/profile')) {
1077
+ @if (path.startsWith('/profile')) {
974
1078
  <div style="position:fixed;inset:0;overflow:auto;background:#0f0f11;color-scheme:dark">
975
1079
  <zitadel-auth-session
976
1080
  [project]="project"
@@ -1257,7 +1361,6 @@ const reactRenderer = {
1257
1361
  "use client";
1258
1362
 
1259
1363
  import dynamic from "next/dynamic";
1260
- import Link from "next/link";
1261
1364
 
1262
1365
  const ${elementName} = dynamic(
1263
1366
  async () => {
@@ -1286,12 +1389,7 @@ const ${elementName} = dynamic(
1286
1389
 
1287
1390
  export default function ${componentName}() {
1288
1391
  return (
1289
- <main style={{ minHeight: "100vh", position: "relative", colorScheme: "dark", background: "#0f0f11" }}>
1290
- <nav aria-label="Authentication" style={{ position: "absolute", top: "24px", right: "24px", zIndex: 1, display: "flex", gap: "12px" }}>
1291
- <Link href="${mode === "login" ? "/register" : "/login"}" style={{ color: "#f4f4f6", fontWeight: 700, textDecoration: "none" }}>
1292
- ${mode === "login" ? "Create account" : "Sign in"}
1293
- </Link>
1294
- </nav>
1392
+ <main style={{ minHeight: "100vh", colorScheme: "dark", background: "#0f0f11" }}>
1295
1393
  <${elementName} />
1296
1394
  </main>
1297
1395
  );
@@ -1349,6 +1447,7 @@ declare module "react" {
1349
1447
  "session-exchange-path"?: string;
1350
1448
  "post-sign-in-url"?: string;
1351
1449
  purpose?: string;
1450
+ "flow-name"?: string;
1352
1451
  };
1353
1452
  "zitadel-logout": React.HTMLAttributes<HTMLElement> & {
1354
1453
  project?: ZitadelProject;
@@ -1538,28 +1637,10 @@ function nextCodeOps(ctx, renderer) {
1538
1637
  }
1539
1638
  function homePageTemplate() {
1540
1639
  return `${MANAGED_MARKER}
1541
- import Link from "next/link";
1640
+ import { redirect } from "next/navigation";
1542
1641
 
1543
1642
  export default function Home() {
1544
- return (
1545
- <main style={{ position: "fixed", inset: 0, padding: "48px", boxSizing: "border-box", display: "flex", alignItems: "center", justifyContent: "center", background: "#0f0f11", colorScheme: "dark", color: "#f4f4f6", fontFamily: "system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif", lineHeight: 1.5, letterSpacing: "normal", textAlign: "center" }}>
1546
- <section style={{ width: "100%", maxWidth: "560px" }}>
1547
- <p style={{ margin: "0 0 12px", color: "#9ca3af", fontSize: "14px" }}>Zitadel auth</p>
1548
- <h1 style={{ margin: "0 0 24px", fontSize: "32px", lineHeight: 1.15, fontWeight: 600, color: "#f4f4f6" }}>Sign in, create an account, or open your profile.</h1>
1549
- <div style={{ display: "flex", flexWrap: "wrap", gap: "12px" }}>
1550
- <Link href="/login" style={{ padding: "10px 16px", borderRadius: "8px", background: "#f4f4f6", color: "#0f0f11", textDecoration: "none", fontWeight: 600, fontSize: "14px" }}>
1551
- Sign in
1552
- </Link>
1553
- <Link href="/register" style={{ padding: "10px 16px", borderRadius: "8px", border: "1px solid #3f3f46", color: "#f4f4f6", textDecoration: "none", fontWeight: 600, fontSize: "14px" }}>
1554
- Create account
1555
- </Link>
1556
- <Link href="/profile" style={{ padding: "10px 16px", borderRadius: "8px", border: "1px solid #3f3f46", color: "#f4f4f6", textDecoration: "none", fontWeight: 600, fontSize: "14px" }}>
1557
- Profile
1558
- </Link>
1559
- </div>
1560
- </section>
1561
- </main>
1562
- );
1643
+ redirect("/login");
1563
1644
  }
1564
1645
  `;
1565
1646
  }
@@ -1695,22 +1776,12 @@ body {
1695
1776
  </style>
1696
1777
  `;
1697
1778
  }
1698
- /** `pages/index.vue` — the landing chooser linking to login/register/profile. */
1779
+ /** `pages/index.vue` — redirects the app root to `/login`. */
1699
1780
  function indexPageTemplate() {
1700
- return `<!-- ${MANAGED_MARKER} -->
1701
- <template>
1702
- <main style="position:fixed;inset:0;padding:48px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;background:#0f0f11;color-scheme:dark;color:#f4f4f6;font-family:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;line-height:1.5;letter-spacing:normal;text-align:center">
1703
- <section style="width:100%;max-width:560px">
1704
- <p style="margin:0 0 12px;color:#9ca3af;font-size:14px">Zitadel auth</p>
1705
- <h1 style="margin:0 0 24px;font-size:32px;line-height:1.15;font-weight:600;color:#f4f4f6">Sign in, create an account, or open your profile.</h1>
1706
- <div style="display:flex;flex-wrap:wrap;gap:12px;justify-content:center">
1707
- <NuxtLink to="/login" style="padding:10px 16px;border-radius:8px;background:#f4f4f6;color:#0f0f11;text-decoration:none;font-weight:600;font-size:14px">Sign in</NuxtLink>
1708
- <NuxtLink to="/register" style="padding:10px 16px;border-radius:8px;border:1px solid #3f3f46;color:#f4f4f6;text-decoration:none;font-weight:600;font-size:14px">Create account</NuxtLink>
1709
- <NuxtLink to="/profile" style="padding:10px 16px;border-radius:8px;border:1px solid #3f3f46;color:#f4f4f6;text-decoration:none;font-weight:600;font-size:14px">Profile</NuxtLink>
1710
- </div>
1711
- </section>
1712
- </main>
1713
- </template>
1781
+ return `<script setup lang="ts">
1782
+ ${MANAGED_MARKER}
1783
+ await navigateTo("/login", { replace: true });
1784
+ <\/script>
1714
1785
  `;
1715
1786
  }
1716
1787
  /** A login/register page rendering `<zitadel-login>` inside `<ClientOnly>`. */
@@ -1897,7 +1968,7 @@ var NuxtPatcher = class extends AbstractRulePatcher {
1897
1968
  summary(_ctx) {
1898
1969
  return {
1899
1970
  title: "Nuxt integration",
1900
- detail: "Wrote landing/login/register/profile pages + plugins and registered @zitadel/sdk-nuxt in nuxt.config.*."
1971
+ detail: "Wrote login/register/profile pages + plugins and registered @zitadel/sdk-nuxt in nuxt.config.*."
1901
1972
  };
1902
1973
  }
1903
1974
  };
@@ -1994,16 +2065,17 @@ function buildViteProxyOp(devPort, server) {
1994
2065
  //#region src/lib/orca/patchers/rule/qwik/templates.ts
1995
2066
  /**
1996
2067
  * The managed `src/app.tsx`: a minimal path-based router that renders the
1997
- * `@zitadel/sdk-qwik` widgets — a landing chooser at `/`, login at `/login`,
1998
- * register at `/register`, and the signed-in session card at `/profile`. Exports a named `App`
1999
- * (`component$`) to match the create-vite Qwik entry (`main.tsx` imports
2000
- * `{ App }`). The project id comes from `VITE_ZITADEL_PROJECT_ID`. No secret
2001
- * reaches the browser: the dev proxy in `vite.config.*` attaches the project
2002
- * service-key secret (from `ZITADEL_PROJECT_SECRET`) server-side.
2068
+ * `@zitadel/sdk-qwik` widgets — login at `/login`, register at `/register`, and
2069
+ * the signed-in session card at `/profile`. The root path redirects to `/login`.
2070
+ * Exports a named `App` (`component$`) to match the create-vite Qwik entry
2071
+ * (`main.tsx` imports `{ App }`). The project id comes from
2072
+ * `VITE_ZITADEL_PROJECT_ID`. No secret reaches the browser: the dev proxy in
2073
+ * `vite.config.*` attaches the project service-key secret (from
2074
+ * `ZITADEL_PROJECT_SECRET`) server-side.
2003
2075
  */
2004
2076
  function appTemplate$4() {
2005
2077
  return `${MANAGED_MARKER}
2006
- import { component$ } from "@builder.io/qwik";
2078
+ import { component$, useVisibleTask$ } from "@builder.io/qwik";
2007
2079
  import { ZitadelLogin, ZitadelSession, configureZitadel } from "@zitadel/sdk-qwik";
2008
2080
 
2009
2081
  const project = configureZitadel({
@@ -2014,20 +2086,14 @@ const project = configureZitadel({
2014
2086
  export const App = component$(() => {
2015
2087
  const path = window.location.pathname;
2016
2088
 
2089
+ useVisibleTask$(() => {
2090
+ if (path === "/") {
2091
+ window.location.replace("/login");
2092
+ }
2093
+ });
2094
+
2017
2095
  if (path === "/") {
2018
- return (
2019
- <main style={{ position: "fixed", inset: "0", padding: "48px", boxSizing: "border-box", display: "flex", alignItems: "center", justifyContent: "center", background: "#0f0f11", colorScheme: "dark", color: "#f4f4f6", fontFamily: "system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif", lineHeight: "1.5", letterSpacing: "normal", textAlign: "center" }}>
2020
- <section style={{ width: "100%", maxWidth: "560px" }}>
2021
- <p style={{ margin: "0 0 12px", color: "#9ca3af", fontSize: "14px" }}>Zitadel auth</p>
2022
- <h1 style={{ margin: "0 0 24px", fontSize: "32px", lineHeight: "1.15", fontWeight: "600", color: "#f4f4f6" }}>Sign in, create an account, or open your profile.</h1>
2023
- <div style={{ display: "flex", flexWrap: "wrap", gap: "12px", justifyContent: "center" }}>
2024
- <a href="/login" style={{ padding: "10px 16px", borderRadius: "8px", background: "#f4f4f6", color: "#0f0f11", textDecoration: "none", fontWeight: "600", fontSize: "14px" }}>Sign in</a>
2025
- <a href="/register" style={{ padding: "10px 16px", borderRadius: "8px", border: "1px solid #3f3f46", color: "#f4f4f6", textDecoration: "none", fontWeight: "600", fontSize: "14px" }}>Create account</a>
2026
- <a href="/profile" style={{ padding: "10px 16px", borderRadius: "8px", border: "1px solid #3f3f46", color: "#f4f4f6", textDecoration: "none", fontWeight: "600", fontSize: "14px" }}>Profile</a>
2027
- </div>
2028
- </section>
2029
- </main>
2030
- );
2096
+ return null;
2031
2097
  }
2032
2098
  if (path.startsWith("/profile")) {
2033
2099
  return (
@@ -2120,15 +2186,16 @@ var QwikPatcher = class extends AbstractRulePatcher {
2120
2186
  //#region src/lib/orca/patchers/rule/react/templates.ts
2121
2187
  /**
2122
2188
  * The managed `src/App.tsx`: a minimal path-based router that renders the
2123
- * `@zitadel/sdk-react` widgets — a landing chooser at `/`, login at `/login`,
2124
- * register at `/register`, and the signed-in session card at `/profile`. The project id comes from
2125
- * `VITE_ZITADEL_PROJECT_ID` (Vite only exposes `VITE_`-prefixed env to the
2126
- * client). No secret reaches the browser: the dev proxy in `vite.config.*`
2127
- * attaches the project service-key secret (from `ZITADEL_PROJECT_SECRET`)
2128
- * server-side.
2189
+ * `@zitadel/sdk-react` widgets — login at `/login`, register at `/register`, and
2190
+ * the signed-in session card at `/profile`. The root path redirects to `/login`.
2191
+ * The project id comes from `VITE_ZITADEL_PROJECT_ID` (Vite only exposes
2192
+ * `VITE_`-prefixed env to the client). No secret reaches the browser: the dev
2193
+ * proxy in `vite.config.*` attaches the project service-key secret (from
2194
+ * `ZITADEL_PROJECT_SECRET`) server-side.
2129
2195
  */
2130
2196
  function appTemplate$3() {
2131
2197
  return `${MANAGED_MARKER}
2198
+ import { useEffect } from "react";
2132
2199
  import { ZitadelLogin, ZitadelSession, configureZitadel } from "@zitadel/sdk-react";
2133
2200
 
2134
2201
  const project = configureZitadel({
@@ -2139,20 +2206,14 @@ const project = configureZitadel({
2139
2206
  export default function App() {
2140
2207
  const path = window.location.pathname;
2141
2208
 
2209
+ useEffect(() => {
2210
+ if (path === "/") {
2211
+ window.location.replace("/login");
2212
+ }
2213
+ }, [path]);
2214
+
2142
2215
  if (path === "/") {
2143
- return (
2144
- <main style={{ position: "fixed", inset: 0, padding: "48px", boxSizing: "border-box", display: "flex", alignItems: "center", justifyContent: "center", background: "#0f0f11", colorScheme: "dark", color: "#f4f4f6", fontFamily: "system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif", lineHeight: 1.5, letterSpacing: "normal", textAlign: "center" }}>
2145
- <section style={{ width: "100%", maxWidth: "560px" }}>
2146
- <p style={{ margin: "0 0 12px", color: "#9ca3af", fontSize: "14px" }}>Zitadel auth</p>
2147
- <h1 style={{ margin: "0 0 24px", fontSize: "32px", lineHeight: 1.15, fontWeight: 600, color: "#f4f4f6" }}>Sign in, create an account, or open your profile.</h1>
2148
- <div style={{ display: "flex", flexWrap: "wrap", gap: "12px", justifyContent: "center" }}>
2149
- <a href="/login" style={{ padding: "10px 16px", borderRadius: "8px", background: "#f4f4f6", color: "#0f0f11", textDecoration: "none", fontWeight: 600, fontSize: "14px" }}>Sign in</a>
2150
- <a href="/register" style={{ padding: "10px 16px", borderRadius: "8px", border: "1px solid #3f3f46", color: "#f4f4f6", textDecoration: "none", fontWeight: 600, fontSize: "14px" }}>Create account</a>
2151
- <a href="/profile" style={{ padding: "10px 16px", borderRadius: "8px", border: "1px solid #3f3f46", color: "#f4f4f6", textDecoration: "none", fontWeight: 600, fontSize: "14px" }}>Profile</a>
2152
- </div>
2153
- </section>
2154
- </main>
2155
- );
2216
+ return null;
2156
2217
  }
2157
2218
  if (path.startsWith("/profile")) {
2158
2219
  return (
@@ -2243,15 +2304,16 @@ var ReactPatcher = class extends AbstractRulePatcher {
2243
2304
  //#region src/lib/orca/patchers/rule/solid/templates.ts
2244
2305
  /**
2245
2306
  * The managed `src/App.tsx`: a minimal path-based router that renders the
2246
- * `@zitadel/sdk-solid` widgets — a landing chooser at `/`, login at `/login`,
2247
- * register at `/register`, and the signed-in session card at `/profile`. The project id comes from
2248
- * `VITE_ZITADEL_PROJECT_ID` (Vite only exposes `VITE_`-prefixed env to the
2249
- * client). No secret reaches the browser: the dev proxy in `vite.config.*`
2250
- * attaches the project service-key secret (from `ZITADEL_PROJECT_SECRET`)
2251
- * server-side.
2307
+ * `@zitadel/sdk-solid` widgets — login at `/login`, register at `/register`, and
2308
+ * the signed-in session card at `/profile`. The root path redirects to `/login`.
2309
+ * The project id comes from `VITE_ZITADEL_PROJECT_ID` (Vite only exposes
2310
+ * `VITE_`-prefixed env to the client). No secret reaches the browser: the dev
2311
+ * proxy in `vite.config.*` attaches the project service-key secret (from
2312
+ * `ZITADEL_PROJECT_SECRET`) server-side.
2252
2313
  */
2253
2314
  function appTemplate$2() {
2254
2315
  return `${MANAGED_MARKER}
2316
+ import { onMount } from "solid-js";
2255
2317
  import { ZitadelLogin, ZitadelSession, configureZitadel } from "@zitadel/sdk-solid";
2256
2318
 
2257
2319
  const project = configureZitadel({
@@ -2262,20 +2324,14 @@ const project = configureZitadel({
2262
2324
  export default function App() {
2263
2325
  const path = window.location.pathname;
2264
2326
 
2327
+ onMount(() => {
2328
+ if (path === "/") {
2329
+ window.location.replace("/login");
2330
+ }
2331
+ });
2332
+
2265
2333
  if (path === "/") {
2266
- return (
2267
- <main style="position:fixed;inset:0;padding:48px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;background:#0f0f11;color-scheme:dark;color:#f4f4f6;font-family:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;line-height:1.5;letter-spacing:normal;text-align:center">
2268
- <section style="width:100%;max-width:560px">
2269
- <p style="margin:0 0 12px;color:#9ca3af;font-size:14px">Zitadel auth</p>
2270
- <h1 style="margin:0 0 24px;font-size:32px;line-height:1.15;font-weight:600;color:#f4f4f6">Sign in, create an account, or open your profile.</h1>
2271
- <div style="display:flex;flex-wrap:wrap;gap:12px;justify-content:center">
2272
- <a href="/login" style="padding:10px 16px;border-radius:8px;background:#f4f4f6;color:#0f0f11;text-decoration:none;font-weight:600;font-size:14px">Sign in</a>
2273
- <a href="/register" style="padding:10px 16px;border-radius:8px;border:1px solid #3f3f46;color:#f4f4f6;text-decoration:none;font-weight:600;font-size:14px">Create account</a>
2274
- <a href="/profile" style="padding:10px 16px;border-radius:8px;border:1px solid #3f3f46;color:#f4f4f6;text-decoration:none;font-weight:600;font-size:14px">Profile</a>
2275
- </div>
2276
- </section>
2277
- </main>
2278
- );
2334
+ return null;
2279
2335
  }
2280
2336
  if (path.startsWith("/profile")) {
2281
2337
  return (
@@ -2366,16 +2422,18 @@ var SolidPatcher = class extends AbstractRulePatcher {
2366
2422
  //#region src/lib/orca/patchers/rule/svelte/templates.ts
2367
2423
  /**
2368
2424
  * The managed `src/App.svelte`: a minimal path-based router that renders the
2369
- * `@zitadel/sdk-svelte` widgets — a landing chooser at `/`, login at `/login`,
2370
- * register at `/register`, and the signed-in session card at `/profile`. The managed marker lives in
2371
- * the `<script lang="ts">` block (a JS comment) so eject/doctor stay
2372
- * marker-aware. The project id comes from `VITE_ZITADEL_PROJECT_ID`. No secret
2373
- * reaches the browser: the dev proxy in `vite.config.*` attaches the project
2374
- * service-key secret (from `ZITADEL_PROJECT_SECRET`) server-side.
2425
+ * `@zitadel/sdk-svelte` widgets — login at `/login`, register at `/register`, and
2426
+ * the signed-in session card at `/profile`. The root path redirects to `/login`.
2427
+ * The managed marker lives in the `<script lang="ts">` block (a JS comment) so
2428
+ * eject/doctor stay marker-aware. The project id comes from
2429
+ * `VITE_ZITADEL_PROJECT_ID`. No secret reaches the browser: the dev proxy in
2430
+ * `vite.config.*` attaches the project service-key secret (from
2431
+ * `ZITADEL_PROJECT_SECRET`) server-side.
2375
2432
  */
2376
2433
  function appTemplate$1() {
2377
2434
  return `<script lang="ts">
2378
2435
  ${MANAGED_MARKER}
2436
+ import { onMount } from "svelte";
2379
2437
  import { ZitadelLogin, ZitadelSession, configureZitadel } from "@zitadel/sdk-svelte";
2380
2438
 
2381
2439
  const project = configureZitadel({
@@ -2384,21 +2442,15 @@ const project = configureZitadel({
2384
2442
  });
2385
2443
 
2386
2444
  const path = window.location.pathname;
2445
+
2446
+ onMount(() => {
2447
+ if (path === "/") {
2448
+ window.location.replace("/login");
2449
+ }
2450
+ });
2387
2451
  <\/script>
2388
2452
 
2389
- {#if path === "/"}
2390
- <main style="position:fixed;inset:0;padding:48px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;background:#0f0f11;color-scheme:dark;color:#f4f4f6;font-family:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;line-height:1.5;letter-spacing:normal;text-align:center">
2391
- <section style="width:100%;max-width:560px">
2392
- <p style="margin:0 0 12px;color:#9ca3af;font-size:14px">Zitadel auth</p>
2393
- <h1 style="margin:0 0 24px;font-size:32px;line-height:1.15;font-weight:600;color:#f4f4f6">Sign in, create an account, or open your profile.</h1>
2394
- <div style="display:flex;flex-wrap:wrap;gap:12px;justify-content:center">
2395
- <a href="/login" style="padding:10px 16px;border-radius:8px;background:#f4f4f6;color:#0f0f11;text-decoration:none;font-weight:600;font-size:14px">Sign in</a>
2396
- <a href="/register" style="padding:10px 16px;border-radius:8px;border:1px solid #3f3f46;color:#f4f4f6;text-decoration:none;font-weight:600;font-size:14px">Create account</a>
2397
- <a href="/profile" style="padding:10px 16px;border-radius:8px;border:1px solid #3f3f46;color:#f4f4f6;text-decoration:none;font-weight:600;font-size:14px">Profile</a>
2398
- </div>
2399
- </section>
2400
- </main>
2401
- {:else if path.startsWith("/profile")}
2453
+ {#if path.startsWith("/profile")}
2402
2454
  <div style="position:fixed;inset:0;overflow:auto;background:#0f0f11;color-scheme:dark">
2403
2455
  <ZitadelSession {project} postSignOutUrl="/login" />
2404
2456
  </div>
@@ -2406,7 +2458,7 @@ const path = window.location.pathname;
2406
2458
  <div style="position:fixed;inset:0;overflow:auto;background:#0f0f11;color-scheme:dark">
2407
2459
  <ZitadelLogin {project} purpose="register" postSignInUrl="/profile" />
2408
2460
  </div>
2409
- {:else}
2461
+ {:else if path !== "/"}
2410
2462
  <div style="position:fixed;inset:0;overflow:auto;background:#0f0f11;color-scheme:dark">
2411
2463
  <ZitadelLogin {project} purpose="login" postSignInUrl="/profile" />
2412
2464
  </div>
@@ -2480,16 +2532,18 @@ var SveltePatcher = class extends AbstractRulePatcher {
2480
2532
  //#region src/lib/orca/patchers/rule/vue/templates.ts
2481
2533
  /**
2482
2534
  * The managed `src/App.vue`: a minimal path-based router that renders the
2483
- * `@zitadel/sdk-vue` widgets — a landing chooser at `/`, login at `/login`,
2484
- * register at `/register`, and the signed-in session card at `/profile`. The managed marker lives in
2485
- * the `<script setup>` block (a JS comment) so eject/doctor stay marker-aware.
2486
- * The project id comes from `VITE_ZITADEL_PROJECT_ID`. No secret reaches the
2487
- * browser: the dev proxy in `vite.config.*` attaches the project service-key
2488
- * secret (from `ZITADEL_PROJECT_SECRET`) server-side.
2535
+ * `@zitadel/sdk-vue` widgets — login at `/login`, register at `/register`, and
2536
+ * the signed-in session card at `/profile`. The root path redirects to `/login`.
2537
+ * The managed marker lives in the `<script setup>` block (a JS comment) so
2538
+ * eject/doctor stay marker-aware. The project id comes from
2539
+ * `VITE_ZITADEL_PROJECT_ID`. No secret reaches the browser: the dev proxy in
2540
+ * `vite.config.*` attaches the project service-key secret (from
2541
+ * `ZITADEL_PROJECT_SECRET`) server-side.
2489
2542
  */
2490
2543
  function appTemplate() {
2491
2544
  return `<script setup lang="ts">
2492
2545
  ${MANAGED_MARKER}
2546
+ import { onMounted } from "vue";
2493
2547
  import { ZitadelLogin, ZitadelSession, configureZitadel } from "@zitadel/sdk-vue";
2494
2548
 
2495
2549
  const project = configureZitadel({
@@ -2498,25 +2552,17 @@ const project = configureZitadel({
2498
2552
  });
2499
2553
 
2500
2554
  const path = window.location.pathname;
2555
+
2556
+ onMounted(() => {
2557
+ if (path === "/") {
2558
+ window.location.replace("/login");
2559
+ }
2560
+ });
2501
2561
  <\/script>
2502
2562
 
2503
2563
  <template>
2504
- <main
2505
- v-if="path === '/'"
2506
- style="position:fixed;inset:0;padding:48px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;background:#0f0f11;color-scheme:dark;color:#f4f4f6;font-family:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;line-height:1.5;letter-spacing:normal;text-align:center"
2507
- >
2508
- <section style="width:100%;max-width:560px">
2509
- <p style="margin:0 0 12px;color:#9ca3af;font-size:14px">Zitadel auth</p>
2510
- <h1 style="margin:0 0 24px;font-size:32px;line-height:1.15;font-weight:600;color:#f4f4f6">Sign in, create an account, or open your profile.</h1>
2511
- <div style="display:flex;flex-wrap:wrap;gap:12px;justify-content:center">
2512
- <a href="/login" style="padding:10px 16px;border-radius:8px;background:#f4f4f6;color:#0f0f11;text-decoration:none;font-weight:600;font-size:14px">Sign in</a>
2513
- <a href="/register" style="padding:10px 16px;border-radius:8px;border:1px solid #3f3f46;color:#f4f4f6;text-decoration:none;font-weight:600;font-size:14px">Create account</a>
2514
- <a href="/profile" style="padding:10px 16px;border-radius:8px;border:1px solid #3f3f46;color:#f4f4f6;text-decoration:none;font-weight:600;font-size:14px">Profile</a>
2515
- </div>
2516
- </section>
2517
- </main>
2518
2564
  <div
2519
- v-else-if="path.startsWith('/profile')"
2565
+ v-if="path.startsWith('/profile')"
2520
2566
  style="position:fixed;inset:0;overflow:auto;background:#0f0f11;color-scheme:dark"
2521
2567
  >
2522
2568
  <ZitadelSession :project="project" postSignOutUrl="/login" />
@@ -2527,7 +2573,7 @@ const path = window.location.pathname;
2527
2573
  >
2528
2574
  <ZitadelLogin :project="project" purpose="register" postSignInUrl="/profile" />
2529
2575
  </div>
2530
- <div v-else style="position:fixed;inset:0;overflow:auto;background:#0f0f11;color-scheme:dark">
2576
+ <div v-else-if="path !== '/'" style="position:fixed;inset:0;overflow:auto;background:#0f0f11;color-scheme:dark">
2531
2577
  <ZitadelLogin :project="project" purpose="login" postSignInUrl="/profile" />
2532
2578
  </div>
2533
2579
  </template>
@@ -3168,6 +3214,6 @@ function isErrno(error, code) {
3168
3214
  return typeof error === "object" && error !== null && "code" in error && error.code === code;
3169
3215
  }
3170
3216
  //#endregion
3171
- export { issuerFromPort as i, inspectScaffoldTarget as n, RENDERER_IDS as r, createOrca as t };
3217
+ export { removeGuidanceSection as a, AGENTS_HEADER as i, inspectScaffoldTarget as n, issuerFromPort as o, RENDERER_IDS as r, createOrca as t };
3172
3218
 
3173
- //# sourceMappingURL=orca-CpXj_XsA.mjs.map
3219
+ //# sourceMappingURL=orca-_TmrJQMw.mjs.map