@p4code/cli 0.3.16 → 0.3.17
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/bin.mjs +365 -14
- package/dist/client/assets/DiffPanel-CIYbT0lg.js +98 -0
- package/dist/client/assets/{FilePreviewPanel-mtyHoFZm.js → FilePreviewPanel-RYHR9MeT.js} +4 -4
- package/dist/client/assets/PreviewPanel-BCMRNNs6.js +2 -0
- package/dist/client/assets/PullRequestCodeTab-CpTu39fG.js +251 -0
- package/dist/client/assets/{fileCommentAnnotations-C-n_jPm-.js → fileCommentAnnotations-Cf1t6wA_.js} +2 -2
- package/dist/client/assets/{index-D20qAWML.css → index-BnBSxG1R.css} +1 -1
- package/dist/client/assets/index-fI8zbfpx.js +2631 -0
- package/dist/client/assets/previewAssetResource-CfyJZLKk.js +48 -0
- package/dist/client/assets/{renderFileChildren-DbU3SLPY.js → renderFileChildren-C43fM7wm.js} +2 -2
- package/dist/client/assets/{toggle-group-yQrflbtL.js → toggle-group-C2OYSxiH.js} +2 -2
- package/dist/client/index.html +3 -3
- package/package.json +1 -1
- package/dist/client/assets/DiffPanel-BArgAYQw.js +0 -98
- package/dist/client/assets/PreviewPanel-Bt36O31D.js +0 -2
- package/dist/client/assets/PullRequestCodeTab-CmQWQscc.js +0 -251
- package/dist/client/assets/index-H-f1YHA3.js +0 -2626
- package/dist/client/assets/previewAssetResource-Dpr4tPSe.js +0 -48
package/dist/bin.mjs
CHANGED
|
@@ -238,7 +238,7 @@ const make$91 = () => {
|
|
|
238
238
|
const layer$82 = Layer.sync(NetService, make$91);
|
|
239
239
|
//#endregion
|
|
240
240
|
//#region package.json
|
|
241
|
-
var version = "0.3.
|
|
241
|
+
var version = "0.3.17";
|
|
242
242
|
//#endregion
|
|
243
243
|
//#region src/config.ts
|
|
244
244
|
/**
|
|
@@ -2173,11 +2173,46 @@ const OrchestrationSubscribeThreadInput = Schema$1.Struct({
|
|
|
2173
2173
|
* Requests an explicit marker after the subscription has emitted its initial
|
|
2174
2174
|
* snapshot or catch-up replay and before it begins emitting live events.
|
|
2175
2175
|
*/
|
|
2176
|
-
requestCompletionMarker: Schema$1.optionalKey(Schema$1.Boolean)
|
|
2176
|
+
requestCompletionMarker: Schema$1.optionalKey(Schema$1.Boolean),
|
|
2177
|
+
/**
|
|
2178
|
+
* When provided, the fallback snapshot frame (sent when `afterSequence` is
|
|
2179
|
+
* missing or the catch-up gap is too large) is windowed to the last
|
|
2180
|
+
* `turnLimit` user-anchored turns and carries `page` metadata. Absent means
|
|
2181
|
+
* the fallback snapshot is the full thread, preserving pre-pagination client
|
|
2182
|
+
* behavior. Live events are unaffected either way.
|
|
2183
|
+
*/
|
|
2184
|
+
turnLimit: Schema$1.optionalKey(PositiveInt)
|
|
2185
|
+
});
|
|
2186
|
+
Schema$1.Struct({
|
|
2187
|
+
turnLimit: Schema$1.optionalKey(PositiveInt),
|
|
2188
|
+
beforeCursor: Schema$1.optionalKey(TrimmedNonEmptyString)
|
|
2189
|
+
});
|
|
2190
|
+
/**
|
|
2191
|
+
* Page metadata for a windowed thread detail read. `beforeCursor` is opaque and
|
|
2192
|
+
* exclusive: passing it back returns the adjacent disjoint slice of older
|
|
2193
|
+
* turns. `null` means the thread is fully loaded below this page. The
|
|
2194
|
+
* `snapshotSequence` mirrors the top-level snapshot sequence so history pages
|
|
2195
|
+
* can be sequence-checked against live state before merging.
|
|
2196
|
+
*/
|
|
2197
|
+
const OrchestrationThreadDetailPage = Schema$1.Struct({
|
|
2198
|
+
beforeCursor: Schema$1.NullOr(TrimmedNonEmptyString),
|
|
2199
|
+
hasMore: Schema$1.Boolean,
|
|
2200
|
+
snapshotSequence: NonNegativeInt,
|
|
2201
|
+
/**
|
|
2202
|
+
* Highest event sequence applied to THIS thread at page read time. The
|
|
2203
|
+
* global `snapshotSequence` advances with every thread's events, so a
|
|
2204
|
+
* client cannot wait for it via its per-thread subscription; this
|
|
2205
|
+
* thread-scoped watermark is reachable. A client merging an older page
|
|
2206
|
+
* must first have applied live events up to it — otherwise a streaming
|
|
2207
|
+
* turn outside the loaded window could have deltas replayed on top of
|
|
2208
|
+
* page content that already includes them, duplicating text.
|
|
2209
|
+
*/
|
|
2210
|
+
threadSequence: Schema$1.optionalKey(NonNegativeInt)
|
|
2177
2211
|
});
|
|
2178
2212
|
const OrchestrationThreadDetailSnapshot = Schema$1.Struct({
|
|
2179
2213
|
snapshotSequence: NonNegativeInt,
|
|
2180
|
-
thread: OrchestrationThread
|
|
2214
|
+
thread: OrchestrationThread,
|
|
2215
|
+
page: Schema$1.optional(OrchestrationThreadDetailPage)
|
|
2181
2216
|
});
|
|
2182
2217
|
const ProjectCreateCommand = Schema$1.Struct({
|
|
2183
2218
|
type: Schema$1.Literal("project.create"),
|
|
@@ -4709,6 +4744,10 @@ var EnvironmentAuthHttpApi = class extends HttpApiGroup.make("auth").add(HttpApi
|
|
|
4709
4744
|
error: EnvironmentScopedOperationErrors
|
|
4710
4745
|
}).middleware(EnvironmentAuthenticatedAuth)) {};
|
|
4711
4746
|
const EnvironmentOrchestrationThreadSnapshotParams = Schema$1.Struct({ threadId: ThreadId });
|
|
4747
|
+
const EnvironmentOrchestrationThreadSnapshotQuery = {
|
|
4748
|
+
turnLimit: Schema$1.optional(Schema$1.FiniteFromString.check(Schema$1.isInt(), Schema$1.isGreaterThanOrEqualTo(1))),
|
|
4749
|
+
beforeCursor: Schema$1.optional(TrimmedNonEmptyString)
|
|
4750
|
+
};
|
|
4712
4751
|
var EnvironmentOrchestrationHttpApi = class extends HttpApiGroup.make("orchestration").add(HttpApiEndpoint.get("snapshot", "/api/orchestration/snapshot", {
|
|
4713
4752
|
headers: OptionalBearerHeaders,
|
|
4714
4753
|
success: OrchestrationReadModel,
|
|
@@ -4720,6 +4759,7 @@ var EnvironmentOrchestrationHttpApi = class extends HttpApiGroup.make("orchestra
|
|
|
4720
4759
|
}).middleware(EnvironmentAuthenticatedAuth)).add(HttpApiEndpoint.get("threadSnapshot", "/api/orchestration/threads/:threadId", {
|
|
4721
4760
|
headers: OptionalBearerHeaders,
|
|
4722
4761
|
params: EnvironmentOrchestrationThreadSnapshotParams,
|
|
4762
|
+
payload: EnvironmentOrchestrationThreadSnapshotQuery,
|
|
4723
4763
|
success: OrchestrationThreadDetailSnapshot,
|
|
4724
4764
|
error: EnvironmentOrchestrationThreadSnapshotErrors
|
|
4725
4765
|
}).middleware(EnvironmentAuthenticatedAuth)).add(HttpApiEndpoint.post("dispatch", "/api/orchestration/dispatch", {
|
|
@@ -8812,7 +8852,13 @@ const ServerConfig = Schema$1.Struct({
|
|
|
8812
8852
|
/** Whether shell subscriptions can emit an opt-in catch-up completion marker. */
|
|
8813
8853
|
shellResumeCompletionMarker: Schema$1.optionalKey(Schema$1.Boolean),
|
|
8814
8854
|
/** Whether thread subscriptions can emit an opt-in catch-up completion marker. */
|
|
8815
|
-
threadResumeCompletionMarker: Schema$1.optionalKey(Schema$1.Boolean)
|
|
8855
|
+
threadResumeCompletionMarker: Schema$1.optionalKey(Schema$1.Boolean),
|
|
8856
|
+
/**
|
|
8857
|
+
* Whether thread detail reads accept a turn window (`turnLimit`/
|
|
8858
|
+
* `beforeCursor`) and return `page` metadata. Clients must not send window
|
|
8859
|
+
* fields to servers that don't advertise this.
|
|
8860
|
+
*/
|
|
8861
|
+
threadSnapshotPagination: Schema$1.optionalKey(Schema$1.Boolean)
|
|
8816
8862
|
});
|
|
8817
8863
|
const ServerUpsertKeybindingReplaceTarget = Schema$1.Struct({
|
|
8818
8864
|
key: KeybindingValue,
|
|
@@ -15774,6 +15820,21 @@ var _052_CompactHistoricalToolActivities_default = Effect.gen(function* () {
|
|
|
15774
15820
|
`;
|
|
15775
15821
|
});
|
|
15776
15822
|
//#endregion
|
|
15823
|
+
//#region src/persistence/Migrations/053_ProjectionTurnsKeysetIndex.ts
|
|
15824
|
+
/**
|
|
15825
|
+
* Composite index for windowed thread detail reads. Pagination orders turns by
|
|
15826
|
+
* the stable keyset (requested_at, turn_id); the pre-existing
|
|
15827
|
+
* (thread_id, requested_at) index cannot serve the tiebreak order, forcing a
|
|
15828
|
+
* temp B-tree over all of a thread's turns before the page LIMIT applies.
|
|
15829
|
+
* With this index the candidates scan is genuinely bounded by the page size.
|
|
15830
|
+
*/
|
|
15831
|
+
var _053_ProjectionTurnsKeysetIndex_default = Effect.gen(function* () {
|
|
15832
|
+
yield* (yield* SqlClient.SqlClient)`
|
|
15833
|
+
CREATE INDEX IF NOT EXISTS idx_projection_turns_thread_keyset
|
|
15834
|
+
ON projection_turns(thread_id, requested_at, turn_id)
|
|
15835
|
+
`;
|
|
15836
|
+
});
|
|
15837
|
+
//#endregion
|
|
15777
15838
|
//#region src/persistence/Migrations.ts
|
|
15778
15839
|
/**
|
|
15779
15840
|
* MigrationsLive - Migration runner with inline loader
|
|
@@ -16054,6 +16115,11 @@ const migrationEntries = [
|
|
|
16054
16115
|
52,
|
|
16055
16116
|
"CompactHistoricalToolActivities",
|
|
16056
16117
|
_052_CompactHistoricalToolActivities_default
|
|
16118
|
+
],
|
|
16119
|
+
[
|
|
16120
|
+
53,
|
|
16121
|
+
"ProjectionTurnsKeysetIndex",
|
|
16122
|
+
_053_ProjectionTurnsKeysetIndex_default
|
|
16057
16123
|
]
|
|
16058
16124
|
];
|
|
16059
16125
|
const makeMigrationLoader = (throughId) => Migrator.fromRecord(Object.fromEntries(migrationEntries.filter(([id]) => throughId === void 0 || id <= throughId).map(([id, name, migration]) => [`${id}_${name}`, migration])));
|
|
@@ -16562,7 +16628,19 @@ function projectActivityPayload(activity) {
|
|
|
16562
16628
|
if (item) projectedData.item = item;
|
|
16563
16629
|
if ("command" in data) projectedData.command = data.command;
|
|
16564
16630
|
const input = asRecord$6(data.input);
|
|
16565
|
-
if (input
|
|
16631
|
+
if (input) {
|
|
16632
|
+
const projectedInput = {};
|
|
16633
|
+
if ("command" in input) projectedInput.command = input.command;
|
|
16634
|
+
if (payload.itemType === "collab_agent_tool_call") {
|
|
16635
|
+
for (const field of [
|
|
16636
|
+
"description",
|
|
16637
|
+
"prompt",
|
|
16638
|
+
"subagent_type",
|
|
16639
|
+
"model"
|
|
16640
|
+
]) if (field in input) projectedInput[field] = input[field];
|
|
16641
|
+
}
|
|
16642
|
+
if (Object.keys(projectedInput).length > 0) projectedData.input = projectedInput;
|
|
16643
|
+
}
|
|
16566
16644
|
const changedFiles = [];
|
|
16567
16645
|
collectChangedFiles(data, changedFiles, /* @__PURE__ */ new Set(), 0);
|
|
16568
16646
|
if (changedFiles.length > 0) projectedData.files = changedFiles.map((path) => ({ path }));
|
|
@@ -30156,6 +30234,37 @@ Schema$1.Struct({
|
|
|
30156
30234
|
Schema$1.Struct({ threadId: ThreadId });
|
|
30157
30235
|
Context.Service()("@p4code/cli/persistence/Services/ProjectionCheckpoints/ProjectionCheckpointRepository");
|
|
30158
30236
|
//#endregion
|
|
30237
|
+
//#region src/orchestration/threadDetailCursor.ts
|
|
30238
|
+
function encodeThreadDetailPageCursor(cursor) {
|
|
30239
|
+
return Buffer.from(JSON.stringify({
|
|
30240
|
+
t: cursor.threadId,
|
|
30241
|
+
a: cursor.beforeAnchorAt,
|
|
30242
|
+
i: cursor.beforeTurnId
|
|
30243
|
+
})).toString("base64url");
|
|
30244
|
+
}
|
|
30245
|
+
/**
|
|
30246
|
+
* Returns null for anything that is not a well-formed cursor. Callers degrade
|
|
30247
|
+
* a malformed or foreign-thread cursor to a first-page request.
|
|
30248
|
+
*/
|
|
30249
|
+
function decodeThreadDetailPageCursor(encoded) {
|
|
30250
|
+
let parsed;
|
|
30251
|
+
try {
|
|
30252
|
+
parsed = JSON.parse(Buffer.from(encoded, "base64url").toString("utf8"));
|
|
30253
|
+
} catch {
|
|
30254
|
+
return null;
|
|
30255
|
+
}
|
|
30256
|
+
if (parsed === null || typeof parsed !== "object") return null;
|
|
30257
|
+
const record = parsed;
|
|
30258
|
+
if (typeof record.t !== "string" || record.t.length === 0) return null;
|
|
30259
|
+
if (typeof record.a !== "string") return null;
|
|
30260
|
+
if (typeof record.i !== "string") return null;
|
|
30261
|
+
return {
|
|
30262
|
+
threadId: record.t,
|
|
30263
|
+
beforeAnchorAt: record.a,
|
|
30264
|
+
beforeTurnId: record.i
|
|
30265
|
+
};
|
|
30266
|
+
}
|
|
30267
|
+
//#endregion
|
|
30159
30268
|
//#region ../../packages/shared/src/sourceControl.ts
|
|
30160
30269
|
const GITHUB_CHANGE_REQUEST_PRESENTATION = {
|
|
30161
30270
|
icon: "github",
|
|
@@ -30852,6 +30961,24 @@ const ProjectionThreadSearchRow = Schema$1.Struct({
|
|
|
30852
30961
|
const WorkspaceRootLookupInput = Schema$1.Struct({ workspaceRoot: Schema$1.String });
|
|
30853
30962
|
const ProjectIdLookupInput = Schema$1.Struct({ projectId: ProjectId });
|
|
30854
30963
|
const ThreadIdLookupInput = Schema$1.Struct({ threadId: ThreadId });
|
|
30964
|
+
const ThreadTurnWindowLookupInput = Schema$1.Struct({
|
|
30965
|
+
threadId: ThreadId,
|
|
30966
|
+
beforeAnchorAt: Schema$1.String,
|
|
30967
|
+
beforeTurnKey: Schema$1.String,
|
|
30968
|
+
userTurnLimit: Schema$1.Number,
|
|
30969
|
+
maxRawTurns: Schema$1.Number
|
|
30970
|
+
});
|
|
30971
|
+
const ProjectionTurnWindowRowSchema = Schema$1.Struct({
|
|
30972
|
+
anchorAt: Schema$1.String,
|
|
30973
|
+
turnKey: Schema$1.String
|
|
30974
|
+
});
|
|
30975
|
+
const ThreadTurnRangeLookupInput = Schema$1.Struct({
|
|
30976
|
+
threadId: ThreadId,
|
|
30977
|
+
minAnchorAt: Schema$1.String,
|
|
30978
|
+
minTurnKey: Schema$1.String,
|
|
30979
|
+
beforeAnchorAt: Schema$1.String,
|
|
30980
|
+
beforeTurnKey: Schema$1.String
|
|
30981
|
+
});
|
|
30855
30982
|
const ProjectionProjectLookupRowSchema = ProjectionProjectDbRowSchema;
|
|
30856
30983
|
const ProjectionThreadIdLookupRowSchema = Schema$1.Struct({ threadId: ThreadId });
|
|
30857
30984
|
const ProjectionThreadCheckpointContextThreadRowSchema = Schema$1.Struct({
|
|
@@ -31769,6 +31896,115 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
|
|
|
31769
31896
|
LIMIT ${BTW_CONTEXT_MESSAGE_LIMIT}
|
|
31770
31897
|
) AS bounded
|
|
31771
31898
|
ORDER BY created_at ASC, message_id ASC
|
|
31899
|
+
`
|
|
31900
|
+
});
|
|
31901
|
+
const getThreadEventWatermarkRow = SqlSchema.findOneOption({
|
|
31902
|
+
Request: Schema$1.Struct({
|
|
31903
|
+
threadId: ThreadId,
|
|
31904
|
+
maxSequence: Schema$1.Number
|
|
31905
|
+
}),
|
|
31906
|
+
Result: Schema$1.Struct({ threadSequence: Schema$1.NullOr(Schema$1.Number) }),
|
|
31907
|
+
execute: ({ threadId, maxSequence }) => sql`
|
|
31908
|
+
SELECT MAX(sequence) AS "threadSequence"
|
|
31909
|
+
FROM orchestration_events
|
|
31910
|
+
WHERE aggregate_kind = 'thread'
|
|
31911
|
+
AND stream_id = ${threadId}
|
|
31912
|
+
AND sequence <= ${maxSequence}
|
|
31913
|
+
AND event_type IN (
|
|
31914
|
+
'thread.message-sent',
|
|
31915
|
+
'thread.proposed-plan-upserted',
|
|
31916
|
+
'thread.activity-appended',
|
|
31917
|
+
'thread.turn-diff-completed',
|
|
31918
|
+
'thread.reverted',
|
|
31919
|
+
'thread.session-set'
|
|
31920
|
+
)
|
|
31921
|
+
`
|
|
31922
|
+
});
|
|
31923
|
+
const listTurnWindowRows = SqlSchema.findAll({
|
|
31924
|
+
Request: ThreadTurnWindowLookupInput,
|
|
31925
|
+
Result: ProjectionTurnWindowRowSchema,
|
|
31926
|
+
execute: ({ threadId, beforeAnchorAt, beforeTurnKey, userTurnLimit, maxRawTurns }) => sql`
|
|
31927
|
+
WITH candidates AS (
|
|
31928
|
+
SELECT
|
|
31929
|
+
turns.requested_at AS anchor_at,
|
|
31930
|
+
COALESCE(turns.turn_id, '') AS turn_key,
|
|
31931
|
+
turns.pending_message_id
|
|
31932
|
+
FROM projection_turns AS turns
|
|
31933
|
+
WHERE turns.thread_id = ${threadId}
|
|
31934
|
+
AND (
|
|
31935
|
+
turns.requested_at < ${beforeAnchorAt}
|
|
31936
|
+
OR (
|
|
31937
|
+
turns.requested_at = ${beforeAnchorAt}
|
|
31938
|
+
AND COALESCE(turns.turn_id, '') < ${beforeTurnKey}
|
|
31939
|
+
)
|
|
31940
|
+
)
|
|
31941
|
+
ORDER BY turns.requested_at DESC, turns.turn_id DESC
|
|
31942
|
+
LIMIT ${maxRawTurns}
|
|
31943
|
+
),
|
|
31944
|
+
walked AS (
|
|
31945
|
+
SELECT
|
|
31946
|
+
candidates.anchor_at,
|
|
31947
|
+
candidates.turn_key,
|
|
31948
|
+
CASE WHEN messages.role = 'user' THEN 1 ELSE 0 END AS is_user_turn,
|
|
31949
|
+
SUM(CASE WHEN messages.role = 'user' THEN 1 ELSE 0 END) OVER (
|
|
31950
|
+
ORDER BY candidates.anchor_at DESC, candidates.turn_key DESC
|
|
31951
|
+
) AS user_turns_seen
|
|
31952
|
+
FROM candidates
|
|
31953
|
+
LEFT JOIN projection_thread_messages AS messages
|
|
31954
|
+
ON messages.message_id = candidates.pending_message_id
|
|
31955
|
+
)
|
|
31956
|
+
SELECT
|
|
31957
|
+
anchor_at AS "anchorAt",
|
|
31958
|
+
turn_key AS "turnKey"
|
|
31959
|
+
FROM walked
|
|
31960
|
+
WHERE user_turns_seen < ${userTurnLimit}
|
|
31961
|
+
OR (user_turns_seen = ${userTurnLimit} AND is_user_turn = 1)
|
|
31962
|
+
ORDER BY anchor_at ASC, turn_key ASC
|
|
31963
|
+
`
|
|
31964
|
+
});
|
|
31965
|
+
const listThreadMessageRowsByThreadWindow = SqlSchema.findAll({
|
|
31966
|
+
Request: ThreadTurnRangeLookupInput,
|
|
31967
|
+
Result: ProjectionThreadMessageDbRowSchema,
|
|
31968
|
+
execute: ({ threadId, minAnchorAt, minTurnKey, beforeAnchorAt, beforeTurnKey }) => sql`
|
|
31969
|
+
SELECT
|
|
31970
|
+
message_id AS "messageId",
|
|
31971
|
+
thread_id AS "threadId",
|
|
31972
|
+
turn_id AS "turnId",
|
|
31973
|
+
role,
|
|
31974
|
+
text,
|
|
31975
|
+
attachments_json AS "attachments",
|
|
31976
|
+
is_streaming AS "isStreaming",
|
|
31977
|
+
created_at AS "createdAt",
|
|
31978
|
+
updated_at AS "updatedAt"
|
|
31979
|
+
FROM projection_thread_messages
|
|
31980
|
+
WHERE thread_id = ${threadId}
|
|
31981
|
+
AND (
|
|
31982
|
+
turn_id IN (
|
|
31983
|
+
SELECT turn_id FROM projection_turns
|
|
31984
|
+
WHERE thread_id = ${threadId}
|
|
31985
|
+
AND turn_id IS NOT NULL
|
|
31986
|
+
AND (
|
|
31987
|
+
requested_at > ${minAnchorAt}
|
|
31988
|
+
OR (
|
|
31989
|
+
requested_at = ${minAnchorAt}
|
|
31990
|
+
AND turn_id >= ${minTurnKey}
|
|
31991
|
+
)
|
|
31992
|
+
)
|
|
31993
|
+
AND (
|
|
31994
|
+
requested_at < ${beforeAnchorAt}
|
|
31995
|
+
OR (
|
|
31996
|
+
requested_at = ${beforeAnchorAt}
|
|
31997
|
+
AND turn_id < ${beforeTurnKey}
|
|
31998
|
+
)
|
|
31999
|
+
)
|
|
32000
|
+
)
|
|
32001
|
+
OR (
|
|
32002
|
+
turn_id IS NULL
|
|
32003
|
+
AND created_at >= ${minAnchorAt}
|
|
32004
|
+
AND created_at < ${beforeAnchorAt}
|
|
32005
|
+
)
|
|
32006
|
+
)
|
|
32007
|
+
ORDER BY created_at ASC, message_id ASC
|
|
31772
32008
|
`
|
|
31773
32009
|
});
|
|
31774
32010
|
const getBtwThreadRow = SqlSchema.findOneOption({
|
|
@@ -31789,6 +32025,54 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
|
|
|
31789
32025
|
OR projects.deleted_at IS NULL
|
|
31790
32026
|
)
|
|
31791
32027
|
LIMIT 1
|
|
32028
|
+
`
|
|
32029
|
+
});
|
|
32030
|
+
const listThreadActivityRowsByThreadWindow = SqlSchema.findAll({
|
|
32031
|
+
Request: ThreadTurnRangeLookupInput,
|
|
32032
|
+
Result: ProjectionThreadActivityDbRowSchema,
|
|
32033
|
+
execute: ({ threadId, minAnchorAt, minTurnKey, beforeAnchorAt, beforeTurnKey }) => sql`
|
|
32034
|
+
SELECT
|
|
32035
|
+
activity_id AS "activityId",
|
|
32036
|
+
thread_id AS "threadId",
|
|
32037
|
+
turn_id AS "turnId",
|
|
32038
|
+
tone,
|
|
32039
|
+
kind,
|
|
32040
|
+
summary,
|
|
32041
|
+
payload_json AS "payload",
|
|
32042
|
+
sequence,
|
|
32043
|
+
created_at AS "createdAt"
|
|
32044
|
+
FROM projection_thread_activities
|
|
32045
|
+
WHERE thread_id = ${threadId}
|
|
32046
|
+
AND (
|
|
32047
|
+
turn_id IN (
|
|
32048
|
+
SELECT turn_id FROM projection_turns
|
|
32049
|
+
WHERE thread_id = ${threadId}
|
|
32050
|
+
AND turn_id IS NOT NULL
|
|
32051
|
+
AND (
|
|
32052
|
+
requested_at > ${minAnchorAt}
|
|
32053
|
+
OR (
|
|
32054
|
+
requested_at = ${minAnchorAt}
|
|
32055
|
+
AND turn_id >= ${minTurnKey}
|
|
32056
|
+
)
|
|
32057
|
+
)
|
|
32058
|
+
AND (
|
|
32059
|
+
requested_at < ${beforeAnchorAt}
|
|
32060
|
+
OR (
|
|
32061
|
+
requested_at = ${beforeAnchorAt}
|
|
32062
|
+
AND turn_id < ${beforeTurnKey}
|
|
32063
|
+
)
|
|
32064
|
+
)
|
|
32065
|
+
)
|
|
32066
|
+
OR (
|
|
32067
|
+
turn_id IS NULL
|
|
32068
|
+
AND created_at >= ${minAnchorAt}
|
|
32069
|
+
AND created_at < ${beforeAnchorAt}
|
|
32070
|
+
)
|
|
32071
|
+
)
|
|
32072
|
+
ORDER BY
|
|
32073
|
+
sequence ASC,
|
|
32074
|
+
created_at ASC,
|
|
32075
|
+
activity_id ASC
|
|
31792
32076
|
`
|
|
31793
32077
|
});
|
|
31794
32078
|
const getFullThreadDiffContextRow = SqlSchema.findOneOption({
|
|
@@ -32358,12 +32642,18 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
|
|
|
32358
32642
|
scheduledWakeAt: threadRow.value.scheduledWakeAt
|
|
32359
32643
|
});
|
|
32360
32644
|
});
|
|
32361
|
-
const
|
|
32645
|
+
const getThreadDetailByIdBounded = (threadId, bounds) => Effect.gen(function* () {
|
|
32362
32646
|
const [threadRow, messageRows, proposedPlanRows, activityRows, checkpointRows, turnRows, latestTurnRow, sessionRow] = yield* Effect.all([
|
|
32363
32647
|
getActiveThreadRowById({ threadId }).pipe(Effect.mapError(toPersistenceSqlOrDecodeError$1("ProjectionSnapshotQuery.getThreadDetailById:getThread:query", "ProjectionSnapshotQuery.getThreadDetailById:getThread:decodeRow"))),
|
|
32364
|
-
listThreadMessageRowsByThread({ threadId })
|
|
32648
|
+
(bounds === void 0 ? listThreadMessageRowsByThread({ threadId }) : listThreadMessageRowsByThreadWindow({
|
|
32649
|
+
threadId,
|
|
32650
|
+
...bounds
|
|
32651
|
+
})).pipe(Effect.mapError(toPersistenceSqlOrDecodeError$1("ProjectionSnapshotQuery.getThreadDetailById:listMessages:query", "ProjectionSnapshotQuery.getThreadDetailById:listMessages:decodeRows"))),
|
|
32365
32652
|
listThreadProposedPlanRowsByThread({ threadId }).pipe(Effect.mapError(toPersistenceSqlOrDecodeError$1("ProjectionSnapshotQuery.getThreadDetailById:listPlans:query", "ProjectionSnapshotQuery.getThreadDetailById:listPlans:decodeRows"))),
|
|
32366
|
-
listThreadActivityRowsByThread({ threadId })
|
|
32653
|
+
(bounds === void 0 ? listThreadActivityRowsByThread({ threadId }) : listThreadActivityRowsByThreadWindow({
|
|
32654
|
+
threadId,
|
|
32655
|
+
...bounds
|
|
32656
|
+
})).pipe(Effect.mapError(toPersistenceSqlOrDecodeError$1("ProjectionSnapshotQuery.getThreadDetailById:listActivities:query", "ProjectionSnapshotQuery.getThreadDetailById:listActivities:decodeRows"))),
|
|
32367
32657
|
listCheckpointRowsByThread({ threadId }).pipe(Effect.mapError(toPersistenceSqlOrDecodeError$1("ProjectionSnapshotQuery.getThreadDetailById:listCheckpoints:query", "ProjectionSnapshotQuery.getThreadDetailById:listCheckpoints:decodeRows"))),
|
|
32368
32658
|
listTurnSummaryRowsByThread({ threadId }).pipe(Effect.mapError(toPersistenceSqlOrDecodeError$1("ProjectionSnapshotQuery.getThreadDetailById:listTurnSummaries:query", "ProjectionSnapshotQuery.getThreadDetailById:listTurnSummaries:decodeRows"))),
|
|
32369
32659
|
getLatestTurnRowByThread({ threadId }).pipe(Effect.mapError(toPersistenceSqlOrDecodeError$1("ProjectionSnapshotQuery.getThreadDetailById:getLatestTurn:query", "ProjectionSnapshotQuery.getThreadDetailById:getLatestTurn:decodeRow"))),
|
|
@@ -32434,13 +32724,70 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
|
|
|
32434
32724
|
};
|
|
32435
32725
|
return Option.some(yield* decodeThread(thread).pipe(Effect.mapError(toPersistenceDecodeError("ProjectionSnapshotQuery.getThreadDetailById:decodeThread"))));
|
|
32436
32726
|
});
|
|
32437
|
-
const
|
|
32438
|
-
|
|
32727
|
+
const getThreadDetailById = (threadId) => getThreadDetailByIdBounded(threadId, void 0);
|
|
32728
|
+
const THREAD_DETAIL_MAX_RAW_TURNS_PER_PAGE = 150;
|
|
32729
|
+
const ANCHOR_UNBOUNDED = "~";
|
|
32730
|
+
const getThreadDetailSnapshot = (threadId, window) => sql.withTransaction(Effect.gen(function* () {
|
|
32731
|
+
if (window?.turnLimit === void 0) {
|
|
32732
|
+
const thread = yield* getThreadDetailById(threadId);
|
|
32733
|
+
if (Option.isNone(thread)) return Option.none();
|
|
32734
|
+
const { snapshotSequence } = yield* getSnapshotSequence();
|
|
32735
|
+
return Option.some({
|
|
32736
|
+
snapshotSequence,
|
|
32737
|
+
thread: thread.value
|
|
32738
|
+
});
|
|
32739
|
+
}
|
|
32740
|
+
const decodedCursor = window.beforeCursor === void 0 ? null : decodeThreadDetailPageCursor(window.beforeCursor);
|
|
32741
|
+
const cursor = decodedCursor?.threadId === threadId ? decodedCursor : null;
|
|
32742
|
+
const oldest = (yield* listTurnWindowRows({
|
|
32743
|
+
threadId,
|
|
32744
|
+
beforeAnchorAt: cursor?.beforeAnchorAt ?? ANCHOR_UNBOUNDED,
|
|
32745
|
+
beforeTurnKey: cursor?.beforeTurnId ?? "",
|
|
32746
|
+
userTurnLimit: window.turnLimit,
|
|
32747
|
+
maxRawTurns: THREAD_DETAIL_MAX_RAW_TURNS_PER_PAGE
|
|
32748
|
+
}).pipe(Effect.mapError(toPersistenceSqlOrDecodeError$1("ProjectionSnapshotQuery.getThreadDetailSnapshot:listTurnWindow:query", "ProjectionSnapshotQuery.getThreadDetailSnapshot:listTurnWindow:decodeRows"))))[0];
|
|
32749
|
+
const bounds = oldest === void 0 && cursor === null ? void 0 : {
|
|
32750
|
+
minAnchorAt: oldest?.anchorAt ?? "",
|
|
32751
|
+
minTurnKey: oldest?.turnKey ?? "",
|
|
32752
|
+
beforeAnchorAt: cursor?.beforeAnchorAt ?? ANCHOR_UNBOUNDED,
|
|
32753
|
+
beforeTurnKey: cursor?.beforeTurnId ?? ""
|
|
32754
|
+
};
|
|
32755
|
+
const thread = yield* getThreadDetailByIdBounded(threadId, (oldest === void 0 && cursor !== null ? {
|
|
32756
|
+
minAnchorAt: "",
|
|
32757
|
+
minTurnKey: "",
|
|
32758
|
+
beforeAnchorAt: "",
|
|
32759
|
+
beforeTurnKey: ""
|
|
32760
|
+
} : void 0) ?? bounds);
|
|
32439
32761
|
if (Option.isNone(thread)) return Option.none();
|
|
32762
|
+
const hasMore = oldest !== void 0 && (yield* listTurnWindowRows({
|
|
32763
|
+
threadId,
|
|
32764
|
+
beforeAnchorAt: oldest.anchorAt,
|
|
32765
|
+
beforeTurnKey: oldest.turnKey,
|
|
32766
|
+
userTurnLimit: 1,
|
|
32767
|
+
maxRawTurns: 1
|
|
32768
|
+
}).pipe(Effect.mapError(toPersistenceSqlOrDecodeError$1("ProjectionSnapshotQuery.getThreadDetailSnapshot:probeOlder:query", "ProjectionSnapshotQuery.getThreadDetailSnapshot:probeOlder:decodeRows")))).length > 0;
|
|
32440
32769
|
const { snapshotSequence } = yield* getSnapshotSequence();
|
|
32770
|
+
const watermarkRow = yield* getThreadEventWatermarkRow({
|
|
32771
|
+
threadId,
|
|
32772
|
+
maxSequence: snapshotSequence
|
|
32773
|
+
}).pipe(Effect.mapError(toPersistenceSqlOrDecodeError$1("ProjectionSnapshotQuery.getThreadDetailSnapshot:threadWatermark:query", "ProjectionSnapshotQuery.getThreadDetailSnapshot:threadWatermark:decodeRow")));
|
|
32774
|
+
const threadSequence = Option.match(watermarkRow, {
|
|
32775
|
+
onNone: () => 0,
|
|
32776
|
+
onSome: (row) => row.threadSequence ?? 0
|
|
32777
|
+
});
|
|
32441
32778
|
return Option.some({
|
|
32442
32779
|
snapshotSequence,
|
|
32443
|
-
thread: thread.value
|
|
32780
|
+
thread: thread.value,
|
|
32781
|
+
page: {
|
|
32782
|
+
beforeCursor: hasMore && oldest !== void 0 ? encodeThreadDetailPageCursor({
|
|
32783
|
+
threadId,
|
|
32784
|
+
beforeAnchorAt: oldest.anchorAt,
|
|
32785
|
+
beforeTurnId: oldest.turnKey
|
|
32786
|
+
}) : null,
|
|
32787
|
+
hasMore,
|
|
32788
|
+
snapshotSequence,
|
|
32789
|
+
threadSequence
|
|
32790
|
+
}
|
|
32444
32791
|
});
|
|
32445
32792
|
})).pipe(Effect.mapError((error) => isPersistenceError(error) ? error : toPersistenceSqlError("ProjectionSnapshotQuery.getThreadDetailSnapshot:transaction")(error)));
|
|
32446
32793
|
return {
|
|
@@ -63445,7 +63792,8 @@ const makeWsRpcLayer = (currentSession, previewAutomationBroker) => WsRpcGroup.t
|
|
|
63445
63792
|
},
|
|
63446
63793
|
settings,
|
|
63447
63794
|
shellResumeCompletionMarker: true,
|
|
63448
|
-
threadResumeCompletionMarker: true
|
|
63795
|
+
threadResumeCompletionMarker: true,
|
|
63796
|
+
threadSnapshotPagination: true
|
|
63449
63797
|
};
|
|
63450
63798
|
});
|
|
63451
63799
|
const refreshGitStatus = (cwd) => vcsStatusBroadcaster.refreshStatus(cwd).pipe(Effect.ignoreCause({ log: true }), Effect.forkDetach, Effect.asVoid);
|
|
@@ -63561,7 +63909,7 @@ const makeWsRpcLayer = (currentSession, previewAutomationBroker) => WsRpcGroup.t
|
|
|
63561
63909
|
const afterCatchUp = input.requestCompletionMarker === true ? Stream.concat(Stream.fromEffect(Queue.offer(liveBuffer, { kind: "synchronized" })).pipe(Stream.drain), bufferedLiveStream) : bufferedLiveStream;
|
|
63562
63910
|
return Stream.concat(catchUpStream, afterCatchUp);
|
|
63563
63911
|
}
|
|
63564
|
-
const snapshot = yield* projectionSnapshotQuery.getThreadDetailSnapshot(input.threadId).pipe(Effect.mapError((cause) => new OrchestrationGetSnapshotError({
|
|
63912
|
+
const snapshot = yield* projectionSnapshotQuery.getThreadDetailSnapshot(input.threadId, input.turnLimit === void 0 ? void 0 : { turnLimit: input.turnLimit }).pipe(Effect.mapError((cause) => new OrchestrationGetSnapshotError({
|
|
63565
63913
|
message: `Failed to load thread ${input.threadId}`,
|
|
63566
63914
|
cause
|
|
63567
63915
|
})));
|
|
@@ -109784,7 +110132,10 @@ const orchestrationHttpApiLayer = HttpApiBuilder.group(EnvironmentHttpApi, "orch
|
|
|
109784
110132
|
})).handle("threadSnapshot", Effect.fn("environment.orchestration.threadSnapshot")(function* (args) {
|
|
109785
110133
|
yield* annotateEnvironmentRequest(args.endpoint.name);
|
|
109786
110134
|
yield* requireEnvironmentScope(AuthOrchestrationReadScope);
|
|
109787
|
-
const snapshot = yield* projectionSnapshotQuery.getThreadDetailSnapshot(args.params.threadId
|
|
110135
|
+
const snapshot = yield* projectionSnapshotQuery.getThreadDetailSnapshot(args.params.threadId, args.payload.turnLimit === void 0 ? void 0 : {
|
|
110136
|
+
turnLimit: args.payload.turnLimit,
|
|
110137
|
+
...args.payload.beforeCursor !== void 0 ? { beforeCursor: args.payload.beforeCursor } : {}
|
|
110138
|
+
}).pipe(Effect.catch((cause) => failEnvironmentInternal("orchestration_thread_snapshot_failed", cause)));
|
|
109788
110139
|
if (Option.isNone(snapshot)) return yield* failEnvironmentNotFound("thread_not_found");
|
|
109789
110140
|
return projectThreadDetailSnapshot(snapshot.value);
|
|
109790
110141
|
})).handle("dispatch", Effect.fn("environment.orchestration.dispatch")(function* (args) {
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,r as n,t as r}from"./compiler-runtime-CLAvuQ-D.js";import{$c as i,Ca as a,Cl as o,Da as s,Et as c,Fa as ee,Fr as te,Ia as l,La as u,Na as d,Oa as f,Pa as ne,Pl as re,Qc as p,_n as ie,ba as m,cu as h,el as g,gt as _,h as v,ht as y,kl as b,kr as ae,ot as x,tl as S,vl as oe,vt as C,wr as w,x as T,xn as E,zl as se}from"./previewAssetResource-CfyJZLKk.js";import{a as D,i as ce,n as O,o as k,r as A,s as j,t as M}from"./toggle-group-C2OYSxiH.js";import{F as le,Fr as ue,I as de,J as fe,L as pe,Lr as me,Mr as he,Nr as ge,R as N,Sr as _e,Y as ve,_ as ye,at as be,ci as xe,cr as Se,ct as Ce,dr as we,fr as Te,gr as Ee,h as De,it as Oe,jr as ke,lr as Ae,lt as P,mr as je,oi as Me,or as Ne,ot as Pe,pr as Fe,rt as Ie,si as Le,sr as Re,st as ze,ur as Be,zr as Ve}from"./index-fI8zbfpx.js";import{a as He,n as Ue}from"./fileCommentAnnotations-Cf1t6wA_.js";var We=S(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),F=e(n(),1);function Ge({threadRef:e,filePath:t,activeCwd:n,openInEditor:r,openFileSurface:i}){if(e){if(i){i(t);return}x.getState().openFile(e,t);return}r(n?v(t,n):t)}var I=r();function Ke(e,t){let n=(0,I.c)(4),r=Ee(e,t),i;return n[0]!==r.data||n[1]!==r.error||n[2]!==r.isPending?(i={data:r.data,error:r.error,isPending:r.isPending},n[0]=r.data,n[1]=r.error,n[2]=r.isPending,n[3]=i):i=n[3],i}var L=t(),qe=[];function Je(e){return(e.endSide??e.side)===`deletions`?`deletions`:`additions`}function R(e,t,n){let r=Je(t),i=e.findIndex(e=>e.side===r&&e.lineNumber===t.end);return i<0?[...e,{side:r,lineNumber:t.end,metadata:{entries:[n]}}]:e.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,n]}}:e)}function Ye(e){let t=(0,I.c)(50),{files:n,sectionId:r,sectionTitle:i,composerDraftTarget:a,options:o,viewerRef:s,className:c,renderHeaderPrefix:ee}=e,l=w(Qe),u=w(B),d;t[0]===a?d=t[1]:(d=e=>e.getComposerDraft(a)?.reviewComments??qe,t[0]=a,t[1]=d);let f=w(d),[ne,re]=(0,F.useState)(null),[p,ie]=(0,F.useState)(null),m;t[2]===n?m=t[3]:(m=new Map(n.map(Ze)),t[2]=n,t[3]=m);let h=m,g;if(t[4]!==p||t[5]!==n||t[6]!==f||t[7]!==r){let e;t[9]!==p||t[10]!==f||t[11]!==r?(e=e=>{let{fileDiff:t,filePath:n,fileKey:i,collapsed:a}=e,o=f.filter(e=>e.sectionId===r&&e.filePath===n&&(e.fenceLanguage??`diff`)===`diff`).reduce((e,n)=>{let r=te(t,n);return r?R(e,r,{id:n.id,kind:`comment`,range:r,rangeLabel:n.rangeLabel,text:n.text}):e},[]),s=p?.fileKey===i?[...o,p.annotation]:o;return{id:i,type:`diff`,fileDiff:t,annotations:s,collapsed:a,version:Oe(`${a?`1`:`0`}:${s.flatMap(z).join(`:`)}`)}},t[9]=p,t[10]=f,t[11]=r,t[12]=e):e=t[12],g=n.map(e),t[4]=p,t[5]=n,t[6]=f,t[7]=r,t[8]=g}else g=t[8];let _=g,v;t[13]!==a||t[14]!==p?.annotation||t[15]!==u?(v=e=>{re(null),p?.annotation.metadata.entries.some(t=>t.id===e)?ie(null):u(a,e)},t[13]=a,t[14]=p?.annotation,t[15]=u,t[16]=v):v=t[16];let y=v,b;t[17]!==l||t[18]!==a||t[19]!==p||t[20]!==h||t[21]!==r||t[22]!==i?(b=(e,t)=>{let n=p?.annotation.metadata.entries.find(t=>t.id===e),o=p?h.get(p.fileKey):void 0;if(!n||!o)return;let s=ae({id:n.id,sectionId:r,sectionTitle:i,filePath:o.filePath,fileDiff:o.fileDiff,range:n.range,text:t});s&&l(a,s),re(null),ie(null)},t[17]=l,t[18]=a,t[19]=p,t[20]=h,t[21]=r,t[22]=i,t[23]=b):b=t[23];let x=b,S;t[24]!==h||t[25]!==r||t[26]!==i?(S=(e,t)=>{if(!e)return;let n=t.item;if(n.type!==`diff`)return;let a=h.get(n.id);if(!a)return;let o=Ue(),s=ae({id:o,sectionId:r,sectionTitle:i,filePath:a.filePath,fileDiff:a.fileDiff,range:e,text:``});s&&ie({fileKey:n.id,annotation:{side:Je(e),lineNumber:e.end,metadata:{entries:[{id:o,kind:`draft`,range:e,rangeLabel:s.rangeLabel,text:``}]}}})},t[24]=h,t[25]=r,t[26]=i,t[27]=S):S=t[27];let oe=S,C=p!==null,T;t[28]===s?T=t[29]:(T=s?{ref:s}:{},t[28]=s,t[29]=T);let E;t[30]===c?E=t[31]:(E=c?{className:c}:{},t[30]=c,t[31]=E);let se=!C,ce=!C,O;t[32]!==oe||t[33]!==o||t[34]!==ce||t[35]!==se?(O={...o,enableGutterUtility:se,enableLineSelection:ce,onLineSelectionEnd:oe},t[32]=oe,t[33]=o,t[34]=ce,t[35]=se,t[36]=O):O=t[36];let k;t[37]===ee?k=t[38]:(k=e=>e.type===`diff`?ee(e.fileDiff,e.id,e.collapsed===!0):null,t[37]=ee,t[38]=k);let A;t[39]!==y||t[40]!==x?(A=e=>(0,L.jsx)(`div`,{className:`py-1`,children:e.metadata.entries.map(e=>(0,L.jsx)(He,{kind:e.kind,rangeLabel:e.rangeLabel,text:e.text,onCancel:()=>y(e.id),onComment:t=>x(e.id,t),onDelete:()=>y(e.id)},e.id))}),t[39]=y,t[40]=x,t[41]=A):A=t[41];let j;return t[42]!==_||t[43]!==ne||t[44]!==O||t[45]!==k||t[46]!==A||t[47]!==T||t[48]!==E?(j=(0,L.jsx)(D,{...T,...E,items:_,selectedLines:ne,onSelectedLinesChange:re,options:O,renderHeaderPrefix:k,renderAnnotation:A}),t[42]=_,t[43]=ne,t[44]=O,t[45]=k,t[46]=A,t[47]=T,t[48]=E,t[49]=j):j=t[49],j}function z(e){return e.metadata.entries.map(Xe)}function Xe(e){return`${e.id}:${e.rangeLabel}:${e.text}`}function Ze(e){return[e.fileKey,e]}function B(e){return e.removeReviewComment}function Qe(e){return e.addReviewComment}function $e(e){return{diffPreview:o(e,{label:`environment-data:review:diff-preview`,tag:h.reviewGetDiffPreview,staleTimeMs:5e3})}}var et=$e(E);function V(e){return e.remoteName&&e.name.startsWith(`${e.remoteName}/`)?e.name.slice(e.remoteName.length+1):e.name}function tt(e,t){let n=new Set(t),r=e.map(e=>{let r=t.filter(t=>n.has(t)&&V(t)===e.name),i=r.find(e=>e.remoteName===`origin`)??r[0]??null;return i&&n.delete(i),{id:`local:${e.name}`,label:e.name,local:e,remote:i}}),i=t.filter(e=>n.has(e)).map(e=>({id:`remote:${e.name}`,label:e.name,local:null,remote:e}));return[...r,...i]}function nt(e,t){let n=t.trim().toLocaleLowerCase();return n.length===0?e:e.filter(e=>e.label.toLocaleLowerCase().includes(n)||e.local?.name.toLocaleLowerCase().includes(n)===!0||e.remote?.name.toLocaleLowerCase().includes(n)===!0)}var H=`__automatic_base_ref__`,rt=new Set,it=`
|
|
2
|
+
[data-diffs-header],
|
|
3
|
+
[data-diff],
|
|
4
|
+
[data-file],
|
|
5
|
+
[data-error-wrapper],
|
|
6
|
+
[data-virtualizer-buffer] {
|
|
7
|
+
--diffs-header-font-family: var(--font-sans) !important;
|
|
8
|
+
--diffs-font-family: var(--font-mono) !important;
|
|
9
|
+
--diffs-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
|
|
10
|
+
--diffs-light-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
|
|
11
|
+
--diffs-dark-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
|
|
12
|
+
--diffs-token-light-bg: transparent;
|
|
13
|
+
--diffs-token-dark-bg: transparent;
|
|
14
|
+
|
|
15
|
+
--diffs-bg-context-override: color-mix(in srgb, var(--background) 97%, var(--foreground));
|
|
16
|
+
--diffs-bg-hover-override: color-mix(in srgb, var(--background) 94%, var(--foreground));
|
|
17
|
+
--diffs-bg-separator-override: color-mix(in srgb, var(--background) 95%, var(--foreground));
|
|
18
|
+
--diffs-bg-buffer-override: color-mix(in srgb, var(--background) 90%, var(--foreground));
|
|
19
|
+
|
|
20
|
+
--diffs-bg-addition-override: color-mix(in srgb, var(--background) 92%, var(--success));
|
|
21
|
+
--diffs-bg-addition-number-override: color-mix(in srgb, var(--background) 88%, var(--success));
|
|
22
|
+
--diffs-bg-addition-hover-override: color-mix(in srgb, var(--background) 85%, var(--success));
|
|
23
|
+
--diffs-bg-addition-emphasis-override: color-mix(in srgb, var(--background) 80%, var(--success));
|
|
24
|
+
|
|
25
|
+
--diffs-bg-deletion-override: color-mix(in srgb, var(--background) 92%, var(--destructive));
|
|
26
|
+
--diffs-bg-deletion-number-override: color-mix(in srgb, var(--background) 88%, var(--destructive));
|
|
27
|
+
--diffs-bg-deletion-hover-override: color-mix(in srgb, var(--background) 85%, var(--destructive));
|
|
28
|
+
--diffs-bg-deletion-emphasis-override: color-mix(
|
|
29
|
+
in srgb,
|
|
30
|
+
var(--background) 80%,
|
|
31
|
+
var(--destructive)
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
background-color: var(--diffs-bg) !important;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[data-file-info] {
|
|
38
|
+
background-color: color-mix(in srgb, var(--card) 94%, var(--foreground)) !important;
|
|
39
|
+
border-block-color: var(--border) !important;
|
|
40
|
+
color: var(--foreground) !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[data-diffs-header] {
|
|
44
|
+
position: sticky !important;
|
|
45
|
+
top: 0;
|
|
46
|
+
z-index: 4;
|
|
47
|
+
background-color: color-mix(in srgb, var(--card) 94%, var(--foreground)) !important;
|
|
48
|
+
border-bottom: 1px solid var(--border) !important;
|
|
49
|
+
align-items: center !important;
|
|
50
|
+
font-family: var(--font-sans) !important;
|
|
51
|
+
font-size: 12px !important;
|
|
52
|
+
line-height: 1 !important;
|
|
53
|
+
min-height: 32px !important;
|
|
54
|
+
padding-block: 6px !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
[data-diffs-header] [data-header-content] {
|
|
58
|
+
align-items: center !important;
|
|
59
|
+
line-height: 1 !important;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
[data-diffs-header] [data-metadata] {
|
|
63
|
+
align-items: center !important;
|
|
64
|
+
line-height: 1 !important;
|
|
65
|
+
font-variant-numeric: tabular-nums;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
[data-diffs-header] [data-additions-count],
|
|
69
|
+
[data-diffs-header] [data-deletions-count] {
|
|
70
|
+
font-family: var(--font-mono) !important;
|
|
71
|
+
font-size: 11px !important;
|
|
72
|
+
font-variant-numeric: tabular-nums;
|
|
73
|
+
line-height: 1 !important;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
[data-diffs-header] [data-change-icon],
|
|
77
|
+
[data-diffs-header] [data-rename-icon] {
|
|
78
|
+
display: block;
|
|
79
|
+
flex-shrink: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
[data-title] {
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
transition:
|
|
85
|
+
color 120ms ease,
|
|
86
|
+
text-decoration-color 120ms ease;
|
|
87
|
+
text-decoration: underline;
|
|
88
|
+
text-decoration-color: transparent;
|
|
89
|
+
text-underline-offset: 2px;
|
|
90
|
+
font-family: var(--font-sans) !important;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[data-title]:hover {
|
|
94
|
+
color: color-mix(in srgb, var(--foreground) 84%, var(--primary)) !important;
|
|
95
|
+
text-decoration-color: currentColor;
|
|
96
|
+
}
|
|
97
|
+
`;function U({mode:e=`inline`,composerDraftTarget:t,initialGitScope:n,threadRef:r}){let{resolvedTheme:o}=T(),te=ue(),[h]=(0,F.useState)(n),[v,ae]=(0,F.useState)(`stacked`),[x,S]=(0,F.useState)(te.wordWrap),[w,E]=(0,F.useState)(te.diffIgnoreWhitespace),[D,ye]=(0,F.useState)(``),[Ee,Oe]=(0,F.useState)(()=>({scopeKey:null,fileKeys:rt})),He=(0,F.useRef)(null),Ue=r.threadId,I=ge(r),qe=I?.projectId??null,Je=he(I&&qe?{environmentId:I.environmentId,projectId:qe}:null),R=I?.worktreePath??Je?.workspaceRoot,z=oe(ie.configValueAtom(I?.environmentId??null)),Xe=je(I?.environmentId??null,z?.availableEditors??[]),Ze=c(I!=null&&R!=null?ke.status({environmentId:I.environmentId,input:{cwd:R}}):null),B=N(e=>pe(e.byThreadKey,r,h===`unstaged`)),Qe=Ze.data?.isRepo??!0,{turnDiffSummaries:$e,inferredCheckpointTurnCountByTurnId:V}=de(I),U=(0,F.useMemo)(()=>[...$e].toSorted((e,t)=>{let n=e.checkpointTurnCount??V[e.turnId]??0,r=t.checkpointTurnCount??V[t.turnId]??0;return n===r?t.completedAt.localeCompare(e.completedAt):r-n}),[V,$e]);(0,F.useEffect)(()=>{B.kind===`turn`&&N.getState().reconcileTurnSelection(r,U.map(e=>e.turnId))},[B,U,r]);let W=B.kind===`turn`?B.turnId:null,G=B.kind===`unstaged`?`unstaged`:`branch`,K=B.kind===`branch`?B.baseRef:null,at=B.kind===`turn`?B.filePath:null,ot=B.kind===`turn`?B.revealRequestId:0,q=W===null?void 0:U.find(e=>e.turnId===W)??U[0],J=q&&(q.checkpointTurnCount??V[q.turnId]),st=U[0],ct=W===null?G===`unstaged`?`Working tree`:`Branch changes`:q?.turnId===st?.turnId?`Latest turn`:`Turn ${J??`?`}`,lt=q?`turn:${q.turnId}`:G,Y=`${r.environmentId}:${r.threadId}:${lt}`,ut=Ee.scopeKey===Y?Ee.fileKeys:rt,dt=q?`Turn ${J??`?`}`:G===`unstaged`?`Working tree`:`Branch changes`,ft=(0,F.useMemo)(()=>typeof J==`number`?{fromTurnCount:Math.max(0,J-1),toTurnCount:J}:null,[J]),pt=Ke({environmentId:I?.environmentId??null,threadId:Ue,fromTurnCount:ft?.fromTurnCount??null,toTurnCount:ft?.toTurnCount??null,ignoreWhitespace:w,cacheScope:q?`turn:${q.turnId}`:null},{enabled:Qe&&q!==void 0}),mt=c(W===null&&I&&R?et.diffPreview({environmentId:I.environmentId,input:{cwd:R,...K?{baseRef:K}:{},ignoreWhitespace:w}}):null),ht=W===null&&mt.error?.includes(`configured workspace root`)===!0&&z?.cwd!==void 0&&z.cwd!==R,gt=c(ht&&I&&z?et.diffPreview({environmentId:I.environmentId,input:{cwd:z.cwd,...K?{baseRef:K}:{},ignoreWhitespace:w}}):null),X=ht?gt:mt,Z=X.data?.sources.find(e=>e.kind===(G===`unstaged`?`working-tree`:`branch-range`)),_t=c(W===null&&G===`branch`&&I&&X.data?.cwd?ke.listRefs({environmentId:I.environmentId,input:{cwd:X.data.cwd,includeMatchingRemoteRefs:!0,refKind:`local`,...D.trim().length>0?{query:D.trim()}:{},limit:100}}):null),vt=c(W===null&&G===`branch`&&I&&X.data?.cwd?ke.listRefs({environmentId:I.environmentId,input:{cwd:X.data.cwd,includeMatchingRemoteRefs:!0,refKind:`remote`,...D.trim().length>0?{query:D.trim()}:{},limit:100}}):null),yt=tt(_t.data?.refs.filter(e=>e.name!==Z?.headRef)??[],vt.data?.refs??[]),bt=nt(yt,D),xt=e=>K&&K===e.remote?.name?K:e.local?.name??e.remote?.name??e.id,St=[H,...yt.map(xt)],Ct=[...D.trim().length===0?[H]:[],...bt.map(xt)],wt=Z?.diff,Tt=q?pt.data?.diff:wt,Et=!q&&Z?.truncated===!0,Dt=q?pt.isPending:X.isPending,Ot=q?pt.error:X.error,kt=typeof Tt==`string`&&Tt.trim().length===0,Q=(0,F.useMemo)(()=>ze(Tt,`diff-panel:${o}`,{compactPartialHunkOffsets:W===null}),[o,Tt,W]),At=(0,F.useMemo)(()=>!Q||Q.kind!==`files`?[]:Q.files.toSorted((e,t)=>P(e).localeCompare(P(t),void 0,{numeric:!0,sensitivity:`base`})),[Q]),$=(0,F.useMemo)(()=>At.map(e=>{let t=Ie(e);return{fileDiff:e,filePath:P(e),fileKey:t,collapsed:ut.has(t)}}),[ut,At]),jt=(0,F.useMemo)(()=>$.map(e=>e.fileKey),[$]),Mt=A(jt,ut),Nt=(0,F.useMemo)(()=>Pe(At),[At]);(0,F.useEffect)(()=>{if(!at)return;let e=$.find(e=>e.filePath===at);e&&He.current?.scrollTo({type:`item`,id:e.fileKey,align:`start`})},[$,at,ot]);let Pt=le({threadRef:r,workspaceRoot:R??null}),Ft=(0,F.useCallback)(e=>{Ge({threadRef:r,filePath:e,activeCwd:R,openFileSurface:Pt,openInEditor:e=>{(async()=>{let t=await Xe(e);t._tag===`Failure`&&!b(t)&&console.warn(`Failed to open diff file in editor.`,{operation:`open-diff-file`,environmentId:r.environmentId,threadId:r.threadId,...se(re(t))})})()}})},[R,Pt,Xe,r]),It=(0,F.useCallback)(e=>{Oe(t=>{let n=new Set(t.scopeKey===Y?t.fileKeys:[]);return n.has(e)?n.delete(e):n.add(e),{scopeKey:Y,fileKeys:n}})},[Y]),Lt=(0,F.useCallback)(()=>{Oe(e=>{let t=e.scopeKey===Y?e.fileKeys:rt;return{scopeKey:Y,fileKeys:ce(jt,t)}})},[Y,jt]),Rt=e=>{N.getState().selectTurn(r,e)},zt=e=>{N.getState().selectGitScope(r,e)},Bt=e=>{N.getState().selectBranchBaseRef(r,e)};return(0,L.jsx)(ve,{mode:e,header:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3 [-webkit-app-region:no-drag]`,children:[(0,L.jsxs)(a,{children:[(0,L.jsxs)(l,{className:`inline-flex h-6 max-w-full items-center gap-1 rounded-md bg-muted/70 px-2 text-xs font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring`,"aria-label":`Diff scope: ${ct}`,children:[(0,L.jsx)(`span`,{className:`truncate`,children:ct}),(0,L.jsx)(i,{className:`size-3.5 shrink-0 text-muted-foreground`})]}),(0,L.jsxs)(f,{align:`start`,className:`w-60`,children:[(0,L.jsx)(s,{className:W===null&&G===`unstaged`?`bg-foreground/[0.08]`:void 0,onClick:()=>zt(`unstaged`),children:(0,L.jsx)(`span`,{children:`Working tree`})}),(0,L.jsx)(s,{className:W===null&&G===`branch`?`bg-foreground/[0.08]`:void 0,onClick:()=>zt(`branch`),children:(0,L.jsx)(`span`,{children:`Branch changes`})}),(0,L.jsx)(s,{className:W!==null&&q?.turnId===st?.turnId?`bg-foreground/[0.08]`:void 0,onClick:()=>{st&&Rt(st.turnId)},children:(0,L.jsx)(`span`,{children:`Latest turn`})}),(0,L.jsxs)(d,{children:[(0,L.jsx)(ee,{children:`Turn`}),(0,L.jsx)(ne,{className:`w-64`,children:U.map(e=>{let t=e.checkpointTurnCount??V[e.turnId]??`?`;return(0,L.jsxs)(s,{className:e.turnId===q?.turnId?`bg-foreground/[0.08]`:void 0,onClick:()=>Rt(e.turnId),children:[(0,L.jsxs)(`span`,{children:[`Turn `,t]}),(0,L.jsx)(`span`,{className:`ml-auto text-xs tabular-nums text-muted-foreground`,children:_e(e.completedAt,te.timestampFormat)})]},e.turnId)})})]})]})]}),W===null&&G===`branch`&&Z?.baseRef&&(0,L.jsxs)(`div`,{className:`flex min-w-0 max-w-full items-center gap-2 overflow-hidden text-xs text-muted-foreground`,title:`${Z.headRef??`HEAD`} → ${Z.baseRef}`,"aria-label":`Comparing ${Z.headRef??`HEAD`} against ${Z.baseRef}`,children:[(0,L.jsx)(`span`,{className:`min-w-0 max-w-48 truncate`,children:Z.headRef??`HEAD`}),(0,L.jsx)(xe,{className:`size-3.5 shrink-0 opacity-70`}),(0,L.jsxs)(Re,{items:St,filteredItems:Ct,value:K??H,onOpenChange:e=>{e||ye(``)},onValueChange:e=>{e&&Bt(e===H?null:e)},children:[(0,L.jsxs)(Fe,{className:`inline-flex min-w-0 max-w-48 items-center gap-1 overflow-hidden rounded-md px-1.5 py-1 outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,"aria-label":`Change comparison target. Currently ${Z.baseRef}`,children:[(0,L.jsx)(`span`,{className:`min-w-0 truncate`,children:Z.baseRef}),(0,L.jsx)(i,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,L.jsxs)(Te,{align:`start`,className:`w-72 min-w-0 max-w-[calc(100vw-1rem)] overflow-hidden [&>[data-slot=combobox-popup]]:min-w-0 [&>[data-slot=combobox-popup]]:overflow-hidden`,children:[(0,L.jsx)(`div`,{className:`min-w-0 shrink-0 px-3 pt-2.5`,children:(0,L.jsxs)(`div`,{className:`relative -translate-y-px border-b border-border/70 pb-1.5 transition-colors focus-within:border-ring`,children:[(0,L.jsx)(Ve,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1.5 left-0 size-4 shrink-0 text-muted-foreground/55`}),(0,L.jsx)(Ae,{className:`[&_input]:h-6.5 [&_input]:ps-5 [&_input]:font-sans [&_input]:leading-6.5`,inputClassName:`rounded-none bg-transparent text-sm`,placeholder:`Search refs...`,showTrigger:!1,size:`sm`,unstyled:!0,value:D,onChange:e=>ye(e.target.value)})]})}),(0,L.jsxs)(`div`,{className:`grid shrink-0 grid-cols-[1rem_minmax(0,1fr)] items-center gap-2 border-b border-border/70 ps-3 pe-6.5 pt-2 pb-1.5 font-medium text-[10px] text-muted-foreground uppercase tracking-wide`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`}),(0,L.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center`,children:[(0,L.jsx)(`span`,{children:`Branch`}),(0,L.jsx)(`span`,{className:`text-right`,children:`Remote`})]})]}),(0,L.jsx)(Se,{children:`No matching refs.`}),(0,L.jsxs)(we,{className:`max-h-64 min-w-0 overflow-x-hidden`,children:[(0,L.jsx)(Be,{className:`h-8 w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)] py-0`,contentClassName:`w-full min-w-0 overflow-hidden`,value:H,children:(0,L.jsx)(`span`,{className:`block min-w-0 truncate`,children:`Automatic`})}),yt.map(e=>{let t=xt(e),n=e.local!==null&&e.remote!==null,r=e.remote?.name===t;return(0,L.jsx)(Be,{className:`h-8 w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)] py-0`,contentClassName:`w-full min-w-0 overflow-hidden`,value:t,children:(0,L.jsxs)(`div`,{className:`grid w-full min-w-0 grid-cols-[minmax(0,1fr)_2rem] items-center overflow-hidden`,children:[(0,L.jsx)(`span`,{className:`block min-w-0 truncate pe-2`,children:e.label}),n?(0,L.jsx)(`div`,{className:`flex justify-end`,onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,L.jsx)(Ne,{"aria-label":`Use remote version of ${e.label}`,checked:r,className:`[--thumb-size:--spacing(3)]`,onCheckedChange:t=>{let n=t?e.remote?.name:e.local?.name;n&&Bt(n)}})}):e.remote?(0,L.jsx)(`span`,{className:`flex justify-end text-muted-foreground`,title:`Remote only`,children:(0,L.jsx)(g,{"aria-hidden":`true`,className:`size-3`})}):null]})},e.id)})]})]})]})]})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 [-webkit-app-region:no-drag]`,children:[$.length>0&&(0,L.jsx)(De,{additions:Nt.additions,deletions:Nt.deletions,className:`mr-1 text-[11px]`,layout:`inline`}),$.length>0&&(0,L.jsxs)(y,{children:[(0,L.jsx)(C,{render:(0,L.jsx)(m,{type:`button`,size:`icon-xs`,variant:`outline`,"aria-label":Mt?`Expand all files`:`Collapse all files`,onClick:Lt}),children:Mt?(0,L.jsx)(Me,{className:`size-3`}):(0,L.jsx)(Le,{className:`size-3`})}),(0,L.jsx)(_,{side:`top`,children:Mt?`Expand all files`:`Collapse all files`})]}),(0,L.jsxs)(O,{className:`shrink-0`,variant:`outline`,size:`xs`,value:[v],onValueChange:e=>{let t=e[0];(t===`stacked`||t===`split`)&&ae(t)},children:[(0,L.jsx)(M,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,L.jsx)(k,{className:`size-3`})}),(0,L.jsx)(M,{"aria-label":`Split diff view`,value:`split`,children:(0,L.jsx)(j,{className:`size-3`})})]}),(0,L.jsxs)(y,{children:[(0,L.jsx)(C,{render:(0,L.jsx)(M,{"aria-label":x?`Disable diff line wrapping`:`Enable diff line wrapping`,variant:`outline`,size:`xs`,pressed:x,onPressedChange:e=>{S(!!e)}}),children:(0,L.jsx)(me,{className:`size-3`})}),(0,L.jsx)(_,{side:`top`,children:x?`Disable line wrapping`:`Enable line wrapping`})]}),(0,L.jsxs)(y,{children:[(0,L.jsx)(C,{render:(0,L.jsx)(M,{"aria-label":w?`Show whitespace changes`:`Hide whitespace changes`,variant:`outline`,size:`xs`,pressed:w,onPressedChange:e=>{E(!!e)}}),children:(0,L.jsx)(We,{className:`size-3`})}),(0,L.jsx)(_,{side:`top`,children:w?`Show whitespace changes`:`Hide whitespace changes`})]})]})]}),children:I?Qe?W!==null&&U.length===0?(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`No completed turns yet.`}):(0,L.jsx)(L.Fragment,{children:(0,L.jsxs)(`div`,{className:`diff-panel-viewport flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[Et&&(0,L.jsx)(`p`,{className:`shrink-0 border-b border-border/70 bg-muted/40 px-3 py-1.5 text-[11px] text-muted-foreground`,children:`This diff was truncated because it exceeded the preview limit. The changes shown are incomplete.`}),Ot&&!Q&&(0,L.jsx)(`div`,{className:`px-3`,children:(0,L.jsx)(`p`,{className:`mb-2 text-[11px] text-red-500/80`,children:Ot})}),Q?Q.kind===`files`?(0,L.jsx)(`div`,{className:`min-h-0 flex-1`,onClickCapture:e=>{let t=(e.nativeEvent.composedPath?.()??[]).find(e=>e instanceof HTMLElement&&e.hasAttribute(`data-title`))?.textContent?.trim();t&&Ft(t)},children:(0,L.jsx)(Ye,{viewerRef:He,className:`diff-render-surface h-full min-h-0 overflow-auto`,files:$,sectionId:lt,sectionTitle:dt,composerDraftTarget:t,renderHeaderPrefix:(e,t,n)=>{let r=P(e);return(0,L.jsxs)(y,{children:[(0,L.jsx)(C,{render:(0,L.jsx)(`button`,{type:`button`,className:u(`inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-0 transition-colors hover:bg-foreground/10 focus-visible:outline-hidden`,be(e)),"aria-label":n?`Expand ${r}`:`Collapse ${r}`,"aria-expanded":!n,onClick:e=>{e.stopPropagation(),It(t)}}),children:n?(0,L.jsx)(p,{className:`size-4`}):(0,L.jsx)(i,{className:`size-4`})}),(0,L.jsx)(_,{side:`top`,children:n?`Expand diff`:`Collapse diff`})]})},options:{diffStyle:v===`split`?`split`:`unified`,lineDiffType:`none`,overflow:x?`wrap`:`scroll`,theme:Ce(o),themeType:o,unsafeCSS:it,stickyHeaders:!0,itemMetrics:{diffHeaderHeight:33},layout:{paddingTop:0,paddingBottom:8,gap:8}}},Y??lt)}):(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`p`,{className:`text-[11px] text-muted-foreground/75`,children:Q.reason}),(0,L.jsx)(`pre`,{className:u(`max-h-[72vh] rounded-md border border-border/70 bg-background/70 p-3 font-mono text-[11px] leading-relaxed text-muted-foreground/90`,x?`overflow-auto whitespace-pre-wrap wrap-break-word`:`overflow-auto`),children:Q.text})]})}):Dt?(0,L.jsx)(fe,{label:q?`Loading checkpoint diff...`:G===`unstaged`?`Loading working tree diff...`:`Loading branch diff...`}):(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,L.jsx)(`p`,{children:kt?`No net changes in this selection.`:`No patch available for this selection.`})})]})}):(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Turn diffs are unavailable because this project is not a git repository.`}):(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Select a thread to inspect turn diffs.`})})}export{ye as DiffWorkerPoolProvider,U as default};
|
|
98
|
+
//# sourceMappingURL=DiffPanel-CIYbT0lg.js.map
|