Hadron capability tool for Google Drive — the platform's ingestion + export bridge to a user's Drive: list/search files, export Google Docs (and Sheets / Slides / text files) as text for "import my GDocs", and create a new Google Doc from markdown ("save this Hadron node as a GDoc").
Part of the hadrontool-* family (hadron-server#396 pattern): this tool owns
the Google provider relationship — the OAuth client secret, the encrypted
refresh tokens, the Drive API calls — behind a provider-neutral HTTP surface.
hadron-server stays the front door: it authorizes every request before
calling this service and stores only the connection identity. The tool is
Hadron-blind (spec cor:int:030:01): no platform data, no platform API access.
- Archetype: stateful, internal-only (the
hadrontool-google-caltemplate). Own Postgres DB (connections + idempotency ledger); no public routes; no event plane in v1 (seedocs/architecture.mdfor the Changes-API v2 sketch). - Scopes:
drive.readonly(read all files — restricted scope, CASA verification tier) +drive.file(write only to files this app created — which enforces the "create new docs, never edit existing" product boundary at the API level) +openid email profile.
| op | what |
|---|---|
list-files |
Children of a folder (default root), folders first |
search-files |
Structured search (fullText, name, MIME, modifiedAfter, folder) |
get-file |
File metadata |
export-file |
Google-native → markdown/text/html (Docs export natively to markdown); text files verbatim; byte-capped with a typed file_too_large |
download-file |
Non-native raw bytes, base64, byte-capped |
create-doc |
Markdown → new Google Doc (multipart upload with conversion); idempotency-keyed |
The operation names are the platform's provider-neutral drive contract — a
future ms-drive sibling (OneDrive/SharePoint via Microsoft Graph) implements
the same names byte-for-byte.
npm install
npm run typecheck
createdb hadrontool_google_drive_test # once
npm run db:test-setup # push schema to the test DB
npm testCopy .env.example to .env for a local run (npm run dev).
Komodo build → GHCR → internal-only deployment on komodo_default (no ports,
no Traefik) with --add-host=host.docker.internal:host-gateway for the
bare-metal Postgres. Secrets live in the hadrontool-google-drive Doppler
project. See the platform deploy runbook
(hadronmemory.com::dev::ops:alpha:deploy-capability-tool).