Skip to content

Commit ba66dfd

Browse files
authored
feat(api): agent identity on v2 meta, scoped CLI pairing keys, and v2 workspace rename (#9904)
* feat(api): agent identity on v2 meta, scoped CLI pairing keys, and v2 workspace rename - GET /api/v2/meta adds keyId, userId, workspaceId and links {openapi, docs, mcp}; existing fields unchanged. The API catalog shares the same link source. - CLI pairing login accepts --read-only and --expires-in <days>. The request rides the approval URL, is shown on the approval card, is recorded with the approval and applied at mint; the unauthenticated poll cannot set either. The poll echoes access and expiresAt, and the CLI refuses to store a key that does not match what was asked (an older server mints full access). The signed-out login bounce now keeps scope, workspace, access and expiry instead of dropping them. sim whoami shows the key's expiry and bound workspace. - POST /api/v2/credentials/connections returns draftId. Opening a connection link that is unknown, expired or another account's now explains to sign in as the creating account, without saying which case applied. - PATCH /api/v2/workspaces/{workspaceId} renames a workspace or changes its logo through the existing workspaces.identity.update operation, widened to personal API keys and OAuth tokens (api:write); Admin still required, workspace keys still denied. Workspace update operations move into the operations registry. - Regenerated OpenAPI, MCP catalog, CLI client and CLI docs. * fix(cli-auth): pass route context in the new approve and poll tests * test(mcp): expect the identity fields getMeta now returns * fix(workspaces): count members before the rename so a failed count never hides a committed update * improvement(cli-auth): reuse the api-key access schema and tidy handoff validation * fix(api): publish the workspace PATCH body rules and check CLI-minted keys exactly - PATCH /v2/workspaces/{id}: the body schema publishes minProperties 1, and logoUrl is a pattern (root-relative path or https URL, protocol-relative refused) instead of an unpublished refine. - sim login refuses a minted key whose access or expiry differs from the request in either direction, with the expiry checked against the requested days within a clock tolerance. - sim workspaces update --logo-url documents that clearing the logo goes through the API or MCP.
1 parent c844be8 commit ba66dfd

46 files changed

Lines changed: 1222 additions & 162 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/docs/content/docs/cli/commands.mdx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ sim login [options]
7979

8080
| Option | Required | Description |
8181
| --- | --- | --- |
82-
| `--method <method>` | No | Credential to obtain: oauth requires OAuth support; api-key creates a permanent key through pairing (auto-selects when omitted). Accepted values: `oauth`, `api-key`. |
82+
| `--method <method>` | No | Credential to obtain: oauth requires OAuth support; api-key creates an API key through pairing (auto-selects when omitted). Accepted values: `oauth`, `api-key`. |
8383
| `--no-browser` | No | Print the approval URL without opening it (either login method). |
8484
| `--read-only` | No | Ask only for permission to read, never to change anything. |
85+
| `--expires-in <days>` | No | API-key login only: days until the key expires (1-365); omit for a key that never expires. |
8586
| `--callback-port <port>` | No | Pin the local port the browser returns to. |
8687
| `-y, --yes` | No | Overwrite an existing API-key profile without prompting. |
8788

‎apps/docs/content/docs/cli/reference.mdx‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ sim login [options]
4747

4848
| Option | Required | Description |
4949
| --- | --- | --- |
50-
| `--method <method>` | No | Credential to obtain: oauth requires OAuth support; api-key creates a permanent key through pairing (auto-selects when omitted). Accepted values: `oauth`, `api-key`. |
50+
| `--method <method>` | No | Credential to obtain: oauth requires OAuth support; api-key creates an API key through pairing (auto-selects when omitted). Accepted values: `oauth`, `api-key`. |
5151
| `--no-browser` | No | Print the approval URL without opening it (either login method). |
5252
| `--read-only` | No | Ask only for permission to read, never to change anything. |
53+
| `--expires-in <days>` | No | API-key login only: days until the key expires (1-365); omit for a key that never expires. |
5354
| `--callback-port <port>` | No | Pin the local port the browser returns to. |
5455
| `-y, --yes` | No | Overwrite an existing API-key profile without prompting. |
5556

@@ -9239,6 +9240,27 @@ sim workspaces unlink [options]
92399240

92409241
API request and response schemas: [unlinkWorkspaceFork](/api-reference/workspace-sync/unlinkWorkspaceFork).
92419242

9243+
### sim workspaces update
9244+
9245+
Update workspace (OAuth login or personal API key required)
9246+
9247+
```bash
9248+
sim workspaces update [options]
9249+
```
9250+
9251+
**Options**
9252+
9253+
<CommandTable>
9254+
9255+
| Option | Required | Description |
9256+
| --- | --- | --- |
9257+
| `--name <value>` | No | New workspace display name. |
9258+
| `--logo-url <value>` | No | New workspace logo: a root-relative path (starting with /) or an https:// URL. To remove the logo, send logoUrl: null through the API or MCP (--logo-url null sends the word, not JSON null). |
9259+
9260+
</CommandTable>
9261+
9262+
API request and response schemas: [updateWorkspace](/api-reference/workspaces/updateWorkspace).
9263+
92429264
### sim workspaces sync-exclusions
92439265

92449266
Update workspace fork exclusions (OAuth login or personal API key required)

‎apps/docs/content/docs/cli/workspaces.mdx‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,27 @@ sim workspaces get
4141

4242
API request and response schemas: [getWorkspace](/api-reference/workspaces/getWorkspace).
4343

44+
### Update workspace
45+
46+
OAuth login or personal API key required.
47+
48+
```bash
49+
sim workspaces update [options]
50+
```
51+
52+
**Options**
53+
54+
<CommandTable>
55+
56+
| Option | Required | Description |
57+
| --- | --- | --- |
58+
| `--name <value>` | No | New workspace display name. |
59+
| `--logo-url <value>` | No | New workspace logo: a root-relative path (starting with /) or an https:// URL. To remove the logo, send logoUrl: null through the API or MCP (--logo-url null sends the word, not JSON null). |
60+
61+
</CommandTable>
62+
63+
API request and response schemas: [updateWorkspace](/api-reference/workspaces/updateWorkspace).
64+
4465
### List workspace members
4566

4667
```bash

0 commit comments

Comments
 (0)