Skip to content

feat: Yandex Disk as a documents source, live files commands and the api group - #1

Merged
leemour merged 10 commits into
mainfrom
feat/source
Nov 17, 2026
Merged

leemour merged 10 commits into
mainfrom
feat/source

Conversation

@leemour

@leemour leemour commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

The first build of ydisk: Yandex Disk as a WireCat documents source, live file commands and the generated api group, on the shared foundation (cli-template 0.25.0, cli-core 0.690.0, cli-base 0.110.0).

What it does

  • Sign-in with a Yandex OAuth token pasted on stdin.
  • folders add/list/browse/remove, sync, status, and cli-core's shared documents, search, catalog and knowledge commands. Yandex has no change feed, so each sync walks the chosen folders and reads only files whose MD5 changed.
  • files list/show/download/upload/copy/move/create/delete/restore/publish/unpublish, guarded by the keys files.delete and files.share.
  • api: 20 operations generated from Yandex's Swagger 1.2. The three that answer a file link are left out.

Design: docs/dev/DESIGN.md. Measurement: cli-testing#381 (1,437 hand-written production lines against notion-cli's 4,531).

Reviews

Three fresh-agent reviews ran before the push. Every finding is fixed with a test: an MCP path that could overwrite or upload any local file, a file saved under another file's id after a replace during sync, a lost upload answer reported as a network error, and download links in api output.

Conformance

  • Live check: 0.0.0 decad7d712f98d7611ebdc20bd7d7f68b947c0ea 2026-11-17 scripts/live.sh v2:ea8d71e5ea60b1f0d88654e3e4eb33df1c087493ae33ff4d10d4f7c115107f68
    Local: typecheck, lint, 172 tests, contracts:check, docs:check. The live check (bin/live) is the owner's and has not run yet.

🤖 Generated with Claude Code

leemour and others added 6 commits November 17, 2026 09:28
- spec/ydisk: the resource listing and the five declarations the CLI uses
  (disk, resources, public/resources, trash/resources, operations), each
  with its URL and SHA-256 in provenance.json; sync-spec fetches Swagger 1.2.
- spec-model: keys each declaration by its listing path and upgrades with
  upgradeToOpenApi3(listing, declarations); the Yandex 360 admin settings
  entry is left out with its reason. swagger-converter 2.1.0 added as a
  devDependency, as cli-base's peer.
- generate: names from paths without the /v1/disk prefix, eight mapped by
  hand (GET /v1/disk would be `list`, the group's own command); group
  `files` with deletingFlags permanently and overwrite, shares publish,
  unpublish and public-settings; offset pagination detected for five reads;
  sign-in `Authorization: OAuth <token>` from the quickstart page.
- identity: hosts cloud-api.yandex.net, downloader.disk.yandex.ru and
  *.disk.yandex.net; the sample host stays until the sample goes.
- api.test: every operation against fakeApi with the OAuth header, the
  delete key on both deletes, overwrite=true refused by files.delete, and
  publish refused by files.share.
- Regenerated src/generated, coverage, commands page, skill API pages and
  contracts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fake and the CLI share manifestBaseUrl, so a doubled slash between the
server and the path would pass the host check alone. Also drop an
unverified claim about the public-key reads from the sign-in reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sk sign-in

The template's sample is gone; ydisk now talks to Yandex Disk's REST API:

- session start checks a pasted OAuth token with GET /v1/disk and keeps it in the keyring;
  the token goes only to cloud-api.yandex.net, as `Authorization: OAuth <token>`.
- The source (src/yandex/source.ts) is a FeedlessDocumentSource: ids are resource_id, the
  path rides in providerMetadata, each sync walks the chosen folders and reads only files
  whose MD5 changed, and a download whose bytes do not match the listed MD5 is retried
  later instead of saved under the wrong id. cli-core's documentLibraryCommands mounts
  folders (with folders browse), sync, status, documents, search, catalog and knowledge.
- files list|show|download|upload|copy|move|create|delete|restore|publish|unpublish, by
  Disk path, through the profile's guard and send journal, never retried. Over MCP,
  download answers a file's text and cannot write a path (--output is owner-only); upload
  refuses credential files unless the owner adds --allow-any-file. Downloads stream to a
  temporary file; links go through linkFetch without the token.
- The api group leaves out the three operations that answer a download or upload link,
  and takes `file`, `preview` and `sizes` out of every answer.
- cli-core 0.689.0, cli-base 0.110.0; coverage leaves out src/generated; a gitleaks rule
  for Yandex tokens; lint overrides with reasons for the folder web link and files list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ict fakes

- src/testing/fake-disk.ts, an in-memory Disk that refuses an unknown path or parameter, a
  call without `OAuth <token>`, and a download that carries the token; src/testing/disk-api.ts,
  cli-base's fakeApi from the whole generated spec, with knobs for lost, hung and failed writes.
- cli-core's documentSourceContract and documentCommandsContract over the source and the CLI.
- The template sample's transport, session and write-path tests, ported to the Disk.
- The review findings as tests: an upload whose answer is lost is outcome_unknown, a
  credential file is refused, MCP cannot pass --output, a download with other bytes than
  the listed MD5 is not saved, the api answers carry no download link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fragment

README, docs/index.md, docs/security.md and the agent skill say what the CLI does for a
person and an agent; docs/dev/DESIGN.md keeps the owner's answers, the differences from
drive-cli with their reasons, and how the source handles paths, the missing change feed and
links. changes/feat-source.md is the release's entry. Generated pages are refreshed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e added again

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@socket-security

socket-security Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​wirecat/​cli-base@​0.109.0 ⏵ 0.110.098100100 +19670
Updated@​wirecat/​cli-core@​0.687.0 ⏵ 0.690.097100100 +19670
Addedswagger-converter@​2.1.010010010075100

View full report

leemour and others added 4 commits November 17, 2026 10:40
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e test Disk lacks it

The owner prepares only the token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first live check got a link on mds.storage.yandex.net, a host Yandex's docs do not name, and the CLI refused it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour
leemour merged commit c13b765 into main Nov 17, 2026
17 of 18 checks passed
@leemour
leemour deleted the feat/source branch November 17, 2026 09:47
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.

1 participant