@codesoul-co/hypha-adapters-local / local-process-policy
- Package index:
@codesoul-co/hypha-adapters-local - Source:
packages/adapters-local/src/local-process-policy.ts - Exports: 3
Using this module
Use the Local process policy module for applying policy and governance checks. It exports 1 class, 2 interfaces.
Import from the package entrypoint
ts
import {
LocalProcessPolicyResolver,
} from '@codesoul-co/hypha-adapters-local';
import type {
LocalProcessPolicyResolverOptions,
ResolvedLocalProcessPolicy,
} from '@codesoul-co/hypha-adapters-local';Usage patterns
- Use the 2 type/interface exports as static contracts in application code, adapters, or tests. Import them with
import type; they do not exist at runtime. - The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
LocalProcessPolicyResolver | class | new LocalProcessPolicyResolver(options: LocalProcessPolicyResolverOptions): LocalProcessPolicyResolver | Resolves untrusted command input into an explicit, host-local execution policy. |
LocalProcessPolicyResolverOptions | interface | interface LocalProcessPolicyResolverOptions | Local Process Policy Resolver Options interface with 14 public fields or methods. |
ResolvedLocalProcessPolicy | interface | interface ResolvedLocalProcessPolicy | Resolved Local Process Policy interface with 9 public fields or methods. |
LocalProcessPolicyResolver
Resolves untrusted command input into an explicit, host-local execution policy.
- Kind: class
- Import:
import { LocalProcessPolicyResolver } from '@codesoul-co/hypha-adapters-local'; - Source module:
local-process-policy
Declaration
text
export declare class LocalProcessPolicyResolver {
readonly workspaceRoot: string;
constructor(options: LocalProcessPolicyResolverOptions);
validateEnvironment(environment: ExecutionEnvironmentSpec): void;
resolve(environment: ExecutionEnvironmentSpec, request: CommandExecutionRequest): Promise<ResolvedLocalProcessPolicy>;
assertExecutionSurfaceUnchanged(policy: ResolvedLocalProcessPolicy): Promise<void>;
assertSurfaceAvailable(): Promise<void>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
assertExecutionSurfaceUnchanged | method | assertExecutionSurfaceUnchanged(policy: ResolvedLocalProcessPolicy): Promise<void> | Public method; parameters and return type are shown in the signature. |
assertSurfaceAvailable | method | assertSurfaceAvailable(): Promise<void> | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (options: LocalProcessPolicyResolverOptions): LocalProcessPolicyResolver | Creates an instance of this class. |
resolve | method | resolve(environment: ExecutionEnvironmentSpec, request: CommandExecutionRequest): Promise<ResolvedLocalProcessPolicy> | Public method; parameters and return type are shown in the signature. |
validateEnvironment | method | validateEnvironment(environment: ExecutionEnvironmentSpec): void | Public method; parameters and return type are shown in the signature. |
workspaceRoot | property | readonly workspaceRoot: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
LocalProcessPolicyResolverOptions
Local Process Policy Resolver Options interface with 14 public fields or methods.
- Kind: interface
- Import:
import type { LocalProcessPolicyResolverOptions } from '@codesoul-co/hypha-adapters-local'; - Source module:
local-process-policy
Declaration
text
export interface LocalProcessPolicyResolverOptions {
workspaceRoot: string;
executables: Record<string, string>;
baseEnvironment?: Record<string, string>;
inheritEnvironment?: string[];
maxExecutionTimeoutMs?: number;
maxStdoutBytes?: number;
maxStderrBytes?: number;
maxCombinedOutputBytes?: number;
maxArgumentCount?: number;
maxArgumentBytes?: number;
maxTotalArgumentBytes?: number;
maxEnvironmentVariables?: number;
maxEnvironmentValueBytes?: number;
maxTotalEnvironmentBytes?: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
baseEnvironment | property | baseEnvironment?: Record<string, string> | Public property; its type, readonly modifier and optionality are shown in the signature. |
executables | property | executables: Record<string, string> | Public property; its type, readonly modifier and optionality are shown in the signature. |
inheritEnvironment | property | inheritEnvironment?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxArgumentBytes | property | maxArgumentBytes?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxArgumentCount | property | maxArgumentCount?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxCombinedOutputBytes | property | maxCombinedOutputBytes?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxEnvironmentValueBytes | property | maxEnvironmentValueBytes?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxEnvironmentVariables | property | maxEnvironmentVariables?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxExecutionTimeoutMs | property | maxExecutionTimeoutMs?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxStderrBytes | property | maxStderrBytes?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxStdoutBytes | property | maxStdoutBytes?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxTotalArgumentBytes | property | maxTotalArgumentBytes?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxTotalEnvironmentBytes | property | maxTotalEnvironmentBytes?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
workspaceRoot | property | workspaceRoot: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ResolvedLocalProcessPolicy
Resolved Local Process Policy interface with 9 public fields or methods.
- Kind: interface
- Import:
import type { ResolvedLocalProcessPolicy } from '@codesoul-co/hypha-adapters-local'; - Source module:
local-process-policy
Declaration
text
export interface ResolvedLocalProcessPolicy {
executable: string;
args: readonly string[];
cwd: string;
environment: NodeJS.ProcessEnv;
timeoutMs: number;
idleTimeoutMs?: number;
maxStdoutBytes: number;
maxStderrBytes: number;
maxCombinedOutputBytes: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
args | property | args: readonly string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
cwd | property | cwd: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
environment | property | environment: NodeJS.ProcessEnv | Public property; its type, readonly modifier and optionality are shown in the signature. |
executable | property | executable: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
idleTimeoutMs | property | idleTimeoutMs?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxCombinedOutputBytes | property | maxCombinedOutputBytes: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxStderrBytes | property | maxStderrBytes: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxStdoutBytes | property | maxStdoutBytes: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
timeoutMs | property | timeoutMs: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
