@take-out/cli 0.4.3 → 0.4.5

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 (69) hide show
  1. package/dist/cjs/cli.cjs +53 -35
  2. package/dist/cjs/commands/changed.cjs +133 -95
  3. package/dist/cjs/commands/docs.cjs +276 -203
  4. package/dist/cjs/commands/env-setup.cjs +45 -33
  5. package/dist/cjs/commands/onboard.cjs +668 -224
  6. package/dist/cjs/commands/run-all.cjs +54 -45
  7. package/dist/cjs/commands/run.cjs +80 -65
  8. package/dist/cjs/commands/script.cjs +263 -187
  9. package/dist/cjs/commands/skills.cjs +174 -118
  10. package/dist/cjs/commands/sync.cjs +193 -93
  11. package/dist/cjs/constants/ascii.cjs +14 -12
  12. package/dist/cjs/index.cjs +12 -10
  13. package/dist/cjs/types.cjs +7 -5
  14. package/dist/cjs/utils/env-categories.cjs +53 -48
  15. package/dist/cjs/utils/env-setup.cjs +214 -106
  16. package/dist/cjs/utils/env.cjs +65 -44
  17. package/dist/cjs/utils/files.cjs +186 -113
  18. package/dist/cjs/utils/parallel-runner.cjs +125 -75
  19. package/dist/cjs/utils/ports.cjs +21 -21
  20. package/dist/cjs/utils/prerequisites.cjs +42 -34
  21. package/dist/cjs/utils/prompts.cjs +66 -41
  22. package/dist/cjs/utils/script-listing.cjs +130 -60
  23. package/dist/cjs/utils/script-utils.cjs +29 -19
  24. package/dist/cjs/utils/sync.cjs +67 -45
  25. package/dist/esm/cli.mjs +40 -24
  26. package/dist/esm/cli.mjs.map +1 -1
  27. package/dist/esm/commands/changed.mjs +104 -68
  28. package/dist/esm/commands/changed.mjs.map +1 -1
  29. package/dist/esm/commands/docs.mjs +245 -174
  30. package/dist/esm/commands/docs.mjs.map +1 -1
  31. package/dist/esm/commands/env-setup.mjs +18 -8
  32. package/dist/esm/commands/env-setup.mjs.map +1 -1
  33. package/dist/esm/commands/onboard.mjs +631 -189
  34. package/dist/esm/commands/onboard.mjs.map +1 -1
  35. package/dist/esm/commands/run-all.mjs +26 -19
  36. package/dist/esm/commands/run-all.mjs.map +1 -1
  37. package/dist/esm/commands/run.mjs +52 -39
  38. package/dist/esm/commands/run.mjs.map +1 -1
  39. package/dist/esm/commands/script.mjs +230 -156
  40. package/dist/esm/commands/script.mjs.map +1 -1
  41. package/dist/esm/commands/skills.mjs +143 -89
  42. package/dist/esm/commands/skills.mjs.map +1 -1
  43. package/dist/esm/commands/sync.mjs +160 -62
  44. package/dist/esm/commands/sync.mjs.map +1 -1
  45. package/dist/esm/constants/ascii.mjs +2 -2
  46. package/dist/esm/constants/ascii.mjs.map +1 -1
  47. package/dist/esm/utils/env-categories.mjs +29 -26
  48. package/dist/esm/utils/env-categories.mjs.map +1 -1
  49. package/dist/esm/utils/env-setup.mjs +184 -78
  50. package/dist/esm/utils/env-setup.mjs.map +1 -1
  51. package/dist/esm/utils/env.mjs +50 -31
  52. package/dist/esm/utils/env.mjs.map +1 -1
  53. package/dist/esm/utils/files.mjs +171 -100
  54. package/dist/esm/utils/files.mjs.map +1 -1
  55. package/dist/esm/utils/parallel-runner.mjs +111 -63
  56. package/dist/esm/utils/parallel-runner.mjs.map +1 -1
  57. package/dist/esm/utils/ports.mjs +9 -11
  58. package/dist/esm/utils/ports.mjs.map +1 -1
  59. package/dist/esm/utils/prerequisites.mjs +30 -24
  60. package/dist/esm/utils/prerequisites.mjs.map +1 -1
  61. package/dist/esm/utils/prompts.mjs +40 -17
  62. package/dist/esm/utils/prompts.mjs.map +1 -1
  63. package/dist/esm/utils/script-listing.mjs +101 -33
  64. package/dist/esm/utils/script-listing.mjs.map +1 -1
  65. package/dist/esm/utils/script-utils.mjs +14 -6
  66. package/dist/esm/utils/script-utils.mjs.map +1 -1
  67. package/dist/esm/utils/sync.mjs +38 -18
  68. package/dist/esm/utils/sync.mjs.map +1 -1
  69. package/package.json +5 -5
@@ -2,56 +2,61 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: true
30
+ }) : target, mod));
31
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: true
33
+ }), mod);
32
34
  var sync_exports = {};
33
35
  __export(sync_exports, {
34
36
  syncCommand: () => syncCommand
35
37
  });
36
38
  module.exports = __toCommonJS(sync_exports);
37
- var import_node_child_process = require("node:child_process"),
38
- import_node_fs = require("node:fs"),
39
- import_node_os = require("node:os"),
40
- import_node_path = require("node:path"),
41
- import_node_url = require("node:url"),
42
- import_citty = require("citty"),
43
- import_picocolors = __toESM(require("picocolors"), 1),
44
- import_prompts = require("../utils/prompts.cjs");
45
- const import_meta = {},
46
- UPSTREAM_REPO = "tamagui/takeout2",
47
- UPSTREAM_REMOTE = "takeout-upstream",
48
- TAKEOUT_FILE = ".takeout";
39
+ var import_node_child_process = require("node:child_process");
40
+ var import_node_fs = require("node:fs");
41
+ var import_node_os = require("node:os");
42
+ var import_node_path = require("node:path");
43
+ var import_node_url = require("node:url");
44
+ var import_citty = require("citty");
45
+ var import_picocolors = __toESM(require("picocolors"), 1);
46
+ var import_prompts = require("../utils/prompts.cjs");
47
+ const import_meta = {};
48
+ const UPSTREAM_REPO = "tamagui/takeout2";
49
+ const UPSTREAM_REMOTE = "takeout-upstream";
50
+ const TAKEOUT_FILE = ".takeout";
49
51
  function getSyncPrompt() {
50
52
  try {
51
- let monorepoRoot = (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url));
52
- for (; monorepoRoot !== (0, import_node_path.parse)(monorepoRoot).root;) {
53
+ const currentDir = (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url));
54
+ let monorepoRoot = currentDir;
55
+ while (monorepoRoot !== (0, import_node_path.parse)(monorepoRoot).root) {
53
56
  const promptPath = (0, import_node_path.join)(monorepoRoot, "packages", "docs", "sync-prompt.md");
54
- if ((0, import_node_fs.existsSync)(promptPath)) return (0, import_node_fs.readFileSync)(promptPath, "utf-8");
57
+ if ((0, import_node_fs.existsSync)(promptPath)) {
58
+ return (0, import_node_fs.readFileSync)(promptPath, "utf-8");
59
+ }
55
60
  monorepoRoot = (0, import_node_path.dirname)(monorepoRoot);
56
61
  }
57
62
  throw new Error("Could not find sync-prompt.md in packages/docs");
@@ -62,37 +67,44 @@ function getSyncPrompt() {
62
67
  function checkToolAvailable(command) {
63
68
  try {
64
69
  const checkCmd = process.platform === "win32" ? "where" : "which";
65
- return (0, import_node_child_process.spawnSync)(checkCmd, [command]).status === 0;
70
+ const result = (0, import_node_child_process.spawnSync)(checkCmd, [command]);
71
+ return result.status === 0;
66
72
  } catch {
67
- return !1;
73
+ return false;
68
74
  }
69
75
  }
70
76
  function ensureUpstreamRemote() {
71
77
  try {
72
- return (0, import_node_child_process.execSync)("git remote", {
78
+ const remotes = (0, import_node_child_process.execSync)("git remote", {
73
79
  encoding: "utf-8"
74
- }).includes(UPSTREAM_REMOTE) || (0, import_node_child_process.execSync)(`git remote add ${UPSTREAM_REMOTE} git@github.com:${UPSTREAM_REPO}.git`, {
75
- stdio: "pipe"
76
- }), (0, import_node_child_process.execSync)(`git fetch ${UPSTREAM_REMOTE} --quiet`, {
80
+ });
81
+ if (!remotes.includes(UPSTREAM_REMOTE)) {
82
+ (0, import_node_child_process.execSync)(`git remote add ${UPSTREAM_REMOTE} git@github.com:${UPSTREAM_REPO}.git`, {
83
+ stdio: "pipe"
84
+ });
85
+ }
86
+ (0, import_node_child_process.execSync)(`git fetch ${UPSTREAM_REMOTE} --quiet`, {
77
87
  stdio: "pipe"
78
- }), !0;
88
+ });
89
+ return true;
79
90
  } catch {
80
- return !1;
91
+ return false;
81
92
  }
82
93
  }
83
94
  function getUpstreamHeadSha() {
84
95
  try {
85
- return (0, import_node_child_process.execSync)(`git rev-parse ${UPSTREAM_REMOTE}/main`, {
96
+ const sha = (0, import_node_child_process.execSync)(`git rev-parse ${UPSTREAM_REMOTE}/main`, {
86
97
  encoding: "utf-8"
87
- }).trim();
98
+ });
99
+ return sha.trim();
88
100
  } catch {
89
101
  return null;
90
102
  }
91
103
  }
92
104
  function writeTakeoutConfig(sha) {
93
- const configPath = (0, import_node_path.join)(process.cwd(), TAKEOUT_FILE),
94
- date = (/* @__PURE__ */new Date()).toISOString().split("T")[0],
95
- content = `# takeout sync tracking file
105
+ const configPath = (0, import_node_path.join)(process.cwd(), TAKEOUT_FILE);
106
+ const date = (/* @__PURE__ */new Date()).toISOString().split("T")[0];
107
+ const content = `# takeout sync tracking file
96
108
  # this file tracks the last synced commit from upstream takeout
97
109
  sha=${sha}
98
110
  date=${date}
@@ -108,49 +120,82 @@ const syncCommand = (0, import_citty.defineCommand)({
108
120
  auto: {
109
121
  type: "boolean",
110
122
  description: "Auto-run with claude-code without prompts (for non-TTY environments)",
111
- default: !1
123
+ default: false
112
124
  },
113
125
  print: {
114
126
  type: "boolean",
115
127
  description: "Print the sync prompt and exit",
116
- default: !1
128
+ default: false
117
129
  }
118
130
  },
119
131
  async run({
120
132
  args
121
133
  }) {
122
- const isAuto = args.auto,
123
- isPrint = args.print;
124
- (0, import_prompts.showStep)("Takeout Repository Sync"), console.info(), !isAuto && !isPrint && ((0, import_prompts.showInfo)("Takeout sync uses AI to intelligently merge upstream changes"), console.info(), console.info(import_picocolors.default.gray("How it works:")), console.info(import_picocolors.default.gray(" \u2022 Analyzes commits from upstream Takeout repository")), console.info(import_picocolors.default.gray(" \u2022 Determines which changes are relevant to your fork")), console.info(import_picocolors.default.gray(" \u2022 Applies changes while preserving your customizations")), console.info(import_picocolors.default.gray(" \u2022 Handles package ejection automatically")), console.info(import_picocolors.default.gray(" \u2022 Asks for your input when decisions are needed")), console.info());
125
- const hasClaudeCode = checkToolAvailable("claude"),
126
- hasCursor = checkToolAvailable("cursor-agent"),
127
- hasAider = checkToolAvailable("aider");
134
+ const isAuto = args.auto;
135
+ const isPrint = args.print;
136
+ (0, import_prompts.showStep)("Takeout Repository Sync");
137
+ console.info();
138
+ if (!isAuto && !isPrint) {
139
+ (0, import_prompts.showInfo)("Takeout sync uses AI to intelligently merge upstream changes");
140
+ console.info();
141
+ console.info(import_picocolors.default.gray("How it works:"));
142
+ console.info(import_picocolors.default.gray(" \u2022 Analyzes commits from upstream Takeout repository"));
143
+ console.info(import_picocolors.default.gray(" \u2022 Determines which changes are relevant to your fork"));
144
+ console.info(import_picocolors.default.gray(" \u2022 Applies changes while preserving your customizations"));
145
+ console.info(import_picocolors.default.gray(" \u2022 Handles package ejection automatically"));
146
+ console.info(import_picocolors.default.gray(" \u2022 Asks for your input when decisions are needed"));
147
+ console.info();
148
+ }
149
+ const hasClaudeCode = checkToolAvailable("claude");
150
+ const hasCursor = checkToolAvailable("cursor-agent");
151
+ const hasAider = checkToolAvailable("aider");
128
152
  let choice;
129
- if (isAuto) hasClaudeCode || ((0, import_prompts.showError)("--auto requires claude CLI to be installed"), process.exit(1)), choice = "claude-code";else if (isPrint) choice = "show-prompt";else {
153
+ if (isAuto) {
154
+ if (!hasClaudeCode) {
155
+ (0, import_prompts.showError)("--auto requires claude CLI to be installed");
156
+ process.exit(1);
157
+ }
158
+ choice = "claude-code";
159
+ } else if (isPrint) {
160
+ choice = "show-prompt";
161
+ } else {
130
162
  const options = [];
131
- if (hasClaudeCode && options.push({
132
- value: "claude-code",
133
- label: "Claude Code (recommended)",
134
- hint: "Run sync automatically with Claude Code CLI"
135
- }), hasCursor && options.push({
136
- value: "cursor",
137
- label: "Cursor Agent",
138
- hint: "Run sync automatically with Cursor CLI"
139
- }), hasAider && options.push({
140
- value: "aider",
141
- label: "Aider",
142
- hint: "Run sync automatically with Aider CLI"
143
- }), options.push({
163
+ if (hasClaudeCode) {
164
+ options.push({
165
+ value: "claude-code",
166
+ label: "Claude Code (recommended)",
167
+ hint: "Run sync automatically with Claude Code CLI"
168
+ });
169
+ }
170
+ if (hasCursor) {
171
+ options.push({
172
+ value: "cursor",
173
+ label: "Cursor Agent",
174
+ hint: "Run sync automatically with Cursor CLI"
175
+ });
176
+ }
177
+ if (hasAider) {
178
+ options.push({
179
+ value: "aider",
180
+ label: "Aider",
181
+ hint: "Run sync automatically with Aider CLI"
182
+ });
183
+ }
184
+ options.push({
144
185
  value: "show-prompt",
145
186
  label: "Show prompt (copy & paste manually)",
146
187
  hint: "Display the full prompt to use with any LLM"
147
- }), choice = await (0, import_prompts.promptSelect)("How would you like to sync?", options), choice === "cancel") {
148
- console.info(), (0, import_prompts.showInfo)("Sync cancelled");
188
+ });
189
+ choice = await (0, import_prompts.promptSelect)("How would you like to sync?", options);
190
+ if (choice === "cancel") {
191
+ console.info();
192
+ (0, import_prompts.showInfo)("Sync cancelled");
149
193
  return;
150
194
  }
151
195
  console.info();
152
196
  }
153
- if (console.info(import_picocolors.default.dim("Fetching upstream repository...")), !ensureUpstreamRemote()) {
197
+ console.info(import_picocolors.default.dim("Fetching upstream repository..."));
198
+ if (!ensureUpstreamRemote()) {
154
199
  (0, import_prompts.showError)("Failed to fetch upstream repository");
155
200
  return;
156
201
  }
@@ -159,45 +204,100 @@ const syncCommand = (0, import_citty.defineCommand)({
159
204
  (0, import_prompts.showError)("Failed to get upstream HEAD SHA");
160
205
  return;
161
206
  }
162
- console.info(import_picocolors.default.dim(`Target SHA: ${upstreamSha.slice(0, 7)}`)), console.info();
207
+ console.info(import_picocolors.default.dim(`Target SHA: ${upstreamSha.slice(0, 7)}`));
208
+ console.info();
163
209
  try {
164
210
  const prompt = getSyncPrompt();
165
- if (choice === "show-prompt") console.info(import_picocolors.default.dim("=".repeat(80))), console.info(prompt), console.info(import_picocolors.default.dim("=".repeat(80))), console.info(), (0, import_prompts.showInfo)("Copy the prompt above and paste it into your preferred LLM"), console.info(), console.info(import_picocolors.default.gray("Recommended LLMs:")), console.info(import_picocolors.default.gray(" \u2022 Claude Code (best for complex instructions)")), console.info(import_picocolors.default.gray(" \u2022 ChatGPT")), console.info(import_picocolors.default.gray(" \u2022 Cursor")), console.info(import_picocolors.default.gray(" \u2022 Aider")), console.info();else if (choice === "claude-code") {
166
- if ((0, import_prompts.showInfo)("Starting Claude Code with sync prompt..."), console.info(), !isAuto && (console.info(import_picocolors.default.dim("Note: Claude Code will run in headless mode and make changes automatically.")), console.info(import_picocolors.default.dim("You will be asked to confirm important decisions.")), console.info(), !(await (0, import_prompts.confirmContinue)("Continue with Claude Code?", !0)))) {
167
- (0, import_prompts.showInfo)("Sync cancelled");
168
- return;
211
+ if (choice === "show-prompt") {
212
+ console.info(import_picocolors.default.dim("=".repeat(80)));
213
+ console.info(prompt);
214
+ console.info(import_picocolors.default.dim("=".repeat(80)));
215
+ console.info();
216
+ (0, import_prompts.showInfo)("Copy the prompt above and paste it into your preferred LLM");
217
+ console.info();
218
+ console.info(import_picocolors.default.gray("Recommended LLMs:"));
219
+ console.info(import_picocolors.default.gray(" \u2022 Claude Code (best for complex instructions)"));
220
+ console.info(import_picocolors.default.gray(" \u2022 ChatGPT"));
221
+ console.info(import_picocolors.default.gray(" \u2022 Cursor"));
222
+ console.info(import_picocolors.default.gray(" \u2022 Aider"));
223
+ console.info();
224
+ } else if (choice === "claude-code") {
225
+ (0, import_prompts.showInfo)("Starting Claude Code with sync prompt...");
226
+ console.info();
227
+ if (!isAuto) {
228
+ console.info(import_picocolors.default.dim("Note: Claude Code will run in headless mode and make changes automatically."));
229
+ console.info(import_picocolors.default.dim("You will be asked to confirm important decisions."));
230
+ console.info();
231
+ const shouldContinue = await (0, import_prompts.confirmContinue)("Continue with Claude Code?", true);
232
+ if (!shouldContinue) {
233
+ (0, import_prompts.showInfo)("Sync cancelled");
234
+ return;
235
+ }
169
236
  }
170
- const tempDir = (0, import_node_fs.mkdtempSync)((0, import_node_path.join)((0, import_node_os.tmpdir)(), "takeout-sync-")),
171
- promptFile = (0, import_node_path.join)(tempDir, "prompt.md");
237
+ const tempDir = (0, import_node_fs.mkdtempSync)((0, import_node_path.join)((0, import_node_os.tmpdir)(), "takeout-sync-"));
238
+ const promptFile = (0, import_node_path.join)(tempDir, "prompt.md");
172
239
  (0, import_node_fs.writeFileSync)(promptFile, prompt);
173
240
  const claude = (0, import_node_child_process.spawn)("claude", ["-p", "-"], {
174
241
  stdio: ["pipe", "inherit", "inherit"]
175
242
  });
176
- claude.stdin?.write(prompt), claude.stdin?.end(), claude.on("close", code => {
177
- console.info(), code === 0 ? (writeTakeoutConfig(upstreamSha), (0, import_prompts.showSuccess)("Sync completed successfully!"), console.info(import_picocolors.default.dim(`Updated .takeout to ${upstreamSha.slice(0, 7)}`))) : (0, import_prompts.showError)(`Claude Code exited with code ${code}`);
243
+ claude.stdin?.write(prompt);
244
+ claude.stdin?.end();
245
+ claude.on("close", code => {
246
+ console.info();
247
+ if (code === 0) {
248
+ writeTakeoutConfig(upstreamSha);
249
+ (0, import_prompts.showSuccess)("Sync completed successfully!");
250
+ console.info(import_picocolors.default.dim(`Updated .takeout to ${upstreamSha.slice(0, 7)}`));
251
+ } else {
252
+ (0, import_prompts.showError)(`Claude Code exited with code ${code}`);
253
+ }
178
254
  });
179
255
  } else if (choice === "cursor") {
180
- if ((0, import_prompts.showInfo)("Starting Cursor Agent with sync prompt..."), console.info(), !(await (0, import_prompts.confirmContinue)("Continue with Cursor?", !0))) {
256
+ (0, import_prompts.showInfo)("Starting Cursor Agent with sync prompt...");
257
+ console.info();
258
+ const shouldContinue = await (0, import_prompts.confirmContinue)("Continue with Cursor?", true);
259
+ if (!shouldContinue) {
181
260
  (0, import_prompts.showInfo)("Sync cancelled");
182
261
  return;
183
262
  }
184
263
  const cursor = (0, import_node_child_process.spawn)("cursor-agent", ["-p", "-"], {
185
264
  stdio: ["pipe", "inherit", "inherit"]
186
265
  });
187
- cursor.stdin?.write(prompt), cursor.stdin?.end(), cursor.on("close", code => {
188
- console.info(), code === 0 ? (writeTakeoutConfig(upstreamSha), (0, import_prompts.showSuccess)("Sync completed successfully!"), console.info(import_picocolors.default.dim(`Updated .takeout to ${upstreamSha.slice(0, 7)}`))) : (0, import_prompts.showError)(`Cursor Agent exited with code ${code}`);
266
+ cursor.stdin?.write(prompt);
267
+ cursor.stdin?.end();
268
+ cursor.on("close", code => {
269
+ console.info();
270
+ if (code === 0) {
271
+ writeTakeoutConfig(upstreamSha);
272
+ (0, import_prompts.showSuccess)("Sync completed successfully!");
273
+ console.info(import_picocolors.default.dim(`Updated .takeout to ${upstreamSha.slice(0, 7)}`));
274
+ } else {
275
+ (0, import_prompts.showError)(`Cursor Agent exited with code ${code}`);
276
+ }
189
277
  });
190
278
  } else if (choice === "aider") {
191
- if ((0, import_prompts.showInfo)("Starting Aider with sync prompt..."), console.info(), !(await (0, import_prompts.confirmContinue)("Continue with Aider?", !0))) {
279
+ (0, import_prompts.showInfo)("Starting Aider with sync prompt...");
280
+ console.info();
281
+ const shouldContinue = await (0, import_prompts.confirmContinue)("Continue with Aider?", true);
282
+ if (!shouldContinue) {
192
283
  (0, import_prompts.showInfo)("Sync cancelled");
193
284
  return;
194
285
  }
195
- const tempDir = (0, import_node_fs.mkdtempSync)((0, import_node_path.join)((0, import_node_os.tmpdir)(), "takeout-sync-")),
196
- promptFile = (0, import_node_path.join)(tempDir, "prompt.md");
197
- (0, import_node_fs.writeFileSync)(promptFile, prompt), (0, import_node_child_process.spawn)("aider", ["--message-file", promptFile, "--no-stream"], {
286
+ const tempDir = (0, import_node_fs.mkdtempSync)((0, import_node_path.join)((0, import_node_os.tmpdir)(), "takeout-sync-"));
287
+ const promptFile = (0, import_node_path.join)(tempDir, "prompt.md");
288
+ (0, import_node_fs.writeFileSync)(promptFile, prompt);
289
+ const aider = (0, import_node_child_process.spawn)("aider", ["--message-file", promptFile, "--no-stream"], {
198
290
  stdio: "inherit"
199
- }).on("close", code => {
200
- console.info(), code === 0 ? (writeTakeoutConfig(upstreamSha), (0, import_prompts.showSuccess)("Sync completed successfully!"), console.info(import_picocolors.default.dim(`Updated .takeout to ${upstreamSha.slice(0, 7)}`))) : (0, import_prompts.showError)(`Aider exited with code ${code}`);
291
+ });
292
+ aider.on("close", code => {
293
+ console.info();
294
+ if (code === 0) {
295
+ writeTakeoutConfig(upstreamSha);
296
+ (0, import_prompts.showSuccess)("Sync completed successfully!");
297
+ console.info(import_picocolors.default.dim(`Updated .takeout to ${upstreamSha.slice(0, 7)}`));
298
+ } else {
299
+ (0, import_prompts.showError)(`Aider exited with code ${code}`);
300
+ }
201
301
  });
202
302
  }
203
303
  } catch (error) {
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- };
17
+ }
18
+ return to;
19
+ };
18
20
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
21
+ value: true
20
22
  }), mod);
21
23
  var ascii_exports = {};
22
24
  __export(ascii_exports, {
@@ -32,5 +34,5 @@ const TAKEOUT_ASCII = `
32
34
  \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551
33
35
  \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D
34
36
  \u9EB5 \u78BC \u98EF
35
- `.trim(),
36
- WELCOME_BANNER = TAKEOUT_ASCII;
37
+ `.trim();
38
+ const WELCOME_BANNER = TAKEOUT_ASCII;
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- };
17
+ }
18
+ return to;
19
+ };
18
20
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
21
+ value: true
20
22
  }), mod);
21
23
  var index_exports = {};
22
24
  __export(index_exports, {
@@ -3,14 +3,16 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
7
- get: () => from[key],
8
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
9
- });
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
+ get: () => from[key],
9
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
+ });
11
+ }
10
12
  return to;
11
13
  };
12
14
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
13
- value: !0
15
+ value: true
14
16
  }), mod);
15
17
  var types_exports = {};
16
18
  module.exports = __toCommonJS(types_exports);