@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.
Files changed (141) hide show
  1. package/EVENTS.md +88 -0
  2. package/README.md +656 -2
  3. package/capabilities.json +2398 -0
  4. package/dist/cli/daemon/preferences.d.ts +67 -0
  5. package/dist/cli/daemon/protocol.d.ts +26 -0
  6. package/dist/cli/daemon/resource-limits.d.ts +39 -0
  7. package/dist/core/auth/platform-client.d.ts +65 -0
  8. package/dist/core/host/runtime-dependencies.d.ts +26 -0
  9. package/dist/core/skills/skill-bindings.d.ts +19 -0
  10. package/dist/core/skills/skill-versions.d.ts +31 -0
  11. package/dist/electron/main/bundled-runtime-tools.d.ts +24 -0
  12. package/dist/events.js +1 -0
  13. package/dist/index.js +55 -0
  14. package/dist/sdk/src/auth.d.ts +43 -0
  15. package/dist/sdk/src/authorization-events.d.ts +16 -0
  16. package/dist/sdk/src/authorization.d.ts +10 -0
  17. package/dist/sdk/src/communication.d.ts +9 -0
  18. package/dist/sdk/src/diagnostics.d.ts +24 -0
  19. package/dist/sdk/src/errors.d.ts +4 -0
  20. package/dist/sdk/src/events.d.ts +4 -0
  21. package/dist/sdk/src/file-api.d.ts +29 -0
  22. package/dist/sdk/src/file-storage.d.ts +34 -0
  23. package/dist/sdk/src/index.d.ts +260 -0
  24. package/dist/sdk/src/local-connection.d.ts +9 -0
  25. package/dist/sdk/src/managed-host.d.ts +32 -0
  26. package/dist/sdk/src/native-status.d.ts +59 -0
  27. package/dist/sdk/src/platform.d.ts +39 -0
  28. package/dist/sdk/src/runtime-control.d.ts +111 -0
  29. package/dist/sdk/src/runtime-integrity.d.ts +10 -0
  30. package/dist/sdk/src/tool-reference.d.ts +11 -0
  31. package/dist/sdk/src/tool-result.d.ts +36 -0
  32. package/dist/sdk/src/tool-server.d.ts +14 -0
  33. package/dist/sdk/src/transport.d.ts +25 -0
  34. package/dist/sdk/src/types.d.ts +405 -0
  35. package/dist/shared/account-context-api.d.ts +47 -0
  36. package/dist/shared/account-schedules-api.d.ts +110 -0
  37. package/dist/shared/action-center-api.d.ts +50 -0
  38. package/dist/shared/agent-capabilities.d.ts +42 -0
  39. package/dist/shared/agent-hooks.d.ts +10 -0
  40. package/dist/shared/agent-team.d.ts +19 -0
  41. package/dist/shared/artifact-evidence.d.ts +18 -0
  42. package/dist/shared/automation-api.d.ts +112 -0
  43. package/dist/shared/client-downloads-api.d.ts +20 -0
  44. package/dist/shared/cloud-assistant-api.d.ts +532 -0
  45. package/dist/shared/cloud-task-resources.d.ts +24 -0
  46. package/dist/shared/cloud-task-runtime-api.d.ts +253 -0
  47. package/dist/shared/collaboration-api.d.ts +17 -0
  48. package/dist/shared/collaboration-automation-api.d.ts +55 -0
  49. package/dist/shared/collaboration-deep-link.d.ts +15 -0
  50. package/dist/shared/collaboration-event-api.d.ts +19 -0
  51. package/dist/shared/collaboration-plan-api.d.ts +159 -0
  52. package/dist/shared/collaboration-project-api.d.ts +206 -0
  53. package/dist/shared/collaboration-resource-api.d.ts +41 -0
  54. package/dist/shared/collaboration-task-api.d.ts +276 -0
  55. package/dist/shared/collaboration-task-execution.d.ts +39 -0
  56. package/dist/shared/computer-use-api.d.ts +80 -0
  57. package/dist/shared/computer-use-handshake.d.ts +19 -0
  58. package/dist/shared/computer-use-protocol.d.ts +488 -0
  59. package/dist/shared/context-usage.d.ts +15 -0
  60. package/dist/shared/desktop-api.d.ts +450 -0
  61. package/dist/shared/desktop-diagnostics-api.d.ts +56 -0
  62. package/dist/shared/desktop-language.d.ts +3 -0
  63. package/dist/shared/desktop-mcp-service-api.d.ts +157 -0
  64. package/dist/shared/document-session-api.d.ts +91 -0
  65. package/dist/shared/enterprise-knowledge-api.d.ts +103 -0
  66. package/dist/shared/enterprise-project-api.d.ts +26 -0
  67. package/dist/shared/execution-activity.d.ts +3 -0
  68. package/dist/shared/execution-context.d.ts +62 -0
  69. package/dist/shared/execution-identity.d.ts +7 -0
  70. package/dist/shared/execution-profile.d.ts +6 -0
  71. package/dist/shared/execution-target.d.ts +71 -0
  72. package/dist/shared/expert-selection.d.ts +22 -0
  73. package/dist/shared/expert-team-api.d.ts +54 -0
  74. package/dist/shared/feedback-api.d.ts +20 -0
  75. package/dist/shared/git-api.d.ts +227 -0
  76. package/dist/shared/git-http-api.d.ts +12 -0
  77. package/dist/shared/hosted-git-api.d.ts +132 -0
  78. package/dist/shared/js-agent-hooks.d.ts +23 -0
  79. package/dist/shared/local-custom-model-api.d.ts +55 -0
  80. package/dist/shared/local-environment-api.d.ts +110 -0
  81. package/dist/shared/local-mcp-server-api.d.ts +91 -0
  82. package/dist/shared/local-memory.d.ts +165 -0
  83. package/dist/shared/local-plugin-api.d.ts +26 -0
  84. package/dist/shared/local-runtime-api.d.ts +32 -0
  85. package/dist/shared/local-skill-api.d.ts +42 -0
  86. package/dist/shared/local-task-api.d.ts +658 -0
  87. package/dist/shared/local-task-command-client.d.ts +55 -0
  88. package/dist/shared/local-task-command.d.ts +93 -0
  89. package/dist/shared/local-task-event-projection.d.ts +29 -0
  90. package/dist/shared/local-task-projection.d.ts +29 -0
  91. package/dist/shared/local-workspace.d.ts +9 -0
  92. package/dist/shared/managed-authorization.d.ts +72 -0
  93. package/dist/shared/memory-customization.d.ts +32 -0
  94. package/dist/shared/model-routing.d.ts +31 -0
  95. package/dist/shared/model-selection.d.ts +11 -0
  96. package/dist/shared/my-expert-api.d.ts +119 -0
  97. package/dist/shared/navigation-api.d.ts +20 -0
  98. package/dist/shared/office-window-api.d.ts +81 -0
  99. package/dist/shared/platform-branding-api.d.ts +66 -0
  100. package/dist/shared/plugin-market-api.d.ts +120 -0
  101. package/dist/shared/profession-market-api.d.ts +96 -0
  102. package/dist/shared/project-local-skill-api.d.ts +8 -0
  103. package/dist/shared/remote-connection-api.d.ts +97 -0
  104. package/dist/shared/remote-connection.d.ts +62 -0
  105. package/dist/shared/remote-installation-api.d.ts +50 -0
  106. package/dist/shared/remote-tasks-api.d.ts +118 -0
  107. package/dist/shared/runtime-tuning.d.ts +44 -0
  108. package/dist/shared/scene-case-api.d.ts +42 -0
  109. package/dist/shared/sdk-session-contract.d.ts +96 -0
  110. package/dist/shared/security-center-api.d.ts +74 -0
  111. package/dist/shared/sensitive-protection-api.d.ts +71 -0
  112. package/dist/shared/session-policy.d.ts +26 -0
  113. package/dist/shared/shortcut-api.d.ts +7 -0
  114. package/dist/shared/skill-activation-api.d.ts +8 -0
  115. package/dist/shared/skill-asset-api.d.ts +12 -0
  116. package/dist/shared/skill-market-api.d.ts +119 -0
  117. package/dist/shared/skill-upload.d.ts +16 -0
  118. package/dist/shared/speech-recognition-api.d.ts +12 -0
  119. package/dist/shared/storage-integrity.d.ts +15 -0
  120. package/dist/shared/target-bridge-protocol.d.ts +67 -0
  121. package/dist/shared/target-environments.d.ts +15 -0
  122. package/dist/shared/target-resources.d.ts +105 -0
  123. package/dist/shared/task-enterprise-project-api.d.ts +75 -0
  124. package/dist/shared/task-execution-api.d.ts +35 -0
  125. package/dist/shared/task-initialization-api.d.ts +44 -0
  126. package/dist/shared/task-menu-api.d.ts +27 -0
  127. package/dist/shared/task-operation.d.ts +19 -0
  128. package/dist/shared/task-path-policy.d.ts +14 -0
  129. package/dist/shared/task-resource-manifest.d.ts +33 -0
  130. package/dist/shared/task-storage-recovery.d.ts +33 -0
  131. package/dist/shared/task-terminal-api.d.ts +48 -0
  132. package/dist/shared/team-control.d.ts +60 -0
  133. package/dist/shared/tool-activity.d.ts +18 -0
  134. package/dist/shared/update-api.d.ts +65 -0
  135. package/dist/shared/usage-statistics-api.d.ts +18 -0
  136. package/dist/shared/worktree-api.d.ts +188 -0
  137. package/examples/business-assistant.mjs +19 -0
  138. package/examples/common.mjs +51 -0
  139. package/examples/platform-assistant.mjs +9 -0
  140. package/examples/standalone-assistant.mjs +16 -0
  141. package/package.json +40 -4
@@ -0,0 +1,75 @@
1
+ export type JsonValue = null | boolean | number | string | JsonValue[] | {
2
+ [key: string]: JsonValue;
3
+ };
4
+ export interface EnterpriseProjectInteraction {
5
+ interaction_id: string;
6
+ type: 'approval' | 'single_select' | 'multi_select' | 'form' | 'text';
7
+ title: string;
8
+ description?: string | null;
9
+ details?: JsonValue;
10
+ options: {
11
+ id: string;
12
+ label: string;
13
+ value: JsonValue;
14
+ }[];
15
+ schema: JsonSchema;
16
+ expires_at?: string | null;
17
+ status: 'pending' | 'resolved' | 'expired';
18
+ }
19
+ export interface JsonSchema {
20
+ [keyword: string]: unknown;
21
+ type?: 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean' | 'null';
22
+ title?: string;
23
+ description?: string;
24
+ properties?: Record<string, JsonSchema>;
25
+ required?: string[];
26
+ items?: JsonSchema;
27
+ enum?: JsonValue[];
28
+ minLength?: number;
29
+ maxLength?: number;
30
+ minimum?: number;
31
+ maximum?: number;
32
+ minItems?: number;
33
+ maxItems?: number;
34
+ pattern?: string;
35
+ format?: string;
36
+ }
37
+ export interface EnterpriseProjectArtifact {
38
+ name: string;
39
+ url: string;
40
+ mime_type?: string;
41
+ }
42
+ export interface EnterpriseProjectInvocation {
43
+ invocation_id: string;
44
+ record_id: string;
45
+ name: string;
46
+ task_id: string;
47
+ session_id: string;
48
+ status: 'queued' | 'running' | 'waiting_input' | 'waiting_approval' | 'succeeded' | 'incomplete' | 'failed' | 'cancelled' | 'interrupted';
49
+ result: JsonValue;
50
+ artifacts: EnterpriseProjectArtifact[];
51
+ required_action: EnterpriseProjectInteraction[];
52
+ error: JsonValue;
53
+ revision: number;
54
+ created_at: string;
55
+ updated_at: string;
56
+ }
57
+ export interface EnterpriseProjectResource {
58
+ tenant_id: string;
59
+ workspace_id: string;
60
+ resource_type: 'AGENT' | 'AICODING_AGENT' | 'AICODING_WORKFLOW';
61
+ resource_id: string;
62
+ }
63
+ export interface EnterpriseProjectCapability extends EnterpriseProjectResource {
64
+ record_id: string;
65
+ name: string;
66
+ description?: string | null;
67
+ contract_revision: string;
68
+ }
69
+ export interface EnterpriseProjectCapabilityPage {
70
+ list: EnterpriseProjectCapability[];
71
+ page: number;
72
+ page_size: number;
73
+ has_next: boolean;
74
+ verification_pending: number;
75
+ }
@@ -0,0 +1,35 @@
1
+ export type TaskExecutionProvider = 'LICOS' | 'CLAUDE' | 'CODEX';
2
+ export interface TaskExecutionEndpoint {
3
+ id: string;
4
+ name: string;
5
+ provider: TaskExecutionProvider;
6
+ status: 'PENDING' | 'ACTIVE' | 'REVOKED';
7
+ connected: boolean;
8
+ deviceId: string | null;
9
+ capabilities: {
10
+ protocolVersion?: number;
11
+ methods?: string[];
12
+ };
13
+ }
14
+ export interface TaskEndpointPairing {
15
+ id: string;
16
+ endpointId: string;
17
+ token: string;
18
+ expiresAt: string;
19
+ }
20
+ export interface TaskExecutionBinding {
21
+ endpointId: string;
22
+ deviceId: string;
23
+ provider: TaskExecutionProvider;
24
+ name: string;
25
+ }
26
+ export interface TaskExecutionEndpointsApi {
27
+ executionEndpoints(actor: string, offset: number): Promise<TaskExecutionEndpoint[]>;
28
+ createExecutionEndpoint(actor: string, name: string, provider: TaskExecutionProvider): Promise<TaskEndpointPairing>;
29
+ pairExecutionEndpoint(actor: string, id: string): Promise<TaskEndpointPairing>;
30
+ executionPairingStatus(actor: string, pair: TaskEndpointPairing): Promise<{
31
+ status: 'PENDING' | 'CLAIMED' | 'CANCELLED' | 'EXPIRED';
32
+ }>;
33
+ cancelExecutionPairing(actor: string, pair: TaskEndpointPairing): Promise<void>;
34
+ revokeExecutionEndpoint(actor: string, id: string): Promise<void>;
35
+ }
@@ -0,0 +1,44 @@
1
+ export interface GenerateTaskTitleRequest {
2
+ permissionMode?: 'ask_dangerous' | 'allow_all';
3
+ prompt: string;
4
+ projectId?: string;
5
+ }
6
+ export interface GenerateTaskTitleResult {
7
+ title: string;
8
+ model: string;
9
+ }
10
+ export interface EnhanceTaskPromptRequest {
11
+ permissionMode?: 'ask_dangerous' | 'allow_all';
12
+ prompt: string;
13
+ projectId?: string;
14
+ }
15
+ export interface EnhanceTaskPromptResult {
16
+ prompt: string;
17
+ model: string;
18
+ }
19
+ export interface RecommendTaskModelRequest {
20
+ permissionMode?: 'ask_dangerous' | 'allow_all';
21
+ prompt: string;
22
+ projectId?: string;
23
+ attachments?: Array<{
24
+ name: string;
25
+ mediaType: string;
26
+ }>;
27
+ }
28
+ export interface RecommendTaskModelResult {
29
+ model: string;
30
+ source: 'recommended' | 'default';
31
+ }
32
+ export interface ResolveTaskExecutionModelRequest extends RecommendTaskModelRequest {
33
+ recommendedModel?: string;
34
+ }
35
+ export interface ResolveTaskExecutionModelResult {
36
+ model: string;
37
+ source: 'existing' | 'recommended' | 'default';
38
+ }
39
+ export interface TaskInitializationApi {
40
+ generateTitle(request: GenerateTaskTitleRequest): Promise<GenerateTaskTitleResult>;
41
+ enhancePrompt(request: EnhanceTaskPromptRequest): Promise<EnhanceTaskPromptResult>;
42
+ recommendModel(request: RecommendTaskModelRequest): Promise<RecommendTaskModelResult>;
43
+ resolveModelForExecution(request: ResolveTaskExecutionModelRequest): Promise<ResolveTaskExecutionModelResult>;
44
+ }
@@ -0,0 +1,27 @@
1
+ export type TaskMenuTarget = {
2
+ kind: 'local';
3
+ taskId: string;
4
+ } | {
5
+ kind: 'cloud';
6
+ taskId: string;
7
+ projectId: string;
8
+ };
9
+ export type TaskMenuAction = {
10
+ kind: 'new-task';
11
+ } | TaskMenuTarget;
12
+ export interface TaskMenuEntry {
13
+ target: TaskMenuTarget;
14
+ title: string;
15
+ projectName?: string;
16
+ updatedAt: string;
17
+ unread: boolean;
18
+ }
19
+ export interface TaskMenuSnapshot {
20
+ ownerUserId: string;
21
+ source: 'local' | 'cloud';
22
+ tasks: TaskMenuEntry[];
23
+ }
24
+ export interface TaskMenuApi {
25
+ update(snapshot: TaskMenuSnapshot): Promise<void>;
26
+ onAction(listener: (action: TaskMenuAction) => void): () => void;
27
+ }
@@ -0,0 +1,19 @@
1
+ /** A reference to the existing execution owner, never another task or scheduler. */
2
+ export interface TaskOperationReference {
3
+ id: string;
4
+ sessionId: string;
5
+ runId: string;
6
+ kind: 'process' | 'document' | 'model-media';
7
+ ownerId: string;
8
+ createdAt: string;
9
+ }
10
+ export interface TaskOperationSnapshot {
11
+ reference: TaskOperationReference;
12
+ status: 'running' | 'completed' | 'failed' | 'cancelled' | 'unknown';
13
+ canCancel: boolean;
14
+ observedAt: string;
15
+ /** Actual owner response. This can include expiring remote download URLs; it is not browser-safe HTML. */
16
+ result?: unknown;
17
+ /** Unknown is not success or cancellation; e.g. a process owner exited without a terminal record. */
18
+ reason?: string;
19
+ }
@@ -0,0 +1,14 @@
1
+ /** Explicit host grants. Omitted policy preserves existing desktop/CLI task behavior. */
2
+ export interface TaskPathPolicy {
3
+ cwd?: string;
4
+ readRoots: string[];
5
+ writeRoots: string[];
6
+ /** Elevated requires a sandbox already provisioned by the machine administrator. */
7
+ windowsSandbox?: 'unelevated' | 'elevated';
8
+ }
9
+ export interface ResolvedTaskPathPolicy extends TaskPathPolicy {
10
+ cwd: string;
11
+ workspaceRoot: string;
12
+ stateRoot: string;
13
+ }
14
+ export declare function parseTaskPathPolicy(value: unknown): TaskPathPolicy;
@@ -0,0 +1,33 @@
1
+ /** Auditable preparation metadata only. Never contains secrets, tokens, full
2
+ * service configuration, or controller-local filesystem paths. */
3
+ export interface TaskResourceManifest {
4
+ schemaVersion: 1;
5
+ preparedAt: string;
6
+ configuration: {
7
+ mcpRevision: string;
8
+ modelRevision: string;
9
+ };
10
+ skills: Array<{
11
+ id: string;
12
+ source: string;
13
+ scope?: string;
14
+ version?: string;
15
+ revision?: string;
16
+ contentHash: string;
17
+ selected: boolean;
18
+ available: boolean;
19
+ }>;
20
+ plugins: Array<{
21
+ id: string;
22
+ runtimeId?: string;
23
+ version?: string;
24
+ definitionHash: string;
25
+ }>;
26
+ expert?: {
27
+ id: string;
28
+ versionId: string;
29
+ version: string;
30
+ packageHash?: string;
31
+ instructionsHash?: string;
32
+ };
33
+ }
@@ -0,0 +1,33 @@
1
+ import type { LocalTaskMessage } from './local-task-api.js';
2
+ import type { StorageProblem } from './storage-integrity.js';
3
+ export interface TaskStorageProblem {
4
+ file: string;
5
+ status: StorageProblem;
6
+ message: string;
7
+ offset?: number;
8
+ endOffset?: number;
9
+ }
10
+ export interface TaskStorageReport {
11
+ taskId: string;
12
+ status: 'healthy' | 'partial' | 'unrecoverable' | 'temporarily_unavailable';
13
+ checkedAt: string;
14
+ issues: TaskStorageProblem[];
15
+ issueCount: number;
16
+ messages: LocalTaskMessage[];
17
+ messagesSource?: 'checkpoint';
18
+ messagesLimited: boolean;
19
+ validMessageCount: number;
20
+ canRestore: boolean;
21
+ checkpointAt?: string;
22
+ checkpointBytes?: number;
23
+ fingerprint: string;
24
+ protectionIssue?: string;
25
+ /** Missing live external references do not invalidate the task journals. */
26
+ resourceIssues?: TaskStorageProblem[];
27
+ }
28
+ export interface TaskStorageRecoveryApi {
29
+ inspect: (taskId: string) => Promise<TaskStorageReport>;
30
+ restore: (taskId: string, fingerprint: string) => Promise<TaskStorageReport>;
31
+ cancel: (taskId: string) => Promise<void>;
32
+ createFromRecovered: (taskId: string, fingerprint: string) => Promise<import('./local-task-api.js').LocalTask>;
33
+ }
@@ -0,0 +1,48 @@
1
+ export interface TaskTerminalTarget {
2
+ taskId: string;
3
+ tabId: string;
4
+ }
5
+ export interface TaskTerminalSize {
6
+ cols: number;
7
+ rows: number;
8
+ }
9
+ export type TaskTerminalEvent = TaskTerminalTarget & {
10
+ sequence: number;
11
+ } & ({
12
+ type: 'output';
13
+ dataBase64: string;
14
+ } | {
15
+ type: 'exit';
16
+ exitCode: number;
17
+ } | {
18
+ type: 'error';
19
+ message: string;
20
+ });
21
+ export interface TaskTerminalSnapshot {
22
+ cwd: string;
23
+ events: TaskTerminalEvent[];
24
+ running: boolean;
25
+ }
26
+ export type TaskTerminalStateUpdate = {
27
+ status: 'connected';
28
+ snapshot: TaskTerminalSnapshot;
29
+ } | {
30
+ status: 'disconnected' | 'error';
31
+ message: string;
32
+ };
33
+ export type TaskTerminalState = TaskTerminalTarget & TaskTerminalStateUpdate;
34
+ export interface TaskTerminalApi {
35
+ open(request: TaskTerminalTarget & {
36
+ worktreeId?: string;
37
+ size: TaskTerminalSize;
38
+ }): Promise<TaskTerminalSnapshot>;
39
+ write(request: TaskTerminalTarget & {
40
+ data: string;
41
+ }): Promise<void>;
42
+ resize(request: TaskTerminalTarget & {
43
+ size: TaskTerminalSize;
44
+ }): Promise<void>;
45
+ close(request: TaskTerminalTarget): Promise<void>;
46
+ onEvent(listener: (event: TaskTerminalEvent) => void): () => void;
47
+ onState(listener: (state: TaskTerminalState) => void): () => void;
48
+ }
@@ -0,0 +1,60 @@
1
+ export interface TeamMemberState {
2
+ memberRunId: string;
3
+ memberId: string;
4
+ threadId: string;
5
+ status: string;
6
+ displayName: string;
7
+ finalText?: string;
8
+ error?: string;
9
+ createdAt: string;
10
+ completedAt?: string;
11
+ closedAt?: string;
12
+ }
13
+ export interface TeamTaskState {
14
+ workflowTaskId: string;
15
+ teamRunId: string;
16
+ subject: string;
17
+ description: string;
18
+ ownerMemberId: string;
19
+ blockedBy: string[];
20
+ status: string;
21
+ revision: number;
22
+ }
23
+ export interface TeamState {
24
+ teamRunId: string;
25
+ taskSnapshotHash: string;
26
+ status: string;
27
+ ownerAvailable: boolean;
28
+ members: TeamMemberState[];
29
+ tasks: TeamTaskState[];
30
+ }
31
+ export type TeamCommand = {
32
+ action: 'task.create';
33
+ subject: string;
34
+ description: string;
35
+ ownerMemberId: string;
36
+ blockedBy?: string[];
37
+ } | {
38
+ action: 'task.update';
39
+ taskId: string;
40
+ expectedRevision: number;
41
+ status: 'pending' | 'in_progress' | 'completed' | 'failed' | 'cancelled';
42
+ } | {
43
+ action: 'delegate' | 'followUp';
44
+ memberId: string;
45
+ taskId: string;
46
+ message: string;
47
+ } | {
48
+ action: 'wait';
49
+ memberIds: string[];
50
+ } | {
51
+ action: 'stop' | 'close';
52
+ memberId: string;
53
+ };
54
+ export interface TeamCommandResult {
55
+ success: boolean;
56
+ contentItems: Array<{
57
+ type: string;
58
+ text: string;
59
+ }>;
60
+ }
@@ -0,0 +1,18 @@
1
+ type RecordValue = Record<string, unknown>;
2
+ export type ToolActivityCategory = 'file' | 'browser' | 'command' | 'mcp';
3
+ export interface ToolActivityTitle {
4
+ title: string;
5
+ category?: ToolActivityCategory;
6
+ }
7
+ export interface ToolDisplayIdentity {
8
+ provider?: string;
9
+ operation?: string;
10
+ external?: boolean;
11
+ }
12
+ export declare function activityRecord(value: unknown): RecordValue;
13
+ /** Strip URL credentials, queries and fragments before shortening; never display script/body contents. */
14
+ export declare function safeActivityText(value: string): string;
15
+ /** Exact known namespaces only. A third-party tool called read_file is not our file tool. */
16
+ export declare function activityToolName(payload: RecordValue): string;
17
+ export declare function toolActivityTitle(payload: RecordValue, language?: 'zh-CN' | 'en-US', identity?: ToolDisplayIdentity, protect?: (value: string) => string): ToolActivityTitle | undefined;
18
+ export {};
@@ -0,0 +1,65 @@
1
+ export type ClientReleasePlatform = 'WINDOWS' | 'MACOS_INTEL' | 'MACOS_APPLE_SILICON' | 'LINUX_X64' | 'LINUX_ARM64';
2
+ export type ClientReleaseChannel = 'STABLE' | 'BETA' | 'CANARY';
3
+ export type ClientUpdateReason = 'NO_RELEASE' | 'UP_TO_DATE' | 'UPDATE_AVAILABLE' | 'DOWNGRADE_AVAILABLE' | 'ROLLOUT_HOLD' | 'RELEASE_NOT_READY';
4
+ export interface ClientUpdateCheckRequest {
5
+ platform: ClientReleasePlatform;
6
+ architecture: string;
7
+ currentVersion: string;
8
+ currentBuildNumber: number;
9
+ osVersion: string;
10
+ channel: ClientReleaseChannel;
11
+ installationId: string;
12
+ }
13
+ export interface ClientUpdateRelease {
14
+ platform: ClientReleasePlatform;
15
+ version: string;
16
+ buildNumber: number;
17
+ channel: ClientReleaseChannel;
18
+ releaseNotes?: string | null;
19
+ minimumOsVersion?: string | null;
20
+ publishedAt?: string | null;
21
+ activatedAt?: string | null;
22
+ }
23
+ export interface ClientUpdatePackage {
24
+ type: 'FULL' | 'DELTA';
25
+ fromBuildNumber?: number | null;
26
+ downloadUrl: string;
27
+ fileSizeBytes: number;
28
+ checksumSha256: string;
29
+ signature: string;
30
+ signatureAlgorithm: string;
31
+ }
32
+ export interface ClientUpdateCheckResult {
33
+ updateAvailable: boolean;
34
+ required: boolean;
35
+ downgrade: boolean;
36
+ reason: ClientUpdateReason;
37
+ checkAfterSeconds: number;
38
+ release?: ClientUpdateRelease | null;
39
+ updatePackage?: ClientUpdatePackage | null;
40
+ }
41
+ export type DesktopUpdateStatus = 'idle' | 'checking' | 'up-to-date' | 'available' | 'downloading' | 'downloaded' | 'installing' | 'error';
42
+ export interface DesktopUpdateState {
43
+ status: DesktopUpdateStatus;
44
+ currentVersion: string;
45
+ currentBuildNumber: number;
46
+ canInstallAutomatically: boolean;
47
+ osSupported?: boolean;
48
+ osCompatibilityMessage?: string;
49
+ checkedAt?: string;
50
+ result?: ClientUpdateCheckResult;
51
+ progressPercent?: number;
52
+ bytesDownloaded?: number;
53
+ totalBytes?: number;
54
+ deferredUntil?: string;
55
+ error?: string;
56
+ }
57
+ export interface DesktopUpdatesApi {
58
+ getState: () => Promise<DesktopUpdateState>;
59
+ check: () => Promise<DesktopUpdateState>;
60
+ download: () => Promise<DesktopUpdateState>;
61
+ install: () => Promise<void>;
62
+ defer: () => Promise<DesktopUpdateState>;
63
+ openDownloadPage: () => Promise<void>;
64
+ onStateChanged: (listener: (state: DesktopUpdateState) => void) => () => void;
65
+ }
@@ -0,0 +1,18 @@
1
+ export interface UsageStatisticsDay {
2
+ date: string;
3
+ callCount: number;
4
+ totalTokens: number;
5
+ }
6
+ export interface UsageStatisticsModelDay extends UsageStatisticsDay {
7
+ modelName: string | null;
8
+ }
9
+ export interface PersonalUsageStatistics {
10
+ totalTokens: number;
11
+ days: UsageStatisticsDay[];
12
+ modelDays: UsageStatisticsModelDay[];
13
+ }
14
+ export interface UsageStatisticsApi {
15
+ getStatistics: (query: {
16
+ endDate: string;
17
+ }) => Promise<PersonalUsageStatistics>;
18
+ }
@@ -0,0 +1,188 @@
1
+ import type { GitCheckout, GitFailure, GitResult, GitTarget, RepositoryCommand } from './git-api.js';
2
+ import type { LocalTask } from './local-task-api.js';
3
+ import type { LocalEnvironmentFile } from './local-environment-api.js';
4
+ export interface WorktreeSettings {
5
+ rootDirectory: string;
6
+ fetchBeforeCreate: boolean;
7
+ automaticCleanup?: boolean;
8
+ retainedCount?: number;
9
+ }
10
+ export declare const DEFAULT_WORKTREE_SETTINGS: WorktreeSettings;
11
+ export interface WorktreeScript {
12
+ common: string;
13
+ darwin?: string;
14
+ linux?: string;
15
+ win32?: string;
16
+ }
17
+ export interface WorktreeEnvironment {
18
+ version: 1;
19
+ id: string;
20
+ repositoryId: string;
21
+ ownerUserId: string;
22
+ name: string;
23
+ setup: WorktreeScript;
24
+ cleanup?: WorktreeScript;
25
+ actions?: Array<{
26
+ id: string;
27
+ name: string;
28
+ script: WorktreeScript;
29
+ platform?: 'darwin' | 'linux' | 'win32';
30
+ }>;
31
+ }
32
+ export interface SaveWorktreeEnvironmentRequest {
33
+ taskId: string;
34
+ checkoutId: string;
35
+ id?: string;
36
+ name: string;
37
+ setup: WorktreeScript;
38
+ cleanup?: WorktreeScript;
39
+ actions?: WorktreeEnvironment['actions'];
40
+ }
41
+ export interface WorktreeAssociation {
42
+ taskId: string;
43
+ kind: 'default' | 'attachment';
44
+ }
45
+ export interface ManagedWorktree {
46
+ version: 1;
47
+ id: string;
48
+ ownerUserId: string;
49
+ projectId?: string;
50
+ repositoryId: string;
51
+ sourcePath: string;
52
+ commonGitDir: string;
53
+ path: string;
54
+ name: string;
55
+ head: string;
56
+ createdAt: string;
57
+ operationId: string;
58
+ state: 'ready' | 'initialization-failed' | 'archived';
59
+ associations: WorktreeAssociation[];
60
+ environmentId?: string;
61
+ retained?: boolean;
62
+ snapshot?: WorktreeSnapshot;
63
+ projectRelativePath?: string;
64
+ sourceWorkspacePath?: string;
65
+ localWorkspaceId?: string;
66
+ }
67
+ export interface WorktreeListItem extends ManagedWorktree {
68
+ available: boolean;
69
+ revision?: string;
70
+ tasks: Array<{
71
+ id: string;
72
+ name: string;
73
+ status: LocalTask['status'];
74
+ kind: WorktreeAssociation['kind'];
75
+ }>;
76
+ }
77
+ export interface CreateWorktreeRequest extends GitTarget {
78
+ requestId: string;
79
+ expectedRevision: string;
80
+ ref?: string;
81
+ remote?: string;
82
+ name?: string;
83
+ basis?: 'ref' | 'working-state';
84
+ environmentId?: string;
85
+ includeIgnored?: string[];
86
+ credentialId?: string;
87
+ }
88
+ export type WorktreePhase = 'awaiting-authorization' | 'preparing' | 'fetching' | 'creating' | 'copying' | 'initializing' | 'registering' | 'completed' | 'failed' | 'cancelled' | 'interrupted';
89
+ export type WorktreeCommand = RepositoryCommand;
90
+ export interface WorktreeOperation {
91
+ version: 1;
92
+ id: string;
93
+ worktreeId: string;
94
+ taskId: string;
95
+ ownerUserId: string;
96
+ projectId?: string;
97
+ request: CreateWorktreeRequest;
98
+ source: GitCheckout;
99
+ sourceRef: string;
100
+ head: string;
101
+ path: string;
102
+ name: string;
103
+ phase: WorktreePhase;
104
+ completedSteps: string[];
105
+ createdAt: string;
106
+ updatedAt: string;
107
+ commands: WorktreeCommand[];
108
+ fetchRemote?: string;
109
+ environment?: WorktreeEnvironment;
110
+ registered: boolean;
111
+ directoryCreated: boolean;
112
+ defaultCwdChanged: false;
113
+ error?: GitFailure;
114
+ projectRelativePath?: string;
115
+ sourceWorkspacePath?: string;
116
+ localEnvironment?: LocalEnvironmentFile;
117
+ }
118
+ export interface WorktreeSnapshot {
119
+ commit: string;
120
+ tree: string;
121
+ parent: string;
122
+ ref: string;
123
+ createdAt: string;
124
+ includedIgnored: string[];
125
+ }
126
+ export interface WorktreeLifecycleRequest {
127
+ taskId?: string;
128
+ worktreeId: string;
129
+ requestId: string;
130
+ action: 'archive' | 'restore' | 'environment-action';
131
+ expectedRevision?: string;
132
+ includeIgnored?: string[];
133
+ actionId?: string;
134
+ confirmed?: boolean;
135
+ }
136
+ export interface WorktreeLifecycleOperation {
137
+ version: 1;
138
+ id: string;
139
+ ownerUserId: string;
140
+ request: WorktreeLifecycleRequest;
141
+ worktree: ManagedWorktree;
142
+ phase: 'awaiting-authorization' | 'snapshotting' | 'removing' | 'restoring' | 'initializing' | 'completed' | 'failed' | 'interrupted';
143
+ commands: RepositoryCommand[];
144
+ filePaths: string[];
145
+ completedSteps: string[];
146
+ createdAt: string;
147
+ updatedAt: string;
148
+ snapshot?: WorktreeSnapshot;
149
+ error?: GitFailure;
150
+ automaticCleanup?: boolean;
151
+ }
152
+ export interface WorktreeApi {
153
+ list(taskId?: string): Promise<GitResult<WorktreeListItem[]>>;
154
+ status(request: {
155
+ taskId: string;
156
+ operationId: string;
157
+ }): Promise<GitResult<WorktreeOperation>>;
158
+ cancel(request: {
159
+ taskId: string;
160
+ operationId: string;
161
+ }): Promise<GitResult<WorktreeOperation>>;
162
+ newTask(request: {
163
+ taskId?: string;
164
+ worktreeId: string;
165
+ name?: string;
166
+ }): Promise<GitResult<LocalTask>>;
167
+ listEnvironments(target: GitTarget): Promise<GitResult<WorktreeEnvironment[]>>;
168
+ saveEnvironment(request: SaveWorktreeEnvironmentRequest): Promise<GitResult<WorktreeEnvironment>>;
169
+ removeEnvironment(request: {
170
+ taskId: string;
171
+ checkoutId: string;
172
+ id: string;
173
+ }): Promise<GitResult<void>>;
174
+ prepareLifecycle(request: WorktreeLifecycleRequest): Promise<GitResult<WorktreeLifecycleOperation>>;
175
+ executeLifecycle(request: {
176
+ taskId?: string;
177
+ operationId: string;
178
+ }): Promise<GitResult<WorktreeLifecycleOperation>>;
179
+ lifecycleStatus(request: {
180
+ taskId?: string;
181
+ operationId: string;
182
+ }): Promise<GitResult<WorktreeLifecycleOperation>>;
183
+ retain(request: {
184
+ taskId?: string;
185
+ worktreeId: string;
186
+ retained: boolean;
187
+ }): Promise<GitResult<void>>;
188
+ }