Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/generate-sdks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
SPEC_INPUT="${1:-sdk/openapi.json}"
SPEC="$(python3 "$ROOT/scripts/resolve_repo_path.py" "$ROOT" "$SPEC_INPUT")"
cd "$ROOT"
VERSION="${SDK_VERSION:-0.0.3}"
VERSION="${SDK_VERSION:-0.1.0}"
GIT_HOST="github.com"
GIT_USER="tokencanopy"
GIT_REPO="agentdrive-sdk"
Expand Down
19 changes: 15 additions & 4 deletions scripts/import_agentdrive_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,34 @@
"url": "https://drive.tokencanopy.com",
"description": "AgentDrive canonical production API",
}
SOURCE_REPOSITORY = "https://github.com/tokencanopy/agentdrive"
SOURCE_PATH = "tests/openapi.golden.json"
# AgentDrive's source moved into the tokencanopy monorepo in the 2026-08-29
# port; the contract it publishes moved with it. The old coordinates named a
# repository that no longer hosts the file, so every provenance record
# written after the port pointed at nothing.
SOURCE_REPOSITORY = "https://github.com/tokencanopy/tokencanopy"
SOURCE_PATH = "apps/drive/tests/openapi.golden.json"
GENERATOR_IMAGE = (
Path(__file__).resolve().parents[1] / "sdk/openapi-generator-image.txt"
).read_text(encoding="utf-8").strip()
HTTP_METHODS = frozenset(
{"get", "put", "post", "delete", "patch", "head", "options", "trace"}
)
SUPPORTED_POLICY_VERSION = 2


class ContractImportError(ValueError):
pass


def _validate(document: Dict[str, Any]) -> None:
if document.get("x-agentdrive-compatibility-policy") != 1:
raise ContractImportError("source contract lacks compatibility policy version 1")
# Pinned to the policy the importer understands, not to a floor: a bump
# is AgentDrive changing the rules its contract is judged by, which is a
# decision to read before the SDK carries the contract downstream.
if document.get("x-agentdrive-compatibility-policy") != SUPPORTED_POLICY_VERSION:
raise ContractImportError(
"source contract is not compatibility policy version "
f"{SUPPORTED_POLICY_VERSION}"
)
if document.get("servers") != ["<DEPLOYMENT-DERIVED>"]:
raise ContractImportError("source contract lacks the deployment-derived server sentinel")

Expand Down
5 changes: 4 additions & 1 deletion sdk/go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ AgentDrive is an agent-focused artifact store: drive-scoped folders, artifacts,
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.

- API version: &lt;PINNED&gt;
- Package version: 0.0.3
- Package version: 0.1.0
- Generator version: 7.16.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen

Expand Down Expand Up @@ -170,6 +170,7 @@ Class | Method | HTTP request | Description
- [DriveUpdateIn](docs/DriveUpdateIn.md)
- [DriveUsageOut](docs/DriveUsageOut.md)
- [EditabilityOut](docs/EditabilityOut.md)
- [EffectiveLimitsOut](docs/EffectiveLimitsOut.md)
- [EntriesInner](docs/EntriesInner.md)
- [EntryListOut](docs/EntryListOut.md)
- [ErrorResponse](docs/ErrorResponse.md)
Expand Down Expand Up @@ -219,6 +220,8 @@ Class | Method | HTTP request | Description
- [UploadsCreateRequestTarget](docs/UploadsCreateRequestTarget.md)
- [UploadsCreateRequestTargetOneOf](docs/UploadsCreateRequestTargetOneOf.md)
- [UploadsCreateRequestTargetOneOf1](docs/UploadsCreateRequestTargetOneOf1.md)
- [UsageMeterOut](docs/UsageMeterOut.md)
- [UsageMetersOut](docs/UsageMetersOut.md)
- [V0ErrorEnvelope](docs/V0ErrorEnvelope.md)
- [ValidationErrorResponse](docs/ValidationErrorResponse.md)
- [ValidationErrorResponseError](docs/ValidationErrorResponseError.md)
Expand Down
Loading
Loading