@pstdio/sdk 0.23.0 → 0.24.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 +3 -0
- package/dist/api.d.ts +19 -0
- package/dist/client.d.ts +12 -0
- package/dist/data/index.js +115 -0
- package/dist/data.d.ts +47 -0
- package/dist/extensions/index.js +5 -1
- package/dist/extensions.d.ts +18 -0
- package/dist/hooks.d.ts +12 -0
- package/dist/resources/index.js +3 -0
- package/dist/resources.d.ts +4 -0
- package/dist/testing/index.js +222 -0
- package/dist/testing.d.ts +910 -0
- package/package.json +9 -1
package/dist/api/index.js
CHANGED
|
@@ -13909,6 +13909,7 @@ var listExtensionConnectionsResponseSchema = exports_external.object({
|
|
|
13909
13909
|
|
|
13910
13910
|
// ../pstdio-api-contracts/src/extensions/execute.ts
|
|
13911
13911
|
var extensionResourceRefSchema = exports_external.object({
|
|
13912
|
+
shorthand: exports_external.string().optional(),
|
|
13912
13913
|
type: exports_external.string(),
|
|
13913
13914
|
id: exports_external.string(),
|
|
13914
13915
|
projectId: exports_external.string().optional(),
|
|
@@ -15458,9 +15459,11 @@ var resolveSessionIdResponseSchema = exports_external.object({
|
|
|
15458
15459
|
});
|
|
15459
15460
|
// ../pstdio-api-contracts/src/settings.ts
|
|
15460
15461
|
var settingsSchema = exports_external.object({
|
|
15462
|
+
notifications_enabled: exports_external.boolean(),
|
|
15461
15463
|
max_concurrent_sessions: exports_external.number().int().min(1).nullable()
|
|
15462
15464
|
});
|
|
15463
15465
|
var updateSettingsInputSchema = exports_external.object({
|
|
15466
|
+
notifications_enabled: exports_external.boolean().optional(),
|
|
15464
15467
|
max_concurrent_sessions: exports_external.number().int().min(1).nullable().optional()
|
|
15465
15468
|
}).strict().refine((value) => Object.keys(value).length > 0, { message: "Expected at least one setting" });
|
|
15466
15469
|
// ../pstdio-api-contracts/src/skills.ts
|
package/dist/api.d.ts
CHANGED
|
@@ -93,6 +93,7 @@ declare const commandExecuteRequestSchema: z.ZodObject<{
|
|
|
93
93
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
94
94
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
95
95
|
resource: z.ZodOptional<z.ZodObject<{
|
|
96
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
96
97
|
type: z.ZodString;
|
|
97
98
|
id: z.ZodString;
|
|
98
99
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -120,6 +121,7 @@ declare const commandExecuteRequestSchema: z.ZodObject<{
|
|
|
120
121
|
mode: z.ZodOptional<z.ZodString>;
|
|
121
122
|
projectId: z.ZodOptional<z.ZodString>;
|
|
122
123
|
resource: z.ZodOptional<z.ZodObject<{
|
|
124
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
123
125
|
type: z.ZodString;
|
|
124
126
|
id: z.ZodString;
|
|
125
127
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -247,6 +249,7 @@ declare const createAutomationRunInputSchema: z.ZodObject<{
|
|
|
247
249
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
248
250
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
249
251
|
resource: z.ZodOptional<z.ZodObject<{
|
|
252
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
250
253
|
type: z.ZodString;
|
|
251
254
|
id: z.ZodString;
|
|
252
255
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -290,6 +293,7 @@ declare const createSessionInputSchema: z.ZodObject<{
|
|
|
290
293
|
agent: z.ZodOptional<z.ZodString>;
|
|
291
294
|
workspace_id: z.ZodOptional<z.ZodString>;
|
|
292
295
|
anchors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
296
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
293
297
|
type: z.ZodString;
|
|
294
298
|
id: z.ZodString;
|
|
295
299
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -448,6 +452,7 @@ declare const extensionKeybindingRecordSchema: z.ZodObject<{
|
|
|
448
452
|
id: z.ZodString;
|
|
449
453
|
}, z.core.$strip>]>;
|
|
450
454
|
resource: z.ZodOptional<z.ZodObject<{
|
|
455
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
451
456
|
type: z.ZodString;
|
|
452
457
|
id: z.ZodString;
|
|
453
458
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -491,6 +496,7 @@ declare const extensionKeybindingRecordSchema: z.ZodObject<{
|
|
|
491
496
|
id: z.ZodString;
|
|
492
497
|
}, z.core.$strip>]>;
|
|
493
498
|
resource: z.ZodOptional<z.ZodObject<{
|
|
499
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
494
500
|
type: z.ZodString;
|
|
495
501
|
id: z.ZodString;
|
|
496
502
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -597,6 +603,7 @@ declare const extensionRecordSchema: z.ZodObject<{
|
|
|
597
603
|
}, z.core.$strip>;
|
|
598
604
|
|
|
599
605
|
declare const extensionResourceRefSchema: z.ZodObject<{
|
|
606
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
600
607
|
type: z.ZodString;
|
|
601
608
|
id: z.ZodString;
|
|
602
609
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -1318,6 +1325,7 @@ declare const resolveSessionIdResponseSchema: z.ZodObject<{
|
|
|
1318
1325
|
export declare interface ResourceRef {
|
|
1319
1326
|
type: string;
|
|
1320
1327
|
id: string;
|
|
1328
|
+
shorthand?: string;
|
|
1321
1329
|
projectId?: string;
|
|
1322
1330
|
label?: string;
|
|
1323
1331
|
icon?: string;
|
|
@@ -1423,6 +1431,7 @@ declare const sessionConversationResponseSchema: z.ZodObject<{
|
|
|
1423
1431
|
cwd: z.ZodNullable<z.ZodString>;
|
|
1424
1432
|
params_json: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
|
|
1425
1433
|
anchors_json: z.ZodArray<z.ZodObject<{
|
|
1434
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
1426
1435
|
type: z.ZodString;
|
|
1427
1436
|
id: z.ZodString;
|
|
1428
1437
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -1440,6 +1449,7 @@ declare const sessionConversationResponseSchema: z.ZodObject<{
|
|
|
1440
1449
|
export declare type Settings = z.infer<typeof settingsSchema>;
|
|
1441
1450
|
|
|
1442
1451
|
declare const settingsSchema: z.ZodObject<{
|
|
1452
|
+
notifications_enabled: z.ZodBoolean;
|
|
1443
1453
|
max_concurrent_sessions: z.ZodNullable<z.ZodNumber>;
|
|
1444
1454
|
}, z.core.$strip>;
|
|
1445
1455
|
|
|
@@ -1513,6 +1523,7 @@ export declare interface UpdateNotificationInput {
|
|
|
1513
1523
|
export declare type UpdateSettingsInput = z.infer<typeof updateSettingsInputSchema>;
|
|
1514
1524
|
|
|
1515
1525
|
declare const updateSettingsInputSchema: z.ZodObject<{
|
|
1526
|
+
notifications_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1516
1527
|
max_concurrent_sessions: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1517
1528
|
}, z.core.$strict>;
|
|
1518
1529
|
|
|
@@ -1855,6 +1866,7 @@ declare const workbenchExtensionMetadataSchema: z.ZodObject<{
|
|
|
1855
1866
|
id: z.ZodString;
|
|
1856
1867
|
}, z.core.$strip>]>;
|
|
1857
1868
|
resource: z.ZodOptional<z.ZodObject<{
|
|
1869
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
1858
1870
|
type: z.ZodString;
|
|
1859
1871
|
id: z.ZodString;
|
|
1860
1872
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -1898,6 +1910,7 @@ declare const workbenchExtensionMetadataSchema: z.ZodObject<{
|
|
|
1898
1910
|
id: z.ZodString;
|
|
1899
1911
|
}, z.core.$strip>]>;
|
|
1900
1912
|
resource: z.ZodOptional<z.ZodObject<{
|
|
1913
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
1901
1914
|
type: z.ZodString;
|
|
1902
1915
|
id: z.ZodString;
|
|
1903
1916
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -2369,6 +2382,7 @@ declare const workbenchExtensionMetadataSchema: z.ZodObject<{
|
|
|
2369
2382
|
id: z.ZodString;
|
|
2370
2383
|
}, z.core.$strip>]>;
|
|
2371
2384
|
resource: z.ZodOptional<z.ZodObject<{
|
|
2385
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
2372
2386
|
type: z.ZodString;
|
|
2373
2387
|
id: z.ZodString;
|
|
2374
2388
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -2412,6 +2426,7 @@ declare const workbenchExtensionMetadataSchema: z.ZodObject<{
|
|
|
2412
2426
|
id: z.ZodString;
|
|
2413
2427
|
}, z.core.$strip>]>;
|
|
2414
2428
|
resource: z.ZodOptional<z.ZodObject<{
|
|
2429
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
2415
2430
|
type: z.ZodString;
|
|
2416
2431
|
id: z.ZodString;
|
|
2417
2432
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -2550,6 +2565,7 @@ declare const workbenchExtensionMetadataSchema: z.ZodObject<{
|
|
|
2550
2565
|
id: z.ZodString;
|
|
2551
2566
|
}, z.core.$strip>]>;
|
|
2552
2567
|
resource: z.ZodOptional<z.ZodObject<{
|
|
2568
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
2553
2569
|
type: z.ZodString;
|
|
2554
2570
|
id: z.ZodString;
|
|
2555
2571
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -2593,6 +2609,7 @@ declare const workbenchExtensionMetadataSchema: z.ZodObject<{
|
|
|
2593
2609
|
id: z.ZodString;
|
|
2594
2610
|
}, z.core.$strip>]>;
|
|
2595
2611
|
resource: z.ZodOptional<z.ZodObject<{
|
|
2612
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
2596
2613
|
type: z.ZodString;
|
|
2597
2614
|
id: z.ZodString;
|
|
2598
2615
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -2783,6 +2800,7 @@ declare const workbenchExtensionMetadataSchema: z.ZodObject<{
|
|
|
2783
2800
|
id: z.ZodString;
|
|
2784
2801
|
}, z.core.$strip>]>;
|
|
2785
2802
|
resource: z.ZodOptional<z.ZodObject<{
|
|
2803
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
2786
2804
|
type: z.ZodString;
|
|
2787
2805
|
id: z.ZodString;
|
|
2788
2806
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -2826,6 +2844,7 @@ declare const workbenchExtensionMetadataSchema: z.ZodObject<{
|
|
|
2826
2844
|
id: z.ZodString;
|
|
2827
2845
|
}, z.core.$strip>]>;
|
|
2828
2846
|
resource: z.ZodOptional<z.ZodObject<{
|
|
2847
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
2829
2848
|
type: z.ZodString;
|
|
2830
2849
|
id: z.ZodString;
|
|
2831
2850
|
projectId: z.ZodOptional<z.ZodString>;
|
package/dist/client.d.ts
CHANGED
|
@@ -157,6 +157,7 @@ declare const commandExecuteRequestSchema: z.ZodObject<{
|
|
|
157
157
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
158
158
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
159
159
|
resource: z.ZodOptional<z.ZodObject<{
|
|
160
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
160
161
|
type: z.ZodString;
|
|
161
162
|
id: z.ZodString;
|
|
162
163
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -184,6 +185,7 @@ declare const commandExecuteRequestSchema: z.ZodObject<{
|
|
|
184
185
|
mode: z.ZodOptional<z.ZodString>;
|
|
185
186
|
projectId: z.ZodOptional<z.ZodString>;
|
|
186
187
|
resource: z.ZodOptional<z.ZodObject<{
|
|
188
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
187
189
|
type: z.ZodString;
|
|
188
190
|
id: z.ZodString;
|
|
189
191
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -311,6 +313,7 @@ declare const createAutomationRunInputSchema: z.ZodObject<{
|
|
|
311
313
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
312
314
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
313
315
|
resource: z.ZodOptional<z.ZodObject<{
|
|
316
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
314
317
|
type: z.ZodString;
|
|
315
318
|
id: z.ZodString;
|
|
316
319
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -360,6 +363,7 @@ declare const createSessionInputSchema: z.ZodObject<{
|
|
|
360
363
|
agent: z.ZodOptional<z.ZodString>;
|
|
361
364
|
workspace_id: z.ZodOptional<z.ZodString>;
|
|
362
365
|
anchors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
366
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
363
367
|
type: z.ZodString;
|
|
364
368
|
id: z.ZodString;
|
|
365
369
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -519,6 +523,7 @@ declare const followUpResponseSchema: z.ZodObject<{
|
|
|
519
523
|
cwd: z.ZodNullable<z.ZodString>;
|
|
520
524
|
params_json: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
|
|
521
525
|
anchors_json: z.ZodArray<z.ZodObject<{
|
|
526
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
522
527
|
type: z.ZodString;
|
|
523
528
|
id: z.ZodString;
|
|
524
529
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -1193,6 +1198,7 @@ declare const resolveSessionIdResponseSchema: z.ZodObject<{
|
|
|
1193
1198
|
declare interface ResourceRef {
|
|
1194
1199
|
type: string;
|
|
1195
1200
|
id: string;
|
|
1201
|
+
shorthand?: string;
|
|
1196
1202
|
projectId?: string;
|
|
1197
1203
|
label?: string;
|
|
1198
1204
|
icon?: string;
|
|
@@ -1271,6 +1277,7 @@ declare const sessionConversationResponseSchema: z.ZodObject<{
|
|
|
1271
1277
|
cwd: z.ZodNullable<z.ZodString>;
|
|
1272
1278
|
params_json: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
|
|
1273
1279
|
anchors_json: z.ZodArray<z.ZodObject<{
|
|
1280
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
1274
1281
|
type: z.ZodString;
|
|
1275
1282
|
id: z.ZodString;
|
|
1276
1283
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -1309,6 +1316,7 @@ declare const sessionSchema: z.ZodObject<{
|
|
|
1309
1316
|
cwd: z.ZodNullable<z.ZodString>;
|
|
1310
1317
|
params_json: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
|
|
1311
1318
|
anchors_json: z.ZodArray<z.ZodObject<{
|
|
1319
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
1312
1320
|
type: z.ZodString;
|
|
1313
1321
|
id: z.ZodString;
|
|
1314
1322
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -1341,6 +1349,7 @@ export declare type SettingsClient = {
|
|
|
1341
1349
|
};
|
|
1342
1350
|
|
|
1343
1351
|
declare const settingsSchema: z.ZodObject<{
|
|
1352
|
+
notifications_enabled: z.ZodBoolean;
|
|
1344
1353
|
max_concurrent_sessions: z.ZodNullable<z.ZodNumber>;
|
|
1345
1354
|
}, z.core.$strip>;
|
|
1346
1355
|
|
|
@@ -1476,6 +1485,7 @@ declare interface UpdateNotificationInput {
|
|
|
1476
1485
|
declare type UpdateSettingsInput = z.infer<typeof updateSettingsInputSchema>;
|
|
1477
1486
|
|
|
1478
1487
|
declare const updateSettingsInputSchema: z.ZodObject<{
|
|
1488
|
+
notifications_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1479
1489
|
max_concurrent_sessions: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1480
1490
|
}, z.core.$strict>;
|
|
1481
1491
|
|
|
@@ -1641,6 +1651,7 @@ declare const workspaceListItemSchema: z.ZodObject<{
|
|
|
1641
1651
|
workspace_shorthand: z.ZodString;
|
|
1642
1652
|
startup_log_file_id: z.ZodNullable<z.ZodString>;
|
|
1643
1653
|
anchors_json: z.ZodArray<z.ZodObject<{
|
|
1654
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
1644
1655
|
type: z.ZodString;
|
|
1645
1656
|
id: z.ZodString;
|
|
1646
1657
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -1693,6 +1704,7 @@ declare const workspaceSchema: z.ZodObject<{
|
|
|
1693
1704
|
workspace_shorthand: z.ZodString;
|
|
1694
1705
|
startup_log_file_id: z.ZodNullable<z.ZodString>;
|
|
1695
1706
|
anchors_json: z.ZodArray<z.ZodObject<{
|
|
1707
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
1696
1708
|
type: z.ZodString;
|
|
1697
1709
|
id: z.ZodString;
|
|
1698
1710
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __returnValue = (v) => v;
|
|
3
|
+
function __exportSetter(name, newValue) {
|
|
4
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
5
|
+
}
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
set: __exportSetter.bind(all, name)
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// src/data/draft-layout.ts
|
|
17
|
+
var assertSafePathSegment = (value) => {
|
|
18
|
+
if (!value || value === "." || value === ".." || /[/\\\0]/.test(value))
|
|
19
|
+
throw new Error(`Unsafe path segment: ${value}`);
|
|
20
|
+
};
|
|
21
|
+
var requireRepoFiles = (repoFiles) => {
|
|
22
|
+
if (!repoFiles)
|
|
23
|
+
throw new Error("This command must be run inside a project repository.");
|
|
24
|
+
return repoFiles;
|
|
25
|
+
};
|
|
26
|
+
var createDraftLayout = (root, document) => {
|
|
27
|
+
const directory = (name) => {
|
|
28
|
+
assertSafePathSegment(name);
|
|
29
|
+
return `${root}/${name}`;
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
directory,
|
|
33
|
+
markdown: (name, suffix = "") => `${directory(name)}/${document}${suffix}.md`,
|
|
34
|
+
files: (name, suffix = "") => `${directory(name)}/files${suffix}`
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
// src/data/frontmatter.ts
|
|
38
|
+
var escapeYamlScalar = (value) => value.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n/g, "\\n");
|
|
39
|
+
var quoteYamlScalar = (value) => `"${escapeYamlScalar(value)}"`;
|
|
40
|
+
var findClosingFrontmatterDelimiter = (content) => {
|
|
41
|
+
const match = /\n---[ \t]*(?:\r?\n|$)/.exec(content.slice(3));
|
|
42
|
+
if (!match)
|
|
43
|
+
return null;
|
|
44
|
+
const start = 3 + match.index + 1;
|
|
45
|
+
const end = 3 + match.index + match[0].length;
|
|
46
|
+
return { end, start };
|
|
47
|
+
};
|
|
48
|
+
var stripFrontmatter = (content) => {
|
|
49
|
+
if (!content.startsWith("---"))
|
|
50
|
+
return content;
|
|
51
|
+
const delimiter = findClosingFrontmatterDelimiter(content);
|
|
52
|
+
if (!delimiter)
|
|
53
|
+
return content;
|
|
54
|
+
return content.slice(delimiter.end);
|
|
55
|
+
};
|
|
56
|
+
var applyFrontmatter = (frontmatter, content) => {
|
|
57
|
+
const body = stripFrontmatter(content).replace(/^\n+/, "");
|
|
58
|
+
if (!body)
|
|
59
|
+
return frontmatter;
|
|
60
|
+
return `${frontmatter}
|
|
61
|
+
|
|
62
|
+
${body}`;
|
|
63
|
+
};
|
|
64
|
+
var unescapeYamlScalar = (value) => {
|
|
65
|
+
let result = "";
|
|
66
|
+
for (let index = 0;index < value.length; index++) {
|
|
67
|
+
const current = value[index];
|
|
68
|
+
const next = value[index + 1];
|
|
69
|
+
if (current !== "\\" || next === undefined) {
|
|
70
|
+
result += current;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (next === "n")
|
|
74
|
+
result += `
|
|
75
|
+
`;
|
|
76
|
+
else if (next === '"')
|
|
77
|
+
result += '"';
|
|
78
|
+
else if (next === "\\")
|
|
79
|
+
result += "\\";
|
|
80
|
+
else
|
|
81
|
+
result += `${current}${next}`;
|
|
82
|
+
index++;
|
|
83
|
+
}
|
|
84
|
+
return result;
|
|
85
|
+
};
|
|
86
|
+
var unquoteYamlScalar = (value) => {
|
|
87
|
+
const quoted = value.match(/^(["'])(.*)\1$/);
|
|
88
|
+
return quoted ? unescapeYamlScalar(quoted[2] ?? "") : value;
|
|
89
|
+
};
|
|
90
|
+
// src/data/resolve.ts
|
|
91
|
+
var sameName = (a, b) => a.trim().toLowerCase() === b.trim().toLowerCase();
|
|
92
|
+
var resolveByIdOrName = (items, value, nameOf, label) => {
|
|
93
|
+
const byId = items.find((item) => item.id === value);
|
|
94
|
+
if (byId)
|
|
95
|
+
return byId.id;
|
|
96
|
+
const byName = items.filter((item) => sameName(nameOf(item), value));
|
|
97
|
+
if (byName.length > 1)
|
|
98
|
+
throw new Error(`Ambiguous ${label} "${value}"`);
|
|
99
|
+
const [match] = byName;
|
|
100
|
+
if (match)
|
|
101
|
+
return match.id;
|
|
102
|
+
throw new Error(`Unknown ${label} "${value}"`);
|
|
103
|
+
};
|
|
104
|
+
export {
|
|
105
|
+
unquoteYamlScalar,
|
|
106
|
+
stripFrontmatter,
|
|
107
|
+
sameName,
|
|
108
|
+
resolveByIdOrName,
|
|
109
|
+
requireRepoFiles,
|
|
110
|
+
quoteYamlScalar,
|
|
111
|
+
findClosingFrontmatterDelimiter,
|
|
112
|
+
createDraftLayout,
|
|
113
|
+
assertSafePathSegment,
|
|
114
|
+
applyFrontmatter
|
|
115
|
+
};
|
package/dist/data.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const applyFrontmatter: (frontmatter: string, content: string) => string;
|
|
2
|
+
|
|
3
|
+
declare interface ArtifactFile {
|
|
4
|
+
path: string;
|
|
5
|
+
size?: number;
|
|
6
|
+
updatedAt?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare interface ArtifactMount {
|
|
10
|
+
exists(path: string): Promise<boolean>;
|
|
11
|
+
readText(path: string): Promise<string>;
|
|
12
|
+
writeText(path: string, value: string): Promise<void>;
|
|
13
|
+
readBytes(path: string): Promise<Uint8Array>;
|
|
14
|
+
writeBytes(path: string, value: Uint8Array): Promise<void>;
|
|
15
|
+
list(pattern?: string): Promise<ArtifactFile[]>;
|
|
16
|
+
listDirs(path?: string): Promise<string[]>;
|
|
17
|
+
delete(path: string): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export declare const assertSafePathSegment: (value: string) => void;
|
|
21
|
+
|
|
22
|
+
export declare const createDraftLayout: (root: string, document: string) => {
|
|
23
|
+
directory: (name: string) => string;
|
|
24
|
+
markdown: (name: string, suffix?: string) => string;
|
|
25
|
+
files: (name: string, suffix?: string) => string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export declare const findClosingFrontmatterDelimiter: (content: string) => {
|
|
29
|
+
end: number;
|
|
30
|
+
start: number;
|
|
31
|
+
} | null;
|
|
32
|
+
|
|
33
|
+
export declare const quoteYamlScalar: (value: string) => string;
|
|
34
|
+
|
|
35
|
+
export declare const requireRepoFiles: (repoFiles: ArtifactMount | undefined) => ArtifactMount;
|
|
36
|
+
|
|
37
|
+
export declare const resolveByIdOrName: <TItem extends {
|
|
38
|
+
id: string;
|
|
39
|
+
}>(items: TItem[], value: string, nameOf: (item: TItem) => string, label: string) => string;
|
|
40
|
+
|
|
41
|
+
export declare const sameName: (a: string, b: string) => boolean;
|
|
42
|
+
|
|
43
|
+
export declare const stripFrontmatter: (content: string) => string;
|
|
44
|
+
|
|
45
|
+
export declare const unquoteYamlScalar: (value: string) => string;
|
|
46
|
+
|
|
47
|
+
export { }
|
package/dist/extensions/index.js
CHANGED
|
@@ -215,7 +215,7 @@ var WEBVIEW_HOST_CAPABILITIES = [
|
|
|
215
215
|
...ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES
|
|
216
216
|
];
|
|
217
217
|
// package.json
|
|
218
|
-
var version = "0.
|
|
218
|
+
var version = "0.24.0";
|
|
219
219
|
|
|
220
220
|
// src/version.ts
|
|
221
221
|
var SDK_VERSION = version;
|
|
@@ -692,6 +692,9 @@ var matchesResourceWhen = (when, resourceType) => {
|
|
|
692
692
|
return true;
|
|
693
693
|
return resourceType ? resourceTypes.some((candidate) => (typeof candidate === "string" ? candidate : candidate.id) === resourceType) : false;
|
|
694
694
|
};
|
|
695
|
+
|
|
696
|
+
// src/extensions/index.ts
|
|
697
|
+
var projectPrefix = () => ({ $prefix: "project" });
|
|
695
698
|
export {
|
|
696
699
|
worktreeEvents,
|
|
697
700
|
workspaceSlots,
|
|
@@ -715,6 +718,7 @@ export {
|
|
|
715
718
|
resolveEventReferenceId,
|
|
716
719
|
qualifyRef,
|
|
717
720
|
projectSlots,
|
|
721
|
+
projectPrefix,
|
|
718
722
|
projectEvents,
|
|
719
723
|
parseWorkbenchPageUrl,
|
|
720
724
|
parsePageUrl,
|
package/dist/extensions.d.ts
CHANGED
|
@@ -932,6 +932,7 @@ export declare interface ExtensionContextBase<TSettings extends Record<string, u
|
|
|
932
932
|
repo?: RepoContext;
|
|
933
933
|
source?: CommandSource;
|
|
934
934
|
storage: ExtensionStorageApi;
|
|
935
|
+
resources: ExtensionResourcesApi;
|
|
935
936
|
artifacts: ExtensionArtifactApi;
|
|
936
937
|
/** Working tree of the invocation's repo, scoped to its root. Absent for non-repo (event/hook) invocations. */
|
|
937
938
|
repoFiles?: ArtifactMount;
|
|
@@ -1062,6 +1063,15 @@ export declare interface ExtensionReposApi {
|
|
|
1062
1063
|
}): Promise<string>;
|
|
1063
1064
|
}
|
|
1064
1065
|
|
|
1066
|
+
export declare interface ExtensionResourcesApi {
|
|
1067
|
+
allocate(input: {
|
|
1068
|
+
kind: string;
|
|
1069
|
+
}): Promise<{
|
|
1070
|
+
id: string;
|
|
1071
|
+
shorthand: string;
|
|
1072
|
+
}>;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1065
1075
|
export declare interface ExtensionSessionResource {
|
|
1066
1076
|
type: "session";
|
|
1067
1077
|
id: string;
|
|
@@ -2290,6 +2300,10 @@ export declare const projectEvents: {
|
|
|
2290
2300
|
}>;
|
|
2291
2301
|
};
|
|
2292
2302
|
|
|
2303
|
+
export declare const projectPrefix: () => {
|
|
2304
|
+
$prefix: "project";
|
|
2305
|
+
};
|
|
2306
|
+
|
|
2293
2307
|
export declare const projectSlots: {
|
|
2294
2308
|
sidenav: SlotRef<object, "panel">;
|
|
2295
2309
|
headerPrimary: SlotRef<object, "menu">;
|
|
@@ -2482,6 +2496,9 @@ export declare function resourceKey(resource: ResourceRef): string;
|
|
|
2482
2496
|
export declare function resourceKey(resource: ResourceRef | undefined): string | undefined;
|
|
2483
2497
|
|
|
2484
2498
|
export declare interface ResourceKindDefinition extends ContributionDefinition<"resource-kind"> {
|
|
2499
|
+
readonly prefix?: string | {
|
|
2500
|
+
readonly $prefix: "project";
|
|
2501
|
+
};
|
|
2485
2502
|
readonly label?: Localizable<string>;
|
|
2486
2503
|
readonly icon?: string;
|
|
2487
2504
|
readonly menuSlots?: readonly ResourceMenuSlotDefinition[];
|
|
@@ -2524,6 +2541,7 @@ export declare type ResourceParam<TRequired extends boolean | undefined = boolea
|
|
|
2524
2541
|
export declare interface ResourceRef {
|
|
2525
2542
|
type: string;
|
|
2526
2543
|
id: string;
|
|
2544
|
+
shorthand?: string;
|
|
2527
2545
|
projectId?: string;
|
|
2528
2546
|
label?: string;
|
|
2529
2547
|
icon?: string;
|
package/dist/hooks.d.ts
CHANGED
|
@@ -155,6 +155,7 @@ declare const commandExecuteRequestSchema: z.ZodObject<{
|
|
|
155
155
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
156
156
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
157
157
|
resource: z.ZodOptional<z.ZodObject<{
|
|
158
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
158
159
|
type: z.ZodString;
|
|
159
160
|
id: z.ZodString;
|
|
160
161
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -182,6 +183,7 @@ declare const commandExecuteRequestSchema: z.ZodObject<{
|
|
|
182
183
|
mode: z.ZodOptional<z.ZodString>;
|
|
183
184
|
projectId: z.ZodOptional<z.ZodString>;
|
|
184
185
|
resource: z.ZodOptional<z.ZodObject<{
|
|
186
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
185
187
|
type: z.ZodString;
|
|
186
188
|
id: z.ZodString;
|
|
187
189
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -324,6 +326,7 @@ declare const createAutomationRunInputSchema: z.ZodObject<{
|
|
|
324
326
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
325
327
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
326
328
|
resource: z.ZodOptional<z.ZodObject<{
|
|
329
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
327
330
|
type: z.ZodString;
|
|
328
331
|
id: z.ZodString;
|
|
329
332
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -367,6 +370,7 @@ declare const createSessionInputSchema: z.ZodObject<{
|
|
|
367
370
|
agent: z.ZodOptional<z.ZodString>;
|
|
368
371
|
workspace_id: z.ZodOptional<z.ZodString>;
|
|
369
372
|
anchors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
373
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
370
374
|
type: z.ZodString;
|
|
371
375
|
id: z.ZodString;
|
|
372
376
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -526,6 +530,7 @@ declare const followUpResponseSchema: z.ZodObject<{
|
|
|
526
530
|
cwd: z.ZodNullable<z.ZodString>;
|
|
527
531
|
params_json: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
|
|
528
532
|
anchors_json: z.ZodArray<z.ZodObject<{
|
|
533
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
529
534
|
type: z.ZodString;
|
|
530
535
|
id: z.ZodString;
|
|
531
536
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -1213,6 +1218,7 @@ declare const resolveSessionIdResponseSchema: z.ZodObject<{
|
|
|
1213
1218
|
declare interface ResourceRef {
|
|
1214
1219
|
type: string;
|
|
1215
1220
|
id: string;
|
|
1221
|
+
shorthand?: string;
|
|
1216
1222
|
projectId?: string;
|
|
1217
1223
|
label?: string;
|
|
1218
1224
|
icon?: string;
|
|
@@ -1291,6 +1297,7 @@ declare const sessionConversationResponseSchema: z.ZodObject<{
|
|
|
1291
1297
|
cwd: z.ZodNullable<z.ZodString>;
|
|
1292
1298
|
params_json: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
|
|
1293
1299
|
anchors_json: z.ZodArray<z.ZodObject<{
|
|
1300
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
1294
1301
|
type: z.ZodString;
|
|
1295
1302
|
id: z.ZodString;
|
|
1296
1303
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -1342,6 +1349,7 @@ declare const sessionSchema: z.ZodObject<{
|
|
|
1342
1349
|
cwd: z.ZodNullable<z.ZodString>;
|
|
1343
1350
|
params_json: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
|
|
1344
1351
|
anchors_json: z.ZodArray<z.ZodObject<{
|
|
1352
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
1345
1353
|
type: z.ZodString;
|
|
1346
1354
|
id: z.ZodString;
|
|
1347
1355
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -1374,6 +1382,7 @@ declare type SettingsClient = {
|
|
|
1374
1382
|
};
|
|
1375
1383
|
|
|
1376
1384
|
declare const settingsSchema: z.ZodObject<{
|
|
1385
|
+
notifications_enabled: z.ZodBoolean;
|
|
1377
1386
|
max_concurrent_sessions: z.ZodNullable<z.ZodNumber>;
|
|
1378
1387
|
}, z.core.$strip>;
|
|
1379
1388
|
|
|
@@ -1509,6 +1518,7 @@ declare interface UpdateNotificationInput {
|
|
|
1509
1518
|
declare type UpdateSettingsInput = z.infer<typeof updateSettingsInputSchema>;
|
|
1510
1519
|
|
|
1511
1520
|
declare const updateSettingsInputSchema: z.ZodObject<{
|
|
1521
|
+
notifications_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1512
1522
|
max_concurrent_sessions: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1513
1523
|
}, z.core.$strict>;
|
|
1514
1524
|
|
|
@@ -1674,6 +1684,7 @@ declare const workspaceListItemSchema: z.ZodObject<{
|
|
|
1674
1684
|
workspace_shorthand: z.ZodString;
|
|
1675
1685
|
startup_log_file_id: z.ZodNullable<z.ZodString>;
|
|
1676
1686
|
anchors_json: z.ZodArray<z.ZodObject<{
|
|
1687
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
1677
1688
|
type: z.ZodString;
|
|
1678
1689
|
id: z.ZodString;
|
|
1679
1690
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -1726,6 +1737,7 @@ declare const workspaceSchema: z.ZodObject<{
|
|
|
1726
1737
|
workspace_shorthand: z.ZodString;
|
|
1727
1738
|
startup_log_file_id: z.ZodNullable<z.ZodString>;
|
|
1728
1739
|
anchors_json: z.ZodArray<z.ZodObject<{
|
|
1740
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
1729
1741
|
type: z.ZodString;
|
|
1730
1742
|
id: z.ZodString;
|
|
1731
1743
|
projectId: z.ZodOptional<z.ZodString>;
|
package/dist/resources/index.js
CHANGED
|
@@ -13909,6 +13909,7 @@ var listExtensionConnectionsResponseSchema = exports_external.object({
|
|
|
13909
13909
|
|
|
13910
13910
|
// ../pstdio-api-contracts/src/extensions/execute.ts
|
|
13911
13911
|
var extensionResourceRefSchema = exports_external.object({
|
|
13912
|
+
shorthand: exports_external.string().optional(),
|
|
13912
13913
|
type: exports_external.string(),
|
|
13913
13914
|
id: exports_external.string(),
|
|
13914
13915
|
projectId: exports_external.string().optional(),
|
|
@@ -15458,9 +15459,11 @@ var resolveSessionIdResponseSchema = exports_external.object({
|
|
|
15458
15459
|
});
|
|
15459
15460
|
// ../pstdio-api-contracts/src/settings.ts
|
|
15460
15461
|
var settingsSchema = exports_external.object({
|
|
15462
|
+
notifications_enabled: exports_external.boolean(),
|
|
15461
15463
|
max_concurrent_sessions: exports_external.number().int().min(1).nullable()
|
|
15462
15464
|
});
|
|
15463
15465
|
var updateSettingsInputSchema = exports_external.object({
|
|
15466
|
+
notifications_enabled: exports_external.boolean().optional(),
|
|
15464
15467
|
max_concurrent_sessions: exports_external.number().int().min(1).nullable().optional()
|
|
15465
15468
|
}).strict().refine((value) => Object.keys(value).length > 0, { message: "Expected at least one setting" });
|
|
15466
15469
|
// ../pstdio-api-contracts/src/skills.ts
|
package/dist/resources.d.ts
CHANGED
|
@@ -186,6 +186,7 @@ declare const sessionSchema: z.ZodObject<{
|
|
|
186
186
|
cwd: z.ZodNullable<z.ZodString>;
|
|
187
187
|
params_json: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
|
|
188
188
|
anchors_json: z.ZodArray<z.ZodObject<{
|
|
189
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
189
190
|
type: z.ZodString;
|
|
190
191
|
id: z.ZodString;
|
|
191
192
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -213,6 +214,7 @@ declare const sessionStatusSchema: z.ZodEnum<{
|
|
|
213
214
|
export declare type Settings = z.infer<typeof settingsSchema>;
|
|
214
215
|
|
|
215
216
|
declare const settingsSchema: z.ZodObject<{
|
|
217
|
+
notifications_enabled: z.ZodBoolean;
|
|
216
218
|
max_concurrent_sessions: z.ZodNullable<z.ZodNumber>;
|
|
217
219
|
}, z.core.$strip>;
|
|
218
220
|
|
|
@@ -354,6 +356,7 @@ declare const workspaceListItemSchema: z.ZodObject<{
|
|
|
354
356
|
workspace_shorthand: z.ZodString;
|
|
355
357
|
startup_log_file_id: z.ZodNullable<z.ZodString>;
|
|
356
358
|
anchors_json: z.ZodArray<z.ZodObject<{
|
|
359
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
357
360
|
type: z.ZodString;
|
|
358
361
|
id: z.ZodString;
|
|
359
362
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -406,6 +409,7 @@ declare const workspaceSchema: z.ZodObject<{
|
|
|
406
409
|
workspace_shorthand: z.ZodString;
|
|
407
410
|
startup_log_file_id: z.ZodNullable<z.ZodString>;
|
|
408
411
|
anchors_json: z.ZodArray<z.ZodObject<{
|
|
412
|
+
shorthand: z.ZodOptional<z.ZodString>;
|
|
409
413
|
type: z.ZodString;
|
|
410
414
|
id: z.ZodString;
|
|
411
415
|
projectId: z.ZodOptional<z.ZodString>;
|