Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/contracts/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ContainerInspectInfo, ContainerOpts, ExecOptions, ExecResult, Platform } from '../lib/types';
import type { ContainerInspectInfo, ContainerOpts, ExecOptions, ExecResult, Platform } from '../lib/types.ts';

export type ErrorPayload = {
error: {
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import crypto from 'node:crypto';
import { canonicalJsonStringify } from './json';
import { canonicalJsonStringify } from './json.ts';

export type SignatureHeaders = {
timestamp: string;
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/workload.grpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
VolumeSpec,
VolumeSpecSchema,
} from '../proto/gen/agynio/api/runner/v1/runner_pb.js';
import type { ContainerOpts, Platform, SidecarOpts } from '../lib/types';
import type { ContainerOpts, Platform, SidecarOpts } from '../lib/types.ts';

const PROP_AUTO_REMOVE = 'auto_remove';
const PROP_NETWORK_MODE = 'network_mode';
Expand Down
32 changes: 16 additions & 16 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
export * from './lib/container.service';
export * from './lib/container.handle';
export * from './lib/container.mounts';
export * from './lib/containerStream.util';
export * from './lib/containerRegistry.port';
export * from './lib/dockerClient.port';
export * from './lib/execTimeout';
export * from './lib/types';
export * from './contracts/auth';
export * from './contracts/json';
export * from './contracts/api';
export * from './contracts/workload.grpc';
export { createRunnerGrpcServer } from './service/grpc/server';
export type { RunnerGrpcOptions } from './service/grpc/server';
export { loadRunnerConfig } from './service/config';
export type { RunnerConfig } from './service/config';
export * from './lib/container.service.ts';
export * from './lib/container.handle.ts';
export * from './lib/container.mounts.ts';
export * from './lib/containerStream.util.ts';
export * from './lib/containerRegistry.port.ts';
export * from './lib/dockerClient.port.ts';
export * from './lib/execTimeout.ts';
export * from './lib/types.ts';
export * from './contracts/auth.ts';
export * from './contracts/json.ts';
export * from './contracts/api.ts';
export * from './contracts/workload.grpc.ts';
export { createRunnerGrpcServer } from './service/grpc/server.ts';
export type { RunnerGrpcOptions } from './service/grpc/server.ts';
export { loadRunnerConfig } from './service/config.ts';
export type { RunnerConfig } from './service/config.ts';
4 changes: 2 additions & 2 deletions src/lib/container.handle.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DockerClientPort } from './dockerClient.port';
import type { ExecOptions } from './types';
import type { DockerClientPort } from './dockerClient.port.ts';
import type { ExecOptions } from './types.ts';

/**
* Lightweight entity wrapper representing a running (or created) container.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/container.mounts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ContainerInspectInfo } from './types';
import type { ContainerInspectInfo } from './types.ts';

export interface ContainerMount {
source: string;
Expand Down
14 changes: 7 additions & 7 deletions src/lib/container.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Injectable, Logger } from '@nestjs/common';
import Docker, { ContainerCreateOptions, Exec, type GetEventsOptions } from 'dockerode';
import { PassThrough, Writable } from 'node:stream';
import { ContainerHandle } from './container.handle';
import { mapInspectMounts } from './container.mounts';
import { createUtf8Collector, demuxDockerMultiplex } from './containerStream.util';
import { ExecIdleTimeoutError, ExecTimeoutError, isExecIdleTimeoutError, isExecTimeoutError } from './execTimeout';
import type { ContainerRegistryPort } from './containerRegistry.port';
import type { DockerClientPort } from './dockerClient.port';
import { ContainerHandle } from './container.handle.ts';
import { mapInspectMounts } from './container.mounts.ts';
import { createUtf8Collector, demuxDockerMultiplex } from './containerStream.util.ts';
import { ExecIdleTimeoutError, ExecTimeoutError, isExecIdleTimeoutError, isExecTimeoutError } from './execTimeout.ts';
import type { ContainerRegistryPort } from './containerRegistry.port.ts';
import type { DockerClientPort } from './dockerClient.port.ts';
import {
ContainerOpts,
ExecOptions,
Expand All @@ -18,7 +18,7 @@ import {
Platform,
PLATFORM_LABEL,
type ContainerInspectInfo,
} from './types';
} from './types.ts';

const INTERACTIVE_EXEC_CLOSE_CAPTURE_LIMIT = 256 * 1024; // 256 KiB of characters (~512 KiB memory)

Expand Down
2 changes: 1 addition & 1 deletion src/lib/containerRegistry.port.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ContainerMount } from './container.mounts';
import type { ContainerMount } from './container.mounts.ts';

export type RegisterContainerStartInput = {
containerId: string;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/dockerClient.port.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ContainerHandle } from './container.handle';
import type { ContainerHandle } from './container.handle.ts';
import type {
ContainerInspectInfo,
ContainerOpts,
Expand All @@ -9,7 +9,7 @@ import type {
LogsStreamOptions,
LogsStreamSession,
Platform,
} from './types';
} from './types.ts';

export type DockerEventFilters = Record<string, Array<string | number>>;

Expand Down
12 changes: 6 additions & 6 deletions src/service/grpc/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ import {
} from '../../proto/grpc.js';
import { timestampFromDate } from '@bufbuild/protobuf/wkt';
import { create } from '@bufbuild/protobuf';
import type { ContainerService, InteractiveExecSession, LogsStreamSession, NonceCache } from '../..';
import type { ContainerHandle } from '../../lib/container.handle';
import { verifyAuthHeaders } from '../..';
import type { RunnerConfig } from '../config';
import { createDockerEventsParser } from '../dockerEvents.parser';
import { startWorkloadRequestToContainerOpts } from '../../contracts/workload.grpc';
import type { ContainerService, InteractiveExecSession, LogsStreamSession, NonceCache } from '../../index.ts';
import type { ContainerHandle } from '../../lib/container.handle.ts';
import { verifyAuthHeaders } from '../../index.ts';
import type { RunnerConfig } from '../config.ts';
import { createDockerEventsParser } from '../dockerEvents.parser.ts';
import { startWorkloadRequestToContainerOpts } from '../../contracts/workload.grpc.ts';

type ExecStream = ServerDuplexStream<ExecRequest, ExecResponse>;

Expand Down
8 changes: 4 additions & 4 deletions src/service/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import './env';
import './env.ts';

import { ServerCredentials } from '@grpc/grpc-js';
import { ContainerService, NonceCache } from '..';
import { loadRunnerConfig } from './config';
import { createRunnerGrpcServer } from './grpc/server';
import { ContainerService, NonceCache } from '../index.ts';
import { loadRunnerConfig } from './config.ts';
import { createRunnerGrpcServer } from './grpc/server.ts';

async function bootstrap(): Promise<void> {
try {
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "Bundler",
"rewriteRelativeImportExtensions": true,
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo",
Expand Down
Loading