Skip to content

feat(cli): send-file β€” OneDrive upload, share link, file card - #32

Open
sinjab wants to merge 2 commits into
mingnz:mainfrom
sinjab:feat/send-file
Open

sinjab wants to merge 2 commits into
mingnz:mainfrom
sinjab:feat/send-file

Conversation

@sinjab

@sinjab sinjab commented Oct 15, 2026

Copy link
Copy Markdown

Adds teams send-file <chat> <file> [--caption] [--link-scope org|anon] [--dry-run]: uploads to the user's OneDrive 'Microsoft Teams Chat Files' folder via the v2.1 drive API, mints a share link (organization-scoped by default), and posts the file card through the same message endpoint as send. SP token ladder: TEAMS_SP_TOKEN env β†’ cached β†’ the CLI's own browser profile MSAL cache β†’ /_api/ Bearer interception; tenant/site/region derived from token claims (no hardcoded values). Non-destructive by design: conflictBehavior=rename with the server-returned name used downstream, staged receipts with partial-failure reporting (a failed post tells you the upload/link that needs cleanup), 250 MB single-PUT cap. Golden-fixture tests against the observed properties.files[] shape. Depends on #31 (buildMessageBody/postMessage).

HTML mode posts caller-owned HTML verbatim (RichText/Html, no <p> wrap);
'-' reads stdin; --dry-run prints the exact body without sending. Plain
mode byte-for-byte unchanged. Send path split into buildMessageBody
(pure) + postMessage (transport) β€” the foundation for the attachments
PR. Implemented via claude relay lane (dispatch 62DFF778), reviewed +
live-tested by the calling session (receipt 1792066772884).
Native SP-token ladder (env TEAMS_SP_TOKEN -> cached -> profile
localStorage -> /_api/ interception), dynamic tenant/site derivation
from token claims, conflictBehavior=rename with server-name use,
organization-scoped links by default (--link-scope anon for the
field-proven Anyone shape), staged receipts with partial-failure
reporting, --dry-run, golden-fixture tests (187 total). Implemented
via claude relay lane (dispatch 5553A777), reviewed + live-tested by
the calling session: native ladder e2e on test thread, both scopes,
properties.files round-trip verified (arrivals 1792067458237,
1792067475606).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants