@pstdio/sdk 0.44.0-nightly.20261018030230 → 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 +599 -57
- package/dist/api.d.ts +29 -4
- package/dist/client/index.js +1131 -40
- package/dist/client.d.ts +1 -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-BH9eW-nb.d.ts → index-BooGkjrP.d.ts} +1264 -678
- package/dist/resources/index.js +599 -57
- 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 +923 -200
- package/dist/testing.d.ts +40 -4
- package/package.json +1 -1
- package/dist/index-BL1xTjNl.d.ts +0 -765
- package/dist/index-BtLMhJpu.d.ts +0 -7
- package/dist/sessions-DqqnZoSD.d.ts +0 -2
- package/dist/skills-DqqnZoSD.d.ts +0 -2
package/dist/api/index.js
CHANGED
|
@@ -6256,6 +6256,7 @@ var activityEventSchema = object({
|
|
|
6256
6256
|
created_at: string2()
|
|
6257
6257
|
});
|
|
6258
6258
|
var listActivityInputSchema = object({
|
|
6259
|
+
eventType: string2().optional(),
|
|
6259
6260
|
event_type: string2().optional(),
|
|
6260
6261
|
from: string2().optional(),
|
|
6261
6262
|
to: string2().optional(),
|
|
@@ -6269,6 +6270,21 @@ var listActivityResponseSchema = object({
|
|
|
6269
6270
|
events: array(activityEventSchema),
|
|
6270
6271
|
next_cursor: string2().nullable()
|
|
6271
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() });
|
|
6272
6288
|
// ../pstdio-api-contracts/src/harness.ts
|
|
6273
6289
|
var AGENT_CAPABILITIES = [
|
|
6274
6290
|
"SessionFork",
|
|
@@ -6324,6 +6340,9 @@ var agentModelSchema = object({
|
|
|
6324
6340
|
paramOverrides: record(string2(), harnessParamDescriptorSchema.nullable()).optional()
|
|
6325
6341
|
});
|
|
6326
6342
|
var harnessLocalId = (id) => id.slice(id.lastIndexOf(".") + 1);
|
|
6343
|
+
var agentDetailsSchema = agentInfoSchema.extend({
|
|
6344
|
+
skills: agentSkillsLayoutSchema.extend({ globalDir: string2() }).optional()
|
|
6345
|
+
});
|
|
6327
6346
|
// ../pstdio-sync-contracts/src/compatibility.ts
|
|
6328
6347
|
var peerSchema = strictObject({
|
|
6329
6348
|
release: string2().min(1),
|
|
@@ -6528,7 +6547,8 @@ var receiptSchema = strictObject({
|
|
|
6528
6547
|
status: _enum(["accepted", "conflict", "pending"]),
|
|
6529
6548
|
reason: string2().optional(),
|
|
6530
6549
|
checkpoint: checkpointSchema.nullable(),
|
|
6531
|
-
conflictId: identitySchema.optional()
|
|
6550
|
+
conflictId: identitySchema.optional(),
|
|
6551
|
+
recoveryProof: fingerprintSchema.optional()
|
|
6532
6552
|
}).superRefine((receipt, ctx) => {
|
|
6533
6553
|
const identityMatches = receipt.operationId === receipt.mutation.operationId && receipt.fingerprint === receipt.mutation.fingerprint;
|
|
6534
6554
|
const accepted = receipt.status === "accepted";
|
|
@@ -6576,6 +6596,44 @@ var replaySchema = strictObject({
|
|
|
6576
6596
|
message: "Replay must contain contiguous complete accepted groups in one scope and epoch"
|
|
6577
6597
|
});
|
|
6578
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 });
|
|
6579
6637
|
// ../pstdio-api-contracts/src/assets.ts
|
|
6580
6638
|
var assetReferenceSchema = assetSchema;
|
|
6581
6639
|
var assetOwnerSchema = strictObject({ workbenchId: identitySchema, extensionId: identitySchema });
|
|
@@ -6763,6 +6821,7 @@ var workbenchAttachmentTargetSchema = union([
|
|
|
6763
6821
|
var workbenchSettingsScopeSchema = _enum(workbenchSettingsScopes);
|
|
6764
6822
|
|
|
6765
6823
|
// ../pstdio-api-contracts/src/extensions/commands.ts
|
|
6824
|
+
var commandParamDescriptorSchema = object({ type: string2(), description: localizableStringSchema.optional() }).catchall(unknown());
|
|
6766
6825
|
var extensionCommandRecordSchema = object({
|
|
6767
6826
|
id: string2(),
|
|
6768
6827
|
extensionId: string2(),
|
|
@@ -6777,9 +6836,9 @@ var extensionCommandRecordSchema = object({
|
|
|
6777
6836
|
object({ kind: literal("rename"), resourceType: string2(), idParam: string2(), labelParam: string2() }),
|
|
6778
6837
|
object({ kind: literal("remove"), resourceType: string2(), idParam: string2() })
|
|
6779
6838
|
]).optional(),
|
|
6780
|
-
params: record(string2(),
|
|
6839
|
+
params: record(string2(), commandParamDescriptorSchema).optional()
|
|
6781
6840
|
});
|
|
6782
|
-
var extensionParamObjectSchema = record(string2(),
|
|
6841
|
+
var extensionParamObjectSchema = record(string2(), commandParamDescriptorSchema);
|
|
6783
6842
|
var extensionMiddlewareRecordSchema = object({
|
|
6784
6843
|
id: string2(),
|
|
6785
6844
|
extensionId: string2(),
|
|
@@ -7101,6 +7160,57 @@ var navigationTargetSchema = union([
|
|
|
7101
7160
|
object({ kind: literal("compound"), targets: array(navigationOperationSchema).min(1) })
|
|
7102
7161
|
]);
|
|
7103
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
|
+
|
|
7104
7214
|
// ../pstdio-api-contracts/src/extensions/execute.ts
|
|
7105
7215
|
var extensionSlotInvocationSchema = object({
|
|
7106
7216
|
id: string2(),
|
|
@@ -7144,25 +7254,6 @@ var dispatchExtensionEventBodySchema = object({
|
|
|
7144
7254
|
eventId: string2().min(1),
|
|
7145
7255
|
payload: jsonObjectSchema
|
|
7146
7256
|
}).strict();
|
|
7147
|
-
var serializedErrorSchema = object({
|
|
7148
|
-
name: string2().optional(),
|
|
7149
|
-
message: string2(),
|
|
7150
|
-
stack: string2().optional()
|
|
7151
|
-
});
|
|
7152
|
-
var commandNoticeSchema = object({
|
|
7153
|
-
type: _enum(["info", "success", "warning", "error"]),
|
|
7154
|
-
title: string2().optional(),
|
|
7155
|
-
message: string2(),
|
|
7156
|
-
metadata: jsonObjectSchema.optional()
|
|
7157
|
-
});
|
|
7158
|
-
var commandDiagnosticSchema = object({
|
|
7159
|
-
code: string2(),
|
|
7160
|
-
message: string2(),
|
|
7161
|
-
severity: _enum(["info", "warning", "error"]),
|
|
7162
|
-
extensionId: string2().optional(),
|
|
7163
|
-
commandId: string2().optional(),
|
|
7164
|
-
metadata: jsonObjectSchema.optional()
|
|
7165
|
-
});
|
|
7166
7257
|
var responseNavigationTargetSchema = navigationTargetSchema;
|
|
7167
7258
|
var commandOutcomeSchema = object({
|
|
7168
7259
|
ok: boolean2(),
|
|
@@ -7172,16 +7263,33 @@ var commandOutcomeSchema = object({
|
|
|
7172
7263
|
code: string2().optional(),
|
|
7173
7264
|
reason: string2().optional(),
|
|
7174
7265
|
data: jsonObjectSchema.optional(),
|
|
7175
|
-
error:
|
|
7176
|
-
notices: array(
|
|
7177
|
-
|
|
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()
|
|
7178
7281
|
});
|
|
7179
|
-
var
|
|
7282
|
+
var responseFields = {
|
|
7180
7283
|
commandId: string2(),
|
|
7181
7284
|
extensionId: string2(),
|
|
7182
|
-
eventIds: array(string2()).optional()
|
|
7285
|
+
eventIds: array(string2()).optional()
|
|
7286
|
+
};
|
|
7287
|
+
var commandExecuteResponseSchema = object({
|
|
7288
|
+
...responseFields,
|
|
7183
7289
|
outcome: commandOutcomeSchema
|
|
7184
7290
|
});
|
|
7291
|
+
var createCommandExecutionResultSchema = (jsonValue) => object({ ...responseFields, outcome: createCommandOutcomeSchema(jsonValue) });
|
|
7292
|
+
var commandExecutionResultSchema = createCommandExecutionResultSchema(json());
|
|
7185
7293
|
|
|
7186
7294
|
// ../pstdio-api-contracts/src/extensions/control-declarations.ts
|
|
7187
7295
|
var base = { id: string2(), name: string2(), description: string2().optional(), readOnly: boolean2().optional() };
|
|
@@ -7587,14 +7695,6 @@ var kanbanRendererEnumOptionSchema = object({
|
|
|
7587
7695
|
var kanbanRendererAttributeTypeSchema = discriminatedUnion("kind", [
|
|
7588
7696
|
object({ kind: literal("enum"), options: array(kanbanRendererEnumOptionSchema) }),
|
|
7589
7697
|
object({ kind: literal("enum-multi"), options: array(kanbanRendererEnumOptionSchema) }),
|
|
7590
|
-
object({
|
|
7591
|
-
kind: literal("status"),
|
|
7592
|
-
statuses: object({
|
|
7593
|
-
extensionId: string2().optional(),
|
|
7594
|
-
kind: literal("status"),
|
|
7595
|
-
id: string2()
|
|
7596
|
-
})
|
|
7597
|
-
}),
|
|
7598
7698
|
object({ kind: literal("boolean"), legacyValues: record(string2(), boolean2()).optional() }),
|
|
7599
7699
|
object({ kind: literal("string") }),
|
|
7600
7700
|
object({ kind: literal("date") }),
|
|
@@ -7627,8 +7727,7 @@ var kanbanRendererSavedViewSchema = object({
|
|
|
7627
7727
|
title: localizableStringSchema,
|
|
7628
7728
|
settings: kanbanViewSettingsSchema,
|
|
7629
7729
|
filter: viewFilterGroupSchema,
|
|
7630
|
-
sorts: viewSortsSchema
|
|
7631
|
-
isDefault: boolean2().optional()
|
|
7730
|
+
sorts: viewSortsSchema
|
|
7632
7731
|
});
|
|
7633
7732
|
var extensionKanbanRendererCreateRowSchema = object({
|
|
7634
7733
|
commandId: string2(),
|
|
@@ -7662,7 +7761,6 @@ var extensionKanbanRendererRecordSchema = extensionRendererRecordBaseSchema.exte
|
|
|
7662
7761
|
attributes: array(kanbanRendererAttributeSchema).optional(),
|
|
7663
7762
|
queryHandlerId: string2(),
|
|
7664
7763
|
attributeChangeHandlerId: string2().optional(),
|
|
7665
|
-
reorderHandlerId: string2().optional(),
|
|
7666
7764
|
moveHandlerId: string2().optional(),
|
|
7667
7765
|
schemaRefreshEventIds: array(string2()).optional(),
|
|
7668
7766
|
columnActionHandlerId: string2().optional(),
|
|
@@ -7836,7 +7934,6 @@ var modeRefSchema2 = contributionRefSchema2("mode");
|
|
|
7836
7934
|
var pageRefSchema2 = contributionRefSchema2("page");
|
|
7837
7935
|
var resourceKindRefSchema2 = contributionRefSchema2("resource-kind");
|
|
7838
7936
|
var settingsSectionRefSchema = contributionRefSchema2("settings-section");
|
|
7839
|
-
var statusRefSchema = contributionRefSchema2("status");
|
|
7840
7937
|
var viewRefSchema2 = contributionRefSchema2("view");
|
|
7841
7938
|
var normalizedWhenSchema = object({
|
|
7842
7939
|
mode: union([modeRefSchema2, array(modeRefSchema2)]).optional(),
|
|
@@ -7965,6 +8062,7 @@ var workbenchExtensionResourceKindRecordSchema = object({
|
|
|
7965
8062
|
icon: string2().optional(),
|
|
7966
8063
|
resolveCommand: string2().optional(),
|
|
7967
8064
|
resolveManyCommand: string2().optional(),
|
|
8065
|
+
relatedOpeningsCommand: string2().optional(),
|
|
7968
8066
|
paths: array(object({ prefix: string2(), resolveCommand: string2() })).optional(),
|
|
7969
8067
|
menuSlots: array(object({
|
|
7970
8068
|
id: string2(),
|
|
@@ -7989,15 +8087,6 @@ var workbenchExtensionStatusBarItemRecordSchema = object({
|
|
|
7989
8087
|
order: number2().optional(),
|
|
7990
8088
|
when: normalizedWhenSchema.optional()
|
|
7991
8089
|
});
|
|
7992
|
-
var workbenchExtensionStatusRecordSchema = object({
|
|
7993
|
-
id: string2(),
|
|
7994
|
-
localId: string2(),
|
|
7995
|
-
extensionId: string2(),
|
|
7996
|
-
title: localizableStringSchema,
|
|
7997
|
-
actions: array(object({ id: string2(), label: localizableStringSchema, icon: string2().optional() })).optional(),
|
|
7998
|
-
queryHandlerId: string2(),
|
|
7999
|
-
saveHandlerId: string2().optional()
|
|
8000
|
-
});
|
|
8001
8090
|
var workbenchExtensionMetadataSchema = object({
|
|
8002
8091
|
extensions: array(extensionRecordSchema),
|
|
8003
8092
|
commands: array(extensionCommandRecordSchema),
|
|
@@ -8013,7 +8102,6 @@ var workbenchExtensionMetadataSchema = object({
|
|
|
8013
8102
|
navigationItems: array(workbenchExtensionNavigationItemRecordSchema),
|
|
8014
8103
|
navigationTrees: array(workbenchExtensionNavigationTreeRecordSchema),
|
|
8015
8104
|
statusBarItems: array(workbenchExtensionStatusBarItemRecordSchema),
|
|
8016
|
-
statuses: array(workbenchExtensionStatusRecordSchema),
|
|
8017
8105
|
activityItems: array(object({
|
|
8018
8106
|
id: string2(),
|
|
8019
8107
|
extensionId: string2(),
|
|
@@ -8087,7 +8175,6 @@ var checkWorkbenchMetadataSchema = workbenchExtensionMetadataSchema.pick({
|
|
|
8087
8175
|
navigationItems: true,
|
|
8088
8176
|
navigationTrees: true,
|
|
8089
8177
|
statusBarItems: true,
|
|
8090
|
-
statuses: true,
|
|
8091
8178
|
activityItems: true,
|
|
8092
8179
|
settingsSections: true,
|
|
8093
8180
|
settingsPanels: true,
|
|
@@ -8270,6 +8357,13 @@ var extensionDiagnosticsResponseSchema = object({
|
|
|
8270
8357
|
check: extensionsCheckResponseSchema
|
|
8271
8358
|
}))
|
|
8272
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
|
+
});
|
|
8273
8367
|
// ../pstdio-api-contracts/src/automation.ts
|
|
8274
8368
|
var automationRunStatusSchema = _enum(["queued", "running", "succeeded", "failed", "cancelled", "rejected"]);
|
|
8275
8369
|
var issueAutomationTokenInputSchema = object({
|
|
@@ -8422,6 +8516,28 @@ var updateProjectInputSchema = object({
|
|
|
8422
8516
|
}).refine((value) => Object.keys(value).length > 0, {
|
|
8423
8517
|
message: "At least one field must be provided"
|
|
8424
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" });
|
|
8425
8541
|
|
|
8426
8542
|
// ../pstdio-api-contracts/src/workspaces.ts
|
|
8427
8543
|
var workspaceProviderRefShape = {
|
|
@@ -8446,7 +8562,6 @@ var workspaceCapabilitiesSchema = object({
|
|
|
8446
8562
|
diff: boolean2(),
|
|
8447
8563
|
merge: boolean2(),
|
|
8448
8564
|
rebase: boolean2(),
|
|
8449
|
-
archive: boolean2(),
|
|
8450
8565
|
delete: boolean2()
|
|
8451
8566
|
});
|
|
8452
8567
|
var workspaceProviderErrorSchema = object({
|
|
@@ -8455,6 +8570,20 @@ var workspaceProviderErrorSchema = object({
|
|
|
8455
8570
|
retryable: boolean2(),
|
|
8456
8571
|
occurred_at: string2()
|
|
8457
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()
|
|
8586
|
+
};
|
|
8458
8587
|
var workspaceAnchorSchema = extensionResourceRefSchema.extend({
|
|
8459
8588
|
role: _enum(["primary", "context", "source", "result"]).optional()
|
|
8460
8589
|
});
|
|
@@ -8470,7 +8599,7 @@ var workspaceSchema = object({
|
|
|
8470
8599
|
provider_state: workspaceProviderStateSchema,
|
|
8471
8600
|
execution_kind: workspaceExecutionKindSchema,
|
|
8472
8601
|
provider_operation_id: string2().nullable(),
|
|
8473
|
-
provider_operation_kind: _enum(["create", "cancel", "archive", "delete"]).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(),
|
|
8474
8603
|
provider_error_json: workspaceProviderErrorSchema.nullable(),
|
|
8475
8604
|
provider_capabilities_json: workspaceCapabilitiesSchema,
|
|
8476
8605
|
display_path: string2().nullable(),
|
|
@@ -8492,6 +8621,13 @@ var createWorkspaceInputSchema = object({
|
|
|
8492
8621
|
anchors: array(workspaceAnchorSchema).optional(),
|
|
8493
8622
|
shorthand_base: string2().trim().min(1).optional()
|
|
8494
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
|
+
});
|
|
8495
8631
|
var renameWorkspaceInputSchema = object({
|
|
8496
8632
|
name: string2().trim().min(1, "Workspace name is required").max(120, "Workspace name must be 120 characters or less")
|
|
8497
8633
|
});
|
|
@@ -8540,6 +8676,7 @@ var workspaceProviderDescriptorSchema = object({
|
|
|
8540
8676
|
description: localizableStringSchema.optional(),
|
|
8541
8677
|
params: extensionParamObjectSchema
|
|
8542
8678
|
});
|
|
8679
|
+
var workspaceEntryMoveInputSchema = object({ destinationPath: string2().min(1) });
|
|
8543
8680
|
|
|
8544
8681
|
// ../pstdio-api-contracts/src/environment.ts
|
|
8545
8682
|
var bindEnvironmentInputSchema = environmentIdentitySchema.extend({
|
|
@@ -8681,6 +8818,21 @@ var resolveDataTableFieldKind = (values, column = {}) => {
|
|
|
8681
8818
|
const comparable = values.map((value) => resolveDataTableComparableValue(value, column.renderer)).filter((value) => value !== null && value !== undefined);
|
|
8682
8819
|
return comparable.length > 0 && comparable.every((value) => typeof value === "number") ? "number" : "string";
|
|
8683
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
|
+
};
|
|
8684
8836
|
// ../pstdio-api-contracts/src/extension-kernel/refs.ts
|
|
8685
8837
|
var createCommandRef = (input) => ({ ...input, kind: "command" });
|
|
8686
8838
|
var commandRef = Object.assign(createCommandRef, {
|
|
@@ -8707,7 +8859,7 @@ var projectSlots = {
|
|
|
8707
8859
|
sidenav: defineSlot("project.sidenav", { kind: "panel" }),
|
|
8708
8860
|
headerPrimary: resourceMenuSlotRef(workbenchResourceKinds.project, "headerPrimary"),
|
|
8709
8861
|
headerOverflow: resourceMenuSlotRef(workbenchResourceKinds.project, "headerOverflow"),
|
|
8710
|
-
settingsPanels: defineSlot("project.
|
|
8862
|
+
settingsPanels: defineSlot("project.settings", { kind: "settings" })
|
|
8711
8863
|
};
|
|
8712
8864
|
var sessionSlots = {
|
|
8713
8865
|
headerPrimary: resourceMenuSlotRef(workbenchResourceKinds.session, "headerPrimary"),
|
|
@@ -8740,7 +8892,6 @@ var workspaceEvents = {
|
|
|
8740
8892
|
created: hostEventRef("workspace.created"),
|
|
8741
8893
|
provision: hostEventRef("workspace.provision"),
|
|
8742
8894
|
ready: hostEventRef("workspace.ready"),
|
|
8743
|
-
archived: hostEventRef("workspace.archived"),
|
|
8744
8895
|
deleted: hostEventRef("workspace.deleted")
|
|
8745
8896
|
};
|
|
8746
8897
|
var worktreeEvents = {
|
|
@@ -8846,6 +8997,254 @@ var packageAsset = (path, baseUrl) => ({
|
|
|
8846
8997
|
path,
|
|
8847
8998
|
baseUrl
|
|
8848
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
|
+
};
|
|
8849
9248
|
// ../pstdio-api-contracts/src/extension-kernel/types/extension.ts
|
|
8850
9249
|
var EXTENSION_API_VERSION = "0.2.0";
|
|
8851
9250
|
// ../pstdio-api-contracts/src/extension-kernel/types/webview-capabilities.ts
|
|
@@ -8876,9 +9275,11 @@ var WEBVIEW_SCOPED_DECLARABLE_CAPABILITIES = ["artifacts.read"];
|
|
|
8876
9275
|
var ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES = ["host.dispatchKeyboardEvent"];
|
|
8877
9276
|
var WEBVIEW_HOST_CAPABILITIES = [
|
|
8878
9277
|
...WEBVIEW_DECLARABLE_CAPABILITIES.filter((capability) => capability !== "clipboard.write"),
|
|
8879
|
-
...WEBVIEW_SCOPED_DECLARABLE_CAPABILITIES
|
|
8880
|
-
...ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES
|
|
9278
|
+
...WEBVIEW_SCOPED_DECLARABLE_CAPABILITIES
|
|
8881
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;
|
|
8882
9283
|
// ../pstdio-api-contracts/src/files.ts
|
|
8883
9284
|
var fileRecordSchema = object({
|
|
8884
9285
|
id: string2(),
|
|
@@ -9174,6 +9575,8 @@ var reconcileMessageHistory = (input, projection = {}) => {
|
|
|
9174
9575
|
throw error;
|
|
9175
9576
|
}
|
|
9176
9577
|
};
|
|
9578
|
+
// ../pstdio-api-contracts/src/pagination.ts
|
|
9579
|
+
var pageQuerySchema = object({ cursor: string2().optional(), limit: exports_coerce.number().optional() });
|
|
9177
9580
|
// ../pstdio-api-contracts/src/session-request-values.ts
|
|
9178
9581
|
var harnessParamValueSchema = union([string2(), boolean2()]);
|
|
9179
9582
|
var harnessParamsInputSchema = record(string2(), harnessParamValueSchema);
|
|
@@ -9261,6 +9664,7 @@ var resourceAnchorPageSchema = object({
|
|
|
9261
9664
|
items: array(object({ source: resourceLinkRefSchema, target: resourceAnchorSchema })),
|
|
9262
9665
|
nextCursor: string2().optional()
|
|
9263
9666
|
});
|
|
9667
|
+
var resourceAnchorQueryPageSchema = resourceAnchorPageSchema.extend({ nextCursor: string2().nullable() });
|
|
9264
9668
|
// ../pstdio-api-contracts/src/session-attachment-types.ts
|
|
9265
9669
|
var sessionAttachmentMimeTypesByExtension = {
|
|
9266
9670
|
c: "text/plain",
|
|
@@ -9418,6 +9822,42 @@ var sessionUsageSchema = object({
|
|
|
9418
9822
|
cache_read_tokens: number2(),
|
|
9419
9823
|
cache_write_tokens: number2()
|
|
9420
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
|
+
});
|
|
9421
9861
|
var sessionSchema = object({
|
|
9422
9862
|
id: string2(),
|
|
9423
9863
|
project_id: string2().nullable(),
|
|
@@ -9439,9 +9879,18 @@ var sessionSchema = object({
|
|
|
9439
9879
|
created_at: string2(),
|
|
9440
9880
|
updated_at: string2()
|
|
9441
9881
|
});
|
|
9442
|
-
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({
|
|
9443
9889
|
operation_result: harnessOperationResponseSchema.optional()
|
|
9444
9890
|
});
|
|
9891
|
+
var sessionCreateResponseSchema = createSessionResponseSchema.extend(sessionDetailsSchema.shape).extend({
|
|
9892
|
+
operationResult: harnessOperationResponseSchema.optional()
|
|
9893
|
+
});
|
|
9445
9894
|
var sessionAttachmentSchema = object({
|
|
9446
9895
|
file_id: string2(),
|
|
9447
9896
|
name: string2(),
|
|
@@ -9513,6 +9962,37 @@ var resolveSessionIdInputSchema = object({
|
|
|
9513
9962
|
var resolveSessionIdResponseSchema = object({
|
|
9514
9963
|
session_id: string2().nullable()
|
|
9515
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 });
|
|
9516
9996
|
// ../pstdio-api-contracts/src/settings.ts
|
|
9517
9997
|
var settingsSchema = object({
|
|
9518
9998
|
notifications_enabled: boolean2(),
|
|
@@ -9565,6 +10045,68 @@ var updateSkillInputSchema = object({
|
|
|
9565
10045
|
title: string2().min(1).optional(),
|
|
9566
10046
|
description: string2().optional()
|
|
9567
10047
|
});
|
|
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({
|
|
10091
|
+
workspace_id: string2(),
|
|
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
|
+
})
|
|
10100
|
+
});
|
|
10101
|
+
var workspaceDiffFilesResponseSchema = workspaceDiffResponseSchema.extend({
|
|
10102
|
+
files: array(fileDiffSummarySchema)
|
|
10103
|
+
});
|
|
10104
|
+
var workspaceDiffSummarySchema = object({
|
|
10105
|
+
workspace_id: string2(),
|
|
10106
|
+
additions: number2(),
|
|
10107
|
+
deletions: number2(),
|
|
10108
|
+
file_count: number2()
|
|
10109
|
+
});
|
|
9568
10110
|
export {
|
|
9569
10111
|
findViewFilterProblem,
|
|
9570
10112
|
sessionAttachmentMimeTypesByExtension,
|