Skip to content

improvement(mship): mship file writing improvements - #6933

Merged
Sg312 merged 2 commits into
stagingfrom
mship-file-improvements
Aug 21, 2026
Merged

Sg312 merged 2 commits into
stagingfrom
mship-file-improvements

Conversation

@Sg312

@Sg312 Sg312 commented Aug 21, 2026 •

Copy link
Copy Markdown
Collaborator

Mship file writing improvements
Companion: https://github.com/simstudioai/mothership/pull/445

Type of Change

  • New feature

Testing

Manual

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…, simdoc clone routing

- pptx-shim: deterministic normalization in both engines (hex/#, 8-digit hex,
  option cloning, auto-breakLine bullets, shadow clamps, stacked-outEnd and
  combo-axis guards, fit default)
- doc-compile: simdoc structural validation after every E2B pptx/docx compile
  (graceful on images without the toolkit); #!simdoc sources route to the
  Python engine with Deck/Doc prelude+finalizer; input_path staging
- pdf-generate: hex(), wrapText(), drawWrappedText() measured-layout helpers
@vercel

vercel Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 21, 2026 5:27pm

Request Review

@github-actions github-actions Bot added the requires-mothership-merge Has a companion PR on the mothership/copilot side — merge in lockstep label Aug 21, 2026
@github-actions

Copy link
Copy Markdown

⚠️ Cross-repo companion check

One or more companion PRs aren't merged into staging yet. Merging this without them will leave copilot and sim out of sync — merge them in lockstep.

@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds shared PPTX option normalization, simdoc-backed template cloning and structural validation, plus PDF color and text-wrapping helpers.

  • Injects a common PptxGenJS shim into legacy and document-sandbox generation.
  • Routes #!simdoc PPTX and DOCX sources through the Python document engine.
  • Adds post-build structural validation and more informative validation errors.
  • Adds PDF hex-color and measured text-wrapping utilities.

Confidence Score: 4/5

The PR needs its ineffective PPTX shrink-to-fit behavior corrected before merging because overflowing text can still be clipped despite the new default.

Both PPTX execution paths apply the new fit: 'shrink' default, but the pinned serializer does not emit the OOXML property that would make that setting take effect.

Files Needing Attention: apps/sim/lib/copilot/tools/server/files/pptx-shim.ts

Important Files Changed

Filename Overview
apps/sim/lib/copilot/tools/server/files/doc-compile.ts Adds simdoc source detection and Python routing, literal input staging, and best-effort structural validation for generated Office documents.
apps/sim/lib/copilot/tools/server/files/pptx-shim.ts Introduces comprehensive PptxGenJS normalization and chart guards, but its automatic shrink-to-fit default is inert with the pinned runtime.
apps/sim/sandbox-tasks/pdf-generate.ts Adds bounded hex-color conversion and measured text-wrapping helpers without altering existing PDF APIs.
apps/sim/sandbox-tasks/pptx-generate.ts Injects the shared PPTX shim after constructing the PptxGenJS instance in the legacy sandbox path.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Source[Document source] --> Marker{Starts with #!simdoc?}
  Marker -->|Yes| Python[Python simdoc engine]
  Marker -->|No, PPTX or DOCX| Node[Node document engine]
  Marker -->|No, PDF or XLSX| GenericPython[Generic Python engine]
  Node --> Shim[PPTX normalization shim]
  Shim --> Artifact[Generated artifact]
  Python --> Artifact
  GenericPython --> Artifact
  Artifact --> Validation[Structural validation]
  Validation --> Result{Valid?}
  Result -->|Yes or validator unavailable| Publish[Publish compiled artifact]
  Result -->|No| UserError[Return actionable compile error]
Loading

Reviews (1): Last reviewed commit: "feat(files): pptxgenjs normalization shi..." | Re-trigger Greptile

Comment thread apps/sim/lib/copilot/tools/server/files/pptx-shim.ts
@Sg312
Sg312 merged commit e578cfe into staging Aug 21, 2026
28 checks passed
@waleedlatif1
waleedlatif1 deleted the mship-file-improvements branch August 21, 2026 18:52

This branch was successfully deployed

1 active deployment
Preview — 0f5110e1 Deployed Aug 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires-mothership-merge Has a companion PR on the mothership/copilot side — merge in lockstep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant