Workspace operations / JSON Schema
Workspai Workspace Contract
Defines the versioned workspace contract v1 boundary used by Workspai and its consumers.
- Schema version
https://getrapidkit.com/schemas/workspace-contract.v1.json- Contract path
contracts/workspace-contract.v1.json- Publication
- json-schema
- Defined fields
- 29
- Artifact bindings
- 1
Why this contract exists
Architecture role
Defines a versioned interoperability boundary used by Workspai and contract-aware consumers.
Consumption boundary
- • Workspai CLI
- • Workspace Intelligence consumers
- • IDEs and agents
Related commands
Commands are linked only when the runtime contract identifies a direct production relationship. Supporting contracts may be consumed without having a single producer command.
Produced artifacts
These durable files are emitted by registered commands and validated against this contract.
| Artifact path | Schema | Producer |
|---|---|---|
| .workspai/workspace.contract.json | 1 | workspai workspace sync workspai workspace contract sync |
Field reference
Every declared schema property or published capability path is listed here. Required means the contract declares or publishes that field at the shown boundary.
| Field path | Type | Required | Meaning | Constraints |
|---|---|---|---|---|
| generatedAt | string | Yes | Defines the generatedat value at this contract boundary. | format: date-time |
| kind | string | Yes | Defines the kind value at this contract boundary. | const: "rapidkit.workspace.contract" |
| projects | array | Yes | Defines the projects value at this contract boundary. | — |
| projects[].contracts | object | Yes | Defines the contracts value at this contract boundary. | additionalProperties: false |
| projects[].contracts.apis | array | Yes | Defines the apis value at this contract boundary. | — |
| projects[].contracts.apis[].basePath | string | Yes | Defines the basepath value at this contract boundary. | pattern: ^/ |
| projects[].contracts.apis[].name | string | Yes | Defines the name value at this contract boundary. | minLength: 1 |
| projects[].contracts.consumes | array | Yes | Defines the consumes value at this contract boundary. | — |
| projects[].contracts.dependsOn | array | Yes | Defines the dependson value at this contract boundary. | — |
| projects[].contracts.env | array | Yes | Defines the env value at this contract boundary. | — |
| projects[].contracts.owns | array | Yes | Defines the owns value at this contract boundary. | — |
| projects[].contracts.publishes | array | Yes | Defines the publishes value at this contract boundary. | — |
| projects[].externalPath | string | No | Defines the externalpath value at this contract boundary. | minLength: 1 |
| projects[].framework | string | No | Defines the framework value at this contract boundary. | minLength: 1 |
| projects[].kit | string | No | Defines the kit value at this contract boundary. | minLength: 1 |
| projects[].modules | array | Yes | Defines the modules value at this contract boundary. | — |
| projects[].ports | array | Yes | Defines the ports value at this contract boundary. | — |
| projects[].ports[].name | string | Yes | Defines the name value at this contract boundary. | minLength: 1 |
| projects[].ports[].port | integer | Yes | Defines the port value at this contract boundary. | minimum: 1 · maximum: 65535 |
| projects[].ports[].protocol | enum | Yes | Defines the protocol value at this contract boundary. | enum: http, https, grpc, tcp, udp |
| projects[].relationship | enum | No | Defines the relationship value at this contract boundary. | enum: imported, adopted |
| projects[].relativePath | string | Yes | Defines the relativepath value at this contract boundary. | minLength: 1 |
| projects[].runtime | string | No | Defines the runtime value at this contract boundary. | minLength: 1 |
| projects[].slug | string | Yes | Defines the slug value at this contract boundary. | minLength: 1 |
| projects[].source | enum | No | Defines the source value at this contract boundary. | enum: workspace, local-folder, git-url, adopted-local |
| schemaVersion | number | Yes | Defines the schemaversion value at this contract boundary. | const: 1 |
| workspace | object | Yes | Defines the workspace value at this contract boundary. | additionalProperties: false |
| workspace.name | string | Yes | Defines the name value at this contract boundary. | minLength: 1 |
| workspace.profile | string | No | Defines the profile value at this contract boundary. | minLength: 1 |
Canonical machine-readable definition
The raw synchronized contract remains authoritative. The educational sections above are projections of this definition.
Show raw JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://getrapidkit.com/schemas/workspace-contract.v1.json",
"title": "Workspai Workspace Contract",
"type": "object",
"required": [
"schemaVersion",
"kind",
"generatedAt",
"workspace",
"projects"
],
"properties": {
"schemaVersion": {
"const": 1
},
"kind": {
"const": "rapidkit.workspace.contract"
},
"generatedAt": {
"type": "string",
"format": "date-time"
},
"workspace": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"profile": {
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
},
"projects": {
"type": "array",
"items": {
"type": "object",
"required": [
"slug",
"relativePath",
"modules",
"ports",
"contracts"
],
"properties": {
"slug": {
"type": "string",
"minLength": 1
},
"relativePath": {
"type": "string",
"minLength": 1
},
"source": {
"enum": [
"workspace",
"local-folder",
"git-url",
"adopted-local"
]
},
"relationship": {
"enum": [
"imported",
"adopted"
]
},
"externalPath": {
"type": "string",
"minLength": 1
},
"runtime": {
"type": "string",
"minLength": 1
},
"framework": {
"type": "string",
"minLength": 1
},
"kit": {
"type": "string",
"minLength": 1
},
"modules": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"uniqueItems": true
},
"ports": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"port",
"protocol"
],
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"port": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"protocol": {
"enum": [
"http",
"https",
"grpc",
"tcp",
"udp"
]
}
},
"additionalProperties": false
}
},
"contracts": {
"type": "object",
"required": [
"owns",
"apis",
"publishes",
"consumes",
"dependsOn",
"env"
],
"properties": {
"owns": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"uniqueItems": true
},
"apis": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"basePath"
],
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"basePath": {
"type": "string",
"pattern": "^/"
}
},
"additionalProperties": false
}
},
"publishes": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"uniqueItems": true
},
"consumes": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"uniqueItems": true
},
"dependsOn": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"uniqueItems": true
},
"env": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[A-Z_][A-Z0-9_]*$"
},
"uniqueItems": true
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}