Skip to content

@codesoul-co/hypha-tools / common-tool-ports

Using this module

Use the Common tool ports module for defining or implementing provider-neutral ports. It exports 9 constants, 1 function, 4 interfaces.

Import from the package entrypoint

ts
import {
  artifactUtilityToolSpec,
  commandUtilityToolSpec,
  commonPortToolSpecs,
  fileUtilityToolSpec,
  hashReferenceUtilityToolSpec,
  httpFetchUtilityToolSpec,
  mcpResourceUtilityToolSpec,
  memoryUtilityToolSpec,
} from '@codesoul-co/hypha-tools';

import type {
  CommonToolBinding,
  CommonToolPort,
  CommonToolPortRequest,
  CommonToolPorts,
} from '@codesoul-co/hypha-tools';

// The complete export list is documented below.

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 1 function as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
  • The 9 constant/enum exports provide stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.

Public exports

SymbolKindSignatureDescription
artifactUtilityToolSpecconstantconst artifactUtilityToolSpec: ToolSpecArtifact Utility Tool Spec constant exported by the common-tool-ports module.
commandUtilityToolSpecconstantconst commandUtilityToolSpec: ToolSpecCommand Utility Tool Spec constant exported by the common-tool-ports module.
commonPortToolSpecsconstantconst commonPortToolSpecs: readonly [ToolSpec, ToolSpec, ToolSpec, ToolSpec, ToolSpec, ToolSpec, ToolSpec, ToolSpec]Common Port Tool Specs constant exported by the common-tool-ports module.
fileUtilityToolSpecconstantconst fileUtilityToolSpec: ToolSpecFile Utility Tool Spec constant exported by the common-tool-ports module.
hashReferenceUtilityToolSpecconstantconst hashReferenceUtilityToolSpec: ToolSpecHash Reference Utility Tool Spec constant exported by the common-tool-ports module.
httpFetchUtilityToolSpecconstantconst httpFetchUtilityToolSpec: ToolSpecHttp Fetch Utility Tool Spec constant exported by the common-tool-ports module.
mcpResourceUtilityToolSpecconstantconst mcpResourceUtilityToolSpec: ToolSpecMCP Resource Utility Tool Spec constant exported by the common-tool-ports module.
memoryUtilityToolSpecconstantconst memoryUtilityToolSpec: ToolSpecMemory Utility Tool Spec constant exported by the common-tool-ports module.
searchUtilityToolSpecconstantconst searchUtilityToolSpec: ToolSpecSearch Utility Tool Spec constant exported by the common-tool-ports module.
createPortBackedCommonToolBindingsfunctioncreatePortBackedCommonToolBindings(ports: CommonToolPorts): CommonToolBinding[]Create Port Backed Common Tool Bindings function with 1 public call signature; parameters and return types are listed below.
CommonToolBindinginterfaceinterface CommonToolBindingCommon Tool Binding interface with 2 public fields or methods.
CommonToolPortinterfaceinterface CommonToolPortCommon Tool Port interface with 1 public fields or methods.
CommonToolPortRequestinterfaceinterface CommonToolPortRequestCommon Tool Port Request interface with 3 public fields or methods.
CommonToolPortsinterfaceinterface CommonToolPortsCommon Tool Ports interface with 8 public fields or methods.

artifactUtilityToolSpec

Artifact Utility Tool Spec constant exported by the common-tool-ports module.

  • Kind: constant
  • Import: import { artifactUtilityToolSpec } from '@codesoul-co/hypha-tools';
  • Source module: common-tool-ports

Declaration

text
export declare const artifactUtilityToolSpec: ToolSpec;

commandUtilityToolSpec

Command Utility Tool Spec constant exported by the common-tool-ports module.

  • Kind: constant
  • Import: import { commandUtilityToolSpec } from '@codesoul-co/hypha-tools';
  • Source module: common-tool-ports

Declaration

text
export declare const commandUtilityToolSpec: ToolSpec;

commonPortToolSpecs

Common Port Tool Specs constant exported by the common-tool-ports module.

  • Kind: constant
  • Import: import { commonPortToolSpecs } from '@codesoul-co/hypha-tools';
  • Source module: common-tool-ports

Declaration

text
export declare const commonPortToolSpecs: readonly [ToolSpec, ToolSpec, ToolSpec, ToolSpec, ToolSpec, ToolSpec, ToolSpec, ToolSpec];

fileUtilityToolSpec

File Utility Tool Spec constant exported by the common-tool-ports module.

  • Kind: constant
  • Import: import { fileUtilityToolSpec } from '@codesoul-co/hypha-tools';
  • Source module: common-tool-ports

Declaration

text
export declare const fileUtilityToolSpec: ToolSpec;

hashReferenceUtilityToolSpec

Hash Reference Utility Tool Spec constant exported by the common-tool-ports module.

  • Kind: constant
  • Import: import { hashReferenceUtilityToolSpec } from '@codesoul-co/hypha-tools';
  • Source module: common-tool-ports

Declaration

text
export declare const hashReferenceUtilityToolSpec: ToolSpec;

httpFetchUtilityToolSpec

Http Fetch Utility Tool Spec constant exported by the common-tool-ports module.

  • Kind: constant
  • Import: import { httpFetchUtilityToolSpec } from '@codesoul-co/hypha-tools';
  • Source module: common-tool-ports

Declaration

text
export declare const httpFetchUtilityToolSpec: ToolSpec;

mcpResourceUtilityToolSpec

MCP Resource Utility Tool Spec constant exported by the common-tool-ports module.

  • Kind: constant
  • Import: import { mcpResourceUtilityToolSpec } from '@codesoul-co/hypha-tools';
  • Source module: common-tool-ports

Declaration

text
export declare const mcpResourceUtilityToolSpec: ToolSpec;

memoryUtilityToolSpec

Memory Utility Tool Spec constant exported by the common-tool-ports module.

  • Kind: constant
  • Import: import { memoryUtilityToolSpec } from '@codesoul-co/hypha-tools';
  • Source module: common-tool-ports

Declaration

text
export declare const memoryUtilityToolSpec: ToolSpec;

searchUtilityToolSpec

Search Utility Tool Spec constant exported by the common-tool-ports module.

  • Kind: constant
  • Import: import { searchUtilityToolSpec } from '@codesoul-co/hypha-tools';
  • Source module: common-tool-ports

Declaration

text
export declare const searchUtilityToolSpec: ToolSpec;

createPortBackedCommonToolBindings

Create Port Backed Common Tool Bindings function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { createPortBackedCommonToolBindings } from '@codesoul-co/hypha-tools';
  • Source module: common-tool-ports

Declaration

text
export declare function createPortBackedCommonToolBindings(ports: CommonToolPorts): CommonToolBinding[];

Call signature

text
createPortBackedCommonToolBindings(ports: CommonToolPorts): CommonToolBinding[]

Parameters

ParameterTypeRequiredDescription
portsCommonToolPortsYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: CommonToolBinding[]
  • Description: The return contract is defined by the type shown above.

CommonToolBinding

Common Tool Binding interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { CommonToolBinding } from '@codesoul-co/hypha-tools';
  • Source module: common-tool-ports

Declaration

text
export interface CommonToolBinding {
    spec: ToolSpec;
    adapter: ToolAdapter;
}

Contract members

MemberKindSignatureDescription
adapterpropertyadapter: ToolAdapter<unknown, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
specpropertyspec: ToolSpecPublic property; its type, readonly modifier and optionality are shown in the signature.

CommonToolPort

Common Tool Port interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { CommonToolPort } from '@codesoul-co/hypha-tools';
  • Source module: common-tool-ports

Declaration

text
export interface CommonToolPort {
    execute(request: CommonToolPortRequest): Promise<unknown>;
}

Contract members

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

CommonToolPortRequest

Common Tool Port Request interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { CommonToolPortRequest } from '@codesoul-co/hypha-tools';
  • Source module: common-tool-ports

Declaration

text
export interface CommonToolPortRequest {
    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.

CommonToolPorts

Common Tool Ports interface with 8 public fields or methods.

  • Kind: interface
  • Import: import type { CommonToolPorts } from '@codesoul-co/hypha-tools';
  • Source module: common-tool-ports

Declaration

text
export interface CommonToolPorts {
    files: CommonToolPort;
    artifacts: CommonToolPort;
    httpFetch: CommonToolPort;
    search: CommonToolPort;
    memory: CommonToolPort;
    command: CommonToolPort;
    mcpResource: CommonToolPort;
    hashReference: CommonToolPort;
}

Contract members

MemberKindSignatureDescription
artifactspropertyartifacts: CommonToolPortPublic property; its type, readonly modifier and optionality are shown in the signature.
commandpropertycommand: CommonToolPortPublic property; its type, readonly modifier and optionality are shown in the signature.
filespropertyfiles: CommonToolPortPublic property; its type, readonly modifier and optionality are shown in the signature.
hashReferencepropertyhashReference: CommonToolPortPublic property; its type, readonly modifier and optionality are shown in the signature.
httpFetchpropertyhttpFetch: CommonToolPortPublic property; its type, readonly modifier and optionality are shown in the signature.
mcpResourcepropertymcpResource: CommonToolPortPublic property; its type, readonly modifier and optionality are shown in the signature.
memorypropertymemory: CommonToolPortPublic property; its type, readonly modifier and optionality are shown in the signature.
searchpropertysearch: CommonToolPortPublic property; its type, readonly modifier and optionality are shown in the signature.