yaaw-se 0.1.0-dev.35745937645.1

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 (208) hide show
  1. package/README.md +155 -0
  2. package/dist/cli/commands/doctor.d.ts +6 -0
  3. package/dist/cli/commands/doctor.js +21 -0
  4. package/dist/cli/commands/doctor.js.map +1 -0
  5. package/dist/cli/commands/install.d.ts +39 -0
  6. package/dist/cli/commands/install.js +209 -0
  7. package/dist/cli/commands/install.js.map +1 -0
  8. package/dist/cli/commands/status.d.ts +63 -0
  9. package/dist/cli/commands/status.js +23 -0
  10. package/dist/cli/commands/status.js.map +1 -0
  11. package/dist/cli/main.d.ts +2 -0
  12. package/dist/cli/main.js +40 -0
  13. package/dist/cli/main.js.map +1 -0
  14. package/dist/installer/boundary.d.ts +4 -0
  15. package/dist/installer/boundary.js +75 -0
  16. package/dist/installer/boundary.js.map +1 -0
  17. package/dist/installer/context.d.ts +3 -0
  18. package/dist/installer/context.js +14 -0
  19. package/dist/installer/context.js.map +1 -0
  20. package/dist/installer/detect.d.ts +7 -0
  21. package/dist/installer/detect.js +40 -0
  22. package/dist/installer/detect.js.map +1 -0
  23. package/dist/installer/filesystem.d.ts +1 -0
  24. package/dist/installer/filesystem.js +23 -0
  25. package/dist/installer/filesystem.js.map +1 -0
  26. package/dist/installer/hashing.d.ts +1 -0
  27. package/dist/installer/hashing.js +5 -0
  28. package/dist/installer/hashing.js.map +1 -0
  29. package/dist/installer/managed-sections.d.ts +8 -0
  30. package/dist/installer/managed-sections.js +53 -0
  31. package/dist/installer/managed-sections.js.map +1 -0
  32. package/dist/installer/manifest.d.ts +5 -0
  33. package/dist/installer/manifest.js +40 -0
  34. package/dist/installer/manifest.js.map +1 -0
  35. package/dist/installer/migrations/index.d.ts +14 -0
  36. package/dist/installer/migrations/index.js +23 -0
  37. package/dist/installer/migrations/index.js.map +1 -0
  38. package/dist/installer/migrations/installation/index.d.ts +2 -0
  39. package/dist/installer/migrations/installation/index.js +3 -0
  40. package/dist/installer/migrations/installation/index.js.map +1 -0
  41. package/dist/installer/migrations/project/index.d.ts +2 -0
  42. package/dist/installer/migrations/project/index.js +3 -0
  43. package/dist/installer/migrations/project/index.js.map +1 -0
  44. package/dist/installer/plan.d.ts +10 -0
  45. package/dist/installer/plan.js +298 -0
  46. package/dist/installer/plan.js.map +1 -0
  47. package/dist/installer/project-state.d.ts +2 -0
  48. package/dist/installer/project-state.js +41 -0
  49. package/dist/installer/project-state.js.map +1 -0
  50. package/dist/installer/status.d.ts +61 -0
  51. package/dist/installer/status.js +146 -0
  52. package/dist/installer/status.js.map +1 -0
  53. package/dist/installer/transaction.d.ts +10 -0
  54. package/dist/installer/transaction.js +176 -0
  55. package/dist/installer/transaction.js.map +1 -0
  56. package/dist/installer/types.d.ts +98 -0
  57. package/dist/installer/types.js +2 -0
  58. package/dist/installer/types.js.map +1 -0
  59. package/dist/installer/verify.d.ts +2 -0
  60. package/dist/installer/verify.js +49 -0
  61. package/dist/installer/verify.js.map +1 -0
  62. package/dist/integrations/claude-code.d.ts +1 -0
  63. package/dist/integrations/claude-code.js +13 -0
  64. package/dist/integrations/claude-code.js.map +1 -0
  65. package/dist/integrations/cline.d.ts +1 -0
  66. package/dist/integrations/cline.js +13 -0
  67. package/dist/integrations/cline.js.map +1 -0
  68. package/dist/integrations/codex.d.ts +1 -0
  69. package/dist/integrations/codex.js +13 -0
  70. package/dist/integrations/codex.js.map +1 -0
  71. package/dist/integrations/gemini-cli.d.ts +1 -0
  72. package/dist/integrations/gemini-cli.js +13 -0
  73. package/dist/integrations/gemini-cli.js.map +1 -0
  74. package/dist/integrations/helpers.d.ts +14 -0
  75. package/dist/integrations/helpers.js +86 -0
  76. package/dist/integrations/helpers.js.map +1 -0
  77. package/dist/integrations/registry.d.ts +4 -0
  78. package/dist/integrations/registry.js +18 -0
  79. package/dist/integrations/registry.js.map +1 -0
  80. package/dist/integrations/types.d.ts +31 -0
  81. package/dist/integrations/types.js +2 -0
  82. package/dist/integrations/types.js.map +1 -0
  83. package/dist/payload/bootstrap/claude-code.md +10 -0
  84. package/dist/payload/bootstrap/cline.md +10 -0
  85. package/dist/payload/bootstrap/codex.md +10 -0
  86. package/dist/payload/bootstrap/gemini-cli.md +10 -0
  87. package/dist/payload/payload-files.json +505 -0
  88. package/dist/payload/payload.json +4 -0
  89. package/dist/payload/skills/yaaw-create-spec/SKILL.md +10 -0
  90. package/dist/payload/skills/yaaw-create-ticket/SKILL.md +10 -0
  91. package/dist/payload/skills/yaaw-create-tickets/SKILL.md +10 -0
  92. package/dist/payload/skills/yaaw-implement/SKILL.md +10 -0
  93. package/dist/payload/skills/yaaw-orchestrator/SKILL.md +10 -0
  94. package/dist/payload/skills/yaaw-planner/SKILL.md +10 -0
  95. package/dist/payload/skills/yaaw-planning-review/SKILL.md +10 -0
  96. package/dist/payload/skills/yaaw-prd/SKILL.md +10 -0
  97. package/dist/payload/skills/yaaw-refine-prd/SKILL.md +10 -0
  98. package/dist/payload/skills/yaaw-repair/SKILL.md +10 -0
  99. package/dist/payload/skills/yaaw-review/SKILL.md +10 -0
  100. package/dist/payload/skills/yaaw-revise-prd/SKILL.md +10 -0
  101. package/dist/payload/yaaw-core/core/artifact-model.md +35 -0
  102. package/dist/payload/yaaw-core/core/authority.md +15 -0
  103. package/dist/payload/yaaw-core/core/context-loading.md +23 -0
  104. package/dist/payload/yaaw-core/core/invalidation.md +20 -0
  105. package/dist/payload/yaaw-core/core/lifecycle.md +33 -0
  106. package/dist/payload/yaaw-core/core/recovery.md +20 -0
  107. package/dist/payload/yaaw-core/core/routing.md +30 -0
  108. package/dist/payload/yaaw-core/core/state-model.md +26 -0
  109. package/dist/payload/yaaw-core/core/transitions.md +34 -0
  110. package/dist/payload/yaaw-core/expertise/changeability/MODULE.md +58 -0
  111. package/dist/payload/yaaw-core/expertise/frontend-design/MODULE.md +16 -0
  112. package/dist/payload/yaaw-core/expertise/python/MODULE.md +16 -0
  113. package/dist/payload/yaaw-core/expertise/security/MODULE.md +16 -0
  114. package/dist/payload/yaaw-core/expertise/testing/MODULE.md +16 -0
  115. package/dist/payload/yaaw-core/registries/expertise.json +47 -0
  116. package/dist/payload/yaaw-core/registries/paths.json +15 -0
  117. package/dist/payload/yaaw-core/registries/routing-policy.json +16 -0
  118. package/dist/payload/yaaw-core/registries/skills.json +14 -0
  119. package/dist/payload/yaaw-core/registries/transitions.json +29 -0
  120. package/dist/payload/yaaw-core/registries/workflows.json +37 -0
  121. package/dist/payload/yaaw-core/roles/implementer.md +15 -0
  122. package/dist/payload/yaaw-core/roles/orchestrator.md +16 -0
  123. package/dist/payload/yaaw-core/roles/planner.md +19 -0
  124. package/dist/payload/yaaw-core/roles/prd.md +19 -0
  125. package/dist/payload/yaaw-core/roles/reviewer.md +20 -0
  126. package/dist/payload/yaaw-core/rules/artifact-writing.md +10 -0
  127. package/dist/payload/yaaw-core/rules/assumption-challenge.md +109 -0
  128. package/dist/payload/yaaw-core/rules/changeability.md +38 -0
  129. package/dist/payload/yaaw-core/rules/durable-memory.md +9 -0
  130. package/dist/payload/yaaw-core/rules/question-format.md +20 -0
  131. package/dist/payload/yaaw-core/rules/recovery-evidence.md +9 -0
  132. package/dist/payload/yaaw-core/rules/repository-identity.md +16 -0
  133. package/dist/payload/yaaw-core/rules/review-independence.md +9 -0
  134. package/dist/payload/yaaw-core/rules/ticket-sizing.md +9 -0
  135. package/dist/payload/yaaw-core/schemas/engineering.schema.json +15 -0
  136. package/dist/payload/yaaw-core/schemas/evidence.schema.json +36 -0
  137. package/dist/payload/yaaw-core/schemas/handoff.schema.json +28 -0
  138. package/dist/payload/yaaw-core/schemas/observed-state.schema.json +25 -0
  139. package/dist/payload/yaaw-core/schemas/product.schema.json +12 -0
  140. package/dist/payload/yaaw-core/schemas/project-state.schema.json +74 -0
  141. package/dist/payload/yaaw-core/schemas/review.schema.json +19 -0
  142. package/dist/payload/yaaw-core/schemas/spec.schema.json +17 -0
  143. package/dist/payload/yaaw-core/schemas/ticket.schema.json +20 -0
  144. package/dist/payload/yaaw-core/templates/engineering.md +33 -0
  145. package/dist/payload/yaaw-core/templates/evidence.json +12 -0
  146. package/dist/payload/yaaw-core/templates/handoff.json +12 -0
  147. package/dist/payload/yaaw-core/templates/observed-state.json +9 -0
  148. package/dist/payload/yaaw-core/templates/product.md +26 -0
  149. package/dist/payload/yaaw-core/templates/project-state.json +13 -0
  150. package/dist/payload/yaaw-core/templates/review.md +28 -0
  151. package/dist/payload/yaaw-core/templates/spec.md +29 -0
  152. package/dist/payload/yaaw-core/templates/ticket.md +28 -0
  153. package/dist/payload/yaaw-core/workflows/implementation/implement-ticket.md +21 -0
  154. package/dist/payload/yaaw-core/workflows/implementation/repair-ticket.md +18 -0
  155. package/dist/payload/yaaw-core/workflows/implementation/select-ticket.md +16 -0
  156. package/dist/payload/yaaw-core/workflows/implementation/verify-ticket.md +17 -0
  157. package/dist/payload/yaaw-core/workflows/orchestration/determine-next-action.md +16 -0
  158. package/dist/payload/yaaw-core/workflows/orchestration/dispatch.md +17 -0
  159. package/dist/payload/yaaw-core/workflows/orchestration/inspect-state.md +17 -0
  160. package/dist/payload/yaaw-core/workflows/orchestration/reconcile-state.md +16 -0
  161. package/dist/payload/yaaw-core/workflows/orchestration/recover-interruption.md +17 -0
  162. package/dist/payload/yaaw-core/workflows/orchestration/route.md +20 -0
  163. package/dist/payload/yaaw-core/workflows/planning/create-spec.md +18 -0
  164. package/dist/payload/yaaw-core/workflows/planning/create-tickets.md +19 -0
  165. package/dist/payload/yaaw-core/workflows/planning/decision-frontier.md +27 -0
  166. package/dist/payload/yaaw-core/workflows/planning/discover.md +17 -0
  167. package/dist/payload/yaaw-core/workflows/planning/question-round.md +22 -0
  168. package/dist/payload/yaaw-core/workflows/planning/readiness-review.md +32 -0
  169. package/dist/payload/yaaw-core/workflows/planning/record-decisions.md +20 -0
  170. package/dist/payload/yaaw-core/workflows/planning/replan.md +18 -0
  171. package/dist/payload/yaaw-core/workflows/planning/route.md +20 -0
  172. package/dist/payload/yaaw-core/workflows/planning/write-understanding.md +24 -0
  173. package/dist/payload/yaaw-core/workflows/prd/create.md +22 -0
  174. package/dist/payload/yaaw-core/workflows/prd/question-round.md +20 -0
  175. package/dist/payload/yaaw-core/workflows/prd/readiness.md +22 -0
  176. package/dist/payload/yaaw-core/workflows/prd/record-decisions.md +20 -0
  177. package/dist/payload/yaaw-core/workflows/prd/refine.md +15 -0
  178. package/dist/payload/yaaw-core/workflows/prd/revise.md +18 -0
  179. package/dist/payload/yaaw-core/workflows/prd/route.md +23 -0
  180. package/dist/payload/yaaw-core/workflows/review/classify-findings.md +17 -0
  181. package/dist/payload/yaaw-core/workflows/review/inspect-change.md +16 -0
  182. package/dist/payload/yaaw-core/workflows/review/record-review.md +18 -0
  183. package/dist/payload/yaaw-core/workflows/review/review-ticket.md +20 -0
  184. package/dist/renderers/agent-skill.d.ts +1 -0
  185. package/dist/renderers/agent-skill.js +14 -0
  186. package/dist/renderers/agent-skill.js.map +1 -0
  187. package/dist/renderers/bootstrap-block.d.ts +1 -0
  188. package/dist/renderers/bootstrap-block.js +10 -0
  189. package/dist/renderers/bootstrap-block.js.map +1 -0
  190. package/dist/tui/confirm-plan.d.ts +3 -0
  191. package/dist/tui/confirm-plan.js +23 -0
  192. package/dist/tui/confirm-plan.js.map +1 -0
  193. package/dist/tui/existing-install.d.ts +2 -0
  194. package/dist/tui/existing-install.js +17 -0
  195. package/dist/tui/existing-install.js.map +1 -0
  196. package/dist/tui/result.d.ts +2 -0
  197. package/dist/tui/result.js +8 -0
  198. package/dist/tui/result.js.map +1 -0
  199. package/dist/tui/select-directory.d.ts +1 -0
  200. package/dist/tui/select-directory.js +12 -0
  201. package/dist/tui/select-directory.js.map +1 -0
  202. package/dist/tui/select-skills.d.ts +1 -0
  203. package/dist/tui/select-skills.js +29 -0
  204. package/dist/tui/select-skills.js.map +1 -0
  205. package/dist/tui/select-tools.d.ts +2 -0
  206. package/dist/tui/select-tools.js +19 -0
  207. package/dist/tui/select-tools.js.map +1 -0
  208. package/package.json +49 -0
@@ -0,0 +1,75 @@
1
+ import { lstat, realpath, stat } from "node:fs/promises";
2
+ import { dirname, isAbsolute, relative, resolve } from "node:path";
3
+ async function exists(path) {
4
+ try {
5
+ await lstat(path);
6
+ return true;
7
+ }
8
+ catch {
9
+ return false;
10
+ }
11
+ }
12
+ async function closestExisting(path) {
13
+ let current = path;
14
+ while (!(await exists(current))) {
15
+ const parent = dirname(current);
16
+ if (parent === current)
17
+ throw new Error(`No existing parent for ${path}`);
18
+ current = parent;
19
+ }
20
+ return current;
21
+ }
22
+ export function isWithin(root, target) {
23
+ const rel = relative(root, target);
24
+ return rel === "" || (!rel.startsWith("..") && !isAbsolute(rel));
25
+ }
26
+ export async function resolveProjectRoot(requested) {
27
+ const absolute = resolve(requested);
28
+ if (await exists(absolute)) {
29
+ const info = await stat(absolute);
30
+ if (!info.isDirectory())
31
+ throw new Error(`Project path is not a directory: ${absolute}`);
32
+ return realpath(absolute);
33
+ }
34
+ const parent = await closestExisting(dirname(absolute));
35
+ const parentReal = await realpath(parent);
36
+ return resolve(parentReal, relative(parent, absolute));
37
+ }
38
+ export async function assertSafeDestination(projectRoot, destination) {
39
+ const root = resolve(projectRoot);
40
+ const target = resolve(destination);
41
+ if (!isWithin(root, target)) {
42
+ throw new Error(`Refusing write outside project root: ${target}`);
43
+ }
44
+ if (!(await exists(root))) {
45
+ const rootParent = await realpath(await closestExisting(dirname(root)));
46
+ const targetParent = await realpath(await closestExisting(dirname(target)));
47
+ if (rootParent !== targetParent && !isWithin(rootParent, targetParent)) {
48
+ throw new Error(`Destination parent escapes unresolved project boundary: ${target}`);
49
+ }
50
+ return;
51
+ }
52
+ const rootReal = await realpath(root);
53
+ if (target === root || target === rootReal)
54
+ return;
55
+ const existingParent = await closestExisting(dirname(target));
56
+ const parentReal = await realpath(existingParent);
57
+ if (!isWithin(rootReal, parentReal)) {
58
+ throw new Error(`Symlink/path escape outside project root: ${target}`);
59
+ }
60
+ if (await exists(target)) {
61
+ const targetReal = await realpath(target);
62
+ if (!isWithin(rootReal, targetReal)) {
63
+ throw new Error(`Existing target resolves outside project root: ${target}`);
64
+ }
65
+ }
66
+ }
67
+ export async function assertRelativeManifestPath(projectRoot, relPath) {
68
+ if (!relPath || isAbsolute(relPath) || relPath.split(/[\\/]+/).includes("..")) {
69
+ throw new Error(`Unsafe manifest path: ${relPath}`);
70
+ }
71
+ const target = resolve(projectRoot, relPath);
72
+ await assertSafeDestination(projectRoot, target);
73
+ return target;
74
+ }
75
+ //# sourceMappingURL=boundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boundary.js","sourceRoot":"","sources":["../../src/installer/boundary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnE,KAAK,UAAU,MAAM,CAAC,IAAY;IAChC,IAAI,CAAC;QAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;QAAC,OAAO,IAAI,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,KAAK,CAAC;IAAC,CAAC;AACjE,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,IAAY;IACzC,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,OAAO,CAAC,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,MAAM,KAAK,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,IAAI,EAAE,CAAC,CAAC;QAC1E,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,MAAc;IACnD,MAA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AC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9E,MAAM,IAAI,KAAK,CAAC,yBAAyB,OAAO,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC7C,MAAM,qBAAqB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACjD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function packageRoot(): string;
2
+ export declare function payloadRoot(): string;
3
+ export declare function packageVersion(): Promise<string>;
@@ -0,0 +1,14 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ export function packageRoot() {
5
+ return fileURLToPath(new URL("../../", import.meta.url));
6
+ }
7
+ export function payloadRoot() {
8
+ return join(packageRoot(), "dist", "payload");
9
+ }
10
+ export async function packageVersion() {
11
+ const pkg = JSON.parse(await readFile(join(packageRoot(), "package.json"), "utf8"));
12
+ return String(pkg.version);
13
+ }
14
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/installer/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAW,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,WAAW;IACzB,OAAO,aAAa,CAAC,IAAI,GAAG,CAAC,QAAQ,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,WAAW;IACzB,OAAO,IAAI,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACpF,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { readManifest } from "./manifest.js";
2
+ export interface ExistingInstallation {
3
+ kind: "none" | "valid" | "partial";
4
+ manifest: Awaited<ReturnType<typeof readManifest>>;
5
+ signals: string[];
6
+ }
7
+ export declare function detectExistingInstallation(projectRoot: string): Promise<ExistingInstallation>;
@@ -0,0 +1,40 @@
1
+ import { access } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { readManifest } from "./manifest.js";
4
+ async function exists(path) {
5
+ try {
6
+ await access(path);
7
+ return true;
8
+ }
9
+ catch {
10
+ return false;
11
+ }
12
+ }
13
+ export async function detectExistingInstallation(projectRoot) {
14
+ const signals = [];
15
+ let manifest = null;
16
+ try {
17
+ manifest = await readManifest(projectRoot);
18
+ }
19
+ catch (error) {
20
+ signals.push(`invalid-manifest: ${error.message}`);
21
+ }
22
+ if (manifest)
23
+ return { kind: "valid", manifest, signals: ["manifest"] };
24
+ if (await exists(join(projectRoot, ".yaaw-core/install/uninstalled.json"))) {
25
+ return { kind: "none", manifest: null, signals: ["preserved-project-archive"] };
26
+ }
27
+ for (const rel of [
28
+ ".yaaw-core/core",
29
+ ".yaaw-core/project",
30
+ ".agents/skills",
31
+ ".claude/skills",
32
+ ".gemini/skills",
33
+ ".cline/skills"
34
+ ]) {
35
+ if (await exists(join(projectRoot, rel)))
36
+ signals.push(rel);
37
+ }
38
+ return { kind: signals.length ? "partial" : "none", manifest: null, signals };
39
+ }
40
+ //# sourceMappingURL=detect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.js","sourceRoot":"","sources":["../../src/installer/detect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CA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AAE,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAChF,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function atomicWrite(path: string, content: Buffer | string): Promise<void>;
@@ -0,0 +1,23 @@
1
+ import { mkdir, open, rename, unlink } from "node:fs/promises";
2
+ import { dirname } from "node:path";
3
+ import { randomUUID } from "node:crypto";
4
+ export async function atomicWrite(path, content) {
5
+ await mkdir(dirname(path), { recursive: true });
6
+ const tmp = `${path}.yaaw-tmp-${randomUUID()}`;
7
+ const handle = await open(tmp, "w");
8
+ try {
9
+ await handle.writeFile(content);
10
+ await handle.sync();
11
+ }
12
+ finally {
13
+ await handle.close();
14
+ }
15
+ try {
16
+ await rename(tmp, path);
17
+ }
18
+ catch (error) {
19
+ await unlink(tmp).catch(() => { });
20
+ throw error;
21
+ }
22
+ }
23
+ //# sourceMappingURL=filesystem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystem.js","sourceRoot":"","sources":["../../src/installer/filesystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAY,EAAE,OAAwB;IACtE,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,MAAM,GAAG,GAAG,GAAG,IAAI,aAAa,UAAU,EAAE,EAAE,CAAC;IAC/C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAChC,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;IACtB,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC1B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAClC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function sha256Bytes(value: Buffer | string): string;
@@ -0,0 +1,5 @@
1
+ import { createHash } from "node:crypto";
2
+ export function sha256Bytes(value) {
3
+ return createHash("sha256").update(value).digest("hex");
4
+ }
5
+ //# sourceMappingURL=hashing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hashing.js","sourceRoot":"","sources":["../../src/installer/hashing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,UAAU,WAAW,CAAC,KAAsB;IAChD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare function sectionMarkers(sectionId: string): {
2
+ begin: string;
3
+ end: string;
4
+ };
5
+ export declare function renderManagedSection(original: string, sectionId: string, content: string): string;
6
+ export declare function removeManagedSection(original: string, sectionId: string): string;
7
+ export declare function extractManagedSection(original: string, sectionId: string): string | null;
8
+ export declare function managedSectionHash(content: string): string;
@@ -0,0 +1,53 @@
1
+ import { sha256Bytes } from "./hashing.js";
2
+ export function sectionMarkers(sectionId) {
3
+ return {
4
+ begin: `<!-- ${sectionId}:begin -->`,
5
+ end: `<!-- ${sectionId}:end -->`
6
+ };
7
+ }
8
+ export function renderManagedSection(original, sectionId, content) {
9
+ const { begin, end } = sectionMarkers(sectionId);
10
+ const block = `${begin}\n${content.trim()}\n${end}`;
11
+ const start = original.indexOf(begin);
12
+ const finish = original.indexOf(end);
13
+ if (start === -1 && finish === -1) {
14
+ // Add no unmanaged separator bytes: uninstall can then restore the
15
+ // pre-existing file byte-for-byte. Files that already end in a newline
16
+ // render naturally; a non-newline-terminated file keeps its bytes exact.
17
+ return `${original}${block}\n`;
18
+ }
19
+ if (start === -1 || finish === -1 || finish < start) {
20
+ throw new Error(`Malformed managed section ${sectionId}`);
21
+ }
22
+ const after = finish + end.length;
23
+ return `${original.slice(0, start)}${block}${original.slice(after)}`;
24
+ }
25
+ export function removeManagedSection(original, sectionId) {
26
+ const { begin, end } = sectionMarkers(sectionId);
27
+ const start = original.indexOf(begin);
28
+ if (start === -1)
29
+ return original;
30
+ const finish = original.indexOf(end, start);
31
+ if (finish === -1)
32
+ throw new Error(`Malformed managed section ${sectionId}`);
33
+ const before = original.slice(0, start);
34
+ let after = original.slice(finish + end.length);
35
+ // The canonical managed block owns one terminating newline.
36
+ if (after.startsWith("\n"))
37
+ after = after.slice(1);
38
+ return before + after;
39
+ }
40
+ export function extractManagedSection(original, sectionId) {
41
+ const { begin, end } = sectionMarkers(sectionId);
42
+ const start = original.indexOf(begin);
43
+ if (start === -1)
44
+ return null;
45
+ const finish = original.indexOf(end, start);
46
+ if (finish === -1)
47
+ return null;
48
+ return original.slice(start + begin.length, finish).replace(/^\n|\n$/g, "");
49
+ }
50
+ export function managedSectionHash(content) {
51
+ return sha256Bytes(content.trim());
52
+ }
53
+ //# sourceMappingURL=managed-sections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managed-sections.js","sourceRoot":"","sources":["../../src/installer/managed-sections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,UAAU,cAAc,CAAC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E,CAAC,CAAC;AACrC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { InstallationManifest } from "./types.js";
2
+ export declare const MANIFEST_RELATIVE_PATH = ".yaaw-core/install/manifest.json";
3
+ export declare function emptyManifest(version: string, installedAt?: string): InstallationManifest;
4
+ export declare function readManifest(projectRoot: string): Promise<InstallationManifest | null>;
5
+ export declare function serializeManifest(manifest: InstallationManifest): string;
@@ -0,0 +1,40 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ export const MANIFEST_RELATIVE_PATH = ".yaaw-core/install/manifest.json";
4
+ export function emptyManifest(version, installedAt = new Date().toISOString()) {
5
+ return {
6
+ schema: "yaaw.installation/v1",
7
+ yaawVersion: version,
8
+ installationSchema: 1,
9
+ projectStateSchema: 1,
10
+ installedAt,
11
+ updatedAt: installedAt,
12
+ project: { root: "." },
13
+ integrations: {},
14
+ skills: [],
15
+ managedFiles: {},
16
+ managedSections: {}
17
+ };
18
+ }
19
+ export async function readManifest(projectRoot) {
20
+ try {
21
+ const raw = await readFile(join(projectRoot, MANIFEST_RELATIVE_PATH), "utf8");
22
+ const value = JSON.parse(raw);
23
+ if (value?.schema !== "yaaw.installation/v1" || value?.project?.root !== ".") {
24
+ throw new Error("Unsupported or unsafe YAAW installation manifest");
25
+ }
26
+ if (!value.managedFiles || !value.managedSections || !Array.isArray(value.skills)) {
27
+ throw new Error("Incomplete YAAW installation manifest");
28
+ }
29
+ return value;
30
+ }
31
+ catch (error) {
32
+ if (error?.code === "ENOENT")
33
+ return null;
34
+ throw error;
35
+ }
36
+ }
37
+ export function serializeManifest(manifest) {
38
+ return JSON.stringify(manifest, null, 2) + "\n";
39
+ }
40
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/installer/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,I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C;QAC1C,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAA8B;IAC9D,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;AAClD,CAAC"}
@@ -0,0 +1,14 @@
1
+ export interface MigrationContext {
2
+ projectRoot: string;
3
+ fromVersion: number;
4
+ toVersion: number;
5
+ }
6
+ export interface Migration {
7
+ from: number;
8
+ to: number;
9
+ describe(): string;
10
+ apply(ctx: MigrationContext): Promise<void>;
11
+ }
12
+ export declare const CURRENT_INSTALLATION_SCHEMA = 1;
13
+ export declare const CURRENT_PROJECT_STATE_SCHEMA = 1;
14
+ export declare function migrationPath(migrations: Migration[], from: number, to: number): Migration[];
@@ -0,0 +1,23 @@
1
+ export const CURRENT_INSTALLATION_SCHEMA = 1;
2
+ export const CURRENT_PROJECT_STATE_SCHEMA = 1;
3
+ export function migrationPath(migrations, from, to) {
4
+ if (from === to)
5
+ return [];
6
+ if (from > to)
7
+ throw new Error(`Schema downgrade is not supported: ${from} -> ${to}`);
8
+ const result = [];
9
+ let current = from;
10
+ while (current < to) {
11
+ const next = migrations.find(m => m.from === current);
12
+ if (!next)
13
+ throw new Error(`No migration registered from schema ${current} toward ${to}`);
14
+ if (next.to <= current)
15
+ throw new Error(`Invalid migration ${next.from} -> ${next.to}`);
16
+ result.push(next);
17
+ current = next.to;
18
+ }
19
+ if (current !== to)
20
+ throw new Error(`Migration chain ended at ${current}, expected ${to}`);
21
+ return result;
22
+ }
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/installer/migrations/index.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAC7C,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAE9C,MAAM,UAAU,aAAa,CAAC,UAAuB,EAAE,IAAY,EAAE,EAAU;IAC7E,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,EAAE,CAAC;IAC3B,IAAI,IAAI,GAAG,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,IAAI,OAAO,EAAE,EAAE,CAAC,CAAC;IACtF,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,OAAO,OAAO,GAAG,EAAE,EAAE,CAAC;QACpB,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,OAAO,WAAW,EAAE,EAAE,CAAC,CAAC;QAC1F,IAAI,IAAI,CAAC,EAAE,IAAI,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACxF,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;IACpB,CAAC;IACD,IAAI,OAAO,KAAK,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,OAAO,cAAc,EAAE,EAAE,CAAC,CAAC;IAC3F,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Migration } from "../index.js";
2
+ export declare const installationMigrations: Migration[];
@@ -0,0 +1,3 @@
1
+ // v0.1 starts at installation schema 1, so there are no published predecessors yet.
2
+ export const installationMigrations = [];
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/installer/migrations/installation/index.ts"],"names":[],"mappings":"AAEA,oFAAoF;AACpF,MAAM,CAAC,MAAM,sBAAsB,GAAgB,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Migration } from "../index.js";
2
+ export declare const projectMigrations: Migration[];
@@ -0,0 +1,3 @@
1
+ // v0.1 starts at project-state schema 1. Add explicit migrations here before changing that schema.
2
+ export const projectMigrations = [];
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/installer/migrations/project/index.ts"],"names":[],"mappings":"AAEA,mGAAmG;AACnG,MAAM,CAAC,MAAM,iBAAiB,GAAgB,EAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { InstallContext, InstallPlan, InstallationManifest } from "./types.js";
2
+ export declare class ManagedConflictError extends Error {
3
+ readonly conflicts: string[];
4
+ constructor(conflicts: string[]);
5
+ }
6
+ export declare function resolveSkillSelection(payloadRoot: string, request: string | string[]): Promise<string[]>;
7
+ export declare function buildInstallPlan(ctx: InstallContext, previous: InstallationManifest | null): Promise<{
8
+ plan: InstallPlan;
9
+ manifest: InstallationManifest | null;
10
+ }>;