@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,111 @@
|
|
|
1
|
+
import type { ResourceSettings, ResourceKey } from '../../cli/daemon/resource-limits.js';
|
|
2
|
+
import type { LocalTaskExecutionState } from '../../shared/local-task-api.js';
|
|
3
|
+
import type { LocalRuntimeTaskState } from '../../shared/local-runtime-api.js';
|
|
4
|
+
import type { DependencyStatus } from './types.js';
|
|
5
|
+
import type { VerifiedRuntime } from './runtime-integrity.js';
|
|
6
|
+
export interface RuntimeHealth {
|
|
7
|
+
ready: boolean;
|
|
8
|
+
sampledAt: string;
|
|
9
|
+
host: {
|
|
10
|
+
pid: number;
|
|
11
|
+
node: string;
|
|
12
|
+
platform: NodeJS.Platform;
|
|
13
|
+
arch: string;
|
|
14
|
+
startedAt: string;
|
|
15
|
+
mode: 'background' | 'managed' | 'embedded' | 'shared-cli';
|
|
16
|
+
};
|
|
17
|
+
versions: {
|
|
18
|
+
sdk: string;
|
|
19
|
+
protocol: number;
|
|
20
|
+
dataFormat: number;
|
|
21
|
+
};
|
|
22
|
+
/** Only present when the launching SDK verified the signed package and every listed file. */
|
|
23
|
+
verifiedPackage?: VerifiedRuntime;
|
|
24
|
+
configurationRevision: string;
|
|
25
|
+
dependencies: DependencyStatus;
|
|
26
|
+
limits: RuntimeLimits;
|
|
27
|
+
activity: RuntimeActivity;
|
|
28
|
+
}
|
|
29
|
+
export interface ManagedHostOptions {
|
|
30
|
+
/** Explicit grace period and timeout action for shutdown, parent disconnect and termination signals. */
|
|
31
|
+
shutdown: DrainOptions;
|
|
32
|
+
}
|
|
33
|
+
export interface HostExit {
|
|
34
|
+
code: number | null;
|
|
35
|
+
signal: NodeJS.Signals | null;
|
|
36
|
+
}
|
|
37
|
+
export type RuntimeLimits = ResourceSettings;
|
|
38
|
+
export type RuntimeLimitKey = ResourceKey;
|
|
39
|
+
export interface RuntimeActivity {
|
|
40
|
+
sampledAt: string;
|
|
41
|
+
phase: 'accepting' | 'draining' | 'drained';
|
|
42
|
+
readyToShutdown: boolean;
|
|
43
|
+
activeRuns: Array<{
|
|
44
|
+
sessionId: string;
|
|
45
|
+
runId: string;
|
|
46
|
+
}>;
|
|
47
|
+
preparations: number;
|
|
48
|
+
mutations: number;
|
|
49
|
+
queuedMessages: number;
|
|
50
|
+
pendingInteractions: number;
|
|
51
|
+
admission: {
|
|
52
|
+
dispatching: boolean;
|
|
53
|
+
deferred: number;
|
|
54
|
+
stopped: boolean;
|
|
55
|
+
};
|
|
56
|
+
memoryBusy: boolean;
|
|
57
|
+
automation: {
|
|
58
|
+
running: boolean;
|
|
59
|
+
scheduled: number;
|
|
60
|
+
};
|
|
61
|
+
operations: number;
|
|
62
|
+
workspaceBusy: boolean;
|
|
63
|
+
browserLogin: boolean;
|
|
64
|
+
runtimes: LocalRuntimeTaskState[];
|
|
65
|
+
executions: Array<LocalTaskExecutionState | import('../../shared/execution-activity.js').OwnedRuntimeActivity>;
|
|
66
|
+
/** Ready engines without activity telemetry cannot be declared idle. */
|
|
67
|
+
unobservedSessions: string[];
|
|
68
|
+
observationErrors: Array<{
|
|
69
|
+
sessionId: string;
|
|
70
|
+
message: string;
|
|
71
|
+
}>;
|
|
72
|
+
controlsPending: number;
|
|
73
|
+
requestOperations: number;
|
|
74
|
+
controlErrors: Array<{
|
|
75
|
+
operation: string;
|
|
76
|
+
message: string;
|
|
77
|
+
}>;
|
|
78
|
+
}
|
|
79
|
+
export type DrainOptions = {
|
|
80
|
+
timeoutMs: number;
|
|
81
|
+
} & ({
|
|
82
|
+
onTimeout: 'return';
|
|
83
|
+
} | {
|
|
84
|
+
onTimeout: 'cancel';
|
|
85
|
+
cancelTimeoutMs: number;
|
|
86
|
+
});
|
|
87
|
+
export interface DrainResult {
|
|
88
|
+
status: 'drained' | 'timed_out' | 'failed';
|
|
89
|
+
cancellationRequested: boolean;
|
|
90
|
+
activity: RuntimeActivity;
|
|
91
|
+
}
|
|
92
|
+
export interface RuntimeCacheStatus {
|
|
93
|
+
entries: Array<{
|
|
94
|
+
path: string;
|
|
95
|
+
bytes: number;
|
|
96
|
+
files: number;
|
|
97
|
+
fingerprint: string;
|
|
98
|
+
eligible: boolean;
|
|
99
|
+
reason?: string;
|
|
100
|
+
}>;
|
|
101
|
+
bytes: number;
|
|
102
|
+
maximumBytes: number;
|
|
103
|
+
overBudget: boolean;
|
|
104
|
+
revision: string;
|
|
105
|
+
}
|
|
106
|
+
export interface RuntimeCachePruneResult extends RuntimeCacheStatus {
|
|
107
|
+
applied: boolean;
|
|
108
|
+
reclaimedBytes: number;
|
|
109
|
+
removed?: string[];
|
|
110
|
+
skipped?: RuntimeCacheStatus['entries'];
|
|
111
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface VerifiedRuntime {
|
|
2
|
+
version: string;
|
|
3
|
+
protocol: number;
|
|
4
|
+
dataFormat: number;
|
|
5
|
+
platform: NodeJS.Platform;
|
|
6
|
+
arch: string;
|
|
7
|
+
profile: 'light';
|
|
8
|
+
manifestSha256: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function validateSdkRuntimeDirectory(directory: string, trustedPublicKey?: string): Promise<VerifiedRuntime>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function applicationToolProviderId(agent: {
|
|
2
|
+
id: string;
|
|
3
|
+
version: string;
|
|
4
|
+
toolProviderId?: string;
|
|
5
|
+
}): string;
|
|
6
|
+
/** Stable across process restarts; suitable for team tool allowlists. */
|
|
7
|
+
export declare function applicationToolReference(agent: {
|
|
8
|
+
id: string;
|
|
9
|
+
version: string;
|
|
10
|
+
toolProviderId?: string;
|
|
11
|
+
}, name: string): string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** MCP content supported by the callback provider's negotiated protocol. */
|
|
2
|
+
export type ToolContent = {
|
|
3
|
+
type: 'text';
|
|
4
|
+
text: string;
|
|
5
|
+
} | {
|
|
6
|
+
type: 'image';
|
|
7
|
+
data: string;
|
|
8
|
+
mimeType: string;
|
|
9
|
+
} | {
|
|
10
|
+
type: 'resource';
|
|
11
|
+
resource: {
|
|
12
|
+
uri: string;
|
|
13
|
+
mimeType?: string;
|
|
14
|
+
} & ({
|
|
15
|
+
text: string;
|
|
16
|
+
} | {
|
|
17
|
+
blob: string;
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
export interface ToolResult {
|
|
21
|
+
kind: 'aios-tool-result';
|
|
22
|
+
content: ToolContent[];
|
|
23
|
+
/** JSON data, including external operation IDs, is also included in model-visible text. */
|
|
24
|
+
data?: Record<string, unknown>;
|
|
25
|
+
error?: {
|
|
26
|
+
code: string;
|
|
27
|
+
message: string;
|
|
28
|
+
details?: Record<string, unknown>;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/** Opt in to rich results; ordinary strings and JSON return values retain their existing meaning. */
|
|
32
|
+
export declare function toolResult(result: Omit<ToolResult, 'kind'>): ToolResult;
|
|
33
|
+
export declare function encodeToolResult(value: unknown): {
|
|
34
|
+
content: ToolContent[];
|
|
35
|
+
isError: boolean;
|
|
36
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BusinessTool, McpServer } from './types.js';
|
|
2
|
+
/** Application callbacks remain in the application process, using the runtime's MCP pipeline. */
|
|
3
|
+
export declare function serveBusinessTools(id: string, tools: BusinessTool[], resolveFile?: (sessionId: string, path: string, access: 'read' | 'write', signal: AbortSignal) => Promise<import('./file-storage.js').FileReference>): Promise<{
|
|
4
|
+
descriptor: McpServer;
|
|
5
|
+
close: () => Promise<void>;
|
|
6
|
+
closed: Promise<void>;
|
|
7
|
+
status: () => {
|
|
8
|
+
retired: boolean;
|
|
9
|
+
sessions: number;
|
|
10
|
+
calls: number;
|
|
11
|
+
closing: boolean;
|
|
12
|
+
};
|
|
13
|
+
retire: () => void;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type SdkServiceMetadata } from './local-connection.js';
|
|
2
|
+
import type { ClientOptions } from './types.js';
|
|
3
|
+
import type { CredentialConnection } from '../../shared/managed-authorization.js';
|
|
4
|
+
import { type VerifiedRuntime } from './runtime-integrity.js';
|
|
5
|
+
export { validateSdkRuntimeDirectory } from './runtime-integrity.js';
|
|
6
|
+
export interface ServiceTransport {
|
|
7
|
+
readonly eventWaitMs?: number;
|
|
8
|
+
call<T>(method: string, params?: unknown, id?: string, signal?: AbortSignal): Promise<T>;
|
|
9
|
+
stop(): Promise<void>;
|
|
10
|
+
shutdown(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export declare class RuntimeTransport {
|
|
13
|
+
private readonly metadata;
|
|
14
|
+
private readonly ownerExit?;
|
|
15
|
+
private readonly communication?;
|
|
16
|
+
eventWaitMs: number;
|
|
17
|
+
private closed;
|
|
18
|
+
private readonly clientId;
|
|
19
|
+
private constructor();
|
|
20
|
+
static start(input: ClientOptions, credentials?: CredentialConnection): Promise<RuntimeTransport>;
|
|
21
|
+
static attach(options: ClientOptions, metadata: SdkServiceMetadata, verifiedPackage: VerifiedRuntime, credentials?: CredentialConnection, ownerExit?: AbortSignal): Promise<RuntimeTransport>;
|
|
22
|
+
call<T>(method: string, params?: unknown, id?: `${string}-${string}-${string}-${string}-${string}`, signal?: AbortSignal): Promise<T>;
|
|
23
|
+
stop(): Promise<void>;
|
|
24
|
+
shutdown(): Promise<void>;
|
|
25
|
+
}
|