mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 00:03:52 +00:00
fix(skills): stabilize compression across zlib versions
This commit is contained in:
@@ -125,7 +125,7 @@ describe('skill package creation and extraction', () => {
|
||||
archiveSha256: created.archiveSha256,
|
||||
packageDigest: created.manifest.packageDigest
|
||||
}).toEqual({
|
||||
archiveSha256: '4a62b276b1e8100f0b437f2f0aa182d844768160ba30c5f76afd027acfe50ac8',
|
||||
archiveSha256: '2abf449e92650f03b749631547c22e0f28facf6da9c36f0e77d6f8cc7df8e47a',
|
||||
packageDigest: '3bb1fc63cfea2f2b7f2cf80e539735eebd5bfb6aa65f47cf0db7e9fd35297f57'
|
||||
})
|
||||
})
|
||||
|
||||
@@ -4,7 +4,7 @@ import { once } from 'node:events'
|
||||
import type { Readable, Writable } from 'node:stream'
|
||||
import { Transform } from 'node:stream'
|
||||
import { pipeline } from 'node:stream/promises'
|
||||
import { createGunzip, createGzip } from 'node:zlib'
|
||||
import { constants as zlibConstants, createGunzip, createGzip } from 'node:zlib'
|
||||
import { SKILL_PACKAGE_MAX_COMPRESSED_BYTES } from '../../shared/skill-package-manifest'
|
||||
|
||||
const TAR_BLOCK_BYTES = 512
|
||||
@@ -103,7 +103,7 @@ export async function writeSkillTarGzip(
|
||||
): Promise<{ archiveSha256: string; compressedBytes: number }> {
|
||||
const archiveHash = createHash('sha256')
|
||||
let compressedBytes = 0
|
||||
const gzip = createGzip({ level: 9 })
|
||||
const gzip = createGzip({ level: 9, strategy: zlibConstants.Z_FIXED })
|
||||
const hashTransform = new Transform({
|
||||
transform(chunk: Buffer, _encoding, callback) {
|
||||
compressedBytes += chunk.length
|
||||
|
||||
Reference in New Issue
Block a user