← Public packages
@kody/google
Call Gmail, Calendar, Tasks, Drive, Docs, Sheets, People, YouTube, and Analytics through saved Google OAuth.
AGENTS.md
100 lines · 3.4 KB · Markdown@kody/google — 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 OAuth
integrations named google / google-* — never paste tokens. Do not
disable live webhooks or jobs.
Auth / integrations
| Call | Resolves to |
|---|---|
| omit both | google (default) |
account: 'work' | google-work |
integration: 'google-work' | that exact name |
account already google-… | used as-is |
Reconnect: /connect/oauth?provider=google or ...?provider=google-<purpose>.
No user secrets for this package.
Import paths
| Export | Import |
|---|---|
overview + smokeTest | kody:@kody/google |
| smoke-test | kody:@kody/google/smoke-test |
| accounts | kody:@kody/google/accounts |
core (requestGoogle, getUserInfo) | kody:@kody/google/core |
| gmail | kody:@kody/google/gmail |
| calendar | kody:@kody/google/calendar |
| tasks | kody:@kody/google/tasks |
| drive | kody:@kody/google/drive |
| docs | kody:@kody/google/docs |
| sheets | kody:@kody/google/sheets |
| people | kody:@kody/google/people |
| youtube | kody:@kody/google/youtube |
| youtube-analytics | kody:@kody/google/youtube-analytics |
| analytics | kody:@kody/google/analytics |
| types | kody:@kody/google/types |
Prefer static kody:@kody/google/... imports from execute. Do not lead with
packages.invoke.
Smoke test (read-only)
import { smokeTest } from 'kody:@kody/google'
// or: import smokeTest from 'kody:@kody/google/smoke-test'
export default async function main() {
return await smokeTest()
// or: smokeTest({ integration: 'google-work' })
// => { integration: 'google', profile: { email, name, emailVerified } }
}Calendar / inbox smokes (need matching scopes):
import { listCalendars } from 'kody:@kody/google/calendar'
import { listInbox } from 'kody:@kody/google/gmail'
export default async function main() {
const calendars = await listCalendars({ maxResults: 3 })
const inbox = await listInbox({ maxResults: 5 })
return { calendars, inbox }
}dryRun snippets
import { createReplyDraft } from 'kody:@kody/google/gmail'
export default async function main() {
return await createReplyDraft({
replyToMessageId: '19fdd464c417fd87',
body: ['Thanks — I will follow up tomorrow.'],
dryRun: true,
})
}Edge cases / fork notes
- A 403 / insufficient-scope error names the missing scope and the next connect URL. Inbox and Drive-wide helpers are not hidden.
createDraftstores raw MIME verbatim.createReplyDraftderives recipient, subject,In-Reply-To,References,threadId, and quoted original — onlybodyis authored. Drafts needgmail.composeorgmail.modify; send-only clients withgmail.sendcan still usesendMessage.- Drive-wide search needs
drive.readonly;drive.fileis only files this app created. - Fork/adapt: keep OAuth + integration naming; do not invent a secret-backed
Google path. Extra accounts stay
google-<purpose>. listEventsAcrossCalendarsis not an unbounded scan. It defaults to a 20s wall-clock budget (explicitbudgetMsis capped at 60s) and returns the events collected so far withtruncated: trueandtruncatedReason: 'budget'. Hidden calendars stay included unlessshowHiddenCalendars: false. Pass a tightertimeMin/timeMaxwhen you only need a window. There is no flag to scan forever.