diff --git a/build-packages.sh b/build-packages.sh index 1d635297..9ebd90d7 100755 --- a/build-packages.sh +++ b/build-packages.sh @@ -188,6 +188,7 @@ install_python_packages() { beautifulsoup4 \ tabulate \ xlrd \ + python-calamine \ numba \ patsy \ numexpr \ diff --git a/docker/package-init.sh b/docker/package-init.sh index 4b96305f..19ad83c3 100644 --- a/docker/package-init.sh +++ b/docker/package-init.sh @@ -208,6 +208,7 @@ if [ -f "$PIP_PATH" ]; then beautifulsoup4 \ tabulate \ xlrd \ + python-calamine \ numba \ patsy \ numexpr \ diff --git a/packages/code/src/protocol.test.ts b/packages/code/src/protocol.test.ts index 25c00cf3..9e1ac2b3 100644 --- a/packages/code/src/protocol.test.ts +++ b/packages/code/src/protocol.test.ts @@ -988,6 +988,15 @@ test('bridge artifact policy and media types match the hardened gateway contract assert.equal(bridgeArtifactMediaType('preview.png'), 'image/png'); assert.equal(bridgeArtifactMediaType('reports/result.json'), 'application/json'); assert.equal(bridgeArtifactMediaType('Dockerfile'), 'application/octet-stream'); + // XLSB (Excel Binary Workbook) — sandboxed code can produce these via + // `pd.read_excel(path, engine='calamine')`-backed workflows; the egress + // gateway must accept them with the correct Content-Type rather than + // falling back to application/octet-stream. + assert.equal(isSupportedBridgeArtifactName('report.xlsb'), true); + assert.equal( + bridgeArtifactMediaType('report.xlsb'), + 'application/vnd.ms-excel.sheet.binary.macroenabled.12', + ); }); test('linked-worktree lanes nest beneath their checkout key and conflict only with it', () => { diff --git a/packages/code/src/protocol.ts b/packages/code/src/protocol.ts index 1451986d..e6488c66 100644 --- a/packages/code/src/protocol.ts +++ b/packages/code/src/protocol.ts @@ -111,6 +111,7 @@ const BRIDGE_ARTIFACT_EXTENSIONS = new Set([ '.pptx', '.xls', '.xlsx', + '.xlsb', '.odt', '.ods', '.odp', @@ -241,8 +242,8 @@ const BRIDGE_ARTIFACT_MEDIA_TYPES: Readonly> = { '.woff': 'font/woff', '.woff2': 'font/woff2', '.xls': 'application/vnd.ms-excel', - '.xlsx': - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + '.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + '.xlsb': 'application/vnd.ms-excel.sheet.binary.macroenabled.12', '.xml': 'application/xml', '.yaml': 'application/yaml', '.yml': 'application/yaml',