@coderook/cli 0.46.11 → 0.47.0
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/.claude-plugin/plugin.json +1 -1
- package/dist/cbx/src/core/cbx.js +32 -2
- package/dist/cbx/src/core/download.js +80 -3
- package/dist/cbx/src/core/tracks.js +4 -0
- package/dist/cbx/src/core/upload.js +2 -0
- package/dist/cbx/src/core/worktree.js +8 -1
- package/dist/cbx/src/shared/safe_path.js +11 -0
- package/dist/cli/src/api.js +1 -0
- package/dist/cli/src/bin.js +2 -0
- package/dist/cli/src/build_command.js +2 -2
- package/dist/cli/src/cli.js +47 -13
- package/dist/cli/src/config.js +20 -3
- package/dist/cli/src/mods_command.js +2 -0
- package/dist/cli/src/portable_python.js +2 -1
- package/dist/cli/src/project_commands.js +42 -0
- package/dist/cli/src/registry.js +1 -1
- package/dist/cli/src/service_commands.js +4 -3
- package/dist/cli/src/terminal_guard.js +37 -0
- package/dist/cli/src/verify_command.js +14 -0
- package/dist/cli/src/workspace_machine.js +11 -1
- package/dist/cli.bundle.cjs +28322 -0
- package/package.json +1 -1
|
@@ -31,6 +31,7 @@ const node_fs_1 = require("node:fs");
|
|
|
31
31
|
const promises_1 = require("node:fs/promises");
|
|
32
32
|
const node_path_1 = __importDefault(require("node:path"));
|
|
33
33
|
const download_js_1 = require("../../cbx/src/core/download.js");
|
|
34
|
+
const safe_path_js_1 = require("../../cbx/src/shared/safe_path.js");
|
|
34
35
|
const worktree_js_1 = require("../../cbx/src/core/worktree.js");
|
|
35
36
|
const api_js_1 = require("./api.js");
|
|
36
37
|
const config_js_1 = require("./config.js");
|
|
@@ -165,7 +166,16 @@ async function checkout(found, draft, workspaceId, into) {
|
|
|
165
166
|
const page = await (0, api_js_1.callApi)(`${draft}/diff?offset=${offset}`);
|
|
166
167
|
revision = page.revision;
|
|
167
168
|
for (const change of page.changes) {
|
|
168
|
-
|
|
169
|
+
/*
|
|
170
|
+
The same rules as every other writer: a draft path the folder must
|
|
171
|
+
not hold (`..`, git's own directory, a drive letter), or one reached
|
|
172
|
+
through a link, is refused, not written or removed. This was the one
|
|
173
|
+
writer that took the service's paths on trust (audit, 16 November 2026).
|
|
174
|
+
*/
|
|
175
|
+
const unsafe = (0, safe_path_js_1.whyUnsafe)(change.path) ?? (await (0, download_js_1.placementProblem)(folder, change.path));
|
|
176
|
+
if (unsafe)
|
|
177
|
+
throw new Error(`The draft holds ${JSON.stringify(change.path)}, which cannot be written here (${unsafe}); nothing past it was changed.`);
|
|
178
|
+
const target = (0, safe_path_js_1.inside)(folder, change.path);
|
|
169
179
|
if (change.removed || !change.after) {
|
|
170
180
|
await (0, promises_1.rm)(target, { force: true });
|
|
171
181
|
delete manifest[change.path];
|