mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add expanded_directory to the agent for extension support (#6087)
This will enable opening the default `dir` of an agent in the VS Code extension!
This commit is contained in:
@@ -469,13 +469,13 @@ func (c *Client) PostLifecycle(ctx context.Context, req PostLifecycleRequest) er
|
||||
return nil
|
||||
}
|
||||
|
||||
type PostVersionRequest struct {
|
||||
Version string `json:"version"`
|
||||
type PostStartupRequest struct {
|
||||
Version string `json:"version"`
|
||||
ExpandedDirectory string `json:"expanded_directory"`
|
||||
}
|
||||
|
||||
func (c *Client) PostVersion(ctx context.Context, version string) error {
|
||||
versionReq := PostVersionRequest{Version: version}
|
||||
res, err := c.SDK.Request(ctx, http.MethodPost, "/api/v2/workspaceagents/me/version", versionReq)
|
||||
func (c *Client) PostStartup(ctx context.Context, req PostStartupRequest) error {
|
||||
res, err := c.SDK.Request(ctx, http.MethodPost, "/api/v2/workspaceagents/me/startup", req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ type WorkspaceAgent struct {
|
||||
OperatingSystem string `json:"operating_system"`
|
||||
StartupScript string `json:"startup_script,omitempty"`
|
||||
Directory string `json:"directory,omitempty"`
|
||||
ExpandedDirectory string `json:"expanded_directory,omitempty"`
|
||||
Version string `json:"version"`
|
||||
Apps []WorkspaceApp `json:"apps"`
|
||||
// DERPLatency is mapped by region name (e.g. "New York City", "Seattle").
|
||||
|
||||
Reference in New Issue
Block a user