lody 0.110.0 → 0.110.1
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/{acp-interaction-owner-CdfQZsA1.js → acp-interaction-owner-CcAOYmEj.js} +4 -4
- package/dist/{agent-execution-BDaiNzV1.js → agent-execution-DbMHu2MY.js} +73 -3
- package/dist/chunks/{vendor-diff-1FyGa8Sd.js → vendor-diff-CPHd5agL.js} +251 -1
- package/dist/{client-CdDGKDiJ.js → client-CBW0Grpt.js} +4 -4
- package/dist/{code-collab-Q9UJxF5f.js → code-collab-COUEig0Z.js} +238 -155
- package/dist/{daemon-session-tools-B2o_Rn8o.js → daemon-session-tools-DgWu5_Fi.js} +4 -4
- package/dist/{diff-line-counts-Cfd7ywAS.js → diff-line-counts-C4QnbxuZ.js} +2 -2
- package/dist/{diff-worker-task-D7Ri1Pxx.js → diff-worker-task-CRv8CGSL.js} +2 -2
- package/dist/diff-worker.js +3 -3
- package/dist/{directory-handle-D3jV-baK.js → directory-handle-DT-Xm7WB.js} +5 -5
- package/dist/{dsh-plugins-bpB7jsn7.js → dsh-plugins-D2C2tzW9.js} +10 -10
- package/dist/file-index-scan-worker.js +4 -4
- package/dist/{file-lock-De7Gp7uV.js → file-lock-Ct7V9_V7.js} +5 -5
- package/dist/{index-DCvrDzQ4.js → index-C4-tIIH9.js} +5 -5
- package/dist/{index-Ct3cdpLb.js → index-Drq2NUA9.js} +95 -93
- package/dist/{index-CCkzRWUs.js → index-FDl9UATC.js} +7 -7
- package/dist/{index-Dr_w9T6F.js → index-R0ifto56.js} +5 -5
- package/dist/index.js +4 -4
- package/dist/{register-D7pWlArd.js → register-DDeKCzbJ.js} +1012 -83
- package/dist/{remote-pairing-1sJYblth.js → remote-pairing-CcEqyvpe.js} +5 -5
- package/dist/{reset-identity-DdzOplMy.js → reset-identity-E0bQ4nDX.js} +6 -6
- package/dist/{review-viewer-Be1SFRPK.js → review-viewer-CuYdljPk.js} +2 -2
- package/dist/{schedule-command-client--Bl9vjMS.js → schedule-command-client-SjsG4n0y.js} +4 -4
- package/dist/{telemetry-CHUhwRVv.js → telemetry-CztoQabb.js} +1155 -751
- package/dist/turn-diff-store-worker.js +92 -4
- package/dist/{workspace-legacy-CAbHfoet.js → workspace-legacy-Cu3kw51y.js} +246 -113
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { aT as e2eeAcpInteractionInputContext, aU as e2eeAcpInteractionResponseContext } from "./telemetry-
|
|
2
|
+
import { aT as e2eeAcpInteractionInputContext, aU as e2eeAcpInteractionResponseContext } from "./telemetry-CztoQabb.js";
|
|
3
3
|
import "./chunks/vendor-effect-qEtB86Xz.js";
|
|
4
4
|
import "./chunks/vendor-commander-B86VeeRa.js";
|
|
5
5
|
import "node:events";
|
|
@@ -8,9 +8,9 @@ import "node:path";
|
|
|
8
8
|
import "node:fs";
|
|
9
9
|
import "node:process";
|
|
10
10
|
import "./chunks/commonjs-helpers-CCIqAdii.js";
|
|
11
|
-
import "./ios-simulator-BJjtVdO8.js";
|
|
12
11
|
import "./chunks/vendor-zod-CBWGVFD-.js";
|
|
13
|
-
import "./
|
|
12
|
+
import "./ios-simulator-BJjtVdO8.js";
|
|
13
|
+
import "./code-collab-COUEig0Z.js";
|
|
14
14
|
import "./chunks/vendor-immer-F2vkwr8n.js";
|
|
15
15
|
import "./chunks/vendor-loro-crdt-B0fZaMbx.js";
|
|
16
16
|
import "./chunks/vendor-loro-mirror-g7rEjGgt.js";
|
|
@@ -503,4 +503,4 @@ function createAcpInteractionOwner(options) {
|
|
|
503
503
|
export {
|
|
504
504
|
createAcpInteractionOwner
|
|
505
505
|
};
|
|
506
|
-
//# sourceMappingURL=acp-interaction-owner-
|
|
506
|
+
//# sourceMappingURL=acp-interaction-owner-CcAOYmEj.js.map
|
|
@@ -7,6 +7,8 @@ import "node:crypto";
|
|
|
7
7
|
import "node:path";
|
|
8
8
|
import "better-sqlite3";
|
|
9
9
|
const attempt = (body) => try_({ try: body, catch: (cause) => cause });
|
|
10
|
+
const encryptedMemberRequester = (cryptoUserId) => `e2ee-member:${cryptoUserId}`;
|
|
11
|
+
const memberRequesterPrefix = encryptedMemberRequester("");
|
|
10
12
|
const retainedIntentSchema = union([
|
|
11
13
|
tuple([literal(1), string(), string()]),
|
|
12
14
|
tuple([literal(1), string(), string(), string()])
|
|
@@ -15,7 +17,7 @@ const intentSchema = object({
|
|
|
15
17
|
workspaceId: string().min(1),
|
|
16
18
|
sessionId: string().min(1),
|
|
17
19
|
userTurnId: string().min(1),
|
|
18
|
-
/**
|
|
20
|
+
/** The identity `resolveRequester` verified; a row's own `userId` is display data. */
|
|
19
21
|
requesterUserId: string().optional(),
|
|
20
22
|
inputConfig: unknown().optional(),
|
|
21
23
|
/** Every local project this machine resolved for the turn; empty means projectless. */
|
|
@@ -65,6 +67,54 @@ function makeEncryptedAgentExecution(options) {
|
|
|
65
67
|
).pipe(
|
|
66
68
|
map((result) => result._tag === "Authorized" && result.isCurrent?.() !== false)
|
|
67
69
|
) : succeed(false);
|
|
70
|
+
const verifiedRequester = fnUntraced(function* (verified) {
|
|
71
|
+
if (verified.derivedFrom) {
|
|
72
|
+
const origin = yield* verifiedOrigin(verified.derivedFrom);
|
|
73
|
+
return origin ? encryptedMemberRequester(origin.requesterCryptoUserId) : void 0;
|
|
74
|
+
}
|
|
75
|
+
if (verified.requesterDevice === options.selfDevice || !options.ledgerIdentity)
|
|
76
|
+
return void 0;
|
|
77
|
+
return (yield* options.ledgerIdentity.ownsDevice(verified.requesterDevice)) ? options.machineUserId : encryptedMemberRequester(verified.requesterCryptoUserId);
|
|
78
|
+
});
|
|
79
|
+
const resolveRequester = fnUntraced(function* (input) {
|
|
80
|
+
const intent = yield* attempt(() => intentSchema.parse(input));
|
|
81
|
+
const verified = yield* options.resolveVerifiedOriginal(intent);
|
|
82
|
+
if (verified && "state" in verified) return { state: "pending" };
|
|
83
|
+
if (!verified) return { state: "denied" };
|
|
84
|
+
const userId = yield* verifiedRequester(verified);
|
|
85
|
+
return userId === void 0 ? {} : { userId };
|
|
86
|
+
});
|
|
87
|
+
const verifyRequesterAccess = fnUntraced(function* (requesterUserId, localProjectId) {
|
|
88
|
+
if (requesterUserId === options.machineUserId) return { allowed: true };
|
|
89
|
+
const denied = { allowed: false, reason: "not_visible" };
|
|
90
|
+
if (!requesterUserId.startsWith(memberRequesterPrefix)) return denied;
|
|
91
|
+
if (!options.authorizeExecution || !options.ledgerIdentity) return denied;
|
|
92
|
+
const device = yield* options.ledgerIdentity.memberDevice(
|
|
93
|
+
requesterUserId.slice(memberRequesterPrefix.length)
|
|
94
|
+
);
|
|
95
|
+
if (!device) return denied;
|
|
96
|
+
const result = yield* authorizeAll(
|
|
97
|
+
options.authorizeExecution,
|
|
98
|
+
options.workspaceId,
|
|
99
|
+
device,
|
|
100
|
+
localProjectId ? [localProjectId] : void 0
|
|
101
|
+
);
|
|
102
|
+
if (result._tag !== "Authorized")
|
|
103
|
+
return localProjectId ? { allowed: false, reason: "project_not_shared" } : denied;
|
|
104
|
+
return result.isCurrent?.() === false ? denied : { allowed: true };
|
|
105
|
+
});
|
|
106
|
+
const verifyMachineTarget = fnUntraced(function* (requesterUserId, machineId) {
|
|
107
|
+
const denied = { allowed: false, reason: "not_visible" };
|
|
108
|
+
if (requesterUserId !== options.machineUserId || !options.authorizeMachineTarget) return denied;
|
|
109
|
+
return (yield* options.authorizeMachineTarget(machineId)) ? { allowed: true } : denied;
|
|
110
|
+
});
|
|
111
|
+
const automationEvidence = fnUntraced(function* (input) {
|
|
112
|
+
const verified = yield* options.resolveVerifiedOriginal(
|
|
113
|
+
yield* attempt(() => intentSchema.parse(input))
|
|
114
|
+
);
|
|
115
|
+
if (verified && "state" in verified) return "pending";
|
|
116
|
+
return verified?.requesterDevice === options.selfDevice ? "verified" : "denied";
|
|
117
|
+
});
|
|
68
118
|
const claim = fnUntraced(function* (input) {
|
|
69
119
|
const intent = yield* attempt(() => intentSchema.parse(input));
|
|
70
120
|
if (intent.workspaceId !== options.workspaceId)
|
|
@@ -99,10 +149,14 @@ function makeEncryptedAgentExecution(options) {
|
|
|
99
149
|
}
|
|
100
150
|
if (!verified || !/^[0-9a-f]{64}$/.test(verified.requesterDevice) || !Number.isSafeInteger(verified.expiresAt) || verified.expiresAt < 0)
|
|
101
151
|
return { state: "denied" };
|
|
152
|
+
const config = intent.inputConfig;
|
|
153
|
+
if (config?._lodyAutomation !== void 0 && verified.requesterDevice !== options.selfDevice)
|
|
154
|
+
return { state: "denied" };
|
|
102
155
|
const authorizeExecution = options.authorizeExecution;
|
|
103
156
|
if (!authorizeExecution) return { state: "denied" };
|
|
104
157
|
let authorityDevice = verified.requesterDevice;
|
|
105
158
|
let originKey;
|
|
159
|
+
let originRequester;
|
|
106
160
|
if (verified.derivedFrom) {
|
|
107
161
|
if (!options.selfDevice || verified.requesterDevice !== options.selfDevice || verified.schedule)
|
|
108
162
|
return { state: "denied" };
|
|
@@ -115,6 +169,7 @@ function makeEncryptedAgentExecution(options) {
|
|
|
115
169
|
if ((derivedClaims.get(originKey) ?? 0) >= MAX_DERIVED_TURNS_PER_ORIGIN)
|
|
116
170
|
return { state: "denied" };
|
|
117
171
|
authorityDevice = origin.requesterDevice;
|
|
172
|
+
originRequester = encryptedMemberRequester(origin.requesterCryptoUserId);
|
|
118
173
|
}
|
|
119
174
|
const authorizeTargets = (authorize) => authorizeAll(authorize, intent.workspaceId, authorityDevice, intent.localProjectIds);
|
|
120
175
|
let authorization = yield* authorizeTargets(authorizeExecution);
|
|
@@ -153,6 +208,11 @@ function makeEncryptedAgentExecution(options) {
|
|
|
153
208
|
};
|
|
154
209
|
const executionCurrent = authorization.isCurrent;
|
|
155
210
|
const principal = originKey ? "derived" : authorization.principal === "owner" ? "owner" : "member";
|
|
211
|
+
if (principal !== "owner" && intent.requesterUserId === options.machineUserId)
|
|
212
|
+
return { state: "denied" };
|
|
213
|
+
const expectedRequester = !options.ledgerIdentity ? void 0 : originRequester ?? (verified.requesterDevice === options.selfDevice ? void 0 : principal === "owner" ? options.machineUserId : encryptedMemberRequester(verified.requesterCryptoUserId));
|
|
214
|
+
if (expectedRequester !== void 0 && intent.requesterUserId !== expectedRequester)
|
|
215
|
+
return { state: "denied" };
|
|
156
216
|
return yield* attempt(() => {
|
|
157
217
|
if (options.isExecutionOpen?.() === false || executionCurrent?.() === false || scheduleCurrent?.() === false)
|
|
158
218
|
return { state: "denied" };
|
|
@@ -177,7 +237,16 @@ function makeEncryptedAgentExecution(options) {
|
|
|
177
237
|
const complete = (permit) => attempt(() => {
|
|
178
238
|
options.journal().finish(permit, Buffer.from('{"state":"settled"}'));
|
|
179
239
|
});
|
|
180
|
-
return {
|
|
240
|
+
return {
|
|
241
|
+
claim,
|
|
242
|
+
complete,
|
|
243
|
+
classifyOrigin,
|
|
244
|
+
authorizeAgentControl,
|
|
245
|
+
automationEvidence,
|
|
246
|
+
resolveRequester,
|
|
247
|
+
verifyRequesterAccess,
|
|
248
|
+
verifyMachineTarget
|
|
249
|
+
};
|
|
181
250
|
}
|
|
182
251
|
function lazyExecutionJournal(filename, now) {
|
|
183
252
|
let journal;
|
|
@@ -195,7 +264,8 @@ function lazyExecutionJournal(filename, now) {
|
|
|
195
264
|
};
|
|
196
265
|
}
|
|
197
266
|
export {
|
|
267
|
+
encryptedMemberRequester,
|
|
198
268
|
lazyExecutionJournal,
|
|
199
269
|
makeEncryptedAgentExecution
|
|
200
270
|
};
|
|
201
|
-
//# sourceMappingURL=agent-execution-
|
|
271
|
+
//# sourceMappingURL=agent-execution-DbMHu2MY.js.map
|
|
@@ -472,6 +472,41 @@ var cssDiff = new Diff();
|
|
|
472
472
|
cssDiff.tokenize = function(value) {
|
|
473
473
|
return value.split(/([{}:;,]|\s+)/);
|
|
474
474
|
};
|
|
475
|
+
function ownKeys(e, r) {
|
|
476
|
+
var t = Object.keys(e);
|
|
477
|
+
if (Object.getOwnPropertySymbols) {
|
|
478
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
479
|
+
r && (o = o.filter(function(r2) {
|
|
480
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
481
|
+
})), t.push.apply(t, o);
|
|
482
|
+
}
|
|
483
|
+
return t;
|
|
484
|
+
}
|
|
485
|
+
function _objectSpread2(e) {
|
|
486
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
487
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
488
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
489
|
+
_defineProperty(e, r2, t[r2]);
|
|
490
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
491
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
return e;
|
|
495
|
+
}
|
|
496
|
+
function _toPrimitive(t, r) {
|
|
497
|
+
if ("object" != typeof t || !t) return t;
|
|
498
|
+
var e = t[Symbol.toPrimitive];
|
|
499
|
+
if (void 0 !== e) {
|
|
500
|
+
var i = e.call(t, r);
|
|
501
|
+
if ("object" != typeof i) return i;
|
|
502
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
503
|
+
}
|
|
504
|
+
return ("string" === r ? String : Number)(t);
|
|
505
|
+
}
|
|
506
|
+
function _toPropertyKey(t) {
|
|
507
|
+
var i = _toPrimitive(t, "string");
|
|
508
|
+
return "symbol" == typeof i ? i : i + "";
|
|
509
|
+
}
|
|
475
510
|
function _typeof(o) {
|
|
476
511
|
"@babel/helpers - typeof";
|
|
477
512
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
@@ -480,6 +515,45 @@ function _typeof(o) {
|
|
|
480
515
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
481
516
|
}, _typeof(o);
|
|
482
517
|
}
|
|
518
|
+
function _defineProperty(obj, key, value) {
|
|
519
|
+
key = _toPropertyKey(key);
|
|
520
|
+
if (key in obj) {
|
|
521
|
+
Object.defineProperty(obj, key, {
|
|
522
|
+
value,
|
|
523
|
+
enumerable: true,
|
|
524
|
+
configurable: true,
|
|
525
|
+
writable: true
|
|
526
|
+
});
|
|
527
|
+
} else {
|
|
528
|
+
obj[key] = value;
|
|
529
|
+
}
|
|
530
|
+
return obj;
|
|
531
|
+
}
|
|
532
|
+
function _toConsumableArray(arr) {
|
|
533
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
534
|
+
}
|
|
535
|
+
function _arrayWithoutHoles(arr) {
|
|
536
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
537
|
+
}
|
|
538
|
+
function _iterableToArray(iter) {
|
|
539
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
540
|
+
}
|
|
541
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
542
|
+
if (!o) return;
|
|
543
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
544
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
545
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
546
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
547
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
548
|
+
}
|
|
549
|
+
function _arrayLikeToArray(arr, len) {
|
|
550
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
551
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
552
|
+
return arr2;
|
|
553
|
+
}
|
|
554
|
+
function _nonIterableSpread() {
|
|
555
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
556
|
+
}
|
|
483
557
|
var jsonDiff = new Diff();
|
|
484
558
|
jsonDiff.useLongestToken = true;
|
|
485
559
|
jsonDiff.tokenize = lineDiff.tokenize;
|
|
@@ -548,7 +622,183 @@ arrayDiff.tokenize = function(value) {
|
|
|
548
622
|
arrayDiff.join = arrayDiff.removeEmpty = function(value) {
|
|
549
623
|
return value;
|
|
550
624
|
};
|
|
625
|
+
function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
|
|
626
|
+
if (!options) {
|
|
627
|
+
options = {};
|
|
628
|
+
}
|
|
629
|
+
if (typeof options === "function") {
|
|
630
|
+
options = {
|
|
631
|
+
callback: options
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
if (typeof options.context === "undefined") {
|
|
635
|
+
options.context = 4;
|
|
636
|
+
}
|
|
637
|
+
if (options.newlineIsToken) {
|
|
638
|
+
throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");
|
|
639
|
+
}
|
|
640
|
+
if (!options.callback) {
|
|
641
|
+
return diffLinesResultToPatch(diffLines(oldStr, newStr, options));
|
|
642
|
+
} else {
|
|
643
|
+
var _options = options, _callback = _options.callback;
|
|
644
|
+
diffLines(oldStr, newStr, _objectSpread2(_objectSpread2({}, options), {}, {
|
|
645
|
+
callback: function callback(diff2) {
|
|
646
|
+
var patch = diffLinesResultToPatch(diff2);
|
|
647
|
+
_callback(patch);
|
|
648
|
+
}
|
|
649
|
+
}));
|
|
650
|
+
}
|
|
651
|
+
function diffLinesResultToPatch(diff2) {
|
|
652
|
+
if (!diff2) {
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
diff2.push({
|
|
656
|
+
value: "",
|
|
657
|
+
lines: []
|
|
658
|
+
});
|
|
659
|
+
function contextLines(lines) {
|
|
660
|
+
return lines.map(function(entry) {
|
|
661
|
+
return " " + entry;
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
var hunks = [];
|
|
665
|
+
var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1;
|
|
666
|
+
var _loop = function _loop2() {
|
|
667
|
+
var current = diff2[i], lines = current.lines || splitLines(current.value);
|
|
668
|
+
current.lines = lines;
|
|
669
|
+
if (current.added || current.removed) {
|
|
670
|
+
var _curRange;
|
|
671
|
+
if (!oldRangeStart) {
|
|
672
|
+
var prev = diff2[i - 1];
|
|
673
|
+
oldRangeStart = oldLine;
|
|
674
|
+
newRangeStart = newLine;
|
|
675
|
+
if (prev) {
|
|
676
|
+
curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
|
|
677
|
+
oldRangeStart -= curRange.length;
|
|
678
|
+
newRangeStart -= curRange.length;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
(_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function(entry) {
|
|
682
|
+
return (current.added ? "+" : "-") + entry;
|
|
683
|
+
})));
|
|
684
|
+
if (current.added) {
|
|
685
|
+
newLine += lines.length;
|
|
686
|
+
} else {
|
|
687
|
+
oldLine += lines.length;
|
|
688
|
+
}
|
|
689
|
+
} else {
|
|
690
|
+
if (oldRangeStart) {
|
|
691
|
+
if (lines.length <= options.context * 2 && i < diff2.length - 2) {
|
|
692
|
+
var _curRange2;
|
|
693
|
+
(_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines)));
|
|
694
|
+
} else {
|
|
695
|
+
var _curRange3;
|
|
696
|
+
var contextSize = Math.min(lines.length, options.context);
|
|
697
|
+
(_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize))));
|
|
698
|
+
var _hunk = {
|
|
699
|
+
oldStart: oldRangeStart,
|
|
700
|
+
oldLines: oldLine - oldRangeStart + contextSize,
|
|
701
|
+
newStart: newRangeStart,
|
|
702
|
+
newLines: newLine - newRangeStart + contextSize,
|
|
703
|
+
lines: curRange
|
|
704
|
+
};
|
|
705
|
+
hunks.push(_hunk);
|
|
706
|
+
oldRangeStart = 0;
|
|
707
|
+
newRangeStart = 0;
|
|
708
|
+
curRange = [];
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
oldLine += lines.length;
|
|
712
|
+
newLine += lines.length;
|
|
713
|
+
}
|
|
714
|
+
};
|
|
715
|
+
for (var i = 0; i < diff2.length; i++) {
|
|
716
|
+
_loop();
|
|
717
|
+
}
|
|
718
|
+
for (var _i = 0, _hunks = hunks; _i < _hunks.length; _i++) {
|
|
719
|
+
var hunk = _hunks[_i];
|
|
720
|
+
for (var _i2 = 0; _i2 < hunk.lines.length; _i2++) {
|
|
721
|
+
if (hunk.lines[_i2].endsWith("\n")) {
|
|
722
|
+
hunk.lines[_i2] = hunk.lines[_i2].slice(0, -1);
|
|
723
|
+
} else {
|
|
724
|
+
hunk.lines.splice(_i2 + 1, 0, "\");
|
|
725
|
+
_i2++;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
return {
|
|
730
|
+
oldFileName,
|
|
731
|
+
newFileName,
|
|
732
|
+
oldHeader,
|
|
733
|
+
newHeader,
|
|
734
|
+
hunks
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
function formatPatch(diff2) {
|
|
739
|
+
if (Array.isArray(diff2)) {
|
|
740
|
+
return diff2.map(formatPatch).join("\n");
|
|
741
|
+
}
|
|
742
|
+
var ret = [];
|
|
743
|
+
if (diff2.oldFileName == diff2.newFileName) {
|
|
744
|
+
ret.push("Index: " + diff2.oldFileName);
|
|
745
|
+
}
|
|
746
|
+
ret.push("===================================================================");
|
|
747
|
+
ret.push("--- " + diff2.oldFileName + (typeof diff2.oldHeader === "undefined" ? "" : " " + diff2.oldHeader));
|
|
748
|
+
ret.push("+++ " + diff2.newFileName + (typeof diff2.newHeader === "undefined" ? "" : " " + diff2.newHeader));
|
|
749
|
+
for (var i = 0; i < diff2.hunks.length; i++) {
|
|
750
|
+
var hunk = diff2.hunks[i];
|
|
751
|
+
if (hunk.oldLines === 0) {
|
|
752
|
+
hunk.oldStart -= 1;
|
|
753
|
+
}
|
|
754
|
+
if (hunk.newLines === 0) {
|
|
755
|
+
hunk.newStart -= 1;
|
|
756
|
+
}
|
|
757
|
+
ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@");
|
|
758
|
+
ret.push.apply(ret, hunk.lines);
|
|
759
|
+
}
|
|
760
|
+
return ret.join("\n") + "\n";
|
|
761
|
+
}
|
|
762
|
+
function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
|
|
763
|
+
var _options2;
|
|
764
|
+
if (typeof options === "function") {
|
|
765
|
+
options = {
|
|
766
|
+
callback: options
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
if (!((_options2 = options) !== null && _options2 !== void 0 && _options2.callback)) {
|
|
770
|
+
var patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options);
|
|
771
|
+
if (!patchObj) {
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
return formatPatch(patchObj);
|
|
775
|
+
} else {
|
|
776
|
+
var _options3 = options, _callback2 = _options3.callback;
|
|
777
|
+
structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, _objectSpread2(_objectSpread2({}, options), {}, {
|
|
778
|
+
callback: function callback(patchObj2) {
|
|
779
|
+
if (!patchObj2) {
|
|
780
|
+
_callback2();
|
|
781
|
+
} else {
|
|
782
|
+
_callback2(formatPatch(patchObj2));
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}));
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
function splitLines(text) {
|
|
789
|
+
var hasTrailingNl = text.endsWith("\n");
|
|
790
|
+
var result = text.split("\n").map(function(line) {
|
|
791
|
+
return line + "\n";
|
|
792
|
+
});
|
|
793
|
+
if (hasTrailingNl) {
|
|
794
|
+
result.pop();
|
|
795
|
+
} else {
|
|
796
|
+
result.push(result.pop().slice(0, -1));
|
|
797
|
+
}
|
|
798
|
+
return result;
|
|
799
|
+
}
|
|
551
800
|
export {
|
|
801
|
+
createTwoFilesPatch as c,
|
|
552
802
|
diffLines as d
|
|
553
803
|
};
|
|
554
|
-
//# sourceMappingURL=vendor-diff-
|
|
804
|
+
//# sourceMappingURL=vendor-diff-CPHd5agL.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aN as makeLocalControlClientAuto, aO as classifyLocalDaemonIpcError, aP as LODY_AUTH_URL, aQ as getAuthContextOrThrow, aR as resolveWorkspaceOrThrow, aS as makeLocalWorkspaceCatalog } from "./telemetry-
|
|
1
|
+
import { aN as makeLocalControlClientAuto, aO as classifyLocalDaemonIpcError, aP as LODY_AUTH_URL, aQ as getAuthContextOrThrow, aR as resolveWorkspaceOrThrow, aS as makeLocalWorkspaceCatalog } from "./telemetry-CztoQabb.js";
|
|
2
2
|
import { cz as runPromise, cf as result } from "./chunks/vendor-effect-qEtB86Xz.js";
|
|
3
3
|
import "./chunks/vendor-commander-B86VeeRa.js";
|
|
4
4
|
import "node:events";
|
|
@@ -7,9 +7,9 @@ import "node:path";
|
|
|
7
7
|
import "node:fs";
|
|
8
8
|
import "node:process";
|
|
9
9
|
import "./chunks/commonjs-helpers-CCIqAdii.js";
|
|
10
|
-
import "./ios-simulator-BJjtVdO8.js";
|
|
11
10
|
import "./chunks/vendor-zod-CBWGVFD-.js";
|
|
12
|
-
import "./
|
|
11
|
+
import "./ios-simulator-BJjtVdO8.js";
|
|
12
|
+
import "./code-collab-COUEig0Z.js";
|
|
13
13
|
import "./chunks/vendor-immer-F2vkwr8n.js";
|
|
14
14
|
import "./chunks/vendor-loro-crdt-B0fZaMbx.js";
|
|
15
15
|
import "./chunks/vendor-loro-mirror-g7rEjGgt.js";
|
|
@@ -206,4 +206,4 @@ export {
|
|
|
206
206
|
sendAutomationCommand,
|
|
207
207
|
sendDaemonAutomationCommand
|
|
208
208
|
};
|
|
209
|
-
//# sourceMappingURL=client-
|
|
209
|
+
//# sourceMappingURL=client-CBW0Grpt.js.map
|