Skip to content

@codesoul-co/hypha-core / modules/workspace/operations

模块用法

用于声明并实施 Workspace 作用域边界。Operations 模块公开 18 常量、10 函数。

从包入口导入

ts
import {
  fileMutationJsonSchema,
  fileMutationSchema,
  principalJsonSchema,
  relativePathJsonSchema,
  resolvedWorkspacePathSchema,
  workspaceDeleteRequestExample,
  workspaceDeleteRequestSchema,
  workspaceFileEntrySchema,
} from '@codesoul-co/hypha-core';

// 完整导出列表见下方。

使用要点

  • 10 个函数是该模块的直接操作入口;每个 overload 的必需/可选参数与返回类型均在下方列出。
  • 18 个常量/枚举提供稳定值、Schema、Definition 或默认配置;应复用这些导出,避免在应用中复制内部值。

运行时校验示例

ts
import { fileMutationSchema } from '@codesoul-co/hypha-core';

declare function loadExternalInput(): unknown;
const input: unknown = loadExternalInput();
const parsed = fileMutationSchema.parse(input);

配置、网络请求或持久化数据等不可信输入应先通过 Runtime Schema,再传给只接受已校验契约的函数或类。

公共导出

Symbol种类签名说明
fileMutationJsonSchema常量const fileMutationJsonSchema: JsonSchemaFile Mutation 的 JSON Schema。
fileMutationSchema常量const fileMutationSchema: z.ZodObject<{ path: z.ZodEffects<z.ZodString, string, string>; operation: z.ZodEnum<["created", "modified", "deleted", "renamed", "permission_changed"]>; beforeHash: z.ZodOptional<z.ZodString>; afterHash: z.ZodOptional<z.ZodString>; beforeSizeBytes: z.ZodOptional<z.ZodNumber>; afterSizeBytes: z.ZodOptional<z.ZodNumber>; artifactRef: z.ZodOptional<z.ZodString>; oldPath: z.ZodOptional<z.Zod...File Mutation 的运行时 Schema。
principalJsonSchema常量const principalJsonSchema: JsonSchemaPrincipal 的 JSON Schema。
relativePathJsonSchema常量const relativePathJsonSchema: JsonSchemaRelative Path 的 JSON Schema。
resolvedWorkspacePathSchema常量const resolvedWorkspacePathSchema: z.ZodObject<{ workspaceId: z.ZodString; relativePath: z.ZodEffects<z.ZodString, string, string>; canonicalRelativePath: z.ZodEffects<z.ZodString, string, string>; pathRef: z.ZodString; exists: z.ZodBoolean; kind: z.ZodOptional<z.ZodEnum<["file", "directory", "symlink", "other"]>>; permissions: z.ZodArray<z.ZodEnum<["read", "write", "execute", "delete"]>, "many">; contentHash: z.Z...Resolved Workspace Path 的运行时 Schema。
workspaceDeleteRequestExample常量const workspaceDeleteRequestExample: WorkspaceDeleteRequestWorkspace Delete Request 的有效示例值。
workspaceDeleteRequestSchema常量const workspaceDeleteRequestSchema: z.ZodObject<{ operationId: z.ZodString; workspaceId: z.ZodString; principal: z.ZodObject<{ principalId: z.ZodString; type: z.ZodEnum<["user", "agent", "service", "system"]>; tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodOptional<z.ZodString>; agentId: z.ZodOptional<z.ZodString>; roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; permissionScopes: z.ZodArray<z.ZodString,...Workspace Delete Request 的运行时 Schema。
workspaceFileEntrySchema常量const workspaceFileEntrySchema: z.ZodObject<{ relativePath: z.ZodEffects<z.ZodString, string, string>; kind: z.ZodEnum<["file", "directory", "symlink", "other"]>; sizeBytes: z.ZodOptional<z.ZodNumber>; contentHash: z.ZodOptional<z.ZodString>; modifiedAt: z.ZodOptional<z.ZodString>; permissions: z.ZodOptional<z.ZodArray<z.ZodEnum<["read", "write", "execute", "delete"]>, "many">>; }, "strict", z.ZodTypeAny, { kind: ...Workspace File Entry 的运行时 Schema。
workspaceListRequestSchema常量const workspaceListRequestSchema: z.ZodObject<{ workspaceId: z.ZodString; principal: z.ZodObject<{ principalId: z.ZodString; type: z.ZodEnum<["user", "agent", "service", "system"]>; tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodOptional<z.ZodString>; agentId: z.ZodOptional<z.ZodString>; roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; permissionScopes: z.ZodArray<z.ZodString, "many">; metadata: z.ZodOpt...Workspace List Request 的运行时 Schema。
workspaceOperationJsonSchemas常量const workspaceOperationJsonSchemas: Record<string, JsonSchema>modules/workspace/operations 模块导出的 Workspace Operation JSON Schemas 常量。
workspaceOperationPrincipalExample常量const workspaceOperationPrincipalExample: ExecutionPrincipalWorkspace Operation Principal 的有效示例值。
workspacePathRequestSchema常量const workspacePathRequestSchema: z.ZodObject<{ workspaceId: z.ZodString; principal: z.ZodObject<{ principalId: z.ZodString; type: z.ZodEnum<["user", "agent", "service", "system"]>; tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodOptional<z.ZodString>; agentId: z.ZodOptional<z.ZodString>; roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; permissionScopes: z.ZodArray<z.ZodString, "many">; metadata: z.ZodOpt...Workspace Path Request 的运行时 Schema。
workspaceReadRequestSchema常量const workspaceReadRequestSchema: z.ZodObject<{ workspaceId: z.ZodString; principal: z.ZodObject<{ principalId: z.ZodString; type: z.ZodEnum<["user", "agent", "service", "system"]>; tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodOptional<z.ZodString>; agentId: z.ZodOptional<z.ZodString>; roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; permissionScopes: z.ZodArray<z.ZodString, "many">; metadata: z.ZodOpt...Workspace Read Request 的运行时 Schema。
workspaceReadResultSchema常量const workspaceReadResultSchema: z.ZodObject<{ relativePath: z.ZodEffects<z.ZodString, string, string>; encoding: z.ZodEnum<["utf8", "base64"]>; content: z.ZodString; contentHash: z.ZodString; sizeBytes: z.ZodNumber; truncated: z.ZodOptional<z.ZodBoolean>; nextOffset: z.ZodOptional<z.ZodNumber>; }, "strict", z.ZodTypeAny, { contentHash: string; sizeBytes: number; content: string; relativePath: string; encoding: "u...Workspace Read Result 的运行时 Schema。
workspaceWriteRequestExample常量const workspaceWriteRequestExample: WorkspaceWriteRequestWorkspace Write Request 的有效示例值。
workspaceWriteRequestSchema常量const workspaceWriteRequestSchema: z.ZodEffects<z.ZodObject<{ operationId: z.ZodString; workspaceId: z.ZodString; principal: z.ZodObject<{ principalId: z.ZodString; type: z.ZodEnum<["user", "agent", "service", "system"]>; tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodOptional<z.ZodString>; agentId: z.ZodOptional<z.ZodString>; roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; permissionScopes: z.ZodArray<...Workspace Write Request 的运行时 Schema。
workspaceWriteResultExample常量const workspaceWriteResultExample: WorkspaceWriteResultWorkspace Write Result 的有效示例值。
workspaceWriteResultSchema常量const workspaceWriteResultSchema: z.ZodObject<{ relativePath: z.ZodEffects<z.ZodString, string, string>; beforeHash: z.ZodOptional<z.ZodString>; afterHash: z.ZodString; sizeBytes: z.ZodNumber; mutation: z.ZodObject<{ path: z.ZodEffects<z.ZodString, string, string>; operation: z.ZodEnum<["created", "modified", "deleted", "renamed", "permission_changed"]>; beforeHash: z.ZodOptional<z.ZodString>; afterHash: z.ZodOpti...Workspace Write Result 的运行时 Schema。
validateFileMutation函数validateFileMutation(input: unknown): FileMutationValidate File Mutation 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateResolvedWorkspacePath函数validateResolvedWorkspacePath(input: unknown): ResolvedWorkspacePathValidate Resolved Workspace Path 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateWorkspaceDeleteRequest函数validateWorkspaceDeleteRequest(input: unknown): WorkspaceDeleteRequestValidate Workspace Delete Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateWorkspaceFileEntry函数validateWorkspaceFileEntry(input: unknown): WorkspaceFileEntryValidate Workspace File Entry 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateWorkspaceListRequest函数validateWorkspaceListRequest(input: unknown): WorkspaceListRequestValidate Workspace List Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateWorkspacePathRequest函数validateWorkspacePathRequest(input: unknown): WorkspacePathRequestValidate Workspace Path Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateWorkspaceReadRequest函数validateWorkspaceReadRequest(input: unknown): WorkspaceReadRequestValidate Workspace Read Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateWorkspaceReadResult函数validateWorkspaceReadResult(input: unknown): WorkspaceReadResultValidate Workspace Read Result 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateWorkspaceWriteRequest函数validateWorkspaceWriteRequest(input: unknown): WorkspaceWriteRequestValidate Workspace Write Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateWorkspaceWriteResult函数validateWorkspaceWriteResult(input: unknown): WorkspaceWriteResultValidate Workspace Write Result 函数,提供 1 个公开调用签名;参数与返回类型见下表。

fileMutationJsonSchema

File Mutation 的 JSON Schema。

声明

text
export declare const fileMutationJsonSchema: JsonSchema;

fileMutationSchema

File Mutation 的运行时 Schema。

声明

text
export declare const fileMutationSchema: z.ZodObject<{ path: z.ZodEffects<z.ZodString, string, string>; operation: z.ZodEnum<["created", "modified", "deleted", "renamed", "permission_changed"]>; beforeHash: z.ZodOptional<z.ZodString>; afterHash: z.ZodOptional<z.ZodString>; beforeSizeBytes: z.ZodOptional<z.ZodNumber>; afterSizeBytes: z.ZodOptional<z.ZodNumber>; artifactRef: z.ZodOptional<z.ZodString>; oldPath: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>; detectedAt: z.ZodString; }, "strict", z.ZodTypeAny, { path: string; detectedAt: string; operation: "deleted" | "created" | "modified" | "renamed" | "permission_changed"; artifactRef?: string | undefined; beforeHash?: string | undefined; afterHash?: string | undefined; beforeSizeBytes?: number | undefined; afterSizeBytes?: number | undefined; oldPath?: string | undefined; }, { path: string; detectedAt: string; operation: "deleted" | "created" | "modified" | "renamed" | "permission_changed"; artifactRef?: string | undefined; beforeHash?: string | undefined; afterHash?: string | undefined; beforeSizeBytes?: number | undefined; afterSizeBytes?: number | undefined; oldPath?: string | undefined; }>;

principalJsonSchema

Principal 的 JSON Schema。

声明

text
export declare const principalJsonSchema: JsonSchema;

relativePathJsonSchema

Relative Path 的 JSON Schema。

声明

text
export declare const relativePathJsonSchema: JsonSchema;

resolvedWorkspacePathSchema

Resolved Workspace Path 的运行时 Schema。

声明

text
export declare const resolvedWorkspacePathSchema: z.ZodObject<{ workspaceId: z.ZodString; relativePath: z.ZodEffects<z.ZodString, string, string>; canonicalRelativePath: z.ZodEffects<z.ZodString, string, string>; pathRef: z.ZodString; exists: z.ZodBoolean; kind: z.ZodOptional<z.ZodEnum<["file", "directory", "symlink", "other"]>>; permissions: z.ZodArray<z.ZodEnum<["read", "write", "execute", "delete"]>, "many">; contentHash: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { workspaceId: string; relativePath: string; canonicalRelativePath: string; pathRef: string; exists: boolean; permissions: ("read" | "write" | "execute" | "delete")[]; contentHash?: string | undefined; kind?: "file" | "directory" | "symlink" | "other" | undefined; }, { workspaceId: string; relativePath: string; canonicalRelativePath: string; pathRef: string; exists: boolean; permissions: ("read" | "write" | "execute" | "delete")[]; contentHash?: string | undefined; kind?: "file" | "directory" | "symlink" | "other" | undefined; }>;

workspaceDeleteRequestExample

Workspace Delete Request 的有效示例值。

声明

text
export declare const workspaceDeleteRequestExample: WorkspaceDeleteRequest;

workspaceDeleteRequestSchema

Workspace Delete Request 的运行时 Schema。

声明

text
export declare const workspaceDeleteRequestSchema: z.ZodObject<{ operationId: z.ZodString; workspaceId: z.ZodString; principal: z.ZodObject<{ principalId: z.ZodString; type: z.ZodEnum<["user", "agent", "service", "system"]>; tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodOptional<z.ZodString>; agentId: z.ZodOptional<z.ZodString>; roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; permissionScopes: z.ZodArray<z.ZodString, "many">; metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, "strict", 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; roles?: string[] | undefined; }, { type: "user" | "agent" | "service" | "system"; principalId: string; permissionScopes: string[]; metadata?: Record<string, unknown> | undefined; agentId?: string | undefined; tenantId?: string | undefined; userId?: string | undefined; roles?: string[] | undefined; }>; relativePath: z.ZodEffects<z.ZodString, string, string>; recursive: z.ZodOptional<z.ZodBoolean>; expectedContentHash: z.ZodOptional<z.ZodString>; idempotencyKey: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { operationId: string; workspaceId: string; principal: { type: "user" | "agent" | "service" | "system"; principalId: string; permissionScopes: string[]; metadata?: Record<string, unknown> | undefined; agentId?: string | undefined; tenantId?: string | undefined; userId?: string | undefined; roles?: string[] | undefined; }; relativePath: string; idempotencyKey?: string | undefined; recursive?: boolean | undefined; expectedContentHash?: string | undefined; }, { operationId: string; workspaceId: string; principal: { type: "user" | "agent" | "service" | "system"; principalId: string; permissionScopes: string[]; metadata?: Record<string, unknown> | undefined; agentId?: string | undefined; tenantId?: string | undefined; userId?: string | undefined; roles?: string[] | undefined; }; relativePath: string; idempotencyKey?: string | undefined; recursive?: boolean | undefined; expectedContentHash?: string | undefined; }>;

workspaceFileEntrySchema

Workspace File Entry 的运行时 Schema。

声明

text
export declare const workspaceFileEntrySchema: z.ZodObject<{ relativePath: z.ZodEffects<z.ZodString, string, string>; kind: z.ZodEnum<["file", "directory", "symlink", "other"]>; sizeBytes: z.ZodOptional<z.ZodNumber>; contentHash: z.ZodOptional<z.ZodString>; modifiedAt: z.ZodOptional<z.ZodString>; permissions: z.ZodOptional<z.ZodArray<z.ZodEnum<["read", "write", "execute", "delete"]>, "many">>; }, "strict", z.ZodTypeAny, { kind: "file" | "directory" | "symlink" | "other"; relativePath: string; contentHash?: string | undefined; sizeBytes?: number | undefined; permissions?: ("read" | "write" | "execute" | "delete")[] | undefined; modifiedAt?: string | undefined; }, { kind: "file" | "directory" | "symlink" | "other"; relativePath: string; contentHash?: string | undefined; sizeBytes?: number | undefined; permissions?: ("read" | "write" | "execute" | "delete")[] | undefined; modifiedAt?: string | undefined; }>;

workspaceListRequestSchema

Workspace List Request 的运行时 Schema。

声明

text
export declare const workspaceListRequestSchema: z.ZodObject<{ workspaceId: z.ZodString; principal: z.ZodObject<{ principalId: z.ZodString; type: z.ZodEnum<["user", "agent", "service", "system"]>; tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodOptional<z.ZodString>; agentId: z.ZodOptional<z.ZodString>; roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; permissionScopes: z.ZodArray<z.ZodString, "many">; metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, "strict", 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; roles?: string[] | undefined; }, { type: "user" | "agent" | "service" | "system"; principalId: string; permissionScopes: string[]; metadata?: Record<string, unknown> | undefined; agentId?: string | undefined; tenantId?: string | undefined; userId?: string | undefined; roles?: string[] | undefined; }>; relativePath: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>; recursive: z.ZodOptional<z.ZodBoolean>; includeHidden: z.ZodOptional<z.ZodBoolean>; maxEntries: z.ZodOptional<z.ZodNumber>; cursor: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { workspaceId: string; principal: { type: "user" | "agent" | "service" | "system"; principalId: string; permissionScopes: string[]; metadata?: Record<string, unknown> | undefined; agentId?: string | undefined; tenantId?: string | undefined; userId?: string | undefined; roles?: string[] | undefined; }; cursor?: string | undefined; relativePath?: string | undefined; recursive?: boolean | undefined; includeHidden?: boolean | undefined; maxEntries?: number | undefined; }, { workspaceId: string; principal: { type: "user" | "agent" | "service" | "system"; principalId: string; permissionScopes: string[]; metadata?: Record<string, unknown> | undefined; agentId?: string | undefined; tenantId?: string | undefined; userId?: string | undefined; roles?: string[] | undefined; }; cursor?: string | undefined; relativePath?: string | undefined; recursive?: boolean | undefined; includeHidden?: boolean | undefined; maxEntries?: number | undefined; }>;

workspaceOperationJsonSchemas

modules/workspace/operations 模块导出的 Workspace Operation JSON Schemas 常量。

声明

text
export declare const workspaceOperationJsonSchemas: Record<string, JsonSchema>;

workspaceOperationPrincipalExample

Workspace Operation Principal 的有效示例值。

  • 种类: 常量
  • 导入: import { workspaceOperationPrincipalExample } from '@codesoul-co/hypha-core';
  • 源码模块: modules/workspace/operations

声明

text
export declare const workspaceOperationPrincipalExample: ExecutionPrincipal;

workspacePathRequestSchema

Workspace Path Request 的运行时 Schema。

声明

text
export declare const workspacePathRequestSchema: z.ZodObject<{ workspaceId: z.ZodString; principal: z.ZodObject<{ principalId: z.ZodString; type: z.ZodEnum<["user", "agent", "service", "system"]>; tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodOptional<z.ZodString>; agentId: z.ZodOptional<z.ZodString>; roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; permissionScopes: z.ZodArray<z.ZodString, "many">; metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, "strict", 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; roles?: string[] | undefined; }, { type: "user" | "agent" | "service" | "system"; principalId: string; permissionScopes: string[]; metadata?: Record<string, unknown> | undefined; agentId?: string | undefined; tenantId?: string | undefined; userId?: string | undefined; roles?: string[] | undefined; }>; relativePath: z.ZodEffects<z.ZodString, string, string>; operation: z.ZodEnum<["read", "write", "execute", "delete", "list"]>; allowMissing: z.ZodOptional<z.ZodBoolean>; }, "strict", z.ZodTypeAny, { workspaceId: string; principal: { type: "user" | "agent" | "service" | "system"; principalId: string; permissionScopes: string[]; metadata?: Record<string, unknown> | undefined; agentId?: string | undefined; tenantId?: string | undefined; userId?: string | undefined; roles?: string[] | undefined; }; operation: "read" | "list" | "write" | "execute" | "delete"; relativePath: string; allowMissing?: boolean | undefined; }, { workspaceId: string; principal: { type: "user" | "agent" | "service" | "system"; principalId: string; permissionScopes: string[]; metadata?: Record<string, unknown> | undefined; agentId?: string | undefined; tenantId?: string | undefined; userId?: string | undefined; roles?: string[] | undefined; }; operation: "read" | "list" | "write" | "execute" | "delete"; relativePath: string; allowMissing?: boolean | undefined; }>;

workspaceReadRequestSchema

Workspace Read Request 的运行时 Schema。

声明

text
export declare const workspaceReadRequestSchema: z.ZodObject<{ workspaceId: z.ZodString; principal: z.ZodObject<{ principalId: z.ZodString; type: z.ZodEnum<["user", "agent", "service", "system"]>; tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodOptional<z.ZodString>; agentId: z.ZodOptional<z.ZodString>; roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; permissionScopes: z.ZodArray<z.ZodString, "many">; metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, "strict", 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; roles?: string[] | undefined; }, { type: "user" | "agent" | "service" | "system"; principalId: string; permissionScopes: string[]; metadata?: Record<string, unknown> | undefined; agentId?: string | undefined; tenantId?: string | undefined; userId?: string | undefined; roles?: string[] | undefined; }>; relativePath: z.ZodEffects<z.ZodString, string, string>; encoding: z.ZodOptional<z.ZodEnum<["utf8", "base64"]>>; offset: z.ZodOptional<z.ZodNumber>; length: z.ZodOptional<z.ZodNumber>; maxBytes: z.ZodOptional<z.ZodNumber>; }, "strict", z.ZodTypeAny, { workspaceId: string; principal: { type: "user" | "agent" | "service" | "system"; principalId: string; permissionScopes: string[]; metadata?: Record<string, unknown> | undefined; agentId?: string | undefined; tenantId?: string | undefined; userId?: string | undefined; roles?: string[] | undefined; }; relativePath: string; length?: number | undefined; offset?: number | undefined; maxBytes?: number | undefined; encoding?: "utf8" | "base64" | undefined; }, { workspaceId: string; principal: { type: "user" | "agent" | "service" | "system"; principalId: string; permissionScopes: string[]; metadata?: Record<string, unknown> | undefined; agentId?: string | undefined; tenantId?: string | undefined; userId?: string | undefined; roles?: string[] | undefined; }; relativePath: string; length?: number | undefined; offset?: number | undefined; maxBytes?: number | undefined; encoding?: "utf8" | "base64" | undefined; }>;

workspaceReadResultSchema

Workspace Read Result 的运行时 Schema。

声明

text
export declare const workspaceReadResultSchema: z.ZodObject<{ relativePath: z.ZodEffects<z.ZodString, string, string>; encoding: z.ZodEnum<["utf8", "base64"]>; content: z.ZodString; contentHash: z.ZodString; sizeBytes: z.ZodNumber; truncated: z.ZodOptional<z.ZodBoolean>; nextOffset: z.ZodOptional<z.ZodNumber>; }, "strict", z.ZodTypeAny, { contentHash: string; sizeBytes: number; content: string; relativePath: string; encoding: "utf8" | "base64"; truncated?: boolean | undefined; nextOffset?: number | undefined; }, { contentHash: string; sizeBytes: number; content: string; relativePath: string; encoding: "utf8" | "base64"; truncated?: boolean | undefined; nextOffset?: number | undefined; }>;

workspaceWriteRequestExample

Workspace Write Request 的有效示例值。

声明

text
export declare const workspaceWriteRequestExample: WorkspaceWriteRequest;

workspaceWriteRequestSchema

Workspace Write Request 的运行时 Schema。

声明

text
// 精确类型由包入口解析;完整编译器展开定义见源码链接。
export declare const workspaceWriteRequestSchema: (typeof import('@codesoul-co/hypha-core'))['workspaceWriteRequestSchema'];

该常量的编译器展开类型已压缩;它的公共名称、顶层类型与源码位置仍保留在本条目中。相关输入/输出字段请使用同模块导出的接口、类型或 Runtime Schema。

workspaceWriteResultExample

Workspace Write Result 的有效示例值。

声明

text
export declare const workspaceWriteResultExample: WorkspaceWriteResult;

workspaceWriteResultSchema

Workspace Write Result 的运行时 Schema。

声明

text
export declare const workspaceWriteResultSchema: z.ZodObject<{ relativePath: z.ZodEffects<z.ZodString, string, string>; beforeHash: z.ZodOptional<z.ZodString>; afterHash: z.ZodString; sizeBytes: z.ZodNumber; mutation: z.ZodObject<{ path: z.ZodEffects<z.ZodString, string, string>; operation: z.ZodEnum<["created", "modified", "deleted", "renamed", "permission_changed"]>; beforeHash: z.ZodOptional<z.ZodString>; afterHash: z.ZodOptional<z.ZodString>; beforeSizeBytes: z.ZodOptional<z.ZodNumber>; afterSizeBytes: z.ZodOptional<z.ZodNumber>; artifactRef: z.ZodOptional<z.ZodString>; oldPath: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>; detectedAt: z.ZodString; }, "strict", z.ZodTypeAny, { path: string; detectedAt: string; operation: "deleted" | "created" | "modified" | "renamed" | "permission_changed"; artifactRef?: string | undefined; beforeHash?: string | undefined; afterHash?: string | undefined; beforeSizeBytes?: number | undefined; afterSizeBytes?: number | undefined; oldPath?: string | undefined; }, { path: string; detectedAt: string; operation: "deleted" | "created" | "modified" | "renamed" | "permission_changed"; artifactRef?: string | undefined; beforeHash?: string | undefined; afterHash?: string | undefined; beforeSizeBytes?: number | undefined; afterSizeBytes?: number | undefined; oldPath?: string | undefined; }>; artifactRef: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { sizeBytes: number; mutation: { path: string; detectedAt: string; operation: "deleted" | "created" | "modified" | "renamed" | "permission_changed"; artifactRef?: string | undefined; beforeHash?: string | undefined; afterHash?: string | undefined; beforeSizeBytes?: number | undefined; afterSizeBytes?: number | undefined; oldPath?: string | undefined; }; relativePath: string; afterHash: string; artifactRef?: string | undefined; beforeHash?: string | undefined; }, { sizeBytes: number; mutation: { path: string; detectedAt: string; operation: "deleted" | "created" | "modified" | "renamed" | "permission_changed"; artifactRef?: string | undefined; beforeHash?: string | undefined; afterHash?: string | undefined; beforeSizeBytes?: number | undefined; afterSizeBytes?: number | undefined; oldPath?: string | undefined; }; relativePath: string; afterHash: string; artifactRef?: string | undefined; beforeHash?: string | undefined; }>;

validateFileMutation

Validate File Mutation 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateFileMutation(input: unknown): FileMutation;

调用签名

text
validateFileMutation(input: unknown): FileMutation

参数

参数类型必需说明
inputunknown必需参数;接受的值由类型列定义。

返回值

  • 类型: FileMutation
  • 说明: 返回值契约由上述类型定义。

validateResolvedWorkspacePath

Validate Resolved Workspace Path 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateResolvedWorkspacePath(input: unknown): ResolvedWorkspacePath;

调用签名

text
validateResolvedWorkspacePath(input: unknown): ResolvedWorkspacePath

参数

参数类型必需说明
inputunknown必需参数;接受的值由类型列定义。

返回值

  • 类型: ResolvedWorkspacePath
  • 说明: 返回值契约由上述类型定义。

validateWorkspaceDeleteRequest

Validate Workspace Delete Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateWorkspaceDeleteRequest(input: unknown): WorkspaceDeleteRequest;

调用签名

text
validateWorkspaceDeleteRequest(input: unknown): WorkspaceDeleteRequest

参数

参数类型必需说明
inputunknown必需参数;接受的值由类型列定义。

返回值

  • 类型: WorkspaceDeleteRequest
  • 说明: 返回值契约由上述类型定义。

validateWorkspaceFileEntry

Validate Workspace File Entry 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateWorkspaceFileEntry(input: unknown): WorkspaceFileEntry;

调用签名

text
validateWorkspaceFileEntry(input: unknown): WorkspaceFileEntry

参数

参数类型必需说明
inputunknown必需参数;接受的值由类型列定义。

返回值

  • 类型: WorkspaceFileEntry
  • 说明: 返回值契约由上述类型定义。

validateWorkspaceListRequest

Validate Workspace List Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateWorkspaceListRequest(input: unknown): WorkspaceListRequest;

调用签名

text
validateWorkspaceListRequest(input: unknown): WorkspaceListRequest

参数

参数类型必需说明
inputunknown必需参数;接受的值由类型列定义。

返回值

  • 类型: WorkspaceListRequest
  • 说明: 返回值契约由上述类型定义。

validateWorkspacePathRequest

Validate Workspace Path Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateWorkspacePathRequest(input: unknown): WorkspacePathRequest;

调用签名

text
validateWorkspacePathRequest(input: unknown): WorkspacePathRequest

参数

参数类型必需说明
inputunknown必需参数;接受的值由类型列定义。

返回值

  • 类型: WorkspacePathRequest
  • 说明: 返回值契约由上述类型定义。

validateWorkspaceReadRequest

Validate Workspace Read Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateWorkspaceReadRequest(input: unknown): WorkspaceReadRequest;

调用签名

text
validateWorkspaceReadRequest(input: unknown): WorkspaceReadRequest

参数

参数类型必需说明
inputunknown必需参数;接受的值由类型列定义。

返回值

  • 类型: WorkspaceReadRequest
  • 说明: 返回值契约由上述类型定义。

validateWorkspaceReadResult

Validate Workspace Read Result 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateWorkspaceReadResult(input: unknown): WorkspaceReadResult;

调用签名

text
validateWorkspaceReadResult(input: unknown): WorkspaceReadResult

参数

参数类型必需说明
inputunknown必需参数;接受的值由类型列定义。

返回值

  • 类型: WorkspaceReadResult
  • 说明: 返回值契约由上述类型定义。

validateWorkspaceWriteRequest

Validate Workspace Write Request 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateWorkspaceWriteRequest(input: unknown): WorkspaceWriteRequest;

调用签名

text
validateWorkspaceWriteRequest(input: unknown): WorkspaceWriteRequest

参数

参数类型必需说明
inputunknown必需参数;接受的值由类型列定义。

返回值

  • 类型: WorkspaceWriteRequest
  • 说明: 返回值契约由上述类型定义。

validateWorkspaceWriteResult

Validate Workspace Write Result 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

text
export declare function validateWorkspaceWriteResult(input: unknown): WorkspaceWriteResult;

调用签名

text
validateWorkspaceWriteResult(input: unknown): WorkspaceWriteResult

参数

参数类型必需说明
inputunknown必需参数;接受的值由类型列定义。

返回值

  • 类型: WorkspaceWriteResult
  • 说明: 返回值契约由上述类型定义。