mindwire 0.1.14 → 0.1.18

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/run.d.ts CHANGED
@@ -53,10 +53,13 @@ export declare class Run {
53
53
  /** Cancel the in-flight turn (kills the underlying agent process). */
54
54
  cancel(): Promise<void>;
55
55
  /**
56
- * Answer a mid-turn interaction the turn is waiting on — a permission approval, or an
57
- * AskUserQuestion / ExitPlanMode reply. Requires the agent's `respond` capability.
56
+ * Answer a pending permission, question or plan. Message-mode questions remain answerable
57
+ * after completion; the daemon steers or resumes the conversation. Read the chat's latest
58
+ * run after replying to a completed run. Requires the agent's `respond` capability.
58
59
  */
59
- respond(input?: RespondInput): Promise<void>;
60
+ respond(input?: RespondInput & {
61
+ gitAuth?: import("./workspace.js").ProjectAuth;
62
+ }): Promise<void>;
60
63
  /**
61
64
  * Steer a follow-up message into the running turn without cancelling it. Requires the agent's
62
65
  * `input` capability.
@@ -0,0 +1,24 @@
1
+ import type { Mindwire } from "./client.js";
2
+ export interface ServiceUpdateState {
3
+ idle: boolean;
4
+ updating: boolean;
5
+ activeOperations: number;
6
+ }
7
+ export interface ServiceUpdateLease {
8
+ id: string;
9
+ /** Terminate only this leased process, not every mindwired process on the host. */
10
+ pid: number;
11
+ expiresAt: string;
12
+ }
13
+ /** Installer coordination; requires health.serviceUpdateVersion >= 1. */
14
+ export declare class ServiceApi {
15
+ private readonly client;
16
+ constructor(client: Mindwire);
17
+ updateStatus(): Promise<ServiceUpdateState>;
18
+ /** Download first. Acquire immediately before replacement; busy work returns 409.
19
+ * Admission stays closed until release, process exit, or the one-minute expiry. */
20
+ acquireUpdate(): Promise<ServiceUpdateLease>;
21
+ releaseUpdate(id: string): Promise<{
22
+ ok: boolean;
23
+ }>;
24
+ }
@@ -16,6 +16,8 @@ export interface SurfaceCapabilities {
16
16
  text: boolean;
17
17
  clipboardRead: boolean;
18
18
  clipboardWrite: boolean;
19
+ keyboardText?: boolean;
20
+ extendedKeys?: boolean;
19
21
  }
20
22
  export interface SurfaceController {
21
23
  sessionId: string;
@@ -101,6 +103,8 @@ export interface SurfaceAction {
101
103
  deltaY?: number;
102
104
  keys?: string[];
103
105
  text?: string;
106
+ /** Physical US keyboard text (printable ASCII, up to 4096 bytes), preserving the clipboard. */
107
+ textMode?: "keyboard";
104
108
  }
105
109
  export interface SurfaceActionRequest {
106
110
  /** Reuse this ID to inspect/recover an uncertain acknowledgement. Do not replay with a new ID. */
@@ -52,7 +52,7 @@ export interface DockerConfig {
52
52
  agentCwd?: string;
53
53
  /** Explicit path to a Linux `mindwired` to deploy (else resolved from the platform package). */
54
54
  daemonBin?: string;
55
- /** Redeploy when the running daemon's version differs from the SDK's bundled binary. */
55
+ /** Upgrade an older daemon when idle; requires its service update capability. */
56
56
  autoUpdate?: boolean;
57
57
  /** On `close()`, stop + remove a container we created (attached containers are left running). */
58
58
  stopOnExit?: boolean;
@@ -35,7 +35,7 @@ export interface EnsureDaemonConfig {
35
35
  * development launcher to build artifacts without guessing the sandbox platform in advance.
36
36
  */
37
37
  daemonBin?: string;
38
- /** Redeploy when the running daemon's version differs from `desiredVersion`. Off by default. */
38
+ /** Upgrade an older service when idle. Requires serviceUpdateVersion >= 1. Off by default. */
39
39
  autoUpdate?: boolean;
40
40
  /** Redeploy even when the reported version matches. Intended only for a locally built development daemon. */
41
41
  forceDeploy?: boolean;
@@ -21,9 +21,9 @@ export interface OblienConfig {
21
21
  port?: number;
22
22
  /** Explicit local `mindwired` to deploy. `{os}`/`{arch}` expand to the workspace platform. */
23
23
  daemonBin?: string;
24
- /** Redeploy the daemon when the running version differs from the SDK's bundled binary. Off by default. */
24
+ /** Upgrade an older daemon when idle; requires its service update capability. Off by default. */
25
25
  autoUpdate?: boolean;
26
- /** Replace even a healthy version match. Use only with a locally built development daemon. */
26
+ /** Replace even a healthy version match while idle. Use only with a local development binary. */
27
27
  forceDeploy?: boolean;
28
28
  /** On `close()`, tear the workspace down (delete one we created / stop one we reused). */
29
29
  stopOnExit?: boolean;
@@ -28,7 +28,7 @@ export interface SshOptions {
28
28
  agentCwd?: string;
29
29
  /** Explicit local `mindwired` to deploy; `{os}`/`{arch}` expand to the destination platform. Otherwise downloaded from GitHub Releases. */
30
30
  daemonBin?: string;
31
- /** Redeploy when the running daemon's version differs from the SDK's bundled binary. */
31
+ /** Upgrade an older daemon when idle; requires its service update capability. */
32
32
  autoUpdate?: boolean;
33
33
  /** On `close()`, tear the tunnel down and end the SSH connection. Defaults to `true`. */
34
34
  stopOnExit?: boolean;
package/dist/types.d.ts CHANGED
@@ -235,6 +235,12 @@ export interface Interaction {
235
235
  /** Whether approval feedback is accepted for all actions, or only a rejection. */
236
236
  feedback?: "always" | "rejection";
237
237
  needsResponse?: boolean;
238
+ /** Async questions use native user messages and remain answerable after turn completion. */
239
+ responseMode?: "message";
240
+ /** Daemon run to address with respond, including when the form is in history. */
241
+ runId?: string;
242
+ /** Accepted answer, saved after acknowledgement. */
243
+ response?: RespondInput;
238
244
  meta?: Record<string, unknown>;
239
245
  }
240
246
  /**
@@ -242,7 +248,8 @@ export interface Interaction {
242
248
  * ties the answer to the pending request. `decision` must be an offered action ID. For a form,
243
249
  * `answers` maps every required question ID to its selected option IDs and optional feedback.
244
250
  * Legacy single-question clients may send `options` and `text` at the top level. Incomplete
245
- * answers return 400; stale or duplicate submissions return 409.
251
+ * answers return 400; stale or concurrent submissions return 409. Message-mode forms
252
+ * remain answerable after completion, and retrying the same accepted answer is idempotent.
246
253
  */
247
254
  export interface RespondInput {
248
255
  interactionId?: string;
@@ -268,6 +275,7 @@ export interface Capabilities {
268
275
  cancel: boolean;
269
276
  persistent: boolean;
270
277
  models: boolean;
278
+ authLogout?: boolean;
271
279
  /**
272
280
  * Client hint: image attachments are delivered as true vision content (the model sees the image),
273
281
  * not just a path it must open with a Read tool. Attachments themselves are ungated.
@@ -375,6 +383,8 @@ export interface Field {
375
383
  presentation?: "segmented" | "menu" | (string & {});
376
384
  /** Text keyboard hint. */
377
385
  inputMode?: "url" | (string & {});
386
+ minimum?: number;
387
+ maximum?: number;
378
388
  }
379
389
  export interface Section {
380
390
  title: string;
@@ -424,6 +434,10 @@ export interface ModelInfo {
424
434
  outputModalities?: string[];
425
435
  /** Capability flags from the catalog. */
426
436
  reasoning?: boolean;
437
+ /** Reasoning levels reported by the installed harness for this exact model. */
438
+ reasoningEfforts?: Option[];
439
+ defaultReasoningEffort?: string;
440
+ default?: boolean;
427
441
  toolCall?: boolean;
428
442
  attachment?: boolean;
429
443
  /** Per-million-token pricing when known. */
@@ -584,6 +598,8 @@ export interface AuthMethod {
584
598
  export interface AuthState {
585
599
  method: string;
586
600
  status: "needs_input" | "pending" | "complete" | "error" | (string & {});
601
+ /** Echo as `_flowId` in step inputs, or use auth.poll/auth.cancel. */
602
+ flowId?: string;
587
603
  url?: string;
588
604
  code?: string;
589
605
  message?: string;
@@ -593,6 +609,8 @@ export interface AuthState {
593
609
  }
594
610
  /** The resting state: is the agent authenticated, and via which method. */
595
611
  export interface AuthStatus {
612
+ /** Explicit workspace sign-out, persisted until a connection completes. */
613
+ signedOut?: boolean;
596
614
  configured: boolean;
597
615
  method?: string;
598
616
  detail?: string;
@@ -780,6 +798,47 @@ export interface DeleteResult {
780
798
  export interface Catalog {
781
799
  version: string;
782
800
  agents: CatalogEntry[];
801
+ harnessPolicyVersion?: number;
802
+ harnessCompatibility?: HarnessCatalog;
803
+ }
804
+ /** Published independently of daemon releases. Entries approve exact CLI/daemon combinations. */
805
+ export interface HarnessCatalog {
806
+ schemaVersion: number;
807
+ revision: number;
808
+ harnesses: Record<string, {
809
+ releases: Array<{
810
+ version: string;
811
+ daemon: HarnessDaemonRange[];
812
+ }>;
813
+ excluded?: Array<{
814
+ min: string;
815
+ maxExclusive: string;
816
+ daemon: HarnessDaemonRange[];
817
+ reason: string;
818
+ }>;
819
+ }>;
820
+ }
821
+ export interface HarnessDaemonRange {
822
+ min: string;
823
+ maxExclusive?: string;
824
+ }
825
+ /** GET /agent/software. Version selection is enforced by the daemon, never by a client. */
826
+ export interface HarnessSoftware {
827
+ policyVersion: number;
828
+ installedVersion: string;
829
+ recommendedVersion?: string;
830
+ latestVersion?: string;
831
+ compatibility: "supported" | "untested" | "incompatible" | "not_installed" | (string & {});
832
+ managed: boolean;
833
+ updateAvailable: boolean;
834
+ requiresDaemonUpdate: boolean;
835
+ requiredDaemonVersion?: string;
836
+ message?: string;
837
+ catalogRevision: number;
838
+ catalogSource: "bundled" | "cached" | "remote" | (string & {});
839
+ catalogStale: boolean;
840
+ /** Missing shared tools; run setup even if the CLI itself is already installed. */
841
+ missingDependencies?: string[];
783
842
  }
784
843
  /** `GET /agent` — everything the client needs to render one agent's screen. */
785
844
  export interface AgentInfo {
@@ -791,6 +850,7 @@ export interface AgentInfo {
791
850
  authMethods: AuthMethod[];
792
851
  authStatus: AuthStatus;
793
852
  installedVersion: string;
853
+ software?: HarnessSoftware;
794
854
  configured: boolean;
795
855
  configPath: string;
796
856
  /**
@@ -918,9 +978,21 @@ export interface Health {
918
978
  workspaceMetadataVersion?: number;
919
979
  /** Durable project creation/clone operations; absent on older daemons. */
920
980
  projectOperationsVersion?: number;
981
+ /** Workspace/project GitHub bindings and operation/run credential forwarding. */
982
+ gitAccessVersion?: number;
983
+ /** Durable, coordinated Git mutations with idempotent submission and reconnectable status. */
984
+ gitOperationsVersion?: number;
985
+ /** Persistent profile/chat mutes enforced before every notification delivery. */
986
+ notificationPreferencesVersion?: number;
987
+ harnessPolicyVersion?: number;
921
988
  ok: boolean;
922
989
  agent: string;
923
990
  version: string;
991
+ /** Atomic idle admission for service replacement. */
992
+ serviceUpdateVersion?: number;
993
+ /** Container placement supplies the sandbox boundary; approval policy is independent. */
994
+ workspaceIsolationVersion?: number;
995
+ workspaceIsolation?: "direct" | "container";
924
996
  }
925
997
  /**
926
998
  * `GET /stats` — the daemon **process's** own resource snapshot, straight from the Go runtime. It is
@@ -1,6 +1,6 @@
1
1
  import type { Mindwire } from "./client.js";
2
- /** Write-only credentials for one clone attempt. Never persisted in operation snapshots. */
3
- export type ProjectAuth = {
2
+ /** Write-only credentials. Never persisted in operation snapshots or conversation state. */
3
+ export type ProjectAuth = ({
4
4
  kind: "token";
5
5
  token: string;
6
6
  username?: string;
@@ -9,7 +9,52 @@ export type ProjectAuth = {
9
9
  privateKey: string;
10
10
  } | {
11
11
  kind: "gh";
12
+ }) & {
13
+ connectionId?: string;
14
+ expiresAt?: string;
15
+ readOnly?: boolean;
12
16
  };
17
+ export interface GitConnection {
18
+ id: string;
19
+ login: string;
20
+ mode: "token" | "oblienApp" | "sshKey" | "ghCli" | "native";
21
+ lifetime: "run" | "workspace";
22
+ }
23
+ export interface GitAccessState {
24
+ default?: GitConnection;
25
+ storedConnectionIds: string[];
26
+ storedConnections: GitConnection[];
27
+ activeOperations: number;
28
+ }
29
+ export interface ProjectGitState {
30
+ connection?: GitConnection;
31
+ inherited: boolean;
32
+ stored: boolean;
33
+ repoUrl?: string;
34
+ }
35
+ export type GitAction = "stage" | "unstage" | "discard" | "commit" | "fetch" | "pull" | "push";
36
+ export interface GitOperationRequest {
37
+ /** Stable ID. Reuse this exact intent after a lost acknowledgement. */
38
+ id: string;
39
+ action: GitAction;
40
+ /** Literal repository-relative paths, required for stage/unstage/discard. */
41
+ paths?: string[];
42
+ /** Required for commit. Git uses the server's configured author identity. */
43
+ message?: string;
44
+ /** Write-only, for network operations only. Never part of an operation snapshot. */
45
+ auth?: ProjectAuth;
46
+ }
47
+ export interface GitOperation extends Omit<GitOperationRequest, "auth"> {
48
+ projectId: string;
49
+ /** Canonical repository root resolved by the daemon. */
50
+ path: string;
51
+ status: "queued" | "running" | "cancelling" | "succeeded" | "failed" | "cancelled" | "interrupted";
52
+ output?: string;
53
+ error?: string;
54
+ createdAt: string;
55
+ updatedAt: string;
56
+ sequence: number;
57
+ }
13
58
  export interface ProjectRequest {
14
59
  /** Stable idempotency key. Keep the same ID if the acknowledgement is lost. */
15
60
  id: string;
@@ -20,6 +65,7 @@ export interface ProjectRequest {
20
65
  repoUrl?: string;
21
66
  branch?: string;
22
67
  auth?: ProjectAuth;
68
+ gitConnection?: GitConnection;
23
69
  }
24
70
  export interface ProjectRemoveRequest {
25
71
  /** Stable idempotency key for this confirmed removal. */
@@ -69,11 +115,15 @@ export interface WorkspaceAgent extends WorkspaceRecord {
69
115
  name: string;
70
116
  agentType: string;
71
117
  agentTypeName?: string;
118
+ /** Mutes this profile's current and future chats across notification channels. Omit to preserve; false to clear. */
119
+ notificationsMuted?: boolean;
72
120
  }
73
121
  export interface WorkspaceProject extends WorkspaceRecord {
74
122
  name: string;
75
123
  path: string;
76
124
  repoUrl?: string;
125
+ /** Omit on edits to preserve; explicitly null restores the workspace default. */
126
+ gitConnection?: GitConnection | null;
77
127
  }
78
128
  /** Chat membership; transcript content continues to come from /chats/:id/messages. */
79
129
  export interface WorkspaceChat extends WorkspaceRecord {
@@ -82,6 +132,8 @@ export interface WorkspaceChat extends WorkspaceRecord {
82
132
  title: string;
83
133
  titleIsUserSet?: boolean;
84
134
  sessionId?: string;
135
+ /** Mutes this chat. False clears its own mute but never overrides a muted parent profile. Omit to preserve. */
136
+ notificationsMuted?: boolean;
85
137
  }
86
138
  export type WorkspaceKind = "agents" | "projects" | "chats";
87
139
  export type WorkspaceInput<T extends WorkspaceRecord> = Omit<T, "id" | "workspaceId" | "revision" | "createdAt"> & {
@@ -128,6 +180,7 @@ export declare class WorkspaceCollection<T extends WorkspaceRecord> {
128
180
  /** Workspace metadata is shared by all harnesses; withAgent() never scopes these requests. */
129
181
  export declare class WorkspaceApi {
130
182
  private readonly mw;
183
+ readonly git: GitAccessApi;
131
184
  readonly operations: ProjectOperationsApi;
132
185
  readonly agents: WorkspaceCollection<WorkspaceAgent>;
133
186
  readonly projects: WorkspaceCollection<WorkspaceProject>;
@@ -147,3 +200,28 @@ export declare class WorkspaceApi {
147
200
  /** Import legacy metadata before replacing a local cache. Safe to repeat after interruption. */
148
201
  import(records: WorkspaceImport): Promise<WorkspaceSnapshot>;
149
202
  }
203
+ /** Account preferences and authenticated Git on the daemon hosting each repository. */
204
+ export declare class GitAccessApi {
205
+ private readonly mw;
206
+ constructor(mw: Mindwire);
207
+ state(): Promise<GitAccessState>;
208
+ setDefault(connection: GitConnection | null, auth?: ProjectAuth): Promise<GitAccessState>;
209
+ forget(connectionId: string): Promise<GitAccessState>;
210
+ project(projectId: string): Promise<ProjectGitState>;
211
+ setProject(projectId: string, connection: GitConnection | null, expectedRevision: number, auth?: ProjectAuth): Promise<WorkspaceSnapshot>;
212
+ /** Compatibility call. Prefer start() and operation()/watch() for reconnectable writes. */
213
+ run(projectId: string, operation: "fetch" | "pull" | "push", auth?: ProjectAuth): Promise<{
214
+ output: string;
215
+ }>;
216
+ /** Requires health.gitOperationsVersion >= 1. Acceptance persists before Git runs;
217
+ * disconnecting only detaches the client. The same ID/intent never runs twice.
218
+ */
219
+ start(projectId: string, request: GitOperationRequest): Promise<GitOperation>;
220
+ operations(projectId: string, activeOnly?: boolean): Promise<GitOperation[]>;
221
+ operation(id: string): Promise<GitOperation>;
222
+ cancel(id: string): Promise<GitOperation>;
223
+ /** Current snapshot followed by state changes. Aborting observation never cancels the operation. */
224
+ watch(id: string, opts?: {
225
+ signal?: AbortSignal;
226
+ }): AsyncGenerator<GitOperation>;
227
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindwire",
3
- "version": "0.1.14",
3
+ "version": "0.1.18",
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "devDependencies": {
@@ -66,7 +66,7 @@
66
66
  "dev": "tsup --watch",
67
67
  "typecheck": "tsc --noEmit",
68
68
  "test": "bun test",
69
- "test:e2e": "RUN_E2E=1 RUN_DOCKER_E2E=1 bun test test/e2e",
69
+ "test:e2e": "bun run build && RUN_E2E=1 RUN_DOCKER_E2E=1 bun test test/e2e",
70
70
  "clean": "rm -rf dist"
71
71
  },
72
72
  "sideEffects": false,