@kmlckj/aios-agent-server-sdk 0.0.0-stage → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/EVENTS.md +88 -0
- package/README.md +656 -2
- package/capabilities.json +2398 -0
- package/dist/cli/daemon/preferences.d.ts +67 -0
- package/dist/cli/daemon/protocol.d.ts +26 -0
- package/dist/cli/daemon/resource-limits.d.ts +39 -0
- package/dist/core/auth/platform-client.d.ts +65 -0
- package/dist/core/host/runtime-dependencies.d.ts +26 -0
- package/dist/core/skills/skill-bindings.d.ts +19 -0
- package/dist/core/skills/skill-versions.d.ts +31 -0
- package/dist/electron/main/bundled-runtime-tools.d.ts +24 -0
- package/dist/events.js +1 -0
- package/dist/index.js +55 -0
- package/dist/sdk/src/auth.d.ts +43 -0
- package/dist/sdk/src/authorization-events.d.ts +16 -0
- package/dist/sdk/src/authorization.d.ts +10 -0
- package/dist/sdk/src/communication.d.ts +9 -0
- package/dist/sdk/src/diagnostics.d.ts +24 -0
- package/dist/sdk/src/errors.d.ts +4 -0
- package/dist/sdk/src/events.d.ts +4 -0
- package/dist/sdk/src/file-api.d.ts +29 -0
- package/dist/sdk/src/file-storage.d.ts +34 -0
- package/dist/sdk/src/index.d.ts +260 -0
- package/dist/sdk/src/local-connection.d.ts +9 -0
- package/dist/sdk/src/managed-host.d.ts +32 -0
- package/dist/sdk/src/native-status.d.ts +59 -0
- package/dist/sdk/src/platform.d.ts +39 -0
- package/dist/sdk/src/runtime-control.d.ts +111 -0
- package/dist/sdk/src/runtime-integrity.d.ts +10 -0
- package/dist/sdk/src/tool-reference.d.ts +11 -0
- package/dist/sdk/src/tool-result.d.ts +36 -0
- package/dist/sdk/src/tool-server.d.ts +14 -0
- package/dist/sdk/src/transport.d.ts +25 -0
- package/dist/sdk/src/types.d.ts +405 -0
- package/dist/shared/account-context-api.d.ts +47 -0
- package/dist/shared/account-schedules-api.d.ts +110 -0
- package/dist/shared/action-center-api.d.ts +50 -0
- package/dist/shared/agent-capabilities.d.ts +42 -0
- package/dist/shared/agent-hooks.d.ts +10 -0
- package/dist/shared/agent-team.d.ts +19 -0
- package/dist/shared/artifact-evidence.d.ts +18 -0
- package/dist/shared/automation-api.d.ts +112 -0
- package/dist/shared/client-downloads-api.d.ts +20 -0
- package/dist/shared/cloud-assistant-api.d.ts +532 -0
- package/dist/shared/cloud-task-resources.d.ts +24 -0
- package/dist/shared/cloud-task-runtime-api.d.ts +253 -0
- package/dist/shared/collaboration-api.d.ts +17 -0
- package/dist/shared/collaboration-automation-api.d.ts +55 -0
- package/dist/shared/collaboration-deep-link.d.ts +15 -0
- package/dist/shared/collaboration-event-api.d.ts +19 -0
- package/dist/shared/collaboration-plan-api.d.ts +159 -0
- package/dist/shared/collaboration-project-api.d.ts +206 -0
- package/dist/shared/collaboration-resource-api.d.ts +41 -0
- package/dist/shared/collaboration-task-api.d.ts +276 -0
- package/dist/shared/collaboration-task-execution.d.ts +39 -0
- package/dist/shared/computer-use-api.d.ts +80 -0
- package/dist/shared/computer-use-handshake.d.ts +19 -0
- package/dist/shared/computer-use-protocol.d.ts +488 -0
- package/dist/shared/context-usage.d.ts +15 -0
- package/dist/shared/desktop-api.d.ts +450 -0
- package/dist/shared/desktop-diagnostics-api.d.ts +56 -0
- package/dist/shared/desktop-language.d.ts +3 -0
- package/dist/shared/desktop-mcp-service-api.d.ts +157 -0
- package/dist/shared/document-session-api.d.ts +91 -0
- package/dist/shared/enterprise-knowledge-api.d.ts +103 -0
- package/dist/shared/enterprise-project-api.d.ts +26 -0
- package/dist/shared/execution-activity.d.ts +3 -0
- package/dist/shared/execution-context.d.ts +62 -0
- package/dist/shared/execution-identity.d.ts +7 -0
- package/dist/shared/execution-profile.d.ts +6 -0
- package/dist/shared/execution-target.d.ts +71 -0
- package/dist/shared/expert-selection.d.ts +22 -0
- package/dist/shared/expert-team-api.d.ts +54 -0
- package/dist/shared/feedback-api.d.ts +20 -0
- package/dist/shared/git-api.d.ts +227 -0
- package/dist/shared/git-http-api.d.ts +12 -0
- package/dist/shared/hosted-git-api.d.ts +132 -0
- package/dist/shared/js-agent-hooks.d.ts +23 -0
- package/dist/shared/local-custom-model-api.d.ts +55 -0
- package/dist/shared/local-environment-api.d.ts +110 -0
- package/dist/shared/local-mcp-server-api.d.ts +91 -0
- package/dist/shared/local-memory.d.ts +165 -0
- package/dist/shared/local-plugin-api.d.ts +26 -0
- package/dist/shared/local-runtime-api.d.ts +32 -0
- package/dist/shared/local-skill-api.d.ts +42 -0
- package/dist/shared/local-task-api.d.ts +658 -0
- package/dist/shared/local-task-command-client.d.ts +55 -0
- package/dist/shared/local-task-command.d.ts +93 -0
- package/dist/shared/local-task-event-projection.d.ts +29 -0
- package/dist/shared/local-task-projection.d.ts +29 -0
- package/dist/shared/local-workspace.d.ts +9 -0
- package/dist/shared/managed-authorization.d.ts +72 -0
- package/dist/shared/memory-customization.d.ts +32 -0
- package/dist/shared/model-routing.d.ts +31 -0
- package/dist/shared/model-selection.d.ts +11 -0
- package/dist/shared/my-expert-api.d.ts +119 -0
- package/dist/shared/navigation-api.d.ts +20 -0
- package/dist/shared/office-window-api.d.ts +81 -0
- package/dist/shared/platform-branding-api.d.ts +66 -0
- package/dist/shared/plugin-market-api.d.ts +120 -0
- package/dist/shared/profession-market-api.d.ts +96 -0
- package/dist/shared/project-local-skill-api.d.ts +8 -0
- package/dist/shared/remote-connection-api.d.ts +97 -0
- package/dist/shared/remote-connection.d.ts +62 -0
- package/dist/shared/remote-installation-api.d.ts +50 -0
- package/dist/shared/remote-tasks-api.d.ts +118 -0
- package/dist/shared/runtime-tuning.d.ts +44 -0
- package/dist/shared/scene-case-api.d.ts +42 -0
- package/dist/shared/sdk-session-contract.d.ts +96 -0
- package/dist/shared/security-center-api.d.ts +74 -0
- package/dist/shared/sensitive-protection-api.d.ts +71 -0
- package/dist/shared/session-policy.d.ts +26 -0
- package/dist/shared/shortcut-api.d.ts +7 -0
- package/dist/shared/skill-activation-api.d.ts +8 -0
- package/dist/shared/skill-asset-api.d.ts +12 -0
- package/dist/shared/skill-market-api.d.ts +119 -0
- package/dist/shared/skill-upload.d.ts +16 -0
- package/dist/shared/speech-recognition-api.d.ts +12 -0
- package/dist/shared/storage-integrity.d.ts +15 -0
- package/dist/shared/target-bridge-protocol.d.ts +67 -0
- package/dist/shared/target-environments.d.ts +15 -0
- package/dist/shared/target-resources.d.ts +105 -0
- package/dist/shared/task-enterprise-project-api.d.ts +75 -0
- package/dist/shared/task-execution-api.d.ts +35 -0
- package/dist/shared/task-initialization-api.d.ts +44 -0
- package/dist/shared/task-menu-api.d.ts +27 -0
- package/dist/shared/task-operation.d.ts +19 -0
- package/dist/shared/task-path-policy.d.ts +14 -0
- package/dist/shared/task-resource-manifest.d.ts +33 -0
- package/dist/shared/task-storage-recovery.d.ts +33 -0
- package/dist/shared/task-terminal-api.d.ts +48 -0
- package/dist/shared/team-control.d.ts +60 -0
- package/dist/shared/tool-activity.d.ts +18 -0
- package/dist/shared/update-api.d.ts +65 -0
- package/dist/shared/usage-statistics-api.d.ts +18 -0
- package/dist/shared/worktree-api.d.ts +188 -0
- package/examples/business-assistant.mjs +19 -0
- package/examples/common.mjs +51 -0
- package/examples/platform-assistant.mjs +9 -0
- package/examples/standalone-assistant.mjs +16 -0
- package/package.json +40 -4
|
@@ -0,0 +1,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
|
+
}
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
export type { TaskEvent, SessionEvent, SessionEventPage, EventObservationOptions, TaskInteraction, TaskMessage, HistoryQuery, HistoryPage, RunQuery, RunRecord, RunPage, RunState, QueueSnapshot } from '../../shared/sdk-session-contract.js';
|
|
2
|
+
import type { BuiltinSelection, BuiltinSnapshot, CapabilityDescriptor } from '../../shared/agent-capabilities.js';
|
|
3
|
+
import type { AuthSession, AuthPasswordChangeRequired } from '../../shared/desktop-api.js';
|
|
4
|
+
import type { CredentialProvider, ManagedAuthentication } from '../../shared/managed-authorization.js';
|
|
5
|
+
export type { TeamState, TeamMemberState, TeamTaskState, TeamCommand, TeamCommandResult } from '../../shared/team-control.js';
|
|
6
|
+
export type { ExpertSelection, PreparedExpertAgent, ResolvedExpertSource } from '../../shared/expert-selection.js';
|
|
7
|
+
export type { ManagedAuthentication, ManagedPrincipal, ManagedCredential, ManagedCredentialRequest, CredentialProvider, CredentialReason, ManagedAuthorizationEvent } from '../../shared/managed-authorization.js';
|
|
8
|
+
export type { BuiltinSelection, BuiltinSnapshot, CapabilityDescriptor, ToolCategory, SkillCategory } from '../../shared/agent-capabilities.js';
|
|
9
|
+
export type { AuthSession, PlatformUser, TenantSummary, LoginContext, AuthRequiredPasswordChangeRequest, AuthSwitchSubjectRequest } from '../../shared/desktop-api.js';
|
|
10
|
+
export type { AvailableChatModel } from '../../shared/cloud-assistant-api.js';
|
|
11
|
+
export type { AccountContextSummary, AccountContextQuery } from '../../shared/account-context-api.js';
|
|
12
|
+
export type { PersonalUsageStatistics } from '../../shared/usage-statistics-api.js';
|
|
13
|
+
export type { EnterpriseKnowledgeBase, EnterpriseKnowledgeSearchQuery, EnterpriseKnowledgeSearchResult, EnterpriseKnowledgeDocument, EnterpriseKnowledgeTreeResult } from '../../shared/enterprise-knowledge-api.js';
|
|
14
|
+
export type { SkillMarketItem, SkillMarketDetail, SkillMarketSearchQuery, SkillMarketSearchResult } from '../../shared/skill-market-api.js';
|
|
15
|
+
export type { PluginMarketItem, PluginMarketDetail, PluginMarketListQuery, PluginMarketListResult } from '../../shared/plugin-market-api.js';
|
|
16
|
+
export type { PluginAuthorizationStatus, PluginAuthorizationDefinition, PluginAuthorizationSaveRequest } from '../../shared/plugin-market-api.js';
|
|
17
|
+
export type { LocalPluginInstallation } from '../../shared/local-plugin-api.js';
|
|
18
|
+
export type { SkillVersionSelection, SkillVersionUpdate } from '../../core/skills/skill-versions.js';
|
|
19
|
+
export interface SkillVersionInfo {
|
|
20
|
+
binding: import('../../core/skills/skill-bindings.js').SkillBinding;
|
|
21
|
+
current: import('../../shared/local-task-api.js').LocalTaskSkillReference;
|
|
22
|
+
}
|
|
23
|
+
export type SkillVersionUpdateResult = Awaited<ReturnType<typeof import('../../core/skills/skill-versions.js').updateSkillVersion>>;
|
|
24
|
+
export interface PluginUpdateResult {
|
|
25
|
+
changed: boolean;
|
|
26
|
+
before: {
|
|
27
|
+
recordId: string;
|
|
28
|
+
version?: string | null;
|
|
29
|
+
};
|
|
30
|
+
installation: import('../../shared/local-plugin-api.js').LocalPluginInstallation;
|
|
31
|
+
}
|
|
32
|
+
export interface ExternalModel {
|
|
33
|
+
generationCapabilities?: import('../../shared/runtime-tuning.js').GenerationCapabilities;
|
|
34
|
+
id: string;
|
|
35
|
+
endpoint: string;
|
|
36
|
+
model: string;
|
|
37
|
+
protocol: 'chat_completions' | 'responses';
|
|
38
|
+
apiKey?: string;
|
|
39
|
+
contextWindow: number;
|
|
40
|
+
maxOutputTokens?: number;
|
|
41
|
+
functionCalling: boolean;
|
|
42
|
+
imageInput?: boolean;
|
|
43
|
+
reasoning?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface RuntimeOptions {
|
|
46
|
+
/** Omit to use the matching runtime installed with this npm package. */
|
|
47
|
+
directory?: string;
|
|
48
|
+
dataDirectory: string;
|
|
49
|
+
/** Optional storage bases. Each uses the same app/principal partition as dataDirectory. */
|
|
50
|
+
workspaceDirectory?: string;
|
|
51
|
+
cacheDirectory?: string;
|
|
52
|
+
temporaryDirectory?: string;
|
|
53
|
+
nodeExecutable?: string;
|
|
54
|
+
tools?: Partial<Record<'node' | 'python' | 'git' | 'bash' | 'npm', string>>;
|
|
55
|
+
/** Override only for a runtime built and signed by your own organization. */
|
|
56
|
+
trustedPublicKey?: string;
|
|
57
|
+
}
|
|
58
|
+
/** Attach to an already running CLI; never starts, installs or stops that service. */
|
|
59
|
+
export interface CliConnectionOptions {
|
|
60
|
+
dataDirectory: string;
|
|
61
|
+
appId: string;
|
|
62
|
+
userScope: string;
|
|
63
|
+
appName?: string;
|
|
64
|
+
builtins?: BuiltinSelection;
|
|
65
|
+
}
|
|
66
|
+
export interface NetworkOptions {
|
|
67
|
+
proxyMode: 'off' | 'system' | 'custom';
|
|
68
|
+
proxyUrl: string;
|
|
69
|
+
caFile: string;
|
|
70
|
+
noProxy: string;
|
|
71
|
+
}
|
|
72
|
+
interface CommonOptions {
|
|
73
|
+
authorization?: {
|
|
74
|
+
required: boolean;
|
|
75
|
+
};
|
|
76
|
+
memory?: import('../../shared/memory-customization.js').MemoryConfiguration;
|
|
77
|
+
/** Explicit host declarations, keyed by platform model code. Unlisted parameters are rejected. */
|
|
78
|
+
generationCapabilities?: Record<string, import('../../shared/runtime-tuning.js').GenerationCapabilities>;
|
|
79
|
+
appId: string;
|
|
80
|
+
userScope: string;
|
|
81
|
+
appName?: string;
|
|
82
|
+
runtime: RuntimeOptions;
|
|
83
|
+
builtins?: BuiltinSelection;
|
|
84
|
+
network?: NetworkOptions;
|
|
85
|
+
communication?: import('./communication.js').CommunicationOptions;
|
|
86
|
+
}
|
|
87
|
+
export type ClientOptions = CommonOptions & ({
|
|
88
|
+
mode: 'platform';
|
|
89
|
+
platformBaseUrl: string;
|
|
90
|
+
environment?: 'dev' | 'prod';
|
|
91
|
+
/** Omit for SDK-managed interactive login. Managed mode never stores platform credentials. */
|
|
92
|
+
authentication?: ManagedAuthentication;
|
|
93
|
+
} | {
|
|
94
|
+
mode: 'standalone';
|
|
95
|
+
models: ExternalModel[];
|
|
96
|
+
});
|
|
97
|
+
export type ResolvedClientOptions = ClientOptions & {
|
|
98
|
+
runtime: RuntimeOptions & {
|
|
99
|
+
directory: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
export interface ClientServices {
|
|
103
|
+
credentials?: CredentialProvider;
|
|
104
|
+
diagnostics?: import('./diagnostics.js').DiagnosticSink;
|
|
105
|
+
memoryStore?: import('../../shared/memory-customization.js').MemoryStoreAdapter;
|
|
106
|
+
authorize?: import('./authorization.js').SessionAuthorizer;
|
|
107
|
+
}
|
|
108
|
+
export interface ToolContext {
|
|
109
|
+
files?: {
|
|
110
|
+
resolve(path: string, access: 'read' | 'write'): Promise<import('./file-storage.js').FileReference>;
|
|
111
|
+
};
|
|
112
|
+
signal: AbortSignal;
|
|
113
|
+
callId: string;
|
|
114
|
+
/** Present on calls dispatched by the SDK execution engine; not model arguments. */
|
|
115
|
+
execution?: Readonly<import('../../shared/execution-context.js').ExecutionBinding & {
|
|
116
|
+
invocationId: string;
|
|
117
|
+
}>;
|
|
118
|
+
}
|
|
119
|
+
export interface BusinessTool {
|
|
120
|
+
name: string;
|
|
121
|
+
description: string;
|
|
122
|
+
inputSchema: Record<string, unknown>;
|
|
123
|
+
readOnly: boolean;
|
|
124
|
+
execute(input: Record<string, unknown>, context: ToolContext): unknown | Promise<unknown>;
|
|
125
|
+
}
|
|
126
|
+
export interface McpServer {
|
|
127
|
+
id: string;
|
|
128
|
+
name: string;
|
|
129
|
+
transport: 'HTTP' | 'STDIO';
|
|
130
|
+
url?: string;
|
|
131
|
+
bearerToken?: string;
|
|
132
|
+
command?: string;
|
|
133
|
+
args?: string[];
|
|
134
|
+
env?: Record<string, string>;
|
|
135
|
+
tools?: string[];
|
|
136
|
+
defaultToolsApproval?: 'auto' | 'prompt';
|
|
137
|
+
toolApprovals?: Record<string, 'auto' | 'prompt'>;
|
|
138
|
+
}
|
|
139
|
+
export interface ExecutionDefaults {
|
|
140
|
+
runtimeTuning?: import('../../shared/runtime-tuning.js').RuntimeTuning;
|
|
141
|
+
model: string;
|
|
142
|
+
mode?: 'agent' | 'plan' | 'chat';
|
|
143
|
+
permissionMode?: 'ask_dangerous' | 'allow_all';
|
|
144
|
+
thinkingEnabled?: boolean;
|
|
145
|
+
reasoningEffort?: import('../../shared/model-selection.js').ModelReasoningEffort;
|
|
146
|
+
/** Requested window; the shared model policy validates it against the model capacity. */
|
|
147
|
+
contextWindow?: number;
|
|
148
|
+
}
|
|
149
|
+
export interface AgentDefinition extends ExecutionDefaults {
|
|
150
|
+
jsHooks?: Partial<Record<'beforeTool' | 'afterTool', {
|
|
151
|
+
matcher?: string;
|
|
152
|
+
timeoutMs?: number;
|
|
153
|
+
execute(event: Readonly<import('../../shared/js-agent-hooks.js').ToolLifecycleEvent>, context: {
|
|
154
|
+
signal: AbortSignal;
|
|
155
|
+
}): void | import('../../shared/js-agent-hooks.js').ToolHookDecision | Promise<void | import('../../shared/js-agent-hooks.js').ToolHookDecision>;
|
|
156
|
+
}>>;
|
|
157
|
+
/** Serializable lifecycle policy returned by session configuration. */
|
|
158
|
+
jsHookDefinitions?: import('../../shared/js-agent-hooks.js').JsHookDefinition[];
|
|
159
|
+
team?: import('../../shared/agent-team.js').AgentTeamDefinition;
|
|
160
|
+
id: string;
|
|
161
|
+
version: string;
|
|
162
|
+
name: string;
|
|
163
|
+
instructions: string;
|
|
164
|
+
rules?: import('../../shared/session-policy.js').ApplicationRule[];
|
|
165
|
+
profile?: import('../../shared/execution-profile.js').ExecutionProfile;
|
|
166
|
+
hooks?: import('../../shared/agent-hooks.js').AgentCommandHook[];
|
|
167
|
+
builtins?: BuiltinSelection;
|
|
168
|
+
tools?: BusinessTool[];
|
|
169
|
+
/** Stable logical identity, independent of the callback URL and secret. */
|
|
170
|
+
toolProviderId?: string;
|
|
171
|
+
mcpServers?: McpServer[];
|
|
172
|
+
skills?: import('../../shared/local-task-api.js').LocalTaskSkillReference[];
|
|
173
|
+
plugins?: import('../../shared/local-task-api.js').LocalTaskPluginReference[];
|
|
174
|
+
}
|
|
175
|
+
export type { LocalSkillDefinition } from '../../shared/local-skill-api.js';
|
|
176
|
+
export type { ExecutionProfile } from '../../shared/execution-profile.js';
|
|
177
|
+
export type { AgentCommandHook } from '../../shared/agent-hooks.js';
|
|
178
|
+
export type { AgentTeamDefinition, AgentTeamMember } from '../../shared/agent-team.js';
|
|
179
|
+
export type { TaskPathPolicy } from '../../shared/task-path-policy.js';
|
|
180
|
+
export type { TaskOperationReference, TaskOperationSnapshot } from '../../shared/task-operation.js';
|
|
181
|
+
export type { ExecutionContext, ExecutionBinding } from '../../shared/execution-context.js';
|
|
182
|
+
export type { SessionScopePolicy, SessionMemoryPolicy, RunMemoryPolicy, ApplicationRule } from '../../shared/session-policy.js';
|
|
183
|
+
export interface SessionCreateOptions {
|
|
184
|
+
name?: string;
|
|
185
|
+
workspacePath?: string;
|
|
186
|
+
creationId?: string;
|
|
187
|
+
policy?: import('../../shared/session-policy.js').SessionScopePolicy;
|
|
188
|
+
}
|
|
189
|
+
export type { ArtifactEvidence, ArtifactVerification } from '../../shared/artifact-evidence.js';
|
|
190
|
+
export interface ArtifactQuery {
|
|
191
|
+
runId?: string;
|
|
192
|
+
query?: string;
|
|
193
|
+
type?: import('../../shared/local-task-api.js').LocalTaskArtifactType;
|
|
194
|
+
limit?: number;
|
|
195
|
+
}
|
|
196
|
+
export type SessionArtifact = import('../../shared/local-task-api.js').LocalTaskArtifact & {
|
|
197
|
+
/** Latest observed reference, or workspace-only when no execution evidence exists. */
|
|
198
|
+
source: {
|
|
199
|
+
kind: 'execution' | 'workspace';
|
|
200
|
+
eventId?: string;
|
|
201
|
+
runId?: string;
|
|
202
|
+
threadId?: string;
|
|
203
|
+
tool?: string;
|
|
204
|
+
at?: string;
|
|
205
|
+
};
|
|
206
|
+
evidence: import('../../shared/artifact-evidence.js').ArtifactEvidence[];
|
|
207
|
+
operations: import('../../shared/task-operation.js').TaskOperationReference[];
|
|
208
|
+
};
|
|
209
|
+
export interface SessionInfo {
|
|
210
|
+
id: string;
|
|
211
|
+
name: string;
|
|
212
|
+
workspacePath: string;
|
|
213
|
+
status: string;
|
|
214
|
+
metadataRevision: string;
|
|
215
|
+
createdAt: string;
|
|
216
|
+
updatedAt: string;
|
|
217
|
+
archivedAt?: string;
|
|
218
|
+
}
|
|
219
|
+
export interface SessionConfiguration {
|
|
220
|
+
revision: number;
|
|
221
|
+
agent: Omit<AgentDefinition, 'tools' | 'mcpServers' | 'jsHooks'>;
|
|
222
|
+
builtins: BuiltinSnapshot;
|
|
223
|
+
defaults: ExecutionDefaults;
|
|
224
|
+
policy?: import('../../shared/session-policy.js').SessionScopePolicy;
|
|
225
|
+
parent?: {
|
|
226
|
+
sessionId: string;
|
|
227
|
+
memberId: string;
|
|
228
|
+
configurationRevision: number;
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
export interface SessionAgentUpdate {
|
|
232
|
+
agentId: string;
|
|
233
|
+
agentVersion: string;
|
|
234
|
+
expectedRevision: number;
|
|
235
|
+
}
|
|
236
|
+
export interface ProviderStatus {
|
|
237
|
+
agentId: string;
|
|
238
|
+
agentVersion: string;
|
|
239
|
+
/** Registration status only; does not assert that an external MCP server is reachable. */
|
|
240
|
+
status: 'registered' | 'unregistered';
|
|
241
|
+
providers: Array<{
|
|
242
|
+
id: string;
|
|
243
|
+
name: string;
|
|
244
|
+
}>;
|
|
245
|
+
ownedByCaller: boolean;
|
|
246
|
+
}
|
|
247
|
+
export interface ConfigurationUpdate {
|
|
248
|
+
authorization?: {
|
|
249
|
+
required: boolean;
|
|
250
|
+
};
|
|
251
|
+
memory?: import('../../shared/memory-customization.js').MemoryConfiguration;
|
|
252
|
+
generationCapabilities?: Record<string, import('../../shared/runtime-tuning.js').GenerationCapabilities>;
|
|
253
|
+
communication?: import('./communication.js').CommunicationOptions;
|
|
254
|
+
runtime?: RuntimeOptions;
|
|
255
|
+
builtins?: BuiltinSelection;
|
|
256
|
+
network?: NetworkOptions;
|
|
257
|
+
platformBaseUrl?: string;
|
|
258
|
+
models?: ExternalModel[];
|
|
259
|
+
}
|
|
260
|
+
export interface ClientConfiguration {
|
|
261
|
+
authorization?: {
|
|
262
|
+
required: boolean;
|
|
263
|
+
};
|
|
264
|
+
memory?: import('../../shared/memory-customization.js').MemoryConfiguration;
|
|
265
|
+
generationCapabilities?: Record<string, import('../../shared/runtime-tuning.js').GenerationCapabilities>;
|
|
266
|
+
communication?: import('./communication.js').CommunicationOptions;
|
|
267
|
+
mode: ClientOptions['mode'];
|
|
268
|
+
appId: string;
|
|
269
|
+
userScope: string;
|
|
270
|
+
appName: string;
|
|
271
|
+
runtime: RuntimeOptions;
|
|
272
|
+
paths: {
|
|
273
|
+
contextDirectory: string;
|
|
274
|
+
resourcesDirectory: string;
|
|
275
|
+
tasksDirectory: string;
|
|
276
|
+
workspacesDirectory: string;
|
|
277
|
+
temporaryDirectory: string;
|
|
278
|
+
cacheDirectory: string;
|
|
279
|
+
};
|
|
280
|
+
builtins: BuiltinSnapshot;
|
|
281
|
+
network: NetworkOptions;
|
|
282
|
+
platformBaseUrl?: string;
|
|
283
|
+
models?: Array<Omit<ExternalModel, 'apiKey'> & {
|
|
284
|
+
apiKeyConfigured: boolean;
|
|
285
|
+
}>;
|
|
286
|
+
authentication?: ManagedAuthentication;
|
|
287
|
+
}
|
|
288
|
+
export type DependencyStatus = import('../../core/host/runtime-dependencies.js').ResolvedRuntimeDependencies;
|
|
289
|
+
export type LocalPreferences = import('../../cli/daemon/preferences.js').Preferences;
|
|
290
|
+
export type LocalPreferenceDomain = import('../../cli/daemon/preferences.js').PreferenceDomain | 'securityPolicy';
|
|
291
|
+
export type { ComputerUseSettings } from '../../shared/computer-use-api.js';
|
|
292
|
+
export type { NativeSettings, NativeCapabilityStatus } from './native-status.js';
|
|
293
|
+
export type { MemoryView, MemoryEditRequest } from '../../shared/local-memory.js';
|
|
294
|
+
export interface SessionMemoryApi {
|
|
295
|
+
get(request: import('../../shared/local-memory.js').MemoryContextRequest & {
|
|
296
|
+
sessionId: string;
|
|
297
|
+
}): Promise<import('../../shared/local-memory.js').MemoryView>;
|
|
298
|
+
edit(request: import('../../shared/local-memory.js').MemoryEditRequest & {
|
|
299
|
+
sessionId: string;
|
|
300
|
+
}): Promise<import('../../shared/local-memory.js').MemoryView>;
|
|
301
|
+
reset(request: {
|
|
302
|
+
sessionId: string;
|
|
303
|
+
}): Promise<import('../../shared/local-memory.js').MemoryView>;
|
|
304
|
+
setEnabled(request: {
|
|
305
|
+
sessionId: string;
|
|
306
|
+
enabled: boolean;
|
|
307
|
+
}): Promise<import('../../shared/local-memory.js').MemoryView>;
|
|
308
|
+
}
|
|
309
|
+
export interface AuthTokens {
|
|
310
|
+
accessToken: string;
|
|
311
|
+
refreshToken: string;
|
|
312
|
+
accessTokenExpiresAt: string;
|
|
313
|
+
platformBaseUrl: string;
|
|
314
|
+
}
|
|
315
|
+
export type CredentialStoreOptions = {
|
|
316
|
+
kind: 'session' | 'system';
|
|
317
|
+
} | {
|
|
318
|
+
kind: 'vault';
|
|
319
|
+
secret: string;
|
|
320
|
+
};
|
|
321
|
+
export type LoginRequest = {
|
|
322
|
+
loginType: 'USERNAME' | 'PHONE';
|
|
323
|
+
account: string;
|
|
324
|
+
password: string;
|
|
325
|
+
countryCode?: string;
|
|
326
|
+
credentialStore?: CredentialStoreOptions;
|
|
327
|
+
};
|
|
328
|
+
export type LoginResult = {
|
|
329
|
+
status: 'authenticated';
|
|
330
|
+
tokens: AuthTokens;
|
|
331
|
+
session: AuthSession;
|
|
332
|
+
} | {
|
|
333
|
+
status: 'challenge';
|
|
334
|
+
challenge: AuthPasswordChangeRequired;
|
|
335
|
+
};
|
|
336
|
+
export interface AuthStatus {
|
|
337
|
+
session: AuthSession | null;
|
|
338
|
+
credentialStore: {
|
|
339
|
+
kind: 'session' | 'vault' | 'system' | 'managed';
|
|
340
|
+
configured: boolean;
|
|
341
|
+
locked: boolean;
|
|
342
|
+
};
|
|
343
|
+
restoration: {
|
|
344
|
+
state: 'ready' | 'restoring';
|
|
345
|
+
} | {
|
|
346
|
+
state: 'failed';
|
|
347
|
+
code: string;
|
|
348
|
+
message: string;
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
export interface BrowserLoginOptions {
|
|
352
|
+
requestId?: string;
|
|
353
|
+
credentialStore?: CredentialStoreOptions;
|
|
354
|
+
}
|
|
355
|
+
export interface BrowserLoginStatus {
|
|
356
|
+
id: string;
|
|
357
|
+
state: 'starting' | 'waiting' | 'completed' | 'cancelled' | 'failed';
|
|
358
|
+
authorizationUrl?: string;
|
|
359
|
+
session?: AuthSession;
|
|
360
|
+
error?: {
|
|
361
|
+
code: string;
|
|
362
|
+
message: string;
|
|
363
|
+
exitCode: number;
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
export interface SendOptions extends Partial<ExecutionDefaults> {
|
|
367
|
+
/** Selected scene and its implicit resources, preserved in this turn's history and queue. */
|
|
368
|
+
sceneContext?: import('../../shared/local-task-api.js').LocalTaskSceneContext;
|
|
369
|
+
/** Narrow this run's long-term memory access within the session grant. */
|
|
370
|
+
memory?: import('../../shared/session-policy.js').RunMemoryPolicy;
|
|
371
|
+
/** Trusted host metadata. Immutable for this run, including queued dispatch and continuations. */
|
|
372
|
+
context?: import('../../shared/execution-context.js').ExecutionContext;
|
|
373
|
+
/** Default is background. Foreground is cancelled if the submitting process exits unexpectedly. */
|
|
374
|
+
execution?: 'foreground' | 'background';
|
|
375
|
+
/** 0 for unlimited; otherwise 1000..604800000 ms. */
|
|
376
|
+
timeoutMs?: number;
|
|
377
|
+
commandId?: string;
|
|
378
|
+
attachments?: Array<{
|
|
379
|
+
path: string;
|
|
380
|
+
}>;
|
|
381
|
+
attachmentIds?: string[];
|
|
382
|
+
references?: import('../../shared/local-task-api.js').LocalTaskFileReference[];
|
|
383
|
+
richContent?: import('../../shared/local-task-api.js').LocalTaskRichContent;
|
|
384
|
+
skills?: import('../../shared/local-task-api.js').LocalTaskSkillReference[];
|
|
385
|
+
plugins?: import('../../shared/local-task-api.js').LocalTaskPluginReference[];
|
|
386
|
+
}
|
|
387
|
+
export type CommandReceipt = import('../../shared/local-task-command.js').LocalTaskCommandReply | null;
|
|
388
|
+
export type CommandResult = import('../../shared/local-task-command.js').LocalTaskCommandResult;
|
|
389
|
+
export interface CapabilityQuery {
|
|
390
|
+
kind?: 'tool' | 'skill';
|
|
391
|
+
category?: string;
|
|
392
|
+
enabled?: boolean;
|
|
393
|
+
available?: boolean;
|
|
394
|
+
source?: CapabilityDescriptor['source'];
|
|
395
|
+
}
|
|
396
|
+
export interface EffectiveCapability extends CapabilityDescriptor {
|
|
397
|
+
enabled: boolean;
|
|
398
|
+
available: boolean;
|
|
399
|
+
reason?: string;
|
|
400
|
+
operations?: Array<{
|
|
401
|
+
id: string;
|
|
402
|
+
available: boolean;
|
|
403
|
+
reason?: string;
|
|
404
|
+
}>;
|
|
405
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface AccountCreditSourceBalance {
|
|
2
|
+
sourceType: string | null;
|
|
3
|
+
initialPoints: number | null;
|
|
4
|
+
remainingPoints: number | null;
|
|
5
|
+
frozenPoints: number | null;
|
|
6
|
+
nearestExpiresAt: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface AccountContextSummary {
|
|
9
|
+
availableBalance: number | null;
|
|
10
|
+
planName: string | null;
|
|
11
|
+
planId?: string | null;
|
|
12
|
+
totalBalance?: number | null;
|
|
13
|
+
planLevel?: string | null;
|
|
14
|
+
planStatus?: string | null;
|
|
15
|
+
subscriptionId?: string | null;
|
|
16
|
+
subscriptionPlanId?: string | null;
|
|
17
|
+
subscriptionStatus?: string | null;
|
|
18
|
+
subscriptionValidFrom?: string | null;
|
|
19
|
+
subscriptionValidTo?: string | null;
|
|
20
|
+
subscriptionRemainingDays?: number | null;
|
|
21
|
+
sourceBalances?: AccountCreditSourceBalance[];
|
|
22
|
+
}
|
|
23
|
+
export type AccountReferralActivityStatus = 'TECHNICAL_DISABLED' | 'DISABLED' | 'UNPUBLISHED' | 'SCHEDULED' | 'ACTIVE' | 'ENDED';
|
|
24
|
+
export interface AccountReferralCampaign {
|
|
25
|
+
technicalEnabled: boolean;
|
|
26
|
+
rewardEnabled: boolean;
|
|
27
|
+
activityStatus: AccountReferralActivityStatus;
|
|
28
|
+
registerRewardPoints: number | null;
|
|
29
|
+
}
|
|
30
|
+
export interface AccountPlanPurchase {
|
|
31
|
+
id: string;
|
|
32
|
+
planId: string;
|
|
33
|
+
planName: string;
|
|
34
|
+
subscriptionId: string | null;
|
|
35
|
+
purchasedAt: string;
|
|
36
|
+
expiresAt: string | null;
|
|
37
|
+
pointsGranted: number | null;
|
|
38
|
+
pointsRemaining: number | null;
|
|
39
|
+
}
|
|
40
|
+
export interface AccountContextQuery {
|
|
41
|
+
subjectName?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface AccountContextApi {
|
|
44
|
+
getSummary: (query?: AccountContextQuery) => Promise<AccountContextSummary>;
|
|
45
|
+
getReferralCampaign: () => Promise<AccountReferralCampaign>;
|
|
46
|
+
listPlanPurchases: () => Promise<AccountPlanPurchase[]>;
|
|
47
|
+
}
|