@get-bb/plugin-sdk 0.6.80 → 0.6.90
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/README.md +26 -23
- package/bundled-types/bb-plugin-sdk-app.d.ts +1035 -897
- package/bundled-types/bb-plugin-sdk-internal-file-navigation-validation.d.ts +7 -0
- package/bundled-types/bb-plugin-sdk-internal-rpc-query-host.d.ts +7 -0
- package/bundled-types/bb-plugin-sdk-process.d.ts +61 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +45 -21
- package/bundled-types/bb-plugin-sdk-testing.d.ts +11 -0
- package/bundled-types/bb-plugin-sdk.d.ts +1029 -895
- package/dist/app.js +16 -0
- package/dist/host.js +557 -13
- package/dist/index.js +1 -1
- package/dist/internal/file-navigation-validation.js +14 -3
- package/dist/internal/host-policy.js +1 -1
- package/dist/internal/plugin-app-collector.js +11 -3
- package/dist/internal/rpc-query-host.js +307 -445
- package/dist/process.js +694 -0
- package/dist/provider-bridge-acp-next.js +739 -320
- package/dist/provider-bridge-acp.js +739 -320
- package/dist/provider-bridge-testing.js +677 -43
- package/dist/provider-bridge-worker-entry.mjs +534 -66
- package/dist/provider-bridge.js +604 -212
- package/dist/testing/app.js +543 -573
- package/dist/testing/index.js +126 -108
- package/package.json +7 -1
package/dist/testing/app.js
CHANGED
|
@@ -169,14 +169,27 @@ function writeBase(store, collection, id, update) {
|
|
|
169
169
|
collection.base.set(id, next);
|
|
170
170
|
changed(store, collection, [id]);
|
|
171
171
|
}
|
|
172
|
+
function dropAccepted(collection, id, acceptedBefore) {
|
|
173
|
+
let dropped = false;
|
|
174
|
+
collection.layers = collection.layers.filter((layer) => {
|
|
175
|
+
if (layer.acceptedAt === null || layer.acceptedAt >= acceptedBefore || !layer.ids.has(id))
|
|
176
|
+
return true;
|
|
177
|
+
dropped = true;
|
|
178
|
+
layer.ids.delete(id);
|
|
179
|
+
return layer.ids.size > 0;
|
|
180
|
+
});
|
|
181
|
+
return dropped;
|
|
182
|
+
}
|
|
172
183
|
function ingest(store, skeleton, id, item, readStart) {
|
|
173
|
-
const
|
|
184
|
+
const { collection } = skeleton;
|
|
185
|
+
const fresh = readStart > (collection.acknowledgedAt.get(id) ?? -1);
|
|
174
186
|
writeBase(
|
|
175
187
|
store,
|
|
176
|
-
|
|
188
|
+
collection,
|
|
177
189
|
id,
|
|
178
190
|
(current) => skeleton.view.read(item, current, fresh)
|
|
179
191
|
);
|
|
192
|
+
if (dropAccepted(collection, id, readStart)) changed(store, collection, [id]);
|
|
180
193
|
}
|
|
181
194
|
function materializeItem(store, view, item, entity) {
|
|
182
195
|
if (!isObject(item) || !isObject(entity)) return view.render(item, entity);
|
|
@@ -281,6 +294,7 @@ function setSkeleton(store, query, skeleton) {
|
|
|
281
294
|
collection.views.delete(id);
|
|
282
295
|
collection.base.delete(id);
|
|
283
296
|
collection.visible.delete(id);
|
|
297
|
+
dropAccepted(collection, id, Number.POSITIVE_INFINITY);
|
|
284
298
|
}
|
|
285
299
|
}
|
|
286
300
|
}
|
|
@@ -476,44 +490,24 @@ function recordKeyedRead(client, queryKey, startedAt) {
|
|
|
476
490
|
const query = client.getQueryCache().get(client.defaultQueryOptions({ queryKey }).queryHash);
|
|
477
491
|
if (query !== void 0) storeOf(client).receipts.set(query, startedAt);
|
|
478
492
|
}
|
|
479
|
-
function bakeSettledLayers(collection) {
|
|
480
|
-
const baked = /* @__PURE__ */ new Set();
|
|
481
|
-
const pending = /* @__PURE__ */ new Set();
|
|
482
|
-
collection.layers = collection.layers.filter((layer) => {
|
|
483
|
-
const blocked = [...layer.ids].some((id) => pending.has(id));
|
|
484
|
-
if (!layer.settled || blocked) {
|
|
485
|
-
for (const id of layer.ids) pending.add(id);
|
|
486
|
-
return true;
|
|
487
|
-
}
|
|
488
|
-
for (const id of layer.ids) {
|
|
489
|
-
const current = collection.base.get(id);
|
|
490
|
-
if (current !== void 0)
|
|
491
|
-
collection.base.set(id, layer.apply(current, id));
|
|
492
|
-
baked.add(id);
|
|
493
|
-
}
|
|
494
|
-
return false;
|
|
495
|
-
});
|
|
496
|
-
return baked;
|
|
497
|
-
}
|
|
498
493
|
function predictKeyed(client, token, ids, apply) {
|
|
499
494
|
const store = storeOf(client);
|
|
500
495
|
const collection = collectionOf(store, token);
|
|
501
|
-
const layer = { ids, apply,
|
|
496
|
+
const layer = { ids: new Set(ids), apply, acceptedAt: null };
|
|
502
497
|
collection.layers.push(layer);
|
|
503
498
|
changed(store, collection, ids);
|
|
504
|
-
const live = () =>
|
|
499
|
+
const live = () => layer.acceptedAt === null && collection.layers.includes(layer);
|
|
505
500
|
return {
|
|
506
501
|
accept() {
|
|
507
502
|
if (!live()) return;
|
|
508
503
|
const at = tick();
|
|
509
504
|
for (const id of ids) collection.acknowledgedAt.set(id, at);
|
|
510
|
-
layer.
|
|
511
|
-
changed(store, collection, [...ids, ...bakeSettledLayers(collection)]);
|
|
505
|
+
layer.acceptedAt = at;
|
|
512
506
|
},
|
|
513
507
|
remove() {
|
|
514
508
|
if (!live()) return;
|
|
515
509
|
collection.layers = collection.layers.filter((other) => other !== layer);
|
|
516
|
-
changed(store, collection,
|
|
510
|
+
changed(store, collection, ids);
|
|
517
511
|
}
|
|
518
512
|
};
|
|
519
513
|
}
|
|
@@ -1117,7 +1111,7 @@ function createTaggedKeyedQueryOwner(options) {
|
|
|
1117
1111
|
queryFn: () => {
|
|
1118
1112
|
let previous = getTaggedReadData(client, queryKey);
|
|
1119
1113
|
const startedAt = /* @__PURE__ */ new Map();
|
|
1120
|
-
let refresh = !missingOnly &&
|
|
1114
|
+
let refresh = !missingOnly && ![...keys.keys()].some((key) => dirtyKeys.has(key));
|
|
1121
1115
|
missingOnly = false;
|
|
1122
1116
|
const refreshedKeys = /* @__PURE__ */ new Set();
|
|
1123
1117
|
let refreshedAll = false;
|
|
@@ -1126,13 +1120,18 @@ function createTaggedKeyedQueryOwner(options) {
|
|
|
1126
1120
|
const all = refreshAll || refresh;
|
|
1127
1121
|
refresh = false;
|
|
1128
1122
|
const dirty = new Set(dirtyKeys);
|
|
1129
|
-
for (const key of dirty) refreshedKeys.add(key);
|
|
1130
1123
|
refreshedAll ||= all;
|
|
1131
|
-
|
|
1124
|
+
if (all)
|
|
1125
|
+
for (const key of Object.keys(previous?.result ?? {}))
|
|
1126
|
+
dirtyKeys.add(key);
|
|
1132
1127
|
refreshAll = false;
|
|
1133
1128
|
const requested = subscribed.filter(
|
|
1134
1129
|
(key) => all || dirty.has(key) || !Object.hasOwn(previous?.result ?? {}, key)
|
|
1135
1130
|
);
|
|
1131
|
+
for (const key of requested) {
|
|
1132
|
+
refreshedKeys.add(key);
|
|
1133
|
+
dirtyKeys.delete(key);
|
|
1134
|
+
}
|
|
1136
1135
|
readingKeys = new Set(requested);
|
|
1137
1136
|
const started = tick();
|
|
1138
1137
|
try {
|
|
@@ -1149,7 +1148,7 @@ function createTaggedKeyedQueryOwner(options) {
|
|
|
1149
1148
|
}
|
|
1150
1149
|
)
|
|
1151
1150
|
);
|
|
1152
|
-
const retained = (key) => !
|
|
1151
|
+
const retained = (key) => !readingKeys.has(key);
|
|
1153
1152
|
for (const key of requested) startedAt.set(key, started);
|
|
1154
1153
|
previous = {
|
|
1155
1154
|
result: Object.fromEntries([
|
|
@@ -1189,6 +1188,15 @@ function createTaggedKeyedQueryOwner(options) {
|
|
|
1189
1188
|
let stop;
|
|
1190
1189
|
return {
|
|
1191
1190
|
observer,
|
|
1191
|
+
async refetchKeys(requested) {
|
|
1192
|
+
const subscribed = requested.filter((key) => keys.has(key));
|
|
1193
|
+
if (subscribed.length === 0) return;
|
|
1194
|
+
for (const key of subscribed) dirtyKeys.add(key);
|
|
1195
|
+
if (observer.getCurrentResult().isFetching) {
|
|
1196
|
+
restartTaggedRead(observer.getCurrentQuery());
|
|
1197
|
+
}
|
|
1198
|
+
await observer.refetch({ cancelRefetch: false });
|
|
1199
|
+
},
|
|
1192
1200
|
subscribe(requested, listener) {
|
|
1193
1201
|
let added = false;
|
|
1194
1202
|
for (const key of requested) {
|
|
@@ -1196,8 +1204,8 @@ function createTaggedKeyedQueryOwner(options) {
|
|
|
1196
1204
|
keys.set(key, (keys.get(key) ?? 0) + 1);
|
|
1197
1205
|
}
|
|
1198
1206
|
const cached = getTaggedReadData(client, queryKey);
|
|
1199
|
-
const
|
|
1200
|
-
(key) => !Object.hasOwn(cached?.result ?? {}, key)
|
|
1207
|
+
const pending = requested.filter(
|
|
1208
|
+
(key) => dirtyKeys.has(key) || !Object.hasOwn(cached?.result ?? {}, key)
|
|
1201
1209
|
);
|
|
1202
1210
|
if (!stop) missingOnly = cached === void 0;
|
|
1203
1211
|
listeners.add(listener);
|
|
@@ -1206,9 +1214,9 @@ function createTaggedKeyedQueryOwner(options) {
|
|
|
1206
1214
|
for (const notify of listeners) notify();
|
|
1207
1215
|
});
|
|
1208
1216
|
}
|
|
1209
|
-
if (added &&
|
|
1217
|
+
if (added && pending.length > 0) {
|
|
1210
1218
|
if (observer.getCurrentResult().isFetching) {
|
|
1211
|
-
if (readingKeys.size > 0 &&
|
|
1219
|
+
if (readingKeys.size > 0 && pending.some((key) => !readingKeys.has(key)))
|
|
1212
1220
|
restartTaggedRead(observer.getCurrentQuery());
|
|
1213
1221
|
} else {
|
|
1214
1222
|
missingOnly = true;
|
|
@@ -1504,107 +1512,12 @@ var projectExecutionDefaultsSchema = z2.object({
|
|
|
1504
1512
|
permissionMode: permissionModeSchema
|
|
1505
1513
|
});
|
|
1506
1514
|
|
|
1507
|
-
// ../domain/src/
|
|
1515
|
+
// ../domain/src/plugin-id.ts
|
|
1508
1516
|
import { z as z3 } from "zod";
|
|
1509
|
-
var
|
|
1510
|
-
var gitBranchWhitespacePattern = /[ \t]/u;
|
|
1511
|
-
var gitReservedBranchNames = /* @__PURE__ */ new Set([
|
|
1512
|
-
"AUTO_MERGE",
|
|
1513
|
-
"BISECT_HEAD",
|
|
1514
|
-
"CHERRY_PICK_HEAD",
|
|
1515
|
-
"FETCH_HEAD",
|
|
1516
|
-
"HEAD",
|
|
1517
|
-
"MERGE_HEAD",
|
|
1518
|
-
"ORIG_HEAD",
|
|
1519
|
-
"REVERT_HEAD"
|
|
1520
|
-
]);
|
|
1521
|
-
function isValidGitBranchName(name) {
|
|
1522
|
-
const components = name.split("/");
|
|
1523
|
-
return name.length > 0 && name.trim().length > 0 && !name.startsWith("-") && !name.startsWith("/") && name !== "@" && !gitReservedBranchNames.has(name) && !gitBranchForbiddenCharacterPattern.test(name) && !gitBranchWhitespacePattern.test(name) && !name.includes("..") && !name.includes("@{") && !name.includes("//") && !name.endsWith("/") && !name.endsWith(".") && components.every(
|
|
1524
|
-
(component) => component.length > 0 && !component.startsWith(".") && !component.endsWith(".lock")
|
|
1525
|
-
);
|
|
1526
|
-
}
|
|
1527
|
-
var gitBranchNameSchema = z3.string().refine(isValidGitBranchName, { message: "Invalid git branch name" });
|
|
1528
|
-
var gitBranchSelectionSchema = z3.discriminatedUnion("kind", [
|
|
1529
|
-
z3.object({ kind: z3.literal("named"), name: gitBranchNameSchema }),
|
|
1530
|
-
z3.object({ kind: z3.literal("default") })
|
|
1531
|
-
]);
|
|
1532
|
-
var gitCheckoutRefSchema = z3.discriminatedUnion("kind", [
|
|
1533
|
-
z3.object({
|
|
1534
|
-
kind: z3.literal("branch"),
|
|
1535
|
-
branchName: z3.string().min(1),
|
|
1536
|
-
headSha: z3.string().min(1).nullable()
|
|
1537
|
-
}),
|
|
1538
|
-
z3.object({
|
|
1539
|
-
kind: z3.literal("detached"),
|
|
1540
|
-
headSha: z3.string().min(1).nullable()
|
|
1541
|
-
}),
|
|
1542
|
-
z3.object({
|
|
1543
|
-
kind: z3.literal("unborn"),
|
|
1544
|
-
branchName: z3.string().min(1).nullable()
|
|
1545
|
-
}),
|
|
1546
|
-
z3.object({
|
|
1547
|
-
kind: z3.literal("unknown"),
|
|
1548
|
-
reason: z3.string().min(1)
|
|
1549
|
-
})
|
|
1550
|
-
]);
|
|
1551
|
-
var workspaceGitOperationSchema = z3.discriminatedUnion("kind", [
|
|
1552
|
-
z3.object({ kind: z3.literal("none") }),
|
|
1553
|
-
z3.object({
|
|
1554
|
-
kind: z3.literal("merge"),
|
|
1555
|
-
hasConflicts: z3.boolean()
|
|
1556
|
-
}),
|
|
1557
|
-
z3.object({
|
|
1558
|
-
kind: z3.literal("rebase"),
|
|
1559
|
-
hasConflicts: z3.boolean()
|
|
1560
|
-
}),
|
|
1561
|
-
z3.object({
|
|
1562
|
-
kind: z3.literal("cherry-pick"),
|
|
1563
|
-
hasConflicts: z3.boolean()
|
|
1564
|
-
}),
|
|
1565
|
-
z3.object({
|
|
1566
|
-
kind: z3.literal("revert"),
|
|
1567
|
-
hasConflicts: z3.boolean()
|
|
1568
|
-
}),
|
|
1569
|
-
z3.object({
|
|
1570
|
-
kind: z3.literal("unknown"),
|
|
1571
|
-
reason: z3.string().min(1),
|
|
1572
|
-
hasConflicts: z3.boolean()
|
|
1573
|
-
})
|
|
1574
|
-
]);
|
|
1575
|
-
var gitBranchRefClassificationSchema = z3.object({
|
|
1576
|
-
name: z3.string().min(1),
|
|
1577
|
-
kind: z3.enum(["local", "remote", "missing"])
|
|
1578
|
-
});
|
|
1579
|
-
var defaultBranchRelationSchema = z3.enum([
|
|
1580
|
-
"equal",
|
|
1581
|
-
"local-behind",
|
|
1582
|
-
"local-ahead",
|
|
1583
|
-
"diverged",
|
|
1584
|
-
"unknown"
|
|
1585
|
-
]);
|
|
1586
|
-
var gitSourceInspectionSchema = z3.object({
|
|
1587
|
-
checkout: gitCheckoutRefSchema,
|
|
1588
|
-
defaultBranch: z3.string().min(1).nullable(),
|
|
1589
|
-
isWorktree: z3.boolean(),
|
|
1590
|
-
defaultBranchRelation: defaultBranchRelationSchema.nullable(),
|
|
1591
|
-
hasUncommittedChanges: z3.boolean(),
|
|
1592
|
-
operation: workspaceGitOperationSchema,
|
|
1593
|
-
originDefaultBranch: z3.string().min(1).nullable()
|
|
1594
|
-
});
|
|
1595
|
-
var gitBranchOptionsSchema = z3.object({
|
|
1596
|
-
branches: z3.array(z3.string()),
|
|
1597
|
-
branchesTruncated: z3.boolean(),
|
|
1598
|
-
remoteBranches: z3.array(z3.string()),
|
|
1599
|
-
remoteBranchesTruncated: z3.boolean(),
|
|
1600
|
-
selectedBranch: gitBranchRefClassificationSchema.nullable()
|
|
1601
|
-
});
|
|
1602
|
-
var projectSourceCheckoutSchema = gitSourceInspectionSchema.extend(
|
|
1603
|
-
gitBranchOptionsSchema.shape
|
|
1604
|
-
);
|
|
1517
|
+
var pluginIdSchema = z3.string().regex(/^[a-z0-9][a-z0-9-]*$/u);
|
|
1605
1518
|
|
|
1606
1519
|
// ../domain/src/change-kinds.ts
|
|
1607
|
-
import { z as
|
|
1520
|
+
import { z as z17 } from "zod";
|
|
1608
1521
|
|
|
1609
1522
|
// ../domain/src/thread-event-types.ts
|
|
1610
1523
|
import { z as z4 } from "zod";
|
|
@@ -1672,7 +1585,7 @@ var threadEventTypeSchema = z4.string().refine(
|
|
|
1672
1585
|
);
|
|
1673
1586
|
|
|
1674
1587
|
// ../domain/src/thread.ts
|
|
1675
|
-
import { z as
|
|
1588
|
+
import { z as z16 } from "zod";
|
|
1676
1589
|
|
|
1677
1590
|
// ../domain/src/thread-create-origin.ts
|
|
1678
1591
|
import { z as z5 } from "zod";
|
|
@@ -1765,18 +1678,14 @@ var environmentSchema = z6.object({
|
|
|
1765
1678
|
});
|
|
1766
1679
|
|
|
1767
1680
|
// ../domain/src/queued-message.ts
|
|
1768
|
-
import { z as
|
|
1769
|
-
|
|
1770
|
-
// ../domain/src/plugin-id.ts
|
|
1771
|
-
import { z as z7 } from "zod";
|
|
1772
|
-
var pluginIdSchema = z7.string().regex(/^[a-z0-9][a-z0-9-]*$/u);
|
|
1681
|
+
import { z as z9 } from "zod";
|
|
1773
1682
|
|
|
1774
1683
|
// ../domain/src/protocol-ids.ts
|
|
1775
|
-
import { z as
|
|
1776
|
-
var clientTurnRequestIdSchema =
|
|
1684
|
+
import { z as z7 } from "zod";
|
|
1685
|
+
var clientTurnRequestIdSchema = z7.string().regex(/^creq_[23456789abcdefghijkmnpqrstuvwxyz]{10}$/u);
|
|
1777
1686
|
|
|
1778
1687
|
// ../domain/src/system-message.ts
|
|
1779
|
-
import { z as
|
|
1688
|
+
import { z as z8 } from "zod";
|
|
1780
1689
|
var systemMessageKindValues = [
|
|
1781
1690
|
"ownership-assigned",
|
|
1782
1691
|
"ownership-removed",
|
|
@@ -1789,41 +1698,41 @@ var systemMessageKindValues = [
|
|
|
1789
1698
|
"environment-directory-updated",
|
|
1790
1699
|
"unlabeled"
|
|
1791
1700
|
];
|
|
1792
|
-
var systemMessageKindSchema =
|
|
1793
|
-
var systemThreadInterruptedReasonSchema =
|
|
1701
|
+
var systemMessageKindSchema = z8.enum(systemMessageKindValues);
|
|
1702
|
+
var systemThreadInterruptedReasonSchema = z8.enum([
|
|
1794
1703
|
"manual-stop",
|
|
1795
1704
|
"host-daemon-restarted",
|
|
1796
1705
|
"host-removed",
|
|
1797
1706
|
"provider-turn-idle"
|
|
1798
1707
|
]);
|
|
1799
|
-
var childThreadOutcomeSchema =
|
|
1800
|
-
threadId:
|
|
1801
|
-
status:
|
|
1802
|
-
interruption:
|
|
1708
|
+
var childThreadOutcomeSchema = z8.object({
|
|
1709
|
+
threadId: z8.string(),
|
|
1710
|
+
status: z8.enum(["completed", "failed", "interrupted"]),
|
|
1711
|
+
interruption: z8.object({
|
|
1803
1712
|
reason: systemThreadInterruptedReasonSchema,
|
|
1804
|
-
cause:
|
|
1713
|
+
cause: z8.literal("host-connection-lost").optional()
|
|
1805
1714
|
}).optional()
|
|
1806
1715
|
});
|
|
1807
|
-
var systemMessageSubjectSchema =
|
|
1808
|
-
|
|
1809
|
-
kind:
|
|
1810
|
-
threadId:
|
|
1811
|
-
threadName:
|
|
1812
|
-
outcomes:
|
|
1716
|
+
var systemMessageSubjectSchema = z8.discriminatedUnion("kind", [
|
|
1717
|
+
z8.object({
|
|
1718
|
+
kind: z8.literal("thread"),
|
|
1719
|
+
threadId: z8.string(),
|
|
1720
|
+
threadName: z8.string(),
|
|
1721
|
+
outcomes: z8.array(childThreadOutcomeSchema).optional()
|
|
1813
1722
|
}),
|
|
1814
|
-
|
|
1815
|
-
kind:
|
|
1816
|
-
count:
|
|
1817
|
-
outcomes:
|
|
1723
|
+
z8.object({
|
|
1724
|
+
kind: z8.literal("thread-batch"),
|
|
1725
|
+
count: z8.number(),
|
|
1726
|
+
outcomes: z8.array(childThreadOutcomeSchema).optional()
|
|
1818
1727
|
}),
|
|
1819
|
-
|
|
1820
|
-
kind:
|
|
1821
|
-
toolName:
|
|
1822
|
-
suppress:
|
|
1728
|
+
z8.object({
|
|
1729
|
+
kind: z8.literal("tool-call"),
|
|
1730
|
+
toolName: z8.string(),
|
|
1731
|
+
suppress: z8.boolean()
|
|
1823
1732
|
}),
|
|
1824
|
-
|
|
1825
|
-
kind:
|
|
1826
|
-
path:
|
|
1733
|
+
z8.object({
|
|
1734
|
+
kind: z8.literal("directory"),
|
|
1735
|
+
path: z8.string()
|
|
1827
1736
|
})
|
|
1828
1737
|
]);
|
|
1829
1738
|
|
|
@@ -1838,44 +1747,44 @@ var queuedMessageWaitingOnKindValues = [
|
|
|
1838
1747
|
"interaction",
|
|
1839
1748
|
"plugin"
|
|
1840
1749
|
];
|
|
1841
|
-
var queuedMessageWaitingOnKindSchema =
|
|
1750
|
+
var queuedMessageWaitingOnKindSchema = z9.enum(
|
|
1842
1751
|
queuedMessageWaitingOnKindValues
|
|
1843
1752
|
);
|
|
1844
|
-
var queuedMessageWaitHostNameSchema =
|
|
1753
|
+
var queuedMessageWaitHostNameSchema = z9.string().min(1).max(200);
|
|
1845
1754
|
var QUEUED_MESSAGE_WAIT_REASON_MAX_LENGTH = 200;
|
|
1846
|
-
var queuedMessageWaitReasonSchema =
|
|
1847
|
-
var queuedMessageWaitingOnSchema =
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
kind:
|
|
1755
|
+
var queuedMessageWaitReasonSchema = z9.string().min(1).max(QUEUED_MESSAGE_WAIT_REASON_MAX_LENGTH);
|
|
1756
|
+
var queuedMessageWaitingOnSchema = z9.discriminatedUnion("kind", [
|
|
1757
|
+
z9.object({ kind: z9.literal("time") }),
|
|
1758
|
+
z9.object({ kind: z9.literal("thread-busy") }),
|
|
1759
|
+
z9.object({ kind: z9.literal("stopping") }),
|
|
1760
|
+
z9.object({ kind: z9.literal("turn-starting") }),
|
|
1761
|
+
z9.object({ kind: z9.literal("provisioning") }),
|
|
1762
|
+
z9.object({
|
|
1763
|
+
kind: z9.literal("host-offline"),
|
|
1855
1764
|
hostName: queuedMessageWaitHostNameSchema
|
|
1856
1765
|
}),
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
kind:
|
|
1766
|
+
z9.object({ kind: z9.literal("interaction") }),
|
|
1767
|
+
z9.object({
|
|
1768
|
+
kind: z9.literal("plugin"),
|
|
1860
1769
|
pluginId: pluginIdSchema,
|
|
1861
1770
|
reason: queuedMessageWaitReasonSchema
|
|
1862
1771
|
})
|
|
1863
1772
|
]);
|
|
1864
1773
|
var QUEUED_MESSAGE_FAILURE_REASON_MAX_LENGTH = 200;
|
|
1865
|
-
var queuedMessageFailureReasonSchema =
|
|
1774
|
+
var queuedMessageFailureReasonSchema = z9.string().min(1).max(QUEUED_MESSAGE_FAILURE_REASON_MAX_LENGTH);
|
|
1866
1775
|
var QUEUED_MESSAGE_PLUGIN_WAIT_HOLDER_PREFIX = "plugin:";
|
|
1867
|
-
var queuedMessageWaitHolderSchema =
|
|
1776
|
+
var queuedMessageWaitHolderSchema = z9.templateLiteral([
|
|
1868
1777
|
QUEUED_MESSAGE_PLUGIN_WAIT_HOLDER_PREFIX,
|
|
1869
1778
|
pluginIdSchema
|
|
1870
1779
|
]);
|
|
1871
1780
|
var queuedMessagePayloadKindValues = ["inline", "retry"];
|
|
1872
|
-
var queuedMessagePayloadKindSchema =
|
|
1781
|
+
var queuedMessagePayloadKindSchema = z9.enum(
|
|
1873
1782
|
queuedMessagePayloadKindValues
|
|
1874
1783
|
);
|
|
1875
|
-
var queuedMessagePayloadSchema =
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
kind:
|
|
1784
|
+
var queuedMessagePayloadSchema = z9.discriminatedUnion("kind", [
|
|
1785
|
+
z9.object({ kind: z9.literal("inline") }),
|
|
1786
|
+
z9.object({
|
|
1787
|
+
kind: z9.literal("retry"),
|
|
1879
1788
|
/**
|
|
1880
1789
|
* The ORIGINAL request, not the attempt that just failed. Retrying a retry
|
|
1881
1790
|
* re-submits the same original blocks, so this id is carried forward
|
|
@@ -1883,7 +1792,7 @@ var queuedMessagePayloadSchema = z10.discriminatedUnion("kind", [
|
|
|
1883
1792
|
*/
|
|
1884
1793
|
retryOfTurnRequestId: clientTurnRequestIdSchema,
|
|
1885
1794
|
/** Which attempt this row will dispatch: 2 is the first retry. */
|
|
1886
|
-
attempt:
|
|
1795
|
+
attempt: z9.number().int().min(2),
|
|
1887
1796
|
/**
|
|
1888
1797
|
* Why this turn is being retried, in the retrier's words ("Rate limited"),
|
|
1889
1798
|
* as the row's card and `bb thread queue list` render it.
|
|
@@ -1896,13 +1805,13 @@ var queuedMessagePayloadSchema = z10.discriminatedUnion("kind", [
|
|
|
1896
1805
|
reason: queuedMessageWaitReasonSchema
|
|
1897
1806
|
})
|
|
1898
1807
|
]);
|
|
1899
|
-
var queuedMessageSystemNoticeSchema =
|
|
1808
|
+
var queuedMessageSystemNoticeSchema = z9.object({
|
|
1900
1809
|
kind: systemMessageKindSchema,
|
|
1901
1810
|
subject: systemMessageSubjectSchema.nullable()
|
|
1902
1811
|
});
|
|
1903
1812
|
|
|
1904
1813
|
// ../domain/src/queued-message-lifecycle.ts
|
|
1905
|
-
import { z as
|
|
1814
|
+
import { z as z10 } from "zod";
|
|
1906
1815
|
var queuedMessageStateValues = [
|
|
1907
1816
|
"queued",
|
|
1908
1817
|
"scheduled",
|
|
@@ -1911,10 +1820,10 @@ var queuedMessageStateValues = [
|
|
|
1911
1820
|
"failed_exhausted",
|
|
1912
1821
|
"claimed"
|
|
1913
1822
|
];
|
|
1914
|
-
var queuedMessageStateSchema =
|
|
1823
|
+
var queuedMessageStateSchema = z10.enum(queuedMessageStateValues);
|
|
1915
1824
|
|
|
1916
1825
|
// ../domain/src/thread-status.ts
|
|
1917
|
-
import { z as
|
|
1826
|
+
import { z as z11 } from "zod";
|
|
1918
1827
|
var threadStatusValues = [
|
|
1919
1828
|
"pending",
|
|
1920
1829
|
"idle",
|
|
@@ -1923,136 +1832,75 @@ var threadStatusValues = [
|
|
|
1923
1832
|
"stopping",
|
|
1924
1833
|
"error"
|
|
1925
1834
|
];
|
|
1926
|
-
var threadStatusSchema =
|
|
1835
|
+
var threadStatusSchema = z11.enum(threadStatusValues);
|
|
1927
1836
|
|
|
1928
1837
|
// ../domain/src/thread-origin-kind.ts
|
|
1929
|
-
import { z as
|
|
1838
|
+
import { z as z12 } from "zod";
|
|
1930
1839
|
var threadOriginKindValues = ["fork"];
|
|
1931
|
-
var threadOriginKindSchema =
|
|
1840
|
+
var threadOriginKindSchema = z12.enum(threadOriginKindValues);
|
|
1932
1841
|
|
|
1933
1842
|
// ../domain/src/thread-parent-notifications.ts
|
|
1934
|
-
import { z as
|
|
1843
|
+
import { z as z13 } from "zod";
|
|
1935
1844
|
var threadParentNotificationsValues = [
|
|
1936
1845
|
"auto",
|
|
1937
1846
|
"stuck",
|
|
1938
1847
|
"off"
|
|
1939
1848
|
];
|
|
1940
|
-
var threadParentNotificationsSchema =
|
|
1849
|
+
var threadParentNotificationsSchema = z13.enum(
|
|
1941
1850
|
threadParentNotificationsValues
|
|
1942
1851
|
);
|
|
1943
1852
|
|
|
1944
1853
|
// ../domain/src/thread-visibility.ts
|
|
1945
|
-
import { z as
|
|
1854
|
+
import { z as z14 } from "zod";
|
|
1946
1855
|
var threadVisibilityValues = ["visible", "hidden"];
|
|
1947
|
-
var threadVisibilitySchema =
|
|
1856
|
+
var threadVisibilitySchema = z14.enum(threadVisibilityValues);
|
|
1948
1857
|
|
|
1949
1858
|
// ../domain/src/thread-runtime-state.ts
|
|
1950
|
-
import { z as
|
|
1859
|
+
import { z as z15 } from "zod";
|
|
1951
1860
|
var threadRuntimeDisplayStatusValues = [
|
|
1952
1861
|
...threadStatusValues,
|
|
1953
1862
|
"provisioning",
|
|
1954
1863
|
"waiting-for-host"
|
|
1955
1864
|
];
|
|
1956
|
-
var threadRuntimeDisplayStatusSchema =
|
|
1865
|
+
var threadRuntimeDisplayStatusSchema = z15.enum(
|
|
1957
1866
|
threadRuntimeDisplayStatusValues
|
|
1958
1867
|
);
|
|
1959
|
-
var threadRuntimeStateSchema =
|
|
1868
|
+
var threadRuntimeStateSchema = z15.object({
|
|
1960
1869
|
displayStatus: threadRuntimeDisplayStatusSchema
|
|
1961
1870
|
});
|
|
1962
|
-
var threadActivityStateSchema =
|
|
1963
|
-
activeWorkflowCount:
|
|
1964
|
-
activeBackgroundAgentCount:
|
|
1965
|
-
activeBackgroundCommandCount:
|
|
1966
|
-
activePlanModeCount:
|
|
1967
|
-
activeGoalCount:
|
|
1871
|
+
var threadActivityStateSchema = z15.object({
|
|
1872
|
+
activeWorkflowCount: z15.number().int().nonnegative(),
|
|
1873
|
+
activeBackgroundAgentCount: z15.number().int().nonnegative(),
|
|
1874
|
+
activeBackgroundCommandCount: z15.number().int().nonnegative(),
|
|
1875
|
+
activePlanModeCount: z15.number().int().nonnegative(),
|
|
1876
|
+
activeGoalCount: z15.number().int().nonnegative()
|
|
1968
1877
|
});
|
|
1969
1878
|
|
|
1970
1879
|
// ../domain/src/thread.ts
|
|
1971
|
-
var
|
|
1972
|
-
|
|
1973
|
-
"untracked",
|
|
1974
|
-
"dirty_uncommitted",
|
|
1975
|
-
"committed_unmerged",
|
|
1976
|
-
"dirty_and_committed_unmerged"
|
|
1977
|
-
];
|
|
1978
|
-
var workspaceStateSchema = z17.enum(workspaceStateValues);
|
|
1979
|
-
var workspaceFileStatusKindSchema = z17.enum([
|
|
1980
|
-
"M",
|
|
1981
|
-
"A",
|
|
1982
|
-
"D",
|
|
1983
|
-
"R",
|
|
1984
|
-
"C",
|
|
1985
|
-
"U",
|
|
1986
|
-
"??",
|
|
1987
|
-
"?"
|
|
1988
|
-
]);
|
|
1989
|
-
var workspaceFileStatusSchema = z17.object({
|
|
1990
|
-
path: z17.string(),
|
|
1991
|
-
status: workspaceFileStatusKindSchema,
|
|
1992
|
-
insertions: z17.number().nullable(),
|
|
1993
|
-
deletions: z17.number().nullable()
|
|
1994
|
-
});
|
|
1995
|
-
var workspaceCommitSummarySchema = z17.object({
|
|
1996
|
-
sha: z17.string(),
|
|
1997
|
-
shortSha: z17.string(),
|
|
1998
|
-
subject: z17.string(),
|
|
1999
|
-
authorName: z17.string(),
|
|
2000
|
-
authoredAt: z17.number()
|
|
2001
|
-
});
|
|
2002
|
-
var workspaceChangeStatsSchema = z17.object({
|
|
2003
|
-
insertions: z17.number(),
|
|
2004
|
-
deletions: z17.number(),
|
|
2005
|
-
lineStatsComplete: z17.boolean(),
|
|
2006
|
-
fileCount: z17.number().int().nonnegative(),
|
|
2007
|
-
files: z17.array(workspaceFileStatusSchema)
|
|
2008
|
-
});
|
|
2009
|
-
var workspaceWorkingTreeSchema = workspaceChangeStatsSchema.extend({
|
|
2010
|
-
hasUncommittedChanges: z17.boolean(),
|
|
2011
|
-
state: workspaceStateSchema
|
|
2012
|
-
});
|
|
2013
|
-
var workspaceBranchSchema = z17.object({
|
|
2014
|
-
currentBranch: z17.string().nullable(),
|
|
2015
|
-
defaultBranch: z17.string()
|
|
2016
|
-
});
|
|
2017
|
-
var workspaceMergeBaseSchema = workspaceChangeStatsSchema.extend({
|
|
2018
|
-
mergeBaseBranch: z17.string(),
|
|
2019
|
-
baseRef: z17.string().nullable(),
|
|
2020
|
-
aheadCount: z17.number(),
|
|
2021
|
-
behindCount: z17.number(),
|
|
2022
|
-
squashMergeCheckComplete: z17.boolean(),
|
|
2023
|
-
hasCommittedUnmergedChanges: z17.boolean(),
|
|
2024
|
-
commits: z17.array(workspaceCommitSummarySchema)
|
|
2025
|
-
});
|
|
2026
|
-
var workspaceStatusSchema = z17.object({
|
|
2027
|
-
workingTree: workspaceWorkingTreeSchema,
|
|
2028
|
-
checkout: gitCheckoutRefSchema,
|
|
2029
|
-
branch: workspaceBranchSchema,
|
|
2030
|
-
mergeBase: workspaceMergeBaseSchema.nullable()
|
|
2031
|
-
});
|
|
2032
|
-
var threadQueuedMessageSchema = z17.object({
|
|
2033
|
-
id: z17.string(),
|
|
1880
|
+
var threadQueuedMessageSchema = z16.object({
|
|
1881
|
+
id: z16.string(),
|
|
2034
1882
|
origin: threadCreateOriginSchema.nullable(),
|
|
2035
|
-
originPluginId:
|
|
2036
|
-
initiator:
|
|
2037
|
-
senderThreadId:
|
|
1883
|
+
originPluginId: z16.string().nullable(),
|
|
1884
|
+
initiator: z16.enum(["user", "agent", "system"]),
|
|
1885
|
+
senderThreadId: z16.string().nullable(),
|
|
2038
1886
|
/**
|
|
2039
1887
|
* The thread this row is waiting on. Redundant on the thread-scoped list
|
|
2040
1888
|
* route that first served this DTO, and load-bearing everywhere else it is
|
|
2041
1889
|
* now served: a `queue.*` plugin event and a cross-thread wait-holder query
|
|
2042
1890
|
* both hand out rows with no surrounding thread to read it from.
|
|
2043
1891
|
*/
|
|
2044
|
-
threadId:
|
|
2045
|
-
content:
|
|
2046
|
-
model:
|
|
1892
|
+
threadId: z16.string(),
|
|
1893
|
+
content: z16.array(promptInputSchema).min(1),
|
|
1894
|
+
model: z16.string().min(1),
|
|
2047
1895
|
reasoningLevel: reasoningLevelSchema,
|
|
2048
1896
|
permissionMode: permissionModeSchema,
|
|
2049
1897
|
serviceTier: serviceTierSchema,
|
|
2050
|
-
groupWithNext:
|
|
1898
|
+
groupWithNext: z16.boolean(),
|
|
2051
1899
|
/**
|
|
2052
1900
|
* Epoch ms this row is scheduled to attempt dispatch, or null when it is
|
|
2053
1901
|
* eligible as soon as its other waits clear.
|
|
2054
1902
|
*/
|
|
2055
|
-
sendAt:
|
|
1903
|
+
sendAt: z16.number().int().nonnegative().nullable(),
|
|
2056
1904
|
state: queuedMessageStateSchema,
|
|
2057
1905
|
/**
|
|
2058
1906
|
* Why this row is queued, or null for a `queued` row that is simply next in
|
|
@@ -2080,50 +1928,50 @@ var threadQueuedMessageSchema = z17.object({
|
|
|
2080
1928
|
* not something a client should reason about. The server folds both into
|
|
2081
1929
|
* this one answer.
|
|
2082
1930
|
*/
|
|
2083
|
-
editable:
|
|
2084
|
-
createdAt:
|
|
2085
|
-
updatedAt:
|
|
1931
|
+
editable: z16.boolean(),
|
|
1932
|
+
createdAt: z16.number(),
|
|
1933
|
+
updatedAt: z16.number()
|
|
2086
1934
|
});
|
|
2087
|
-
var threadSchema =
|
|
2088
|
-
id:
|
|
2089
|
-
projectId:
|
|
2090
|
-
environmentId:
|
|
2091
|
-
providerId:
|
|
2092
|
-
title:
|
|
2093
|
-
titleFallback:
|
|
2094
|
-
sectionId:
|
|
1935
|
+
var threadSchema = z16.object({
|
|
1936
|
+
id: z16.string(),
|
|
1937
|
+
projectId: z16.string(),
|
|
1938
|
+
environmentId: z16.string().nullable(),
|
|
1939
|
+
providerId: z16.string(),
|
|
1940
|
+
title: z16.string().nullable(),
|
|
1941
|
+
titleFallback: z16.string().nullable(),
|
|
1942
|
+
sectionId: z16.string().nullable(),
|
|
2095
1943
|
status: threadStatusSchema,
|
|
2096
|
-
parentThreadId:
|
|
2097
|
-
lifecycleOwnerThreadId:
|
|
2098
|
-
sourceThreadId:
|
|
1944
|
+
parentThreadId: z16.string().nullable(),
|
|
1945
|
+
lifecycleOwnerThreadId: z16.string().nullable(),
|
|
1946
|
+
sourceThreadId: z16.string().nullable(),
|
|
2099
1947
|
originKind: threadOriginKindSchema.nullable(),
|
|
2100
|
-
originPluginId:
|
|
1948
|
+
originPluginId: z16.string().nullable(),
|
|
2101
1949
|
visibility: threadVisibilitySchema,
|
|
2102
1950
|
parentNotifications: threadParentNotificationsSchema,
|
|
2103
|
-
archivedAt:
|
|
2104
|
-
pinnedAt:
|
|
2105
|
-
deletedAt:
|
|
2106
|
-
lastReadAt:
|
|
2107
|
-
latestAttentionAt:
|
|
2108
|
-
createdAt:
|
|
2109
|
-
updatedAt:
|
|
1951
|
+
archivedAt: z16.number().nullable(),
|
|
1952
|
+
pinnedAt: z16.number().nullable(),
|
|
1953
|
+
deletedAt: z16.number().nullable(),
|
|
1954
|
+
lastReadAt: z16.number().nullable(),
|
|
1955
|
+
latestAttentionAt: z16.number(),
|
|
1956
|
+
createdAt: z16.number(),
|
|
1957
|
+
updatedAt: z16.number()
|
|
2110
1958
|
});
|
|
2111
1959
|
var threadWithRuntimeSchema = threadSchema.extend({
|
|
2112
1960
|
runtime: threadRuntimeStateSchema
|
|
2113
1961
|
});
|
|
2114
1962
|
var threadQueuedWorkValues = ["none", "waiting", "failed"];
|
|
2115
|
-
var threadQueuedWorkSchema =
|
|
1963
|
+
var threadQueuedWorkSchema = z16.enum(threadQueuedWorkValues);
|
|
2116
1964
|
var threadListEntrySchema = threadWithRuntimeSchema.extend({
|
|
2117
1965
|
activity: threadActivityStateSchema,
|
|
2118
1966
|
queuedWork: threadQueuedWorkSchema,
|
|
2119
|
-
pinSortKey:
|
|
2120
|
-
hasPendingInteraction:
|
|
2121
|
-
environmentHostId:
|
|
2122
|
-
environmentName:
|
|
2123
|
-
environmentBranchName:
|
|
2124
|
-
environmentPath:
|
|
2125
|
-
environmentProviderId:
|
|
2126
|
-
environmentIsWorktree:
|
|
1967
|
+
pinSortKey: z16.string().nullable(),
|
|
1968
|
+
hasPendingInteraction: z16.boolean(),
|
|
1969
|
+
environmentHostId: z16.string().nullable(),
|
|
1970
|
+
environmentName: z16.string().nullable(),
|
|
1971
|
+
environmentBranchName: z16.string().nullable(),
|
|
1972
|
+
environmentPath: z16.string().nullable(),
|
|
1973
|
+
environmentProviderId: z16.string().nullable(),
|
|
1974
|
+
environmentIsWorktree: z16.boolean().nullable(),
|
|
2127
1975
|
environmentWorkspaceDisplayKind: environmentWorkspaceDisplayKindSchema
|
|
2128
1976
|
});
|
|
2129
1977
|
|
|
@@ -2167,7 +2015,8 @@ var ENVIRONMENT_CHANGE_KINDS = [
|
|
|
2167
2015
|
var HOST_CHANGE_KINDS = [
|
|
2168
2016
|
"host-connected",
|
|
2169
2017
|
"host-disconnected",
|
|
2170
|
-
"provider-model-catalog-changed"
|
|
2018
|
+
"provider-model-catalog-changed",
|
|
2019
|
+
"provider-commands-changed"
|
|
2171
2020
|
];
|
|
2172
2021
|
var SYSTEM_CHANGE_KINDS = [
|
|
2173
2022
|
"config-changed",
|
|
@@ -2179,16 +2028,16 @@ var SYSTEM_CHANGE_KINDS = [
|
|
|
2179
2028
|
"server-move-changed",
|
|
2180
2029
|
"app-update-changed"
|
|
2181
2030
|
];
|
|
2182
|
-
var threadChangeKindSchema =
|
|
2183
|
-
var projectChangeKindSchema =
|
|
2184
|
-
var environmentChangeKindSchema =
|
|
2185
|
-
var hostChangeKindSchema =
|
|
2186
|
-
var systemChangeKindSchema =
|
|
2187
|
-
var threadTimelineSubscriptionTargetSchema =
|
|
2188
|
-
kind:
|
|
2189
|
-
threadId:
|
|
2190
|
-
segmentLimit:
|
|
2191
|
-
deferContent:
|
|
2031
|
+
var threadChangeKindSchema = z17.enum(THREAD_CHANGE_KINDS);
|
|
2032
|
+
var projectChangeKindSchema = z17.enum(PROJECT_CHANGE_KINDS);
|
|
2033
|
+
var environmentChangeKindSchema = z17.enum(ENVIRONMENT_CHANGE_KINDS);
|
|
2034
|
+
var hostChangeKindSchema = z17.enum(HOST_CHANGE_KINDS);
|
|
2035
|
+
var systemChangeKindSchema = z17.enum(SYSTEM_CHANGE_KINDS);
|
|
2036
|
+
var threadTimelineSubscriptionTargetSchema = z17.object({
|
|
2037
|
+
kind: z17.literal("thread-timeline"),
|
|
2038
|
+
threadId: z17.string().min(1),
|
|
2039
|
+
segmentLimit: z17.number().int().positive().nullable(),
|
|
2040
|
+
deferContent: z17.boolean()
|
|
2192
2041
|
}).strict();
|
|
2193
2042
|
function canonicalPluginReadInput(value) {
|
|
2194
2043
|
if (value === null || typeof value !== "object") return JSON.stringify(value);
|
|
@@ -2198,62 +2047,62 @@ function canonicalPluginReadInput(value) {
|
|
|
2198
2047
|
(key) => `${JSON.stringify(key)}:${canonicalPluginReadInput(value[key])}`
|
|
2199
2048
|
).join(",")}}`;
|
|
2200
2049
|
}
|
|
2201
|
-
var pluginReadSubscriptionTargetSchema =
|
|
2202
|
-
kind:
|
|
2203
|
-
pluginId:
|
|
2204
|
-
method:
|
|
2205
|
-
read:
|
|
2206
|
-
|
|
2207
|
-
|
|
2050
|
+
var pluginReadSubscriptionTargetSchema = z17.object({
|
|
2051
|
+
kind: z17.literal("plugin-read"),
|
|
2052
|
+
pluginId: z17.string().min(1),
|
|
2053
|
+
method: z17.string().min(1),
|
|
2054
|
+
read: z17.union([
|
|
2055
|
+
z17.object({ input: jsonValueSchema }).strict(),
|
|
2056
|
+
z17.object({ key: z17.string() }).strict()
|
|
2208
2057
|
]).refine(
|
|
2209
2058
|
(read) => new TextEncoder().encode(canonicalPluginReadInput(read)).byteLength <= 16384,
|
|
2210
2059
|
"Plugin read input exceeds 16 KiB"
|
|
2211
2060
|
)
|
|
2212
2061
|
}).strict();
|
|
2213
|
-
var realtimeSubscriptionTargetSchema =
|
|
2062
|
+
var realtimeSubscriptionTargetSchema = z17.discriminatedUnion("kind", [
|
|
2214
2063
|
pluginReadSubscriptionTargetSchema,
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
kind:
|
|
2218
|
-
threadId:
|
|
2064
|
+
z17.object({ kind: z17.literal("plugin"), pluginId: z17.string().min(1) }).strict(),
|
|
2065
|
+
z17.object({
|
|
2066
|
+
kind: z17.literal("thread-detail"),
|
|
2067
|
+
threadId: z17.string().min(1)
|
|
2219
2068
|
}).strict(),
|
|
2220
2069
|
threadTimelineSubscriptionTargetSchema,
|
|
2221
|
-
|
|
2222
|
-
kind:
|
|
2070
|
+
z17.object({
|
|
2071
|
+
kind: z17.literal("thread-list")
|
|
2223
2072
|
}).strict(),
|
|
2224
|
-
|
|
2225
|
-
kind:
|
|
2226
|
-
projectId:
|
|
2073
|
+
z17.object({
|
|
2074
|
+
kind: z17.literal("project-detail"),
|
|
2075
|
+
projectId: z17.string().min(1)
|
|
2227
2076
|
}).strict(),
|
|
2228
|
-
|
|
2229
|
-
kind:
|
|
2077
|
+
z17.object({
|
|
2078
|
+
kind: z17.literal("project-list")
|
|
2230
2079
|
}).strict(),
|
|
2231
|
-
|
|
2232
|
-
kind:
|
|
2233
|
-
environmentId:
|
|
2080
|
+
z17.object({
|
|
2081
|
+
kind: z17.literal("environment-detail"),
|
|
2082
|
+
environmentId: z17.string().min(1)
|
|
2234
2083
|
}).strict(),
|
|
2235
|
-
|
|
2236
|
-
kind:
|
|
2084
|
+
z17.object({
|
|
2085
|
+
kind: z17.literal("environment-list")
|
|
2237
2086
|
}).strict(),
|
|
2238
|
-
|
|
2239
|
-
kind:
|
|
2240
|
-
hostId:
|
|
2087
|
+
z17.object({
|
|
2088
|
+
kind: z17.literal("host-detail"),
|
|
2089
|
+
hostId: z17.string().min(1)
|
|
2241
2090
|
}).strict(),
|
|
2242
|
-
|
|
2243
|
-
kind:
|
|
2091
|
+
z17.object({
|
|
2092
|
+
kind: z17.literal("host-list")
|
|
2244
2093
|
}).strict(),
|
|
2245
|
-
|
|
2246
|
-
kind:
|
|
2094
|
+
z17.object({
|
|
2095
|
+
kind: z17.literal("system")
|
|
2247
2096
|
}).strict()
|
|
2248
2097
|
]);
|
|
2249
2098
|
function isValidSubscriptionTarget(value) {
|
|
2250
2099
|
return realtimeSubscriptionTargetSchema.safeParse(value).success;
|
|
2251
2100
|
}
|
|
2252
|
-
var validSubscriptionTargetsSchema =
|
|
2101
|
+
var validSubscriptionTargetsSchema = z17.preprocess(
|
|
2253
2102
|
(value) => Array.isArray(value) ? value.filter(isValidSubscriptionTarget) : value,
|
|
2254
|
-
|
|
2103
|
+
z17.array(realtimeSubscriptionTargetSchema)
|
|
2255
2104
|
);
|
|
2256
|
-
var validSubscriptionTargetSchema =
|
|
2105
|
+
var validSubscriptionTargetSchema = z17.preprocess(
|
|
2257
2106
|
(value) => value === void 0 || isValidSubscriptionTarget(value) ? value : null,
|
|
2258
2107
|
realtimeSubscriptionTargetSchema.nullable().optional()
|
|
2259
2108
|
);
|
|
@@ -2262,84 +2111,88 @@ var subscriptionFields = {
|
|
|
2262
2111
|
targets: validSubscriptionTargetsSchema.optional()
|
|
2263
2112
|
};
|
|
2264
2113
|
var hasSubscriptionTargets = (value) => value.target !== void 0 !== (value.targets !== void 0);
|
|
2265
|
-
var subscribeMessageSchema =
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2114
|
+
var subscribeMessageSchema = z17.object({
|
|
2115
|
+
type: z17.literal("subscribe"),
|
|
2116
|
+
...subscriptionFields,
|
|
2117
|
+
timelineTags: z17.record(z17.string(), z17.string().min(1).nullable()).optional()
|
|
2118
|
+
}).refine(hasSubscriptionTargets);
|
|
2119
|
+
var unsubscribeMessageSchema = z17.object({ type: z17.literal("unsubscribe"), ...subscriptionFields }).refine(hasSubscriptionTargets);
|
|
2120
|
+
var pingMessageSchema = z17.object({
|
|
2121
|
+
type: z17.literal("ping")
|
|
2269
2122
|
});
|
|
2270
|
-
var visibilityMessageSchema =
|
|
2271
|
-
type:
|
|
2272
|
-
visible:
|
|
2123
|
+
var visibilityMessageSchema = z17.object({
|
|
2124
|
+
type: z17.literal("visibility"),
|
|
2125
|
+
visible: z17.boolean()
|
|
2273
2126
|
});
|
|
2274
|
-
var clientMessageSchema =
|
|
2127
|
+
var clientMessageSchema = z17.discriminatedUnion("type", [
|
|
2275
2128
|
subscribeMessageSchema,
|
|
2276
2129
|
unsubscribeMessageSchema,
|
|
2277
2130
|
pingMessageSchema,
|
|
2278
2131
|
visibilityMessageSchema
|
|
2279
2132
|
]);
|
|
2280
|
-
var pongMessageSchema =
|
|
2281
|
-
type:
|
|
2133
|
+
var pongMessageSchema = z17.object({
|
|
2134
|
+
type: z17.literal("pong")
|
|
2282
2135
|
}).strict();
|
|
2283
|
-
var pongMessageLenientSchema =
|
|
2284
|
-
type:
|
|
2136
|
+
var pongMessageLenientSchema = z17.object({
|
|
2137
|
+
type: z17.literal("pong")
|
|
2285
2138
|
});
|
|
2286
|
-
var threadStatusChangeMetadataSchema =
|
|
2139
|
+
var threadStatusChangeMetadataSchema = z17.object({
|
|
2287
2140
|
status: threadStatusSchema,
|
|
2288
2141
|
runtime: threadRuntimeStateSchema,
|
|
2289
2142
|
activity: threadActivityStateSchema,
|
|
2290
|
-
latestAttentionAt:
|
|
2291
|
-
updatedAt:
|
|
2143
|
+
latestAttentionAt: z17.number(),
|
|
2144
|
+
updatedAt: z17.number()
|
|
2292
2145
|
}).strict();
|
|
2293
|
-
var threadChangeMetadataSchema =
|
|
2294
|
-
backgroundActivityChanged:
|
|
2295
|
-
eventTypes:
|
|
2296
|
-
timelineSequence:
|
|
2297
|
-
hasPendingInteraction:
|
|
2298
|
-
projectId:
|
|
2146
|
+
var threadChangeMetadataSchema = z17.object({
|
|
2147
|
+
backgroundActivityChanged: z17.boolean().optional(),
|
|
2148
|
+
eventTypes: z17.array(threadEventTypeSchema).readonly().optional(),
|
|
2149
|
+
timelineSequence: z17.number().int().nonnegative().optional(),
|
|
2150
|
+
hasPendingInteraction: z17.boolean().optional(),
|
|
2151
|
+
projectId: z17.string().optional(),
|
|
2299
2152
|
statusChange: threadStatusChangeMetadataSchema.optional()
|
|
2300
2153
|
}).strict();
|
|
2301
|
-
var threadChangedMessageSchema =
|
|
2302
|
-
type:
|
|
2303
|
-
entity:
|
|
2304
|
-
id:
|
|
2154
|
+
var threadChangedMessageSchema = z17.object({
|
|
2155
|
+
type: z17.literal("changed"),
|
|
2156
|
+
entity: z17.literal("thread"),
|
|
2157
|
+
id: z17.string().optional(),
|
|
2305
2158
|
metadata: threadChangeMetadataSchema.optional(),
|
|
2306
|
-
changes:
|
|
2159
|
+
changes: z17.array(threadChangeKindSchema).readonly()
|
|
2307
2160
|
}).strict();
|
|
2308
|
-
var projectChangedMessageSchema =
|
|
2309
|
-
type:
|
|
2310
|
-
entity:
|
|
2311
|
-
id:
|
|
2312
|
-
changes:
|
|
2161
|
+
var projectChangedMessageSchema = z17.object({
|
|
2162
|
+
type: z17.literal("changed"),
|
|
2163
|
+
entity: z17.literal("project"),
|
|
2164
|
+
id: z17.string().optional(),
|
|
2165
|
+
changes: z17.array(projectChangeKindSchema).readonly()
|
|
2313
2166
|
}).strict();
|
|
2314
|
-
var environmentChangedMessageSchema =
|
|
2315
|
-
type:
|
|
2316
|
-
entity:
|
|
2317
|
-
id:
|
|
2318
|
-
changes:
|
|
2167
|
+
var environmentChangedMessageSchema = z17.object({
|
|
2168
|
+
type: z17.literal("changed"),
|
|
2169
|
+
entity: z17.literal("environment"),
|
|
2170
|
+
id: z17.string().optional(),
|
|
2171
|
+
changes: z17.array(environmentChangeKindSchema).readonly()
|
|
2319
2172
|
}).strict();
|
|
2320
|
-
var hostChangedMessageSchema =
|
|
2321
|
-
type:
|
|
2322
|
-
entity:
|
|
2323
|
-
id:
|
|
2324
|
-
changes:
|
|
2173
|
+
var hostChangedMessageSchema = z17.object({
|
|
2174
|
+
type: z17.literal("changed"),
|
|
2175
|
+
entity: z17.literal("host"),
|
|
2176
|
+
id: z17.string().optional(),
|
|
2177
|
+
changes: z17.array(hostChangeKindSchema).readonly()
|
|
2325
2178
|
}).strict();
|
|
2326
|
-
var systemChangedMessageSchema =
|
|
2327
|
-
type:
|
|
2328
|
-
entity:
|
|
2329
|
-
changes:
|
|
2179
|
+
var systemChangedMessageSchema = z17.object({
|
|
2180
|
+
type: z17.literal("changed"),
|
|
2181
|
+
entity: z17.literal("system"),
|
|
2182
|
+
changes: z17.array(systemChangeKindSchema).readonly()
|
|
2330
2183
|
}).strict();
|
|
2331
|
-
var tagsChangedMessageSchema =
|
|
2332
|
-
type:
|
|
2333
|
-
entity:
|
|
2334
|
-
tags:
|
|
2184
|
+
var tagsChangedMessageSchema = z17.object({
|
|
2185
|
+
type: z17.literal("changed"),
|
|
2186
|
+
entity: z17.literal("tags"),
|
|
2187
|
+
tags: z17.array(z17.string().min(1)).min(1)
|
|
2335
2188
|
}).strict();
|
|
2336
|
-
var pluginChangedMessageSchema =
|
|
2337
|
-
type:
|
|
2338
|
-
entity:
|
|
2339
|
-
pluginId:
|
|
2340
|
-
tags:
|
|
2189
|
+
var pluginChangedMessageSchema = z17.object({
|
|
2190
|
+
type: z17.literal("changed"),
|
|
2191
|
+
entity: z17.literal("plugin"),
|
|
2192
|
+
pluginId: z17.string().min(1),
|
|
2193
|
+
tags: z17.array(z17.string().min(1)).min(1).nullable()
|
|
2341
2194
|
}).strict();
|
|
2342
|
-
var changedMessageSchema =
|
|
2195
|
+
var changedMessageSchema = z17.discriminatedUnion("entity", [
|
|
2343
2196
|
threadChangedMessageSchema,
|
|
2344
2197
|
projectChangedMessageSchema,
|
|
2345
2198
|
environmentChangedMessageSchema,
|
|
@@ -2350,56 +2203,56 @@ var changedMessageSchema = z18.discriminatedUnion("entity", [
|
|
|
2350
2203
|
]);
|
|
2351
2204
|
function lenientKinds(kinds) {
|
|
2352
2205
|
const known = new Set(kinds);
|
|
2353
|
-
return
|
|
2206
|
+
return z17.array(z17.string()).transform(
|
|
2354
2207
|
(values) => values.filter((value) => known.has(value))
|
|
2355
2208
|
);
|
|
2356
2209
|
}
|
|
2357
2210
|
var knownThreadEventTypes = new Set(
|
|
2358
2211
|
threadEventTypeValues
|
|
2359
2212
|
);
|
|
2360
|
-
var threadChangeMetadataLenientSchema =
|
|
2361
|
-
timelineSequence:
|
|
2362
|
-
backgroundActivityChanged:
|
|
2363
|
-
eventTypes:
|
|
2213
|
+
var threadChangeMetadataLenientSchema = z17.object({
|
|
2214
|
+
timelineSequence: z17.number().int().nonnegative().optional(),
|
|
2215
|
+
backgroundActivityChanged: z17.boolean().optional(),
|
|
2216
|
+
eventTypes: z17.array(z17.string()).transform(
|
|
2364
2217
|
(values) => values.filter(
|
|
2365
2218
|
(value) => knownThreadEventTypes.has(value)
|
|
2366
2219
|
)
|
|
2367
2220
|
).optional(),
|
|
2368
|
-
hasPendingInteraction:
|
|
2369
|
-
projectId:
|
|
2221
|
+
hasPendingInteraction: z17.boolean().optional(),
|
|
2222
|
+
projectId: z17.string().optional(),
|
|
2370
2223
|
statusChange: threadStatusChangeMetadataSchema.optional().catch(void 0)
|
|
2371
2224
|
});
|
|
2372
|
-
var threadChangedMessageLenientSchema =
|
|
2373
|
-
type:
|
|
2374
|
-
entity:
|
|
2375
|
-
id:
|
|
2225
|
+
var threadChangedMessageLenientSchema = z17.object({
|
|
2226
|
+
type: z17.literal("changed"),
|
|
2227
|
+
entity: z17.literal("thread"),
|
|
2228
|
+
id: z17.string().optional(),
|
|
2376
2229
|
metadata: threadChangeMetadataLenientSchema.optional(),
|
|
2377
2230
|
changes: lenientKinds(THREAD_CHANGE_KINDS)
|
|
2378
2231
|
});
|
|
2379
|
-
var projectChangedMessageLenientSchema =
|
|
2380
|
-
type:
|
|
2381
|
-
entity:
|
|
2382
|
-
id:
|
|
2232
|
+
var projectChangedMessageLenientSchema = z17.object({
|
|
2233
|
+
type: z17.literal("changed"),
|
|
2234
|
+
entity: z17.literal("project"),
|
|
2235
|
+
id: z17.string().optional(),
|
|
2383
2236
|
changes: lenientKinds(PROJECT_CHANGE_KINDS)
|
|
2384
2237
|
});
|
|
2385
|
-
var environmentChangedMessageLenientSchema =
|
|
2386
|
-
type:
|
|
2387
|
-
entity:
|
|
2388
|
-
id:
|
|
2238
|
+
var environmentChangedMessageLenientSchema = z17.object({
|
|
2239
|
+
type: z17.literal("changed"),
|
|
2240
|
+
entity: z17.literal("environment"),
|
|
2241
|
+
id: z17.string().optional(),
|
|
2389
2242
|
changes: lenientKinds(ENVIRONMENT_CHANGE_KINDS)
|
|
2390
2243
|
});
|
|
2391
|
-
var hostChangedMessageLenientSchema =
|
|
2392
|
-
type:
|
|
2393
|
-
entity:
|
|
2394
|
-
id:
|
|
2244
|
+
var hostChangedMessageLenientSchema = z17.object({
|
|
2245
|
+
type: z17.literal("changed"),
|
|
2246
|
+
entity: z17.literal("host"),
|
|
2247
|
+
id: z17.string().optional(),
|
|
2395
2248
|
changes: lenientKinds(HOST_CHANGE_KINDS)
|
|
2396
2249
|
});
|
|
2397
|
-
var systemChangedMessageLenientSchema =
|
|
2398
|
-
type:
|
|
2399
|
-
entity:
|
|
2250
|
+
var systemChangedMessageLenientSchema = z17.object({
|
|
2251
|
+
type: z17.literal("changed"),
|
|
2252
|
+
entity: z17.literal("system"),
|
|
2400
2253
|
changes: lenientKinds(SYSTEM_CHANGE_KINDS)
|
|
2401
2254
|
});
|
|
2402
|
-
var changedMessageLenientSchema =
|
|
2255
|
+
var changedMessageLenientSchema = z17.discriminatedUnion("entity", [
|
|
2403
2256
|
threadChangedMessageLenientSchema,
|
|
2404
2257
|
projectChangedMessageLenientSchema,
|
|
2405
2258
|
environmentChangedMessageLenientSchema,
|
|
@@ -2410,22 +2263,22 @@ var changedMessageLenientSchema = z18.discriminatedUnion("entity", [
|
|
|
2410
2263
|
]);
|
|
2411
2264
|
|
|
2412
2265
|
// src/internal/rpc-tags.ts
|
|
2413
|
-
import { z as
|
|
2414
|
-
var rpcInvalidationTags =
|
|
2266
|
+
import { z as z18 } from "zod";
|
|
2267
|
+
var rpcInvalidationTags = z18.array(z18.string().min(1)).min(1);
|
|
2415
2268
|
function rpcResponseTags(declarations, input, output) {
|
|
2416
|
-
const tags =
|
|
2269
|
+
const tags = z18.array(z18.string().min(1)).parse(declarations.tags?.(input, output) ?? []);
|
|
2417
2270
|
const keyTags = {};
|
|
2418
2271
|
if (declarations.keyTags && typeof output === "object" && output !== null && !Array.isArray(output)) {
|
|
2419
2272
|
for (const [key, value] of Object.entries(output)) {
|
|
2420
|
-
keyTags[key] =
|
|
2273
|
+
keyTags[key] = z18.array(z18.string().min(1)).parse(declarations.keyTags(key, value));
|
|
2421
2274
|
}
|
|
2422
2275
|
}
|
|
2423
|
-
const invalidated =
|
|
2276
|
+
const invalidated = z18.array(z18.string().min(1)).parse(declarations.invalidates?.(input, output) ?? []);
|
|
2424
2277
|
return { tags, keyTags, invalidated };
|
|
2425
2278
|
}
|
|
2426
2279
|
|
|
2427
2280
|
// src/internal/rpc-query-host.ts
|
|
2428
|
-
import { z as
|
|
2281
|
+
import { z as z19 } from "zod";
|
|
2429
2282
|
var rpcQueryKey = (pluginId, method, input) => [
|
|
2430
2283
|
"plugin-rpc",
|
|
2431
2284
|
pluginId,
|
|
@@ -2567,7 +2420,7 @@ function createRpcQueryHooks(useHost) {
|
|
|
2567
2420
|
const enabled = options.enabled ?? true;
|
|
2568
2421
|
const identity = JSON.stringify([...new Set(options.keys)].sort());
|
|
2569
2422
|
const keys = useMemo2(
|
|
2570
|
-
() =>
|
|
2423
|
+
() => z19.array(z19.string()).parse(JSON.parse(identity)),
|
|
2571
2424
|
[identity]
|
|
2572
2425
|
);
|
|
2573
2426
|
let cache = owners.get(host.queryClient);
|
|
@@ -2593,7 +2446,7 @@ function createRpcQueryHooks(useHost) {
|
|
|
2593
2446
|
);
|
|
2594
2447
|
return {
|
|
2595
2448
|
...response,
|
|
2596
|
-
result:
|
|
2449
|
+
result: z19.record(z19.string(), jsonValueSchema).parse(response.result)
|
|
2597
2450
|
};
|
|
2598
2451
|
}
|
|
2599
2452
|
});
|
|
@@ -2642,9 +2495,18 @@ function createRpcQueryHooks(useHost) {
|
|
|
2642
2495
|
const refetch = useCallback2(async () => {
|
|
2643
2496
|
await current.observer.refetch();
|
|
2644
2497
|
}, [current]);
|
|
2498
|
+
const refetchKeys = useCallback2(
|
|
2499
|
+
async (requested) => {
|
|
2500
|
+
await current.refetchKeys(
|
|
2501
|
+
requested.filter((key) => keys.includes(key))
|
|
2502
|
+
);
|
|
2503
|
+
},
|
|
2504
|
+
[current, keys]
|
|
2505
|
+
);
|
|
2645
2506
|
return {
|
|
2646
2507
|
...query,
|
|
2647
|
-
refetch
|
|
2508
|
+
refetch,
|
|
2509
|
+
refetchKeys
|
|
2648
2510
|
};
|
|
2649
2511
|
}
|
|
2650
2512
|
function experimental_useRpcMutation(options) {
|
|
@@ -2793,71 +2655,71 @@ function reconcileComposerMentions(currentText, nextText, mentions) {
|
|
|
2793
2655
|
}
|
|
2794
2656
|
|
|
2795
2657
|
// src/internal/composer-draft-actions.ts
|
|
2796
|
-
import { z as
|
|
2658
|
+
import { z as z20 } from "zod";
|
|
2797
2659
|
var range = {
|
|
2798
|
-
from:
|
|
2799
|
-
to:
|
|
2800
|
-
label:
|
|
2660
|
+
from: z20.number().int().nonnegative(),
|
|
2661
|
+
to: z20.number().int().nonnegative(),
|
|
2662
|
+
label: z20.string()
|
|
2801
2663
|
};
|
|
2802
|
-
var mentionSchema =
|
|
2803
|
-
|
|
2664
|
+
var mentionSchema = z20.discriminatedUnion("kind", [
|
|
2665
|
+
z20.object({
|
|
2804
2666
|
...range,
|
|
2805
|
-
kind:
|
|
2806
|
-
threadId:
|
|
2807
|
-
projectId:
|
|
2667
|
+
kind: z20.literal("thread"),
|
|
2668
|
+
threadId: z20.string(),
|
|
2669
|
+
projectId: z20.string().optional()
|
|
2808
2670
|
}),
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2671
|
+
z20.object({ ...range, kind: z20.literal("project"), projectId: z20.string() }),
|
|
2672
|
+
z20.object({ ...range, kind: z20.literal("section"), sectionId: z20.string() }),
|
|
2673
|
+
z20.object({
|
|
2812
2674
|
...range,
|
|
2813
|
-
kind:
|
|
2814
|
-
path:
|
|
2815
|
-
source:
|
|
2816
|
-
entryKind:
|
|
2675
|
+
kind: z20.literal("path"),
|
|
2676
|
+
path: z20.string(),
|
|
2677
|
+
source: z20.enum(["workspace", "thread-storage"]),
|
|
2678
|
+
entryKind: z20.enum(["file", "directory"])
|
|
2817
2679
|
}),
|
|
2818
|
-
|
|
2680
|
+
z20.object({
|
|
2819
2681
|
...range,
|
|
2820
|
-
kind:
|
|
2821
|
-
trigger:
|
|
2822
|
-
name:
|
|
2823
|
-
source:
|
|
2824
|
-
origin:
|
|
2825
|
-
argumentHint:
|
|
2682
|
+
kind: z20.literal("command"),
|
|
2683
|
+
trigger: z20.enum(["/", "$"]),
|
|
2684
|
+
name: z20.string(),
|
|
2685
|
+
source: z20.enum(["skill", "command"]),
|
|
2686
|
+
origin: z20.enum(["builtin", "project", "user"]),
|
|
2687
|
+
argumentHint: z20.string().nullable()
|
|
2826
2688
|
}),
|
|
2827
|
-
|
|
2828
|
-
|
|
2689
|
+
z20.object({ ...range, kind: z20.literal("attachment"), path: z20.string() }),
|
|
2690
|
+
z20.object({
|
|
2829
2691
|
...range,
|
|
2830
|
-
kind:
|
|
2831
|
-
pluginId:
|
|
2832
|
-
provider:
|
|
2833
|
-
id:
|
|
2834
|
-
icon:
|
|
2692
|
+
kind: z20.literal("plugin"),
|
|
2693
|
+
pluginId: z20.string(),
|
|
2694
|
+
provider: z20.string().min(1).refine((value) => !value.includes(":")),
|
|
2695
|
+
id: z20.string(),
|
|
2696
|
+
icon: z20.string().nullable().optional()
|
|
2835
2697
|
})
|
|
2836
2698
|
]);
|
|
2837
2699
|
var attachmentFields = {
|
|
2838
|
-
type:
|
|
2839
|
-
path:
|
|
2840
|
-
name:
|
|
2841
|
-
mimeType:
|
|
2842
|
-
sizeBytes:
|
|
2700
|
+
type: z20.enum(["localImage", "localFile"]),
|
|
2701
|
+
path: z20.string().min(1),
|
|
2702
|
+
name: z20.string(),
|
|
2703
|
+
mimeType: z20.string().optional(),
|
|
2704
|
+
sizeBytes: z20.number().nonnegative().optional()
|
|
2843
2705
|
};
|
|
2844
|
-
var attachmentsSchema =
|
|
2845
|
-
|
|
2846
|
-
|
|
2706
|
+
var attachmentsSchema = z20.array(
|
|
2707
|
+
z20.union([
|
|
2708
|
+
z20.object({
|
|
2847
2709
|
...attachmentFields,
|
|
2848
|
-
hostId:
|
|
2849
|
-
sourceProjectId:
|
|
2710
|
+
hostId: z20.string().min(1),
|
|
2711
|
+
sourceProjectId: z20.undefined().optional()
|
|
2850
2712
|
}),
|
|
2851
|
-
|
|
2713
|
+
z20.object({
|
|
2852
2714
|
...attachmentFields,
|
|
2853
|
-
sourceProjectId:
|
|
2854
|
-
hostId:
|
|
2715
|
+
sourceProjectId: z20.string().min(1).optional(),
|
|
2716
|
+
hostId: z20.undefined().optional()
|
|
2855
2717
|
})
|
|
2856
2718
|
])
|
|
2857
2719
|
);
|
|
2858
|
-
var replacementSchema =
|
|
2859
|
-
text:
|
|
2860
|
-
mentions:
|
|
2720
|
+
var replacementSchema = z20.object({
|
|
2721
|
+
text: z20.string(),
|
|
2722
|
+
mentions: z20.array(mentionSchema),
|
|
2861
2723
|
attachments: attachmentsSchema.optional()
|
|
2862
2724
|
}).superRefine((draft, context) => {
|
|
2863
2725
|
let end = 0;
|
|
@@ -3547,6 +3409,7 @@ function collectComposerCustomization(registration, seenIds, onRejected, seenPop
|
|
|
3547
3409
|
var FILE_PATH_MAX_LENGTH = 32768;
|
|
3548
3410
|
var WINDOWS_DRIVE_ABSOLUTE_PATH = /^[A-Za-z]:[\\/]/u;
|
|
3549
3411
|
var WINDOWS_UNC_ABSOLUTE_PATH = /^\\\\/u;
|
|
3412
|
+
var REVISION_REF = /^(?:HEAD|[0-9a-f]{4,40})$/iu;
|
|
3550
3413
|
function isJsonObject(value) {
|
|
3551
3414
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
3552
3415
|
return false;
|
|
@@ -3585,6 +3448,9 @@ function hasUnpairedSurrogate(value) {
|
|
|
3585
3448
|
function isValidPathSegment(segment) {
|
|
3586
3449
|
return segment.length > 0 && segment !== "." && segment !== "..";
|
|
3587
3450
|
}
|
|
3451
|
+
function isValidRevisionRef(value) {
|
|
3452
|
+
return typeof value === "string" && REVISION_REF.test(value);
|
|
3453
|
+
}
|
|
3588
3454
|
function isPositiveSafeInteger(value) {
|
|
3589
3455
|
return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
|
|
3590
3456
|
}
|
|
@@ -3615,15 +3481,22 @@ function isValidAbsoluteHostFilePath(value) {
|
|
|
3615
3481
|
function normalizeExperimentalLiveFileTarget(value) {
|
|
3616
3482
|
if (!isJsonObject(value) || typeof value.kind !== "string") return null;
|
|
3617
3483
|
switch (value.kind) {
|
|
3618
|
-
case "workspace":
|
|
3619
|
-
|
|
3484
|
+
case "workspace": {
|
|
3485
|
+
const ref = value.experimental_ref;
|
|
3486
|
+
if (!hasExactKeys(
|
|
3487
|
+
value,
|
|
3488
|
+
ref === void 0 ? ["kind", "environmentId", "path"] : ["kind", "environmentId", "path", "experimental_ref"]
|
|
3489
|
+
) || !isNonEmptyIdentity(value.environmentId) || !isValidRelativeFilePath(value.path)) {
|
|
3620
3490
|
return null;
|
|
3621
3491
|
}
|
|
3622
|
-
|
|
3492
|
+
const target = {
|
|
3623
3493
|
kind: value.kind,
|
|
3624
3494
|
environmentId: value.environmentId,
|
|
3625
3495
|
path: value.path
|
|
3626
3496
|
};
|
|
3497
|
+
if (ref === void 0) return target;
|
|
3498
|
+
return isValidRevisionRef(ref) ? { ...target, experimental_ref: ref } : null;
|
|
3499
|
+
}
|
|
3627
3500
|
case "host":
|
|
3628
3501
|
if (!hasExactKeys(value, ["kind", "hostId", "path"]) || !isNonEmptyIdentity(value.hostId) || !isValidAbsoluteHostFilePath(value.path)) {
|
|
3629
3502
|
return null;
|
|
@@ -3751,7 +3624,7 @@ function adaptSidebarFooterAction(registration) {
|
|
|
3751
3624
|
var sidebarFooterItemsByRegistrationSet = /* @__PURE__ */ new WeakMap();
|
|
3752
3625
|
|
|
3753
3626
|
// src/internal/plugin-app-registration-collector.ts
|
|
3754
|
-
import { z as
|
|
3627
|
+
import { z as z21 } from "zod";
|
|
3755
3628
|
var CODE_FENCE_LANGUAGE_PATTERN = /^[a-z0-9][a-z0-9+#._-]*$/;
|
|
3756
3629
|
var SIDEBAR_FOOTER_ACTION_KEYS = /* @__PURE__ */ new Set([
|
|
3757
3630
|
"id",
|
|
@@ -3867,8 +3740,8 @@ function checkStaleNavPanelKeys(kind, registration, onWarning) {
|
|
|
3867
3740
|
}
|
|
3868
3741
|
}
|
|
3869
3742
|
function createCommandShortcutSchema() {
|
|
3870
|
-
return
|
|
3871
|
-
key:
|
|
3743
|
+
return z21.object({
|
|
3744
|
+
key: z21.string().min(1).max(32).refine(
|
|
3872
3745
|
(key) => ![
|
|
3873
3746
|
"Alt",
|
|
3874
3747
|
"Control",
|
|
@@ -3879,11 +3752,11 @@ function createCommandShortcutSchema() {
|
|
|
3879
3752
|
"Unidentified"
|
|
3880
3753
|
].includes(key)
|
|
3881
3754
|
),
|
|
3882
|
-
mod:
|
|
3883
|
-
meta:
|
|
3884
|
-
control:
|
|
3885
|
-
alt:
|
|
3886
|
-
shift:
|
|
3755
|
+
mod: z21.boolean().default(false),
|
|
3756
|
+
meta: z21.boolean().default(false),
|
|
3757
|
+
control: z21.boolean().default(false),
|
|
3758
|
+
alt: z21.boolean().default(false),
|
|
3759
|
+
shift: z21.boolean().default(false)
|
|
3887
3760
|
}).strict().refine(
|
|
3888
3761
|
(shortcut) => shortcut.mod || shortcut.meta || shortcut.control || shortcut.alt || /^F(?:[1-9]|1[0-9]|2[0-4])$/u.test(shortcut.key),
|
|
3889
3762
|
"Use Command, Control, or Alt with a key, or a function key"
|
|
@@ -4032,9 +3905,9 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
4032
3905
|
throw new Error(`${kind}: run and params require action availability`);
|
|
4033
3906
|
}
|
|
4034
3907
|
const target = registration.experimental_target;
|
|
4035
|
-
if (target !== void 0 && (
|
|
3908
|
+
if (target !== void 0 && (availability !== "fixed" || typeof target?.validate !== "function")) {
|
|
4036
3909
|
throw new Error(
|
|
4037
|
-
`${kind}: experimental_target requires a
|
|
3910
|
+
`${kind}: experimental_target requires a fixed tab and a validate function`
|
|
4038
3911
|
);
|
|
4039
3912
|
}
|
|
4040
3913
|
const validated = {
|
|
@@ -4051,7 +3924,7 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
4051
3924
|
registration.tooltip
|
|
4052
3925
|
)
|
|
4053
3926
|
},
|
|
4054
|
-
...availability === "action" && registration.params !== void 0 ? { params:
|
|
3927
|
+
...availability === "action" && registration.params !== void 0 ? { params: z21.json().parse(registration.params) } : {}
|
|
4055
3928
|
};
|
|
4056
3929
|
collected.tabs.push(validated);
|
|
4057
3930
|
}
|
|
@@ -4389,6 +4262,11 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
4389
4262
|
if (registration.useData !== void 0 && typeof registration.useData !== "function") {
|
|
4390
4263
|
throw new Error(`${kind}: "useData" must be a function`);
|
|
4391
4264
|
}
|
|
4265
|
+
if (registration.experimental_bulkItem !== void 0 && typeof registration.experimental_bulkItem !== "function") {
|
|
4266
|
+
throw new Error(
|
|
4267
|
+
`${kind}: "experimental_bulkItem" must be a function`
|
|
4268
|
+
);
|
|
4269
|
+
}
|
|
4392
4270
|
collected.threadActions.push({
|
|
4393
4271
|
id,
|
|
4394
4272
|
title: requireNonEmptyString(kind, "title", registration.title),
|
|
@@ -4396,7 +4274,10 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
4396
4274
|
group: requireNonEmptyString(kind, "group", registration.group),
|
|
4397
4275
|
...requireOptionalOrder(kind, registration.order),
|
|
4398
4276
|
...registration.useData !== void 0 ? { useData: registration.useData } : {},
|
|
4399
|
-
item: registration.item
|
|
4277
|
+
item: registration.item,
|
|
4278
|
+
...registration.experimental_bulkItem !== void 0 ? {
|
|
4279
|
+
experimental_bulkItem: registration.experimental_bulkItem
|
|
4280
|
+
} : {}
|
|
4400
4281
|
});
|
|
4401
4282
|
},
|
|
4402
4283
|
experimental_browserToolbarAction(registration) {
|
|
@@ -4758,6 +4639,7 @@ function SlotLifecycleGuard({
|
|
|
4758
4639
|
}
|
|
4759
4640
|
var SlotEnvContext = createContext(null);
|
|
4760
4641
|
var NO_THREAD_ACTIONS = () => [];
|
|
4642
|
+
var NO_THREAD_BULK_ACTIONS = () => [];
|
|
4761
4643
|
var NO_THREAD_ACTION_REGISTRATIONS = [];
|
|
4762
4644
|
function noRenameEditor() {
|
|
4763
4645
|
}
|
|
@@ -4781,6 +4663,25 @@ function TestThreadActionsMenuItems({
|
|
|
4781
4663
|
}) {
|
|
4782
4664
|
const rename = requestRename ?? noRenameEditor;
|
|
4783
4665
|
const entries = useTestThreadActions(hook, thread, { requestRename: rename });
|
|
4666
|
+
return /* @__PURE__ */ jsx(
|
|
4667
|
+
TestThreadActionRows,
|
|
4668
|
+
{
|
|
4669
|
+
label: "Thread actions",
|
|
4670
|
+
entries,
|
|
4671
|
+
inline,
|
|
4672
|
+
rename,
|
|
4673
|
+
onClose
|
|
4674
|
+
}
|
|
4675
|
+
);
|
|
4676
|
+
}
|
|
4677
|
+
function TestThreadActionRows({
|
|
4678
|
+
label,
|
|
4679
|
+
entries,
|
|
4680
|
+
inline,
|
|
4681
|
+
rename,
|
|
4682
|
+
onClose,
|
|
4683
|
+
onKeyDown
|
|
4684
|
+
}) {
|
|
4784
4685
|
const rows = [
|
|
4785
4686
|
...entries.map((entry) => ({
|
|
4786
4687
|
key: entry.key,
|
|
@@ -4793,7 +4694,7 @@ function TestThreadActionsMenuItems({
|
|
|
4793
4694
|
run: () => item.action.run({ requestRename: rename })
|
|
4794
4695
|
}))
|
|
4795
4696
|
];
|
|
4796
|
-
return /* @__PURE__ */ jsx("div", { role: "menu", "aria-label":
|
|
4697
|
+
return /* @__PURE__ */ jsx("div", { role: "menu", "aria-label": label, onKeyDown, children: rows.map((row) => /* @__PURE__ */ jsx(
|
|
4797
4698
|
"button",
|
|
4798
4699
|
{
|
|
4799
4700
|
type: "button",
|
|
@@ -4875,19 +4776,31 @@ function TestThreadActionsMenu({
|
|
|
4875
4776
|
function TestThreadActionsContextMenu({
|
|
4876
4777
|
thread,
|
|
4877
4778
|
children,
|
|
4878
|
-
inline,
|
|
4779
|
+
inline = [],
|
|
4879
4780
|
requestRename,
|
|
4880
4781
|
onOpenChange,
|
|
4881
4782
|
onCloseAutoFocus,
|
|
4783
|
+
onEscapeKeyDown,
|
|
4882
4784
|
disabled,
|
|
4883
|
-
dragging
|
|
4785
|
+
dragging,
|
|
4786
|
+
experimental_bulkThreads
|
|
4884
4787
|
}) {
|
|
4885
4788
|
const menu = useTestMenuOpenState({ onOpenChange, onCloseAutoFocus });
|
|
4789
|
+
const resolveSelection = useSlotEnv(
|
|
4790
|
+
"experimental_ThreadActionsContextMenu"
|
|
4791
|
+
).threadBulkActions;
|
|
4792
|
+
const selection = experimental_bulkThreads !== void 0 && experimental_bulkThreads.length > 1 ? experimental_bulkThreads : null;
|
|
4793
|
+
const onKeyDown = (event) => {
|
|
4794
|
+
if (event.key !== "Escape") return;
|
|
4795
|
+
onEscapeKeyDown?.(event.nativeEvent);
|
|
4796
|
+
menu.close();
|
|
4797
|
+
};
|
|
4886
4798
|
return /* @__PURE__ */ jsxs(
|
|
4887
4799
|
"div",
|
|
4888
4800
|
{
|
|
4889
4801
|
"data-testid": "bb-thread-actions-context-menu",
|
|
4890
4802
|
"data-thread-id": thread.id,
|
|
4803
|
+
"data-selection-thread-ids": selection === null ? void 0 : selection.map((target) => target.id).join(" "),
|
|
4891
4804
|
"data-disabled": disabled === true ? "true" : "false",
|
|
4892
4805
|
"data-dragging": dragging === true ? "true" : "false",
|
|
4893
4806
|
className: "contents",
|
|
@@ -4898,7 +4811,18 @@ function TestThreadActionsContextMenu({
|
|
|
4898
4811
|
},
|
|
4899
4812
|
children: [
|
|
4900
4813
|
children,
|
|
4901
|
-
menu.open ? /* @__PURE__ */ jsx(
|
|
4814
|
+
menu.open && selection !== null ? /* @__PURE__ */ jsx(
|
|
4815
|
+
TestThreadActionRows,
|
|
4816
|
+
{
|
|
4817
|
+
label: `Actions for ${selection.length} threads`,
|
|
4818
|
+
entries: resolveSelection(selection),
|
|
4819
|
+
inline,
|
|
4820
|
+
rename: requestRename ?? noRenameEditor,
|
|
4821
|
+
onClose: menu.close,
|
|
4822
|
+
onKeyDown
|
|
4823
|
+
}
|
|
4824
|
+
) : null,
|
|
4825
|
+
menu.open && selection === null ? /* @__PURE__ */ jsx(
|
|
4902
4826
|
TestThreadActionsMenuItems,
|
|
4903
4827
|
{
|
|
4904
4828
|
hook: "experimental_ThreadActionsContextMenu",
|
|
@@ -5493,6 +5417,8 @@ function captureClipboardWrites(result) {
|
|
|
5493
5417
|
return writes;
|
|
5494
5418
|
}
|
|
5495
5419
|
var testPluginSdkApp = {
|
|
5420
|
+
experimental_getApplicationLinkApprovals: async () => [],
|
|
5421
|
+
experimental_revokeApplicationLinkApproval: async (_scheme) => [],
|
|
5496
5422
|
definePluginApp,
|
|
5497
5423
|
...createRpcQueryHooks(() => useSlotEnv("rpc query").rpcQueryHost),
|
|
5498
5424
|
useRpc() {
|
|
@@ -5555,7 +5481,7 @@ var testPluginSdkApp = {
|
|
|
5555
5481
|
store.getSnapshot,
|
|
5556
5482
|
store.getSnapshot
|
|
5557
5483
|
);
|
|
5558
|
-
if (state === null || state.panelId !== ("context" in tab ? tab.context.panelId : tab.panelId) || state.tabId !== tab.id || tab.experimental_target === void 0) {
|
|
5484
|
+
if (state === null || state.panelId !== ("context" in tab ? tab.context.kind === "nav-panel" ? tab.context.panelId : null : tab.panelId) || state.tabId !== tab.id || tab.experimental_target === void 0) {
|
|
5559
5485
|
return null;
|
|
5560
5486
|
}
|
|
5561
5487
|
try {
|
|
@@ -5656,6 +5582,14 @@ var testPluginSdkApp = {
|
|
|
5656
5582
|
experimental_useCodeTheme() {
|
|
5657
5583
|
return useSlotEnv("experimental_useCodeTheme").codeTheme;
|
|
5658
5584
|
},
|
|
5585
|
+
experimental_useCanOpenFileExternally(target) {
|
|
5586
|
+
return useSlotEnv(
|
|
5587
|
+
"experimental_useCanOpenFileExternally"
|
|
5588
|
+
).canOpenFileExternally(target);
|
|
5589
|
+
},
|
|
5590
|
+
experimental_useTabVisible() {
|
|
5591
|
+
return useSlotEnv("experimental_useTabVisible").tabVisible;
|
|
5592
|
+
},
|
|
5659
5593
|
experimental_copyToClipboard(content) {
|
|
5660
5594
|
return activeClipboard?.(content) ?? Promise.resolve(true);
|
|
5661
5595
|
},
|
|
@@ -6022,10 +5956,12 @@ function renderSlot(registration, props, options = {}) {
|
|
|
6022
5956
|
}
|
|
6023
5957
|
};
|
|
6024
5958
|
const navigateCalls = [];
|
|
5959
|
+
const retired = options;
|
|
5960
|
+
const experimental_panelCalls = [];
|
|
6025
5961
|
const experimental_fixedTabOpenCalls = [];
|
|
6026
5962
|
const experimental_tabOpenCalls = [];
|
|
6027
5963
|
let fixedTabTargetSnapshot = options.experimental_fixedTabTarget === void 0 ? null : {
|
|
6028
|
-
panelId: options.experimental_fixedTabTarget.panelId,
|
|
5964
|
+
panelId: options.experimental_fixedTabTarget.panelId ?? null,
|
|
6029
5965
|
sequence: 1,
|
|
6030
5966
|
tabId: options.experimental_fixedTabTarget.tabId,
|
|
6031
5967
|
target: strictJsonRoundTrip(
|
|
@@ -6046,54 +5982,88 @@ function renderSlot(registration, props, options = {}) {
|
|
|
6046
5982
|
for (const listener of fixedTabTargetListeners) listener();
|
|
6047
5983
|
}
|
|
6048
5984
|
};
|
|
6049
|
-
function
|
|
5985
|
+
function openTabWithRetiredHosts(tabOptions) {
|
|
5986
|
+
if (retired.experimental_openTab !== void 0)
|
|
5987
|
+
return retired.experimental_openTab({
|
|
5988
|
+
surface: { kind: "current" },
|
|
5989
|
+
...tabOptions
|
|
5990
|
+
});
|
|
5991
|
+
if (tabOptions.tab.availability === "action") {
|
|
5992
|
+
navigateCalls.push({
|
|
5993
|
+
method: "openThreadPanel",
|
|
5994
|
+
options: {
|
|
5995
|
+
actionId: tabOptions.tab.id,
|
|
5996
|
+
...tabOptions.title === void 0 ? {} : { title: tabOptions.title },
|
|
5997
|
+
...tabOptions.params === void 0 ? {} : { params: tabOptions.params }
|
|
5998
|
+
}
|
|
5999
|
+
});
|
|
6000
|
+
return retired.openThreadPanel?.({
|
|
6001
|
+
actionId: tabOptions.tab.id,
|
|
6002
|
+
...tabOptions.title === void 0 ? {} : { title: tabOptions.title },
|
|
6003
|
+
...tabOptions.params === void 0 ? {} : { params: tabOptions.params }
|
|
6004
|
+
}) ?? false;
|
|
6005
|
+
}
|
|
6050
6006
|
const call = {
|
|
6051
|
-
surface,
|
|
6052
|
-
...
|
|
6053
|
-
tabId,
|
|
6054
|
-
...target === void 0 ? {} : { target }
|
|
6007
|
+
surface: { kind: "current" },
|
|
6008
|
+
...tabOptions.tab.context.kind === "nav-panel" ? { panelId: tabOptions.tab.context.panelId } : {},
|
|
6009
|
+
tabId: tabOptions.tab.id,
|
|
6010
|
+
...tabOptions.target === void 0 ? {} : { target: tabOptions.target }
|
|
6055
6011
|
};
|
|
6056
6012
|
experimental_fixedTabOpenCalls.push(call);
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6013
|
+
return retired.experimental_openFixedTab?.(call) ?? false;
|
|
6014
|
+
}
|
|
6015
|
+
function jsonTabOptions(tabOptions) {
|
|
6016
|
+
try {
|
|
6017
|
+
if (tabOptions.tab.availability === "fixed")
|
|
6018
|
+
return tabOptions.target === void 0 ? { tab: tabOptions.tab } : {
|
|
6019
|
+
tab: tabOptions.tab,
|
|
6020
|
+
target: strictJsonRoundTrip(tabOptions.target, "tab target")
|
|
6021
|
+
};
|
|
6022
|
+
return {
|
|
6023
|
+
tab: tabOptions.tab,
|
|
6024
|
+
...tabOptions.title === void 0 ? {} : { title: tabOptions.title },
|
|
6025
|
+
...tabOptions.params === void 0 ? {} : { params: strictJsonRoundTrip(tabOptions.params, "tab params") }
|
|
6064
6026
|
};
|
|
6065
|
-
|
|
6027
|
+
} catch {
|
|
6028
|
+
return null;
|
|
6066
6029
|
}
|
|
6067
|
-
return accepted;
|
|
6068
6030
|
}
|
|
6031
|
+
const panelController = {
|
|
6032
|
+
openTab(tabOptions) {
|
|
6033
|
+
experimental_panelCalls.push({ method: "openTab", options: tabOptions });
|
|
6034
|
+
const json = jsonTabOptions(tabOptions);
|
|
6035
|
+
if (json === null) return false;
|
|
6036
|
+
const accepted = options.experimental_panel?.openTab?.(json) ?? openTabWithRetiredHosts(json);
|
|
6037
|
+
if (accepted && json.tab.availability === "fixed" && json.target !== void 0) {
|
|
6038
|
+
fixedTabTargetSnapshot = {
|
|
6039
|
+
panelId: json.tab.context.kind === "nav-panel" ? json.tab.context.panelId : null,
|
|
6040
|
+
sequence: (fixedTabTargetSnapshot?.sequence ?? 0) + 1,
|
|
6041
|
+
tabId: json.tab.id,
|
|
6042
|
+
target: json.target
|
|
6043
|
+
};
|
|
6044
|
+
for (const listener of fixedTabTargetListeners) listener();
|
|
6045
|
+
}
|
|
6046
|
+
return accepted;
|
|
6047
|
+
},
|
|
6048
|
+
toggleTab(tabOptions) {
|
|
6049
|
+
experimental_panelCalls.push({
|
|
6050
|
+
method: "toggleTab",
|
|
6051
|
+
options: tabOptions
|
|
6052
|
+
});
|
|
6053
|
+
const json = jsonTabOptions(tabOptions);
|
|
6054
|
+
if (json === null) return false;
|
|
6055
|
+
return options.experimental_panel?.toggleTab?.(json) ?? false;
|
|
6056
|
+
},
|
|
6057
|
+
close() {
|
|
6058
|
+
experimental_panelCalls.push({ method: "close" });
|
|
6059
|
+
return options.experimental_panel?.close?.() ?? false;
|
|
6060
|
+
}
|
|
6061
|
+
};
|
|
6069
6062
|
const appPanel = {
|
|
6063
|
+
...panelController,
|
|
6070
6064
|
experimental_openTab(tabOptions) {
|
|
6071
6065
|
experimental_tabOpenCalls.push(tabOptions);
|
|
6072
|
-
|
|
6073
|
-
return options.experimental_openTab(tabOptions);
|
|
6074
|
-
if (tabOptions.tab.availability === "action") {
|
|
6075
|
-
try {
|
|
6076
|
-
const params = tabOptions.params === void 0 ? void 0 : strictJsonRoundTrip(tabOptions.params, "tab params");
|
|
6077
|
-
return navigate.openThreadPanel({
|
|
6078
|
-
actionId: tabOptions.tab.id,
|
|
6079
|
-
...tabOptions.title === void 0 ? {} : { title: tabOptions.title },
|
|
6080
|
-
...params === void 0 ? {} : { params }
|
|
6081
|
-
});
|
|
6082
|
-
} catch {
|
|
6083
|
-
return false;
|
|
6084
|
-
}
|
|
6085
|
-
}
|
|
6086
|
-
try {
|
|
6087
|
-
const target = tabOptions.target === void 0 ? void 0 : strictJsonRoundTrip(tabOptions.target, "tab target");
|
|
6088
|
-
return captureFixedTabOpen(
|
|
6089
|
-
tabOptions.surface,
|
|
6090
|
-
tabOptions.tab.context.kind === "nav-panel" ? tabOptions.tab.context.panelId : void 0,
|
|
6091
|
-
tabOptions.tab.id,
|
|
6092
|
-
target
|
|
6093
|
-
);
|
|
6094
|
-
} catch {
|
|
6095
|
-
return false;
|
|
6096
|
-
}
|
|
6066
|
+
return panelController.openTab(tabOptions);
|
|
6097
6067
|
},
|
|
6098
6068
|
openFixedTab(panelOptions) {
|
|
6099
6069
|
let target;
|
|
@@ -6115,22 +6085,13 @@ function renderSlot(registration, props, options = {}) {
|
|
|
6115
6085
|
return false;
|
|
6116
6086
|
}
|
|
6117
6087
|
}
|
|
6118
|
-
if (panelOptions.tab.panelId === void 0)
|
|
6119
|
-
|
|
6120
|
-
return appPanel.experimental_openTab({
|
|
6121
|
-
surface: panelOptions.surface,
|
|
6122
|
-
tab: {
|
|
6123
|
-
id: panelOptions.tab.id,
|
|
6124
|
-
context: { kind: "thread" },
|
|
6125
|
-
availability: "fixed"
|
|
6126
|
-
}
|
|
6127
|
-
});
|
|
6128
|
-
}
|
|
6088
|
+
if (panelOptions.tab.panelId === void 0 && target !== void 0)
|
|
6089
|
+
return false;
|
|
6129
6090
|
return appPanel.experimental_openTab({
|
|
6130
6091
|
surface: panelOptions.surface,
|
|
6131
6092
|
tab: {
|
|
6132
6093
|
id: panelOptions.tab.id,
|
|
6133
|
-
context: { kind: "nav-panel", panelId: panelOptions.tab.panelId },
|
|
6094
|
+
context: panelOptions.tab.panelId === void 0 ? { kind: "thread" } : { kind: "nav-panel", panelId: panelOptions.tab.panelId },
|
|
6134
6095
|
availability: "fixed"
|
|
6135
6096
|
},
|
|
6136
6097
|
...target === void 0 ? {} : { target }
|
|
@@ -6279,11 +6240,15 @@ function renderSlot(registration, props, options = {}) {
|
|
|
6279
6240
|
});
|
|
6280
6241
|
},
|
|
6281
6242
|
openThreadPanel(panelOptions) {
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6243
|
+
return panelController.openTab({
|
|
6244
|
+
tab: {
|
|
6245
|
+
id: panelOptions.actionId,
|
|
6246
|
+
context: { kind: "thread" },
|
|
6247
|
+
availability: "action"
|
|
6248
|
+
},
|
|
6249
|
+
...panelOptions.title === void 0 ? {} : { title: panelOptions.title },
|
|
6250
|
+
...panelOptions.params === void 0 ? {} : { params: panelOptions.params }
|
|
6285
6251
|
});
|
|
6286
|
-
return options.openThreadPanel?.(panelOptions) ?? false;
|
|
6287
6252
|
},
|
|
6288
6253
|
openUrl(url) {
|
|
6289
6254
|
navigateCalls.push({ method: "openUrl", url });
|
|
@@ -6571,8 +6536,6 @@ ${block}
|
|
|
6571
6536
|
navigate,
|
|
6572
6537
|
navigateCalls,
|
|
6573
6538
|
appPanel,
|
|
6574
|
-
experimental_fixedTabOpenCalls,
|
|
6575
|
-
experimental_tabOpenCalls,
|
|
6576
6539
|
fixedTabTarget,
|
|
6577
6540
|
composer,
|
|
6578
6541
|
composerLog,
|
|
@@ -6583,6 +6546,7 @@ ${block}
|
|
|
6583
6546
|
sidebarNavigationCalls,
|
|
6584
6547
|
environmentArchiveCalls,
|
|
6585
6548
|
threadActions: options.threadActions ?? NO_THREAD_ACTIONS,
|
|
6549
|
+
threadBulkActions: options.threadBulkActions ?? NO_THREAD_BULK_ACTIONS,
|
|
6586
6550
|
threadActionRegistrations: options.threadActionRegistrations ?? NO_THREAD_ACTION_REGISTRATIONS,
|
|
6587
6551
|
sidebarDraftThreadIds,
|
|
6588
6552
|
experiments: new Set(options.experiments ?? []),
|
|
@@ -6595,6 +6559,8 @@ ${block}
|
|
|
6595
6559
|
sdkCalls,
|
|
6596
6560
|
providers,
|
|
6597
6561
|
codeTheme,
|
|
6562
|
+
canOpenFileExternally: options.canOpenFileExternally ?? (() => false),
|
|
6563
|
+
tabVisible: options.tabVisible ?? true,
|
|
6598
6564
|
branchesState: {
|
|
6599
6565
|
branches: options.branchesState?.branches ?? [],
|
|
6600
6566
|
remoteBranches: options.branchesState?.remoteBranches ?? [],
|
|
@@ -6674,6 +6640,10 @@ ${block}
|
|
|
6674
6640
|
if (!composerOwnership.active) return;
|
|
6675
6641
|
result.unmount();
|
|
6676
6642
|
};
|
|
6643
|
+
const retiredLogs = {
|
|
6644
|
+
experimental_fixedTabOpenCalls,
|
|
6645
|
+
experimental_tabOpenCalls
|
|
6646
|
+
};
|
|
6677
6647
|
return {
|
|
6678
6648
|
...result,
|
|
6679
6649
|
rerender: rerenderSlot,
|
|
@@ -6685,8 +6655,8 @@ ${block}
|
|
|
6685
6655
|
setComposerText: setComposerText2,
|
|
6686
6656
|
setComposerScope,
|
|
6687
6657
|
navigateCalls,
|
|
6688
|
-
|
|
6689
|
-
|
|
6658
|
+
experimental_panelCalls,
|
|
6659
|
+
...retiredLogs,
|
|
6690
6660
|
sidebarActionCalls,
|
|
6691
6661
|
sidebarNavigationCalls,
|
|
6692
6662
|
experimental_environmentArchiveCalls: environmentArchiveCalls,
|
|
@@ -6706,8 +6676,8 @@ ${block}
|
|
|
6706
6676
|
},
|
|
6707
6677
|
rpcCalls,
|
|
6708
6678
|
navigateCalls,
|
|
6709
|
-
|
|
6710
|
-
|
|
6679
|
+
experimental_panelCalls,
|
|
6680
|
+
...retiredLogs,
|
|
6711
6681
|
sidebarActionCalls,
|
|
6712
6682
|
sidebarNavigationCalls,
|
|
6713
6683
|
experimental_environmentArchiveCalls: environmentArchiveCalls,
|