mindwire 0.1.15 → 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
@@ -57,7 +57,9 @@ export declare class Run {
57
57
  * after completion; the daemon steers or resumes the conversation. Read the chat's latest
58
58
  * run after replying to a completed run. Requires the agent's `respond` capability.
59
59
  */
60
- respond(input?: RespondInput): Promise<void>;
60
+ respond(input?: RespondInput & {
61
+ gitAuth?: import("./workspace.js").ProjectAuth;
62
+ }): Promise<void>;
61
63
  /**
62
64
  * Steer a follow-up message into the running turn without cancelling it. Requires the agent's
63
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
+ }
@@ -103,7 +103,7 @@ export interface SurfaceAction {
103
103
  deltaY?: number;
104
104
  keys?: string[];
105
105
  text?: string;
106
- /** Physical US keyboard text (printable ASCII, <=4096 bytes), preserving the clipboard. */
106
+ /** Physical US keyboard text (printable ASCII, up to 4096 bytes), preserving the clipboard. */
107
107
  textMode?: "keyboard";
108
108
  }
109
109
  export interface SurfaceActionRequest {
@@ -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
@@ -275,6 +275,7 @@ export interface Capabilities {
275
275
  cancel: boolean;
276
276
  persistent: boolean;
277
277
  models: boolean;
278
+ authLogout?: boolean;
278
279
  /**
279
280
  * Client hint: image attachments are delivered as true vision content (the model sees the image),
280
281
  * not just a path it must open with a Read tool. Attachments themselves are ungated.
@@ -382,6 +383,8 @@ export interface Field {
382
383
  presentation?: "segmented" | "menu" | (string & {});
383
384
  /** Text keyboard hint. */
384
385
  inputMode?: "url" | (string & {});
386
+ minimum?: number;
387
+ maximum?: number;
385
388
  }
386
389
  export interface Section {
387
390
  title: string;
@@ -431,6 +434,10 @@ export interface ModelInfo {
431
434
  outputModalities?: string[];
432
435
  /** Capability flags from the catalog. */
433
436
  reasoning?: boolean;
437
+ /** Reasoning levels reported by the installed harness for this exact model. */
438
+ reasoningEfforts?: Option[];
439
+ defaultReasoningEffort?: string;
440
+ default?: boolean;
434
441
  toolCall?: boolean;
435
442
  attachment?: boolean;
436
443
  /** Per-million-token pricing when known. */
@@ -591,6 +598,8 @@ export interface AuthMethod {
591
598
  export interface AuthState {
592
599
  method: string;
593
600
  status: "needs_input" | "pending" | "complete" | "error" | (string & {});
601
+ /** Echo as `_flowId` in step inputs, or use auth.poll/auth.cancel. */
602
+ flowId?: string;
594
603
  url?: string;
595
604
  code?: string;
596
605
  message?: string;
@@ -600,6 +609,8 @@ export interface AuthState {
600
609
  }
601
610
  /** The resting state: is the agent authenticated, and via which method. */
602
611
  export interface AuthStatus {
612
+ /** Explicit workspace sign-out, persisted until a connection completes. */
613
+ signedOut?: boolean;
603
614
  configured: boolean;
604
615
  method?: string;
605
616
  detail?: string;
@@ -787,6 +798,47 @@ export interface DeleteResult {
787
798
  export interface Catalog {
788
799
  version: string;
789
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[];
790
842
  }
791
843
  /** `GET /agent` — everything the client needs to render one agent's screen. */
792
844
  export interface AgentInfo {
@@ -798,6 +850,7 @@ export interface AgentInfo {
798
850
  authMethods: AuthMethod[];
799
851
  authStatus: AuthStatus;
800
852
  installedVersion: string;
853
+ software?: HarnessSoftware;
801
854
  configured: boolean;
802
855
  configPath: string;
803
856
  /**
@@ -925,11 +978,21 @@ export interface Health {
925
978
  workspaceMetadataVersion?: number;
926
979
  /** Durable project creation/clone operations; absent on older daemons. */
927
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;
928
985
  /** Persistent profile/chat mutes enforced before every notification delivery. */
929
986
  notificationPreferencesVersion?: number;
987
+ harnessPolicyVersion?: number;
930
988
  ok: boolean;
931
989
  agent: string;
932
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";
933
996
  }
934
997
  /**
935
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. */
@@ -76,6 +122,8 @@ export interface WorkspaceProject extends WorkspaceRecord {
76
122
  name: string;
77
123
  path: string;
78
124
  repoUrl?: string;
125
+ /** Omit on edits to preserve; explicitly null restores the workspace default. */
126
+ gitConnection?: GitConnection | null;
79
127
  }
80
128
  /** Chat membership; transcript content continues to come from /chats/:id/messages. */
81
129
  export interface WorkspaceChat extends WorkspaceRecord {
@@ -132,6 +180,7 @@ export declare class WorkspaceCollection<T extends WorkspaceRecord> {
132
180
  /** Workspace metadata is shared by all harnesses; withAgent() never scopes these requests. */
133
181
  export declare class WorkspaceApi {
134
182
  private readonly mw;
183
+ readonly git: GitAccessApi;
135
184
  readonly operations: ProjectOperationsApi;
136
185
  readonly agents: WorkspaceCollection<WorkspaceAgent>;
137
186
  readonly projects: WorkspaceCollection<WorkspaceProject>;
@@ -151,3 +200,28 @@ export declare class WorkspaceApi {
151
200
  /** Import legacy metadata before replacing a local cache. Safe to repeat after interruption. */
152
201
  import(records: WorkspaceImport): Promise<WorkspaceSnapshot>;
153
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.15",
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,