create-thally-docs 0.9.0 → 0.10.0

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.
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/stable-scaffold-release.json
4
+ var stable_scaffold_release_default = {
5
+ schemaVersion: 1,
6
+ id: "2026-08-05.04438581.baf29307",
7
+ source: {
8
+ repository: "thallylabs/starter",
9
+ commitSha: "04438581a402d02e9f4308ff047c4c4a48d8169f",
10
+ treeSha: "c962a01b3b8b24ffdb65671c2f7805a47175ba42",
11
+ archiveUrl: "https://codeload.github.com/thallylabs/starter/tar.gz/04438581a402d02e9f4308ff047c4c4a48d8169f",
12
+ manifestPath: "starter-release.json",
13
+ manifestSha256: "e019c6416c6c6872114cdf9d9b5eec6579873f46f826748cf39254fd16628392"
14
+ },
15
+ runtime: {
16
+ repository: "thallylabs/thally",
17
+ commitSha: "baf2930771baf449238bd6c68101ceb3af33ee96",
18
+ treeSha: "56f8217b4da6740015e4775d2ce0aeb60bc167a0",
19
+ contentSource: "assets",
20
+ identityContractVersion: 1
21
+ },
22
+ starterVersion: 2
23
+ };
24
+
25
+ // src/previous-scaffold-releases.json
26
+ var previous_scaffold_releases_default = [
27
+ {
28
+ schemaVersion: 1,
29
+ id: "2026-08-05.d5fef916.f3817263",
30
+ source: {
31
+ repository: "thallylabs/starter",
32
+ commitSha: "d5fef9167ea81f12a861deec5515a78a0f756781",
33
+ treeSha: "31c1e49342ce9f4122dc0cd60fe714868ca03150",
34
+ archiveUrl: "https://codeload.github.com/thallylabs/starter/tar.gz/d5fef9167ea81f12a861deec5515a78a0f756781",
35
+ manifestPath: "starter-release.json",
36
+ manifestSha256: "06cccd3496c368ef95a11b3afc15add610f261b8106e8371720b084adbf7fa5a"
37
+ },
38
+ runtime: {
39
+ repository: "thallylabs/thally",
40
+ commitSha: "f38172638cd2cc944ac9ecda19c096ce4d9b4599",
41
+ treeSha: "d33ad60ad0acabee1cf950880c8bd908e83a002a",
42
+ contentSource: "assets",
43
+ identityContractVersion: 1
44
+ },
45
+ starterVersion: 1
46
+ }
47
+ ];
48
+
49
+ // src/release.ts
50
+ var STABLE_SCAFFOLD_RELEASE = stable_scaffold_release_default;
51
+ var SUPPORTED_SCAFFOLD_RELEASES = [
52
+ STABLE_SCAFFOLD_RELEASE,
53
+ ...previous_scaffold_releases_default
54
+ ];
55
+ function isStableScaffoldRelease(value) {
56
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
57
+ const candidate = value;
58
+ return candidate.schemaVersion === STABLE_SCAFFOLD_RELEASE.schemaVersion && candidate.id === STABLE_SCAFFOLD_RELEASE.id && candidate.starterVersion === STABLE_SCAFFOLD_RELEASE.starterVersion && candidate.source?.repository === STABLE_SCAFFOLD_RELEASE.source.repository && candidate.source?.commitSha === STABLE_SCAFFOLD_RELEASE.source.commitSha && candidate.source?.treeSha === STABLE_SCAFFOLD_RELEASE.source.treeSha && candidate.source?.archiveUrl === STABLE_SCAFFOLD_RELEASE.source.archiveUrl && candidate.source?.manifestPath === STABLE_SCAFFOLD_RELEASE.source.manifestPath && candidate.source?.manifestSha256 === STABLE_SCAFFOLD_RELEASE.source.manifestSha256 && candidate.runtime?.repository === STABLE_SCAFFOLD_RELEASE.runtime.repository && candidate.runtime?.commitSha === STABLE_SCAFFOLD_RELEASE.runtime.commitSha && candidate.runtime?.treeSha === STABLE_SCAFFOLD_RELEASE.runtime.treeSha && candidate.runtime?.contentSource === STABLE_SCAFFOLD_RELEASE.runtime.contentSource && candidate.runtime?.identityContractVersion === STABLE_SCAFFOLD_RELEASE.runtime.identityContractVersion;
59
+ }
60
+
61
+ export {
62
+ STABLE_SCAFFOLD_RELEASE,
63
+ SUPPORTED_SCAFFOLD_RELEASES,
64
+ isStableScaffoldRelease
65
+ };
@@ -1,93 +1,39 @@
1
1
  /**
2
- * Lowest `@thallylabs/cli` release a scaffold may declare.
2
+ * Documented owner-field personalization for the immutable starter tree.
3
3
  *
4
- * The managed builder depends on the Cloudflare-aware CLI contract, so a site
5
- * scaffolded from an older or locally-vendored template must not keep a
6
- * pre-Workers pin. This is a FLOOR, never an override: the canonical template
7
- * tracks the newest published CLI, and overwriting its pin with a constant that
8
- * has since aged past it silently downgrades every generated site. Raise it
9
- * only alongside a released CLI — `scaffold-hygiene.test.ts` fails if it ever
10
- * climbs above the version this monorepo publishes.
4
+ * Runtime source, authored pages, navigation structure, dependencies, CI, and
5
+ * repository policy all belong to `thallylabs/starter`. This module may change
6
+ * only the small set of fields an owner answers during creation.
11
7
  */
12
- declare const MIN_CLI_VERSION = "0.7.0";
13
- /**
14
- * Lowest `@thallylabs/mcp` release a scaffold may declare. Same floor semantics
15
- * as {@link MIN_CLI_VERSION}; it also stands in for the unresolvable `*` range
16
- * that older workspace-based templates used.
17
- */
18
- declare const MIN_MCP_VERSION = "0.9.0";
19
- /**
20
- * Resolve a dependency pin to at least `floor`, preferring what the template
21
- * already ships. An absent, unresolvable, or demonstrably older pin becomes the
22
- * floor; anything newer — or anything the comparison cannot rank — survives.
23
- */
24
- declare function raisePinToFloor(current: string | undefined, floor: string): string;
25
8
  interface StarterLocale {
26
9
  code: string;
27
10
  label: string;
28
11
  }
29
- interface StarterFile {
30
- path: string;
31
- content: string;
32
- }
33
- interface BuildStarterFilesOptions {
12
+ interface StarterPersonalizationOptions {
34
13
  projectName: string;
35
- enableAiChat?: boolean;
36
- repoUrl?: string;
14
+ packageName: string;
15
+ description: string;
16
+ brandPreset: string;
17
+ repoUrl: string;
18
+ enableAiChat: boolean;
37
19
  i18nLocales?: Array<StarterLocale>;
38
20
  }
39
- declare function buildStarterDocsJson({ enableAiChat, repoUrl, i18nLocales, }: {
40
- enableAiChat: boolean;
41
- repoUrl?: string;
42
- i18nLocales?: Array<{
43
- code: string;
44
- label: string;
45
- }>;
46
- }): string;
47
21
  /**
48
- * Render the complete site-owned starter layer without reading or writing the
49
- * filesystem. CLI, MCP, and Thally Cloud consume these exact bytes so a new
50
- * site cannot vary by which creation entry point the user chose.
51
- */
52
- declare function buildStarterFiles({ projectName, enableAiChat, repoUrl, i18nLocales, }: BuildStarterFilesOptions): Array<StarterFile>;
53
- declare function writeStarterContent(targetDir: string, projectName: string, enableAiChat?: boolean, repoUrl?: string, i18nLocales?: Array<{
54
- code: string;
55
- label: string;
56
- }>): void;
57
- declare function writeStarterAgentGuide(targetDir: string, projectName: string): void;
58
- declare function writeStarterReadme(targetDir: string, projectName: string): void;
59
- /**
60
- * Write provider-portable Cloudflare Workers configuration into every scaffold.
22
+ * Personalize only the owner-controlled settings in `docs.json`.
61
23
  *
62
- * The files contain no account, route, bucket, or token identifiers. Thally
63
- * Cloud supplies those operational values while self-hosters can deploy the
64
- * same source tree to their own account without editing application internals.
24
+ * Authored tabs, groups, pages, theme choices, and every unrelated key remain
25
+ * byte-for-byte equivalent after JSON normalization.
65
26
  */
66
- declare function writeCloudflareRuntimeConfig(targetDir: string, slug: string): void;
27
+ declare function updateStarterDocsConfig(targetDir: string, enableAiChat: boolean, repoUrl: string, i18nLocales?: Array<StarterLocale>): void;
28
+ /** Personalize the documented identity and repository fields in `site.ts`. */
67
29
  declare function updateSiteConfig(targetDir: string, projectName: string, description: string, brandPreset: string, repoUrl: string): void;
68
- declare function patchApiReferenceGuard(targetDir: string): void;
69
- declare function patchTopBarNavigation(targetDir: string): void;
70
- declare function patchOpenApiFetch(targetDir: string): void;
30
+ /** Rename only the root package identity; dependency pins belong to starter. */
31
+ declare function updatePackageIdentity(targetDir: string, packageName: string): void;
32
+ /** Update the provider-portable Worker name without recreating its config. */
33
+ declare function updateCloudflareRuntimeName(targetDir: string, packageName: string): void;
34
+ /** Copy the canonical environment guide to the ignored local filename. */
71
35
  declare function updateEnvExample(targetDir: string): void;
72
- /**
73
- * Normalize the canonical docs package for a newly named standalone site.
74
- * `thallylabs/docs` is already standalone, while this defensive cleanup also
75
- * keeps local or older monorepo-based sources safe to scaffold:
76
- *
77
- * - `workspaces` points at a directory that doesn't exist in scaffolds.
78
- * - `prebuild`/`pretest` invoke `packages:build`, which builds those absent
79
- * workspaces. Runtime sources and embeddings stay in `prebuild`: both run
80
- * standalone and supply request-time data in filesystem-free Workers.
81
- * - The copied `package-lock.json` still resolves the monorepo's workspace
82
- * graph; deleting it lets the scaffold's own `npm install` write a clean
83
- * lockfile. Workspace-linked deps (e.g. @thallylabs/core) resolve from the
84
- * npm registry instead, which is why the template must depend on published
85
- * versions, never `workspace:*` specs.
86
- *
87
- * Also names the package after the site so `npm ls`/lockfiles read correctly.
88
- */
89
- declare function patchPackageJson(targetDir: string, slug: string): void;
90
- /** Ensure dependency folders are ignored at any depth in generated sites. */
91
- declare function patchGitignore(targetDir: string): void;
36
+ /** Apply the complete, intentionally narrow owner-personalization contract. */
37
+ declare function personalizeStarter(targetDir: string, options: StarterPersonalizationOptions): void;
92
38
 
93
- export { type BuildStarterFilesOptions, MIN_CLI_VERSION, MIN_MCP_VERSION, type StarterFile, type StarterLocale, buildStarterDocsJson, buildStarterFiles, patchApiReferenceGuard, patchGitignore, patchOpenApiFetch, patchPackageJson, patchTopBarNavigation, raisePinToFloor, updateEnvExample, updateSiteConfig, writeCloudflareRuntimeConfig, writeStarterAgentGuide, writeStarterContent, writeStarterReadme };
39
+ export { type StarterLocale, type StarterPersonalizationOptions, personalizeStarter, updateCloudflareRuntimeName, updateEnvExample, updatePackageIdentity, updateSiteConfig, updateStarterDocsConfig };
package/dist/customize.js CHANGED
@@ -1,37 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- MIN_CLI_VERSION,
4
- MIN_MCP_VERSION,
5
- buildStarterDocsJson,
6
- buildStarterFiles,
7
- patchApiReferenceGuard,
8
- patchGitignore,
9
- patchOpenApiFetch,
10
- patchPackageJson,
11
- patchTopBarNavigation,
12
- raisePinToFloor,
3
+ personalizeStarter,
4
+ updateCloudflareRuntimeName,
13
5
  updateEnvExample,
6
+ updatePackageIdentity,
14
7
  updateSiteConfig,
15
- writeCloudflareRuntimeConfig,
16
- writeStarterAgentGuide,
17
- writeStarterContent,
18
- writeStarterReadme
19
- } from "./chunk-BW7J7DJV.js";
8
+ updateStarterDocsConfig
9
+ } from "./chunk-ORUAMPNF.js";
20
10
  export {
21
- MIN_CLI_VERSION,
22
- MIN_MCP_VERSION,
23
- buildStarterDocsJson,
24
- buildStarterFiles,
25
- patchApiReferenceGuard,
26
- patchGitignore,
27
- patchOpenApiFetch,
28
- patchPackageJson,
29
- patchTopBarNavigation,
30
- raisePinToFloor,
11
+ personalizeStarter,
12
+ updateCloudflareRuntimeName,
31
13
  updateEnvExample,
14
+ updatePackageIdentity,
32
15
  updateSiteConfig,
33
- writeCloudflareRuntimeConfig,
34
- writeStarterAgentGuide,
35
- writeStarterContent,
36
- writeStarterReadme
16
+ updateStarterDocsConfig
37
17
  };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  migrateDocs
4
- } from "./chunk-YWNWLSZ2.js";
4
+ } from "./chunk-GAFCLXU4.js";
5
5
  import {
6
6
  logo,
7
7
  readDocsJson,
@@ -9,9 +9,11 @@ import {
9
9
  slugify,
10
10
  success,
11
11
  writeDocsJson
12
- } from "./chunk-JNDRCCJV.js";
13
- import "./chunk-BW7J7DJV.js";
14
- import "./chunk-PJW4JJIT.js";
12
+ } from "./chunk-GTGHYJXS.js";
13
+ import "./chunk-ORUAMPNF.js";
14
+ import "./chunk-ENQIF6MA.js";
15
+ import "./chunk-KXJT2MG5.js";
16
+ import "./chunk-WMHBVXWW.js";
15
17
 
16
18
  // src/index.ts
17
19
  import { existsSync as existsSync3, readdirSync as readdirSync2 } from "fs";
@@ -151,7 +153,7 @@ async function gatherAnswers(dirArg, useDefaults, installPreference) {
151
153
  let i18nLocales;
152
154
  if (!useDefaults) {
153
155
  const enableI18n = await input({
154
- message: " Add languages beyond English and Spanish? (y/N):",
156
+ message: " Add another documentation language? (y/N):",
155
157
  default: "N"
156
158
  });
157
159
  if (enableI18n.toLowerCase() === "y") {
@@ -1,10 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  migrateDocs
4
- } from "../chunk-YWNWLSZ2.js";
5
- import "../chunk-JNDRCCJV.js";
6
- import "../chunk-BW7J7DJV.js";
7
- import "../chunk-PJW4JJIT.js";
4
+ } from "../chunk-GAFCLXU4.js";
5
+ import "../chunk-GTGHYJXS.js";
6
+ import "../chunk-ORUAMPNF.js";
7
+ import "../chunk-ENQIF6MA.js";
8
+ import "../chunk-KXJT2MG5.js";
9
+ import "../chunk-WMHBVXWW.js";
8
10
  export {
9
11
  migrateDocs
10
12
  };
package/dist/release.d.ts CHANGED
@@ -11,6 +11,22 @@ interface ScaffoldSourceRelease {
11
11
  commitSha: string;
12
12
  treeSha: string;
13
13
  archiveUrl: string;
14
+ manifestPath: 'starter-release.json';
15
+ manifestSha256: string;
16
+ }
17
+ interface ScaffoldOwnershipContract {
18
+ frameworkSyncEligible: readonly string[];
19
+ userOwnedNeverOverwrite: readonly string[];
20
+ manualReview: readonly string[];
21
+ }
22
+ interface StarterReleaseManifest {
23
+ schemaVersion: 1;
24
+ starterVersion: number;
25
+ repository: string;
26
+ defaultBranch: string;
27
+ runtime: Pick<ScaffoldRuntimeRelease, 'repository' | 'commitSha' | 'treeSha'>;
28
+ packages: Record<string, string>;
29
+ ownership: ScaffoldOwnershipContract;
14
30
  }
15
31
  interface ScaffoldRuntimeRelease {
16
32
  repository: string;
@@ -29,30 +45,22 @@ interface ScaffoldRelease {
29
45
  /**
30
46
  * Current stable scaffold release.
31
47
  *
32
- * The source commit is the refreshed public docs template and the runtime
33
- * commit is the matching engine change. `create-thally-docs`, the CLI, MCP,
34
- * and Thally Cloud all import this exact record rather than following a moving
35
- * branch independently.
48
+ * The source commit is the complete, standalone `thallylabs/starter` tree and
49
+ * the runtime commit is the matching engine change. `create-thally-docs`, the
50
+ * CLI, MCP, and Thally Cloud all import this exact record rather than following
51
+ * a moving branch independently. Promotion replaces the placeholders in the
52
+ * adjacent JSON record, which is also consumed by Cloud build parity checks.
53
+ */
54
+ declare const STABLE_SCAFFOLD_RELEASE: ScaffoldRelease;
55
+ /**
56
+ * Immutable releases this toolchain can use as a three-way update base.
57
+ *
58
+ * Promotion prepends the new stable record but retains earlier records. That
59
+ * lets a project created directly from GitHub carry only the exact manifest
60
+ * bytes and still resolve its original starter without mutable branch state.
36
61
  */
37
- declare const STABLE_SCAFFOLD_RELEASE: {
38
- readonly schemaVersion: 1;
39
- readonly id: "2026-08-04.b0094de4.e36d2bcf";
40
- readonly source: {
41
- readonly repository: "thallylabs/docs";
42
- readonly commitSha: "b0094de4fea84567eb12c39c6783fdae6820bb98";
43
- readonly treeSha: "ffd0a6fda07341ddd1ba164cb40acef796f89e2d";
44
- readonly archiveUrl: "https://codeload.github.com/thallylabs/docs/tar.gz/b0094de4fea84567eb12c39c6783fdae6820bb98";
45
- };
46
- readonly runtime: {
47
- readonly repository: "thallylabs/thally";
48
- readonly commitSha: "e36d2bcff38f7638a77369e12773a7cab4d5d9ce";
49
- readonly treeSha: "1c8b0358d78d8caa14ed039bff6ab47c98b685d8";
50
- readonly contentSource: "assets";
51
- readonly identityContractVersion: 1;
52
- };
53
- readonly starterVersion: 1;
54
- };
62
+ declare const SUPPORTED_SCAFFOLD_RELEASES: readonly ScaffoldRelease[];
55
63
  /** True only when an unknown record is the currently supported release. */
56
64
  declare function isStableScaffoldRelease(value: unknown): value is ScaffoldRelease;
57
65
 
58
- export { STABLE_SCAFFOLD_RELEASE, type ScaffoldRelease, type ScaffoldRuntimeRelease, type ScaffoldSourceRelease, isStableScaffoldRelease };
66
+ export { STABLE_SCAFFOLD_RELEASE, SUPPORTED_SCAFFOLD_RELEASES, type ScaffoldOwnershipContract, type ScaffoldRelease, type ScaffoldRuntimeRelease, type ScaffoldSourceRelease, type StarterReleaseManifest, isStableScaffoldRelease };
package/dist/release.js CHANGED
@@ -1,9 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  STABLE_SCAFFOLD_RELEASE,
4
+ SUPPORTED_SCAFFOLD_RELEASES,
4
5
  isStableScaffoldRelease
5
- } from "./chunk-PJW4JJIT.js";
6
+ } from "./chunk-WMHBVXWW.js";
6
7
  export {
7
8
  STABLE_SCAFFOLD_RELEASE,
9
+ SUPPORTED_SCAFFOLD_RELEASES,
8
10
  isStableScaffoldRelease
9
11
  };
@@ -1,16 +1,31 @@
1
1
  export { STABLE_SCAFFOLD_RELEASE } from './release.js';
2
2
 
3
3
  /**
4
- * The live Thally documentation site is also the canonical standalone site
5
- * source. Keeping one source means a runtime or UI improvement shipped to the
6
- * docs is available to every subsequent scaffold without maintaining a second
7
- * template repository.
4
+ * Immutable starter archive download and extraction.
5
+ *
6
+ * The dedicated starter repository is already a customer-ready project. Every
7
+ * safe filesystem entry is extracted; there is no exclusion list or second
8
+ * manifest that can silently produce a different scaffold.
8
9
  */
9
- declare const TEMPLATE_REPOSITORY: "thallylabs/docs";
10
- declare const TEMPLATE_COMMIT_SHA: "b0094de4fea84567eb12c39c6783fdae6820bb98";
11
- declare const EXCLUDE_PATHS: string[];
12
- /** True if a tarball entry should land in the scaffold (see EXCLUDE_PATHS). */
13
- declare function shouldInclude(path: string): boolean;
10
+
11
+ /** Repository whose complete tree becomes every newly scaffolded site. */
12
+ declare const STARTER_REPOSITORY: string;
13
+ /** Exact starter commit consumed by every creation surface. */
14
+ declare const STARTER_COMMIT_SHA: string;
15
+ /** GitHub codeload's single top-level directory for the pinned archive. */
16
+ declare const STARTER_ARCHIVE_ROOT: string;
17
+ interface StarterArchiveEntryMetadata {
18
+ type: string;
19
+ size: number;
20
+ }
21
+ /**
22
+ * Validate one codeload entry before `strip: 1` can write it to disk.
23
+ *
24
+ * Git cannot store devices or FIFOs, and starter sites do not need links. A
25
+ * release containing one is rejected rather than partially extracted because
26
+ * the entire repository tree is the immutable contract.
27
+ */
28
+ declare function validateStarterArchiveEntry(archivePath: string, entry: StarterArchiveEntryMetadata, archiveRoot?: string): void;
14
29
 
15
30
  interface ScaffoldOptions {
16
31
  projectDir: string;
@@ -35,4 +50,4 @@ interface ScaffoldResult {
35
50
  }
36
51
  declare function scaffold(options: ScaffoldOptions): Promise<ScaffoldResult>;
37
52
 
38
- export { EXCLUDE_PATHS, type ScaffoldOptions, type ScaffoldResult, TEMPLATE_COMMIT_SHA, TEMPLATE_REPOSITORY, scaffold, shouldInclude };
53
+ export { STARTER_ARCHIVE_ROOT, STARTER_COMMIT_SHA, STARTER_REPOSITORY, type ScaffoldOptions, type ScaffoldResult, scaffold, validateStarterArchiveEntry };
package/dist/scaffold.js CHANGED
@@ -1,20 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- EXCLUDE_PATHS,
4
- TEMPLATE_COMMIT_SHA,
5
- TEMPLATE_REPOSITORY,
6
- scaffold,
7
- shouldInclude
8
- } from "./chunk-JNDRCCJV.js";
9
- import "./chunk-BW7J7DJV.js";
3
+ scaffold
4
+ } from "./chunk-GTGHYJXS.js";
5
+ import "./chunk-ORUAMPNF.js";
6
+ import {
7
+ STARTER_ARCHIVE_ROOT,
8
+ STARTER_COMMIT_SHA,
9
+ STARTER_REPOSITORY,
10
+ validateStarterArchiveEntry
11
+ } from "./chunk-ENQIF6MA.js";
12
+ import "./chunk-KXJT2MG5.js";
10
13
  import {
11
14
  STABLE_SCAFFOLD_RELEASE
12
- } from "./chunk-PJW4JJIT.js";
15
+ } from "./chunk-WMHBVXWW.js";
13
16
  export {
14
- EXCLUDE_PATHS,
15
17
  STABLE_SCAFFOLD_RELEASE,
16
- TEMPLATE_COMMIT_SHA,
17
- TEMPLATE_REPOSITORY,
18
+ STARTER_ARCHIVE_ROOT,
19
+ STARTER_COMMIT_SHA,
20
+ STARTER_REPOSITORY,
18
21
  scaffold,
19
- shouldInclude
22
+ validateStarterArchiveEntry
20
23
  };
@@ -0,0 +1,68 @@
1
+ import { ScaffoldOwnershipContract, ScaffoldRelease, StarterReleaseManifest } from './release.js';
2
+
3
+ /**
4
+ * Ownership-aware, three-way planning for future starter runtime updates.
5
+ *
6
+ * The ownership contract comes from the pinned starter archive's
7
+ * `starter-release.json`. Automatic updates touch only framework-eligible files
8
+ * that still match the recorded old starter; owner and manual-review paths are
9
+ * never included in an apply plan.
10
+ */
11
+
12
+ type StarterPathOwnership = 'protected' | 'manual' | 'syncable' | 'unmanaged';
13
+ interface StarterRuntimeSyncPlan {
14
+ copyPaths: string[];
15
+ deletePaths: string[];
16
+ conflictPaths: string[];
17
+ manualReviewPaths: string[];
18
+ preservedPaths: string[];
19
+ unchangedPaths: string[];
20
+ targetPreconditions: Record<string, StarterTargetPrecondition>;
21
+ }
22
+ interface StarterTargetPrecondition {
23
+ kind: 'missing' | 'file';
24
+ sha256?: string;
25
+ }
26
+ interface StarterApplyProvenance {
27
+ sourcePath: string;
28
+ targetPath: string;
29
+ expectedSha256: string;
30
+ }
31
+ interface ApplyStarterRuntimeSyncOptions {
32
+ /** Explicit acknowledgement that the caller reviewed this exact plan. */
33
+ confirmed: boolean;
34
+ /** Optional immutable provenance file, atomically replaced after mutations. */
35
+ provenance?: StarterApplyProvenance;
36
+ /** Integration hook; an exception aborts and rolls back the transaction. */
37
+ onMutationApplied?: (path: string, index: number) => void;
38
+ }
39
+ /** Parse and validate the ownership section in `starter-release.json`. */
40
+ declare function parseStarterOwnershipContract(value: unknown): ScaffoldOwnershipContract;
41
+ /**
42
+ * Combine the previous and next release policies without weakening ownership.
43
+ *
44
+ * A later starter may broaden framework ownership, but it cannot retroactively
45
+ * make a path safe to overwrite when either release marked that path as owner
46
+ * controlled or manual-review. Classification precedence enforces that union.
47
+ */
48
+ declare function mergeStarterOwnershipContracts(previous: ScaffoldOwnershipContract, next: ScaffoldOwnershipContract): ScaffoldOwnershipContract;
49
+ /** Stable SHA-256 of the exact manifest bytes promoted with a release. */
50
+ declare function starterManifestSha256(source: string): string;
51
+ /**
52
+ * Parse the archive-owned release manifest and bind it to its promoted source,
53
+ * runtime identity, and SHA-256. Branch names never participate in updates.
54
+ */
55
+ declare function parseStarterReleaseManifest(source: string, release?: ScaffoldRelease): StarterReleaseManifest;
56
+ /** Read and validate the canonical ownership manifest from an extracted archive. */
57
+ declare function readStarterReleaseManifest(starterDir: string, release?: ScaffoldRelease): StarterReleaseManifest;
58
+ /** Protected > manual-review > syncable > unmanaged. */
59
+ declare function classifyStarterPath(path: string, contract: ScaffoldOwnershipContract): StarterPathOwnership;
60
+ /**
61
+ * Build a safe three-way update plan from the recorded old starter, the new
62
+ * starter, and the customer's current tree.
63
+ */
64
+ declare function planStarterRuntimeSync(oldStarterDir: string, newStarterDir: string, targetDir: string, ownership: ScaffoldOwnershipContract): StarterRuntimeSyncPlan;
65
+ /** Apply an explicitly confirmed, conflict-free three-way plan. */
66
+ declare function applyStarterRuntimeSyncPlan(newStarterDir: string, targetDir: string, plan: StarterRuntimeSyncPlan, ownership: ScaffoldOwnershipContract, options: ApplyStarterRuntimeSyncOptions): void;
67
+
68
+ export { type ApplyStarterRuntimeSyncOptions, type StarterApplyProvenance, type StarterPathOwnership, type StarterRuntimeSyncPlan, type StarterTargetPrecondition, applyStarterRuntimeSyncPlan, classifyStarterPath, mergeStarterOwnershipContracts, parseStarterOwnershipContract, parseStarterReleaseManifest, planStarterRuntimeSync, readStarterReleaseManifest, starterManifestSha256 };
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ applyStarterRuntimeSyncPlan,
4
+ classifyStarterPath,
5
+ mergeStarterOwnershipContracts,
6
+ parseStarterOwnershipContract,
7
+ parseStarterReleaseManifest,
8
+ planStarterRuntimeSync,
9
+ readStarterReleaseManifest,
10
+ starterManifestSha256
11
+ } from "./chunk-KXJT2MG5.js";
12
+ import "./chunk-WMHBVXWW.js";
13
+ export {
14
+ applyStarterRuntimeSyncPlan,
15
+ classifyStarterPath,
16
+ mergeStarterOwnershipContracts,
17
+ parseStarterOwnershipContract,
18
+ parseStarterReleaseManifest,
19
+ planStarterRuntimeSync,
20
+ readStarterReleaseManifest,
21
+ starterManifestSha256
22
+ };
@@ -0,0 +1,43 @@
1
+ import { ScaffoldRelease } from './release.js';
2
+ import { StarterRuntimeSyncPlan } from './starter-sync.js';
3
+
4
+ /**
5
+ * User-reachable orchestration for immutable starter release updates.
6
+ *
7
+ * Projects carry the exact bytes of `starter-release.json`. The manifest hash
8
+ * resolves the old release from the toolchain's retained immutable catalog;
9
+ * neither the old nor new side follows a branch. Updates are dry-run by
10
+ * default and advance provenance only after a confirmed, conflict-free apply.
11
+ */
12
+
13
+ interface StarterUpdateDownload {
14
+ (targetDir: string, release: ScaffoldRelease): Promise<void>;
15
+ }
16
+ interface UpdateStarterProjectOptions {
17
+ targetDir: string;
18
+ /** Applying is opt-in. Omitted/false always produces a dry-run plan. */
19
+ apply?: boolean;
20
+ /** Separate acknowledgement for programmatic callers. */
21
+ confirmed?: boolean;
22
+ targetRelease?: ScaffoldRelease;
23
+ releases?: readonly ScaffoldRelease[];
24
+ download?: StarterUpdateDownload;
25
+ }
26
+ interface StarterUpdateResult {
27
+ previousRelease: ScaffoldRelease;
28
+ targetRelease: ScaffoldRelease;
29
+ plan: StarterRuntimeSyncPlan;
30
+ isUpToDate: boolean;
31
+ applied: boolean;
32
+ }
33
+ /** Resolve exact downstream provenance without consulting a moving branch. */
34
+ declare function resolveStarterReleaseFromManifest(source: string, releases?: readonly ScaffoldRelease[]): ScaffoldRelease;
35
+ /**
36
+ * Plan or explicitly apply an immutable three-way starter update.
37
+ *
38
+ * Direct GitHub-template copies need no generated state beyond the canonical
39
+ * manifest: its pinned hash selects the old archive from the retained catalog.
40
+ */
41
+ declare function updateStarterProject(options: UpdateStarterProjectOptions): Promise<StarterUpdateResult>;
42
+
43
+ export { type StarterUpdateDownload, type StarterUpdateResult, type UpdateStarterProjectOptions, resolveStarterReleaseFromManifest, updateStarterProject };