@codesoul-co/hypha-core / contracts/workspace
- 包索引:
@codesoul-co/hypha-core - 源码:
packages/core/src/contracts/workspace.ts - 导出数: 39
模块用法
用于声明并运行时校验契约。Workspace 模块公开 30 接口、9 类型。
从包入口导入
import type {
FileMutation,
ResolvedWorkspacePath,
WorkspaceCleanupPolicySpec,
WorkspaceDeleteRequest,
WorkspaceDiffRequest,
WorkspaceDiffResult,
WorkspaceDiffSummary,
WorkspaceDirectorySpec,
} from '@codesoul-co/hypha-core';
// 完整导出列表见下方。使用要点
- 39 个类型/接口用于应用代码、Adapter 或测试中的静态契约;请使用
import type,运行时不应依赖它们。
公共导出
| Symbol | 种类 | 签名 | 说明 |
|---|---|---|---|
FileMutation | 接口 | interface FileMutation | File Mutation 接口,共包含 9 个公开字段或方法。 |
ResolvedWorkspacePath | 接口 | interface ResolvedWorkspacePath | Resolved Workspace Path 接口,共包含 8 个公开字段或方法。 |
WorkspaceCleanupPolicySpec | 接口 | interface WorkspaceCleanupPolicySpec | Workspace Cleanup Policy Spec 接口,共包含 6 个公开字段或方法。 |
WorkspaceDeleteRequest | 接口 | interface WorkspaceDeleteRequest | Workspace Delete Request 接口,共包含 7 个公开字段或方法。 |
WorkspaceDiffRequest | 接口 | interface WorkspaceDiffRequest | Workspace Diff Request 接口,共包含 6 个公开字段或方法。 |
WorkspaceDiffResult | 接口 | interface WorkspaceDiffResult | Workspace Diff Result 接口,共包含 5 个公开字段或方法。 |
WorkspaceDiffSummary | 接口 | interface WorkspaceDiffSummary | Workspace Diff Summary 接口,共包含 7 个公开字段或方法。 |
WorkspaceDirectorySpec | 接口 | interface WorkspaceDirectorySpec | Workspace Directory Spec 接口,共包含 9 个公开字段或方法。 |
WorkspaceEventPayload | 接口 | interface WorkspaceEventPayload | Workspace Event Payload 接口,共包含 12 个公开字段或方法。 |
WorkspaceFileEntry | 接口 | interface WorkspaceFileEntry | Workspace File Entry 接口,共包含 6 个公开字段或方法。 |
WorkspaceListRequest | 接口 | interface WorkspaceListRequest | Workspace List Request 接口,共包含 7 个公开字段或方法。 |
WorkspaceMutationPolicySpec | 接口 | interface WorkspaceMutationPolicySpec | Workspace Mutation Policy Spec 接口,共包含 7 个公开字段或方法。 |
WorkspacePatchConflict | 接口 | interface WorkspacePatchConflict | Workspace Patch Conflict 接口,共包含 4 个公开字段或方法。 |
WorkspacePatchRequest | 接口 | interface WorkspacePatchRequest | Workspace Patch Request 接口,共包含 8 个公开字段或方法。 |
WorkspacePatchResult | 接口 | interface WorkspacePatchResult | Workspace Patch Result 接口,共包含 5 个公开字段或方法。 |
WorkspacePathPolicySpec | 接口 | interface WorkspacePathPolicySpec | Workspace Path Policy Spec 接口,共包含 12 个公开字段或方法。 |
WorkspacePathRequest | 接口 | interface WorkspacePathRequest | Workspace Path Request 接口,共包含 5 个公开字段或方法。 |
WorkspaceQuotaSpec | 接口 | interface WorkspaceQuotaSpec | Workspace Quota Spec 接口,共包含 6 个公开字段或方法。 |
WorkspaceReadRequest | 接口 | interface WorkspaceReadRequest | Workspace Read Request 接口,共包含 7 个公开字段或方法。 |
WorkspaceReadResult | 接口 | interface WorkspaceReadResult | Workspace Read Result 接口,共包含 7 个公开字段或方法。 |
WorkspaceRecord | 接口 | interface WorkspaceRecord | Workspace Record 接口,共包含 22 个公开字段或方法。 |
WorkspaceRestoreRequest | 接口 | interface WorkspaceRestoreRequest | Workspace Restore Request 接口,共包含 6 个公开字段或方法。 |
WorkspaceSnapshotEntry | 接口 | interface WorkspaceSnapshotEntry | Workspace Snapshot Entry 接口,共包含 7 个公开字段或方法。 |
WorkspaceSnapshotManifest | 接口 | interface WorkspaceSnapshotManifest | Workspace Snapshot Manifest 接口,共包含 12 个公开字段或方法。 |
WorkspaceSnapshotPolicySpec | 接口 | interface WorkspaceSnapshotPolicySpec | Workspace Snapshot Policy Spec 接口,共包含 6 个公开字段或方法。 |
WorkspaceSnapshotRequest | 接口 | interface WorkspaceSnapshotRequest | Workspace Snapshot Request 接口,共包含 10 个公开字段或方法。 |
WorkspaceSpec | 接口 | interface WorkspaceSpec extends VersionedSpec, SpecMetadata | Workspace Spec 接口,共包含 21 个公开字段或方法。 |
WorkspaceUsage | 接口 | interface WorkspaceUsage | Workspace Usage 接口,共包含 4 个公开字段或方法。 |
WorkspaceWriteRequest | 接口 | interface WorkspaceWriteRequest | Workspace Write Request 接口,共包含 10 个公开字段或方法。 |
WorkspaceWriteResult | 接口 | interface WorkspaceWriteResult | Workspace Write Result 接口,共包含 6 个公开字段或方法。 |
WorkspaceEntryKind | 类型 | type WorkspaceEntryKind = 'file' | 'directory' | 'symlink' | 'other' | Workspace Entry Kind 公共类型别名;完整类型表达式见声明。 |
WorkspaceEventCreateInput | 类型 | type WorkspaceEventCreateInput = Omit<EventCreateInput<WorkspaceEventPayloadMap[TType]>, 'type' | 'workspaceId'> & { type: TType; workspaceId: string; } | Workspace Event Create Input 公共类型别名;完整类型表达式见声明。 |
WorkspaceEventPayloadMap | 类型 | type WorkspaceEventPayloadMap = { 'workspace.create.requested': WorkspaceEventPayloadWithRequired<'operationId' | 'profileRef'>; 'workspace.created': WorkspaceEventPayloadWithRequired<'operationId' | 'profileRef' | 'status'>; 'workspace.ready': WorkspaceStatusEventPayload<'ready'>; 'workspace.busy': WorkspaceStatusEventPayload<'busy'>; 'workspace.path.resolved': WorkspaceEventPayloadWithRequired<'operationId'>; 'w... | Workspace Event Payload Map 公共类型别名;完整类型表达式见声明。 |
WorkspaceFrameworkEvent | 类型 | type WorkspaceFrameworkEvent = Omit<FrameworkEvent<WorkspaceEventPayloadMap[TType]>, 'type' | 'workspaceId'> & { type: TType; workspaceId: string; } | Workspace Framework Event 公共类型别名;完整类型表达式见声明。 |
WorkspaceFrameworkEventType | 类型 | type WorkspaceFrameworkEventType = 'workspace.create.requested' | 'workspace.created' | 'workspace.ready' | 'workspace.busy' | 'workspace.path.resolved' | 'workspace.path.denied' | 'workspace.quota.exceeded' | 'workspace.snapshot.requested' | 'workspace.snapshot.created' | 'workspace.snapshot.failed' | 'workspace.restore.requested' | 'workspace.restored' | 'workspace.restore.failed' | 'workspace.patch.checked' | '... | Workspace Framework Event Type 公共类型别名;完整类型表达式见声明。 |
WorkspacePathOperation | 类型 | type WorkspacePathOperation = 'read' | 'write' | 'execute' | 'delete' | 'list' | Workspace Path Operation 公共类型别名;完整类型表达式见声明。 |
WorkspacePermission | 类型 | type WorkspacePermission = 'read' | 'write' | 'execute' | 'delete' | Workspace Permission 公共类型别名;完整类型表达式见声明。 |
WorkspaceSnapshotType | 类型 | type WorkspaceSnapshotType = 'full' | 'incremental' | 'manifest_only' | 'failure_snapshot' | Workspace Snapshot Type 公共类型别名;完整类型表达式见声明。 |
WorkspaceStatus | 类型 | type WorkspaceStatus = 'creating' | 'ready' | 'busy' | 'snapshotting' | 'archiving' | 'archived' | 'cleaning' | 'cleaned' | 'failed' | Workspace Status 公共类型别名;完整类型表达式见声明。 |
FileMutation
File Mutation 接口,共包含 9 个公开字段或方法。
- 种类: 接口
- 导入:
import type { FileMutation } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface FileMutation {
path: string;
operation: 'created' | 'modified' | 'deleted' | 'renamed' | 'permission_changed';
beforeHash?: string;
afterHash?: string;
beforeSizeBytes?: number;
afterSizeBytes?: number;
artifactRef?: string;
oldPath?: string;
detectedAt: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
afterHash | 属性 | afterHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
afterSizeBytes | 属性 | afterSizeBytes?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
artifactRef | 属性 | artifactRef?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
beforeHash | 属性 | beforeHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
beforeSizeBytes | 属性 | beforeSizeBytes?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
detectedAt | 属性 | detectedAt: string | 公开属性;类型、只读和可选状态以签名列为准。 |
oldPath | 属性 | oldPath?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
operation | 属性 | operation: "created" | "deleted" | "modified" | "renamed" | "permission_changed" | 公开属性;类型、只读和可选状态以签名列为准。 |
path | 属性 | path: string | 公开属性;类型、只读和可选状态以签名列为准。 |
ResolvedWorkspacePath
Resolved Workspace Path 接口,共包含 8 个公开字段或方法。
- 种类: 接口
- 导入:
import type { ResolvedWorkspacePath } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface ResolvedWorkspacePath {
workspaceId: string;
relativePath: string;
canonicalRelativePath: string;
pathRef: string;
exists: boolean;
kind?: WorkspaceEntryKind;
permissions: WorkspacePermission[];
contentHash?: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
canonicalRelativePath | 属性 | canonicalRelativePath: string | 公开属性;类型、只读和可选状态以签名列为准。 |
contentHash | 属性 | contentHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
exists | 属性 | exists: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
kind | 属性 | kind?: WorkspaceEntryKind | 公开属性;类型、只读和可选状态以签名列为准。 |
pathRef | 属性 | pathRef: string | 公开属性;类型、只读和可选状态以签名列为准。 |
permissions | 属性 | permissions: WorkspacePermission[] | 公开属性;类型、只读和可选状态以签名列为准。 |
relativePath | 属性 | relativePath: string | 公开属性;类型、只读和可选状态以签名列为准。 |
workspaceId | 属性 | workspaceId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceCleanupPolicySpec
Workspace Cleanup Policy Spec 接口,共包含 6 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceCleanupPolicySpec } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceCleanupPolicySpec {
mode: 'on_run_end' | 'on_success' | 'after_ttl' | 'retain' | 'manual';
ttlSeconds?: number;
retainOnFailure?: boolean;
retainSnapshots?: boolean;
secureDelete?: boolean;
archiveBeforeDelete?: boolean;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
archiveBeforeDelete | 属性 | archiveBeforeDelete?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
mode | 属性 | mode: "on_run_end" | "on_success" | "after_ttl" | "retain" | "manual" | 公开属性;类型、只读和可选状态以签名列为准。 |
retainOnFailure | 属性 | retainOnFailure?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
retainSnapshots | 属性 | retainSnapshots?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
secureDelete | 属性 | secureDelete?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
ttlSeconds | 属性 | ttlSeconds?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceDeleteRequest
Workspace Delete Request 接口,共包含 7 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceDeleteRequest } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceDeleteRequest {
operationId: string;
workspaceId: string;
principal: ExecutionPrincipal;
relativePath: string;
recursive?: boolean;
expectedContentHash?: string;
idempotencyKey?: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
expectedContentHash | 属性 | expectedContentHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
idempotencyKey | 属性 | idempotencyKey?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
operationId | 属性 | operationId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
principal | 属性 | principal: ExecutionPrincipal | 公开属性;类型、只读和可选状态以签名列为准。 |
recursive | 属性 | recursive?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
relativePath | 属性 | relativePath: string | 公开属性;类型、只读和可选状态以签名列为准。 |
workspaceId | 属性 | workspaceId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceDiffRequest
Workspace Diff Request 接口,共包含 6 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceDiffRequest } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceDiffRequest {
operationId: string;
workspaceId: string;
principal: ExecutionPrincipal;
fromSnapshotRef: string;
toSnapshotRef?: string;
createPatchArtifact?: boolean;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
createPatchArtifact | 属性 | createPatchArtifact?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
fromSnapshotRef | 属性 | fromSnapshotRef: string | 公开属性;类型、只读和可选状态以签名列为准。 |
operationId | 属性 | operationId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
principal | 属性 | principal: ExecutionPrincipal | 公开属性;类型、只读和可选状态以签名列为准。 |
toSnapshotRef | 属性 | toSnapshotRef?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
workspaceId | 属性 | workspaceId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceDiffResult
Workspace Diff Result 接口,共包含 5 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceDiffResult } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceDiffResult {
fromSnapshotRef: string;
toSnapshotRef?: string;
mutations: FileMutation[];
patchArtifactRef?: string;
summary: WorkspaceDiffSummary;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
fromSnapshotRef | 属性 | fromSnapshotRef: string | 公开属性;类型、只读和可选状态以签名列为准。 |
mutations | 属性 | mutations: FileMutation[] | 公开属性;类型、只读和可选状态以签名列为准。 |
patchArtifactRef | 属性 | patchArtifactRef?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
summary | 属性 | summary: WorkspaceDiffSummary | 公开属性;类型、只读和可选状态以签名列为准。 |
toSnapshotRef | 属性 | toSnapshotRef?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceDiffSummary
Workspace Diff Summary 接口,共包含 7 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceDiffSummary } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceDiffSummary {
created: number;
modified: number;
deleted: number;
renamed: number;
permissionChanged: number;
bytesAdded: number;
bytesRemoved: number;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
bytesAdded | 属性 | bytesAdded: number | 公开属性;类型、只读和可选状态以签名列为准。 |
bytesRemoved | 属性 | bytesRemoved: number | 公开属性;类型、只读和可选状态以签名列为准。 |
created | 属性 | created: number | 公开属性;类型、只读和可选状态以签名列为准。 |
deleted | 属性 | deleted: number | 公开属性;类型、只读和可选状态以签名列为准。 |
modified | 属性 | modified: number | 公开属性;类型、只读和可选状态以签名列为准。 |
permissionChanged | 属性 | permissionChanged: number | 公开属性;类型、只读和可选状态以签名列为准。 |
renamed | 属性 | renamed: number | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceDirectorySpec
Workspace Directory Spec 接口,共包含 9 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceDirectorySpec } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceDirectorySpec {
inputs: string;
source: string;
working: string;
outputs: string;
logs: string;
temp: string;
snapshots: string;
artifacts?: string;
cache?: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
artifacts | 属性 | artifacts?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
cache | 属性 | cache?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
inputs | 属性 | inputs: string | 公开属性;类型、只读和可选状态以签名列为准。 |
logs | 属性 | logs: string | 公开属性;类型、只读和可选状态以签名列为准。 |
outputs | 属性 | outputs: string | 公开属性;类型、只读和可选状态以签名列为准。 |
snapshots | 属性 | snapshots: string | 公开属性;类型、只读和可选状态以签名列为准。 |
source | 属性 | source: string | 公开属性;类型、只读和可选状态以签名列为准。 |
temp | 属性 | temp: string | 公开属性;类型、只读和可选状态以签名列为准。 |
working | 属性 | working: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceEventPayload
Workspace Event Payload 接口,共包含 12 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceEventPayload } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceEventPayload {
operationId?: string;
workspaceId: string;
profileRef?: SpecRef;
status?: WorkspaceStatus;
sourceTreeHash?: string;
workspaceSnapshotHash?: string;
snapshotManifestHash?: string;
artifactRefs?: string[];
bytes?: number;
files?: number;
error?: NormalizedExecutionError;
metadata?: Record<string, unknown>;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
artifactRefs | 属性 | artifactRefs?: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
bytes | 属性 | bytes?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
error | 属性 | error?: NormalizedExecutionError | 公开属性;类型、只读和可选状态以签名列为准。 |
files | 属性 | files?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
metadata | 属性 | metadata?: Record<string, unknown> | 公开属性;类型、只读和可选状态以签名列为准。 |
operationId | 属性 | operationId?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
profileRef | 属性 | profileRef?: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
snapshotManifestHash | 属性 | snapshotManifestHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
sourceTreeHash | 属性 | sourceTreeHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
status | 属性 | status?: WorkspaceStatus | 公开属性;类型、只读和可选状态以签名列为准。 |
workspaceId | 属性 | workspaceId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
workspaceSnapshotHash | 属性 | workspaceSnapshotHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceFileEntry
Workspace File Entry 接口,共包含 6 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceFileEntry } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceFileEntry {
relativePath: string;
kind: WorkspaceEntryKind;
sizeBytes?: number;
contentHash?: string;
modifiedAt?: string;
permissions?: WorkspacePermission[];
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
contentHash | 属性 | contentHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
kind | 属性 | kind: WorkspaceEntryKind | 公开属性;类型、只读和可选状态以签名列为准。 |
modifiedAt | 属性 | modifiedAt?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
permissions | 属性 | permissions?: WorkspacePermission[] | 公开属性;类型、只读和可选状态以签名列为准。 |
relativePath | 属性 | relativePath: string | 公开属性;类型、只读和可选状态以签名列为准。 |
sizeBytes | 属性 | sizeBytes?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceListRequest
Workspace List Request 接口,共包含 7 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceListRequest } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceListRequest {
workspaceId: string;
principal: ExecutionPrincipal;
relativePath?: string;
recursive?: boolean;
includeHidden?: boolean;
maxEntries?: number;
cursor?: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
cursor | 属性 | cursor?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
includeHidden | 属性 | includeHidden?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
maxEntries | 属性 | maxEntries?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
principal | 属性 | principal: ExecutionPrincipal | 公开属性;类型、只读和可选状态以签名列为准。 |
recursive | 属性 | recursive?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
relativePath | 属性 | relativePath?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
workspaceId | 属性 | workspaceId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceMutationPolicySpec
Workspace Mutation Policy Spec 接口,共包含 7 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceMutationPolicySpec } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceMutationPolicySpec {
requireSnapshotBeforeWrite?: boolean;
trackFileMutations?: boolean;
maxPatchBytes?: number;
allowDelete?: boolean;
requireApprovalForDelete?: boolean;
preserveInputFiles?: boolean;
atomicWrite?: boolean;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
allowDelete | 属性 | allowDelete?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
atomicWrite | 属性 | atomicWrite?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
maxPatchBytes | 属性 | maxPatchBytes?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
preserveInputFiles | 属性 | preserveInputFiles?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
requireApprovalForDelete | 属性 | requireApprovalForDelete?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
requireSnapshotBeforeWrite | 属性 | requireSnapshotBeforeWrite?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
trackFileMutations | 属性 | trackFileMutations?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspacePatchConflict
Workspace Patch Conflict 接口,共包含 4 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspacePatchConflict } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspacePatchConflict {
path: string;
reason: string;
expectedHash?: string;
actualHash?: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
actualHash | 属性 | actualHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
expectedHash | 属性 | expectedHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
path | 属性 | path: string | 公开属性;类型、只读和可选状态以签名列为准。 |
reason | 属性 | reason: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspacePatchRequest
Workspace Patch Request 接口,共包含 8 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspacePatchRequest } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspacePatchRequest {
operationId: string;
workspaceId: string;
principal: ExecutionPrincipal;
patchArtifactRef: string;
expectedBaseSnapshotHash?: string;
mode: 'check' | 'apply';
conflictPolicy: 'fail' | 'three_way' | 'mark_conflicts';
idempotencyKey?: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
conflictPolicy | 属性 | conflictPolicy: "fail" | "three_way" | "mark_conflicts" | 公开属性;类型、只读和可选状态以签名列为准。 |
expectedBaseSnapshotHash | 属性 | expectedBaseSnapshotHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
idempotencyKey | 属性 | idempotencyKey?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
mode | 属性 | mode: "check" | "apply" | 公开属性;类型、只读和可选状态以签名列为准。 |
operationId | 属性 | operationId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
patchArtifactRef | 属性 | patchArtifactRef: string | 公开属性;类型、只读和可选状态以签名列为准。 |
principal | 属性 | principal: ExecutionPrincipal | 公开属性;类型、只读和可选状态以签名列为准。 |
workspaceId | 属性 | workspaceId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspacePatchResult
Workspace Patch Result 接口,共包含 5 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspacePatchResult } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspacePatchResult {
checked: boolean;
applied: boolean;
conflicts: WorkspacePatchConflict[];
mutations: FileMutation[];
resultingWorkspaceSnapshotHash?: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
applied | 属性 | applied: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
checked | 属性 | checked: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
conflicts | 属性 | conflicts: WorkspacePatchConflict[] | 公开属性;类型、只读和可选状态以签名列为准。 |
mutations | 属性 | mutations: FileMutation[] | 公开属性;类型、只读和可选状态以签名列为准。 |
resultingWorkspaceSnapshotHash | 属性 | resultingWorkspaceSnapshotHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspacePathPolicySpec
Workspace Path Policy Spec 接口,共包含 12 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspacePathPolicySpec } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspacePathPolicySpec {
/** Read permission only. Exact or descendant deny rules always take precedence. */
readOnlyPaths?: string[];
/** Write permission only. Exact or descendant deny rules always take precedence. */
writablePaths?: string[];
/** Execute permission only. Exact or descendant deny rules always take precedence. */
executablePaths?: string[];
/** Final deny boundary; it cannot be widened by any allow list. */
deniedPaths?: string[];
allowSymlinks?: boolean;
allowHardLinks?: boolean;
followSymlinksForRead?: boolean;
allowHiddenFiles?: boolean;
maxPathLength?: number;
allowedExtensions?: string[];
deniedExtensions?: string[];
caseSensitivity?: 'platform' | 'sensitive' | 'insensitive';
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
allowedExtensions | 属性 | allowedExtensions?: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
allowHardLinks | 属性 | allowHardLinks?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
allowHiddenFiles | 属性 | allowHiddenFiles?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
allowSymlinks | 属性 | allowSymlinks?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
caseSensitivity | 属性 | caseSensitivity?: "platform" | "sensitive" | "insensitive" | 公开属性;类型、只读和可选状态以签名列为准。 |
deniedExtensions | 属性 | deniedExtensions?: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
deniedPaths | 属性 | deniedPaths?: string[] | Final deny boundary; it cannot be widened by any allow list. |
executablePaths | 属性 | executablePaths?: string[] | Execute permission only. Exact or descendant deny rules always take precedence. |
followSymlinksForRead | 属性 | followSymlinksForRead?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
maxPathLength | 属性 | maxPathLength?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
readOnlyPaths | 属性 | readOnlyPaths?: string[] | Read permission only. Exact or descendant deny rules always take precedence. |
writablePaths | 属性 | writablePaths?: string[] | Write permission only. Exact or descendant deny rules always take precedence. |
WorkspacePathRequest
Workspace Path Request 接口,共包含 5 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspacePathRequest } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspacePathRequest {
workspaceId: string;
principal: ExecutionPrincipal;
relativePath: string;
operation: WorkspacePathOperation;
allowMissing?: boolean;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
allowMissing | 属性 | allowMissing?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
operation | 属性 | operation: WorkspacePathOperation | 公开属性;类型、只读和可选状态以签名列为准。 |
principal | 属性 | principal: ExecutionPrincipal | 公开属性;类型、只读和可选状态以签名列为准。 |
relativePath | 属性 | relativePath: string | 公开属性;类型、只读和可选状态以签名列为准。 |
workspaceId | 属性 | workspaceId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceQuotaSpec
Workspace Quota Spec 接口,共包含 6 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceQuotaSpec } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceQuotaSpec {
maxBytes?: number;
maxFiles?: number;
maxSingleFileBytes?: number;
maxDirectoryDepth?: number;
maxOpenFiles?: number;
maxMutationCountPerExecution?: number;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
maxBytes | 属性 | maxBytes?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
maxDirectoryDepth | 属性 | maxDirectoryDepth?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
maxFiles | 属性 | maxFiles?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
maxMutationCountPerExecution | 属性 | maxMutationCountPerExecution?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
maxOpenFiles | 属性 | maxOpenFiles?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
maxSingleFileBytes | 属性 | maxSingleFileBytes?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceReadRequest
Workspace Read Request 接口,共包含 7 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceReadRequest } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceReadRequest {
workspaceId: string;
principal: ExecutionPrincipal;
relativePath: string;
encoding?: 'utf8' | 'base64';
offset?: number;
length?: number;
maxBytes?: number;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
encoding | 属性 | encoding?: "utf8" | "base64" | 公开属性;类型、只读和可选状态以签名列为准。 |
length | 属性 | length?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
maxBytes | 属性 | maxBytes?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
offset | 属性 | offset?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
principal | 属性 | principal: ExecutionPrincipal | 公开属性;类型、只读和可选状态以签名列为准。 |
relativePath | 属性 | relativePath: string | 公开属性;类型、只读和可选状态以签名列为准。 |
workspaceId | 属性 | workspaceId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceReadResult
Workspace Read Result 接口,共包含 7 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceReadResult } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceReadResult {
relativePath: string;
encoding: 'utf8' | 'base64';
content: string;
contentHash: string;
sizeBytes: number;
truncated?: boolean;
nextOffset?: number;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
content | 属性 | content: string | 公开属性;类型、只读和可选状态以签名列为准。 |
contentHash | 属性 | contentHash: string | 公开属性;类型、只读和可选状态以签名列为准。 |
encoding | 属性 | encoding: "utf8" | "base64" | 公开属性;类型、只读和可选状态以签名列为准。 |
nextOffset | 属性 | nextOffset?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
relativePath | 属性 | relativePath: string | 公开属性;类型、只读和可选状态以签名列为准。 |
sizeBytes | 属性 | sizeBytes: number | 公开属性;类型、只读和可选状态以签名列为准。 |
truncated | 属性 | truncated?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceRecord
Workspace Record 接口,共包含 22 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceRecord } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceRecord {
id: string;
revision: number;
tenantId?: string;
userId: string;
sessionId?: string;
runId?: string;
agentId?: string;
profileRef: SpecRef;
profileRevision: string;
rootPathRef: string;
status: WorkspaceStatus;
quota: WorkspaceQuotaSpec;
usage: WorkspaceUsage;
activeExecutionIds: string[];
latestSnapshotRef?: string;
createdAt: string;
readyAt?: string;
updatedAt: string;
expiresAt?: string;
cleanedAt?: string;
error?: NormalizedExecutionError;
metadata?: Record<string, unknown>;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
activeExecutionIds | 属性 | activeExecutionIds: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
agentId | 属性 | agentId?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
cleanedAt | 属性 | cleanedAt?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
createdAt | 属性 | createdAt: string | 公开属性;类型、只读和可选状态以签名列为准。 |
error | 属性 | error?: NormalizedExecutionError | 公开属性;类型、只读和可选状态以签名列为准。 |
expiresAt | 属性 | expiresAt?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
id | 属性 | id: string | 公开属性;类型、只读和可选状态以签名列为准。 |
latestSnapshotRef | 属性 | latestSnapshotRef?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
metadata | 属性 | metadata?: Record<string, unknown> | 公开属性;类型、只读和可选状态以签名列为准。 |
profileRef | 属性 | profileRef: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
profileRevision | 属性 | profileRevision: string | 公开属性;类型、只读和可选状态以签名列为准。 |
quota | 属性 | quota: WorkspaceQuotaSpec | 公开属性;类型、只读和可选状态以签名列为准。 |
readyAt | 属性 | readyAt?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
revision | 属性 | revision: number | 公开属性;类型、只读和可选状态以签名列为准。 |
rootPathRef | 属性 | rootPathRef: string | 公开属性;类型、只读和可选状态以签名列为准。 |
runId | 属性 | runId?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
sessionId | 属性 | sessionId?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
status | 属性 | status: WorkspaceStatus | 公开属性;类型、只读和可选状态以签名列为准。 |
tenantId | 属性 | tenantId?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
updatedAt | 属性 | updatedAt: string | 公开属性;类型、只读和可选状态以签名列为准。 |
usage | 属性 | usage: WorkspaceUsage | 公开属性;类型、只读和可选状态以签名列为准。 |
userId | 属性 | userId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceRestoreRequest
Workspace Restore Request 接口,共包含 6 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceRestoreRequest } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceRestoreRequest {
operationId: string;
workspaceId: string;
principal: ExecutionPrincipal;
snapshotRef: string;
expectedWorkspaceSnapshotHash?: string;
idempotencyKey?: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
expectedWorkspaceSnapshotHash | 属性 | expectedWorkspaceSnapshotHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
idempotencyKey | 属性 | idempotencyKey?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
operationId | 属性 | operationId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
principal | 属性 | principal: ExecutionPrincipal | 公开属性;类型、只读和可选状态以签名列为准。 |
snapshotRef | 属性 | snapshotRef: string | 公开属性;类型、只读和可选状态以签名列为准。 |
workspaceId | 属性 | workspaceId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceSnapshotEntry
Workspace Snapshot Entry 接口,共包含 7 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceSnapshotEntry } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceSnapshotEntry {
path: string;
kind: 'file' | 'directory' | 'symlink';
sizeBytes?: number;
contentHash?: string;
mode?: number;
/** Required only for symlink entries; always Workspace-relative. */
symlinkTarget?: string;
artifactRef?: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
artifactRef | 属性 | artifactRef?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
contentHash | 属性 | contentHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
kind | 属性 | kind: "file" | "directory" | "symlink" | 公开属性;类型、只读和可选状态以签名列为准。 |
mode | 属性 | mode?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
path | 属性 | path: string | 公开属性;类型、只读和可选状态以签名列为准。 |
sizeBytes | 属性 | sizeBytes?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
symlinkTarget | 属性 | symlinkTarget?: string | Required only for symlink entries; always Workspace-relative. |
WorkspaceSnapshotManifest
Workspace Snapshot Manifest 接口,共包含 12 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceSnapshotManifest } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceSnapshotManifest {
id: string;
workspaceId: string;
baseSnapshotId?: string;
entries: WorkspaceSnapshotEntry[];
ignoredPatterns?: string[];
sourceTreeHash: string;
manifestHash: string;
totalBytes: number;
fileCount: number;
createdAt: string;
createdBy: string;
metadata?: Record<string, unknown>;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
baseSnapshotId | 属性 | baseSnapshotId?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
createdAt | 属性 | createdAt: string | 公开属性;类型、只读和可选状态以签名列为准。 |
createdBy | 属性 | createdBy: string | 公开属性;类型、只读和可选状态以签名列为准。 |
entries | 属性 | entries: WorkspaceSnapshotEntry[] | 公开属性;类型、只读和可选状态以签名列为准。 |
fileCount | 属性 | fileCount: number | 公开属性;类型、只读和可选状态以签名列为准。 |
id | 属性 | id: string | 公开属性;类型、只读和可选状态以签名列为准。 |
ignoredPatterns | 属性 | ignoredPatterns?: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
manifestHash | 属性 | manifestHash: string | 公开属性;类型、只读和可选状态以签名列为准。 |
metadata | 属性 | metadata?: Record<string, unknown> | 公开属性;类型、只读和可选状态以签名列为准。 |
sourceTreeHash | 属性 | sourceTreeHash: string | 公开属性;类型、只读和可选状态以签名列为准。 |
totalBytes | 属性 | totalBytes: number | 公开属性;类型、只读和可选状态以签名列为准。 |
workspaceId | 属性 | workspaceId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceSnapshotPolicySpec
Workspace Snapshot Policy Spec 接口,共包含 6 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceSnapshotPolicySpec } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceSnapshotPolicySpec {
enabled: boolean;
mode: 'full' | 'incremental' | 'manifest_only';
snapshotBeforeWrite?: boolean;
snapshotAfterExecution?: boolean;
snapshotOnFailure?: boolean;
maxSnapshots?: number;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
enabled | 属性 | enabled: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
maxSnapshots | 属性 | maxSnapshots?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
mode | 属性 | mode: "full" | "incremental" | "manifest_only" | 公开属性;类型、只读和可选状态以签名列为准。 |
snapshotAfterExecution | 属性 | snapshotAfterExecution?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
snapshotBeforeWrite | 属性 | snapshotBeforeWrite?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
snapshotOnFailure | 属性 | snapshotOnFailure?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceSnapshotRequest
Workspace Snapshot Request 接口,共包含 10 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceSnapshotRequest } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceSnapshotRequest {
operationId: string;
workspaceId: string;
principal: ExecutionPrincipal;
type: WorkspaceSnapshotType;
baseSnapshotRef?: string;
includePaths?: string[];
excludePatterns?: string[];
reason?: string;
idempotencyKey?: string;
metadata?: Record<string, unknown>;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
baseSnapshotRef | 属性 | baseSnapshotRef?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
excludePatterns | 属性 | excludePatterns?: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
idempotencyKey | 属性 | idempotencyKey?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
includePaths | 属性 | includePaths?: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
metadata | 属性 | metadata?: Record<string, unknown> | 公开属性;类型、只读和可选状态以签名列为准。 |
operationId | 属性 | operationId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
principal | 属性 | principal: ExecutionPrincipal | 公开属性;类型、只读和可选状态以签名列为准。 |
reason | 属性 | reason?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
type | 属性 | type: WorkspaceSnapshotType | 公开属性;类型、只读和可选状态以签名列为准。 |
workspaceId | 属性 | workspaceId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceSpec
Workspace Spec 接口,共包含 21 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceSpec } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceSpec extends VersionedSpec, SpecMetadata {
revision?: string;
rootPolicy: 'managed' | 'provided_ref';
rootRef?: string;
directories: WorkspaceDirectorySpec;
pathPolicy: WorkspacePathPolicySpec;
quota: WorkspaceQuotaSpec;
cleanup: WorkspaceCleanupPolicySpec;
snapshot: WorkspaceSnapshotPolicySpec;
mutation: WorkspaceMutationPolicySpec;
executionEnvironmentRef?: SpecRef;
artifactProfileRef?: SpecRef;
secretPolicyRef?: SpecRef;
metadata?: Record<string, unknown>;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
artifactProfileRef | 属性 | artifactProfileRef?: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
cleanup | 属性 | cleanup: WorkspaceCleanupPolicySpec | 公开属性;类型、只读和可选状态以签名列为准。 |
createdAt | 属性 | createdAt?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
description | 属性 | description?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
directories | 属性 | directories: WorkspaceDirectorySpec | 公开属性;类型、只读和可选状态以签名列为准。 |
executionEnvironmentRef | 属性 | executionEnvironmentRef?: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
id | 属性 | id: string | 公开属性;类型、只读和可选状态以签名列为准。 |
metadata | 属性 | metadata?: Record<string, unknown> | 公开属性;类型、只读和可选状态以签名列为准。 |
mutation | 属性 | mutation: WorkspaceMutationPolicySpec | 公开属性;类型、只读和可选状态以签名列为准。 |
name | 属性 | name?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
owner | 属性 | owner?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
pathPolicy | 属性 | pathPolicy: WorkspacePathPolicySpec | 公开属性;类型、只读和可选状态以签名列为准。 |
quota | 属性 | quota: WorkspaceQuotaSpec | 公开属性;类型、只读和可选状态以签名列为准。 |
revision | 属性 | revision?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
rootPolicy | 属性 | rootPolicy: "managed" | "provided_ref" | 公开属性;类型、只读和可选状态以签名列为准。 |
rootRef | 属性 | rootRef?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
secretPolicyRef | 属性 | secretPolicyRef?: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
snapshot | 属性 | snapshot: WorkspaceSnapshotPolicySpec | 公开属性;类型、只读和可选状态以签名列为准。 |
tags | 属性 | tags?: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
updatedAt | 属性 | updatedAt?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
version | 属性 | version: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceUsage
Workspace Usage 接口,共包含 4 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceUsage } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceUsage {
bytes: number;
files: number;
directories?: number;
lastCalculatedAt: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
bytes | 属性 | bytes: number | 公开属性;类型、只读和可选状态以签名列为准。 |
directories | 属性 | directories?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
files | 属性 | files: number | 公开属性;类型、只读和可选状态以签名列为准。 |
lastCalculatedAt | 属性 | lastCalculatedAt: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceWriteRequest
Workspace Write Request 接口,共包含 10 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceWriteRequest } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceWriteRequest {
operationId: string;
workspaceId: string;
principal: ExecutionPrincipal;
relativePath: string;
content?: string | Uint8Array;
artifactRef?: string;
mode: 'create' | 'overwrite' | 'append' | 'atomic_replace';
expectedContentHash?: string;
createParents?: boolean;
idempotencyKey?: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
artifactRef | 属性 | artifactRef?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
content | 属性 | content?: string | Uint8Array<ArrayBufferLike> | 公开属性;类型、只读和可选状态以签名列为准。 |
createParents | 属性 | createParents?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
expectedContentHash | 属性 | expectedContentHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
idempotencyKey | 属性 | idempotencyKey?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
mode | 属性 | mode: "create" | "overwrite" | "append" | "atomic_replace" | 公开属性;类型、只读和可选状态以签名列为准。 |
operationId | 属性 | operationId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
principal | 属性 | principal: ExecutionPrincipal | 公开属性;类型、只读和可选状态以签名列为准。 |
relativePath | 属性 | relativePath: string | 公开属性;类型、只读和可选状态以签名列为准。 |
workspaceId | 属性 | workspaceId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceWriteResult
Workspace Write Result 接口,共包含 6 个公开字段或方法。
- 种类: 接口
- 导入:
import type { WorkspaceWriteResult } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export interface WorkspaceWriteResult {
relativePath: string;
beforeHash?: string;
afterHash: string;
sizeBytes: number;
mutation: FileMutation;
artifactRef?: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
afterHash | 属性 | afterHash: string | 公开属性;类型、只读和可选状态以签名列为准。 |
artifactRef | 属性 | artifactRef?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
beforeHash | 属性 | beforeHash?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
mutation | 属性 | mutation: FileMutation | 公开属性;类型、只读和可选状态以签名列为准。 |
relativePath | 属性 | relativePath: string | 公开属性;类型、只读和可选状态以签名列为准。 |
sizeBytes | 属性 | sizeBytes: number | 公开属性;类型、只读和可选状态以签名列为准。 |
WorkspaceEntryKind
Workspace Entry Kind 公共类型别名;完整类型表达式见声明。
- 种类: 类型
- 导入:
import type { WorkspaceEntryKind } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export type WorkspaceEntryKind = 'file' | 'directory' | 'symlink' | 'other';WorkspaceEventCreateInput
Workspace Event Create Input 公共类型别名;完整类型表达式见声明。
- 种类: 类型
- 导入:
import type { WorkspaceEventCreateInput } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export type WorkspaceEventCreateInput<TType extends WorkspaceFrameworkEventType = WorkspaceFrameworkEventType> = Omit<EventCreateInput<WorkspaceEventPayloadMap[TType]>, 'type' | 'workspaceId'> & {
type: TType;
workspaceId: string;
};WorkspaceEventPayloadMap
Workspace Event Payload Map 公共类型别名;完整类型表达式见声明。
- 种类: 类型
- 导入:
import type { WorkspaceEventPayloadMap } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export type WorkspaceEventPayloadMap = {
'workspace.create.requested': WorkspaceEventPayloadWithRequired<'operationId' | 'profileRef'>;
'workspace.created': WorkspaceEventPayloadWithRequired<'operationId' | 'profileRef' | 'status'>;
'workspace.ready': WorkspaceStatusEventPayload<'ready'>;
'workspace.busy': WorkspaceStatusEventPayload<'busy'>;
'workspace.path.resolved': WorkspaceEventPayloadWithRequired<'operationId'>;
'workspace.path.denied': WorkspaceEventPayloadWithRequired<'operationId' | 'error'>;
'workspace.quota.exceeded': WorkspaceQuotaExceededEventPayload;
'workspace.snapshot.requested': WorkspaceEventPayloadWithRequired<'operationId'>;
'workspace.snapshot.created': WorkspaceEventPayloadWithRequired<'operationId' | 'snapshotManifestHash' | 'artifactRefs'>;
'workspace.snapshot.failed': WorkspaceEventPayloadWithRequired<'operationId' | 'error'>;
'workspace.restore.requested': WorkspaceEventPayloadWithRequired<'operationId' | 'artifactRefs'>;
'workspace.restored': WorkspaceEventPayloadWithRequired<'operationId' | 'workspaceSnapshotHash'>;
'workspace.restore.failed': WorkspaceEventPayloadWithRequired<'operationId' | 'error'>;
'workspace.patch.checked': WorkspaceEventPayloadWithRequired<'operationId'>;
'workspace.patch.applied': WorkspaceEventPayloadWithRequired<'operationId' | 'workspaceSnapshotHash'>;
'workspace.patch.conflict': WorkspaceEventPayloadWithRequired<'operationId'>;
'workspace.cleanup.started': WorkspaceEventPayloadWithRequired<'operationId'>;
'workspace.cleanup.completed': WorkspaceEventPayloadWithRequired<'operationId'>;
'workspace.cleanup.failed': WorkspaceEventPayloadWithRequired<'operationId' | 'error'>;
};WorkspaceFrameworkEvent
Workspace Framework Event 公共类型别名;完整类型表达式见声明。
- 种类: 类型
- 导入:
import type { WorkspaceFrameworkEvent } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export type WorkspaceFrameworkEvent<TType extends WorkspaceFrameworkEventType = WorkspaceFrameworkEventType> = Omit<FrameworkEvent<WorkspaceEventPayloadMap[TType]>, 'type' | 'workspaceId'> & {
type: TType;
workspaceId: string;
};WorkspaceFrameworkEventType
Workspace Framework Event Type 公共类型别名;完整类型表达式见声明。
- 种类: 类型
- 导入:
import type { WorkspaceFrameworkEventType } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export type WorkspaceFrameworkEventType = 'workspace.create.requested' | 'workspace.created' | 'workspace.ready' | 'workspace.busy' | 'workspace.path.resolved' | 'workspace.path.denied' | 'workspace.quota.exceeded' | 'workspace.snapshot.requested' | 'workspace.snapshot.created' | 'workspace.snapshot.failed' | 'workspace.restore.requested' | 'workspace.restored' | 'workspace.restore.failed' | 'workspace.patch.checked' | 'workspace.patch.applied' | 'workspace.patch.conflict' | 'workspace.cleanup.started' | 'workspace.cleanup.completed' | 'workspace.cleanup.failed';WorkspacePathOperation
Workspace Path Operation 公共类型别名;完整类型表达式见声明。
- 种类: 类型
- 导入:
import type { WorkspacePathOperation } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export type WorkspacePathOperation = 'read' | 'write' | 'execute' | 'delete' | 'list';WorkspacePermission
Workspace Permission 公共类型别名;完整类型表达式见声明。
- 种类: 类型
- 导入:
import type { WorkspacePermission } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export type WorkspacePermission = 'read' | 'write' | 'execute' | 'delete';WorkspaceSnapshotType
Workspace Snapshot Type 公共类型别名;完整类型表达式见声明。
- 种类: 类型
- 导入:
import type { WorkspaceSnapshotType } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export type WorkspaceSnapshotType = 'full' | 'incremental' | 'manifest_only' | 'failure_snapshot';WorkspaceStatus
Workspace Status 公共类型别名;完整类型表达式见声明。
- 种类: 类型
- 导入:
import type { WorkspaceStatus } from '@codesoul-co/hypha-core'; - 源码模块:
contracts/workspace
声明
export type WorkspaceStatus = 'creating' | 'ready' | 'busy' | 'snapshotting' | 'archiving' | 'archived' | 'cleaning' | 'cleaned' | 'failed';