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,176 @@
1
+ import { lstat, mkdir, readFile, rm, rmdir, stat, unlink } from "node:fs/promises";
2
+ import { dirname, relative } from "node:path";
3
+ import { assertSafeDestination } from "./boundary.js";
4
+ import { atomicWrite } from "./filesystem.js";
5
+ import { removeManagedSection, renderManagedSection } from "./managed-sections.js";
6
+ async function exists(path) {
7
+ try {
8
+ await lstat(path);
9
+ return true;
10
+ }
11
+ catch {
12
+ return false;
13
+ }
14
+ }
15
+ async function ensureDirectories(path, projectRoot, createdDirs) {
16
+ const stack = [];
17
+ let current = path;
18
+ while (!(await exists(current))) {
19
+ stack.push(current);
20
+ const next = dirname(current);
21
+ if (next === current)
22
+ break;
23
+ current = next;
24
+ }
25
+ for (const dir of stack.reverse()) {
26
+ await assertSafeDestination(projectRoot, dir);
27
+ await mkdir(dir);
28
+ createdDirs.add(dir);
29
+ }
30
+ }
31
+ async function capture(path, backups) {
32
+ if (backups.has(path))
33
+ return;
34
+ if (!(await exists(path))) {
35
+ backups.set(path, { existed: false });
36
+ return;
37
+ }
38
+ const info = await lstat(path);
39
+ if (!info.isFile())
40
+ throw new Error(`Expected file but found non-file: ${path}`);
41
+ backups.set(path, { existed: true, bytes: await readFile(path) });
42
+ }
43
+ async function operationBytes(op) {
44
+ if (op.type === "write-managed-file" || op.type === "write-project-file-if-missing")
45
+ return op.content;
46
+ if (op.type === "copy-managed-file")
47
+ return readFile(op.source);
48
+ return null;
49
+ }
50
+ export async function preflightPlan(plan) {
51
+ for (const op of plan.operations) {
52
+ if ("path" in op)
53
+ await assertSafeDestination(plan.projectRoot, op.path);
54
+ if (op.type === "copy-managed-file") {
55
+ const info = await stat(op.source);
56
+ if (!info.isFile())
57
+ throw new Error(`Managed source is not a file: ${op.source}`);
58
+ }
59
+ }
60
+ }
61
+ export async function executePlan(plan, options = {}) {
62
+ await preflightPlan(plan);
63
+ if (plan.operations.length === 0 && !options.manifestPath)
64
+ return [];
65
+ const backups = new Map();
66
+ const createdDirs = new Set();
67
+ const removedDirs = new Set();
68
+ const changed = [];
69
+ let count = 0;
70
+ const mutateFile = async (path, writer) => {
71
+ await assertSafeDestination(plan.projectRoot, path);
72
+ await ensureDirectories(dirname(path), plan.projectRoot, createdDirs);
73
+ await capture(path, backups);
74
+ await writer();
75
+ changed.push(relative(plan.projectRoot, path).replaceAll("\\", "/"));
76
+ };
77
+ try {
78
+ for (const op of plan.operations) {
79
+ if (op.type === "preserve")
80
+ continue;
81
+ if (op.type === "mkdir") {
82
+ if (!(await exists(op.path))) {
83
+ await ensureDirectories(op.path, plan.projectRoot, createdDirs);
84
+ changed.push(relative(plan.projectRoot, op.path).replaceAll("\\", "/") + "/");
85
+ }
86
+ }
87
+ else if (op.type === "write-project-file-if-missing") {
88
+ if (!(await exists(op.path))) {
89
+ await mutateFile(op.path, async () => atomicWrite(op.path, op.content));
90
+ }
91
+ }
92
+ else if (op.type === "write-managed-file") {
93
+ await mutateFile(op.path, async () => atomicWrite(op.path, op.content));
94
+ }
95
+ else if (op.type === "copy-managed-file") {
96
+ const bytes = await readFile(op.source);
97
+ await mutateFile(op.path, async () => atomicWrite(op.path, bytes));
98
+ }
99
+ else if (op.type === "update-managed-section") {
100
+ const original = (await exists(op.path)) ? await readFile(op.path, "utf8") : "";
101
+ const updated = renderManagedSection(original, op.sectionId, op.content);
102
+ if (updated !== original)
103
+ await mutateFile(op.path, async () => atomicWrite(op.path, updated));
104
+ }
105
+ else if (op.type === "remove-managed-section") {
106
+ if (await exists(op.path)) {
107
+ const original = await readFile(op.path, "utf8");
108
+ const updated = removeManagedSection(original, op.sectionId);
109
+ if (updated !== original)
110
+ await mutateFile(op.path, async () => {
111
+ if (updated.length === 0)
112
+ await unlink(op.path);
113
+ else
114
+ await atomicWrite(op.path, updated);
115
+ });
116
+ }
117
+ }
118
+ else if (op.type === "remove-managed-file") {
119
+ if (await exists(op.path)) {
120
+ await mutateFile(op.path, async () => unlink(op.path));
121
+ }
122
+ }
123
+ else if (op.type === "remove-empty-dir") {
124
+ if (await exists(op.path)) {
125
+ try {
126
+ await rmdir(op.path);
127
+ removedDirs.add(op.path);
128
+ changed.push(relative(plan.projectRoot, op.path).replaceAll("\\", "/") + "/");
129
+ }
130
+ catch (error) {
131
+ if (!["ENOTEMPTY", "ENOENT"].includes(error?.code))
132
+ throw error;
133
+ }
134
+ }
135
+ }
136
+ count += 1;
137
+ if (options.failAfterOperations && count >= options.failAfterOperations) {
138
+ throw new Error("Simulated installer transaction failure");
139
+ }
140
+ }
141
+ if (options.beforeManifest)
142
+ await options.beforeManifest();
143
+ if (options.manifestPath && options.manifestContent !== undefined) {
144
+ await mutateFile(options.manifestPath, async () => atomicWrite(options.manifestPath, options.manifestContent));
145
+ }
146
+ return changed;
147
+ }
148
+ catch (error) {
149
+ const restore = [...backups.entries()].reverse();
150
+ for (const [path, backup] of restore) {
151
+ try {
152
+ if (backup.existed)
153
+ await atomicWrite(path, backup.bytes);
154
+ else
155
+ await rm(path, { force: true });
156
+ }
157
+ catch { }
158
+ }
159
+ const removed = [...removedDirs].sort((a, b) => a.length - b.length);
160
+ for (const dir of removed) {
161
+ try {
162
+ await mkdir(dir, { recursive: true });
163
+ }
164
+ catch { }
165
+ }
166
+ const dirs = [...createdDirs].sort((a, b) => b.length - a.length);
167
+ for (const dir of dirs) {
168
+ try {
169
+ await rmdir(dir);
170
+ }
171
+ catch { }
172
+ }
173
+ throw error;
174
+ }
175
+ }
176
+ //# sourceMappingURL=transaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../src/installer/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAW,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,qBAAqB,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O,EAAE,CAAC;YACrC,IAAI,CAAC;gBACH,IAAI,MAAM,CAAC,OAAO;oBAAE,MAAM,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,KAAM,CAAC,CAAC;;oBACtD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACvC,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;QACZ,CAAC;QACD,MAAM,OAAO,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,CAAC,MAAM,GAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAChE,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YAC1B,IAAI,CAAC;gBAAC,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;QACzD,CAAC;QACD,MAAM,IAAI,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,CAAC,MAAM,GAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAC7D,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,IAAI,CAAC;gBAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;QACpC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,98 @@
1
+ import type { IntegrationId } from "../integrations/types.js";
2
+ export type InstallAction = "fresh" | "quick-update" | "modify" | "repair" | "uninstall";
3
+ export type InstallMode = "interactive" | "headless";
4
+ export type ConflictPolicy = "fail" | "keep" | "replace" | "backup-replace";
5
+ export interface InstallContext {
6
+ packageVersion: string;
7
+ payloadRoot: string;
8
+ requestedDirectory: string;
9
+ projectRoot: string;
10
+ mode: InstallMode;
11
+ selectedIntegrations: IntegrationId[];
12
+ selectedSkills: string[];
13
+ action: InstallAction;
14
+ dryRun: boolean;
15
+ forceManaged: boolean;
16
+ conflictPolicy: ConflictPolicy;
17
+ }
18
+ export type InstallOperation = {
19
+ type: "mkdir";
20
+ path: string;
21
+ owner?: string;
22
+ } | {
23
+ type: "write-managed-file";
24
+ path: string;
25
+ content: Buffer | string;
26
+ owner: string;
27
+ } | {
28
+ type: "copy-managed-file";
29
+ source: string;
30
+ path: string;
31
+ owner: string;
32
+ } | {
33
+ type: "write-project-file-if-missing";
34
+ path: string;
35
+ content: Buffer | string;
36
+ } | {
37
+ type: "update-managed-section";
38
+ path: string;
39
+ sectionId: string;
40
+ content: string;
41
+ owner: string;
42
+ } | {
43
+ type: "remove-managed-file";
44
+ path: string;
45
+ owner: string;
46
+ } | {
47
+ type: "remove-managed-section";
48
+ path: string;
49
+ sectionId: string;
50
+ owner: string;
51
+ } | {
52
+ type: "remove-empty-dir";
53
+ path: string;
54
+ owner: string;
55
+ } | {
56
+ type: "preserve";
57
+ path: string;
58
+ reason: string;
59
+ };
60
+ export interface InstallPlan {
61
+ action: InstallAction;
62
+ projectRoot: string;
63
+ operations: InstallOperation[];
64
+ selectedIntegrations: IntegrationId[];
65
+ selectedSkills: string[];
66
+ warnings: string[];
67
+ }
68
+ export interface ManagedFileRecord {
69
+ owner: string;
70
+ sha256: string;
71
+ packageSha256?: string;
72
+ localOverride?: boolean;
73
+ }
74
+ export interface ManagedSectionRecord {
75
+ owner: string;
76
+ sha256: string;
77
+ packageSha256?: string;
78
+ localOverride?: boolean;
79
+ }
80
+ export interface InstallationManifest {
81
+ schema: "yaaw.installation/v1";
82
+ yaawVersion: string;
83
+ installationSchema: 1;
84
+ projectStateSchema: 1;
85
+ installedAt: string;
86
+ updatedAt: string;
87
+ project: {
88
+ root: ".";
89
+ };
90
+ integrations: Record<string, {
91
+ adapterVersion: number;
92
+ skillsRoot: string;
93
+ bootstrap: string;
94
+ }>;
95
+ skills: string[];
96
+ managedFiles: Record<string, ManagedFileRecord>;
97
+ managedSections: Record<string, Record<string, ManagedSectionRecord>>;
98
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/installer/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import type { IntegrationId } from "../integrations/types.js";
2
+ export declare function verifyInstalledState(projectRoot: string, integrations: IntegrationId[], skills: string[]): Promise<void>;
@@ -0,0 +1,49 @@
1
+ import { access, readFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { getIntegration } from "../integrations/registry.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 verifyInstalledState(projectRoot, integrations, skills) {
14
+ const required = [
15
+ ".yaaw-core/core",
16
+ ".yaaw-core/roles",
17
+ ".yaaw-core/workflows",
18
+ ".yaaw-core/registries",
19
+ ".yaaw-core/templates",
20
+ ".yaaw-core/project/product.md",
21
+ ".yaaw-core/project/engineering.md",
22
+ ".yaaw-core/project/state.json",
23
+ ".yaaw-core/runtime",
24
+ ".yaaw-core/install"
25
+ ];
26
+ const issues = [];
27
+ for (const rel of required)
28
+ if (!(await exists(join(projectRoot, rel))))
29
+ issues.push(`missing ${rel}`);
30
+ if (await exists(join(projectRoot, ".yaaw"))) {
31
+ issues.push("legacy .yaaw root exists; automatic merge is intentionally unsupported");
32
+ }
33
+ for (const id of integrations) {
34
+ const result = await getIntegration(id).verify({ projectRoot, payloadRoot: "" }, skills);
35
+ issues.push(...result.issues.map(issue => `${id}: ${issue}`));
36
+ }
37
+ try {
38
+ const paths = JSON.parse(await readFile(join(projectRoot, ".yaaw-core", "registries", "paths.json"), "utf8"));
39
+ if (paths.project_root !== ".yaaw-core/project" || paths.runtime_root !== ".yaaw-core/runtime") {
40
+ issues.push("installed paths registry violates one-root distribution contract");
41
+ }
42
+ }
43
+ catch {
44
+ issues.push("installed paths registry missing or invalid");
45
+ }
46
+ if (issues.length)
47
+ throw new Error(`Installed-state verification failed:\n- ${issues.join("\n- ")}`);
48
+ }
49
+ //# sourceMappingURL=verify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify.js","sourceRoot":"","sources":["../../src/installer/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,KAAK,UAAU,MAAM,CAAC,IAAY;IAChC,IAAI,CAAC;QAAC,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;QAAC,OAAO,IAAI,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,KAAK,CAAC;IAAC,CAAC;AAClE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,WAAmB,EAAE,YAA6B,EAAE,MAAgB;IAC7G,MAAM,QAAQ,GAAG;QACf,iBAAiB;QACjB,kBAAkB;QAClB,sBAAsB;QACtB,uBAAuB;QACvB,sBAAsB;QACtB,+BAA+B;QAC/B,mCAAmC;QACnC,+BAA+B;QAC/B,oBAAoB;QACpB,oBAAoB;KACrB,CAAC;IACF,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,GAAG,IAAI,QAAQ;QAAE,IAAI,CAAC,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,CAAC;IAEvG,IAAI,MAAM,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;QAC7C,MAAM,CAAC,IAAI,CAAC,wEAAwE,CAAC,CAAC;IACxF,CAAC;IAED,KAAK,MAAM,EAAE,IAAI,YAAY,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;QACzF,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAA,EAAE,CAAA,GAAG,EAAE,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;QAC9G,IAAI,KAAK,CAAC,YAAY,KAAK,oBAAoB,IAAI,KAAK,CAAC,YAAY,KAAK,oBAAoB,EAAE,CAAC;YAC/F,MAAM,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;QAClF,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI,MAAM,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,2CAA2C,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACvG,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const claudeCodeAdapter: import("./types.js").IntegrationAdapter;
@@ -0,0 +1,13 @@
1
+ import { makeAdapter } from "./helpers.js";
2
+ export const claudeCodeAdapter = makeAdapter({
3
+ id: "claude-code",
4
+ displayName: "Claude Code",
5
+ executable: "claude",
6
+ detectionPaths: [".claude", "CLAUDE.md"],
7
+ skillsRel: ".claude/skills",
8
+ bootstrapRel: "CLAUDE.md",
9
+ bootstrapTemplate: "claude-code.md",
10
+ managedSection: true,
11
+ hint: skill => `/${skill}`
12
+ });
13
+ //# sourceMappingURL=claude-code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../src/integrations/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC;IAC3C,EAAE,EAAE,aAAa;IACjB,WAAW,EAAE,aAAa;IAC1B,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;IACxC,SAAS,EAAE,gBAAgB;IAC3B,YAAY,EAAE,WAAW;IACzB,iBAAiB,EAAE,gBAAgB;IACnC,cAAc,EAAE,IAAI;IACpB,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,EAAE;CAC3B,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const clineAdapter: import("./types.js").IntegrationAdapter;
@@ -0,0 +1,13 @@
1
+ import { makeAdapter } from "./helpers.js";
2
+ export const clineAdapter = makeAdapter({
3
+ id: "cline",
4
+ displayName: "Cline",
5
+ executable: null,
6
+ detectionPaths: [".cline"],
7
+ skillsRel: ".cline/skills",
8
+ bootstrapRel: ".cline/rules/yaaw-se.md",
9
+ bootstrapTemplate: "cline.md",
10
+ managedSection: false,
11
+ hint: skill => `/${skill}`
12
+ });
13
+ //# sourceMappingURL=cline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cline.js","sourceRoot":"","sources":["../../src/integrations/cline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;IACtC,EAAE,EAAE,OAAO;IACX,WAAW,EAAE,OAAO;IACpB,UAAU,EAAE,IAAI;IAChB,cAAc,EAAE,CAAC,QAAQ,CAAC;IAC1B,SAAS,EAAE,eAAe;IAC1B,YAAY,EAAE,yBAAyB;IACvC,iBAAiB,EAAE,UAAU;IAC7B,cAAc,EAAE,KAAK;IACrB,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,EAAE;CAC3B,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const codexAdapter: import("./types.js").IntegrationAdapter;
@@ -0,0 +1,13 @@
1
+ import { makeAdapter } from "./helpers.js";
2
+ export const codexAdapter = makeAdapter({
3
+ id: "codex",
4
+ displayName: "Codex",
5
+ executable: "codex",
6
+ detectionPaths: [".agents", "AGENTS.md"],
7
+ skillsRel: ".agents/skills",
8
+ bootstrapRel: "AGENTS.md",
9
+ bootstrapTemplate: "codex.md",
10
+ managedSection: true,
11
+ hint: skill => `$${skill}`
12
+ });
13
+ //# sourceMappingURL=codex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex.js","sourceRoot":"","sources":["../../src/integrations/codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;IACtC,EAAE,EAAE,OAAO;IACX,WAAW,EAAE,OAAO;IACpB,UAAU,EAAE,OAAO;IACnB,cAAc,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;IACxC,SAAS,EAAE,gBAAgB;IAC3B,YAAY,EAAE,WAAW;IACzB,iBAAiB,EAAE,UAAU;IAC7B,cAAc,EAAE,IAAI;IACpB,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,EAAE;CAC3B,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const geminiCliAdapter: import("./types.js").IntegrationAdapter;
@@ -0,0 +1,13 @@
1
+ import { makeAdapter } from "./helpers.js";
2
+ export const geminiCliAdapter = makeAdapter({
3
+ id: "gemini-cli",
4
+ displayName: "Gemini CLI",
5
+ executable: "gemini",
6
+ detectionPaths: [".gemini", "GEMINI.md"],
7
+ skillsRel: ".gemini/skills",
8
+ bootstrapRel: "GEMINI.md",
9
+ bootstrapTemplate: "gemini-cli.md",
10
+ managedSection: true,
11
+ hint: skill => `/skills list; then ask Gemini to use \`${skill}\``
12
+ });
13
+ //# sourceMappingURL=gemini-cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gemini-cli.js","sourceRoot":"","sources":["../../src/integrations/gemini-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC;IAC1C,EAAE,EAAE,YAAY;IAChB,WAAW,EAAE,YAAY;IACzB,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;IACxC,SAAS,EAAE,gBAAgB;IAC3B,YAAY,EAAE,WAAW;IACzB,iBAAiB,EAAE,eAAe;IAClC,cAAc,EAAE,IAAI;IACpB,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,0CAA0C,KAAK,IAAI;CACnE,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { DetectionResult, IntegrationAdapter, IntegrationId } from "./types.js";
2
+ export declare function pathExists(path: string): Promise<boolean>;
3
+ export declare function detectSignals(projectRoot: string, executable: string | null, paths: string[]): Promise<DetectionResult>;
4
+ export declare function makeAdapter(config: {
5
+ id: IntegrationId;
6
+ displayName: string;
7
+ executable: string | null;
8
+ detectionPaths: string[];
9
+ skillsRel: string;
10
+ bootstrapRel: string;
11
+ bootstrapTemplate: string;
12
+ managedSection: boolean;
13
+ hint(skill: string): string;
14
+ }): IntegrationAdapter;
@@ -0,0 +1,86 @@
1
+ import { access } from "node:fs/promises";
2
+ import { constants } from "node:fs";
3
+ import { execFile } from "node:child_process";
4
+ import { promisify } from "node:util";
5
+ import { join } from "node:path";
6
+ import { renderAgentSkill } from "../renderers/agent-skill.js";
7
+ import { renderBootstrapTemplate } from "../renderers/bootstrap-block.js";
8
+ const execFileAsync = promisify(execFile);
9
+ export async function pathExists(path) {
10
+ try {
11
+ await access(path, constants.F_OK);
12
+ return true;
13
+ }
14
+ catch {
15
+ return false;
16
+ }
17
+ }
18
+ export async function detectSignals(projectRoot, executable, paths) {
19
+ const signals = [];
20
+ if (executable) {
21
+ try {
22
+ await execFileAsync(process.platform === "win32" ? "where" : "which", [executable]);
23
+ signals.push(`${executable} executable`);
24
+ }
25
+ catch { }
26
+ }
27
+ for (const rel of paths)
28
+ if (await pathExists(join(projectRoot, rel)))
29
+ signals.push(rel);
30
+ return { detected: signals.length > 0, signals };
31
+ }
32
+ export function makeAdapter(config) {
33
+ return {
34
+ id: config.id,
35
+ displayName: config.displayName,
36
+ maturity: "stable",
37
+ adapterVersion: 1,
38
+ detect: root => detectSignals(root, config.executable, config.detectionPaths),
39
+ skillsRoot: root => join(root, config.skillsRel),
40
+ bootstrapRelativePath: config.bootstrapRel,
41
+ async planBootstrap(ctx) {
42
+ const source = join(ctx.payloadRoot, "bootstrap", config.bootstrapTemplate);
43
+ if (config.managedSection) {
44
+ return [{
45
+ type: "update-managed-section",
46
+ path: join(ctx.projectRoot, config.bootstrapRel),
47
+ sectionId: "yaaw-se",
48
+ content: await renderBootstrapTemplate(source),
49
+ owner: `integration:${config.id}`
50
+ }];
51
+ }
52
+ return [{
53
+ type: "copy-managed-file",
54
+ source,
55
+ path: join(ctx.projectRoot, config.bootstrapRel),
56
+ owner: `integration:${config.id}`
57
+ }];
58
+ },
59
+ async planSkills(ctx, skills) {
60
+ const operations = [];
61
+ for (const skill of skills) {
62
+ operations.push({
63
+ type: "write-managed-file",
64
+ path: join(ctx.projectRoot, config.skillsRel, skill.id, "SKILL.md"),
65
+ content: await renderAgentSkill(skill.source, skill.id),
66
+ owner: `integration:${config.id}`
67
+ });
68
+ }
69
+ return operations;
70
+ },
71
+ async verify(ctx, selectedSkillIds) {
72
+ const issues = [];
73
+ for (const skill of selectedSkillIds) {
74
+ if (!(await pathExists(join(ctx.projectRoot, config.skillsRel, skill, "SKILL.md")))) {
75
+ issues.push(`missing ${config.skillsRel}/${skill}/SKILL.md`);
76
+ }
77
+ }
78
+ if (!(await pathExists(join(ctx.projectRoot, config.bootstrapRel)))) {
79
+ issues.push(`missing bootstrap ${config.bootstrapRel}`);
80
+ }
81
+ return { healthy: issues.length === 0, issues };
82
+ },
83
+ invocationHint: config.hint
84
+ };
85
+ }
86
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/integrations/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAY,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAI1E,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAY;IAC3C,IAAI,CAAC;QAAC,MAAM,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QAAC,OAAO,IAAI,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,KAAK,CAAC;IAAC,CAAC;AAClF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,WAAmB,EAAE,UAAyB,EAAE,KAAe;IACjG,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,UAAU,EAAE,CAAC;QACf,IAAI,CAAC;YACH,MAAM,aAAa,CAAC,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C,CAAC;gBAC/D,CAAC;YACH,CAAC;YACD,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;gBACpE,MAAM,CAAC,IAAI,CAAC,qBAAqB,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;YAC1D,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAClD,CAAC;QACD,cAAc,EAAE,MAAM,CAAC,IAAI;KAC5B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { IntegrationAdapter, IntegrationId } from "./types.js";
2
+ export declare const integrations: Record<IntegrationId, IntegrationAdapter>;
3
+ export declare const integrationIds: IntegrationId[];
4
+ export declare function getIntegration(id: string): IntegrationAdapter;
@@ -0,0 +1,18 @@
1
+ import { codexAdapter } from "./codex.js";
2
+ import { claudeCodeAdapter } from "./claude-code.js";
3
+ import { geminiCliAdapter } from "./gemini-cli.js";
4
+ import { clineAdapter } from "./cline.js";
5
+ export const integrations = {
6
+ codex: codexAdapter,
7
+ "claude-code": claudeCodeAdapter,
8
+ "gemini-cli": geminiCliAdapter,
9
+ cline: clineAdapter
10
+ };
11
+ export const integrationIds = Object.keys(integrations);
12
+ export function getIntegration(id) {
13
+ const adapter = integrations[id];
14
+ if (!adapter)
15
+ throw new Error(`Unknown integration: ${id}`);
16
+ return adapter;
17
+ }
18
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/integrations/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,MAAM,CAAC,MAAM,YAAY,GAA8C;IACrE,KAAK,EAAE,YAAY;IACnB,aAAa,EAAE,iBAAiB;IAChC,YAAY,EAAE,gBAAgB;IAC9B,KAAK,EAAE,YAAY;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAoB,CAAC;AAE3E,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,MAAM,OAAO,GAAG,YAAY,CAAC,EAAmB,CAAC,CAAC;IAClD,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;IAC5D,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { InstallOperation } from "../installer/types.js";
2
+ export type IntegrationId = "codex" | "claude-code" | "gemini-cli" | "cline";
3
+ export interface DetectionResult {
4
+ detected: boolean;
5
+ signals: string[];
6
+ }
7
+ export interface IntegrationContext {
8
+ projectRoot: string;
9
+ payloadRoot: string;
10
+ }
11
+ export interface IntegrationVerification {
12
+ healthy: boolean;
13
+ issues: string[];
14
+ }
15
+ export interface CanonicalSkill {
16
+ id: string;
17
+ source: string;
18
+ }
19
+ export interface IntegrationAdapter {
20
+ id: IntegrationId;
21
+ displayName: string;
22
+ maturity: "stable" | "experimental";
23
+ adapterVersion: number;
24
+ detect(projectRoot: string): Promise<DetectionResult>;
25
+ skillsRoot(projectRoot: string): string;
26
+ bootstrapRelativePath: string;
27
+ planBootstrap(ctx: IntegrationContext): Promise<InstallOperation[]>;
28
+ planSkills(ctx: IntegrationContext, skills: CanonicalSkill[]): Promise<InstallOperation[]>;
29
+ verify(ctx: IntegrationContext, selectedSkillIds: string[]): Promise<IntegrationVerification>;
30
+ invocationHint(skillName: string): string;
31
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/integrations/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ ## YAAW-SE
2
+
3
+ This project uses YAAW-SE.
4
+
5
+ - Canonical YAAW implementation: `.yaaw-core/`
6
+ - Durable project memory: `.yaaw-core/project/`
7
+ - Public Claude Code skills: `.claude/skills/yaaw-*/`
8
+ - Treat `.yaaw-core/project/` as durable project state.
9
+ - Do not duplicate YAAW workflow logic into `CLAUDE.md`.
10
+ - When a YAAW skill is invoked, follow its canonical role/workflow references.
@@ -0,0 +1,10 @@
1
+ # YAAW-SE
2
+
3
+ This workspace uses YAAW-SE.
4
+
5
+ - Canonical YAAW implementation: `.yaaw-core/`
6
+ - Durable project memory: `.yaaw-core/project/`
7
+ - Public Cline skills: `.cline/skills/yaaw-*/`
8
+ - Treat `.yaaw-core/project/` as durable project state.
9
+ - Do not duplicate YAAW workflow logic into provider rules.
10
+ - When a YAAW skill is invoked, follow its canonical role/workflow references.