-
Notifications
You must be signed in to change notification settings - Fork 18
feat(generated): Agents (batch 13ebc8c1) #437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
.changelog-pending/2026-09-01T21-42-41-b6350ef365d412ae1775ac389c8d8e4ad8c20734.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| * [#437](https://github.com/workos/workos-php/pull/437) fix(generated): regenerate from spec | ||
|
|
||
| **Features** | ||
| * **[agents](https://workos.com/docs/reference/agents)**: | ||
| * Made `AgentBlueprintsCreateRequest.session_settings` optional | ||
| * Added model `AgentTokenValidation` | ||
| * Added model `AgentBlueprintsTokenValidateTokenRequest` | ||
| * **agents_blueprints_tokens**: | ||
| * Added endpoint `POST /agents/blueprints/{agent_blueprint_id}/tokens/validate` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| d61348070f219d16b6285f205986c2d332bf6e9c | ||
| edb560e2be3f54b668ea8d11fa5a060c87ab5087 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| namespace WorkOS\Resource; | ||
|
|
||
| readonly class AgentBlueprintsTokenValidateTokenRequest implements \JsonSerializable | ||
| { | ||
| use JsonSerializableTrait; | ||
|
|
||
| public function __construct( | ||
| /** The agent access token (a JWT) to validate. */ | ||
| public string $agentAccessToken, | ||
| ) { | ||
| } | ||
|
|
||
| public static function fromArray(array $data): self | ||
| { | ||
| return new self( | ||
| agentAccessToken: $data['agent_access_token'], | ||
| ); | ||
| } | ||
|
|
||
| public function toArray(): array | ||
| { | ||
| return [ | ||
| 'agent_access_token' => $this->agentAccessToken, | ||
| ]; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| namespace WorkOS\Resource; | ||
|
|
||
| readonly class AgentTokenValidation implements \JsonSerializable | ||
| { | ||
| use JsonSerializableTrait; | ||
|
|
||
| public function __construct( | ||
| /** Always `true`: an invalid token is reported as an error with a stable code, never as a `200`. */ | ||
| public bool $valid, | ||
| /** The agent instance the token was minted for. */ | ||
| public string $agentInstanceId, | ||
| /** The agent instance session backing the token. */ | ||
| public string $agentInstanceSessionId, | ||
| /** The organization the agent acts within. */ | ||
| public string $organizationId, | ||
| /** | ||
| * The effective permission slugs carried by the token. | ||
| * @var array<string> | ||
| */ | ||
| public array $permissions, | ||
| /** The caller-supplied context echoed into the token at mint time, or `null` when none was given. */ | ||
| public ?string $intent, | ||
| /** The delegating user carried in the `act.sub` claim of the token, or `null` for autonomous sessions. */ | ||
| public ?string $actingUserId, | ||
| /** When the backing agent instance session expires. */ | ||
| public string $sessionExpiresAt, | ||
| ) { | ||
| } | ||
|
|
||
| public static function fromArray(array $data): self | ||
| { | ||
| return new self( | ||
| valid: $data['valid'] ?? true, | ||
| agentInstanceId: $data['agent_instance_id'], | ||
| agentInstanceSessionId: $data['agent_instance_session_id'], | ||
| organizationId: $data['organization_id'], | ||
| permissions: $data['permissions'], | ||
| intent: $data['intent'] ?? null, | ||
| actingUserId: $data['acting_user_id'] ?? null, | ||
| sessionExpiresAt: $data['session_expires_at'], | ||
| ); | ||
| } | ||
|
|
||
| public function toArray(): array | ||
| { | ||
| return [ | ||
| 'valid' => $this->valid, | ||
| 'agent_instance_id' => $this->agentInstanceId, | ||
| 'agent_instance_session_id' => $this->agentInstanceSessionId, | ||
| 'organization_id' => $this->organizationId, | ||
| 'permissions' => $this->permissions, | ||
| 'intent' => $this->intent, | ||
| 'acting_user_id' => $this->actingUserId, | ||
| 'session_expires_at' => $this->sessionExpiresAt, | ||
| ]; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
tests/Fixtures/agent_blueprints_token_validate_token_request.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "agent_access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6..." | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "valid": true, | ||
| "agent_instance_id": "agent_01EHWNCE74X7JSDV0X3SZ3KJNY", | ||
| "agent_instance_session_id": "agent_session_01EHWNCE74X7JSDV0X3SZ3KJNY", | ||
| "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", | ||
| "permissions": [ | ||
| "crm:read" | ||
| ], | ||
| "intent": "renew-contract-123", | ||
| "acting_user_id": "userland_user_01EHWNCE74X7JSDV0X3SZ3KJNY", | ||
| "session_expires_at": "2024-01-01T00:00:00.000Z" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When existing consumers call
createBlueprint($name, $sessionSettings)positionally, the settings object now binds to the?string $descriptionparameter, causing aTypeError. Making this parameter optional should preserve its existing positional slot; the corresponding resource constructor has the same compatibility break.Prompt To Fix With AI