Skip to content

Commit ba45ffd

Browse files
committed
chore: bump version to 6.0.7
1 parent 3b8e197 commit ba45ffd

33 files changed

Lines changed: 603 additions & 806 deletions

.config/fleet/oxlint-plugin/index.mts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import preferEllipsisChar from './rules/prefer-ellipsis-char.mts'
4949
import preferEnvAsBoolean from './rules/prefer-env-as-boolean.mts'
5050
import preferErrorMessage from './rules/prefer-error-message.mts'
5151
import preferExistsSync from './rules/prefer-exists-sync.mts'
52-
import preferFindUpPackageJson from './rules/prefer-find-up-package-json.mts'
5352
import preferFunctionDeclaration from './rules/prefer-function-declaration.mts'
5453
import preferMockImport from './rules/prefer-mock-import.mts'
5554
import preferNodeBuiltinImports from './rules/prefer-node-builtin-imports.mts'
@@ -124,7 +123,6 @@ const plugin = {
124123
'prefer-env-as-boolean': preferEnvAsBoolean,
125124
'prefer-error-message': preferErrorMessage,
126125
'prefer-exists-sync': preferExistsSync,
127-
'prefer-find-up-package-json': preferFindUpPackageJson,
128126
'prefer-function-declaration': preferFunctionDeclaration,
129127
'prefer-mock-import': preferMockImport,
130128
'prefer-node-builtin-imports': preferNodeBuiltinImports,

.config/fleet/oxlint-plugin/rules/prefer-find-up-package-json.mts

Lines changed: 0 additions & 125 deletions
This file was deleted.

.config/fleet/oxlint-plugin/test/prefer-find-up-package-json.test.mts

Lines changed: 0 additions & 63 deletions
This file was deleted.

.config/fleet/oxlintrc.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,25 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [6.0.7](https://github.com/SocketDev/socket-lib/releases/tag/v6.0.7) - 2026-06-02
8+
## [6.0.7](https://github.com/SocketDev/socket-lib/releases/tag/v6.0.7) - 2026-06-03
99

1010
### Added
1111

12+
- **`external-tools/python` — zero-host-dependency Python.** `resolvePython` (PATH → python-build-standalone download), `downloadPipPackage` (bundle-safe `pip install --target`), `resolvePipPackagePin` (hash-pinned closure), and the `dlxPipInstall` / `dlxPipPin` one-call wrappers. Removes the unused `external-tools/uv`.
13+
- **`constants/platform``getOs`, `getLibc`, `getTarget`.** OS, libc (`glibc`/`musl`/`undefined`), and the pnpm `pack-app` host token `<os>-<arch>[-<libc>]`.
1214
- **`http-request` decompresses `gzip` / `br` response bodies.** Buffered requests advertise `Accept-Encoding: gzip, br` and now decode the body by its `Content-Encoding` before resolving. 6.0.6 sent the header but never decompressed, so a compressed response reached callers as raw deflated bytes. Streamed requests (`stream: true`, e.g. `httpDownload`) skip the header so piped-to-disk payloads stay raw and checksum cleanly. Callers can override with `'identity'`.
1315
- **`crypto/hash` blob content-address helpers.** `blobHashOf(bytes)` returns Socket's content-addressed blob hash (`Q` + base64url(sha256)), and `verifyBlobHash(hash, bytes)` throws when bytes don't hash to the expected address. Both build on the fast one-shot `hash()`; the `S` file-stream discriminator verifies against the same digest body. Lets blob consumers (the SDK, MCP server) verify integrity against one canonical implementation instead of re-deriving the scheme.
1416
- **`integrity` — unified checksum/integrity surface.** `checksumToIntegrity(hex, algorithm?)` and `integrityToChecksum(sri)` convert between the two named hash flavors and are idempotent on the destination format (pass an SRI to `checksumToIntegrity`, get it back unchanged). `isIntegrity(s)` and `isChecksum(s)` are the predicates. `parseIntegrity(s)` returns `{ algorithm, body }` for the SRI structure. Replaces the `src/ssri/` directory (`hexToSsri`, `ssriToHex`, `isValidHex`, `isValidSsri`, `parseSsri`) — SSRI is just another name for Subresource Integrity, so the duplication confused readers. `isIntegrity` now accepts the full W3C SRI set (`sha256` / `sha384` / `sha512`) — the previous predicate hardcoded `sha512` only, which mismatched the contract `external-tools/manifest.ts` already promised and rejected the fleet's `sha256-<base64>` integrity strings.
1517
- **`process/spawn/kill-tree` — cross-platform process-tree termination.** `killProcessTree(target, { detached?, signal? })` walks and signals the whole descendant tree of a `pid` or `ChildProcess`: POSIX uses `process.kill(-pid, signal)` against the detached child's process group; Windows shells out to `taskkill /T /F /pid <pid>`. `isProcessAlive(pid)` probes liveness with `process.kill(pid, 0)`. Both helpers are best-effort and never throw — `ESRCH` (process gone) or `EPERM` (not ours) returns `false` so cleanup kills can't mask the caller's control flow.
1618

19+
### Changed
20+
21+
- **dlx + pin API renamed (breaking).** `downloadPackage``downloadNpmPackage`, `generatePackagePin``resolveNpmPackagePin`, the `package` option → `spec`. `downloadNpmPackage` gains an optional `hash` for tarball integrity.
22+
- **`packages/operations` split by concern (breaking).** The grab-bag `@socketsecurity/lib/packages/operations` export is gone; its members move to focused subpaths: `readPackageJson`/`readPackageJsonSync``packages/read`, the fetcher + GitHub tarball resolver → `packages/fetch`, `extractPackage`/`packPackage``packages/tarball`, the dependency-metadata override lookup → `packages/metadata-extensions`, and the name/spec helpers → `packages/specs`. `findUpPackageJson` now lives at `packages/find` (the `packages/find-up` subpath is removed). The `fs/find-up` subpath is renamed `fs/find`, and `fs/path-cache` is renamed `fs/allowed-dirs-cache` (it caches the safe-delete allowed-directories set, not arbitrary paths).
23+
1724
### Fixed
1825

26+
- **Python downloads now work on Windows and Alpine.** python-build-standalone resolution previously returned no asset on `win32` and musl hosts; both now resolve.
1927
- **`debug` — namespace `SOCKET_DEBUG` values enable debug output.** `envAsBoolean(getSocketDebug())` returned false for `SOCKET_DEBUG=*` or `SOCKET_DEBUG=socket:foo` — those aren't boolean literals, so debug output was silently suppressed for the common namespace-selection shape. The new `isSocketDebugEnabled()` helper treats any non-empty value other than `0`/`false`/`no` (case-insensitive) as enabled.
2028
- **`external-tools/skillspector` pipx detection on Windows.** The PATH-tier resolver normalizes the resolved binary path with `normalizePath` and matches a forward-slash-only `pipx/venvs/` pattern, instead of `path.normalize` plus a dual-separator regex. On Windows the old form left backslashes in the path and missed pipx-installed binaries, tagging them `source: 'path'` rather than `source: 'pipx'`.
2129

package.json

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,26 +1385,26 @@
13851385
"types": "./dist/fs/access.d.ts",
13861386
"default": "./dist/fs/access.js"
13871387
},
1388+
"./fs/allowed-dirs-cache": {
1389+
"source": "./src/fs/allowed-dirs-cache.ts",
1390+
"types": "./dist/fs/allowed-dirs-cache.d.ts",
1391+
"default": "./dist/fs/allowed-dirs-cache.js"
1392+
},
13881393
"./fs/encoding": {
13891394
"source": "./src/fs/encoding.ts",
13901395
"types": "./dist/fs/encoding.d.ts",
13911396
"default": "./dist/fs/encoding.js"
13921397
},
1393-
"./fs/find-up": {
1394-
"source": "./src/fs/find-up.ts",
1395-
"types": "./dist/fs/find-up.d.ts",
1396-
"default": "./dist/fs/find-up.js"
1398+
"./fs/find": {
1399+
"source": "./src/fs/find.ts",
1400+
"types": "./dist/fs/find.d.ts",
1401+
"default": "./dist/fs/find.js"
13971402
},
13981403
"./fs/inspect": {
13991404
"source": "./src/fs/inspect.ts",
14001405
"types": "./dist/fs/inspect.d.ts",
14011406
"default": "./dist/fs/inspect.js"
14021407
},
1403-
"./fs/path-cache": {
1404-
"source": "./src/fs/path-cache.ts",
1405-
"types": "./dist/fs/path-cache.d.ts",
1406-
"default": "./dist/fs/path-cache.js"
1407-
},
14081408
"./fs/read-dir": {
14091409
"source": "./src/fs/read-dir.ts",
14101410
"types": "./dist/fs/read-dir.d.ts",
@@ -2016,6 +2016,16 @@
20162016
"types": "./dist/packages/exports.d.ts",
20172017
"default": "./dist/packages/exports.js"
20182018
},
2019+
"./packages/fetch": {
2020+
"source": "./src/packages/fetch.ts",
2021+
"types": "./dist/packages/fetch.d.ts",
2022+
"default": "./dist/packages/fetch.js"
2023+
},
2024+
"./packages/find": {
2025+
"source": "./src/packages/find.ts",
2026+
"types": "./dist/packages/find.d.ts",
2027+
"default": "./dist/packages/find.js"
2028+
},
20192029
"./packages/isolation": {
20202030
"source": "./src/packages/isolation.ts",
20212031
"types": "./dist/packages/isolation.d.ts",
@@ -2031,26 +2041,36 @@
20312041
"types": "./dist/packages/manifest.d.ts",
20322042
"default": "./dist/packages/manifest.js"
20332043
},
2044+
"./packages/metadata-extensions": {
2045+
"source": "./src/packages/metadata-extensions.ts",
2046+
"types": "./dist/packages/metadata-extensions.d.ts",
2047+
"default": "./dist/packages/metadata-extensions.js"
2048+
},
20342049
"./packages/normalize": {
20352050
"source": "./src/packages/normalize.ts",
20362051
"types": "./dist/packages/normalize.d.ts",
20372052
"default": "./dist/packages/normalize.js"
20382053
},
2039-
"./packages/operations": {
2040-
"source": "./src/packages/operations.ts",
2041-
"types": "./dist/packages/operations.d.ts",
2042-
"default": "./dist/packages/operations.js"
2043-
},
20442054
"./packages/provenance": {
20452055
"source": "./src/packages/provenance.ts",
20462056
"types": "./dist/packages/provenance.d.ts",
20472057
"default": "./dist/packages/provenance.js"
20482058
},
2059+
"./packages/read": {
2060+
"source": "./src/packages/read.ts",
2061+
"types": "./dist/packages/read.d.ts",
2062+
"default": "./dist/packages/read.js"
2063+
},
20492064
"./packages/specs": {
20502065
"source": "./src/packages/specs.ts",
20512066
"types": "./dist/packages/specs.d.ts",
20522067
"default": "./dist/packages/specs.js"
20532068
},
2069+
"./packages/tarball": {
2070+
"source": "./src/packages/tarball.ts",
2071+
"types": "./dist/packages/tarball.d.ts",
2072+
"default": "./dist/packages/tarball.js"
2073+
},
20542074
"./packages/types": {
20552075
"source": "./src/packages/types.ts",
20562076
"types": "./dist/packages/types.d.ts",

scripts/post-build/make-package-exports.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import fastGlob from 'fast-glob'
1313

1414
import { getDefaultLogger } from '@socketsecurity/lib-stable/logger/default'
1515
import { toSortedObject } from '@socketsecurity/lib-stable/objects/sort'
16+
// Scripts run against the RELEASED `-stable` surface (never src/). readPackageJson
17+
// lives at `packages/operations` in the released version; the WIP src/ rename to
18+
// `packages/read` only applies after 6.0.7 ships, at which point this bumps too.
1619
import { readPackageJson } from '@socketsecurity/lib-stable/packages/operations'
1720

1821
const logger = getDefaultLogger()

src/dlx/detect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414

1515
import { isInSocketDlx } from './paths'
16-
import { findUpSync } from '../fs/find-up'
16+
import { findUpSync } from '../fs/find'
1717
import { getSocketDlxDir } from '../paths/socket'
1818

1919
import { DateNow } from '../primordials/date'

src/eco/npm/script.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
getNodeNoWarningsFlags,
2626
supportsNodeRun,
2727
} from '../../constants/node'
28-
import { findUpSync } from '../../fs/find-up'
28+
import { findUpSync } from '../../fs/find'
2929
import { getOwn } from '../../objects/inspect'
3030
import { ArrayIsArray } from '../../primordials/array'
3131
import { ErrorCtor } from '../../primordials/error'

0 commit comments

Comments
 (0)