mindwire 0.1.42 → 0.1.43
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-YQSLQWPI.js → chunk-G7CSL6OC.js} +66 -16
- package/dist/chunk-G7CSL6OC.js.map +1 -0
- package/dist/{chunk-5O6QCNZW.js → chunk-VQUMF44I.js} +3 -3
- package/dist/{chunk-5O6QCNZW.js.map → chunk-VQUMF44I.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{connection-change-LZ6MT6Q6.js → connection-change-SF6UKNSO.js} +3 -3
- package/dist/{connection-change-LZ6MT6Q6.js.map → connection-change-SF6UKNSO.js.map} +1 -1
- package/dist/{controller-UYJ7F2IU.js → controller-FCIIKFUZ.js} +4 -4
- package/dist/{controller-UYJ7F2IU.js.map → controller-FCIIKFUZ.js.map} +1 -1
- package/dist/{controller-handoff-YNHM2W52.js → controller-handoff-WVGU5UNV.js} +3 -3
- package/dist/{controller-handoff-YNHM2W52.js.map → controller-handoff-WVGU5UNV.js.map} +1 -1
- package/dist/index.cjs +61 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +61 -11
- package/dist/index.js.map +1 -1
- package/dist/surfaces.d.ts +95 -3
- package/dist/types.d.ts +5 -1
- package/dist/workspace.d.ts +30 -0
- package/package.json +1 -1
- package/dist/chunk-YQSLQWPI.js.map +0 -1
|
@@ -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.43" ;
|
|
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;
|
|
@@ -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)) {
|
|
@@ -2553,7 +2603,7 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
|
|
|
2553
2603
|
if (!compatible(controller2) || !await processStateAlive(controller2)) {
|
|
2554
2604
|
await ensureComputer(directory, cliPath, {}, onProgress, { ...options, waitForRoutes: false });
|
|
2555
2605
|
}
|
|
2556
|
-
const { changeComputerConnection } = await import('./connection-change-
|
|
2606
|
+
const { changeComputerConnection } = await import('./connection-change-SF6UKNSO.js');
|
|
2557
2607
|
await changeComputerConnection(directory, Object.fromEntries(changed.map((key) => [key, patch[key]])), { signal: options.signal, onProgress });
|
|
2558
2608
|
return computerClient(directory);
|
|
2559
2609
|
}
|
|
@@ -2594,7 +2644,7 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
|
|
|
2594
2644
|
let controller = await readJSON(path4.join(directory, "computer-controller.json"));
|
|
2595
2645
|
if (existing && controller && !compatible(controller) && await processStateAlive(controller)) {
|
|
2596
2646
|
onProgress?.("Refreshing the background connection service\u2026");
|
|
2597
|
-
const { handoffController } = await import('./controller-handoff-
|
|
2647
|
+
const { handoffController } = await import('./controller-handoff-WVGU5UNV.js');
|
|
2598
2648
|
await handoffController(directory, controller, config, await existing.computer.info());
|
|
2599
2649
|
controller = void 0;
|
|
2600
2650
|
}
|
|
@@ -2628,7 +2678,7 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
|
|
|
2628
2678
|
}
|
|
2629
2679
|
}
|
|
2630
2680
|
async function superviseComputer(directory) {
|
|
2631
|
-
const controller = await import('./controller-
|
|
2681
|
+
const controller = await import('./controller-FCIIKFUZ.js');
|
|
2632
2682
|
await controller.superviseComputer(directory);
|
|
2633
2683
|
}
|
|
2634
2684
|
async function stopComputer(directory, force = false) {
|
|
@@ -2653,5 +2703,5 @@ async function stopComputer(directory, force = false) {
|
|
|
2653
2703
|
}
|
|
2654
2704
|
|
|
2655
2705
|
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-
|
|
2706
|
+
//# sourceMappingURL=chunk-G7CSL6OC.js.map
|
|
2707
|
+
//# sourceMappingURL=chunk-G7CSL6OC.js.map
|