@dp-bohrium/widget-sdk 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +6 -0
- package/README.md +0 -7
- package/assets/schemas/widget-manifest.schema.json +0 -12
- package/assets/schemas/widget-runtime-contracts.schema.json +0 -272
- package/assets/toolchain.json +7 -7
- package/dist/cli.mjs +1 -1
- package/dist/{dsh-BL6cMLrg.mjs → dsh-BJWUB8Nq.mjs} +1 -357
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -11
- package/dist/protocol/generated-host-runtime-config.d.ts +0 -22
- package/dist/protocol/generated-manifest.d.ts +0 -8
- package/dist/protocol/generated-plugin-manifest.d.ts +0 -8
- package/dist/protocol/generated-runtime-contracts.d.ts +0 -139
- package/dist/protocol/index.d.ts +2 -2
- package/dist/runtime/index.js +1 -1
- package/dist/{runtime-9g5MfsgK.js → runtime-Bn_ee8xy.js} +1 -1
- package/dist/widget.d.ts +1 -41
- package/package.json +1 -1
- package/schemas/widget-manifest.schema.json +0 -12
- package/schemas/widget-runtime-contracts.schema.json +0 -272
- package/conformance/bridge/tasks-list-request.json +0 -17
- package/conformance/bridge/tasks-watch-request.json +0 -18
package/dist/protocol/index.d.ts
CHANGED
|
@@ -8,9 +8,9 @@ import type { BridgeEnvelopeBase, GrantedCapability, HostToWidgetMessage, Render
|
|
|
8
8
|
* public surface drift from the canonical contract.
|
|
9
9
|
*/
|
|
10
10
|
export type { FallbackBinding, HostServiceAuthorization, HostServiceAuthorizationGranted, HostServiceAuthorizationRequired, LoadableBinding, NetworkAuthority, RuntimeAuthority, WidgetHostRuntimeConfig, WidgetServiceAccess, } from "./generated-host-runtime-config.js";
|
|
11
|
-
export type { ActivationEvents, HostUserPermission, HostUserPermissions, RequestedPresentationCapability, RequestedRegionCapability, StateCapabilityRequest,
|
|
11
|
+
export type { ActivationEvents, HostUserPermission, HostUserPermissions, RequestedPresentationCapability, RequestedRegionCapability, StateCapabilityRequest, WidgetContributionConfig, WidgetManifest, } from "./generated-manifest.js";
|
|
12
12
|
export type { WidgetContribution, WidgetFilePreviewContribution, WidgetPanelContribution, WidgetPluginContributions, } from "./generated-plugin-manifest.js";
|
|
13
|
-
export type { BridgeEnvelopeBase, CapabilityRequest, CapabilityRequestMessage, CapabilityResult, CapabilityResultMessage, ComputeReviewRequestedPublicWidgetEvent, ComputeReviewRequestedPublicWidgetEventPayload, DisposeMessage, EmptyPublicWidgetEventPayload, ErrorMessage, FileDownloadResult, FileMutationId, FilePreviewContent, FilePreviewRenderRequest, FileReadInput, FileReadResult, FileReference, FileRevision, FileWriteInput, FileWriteResult, FocusBoundaryPresentationCapabilityRequest, GrantedCapability, GrantedPresentationCapability, GrantedRegionCapability, HostToWidgetMessage, HostUserAction, HostUserEmailReadInput, HostUserEmailReadOutput, HostUserProfileReadInput, HostUserProfileReadOutput, HostUserService, HostUserServiceRequest, InitMessage, InitPayload, JsonValue, PanelContent, PanelRenderRequest, PresentationCapabilityOutput, PresentationCapabilityRequest, PresentationCapabilityResult, PublicWidgetEvent, PublicWidgetEventBase, PublicWidgetEventId, PublicWidgetEventOccurredAt, PublicWidgetEventTopic, PublicWidgetSessionId, PublicWidgetWorkflowId, ReadyMessage, RegionCapabilityRequest, RegionCapabilityResult, RenderMessage, RenderRequest, RenderRequestBase, RenderState, ResizeMessage, ResourceBudget, SandboxApprovalRequestedPublicWidgetEvent, SandboxApprovalRequestedPublicWidgetEventPayload, SandboxApprovedPublicWidgetEvent, SandboxApprovedPublicWidgetEventPayload, SandboxDeniedPublicWidgetEvent,
|
|
13
|
+
export type { BridgeEnvelopeBase, CapabilityRequest, CapabilityRequestMessage, CapabilityResult, CapabilityResultMessage, ComputeReviewRequestedPublicWidgetEvent, ComputeReviewRequestedPublicWidgetEventPayload, DisposeMessage, EmptyPublicWidgetEventPayload, ErrorMessage, FileDownloadResult, FileMutationId, FilePreviewContent, FilePreviewRenderRequest, FileReadInput, FileReadResult, FileReference, FileRevision, FileWriteInput, FileWriteResult, FocusBoundaryPresentationCapabilityRequest, GrantedCapability, GrantedPresentationCapability, GrantedRegionCapability, HostToWidgetMessage, HostUserAction, HostUserEmailReadInput, HostUserEmailReadOutput, HostUserProfileReadInput, HostUserProfileReadOutput, HostUserService, HostUserServiceRequest, InitMessage, InitPayload, JsonValue, PanelContent, PanelRenderRequest, PresentationCapabilityOutput, PresentationCapabilityRequest, PresentationCapabilityResult, PublicWidgetEvent, PublicWidgetEventBase, PublicWidgetEventId, PublicWidgetEventOccurredAt, PublicWidgetEventTopic, PublicWidgetSessionId, PublicWidgetWorkflowId, ReadyMessage, RegionCapabilityRequest, RegionCapabilityResult, RenderMessage, RenderRequest, RenderRequestBase, RenderState, ResizeMessage, ResourceBudget, SandboxApprovalRequestedPublicWidgetEvent, SandboxApprovalRequestedPublicWidgetEventPayload, SandboxApprovedPublicWidgetEvent, SandboxApprovedPublicWidgetEventPayload, SandboxDeniedPublicWidgetEvent, Theme, ThemeMode, ToolCallPublicWidgetEvent, ToolCallPublicWidgetEventPayload, ToolLifecycleEvent, ToolResultArtifact, ToolResultContent, ToolResultEnvelope, ToolResultMetric, ToolResultNotice, ToolResultProvenance, ToolResultPublicWidgetEvent, ToolResultPublicWidgetEventPayload, ToolResultRenderRequest, UiStateResult, UiStateWriteResult, UserInputRequestedPublicWidgetEvent, UserInputRequestedPublicWidgetEventPayload, WidgetContributionKind, WidgetError, WidgetEvent, WidgetEventBatch, WidgetEventMessage, WidgetLiveEvent, WidgetNetworkFetchInput, WidgetNetworkFetchOutput, WidgetNetworkLimits, WidgetRenderContext, WidgetServicePermission, WidgetServicePermissions, WidgetToHostMessage, WorkflowDonePublicWidgetEvent, WorkflowDonePublicWidgetEventPayload, WorkflowErrorPublicWidgetEvent, WorkflowErrorPublicWidgetEventPayload, WorkflowStartedPublicWidgetEvent, WorkflowStartedPublicWidgetEventPayload, } from "./generated-runtime-contracts.js";
|
|
14
14
|
export type { WidgetActivationEvent, WidgetActivationEvents, WidgetPluginManifest, WidgetToolPhase, } from "./plugin-manifest.js";
|
|
15
15
|
export { isWidgetActivationEvent, WIDGET_ACTIVATION_EVENTS, } from "./plugin-manifest.js";
|
|
16
16
|
export type { WidgetEventName } from "./widget-events.js";
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as isWidgetHostConnectMessage, c as WidgetClient, i as createWidgetClient, l as WIDGET_SDK_VERSION, n as WIDGET_HOST_CONNECT, o as PRESENTATION_CONFIRMATION_TIMEOUT_MS, r as WidgetRuntimeClient, s as REGION_CONFIRMATION_TIMEOUT_MS, t as WIDGET_BOOTSTRAP_READY } from "../runtime-
|
|
1
|
+
import { a as isWidgetHostConnectMessage, c as WidgetClient, i as createWidgetClient, l as WIDGET_SDK_VERSION, n as WIDGET_HOST_CONNECT, o as PRESENTATION_CONFIRMATION_TIMEOUT_MS, r as WidgetRuntimeClient, s as REGION_CONFIRMATION_TIMEOUT_MS, t as WIDGET_BOOTSTRAP_READY } from "../runtime-Bn_ee8xy.js";
|
|
2
2
|
import { i as isWidgetProtocolMessage, r as MessagePortTransport } from "../protocol-endpoint-DbT0OJNu.js";
|
|
3
3
|
export { MessagePortTransport, PRESENTATION_CONFIRMATION_TIMEOUT_MS, REGION_CONFIRMATION_TIMEOUT_MS, WIDGET_BOOTSTRAP_READY, WIDGET_HOST_CONNECT, WIDGET_SDK_VERSION, WidgetClient, WidgetRuntimeClient, createWidgetClient, isWidgetHostConnectMessage, isWidgetProtocolMessage };
|
|
@@ -2,7 +2,7 @@ import { r as MessagePortTransport, t as ProtocolEndpoint } from "./protocol-end
|
|
|
2
2
|
//#endregion
|
|
3
3
|
//#region src/runtime/version.ts
|
|
4
4
|
/** 从当前安装的 SDK package.json 读取版本,插件作者不需要重复填写。 */
|
|
5
|
-
const WIDGET_SDK_VERSION = "0.
|
|
5
|
+
const WIDGET_SDK_VERSION = "0.10.0";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/runtime/network.ts
|
|
8
8
|
const failureReasons = /* @__PURE__ */ new Set([
|
package/dist/widget.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CapabilityRequest, CapabilityResult, FileDownloadResult, FileReadInput, FileReference, FileWriteInput, GrantedCapability, RegionCapabilityResult, RenderRequest,
|
|
1
|
+
import type { CapabilityRequest, CapabilityResult, FileDownloadResult, FileReadInput, FileReference, FileWriteInput, GrantedCapability, RegionCapabilityResult, RenderRequest, Theme, UiStateResult, UiStateWriteResult, WidgetEventName, WidgetLiveEvent } from "./protocol/index.js";
|
|
2
2
|
import { type FileReadCapabilityResult, type FileWriteCapabilityResult } from "./runtime/files.js";
|
|
3
3
|
import { type CreateWidgetClientOptions, type RegionName, type WidgetClientFactoryOptions, type WidgetClientState, type WidgetLiveEventContext, type WidgetLiveEventHandler } from "./runtime/index.js";
|
|
4
4
|
import type { WidgetNetworkClient } from "./runtime/network.js";
|
|
@@ -52,45 +52,6 @@ export type FileDownloadCapabilityResult = {
|
|
|
52
52
|
} | Extract<CapabilityResult, {
|
|
53
53
|
readonly ok: false;
|
|
54
54
|
}>;
|
|
55
|
-
export interface WidgetTaskApi {
|
|
56
|
-
/**
|
|
57
|
-
* 读取一次受 Host 限制的任务摘要页。返回的 taskId 可继续用于 tasks.watch;
|
|
58
|
-
* 此 API 只发现任务,不创建、调度或取消任务。
|
|
59
|
-
*/
|
|
60
|
-
list(input?: {
|
|
61
|
-
readonly cursor?: string;
|
|
62
|
-
readonly limit?: number;
|
|
63
|
-
}, options?: {
|
|
64
|
-
readonly timeoutMs?: number;
|
|
65
|
-
readonly signal?: AbortSignal;
|
|
66
|
-
}): Promise<TaskListCapabilityResult>;
|
|
67
|
-
/**
|
|
68
|
-
* 读取一次受 Host 限制的任务快照和事件页。调用方使用返回的 cursor
|
|
69
|
-
* 继续轮询;此 API 不创建、调度或取消任务。
|
|
70
|
-
*/
|
|
71
|
-
watch(input: {
|
|
72
|
-
readonly taskId: string;
|
|
73
|
-
readonly cursor?: string;
|
|
74
|
-
readonly limit?: number;
|
|
75
|
-
}, options?: {
|
|
76
|
-
readonly timeoutMs?: number;
|
|
77
|
-
readonly signal?: AbortSignal;
|
|
78
|
-
}): Promise<TaskWatchCapabilityResult>;
|
|
79
|
-
}
|
|
80
|
-
/** tasks.list 的类型化能力结果。 */
|
|
81
|
-
export type TaskListCapabilityResult = {
|
|
82
|
-
readonly ok: true;
|
|
83
|
-
readonly data: TaskListPage;
|
|
84
|
-
} | Extract<CapabilityResult, {
|
|
85
|
-
readonly ok: false;
|
|
86
|
-
}>;
|
|
87
|
-
/** tasks.watch 的类型化能力结果。 */
|
|
88
|
-
export type TaskWatchCapabilityResult = {
|
|
89
|
-
readonly ok: true;
|
|
90
|
-
readonly data: TaskObservationBatch;
|
|
91
|
-
} | Extract<CapabilityResult, {
|
|
92
|
-
readonly ok: false;
|
|
93
|
-
}>;
|
|
94
55
|
export interface WidgetUiStateApi {
|
|
95
56
|
read(key: string, options?: {
|
|
96
57
|
readonly timeoutMs?: number;
|
|
@@ -147,7 +108,6 @@ export interface WidgetContext {
|
|
|
147
108
|
readonly signal: AbortSignal;
|
|
148
109
|
readonly capabilities: WidgetCapabilityApi;
|
|
149
110
|
readonly files: WidgetFileApi;
|
|
150
|
-
readonly tasks: WidgetTaskApi;
|
|
151
111
|
readonly network: WidgetNetworkClient;
|
|
152
112
|
/** 低层 service.invoke 入口;保留给自定义 Host service。 */
|
|
153
113
|
readonly services: WidgetServiceClient;
|
package/package.json
CHANGED
|
@@ -65,7 +65,6 @@
|
|
|
65
65
|
"properties": {
|
|
66
66
|
"files": { "$ref": "#/$defs/FilesCapabilityRequest" },
|
|
67
67
|
"events": { "$ref": "#/$defs/EventsCapabilityRequest" },
|
|
68
|
-
"tasks": { "$ref": "#/$defs/TasksCapabilityRequest" },
|
|
69
68
|
"state": { "$ref": "#/$defs/StateCapabilityRequest" },
|
|
70
69
|
"actions": { "$ref": "#/$defs/ActionsCapabilityRequest" },
|
|
71
70
|
"network": { "$ref": "#/$defs/NetworkCapabilityRequest" },
|
|
@@ -111,17 +110,6 @@
|
|
|
111
110
|
}
|
|
112
111
|
}
|
|
113
112
|
},
|
|
114
|
-
"TasksCapabilityRequest": {
|
|
115
|
-
"description": "任务发现与观察能力的申请;list / watch 至少显式申请一项,已申请项固定为 true。",
|
|
116
|
-
"title": "TasksCapabilityRequest",
|
|
117
|
-
"type": "object",
|
|
118
|
-
"additionalProperties": false,
|
|
119
|
-
"minProperties": 1,
|
|
120
|
-
"properties": {
|
|
121
|
-
"list": { "const": true },
|
|
122
|
-
"watch": { "const": true }
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
113
|
"StateCapabilityRequest": {
|
|
126
114
|
"description": "受限 UI 状态读写能力的申请;read / write 分别声明。",
|
|
127
115
|
"title": "StateCapabilityRequest",
|
|
@@ -72,24 +72,6 @@
|
|
|
72
72
|
},
|
|
73
73
|
"fileReadResult": { "$ref": "#/$defs/FileReadResult" },
|
|
74
74
|
"fileWriteResult": { "$ref": "#/$defs/FileWriteResult" },
|
|
75
|
-
"taskObservationSnapshot": {
|
|
76
|
-
"$ref": "#/$defs/TaskObservationSnapshot"
|
|
77
|
-
},
|
|
78
|
-
"taskObservationEvent": {
|
|
79
|
-
"$ref": "#/$defs/TaskObservationEvent"
|
|
80
|
-
},
|
|
81
|
-
"taskObservationBatch": {
|
|
82
|
-
"$ref": "#/$defs/TaskObservationBatch"
|
|
83
|
-
},
|
|
84
|
-
"taskListField": {
|
|
85
|
-
"$ref": "#/$defs/TaskListField"
|
|
86
|
-
},
|
|
87
|
-
"taskListItem": {
|
|
88
|
-
"$ref": "#/$defs/TaskListItem"
|
|
89
|
-
},
|
|
90
|
-
"taskListPage": {
|
|
91
|
-
"$ref": "#/$defs/TaskListPage"
|
|
92
|
-
},
|
|
93
75
|
"toolResultEnvelope": {
|
|
94
76
|
"$ref": "#/$defs/ToolResultEnvelope"
|
|
95
77
|
},
|
|
@@ -424,190 +406,6 @@
|
|
|
424
406
|
}
|
|
425
407
|
}
|
|
426
408
|
},
|
|
427
|
-
"TaskStatus": {
|
|
428
|
-
"description": "Host 投影给 Widget 的统一任务状态。",
|
|
429
|
-
"title": "TaskStatus",
|
|
430
|
-
"enum": ["queued", "running", "succeeded", "failed", "cancelled", "expired"]
|
|
431
|
-
},
|
|
432
|
-
"TaskObservationSnapshot": {
|
|
433
|
-
"description": "任务观察的当前快照:taskId、status 与 updatedAt;progress、message 可选。",
|
|
434
|
-
"title": "TaskObservationSnapshot",
|
|
435
|
-
"type": "object",
|
|
436
|
-
"additionalProperties": false,
|
|
437
|
-
"required": ["taskId", "status", "updatedAt"],
|
|
438
|
-
"properties": {
|
|
439
|
-
"taskId": {
|
|
440
|
-
"type": "string",
|
|
441
|
-
"minLength": 1,
|
|
442
|
-
"maxLength": 256
|
|
443
|
-
},
|
|
444
|
-
"status": { "$ref": "#/$defs/TaskStatus" },
|
|
445
|
-
"progress": {
|
|
446
|
-
"type": "number",
|
|
447
|
-
"minimum": 0,
|
|
448
|
-
"maximum": 1
|
|
449
|
-
},
|
|
450
|
-
"message": {
|
|
451
|
-
"type": "string",
|
|
452
|
-
"maxLength": 1024
|
|
453
|
-
},
|
|
454
|
-
"updatedAt": {
|
|
455
|
-
"type": "string",
|
|
456
|
-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T[^ ]+Z$"
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
},
|
|
460
|
-
"TaskObservationEvent": {
|
|
461
|
-
"description": "任务观察流中的单条事件;payload 由服务端裁剪。",
|
|
462
|
-
"title": "TaskObservationEvent",
|
|
463
|
-
"type": "object",
|
|
464
|
-
"additionalProperties": false,
|
|
465
|
-
"required": ["id", "type", "occurredAt", "payload"],
|
|
466
|
-
"properties": {
|
|
467
|
-
"id": {
|
|
468
|
-
"type": "string",
|
|
469
|
-
"minLength": 1,
|
|
470
|
-
"maxLength": 256
|
|
471
|
-
},
|
|
472
|
-
"type": {
|
|
473
|
-
"enum": ["started", "progress", "succeeded", "failed", "cancelled", "expired"]
|
|
474
|
-
},
|
|
475
|
-
"occurredAt": {
|
|
476
|
-
"type": "string",
|
|
477
|
-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T[^ ]+Z$"
|
|
478
|
-
},
|
|
479
|
-
"payload": {
|
|
480
|
-
"$ref": "#/$defs/JsonValue"
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
},
|
|
484
|
-
"TaskObservationBatch": {
|
|
485
|
-
"description": "任务观察的一页结果:快照 + 有限事件页 + 游标。",
|
|
486
|
-
"title": "TaskObservationBatch",
|
|
487
|
-
"type": "object",
|
|
488
|
-
"additionalProperties": false,
|
|
489
|
-
"required": ["schemaVersion", "taskId", "cursor", "reset", "hasMore", "snapshot", "events"],
|
|
490
|
-
"properties": {
|
|
491
|
-
"schemaVersion": { "const": 1 },
|
|
492
|
-
"taskId": {
|
|
493
|
-
"type": "string",
|
|
494
|
-
"minLength": 1,
|
|
495
|
-
"maxLength": 256
|
|
496
|
-
},
|
|
497
|
-
"cursor": {
|
|
498
|
-
"type": "string",
|
|
499
|
-
"minLength": 1,
|
|
500
|
-
"maxLength": 256
|
|
501
|
-
},
|
|
502
|
-
"reset": { "type": "boolean" },
|
|
503
|
-
"hasMore": { "type": "boolean" },
|
|
504
|
-
"snapshot": { "$ref": "#/$defs/TaskObservationSnapshot" },
|
|
505
|
-
"events": {
|
|
506
|
-
"type": "array",
|
|
507
|
-
"maxItems": 100,
|
|
508
|
-
"items": { "$ref": "#/$defs/TaskObservationEvent" }
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
},
|
|
512
|
-
"TaskListField": {
|
|
513
|
-
"description": "任务列表中的受限展示字段;key 是稳定机器键,value 是 Host 裁剪后的展示文本。",
|
|
514
|
-
"title": "TaskListField",
|
|
515
|
-
"type": "object",
|
|
516
|
-
"additionalProperties": false,
|
|
517
|
-
"required": ["key", "value"],
|
|
518
|
-
"properties": {
|
|
519
|
-
"key": {
|
|
520
|
-
"description": "展示字段的稳定机器键,例如 machine 或 command。",
|
|
521
|
-
"type": "string",
|
|
522
|
-
"minLength": 1,
|
|
523
|
-
"maxLength": 64,
|
|
524
|
-
"pattern": "^[A-Za-z][A-Za-z0-9_.:-]*$"
|
|
525
|
-
},
|
|
526
|
-
"value": {
|
|
527
|
-
"description": "Host 完成授权与裁剪后的展示文本。",
|
|
528
|
-
"type": "string",
|
|
529
|
-
"maxLength": 16384
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
},
|
|
533
|
-
"TaskListItem": {
|
|
534
|
-
"description": "Host 已授权发现的任务摘要;taskId 是可继续传给 tasks.watch 的不透明引用。",
|
|
535
|
-
"title": "TaskListItem",
|
|
536
|
-
"type": "object",
|
|
537
|
-
"additionalProperties": false,
|
|
538
|
-
"required": ["taskId", "kind", "name", "status", "updatedAt", "fields"],
|
|
539
|
-
"properties": {
|
|
540
|
-
"taskId": {
|
|
541
|
-
"description": "可继续传给 tasks.watch 的 Host 不透明任务引用。",
|
|
542
|
-
"type": "string",
|
|
543
|
-
"minLength": 1,
|
|
544
|
-
"maxLength": 256
|
|
545
|
-
},
|
|
546
|
-
"kind": {
|
|
547
|
-
"description": "任务来源类型的稳定机器键。",
|
|
548
|
-
"type": "string",
|
|
549
|
-
"minLength": 1,
|
|
550
|
-
"maxLength": 64,
|
|
551
|
-
"pattern": "^[A-Za-z][A-Za-z0-9_.:-]*$"
|
|
552
|
-
},
|
|
553
|
-
"name": {
|
|
554
|
-
"description": "任务的安全展示名称。",
|
|
555
|
-
"type": "string",
|
|
556
|
-
"minLength": 1,
|
|
557
|
-
"maxLength": 256
|
|
558
|
-
},
|
|
559
|
-
"status": {
|
|
560
|
-
"$ref": "#/$defs/TaskStatus"
|
|
561
|
-
},
|
|
562
|
-
"progress": {
|
|
563
|
-
"description": "可选执行进度,取值范围为 0 到 1。",
|
|
564
|
-
"type": "number",
|
|
565
|
-
"minimum": 0,
|
|
566
|
-
"maximum": 1
|
|
567
|
-
},
|
|
568
|
-
"message": {
|
|
569
|
-
"description": "Host 裁剪后的可选状态说明。",
|
|
570
|
-
"type": "string",
|
|
571
|
-
"maxLength": 1024
|
|
572
|
-
},
|
|
573
|
-
"updatedAt": {
|
|
574
|
-
"description": "任务摘要最后更新时间,使用 UTC ISO 8601 字符串。",
|
|
575
|
-
"type": "string",
|
|
576
|
-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T[^ ]+Z$"
|
|
577
|
-
},
|
|
578
|
-
"fields": {
|
|
579
|
-
"description": "任务面板可展示的受限附加字段。",
|
|
580
|
-
"type": "array",
|
|
581
|
-
"maxItems": 32,
|
|
582
|
-
"items": { "$ref": "#/$defs/TaskListField" }
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
},
|
|
586
|
-
"TaskListPage": {
|
|
587
|
-
"description": "Host 已授权任务摘要的一页结果;nextCursor 缺失表示当前页已到末尾。",
|
|
588
|
-
"title": "TaskListPage",
|
|
589
|
-
"type": "object",
|
|
590
|
-
"additionalProperties": false,
|
|
591
|
-
"required": ["schemaVersion", "tasks"],
|
|
592
|
-
"properties": {
|
|
593
|
-
"schemaVersion": {
|
|
594
|
-
"description": "任务列表页结构版本,当前固定为 1。",
|
|
595
|
-
"const": 1
|
|
596
|
-
},
|
|
597
|
-
"tasks": {
|
|
598
|
-
"description": "当前页中 Host 已授权的任务摘要。",
|
|
599
|
-
"type": "array",
|
|
600
|
-
"maxItems": 100,
|
|
601
|
-
"items": { "$ref": "#/$defs/TaskListItem" }
|
|
602
|
-
},
|
|
603
|
-
"nextCursor": {
|
|
604
|
-
"description": "下一页的不透明游标;缺失表示当前列表已到末尾。",
|
|
605
|
-
"type": "string",
|
|
606
|
-
"minLength": 1,
|
|
607
|
-
"maxLength": 512
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
},
|
|
611
409
|
"ToolResultMetric": {
|
|
612
410
|
"description": "工具结果中的单个指标。",
|
|
613
411
|
"title": "ToolResultMetric",
|
|
@@ -930,42 +728,6 @@
|
|
|
930
728
|
}
|
|
931
729
|
}
|
|
932
730
|
},
|
|
933
|
-
{
|
|
934
|
-
"type": "object",
|
|
935
|
-
"additionalProperties": false,
|
|
936
|
-
"required": ["name", "limits"],
|
|
937
|
-
"properties": {
|
|
938
|
-
"name": { "const": "tasks.list" },
|
|
939
|
-
"limits": {
|
|
940
|
-
"type": "object",
|
|
941
|
-
"additionalProperties": false,
|
|
942
|
-
"required": ["callsPerMinute", "pageSize", "minPollMs"],
|
|
943
|
-
"properties": {
|
|
944
|
-
"callsPerMinute": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
|
|
945
|
-
"pageSize": { "type": "integer", "minimum": 1, "maximum": 100 },
|
|
946
|
-
"minPollMs": { "type": "integer", "minimum": 1000, "maximum": 60000 }
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
},
|
|
951
|
-
{
|
|
952
|
-
"type": "object",
|
|
953
|
-
"additionalProperties": false,
|
|
954
|
-
"required": ["name", "limits"],
|
|
955
|
-
"properties": {
|
|
956
|
-
"name": { "const": "tasks.watch" },
|
|
957
|
-
"limits": {
|
|
958
|
-
"type": "object",
|
|
959
|
-
"additionalProperties": false,
|
|
960
|
-
"required": ["callsPerMinute", "pageSize", "minPollMs"],
|
|
961
|
-
"properties": {
|
|
962
|
-
"callsPerMinute": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
|
|
963
|
-
"pageSize": { "type": "integer", "minimum": 1, "maximum": 100 },
|
|
964
|
-
"minPollMs": { "type": "integer", "minimum": 1000, "maximum": 60000 }
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
},
|
|
969
731
|
{
|
|
970
732
|
"type": "object",
|
|
971
733
|
"additionalProperties": false,
|
|
@@ -1384,40 +1146,6 @@
|
|
|
1384
1146
|
}
|
|
1385
1147
|
}
|
|
1386
1148
|
},
|
|
1387
|
-
{
|
|
1388
|
-
"type": "object",
|
|
1389
|
-
"additionalProperties": false,
|
|
1390
|
-
"required": ["operation", "input"],
|
|
1391
|
-
"properties": {
|
|
1392
|
-
"operation": { "const": "tasks.list" },
|
|
1393
|
-
"input": {
|
|
1394
|
-
"type": "object",
|
|
1395
|
-
"additionalProperties": false,
|
|
1396
|
-
"properties": {
|
|
1397
|
-
"cursor": { "type": "string", "minLength": 1, "maxLength": 512 },
|
|
1398
|
-
"limit": { "type": "integer", "minimum": 1, "maximum": 100 }
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
}
|
|
1402
|
-
},
|
|
1403
|
-
{
|
|
1404
|
-
"type": "object",
|
|
1405
|
-
"additionalProperties": false,
|
|
1406
|
-
"required": ["operation", "input"],
|
|
1407
|
-
"properties": {
|
|
1408
|
-
"operation": { "const": "tasks.watch" },
|
|
1409
|
-
"input": {
|
|
1410
|
-
"type": "object",
|
|
1411
|
-
"additionalProperties": false,
|
|
1412
|
-
"required": ["taskId"],
|
|
1413
|
-
"properties": {
|
|
1414
|
-
"taskId": { "type": "string", "minLength": 1, "maxLength": 256 },
|
|
1415
|
-
"cursor": { "type": "string", "minLength": 1, "maxLength": 256 },
|
|
1416
|
-
"limit": { "type": "integer", "minimum": 1, "maximum": 100 }
|
|
1417
|
-
}
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
},
|
|
1421
1149
|
{
|
|
1422
1150
|
"type": "object",
|
|
1423
1151
|
"additionalProperties": false,
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"protocolVersion": 1,
|
|
3
|
-
"channelId": "0123456789abcdef0123456789abcdef",
|
|
4
|
-
"messageId": "widget-task-list-request-1",
|
|
5
|
-
"sequence": 5,
|
|
6
|
-
"type": "capability-request",
|
|
7
|
-
"payload": {
|
|
8
|
-
"requestId": "task-list-request-1",
|
|
9
|
-
"request": {
|
|
10
|
-
"operation": "tasks.list",
|
|
11
|
-
"input": {
|
|
12
|
-
"cursor": "page-1",
|
|
13
|
-
"limit": 20
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"protocolVersion": 1,
|
|
3
|
-
"channelId": "0123456789abcdef0123456789abcdef",
|
|
4
|
-
"messageId": "widget-task-watch-request-1",
|
|
5
|
-
"sequence": 5,
|
|
6
|
-
"type": "capability-request",
|
|
7
|
-
"payload": {
|
|
8
|
-
"requestId": "task-watch-request-1",
|
|
9
|
-
"request": {
|
|
10
|
-
"operation": "tasks.watch",
|
|
11
|
-
"input": {
|
|
12
|
-
"taskId": "task-001",
|
|
13
|
-
"cursor": "cursor-1",
|
|
14
|
-
"limit": 20
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|