@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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ship.zone/runner",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "exports": "./mod.ts",
5
5
  "nodeModulesDir": "none",
6
6
  "tasks": {
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: Deno.MakeTempOptions) => Promise<string>;
549
+ makeTempDir?: (options: IRuntimeMakeTempOptions) => Promise<string>;
532
550
  chmod?: (path: string, mode: number) => Promise<void>;
533
- remove?: (path: string, options?: Deno.RemoveOptions) => Promise<void>;
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<Deno.DirEntry>;
538
- lstat?: (path: string) => Promise<Deno.FileInfo>;
539
- remove?: (path: string, options?: Deno.RemoveOptions) => Promise<void>;
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
@@ -4919,7 +4919,7 @@ var init_deno = __esm({
4919
4919
  "deno.json"() {
4920
4920
  deno_default = {
4921
4921
  name: "@ship.zone/runner",
4922
- version: "0.2.0",
4922
+ version: "0.2.1",
4923
4923
  exports: "./mod.ts",
4924
4924
  nodeModulesDir: "none",
4925
4925
  tasks: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ship.zone/runner",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "The isolated OCI job runner for ship.zone CI/CD",
5
5
  "homepage": "https://code.foss.global/ship.zone/runner",
6
6
  "bugs": {
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@ship.zone/runner',
6
- version: '0.2.0',
6
+ version: '0.2.1',
7
7
  description: 'The isolated OCI job runner for ship.zone CI/CD'
8
8
  }
@@ -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: Deno.MakeTempOptions) => Promise<string>;
117
+ makeTempDir?: (options: IRuntimeMakeTempOptions) => Promise<string>;
92
118
  chmod?: (path: string, mode: number) => Promise<void>;
93
- remove?: (path: string, options?: Deno.RemoveOptions) => Promise<void>;
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<Deno.DirEntry>;
100
- lstat?: (path: string) => Promise<Deno.FileInfo>;
101
- remove?: (path: string, options?: Deno.RemoveOptions) => Promise<void>;
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: Deno.FileInfo): boolean =>
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: Deno.FileInfo;
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: Deno.FileInfo;
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: Deno.MakeTempOptions) => Promise<string>;
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?: Deno.RemoveOptions) => Promise<void>;
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