@antigma/ante-remote-protocol 0.1.0
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/dist/index.d.ts +176 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/package.json +25 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
export type PeerRole = "host" | "browser";
|
|
2
|
+
export type PermissionMode = "default" | "acceptEdits" | "bypassPermissions" | "plan" | "dontAsk" | "auto";
|
|
3
|
+
export type ApprovalDecision = "Accept" | "AcceptForSession" | "Skip" | "Abort";
|
|
4
|
+
export interface MachineIdentity {
|
|
5
|
+
machineId: string;
|
|
6
|
+
machineName: string;
|
|
7
|
+
token?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface MachineStatus {
|
|
10
|
+
machineId: string;
|
|
11
|
+
machineName?: string;
|
|
12
|
+
online: boolean;
|
|
13
|
+
anteReady?: boolean;
|
|
14
|
+
activeSessionId?: string | null;
|
|
15
|
+
lastSeenAt: string;
|
|
16
|
+
capabilities?: string[];
|
|
17
|
+
runtimeTarget?: {
|
|
18
|
+
provider: string;
|
|
19
|
+
model: string;
|
|
20
|
+
source: "ante-defaults" | "env" | "fallback";
|
|
21
|
+
};
|
|
22
|
+
error?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface LinkCodeRequest {
|
|
25
|
+
machineName?: string;
|
|
26
|
+
machineId?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface LinkCodeResponse {
|
|
29
|
+
machineId: string;
|
|
30
|
+
token: string;
|
|
31
|
+
pairingCode: string;
|
|
32
|
+
serverUrl: string;
|
|
33
|
+
expiresAt: string;
|
|
34
|
+
expiresInSeconds: number;
|
|
35
|
+
hostPath: string;
|
|
36
|
+
hostWsUrl: string;
|
|
37
|
+
browserPath: string;
|
|
38
|
+
browserWsUrl: string;
|
|
39
|
+
hostCommand: string;
|
|
40
|
+
}
|
|
41
|
+
export interface SessionOptions {
|
|
42
|
+
cwd?: string;
|
|
43
|
+
provider?: string;
|
|
44
|
+
model?: string;
|
|
45
|
+
permissionMode?: PermissionMode;
|
|
46
|
+
resumeSessionId?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface ConversationRoute {
|
|
49
|
+
clientConversationId?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface ApprovalTool {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
argsText?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface ApprovalRequest {
|
|
57
|
+
turnId: string;
|
|
58
|
+
message: string;
|
|
59
|
+
tools: ApprovalTool[];
|
|
60
|
+
}
|
|
61
|
+
export interface RemoteEnvelope<TPayload = unknown> {
|
|
62
|
+
id: string;
|
|
63
|
+
type: string;
|
|
64
|
+
createdAt: string;
|
|
65
|
+
payload: TPayload;
|
|
66
|
+
}
|
|
67
|
+
export type HostHello = RemoteEnvelope<MachineIdentity & {
|
|
68
|
+
capabilities: string[];
|
|
69
|
+
}> & {
|
|
70
|
+
type: "host.hello";
|
|
71
|
+
};
|
|
72
|
+
export type BrowserHello = RemoteEnvelope<{
|
|
73
|
+
machineId: string;
|
|
74
|
+
token?: string;
|
|
75
|
+
}> & {
|
|
76
|
+
type: "browser.hello";
|
|
77
|
+
};
|
|
78
|
+
export type BrowserCommand = (RemoteEnvelope<{
|
|
79
|
+
options?: SessionOptions;
|
|
80
|
+
}> & {
|
|
81
|
+
type: "session.start";
|
|
82
|
+
}) | (RemoteEnvelope<{
|
|
83
|
+
sessionId?: string;
|
|
84
|
+
text: string;
|
|
85
|
+
options?: SessionOptions;
|
|
86
|
+
} & ConversationRoute> & {
|
|
87
|
+
type: "user.message";
|
|
88
|
+
}) | (RemoteEnvelope<{
|
|
89
|
+
sessionId?: string;
|
|
90
|
+
approval: ApprovalRequest;
|
|
91
|
+
decision: ApprovalDecision;
|
|
92
|
+
} & ConversationRoute> & {
|
|
93
|
+
type: "approval.reply";
|
|
94
|
+
}) | (RemoteEnvelope<{
|
|
95
|
+
sessionId?: string;
|
|
96
|
+
} & ConversationRoute> & {
|
|
97
|
+
type: "session.interrupt";
|
|
98
|
+
}) | (RemoteEnvelope<Record<string, never>> & {
|
|
99
|
+
type: "session.reset";
|
|
100
|
+
}) | (RemoteEnvelope<Record<string, never>> & {
|
|
101
|
+
type: "browser.ping";
|
|
102
|
+
});
|
|
103
|
+
export type HostEvent = (RemoteEnvelope<MachineStatus> & {
|
|
104
|
+
type: "machine.status";
|
|
105
|
+
}) | (RemoteEnvelope<{
|
|
106
|
+
sessionId: string;
|
|
107
|
+
cwd?: string;
|
|
108
|
+
provider?: string;
|
|
109
|
+
model?: string;
|
|
110
|
+
} & ConversationRoute> & {
|
|
111
|
+
type: "session.started";
|
|
112
|
+
}) | (RemoteEnvelope<{
|
|
113
|
+
sessionId?: string;
|
|
114
|
+
text: string;
|
|
115
|
+
kind: "answer" | "thinking";
|
|
116
|
+
} & ConversationRoute> & {
|
|
117
|
+
type: "assistant.delta";
|
|
118
|
+
}) | (RemoteEnvelope<{
|
|
119
|
+
sessionId?: string;
|
|
120
|
+
text: string;
|
|
121
|
+
} & ConversationRoute> & {
|
|
122
|
+
type: "assistant.message";
|
|
123
|
+
}) | (RemoteEnvelope<{
|
|
124
|
+
sessionId?: string;
|
|
125
|
+
approval: ApprovalRequest;
|
|
126
|
+
} & ConversationRoute> & {
|
|
127
|
+
type: "approval.required";
|
|
128
|
+
}) | (RemoteEnvelope<{
|
|
129
|
+
sessionId?: string;
|
|
130
|
+
tool: unknown;
|
|
131
|
+
phase: "start" | "end";
|
|
132
|
+
} & ConversationRoute> & {
|
|
133
|
+
type: "tool.event";
|
|
134
|
+
}) | (RemoteEnvelope<{
|
|
135
|
+
sessionId?: string;
|
|
136
|
+
status: "completed" | "failed" | "cancelled";
|
|
137
|
+
error?: string;
|
|
138
|
+
} & ConversationRoute> & {
|
|
139
|
+
type: "session.done";
|
|
140
|
+
}) | (RemoteEnvelope<{
|
|
141
|
+
sessionId?: string;
|
|
142
|
+
stream: "stdout" | "stderr" | "system";
|
|
143
|
+
text: string;
|
|
144
|
+
} & ConversationRoute> & {
|
|
145
|
+
type: "diagnostic";
|
|
146
|
+
}) | (RemoteEnvelope<{
|
|
147
|
+
message: string;
|
|
148
|
+
}> & {
|
|
149
|
+
type: "host.error";
|
|
150
|
+
}) | (RemoteEnvelope<Record<string, never>> & {
|
|
151
|
+
type: "host.pong";
|
|
152
|
+
});
|
|
153
|
+
export type RelayNotice = (RemoteEnvelope<MachineStatus> & {
|
|
154
|
+
type: "relay.machine";
|
|
155
|
+
}) | (RemoteEnvelope<{
|
|
156
|
+
message: string;
|
|
157
|
+
}> & {
|
|
158
|
+
type: "relay.error";
|
|
159
|
+
}) | (RemoteEnvelope<{
|
|
160
|
+
token: string;
|
|
161
|
+
}> & {
|
|
162
|
+
type: "relay.auth";
|
|
163
|
+
}) | (RemoteEnvelope<{
|
|
164
|
+
role: PeerRole;
|
|
165
|
+
peerCount: number;
|
|
166
|
+
}> & {
|
|
167
|
+
type: "relay.presence";
|
|
168
|
+
});
|
|
169
|
+
export type RemoteMessage = HostHello | BrowserHello | BrowserCommand | HostEvent | RelayNotice;
|
|
170
|
+
export declare function createEnvelope<TPayload>(type: string, payload: TPayload): RemoteEnvelope<TPayload>;
|
|
171
|
+
export declare function encodeMessage(message: RemoteMessage): string;
|
|
172
|
+
export declare function decodeMessage(input: string | ArrayBuffer): RemoteMessage | null;
|
|
173
|
+
export declare function isBrowserCommand(message: RemoteMessage): message is BrowserCommand;
|
|
174
|
+
export declare function isHostEvent(message: RemoteMessage): message is HostEvent;
|
|
175
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
176
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,M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@
|
|
|
1
|
+
export function createEnvelope(type, payload) {
|
|
2
|
+
return {
|
|
3
|
+
id: cryptoRandomId(),
|
|
4
|
+
type,
|
|
5
|
+
createdAt: new Date().toISOString(),
|
|
6
|
+
payload,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export function encodeMessage(message) {
|
|
10
|
+
return JSON.stringify(message);
|
|
11
|
+
}
|
|
12
|
+
export function decodeMessage(input) {
|
|
13
|
+
const text = typeof input === "string" ? input : new TextDecoder().decode(input);
|
|
14
|
+
try {
|
|
15
|
+
const value = JSON.parse(text);
|
|
16
|
+
if (!isRecord(value) || typeof value.type !== "string" || !isRecord(value.payload)) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export function isBrowserCommand(message) {
|
|
26
|
+
return [
|
|
27
|
+
"session.start",
|
|
28
|
+
"user.message",
|
|
29
|
+
"approval.reply",
|
|
30
|
+
"session.interrupt",
|
|
31
|
+
"session.reset",
|
|
32
|
+
"browser.ping",
|
|
33
|
+
].includes(message.type);
|
|
34
|
+
}
|
|
35
|
+
export function isHostEvent(message) {
|
|
36
|
+
return [
|
|
37
|
+
"machine.status",
|
|
38
|
+
"session.started",
|
|
39
|
+
"assistant.delta",
|
|
40
|
+
"assistant.message",
|
|
41
|
+
"approval.required",
|
|
42
|
+
"tool.event",
|
|
43
|
+
"session.done",
|
|
44
|
+
"diagnostic",
|
|
45
|
+
"host.error",
|
|
46
|
+
"host.pong",
|
|
47
|
+
].includes(message.type);
|
|
48
|
+
}
|
|
49
|
+
export function isRecord(value) {
|
|
50
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
51
|
+
}
|
|
52
|
+
function cryptoRandomId() {
|
|
53
|
+
const globalCrypto = globalThis.crypto;
|
|
54
|
+
if (globalCrypto && "randomUUID" in globalCrypto) {
|
|
55
|
+
return globalCrypto.randomUUID();
|
|
56
|
+
}
|
|
57
|
+
return `msg_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAwIA,MAAM,UAAU,cAAc,CAC5B,IAAY,EACZ,OAAiB;IAEjB,OAAO;QACL,EAAE,EAAE,cAAc,EAAE;QACpB,IAAI;QACJ,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,OAAO;KACR,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,OAAsB;IAClD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAA2B;IACvD,MAAM,IAAI,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjF,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC;QAC1C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;YACnF,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAiC,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAsB;IACrD,OAAO;QACL,eAAe;QACf,cAAc;QACd,gBAAgB;QAChB,mBAAmB;QACnB,eAAe;QACf,cAAc;KACf,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAsB;IAChD,OAAO;QACL,gBAAgB;QAChB,iBAAiB;QACjB,iBAAiB;QACjB,mBAAmB;QACnB,mBAAmB;QACnB,YAAY;QACZ,cAAc;QACd,YAAY;QACZ,YAAY;QACZ,WAAW;KACZ,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,cAAc;IACrB,MAAM,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC;IACvC,IAAI,YAAY,IAAI,YAAY,IAAI,YAAY,EAAE,CAAC;QACjD,OAAO,YAAY,CAAC,UAAU,EAAE,CAAC;IACnC,CAAC;IACD,OAAO,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AACrF,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@antigma/ante-remote-protocol",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc -p tsconfig.json",
|
|
17
|
+
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
}
|
|
25
|
+
}
|