mindwire 0.1.36 → 0.1.40
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 +16 -0
- package/dist/{chunk-RTGZDLSG.js → chunk-BJL5K6M7.js} +74 -21
- package/dist/chunk-BJL5K6M7.js.map +1 -0
- package/dist/chunk-ZP7F7LP7.js +306 -0
- package/dist/chunk-ZP7F7LP7.js.map +1 -0
- package/dist/cli.js +499 -250
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +6 -8
- package/dist/computer/dashboard.d.ts +1 -0
- package/dist/computer/desktop.d.ts +17 -0
- package/dist/computer/directory-http.d.ts +1 -1
- package/dist/computer/discovery.d.ts +22 -0
- package/dist/computer/inspection.d.ts +30 -0
- package/dist/computer/lifecycle.d.ts +4 -2
- package/dist/computer/runtime-version.d.ts +6 -0
- package/dist/computer/service-update.d.ts +26 -0
- package/dist/computer/setup-prompt.d.ts +2 -0
- package/dist/computer/startup.d.ts +7 -0
- package/dist/computer/terminal-ui.d.ts +9 -0
- package/dist/computer.d.ts +2 -0
- package/dist/{connection-change-IBNL42BL.js → connection-change-7ZV6O75Q.js} +3 -3
- package/dist/{connection-change-IBNL42BL.js.map → connection-change-7ZV6O75Q.js.map} +1 -1
- package/dist/{controller-2SJLZMJZ.js → controller-FBMGMSLM.js} +67 -9
- package/dist/controller-FBMGMSLM.js.map +1 -0
- package/dist/{controller-handoff-RUUHODNC.js → controller-handoff-CJKXUFQI.js} +3 -3
- package/dist/{controller-handoff-RUUHODNC.js.map → controller-handoff-CJKXUFQI.js.map} +1 -1
- package/dist/conversations.d.ts +57 -0
- package/dist/daemon-binary.d.ts +2 -0
- package/dist/index.cjs +66 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +66 -13
- package/dist/index.js.map +1 -1
- package/dist/project-sync.d.ts +29 -0
- package/dist/surfaces.d.ts +20 -1
- package/dist/types.d.ts +18 -0
- package/dist/workspace.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunk-67BNDGRK.js +0 -20
- package/dist/chunk-67BNDGRK.js.map +0 -1
- package/dist/chunk-RTGZDLSG.js.map +0 -1
- package/dist/controller-2SJLZMJZ.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -35,8 +35,10 @@ export * from "./types.js";
|
|
|
35
35
|
export { ServiceApi } from "./service.js";
|
|
36
36
|
export type { ServiceUpdateState, ServiceUpdateLease } from "./service.js";
|
|
37
37
|
export { WorkspaceApi, WorkspaceCollection, ProjectOperationsApi, GitAccessApi } from "./workspace.js";
|
|
38
|
+
export { ConversationsApi } from "./conversations.js";
|
|
39
|
+
export type { Conversation, ConversationQuery, ConversationPage, ConversationOpenRequest, ConversationOpenResult } from "./conversations.js";
|
|
38
40
|
export { ProjectSyncApi, ProjectSyncError } from "./project-sync.js";
|
|
39
|
-
export type { ProjectSyncEntry, ProjectSyncCheckpoint, ProjectSyncRequest, ProjectSyncOperation, ProjectSyncConflict, ProjectSyncProgress } from "./project-sync.js";
|
|
41
|
+
export type { ProjectSyncEntry, ProjectSyncCheckpoint, ProjectSyncRequest, ProjectSyncOperation, ProjectSyncConflict, ProjectSyncProgress, ProjectSyncPreview, ProjectSyncPreviewRequest, ProjectSyncIgnoredPath } from "./project-sync.js";
|
|
40
42
|
export type { ProjectRequest, ProjectAuth, ProjectOperation, ProjectRemoveRequest, GitConnection, GitAccessState, ProjectGitState, GitAction, GitIdentity, GitIdentityScope, GitIdentitySettings, GitIdentityUpdate, GitOperationRequest, GitOperation } from "./workspace.js";
|
|
41
43
|
export type { WorkspaceRecord, WorkspaceAgent, WorkspaceProject, WorkspaceChat, WorkspaceKind, WorkspaceInput, WorkspaceImport, WorkspaceSnapshot, ProjectIcon } from "./workspace.js";
|
|
42
44
|
export * from "./surfaces.js";
|
package/dist/index.js
CHANGED
|
@@ -436,6 +436,18 @@ var ProjectSyncError = class extends MindwireError {
|
|
|
436
436
|
};
|
|
437
437
|
var active = (o) => ["queued", "exporting", "preparing", "applying"].includes(o.status);
|
|
438
438
|
var prefix = "/workspace/sync";
|
|
439
|
+
var selectionPaths = (paths = []) => {
|
|
440
|
+
const sorted = [...new Set(paths.map((path) => path.replace(/\/$/, "")))].sort();
|
|
441
|
+
const selected = new Set(sorted);
|
|
442
|
+
return sorted.filter((path) => {
|
|
443
|
+
let parent = path;
|
|
444
|
+
while (parent.includes("/")) {
|
|
445
|
+
parent = parent.slice(0, parent.lastIndexOf("/"));
|
|
446
|
+
if (selected.has(parent)) return false;
|
|
447
|
+
}
|
|
448
|
+
return true;
|
|
449
|
+
});
|
|
450
|
+
};
|
|
439
451
|
function delay(ms, signal) {
|
|
440
452
|
signal?.throwIfAborted();
|
|
441
453
|
return new Promise((resolve, reject) => {
|
|
@@ -458,7 +470,16 @@ var ProjectSyncApi = class {
|
|
|
458
470
|
}
|
|
459
471
|
mw;
|
|
460
472
|
flights = /* @__PURE__ */ new Map();
|
|
461
|
-
|
|
473
|
+
async requireSelectionSupport() {
|
|
474
|
+
if (((await this.mw.health()).projectSyncVersion ?? 0) < 2)
|
|
475
|
+
throw new MindwireError("Update Mindwire on both workspaces to review and switch selected project files.");
|
|
476
|
+
}
|
|
477
|
+
async preview(request, options = {}) {
|
|
478
|
+
await this.requireSelectionSupport();
|
|
479
|
+
return this.mw.http.request("POST", `${prefix}/preview`, { body: request, ...options });
|
|
480
|
+
}
|
|
481
|
+
async export(request, options = {}) {
|
|
482
|
+
await this.requireSelectionSupport();
|
|
462
483
|
return this.mw.http.request("POST", `${prefix}/exports`, { body: request, ...options });
|
|
463
484
|
}
|
|
464
485
|
import(request, options = {}) {
|
|
@@ -543,6 +564,7 @@ var ProjectSyncApi = class {
|
|
|
543
564
|
* throws ProjectSyncError carrying the complete conflict/recovery operation.
|
|
544
565
|
*/
|
|
545
566
|
switchTo(target, request, options = {}) {
|
|
567
|
+
request = { ...request, includeIgnored: selectionPaths(request.includeIgnored) };
|
|
546
568
|
const intent = JSON.stringify(request);
|
|
547
569
|
const old = this.flights.get(request.id);
|
|
548
570
|
if (old) {
|
|
@@ -558,7 +580,8 @@ var ProjectSyncApi = class {
|
|
|
558
580
|
if (!(error instanceof ApiError) || error.status !== 404) throw error;
|
|
559
581
|
}
|
|
560
582
|
if (accepted) {
|
|
561
|
-
if ((accepted.path ?? "") !== (request.path ?? "")
|
|
583
|
+
if ((accepted.path ?? "") !== (request.path ?? "") || (accepted.selectionToken ?? "") !== (request.selectionToken ?? "") || JSON.stringify(selectionPaths(accepted.includeIgnored)) !== JSON.stringify(request.includeIgnored))
|
|
584
|
+
throw new MindwireError("This sync ID belongs to a different destination folder or file selection.");
|
|
562
585
|
const operation = await target.wait(accepted.id, {
|
|
563
586
|
signal: options.signal,
|
|
564
587
|
onUpdate: (operation2) => options.onProgress?.({ phase: "apply", transferredBytes: 0, operation: operation2 })
|
|
@@ -567,11 +590,11 @@ var ProjectSyncApi = class {
|
|
|
567
590
|
return operation;
|
|
568
591
|
}
|
|
569
592
|
const health = await Promise.all([this.mw.health(), target.mw.health()]);
|
|
570
|
-
if (health.some((h) => (h.projectSyncVersion ?? 0) <
|
|
593
|
+
if (health.some((h) => (h.projectSyncVersion ?? 0) < 2)) throw new MindwireError("Update Mindwire on both workspaces to review and switch selected project files.");
|
|
571
594
|
let bytes = 0;
|
|
572
595
|
const emit2 = (phase, operation) => options.onProgress?.({ phase, transferredBytes: bytes, operation });
|
|
573
596
|
emit2("checkpoint");
|
|
574
|
-
let o = await this.export({ id: `${request.id}-export`, projectId: request.projectId }, options);
|
|
597
|
+
let o = await this.export({ id: `${request.id}-export`, projectId: request.projectId, includeIgnored: request.includeIgnored, selectionToken: request.selectionToken }, options);
|
|
575
598
|
o = await this.wait(o.id, { signal: options.signal, onUpdate: (value) => emit2("checkpoint", value) });
|
|
576
599
|
if (o.status !== "succeeded" || !o.resultCheckpointId) throw new ProjectSyncError(o);
|
|
577
600
|
emit2("transfer");
|
|
@@ -579,7 +602,7 @@ var ProjectSyncApi = class {
|
|
|
579
602
|
bytes += n;
|
|
580
603
|
emit2("transfer");
|
|
581
604
|
} });
|
|
582
|
-
o = await target.import({ id: `${request.id}-import`, checkpointId: o.resultCheckpointId, path: request.path }, options);
|
|
605
|
+
o = await target.import({ id: `${request.id}-import`, checkpointId: o.resultCheckpointId, path: request.path, includeIgnored: request.includeIgnored, selectionToken: request.selectionToken }, options);
|
|
583
606
|
o = await target.wait(o.id, { signal: options.signal, onUpdate: (value) => emit2("apply", value) });
|
|
584
607
|
if (o.status !== "succeeded") throw new ProjectSyncError(o);
|
|
585
608
|
return o;
|
|
@@ -590,6 +613,23 @@ var ProjectSyncApi = class {
|
|
|
590
613
|
}
|
|
591
614
|
};
|
|
592
615
|
|
|
616
|
+
// src/conversations.ts
|
|
617
|
+
var ConversationsApi = class {
|
|
618
|
+
constructor(mw) {
|
|
619
|
+
this.mw = mw;
|
|
620
|
+
}
|
|
621
|
+
mw;
|
|
622
|
+
/** Read-only; includes folders not registered as Mindwire projects. */
|
|
623
|
+
list(query = {}) {
|
|
624
|
+
return this.mw.http.request("GET", "/workspace/conversations", { query: { ...query } });
|
|
625
|
+
}
|
|
626
|
+
/** Idempotently associates the selected native session with its original folder.
|
|
627
|
+
* Use chatId with messages()/turn() and the ordinary chat APIs afterward. */
|
|
628
|
+
open(request) {
|
|
629
|
+
return this.mw.http.request("POST", "/workspace/conversations/open", { body: request });
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
|
|
593
633
|
// src/workspace.ts
|
|
594
634
|
var ProjectOperationsApi = class {
|
|
595
635
|
constructor(mw) {
|
|
@@ -661,6 +701,7 @@ var WorkspaceCollection = class {
|
|
|
661
701
|
var WorkspaceApi = class {
|
|
662
702
|
constructor(mw) {
|
|
663
703
|
this.mw = mw;
|
|
704
|
+
this.conversations = new ConversationsApi(mw);
|
|
664
705
|
this.sync = new ProjectSyncApi(mw);
|
|
665
706
|
this.git = new GitAccessApi(mw);
|
|
666
707
|
this.operations = new ProjectOperationsApi(mw);
|
|
@@ -669,6 +710,7 @@ var WorkspaceApi = class {
|
|
|
669
710
|
this.chats = new WorkspaceCollection(mw, "chats");
|
|
670
711
|
}
|
|
671
712
|
mw;
|
|
713
|
+
conversations;
|
|
672
714
|
sync;
|
|
673
715
|
git;
|
|
674
716
|
operations;
|
|
@@ -797,6 +839,17 @@ var SurfacesApi = class {
|
|
|
797
839
|
bind(binding) {
|
|
798
840
|
return this.mw.http.request("PUT", "/surfaces/desktop/binding", { body: binding });
|
|
799
841
|
}
|
|
842
|
+
localStatus() {
|
|
843
|
+
return this.mw.http.request("GET", "/surfaces/desktop/local");
|
|
844
|
+
}
|
|
845
|
+
/** Local CLI only. The separate 0600 control credential is not part of phone pairing. */
|
|
846
|
+
configureLocal(settings, localControlToken) {
|
|
847
|
+
if (!localControlToken) throw new Error("Run mindwire desktop on your Mac to manage desktop access.");
|
|
848
|
+
return this.mw.http.request("PUT", "/surfaces/desktop/local", {
|
|
849
|
+
body: settings,
|
|
850
|
+
headers: { "X-Mindwire-Local-Control": localControlToken }
|
|
851
|
+
});
|
|
852
|
+
}
|
|
800
853
|
open(request) {
|
|
801
854
|
return this.mw.http.request("POST", "/surfaces/desktop/sessions", { body: request });
|
|
802
855
|
}
|
|
@@ -1011,7 +1064,7 @@ function computerPairingURI(invitation) {
|
|
|
1011
1064
|
}
|
|
1012
1065
|
|
|
1013
1066
|
// src/version.ts
|
|
1014
|
-
var SDK_VERSION = "0.1.
|
|
1067
|
+
var SDK_VERSION = "0.1.40" ;
|
|
1015
1068
|
function versionAtLeast(actual, desired) {
|
|
1016
1069
|
if (actual === desired) return true;
|
|
1017
1070
|
if (!actual || !/^\d+\.\d+\.\d+$/.test(actual) || !/^\d+\.\d+\.\d+$/.test(desired)) return false;
|
|
@@ -1062,7 +1115,7 @@ async function ensureDaemonBinary(opts = {}) {
|
|
|
1062
1115
|
if (!request) throw new MindwireError("mindwire: fetch is unavailable; set daemonBin or MINDWIRE_DAEMON");
|
|
1063
1116
|
const [checksums, binary] = await Promise.all([request(`${release}/checksums.txt`), request(`${release}/${asset}`)]);
|
|
1064
1117
|
if (!checksums.ok || !binary.ok) {
|
|
1065
|
-
if (!opts.releaseBaseUrl && !proc.process?.env?.MINDWIRE_RELEASE_BASE_URL) {
|
|
1118
|
+
if (!opts.exactVersion && !opts.releaseBaseUrl && !proc.process?.env?.MINDWIRE_RELEASE_BASE_URL) {
|
|
1066
1119
|
const latest = await request("https://api.github.com/repos/oblien/mindwire/releases/latest");
|
|
1067
1120
|
if (latest.ok) {
|
|
1068
1121
|
const tag = (await latest.json()).tag_name;
|
|
@@ -1451,14 +1504,14 @@ var Mindwire = class _Mindwire {
|
|
|
1451
1504
|
}
|
|
1452
1505
|
/**
|
|
1453
1506
|
* `POST /chats/{id}/fork` — clone a chat into a new id (generated when `newChatId` is omitted).
|
|
1454
|
-
*
|
|
1455
|
-
*
|
|
1456
|
-
*
|
|
1457
|
-
*
|
|
1507
|
+
* Codex and Claude preserve native context. `beforeMessageId` excludes that prompt and every
|
|
1508
|
+
* later message; send the edited prompt to the returned chat with `turn`. Reuse `newChatId`
|
|
1509
|
+
* and the turn's `requestId` on retries. The source chat and filesystem are unchanged.
|
|
1510
|
+
* A source with a live turn returns 409; an unknown source returns 404.
|
|
1458
1511
|
*/
|
|
1459
1512
|
forkChat(chatId, opts = {}) {
|
|
1460
1513
|
return this.http.request("POST", `/chats/${encodeURIComponent(chatId)}/fork`, {
|
|
1461
|
-
body: opts
|
|
1514
|
+
body: opts
|
|
1462
1515
|
});
|
|
1463
1516
|
}
|
|
1464
1517
|
/**
|
|
@@ -3010,6 +3063,6 @@ function clearCatalogCache() {
|
|
|
3010
3063
|
inflight = null;
|
|
3011
3064
|
}
|
|
3012
3065
|
|
|
3013
|
-
export { AuthApi, ComputerApi, ContainerHost, ExecutionApi, GitAccessApi, Http, MODELS_DEV_URL, McpApi, Mindwire, NotifyApi, ProjectOperationsApi, ProjectSyncApi, ProjectSyncError, PromptsApi, ProvidersApi, Run, SDK_VERSION, ServiceApi, SurfacesApi, TerminalsApi, WorkspaceApi, WorkspaceCollection, catalogModels, catalogProvider, catalogProviders, clearCatalogCache, computerPairingQRData, computerPairingURI, docker, ensureDaemon, ensureDaemonBinary, loadCatalog, local, lookupModel, oblien, provisionContainer, provisionDocker, provisionOblien, provisionSsh, provisionSshContainer, remote, resolveLinuxDaemon, ssh, startEmbedded };
|
|
3066
|
+
export { AuthApi, ComputerApi, ContainerHost, ConversationsApi, ExecutionApi, GitAccessApi, Http, MODELS_DEV_URL, McpApi, Mindwire, NotifyApi, ProjectOperationsApi, ProjectSyncApi, ProjectSyncError, PromptsApi, ProvidersApi, Run, SDK_VERSION, ServiceApi, SurfacesApi, TerminalsApi, WorkspaceApi, WorkspaceCollection, catalogModels, catalogProvider, catalogProviders, clearCatalogCache, computerPairingQRData, computerPairingURI, docker, ensureDaemon, ensureDaemonBinary, loadCatalog, local, lookupModel, oblien, provisionContainer, provisionDocker, provisionOblien, provisionSsh, provisionSshContainer, remote, resolveLinuxDaemon, ssh, startEmbedded };
|
|
3014
3067
|
//# sourceMappingURL=index.js.map
|
|
3015
3068
|
//# sourceMappingURL=index.js.map
|