@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.
- package/dist/cjs/cli.cjs +53 -35
- package/dist/cjs/commands/changed.cjs +133 -95
- package/dist/cjs/commands/docs.cjs +276 -203
- package/dist/cjs/commands/env-setup.cjs +45 -33
- package/dist/cjs/commands/onboard.cjs +668 -224
- package/dist/cjs/commands/run-all.cjs +54 -45
- package/dist/cjs/commands/run.cjs +80 -65
- package/dist/cjs/commands/script.cjs +263 -187
- package/dist/cjs/commands/skills.cjs +174 -118
- package/dist/cjs/commands/sync.cjs +193 -93
- package/dist/cjs/constants/ascii.cjs +14 -12
- package/dist/cjs/index.cjs +12 -10
- package/dist/cjs/types.cjs +7 -5
- package/dist/cjs/utils/env-categories.cjs +53 -48
- package/dist/cjs/utils/env-setup.cjs +214 -106
- package/dist/cjs/utils/env.cjs +65 -44
- package/dist/cjs/utils/files.cjs +186 -113
- package/dist/cjs/utils/parallel-runner.cjs +125 -75
- package/dist/cjs/utils/ports.cjs +21 -21
- package/dist/cjs/utils/prerequisites.cjs +42 -34
- package/dist/cjs/utils/prompts.cjs +66 -41
- package/dist/cjs/utils/script-listing.cjs +130 -60
- package/dist/cjs/utils/script-utils.cjs +29 -19
- package/dist/cjs/utils/sync.cjs +67 -45
- package/dist/esm/cli.mjs +40 -24
- package/dist/esm/cli.mjs.map +1 -1
- package/dist/esm/commands/changed.mjs +104 -68
- package/dist/esm/commands/changed.mjs.map +1 -1
- package/dist/esm/commands/docs.mjs +245 -174
- package/dist/esm/commands/docs.mjs.map +1 -1
- package/dist/esm/commands/env-setup.mjs +18 -8
- package/dist/esm/commands/env-setup.mjs.map +1 -1
- package/dist/esm/commands/onboard.mjs +631 -189
- package/dist/esm/commands/onboard.mjs.map +1 -1
- package/dist/esm/commands/run-all.mjs +26 -19
- package/dist/esm/commands/run-all.mjs.map +1 -1
- package/dist/esm/commands/run.mjs +52 -39
- package/dist/esm/commands/run.mjs.map +1 -1
- package/dist/esm/commands/script.mjs +230 -156
- package/dist/esm/commands/script.mjs.map +1 -1
- package/dist/esm/commands/skills.mjs +143 -89
- package/dist/esm/commands/skills.mjs.map +1 -1
- package/dist/esm/commands/sync.mjs +160 -62
- package/dist/esm/commands/sync.mjs.map +1 -1
- package/dist/esm/constants/ascii.mjs +2 -2
- package/dist/esm/constants/ascii.mjs.map +1 -1
- package/dist/esm/utils/env-categories.mjs +29 -26
- package/dist/esm/utils/env-categories.mjs.map +1 -1
- package/dist/esm/utils/env-setup.mjs +184 -78
- package/dist/esm/utils/env-setup.mjs.map +1 -1
- package/dist/esm/utils/env.mjs +50 -31
- package/dist/esm/utils/env.mjs.map +1 -1
- package/dist/esm/utils/files.mjs +171 -100
- package/dist/esm/utils/files.mjs.map +1 -1
- package/dist/esm/utils/parallel-runner.mjs +111 -63
- package/dist/esm/utils/parallel-runner.mjs.map +1 -1
- package/dist/esm/utils/ports.mjs +9 -11
- package/dist/esm/utils/ports.mjs.map +1 -1
- package/dist/esm/utils/prerequisites.mjs +30 -24
- package/dist/esm/utils/prerequisites.mjs.map +1 -1
- package/dist/esm/utils/prompts.mjs +40 -17
- package/dist/esm/utils/prompts.mjs.map +1 -1
- package/dist/esm/utils/script-listing.mjs +101 -33
- package/dist/esm/utils/script-listing.mjs.map +1 -1
- package/dist/esm/utils/script-utils.mjs +14 -6
- package/dist/esm/utils/script-utils.mjs.map +1 -1
- package/dist/esm/utils/sync.mjs +38 -18
- package/dist/esm/utils/sync.mjs.map +1 -1
- 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
|
-
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const import_meta = {}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
52
|
-
|
|
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))
|
|
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
|
-
|
|
70
|
+
const result = (0, import_node_child_process.spawnSync)(checkCmd, [command]);
|
|
71
|
+
return result.status === 0;
|
|
66
72
|
} catch {
|
|
67
|
-
return
|
|
73
|
+
return false;
|
|
68
74
|
}
|
|
69
75
|
}
|
|
70
76
|
function ensureUpstreamRemote() {
|
|
71
77
|
try {
|
|
72
|
-
|
|
78
|
+
const remotes = (0, import_node_child_process.execSync)("git remote", {
|
|
73
79
|
encoding: "utf-8"
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
})
|
|
88
|
+
});
|
|
89
|
+
return true;
|
|
79
90
|
} catch {
|
|
80
|
-
return
|
|
91
|
+
return false;
|
|
81
92
|
}
|
|
82
93
|
}
|
|
83
94
|
function getUpstreamHeadSha() {
|
|
84
95
|
try {
|
|
85
|
-
|
|
96
|
+
const sha = (0, import_node_child_process.execSync)(`git rev-parse ${UPSTREAM_REMOTE}/main`, {
|
|
86
97
|
encoding: "utf-8"
|
|
87
|
-
})
|
|
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
|
-
|
|
95
|
-
|
|
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:
|
|
123
|
+
default: false
|
|
112
124
|
},
|
|
113
125
|
print: {
|
|
114
126
|
type: "boolean",
|
|
115
127
|
description: "Print the sync prompt and exit",
|
|
116
|
-
default:
|
|
128
|
+
default: false
|
|
117
129
|
}
|
|
118
130
|
},
|
|
119
131
|
async run({
|
|
120
132
|
args
|
|
121
133
|
}) {
|
|
122
|
-
const isAuto = args.auto
|
|
123
|
-
|
|
124
|
-
(0, import_prompts.showStep)("Takeout Repository Sync")
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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)
|
|
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
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
})
|
|
148
|
-
|
|
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
|
-
|
|
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)}`))
|
|
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")
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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
|
-
|
|
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)
|
|
177
|
-
|
|
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
|
-
|
|
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)
|
|
188
|
-
|
|
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
|
-
|
|
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
|
-
|
|
197
|
-
(0, import_node_fs.writeFileSync)(promptFile, prompt)
|
|
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
|
-
})
|
|
200
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
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
|
-
|
|
37
|
+
`.trim();
|
|
38
|
+
const WELCOME_BANNER = TAKEOUT_ASCII;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var index_exports = {};
|
|
22
24
|
__export(index_exports, {
|
package/dist/cjs/types.cjs
CHANGED
|
@@ -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
|
|
7
|
-
|
|
8
|
-
|
|
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:
|
|
15
|
+
value: true
|
|
14
16
|
}), mod);
|
|
15
17
|
var types_exports = {};
|
|
16
18
|
module.exports = __toCommonJS(types_exports);
|