@sipher.dev/agents 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/connector-platforms.json +14 -0
- package/connector-runtime.json +4 -0
- package/dist/index.js +319 -3400
- package/dist/local-control-DKnrc-X8.d.ts +27 -0
- package/dist/local-control-Dm6FcXAi.js +429 -0
- package/dist/local-control-server.d.ts +18 -0
- package/dist/local-control-server.js +149 -0
- package/dist/local-control.d.ts +355 -0
- package/dist/local-control.js +2 -0
- package/dist/local-machine-controller-CjOyllJj.js +453 -0
- package/dist/release-resolver-PnPDodU9.js +5828 -0
- package/dist/src-ghbvDJyd.js +731 -0
- package/package.json +32 -23
- package/release-trust-anchor.json +11 -0
- package/dist/local-machine-controller-Dtiash-C.js +0 -2129
- package/dist/local-machine.d.ts +0 -177
- package/dist/local-machine.js +0 -2
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import { n as LocalControlStatus, r as LocalControlVersionRange, t as LocalControlCapability } from "./local-control-DKnrc-X8.js";
|
|
2
|
+
|
|
3
|
+
//#region ../machine-protocol/src/deployment.d.ts
|
|
4
|
+
type ConnectorChannel = "latest" | "next";
|
|
5
|
+
interface DeploymentPolicy {
|
|
6
|
+
deploymentId: string;
|
|
7
|
+
canonicalOrigin: string;
|
|
8
|
+
aliases: string[];
|
|
9
|
+
connectorChannel: ConnectorChannel;
|
|
10
|
+
connectorVersionRange: string;
|
|
11
|
+
}
|
|
12
|
+
interface DeploymentWellKnown extends DeploymentPolicy {
|
|
13
|
+
policyDigest: string;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region ../machine-protocol/src/connector-release.d.ts
|
|
17
|
+
interface SignedConnectorReleaseTuple {
|
|
18
|
+
packageName: string;
|
|
19
|
+
platform: "darwin" | "linux" | "win32";
|
|
20
|
+
arch: "arm64" | "x64";
|
|
21
|
+
runtimeVersion: string;
|
|
22
|
+
releaseId: string;
|
|
23
|
+
tarballUrl: string;
|
|
24
|
+
integrity: string;
|
|
25
|
+
manifestDigest: string;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/connector-profile.d.ts
|
|
29
|
+
interface ConnectorProfileContext {
|
|
30
|
+
serviceKey: string;
|
|
31
|
+
serviceName: string;
|
|
32
|
+
serviceUnitName: string;
|
|
33
|
+
configPath: string;
|
|
34
|
+
authStorePath: string;
|
|
35
|
+
logPath: string;
|
|
36
|
+
errorLogPath: string;
|
|
37
|
+
launchAgentPath: string;
|
|
38
|
+
systemdUnitPath: string;
|
|
39
|
+
registryPath: string;
|
|
40
|
+
controlSecretPath: string;
|
|
41
|
+
controlEndpoint: string;
|
|
42
|
+
statePath: string;
|
|
43
|
+
launcherPath: string;
|
|
44
|
+
currentPath: string;
|
|
45
|
+
previousPath: string;
|
|
46
|
+
candidatePath: string;
|
|
47
|
+
launcherActivationPath: string;
|
|
48
|
+
rollbackErrorPath: string;
|
|
49
|
+
signedSnapshotPath: string;
|
|
50
|
+
updateStatePath: string;
|
|
51
|
+
launcherJournalPath: string;
|
|
52
|
+
reconciliationLockPath: string;
|
|
53
|
+
scheduledTaskXmlPath: string;
|
|
54
|
+
cacheRoot: string;
|
|
55
|
+
cacheLockPath: string;
|
|
56
|
+
}
|
|
57
|
+
interface ConnectorRootOverrides {
|
|
58
|
+
configRoot?: string;
|
|
59
|
+
stateRoot?: string;
|
|
60
|
+
cacheRoot?: string;
|
|
61
|
+
launchAgentsRoot?: string;
|
|
62
|
+
systemdUserRoot?: string;
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/connector-registry.d.ts
|
|
66
|
+
interface ConnectorRegistryEntry {
|
|
67
|
+
schemaVersion: 1;
|
|
68
|
+
deploymentId: string;
|
|
69
|
+
serviceKey: string;
|
|
70
|
+
endpoint: string;
|
|
71
|
+
controlMinVersion: number;
|
|
72
|
+
controlMaxVersion: number;
|
|
73
|
+
serviceName: string;
|
|
74
|
+
configPath: string;
|
|
75
|
+
updatedAt: string;
|
|
76
|
+
}
|
|
77
|
+
type LocalConnectorDiscovery = {
|
|
78
|
+
state: "ready";
|
|
79
|
+
entry: ConnectorRegistryEntry;
|
|
80
|
+
status: LocalControlStatus;
|
|
81
|
+
} | {
|
|
82
|
+
state: "needs_bootstrap";
|
|
83
|
+
entry?: ConnectorRegistryEntry;
|
|
84
|
+
} | {
|
|
85
|
+
state: "ownership_conflict";
|
|
86
|
+
entry: ConnectorRegistryEntry;
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/deployment-discovery.d.ts
|
|
90
|
+
type DeploymentIdentity = DeploymentWellKnown;
|
|
91
|
+
interface DeploymentDiscovery extends DeploymentIdentity {
|
|
92
|
+
serverUrl: string;
|
|
93
|
+
serviceKey: string;
|
|
94
|
+
}
|
|
95
|
+
declare function discoverDeployment(serverUrl: string, options?: {
|
|
96
|
+
fetch?: typeof fetch;
|
|
97
|
+
candidateFetch?: typeof fetch;
|
|
98
|
+
canonicalFetch?: typeof fetch;
|
|
99
|
+
allowInsecureTls?: boolean | undefined;
|
|
100
|
+
trustedCanonicalOrigin?: string | undefined;
|
|
101
|
+
expectedDeploymentId?: string | undefined;
|
|
102
|
+
}): Promise<DeploymentDiscovery>;
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/release-tooling-bridge.d.mts
|
|
105
|
+
interface ConnectorPlatform {
|
|
106
|
+
packageName: string;
|
|
107
|
+
platform: "darwin" | "linux" | "win32";
|
|
108
|
+
arch: "arm64" | "x64";
|
|
109
|
+
minimumHost: string;
|
|
110
|
+
}
|
|
111
|
+
interface ConnectorReleaseTuple {
|
|
112
|
+
packageName: string;
|
|
113
|
+
platform: "darwin" | "linux" | "win32";
|
|
114
|
+
arch: "arm64" | "x64";
|
|
115
|
+
runtimeVersion: string;
|
|
116
|
+
releaseId: string;
|
|
117
|
+
tarballUrl: string;
|
|
118
|
+
integrity: string;
|
|
119
|
+
manifestDigest: string;
|
|
120
|
+
}
|
|
121
|
+
interface ConnectorReleaseIndex {
|
|
122
|
+
schemaVersion: 1;
|
|
123
|
+
indexVersion: string;
|
|
124
|
+
releaseId: string;
|
|
125
|
+
sequence: number;
|
|
126
|
+
runtimeVersion: string;
|
|
127
|
+
tuples: ConnectorReleaseTuple[];
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/release-resolver.d.ts
|
|
131
|
+
interface SignedReleaseSnapshot {
|
|
132
|
+
channel: "latest" | "next";
|
|
133
|
+
sequence: number;
|
|
134
|
+
indexVersion: string;
|
|
135
|
+
digest: string;
|
|
136
|
+
index: ConnectorReleaseIndex;
|
|
137
|
+
signature: string;
|
|
138
|
+
tuple: ConnectorReleaseTuple;
|
|
139
|
+
}
|
|
140
|
+
interface VerifiedConnectorRelease {
|
|
141
|
+
snapshot: SignedReleaseSnapshot;
|
|
142
|
+
packageRoot: string;
|
|
143
|
+
manifest: Record<string, unknown>;
|
|
144
|
+
dispose(): Promise<void>;
|
|
145
|
+
}
|
|
146
|
+
declare function resolveVerifiedConnectorRelease(deployment: DeploymentDiscovery, options?: {
|
|
147
|
+
fetch?: typeof fetch;
|
|
148
|
+
platform?: NodeJS.Platform;
|
|
149
|
+
arch?: string;
|
|
150
|
+
trustAnchor?: ConnectorTrustAnchor;
|
|
151
|
+
platforms?: Record<string, ConnectorPlatform>;
|
|
152
|
+
host?: HostCompatibility;
|
|
153
|
+
etag?: string;
|
|
154
|
+
onEtag?: (etag: string) => void;
|
|
155
|
+
}): Promise<VerifiedConnectorRelease>;
|
|
156
|
+
declare function resolveVerifiedConnectorSnapshot(snapshot: SignedReleaseSnapshot, options?: {
|
|
157
|
+
fetch?: typeof fetch;
|
|
158
|
+
platform?: NodeJS.Platform;
|
|
159
|
+
arch?: string;
|
|
160
|
+
trustAnchor?: ConnectorTrustAnchor;
|
|
161
|
+
platforms?: Record<string, ConnectorPlatform>;
|
|
162
|
+
host?: HostCompatibility;
|
|
163
|
+
}): Promise<VerifiedConnectorRelease>;
|
|
164
|
+
interface ConnectorTrustAnchor {
|
|
165
|
+
schemaVersion: 1;
|
|
166
|
+
releasePackageName: string;
|
|
167
|
+
npmRegistryOrigin: string;
|
|
168
|
+
publicKey: string;
|
|
169
|
+
latest: {
|
|
170
|
+
sequence: number;
|
|
171
|
+
indexVersion: string;
|
|
172
|
+
digest: string;
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
interface HostCompatibility {
|
|
176
|
+
platform: NodeJS.Platform;
|
|
177
|
+
release: string;
|
|
178
|
+
glibcVersion?: string;
|
|
179
|
+
glibcxxVersion?: string;
|
|
180
|
+
}
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/service-manager.d.ts
|
|
183
|
+
declare const SUPPORTED_SERVICE_PLATFORMS: readonly ["darwin", "linux", "win32"];
|
|
184
|
+
type SupportedServicePlatform = (typeof SUPPORTED_SERVICE_PLATFORMS)[number];
|
|
185
|
+
type CommandRunner = (command: string, args: string[], options?: {
|
|
186
|
+
allowFailure?: boolean;
|
|
187
|
+
quietFailure?: boolean;
|
|
188
|
+
}) => Promise<void>;
|
|
189
|
+
declare function installConnectorLauncherService(input: {
|
|
190
|
+
platform: SupportedServicePlatform;
|
|
191
|
+
context: ConnectorProfileContext;
|
|
192
|
+
runner?: CommandRunner;
|
|
193
|
+
}): Promise<void>;
|
|
194
|
+
declare function uninstallConnectorLauncherService(input: {
|
|
195
|
+
platform: SupportedServicePlatform;
|
|
196
|
+
context: ConnectorProfileContext;
|
|
197
|
+
runner?: CommandRunner;
|
|
198
|
+
}): Promise<void>;
|
|
199
|
+
declare function connectorLauncherServiceIsRunning(input: {
|
|
200
|
+
platform: SupportedServicePlatform;
|
|
201
|
+
context: ConnectorProfileContext;
|
|
202
|
+
probe?: (command: string, args: string[]) => Promise<number>;
|
|
203
|
+
}): Promise<boolean>;
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region src/connector-installer.d.ts
|
|
206
|
+
interface BootstrapServiceCredentials {
|
|
207
|
+
receiptId: string;
|
|
208
|
+
machineId: string;
|
|
209
|
+
refreshToken: string;
|
|
210
|
+
accessToken: string;
|
|
211
|
+
accessTokenExpiresAt: string;
|
|
212
|
+
}
|
|
213
|
+
declare function installDeploymentConnector(input: {
|
|
214
|
+
deployment: DeploymentDiscovery;
|
|
215
|
+
release: VerifiedConnectorRelease;
|
|
216
|
+
credentials: BootstrapServiceCredentials;
|
|
217
|
+
connectorInstallId: string;
|
|
218
|
+
challenge: string;
|
|
219
|
+
allowInsecureTls?: boolean;
|
|
220
|
+
roots?: ConnectorRootOverrides;
|
|
221
|
+
platform?: NodeJS.Platform;
|
|
222
|
+
arch?: string;
|
|
223
|
+
nodeExtraCaCerts?: string;
|
|
224
|
+
acknowledge(receiptId: string): Promise<void>;
|
|
225
|
+
installService?: typeof installConnectorLauncherService;
|
|
226
|
+
reconciliationLockHeld?: boolean;
|
|
227
|
+
}): Promise<{
|
|
228
|
+
context: ConnectorProfileContext;
|
|
229
|
+
runtimeRoot: string;
|
|
230
|
+
}>;
|
|
231
|
+
//#endregion
|
|
232
|
+
//#region src/tls.d.ts
|
|
233
|
+
interface TlsOptions {
|
|
234
|
+
allowInsecureTls?: boolean | undefined;
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region src/machine-client.d.ts
|
|
238
|
+
interface ClaimedMachine {
|
|
239
|
+
machineId: string;
|
|
240
|
+
name: string;
|
|
241
|
+
}
|
|
242
|
+
interface BootstrapServiceGrant {
|
|
243
|
+
receiptId: string;
|
|
244
|
+
accessToken: string;
|
|
245
|
+
refreshToken: string;
|
|
246
|
+
accessTokenExpiresAt: string;
|
|
247
|
+
}
|
|
248
|
+
interface MachineRetirement {
|
|
249
|
+
revision: number;
|
|
250
|
+
token: string;
|
|
251
|
+
deploymentId: string;
|
|
252
|
+
connectorInstallId: string;
|
|
253
|
+
machineId: string;
|
|
254
|
+
acknowledged: boolean;
|
|
255
|
+
}
|
|
256
|
+
declare class MachineClient {
|
|
257
|
+
private readonly serverUrl;
|
|
258
|
+
private readonly tlsOptions;
|
|
259
|
+
constructor(serverUrl: string, tlsOptions?: TlsOptions);
|
|
260
|
+
claim(input: {
|
|
261
|
+
accessToken: string;
|
|
262
|
+
deploymentId: string;
|
|
263
|
+
serviceKey: string;
|
|
264
|
+
challenge: string;
|
|
265
|
+
connectorInstallId: string;
|
|
266
|
+
name?: string | undefined;
|
|
267
|
+
bootstrap?: {
|
|
268
|
+
policyDigest: string;
|
|
269
|
+
releaseTuple: SignedConnectorReleaseTuple;
|
|
270
|
+
receiptId?: string;
|
|
271
|
+
};
|
|
272
|
+
}): Promise<ClaimedMachine & {
|
|
273
|
+
bootstrap?: BootstrapServiceGrant;
|
|
274
|
+
}>;
|
|
275
|
+
acknowledgeBootstrap(input: {
|
|
276
|
+
accessToken: string;
|
|
277
|
+
receiptId: string;
|
|
278
|
+
}): Promise<void>;
|
|
279
|
+
readRetirement(accessToken: string): Promise<MachineRetirement | undefined>;
|
|
280
|
+
acknowledgeRetirement(input: {
|
|
281
|
+
accessToken: string;
|
|
282
|
+
retirement: Pick<MachineRetirement, "revision" | "token">;
|
|
283
|
+
}): Promise<void>;
|
|
284
|
+
}
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region src/desktop-bootstrap.d.ts
|
|
287
|
+
interface DesktopConnectorSeed {
|
|
288
|
+
snapshot: SignedReleaseSnapshot;
|
|
289
|
+
tarball: Uint8Array;
|
|
290
|
+
verification?: {
|
|
291
|
+
trustAnchor: ConnectorTrustAnchor;
|
|
292
|
+
platforms: Record<string, ConnectorPlatform>;
|
|
293
|
+
};
|
|
294
|
+
development?: {
|
|
295
|
+
refreshInstalledRuntime: true;
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
interface DesktopBootstrapRequest {
|
|
299
|
+
request<T>(path: string, body: Record<string, unknown>): Promise<T>;
|
|
300
|
+
}
|
|
301
|
+
interface DesktopBootstrapResult {
|
|
302
|
+
serverUrl: string;
|
|
303
|
+
machineId: string;
|
|
304
|
+
machineName: string;
|
|
305
|
+
installedVersion?: string;
|
|
306
|
+
reused: boolean;
|
|
307
|
+
}
|
|
308
|
+
declare function bootstrapDesktopConnector(input: {
|
|
309
|
+
serverUrl: string;
|
|
310
|
+
seed: DesktopConnectorSeed;
|
|
311
|
+
transport: DesktopBootstrapRequest;
|
|
312
|
+
roots?: ConnectorRootOverrides;
|
|
313
|
+
platform?: NodeJS.Platform;
|
|
314
|
+
arch?: string;
|
|
315
|
+
discover?: typeof discoverDeployment;
|
|
316
|
+
resolveLive?: typeof resolveVerifiedConnectorRelease;
|
|
317
|
+
resolveSnapshot?: typeof resolveVerifiedConnectorSnapshot;
|
|
318
|
+
claim?: MachineClient["claim"];
|
|
319
|
+
install?: typeof installDeploymentConnector;
|
|
320
|
+
uninstall?: typeof uninstallConnectorLauncherService;
|
|
321
|
+
serviceRunning?: typeof connectorLauncherServiceIsRunning;
|
|
322
|
+
}): Promise<DesktopBootstrapResult>;
|
|
323
|
+
//#endregion
|
|
324
|
+
//#region src/local-control.d.ts
|
|
325
|
+
declare class LocalControlIncompatibleError extends Error {
|
|
326
|
+
readonly code = "local_control_incompatible";
|
|
327
|
+
}
|
|
328
|
+
declare class LocalControlClient {
|
|
329
|
+
private readonly options;
|
|
330
|
+
constructor(options: {
|
|
331
|
+
endpoint: string;
|
|
332
|
+
secret: string;
|
|
333
|
+
versions?: LocalControlVersionRange;
|
|
334
|
+
timeoutMs?: number;
|
|
335
|
+
});
|
|
336
|
+
command(command: "status" | "ensure-installed" | "start" | "restart"): Promise<LocalControlStatus>;
|
|
337
|
+
command(command: "retry" | "force", capability: LocalControlCapability): Promise<LocalControlStatus>;
|
|
338
|
+
private exchange;
|
|
339
|
+
}
|
|
340
|
+
declare function discoverLocalConnector(input: {
|
|
341
|
+
deploymentId: string;
|
|
342
|
+
serviceKey: string;
|
|
343
|
+
platform?: NodeJS.Platform;
|
|
344
|
+
roots?: ConnectorRootOverrides;
|
|
345
|
+
versions?: LocalControlVersionRange;
|
|
346
|
+
}): Promise<LocalConnectorDiscovery>;
|
|
347
|
+
declare function runLocalControlCommand(input: {
|
|
348
|
+
deploymentId: string;
|
|
349
|
+
serviceKey: string;
|
|
350
|
+
command: "status" | "ensure-installed" | "start" | "restart";
|
|
351
|
+
platform?: NodeJS.Platform;
|
|
352
|
+
roots?: ConnectorRootOverrides;
|
|
353
|
+
}): Promise<LocalControlStatus>;
|
|
354
|
+
//#endregion
|
|
355
|
+
export { type DesktopBootstrapRequest, type DesktopBootstrapResult, type DesktopConnectorSeed, LocalControlClient, LocalControlIncompatibleError, bootstrapDesktopConnector, discoverLocalConnector, runLocalControlCommand };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as bootstrapDesktopConnector, i as runLocalControlCommand, n as LocalControlIncompatibleError, r as discoverLocalConnector, t as LocalControlClient } from "./local-control-Dm6FcXAi.js";
|
|
2
|
+
export { LocalControlClient, LocalControlIncompatibleError, bootstrapDesktopConnector, discoverLocalConnector, runLocalControlCommand };
|