@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,55 @@
|
|
|
1
|
+
import type { SendLocalTaskMessageRequest, RestartLocalTaskMessageRequest, UpdateLocalTaskPendingMessageRequest, DeleteLocalTaskPendingMessageRequest, ReorderLocalTaskPendingMessagesRequest, LocalTaskApprovalRequest, LocalTaskUserInputRequest } from './local-task-api.js';
|
|
2
|
+
import type { LocalTaskInteraction, LocalTaskPendingMessage } from './local-task-api.js';
|
|
3
|
+
import type { LocalTaskCommand, LocalTaskCommandResult, LocalTaskCommandReply, LocalTaskCommandTargets } from './local-task-command.js';
|
|
4
|
+
export interface LocalTaskCommandTransport {
|
|
5
|
+
executeCommand(command: LocalTaskCommand): Promise<LocalTaskCommandReply>;
|
|
6
|
+
getCommand(taskId: string, commandId: string): Promise<LocalTaskCommandReply | null>;
|
|
7
|
+
getCommandTargets(taskId: string): Promise<LocalTaskCommandTargets>;
|
|
8
|
+
listInteractions(taskId: string): Promise<LocalTaskInteraction[]>;
|
|
9
|
+
listPendingMessages(taskId: string): Promise<LocalTaskPendingMessage[]>;
|
|
10
|
+
}
|
|
11
|
+
export declare class CommandAwaitingConfirmation extends Error {
|
|
12
|
+
readonly commandId: string;
|
|
13
|
+
constructor(commandId: string);
|
|
14
|
+
}
|
|
15
|
+
export declare function dispatchLocalTaskCommand(api: LocalTaskCommandTransport, command: LocalTaskCommand): Promise<LocalTaskCommandResult>;
|
|
16
|
+
export declare function createLocalTaskCommandClient(transport: () => LocalTaskCommandTransport, createId: () => string, dispatch?: (command: LocalTaskCommand) => Promise<LocalTaskCommandResult>): {
|
|
17
|
+
sendMessage: (request: SendLocalTaskMessageRequest, identity?: {
|
|
18
|
+
commandId: string;
|
|
19
|
+
messageId: string;
|
|
20
|
+
}) => Promise<{
|
|
21
|
+
status: string;
|
|
22
|
+
messageId: string;
|
|
23
|
+
runId: string;
|
|
24
|
+
}>;
|
|
25
|
+
restartFromMessage: (request: RestartLocalTaskMessageRequest) => Promise<{
|
|
26
|
+
status: string;
|
|
27
|
+
messageId: string;
|
|
28
|
+
runId: string;
|
|
29
|
+
}>;
|
|
30
|
+
enqueueMessage: (request: SendLocalTaskMessageRequest, identity?: {
|
|
31
|
+
commandId: string;
|
|
32
|
+
messageId: string;
|
|
33
|
+
}) => Promise<{
|
|
34
|
+
status: string;
|
|
35
|
+
messageId: string;
|
|
36
|
+
runId: string;
|
|
37
|
+
}>;
|
|
38
|
+
updatePendingMessage: (request: UpdateLocalTaskPendingMessageRequest) => Promise<LocalTaskCommandResult>;
|
|
39
|
+
deletePendingMessage: (request: DeleteLocalTaskPendingMessageRequest) => Promise<void>;
|
|
40
|
+
reorderPendingMessages: (request: ReorderLocalTaskPendingMessagesRequest) => Promise<LocalTaskPendingMessage[]>;
|
|
41
|
+
sendPendingMessageNow: (request: DeleteLocalTaskPendingMessageRequest) => Promise<{
|
|
42
|
+
status: string;
|
|
43
|
+
messageId: string;
|
|
44
|
+
runId: string;
|
|
45
|
+
}>;
|
|
46
|
+
startPlan: (taskId: string) => Promise<{
|
|
47
|
+
status: string;
|
|
48
|
+
runId: string;
|
|
49
|
+
}>;
|
|
50
|
+
cancel: (taskId: string) => Promise<void>;
|
|
51
|
+
respondToApproval: (request: LocalTaskApprovalRequest) => Promise<void>;
|
|
52
|
+
submitUserInput: (request: LocalTaskUserInputRequest) => Promise<void>;
|
|
53
|
+
cancelUserInput: (request: Omit<LocalTaskUserInputRequest, "response">) => Promise<void>;
|
|
54
|
+
};
|
|
55
|
+
export type LocalTaskExecutionCommands = ReturnType<typeof createLocalTaskCommandClient>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { LocalTaskApprovalRequest, LocalTaskInteraction, LocalTaskUserInputRequest, RestartLocalTaskMessageRequest, SendLocalTaskMessageRequest } from './local-task-api.js';
|
|
2
|
+
export declare function matchesTaskInteraction(item: LocalTaskInteraction, kind: 'approve' | 'input' | 'input_cancel', responseId: string): boolean;
|
|
3
|
+
type Header<K extends string, P> = {
|
|
4
|
+
commandId: string;
|
|
5
|
+
taskId: string;
|
|
6
|
+
kind: K;
|
|
7
|
+
payload: P;
|
|
8
|
+
};
|
|
9
|
+
export type LocalTaskCommand = Header<'send' | 'enqueue', {
|
|
10
|
+
messageId: string;
|
|
11
|
+
request: SendLocalTaskMessageRequest;
|
|
12
|
+
}> | Header<'restart', {
|
|
13
|
+
messageId: string;
|
|
14
|
+
historyVersion: string;
|
|
15
|
+
request: RestartLocalTaskMessageRequest;
|
|
16
|
+
}> | Header<'queue_edit', {
|
|
17
|
+
pendingMessageId: string;
|
|
18
|
+
queueVersion: string;
|
|
19
|
+
content: string;
|
|
20
|
+
}> | Header<'queue_delete' | 'queue_send', {
|
|
21
|
+
pendingMessageId: string;
|
|
22
|
+
queueVersion: string;
|
|
23
|
+
targetRunId: string | null;
|
|
24
|
+
}> | Header<'queue_reorder', {
|
|
25
|
+
pendingMessageIds: string[];
|
|
26
|
+
queueVersion: string;
|
|
27
|
+
}> | Header<'plan_start', {
|
|
28
|
+
runId: string;
|
|
29
|
+
targetRunId: string | null;
|
|
30
|
+
planRunId?: string;
|
|
31
|
+
}> | Header<'compact', {
|
|
32
|
+
runId: string;
|
|
33
|
+
historyVersion: string;
|
|
34
|
+
}> | Header<'cancel', {
|
|
35
|
+
targetRunId: string;
|
|
36
|
+
handoff?: boolean;
|
|
37
|
+
}> | Header<'approve', {
|
|
38
|
+
targetRunId: string;
|
|
39
|
+
request: LocalTaskApprovalRequest;
|
|
40
|
+
}> | Header<'input', {
|
|
41
|
+
targetRunId: string;
|
|
42
|
+
request: LocalTaskUserInputRequest;
|
|
43
|
+
}> | Header<'input_cancel', {
|
|
44
|
+
targetRunId: string;
|
|
45
|
+
request: Omit<LocalTaskUserInputRequest, 'response'>;
|
|
46
|
+
}>;
|
|
47
|
+
export type LocalTaskCommandStage = 'preparing' | 'dispatching' | 'runtime_accepted' | 'queued' | 'settled';
|
|
48
|
+
export interface LocalTaskCommandResult {
|
|
49
|
+
status: string;
|
|
50
|
+
messageId?: string;
|
|
51
|
+
runId?: string;
|
|
52
|
+
}
|
|
53
|
+
export type LocalTaskCommandReply = {
|
|
54
|
+
disposition: 'accepted' | 'duplicate';
|
|
55
|
+
commandId: string;
|
|
56
|
+
stage: LocalTaskCommandStage;
|
|
57
|
+
result: LocalTaskCommandResult;
|
|
58
|
+
} | {
|
|
59
|
+
disposition: 'reconciling';
|
|
60
|
+
commandId: string;
|
|
61
|
+
reasonCode: string;
|
|
62
|
+
} | {
|
|
63
|
+
disposition: 'rejected';
|
|
64
|
+
commandId: string;
|
|
65
|
+
code: 'stale' | 'payload_conflict' | 'invalid' | 'unavailable';
|
|
66
|
+
causeCode?: string;
|
|
67
|
+
message?: string;
|
|
68
|
+
};
|
|
69
|
+
/** Internal journal payload. Contains identifiers, never a second copy of the user's prompt. */
|
|
70
|
+
export interface LocalTaskCommandRecord {
|
|
71
|
+
version: 1;
|
|
72
|
+
commandId: string;
|
|
73
|
+
kind: LocalTaskCommand['kind'];
|
|
74
|
+
fingerprint: string;
|
|
75
|
+
stage: LocalTaskCommandStage;
|
|
76
|
+
messageId?: string;
|
|
77
|
+
targetRunId?: string;
|
|
78
|
+
restartMessageId?: string;
|
|
79
|
+
pendingMessageId?: string;
|
|
80
|
+
interactionId?: string;
|
|
81
|
+
outcomeFingerprint?: string;
|
|
82
|
+
result?: LocalTaskCommandResult;
|
|
83
|
+
rejection?: Extract<LocalTaskCommandReply, {
|
|
84
|
+
disposition: 'rejected';
|
|
85
|
+
}>;
|
|
86
|
+
}
|
|
87
|
+
export interface LocalTaskCommandTargets {
|
|
88
|
+
activeRunId: string | null;
|
|
89
|
+
planRunId?: string | null;
|
|
90
|
+
queueVersion: string;
|
|
91
|
+
historyVersion: string;
|
|
92
|
+
}
|
|
93
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { LocalTaskEvent } from './local-task-api.js';
|
|
2
|
+
export interface LocalTaskTextChunk {
|
|
3
|
+
id: string;
|
|
4
|
+
sequence?: number;
|
|
5
|
+
createdAt: string;
|
|
6
|
+
text: string;
|
|
7
|
+
}
|
|
8
|
+
export interface LocalTaskTextSpan extends Omit<LocalTaskTextChunk, 'text'> {
|
|
9
|
+
start: number;
|
|
10
|
+
end: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function textField(event: LocalTaskEvent): string | undefined;
|
|
13
|
+
export declare function textIdentity(event: LocalTaskEvent): string;
|
|
14
|
+
export declare function taskEventChunks(event: LocalTaskEvent): LocalTaskTextChunk[];
|
|
15
|
+
/** A display projection only. Original journal events and runtime cursors are never rewritten. */
|
|
16
|
+
export declare class LocalTaskEventProjection {
|
|
17
|
+
private events;
|
|
18
|
+
private lastIdentity;
|
|
19
|
+
private ownsLast;
|
|
20
|
+
private lastSource?;
|
|
21
|
+
constructor(events?: LocalTaskEvent[]);
|
|
22
|
+
append(event: LocalTaskEvent, chunk?: LocalTaskTextChunk): void;
|
|
23
|
+
snapshot(): LocalTaskEvent[];
|
|
24
|
+
}
|
|
25
|
+
export declare function appendProjectedTaskEvents(current: LocalTaskEvent[], incoming: LocalTaskEvent[]): LocalTaskEvent[];
|
|
26
|
+
export declare function projectTaskEvents(events: LocalTaskEvent[]): LocalTaskEvent[];
|
|
27
|
+
export declare function lastDisplayEventId(event: LocalTaskEvent): string;
|
|
28
|
+
/** Resolve overlapping display blocks only; unchanged history never expands into individual deltas. */
|
|
29
|
+
export declare function mergeProjectedTaskEvents(persisted: LocalTaskEvent[], live: LocalTaskEvent[]): LocalTaskEvent[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { LocalTask, LocalTaskEvent, LocalTaskExecutionState, LocalTaskInteraction, LocalTaskMessagePage, LocalTaskPendingMessage } from './local-task-api.js';
|
|
2
|
+
export interface LocalTaskStateCursor {
|
|
3
|
+
publisherEpoch: string;
|
|
4
|
+
revision: number;
|
|
5
|
+
}
|
|
6
|
+
export interface LocalTaskSnapshot {
|
|
7
|
+
task: LocalTask;
|
|
8
|
+
messages: LocalTaskMessagePage;
|
|
9
|
+
pendingMessages: LocalTaskPendingMessage[];
|
|
10
|
+
interactions: LocalTaskInteraction[];
|
|
11
|
+
execution: LocalTaskExecutionState;
|
|
12
|
+
/** Current unfinished assistant item; persisted messages remain the history authority. */
|
|
13
|
+
assistantStream?: {
|
|
14
|
+
runId: string;
|
|
15
|
+
itemId?: string;
|
|
16
|
+
content: string;
|
|
17
|
+
};
|
|
18
|
+
cursor: LocalTaskStateCursor;
|
|
19
|
+
}
|
|
20
|
+
export interface LocalTaskStateBatch {
|
|
21
|
+
taskId: string;
|
|
22
|
+
subscriptionId: string;
|
|
23
|
+
publisherEpoch: string;
|
|
24
|
+
fromRevision: number;
|
|
25
|
+
toRevision: number;
|
|
26
|
+
events: LocalTaskEvent[];
|
|
27
|
+
resnapshot: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare function classifyStateBatch(cursor: LocalTaskStateCursor, batch: LocalTaskStateBatch): 'apply' | 'duplicate' | 'resnapshot';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { AuthSession } from './desktop-api.js';
|
|
2
|
+
import type { ExecutionBinding } from './execution-context.js';
|
|
3
|
+
export interface ManagedPrincipal {
|
|
4
|
+
userId: string;
|
|
5
|
+
tenantId: string | null;
|
|
6
|
+
workspaceId: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface ManagedAuthentication {
|
|
9
|
+
kind: 'managed';
|
|
10
|
+
principal: ManagedPrincipal;
|
|
11
|
+
/** Additional origins allowed to receive platform credentials. The platform origin is always included. */
|
|
12
|
+
allowedOrigins?: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface ManagedCredential {
|
|
15
|
+
accessToken: string;
|
|
16
|
+
session: AuthSession;
|
|
17
|
+
}
|
|
18
|
+
export type CredentialReason = 'initial' | 'expiring' | 'rejected' | 'explicit';
|
|
19
|
+
export interface ManagedCredentialRequest {
|
|
20
|
+
reason: CredentialReason;
|
|
21
|
+
signal: AbortSignal;
|
|
22
|
+
/** Trusted run identity. Absent for instance-level platform management requests. */
|
|
23
|
+
execution?: Readonly<ExecutionBinding>;
|
|
24
|
+
}
|
|
25
|
+
export type CredentialProvider = (request: ManagedCredentialRequest) => Promise<ManagedCredential | null>;
|
|
26
|
+
export interface ManagedAuthorizationEvent {
|
|
27
|
+
cursor: string;
|
|
28
|
+
occurredAt: string;
|
|
29
|
+
type: 'authorized' | 'invalidated';
|
|
30
|
+
scope: 'credential' | 'provider';
|
|
31
|
+
reason: CredentialReason | 'expired' | 'revoked' | 'provider_error' | 'closed';
|
|
32
|
+
execution?: ExecutionBinding;
|
|
33
|
+
expiresAt?: string;
|
|
34
|
+
code?: string;
|
|
35
|
+
}
|
|
36
|
+
/** Private process transport metadata, never a platform access/refresh token. */
|
|
37
|
+
export interface CredentialConnection {
|
|
38
|
+
url: string;
|
|
39
|
+
token: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ManagedAuthorizationConnection extends CredentialConnection {
|
|
42
|
+
handle: string;
|
|
43
|
+
platformBaseUrl: string;
|
|
44
|
+
principal: ManagedPrincipal;
|
|
45
|
+
allowedOrigins: string[];
|
|
46
|
+
/** Resolved from authenticated platform model details, keyed by model code. */
|
|
47
|
+
configuredModelOrigins?: Record<string, string[]>;
|
|
48
|
+
}
|
|
49
|
+
export interface AuthorizedPlatformContext {
|
|
50
|
+
accessToken: string;
|
|
51
|
+
sessionId: string | null;
|
|
52
|
+
platformBaseUrl: string;
|
|
53
|
+
tenantId: string | null;
|
|
54
|
+
userId: string | null;
|
|
55
|
+
workspaceId: string | null;
|
|
56
|
+
}
|
|
57
|
+
export interface ManagedAuthorizationSource {
|
|
58
|
+
getSession(): AuthSession | null;
|
|
59
|
+
authorize(): Promise<AuthorizedPlatformContext>;
|
|
60
|
+
refresh(): Promise<AuthSession>;
|
|
61
|
+
invalidate(reason: string): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
export declare function authorizationError(code: string, message: string): Error & {
|
|
64
|
+
code: string;
|
|
65
|
+
};
|
|
66
|
+
export declare function validateManagedAuthentication(value: ManagedAuthentication, platformBaseUrl: string): ManagedAuthentication;
|
|
67
|
+
export declare function validateCredentialConnection(value: CredentialConnection): CredentialConnection;
|
|
68
|
+
export declare function validateManagedCredential(value: ManagedCredential, principal: ManagedPrincipal, platformBaseUrl: string, now?: number): {
|
|
69
|
+
credential: ManagedCredential;
|
|
70
|
+
expiresAt: number;
|
|
71
|
+
sessionId: string | null;
|
|
72
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { MemoryRecord, MemoryScope, MemoryState } from './local-memory.js';
|
|
2
|
+
export interface MemoryExtractionPolicy {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
idleMs?: number;
|
|
5
|
+
model?: string;
|
|
6
|
+
instructions?: string;
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface MemoryConfiguration {
|
|
10
|
+
storage?: 'local' | 'external';
|
|
11
|
+
extraction?: MemoryExtractionPolicy;
|
|
12
|
+
}
|
|
13
|
+
export interface MemorySnapshot {
|
|
14
|
+
state: MemoryState;
|
|
15
|
+
records: MemoryRecord[];
|
|
16
|
+
}
|
|
17
|
+
export interface MemoryStoreAdapter {
|
|
18
|
+
read(scope: Readonly<MemoryScope>, signal?: AbortSignal): Promise<{
|
|
19
|
+
version: string;
|
|
20
|
+
snapshot: MemorySnapshot;
|
|
21
|
+
} | null>;
|
|
22
|
+
/** Atomic compare-and-swap; a conflict must throw, never overwrite a newer revision. */
|
|
23
|
+
compareAndSwap(request: {
|
|
24
|
+
scope: Readonly<MemoryScope>;
|
|
25
|
+
expectedVersion: string | null;
|
|
26
|
+
snapshot: MemorySnapshot;
|
|
27
|
+
operationId: string;
|
|
28
|
+
}, signal?: AbortSignal): Promise<{
|
|
29
|
+
version: string;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
32
|
+
export declare function validateMemoryConfiguration(value?: MemoryConfiguration): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ExecutionBinding } from './execution-context.js';
|
|
2
|
+
export interface ModelRoutingIdentity {
|
|
3
|
+
executionBinding?: ExecutionBinding;
|
|
4
|
+
currentUserId?: string;
|
|
5
|
+
currentUserName?: string;
|
|
6
|
+
currentOrgId?: string;
|
|
7
|
+
currentOrgName?: string;
|
|
8
|
+
ownerProjectId?: string;
|
|
9
|
+
ownerProjectName?: string;
|
|
10
|
+
ownerProjectType?: string;
|
|
11
|
+
ownerApplicationType?: string;
|
|
12
|
+
ownerWorkspaceId?: string;
|
|
13
|
+
ownerWorkspaceName?: string;
|
|
14
|
+
ownerOrgId?: string;
|
|
15
|
+
ownerOrgName?: string;
|
|
16
|
+
ownerUserId?: string;
|
|
17
|
+
ownerUserName?: string;
|
|
18
|
+
ownerWorkflowId?: string;
|
|
19
|
+
ownerWorkflowName?: string;
|
|
20
|
+
ownerPluginId?: string;
|
|
21
|
+
ownerPluginName?: string;
|
|
22
|
+
runtimeEnv?: string;
|
|
23
|
+
usageScene?: string;
|
|
24
|
+
/** @deprecated Use ownerWorkspaceId for new requests. */
|
|
25
|
+
workspaceId?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const LICOS_MODEL_ROUTING_HEADER_NAMES: readonly ["X-Licos-Current-User-Id", "X-Licos-Current-User-Name", "X-Licos-Current-Org-Id", "X-Licos-Current-Org-Name", "X-Licos-Owner-Project-Id", "X-Licos-Owner-Project-Name", "X-Licos-Owner-Project-Type", "X-Licos-Owner-Application-Type", "X-Licos-Owner-Workspace-Id", "X-Licos-Owner-Workspace-Name", "X-Licos-Owner-Org-Id", "X-Licos-Owner-Org-Name", "X-Licos-Owner-User-Id", "X-Licos-Owner-User-Name", "X-Licos-Owner-Workflow-Id", "X-Licos-Owner-Workflow-Name", "X-Licos-Owner-Plugin-Id", "X-Licos-Owner-Plugin-Name", "X-Licos-Runtime-Env", "X-Licos-UsagScene"];
|
|
28
|
+
export declare function encodeLicosHeaderValue(name: string, value: string): string;
|
|
29
|
+
export declare function modelRoutingHeaders(identity: ModelRoutingIdentity, usageScene?: string | undefined): {
|
|
30
|
+
'X-AIOS-Execution-Context'?: string | undefined;
|
|
31
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const DEFAULT_LOCAL_TASK_CONTEXT_WINDOW: number;
|
|
2
|
+
export type ModelReasoningEffort = 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
3
|
+
export interface ModelReasoningConfig {
|
|
4
|
+
mode: 'disabled' | 'optional' | 'required';
|
|
5
|
+
efforts: ModelReasoningEffort[];
|
|
6
|
+
defaultEffort: ModelReasoningEffort | null;
|
|
7
|
+
xhighEffort: 'xhigh' | 'max' | null;
|
|
8
|
+
}
|
|
9
|
+
export declare function isModelReasoningEffort(value: unknown): value is ModelReasoningEffort;
|
|
10
|
+
export declare function parseModelReasoningEffort(value: unknown): ModelReasoningEffort | undefined;
|
|
11
|
+
export declare function parseModelThinkingEnabled(value: unknown): boolean | undefined;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { ExpertTeamRunSnapshot } from './expert-team-api.js';
|
|
2
|
+
import type { LocalTaskProfessionReference } from './local-task-api.js';
|
|
3
|
+
export type MyExpertType = 'agent' | 'team';
|
|
4
|
+
export interface ExpertResourceMapping {
|
|
5
|
+
reference: string;
|
|
6
|
+
folderName: string;
|
|
7
|
+
sha256: string;
|
|
8
|
+
}
|
|
9
|
+
export interface MyExpertManifest {
|
|
10
|
+
schemaVersion: 1;
|
|
11
|
+
packageFormat: 'aios-expert';
|
|
12
|
+
name: string;
|
|
13
|
+
version: string;
|
|
14
|
+
expertType: MyExpertType;
|
|
15
|
+
agentName: string;
|
|
16
|
+
displayName: string;
|
|
17
|
+
displayDescription: string;
|
|
18
|
+
description: string;
|
|
19
|
+
profession: string;
|
|
20
|
+
avatar: string;
|
|
21
|
+
agents: string | string[];
|
|
22
|
+
tags: [string, string, string];
|
|
23
|
+
quickPrompts: [string, string, string];
|
|
24
|
+
teamInfo?: {
|
|
25
|
+
leadAgent: string;
|
|
26
|
+
memberAgents: string[];
|
|
27
|
+
};
|
|
28
|
+
members?: Array<{
|
|
29
|
+
id: string;
|
|
30
|
+
role: 'lead' | 'member';
|
|
31
|
+
avatar: string;
|
|
32
|
+
displayName: string;
|
|
33
|
+
profession: string;
|
|
34
|
+
}>;
|
|
35
|
+
skills?: string[];
|
|
36
|
+
}
|
|
37
|
+
export interface MyExpertAgentDefinition {
|
|
38
|
+
id: string;
|
|
39
|
+
displayName: string;
|
|
40
|
+
profession: string;
|
|
41
|
+
description: string;
|
|
42
|
+
instructions: string;
|
|
43
|
+
maxTurns: number | null;
|
|
44
|
+
skills: string[];
|
|
45
|
+
role: 'lead' | 'member';
|
|
46
|
+
avatarRelativePath: string;
|
|
47
|
+
}
|
|
48
|
+
export interface MyExpertSummary {
|
|
49
|
+
expertId: string;
|
|
50
|
+
version: string;
|
|
51
|
+
expertType: MyExpertType;
|
|
52
|
+
displayName: string;
|
|
53
|
+
alias: string;
|
|
54
|
+
profession: string;
|
|
55
|
+
description: string;
|
|
56
|
+
tags: [string, string, string];
|
|
57
|
+
avatarDataUrl: string | null;
|
|
58
|
+
memberCount: number;
|
|
59
|
+
createdAt: string;
|
|
60
|
+
updatedAt: string;
|
|
61
|
+
}
|
|
62
|
+
export interface MyExpertDetail extends MyExpertSummary {
|
|
63
|
+
quickPrompts: [string, string, string];
|
|
64
|
+
agents: MyExpertAgentDefinition[];
|
|
65
|
+
packagePath: string;
|
|
66
|
+
}
|
|
67
|
+
export interface ListMyExpertsQuery {
|
|
68
|
+
expertType?: MyExpertType;
|
|
69
|
+
keyword?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface MyExpertPublishResult {
|
|
72
|
+
expertId: string;
|
|
73
|
+
version: string;
|
|
74
|
+
expertType: MyExpertType;
|
|
75
|
+
created: boolean;
|
|
76
|
+
contentHash: string;
|
|
77
|
+
}
|
|
78
|
+
export interface MyExpertAuthoringAgent {
|
|
79
|
+
id: string;
|
|
80
|
+
displayName: string;
|
|
81
|
+
profession: string;
|
|
82
|
+
description: string;
|
|
83
|
+
instructions: string;
|
|
84
|
+
maxTurns: number;
|
|
85
|
+
skills: string[];
|
|
86
|
+
}
|
|
87
|
+
export interface MyExpertAuthoringDraft {
|
|
88
|
+
name: string;
|
|
89
|
+
version: string;
|
|
90
|
+
expertType: MyExpertType;
|
|
91
|
+
displayName: string;
|
|
92
|
+
displayDescription: string;
|
|
93
|
+
description: string;
|
|
94
|
+
profession: string;
|
|
95
|
+
tags: [string, string, string];
|
|
96
|
+
quickPrompts: [string, string, string];
|
|
97
|
+
leadAgent: string;
|
|
98
|
+
agents: MyExpertAuthoringAgent[];
|
|
99
|
+
}
|
|
100
|
+
export interface MyExpertApi {
|
|
101
|
+
list: (query?: ListMyExpertsQuery) => Promise<MyExpertSummary[]>;
|
|
102
|
+
get: (expertId: string) => Promise<MyExpertDetail>;
|
|
103
|
+
prepareForLocalTask: (expertId: string) => Promise<LocalTaskProfessionReference>;
|
|
104
|
+
openDirectory: (expertId: string) => Promise<void>;
|
|
105
|
+
remove: (expertId: string) => Promise<void>;
|
|
106
|
+
onChanged: (listener: () => void) => () => void;
|
|
107
|
+
}
|
|
108
|
+
export interface ValidatedMyExpertPackage {
|
|
109
|
+
manifest: MyExpertManifest;
|
|
110
|
+
files: Array<{
|
|
111
|
+
relativePath: string;
|
|
112
|
+
absolutePath: string;
|
|
113
|
+
sizeBytes: number;
|
|
114
|
+
}>;
|
|
115
|
+
contentHash: string;
|
|
116
|
+
agent: MyExpertAgentDefinition | null;
|
|
117
|
+
agents: MyExpertAgentDefinition[];
|
|
118
|
+
teamSnapshot: ExpertTeamRunSnapshot | null;
|
|
119
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ProtocolTarget = {
|
|
2
|
+
kind: 'external';
|
|
3
|
+
url: string;
|
|
4
|
+
} | {
|
|
5
|
+
kind: 'app';
|
|
6
|
+
resourceType: string;
|
|
7
|
+
resourceId: string;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'page';
|
|
10
|
+
path: string;
|
|
11
|
+
};
|
|
12
|
+
export interface InAppBrowserTarget {
|
|
13
|
+
url: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface NavigationApi {
|
|
17
|
+
openExternal(url: string): Promise<void>;
|
|
18
|
+
resolveInAppTarget(target: ProtocolTarget): Promise<InAppBrowserTarget>;
|
|
19
|
+
openProtocolTarget(target: ProtocolTarget): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { DocumentEdit, DocumentEditorVersion, DocumentSelection } from './document-session-api.js';
|
|
2
|
+
export interface OfficeEditorRequest {
|
|
3
|
+
requestId: string;
|
|
4
|
+
documentId: string;
|
|
5
|
+
action: 'snapshot' | 'apply' | 'save';
|
|
6
|
+
expectedEditorRevision?: number;
|
|
7
|
+
expectedDiskRevision?: string;
|
|
8
|
+
edit?: DocumentEdit;
|
|
9
|
+
}
|
|
10
|
+
export interface OfficeEditorResponse {
|
|
11
|
+
requestId: string;
|
|
12
|
+
result?: {
|
|
13
|
+
version: DocumentEditorVersion;
|
|
14
|
+
selection: DocumentSelection | null;
|
|
15
|
+
data?: Uint8Array;
|
|
16
|
+
};
|
|
17
|
+
error?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface OfficeDocument {
|
|
20
|
+
id: string;
|
|
21
|
+
filePath: string;
|
|
22
|
+
name: string;
|
|
23
|
+
revision: string;
|
|
24
|
+
sizeBytes: number;
|
|
25
|
+
}
|
|
26
|
+
export interface OfficeDocumentContent extends OfficeDocument {
|
|
27
|
+
data: Uint8Array;
|
|
28
|
+
}
|
|
29
|
+
export interface OfficeWindowSnapshot {
|
|
30
|
+
documents: OfficeDocument[];
|
|
31
|
+
activeDocumentId: string | null;
|
|
32
|
+
recentFiles: string[];
|
|
33
|
+
}
|
|
34
|
+
export type OfficeMainSection = 'skills' | 'plugins' | 'experts';
|
|
35
|
+
export interface OfficeWindowApi {
|
|
36
|
+
openTaskEditor(request: import('./local-task-api.js').LocalTaskFileRequest): Promise<OfficeDocumentContent>;
|
|
37
|
+
readTaskEditor(id: string): Promise<OfficeDocumentContent>;
|
|
38
|
+
saveTaskEditor(request: {
|
|
39
|
+
id: string;
|
|
40
|
+
data: Uint8Array;
|
|
41
|
+
expectedRevision: string;
|
|
42
|
+
}): Promise<OfficeDocument>;
|
|
43
|
+
closeTaskEditor(id: string): Promise<void>;
|
|
44
|
+
onTaskEditorFileChanged(listener: (id: string) => void): () => void;
|
|
45
|
+
respondTaskEditor(request: {
|
|
46
|
+
documentId: string;
|
|
47
|
+
response: OfficeEditorResponse;
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
openTaskFile(request: import('./local-task-api.js').LocalTaskFileRequest): Promise<void>;
|
|
50
|
+
focusTaskFile(request: import('./local-task-api.js').LocalTaskFileRequest): Promise<boolean>;
|
|
51
|
+
isTaskFileOpen(request: import('./local-task-api.js').LocalTaskFileRequest): Promise<boolean>;
|
|
52
|
+
onDocumentsChanged(listener: () => void): () => void;
|
|
53
|
+
openFiles(request: {
|
|
54
|
+
paths: string[];
|
|
55
|
+
}): Promise<void>;
|
|
56
|
+
chooseFiles(): Promise<void>;
|
|
57
|
+
createDocument(extension: 'txt' | 'md' | 'docx' | 'xlsx' | 'pptx'): Promise<void>;
|
|
58
|
+
getSnapshot(): Promise<OfficeWindowSnapshot>;
|
|
59
|
+
consumeErrors(): Promise<string[]>;
|
|
60
|
+
onErrors(listener: () => void): () => void;
|
|
61
|
+
readDocument(id: string): Promise<OfficeDocumentContent>;
|
|
62
|
+
saveDocument(request: {
|
|
63
|
+
id: string;
|
|
64
|
+
data: Uint8Array;
|
|
65
|
+
expectedRevision: string;
|
|
66
|
+
}): Promise<OfficeDocument>;
|
|
67
|
+
setDirty(request: {
|
|
68
|
+
id: string;
|
|
69
|
+
dirty: boolean;
|
|
70
|
+
}): Promise<void>;
|
|
71
|
+
activateDocument(id: string): Promise<void>;
|
|
72
|
+
closeDocument(id: string): Promise<boolean>;
|
|
73
|
+
revealDocument(id: string): Promise<void>;
|
|
74
|
+
openMainWindow(section?: OfficeMainSection): Promise<void>;
|
|
75
|
+
consumeMainNavigation(): Promise<OfficeMainSection | null>;
|
|
76
|
+
onMainNavigation(listener: () => void): () => void;
|
|
77
|
+
onChanged(listener: (snapshot: OfficeWindowSnapshot) => void): () => void;
|
|
78
|
+
onFileChanged(listener: (id: string) => void): () => void;
|
|
79
|
+
onEditorRequest(listener: (request: OfficeEditorRequest) => void): () => void;
|
|
80
|
+
respondEditor(response: OfficeEditorResponse): Promise<void>;
|
|
81
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export interface PlatformBrandingIdentity {
|
|
2
|
+
brandName: string;
|
|
3
|
+
brandShortName: string;
|
|
4
|
+
productPrimaryName: string;
|
|
5
|
+
productSecondaryName: string;
|
|
6
|
+
platformDisplayName: string;
|
|
7
|
+
siteTitle: string;
|
|
8
|
+
siteDescription: string;
|
|
9
|
+
companyLegalName: string;
|
|
10
|
+
officialPublisherName: string;
|
|
11
|
+
}
|
|
12
|
+
export interface PlatformBrandingAssets {
|
|
13
|
+
logoLightUrl: string;
|
|
14
|
+
logoDarkUrl: string;
|
|
15
|
+
compactLogoLightUrl: string;
|
|
16
|
+
compactLogoDarkUrl: string;
|
|
17
|
+
faviconUrl: string;
|
|
18
|
+
appleTouchIconUrl: string;
|
|
19
|
+
shareImageUrl: string;
|
|
20
|
+
portalHeroBackgroundUrl: string;
|
|
21
|
+
productArchitectureImageUrl: string;
|
|
22
|
+
officialAccountQrUrl: string;
|
|
23
|
+
videoAccountQrUrl: string;
|
|
24
|
+
}
|
|
25
|
+
export interface PlatformBrandingContact {
|
|
26
|
+
phone: string;
|
|
27
|
+
phoneDescription: string;
|
|
28
|
+
email: string;
|
|
29
|
+
address: string;
|
|
30
|
+
}
|
|
31
|
+
export interface PlatformBrandingLinks {
|
|
32
|
+
documentationUrl: string;
|
|
33
|
+
termsUrl: string;
|
|
34
|
+
privacyUrl: string;
|
|
35
|
+
dataProcessingUrl: string;
|
|
36
|
+
}
|
|
37
|
+
export interface PlatformBrandingLegal {
|
|
38
|
+
copyrightText: string;
|
|
39
|
+
icpNumber: string;
|
|
40
|
+
icpUrl: string;
|
|
41
|
+
publicSecurityNumber: string;
|
|
42
|
+
publicSecurityUrl: string;
|
|
43
|
+
}
|
|
44
|
+
export interface PlatformBrandingProducts {
|
|
45
|
+
codingDisplayName: string;
|
|
46
|
+
codingWelcomeTitle: string;
|
|
47
|
+
desktopClientName: string;
|
|
48
|
+
mobileClientName: string;
|
|
49
|
+
adminConsoleName: string;
|
|
50
|
+
}
|
|
51
|
+
export interface PlatformBrandingValues {
|
|
52
|
+
identity: PlatformBrandingIdentity;
|
|
53
|
+
assets: PlatformBrandingAssets;
|
|
54
|
+
contact: PlatformBrandingContact;
|
|
55
|
+
links: PlatformBrandingLinks;
|
|
56
|
+
legal: PlatformBrandingLegal;
|
|
57
|
+
products: PlatformBrandingProducts;
|
|
58
|
+
}
|
|
59
|
+
export interface PublicPlatformBranding {
|
|
60
|
+
version: number;
|
|
61
|
+
publishedAt?: string;
|
|
62
|
+
values: PlatformBrandingValues;
|
|
63
|
+
}
|
|
64
|
+
export interface PlatformBrandingApi {
|
|
65
|
+
getCurrent(): Promise<PublicPlatformBranding>;
|
|
66
|
+
}
|