@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,227 @@
|
|
|
1
|
+
/** A checkout is an authorized directory, not a task's execution directory. */
|
|
2
|
+
export interface GitCheckout {
|
|
3
|
+
id: string;
|
|
4
|
+
repositoryId: string;
|
|
5
|
+
root: string;
|
|
6
|
+
scopePath: string;
|
|
7
|
+
commonGitDir: string;
|
|
8
|
+
name: string;
|
|
9
|
+
worktreeId?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface GitTarget {
|
|
12
|
+
taskId: string;
|
|
13
|
+
checkoutId: string;
|
|
14
|
+
}
|
|
15
|
+
export interface GitFileStatus {
|
|
16
|
+
path: string;
|
|
17
|
+
originalPath?: string;
|
|
18
|
+
index: string;
|
|
19
|
+
workingTree: string;
|
|
20
|
+
untracked: boolean;
|
|
21
|
+
conflicted: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface GitStatus {
|
|
24
|
+
checkout: GitCheckout;
|
|
25
|
+
revision: string;
|
|
26
|
+
head: string | null;
|
|
27
|
+
branch: string | null;
|
|
28
|
+
upstream?: string;
|
|
29
|
+
ahead: number;
|
|
30
|
+
behind: number;
|
|
31
|
+
files: GitFileStatus[];
|
|
32
|
+
branches: string[];
|
|
33
|
+
refs: string[];
|
|
34
|
+
remotes: string[];
|
|
35
|
+
turnDiffRevision?: string;
|
|
36
|
+
}
|
|
37
|
+
export type GitDiffScope = 'last-turn' | 'uncommitted' | 'unstaged' | 'staged' | 'branch' | 'commit';
|
|
38
|
+
export interface GitTurnDiffSnapshot {
|
|
39
|
+
runId: string;
|
|
40
|
+
revision: string;
|
|
41
|
+
workspacePath: string;
|
|
42
|
+
patch?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface GitCommit {
|
|
45
|
+
id: string;
|
|
46
|
+
subject: string;
|
|
47
|
+
author: string;
|
|
48
|
+
committedAt: string;
|
|
49
|
+
}
|
|
50
|
+
export interface GitCommitsRequest extends GitTarget {
|
|
51
|
+
head?: string;
|
|
52
|
+
offset?: number;
|
|
53
|
+
}
|
|
54
|
+
export interface GitCommits {
|
|
55
|
+
checkoutId: string;
|
|
56
|
+
head: string | null;
|
|
57
|
+
items: GitCommit[];
|
|
58
|
+
nextOffset?: number;
|
|
59
|
+
}
|
|
60
|
+
export interface GitDiffRequest extends GitTarget {
|
|
61
|
+
path: string;
|
|
62
|
+
scope: GitDiffScope;
|
|
63
|
+
ref?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface GitChangesRequest extends GitTarget {
|
|
66
|
+
scope: GitDiffScope;
|
|
67
|
+
ref?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface GitChangedFile {
|
|
70
|
+
path: string;
|
|
71
|
+
additions: number | null;
|
|
72
|
+
deletions: number | null;
|
|
73
|
+
}
|
|
74
|
+
export interface GitChanges {
|
|
75
|
+
checkoutId: string;
|
|
76
|
+
revision: string;
|
|
77
|
+
files: GitChangedFile[];
|
|
78
|
+
}
|
|
79
|
+
export interface GitHunk {
|
|
80
|
+
id: string;
|
|
81
|
+
header: string;
|
|
82
|
+
patch: string;
|
|
83
|
+
}
|
|
84
|
+
export interface GitDiff {
|
|
85
|
+
checkoutId: string;
|
|
86
|
+
revision: string;
|
|
87
|
+
path: string;
|
|
88
|
+
scope: GitDiffScope;
|
|
89
|
+
binary: boolean;
|
|
90
|
+
patch: string;
|
|
91
|
+
hunks: GitHunk[];
|
|
92
|
+
}
|
|
93
|
+
export type GitMutation = {
|
|
94
|
+
action: 'stage' | 'unstage';
|
|
95
|
+
paths: string[];
|
|
96
|
+
} | {
|
|
97
|
+
action: 'revert';
|
|
98
|
+
paths: string[];
|
|
99
|
+
confirmed: true;
|
|
100
|
+
} | {
|
|
101
|
+
action: 'stage-hunk' | 'unstage-hunk';
|
|
102
|
+
path: string;
|
|
103
|
+
hunkId: string;
|
|
104
|
+
} | {
|
|
105
|
+
action: 'revert-hunk';
|
|
106
|
+
path: string;
|
|
107
|
+
hunkId: string;
|
|
108
|
+
confirmed: true;
|
|
109
|
+
} | {
|
|
110
|
+
action: 'commit';
|
|
111
|
+
message: string;
|
|
112
|
+
} | {
|
|
113
|
+
action: 'create-branch';
|
|
114
|
+
name: string;
|
|
115
|
+
} | {
|
|
116
|
+
action: 'switch-branch';
|
|
117
|
+
name: string;
|
|
118
|
+
} | {
|
|
119
|
+
action: 'fetch';
|
|
120
|
+
remote: string;
|
|
121
|
+
credentialId?: string;
|
|
122
|
+
} | {
|
|
123
|
+
action: 'push';
|
|
124
|
+
remote: string;
|
|
125
|
+
branch: string;
|
|
126
|
+
remoteBranch: string;
|
|
127
|
+
credentialId?: string;
|
|
128
|
+
lease?: {
|
|
129
|
+
expectedRemoteHead: string;
|
|
130
|
+
confirmed: true;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
export type GitMutationRequest = GitTarget & {
|
|
134
|
+
expectedRevision: string;
|
|
135
|
+
} & GitMutation;
|
|
136
|
+
export interface RepositoryCommand {
|
|
137
|
+
command: string[];
|
|
138
|
+
cwd: string;
|
|
139
|
+
networkDomains?: string[];
|
|
140
|
+
environment?: Record<string, string>;
|
|
141
|
+
}
|
|
142
|
+
export interface GitMutationPlan {
|
|
143
|
+
checkout: GitCheckout;
|
|
144
|
+
revision: string;
|
|
145
|
+
action: GitMutation['action'];
|
|
146
|
+
commands: RepositoryCommand[];
|
|
147
|
+
filePaths: string[];
|
|
148
|
+
deleting: boolean;
|
|
149
|
+
}
|
|
150
|
+
export interface GitMutationResult {
|
|
151
|
+
checkoutId: string;
|
|
152
|
+
action: GitMutation['action'];
|
|
153
|
+
output: string;
|
|
154
|
+
completedSteps: string[];
|
|
155
|
+
}
|
|
156
|
+
export interface GitFailure {
|
|
157
|
+
code: string;
|
|
158
|
+
message: string;
|
|
159
|
+
completedSteps?: string[];
|
|
160
|
+
details?: string;
|
|
161
|
+
}
|
|
162
|
+
export type GitResult<T> = {
|
|
163
|
+
ok: true;
|
|
164
|
+
value: T;
|
|
165
|
+
} | {
|
|
166
|
+
ok: false;
|
|
167
|
+
error: GitFailure;
|
|
168
|
+
};
|
|
169
|
+
export interface GitSettings {
|
|
170
|
+
branchPrefix: string;
|
|
171
|
+
commitInstructions: string;
|
|
172
|
+
pullRequestInstructions?: string;
|
|
173
|
+
monitorRepairInstructions?: string;
|
|
174
|
+
mergeMethod?: 'merge' | 'squash';
|
|
175
|
+
draftPullRequests?: boolean;
|
|
176
|
+
reviewPresentation?: 'inline' | 'separate';
|
|
177
|
+
automaticMerge?: boolean;
|
|
178
|
+
forcePush?: boolean;
|
|
179
|
+
}
|
|
180
|
+
export declare const DEFAULT_GIT_SETTINGS: GitSettings;
|
|
181
|
+
export interface GitApi {
|
|
182
|
+
credentials(taskId?: string): Promise<GitResult<import('./git-http-api.js').GitHttpCredential[]>>;
|
|
183
|
+
saveCredential(request: import('./git-http-api.js').SaveGitHttpCredential & {
|
|
184
|
+
taskId?: string;
|
|
185
|
+
}): Promise<GitResult<import('./git-http-api.js').GitHttpCredential>>;
|
|
186
|
+
removeCredential(request: {
|
|
187
|
+
id: string;
|
|
188
|
+
taskId?: string;
|
|
189
|
+
}): Promise<GitResult<void>>;
|
|
190
|
+
listCheckouts(taskId: string): Promise<GitResult<GitCheckout[]>>;
|
|
191
|
+
status(target: GitTarget): Promise<GitResult<GitStatus>>;
|
|
192
|
+
diff(request: GitDiffRequest): Promise<GitResult<GitDiff>>;
|
|
193
|
+
changes(request: GitChangesRequest): Promise<GitResult<GitChanges>>;
|
|
194
|
+
commits(request: GitCommitsRequest): Promise<GitResult<GitCommits>>;
|
|
195
|
+
mutate(request: GitMutationRequest): Promise<GitResult<GitMutationResult>>;
|
|
196
|
+
assist(request: GitAssistantRequest): Promise<GitResult<GitAssistantResult>>;
|
|
197
|
+
}
|
|
198
|
+
export interface GitAssistantRequest extends GitChangesRequest {
|
|
199
|
+
kind: 'commit-message' | 'review' | 'pull-request';
|
|
200
|
+
expectedRevision: string;
|
|
201
|
+
presentation?: 'inline' | 'separate';
|
|
202
|
+
}
|
|
203
|
+
export type GitAssistantResult = {
|
|
204
|
+
kind: 'commit-message';
|
|
205
|
+
checkoutId: string;
|
|
206
|
+
revision: string;
|
|
207
|
+
message: string;
|
|
208
|
+
} | {
|
|
209
|
+
kind: 'pull-request';
|
|
210
|
+
checkoutId: string;
|
|
211
|
+
revision: string;
|
|
212
|
+
title: string;
|
|
213
|
+
body: string;
|
|
214
|
+
} | {
|
|
215
|
+
kind: 'review';
|
|
216
|
+
checkoutId: string;
|
|
217
|
+
revision: string;
|
|
218
|
+
summary: string;
|
|
219
|
+
findings: Array<{
|
|
220
|
+
path: string;
|
|
221
|
+
line: number;
|
|
222
|
+
severity: 'high' | 'medium' | 'low';
|
|
223
|
+
title: string;
|
|
224
|
+
detail: string;
|
|
225
|
+
}>;
|
|
226
|
+
reviewTaskId?: string;
|
|
227
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface GitHttpCredential {
|
|
2
|
+
id: string;
|
|
3
|
+
url: string;
|
|
4
|
+
username: string;
|
|
5
|
+
mode: 'password' | 'token';
|
|
6
|
+
}
|
|
7
|
+
export interface SaveGitHttpCredential {
|
|
8
|
+
url: string;
|
|
9
|
+
username: string;
|
|
10
|
+
mode: GitHttpCredential['mode'];
|
|
11
|
+
secret: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { GitTarget, GitResult, GitFailure, RepositoryCommand } from './git-api.js';
|
|
2
|
+
export type HostedGitProvider = 'github' | 'gitlab';
|
|
3
|
+
export interface HostedGitConnection {
|
|
4
|
+
id: string;
|
|
5
|
+
provider: HostedGitProvider;
|
|
6
|
+
webOrigin: string;
|
|
7
|
+
apiBase: string;
|
|
8
|
+
account: string;
|
|
9
|
+
accountId?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SaveHostedGitConnectionRequest {
|
|
12
|
+
provider: HostedGitProvider;
|
|
13
|
+
webOrigin: string;
|
|
14
|
+
apiBase: string;
|
|
15
|
+
token: string;
|
|
16
|
+
}
|
|
17
|
+
export interface HostedGitTarget extends GitTarget {
|
|
18
|
+
connectionId: string;
|
|
19
|
+
remote: string;
|
|
20
|
+
}
|
|
21
|
+
export interface HostedGitRepository {
|
|
22
|
+
connectionId: string;
|
|
23
|
+
provider: HostedGitProvider;
|
|
24
|
+
webOrigin: string;
|
|
25
|
+
apiBase: string;
|
|
26
|
+
path: string;
|
|
27
|
+
}
|
|
28
|
+
export interface HostedPullRequest {
|
|
29
|
+
number: number;
|
|
30
|
+
url: string;
|
|
31
|
+
title: string;
|
|
32
|
+
body: string;
|
|
33
|
+
source: string;
|
|
34
|
+
target: string;
|
|
35
|
+
head: string;
|
|
36
|
+
state: 'open' | 'closed' | 'merged';
|
|
37
|
+
draft: boolean;
|
|
38
|
+
mergeable: boolean | null;
|
|
39
|
+
mergeState: string;
|
|
40
|
+
sameRepository: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface CreateHostedPullRequest extends HostedGitTarget {
|
|
43
|
+
requestId: string;
|
|
44
|
+
expectedRevision: string;
|
|
45
|
+
source: string;
|
|
46
|
+
target: string;
|
|
47
|
+
title: string;
|
|
48
|
+
body: string;
|
|
49
|
+
draft: boolean;
|
|
50
|
+
commitAndPush?: {
|
|
51
|
+
message?: string;
|
|
52
|
+
credentialId?: string;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export interface HostedGitOperation {
|
|
56
|
+
version: 1;
|
|
57
|
+
id: string;
|
|
58
|
+
ownerUserId: string;
|
|
59
|
+
request: CreateHostedPullRequest;
|
|
60
|
+
repository: HostedGitRepository;
|
|
61
|
+
initialHead: string;
|
|
62
|
+
initialStaged: string[];
|
|
63
|
+
commands: RepositoryCommand[];
|
|
64
|
+
filePaths: string[];
|
|
65
|
+
phase: 'awaiting-authorization' | 'committing' | 'pushing' | 'creating' | 'unknown' | 'completed' | 'failed';
|
|
66
|
+
completedSteps: string[];
|
|
67
|
+
createdAt: string;
|
|
68
|
+
updatedAt: string;
|
|
69
|
+
result?: HostedPullRequest;
|
|
70
|
+
error?: GitFailure;
|
|
71
|
+
submittedHead?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface HostedGitMonitor {
|
|
74
|
+
executionScope?: string;
|
|
75
|
+
version: 1;
|
|
76
|
+
id: string;
|
|
77
|
+
authorizationId: string;
|
|
78
|
+
ownerUserId: string;
|
|
79
|
+
taskId: string;
|
|
80
|
+
target: HostedGitTarget;
|
|
81
|
+
repository: HostedGitRepository;
|
|
82
|
+
number: number;
|
|
83
|
+
enabled: boolean;
|
|
84
|
+
repair: boolean;
|
|
85
|
+
repairInstructions: string;
|
|
86
|
+
autoMerge: boolean;
|
|
87
|
+
mergeMethod: 'merge' | 'squash';
|
|
88
|
+
authorizedHead: string;
|
|
89
|
+
phase: 'watching' | 'repairing' | 'merge-unknown' | 'merged' | 'closed' | 'blocked';
|
|
90
|
+
fingerprint?: string;
|
|
91
|
+
last?: HostedPullRequest;
|
|
92
|
+
error?: GitFailure;
|
|
93
|
+
repairCommandId?: string;
|
|
94
|
+
repairingFingerprint?: string;
|
|
95
|
+
updatedAt: string;
|
|
96
|
+
}
|
|
97
|
+
export interface ConfigureHostedGitMonitorRequest extends HostedGitTarget {
|
|
98
|
+
number: number;
|
|
99
|
+
enabled: boolean;
|
|
100
|
+
repair: boolean;
|
|
101
|
+
repairInstructions: string;
|
|
102
|
+
autoMerge: boolean;
|
|
103
|
+
mergeMethod: 'merge' | 'squash';
|
|
104
|
+
expectedHead: string;
|
|
105
|
+
confirmed: true;
|
|
106
|
+
}
|
|
107
|
+
export interface HostedGitApi {
|
|
108
|
+
connections(taskId?: string): Promise<GitResult<HostedGitConnection[]>>;
|
|
109
|
+
saveConnection(request: SaveHostedGitConnectionRequest & {
|
|
110
|
+
taskId?: string;
|
|
111
|
+
}): Promise<GitResult<HostedGitConnection>>;
|
|
112
|
+
removeConnection(request: {
|
|
113
|
+
id: string;
|
|
114
|
+
taskId?: string;
|
|
115
|
+
}): Promise<GitResult<void>>;
|
|
116
|
+
list(request: HostedGitTarget): Promise<GitResult<HostedPullRequest[]>>;
|
|
117
|
+
prepare(request: CreateHostedPullRequest): Promise<GitResult<HostedGitOperation>>;
|
|
118
|
+
execute(request: {
|
|
119
|
+
taskId: string;
|
|
120
|
+
operationId: string;
|
|
121
|
+
}): Promise<GitResult<HostedGitOperation>>;
|
|
122
|
+
status(request: {
|
|
123
|
+
taskId: string;
|
|
124
|
+
operationId: string;
|
|
125
|
+
}): Promise<GitResult<HostedGitOperation>>;
|
|
126
|
+
configureMonitor(request: ConfigureHostedGitMonitorRequest): Promise<GitResult<HostedGitMonitor>>;
|
|
127
|
+
monitors(taskId: string): Promise<GitResult<HostedGitMonitor[]>>;
|
|
128
|
+
pollMonitor(request: {
|
|
129
|
+
taskId: string;
|
|
130
|
+
monitorId: string;
|
|
131
|
+
}): Promise<GitResult<HostedGitMonitor>>;
|
|
132
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface JsHookDefinition {
|
|
2
|
+
event: 'PreToolUse' | 'PostToolUse';
|
|
3
|
+
callback: string;
|
|
4
|
+
matcher?: string;
|
|
5
|
+
timeoutMs: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ToolLifecycleEvent {
|
|
8
|
+
sessionId: string;
|
|
9
|
+
event: 'beforeTool' | 'afterTool';
|
|
10
|
+
toolName: string;
|
|
11
|
+
toolCallId: string;
|
|
12
|
+
input: unknown;
|
|
13
|
+
result?: unknown;
|
|
14
|
+
/** Original event preserves engine thread and turn identifiers separately from the SDK session. */
|
|
15
|
+
raw: Readonly<Record<string, unknown>>;
|
|
16
|
+
}
|
|
17
|
+
export interface ToolHookDecision {
|
|
18
|
+
decision?: 'continue' | 'deny';
|
|
19
|
+
reason?: string;
|
|
20
|
+
additionalContext?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function parseJsHookDefinitions(value: unknown): JsHookDefinition[];
|
|
23
|
+
export declare function hookOutput(event: JsHookDefinition['event'], value: unknown): Record<string, unknown>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ModelReasoningEffort } from './model-selection.js';
|
|
2
|
+
export declare const LOCAL_CUSTOM_MODEL_ID_PREFIX = "custom-model:";
|
|
3
|
+
export interface LocalCustomModel {
|
|
4
|
+
upstreamProtocol?: 'responses' | 'chat_completions';
|
|
5
|
+
id: string;
|
|
6
|
+
selectionId: string;
|
|
7
|
+
endpoint: string;
|
|
8
|
+
model: string;
|
|
9
|
+
apiKeyConfigured: boolean;
|
|
10
|
+
functionCalling: boolean;
|
|
11
|
+
imageInput: boolean;
|
|
12
|
+
videoInput: boolean;
|
|
13
|
+
reasoning: boolean;
|
|
14
|
+
thinkingOnly: boolean;
|
|
15
|
+
allowDisableThinking: boolean;
|
|
16
|
+
customProtocol: boolean;
|
|
17
|
+
defaultReasoningEffort?: ModelReasoningEffort;
|
|
18
|
+
supportedReasoningEfforts: ModelReasoningEffort[];
|
|
19
|
+
maxInputTokens?: number;
|
|
20
|
+
maxOutputTokens?: number;
|
|
21
|
+
createdAt: string;
|
|
22
|
+
updatedAt: string;
|
|
23
|
+
}
|
|
24
|
+
export interface SaveLocalCustomModelRequest {
|
|
25
|
+
id?: string;
|
|
26
|
+
endpoint: string;
|
|
27
|
+
apiKey?: string;
|
|
28
|
+
clearApiKey?: boolean;
|
|
29
|
+
model: string;
|
|
30
|
+
functionCalling: boolean;
|
|
31
|
+
imageInput: boolean;
|
|
32
|
+
videoInput: boolean;
|
|
33
|
+
reasoning: boolean;
|
|
34
|
+
thinkingOnly?: boolean;
|
|
35
|
+
allowDisableThinking?: boolean;
|
|
36
|
+
customProtocol: boolean;
|
|
37
|
+
defaultReasoningEffort?: ModelReasoningEffort;
|
|
38
|
+
supportedReasoningEfforts?: ModelReasoningEffort[];
|
|
39
|
+
maxInputTokens?: number;
|
|
40
|
+
maxOutputTokens?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface LocalCustomModelStorageInfo {
|
|
43
|
+
filePath: string;
|
|
44
|
+
displayPath: string;
|
|
45
|
+
}
|
|
46
|
+
export interface LocalCustomModelApi {
|
|
47
|
+
getStorageInfo: () => Promise<LocalCustomModelStorageInfo>;
|
|
48
|
+
list: () => Promise<LocalCustomModel[]>;
|
|
49
|
+
save: (request: SaveLocalCustomModelRequest) => Promise<LocalCustomModel>;
|
|
50
|
+
remove: (modelId: string) => Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
export interface LocalCustomRuntimeModel extends Omit<LocalCustomModel, 'apiKeyConfigured'> {
|
|
53
|
+
generationCapabilities?: import('./runtime-tuning.js').GenerationCapabilities;
|
|
54
|
+
apiKey: string;
|
|
55
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { GitResult, RepositoryCommand } from './git-api.js';
|
|
2
|
+
import type { WorktreeScript } from './worktree-api.js';
|
|
3
|
+
import type { LocalWorkspace } from './local-workspace.js';
|
|
4
|
+
export type { LocalWorkspace } from './local-workspace.js';
|
|
5
|
+
export type EnvironmentPlatform = 'darwin' | 'linux' | 'win32';
|
|
6
|
+
export type EnvironmentActionIcon = 'tool' | 'run' | 'debug' | 'test';
|
|
7
|
+
export interface LocalEnvironmentAction {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
icon: EnvironmentActionIcon;
|
|
11
|
+
command: string;
|
|
12
|
+
platform?: EnvironmentPlatform;
|
|
13
|
+
}
|
|
14
|
+
export interface LocalEnvironmentConfig {
|
|
15
|
+
version: 1;
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
setup: WorktreeScript;
|
|
19
|
+
cleanup: WorktreeScript;
|
|
20
|
+
actions: LocalEnvironmentAction[];
|
|
21
|
+
}
|
|
22
|
+
export interface LocalEnvironmentFile extends LocalEnvironmentConfig {
|
|
23
|
+
localWorkspaceId: string;
|
|
24
|
+
fileName: string;
|
|
25
|
+
revision: string;
|
|
26
|
+
}
|
|
27
|
+
export interface LocalWorkspaceEntry extends LocalWorkspace {
|
|
28
|
+
environments: LocalEnvironmentFile[];
|
|
29
|
+
errors: string[];
|
|
30
|
+
}
|
|
31
|
+
export interface EnvironmentMigrationIssue {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
message: string;
|
|
35
|
+
}
|
|
36
|
+
export interface LocalEnvironmentCatalog {
|
|
37
|
+
workspaces: LocalWorkspaceEntry[];
|
|
38
|
+
migrationIssues: EnvironmentMigrationIssue[];
|
|
39
|
+
platform: EnvironmentPlatform;
|
|
40
|
+
}
|
|
41
|
+
export interface SaveLocalEnvironmentRequest {
|
|
42
|
+
localWorkspaceId: string;
|
|
43
|
+
config: LocalEnvironmentConfig;
|
|
44
|
+
fileName?: string;
|
|
45
|
+
expectedRevision?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface EnvironmentTarget {
|
|
48
|
+
taskId: string;
|
|
49
|
+
worktreeId?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface EnvironmentContext {
|
|
52
|
+
rootPath: string;
|
|
53
|
+
workspace?: LocalWorkspaceEntry;
|
|
54
|
+
platform: EnvironmentPlatform;
|
|
55
|
+
sourcePath: string;
|
|
56
|
+
}
|
|
57
|
+
export interface EnvironmentRun {
|
|
58
|
+
id: string;
|
|
59
|
+
ownerUserId: string;
|
|
60
|
+
target: EnvironmentTarget;
|
|
61
|
+
localWorkspaceId: string;
|
|
62
|
+
environmentId: string;
|
|
63
|
+
actionId: string;
|
|
64
|
+
name: string;
|
|
65
|
+
requestId: string;
|
|
66
|
+
revision: string;
|
|
67
|
+
command: RepositoryCommand;
|
|
68
|
+
phase: 'awaiting-authorization' | 'running' | 'completed' | 'failed' | 'cancelled' | 'interrupted';
|
|
69
|
+
startedAt: string;
|
|
70
|
+
finishedAt?: string;
|
|
71
|
+
output: string;
|
|
72
|
+
error?: string;
|
|
73
|
+
pid?: number;
|
|
74
|
+
errorCode?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface LocalEnvironmentApi {
|
|
77
|
+
list(): Promise<GitResult<LocalEnvironmentCatalog>>;
|
|
78
|
+
migrate(request: {
|
|
79
|
+
environmentId: string;
|
|
80
|
+
}): Promise<GitResult<void>>;
|
|
81
|
+
addWorkspace(): Promise<GitResult<LocalWorkspaceEntry | null>>;
|
|
82
|
+
removeWorkspace(request: {
|
|
83
|
+
localWorkspaceId: string;
|
|
84
|
+
}): Promise<GitResult<void>>;
|
|
85
|
+
save(request: SaveLocalEnvironmentRequest): Promise<GitResult<LocalEnvironmentFile>>;
|
|
86
|
+
remove(request: {
|
|
87
|
+
localWorkspaceId: string;
|
|
88
|
+
fileName: string;
|
|
89
|
+
expectedRevision: string;
|
|
90
|
+
}): Promise<GitResult<void>>;
|
|
91
|
+
select(request: {
|
|
92
|
+
localWorkspaceId: string;
|
|
93
|
+
environmentId?: string;
|
|
94
|
+
}): Promise<GitResult<void>>;
|
|
95
|
+
context(request: EnvironmentTarget): Promise<GitResult<EnvironmentContext>>;
|
|
96
|
+
prepareAction(request: EnvironmentTarget & {
|
|
97
|
+
environmentId: string;
|
|
98
|
+
actionId: string;
|
|
99
|
+
requestId: string;
|
|
100
|
+
}): Promise<GitResult<EnvironmentRun>>;
|
|
101
|
+
executeAction(request: {
|
|
102
|
+
taskId: string;
|
|
103
|
+
operationId: string;
|
|
104
|
+
}): Promise<GitResult<EnvironmentRun>>;
|
|
105
|
+
runs(request: EnvironmentTarget): Promise<GitResult<EnvironmentRun[]>>;
|
|
106
|
+
stopAction(request: {
|
|
107
|
+
taskId: string;
|
|
108
|
+
operationId: string;
|
|
109
|
+
}): Promise<GitResult<EnvironmentRun>>;
|
|
110
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export type LocalMcpServerTransport = 'HTTP' | 'STDIO';
|
|
2
|
+
export type LocalMcpServerSource = 'builtin' | 'custom' | 'managed';
|
|
3
|
+
export type LocalMcpAuthorizationStatus = 'not_required' | 'required' | 'granted';
|
|
4
|
+
export interface LocalMcpRegistrySource {
|
|
5
|
+
name: string;
|
|
6
|
+
version: string;
|
|
7
|
+
serviceId?: string;
|
|
8
|
+
packageSha256?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface LocalMcpServerTool {
|
|
11
|
+
name: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface LocalMcpServer {
|
|
17
|
+
id: string;
|
|
18
|
+
key: string;
|
|
19
|
+
name: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
source: LocalMcpServerSource;
|
|
22
|
+
authorizationStatus: LocalMcpAuthorizationStatus;
|
|
23
|
+
authorizedAt?: string;
|
|
24
|
+
transport: LocalMcpServerTransport;
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
url?: string;
|
|
27
|
+
bearerTokenConfigured: boolean;
|
|
28
|
+
command?: string;
|
|
29
|
+
args: string[];
|
|
30
|
+
env: Record<string, boolean>;
|
|
31
|
+
tools: LocalMcpServerTool[];
|
|
32
|
+
registry?: LocalMcpRegistrySource;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
updatedAt: string;
|
|
35
|
+
}
|
|
36
|
+
export interface SaveLocalMcpServerRequest {
|
|
37
|
+
id?: string;
|
|
38
|
+
key?: string;
|
|
39
|
+
name: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
transport: LocalMcpServerTransport;
|
|
42
|
+
enabled: boolean;
|
|
43
|
+
url?: string;
|
|
44
|
+
bearerToken?: string;
|
|
45
|
+
clearBearerToken?: boolean;
|
|
46
|
+
command?: string;
|
|
47
|
+
args?: string[];
|
|
48
|
+
env?: Record<string, string>;
|
|
49
|
+
preserveExistingEnv?: boolean;
|
|
50
|
+
registry?: LocalMcpRegistrySource;
|
|
51
|
+
}
|
|
52
|
+
export interface SetLocalMcpServerEnabledRequest {
|
|
53
|
+
serverId: string;
|
|
54
|
+
enabled: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface SetLocalMcpServerToolEnabledRequest {
|
|
57
|
+
serverId: string;
|
|
58
|
+
toolName: string;
|
|
59
|
+
enabled: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface LocalMcpRuntimeServer {
|
|
62
|
+
id: string;
|
|
63
|
+
key: string;
|
|
64
|
+
name: string;
|
|
65
|
+
description?: string;
|
|
66
|
+
source?: LocalMcpServerSource;
|
|
67
|
+
authorizationRequired?: boolean;
|
|
68
|
+
authorizationGranted?: boolean;
|
|
69
|
+
authorizationFingerprint?: string;
|
|
70
|
+
transport: LocalMcpServerTransport;
|
|
71
|
+
url?: string;
|
|
72
|
+
bearerToken?: string;
|
|
73
|
+
command?: string;
|
|
74
|
+
args: string[];
|
|
75
|
+
env: Record<string, string>;
|
|
76
|
+
tools?: string[];
|
|
77
|
+
toolTitles?: Record<string, string>;
|
|
78
|
+
disabledTools?: string[];
|
|
79
|
+
defaultToolsApproval?: 'auto' | 'prompt';
|
|
80
|
+
toolApprovals?: Record<string, 'auto' | 'prompt'>;
|
|
81
|
+
}
|
|
82
|
+
export interface LocalMcpServerApi {
|
|
83
|
+
list: () => Promise<LocalMcpServer[]>;
|
|
84
|
+
save: (request: SaveLocalMcpServerRequest) => Promise<LocalMcpServer>;
|
|
85
|
+
saveBatch: (requests: SaveLocalMcpServerRequest[]) => Promise<LocalMcpServer[]>;
|
|
86
|
+
setEnabled: (request: SetLocalMcpServerEnabledRequest) => Promise<LocalMcpServer>;
|
|
87
|
+
refreshTools: (serverId: string) => Promise<LocalMcpServer>;
|
|
88
|
+
setToolEnabled: (request: SetLocalMcpServerToolEnabledRequest) => Promise<LocalMcpServer>;
|
|
89
|
+
revokeAuthorization: (serverId: string) => Promise<LocalMcpServer>;
|
|
90
|
+
remove: (serverId: string) => Promise<void>;
|
|
91
|
+
}
|