@clawos-dev/clawd 0.2.170 → 0.2.171-beta.347.906bfd3
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.cjs +176 -113
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -88,6 +88,7 @@ var init_methods = __esm({
|
|
|
88
88
|
"history:recentDirs",
|
|
89
89
|
"workspace:list",
|
|
90
90
|
"workspace:read",
|
|
91
|
+
"shift:list",
|
|
91
92
|
"skills:list",
|
|
92
93
|
"agents:list",
|
|
93
94
|
"git:root",
|
|
@@ -726,8 +727,8 @@ var init_parseUtil = __esm({
|
|
|
726
727
|
init_errors2();
|
|
727
728
|
init_en();
|
|
728
729
|
makeIssue = (params) => {
|
|
729
|
-
const { data, path:
|
|
730
|
-
const fullPath = [...
|
|
730
|
+
const { data, path: path62, errorMaps, issueData } = params;
|
|
731
|
+
const fullPath = [...path62, ...issueData.path || []];
|
|
731
732
|
const fullIssue = {
|
|
732
733
|
...issueData,
|
|
733
734
|
path: fullPath
|
|
@@ -1038,11 +1039,11 @@ var init_types = __esm({
|
|
|
1038
1039
|
init_parseUtil();
|
|
1039
1040
|
init_util();
|
|
1040
1041
|
ParseInputLazyPath = class {
|
|
1041
|
-
constructor(parent, value,
|
|
1042
|
+
constructor(parent, value, path62, key) {
|
|
1042
1043
|
this._cachedPath = [];
|
|
1043
1044
|
this.parent = parent;
|
|
1044
1045
|
this.data = value;
|
|
1045
|
-
this._path =
|
|
1046
|
+
this._path = path62;
|
|
1046
1047
|
this._key = key;
|
|
1047
1048
|
}
|
|
1048
1049
|
get path() {
|
|
@@ -6320,8 +6321,8 @@ var require_req = __commonJS({
|
|
|
6320
6321
|
if (req.originalUrl) {
|
|
6321
6322
|
_req.url = req.originalUrl;
|
|
6322
6323
|
} else {
|
|
6323
|
-
const
|
|
6324
|
-
_req.url = typeof
|
|
6324
|
+
const path62 = req.path;
|
|
6325
|
+
_req.url = typeof path62 === "string" ? path62 : req.url ? req.url.path || req.url : void 0;
|
|
6325
6326
|
}
|
|
6326
6327
|
if (req.query) {
|
|
6327
6328
|
_req.query = req.query;
|
|
@@ -6486,14 +6487,14 @@ var require_redact = __commonJS({
|
|
|
6486
6487
|
}
|
|
6487
6488
|
return obj;
|
|
6488
6489
|
}
|
|
6489
|
-
function parsePath(
|
|
6490
|
+
function parsePath(path62) {
|
|
6490
6491
|
const parts = [];
|
|
6491
6492
|
let current = "";
|
|
6492
6493
|
let inBrackets = false;
|
|
6493
6494
|
let inQuotes = false;
|
|
6494
6495
|
let quoteChar = "";
|
|
6495
|
-
for (let i = 0; i <
|
|
6496
|
-
const char =
|
|
6496
|
+
for (let i = 0; i < path62.length; i++) {
|
|
6497
|
+
const char = path62[i];
|
|
6497
6498
|
if (!inBrackets && char === ".") {
|
|
6498
6499
|
if (current) {
|
|
6499
6500
|
parts.push(current);
|
|
@@ -6624,10 +6625,10 @@ var require_redact = __commonJS({
|
|
|
6624
6625
|
return current;
|
|
6625
6626
|
}
|
|
6626
6627
|
function redactPaths(obj, paths, censor, remove = false) {
|
|
6627
|
-
for (const
|
|
6628
|
-
const parts = parsePath(
|
|
6628
|
+
for (const path62 of paths) {
|
|
6629
|
+
const parts = parsePath(path62);
|
|
6629
6630
|
if (parts.includes("*")) {
|
|
6630
|
-
redactWildcardPath(obj, parts, censor,
|
|
6631
|
+
redactWildcardPath(obj, parts, censor, path62, remove);
|
|
6631
6632
|
} else {
|
|
6632
6633
|
if (remove) {
|
|
6633
6634
|
removeKey(obj, parts);
|
|
@@ -6712,8 +6713,8 @@ var require_redact = __commonJS({
|
|
|
6712
6713
|
}
|
|
6713
6714
|
} else {
|
|
6714
6715
|
if (afterWildcard.includes("*")) {
|
|
6715
|
-
const wrappedCensor = typeof censor === "function" ? (value,
|
|
6716
|
-
const fullPath = [...pathArray.slice(0, pathLength), ...
|
|
6716
|
+
const wrappedCensor = typeof censor === "function" ? (value, path62) => {
|
|
6717
|
+
const fullPath = [...pathArray.slice(0, pathLength), ...path62];
|
|
6717
6718
|
return censor(value, fullPath);
|
|
6718
6719
|
} : censor;
|
|
6719
6720
|
redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove);
|
|
@@ -6748,8 +6749,8 @@ var require_redact = __commonJS({
|
|
|
6748
6749
|
return null;
|
|
6749
6750
|
}
|
|
6750
6751
|
const pathStructure = /* @__PURE__ */ new Map();
|
|
6751
|
-
for (const
|
|
6752
|
-
const parts = parsePath(
|
|
6752
|
+
for (const path62 of pathsToClone) {
|
|
6753
|
+
const parts = parsePath(path62);
|
|
6753
6754
|
let current = pathStructure;
|
|
6754
6755
|
for (let i = 0; i < parts.length; i++) {
|
|
6755
6756
|
const part = parts[i];
|
|
@@ -6801,24 +6802,24 @@ var require_redact = __commonJS({
|
|
|
6801
6802
|
}
|
|
6802
6803
|
return cloneSelectively(obj, pathStructure);
|
|
6803
6804
|
}
|
|
6804
|
-
function validatePath(
|
|
6805
|
-
if (typeof
|
|
6805
|
+
function validatePath(path62) {
|
|
6806
|
+
if (typeof path62 !== "string") {
|
|
6806
6807
|
throw new Error("Paths must be (non-empty) strings");
|
|
6807
6808
|
}
|
|
6808
|
-
if (
|
|
6809
|
+
if (path62 === "") {
|
|
6809
6810
|
throw new Error("Invalid redaction path ()");
|
|
6810
6811
|
}
|
|
6811
|
-
if (
|
|
6812
|
-
throw new Error(`Invalid redaction path (${
|
|
6812
|
+
if (path62.includes("..")) {
|
|
6813
|
+
throw new Error(`Invalid redaction path (${path62})`);
|
|
6813
6814
|
}
|
|
6814
|
-
if (
|
|
6815
|
-
throw new Error(`Invalid redaction path (${
|
|
6815
|
+
if (path62.includes(",")) {
|
|
6816
|
+
throw new Error(`Invalid redaction path (${path62})`);
|
|
6816
6817
|
}
|
|
6817
6818
|
let bracketCount = 0;
|
|
6818
6819
|
let inQuotes = false;
|
|
6819
6820
|
let quoteChar = "";
|
|
6820
|
-
for (let i = 0; i <
|
|
6821
|
-
const char =
|
|
6821
|
+
for (let i = 0; i < path62.length; i++) {
|
|
6822
|
+
const char = path62[i];
|
|
6822
6823
|
if ((char === '"' || char === "'") && bracketCount > 0) {
|
|
6823
6824
|
if (!inQuotes) {
|
|
6824
6825
|
inQuotes = true;
|
|
@@ -6832,20 +6833,20 @@ var require_redact = __commonJS({
|
|
|
6832
6833
|
} else if (char === "]" && !inQuotes) {
|
|
6833
6834
|
bracketCount--;
|
|
6834
6835
|
if (bracketCount < 0) {
|
|
6835
|
-
throw new Error(`Invalid redaction path (${
|
|
6836
|
+
throw new Error(`Invalid redaction path (${path62})`);
|
|
6836
6837
|
}
|
|
6837
6838
|
}
|
|
6838
6839
|
}
|
|
6839
6840
|
if (bracketCount !== 0) {
|
|
6840
|
-
throw new Error(`Invalid redaction path (${
|
|
6841
|
+
throw new Error(`Invalid redaction path (${path62})`);
|
|
6841
6842
|
}
|
|
6842
6843
|
}
|
|
6843
6844
|
function validatePaths(paths) {
|
|
6844
6845
|
if (!Array.isArray(paths)) {
|
|
6845
6846
|
throw new TypeError("paths must be an array");
|
|
6846
6847
|
}
|
|
6847
|
-
for (const
|
|
6848
|
-
validatePath(
|
|
6848
|
+
for (const path62 of paths) {
|
|
6849
|
+
validatePath(path62);
|
|
6849
6850
|
}
|
|
6850
6851
|
}
|
|
6851
6852
|
function slowRedact(options = {}) {
|
|
@@ -7013,8 +7014,8 @@ var require_redaction = __commonJS({
|
|
|
7013
7014
|
if (shape[k2] === null) {
|
|
7014
7015
|
o[k2] = (value) => topCensor(value, [k2]);
|
|
7015
7016
|
} else {
|
|
7016
|
-
const wrappedCensor = typeof censor === "function" ? (value,
|
|
7017
|
-
return censor(value, [k2, ...
|
|
7017
|
+
const wrappedCensor = typeof censor === "function" ? (value, path62) => {
|
|
7018
|
+
return censor(value, [k2, ...path62]);
|
|
7018
7019
|
} : censor;
|
|
7019
7020
|
o[k2] = Redact({
|
|
7020
7021
|
paths: shape[k2],
|
|
@@ -7232,10 +7233,10 @@ var require_atomic_sleep = __commonJS({
|
|
|
7232
7233
|
var require_sonic_boom = __commonJS({
|
|
7233
7234
|
"../node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js"(exports2, module2) {
|
|
7234
7235
|
"use strict";
|
|
7235
|
-
var
|
|
7236
|
+
var fs56 = require("fs");
|
|
7236
7237
|
var EventEmitter3 = require("events");
|
|
7237
7238
|
var inherits = require("util").inherits;
|
|
7238
|
-
var
|
|
7239
|
+
var path62 = require("path");
|
|
7239
7240
|
var sleep2 = require_atomic_sleep();
|
|
7240
7241
|
var assert = require("assert");
|
|
7241
7242
|
var BUSY_WRITE_TIMEOUT = 100;
|
|
@@ -7289,20 +7290,20 @@ var require_sonic_boom = __commonJS({
|
|
|
7289
7290
|
const mode = sonic.mode;
|
|
7290
7291
|
if (sonic.sync) {
|
|
7291
7292
|
try {
|
|
7292
|
-
if (sonic.mkdir)
|
|
7293
|
-
const fd =
|
|
7293
|
+
if (sonic.mkdir) fs56.mkdirSync(path62.dirname(file), { recursive: true });
|
|
7294
|
+
const fd = fs56.openSync(file, flags, mode);
|
|
7294
7295
|
fileOpened(null, fd);
|
|
7295
7296
|
} catch (err) {
|
|
7296
7297
|
fileOpened(err);
|
|
7297
7298
|
throw err;
|
|
7298
7299
|
}
|
|
7299
7300
|
} else if (sonic.mkdir) {
|
|
7300
|
-
|
|
7301
|
+
fs56.mkdir(path62.dirname(file), { recursive: true }, (err) => {
|
|
7301
7302
|
if (err) return fileOpened(err);
|
|
7302
|
-
|
|
7303
|
+
fs56.open(file, flags, mode, fileOpened);
|
|
7303
7304
|
});
|
|
7304
7305
|
} else {
|
|
7305
|
-
|
|
7306
|
+
fs56.open(file, flags, mode, fileOpened);
|
|
7306
7307
|
}
|
|
7307
7308
|
}
|
|
7308
7309
|
function SonicBoom(opts) {
|
|
@@ -7343,8 +7344,8 @@ var require_sonic_boom = __commonJS({
|
|
|
7343
7344
|
this.flush = flushBuffer;
|
|
7344
7345
|
this.flushSync = flushBufferSync;
|
|
7345
7346
|
this._actualWrite = actualWriteBuffer;
|
|
7346
|
-
fsWriteSync = () =>
|
|
7347
|
-
fsWrite = () =>
|
|
7347
|
+
fsWriteSync = () => fs56.writeSync(this.fd, this._writingBuf);
|
|
7348
|
+
fsWrite = () => fs56.write(this.fd, this._writingBuf, this.release);
|
|
7348
7349
|
} else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
|
|
7349
7350
|
this._writingBuf = "";
|
|
7350
7351
|
this.write = write;
|
|
@@ -7353,15 +7354,15 @@ var require_sonic_boom = __commonJS({
|
|
|
7353
7354
|
this._actualWrite = actualWrite;
|
|
7354
7355
|
fsWriteSync = () => {
|
|
7355
7356
|
if (Buffer.isBuffer(this._writingBuf)) {
|
|
7356
|
-
return
|
|
7357
|
+
return fs56.writeSync(this.fd, this._writingBuf);
|
|
7357
7358
|
}
|
|
7358
|
-
return
|
|
7359
|
+
return fs56.writeSync(this.fd, this._writingBuf, "utf8");
|
|
7359
7360
|
};
|
|
7360
7361
|
fsWrite = () => {
|
|
7361
7362
|
if (Buffer.isBuffer(this._writingBuf)) {
|
|
7362
|
-
return
|
|
7363
|
+
return fs56.write(this.fd, this._writingBuf, this.release);
|
|
7363
7364
|
}
|
|
7364
|
-
return
|
|
7365
|
+
return fs56.write(this.fd, this._writingBuf, "utf8", this.release);
|
|
7365
7366
|
};
|
|
7366
7367
|
} else {
|
|
7367
7368
|
throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
|
|
@@ -7418,7 +7419,7 @@ var require_sonic_boom = __commonJS({
|
|
|
7418
7419
|
}
|
|
7419
7420
|
}
|
|
7420
7421
|
if (this._fsync) {
|
|
7421
|
-
|
|
7422
|
+
fs56.fsyncSync(this.fd);
|
|
7422
7423
|
}
|
|
7423
7424
|
const len = this._len;
|
|
7424
7425
|
if (this._reopening) {
|
|
@@ -7532,7 +7533,7 @@ var require_sonic_boom = __commonJS({
|
|
|
7532
7533
|
const onDrain = () => {
|
|
7533
7534
|
if (!this._fsync) {
|
|
7534
7535
|
try {
|
|
7535
|
-
|
|
7536
|
+
fs56.fsync(this.fd, (err) => {
|
|
7536
7537
|
this._flushPending = false;
|
|
7537
7538
|
cb(err);
|
|
7538
7539
|
});
|
|
@@ -7634,7 +7635,7 @@ var require_sonic_boom = __commonJS({
|
|
|
7634
7635
|
const fd = this.fd;
|
|
7635
7636
|
this.once("ready", () => {
|
|
7636
7637
|
if (fd !== this.fd) {
|
|
7637
|
-
|
|
7638
|
+
fs56.close(fd, (err) => {
|
|
7638
7639
|
if (err) {
|
|
7639
7640
|
return this.emit("error", err);
|
|
7640
7641
|
}
|
|
@@ -7683,7 +7684,7 @@ var require_sonic_boom = __commonJS({
|
|
|
7683
7684
|
buf = this._bufs[0];
|
|
7684
7685
|
}
|
|
7685
7686
|
try {
|
|
7686
|
-
const n = Buffer.isBuffer(buf) ?
|
|
7687
|
+
const n = Buffer.isBuffer(buf) ? fs56.writeSync(this.fd, buf) : fs56.writeSync(this.fd, buf, "utf8");
|
|
7687
7688
|
const releasedBufObj = releaseWritingBuf(buf, this._len, n);
|
|
7688
7689
|
buf = releasedBufObj.writingBuf;
|
|
7689
7690
|
this._len = releasedBufObj.len;
|
|
@@ -7699,7 +7700,7 @@ var require_sonic_boom = __commonJS({
|
|
|
7699
7700
|
}
|
|
7700
7701
|
}
|
|
7701
7702
|
try {
|
|
7702
|
-
|
|
7703
|
+
fs56.fsyncSync(this.fd);
|
|
7703
7704
|
} catch {
|
|
7704
7705
|
}
|
|
7705
7706
|
}
|
|
@@ -7720,7 +7721,7 @@ var require_sonic_boom = __commonJS({
|
|
|
7720
7721
|
buf = mergeBuf(this._bufs[0], this._lens[0]);
|
|
7721
7722
|
}
|
|
7722
7723
|
try {
|
|
7723
|
-
const n =
|
|
7724
|
+
const n = fs56.writeSync(this.fd, buf);
|
|
7724
7725
|
buf = buf.subarray(n);
|
|
7725
7726
|
this._len = Math.max(this._len - n, 0);
|
|
7726
7727
|
if (buf.length <= 0) {
|
|
@@ -7748,13 +7749,13 @@ var require_sonic_boom = __commonJS({
|
|
|
7748
7749
|
this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "";
|
|
7749
7750
|
if (this.sync) {
|
|
7750
7751
|
try {
|
|
7751
|
-
const written = Buffer.isBuffer(this._writingBuf) ?
|
|
7752
|
+
const written = Buffer.isBuffer(this._writingBuf) ? fs56.writeSync(this.fd, this._writingBuf) : fs56.writeSync(this.fd, this._writingBuf, "utf8");
|
|
7752
7753
|
release(null, written);
|
|
7753
7754
|
} catch (err) {
|
|
7754
7755
|
release(err);
|
|
7755
7756
|
}
|
|
7756
7757
|
} else {
|
|
7757
|
-
|
|
7758
|
+
fs56.write(this.fd, this._writingBuf, release);
|
|
7758
7759
|
}
|
|
7759
7760
|
}
|
|
7760
7761
|
function actualWriteBuffer() {
|
|
@@ -7763,7 +7764,7 @@ var require_sonic_boom = __commonJS({
|
|
|
7763
7764
|
this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
|
|
7764
7765
|
if (this.sync) {
|
|
7765
7766
|
try {
|
|
7766
|
-
const written =
|
|
7767
|
+
const written = fs56.writeSync(this.fd, this._writingBuf);
|
|
7767
7768
|
release(null, written);
|
|
7768
7769
|
} catch (err) {
|
|
7769
7770
|
release(err);
|
|
@@ -7772,7 +7773,7 @@ var require_sonic_boom = __commonJS({
|
|
|
7772
7773
|
if (kCopyBuffer) {
|
|
7773
7774
|
this._writingBuf = Buffer.from(this._writingBuf);
|
|
7774
7775
|
}
|
|
7775
|
-
|
|
7776
|
+
fs56.write(this.fd, this._writingBuf, release);
|
|
7776
7777
|
}
|
|
7777
7778
|
}
|
|
7778
7779
|
function actualClose(sonic) {
|
|
@@ -7788,12 +7789,12 @@ var require_sonic_boom = __commonJS({
|
|
|
7788
7789
|
sonic._lens = [];
|
|
7789
7790
|
assert(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
|
|
7790
7791
|
try {
|
|
7791
|
-
|
|
7792
|
+
fs56.fsync(sonic.fd, closeWrapped);
|
|
7792
7793
|
} catch {
|
|
7793
7794
|
}
|
|
7794
7795
|
function closeWrapped() {
|
|
7795
7796
|
if (sonic.fd !== 1 && sonic.fd !== 2) {
|
|
7796
|
-
|
|
7797
|
+
fs56.close(sonic.fd, done);
|
|
7797
7798
|
} else {
|
|
7798
7799
|
done();
|
|
7799
7800
|
}
|
|
@@ -8050,7 +8051,7 @@ var require_thread_stream = __commonJS({
|
|
|
8050
8051
|
var { version: version2 } = require_package();
|
|
8051
8052
|
var { EventEmitter: EventEmitter3 } = require("events");
|
|
8052
8053
|
var { Worker } = require("worker_threads");
|
|
8053
|
-
var { join:
|
|
8054
|
+
var { join: join16 } = require("path");
|
|
8054
8055
|
var { pathToFileURL } = require("url");
|
|
8055
8056
|
var { wait } = require_wait();
|
|
8056
8057
|
var {
|
|
@@ -8086,7 +8087,7 @@ var require_thread_stream = __commonJS({
|
|
|
8086
8087
|
function createWorker(stream, opts) {
|
|
8087
8088
|
const { filename, workerData } = opts;
|
|
8088
8089
|
const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
|
|
8089
|
-
const toExecute = bundlerOverrides["thread-stream-worker"] ||
|
|
8090
|
+
const toExecute = bundlerOverrides["thread-stream-worker"] || join16(__dirname, "lib", "worker.js");
|
|
8090
8091
|
const worker = new Worker(toExecute, {
|
|
8091
8092
|
...opts.workerOpts,
|
|
8092
8093
|
trackUnmanagedFds: false,
|
|
@@ -8472,7 +8473,7 @@ var require_transport = __commonJS({
|
|
|
8472
8473
|
"use strict";
|
|
8473
8474
|
var { createRequire } = require("module");
|
|
8474
8475
|
var getCallers = require_caller();
|
|
8475
|
-
var { join:
|
|
8476
|
+
var { join: join16, isAbsolute: isAbsolute2, sep: sep3 } = require("path");
|
|
8476
8477
|
var sleep2 = require_atomic_sleep();
|
|
8477
8478
|
var onExit = require_on_exit_leak_free();
|
|
8478
8479
|
var ThreadStream = require_thread_stream();
|
|
@@ -8535,7 +8536,7 @@ var require_transport = __commonJS({
|
|
|
8535
8536
|
throw new Error("only one of target or targets can be specified");
|
|
8536
8537
|
}
|
|
8537
8538
|
if (targets) {
|
|
8538
|
-
target = bundlerOverrides["pino-worker"] ||
|
|
8539
|
+
target = bundlerOverrides["pino-worker"] || join16(__dirname, "worker.js");
|
|
8539
8540
|
options.targets = targets.filter((dest) => dest.target).map((dest) => {
|
|
8540
8541
|
return {
|
|
8541
8542
|
...dest,
|
|
@@ -8553,7 +8554,7 @@ var require_transport = __commonJS({
|
|
|
8553
8554
|
});
|
|
8554
8555
|
});
|
|
8555
8556
|
} else if (pipeline3) {
|
|
8556
|
-
target = bundlerOverrides["pino-worker"] ||
|
|
8557
|
+
target = bundlerOverrides["pino-worker"] || join16(__dirname, "worker.js");
|
|
8557
8558
|
options.pipelines = [pipeline3.map((dest) => {
|
|
8558
8559
|
return {
|
|
8559
8560
|
...dest,
|
|
@@ -8575,7 +8576,7 @@ var require_transport = __commonJS({
|
|
|
8575
8576
|
return origin;
|
|
8576
8577
|
}
|
|
8577
8578
|
if (origin === "pino/file") {
|
|
8578
|
-
return
|
|
8579
|
+
return join16(__dirname, "..", "file.js");
|
|
8579
8580
|
}
|
|
8580
8581
|
let fixTarget2;
|
|
8581
8582
|
for (const filePath of callers) {
|
|
@@ -9565,7 +9566,7 @@ var require_safe_stable_stringify = __commonJS({
|
|
|
9565
9566
|
return circularValue;
|
|
9566
9567
|
}
|
|
9567
9568
|
let res = "";
|
|
9568
|
-
let
|
|
9569
|
+
let join16 = ",";
|
|
9569
9570
|
const originalIndentation = indentation;
|
|
9570
9571
|
if (Array.isArray(value)) {
|
|
9571
9572
|
if (value.length === 0) {
|
|
@@ -9579,7 +9580,7 @@ var require_safe_stable_stringify = __commonJS({
|
|
|
9579
9580
|
indentation += spacer;
|
|
9580
9581
|
res += `
|
|
9581
9582
|
${indentation}`;
|
|
9582
|
-
|
|
9583
|
+
join16 = `,
|
|
9583
9584
|
${indentation}`;
|
|
9584
9585
|
}
|
|
9585
9586
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -9587,13 +9588,13 @@ ${indentation}`;
|
|
|
9587
9588
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
9588
9589
|
const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
9589
9590
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
9590
|
-
res +=
|
|
9591
|
+
res += join16;
|
|
9591
9592
|
}
|
|
9592
9593
|
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
9593
9594
|
res += tmp !== void 0 ? tmp : "null";
|
|
9594
9595
|
if (value.length - 1 > maximumBreadth) {
|
|
9595
9596
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
9596
|
-
res += `${
|
|
9597
|
+
res += `${join16}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
9597
9598
|
}
|
|
9598
9599
|
if (spacer !== "") {
|
|
9599
9600
|
res += `
|
|
@@ -9614,7 +9615,7 @@ ${originalIndentation}`;
|
|
|
9614
9615
|
let separator = "";
|
|
9615
9616
|
if (spacer !== "") {
|
|
9616
9617
|
indentation += spacer;
|
|
9617
|
-
|
|
9618
|
+
join16 = `,
|
|
9618
9619
|
${indentation}`;
|
|
9619
9620
|
whitespace = " ";
|
|
9620
9621
|
}
|
|
@@ -9628,13 +9629,13 @@ ${indentation}`;
|
|
|
9628
9629
|
const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
|
|
9629
9630
|
if (tmp !== void 0) {
|
|
9630
9631
|
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
9631
|
-
separator =
|
|
9632
|
+
separator = join16;
|
|
9632
9633
|
}
|
|
9633
9634
|
}
|
|
9634
9635
|
if (keyLength > maximumBreadth) {
|
|
9635
9636
|
const removedKeys = keyLength - maximumBreadth;
|
|
9636
9637
|
res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
|
|
9637
|
-
separator =
|
|
9638
|
+
separator = join16;
|
|
9638
9639
|
}
|
|
9639
9640
|
if (spacer !== "" && separator.length > 1) {
|
|
9640
9641
|
res = `
|
|
@@ -9675,7 +9676,7 @@ ${originalIndentation}`;
|
|
|
9675
9676
|
}
|
|
9676
9677
|
const originalIndentation = indentation;
|
|
9677
9678
|
let res = "";
|
|
9678
|
-
let
|
|
9679
|
+
let join16 = ",";
|
|
9679
9680
|
if (Array.isArray(value)) {
|
|
9680
9681
|
if (value.length === 0) {
|
|
9681
9682
|
return "[]";
|
|
@@ -9688,7 +9689,7 @@ ${originalIndentation}`;
|
|
|
9688
9689
|
indentation += spacer;
|
|
9689
9690
|
res += `
|
|
9690
9691
|
${indentation}`;
|
|
9691
|
-
|
|
9692
|
+
join16 = `,
|
|
9692
9693
|
${indentation}`;
|
|
9693
9694
|
}
|
|
9694
9695
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -9696,13 +9697,13 @@ ${indentation}`;
|
|
|
9696
9697
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
9697
9698
|
const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
9698
9699
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
9699
|
-
res +=
|
|
9700
|
+
res += join16;
|
|
9700
9701
|
}
|
|
9701
9702
|
const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
9702
9703
|
res += tmp !== void 0 ? tmp : "null";
|
|
9703
9704
|
if (value.length - 1 > maximumBreadth) {
|
|
9704
9705
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
9705
|
-
res += `${
|
|
9706
|
+
res += `${join16}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
9706
9707
|
}
|
|
9707
9708
|
if (spacer !== "") {
|
|
9708
9709
|
res += `
|
|
@@ -9715,7 +9716,7 @@ ${originalIndentation}`;
|
|
|
9715
9716
|
let whitespace = "";
|
|
9716
9717
|
if (spacer !== "") {
|
|
9717
9718
|
indentation += spacer;
|
|
9718
|
-
|
|
9719
|
+
join16 = `,
|
|
9719
9720
|
${indentation}`;
|
|
9720
9721
|
whitespace = " ";
|
|
9721
9722
|
}
|
|
@@ -9724,7 +9725,7 @@ ${indentation}`;
|
|
|
9724
9725
|
const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
|
|
9725
9726
|
if (tmp !== void 0) {
|
|
9726
9727
|
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
9727
|
-
separator =
|
|
9728
|
+
separator = join16;
|
|
9728
9729
|
}
|
|
9729
9730
|
}
|
|
9730
9731
|
if (spacer !== "" && separator.length > 1) {
|
|
@@ -9782,20 +9783,20 @@ ${originalIndentation}`;
|
|
|
9782
9783
|
indentation += spacer;
|
|
9783
9784
|
let res2 = `
|
|
9784
9785
|
${indentation}`;
|
|
9785
|
-
const
|
|
9786
|
+
const join17 = `,
|
|
9786
9787
|
${indentation}`;
|
|
9787
9788
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
9788
9789
|
let i = 0;
|
|
9789
9790
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
9790
9791
|
const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
9791
9792
|
res2 += tmp2 !== void 0 ? tmp2 : "null";
|
|
9792
|
-
res2 +=
|
|
9793
|
+
res2 += join17;
|
|
9793
9794
|
}
|
|
9794
9795
|
const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
9795
9796
|
res2 += tmp !== void 0 ? tmp : "null";
|
|
9796
9797
|
if (value.length - 1 > maximumBreadth) {
|
|
9797
9798
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
9798
|
-
res2 += `${
|
|
9799
|
+
res2 += `${join17}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
9799
9800
|
}
|
|
9800
9801
|
res2 += `
|
|
9801
9802
|
${originalIndentation}`;
|
|
@@ -9811,16 +9812,16 @@ ${originalIndentation}`;
|
|
|
9811
9812
|
return '"[Object]"';
|
|
9812
9813
|
}
|
|
9813
9814
|
indentation += spacer;
|
|
9814
|
-
const
|
|
9815
|
+
const join16 = `,
|
|
9815
9816
|
${indentation}`;
|
|
9816
9817
|
let res = "";
|
|
9817
9818
|
let separator = "";
|
|
9818
9819
|
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
9819
9820
|
if (isTypedArrayWithEntries(value)) {
|
|
9820
|
-
res += stringifyTypedArray(value,
|
|
9821
|
+
res += stringifyTypedArray(value, join16, maximumBreadth);
|
|
9821
9822
|
keys = keys.slice(value.length);
|
|
9822
9823
|
maximumPropertiesToStringify -= value.length;
|
|
9823
|
-
separator =
|
|
9824
|
+
separator = join16;
|
|
9824
9825
|
}
|
|
9825
9826
|
if (deterministic) {
|
|
9826
9827
|
keys = sort(keys, comparator);
|
|
@@ -9831,13 +9832,13 @@ ${indentation}`;
|
|
|
9831
9832
|
const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
|
|
9832
9833
|
if (tmp !== void 0) {
|
|
9833
9834
|
res += `${separator}${strEscape(key2)}: ${tmp}`;
|
|
9834
|
-
separator =
|
|
9835
|
+
separator = join16;
|
|
9835
9836
|
}
|
|
9836
9837
|
}
|
|
9837
9838
|
if (keyLength > maximumBreadth) {
|
|
9838
9839
|
const removedKeys = keyLength - maximumBreadth;
|
|
9839
9840
|
res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
|
|
9840
|
-
separator =
|
|
9841
|
+
separator = join16;
|
|
9841
9842
|
}
|
|
9842
9843
|
if (separator !== "") {
|
|
9843
9844
|
res = `
|
|
@@ -10157,7 +10158,7 @@ var require_multistream = __commonJS({
|
|
|
10157
10158
|
var require_pino = __commonJS({
|
|
10158
10159
|
"../node_modules/.pnpm/pino@9.14.0/node_modules/pino/pino.js"(exports2, module2) {
|
|
10159
10160
|
"use strict";
|
|
10160
|
-
var
|
|
10161
|
+
var os23 = require("os");
|
|
10161
10162
|
var stdSerializers = require_pino_std_serializers();
|
|
10162
10163
|
var caller = require_caller();
|
|
10163
10164
|
var redaction = require_redaction();
|
|
@@ -10204,7 +10205,7 @@ var require_pino = __commonJS({
|
|
|
10204
10205
|
} = symbols;
|
|
10205
10206
|
var { epochTime, nullTime } = time;
|
|
10206
10207
|
var { pid } = process;
|
|
10207
|
-
var hostname =
|
|
10208
|
+
var hostname = os23.hostname();
|
|
10208
10209
|
var defaultErrorSerializer = stdSerializers.err;
|
|
10209
10210
|
var defaultOptions = {
|
|
10210
10211
|
level: "info",
|
|
@@ -10928,11 +10929,11 @@ var init_lib = __esm({
|
|
|
10928
10929
|
}
|
|
10929
10930
|
}
|
|
10930
10931
|
},
|
|
10931
|
-
addToPath: function addToPath(
|
|
10932
|
-
var last =
|
|
10932
|
+
addToPath: function addToPath(path62, added, removed, oldPosInc, options) {
|
|
10933
|
+
var last = path62.lastComponent;
|
|
10933
10934
|
if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
|
|
10934
10935
|
return {
|
|
10935
|
-
oldPos:
|
|
10936
|
+
oldPos: path62.oldPos + oldPosInc,
|
|
10936
10937
|
lastComponent: {
|
|
10937
10938
|
count: last.count + 1,
|
|
10938
10939
|
added,
|
|
@@ -10942,7 +10943,7 @@ var init_lib = __esm({
|
|
|
10942
10943
|
};
|
|
10943
10944
|
} else {
|
|
10944
10945
|
return {
|
|
10945
|
-
oldPos:
|
|
10946
|
+
oldPos: path62.oldPos + oldPosInc,
|
|
10946
10947
|
lastComponent: {
|
|
10947
10948
|
count: 1,
|
|
10948
10949
|
added,
|
|
@@ -11388,10 +11389,10 @@ function attachmentToHistoryMessage(o, ts) {
|
|
|
11388
11389
|
const memories = raw.map((m2) => {
|
|
11389
11390
|
if (!m2 || typeof m2 !== "object") return null;
|
|
11390
11391
|
const rec3 = m2;
|
|
11391
|
-
const
|
|
11392
|
+
const path62 = typeof rec3.path === "string" ? rec3.path : null;
|
|
11392
11393
|
const content = typeof rec3.content === "string" ? rec3.content : null;
|
|
11393
|
-
if (!
|
|
11394
|
-
const entry = { path:
|
|
11394
|
+
if (!path62 || content == null) return null;
|
|
11395
|
+
const entry = { path: path62, content };
|
|
11395
11396
|
if (typeof rec3.mtimeMs === "number") entry.mtimeMs = rec3.mtimeMs;
|
|
11396
11397
|
return entry;
|
|
11397
11398
|
}).filter((m2) => m2 !== null);
|
|
@@ -12196,10 +12197,10 @@ function parseAttachment(obj) {
|
|
|
12196
12197
|
const memories = raw.map((m2) => {
|
|
12197
12198
|
if (!m2 || typeof m2 !== "object") return null;
|
|
12198
12199
|
const rec3 = m2;
|
|
12199
|
-
const
|
|
12200
|
+
const path62 = typeof rec3.path === "string" ? rec3.path : null;
|
|
12200
12201
|
const content = typeof rec3.content === "string" ? rec3.content : null;
|
|
12201
|
-
if (!
|
|
12202
|
-
const out = { path:
|
|
12202
|
+
if (!path62 || content == null) return null;
|
|
12203
|
+
const out = { path: path62, content };
|
|
12203
12204
|
if (typeof rec3.mtimeMs === "number") out.mtimeMs = rec3.mtimeMs;
|
|
12204
12205
|
return out;
|
|
12205
12206
|
}).filter((m2) => m2 !== null);
|
|
@@ -21400,7 +21401,7 @@ var require_BufferList = __commonJS({
|
|
|
21400
21401
|
this.head = this.tail = null;
|
|
21401
21402
|
this.length = 0;
|
|
21402
21403
|
};
|
|
21403
|
-
BufferList.prototype.join = function
|
|
21404
|
+
BufferList.prototype.join = function join16(s) {
|
|
21404
21405
|
if (this.length === 0) return "";
|
|
21405
21406
|
var p2 = this.head;
|
|
21406
21407
|
var ret = "" + p2.data;
|
|
@@ -23990,8 +23991,8 @@ var require_utils = __commonJS({
|
|
|
23990
23991
|
var result = transform[inputType][outputType](input);
|
|
23991
23992
|
return result;
|
|
23992
23993
|
};
|
|
23993
|
-
exports2.resolve = function(
|
|
23994
|
-
var parts =
|
|
23994
|
+
exports2.resolve = function(path62) {
|
|
23995
|
+
var parts = path62.split("/");
|
|
23995
23996
|
var result = [];
|
|
23996
23997
|
for (var index = 0; index < parts.length; index++) {
|
|
23997
23998
|
var part = parts[index];
|
|
@@ -29844,18 +29845,18 @@ var require_object = __commonJS({
|
|
|
29844
29845
|
var object = new ZipObject(name, zipObjectContent, o);
|
|
29845
29846
|
this.files[name] = object;
|
|
29846
29847
|
};
|
|
29847
|
-
var parentFolder = function(
|
|
29848
|
-
if (
|
|
29849
|
-
|
|
29848
|
+
var parentFolder = function(path62) {
|
|
29849
|
+
if (path62.slice(-1) === "/") {
|
|
29850
|
+
path62 = path62.substring(0, path62.length - 1);
|
|
29850
29851
|
}
|
|
29851
|
-
var lastSlash =
|
|
29852
|
-
return lastSlash > 0 ?
|
|
29852
|
+
var lastSlash = path62.lastIndexOf("/");
|
|
29853
|
+
return lastSlash > 0 ? path62.substring(0, lastSlash) : "";
|
|
29853
29854
|
};
|
|
29854
|
-
var forceTrailingSlash = function(
|
|
29855
|
-
if (
|
|
29856
|
-
|
|
29855
|
+
var forceTrailingSlash = function(path62) {
|
|
29856
|
+
if (path62.slice(-1) !== "/") {
|
|
29857
|
+
path62 += "/";
|
|
29857
29858
|
}
|
|
29858
|
-
return
|
|
29859
|
+
return path62;
|
|
29859
29860
|
};
|
|
29860
29861
|
var folderAdd = function(name, createFolders) {
|
|
29861
29862
|
createFolders = typeof createFolders !== "undefined" ? createFolders : defaults.createFolders;
|
|
@@ -36491,8 +36492,8 @@ function turnStartInput(text) {
|
|
|
36491
36492
|
const items = [];
|
|
36492
36493
|
let leftover = text;
|
|
36493
36494
|
for (const m2 of text.matchAll(SKILL_RE)) {
|
|
36494
|
-
const [marker, name,
|
|
36495
|
-
items.push({ type: "skill", name, path:
|
|
36495
|
+
const [marker, name, path62] = m2;
|
|
36496
|
+
items.push({ type: "skill", name, path: path62 });
|
|
36496
36497
|
leftover = leftover.replace(marker, "");
|
|
36497
36498
|
}
|
|
36498
36499
|
for (const m2 of text.matchAll(ATTACHMENT_RE2)) {
|
|
@@ -38372,13 +38373,13 @@ function mapSkillsListResponse(res) {
|
|
|
38372
38373
|
const r = s ?? {};
|
|
38373
38374
|
const name = str3(r.name);
|
|
38374
38375
|
if (!name) continue;
|
|
38375
|
-
const
|
|
38376
|
+
const path62 = str3(r.path);
|
|
38376
38377
|
const description = str3(r.description);
|
|
38377
38378
|
const isPlugin = name.includes(":");
|
|
38378
38379
|
out.push({
|
|
38379
38380
|
name,
|
|
38380
38381
|
source: isPlugin ? "plugin" : "project",
|
|
38381
|
-
...
|
|
38382
|
+
...path62 ? { path: path62 } : {},
|
|
38382
38383
|
...description ? { description } : {},
|
|
38383
38384
|
...isPlugin ? { plugin: name.split(":")[0] } : {}
|
|
38384
38385
|
});
|
|
@@ -42488,9 +42489,9 @@ var CentralClientError = class extends Error {
|
|
|
42488
42489
|
code;
|
|
42489
42490
|
cause;
|
|
42490
42491
|
};
|
|
42491
|
-
async function centralRequest(opts,
|
|
42492
|
+
async function centralRequest(opts, path62, init) {
|
|
42492
42493
|
const f = opts.fetchImpl ?? globalThis.fetch;
|
|
42493
|
-
const url = `${opts.api.replace(/\/+$/, "")}${
|
|
42494
|
+
const url = `${opts.api.replace(/\/+$/, "")}${path62}`;
|
|
42494
42495
|
const ctrl = new AbortController();
|
|
42495
42496
|
const timer = setTimeout(() => ctrl.abort(), opts.timeoutMs ?? 15e3);
|
|
42496
42497
|
let res;
|
|
@@ -45866,6 +45867,62 @@ function buildAppBuilderHandlers(deps) {
|
|
|
45866
45867
|
};
|
|
45867
45868
|
}
|
|
45868
45869
|
|
|
45870
|
+
// src/shift-mock-store.ts
|
|
45871
|
+
init_zod();
|
|
45872
|
+
var fs49 = __toESM(require("fs/promises"), 1);
|
|
45873
|
+
var ShiftScheduleSchema = external_exports.discriminatedUnion("kind", [
|
|
45874
|
+
external_exports.object({
|
|
45875
|
+
kind: external_exports.literal("single"),
|
|
45876
|
+
start: external_exports.string(),
|
|
45877
|
+
end: external_exports.string()
|
|
45878
|
+
}),
|
|
45879
|
+
external_exports.object({
|
|
45880
|
+
kind: external_exports.literal("recurring"),
|
|
45881
|
+
cron: external_exports.string(),
|
|
45882
|
+
tz: external_exports.string().optional(),
|
|
45883
|
+
durationMs: external_exports.number().int().positive()
|
|
45884
|
+
})
|
|
45885
|
+
]);
|
|
45886
|
+
var ShiftSchema = external_exports.object({
|
|
45887
|
+
id: external_exports.string(),
|
|
45888
|
+
agentId: external_exports.string(),
|
|
45889
|
+
schedule: ShiftScheduleSchema,
|
|
45890
|
+
note: external_exports.string().optional()
|
|
45891
|
+
});
|
|
45892
|
+
var ShiftFileSchema = external_exports.array(ShiftSchema);
|
|
45893
|
+
function createShiftMockStore({ filePath }) {
|
|
45894
|
+
return {
|
|
45895
|
+
async list() {
|
|
45896
|
+
let raw;
|
|
45897
|
+
try {
|
|
45898
|
+
raw = await fs49.readFile(filePath, "utf-8");
|
|
45899
|
+
} catch (err) {
|
|
45900
|
+
if (err.code === "ENOENT") {
|
|
45901
|
+
return { shifts: [], total: 0, source: "empty" };
|
|
45902
|
+
}
|
|
45903
|
+
throw err;
|
|
45904
|
+
}
|
|
45905
|
+
const parsed = ShiftFileSchema.parse(JSON.parse(raw));
|
|
45906
|
+
return { shifts: parsed, total: parsed.length, source: "file" };
|
|
45907
|
+
}
|
|
45908
|
+
};
|
|
45909
|
+
}
|
|
45910
|
+
|
|
45911
|
+
// src/handlers/shift.ts
|
|
45912
|
+
function buildShiftHandlers(deps) {
|
|
45913
|
+
const store = createShiftMockStore({ filePath: deps.shiftFilePath });
|
|
45914
|
+
return {
|
|
45915
|
+
"shift:list": async () => {
|
|
45916
|
+
const result = await store.list();
|
|
45917
|
+
return { response: result };
|
|
45918
|
+
}
|
|
45919
|
+
};
|
|
45920
|
+
}
|
|
45921
|
+
|
|
45922
|
+
// src/handlers/index.ts
|
|
45923
|
+
var path55 = __toESM(require("path"), 1);
|
|
45924
|
+
var os20 = __toESM(require("os"), 1);
|
|
45925
|
+
|
|
45869
45926
|
// src/extension/registry.ts
|
|
45870
45927
|
var import_promises8 = __toESM(require("fs/promises"), 1);
|
|
45871
45928
|
var import_node_path43 = __toESM(require("path"), 1);
|
|
@@ -46017,6 +46074,9 @@ function buildMethodHandlers(deps) {
|
|
|
46017
46074
|
deployKitRoot: deps.deployKitRoot,
|
|
46018
46075
|
resolvePersonaRoot: deps.resolvePersonaRoot,
|
|
46019
46076
|
broadcastSessionFrame: deps.broadcastSessionFrame
|
|
46077
|
+
}),
|
|
46078
|
+
...buildShiftHandlers({
|
|
46079
|
+
shiftFilePath: path55.join(os20.homedir(), ".clawd", "shift.json")
|
|
46020
46080
|
})
|
|
46021
46081
|
};
|
|
46022
46082
|
}
|
|
@@ -46357,6 +46417,9 @@ var METHOD_GRANT_MAP = {
|
|
|
46357
46417
|
"history:recentDirs": CAPABILITY_SCOPED,
|
|
46358
46418
|
"workspace:list": CAPABILITY_SCOPED,
|
|
46359
46419
|
"workspace:read": CAPABILITY_SCOPED,
|
|
46420
|
+
// ---- shift:* (排班 mock,owner-only 读) ----
|
|
46421
|
+
// mock 阶段只 owner 用;接 guest 后再考虑分级
|
|
46422
|
+
"shift:list": ADMIN_ANY,
|
|
46360
46423
|
"skills:list": CAPABILITY_SCOPED,
|
|
46361
46424
|
"agents:list": CAPABILITY_SCOPED,
|
|
46362
46425
|
"git:root": CAPABILITY_SCOPED,
|
package/package.json
CHANGED