oh-my-customcode 1.1.99 → 1.1.100
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/cli/index.js +44 -13
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/templates/manifest.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -47,8 +47,9 @@ var __esm = (fn, res, err) => () => {
|
|
|
47
47
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
48
48
|
|
|
49
49
|
// src/utils/home.ts
|
|
50
|
+
import { realpathSync } from "node:fs";
|
|
50
51
|
import { homedir, userInfo } from "node:os";
|
|
51
|
-
import { parse, sep } from "node:path";
|
|
52
|
+
import { isAbsolute, parse, sep } from "node:path";
|
|
52
53
|
function readEnvHome() {
|
|
53
54
|
return process.env.HOME;
|
|
54
55
|
}
|
|
@@ -94,16 +95,28 @@ function isPathWithin(path, base) {
|
|
|
94
95
|
const prefix = strippedBase.endsWith(sep) || strippedBase.endsWith("/") ? strippedBase : strippedBase + sep;
|
|
95
96
|
return path.startsWith(prefix);
|
|
96
97
|
}
|
|
98
|
+
function realpathOrSelf(p) {
|
|
99
|
+
if (p === "" || !isAbsolute(p)) {
|
|
100
|
+
return p;
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
return realpathSync(p);
|
|
104
|
+
} catch {
|
|
105
|
+
return p;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
97
108
|
function isUnderHome(path, home) {
|
|
98
|
-
|
|
109
|
+
const base = home ?? resolveHomeDir();
|
|
110
|
+
const paths = [path, realpathOrSelf(path)];
|
|
111
|
+
const bases = [base, realpathOrSelf(base)];
|
|
112
|
+
return paths.some((p) => bases.some((b) => isPathWithin(p, b)));
|
|
99
113
|
}
|
|
100
|
-
function
|
|
101
|
-
const base = stripTrailingSeparators(
|
|
114
|
+
function tildeRelative(path, rawBase) {
|
|
115
|
+
const base = stripTrailingSeparators(rawBase);
|
|
102
116
|
if (!isPathWithin(path, base)) {
|
|
103
|
-
return
|
|
117
|
+
return;
|
|
104
118
|
}
|
|
105
|
-
|
|
106
|
-
if (strippedPath === base) {
|
|
119
|
+
if (stripTrailingSeparators(path) === base) {
|
|
107
120
|
return "~";
|
|
108
121
|
}
|
|
109
122
|
let rest = path.slice(base.length);
|
|
@@ -112,10 +125,28 @@ function shortenHome(path, home) {
|
|
|
112
125
|
}
|
|
113
126
|
return `~${sep}${rest}`;
|
|
114
127
|
}
|
|
128
|
+
function shortenHome(path, home) {
|
|
129
|
+
const base = home ?? resolveHomeDir();
|
|
130
|
+
const realPath = realpathOrSelf(path);
|
|
131
|
+
const realBase = realpathOrSelf(base);
|
|
132
|
+
const candidates = [
|
|
133
|
+
[path, base],
|
|
134
|
+
[path, realBase],
|
|
135
|
+
[realPath, base],
|
|
136
|
+
[realPath, realBase]
|
|
137
|
+
];
|
|
138
|
+
for (const [p, b] of candidates) {
|
|
139
|
+
const shortened = tildeRelative(p, b);
|
|
140
|
+
if (shortened !== undefined) {
|
|
141
|
+
return shortened;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return path;
|
|
145
|
+
}
|
|
115
146
|
var init_home = () => {};
|
|
116
147
|
|
|
117
148
|
// src/core/registry.ts
|
|
118
|
-
import { realpathSync } from "node:fs";
|
|
149
|
+
import { realpathSync as realpathSync2 } from "node:fs";
|
|
119
150
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
120
151
|
import { tmpdir } from "node:os";
|
|
121
152
|
import { basename, join, resolve, sep as sep2 } from "node:path";
|
|
@@ -133,7 +164,7 @@ function isTempPath(projectPath) {
|
|
|
133
164
|
candidates.add("/var/folders");
|
|
134
165
|
for (const candidate of [...candidates]) {
|
|
135
166
|
try {
|
|
136
|
-
candidates.add(
|
|
167
|
+
candidates.add(realpathSync2(candidate));
|
|
137
168
|
} catch {}
|
|
138
169
|
}
|
|
139
170
|
for (const candidate of candidates) {
|
|
@@ -297,7 +328,7 @@ var init_package = __esm(() => {
|
|
|
297
328
|
workspaces: [
|
|
298
329
|
"packages/*"
|
|
299
330
|
],
|
|
300
|
-
version: "1.1.
|
|
331
|
+
version: "1.1.100",
|
|
301
332
|
description: "Batteries-included agent harness for Claude Code",
|
|
302
333
|
type: "module",
|
|
303
334
|
bin: {
|
|
@@ -7293,7 +7324,7 @@ var require_public_api = __commonJS(function(exports) {
|
|
|
7293
7324
|
});
|
|
7294
7325
|
|
|
7295
7326
|
// src/utils/fs.ts
|
|
7296
|
-
import { dirname as dirname2, isAbsolute, join as join3, relative, resolve as resolve2, sep as sep3 } from "node:path";
|
|
7327
|
+
import { dirname as dirname2, isAbsolute as isAbsolute2, join as join3, relative, resolve as resolve2, sep as sep3 } from "node:path";
|
|
7297
7328
|
import { fileURLToPath } from "node:url";
|
|
7298
7329
|
function validatePreserveFilePath(filePath, projectRoot) {
|
|
7299
7330
|
if (!filePath || filePath.trim() === "") {
|
|
@@ -7302,7 +7333,7 @@ function validatePreserveFilePath(filePath, projectRoot) {
|
|
|
7302
7333
|
reason: "Path cannot be empty"
|
|
7303
7334
|
};
|
|
7304
7335
|
}
|
|
7305
|
-
if (
|
|
7336
|
+
if (isAbsolute2(filePath)) {
|
|
7306
7337
|
return {
|
|
7307
7338
|
valid: false,
|
|
7308
7339
|
reason: "Absolute paths are not allowed"
|
|
@@ -7310,7 +7341,7 @@ function validatePreserveFilePath(filePath, projectRoot) {
|
|
|
7310
7341
|
}
|
|
7311
7342
|
const resolvedPath = resolve2(projectRoot, filePath);
|
|
7312
7343
|
const relativePath = relative(projectRoot, resolvedPath);
|
|
7313
|
-
if (relativePath.startsWith("..") ||
|
|
7344
|
+
if (relativePath.startsWith("..") || isAbsolute2(relativePath)) {
|
|
7314
7345
|
return {
|
|
7315
7346
|
valid: false,
|
|
7316
7347
|
reason: "Path cannot traverse outside project root"
|
package/dist/index.js
CHANGED
|
@@ -206,7 +206,7 @@ var init_fs = () => {};
|
|
|
206
206
|
|
|
207
207
|
// src/utils/home.ts
|
|
208
208
|
import { homedir, userInfo } from "node:os";
|
|
209
|
-
import { parse, sep as sep2 } from "node:path";
|
|
209
|
+
import { isAbsolute as isAbsolute2, parse, sep as sep2 } from "node:path";
|
|
210
210
|
function readEnvHome() {
|
|
211
211
|
return process.env.HOME;
|
|
212
212
|
}
|
|
@@ -2814,7 +2814,7 @@ var package_default = {
|
|
|
2814
2814
|
workspaces: [
|
|
2815
2815
|
"packages/*"
|
|
2816
2816
|
],
|
|
2817
|
-
version: "1.1.
|
|
2817
|
+
version: "1.1.100",
|
|
2818
2818
|
description: "Batteries-included agent harness for Claude Code",
|
|
2819
2819
|
type: "module",
|
|
2820
2820
|
bin: {
|
package/package.json
CHANGED
package/templates/manifest.json
CHANGED