@kody/dropbox
Reusable Dropbox OAuth helpers for account, metadata, search, file transfer, sharing, and generic API requests.
AGENTS.md
111 lines · 3.1 KB · Markdown@kody/dropbox — agent notes
Human setup and intent live in README.md. This file is for
agents: imports, smoke/dryRun execute snippets, and edge cases. Auth is the
saved OAuth integration named dropbox — never paste tokens. Do not disable
live webhooks or jobs.
Auth / integration
| Item | Value |
|---|---|
| Integration name | dropbox |
| Reconnect | https://kody.codes/connect/oauth?provider=dropbox |
Import paths
| Export | Import |
|---|---|
| overview | kody:@kody/dropbox |
| smoke-test | kody:@kody/dropbox/smoke-test |
| get-current-account | kody:@kody/dropbox/get-current-account |
| get-space-usage | kody:@kody/dropbox/get-space-usage |
| list-folder | kody:@kody/dropbox/list-folder |
| get-metadata | kody:@kody/dropbox/get-metadata |
| search | kody:@kody/dropbox/search |
| download | kody:@kody/dropbox/download |
| upload | kody:@kody/dropbox/upload |
| delete | kody:@kody/dropbox/delete |
| create-shared-link | kody:@kody/dropbox/create-shared-link |
| request | kody:@kody/dropbox/request |
Prefer static kody:@kody/dropbox/... imports from execute. Do not lead with
packages.invoke.
Smoke test (read-only)
import smokeTest from 'kody:@kody/dropbox/smoke-test'
export default async function main() {
return await smokeTest()
// => { ok: true, hasAccountId, hasDisplayName, accountType } — no PII fields
}Optional read-only follow-ups: listFolder({ path: '', limit: 100 }),
getSpaceUsage(), or getMetadata({ path: '/notes/todo.txt' }).
dryRun / confirm (writes)
upload, delete, create-shared-link, and unknown/mutating ./request
endpoints require confirm: true after explicit user approval. Use
dryRun: true to preview without calling Dropbox. Documented read-only
./request endpoints do not need confirmation.
import upload from 'kody:@kody/dropbox/upload'
export default async function main() {
return await upload({
path: '/notes/hello.txt',
text: 'Hello from Kody',
mode: 'overwrite',
dryRun: true,
})
}import deleteDropboxPath from 'kody:@kody/dropbox/delete'
export default async function main() {
return await deleteDropboxPath({
path: '/notes/old.txt',
dryRun: true,
})
}List root (read-only):
import listFolder from 'kody:@kody/dropbox/list-folder'
export default async function main() {
return await listFolder({ path: '', limit: 100 })
}Generic request (known read-only endpoint — no confirm):
import request from 'kody:@kody/dropbox/request'
export default async function main() {
return await request({
endpoint: 'files/get_metadata',
body: { path: '/notes/todo.txt' },
})
}Edge cases
- Paths start with
/; use''for the account root on list/search. downloadreturns{ metadata, bytesBase64, byteLength, contentType }.upload: pass exactly one oftextorbytesBase64;modeisadd(default) oroverwrite.list-folder/search: continue with returnedcursorwhilehas_more.- Prefer dedicated helpers over assembling
./requestwhen one exists. - Never paste Dropbox OAuth tokens into chat or logs.