Skip to content

@codesoul-co/hypha-tools / contracts

Using this module

Use the Contracts module for declaring and runtime-validating contracts. It exports 38 constants, 4 functions, 32 interfaces, 2 types.

Import from the package entrypoint

ts
import {
  effectiveAgentCapabilitySnapshotSchema,
  effectiveCapabilityApprovalSchema,
  governedHumanApprovalDefinition,
  governedHumanApprovalExample,
  governedHumanApprovalJsonSchema,
  governedHumanApprovalPolicySpecSchema,
  governedHumanApprovalRequestSchema,
  governedToolContractDefinition,
} from '@codesoul-co/hypha-tools';

import type {
  EffectiveAgentCapabilitySnapshot,
  EffectiveCapabilityApproval,
  GovernedHumanApprovalPolicySpec,
  GovernedHumanApprovalRequest,
  GovernedToolContractSpec,
  GovernedToolInvocationRecord,
  HumanApprovalDecisionRecord,
  NormalizedToolError,
} from '@codesoul-co/hypha-tools';

// The complete export list is documented below.

Usage patterns

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

Runtime validation example

ts
import { effectiveAgentCapabilitySnapshotSchema } from '@codesoul-co/hypha-tools';

declare function loadExternalInput(): unknown;
const input: unknown = loadExternalInput();
const parsed = effectiveAgentCapabilitySnapshotSchema.parse(input);

Parse untrusted configuration, network, or persisted input with the runtime schema before passing it to functions or classes that expect a validated contract.

Public exports

SymbolKindSignatureDescription
effectiveAgentCapabilitySnapshotSchemaconstantconst effectiveAgentCapabilitySnapshotSchema: z.ZodObject<{ id: z.ZodString; runId: z.ZodString; agentId: z.ZodString; principalId: z.ZodString; tenantId: z.ZodOptional<z.ZodString>; domainId: z.ZodOptional<z.ZodString>; createdAt: z.ZodString; expiresAt: z.ZodOptional<z.ZodString>; skillRevisions: z.ZodArray<z.ZodObject<{ id: z.ZodString; version: z.ZodString; contentHash: z.ZodString; }, "strip", z.ZodTypeAny, {...Runtime schema for Effective Agent Capability Snapshot.
effectiveCapabilityApprovalSchemaconstantconst effectiveCapabilityApprovalSchema: z.ZodObject<{ taskId: z.ZodString; subjectType: z.ZodLiteral<"effective_capability_snapshot">; subjectHash: z.ZodString; snapshotId: z.ZodString; runId: z.ZodString; agentId: z.ZodString; principalId: z.ZodString; approvedBy: z.ZodString; approvedAt: z.ZodString; expiresAt: z.ZodString; status: z.ZodLiteral<"approved">; }, "strict", z.ZodTypeAny, { status: "approved"; runId...Runtime schema for Effective Capability Approval.
governedHumanApprovalDefinitionconstantconst governedHumanApprovalDefinition: SpecSchemaDefinition<GovernedHumanApprovalRequest>Governed Human Approval Definition constant exported by the contracts module.
governedHumanApprovalExampleconstantconst governedHumanApprovalExample: GovernedHumanApprovalRequestValid example value for Governed Human Approval.
governedHumanApprovalJsonSchemaconstantconst governedHumanApprovalJsonSchema: JsonSchemaJSON Schema for Governed Human Approval.
governedHumanApprovalPolicySpecSchemaconstantconst governedHumanApprovalPolicySpecSchema: z.ZodObject<{ mode: z.ZodEnum<["never", "policy", "always"]>; requiredForSideEffects: z.ZodOptional<z.ZodArray<z.ZodEnum<["none", "read", "write", "external_effect", "irreversible"]>, "many">>; approverRoles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; minApprovals: z.ZodOptional<z.ZodNumber>; expiresAfterSeconds: z.ZodOptional<z.ZodNumber>; allowParameterEdit: z.Zo...Runtime schema for Governed Human Approval Policy Spec.
governedHumanApprovalRequestSchemaconstantconst governedHumanApprovalRequestSchema: z.ZodObject<{ id: z.ZodString; revision: z.ZodNumber; invocationId: z.ZodString; toolRef: z.ZodObject<{ id: z.ZodString; version: z.ZodOptional<z.ZodString>; revision: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { id: string; version?: string | undefined; revision?: string | undefined; }, { id: string; version?: string | undefined; revision?: string | undefined; ...Runtime schema for Governed Human Approval Request.
governedToolContractDefinitionconstantconst governedToolContractDefinition: SpecSchemaDefinition<GovernedToolContractSpec>Governed Tool Contract Definition constant exported by the contracts module.
governedToolContractExampleconstantconst governedToolContractExample: GovernedToolContractSpecValid example value for Governed Tool Contract.
governedToolContractJsonSchemaconstantconst governedToolContractJsonSchema: JsonSchemaJSON Schema for Governed Tool Contract.
governedToolContractJsonSchemasconstantconst governedToolContractJsonSchemas: Record<string, JsonSchema>Governed Tool Contract JSON Schemas constant exported by the contracts module.
governedToolContractSpecSchemaconstantconst governedToolContractSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; revision: z.ZodString; name: z.ZodString; displayName: z.ZodOptional<z.ZodString>; description: z.ZodString; instructions: z.ZodOptional<z.ZodString>; tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; input: z.ZodObject<{ jsonSchema: z.ZodType<JsonSchema, z.ZodTypeDef, JsonSchema>; schemaId: z.ZodOptional<z.ZodString>; s...Runtime schema for Governed Tool Contract Spec.
governedToolInvocationDefinitionconstantconst governedToolInvocationDefinition: SpecSchemaDefinition<GovernedToolInvocationRecord>Governed Tool Invocation Definition constant exported by the contracts module.
governedToolInvocationExampleconstantconst governedToolInvocationExample: GovernedToolInvocationRecordValid example value for Governed Tool Invocation.
governedToolInvocationJsonSchemaconstantconst governedToolInvocationJsonSchema: JsonSchemaJSON Schema for Governed Tool Invocation.
governedToolInvocationRecordSchemaconstantconst governedToolInvocationRecordSchema: z.ZodObject<{ id: z.ZodString; revision: z.ZodNumber; operationId: z.ZodString; toolRef: z.ZodObject<{ id: z.ZodString; version: z.ZodOptional<z.ZodString>; revision: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { id: string; version?: string | undefined; revision?: string | undefined; }, { id: string; version?: string | undefined; revision?: string | undefined; }...Runtime schema for Governed Tool Invocation Record.
governedToolInvocationStatusSchemaconstantconst governedToolInvocationStatusSchema: z.ZodEnum<["created", "validating", "validated", "denied", "waiting_approval", "approved", "rejected", "queued", "running", "cancelling", "cancelled", "completed", "failed", "timed_out", "expired", "conflict"]>Runtime schema for Governed Tool Invocation Status.
normalizedToolErrorSchemaconstantconst normalizedToolErrorSchema: z.ZodObject<{ code: z.ZodEnum<["TOOL_NOT_FOUND", "TOOL_DISABLED", "TOOL_SCHEMA_INVALID", "TOOL_OUTPUT_INVALID", "TOOL_PERMISSION_DENIED", "TOOL_POLICY_DENIED", "TOOL_APPROVAL_REQUIRED", "TOOL_APPROVAL_REJECTED", "TOOL_APPROVAL_EXPIRED", "TOOL_IDEMPOTENCY_CONFLICT", "TOOL_CONCURRENCY_CONFLICT", "TOOL_TIMEOUT", "TOOL_CANCELLED", "TOOL_ADAPTER_UNAVAILABLE", "TOOL_RETRY_EXHAUSTED", "TO...Runtime schema for Normalized Tool Error.
providerHealthSchemaconstantconst providerHealthSchema: z.ZodObject<{ status: z.ZodEnum<["healthy", "degraded", "unhealthy", "unknown"]>; checkedAt: z.ZodString; latencyMs: z.ZodOptional<z.ZodNumber>; message: z.ZodOptional<z.ZodString>; details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, "strip", z.ZodTypeAny, { status: "unknown" | "healthy" | "degraded" | "unhealthy"; checkedAt: string; message?: string | undefined; latencyM...Runtime schema for Provider Health.
toolCachePolicySpecSchemaconstantconst toolCachePolicySpecSchema: z.ZodObject<{ mode: z.ZodEnum<["disabled", "result", "observation_ref"]>; ttlSeconds: z.ZodOptional<z.ZodNumber>; scope: z.ZodEnum<["run", "session", "workspace", "tenant"]>; keyFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; includeToolRevision: z.ZodBoolean; includePolicyRevision: z.ZodBoolean; allowForSideEffectLevels: z.ZodOptional<z.ZodArray<z.ZodEnum<["none", "read", ...Runtime schema for Tool Cache Policy Spec.
toolContractSnapshotDefinitionconstantconst toolContractSnapshotDefinition: SpecSchemaDefinition<ToolContractSnapshot>Tool Contract Snapshot Definition constant exported by the contracts module.
toolContractSnapshotExampleconstantconst toolContractSnapshotExample: ToolContractSnapshotValid example value for Tool Contract Snapshot.
toolContractSnapshotItemSchemaconstantconst toolContractSnapshotItemSchema: z.ZodObject<{ toolId: z.ZodString; toolVersion: z.ZodString; toolRevision: z.ZodString; inputSchemaHash: z.ZodString; outputSchemaHash: z.ZodOptional<z.ZodString>; sourceCapabilityHash: z.ZodOptional<z.ZodString>; sideEffectLevel: z.ZodEnum<["none", "read", "write", "external_effect", "irreversible"]>; adapterRef: z.ZodString; }, "strip", z.ZodTypeAny, { toolId: string; toolVe...Runtime schema for Tool Contract Snapshot Item.
toolContractSnapshotJsonSchemaconstantconst toolContractSnapshotJsonSchema: JsonSchemaJSON Schema for Tool Contract Snapshot.
toolContractSnapshotSchemaconstantconst toolContractSnapshotSchema: z.ZodObject<{ id: z.ZodString; runId: z.ZodString; createdAt: z.ZodString; toolContracts: z.ZodArray<z.ZodObject<{ toolId: z.ZodString; toolVersion: z.ZodString; toolRevision: z.ZodString; inputSchemaHash: z.ZodString; outputSchemaHash: z.ZodOptional<z.ZodString>; sourceCapabilityHash: z.ZodOptional<z.ZodString>; sideEffectLevel: z.ZodEnum<["none", "read", "write", "external_effec...Runtime schema for Tool Contract Snapshot.
toolEventPayloadBaseDefinitionconstantconst toolEventPayloadBaseDefinition: SpecSchemaDefinition<ToolEventPayloadBase>Tool Event Payload Base Definition constant exported by the contracts module.
toolEventPayloadBaseExampleconstantconst toolEventPayloadBaseExample: ToolEventPayloadBaseValid example value for Tool Event Payload Base.
toolEventPayloadBaseJsonSchemaconstantconst toolEventPayloadBaseJsonSchema: JsonSchemaJSON Schema for Tool Event Payload Base.
toolEventPayloadBaseSchemaconstantconst toolEventPayloadBaseSchema: z.ZodObject<{ invocationId: z.ZodOptional<z.ZodString>; operationId: z.ZodOptional<z.ZodString>; toolId: z.ZodOptional<z.ZodString>; toolVersion: z.ZodOptional<z.ZodString>; toolRevision: z.ZodOptional<z.ZodString>; contractSnapshotRef: z.ZodOptional<z.ZodString>; scopeHash: z.ZodOptional<z.ZodString>; principalId: z.ZodOptional<z.ZodString>; sideEffectLevel: z.ZodOptional<z.ZodEn...Runtime schema for Tool Event Payload Base.
toolExecutionContextSpecSchemaconstantconst toolExecutionContextSpecSchema: z.ZodObject<{ principal: z.ZodObject<{ principalId: z.ZodString; type: z.ZodEnum<["user", "agent", "service", "system"]>; tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodOptional<z.ZodString>; workspaceId: z.ZodOptional<z.ZodString>; agentId: z.ZodOptional<z.ZodString>; roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; permissionScopes: z.ZodArray<z.ZodString, "many">;...Runtime schema for Tool Execution Context Spec.
toolExecutionPolicySpecSchemaconstantconst toolExecutionPolicySpecSchema: z.ZodObject<{ timeout: z.ZodObject<{ timeoutMs: z.ZodNumber; onTimeout: z.ZodOptional<z.ZodEnum<["fail", "retry", "human_review"]>>; }, "strip", z.ZodTypeAny, { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; }, { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; }>; retry: z.ZodObject<{ maxAttempts: z.ZodNumber; backoff...Runtime schema for Tool Execution Policy Spec.
toolGovernanceSpecSchemaconstantconst toolGovernanceSpecSchema: z.ZodObject<{ requiredPermissionScopes: z.ZodArray<z.ZodString, "many">; deniedPermissionScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; allowedPrincipalTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["user", "agent", "service", "system"]>, "many">>; policyRefs: z.ZodOptional<z.ZodArray<z.ZodObject<{ id: z.ZodString; version: z.ZodOptional<z.ZodString>; revision: z.ZodOptional<z....Runtime schema for Tool Governance Spec.
toolInvocationScopeSpecSchemaconstantconst toolInvocationScopeSpecSchema: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; workspaceId: z.ZodOptional<z.ZodString>; sessionId: z.ZodString; runId: z.ZodString; stepId: z.ZodOptional<z.ZodString>; agentId: z.ZodOptional<z.ZodString>; fsmState: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { runId: string; userId: string; sessionId: string; agentId?: string | undefined; ten...Runtime schema for Tool Invocation Scope Spec.
toolObservabilitySpecSchemaconstantconst toolObservabilitySpecSchema: z.ZodObject<{ traceLevel: z.ZodEnum<["none", "metadata", "summary", "full_redacted"]>; recordInput: z.ZodOptional<z.ZodBoolean>; recordOutput: z.ZodOptional<z.ZodBoolean>; recordAttempts: z.ZodOptional<z.ZodBoolean>; recordPolicyDecision: z.ZodOptional<z.ZodBoolean>; metricsEnabled: z.ZodOptional<z.ZodBoolean>; redactionPolicyRef: z.ZodOptional<z.ZodObject<{ id: z.ZodString; vers...Runtime schema for Tool Observability Spec.
toolPrincipalSpecSchemaconstantconst toolPrincipalSpecSchema: z.ZodObject<{ principalId: z.ZodString; type: z.ZodEnum<["user", "agent", "service", "system"]>; tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodOptional<z.ZodString>; workspaceId: z.ZodOptional<z.ZodString>; agentId: z.ZodOptional<z.ZodString>; roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; permissionScopes: z.ZodArray<z.ZodString, "many">; delegatedBy: z.ZodOptional<z.Zo...Runtime schema for Tool Principal Spec.
toolSchemaSpecSchemaconstantconst toolSchemaSpecSchema: z.ZodObject<{ jsonSchema: z.ZodType<JsonSchema, z.ZodTypeDef, JsonSchema>; schemaId: z.ZodOptional<z.ZodString>; schemaVersion: z.ZodOptional<z.ZodString>; schemaHash: z.ZodString; strict: z.ZodOptional<z.ZodBoolean>; allowAdditionalProperties: z.ZodOptional<z.ZodBoolean>; maxSerializedBytes: z.ZodOptional<z.ZodNumber>; sensitivePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; red...Runtime schema for Tool Schema Spec.
toolSemanticSpecSchemaconstantconst toolSemanticSpecSchema: z.ZodType<ToolSemanticSpec, z.ZodTypeDef, ToolSemanticSpec>Runtime schema for Tool Semantic Spec.
toolSourceRefSchemaconstantconst toolSourceRefSchema: z.ZodObject<{ adapterId: z.ZodOptional<z.ZodString>; handlerId: z.ZodOptional<z.ZodString>; endpointRef: z.ZodOptional<z.ZodString>; mcpServerId: z.ZodOptional<z.ZodString>; mcpCapabilityId: z.ZodOptional<z.ZodString>; mcpCapabilityHash: z.ZodOptional<z.ZodString>; pluginId: z.ZodOptional<z.ZodString>; hostedToolId: z.ZodOptional<z.ZodString>; metadata: z.ZodOptional<z.ZodRecord<z.ZodStr...Runtime schema for Tool Source Ref.
canonicalJsonfunctioncanonicalJson(value: unknown): stringCanonical JSON function with 1 public call signature; parameters and return types are listed below.
createToolCacheValidityKeyfunctioncreateToolCacheValidityKey(input: ToolCacheValidityInput): stringCreate Tool Cache Validity Key function with 1 public call signature; parameters and return types are listed below.
createToolSchemaSpecfunctioncreateToolSchemaSpec(jsonSchema: JsonSchema, options?: Omit<Partial<ToolSchemaSpec>, "jsonSchema" | "schemaHash">): ToolSchemaSpecCreate Tool Schema Spec function with 1 public call signature; parameters and return types are listed below.
hashToolContractfunctionhashToolContract(value: unknown): stringHash Tool Contract function with 1 public call signature; parameters and return types are listed below.
EffectiveAgentCapabilitySnapshotinterfaceinterface EffectiveAgentCapabilitySnapshotEffective Agent Capability Snapshot interface with 17 public fields or methods.
EffectiveCapabilityApprovalinterfaceinterface EffectiveCapabilityApprovalEffective Capability Approval interface with 11 public fields or methods.
GovernedHumanApprovalPolicySpecinterfaceinterface GovernedHumanApprovalPolicySpecGoverned Human Approval Policy Spec interface with 9 public fields or methods.
GovernedHumanApprovalRequestinterfaceinterface GovernedHumanApprovalRequestGoverned Human Approval Request interface with 19 public fields or methods.
GovernedToolContractSpecinterfaceinterface GovernedToolContractSpecGoverned Tool Contract Spec interface with 22 public fields or methods.
GovernedToolInvocationRecordinterfaceinterface GovernedToolInvocationRecordGoverned Tool Invocation Record interface with 35 public fields or methods.
HumanApprovalDecisionRecordinterfaceinterface HumanApprovalDecisionRecordHuman Approval Decision Record interface with 5 public fields or methods.
NormalizedToolErrorinterfaceinterface NormalizedToolErrorNormalized Tool Error interface with 7 public fields or methods.
ProviderHealthinterfaceinterface ProviderHealthProvider Health interface with 5 public fields or methods.
ToolArtifactContractinterfaceinterface ToolArtifactContractTool Artifact Contract interface with 4 public fields or methods.
ToolCachePolicySpecinterfaceinterface ToolCachePolicySpecTool Cache Policy Spec interface with 8 public fields or methods.
ToolCacheValidityInputinterfaceinterface ToolCacheValidityInputTool Cache Validity Input interface with 8 public fields or methods.
ToolCacheValidityRecordinterfaceinterface ToolCacheValidityRecord extends ToolCacheValidityInputTool Cache Validity Record interface with 10 public fields or methods.
ToolCancellationPolicySpecinterfaceinterface ToolCancellationPolicySpecTool Cancellation Policy Spec interface with 2 public fields or methods.
ToolConcurrencyPolicySpecinterfaceinterface ToolConcurrencyPolicySpecTool Concurrency Policy Spec interface with 3 public fields or methods.
ToolContractSnapshotinterfaceinterface ToolContractSnapshotTool Contract Snapshot interface with 8 public fields or methods.
ToolContractSnapshotIteminterfaceinterface ToolContractSnapshotItemTool Contract Snapshot Item interface with 8 public fields or methods.
ToolContractSnapshotStoreinterfaceinterface ToolContractSnapshotStoreTool Contract Snapshot Store interface with 2 public fields or methods.
ToolEventPayloadBaseinterfaceinterface ToolEventPayloadBaseTool Event Payload Base interface with 15 public fields or methods.
ToolExecutionContextSpecinterfaceinterface ToolExecutionContextSpecTool Execution Context Spec interface with 21 public fields or methods.
ToolExecutionPolicySpecinterfaceinterface ToolExecutionPolicySpecTool Execution Policy Spec interface with 7 public fields or methods.
ToolExternalReceiptinterfaceinterface ToolExternalReceiptTool External Receipt interface with 5 public fields or methods.
ToolGovernanceSpecinterfaceinterface ToolGovernanceSpecTool Governance Spec interface with 10 public fields or methods.
ToolInvocationScopeSpecinterfaceinterface ToolInvocationScopeSpecTool Invocation Scope Spec interface with 8 public fields or methods.
ToolLateResultPolicySpecinterfaceinterface ToolLateResultPolicySpecTool Late Result Policy Spec interface with 2 public fields or methods.
ToolObservabilitySpecinterfaceinterface ToolObservabilitySpecTool Observability Spec interface with 7 public fields or methods.
ToolOutputLimitSpecinterfaceinterface ToolOutputLimitSpecTool Output Limit Spec interface with 2 public fields or methods.
ToolPrincipalSpecinterfaceinterface ToolPrincipalSpecTool Principal Spec interface with 12 public fields or methods.
ToolSchemaSpecinterfaceinterface ToolSchemaSpecTool Schema Spec interface with 9 public fields or methods.
ToolSemanticSpecinterfaceinterface ToolSemanticSpecTool Semantic Spec interface with 10 public fields or methods.
ToolSourceRefinterfaceinterface ToolSourceRefTool Source Ref interface with 9 public fields or methods.
ToolStreamingSpecinterfaceinterface ToolStreamingSpecTool Streaming Spec interface with 4 public fields or methods.
GovernedToolInvocationStatustypetype GovernedToolInvocationStatus = 'created' | 'validating' | 'validated' | 'denied' | 'waiting_approval' | 'approved' | 'rejected' | 'queued' | 'running' | 'cancelling' | 'cancelled' | 'completed' | 'failed' | 'timed_out' | 'expired' | 'conflict'Public type alias for Governed Tool Invocation Status; the declaration contains its complete type expression.
ToolSourcetypetype ToolSource = 'local' | 'mcp' | 'http' | 'plugin' | 'hosted' | 'execution' | 'custom'Public type alias for Tool Source; the declaration contains its complete type expression.

effectiveAgentCapabilitySnapshotSchema

Runtime schema for Effective Agent Capability Snapshot.

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

Declaration

text
export declare const effectiveAgentCapabilitySnapshotSchema: z.ZodObject<{ id: z.ZodString; runId: z.ZodString; agentId: z.ZodString; principalId: z.ZodString; tenantId: z.ZodOptional<z.ZodString>; domainId: z.ZodOptional<z.ZodString>; createdAt: z.ZodString; expiresAt: z.ZodOptional<z.ZodString>; skillRevisions: z.ZodArray<z.ZodObject<{ id: z.ZodString; version: z.ZodString; contentHash: z.ZodString; }, "strip", z.ZodTypeAny, { id: string; version: string; contentHash: string; }, { id: string; version: string; contentHash: string; }>, "many">; allowedToolIds: z.ZodArray<z.ZodString, "many">; allowedMCPServerIds: z.ZodArray<z.ZodString, "many">; memoryAccess: z.ZodEnum<["none", "read", "write", "read_write"]>; allowedExecutionProfiles: z.ZodArray<z.ZodString, "many">; maximumSideEffectLevel: z.ZodEnum<["none", "read", "write", "external_effect", "irreversible"]>; requiresHumanReview: z.ZodBoolean; policyRefs: z.ZodArray<z.ZodString, "many">; snapshotHash: z.ZodString; }, "strip", z.ZodTypeAny, { id: string; policyRefs: string[]; runId: string; agentId: string; principalId: string; createdAt: string; skillRevisions: { id: string; version: string; contentHash: string; }[]; allowedToolIds: string[]; allowedMCPServerIds: string[]; memoryAccess: "none" | "read" | "write" | "read_write"; allowedExecutionProfiles: string[]; maximumSideEffectLevel: "none" | "read" | "write" | "external_effect" | "irreversible"; requiresHumanReview: boolean; snapshotHash: string; tenantId?: string | undefined; domainId?: string | undefined; expiresAt?: string | undefined; }, { id: string; policyRefs: string[]; runId: string; agentId: string; principalId: string; createdAt: string; skillRevisions: { id: string; version: string; contentHash: string; }[]; allowedToolIds: string[]; allowedMCPServerIds: string[]; memoryAccess: "none" | "read" | "write" | "read_write"; allowedExecutionProfiles: string[]; maximumSideEffectLevel: "none" | "read" | "write" | "external_effect" | "irreversible"; requiresHumanReview: boolean; snapshotHash: string; tenantId?: string | undefined; domainId?: string | undefined; expiresAt?: string | undefined; }>;

effectiveCapabilityApprovalSchema

Runtime schema for Effective Capability Approval.

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

Declaration

text
export declare const effectiveCapabilityApprovalSchema: z.ZodObject<{ taskId: z.ZodString; subjectType: z.ZodLiteral<"effective_capability_snapshot">; subjectHash: z.ZodString; snapshotId: z.ZodString; runId: z.ZodString; agentId: z.ZodString; principalId: z.ZodString; approvedBy: z.ZodString; approvedAt: z.ZodString; expiresAt: z.ZodString; status: z.ZodLiteral<"approved">; }, "strict", z.ZodTypeAny, { status: "approved"; runId: string; agentId: string; principalId: string; expiresAt: string; taskId: string; subjectType: "effective_capability_snapshot"; subjectHash: string; snapshotId: string; approvedBy: string; approvedAt: string; }, { status: "approved"; runId: string; agentId: string; principalId: string; expiresAt: string; taskId: string; subjectType: "effective_capability_snapshot"; subjectHash: string; snapshotId: string; approvedBy: string; approvedAt: string; }>;

governedHumanApprovalDefinition

Governed Human Approval Definition constant exported by the contracts module.

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

Declaration

text
export declare const governedHumanApprovalDefinition: SpecSchemaDefinition<GovernedHumanApprovalRequest>;

governedHumanApprovalExample

Valid example value for Governed Human Approval.

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

Declaration

text
export declare const governedHumanApprovalExample: GovernedHumanApprovalRequest;

governedHumanApprovalJsonSchema

JSON Schema for Governed Human Approval.

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

Declaration

text
export declare const governedHumanApprovalJsonSchema: JsonSchema;

governedHumanApprovalPolicySpecSchema

Runtime schema for Governed Human Approval Policy Spec.

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

Declaration

text
export declare const governedHumanApprovalPolicySpecSchema: z.ZodObject<{ mode: z.ZodEnum<["never", "policy", "always"]>; requiredForSideEffects: z.ZodOptional<z.ZodArray<z.ZodEnum<["none", "read", "write", "external_effect", "irreversible"]>, "many">>; approverRoles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; minApprovals: z.ZodOptional<z.ZodNumber>; expiresAfterSeconds: z.ZodOptional<z.ZodNumber>; allowParameterEdit: z.ZodOptional<z.ZodBoolean>; requireReason: z.ZodOptional<z.ZodBoolean>; revalidateOnResume: z.ZodOptional<z.ZodBoolean>; escalationPolicyRef: z.ZodOptional<z.ZodObject<{ id: z.ZodString; version: z.ZodOptional<z.ZodString>; revision: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { id: string; version?: string | undefined; revision?: string | undefined; }, { id: string; version?: string | undefined; revision?: string | undefined; }>>; }, "strip", z.ZodTypeAny, { mode: "never" | "policy" | "always"; requiredForSideEffects?: ("none" | "read" | "write" | "external_effect" | "irreversible")[] | undefined; approverRoles?: string[] | undefined; minApprovals?: number | undefined; expiresAfterSeconds?: number | undefined; allowParameterEdit?: boolean | undefined; requireReason?: boolean | undefined; revalidateOnResume?: boolean | undefined; escalationPolicyRef?: { id: string; version?: string | undefined; revision?: string | undefined; } | undefined; }, { mode: "never" | "policy" | "always"; requiredForSideEffects?: ("none" | "read" | "write" | "external_effect" | "irreversible")[] | undefined; approverRoles?: string[] | undefined; minApprovals?: number | undefined; expiresAfterSeconds?: number | undefined; allowParameterEdit?: boolean | undefined; requireReason?: boolean | undefined; revalidateOnResume?: boolean | undefined; escalationPolicyRef?: { id: string; version?: string | undefined; revision?: string | undefined; } | undefined; }>;

governedHumanApprovalRequestSchema

Runtime schema for Governed Human Approval Request.

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

Declaration

text
// Exact type resolved from the package entrypoint; see source for the compiler expansion.
export declare const governedHumanApprovalRequestSchema: (typeof import('@codesoul-co/hypha-tools'))['governedHumanApprovalRequestSchema'];

This compiler-expanded constant type is compacted. Its public name, top-level type, and source location remain here; use the module’s exported interfaces, types, or runtime schema for input/output fields.

governedToolContractDefinition

Governed Tool Contract Definition constant exported by the contracts module.

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

Declaration

text
export declare const governedToolContractDefinition: SpecSchemaDefinition<GovernedToolContractSpec>;

governedToolContractExample

Valid example value for Governed Tool Contract.

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

Declaration

text
export declare const governedToolContractExample: GovernedToolContractSpec;

governedToolContractJsonSchema

JSON Schema for Governed Tool Contract.

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

Declaration

text
export declare const governedToolContractJsonSchema: JsonSchema;

governedToolContractJsonSchemas

Governed Tool Contract JSON Schemas constant exported by the contracts module.

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

Declaration

text
export declare const governedToolContractJsonSchemas: Record<string, JsonSchema>;

governedToolContractSpecSchema

Runtime schema for Governed Tool Contract Spec.

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

Declaration

text
// Exact type resolved from the package entrypoint; see source for the compiler expansion.
export declare const governedToolContractSpecSchema: (typeof import('@codesoul-co/hypha-tools'))['governedToolContractSpecSchema'];

This compiler-expanded constant type is compacted. Its public name, top-level type, and source location remain here; use the module’s exported interfaces, types, or runtime schema for input/output fields.

governedToolInvocationDefinition

Governed Tool Invocation Definition constant exported by the contracts module.

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

Declaration

text
export declare const governedToolInvocationDefinition: SpecSchemaDefinition<GovernedToolInvocationRecord>;

governedToolInvocationExample

Valid example value for Governed Tool Invocation.

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

Declaration

text
export declare const governedToolInvocationExample: GovernedToolInvocationRecord;

governedToolInvocationJsonSchema

JSON Schema for Governed Tool Invocation.

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

Declaration

text
export declare const governedToolInvocationJsonSchema: JsonSchema;

governedToolInvocationRecordSchema

Runtime schema for Governed Tool Invocation Record.

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

Declaration

text
// Exact type resolved from the package entrypoint; see source for the compiler expansion.
export declare const governedToolInvocationRecordSchema: (typeof import('@codesoul-co/hypha-tools'))['governedToolInvocationRecordSchema'];

This compiler-expanded constant type is compacted. Its public name, top-level type, and source location remain here; use the module’s exported interfaces, types, or runtime schema for input/output fields.

governedToolInvocationStatusSchema

Runtime schema for Governed Tool Invocation Status.

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

Declaration

text
export declare const governedToolInvocationStatusSchema: z.ZodEnum<["created", "validating", "validated", "denied", "waiting_approval", "approved", "rejected", "queued", "running", "cancelling", "cancelled", "completed", "failed", "timed_out", "expired", "conflict"]>;

normalizedToolErrorSchema

Runtime schema for Normalized Tool Error.

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

Declaration

text
export declare const normalizedToolErrorSchema: z.ZodObject<{ code: z.ZodEnum<["TOOL_NOT_FOUND", "TOOL_DISABLED", "TOOL_SCHEMA_INVALID", "TOOL_OUTPUT_INVALID", "TOOL_PERMISSION_DENIED", "TOOL_POLICY_DENIED", "TOOL_APPROVAL_REQUIRED", "TOOL_APPROVAL_REJECTED", "TOOL_APPROVAL_EXPIRED", "TOOL_IDEMPOTENCY_CONFLICT", "TOOL_CONCURRENCY_CONFLICT", "TOOL_TIMEOUT", "TOOL_CANCELLED", "TOOL_ADAPTER_UNAVAILABLE", "TOOL_RETRY_EXHAUSTED", "TOOL_LATE_RESULT", "TOOL_EXECUTION_FAILED", "TOOL_INTERNAL_ERROR"]>; message: z.ZodString; retryable: z.ZodBoolean; attempt: z.ZodOptional<z.ZodNumber>; providerCode: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; causeRef: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { code: "TOOL_NOT_FOUND" | "TOOL_DISABLED" | "TOOL_SCHEMA_INVALID" | "TOOL_OUTPUT_INVALID" | "TOOL_PERMISSION_DENIED" | "TOOL_POLICY_DENIED" | "TOOL_APPROVAL_REQUIRED" | "TOOL_APPROVAL_REJECTED" | "TOOL_APPROVAL_EXPIRED" | "TOOL_IDEMPOTENCY_CONFLICT" | "TOOL_CONCURRENCY_CONFLICT" | "TOOL_TIMEOUT" | "TOOL_CANCELLED" | "TOOL_ADAPTER_UNAVAILABLE" | "TOOL_RETRY_EXHAUSTED" | "TOOL_LATE_RESULT" | "TOOL_EXECUTION_FAILED" | "TOOL_INTERNAL_ERROR"; message: string; retryable: boolean; details?: Record<string, unknown> | undefined; attempt?: number | undefined; providerCode?: string | number | undefined; causeRef?: string | undefined; }, { code: "TOOL_NOT_FOUND" | "TOOL_DISABLED" | "TOOL_SCHEMA_INVALID" | "TOOL_OUTPUT_INVALID" | "TOOL_PERMISSION_DENIED" | "TOOL_POLICY_DENIED" | "TOOL_APPROVAL_REQUIRED" | "TOOL_APPROVAL_REJECTED" | "TOOL_APPROVAL_EXPIRED" | "TOOL_IDEMPOTENCY_CONFLICT" | "TOOL_CONCURRENCY_CONFLICT" | "TOOL_TIMEOUT" | "TOOL_CANCELLED" | "TOOL_ADAPTER_UNAVAILABLE" | "TOOL_RETRY_EXHAUSTED" | "TOOL_LATE_RESULT" | "TOOL_EXECUTION_FAILED" | "TOOL_INTERNAL_ERROR"; message: string; retryable: boolean; details?: Record<string, unknown> | undefined; attempt?: number | undefined; providerCode?: string | number | undefined; causeRef?: string | undefined; }>;

providerHealthSchema

Runtime schema for Provider Health.

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

Declaration

text
export declare const providerHealthSchema: z.ZodObject<{ status: z.ZodEnum<["healthy", "degraded", "unhealthy", "unknown"]>; checkedAt: z.ZodString; latencyMs: z.ZodOptional<z.ZodNumber>; message: z.ZodOptional<z.ZodString>; details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, "strip", z.ZodTypeAny, { status: "unknown" | "healthy" | "degraded" | "unhealthy"; checkedAt: string; message?: string | undefined; latencyMs?: number | undefined; details?: Record<string, unknown> | undefined; }, { status: "unknown" | "healthy" | "degraded" | "unhealthy"; checkedAt: string; message?: string | undefined; latencyMs?: number | undefined; details?: Record<string, unknown> | undefined; }>;

toolCachePolicySpecSchema

Runtime schema for Tool Cache Policy Spec.

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

Declaration

text
export declare const toolCachePolicySpecSchema: z.ZodObject<{ mode: z.ZodEnum<["disabled", "result", "observation_ref"]>; ttlSeconds: z.ZodOptional<z.ZodNumber>; scope: z.ZodEnum<["run", "session", "workspace", "tenant"]>; keyFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; includeToolRevision: z.ZodBoolean; includePolicyRevision: z.ZodBoolean; allowForSideEffectLevels: z.ZodOptional<z.ZodArray<z.ZodEnum<["none", "read", "write", "external_effect", "irreversible"]>, "many">>; staleWhileRevalidateSeconds: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { mode: "disabled" | "result" | "observation_ref"; scope: "run" | "session" | "workspace" | "tenant"; includeToolRevision: boolean; includePolicyRevision: boolean; keyFields?: string[] | undefined; ttlSeconds?: number | undefined; allowForSideEffectLevels?: ("none" | "read" | "write" | "external_effect" | "irreversible")[] | undefined; staleWhileRevalidateSeconds?: number | undefined; }, { mode: "disabled" | "result" | "observation_ref"; scope: "run" | "session" | "workspace" | "tenant"; includeToolRevision: boolean; includePolicyRevision: boolean; keyFields?: string[] | undefined; ttlSeconds?: number | undefined; allowForSideEffectLevels?: ("none" | "read" | "write" | "external_effect" | "irreversible")[] | undefined; staleWhileRevalidateSeconds?: number | undefined; }>;

toolContractSnapshotDefinition

Tool Contract Snapshot Definition constant exported by the contracts module.

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

Declaration

text
export declare const toolContractSnapshotDefinition: SpecSchemaDefinition<ToolContractSnapshot>;

toolContractSnapshotExample

Valid example value for Tool Contract Snapshot.

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

Declaration

text
export declare const toolContractSnapshotExample: ToolContractSnapshot;

toolContractSnapshotItemSchema

Runtime schema for Tool Contract Snapshot Item.

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

Declaration

text
export declare const toolContractSnapshotItemSchema: z.ZodObject<{ toolId: z.ZodString; toolVersion: z.ZodString; toolRevision: z.ZodString; inputSchemaHash: z.ZodString; outputSchemaHash: z.ZodOptional<z.ZodString>; sourceCapabilityHash: z.ZodOptional<z.ZodString>; sideEffectLevel: z.ZodEnum<["none", "read", "write", "external_effect", "irreversible"]>; adapterRef: z.ZodString; }, "strip", z.ZodTypeAny, { toolId: string; toolVersion: string; toolRevision: string; inputSchemaHash: string; sideEffectLevel: "none" | "read" | "write" | "external_effect" | "irreversible"; adapterRef: string; outputSchemaHash?: string | undefined; sourceCapabilityHash?: string | undefined; }, { toolId: string; toolVersion: string; toolRevision: string; inputSchemaHash: string; sideEffectLevel: "none" | "read" | "write" | "external_effect" | "irreversible"; adapterRef: string; outputSchemaHash?: string | undefined; sourceCapabilityHash?: string | undefined; }>;

toolContractSnapshotJsonSchema

JSON Schema for Tool Contract Snapshot.

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

Declaration

text
export declare const toolContractSnapshotJsonSchema: JsonSchema;

toolContractSnapshotSchema

Runtime schema for Tool Contract Snapshot.

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

Declaration

text
// Exact type resolved from the package entrypoint; see source for the compiler expansion.
export declare const toolContractSnapshotSchema: (typeof import('@codesoul-co/hypha-tools'))['toolContractSnapshotSchema'];

This compiler-expanded constant type is compacted. Its public name, top-level type, and source location remain here; use the module’s exported interfaces, types, or runtime schema for input/output fields.

toolEventPayloadBaseDefinition

Tool Event Payload Base Definition constant exported by the contracts module.

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

Declaration

text
export declare const toolEventPayloadBaseDefinition: SpecSchemaDefinition<ToolEventPayloadBase>;

toolEventPayloadBaseExample

Valid example value for Tool Event Payload Base.

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

Declaration

text
export declare const toolEventPayloadBaseExample: ToolEventPayloadBase;

toolEventPayloadBaseJsonSchema

JSON Schema for Tool Event Payload Base.

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

Declaration

text
export declare const toolEventPayloadBaseJsonSchema: JsonSchema;

toolEventPayloadBaseSchema

Runtime schema for Tool Event Payload Base.

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

Declaration

text
// Exact type resolved from the package entrypoint; see source for the compiler expansion.
export declare const toolEventPayloadBaseSchema: (typeof import('@codesoul-co/hypha-tools'))['toolEventPayloadBaseSchema'];

This compiler-expanded constant type is compacted. Its public name, top-level type, and source location remain here; use the module’s exported interfaces, types, or runtime schema for input/output fields.

toolExecutionContextSpecSchema

Runtime schema for Tool Execution Context Spec.

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

Declaration

text
// Exact type resolved from the package entrypoint; see source for the compiler expansion.
export declare const toolExecutionContextSpecSchema: (typeof import('@codesoul-co/hypha-tools'))['toolExecutionContextSpecSchema'];

This compiler-expanded constant type is compacted. Its public name, top-level type, and source location remain here; use the module’s exported interfaces, types, or runtime schema for input/output fields.

toolExecutionPolicySpecSchema

Runtime schema for Tool Execution Policy Spec.

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

Declaration

text
// Exact type resolved from the package entrypoint; see source for the compiler expansion.
export declare const toolExecutionPolicySpecSchema: (typeof import('@codesoul-co/hypha-tools'))['toolExecutionPolicySpecSchema'];

This compiler-expanded constant type is compacted. Its public name, top-level type, and source location remain here; use the module’s exported interfaces, types, or runtime schema for input/output fields.

toolGovernanceSpecSchema

Runtime schema for Tool Governance Spec.

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

Declaration

text
export declare const toolGovernanceSpecSchema: z.ZodObject<{ requiredPermissionScopes: z.ZodArray<z.ZodString, "many">; deniedPermissionScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; allowedPrincipalTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["user", "agent", "service", "system"]>, "many">>; policyRefs: z.ZodOptional<z.ZodArray<z.ZodObject<{ id: z.ZodString; version: z.ZodOptional<z.ZodString>; revision: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { id: string; version?: string | undefined; revision?: string | undefined; }, { id: string; version?: string | undefined; revision?: string | undefined; }>, "many">>; approvalPolicy: z.ZodOptional<z.ZodObject<{ required: z.ZodBoolean; reason: z.ZodOptional<z.ZodString>; approverRole: z.ZodOptional<z.ZodString>; timeoutPolicy: z.ZodOptional<z.ZodObject<{ timeoutMs: z.ZodNumber; onTimeout: z.ZodOptional<z.ZodEnum<["fail", "retry", "human_review"]>>; }, "strip", z.ZodTypeAny, { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; }, { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; }>>; }, "strip", z.ZodTypeAny, { required: boolean; reason?: string | undefined; approverRole?: string | undefined; timeoutPolicy?: { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; } | undefined; }, { required: boolean; reason?: string | undefined; approverRole?: string | undefined; timeoutPolicy?: { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; } | undefined; }>>; auditPolicy: z.ZodObject<{ enabled: z.ZodBoolean; includeInput: z.ZodOptional<z.ZodBoolean>; includeOutput: z.ZodOptional<z.ZodBoolean>; redactPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { enabled: boolean; includeInput?: boolean | undefined; includeOutput?: boolean | undefined; redactPaths?: string[] | undefined; }, { enabled: boolean; includeInput?: boolean | undefined; includeOutput?: boolean | undefined; redactPaths?: string[] | undefined; }>; tenantIsolation: z.ZodOptional<z.ZodBoolean>; workspaceIsolation: z.ZodOptional<z.ZodBoolean>; allowDelegation: z.ZodOptional<z.ZodBoolean>; maxDelegationDepth: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { requiredPermissionScopes: string[]; auditPolicy: { enabled: boolean; includeInput?: boolean | undefined; includeOutput?: boolean | undefined; redactPaths?: string[] | undefined; }; deniedPermissionScopes?: string[] | undefined; allowedPrincipalTypes?: ("user" | "agent" | "service" | "system")[] | undefined; policyRefs?: { id: string; version?: string | undefined; revision?: string | undefined; }[] | undefined; approvalPolicy?: { required: boolean; reason?: string | undefined; approverRole?: string | undefined; timeoutPolicy?: { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; } | undefined; } | undefined; tenantIsolation?: boolean | undefined; workspaceIsolation?: boolean | undefined; allowDelegation?: boolean | undefined; maxDelegationDepth?: number | undefined; }, { requiredPermissionScopes: string[]; auditPolicy: { enabled: boolean; includeInput?: boolean | undefined; includeOutput?: boolean | undefined; redactPaths?: string[] | undefined; }; deniedPermissionScopes?: string[] | undefined; allowedPrincipalTypes?: ("user" | "agent" | "service" | "system")[] | undefined; policyRefs?: { id: string; version?: string | undefined; revision?: string | undefined; }[] | undefined; approvalPolicy?: { required: boolean; reason?: string | undefined; approverRole?: string | undefined; timeoutPolicy?: { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; } | undefined; } | undefined; tenantIsolation?: boolean | undefined; workspaceIsolation?: boolean | undefined; allowDelegation?: boolean | undefined; maxDelegationDepth?: number | undefined; }>;

toolInvocationScopeSpecSchema

Runtime schema for Tool Invocation Scope Spec.

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

Declaration

text
export declare const toolInvocationScopeSpecSchema: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; workspaceId: z.ZodOptional<z.ZodString>; sessionId: z.ZodString; runId: z.ZodString; stepId: z.ZodOptional<z.ZodString>; agentId: z.ZodOptional<z.ZodString>; fsmState: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { runId: string; userId: string; sessionId: string; agentId?: string | undefined; tenantId?: string | undefined; workspaceId?: string | undefined; stepId?: string | undefined; fsmState?: string | undefined; }, { runId: string; userId: string; sessionId: string; agentId?: string | undefined; tenantId?: string | undefined; workspaceId?: string | undefined; stepId?: string | undefined; fsmState?: string | undefined; }>;

toolObservabilitySpecSchema

Runtime schema for Tool Observability Spec.

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

Declaration

text
export declare const toolObservabilitySpecSchema: z.ZodObject<{ traceLevel: z.ZodEnum<["none", "metadata", "summary", "full_redacted"]>; recordInput: z.ZodOptional<z.ZodBoolean>; recordOutput: z.ZodOptional<z.ZodBoolean>; recordAttempts: z.ZodOptional<z.ZodBoolean>; recordPolicyDecision: z.ZodOptional<z.ZodBoolean>; metricsEnabled: z.ZodOptional<z.ZodBoolean>; redactionPolicyRef: z.ZodOptional<z.ZodObject<{ id: z.ZodString; version: z.ZodOptional<z.ZodString>; revision: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { id: string; version?: string | undefined; revision?: string | undefined; }, { id: string; version?: string | undefined; revision?: string | undefined; }>>; }, "strip", z.ZodTypeAny, { traceLevel: "metadata" | "none" | "summary" | "full_redacted"; recordInput?: boolean | undefined; recordOutput?: boolean | undefined; recordAttempts?: boolean | undefined; recordPolicyDecision?: boolean | undefined; metricsEnabled?: boolean | undefined; redactionPolicyRef?: { id: string; version?: string | undefined; revision?: string | undefined; } | undefined; }, { traceLevel: "metadata" | "none" | "summary" | "full_redacted"; recordInput?: boolean | undefined; recordOutput?: boolean | undefined; recordAttempts?: boolean | undefined; recordPolicyDecision?: boolean | undefined; metricsEnabled?: boolean | undefined; redactionPolicyRef?: { id: string; version?: string | undefined; revision?: string | undefined; } | undefined; }>;

toolPrincipalSpecSchema

Runtime schema for Tool Principal Spec.

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

Declaration

text
export declare const toolPrincipalSpecSchema: z.ZodObject<{ principalId: z.ZodString; type: z.ZodEnum<["user", "agent", "service", "system"]>; tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodOptional<z.ZodString>; workspaceId: z.ZodOptional<z.ZodString>; agentId: z.ZodOptional<z.ZodString>; roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; permissionScopes: z.ZodArray<z.ZodString, "many">; delegatedBy: z.ZodOptional<z.ZodString>; delegationDepth: z.ZodOptional<z.ZodNumber>; authenticationContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, "strip", z.ZodTypeAny, { type: "user" | "agent" | "service" | "system"; principalId: string; permissionScopes: string[]; metadata?: Record<string, unknown> | undefined; agentId?: string | undefined; tenantId?: string | undefined; userId?: string | undefined; workspaceId?: string | undefined; roles?: string[] | undefined; delegatedBy?: string | undefined; delegationDepth?: number | undefined; authenticationContext?: Record<string, unknown> | undefined; }, { type: "user" | "agent" | "service" | "system"; principalId: string; permissionScopes: string[]; metadata?: Record<string, unknown> | undefined; agentId?: string | undefined; tenantId?: string | undefined; userId?: string | undefined; workspaceId?: string | undefined; roles?: string[] | undefined; delegatedBy?: string | undefined; delegationDepth?: number | undefined; authenticationContext?: Record<string, unknown> | undefined; }>;

toolSchemaSpecSchema

Runtime schema for Tool Schema Spec.

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

Declaration

text
export declare const toolSchemaSpecSchema: z.ZodObject<{ jsonSchema: z.ZodType<JsonSchema, z.ZodTypeDef, JsonSchema>; schemaId: z.ZodOptional<z.ZodString>; schemaVersion: z.ZodOptional<z.ZodString>; schemaHash: z.ZodString; strict: z.ZodOptional<z.ZodBoolean>; allowAdditionalProperties: z.ZodOptional<z.ZodBoolean>; maxSerializedBytes: z.ZodOptional<z.ZodNumber>; sensitivePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; redactedPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { jsonSchema: JsonSchema; schemaHash: string; schemaId?: string | undefined; schemaVersion?: string | undefined; strict?: boolean | undefined; allowAdditionalProperties?: boolean | undefined; maxSerializedBytes?: number | undefined; sensitivePaths?: string[] | undefined; redactedPaths?: string[] | undefined; }, { jsonSchema: JsonSchema; schemaHash: string; schemaId?: string | undefined; schemaVersion?: string | undefined; strict?: boolean | undefined; allowAdditionalProperties?: boolean | undefined; maxSerializedBytes?: number | undefined; sensitivePaths?: string[] | undefined; redactedPaths?: string[] | undefined; }>;

toolSemanticSpecSchema

Runtime schema for Tool Semantic Spec.

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

Declaration

text
export declare const toolSemanticSpecSchema: z.ZodType<ToolSemanticSpec, z.ZodTypeDef, ToolSemanticSpec>;

toolSourceRefSchema

Runtime schema for Tool Source Ref.

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

Declaration

text
export declare const toolSourceRefSchema: z.ZodObject<{ adapterId: z.ZodOptional<z.ZodString>; handlerId: z.ZodOptional<z.ZodString>; endpointRef: z.ZodOptional<z.ZodString>; mcpServerId: z.ZodOptional<z.ZodString>; mcpCapabilityId: z.ZodOptional<z.ZodString>; mcpCapabilityHash: z.ZodOptional<z.ZodString>; pluginId: z.ZodOptional<z.ZodString>; hostedToolId: z.ZodOptional<z.ZodString>; metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, "strip", z.ZodTypeAny, { adapterId?: string | undefined; handlerId?: string | undefined; endpointRef?: string | undefined; mcpServerId?: string | undefined; mcpCapabilityId?: string | undefined; mcpCapabilityHash?: string | undefined; pluginId?: string | undefined; hostedToolId?: string | undefined; metadata?: Record<string, unknown> | undefined; }, { adapterId?: string | undefined; handlerId?: string | undefined; endpointRef?: string | undefined; mcpServerId?: string | undefined; mcpCapabilityId?: string | undefined; mcpCapabilityHash?: string | undefined; pluginId?: string | undefined; hostedToolId?: string | undefined; metadata?: Record<string, unknown> | undefined; }>;

canonicalJson

Canonical JSON function with 1 public call signature; parameters and return types are listed below.

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

Declaration

text
export declare function canonicalJson(value: unknown): string;

Call signature

text
canonicalJson(value: unknown): string

Parameters

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

Returns

  • Type: string
  • Description: The return contract is defined by the type shown above.

createToolCacheValidityKey

Create Tool Cache Validity Key function with 1 public call signature; parameters and return types are listed below.

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

Declaration

text
export declare function createToolCacheValidityKey(input: ToolCacheValidityInput): string;

Call signature

text
createToolCacheValidityKey(input: ToolCacheValidityInput): string

Parameters

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

Returns

  • Type: string
  • Description: The return contract is defined by the type shown above.

createToolSchemaSpec

Create Tool Schema Spec function with 1 public call signature; parameters and return types are listed below.

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

Declaration

text
export declare function createToolSchemaSpec(jsonSchema: JsonSchema, options?: Omit<Partial<ToolSchemaSpec>, 'jsonSchema' | 'schemaHash'>): ToolSchemaSpec;

Call signature

text
createToolSchemaSpec(jsonSchema: JsonSchema, options?: Omit<Partial<ToolSchemaSpec>, "jsonSchema" | "schemaHash">): ToolSchemaSpec

Parameters

ParameterTypeRequiredDescription
jsonSchemaJsonSchemaYesRequired parameter; accepted values are defined by the type column.
optionsOmit<Partial<ToolSchemaSpec>, "jsonSchema" | "schemaHash">NoOptional parameter; accepted values are defined by the type column.

Returns

  • Type: ToolSchemaSpec
  • Description: The return contract is defined by the type shown above.

hashToolContract

Hash Tool Contract function with 1 public call signature; parameters and return types are listed below.

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

Declaration

text
export declare function hashToolContract(value: unknown): string;

Call signature

text
hashToolContract(value: unknown): string

Parameters

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

Returns

  • Type: string
  • Description: The return contract is defined by the type shown above.

EffectiveAgentCapabilitySnapshot

Effective Agent Capability Snapshot interface with 17 public fields or methods.

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

Declaration

text
export interface EffectiveAgentCapabilitySnapshot {
    id: string;
    runId: string;
    agentId: string;
    principalId: string;
    tenantId?: string;
    domainId?: string;
    createdAt: string;
    expiresAt?: string;
    skillRevisions: Array<{
        id: string;
        version: string;
        contentHash: string;
    }>;
    allowedToolIds: string[];
    allowedMCPServerIds: string[];
    memoryAccess: 'none' | 'read' | 'write' | 'read_write';
    allowedExecutionProfiles: string[];
    maximumSideEffectLevel: SideEffectLevel;
    requiresHumanReview: boolean;
    policyRefs: string[];
    snapshotHash: string;
}

Contract members

MemberKindSignatureDescription
agentIdpropertyagentId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
allowedExecutionProfilespropertyallowedExecutionProfiles: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
allowedMCPServerIdspropertyallowedMCPServerIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
allowedToolIdspropertyallowedToolIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
createdAtpropertycreatedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
domainIdpropertydomainId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
expiresAtpropertyexpiresAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
maximumSideEffectLevelpropertymaximumSideEffectLevel: SideEffectLevelPublic property; its type, readonly modifier and optionality are shown in the signature.
memoryAccesspropertymemoryAccess: "none" | "read" | "write" | "read_write"Public property; its type, readonly modifier and optionality are shown in the signature.
policyRefspropertypolicyRefs: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
principalIdpropertyprincipalId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
requiresHumanReviewpropertyrequiresHumanReview: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
runIdpropertyrunId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
skillRevisionspropertyskillRevisions: { id: string; version: string; contentHash: string; }[]Public property; its type, readonly modifier and optionality are shown in the signature.
snapshotHashpropertysnapshotHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
tenantIdpropertytenantId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

EffectiveCapabilityApproval

Effective Capability Approval interface with 11 public fields or methods.

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

Declaration

text
export interface EffectiveCapabilityApproval {
    taskId: string;
    subjectType: 'effective_capability_snapshot';
    subjectHash: string;
    snapshotId: string;
    runId: string;
    agentId: string;
    principalId: string;
    approvedBy: string;
    approvedAt: string;
    expiresAt: string;
    status: 'approved';
}

Contract members

MemberKindSignatureDescription
agentIdpropertyagentId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
approvedAtpropertyapprovedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
approvedBypropertyapprovedBy: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
expiresAtpropertyexpiresAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
principalIdpropertyprincipalId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
runIdpropertyrunId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
snapshotIdpropertysnapshotId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: "approved"Public property; its type, readonly modifier and optionality are shown in the signature.
subjectHashpropertysubjectHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
subjectTypepropertysubjectType: "effective_capability_snapshot"Public property; its type, readonly modifier and optionality are shown in the signature.
taskIdpropertytaskId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

GovernedHumanApprovalPolicySpec

Governed Human Approval Policy Spec interface with 9 public fields or methods.

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

Declaration

text
export interface GovernedHumanApprovalPolicySpec {
    mode: 'never' | 'policy' | 'always';
    requiredForSideEffects?: SideEffectLevel[];
    approverRoles?: string[];
    minApprovals?: number;
    expiresAfterSeconds?: number;
    allowParameterEdit?: boolean;
    requireReason?: boolean;
    revalidateOnResume?: boolean;
    escalationPolicyRef?: {
        id: string;
        version?: string;
        revision?: string;
    };
}

Contract members

MemberKindSignatureDescription
allowParameterEditpropertyallowParameterEdit?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
approverRolespropertyapproverRoles?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
escalationPolicyRefpropertyescalationPolicyRef?: { id: string; version?: string; revision?: string; }Public property; its type, readonly modifier and optionality are shown in the signature.
expiresAfterSecondspropertyexpiresAfterSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
minApprovalspropertyminApprovals?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
modepropertymode: "policy" | "never" | "always"Public property; its type, readonly modifier and optionality are shown in the signature.
requiredForSideEffectspropertyrequiredForSideEffects?: SideEffectLevel[]Public property; its type, readonly modifier and optionality are shown in the signature.
requireReasonpropertyrequireReason?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
revalidateOnResumepropertyrevalidateOnResume?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

GovernedHumanApprovalRequest

Governed Human Approval Request interface with 19 public fields or methods.

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

Declaration

text
export interface GovernedHumanApprovalRequest {
    id: string;
    revision: number;
    invocationId: string;
    toolRef: {
        id: string;
        version?: string;
        revision?: string;
    };
    toolRevision: string;
    scope: ToolInvocationScopeSpec;
    principal: ToolPrincipalSpec;
    requestSummary: string;
    parameterSummary?: unknown;
    parameterHash: string;
    riskSummary?: string;
    sideEffectLevel: SideEffectLevel;
    policyDecisionRef?: string;
    requestedAt: string;
    expiresAt?: string;
    status: 'pending' | 'approved' | 'rejected' | 'expired' | 'cancelled';
    decisions: HumanApprovalDecisionRecord[];
    pendingActionRef: string;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
decisionspropertydecisions: HumanApprovalDecisionRecord[]Public property; its type, readonly modifier and optionality are shown in the signature.
expiresAtpropertyexpiresAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
invocationIdpropertyinvocationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
parameterHashpropertyparameterHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
parameterSummarypropertyparameterSummary?: unknownPublic property; its type, readonly modifier and optionality are shown in the signature.
pendingActionRefpropertypendingActionRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
policyDecisionRefpropertypolicyDecisionRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
principalpropertyprincipal: ToolPrincipalSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
requestedAtpropertyrequestedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
requestSummarypropertyrequestSummary: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
riskSummarypropertyriskSummary?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope: ToolInvocationScopeSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
sideEffectLevelpropertysideEffectLevel: SideEffectLevelPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: "rejected" | "cancelled" | "expired" | "pending" | "approved"Public property; its type, readonly modifier and optionality are shown in the signature.
toolRefpropertytoolRef: { id: string; version?: string; revision?: string; }Public property; its type, readonly modifier and optionality are shown in the signature.
toolRevisionpropertytoolRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

GovernedToolContractSpec

Governed Tool Contract Spec interface with 22 public fields or methods.

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

Declaration

text
export interface GovernedToolContractSpec {
    id: string;
    version: string;
    revision: string;
    name: string;
    displayName?: string;
    description: string;
    instructions?: string;
    tags?: string[];
    input: ToolSchemaSpec;
    output?: ToolSchemaSpec;
    source: ToolSource;
    sourceRef?: ToolSourceRef;
    semantics: ToolSemanticSpec;
    execution: ToolExecutionPolicySpec;
    governance: ToolGovernanceSpec;
    observability: ToolObservabilitySpec;
    cache?: ToolCachePolicySpec;
    streaming?: ToolStreamingSpec;
    enabled?: boolean;
    deprecated?: boolean;
    replacedBy?: {
        id: string;
        version?: string;
        revision?: string;
    };
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
cachepropertycache?: ToolCachePolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
deprecatedpropertydeprecated?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
displayNamepropertydisplayName?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
enabledpropertyenabled?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
executionpropertyexecution: ToolExecutionPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
governancepropertygovernance: ToolGovernanceSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
inputpropertyinput: ToolSchemaSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
instructionspropertyinstructions?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
observabilitypropertyobservability: ToolObservabilitySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
outputpropertyoutput?: ToolSchemaSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
replacedBypropertyreplacedBy?: { id: string; version?: string; revision?: string; }Public property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
semanticspropertysemantics: ToolSemanticSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
sourcepropertysource: ToolSourcePublic property; its type, readonly modifier and optionality are shown in the signature.
sourceRefpropertysourceRef?: ToolSourceRefPublic property; its type, readonly modifier and optionality are shown in the signature.
streamingpropertystreaming?: ToolStreamingSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
tagspropertytags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

GovernedToolInvocationRecord

Governed Tool Invocation Record interface with 35 public fields or methods.

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

Declaration

text
export interface GovernedToolInvocationRecord {
    id: string;
    revision: number;
    operationId: string;
    toolRef: {
        id: string;
        version?: string;
        revision?: string;
    };
    toolRevision: string;
    contractSnapshotRef?: string;
    principal: ToolPrincipalSpec;
    scope: ToolInvocationScopeSpec;
    input?: unknown;
    inputHash: string;
    redactedInput?: unknown;
    status: GovernedToolInvocationStatus;
    sideEffectLevel: SideEffectLevel;
    idempotencyKey?: string;
    idempotencyFingerprint?: string;
    reusedFromInvocationId?: string;
    approvalRequestId?: string;
    currentAttempt: number;
    maxAttempts: number;
    queuedAt?: string;
    startedAt?: string;
    deadlineAt?: string;
    completedAt?: string;
    output?: unknown;
    outputHash?: string;
    artifactRefs?: string[];
    observationRefs?: string[];
    externalReceipt?: ToolExternalReceipt;
    error?: NormalizedToolError;
    lateResultState?: 'none' | 'pending' | 'accepted' | 'discarded' | 'quarantined';
    correlationId?: string;
    causationId?: string;
    createdAt: string;
    updatedAt: string;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
approvalRequestIdpropertyapprovalRequestId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
artifactRefspropertyartifactRefs?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
causationIdpropertycausationId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
completedAtpropertycompletedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
contractSnapshotRefpropertycontractSnapshotRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
correlationIdpropertycorrelationId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
createdAtpropertycreatedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
currentAttemptpropertycurrentAttempt: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
deadlineAtpropertydeadlineAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
errorpropertyerror?: NormalizedToolErrorPublic property; its type, readonly modifier and optionality are shown in the signature.
externalReceiptpropertyexternalReceipt?: ToolExternalReceiptPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idempotencyFingerprintpropertyidempotencyFingerprint?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idempotencyKeypropertyidempotencyKey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
inputpropertyinput?: unknownPublic property; its type, readonly modifier and optionality are shown in the signature.
inputHashpropertyinputHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
lateResultStatepropertylateResultState?: "none" | "accepted" | "quarantined" | "pending" | "discarded"Public property; its type, readonly modifier and optionality are shown in the signature.
maxAttemptspropertymaxAttempts: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
observationRefspropertyobservationRefs?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
outputpropertyoutput?: unknownPublic property; its type, readonly modifier and optionality are shown in the signature.
outputHashpropertyoutputHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
principalpropertyprincipal: ToolPrincipalSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
queuedAtpropertyqueuedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
redactedInputpropertyredactedInput?: unknownPublic property; its type, readonly modifier and optionality are shown in the signature.
reusedFromInvocationIdpropertyreusedFromInvocationId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope: ToolInvocationScopeSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
sideEffectLevelpropertysideEffectLevel: SideEffectLevelPublic property; its type, readonly modifier and optionality are shown in the signature.
startedAtpropertystartedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: GovernedToolInvocationStatusPublic property; its type, readonly modifier and optionality are shown in the signature.
toolRefpropertytoolRef: { id: string; version?: string; revision?: string; }Public property; its type, readonly modifier and optionality are shown in the signature.
toolRevisionpropertytoolRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

HumanApprovalDecisionRecord

Human Approval Decision Record interface with 5 public fields or methods.

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

Declaration

text
export interface HumanApprovalDecisionRecord {
    decidedBy: string;
    decision: 'approved' | 'rejected';
    reason?: string;
    decidedAt: string;
    parameterHash: string;
}

Contract members

MemberKindSignatureDescription
decidedAtpropertydecidedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
decidedBypropertydecidedBy: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
decisionpropertydecision: "rejected" | "approved"Public property; its type, readonly modifier and optionality are shown in the signature.
parameterHashpropertyparameterHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
reasonpropertyreason?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

NormalizedToolError

Normalized Tool Error interface with 7 public fields or methods.

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

Declaration

text
export interface NormalizedToolError {
    code: 'TOOL_NOT_FOUND' | 'TOOL_DISABLED' | 'TOOL_SCHEMA_INVALID' | 'TOOL_OUTPUT_INVALID' | 'TOOL_PERMISSION_DENIED' | 'TOOL_POLICY_DENIED' | 'TOOL_APPROVAL_REQUIRED' | 'TOOL_APPROVAL_REJECTED' | 'TOOL_APPROVAL_EXPIRED' | 'TOOL_IDEMPOTENCY_CONFLICT' | 'TOOL_CONCURRENCY_CONFLICT' | 'TOOL_TIMEOUT' | 'TOOL_CANCELLED' | 'TOOL_ADAPTER_UNAVAILABLE' | 'TOOL_RETRY_EXHAUSTED' | 'TOOL_LATE_RESULT' | 'TOOL_EXECUTION_FAILED' | 'TOOL_INTERNAL_ERROR';
    message: string;
    retryable: boolean;
    attempt?: number;
    providerCode?: string | number;
    details?: Record<string, unknown>;
    causeRef?: string;
}

Contract members

MemberKindSignatureDescription
attemptpropertyattempt?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
causeRefpropertycauseRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
codepropertycode: "TOOL_NOT_FOUND" | "TOOL_DISABLED" | "TOOL_SCHEMA_INVALID" | "TOOL_OUTPUT_INVALID" | "TOOL_PERMISSION_DENIED" | "TOOL_POLICY_DENIED" | "TOOL_APPROVAL_REQUIRED" | "TOOL_APPROVAL_REJECTED" | "TOOL_APPROVAL_EXPIRED" | "TOOL_IDEMPOTENCY_CONFLICT" | "TOOL_CONCURRENCY_CONFLICT" | "TOOL_TIMEOUT" | "TOOL_CANCELLED" | "TOOL_ADAPTER_UNAVAILABLE" | "TOOL_RETRY_EXHAUSTED" | "TOOL_LATE_RESULT" | "TOOL_EXECUTION_FAILED" |...Public property; its type, readonly modifier and optionality are shown in the signature.
detailspropertydetails?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
messagepropertymessage: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
providerCodepropertyproviderCode?: string | numberPublic property; its type, readonly modifier and optionality are shown in the signature.
retryablepropertyretryable: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

ProviderHealth

Provider Health interface with 5 public fields or methods.

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

Declaration

text
export interface ProviderHealth {
    status: 'healthy' | 'degraded' | 'unhealthy' | 'unknown';
    checkedAt: string;
    latencyMs?: number;
    message?: string;
    details?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
checkedAtpropertycheckedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
detailspropertydetails?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
latencyMspropertylatencyMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
messagepropertymessage?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: "healthy" | "degraded" | "unhealthy" | "unknown"Public property; its type, readonly modifier and optionality are shown in the signature.

ToolArtifactContract

Tool Artifact Contract interface with 4 public fields or methods.

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

Declaration

text
export interface ToolArtifactContract {
    kind?: string;
    mimeTypes?: string[];
    maxInlineBytes?: number;
    required?: boolean;
}

Contract members

MemberKindSignatureDescription
kindpropertykind?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
maxInlineBytespropertymaxInlineBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
mimeTypespropertymimeTypes?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
requiredpropertyrequired?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

ToolCachePolicySpec

Tool Cache Policy Spec interface with 8 public fields or methods.

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

Declaration

text
export interface ToolCachePolicySpec {
    mode: 'disabled' | 'result' | 'observation_ref';
    ttlSeconds?: number;
    scope: 'run' | 'session' | 'workspace' | 'tenant';
    keyFields?: string[];
    includeToolRevision: boolean;
    includePolicyRevision: boolean;
    allowForSideEffectLevels?: SideEffectLevel[];
    staleWhileRevalidateSeconds?: number;
}

Contract members

MemberKindSignatureDescription
allowForSideEffectLevelspropertyallowForSideEffectLevels?: SideEffectLevel[]Public property; its type, readonly modifier and optionality are shown in the signature.
includePolicyRevisionpropertyincludePolicyRevision: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
includeToolRevisionpropertyincludeToolRevision: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
keyFieldspropertykeyFields?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
modepropertymode: "disabled" | "result" | "observation_ref"Public property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope: "workspace" | "session" | "run" | "tenant"Public property; its type, readonly modifier and optionality are shown in the signature.
staleWhileRevalidateSecondspropertystaleWhileRevalidateSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
ttlSecondspropertyttlSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

ToolCacheValidityInput

Tool Cache Validity Input interface with 8 public fields or methods.

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

Declaration

text
export interface ToolCacheValidityInput {
    toolId: string;
    toolRevision: string;
    inputHash: string;
    scopeHash: string;
    policyRevision: string;
    contractSnapshotHash?: string;
    capabilityHash?: string;
    externalStateVersion?: string;
}

Contract members

MemberKindSignatureDescription
capabilityHashpropertycapabilityHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
contractSnapshotHashpropertycontractSnapshotHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
externalStateVersionpropertyexternalStateVersion?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
inputHashpropertyinputHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
policyRevisionpropertypolicyRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
scopeHashpropertyscopeHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
toolIdpropertytoolId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
toolRevisionpropertytoolRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ToolCacheValidityRecord

Tool Cache Validity Record interface with 10 public fields or methods.

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

Declaration

text
export interface ToolCacheValidityRecord extends ToolCacheValidityInput {
    key: string;
    validUntil?: string;
}

Contract members

MemberKindSignatureDescription
capabilityHashpropertycapabilityHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
contractSnapshotHashpropertycontractSnapshotHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
externalStateVersionpropertyexternalStateVersion?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
inputHashpropertyinputHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
keypropertykey: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
policyRevisionpropertypolicyRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
scopeHashpropertyscopeHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
toolIdpropertytoolId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
toolRevisionpropertytoolRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
validUntilpropertyvalidUntil?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ToolCancellationPolicySpec

Tool Cancellation Policy Spec interface with 2 public fields or methods.

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

Declaration

text
export interface ToolCancellationPolicySpec {
    mode: 'cooperative' | 'provider' | 'unsupported';
    gracePeriodMs?: number;
}

Contract members

MemberKindSignatureDescription
gracePeriodMspropertygracePeriodMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
modepropertymode: "provider" | "cooperative" | "unsupported"Public property; its type, readonly modifier and optionality are shown in the signature.

ToolConcurrencyPolicySpec

Tool Concurrency Policy Spec interface with 3 public fields or methods.

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

Declaration

text
export interface ToolConcurrencyPolicySpec {
    maxConcurrent?: number;
    keyFields?: string[];
    queueWhenBusy?: boolean;
}

Contract members

MemberKindSignatureDescription
keyFieldspropertykeyFields?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
maxConcurrentpropertymaxConcurrent?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
queueWhenBusypropertyqueueWhenBusy?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

ToolContractSnapshot

Tool Contract Snapshot interface with 8 public fields or methods.

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

Declaration

text
export interface ToolContractSnapshot {
    id: string;
    runId: string;
    createdAt: string;
    toolContracts: ToolContractSnapshotItem[];
    catalogRevision?: string;
    policyRevision?: string;
    effectiveCapabilities?: EffectiveAgentCapabilitySnapshot;
    snapshotHash: string;
}

Contract members

MemberKindSignatureDescription
catalogRevisionpropertycatalogRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
createdAtpropertycreatedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
effectiveCapabilitiespropertyeffectiveCapabilities?: EffectiveAgentCapabilitySnapshotPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
policyRevisionpropertypolicyRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
runIdpropertyrunId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
snapshotHashpropertysnapshotHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
toolContractspropertytoolContracts: ToolContractSnapshotItem[]Public property; its type, readonly modifier and optionality are shown in the signature.

ToolContractSnapshotItem

Tool Contract Snapshot Item interface with 8 public fields or methods.

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

Declaration

text
export interface ToolContractSnapshotItem {
    toolId: string;
    toolVersion: string;
    toolRevision: string;
    inputSchemaHash: string;
    outputSchemaHash?: string;
    sourceCapabilityHash?: string;
    sideEffectLevel: SideEffectLevel;
    adapterRef: string;
}

Contract members

MemberKindSignatureDescription
adapterRefpropertyadapterRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
inputSchemaHashpropertyinputSchemaHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
outputSchemaHashpropertyoutputSchemaHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sideEffectLevelpropertysideEffectLevel: SideEffectLevelPublic property; its type, readonly modifier and optionality are shown in the signature.
sourceCapabilityHashpropertysourceCapabilityHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
toolIdpropertytoolId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
toolRevisionpropertytoolRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
toolVersionpropertytoolVersion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ToolContractSnapshotStore

Tool Contract Snapshot Store interface with 2 public fields or methods.

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

Declaration

text
export interface ToolContractSnapshotStore {
    get(snapshotId: string): Promise<ToolContractSnapshot | null>;
    save(snapshot: ToolContractSnapshot): Promise<void>;
}

Contract members

MemberKindSignatureDescription
getmethodget(snapshotId: string): Promise<ToolContractSnapshot | null>Public method; parameters and return type are shown in the signature.
savemethodsave(snapshot: ToolContractSnapshot): Promise<void>Public method; parameters and return type are shown in the signature.

ToolEventPayloadBase

Tool Event Payload Base interface with 15 public fields or methods.

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

Declaration

text
export interface ToolEventPayloadBase {
    invocationId?: string;
    operationId?: string;
    toolId?: string;
    toolVersion?: string;
    toolRevision?: string;
    contractSnapshotRef?: string;
    scopeHash?: string;
    principalId?: string;
    sideEffectLevel?: SideEffectLevel;
    attempt?: number;
    latencyMs?: number;
    inputHash?: string;
    outputHash?: string;
    error?: NormalizedToolError;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
attemptpropertyattempt?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
contractSnapshotRefpropertycontractSnapshotRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
errorpropertyerror?: NormalizedToolErrorPublic property; its type, readonly modifier and optionality are shown in the signature.
inputHashpropertyinputHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
invocationIdpropertyinvocationId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
latencyMspropertylatencyMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
outputHashpropertyoutputHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
principalIdpropertyprincipalId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
scopeHashpropertyscopeHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sideEffectLevelpropertysideEffectLevel?: SideEffectLevelPublic property; its type, readonly modifier and optionality are shown in the signature.
toolIdpropertytoolId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
toolRevisionpropertytoolRevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
toolVersionpropertytoolVersion?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ToolExecutionContextSpec

Tool Execution Context Spec interface with 21 public fields or methods.

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

Declaration

text
export interface ToolExecutionContextSpec {
    principal: ToolPrincipalSpec;
    tenantId?: string;
    userId: string;
    workspaceId?: string;
    sessionId: string;
    runId: string;
    stepId?: string;
    agentId?: string;
    fsmState?: string;
    invocationId: string;
    operationId: string;
    idempotencyKey?: string;
    correlationId?: string;
    causationId?: string;
    parentEventId?: string;
    contractSnapshotRef?: string;
    capabilitySnapshotRef?: string;
    capabilityApprovals?: EffectiveCapabilityApproval[];
    deadlineAt?: string;
    abortSignal?: AbortSignal;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
abortSignalpropertyabortSignal?: AbortSignalPublic property; its type, readonly modifier and optionality are shown in the signature.
agentIdpropertyagentId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
capabilityApprovalspropertycapabilityApprovals?: EffectiveCapabilityApproval[]Public property; its type, readonly modifier and optionality are shown in the signature.
capabilitySnapshotRefpropertycapabilitySnapshotRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
causationIdpropertycausationId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
contractSnapshotRefpropertycontractSnapshotRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
correlationIdpropertycorrelationId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
deadlineAtpropertydeadlineAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
fsmStatepropertyfsmState?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idempotencyKeypropertyidempotencyKey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
invocationIdpropertyinvocationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
parentEventIdpropertyparentEventId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
principalpropertyprincipal: ToolPrincipalSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
runIdpropertyrunId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sessionIdpropertysessionId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
stepIdpropertystepId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
tenantIdpropertytenantId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
userIdpropertyuserId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
workspaceIdpropertyworkspaceId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ToolExecutionPolicySpec

Tool Execution Policy Spec interface with 7 public fields or methods.

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

Declaration

text
export interface ToolExecutionPolicySpec {
    timeout: TimeoutPolicySpec;
    retry: RetryPolicySpec;
    cancellation?: ToolCancellationPolicySpec;
    concurrency?: ToolConcurrencyPolicySpec;
    lateResult?: ToolLateResultPolicySpec;
    outputLimit?: ToolOutputLimitSpec;
    environmentRef?: {
        id: string;
        version?: string;
        revision?: string;
    };
}

Contract members

MemberKindSignatureDescription
cancellationpropertycancellation?: ToolCancellationPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
concurrencypropertyconcurrency?: ToolConcurrencyPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
environmentRefpropertyenvironmentRef?: { id: string; version?: string; revision?: string; }Public property; its type, readonly modifier and optionality are shown in the signature.
lateResultpropertylateResult?: ToolLateResultPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
outputLimitpropertyoutputLimit?: ToolOutputLimitSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
retrypropertyretry: RetryPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
timeoutpropertytimeout: TimeoutPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.

ToolExternalReceipt

Tool External Receipt interface with 5 public fields or methods.

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

Declaration

text
export interface ToolExternalReceipt {
    provider?: string;
    receiptId: string;
    status?: string;
    committedAt?: string;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
committedAtpropertycommittedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
providerpropertyprovider?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
receiptIdpropertyreceiptId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ToolGovernanceSpec

Tool Governance Spec interface with 10 public fields or methods.

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

Declaration

text
export interface ToolGovernanceSpec {
    requiredPermissionScopes: string[];
    deniedPermissionScopes?: string[];
    allowedPrincipalTypes?: Array<'user' | 'agent' | 'service' | 'system'>;
    policyRefs?: Array<{
        id: string;
        version?: string;
        revision?: string;
    }>;
    approvalPolicy?: HumanReviewPolicySpec;
    auditPolicy: {
        enabled: boolean;
        includeInput?: boolean;
        includeOutput?: boolean;
        redactPaths?: string[];
    };
    tenantIsolation?: boolean;
    workspaceIsolation?: boolean;
    allowDelegation?: boolean;
    maxDelegationDepth?: number;
}

Contract members

MemberKindSignatureDescription
allowDelegationpropertyallowDelegation?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
allowedPrincipalTypespropertyallowedPrincipalTypes?: ("system" | "agent" | "user" | "service")[]Public property; its type, readonly modifier and optionality are shown in the signature.
approvalPolicypropertyapprovalPolicy?: HumanReviewPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
auditPolicypropertyauditPolicy: { enabled: boolean; includeInput?: boolean; includeOutput?: boolean; redactPaths?: string[]; }Public property; its type, readonly modifier and optionality are shown in the signature.
deniedPermissionScopespropertydeniedPermissionScopes?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
maxDelegationDepthpropertymaxDelegationDepth?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
policyRefspropertypolicyRefs?: { id: string; version?: string; revision?: string; }[]Public property; its type, readonly modifier and optionality are shown in the signature.
requiredPermissionScopespropertyrequiredPermissionScopes: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
tenantIsolationpropertytenantIsolation?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
workspaceIsolationpropertyworkspaceIsolation?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

ToolInvocationScopeSpec

Tool Invocation Scope Spec interface with 8 public fields or methods.

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

Declaration

text
export interface ToolInvocationScopeSpec {
    tenantId?: string;
    userId: string;
    workspaceId?: string;
    sessionId: string;
    runId: string;
    stepId?: string;
    agentId?: string;
    fsmState?: string;
}

Contract members

MemberKindSignatureDescription
agentIdpropertyagentId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
fsmStatepropertyfsmState?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
runIdpropertyrunId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sessionIdpropertysessionId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
stepIdpropertystepId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
tenantIdpropertytenantId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
userIdpropertyuserId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
workspaceIdpropertyworkspaceId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ToolLateResultPolicySpec

Tool Late Result Policy Spec interface with 2 public fields or methods.

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

Declaration

text
export interface ToolLateResultPolicySpec {
    mode: 'discard' | 'accept' | 'quarantine' | 'reconcile';
    reconciliationToolRef?: {
        id: string;
        version?: string;
        revision?: string;
    };
}

Contract members

MemberKindSignatureDescription
modepropertymode: "reconcile" | "quarantine" | "discard" | "accept"Public property; its type, readonly modifier and optionality are shown in the signature.
reconciliationToolRefpropertyreconciliationToolRef?: { id: string; version?: string; revision?: string; }Public property; its type, readonly modifier and optionality are shown in the signature.

ToolObservabilitySpec

Tool Observability Spec interface with 7 public fields or methods.

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

Declaration

text
export interface ToolObservabilitySpec {
    traceLevel: 'none' | 'metadata' | 'summary' | 'full_redacted';
    recordInput?: boolean;
    recordOutput?: boolean;
    recordAttempts?: boolean;
    recordPolicyDecision?: boolean;
    metricsEnabled?: boolean;
    redactionPolicyRef?: {
        id: string;
        version?: string;
        revision?: string;
    };
}

Contract members

MemberKindSignatureDescription
metricsEnabledpropertymetricsEnabled?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
recordAttemptspropertyrecordAttempts?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
recordInputpropertyrecordInput?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
recordOutputpropertyrecordOutput?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
recordPolicyDecisionpropertyrecordPolicyDecision?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
redactionPolicyRefpropertyredactionPolicyRef?: { id: string; version?: string; revision?: string; }Public property; its type, readonly modifier and optionality are shown in the signature.
traceLevelpropertytraceLevel: "none" | "metadata" | "summary" | "full_redacted"Public property; its type, readonly modifier and optionality are shown in the signature.

ToolOutputLimitSpec

Tool Output Limit Spec interface with 2 public fields or methods.

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

Declaration

text
export interface ToolOutputLimitSpec {
    maxInlineBytes: number;
    overflow: 'fail' | 'truncate' | 'artifact';
}

Contract members

MemberKindSignatureDescription
maxInlineBytespropertymaxInlineBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
overflowpropertyoverflow: "fail" | "artifact" | "truncate"Public property; its type, readonly modifier and optionality are shown in the signature.

ToolPrincipalSpec

Tool Principal Spec interface with 12 public fields or methods.

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

Declaration

text
export interface ToolPrincipalSpec {
    principalId: string;
    type: 'user' | 'agent' | 'service' | 'system';
    tenantId?: string;
    userId?: string;
    workspaceId?: string;
    agentId?: string;
    roles?: string[];
    permissionScopes: string[];
    delegatedBy?: string;
    delegationDepth?: number;
    authenticationContext?: Record<string, unknown>;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
agentIdpropertyagentId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
authenticationContextpropertyauthenticationContext?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
delegatedBypropertydelegatedBy?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
delegationDepthpropertydelegationDepth?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
permissionScopespropertypermissionScopes: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
principalIdpropertyprincipalId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
rolespropertyroles?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
tenantIdpropertytenantId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: "system" | "agent" | "user" | "service"Public property; its type, readonly modifier and optionality are shown in the signature.
userIdpropertyuserId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
workspaceIdpropertyworkspaceId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ToolSchemaSpec

Tool Schema Spec interface with 9 public fields or methods.

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

Declaration

text
export interface ToolSchemaSpec {
    jsonSchema: JsonSchema;
    schemaId?: string;
    schemaVersion?: string;
    schemaHash: string;
    strict?: boolean;
    allowAdditionalProperties?: boolean;
    maxSerializedBytes?: number;
    sensitivePaths?: string[];
    redactedPaths?: string[];
}

Contract members

MemberKindSignatureDescription
allowAdditionalPropertiespropertyallowAdditionalProperties?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
jsonSchemapropertyjsonSchema: JsonSchemaPublic property; its type, readonly modifier and optionality are shown in the signature.
maxSerializedBytespropertymaxSerializedBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
redactedPathspropertyredactedPaths?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
schemaHashpropertyschemaHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
schemaIdpropertyschemaId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
schemaVersionpropertyschemaVersion?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sensitivePathspropertysensitivePaths?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
strictpropertystrict?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

ToolSemanticSpec

Tool Semantic Spec interface with 10 public fields or methods.

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

Declaration

text
export interface ToolSemanticSpec {
    sideEffectLevel: SideEffectLevel;
    idempotency: 'none' | 'caller_key' | 'derived_key' | 'provider_key' | 'intrinsic';
    deterministic?: boolean;
    readOnlyHint?: boolean;
    destructiveHint?: boolean;
    openWorldHint?: boolean;
    preconditions?: PolicyRuleSpec[];
    postconditions?: PolicyRuleSpec[];
    expectedArtifacts?: ToolArtifactContract[];
    resultSemantics?: 'observation' | 'artifact' | 'state_patch' | 'external_receipt';
}

Contract members

MemberKindSignatureDescription
destructiveHintpropertydestructiveHint?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
deterministicpropertydeterministic?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
expectedArtifactspropertyexpectedArtifacts?: ToolArtifactContract[]Public property; its type, readonly modifier and optionality are shown in the signature.
idempotencypropertyidempotency: "none" | "caller_key" | "derived_key" | "provider_key" | "intrinsic"Public property; its type, readonly modifier and optionality are shown in the signature.
openWorldHintpropertyopenWorldHint?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
postconditionspropertypostconditions?: PolicyRuleSpec[]Public property; its type, readonly modifier and optionality are shown in the signature.
preconditionspropertypreconditions?: PolicyRuleSpec[]Public property; its type, readonly modifier and optionality are shown in the signature.
readOnlyHintpropertyreadOnlyHint?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
resultSemanticspropertyresultSemantics?: "artifact" | "observation" | "state_patch" | "external_receipt"Public property; its type, readonly modifier and optionality are shown in the signature.
sideEffectLevelpropertysideEffectLevel: SideEffectLevelPublic property; its type, readonly modifier and optionality are shown in the signature.

ToolSourceRef

Tool Source Ref interface with 9 public fields or methods.

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

Declaration

text
export interface ToolSourceRef {
    adapterId?: string;
    handlerId?: string;
    endpointRef?: string;
    mcpServerId?: string;
    mcpCapabilityId?: string;
    mcpCapabilityHash?: string;
    pluginId?: string;
    hostedToolId?: string;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
adapterIdpropertyadapterId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
endpointRefpropertyendpointRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
handlerIdpropertyhandlerId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
hostedToolIdpropertyhostedToolId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
mcpCapabilityHashpropertymcpCapabilityHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
mcpCapabilityIdpropertymcpCapabilityId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
mcpServerIdpropertymcpServerId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
pluginIdpropertypluginId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ToolStreamingSpec

Tool Streaming Spec interface with 4 public fields or methods.

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

Declaration

text
export interface ToolStreamingSpec {
    enabled: boolean;
    supportsProgress?: boolean;
    supportsStructuredContent?: boolean;
    maxUpdates?: number;
}

Contract members

MemberKindSignatureDescription
enabledpropertyenabled: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
maxUpdatespropertymaxUpdates?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
supportsProgresspropertysupportsProgress?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
supportsStructuredContentpropertysupportsStructuredContent?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

GovernedToolInvocationStatus

Public type alias for Governed Tool Invocation Status; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { GovernedToolInvocationStatus } from '@codesoul-co/hypha-tools';
  • Source module: contracts

Declaration

text
export type GovernedToolInvocationStatus = 'created' | 'validating' | 'validated' | 'denied' | 'waiting_approval' | 'approved' | 'rejected' | 'queued' | 'running' | 'cancelling' | 'cancelled' | 'completed' | 'failed' | 'timed_out' | 'expired' | 'conflict';

ToolSource

Public type alias for Tool Source; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { ToolSource } from '@codesoul-co/hypha-tools';
  • Source module: contracts

Declaration

text
export type ToolSource = 'local' | 'mcp' | 'http' | 'plugin' | 'hosted' | 'execution' | 'custom';