跳转到内容

签名关联类型:ProbeCandidate – ResourcePermission

本页由当前 SDK 声明自动生成。

返回接口索引

ProbeCandidate · PromptSnippet · PromptSnippetErrorCode · PromptSnippetFilter · PromptSnippetListQuery · PromptSnippetListResult · PromptSnippetMaterial · PromptSnippetMaterialBase · PromptSnippetMediaMaterial · PromptSnippetTag · PromptSnippetTextMaterial · Quat · QueryResult · QueryUnavailableReason · RegisterModelRefreshRouteOptions · ReleaseChangedPayload · RenamePromptSnippetTagInput · ResolvedNodeCapabilities · ResourceAccessDecision · ResourceAccessPolicy · ResourceDirectory · ResourceDirectoryEntry · ResourceLifecyclePolicy · ResourcePermission

ProbeCandidate

probe 候选(稳定节点 identity 与连接能力)。

export type ProbeCandidate = {
nodeId: string;
direction: "prev" | "next";
connectable: boolean;
};

PromptSnippet

export type PromptSnippet = {
id: string;
formatVersion: number;
builtIn: boolean;
name: string;
body: string;
materials: PromptSnippetMaterial[];
tagIds: string[];
revision: number;
createdAt: string;
updatedAt: string;
};

关联类型:PromptSnippetMaterial

成员说明:

  • body:受长度限制的 token 化正文。

PromptSnippetErrorCode

export type PromptSnippetErrorCode = (typeof PROMPT_SNIPPET_ERROR_CODES)[number];

PromptSnippetFilter

目录筛选:全部 / 内置 / 无标签 / 单个自定义标签。

export type PromptSnippetFilter = "all" | "builtIn" | "untagged" | "tag";

PromptSnippetListQuery

export type PromptSnippetListQuery = {
query?: string;
filter?: PromptSnippetFilter;
tagId?: string;
cursor?: string;
limit?: number;
};

关联类型:PromptSnippetFilter

PromptSnippetListResult

export type PromptSnippetListResult = {
items: PromptSnippet[];
nextCursor: string | null;
total: number;
};

关联类型:PromptSnippet

成员说明:

  • nextCursor:下一页游标;无更多时为 null。

PromptSnippetMaterial

export type PromptSnippetMaterial = PromptSnippetMediaMaterial | PromptSnippetTextMaterial;

关联类型:PromptSnippetMediaMaterial · PromptSnippetTextMaterial

成员说明:

  • key:片段局部 key;正文 token 的 identity 字段必须是它。
  • assetId:捕获时当前画布的稳定 asset 身份;跨画布不保证存在。

PromptSnippetMaterialBase

type PromptSnippetMaterialBase = {
key: string;
label: string;
};

成员说明:

  • key:片段局部 key;正文 token 的 identity 字段必须是它。

PromptSnippetMediaMaterial

export type PromptSnippetMediaMaterial = PromptSnippetMaterialBase & {
mediaKind: "image" | "video" | "audio";
assetId: string;
storageKey: string;
checksum: string;
contentType: string;
size: number;
};

关联类型:PromptSnippetMaterialBase

成员说明:

  • key:片段局部 key;正文 token 的 identity 字段必须是它。
  • assetId:捕获时当前画布的稳定 asset 身份;跨画布不保证存在。
  • storageKey:稳定内容寻址键(sha256-<64hex> 或 generation-outputs/...)。

PromptSnippetTag

export type PromptSnippetTag = {
id: string;
name: string;
builtIn: boolean;
revision: number;
createdAt: string;
updatedAt: string;
};

成员说明:

  • name:规范化后的展示名(去除首尾空白、压缩内部空白)。

PromptSnippetTextMaterial

export type PromptSnippetTextMaterial = PromptSnippetMaterialBase & {
mediaKind: "text";
assetId: string;
text: string;
};

关联类型:PromptSnippetMaterialBase

成员说明:

  • key:片段局部 key;正文 token 的 identity 字段必须是它。
  • text:受长度限制的文本快照。

Quat

四元数 [x, y, z, w](与 glam/Bevy 内存顺序一致)。

export type Quat = [
number,
number,
number,
number
];

QueryResult

版本化查询结果包络;ok=false 时调用方 MUST NOT 开始手势。

export type QueryResult<T> = {
ok: true;
generation: number;
value: T;
} | {
ok: false;
reason: QueryUnavailableReason;
};

关联类型:QueryUnavailableReason

QueryUnavailableReason

稳定查询失败原因:未就绪 / generation 过期 / 运行时缺新导出。

export type QueryUnavailableReason = "unavailable" | "stale" | "unsupported";

RegisterModelRefreshRouteOptions

export type RegisterModelRefreshRouteOptions = {
path: string;
refresh: () => Promise<ModelRefreshResult>;
order?: number;
};

关联类型:ModelRefreshResult

成员说明:

  • path:插件自己注册的刷新路径(同时也是 modelRefresh.path)。
  • order:网关路由顺序;缺省 {@link DEFAULT_MODEL_REFRESH_ROUTE_ORDER}。

ReleaseChangedPayload

export type ReleaseChangedPayload = {
releaseId: string;
href: string;
added: string[];
upgraded: string[];
removed: string[];
pendingReopen: string[];
};

成员说明:

  • href:新发布目录逻辑地址(重开画布前 repin 用)。
  • pendingReopen:当前页面仍在用旧版本、重开画布后才生效的扩展。

RenamePromptSnippetTagInput

export type RenamePromptSnippetTagInput = {
tagId: string;
expectedRevision: number;
name: string;
};

ResolvedNodeCapabilities

export type ResolvedNodeCapabilities = Readonly<NodeCapabilities> & {
readonly generation: number;
};

关联类型:NodeCapabilities

ResourceAccessDecision

export type ResourceAccessDecision = {
allowed: true;
permission: ResourcePermission;
} | {
allowed: false;
code: "not-found" | "forbidden" | "unauthenticated" | "provider-unavailable";
message?: string;
};

关联类型:ResourcePermission

ResourceAccessPolicy

资源访问提供者(Access 拥有 ACL 与四模式规则)。

宿主的 Canvas/Task/MCP/extension 全部相关入口消费同一决策;不允许存在性放行。

export type ResourceAccessPolicy = {
policyId: string;
authorize(input: {
principal: PrincipalContext;
resource: ResourceRef;
permission: ResourcePermission;
}): Promise<ResourceAccessDecision>;
ready?(): boolean;
};

关联类型:PrincipalContext · ResourceRef · ResourcePermission · ResourceAccessDecision

成员说明:

  • ready:当前主体可发现的资源集合(我的目录)由目录 contribution 提供,见 ResourceDirectory。

ResourceDirectory

资源发现目录提供者(Access 拥有成员索引): 当前主体可读的资源集合,与「我的目录」同一发现规则(先按 subject 过滤,再稳定排序分页)。

宿主把它接到 Agent 的 list_canvases(本文件任务 4.4/6.5):未提供或故障时目录为空(fail closed),绝不退回「列出全库画布」。

export type ResourceDirectory = {
directoryId: string;
list(input: {
principal: PrincipalContext;
cursor?: string;
limit?: number;
}): Promise<{
items: ResourceDirectoryEntry[];
nextCursor?: string;
}>;
listDiscoverableIds?(input: {
principal: PrincipalContext;
}): Promise<string[]>;
ready?(): boolean;
};

关联类型:PrincipalContext · ResourceDirectoryEntry

成员说明:

  • listDiscoverableIds:当前主体可发现集合的 ID 全量(不分页,与 list 同一发现规则)。 「可发现集合」按 spec 只含主体创建/指定协作及已登记的无属主 legacy——不等于「所有 可链接读取的画布」(everyone 链接 MUST NOT 自动进入发现列表)。供同源目录列表在分页 之前过滤(否则只会列出恰好落在某一页的项,散落在后续页的项永远不可见)。 缺省时调用方回退翻页收集;失败/未提供即视为空(fail closed),绝不退回列出全库。

ResourceDirectoryEntry

资源目录条目:只读摘要(不含 Y.Doc/store 句柄,也不泄漏 ACL 名单)。

export type ResourceDirectoryEntry = {
resource: ResourceRef;
title: string;
revision: number;
updatedAt: string;
nodeCount: number;
};

关联类型:ResourceRef

ResourceLifecyclePolicy

资源生命周期提供者(Access 拥有 ACL reservation/finalize/tombstone)。

宿主使用稳定 operationId + owner 串行协调 reserve→create→finalize,并持久化 receipt 以 支持崩溃恢复;不能先公开资源再异步补 owner。

export type ResourceLifecyclePolicy = {
policyId: string;
reserve(input: {
principal: PrincipalContext;
resource: ResourceRef;
operationId: string;
}): Promise<{
ok: true;
aclRevision: number;
resumed?: boolean;
} | {
ok: false;
code: string;
message: string;
}>;
finalize(input: {
principal: PrincipalContext;
resource: ResourceRef;
operationId: string;
}): Promise<{
ok: true;
aclRevision: number;
} | {
ok: false;
code: string;
message: string;
}>;
tombstone(input: {
principal: PrincipalContext;
resource: ResourceRef;
operationId: string;
}): Promise<{
ok: true;
} | {
ok: false;
code: string;
message: string;
}>;
beginDelete?(input: {
principal: PrincipalContext;
resource: ResourceRef;
operationId: string;
}): Promise<{
ok: true;
aclRevision: number;
} | {
ok: false;
code: string;
message: string;
}>;
cancelReservation?(input: {
principal: PrincipalContext;
resource: ResourceRef;
operationId: string;
}): Promise<{
ok: true;
} | {
ok: false;
code: string;
message: string;
}>;
reconcileProvisioning?(input: {
exists(resourceId: string): Promise<boolean>;
reservedBefore?: string;
}): Promise<{
finalized: string[];
cleaned: string[];
failed: string[];
}>;
ready?(): boolean;
};

关联类型:PrincipalContext · ResourceRef

成员说明:

  • reserve:为可信 owner 预留资源(返回 provisioning ACL;不公开)。 崩溃恢复:同一 owner 用同一 operationId 重试时返回 resumed: true 并沿用既有预留, 宿主据此判断内容可能已由上一次尝试创建。
  • finalize:内容创建成功后激活 ACL(active 才可发现/打开)。
  • tombstone:内容删除成功后保存 tombstone。
  • beginDelete:删除开始:把资源置为 deleting(对所有读者不可读并断开读者),幂等。 在删除权威内容之前调用;内容删除成功后用 tombstone 终结。删除失败时宿主用 finalize 复原为 active(可恢复,不产生无属主孤儿)。缺失时不写入中间态(旧实现兼容)。
  • cancelReservation:取消未完成的预留。 只在该预留仍属于同一 principal + operationId 且仍为 provisioning 时移除(连同成员索引), 不触碰 active/deleted 记录。缺省实现表示不支持(宿主跳过,预留留给重试或启动结算)。
  • reconcileProvisioning:启动期结算遗留 provisioning 预留。 宿主提供内容存在性判定:内容已存在 → 补 finalize;内容不存在 → 清理预留。只结算早于 reservedBefore 的预留(避免与在途创建竞争)。幂等,可每次启动执行。

ResourcePermission

export type ResourcePermission = (typeof RESOURCE_PERMISSIONS)[number];