Skip to content

@codesoul-co/hypha-tools / tool-families

Using this module

Use the Tool families module for using the public contracts and operations for this capability boundary. It exports 1 constant, 1 function, 2 interfaces.

Import from the package entrypoint

ts
import {
  governedToolFamilySpecs,
  createGovernedToolFamilyBindings,
} from '@codesoul-co/hypha-tools';

import type {
  GovernedToolFamilyBinding,
  GovernedToolFamilyPort,
} from '@codesoul-co/hypha-tools';

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

Public exports

SymbolKindSignatureDescription
governedToolFamilySpecsconstantconst governedToolFamilySpecs: readonly ToolSpec[]Governed Tool Family Specs constant exported by the tool-families module.
createGovernedToolFamilyBindingsfunctioncreateGovernedToolFamilyBindings(ports: Readonly<Record<string, GovernedToolFamilyPort>>): GovernedToolFamilyBinding[]Create Governed Tool Family Bindings function with 1 public call signature; parameters and return types are listed below.
GovernedToolFamilyBindinginterfaceinterface GovernedToolFamilyBindingGoverned Tool Family Binding interface with 2 public fields or methods.
GovernedToolFamilyPortinterfaceinterface GovernedToolFamilyPortGoverned Tool Family Port interface with 1 public fields or methods.

governedToolFamilySpecs

Governed Tool Family Specs constant exported by the tool-families module.

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

Declaration

text
export declare const governedToolFamilySpecs: readonly ToolSpec[];

createGovernedToolFamilyBindings

Create Governed Tool Family Bindings function with 1 public call signature; parameters and return types are listed below.

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

Declaration

text
export declare function createGovernedToolFamilyBindings(ports: Readonly<Record<string, GovernedToolFamilyPort>>): GovernedToolFamilyBinding[];

Call signature

text
createGovernedToolFamilyBindings(ports: Readonly<Record<string, GovernedToolFamilyPort>>): GovernedToolFamilyBinding[]

Parameters

ParameterTypeRequiredDescription
portsReadonly<Record<string, GovernedToolFamilyPort>>YesRequired parameter; accepted values are defined by the type column.

Returns

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

GovernedToolFamilyBinding

Governed Tool Family Binding interface with 2 public fields or methods.

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

Declaration

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

GovernedToolFamilyPort

Governed Tool Family Port interface with 1 public fields or methods.

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

Declaration

text
export interface GovernedToolFamilyPort {
    execute(input: {
        toolId: string;
        input: Record<string, unknown>;
        context: ToolCallContext;
    }): Promise<unknown>;
}

Contract members

MemberKindSignatureDescription
executemethodexecute(input: { toolId: string; input: Record<string, unknown>; context: ToolCallContext; }): Promise<unknown>Public method; parameters and return type are shown in the signature.