@ship.zone/runner 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +7 -0
- package/deno.json +1 -1
- package/dist_npm/mod.d.ts +23 -5
- package/dist_npm/mod.js +1 -1
- package/dist_rust/runnerworkspace_linux_amd64_musl +0 -0
- package/dist_rust/runnerworkspace_linux_arm64_musl +0 -0
- package/package.json +1 -1
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/oci-executor.ts +36 -10
package/changelog.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-07-31 - 0.2.1
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- publish Node-compatible declaration types for OCI dependency injection (oci-executor)
|
|
8
|
+
- Replace Deno-specific dependency injection types with runtime-neutral interfaces for temporary directories, removal options, directory entries, and file metadata.
|
|
9
|
+
|
|
3
10
|
## 2026-07-31 - 0.2.0
|
|
4
11
|
|
|
5
12
|
### Features
|
package/deno.json
CHANGED
package/dist_npm/mod.d.ts
CHANGED
|
@@ -522,21 +522,39 @@ export interface IOciRuntimeCommandResult { success: boolean;
|
|
|
522
522
|
stderr: Uint8Array;
|
|
523
523
|
}
|
|
524
524
|
export type TOciRuntimeCommandRunner = (request: IOciRuntimeCommandRequest) => Promise<IOciRuntimeCommandResult>;
|
|
525
|
+
export interface IRuntimeMakeTempOptions { dir?: string;
|
|
526
|
+
prefix?: string;
|
|
527
|
+
suffix?: string;
|
|
528
|
+
}
|
|
529
|
+
export interface IRuntimeRemoveOptions { recursive?: boolean;
|
|
530
|
+
}
|
|
531
|
+
export interface IRuntimeDirectoryEntry { name: string;
|
|
532
|
+
isFile: boolean;
|
|
533
|
+
isDirectory: boolean;
|
|
534
|
+
isSymlink: boolean;
|
|
535
|
+
}
|
|
536
|
+
export interface IRuntimeFileInfo { isDirectory: boolean;
|
|
537
|
+
isSymlink: boolean;
|
|
538
|
+
uid: number | null;
|
|
539
|
+
mtime: Date | null;
|
|
540
|
+
dev: number | null;
|
|
541
|
+
ino: number | null;
|
|
542
|
+
}
|
|
525
543
|
export interface IOciExecutorDependencies { commandRunner?: TOciRuntimeCommandRunner;
|
|
526
544
|
runtimeEnvironment?: Record<string, string>;
|
|
527
545
|
resolveHelperPath?: (target: TOciHelperTarget) => Promise<string>;
|
|
528
546
|
probeTmpfs?: (helperPath: string) => Promise<number>;
|
|
529
547
|
randomId?: () => string;
|
|
530
548
|
now?: () => number;
|
|
531
|
-
makeTempDir?: (options:
|
|
549
|
+
makeTempDir?: (options: IRuntimeMakeTempOptions) => Promise<string>;
|
|
532
550
|
chmod?: (path: string, mode: number) => Promise<void>;
|
|
533
|
-
remove?: (path: string, options?:
|
|
551
|
+
remove?: (path: string, options?: IRuntimeRemoveOptions) => Promise<void>;
|
|
534
552
|
}
|
|
535
553
|
export interface IHostTmpfsProbeScavengerDependencies { getUid?: () => number | undefined;
|
|
536
554
|
now?: () => number;
|
|
537
|
-
readDir?: (path: string) => AsyncIterable<
|
|
538
|
-
lstat?: (path: string) => Promise<
|
|
539
|
-
remove?: (path: string, options?:
|
|
555
|
+
readDir?: (path: string) => AsyncIterable<IRuntimeDirectoryEntry>;
|
|
556
|
+
lstat?: (path: string) => Promise<IRuntimeFileInfo>;
|
|
557
|
+
remove?: (path: string, options?: IRuntimeRemoveOptions) => Promise<void>;
|
|
540
558
|
}
|
|
541
559
|
export interface IWorkspaceVolumeLimits { blockSize: number;
|
|
542
560
|
logicalBytes: number;
|
package/dist_npm/mod.js
CHANGED
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/ts/00_commitinfo_data.ts
CHANGED
package/ts/oci-executor.ts
CHANGED
|
@@ -81,6 +81,32 @@ export type TOciRuntimeCommandRunner = (
|
|
|
81
81
|
request: IOciRuntimeCommandRequest,
|
|
82
82
|
) => Promise<IOciRuntimeCommandResult>;
|
|
83
83
|
|
|
84
|
+
export interface IRuntimeMakeTempOptions {
|
|
85
|
+
dir?: string;
|
|
86
|
+
prefix?: string;
|
|
87
|
+
suffix?: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface IRuntimeRemoveOptions {
|
|
91
|
+
recursive?: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface IRuntimeDirectoryEntry {
|
|
95
|
+
name: string;
|
|
96
|
+
isFile: boolean;
|
|
97
|
+
isDirectory: boolean;
|
|
98
|
+
isSymlink: boolean;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface IRuntimeFileInfo {
|
|
102
|
+
isDirectory: boolean;
|
|
103
|
+
isSymlink: boolean;
|
|
104
|
+
uid: number | null;
|
|
105
|
+
mtime: Date | null;
|
|
106
|
+
dev: number | null;
|
|
107
|
+
ino: number | null;
|
|
108
|
+
}
|
|
109
|
+
|
|
84
110
|
export interface IOciExecutorDependencies {
|
|
85
111
|
commandRunner?: TOciRuntimeCommandRunner;
|
|
86
112
|
runtimeEnvironment?: Record<string, string>;
|
|
@@ -88,17 +114,17 @@ export interface IOciExecutorDependencies {
|
|
|
88
114
|
probeTmpfs?: (helperPath: string) => Promise<number>;
|
|
89
115
|
randomId?: () => string;
|
|
90
116
|
now?: () => number;
|
|
91
|
-
makeTempDir?: (options:
|
|
117
|
+
makeTempDir?: (options: IRuntimeMakeTempOptions) => Promise<string>;
|
|
92
118
|
chmod?: (path: string, mode: number) => Promise<void>;
|
|
93
|
-
remove?: (path: string, options?:
|
|
119
|
+
remove?: (path: string, options?: IRuntimeRemoveOptions) => Promise<void>;
|
|
94
120
|
}
|
|
95
121
|
|
|
96
122
|
export interface IHostTmpfsProbeScavengerDependencies {
|
|
97
123
|
getUid?: () => number | undefined;
|
|
98
124
|
now?: () => number;
|
|
99
|
-
readDir?: (path: string) => AsyncIterable<
|
|
100
|
-
lstat?: (path: string) => Promise<
|
|
101
|
-
remove?: (path: string, options?:
|
|
125
|
+
readDir?: (path: string) => AsyncIterable<IRuntimeDirectoryEntry>;
|
|
126
|
+
lstat?: (path: string) => Promise<IRuntimeFileInfo>;
|
|
127
|
+
remove?: (path: string, options?: IRuntimeRemoveOptions) => Promise<void>;
|
|
102
128
|
}
|
|
103
129
|
|
|
104
130
|
export interface IWorkspaceVolumeLimits {
|
|
@@ -356,14 +382,14 @@ export const scavengeHostTmpfsProbes = async (
|
|
|
356
382
|
const readDir = dependencies.readDir ?? ((path: string) => Deno.readDir(path));
|
|
357
383
|
const lstat = dependencies.lstat ?? ((path: string) => Deno.lstat(path));
|
|
358
384
|
const remove = dependencies.remove ?? ((path, options) => Deno.remove(path, options));
|
|
359
|
-
const isEligible = (stat:
|
|
385
|
+
const isEligible = (stat: IRuntimeFileInfo): boolean =>
|
|
360
386
|
stat.isDirectory && !stat.isSymlink && stat.uid === uid && stat.mtime !== null &&
|
|
361
387
|
now() - stat.mtime.getTime() > hostTmpfsProbeMaximumAgeMs;
|
|
362
388
|
|
|
363
389
|
for await (const entry of readDir(directory)) {
|
|
364
390
|
if (!hostTmpfsProbeNamePattern.test(entry.name)) continue;
|
|
365
391
|
const path = join(directory, entry.name);
|
|
366
|
-
let initial:
|
|
392
|
+
let initial: IRuntimeFileInfo;
|
|
367
393
|
try {
|
|
368
394
|
initial = await lstat(path);
|
|
369
395
|
} catch (error) {
|
|
@@ -371,7 +397,7 @@ export const scavengeHostTmpfsProbes = async (
|
|
|
371
397
|
throw error;
|
|
372
398
|
}
|
|
373
399
|
if (!isEligible(initial) || initial.dev === null || initial.ino === null) continue;
|
|
374
|
-
let current:
|
|
400
|
+
let current: IRuntimeFileInfo;
|
|
375
401
|
try {
|
|
376
402
|
current = await lstat(path);
|
|
377
403
|
} catch (error) {
|
|
@@ -934,9 +960,9 @@ export class OciExecutor implements IJobExecutor {
|
|
|
934
960
|
private readonly now: () => number;
|
|
935
961
|
private readonly resolveHelperPathImplementation: (target: TOciHelperTarget) => Promise<string>;
|
|
936
962
|
private readonly probeTmpfsImplementation: (helperPath: string) => Promise<number>;
|
|
937
|
-
private readonly makeTempDir: (options:
|
|
963
|
+
private readonly makeTempDir: (options: IRuntimeMakeTempOptions) => Promise<string>;
|
|
938
964
|
private readonly chmod: (path: string, mode: number) => Promise<void>;
|
|
939
|
-
private readonly remove: (path: string, options?:
|
|
965
|
+
private readonly remove: (path: string, options?: IRuntimeRemoveOptions) => Promise<void>;
|
|
940
966
|
private runtimeFacts?: IOciRuntimeFacts;
|
|
941
967
|
private readonly preparedLeases = new Map<string, PreparedOciLease>();
|
|
942
968
|
|