@opensoha/contracts 0.1.11 → 0.1.13

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.
Files changed (22) hide show
  1. package/compat/json-schema-ecosystem-0.1.0.json +1 -1
  2. package/compat/openapi-loose-boundaries-0.1.0.json +1 -1
  3. package/fixtures/openapi/DockerHostAgentCredentialsEnvelope/invalid/missing-runtime-token.json +9 -0
  4. package/fixtures/openapi/DockerHostAgentCredentialsEnvelope/valid/credentials.json +10 -0
  5. package/fixtures/openapi/DockerHostAgentEnrollmentRequest/invalid/short-token.json +4 -0
  6. package/fixtures/openapi/DockerHostAgentEnrollmentRequest/valid/enrollment.json +4 -0
  7. package/fixtures/openapi/KubernetesWorkloadSnapshotEnvelope/invalid/missing-content.json +8 -0
  8. package/fixtures/openapi/KubernetesWorkloadSnapshotEnvelope/valid/job.json +14 -0
  9. package/fixtures/openapi/KubernetesWorkloadSnapshotRequest/invalid/cronjob-missing-schedule.json +8 -0
  10. package/fixtures/openapi/KubernetesWorkloadSnapshotRequest/invalid/workload-cronjob-missing-schedule.json +8 -0
  11. package/fixtures/openapi/KubernetesWorkloadSnapshotRequest/valid/cronjob.json +9 -0
  12. package/fixtures/openapi/KubernetesWorkloadSnapshotRequest/valid/job-zero-values.json +11 -0
  13. package/fixtures/openapi/KubernetesWorkloadSnapshotRequest/valid/workload-cronjob.json +9 -0
  14. package/gen/go/sohaapi/client.go +10 -1
  15. package/gen/go/sohaapi/client_test.go +29 -0
  16. package/gen/go/sohaapi/types.go +156 -0
  17. package/gen/go/sohaapi/types_test.go +17 -0
  18. package/gen/ts/sohaapi/index.ts +182 -0
  19. package/openapi/soha-api.json +413 -2
  20. package/openapi/soha-api.yaml +245 -2
  21. package/openapi/spec_generated.go +3 -3
  22. package/package.json +1 -1
@@ -10063,6 +10063,85 @@
10063
10063
  ],
10064
10064
  "type": "object"
10065
10065
  },
10066
+ "DockerHostAgentCredentials": {
10067
+ "additionalProperties": false,
10068
+ "properties": {
10069
+ "agentBearerToken": {
10070
+ "description": "Credential for the Agent's local HTTP API, returned only by the successful enrollment response.",
10071
+ "format": "password",
10072
+ "maxLength": 512,
10073
+ "minLength": 32,
10074
+ "type": "string"
10075
+ },
10076
+ "agentId": {
10077
+ "maxLength": 200,
10078
+ "minLength": 1,
10079
+ "type": "string"
10080
+ },
10081
+ "hostId": {
10082
+ "minLength": 1,
10083
+ "type": "string"
10084
+ },
10085
+ "issuedAt": {
10086
+ "format": "date-time",
10087
+ "type": "string"
10088
+ },
10089
+ "operationId": {
10090
+ "minLength": 1,
10091
+ "type": "string"
10092
+ },
10093
+ "runtimeBearerToken": {
10094
+ "description": "Revocable credential restricted to Docker operations for this host.",
10095
+ "format": "password",
10096
+ "maxLength": 512,
10097
+ "minLength": 32,
10098
+ "type": "string"
10099
+ }
10100
+ },
10101
+ "required": [
10102
+ "hostId",
10103
+ "operationId",
10104
+ "agentId",
10105
+ "agentBearerToken",
10106
+ "runtimeBearerToken",
10107
+ "issuedAt"
10108
+ ],
10109
+ "type": "object"
10110
+ },
10111
+ "DockerHostAgentCredentialsEnvelope": {
10112
+ "additionalProperties": false,
10113
+ "properties": {
10114
+ "data": {
10115
+ "$ref": "#/components/schemas/DockerHostAgentCredentials"
10116
+ }
10117
+ },
10118
+ "required": [
10119
+ "data"
10120
+ ],
10121
+ "type": "object"
10122
+ },
10123
+ "DockerHostAgentEnrollmentRequest": {
10124
+ "additionalProperties": false,
10125
+ "properties": {
10126
+ "agentId": {
10127
+ "maxLength": 200,
10128
+ "minLength": 1,
10129
+ "type": "string"
10130
+ },
10131
+ "enrollmentToken": {
10132
+ "description": "Short-lived one-time secret delivered only inside the installer.",
10133
+ "format": "password",
10134
+ "maxLength": 512,
10135
+ "minLength": 32,
10136
+ "type": "string"
10137
+ }
10138
+ },
10139
+ "required": [
10140
+ "agentId",
10141
+ "enrollmentToken"
10142
+ ],
10143
+ "type": "object"
10144
+ },
10066
10145
  "DockerHostAgentInstallation": {
10067
10146
  "additionalProperties": false,
10068
10147
  "properties": {
@@ -23978,6 +24057,232 @@
23978
24057
  ],
23979
24058
  "type": "object"
23980
24059
  },
24060
+ "KubernetesWorkloadSnapshot": {
24061
+ "additionalProperties": false,
24062
+ "properties": {
24063
+ "containers": {
24064
+ "items": {
24065
+ "$ref": "#/components/schemas/KubernetesWorkloadSnapshotContainer"
24066
+ },
24067
+ "minItems": 1,
24068
+ "type": "array"
24069
+ },
24070
+ "content": {
24071
+ "description": "Generated native batch/v1 Job or CronJob YAML, or workloads.soha.io/v1alpha1 WorkloadCronJob YAML whose selected container image follows the source workload, ready for the existing resource-creation preflight.",
24072
+ "maxLength": 1048576,
24073
+ "minLength": 1,
24074
+ "type": "string"
24075
+ },
24076
+ "selectedContainer": {
24077
+ "minLength": 1,
24078
+ "type": "string"
24079
+ },
24080
+ "sourceUid": {
24081
+ "minLength": 1,
24082
+ "type": "string"
24083
+ },
24084
+ "warnings": {
24085
+ "items": {
24086
+ "type": "string"
24087
+ },
24088
+ "type": "array"
24089
+ }
24090
+ },
24091
+ "required": [
24092
+ "content",
24093
+ "sourceUid",
24094
+ "selectedContainer",
24095
+ "containers",
24096
+ "warnings"
24097
+ ],
24098
+ "type": "object"
24099
+ },
24100
+ "KubernetesWorkloadSnapshotContainer": {
24101
+ "additionalProperties": false,
24102
+ "properties": {
24103
+ "image": {
24104
+ "type": "string"
24105
+ },
24106
+ "name": {
24107
+ "minLength": 1,
24108
+ "type": "string"
24109
+ }
24110
+ },
24111
+ "required": [
24112
+ "name",
24113
+ "image"
24114
+ ],
24115
+ "type": "object"
24116
+ },
24117
+ "KubernetesWorkloadSnapshotEnvelope": {
24118
+ "additionalProperties": false,
24119
+ "properties": {
24120
+ "data": {
24121
+ "$ref": "#/components/schemas/KubernetesWorkloadSnapshot"
24122
+ }
24123
+ },
24124
+ "required": [
24125
+ "data"
24126
+ ],
24127
+ "type": "object"
24128
+ },
24129
+ "KubernetesWorkloadSnapshotRequest": {
24130
+ "additionalProperties": false,
24131
+ "if": {
24132
+ "properties": {
24133
+ "targetKind": {
24134
+ "enum": [
24135
+ "CronJob",
24136
+ "WorkloadCronJob"
24137
+ ]
24138
+ }
24139
+ },
24140
+ "required": [
24141
+ "targetKind"
24142
+ ]
24143
+ },
24144
+ "properties": {
24145
+ "activeDeadlineSeconds": {
24146
+ "description": "Zero leaves the Kubernetes default unchanged.",
24147
+ "minimum": 0,
24148
+ "type": "integer"
24149
+ },
24150
+ "annotations": {
24151
+ "additionalProperties": {
24152
+ "type": "string"
24153
+ },
24154
+ "maxProperties": 64,
24155
+ "type": "object"
24156
+ },
24157
+ "args": {
24158
+ "items": {
24159
+ "maxLength": 4096,
24160
+ "type": "string"
24161
+ },
24162
+ "maxItems": 128,
24163
+ "type": "array"
24164
+ },
24165
+ "backoffLimit": {
24166
+ "minimum": 0,
24167
+ "type": "integer"
24168
+ },
24169
+ "command": {
24170
+ "items": {
24171
+ "maxLength": 4096,
24172
+ "type": "string"
24173
+ },
24174
+ "maxItems": 128,
24175
+ "type": "array"
24176
+ },
24177
+ "completions": {
24178
+ "description": "Zero leaves the Kubernetes default unchanged.",
24179
+ "minimum": 0,
24180
+ "type": "integer"
24181
+ },
24182
+ "description": {
24183
+ "maxLength": 512,
24184
+ "type": "string"
24185
+ },
24186
+ "labels": {
24187
+ "additionalProperties": {
24188
+ "type": "string"
24189
+ },
24190
+ "maxProperties": 64,
24191
+ "type": "object"
24192
+ },
24193
+ "namespace": {
24194
+ "description": "Namespace shared by the source workload and generated target because referenced Secrets, ConfigMaps, ServiceAccounts, and PVCs are namespace-scoped.",
24195
+ "minLength": 1,
24196
+ "type": "string"
24197
+ },
24198
+ "parallelism": {
24199
+ "description": "Zero leaves the Kubernetes default unchanged.",
24200
+ "minimum": 0,
24201
+ "type": "integer"
24202
+ },
24203
+ "restartPolicy": {
24204
+ "$ref": "#/components/schemas/KubernetesWorkloadSnapshotRestartPolicy"
24205
+ },
24206
+ "schedule": {
24207
+ "description": "Required when targetKind is CronJob or WorkloadCronJob.",
24208
+ "minLength": 1,
24209
+ "type": "string"
24210
+ },
24211
+ "sourceContainer": {
24212
+ "description": "Regular container to retain. When omitted, the first regular container is selected.",
24213
+ "minLength": 1,
24214
+ "type": "string"
24215
+ },
24216
+ "sourceKind": {
24217
+ "$ref": "#/components/schemas/KubernetesWorkloadSnapshotSourceKind"
24218
+ },
24219
+ "sourceName": {
24220
+ "minLength": 1,
24221
+ "type": "string"
24222
+ },
24223
+ "suspend": {
24224
+ "type": "boolean"
24225
+ },
24226
+ "targetKind": {
24227
+ "$ref": "#/components/schemas/KubernetesWorkloadSnapshotTargetKind"
24228
+ },
24229
+ "targetName": {
24230
+ "minLength": 1,
24231
+ "type": "string"
24232
+ }
24233
+ },
24234
+ "required": [
24235
+ "namespace",
24236
+ "sourceKind",
24237
+ "sourceName",
24238
+ "targetKind",
24239
+ "targetName",
24240
+ "restartPolicy"
24241
+ ],
24242
+ "then": {
24243
+ "required": [
24244
+ "schedule"
24245
+ ]
24246
+ },
24247
+ "type": "object"
24248
+ },
24249
+ "KubernetesWorkloadSnapshotRestartPolicy": {
24250
+ "enum": [
24251
+ "Never",
24252
+ "OnFailure"
24253
+ ],
24254
+ "type": "string",
24255
+ "x-enum-varnames": [
24256
+ "KubernetesWorkloadSnapshotRestartPolicyNever",
24257
+ "KubernetesWorkloadSnapshotRestartPolicyOnFailure"
24258
+ ]
24259
+ },
24260
+ "KubernetesWorkloadSnapshotSourceKind": {
24261
+ "enum": [
24262
+ "Deployment",
24263
+ "StatefulSet",
24264
+ "DaemonSet"
24265
+ ],
24266
+ "type": "string",
24267
+ "x-enum-varnames": [
24268
+ "KubernetesWorkloadSnapshotSourceKindDeployment",
24269
+ "KubernetesWorkloadSnapshotSourceKindStatefulSet",
24270
+ "KubernetesWorkloadSnapshotSourceKindDaemonSet"
24271
+ ]
24272
+ },
24273
+ "KubernetesWorkloadSnapshotTargetKind": {
24274
+ "enum": [
24275
+ "Job",
24276
+ "CronJob",
24277
+ "WorkloadCronJob"
24278
+ ],
24279
+ "type": "string",
24280
+ "x-enum-varnames": [
24281
+ "KubernetesWorkloadSnapshotTargetKindJob",
24282
+ "KubernetesWorkloadSnapshotTargetKindCronJob",
24283
+ "KubernetesWorkloadSnapshotTargetKindWorkloadCronJob"
24284
+ ]
24285
+ },
23981
24286
  "LLMCallLog": {
23982
24287
  "additionalProperties": false,
23983
24288
  "properties": {
@@ -41073,7 +41378,7 @@
41073
41378
  "type": "http"
41074
41379
  },
41075
41380
  "runtimeBearerAuth": {
41076
- "description": "Runtime execution runner token.",
41381
+ "description": "Runtime execution runner token, including host-bound Docker Agent credentials.",
41077
41382
  "scheme": "bearer",
41078
41383
  "type": "http"
41079
41384
  },
@@ -41088,7 +41393,7 @@
41088
41393
  "info": {
41089
41394
  "description": "Public OpenSoha core API contract. This first contract focuses on stable cross-repository boundaries: auth, health, runner-facing control-plane callbacks, AI Gateway, and MCP capability discovery.\n",
41090
41395
  "title": "Soha API",
41091
- "version": "0.1.11"
41396
+ "version": "0.1.13"
41092
41397
  },
41093
41398
  "openapi": "3.1.0",
41094
41399
  "paths": {
@@ -52636,6 +52941,55 @@
52636
52941
  ]
52637
52942
  }
52638
52943
  },
52944
+ "/clusters/{clusterID}/resource-creation/workload-snapshot": {
52945
+ "post": {
52946
+ "operationId": "generateKubernetesWorkloadSnapshot",
52947
+ "parameters": [
52948
+ {
52949
+ "$ref": "#/components/parameters/ClusterID"
52950
+ }
52951
+ ],
52952
+ "requestBody": {
52953
+ "content": {
52954
+ "application/json": {
52955
+ "schema": {
52956
+ "$ref": "#/components/schemas/KubernetesWorkloadSnapshotRequest"
52957
+ }
52958
+ }
52959
+ },
52960
+ "required": true
52961
+ },
52962
+ "responses": {
52963
+ "200": {
52964
+ "content": {
52965
+ "application/json": {
52966
+ "schema": {
52967
+ "$ref": "#/components/schemas/KubernetesWorkloadSnapshotEnvelope"
52968
+ }
52969
+ }
52970
+ },
52971
+ "description": "A native Job or CronJob manifest, or a workloads.soha.io/v1alpha1 WorkloadCronJob manifest, generated from a same-namespace workload Pod template. This operation does not create resources."
52972
+ },
52973
+ "400": {
52974
+ "$ref": "#/components/responses/Error"
52975
+ },
52976
+ "403": {
52977
+ "$ref": "#/components/responses/Error"
52978
+ },
52979
+ "404": {
52980
+ "$ref": "#/components/responses/Error"
52981
+ }
52982
+ },
52983
+ "tags": [
52984
+ "Platform"
52985
+ ],
52986
+ "x-soha-capability": {
52987
+ "name": "k8s.workloads.snapshot.generate",
52988
+ "requiresApproval": false,
52989
+ "riskLevel": "analyze"
52990
+ }
52991
+ }
52992
+ },
52639
52993
  "/clusters/{clusterID}/storage/persistentvolumeclaims": {
52640
52994
  "get": {
52641
52995
  "operationId": "listKubernetesPersistentVolumeClaims",
@@ -57072,6 +57426,63 @@
57072
57426
  "x-soha-implementation-status": "implemented"
57073
57427
  }
57074
57428
  },
57429
+ "/docker/agent-installations/{operationID}/enroll": {
57430
+ "post": {
57431
+ "operationId": "exchangeDockerHostAgentEnrollment",
57432
+ "parameters": [
57433
+ {
57434
+ "$ref": "#/components/parameters/OperationID"
57435
+ }
57436
+ ],
57437
+ "requestBody": {
57438
+ "content": {
57439
+ "application/json": {
57440
+ "schema": {
57441
+ "$ref": "#/components/schemas/DockerHostAgentEnrollmentRequest"
57442
+ }
57443
+ }
57444
+ },
57445
+ "required": true
57446
+ },
57447
+ "responses": {
57448
+ "201": {
57449
+ "content": {
57450
+ "application/json": {
57451
+ "schema": {
57452
+ "$ref": "#/components/schemas/DockerHostAgentCredentialsEnvelope"
57453
+ }
57454
+ }
57455
+ },
57456
+ "description": "One-time host-bound Agent and control-plane credentials. The enrollment token is atomically consumed by a successful response.",
57457
+ "headers": {
57458
+ "Cache-Control": {
57459
+ "description": "Prevents credential responses from being cached.",
57460
+ "schema": {
57461
+ "const": "no-store",
57462
+ "type": "string"
57463
+ }
57464
+ }
57465
+ }
57466
+ },
57467
+ "400": {
57468
+ "$ref": "#/components/responses/Error"
57469
+ },
57470
+ "404": {
57471
+ "$ref": "#/components/responses/Error"
57472
+ },
57473
+ "409": {
57474
+ "$ref": "#/components/responses/Error"
57475
+ },
57476
+ "410": {
57477
+ "$ref": "#/components/responses/Error"
57478
+ }
57479
+ },
57480
+ "security": [],
57481
+ "tags": [
57482
+ "Runner"
57483
+ ]
57484
+ }
57485
+ },
57075
57486
  "/docker/containers/start": {
57076
57487
  "post": {
57077
57488
  "operationId": "startDockerContainer",