@kmlckj/aios-agent-server-sdk 0.0.0-stage → 0.0.1
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 +628 -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 +59 -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 +257 -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 +35 -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 +492 -0
- package/dist/shared/account-context-api.d.ts +47 -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 +17 -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 +1020 -0
- package/dist/shared/cloud-task-event-api.d.ts +22 -0
- package/dist/shared/collaboration-api.d.ts +16 -0
- package/dist/shared/collaboration-automation-api.d.ts +55 -0
- package/dist/shared/collaboration-deep-link.d.ts +18 -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 +372 -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 +449 -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 +37 -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-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 +91 -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 +70 -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/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-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 +20 -4
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/** Editor state is distinct from the last saved disk revision. */
|
|
2
|
+
export interface DocumentEditorVersion {
|
|
3
|
+
documentId: string;
|
|
4
|
+
diskRevision: string;
|
|
5
|
+
editorRevision: number;
|
|
6
|
+
}
|
|
7
|
+
export type DocumentSelectionLocator = {
|
|
8
|
+
kind: 'text';
|
|
9
|
+
start: number;
|
|
10
|
+
end: number;
|
|
11
|
+
format?: 'markdown' | 'html';
|
|
12
|
+
element?: string;
|
|
13
|
+
htmlTextRanges?: Array<{
|
|
14
|
+
start: number;
|
|
15
|
+
end: number;
|
|
16
|
+
}>;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'word';
|
|
19
|
+
targetJson: string;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'word-table';
|
|
22
|
+
table: number;
|
|
23
|
+
nodeId: string;
|
|
24
|
+
row: [number, number];
|
|
25
|
+
column: [number, number];
|
|
26
|
+
} | {
|
|
27
|
+
kind: 'word-image';
|
|
28
|
+
part: string;
|
|
29
|
+
imageId: string;
|
|
30
|
+
} | {
|
|
31
|
+
kind: 'sheet-image';
|
|
32
|
+
sheetId: string;
|
|
33
|
+
sheetName: string;
|
|
34
|
+
imageId: string;
|
|
35
|
+
imageIndex: number;
|
|
36
|
+
} | {
|
|
37
|
+
kind: 'cells';
|
|
38
|
+
sheetId: string;
|
|
39
|
+
sheetName: string;
|
|
40
|
+
row: [number, number];
|
|
41
|
+
column: [number, number];
|
|
42
|
+
} | {
|
|
43
|
+
kind: 'slide-elements';
|
|
44
|
+
slideIndex: number;
|
|
45
|
+
elementIds: string[];
|
|
46
|
+
} | {
|
|
47
|
+
kind: 'image-region';
|
|
48
|
+
imageWidth: number;
|
|
49
|
+
imageHeight: number;
|
|
50
|
+
rect: DocumentRectangle;
|
|
51
|
+
};
|
|
52
|
+
export interface DocumentRectangle {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
}
|
|
58
|
+
export interface DocumentSelection extends DocumentEditorVersion {
|
|
59
|
+
fileName: string;
|
|
60
|
+
locator: DocumentSelectionLocator;
|
|
61
|
+
text: string;
|
|
62
|
+
}
|
|
63
|
+
/** A snapshot replacement is an explicit whole editor transaction, not a text conversion. */
|
|
64
|
+
export type DocumentEdit = {
|
|
65
|
+
kind: 'replace-snapshot';
|
|
66
|
+
data: Uint8Array;
|
|
67
|
+
} | {
|
|
68
|
+
kind: 'replace-text';
|
|
69
|
+
selection: DocumentSelection;
|
|
70
|
+
text: string;
|
|
71
|
+
} | {
|
|
72
|
+
kind: 'set-cells';
|
|
73
|
+
selection: DocumentSelection;
|
|
74
|
+
values: Array<Array<string | number | boolean | null>>;
|
|
75
|
+
} | {
|
|
76
|
+
kind: 'update-slide-text';
|
|
77
|
+
selection: DocumentSelection;
|
|
78
|
+
elementId: string;
|
|
79
|
+
text: string;
|
|
80
|
+
};
|
|
81
|
+
export interface DocumentEditorController {
|
|
82
|
+
getVersion(): DocumentEditorVersion;
|
|
83
|
+
getSelection(): DocumentSelection | null;
|
|
84
|
+
/** Present only for editors that expose reference navigation. */
|
|
85
|
+
readonly locateSelection?: (selection: DocumentSelection) => void;
|
|
86
|
+
exportSnapshot(): Promise<Uint8Array>;
|
|
87
|
+
applyEdit(edit: DocumentEdit, expectedEditorRevision: number): Promise<void>;
|
|
88
|
+
save(): Promise<void>;
|
|
89
|
+
undo(): Promise<void>;
|
|
90
|
+
redo(): Promise<void>;
|
|
91
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export type EnterpriseKnowledgeType = 'STANDARD' | 'GRAPH' | 'OBJECT_STORAGE';
|
|
2
|
+
export type EnterpriseKnowledgeNodeType = 'ROOT' | 'ORGANIZATION' | 'FOLDER' | 'KNOWLEDGE_BASE' | 'GRAPH' | 'OBJECT_STORAGE';
|
|
3
|
+
export interface EnterpriseKnowledgeCapabilities {
|
|
4
|
+
retrieve: boolean;
|
|
5
|
+
upload: boolean;
|
|
6
|
+
listFiles: boolean;
|
|
7
|
+
batchDeleteFiles: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface EnterpriseKnowledgeBase {
|
|
10
|
+
id: string;
|
|
11
|
+
sourceId: string | null;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
knowledgeType: EnterpriseKnowledgeType;
|
|
15
|
+
status: string | null;
|
|
16
|
+
capabilities: EnterpriseKnowledgeCapabilities;
|
|
17
|
+
}
|
|
18
|
+
export interface EnterpriseKnowledgeTreeNode {
|
|
19
|
+
id: string;
|
|
20
|
+
parentId: string | null;
|
|
21
|
+
nodeType: EnterpriseKnowledgeNodeType;
|
|
22
|
+
name: string;
|
|
23
|
+
protected: boolean;
|
|
24
|
+
deletable: boolean;
|
|
25
|
+
knowledgeBase: EnterpriseKnowledgeBase | null;
|
|
26
|
+
children: EnterpriseKnowledgeTreeNode[];
|
|
27
|
+
}
|
|
28
|
+
export interface EnterpriseKnowledgeTreeResult {
|
|
29
|
+
tenantId: string | null;
|
|
30
|
+
permissionScope: string | null;
|
|
31
|
+
nodes: EnterpriseKnowledgeTreeNode[];
|
|
32
|
+
}
|
|
33
|
+
export interface EnterpriseKnowledgeSearchQuery {
|
|
34
|
+
keyword?: string;
|
|
35
|
+
page?: number;
|
|
36
|
+
pageSize?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface EnterpriseKnowledgeSearchResult {
|
|
39
|
+
items: EnterpriseKnowledgeBase[];
|
|
40
|
+
page: number;
|
|
41
|
+
pageSize: number;
|
|
42
|
+
total: number;
|
|
43
|
+
}
|
|
44
|
+
export interface EnterpriseKnowledgeDocument {
|
|
45
|
+
id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
status: string | null;
|
|
48
|
+
fileType: string | null;
|
|
49
|
+
sizeBytes: number | null;
|
|
50
|
+
createdByName: string | null;
|
|
51
|
+
createdAt: string | null;
|
|
52
|
+
updatedAt: string | null;
|
|
53
|
+
canPreview: boolean;
|
|
54
|
+
canDownload: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface EnterpriseKnowledgeDocumentPreviewRequest {
|
|
57
|
+
documentId: string;
|
|
58
|
+
fileName: string;
|
|
59
|
+
page?: number;
|
|
60
|
+
}
|
|
61
|
+
export interface EnterpriseKnowledgeDocumentPreviewResult {
|
|
62
|
+
name: string;
|
|
63
|
+
mediaType: string | null;
|
|
64
|
+
sizeBytes: number;
|
|
65
|
+
dataUrl: string;
|
|
66
|
+
page: number;
|
|
67
|
+
pageCount: number;
|
|
68
|
+
canDownload: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface EnterpriseKnowledgeDocumentDownloadLink {
|
|
71
|
+
documentId: string;
|
|
72
|
+
downloadUrl: string;
|
|
73
|
+
}
|
|
74
|
+
export interface EnterpriseKnowledgeAttachment {
|
|
75
|
+
id: string;
|
|
76
|
+
documentId: string;
|
|
77
|
+
knowledgeBaseId: string;
|
|
78
|
+
name: string;
|
|
79
|
+
mimeType: string;
|
|
80
|
+
sizeBytes: number;
|
|
81
|
+
url: string;
|
|
82
|
+
}
|
|
83
|
+
export interface EnterpriseKnowledgeDocumentQuery {
|
|
84
|
+
sourceId: string;
|
|
85
|
+
keyword?: string;
|
|
86
|
+
page?: number;
|
|
87
|
+
pageSize?: number;
|
|
88
|
+
}
|
|
89
|
+
export interface EnterpriseKnowledgeDocumentResult {
|
|
90
|
+
items: EnterpriseKnowledgeDocument[];
|
|
91
|
+
page: number;
|
|
92
|
+
pageSize: number;
|
|
93
|
+
total: number;
|
|
94
|
+
hasPrevious: boolean;
|
|
95
|
+
hasNext: boolean;
|
|
96
|
+
}
|
|
97
|
+
export interface EnterpriseKnowledgeApi {
|
|
98
|
+
tree(): Promise<EnterpriseKnowledgeTreeResult>;
|
|
99
|
+
search(query?: EnterpriseKnowledgeSearchQuery): Promise<EnterpriseKnowledgeSearchResult>;
|
|
100
|
+
listDocuments(query: EnterpriseKnowledgeDocumentQuery): Promise<EnterpriseKnowledgeDocumentResult>;
|
|
101
|
+
readDocument(request: EnterpriseKnowledgeDocumentPreviewRequest): Promise<EnterpriseKnowledgeDocumentPreviewResult>;
|
|
102
|
+
getDocumentDownloadLink(documentId: string): Promise<EnterpriseKnowledgeDocumentDownloadLink>;
|
|
103
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface EnterpriseProjectResource {
|
|
2
|
+
tenant_id: string;
|
|
3
|
+
workspace_id: string;
|
|
4
|
+
resource_type: 'AGENT' | 'AICODING_AGENT' | 'AICODING_WORKFLOW';
|
|
5
|
+
resource_id: string;
|
|
6
|
+
}
|
|
7
|
+
export interface EnterpriseProjectCapability extends EnterpriseProjectResource {
|
|
8
|
+
record_id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string | null;
|
|
11
|
+
contract_revision: string;
|
|
12
|
+
}
|
|
13
|
+
export interface EnterpriseProjectCapabilityPage {
|
|
14
|
+
list: EnterpriseProjectCapability[];
|
|
15
|
+
page: number;
|
|
16
|
+
page_size: number;
|
|
17
|
+
has_next: boolean;
|
|
18
|
+
verification_pending: number;
|
|
19
|
+
}
|
|
20
|
+
export interface EnterpriseProjectSearchRequest {
|
|
21
|
+
userId: string;
|
|
22
|
+
tenantId: string;
|
|
23
|
+
keyword: string;
|
|
24
|
+
page: number;
|
|
25
|
+
}
|
|
26
|
+
export declare function enterpriseProjectKey(resource: EnterpriseProjectResource): string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { LocalTaskExecutionState } from './local-task-api.js';
|
|
2
|
+
export type OwnedRuntimeActivity = Pick<LocalTaskExecutionState, 'taskId' | 'running' | 'pendingInteractionCount' | 'activity'>;
|
|
3
|
+
export declare function readExecutionActivity(value: unknown): NonNullable<LocalTaskExecutionState['activity']>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ModelRoutingIdentity } from './model-routing.js';
|
|
2
|
+
/** Supplied only by the authenticated application host, never by tool arguments. */
|
|
3
|
+
export interface ExecutionContext {
|
|
4
|
+
actor: {
|
|
5
|
+
userId: string;
|
|
6
|
+
tenantId: string | null;
|
|
7
|
+
name?: string;
|
|
8
|
+
};
|
|
9
|
+
owner: {
|
|
10
|
+
userId: string;
|
|
11
|
+
tenantId: string | null;
|
|
12
|
+
name?: string;
|
|
13
|
+
};
|
|
14
|
+
workspaceId: string | null;
|
|
15
|
+
projectId?: string;
|
|
16
|
+
collaborationProjectId?: string;
|
|
17
|
+
assistantId?: string;
|
|
18
|
+
platformSessionId?: string;
|
|
19
|
+
platformTurnId?: string;
|
|
20
|
+
platformTaskId?: string;
|
|
21
|
+
platformRunId?: string;
|
|
22
|
+
traceId?: string;
|
|
23
|
+
/** Host-owned business data; never used as identity or routing headers. */
|
|
24
|
+
metadata?: Record<string, Record<string, string | number | boolean | null>>;
|
|
25
|
+
usageScene: 'personal' | 'greeting' | 'task' | 'collaboration' | 'coding';
|
|
26
|
+
}
|
|
27
|
+
export interface ExecutionBinding {
|
|
28
|
+
sessionId: string;
|
|
29
|
+
runId: string;
|
|
30
|
+
context?: ExecutionContext;
|
|
31
|
+
}
|
|
32
|
+
export declare function parseExecutionContext(value: unknown): ExecutionContext;
|
|
33
|
+
export declare function parseExecutionBinding(value: unknown): ExecutionBinding;
|
|
34
|
+
export declare function executionRoutingIdentity(context: ExecutionContext): ModelRoutingIdentity;
|
|
35
|
+
export declare function executionContextHeaders(binding: ExecutionBinding): Record<string, string>;
|
|
36
|
+
export declare function executionBindingHeaders(binding?: ExecutionBinding): Record<string, string>;
|
|
37
|
+
export declare function decodeExecutionBinding(value: string | undefined): ExecutionBinding | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Local application identity is not a platform user or tenant. */
|
|
2
|
+
export interface StandaloneExecutionIdentity {
|
|
3
|
+
mode: 'standalone';
|
|
4
|
+
appId: string;
|
|
5
|
+
userScope: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function validateStandaloneIdentity(value: StandaloneExecutionIdentity): StandaloneExecutionIdentity;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Describes the execution host, not the user's authorization or model permissions. */
|
|
2
|
+
export interface ExecutionProfile {
|
|
3
|
+
host: 'desktop' | 'server';
|
|
4
|
+
role: 'personal' | 'task' | 'coding';
|
|
5
|
+
}
|
|
6
|
+
export declare function parseExecutionProfile(value: unknown): ExecutionProfile;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/** Execution location is independent of workspace kind and worktree environments. */
|
|
2
|
+
export type ExecutionTargetKind = 'local' | 'ssh' | 'docker' | 'wsl';
|
|
3
|
+
export type RemoteExecutionTargetKind = Exclude<ExecutionTargetKind, 'local'>;
|
|
4
|
+
export type ExecutionTargetPlatform = 'darwin' | 'linux' | 'win32';
|
|
5
|
+
export interface OwnerPrincipal {
|
|
6
|
+
platformUrl: string;
|
|
7
|
+
userId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ExecutionTargetIdentity {
|
|
10
|
+
executionTargetId: string;
|
|
11
|
+
dataRootId: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TaskRef extends ExecutionTargetIdentity {
|
|
14
|
+
kind: ExecutionTargetKind;
|
|
15
|
+
owner: OwnerPrincipal;
|
|
16
|
+
taskId: string;
|
|
17
|
+
}
|
|
18
|
+
export interface WorkspaceRef extends ExecutionTargetIdentity {
|
|
19
|
+
kind: ExecutionTargetKind;
|
|
20
|
+
owner: OwnerPrincipal;
|
|
21
|
+
workspaceId: string;
|
|
22
|
+
/** Resolved by the target, never by the controlling machine's path/fs APIs. */
|
|
23
|
+
canonicalPath: string;
|
|
24
|
+
name: string;
|
|
25
|
+
}
|
|
26
|
+
export interface MemberRef {
|
|
27
|
+
task: TaskRef;
|
|
28
|
+
runId: string;
|
|
29
|
+
sourceThreadId: string;
|
|
30
|
+
teamRunId?: string;
|
|
31
|
+
memberRunId?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface TargetFileRef {
|
|
34
|
+
task: TaskRef;
|
|
35
|
+
fileId: string;
|
|
36
|
+
contentVersion: string;
|
|
37
|
+
name: string;
|
|
38
|
+
}
|
|
39
|
+
export interface TargetArtifactRef {
|
|
40
|
+
task: TaskRef;
|
|
41
|
+
artifactId: string;
|
|
42
|
+
file: TargetFileRef;
|
|
43
|
+
runId?: string;
|
|
44
|
+
memberRunId?: string;
|
|
45
|
+
}
|
|
46
|
+
/** This is a verified session reference, not credentials or proof supplied by a caller. */
|
|
47
|
+
export interface TargetAuthBinding {
|
|
48
|
+
id: string;
|
|
49
|
+
owner: OwnerPrincipal;
|
|
50
|
+
tenantId: string;
|
|
51
|
+
personalMode: boolean;
|
|
52
|
+
contextVersion: number;
|
|
53
|
+
sessionId: string;
|
|
54
|
+
clientAuthGeneration: number;
|
|
55
|
+
expiresAt: string;
|
|
56
|
+
}
|
|
57
|
+
export type ExecutionTargetErrorCode = 'INVALID_TARGET_REFERENCE' | 'TARGET_MISMATCH' | 'OWNER_MISMATCH' | 'TASK_SCOPE_UNSUPPORTED' | 'TARGET_UNAVAILABLE' | 'STALE_BINDING' | 'PROTOCOL_ERROR' | 'PROTOCOL_MISMATCH' | 'METHOD_UNAVAILABLE' | 'HANDSHAKE_REQUIRED' | 'AUTH_REQUIRED' | 'INPUT_TOO_LARGE' | 'CONNECTION_CLOSED' | 'QUERY_CANCELLED';
|
|
58
|
+
export declare class ExecutionTargetError extends Error {
|
|
59
|
+
readonly code: ExecutionTargetErrorCode;
|
|
60
|
+
readonly cause?: unknown;
|
|
61
|
+
constructor(code: ExecutionTargetErrorCode, message: string, options?: {
|
|
62
|
+
cause?: unknown;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
export declare function canonicalPlatformUrl(value: string): string;
|
|
66
|
+
export declare function principalKey(owner: OwnerPrincipal): string;
|
|
67
|
+
export declare function targetKey(target: ExecutionTargetIdentity): string;
|
|
68
|
+
export declare function taskRefKey(ref: TaskRef): string;
|
|
69
|
+
export declare function workspaceRefKey(ref: WorkspaceRef): string;
|
|
70
|
+
export declare function assertTargetIdentity(expected: ExecutionTargetIdentity, actual: ExecutionTargetIdentity): void;
|
|
71
|
+
export declare function assertOwnerPrincipal(expected: OwnerPrincipal, actual: OwnerPrincipal): void;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { LocalTaskExpertTeamMemberReference } from './local-task-api.js';
|
|
2
|
+
export interface ExpertTeamAgentSnapshot extends LocalTaskExpertTeamMemberReference {
|
|
3
|
+
sdk?: Pick<import('./agent-team.js').AgentTeamMember, 'model' | 'reasoningEffort' | 'tools' | 'paths'>;
|
|
4
|
+
runtimeRole: string;
|
|
5
|
+
description: string;
|
|
6
|
+
instructions: string;
|
|
7
|
+
maxTurns: number | null;
|
|
8
|
+
skills: string[];
|
|
9
|
+
capabilities: string[];
|
|
10
|
+
}
|
|
11
|
+
export type ExpertTeamWritePolicy = 'leader_only' | 'team_shared_workspace';
|
|
12
|
+
export interface ExpertTeamRunSnapshot {
|
|
13
|
+
schemaVersion: 1;
|
|
14
|
+
packageFormat: 'aios-expert-team';
|
|
15
|
+
packageId: string;
|
|
16
|
+
packageVersion: string;
|
|
17
|
+
packageHash: string;
|
|
18
|
+
snapshotHash: string;
|
|
19
|
+
displayName: string;
|
|
20
|
+
description: string;
|
|
21
|
+
teamAvatarRelativePath: string;
|
|
22
|
+
leader: ExpertTeamAgentSnapshot;
|
|
23
|
+
members: ExpertTeamAgentSnapshot[];
|
|
24
|
+
workflow: string;
|
|
25
|
+
writePolicy: ExpertTeamWritePolicy;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 首次执行前由 Electron 主进程锁定的任务级专家团快照。
|
|
29
|
+
* Renderer 不能创建或修改此对象;后续消息、重试和恢复必须复用同一份快照。
|
|
30
|
+
*/
|
|
31
|
+
export interface TeamExecutionSnapshot {
|
|
32
|
+
schemaVersion: 1;
|
|
33
|
+
teamRunId: string;
|
|
34
|
+
taskId: string;
|
|
35
|
+
selectionLockedAt: string;
|
|
36
|
+
package: ExpertTeamRunSnapshot;
|
|
37
|
+
taskSnapshotHash: string;
|
|
38
|
+
source?: {
|
|
39
|
+
kind: 'application';
|
|
40
|
+
agentId: string;
|
|
41
|
+
agentVersion: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface ExpertTeamTaskSnapshot extends TeamExecutionSnapshot {
|
|
45
|
+
professionId: string;
|
|
46
|
+
professionVersionId: string;
|
|
47
|
+
professionVersionNo: string;
|
|
48
|
+
}
|
|
49
|
+
export interface PrepareExpertTeamPackageRequest {
|
|
50
|
+
professionId: string;
|
|
51
|
+
versionId: string;
|
|
52
|
+
versionNo: string;
|
|
53
|
+
packageRef: string;
|
|
54
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface DesktopFeedbackFileAttachment {
|
|
2
|
+
name: string;
|
|
3
|
+
mediaType: string;
|
|
4
|
+
sizeBytes: number;
|
|
5
|
+
sourcePath?: string;
|
|
6
|
+
data?: ArrayBuffer;
|
|
7
|
+
}
|
|
8
|
+
export interface SubmitDesktopFeedbackRequest {
|
|
9
|
+
description: string;
|
|
10
|
+
attachments: DesktopFeedbackFileAttachment[];
|
|
11
|
+
includeDiagnostics: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface DesktopFeedbackSubmission {
|
|
14
|
+
id: string;
|
|
15
|
+
status: 'PENDING' | 'PROCESSED';
|
|
16
|
+
createdAt: string;
|
|
17
|
+
}
|
|
18
|
+
export interface DesktopFeedbackApi {
|
|
19
|
+
submit(request: SubmitDesktopFeedbackRequest): Promise<DesktopFeedbackSubmission>;
|
|
20
|
+
}
|
|
@@ -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
|
+
}
|