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
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
* client over its REST + SSE surface.
|
|
7
7
|
*/
|
|
8
8
|
export { Mindwire, AuthApi, PromptsApi, McpApi, ProvidersApi, NotifyApi } from "./client.js";
|
|
9
|
+
export * from "./bots.js";
|
|
10
|
+
export * from "./apps.js";
|
|
11
|
+
export * from "./integrations.js";
|
|
9
12
|
export type { MindwireOptions, AgentScoped } from "./client.js";
|
|
10
13
|
export { Run } from "./run.js";
|
|
11
14
|
export { VoiceApi, VoiceSession } from "./voice.js";
|
package/dist/index.js
CHANGED
|
@@ -734,6 +734,12 @@ var WorkspaceApi = class {
|
|
|
734
734
|
projectIcon(projectId, path) {
|
|
735
735
|
return this.mw.http.request("GET", `/workspace/projects/${encodeURIComponent(projectId)}/icon`, { query: { path } });
|
|
736
736
|
}
|
|
737
|
+
/** Upload a validated image (base64 content, at most 1 MB). Requires projectIconsVersion >= 2.
|
|
738
|
+
* Stores the image inside the project; set projects.put(..., { iconPath: result.path }) to select it.
|
|
739
|
+
*/
|
|
740
|
+
uploadProjectIcon(projectId, image) {
|
|
741
|
+
return this.mw.http.request("POST", `/workspace/projects/${encodeURIComponent(projectId)}/icon`, { body: image });
|
|
742
|
+
}
|
|
737
743
|
/** Start an operation owned by the daemon. The same ID/payload returns the existing operation. */
|
|
738
744
|
createProject(request) {
|
|
739
745
|
return this.mw.http.request("POST", "/workspace/projects", { body: request });
|
|
@@ -834,6 +840,160 @@ var GitAccessApi = class {
|
|
|
834
840
|
}
|
|
835
841
|
};
|
|
836
842
|
|
|
843
|
+
// src/bots.ts
|
|
844
|
+
var BotsApi = class {
|
|
845
|
+
constructor(mw) {
|
|
846
|
+
this.mw = mw;
|
|
847
|
+
}
|
|
848
|
+
mw;
|
|
849
|
+
list(options = {}) {
|
|
850
|
+
return this.mw.http.request("GET", "/bots", { query: { projectId: options.projectId, archived: options.archived ? "true" : void 0 } });
|
|
851
|
+
}
|
|
852
|
+
get(id) {
|
|
853
|
+
return this.mw.http.request("GET", `/bots/${encodeURIComponent(id)}`);
|
|
854
|
+
}
|
|
855
|
+
ensure(agentId, projectId) {
|
|
856
|
+
return this.mw.http.request("POST", "/bots/ensure", { body: { agentId, projectId } });
|
|
857
|
+
}
|
|
858
|
+
create(input) {
|
|
859
|
+
return this.mw.http.request("POST", "/bots", { body: input });
|
|
860
|
+
}
|
|
861
|
+
update(id, edit) {
|
|
862
|
+
return this.mw.http.request("PATCH", `/bots/${encodeURIComponent(id)}`, { body: edit });
|
|
863
|
+
}
|
|
864
|
+
chats(id) {
|
|
865
|
+
return this.mw.http.request("GET", `/bots/${encodeURIComponent(id)}/chats`);
|
|
866
|
+
}
|
|
867
|
+
createChat(id, input = {}) {
|
|
868
|
+
return this.mw.http.request("POST", `/bots/${encodeURIComponent(id)}/chats`, { body: input });
|
|
869
|
+
}
|
|
870
|
+
agents() {
|
|
871
|
+
return this.mw.http.request("GET", "/bots/agents");
|
|
872
|
+
}
|
|
873
|
+
tasks(id) {
|
|
874
|
+
return this.mw.http.request("GET", `/bots/${encodeURIComponent(id)}/tasks`);
|
|
875
|
+
}
|
|
876
|
+
/** Keep requestId stable when retrying a task after a lost acknowledgement. */
|
|
877
|
+
delegate(id, input) {
|
|
878
|
+
return this.mw.http.request("POST", `/bots/${encodeURIComponent(id)}/tasks`, { body: input });
|
|
879
|
+
}
|
|
880
|
+
task(id, runId) {
|
|
881
|
+
return this.mw.http.request("GET", this.taskPath(id, runId));
|
|
882
|
+
}
|
|
883
|
+
input(id, runId, input) {
|
|
884
|
+
return this.mw.http.request("POST", `${this.taskPath(id, runId)}/input`, { body: input });
|
|
885
|
+
}
|
|
886
|
+
cancel(id, runId) {
|
|
887
|
+
return this.mw.http.request("POST", `${this.taskPath(id, runId)}/cancel`);
|
|
888
|
+
}
|
|
889
|
+
peerIdentity() {
|
|
890
|
+
return this.mw.http.request("GET", "/bots/peers/identity");
|
|
891
|
+
}
|
|
892
|
+
startPeerListener(port) {
|
|
893
|
+
return this.mw.http.request("POST", "/bots/peers/listener", { body: { port } });
|
|
894
|
+
}
|
|
895
|
+
peers() {
|
|
896
|
+
return this.mw.http.request("GET", "/bots/peers");
|
|
897
|
+
}
|
|
898
|
+
pair(workspaceId, input) {
|
|
899
|
+
return this.mw.http.request("PUT", `/bots/peers/${encodeURIComponent(workspaceId)}`, { body: input });
|
|
900
|
+
}
|
|
901
|
+
revokePeer(workspaceId) {
|
|
902
|
+
return this.mw.http.request("DELETE", `/bots/peers/${encodeURIComponent(workspaceId)}`);
|
|
903
|
+
}
|
|
904
|
+
/** Bounded peer handshake/discovery; does not start a bot task. */
|
|
905
|
+
checkPeer(workspaceId) {
|
|
906
|
+
return this.mw.http.request("POST", `/bots/peers/${encodeURIComponent(workspaceId)}/check`, { body: {} });
|
|
907
|
+
}
|
|
908
|
+
taskPath(id, runId) {
|
|
909
|
+
return `/bots/${encodeURIComponent(id)}/tasks/${encodeURIComponent(runId)}`;
|
|
910
|
+
}
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
// src/apps.ts
|
|
914
|
+
var AppsApi = class {
|
|
915
|
+
constructor(mw) {
|
|
916
|
+
this.mw = mw;
|
|
917
|
+
}
|
|
918
|
+
mw;
|
|
919
|
+
list() {
|
|
920
|
+
return this.mw.http.request("GET", "/apps");
|
|
921
|
+
}
|
|
922
|
+
get(id) {
|
|
923
|
+
return this.mw.http.request("GET", `/apps/${encodeURIComponent(id)}`);
|
|
924
|
+
}
|
|
925
|
+
register(input) {
|
|
926
|
+
return this.mw.http.request("POST", "/apps", { body: input });
|
|
927
|
+
}
|
|
928
|
+
update(id, input) {
|
|
929
|
+
return this.mw.http.request("PATCH", `/apps/${encodeURIComponent(id)}`, { body: input });
|
|
930
|
+
}
|
|
931
|
+
/** Ensures readiness on the owning computer; the client opens the returned URL. */
|
|
932
|
+
open(id) {
|
|
933
|
+
return this.mw.http.request("POST", `/apps/${encodeURIComponent(id)}/open`, { body: {} });
|
|
934
|
+
}
|
|
935
|
+
/** Validates a plan for the owner's hosting adapter; does not deploy or charge. */
|
|
936
|
+
preparePublication(id) {
|
|
937
|
+
return this.mw.http.request("POST", `/apps/${encodeURIComponent(id)}/publication/prepare`, { body: {} });
|
|
938
|
+
}
|
|
939
|
+
channels() {
|
|
940
|
+
return this.mw.http.request("GET", "/apps/channels");
|
|
941
|
+
}
|
|
942
|
+
notifications(id, options = {}) {
|
|
943
|
+
return this.mw.http.request("POST", `/apps/${encodeURIComponent(id)}/notifications`, { body: options });
|
|
944
|
+
}
|
|
945
|
+
revokeNotificationAccess(id) {
|
|
946
|
+
return this.mw.http.request("DELETE", `/apps/${encodeURIComponent(id)}/notifications/token`);
|
|
947
|
+
}
|
|
948
|
+
schedules(id) {
|
|
949
|
+
return this.mw.http.request("GET", `/apps/${encodeURIComponent(id)}/schedules`);
|
|
950
|
+
}
|
|
951
|
+
saveSchedule(id, schedule) {
|
|
952
|
+
return this.mw.http.request("POST", `/apps/${encodeURIComponent(id)}/schedules`, { body: schedule });
|
|
953
|
+
}
|
|
954
|
+
deleteSchedule(id, scheduleId) {
|
|
955
|
+
return this.mw.http.request("DELETE", `/apps/${encodeURIComponent(id)}/schedules/${encodeURIComponent(scheduleId)}`);
|
|
956
|
+
}
|
|
957
|
+
};
|
|
958
|
+
|
|
959
|
+
// src/integrations.ts
|
|
960
|
+
var IntegrationsApi = class {
|
|
961
|
+
constructor(mw) {
|
|
962
|
+
this.mw = mw;
|
|
963
|
+
}
|
|
964
|
+
mw;
|
|
965
|
+
list() {
|
|
966
|
+
return this.mw.http.request("GET", "/integrations");
|
|
967
|
+
}
|
|
968
|
+
get(id) {
|
|
969
|
+
return this.mw.http.request("GET", this.path(id));
|
|
970
|
+
}
|
|
971
|
+
create(spec) {
|
|
972
|
+
return this.mw.http.request("POST", "/integrations", { body: spec });
|
|
973
|
+
}
|
|
974
|
+
/** Complete replacement with optimistic concurrency; omit credentials to preserve them. */
|
|
975
|
+
update(id, spec) {
|
|
976
|
+
return this.mw.http.request("PUT", this.path(id), { body: spec });
|
|
977
|
+
}
|
|
978
|
+
async delete(id) {
|
|
979
|
+
await this.mw.http.request("DELETE", this.path(id));
|
|
980
|
+
}
|
|
981
|
+
/** Sends to the configured destination, also useful as a connection test. */
|
|
982
|
+
send(id, text) {
|
|
983
|
+
return this.mw.http.request("POST", `${this.path(id)}/send`, { body: { text } });
|
|
984
|
+
}
|
|
985
|
+
/** Latest 100 redacted delivery receipts. */
|
|
986
|
+
events(id) {
|
|
987
|
+
return this.mw.http.request("GET", `${this.path(id)}/events`);
|
|
988
|
+
}
|
|
989
|
+
retry(id, eventId) {
|
|
990
|
+
return this.mw.http.request("POST", `${this.path(id)}/events/${encodeURIComponent(eventId)}/retry`);
|
|
991
|
+
}
|
|
992
|
+
path(id) {
|
|
993
|
+
return `/integrations/${encodeURIComponent(id)}`;
|
|
994
|
+
}
|
|
995
|
+
};
|
|
996
|
+
|
|
837
997
|
// src/surfaces.ts
|
|
838
998
|
function savedDesktopID(id) {
|
|
839
999
|
if (!/^(console|ds_[a-f0-9]{16})$/.test(id)) throw new Error("Invalid saved desktop ID.");
|
|
@@ -1262,7 +1422,7 @@ var NativeSessionsApi = class {
|
|
|
1262
1422
|
};
|
|
1263
1423
|
|
|
1264
1424
|
// src/version.ts
|
|
1265
|
-
var SDK_VERSION = "0.1.
|
|
1425
|
+
var SDK_VERSION = "0.1.53" ;
|
|
1266
1426
|
function versionAtLeast(actual, desired) {
|
|
1267
1427
|
if (actual === desired) return true;
|
|
1268
1428
|
if (!actual || !/^\d+\.\d+\.\d+$/.test(actual) || !/^\d+\.\d+\.\d+$/.test(desired)) return false;
|
|
@@ -1481,7 +1641,7 @@ function daemonStartError(resolved, cause) {
|
|
|
1481
1641
|
" \u2022 check GitHub Release access so the SDK can download its matching daemon binary; or",
|
|
1482
1642
|
" \u2022 set MINDWIRE_DAEMON to a `mindwired` binary; or",
|
|
1483
1643
|
" \u2022 pass { baseUrl } to connect to a daemon you run yourself.",
|
|
1484
|
-
" \u2022 Working inside the mindwire monorepo? Run `go build -o /tmp/mindwired ./
|
|
1644
|
+
" \u2022 Working inside the mindwire monorepo? Run `go -C packages/daemon build -o /tmp/mindwired ./cmd/daemon` and set MINDWIRE_DAEMON.",
|
|
1485
1645
|
`(underlying error: ${cause.message})`
|
|
1486
1646
|
].join("\n");
|
|
1487
1647
|
}
|
|
@@ -1578,6 +1738,9 @@ var handleByTransport = /* @__PURE__ */ new WeakMap();
|
|
|
1578
1738
|
var Mindwire = class _Mindwire {
|
|
1579
1739
|
/** Workspace registry: saved agent profiles, projects and chat relationships. */
|
|
1580
1740
|
workspace;
|
|
1741
|
+
bots;
|
|
1742
|
+
apps;
|
|
1743
|
+
integrations;
|
|
1581
1744
|
surfaces;
|
|
1582
1745
|
service;
|
|
1583
1746
|
execution;
|
|
@@ -1618,6 +1781,9 @@ var Mindwire = class _Mindwire {
|
|
|
1618
1781
|
});
|
|
1619
1782
|
this.defaultAgent = opts.agent;
|
|
1620
1783
|
this.workspace = new WorkspaceApi(this);
|
|
1784
|
+
this.bots = new BotsApi(this);
|
|
1785
|
+
this.apps = new AppsApi(this);
|
|
1786
|
+
this.integrations = new IntegrationsApi(this);
|
|
1621
1787
|
this.surfaces = new SurfacesApi(this);
|
|
1622
1788
|
this.service = new ServiceApi(this);
|
|
1623
1789
|
this.execution = new ExecutionApi(this);
|
|
@@ -1645,6 +1811,9 @@ var Mindwire = class _Mindwire {
|
|
|
1645
1811
|
clone.http = this.http;
|
|
1646
1812
|
clone.defaultAgent = agent;
|
|
1647
1813
|
clone.workspace = new WorkspaceApi(clone);
|
|
1814
|
+
clone.bots = new BotsApi(clone);
|
|
1815
|
+
clone.apps = new AppsApi(clone);
|
|
1816
|
+
clone.integrations = new IntegrationsApi(clone);
|
|
1648
1817
|
clone.surfaces = new SurfacesApi(clone);
|
|
1649
1818
|
clone.service = new ServiceApi(clone);
|
|
1650
1819
|
clone.execution = new ExecutionApi(clone);
|
|
@@ -3002,7 +3171,7 @@ function docker(config = {}) {
|
|
|
3002
3171
|
var DEFAULT_PORT2 = 8790;
|
|
3003
3172
|
var DEFAULT_AGENT2 = "claude-code";
|
|
3004
3173
|
var DEFAULT_AGENT_CWD2 = "/root";
|
|
3005
|
-
var DEFAULT_RUNTIME_IMAGE =
|
|
3174
|
+
var DEFAULT_RUNTIME_IMAGE = "node:24-bookworm";
|
|
3006
3175
|
var DockerHost = class {
|
|
3007
3176
|
constructor(container) {
|
|
3008
3177
|
this.container = container;
|
|
@@ -3061,13 +3230,14 @@ async function provisionDocker(docker2, config = {}, onLog) {
|
|
|
3061
3230
|
await ensureImage(docker2, image, config.pull ?? "missing", onLog);
|
|
3062
3231
|
const portKey = `${port}/tcp`;
|
|
3063
3232
|
container = await docker2.createContainer({
|
|
3064
|
-
//
|
|
3065
|
-
// image
|
|
3233
|
+
// Keep the default base container alive while the shared binary installer bootstraps it.
|
|
3234
|
+
// A custom image retains its own entrypoint and command.
|
|
3066
3235
|
Image: image,
|
|
3236
|
+
...config.image === void 0 ? { Cmd: ["sleep", "infinity"] } : {},
|
|
3067
3237
|
Env: [`ADDR=:${port}`, `AGENT_TYPE=${agent}`, `AGENT_CWD=${agentCwd}`, "MINDWIRE_ISOLATION=container"],
|
|
3068
3238
|
Tty: false,
|
|
3069
3239
|
ExposedPorts: { [portKey]: {} },
|
|
3070
|
-
HostConfig: { PortBindings: { [portKey]: [{ HostPort: "0" }] } },
|
|
3240
|
+
HostConfig: { PortBindings: { [portKey]: [{ HostIp: "127.0.0.1", HostPort: "0" }] } },
|
|
3071
3241
|
...config.createOptions ?? {}
|
|
3072
3242
|
});
|
|
3073
3243
|
}
|
|
@@ -3121,9 +3291,15 @@ async function ensureImage(docker2, image, policy, onLog) {
|
|
|
3121
3291
|
try {
|
|
3122
3292
|
const stream = await docker2.pull(image);
|
|
3123
3293
|
await new Promise((resolve, reject) => {
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3294
|
+
docker2.modem.followProgress(stream, (error, output) => {
|
|
3295
|
+
if (error) {
|
|
3296
|
+
reject(error);
|
|
3297
|
+
return;
|
|
3298
|
+
}
|
|
3299
|
+
const failure = output?.find((frame) => frame.error || frame.errorDetail?.message);
|
|
3300
|
+
if (failure) reject(new Error(failure.error ?? failure.errorDetail.message));
|
|
3301
|
+
else resolve();
|
|
3302
|
+
});
|
|
3127
3303
|
});
|
|
3128
3304
|
emit2(`runtime image ready: ${image}`);
|
|
3129
3305
|
} catch (error) {
|
|
@@ -3379,6 +3555,6 @@ function clearCatalogCache() {
|
|
|
3379
3555
|
inflight = null;
|
|
3380
3556
|
}
|
|
3381
3557
|
|
|
3382
|
-
export { AuthApi, ComputerApi, ContainerHost, ConversationsApi, ExecutionApi, GitAccessApi, Http, MODELS_DEV_URL, McpApi, Mindwire, NativeSessionsApi, NotifyApi, ProjectOperationsApi, ProjectSyncApi, ProjectSyncError, PromptsApi, ProvidersApi, Run, SDK_VERSION, ServiceApi, SurfacesApi, TerminalsApi, VoiceApi, VoiceSession, WorkspaceApi, WorkspaceCollection, catalogModels, catalogProvider, catalogProviders, clearCatalogCache, computerPairingQRData, computerPairingURI, docker, ensureDaemon, ensureDaemonBinary, loadCatalog, local, lookupModel, oblien, provisionContainer, provisionDocker, provisionOblien, provisionSsh, provisionSshContainer, remote, resolveLinuxDaemon, ssh, startEmbedded };
|
|
3558
|
+
export { AppsApi, AuthApi, BotsApi, ComputerApi, ContainerHost, ConversationsApi, ExecutionApi, GitAccessApi, Http, IntegrationsApi, MODELS_DEV_URL, McpApi, Mindwire, NativeSessionsApi, NotifyApi, ProjectOperationsApi, ProjectSyncApi, ProjectSyncError, PromptsApi, ProvidersApi, Run, SDK_VERSION, ServiceApi, SurfacesApi, TerminalsApi, VoiceApi, VoiceSession, WorkspaceApi, WorkspaceCollection, catalogModels, catalogProvider, catalogProviders, clearCatalogCache, computerPairingQRData, computerPairingURI, docker, ensureDaemon, ensureDaemonBinary, loadCatalog, local, lookupModel, oblien, provisionContainer, provisionDocker, provisionOblien, provisionSsh, provisionSshContainer, remote, resolveLinuxDaemon, ssh, startEmbedded };
|
|
3383
3559
|
//# sourceMappingURL=index.js.map
|
|
3384
3560
|
//# sourceMappingURL=index.js.map
|