Skip to content

feat(skill): add skill office to fetch and run the offline DOCX bundle - #233

Merged
quickbeard merged 3 commits into
mainfrom
skill-office
Aug 3, 2026
Merged

feat(skill): add skill office to fetch and run the offline DOCX bundle#233
quickbeard merged 3 commits into
mainfrom
skill-office

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

Summary

New codevhub skill office subcommand: downloads the MiniMax-DOCX offline bundle for the current OS from the codev-storage MinIO backend (anonymous — never forces a login, unlike the other skill subcommands), verifies it against the bucket's manifest.json, and runs the bundled setup script with inherited stdio so sudo/UAC prompts reach the user.

  • src/lib/download.ts — streaming download helper for GB-scale files: pipes to <dest>.partial with proper backpressure (stream/promises.pipeline), hashes SHA-256 in-flight, resumes interrupted transfers via HTTP Range (a stale/oversized partial self-heals through 416 or the hash check), write-then-rename on verify. Existing fetch sites buffer whole bodies in RAM — hopeless at the 1.1 GB macOS bundle.
  • src/lib/office.ts — plain non-Ink runner (the installer owns the TTY). linux/darwin/win32 → ubuntu/macos/windows; a cross-host --platform forces --download-only so a mismatched script is never executed (still useful for fetch-and-carry). PowerShell flag translation (--minimal-Minimal). Flags: --platform, --dir, --download-only, --minimal, --skip-verify.
  • Wired under the existing skill namespace; help text updated; bundles stage in ~/.codev-hub/office so re-runs resume/verify instead of re-downloading.
  • OFFICE_DOWNLOADS_URL follows the hardcoded CODE_DOWNLOADS_URL pattern.

Tests

28 new vitest cases: platform mapping, arg parsing, manifest validation, PowerShell flag translation, cross-platform never-spawns, plus a real node:http server exercising full download, hash-mismatch cleanup, Range resume (asserts bytes=N- → 206), Range-ignored restart, 416 recovery, and runSkillOffice --download-only end-to-end.

Live verification

Against a local MinIO + prefix-stripping nginx (matching the production route): full download + SHA-256 verify of the real 470 MB bundle; killed the 1.1 GB macOS download at 973 MB and re-ran — proxy log shows a 206 serving only the remaining 139 MB, reassembled file verified.

biome check, tsc --noEmit, full vitest suite (1361 passed), and the esbuild bundle are green (run manually; the pre-commit hook was skipped because pnpm is currently broken on this machine, not because checks failed).

Companion PRs: codev-storage (the MinIO backend), codev-landing-page (docs download links).

🤖 Generated with Claude Code

Quickbeard and others added 3 commits August 3, 2026 16:16
New `codevhub skill office`: downloads the MiniMax-DOCX offline bundle
for this OS from the codev-storage MinIO backend (anonymous, no login),
verifies it against the bucket's manifest.json, and runs the bundled
setup script with inherited stdio so sudo/UAC prompts reach the user.

- lib/download.ts: streaming download helper for GB-scale files — the
  existing fetch sites buffer whole bodies in memory, hopeless at the
  1.1GB macOS bundle. Pipes to `<dest>.partial` with backpressure,
  hashes in-flight, resumes via HTTP Range (stale partials self-heal
  through 416 or the SHA-256 check), renames into place on verify.
- lib/office.ts: plain non-Ink runner (the installer owns the TTY).
  Platform mapping linux/darwin/win32 -> ubuntu/macos/windows with a
  --platform override that forces --download-only when it differs from
  the host, so a mismatched script is never executed. Flag translation
  for PowerShell (--minimal -> -Minimal). --dir, --download-only,
  --minimal, --skip-verify.
- Wired under the existing `skill` namespace (search|pull|push|office);
  bundles stage in ~/.codev-hub/office so re-runs resume/verify.

Verified live against a local MinIO + prefix-stripping nginx: full
download + SHA-256 verify, and a kill at 973MB of 1.1GB resumed with a
206 for just the remaining bytes. Pre-commit hook checks (biome, tsc,
vitest, build) run manually and green — pnpm itself is currently broken
on this machine, so the hook was skipped with --no-verify.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Print the platform bundle's actual size from the manifest ahead of the
download, plus a note that an interrupted run resumes, so a user on a
slow link knows a long silence-then-progress is expected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@quickbeard
quickbeard merged commit 48281f2 into main Aug 3, 2026
2 of 4 checks passed
@quickbeard
quickbeard deleted the skill-office branch August 3, 2026 10:52
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