@topolo/cli 0.1.31 → 0.1.32

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 (3) hide show
  1. package/README.md +9 -4
  2. package/dist/index.js +147 -60
  3. package/package.json +14 -14
package/README.md CHANGED
@@ -165,10 +165,15 @@ including package/auth/shell/docs/CloudControl files, a deploy-ready
165
165
  Wrangler Worker/static-assets baseline, an Auth service manifest, and a
166
166
  `topolo-conformance.yml` GitHub Actions workflow for first-party platform
167
167
  apps. Add `--write --repo-root <topolo-checkout>` to create the files on disk;
168
- existing files are refused unless `--force` is passed. The generated workflow
169
- checks out the app under `PlatformApplications/<AppDir>`, checks out
170
- `Topolo-io/TopoloDocs`, `Topolo-io/topolo-sdk`, and `Topolo-io/TopoloCli`, builds the
171
- current CLI from source, then runs the local conformance audit with
168
+ existing files are refused unless `--force` is passed. The first-party scaffold
169
+ writes apps under `apps/<AppDir>`, writes canonical docs under
170
+ `system-apps/TopoloDocs/apps/web/src/content`, writes Auth service manifests
171
+ under `topolo-platform/core/TopoloAuth/catalog/service-manifests`, emits a
172
+ project-local `AGENTS.md` for future agent work in the scaffold, and pins the
173
+ generated starter to the current published shared package baseline. The
174
+ generated workflow checks out the app under `apps/<AppDir>`, checks out
175
+ `Topolo-io/TopoloDocs`, `Topolo-io/topolo-sdk`, and `Topolo-io/TopoloCli`, builds
176
+ the current CLI from source, then runs the local conformance audit with
172
177
  `--fail-on needs_review`.
173
178
 
174
179
  For third-party developers, use `--target developer` or `--developer`. Developer
package/dist/index.js CHANGED
@@ -2712,7 +2712,6 @@ var CrmModule = class {
2712
2712
  constructor(client) {
2713
2713
  this.client = client;
2714
2714
  }
2715
- client;
2716
2715
  async listContacts(options = {}) {
2717
2716
  const res = await this.client.request({
2718
2717
  service: "crm",
@@ -2758,7 +2757,6 @@ var IdentityModule = class {
2758
2757
  constructor(client) {
2759
2758
  this.client = client;
2760
2759
  }
2761
- client;
2762
2760
  /** Returns the resolved user, organization, and permission set for the
2763
2761
  * current credential. Equivalent to `TopoloClient.introspect()` — exposed
2764
2762
  * on this module for symmetry with the other domain modules. */
@@ -3684,7 +3682,7 @@ var SOURCE_EXTENSIONS = /* @__PURE__ */ new Set([
3684
3682
  function enrichApplicationAuditWithLocalEvidence(report, options = {}) {
3685
3683
  const repoRoot = resolveTopoloRepoRoot(options.repoRoot, options.cwd ?? process.cwd());
3686
3684
  if (!repoRoot) {
3687
- throw new Error("Could not locate the Topolo checkout. Pass --repo-root with the path that contains PlatformApplications.");
3685
+ throw new Error("Could not locate the Topolo checkout. Pass --repo-root with the path that contains apps/ and system-apps/.");
3688
3686
  }
3689
3687
  const applications = report.applications.map(
3690
3688
  (audit) => enrichApplicationAudit(audit, collectEvidence(repoRoot, audit.application))
@@ -3713,8 +3711,10 @@ function resolveTopoloRepoRoot(explicitRoot, cwd = process.cwd()) {
3713
3711
  }
3714
3712
  }
3715
3713
  function normalizeTopoloRoot(candidate) {
3716
- if (isDirectory(path.join(candidate, "PlatformApplications"))) return candidate;
3717
- if (path.basename(candidate) === "PlatformApplications" && isDirectory(path.join(candidate, "TopoloCli"))) {
3714
+ if (isDirectory(path.join(candidate, "apps")) && isDirectory(path.join(candidate, "system-apps"))) {
3715
+ return candidate;
3716
+ }
3717
+ if (path.basename(candidate) === "apps" && isDirectory(path.join(path.dirname(candidate), "system-apps"))) {
3718
3718
  return path.dirname(candidate);
3719
3719
  }
3720
3720
  return null;
@@ -4298,7 +4298,8 @@ function nativeDashboardWidgetEvidence(evidence) {
4298
4298
  return unique(items);
4299
4299
  }
4300
4300
  function collectEvidence(repoRoot, application) {
4301
- const appRoot = path.join(repoRoot, "PlatformApplications", application.appDir);
4301
+ const appRepoPath = applicationSourcePath(application.appDir);
4302
+ const appRoot = path.join(repoRoot, appRepoPath);
4302
4303
  const packageJsonPath = path.join(appRoot, "package.json");
4303
4304
  const packageJson2 = readPackageJson(packageJsonPath);
4304
4305
  const cloudcontrolPath = path.join(appRoot, "topolo.cloudcontrol.json");
@@ -4539,7 +4540,7 @@ function matchingSystems(repoRoot, application) {
4539
4540
  const docsRoot = topoloDocsRoot(repoRoot);
4540
4541
  const systemsRoot = path.join(docsRoot, "src", "content", "systems");
4541
4542
  if (!isDirectory(systemsRoot)) return [];
4542
- const appRepoPath = `PlatformApplications/${application.appDir}`;
4543
+ const appRepoPath = applicationSourcePath(application.appDir);
4543
4544
  return readdirSync(systemsRoot).filter((entry) => entry.endsWith(".json")).map((entry) => readJson(path.join(systemsRoot, entry))).filter((system) => Boolean(system)).filter((system) => {
4544
4545
  const repoPaths = [...system.repo_paths ?? [], ...system.repoPaths ?? []];
4545
4546
  return repoPaths.some(
@@ -4560,9 +4561,14 @@ function existingDocs(repoRoot, systems) {
4560
4561
  );
4561
4562
  }
4562
4563
  function topoloDocsRoot(repoRoot) {
4563
- const platformDocs = path.join(repoRoot, "PlatformApplications", "TopoloDocs");
4564
- if (isDirectory(platformDocs)) return platformDocs;
4565
- return path.join(repoRoot, "TopoloDocs");
4564
+ return path.join(repoRoot, "system-apps", "TopoloDocs", "apps", "web");
4565
+ }
4566
+ function applicationSourcePath(appDir) {
4567
+ if (appDir === "TopoloCli" || appDir === "TopoloCLI") return "topolo-platform/packages/topolo-cli";
4568
+ if (appDir === "TopoloDocs") return "system-apps/TopoloDocs";
4569
+ if (appDir === "TopoloAuth") return "topolo-platform/core/TopoloAuth";
4570
+ if (appDir === "TopoloCloudControl") return "topolo-platform/core/TopoloCloudControl";
4571
+ return `apps/${appDir}`;
4566
4572
  }
4567
4573
  function docExists(contentRoot, docPath) {
4568
4574
  return [
@@ -4690,10 +4696,12 @@ function unique(items) {
4690
4696
  return Array.from(new Set(items));
4691
4697
  }
4692
4698
  function relativeTopoloPath(filePath) {
4693
- const index = filePath.indexOf("PlatformApplications/");
4699
+ const index = filePath.indexOf("apps/");
4694
4700
  if (index >= 0) return filePath.slice(index);
4695
- const docsIndex = filePath.indexOf("TopoloDocs/");
4701
+ const docsIndex = filePath.indexOf("system-apps/TopoloDocs/");
4696
4702
  if (docsIndex >= 0) return filePath.slice(docsIndex);
4703
+ const platformIndex = filePath.indexOf("topolo-platform/");
4704
+ if (platformIndex >= 0) return filePath.slice(platformIndex);
4697
4705
  return filePath;
4698
4706
  }
4699
4707
  function isDirectory(filePath) {
@@ -4849,11 +4857,11 @@ function escapeSingleQuoted(value) {
4849
4857
  function escapeFrontmatter(value) {
4850
4858
  return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
4851
4859
  }
4852
- function firstPartyAppPath(appDir, audience) {
4853
- if (appDir === "TopoloCli" || appDir === "TopoloCLI") return "Apps/system/TopoloCLI";
4854
- if (appDir === "TopoloDocs") return "Apps/system/TopoloDocs";
4855
- if (appDir === "TopoloAuth") return "Apps/system/TopoloAuth";
4856
- return `${audience === "personal" ? "Apps/personal" : "Apps/business"}/${appDir}`;
4860
+ function firstPartyAppPath(appDir, _audience) {
4861
+ if (appDir === "TopoloCli" || appDir === "TopoloCLI") return "topolo-platform/packages/topolo-cli";
4862
+ if (appDir === "TopoloDocs") return "system-apps/TopoloDocs";
4863
+ if (appDir === "TopoloAuth") return "topolo-platform/core/TopoloAuth";
4864
+ return `apps/${appDir}`;
4857
4865
  }
4858
4866
 
4859
4867
  // src/commands/app-scaffold-package-template.ts
@@ -4871,10 +4879,10 @@ function packageJson(application, target, options) {
4871
4879
  typecheck: "tsc --noEmit"
4872
4880
  };
4873
4881
  if (options.browser) {
4874
- dependencies.react = "^18.3.1";
4875
- dependencies["react-dom"] = "^18.3.1";
4876
- devDependencies["@types/react"] = "^18.3.3";
4877
- devDependencies["@types/react-dom"] = "^18.3.0";
4882
+ dependencies.react = "^19.2.0";
4883
+ dependencies["react-dom"] = "^19.2.0";
4884
+ devDependencies["@types/react"] = "^19.2.2";
4885
+ devDependencies["@types/react-dom"] = "^19.2.2";
4878
4886
  devDependencies["@vitejs/plugin-react"] = "^4.7.0";
4879
4887
  if (target === "platform") {
4880
4888
  dependencies["@topolo-io/auth-client"] = topoloPackageVersion("@topolo-io/auth-client", target);
@@ -4923,28 +4931,28 @@ function topoloPackageVersion(packageName, target) {
4923
4931
  if (target === "developer") {
4924
4932
  if (packageName === "@topolo/login") return "^0.1.0";
4925
4933
  if (packageName === "@topolo-io/auth-client") return "^1.0.0";
4926
- if (packageName === "@topolo/sdk") return "^0.4.1";
4934
+ if (packageName === "@topolo/sdk") return "^0.4.9";
4927
4935
  return "^0.1.0";
4928
4936
  }
4929
- const platformPackageFolders = {
4930
- "@topolo/sdk": "topolo-sdk",
4931
- "@topolo/login": "topolo-login",
4932
- "@topolo-io/app-funnel": "topolo-app-funnel",
4933
- "@topolo-io/app-launcher": "topolo-app-launcher",
4934
- "@topolo-io/app-shell": "topolo-app-shell",
4935
- "@topolo-io/auth-client": "topolo-auth-client",
4936
- "@topolo-io/auth-middleware": "topolo-auth-middleware",
4937
- "@topolo-io/worker-runtime": "topolo-worker-runtime",
4938
- "@topolo-io/design-tokens": "topolo-design-tokens",
4939
- "@topolo-io/onboarding": "topolo-onboarding",
4940
- "@topolo-io/tour": "topolo-tour",
4941
- "@topolo-io/ui-kit": "topolo-ui-kit"
4937
+ const platformPackageVersions = {
4938
+ "@topolo/sdk": "^0.4.9",
4939
+ "@topolo/login": "^0.1.0",
4940
+ "@topolo-io/app-funnel": "^0.1.6",
4941
+ "@topolo-io/app-launcher": "^0.1.15",
4942
+ "@topolo-io/app-shell": "^0.5.54",
4943
+ "@topolo-io/auth-client": "^1.2.1",
4944
+ "@topolo-io/auth-middleware": "^0.3.4",
4945
+ "@topolo-io/worker-runtime": "^0.1.11",
4946
+ "@topolo-io/design-tokens": "^0.1.8",
4947
+ "@topolo-io/onboarding": "^0.9.5",
4948
+ "@topolo-io/tour": "^0.3.4",
4949
+ "@topolo-io/ui-kit": "^0.4.233"
4942
4950
  };
4943
- const folder = platformPackageFolders[packageName];
4944
- if (!folder) {
4951
+ const version = platformPackageVersions[packageName];
4952
+ if (!version) {
4945
4953
  throw new Error(`Unknown Topolo platform package: ${packageName}`);
4946
4954
  }
4947
- return `file:../packages/${folder}`;
4955
+ return version;
4948
4956
  }
4949
4957
  function hasScaffoldResources(resources) {
4950
4958
  return resources.d1 || resources.r2 || resources.queue || resources.workflow || resources.containerProcessing;
@@ -5073,6 +5081,67 @@ function readme(application, target, options) {
5073
5081
  return `${lines.join("\n")}
5074
5082
  `;
5075
5083
  }
5084
+ function agentRules(application, target, options) {
5085
+ const displayName = toTitle(application.name);
5086
+ if (target === "developer") {
5087
+ return [
5088
+ `# AGENTS.md - ${displayName}`,
5089
+ "",
5090
+ "These rules apply to this scaffolded Topolo developer application.",
5091
+ "",
5092
+ "## Scope First",
5093
+ "",
5094
+ "- Confirm whether a change belongs in this app, the public Topolo SDK/Login integration boundary, or the registered `topolo.app.json` manifest before editing.",
5095
+ "- Keep public developer scaffolds independent from private first-party Topolo packages.",
5096
+ "- Keep `topolo.app.json`, callback URLs, requested scopes, and README verification steps aligned with runtime behavior.",
5097
+ "",
5098
+ "## Implementation Rules",
5099
+ "",
5100
+ "- Make focused changes only; do not rewrite generated structure unless the task requires it.",
5101
+ "- For API-backed changes, validate bearer tokens through Topolo Auth and derive tenant context from the verified credential.",
5102
+ "- For browser changes, keep the OAuth authorization-code + PKCE flow intact and do not hardcode user, organization, or household ids.",
5103
+ "- Add or update tests for changed behavior before handoff.",
5104
+ "",
5105
+ "## Verification",
5106
+ "",
5107
+ "- Run `npm run typecheck` and `npm run build` before handoff.",
5108
+ ...options.api ? ["- Run Worker deploy dry-runs or the project deploy check after changing API bindings."] : [],
5109
+ "- Flag any required Topolo Developers registration or provisioning follow-up explicitly.",
5110
+ ""
5111
+ ].join("\n");
5112
+ }
5113
+ const portfolioLabel = options.portfolio === "personal" ? "personal" : "platform";
5114
+ const tenantLabel = options.tenancy === "household" ? "household" : "organization";
5115
+ return [
5116
+ `# AGENTS.md - ${displayName}`,
5117
+ "",
5118
+ "These rules apply to this first-party Topolo scaffold.",
5119
+ "",
5120
+ "## Canonical Ownership",
5121
+ "",
5122
+ "- The workspace-level `/Users/ashes/Projects/Topolo/AGENTS.md` rules still apply.",
5123
+ `- This app is a first-party ${portfolioLabel} app under \`apps/${application.appDir}\` with ${tenantLabel}-scoped product behavior.`,
5124
+ "- Put reusable UI in shared platform packages and reusable API/runtime behavior in shared platform packages; keep this app local only for app-specific product logic.",
5125
+ "- Keep `topolo.app.json`, `topolo.cloudcontrol.json`, TopoloDocs system/public/internal docs, and Auth service manifests aligned with behavior changes.",
5126
+ "- Keep `topolo.app.json` actions current for callable product operations and mark mutating, external-send, billing, export, destructive, and provisioning actions for confirmation.",
5127
+ "",
5128
+ "## Implementation Rules",
5129
+ "",
5130
+ "- Start from `staging`, preserve other agents' work, and do not revert unrelated local changes.",
5131
+ "- Make contained changes at the real ownership boundary; do not patch around shared runtime, auth, launcher, shell, or resource-context issues locally.",
5132
+ "- Browser code should stay on the shared landing/login/callback/AppShell baseline generated by the scaffold.",
5133
+ ...options.api ? ["- API code should stay on `@topolo-io/worker-runtime`, derive auth context from verified credentials, and preserve Nexus usage monitoring."] : [],
5134
+ ...hasScaffoldResources(options.resources) ? ["- Keep Cloudflare resource bindings in Wrangler, CloudControl, Env typing, docs, and README verification output in sync."] : [],
5135
+ "",
5136
+ "## Verification",
5137
+ "",
5138
+ "- Add or update tests for changed behavior; newly added code should be covered.",
5139
+ "- Run the most specific affected tests plus `npm run typecheck` and `npm run build` before handoff.",
5140
+ "- Run `npm run check:deploy-config` after resource binding changes when the script exists.",
5141
+ "- Deploy and verify staging before any production promotion.",
5142
+ ""
5143
+ ].join("\n");
5144
+ }
5076
5145
  function tsconfigJson(api, target) {
5077
5146
  const include = target === "platform" ? ["apps/web/src", ...api ? ["apps/api/src"] : []] : ["src"];
5078
5147
  return `${json({
@@ -6487,10 +6556,10 @@ function scaffoldCommands(options) {
6487
6556
  const portfolioFlags = options.portfolio === "personal" ? " --portfolio personal" : "";
6488
6557
  const profileFlags = options.profile ? ` --profile ${options.profile}` : "";
6489
6558
  return [
6490
- `topolo platform apps scaffold ${scaffoldId}${portfolioFlags}${profileFlags} --write --provision --repo-root /Users/ashes/Projects/Topolo/Platform --json`,
6559
+ `topolo platform apps scaffold ${scaffoldId}${portfolioFlags}${profileFlags} --write --provision --repo-root /Users/ashes/Projects/Topolo --json`,
6491
6560
  "topolo apps requirements --json",
6492
- `topolo apps audit ${options.id} --local --repo-root /Users/ashes/Projects/Topolo/Platform --fail-on needs_review --json`,
6493
- `topolo apps audit ${options.id} --local --repo-root /Users/ashes/Projects/Topolo/Platform --fail-on partial --json`
6561
+ `topolo apps audit ${options.id} --local --repo-root /Users/ashes/Projects/Topolo --fail-on needs_review --json`,
6562
+ `topolo apps audit ${options.id} --local --repo-root /Users/ashes/Projects/Topolo --fail-on partial --json`
6494
6563
  ];
6495
6564
  }
6496
6565
  function topoloConformanceWorkflow(options) {
@@ -6502,7 +6571,7 @@ function topoloConformanceWorkflow(options) {
6502
6571
  " uses: actions/checkout@v4",
6503
6572
  " with:",
6504
6573
  " repository: Topolo-io/TopoloDocs",
6505
- " path: Apps/system/TopoloDocs",
6574
+ " path: system-apps/TopoloDocs",
6506
6575
  " token: ${{ steps.app-token.outputs.token || secrets.TOPOLO_CI_REPO_TOKEN }}"
6507
6576
  ];
6508
6577
  const cliCheckoutStep = options.appDir === "TopoloCLI" || options.appDir === "TopoloCli" ? [] : [
@@ -6512,7 +6581,7 @@ function topoloConformanceWorkflow(options) {
6512
6581
  " uses: actions/checkout@v4",
6513
6582
  " with:",
6514
6583
  " repository: Topolo-io/TopoloCli",
6515
- " path: Apps/system/TopoloCLI",
6584
+ " path: topolo-platform/packages/topolo-cli",
6516
6585
  " token: ${{ steps.app-token.outputs.token || secrets.TOPOLO_CI_REPO_TOKEN }}"
6517
6586
  ];
6518
6587
  return [
@@ -6555,7 +6624,7 @@ function topoloConformanceWorkflow(options) {
6555
6624
  " uses: actions/checkout@v4",
6556
6625
  " with:",
6557
6626
  " repository: Topolo-io/topolo-sdk",
6558
- " path: Apps/packages/topolo-sdk",
6627
+ " path: topolo-platform/packages/topolo-sdk",
6559
6628
  " token: ${{ steps.app-token.outputs.token || secrets.TOPOLO_CI_REPO_TOKEN }}",
6560
6629
  ...cliCheckoutStep,
6561
6630
  "",
@@ -6572,14 +6641,14 @@ function topoloConformanceWorkflow(options) {
6572
6641
  "",
6573
6642
  " - name: Build Topolo SDK",
6574
6643
  ` if: steps.app-token.outputs.token != '' || env.HAS_TOPOLO_CI_REPO_TOKEN == 'true'`,
6575
- " working-directory: Apps/packages/topolo-sdk",
6644
+ " working-directory: topolo-platform/packages/topolo-sdk",
6576
6645
  " run: |",
6577
6646
  " npm install --no-audit --no-fund",
6578
6647
  " npm run build",
6579
6648
  "",
6580
6649
  " - name: Build Topolo CLI",
6581
6650
  ` if: steps.app-token.outputs.token != '' || env.HAS_TOPOLO_CI_REPO_TOKEN == 'true'`,
6582
- " working-directory: Apps/system/TopoloCLI",
6651
+ " working-directory: topolo-platform/packages/topolo-cli",
6583
6652
  " run: |",
6584
6653
  " npm install --no-audit --no-fund",
6585
6654
  " npm run build",
@@ -6587,13 +6656,13 @@ function topoloConformanceWorkflow(options) {
6587
6656
  " - name: Run Topolo app conformance audit",
6588
6657
  ` if: steps.app-token.outputs.token != '' || env.HAS_TOPOLO_CI_REPO_TOKEN == 'true'`,
6589
6658
  " run: |",
6590
- ` node Apps/system/TopoloCLI/dist/index.js apps audit ${options.id} --local --repo-root "$GITHUB_WORKSPACE" --fail-on needs_review --json`,
6659
+ ` node topolo-platform/packages/topolo-cli/dist/index.js apps audit ${options.id} --local --repo-root "$GITHUB_WORKSPACE" --fail-on needs_review --json`,
6591
6660
  "",
6592
6661
  " - name: Record green CI evidence",
6593
6662
  ` if: \${{ success() && (steps.app-token.outputs.token != '' || env.HAS_TOPOLO_CI_REPO_TOKEN == 'true') }}`,
6594
6663
  ` working-directory: ${appPath}`,
6595
6664
  " run: |",
6596
- ` node "$GITHUB_WORKSPACE/Apps/system/TopoloCLI/dist/index.js" apps record-evidence ${options.id} --build --typecheck --test --commit "$GITHUB_SHA"`
6665
+ ` node "$GITHUB_WORKSPACE/topolo-platform/packages/topolo-cli/dist/index.js" apps record-evidence ${options.id} --build --typecheck --test --commit "$GITHUB_SHA"`
6597
6666
  ].join("\n");
6598
6667
  }
6599
6668
 
@@ -6743,6 +6812,9 @@ function scaffoldPackages(options) {
6743
6812
  packages.add("@topolo-io/app-launcher");
6744
6813
  packages.add("@topolo-io/app-shell");
6745
6814
  packages.add("@topolo-io/auth-client");
6815
+ packages.add("@topolo-io/design-tokens");
6816
+ packages.add("@topolo-io/onboarding");
6817
+ packages.add("@topolo-io/tour");
6746
6818
  packages.add("@topolo-io/ui-kit");
6747
6819
  }
6748
6820
  if (options.api) {
@@ -6805,6 +6877,21 @@ function scaffoldFiles(options) {
6805
6877
  ],
6806
6878
  content: gitignore()
6807
6879
  },
6880
+ {
6881
+ path: `${base}/AGENTS.md`,
6882
+ purpose: "Local agent rules for safe work inside the generated project.",
6883
+ requiredSignals: [
6884
+ "states the app-specific ownership boundary",
6885
+ "keeps future agents aligned with Topolo docs, manifest, testing, and staging expectations"
6886
+ ],
6887
+ content: agentRules(application, target, {
6888
+ api: options.api,
6889
+ audience: options.payload.audience,
6890
+ tenancy: options.payload.tenancy,
6891
+ portfolio: options.payload.portfolio,
6892
+ resources: options.payload.resources
6893
+ })
6894
+ },
6808
6895
  {
6809
6896
  path: `${base}/tsconfig.json`,
6810
6897
  purpose: "TypeScript configuration for the generated app.",
@@ -6904,15 +6991,15 @@ function scaffoldFiles(options) {
6904
6991
  path: `${base}/.github/workflows/topolo-conformance.yml`,
6905
6992
  purpose: "PR/push gate that runs the local Topolo app audit with docs evidence.",
6906
6993
  requiredSignals: [
6907
- "checks out this repo under its Apps lane directory",
6908
- "checks out TopoloDocs under Apps/system/TopoloDocs",
6994
+ "checks out this repo under its workspace app directory",
6995
+ "checks out TopoloDocs under system-apps/TopoloDocs",
6909
6996
  "checks out topolo-sdk and TopoloCli from main so the gate does not wait for an npm publish",
6910
6997
  "runs topolo apps audit with --local and --fail-on needs_review"
6911
6998
  ],
6912
6999
  content: options.ciWorkflow ?? ""
6913
7000
  },
6914
7001
  {
6915
- path: `Apps/system/TopoloDocs/src/content/systems/topolo-${slug}.json`,
7002
+ path: `system-apps/TopoloDocs/apps/web/src/content/systems/topolo-${slug}.json`,
6916
7003
  purpose: "Canonical system registry entry.",
6917
7004
  requiredSignals: [
6918
7005
  `repo_paths includes ${base}`,
@@ -6929,7 +7016,7 @@ function scaffoldFiles(options) {
6929
7016
  })
6930
7017
  },
6931
7018
  {
6932
- path: `Apps/system/TopoloDocs/src/content/internal/apps/${slug}.mdx`,
7019
+ path: `system-apps/TopoloDocs/apps/web/src/content/internal/apps/${slug}.mdx`,
6933
7020
  purpose: "Internal operator handbook.",
6934
7021
  requiredSignals: [
6935
7022
  "documents ownership, routes, auth boundary, deployment, operations, and verification",
@@ -6945,7 +7032,7 @@ function scaffoldFiles(options) {
6945
7032
  })
6946
7033
  },
6947
7034
  {
6948
- path: `Apps/system/TopoloDocs/src/content/public/applications/${slug}.mdx`,
7035
+ path: `system-apps/TopoloDocs/apps/web/src/content/public/applications/${slug}.mdx`,
6949
7036
  purpose: "Public application overview.",
6950
7037
  requiredSignals: [
6951
7038
  "documents the product surface without internal-only details",
@@ -6964,7 +7051,7 @@ function scaffoldFiles(options) {
6964
7051
  if (options.api && application.serviceId) {
6965
7052
  files.push(
6966
7053
  {
6967
- path: `Apps/system/TopoloAuth/catalog/service-manifests/${application.serviceId}.json`,
7054
+ path: `topolo-platform/core/TopoloAuth/catalog/service-manifests/${application.serviceId}.json`,
6968
7055
  purpose: "Auth service manifest for first-party permissions, role bundles, and API-key scopes.",
6969
7056
  requiredSignals: [
6970
7057
  "serviceId matches the generated Worker service id",
@@ -7412,7 +7499,7 @@ function cloudcontrolJson(application, options) {
7412
7499
  ];
7413
7500
  return `${json({
7414
7501
  name: `topolo-${slug}`,
7415
- description: `Canonical documentation for ${toTitle(application.name)} lives in Apps/system/TopoloDocs.`,
7502
+ description: `Canonical documentation for ${toTitle(application.name)} lives in system-apps/TopoloDocs.`,
7416
7503
  deploy_method: "wrangler",
7417
7504
  ci_provider: "github_actions",
7418
7505
  repo_identity: {
@@ -7563,7 +7650,7 @@ function internalDocs(application, options) {
7563
7650
  `last_verified: "${CURRENT_VERIFICATION_DATE}"`,
7564
7651
  "source_repos:",
7565
7652
  ` - "${appPath}"`,
7566
- ' - "Apps/system/TopoloDocs"',
7653
+ ' - "system-apps/TopoloDocs"',
7567
7654
  'audience: "internal"',
7568
7655
  "tags:",
7569
7656
  ` - "${slug}"`,
@@ -7596,7 +7683,7 @@ function internalDocs(application, options) {
7596
7683
  ...options.api ? [`- \`${appPath}/apps/api/src/worker.ts\``, `- \`${appPath}/apps/api/wrangler.toml\``] : [],
7597
7684
  `- \`${appPath}/topolo.app.json\``,
7598
7685
  `- \`${appPath}/topolo.cloudcontrol.json\``,
7599
- ...options.api && application.serviceId ? [`- \`Apps/system/TopoloAuth/catalog/service-manifests/${application.serviceId}.json\``] : [],
7686
+ ...options.api && application.serviceId ? [`- \`topolo-platform/core/TopoloAuth/catalog/service-manifests/${application.serviceId}.json\``] : [],
7600
7687
  "",
7601
7688
  "## API Reference",
7602
7689
  "",
@@ -7625,7 +7712,7 @@ function internalDocs(application, options) {
7625
7712
  "## Debugging",
7626
7713
  "",
7627
7714
  "- run `npm run typecheck` and `npm run build` in the application directory",
7628
- "- run `topolo apps audit <app> --local --repo-root /Users/ashes/Projects/Topolo/Platform --fail-on needs_review --json` after SDK catalog registration",
7715
+ "- run `topolo apps audit <app> --local --repo-root /Users/ashes/Projects/Topolo --fail-on needs_review --json` after SDK catalog registration",
7629
7716
  "- inspect `topolo.cloudcontrol.json` before deployment changes",
7630
7717
  ...options.api ? ["- inspect the Worker `SERVICE_ID` binding and matching Auth service manifest when permission grants fail"] : [],
7631
7718
  ...options.api && application.serviceId ? [`- re-run \`topolo platform apps scaffold ${slug} --write --provision\` when embedded app login, launcher visibility, or callback origins drift`] : [],
@@ -8178,7 +8265,7 @@ function registerAppsCommand(program2) {
8178
8265
  });
8179
8266
  apps.command("scaffold <application>").description(
8180
8267
  "Generate a third-party Topolo application scaffold for business or personal/household use."
8181
- ).option("--json", "Output JSON").option("--no-json", "Output human-readable checklist").option("--app-dir <path>", "Application directory under PlatformApplications").option("--name <name>", "Application display/package source name").option("--package-name <name>", "package.json name").option("--production-url <url>", "Production browser URL").option("--service <id>", "Stable SDK/Auth service id for API-backed apps").option("--audience <audience>", "Developer app audience: business or personal").option("--tenancy <tenancy>", "Developer app tenancy: organization or household").option(
8268
+ ).option("--json", "Output JSON").option("--no-json", "Output human-readable checklist").option("--app-dir <path>", "Application directory under the scaffold root").option("--name <name>", "Application display/package source name").option("--package-name <name>", "package.json name").option("--production-url <url>", "Production browser URL").option("--service <id>", "Stable SDK/Auth service id for API-backed apps").option("--audience <audience>", "Developer app audience: business or personal").option("--tenancy <tenancy>", "Developer app tenancy: organization or household").option(
8182
8269
  "--surface-model <surfaceModel>",
8183
8270
  "Developer app surface model: web_app, mobile_container, mobile_module, or messaging_surface"
8184
8271
  ).option("--container-app-id <appId>", "Container app id when --surface-model mobile_module is used").option("--write", "Write the generated scaffold files to disk").option("--repo-root <path>", "Directory where scaffold files should be written").option("--force", "Overwrite existing scaffold files when --write is set").option("--with-api", "Include API/service files for developer scaffolds").option("--no-api", "Do not include API/service requirements").option("--no-browser", "Do not include browser-shell requirements").option(
@@ -8602,7 +8689,7 @@ function registerPlatformCommand(program2) {
8602
8689
  const platformApps = platform3.command("apps").description("Scaffold and operate first-party Topolo platform and personal applications");
8603
8690
  platformApps.command("scaffold <application>").description(
8604
8691
  "Generate a first-party Topolo scaffold for the platform or personal portfolio."
8605
- ).option("--json", "Output JSON").option("--no-json", "Output human-readable checklist").option("--app-dir <path>", "Application directory under PlatformApplications").option("--name <name>", "Application display/package source name").option("--package-name <name>", "package.json name").option("--production-url <url>", "Production browser URL").option("--service <id>", "Stable SDK/Auth service id for API-backed apps").option("--portfolio <portfolio>", "First-party portfolio: platform or personal").option(
8692
+ ).option("--json", "Output JSON").option("--no-json", "Output human-readable checklist").option("--app-dir <path>", "Application directory under apps/").option("--name <name>", "Application display/package source name").option("--package-name <name>", "package.json name").option("--production-url <url>", "Production browser URL").option("--service <id>", "Stable SDK/Auth service id for API-backed apps").option("--portfolio <portfolio>", "First-party portfolio: platform or personal").option(
8606
8693
  "--surface-model <surfaceModel>",
8607
8694
  "First-party surface model: web_app, mobile_container, mobile_module, or messaging_surface"
8608
8695
  ).option("--container-app-id <appId>", "Container app id when --surface-model mobile_module is used").option("--profile <profile>", "First-party scaffold profile such as spatial-assets").option("--with-d1", "Declare a D1 binding in the first-party scaffold").option("--with-r2", "Declare an R2 binding in the first-party scaffold").option("--with-queue", "Declare a Queue binding in the first-party scaffold").option("--with-workflow", "Declare a Workflow binding in the first-party scaffold").option("--with-container-processing", "Declare container-processing metadata in CloudControl").option("--write", "Write the generated scaffold files to disk").option("--repo-root <path>", "Directory where scaffold files should be written").option("--force", "Overwrite existing scaffold files when --write is set").option("--with-api", "Include the API/service baseline").option("--no-api", "Do not include API/service requirements").option("--no-browser", "Do not include browser-shell requirements").option(
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
1
  {
2
2
  "name": "@topolo/cli",
3
- "version": "0.1.31",
3
+ "version": "0.1.32",
4
4
  "description": "Command-line interface for Topolo developers, operators, and agents, with internal first-party scaffolding available under the topolo platform namespace.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "topolo": "./dist/index.js"
7
+ "topolo": "dist/index.js"
8
8
  },
9
9
  "files": [
10
10
  "dist"
11
11
  ],
12
+ "scripts": {
13
+ "build": "tsup",
14
+ "dev": "tsup --watch",
15
+ "typecheck": "tsc --noEmit",
16
+ "start": "node dist/index.js",
17
+ "test": "vitest run",
18
+ "test:watch": "vitest",
19
+ "coverage": "vitest run --coverage"
20
+ },
12
21
  "dependencies": {
13
22
  "commander": "^12.1.0"
14
23
  },
15
24
  "devDependencies": {
25
+ "@topolo/sdk": "workspace:*",
16
26
  "@types/node": "^20.12.0",
17
27
  "@vitest/coverage-v8": "^2.1.0",
18
28
  "tsup": "^8.0.0",
19
29
  "typescript": "^5.4.0",
20
- "vitest": "^2.1.0",
21
- "@topolo/sdk": "0.4.9"
30
+ "vitest": "^2.1.0"
22
31
  },
23
32
  "engines": {
24
33
  "node": ">=20"
25
- },
26
- "scripts": {
27
- "build": "tsup",
28
- "dev": "tsup --watch",
29
- "typecheck": "tsc --noEmit",
30
- "start": "node dist/index.js",
31
- "test": "vitest run",
32
- "test:watch": "vitest",
33
- "coverage": "vitest run --coverage"
34
34
  }
35
- }
35
+ }