Skip to content

feat(office): offline Python authoring on Windows and macOS - #649

Merged
yaojin3616 merged 4 commits into
fix/node-pty-unpacked-helperfrom
codex/office-workspace-runtime
Oct 3, 2026
Merged

yaojin3616 merged 4 commits into
fix/node-pty-unpacked-helperfrom
codex/office-workspace-runtime

Conversation

@yaojin3616

@yaojin3616 yaojin3616 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Based on #646 (fix/node-pty-unpacked-helper). Ordinary Windows and macOS conversations lack the upstream general Office skills and bundled Python libraries, so agents can hand-assemble OOXML with PowerShell Compress-Archive and produce ZIP names that strict preview rejects. The existing template PPTD/PptxGenJS workflow remains in place. This enables upstream DOCX/PPTX/XLSX skills and load_workspace_dependencies, backed by an offline, hash-locked Python payload.

  • Add an installation-owned dsh-desktop-office composition using the published Harness 0.2.0-rc.2 plugins. Skills are visible through a real session's skill catalog; dependency queries return the current installation's Python directly. No PATH modification, first-call download, or Profile copy.
  • Prepare Python 3.12.14 and pinned numpy/pandas, python-docx, python-pptx, openpyxl, Pillow, lxml and XlsxWriter for Windows x64 and macOS arm64/x64. Archive/wheel URLs and hashes come from the recorded upstream commit. Build/dev/test prepare ignored staging output; corrupt inputs fail without retaining stale payloads.
  • Keep fix(mac): terminal posix_spawn ENOENT; run package commands on the Electron Helper and drop bundled Node #646's single Electron Node runtime. The Office CLI uses the current Electron Helper/executable in Node mode and the packaged engine-resolution hook. Python and complete skill resources live outside ASAR, so external scripts can read them. Skills explicitly prohibit Compress-Archive for OOXML and document Electron Node-mode invocation.
  • Keep general PPT and template PPT separate: ordinary conversations can load office-pptx; active template mode retains dsh-ppt, the selected template and PPTD tools. Apply current-session invocation policy after discovery caching to both catalogs and loaded bodies, disabling automatic model loading of office-pptx only in template mode. Word/Excel and explicit user invocation remain available; disabling mode or unloading the PPT plugin restores the general skill. Validation/export failures do not silently switch engines.
  • Keep Office optional in recovery: a missing payload reports activation diagnostics and Safe Mode remains usable. Existing ZIP reading compatibility remains in place.
  • Extend afterPack to activate the actual ASAR-packaged Office plugin, query its tool/skills, generate/reopen all three formats, validate OPC slash paths and skill checks, and convert them with the packaged LibreOffice engine. Repeat the Office gate from both signed Windows installation directories.

Patch scope: the existing @deepseek-ai/dsh@0.2.0-rc.2 dependency-closure patch gains one local host package, following the other Desktop plugins. No slots or client bootstrap changes. Remove this injection when upstream provides equivalent host-package closure registration. A minimal dsh-skill@0.2.0-rc.2 patch adds a shared skills/invocation waterfall for catalog/body views; the existing dsh-api-session-controller patch passes the durable Session ID to catalog views before Agent activation. The PPT plugin owns the policy and its lifecycle. Remove the seam patch when upstream exposes equivalent dynamic invocation policy. Provider precedence and client slots/bootstrap remain unchanged.

Validation:

  • Clean npm ci, including complete patch-package/postinstall
  • npm test: 181 files / 1612 tests
  • npm run typecheck, npm run build, git diff --check
  • node scripts/verify-target.mjs darwin arm64: Electron 43.0.0 / Node 24.17.0 native-loader check
  • Final unsigned macOS arm64 directory package: packaged Office plugin/tool/skills, Python authoring, structural checks and DOCX/PPTX/XLSX PDF conversion passed
  • Before the session-routing update, relocated the macOS arm64 application to a directory containing spaces and Chinese characters, with the original installation path absent: the complete packaged Office gate passed
  • Real authenticated Harness HTTP catalogs: template mode, ordinary concurrent session, Word/Excel visibility and restoration after mode switch; actual model skill loader rejects general PPT in template mode. Cached catalogs, direct body reads, cold-session ID views and listener disposal are covered.
  • Real neutral-cwd Harness subprocess: Office tool, actual session skill catalog, missing-payload diagnostic and Safe Mode recovery; corrupt download/wheel path and legacy backslash ZIP regressions
  • Native three-platform development qualification passed at cf9c113, including clean patch replay, full tests, typecheck, build, target verification, actual development packages and packaged Office generation/checks/DOCX-PPTX-XLSX PDF conversion:
    • macOS Apple Silicon: 181 files / 1612 tests passed
    • macOS Intel: 181 files / 1612 tests and native packaging passed
    • Windows x64: 1605 tests passed / 7 platform skips; packaged Harness smoke and recovery UI at three display scales also passed

Signed/notarized artifacts, final signed installation, and model-driven UI authoring are not yet verified. The arm64 development directory package carries about 205 MiB of Office resources; this is not a compressed-installer delta. Runtime discovery adds no first-use installation; installer time/size still needs native artifact comparison.

@yaojin3616
yaojin3616 marked this pull request as ready for review October 2, 2026 12:58
@yaojin3616
yaojin3616 merged commit 13434d4 into fix/node-pty-unpacked-helper Oct 3, 2026
10 checks passed
@yaojin3616
yaojin3616 deleted the codex/office-workspace-runtime branch October 3, 2026 05: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