@pstdio/sdk 0.35.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 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
@@ -64,9 +92,9 @@ Development and installed consumers both load built SDK entries. Repository deve
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.
66
94
 
67
- ## Workspace contract release bridge
95
+ ## Workspace contracts
68
96
 
69
- The alpha.10 host now provides workspace APIs alongside its existing repository APIs.
97
+ The alpha.13 host opens one folder per project and uses workspace APIs for execution and files.
70
98
  Use `ctx.projectFiles` for the project's default workspace and `ctx.workspaceFiles`
71
99
  for the invocation's working files. Project file operations check the current workspace
72
100
  readiness and file capabilities. Remote workspaces never fall back to local files.
@@ -77,8 +105,7 @@ Render these declared parameters after the user selects a workspace type. The Gi
77
105
  provider supplies a **Base branch** selection; cloud providers supply their own fields.
78
106
  Local setup failures reject creation with the saved workspace ID and setup error.
79
107
  The workspace remains available for diagnosis and retry.
80
- Workspace context records expose `root_path` for a local directory and retain
81
- `worktree_path` during this release bridge.
108
+ Workspace context records expose `root_path` for a local directory. Remote workspaces have no local root.
82
109
 
83
110
  The SDK client exposes `client.workspaces.listProviders(projectId)` and
84
111
  `client.filesystem.createDirectory({ parent_path, name })`.
@@ -88,7 +115,7 @@ Webviews can set `workspaceId` in `createWebviewClient(host, { workspaceId })`
88
115
  to run commands in that workspace. The host validates project ownership.
89
116
 
90
117
  Extensions that work with both host contracts can declare the exact versions
91
- `1.0.0-alpha.10 || 1.0.0-alpha.11` in `engines.pstdio`.
118
+ `1.0.0-alpha.12 || 1.0.0-alpha.13` in `engines.pstdio`.
92
119
  General version ranges and wildcards remain unsupported.
93
- This declaration requires the bridge host; older alpha.10 hosts accept only one version.
120
+ The compatible extension release must precede the host cutover.
94
121
  See [the staged release ADR](../../.pstdio/docs/adrs/0030-temporary-workspace-contract-release-bridge.md).