mindwire 0.1.19 → 0.1.22
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/binary-cache-CG52TXCZ.js +3 -0
- package/dist/binary-cache-CG52TXCZ.js.map +1 -0
- package/dist/binary-cache-ZTEYICUF.js +51 -0
- package/dist/binary-cache-ZTEYICUF.js.map +1 -0
- package/dist/binary-cache.d.ts +5 -0
- package/dist/chunk-PFYKJ6LX.js +103 -0
- package/dist/chunk-PFYKJ6LX.js.map +1 -0
- package/dist/chunk-T6TD76UA.js +57 -0
- package/dist/chunk-T6TD76UA.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +2395 -0
- package/dist/cli.js.map +1 -0
- package/dist/client.d.ts +4 -0
- package/dist/computer/cloudflare-binary.d.ts +9 -0
- package/dist/computer/lifecycle.d.ts +24 -0
- package/dist/computer/relay.d.ts +19 -0
- package/dist/computer.d.ts +80 -0
- package/dist/execution.d.ts +111 -0
- package/dist/index.cjs +321 -118
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +139 -79
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/workspace.d.ts +27 -0
- package/package.json +7 -2
package/dist/client.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { Run } from "./run.js";
|
|
|
3
3
|
import { WorkspaceApi, type ProjectAuth } from "./workspace.js";
|
|
4
4
|
import { SurfacesApi } from "./surfaces.js";
|
|
5
5
|
import { ServiceApi } from "./service.js";
|
|
6
|
+
import { ExecutionApi } from "./execution.js";
|
|
7
|
+
import { ComputerApi } from "./computer.js";
|
|
6
8
|
import { type Target } from "./target/index.js";
|
|
7
9
|
import type { EnsureEvent } from "./target/host.js";
|
|
8
10
|
import type { AgentInfo, AuthMethod, AuthState, AuthStatus, Catalog, ChatSummary, CustomProvider, DeleteResult, DoctorReport, Health, MCPServer, MemoryDoc, MemoryScope, Message, ModelInfo, Notification, NotifyChannel, NotifyChannelInput, NotifyChannelTestResult, NotifyConfigInput, NotifyConfigStatus, NotifyRule, NotifyRuleInput, ProcessFrame, PromptTemplate, ResolveOptions, SetupStatus, HarnessSoftware, Stats, Subagent, TurnOptions } from "./types.js";
|
|
@@ -74,6 +76,8 @@ export declare class Mindwire {
|
|
|
74
76
|
readonly workspace: WorkspaceApi;
|
|
75
77
|
readonly surfaces: SurfacesApi;
|
|
76
78
|
readonly service: ServiceApi;
|
|
79
|
+
readonly execution: ExecutionApi;
|
|
80
|
+
readonly computer: ComputerApi;
|
|
77
81
|
readonly http: Http;
|
|
78
82
|
/** The default agent type applied to agent-scoped calls, if set. */
|
|
79
83
|
readonly defaultAgent: string | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const CLOUDFLARED_VERSION = "2026.9.3";
|
|
2
|
+
export declare function ensureCloudflareBinary(options?: {
|
|
3
|
+
cacheDir?: string;
|
|
4
|
+
platform?: string;
|
|
5
|
+
arch?: string;
|
|
6
|
+
fetch?: typeof fetch;
|
|
7
|
+
onProgress?: (message: string) => void | Promise<void>;
|
|
8
|
+
}): Promise<string>;
|
|
9
|
+
export declare function cloudflareCommand(options: Parameters<typeof ensureCloudflareBinary>[0]): Promise<string>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Mindwire } from "../client.js";
|
|
2
|
+
import type { ComputerRoute } from "../computer.js";
|
|
3
|
+
import { type RelayOptions } from "./relay.js";
|
|
4
|
+
export interface ComputerConfig {
|
|
5
|
+
daemonBin?: string;
|
|
6
|
+
version?: string;
|
|
7
|
+
directory: string;
|
|
8
|
+
host?: string;
|
|
9
|
+
bind: string;
|
|
10
|
+
sshPort: number;
|
|
11
|
+
websocketPort: number;
|
|
12
|
+
relay: RelayOptions;
|
|
13
|
+
}
|
|
14
|
+
export declare const defaultStateDirectory: () => string;
|
|
15
|
+
export declare const defaultComputerConfig: () => ComputerConfig;
|
|
16
|
+
export declare function readJSON<T>(file: string): Promise<T | undefined>;
|
|
17
|
+
export declare function writeJSON(file: string, value: unknown): Promise<void>;
|
|
18
|
+
export declare function computerClient(directory: string): Promise<Mindwire>;
|
|
19
|
+
export declare function directRoutes(config: ComputerConfig, port: number): ComputerRoute[];
|
|
20
|
+
/** Launch once; the daemon additionally owns an OS file lock over its identity/state. */
|
|
21
|
+
export declare function ensureComputer(directory: string, cliPath: string, patch?: Partial<ComputerConfig>, onProgress?: (message: string) => void): Promise<Mindwire>;
|
|
22
|
+
/** The only owner of daemon/relay processes. Closing the pairing command leaves this running. */
|
|
23
|
+
export declare function superviseComputer(directory: string): Promise<void>;
|
|
24
|
+
export declare function stopComputer(directory: string, force?: boolean): Promise<void>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ChildProcess } from "node:child_process";
|
|
2
|
+
import type { ComputerRoute } from "../computer.js";
|
|
3
|
+
export interface RelayOptions {
|
|
4
|
+
kind: "none" | "cloudflare" | "ngrok" | "custom";
|
|
5
|
+
/** A stable, already configured hostname; custom relays must forward WebSocket upgrades. */
|
|
6
|
+
url?: string;
|
|
7
|
+
cloudflareTokenFile?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface RelayHandle {
|
|
10
|
+
route?: ComputerRoute;
|
|
11
|
+
process?: ChildProcess;
|
|
12
|
+
close(): void;
|
|
13
|
+
}
|
|
14
|
+
export declare function websocketURL(value: string): string;
|
|
15
|
+
/** Both providers forward encrypted SSH bytes to one loopback WebSocket bridge. */
|
|
16
|
+
export declare function startRelay(options: RelayOptions, port: number, runtime?: {
|
|
17
|
+
cacheDir?: string;
|
|
18
|
+
onProgress?: (message: string) => void | Promise<void>;
|
|
19
|
+
}): Promise<RelayHandle>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { Mindwire } from "./client.js";
|
|
2
|
+
export type ComputerRoute = {
|
|
3
|
+
kind: "ssh";
|
|
4
|
+
host: string;
|
|
5
|
+
port: number;
|
|
6
|
+
} | {
|
|
7
|
+
kind: "websocket";
|
|
8
|
+
url: string;
|
|
9
|
+
};
|
|
10
|
+
export interface ComputerInvitation {
|
|
11
|
+
version: 1;
|
|
12
|
+
computerId: string;
|
|
13
|
+
name: string;
|
|
14
|
+
fingerprint: string;
|
|
15
|
+
routes: ComputerRoute[];
|
|
16
|
+
pairingId: string;
|
|
17
|
+
secret: string;
|
|
18
|
+
expiresAt: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ComputerDevice {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
publicKey: string;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
revoked: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface ComputerPairRequest {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
publicKey: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ComputerPairing {
|
|
33
|
+
id: string;
|
|
34
|
+
expiresAt: string;
|
|
35
|
+
status: "waiting" | "pending" | "approved" | "rejected";
|
|
36
|
+
request?: ComputerPairRequest;
|
|
37
|
+
completed?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface ComputerUpdate {
|
|
40
|
+
id: string;
|
|
41
|
+
version: string;
|
|
42
|
+
updatedAt: string;
|
|
43
|
+
error?: string;
|
|
44
|
+
status: "idle" | "queued" | "downloading" | "waiting" | "restarting" | "complete" | "failed";
|
|
45
|
+
}
|
|
46
|
+
export interface ComputerInfo {
|
|
47
|
+
version: number;
|
|
48
|
+
computerId: string;
|
|
49
|
+
registryId: string;
|
|
50
|
+
fingerprint: string;
|
|
51
|
+
routes: ComputerRoute[];
|
|
52
|
+
pid: number;
|
|
53
|
+
apiAddress: string;
|
|
54
|
+
sshPort: number;
|
|
55
|
+
websocketPort: number;
|
|
56
|
+
}
|
|
57
|
+
/** Available only in computer mode. All calls use the existing authenticated transport. */
|
|
58
|
+
export declare class ComputerApi {
|
|
59
|
+
private readonly client;
|
|
60
|
+
constructor(client: Mindwire);
|
|
61
|
+
info(): Promise<ComputerInfo>;
|
|
62
|
+
setRoutes(routes: ComputerRoute[]): Promise<ComputerInfo>;
|
|
63
|
+
updateStatus(): Promise<ComputerUpdate>;
|
|
64
|
+
requestUpdate(version: string): Promise<ComputerUpdate>;
|
|
65
|
+
invite(routes: ComputerRoute[]): Promise<ComputerInvitation>;
|
|
66
|
+
pairing(id: string): Promise<ComputerPairing>;
|
|
67
|
+
completePairing(id: string, requestId: string): Promise<{
|
|
68
|
+
ok: boolean;
|
|
69
|
+
}>;
|
|
70
|
+
decide(id: string, requestId: string, approve: boolean): Promise<{
|
|
71
|
+
ok: boolean;
|
|
72
|
+
device: ComputerDevice;
|
|
73
|
+
}>;
|
|
74
|
+
devices(): Promise<ComputerDevice[]>;
|
|
75
|
+
revoke(id: string): Promise<{
|
|
76
|
+
ok: boolean;
|
|
77
|
+
}>;
|
|
78
|
+
}
|
|
79
|
+
/** A URI carries an invitation, not permanent credentials. Never log it to shared service logs. */
|
|
80
|
+
export declare function computerPairingURI(invitation: ComputerInvitation): string;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { Mindwire } from "./client.js";
|
|
2
|
+
/** Native workspace execution; the same contract on macOS, Linux and Windows. */
|
|
3
|
+
export interface WorkspaceHost {
|
|
4
|
+
hostname: string;
|
|
5
|
+
os: "darwin" | "linux" | "windows" | string;
|
|
6
|
+
arch: string;
|
|
7
|
+
home: string;
|
|
8
|
+
directory: string;
|
|
9
|
+
pid: number;
|
|
10
|
+
}
|
|
11
|
+
export interface HostResources {
|
|
12
|
+
cpus: number;
|
|
13
|
+
memoryMb: number;
|
|
14
|
+
diskMb: number;
|
|
15
|
+
}
|
|
16
|
+
export interface WorkspaceFile {
|
|
17
|
+
name: string;
|
|
18
|
+
path: string;
|
|
19
|
+
type: "file" | "dir";
|
|
20
|
+
size: number;
|
|
21
|
+
modifiedAt: string;
|
|
22
|
+
isIgnored: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface WorkspaceFileContent {
|
|
25
|
+
path: string;
|
|
26
|
+
content: string;
|
|
27
|
+
size: number;
|
|
28
|
+
}
|
|
29
|
+
export interface WorkspaceExecRequest {
|
|
30
|
+
argv: string[];
|
|
31
|
+
directory?: string;
|
|
32
|
+
input?: string;
|
|
33
|
+
timeoutMs?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface WorkspaceExecResult {
|
|
36
|
+
stdout: string;
|
|
37
|
+
stderr: string;
|
|
38
|
+
exitCode: number;
|
|
39
|
+
truncated?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export type WorkspaceExecEvent = {
|
|
42
|
+
kind: "output";
|
|
43
|
+
channel: "stdout" | "stderr";
|
|
44
|
+
data: string;
|
|
45
|
+
} | {
|
|
46
|
+
kind: "exit";
|
|
47
|
+
exitCode: number;
|
|
48
|
+
} | {
|
|
49
|
+
kind: "error";
|
|
50
|
+
error: string;
|
|
51
|
+
};
|
|
52
|
+
export interface TerminalRequest {
|
|
53
|
+
id: string;
|
|
54
|
+
directory?: string;
|
|
55
|
+
columns: number;
|
|
56
|
+
rows: number;
|
|
57
|
+
}
|
|
58
|
+
export interface TerminalState extends TerminalRequest {
|
|
59
|
+
title: string;
|
|
60
|
+
running: boolean;
|
|
61
|
+
exitCode?: number;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
}
|
|
64
|
+
export interface TerminalEvent {
|
|
65
|
+
sequence: number;
|
|
66
|
+
kind: "output" | "reset" | "exit";
|
|
67
|
+
data?: string;
|
|
68
|
+
state?: TerminalState;
|
|
69
|
+
}
|
|
70
|
+
/** Retry the exact same writer/sequence/data after a lost acknowledgement, never a new sequence. */
|
|
71
|
+
export interface TerminalInput {
|
|
72
|
+
writer: string;
|
|
73
|
+
sequence: number;
|
|
74
|
+
data: string;
|
|
75
|
+
}
|
|
76
|
+
export declare class ExecutionApi {
|
|
77
|
+
private readonly client;
|
|
78
|
+
readonly terminals: TerminalsApi;
|
|
79
|
+
constructor(client: Mindwire);
|
|
80
|
+
host(): Promise<WorkspaceHost>;
|
|
81
|
+
resources(): Promise<HostResources>;
|
|
82
|
+
files(path?: string, query?: string): Promise<WorkspaceFile[]>;
|
|
83
|
+
read(path: string): Promise<WorkspaceFileContent>;
|
|
84
|
+
write(path: string, content: string): Promise<{
|
|
85
|
+
ok: boolean;
|
|
86
|
+
}>;
|
|
87
|
+
remove(path: string): Promise<{
|
|
88
|
+
ok: boolean;
|
|
89
|
+
}>;
|
|
90
|
+
exec(command: WorkspaceExecRequest, signal?: AbortSignal): Promise<WorkspaceExecResult>;
|
|
91
|
+
/** Output data is base64, preserving partial UTF-8 chunks. Cancelling stops this command. */
|
|
92
|
+
stream(command: WorkspaceExecRequest, signal?: AbortSignal): AsyncGenerator<WorkspaceExecEvent>;
|
|
93
|
+
}
|
|
94
|
+
export declare class TerminalsApi {
|
|
95
|
+
private readonly client;
|
|
96
|
+
constructor(client: Mindwire);
|
|
97
|
+
list(directory?: string): Promise<TerminalState[]>;
|
|
98
|
+
open(request: TerminalRequest): Promise<TerminalState>;
|
|
99
|
+
get(id: string): Promise<TerminalState>;
|
|
100
|
+
close(id: string): Promise<{
|
|
101
|
+
ok: boolean;
|
|
102
|
+
}>;
|
|
103
|
+
input(id: string, input: TerminalInput): Promise<{
|
|
104
|
+
ok: boolean;
|
|
105
|
+
sequence: number;
|
|
106
|
+
}>;
|
|
107
|
+
resize(id: string, columns: number, rows: number): Promise<TerminalState>;
|
|
108
|
+
/** Detaching only closes the subscription. Resume from the last sequence; reset replaces the screen. */
|
|
109
|
+
events(id: string, after?: number, signal?: AbortSignal): AsyncGenerator<TerminalEvent>;
|
|
110
|
+
private path;
|
|
111
|
+
}
|