mindwire 0.1.42 → 0.1.44
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/{chunk-5O6QCNZW.js → chunk-4T66LLES.js} +3 -3
- package/dist/{chunk-5O6QCNZW.js.map → chunk-4T66LLES.js.map} +1 -1
- package/dist/{chunk-YQSLQWPI.js → chunk-CSX2ZLIV.js} +108 -18
- package/dist/chunk-CSX2ZLIV.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/client.d.ts +14 -1
- package/dist/{connection-change-LZ6MT6Q6.js → connection-change-KVOVAVF4.js} +3 -3
- package/dist/{connection-change-LZ6MT6Q6.js.map → connection-change-KVOVAVF4.js.map} +1 -1
- package/dist/{controller-UYJ7F2IU.js → controller-3KH6CUOC.js} +4 -4
- package/dist/{controller-UYJ7F2IU.js.map → controller-3KH6CUOC.js.map} +1 -1
- package/dist/{controller-handoff-YNHM2W52.js → controller-handoff-OWJJEC2H.js} +3 -3
- package/dist/{controller-handoff-YNHM2W52.js.map → controller-handoff-OWJJEC2H.js.map} +1 -1
- package/dist/index.cjs +106 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +106 -16
- package/dist/index.js.map +1 -1
- package/dist/run.d.ts +5 -2
- package/dist/surfaces.d.ts +95 -3
- package/dist/types.d.ts +44 -2
- package/dist/workspace.d.ts +30 -0
- package/package.json +1 -1
- package/dist/binary-cache-ZTEYICUF.js +0 -51
- package/dist/binary-cache-ZTEYICUF.js.map +0 -1
- package/dist/chunk-T6TD76UA.js +0 -57
- package/dist/chunk-T6TD76UA.js.map +0 -1
- package/dist/chunk-YQSLQWPI.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { websocketURL, readJSON, writeJSON, acquireProcessLock, computerClient, versionAtLeast } from './chunk-
|
|
1
|
+
import { websocketURL, readJSON, writeJSON, acquireProcessLock, computerClient, versionAtLeast } from './chunk-CSX2ZLIV.js';
|
|
2
2
|
import { join } from 'path';
|
|
3
3
|
import { setTimeout } from 'timers/promises';
|
|
4
4
|
|
|
@@ -302,5 +302,5 @@ function updateProgress(update) {
|
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
export { activeUpdate, connectionAddress, connectionDescription, connectionInfo, disableAddressDiscovery, discoveryDescription, discoveryPreference, enableAddressDiscovery, queueServiceUpdate, reconcileAddressDiscovery, saveDiscoveryPreference, updateComputer, updateProgress };
|
|
305
|
-
//# sourceMappingURL=chunk-
|
|
306
|
-
//# sourceMappingURL=chunk-
|
|
305
|
+
//# sourceMappingURL=chunk-4T66LLES.js.map
|
|
306
|
+
//# sourceMappingURL=chunk-4T66LLES.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/computer/provider-info.ts","../src/computer/directory-http.ts","../src/computer/discovery.ts","../src/computer/service-update.ts"],"names":["delay","join"],"mappings":";;;;;AAKO,SAAS,iBAAA,CAAkB,OAAqB,IAAA,EAAuB;AAC5E,EAAA,OAAO,KAAA,CAAM,IAAA,KAAS,MAAA,GAAS,CAAA,IAAA,EAAO,QAAQ,SAAS,CAAA,CAAA,GACnD,KAAA,CAAM,GAAA,GAAM,aAAa,KAAA,CAAM,GAAG,CAAA,GAAI,CAAA,UAAA,EAAa,MAAM,IAAI,CAAA,CAAA;AACnE;AAGO,SAAS,cAAA,CAAe,OAAqB,IAAA,EAAuC;AACzF,EAAA,IAAI,KAAA,CAAM,IAAA,KAAS,MAAA,EAAQ,OAAO,EAAE,UAAU,QAAA,EAAU,OAAA,EAAS,IAAA,GAAO,YAAA,GAAe,SAAA,EAAU;AACjG,EAAA,OAAO,EAAE,QAAA,EAAU,KAAA,CAAM,IAAA,EAAM,OAAA,EAAS,CAAC,YAAA,EAAc,OAAO,CAAA,CAAE,QAAA,CAAS,MAAM,IAAI,CAAA,IAAK,CAAC,KAAA,CAAM,GAAA,GAAM,cAAc,YAAA,EAAa;AAClI;AAEO,SAAS,sBAA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AAA,EAAQ,OAAA,CAAQ,QAAQ,CAAA;AAAA,EACxD;AACF;AAEO,SAAS,eAAe,MAAA,EAAgC;AAC7D,EAAA,MAAM,KAAA,GAAkD;AAAA,IACtD,IAAA,EAAM,OAAA;AAAA,IAAS,MAAA,EAAQ,QAAA;AAAA,IAAU,WAAA,EAAa,oCAAA;AAAA,IAC9C,OAAA,EAAS,mCAAA;AAAA,IAAqC,UAAA,EAAY,0BAAA;AAAA,IAC1D,QAAA,EAAU,WAAA;AAAA,IAAa,MAAA,EAAQ;AAAA,GACjC;AACA,EAAA,OAAO,GAAG,MAAA,CAAO,OAAO,SAAM,KAAA,CAAM,MAAA,CAAO,MAAM,CAAC,CAAA,CAAA;AACpD","file":"chunk-5O6QCNZW.js","sourcesContent":["import type { ComputerConnectionInfo } from \"../computer.js\";\nimport type { RelayOptions } from \"./relay.js\";\nimport { websocketURL } from \"./relay.js\";\n\n/** Credential renewal does not change the address already saved by the phone. */\nexport function connectionAddress(relay: RelayOptions, host?: string): string {\n return relay.kind === \"none\" ? `ssh:${host ?? \"network\"}`\n : relay.url ? websocketURL(relay.url) : `temporary:${relay.kind}`;\n}\n\n/** Public, non-secret metadata. Route/SSH identity is independent of provider credentials. */\nexport function connectionInfo(relay: RelayOptions, host?: string): ComputerConnectionInfo {\n if (relay.kind === \"none\") return { provider: \"direct\", address: host ? \"persistent\" : \"network\" };\n return { provider: relay.kind, address: [\"cloudflare\", \"ngrok\"].includes(relay.kind) && !relay.url ? \"temporary\" : \"persistent\" };\n}\n\nexport function connectionDescription(info: ComputerConnectionInfo): string {\n const name = { oblien: \"Oblien\", cloudflare: \"Cloudflare\", ngrok: \"ngrok\", custom: \"Your tunnel\", direct: \"Direct SSH / VPN\" }[info.provider];\n if (info.address === \"temporary\") return `${name} · temporary address. For reconnect after a restart, run mindwire connection to choose a persistent address.`;\n if (info.address === \"network\") return `${name} · reachable network required. Use a VPN hostname for access across networks.`;\n return `${name} · persistent address. Saved phones retry automatically when this computer is online.`;\n}\n","export class DirectoryRequestError extends Error {\n constructor(\n readonly status: number,\n readonly code: string,\n readonly retryAfter = 0,\n ) {\n super(\n status === 0\n ? \"Couldn't reach the address directory securely. Check its HTTPS address and retry.\"\n : `The address directory rejected the request (${code}).`,\n );\n }\n}\n\n/** Bounded, same-origin requests. No redirects, cookie jar or retained credentials. */\nexport async function directoryRequest<T>(url: string, path: string, body: unknown, signal?: AbortSignal): Promise<T> {\n let response: Response;\n try {\n response = await fetch(url + path, {\n method: \"POST\",\n redirect: \"error\",\n signal: signal ? AbortSignal.any([signal, AbortSignal.timeout(10_000)]) : AbortSignal.timeout(10_000),\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\",\n },\n body: JSON.stringify(body),\n });\n } catch {\n signal?.throwIfAborted();\n throw new DirectoryRequestError(0, \"unreachable\");\n }\n const reader = response.body?.getReader();\n const chunks: Uint8Array[] = [];\n let length = 0;\n try {\n if (reader)\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n length += value.byteLength;\n if (length > 64 * 1024) throw new Error(\"The address directory returned an oversized response.\");\n chunks.push(value);\n }\n } finally {\n void reader?.cancel().catch(() => {});\n }\n let data: unknown;\n try {\n data = JSON.parse(Buffer.concat(chunks).toString(\"utf8\"));\n } catch {\n throw new DirectoryRequestError(response.status, \"invalid_response\");\n }\n if (!response.ok) {\n const error = (data as { error?: unknown } | null)?.error;\n const code = typeof error === \"string\" ? error : (error as { code?: unknown } | null)?.code;\n const retryAfter = Number(response.headers.get(\"Retry-After\"));\n throw new DirectoryRequestError(\n response.status,\n typeof code === \"string\" && /^[a-z_]{1,64}$/.test(code) ? code : \"directory_error\",\n Number.isFinite(retryAfter) ? Math.max(0, Math.min(60, retryAfter)) : 0,\n );\n }\n return data as T;\n}\n","import { join } from \"node:path\";\nimport { setTimeout as delay } from \"node:timers/promises\";\nimport type { Mindwire } from \"../client.js\";\nimport type { ComputerDiscoveryStatus } from \"../computer.js\";\nimport { acquireProcessLock } from \"./lock.js\";\nimport type { SetupPrompt } from \"./setup-prompt.js\";\nimport { directoryRequest, DirectoryRequestError } from \"./directory-http.js\";\nimport { readJSON, writeJSON, type ComputerConfig } from \"./lifecycle.js\";\n\nexport const DIRECTORY_API_PATH = \"/api/computer-directory/v1\";\nexport const DIRECTORY_URL = `https://console.mindwire.sh${DIRECTORY_API_PATH}`;\n\nexport interface DiscoveryPreference { enabled: boolean; url?: string }\nexport const discoveryPreference = (directory: string) =>\n readJSON<DiscoveryPreference>(join(directory, \"computer-discovery-preference.json\"));\n\n/** Desired setup is durable even if enrollment is temporarily offline. The\n * daemon remains the authority for signed publications and phone access. */\nexport async function saveDiscoveryPreference(directory: string, value: DiscoveryPreference): Promise<void> {\n const preference = { ...value, url: value.url ? directoryURL(value.url) : undefined };\n await writeJSON(join(directory, \"computer-discovery-preference.json\"), preference);\n}\n\nexport function directoryURL(value: string): string {\n let url: URL;\n try {\n url = new URL(value);\n } catch {\n throw new Error(\"Enter the directory's HTTPS API URL.\");\n }\n if (\n value.length > 2048 ||\n /[\\s\\x00]/.test(value) ||\n url.username ||\n url.password ||\n url.search ||\n url.hash ||\n (url.protocol !== \"https:\" &&\n !(url.protocol === \"http:\" && [\"localhost\", \"127.0.0.1\", \"[::1]\"].includes(url.hostname)))\n ) {\n throw new Error(\"Use an HTTPS directory URL without credentials, a query, or a fragment.\");\n }\n if (url.pathname === \"/\") url.pathname = DIRECTORY_API_PATH;\n if (url.pathname.endsWith(\"/\") || url.pathname.includes(\"//\") || url.pathname.includes(\"%\")) {\n throw new Error(\"Use the exact directory API URL without a trailing slash.\");\n }\n return url.href;\n}\n\nexport async function enableAddressDiscovery(options: {\n directory: string;\n computer: Mindwire;\n prompt: SetupPrompt;\n url?: string;\n waitForPublication?: boolean;\n signal?: AbortSignal;\n reconcile?: boolean;\n}): Promise<ComputerDiscoveryStatus> {\n const lock = await acquireProcessLock(join(options.directory, \"discovery-setup.lock\"), { signal: options.signal });\n try {\n let status: ComputerDiscoveryStatus;\n try {\n status = await options.computer.computer.discovery();\n } catch (error) {\n if ((error as { status?: number }).status === 404)\n throw new Error(\"Update the Mindwire service before enabling automatic address recovery.\");\n throw error;\n }\n const preference = await discoveryPreference(options.directory);\n if (options.reconcile && preference?.enabled === false) return status;\n // Preserve a saved private directory across upgrades. Credentials belonging\n // to another provider are never read by this flow.\n const url = directoryURL(\n options.url ?? process.env.MINDWIRE_DIRECTORY_URL ?? status.url ?? preference?.url ?? DIRECTORY_URL,\n );\n if (\n status.url &&\n status.url !== url &&\n (status.enabled || (status.sequence ?? 0) !== (status.publishedSequence ?? 0))\n ) {\n throw new Error(\n \"Disable the current directory with mindwire discovery disable and wait for its withdrawal before changing the directory URL.\",\n );\n }\n await saveDiscoveryPreference(options.directory, { enabled: true, url });\n if (!status.enabled || status.url !== url || status.error?.includes(\"enrollment\")) {\n options.prompt.print(`Enabling encrypted address recovery with ${new URL(url).host}…`);\n try {\n const challenge = await directoryRequest<{ challenge: string }>(url, \"/registrations/challenge\", {\n directoryId: status.directoryId,\n }, options.signal);\n if (\n typeof challenge?.challenge !== \"string\" ||\n challenge.challenge.length < 16 ||\n challenge.challenge.length > 2048\n ) {\n throw new Error(\"The address directory returned an invalid enrollment challenge.\");\n }\n const proof = await options.computer.computer.directoryEnrollment(url, challenge.challenge);\n const enrolled = await directoryRequest<{ directoryId: string }>(url, \"/registrations\", proof, options.signal);\n if (enrolled?.directoryId !== status.directoryId)\n throw new Error(\"The directory acknowledged a different computer.\");\n } catch (error) {\n if (error instanceof DirectoryRequestError) {\n if (error.status === 404 || error.status === 501)\n throw new Error(\n \"The address directory isn't available at this URL. Your existing connection still works; retry after the backend is deployed.\",\n );\n if (error.status === 409)\n throw new Error(\n \"This computer's directory registration is revoked or conflicts with its saved identity. Contact the directory operator.\",\n );\n if (error.code === \"account_required\")\n throw new Error(\n \"This directory still requires an account. Update its Mindwire backend to enable key-based registration, or choose another directory with --directory-url.\",\n );\n if (error.status === 401 || error.status === 403)\n throw new Error(\n \"The directory couldn't verify this computer's key or challenge. Retry enrollment.\",\n );\n if (error.status === 429)\n throw new Error(\n \"The directory's registration limit was reached. Retry later or use another directory.\",\n );\n if (error.status === 503)\n throw new Error(\n \"The directory is temporarily unavailable or at capacity. Your existing connection still works.\",\n );\n }\n throw error;\n }\n status = await options.computer.computer.configureDiscovery(true, url);\n }\n if (options.waitForPublication === false) return status;\n const deadline = Date.now() + 15_000;\n while (Date.now() < deadline) {\n status = await options.computer.computer.discovery();\n if (status.enabled && status.sequence && status.publishedSequence === status.sequence) return status;\n if (status.error?.includes(\"enrollment\") || status.error?.includes(\"older revision\"))\n throw new Error(status.error);\n await delay(250, undefined, { signal: options.signal });\n }\n throw new Error(\n \"Address recovery is configured and will retry in the background. Run mindwire discovery status to check publication.\",\n );\n } finally {\n await lock?.close();\n }\n}\n\nexport async function disableAddressDiscovery(directory: string, computer: Mindwire, reconcile = false): Promise<ComputerDiscoveryStatus> {\n const lock = await acquireProcessLock(join(directory, \"discovery-setup.lock\"));\n try {\n const status = await computer.computer.discovery();\n const preference = await discoveryPreference(directory);\n if (reconcile && preference?.enabled === true) return status;\n await saveDiscoveryPreference(directory, { enabled: false, url: status.url ?? preference?.url });\n if (!status.enabled) return status;\n return await computer.computer.configureDiscovery(false);\n } finally { await lock?.close(); }\n}\n\n/** Runs once after startup and retries failed enrollment in the controller. A\n * healthy setup makes only a local status read: publication/renewal stays in Go.\n * Direct/VPN/custom connections never opt into a hosted directory implicitly. */\nexport async function reconcileAddressDiscovery(options: {\n directory: string; config: ComputerConfig; computer: Mindwire; signal?: AbortSignal;\n}): Promise<void> {\n const preference = await discoveryPreference(options.directory);\n const { discovery: status } = await options.computer.computer.info();\n const automatic = options.config.relay.kind === \"cloudflare\" && !options.config.relay.url;\n const enabled = preference?.enabled ?? (status?.enabled || automatic && !status?.url);\n if (!enabled) {\n if (preference?.enabled === false && status?.enabled) await disableAddressDiscovery(options.directory, options.computer, true);\n return;\n }\n if (!status) throw new Error(\"Update the Mindwire service to enable automatic reconnection.\");\n const url = directoryURL(preference?.url ?? process.env.MINDWIRE_DIRECTORY_URL ?? status.url ?? DIRECTORY_URL);\n if (status.enabled && status.url === url && !status.error?.includes(\"enrollment\")) return;\n await enableAddressDiscovery({ ...options, url, waitForPublication: false, reconcile: true,\n prompt: { print() {}, open() {}, question: async () => { throw new Error(\"Unexpected interactive setup.\"); },\n secret: async () => { throw new Error(\"Unexpected interactive setup.\"); } } });\n}\n\nexport function discoveryDescription(status: ComputerDiscoveryStatus | undefined): string {\n if (!status?.enabled) return \"Automatic address recovery is off. Enable it with mindwire discovery enable.\";\n if (status.error) return status.error;\n return status.sequence && status.publishedSequence === status.sequence\n ? \"Encrypted address recovery is on. Saved phones can find this computer when its tunnel address changes.\"\n : \"Publishing the computer's encrypted address…\";\n}\n","import { join } from \"node:path\";\nimport { setTimeout as delay } from \"node:timers/promises\";\nimport type { ComputerUpdate } from \"../computer.js\";\nimport type { Mindwire } from \"../client.js\";\nimport { computerClient, readJSON } from \"./lifecycle.js\";\nimport { versionAtLeast } from \"../version.js\";\n\ntype UpdateClient = Pick<Mindwire, \"health\" | \"computer\">;\nexport function activeUpdate(update: ComputerUpdate | undefined): update is ComputerUpdate {\n return !!update && [\"queued\", \"downloading\", \"waiting\", \"restarting\"].includes(update.status);\n}\n\n/** The daemon arbitrates requests. Join an earlier version before requesting the\n * next; promoting a request never creates a second download or bypasses its lease. */\nexport async function queueServiceUpdate(client: UpdateClient, version: string, force = false): Promise<ComputerUpdate> {\n for (let attempt = 0; ; attempt++) {\n const previous = await client.computer.updateStatus();\n if (activeUpdate(previous) && (!force || previous.force)) return previous;\n try {\n return await client.computer.requestUpdate(activeUpdate(previous) ? previous.version : version, { force });\n } catch (error) {\n if ((error as { status?: number }).status !== 409 || attempt >= 2) throw error;\n // Another caller won admission. Read the authoritative request and join it.\n }\n }\n}\n\nexport interface ServiceUpdateResult { version: string; complete: boolean; update?: ComputerUpdate }\n\n/** A CLI may close after queuing: the controller owns download/restart. Human\n * callers get a bounded result, including the exact older request being joined. */\nexport async function updateComputer(options: {\n directory: string; version: string; force?: boolean; allowDowngrade?: boolean;\n onProgress?: (update: ComputerUpdate) => void; signal?: AbortSignal; timeoutMs?: number;\n connect?: () => Promise<UpdateClient>;\n}):\nPromise<ServiceUpdateResult> {\n const version = options.version.replace(/^v/, \"\");\n if (!/^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$/.test(version)) throw new Error(\"Enter a Mindwire release version, such as 0.1.38.\");\n const connect = options.connect ?? (() => computerClient(options.directory));\n const deadline = Date.now() + (options.timeoutMs ?? 120_000);\n let requested: ComputerUpdate | undefined, last = \"\";\n for (;;) {\n options.signal?.throwIfAborted();\n if (!requested) {\n const client = await connect();\n const installed = (await client.health()).version.replace(/^v/, \"\");\n if (installed === version || !options.allowDowngrade && versionAtLeast(installed, version))\n return { version: installed, complete: true };\n requested = await queueServiceUpdate(client, version, options.force);\n }\n // Progress survives the short API outage during restart. Only the daemon\n // accepts new requests; this read never changes or clears its status.\n const update = await readJSON<ComputerUpdate>(join(options.directory, \"computer-update.json\")) ?? requested;\n if (update.id !== requested.id) {\n // A concurrent update completed/advanced first. Recheck the live service.\n requested = undefined;\n } else {\n const key = `${update.id}:${update.status}`;\n if (last !== key) { last = key; options.onProgress?.(update); }\n if (update.status === \"failed\") throw new Error(update.error ?? \"The service update failed. Run mindwire inspect for details.\");\n if (update.status === \"complete\") {\n requested = undefined;\n if (Date.now() < deadline) continue;\n } else if (!options.force && update.status === \"waiting\") {\n return { version, complete: false, update };\n }\n }\n if (Date.now() >= deadline) return { version, complete: false, update };\n await delay(500, undefined, { signal: options.signal });\n }\n}\n\nexport function updateProgress(update: ComputerUpdate): string {\n const phase: Record<ComputerUpdate[\"status\"], string> = {\n idle: \"Ready\", queued: \"Queued\", downloading: \"Downloading verified release…\",\n waiting: \"Waiting for active work to finish\", restarting: \"Restarting service…\",\n complete: \"Installed\", failed: \"Update failed\",\n };\n return `${update.version} · ${phase[update.status]}`;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/computer/provider-info.ts","../src/computer/directory-http.ts","../src/computer/discovery.ts","../src/computer/service-update.ts"],"names":["delay","join"],"mappings":";;;;;AAKO,SAAS,iBAAA,CAAkB,OAAqB,IAAA,EAAuB;AAC5E,EAAA,OAAO,KAAA,CAAM,IAAA,KAAS,MAAA,GAAS,CAAA,IAAA,EAAO,QAAQ,SAAS,CAAA,CAAA,GACnD,KAAA,CAAM,GAAA,GAAM,aAAa,KAAA,CAAM,GAAG,CAAA,GAAI,CAAA,UAAA,EAAa,MAAM,IAAI,CAAA,CAAA;AACnE;AAGO,SAAS,cAAA,CAAe,OAAqB,IAAA,EAAuC;AACzF,EAAA,IAAI,KAAA,CAAM,IAAA,KAAS,MAAA,EAAQ,OAAO,EAAE,UAAU,QAAA,EAAU,OAAA,EAAS,IAAA,GAAO,YAAA,GAAe,SAAA,EAAU;AACjG,EAAA,OAAO,EAAE,QAAA,EAAU,KAAA,CAAM,IAAA,EAAM,OAAA,EAAS,CAAC,YAAA,EAAc,OAAO,CAAA,CAAE,QAAA,CAAS,MAAM,IAAI,CAAA,IAAK,CAAC,KAAA,CAAM,GAAA,GAAM,cAAc,YAAA,EAAa;AAClI;AAEO,SAAS,sBAAsB,IAAA,EAAsC;AAC1E,EAAA,MAAM,IAAA,GAAO,EAAE,MAAA,EAAQ,QAAA,EAAU,YAAY,YAAA,EAAc,KAAA,EAAO,OAAA,EAAS,MAAA,EAAQ,aAAA,EAAe,MAAA,EAAQ,kBAAA,EAAmB,CAAE,KAAK,QAAQ,CAAA;AAC5I,EAAA,IAAI,IAAA,CAAK,OAAA,KAAY,WAAA,EAAa,OAAO,GAAG,IAAI,CAAA,+GAAA,CAAA;AAChD,EAAA,IAAI,IAAA,CAAK,OAAA,KAAY,SAAA,EAAW,OAAO,GAAG,IAAI,CAAA,gFAAA,CAAA;AAC9C,EAAA,OAAO,GAAG,IAAI,CAAA,wFAAA,CAAA;AAChB;;;ACrBO,IAAM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4T66LLES.js","sourcesContent":["import type { ComputerConnectionInfo } from \"../computer.js\";\nimport type { RelayOptions } from \"./relay.js\";\nimport { websocketURL } from \"./relay.js\";\n\n/** Credential renewal does not change the address already saved by the phone. */\nexport function connectionAddress(relay: RelayOptions, host?: string): string {\n return relay.kind === \"none\" ? `ssh:${host ?? \"network\"}`\n : relay.url ? websocketURL(relay.url) : `temporary:${relay.kind}`;\n}\n\n/** Public, non-secret metadata. Route/SSH identity is independent of provider credentials. */\nexport function connectionInfo(relay: RelayOptions, host?: string): ComputerConnectionInfo {\n if (relay.kind === \"none\") return { provider: \"direct\", address: host ? \"persistent\" : \"network\" };\n return { provider: relay.kind, address: [\"cloudflare\", \"ngrok\"].includes(relay.kind) && !relay.url ? \"temporary\" : \"persistent\" };\n}\n\nexport function connectionDescription(info: ComputerConnectionInfo): string {\n const name = { oblien: \"Oblien\", cloudflare: \"Cloudflare\", ngrok: \"ngrok\", custom: \"Your tunnel\", direct: \"Direct SSH / VPN\" }[info.provider];\n if (info.address === \"temporary\") return `${name} · temporary address. For reconnect after a restart, run mindwire connection to choose a persistent address.`;\n if (info.address === \"network\") return `${name} · reachable network required. Use a VPN hostname for access across networks.`;\n return `${name} · persistent address. Saved phones retry automatically when this computer is online.`;\n}\n","export class DirectoryRequestError extends Error {\n constructor(\n readonly status: number,\n readonly code: string,\n readonly retryAfter = 0,\n ) {\n super(\n status === 0\n ? \"Couldn't reach the address directory securely. Check its HTTPS address and retry.\"\n : `The address directory rejected the request (${code}).`,\n );\n }\n}\n\n/** Bounded, same-origin requests. No redirects, cookie jar or retained credentials. */\nexport async function directoryRequest<T>(url: string, path: string, body: unknown, signal?: AbortSignal): Promise<T> {\n let response: Response;\n try {\n response = await fetch(url + path, {\n method: \"POST\",\n redirect: \"error\",\n signal: signal ? AbortSignal.any([signal, AbortSignal.timeout(10_000)]) : AbortSignal.timeout(10_000),\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\",\n },\n body: JSON.stringify(body),\n });\n } catch {\n signal?.throwIfAborted();\n throw new DirectoryRequestError(0, \"unreachable\");\n }\n const reader = response.body?.getReader();\n const chunks: Uint8Array[] = [];\n let length = 0;\n try {\n if (reader)\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n length += value.byteLength;\n if (length > 64 * 1024) throw new Error(\"The address directory returned an oversized response.\");\n chunks.push(value);\n }\n } finally {\n void reader?.cancel().catch(() => {});\n }\n let data: unknown;\n try {\n data = JSON.parse(Buffer.concat(chunks).toString(\"utf8\"));\n } catch {\n throw new DirectoryRequestError(response.status, \"invalid_response\");\n }\n if (!response.ok) {\n const error = (data as { error?: unknown } | null)?.error;\n const code = typeof error === \"string\" ? error : (error as { code?: unknown } | null)?.code;\n const retryAfter = Number(response.headers.get(\"Retry-After\"));\n throw new DirectoryRequestError(\n response.status,\n typeof code === \"string\" && /^[a-z_]{1,64}$/.test(code) ? code : \"directory_error\",\n Number.isFinite(retryAfter) ? Math.max(0, Math.min(60, retryAfter)) : 0,\n );\n }\n return data as T;\n}\n","import { join } from \"node:path\";\nimport { setTimeout as delay } from \"node:timers/promises\";\nimport type { Mindwire } from \"../client.js\";\nimport type { ComputerDiscoveryStatus } from \"../computer.js\";\nimport { acquireProcessLock } from \"./lock.js\";\nimport type { SetupPrompt } from \"./setup-prompt.js\";\nimport { directoryRequest, DirectoryRequestError } from \"./directory-http.js\";\nimport { readJSON, writeJSON, type ComputerConfig } from \"./lifecycle.js\";\n\nexport const DIRECTORY_API_PATH = \"/api/computer-directory/v1\";\nexport const DIRECTORY_URL = `https://console.mindwire.sh${DIRECTORY_API_PATH}`;\n\nexport interface DiscoveryPreference { enabled: boolean; url?: string }\nexport const discoveryPreference = (directory: string) =>\n readJSON<DiscoveryPreference>(join(directory, \"computer-discovery-preference.json\"));\n\n/** Desired setup is durable even if enrollment is temporarily offline. The\n * daemon remains the authority for signed publications and phone access. */\nexport async function saveDiscoveryPreference(directory: string, value: DiscoveryPreference): Promise<void> {\n const preference = { ...value, url: value.url ? directoryURL(value.url) : undefined };\n await writeJSON(join(directory, \"computer-discovery-preference.json\"), preference);\n}\n\nexport function directoryURL(value: string): string {\n let url: URL;\n try {\n url = new URL(value);\n } catch {\n throw new Error(\"Enter the directory's HTTPS API URL.\");\n }\n if (\n value.length > 2048 ||\n /[\\s\\x00]/.test(value) ||\n url.username ||\n url.password ||\n url.search ||\n url.hash ||\n (url.protocol !== \"https:\" &&\n !(url.protocol === \"http:\" && [\"localhost\", \"127.0.0.1\", \"[::1]\"].includes(url.hostname)))\n ) {\n throw new Error(\"Use an HTTPS directory URL without credentials, a query, or a fragment.\");\n }\n if (url.pathname === \"/\") url.pathname = DIRECTORY_API_PATH;\n if (url.pathname.endsWith(\"/\") || url.pathname.includes(\"//\") || url.pathname.includes(\"%\")) {\n throw new Error(\"Use the exact directory API URL without a trailing slash.\");\n }\n return url.href;\n}\n\nexport async function enableAddressDiscovery(options: {\n directory: string;\n computer: Mindwire;\n prompt: SetupPrompt;\n url?: string;\n waitForPublication?: boolean;\n signal?: AbortSignal;\n reconcile?: boolean;\n}): Promise<ComputerDiscoveryStatus> {\n const lock = await acquireProcessLock(join(options.directory, \"discovery-setup.lock\"), { signal: options.signal });\n try {\n let status: ComputerDiscoveryStatus;\n try {\n status = await options.computer.computer.discovery();\n } catch (error) {\n if ((error as { status?: number }).status === 404)\n throw new Error(\"Update the Mindwire service before enabling automatic address recovery.\");\n throw error;\n }\n const preference = await discoveryPreference(options.directory);\n if (options.reconcile && preference?.enabled === false) return status;\n // Preserve a saved private directory across upgrades. Credentials belonging\n // to another provider are never read by this flow.\n const url = directoryURL(\n options.url ?? process.env.MINDWIRE_DIRECTORY_URL ?? status.url ?? preference?.url ?? DIRECTORY_URL,\n );\n if (\n status.url &&\n status.url !== url &&\n (status.enabled || (status.sequence ?? 0) !== (status.publishedSequence ?? 0))\n ) {\n throw new Error(\n \"Disable the current directory with mindwire discovery disable and wait for its withdrawal before changing the directory URL.\",\n );\n }\n await saveDiscoveryPreference(options.directory, { enabled: true, url });\n if (!status.enabled || status.url !== url || status.error?.includes(\"enrollment\")) {\n options.prompt.print(`Enabling encrypted address recovery with ${new URL(url).host}…`);\n try {\n const challenge = await directoryRequest<{ challenge: string }>(url, \"/registrations/challenge\", {\n directoryId: status.directoryId,\n }, options.signal);\n if (\n typeof challenge?.challenge !== \"string\" ||\n challenge.challenge.length < 16 ||\n challenge.challenge.length > 2048\n ) {\n throw new Error(\"The address directory returned an invalid enrollment challenge.\");\n }\n const proof = await options.computer.computer.directoryEnrollment(url, challenge.challenge);\n const enrolled = await directoryRequest<{ directoryId: string }>(url, \"/registrations\", proof, options.signal);\n if (enrolled?.directoryId !== status.directoryId)\n throw new Error(\"The directory acknowledged a different computer.\");\n } catch (error) {\n if (error instanceof DirectoryRequestError) {\n if (error.status === 404 || error.status === 501)\n throw new Error(\n \"The address directory isn't available at this URL. Your existing connection still works; retry after the backend is deployed.\",\n );\n if (error.status === 409)\n throw new Error(\n \"This computer's directory registration is revoked or conflicts with its saved identity. Contact the directory operator.\",\n );\n if (error.code === \"account_required\")\n throw new Error(\n \"This directory still requires an account. Update its Mindwire backend to enable key-based registration, or choose another directory with --directory-url.\",\n );\n if (error.status === 401 || error.status === 403)\n throw new Error(\n \"The directory couldn't verify this computer's key or challenge. Retry enrollment.\",\n );\n if (error.status === 429)\n throw new Error(\n \"The directory's registration limit was reached. Retry later or use another directory.\",\n );\n if (error.status === 503)\n throw new Error(\n \"The directory is temporarily unavailable or at capacity. Your existing connection still works.\",\n );\n }\n throw error;\n }\n status = await options.computer.computer.configureDiscovery(true, url);\n }\n if (options.waitForPublication === false) return status;\n const deadline = Date.now() + 15_000;\n while (Date.now() < deadline) {\n status = await options.computer.computer.discovery();\n if (status.enabled && status.sequence && status.publishedSequence === status.sequence) return status;\n if (status.error?.includes(\"enrollment\") || status.error?.includes(\"older revision\"))\n throw new Error(status.error);\n await delay(250, undefined, { signal: options.signal });\n }\n throw new Error(\n \"Address recovery is configured and will retry in the background. Run mindwire discovery status to check publication.\",\n );\n } finally {\n await lock?.close();\n }\n}\n\nexport async function disableAddressDiscovery(directory: string, computer: Mindwire, reconcile = false): Promise<ComputerDiscoveryStatus> {\n const lock = await acquireProcessLock(join(directory, \"discovery-setup.lock\"));\n try {\n const status = await computer.computer.discovery();\n const preference = await discoveryPreference(directory);\n if (reconcile && preference?.enabled === true) return status;\n await saveDiscoveryPreference(directory, { enabled: false, url: status.url ?? preference?.url });\n if (!status.enabled) return status;\n return await computer.computer.configureDiscovery(false);\n } finally { await lock?.close(); }\n}\n\n/** Runs once after startup and retries failed enrollment in the controller. A\n * healthy setup makes only a local status read: publication/renewal stays in Go.\n * Direct/VPN/custom connections never opt into a hosted directory implicitly. */\nexport async function reconcileAddressDiscovery(options: {\n directory: string; config: ComputerConfig; computer: Mindwire; signal?: AbortSignal;\n}): Promise<void> {\n const preference = await discoveryPreference(options.directory);\n const { discovery: status } = await options.computer.computer.info();\n const automatic = options.config.relay.kind === \"cloudflare\" && !options.config.relay.url;\n const enabled = preference?.enabled ?? (status?.enabled || automatic && !status?.url);\n if (!enabled) {\n if (preference?.enabled === false && status?.enabled) await disableAddressDiscovery(options.directory, options.computer, true);\n return;\n }\n if (!status) throw new Error(\"Update the Mindwire service to enable automatic reconnection.\");\n const url = directoryURL(preference?.url ?? process.env.MINDWIRE_DIRECTORY_URL ?? status.url ?? DIRECTORY_URL);\n if (status.enabled && status.url === url && !status.error?.includes(\"enrollment\")) return;\n await enableAddressDiscovery({ ...options, url, waitForPublication: false, reconcile: true,\n prompt: { print() {}, open() {}, question: async () => { throw new Error(\"Unexpected interactive setup.\"); },\n secret: async () => { throw new Error(\"Unexpected interactive setup.\"); } } });\n}\n\nexport function discoveryDescription(status: ComputerDiscoveryStatus | undefined): string {\n if (!status?.enabled) return \"Automatic address recovery is off. Enable it with mindwire discovery enable.\";\n if (status.error) return status.error;\n return status.sequence && status.publishedSequence === status.sequence\n ? \"Encrypted address recovery is on. Saved phones can find this computer when its tunnel address changes.\"\n : \"Publishing the computer's encrypted address…\";\n}\n","import { join } from \"node:path\";\nimport { setTimeout as delay } from \"node:timers/promises\";\nimport type { ComputerUpdate } from \"../computer.js\";\nimport type { Mindwire } from \"../client.js\";\nimport { computerClient, readJSON } from \"./lifecycle.js\";\nimport { versionAtLeast } from \"../version.js\";\n\ntype UpdateClient = Pick<Mindwire, \"health\" | \"computer\">;\nexport function activeUpdate(update: ComputerUpdate | undefined): update is ComputerUpdate {\n return !!update && [\"queued\", \"downloading\", \"waiting\", \"restarting\"].includes(update.status);\n}\n\n/** The daemon arbitrates requests. Join an earlier version before requesting the\n * next; promoting a request never creates a second download or bypasses its lease. */\nexport async function queueServiceUpdate(client: UpdateClient, version: string, force = false): Promise<ComputerUpdate> {\n for (let attempt = 0; ; attempt++) {\n const previous = await client.computer.updateStatus();\n if (activeUpdate(previous) && (!force || previous.force)) return previous;\n try {\n return await client.computer.requestUpdate(activeUpdate(previous) ? previous.version : version, { force });\n } catch (error) {\n if ((error as { status?: number }).status !== 409 || attempt >= 2) throw error;\n // Another caller won admission. Read the authoritative request and join it.\n }\n }\n}\n\nexport interface ServiceUpdateResult { version: string; complete: boolean; update?: ComputerUpdate }\n\n/** A CLI may close after queuing: the controller owns download/restart. Human\n * callers get a bounded result, including the exact older request being joined. */\nexport async function updateComputer(options: {\n directory: string; version: string; force?: boolean; allowDowngrade?: boolean;\n onProgress?: (update: ComputerUpdate) => void; signal?: AbortSignal; timeoutMs?: number;\n connect?: () => Promise<UpdateClient>;\n}):\nPromise<ServiceUpdateResult> {\n const version = options.version.replace(/^v/, \"\");\n if (!/^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$/.test(version)) throw new Error(\"Enter a Mindwire release version, such as 0.1.38.\");\n const connect = options.connect ?? (() => computerClient(options.directory));\n const deadline = Date.now() + (options.timeoutMs ?? 120_000);\n let requested: ComputerUpdate | undefined, last = \"\";\n for (;;) {\n options.signal?.throwIfAborted();\n if (!requested) {\n const client = await connect();\n const installed = (await client.health()).version.replace(/^v/, \"\");\n if (installed === version || !options.allowDowngrade && versionAtLeast(installed, version))\n return { version: installed, complete: true };\n requested = await queueServiceUpdate(client, version, options.force);\n }\n // Progress survives the short API outage during restart. Only the daemon\n // accepts new requests; this read never changes or clears its status.\n const update = await readJSON<ComputerUpdate>(join(options.directory, \"computer-update.json\")) ?? requested;\n if (update.id !== requested.id) {\n // A concurrent update completed/advanced first. Recheck the live service.\n requested = undefined;\n } else {\n const key = `${update.id}:${update.status}`;\n if (last !== key) { last = key; options.onProgress?.(update); }\n if (update.status === \"failed\") throw new Error(update.error ?? \"The service update failed. Run mindwire inspect for details.\");\n if (update.status === \"complete\") {\n requested = undefined;\n if (Date.now() < deadline) continue;\n } else if (!options.force && update.status === \"waiting\") {\n return { version, complete: false, update };\n }\n }\n if (Date.now() >= deadline) return { version, complete: false, update };\n await delay(500, undefined, { signal: options.signal });\n }\n}\n\nexport function updateProgress(update: ComputerUpdate): string {\n const phase: Record<ComputerUpdate[\"status\"], string> = {\n idle: \"Ready\", queued: \"Queued\", downloading: \"Downloading verified release…\",\n waiting: \"Waiting for active work to finish\", restarting: \"Restarting service…\",\n complete: \"Installed\", failed: \"Update failed\",\n };\n return `${update.version} · ${phase[update.status]}`;\n}\n"]}
|
|
@@ -88,7 +88,7 @@ function computerPairingURI(invitation) {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
// src/version.ts
|
|
91
|
-
var SDK_VERSION = "0.1.
|
|
91
|
+
var SDK_VERSION = "0.1.44" ;
|
|
92
92
|
function versionAtLeast(actual, desired) {
|
|
93
93
|
if (actual === desired) return true;
|
|
94
94
|
if (!actual || !/^\d+\.\d+\.\d+$/.test(actual) || !/^\d+\.\d+\.\d+$/.test(desired)) return false;
|
|
@@ -997,8 +997,8 @@ var Run = class _Run {
|
|
|
997
997
|
* Steer a follow-up message into the running turn without cancelling it. Requires the agent's
|
|
998
998
|
* `input` capability.
|
|
999
999
|
*/
|
|
1000
|
-
async sendInput(text) {
|
|
1001
|
-
await this.http.request("POST", `/runs/${encodeURIComponent(this.id)}/input`, { body: { text } });
|
|
1000
|
+
async sendInput(text, options = {}) {
|
|
1001
|
+
await this.http.request("POST", `/runs/${encodeURIComponent(this.id)}/input`, { body: { text, ...options } });
|
|
1002
1002
|
}
|
|
1003
1003
|
/**
|
|
1004
1004
|
* Soft-stop the running turn (ask the agent to halt current work) without the hard process kill
|
|
@@ -1376,6 +1376,12 @@ var WorkspaceApi = class {
|
|
|
1376
1376
|
snapshot(options = {}) {
|
|
1377
1377
|
return this.mw.http.request("GET", "/workspace", { query: options });
|
|
1378
1378
|
}
|
|
1379
|
+
library() {
|
|
1380
|
+
return this.mw.http.request("GET", "/workspace/project-library");
|
|
1381
|
+
}
|
|
1382
|
+
editLibrary(edit) {
|
|
1383
|
+
return this.mw.http.request("PATCH", "/workspace/project-library", { body: edit });
|
|
1384
|
+
}
|
|
1379
1385
|
/** Read the saved icon, or preview a candidate relative path within the project. Requires projectIconsVersion >= 1. */
|
|
1380
1386
|
projectIcon(projectId, path5) {
|
|
1381
1387
|
return this.mw.http.request("GET", `/workspace/projects/${encodeURIComponent(projectId)}/icon`, { query: { path: path5 } });
|
|
@@ -1481,18 +1487,61 @@ var GitAccessApi = class {
|
|
|
1481
1487
|
};
|
|
1482
1488
|
|
|
1483
1489
|
// src/surfaces.ts
|
|
1484
|
-
|
|
1485
|
-
|
|
1490
|
+
function savedDesktopID(id) {
|
|
1491
|
+
if (!/^(console|ds_[a-f0-9]{16})$/.test(id)) throw new Error("Invalid saved desktop ID.");
|
|
1492
|
+
return id;
|
|
1493
|
+
}
|
|
1494
|
+
var SurfacesApi = class _SurfacesApi {
|
|
1495
|
+
constructor(mw, desktopId) {
|
|
1486
1496
|
this.mw = mw;
|
|
1497
|
+
this.desktopId = desktopId;
|
|
1487
1498
|
}
|
|
1488
1499
|
mw;
|
|
1500
|
+
desktopId;
|
|
1501
|
+
/** Select a saved display for status, events, captures and input receipts. */
|
|
1502
|
+
desktop(id) {
|
|
1503
|
+
return new _SurfacesApi(this.mw, savedDesktopID(id));
|
|
1504
|
+
}
|
|
1505
|
+
scoped(path5) {
|
|
1506
|
+
return this.desktopId ? `${path5}?desktopId=${encodeURIComponent(this.desktopId)}` : path5;
|
|
1507
|
+
}
|
|
1508
|
+
bindRuntime(binding) {
|
|
1509
|
+
return this.mw.http.request("PUT", "/surfaces/desktop/runtime", { body: binding });
|
|
1510
|
+
}
|
|
1511
|
+
listDesktops(projectId) {
|
|
1512
|
+
return this.mw.http.request("GET", "/surfaces/desktop/catalog", { query: { projectId } });
|
|
1513
|
+
}
|
|
1514
|
+
createDesktop(request) {
|
|
1515
|
+
return this.mw.http.request("POST", "/surfaces/desktop/catalog", { body: request });
|
|
1516
|
+
}
|
|
1517
|
+
ensureProjectDesktop(projectId) {
|
|
1518
|
+
return this.mw.http.request("POST", `/surfaces/desktop/projects/${encodeURIComponent(projectId)}/ensure`);
|
|
1519
|
+
}
|
|
1520
|
+
getDesktop(id) {
|
|
1521
|
+
return this.mw.http.request("GET", `/surfaces/desktop/catalog/${savedDesktopID(id)}`);
|
|
1522
|
+
}
|
|
1523
|
+
updateDesktop(id, request) {
|
|
1524
|
+
return this.mw.http.request("PATCH", `/surfaces/desktop/catalog/${savedDesktopID(id)}`, { body: request });
|
|
1525
|
+
}
|
|
1526
|
+
startDesktop(id) {
|
|
1527
|
+
return this.mw.http.request("POST", `/surfaces/desktop/catalog/${savedDesktopID(id)}/start`);
|
|
1528
|
+
}
|
|
1529
|
+
/** Stops this desktop's apps; keeps its profile and files. */
|
|
1530
|
+
stopDesktop(id) {
|
|
1531
|
+
return this.mw.http.request("POST", `/surfaces/desktop/catalog/${savedDesktopID(id)}/stop`);
|
|
1532
|
+
}
|
|
1533
|
+
/** Deletes the desktop's private profile. Closing a viewer uses close(), never this method. */
|
|
1534
|
+
deleteDesktop(id) {
|
|
1535
|
+
return this.mw.http.request("DELETE", `/surfaces/desktop/catalog/${savedDesktopID(id)}`);
|
|
1536
|
+
}
|
|
1489
1537
|
list() {
|
|
1490
1538
|
return this.mw.http.request("GET", "/surfaces");
|
|
1491
1539
|
}
|
|
1492
1540
|
status(refresh = false) {
|
|
1493
|
-
return this.mw.http.request("GET", "/surfaces/desktop", { query: { refresh } });
|
|
1541
|
+
return this.mw.http.request("GET", this.scoped("/surfaces/desktop"), { query: { refresh } });
|
|
1494
1542
|
}
|
|
1495
1543
|
bind(binding) {
|
|
1544
|
+
if (this.desktopId && binding.desktopId !== this.desktopId) throw new Error("The desktop grant belongs to another saved desktop.");
|
|
1496
1545
|
return this.mw.http.request("PUT", "/surfaces/desktop/binding", { body: binding });
|
|
1497
1546
|
}
|
|
1498
1547
|
localStatus() {
|
|
@@ -1507,22 +1556,23 @@ var SurfacesApi = class {
|
|
|
1507
1556
|
});
|
|
1508
1557
|
}
|
|
1509
1558
|
open(request) {
|
|
1510
|
-
|
|
1559
|
+
if (this.desktopId && request.desktopId && request.desktopId !== this.desktopId) throw new Error("Select the matching saved desktop.");
|
|
1560
|
+
return this.mw.http.request("POST", this.scoped("/surfaces/desktop/sessions"), { body: request });
|
|
1511
1561
|
}
|
|
1512
1562
|
control(id, request) {
|
|
1513
|
-
return this.mw.http.request("POST", `/surfaces/desktop/sessions/${encodeURIComponent(id)}/control
|
|
1563
|
+
return this.mw.http.request("POST", this.scoped(`/surfaces/desktop/sessions/${encodeURIComponent(id)}/control`), { body: request });
|
|
1514
1564
|
}
|
|
1515
1565
|
close(id) {
|
|
1516
|
-
return this.mw.http.request("DELETE", `/surfaces/desktop/sessions/${encodeURIComponent(id)}`);
|
|
1566
|
+
return this.mw.http.request("DELETE", this.scoped(`/surfaces/desktop/sessions/${encodeURIComponent(id)}`));
|
|
1517
1567
|
}
|
|
1518
1568
|
capture(id) {
|
|
1519
|
-
return this.mw.http.request("POST", `/surfaces/desktop/sessions/${encodeURIComponent(id)}/captures`);
|
|
1569
|
+
return this.mw.http.request("POST", this.scoped(`/surfaces/desktop/sessions/${encodeURIComponent(id)}/captures`));
|
|
1520
1570
|
}
|
|
1521
1571
|
action(request) {
|
|
1522
|
-
return this.mw.http.request("POST", "/surfaces/desktop/actions", { body: request });
|
|
1572
|
+
return this.mw.http.request("POST", this.scoped("/surfaces/desktop/actions"), { body: request });
|
|
1523
1573
|
}
|
|
1524
1574
|
receipt(id) {
|
|
1525
|
-
return this.mw.http.request("GET", `/surfaces/desktop/actions/${encodeURIComponent(id)}`);
|
|
1575
|
+
return this.mw.http.request("GET", this.scoped(`/surfaces/desktop/actions/${encodeURIComponent(id)}`));
|
|
1526
1576
|
}
|
|
1527
1577
|
artifact(id) {
|
|
1528
1578
|
return this.mw.http.request("GET", `/artifacts/${encodeURIComponent(id)}`);
|
|
@@ -1534,7 +1584,7 @@ var SurfacesApi = class {
|
|
|
1534
1584
|
opts.signal?.addEventListener("abort", abort, { once: true });
|
|
1535
1585
|
if (opts.signal?.aborted) controller.abort();
|
|
1536
1586
|
try {
|
|
1537
|
-
const response = await this.mw.http.open("GET", "/surfaces/desktop/events", { signal: controller.signal });
|
|
1587
|
+
const response = await this.mw.http.open("GET", this.scoped("/surfaces/desktop/events"), { signal: controller.signal });
|
|
1538
1588
|
let instance;
|
|
1539
1589
|
let revision = -1;
|
|
1540
1590
|
for await (const snapshot of readSSE(response.body, controller.signal)) {
|
|
@@ -2000,6 +2050,45 @@ var Mindwire = class _Mindwire {
|
|
|
2000
2050
|
body: { title }
|
|
2001
2051
|
});
|
|
2002
2052
|
}
|
|
2053
|
+
/** Resumable upload over the same connection as chat. Retrying an identical chunk is safe. */
|
|
2054
|
+
uploadAttachmentChunk(chatId, id, chunk, signal) {
|
|
2055
|
+
return this.http.request("PUT", `/chats/${encodeURIComponent(chatId)}/attachments/${encodeURIComponent(id)}`, { body: chunk, signal });
|
|
2056
|
+
}
|
|
2057
|
+
/** Store a file with its conversation, then pass the returned reference in turn options. */
|
|
2058
|
+
async uploadAttachment(chatId, file, options = {}) {
|
|
2059
|
+
if (file.data.byteLength > 16 * 1024 * 1024) throw new RangeError("Attachments must be at most 16 MiB");
|
|
2060
|
+
const data = new Uint8Array(file.data);
|
|
2061
|
+
const hash = async (bytes) => {
|
|
2062
|
+
if (!globalThis.crypto?.subtle) return executableChecksum(bytes);
|
|
2063
|
+
const digest = new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256", bytes));
|
|
2064
|
+
return Array.from(digest, (b) => b.toString(16).padStart(2, "0")).join("");
|
|
2065
|
+
};
|
|
2066
|
+
const sha256 = await hash(data);
|
|
2067
|
+
const id = (await hash(new TextEncoder().encode(`${chatId}\0${file.name}\0${sha256}`))).slice(0, 32);
|
|
2068
|
+
let offset = 0;
|
|
2069
|
+
for (; ; ) {
|
|
2070
|
+
options.signal?.throwIfAborted();
|
|
2071
|
+
const end = Math.min(data.length, offset + 384 * 1024);
|
|
2072
|
+
let binary = "";
|
|
2073
|
+
for (let start = offset; start < end; start += 16384) {
|
|
2074
|
+
binary += String.fromCharCode(...data.subarray(start, Math.min(end, start + 16384)));
|
|
2075
|
+
}
|
|
2076
|
+
const state = await this.uploadAttachmentChunk(chatId, id, {
|
|
2077
|
+
name: file.name,
|
|
2078
|
+
mime: file.mime ?? "application/octet-stream",
|
|
2079
|
+
bytes: data.length,
|
|
2080
|
+
sha256,
|
|
2081
|
+
offset,
|
|
2082
|
+
data: btoa(binary)
|
|
2083
|
+
}, options.signal);
|
|
2084
|
+
if (state.id !== id || state.bytes !== data.length || state.offset < end || state.offset > data.length || state.complete && state.offset !== data.length || !state.complete && state.offset <= offset) {
|
|
2085
|
+
throw new Error("Invalid attachment upload acknowledgement");
|
|
2086
|
+
}
|
|
2087
|
+
options.onProgress?.(data.length === 0 ? 1 : state.offset / data.length);
|
|
2088
|
+
if (state.complete) return { artifactId: id, name: state.name, mime: state.mime, bytes: state.bytes };
|
|
2089
|
+
offset = state.offset;
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2003
2092
|
/**
|
|
2004
2093
|
* `DELETE /chats/{id}` — a true, irreversible delete: purges ALL of the chat's mindwire
|
|
2005
2094
|
* bookkeeping and, for every session the chat mapped to, removes that agent's native transcript
|
|
@@ -2081,6 +2170,7 @@ var Mindwire = class _Mindwire {
|
|
|
2081
2170
|
message: input.message
|
|
2082
2171
|
};
|
|
2083
2172
|
if (input.requestId !== void 0) body.requestId = input.requestId;
|
|
2173
|
+
if (input.queueIfRunning !== void 0) body.queueIfRunning = input.queueIfRunning;
|
|
2084
2174
|
if (input.cwd !== void 0) body.cwd = input.cwd;
|
|
2085
2175
|
if (input.options !== void 0) body.options = input.options;
|
|
2086
2176
|
if (input.mode !== void 0) body.mode = input.mode;
|
|
@@ -2553,7 +2643,7 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
|
|
|
2553
2643
|
if (!compatible(controller2) || !await processStateAlive(controller2)) {
|
|
2554
2644
|
await ensureComputer(directory, cliPath, {}, onProgress, { ...options, waitForRoutes: false });
|
|
2555
2645
|
}
|
|
2556
|
-
const { changeComputerConnection } = await import('./connection-change-
|
|
2646
|
+
const { changeComputerConnection } = await import('./connection-change-KVOVAVF4.js');
|
|
2557
2647
|
await changeComputerConnection(directory, Object.fromEntries(changed.map((key) => [key, patch[key]])), { signal: options.signal, onProgress });
|
|
2558
2648
|
return computerClient(directory);
|
|
2559
2649
|
}
|
|
@@ -2594,7 +2684,7 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
|
|
|
2594
2684
|
let controller = await readJSON(path4.join(directory, "computer-controller.json"));
|
|
2595
2685
|
if (existing && controller && !compatible(controller) && await processStateAlive(controller)) {
|
|
2596
2686
|
onProgress?.("Refreshing the background connection service\u2026");
|
|
2597
|
-
const { handoffController } = await import('./controller-handoff-
|
|
2687
|
+
const { handoffController } = await import('./controller-handoff-OWJJEC2H.js');
|
|
2598
2688
|
await handoffController(directory, controller, config, await existing.computer.info());
|
|
2599
2689
|
controller = void 0;
|
|
2600
2690
|
}
|
|
@@ -2628,7 +2718,7 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
|
|
|
2628
2718
|
}
|
|
2629
2719
|
}
|
|
2630
2720
|
async function superviseComputer(directory) {
|
|
2631
|
-
const controller = await import('./controller-
|
|
2721
|
+
const controller = await import('./controller-3KH6CUOC.js');
|
|
2632
2722
|
await controller.superviseComputer(directory);
|
|
2633
2723
|
}
|
|
2634
2724
|
async function stopComputer(directory, force = false) {
|
|
@@ -2653,5 +2743,5 @@ async function stopComputer(directory, force = false) {
|
|
|
2653
2743
|
}
|
|
2654
2744
|
|
|
2655
2745
|
export { CONTROLLER_PROTOCOL, ProviderConnectionError, RelayOutput, SDK_VERSION, acquireProcessLock, adoptProcess, adoptRelay, cloudflareCommand, computerClient, computerPairingQRData, computerPairingURI, currentProcessIdentity, defaultComputerConfig, defaultStateDirectory, directRoutes, ensureComputer, ensureDaemonBinary, hasCertificateError, ownChild, processIdentity, processStateAlive, providerFailure, providerNeedsAction, readJSON, startRelay, stopComputer, superviseComputer, versionAtLeast, websocketURL, writeJSON };
|
|
2656
|
-
//# sourceMappingURL=chunk-
|
|
2657
|
-
//# sourceMappingURL=chunk-
|
|
2746
|
+
//# sourceMappingURL=chunk-CSX2ZLIV.js.map
|
|
2747
|
+
//# sourceMappingURL=chunk-CSX2ZLIV.js.map
|