mindwire 0.1.1 → 0.1.3

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.
@@ -32,6 +32,8 @@ export interface ContainerHandle {
32
32
  containerId: string;
33
33
  /** The ephemeral host port the in-container daemon is published to, on the base machine's loopback. */
34
34
  hostPort: number;
35
+ /** Bearer token generated for the daemon in this container. */
36
+ token: string;
35
37
  /** Tear down: `docker rm -f` the container if we created it and `stopOnExit` is set. Idempotent. */
36
38
  stop(): Promise<void>;
37
39
  }
@@ -36,8 +36,10 @@ export interface DockerConfig {
36
36
  docker?: DockerodeLike;
37
37
  /** How to reach the Docker engine (remote host / socket / TLS). Ignored when `docker` is passed. */
38
38
  engine?: DockerEngineOptions;
39
- /** Create + own a container from this image. */
39
+ /** Create + own a container from this image. Defaults to the SDK-matched MindWire runtime image. */
40
40
  image?: string;
41
+ /** Image acquisition policy for a container MindWire creates. Defaults to pulling only when absent. */
42
+ pull?: "missing" | "always" | "never";
41
43
  /** Attach to an existing container (id or name) instead of creating one. */
42
44
  container?: string;
43
45
  /** Extra options merged into `createContainer` (native dockerode/Docker API fields). */
@@ -103,6 +105,10 @@ interface ContainerLike {
103
105
  }
104
106
  export interface DockerodeLike {
105
107
  getContainer(id: string): ContainerLike;
108
+ getImage(name: string): {
109
+ inspect(): Promise<unknown>;
110
+ };
111
+ pull(name: string): Promise<DuplexLike>;
106
112
  createContainer(opts: Record<string, unknown>): Promise<ContainerLike>;
107
113
  }
108
114
  /**
@@ -29,16 +29,23 @@ export interface EnsureDaemonConfig {
29
29
  agent: string;
30
30
  /** `AGENT_CWD` — working directory agents run in, inside the sandbox. */
31
31
  agentCwd: string;
32
- /** Explicit path to a Linux `mindwired` to deploy (else resolved from the platform package). */
32
+ /**
33
+ * Explicit path to a Linux `mindwired` to deploy (else downloaded from the matching GitHub Release).
34
+ * `{arch}` is expanded to the destination architecture (`amd64` or `arm64`), allowing a development
35
+ * launcher to build both artifacts without guessing the sandbox architecture in advance.
36
+ */
33
37
  daemonBin?: string;
34
38
  /** Redeploy when the running daemon's version differs from `desiredVersion`. Off by default. */
35
39
  autoUpdate?: boolean;
40
+ /** Redeploy even when the reported version matches. Intended only for a locally built development daemon. */
41
+ forceDeploy?: boolean;
36
42
  /** Version to reconcile against. Defaults to {@link SDK_VERSION} (the bundled binary's version). */
37
43
  desiredVersion?: string;
38
44
  /** Destination label carried on every {@link EnsureEvent} (e.g. `"ssh"`/`"docker"`/`"oblien"`). */
39
45
  target?: string;
40
46
  /** Receives a step {@link EnsureEvent} at each phase. A throwing callback can't abort provisioning. */
41
47
  onLog?: (e: EnsureEvent) => void;
48
+ token?: string;
42
49
  }
43
50
  /**
44
51
  * A progress event emitted at each phase of the ensure cycle (and, one-shot, by the `local`/`remote`
@@ -54,7 +61,7 @@ export interface EnsureDaemonConfig {
54
61
  * `connect → install → provision → probe → (skip | upload → launch → ready)`.
55
62
  */
56
63
  export interface EnsureEvent {
57
- phase: "connect" | "install" | "provision" | "probe" | "download" | "upload" | "launch" | "ready" | "skip" | "error";
64
+ phase: "connect" | "install" | "provision" | "pull" | "probe" | "download" | "upload" | "launch" | "ready" | "skip" | "error";
58
65
  /** Destination label, e.g. `"ssh"` / `"docker"` / `"oblien"` / `"local"` / `"remote"`. */
59
66
  target: string;
60
67
  /** Human-readable one-line status. */
@@ -70,10 +77,11 @@ export interface EnsureEvent {
70
77
  }
71
78
  /**
72
79
  * Make sure a healthy `mindwired` of the desired version is reachable at `127.0.0.1:<port>` inside the
73
- * sandbox, deploying it if absent (or redeploying if stale and `autoUpdate` is set). Idempotent: a
74
- * healthy, current daemon (e.g. an image that autostarts it, or a reused sandbox) is a no-op.
80
+ * sandbox, deploying it if absent (or redeploying if stale and `autoUpdate` is set). `forceDeploy`
81
+ * deliberately replaces even a version match for local source development. Otherwise a healthy,
82
+ * current daemon (e.g. an image that autostarts it, or a reused sandbox) is a no-op.
75
83
  */
76
- export declare function ensureDaemon(host: SandboxHost, cfg: EnsureDaemonConfig): Promise<void>;
84
+ export declare function ensureDaemon(host: SandboxHost, cfg: EnsureDaemonConfig): Promise<string>;
77
85
  /**
78
86
  * Resolve a Linux `mindwired` on the host running the SDK: an explicit `daemonBin`, else download the
79
87
  * SDK-matched release binary, verify its checksum, and return its local cache path for upload.
@@ -19,10 +19,12 @@ export interface OblienConfig {
19
19
  agentCwd?: string;
20
20
  /** Loopback port the in-workspace daemon listens on. */
21
21
  port?: number;
22
- /** Explicit path to a Linux `mindwired` to deploy (else resolved from the platform package). */
22
+ /** Explicit local Linux `mindwired` to deploy. `{arch}` expands to the workspace architecture. */
23
23
  daemonBin?: string;
24
24
  /** Redeploy the daemon when the running version differs from the SDK's bundled binary. Off by default. */
25
25
  autoUpdate?: boolean;
26
+ /** Replace even a healthy version match. Use only with a locally built development daemon. */
27
+ forceDeploy?: boolean;
26
28
  /** On `close()`, tear the workspace down (delete one we created / stop one we reused). */
27
29
  stopOnExit?: boolean;
28
30
  /** Image for a new workspace. Ideally one that already runs `mindwired` and ships the target agent CLI. */
@@ -37,6 +39,8 @@ export interface OblienConfig {
37
39
  memoryMb?: number;
38
40
  /** Disk (MB) for a new workspace. */
39
41
  diskMb?: number;
42
+ /** Called as soon as the workspace identity is known, before daemon installation begins. */
43
+ onWorkspace?: (workspaceId: string) => void | Promise<void>;
40
44
  /** Lifecycle: `temporary` (auto-reaped) or `permanent`. */
41
45
  mode?: "temporary" | "permanent";
42
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindwire",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "devDependencies": {
@@ -33,7 +33,7 @@
33
33
  "require": "./dist/index.cjs"
34
34
  }
35
35
  },
36
- "description": "TypeScript SDK for the mindwire daemon — one client for every coding-agent harness (Claude Code, Codex, Copilot CLI, opencode).",
36
+ "description": "TypeScript SDK for the MindWire runtime — one client for every coding-agent harness (Claude Code, Codex, Grok Build, opencode).",
37
37
  "engines": {
38
38
  "node": ">=18"
39
39
  },
@@ -45,6 +45,7 @@
45
45
  "coding-agent",
46
46
  "claude-code",
47
47
  "codex",
48
+ "grok",
48
49
  "copilot",
49
50
  "opencode",
50
51
  "agent",
@@ -61,7 +62,6 @@
61
62
  "scripts": {
62
63
  "prepack": "bun run build",
63
64
  "build": "tsup && tsc --emitDeclarationOnly",
64
- "build:daemon": "node scripts/build-daemon.mjs",
65
65
  "docs:api": "node scripts/gen-sdk-docs.mjs",
66
66
  "dev": "tsup --watch",
67
67
  "typecheck": "tsc --noEmit",