@codyswann/lisa 4.60.11 → 4.61.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.
Files changed (91) hide show
  1. package/all/copy-overwrite/scripts/lib/process-tree-runner.mjs +15 -13
  2. package/all/copy-overwrite/scripts/lib/windows-process-job.cs +249 -0
  3. package/all/copy-overwrite/scripts/lib/windows-process-job.mjs +119 -0
  4. package/all/copy-overwrite/scripts/lib/windows-process-job.ps1 +25 -0
  5. package/dist/cli/starter-sync-content.d.ts +25 -0
  6. package/dist/cli/starter-sync-content.d.ts.map +1 -0
  7. package/dist/cli/starter-sync-content.js +106 -0
  8. package/dist/cli/starter-sync-content.js.map +1 -0
  9. package/dist/cli/starter-sync-source.d.ts +33 -0
  10. package/dist/cli/starter-sync-source.d.ts.map +1 -0
  11. package/dist/cli/starter-sync-source.js +154 -0
  12. package/dist/cli/starter-sync-source.js.map +1 -0
  13. package/dist/cli/starter-sync-write.d.ts +11 -0
  14. package/dist/cli/starter-sync-write.d.ts.map +1 -0
  15. package/dist/cli/starter-sync-write.js +126 -0
  16. package/dist/cli/starter-sync-write.js.map +1 -0
  17. package/dist/cli/starter-sync.d.ts +22 -0
  18. package/dist/cli/starter-sync.d.ts.map +1 -0
  19. package/dist/cli/starter-sync.js +219 -0
  20. package/dist/cli/starter-sync.js.map +1 -0
  21. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  22. package/dist/core/lisa-owned-hash-ledger.js +40 -0
  23. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  24. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  25. package/dist/core/nightly-e2e-guard-behavior-certificate.js.map +1 -1
  26. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  27. package/dist/core/upstream-evidence-manifest.js +21 -2
  28. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  29. package/dist/health/template-inspection.d.ts +16 -1
  30. package/dist/health/template-inspection.d.ts.map +1 -1
  31. package/dist/health/template-inspection.js +1 -1
  32. package/dist/health/template-inspection.js.map +1 -1
  33. package/dist/strategies/copy-contents.d.ts +11 -0
  34. package/dist/strategies/copy-contents.d.ts.map +1 -1
  35. package/dist/strategies/copy-contents.js +21 -5
  36. package/dist/strategies/copy-contents.js.map +1 -1
  37. package/dist/utils/atomic-file-write.d.ts +1 -1
  38. package/dist/utils/atomic-file-write.d.ts.map +1 -1
  39. package/dist/utils/atomic-file-write.js.map +1 -1
  40. package/package.json +4 -4
  41. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  43. package/plugins/lisa-agy/plugin.json +1 -1
  44. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  46. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  47. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  48. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  49. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  50. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  53. package/plugins/lisa-expo-agy/plugin.json +1 -1
  54. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  57. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  58. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  59. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  63. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  64. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  68. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  69. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  73. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  74. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  75. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  77. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  78. package/plugins/lisa-rails-agy/plugin.json +1 -1
  79. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  82. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  83. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  84. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  85. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  87. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  88. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  89. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  90. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  91. package/scripts/two-channel-couplings.json +1 -1
@@ -0,0 +1,154 @@
1
+ import { isJsonObject } from "../sync/json-path.js";
2
+ import { captureCommand, readGitHubStarter, validateStarterRepo, } from "./starter-provenance.js";
3
+ /**
4
+ * Require a pinned Git object before putting it into a remote endpoint.
5
+ * @param value - Supplied or returned object identifier.
6
+ * @returns Validated identifier.
7
+ */
8
+ function objectId(value) {
9
+ if (!/^(?:[a-f\d]{40}|[a-f\d]{64})$/i.test(value)) {
10
+ throw new Error("Starter revision is not a valid Git object identifier");
11
+ }
12
+ return value;
13
+ }
14
+ /**
15
+ * Keep Git paths relative without rejecting colon-scoped agent commands.
16
+ * @param value - Repository path or configured scope.
17
+ * @returns Validated path, with a scope's trailing slash removed.
18
+ */
19
+ export function starterRelativePath(value) {
20
+ const normalized = value.replace(/\/$/, "");
21
+ if (!normalized ||
22
+ /[\\\u0000-\u001f]/u.test(normalized) ||
23
+ /^[a-z]:/iu.test(normalized) ||
24
+ normalized.split("/").some(part => !part || part === "." || part === "..")) {
25
+ throw new Error(`Invalid starter path: ${value}`);
26
+ }
27
+ return normalized;
28
+ }
29
+ /**
30
+ * Decode a file entry while leaving directory entries to the recursive tree.
31
+ * @param entry - Untrusted GitHub tree entry.
32
+ * @returns Zero or one validated file tuple.
33
+ */
34
+ function treeEntry(entry) {
35
+ if (!isJsonObject(entry))
36
+ throw new Error("Starter returned an invalid tree entry");
37
+ if (entry.type === "tree")
38
+ return [];
39
+ if (typeof entry.path !== "string" ||
40
+ typeof entry.sha !== "string" ||
41
+ typeof entry.mode !== "string") {
42
+ throw new Error("Starter returned an invalid tree entry");
43
+ }
44
+ return [
45
+ [
46
+ starterRelativePath(entry.path),
47
+ { sha: objectId(entry.sha), mode: entry.mode },
48
+ ],
49
+ ];
50
+ }
51
+ /**
52
+ * Read a complete tree; an API limit must never look like deleted files.
53
+ * @param endpoint - Validated repository API endpoint.
54
+ * @param tree - Pinned tree object.
55
+ * @param capture - Read-only command runner.
56
+ * @returns Files indexed by their exact repository paths.
57
+ */
58
+ async function readTree(endpoint, tree, capture) {
59
+ const data = JSON.parse(await capture("gh", [
60
+ "api",
61
+ `${endpoint}/git/trees/${objectId(tree)}?recursive=1`,
62
+ ]));
63
+ if (!isJsonObject(data) || !Array.isArray(data.tree)) {
64
+ throw new Error("Starter returned an invalid Git tree");
65
+ }
66
+ if (data.truncated !== false) {
67
+ throw new Error("Starter Git tree is truncated or completeness is unknown");
68
+ }
69
+ const entries = data.tree.flatMap(treeEntry);
70
+ const files = new Map(entries);
71
+ if (files.size !== entries.length)
72
+ throw new Error("Starter returned duplicate tree paths");
73
+ return files;
74
+ }
75
+ /**
76
+ * Decode a pinned blob without trimming whitespace or executable metadata.
77
+ * @param endpoint - Validated repository API endpoint.
78
+ * @param file - File from the complete tree, or an absent side of the diff.
79
+ * @param capture - Read-only command runner.
80
+ * @returns Exact bytes and Git mode, or undefined when absent.
81
+ */
82
+ async function readBlob(endpoint, file, capture) {
83
+ if (file === undefined)
84
+ return undefined;
85
+ if (!["100644", "100755", "120000"].includes(file.mode)) {
86
+ throw new Error("Starter change has an unsupported Git file mode");
87
+ }
88
+ const data = JSON.parse(await capture("gh", ["api", `${endpoint}/git/blobs/${file.sha}`]));
89
+ if (!isJsonObject(data) ||
90
+ data.encoding !== "base64" ||
91
+ typeof data.content !== "string") {
92
+ throw new Error("Starter returned an invalid Git blob");
93
+ }
94
+ const bytes = Buffer.from(data.content, "base64");
95
+ if (data.size !== bytes.length)
96
+ throw new Error("Starter blob size does not match its contents");
97
+ return { bytes, mode: file.mode };
98
+ }
99
+ /**
100
+ * Diff the actual recorded tree against one pinned head, never a merge base.
101
+ * @param template - Independently tracked starter and optional path scopes.
102
+ * @param capture - Bounded read-only GitHub metadata/content runner.
103
+ * @param accepts - Applicable ownership filter, applied before reading contents.
104
+ * @returns Complete scoped changes and the exact revision they describe.
105
+ */
106
+ export async function readStarterChanges(template, capture = captureCommand, accepts = () => true) {
107
+ const endpoint = `repos/${validateStarterRepo(template.repo)}`;
108
+ const baseline = objectId(template.lastSync.sha);
109
+ const scopes = template.paths?.map(starterRelativePath);
110
+ const head = await readGitHubStarter(template.repo, template.ref, capture);
111
+ const sha = head.template.lastSync.sha;
112
+ if (sha === baseline)
113
+ return { sha, changes: [] };
114
+ const baseTree = await capture("gh", [
115
+ "api",
116
+ `${endpoint}/git/commits/${baseline}`,
117
+ "--jq",
118
+ ".tree.sha",
119
+ ]);
120
+ const before = await readTree(endpoint, baseTree, capture);
121
+ const after = await readTree(endpoint, head.tree, capture);
122
+ const paths = [...new Set([...before.keys(), ...after.keys()])]
123
+ .sort((left, right) => left.localeCompare(right))
124
+ .filter(name => inScope(name, scopes))
125
+ .filter(accepts)
126
+ .filter(name => before.get(name)?.sha !== after.get(name)?.sha ||
127
+ before.get(name)?.mode !== after.get(name)?.mode);
128
+ // Read serially so a large starter never creates an unbounded request burst.
129
+ const changes = await paths.reduce(async (pending, name) => {
130
+ const completed = await pending;
131
+ const oldBytes = await readBlob(endpoint, before.get(name), capture);
132
+ const newBytes = await readBlob(endpoint, after.get(name), capture);
133
+ return [
134
+ ...completed,
135
+ {
136
+ path: name,
137
+ ...(oldBytes === undefined ? {} : { before: oldBytes }),
138
+ ...(newBytes === undefined ? {} : { after: newBytes }),
139
+ },
140
+ ];
141
+ }, Promise.resolve([]));
142
+ return { sha, changes };
143
+ }
144
+ /**
145
+ * Match exact files or directory boundaries, rather than similar prefixes.
146
+ * @param name - Changed repository path.
147
+ * @param scopes - Validated optional configuration scopes.
148
+ * @returns Whether this path belongs to the requested diff.
149
+ */
150
+ function inScope(name, scopes) {
151
+ return (scopes === undefined ||
152
+ scopes.some(scope => name === scope || name.startsWith(`${scope}/`)));
153
+ }
154
+ //# sourceMappingURL=starter-sync-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"starter-sync-source.js","sourceRoot":"","sources":["../../src/cli/starter-sync-source.ts"],"names":[],"m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AC,MAAM,CAChC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC;QAChC,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;QACrE,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;QACpE,OAAO;YACL,GAAG,SAAS;YACZ;gBACE,IAAI,EAAE,IAAI;gBACV,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;gBACvD,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;aACvD;SACF,CAAC;IACJ,CAAC,EACD,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CACpB,CAAC;IACF,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;AAC1B,CAAC;AAED;;;;;GAKG;AACH,SAAS,OAAO,CAAC,IAAY,EAAE,MAAqC;IAClE,OAAO,CACL,MAAM,KAAK,SAAS;QACpB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CACrE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type ProjectFileSnapshot } from "../health/read-only-fs.js";
2
+ /**
3
+ * Publish one guarded file update; an interrupted apply retains its old baseline.
4
+ * @param root - Canonical consumer root.
5
+ * @param name - Validated relative path.
6
+ * @param expected - Previously inspected bytes and mode.
7
+ * @param bytes - Replacement payload, or undefined to remove an owned file.
8
+ * @param mode - Final file permission bits.
9
+ */
10
+ export declare function writeStarterFile(root: string, name: string, expected: ProjectFileSnapshot | undefined, bytes: Buffer | undefined, mode: number): Promise<void>;
11
+ //# sourceMappingURL=starter-sync-write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"starter-sync-write.d.ts","sourceRoot":"","sources":["../../src/cli/starter-sync-write.ts"],"names":[],"mappings":"AAWA,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,2BAA2B,CAAC;AAyHnC;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,mBAAmB,GAAG,SAAS,EACzC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CAcf"}
@@ -0,0 +1,126 @@
1
+ import { link, lstat, mkdir, mkdtemp, realpath, rename, rmdir, unlink, } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { readProjectFile, resolveProjectPath, } from "../health/read-only-fs.js";
4
+ import { writeFileAtomically } from "../utils/atomic-file-write.js";
5
+ /**
6
+ * Verify every destination parent and create only missing consumer directories.
7
+ * @param root - Canonical consumer root.
8
+ * @param name - Validated relative file path.
9
+ * @param create - Whether missing parents may be created.
10
+ */
11
+ async function parents(root, name, create) {
12
+ if ((await realpath(root)) !== root || (await lstat(root)).isSymbolicLink())
13
+ throw new Error("Starter consumer root changed");
14
+ const target = resolveProjectPath(root, name);
15
+ const parts = path
16
+ .relative(root, path.dirname(target))
17
+ .split(path.sep)
18
+ .filter(Boolean);
19
+ await parts.reduce(async (pending, part) => {
20
+ const parent = path.join(await pending, part);
21
+ if (create) {
22
+ try {
23
+ await mkdir(parent);
24
+ }
25
+ catch (error) {
26
+ if (error.code !== "EEXIST")
27
+ throw error;
28
+ }
29
+ }
30
+ const stat = await lstat(parent);
31
+ if (!stat.isDirectory() || stat.isSymbolicLink())
32
+ throw new Error("Unsafe starter destination parent");
33
+ return parent;
34
+ }, Promise.resolve(root));
35
+ }
36
+ /**
37
+ * Refuse concurrent edits rather than overwriting a newer consumer snapshot.
38
+ * @param root - Canonical consumer root.
39
+ * @param name - Validated file path.
40
+ * @param expected - Snapshot used to decide this update.
41
+ */
42
+ async function unchanged(root, name, expected) {
43
+ await parents(root, name, false);
44
+ const actual = await readProjectFile(root, name);
45
+ const sameBytes = actual === undefined
46
+ ? expected === undefined
47
+ : expected !== undefined && actual.bytes.equals(expected.bytes);
48
+ if (!sameBytes || actual?.mode !== expected?.mode)
49
+ throw new Error(`Starter destination changed during sync: ${name}`);
50
+ }
51
+ /**
52
+ * Restore a displaced entry without overwriting another concurrent replacement.
53
+ * @param root - Canonical consumer root.
54
+ * @param name - Original relative path.
55
+ * @param quarantine - Private path holding the displaced entry.
56
+ * @param failure - Original verification or removal error.
57
+ */
58
+ async function restoreDisplaced(root, name, quarantine, failure) {
59
+ try {
60
+ await parents(root, name, false);
61
+ await link(quarantine, resolveProjectPath(root, name));
62
+ await unlink(quarantine);
63
+ }
64
+ catch (error) {
65
+ throw new Error(`Starter destination changed during sync: ${name}; displaced entry preserved at ${path.relative(root, quarantine)}`, { cause: new AggregateError([failure, error]) });
66
+ }
67
+ }
68
+ /**
69
+ * Pin a deletion by moving it privately and checking identity before unlinking.
70
+ * @param root - Canonical consumer root.
71
+ * @param name - Relative owned-file path.
72
+ * @param expected - Contents and permissions that justified deletion.
73
+ */
74
+ async function removeUnchanged(root, name, expected) {
75
+ const target = resolveProjectPath(root, name);
76
+ const directory = await mkdtemp(path.join(path.dirname(target), ".lisa-starter-remove-"));
77
+ const quarantine = path.join(directory, "entry");
78
+ try {
79
+ const before = await lstat(target);
80
+ await unchanged(root, name, expected);
81
+ await rename(target, quarantine);
82
+ try {
83
+ const after = await lstat(quarantine);
84
+ if (before.dev !== after.dev || before.ino !== after.ino)
85
+ throw new Error(`Starter destination changed during sync: ${name}`);
86
+ await unchanged(root, path.relative(root, quarantine), expected);
87
+ await unchanged(root, name, undefined);
88
+ await unlink(quarantine);
89
+ }
90
+ catch (error) {
91
+ await restoreDisplaced(root, name, quarantine, error);
92
+ throw error;
93
+ }
94
+ }
95
+ finally {
96
+ await rmdir(directory).catch((error) => {
97
+ if (error.code !== "ENOTEMPTY")
98
+ throw error;
99
+ });
100
+ }
101
+ }
102
+ /**
103
+ * Publish one guarded file update; an interrupted apply retains its old baseline.
104
+ * @param root - Canonical consumer root.
105
+ * @param name - Validated relative path.
106
+ * @param expected - Previously inspected bytes and mode.
107
+ * @param bytes - Replacement payload, or undefined to remove an owned file.
108
+ * @param mode - Final file permission bits.
109
+ */
110
+ export async function writeStarterFile(root, name, expected, bytes, mode) {
111
+ if (process.platform === "win32" && /[:<>"|?*]|[. ](?:\/|$)/u.test(name))
112
+ throw new Error("Starter path is not representable safely on Windows");
113
+ await parents(root, name, bytes !== undefined);
114
+ await unchanged(root, name, expected);
115
+ const target = resolveProjectPath(root, name);
116
+ if (bytes === undefined) {
117
+ if (expected !== undefined)
118
+ await removeUnchanged(root, name, expected);
119
+ return;
120
+ }
121
+ await writeFileAtomically(target, bytes, {
122
+ mode,
123
+ beforeRename: () => unchanged(root, name, expected),
124
+ });
125
+ }
126
+ //# sourceMappingURL=starter-sync-write.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"starter-sync-write.js","sourceRoot":"","sources":["../../src/cli/starter-sync-write.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,KAAK,EACL,MAAM,GACP,MAAM,kBAAkB,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,eAAe,EACf,kBAAkB,GAEnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE;;;;;GAKG;AACH,KAAK,UAAU,OAAO,CAC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AC,KAAK,UAAU,gBAAgB,CACpC,IAAY,EACZ,IAAY,EACZ,QAAyC,EACzC,KAAyB,EACzB,IAAY;IAEZ,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC;QACtE,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,MAAM,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC;IAC/C,MAAM,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,IAAI,QAAQ,KAAK,SAAS;YAAE,MAAM,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QACxE,OAAO;IACT,CAAC;IACD,MAAM,mBAAmB,CAAC,MAAM,EAAE,KAAK,EAAE;QACvC,IAAI;QACJ,YAAY,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC;KACpD,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { StarterTemplate } from "../core/project-config-starter.js";
2
+ import { type StarterChanges } from "./starter-sync-source.js";
3
+ /** Result for one independently tracked starter. */
4
+ export interface StarterSyncResult {
5
+ readonly repo: string;
6
+ readonly state: "updated" | "current" | "failed";
7
+ readonly changed: readonly string[];
8
+ readonly error?: string;
9
+ }
10
+ /** The caller supplies the isolated landing worktree; this is not a CLI default. */
11
+ export interface StarterSyncOptions {
12
+ readonly lisaRoot: string;
13
+ readonly projectRoot: string;
14
+ readonly readChanges?: (template: StarterTemplate, accepts: (name: string) => boolean) => Promise<StarterChanges>;
15
+ }
16
+ /**
17
+ * Apply each starter independently using the existing template ownership rules.
18
+ * @param options - Lisa installation and caller-owned landing worktree.
19
+ * @returns Per-template outcomes, preserving failed baselines for retries.
20
+ */
21
+ export declare function syncStarterTemplates(options: StarterSyncOptions): Promise<readonly StarterSyncResult[]>;
22
+ //# sourceMappingURL=starter-sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"starter-sync.d.ts","sourceRoot":"","sources":["../../src/cli/starter-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAczE,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAC;AAUlC,oDAAoD;AACpD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;IACjD,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,oFAAoF;AACpF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,CACrB,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,KAC/B,OAAO,CAAC,cAAc,CAAC,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,SAAS,iBAAiB,EAAE,CAAC,CAwBvC"}
@@ -0,0 +1,219 @@
1
+ import { realpath } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { validateProjectConfig } from "../core/project-config.js";
4
+ import { readProjectFile, } from "../health/read-only-fs.js";
5
+ import { applicableCandidates, detectHealthProjectTypes, } from "../health/template-inspection.js";
6
+ import { isJsonObject } from "../sync/json-path.js";
7
+ import { readStarterChanges, starterRelativePath, } from "./starter-sync-source.js";
8
+ import { mergeStarterBlocks, mergeStarterJson, starterBlockMarkers, } from "./starter-sync-content.js";
9
+ import { writeStarterFile } from "./starter-sync-write.js";
10
+ const CONFIG = ".lisa.config.json";
11
+ /**
12
+ * Apply each starter independently using the existing template ownership rules.
13
+ * @param options - Lisa installation and caller-owned landing worktree.
14
+ * @returns Per-template outcomes, preserving failed baselines for retries.
15
+ */
16
+ export async function syncStarterTemplates(options) {
17
+ const root = await realpath(options.projectRoot);
18
+ const document = await readConfig(root);
19
+ const templates = document.config.starter?.templates ?? [];
20
+ const candidates = await applicableCandidates(options.lisaRoot, root, await detectHealthProjectTypes(root), document.raw);
21
+ return templates.reduce(async (pending, template, index) => {
22
+ const completed = await pending;
23
+ const result = await syncOne(root, template, index, candidates, options.readChanges);
24
+ return [...completed, result];
25
+ }, Promise.resolve([]));
26
+ }
27
+ /**
28
+ * Read a confined configuration while retaining every unknown extension.
29
+ * @param root - Canonical consumer root.
30
+ * @returns Validated settings, original fields, and the guarded file snapshot.
31
+ */
32
+ async function readConfig(root) {
33
+ const snapshot = await readProjectFile(root, CONFIG);
34
+ const raw = JSON.parse(snapshot?.bytes.toString("utf8") ?? "{}");
35
+ if (!isJsonObject(raw))
36
+ throw new Error("Starter project config must be an object");
37
+ return { raw, snapshot, config: validateProjectConfig(raw, CONFIG) };
38
+ }
39
+ /**
40
+ * Compare a scoped path using the same portable validation as the source reader.
41
+ * @param name - Repository path.
42
+ * @param scopes - Optional validated path restrictions.
43
+ * @returns Whether the file is included.
44
+ */
45
+ function inScope(name, scopes) {
46
+ return (scopes === undefined ||
47
+ scopes.some(scope => name === scope || name.startsWith(`${scope}/`)));
48
+ }
49
+ /**
50
+ * Apply one independent source without letting its failure stop later templates.
51
+ * @param root - Canonical landing worktree.
52
+ * @param template - Original independently tracked entry.
53
+ * @param index - Stable position in the recorded template list.
54
+ * @param candidates - Existing canonical ownership plan.
55
+ * @param reader - Optional real-source adapter for the caller.
56
+ * @returns Applied paths and success, current, or retryable failure.
57
+ */
58
+ async function syncOne(root, template, index, candidates, reader) {
59
+ const initial = {
60
+ repo: template.repo,
61
+ state: "updated",
62
+ changed: [],
63
+ };
64
+ try {
65
+ const scopes = template.paths?.map(starterRelativePath);
66
+ const names = new Set(candidates.map(candidate => candidate.destination.split(path.sep).join("/")));
67
+ const accepts = (name) => name !== CONFIG &&
68
+ name !== ".lisa.workspaces.json" &&
69
+ names.has(name) &&
70
+ inScope(name, scopes);
71
+ const source = await (reader ??
72
+ ((entry, filter) => readStarterChanges(entry, undefined, filter)))(template, accepts);
73
+ if (source.sha === template.lastSync.sha)
74
+ return { ...initial, state: "current" };
75
+ const result = await source.changes
76
+ .filter(change => accepts(change.path))
77
+ .reduce(async (pending, change) => {
78
+ const prior = await pending;
79
+ if (prior.state === "failed")
80
+ return prior;
81
+ try {
82
+ const changed = await applyChange(root, change, candidates.filter(candidate => candidate.destination.split(path.sep).join("/") === change.path));
83
+ return changed
84
+ ? { ...prior, changed: [...prior.changed, change.path] }
85
+ : prior;
86
+ }
87
+ catch (error) {
88
+ return failure(prior, error);
89
+ }
90
+ }, Promise.resolve(initial));
91
+ if (result.state === "failed")
92
+ return result;
93
+ try {
94
+ await advance(root, template, index, source.sha);
95
+ return result;
96
+ }
97
+ catch (error) {
98
+ return failure(result, error);
99
+ }
100
+ }
101
+ catch (error) {
102
+ return failure(initial, error);
103
+ }
104
+ }
105
+ /**
106
+ * Preserve partial-apply evidence when an operation needs to be retried.
107
+ * @param result - Paths already applied.
108
+ * @param error - Refusal from the source, filesystem, or config writer.
109
+ * @returns Failed result without falsely claiming that nothing changed.
110
+ */
111
+ function failure(result, error) {
112
+ return {
113
+ ...result,
114
+ state: "failed",
115
+ error: error instanceof Error ? error.message : String(error),
116
+ };
117
+ }
118
+ /**
119
+ * Respect existing ownership and refuse local conflicts in governed files.
120
+ * @param root - Canonical consumer root.
121
+ * @param change - Pinned starter change.
122
+ * @param candidates - Applicable strategies for exactly this path.
123
+ * @returns Whether consumer bytes or executable mode changed.
124
+ */
125
+ async function applyChange(root, change, candidates) {
126
+ const name = starterRelativePath(change.path);
127
+ const current = await readProjectFile(root, name);
128
+ const writable = candidates.filter(candidate => candidate.strategy !== "create-only");
129
+ if (writable.length === 0 &&
130
+ candidates.some(candidate => candidate.strategy === "create-only")) {
131
+ if (current !== undefined || change.after === undefined)
132
+ return false;
133
+ }
134
+ else if (!candidates.some(candidate => ["copy-overwrite", "copy-contents", "merge", "tagged-merge"].includes(candidate.strategy))) {
135
+ throw new Error(`Starter change requires its existing merge strategy: ${name}`);
136
+ }
137
+ if ([change.before?.mode, change.after?.mode].some(mode => mode !== undefined && !["100644", "100755"].includes(mode)))
138
+ throw new Error(`Starter change is not a regular file: ${name}`);
139
+ const blocks = await starterBlockMarkers(candidates.filter(candidate => candidate.strategy === "copy-contents"));
140
+ const json = candidates.filter(candidate => ["merge", "tagged-merge"].includes(candidate.strategy));
141
+ const bytes = await desiredBytes(change, current?.bytes, blocks, json);
142
+ const partial = blocks.length > 0 || json.length > 0;
143
+ const mode = destinationMode(current, change, partial);
144
+ if (sameDestination(current, bytes, mode))
145
+ return false;
146
+ if (!partial &&
147
+ current !== undefined &&
148
+ (change.before === undefined ||
149
+ !current.bytes.equals(change.before.bytes) ||
150
+ Boolean(current.mode & 0o111) !== (change.before.mode === "100755")))
151
+ throw new Error(`Starter change conflicts with local changes: ${name}`);
152
+ await writeStarterFile(root, name, current, bytes, mode);
153
+ return true;
154
+ }
155
+ /**
156
+ * Select the existing content strategy without inventing starter ownership rules.
157
+ * @param change - Pinned starter change.
158
+ * @param current - Existing consumer bytes.
159
+ * @param blocks - Applicable managed-block templates.
160
+ * @param json - Applicable JSON templates.
161
+ * @returns Desired file bytes, or undefined for whole-file removal.
162
+ */
163
+ async function desiredBytes(change, current, blocks, json) {
164
+ if (blocks.length > 0)
165
+ return mergeStarterBlocks(change, current, blocks);
166
+ if (json.length > 0)
167
+ return mergeStarterJson(change, current, json);
168
+ return change.after?.bytes;
169
+ }
170
+ /**
171
+ * Preserve consumer permissions outside the part governed by the strategy.
172
+ * @param current - Existing file snapshot.
173
+ * @param change - Source mode and contents.
174
+ * @param managed - Whether only content blocks belong to Lisa.
175
+ * @returns Permission bits for the new file.
176
+ */
177
+ function destinationMode(current, change, managed) {
178
+ if (managed && current !== undefined)
179
+ return current.mode & 0o777;
180
+ return (((current?.mode ?? 0o644) & 0o666) |
181
+ (change.after?.mode === "100755" ? 0o111 : 0));
182
+ }
183
+ /**
184
+ * Recognize an already applied file after an interrupted template sync.
185
+ * @param current - Existing consumer snapshot.
186
+ * @param bytes - Desired bytes, or an absent file.
187
+ * @param mode - Desired permission bits.
188
+ * @returns Whether another write would change nothing.
189
+ */
190
+ function sameDestination(current, bytes, mode) {
191
+ if (bytes === undefined)
192
+ return current === undefined;
193
+ return (current !== undefined &&
194
+ current.bytes.equals(bytes) &&
195
+ (current.mode & 0o777) === mode);
196
+ }
197
+ /**
198
+ * Advance only after apply succeeds, preserving concurrent unrelated config edits.
199
+ * @param root - Canonical consumer root.
200
+ * @param template - Entry as it existed when this sync started.
201
+ * @param index - Entry position, verified again before publication.
202
+ * @param sha - Exact successfully applied source revision.
203
+ */
204
+ async function advance(root, template, index, sha) {
205
+ const document = await readConfig(root);
206
+ const starter = document.config.starter;
207
+ const templates = starter?.templates ?? [];
208
+ if (JSON.stringify(templates[index]) !== JSON.stringify(template))
209
+ throw new Error("Starter configuration changed during sync; baseline was not advanced");
210
+ const updated = templates.map((entry, at) => at === index
211
+ ? {
212
+ ...entry,
213
+ lastSync: { ...entry.lastSync, sha, at: new Date().toISOString() },
214
+ }
215
+ : entry);
216
+ const bytes = Buffer.from(`${JSON.stringify({ ...document.raw, starter: { ...starter, templates: updated } }, null, 2)}\n`);
217
+ await writeStarterFile(root, CONFIG, document.snapshot, bytes, (document.snapshot?.mode ?? 0o644) & 0o777);
218
+ }
219
+ //# sourceMappingURL=starter-sync.js.map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AAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAC1C,EAAE,KAAK,KAAK;QACV,CAAC,CAAC;YACE,GAAG,KAAK;YACR,QAAQ,EAAE,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE;SACnE;QACH,CAAC,CAAC,KAAK,CACV,CAAC;IACF,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CACvB,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CACjG,CAAC;IACF,MAAM,gBAAgB,CACpB,IAAI,EACJ,MAAM,EACN,QAAQ,CAAC,QAAQ,EACjB,KAAK,EACL,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,CAC3C,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"lisa-owned-hash-ledger.d.ts","sourceRoot":"","sources":["../../src/core/lisa-owned-hash-ledger.ts"],"names":[],"mappings":"AACA,6EAA6E;AAE7E;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAC3C,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CA40CjC,CAAC;AAEH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CACpD,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CA+uCjC,CAAC"}
1
+ {"version":3,"file":"lisa-owned-hash-ledger.d.ts","sourceRoot":"","sources":["../../src/core/lisa-owned-hash-ledger.ts"],"names":[],"mappings":"AACA,6EAA6E;AAE7E;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAC3C,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAg2CjC,CAAC;AAEH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CACpD,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAmwCjC,CAAC"}