@open-agent-toolkit/cli 0.2.40 → 0.2.45

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 (213) hide show
  1. package/assets/agents/oat-codebase-mapper.md +15 -3
  2. package/assets/agents/oat-phase-implementer.md +34 -9
  3. package/assets/agents/oat-reviewer.md +2 -2
  4. package/assets/bundle-metadata.json +1 -1
  5. package/assets/docs/cli-utilities/configuration.md +11 -1
  6. package/assets/docs/cli-utilities/tool-packs.md +8 -0
  7. package/assets/docs/contributing/skills.md +67 -14
  8. package/assets/docs/quickstart.md +9 -0
  9. package/assets/docs/reference/cli-reference.md +56 -1
  10. package/assets/docs/reference/file-locations.md +18 -1
  11. package/assets/docs/reference/oat-directory-structure.md +20 -4
  12. package/assets/docs/workflows/projects/artifacts.md +27 -1
  13. package/assets/docs/workflows/projects/implementation-execution.md +22 -0
  14. package/assets/docs/workflows/projects/index.md +6 -0
  15. package/assets/docs/workflows/projects/lifecycle.md +19 -5
  16. package/assets/docs/workflows/projects/picking-up-projects.md +75 -0
  17. package/assets/docs/workflows/projects/pr-flow.md +22 -1
  18. package/assets/docs/workflows/projects/reviewing-oat-prs.md +60 -0
  19. package/assets/public-package-versions.json +4 -4
  20. package/assets/skills/analyze/SKILL.md +13 -5
  21. package/assets/skills/compare/SKILL.md +11 -2
  22. package/assets/skills/oat-brainstorm/SKILL.md +135 -32
  23. package/assets/skills/oat-brainstorm/references/destinations.md +9 -6
  24. package/assets/skills/oat-cursor-cloud-projects/SKILL.md +11 -1
  25. package/assets/skills/oat-dispatch-subagents/SKILL.md +19 -6
  26. package/assets/skills/oat-doctor/SKILL.md +8 -1
  27. package/assets/skills/oat-project-autonomous/SKILL.md +45 -1
  28. package/assets/skills/oat-project-autonomous/references/gate-inventory.md +8 -8
  29. package/assets/skills/oat-project-capture/SKILL.md +29 -9
  30. package/assets/skills/oat-project-complete/SKILL.md +610 -38
  31. package/assets/skills/oat-project-complete/scripts/parse-completion-retry-fields.mjs +265 -0
  32. package/assets/skills/oat-project-complete/scripts/recover-completion-receipts.mjs +764 -0
  33. package/assets/skills/oat-project-complete/scripts/resolve-completion-retry.mjs +134 -0
  34. package/assets/skills/oat-project-complete/scripts/validate-nonarchive-lifecycle-receipt.mjs +160 -0
  35. package/assets/skills/oat-project-design/SKILL.md +33 -9
  36. package/assets/skills/oat-project-discover/SKILL.md +16 -3
  37. package/assets/skills/oat-project-document/SKILL.md +10 -4
  38. package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +8 -8
  39. package/assets/skills/oat-project-implement/SKILL.md +14 -3
  40. package/assets/skills/oat-project-implement/references/completion-and-closeout.md +18 -6
  41. package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +8 -8
  42. package/assets/skills/oat-project-implement/references/phase-execution.md +9 -3
  43. package/assets/skills/oat-project-implement/references/plan-and-resume.md +3 -0
  44. package/assets/skills/oat-project-import-plan/SKILL.md +15 -9
  45. package/assets/skills/oat-project-new/SKILL.md +7 -5
  46. package/assets/skills/oat-project-next/SKILL.md +32 -10
  47. package/assets/skills/oat-project-plan/SKILL.md +18 -3
  48. package/assets/skills/oat-project-pr-final/SKILL.md +23 -2
  49. package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +8 -8
  50. package/assets/skills/oat-project-pr-progress/SKILL.md +23 -2
  51. package/assets/skills/oat-project-progress/SKILL.md +23 -9
  52. package/assets/skills/oat-project-promote-spec-driven/SKILL.md +20 -2
  53. package/assets/skills/oat-project-quick-start/SKILL.md +48 -18
  54. package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +8 -8
  55. package/assets/skills/oat-project-reconcile/SKILL.md +14 -10
  56. package/assets/skills/oat-project-retro/SKILL.md +3 -3
  57. package/assets/skills/oat-project-retro/references/apply-procedure.md +102 -6
  58. package/assets/skills/oat-project-retro-file/SKILL.md +57 -6
  59. package/assets/skills/oat-project-review-provide/SKILL.md +56 -6
  60. package/assets/skills/oat-project-review-receive/SKILL.md +16 -7
  61. package/assets/skills/oat-project-review-receive-remote/SKILL.md +9 -3
  62. package/assets/skills/oat-project-revise/SKILL.md +12 -3
  63. package/assets/skills/oat-project-spec/SKILL.md +16 -3
  64. package/assets/skills/oat-project-summary/SKILL.md +113 -13
  65. package/assets/skills/oat-repo-improve/SKILL.md +18 -7
  66. package/assets/skills/oat-review-provide-remote/SKILL.md +11 -2
  67. package/assets/skills/oat-wave-execute/SKILL.md +34 -2
  68. package/assets/skills/oat-worktree-bootstrap/SKILL.md +13 -1
  69. package/assets/skills/oat-worktree-bootstrap-auto/SKILL.md +13 -1
  70. package/dist/commands/config/index.d.ts +1 -0
  71. package/dist/commands/config/index.d.ts.map +1 -1
  72. package/dist/commands/config/index.js +30 -2
  73. package/dist/commands/doctor/index.d.ts +2 -0
  74. package/dist/commands/doctor/index.d.ts.map +1 -1
  75. package/dist/commands/doctor/index.js +27 -3
  76. package/dist/commands/doctor/synced-projects.d.ts +12 -0
  77. package/dist/commands/doctor/synced-projects.d.ts.map +1 -0
  78. package/dist/commands/doctor/synced-projects.js +208 -0
  79. package/dist/commands/init/gitattributes.d.ts +4 -0
  80. package/dist/commands/init/gitattributes.d.ts.map +1 -0
  81. package/dist/commands/init/gitattributes.js +12 -0
  82. package/dist/commands/init/gitignore.d.ts +8 -1
  83. package/dist/commands/init/gitignore.d.ts.map +1 -1
  84. package/dist/commands/init/gitignore.js +146 -41
  85. package/dist/commands/init/index.d.ts +2 -0
  86. package/dist/commands/init/index.d.ts.map +1 -1
  87. package/dist/commands/init/index.js +3 -0
  88. package/dist/commands/init/managed-block.d.ts +10 -0
  89. package/dist/commands/init/managed-block.d.ts.map +1 -0
  90. package/dist/commands/init/managed-block.js +40 -0
  91. package/dist/commands/init/tools/workflows/install-workflows.js +1 -1
  92. package/dist/commands/local/index.d.ts.map +1 -1
  93. package/dist/commands/local/index.js +5 -1
  94. package/dist/commands/local/sync.d.ts +4 -0
  95. package/dist/commands/local/sync.d.ts.map +1 -1
  96. package/dist/commands/local/sync.js +123 -2
  97. package/dist/commands/pjm/adoption.d.ts +2 -0
  98. package/dist/commands/pjm/adoption.d.ts.map +1 -1
  99. package/dist/commands/pjm/adoption.js +1 -1
  100. package/dist/commands/project/archive/archive-utils.d.ts +24 -0
  101. package/dist/commands/project/archive/archive-utils.d.ts.map +1 -1
  102. package/dist/commands/project/archive/archive-utils.js +349 -22
  103. package/dist/commands/project/archive/index.d.ts.map +1 -1
  104. package/dist/commands/project/archive/index.js +1 -0
  105. package/dist/commands/project/archive/push-runner.d.ts +5 -1
  106. package/dist/commands/project/archive/push-runner.d.ts.map +1 -1
  107. package/dist/commands/project/archive/push-runner.js +33 -4
  108. package/dist/commands/project/complete-state/index.d.ts.map +1 -1
  109. package/dist/commands/project/complete-state/index.js +3 -1
  110. package/dist/commands/project/index.d.ts.map +1 -1
  111. package/dist/commands/project/index.js +12 -0
  112. package/dist/commands/project/links/compute.d.ts +9 -0
  113. package/dist/commands/project/links/compute.d.ts.map +1 -0
  114. package/dist/commands/project/links/compute.js +27 -0
  115. package/dist/commands/project/links/index.d.ts +17 -0
  116. package/dist/commands/project/links/index.d.ts.map +1 -0
  117. package/dist/commands/project/links/index.js +72 -0
  118. package/dist/commands/project/links/refresh.d.ts +26 -0
  119. package/dist/commands/project/links/refresh.d.ts.map +1 -0
  120. package/dist/commands/project/links/refresh.js +92 -0
  121. package/dist/commands/project/links/render.d.ts +24 -0
  122. package/dist/commands/project/links/render.d.ts.map +1 -0
  123. package/dist/commands/project/links/render.js +68 -0
  124. package/dist/commands/project/list.d.ts +5 -0
  125. package/dist/commands/project/list.d.ts.map +1 -1
  126. package/dist/commands/project/list.js +182 -9
  127. package/dist/commands/project/migrate/index.d.ts +22 -0
  128. package/dist/commands/project/migrate/index.d.ts.map +1 -0
  129. package/dist/commands/project/migrate/index.js +79 -0
  130. package/dist/commands/project/new/index.d.ts +2 -0
  131. package/dist/commands/project/new/index.d.ts.map +1 -1
  132. package/dist/commands/project/new/index.js +14 -2
  133. package/dist/commands/project/new/scaffold.d.ts +22 -1
  134. package/dist/commands/project/new/scaffold.d.ts.map +1 -1
  135. package/dist/commands/project/new/scaffold.js +287 -69
  136. package/dist/commands/project/open/index.d.ts +16 -0
  137. package/dist/commands/project/open/index.d.ts.map +1 -1
  138. package/dist/commands/project/open/index.js +151 -19
  139. package/dist/commands/project/pause/index.d.ts +8 -0
  140. package/dist/commands/project/pause/index.d.ts.map +1 -1
  141. package/dist/commands/project/pause/index.js +129 -19
  142. package/dist/commands/project/prune/index.d.ts +21 -0
  143. package/dist/commands/project/prune/index.d.ts.map +1 -0
  144. package/dist/commands/project/prune/index.js +95 -0
  145. package/dist/commands/project/pull/index.d.ts +28 -0
  146. package/dist/commands/project/pull/index.d.ts.map +1 -0
  147. package/dist/commands/project/pull/index.js +157 -0
  148. package/dist/commands/project/push/index.d.ts +22 -0
  149. package/dist/commands/project/push/index.d.ts.map +1 -0
  150. package/dist/commands/project/push/index.js +100 -0
  151. package/dist/commands/project/scope/index.d.ts +17 -0
  152. package/dist/commands/project/scope/index.d.ts.map +1 -0
  153. package/dist/commands/project/scope/index.js +107 -0
  154. package/dist/commands/project/split/run.d.ts +4 -0
  155. package/dist/commands/project/split/run.d.ts.map +1 -1
  156. package/dist/commands/project/split/run.js +48 -10
  157. package/dist/commands/project/sync/git.d.ts +18 -0
  158. package/dist/commands/project/sync/git.d.ts.map +1 -0
  159. package/dist/commands/project/sync/git.js +60 -0
  160. package/dist/commands/project/sync/record.d.ts +22 -0
  161. package/dist/commands/project/sync/record.d.ts.map +1 -0
  162. package/dist/commands/project/sync/record.js +133 -0
  163. package/dist/commands/project/sync/ref-sync.d.ts +120 -0
  164. package/dist/commands/project/sync/ref-sync.d.ts.map +1 -0
  165. package/dist/commands/project/sync/ref-sync.js +962 -0
  166. package/dist/commands/project/sync/resolve-target.d.ts +27 -0
  167. package/dist/commands/project/sync/resolve-target.d.ts.map +1 -0
  168. package/dist/commands/project/sync/resolve-target.js +159 -0
  169. package/dist/commands/shared/oat-paths.d.ts +4 -1
  170. package/dist/commands/shared/oat-paths.d.ts.map +1 -1
  171. package/dist/commands/shared/oat-paths.js +2 -2
  172. package/dist/commands/shared/project-scope.d.ts +23 -0
  173. package/dist/commands/shared/project-scope.d.ts.map +1 -0
  174. package/dist/commands/shared/project-scope.js +106 -0
  175. package/dist/commands/tools/migrate/index.js +1 -1
  176. package/dist/commands/tools/shared/pack-inventory.d.ts.map +1 -1
  177. package/dist/commands/tools/shared/pack-inventory.js +11 -0
  178. package/dist/commands/tools/shared/pack-lifecycle.js +1 -1
  179. package/dist/commands/tools/shared/pack-reconcile.d.ts.map +1 -1
  180. package/dist/commands/tools/shared/pack-reconcile.js +4 -1
  181. package/dist/commands/tools/update/index.d.ts.map +1 -1
  182. package/dist/commands/tools/update/index.js +20 -10
  183. package/dist/commands/tools/update/update-tools.d.ts +2 -0
  184. package/dist/commands/tools/update/update-tools.d.ts.map +1 -1
  185. package/dist/config/oat-config.d.ts +6 -3
  186. package/dist/config/oat-config.d.ts.map +1 -1
  187. package/dist/config/oat-config.js +41 -7
  188. package/dist/config/resolve.d.ts.map +1 -1
  189. package/dist/config/resolve.js +2 -1
  190. package/dist/fs/io.d.ts +2 -1
  191. package/dist/fs/io.d.ts.map +1 -1
  192. package/dist/fs/io.js +5 -2
  193. package/dist/projects/split/finalize.d.ts.map +1 -1
  194. package/dist/projects/split/finalize.js +55 -2
  195. package/dist/projects/split/resume.d.ts +3 -0
  196. package/dist/projects/split/resume.d.ts.map +1 -1
  197. package/dist/projects/split/resume.js +34 -7
  198. package/dist/projects/split/seed-children.d.ts.map +1 -1
  199. package/dist/projects/split/seed-children.js +6 -0
  200. package/dist/projects/split/write-parent.d.ts +7 -0
  201. package/dist/projects/split/write-parent.d.ts.map +1 -1
  202. package/dist/projects/split/write-parent.js +7 -4
  203. package/dist/release/public-package-contract.d.ts.map +1 -1
  204. package/dist/release/public-package-contract.js +1 -0
  205. package/dist/validation/skills.d.ts.map +1 -1
  206. package/dist/validation/skills.js +434 -0
  207. package/package.json +4 -4
  208. package/dist/__tests__/skills/split-flow-fixtures.d.ts +0 -50
  209. package/dist/__tests__/skills/split-flow-fixtures.d.ts.map +0 -1
  210. package/dist/__tests__/skills/split-flow-fixtures.js +0 -161
  211. package/dist/commands/__tests__/helpers.d.ts +0 -12
  212. package/dist/commands/__tests__/helpers.d.ts.map +0 -1
  213. package/dist/commands/__tests__/helpers.js +0 -36
@@ -0,0 +1,22 @@
1
+ import { SYNCED_REMOTE } from '../../shared/project-scope.js';
2
+ import { z } from 'zod';
3
+ export interface SyncedProjectRecord {
4
+ schemaVersion: 1;
5
+ slug: string;
6
+ scope: 'synced';
7
+ ref: string;
8
+ remote: typeof SYNCED_REMOTE;
9
+ status: 'active' | 'complete';
10
+ createdAt: string;
11
+ completedAt: string | null;
12
+ archiveSnapshot?: string;
13
+ archiveSourceRefSha?: string;
14
+ }
15
+ export declare const SyncedProjectRecordSchema: z.ZodType<SyncedProjectRecord>;
16
+ export declare function buildSyncedRecord(slug: string, now: Date): SyncedProjectRecord;
17
+ export declare function readSyncedRecord(path: string): Promise<SyncedProjectRecord | null>;
18
+ export declare function writeSyncedRecord(path: string, record: SyncedProjectRecord): Promise<void>;
19
+ export declare function listSyncedRecords(scopeRoot: string, options?: {
20
+ onInvalid?: (path: string, error: unknown) => void;
21
+ }): Promise<SyncedProjectRecord[]>;
22
+ //# sourceMappingURL=record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/sync/record.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAiB,MAAM,gCAAgC,CAAC;AAE9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,CAAC,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,QAAQ,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,aAAa,CAAC;IAC7B,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAMD,eAAO,MAAM,yBAAyB,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAoCjE,CAAC;AAEL,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,IAAI,GACR,mBAAmB,CAWrB;AA8BD,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAuBrC;AAED,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAIf;AAED,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IACP,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C,GACL,OAAO,CAAC,mBAAmB,EAAE,CAAC,CA4BhC"}
@@ -0,0 +1,133 @@
1
+ import { mkdir, readFile, readdir, writeFile } from 'node:fs/promises';
2
+ import { basename, dirname, extname, join } from 'node:path';
3
+ import { SYNCED_REMOTE, syncedRefName } from '../../shared/project-scope.js';
4
+ import { CliError } from '../../../errors/cli-error.js';
5
+ import { z } from 'zod';
6
+ const schemaVersion = z.custom((value) => value === 1, {
7
+ message: 'Unsupported schemaVersion; upgrade OAT before reading this record',
8
+ });
9
+ export const SyncedProjectRecordSchema = z
10
+ .object({
11
+ schemaVersion,
12
+ slug: z.string().min(1),
13
+ scope: z.literal('synced'),
14
+ ref: z.string().min(1),
15
+ remote: z.literal(SYNCED_REMOTE),
16
+ status: z.enum(['active', 'complete']),
17
+ createdAt: z.string().datetime(),
18
+ completedAt: z.string().datetime().nullable(),
19
+ archiveSnapshot: z.string().min(1).optional(),
20
+ archiveSourceRefSha: z
21
+ .string()
22
+ .regex(/^[0-9a-f]{40}$/)
23
+ .optional(),
24
+ })
25
+ .strict()
26
+ .superRefine((record, context) => {
27
+ let expectedRef;
28
+ try {
29
+ expectedRef = syncedRefName(record.slug);
30
+ }
31
+ catch {
32
+ context.addIssue({
33
+ code: z.ZodIssueCode.custom,
34
+ path: ['slug'],
35
+ message: 'Record slug is not a valid synced project slug',
36
+ });
37
+ return;
38
+ }
39
+ if (record.ref !== expectedRef) {
40
+ context.addIssue({
41
+ code: z.ZodIssueCode.custom,
42
+ path: ['ref'],
43
+ message: `Record ref must match slug (${expectedRef})`,
44
+ });
45
+ }
46
+ });
47
+ export function buildSyncedRecord(slug, now) {
48
+ return SyncedProjectRecordSchema.parse({
49
+ schemaVersion: 1,
50
+ slug,
51
+ scope: 'synced',
52
+ ref: syncedRefName(slug),
53
+ remote: SYNCED_REMOTE,
54
+ status: 'active',
55
+ createdAt: now.toISOString(),
56
+ completedAt: null,
57
+ });
58
+ }
59
+ function recordSlugFromPath(path) {
60
+ return basename(path, extname(path));
61
+ }
62
+ function recordRecovery() {
63
+ return `Restore this exact record from a trusted Git revision before retrying. Do not delete or quarantine it to trigger pull adoption: regeneration creates an active record and can discard lifecycle fields such as status, completedAt, and archiveSnapshot. If no trusted Git copy exists, repair those fields losslessly before continuing.`;
64
+ }
65
+ function parseRecord(path, value) {
66
+ const result = SyncedProjectRecordSchema.safeParse(value);
67
+ if (!result.success) {
68
+ throw new CliError(`Invalid synced project record ${path}: ${result.error.issues
69
+ .map((issue) => issue.message)
70
+ .join('; ')} ${recordRecovery()}`, 1);
71
+ }
72
+ const filenameSlug = recordSlugFromPath(path);
73
+ if (result.data.slug !== filenameSlug) {
74
+ throw new CliError(`Synced project record filename slug "${filenameSlug}" does not match record slug "${result.data.slug}". ${recordRecovery()}`, 1);
75
+ }
76
+ return result.data;
77
+ }
78
+ export async function readSyncedRecord(path) {
79
+ let content;
80
+ try {
81
+ content = await readFile(path, 'utf8');
82
+ }
83
+ catch (error) {
84
+ if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {
85
+ return null;
86
+ }
87
+ throw error;
88
+ }
89
+ try {
90
+ return parseRecord(path, JSON.parse(content));
91
+ }
92
+ catch (error) {
93
+ if (error instanceof CliError) {
94
+ throw error;
95
+ }
96
+ const message = error instanceof Error ? error.message : String(error);
97
+ throw new CliError(`Invalid JSON in synced project record ${path}: ${message} ${recordRecovery()}`, 1);
98
+ }
99
+ }
100
+ export async function writeSyncedRecord(path, record) {
101
+ const validated = parseRecord(path, record);
102
+ await mkdir(dirname(path), { recursive: true });
103
+ await writeFile(path, `${JSON.stringify(validated, null, 2)}\n`, 'utf8');
104
+ }
105
+ export async function listSyncedRecords(scopeRoot, options = {}) {
106
+ let entries;
107
+ try {
108
+ entries = await readdir(scopeRoot, { withFileTypes: true });
109
+ }
110
+ catch (error) {
111
+ if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {
112
+ return [];
113
+ }
114
+ throw error;
115
+ }
116
+ const records = await Promise.all(entries
117
+ .filter((entry) => entry.isFile() && entry.name.endsWith('.json'))
118
+ .map(async (entry) => {
119
+ const path = join(scopeRoot, entry.name);
120
+ try {
121
+ return await readSyncedRecord(path);
122
+ }
123
+ catch (error) {
124
+ if (!options.onInvalid)
125
+ throw error;
126
+ options.onInvalid(path, error);
127
+ return null;
128
+ }
129
+ }));
130
+ return records
131
+ .filter((record) => record !== null)
132
+ .sort((left, right) => left.slug.localeCompare(right.slug));
133
+ }
@@ -0,0 +1,120 @@
1
+ import { ensureScopedRootGitignore } from '../../init/gitignore.js';
2
+ import { readOatLocalConfig, writeOatLocalConfig } from '../../../config/oat-config.js';
3
+ import { copyDirectory } from '../../../fs/io.js';
4
+ import type { GitRunner } from './git.js';
5
+ export interface SyncTarget {
6
+ repoRoot: string;
7
+ sharedRoot: string;
8
+ syncedRoot: string;
9
+ slug: string;
10
+ projectPath: string;
11
+ ref: string;
12
+ remote: string;
13
+ }
14
+ export interface SyncTargetIdentityOptions {
15
+ pathExists?: (path: string) => Promise<boolean>;
16
+ realpath?: (path: string) => Promise<string>;
17
+ exitCode?: 1 | 2;
18
+ }
19
+ export interface AllowlistedPathspecOptions {
20
+ summaryExportPath?: string | null;
21
+ projectRoots: Pick<SyncTarget, 'sharedRoot' | 'syncedRoot'>;
22
+ recapExportRoot?: string | null;
23
+ }
24
+ export type PushResult = {
25
+ status: 'pushed' | 'up-to-date' | 'rejected' | 'conflict';
26
+ sha: string;
27
+ conflicts?: string[];
28
+ remoteBeforePushSha?: string | null;
29
+ };
30
+ export type PullResult = {
31
+ status: 'created' | 'updated' | 'up-to-date' | 'conflict' | 'dirty';
32
+ sha: string;
33
+ conflicts?: string[];
34
+ adopted?: boolean;
35
+ adoptionRecordOwnership?: 'created' | 'existing';
36
+ pendingRecordPaths?: string[];
37
+ };
38
+ export type AdoptionRecordState = 'create' | 'pending' | 'durable';
39
+ export interface PullChildResult {
40
+ slug: string;
41
+ status: PullResult['status'] | 'missing' | 'error';
42
+ sha?: string;
43
+ conflicts?: string[];
44
+ adopted?: boolean;
45
+ pendingRecordPaths?: string[];
46
+ message?: string;
47
+ exitCode?: 1 | 2;
48
+ }
49
+ export type CheckoutPreflight = {
50
+ status: 'clean' | 'dirty' | 'unpushed' | 'absent';
51
+ sha?: string;
52
+ };
53
+ export type RemoveResult = {
54
+ status: 'removed' | 'absent' | 'dirty' | 'unpushed';
55
+ };
56
+ export type PruneResult = {
57
+ status: 'pruned';
58
+ lifecycleCommit: string | null;
59
+ };
60
+ export type MigrateResult = {
61
+ status: 'migrated';
62
+ lifecycleCommit: string | null;
63
+ sha: string;
64
+ };
65
+ export declare function classifyRemoteRefLookup(result: {
66
+ code: number;
67
+ stdout: string;
68
+ stderr: string;
69
+ }, remote: string, ref: string): 'present' | 'absent';
70
+ export interface MigrateSharedToSyncedOptions {
71
+ sourcePath: string;
72
+ commit: boolean;
73
+ now?: Date;
74
+ copyDirectory?: typeof copyDirectory;
75
+ ensureScopedRootGitignore?: typeof ensureScopedRootGitignore;
76
+ readOatLocalConfig?: typeof readOatLocalConfig;
77
+ writeOatLocalConfig?: typeof writeOatLocalConfig;
78
+ afterBranchCommit?: () => Promise<void>;
79
+ }
80
+ export declare function classifyAdoptionRecord(target: SyncTarget, git: GitRunner): Promise<AdoptionRecordState>;
81
+ export declare function assertConfinedMigrationSource(target: SyncTarget, sourcePath: string): Promise<void>;
82
+ export declare function buildSyncTarget(repoRoot: string, projectsRoot: string, slug: string): SyncTarget;
83
+ export declare function assertCanonicalSyncTargetIdentity(target: SyncTarget, options?: SyncTargetIdentityOptions): Promise<boolean>;
84
+ export declare function createSyncedProject(target: SyncTarget, git: GitRunner): Promise<void>;
85
+ export declare function pendingRebaseConflicts(target: SyncTarget, git: GitRunner): Promise<string[] | null>;
86
+ export declare function pushSynced(target: SyncTarget, git: GitRunner, options: {
87
+ message?: string;
88
+ }): Promise<PushResult>;
89
+ export declare function pullSynced(target: SyncTarget, git: GitRunner, options?: {
90
+ adopt?: boolean;
91
+ adoptionRecord?: AdoptionRecordState;
92
+ now?: Date;
93
+ }): Promise<PullResult>;
94
+ export declare function pullChildren(parentTarget: SyncTarget, git: GitRunner): Promise<PullChildResult[]>;
95
+ export declare function continueSynced(target: SyncTarget, git: GitRunner, options?: {
96
+ adopt?: boolean;
97
+ adoptionRecord?: AdoptionRecordState;
98
+ now?: Date;
99
+ }): Promise<PullResult>;
100
+ export declare function abortSynced(target: SyncTarget, git: GitRunner): Promise<void>;
101
+ export declare function commitRecordChange(repoRoot: string, pathspecs: string[], message: string, git: GitRunner, options: AllowlistedPathspecOptions): Promise<{
102
+ sha: string;
103
+ } | null>;
104
+ export declare function preflightSyncedCheckout(target: SyncTarget, git: GitRunner): Promise<CheckoutPreflight>;
105
+ export declare function removeSyncedCheckout(target: SyncTarget, git: GitRunner, options?: {
106
+ force?: boolean;
107
+ }): Promise<RemoveResult>;
108
+ export declare function pruneSynced(target: SyncTarget, git: GitRunner, options: {
109
+ force: boolean;
110
+ commit: boolean;
111
+ }): Promise<PruneResult>;
112
+ export declare function migrateSharedToSynced(target: SyncTarget, git: GitRunner, options: MigrateSharedToSyncedOptions): Promise<MigrateResult>;
113
+ /**
114
+ * Compensate only a synced checkout/ref created by the current invocation.
115
+ * Callers must establish that ownership before invoking this helper.
116
+ */
117
+ export declare function rollbackCreatedSyncedProject(target: SyncTarget, git: GitRunner): Promise<void>;
118
+ export declare function assertNestedWorktree(target: SyncTarget, git: GitRunner): Promise<void>;
119
+ export declare function assertAllowlistedPathspecs(repoRoot: string, pathspecs: string[], options: AllowlistedPathspecOptions): void;
120
+ //# sourceMappingURL=ref-sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ref-sync.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/sync/ref-sync.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAUrE,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAGvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,CAA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