# tokencanopy/agentdrive-sdk architecture

> Architecture diagram of the GitHub repository tokencanopy/agentdrive-sdk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tokencanopy/agentdrive-sdk
- Repository: https://github.com/tokencanopy/agentdrive-sdk

## Overview

This repository provides generated REST SDKs for AgentDrive, an artifact store for AI agents; it contains no server implementation. The main workflow is an application using a language client and resource helpers to make authenticated REST operations, such as managing files and folders, searching, and sharing. Python and TypeScript add ergonomic facades for paths, pagination, and errors; Go exposes generated API clients. Auth-provider code obtains Hub-issued tokens. The README documents the SDKs and API; sampled excerpts show facade wiring and selected calls, but not every operation.

Main entry points: [`sdk/python/agentdrive_sdk/client.py`](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/python/agentdrive_sdk/client.py) (Client and transport), [`sdk/typescript/src/facade/client.ts`](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/typescript/src/facade/client.ts) (Client and transport), [`sdk/python/agentdrive_sdk/resources.py`](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/python/agentdrive_sdk/resources.py) (Resource operations), [`sdk/typescript/src/facade/resources.ts`](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/typescript/src/facade/resources.ts) (Resource operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_py["Python SDK"]
  node_pyclient["Client and transport<br/>[client.py]"]
  node_pyauth["Token providers<br/>[auth.py]"]
  node_pyresources["Resource operations<br/>[resources.py]"]
  node_pypaths["Path safety<br/>[paths.py]"]
  node_pyiteration["Cursor iteration<br/>[iteration.py]"]
  node_pyerrors["Typed errors<br/>[errors.py]"]
end

subgraph group_ts["TypeScript SDK"]
  node_tsclient["Client and transport<br/>[client.ts]"]
  node_tsauth["Token providers<br/>[auth.ts]"]
  node_tsresources["Resource operations<br/>[resources.ts]"]
  node_tspaths["Path safety<br/>[paths.ts]"]
  node_tsiteration["Cursor iteration<br/>[iteration.ts]"]
  node_tserrors["Typed errors<br/>[errors.ts]"]
end

subgraph group_go["Go SDK"]
  node_goartifacts["Artifacts API<br/>[api_artifacts.go]"]
  node_godrives["Drives API<br/>[api_drives.go]"]
  node_gofolders["Folders API<br/>[api_folders.go]"]
  node_gosearch["Search API<br/>[api_search.go]"]
  node_gosheets["Sheets API<br/>[api_sheets.go]"]
  node_goviewer["Viewer sessions API"]
  node_goclient["Generated client<br/>[client.go]"]
end

node_app(("Agent application"))
node_api["AgentDrive REST API"]
node_hub["Hub token service"]

node_app -->|"uses"| node_pyclient
node_app -->|"uses"| node_tsclient
node_app -->|"uses"| node_goclient
node_pyclient -->|"sends REST requests"| node_api
node_tsclient -->|"sends REST requests"| node_api
node_goclient -->|"sends REST requests"| node_api
node_pyresources -->|"invokes operations"| node_pyclient
node_pyclient -->|"creates resources"| node_pyresources
node_pyauth -->|"requests tokens"| node_hub
node_tsclient -->|"creates resources"| node_tsresources
node_tsresources -->|"invokes operations"| node_tsclient
node_tsauth -->|"requests tokens"| node_hub
node_goartifacts -->|"exposes REST operations"| node_api
node_godrives -->|"exposes REST operations"| node_api
node_gofolders -->|"exposes REST operations"| node_api
node_gosearch -->|"exposes REST operations"| node_api
node_gosheets -->|"exposes REST operations"| node_api
node_goviewer -->|"exposes REST operations"| node_api

click node_pyclient "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/python/agentdrive_sdk/client.py"
click node_pyauth "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/python/agentdrive_sdk/auth.py"
click node_pyresources "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/python/agentdrive_sdk/resources.py"
click node_pypaths "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/python/agentdrive_sdk/paths.py"
click node_pyiteration "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/python/agentdrive_sdk/iteration.py"
click node_pyerrors "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/python/agentdrive_sdk/errors.py"
click node_tsclient "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/typescript/src/facade/client.ts"
click node_tsauth "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/typescript/src/facade/auth.ts"
click node_tsresources "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/typescript/src/facade/resources.ts"
click node_tspaths "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/typescript/src/facade/paths.ts"
click node_tsiteration "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/typescript/src/facade/iteration.ts"
click node_tserrors "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/typescript/src/facade/errors.ts"
click node_goartifacts "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/go/api_artifacts.go"
click node_godrives "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/go/api_drives.go"
click node_gofolders "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/go/api_folders.go"
click node_gosearch "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/go/api_search.go"
click node_gosheets "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/go/api_sheets.go"
click node_goviewer "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/go/api_viewer_sessions.go"
click node_goclient "https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/go/client.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pyclient,node_pyauth,node_pyresources,node_pypaths,node_pyiteration,node_pyerrors toneBlue
class node_tsclient,node_tsauth,node_tsresources,node_tspaths,node_tsiteration,node_tserrors toneAmber
class node_goartifacts,node_godrives,node_gofolders,node_gosearch,node_gosheets,node_goviewer,node_goclient,node_api toneMint
class node_app,node_hub toneIndigo
```

## Components

### Python SDK

- [Client and transport](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/python/agentdrive_sdk/client.py): `sdk/python/agentdrive_sdk/client.py`
- [Token providers](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/python/agentdrive_sdk/auth.py): `sdk/python/agentdrive_sdk/auth.py`
- [Resource operations](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/python/agentdrive_sdk/resources.py): `sdk/python/agentdrive_sdk/resources.py`
- [Path safety](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/python/agentdrive_sdk/paths.py): `sdk/python/agentdrive_sdk/paths.py`
- [Cursor iteration](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/python/agentdrive_sdk/iteration.py): `sdk/python/agentdrive_sdk/iteration.py`
- [Typed errors](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/python/agentdrive_sdk/errors.py): `sdk/python/agentdrive_sdk/errors.py`

### TypeScript SDK

- [Client and transport](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/typescript/src/facade/client.ts): `sdk/typescript/src/facade/client.ts`
- [Token providers](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/typescript/src/facade/auth.ts): `sdk/typescript/src/facade/auth.ts`
- [Resource operations](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/typescript/src/facade/resources.ts): `sdk/typescript/src/facade/resources.ts`
- [Path safety](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/typescript/src/facade/paths.ts): `sdk/typescript/src/facade/paths.ts`
- [Cursor iteration](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/typescript/src/facade/iteration.ts): `sdk/typescript/src/facade/iteration.ts`
- [Typed errors](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/typescript/src/facade/errors.ts): `sdk/typescript/src/facade/errors.ts`

### Go SDK

- [Artifacts API](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/go/api_artifacts.go): `sdk/go/api_artifacts.go`
- [Drives API](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/go/api_drives.go): `sdk/go/api_drives.go`
- [Folders API](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/go/api_folders.go): `sdk/go/api_folders.go`
- [Search API](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/go/api_search.go): `sdk/go/api_search.go`
- [Sheets API](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/go/api_sheets.go): `sdk/go/api_sheets.go`
- [Viewer sessions API](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/go/api_viewer_sessions.go): `sdk/go/api_viewer_sessions.go`
- [Generated client](https://github.com/tokencanopy/agentdrive-sdk/blob/main/sdk/go/client.go): `sdk/go/client.go`

### Other components

- **Agent application**
- **AgentDrive REST API**
- **Hub token service**

## Connections

- Agent application → Client and transport: uses (evidence: `README.md`)
- Agent application → Client and transport: uses (evidence: `README.md`)
- Agent application → Generated client: uses (evidence: `README.md`)
- Client and transport → AgentDrive REST API: sends REST requests (evidence: `README.md`)
- Client and transport → AgentDrive REST API: sends REST requests (evidence: `README.md`)
- Generated client → AgentDrive REST API: sends REST requests (evidence: `README.md`)
- Resource operations → Client and transport: invokes operations (evidence: `sdk/python/agentdrive_sdk/resources.py`)
- Client and transport → Resource operations: creates resources (evidence: `sdk/python/agentdrive_sdk/client.py`)
- Token providers → Hub token service: requests tokens (evidence: `sdk/python/agentdrive_sdk/auth.py`)
- Client and transport → Resource operations: creates resources (evidence: `sdk/typescript/src/facade/client.ts`)
- Resource operations → Client and transport: invokes operations (evidence: `sdk/typescript/src/facade/resources.ts`)
- Token providers → Hub token service: requests tokens (evidence: `sdk/typescript/src/facade/auth.ts`)
- Artifacts API → AgentDrive REST API: exposes REST operations (evidence: `README.md`)
- Drives API → AgentDrive REST API: exposes REST operations (evidence: `README.md`)
- Folders API → AgentDrive REST API: exposes REST operations (evidence: `README.md`)
- Search API → AgentDrive REST API: exposes REST operations (evidence: `README.md`)
- Sheets API → AgentDrive REST API: exposes REST operations (evidence: `README.md`)
- Viewer sessions API → AgentDrive REST API: exposes REST operations (evidence: `README.md`)
