Skip to content

@codesoul-co/hypha-adapters-local / common-tool-port-bindings

Using this module

Use the Common tool port bindings module for defining or implementing provider-neutral ports. It exports 3 classes, 3 interfaces, 1 type.

Import from the package entrypoint

ts
import {
  ArtifactManagerCommonToolPort,
  GovernedCommandCommonToolPort,
  WorkspaceCommonToolPort,
} from '@codesoul-co/hypha-adapters-local';

import type {
  ArtifactManagerCommonToolPortOptions,
  CommonToolProviderPort,
  CommonToolProviderRequest,
  GovernedCommandDispatchFactory,
} from '@codesoul-co/hypha-adapters-local';

Usage patterns

  • Use the 4 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 3 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
ArtifactManagerCommonToolPortclassnew ArtifactManagerCommonToolPort(artifacts: ArtifactManager, options: ArtifactManagerCommonToolPortOptions): ArtifactManagerCommonToolPortPrincipal/workspace-scoped ArtifactManager binding; raw storage or host paths are never exposed.
GovernedCommandCommonToolPortclassnew GovernedCommandCommonToolPort(execution: ExecutionPort, createDispatch: GovernedCommandDispatchFactory): GovernedCommandCommonToolPortBinds common.command to the authorization-verifying ExecutionPort boundary.
WorkspaceCommonToolPortclassnew WorkspaceCommonToolPort(workspace: WorkspaceRuntimePort): WorkspaceCommonToolPortExposes only file operations; WorkspaceRuntime.execute is never reachable through this binding.
ArtifactManagerCommonToolPortOptionsinterfaceinterface ArtifactManagerCommonToolPortOptionsArtifact Manager Common Tool Port Options interface with 2 public fields or methods.
CommonToolProviderPortinterfaceinterface CommonToolProviderPortCommon Tool Provider Port interface with 1 public fields or methods.
CommonToolProviderRequestinterfaceinterface CommonToolProviderRequestStructural mirror of the tools-owned CommonToolPort boundary.
GovernedCommandDispatchFactorytypetype GovernedCommandDispatchFactory = (request: CommonToolProviderRequest) => Promise<ExecutionDispatchRequest> | ExecutionDispatchRequestPublic type alias for Governed Command Dispatch Factory; the declaration contains its complete type expression.

ArtifactManagerCommonToolPort

Principal/workspace-scoped ArtifactManager binding; raw storage or host paths are never exposed.

  • Kind: class
  • Import: import { ArtifactManagerCommonToolPort } from '@codesoul-co/hypha-adapters-local';
  • Source module: common-tool-port-bindings

Declaration

text
export declare class ArtifactManagerCommonToolPort implements CommonToolProviderPort {
    constructor(artifacts: ArtifactManager, options: ArtifactManagerCommonToolPortOptions);
    execute(request: CommonToolProviderRequest): Promise<unknown>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(artifacts: ArtifactManager, options: ArtifactManagerCommonToolPortOptions): ArtifactManagerCommonToolPortCreates an instance of this class.
executemethodexecute(request: CommonToolProviderRequest): Promise<unknown>Public method; parameters and return type are shown in the signature.

GovernedCommandCommonToolPort

Binds common.command to the authorization-verifying ExecutionPort boundary.

  • Kind: class
  • Import: import { GovernedCommandCommonToolPort } from '@codesoul-co/hypha-adapters-local';
  • Source module: common-tool-port-bindings

Declaration

text
export declare class GovernedCommandCommonToolPort implements CommonToolProviderPort {
    constructor(execution: ExecutionPort, createDispatch: GovernedCommandDispatchFactory);
    execute(request: CommonToolProviderRequest): Promise<unknown>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(execution: ExecutionPort, createDispatch: GovernedCommandDispatchFactory): GovernedCommandCommonToolPortCreates an instance of this class.
executemethodexecute(request: CommonToolProviderRequest): Promise<unknown>Public method; parameters and return type are shown in the signature.

WorkspaceCommonToolPort

Exposes only file operations; WorkspaceRuntime.execute is never reachable through this binding.

  • Kind: class
  • Import: import { WorkspaceCommonToolPort } from '@codesoul-co/hypha-adapters-local';
  • Source module: common-tool-port-bindings

Declaration

text
export declare class WorkspaceCommonToolPort implements CommonToolProviderPort {
    constructor(workspace: WorkspaceRuntimePort);
    execute(request: CommonToolProviderRequest): Promise<unknown>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(workspace: WorkspaceRuntimePort): WorkspaceCommonToolPortCreates an instance of this class.
executemethodexecute(request: CommonToolProviderRequest): Promise<unknown>Public method; parameters and return type are shown in the signature.

ArtifactManagerCommonToolPortOptions

Artifact Manager Common Tool Port Options interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { ArtifactManagerCommonToolPortOptions } from '@codesoul-co/hypha-adapters-local';
  • Source module: common-tool-port-bindings

Declaration

text
export interface ArtifactManagerCommonToolPortOptions {
    profileRef: SpecRef;
    maxReadBytes?: number;
}

Contract members

MemberKindSignatureDescription
maxReadBytespropertymaxReadBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
profileRefpropertyprofileRef: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.

CommonToolProviderPort

Common Tool Provider Port interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { CommonToolProviderPort } from '@codesoul-co/hypha-adapters-local';
  • Source module: common-tool-port-bindings

Declaration

text
export interface CommonToolProviderPort {
    execute(request: CommonToolProviderRequest): Promise<unknown>;
}

Contract members

MemberKindSignatureDescription
executemethodexecute(request: CommonToolProviderRequest): Promise<unknown>Public method; parameters and return type are shown in the signature.

CommonToolProviderRequest

Structural mirror of the tools-owned CommonToolPort boundary.

  • Kind: interface
  • Import: import type { CommonToolProviderRequest } from '@codesoul-co/hypha-adapters-local';
  • Source module: common-tool-port-bindings

Declaration

text
export interface CommonToolProviderRequest {
    operation: string;
    input: Record<string, unknown>;
    context: ToolCallContext;
}

Contract members

MemberKindSignatureDescription
contextpropertycontext: ToolCallContextPublic property; its type, readonly modifier and optionality are shown in the signature.
inputpropertyinput: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
operationpropertyoperation: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

GovernedCommandDispatchFactory

Public type alias for Governed Command Dispatch Factory; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { GovernedCommandDispatchFactory } from '@codesoul-co/hypha-adapters-local';
  • Source module: common-tool-port-bindings

Declaration

text
export type GovernedCommandDispatchFactory = (request: CommonToolProviderRequest) => Promise<ExecutionDispatchRequest> | ExecutionDispatchRequest;