mindwire 0.1.25 → 0.1.27
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-VM7VHCEU.js +4 -0
- package/dist/{binary-cache-CG52TXCZ.js.map → binary-cache-VM7VHCEU.js.map} +1 -1
- package/dist/{chunk-PFYKJ6LX.js → chunk-3FR7BFAW.js} +4 -56
- package/dist/chunk-3FR7BFAW.js.map +1 -0
- package/dist/chunk-QXHI4TMC.js +2050 -0
- package/dist/chunk-QXHI4TMC.js.map +1 -0
- package/dist/cli.js +567 -2180
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +23 -3
- package/dist/computer/connection-flow.d.ts +22 -0
- package/dist/computer/controller.d.ts +3 -0
- package/dist/computer/lifecycle.d.ts +13 -3
- package/dist/computer/lock.d.ts +11 -0
- package/dist/computer/pairing-display.d.ts +23 -0
- package/dist/computer/process.d.ts +26 -0
- package/dist/computer/relay.d.ts +5 -1
- package/dist/computer/startup.d.ts +38 -0
- package/dist/computer.d.ts +26 -2
- package/dist/controller-7YV6O7GT.js +496 -0
- package/dist/controller-7YV6O7GT.js.map +1 -0
- package/dist/index.cjs +51 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +51 -15
- package/dist/index.js.map +1 -1
- package/dist/service.d.ts +5 -1
- package/dist/types.d.ts +13 -0
- package/dist/workspace.d.ts +16 -2
- package/package.json +1 -1
- package/dist/binary-cache-CG52TXCZ.js +0 -3
- package/dist/chunk-PFYKJ6LX.js.map +0 -1
package/dist/service.d.ts
CHANGED
|
@@ -16,8 +16,12 @@ export declare class ServiceApi {
|
|
|
16
16
|
constructor(client: Mindwire);
|
|
17
17
|
updateStatus(): Promise<ServiceUpdateState>;
|
|
18
18
|
/** Download first. Acquire immediately before replacement; busy work returns 409.
|
|
19
|
+
* With serviceUpdateVersion >= 2, force authorizes interrupting active work.
|
|
20
|
+
* It never overrides another installer's lease.
|
|
19
21
|
* Admission stays closed until release, process exit, or the one-minute expiry. */
|
|
20
|
-
acquireUpdate(
|
|
22
|
+
acquireUpdate(options?: {
|
|
23
|
+
force?: boolean;
|
|
24
|
+
}): Promise<ServiceUpdateLease>;
|
|
21
25
|
releaseUpdate(id: string): Promise<{
|
|
22
26
|
ok: boolean;
|
|
23
27
|
}>;
|
package/dist/types.d.ts
CHANGED
|
@@ -676,6 +676,15 @@ export interface Message {
|
|
|
676
676
|
createdAt: string;
|
|
677
677
|
/** Ordered rich transcript (text / thinking / tool / compaction). Absent for user & text-only messages. */
|
|
678
678
|
parts?: Part[];
|
|
679
|
+
/** Native user images, including inline bytes when retained by the harness or recorded turn. */
|
|
680
|
+
attachments?: Attachment[];
|
|
681
|
+
}
|
|
682
|
+
/** Complete messages, oldest first. A soft byte budget keeps large histories incremental. */
|
|
683
|
+
export interface MessagePage {
|
|
684
|
+
messages: Message[];
|
|
685
|
+
hasMore: boolean;
|
|
686
|
+
/** Pass as `before` to read the preceding page. */
|
|
687
|
+
before?: string;
|
|
679
688
|
}
|
|
680
689
|
/**
|
|
681
690
|
* Per-turn parameters distinct from the agent's sticky settings (persisted via `setConfig`). Passed
|
|
@@ -977,6 +986,7 @@ export interface NotifyChannelTestResult {
|
|
|
977
986
|
}
|
|
978
987
|
/** `GET /healthz` — the daemon's liveness probe. */
|
|
979
988
|
export interface Health {
|
|
989
|
+
historyPageVersion?: number;
|
|
980
990
|
surfaceProtocolVersion?: number;
|
|
981
991
|
/** Workspace registry protocol version; absent on daemons predating workspace metadata. */
|
|
982
992
|
workspaceMetadataVersion?: number;
|
|
@@ -1000,6 +1010,9 @@ export interface Health {
|
|
|
1000
1010
|
workspaceIsolationVersion?: number;
|
|
1001
1011
|
workspaceExecutionVersion?: number;
|
|
1002
1012
|
terminalProtocolVersion?: number;
|
|
1013
|
+
turnRequestVersion?: number;
|
|
1014
|
+
/** Image-only input and image attachments retained in message history. */
|
|
1015
|
+
imageAttachmentsVersion?: number;
|
|
1003
1016
|
computerConnectionVersion?: number;
|
|
1004
1017
|
workspaceIsolation?: "direct" | "container";
|
|
1005
1018
|
}
|
package/dist/workspace.d.ts
CHANGED
|
@@ -165,8 +165,12 @@ export interface WorkspaceChat extends WorkspaceRecord {
|
|
|
165
165
|
agentId: string;
|
|
166
166
|
projectId: string;
|
|
167
167
|
title: string;
|
|
168
|
+
/** Cached native title beneath an optional user rename. Owned by the daemon. */
|
|
169
|
+
nativeTitle?: string;
|
|
168
170
|
titleIsUserSet?: boolean;
|
|
169
171
|
sessionId?: string;
|
|
172
|
+
/** Native harness activity, retained across app restarts. Not the last app-open time. */
|
|
173
|
+
updatedAt?: string;
|
|
170
174
|
/** Mutes this chat. False clears its own mute but never overrides a muted parent profile. Omit to preserve. */
|
|
171
175
|
notificationsMuted?: boolean;
|
|
172
176
|
}
|
|
@@ -200,6 +204,12 @@ export interface WorkspaceSnapshot {
|
|
|
200
204
|
id: string;
|
|
201
205
|
revision: number;
|
|
202
206
|
}[];
|
|
207
|
+
/** Cached chats are retained when a harness's native list could not be refreshed. */
|
|
208
|
+
sessionDiscoveryIssues?: {
|
|
209
|
+
projectId: string;
|
|
210
|
+
agent: string;
|
|
211
|
+
message: string;
|
|
212
|
+
}[];
|
|
203
213
|
}
|
|
204
214
|
export declare class WorkspaceCollection<T extends WorkspaceRecord> {
|
|
205
215
|
private readonly mw;
|
|
@@ -221,7 +231,9 @@ export declare class WorkspaceApi {
|
|
|
221
231
|
readonly projects: WorkspaceCollection<WorkspaceProject>;
|
|
222
232
|
readonly chats: WorkspaceCollection<WorkspaceChat>;
|
|
223
233
|
constructor(mw: Mindwire);
|
|
224
|
-
snapshot(
|
|
234
|
+
snapshot(options?: {
|
|
235
|
+
refresh?: boolean;
|
|
236
|
+
}): Promise<WorkspaceSnapshot>;
|
|
225
237
|
/** Start an operation owned by the daemon. The same ID/payload returns the existing operation. */
|
|
226
238
|
createProject(request: ProjectRequest): Promise<ProjectOperation>;
|
|
227
239
|
/** Permanently remove the confirmed project's directory and membership.
|
|
@@ -231,7 +243,9 @@ export declare class WorkspaceApi {
|
|
|
231
243
|
/** Incremental reconciliation. Pass the previous identity to detect a replaced/restored workspace.
|
|
232
244
|
* A 409 requires fetching snapshot() again; never apply a delta to a different registry.
|
|
233
245
|
*/
|
|
234
|
-
changes(since: number, workspaceId: string
|
|
246
|
+
changes(since: number, workspaceId: string, options?: {
|
|
247
|
+
refresh?: boolean;
|
|
248
|
+
}): Promise<WorkspaceSnapshot>;
|
|
235
249
|
/** Import legacy metadata before replacing a local cache. Safe to repeat after interruption. */
|
|
236
250
|
import(records: WorkspaceImport): Promise<WorkspaceSnapshot>;
|
|
237
251
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors.ts","../src/binary-cache.ts"],"names":[],"mappings":";AACO,IAAM,aAAA,GAAN,cAA4B,KAAA,CAAM;AAAA,EACvC,WAAA,CAAY,SAAiB,OAAA,EAA+B;AAC1D,IAAA,KAAA,CAAM,SAAS,OAAO,CAAA;AACtB,IAAA,IAAA,CAAK,IAAA,GAAO,eAAA;AAAA,EACd;AACF;AAMO,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiB,aAAA,CAAc;AAAA,EACjC,MAAA;AAAA,EACA,GAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA;AAAA,EAET,YAAY,IAAA,EAAsE;AAChF,IAAA,KAAA,CAAM,SAAA,CAAS,UAAA,CAAW,IAAI,CAAC,CAAA;AAC/B,IAAA,IAAA,CAAK,IAAA,GAAO,UAAA;AACZ,IAAA,IAAA,CAAK,SAAS,IAAA,CAAK,MAAA;AACnB,IAAA,IAAA,CAAK,MAAM,IAAA,CAAK,GAAA;AAChB,IAAA,IAAA,CAAK,SAAS,IAAA,CAAK,MAAA;AACnB,IAAA,IAAA,CAAK,OAAO,IAAA,CAAK,IAAA;AAAA,EACnB;AAAA,EAEA,OAAe,UAAA,CAAW;AAAA,IACxB,MAAA;AAAA,IACA,MAAA;AAAA,IACA,GA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D,IAAA,MAAM,EAAA,CAAG,UAAU,CAAA,EAAG,IAAI,WAAW,CAAA,EAAG,QAAA,CAAS,aAAa;AAAA,CAAA,EAAM,EAAE,IAAA,EAAM,GAAA,EAAO,IAAA,EAAM,MAAM,CAAA;AAC/F,IAAA,MAAM,EAAA,CAAG,MAAA,CAAO,IAAA,EAAM,GAAG,CAAA;AACzB,IAAA,MAAM,GAAG,MAAA,CAAO,CAAA,EAAG,IAAI,CAAA,OAAA,CAAA,EAAW,CAAA,EAAG,GAAG,CAAA,OAAA,CAAS,CAAA;AACjD,IAAA,OAAO,GAAA;AAAA,EACT,CAAA,SAAE;AACA,IAAA,MAAM,GAAG,EAAA,CAAG,IAAA,EAAM,EAAE,KAAA,EAAO,MAAM,CAAA;AACjC,IAAA,MAAM,EAAA,CAAG,GAAG,CAAA,EAAG,IAAI,WAAW,EAAE,KAAA,EAAO,MAAM,CAAA;AAAA,EAC/C;AACF","file":"chunk-PFYKJ6LX.js","sourcesContent":["/** Base class for every error thrown by the SDK. */\nexport class MindwireError extends Error {\n constructor(message: string, options?: { cause?: unknown }) {\n super(message, options);\n this.name = \"MindwireError\";\n }\n}\n\n/**\n * A non-2xx HTTP response from the daemon. `body` is the parsed JSON error payload when the\n * daemon returned one (it uses `{ \"error\": \"...\" }`), otherwise the raw text.\n */\nexport class ApiError extends MindwireError {\n readonly status: number;\n readonly url: string;\n readonly method: string;\n readonly body: unknown;\n\n constructor(args: { status: number; url: string; method: string; body: unknown }) {\n super(ApiError.messageFor(args));\n this.name = \"ApiError\";\n this.status = args.status;\n this.url = args.url;\n this.method = args.method;\n this.body = args.body;\n }\n\n private static messageFor({\n status,\n method,\n url,\n body,\n }: {\n status: number;\n method: string;\n url: string;\n body: unknown;\n }): string {\n const detail =\n body && typeof body === \"object\" && \"error\" in body && typeof body.error === \"string\"\n ? body.error\n : typeof body === \"string\" && body.trim() !== \"\"\n ? body.trim()\n : \"\";\n const base = `${method} ${url} failed with ${status}`;\n return detail ? `${base}: ${detail}` : base;\n }\n}\n\n/**\n * Thrown by {@link import(\"./run.js\").Run.wait} when a run ends in a non-success terminal state\n * (`error`/`cancelled`), or when the event stream ends before the run reaches any terminal state —\n * a dropped/truncated stream. The `status` is whatever the run was in when `wait()` gave up, so a\n * truncated stream surfaces as e.g. `run <id> running: event stream ended …` rather than silently\n * returning a success-shaped result.\n */\nexport class RunFailedError extends MindwireError {\n readonly status: string;\n readonly runId: string;\n\n constructor(runId: string, status: string, detail?: string) {\n super(detail ? `run ${runId} ${status}: ${detail}` : `run ${runId} ${status}`);\n this.name = \"RunFailedError\";\n this.runId = runId;\n this.status = status;\n }\n}\n\n/**\n * Thrown when a unary request exceeds the client's `requestTimeoutMs` deadline. A hung daemon or a\n * dead tunnel would otherwise block the caller forever; this bounds every non-streaming call. SSE\n * streams are long-lived and are never subject to this timeout.\n */\nexport class TimeoutError extends MindwireError {\n readonly method: string;\n readonly path: string;\n readonly timeoutMs: number;\n\n constructor(method: string, path: string, timeoutMs: number) {\n super(`mindwire: ${method} ${path} timed out after ${timeoutMs}ms`);\n this.name = \"TimeoutError\";\n this.method = method;\n this.path = path;\n this.timeoutMs = timeoutMs;\n }\n}\n","// Shared verified executable cache for the daemon and optional connection helpers.\n// Node modules stay lazy so importing the SDK in a browser remains supported.\nimport { MindwireError } from \"./errors.js\";\n\nexport async function binaryCacheDirectory(platform = process.platform): Promise<string> {\n const path = await import(\"node:path\");\n const { homedir } = await import(\"node:os\");\n const homeDirectory = homedir();\n return platform === \"darwin\" ? path.join(homeDirectory, \"Library\", \"Caches\", \"mindwire\")\n : platform === \"win32\" ? path.join(process.env.LOCALAPPDATA ?? homeDirectory, \"mindwire\", \"Cache\")\n : path.join(process.env.XDG_CACHE_HOME ?? path.join(homeDirectory, \".cache\"), \"mindwire\");\n}\n\nexport async function executableChecksum(bytes: Uint8Array): Promise<string> {\n const { createHash } = await import(\"node:crypto\");\n return createHash(\"sha256\").update(bytes).digest(\"hex\");\n}\n\nexport async function verifyReleaseBytes(bytes: Uint8Array, expected: string, name: string): Promise<void> {\n if (!/^[a-f0-9]{64}$/i.test(expected) || await executableChecksum(bytes) !== expected.toLowerCase()) {\n throw new MindwireError(`mindwire: checksum verification failed for ${name}`);\n }\n}\n\nexport async function cachedExecutable(bin: string): Promise<string | undefined> {\n const fs = await import(\"node:fs/promises\");\n try {\n const [bytes, checksum] = await Promise.all([fs.readFile(bin), fs.readFile(`${bin}.sha256`, \"utf8\")]);\n await verifyReleaseBytes(bytes, checksum.trim(), bin);\n return bin;\n } catch { return undefined; }\n}\n\nexport async function cacheExecutable(bin: string, bytes: Uint8Array, expected: string): Promise<string> {\n await verifyReleaseBytes(bytes, expected, bin);\n const fs = await import(\"node:fs/promises\");\n const { dirname } = await import(\"node:path\");\n const { randomUUID } = await import(\"node:crypto\");\n await fs.mkdir(dirname(bin), { recursive: true, mode: 0o700 });\n // Unique temporary names also cover concurrent acquisitions in the same process.\n const temp = `${bin}.${randomUUID()}.tmp`;\n try {\n await fs.writeFile(temp, bytes, { mode: 0o755, flag: \"wx\" });\n await fs.writeFile(`${temp}.sha256`, `${expected.toLowerCase()}\\n`, { mode: 0o600, flag: \"wx\" });\n await fs.rename(temp, bin);\n await fs.rename(`${temp}.sha256`, `${bin}.sha256`);\n return bin;\n } finally {\n await fs.rm(temp, { force: true });\n await fs.rm(`${temp}.sha256`, { force: true });\n }\n}\n"]}
|