@codesoul-co/hypha-tools / contracts
- Package index:
@codesoul-co/hypha-tools - Source:
packages/tools/src/contracts.ts - Exports: 76
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
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
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
| Symbol | Kind | Signature | Description |
|---|---|---|---|
effectiveAgentCapabilitySnapshotSchema | constant | 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, {... | Runtime schema for Effective Agent Capability Snapshot. |
effectiveCapabilityApprovalSchema | constant | 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... | Runtime schema for Effective Capability Approval. |
governedHumanApprovalDefinition | constant | const governedHumanApprovalDefinition: SpecSchemaDefinition<GovernedHumanApprovalRequest> | Governed Human Approval Definition constant exported by the contracts module. |
governedHumanApprovalExample | constant | const governedHumanApprovalExample: GovernedHumanApprovalRequest | Valid example value for Governed Human Approval. |
governedHumanApprovalJsonSchema | constant | const governedHumanApprovalJsonSchema: JsonSchema | JSON Schema for Governed Human Approval. |
governedHumanApprovalPolicySpecSchema | constant | 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.Zo... | Runtime schema for Governed Human Approval Policy Spec. |
governedHumanApprovalRequestSchema | constant | const 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. |
governedToolContractDefinition | constant | const governedToolContractDefinition: SpecSchemaDefinition<GovernedToolContractSpec> | Governed Tool Contract Definition constant exported by the contracts module. |
governedToolContractExample | constant | const governedToolContractExample: GovernedToolContractSpec | Valid example value for Governed Tool Contract. |
governedToolContractJsonSchema | constant | const governedToolContractJsonSchema: JsonSchema | JSON Schema for Governed Tool Contract. |
governedToolContractJsonSchemas | constant | const governedToolContractJsonSchemas: Record<string, JsonSchema> | Governed Tool Contract JSON Schemas constant exported by the contracts module. |
governedToolContractSpecSchema | constant | const 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. |
governedToolInvocationDefinition | constant | const governedToolInvocationDefinition: SpecSchemaDefinition<GovernedToolInvocationRecord> | Governed Tool Invocation Definition constant exported by the contracts module. |
governedToolInvocationExample | constant | const governedToolInvocationExample: GovernedToolInvocationRecord | Valid example value for Governed Tool Invocation. |
governedToolInvocationJsonSchema | constant | const governedToolInvocationJsonSchema: JsonSchema | JSON Schema for Governed Tool Invocation. |
governedToolInvocationRecordSchema | constant | const 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. |
governedToolInvocationStatusSchema | constant | const 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. |
normalizedToolErrorSchema | constant | 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", "TO... | Runtime schema for Normalized Tool Error. |
providerHealthSchema | constant | 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; latencyM... | Runtime schema for Provider Health. |
toolCachePolicySpecSchema | constant | 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", ... | Runtime schema for Tool Cache Policy Spec. |
toolContractSnapshotDefinition | constant | const toolContractSnapshotDefinition: SpecSchemaDefinition<ToolContractSnapshot> | Tool Contract Snapshot Definition constant exported by the contracts module. |
toolContractSnapshotExample | constant | const toolContractSnapshotExample: ToolContractSnapshot | Valid example value for Tool Contract Snapshot. |
toolContractSnapshotItemSchema | constant | 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; toolVe... | Runtime schema for Tool Contract Snapshot Item. |
toolContractSnapshotJsonSchema | constant | const toolContractSnapshotJsonSchema: JsonSchema | JSON Schema for Tool Contract Snapshot. |
toolContractSnapshotSchema | constant | const 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. |
toolEventPayloadBaseDefinition | constant | const toolEventPayloadBaseDefinition: SpecSchemaDefinition<ToolEventPayloadBase> | Tool Event Payload Base Definition constant exported by the contracts module. |
toolEventPayloadBaseExample | constant | const toolEventPayloadBaseExample: ToolEventPayloadBase | Valid example value for Tool Event Payload Base. |
toolEventPayloadBaseJsonSchema | constant | const toolEventPayloadBaseJsonSchema: JsonSchema | JSON Schema for Tool Event Payload Base. |
toolEventPayloadBaseSchema | constant | const 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. |
toolExecutionContextSpecSchema | constant | const 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. |
toolExecutionPolicySpecSchema | constant | const 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. |
toolGovernanceSpecSchema | constant | 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.... | Runtime schema for Tool Governance Spec. |
toolInvocationScopeSpecSchema | constant | 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; ten... | Runtime schema for Tool Invocation Scope Spec. |
toolObservabilitySpecSchema | constant | 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; vers... | Runtime schema for Tool Observability Spec. |
toolPrincipalSpecSchema | constant | 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.Zo... | Runtime schema for Tool Principal Spec. |
toolSchemaSpecSchema | constant | 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">>; red... | Runtime schema for Tool Schema Spec. |
toolSemanticSpecSchema | constant | const toolSemanticSpecSchema: z.ZodType<ToolSemanticSpec, z.ZodTypeDef, ToolSemanticSpec> | Runtime schema for Tool Semantic Spec. |
toolSourceRefSchema | constant | 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.ZodStr... | Runtime schema for Tool Source Ref. |
canonicalJson | function | canonicalJson(value: unknown): string | Canonical JSON function with 1 public call signature; parameters and return types are listed below. |
createToolCacheValidityKey | function | createToolCacheValidityKey(input: ToolCacheValidityInput): string | Create Tool Cache Validity Key function with 1 public call signature; parameters and return types are listed below. |
createToolSchemaSpec | function | createToolSchemaSpec(jsonSchema: JsonSchema, options?: Omit<Partial<ToolSchemaSpec>, "jsonSchema" | "schemaHash">): ToolSchemaSpec | Create Tool Schema Spec function with 1 public call signature; parameters and return types are listed below. |
hashToolContract | function | hashToolContract(value: unknown): string | Hash Tool Contract function with 1 public call signature; parameters and return types are listed below. |
EffectiveAgentCapabilitySnapshot | interface | interface EffectiveAgentCapabilitySnapshot | Effective Agent Capability Snapshot interface with 17 public fields or methods. |
EffectiveCapabilityApproval | interface | interface EffectiveCapabilityApproval | Effective Capability Approval interface with 11 public fields or methods. |
GovernedHumanApprovalPolicySpec | interface | interface GovernedHumanApprovalPolicySpec | Governed Human Approval Policy Spec interface with 9 public fields or methods. |
GovernedHumanApprovalRequest | interface | interface GovernedHumanApprovalRequest | Governed Human Approval Request interface with 19 public fields or methods. |
GovernedToolContractSpec | interface | interface GovernedToolContractSpec | Governed Tool Contract Spec interface with 22 public fields or methods. |
GovernedToolInvocationRecord | interface | interface GovernedToolInvocationRecord | Governed Tool Invocation Record interface with 35 public fields or methods. |
HumanApprovalDecisionRecord | interface | interface HumanApprovalDecisionRecord | Human Approval Decision Record interface with 5 public fields or methods. |
NormalizedToolError | interface | interface NormalizedToolError | Normalized Tool Error interface with 7 public fields or methods. |
ProviderHealth | interface | interface ProviderHealth | Provider Health interface with 5 public fields or methods. |
ToolArtifactContract | interface | interface ToolArtifactContract | Tool Artifact Contract interface with 4 public fields or methods. |
ToolCachePolicySpec | interface | interface ToolCachePolicySpec | Tool Cache Policy Spec interface with 8 public fields or methods. |
ToolCacheValidityInput | interface | interface ToolCacheValidityInput | Tool Cache Validity Input interface with 8 public fields or methods. |
ToolCacheValidityRecord | interface | interface ToolCacheValidityRecord extends ToolCacheValidityInput | Tool Cache Validity Record interface with 10 public fields or methods. |
ToolCancellationPolicySpec | interface | interface ToolCancellationPolicySpec | Tool Cancellation Policy Spec interface with 2 public fields or methods. |
ToolConcurrencyPolicySpec | interface | interface ToolConcurrencyPolicySpec | Tool Concurrency Policy Spec interface with 3 public fields or methods. |
ToolContractSnapshot | interface | interface ToolContractSnapshot | Tool Contract Snapshot interface with 8 public fields or methods. |
ToolContractSnapshotItem | interface | interface ToolContractSnapshotItem | Tool Contract Snapshot Item interface with 8 public fields or methods. |
ToolContractSnapshotStore | interface | interface ToolContractSnapshotStore | Tool Contract Snapshot Store interface with 2 public fields or methods. |
ToolEventPayloadBase | interface | interface ToolEventPayloadBase | Tool Event Payload Base interface with 15 public fields or methods. |
ToolExecutionContextSpec | interface | interface ToolExecutionContextSpec | Tool Execution Context Spec interface with 21 public fields or methods. |
ToolExecutionPolicySpec | interface | interface ToolExecutionPolicySpec | Tool Execution Policy Spec interface with 7 public fields or methods. |
ToolExternalReceipt | interface | interface ToolExternalReceipt | Tool External Receipt interface with 5 public fields or methods. |
ToolGovernanceSpec | interface | interface ToolGovernanceSpec | Tool Governance Spec interface with 10 public fields or methods. |
ToolInvocationScopeSpec | interface | interface ToolInvocationScopeSpec | Tool Invocation Scope Spec interface with 8 public fields or methods. |
ToolLateResultPolicySpec | interface | interface ToolLateResultPolicySpec | Tool Late Result Policy Spec interface with 2 public fields or methods. |
ToolObservabilitySpec | interface | interface ToolObservabilitySpec | Tool Observability Spec interface with 7 public fields or methods. |
ToolOutputLimitSpec | interface | interface ToolOutputLimitSpec | Tool Output Limit Spec interface with 2 public fields or methods. |
ToolPrincipalSpec | interface | interface ToolPrincipalSpec | Tool Principal Spec interface with 12 public fields or methods. |
ToolSchemaSpec | interface | interface ToolSchemaSpec | Tool Schema Spec interface with 9 public fields or methods. |
ToolSemanticSpec | interface | interface ToolSemanticSpec | Tool Semantic Spec interface with 10 public fields or methods. |
ToolSourceRef | interface | interface ToolSourceRef | Tool Source Ref interface with 9 public fields or methods. |
ToolStreamingSpec | interface | interface ToolStreamingSpec | Tool Streaming Spec interface with 4 public fields or methods. |
GovernedToolInvocationStatus | type | type 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. |
ToolSource | type | type 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
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
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
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
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
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
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
// 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
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
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
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
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
// 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
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
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
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
// 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
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
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
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
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
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
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
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
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
// 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
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
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
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
// 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
// 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
// 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
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
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
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
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
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
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
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
export declare function canonicalJson(value: unknown): string;Call signature
canonicalJson(value: unknown): stringParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
value | unknown | Yes | Required 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
export declare function createToolCacheValidityKey(input: ToolCacheValidityInput): string;Call signature
createToolCacheValidityKey(input: ToolCacheValidityInput): stringParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | ToolCacheValidityInput | Yes | Required 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
export declare function createToolSchemaSpec(jsonSchema: JsonSchema, options?: Omit<Partial<ToolSchemaSpec>, 'jsonSchema' | 'schemaHash'>): ToolSchemaSpec;Call signature
createToolSchemaSpec(jsonSchema: JsonSchema, options?: Omit<Partial<ToolSchemaSpec>, "jsonSchema" | "schemaHash">): ToolSchemaSpecParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
jsonSchema | JsonSchema | Yes | Required parameter; accepted values are defined by the type column. |
options | Omit<Partial<ToolSchemaSpec>, "jsonSchema" | "schemaHash"> | No | Optional 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
export declare function hashToolContract(value: unknown): string;Call signature
hashToolContract(value: unknown): stringParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
value | unknown | Yes | Required 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
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
| Member | Kind | Signature | Description |
|---|---|---|---|
agentId | property | agentId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
allowedExecutionProfiles | property | allowedExecutionProfiles: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
allowedMCPServerIds | property | allowedMCPServerIds: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
allowedToolIds | property | allowedToolIds: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
createdAt | property | createdAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
domainId | property | domainId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
expiresAt | property | expiresAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
maximumSideEffectLevel | property | maximumSideEffectLevel: SideEffectLevel | Public property; its type, readonly modifier and optionality are shown in the signature. |
memoryAccess | property | memoryAccess: "none" | "read" | "write" | "read_write" | Public property; its type, readonly modifier and optionality are shown in the signature. |
policyRefs | property | policyRefs: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
principalId | property | principalId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
requiresHumanReview | property | requiresHumanReview: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
runId | property | runId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
skillRevisions | property | skillRevisions: { id: string; version: string; contentHash: string; }[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
snapshotHash | property | snapshotHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
tenantId | property | tenantId?: string | Public 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
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
| Member | Kind | Signature | Description |
|---|---|---|---|
agentId | property | agentId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
approvedAt | property | approvedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
approvedBy | property | approvedBy: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
expiresAt | property | expiresAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
principalId | property | principalId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
runId | property | runId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
snapshotId | property | snapshotId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status: "approved" | Public property; its type, readonly modifier and optionality are shown in the signature. |
subjectHash | property | subjectHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
subjectType | property | subjectType: "effective_capability_snapshot" | Public property; its type, readonly modifier and optionality are shown in the signature. |
taskId | property | taskId: string | Public 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
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
| Member | Kind | Signature | Description |
|---|---|---|---|
allowParameterEdit | property | allowParameterEdit?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
approverRoles | property | approverRoles?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
escalationPolicyRef | property | escalationPolicyRef?: { id: string; version?: string; revision?: string; } | Public property; its type, readonly modifier and optionality are shown in the signature. |
expiresAfterSeconds | property | expiresAfterSeconds?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
minApprovals | property | minApprovals?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
mode | property | mode: "policy" | "never" | "always" | Public property; its type, readonly modifier and optionality are shown in the signature. |
requiredForSideEffects | property | requiredForSideEffects?: SideEffectLevel[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
requireReason | property | requireReason?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
revalidateOnResume | property | revalidateOnResume?: boolean | Public 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
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
| Member | Kind | Signature | Description |
|---|---|---|---|
decisions | property | decisions: HumanApprovalDecisionRecord[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
expiresAt | property | expiresAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
invocationId | property | invocationId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
parameterHash | property | parameterHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
parameterSummary | property | parameterSummary?: unknown | Public property; its type, readonly modifier and optionality are shown in the signature. |
pendingActionRef | property | pendingActionRef: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
policyDecisionRef | property | policyDecisionRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
principal | property | principal: ToolPrincipalSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
requestedAt | property | requestedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
requestSummary | property | requestSummary: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
revision | property | revision: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
riskSummary | property | riskSummary?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
scope | property | scope: ToolInvocationScopeSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
sideEffectLevel | property | sideEffectLevel: SideEffectLevel | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status: "rejected" | "cancelled" | "expired" | "pending" | "approved" | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolRef | property | toolRef: { id: string; version?: string; revision?: string; } | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolRevision | property | toolRevision: string | Public 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
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
| Member | Kind | Signature | Description |
|---|---|---|---|
cache | property | cache?: ToolCachePolicySpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
deprecated | property | deprecated?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
description | property | description: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
displayName | property | displayName?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
enabled | property | enabled?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
execution | property | execution: ToolExecutionPolicySpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
governance | property | governance: ToolGovernanceSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
input | property | input: ToolSchemaSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
instructions | property | instructions?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
name | property | name: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
observability | property | observability: ToolObservabilitySpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
output | property | output?: ToolSchemaSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
replacedBy | property | replacedBy?: { id: string; version?: string; revision?: string; } | Public property; its type, readonly modifier and optionality are shown in the signature. |
revision | property | revision: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
semantics | property | semantics: ToolSemanticSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
source | property | source: ToolSource | Public property; its type, readonly modifier and optionality are shown in the signature. |
sourceRef | property | sourceRef?: ToolSourceRef | Public property; its type, readonly modifier and optionality are shown in the signature. |
streaming | property | streaming?: ToolStreamingSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
tags | property | tags?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
version | property | version: string | Public 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
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
| Member | Kind | Signature | Description |
|---|---|---|---|
approvalRequestId | property | approvalRequestId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
artifactRefs | property | artifactRefs?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
causationId | property | causationId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
completedAt | property | completedAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
contractSnapshotRef | property | contractSnapshotRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
correlationId | property | correlationId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
createdAt | property | createdAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
currentAttempt | property | currentAttempt: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
deadlineAt | property | deadlineAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
error | property | error?: NormalizedToolError | Public property; its type, readonly modifier and optionality are shown in the signature. |
externalReceipt | property | externalReceipt?: ToolExternalReceipt | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
idempotencyFingerprint | property | idempotencyFingerprint?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
idempotencyKey | property | idempotencyKey?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
input | property | input?: unknown | Public property; its type, readonly modifier and optionality are shown in the signature. |
inputHash | property | inputHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
lateResultState | property | lateResultState?: "none" | "accepted" | "quarantined" | "pending" | "discarded" | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxAttempts | property | maxAttempts: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
observationRefs | property | observationRefs?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
operationId | property | operationId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
output | property | output?: unknown | Public property; its type, readonly modifier and optionality are shown in the signature. |
outputHash | property | outputHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
principal | property | principal: ToolPrincipalSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
queuedAt | property | queuedAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
redactedInput | property | redactedInput?: unknown | Public property; its type, readonly modifier and optionality are shown in the signature. |
reusedFromInvocationId | property | reusedFromInvocationId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
revision | property | revision: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
scope | property | scope: ToolInvocationScopeSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
sideEffectLevel | property | sideEffectLevel: SideEffectLevel | Public property; its type, readonly modifier and optionality are shown in the signature. |
startedAt | property | startedAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status: GovernedToolInvocationStatus | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolRef | property | toolRef: { id: string; version?: string; revision?: string; } | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolRevision | property | toolRevision: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
updatedAt | property | updatedAt: string | Public 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
export interface HumanApprovalDecisionRecord {
decidedBy: string;
decision: 'approved' | 'rejected';
reason?: string;
decidedAt: string;
parameterHash: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
decidedAt | property | decidedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
decidedBy | property | decidedBy: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
decision | property | decision: "rejected" | "approved" | Public property; its type, readonly modifier and optionality are shown in the signature. |
parameterHash | property | parameterHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
reason | property | reason?: string | Public 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
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
| Member | Kind | Signature | Description |
|---|---|---|---|
attempt | property | attempt?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
causeRef | property | causeRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
code | property | 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" |... | Public property; its type, readonly modifier and optionality are shown in the signature. |
details | property | details?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
message | property | message: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerCode | property | providerCode?: string | number | Public property; its type, readonly modifier and optionality are shown in the signature. |
retryable | property | retryable: boolean | Public 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
export interface ProviderHealth {
status: 'healthy' | 'degraded' | 'unhealthy' | 'unknown';
checkedAt: string;
latencyMs?: number;
message?: string;
details?: Record<string, unknown>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
checkedAt | property | checkedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
details | property | details?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
latencyMs | property | latencyMs?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
message | property | message?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status: "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
export interface ToolArtifactContract {
kind?: string;
mimeTypes?: string[];
maxInlineBytes?: number;
required?: boolean;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
kind | property | kind?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxInlineBytes | property | maxInlineBytes?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
mimeTypes | property | mimeTypes?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
required | property | required?: boolean | Public 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
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
| Member | Kind | Signature | Description |
|---|---|---|---|
allowForSideEffectLevels | property | allowForSideEffectLevels?: SideEffectLevel[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
includePolicyRevision | property | includePolicyRevision: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
includeToolRevision | property | includeToolRevision: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
keyFields | property | keyFields?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
mode | property | mode: "disabled" | "result" | "observation_ref" | Public property; its type, readonly modifier and optionality are shown in the signature. |
scope | property | scope: "workspace" | "session" | "run" | "tenant" | Public property; its type, readonly modifier and optionality are shown in the signature. |
staleWhileRevalidateSeconds | property | staleWhileRevalidateSeconds?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
ttlSeconds | property | ttlSeconds?: number | Public 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
export interface ToolCacheValidityInput {
toolId: string;
toolRevision: string;
inputHash: string;
scopeHash: string;
policyRevision: string;
contractSnapshotHash?: string;
capabilityHash?: string;
externalStateVersion?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
capabilityHash | property | capabilityHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
contractSnapshotHash | property | contractSnapshotHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
externalStateVersion | property | externalStateVersion?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
inputHash | property | inputHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
policyRevision | property | policyRevision: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
scopeHash | property | scopeHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolId | property | toolId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolRevision | property | toolRevision: string | Public 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
export interface ToolCacheValidityRecord extends ToolCacheValidityInput {
key: string;
validUntil?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
capabilityHash | property | capabilityHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
contractSnapshotHash | property | contractSnapshotHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
externalStateVersion | property | externalStateVersion?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
inputHash | property | inputHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
key | property | key: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
policyRevision | property | policyRevision: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
scopeHash | property | scopeHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolId | property | toolId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolRevision | property | toolRevision: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
validUntil | property | validUntil?: string | Public 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
export interface ToolCancellationPolicySpec {
mode: 'cooperative' | 'provider' | 'unsupported';
gracePeriodMs?: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
gracePeriodMs | property | gracePeriodMs?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
mode | property | mode: "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
export interface ToolConcurrencyPolicySpec {
maxConcurrent?: number;
keyFields?: string[];
queueWhenBusy?: boolean;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
keyFields | property | keyFields?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxConcurrent | property | maxConcurrent?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
queueWhenBusy | property | queueWhenBusy?: boolean | Public 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
export interface ToolContractSnapshot {
id: string;
runId: string;
createdAt: string;
toolContracts: ToolContractSnapshotItem[];
catalogRevision?: string;
policyRevision?: string;
effectiveCapabilities?: EffectiveAgentCapabilitySnapshot;
snapshotHash: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
catalogRevision | property | catalogRevision?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
createdAt | property | createdAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
effectiveCapabilities | property | effectiveCapabilities?: EffectiveAgentCapabilitySnapshot | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
policyRevision | property | policyRevision?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
runId | property | runId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
snapshotHash | property | snapshotHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolContracts | property | toolContracts: 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
export interface ToolContractSnapshotItem {
toolId: string;
toolVersion: string;
toolRevision: string;
inputSchemaHash: string;
outputSchemaHash?: string;
sourceCapabilityHash?: string;
sideEffectLevel: SideEffectLevel;
adapterRef: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
adapterRef | property | adapterRef: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
inputSchemaHash | property | inputSchemaHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
outputSchemaHash | property | outputSchemaHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
sideEffectLevel | property | sideEffectLevel: SideEffectLevel | Public property; its type, readonly modifier and optionality are shown in the signature. |
sourceCapabilityHash | property | sourceCapabilityHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolId | property | toolId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolRevision | property | toolRevision: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolVersion | property | toolVersion: string | Public 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
export interface ToolContractSnapshotStore {
get(snapshotId: string): Promise<ToolContractSnapshot | null>;
save(snapshot: ToolContractSnapshot): Promise<void>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
get | method | get(snapshotId: string): Promise<ToolContractSnapshot | null> | Public method; parameters and return type are shown in the signature. |
save | method | save(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
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
| Member | Kind | Signature | Description |
|---|---|---|---|
attempt | property | attempt?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
contractSnapshotRef | property | contractSnapshotRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
error | property | error?: NormalizedToolError | Public property; its type, readonly modifier and optionality are shown in the signature. |
inputHash | property | inputHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
invocationId | property | invocationId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
latencyMs | property | latencyMs?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
operationId | property | operationId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
outputHash | property | outputHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
principalId | property | principalId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
scopeHash | property | scopeHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
sideEffectLevel | property | sideEffectLevel?: SideEffectLevel | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolId | property | toolId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolRevision | property | toolRevision?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolVersion | property | toolVersion?: string | Public 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
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
| Member | Kind | Signature | Description |
|---|---|---|---|
abortSignal | property | abortSignal?: AbortSignal | Public property; its type, readonly modifier and optionality are shown in the signature. |
agentId | property | agentId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
capabilityApprovals | property | capabilityApprovals?: EffectiveCapabilityApproval[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
capabilitySnapshotRef | property | capabilitySnapshotRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
causationId | property | causationId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
contractSnapshotRef | property | contractSnapshotRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
correlationId | property | correlationId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
deadlineAt | property | deadlineAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
fsmState | property | fsmState?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
idempotencyKey | property | idempotencyKey?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
invocationId | property | invocationId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
operationId | property | operationId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
parentEventId | property | parentEventId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
principal | property | principal: ToolPrincipalSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
runId | property | runId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
sessionId | property | sessionId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
stepId | property | stepId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
tenantId | property | tenantId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
userId | property | userId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
workspaceId | property | workspaceId?: string | Public 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
export interface ToolExecutionPolicySpec {
timeout: TimeoutPolicySpec;
retry: RetryPolicySpec;
cancellation?: ToolCancellationPolicySpec;
concurrency?: ToolConcurrencyPolicySpec;
lateResult?: ToolLateResultPolicySpec;
outputLimit?: ToolOutputLimitSpec;
environmentRef?: {
id: string;
version?: string;
revision?: string;
};
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
cancellation | property | cancellation?: ToolCancellationPolicySpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
concurrency | property | concurrency?: ToolConcurrencyPolicySpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
environmentRef | property | environmentRef?: { id: string; version?: string; revision?: string; } | Public property; its type, readonly modifier and optionality are shown in the signature. |
lateResult | property | lateResult?: ToolLateResultPolicySpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
outputLimit | property | outputLimit?: ToolOutputLimitSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
retry | property | retry: RetryPolicySpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
timeout | property | timeout: TimeoutPolicySpec | Public 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
export interface ToolExternalReceipt {
provider?: string;
receiptId: string;
status?: string;
committedAt?: string;
metadata?: Record<string, unknown>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
committedAt | property | committedAt?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
provider | property | provider?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
receiptId | property | receiptId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status?: string | Public 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
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
| Member | Kind | Signature | Description |
|---|---|---|---|
allowDelegation | property | allowDelegation?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
allowedPrincipalTypes | property | allowedPrincipalTypes?: ("system" | "agent" | "user" | "service")[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
approvalPolicy | property | approvalPolicy?: HumanReviewPolicySpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
auditPolicy | property | auditPolicy: { enabled: boolean; includeInput?: boolean; includeOutput?: boolean; redactPaths?: string[]; } | Public property; its type, readonly modifier and optionality are shown in the signature. |
deniedPermissionScopes | property | deniedPermissionScopes?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxDelegationDepth | property | maxDelegationDepth?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
policyRefs | property | policyRefs?: { id: string; version?: string; revision?: string; }[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
requiredPermissionScopes | property | requiredPermissionScopes: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
tenantIsolation | property | tenantIsolation?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
workspaceIsolation | property | workspaceIsolation?: boolean | Public 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
export interface ToolInvocationScopeSpec {
tenantId?: string;
userId: string;
workspaceId?: string;
sessionId: string;
runId: string;
stepId?: string;
agentId?: string;
fsmState?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
agentId | property | agentId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
fsmState | property | fsmState?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
runId | property | runId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
sessionId | property | sessionId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
stepId | property | stepId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
tenantId | property | tenantId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
userId | property | userId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
workspaceId | property | workspaceId?: string | Public 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
export interface ToolLateResultPolicySpec {
mode: 'discard' | 'accept' | 'quarantine' | 'reconcile';
reconciliationToolRef?: {
id: string;
version?: string;
revision?: string;
};
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
mode | property | mode: "reconcile" | "quarantine" | "discard" | "accept" | Public property; its type, readonly modifier and optionality are shown in the signature. |
reconciliationToolRef | property | reconciliationToolRef?: { 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
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
| Member | Kind | Signature | Description |
|---|---|---|---|
metricsEnabled | property | metricsEnabled?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
recordAttempts | property | recordAttempts?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
recordInput | property | recordInput?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
recordOutput | property | recordOutput?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
recordPolicyDecision | property | recordPolicyDecision?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
redactionPolicyRef | property | redactionPolicyRef?: { id: string; version?: string; revision?: string; } | Public property; its type, readonly modifier and optionality are shown in the signature. |
traceLevel | property | traceLevel: "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
export interface ToolOutputLimitSpec {
maxInlineBytes: number;
overflow: 'fail' | 'truncate' | 'artifact';
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
maxInlineBytes | property | maxInlineBytes: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
overflow | property | overflow: "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
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
| Member | Kind | Signature | Description |
|---|---|---|---|
agentId | property | agentId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
authenticationContext | property | authenticationContext?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
delegatedBy | property | delegatedBy?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
delegationDepth | property | delegationDepth?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
permissionScopes | property | permissionScopes: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
principalId | property | principalId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
roles | property | roles?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
tenantId | property | tenantId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
type | property | type: "system" | "agent" | "user" | "service" | Public property; its type, readonly modifier and optionality are shown in the signature. |
userId | property | userId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
workspaceId | property | workspaceId?: string | Public 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
export interface ToolSchemaSpec {
jsonSchema: JsonSchema;
schemaId?: string;
schemaVersion?: string;
schemaHash: string;
strict?: boolean;
allowAdditionalProperties?: boolean;
maxSerializedBytes?: number;
sensitivePaths?: string[];
redactedPaths?: string[];
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
allowAdditionalProperties | property | allowAdditionalProperties?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
jsonSchema | property | jsonSchema: JsonSchema | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxSerializedBytes | property | maxSerializedBytes?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
redactedPaths | property | redactedPaths?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
schemaHash | property | schemaHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
schemaId | property | schemaId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
schemaVersion | property | schemaVersion?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
sensitivePaths | property | sensitivePaths?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
strict | property | strict?: boolean | Public 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
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
| Member | Kind | Signature | Description |
|---|---|---|---|
destructiveHint | property | destructiveHint?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
deterministic | property | deterministic?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
expectedArtifacts | property | expectedArtifacts?: ToolArtifactContract[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
idempotency | property | idempotency: "none" | "caller_key" | "derived_key" | "provider_key" | "intrinsic" | Public property; its type, readonly modifier and optionality are shown in the signature. |
openWorldHint | property | openWorldHint?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
postconditions | property | postconditions?: PolicyRuleSpec[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
preconditions | property | preconditions?: PolicyRuleSpec[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
readOnlyHint | property | readOnlyHint?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
resultSemantics | property | resultSemantics?: "artifact" | "observation" | "state_patch" | "external_receipt" | Public property; its type, readonly modifier and optionality are shown in the signature. |
sideEffectLevel | property | sideEffectLevel: SideEffectLevel | Public 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
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
| Member | Kind | Signature | Description |
|---|---|---|---|
adapterId | property | adapterId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
endpointRef | property | endpointRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
handlerId | property | handlerId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
hostedToolId | property | hostedToolId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
mcpCapabilityHash | property | mcpCapabilityHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
mcpCapabilityId | property | mcpCapabilityId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
mcpServerId | property | mcpServerId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
pluginId | property | pluginId?: string | Public 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
export interface ToolStreamingSpec {
enabled: boolean;
supportsProgress?: boolean;
supportsStructuredContent?: boolean;
maxUpdates?: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
enabled | property | enabled: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxUpdates | property | maxUpdates?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
supportsProgress | property | supportsProgress?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
supportsStructuredContent | property | supportsStructuredContent?: boolean | Public 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
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
export type ToolSource = 'local' | 'mcp' | 'http' | 'plugin' | 'hosted' | 'execution' | 'custom';