@kmlckj/aios-agent-server-sdk 0.0.0-stage → 0.0.2
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/EVENTS.md +88 -0
- package/README.md +656 -2
- package/capabilities.json +2398 -0
- package/dist/cli/daemon/preferences.d.ts +67 -0
- package/dist/cli/daemon/protocol.d.ts +26 -0
- package/dist/cli/daemon/resource-limits.d.ts +39 -0
- package/dist/core/auth/platform-client.d.ts +65 -0
- package/dist/core/host/runtime-dependencies.d.ts +26 -0
- package/dist/core/skills/skill-bindings.d.ts +19 -0
- package/dist/core/skills/skill-versions.d.ts +31 -0
- package/dist/electron/main/bundled-runtime-tools.d.ts +24 -0
- package/dist/events.js +1 -0
- package/dist/index.js +55 -0
- package/dist/sdk/src/auth.d.ts +43 -0
- package/dist/sdk/src/authorization-events.d.ts +16 -0
- package/dist/sdk/src/authorization.d.ts +10 -0
- package/dist/sdk/src/communication.d.ts +9 -0
- package/dist/sdk/src/diagnostics.d.ts +24 -0
- package/dist/sdk/src/errors.d.ts +4 -0
- package/dist/sdk/src/events.d.ts +4 -0
- package/dist/sdk/src/file-api.d.ts +29 -0
- package/dist/sdk/src/file-storage.d.ts +34 -0
- package/dist/sdk/src/index.d.ts +260 -0
- package/dist/sdk/src/local-connection.d.ts +9 -0
- package/dist/sdk/src/managed-host.d.ts +32 -0
- package/dist/sdk/src/native-status.d.ts +59 -0
- package/dist/sdk/src/platform.d.ts +39 -0
- package/dist/sdk/src/runtime-control.d.ts +111 -0
- package/dist/sdk/src/runtime-integrity.d.ts +10 -0
- package/dist/sdk/src/tool-reference.d.ts +11 -0
- package/dist/sdk/src/tool-result.d.ts +36 -0
- package/dist/sdk/src/tool-server.d.ts +14 -0
- package/dist/sdk/src/transport.d.ts +25 -0
- package/dist/sdk/src/types.d.ts +405 -0
- package/dist/shared/account-context-api.d.ts +47 -0
- package/dist/shared/account-schedules-api.d.ts +110 -0
- package/dist/shared/action-center-api.d.ts +50 -0
- package/dist/shared/agent-capabilities.d.ts +42 -0
- package/dist/shared/agent-hooks.d.ts +10 -0
- package/dist/shared/agent-team.d.ts +19 -0
- package/dist/shared/artifact-evidence.d.ts +18 -0
- package/dist/shared/automation-api.d.ts +112 -0
- package/dist/shared/client-downloads-api.d.ts +20 -0
- package/dist/shared/cloud-assistant-api.d.ts +532 -0
- package/dist/shared/cloud-task-resources.d.ts +24 -0
- package/dist/shared/cloud-task-runtime-api.d.ts +253 -0
- package/dist/shared/collaboration-api.d.ts +17 -0
- package/dist/shared/collaboration-automation-api.d.ts +55 -0
- package/dist/shared/collaboration-deep-link.d.ts +15 -0
- package/dist/shared/collaboration-event-api.d.ts +19 -0
- package/dist/shared/collaboration-plan-api.d.ts +159 -0
- package/dist/shared/collaboration-project-api.d.ts +206 -0
- package/dist/shared/collaboration-resource-api.d.ts +41 -0
- package/dist/shared/collaboration-task-api.d.ts +276 -0
- package/dist/shared/collaboration-task-execution.d.ts +39 -0
- package/dist/shared/computer-use-api.d.ts +80 -0
- package/dist/shared/computer-use-handshake.d.ts +19 -0
- package/dist/shared/computer-use-protocol.d.ts +488 -0
- package/dist/shared/context-usage.d.ts +15 -0
- package/dist/shared/desktop-api.d.ts +450 -0
- package/dist/shared/desktop-diagnostics-api.d.ts +56 -0
- package/dist/shared/desktop-language.d.ts +3 -0
- package/dist/shared/desktop-mcp-service-api.d.ts +157 -0
- package/dist/shared/document-session-api.d.ts +91 -0
- package/dist/shared/enterprise-knowledge-api.d.ts +103 -0
- package/dist/shared/enterprise-project-api.d.ts +26 -0
- package/dist/shared/execution-activity.d.ts +3 -0
- package/dist/shared/execution-context.d.ts +62 -0
- package/dist/shared/execution-identity.d.ts +7 -0
- package/dist/shared/execution-profile.d.ts +6 -0
- package/dist/shared/execution-target.d.ts +71 -0
- package/dist/shared/expert-selection.d.ts +22 -0
- package/dist/shared/expert-team-api.d.ts +54 -0
- package/dist/shared/feedback-api.d.ts +20 -0
- package/dist/shared/git-api.d.ts +227 -0
- package/dist/shared/git-http-api.d.ts +12 -0
- package/dist/shared/hosted-git-api.d.ts +132 -0
- package/dist/shared/js-agent-hooks.d.ts +23 -0
- package/dist/shared/local-custom-model-api.d.ts +55 -0
- package/dist/shared/local-environment-api.d.ts +110 -0
- package/dist/shared/local-mcp-server-api.d.ts +91 -0
- package/dist/shared/local-memory.d.ts +165 -0
- package/dist/shared/local-plugin-api.d.ts +26 -0
- package/dist/shared/local-runtime-api.d.ts +32 -0
- package/dist/shared/local-skill-api.d.ts +42 -0
- package/dist/shared/local-task-api.d.ts +658 -0
- package/dist/shared/local-task-command-client.d.ts +55 -0
- package/dist/shared/local-task-command.d.ts +93 -0
- package/dist/shared/local-task-event-projection.d.ts +29 -0
- package/dist/shared/local-task-projection.d.ts +29 -0
- package/dist/shared/local-workspace.d.ts +9 -0
- package/dist/shared/managed-authorization.d.ts +72 -0
- package/dist/shared/memory-customization.d.ts +32 -0
- package/dist/shared/model-routing.d.ts +31 -0
- package/dist/shared/model-selection.d.ts +11 -0
- package/dist/shared/my-expert-api.d.ts +119 -0
- package/dist/shared/navigation-api.d.ts +20 -0
- package/dist/shared/office-window-api.d.ts +81 -0
- package/dist/shared/platform-branding-api.d.ts +66 -0
- package/dist/shared/plugin-market-api.d.ts +120 -0
- package/dist/shared/profession-market-api.d.ts +96 -0
- package/dist/shared/project-local-skill-api.d.ts +8 -0
- package/dist/shared/remote-connection-api.d.ts +97 -0
- package/dist/shared/remote-connection.d.ts +62 -0
- package/dist/shared/remote-installation-api.d.ts +50 -0
- package/dist/shared/remote-tasks-api.d.ts +118 -0
- package/dist/shared/runtime-tuning.d.ts +44 -0
- package/dist/shared/scene-case-api.d.ts +42 -0
- package/dist/shared/sdk-session-contract.d.ts +96 -0
- package/dist/shared/security-center-api.d.ts +74 -0
- package/dist/shared/sensitive-protection-api.d.ts +71 -0
- package/dist/shared/session-policy.d.ts +26 -0
- package/dist/shared/shortcut-api.d.ts +7 -0
- package/dist/shared/skill-activation-api.d.ts +8 -0
- package/dist/shared/skill-asset-api.d.ts +12 -0
- package/dist/shared/skill-market-api.d.ts +119 -0
- package/dist/shared/skill-upload.d.ts +16 -0
- package/dist/shared/speech-recognition-api.d.ts +12 -0
- package/dist/shared/storage-integrity.d.ts +15 -0
- package/dist/shared/target-bridge-protocol.d.ts +67 -0
- package/dist/shared/target-environments.d.ts +15 -0
- package/dist/shared/target-resources.d.ts +105 -0
- package/dist/shared/task-enterprise-project-api.d.ts +75 -0
- package/dist/shared/task-execution-api.d.ts +35 -0
- package/dist/shared/task-initialization-api.d.ts +44 -0
- package/dist/shared/task-menu-api.d.ts +27 -0
- package/dist/shared/task-operation.d.ts +19 -0
- package/dist/shared/task-path-policy.d.ts +14 -0
- package/dist/shared/task-resource-manifest.d.ts +33 -0
- package/dist/shared/task-storage-recovery.d.ts +33 -0
- package/dist/shared/task-terminal-api.d.ts +48 -0
- package/dist/shared/team-control.d.ts +60 -0
- package/dist/shared/tool-activity.d.ts +18 -0
- package/dist/shared/update-api.d.ts +65 -0
- package/dist/shared/usage-statistics-api.d.ts +18 -0
- package/dist/shared/worktree-api.d.ts +188 -0
- package/examples/business-assistant.mjs +19 -0
- package/examples/common.mjs +51 -0
- package/examples/platform-assistant.mjs +9 -0
- package/examples/standalone-assistant.mjs +16 -0
- package/package.json +40 -4
|
@@ -0,0 +1,658 @@
|
|
|
1
|
+
import type { LocalTaskExecutionCommands } from './local-task-command-client.js';
|
|
2
|
+
import type { ModelReasoningEffort } from './model-selection.js';
|
|
3
|
+
import type { CloudFileEntry } from './cloud-assistant-api.js';
|
|
4
|
+
/** Message submission limit; stored task histories can contain more attachments. */
|
|
5
|
+
export declare const MAX_MESSAGE_ATTACHMENTS = 10;
|
|
6
|
+
export type LocalTaskStatus = 'ready' | 'running' | 'waiting_approval' | 'waiting_plan' | 'completed' | 'cancelled' | 'interrupted' | 'failed' | 'archived';
|
|
7
|
+
export type LocalTaskMessageRole = 'user' | 'assistant' | 'system';
|
|
8
|
+
export type LocalTaskWorkspaceKind = 'managed' | 'external' | 'auto';
|
|
9
|
+
export type LocalTaskMessageMode = 'agent' | 'plan' | 'chat';
|
|
10
|
+
export type LocalTaskPermissionMode = 'ask_dangerous' | 'allow_all';
|
|
11
|
+
/** An ordinary local task opened from a document. The source is not an attachment copy. */
|
|
12
|
+
export interface LocalTaskDocumentBinding {
|
|
13
|
+
version: 1;
|
|
14
|
+
filePath: string;
|
|
15
|
+
/** Stable first-send identity; retried creation returns the same task. */
|
|
16
|
+
creationId: string;
|
|
17
|
+
}
|
|
18
|
+
export interface DocumentTaskInstruction {
|
|
19
|
+
id: string;
|
|
20
|
+
action: 'add' | 'send';
|
|
21
|
+
content: string;
|
|
22
|
+
richContent?: LocalTaskRichContent;
|
|
23
|
+
selection: import('./document-session-api.js').DocumentSelection;
|
|
24
|
+
}
|
|
25
|
+
export type LocalTaskEventType = 'sensitive_protection' | 'command_control' | 'status' | 'queue_changed' | 'text_delta' | 'stage_message' | 'thinking_delta' | 'state' | 'tool_start' | 'tool_result' | 'sub_agent' | 'team_run' | 'team_member' | 'team_collaboration' | 'team_workflow_task' | 'team_artifact' | 'command' | 'file_change' | 'file_diff' | 'turn_diff' | 'approval_required' | 'approval_response' | 'user_input_required' | 'user_input_response' | 'open_browser' | 'plan_delta' | 'plan_response' | 'task_list' | 'plan_ready' | 'usage' | 'complete' | 'error';
|
|
26
|
+
export interface LocalTask {
|
|
27
|
+
executionIdentity?: import('./execution-identity.js').StandaloneExecutionIdentity;
|
|
28
|
+
documentBinding?: LocalTaskDocumentBinding;
|
|
29
|
+
/** Desktop-only read projection; the authoritative target record keeps its UUID. */
|
|
30
|
+
targetRef?: import('./execution-target.js').TaskRef;
|
|
31
|
+
/** Immutable creation scope; absent on old tasks whose enterprise cannot be proven. */
|
|
32
|
+
memoryScope?: import('./local-memory.js').MemoryScope;
|
|
33
|
+
/** Absent on pre-integrity task records. Original journal formats are unchanged. */
|
|
34
|
+
storageVersion?: 1;
|
|
35
|
+
/** Immutable command entry selected when the task was created; absent means the original native shell entry. */
|
|
36
|
+
commandEntryVersion?: 2;
|
|
37
|
+
/** Read-only projection; never saved back as execution state. */
|
|
38
|
+
storageIssue?: string;
|
|
39
|
+
recoveryContext?: string;
|
|
40
|
+
id: string;
|
|
41
|
+
ownerUserId: string;
|
|
42
|
+
/** Explicit platform provenance. Legacy records without it are not exposed
|
|
43
|
+
* through remote account-scoped views. */
|
|
44
|
+
ownerPlatformUrl?: string;
|
|
45
|
+
name: string;
|
|
46
|
+
projectId?: string;
|
|
47
|
+
projectName?: string;
|
|
48
|
+
automationId?: string;
|
|
49
|
+
automationName?: string;
|
|
50
|
+
workspacePath: string;
|
|
51
|
+
workspaceName: string;
|
|
52
|
+
workspaceKind: LocalTaskWorkspaceKind;
|
|
53
|
+
permissionMode?: LocalTaskPermissionMode;
|
|
54
|
+
model?: string;
|
|
55
|
+
recommendedModel?: string;
|
|
56
|
+
thinkingEnabled?: boolean;
|
|
57
|
+
reasoningEffort?: ModelReasoningEffort;
|
|
58
|
+
contextWindow?: number;
|
|
59
|
+
profession?: LocalTaskProfessionReference;
|
|
60
|
+
status: LocalTaskStatus;
|
|
61
|
+
createdAt: string;
|
|
62
|
+
updatedAt: string;
|
|
63
|
+
lastOpenedAt?: string;
|
|
64
|
+
archivedAt?: string;
|
|
65
|
+
pinnedAt?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface LocalTaskUsage {
|
|
68
|
+
inputTokens: number;
|
|
69
|
+
outputTokens: number;
|
|
70
|
+
cacheReadTokens?: number;
|
|
71
|
+
cacheWriteTokens?: number;
|
|
72
|
+
chargedPoints?: number;
|
|
73
|
+
}
|
|
74
|
+
export interface LocalTaskWorkspace {
|
|
75
|
+
remote?: {
|
|
76
|
+
connectionId: string;
|
|
77
|
+
connectionName: string;
|
|
78
|
+
ref: import('./execution-target.js').WorkspaceRef;
|
|
79
|
+
};
|
|
80
|
+
localWorkspaceId?: string;
|
|
81
|
+
unavailableReason?: string;
|
|
82
|
+
kind: LocalTaskWorkspaceKind;
|
|
83
|
+
name: string;
|
|
84
|
+
path?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface LocalTaskExpertTeamMemberReference {
|
|
87
|
+
memberId: string;
|
|
88
|
+
displayName: string;
|
|
89
|
+
profession: string;
|
|
90
|
+
role: 'lead' | 'member';
|
|
91
|
+
avatarRelativePath: string;
|
|
92
|
+
}
|
|
93
|
+
export interface LocalTaskExpertTeamReference {
|
|
94
|
+
source?: 'MARKET' | 'LOCAL';
|
|
95
|
+
packageId: string;
|
|
96
|
+
packageVersion: string;
|
|
97
|
+
packageHash: string;
|
|
98
|
+
snapshotHash: string;
|
|
99
|
+
leadAgentId: string;
|
|
100
|
+
members: LocalTaskExpertTeamMemberReference[];
|
|
101
|
+
}
|
|
102
|
+
export interface LocalTaskProfessionReference {
|
|
103
|
+
source?: 'MARKET' | 'LOCAL';
|
|
104
|
+
professionId: string;
|
|
105
|
+
professionForm: 'EXPERT' | 'EXPERT_TEAM';
|
|
106
|
+
name: string;
|
|
107
|
+
summary: string;
|
|
108
|
+
iconUrl?: string | null;
|
|
109
|
+
versionId: string;
|
|
110
|
+
versionNo: string;
|
|
111
|
+
instructions?: string;
|
|
112
|
+
expertTeam?: LocalTaskExpertTeamReference;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* 用户在新建任务时选中的场景。skillReferences/professionId 只用于把场景
|
|
116
|
+
* 隐式注入的能力与用户主动选择的能力区分开;消息历史仍保留场景名称,
|
|
117
|
+
* 以便准确还原用户实际发送的上下文。
|
|
118
|
+
*/
|
|
119
|
+
export interface LocalTaskSceneContext {
|
|
120
|
+
sceneCaseId: string;
|
|
121
|
+
name: string;
|
|
122
|
+
skillReferences: string[];
|
|
123
|
+
professionId?: string;
|
|
124
|
+
}
|
|
125
|
+
export interface LocalTaskMessage {
|
|
126
|
+
/** User input appended to an existing execution, not a new billed run. */
|
|
127
|
+
steered?: boolean;
|
|
128
|
+
/** Enterprise capabilities supplied to this turn, including enabled plugins. */
|
|
129
|
+
enterpriseResources?: LocalTaskEnterpriseResource[];
|
|
130
|
+
/** Discovery candidates are requirements only after the task actually loads them. */
|
|
131
|
+
enterpriseSkillCatalog?: Array<LocalTaskEnterpriseResource & {
|
|
132
|
+
skillRef: string;
|
|
133
|
+
}>;
|
|
134
|
+
id: string;
|
|
135
|
+
taskId: string;
|
|
136
|
+
runId?: string;
|
|
137
|
+
role: LocalTaskMessageRole;
|
|
138
|
+
content: string;
|
|
139
|
+
createdAt: string;
|
|
140
|
+
status?: 'streaming' | 'complete' | 'cancelled' | 'failed';
|
|
141
|
+
thinking?: string;
|
|
142
|
+
durationMs?: number;
|
|
143
|
+
usage?: LocalTaskUsage;
|
|
144
|
+
mode?: LocalTaskMessageMode;
|
|
145
|
+
/** 用户在这一轮选择的模型;Auto 选择保持为 auto。 */
|
|
146
|
+
model?: string;
|
|
147
|
+
/** Runtime 在这一轮实际使用的模型,用于准确还原历史回复。 */
|
|
148
|
+
actualModel?: string;
|
|
149
|
+
thinkingEnabled?: boolean;
|
|
150
|
+
reasoningEffort?: ModelReasoningEffort;
|
|
151
|
+
contextWindow?: number;
|
|
152
|
+
runtimeTuning?: import('./runtime-tuning.js').RuntimeTuning;
|
|
153
|
+
attachments?: LocalTaskAttachment[];
|
|
154
|
+
references?: LocalTaskFileReference[];
|
|
155
|
+
richContent?: LocalTaskRichContent;
|
|
156
|
+
skills?: LocalTaskSkillReference[];
|
|
157
|
+
plugins?: LocalTaskPluginReference[];
|
|
158
|
+
sceneContext?: LocalTaskSceneContext;
|
|
159
|
+
}
|
|
160
|
+
export interface LocalTaskEnterpriseResource {
|
|
161
|
+
kind: 'skill' | 'plugin';
|
|
162
|
+
id: string;
|
|
163
|
+
name: string;
|
|
164
|
+
runtimePluginId?: string;
|
|
165
|
+
tenantId?: string;
|
|
166
|
+
tenantName?: string;
|
|
167
|
+
}
|
|
168
|
+
export interface ListLocalTaskMessagesRequest {
|
|
169
|
+
taskId: string;
|
|
170
|
+
cursor?: string;
|
|
171
|
+
limit?: number;
|
|
172
|
+
}
|
|
173
|
+
export interface LocalTaskMessagePage {
|
|
174
|
+
items: LocalTaskMessage[];
|
|
175
|
+
nextCursor?: string;
|
|
176
|
+
hasMore: boolean;
|
|
177
|
+
}
|
|
178
|
+
export type LocalTaskAttachmentKind = 'image' | 'file' | 'folder';
|
|
179
|
+
export interface LocalTaskAttachmentDraft {
|
|
180
|
+
/** Source identity for an office document snapshot; data still carries the current editor bytes. */
|
|
181
|
+
conversationDocumentPath?: string;
|
|
182
|
+
/**
|
|
183
|
+
* 本机文件使用 sourcePath;云端项目资产使用 data。
|
|
184
|
+
* 两者必须且只能提供一个,由主进程在导入时校验。
|
|
185
|
+
*/
|
|
186
|
+
sourcePath?: string;
|
|
187
|
+
data?: Uint8Array;
|
|
188
|
+
name: string;
|
|
189
|
+
sizeBytes: number;
|
|
190
|
+
mediaType: string;
|
|
191
|
+
kind: LocalTaskAttachmentKind;
|
|
192
|
+
}
|
|
193
|
+
export interface LocalTaskAttachment {
|
|
194
|
+
id: string;
|
|
195
|
+
name: string;
|
|
196
|
+
sizeBytes: number;
|
|
197
|
+
mediaType: string;
|
|
198
|
+
kind: LocalTaskAttachmentKind;
|
|
199
|
+
/**
|
|
200
|
+
* 用户从本机选择附件时保留的原始绝对路径,用于消息复制和再次发送。
|
|
201
|
+
* 由二进制内容导入的附件没有本机来源路径。
|
|
202
|
+
*/
|
|
203
|
+
sourcePath?: string;
|
|
204
|
+
createdAt: string;
|
|
205
|
+
}
|
|
206
|
+
export interface LocalTaskFileReference {
|
|
207
|
+
path: string;
|
|
208
|
+
name: string;
|
|
209
|
+
nodeType?: 'file' | 'folder';
|
|
210
|
+
teamRunId?: string;
|
|
211
|
+
sourceThreadId?: string;
|
|
212
|
+
contributorMemberIds?: string[];
|
|
213
|
+
contributorDisplayNames?: string[];
|
|
214
|
+
phaseId?: string;
|
|
215
|
+
}
|
|
216
|
+
export interface LocalTaskSkillReference {
|
|
217
|
+
/** An explicit expert dependency may require an exact platform version. */
|
|
218
|
+
requiredVersionId?: string;
|
|
219
|
+
/** Local package origin. Changing execution targets must not substitute a namesake package. */
|
|
220
|
+
executionScope?: string;
|
|
221
|
+
tenantId?: string | null;
|
|
222
|
+
/** 云端、企业和内置技能使用平台技能标识;旧任务中的本地技能也可能保留该字段。 */
|
|
223
|
+
skillId?: string;
|
|
224
|
+
/** 本地技能使用安装文件夹名称作为身份。 */
|
|
225
|
+
folderName?: string;
|
|
226
|
+
name: string;
|
|
227
|
+
description: string;
|
|
228
|
+
source?: 'PLATFORM' | 'ENTERPRISE' | 'MINE' | 'LOCAL' | 'BUILTIN';
|
|
229
|
+
iconUrl?: string | null;
|
|
230
|
+
version?: string;
|
|
231
|
+
/** Immutable cloud package revision, including versions without a display number. */
|
|
232
|
+
versionId?: string;
|
|
233
|
+
packageRef?: string;
|
|
234
|
+
instructions?: string;
|
|
235
|
+
localPath?: string;
|
|
236
|
+
localRevision?: string;
|
|
237
|
+
}
|
|
238
|
+
export type LocalTaskRichSegment = {
|
|
239
|
+
type: 'text';
|
|
240
|
+
text: string;
|
|
241
|
+
} | {
|
|
242
|
+
type: 'skill';
|
|
243
|
+
skillId: string;
|
|
244
|
+
name: string;
|
|
245
|
+
} | {
|
|
246
|
+
type: 'quote';
|
|
247
|
+
id: string;
|
|
248
|
+
} | {
|
|
249
|
+
type: 'document-selection';
|
|
250
|
+
id: string;
|
|
251
|
+
selection: import('./document-session-api.js').DocumentSelection;
|
|
252
|
+
} | {
|
|
253
|
+
type: 'attachment';
|
|
254
|
+
id: string;
|
|
255
|
+
name: string;
|
|
256
|
+
source?: string;
|
|
257
|
+
reference?: Record<string, unknown>;
|
|
258
|
+
};
|
|
259
|
+
export interface LocalTaskRichContent {
|
|
260
|
+
/** Earlier office drafts/messages stored one selection outside the inline body. */
|
|
261
|
+
documentSelection?: import('./document-session-api.js').DocumentSelection;
|
|
262
|
+
version: 1;
|
|
263
|
+
segments: LocalTaskRichSegment[];
|
|
264
|
+
quotes?: LocalTaskQuote[];
|
|
265
|
+
}
|
|
266
|
+
/** Immutable user-selected excerpt, independent of the retained history window. */
|
|
267
|
+
export interface LocalTaskQuote {
|
|
268
|
+
id: string;
|
|
269
|
+
messageId: string;
|
|
270
|
+
kind: 'text' | 'table';
|
|
271
|
+
content: string;
|
|
272
|
+
/** Historical comments remain readable; new quotes do not add comments. */
|
|
273
|
+
comment?: string;
|
|
274
|
+
offset?: number;
|
|
275
|
+
}
|
|
276
|
+
export declare function localTaskAttachmentDraftKey(attachment: LocalTaskAttachmentDraft | LocalTaskAttachment): string;
|
|
277
|
+
export interface LocalTaskPluginToolReference {
|
|
278
|
+
toolId: string;
|
|
279
|
+
name: string;
|
|
280
|
+
description?: string;
|
|
281
|
+
inputSchema: Record<string, unknown>;
|
|
282
|
+
}
|
|
283
|
+
export interface LocalTaskPluginReference {
|
|
284
|
+
sourcePluginId: string;
|
|
285
|
+
recordId?: string;
|
|
286
|
+
runtimePluginId?: string;
|
|
287
|
+
name: string;
|
|
288
|
+
description: string;
|
|
289
|
+
pluginKind: 'CLOUD' | 'LOCAL' | 'MCP' | 'OFFICIAL';
|
|
290
|
+
source?: 'PLATFORM' | 'ENTERPRISE' | 'MINE';
|
|
291
|
+
version?: string;
|
|
292
|
+
iconUrl?: string | null;
|
|
293
|
+
tools?: LocalTaskPluginToolReference[];
|
|
294
|
+
}
|
|
295
|
+
export interface LocalTaskWorkspaceFile extends LocalTaskFileReference {
|
|
296
|
+
sizeBytes: number;
|
|
297
|
+
modifiedAt: string;
|
|
298
|
+
}
|
|
299
|
+
export type LocalTaskArtifactType = 'document' | 'spreadsheet' | 'presentation' | 'pdf' | 'image' | 'video' | 'audio' | 'website' | 'markdown' | 'code' | 'other';
|
|
300
|
+
export interface LocalTaskArtifact {
|
|
301
|
+
id: string;
|
|
302
|
+
taskId: string;
|
|
303
|
+
taskName: string;
|
|
304
|
+
projectId?: string;
|
|
305
|
+
projectName?: string;
|
|
306
|
+
automationId?: string;
|
|
307
|
+
automationName?: string;
|
|
308
|
+
workspacePath: string;
|
|
309
|
+
workspaceName: string;
|
|
310
|
+
workspaceKind: LocalTaskWorkspaceKind;
|
|
311
|
+
path: string;
|
|
312
|
+
sourcePath: string;
|
|
313
|
+
name: string;
|
|
314
|
+
mediaType: string;
|
|
315
|
+
sizeBytes: number;
|
|
316
|
+
modifiedAt: string;
|
|
317
|
+
artifactType: LocalTaskArtifactType;
|
|
318
|
+
favorite: boolean;
|
|
319
|
+
}
|
|
320
|
+
export interface ListLocalTaskArtifactsRequest {
|
|
321
|
+
taskId?: string;
|
|
322
|
+
query?: string;
|
|
323
|
+
type?: LocalTaskArtifactType;
|
|
324
|
+
favoriteOnly?: boolean;
|
|
325
|
+
includeArchived?: boolean;
|
|
326
|
+
limit?: number;
|
|
327
|
+
}
|
|
328
|
+
export interface SetLocalTaskArtifactFavoriteRequest {
|
|
329
|
+
taskId: string;
|
|
330
|
+
path: string;
|
|
331
|
+
favorite: boolean;
|
|
332
|
+
}
|
|
333
|
+
export interface UploadLocalTaskProjectAssetRequest {
|
|
334
|
+
taskId: string;
|
|
335
|
+
path: string;
|
|
336
|
+
projectDir?: string;
|
|
337
|
+
fileName?: string;
|
|
338
|
+
fileType?: string;
|
|
339
|
+
}
|
|
340
|
+
export type LocalTaskFileTarget = {
|
|
341
|
+
kind: 'attachment';
|
|
342
|
+
attachmentId: string;
|
|
343
|
+
} | {
|
|
344
|
+
kind: 'workspace';
|
|
345
|
+
path: string;
|
|
346
|
+
worktreeId?: string;
|
|
347
|
+
};
|
|
348
|
+
export interface LocalTaskFileContent {
|
|
349
|
+
name: string;
|
|
350
|
+
mediaType: string;
|
|
351
|
+
sizeBytes: number;
|
|
352
|
+
dataUrl: string;
|
|
353
|
+
revision: string;
|
|
354
|
+
}
|
|
355
|
+
export interface WriteLocalTaskFileRequest {
|
|
356
|
+
taskId: string;
|
|
357
|
+
target: Extract<LocalTaskFileTarget, {
|
|
358
|
+
kind: 'workspace';
|
|
359
|
+
}>;
|
|
360
|
+
data: Uint8Array;
|
|
361
|
+
expectedRevision: string;
|
|
362
|
+
}
|
|
363
|
+
export interface WriteLocalTaskFileResult {
|
|
364
|
+
sizeBytes: number;
|
|
365
|
+
revision: string;
|
|
366
|
+
}
|
|
367
|
+
export interface LocalTaskEvent {
|
|
368
|
+
/** Lossless display aggregation; never persisted in the execution journal. */
|
|
369
|
+
displayChunks?: import('./local-task-event-projection.js').LocalTaskTextSpan[];
|
|
370
|
+
/** Dense display-only sequence, text-end and timestamp columns. Original events remain in the journal. */
|
|
371
|
+
displaySequence?: {
|
|
372
|
+
positions: Float64Array;
|
|
373
|
+
ids: string;
|
|
374
|
+
lastEventId: string;
|
|
375
|
+
};
|
|
376
|
+
id: string;
|
|
377
|
+
taskId: string;
|
|
378
|
+
runId?: string;
|
|
379
|
+
sequence?: number;
|
|
380
|
+
threadId?: string;
|
|
381
|
+
turnId?: string;
|
|
382
|
+
itemId?: string;
|
|
383
|
+
requestId?: string;
|
|
384
|
+
type: LocalTaskEventType;
|
|
385
|
+
payload: Record<string, unknown>;
|
|
386
|
+
createdAt: string;
|
|
387
|
+
}
|
|
388
|
+
export interface ListLocalTaskEventsQuery {
|
|
389
|
+
project?: boolean;
|
|
390
|
+
runIds?: string[];
|
|
391
|
+
afterEventId?: string;
|
|
392
|
+
}
|
|
393
|
+
export interface LocalTaskEventPage {
|
|
394
|
+
data: Uint8Array;
|
|
395
|
+
nextCursor?: string;
|
|
396
|
+
}
|
|
397
|
+
export type LocalTaskInteractionKind = 'approval' | 'question' | 'elicitation' | 'permission';
|
|
398
|
+
export type LocalTaskInteractionStatus = 'pending' | 'submitted' | 'resolved' | 'cancelled' | 'expired' | 'orphaned';
|
|
399
|
+
export interface LocalTaskInteraction {
|
|
400
|
+
id: string;
|
|
401
|
+
taskId: string;
|
|
402
|
+
runId: string;
|
|
403
|
+
requestId: string;
|
|
404
|
+
itemId?: string;
|
|
405
|
+
kind: LocalTaskInteractionKind;
|
|
406
|
+
status: LocalTaskInteractionStatus;
|
|
407
|
+
payload: Record<string, unknown>;
|
|
408
|
+
createdAt: string;
|
|
409
|
+
updatedAt: string;
|
|
410
|
+
}
|
|
411
|
+
export interface ListLocalTasksQuery {
|
|
412
|
+
includeArchived?: boolean;
|
|
413
|
+
projectId?: string;
|
|
414
|
+
}
|
|
415
|
+
export interface CreateLocalTaskRequest {
|
|
416
|
+
documentBinding?: LocalTaskDocumentBinding;
|
|
417
|
+
name?: string;
|
|
418
|
+
projectId?: string;
|
|
419
|
+
projectName?: string;
|
|
420
|
+
automationId?: string;
|
|
421
|
+
automationName?: string;
|
|
422
|
+
workspacePath?: string;
|
|
423
|
+
workspaceKind?: LocalTaskWorkspaceKind;
|
|
424
|
+
permissionMode?: LocalTaskPermissionMode;
|
|
425
|
+
recommendedModel?: string;
|
|
426
|
+
profession?: LocalTaskProfessionReference;
|
|
427
|
+
editExpertId?: string;
|
|
428
|
+
}
|
|
429
|
+
export interface CreateLocalTaskWorkspaceRequest {
|
|
430
|
+
name: string;
|
|
431
|
+
}
|
|
432
|
+
export interface CreateDocumentTaskRequest {
|
|
433
|
+
/** Current office file capability; only the initial host acceptance needs it. */
|
|
434
|
+
documentId: string;
|
|
435
|
+
task: CreateLocalTaskRequest & {
|
|
436
|
+
documentBinding: LocalTaskDocumentBinding;
|
|
437
|
+
};
|
|
438
|
+
message: Omit<SendLocalTaskMessageRequest, 'taskId'>;
|
|
439
|
+
commandId: string;
|
|
440
|
+
messageId: string;
|
|
441
|
+
}
|
|
442
|
+
export interface DocumentTaskSubmissionResult {
|
|
443
|
+
task: LocalTask;
|
|
444
|
+
reply: import('./local-task-command.js').LocalTaskCommandReply;
|
|
445
|
+
}
|
|
446
|
+
export interface RenameLocalTaskRequest {
|
|
447
|
+
taskId: string;
|
|
448
|
+
name: string;
|
|
449
|
+
}
|
|
450
|
+
export interface SetLocalTaskArchivedRequest {
|
|
451
|
+
taskId: string;
|
|
452
|
+
archived: boolean;
|
|
453
|
+
}
|
|
454
|
+
export interface SetLocalTaskPinnedRequest {
|
|
455
|
+
taskId: string;
|
|
456
|
+
pinned: boolean;
|
|
457
|
+
}
|
|
458
|
+
export interface SetLocalTaskPermissionModeRequest {
|
|
459
|
+
taskId: string;
|
|
460
|
+
permissionMode: LocalTaskPermissionMode;
|
|
461
|
+
}
|
|
462
|
+
export interface SetLocalTaskModelSelectionRequest {
|
|
463
|
+
taskId: string;
|
|
464
|
+
model: string;
|
|
465
|
+
thinkingEnabled: boolean;
|
|
466
|
+
reasoningEffort: ModelReasoningEffort | undefined;
|
|
467
|
+
contextWindow?: number;
|
|
468
|
+
runtimeTuning?: import('./runtime-tuning.js').RuntimeTuning;
|
|
469
|
+
}
|
|
470
|
+
export interface DeleteLocalTaskRequest {
|
|
471
|
+
taskId: string;
|
|
472
|
+
confirmed?: boolean;
|
|
473
|
+
}
|
|
474
|
+
export interface RemoveLocalTaskWorkspaceRequest {
|
|
475
|
+
workspacePath: string;
|
|
476
|
+
confirmed?: boolean;
|
|
477
|
+
}
|
|
478
|
+
export interface RemoveLocalTaskWorkspaceResult {
|
|
479
|
+
removedTaskIds: string[];
|
|
480
|
+
}
|
|
481
|
+
export interface SendLocalTaskMessageRequest {
|
|
482
|
+
taskId: string;
|
|
483
|
+
content: string;
|
|
484
|
+
model?: string;
|
|
485
|
+
thinkingEnabled?: boolean;
|
|
486
|
+
reasoningEffort?: ModelReasoningEffort;
|
|
487
|
+
contextWindow?: number;
|
|
488
|
+
runtimeTuning?: import('./runtime-tuning.js').RuntimeTuning;
|
|
489
|
+
mode?: LocalTaskMessageMode;
|
|
490
|
+
permissionMode?: LocalTaskPermissionMode;
|
|
491
|
+
attachments?: LocalTaskAttachmentDraft[];
|
|
492
|
+
attachmentIds?: string[];
|
|
493
|
+
references?: LocalTaskFileReference[];
|
|
494
|
+
richContent?: LocalTaskRichContent;
|
|
495
|
+
skills?: LocalTaskSkillReference[];
|
|
496
|
+
plugins?: LocalTaskPluginReference[];
|
|
497
|
+
sceneContext?: LocalTaskSceneContext;
|
|
498
|
+
}
|
|
499
|
+
export interface RestartLocalTaskMessageRequest {
|
|
500
|
+
taskId: string;
|
|
501
|
+
messageId: string;
|
|
502
|
+
content: string;
|
|
503
|
+
attachmentIds: string[];
|
|
504
|
+
referencePaths: string[];
|
|
505
|
+
}
|
|
506
|
+
export interface LocalTaskPendingMessage {
|
|
507
|
+
/** A dispatched addition must be reconciled before any ordinary queue dispatch. */
|
|
508
|
+
steeringRunId?: string;
|
|
509
|
+
/** Exact submitted snapshot, committed to history only after acceptance. */
|
|
510
|
+
steeringMessage?: LocalTaskMessage;
|
|
511
|
+
id: string;
|
|
512
|
+
taskId: string;
|
|
513
|
+
content: string;
|
|
514
|
+
model?: string;
|
|
515
|
+
thinkingEnabled?: boolean;
|
|
516
|
+
reasoningEffort?: ModelReasoningEffort;
|
|
517
|
+
contextWindow?: number;
|
|
518
|
+
runtimeTuning?: import('./runtime-tuning.js').RuntimeTuning;
|
|
519
|
+
mode: LocalTaskMessageMode;
|
|
520
|
+
permissionMode: LocalTaskPermissionMode;
|
|
521
|
+
attachments: LocalTaskAttachment[];
|
|
522
|
+
references: LocalTaskFileReference[];
|
|
523
|
+
richContent?: LocalTaskRichContent;
|
|
524
|
+
skills: LocalTaskSkillReference[];
|
|
525
|
+
plugins: LocalTaskPluginReference[];
|
|
526
|
+
sceneContext?: LocalTaskSceneContext;
|
|
527
|
+
createdAt: string;
|
|
528
|
+
updatedAt: string;
|
|
529
|
+
}
|
|
530
|
+
export interface DeleteLocalTaskPendingMessageRequest {
|
|
531
|
+
taskId: string;
|
|
532
|
+
pendingMessageId: string;
|
|
533
|
+
}
|
|
534
|
+
export interface UpdateLocalTaskPendingMessageRequest extends DeleteLocalTaskPendingMessageRequest {
|
|
535
|
+
content: string;
|
|
536
|
+
}
|
|
537
|
+
export interface ReorderLocalTaskPendingMessagesRequest {
|
|
538
|
+
taskId: string;
|
|
539
|
+
pendingMessageIds: string[];
|
|
540
|
+
}
|
|
541
|
+
export interface ListLocalTaskWorkspaceFilesRequest {
|
|
542
|
+
taskId?: string;
|
|
543
|
+
worktreeId?: string;
|
|
544
|
+
workspacePath?: string;
|
|
545
|
+
query?: string;
|
|
546
|
+
limit?: number;
|
|
547
|
+
/** Also stat task-referenced files, even outside the limited directory scan. Requires taskId. */
|
|
548
|
+
includeTaskReferences?: boolean;
|
|
549
|
+
}
|
|
550
|
+
export interface LocalTaskApprovalRequest {
|
|
551
|
+
taskId: string;
|
|
552
|
+
toolCallId: string;
|
|
553
|
+
decision: 'approve' | 'approve_for_session' | 'deny';
|
|
554
|
+
}
|
|
555
|
+
export interface LocalTaskUserInputRequest {
|
|
556
|
+
taskId: string;
|
|
557
|
+
requestId: string;
|
|
558
|
+
response: Record<string, unknown>;
|
|
559
|
+
}
|
|
560
|
+
export interface LocalTaskFileRequest {
|
|
561
|
+
taskId: string;
|
|
562
|
+
target: LocalTaskFileTarget;
|
|
563
|
+
}
|
|
564
|
+
export interface LocalTaskExecutionEvent {
|
|
565
|
+
taskId: string;
|
|
566
|
+
event: LocalTaskEvent;
|
|
567
|
+
}
|
|
568
|
+
export interface LocalTaskDiagnostics {
|
|
569
|
+
taskId: string;
|
|
570
|
+
taskStatus: LocalTaskStatus;
|
|
571
|
+
runtimeState: Record<string, unknown>;
|
|
572
|
+
persisted: {
|
|
573
|
+
threadMappingPresent: boolean;
|
|
574
|
+
runStatePresent: boolean;
|
|
575
|
+
interactionCount: number;
|
|
576
|
+
eventCount: number;
|
|
577
|
+
messageCount: number;
|
|
578
|
+
};
|
|
579
|
+
sidecar?: Record<string, unknown>;
|
|
580
|
+
sidecarError?: string;
|
|
581
|
+
}
|
|
582
|
+
export interface LocalTaskExecutionState {
|
|
583
|
+
taskId: string;
|
|
584
|
+
taskStatus: LocalTaskStatus;
|
|
585
|
+
runtimeReady: boolean;
|
|
586
|
+
running: boolean;
|
|
587
|
+
activeRunId: string | null;
|
|
588
|
+
runStatus: string | null;
|
|
589
|
+
pendingInteractionCount: number;
|
|
590
|
+
/** Present when the running engine exposes owned execution activity. */
|
|
591
|
+
activity?: {
|
|
592
|
+
backgroundProcesses: number;
|
|
593
|
+
foregroundProcesses: number;
|
|
594
|
+
nativeCommands: number;
|
|
595
|
+
nativeChildThreads: number;
|
|
596
|
+
toolCalls: number;
|
|
597
|
+
memberTurns: number;
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
export interface LocalTaskExecutionApi extends LocalTaskExecutionCommands {
|
|
601
|
+
subscribeSnapshot: (taskId: string) => Promise<{
|
|
602
|
+
subscriptionId: string;
|
|
603
|
+
snapshot: import('./local-task-projection.js').LocalTaskSnapshot;
|
|
604
|
+
}>;
|
|
605
|
+
acknowledgeSnapshot: (subscriptionId: string, cursor: import('./local-task-projection.js').LocalTaskStateCursor) => Promise<void>;
|
|
606
|
+
onStateBatch: (listener: (batch: import('./local-task-projection.js').LocalTaskStateBatch) => void) => () => void;
|
|
607
|
+
executeCommand: (command: import('./local-task-command.js').LocalTaskCommand) => Promise<import('./local-task-command.js').LocalTaskCommandReply>;
|
|
608
|
+
getCommand: (taskId: string, commandId: string) => Promise<import('./local-task-command.js').LocalTaskCommandReply | null>;
|
|
609
|
+
getCommandTargets: (taskId: string) => Promise<import('./local-task-command.js').LocalTaskCommandTargets>;
|
|
610
|
+
listMessages: (request: ListLocalTaskMessagesRequest) => Promise<LocalTaskMessagePage>;
|
|
611
|
+
listPendingMessages: (taskId: string) => Promise<LocalTaskPendingMessage[]>;
|
|
612
|
+
listEvents: (taskId: string, query?: ListLocalTaskEventsQuery) => Promise<LocalTaskEvent[]>;
|
|
613
|
+
listEventPage: (taskId: string, query?: ListLocalTaskEventsQuery, cursor?: string) => Promise<LocalTaskEventPage>;
|
|
614
|
+
listInteractions: (taskId: string) => Promise<LocalTaskInteraction[]>;
|
|
615
|
+
getExecutionState: (taskId: string) => Promise<LocalTaskExecutionState>;
|
|
616
|
+
getDiagnostics: (taskId: string) => Promise<LocalTaskDiagnostics>;
|
|
617
|
+
subscribe: (taskId: string) => Promise<string>;
|
|
618
|
+
unsubscribe: (subscriptionId: string) => Promise<void>;
|
|
619
|
+
onEvent: (listener: (event: LocalTaskExecutionEvent) => void) => () => void;
|
|
620
|
+
}
|
|
621
|
+
export interface LocalTaskApi {
|
|
622
|
+
list: (query?: ListLocalTasksQuery) => Promise<LocalTask[]>;
|
|
623
|
+
onDeleted: (listener: (taskId: string) => void) => () => void;
|
|
624
|
+
listWorkspaces: () => Promise<LocalTaskWorkspace[]>;
|
|
625
|
+
chooseWorkspace: () => Promise<LocalTaskWorkspace | null>;
|
|
626
|
+
onWorkspacesChanged: (listener: () => void) => () => void;
|
|
627
|
+
openRegisteredWorkspace: (localWorkspaceId: string) => Promise<void>;
|
|
628
|
+
forgetWorkspace: (localWorkspaceId: string) => Promise<void>;
|
|
629
|
+
createWorkspace: (request: CreateLocalTaskWorkspaceRequest) => Promise<LocalTaskWorkspace>;
|
|
630
|
+
create: (request: CreateLocalTaskRequest) => Promise<LocalTask>;
|
|
631
|
+
createDocument: (request: CreateDocumentTaskRequest) => Promise<DocumentTaskSubmissionResult>;
|
|
632
|
+
resumeDocument: (taskId: string) => Promise<DocumentTaskSubmissionResult | null>;
|
|
633
|
+
rename: (request: RenameLocalTaskRequest) => Promise<LocalTask>;
|
|
634
|
+
setArchived: (request: SetLocalTaskArchivedRequest) => Promise<LocalTask>;
|
|
635
|
+
setPinned: (request: SetLocalTaskPinnedRequest) => Promise<LocalTask>;
|
|
636
|
+
setPermissionMode: (request: SetLocalTaskPermissionModeRequest) => Promise<LocalTask>;
|
|
637
|
+
setModelSelection: (request: SetLocalTaskModelSelectionRequest) => Promise<LocalTask>;
|
|
638
|
+
delete: (request: DeleteLocalTaskRequest) => Promise<void>;
|
|
639
|
+
removeWorkspace: (request: RemoveLocalTaskWorkspaceRequest) => Promise<RemoveLocalTaskWorkspaceResult>;
|
|
640
|
+
openWorkspace: (taskId: string) => Promise<LocalTask>;
|
|
641
|
+
exportDiagnostics: (taskId: string) => Promise<{
|
|
642
|
+
canceled: boolean;
|
|
643
|
+
path?: string;
|
|
644
|
+
}>;
|
|
645
|
+
listWorkspaceFiles: (request: ListLocalTaskWorkspaceFilesRequest) => Promise<LocalTaskWorkspaceFile[]>;
|
|
646
|
+
listArtifacts: (request?: ListLocalTaskArtifactsRequest) => Promise<LocalTaskArtifact[]>;
|
|
647
|
+
setArtifactFavorite: (request: SetLocalTaskArtifactFavoriteRequest) => Promise<LocalTaskArtifact>;
|
|
648
|
+
uploadProjectAsset: (request: UploadLocalTaskProjectAssetRequest) => Promise<CloudFileEntry>;
|
|
649
|
+
readFile: (request: LocalTaskFileRequest) => Promise<LocalTaskFileContent>;
|
|
650
|
+
writeFile: (request: WriteLocalTaskFileRequest) => Promise<WriteLocalTaskFileResult>;
|
|
651
|
+
getPreviewUrl: (request: LocalTaskFileRequest) => Promise<string>;
|
|
652
|
+
openFile: (request: LocalTaskFileRequest) => Promise<void>;
|
|
653
|
+
openContainingFolder: (request: LocalTaskFileRequest) => Promise<void>;
|
|
654
|
+
saveFileAs: (request: LocalTaskFileRequest) => Promise<{
|
|
655
|
+
canceled: boolean;
|
|
656
|
+
path?: string;
|
|
657
|
+
}>;
|
|
658
|
+
}
|