@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,43 @@
1
+ import type { ServiceTransport } from './transport.js';
2
+ import type { AuthorizationEvents } from './authorization-events.js';
3
+ import type { AuthTokens, LoginRequest, LoginResult, AuthStatus, BrowserLoginOptions, BrowserLoginStatus } from './types.js';
4
+ import type { AuthSession, AuthRequiredPasswordChangeRequest, AuthSwitchSubjectRequest, LoginContext } from '../../shared/desktop-api.js';
5
+ export declare class AuthApi {
6
+ private readonly connection;
7
+ private readonly authorizationEvents?;
8
+ constructor(connection: () => ServiceTransport, authorizationEvents?: (() => AuthorizationEvents | undefined) | undefined);
9
+ /** Owner-only, in-memory notifications. Cancelling observation never revokes authorization. */
10
+ managedEvents(options?: {
11
+ after?: string;
12
+ signal?: AbortSignal;
13
+ }): AsyncIterable<import("./types.js").ManagedAuthorizationEvent>;
14
+ login(request: LoginRequest): Promise<LoginResult>;
15
+ getToken(): Promise<AuthTokens>;
16
+ refresh(): Promise<AuthTokens>;
17
+ /** Ask the application's provider for fresh credentials; no tokens are returned. */
18
+ refreshManaged(): Promise<AuthSession>;
19
+ revokeManaged(): Promise<void>;
20
+ status(): Promise<AuthStatus>;
21
+ context(): Promise<LoginContext | null>;
22
+ logout(): Promise<void>;
23
+ completePasswordChange(request: AuthRequiredPasswordChangeRequest): Promise<LoginResult>;
24
+ switchSubject(request: AuthSwitchSubjectRequest): Promise<AuthSession>;
25
+ startBrowserLogin(options?: BrowserLoginOptions): Promise<BrowserLogin>;
26
+ resumeBrowserLogin(requestId: string): BrowserLogin;
27
+ }
28
+ /** The application opens the URL. No Electron or OS browser launcher is required. */
29
+ export declare class BrowserLogin {
30
+ private readonly transport;
31
+ readonly id: string;
32
+ constructor(transport: ServiceTransport, id: string);
33
+ status(): Promise<BrowserLoginStatus>;
34
+ cancel(): Promise<BrowserLoginStatus>;
35
+ getAuthorizationUrl(options?: {
36
+ signal?: AbortSignal;
37
+ }): Promise<string>;
38
+ /** Aborting the wait leaves the authorization active; cancel() explicitly revokes it. */
39
+ wait(options?: {
40
+ signal?: AbortSignal;
41
+ }): Promise<AuthSession>;
42
+ private checkFailure;
43
+ }
@@ -0,0 +1,16 @@
1
+ import { type ManagedAuthorizationEvent } from '../../shared/managed-authorization.js';
2
+ /** In-memory owner notifications; never store credentials or callback error text. */
3
+ export declare class AuthorizationEvents {
4
+ private readonly id;
5
+ private sequence;
6
+ private readonly records;
7
+ private readonly listeners;
8
+ private closed;
9
+ publish(value: Omit<ManagedAuthorizationEvent, 'cursor' | 'occurredAt'>): void;
10
+ close(): void;
11
+ private wake;
12
+ stream(options?: {
13
+ after?: string;
14
+ signal?: AbortSignal;
15
+ }): AsyncIterable<ManagedAuthorizationEvent>;
16
+ }
@@ -0,0 +1,10 @@
1
+ export interface SessionAuthorizationRequest {
2
+ method: string;
3
+ sessionId?: string;
4
+ scope?: string;
5
+ runId?: string;
6
+ }
7
+ /** An application policy, independent of platform account and model credentials. */
8
+ export type SessionAuthorizer = (request: Readonly<SessionAuthorizationRequest>, context: {
9
+ signal: AbortSignal;
10
+ }) => boolean | Promise<boolean>;
@@ -0,0 +1,9 @@
1
+ export interface CommunicationOptions {
2
+ startupTimeoutMs?: number;
3
+ /** Observation only. A timeout never cancels or retries the task. Zero disables the timer. */
4
+ rpcTimeoutMs?: number;
5
+ methodTimeoutMs?: Record<string, number>;
6
+ shutdownTimeoutMs?: number;
7
+ }
8
+ export declare function validateCommunication(value?: CommunicationOptions): void;
9
+ export declare function rpcTimeout(method: string, options?: CommunicationOptions): number;
@@ -0,0 +1,24 @@
1
+ import type { ServiceTransport } from './transport.js';
2
+ export interface DiagnosticRecord {
3
+ name: 'sdk.rpc';
4
+ method: string;
5
+ requestId: string;
6
+ phase: 'started' | 'completed' | 'failed';
7
+ durationMs?: number;
8
+ errorCode?: string;
9
+ }
10
+ export interface DiagnosticSink {
11
+ log?(record: Readonly<DiagnosticRecord>): void;
12
+ metric?(name: 'sdk.rpc.duration_ms', value: number, labels: {
13
+ method: string;
14
+ outcome: 'completed' | 'failed';
15
+ }): void;
16
+ startSpan?(name: 'sdk.rpc', attributes: {
17
+ method: string;
18
+ requestId: string;
19
+ }): {
20
+ end(record: Readonly<DiagnosticRecord>): void;
21
+ };
22
+ }
23
+ /** Diagnostic exporters never receive credentials, prompts, arguments or error messages. */
24
+ export declare function instrumentTransport(transport: ServiceTransport, sink?: DiagnosticSink): ServiceTransport;
@@ -0,0 +1,4 @@
1
+ export declare class AiosSdkError extends Error {
2
+ readonly code: string;
3
+ constructor(code: string, message: string, options?: ErrorOptions);
4
+ }
@@ -0,0 +1,4 @@
1
+ /** Browser-safe presentation helpers; importing this entry never starts a runtime. */
2
+ export { toolActivityTitle } from '../../shared/tool-activity.js';
3
+ export type { ToolActivityTitle, ToolActivityCategory, ToolDisplayIdentity } from '../../shared/tool-activity.js';
4
+ export type { TaskEvent, SessionEvent, SessionEventPage, TaskMessage, TaskInteraction, RunState } from './types.js';
@@ -0,0 +1,29 @@
1
+ import type { ServiceTransport } from './transport.js';
2
+ import type { FileReference, FileStorageAdapter, StoredFileReference } from './file-storage.js';
3
+ export declare class SessionFiles {
4
+ private readonly transport;
5
+ private readonly sessionId;
6
+ constructor(transport: ServiceTransport, sessionId: string);
7
+ resolve(path: string, access?: 'read' | 'write', signal?: AbortSignal): Promise<FileReference>;
8
+ private call;
9
+ export(path: string, adapter: FileStorageAdapter, options: {
10
+ key: string;
11
+ expectedVersion?: string;
12
+ signal?: AbortSignal;
13
+ }): Promise<{
14
+ stored: StoredFileReference;
15
+ file: FileReference;
16
+ sha256: string;
17
+ bytes: number;
18
+ }>;
19
+ import(reference: StoredFileReference, adapter: FileStorageAdapter, options: {
20
+ path: string;
21
+ expectedVersion: string | null;
22
+ signal?: AbortSignal;
23
+ }): Promise<{
24
+ file: FileReference & {
25
+ sha256: string;
26
+ };
27
+ source: StoredFileReference;
28
+ }>;
29
+ }
@@ -0,0 +1,34 @@
1
+ export interface FileReference {
2
+ absolutePath: string;
3
+ toolPath: string;
4
+ workspaceRelativePath?: string;
5
+ access: 'read' | 'write';
6
+ exists: boolean;
7
+ bytes?: number;
8
+ }
9
+ export interface StoredFileReference {
10
+ key: string;
11
+ version: string;
12
+ metadata?: Record<string, string>;
13
+ }
14
+ export interface FileStorageAdapter {
15
+ /** Export immutable bytes; return the object version actually stored. */
16
+ put(request: {
17
+ key: string;
18
+ source: AsyncIterable<Uint8Array>;
19
+ sha256: string;
20
+ bytes: number;
21
+ expectedVersion?: string;
22
+ signal?: AbortSignal;
23
+ }): Promise<StoredFileReference>;
24
+ /** Fetch an explicit version, never silently return the latest version. */
25
+ get(request: {
26
+ key: string;
27
+ version: string;
28
+ signal?: AbortSignal;
29
+ }): Promise<{
30
+ source: AsyncIterable<Uint8Array>;
31
+ sha256: string;
32
+ bytes: number;
33
+ }>;
34
+ }
@@ -0,0 +1,260 @@
1
+ import { type ServiceTransport } from './transport.js';
2
+ import type { CliConnectionOptions, ClientServices } from './types.js';
3
+ import { serveBusinessTools } from './tool-server.js';
4
+ import { SessionFiles } from './file-api.js';
5
+ export type { ToolLifecycleEvent, ToolHookDecision } from '../../shared/js-agent-hooks.js';
6
+ export type { SessionAuthorizer, SessionAuthorizationRequest } from './authorization.js';
7
+ export type { MemoryConfiguration, MemoryExtractionPolicy, MemorySnapshot, MemoryStoreAdapter } from '../../shared/memory-customization.js';
8
+ export type { DiagnosticSink, DiagnosticRecord } from './diagnostics.js';
9
+ export type { CommunicationOptions } from './communication.js';
10
+ export type { FileReference, StoredFileReference, FileStorageAdapter } from './file-storage.js';
11
+ export { applicationToolProviderId, applicationToolReference } from './tool-reference.js';
12
+ import { AuthApi } from './auth.js';
13
+ import { PlatformApi } from './platform.js';
14
+ import { ManagedHost } from './managed-host.js';
15
+ import type { AgentDefinition, CapabilityQuery, ClientOptions, ClientConfiguration, ConfigurationUpdate, EffectiveCapability, ExecutionDefaults, LocalPreferences, LocalPreferenceDomain, RunState, SendOptions, SessionInfo, TaskEvent } from './types.js';
16
+ export * from './types.js';
17
+ export type { CompactionPolicy, RuntimeTuning, GenerationOptions, GenerationCapabilities } from '../../shared/runtime-tuning.js';
18
+ export * from './runtime-control.js';
19
+ export { ManagedHost } from './managed-host.js';
20
+ export type { VerifiedRuntime } from './runtime-integrity.js';
21
+ export { toolResult } from './tool-result.js';
22
+ export type { ToolResult, ToolContent } from './tool-result.js';
23
+ export { AiosSdkError } from './errors.js';
24
+ export { AuthApi, BrowserLogin } from './auth.js';
25
+ export { PlatformApi } from './platform.js';
26
+ export { validateSdkRuntimeDirectory as validateRuntime } from './runtime-integrity.js';
27
+ export declare class AiosClient {
28
+ private transport;
29
+ private options;
30
+ readonly mode: ClientOptions['mode'];
31
+ private readonly services;
32
+ private readonly toolProviders;
33
+ private readonly activeToolProviders;
34
+ private credentialProvider?;
35
+ private callbacks?;
36
+ private readonly callbackHandlers;
37
+ private lifecycleQueue;
38
+ private closed;
39
+ private scheduleLifecycle;
40
+ private assertOpen;
41
+ private startCallbacks;
42
+ private constructor();
43
+ private static start;
44
+ static create(input: ClientOptions, services?: ClientServices): Promise<AiosClient>;
45
+ static startManaged(input: ClientOptions, lifecycle: import('./runtime-control.js').ManagedHostOptions): Promise<ManagedHost>;
46
+ static connectCli(options: CliConnectionOptions): Promise<AiosClient>;
47
+ readonly auth: AuthApi;
48
+ readonly platform: PlatformApi;
49
+ readonly runtime: {
50
+ health: (signal?: AbortSignal) => Promise<import("./runtime-control.js").RuntimeHealth>;
51
+ activity: () => Promise<import("./runtime-control.js").RuntimeActivity>;
52
+ drain: (options: import("./runtime-control.js").DrainOptions, signal?: AbortSignal) => Promise<import("./runtime-control.js").DrainResult>;
53
+ };
54
+ readonly resources: {
55
+ limits: {
56
+ get: () => Promise<import("../../cli/daemon/resource-limits.js").ResourceSettings>;
57
+ set: <K extends import("./runtime-control.js").RuntimeLimitKey>(key: K, value: import("./runtime-control.js").RuntimeLimits["values"][K] | undefined, revision: number) => Promise<import("../../cli/daemon/resource-limits.js").ResourceSettings>;
58
+ };
59
+ cache: {
60
+ status: () => Promise<import("./runtime-control.js").RuntimeCacheStatus>;
61
+ prune: (options?: {
62
+ apply?: boolean;
63
+ revision?: string;
64
+ }) => Promise<import("./runtime-control.js").RuntimeCachePruneResult>;
65
+ };
66
+ };
67
+ readonly skills: {
68
+ list: () => Promise<import("./types.js").LocalSkillDefinition[]>;
69
+ /** Installs an additive immutable package version; does not change task selections. */
70
+ importVersion: (request: {
71
+ packagePath: string;
72
+ folderName: string;
73
+ packageSha256: string;
74
+ }) => Promise<import("./types.js").LocalSkillDefinition>;
75
+ importPaths: (paths: string[]) => Promise<import("./types.js").LocalSkillDefinition[]>;
76
+ remove: (reference: string) => Promise<void>;
77
+ };
78
+ readonly plugins: {
79
+ list: () => Promise<import("./types.js").LocalPluginInstallation[]>;
80
+ install: (recordId: string, source: "PLATFORM" | "ENTERPRISE") => Promise<import("./types.js").LocalPluginInstallation>;
81
+ update: (pluginId: string, recordId: string, expectedRevision: string) => Promise<import("./types.js").PluginUpdateResult>;
82
+ setEnabled: (pluginId: string, enabled: boolean, expectedRevision: string) => Promise<import("./types.js").LocalPluginInstallation>;
83
+ remove: (pluginId: string, expectedRevision: string) => Promise<void>;
84
+ };
85
+ readonly settings: {
86
+ get: () => Promise<import("../../cli/daemon/preferences.js").Preferences>;
87
+ set: <K extends LocalPreferenceDomain>(domain: K, value: LocalPreferences[K], revision: number) => Promise<import("../../cli/daemon/preferences.js").Preferences>;
88
+ };
89
+ readonly native: {
90
+ settings: () => Promise<import("./native-status.js").NativeSettings>;
91
+ configure: (value: import("./types.js").ComputerUseSettings, revision: number) => Promise<import("./native-status.js").NativeSettings>;
92
+ status: (kind: "computer" | "browser") => Promise<import("./native-status.js").NativeCapabilityStatus>;
93
+ registerBrowser: () => Promise<unknown>;
94
+ unregisterBrowser: () => Promise<unknown>;
95
+ };
96
+ readonly memory: import('./types.js').SessionMemoryApi;
97
+ setPlatformBaseUrl(url: string): Promise<void>;
98
+ getConfiguration(): Promise<ClientConfiguration>;
99
+ /** Runtime settings require exclusive idle ownership. Reopen sessions and register agents afterwards. */
100
+ configure(patch: ConfigurationUpdate): Promise<ClientConfiguration>;
101
+ private applyConfiguration;
102
+ capabilities(query?: CapabilityQuery): Promise<EffectiveCapability[]>;
103
+ dependencies(): Promise<import("../../core/host/runtime-dependencies.js").ResolvedRuntimeDependencies>;
104
+ defineAgent(definition: AgentDefinition): Promise<Agent>;
105
+ private registerAgent;
106
+ openSession(id: string): Promise<Session>;
107
+ /** Reopen an immutable, already defined agent version without replacing its tool registrations. */
108
+ openAgent(id: string, version: string): Promise<Agent>;
109
+ listSessions(query?: {
110
+ scope?: string;
111
+ includeArchived?: boolean;
112
+ }): Promise<SessionInfo[]>;
113
+ shutdown(): Promise<void>;
114
+ close(): Promise<void>;
115
+ private disconnect;
116
+ }
117
+ export declare class Agent {
118
+ private readonly transport;
119
+ readonly id: string;
120
+ readonly version: string;
121
+ private readonly provider?;
122
+ readonly tools: ReadonlyArray<{
123
+ name: string;
124
+ reference: string;
125
+ }>;
126
+ private readonly assertCurrentProvider;
127
+ constructor(transport: ServiceTransport, id: string, version: string, provider?: Awaited<ReturnType<typeof serveBusinessTools>> | undefined, tools?: ReadonlyArray<{
128
+ name: string;
129
+ reference: string;
130
+ }>, assertCurrentProvider?: () => void);
131
+ createSession(options?: import('./types.js').SessionCreateOptions): Promise<Session>;
132
+ adoptSession(id: string, options?: {
133
+ policy?: import('./types.js').SessionScopePolicy;
134
+ }): Promise<Session>;
135
+ providerStatus(): Promise<import("./types.js").ProviderStatus>;
136
+ /** Removes registration for future turns. Existing calls finish or use their normal cancellation path. */
137
+ unregisterProvider(): Promise<import("./types.js").ProviderStatus>;
138
+ /** Stop new MCP sessions; existing sessions and calls drain before the HTTP server closes. */
139
+ releaseProvider(): Promise<{
140
+ retired: boolean;
141
+ sessions: number;
142
+ calls: number;
143
+ closing: boolean;
144
+ } | undefined>;
145
+ waitProviderClosed(): Promise<void>;
146
+ }
147
+ export declare class Session {
148
+ private readonly transport;
149
+ readonly info: SessionInfo;
150
+ readonly id: string;
151
+ readonly files: SessionFiles;
152
+ runtimeTuning(): Promise<import("../../shared/runtime-tuning.js").RuntimeTuningState>;
153
+ constructor(transport: ServiceTransport, info: SessionInfo);
154
+ readonly memory: {
155
+ get: (request?: {
156
+ page?: number;
157
+ }) => Promise<import("./types.js").MemoryView>;
158
+ edit: (request: Omit<import("./types.js").MemoryEditRequest, "sessionId">) => Promise<import("./types.js").MemoryView>;
159
+ reset: () => Promise<import("./types.js").MemoryView>;
160
+ setEnabled: (enabled: boolean) => Promise<import("./types.js").MemoryView>;
161
+ };
162
+ send(content: string, options?: SendOptions): Promise<Run>;
163
+ enqueue(content: string, options?: SendOptions): Promise<import("../../shared/local-task-command.js").LocalTaskCommandResult>;
164
+ queue(): Promise<import("./types.js").QueueSnapshot>;
165
+ editQueued(messageId: string, content: string, queueVersion: string, commandId?: string): Promise<import("../../shared/local-task-command.js").LocalTaskCommandResult>;
166
+ removeQueued(messageId: string, snapshot: Pick<import('./types.js').QueueSnapshot, 'queueVersion' | 'activeRunId'>, commandId?: string): Promise<import("../../shared/local-task-command.js").LocalTaskCommandResult>;
167
+ reorderQueue(messageIds: string[], queueVersion: string, commandId?: string): Promise<import("../../shared/local-task-command.js").LocalTaskCommandResult>;
168
+ /** A non-null targetRunId adds this message to that active run; null starts its own run. */
169
+ dispatchQueued(messageId: string, queueVersion: string, targetRunId: string | null, commandId?: string): Promise<import("../../shared/local-task-command.js").LocalTaskCommandResult>;
170
+ history(): Promise<import("../../shared/local-task-api.js").LocalTaskMessage[]>;
171
+ rename(name: string, expectedRevision: string): Promise<SessionInfo>;
172
+ setArchived(archived: boolean, expectedRevision: string): Promise<SessionInfo>;
173
+ runs(query?: import('./types.js').RunQuery, signal?: AbortSignal): Promise<import("./types.js").RunPage>;
174
+ /** Durable execution events across runs. Aborting this observer never cancels a task. */
175
+ events(options?: import('./types.js').EventObservationOptions): AsyncGenerator<import('./types.js').SessionEvent>;
176
+ eventPage(options?: {
177
+ cursor?: string;
178
+ signal?: AbortSignal;
179
+ }): Promise<import("./types.js").SessionEventPage>;
180
+ queryHistory(query?: import('./types.js').HistoryQuery): Promise<import("./types.js").HistoryPage>;
181
+ clear(options: {
182
+ historyVersion: string;
183
+ cancelActive?: boolean;
184
+ }): Promise<SessionInfo>;
185
+ delete(options: {
186
+ historyVersion: string;
187
+ cancelActive?: boolean;
188
+ }): Promise<{
189
+ retainedWorkspace?: string;
190
+ }>;
191
+ artifacts(query?: import('./types.js').ArtifactQuery, options?: {
192
+ signal?: AbortSignal;
193
+ }): Promise<import("./types.js").SessionArtifact[]>;
194
+ operations(query?: {
195
+ runId?: string;
196
+ }): Promise<import("./types.js").TaskOperationReference[]>;
197
+ teamState(): Promise<import("./types.js").TeamState | null>;
198
+ /** Independent Session: send explicitly; the parent neither waits for it nor cancels it. */
199
+ createBackgroundSession(memberId: string, creationId?: string): Promise<Session>;
200
+ operation(operationId: string, options?: {
201
+ signal?: AbortSignal;
202
+ }): Promise<import("./types.js").TaskOperationSnapshot>;
203
+ cancelOperation(operationId: string, options?: {
204
+ signal?: AbortSignal;
205
+ }): Promise<import("./types.js").TaskOperationSnapshot>;
206
+ configuration(revision?: number): Promise<import("./types.js").SessionConfiguration>;
207
+ configure(defaults: Partial<Omit<ExecutionDefaults, 'contextWindow' | 'reasoningEffort' | 'runtimeTuning'>> & {
208
+ contextWindow?: number | null;
209
+ reasoningEffort?: ExecutionDefaults['reasoningEffort'] | null;
210
+ runtimeTuning?: ExecutionDefaults['runtimeTuning'] | null;
211
+ }, expectedRevision?: number): Promise<ExecutionDefaults>;
212
+ configureBuiltins(builtins: import('./types.js').BuiltinSelection, expectedRevision?: number): Promise<void>;
213
+ /** Applies a registered agent version at the target session's idle boundary, preserving its history. */
214
+ updateAgent(update: import('./types.js').SessionAgentUpdate): Promise<import("./types.js").SessionConfiguration>;
215
+ receipt(commandId: string): Promise<import("./types.js").CommandReceipt>;
216
+ resumeRun(runId: string): Run;
217
+ compact(commandId?: string): Promise<Run>;
218
+ }
219
+ export declare class Run {
220
+ private readonly transport;
221
+ readonly taskId: string;
222
+ readonly id: string;
223
+ readonly commandId?: string | undefined;
224
+ constructor(transport: ServiceTransport, taskId: string, id: string, commandId?: string | undefined);
225
+ state(options?: {
226
+ signal?: AbortSignal;
227
+ }): Promise<RunState>;
228
+ context(): Promise<import("./types.js").ExecutionBinding | null>;
229
+ memoryPolicy(): Promise<import("./types.js").SessionMemoryPolicy | null>;
230
+ team(command: import('./types.js').TeamCommand, options?: {
231
+ signal?: AbortSignal;
232
+ }): Promise<import("./types.js").TeamCommandResult>;
233
+ artifacts(query?: Omit<import('./types.js').ArtifactQuery, 'runId'>, options?: {
234
+ signal?: AbortSignal;
235
+ }): Promise<import("./types.js").SessionArtifact[]>;
236
+ operations(): Promise<import("./types.js").TaskOperationReference[]>;
237
+ operation(operationId: string, options?: {
238
+ signal?: AbortSignal;
239
+ }): Promise<import("./types.js").TaskOperationSnapshot>;
240
+ cancelOperation(operationId: string, options?: {
241
+ signal?: AbortSignal;
242
+ }): Promise<import("./types.js").TaskOperationSnapshot>;
243
+ cancel(commandId?: string): Promise<void>;
244
+ detach(): Promise<void>;
245
+ approve(toolCallId: string, decision: 'approve' | 'approve_for_session' | 'deny', commandId?: string): Promise<void>;
246
+ answer(requestId: string, response: Record<string, unknown>, commandId?: string): Promise<void>;
247
+ cancelInput(requestId: string, commandId?: string): Promise<void>;
248
+ confirmPlan(commandId?: string): Promise<Run>;
249
+ /** Aborting observation never sends task cancellation. */
250
+ events(options?: {
251
+ cursor?: string;
252
+ signal?: AbortSignal;
253
+ }): AsyncGenerator<TaskEvent>;
254
+ wait(options?: {
255
+ signal?: AbortSignal;
256
+ }): Promise<RunState>;
257
+ }
258
+ export declare const createClient: typeof AiosClient.create;
259
+ export declare const connectCli: typeof AiosClient.connectCli;
260
+ export declare const startManagedHost: typeof AiosClient.startManaged;
@@ -0,0 +1,9 @@
1
+ import { type DaemonMetadata } from '../../cli/daemon/protocol.js';
2
+ export interface SdkServiceMetadata extends DaemonMetadata {
3
+ sdkProtocol: 1;
4
+ manifestSha256?: string;
5
+ }
6
+ export declare function readCliService(root: string): DaemonMetadata;
7
+ export declare function readSdkService(root: string): SdkServiceMetadata | undefined;
8
+ export declare function waitSdkService(root: string, signal: AbortSignal): Promise<SdkServiceMetadata>;
9
+ export declare function callSdkService<T>(metadata: DaemonMetadata, clientId: string, method: string, params: unknown, requestId: string, signal?: AbortSignal, timeoutMs?: number): Promise<T>;
@@ -0,0 +1,32 @@
1
+ import type { AiosClient } from './index.js';
2
+ import type { ClientOptions, ClientServices, ResolvedClientOptions } from './types.js';
3
+ import type { DrainResult, HostExit, ManagedHostOptions } from './runtime-control.js';
4
+ import type { SdkServiceMetadata } from './local-connection.js';
5
+ import { type VerifiedRuntime } from './runtime-integrity.js';
6
+ type Connect = (options: ResolvedClientOptions, metadata: SdkServiceMetadata, verified: VerifiedRuntime, services: ClientServices, exitSignal: AbortSignal) => Promise<AiosClient>;
7
+ /** Owns one child process. Closing an attached client never closes this handle or the process. */
8
+ export declare class ManagedHost {
9
+ private readonly options;
10
+ private readonly metadata;
11
+ private readonly verified;
12
+ private readonly child;
13
+ private readonly exited;
14
+ private readonly connector;
15
+ private exit?;
16
+ private readonly exitController;
17
+ private shutdownRequest?;
18
+ private readonly pending;
19
+ private constructor();
20
+ /** @internal Use startManagedHost, which supplies the public client connection factory. */
21
+ static start(input: ClientOptions, lifecycle: ManagedHostOptions, connect: Connect): Promise<ManagedHost>;
22
+ get pid(): number;
23
+ get instanceId(): string;
24
+ connect(services?: ClientServices): Promise<AiosClient>;
25
+ /** No observer timeout or implicit kill. The startup shutdown policy controls drain and cancellation. */
26
+ shutdown(): Promise<DrainResult>;
27
+ wait(): Promise<HostExit>;
28
+ private readonly onMessage;
29
+ private readonly onError;
30
+ private readonly onDisconnect;
31
+ }
32
+ export {};
@@ -0,0 +1,59 @@
1
+ import type { ComputerUseSettings } from '../../shared/computer-use-api.js';
2
+ import type { ComputerUseBrowserAction } from '../../shared/computer-use-protocol.js';
3
+ import type { ComputerUsePeerMetadata } from '../../shared/computer-use-handshake.js';
4
+ export interface NativeSettings {
5
+ version: 1;
6
+ revision: number;
7
+ computerUse: ComputerUseSettings;
8
+ }
9
+ export interface NativeHelperStatus {
10
+ running: boolean;
11
+ pid?: number;
12
+ platform: 'darwin' | 'win32' | 'linux';
13
+ executablePath: string;
14
+ executableAvailable: boolean;
15
+ protocolVersion: number;
16
+ protocolValidated: boolean;
17
+ architectureVersion?: number;
18
+ architectureValidated?: boolean;
19
+ invariants?: string[];
20
+ capabilities?: {
21
+ uiAutomation?: boolean;
22
+ screenCapture?: boolean;
23
+ targetIntegrityBoundary?: string;
24
+ uiAutomationError?: string;
25
+ screenCaptureError?: string;
26
+ };
27
+ error?: string;
28
+ }
29
+ export interface NativeRegistrationStatus {
30
+ registered: boolean;
31
+ manifestPath: string;
32
+ extensionDirectory: string;
33
+ error?: string;
34
+ }
35
+ export interface NativeConnectionStatus {
36
+ running: boolean;
37
+ hostConnected: boolean;
38
+ extensionConnected: boolean;
39
+ extensionUserAgent?: string;
40
+ extensionSupportedActions: ComputerUseBrowserAction[];
41
+ protocolVersion: number;
42
+ peers?: Partial<Record<ComputerUsePeerMetadata['role'], ComputerUsePeerMetadata>>;
43
+ native?: NativeHelperStatus;
44
+ lastHeartbeatAt?: string;
45
+ error?: string;
46
+ }
47
+ /** Serialized SDK response; no dependency on an execution host implementation. */
48
+ export interface NativeCapabilityStatus {
49
+ id: string;
50
+ available: boolean;
51
+ reason: string | null;
52
+ configuration: NativeSettings;
53
+ verification?: string;
54
+ helper?: NativeHelperStatus;
55
+ permissions?: unknown;
56
+ extensionId?: string;
57
+ registration?: NativeRegistrationStatus;
58
+ connection?: NativeConnectionStatus;
59
+ }
@@ -0,0 +1,39 @@
1
+ import type { ServiceTransport } from './transport.js';
2
+ import type { AuthSession, PlatformUser, TenantSummary, LoginContext } from '../../shared/desktop-api.js';
3
+ import type { AvailableChatModel } from '../../shared/cloud-assistant-api.js';
4
+ import type { AccountContextQuery, AccountContextSummary, AccountPlanPurchase } from '../../shared/account-context-api.js';
5
+ import type { PersonalUsageStatistics } from '../../shared/usage-statistics-api.js';
6
+ import type { SkillMarketApi } from '../../shared/skill-market-api.js';
7
+ import type { PluginMarketApi } from '../../shared/plugin-market-api.js';
8
+ import type { EnterpriseKnowledgeApi } from '../../shared/enterprise-knowledge-api.js';
9
+ import type { ExpertSelection, PreparedExpertAgent, ResolvedExpertSource } from '../../shared/expert-selection.js';
10
+ /** Explicit platform queries, independent of the model's builtin tool permissions. */
11
+ export declare class PlatformApi {
12
+ private readonly connection;
13
+ constructor(connection: () => ServiceTransport);
14
+ private call;
15
+ getSession(): Promise<AuthSession>;
16
+ getUser(): Promise<PlatformUser>;
17
+ getTenants(): Promise<TenantSummary[]>;
18
+ getContext(): Promise<LoginContext | null>;
19
+ readonly models: {
20
+ list: () => Promise<AvailableChatModel[]>;
21
+ listSpeechRecognition: () => Promise<AvailableChatModel[]>;
22
+ };
23
+ readonly experts: {
24
+ prepare: (selection: ExpertSelection, resolved?: ResolvedExpertSource) => Promise<PreparedExpertAgent>;
25
+ };
26
+ readonly account: {
27
+ getSummary: (query?: AccountContextQuery) => Promise<AccountContextSummary>;
28
+ listPlanPurchases: () => Promise<AccountPlanPurchase[]>;
29
+ getUsage: (query: {
30
+ endDate: string;
31
+ }) => Promise<PersonalUsageStatistics>;
32
+ };
33
+ readonly skills: SkillMarketApi & {
34
+ getVersions: (selection: import('./types.js').SkillVersionSelection) => Promise<import('./types.js').SkillVersionInfo>;
35
+ updateVersion: (request: import('./types.js').SkillVersionUpdate) => Promise<import('./types.js').SkillVersionUpdateResult>;
36
+ };
37
+ readonly plugins: PluginMarketApi;
38
+ readonly knowledge: EnterpriseKnowledgeApi;
39
+ }