All contracts

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 pathSchemaProducer
.workspai/workspace.contract.json1
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 pathTypeRequiredMeaningConstraints
generatedAtstringYesDefines the generatedat value at this contract boundary.format: date-time
kindstringYesDefines the kind value at this contract boundary.const: "rapidkit.workspace.contract"
projectsarrayYesDefines the projects value at this contract boundary.
projects[].contractsobjectYesDefines the contracts value at this contract boundary.additionalProperties: false
projects[].contracts.apisarrayYesDefines the apis value at this contract boundary.
projects[].contracts.apis[].basePathstringYesDefines the basepath value at this contract boundary.pattern: ^/
projects[].contracts.apis[].namestringYesDefines the name value at this contract boundary.minLength: 1
projects[].contracts.consumesarrayYesDefines the consumes value at this contract boundary.
projects[].contracts.dependsOnarrayYesDefines the dependson value at this contract boundary.
projects[].contracts.envarrayYesDefines the env value at this contract boundary.
projects[].contracts.ownsarrayYesDefines the owns value at this contract boundary.
projects[].contracts.publishesarrayYesDefines the publishes value at this contract boundary.
projects[].externalPathstringNoDefines the externalpath value at this contract boundary.minLength: 1
projects[].frameworkstringNoDefines the framework value at this contract boundary.minLength: 1
projects[].kitstringNoDefines the kit value at this contract boundary.minLength: 1
projects[].modulesarrayYesDefines the modules value at this contract boundary.
projects[].portsarrayYesDefines the ports value at this contract boundary.
projects[].ports[].namestringYesDefines the name value at this contract boundary.minLength: 1
projects[].ports[].portintegerYesDefines the port value at this contract boundary.minimum: 1 · maximum: 65535
projects[].ports[].protocolenumYesDefines the protocol value at this contract boundary.enum: http, https, grpc, tcp, udp
projects[].relationshipenumNoDefines the relationship value at this contract boundary.enum: imported, adopted
projects[].relativePathstringYesDefines the relativepath value at this contract boundary.minLength: 1
projects[].runtimestringNoDefines the runtime value at this contract boundary.minLength: 1
projects[].slugstringYesDefines the slug value at this contract boundary.minLength: 1
projects[].sourceenumNoDefines the source value at this contract boundary.enum: workspace, local-folder, git-url, adopted-local
schemaVersionnumberYesDefines the schemaversion value at this contract boundary.const: 1
workspaceobjectYesDefines the workspace value at this contract boundary.additionalProperties: false
workspace.namestringYesDefines the name value at this contract boundary.minLength: 1
workspace.profilestringNoDefines 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
}