@pstdio/sdk 0.44.0-nightly.20261017030225 → 0.44.0
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/api/index.js +1122 -268
- package/dist/api.d.ts +29 -4
- package/dist/client/index.js +1744 -162
- package/dist/client.d.ts +2 -2
- package/dist/data.d.ts +2 -1
- package/dist/extensions/index.js +674 -543
- package/dist/extensions/react/index.js +34 -1
- package/dist/extensions-react.d.ts +8 -0
- package/dist/extensions.d.ts +2 -2
- package/dist/hooks.d.ts +20 -4
- package/dist/index-B3qUeP-z.d.ts +5451 -0
- package/dist/{index-COGwWDWo.d.ts → index-BooGkjrP.d.ts} +1591 -671
- package/dist/resources/index.js +1122 -268
- package/dist/resources.d.ts +2 -3
- package/dist/sessions-uM8AN3_e.d.ts +2 -0
- package/dist/skills-uM8AN3_e.d.ts +2 -0
- package/dist/testing/index.js +17831 -180
- package/dist/testing.d.ts +54 -6
- package/package.json +2 -1
- package/dist/index-BDnOpwNd.d.ts +0 -7
- package/dist/index-CWJstQMY.d.ts +0 -650
- package/dist/sessions-CIy86sx7.d.ts +0 -2
- package/dist/skills-CIy86sx7.d.ts +0 -2
package/dist/api/index.js
CHANGED
|
@@ -4013,6 +4013,17 @@ function _array(Class, element, params) {
|
|
|
4013
4013
|
...normalizeParams(params)
|
|
4014
4014
|
});
|
|
4015
4015
|
}
|
|
4016
|
+
function _custom(Class, fn, _params) {
|
|
4017
|
+
const norm = normalizeParams(_params);
|
|
4018
|
+
norm.abort ?? (norm.abort = true);
|
|
4019
|
+
const schema = new Class({
|
|
4020
|
+
type: "custom",
|
|
4021
|
+
check: "custom",
|
|
4022
|
+
fn,
|
|
4023
|
+
...norm
|
|
4024
|
+
});
|
|
4025
|
+
return schema;
|
|
4026
|
+
}
|
|
4016
4027
|
function _refine(Class, fn, _params) {
|
|
4017
4028
|
const schema = new Class({
|
|
4018
4029
|
type: "custom",
|
|
@@ -6158,6 +6169,9 @@ var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
|
6158
6169
|
ZodType.init(inst, def);
|
|
6159
6170
|
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
|
|
6160
6171
|
});
|
|
6172
|
+
function custom(fn, _params) {
|
|
6173
|
+
return _custom(ZodCustom, fn ?? (() => true), _params);
|
|
6174
|
+
}
|
|
6161
6175
|
function refine(fn, _params = {}) {
|
|
6162
6176
|
return _refine(ZodCustom, fn, _params);
|
|
6163
6177
|
}
|
|
@@ -6242,6 +6256,7 @@ var activityEventSchema = object({
|
|
|
6242
6256
|
created_at: string2()
|
|
6243
6257
|
});
|
|
6244
6258
|
var listActivityInputSchema = object({
|
|
6259
|
+
eventType: string2().optional(),
|
|
6245
6260
|
event_type: string2().optional(),
|
|
6246
6261
|
from: string2().optional(),
|
|
6247
6262
|
to: string2().optional(),
|
|
@@ -6255,6 +6270,21 @@ var listActivityResponseSchema = object({
|
|
|
6255
6270
|
events: array(activityEventSchema),
|
|
6256
6271
|
next_cursor: string2().nullable()
|
|
6257
6272
|
});
|
|
6273
|
+
var activityEntrySchema = object({
|
|
6274
|
+
id: string2(),
|
|
6275
|
+
projectId: string2(),
|
|
6276
|
+
resourceType: string2(),
|
|
6277
|
+
resourceId: string2(),
|
|
6278
|
+
sourceExtensionId: string2().nullable(),
|
|
6279
|
+
eventType: string2(),
|
|
6280
|
+
actorType: activityActorTypeSchema,
|
|
6281
|
+
actorId: string2().nullable(),
|
|
6282
|
+
source: activitySourceSchema,
|
|
6283
|
+
summary: string2(),
|
|
6284
|
+
payloadJson: record(string2(), unknown()),
|
|
6285
|
+
createdAt: string2()
|
|
6286
|
+
});
|
|
6287
|
+
var activityPageSchema = object({ items: array(activityEntrySchema), nextCursor: string2().nullable() });
|
|
6258
6288
|
// ../pstdio-api-contracts/src/harness.ts
|
|
6259
6289
|
var AGENT_CAPABILITIES = [
|
|
6260
6290
|
"SessionFork",
|
|
@@ -6310,6 +6340,313 @@ var agentModelSchema = object({
|
|
|
6310
6340
|
paramOverrides: record(string2(), harnessParamDescriptorSchema.nullable()).optional()
|
|
6311
6341
|
});
|
|
6312
6342
|
var harnessLocalId = (id) => id.slice(id.lastIndexOf(".") + 1);
|
|
6343
|
+
var agentDetailsSchema = agentInfoSchema.extend({
|
|
6344
|
+
skills: agentSkillsLayoutSchema.extend({ globalDir: string2() }).optional()
|
|
6345
|
+
});
|
|
6346
|
+
// ../pstdio-sync-contracts/src/compatibility.ts
|
|
6347
|
+
var peerSchema = strictObject({
|
|
6348
|
+
release: string2().min(1),
|
|
6349
|
+
protocolVersions: array(number2().int().positive()).min(1),
|
|
6350
|
+
supportedFeatures: array(string2().min(1)),
|
|
6351
|
+
requiredFeatures: array(string2().min(1))
|
|
6352
|
+
});
|
|
6353
|
+
var protocolPeer = {
|
|
6354
|
+
release: "contracts-v1",
|
|
6355
|
+
protocolVersions: [1],
|
|
6356
|
+
supportedFeatures: ["atomic-groups", "retained-recovery", "revisioned-resolution"],
|
|
6357
|
+
requiredFeatures: ["atomic-groups", "retained-recovery", "revisioned-resolution"]
|
|
6358
|
+
};
|
|
6359
|
+
function negotiate(client, relay) {
|
|
6360
|
+
const common = client.protocolVersions.includes(1) && relay.protocolVersions.includes(1);
|
|
6361
|
+
const features = client.requiredFeatures.every((feature) => relay.supportedFeatures.includes(feature)) && relay.requiredFeatures.every((feature) => client.supportedFeatures.includes(feature));
|
|
6362
|
+
if (common && features)
|
|
6363
|
+
return { status: "compatible", protocolVersion: 1 };
|
|
6364
|
+
return {
|
|
6365
|
+
status: "unsupported-protocol",
|
|
6366
|
+
recoverable: true,
|
|
6367
|
+
action: "Update the local runtime or relay to a common protocol and required feature set. Local work remains saved; retry after updating."
|
|
6368
|
+
};
|
|
6369
|
+
}
|
|
6370
|
+
// ../pstdio-sync-contracts/src/json.ts
|
|
6371
|
+
function isJson(value) {
|
|
6372
|
+
try {
|
|
6373
|
+
JSON.stringify(value);
|
|
6374
|
+
} catch {
|
|
6375
|
+
return false;
|
|
6376
|
+
}
|
|
6377
|
+
const queue = [value];
|
|
6378
|
+
const visited = new Set;
|
|
6379
|
+
while (queue.length) {
|
|
6380
|
+
const item = queue.pop();
|
|
6381
|
+
if (item === null || typeof item === "string" || typeof item === "boolean")
|
|
6382
|
+
continue;
|
|
6383
|
+
if (typeof item === "number" && Number.isFinite(item))
|
|
6384
|
+
continue;
|
|
6385
|
+
if (typeof item !== "object" || item === null)
|
|
6386
|
+
return false;
|
|
6387
|
+
if (visited.has(item))
|
|
6388
|
+
continue;
|
|
6389
|
+
visited.add(item);
|
|
6390
|
+
if (Array.isArray(item))
|
|
6391
|
+
queue.push(...item);
|
|
6392
|
+
else {
|
|
6393
|
+
const prototype = Object.getPrototypeOf(item);
|
|
6394
|
+
if (prototype !== Object.prototype && prototype !== null)
|
|
6395
|
+
return false;
|
|
6396
|
+
queue.push(...Object.values(item));
|
|
6397
|
+
}
|
|
6398
|
+
}
|
|
6399
|
+
return true;
|
|
6400
|
+
}
|
|
6401
|
+
var jsonSchema = custom(isJson, "Expected a JSON value without loss of object keys");
|
|
6402
|
+
function dictionarySchema(valueSchema) {
|
|
6403
|
+
return custom((value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => valueSchema.safeParse(entry).success), "Invalid dictionary");
|
|
6404
|
+
}
|
|
6405
|
+
|
|
6406
|
+
// ../pstdio-sync-contracts/src/wire.ts
|
|
6407
|
+
var identitySchema = string2().min(1);
|
|
6408
|
+
var revisionSchema = number2().int().nonnegative();
|
|
6409
|
+
var fingerprintSchema = string2().regex(/^[a-f0-9]{64}$/);
|
|
6410
|
+
var scopeSchema = strictObject({
|
|
6411
|
+
accountId: identitySchema,
|
|
6412
|
+
workbenchId: identitySchema,
|
|
6413
|
+
extensionId: identitySchema
|
|
6414
|
+
});
|
|
6415
|
+
var assetSchema = strictObject({
|
|
6416
|
+
sha256: fingerprintSchema,
|
|
6417
|
+
byteLength: revisionSchema,
|
|
6418
|
+
mediaType: identitySchema
|
|
6419
|
+
});
|
|
6420
|
+
var sharedSchema = discriminatedUnion("kind", [
|
|
6421
|
+
strictObject({ kind: literal("text"), update: string2().min(1) }),
|
|
6422
|
+
strictObject({ kind: literal("list"), update: string2().min(1) }),
|
|
6423
|
+
strictObject({
|
|
6424
|
+
kind: literal("map"),
|
|
6425
|
+
entries: array(strictObject({
|
|
6426
|
+
key: string2(),
|
|
6427
|
+
expected: fingerprintSchema,
|
|
6428
|
+
next: discriminatedUnion("kind", [
|
|
6429
|
+
strictObject({ kind: literal("set"), value: jsonSchema }),
|
|
6430
|
+
strictObject({ kind: literal("delete") })
|
|
6431
|
+
])
|
|
6432
|
+
})).min(1)
|
|
6433
|
+
})
|
|
6434
|
+
]);
|
|
6435
|
+
var changeSchema = strictObject({
|
|
6436
|
+
recordId: identitySchema,
|
|
6437
|
+
expectedRevision: revisionSchema,
|
|
6438
|
+
baseDeleted: boolean2(),
|
|
6439
|
+
shared: sharedSchema.optional(),
|
|
6440
|
+
value: strictObject({ expected: fingerprintSchema, next: jsonSchema }).optional(),
|
|
6441
|
+
asset: strictObject({ base: assetSchema.nullable(), next: assetSchema.nullable() }).optional(),
|
|
6442
|
+
deleted: boolean2().optional()
|
|
6443
|
+
});
|
|
6444
|
+
var resolutionSchema = strictObject({
|
|
6445
|
+
conflictId: identitySchema,
|
|
6446
|
+
expectedConflicts: array(strictObject({ conflictId: identitySchema, revision: revisionSchema })).min(1),
|
|
6447
|
+
capturedOperationIds: array(identitySchema).min(1),
|
|
6448
|
+
expectedInputs: array(strictObject({ recordId: identitySchema, revision: revisionSchema })).min(1),
|
|
6449
|
+
handler: strictObject({ publishedRevision: identitySchema, handlerId: identitySchema }).optional()
|
|
6450
|
+
});
|
|
6451
|
+
var mutationBodySchema = strictObject({
|
|
6452
|
+
protocolVersion: literal(1),
|
|
6453
|
+
scope: scopeSchema,
|
|
6454
|
+
environmentId: identitySchema,
|
|
6455
|
+
operationId: identitySchema,
|
|
6456
|
+
parents: array(identitySchema),
|
|
6457
|
+
changes: array(changeSchema).min(1),
|
|
6458
|
+
resolution: resolutionSchema.optional()
|
|
6459
|
+
});
|
|
6460
|
+
var localOperationSchema = mutationBodySchema.omit({ protocolVersion: true, scope: true }).superRefine(checkGroup);
|
|
6461
|
+
var mutationSchema = mutationBodySchema.extend({ fingerprint: fingerprintSchema }).superRefine(checkGroup);
|
|
6462
|
+
function checkGroup(value, ctx) {
|
|
6463
|
+
const unique = (values) => new Set(values).size === values.length;
|
|
6464
|
+
const records = value.changes.map((change) => change.recordId);
|
|
6465
|
+
if (!unique(records) || !unique(value.parents) || value.parents.includes(value.operationId)) {
|
|
6466
|
+
ctx.addIssue({
|
|
6467
|
+
code: "custom",
|
|
6468
|
+
message: "Records and parents must be unique; operations cannot depend on themselves"
|
|
6469
|
+
});
|
|
6470
|
+
}
|
|
6471
|
+
for (const change of value.changes) {
|
|
6472
|
+
if (!change.shared && !change.value && !change.asset && change.deleted === undefined) {
|
|
6473
|
+
ctx.addIssue({ code: "custom", message: "A record change must contain an edit" });
|
|
6474
|
+
}
|
|
6475
|
+
if (change.shared?.kind === "map" && !unique(change.shared.entries.map((entry) => entry.key))) {
|
|
6476
|
+
ctx.addIssue({ code: "custom", message: "Map keys must be unique within a change" });
|
|
6477
|
+
}
|
|
6478
|
+
}
|
|
6479
|
+
const resolution = value.resolution;
|
|
6480
|
+
if (!resolution)
|
|
6481
|
+
return;
|
|
6482
|
+
const inputs = resolution.expectedInputs.map((input) => input.recordId);
|
|
6483
|
+
if (!unique(resolution.expectedConflicts.map((input) => input.conflictId)) || !resolution.expectedConflicts.some((input) => input.conflictId === resolution.conflictId) || !unique(inputs) || inputs.length !== records.length || records.some((id) => !inputs.includes(id)) || !unique(resolution.capturedOperationIds) || resolution.capturedOperationIds.some((id) => !value.parents.includes(id))) {
|
|
6484
|
+
ctx.addIssue({
|
|
6485
|
+
code: "custom",
|
|
6486
|
+
message: "Resolution inputs must cover the whole group and captured operations must be parents"
|
|
6487
|
+
});
|
|
6488
|
+
}
|
|
6489
|
+
}
|
|
6490
|
+
|
|
6491
|
+
// ../pstdio-sync-contracts/src/fingerprint.ts
|
|
6492
|
+
function canonicalJson(value) {
|
|
6493
|
+
if (Array.isArray(value))
|
|
6494
|
+
return `[${value.map(canonicalJson).join(",")}]`;
|
|
6495
|
+
if (value !== null && typeof value === "object") {
|
|
6496
|
+
return `{${Object.keys(value).filter((key) => value[key] !== undefined).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson(value[key])}`).join(",")}}`;
|
|
6497
|
+
}
|
|
6498
|
+
return JSON.stringify(value);
|
|
6499
|
+
}
|
|
6500
|
+
async function fingerprint(value) {
|
|
6501
|
+
const bytes = new TextEncoder().encode(canonicalJson(value));
|
|
6502
|
+
const digest = await crypto.subtle.digest("SHA-256", bytes);
|
|
6503
|
+
return Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
6504
|
+
}
|
|
6505
|
+
async function sealMutation(body) {
|
|
6506
|
+
const parsed = mutationSchema.parse({ ...body, fingerprint: "0".repeat(64) });
|
|
6507
|
+
const { fingerprint: _ignored, ...normalized } = parsed;
|
|
6508
|
+
return { ...normalized, fingerprint: await fingerprint(normalized) };
|
|
6509
|
+
}
|
|
6510
|
+
async function validateMutation(input) {
|
|
6511
|
+
const mutation = mutationSchema.parse(input);
|
|
6512
|
+
const { fingerprint: supplied, ...body } = mutation;
|
|
6513
|
+
if (await fingerprint(body) !== supplied)
|
|
6514
|
+
throw new Error("Payload fingerprint does not match");
|
|
6515
|
+
return mutation;
|
|
6516
|
+
}
|
|
6517
|
+
// ../pstdio-sync-contracts/src/identity.ts
|
|
6518
|
+
var environmentIdentitySchema = strictObject({ environmentId: identitySchema });
|
|
6519
|
+
var environmentTargetSchema = environmentIdentitySchema.extend({
|
|
6520
|
+
workbenchId: identitySchema,
|
|
6521
|
+
workspaceId: identitySchema
|
|
6522
|
+
});
|
|
6523
|
+
// ../pstdio-sync-contracts/src/state.ts
|
|
6524
|
+
var checkpointSchema = strictObject({ epoch: identitySchema, sequence: revisionSchema });
|
|
6525
|
+
var recordSchema = strictObject({
|
|
6526
|
+
recordId: identitySchema,
|
|
6527
|
+
revision: revisionSchema,
|
|
6528
|
+
deleted: boolean2(),
|
|
6529
|
+
primitive: _enum(["text", "list", "map"]).nullable(),
|
|
6530
|
+
shared: strictObject({ kind: _enum(["text", "list"]), update: string2() }).optional(),
|
|
6531
|
+
map: dictionarySchema(jsonSchema),
|
|
6532
|
+
value: jsonSchema,
|
|
6533
|
+
asset: assetSchema.nullable()
|
|
6534
|
+
});
|
|
6535
|
+
var conflictSchema = strictObject({
|
|
6536
|
+
conflictId: identitySchema,
|
|
6537
|
+
revision: revisionSchema,
|
|
6538
|
+
recordIds: array(identitySchema).min(1),
|
|
6539
|
+
alternativeOperationIds: array(identitySchema).min(1),
|
|
6540
|
+
resolvedBy: identitySchema.optional()
|
|
6541
|
+
});
|
|
6542
|
+
var receiptSchema = strictObject({
|
|
6543
|
+
order: revisionSchema,
|
|
6544
|
+
operationId: identitySchema,
|
|
6545
|
+
fingerprint: fingerprintSchema,
|
|
6546
|
+
mutation: mutationSchema,
|
|
6547
|
+
status: _enum(["accepted", "conflict", "pending"]),
|
|
6548
|
+
reason: string2().optional(),
|
|
6549
|
+
checkpoint: checkpointSchema.nullable(),
|
|
6550
|
+
conflictId: identitySchema.optional(),
|
|
6551
|
+
recoveryProof: fingerprintSchema.optional()
|
|
6552
|
+
}).superRefine((receipt, ctx) => {
|
|
6553
|
+
const identityMatches = receipt.operationId === receipt.mutation.operationId && receipt.fingerprint === receipt.mutation.fingerprint;
|
|
6554
|
+
const accepted = receipt.status === "accepted";
|
|
6555
|
+
if (!identityMatches || accepted !== (receipt.checkpoint !== null) || receipt.status === "conflict" && !receipt.conflictId) {
|
|
6556
|
+
ctx.addIssue({ code: "custom", message: "Receipt identity, fingerprint, outcome and checkpoint must agree" });
|
|
6557
|
+
}
|
|
6558
|
+
});
|
|
6559
|
+
var snapshotSchema = strictObject({
|
|
6560
|
+
protocolVersion: literal(1),
|
|
6561
|
+
scope: scopeSchema,
|
|
6562
|
+
journalSequence: revisionSchema,
|
|
6563
|
+
checkpoint: checkpointSchema,
|
|
6564
|
+
records: dictionarySchema(recordSchema),
|
|
6565
|
+
receipts: dictionarySchema(receiptSchema),
|
|
6566
|
+
conflicts: dictionarySchema(conflictSchema),
|
|
6567
|
+
publishedRevision: identitySchema
|
|
6568
|
+
});
|
|
6569
|
+
var syncOutcomeSchema = discriminatedUnion("status", [
|
|
6570
|
+
strictObject({ status: literal("saved-locally"), operationId: identitySchema }),
|
|
6571
|
+
strictObject({ status: literal("pending"), operationId: identitySchema, reason: string2() }),
|
|
6572
|
+
strictObject({ status: literal("synchronized"), operationId: identitySchema, checkpoint: checkpointSchema }),
|
|
6573
|
+
strictObject({
|
|
6574
|
+
status: literal("conflict"),
|
|
6575
|
+
operationId: identitySchema,
|
|
6576
|
+
conflictId: identitySchema,
|
|
6577
|
+
conflictRevision: revisionSchema
|
|
6578
|
+
})
|
|
6579
|
+
]);
|
|
6580
|
+
|
|
6581
|
+
// ../pstdio-sync-contracts/src/replay.ts
|
|
6582
|
+
var replaySchema = strictObject({
|
|
6583
|
+
protocolVersion: literal(1),
|
|
6584
|
+
scope: scopeSchema,
|
|
6585
|
+
after: checkpointSchema,
|
|
6586
|
+
through: checkpointSchema,
|
|
6587
|
+
groups: array(receiptSchema)
|
|
6588
|
+
}).superRefine((batch, ctx) => {
|
|
6589
|
+
const sameEpoch = batch.after.epoch === batch.through.epoch;
|
|
6590
|
+
const complete = batch.through.sequence - batch.after.sequence === batch.groups.length;
|
|
6591
|
+
const validGroups = batch.groups.every((group, index) => group.status === "accepted" && group.checkpoint?.epoch === batch.through.epoch && group.checkpoint.sequence === batch.after.sequence + index + 1 && canonicalJson(group.mutation.scope) === canonicalJson(batch.scope));
|
|
6592
|
+
const unique = new Set(batch.groups.map((group) => group.operationId)).size === batch.groups.length;
|
|
6593
|
+
if (!sameEpoch || !complete || !validGroups || !unique)
|
|
6594
|
+
ctx.addIssue({
|
|
6595
|
+
code: "custom",
|
|
6596
|
+
message: "Replay must contain contiguous complete accepted groups in one scope and epoch"
|
|
6597
|
+
});
|
|
6598
|
+
});
|
|
6599
|
+
// ../pstdio-sync-contracts/src/transport.ts
|
|
6600
|
+
var relayOperationSchema = _enum([
|
|
6601
|
+
"initialize",
|
|
6602
|
+
"snapshot",
|
|
6603
|
+
"replay",
|
|
6604
|
+
"submit",
|
|
6605
|
+
"recover",
|
|
6606
|
+
"changes",
|
|
6607
|
+
"assets/begin",
|
|
6608
|
+
"assets/part",
|
|
6609
|
+
"assets/finish",
|
|
6610
|
+
"assets/cancel",
|
|
6611
|
+
"assets/read"
|
|
6612
|
+
]);
|
|
6613
|
+
var relayRecoverySchema = strictObject({ mutation: mutationSchema, proof: fingerprintSchema });
|
|
6614
|
+
var targetSchema = strictObject({ workbenchId: identitySchema, extensionId: identitySchema });
|
|
6615
|
+
var relayReplayResultSchema = discriminatedUnion("status", [
|
|
6616
|
+
strictObject({ status: literal("replay"), batch: replaySchema }),
|
|
6617
|
+
strictObject({ status: literal("snapshot-required"), checkpoint: checkpointSchema })
|
|
6618
|
+
]);
|
|
6619
|
+
var byteLengthSchema = number2().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
6620
|
+
var relayAssetBeginSchema = strictObject({ uploadId: identitySchema, asset: assetSchema });
|
|
6621
|
+
var relayAssetUploadSchema = strictObject({ uploadId: identitySchema });
|
|
6622
|
+
var relayAssetPartSchema = strictObject({
|
|
6623
|
+
uploadId: identitySchema,
|
|
6624
|
+
number: number2().int().min(1).max(1e4),
|
|
6625
|
+
sha256: fingerprintSchema,
|
|
6626
|
+
byteLength: byteLengthSchema
|
|
6627
|
+
});
|
|
6628
|
+
var relayAssetReadSchema = strictObject({ asset: assetSchema, offset: byteLengthSchema }).refine(({ asset, offset }) => offset <= asset.byteLength, "Offset exceeds the asset");
|
|
6629
|
+
var relayAssetStatusSchema = strictObject({
|
|
6630
|
+
asset: assetSchema,
|
|
6631
|
+
partSize: number2().int().positive(),
|
|
6632
|
+
completed: boolean2(),
|
|
6633
|
+
parts: array(strictObject({ number: number2().int().positive(), sha256: fingerprintSchema, byteLength: byteLengthSchema }))
|
|
6634
|
+
});
|
|
6635
|
+
var relayEventSchema = strictObject({ protocolVersion: literal(1), type: _enum(["ready", "changed"]) });
|
|
6636
|
+
var relayInitializeSchema = strictObject({ publishedRevision: identitySchema });
|
|
6637
|
+
// ../pstdio-api-contracts/src/assets.ts
|
|
6638
|
+
var assetReferenceSchema = assetSchema;
|
|
6639
|
+
var assetOwnerSchema = strictObject({ workbenchId: identitySchema, extensionId: identitySchema });
|
|
6640
|
+
var assetTransferSchema = discriminatedUnion("status", [
|
|
6641
|
+
strictObject({
|
|
6642
|
+
status: literal("staging"),
|
|
6643
|
+
operationId: identitySchema,
|
|
6644
|
+
expected: assetReferenceSchema,
|
|
6645
|
+
uploadedByteLength: revisionSchema
|
|
6646
|
+
}),
|
|
6647
|
+
strictObject({ status: literal("complete"), operationId: identitySchema, asset: assetReferenceSchema }),
|
|
6648
|
+
strictObject({ status: literal("cancelled"), operationId: identitySchema, expected: assetReferenceSchema })
|
|
6649
|
+
]);
|
|
6313
6650
|
// ../pstdio-api-contracts/src/extensions/common.ts
|
|
6314
6651
|
var jsonObjectSchema = record(string2(), unknown());
|
|
6315
6652
|
var serializableJsonObjectSchema = record(string2(), json()).meta({
|
|
@@ -6484,6 +6821,7 @@ var workbenchAttachmentTargetSchema = union([
|
|
|
6484
6821
|
var workbenchSettingsScopeSchema = _enum(workbenchSettingsScopes);
|
|
6485
6822
|
|
|
6486
6823
|
// ../pstdio-api-contracts/src/extensions/commands.ts
|
|
6824
|
+
var commandParamDescriptorSchema = object({ type: string2(), description: localizableStringSchema.optional() }).catchall(unknown());
|
|
6487
6825
|
var extensionCommandRecordSchema = object({
|
|
6488
6826
|
id: string2(),
|
|
6489
6827
|
extensionId: string2(),
|
|
@@ -6498,9 +6836,9 @@ var extensionCommandRecordSchema = object({
|
|
|
6498
6836
|
object({ kind: literal("rename"), resourceType: string2(), idParam: string2(), labelParam: string2() }),
|
|
6499
6837
|
object({ kind: literal("remove"), resourceType: string2(), idParam: string2() })
|
|
6500
6838
|
]).optional(),
|
|
6501
|
-
params: record(string2(),
|
|
6839
|
+
params: record(string2(), commandParamDescriptorSchema).optional()
|
|
6502
6840
|
});
|
|
6503
|
-
var extensionParamObjectSchema = record(string2(),
|
|
6841
|
+
var extensionParamObjectSchema = record(string2(), commandParamDescriptorSchema);
|
|
6504
6842
|
var extensionMiddlewareRecordSchema = object({
|
|
6505
6843
|
id: string2(),
|
|
6506
6844
|
extensionId: string2(),
|
|
@@ -6822,6 +7160,57 @@ var navigationTargetSchema = union([
|
|
|
6822
7160
|
object({ kind: literal("compound"), targets: array(navigationOperationSchema).min(1) })
|
|
6823
7161
|
]);
|
|
6824
7162
|
|
|
7163
|
+
// ../pstdio-api-contracts/src/extensions/command-outcome.ts
|
|
7164
|
+
var notice = object({
|
|
7165
|
+
type: _enum(["info", "success", "warning", "error"]),
|
|
7166
|
+
title: string2().optional(),
|
|
7167
|
+
message: string2(),
|
|
7168
|
+
metadata: serializableJsonObjectSchema.optional()
|
|
7169
|
+
});
|
|
7170
|
+
var diagnostic = object({
|
|
7171
|
+
code: string2(),
|
|
7172
|
+
message: string2(),
|
|
7173
|
+
severity: _enum(["info", "warning", "error"]),
|
|
7174
|
+
extensionId: string2().optional(),
|
|
7175
|
+
commandId: string2().optional(),
|
|
7176
|
+
metadata: serializableJsonObjectSchema.optional()
|
|
7177
|
+
});
|
|
7178
|
+
var createCommandOutcomeSchema = (jsonValue) => {
|
|
7179
|
+
const error = object({
|
|
7180
|
+
name: string2().optional(),
|
|
7181
|
+
message: string2(),
|
|
7182
|
+
stack: string2().optional(),
|
|
7183
|
+
cause: jsonValue.optional()
|
|
7184
|
+
});
|
|
7185
|
+
const annotations = {
|
|
7186
|
+
notices: array(notice).optional(),
|
|
7187
|
+
diagnostics: array(diagnostic).optional()
|
|
7188
|
+
};
|
|
7189
|
+
const failure = {
|
|
7190
|
+
...annotations,
|
|
7191
|
+
ok: literal(false),
|
|
7192
|
+
code: string2().optional(),
|
|
7193
|
+
reason: string2(),
|
|
7194
|
+
data: serializableJsonObjectSchema.optional(),
|
|
7195
|
+
cause: jsonValue.optional(),
|
|
7196
|
+
error: error.optional()
|
|
7197
|
+
};
|
|
7198
|
+
const navigation = navigationTargetSchema;
|
|
7199
|
+
const outcome = discriminatedUnion("status", [
|
|
7200
|
+
object({
|
|
7201
|
+
...annotations,
|
|
7202
|
+
ok: literal(true),
|
|
7203
|
+
status: literal("success"),
|
|
7204
|
+
value: unknown().optional(),
|
|
7205
|
+
navigationRequests: array(navigation).optional()
|
|
7206
|
+
}).transform((outcome) => ({ ...outcome, value: outcome.value })),
|
|
7207
|
+
object({ ...failure, status: literal("rejected") }),
|
|
7208
|
+
object({ ...failure, status: literal("error") })
|
|
7209
|
+
]);
|
|
7210
|
+
return outcome;
|
|
7211
|
+
};
|
|
7212
|
+
var validatedCommandOutcomeSchema = createCommandOutcomeSchema(json());
|
|
7213
|
+
|
|
6825
7214
|
// ../pstdio-api-contracts/src/extensions/execute.ts
|
|
6826
7215
|
var extensionSlotInvocationSchema = object({
|
|
6827
7216
|
id: string2(),
|
|
@@ -6865,25 +7254,6 @@ var dispatchExtensionEventBodySchema = object({
|
|
|
6865
7254
|
eventId: string2().min(1),
|
|
6866
7255
|
payload: jsonObjectSchema
|
|
6867
7256
|
}).strict();
|
|
6868
|
-
var serializedErrorSchema = object({
|
|
6869
|
-
name: string2().optional(),
|
|
6870
|
-
message: string2(),
|
|
6871
|
-
stack: string2().optional()
|
|
6872
|
-
});
|
|
6873
|
-
var commandNoticeSchema = object({
|
|
6874
|
-
type: _enum(["info", "success", "warning", "error"]),
|
|
6875
|
-
title: string2().optional(),
|
|
6876
|
-
message: string2(),
|
|
6877
|
-
metadata: jsonObjectSchema.optional()
|
|
6878
|
-
});
|
|
6879
|
-
var commandDiagnosticSchema = object({
|
|
6880
|
-
code: string2(),
|
|
6881
|
-
message: string2(),
|
|
6882
|
-
severity: _enum(["info", "warning", "error"]),
|
|
6883
|
-
extensionId: string2().optional(),
|
|
6884
|
-
commandId: string2().optional(),
|
|
6885
|
-
metadata: jsonObjectSchema.optional()
|
|
6886
|
-
});
|
|
6887
7257
|
var responseNavigationTargetSchema = navigationTargetSchema;
|
|
6888
7258
|
var commandOutcomeSchema = object({
|
|
6889
7259
|
ok: boolean2(),
|
|
@@ -6893,16 +7263,33 @@ var commandOutcomeSchema = object({
|
|
|
6893
7263
|
code: string2().optional(),
|
|
6894
7264
|
reason: string2().optional(),
|
|
6895
7265
|
data: jsonObjectSchema.optional(),
|
|
6896
|
-
error:
|
|
6897
|
-
notices: array(
|
|
6898
|
-
|
|
7266
|
+
error: object({ name: string2().optional(), message: string2(), stack: string2().optional() }).optional(),
|
|
7267
|
+
notices: array(object({
|
|
7268
|
+
type: _enum(["info", "success", "warning", "error"]),
|
|
7269
|
+
title: string2().optional(),
|
|
7270
|
+
message: string2(),
|
|
7271
|
+
metadata: jsonObjectSchema.optional()
|
|
7272
|
+
})).optional(),
|
|
7273
|
+
diagnostics: array(object({
|
|
7274
|
+
code: string2(),
|
|
7275
|
+
message: string2(),
|
|
7276
|
+
severity: _enum(["info", "warning", "error"]),
|
|
7277
|
+
extensionId: string2().optional(),
|
|
7278
|
+
commandId: string2().optional(),
|
|
7279
|
+
metadata: jsonObjectSchema.optional()
|
|
7280
|
+
})).optional()
|
|
6899
7281
|
});
|
|
6900
|
-
var
|
|
7282
|
+
var responseFields = {
|
|
6901
7283
|
commandId: string2(),
|
|
6902
7284
|
extensionId: string2(),
|
|
6903
|
-
eventIds: array(string2()).optional()
|
|
7285
|
+
eventIds: array(string2()).optional()
|
|
7286
|
+
};
|
|
7287
|
+
var commandExecuteResponseSchema = object({
|
|
7288
|
+
...responseFields,
|
|
6904
7289
|
outcome: commandOutcomeSchema
|
|
6905
7290
|
});
|
|
7291
|
+
var createCommandExecutionResultSchema = (jsonValue) => object({ ...responseFields, outcome: createCommandOutcomeSchema(jsonValue) });
|
|
7292
|
+
var commandExecutionResultSchema = createCommandExecutionResultSchema(json());
|
|
6906
7293
|
|
|
6907
7294
|
// ../pstdio-api-contracts/src/extensions/control-declarations.ts
|
|
6908
7295
|
var base = { id: string2(), name: string2(), description: string2().optional(), readOnly: boolean2().optional() };
|
|
@@ -7308,14 +7695,6 @@ var kanbanRendererEnumOptionSchema = object({
|
|
|
7308
7695
|
var kanbanRendererAttributeTypeSchema = discriminatedUnion("kind", [
|
|
7309
7696
|
object({ kind: literal("enum"), options: array(kanbanRendererEnumOptionSchema) }),
|
|
7310
7697
|
object({ kind: literal("enum-multi"), options: array(kanbanRendererEnumOptionSchema) }),
|
|
7311
|
-
object({
|
|
7312
|
-
kind: literal("status"),
|
|
7313
|
-
statuses: object({
|
|
7314
|
-
extensionId: string2().optional(),
|
|
7315
|
-
kind: literal("status"),
|
|
7316
|
-
id: string2()
|
|
7317
|
-
})
|
|
7318
|
-
}),
|
|
7319
7698
|
object({ kind: literal("boolean"), legacyValues: record(string2(), boolean2()).optional() }),
|
|
7320
7699
|
object({ kind: literal("string") }),
|
|
7321
7700
|
object({ kind: literal("date") }),
|
|
@@ -7348,8 +7727,7 @@ var kanbanRendererSavedViewSchema = object({
|
|
|
7348
7727
|
title: localizableStringSchema,
|
|
7349
7728
|
settings: kanbanViewSettingsSchema,
|
|
7350
7729
|
filter: viewFilterGroupSchema,
|
|
7351
|
-
sorts: viewSortsSchema
|
|
7352
|
-
isDefault: boolean2().optional()
|
|
7730
|
+
sorts: viewSortsSchema
|
|
7353
7731
|
});
|
|
7354
7732
|
var extensionKanbanRendererCreateRowSchema = object({
|
|
7355
7733
|
commandId: string2(),
|
|
@@ -7383,7 +7761,6 @@ var extensionKanbanRendererRecordSchema = extensionRendererRecordBaseSchema.exte
|
|
|
7383
7761
|
attributes: array(kanbanRendererAttributeSchema).optional(),
|
|
7384
7762
|
queryHandlerId: string2(),
|
|
7385
7763
|
attributeChangeHandlerId: string2().optional(),
|
|
7386
|
-
reorderHandlerId: string2().optional(),
|
|
7387
7764
|
moveHandlerId: string2().optional(),
|
|
7388
7765
|
schemaRefreshEventIds: array(string2()).optional(),
|
|
7389
7766
|
columnActionHandlerId: string2().optional(),
|
|
@@ -7557,7 +7934,6 @@ var modeRefSchema2 = contributionRefSchema2("mode");
|
|
|
7557
7934
|
var pageRefSchema2 = contributionRefSchema2("page");
|
|
7558
7935
|
var resourceKindRefSchema2 = contributionRefSchema2("resource-kind");
|
|
7559
7936
|
var settingsSectionRefSchema = contributionRefSchema2("settings-section");
|
|
7560
|
-
var statusRefSchema = contributionRefSchema2("status");
|
|
7561
7937
|
var viewRefSchema2 = contributionRefSchema2("view");
|
|
7562
7938
|
var normalizedWhenSchema = object({
|
|
7563
7939
|
mode: union([modeRefSchema2, array(modeRefSchema2)]).optional(),
|
|
@@ -7686,6 +8062,8 @@ var workbenchExtensionResourceKindRecordSchema = object({
|
|
|
7686
8062
|
icon: string2().optional(),
|
|
7687
8063
|
resolveCommand: string2().optional(),
|
|
7688
8064
|
resolveManyCommand: string2().optional(),
|
|
8065
|
+
relatedOpeningsCommand: string2().optional(),
|
|
8066
|
+
paths: array(object({ prefix: string2(), resolveCommand: string2() })).optional(),
|
|
7689
8067
|
menuSlots: array(object({
|
|
7690
8068
|
id: string2(),
|
|
7691
8069
|
placement: _enum(["header-primary", "header-overflow", "context-menu"]),
|
|
@@ -7709,15 +8087,6 @@ var workbenchExtensionStatusBarItemRecordSchema = object({
|
|
|
7709
8087
|
order: number2().optional(),
|
|
7710
8088
|
when: normalizedWhenSchema.optional()
|
|
7711
8089
|
});
|
|
7712
|
-
var workbenchExtensionStatusRecordSchema = object({
|
|
7713
|
-
id: string2(),
|
|
7714
|
-
localId: string2(),
|
|
7715
|
-
extensionId: string2(),
|
|
7716
|
-
title: localizableStringSchema,
|
|
7717
|
-
actions: array(object({ id: string2(), label: localizableStringSchema, icon: string2().optional() })).optional(),
|
|
7718
|
-
queryHandlerId: string2(),
|
|
7719
|
-
saveHandlerId: string2().optional()
|
|
7720
|
-
});
|
|
7721
8090
|
var workbenchExtensionMetadataSchema = object({
|
|
7722
8091
|
extensions: array(extensionRecordSchema),
|
|
7723
8092
|
commands: array(extensionCommandRecordSchema),
|
|
@@ -7733,7 +8102,6 @@ var workbenchExtensionMetadataSchema = object({
|
|
|
7733
8102
|
navigationItems: array(workbenchExtensionNavigationItemRecordSchema),
|
|
7734
8103
|
navigationTrees: array(workbenchExtensionNavigationTreeRecordSchema),
|
|
7735
8104
|
statusBarItems: array(workbenchExtensionStatusBarItemRecordSchema),
|
|
7736
|
-
statuses: array(workbenchExtensionStatusRecordSchema),
|
|
7737
8105
|
activityItems: array(object({
|
|
7738
8106
|
id: string2(),
|
|
7739
8107
|
extensionId: string2(),
|
|
@@ -7807,7 +8175,6 @@ var checkWorkbenchMetadataSchema = workbenchExtensionMetadataSchema.pick({
|
|
|
7807
8175
|
navigationItems: true,
|
|
7808
8176
|
navigationTrees: true,
|
|
7809
8177
|
statusBarItems: true,
|
|
7810
|
-
statuses: true,
|
|
7811
8178
|
activityItems: true,
|
|
7812
8179
|
settingsSections: true,
|
|
7813
8180
|
settingsPanels: true,
|
|
@@ -7990,6 +8357,13 @@ var extensionDiagnosticsResponseSchema = object({
|
|
|
7990
8357
|
check: extensionsCheckResponseSchema
|
|
7991
8358
|
}))
|
|
7992
8359
|
});
|
|
8360
|
+
// ../pstdio-api-contracts/src/extensions/related-resource-opening.ts
|
|
8361
|
+
var relatedResourceOpeningSchema = object({
|
|
8362
|
+
resource: extensionResourceRefSchema,
|
|
8363
|
+
autoOpen: boolean2().optional(),
|
|
8364
|
+
region: _enum(extensionPanelRegions),
|
|
8365
|
+
open: _enum(["preview", "pin"]).optional()
|
|
8366
|
+
});
|
|
7993
8367
|
// ../pstdio-api-contracts/src/automation.ts
|
|
7994
8368
|
var automationRunStatusSchema = _enum(["queued", "running", "succeeded", "failed", "cancelled", "rejected"]);
|
|
7995
8369
|
var issueAutomationTokenInputSchema = object({
|
|
@@ -8087,78 +8461,304 @@ var boardViewCreateSchema = boardViewUpdateSchema.extend({
|
|
|
8087
8461
|
title: string2().trim().min(1),
|
|
8088
8462
|
copyFrom: string2().optional()
|
|
8089
8463
|
});
|
|
8090
|
-
// ../pstdio-api-contracts/src/
|
|
8091
|
-
var
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8464
|
+
// ../pstdio-api-contracts/src/data-migration.ts
|
|
8465
|
+
var createDataMigrationRunner = (store) => {
|
|
8466
|
+
let pending = Promise.resolve();
|
|
8467
|
+
return (version, run) => {
|
|
8468
|
+
const result = pending.then(async () => {
|
|
8469
|
+
if (!Number.isSafeInteger(version) || version < 1)
|
|
8470
|
+
throw new Error("Migration version must be a positive safe integer.");
|
|
8471
|
+
const previous = await store.readVersion();
|
|
8472
|
+
if (!Number.isSafeInteger(previous) || previous < 0)
|
|
8473
|
+
throw new Error("Stored migration version is invalid.");
|
|
8474
|
+
if (previous > version)
|
|
8475
|
+
throw new Error("Stored data has a newer migration version.");
|
|
8476
|
+
if (previous === version)
|
|
8477
|
+
return;
|
|
8478
|
+
await run(previous);
|
|
8479
|
+
await store.writeVersion(version);
|
|
8480
|
+
});
|
|
8481
|
+
pending = result.catch(() => {});
|
|
8482
|
+
return result;
|
|
8109
8483
|
};
|
|
8110
8484
|
};
|
|
8111
|
-
// ../pstdio-api-contracts/src/
|
|
8112
|
-
var
|
|
8113
|
-
|
|
8114
|
-
|
|
8115
|
-
sessions: hostRef("mode", "sessions"),
|
|
8116
|
-
settings: hostRef("mode", "settings")
|
|
8117
|
-
};
|
|
8118
|
-
var workbenchModeDefinitions = {
|
|
8119
|
-
project: { ref: workbenchModes.project, regions: dockedWorkbenchRegions },
|
|
8120
|
-
sessions: { ref: workbenchModes.sessions, regions: dockedWorkbenchRegions },
|
|
8121
|
-
settings: { ref: workbenchModes.settings, regions: dockedWorkbenchRegions }
|
|
8122
|
-
};
|
|
8123
|
-
var hostResourceKind = (id, label, menuSlots) => ({
|
|
8124
|
-
id,
|
|
8125
|
-
ref: hostRef("resource-kind", id),
|
|
8126
|
-
label,
|
|
8127
|
-
menuSlots
|
|
8485
|
+
// ../pstdio-api-contracts/src/projects.ts
|
|
8486
|
+
var initialWorkspaceSchema = object({
|
|
8487
|
+
provider_id: string2().min(1),
|
|
8488
|
+
params: serializableJsonObjectSchema.default({})
|
|
8128
8489
|
});
|
|
8129
|
-
var
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8490
|
+
var extensionSetupWarningSchema = object({
|
|
8491
|
+
code: literal("extension_setup_failed"),
|
|
8492
|
+
extension: string2(),
|
|
8493
|
+
message: string2()
|
|
8494
|
+
});
|
|
8495
|
+
var projectSchema = object({
|
|
8496
|
+
id: string2(),
|
|
8497
|
+
name: string2(),
|
|
8498
|
+
shorthand: string2(),
|
|
8499
|
+
default_agent_id: string2().nullable(),
|
|
8500
|
+
default_agent_model: string2().nullable(),
|
|
8501
|
+
startup_script: string2().nullable(),
|
|
8502
|
+
created_at: string2(),
|
|
8503
|
+
updated_at: string2(),
|
|
8504
|
+
deleted_at: string2().nullable(),
|
|
8505
|
+
extension_warnings: array(extensionSetupWarningSchema).optional()
|
|
8506
|
+
});
|
|
8507
|
+
var createProjectInputSchema = object({
|
|
8508
|
+
name: string2().trim().min(1).optional(),
|
|
8509
|
+
initial_workspace: initialWorkspaceSchema,
|
|
8510
|
+
agents: array(string2().min(1)).min(1).optional()
|
|
8511
|
+
});
|
|
8512
|
+
var updateProjectInputSchema = object({
|
|
8513
|
+
name: string2().trim().min(1).optional(),
|
|
8514
|
+
default_agent_id: string2().min(1).nullable().optional(),
|
|
8515
|
+
default_agent_model: string2().min(1).nullable().optional()
|
|
8516
|
+
}).refine((value) => Object.keys(value).length > 0, {
|
|
8517
|
+
message: "At least one field must be provided"
|
|
8518
|
+
});
|
|
8519
|
+
var projectDetailsSchema = object({
|
|
8520
|
+
id: string2(),
|
|
8521
|
+
name: string2(),
|
|
8522
|
+
shorthand: string2(),
|
|
8523
|
+
defaultAgentId: string2().nullable(),
|
|
8524
|
+
defaultAgentModel: string2().nullable(),
|
|
8525
|
+
startupScript: string2().nullable(),
|
|
8526
|
+
createdAt: string2(),
|
|
8527
|
+
updatedAt: string2(),
|
|
8528
|
+
deletedAt: string2().nullable(),
|
|
8529
|
+
extensionWarnings: array(extensionSetupWarningSchema).optional()
|
|
8530
|
+
});
|
|
8531
|
+
var initialWorkspaceRequestSchema = object({
|
|
8532
|
+
providerId: string2().min(1),
|
|
8533
|
+
params: serializableJsonObjectSchema.default({})
|
|
8534
|
+
});
|
|
8535
|
+
var projectCreateRequestSchema = createProjectInputSchema.omit({ initial_workspace: true }).extend({ initialWorkspace: initialWorkspaceRequestSchema });
|
|
8536
|
+
var projectUpdateRequestSchema = object({
|
|
8537
|
+
name: string2().trim().min(1).optional(),
|
|
8538
|
+
defaultAgentId: string2().min(1).nullable().optional(),
|
|
8539
|
+
defaultAgentModel: string2().min(1).nullable().optional()
|
|
8540
|
+
}).strict().refine((value) => Object.keys(value).length > 0, { message: "At least one field must be provided" });
|
|
8541
|
+
|
|
8542
|
+
// ../pstdio-api-contracts/src/workspaces.ts
|
|
8543
|
+
var workspaceProviderRefShape = {
|
|
8544
|
+
version: number2().int().positive(),
|
|
8545
|
+
data: jsonObjectSchema
|
|
8142
8546
|
};
|
|
8143
|
-
var
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
|
|
8547
|
+
var workspaceProviderRefSchema = object(workspaceProviderRefShape);
|
|
8548
|
+
var workspaceProviderStates = [
|
|
8549
|
+
"provisioning",
|
|
8550
|
+
"ready",
|
|
8551
|
+
"failed",
|
|
8552
|
+
"cancelled",
|
|
8553
|
+
"archiving",
|
|
8554
|
+
"archived",
|
|
8555
|
+
"deleting",
|
|
8556
|
+
"provider_missing"
|
|
8557
|
+
];
|
|
8558
|
+
var workspaceProviderStateSchema = _enum(workspaceProviderStates);
|
|
8559
|
+
var workspaceExecutionKindSchema = _enum(["local", "remote"]);
|
|
8560
|
+
var workspaceCapabilitiesSchema = object({
|
|
8561
|
+
files: _enum(["none", "read", "write"]),
|
|
8562
|
+
diff: boolean2(),
|
|
8563
|
+
merge: boolean2(),
|
|
8564
|
+
rebase: boolean2(),
|
|
8565
|
+
delete: boolean2()
|
|
8566
|
+
});
|
|
8567
|
+
var workspaceProviderErrorSchema = object({
|
|
8568
|
+
code: string2(),
|
|
8569
|
+
message: string2(),
|
|
8570
|
+
retryable: boolean2(),
|
|
8571
|
+
occurred_at: string2()
|
|
8572
|
+
});
|
|
8573
|
+
var extensionWorkspaceFields = {
|
|
8574
|
+
projectId: string2(),
|
|
8575
|
+
isDefault: boolean2(),
|
|
8576
|
+
shorthand: string2(),
|
|
8577
|
+
rootPath: string2().nullable(),
|
|
8578
|
+
providerId: string2(),
|
|
8579
|
+
providerState: workspaceProviderStateSchema,
|
|
8580
|
+
executionKind: workspaceExecutionKindSchema,
|
|
8581
|
+
displayPath: string2().nullable(),
|
|
8582
|
+
capabilities: workspaceCapabilitiesSchema,
|
|
8583
|
+
setupError: string2().nullable(),
|
|
8584
|
+
createdAt: string2(),
|
|
8585
|
+
updatedAt: string2()
|
|
8149
8586
|
};
|
|
8150
|
-
var
|
|
8151
|
-
|
|
8152
|
-
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
8157
|
-
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
|
|
8587
|
+
var workspaceAnchorSchema = extensionResourceRefSchema.extend({
|
|
8588
|
+
role: _enum(["primary", "context", "source", "result"]).optional()
|
|
8589
|
+
});
|
|
8590
|
+
var workspaceSchema = object({
|
|
8591
|
+
id: string2(),
|
|
8592
|
+
project_id: string2(),
|
|
8593
|
+
name: string2(),
|
|
8594
|
+
branch: string2().nullable(),
|
|
8595
|
+
root_path: string2().nullable(),
|
|
8596
|
+
provider_id: string2(),
|
|
8597
|
+
provider_params_json: jsonObjectSchema,
|
|
8598
|
+
provider_ref_json: workspaceProviderRefSchema.nullable(),
|
|
8599
|
+
provider_state: workspaceProviderStateSchema,
|
|
8600
|
+
execution_kind: workspaceExecutionKindSchema,
|
|
8601
|
+
provider_operation_id: string2().nullable(),
|
|
8602
|
+
provider_operation_kind: _enum(["create", "cancel", "archive", "delete"]).describe('The "archive" value is deprecated; use "delete". Historical archive operations remain readable until 0.45.').nullable(),
|
|
8603
|
+
provider_error_json: workspaceProviderErrorSchema.nullable(),
|
|
8604
|
+
provider_capabilities_json: workspaceCapabilitiesSchema,
|
|
8605
|
+
display_path: string2().nullable(),
|
|
8606
|
+
is_default: boolean2(),
|
|
8607
|
+
archived: boolean2(),
|
|
8608
|
+
initializing: boolean2(),
|
|
8609
|
+
setup_error: string2().nullable(),
|
|
8610
|
+
workspace_shorthand: string2(),
|
|
8611
|
+
startup_log_file_id: string2().nullable(),
|
|
8612
|
+
anchors_json: array(workspaceAnchorSchema),
|
|
8613
|
+
created_at: string2(),
|
|
8614
|
+
updated_at: string2(),
|
|
8615
|
+
deleted_at: string2().nullable()
|
|
8616
|
+
});
|
|
8617
|
+
var createWorkspaceInputSchema = object({
|
|
8618
|
+
project_id: string2().min(1),
|
|
8619
|
+
provider_id: string2().min(1),
|
|
8620
|
+
params: jsonObjectSchema.optional(),
|
|
8621
|
+
anchors: array(workspaceAnchorSchema).optional(),
|
|
8622
|
+
shorthand_base: string2().trim().min(1).optional()
|
|
8623
|
+
});
|
|
8624
|
+
var extensionWorkspaceCreateInputSchema = object({
|
|
8625
|
+
projectId: string2().min(1),
|
|
8626
|
+
providerId: string2().min(1),
|
|
8627
|
+
shorthandBase: string2().trim().min(1).optional(),
|
|
8628
|
+
params: jsonObjectSchema.optional(),
|
|
8629
|
+
anchors: array(workspaceAnchorSchema).optional()
|
|
8630
|
+
});
|
|
8631
|
+
var renameWorkspaceInputSchema = object({
|
|
8632
|
+
name: string2().trim().min(1, "Workspace name is required").max(120, "Workspace name must be 120 characters or less")
|
|
8633
|
+
});
|
|
8634
|
+
var removeWorktreeResponseSchema = object({
|
|
8635
|
+
removed: boolean2()
|
|
8636
|
+
});
|
|
8637
|
+
var workspaceFileEntrySchema = object({
|
|
8638
|
+
path: string2(),
|
|
8639
|
+
name: string2(),
|
|
8640
|
+
type: _enum(["file", "directory"]),
|
|
8641
|
+
size: number2().int().nonnegative().optional(),
|
|
8642
|
+
modified_at: string2().optional()
|
|
8643
|
+
});
|
|
8644
|
+
var workspaceFilesResponseSchema = object({
|
|
8645
|
+
workspace_id: string2(),
|
|
8646
|
+
path: string2(),
|
|
8647
|
+
entries: array(workspaceFileEntrySchema),
|
|
8648
|
+
truncated: boolean2()
|
|
8649
|
+
});
|
|
8650
|
+
var workspaceFileContentSchema = object({
|
|
8651
|
+
workspace_id: string2(),
|
|
8652
|
+
path: string2(),
|
|
8653
|
+
file_name: string2(),
|
|
8654
|
+
mime_type: string2().optional(),
|
|
8655
|
+
size: number2().int().nonnegative(),
|
|
8656
|
+
encoding: _enum(["utf8", "base64"]),
|
|
8657
|
+
content: string2().optional(),
|
|
8658
|
+
data_url: string2().optional(),
|
|
8659
|
+
editable: boolean2()
|
|
8660
|
+
});
|
|
8661
|
+
var writeWorkspaceFileInputSchema = object({
|
|
8662
|
+
content: string2()
|
|
8663
|
+
});
|
|
8664
|
+
var moveWorkspaceEntryInputSchema = object({
|
|
8665
|
+
destination_path: string2().min(1)
|
|
8666
|
+
});
|
|
8667
|
+
var listWorkspaceFilesInputSchema = object({
|
|
8668
|
+
path: string2().optional(),
|
|
8669
|
+
query: string2().optional(),
|
|
8670
|
+
limit: number2().int().positive().max(500).optional()
|
|
8671
|
+
});
|
|
8672
|
+
var workspaceProviderDescriptorSchema = object({
|
|
8673
|
+
id: string2(),
|
|
8674
|
+
label: localizableStringSchema,
|
|
8675
|
+
icon: string2().optional(),
|
|
8676
|
+
description: localizableStringSchema.optional(),
|
|
8677
|
+
params: extensionParamObjectSchema
|
|
8678
|
+
});
|
|
8679
|
+
var workspaceEntryMoveInputSchema = object({ destinationPath: string2().min(1) });
|
|
8680
|
+
|
|
8681
|
+
// ../pstdio-api-contracts/src/environment.ts
|
|
8682
|
+
var bindEnvironmentInputSchema = environmentIdentitySchema.extend({
|
|
8683
|
+
name: string2().trim().min(1),
|
|
8684
|
+
initial_workspace: initialWorkspaceSchema
|
|
8685
|
+
});
|
|
8686
|
+
var environmentBindingSchema = environmentIdentitySchema.extend({
|
|
8687
|
+
workbenchId: string2().min(1),
|
|
8688
|
+
workspace: workspaceSchema
|
|
8689
|
+
});
|
|
8690
|
+
// ../pstdio-api-contracts/src/extension-kernel/api-versions.ts
|
|
8691
|
+
var numericIdentifier = "(?:0|[1-9]\\d*)";
|
|
8692
|
+
var caretTerm = new RegExp(`^\\^(${numericIdentifier}\\.${numericIdentifier}\\.${numericIdentifier})$`);
|
|
8693
|
+
// ../pstdio-api-contracts/src/extension-kernel/boolean-view-filter.ts
|
|
8694
|
+
var normalizeBooleanViewRule = (rule, type) => {
|
|
8695
|
+
const mapping = type.kind === "boolean" ? type.legacyValues : undefined;
|
|
8696
|
+
if (!mapping || !Array.isArray(rule.value) || rule.value.length === 0)
|
|
8697
|
+
return rule;
|
|
8698
|
+
if (rule.condition !== "is-any-of" && rule.condition !== "is-none-of")
|
|
8699
|
+
return rule;
|
|
8700
|
+
if (rule.value.some((value) => !Object.hasOwn(mapping, value)))
|
|
8701
|
+
return rule;
|
|
8702
|
+
const values = new Set(rule.value.map((value) => mapping[value]));
|
|
8703
|
+
if (values.size === 2)
|
|
8704
|
+
return { attributeId: rule.attributeId, condition: rule.condition === "is-any-of" ? "is-not-empty" : "is-empty" };
|
|
8705
|
+
return {
|
|
8706
|
+
attributeId: rule.attributeId,
|
|
8707
|
+
condition: rule.condition === "is-any-of" ? "is" : "is-not",
|
|
8708
|
+
value: [...values][0]
|
|
8709
|
+
};
|
|
8710
|
+
};
|
|
8711
|
+
// ../pstdio-api-contracts/src/extension-kernel/builtin-refs.ts
|
|
8712
|
+
var hostRef = (kind, id) => ({ extensionId: "pstdio", kind, id });
|
|
8713
|
+
var workbenchModes = {
|
|
8714
|
+
project: hostRef("mode", "project"),
|
|
8715
|
+
sessions: hostRef("mode", "sessions"),
|
|
8716
|
+
settings: hostRef("mode", "settings")
|
|
8717
|
+
};
|
|
8718
|
+
var workbenchModeDefinitions = {
|
|
8719
|
+
project: { ref: workbenchModes.project, regions: dockedWorkbenchRegions },
|
|
8720
|
+
sessions: { ref: workbenchModes.sessions, regions: dockedWorkbenchRegions },
|
|
8721
|
+
settings: { ref: workbenchModes.settings, regions: dockedWorkbenchRegions }
|
|
8722
|
+
};
|
|
8723
|
+
var hostResourceKind = (id, label, menuSlots) => ({
|
|
8724
|
+
id,
|
|
8725
|
+
ref: hostRef("resource-kind", id),
|
|
8726
|
+
label,
|
|
8727
|
+
menuSlots
|
|
8728
|
+
});
|
|
8729
|
+
var headerMenuSlots = [
|
|
8730
|
+
{ id: "headerPrimary", placement: "header-primary", access: "public" },
|
|
8731
|
+
{ id: "headerOverflow", placement: "header-overflow", access: "public" }
|
|
8732
|
+
];
|
|
8733
|
+
var workbenchResourceKindDefinitions = {
|
|
8734
|
+
project: hostResourceKind("project", "Extension", headerMenuSlots),
|
|
8735
|
+
session: hostResourceKind("session", "Session", headerMenuSlots),
|
|
8736
|
+
workspace: hostResourceKind("workspace", "Workspace", headerMenuSlots)
|
|
8737
|
+
};
|
|
8738
|
+
var workbenchResourceKinds = {
|
|
8739
|
+
project: workbenchResourceKindDefinitions.project.ref,
|
|
8740
|
+
session: workbenchResourceKindDefinitions.session.ref,
|
|
8741
|
+
workspace: workbenchResourceKindDefinitions.workspace.ref
|
|
8742
|
+
};
|
|
8743
|
+
var workbenchPages = {
|
|
8744
|
+
start: hostRef("page", "start"),
|
|
8745
|
+
sessions: hostRef("page", "sessions"),
|
|
8746
|
+
session: hostRef("page", "session"),
|
|
8747
|
+
workspaces: hostRef("page", "workspaces"),
|
|
8748
|
+
workspace: hostRef("page", "workspace")
|
|
8749
|
+
};
|
|
8750
|
+
var workbenchPageDefinitions = {
|
|
8751
|
+
start: {
|
|
8752
|
+
ref: workbenchPages.start,
|
|
8753
|
+
mode: workbenchModes.project,
|
|
8754
|
+
path: "",
|
|
8755
|
+
primary: { cardinality: "one", resourceKinds: [] }
|
|
8756
|
+
},
|
|
8757
|
+
sessions: {
|
|
8758
|
+
ref: workbenchPages.sessions,
|
|
8759
|
+
mode: workbenchModes.sessions,
|
|
8760
|
+
path: "sessions",
|
|
8761
|
+
primary: { cardinality: "one", resourceKinds: [] }
|
|
8162
8762
|
},
|
|
8163
8763
|
session: {
|
|
8164
8764
|
ref: workbenchPages.session,
|
|
@@ -8218,6 +8818,21 @@ var resolveDataTableFieldKind = (values, column = {}) => {
|
|
|
8218
8818
|
const comparable = values.map((value) => resolveDataTableComparableValue(value, column.renderer)).filter((value) => value !== null && value !== undefined);
|
|
8219
8819
|
return comparable.length > 0 && comparable.every((value) => typeof value === "number") ? "number" : "string";
|
|
8220
8820
|
};
|
|
8821
|
+
// ../pstdio-api-contracts/src/extension-kernel/event-reference.ts
|
|
8822
|
+
var resolveEventReferenceId = (ref, ownerExtensionId) => {
|
|
8823
|
+
if (typeof ref === "string")
|
|
8824
|
+
return ref;
|
|
8825
|
+
const extensionId = ref.extensionId ?? ownerExtensionId;
|
|
8826
|
+
if (!extensionId || extensionId === "pstdio")
|
|
8827
|
+
return ref.id;
|
|
8828
|
+
const lifecycle = /^(command\.(?:requested|started|completed|rejected|failed):)(.+)$/.exec(ref.id);
|
|
8829
|
+
if (lifecycle)
|
|
8830
|
+
return `${lifecycle[1]}${extensionId}.command.${lifecycle[2]}`;
|
|
8831
|
+
const artifact = /^artifact\.changed:(.+)$/.exec(ref.id);
|
|
8832
|
+
if (artifact)
|
|
8833
|
+
return `artifact.changed:${extensionId}.artifact.${artifact[1]}`;
|
|
8834
|
+
return `${extensionId}.event.${ref.id}`;
|
|
8835
|
+
};
|
|
8221
8836
|
// ../pstdio-api-contracts/src/extension-kernel/refs.ts
|
|
8222
8837
|
var createCommandRef = (input) => ({ ...input, kind: "command" });
|
|
8223
8838
|
var commandRef = Object.assign(createCommandRef, {
|
|
@@ -8244,7 +8859,7 @@ var projectSlots = {
|
|
|
8244
8859
|
sidenav: defineSlot("project.sidenav", { kind: "panel" }),
|
|
8245
8860
|
headerPrimary: resourceMenuSlotRef(workbenchResourceKinds.project, "headerPrimary"),
|
|
8246
8861
|
headerOverflow: resourceMenuSlotRef(workbenchResourceKinds.project, "headerOverflow"),
|
|
8247
|
-
settingsPanels: defineSlot("project.
|
|
8862
|
+
settingsPanels: defineSlot("project.settings", { kind: "settings" })
|
|
8248
8863
|
};
|
|
8249
8864
|
var sessionSlots = {
|
|
8250
8865
|
headerPrimary: resourceMenuSlotRef(workbenchResourceKinds.session, "headerPrimary"),
|
|
@@ -8277,7 +8892,6 @@ var workspaceEvents = {
|
|
|
8277
8892
|
created: hostEventRef("workspace.created"),
|
|
8278
8893
|
provision: hostEventRef("workspace.provision"),
|
|
8279
8894
|
ready: hostEventRef("workspace.ready"),
|
|
8280
|
-
archived: hostEventRef("workspace.archived"),
|
|
8281
8895
|
deleted: hostEventRef("workspace.deleted")
|
|
8282
8896
|
};
|
|
8283
8897
|
var worktreeEvents = {
|
|
@@ -8383,6 +8997,254 @@ var packageAsset = (path, baseUrl) => ({
|
|
|
8383
8997
|
path,
|
|
8384
8998
|
baseUrl
|
|
8385
8999
|
});
|
|
9000
|
+
// ../pstdio-api-contracts/src/extension-kernel/page-resource-codec.ts
|
|
9001
|
+
var fromUri = (uri) => {
|
|
9002
|
+
try {
|
|
9003
|
+
const parsed = new URL(uri);
|
|
9004
|
+
if (parsed.protocol !== "pstdio:" || parsed.hostname !== "extension-resource")
|
|
9005
|
+
return;
|
|
9006
|
+
const [type, id, ...rest] = parsed.pathname.slice(1).split("/");
|
|
9007
|
+
if (!type || !id || rest.length > 0)
|
|
9008
|
+
return;
|
|
9009
|
+
const extensionId = parsed.searchParams.get("extensionId");
|
|
9010
|
+
const projectId = parsed.searchParams.get("projectId");
|
|
9011
|
+
return {
|
|
9012
|
+
type: decodeURIComponent(type),
|
|
9013
|
+
id: decodeURIComponent(id),
|
|
9014
|
+
...extensionId ? { extensionId } : {},
|
|
9015
|
+
...projectId ? { projectId } : {}
|
|
9016
|
+
};
|
|
9017
|
+
} catch {
|
|
9018
|
+
return;
|
|
9019
|
+
}
|
|
9020
|
+
};
|
|
9021
|
+
var defaultPageResourceCodec = {
|
|
9022
|
+
normalize: (resource) => ({ ...resource }),
|
|
9023
|
+
toUri: (resource) => {
|
|
9024
|
+
const uri = `pstdio://extension-resource/${encodeURIComponent(resource.type)}/${encodeURIComponent(resource.id)}`;
|
|
9025
|
+
const query = new URLSearchParams;
|
|
9026
|
+
if (resource.extensionId)
|
|
9027
|
+
query.set("extensionId", resource.extensionId);
|
|
9028
|
+
if (resource.projectId)
|
|
9029
|
+
query.set("projectId", resource.projectId);
|
|
9030
|
+
return query.size ? `${uri}?${query}` : uri;
|
|
9031
|
+
},
|
|
9032
|
+
fromUri
|
|
9033
|
+
};
|
|
9034
|
+
// ../pstdio-api-contracts/src/extension-kernel/page-url.ts
|
|
9035
|
+
var hostExtensionId = "pstdio";
|
|
9036
|
+
var pageRefKey = (ref) => `${ref.extensionId ?? ""}:page:${ref.id}`;
|
|
9037
|
+
var pageForRef = (pages, ref) => pages.find((page) => pageRefKey(page.ref) === pageRefKey(ref));
|
|
9038
|
+
var encodePath = (path) => path.split("/").filter(Boolean).map((segment) => encodeURIComponent(segment)).join("/");
|
|
9039
|
+
var routePath = (projectId, page) => {
|
|
9040
|
+
const project = `/projects/${encodeURIComponent(projectId)}`;
|
|
9041
|
+
const path = encodePath(page.path);
|
|
9042
|
+
if (page.ref.extensionId === hostExtensionId)
|
|
9043
|
+
return path ? `${project}/${path}` : project;
|
|
9044
|
+
if (!page.ref.extensionId)
|
|
9045
|
+
throw new Error(`Page "${page.id}" has no extension id`);
|
|
9046
|
+
return `${project}/extensions/${encodeURIComponent(page.ref.extensionId)}/${path}`;
|
|
9047
|
+
};
|
|
9048
|
+
var normalizedSection = (value) => {
|
|
9049
|
+
if (!value || typeof value !== "object" || !Array.isArray(value.anchors))
|
|
9050
|
+
return;
|
|
9051
|
+
const anchors = value.anchors;
|
|
9052
|
+
if (anchors.some((anchor) => !anchor || typeof anchor !== "object" || typeof anchor.id !== "string" || typeof anchor.heading !== "string" || anchor.occurrence !== undefined && (!Number.isInteger(anchor.occurrence) || Number(anchor.occurrence) < 0))) {
|
|
9053
|
+
return;
|
|
9054
|
+
}
|
|
9055
|
+
return {
|
|
9056
|
+
anchors: anchors.map((anchor) => {
|
|
9057
|
+
const value = anchor;
|
|
9058
|
+
return {
|
|
9059
|
+
id: value.id,
|
|
9060
|
+
heading: value.heading,
|
|
9061
|
+
...value.occurrence !== undefined ? { occurrence: value.occurrence } : {}
|
|
9062
|
+
};
|
|
9063
|
+
})
|
|
9064
|
+
};
|
|
9065
|
+
};
|
|
9066
|
+
var serializeSection = (section) => {
|
|
9067
|
+
const normalized = normalizedSection(section);
|
|
9068
|
+
if (!normalized)
|
|
9069
|
+
throw new Error("Page location has an invalid section");
|
|
9070
|
+
return JSON.stringify(normalized);
|
|
9071
|
+
};
|
|
9072
|
+
var parseSection = (value) => {
|
|
9073
|
+
try {
|
|
9074
|
+
return normalizedSection(JSON.parse(value));
|
|
9075
|
+
} catch {
|
|
9076
|
+
return;
|
|
9077
|
+
}
|
|
9078
|
+
};
|
|
9079
|
+
var serializeWorkbenchPageUrl = (input) => {
|
|
9080
|
+
const page = pageForRef(input.pages, input.location.page);
|
|
9081
|
+
if (!page)
|
|
9082
|
+
throw new Error(`Unknown page ref: ${pageRefKey(input.location.page)}`);
|
|
9083
|
+
const query = new URLSearchParams;
|
|
9084
|
+
if (input.location.resource) {
|
|
9085
|
+
query.set("resource", input.resources.toUri(input.resources.normalize(input.location.resource)));
|
|
9086
|
+
}
|
|
9087
|
+
const document = page.document && input.location.resource?.metadata?.[page.document.metadataKey];
|
|
9088
|
+
if (document !== undefined) {
|
|
9089
|
+
if (typeof document !== "string" || !document)
|
|
9090
|
+
throw new Error("Page location has an invalid document");
|
|
9091
|
+
query.set("document", document);
|
|
9092
|
+
}
|
|
9093
|
+
if (input.location.position) {
|
|
9094
|
+
if (!page.document || typeof document !== "string" || !document || input.location.section || !isFileSourcePosition(input.location.position))
|
|
9095
|
+
throw new Error("Page location has an invalid source position");
|
|
9096
|
+
for (const key of ["line", "column", "endLine", "endColumn"]) {
|
|
9097
|
+
const value = input.location.position[key];
|
|
9098
|
+
if (value !== undefined)
|
|
9099
|
+
query.set(key, String(value));
|
|
9100
|
+
}
|
|
9101
|
+
}
|
|
9102
|
+
if (input.location.section)
|
|
9103
|
+
query.set("section", serializeSection(input.location.section));
|
|
9104
|
+
const params = normalizePageParams(page.params, input.location.params);
|
|
9105
|
+
for (const [name, value] of pageParamsQuery(page.params, params))
|
|
9106
|
+
query.append(name, value);
|
|
9107
|
+
const encoded = query.toString();
|
|
9108
|
+
const path = routePath(input.projectId, page);
|
|
9109
|
+
return encoded ? `${path}?${encoded}` : path;
|
|
9110
|
+
};
|
|
9111
|
+
var decodedSegments = (pathname) => {
|
|
9112
|
+
try {
|
|
9113
|
+
return pathname.split("/").filter(Boolean).map((segment) => decodeURIComponent(segment));
|
|
9114
|
+
} catch {
|
|
9115
|
+
return;
|
|
9116
|
+
}
|
|
9117
|
+
};
|
|
9118
|
+
var isWorkbenchProjectUrl = (urlValue, projectId) => {
|
|
9119
|
+
try {
|
|
9120
|
+
const url = new URL(urlValue, "http://workbench.local");
|
|
9121
|
+
const segments = decodedSegments(url.pathname);
|
|
9122
|
+
return Boolean(segments && segments[0] === "projects" && segments[1] === projectId);
|
|
9123
|
+
} catch {
|
|
9124
|
+
return false;
|
|
9125
|
+
}
|
|
9126
|
+
};
|
|
9127
|
+
var pageForRoute = (pages, extensionId, path) => pages.find((page) => page.ref.extensionId === extensionId && page.path === path);
|
|
9128
|
+
var parseResource = (uri, resources) => {
|
|
9129
|
+
try {
|
|
9130
|
+
const resource = resources.fromUri(uri);
|
|
9131
|
+
return resource ? resources.normalize(resource) : undefined;
|
|
9132
|
+
} catch {
|
|
9133
|
+
return;
|
|
9134
|
+
}
|
|
9135
|
+
};
|
|
9136
|
+
var parseSourcePosition = (url, page, document, section) => {
|
|
9137
|
+
const coordinates = Object.fromEntries(["line", "column", "endLine", "endColumn"].filter((key) => url.searchParams.has(key)).map((key) => {
|
|
9138
|
+
const raw = url.searchParams.get(key);
|
|
9139
|
+
return [key, /^[1-9]\d*$/.test(raw) ? Number(raw) : NaN];
|
|
9140
|
+
}));
|
|
9141
|
+
let position;
|
|
9142
|
+
if (Object.keys(coordinates).length) {
|
|
9143
|
+
if (!page.document || document === null || section || !isFileSourcePosition(coordinates))
|
|
9144
|
+
return false;
|
|
9145
|
+
position = coordinates;
|
|
9146
|
+
}
|
|
9147
|
+
return position;
|
|
9148
|
+
};
|
|
9149
|
+
var pageForUrl = (url, projectId, pages) => {
|
|
9150
|
+
const segments = decodedSegments(url.pathname);
|
|
9151
|
+
if (!segments || segments[0] !== "projects" || segments[1] !== projectId)
|
|
9152
|
+
return;
|
|
9153
|
+
const route = segments.slice(2);
|
|
9154
|
+
const extensionRoute = route[0] === "extensions";
|
|
9155
|
+
const extensionId = extensionRoute ? route[1] : hostExtensionId;
|
|
9156
|
+
const path = (extensionRoute ? route.slice(2) : route).join("/");
|
|
9157
|
+
if (!extensionId || extensionRoute && !path)
|
|
9158
|
+
return;
|
|
9159
|
+
const page = pageForRoute(pages, extensionId, path);
|
|
9160
|
+
return page;
|
|
9161
|
+
};
|
|
9162
|
+
var parseWorkbenchPageUrl = (input) => {
|
|
9163
|
+
let url;
|
|
9164
|
+
try {
|
|
9165
|
+
url = new URL(input.url, "http://workbench.local");
|
|
9166
|
+
} catch {
|
|
9167
|
+
return;
|
|
9168
|
+
}
|
|
9169
|
+
const page = pageForUrl(url, input.projectId, input.pages);
|
|
9170
|
+
if (!page)
|
|
9171
|
+
return;
|
|
9172
|
+
for (const key of ["resource", "document", "section", "line", "column", "endLine", "endColumn"]) {
|
|
9173
|
+
if (url.searchParams.getAll(key).length > 1)
|
|
9174
|
+
return;
|
|
9175
|
+
}
|
|
9176
|
+
const resourceValue = url.searchParams.get("resource");
|
|
9177
|
+
let resource = resourceValue ? parseResource(resourceValue, input.resources) : undefined;
|
|
9178
|
+
if (resourceValue !== null && !resource)
|
|
9179
|
+
return;
|
|
9180
|
+
const document = url.searchParams.get("document");
|
|
9181
|
+
if (document !== null) {
|
|
9182
|
+
if (!document || !page.document || !resource)
|
|
9183
|
+
return;
|
|
9184
|
+
resource = { ...resource, metadata: { [page.document.metadataKey]: document } };
|
|
9185
|
+
}
|
|
9186
|
+
const sectionValue = url.searchParams.get("section");
|
|
9187
|
+
const section = sectionValue ? parseSection(sectionValue) : undefined;
|
|
9188
|
+
if (sectionValue !== null && !section)
|
|
9189
|
+
return;
|
|
9190
|
+
const position = parseSourcePosition(url, page, document, section);
|
|
9191
|
+
if (position === false)
|
|
9192
|
+
return;
|
|
9193
|
+
const params = parsePageParams(page.params, url.searchParams);
|
|
9194
|
+
return {
|
|
9195
|
+
pageId: page.id,
|
|
9196
|
+
...params ? { params } : {},
|
|
9197
|
+
...resource ? { resource } : {},
|
|
9198
|
+
...section ? { section } : {},
|
|
9199
|
+
...position ? { position } : {}
|
|
9200
|
+
};
|
|
9201
|
+
};
|
|
9202
|
+
var serializePageUrl = (input) => serializeWorkbenchPageUrl({
|
|
9203
|
+
projectId: input.projectId,
|
|
9204
|
+
location: { page: input.page.ref, resource: input.resource, position: input.position, params: input.params },
|
|
9205
|
+
pages: [input.page],
|
|
9206
|
+
resources: defaultPageResourceCodec
|
|
9207
|
+
});
|
|
9208
|
+
var parsePageUrl = (input) => {
|
|
9209
|
+
if (!input.url.startsWith("/") || input.url.startsWith("//"))
|
|
9210
|
+
return;
|
|
9211
|
+
return parseWorkbenchPageUrl({ ...input, resources: defaultPageResourceCodec });
|
|
9212
|
+
};
|
|
9213
|
+
// ../pstdio-api-contracts/src/extension-kernel/serialize-error.ts
|
|
9214
|
+
var serializeCommandError = (error) => {
|
|
9215
|
+
const ancestors = [];
|
|
9216
|
+
const shape = (value) => ({
|
|
9217
|
+
...value,
|
|
9218
|
+
name: value.name,
|
|
9219
|
+
message: value.message,
|
|
9220
|
+
...value.stack ? { stack: value.stack } : {},
|
|
9221
|
+
...value.cause !== undefined ? { cause: value.cause } : {}
|
|
9222
|
+
});
|
|
9223
|
+
const shapes = new WeakMap;
|
|
9224
|
+
const errorShape = (value) => {
|
|
9225
|
+
const existing = shapes.get(value);
|
|
9226
|
+
if (existing)
|
|
9227
|
+
return existing;
|
|
9228
|
+
const result = shape(value);
|
|
9229
|
+
shapes.set(value, result);
|
|
9230
|
+
return result;
|
|
9231
|
+
};
|
|
9232
|
+
const source = error instanceof Error ? errorShape(error) : { message: String(error) };
|
|
9233
|
+
const result = JSON.parse(JSON.stringify(source, function(_key, value) {
|
|
9234
|
+
const normalized = value instanceof Error ? errorShape(value) : value;
|
|
9235
|
+
if (typeof normalized === "bigint")
|
|
9236
|
+
return String(normalized);
|
|
9237
|
+
if (normalized && typeof normalized === "object") {
|
|
9238
|
+
while (ancestors.length && ancestors.at(-1) !== this)
|
|
9239
|
+
ancestors.pop();
|
|
9240
|
+
if (ancestors.includes(normalized))
|
|
9241
|
+
return "[Circular]";
|
|
9242
|
+
ancestors.push(normalized);
|
|
9243
|
+
}
|
|
9244
|
+
return normalized;
|
|
9245
|
+
}));
|
|
9246
|
+
return result;
|
|
9247
|
+
};
|
|
8386
9248
|
// ../pstdio-api-contracts/src/extension-kernel/types/extension.ts
|
|
8387
9249
|
var EXTENSION_API_VERSION = "0.2.0";
|
|
8388
9250
|
// ../pstdio-api-contracts/src/extension-kernel/types/webview-capabilities.ts
|
|
@@ -8413,9 +9275,11 @@ var WEBVIEW_SCOPED_DECLARABLE_CAPABILITIES = ["artifacts.read"];
|
|
|
8413
9275
|
var ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES = ["host.dispatchKeyboardEvent"];
|
|
8414
9276
|
var WEBVIEW_HOST_CAPABILITIES = [
|
|
8415
9277
|
...WEBVIEW_DECLARABLE_CAPABILITIES.filter((capability) => capability !== "clipboard.write"),
|
|
8416
|
-
...WEBVIEW_SCOPED_DECLARABLE_CAPABILITIES
|
|
8417
|
-
...ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES
|
|
9278
|
+
...WEBVIEW_SCOPED_DECLARABLE_CAPABILITIES
|
|
8418
9279
|
];
|
|
9280
|
+
// ../pstdio-api-contracts/src/extension-kernel/webview-protocol.ts
|
|
9281
|
+
var EXTENSION_EVENTS_SCOPE = "extension.events";
|
|
9282
|
+
var artifactMountId = (mount) => typeof mount === "string" ? mount : mount.id;
|
|
8419
9283
|
// ../pstdio-api-contracts/src/files.ts
|
|
8420
9284
|
var fileRecordSchema = object({
|
|
8421
9285
|
id: string2(),
|
|
@@ -8711,40 +9575,8 @@ var reconcileMessageHistory = (input, projection = {}) => {
|
|
|
8711
9575
|
throw error;
|
|
8712
9576
|
}
|
|
8713
9577
|
};
|
|
8714
|
-
// ../pstdio-api-contracts/src/
|
|
8715
|
-
var
|
|
8716
|
-
provider_id: string2().min(1),
|
|
8717
|
-
params: serializableJsonObjectSchema.default({})
|
|
8718
|
-
});
|
|
8719
|
-
var extensionSetupWarningSchema = object({
|
|
8720
|
-
code: literal("extension_setup_failed"),
|
|
8721
|
-
extension: string2(),
|
|
8722
|
-
message: string2()
|
|
8723
|
-
});
|
|
8724
|
-
var projectSchema = object({
|
|
8725
|
-
id: string2(),
|
|
8726
|
-
name: string2(),
|
|
8727
|
-
shorthand: string2(),
|
|
8728
|
-
default_agent_id: string2().nullable(),
|
|
8729
|
-
default_agent_model: string2().nullable(),
|
|
8730
|
-
startup_script: string2().nullable(),
|
|
8731
|
-
created_at: string2(),
|
|
8732
|
-
updated_at: string2(),
|
|
8733
|
-
deleted_at: string2().nullable(),
|
|
8734
|
-
extension_warnings: array(extensionSetupWarningSchema).optional()
|
|
8735
|
-
});
|
|
8736
|
-
var createProjectInputSchema = object({
|
|
8737
|
-
name: string2().trim().min(1).optional(),
|
|
8738
|
-
initial_workspace: initialWorkspaceSchema,
|
|
8739
|
-
agents: array(string2().min(1)).min(1).optional()
|
|
8740
|
-
});
|
|
8741
|
-
var updateProjectInputSchema = object({
|
|
8742
|
-
name: string2().trim().min(1).optional(),
|
|
8743
|
-
default_agent_id: string2().min(1).nullable().optional(),
|
|
8744
|
-
default_agent_model: string2().min(1).nullable().optional()
|
|
8745
|
-
}).refine((value) => Object.keys(value).length > 0, {
|
|
8746
|
-
message: "At least one field must be provided"
|
|
8747
|
-
});
|
|
9578
|
+
// ../pstdio-api-contracts/src/pagination.ts
|
|
9579
|
+
var pageQuerySchema = object({ cursor: string2().optional(), limit: exports_coerce.number().optional() });
|
|
8748
9580
|
// ../pstdio-api-contracts/src/session-request-values.ts
|
|
8749
9581
|
var harnessParamValueSchema = union([string2(), boolean2()]);
|
|
8750
9582
|
var harnessParamsInputSchema = record(string2(), harnessParamValueSchema);
|
|
@@ -8832,6 +9664,7 @@ var resourceAnchorPageSchema = object({
|
|
|
8832
9664
|
items: array(object({ source: resourceLinkRefSchema, target: resourceAnchorSchema })),
|
|
8833
9665
|
nextCursor: string2().optional()
|
|
8834
9666
|
});
|
|
9667
|
+
var resourceAnchorQueryPageSchema = resourceAnchorPageSchema.extend({ nextCursor: string2().nullable() });
|
|
8835
9668
|
// ../pstdio-api-contracts/src/session-attachment-types.ts
|
|
8836
9669
|
var sessionAttachmentMimeTypesByExtension = {
|
|
8837
9670
|
c: "text/plain",
|
|
@@ -8989,6 +9822,42 @@ var sessionUsageSchema = object({
|
|
|
8989
9822
|
cache_read_tokens: number2(),
|
|
8990
9823
|
cache_write_tokens: number2()
|
|
8991
9824
|
});
|
|
9825
|
+
var sessionExitSchema = object({
|
|
9826
|
+
cause: _enum([
|
|
9827
|
+
"completed",
|
|
9828
|
+
"user_stop",
|
|
9829
|
+
"request_aborted",
|
|
9830
|
+
"worker_lost",
|
|
9831
|
+
"host_shutdown",
|
|
9832
|
+
"timeout",
|
|
9833
|
+
"failed",
|
|
9834
|
+
"unknown"
|
|
9835
|
+
]),
|
|
9836
|
+
startedAt: string2().nullable(),
|
|
9837
|
+
endedAt: string2()
|
|
9838
|
+
});
|
|
9839
|
+
var extensionSessionSchema = object({
|
|
9840
|
+
id: string2(),
|
|
9841
|
+
title: string2(),
|
|
9842
|
+
status: sessionStatusSchema,
|
|
9843
|
+
archived: boolean2(),
|
|
9844
|
+
agent: string2().nullable(),
|
|
9845
|
+
cwd: string2().nullable(),
|
|
9846
|
+
lastSelectedModel: string2().nullable(),
|
|
9847
|
+
workspaceId: string2().nullable(),
|
|
9848
|
+
originalSessionId: string2().nullable(),
|
|
9849
|
+
createdAt: string2(),
|
|
9850
|
+
updatedAt: string2(),
|
|
9851
|
+
lastRequestStarted: string2().nullable(),
|
|
9852
|
+
lastRequestEnded: string2().nullable(),
|
|
9853
|
+
lastExit: sessionExitSchema.nullable().optional(),
|
|
9854
|
+
usage: object({
|
|
9855
|
+
inputTokens: number2(),
|
|
9856
|
+
outputTokens: number2(),
|
|
9857
|
+
cacheReadTokens: number2(),
|
|
9858
|
+
cacheWriteTokens: number2()
|
|
9859
|
+
}).nullable()
|
|
9860
|
+
});
|
|
8992
9861
|
var sessionSchema = object({
|
|
8993
9862
|
id: string2(),
|
|
8994
9863
|
project_id: string2().nullable(),
|
|
@@ -9010,9 +9879,18 @@ var sessionSchema = object({
|
|
|
9010
9879
|
created_at: string2(),
|
|
9011
9880
|
updated_at: string2()
|
|
9012
9881
|
});
|
|
9013
|
-
var
|
|
9882
|
+
var sessionDetailsSchema = extensionSessionSchema.extend({
|
|
9883
|
+
projectId: string2().nullable(),
|
|
9884
|
+
agentSessionId: string2().nullable(),
|
|
9885
|
+
sessionFileId: string2().nullable(),
|
|
9886
|
+
params: harnessParamsInputSchema.nullable()
|
|
9887
|
+
});
|
|
9888
|
+
var createSessionResponseSchema = sessionSchema.extend(extensionSessionSchema.shape).extend({
|
|
9014
9889
|
operation_result: harnessOperationResponseSchema.optional()
|
|
9015
9890
|
});
|
|
9891
|
+
var sessionCreateResponseSchema = createSessionResponseSchema.extend(sessionDetailsSchema.shape).extend({
|
|
9892
|
+
operationResult: harnessOperationResponseSchema.optional()
|
|
9893
|
+
});
|
|
9016
9894
|
var sessionAttachmentSchema = object({
|
|
9017
9895
|
file_id: string2(),
|
|
9018
9896
|
name: string2(),
|
|
@@ -9084,6 +9962,37 @@ var resolveSessionIdInputSchema = object({
|
|
|
9084
9962
|
var resolveSessionIdResponseSchema = object({
|
|
9085
9963
|
session_id: string2().nullable()
|
|
9086
9964
|
});
|
|
9965
|
+
var sessionCreateRequestSchema = createSessionInputSchema.omit({ project_id: true, workspace_id: true, original_session_id: true, attachments: true }).extend({
|
|
9966
|
+
attachments: array(object({ fileId: string2().min(1) })).optional(),
|
|
9967
|
+
projectId: string2().min(1),
|
|
9968
|
+
workspaceId: string2().optional(),
|
|
9969
|
+
originalSessionId: string2().optional()
|
|
9970
|
+
});
|
|
9971
|
+
var sessionAttachmentDetailsSchema = sessionAttachmentSchema.omit({ file_id: true, mime_type: true, size_bytes: true, created_at: true, updated_at: true }).extend({
|
|
9972
|
+
fileId: string2(),
|
|
9973
|
+
mimeType: string2().nullable(),
|
|
9974
|
+
sizeBytes: number2(),
|
|
9975
|
+
createdAt: string2(),
|
|
9976
|
+
updatedAt: string2()
|
|
9977
|
+
});
|
|
9978
|
+
var sessionFollowUpRequestSchema = followUpInputSchema.omit({
|
|
9979
|
+
question_response: true,
|
|
9980
|
+
summary_from_session_id: true,
|
|
9981
|
+
summary_format: true,
|
|
9982
|
+
summary_role: true,
|
|
9983
|
+
attachments: true
|
|
9984
|
+
}).extend({
|
|
9985
|
+
questionResponse: questionResponseSchema.optional(),
|
|
9986
|
+
summaryFromSessionId: string2().optional(),
|
|
9987
|
+
summaryFormat: _enum(["brief", "detailed"]).optional(),
|
|
9988
|
+
summaryRole: _enum(["assistant", "all"]).optional(),
|
|
9989
|
+
attachments: array(object({ fileId: string2().min(1) })).optional()
|
|
9990
|
+
});
|
|
9991
|
+
var sessionFollowUpDecisionSchema = union([
|
|
9992
|
+
object({ status: literal("dispatched") }),
|
|
9993
|
+
object({ status: literal("queued"), queuePosition: number2().int() })
|
|
9994
|
+
]);
|
|
9995
|
+
var sessionFollowUpResponseSchema = followUpResponseSchema.extend(sessionDetailsSchema.shape).extend({ followUp: sessionFollowUpDecisionSchema });
|
|
9087
9996
|
// ../pstdio-api-contracts/src/settings.ts
|
|
9088
9997
|
var settingsSchema = object({
|
|
9089
9998
|
notifications_enabled: boolean2(),
|
|
@@ -9136,122 +10045,67 @@ var updateSkillInputSchema = object({
|
|
|
9136
10045
|
title: string2().min(1).optional(),
|
|
9137
10046
|
description: string2().optional()
|
|
9138
10047
|
});
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
});
|
|
9165
|
-
var
|
|
9166
|
-
|
|
9167
|
-
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
9175
|
-
|
|
9176
|
-
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
provider_ref_json: workspaceProviderRefSchema.nullable(),
|
|
9183
|
-
provider_state: workspaceProviderStateSchema,
|
|
9184
|
-
execution_kind: workspaceExecutionKindSchema,
|
|
9185
|
-
provider_operation_id: string2().nullable(),
|
|
9186
|
-
provider_operation_kind: _enum(["create", "cancel", "archive", "delete"]).nullable(),
|
|
9187
|
-
provider_error_json: workspaceProviderErrorSchema.nullable(),
|
|
9188
|
-
provider_capabilities_json: workspaceCapabilitiesSchema,
|
|
9189
|
-
display_path: string2().nullable(),
|
|
9190
|
-
is_default: boolean2(),
|
|
9191
|
-
archived: boolean2(),
|
|
9192
|
-
initializing: boolean2(),
|
|
9193
|
-
setup_error: string2().nullable(),
|
|
9194
|
-
workspace_shorthand: string2(),
|
|
9195
|
-
startup_log_file_id: string2().nullable(),
|
|
9196
|
-
anchors_json: array(workspaceAnchorSchema),
|
|
9197
|
-
created_at: string2(),
|
|
9198
|
-
updated_at: string2(),
|
|
9199
|
-
deleted_at: string2().nullable()
|
|
9200
|
-
});
|
|
9201
|
-
var createWorkspaceInputSchema = object({
|
|
9202
|
-
project_id: string2().min(1),
|
|
9203
|
-
provider_id: string2().min(1),
|
|
9204
|
-
params: jsonObjectSchema.optional(),
|
|
9205
|
-
anchors: array(workspaceAnchorSchema).optional(),
|
|
9206
|
-
shorthand_base: string2().trim().min(1).optional()
|
|
9207
|
-
});
|
|
9208
|
-
var renameWorkspaceInputSchema = object({
|
|
9209
|
-
name: string2().trim().min(1, "Workspace name is required").max(120, "Workspace name must be 120 characters or less")
|
|
9210
|
-
});
|
|
9211
|
-
var removeWorktreeResponseSchema = object({
|
|
9212
|
-
removed: boolean2()
|
|
9213
|
-
});
|
|
9214
|
-
var workspaceFileEntrySchema = object({
|
|
9215
|
-
path: string2(),
|
|
9216
|
-
name: string2(),
|
|
9217
|
-
type: _enum(["file", "directory"]),
|
|
9218
|
-
size: number2().int().nonnegative().optional(),
|
|
9219
|
-
modified_at: string2().optional()
|
|
9220
|
-
});
|
|
9221
|
-
var workspaceFilesResponseSchema = object({
|
|
9222
|
-
workspace_id: string2(),
|
|
9223
|
-
path: string2(),
|
|
9224
|
-
entries: array(workspaceFileEntrySchema),
|
|
9225
|
-
truncated: boolean2()
|
|
9226
|
-
});
|
|
9227
|
-
var workspaceFileContentSchema = object({
|
|
10048
|
+
var skillDetailsSchema = skillSchema.omit({
|
|
10049
|
+
project_id: true,
|
|
10050
|
+
source_kind: true,
|
|
10051
|
+
extension_instance_id: true,
|
|
10052
|
+
extension_id: true,
|
|
10053
|
+
installed_extension_id: true,
|
|
10054
|
+
install_name: true,
|
|
10055
|
+
created_at: true,
|
|
10056
|
+
updated_at: true,
|
|
10057
|
+
deleted_at: true
|
|
10058
|
+
}).extend({
|
|
10059
|
+
projectId: string2(),
|
|
10060
|
+
sourceKind: skillSourceKindSchema,
|
|
10061
|
+
extensionInstanceId: string2().optional(),
|
|
10062
|
+
extensionId: string2().optional(),
|
|
10063
|
+
installedExtensionId: string2().optional(),
|
|
10064
|
+
installName: string2().optional(),
|
|
10065
|
+
createdAt: string2(),
|
|
10066
|
+
updatedAt: string2(),
|
|
10067
|
+
deletedAt: string2().nullable()
|
|
10068
|
+
});
|
|
10069
|
+
var skillAgentInstallationDetailsSchema = object({
|
|
10070
|
+
agentId: string2(),
|
|
10071
|
+
agentName: string2(),
|
|
10072
|
+
installedVersion: string2().nullable()
|
|
10073
|
+
});
|
|
10074
|
+
var skillWithContentDetailsSchema = skillDetailsSchema.extend({
|
|
10075
|
+
installedAgents: array(string2()),
|
|
10076
|
+
agentInstallations: array(skillAgentInstallationDetailsSchema)
|
|
10077
|
+
});
|
|
10078
|
+
// ../pstdio-api-contracts/src/workspace-diffs.ts
|
|
10079
|
+
var fileDiffSchema = object({
|
|
10080
|
+
filePath: string2(),
|
|
10081
|
+
change: _enum(["added", "deleted", "modified", "renamed", "copied", "permissionChange"]),
|
|
10082
|
+
additions: number2(),
|
|
10083
|
+
deletions: number2(),
|
|
10084
|
+
oldContent: string2(),
|
|
10085
|
+
newContent: string2(),
|
|
10086
|
+
oldPath: string2().optional(),
|
|
10087
|
+
newPath: string2().optional()
|
|
10088
|
+
});
|
|
10089
|
+
var fileDiffSummarySchema = fileDiffSchema.omit({ oldContent: true, newContent: true });
|
|
10090
|
+
var workspaceDiffResponseSchema = object({
|
|
9228
10091
|
workspace_id: string2(),
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
});
|
|
9238
|
-
var writeWorkspaceFileInputSchema = object({
|
|
9239
|
-
content: string2()
|
|
9240
|
-
});
|
|
9241
|
-
var moveWorkspaceEntryInputSchema = object({
|
|
9242
|
-
destination_path: string2().min(1)
|
|
10092
|
+
base_ref: string2(),
|
|
10093
|
+
head_ref: string2(),
|
|
10094
|
+
files: array(fileDiffSchema),
|
|
10095
|
+
totals: object({
|
|
10096
|
+
additions: number2(),
|
|
10097
|
+
deletions: number2(),
|
|
10098
|
+
file_count: number2()
|
|
10099
|
+
})
|
|
9243
10100
|
});
|
|
9244
|
-
var
|
|
9245
|
-
|
|
9246
|
-
query: string2().optional(),
|
|
9247
|
-
limit: number2().int().positive().max(500).optional()
|
|
10101
|
+
var workspaceDiffFilesResponseSchema = workspaceDiffResponseSchema.extend({
|
|
10102
|
+
files: array(fileDiffSummarySchema)
|
|
9248
10103
|
});
|
|
9249
|
-
var
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
params: extensionParamObjectSchema
|
|
10104
|
+
var workspaceDiffSummarySchema = object({
|
|
10105
|
+
workspace_id: string2(),
|
|
10106
|
+
additions: number2(),
|
|
10107
|
+
deletions: number2(),
|
|
10108
|
+
file_count: number2()
|
|
9255
10109
|
});
|
|
9256
10110
|
export {
|
|
9257
10111
|
findViewFilterProblem,
|