@pstdio/sdk 0.25.0 → 0.36.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/README.md +56 -0
- package/dist/api/index.js +2409 -896
- package/dist/api.d.ts +15 -3787
- package/dist/client/index.js +27 -9
- package/dist/client.d.ts +3 -1728
- package/dist/data/index.js +4 -4
- package/dist/data.d.ts +27 -49
- package/dist/extensions/index.js +200 -4
- package/dist/extensions-react.d.ts +18 -23
- package/dist/extensions.d.ts +3 -3940
- package/dist/hooks.d.ts +95 -1789
- package/dist/index-CR17_9lz.d.ts +7907 -0
- package/dist/index-DHgymE3o.d.ts +7 -0
- package/dist/index-ec4rxUeY.d.ts +264 -0
- package/dist/prompts.d.ts +4 -3
- package/dist/resources/index.js +2409 -896
- package/dist/resources.d.ts +4 -426
- package/dist/sessions-BfZI6tY0.d.ts +2 -0
- package/dist/skills-BfZI6tY0.d.ts +2 -0
- package/dist/testing/index.js +15 -2
- package/dist/testing.d.ts +27 -921
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,6 +32,29 @@ Page targets change location. Panel targets preserve it. Compound targets contai
|
|
|
32
32
|
|
|
33
33
|
Use `qualifyRef(owner, ref)` in provider contract modules. Keep definitions local and pass qualified refs between extensions. For webviews, declare capabilities and call the typed `GuestHost`; `placement.close` closes the calling placement through the normal tab controller.
|
|
34
34
|
|
|
35
|
+
## Workspace creation
|
|
36
|
+
|
|
37
|
+
Workspace creation belongs to the host. Use `ctx.workspaces.listProviders()` to
|
|
38
|
+
check whether additional workspaces can be created. The existing project
|
|
39
|
+
workspace is returned separately by `ctx.workspaces.getDefault()`.
|
|
40
|
+
|
|
41
|
+
A tree action can call the public host command `workbench.workspace.create`:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
const createWorkspace = commandRef<CreateWorkspaceCommandParams>({
|
|
45
|
+
extensionId: "pstdio",
|
|
46
|
+
id: "workbench.workspace.create",
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
It accepts optional `anchors` and `shorthand_base` parameters. The host shows the available providers and their
|
|
51
|
+
declared inputs, then creates the workspace with those resource links. Provider
|
|
52
|
+
parameters stay nested and are passed unchanged. Cloud providers do not need Git
|
|
53
|
+
or a local directory; creation may return while provisioning is still running.
|
|
54
|
+
|
|
55
|
+
For programmatic creation, call `ctx.workspaces.create()` with an explicit
|
|
56
|
+
`provider_id` and provider `params`.
|
|
57
|
+
|
|
35
58
|
## Dashboard URLs
|
|
36
59
|
|
|
37
60
|
Use `serializePageUrl({ projectId, page, resource })` to return a dashboard link from a command. The page descriptor contains its `id`, qualified `ref`, and declared `path`; `resource` is optional. The workbench uses the same route and resource codec.
|
|
@@ -42,6 +65,11 @@ Page and panel navigation targets remain the API for opening views and tabs.
|
|
|
42
65
|
|
|
43
66
|
## Webview change subscriptions
|
|
44
67
|
|
|
68
|
+
To run webview commands in a selected workspace, pass `{ workspaceId }` to
|
|
69
|
+
`createWebviewClient(host, options)`. Without that option, commands use the project's
|
|
70
|
+
default workspace. The host resolves the workspace target and checks project ownership.
|
|
71
|
+
The low-level `commands.execute` bridge accepts the same `workspaceId` field.
|
|
72
|
+
|
|
45
73
|
Use the typed client's `events.subscribe(event, listener)` to refetch after a command changes data:
|
|
46
74
|
|
|
47
75
|
```ts
|
|
@@ -63,3 +91,31 @@ The host delivers only events matching the view's project. Projectless events re
|
|
|
63
91
|
Development and installed consumers both load built SDK entries. Repository development builds this package before starting the source CLI. Builds stage release files under `.publish` through the shared release script. Package verification installs those same staged artifacts into a temporary directory outside the monorepo and checks every entry point.
|
|
64
92
|
|
|
65
93
|
Host authors should use the [workbench guide](https://github.com/pufflyai/prompt-studio/blob/main/packages/pstdio-workbench/README.md). Extension authors should use this SDK and public UI packages.
|
|
94
|
+
|
|
95
|
+
## Workspace contracts
|
|
96
|
+
|
|
97
|
+
The alpha.13 host opens one folder per project and uses workspace APIs for execution and files.
|
|
98
|
+
Use `ctx.projectFiles` for the project's default workspace and `ctx.workspaceFiles`
|
|
99
|
+
for the invocation's working files. Project file operations check the current workspace
|
|
100
|
+
readiness and file capabilities. Remote workspaces never fall back to local files.
|
|
101
|
+
|
|
102
|
+
`ctx.workspaces.getDefault()` returns the project workspace.
|
|
103
|
+
`ctx.workspaces.listProviders()` returns available providers, their optional `icon`, and their parameters.
|
|
104
|
+
Render these declared parameters after the user selects a workspace type. The Git
|
|
105
|
+
provider supplies a **Base branch** selection; cloud providers supply their own fields.
|
|
106
|
+
Local setup failures reject creation with the saved workspace ID and setup error.
|
|
107
|
+
The workspace remains available for diagnosis and retry.
|
|
108
|
+
Workspace context records expose `root_path` for a local directory. Remote workspaces have no local root.
|
|
109
|
+
|
|
110
|
+
The SDK client exposes `client.workspaces.listProviders(projectId)` and
|
|
111
|
+
`client.filesystem.createDirectory({ parent_path, name })`.
|
|
112
|
+
Directory creation accepts one child name under an existing parent.
|
|
113
|
+
|
|
114
|
+
Webviews can set `workspaceId` in `createWebviewClient(host, { workspaceId })`
|
|
115
|
+
to run commands in that workspace. The host validates project ownership.
|
|
116
|
+
|
|
117
|
+
Extensions that work with both host contracts can declare the exact versions
|
|
118
|
+
`1.0.0-alpha.12 || 1.0.0-alpha.13` in `engines.pstdio`.
|
|
119
|
+
General version ranges and wildcards remain unsupported.
|
|
120
|
+
The compatible extension release must precede the host cutover.
|
|
121
|
+
See [the staged release ADR](../../.pstdio/docs/adrs/0030-temporary-workspace-contract-release-bridge.md).
|