mindwire 0.1.52 → 0.1.53
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/README.md +97 -2
- package/dist/apps.d.ts +94 -0
- package/dist/bots.d.ts +168 -0
- package/dist/{chunk-RTMQJIKW.js → chunk-MZ4OTZFH.js} +4 -10
- package/dist/chunk-MZ4OTZFH.js.map +1 -0
- package/dist/{chunk-4XL565EU.js → chunk-O5DWL7MH.js} +176 -7
- package/dist/chunk-O5DWL7MH.js.map +1 -0
- package/dist/cli.js +21 -25
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +6 -0
- package/dist/{connection-change-6E7QLJFC.js → connection-change-EGOCFEPP.js} +3 -3
- package/dist/{connection-change-6E7QLJFC.js.map → connection-change-EGOCFEPP.js.map} +1 -1
- package/dist/{controller-566LDBZD.js → controller-WUR6XGOM.js} +4 -4
- package/dist/{controller-566LDBZD.js.map → controller-WUR6XGOM.js.map} +1 -1
- package/dist/{controller-handoff-KNEQ5W6J.js → controller-handoff-SJ3A4NEC.js} +3 -3
- package/dist/{controller-handoff-KNEQ5W6J.js.map → controller-handoff-SJ3A4NEC.js.map} +1 -1
- package/dist/index.cjs +195 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +186 -10
- package/dist/index.js.map +1 -1
- package/dist/integrations.d.ts +72 -0
- package/dist/target/docker.d.ts +9 -1
- package/dist/types.d.ts +17 -1
- package/dist/workspace.d.ts +13 -0
- package/package.json +10 -11
- package/dist/chunk-4XL565EU.js.map +0 -1
- package/dist/chunk-RTMQJIKW.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.53" ;
|
|
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;
|
|
@@ -1390,6 +1390,12 @@ var WorkspaceApi = class {
|
|
|
1390
1390
|
projectIcon(projectId, path5) {
|
|
1391
1391
|
return this.mw.http.request("GET", `/workspace/projects/${encodeURIComponent(projectId)}/icon`, { query: { path: path5 } });
|
|
1392
1392
|
}
|
|
1393
|
+
/** Upload a validated image (base64 content, at most 1 MB). Requires projectIconsVersion >= 2.
|
|
1394
|
+
* Stores the image inside the project; set projects.put(..., { iconPath: result.path }) to select it.
|
|
1395
|
+
*/
|
|
1396
|
+
uploadProjectIcon(projectId, image) {
|
|
1397
|
+
return this.mw.http.request("POST", `/workspace/projects/${encodeURIComponent(projectId)}/icon`, { body: image });
|
|
1398
|
+
}
|
|
1393
1399
|
/** Start an operation owned by the daemon. The same ID/payload returns the existing operation. */
|
|
1394
1400
|
createProject(request) {
|
|
1395
1401
|
return this.mw.http.request("POST", "/workspace/projects", { body: request });
|
|
@@ -1490,6 +1496,160 @@ var GitAccessApi = class {
|
|
|
1490
1496
|
}
|
|
1491
1497
|
};
|
|
1492
1498
|
|
|
1499
|
+
// src/bots.ts
|
|
1500
|
+
var BotsApi = class {
|
|
1501
|
+
constructor(mw) {
|
|
1502
|
+
this.mw = mw;
|
|
1503
|
+
}
|
|
1504
|
+
mw;
|
|
1505
|
+
list(options = {}) {
|
|
1506
|
+
return this.mw.http.request("GET", "/bots", { query: { projectId: options.projectId, archived: options.archived ? "true" : void 0 } });
|
|
1507
|
+
}
|
|
1508
|
+
get(id) {
|
|
1509
|
+
return this.mw.http.request("GET", `/bots/${encodeURIComponent(id)}`);
|
|
1510
|
+
}
|
|
1511
|
+
ensure(agentId, projectId) {
|
|
1512
|
+
return this.mw.http.request("POST", "/bots/ensure", { body: { agentId, projectId } });
|
|
1513
|
+
}
|
|
1514
|
+
create(input) {
|
|
1515
|
+
return this.mw.http.request("POST", "/bots", { body: input });
|
|
1516
|
+
}
|
|
1517
|
+
update(id, edit) {
|
|
1518
|
+
return this.mw.http.request("PATCH", `/bots/${encodeURIComponent(id)}`, { body: edit });
|
|
1519
|
+
}
|
|
1520
|
+
chats(id) {
|
|
1521
|
+
return this.mw.http.request("GET", `/bots/${encodeURIComponent(id)}/chats`);
|
|
1522
|
+
}
|
|
1523
|
+
createChat(id, input = {}) {
|
|
1524
|
+
return this.mw.http.request("POST", `/bots/${encodeURIComponent(id)}/chats`, { body: input });
|
|
1525
|
+
}
|
|
1526
|
+
agents() {
|
|
1527
|
+
return this.mw.http.request("GET", "/bots/agents");
|
|
1528
|
+
}
|
|
1529
|
+
tasks(id) {
|
|
1530
|
+
return this.mw.http.request("GET", `/bots/${encodeURIComponent(id)}/tasks`);
|
|
1531
|
+
}
|
|
1532
|
+
/** Keep requestId stable when retrying a task after a lost acknowledgement. */
|
|
1533
|
+
delegate(id, input) {
|
|
1534
|
+
return this.mw.http.request("POST", `/bots/${encodeURIComponent(id)}/tasks`, { body: input });
|
|
1535
|
+
}
|
|
1536
|
+
task(id, runId) {
|
|
1537
|
+
return this.mw.http.request("GET", this.taskPath(id, runId));
|
|
1538
|
+
}
|
|
1539
|
+
input(id, runId, input) {
|
|
1540
|
+
return this.mw.http.request("POST", `${this.taskPath(id, runId)}/input`, { body: input });
|
|
1541
|
+
}
|
|
1542
|
+
cancel(id, runId) {
|
|
1543
|
+
return this.mw.http.request("POST", `${this.taskPath(id, runId)}/cancel`);
|
|
1544
|
+
}
|
|
1545
|
+
peerIdentity() {
|
|
1546
|
+
return this.mw.http.request("GET", "/bots/peers/identity");
|
|
1547
|
+
}
|
|
1548
|
+
startPeerListener(port) {
|
|
1549
|
+
return this.mw.http.request("POST", "/bots/peers/listener", { body: { port } });
|
|
1550
|
+
}
|
|
1551
|
+
peers() {
|
|
1552
|
+
return this.mw.http.request("GET", "/bots/peers");
|
|
1553
|
+
}
|
|
1554
|
+
pair(workspaceId, input) {
|
|
1555
|
+
return this.mw.http.request("PUT", `/bots/peers/${encodeURIComponent(workspaceId)}`, { body: input });
|
|
1556
|
+
}
|
|
1557
|
+
revokePeer(workspaceId) {
|
|
1558
|
+
return this.mw.http.request("DELETE", `/bots/peers/${encodeURIComponent(workspaceId)}`);
|
|
1559
|
+
}
|
|
1560
|
+
/** Bounded peer handshake/discovery; does not start a bot task. */
|
|
1561
|
+
checkPeer(workspaceId) {
|
|
1562
|
+
return this.mw.http.request("POST", `/bots/peers/${encodeURIComponent(workspaceId)}/check`, { body: {} });
|
|
1563
|
+
}
|
|
1564
|
+
taskPath(id, runId) {
|
|
1565
|
+
return `/bots/${encodeURIComponent(id)}/tasks/${encodeURIComponent(runId)}`;
|
|
1566
|
+
}
|
|
1567
|
+
};
|
|
1568
|
+
|
|
1569
|
+
// src/apps.ts
|
|
1570
|
+
var AppsApi = class {
|
|
1571
|
+
constructor(mw) {
|
|
1572
|
+
this.mw = mw;
|
|
1573
|
+
}
|
|
1574
|
+
mw;
|
|
1575
|
+
list() {
|
|
1576
|
+
return this.mw.http.request("GET", "/apps");
|
|
1577
|
+
}
|
|
1578
|
+
get(id) {
|
|
1579
|
+
return this.mw.http.request("GET", `/apps/${encodeURIComponent(id)}`);
|
|
1580
|
+
}
|
|
1581
|
+
register(input) {
|
|
1582
|
+
return this.mw.http.request("POST", "/apps", { body: input });
|
|
1583
|
+
}
|
|
1584
|
+
update(id, input) {
|
|
1585
|
+
return this.mw.http.request("PATCH", `/apps/${encodeURIComponent(id)}`, { body: input });
|
|
1586
|
+
}
|
|
1587
|
+
/** Ensures readiness on the owning computer; the client opens the returned URL. */
|
|
1588
|
+
open(id) {
|
|
1589
|
+
return this.mw.http.request("POST", `/apps/${encodeURIComponent(id)}/open`, { body: {} });
|
|
1590
|
+
}
|
|
1591
|
+
/** Validates a plan for the owner's hosting adapter; does not deploy or charge. */
|
|
1592
|
+
preparePublication(id) {
|
|
1593
|
+
return this.mw.http.request("POST", `/apps/${encodeURIComponent(id)}/publication/prepare`, { body: {} });
|
|
1594
|
+
}
|
|
1595
|
+
channels() {
|
|
1596
|
+
return this.mw.http.request("GET", "/apps/channels");
|
|
1597
|
+
}
|
|
1598
|
+
notifications(id, options = {}) {
|
|
1599
|
+
return this.mw.http.request("POST", `/apps/${encodeURIComponent(id)}/notifications`, { body: options });
|
|
1600
|
+
}
|
|
1601
|
+
revokeNotificationAccess(id) {
|
|
1602
|
+
return this.mw.http.request("DELETE", `/apps/${encodeURIComponent(id)}/notifications/token`);
|
|
1603
|
+
}
|
|
1604
|
+
schedules(id) {
|
|
1605
|
+
return this.mw.http.request("GET", `/apps/${encodeURIComponent(id)}/schedules`);
|
|
1606
|
+
}
|
|
1607
|
+
saveSchedule(id, schedule) {
|
|
1608
|
+
return this.mw.http.request("POST", `/apps/${encodeURIComponent(id)}/schedules`, { body: schedule });
|
|
1609
|
+
}
|
|
1610
|
+
deleteSchedule(id, scheduleId) {
|
|
1611
|
+
return this.mw.http.request("DELETE", `/apps/${encodeURIComponent(id)}/schedules/${encodeURIComponent(scheduleId)}`);
|
|
1612
|
+
}
|
|
1613
|
+
};
|
|
1614
|
+
|
|
1615
|
+
// src/integrations.ts
|
|
1616
|
+
var IntegrationsApi = class {
|
|
1617
|
+
constructor(mw) {
|
|
1618
|
+
this.mw = mw;
|
|
1619
|
+
}
|
|
1620
|
+
mw;
|
|
1621
|
+
list() {
|
|
1622
|
+
return this.mw.http.request("GET", "/integrations");
|
|
1623
|
+
}
|
|
1624
|
+
get(id) {
|
|
1625
|
+
return this.mw.http.request("GET", this.path(id));
|
|
1626
|
+
}
|
|
1627
|
+
create(spec) {
|
|
1628
|
+
return this.mw.http.request("POST", "/integrations", { body: spec });
|
|
1629
|
+
}
|
|
1630
|
+
/** Complete replacement with optimistic concurrency; omit credentials to preserve them. */
|
|
1631
|
+
update(id, spec) {
|
|
1632
|
+
return this.mw.http.request("PUT", this.path(id), { body: spec });
|
|
1633
|
+
}
|
|
1634
|
+
async delete(id) {
|
|
1635
|
+
await this.mw.http.request("DELETE", this.path(id));
|
|
1636
|
+
}
|
|
1637
|
+
/** Sends to the configured destination, also useful as a connection test. */
|
|
1638
|
+
send(id, text) {
|
|
1639
|
+
return this.mw.http.request("POST", `${this.path(id)}/send`, { body: { text } });
|
|
1640
|
+
}
|
|
1641
|
+
/** Latest 100 redacted delivery receipts. */
|
|
1642
|
+
events(id) {
|
|
1643
|
+
return this.mw.http.request("GET", `${this.path(id)}/events`);
|
|
1644
|
+
}
|
|
1645
|
+
retry(id, eventId) {
|
|
1646
|
+
return this.mw.http.request("POST", `${this.path(id)}/events/${encodeURIComponent(eventId)}/retry`);
|
|
1647
|
+
}
|
|
1648
|
+
path(id) {
|
|
1649
|
+
return `/integrations/${encodeURIComponent(id)}`;
|
|
1650
|
+
}
|
|
1651
|
+
};
|
|
1652
|
+
|
|
1493
1653
|
// src/surfaces.ts
|
|
1494
1654
|
function savedDesktopID(id) {
|
|
1495
1655
|
if (!/^(console|ds_[a-f0-9]{16})$/.test(id)) throw new Error("Invalid saved desktop ID.");
|
|
@@ -1988,7 +2148,7 @@ function daemonStartError(resolved, cause) {
|
|
|
1988
2148
|
" \u2022 check GitHub Release access so the SDK can download its matching daemon binary; or",
|
|
1989
2149
|
" \u2022 set MINDWIRE_DAEMON to a `mindwired` binary; or",
|
|
1990
2150
|
" \u2022 pass { baseUrl } to connect to a daemon you run yourself.",
|
|
1991
|
-
" \u2022 Working inside the mindwire monorepo? Run `go build -o /tmp/mindwired ./
|
|
2151
|
+
" \u2022 Working inside the mindwire monorepo? Run `go -C packages/daemon build -o /tmp/mindwired ./cmd/daemon` and set MINDWIRE_DAEMON.",
|
|
1992
2152
|
`(underlying error: ${cause.message})`
|
|
1993
2153
|
].join("\n");
|
|
1994
2154
|
}
|
|
@@ -2085,6 +2245,9 @@ var handleByTransport = /* @__PURE__ */ new WeakMap();
|
|
|
2085
2245
|
var Mindwire = class _Mindwire {
|
|
2086
2246
|
/** Workspace registry: saved agent profiles, projects and chat relationships. */
|
|
2087
2247
|
workspace;
|
|
2248
|
+
bots;
|
|
2249
|
+
apps;
|
|
2250
|
+
integrations;
|
|
2088
2251
|
surfaces;
|
|
2089
2252
|
service;
|
|
2090
2253
|
execution;
|
|
@@ -2125,6 +2288,9 @@ var Mindwire = class _Mindwire {
|
|
|
2125
2288
|
});
|
|
2126
2289
|
this.defaultAgent = opts.agent;
|
|
2127
2290
|
this.workspace = new WorkspaceApi(this);
|
|
2291
|
+
this.bots = new BotsApi(this);
|
|
2292
|
+
this.apps = new AppsApi(this);
|
|
2293
|
+
this.integrations = new IntegrationsApi(this);
|
|
2128
2294
|
this.surfaces = new SurfacesApi(this);
|
|
2129
2295
|
this.service = new ServiceApi(this);
|
|
2130
2296
|
this.execution = new ExecutionApi(this);
|
|
@@ -2152,6 +2318,9 @@ var Mindwire = class _Mindwire {
|
|
|
2152
2318
|
clone.http = this.http;
|
|
2153
2319
|
clone.defaultAgent = agent;
|
|
2154
2320
|
clone.workspace = new WorkspaceApi(clone);
|
|
2321
|
+
clone.bots = new BotsApi(clone);
|
|
2322
|
+
clone.apps = new AppsApi(clone);
|
|
2323
|
+
clone.integrations = new IntegrationsApi(clone);
|
|
2155
2324
|
clone.surfaces = new SurfacesApi(clone);
|
|
2156
2325
|
clone.service = new ServiceApi(clone);
|
|
2157
2326
|
clone.execution = new ExecutionApi(clone);
|
|
@@ -2869,7 +3038,7 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
|
|
|
2869
3038
|
if (!compatible(controller2) || !await processStateAlive(controller2)) {
|
|
2870
3039
|
await ensureComputer(directory, cliPath, {}, onProgress, { ...options, waitForRoutes: false });
|
|
2871
3040
|
}
|
|
2872
|
-
const { changeComputerConnection } = await import('./connection-change-
|
|
3041
|
+
const { changeComputerConnection } = await import('./connection-change-EGOCFEPP.js');
|
|
2873
3042
|
await changeComputerConnection(directory, Object.fromEntries(changed.map((key) => [key, patch[key]])), { signal: options.signal, onProgress });
|
|
2874
3043
|
return computerClient(directory);
|
|
2875
3044
|
}
|
|
@@ -2910,7 +3079,7 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
|
|
|
2910
3079
|
let controller = await readJSON(path4.join(directory, "computer-controller.json"));
|
|
2911
3080
|
if (existing && controller && !compatible(controller) && await processStateAlive(controller)) {
|
|
2912
3081
|
onProgress?.("Refreshing the background connection service\u2026");
|
|
2913
|
-
const { handoffController } = await import('./controller-handoff-
|
|
3082
|
+
const { handoffController } = await import('./controller-handoff-SJ3A4NEC.js');
|
|
2914
3083
|
await handoffController(directory, controller, config, await existing.computer.info());
|
|
2915
3084
|
controller = void 0;
|
|
2916
3085
|
}
|
|
@@ -2944,7 +3113,7 @@ async function ensureComputer(directory, cliPath, patch = {}, onProgress, option
|
|
|
2944
3113
|
}
|
|
2945
3114
|
}
|
|
2946
3115
|
async function superviseComputer(directory) {
|
|
2947
|
-
const controller = await import('./controller-
|
|
3116
|
+
const controller = await import('./controller-WUR6XGOM.js');
|
|
2948
3117
|
await controller.superviseComputer(directory);
|
|
2949
3118
|
}
|
|
2950
3119
|
async function stopComputer(directory, force = false) {
|
|
@@ -2969,5 +3138,5 @@ async function stopComputer(directory, force = false) {
|
|
|
2969
3138
|
}
|
|
2970
3139
|
|
|
2971
3140
|
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 };
|
|
2972
|
-
//# sourceMappingURL=chunk-
|
|
2973
|
-
//# sourceMappingURL=chunk-
|
|
3141
|
+
//# sourceMappingURL=chunk-O5DWL7MH.js.map
|
|
3142
|
+
//# sourceMappingURL=chunk-O5DWL7MH.js.map
|