@ekkos/cli 1.3.1 → 1.3.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/dist/commands/dashboard.js +147 -57
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +54 -16
- package/dist/commands/run.js +163 -44
- package/dist/commands/status.d.ts +4 -1
- package/dist/commands/status.js +165 -27
- package/dist/commands/synk.d.ts +7 -0
- package/dist/commands/synk.js +339 -0
- package/dist/deploy/settings.d.ts +6 -5
- package/dist/deploy/settings.js +27 -17
- package/dist/index.js +12 -82
- package/dist/lib/usage-parser.d.ts +1 -1
- package/dist/lib/usage-parser.js +5 -3
- package/dist/local/index.d.ts +14 -0
- package/dist/local/index.js +28 -0
- package/dist/local/local-embeddings.d.ts +49 -0
- package/dist/local/local-embeddings.js +232 -0
- package/dist/local/offline-fallback.d.ts +44 -0
- package/dist/local/offline-fallback.js +159 -0
- package/dist/local/sqlite-store.d.ts +126 -0
- package/dist/local/sqlite-store.js +393 -0
- package/dist/local/sync-engine.d.ts +42 -0
- package/dist/local/sync-engine.js +223 -0
- package/dist/synk/api.d.ts +22 -0
- package/dist/synk/api.js +133 -0
- package/dist/synk/auth.d.ts +7 -0
- package/dist/synk/auth.js +30 -0
- package/dist/synk/config.d.ts +18 -0
- package/dist/synk/config.js +37 -0
- package/dist/synk/daemon/control-client.d.ts +11 -0
- package/dist/synk/daemon/control-client.js +101 -0
- package/dist/synk/daemon/control-server.d.ts +24 -0
- package/dist/synk/daemon/control-server.js +91 -0
- package/dist/synk/daemon/run.d.ts +14 -0
- package/dist/synk/daemon/run.js +338 -0
- package/dist/synk/encryption.d.ts +17 -0
- package/dist/synk/encryption.js +133 -0
- package/dist/synk/index.d.ts +13 -0
- package/dist/synk/index.js +36 -0
- package/dist/synk/machine-client.d.ts +42 -0
- package/dist/synk/machine-client.js +218 -0
- package/dist/synk/persistence.d.ts +51 -0
- package/dist/synk/persistence.js +211 -0
- package/dist/synk/qr.d.ts +5 -0
- package/dist/synk/qr.js +33 -0
- package/dist/synk/session-bridge.d.ts +58 -0
- package/dist/synk/session-bridge.js +171 -0
- package/dist/synk/session-client.d.ts +46 -0
- package/dist/synk/session-client.js +240 -0
- package/dist/synk/types.d.ts +574 -0
- package/dist/synk/types.js +74 -0
- package/dist/utils/platform.d.ts +5 -1
- package/dist/utils/platform.js +24 -4
- package/dist/utils/proxy-url.d.ts +10 -0
- package/dist/utils/proxy-url.js +19 -0
- package/dist/utils/state.d.ts +1 -1
- package/dist/utils/state.js +11 -3
- package/package.json +13 -4
- package/templates/claude-plugins-admin/AGENT_TEAM_PROPOSALS.md +0 -819
- package/templates/claude-plugins-admin/README.md +0 -446
- package/templates/claude-plugins-admin/autonomous-admin-agent/.claude-plugin/plugin.json +0 -8
- package/templates/claude-plugins-admin/autonomous-admin-agent/commands/agent.md +0 -595
- package/templates/claude-plugins-admin/backend-agent/.claude-plugin/plugin.json +0 -8
- package/templates/claude-plugins-admin/backend-agent/commands/backend.md +0 -798
- package/templates/claude-plugins-admin/deploy-guardian/.claude-plugin/plugin.json +0 -8
- package/templates/claude-plugins-admin/deploy-guardian/commands/deploy.md +0 -554
- package/templates/claude-plugins-admin/frontend-agent/.claude-plugin/plugin.json +0 -8
- package/templates/claude-plugins-admin/frontend-agent/commands/frontend.md +0 -881
- package/templates/claude-plugins-admin/mcp-server-manager/.claude-plugin/plugin.json +0 -8
- package/templates/claude-plugins-admin/mcp-server-manager/commands/mcp.md +0 -85
- package/templates/claude-plugins-admin/memory-system-monitor/.claude-plugin/plugin.json +0 -8
- package/templates/claude-plugins-admin/memory-system-monitor/commands/memory-health.md +0 -569
- package/templates/claude-plugins-admin/qa-agent/.claude-plugin/plugin.json +0 -8
- package/templates/claude-plugins-admin/qa-agent/commands/qa.md +0 -863
- package/templates/claude-plugins-admin/tech-lead-agent/.claude-plugin/plugin.json +0 -8
- package/templates/claude-plugins-admin/tech-lead-agent/commands/lead.md +0 -732
- package/templates/hooks-node/lib/state.js +0 -187
- package/templates/hooks-node/stop.js +0 -416
- package/templates/hooks-node/user-prompt-submit.js +0 -337
- package/templates/rules/00-hooks-contract.mdc +0 -89
- package/templates/rules/30-ekkos-core.mdc +0 -188
- package/templates/rules/31-ekkos-messages.mdc +0 -78
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for ekkOS_synk protocol
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export { SessionMessageContentSchema, SessionMessageSchema, UpdateBodySchema, UpdateMachineBodySchema, UpdateSchema, UpdateSessionBodySchema, } from '@ekkos/synk-wire';
|
|
6
|
+
export type { SessionMessage, SessionMessageContent, Update, UpdateBody, UpdateMachineBody, UpdateSessionBody, } from '@ekkos/synk-wire';
|
|
7
|
+
export type PermissionMode = 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan';
|
|
8
|
+
/** Socket events from server to client */
|
|
9
|
+
export interface ServerToClientEvents {
|
|
10
|
+
update: (data: any) => void;
|
|
11
|
+
'rpc-request': (data: {
|
|
12
|
+
method: string;
|
|
13
|
+
params: string;
|
|
14
|
+
}, callback: (response: string) => void) => void;
|
|
15
|
+
'rpc-registered': (data: {
|
|
16
|
+
method: string;
|
|
17
|
+
}) => void;
|
|
18
|
+
'rpc-unregistered': (data: {
|
|
19
|
+
method: string;
|
|
20
|
+
}) => void;
|
|
21
|
+
'rpc-error': (data: {
|
|
22
|
+
type: string;
|
|
23
|
+
error: string;
|
|
24
|
+
}) => void;
|
|
25
|
+
ephemeral: (data: {
|
|
26
|
+
type: 'activity';
|
|
27
|
+
id: string;
|
|
28
|
+
active: boolean;
|
|
29
|
+
activeAt: number;
|
|
30
|
+
thinking: boolean;
|
|
31
|
+
}) => void;
|
|
32
|
+
auth: (data: {
|
|
33
|
+
success: boolean;
|
|
34
|
+
user: string;
|
|
35
|
+
}) => void;
|
|
36
|
+
error: (data: {
|
|
37
|
+
message: string;
|
|
38
|
+
}) => void;
|
|
39
|
+
}
|
|
40
|
+
/** Socket events from client to server */
|
|
41
|
+
export interface ClientToServerEvents {
|
|
42
|
+
message: (data: {
|
|
43
|
+
sid: string;
|
|
44
|
+
message: any;
|
|
45
|
+
}) => void;
|
|
46
|
+
'session-alive': (data: {
|
|
47
|
+
sid: string;
|
|
48
|
+
time: number;
|
|
49
|
+
thinking: boolean;
|
|
50
|
+
mode?: 'local' | 'remote';
|
|
51
|
+
}) => void;
|
|
52
|
+
'session-end': (data: {
|
|
53
|
+
sid: string;
|
|
54
|
+
time: number;
|
|
55
|
+
}) => void;
|
|
56
|
+
'update-metadata': (data: {
|
|
57
|
+
sid: string;
|
|
58
|
+
expectedVersion: number;
|
|
59
|
+
metadata: string;
|
|
60
|
+
}, cb: (answer: any) => void) => void;
|
|
61
|
+
'update-state': (data: {
|
|
62
|
+
sid: string;
|
|
63
|
+
expectedVersion: number;
|
|
64
|
+
agentState: string | null;
|
|
65
|
+
}, cb: (answer: any) => void) => void;
|
|
66
|
+
'machine-alive': (data: {
|
|
67
|
+
machineId: string;
|
|
68
|
+
time: number;
|
|
69
|
+
}) => void;
|
|
70
|
+
'machine-update-state': (data: {
|
|
71
|
+
machineId: string;
|
|
72
|
+
daemonState: string;
|
|
73
|
+
expectedVersion: number;
|
|
74
|
+
}, cb: (answer: any) => void) => void;
|
|
75
|
+
'machine-update-metadata': (data: {
|
|
76
|
+
machineId: string;
|
|
77
|
+
metadata: string;
|
|
78
|
+
expectedVersion: number;
|
|
79
|
+
}, cb: (answer: any) => void) => void;
|
|
80
|
+
'ping': (callback: () => void) => void;
|
|
81
|
+
'rpc-register': (data: {
|
|
82
|
+
method: string;
|
|
83
|
+
}) => void;
|
|
84
|
+
'rpc-unregister': (data: {
|
|
85
|
+
method: string;
|
|
86
|
+
}) => void;
|
|
87
|
+
'rpc-call': (data: {
|
|
88
|
+
method: string;
|
|
89
|
+
params: string;
|
|
90
|
+
}, callback: (response: {
|
|
91
|
+
ok: boolean;
|
|
92
|
+
result?: string;
|
|
93
|
+
error?: string;
|
|
94
|
+
}) => void) => void;
|
|
95
|
+
'usage-report': (data: {
|
|
96
|
+
key: string;
|
|
97
|
+
sessionId: string;
|
|
98
|
+
tokens: Record<string, number>;
|
|
99
|
+
cost: Record<string, number>;
|
|
100
|
+
}) => void;
|
|
101
|
+
}
|
|
102
|
+
/** Session information */
|
|
103
|
+
export interface Session {
|
|
104
|
+
id: string;
|
|
105
|
+
seq: number;
|
|
106
|
+
encryptionKey: Uint8Array;
|
|
107
|
+
encryptionVariant: 'legacy' | 'dataKey';
|
|
108
|
+
metadata: Metadata;
|
|
109
|
+
metadataVersion: number;
|
|
110
|
+
agentState: AgentState | null;
|
|
111
|
+
agentStateVersion: number;
|
|
112
|
+
}
|
|
113
|
+
/** Machine metadata — static information (rarely changes) */
|
|
114
|
+
export declare const MachineMetadataSchema: z.ZodObject<{
|
|
115
|
+
host: z.ZodString;
|
|
116
|
+
platform: z.ZodString;
|
|
117
|
+
synkCliVersion: z.ZodString;
|
|
118
|
+
homeDir: z.ZodString;
|
|
119
|
+
synkHomeDir: z.ZodString;
|
|
120
|
+
}, "strip", z.ZodTypeAny, {
|
|
121
|
+
host?: string;
|
|
122
|
+
platform?: string;
|
|
123
|
+
synkCliVersion?: string;
|
|
124
|
+
homeDir?: string;
|
|
125
|
+
synkHomeDir?: string;
|
|
126
|
+
}, {
|
|
127
|
+
host?: string;
|
|
128
|
+
platform?: string;
|
|
129
|
+
synkCliVersion?: string;
|
|
130
|
+
homeDir?: string;
|
|
131
|
+
synkHomeDir?: string;
|
|
132
|
+
}>;
|
|
133
|
+
export type MachineMetadata = z.infer<typeof MachineMetadataSchema>;
|
|
134
|
+
/** Daemon state — dynamic runtime information */
|
|
135
|
+
export declare const DaemonStateSchema: z.ZodObject<{
|
|
136
|
+
status: z.ZodUnion<[z.ZodEnum<["running", "shutting-down"]>, z.ZodString]>;
|
|
137
|
+
pid: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
httpPort: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
140
|
+
shutdownRequestedAt: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
shutdownSource: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["mobile-app", "cli", "os-signal", "unknown"]>, z.ZodString]>>;
|
|
142
|
+
}, "strip", z.ZodTypeAny, {
|
|
143
|
+
status?: string;
|
|
144
|
+
pid?: number;
|
|
145
|
+
httpPort?: number;
|
|
146
|
+
startedAt?: number;
|
|
147
|
+
shutdownRequestedAt?: number;
|
|
148
|
+
shutdownSource?: string;
|
|
149
|
+
}, {
|
|
150
|
+
status?: string;
|
|
151
|
+
pid?: number;
|
|
152
|
+
httpPort?: number;
|
|
153
|
+
startedAt?: number;
|
|
154
|
+
shutdownRequestedAt?: number;
|
|
155
|
+
shutdownSource?: string;
|
|
156
|
+
}>;
|
|
157
|
+
export type DaemonState = z.infer<typeof DaemonStateSchema>;
|
|
158
|
+
export interface Machine {
|
|
159
|
+
id: string;
|
|
160
|
+
encryptionKey: Uint8Array;
|
|
161
|
+
encryptionVariant: 'legacy' | 'dataKey';
|
|
162
|
+
metadata: MachineMetadata;
|
|
163
|
+
metadataVersion: number;
|
|
164
|
+
daemonState: DaemonState | null;
|
|
165
|
+
daemonStateVersion: number;
|
|
166
|
+
}
|
|
167
|
+
/** Message metadata schema */
|
|
168
|
+
export declare const MessageMetaSchema: z.ZodObject<{
|
|
169
|
+
sentFrom: z.ZodOptional<z.ZodString>;
|
|
170
|
+
permissionMode: z.ZodOptional<z.ZodEnum<["default", "acceptEdits", "bypassPermissions", "plan"]>>;
|
|
171
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
172
|
+
customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
173
|
+
appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
174
|
+
allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
175
|
+
disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
176
|
+
}, "strip", z.ZodTypeAny, {
|
|
177
|
+
sentFrom?: string;
|
|
178
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
179
|
+
model?: string;
|
|
180
|
+
customSystemPrompt?: string;
|
|
181
|
+
appendSystemPrompt?: string;
|
|
182
|
+
allowedTools?: string[];
|
|
183
|
+
disallowedTools?: string[];
|
|
184
|
+
}, {
|
|
185
|
+
sentFrom?: string;
|
|
186
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
187
|
+
model?: string;
|
|
188
|
+
customSystemPrompt?: string;
|
|
189
|
+
appendSystemPrompt?: string;
|
|
190
|
+
allowedTools?: string[];
|
|
191
|
+
disallowedTools?: string[];
|
|
192
|
+
}>;
|
|
193
|
+
export type MessageMeta = z.infer<typeof MessageMetaSchema>;
|
|
194
|
+
/** API response types */
|
|
195
|
+
export declare const CreateSessionResponseSchema: z.ZodObject<{
|
|
196
|
+
session: z.ZodObject<{
|
|
197
|
+
id: z.ZodString;
|
|
198
|
+
tag: z.ZodString;
|
|
199
|
+
seq: z.ZodNumber;
|
|
200
|
+
createdAt: z.ZodNumber;
|
|
201
|
+
updatedAt: z.ZodNumber;
|
|
202
|
+
metadata: z.ZodString;
|
|
203
|
+
metadataVersion: z.ZodNumber;
|
|
204
|
+
agentState: z.ZodNullable<z.ZodString>;
|
|
205
|
+
agentStateVersion: z.ZodNumber;
|
|
206
|
+
}, "strip", z.ZodTypeAny, {
|
|
207
|
+
id?: string;
|
|
208
|
+
tag?: string;
|
|
209
|
+
seq?: number;
|
|
210
|
+
createdAt?: number;
|
|
211
|
+
updatedAt?: number;
|
|
212
|
+
metadata?: string;
|
|
213
|
+
metadataVersion?: number;
|
|
214
|
+
agentState?: string;
|
|
215
|
+
agentStateVersion?: number;
|
|
216
|
+
}, {
|
|
217
|
+
id?: string;
|
|
218
|
+
tag?: string;
|
|
219
|
+
seq?: number;
|
|
220
|
+
createdAt?: number;
|
|
221
|
+
updatedAt?: number;
|
|
222
|
+
metadata?: string;
|
|
223
|
+
metadataVersion?: number;
|
|
224
|
+
agentState?: string;
|
|
225
|
+
agentStateVersion?: number;
|
|
226
|
+
}>;
|
|
227
|
+
}, "strip", z.ZodTypeAny, {
|
|
228
|
+
session?: {
|
|
229
|
+
id?: string;
|
|
230
|
+
tag?: string;
|
|
231
|
+
seq?: number;
|
|
232
|
+
createdAt?: number;
|
|
233
|
+
updatedAt?: number;
|
|
234
|
+
metadata?: string;
|
|
235
|
+
metadataVersion?: number;
|
|
236
|
+
agentState?: string;
|
|
237
|
+
agentStateVersion?: number;
|
|
238
|
+
};
|
|
239
|
+
}, {
|
|
240
|
+
session?: {
|
|
241
|
+
id?: string;
|
|
242
|
+
tag?: string;
|
|
243
|
+
seq?: number;
|
|
244
|
+
createdAt?: number;
|
|
245
|
+
updatedAt?: number;
|
|
246
|
+
metadata?: string;
|
|
247
|
+
metadataVersion?: number;
|
|
248
|
+
agentState?: string;
|
|
249
|
+
agentStateVersion?: number;
|
|
250
|
+
};
|
|
251
|
+
}>;
|
|
252
|
+
export type CreateSessionResponse = z.infer<typeof CreateSessionResponseSchema>;
|
|
253
|
+
export declare const UserMessageSchema: z.ZodObject<{
|
|
254
|
+
role: z.ZodLiteral<"user">;
|
|
255
|
+
content: z.ZodObject<{
|
|
256
|
+
type: z.ZodLiteral<"text">;
|
|
257
|
+
text: z.ZodString;
|
|
258
|
+
}, "strip", z.ZodTypeAny, {
|
|
259
|
+
type?: "text";
|
|
260
|
+
text?: string;
|
|
261
|
+
}, {
|
|
262
|
+
type?: "text";
|
|
263
|
+
text?: string;
|
|
264
|
+
}>;
|
|
265
|
+
localKey: z.ZodOptional<z.ZodString>;
|
|
266
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
267
|
+
sentFrom: z.ZodOptional<z.ZodString>;
|
|
268
|
+
permissionMode: z.ZodOptional<z.ZodEnum<["default", "acceptEdits", "bypassPermissions", "plan"]>>;
|
|
269
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
270
|
+
customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
271
|
+
appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
272
|
+
allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
273
|
+
disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
274
|
+
}, "strip", z.ZodTypeAny, {
|
|
275
|
+
sentFrom?: string;
|
|
276
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
277
|
+
model?: string;
|
|
278
|
+
customSystemPrompt?: string;
|
|
279
|
+
appendSystemPrompt?: string;
|
|
280
|
+
allowedTools?: string[];
|
|
281
|
+
disallowedTools?: string[];
|
|
282
|
+
}, {
|
|
283
|
+
sentFrom?: string;
|
|
284
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
285
|
+
model?: string;
|
|
286
|
+
customSystemPrompt?: string;
|
|
287
|
+
appendSystemPrompt?: string;
|
|
288
|
+
allowedTools?: string[];
|
|
289
|
+
disallowedTools?: string[];
|
|
290
|
+
}>>;
|
|
291
|
+
}, "strip", z.ZodTypeAny, {
|
|
292
|
+
role?: "user";
|
|
293
|
+
content?: {
|
|
294
|
+
type?: "text";
|
|
295
|
+
text?: string;
|
|
296
|
+
};
|
|
297
|
+
localKey?: string;
|
|
298
|
+
meta?: {
|
|
299
|
+
sentFrom?: string;
|
|
300
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
301
|
+
model?: string;
|
|
302
|
+
customSystemPrompt?: string;
|
|
303
|
+
appendSystemPrompt?: string;
|
|
304
|
+
allowedTools?: string[];
|
|
305
|
+
disallowedTools?: string[];
|
|
306
|
+
};
|
|
307
|
+
}, {
|
|
308
|
+
role?: "user";
|
|
309
|
+
content?: {
|
|
310
|
+
type?: "text";
|
|
311
|
+
text?: string;
|
|
312
|
+
};
|
|
313
|
+
localKey?: string;
|
|
314
|
+
meta?: {
|
|
315
|
+
sentFrom?: string;
|
|
316
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
317
|
+
model?: string;
|
|
318
|
+
customSystemPrompt?: string;
|
|
319
|
+
appendSystemPrompt?: string;
|
|
320
|
+
allowedTools?: string[];
|
|
321
|
+
disallowedTools?: string[];
|
|
322
|
+
};
|
|
323
|
+
}>;
|
|
324
|
+
export type UserMessage = z.infer<typeof UserMessageSchema>;
|
|
325
|
+
export declare const AgentMessageSchema: z.ZodObject<{
|
|
326
|
+
role: z.ZodLiteral<"agent">;
|
|
327
|
+
content: z.ZodObject<{
|
|
328
|
+
type: z.ZodLiteral<"output">;
|
|
329
|
+
data: z.ZodAny;
|
|
330
|
+
}, "strip", z.ZodTypeAny, {
|
|
331
|
+
type?: "output";
|
|
332
|
+
data?: any;
|
|
333
|
+
}, {
|
|
334
|
+
type?: "output";
|
|
335
|
+
data?: any;
|
|
336
|
+
}>;
|
|
337
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
338
|
+
sentFrom: z.ZodOptional<z.ZodString>;
|
|
339
|
+
permissionMode: z.ZodOptional<z.ZodEnum<["default", "acceptEdits", "bypassPermissions", "plan"]>>;
|
|
340
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
341
|
+
customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
342
|
+
appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
343
|
+
allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
344
|
+
disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
345
|
+
}, "strip", z.ZodTypeAny, {
|
|
346
|
+
sentFrom?: string;
|
|
347
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
348
|
+
model?: string;
|
|
349
|
+
customSystemPrompt?: string;
|
|
350
|
+
appendSystemPrompt?: string;
|
|
351
|
+
allowedTools?: string[];
|
|
352
|
+
disallowedTools?: string[];
|
|
353
|
+
}, {
|
|
354
|
+
sentFrom?: string;
|
|
355
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
356
|
+
model?: string;
|
|
357
|
+
customSystemPrompt?: string;
|
|
358
|
+
appendSystemPrompt?: string;
|
|
359
|
+
allowedTools?: string[];
|
|
360
|
+
disallowedTools?: string[];
|
|
361
|
+
}>>;
|
|
362
|
+
}, "strip", z.ZodTypeAny, {
|
|
363
|
+
role?: "agent";
|
|
364
|
+
content?: {
|
|
365
|
+
type?: "output";
|
|
366
|
+
data?: any;
|
|
367
|
+
};
|
|
368
|
+
meta?: {
|
|
369
|
+
sentFrom?: string;
|
|
370
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
371
|
+
model?: string;
|
|
372
|
+
customSystemPrompt?: string;
|
|
373
|
+
appendSystemPrompt?: string;
|
|
374
|
+
allowedTools?: string[];
|
|
375
|
+
disallowedTools?: string[];
|
|
376
|
+
};
|
|
377
|
+
}, {
|
|
378
|
+
role?: "agent";
|
|
379
|
+
content?: {
|
|
380
|
+
type?: "output";
|
|
381
|
+
data?: any;
|
|
382
|
+
};
|
|
383
|
+
meta?: {
|
|
384
|
+
sentFrom?: string;
|
|
385
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
386
|
+
model?: string;
|
|
387
|
+
customSystemPrompt?: string;
|
|
388
|
+
appendSystemPrompt?: string;
|
|
389
|
+
allowedTools?: string[];
|
|
390
|
+
disallowedTools?: string[];
|
|
391
|
+
};
|
|
392
|
+
}>;
|
|
393
|
+
export type AgentMessage = z.infer<typeof AgentMessageSchema>;
|
|
394
|
+
export declare const MessageContentSchema: z.ZodUnion<[z.ZodObject<{
|
|
395
|
+
role: z.ZodLiteral<"user">;
|
|
396
|
+
content: z.ZodObject<{
|
|
397
|
+
type: z.ZodLiteral<"text">;
|
|
398
|
+
text: z.ZodString;
|
|
399
|
+
}, "strip", z.ZodTypeAny, {
|
|
400
|
+
type?: "text";
|
|
401
|
+
text?: string;
|
|
402
|
+
}, {
|
|
403
|
+
type?: "text";
|
|
404
|
+
text?: string;
|
|
405
|
+
}>;
|
|
406
|
+
localKey: z.ZodOptional<z.ZodString>;
|
|
407
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
408
|
+
sentFrom: z.ZodOptional<z.ZodString>;
|
|
409
|
+
permissionMode: z.ZodOptional<z.ZodEnum<["default", "acceptEdits", "bypassPermissions", "plan"]>>;
|
|
410
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
411
|
+
customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
412
|
+
appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
413
|
+
allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
414
|
+
disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
415
|
+
}, "strip", z.ZodTypeAny, {
|
|
416
|
+
sentFrom?: string;
|
|
417
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
418
|
+
model?: string;
|
|
419
|
+
customSystemPrompt?: string;
|
|
420
|
+
appendSystemPrompt?: string;
|
|
421
|
+
allowedTools?: string[];
|
|
422
|
+
disallowedTools?: string[];
|
|
423
|
+
}, {
|
|
424
|
+
sentFrom?: string;
|
|
425
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
426
|
+
model?: string;
|
|
427
|
+
customSystemPrompt?: string;
|
|
428
|
+
appendSystemPrompt?: string;
|
|
429
|
+
allowedTools?: string[];
|
|
430
|
+
disallowedTools?: string[];
|
|
431
|
+
}>>;
|
|
432
|
+
}, "strip", z.ZodTypeAny, {
|
|
433
|
+
role?: "user";
|
|
434
|
+
content?: {
|
|
435
|
+
type?: "text";
|
|
436
|
+
text?: string;
|
|
437
|
+
};
|
|
438
|
+
localKey?: string;
|
|
439
|
+
meta?: {
|
|
440
|
+
sentFrom?: string;
|
|
441
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
442
|
+
model?: string;
|
|
443
|
+
customSystemPrompt?: string;
|
|
444
|
+
appendSystemPrompt?: string;
|
|
445
|
+
allowedTools?: string[];
|
|
446
|
+
disallowedTools?: string[];
|
|
447
|
+
};
|
|
448
|
+
}, {
|
|
449
|
+
role?: "user";
|
|
450
|
+
content?: {
|
|
451
|
+
type?: "text";
|
|
452
|
+
text?: string;
|
|
453
|
+
};
|
|
454
|
+
localKey?: string;
|
|
455
|
+
meta?: {
|
|
456
|
+
sentFrom?: string;
|
|
457
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
458
|
+
model?: string;
|
|
459
|
+
customSystemPrompt?: string;
|
|
460
|
+
appendSystemPrompt?: string;
|
|
461
|
+
allowedTools?: string[];
|
|
462
|
+
disallowedTools?: string[];
|
|
463
|
+
};
|
|
464
|
+
}>, z.ZodObject<{
|
|
465
|
+
role: z.ZodLiteral<"agent">;
|
|
466
|
+
content: z.ZodObject<{
|
|
467
|
+
type: z.ZodLiteral<"output">;
|
|
468
|
+
data: z.ZodAny;
|
|
469
|
+
}, "strip", z.ZodTypeAny, {
|
|
470
|
+
type?: "output";
|
|
471
|
+
data?: any;
|
|
472
|
+
}, {
|
|
473
|
+
type?: "output";
|
|
474
|
+
data?: any;
|
|
475
|
+
}>;
|
|
476
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
477
|
+
sentFrom: z.ZodOptional<z.ZodString>;
|
|
478
|
+
permissionMode: z.ZodOptional<z.ZodEnum<["default", "acceptEdits", "bypassPermissions", "plan"]>>;
|
|
479
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
480
|
+
customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
481
|
+
appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
482
|
+
allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
483
|
+
disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
484
|
+
}, "strip", z.ZodTypeAny, {
|
|
485
|
+
sentFrom?: string;
|
|
486
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
487
|
+
model?: string;
|
|
488
|
+
customSystemPrompt?: string;
|
|
489
|
+
appendSystemPrompt?: string;
|
|
490
|
+
allowedTools?: string[];
|
|
491
|
+
disallowedTools?: string[];
|
|
492
|
+
}, {
|
|
493
|
+
sentFrom?: string;
|
|
494
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
495
|
+
model?: string;
|
|
496
|
+
customSystemPrompt?: string;
|
|
497
|
+
appendSystemPrompt?: string;
|
|
498
|
+
allowedTools?: string[];
|
|
499
|
+
disallowedTools?: string[];
|
|
500
|
+
}>>;
|
|
501
|
+
}, "strip", z.ZodTypeAny, {
|
|
502
|
+
role?: "agent";
|
|
503
|
+
content?: {
|
|
504
|
+
type?: "output";
|
|
505
|
+
data?: any;
|
|
506
|
+
};
|
|
507
|
+
meta?: {
|
|
508
|
+
sentFrom?: string;
|
|
509
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
510
|
+
model?: string;
|
|
511
|
+
customSystemPrompt?: string;
|
|
512
|
+
appendSystemPrompt?: string;
|
|
513
|
+
allowedTools?: string[];
|
|
514
|
+
disallowedTools?: string[];
|
|
515
|
+
};
|
|
516
|
+
}, {
|
|
517
|
+
role?: "agent";
|
|
518
|
+
content?: {
|
|
519
|
+
type?: "output";
|
|
520
|
+
data?: any;
|
|
521
|
+
};
|
|
522
|
+
meta?: {
|
|
523
|
+
sentFrom?: string;
|
|
524
|
+
permissionMode?: "default" | "acceptEdits" | "bypassPermissions" | "plan";
|
|
525
|
+
model?: string;
|
|
526
|
+
customSystemPrompt?: string;
|
|
527
|
+
appendSystemPrompt?: string;
|
|
528
|
+
allowedTools?: string[];
|
|
529
|
+
disallowedTools?: string[];
|
|
530
|
+
};
|
|
531
|
+
}>]>;
|
|
532
|
+
export type MessageContent = z.infer<typeof MessageContentSchema>;
|
|
533
|
+
export interface Metadata {
|
|
534
|
+
path: string;
|
|
535
|
+
host: string;
|
|
536
|
+
version?: string;
|
|
537
|
+
name?: string;
|
|
538
|
+
os?: string;
|
|
539
|
+
summary?: {
|
|
540
|
+
text: string;
|
|
541
|
+
updatedAt: number;
|
|
542
|
+
};
|
|
543
|
+
machineId?: string;
|
|
544
|
+
claudeSessionId?: string;
|
|
545
|
+
tools?: string[];
|
|
546
|
+
homeDir: string;
|
|
547
|
+
synkHomeDir: string;
|
|
548
|
+
startedFromDaemon?: boolean;
|
|
549
|
+
hostPid?: number;
|
|
550
|
+
startedBy?: 'daemon' | 'terminal';
|
|
551
|
+
lifecycleState?: 'running' | 'archiveRequested' | 'archived' | string;
|
|
552
|
+
lifecycleStateSince?: number;
|
|
553
|
+
archivedBy?: string;
|
|
554
|
+
archiveReason?: string;
|
|
555
|
+
dangerouslySkipPermissions?: boolean | null;
|
|
556
|
+
}
|
|
557
|
+
export interface AgentState {
|
|
558
|
+
controlledByUser?: boolean | null | undefined;
|
|
559
|
+
requests?: Record<string, {
|
|
560
|
+
tool: string;
|
|
561
|
+
arguments: any;
|
|
562
|
+
createdAt: number;
|
|
563
|
+
}>;
|
|
564
|
+
completedRequests?: Record<string, {
|
|
565
|
+
tool: string;
|
|
566
|
+
arguments: any;
|
|
567
|
+
createdAt: number;
|
|
568
|
+
completedAt: number;
|
|
569
|
+
status: 'canceled' | 'denied' | 'approved';
|
|
570
|
+
reason?: string;
|
|
571
|
+
mode?: PermissionMode;
|
|
572
|
+
decision?: 'approved' | 'approved_for_session' | 'denied' | 'abort';
|
|
573
|
+
}>;
|
|
574
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Type definitions for ekkOS_synk protocol
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MessageContentSchema = exports.AgentMessageSchema = exports.UserMessageSchema = exports.CreateSessionResponseSchema = exports.MessageMetaSchema = exports.DaemonStateSchema = exports.MachineMetadataSchema = exports.UpdateSessionBodySchema = exports.UpdateSchema = exports.UpdateMachineBodySchema = exports.UpdateBodySchema = exports.SessionMessageSchema = exports.SessionMessageContentSchema = void 0;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
// Re-export wire protocol types
|
|
9
|
+
var synk_wire_1 = require("@ekkos/synk-wire");
|
|
10
|
+
Object.defineProperty(exports, "SessionMessageContentSchema", { enumerable: true, get: function () { return synk_wire_1.SessionMessageContentSchema; } });
|
|
11
|
+
Object.defineProperty(exports, "SessionMessageSchema", { enumerable: true, get: function () { return synk_wire_1.SessionMessageSchema; } });
|
|
12
|
+
Object.defineProperty(exports, "UpdateBodySchema", { enumerable: true, get: function () { return synk_wire_1.UpdateBodySchema; } });
|
|
13
|
+
Object.defineProperty(exports, "UpdateMachineBodySchema", { enumerable: true, get: function () { return synk_wire_1.UpdateMachineBodySchema; } });
|
|
14
|
+
Object.defineProperty(exports, "UpdateSchema", { enumerable: true, get: function () { return synk_wire_1.UpdateSchema; } });
|
|
15
|
+
Object.defineProperty(exports, "UpdateSessionBodySchema", { enumerable: true, get: function () { return synk_wire_1.UpdateSessionBodySchema; } });
|
|
16
|
+
/** Machine metadata — static information (rarely changes) */
|
|
17
|
+
exports.MachineMetadataSchema = zod_1.z.object({
|
|
18
|
+
host: zod_1.z.string(),
|
|
19
|
+
platform: zod_1.z.string(),
|
|
20
|
+
synkCliVersion: zod_1.z.string(),
|
|
21
|
+
homeDir: zod_1.z.string(),
|
|
22
|
+
synkHomeDir: zod_1.z.string(),
|
|
23
|
+
});
|
|
24
|
+
/** Daemon state — dynamic runtime information */
|
|
25
|
+
exports.DaemonStateSchema = zod_1.z.object({
|
|
26
|
+
status: zod_1.z.union([zod_1.z.enum(['running', 'shutting-down']), zod_1.z.string()]),
|
|
27
|
+
pid: zod_1.z.number().optional(),
|
|
28
|
+
httpPort: zod_1.z.number().optional(),
|
|
29
|
+
startedAt: zod_1.z.number().optional(),
|
|
30
|
+
shutdownRequestedAt: zod_1.z.number().optional(),
|
|
31
|
+
shutdownSource: zod_1.z.union([zod_1.z.enum(['mobile-app', 'cli', 'os-signal', 'unknown']), zod_1.z.string()]).optional(),
|
|
32
|
+
});
|
|
33
|
+
/** Message metadata schema */
|
|
34
|
+
exports.MessageMetaSchema = zod_1.z.object({
|
|
35
|
+
sentFrom: zod_1.z.string().optional(),
|
|
36
|
+
permissionMode: zod_1.z.enum(['default', 'acceptEdits', 'bypassPermissions', 'plan']).optional(),
|
|
37
|
+
model: zod_1.z.string().nullable().optional(),
|
|
38
|
+
customSystemPrompt: zod_1.z.string().nullable().optional(),
|
|
39
|
+
appendSystemPrompt: zod_1.z.string().nullable().optional(),
|
|
40
|
+
allowedTools: zod_1.z.array(zod_1.z.string()).nullable().optional(),
|
|
41
|
+
disallowedTools: zod_1.z.array(zod_1.z.string()).nullable().optional(),
|
|
42
|
+
});
|
|
43
|
+
/** API response types */
|
|
44
|
+
exports.CreateSessionResponseSchema = zod_1.z.object({
|
|
45
|
+
session: zod_1.z.object({
|
|
46
|
+
id: zod_1.z.string(),
|
|
47
|
+
tag: zod_1.z.string(),
|
|
48
|
+
seq: zod_1.z.number(),
|
|
49
|
+
createdAt: zod_1.z.number(),
|
|
50
|
+
updatedAt: zod_1.z.number(),
|
|
51
|
+
metadata: zod_1.z.string(),
|
|
52
|
+
metadataVersion: zod_1.z.number(),
|
|
53
|
+
agentState: zod_1.z.string().nullable(),
|
|
54
|
+
agentStateVersion: zod_1.z.number(),
|
|
55
|
+
}),
|
|
56
|
+
});
|
|
57
|
+
exports.UserMessageSchema = zod_1.z.object({
|
|
58
|
+
role: zod_1.z.literal('user'),
|
|
59
|
+
content: zod_1.z.object({
|
|
60
|
+
type: zod_1.z.literal('text'),
|
|
61
|
+
text: zod_1.z.string(),
|
|
62
|
+
}),
|
|
63
|
+
localKey: zod_1.z.string().optional(),
|
|
64
|
+
meta: exports.MessageMetaSchema.optional(),
|
|
65
|
+
});
|
|
66
|
+
exports.AgentMessageSchema = zod_1.z.object({
|
|
67
|
+
role: zod_1.z.literal('agent'),
|
|
68
|
+
content: zod_1.z.object({
|
|
69
|
+
type: zod_1.z.literal('output'),
|
|
70
|
+
data: zod_1.z.any(),
|
|
71
|
+
}),
|
|
72
|
+
meta: exports.MessageMetaSchema.optional(),
|
|
73
|
+
});
|
|
74
|
+
exports.MessageContentSchema = zod_1.z.union([exports.UserMessageSchema, exports.AgentMessageSchema]);
|
package/dist/utils/platform.d.ts
CHANGED
|
@@ -24,6 +24,10 @@ export declare const WINDSURF_MCP: string;
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function detectInstalledIDEs(): string[];
|
|
26
26
|
/**
|
|
27
|
-
* Get the current running IDE from environment
|
|
27
|
+
* Get the current running IDE from environment variables and cwd directory markers.
|
|
28
|
+
* Checks (in priority order):
|
|
29
|
+
* 1. Dedicated IDE env vars (CURSOR_USER_ID, VSCODE_INJECTION, CODEIUM_USER_ID, CLAUDE_CODE)
|
|
30
|
+
* 2. TERM_PROGRAM / TERMINAL_EMULATOR
|
|
31
|
+
* 3. Project-local directory markers (.cursor/, .windsurf/, .vscode/ in cwd)
|
|
28
32
|
*/
|
|
29
33
|
export declare function detectCurrentIDE(): string | null;
|