Skip to content

@codesoul-co/hypha-adapters-local / legacy-tool-artifact-migration-executor

Using this module

Use the Legacy tool artifact migration executor module for executing runtime behavior at this boundary. It exports 2 classes, 7 interfaces, 1 type.

Import from the package entrypoint

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

import type {
  LegacyToolArtifactMigrationExecuteRequest,
  LegacyToolArtifactMigrationExecutionItem,
  LegacyToolArtifactMigrationExecutionResult,
  LegacyToolArtifactMigrationExecutionSummary,
  LegacyToolArtifactMigrationExecutorOptions,
  LegacyToolArtifactMigrationFailure,
  LegacyToolArtifactMigrationTargetSummary,
  LegacyToolArtifactMigrationExecutionErrorCode,
} from '@codesoul-co/hypha-adapters-local';

Usage patterns

  • Use the 8 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
LegacyToolArtifactMigrationExecutionErrorclassnew LegacyToolArtifactMigrationExecutionError(code: LegacyToolArtifactMigrationExecutionErrorCode, message: string, details?: Record<string, unknown> | undefined): LegacyToolArtifactMigrationExecutionErrorLegacy Tool Artifact Migration Execution Error class with 10 public constructor or member entries; its exact declarations are listed below.
LegacyToolArtifactMigrationExecutorclassnew LegacyToolArtifactMigrationExecutor(options: LegacyToolArtifactMigrationExecutorOptions): LegacyToolArtifactMigrationExecutorExecutes a prevalidated migration plan sequentially. It never deletes or mutates legacy source files, and individual import failures remain isolated.
LegacyToolArtifactMigrationExecuteRequestinterfaceinterface LegacyToolArtifactMigrationExecuteRequestLegacy Tool Artifact Migration Execute Request interface with 2 public fields or methods.
LegacyToolArtifactMigrationExecutionIteminterfaceinterface LegacyToolArtifactMigrationExecutionItemLegacy Tool Artifact Migration Execution Item interface with 10 public fields or methods.
LegacyToolArtifactMigrationExecutionResultinterfaceinterface LegacyToolArtifactMigrationExecutionResultLegacy Tool Artifact Migration Execution Result interface with 6 public fields or methods.
LegacyToolArtifactMigrationExecutionSummaryinterfaceinterface LegacyToolArtifactMigrationExecutionSummaryLegacy Tool Artifact Migration Execution Summary interface with 5 public fields or methods.
LegacyToolArtifactMigrationExecutorOptionsinterfaceinterface LegacyToolArtifactMigrationExecutorOptionsLegacy Tool Artifact Migration Executor Options interface with 2 public fields or methods.
LegacyToolArtifactMigrationFailureinterfaceinterface LegacyToolArtifactMigrationFailureLegacy Tool Artifact Migration Failure interface with 3 public fields or methods.
LegacyToolArtifactMigrationTargetSummaryinterfaceinterface LegacyToolArtifactMigrationTargetSummaryLegacy Tool Artifact Migration Target Summary interface with 4 public fields or methods.
LegacyToolArtifactMigrationExecutionErrorCodetypetype LegacyToolArtifactMigrationExecutionErrorCode = 'LEGACY_MIGRATION_EXECUTION_INVALID_PLAN' | 'LEGACY_MIGRATION_EXECUTION_LIMIT_EXCEEDED' | 'LEGACY_MIGRATION_RESULT_MISMATCH'Public type alias for Legacy Tool Artifact Migration Execution Error Code; the declaration contains its complete type expression.

LegacyToolArtifactMigrationExecutionError

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

Declaration

text
export declare class LegacyToolArtifactMigrationExecutionError extends Error {
    readonly code: LegacyToolArtifactMigrationExecutionErrorCode;
    readonly details?: Record<string, unknown> | undefined;
    constructor(code: LegacyToolArtifactMigrationExecutionErrorCode, 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: LegacyToolArtifactMigrationExecutionErrorCodePublic property; its type, readonly modifier and optionality are shown in the signature.
constructorconstructor(code: LegacyToolArtifactMigrationExecutionErrorCode, message: string, details?: Record<string, unknown> | undefined): LegacyToolArtifactMigrationExecutionErrorCreates 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.

LegacyToolArtifactMigrationExecutor

Executes a prevalidated migration plan sequentially. It never deletes or mutates legacy source files, and individual import failures remain isolated.

Declaration

text
export declare class LegacyToolArtifactMigrationExecutor {
    constructor(options: LegacyToolArtifactMigrationExecutorOptions);
    execute(request: LegacyToolArtifactMigrationExecuteRequest): Promise<LegacyToolArtifactMigrationExecutionResult>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: LegacyToolArtifactMigrationExecutorOptions): LegacyToolArtifactMigrationExecutorCreates an instance of this class.
executemethodexecute(request: LegacyToolArtifactMigrationExecuteRequest): Promise<LegacyToolArtifactMigrationExecutionResult>Public method; parameters and return type are shown in the signature.

LegacyToolArtifactMigrationExecuteRequest

Legacy Tool Artifact Migration Execute Request interface with 2 public fields or methods.

Declaration

text
export interface LegacyToolArtifactMigrationExecuteRequest {
    plan: LegacyToolArtifactMigrationPlan;
    dryRun?: boolean;
}

Contract members

MemberKindSignatureDescription
dryRunpropertydryRun?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
planpropertyplan: LegacyToolArtifactMigrationPlanPublic property; its type, readonly modifier and optionality are shown in the signature.

LegacyToolArtifactMigrationExecutionItem

Legacy Tool Artifact Migration Execution Item interface with 10 public fields or methods.

Declaration

text
export interface LegacyToolArtifactMigrationExecutionItem {
    relativePath: string;
    legacyArtifactId: string;
    target: LegacyToolArtifactMigrationTargetSummary;
    status: 'dry_run' | 'imported' | 'failed';
    artifactId?: string;
    versionId?: string;
    revision?: number;
    contentHash?: string;
    sizeBytes?: number;
    failure?: LegacyToolArtifactMigrationFailure;
}

Contract members

MemberKindSignatureDescription
artifactIdpropertyartifactId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
contentHashpropertycontentHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
failurepropertyfailure?: LegacyToolArtifactMigrationFailurePublic 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.
relativePathpropertyrelativePath: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
sizeBytespropertysizeBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: "failed" | "imported" | "dry_run"Public property; its type, readonly modifier and optionality are shown in the signature.
targetpropertytarget: LegacyToolArtifactMigrationTargetSummaryPublic property; its type, readonly modifier and optionality are shown in the signature.
versionIdpropertyversionId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

LegacyToolArtifactMigrationExecutionResult

Legacy Tool Artifact Migration Execution Result interface with 6 public fields or methods.

Declaration

text
export interface LegacyToolArtifactMigrationExecutionResult {
    planHash: string;
    reportId: string;
    mode: 'dry_run' | 'execute';
    items: LegacyToolArtifactMigrationExecutionItem[];
    skipped: LegacyToolArtifactMigrationSkipPlanItem[];
    summary: LegacyToolArtifactMigrationExecutionSummary;
}

Contract members

MemberKindSignatureDescription
itemspropertyitems: LegacyToolArtifactMigrationExecutionItem[]Public property; its type, readonly modifier and optionality are shown in the signature.
modepropertymode: "execute" | "dry_run"Public property; its type, readonly modifier and optionality are shown in the signature.
planHashpropertyplanHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
reportIdpropertyreportId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
skippedpropertyskipped: LegacyToolArtifactMigrationSkipPlanItem[]Public property; its type, readonly modifier and optionality are shown in the signature.
summarypropertysummary: LegacyToolArtifactMigrationExecutionSummaryPublic property; its type, readonly modifier and optionality are shown in the signature.

LegacyToolArtifactMigrationExecutionSummary

Legacy Tool Artifact Migration Execution Summary interface with 5 public fields or methods.

Declaration

text
export interface LegacyToolArtifactMigrationExecutionSummary {
    planned: number;
    dryRun: number;
    imported: number;
    failed: number;
    skipped: number;
}

Contract members

MemberKindSignatureDescription
dryRunpropertydryRun: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
failedpropertyfailed: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
importedpropertyimported: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
plannedpropertyplanned: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
skippedpropertyskipped: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

LegacyToolArtifactMigrationExecutorOptions

Legacy Tool Artifact Migration Executor Options interface with 2 public fields or methods.

Declaration

text
export interface LegacyToolArtifactMigrationExecutorOptions {
    importer: Pick<LegacyToolArtifactImporter, 'import'>;
    maxImports?: number;
}

Contract members

MemberKindSignatureDescription
importerpropertyimporter: Pick<LegacyToolArtifactImporter, "import">Public property; its type, readonly modifier and optionality are shown in the signature.
maxImportspropertymaxImports?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

LegacyToolArtifactMigrationFailure

Legacy Tool Artifact Migration Failure interface with 3 public fields or methods.

Declaration

text
export interface LegacyToolArtifactMigrationFailure {
    name: string;
    code?: string;
    message: string;
}

Contract members

MemberKindSignatureDescription
codepropertycode?: stringPublic 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.

LegacyToolArtifactMigrationTargetSummary

Legacy Tool Artifact Migration Target Summary interface with 4 public fields or methods.

Declaration

text
export interface LegacyToolArtifactMigrationTargetSummary {
    principalId: string;
    workspaceId: string;
    toolId: string;
    invocationId: string;
}

Contract members

MemberKindSignatureDescription
invocationIdpropertyinvocationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
principalIdpropertyprincipalId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
toolIdpropertytoolId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
workspaceIdpropertyworkspaceId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

LegacyToolArtifactMigrationExecutionErrorCode

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

Declaration

text
export type LegacyToolArtifactMigrationExecutionErrorCode = 'LEGACY_MIGRATION_EXECUTION_INVALID_PLAN' | 'LEGACY_MIGRATION_EXECUTION_LIMIT_EXCEEDED' | 'LEGACY_MIGRATION_RESULT_MISMATCH';