Skip to content

@codesoul-co/hypha-adapters-local / legacy-tool-artifact-inventory

Using this module

Use the Legacy tool artifact inventory module for using the public contracts and operations for this capability boundary. It exports 2 classes, 3 interfaces, 1 type.

Import from the package entrypoint

ts
import {
  LegacyToolArtifactInventory,
  LegacyToolArtifactInventoryError,
} from '@codesoul-co/hypha-adapters-local';

import type {
  LegacyToolArtifactInventoryEntry,
  LegacyToolArtifactInventoryOptions,
  LegacyToolArtifactInventoryResult,
  LegacyToolArtifactInventoryErrorCode,
} from '@codesoul-co/hypha-adapters-local';

Usage patterns

  • Use the 4 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 2 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
LegacyToolArtifactInventoryclassnew LegacyToolArtifactInventory(options: LegacyToolArtifactInventoryOptions): LegacyToolArtifactInventoryBuilds a deterministic, bounded, read-only inventory of old Tool outputs.
LegacyToolArtifactInventoryErrorclassnew LegacyToolArtifactInventoryError(code: LegacyToolArtifactInventoryErrorCode, message: string, details?: Record<string, unknown> | undefined): LegacyToolArtifactInventoryErrorLegacy Tool Artifact Inventory Error class with 10 public constructor or member entries; its exact declarations are listed below.
LegacyToolArtifactInventoryEntryinterfaceinterface LegacyToolArtifactInventoryEntryDescribes an old Tool output without treating sanitized path segments as authoritative Tool or Invocation identities.
LegacyToolArtifactInventoryOptionsinterfaceinterface LegacyToolArtifactInventoryOptionsLegacy Tool Artifact Inventory Options interface with 4 public fields or methods.
LegacyToolArtifactInventoryResultinterfaceinterface LegacyToolArtifactInventoryResultLegacy Tool Artifact Inventory Result interface with 2 public fields or methods.
LegacyToolArtifactInventoryErrorCodetypetype LegacyToolArtifactInventoryErrorCode = 'LEGACY_INVENTORY_INVALID_ROOT' | 'LEGACY_INVENTORY_INVALID_LAYOUT' | 'LEGACY_INVENTORY_LIMIT_EXCEEDED' | 'LEGACY_INVENTORY_SOURCE_CHANGED'Public type alias for Legacy Tool Artifact Inventory Error Code; the declaration contains its complete type expression.

LegacyToolArtifactInventory

Builds a deterministic, bounded, read-only inventory of old Tool outputs.

Declaration

text
export declare class LegacyToolArtifactInventory {
    constructor(options: LegacyToolArtifactInventoryOptions);
    scan(): Promise<LegacyToolArtifactInventoryResult>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: LegacyToolArtifactInventoryOptions): LegacyToolArtifactInventoryCreates an instance of this class.
scanmethodscan(): Promise<LegacyToolArtifactInventoryResult>Public method; parameters and return type are shown in the signature.

LegacyToolArtifactInventoryError

Legacy Tool Artifact Inventory Error class with 10 public constructor or member entries; its exact declarations are listed below.

Declaration

text
export declare class LegacyToolArtifactInventoryError extends Error {
    readonly code: LegacyToolArtifactInventoryErrorCode;
    readonly details?: Record<string, unknown> | undefined;
    constructor(code: LegacyToolArtifactInventoryErrorCode, message: string, details?: Record<string, unknown> | undefined);
}

Public members

MemberKindSignatureDescription
causepropertycause?: unknownPublic property; its type, readonly modifier and optionality are shown in the signature.
codepropertyreadonly code: LegacyToolArtifactInventoryErrorCodePublic property; its type, readonly modifier and optionality are shown in the signature.
constructorconstructor(code: LegacyToolArtifactInventoryErrorCode, message: string, details?: Record<string, unknown> | undefined): LegacyToolArtifactInventoryErrorCreates an instance of this class.
detailspropertyreadonly details?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
messagepropertymessage: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
stackpropertystack?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
static captureStackTracemethodstatic captureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called. js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}. The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace. The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance: js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a();
static prepareStackTracemethodstatic prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): anyPublic method; parameters and return type are shown in the signature.
static stackTraceLimitpropertystatic stackTraceLimit: numberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

LegacyToolArtifactInventoryEntry

Describes an old Tool output without treating sanitized path segments as authoritative Tool or Invocation identities.

  • Kind: interface
  • Import: import type { LegacyToolArtifactInventoryEntry } from '@codesoul-co/hypha-adapters-local';
  • Source module: legacy-tool-artifact-inventory

Declaration

text
export interface LegacyToolArtifactInventoryEntry {
    relativePath: string;
    legacyArtifactId: string;
    contentHash: string;
    sizeBytes: number;
    mimeType: 'application/json' | 'text/plain';
    legacyToolPathSegment: string;
    legacyInvocationPathSegment: string;
}

Contract members

MemberKindSignatureDescription
contentHashpropertycontentHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
legacyArtifactIdpropertylegacyArtifactId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
legacyInvocationPathSegmentpropertylegacyInvocationPathSegment: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
legacyToolPathSegmentpropertylegacyToolPathSegment: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
mimeTypepropertymimeType: "application/json" | "text/plain"Public property; its type, readonly modifier and optionality are shown in the signature.
relativePathpropertyrelativePath: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sizeBytespropertysizeBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

LegacyToolArtifactInventoryOptions

Legacy Tool Artifact Inventory Options interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { LegacyToolArtifactInventoryOptions } from '@codesoul-co/hypha-adapters-local';
  • Source module: legacy-tool-artifact-inventory

Declaration

text
export interface LegacyToolArtifactInventoryOptions {
    legacyRootPath: string;
    maxEntries?: number;
    maxFileBytes?: number;
    maxTotalBytes?: number;
}

Contract members

MemberKindSignatureDescription
legacyRootPathpropertylegacyRootPath: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
maxEntriespropertymaxEntries?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxFileBytespropertymaxFileBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxTotalBytespropertymaxTotalBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

LegacyToolArtifactInventoryResult

Legacy Tool Artifact Inventory Result interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { LegacyToolArtifactInventoryResult } from '@codesoul-co/hypha-adapters-local';
  • Source module: legacy-tool-artifact-inventory

Declaration

text
export interface LegacyToolArtifactInventoryResult {
    entries: LegacyToolArtifactInventoryEntry[];
    totalBytes: number;
}

Contract members

MemberKindSignatureDescription
entriespropertyentries: LegacyToolArtifactInventoryEntry[]Public property; its type, readonly modifier and optionality are shown in the signature.
totalBytespropertytotalBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

LegacyToolArtifactInventoryErrorCode

Public type alias for Legacy Tool Artifact Inventory Error Code; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { LegacyToolArtifactInventoryErrorCode } from '@codesoul-co/hypha-adapters-local';
  • Source module: legacy-tool-artifact-inventory

Declaration

text
export type LegacyToolArtifactInventoryErrorCode = 'LEGACY_INVENTORY_INVALID_ROOT' | 'LEGACY_INVENTORY_INVALID_LAYOUT' | 'LEGACY_INVENTORY_LIMIT_EXCEEDED' | 'LEGACY_INVENTORY_SOURCE_CHANGED';