@codesoul-co/hypha-adapters-local / legacy-tool-artifact-migration-executor
- 包索引:
@codesoul-co/hypha-adapters-local - 源码:
packages/adapters-local/src/legacy-tool-artifact-migration-executor.ts - 导出数: 10
模块用法
用于执行该边界的运行时行为。Legacy tool artifact migration executor 模块公开 2 类、7 接口、1 类型。
从包入口导入
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';使用要点
- 8 个类型/接口用于应用代码、Adapter 或测试中的静态契约;请使用
import type,运行时不应依赖它们。 - 2 个类提供可实例化的运行时实现;构造参数与公开方法在各自条目中完整列出。
公共导出
| Symbol | 种类 | 签名 | 说明 |
|---|---|---|---|
LegacyToolArtifactMigrationExecutionError | 类 | new LegacyToolArtifactMigrationExecutionError(code: LegacyToolArtifactMigrationExecutionErrorCode, message: string, details?: Record<string, unknown> | undefined): LegacyToolArtifactMigrationExecutionError | Legacy Tool Artifact Migration Execution Error 类,共公开 10 个构造函数或成员;精确签名见本条目的声明与成员表。 |
LegacyToolArtifactMigrationExecutor | 类 | new LegacyToolArtifactMigrationExecutor(options: LegacyToolArtifactMigrationExecutorOptions): LegacyToolArtifactMigrationExecutor | Executes a prevalidated migration plan sequentially. It never deletes or mutates legacy source files, and individual import failures remain isolated. |
LegacyToolArtifactMigrationExecuteRequest | 接口 | interface LegacyToolArtifactMigrationExecuteRequest | Legacy Tool Artifact Migration Execute Request 接口,共包含 2 个公开字段或方法。 |
LegacyToolArtifactMigrationExecutionItem | 接口 | interface LegacyToolArtifactMigrationExecutionItem | Legacy Tool Artifact Migration Execution Item 接口,共包含 10 个公开字段或方法。 |
LegacyToolArtifactMigrationExecutionResult | 接口 | interface LegacyToolArtifactMigrationExecutionResult | Legacy Tool Artifact Migration Execution Result 接口,共包含 6 个公开字段或方法。 |
LegacyToolArtifactMigrationExecutionSummary | 接口 | interface LegacyToolArtifactMigrationExecutionSummary | Legacy Tool Artifact Migration Execution Summary 接口,共包含 5 个公开字段或方法。 |
LegacyToolArtifactMigrationExecutorOptions | 接口 | interface LegacyToolArtifactMigrationExecutorOptions | Legacy Tool Artifact Migration Executor Options 接口,共包含 2 个公开字段或方法。 |
LegacyToolArtifactMigrationFailure | 接口 | interface LegacyToolArtifactMigrationFailure | Legacy Tool Artifact Migration Failure 接口,共包含 3 个公开字段或方法。 |
LegacyToolArtifactMigrationTargetSummary | 接口 | interface LegacyToolArtifactMigrationTargetSummary | Legacy Tool Artifact Migration Target Summary 接口,共包含 4 个公开字段或方法。 |
LegacyToolArtifactMigrationExecutionErrorCode | 类型 | type LegacyToolArtifactMigrationExecutionErrorCode = 'LEGACY_MIGRATION_EXECUTION_INVALID_PLAN' | 'LEGACY_MIGRATION_EXECUTION_LIMIT_EXCEEDED' | 'LEGACY_MIGRATION_RESULT_MISMATCH' | Legacy Tool Artifact Migration Execution Error Code 公共类型别名;完整类型表达式见声明。 |
LegacyToolArtifactMigrationExecutionError
Legacy Tool Artifact Migration Execution Error 类,共公开 10 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { LegacyToolArtifactMigrationExecutionError } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
legacy-tool-artifact-migration-executor
声明
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);
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
cause | 属性 | cause?: unknown | 公开属性;类型、只读和可选状态以签名列为准。 |
code | 属性 | readonly code: LegacyToolArtifactMigrationExecutionErrorCode | 公开属性;类型、只读和可选状态以签名列为准。 |
constructor | 构造函数 | (code: LegacyToolArtifactMigrationExecutionErrorCode, message: string, details?: Record<string, unknown> | undefined): LegacyToolArtifactMigrationExecutionError | 创建该类的实例。 |
details | 属性 | readonly details?: Record<string, unknown> | 公开属性;类型、只读和可选状态以签名列为准。 |
message | 属性 | message: string | 公开属性;类型、只读和可选状态以签名列为准。 |
name | 属性 | name: string | 公开属性;类型、只读和可选状态以签名列为准。 |
stack | 属性 | stack?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
static captureStackTrace | 方法 | static captureStackTrace(targetObject: object, constructorOpt?: Function): void | Creates 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 prepareStackTrace | 方法 | static prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any | 公开方法;参数与返回类型以签名列为准。 |
static stackTraceLimit | 属性 | static stackTraceLimit: number | The 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.
- 种类: 类
- 导入:
import { LegacyToolArtifactMigrationExecutor } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
legacy-tool-artifact-migration-executor
声明
export declare class LegacyToolArtifactMigrationExecutor {
constructor(options: LegacyToolArtifactMigrationExecutorOptions);
execute(request: LegacyToolArtifactMigrationExecuteRequest): Promise<LegacyToolArtifactMigrationExecutionResult>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (options: LegacyToolArtifactMigrationExecutorOptions): LegacyToolArtifactMigrationExecutor | 创建该类的实例。 |
execute | 方法 | execute(request: LegacyToolArtifactMigrationExecuteRequest): Promise<LegacyToolArtifactMigrationExecutionResult> | 公开方法;参数与返回类型以签名列为准。 |
LegacyToolArtifactMigrationExecuteRequest
Legacy Tool Artifact Migration Execute Request 接口,共包含 2 个公开字段或方法。
- 种类: 接口
- 导入:
import type { LegacyToolArtifactMigrationExecuteRequest } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
legacy-tool-artifact-migration-executor
声明
export interface LegacyToolArtifactMigrationExecuteRequest {
plan: LegacyToolArtifactMigrationPlan;
dryRun?: boolean;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
dryRun | 属性 | dryRun?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
plan | 属性 | plan: LegacyToolArtifactMigrationPlan | 公开属性;类型、只读和可选状态以签名列为准。 |
LegacyToolArtifactMigrationExecutionItem
Legacy Tool Artifact Migration Execution Item 接口,共包含 10 个公开字段或方法。
- 种类: 接口
- 导入:
import type { LegacyToolArtifactMigrationExecutionItem } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
legacy-tool-artifact-migration-executor
声明
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;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
artifactId | 属性 | artifactId?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
contentHash | 属性 | contentHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
failure | 属性 | failure?: LegacyToolArtifactMigrationFailure | 公开属性;类型、只读和可选状态以签名列为准。 |
legacyArtifactId | 属性 | legacyArtifactId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
relativePath | 属性 | relativePath: string | 公开属性;类型、只读和可选状态以签名列为准。 |
revision | 属性 | revision?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
sizeBytes | 属性 | sizeBytes?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
status | 属性 | status: "failed" | "imported" | "dry_run" | 公开属性;类型、只读和可选状态以签名列为准。 |
target | 属性 | target: LegacyToolArtifactMigrationTargetSummary | 公开属性;类型、只读和可选状态以签名列为准。 |
versionId | 属性 | versionId?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
LegacyToolArtifactMigrationExecutionResult
Legacy Tool Artifact Migration Execution Result 接口,共包含 6 个公开字段或方法。
- 种类: 接口
- 导入:
import type { LegacyToolArtifactMigrationExecutionResult } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
legacy-tool-artifact-migration-executor
声明
export interface LegacyToolArtifactMigrationExecutionResult {
planHash: string;
reportId: string;
mode: 'dry_run' | 'execute';
items: LegacyToolArtifactMigrationExecutionItem[];
skipped: LegacyToolArtifactMigrationSkipPlanItem[];
summary: LegacyToolArtifactMigrationExecutionSummary;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
items | 属性 | items: LegacyToolArtifactMigrationExecutionItem[] | 公开属性;类型、只读和可选状态以签名列为准。 |
mode | 属性 | mode: "execute" | "dry_run" | 公开属性;类型、只读和可选状态以签名列为准。 |
planHash | 属性 | planHash: string | 公开属性;类型、只读和可选状态以签名列为准。 |
reportId | 属性 | reportId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
skipped | 属性 | skipped: LegacyToolArtifactMigrationSkipPlanItem[] | 公开属性;类型、只读和可选状态以签名列为准。 |
summary | 属性 | summary: LegacyToolArtifactMigrationExecutionSummary | 公开属性;类型、只读和可选状态以签名列为准。 |
LegacyToolArtifactMigrationExecutionSummary
Legacy Tool Artifact Migration Execution Summary 接口,共包含 5 个公开字段或方法。
- 种类: 接口
- 导入:
import type { LegacyToolArtifactMigrationExecutionSummary } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
legacy-tool-artifact-migration-executor
声明
export interface LegacyToolArtifactMigrationExecutionSummary {
planned: number;
dryRun: number;
imported: number;
failed: number;
skipped: number;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
dryRun | 属性 | dryRun: number | 公开属性;类型、只读和可选状态以签名列为准。 |
failed | 属性 | failed: number | 公开属性;类型、只读和可选状态以签名列为准。 |
imported | 属性 | imported: number | 公开属性;类型、只读和可选状态以签名列为准。 |
planned | 属性 | planned: number | 公开属性;类型、只读和可选状态以签名列为准。 |
skipped | 属性 | skipped: number | 公开属性;类型、只读和可选状态以签名列为准。 |
LegacyToolArtifactMigrationExecutorOptions
Legacy Tool Artifact Migration Executor Options 接口,共包含 2 个公开字段或方法。
- 种类: 接口
- 导入:
import type { LegacyToolArtifactMigrationExecutorOptions } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
legacy-tool-artifact-migration-executor
声明
export interface LegacyToolArtifactMigrationExecutorOptions {
importer: Pick<LegacyToolArtifactImporter, 'import'>;
maxImports?: number;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
importer | 属性 | importer: Pick<LegacyToolArtifactImporter, "import"> | 公开属性;类型、只读和可选状态以签名列为准。 |
maxImports | 属性 | maxImports?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
LegacyToolArtifactMigrationFailure
Legacy Tool Artifact Migration Failure 接口,共包含 3 个公开字段或方法。
- 种类: 接口
- 导入:
import type { LegacyToolArtifactMigrationFailure } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
legacy-tool-artifact-migration-executor
声明
export interface LegacyToolArtifactMigrationFailure {
name: string;
code?: string;
message: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
code | 属性 | code?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
message | 属性 | message: string | 公开属性;类型、只读和可选状态以签名列为准。 |
name | 属性 | name: string | 公开属性;类型、只读和可选状态以签名列为准。 |
LegacyToolArtifactMigrationTargetSummary
Legacy Tool Artifact Migration Target Summary 接口,共包含 4 个公开字段或方法。
- 种类: 接口
- 导入:
import type { LegacyToolArtifactMigrationTargetSummary } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
legacy-tool-artifact-migration-executor
声明
export interface LegacyToolArtifactMigrationTargetSummary {
principalId: string;
workspaceId: string;
toolId: string;
invocationId: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
invocationId | 属性 | invocationId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
principalId | 属性 | principalId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
toolId | 属性 | toolId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
workspaceId | 属性 | workspaceId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
LegacyToolArtifactMigrationExecutionErrorCode
Legacy Tool Artifact Migration Execution Error Code 公共类型别名;完整类型表达式见声明。
- 种类: 类型
- 导入:
import type { LegacyToolArtifactMigrationExecutionErrorCode } from '@codesoul-co/hypha-adapters-local'; - 源码模块:
legacy-tool-artifact-migration-executor
声明
export type LegacyToolArtifactMigrationExecutionErrorCode = 'LEGACY_MIGRATION_EXECUTION_INVALID_PLAN' | 'LEGACY_MIGRATION_EXECUTION_LIMIT_EXCEEDED' | 'LEGACY_MIGRATION_RESULT_MISMATCH';