@pstdio/sdk 0.24.0 → 0.24.1
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 +1524 -10202
- package/dist/client/index.js +6 -21
- package/dist/data/index.js +9 -24
- package/dist/extensions/index.js +93 -108
- package/dist/extensions/react/index.js +2 -17
- package/dist/prompts/index.js +0 -15
- package/dist/resources/index.js +1524 -10202
- package/dist/testing/index.js +5 -20
- package/package.json +1 -1
package/dist/client/index.js
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
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
1
|
// src/client/agents.ts
|
|
17
2
|
var createAgentClient = (request) => ({
|
|
18
3
|
info: (params) => request(params?.project ? `/v1/agents/info?project=${encodeURIComponent(params.project)}` : "/v1/agents/info"),
|
|
@@ -270,7 +255,7 @@ var readSseStream = async (body, onEvent, options = {}) => {
|
|
|
270
255
|
const decoder = new TextDecoder;
|
|
271
256
|
let buffer = "";
|
|
272
257
|
const abort = () => {
|
|
273
|
-
reader.cancel();
|
|
258
|
+
reader.cancel().catch(() => {});
|
|
274
259
|
};
|
|
275
260
|
options.signal?.addEventListener("abort", abort, { once: true });
|
|
276
261
|
try {
|
|
@@ -634,10 +619,10 @@ var createClient = (options = {}) => {
|
|
|
634
619
|
};
|
|
635
620
|
};
|
|
636
621
|
export {
|
|
637
|
-
|
|
638
|
-
createRuntimeClient,
|
|
639
|
-
createRequest,
|
|
640
|
-
createClient,
|
|
622
|
+
PstdioApiError,
|
|
641
623
|
applySyncEvent,
|
|
642
|
-
|
|
624
|
+
createClient,
|
|
625
|
+
createRequest,
|
|
626
|
+
createRuntimeClient,
|
|
627
|
+
parseSyncDeleteEvent
|
|
643
628
|
};
|
package/dist/data/index.js
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
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
1
|
// src/data/draft-layout.ts
|
|
17
2
|
var assertSafePathSegment = (value) => {
|
|
18
3
|
if (!value || value === "." || value === ".." || /[/\\\0]/.test(value))
|
|
@@ -102,14 +87,14 @@ var resolveByIdOrName = (items, value, nameOf, label) => {
|
|
|
102
87
|
throw new Error(`Unknown ${label} "${value}"`);
|
|
103
88
|
};
|
|
104
89
|
export {
|
|
105
|
-
|
|
106
|
-
stripFrontmatter,
|
|
107
|
-
sameName,
|
|
108
|
-
resolveByIdOrName,
|
|
109
|
-
requireRepoFiles,
|
|
110
|
-
quoteYamlScalar,
|
|
111
|
-
findClosingFrontmatterDelimiter,
|
|
112
|
-
createDraftLayout,
|
|
90
|
+
applyFrontmatter,
|
|
113
91
|
assertSafePathSegment,
|
|
114
|
-
|
|
92
|
+
createDraftLayout,
|
|
93
|
+
findClosingFrontmatterDelimiter,
|
|
94
|
+
quoteYamlScalar,
|
|
95
|
+
requireRepoFiles,
|
|
96
|
+
resolveByIdOrName,
|
|
97
|
+
sameName,
|
|
98
|
+
stripFrontmatter,
|
|
99
|
+
unquoteYamlScalar
|
|
115
100
|
};
|
package/dist/extensions/index.js
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
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
1
|
// ../pstdio-api-contracts/src/extension-kernel/types/composition.ts
|
|
17
2
|
var dockedWorkbenchRegions = ["sidenav", "main", "secondary", "side"];
|
|
18
3
|
var extensionPanelRegions = ["main", "secondary", "side"];
|
|
@@ -215,7 +200,7 @@ var WEBVIEW_HOST_CAPABILITIES = [
|
|
|
215
200
|
...ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES
|
|
216
201
|
];
|
|
217
202
|
// package.json
|
|
218
|
-
var version = "0.24.
|
|
203
|
+
var version = "0.24.1";
|
|
219
204
|
|
|
220
205
|
// src/version.ts
|
|
221
206
|
var SDK_VERSION = version;
|
|
@@ -414,11 +399,11 @@ var normalizedSection = (value) => {
|
|
|
414
399
|
}
|
|
415
400
|
return {
|
|
416
401
|
anchors: anchors.map((anchor) => {
|
|
417
|
-
const
|
|
402
|
+
const value = anchor;
|
|
418
403
|
return {
|
|
419
|
-
id:
|
|
420
|
-
heading:
|
|
421
|
-
...
|
|
404
|
+
id: value.id,
|
|
405
|
+
heading: value.heading,
|
|
406
|
+
...value.occurrence !== undefined ? { occurrence: value.occurrence } : {}
|
|
422
407
|
};
|
|
423
408
|
})
|
|
424
409
|
};
|
|
@@ -652,10 +637,10 @@ var createWebviewClient = (host, options) => {
|
|
|
652
637
|
if (!extensionId) {
|
|
653
638
|
throw new Error("The host bridge did not provide an extension id. Pass { extensionId } to createWebviewClient.");
|
|
654
639
|
}
|
|
655
|
-
const runCommand = async (commandKey,
|
|
640
|
+
const runCommand = async (commandKey, params) => {
|
|
656
641
|
const response = await host.call("commands.execute", {
|
|
657
642
|
commandId: `${extensionId}.command.${commandKey}`,
|
|
658
|
-
params
|
|
643
|
+
params
|
|
659
644
|
});
|
|
660
645
|
return unwrapCommandOutcome(response);
|
|
661
646
|
};
|
|
@@ -663,7 +648,7 @@ var createWebviewClient = (host, options) => {
|
|
|
663
648
|
get: (_target, commandKey) => {
|
|
664
649
|
if (typeof commandKey !== "string")
|
|
665
650
|
return;
|
|
666
|
-
return (
|
|
651
|
+
return (params) => runCommand(commandKey, params);
|
|
667
652
|
}
|
|
668
653
|
});
|
|
669
654
|
const settings = {
|
|
@@ -696,90 +681,90 @@ var matchesResourceWhen = (when, resourceType) => {
|
|
|
696
681
|
// src/extensions/index.ts
|
|
697
682
|
var projectPrefix = () => ({ $prefix: "project" });
|
|
698
683
|
export {
|
|
699
|
-
|
|
700
|
-
workspaceSlots,
|
|
701
|
-
workspaceEvents,
|
|
702
|
-
workbenchSlots,
|
|
703
|
-
workbenchResourceKinds,
|
|
704
|
-
workbenchResourceKindDefinitions,
|
|
705
|
-
workbenchPanels,
|
|
706
|
-
workbenchPanelDefinitions,
|
|
707
|
-
workbenchPages,
|
|
708
|
-
workbenchPageDefinitions,
|
|
709
|
-
workbenchModes,
|
|
710
|
-
workbenchModeDefinitions,
|
|
711
|
-
unwrapCommandOutcome,
|
|
712
|
-
sessionSlots,
|
|
713
|
-
sessionEvents,
|
|
714
|
-
serializeWorkbenchPageUrl,
|
|
715
|
-
serializePageUrl,
|
|
716
|
-
resourceMenuSlotRef2 as resourceMenuSlotRef,
|
|
717
|
-
resourceKey,
|
|
718
|
-
resolveEventReferenceId,
|
|
719
|
-
qualifyRef,
|
|
720
|
-
projectSlots,
|
|
721
|
-
projectPrefix,
|
|
722
|
-
projectEvents,
|
|
723
|
-
parseWorkbenchPageUrl,
|
|
724
|
-
parsePageUrl,
|
|
725
|
-
params,
|
|
726
|
-
packageAsset,
|
|
727
|
-
matchesResourceWhen,
|
|
728
|
-
localContributionIdPattern,
|
|
729
|
-
localContributionIdGrammar,
|
|
730
|
-
l10n,
|
|
731
|
-
isWorkbenchProjectUrl,
|
|
732
|
-
isValidLocalContributionId,
|
|
733
|
-
isLocalizedString,
|
|
734
|
-
gitEvents,
|
|
735
|
-
extensionPanelRegions,
|
|
736
|
-
eventRef,
|
|
737
|
-
dockedWorkbenchRegions,
|
|
738
|
-
defineWorkspaceType,
|
|
739
|
-
defineViewMenu,
|
|
740
|
-
defineView,
|
|
741
|
-
defineTheme,
|
|
742
|
-
defineTemplateType,
|
|
743
|
-
defineTemplate,
|
|
744
|
-
defineStatuses,
|
|
745
|
-
defineStatusBarItem,
|
|
746
|
-
defineSlot,
|
|
747
|
-
defineSkill,
|
|
748
|
-
defineSettingsSection,
|
|
749
|
-
defineSettingsPanel,
|
|
750
|
-
defineSchedule,
|
|
751
|
-
defineResourceKind,
|
|
752
|
-
defineResourceHierarchyProvider,
|
|
753
|
-
definePlacement,
|
|
754
|
-
definePage,
|
|
755
|
-
defineNavigationTree,
|
|
756
|
-
defineNavigationItem,
|
|
757
|
-
defineMode,
|
|
758
|
-
defineMiddleware,
|
|
759
|
-
defineKeybinding,
|
|
760
|
-
defineHook,
|
|
761
|
-
defineHarness,
|
|
762
|
-
defineFileIconTheme,
|
|
763
|
-
defineExtensionView,
|
|
764
|
-
defineExtension,
|
|
765
|
-
defineConnection,
|
|
766
|
-
defineCommandPaletteResource,
|
|
767
|
-
defineCommand,
|
|
768
|
-
defineArtifactMount,
|
|
769
|
-
defineActivityItem,
|
|
770
|
-
defaultPageResourceCodec,
|
|
771
|
-
createWebviewClient,
|
|
772
|
-
createTerminalSessionBridge,
|
|
773
|
-
commandRef,
|
|
774
|
-
commandEvent,
|
|
775
|
-
artifactsRead,
|
|
776
|
-
artifactMountId,
|
|
777
|
-
WEBVIEW_SCOPED_DECLARABLE_CAPABILITIES,
|
|
778
|
-
WEBVIEW_HOST_CAPABILITY_VERSION,
|
|
779
|
-
WEBVIEW_HOST_CAPABILITIES,
|
|
780
|
-
WEBVIEW_DECLARABLE_CAPABILITIES,
|
|
781
|
-
SDK_VERSION,
|
|
782
|
-
EXTENSION_EVENTS_SCOPE,
|
|
684
|
+
ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES,
|
|
783
685
|
EXTENSION_API_VERSION,
|
|
784
|
-
|
|
686
|
+
EXTENSION_EVENTS_SCOPE,
|
|
687
|
+
SDK_VERSION,
|
|
688
|
+
WEBVIEW_DECLARABLE_CAPABILITIES,
|
|
689
|
+
WEBVIEW_HOST_CAPABILITIES,
|
|
690
|
+
WEBVIEW_HOST_CAPABILITY_VERSION,
|
|
691
|
+
WEBVIEW_SCOPED_DECLARABLE_CAPABILITIES,
|
|
692
|
+
artifactMountId,
|
|
693
|
+
artifactsRead,
|
|
694
|
+
commandEvent,
|
|
695
|
+
commandRef,
|
|
696
|
+
createTerminalSessionBridge,
|
|
697
|
+
createWebviewClient,
|
|
698
|
+
defaultPageResourceCodec,
|
|
699
|
+
defineActivityItem,
|
|
700
|
+
defineArtifactMount,
|
|
701
|
+
defineCommand,
|
|
702
|
+
defineCommandPaletteResource,
|
|
703
|
+
defineConnection,
|
|
704
|
+
defineExtension,
|
|
705
|
+
defineExtensionView,
|
|
706
|
+
defineFileIconTheme,
|
|
707
|
+
defineHarness,
|
|
708
|
+
defineHook,
|
|
709
|
+
defineKeybinding,
|
|
710
|
+
defineMiddleware,
|
|
711
|
+
defineMode,
|
|
712
|
+
defineNavigationItem,
|
|
713
|
+
defineNavigationTree,
|
|
714
|
+
definePage,
|
|
715
|
+
definePlacement,
|
|
716
|
+
defineResourceHierarchyProvider,
|
|
717
|
+
defineResourceKind,
|
|
718
|
+
defineSchedule,
|
|
719
|
+
defineSettingsPanel,
|
|
720
|
+
defineSettingsSection,
|
|
721
|
+
defineSkill,
|
|
722
|
+
defineSlot,
|
|
723
|
+
defineStatusBarItem,
|
|
724
|
+
defineStatuses,
|
|
725
|
+
defineTemplate,
|
|
726
|
+
defineTemplateType,
|
|
727
|
+
defineTheme,
|
|
728
|
+
defineView,
|
|
729
|
+
defineViewMenu,
|
|
730
|
+
defineWorkspaceType,
|
|
731
|
+
dockedWorkbenchRegions,
|
|
732
|
+
eventRef,
|
|
733
|
+
extensionPanelRegions,
|
|
734
|
+
gitEvents,
|
|
735
|
+
isLocalizedString,
|
|
736
|
+
isValidLocalContributionId,
|
|
737
|
+
isWorkbenchProjectUrl,
|
|
738
|
+
l10n,
|
|
739
|
+
localContributionIdGrammar,
|
|
740
|
+
localContributionIdPattern,
|
|
741
|
+
matchesResourceWhen,
|
|
742
|
+
packageAsset,
|
|
743
|
+
params,
|
|
744
|
+
parsePageUrl,
|
|
745
|
+
parseWorkbenchPageUrl,
|
|
746
|
+
projectEvents,
|
|
747
|
+
projectPrefix,
|
|
748
|
+
projectSlots,
|
|
749
|
+
qualifyRef,
|
|
750
|
+
resolveEventReferenceId,
|
|
751
|
+
resourceKey,
|
|
752
|
+
resourceMenuSlotRef2 as resourceMenuSlotRef,
|
|
753
|
+
serializePageUrl,
|
|
754
|
+
serializeWorkbenchPageUrl,
|
|
755
|
+
sessionEvents,
|
|
756
|
+
sessionSlots,
|
|
757
|
+
unwrapCommandOutcome,
|
|
758
|
+
workbenchModeDefinitions,
|
|
759
|
+
workbenchModes,
|
|
760
|
+
workbenchPageDefinitions,
|
|
761
|
+
workbenchPages,
|
|
762
|
+
workbenchPanelDefinitions,
|
|
763
|
+
workbenchPanels,
|
|
764
|
+
workbenchResourceKindDefinitions,
|
|
765
|
+
workbenchResourceKinds,
|
|
766
|
+
workbenchSlots,
|
|
767
|
+
workspaceEvents,
|
|
768
|
+
workspaceSlots,
|
|
769
|
+
worktreeEvents
|
|
785
770
|
};
|
|
@@ -1,18 +1,3 @@
|
|
|
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
1
|
// src/extensions/react/index.ts
|
|
17
2
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
18
3
|
var useCommandQuery = (input) => {
|
|
@@ -34,6 +19,6 @@ var useCommandMutation = (input) => {
|
|
|
34
19
|
});
|
|
35
20
|
};
|
|
36
21
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
useCommandMutation,
|
|
23
|
+
useCommandQuery
|
|
39
24
|
};
|
package/dist/prompts/index.js
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
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
1
|
// src/prompts/render-prompt.ts
|
|
17
2
|
import Mustache from "mustache";
|
|
18
3
|
var renderPrompt = (template, data) => Mustache.render(template, data);
|