diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 26b1ce24..2b2b4fa9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.50.0" + ".": "0.51.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 16d8f91d..47035ac5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 213 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/casemark/router-d877f8733c59535fe64ede3e403087094b7b62563cabd9f13b3cba08fc08a492.yml -openapi_spec_hash: 2f86e023964eb545ae8516a453e516e2 -config_hash: a31ba9c8a6ed0f2b6739f6522213040e +configured_endpoints: 211 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/casemark/router-866cc91e422dbe530e40757e8548c78340d886c61bd6ab5cef81a742a141db2d.yml +openapi_spec_hash: 3ba7c949a852fc2787cc75fcf81bc16e +config_hash: 2726ecf6661ab60be4ece0848a240344 diff --git a/CHANGELOG.md b/CHANGELOG.md index 19733241..737b7c60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.51.0 (2026-05-19) + +Full Changelog: [v0.50.0...v0.51.0](https://github.com/CaseMark/casedev-php/compare/v0.50.0...v0.51.0) + +### Features + +* **api:** api update ([668ac21](https://github.com/CaseMark/casedev-php/commit/668ac219a78a17023c759f0f41325f3bbe8e9a23)) + ## 0.50.0 (2026-05-15) Full Changelog: [v0.49.2...v0.50.0](https://github.com/CaseMark/casedev-php/compare/v0.49.2...v0.50.0) diff --git a/README.md b/README.md index 84351bcc..76e53c55 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The REST API documentation can be found on [docs.case.dev](https://docs.case.dev ``` -composer require "casemark/casedev 0.50.0" +composer require "casemark/casedev 0.51.0" ``` diff --git a/src/Agent/Skills/Namespaces/NamespaceCreateParams.php b/src/Agent/Skills/Namespaces/NamespaceCreateParams.php new file mode 100644 index 00000000..a66149c7 --- /dev/null +++ b/src/Agent/Skills/Namespaces/NamespaceCreateParams.php @@ -0,0 +1,121 @@ + */ + use SdkModel; + use SdkParams; + + /** + * URL-safe slug, e.g. "curi" or "client-firm-abc". Lowercase alphanumeric with single hyphens, 2-64 chars. + */ + #[Required('namespaceId')] + public string $namespaceID; + + #[Optional(nullable: true)] + public ?string $description; + + #[Optional(nullable: true)] + public ?string $label; + + #[Optional(nullable: true)] + public mixed $metadata; + + /** + * `new NamespaceCreateParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * NamespaceCreateParams::with(namespaceID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new NamespaceCreateParams)->withNamespaceID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $namespaceID, + ?string $description = null, + ?string $label = null, + mixed $metadata = null, + ): self { + $self = new self; + + $self['namespaceID'] = $namespaceID; + + null !== $description && $self['description'] = $description; + null !== $label && $self['label'] = $label; + null !== $metadata && $self['metadata'] = $metadata; + + return $self; + } + + /** + * URL-safe slug, e.g. "curi" or "client-firm-abc". Lowercase alphanumeric with single hyphens, 2-64 chars. + */ + public function withNamespaceID(string $namespaceID): self + { + $self = clone $this; + $self['namespaceID'] = $namespaceID; + + return $self; + } + + public function withDescription(?string $description): self + { + $self = clone $this; + $self['description'] = $description; + + return $self; + } + + public function withLabel(?string $label): self + { + $self = clone $this; + $self['label'] = $label; + + return $self; + } + + public function withMetadata(mixed $metadata): self + { + $self = clone $this; + $self['metadata'] = $metadata; + + return $self; + } +} diff --git a/src/Agent/Skills/Namespaces/NamespacePublishParams.php b/src/Agent/Skills/Namespaces/NamespacePublishParams.php new file mode 100644 index 00000000..6826114b --- /dev/null +++ b/src/Agent/Skills/Namespaces/NamespacePublishParams.php @@ -0,0 +1,77 @@ +} + */ +final class NamespacePublishParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** @var list $files */ + #[Required(list: File::class)] + public array $files; + + /** + * `new NamespacePublishParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * NamespacePublishParams::with(files: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new NamespacePublishParams)->withFiles(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $files + */ + public static function with(array $files): self + { + $self = new self; + + $self['files'] = $files; + + return $self; + } + + /** + * @param list $files + */ + public function withFiles(array $files): self + { + $self = clone $this; + $self['files'] = $files; + + return $self; + } +} diff --git a/src/Agent/Skills/Namespaces/NamespacePublishParams/File.php b/src/Agent/Skills/Namespaces/NamespacePublishParams/File.php new file mode 100644 index 00000000..b27efef8 --- /dev/null +++ b/src/Agent/Skills/Namespaces/NamespacePublishParams/File.php @@ -0,0 +1,116 @@ +, + * path: string, + * contentType?: string|null, + * } + */ +final class File implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + #[Required] + public string $content; + + /** @var value-of $encoding */ + #[Required(enum: Encoding::class)] + public string $encoding; + + #[Required] + public string $path; + + #[Optional(nullable: true)] + public ?string $contentType; + + /** + * `new File()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * File::with(content: ..., encoding: ..., path: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new File)->withContent(...)->withEncoding(...)->withPath(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Encoding|value-of $encoding + */ + public static function with( + string $content, + Encoding|string $encoding, + string $path, + ?string $contentType = null, + ): self { + $self = new self; + + $self['content'] = $content; + $self['encoding'] = $encoding; + $self['path'] = $path; + + null !== $contentType && $self['contentType'] = $contentType; + + return $self; + } + + public function withContent(string $content): self + { + $self = clone $this; + $self['content'] = $content; + + return $self; + } + + /** + * @param Encoding|value-of $encoding + */ + public function withEncoding(Encoding|string $encoding): self + { + $self = clone $this; + $self['encoding'] = $encoding; + + return $self; + } + + public function withPath(string $path): self + { + $self = clone $this; + $self['path'] = $path; + + return $self; + } + + public function withContentType(?string $contentType): self + { + $self = clone $this; + $self['contentType'] = $contentType; + + return $self; + } +} diff --git a/src/Agent/Skills/Namespaces/NamespacePublishParams/File/Encoding.php b/src/Agent/Skills/Namespaces/NamespacePublishParams/File/Encoding.php new file mode 100644 index 00000000..d55cf785 --- /dev/null +++ b/src/Agent/Skills/Namespaces/NamespacePublishParams/File/Encoding.php @@ -0,0 +1,12 @@ +agent = new AgentService($this); $this->system = new SystemService($this); - $this->worker = new WorkerService($this); $this->compute = new ComputeService($this); $this->database = new DatabaseService($this); $this->format = new FormatService($this); diff --git a/src/Compute/V1/Instances/InstanceCreateParams.php b/src/Compute/V1/Instances/InstanceCreateParams.php index 4b36c3bd..21e8edd6 100644 --- a/src/Compute/V1/Instances/InstanceCreateParams.php +++ b/src/Compute/V1/Instances/InstanceCreateParams.php @@ -11,7 +11,7 @@ use CaseDev\Core\Contracts\BaseModel; /** - * Launches a new GPU compute instance with automatic SSH key generation. Supports mounting Case.dev Vaults as filesystems and configurable auto-shutdown. Instance boots in ~2-5 minutes. Perfect for batch OCR processing, AI model training, and intensive document analysis workloads. + * Launches a new GPU compute instance with automatic SSH key generation. Supports mounting Case.dev Vaults as filesystems. Instance boots in ~2-5 minutes. Perfect for batch OCR processing, AI model training, and intensive document analysis workloads. * * @see CaseDev\Services\Compute\V1\InstancesService::create() * @@ -19,7 +19,6 @@ * instanceType: string, * name: string, * region: string, - * autoShutdownMinutes?: int|null, * vaultIDs?: list|null, * } */ @@ -47,12 +46,6 @@ final class InstanceCreateParams implements BaseModel #[Required] public string $region; - /** - * Auto-shutdown timer (null = never). - */ - #[Optional(nullable: true)] - public ?int $autoShutdownMinutes; - /** * Vault IDs to mount. * @@ -94,8 +87,7 @@ public static function with( string $instanceType, string $name, string $region, - ?int $autoShutdownMinutes = null, - ?array $vaultIDs = null, + ?array $vaultIDs = null ): self { $self = new self; @@ -103,7 +95,6 @@ public static function with( $self['name'] = $name; $self['region'] = $region; - null !== $autoShutdownMinutes && $self['autoShutdownMinutes'] = $autoShutdownMinutes; null !== $vaultIDs && $self['vaultIDs'] = $vaultIDs; return $self; @@ -142,17 +133,6 @@ public function withRegion(string $region): self return $self; } - /** - * Auto-shutdown timer (null = never). - */ - public function withAutoShutdownMinutes(?int $autoShutdownMinutes): self - { - $self = clone $this; - $self['autoShutdownMinutes'] = $autoShutdownMinutes; - - return $self; - } - /** * Vault IDs to mount. * diff --git a/src/Compute/V1/Instances/InstanceGetResponse.php b/src/Compute/V1/Instances/InstanceGetResponse.php index 79d47328..97df3715 100644 --- a/src/Compute/V1/Instances/InstanceGetResponse.php +++ b/src/Compute/V1/Instances/InstanceGetResponse.php @@ -14,7 +14,6 @@ * * @phpstan-type InstanceGetResponseShape = array{ * id?: string|null, - * autoShutdownMinutes?: int|null, * createdAt?: string|null, * currentCost?: string|null, * currentRuntimeSeconds?: int|null, @@ -39,9 +38,6 @@ final class InstanceGetResponse implements BaseModel #[Optional] public ?string $id; - #[Optional(nullable: true)] - public ?int $autoShutdownMinutes; - #[Optional] public ?string $createdAt; @@ -98,7 +94,6 @@ public function __construct() */ public static function with( ?string $id = null, - ?int $autoShutdownMinutes = null, ?string $createdAt = null, ?string $currentCost = null, ?int $currentRuntimeSeconds = null, @@ -117,7 +112,6 @@ public static function with( $self = new self; null !== $id && $self['id'] = $id; - null !== $autoShutdownMinutes && $self['autoShutdownMinutes'] = $autoShutdownMinutes; null !== $createdAt && $self['createdAt'] = $createdAt; null !== $currentCost && $self['currentCost'] = $currentCost; null !== $currentRuntimeSeconds && $self['currentRuntimeSeconds'] = $currentRuntimeSeconds; @@ -144,14 +138,6 @@ public function withID(string $id): self return $self; } - public function withAutoShutdownMinutes(?int $autoShutdownMinutes): self - { - $self = clone $this; - $self['autoShutdownMinutes'] = $autoShutdownMinutes; - - return $self; - } - public function withCreatedAt(string $createdAt): self { $self = clone $this; diff --git a/src/Compute/V1/Instances/InstanceListResponse/Instance.php b/src/Compute/V1/Instances/InstanceListResponse/Instance.php index dfde6d30..70101412 100644 --- a/src/Compute/V1/Instances/InstanceListResponse/Instance.php +++ b/src/Compute/V1/Instances/InstanceListResponse/Instance.php @@ -12,7 +12,6 @@ /** * @phpstan-type InstanceShape = array{ * id?: string|null, - * autoShutdownMinutes?: int|null, * createdAt?: \DateTimeInterface|null, * gpu?: string|null, * instanceType?: string|null, @@ -34,9 +33,6 @@ final class Instance implements BaseModel #[Optional] public ?string $id; - #[Optional(nullable: true)] - public ?int $autoShutdownMinutes; - #[Optional] public ?\DateTimeInterface $createdAt; @@ -85,7 +81,6 @@ public function __construct() */ public static function with( ?string $id = null, - ?int $autoShutdownMinutes = null, ?\DateTimeInterface $createdAt = null, ?string $gpu = null, ?string $instanceType = null, @@ -101,7 +96,6 @@ public static function with( $self = new self; null !== $id && $self['id'] = $id; - null !== $autoShutdownMinutes && $self['autoShutdownMinutes'] = $autoShutdownMinutes; null !== $createdAt && $self['createdAt'] = $createdAt; null !== $gpu && $self['gpu'] = $gpu; null !== $instanceType && $self['instanceType'] = $instanceType; @@ -125,14 +119,6 @@ public function withID(string $id): self return $self; } - public function withAutoShutdownMinutes(?int $autoShutdownMinutes): self - { - $self = clone $this; - $self['autoShutdownMinutes'] = $autoShutdownMinutes; - - return $self; - } - public function withCreatedAt(\DateTimeInterface $createdAt): self { $self = clone $this; diff --git a/src/Compute/V1/Instances/InstanceNewResponse.php b/src/Compute/V1/Instances/InstanceNewResponse.php index bd530d1a..ac508e8b 100644 --- a/src/Compute/V1/Instances/InstanceNewResponse.php +++ b/src/Compute/V1/Instances/InstanceNewResponse.php @@ -11,7 +11,6 @@ /** * @phpstan-type InstanceNewResponseShape = array{ * id?: string|null, - * autoShutdownMinutes?: int|null, * createdAt?: string|null, * gpu?: string|null, * instanceType?: string|null, @@ -32,9 +31,6 @@ final class InstanceNewResponse implements BaseModel #[Optional] public ?string $id; - #[Optional(nullable: true)] - public ?int $autoShutdownMinutes; - #[Optional] public ?string $createdAt; @@ -80,7 +76,6 @@ public function __construct() */ public static function with( ?string $id = null, - ?int $autoShutdownMinutes = null, ?string $createdAt = null, ?string $gpu = null, ?string $instanceType = null, @@ -95,7 +90,6 @@ public static function with( $self = new self; null !== $id && $self['id'] = $id; - null !== $autoShutdownMinutes && $self['autoShutdownMinutes'] = $autoShutdownMinutes; null !== $createdAt && $self['createdAt'] = $createdAt; null !== $gpu && $self['gpu'] = $gpu; null !== $instanceType && $self['instanceType'] = $instanceType; @@ -118,14 +112,6 @@ public function withID(string $id): self return $self; } - public function withAutoShutdownMinutes(?int $autoShutdownMinutes): self - { - $self = clone $this; - $self['autoShutdownMinutes'] = $autoShutdownMinutes; - - return $self; - } - public function withCreatedAt(string $createdAt): self { $self = clone $this; diff --git a/src/ServiceContracts/Worker/V1Contract.php b/src/ServiceContracts/Agent/Skills/NamespacesContract.php similarity index 62% rename from src/ServiceContracts/Worker/V1Contract.php rename to src/ServiceContracts/Agent/Skills/NamespacesContract.php index be40fcc5..c5ca05a9 100644 --- a/src/ServiceContracts/Worker/V1Contract.php +++ b/src/ServiceContracts/Agent/Skills/NamespacesContract.php @@ -2,30 +2,38 @@ declare(strict_types=1); -namespace CaseDev\ServiceContracts\Worker; +namespace CaseDev\ServiceContracts\Agent\Skills; +use CaseDev\Agent\Skills\Namespaces\NamespacePublishParams\File; use CaseDev\Core\Exceptions\APIException; use CaseDev\RequestOptions; /** + * @phpstan-import-type FileShape from \CaseDev\Agent\Skills\Namespaces\NamespacePublishParams\File * @phpstan-import-type RequestOpts from \CaseDev\RequestOptions */ -interface V1Contract +interface NamespacesContract { /** * @api * + * @param string $namespaceID URL-safe slug, e.g. "curi" or "client-firm-abc". Lowercase alphanumeric with single hyphens, 2-64 chars. * @param RequestOpts|null $requestOptions * * @throws APIException */ public function create( - RequestOptions|array|null $requestOptions = null + string $namespaceID, + ?string $description = null, + ?string $label = null, + mixed $metadata = null, + RequestOptions|array|null $requestOptions = null, ): mixed; /** * @api * + * @param string $id Namespace row id (e.g. skn_...) * @param RequestOpts|null $requestOptions * * @throws APIException @@ -42,8 +50,7 @@ public function retrieve( * * @throws APIException */ - public function delete( - string $id, + public function list( RequestOptions|array|null $requestOptions = null ): mixed; @@ -54,7 +61,7 @@ public function delete( * * @throws APIException */ - public function boot( + public function delete( string $id, RequestOptions|array|null $requestOptions = null ): mixed; @@ -62,40 +69,15 @@ public function boot( /** * @api * + * @param list $files * @param RequestOpts|null $requestOptions * * @throws APIException */ - public function proxyDelete( - string $workerPath, + public function publish( string $id, - RequestOptions|array|null $requestOptions = null, - ): mixed; - - /** - * @api - * - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function proxyGet( - string $workerPath, - string $id, - RequestOptions|array|null $requestOptions = null, - ): mixed; - - /** - * @api - * - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function proxyPatch( - string $workerPath, - string $id, - RequestOptions|array|null $requestOptions = null, + array $files, + RequestOptions|array|null $requestOptions = null ): mixed; /** @@ -105,10 +87,9 @@ public function proxyPatch( * * @throws APIException */ - public function proxyPost( - string $workerPath, + public function pull( string $id, - RequestOptions|array|null $requestOptions = null, + RequestOptions|array|null $requestOptions = null ): mixed; /** @@ -118,9 +99,8 @@ public function proxyPost( * * @throws APIException */ - public function proxyPut( - string $workerPath, + public function rotateToken( string $id, - RequestOptions|array|null $requestOptions = null, + RequestOptions|array|null $requestOptions = null ): mixed; } diff --git a/src/ServiceContracts/Worker/V1RawContract.php b/src/ServiceContracts/Agent/Skills/NamespacesRawContract.php similarity index 54% rename from src/ServiceContracts/Worker/V1RawContract.php rename to src/ServiceContracts/Agent/Skills/NamespacesRawContract.php index c5731c12..d1d657a9 100644 --- a/src/ServiceContracts/Worker/V1RawContract.php +++ b/src/ServiceContracts/Agent/Skills/NamespacesRawContract.php @@ -2,25 +2,23 @@ declare(strict_types=1); -namespace CaseDev\ServiceContracts\Worker; +namespace CaseDev\ServiceContracts\Agent\Skills; +use CaseDev\Agent\Skills\Namespaces\NamespaceCreateParams; +use CaseDev\Agent\Skills\Namespaces\NamespacePublishParams; use CaseDev\Core\Contracts\BaseResponse; use CaseDev\Core\Exceptions\APIException; use CaseDev\RequestOptions; -use CaseDev\Worker\V1\V1ProxyDeleteParams; -use CaseDev\Worker\V1\V1ProxyGetParams; -use CaseDev\Worker\V1\V1ProxyPatchParams; -use CaseDev\Worker\V1\V1ProxyPostParams; -use CaseDev\Worker\V1\V1ProxyPutParams; /** * @phpstan-import-type RequestOpts from \CaseDev\RequestOptions */ -interface V1RawContract +interface NamespacesRawContract { /** * @api * + * @param array|NamespaceCreateParams $params * @param RequestOpts|null $requestOptions * * @return BaseResponse @@ -28,12 +26,14 @@ interface V1RawContract * @throws APIException */ public function create( - RequestOptions|array|null $requestOptions = null + array|NamespaceCreateParams $params, + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * + * @param string $id Namespace row id (e.g. skn_...) * @param RequestOpts|null $requestOptions * * @return BaseResponse @@ -54,8 +54,7 @@ public function retrieve( * * @throws APIException */ - public function delete( - string $id, + public function list( RequestOptions|array|null $requestOptions = null ): BaseResponse; @@ -68,7 +67,7 @@ public function delete( * * @throws APIException */ - public function boot( + public function delete( string $id, RequestOptions|array|null $requestOptions = null ): BaseResponse; @@ -76,80 +75,44 @@ public function boot( /** * @api * - * @param array|V1ProxyDeleteParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function proxyDelete( - string $workerPath, - array|V1ProxyDeleteParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse; - - /** - * @api - * - * @param array|V1ProxyGetParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function proxyGet( - string $workerPath, - array|V1ProxyGetParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse; - - /** - * @api - * - * @param array|V1ProxyPatchParams $params + * @param array|NamespacePublishParams $params * @param RequestOpts|null $requestOptions * * @return BaseResponse * * @throws APIException */ - public function proxyPatch( - string $workerPath, - array|V1ProxyPatchParams $params, + public function publish( + string $id, + array|NamespacePublishParams $params, RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * - * @param array|V1ProxyPostParams $params * @param RequestOpts|null $requestOptions * * @return BaseResponse * * @throws APIException */ - public function proxyPost( - string $workerPath, - array|V1ProxyPostParams $params, - RequestOptions|array|null $requestOptions = null, + public function pull( + string $id, + RequestOptions|array|null $requestOptions = null ): BaseResponse; /** * @api * - * @param array|V1ProxyPutParams $params * @param RequestOpts|null $requestOptions * * @return BaseResponse * * @throws APIException */ - public function proxyPut( - string $workerPath, - array|V1ProxyPutParams $params, - RequestOptions|array|null $requestOptions = null, + public function rotateToken( + string $id, + RequestOptions|array|null $requestOptions = null ): BaseResponse; } diff --git a/src/ServiceContracts/Agent/SkillsContract.php b/src/ServiceContracts/Agent/SkillsContract.php new file mode 100644 index 00000000..5cefb24e --- /dev/null +++ b/src/ServiceContracts/Agent/SkillsContract.php @@ -0,0 +1,7 @@ + $vaultIDs Vault IDs to mount * @param RequestOpts|null $requestOptions * @@ -32,7 +31,6 @@ public function create( string $instanceType, string $name, string $region, - ?int $autoShutdownMinutes = null, ?array $vaultIDs = null, RequestOptions|array|null $requestOptions = null, ): InstanceNewResponse; diff --git a/src/ServiceContracts/WorkerContract.php b/src/ServiceContracts/WorkerContract.php deleted file mode 100644 index 524f0a9d..00000000 --- a/src/ServiceContracts/WorkerContract.php +++ /dev/null @@ -1,7 +0,0 @@ - + * + * @throws APIException + */ + public function create( + array|NamespaceCreateParams $params, + RequestOptions|array|null $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = NamespaceCreateParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'agent/skills/namespaces', + body: (object) $parsed, + options: $options, + convert: null, + ); + } + + /** + * @api + * + * Read skill namespace + * + * @param string $id Namespace row id (e.g. skn_...) + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse + * + * @throws APIException + */ + public function retrieve( + string $id, + RequestOptions|array|null $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: ['agent/skills/namespaces/%1$s', $id], + options: $requestOptions, + convert: null, + ); + } + + /** + * @api + * + * List all active skill namespaces owned by the authenticated organization. + * + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse + * + * @throws APIException + */ + public function list( + RequestOptions|array|null $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: 'agent/skills/namespaces', + options: $requestOptions, + convert: null, + ); + } + + /** + * @api + * + * Delete skill namespace + * + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + string $id, + RequestOptions|array|null $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'delete', + path: ['agent/skills/namespaces/%1$s', $id], + options: $requestOptions, + convert: null, + ); + } + + /** + * @api + * + * Upload a tree of skill files for the namespace. Authenticated by the namespace bearer token. Atomic at the version-bump level: a partial upload leaves the namespace pinned to the previous version. + * + * @param array{files: list}|NamespacePublishParams $params + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse + * + * @throws APIException + */ + public function publish( + string $id, + array|NamespacePublishParams $params, + RequestOptions|array|null $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = NamespacePublishParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: ['agent/skills/namespaces/%1$s/publish', $id], + body: (object) $parsed, + options: $options, + convert: null, + ); + } + + /** + * @api + * + * Returns the active version's file manifest with short-lived presigned S3 URLs. Sandboxes use this to materialize the tree at /workspace/.agents/skills/ before opencode boots. + * + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse + * + * @throws APIException + */ + public function pull( + string $id, + RequestOptions|array|null $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: ['agent/skills/namespaces/%1$s/pull', $id], + options: $requestOptions, + convert: null, + ); + } + + /** + * @api + * + * Rotate skill namespace token + * + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse + * + * @throws APIException + */ + public function rotateToken( + string $id, + RequestOptions|array|null $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: ['agent/skills/namespaces/%1$s/rotate-token', $id], + options: $requestOptions, + convert: null, + ); + } +} diff --git a/src/Services/Agent/Skills/NamespacesService.php b/src/Services/Agent/Skills/NamespacesService.php new file mode 100644 index 00000000..c3482093 --- /dev/null +++ b/src/Services/Agent/Skills/NamespacesService.php @@ -0,0 +1,184 @@ +raw = new NamespacesRawService($client); + } + + /** + * @api + * + * Create a private skill namespace owned by the authenticated org and receive a one-time bearer token used by the case-skills publisher. + * + * @param string $namespaceID URL-safe slug, e.g. "curi" or "client-firm-abc". Lowercase alphanumeric with single hyphens, 2-64 chars. + * @param RequestOpts|null $requestOptions + * + * @throws APIException + */ + public function create( + string $namespaceID, + ?string $description = null, + ?string $label = null, + mixed $metadata = null, + RequestOptions|array|null $requestOptions = null, + ): mixed { + $params = Util::removeNulls( + [ + 'namespaceID' => $namespaceID, + 'description' => $description, + 'label' => $label, + 'metadata' => $metadata, + ], + ); + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->create(params: $params, requestOptions: $requestOptions); + + return $response->parse(); + } + + /** + * @api + * + * Read skill namespace + * + * @param string $id Namespace row id (e.g. skn_...) + * @param RequestOpts|null $requestOptions + * + * @throws APIException + */ + public function retrieve( + string $id, + RequestOptions|array|null $requestOptions = null + ): mixed { + // @phpstan-ignore-next-line argument.type + $response = $this->raw->retrieve($id, requestOptions: $requestOptions); + + return $response->parse(); + } + + /** + * @api + * + * List all active skill namespaces owned by the authenticated organization. + * + * @param RequestOpts|null $requestOptions + * + * @throws APIException + */ + public function list( + RequestOptions|array|null $requestOptions = null + ): mixed { + // @phpstan-ignore-next-line argument.type + $response = $this->raw->list(requestOptions: $requestOptions); + + return $response->parse(); + } + + /** + * @api + * + * Delete skill namespace + * + * @param RequestOpts|null $requestOptions + * + * @throws APIException + */ + public function delete( + string $id, + RequestOptions|array|null $requestOptions = null + ): mixed { + // @phpstan-ignore-next-line argument.type + $response = $this->raw->delete($id, requestOptions: $requestOptions); + + return $response->parse(); + } + + /** + * @api + * + * Upload a tree of skill files for the namespace. Authenticated by the namespace bearer token. Atomic at the version-bump level: a partial upload leaves the namespace pinned to the previous version. + * + * @param list $files + * @param RequestOpts|null $requestOptions + * + * @throws APIException + */ + public function publish( + string $id, + array $files, + RequestOptions|array|null $requestOptions = null + ): mixed { + $params = Util::removeNulls(['files' => $files]); + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->publish($id, params: $params, requestOptions: $requestOptions); + + return $response->parse(); + } + + /** + * @api + * + * Returns the active version's file manifest with short-lived presigned S3 URLs. Sandboxes use this to materialize the tree at /workspace/.agents/skills/ before opencode boots. + * + * @param RequestOpts|null $requestOptions + * + * @throws APIException + */ + public function pull( + string $id, + RequestOptions|array|null $requestOptions = null + ): mixed { + // @phpstan-ignore-next-line argument.type + $response = $this->raw->pull($id, requestOptions: $requestOptions); + + return $response->parse(); + } + + /** + * @api + * + * Rotate skill namespace token + * + * @param RequestOpts|null $requestOptions + * + * @throws APIException + */ + public function rotateToken( + string $id, + RequestOptions|array|null $requestOptions = null + ): mixed { + // @phpstan-ignore-next-line argument.type + $response = $this->raw->rotateToken($id, requestOptions: $requestOptions); + + return $response->parse(); + } +} diff --git a/src/Services/WorkerRawService.php b/src/Services/Agent/SkillsRawService.php similarity index 55% rename from src/Services/WorkerRawService.php rename to src/Services/Agent/SkillsRawService.php index 09391968..940296f2 100644 --- a/src/Services/WorkerRawService.php +++ b/src/Services/Agent/SkillsRawService.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace CaseDev\Services; +namespace CaseDev\Services\Agent; use CaseDev\Client; -use CaseDev\ServiceContracts\WorkerRawContract; +use CaseDev\ServiceContracts\Agent\SkillsRawContract; -final class WorkerRawService implements WorkerRawContract +final class SkillsRawService implements SkillsRawContract { // @phpstan-ignore-next-line /** diff --git a/src/Services/Agent/SkillsService.php b/src/Services/Agent/SkillsService.php new file mode 100644 index 00000000..b2b53d80 --- /dev/null +++ b/src/Services/Agent/SkillsService.php @@ -0,0 +1,31 @@ +raw = new SkillsRawService($client); + $this->namespaces = new NamespacesService($client); + } +} diff --git a/src/Services/AgentService.php b/src/Services/AgentService.php index 9223803f..cef0fef1 100644 --- a/src/Services/AgentService.php +++ b/src/Services/AgentService.php @@ -6,6 +6,7 @@ use CaseDev\Client; use CaseDev\ServiceContracts\AgentContract; +use CaseDev\Services\Agent\SkillsService; use CaseDev\Services\Agent\V1Service; final class AgentService implements AgentContract @@ -15,6 +16,11 @@ final class AgentService implements AgentContract */ public AgentRawService $raw; + /** + * @api + */ + public SkillsService $skills; + /** * @api */ @@ -26,6 +32,7 @@ final class AgentService implements AgentContract public function __construct(private Client $client) { $this->raw = new AgentRawService($client); + $this->skills = new SkillsService($client); $this->v1 = new V1Service($client); } } diff --git a/src/Services/Compute/V1/InstancesRawService.php b/src/Services/Compute/V1/InstancesRawService.php index 604fcc3e..10c2dbe7 100644 --- a/src/Services/Compute/V1/InstancesRawService.php +++ b/src/Services/Compute/V1/InstancesRawService.php @@ -31,14 +31,10 @@ public function __construct(private Client $client) {} /** * @api * - * Launches a new GPU compute instance with automatic SSH key generation. Supports mounting Case.dev Vaults as filesystems and configurable auto-shutdown. Instance boots in ~2-5 minutes. Perfect for batch OCR processing, AI model training, and intensive document analysis workloads. + * Launches a new GPU compute instance with automatic SSH key generation. Supports mounting Case.dev Vaults as filesystems. Instance boots in ~2-5 minutes. Perfect for batch OCR processing, AI model training, and intensive document analysis workloads. * * @param array{ - * instanceType: string, - * name: string, - * region: string, - * autoShutdownMinutes?: int|null, - * vaultIDs?: list, + * instanceType: string, name: string, region: string, vaultIDs?: list * }|InstanceCreateParams $params * @param RequestOpts|null $requestOptions * @@ -93,7 +89,7 @@ public function retrieve( /** * @api * - * Retrieves all GPU compute instances for your organization with real-time status updates from Lambda Labs. Includes pricing, runtime metrics, and auto-shutdown configuration. Perfect for monitoring AI workloads, document processing jobs, and cost tracking. + * Retrieves all GPU compute instances for your organization with real-time status updates from Lambda Labs. Includes pricing and runtime metrics. Perfect for monitoring AI workloads, document processing jobs, and cost tracking. * * @param RequestOpts|null $requestOptions * diff --git a/src/Services/Compute/V1/InstancesService.php b/src/Services/Compute/V1/InstancesService.php index 3cf77d19..d75f1dae 100644 --- a/src/Services/Compute/V1/InstancesService.php +++ b/src/Services/Compute/V1/InstancesService.php @@ -37,12 +37,11 @@ public function __construct(private Client $client) /** * @api * - * Launches a new GPU compute instance with automatic SSH key generation. Supports mounting Case.dev Vaults as filesystems and configurable auto-shutdown. Instance boots in ~2-5 minutes. Perfect for batch OCR processing, AI model training, and intensive document analysis workloads. + * Launches a new GPU compute instance with automatic SSH key generation. Supports mounting Case.dev Vaults as filesystems. Instance boots in ~2-5 minutes. Perfect for batch OCR processing, AI model training, and intensive document analysis workloads. * * @param string $instanceType GPU type (e.g., 'gpu_1x_h100_sxm5') * @param string $name Instance name * @param string $region Region (e.g., 'us-west-1') - * @param int|null $autoShutdownMinutes Auto-shutdown timer (null = never) * @param list $vaultIDs Vault IDs to mount * @param RequestOpts|null $requestOptions * @@ -52,7 +51,6 @@ public function create( string $instanceType, string $name, string $region, - ?int $autoShutdownMinutes = null, ?array $vaultIDs = null, RequestOptions|array|null $requestOptions = null, ): InstanceNewResponse { @@ -61,7 +59,6 @@ public function create( 'instanceType' => $instanceType, 'name' => $name, 'region' => $region, - 'autoShutdownMinutes' => $autoShutdownMinutes, 'vaultIDs' => $vaultIDs, ], ); @@ -95,7 +92,7 @@ public function retrieve( /** * @api * - * Retrieves all GPU compute instances for your organization with real-time status updates from Lambda Labs. Includes pricing, runtime metrics, and auto-shutdown configuration. Perfect for monitoring AI workloads, document processing jobs, and cost tracking. + * Retrieves all GPU compute instances for your organization with real-time status updates from Lambda Labs. Includes pricing and runtime metrics. Perfect for monitoring AI workloads, document processing jobs, and cost tracking. * * @param RequestOpts|null $requestOptions * diff --git a/src/Services/Worker/V1RawService.php b/src/Services/Worker/V1RawService.php deleted file mode 100644 index a4cb143f..00000000 --- a/src/Services/Worker/V1RawService.php +++ /dev/null @@ -1,288 +0,0 @@ - - * - * @throws APIException - */ - public function create( - RequestOptions|array|null $requestOptions = null - ): BaseResponse { - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'post', - path: 'worker/v1', - options: $requestOptions, - convert: null - ); - } - - /** - * @api - * - * Get worker - * - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function retrieve( - string $id, - RequestOptions|array|null $requestOptions = null - ): BaseResponse { - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'get', - path: ['worker/v1/%1$s', $id], - options: $requestOptions, - convert: null, - ); - } - - /** - * @api - * - * End worker - * - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function delete( - string $id, - RequestOptions|array|null $requestOptions = null - ): BaseResponse { - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'delete', - path: ['worker/v1/%1$s', $id], - options: $requestOptions, - convert: null, - ); - } - - /** - * @api - * - * Starts or resumes the worker sandbox and OpenCode server. Native /worker/v1/:id/* proxy routes require this lifecycle primitive to have completed first. - * - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function boot( - string $id, - RequestOptions|array|null $requestOptions = null - ): BaseResponse { - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'post', - path: ['worker/v1/%1$s/boot', $id], - options: $requestOptions, - convert: null, - ); - } - - /** - * @api - * - * Forwards a DELETE request to the worker runtime without translating response shapes. - * - * @param array{id: string}|V1ProxyDeleteParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function proxyDelete( - string $workerPath, - array|V1ProxyDeleteParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse { - [$parsed, $options] = V1ProxyDeleteParams::parseRequest( - $params, - $requestOptions, - ); - $id = $parsed['id']; - unset($parsed['id']); - - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'delete', - path: ['worker/v1/%1$s/%2$s', $id, $workerPath], - options: $options, - convert: null, - ); - } - - /** - * @api - * - * Forwards a GET request to the worker runtime without translating response or SSE event shapes. - * - * @param array{id: string}|V1ProxyGetParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function proxyGet( - string $workerPath, - array|V1ProxyGetParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse { - [$parsed, $options] = V1ProxyGetParams::parseRequest( - $params, - $requestOptions, - ); - $id = $parsed['id']; - unset($parsed['id']); - - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'get', - path: ['worker/v1/%1$s/%2$s', $id, $workerPath], - options: $options, - convert: null, - ); - } - - /** - * @api - * - * Forwards a PATCH request to the worker runtime without translating request or response shapes. - * - * @param array{id: string}|V1ProxyPatchParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function proxyPatch( - string $workerPath, - array|V1ProxyPatchParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse { - [$parsed, $options] = V1ProxyPatchParams::parseRequest( - $params, - $requestOptions, - ); - $id = $parsed['id']; - unset($parsed['id']); - - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'patch', - path: ['worker/v1/%1$s/%2$s', $id, $workerPath], - options: $options, - convert: null, - ); - } - - /** - * @api - * - * Forwards a POST request to the worker runtime without translating request, response, or SSE event shapes. - * - * @param array{id: string}|V1ProxyPostParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function proxyPost( - string $workerPath, - array|V1ProxyPostParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse { - [$parsed, $options] = V1ProxyPostParams::parseRequest( - $params, - $requestOptions, - ); - $id = $parsed['id']; - unset($parsed['id']); - - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'post', - path: ['worker/v1/%1$s/%2$s', $id, $workerPath], - options: $options, - convert: null, - ); - } - - /** - * @api - * - * Forwards a PUT request to the worker runtime without translating request or response shapes. - * - * @param array{id: string}|V1ProxyPutParams $params - * @param RequestOpts|null $requestOptions - * - * @return BaseResponse - * - * @throws APIException - */ - public function proxyPut( - string $workerPath, - array|V1ProxyPutParams $params, - RequestOptions|array|null $requestOptions = null, - ): BaseResponse { - [$parsed, $options] = V1ProxyPutParams::parseRequest( - $params, - $requestOptions, - ); - $id = $parsed['id']; - unset($parsed['id']); - - // @phpstan-ignore-next-line return.type - return $this->client->request( - method: 'put', - path: ['worker/v1/%1$s/%2$s', $id, $workerPath], - options: $options, - convert: null, - ); - } -} diff --git a/src/Services/Worker/V1Service.php b/src/Services/Worker/V1Service.php deleted file mode 100644 index d51882d3..00000000 --- a/src/Services/Worker/V1Service.php +++ /dev/null @@ -1,215 +0,0 @@ -raw = new V1RawService($client); - } - - /** - * @api - * - * Creates a Daytona-backed worker runtime. The worker exposes its native runtime API through /worker/v1/:id/* without reshaping payloads or events. - * - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function create( - RequestOptions|array|null $requestOptions = null - ): mixed { - // @phpstan-ignore-next-line argument.type - $response = $this->raw->create(requestOptions: $requestOptions); - - return $response->parse(); - } - - /** - * @api - * - * Get worker - * - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function retrieve( - string $id, - RequestOptions|array|null $requestOptions = null - ): mixed { - // @phpstan-ignore-next-line argument.type - $response = $this->raw->retrieve($id, requestOptions: $requestOptions); - - return $response->parse(); - } - - /** - * @api - * - * End worker - * - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function delete( - string $id, - RequestOptions|array|null $requestOptions = null - ): mixed { - // @phpstan-ignore-next-line argument.type - $response = $this->raw->delete($id, requestOptions: $requestOptions); - - return $response->parse(); - } - - /** - * @api - * - * Starts or resumes the worker sandbox and OpenCode server. Native /worker/v1/:id/* proxy routes require this lifecycle primitive to have completed first. - * - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function boot( - string $id, - RequestOptions|array|null $requestOptions = null - ): mixed { - // @phpstan-ignore-next-line argument.type - $response = $this->raw->boot($id, requestOptions: $requestOptions); - - return $response->parse(); - } - - /** - * @api - * - * Forwards a DELETE request to the worker runtime without translating response shapes. - * - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function proxyDelete( - string $workerPath, - string $id, - RequestOptions|array|null $requestOptions = null, - ): mixed { - $params = Util::removeNulls(['id' => $id]); - - // @phpstan-ignore-next-line argument.type - $response = $this->raw->proxyDelete($workerPath, params: $params, requestOptions: $requestOptions); - - return $response->parse(); - } - - /** - * @api - * - * Forwards a GET request to the worker runtime without translating response or SSE event shapes. - * - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function proxyGet( - string $workerPath, - string $id, - RequestOptions|array|null $requestOptions = null, - ): mixed { - $params = Util::removeNulls(['id' => $id]); - - // @phpstan-ignore-next-line argument.type - $response = $this->raw->proxyGet($workerPath, params: $params, requestOptions: $requestOptions); - - return $response->parse(); - } - - /** - * @api - * - * Forwards a PATCH request to the worker runtime without translating request or response shapes. - * - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function proxyPatch( - string $workerPath, - string $id, - RequestOptions|array|null $requestOptions = null, - ): mixed { - $params = Util::removeNulls(['id' => $id]); - - // @phpstan-ignore-next-line argument.type - $response = $this->raw->proxyPatch($workerPath, params: $params, requestOptions: $requestOptions); - - return $response->parse(); - } - - /** - * @api - * - * Forwards a POST request to the worker runtime without translating request, response, or SSE event shapes. - * - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function proxyPost( - string $workerPath, - string $id, - RequestOptions|array|null $requestOptions = null, - ): mixed { - $params = Util::removeNulls(['id' => $id]); - - // @phpstan-ignore-next-line argument.type - $response = $this->raw->proxyPost($workerPath, params: $params, requestOptions: $requestOptions); - - return $response->parse(); - } - - /** - * @api - * - * Forwards a PUT request to the worker runtime without translating request or response shapes. - * - * @param RequestOpts|null $requestOptions - * - * @throws APIException - */ - public function proxyPut( - string $workerPath, - string $id, - RequestOptions|array|null $requestOptions = null, - ): mixed { - $params = Util::removeNulls(['id' => $id]); - - // @phpstan-ignore-next-line argument.type - $response = $this->raw->proxyPut($workerPath, params: $params, requestOptions: $requestOptions); - - return $response->parse(); - } -} diff --git a/src/Services/WorkerService.php b/src/Services/WorkerService.php deleted file mode 100644 index 615421a7..00000000 --- a/src/Services/WorkerService.php +++ /dev/null @@ -1,31 +0,0 @@ -raw = new WorkerRawService($client); - $this->v1 = new V1Service($client); - } -} diff --git a/src/Version.php b/src/Version.php index 924b2c67..c516e17f 100644 --- a/src/Version.php +++ b/src/Version.php @@ -5,5 +5,5 @@ namespace CaseDev; // x-release-please-start-version -const VERSION = '0.50.0'; +const VERSION = '0.51.0'; // x-release-please-end diff --git a/src/Worker/V1/V1ProxyDeleteParams.php b/src/Worker/V1/V1ProxyDeleteParams.php deleted file mode 100644 index 42e93b6c..00000000 --- a/src/Worker/V1/V1ProxyDeleteParams.php +++ /dev/null @@ -1,68 +0,0 @@ - */ - use SdkModel; - use SdkParams; - - #[Required] - public string $id; - - /** - * `new V1ProxyDeleteParams()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * V1ProxyDeleteParams::with(id: ...) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new V1ProxyDeleteParams)->withID(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with(string $id): self - { - $self = new self; - - $self['id'] = $id; - - return $self; - } - - public function withID(string $id): self - { - $self = clone $this; - $self['id'] = $id; - - return $self; - } -} diff --git a/src/Worker/V1/V1ProxyGetParams.php b/src/Worker/V1/V1ProxyGetParams.php deleted file mode 100644 index 725178d2..00000000 --- a/src/Worker/V1/V1ProxyGetParams.php +++ /dev/null @@ -1,68 +0,0 @@ - */ - use SdkModel; - use SdkParams; - - #[Required] - public string $id; - - /** - * `new V1ProxyGetParams()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * V1ProxyGetParams::with(id: ...) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new V1ProxyGetParams)->withID(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with(string $id): self - { - $self = new self; - - $self['id'] = $id; - - return $self; - } - - public function withID(string $id): self - { - $self = clone $this; - $self['id'] = $id; - - return $self; - } -} diff --git a/src/Worker/V1/V1ProxyPatchParams.php b/src/Worker/V1/V1ProxyPatchParams.php deleted file mode 100644 index 9e93ddfb..00000000 --- a/src/Worker/V1/V1ProxyPatchParams.php +++ /dev/null @@ -1,68 +0,0 @@ - */ - use SdkModel; - use SdkParams; - - #[Required] - public string $id; - - /** - * `new V1ProxyPatchParams()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * V1ProxyPatchParams::with(id: ...) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new V1ProxyPatchParams)->withID(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with(string $id): self - { - $self = new self; - - $self['id'] = $id; - - return $self; - } - - public function withID(string $id): self - { - $self = clone $this; - $self['id'] = $id; - - return $self; - } -} diff --git a/src/Worker/V1/V1ProxyPostParams.php b/src/Worker/V1/V1ProxyPostParams.php deleted file mode 100644 index 2f818450..00000000 --- a/src/Worker/V1/V1ProxyPostParams.php +++ /dev/null @@ -1,68 +0,0 @@ - */ - use SdkModel; - use SdkParams; - - #[Required] - public string $id; - - /** - * `new V1ProxyPostParams()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * V1ProxyPostParams::with(id: ...) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new V1ProxyPostParams)->withID(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with(string $id): self - { - $self = new self; - - $self['id'] = $id; - - return $self; - } - - public function withID(string $id): self - { - $self = clone $this; - $self['id'] = $id; - - return $self; - } -} diff --git a/src/Worker/V1/V1ProxyPutParams.php b/src/Worker/V1/V1ProxyPutParams.php deleted file mode 100644 index f6c9ba3a..00000000 --- a/src/Worker/V1/V1ProxyPutParams.php +++ /dev/null @@ -1,68 +0,0 @@ - */ - use SdkModel; - use SdkParams; - - #[Required] - public string $id; - - /** - * `new V1ProxyPutParams()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * V1ProxyPutParams::with(id: ...) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new V1ProxyPutParams)->withID(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with(string $id): self - { - $self = new self; - - $self['id'] = $id; - - return $self; - } - - public function withID(string $id): self - { - $self = clone $this; - $self['id'] = $id; - - return $self; - } -} diff --git a/tests/Services/Agent/Skills/NamespacesTest.php b/tests/Services/Agent/Skills/NamespacesTest.php new file mode 100644 index 00000000..7f2095c6 --- /dev/null +++ b/tests/Services/Agent/Skills/NamespacesTest.php @@ -0,0 +1,129 @@ +client = $client; + } + + #[Test] + public function testCreate(): void + { + $result = $this->client->agent->skills->namespaces->create( + namespaceID: 'namespaceId' + ); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNull($result); + } + + #[Test] + public function testCreateWithOptionalParams(): void + { + $result = $this->client->agent->skills->namespaces->create( + namespaceID: 'namespaceId', + description: 'description', + label: 'label', + metadata: (object) [], + ); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNull($result); + } + + #[Test] + public function testRetrieve(): void + { + $result = $this->client->agent->skills->namespaces->retrieve('id'); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNull($result); + } + + #[Test] + public function testList(): void + { + $result = $this->client->agent->skills->namespaces->list(); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNull($result); + } + + #[Test] + public function testDelete(): void + { + $result = $this->client->agent->skills->namespaces->delete('id'); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNull($result); + } + + #[Test] + public function testPublish(): void + { + $result = $this->client->agent->skills->namespaces->publish( + 'id', + files: [['content' => 'content', 'encoding' => 'utf8', 'path' => 'path']], + ); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNull($result); + } + + #[Test] + public function testPublishWithOptionalParams(): void + { + $result = $this->client->agent->skills->namespaces->publish( + 'id', + files: [ + [ + 'content' => 'content', + 'encoding' => 'utf8', + 'path' => 'path', + 'contentType' => 'contentType', + ], + ], + ); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNull($result); + } + + #[Test] + public function testPull(): void + { + $result = $this->client->agent->skills->namespaces->pull('id'); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNull($result); + } + + #[Test] + public function testRotateToken(): void + { + $result = $this->client->agent->skills->namespaces->rotateToken('id'); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNull($result); + } +} diff --git a/tests/Services/Compute/V1/InstancesTest.php b/tests/Services/Compute/V1/InstancesTest.php index 84f10114..db48287f 100644 --- a/tests/Services/Compute/V1/InstancesTest.php +++ b/tests/Services/Compute/V1/InstancesTest.php @@ -50,7 +50,6 @@ public function testCreateWithOptionalParams(): void instanceType: 'gpu_1x_a10', name: 'ocr-batch-job', region: 'us-west-1', - autoShutdownMinutes: 120, vaultIDs: ['vault_abc123'], ); diff --git a/tests/Services/Worker/V1Test.php b/tests/Services/Worker/V1Test.php deleted file mode 100644 index e52e3e79..00000000 --- a/tests/Services/Worker/V1Test.php +++ /dev/null @@ -1,154 +0,0 @@ -client = $client; - } - - #[Test] - public function testCreate(): void - { - $result = $this->client->worker->v1->create(); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertNull($result); - } - - #[Test] - public function testRetrieve(): void - { - $result = $this->client->worker->v1->retrieve('id'); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertNull($result); - } - - #[Test] - public function testDelete(): void - { - $result = $this->client->worker->v1->delete('id'); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertNull($result); - } - - #[Test] - public function testBoot(): void - { - $result = $this->client->worker->v1->boot('id'); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertNull($result); - } - - #[Test] - public function testProxyDelete(): void - { - $result = $this->client->worker->v1->proxyDelete('workerPath', id: 'id'); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertNull($result); - } - - #[Test] - public function testProxyDeleteWithOptionalParams(): void - { - $result = $this->client->worker->v1->proxyDelete('workerPath', id: 'id'); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertNull($result); - } - - #[Test] - public function testProxyGet(): void - { - $result = $this->client->worker->v1->proxyGet('workerPath', id: 'id'); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertNull($result); - } - - #[Test] - public function testProxyGetWithOptionalParams(): void - { - $result = $this->client->worker->v1->proxyGet('workerPath', id: 'id'); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertNull($result); - } - - #[Test] - public function testProxyPatch(): void - { - $result = $this->client->worker->v1->proxyPatch('workerPath', id: 'id'); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertNull($result); - } - - #[Test] - public function testProxyPatchWithOptionalParams(): void - { - $result = $this->client->worker->v1->proxyPatch('workerPath', id: 'id'); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertNull($result); - } - - #[Test] - public function testProxyPost(): void - { - $result = $this->client->worker->v1->proxyPost('workerPath', id: 'id'); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertNull($result); - } - - #[Test] - public function testProxyPostWithOptionalParams(): void - { - $result = $this->client->worker->v1->proxyPost('workerPath', id: 'id'); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertNull($result); - } - - #[Test] - public function testProxyPut(): void - { - $result = $this->client->worker->v1->proxyPut('workerPath', id: 'id'); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertNull($result); - } - - #[Test] - public function testProxyPutWithOptionalParams(): void - { - $result = $this->client->worker->v1->proxyPut('workerPath', id: 'id'); - - // @phpstan-ignore-next-line method.alreadyNarrowedType - $this->assertNull($result); - } -}