@aspectlylabs/mikka 0.0.113 → 0.0.115

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/client.js CHANGED
@@ -2346,7 +2346,11 @@ var harnessInfoSchema = z6.object({
2346
2346
  defaultModelSlot: z6.string().trim().min(1).max(128).optional(),
2347
2347
  /** Deprecated (#312, 2026-10-27): could host the native Coordinator. The server keeps that runtime switched off. */
2348
2348
  coordinator: z6.boolean().optional(),
2349
- /** Set only by a runner with an isolated, owner-bound subscription broker. */
2349
+ /**
2350
+ * Set only by a runner that runs subscriptions under owner-bound custody:
2351
+ * the hosted runner's broker, or a device daemon that takes one run's
2352
+ * short-lived access lease (never the refresh grant) and wipes it at run end.
2353
+ */
2350
2354
  subscriptionBroker: z6.literal(true).optional(),
2351
2355
  /** Set only by an E2B worker with the guarded Bot computer broker. */
2352
2356
  computerBroker: z6.literal(true).optional(),
@@ -2842,6 +2846,17 @@ var runSkillRefSchema = z13.object({
2842
2846
  var id2 = z14.string().min(1).max(64);
2843
2847
  var isoTime = z14.iso.datetime({ offset: true });
2844
2848
  var deviceComputerCapability = z14.object({ installed: z14.boolean(), version: z14.string().max(100).nullable() }).strict();
2849
+ var deviceRunnerCapability = z14.object({
2850
+ os: z14.string().max(50),
2851
+ arch: z14.string().max(50),
2852
+ freeDiskBytes: z14.number().int().nonnegative().nullable(),
2853
+ docker: z14.boolean(),
2854
+ harnesses: z14.array(z14.object({
2855
+ harness: harnessSchema,
2856
+ state: z14.enum(["installed", "not_installed", "unsupported"]),
2857
+ version: z14.string().max(100)
2858
+ })).max(20)
2859
+ });
2845
2860
  var deviceRegistration = z14.object({
2846
2861
  deviceType: z14.enum(["laptop", "server"]).optional(),
2847
2862
  name: z14.string().trim().min(1).max(200),
@@ -2852,6 +2867,7 @@ var deviceRegistration = z14.object({
2852
2867
  protocolVersion: z14.number().int(),
2853
2868
  harnesses: z14.array(harnessInfoSchema).max(20),
2854
2869
  computerUse: deviceComputerCapability.optional(),
2870
+ runner: deviceRunnerCapability.optional(),
2855
2871
  /**
2856
2872
  * This machine's one device id, the same in every workspace (ADR ORV-284).
2857
2873
  * Registering with it in another workspace joins the same device there.
@@ -2877,6 +2893,7 @@ var deviceHeartbeatSchema = z14.object({
2877
2893
  failedDeviceCommands: z14.array(z14.object({ id: z14.uuid(), error: z14.string().max(500) })).max(100).optional(),
2878
2894
  harnesses: z14.array(harnessInfoSchema).max(20),
2879
2895
  computerUse: deviceComputerCapability.optional(),
2896
+ runner: deviceRunnerCapability.optional(),
2880
2897
  deviceType: z14.enum(["laptop", "server"]).optional(),
2881
2898
  runs: z14.array(heartbeatRunSchema).max(500),
2882
2899
  worktreeDiskBytes: z14.number().int().nonnegative(),
@@ -3684,6 +3701,9 @@ var nativeBrokerContextSchema = z22.object({
3684
3701
  plan: z22.string().max(40).optional(),
3685
3702
  expiresAt: z22.iso.datetime()
3686
3703
  }).strict();
3704
+ var nativeLeaseSchema = nativeBrokerContextSchema.extend({
3705
+ accessToken: z22.string().min(1).max(32768).regex(/^[^\r\n\0]+$/)
3706
+ }).strict();
3687
3707
 
3688
3708
  // src/rpc/client.ts
3689
3709
  import {
@@ -3699,7 +3719,7 @@ import { join } from "node:path";
3699
3719
  // package.json
3700
3720
  var package_default = {
3701
3721
  name: "@mikka/daemon",
3702
- version: "0.0.113",
3722
+ version: "0.0.115",
3703
3723
  description: "Local Mikka daemon: runs agents through the user's own CLIs",
3704
3724
  type: "module",
3705
3725
  private: true,
@@ -3731,7 +3751,8 @@ var package_default = {
3731
3751
  build: "node scripts/build.mjs",
3732
3752
  "test:package": "node --test test/package.test.mjs",
3733
3753
  "test:repository-identity": "node --experimental-strip-types --test test/repository-identity-pure.node-test.ts",
3734
- "test:github-credentials": "node --test test/github-credentials.node-test.mjs"
3754
+ "test:github-credentials": "node --test test/github-credentials.node-test.mjs",
3755
+ "test:run-container": "node --import tsx --test --test-timeout=900000 test/run-container.docker-test.ts"
3735
3756
  },
3736
3757
  dependencies: {
3737
3758
  "@agentclientprotocol/sdk": "1.9.0",
@@ -3758,7 +3779,7 @@ var package_default = {
3758
3779
  engines: {
3759
3780
  node: ">=24"
3760
3781
  },
3761
- gitHead: "aaeb12ba1c18c1b1212089f956f9469c3c987929"
3782
+ gitHead: "359ba1cd2bc68cbb7b92e957579690d9f43878b8"
3762
3783
  };
3763
3784
 
3764
3785
  // src/paths.ts
@@ -3775,6 +3796,8 @@ function daemonPaths(dataDir) {
3775
3796
  worktrees: join(dataDir, "worktrees"),
3776
3797
  repos: join(dataDir, "repos"),
3777
3798
  adapterState: join(dataDir, "adapters"),
3799
+ /** Pinned Claude Code and Codex the daemon installs for its runs. */
3800
+ harness: join(dataDir, "harness"),
3778
3801
  logs: join(dataDir, "logs"),
3779
3802
  devRepos: join(dataDir, "dev-repos.json")
3780
3803
  };
@@ -0,0 +1,19 @@
1
+ # The runner image: a clean Linux with the daemon's pinned Claude Code and
2
+ # Codex (harness/pins.json), the same harnesses a device installs for itself.
3
+ # A device with Docker runs each harness in a disposable container of it;
4
+ # the E2B template installs from the same pins and installer.
5
+ #
6
+ # Context: packages/daemon (or the npm package root). Multi-arch: the installer picks the build for the
7
+ # image's own arch, e.g.
8
+ # docker buildx build --platform linux/amd64,linux/arm64 -f harness/Dockerfile .
9
+ # The base is the multi-arch node 24 index also pinned as HOSTED_NATIVE_IMAGE.
10
+ FROM node@sha256:6449e19d8184d84062525b6a7524def03146c2cb04a7f08b076680d0e8e4240a
11
+ COPY harness/pins.json harness/install.mjs harness/cli.mjs /opt/mikka/installer/
12
+ # An optional `--secret id=ca,src=<bundle>` trusts a proxy's CA while downloading.
13
+ RUN --mount=type=secret,id=ca,required=false \
14
+ if [ -f /run/secrets/ca ]; then export NODE_EXTRA_CA_CERTS=/run/secrets/ca; fi \
15
+ && node /opt/mikka/installer/cli.mjs /opt/mikka/harness > /tmp/harnesses \
16
+ && while read -r binary; do ln -sf "$binary" "/usr/local/bin/$(basename "$binary")"; done < /tmp/harnesses \
17
+ && rm -rf /opt/mikka/installer /tmp/harnesses \
18
+ && chmod -R go+rX,go-w /opt/mikka/harness \
19
+ && claude --version && codex --version
@@ -0,0 +1,12 @@
1
+ // Installs the pinned harnesses with plain Node, for images built from the
2
+ // same pins as the daemon (Dockerfile, scripts/e2b/build-template.py):
3
+ // node harness/cli.mjs <root> [claude_code|codex ...]
4
+ // Prints each installed binary's path.
5
+ import { ensureHarness, MANAGED_HARNESSES } from './install.mjs'
6
+
7
+ const [root, ...names] = process.argv.slice(2)
8
+ if (!root) throw new Error('usage: cli.mjs <root> [harness ...]')
9
+ for (const harness of names.length ? names : MANAGED_HARNESSES) {
10
+ if (!MANAGED_HARNESSES.includes(harness)) throw new Error(`unknown harness ${harness}`)
11
+ console.log(await ensureHarness({ root }, harness))
12
+ }
@@ -0,0 +1,113 @@
1
+ // Daemon-managed harnesses: the daemon runs its own pinned Claude Code and
2
+ // Codex, never a CLI the person installed. Each is the official npm
3
+ // platform package, checked against the integrity pinned in `pins.json`
4
+ // (the registry is never trusted for it) and unpacked into
5
+ // `<root>/<harness>/<version>/bin/<command>`. A daemon release that bumps a
6
+ // pin installs the new version on its next run and removes the old.
7
+ //
8
+ // Plain JavaScript with no local imports beyond the pins: the runner image
9
+ // (Dockerfile) and the E2B template run it through `cli.mjs`.
10
+ import { createHash, randomBytes } from 'node:crypto'
11
+ import { execFile } from 'node:child_process'
12
+ import { createWriteStream, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from 'node:fs'
13
+ import { join } from 'node:path'
14
+ import { Readable, Transform } from 'node:stream'
15
+ import { pipeline } from 'node:stream/promises'
16
+ import { promisify } from 'node:util'
17
+
18
+ import pins from './pins.json' with { type: 'json' }
19
+
20
+ export const MANAGED_HARNESSES = ['claude_code', 'codex']
21
+ export const HARNESS_PINS = pins
22
+
23
+ const MARKER = '.mikka-installed'
24
+ const run = promisify(execFile)
25
+ const inflight = new Map()
26
+
27
+ export function platformKey(platform = process.platform, arch = process.arch) {
28
+ return `${platform}-${arch}`
29
+ }
30
+
31
+ function resolvePin(store, harness) {
32
+ const pin = (store.pins ?? HARNESS_PINS).harnesses[harness]
33
+ return { pin, artifact: pin.platforms[store.platform ?? platformKey()] }
34
+ }
35
+
36
+ function versionDir(store, harness) {
37
+ return join(store.root, harness, resolvePin(store, harness).pin.version)
38
+ }
39
+
40
+ /** Where the pinned binary lives once installed. */
41
+ export function harnessBinaryPath(store, harness) {
42
+ return join(versionDir(store, harness), 'bin', resolvePin(store, harness).pin.command)
43
+ }
44
+
45
+ export function harnessInstallState(store, harness) {
46
+ const { pin, artifact } = resolvePin(store, harness)
47
+ if (!artifact) return { state: 'unsupported', version: pin.version }
48
+ let installed = false
49
+ try {
50
+ installed = readFileSync(join(versionDir(store, harness), MARKER), 'utf8') === artifact.integrity
51
+ && statSync(harnessBinaryPath(store, harness)).isFile()
52
+ } catch {
53
+ // Not installed (or a half-finished one, which is replaced).
54
+ }
55
+ return { state: installed ? 'installed' : 'not_installed', version: pin.version }
56
+ }
57
+
58
+ /** The pinned binary, downloaded and verified on first need. */
59
+ export function ensureHarness(store, harness) {
60
+ const key = `${store.root}\0${harness}`
61
+ let pending = inflight.get(key)
62
+ if (!pending) {
63
+ pending = install(store, harness).finally(() => inflight.delete(key))
64
+ inflight.set(key, pending)
65
+ }
66
+ return pending
67
+ }
68
+
69
+ async function install(store, harness) {
70
+ const binary = harnessBinaryPath(store, harness)
71
+ const { state } = harnessInstallState(store, harness)
72
+ if (state === 'unsupported') throw new Error(`${harness} has no build for ${store.platform ?? platformKey()}`)
73
+ if (state === 'installed') return binary
74
+ const { pin, artifact } = resolvePin(store, harness)
75
+ const parent = join(store.root, harness)
76
+ mkdirSync(parent, { recursive: true, mode: 0o700 })
77
+ const staging = join(parent, `.staging-${randomBytes(6).toString('hex')}`)
78
+ mkdirSync(join(staging, 'bin'), { recursive: true, mode: 0o700 })
79
+ try {
80
+ const tarball = join(staging, 'package.tgz')
81
+ await download(`${(store.pins ?? HARNESS_PINS).registry.replace(/\/$/, '')}/${artifact.tarball}`, tarball, artifact.integrity)
82
+ await run('tar', ['-xzf', tarball, '-C', staging, artifact.entry])
83
+ renameSync(join(staging, artifact.entry), join(staging, 'bin', pin.command))
84
+ rmSync(tarball)
85
+ rmSync(join(staging, artifact.entry.split('/')[0]), { recursive: true, force: true })
86
+ writeFileSync(join(staging, MARKER), artifact.integrity, { mode: 0o600 })
87
+ const target = versionDir(store, harness)
88
+ rmSync(target, { recursive: true, force: true })
89
+ renameSync(staging, target)
90
+ } catch (error) {
91
+ rmSync(staging, { recursive: true, force: true })
92
+ throw error
93
+ }
94
+ // Older pins and interrupted downloads.
95
+ for (const name of readdirSync(parent)) if (name !== pin.version) rmSync(join(parent, name), { recursive: true, force: true })
96
+ return binary
97
+ }
98
+
99
+ async function download(url, file, integrity) {
100
+ const [algorithm, expected] = integrity.split(/-(.*)/s)
101
+ if (algorithm !== 'sha512' || !expected) throw new Error('Unsupported harness integrity')
102
+ const response = await fetch(url, { redirect: 'follow' })
103
+ if (!response.ok || !response.body) throw new Error(`Harness download failed (${response.status})`)
104
+ const hash = createHash('sha512')
105
+ const tap = new Transform({ transform(chunk, _encoding, done) { hash.update(chunk); done(null, chunk) } })
106
+ await pipeline(Readable.fromWeb(response.body), tap, createWriteStream(file, { mode: 0o600 }))
107
+ if (hash.digest('base64') !== expected) throw new Error('Harness download failed its integrity check')
108
+ }
109
+
110
+ /** Pinned versions and what is installed, for the device report. */
111
+ export function managedHarnessReport(store) {
112
+ return MANAGED_HARNESSES.map(harness => ({ harness, ...harnessInstallState(store, harness) }))
113
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "registry": "https://registry.npmjs.org",
3
+ "harnesses": {
4
+ "claude_code": {
5
+ "version": "2.1.309",
6
+ "command": "claude",
7
+ "platforms": {
8
+ "darwin-arm64": { "tarball": "@anthropic-ai/claude-code-darwin-arm64/-/claude-code-darwin-arm64-2.1.309.tgz", "integrity": "sha512-7ZVUH/WyxWpFfkV90tJBUSnFTQo8wwRxHNOLNj+q8eYp5DNoCU8KOVC3OiNDmo832BrfQImH0XmpWjGqKPulDg==", "entry": "package/claude" },
9
+ "darwin-x64": { "tarball": "@anthropic-ai/claude-code-darwin-x64/-/claude-code-darwin-x64-2.1.309.tgz", "integrity": "sha512-K+9PSzQQYYooMpohqGInTLbNDXQvbroZZJcmrpyAKonXjzkl4jAQJHe6F6wHxFLKoALntoP6/5WIuCIetoR26w==", "entry": "package/claude" },
10
+ "linux-arm64": { "tarball": "@anthropic-ai/claude-code-linux-arm64/-/claude-code-linux-arm64-2.1.309.tgz", "integrity": "sha512-tTZvLm0QR5d6hWsDpNvc1/QnjRzIfAEaGeZgau+tBle5z5DT8QGRe7IZsPuyBFkkS3MtSbbvsUx/ghO8zYc2ew==", "entry": "package/claude" },
11
+ "linux-x64": { "tarball": "@anthropic-ai/claude-code-linux-x64/-/claude-code-linux-x64-2.1.309.tgz", "integrity": "sha512-36D6kMC0fWdWLwBA8XYaJTSTXEWvw0Kc3WQYqterieKDtplIfUsE5jurZAYilhzOeF+uNL9SNn4DkwhQmUrRMg==", "entry": "package/claude" }
12
+ }
13
+ },
14
+ "codex": {
15
+ "version": "0.163.0",
16
+ "command": "codex",
17
+ "platforms": {
18
+ "darwin-arm64": { "tarball": "@openai/codex/-/codex-0.163.0-darwin-arm64.tgz", "integrity": "sha512-i7Dzk2a5aGmuGM9aNZgaUVTojZ/4bc5lRfosz++Y7X2BGhDkz+cySgbD+NYS1pOxfm0VEbLi9PZ3pAulI4kchw==", "entry": "package/vendor/aarch64-apple-darwin/bin/codex" },
19
+ "darwin-x64": { "tarball": "@openai/codex/-/codex-0.163.0-darwin-x64.tgz", "integrity": "sha512-Ioj7h+B1ME9ZU1PH1ATfvFV5DiototEpFFaSSbg3kfDifB9djhl5fcJ++g5mpcL/+uVbcnReei+RiSXEx8o+kw==", "entry": "package/vendor/x86_64-apple-darwin/bin/codex" },
20
+ "linux-arm64": { "tarball": "@openai/codex/-/codex-0.163.0-linux-arm64.tgz", "integrity": "sha512-IH2/R+4OarjGvsAf1ll3fdyLwrPgYLl3uzp6u9CyD9sj2Lw+ViDSe3QBZVHdcHJs0eIiZFg6Wprcuy4CRZaUGw==", "entry": "package/vendor/aarch64-unknown-linux-musl/bin/codex" },
21
+ "linux-x64": { "tarball": "@openai/codex/-/codex-0.163.0-linux-x64.tgz", "integrity": "sha512-uwRaOsrYogLQhcxAM/GoeWrw0QIWEMRo7c9gM8sKAviVkZQHlu9kRLJ5PkufbV+ABGjyZgIwiFdJ0LCJ0N6e8w==", "entry": "package/vendor/x86_64-unknown-linux-musl/bin/codex" }
22
+ }
23
+ }
24
+ }
25
+ }
package/http-link.js CHANGED
@@ -2611,6 +2611,9 @@ var nativeBrokerContextSchema = z7.object({
2611
2611
  plan: z7.string().max(40).optional(),
2612
2612
  expiresAt: z7.iso.datetime()
2613
2613
  }).strict();
2614
+ var nativeLeaseSchema = nativeBrokerContextSchema.extend({
2615
+ accessToken: z7.string().min(1).max(32768).regex(/^[^\r\n\0]+$/)
2616
+ }).strict();
2614
2617
 
2615
2618
  // ../protocol/src/computer.ts
2616
2619
  import { z as z8 } from "zod";
@@ -2979,7 +2982,11 @@ var harnessInfoSchema = z14.object({
2979
2982
  defaultModelSlot: z14.string().trim().min(1).max(128).optional(),
2980
2983
  /** Deprecated (#312, 2026-10-27): could host the native Coordinator. The server keeps that runtime switched off. */
2981
2984
  coordinator: z14.boolean().optional(),
2982
- /** Set only by a runner with an isolated, owner-bound subscription broker. */
2985
+ /**
2986
+ * Set only by a runner that runs subscriptions under owner-bound custody:
2987
+ * the hosted runner's broker, or a device daemon that takes one run's
2988
+ * short-lived access lease (never the refresh grant) and wipes it at run end.
2989
+ */
2983
2990
  subscriptionBroker: z14.literal(true).optional(),
2984
2991
  /** Set only by an E2B worker with the guarded Bot computer broker. */
2985
2992
  computerBroker: z14.literal(true).optional(),
@@ -3348,6 +3355,17 @@ var devicePaths = {
3348
3355
  runCheckpoint: (runId) => `/v1/runs/${seg(runId)}/checkpoint`
3349
3356
  };
3350
3357
  var deviceComputerCapability = z18.object({ installed: z18.boolean(), version: z18.string().max(100).nullable() }).strict();
3358
+ var deviceRunnerCapability = z18.object({
3359
+ os: z18.string().max(50),
3360
+ arch: z18.string().max(50),
3361
+ freeDiskBytes: z18.number().int().nonnegative().nullable(),
3362
+ docker: z18.boolean(),
3363
+ harnesses: z18.array(z18.object({
3364
+ harness: harnessSchema,
3365
+ state: z18.enum(["installed", "not_installed", "unsupported"]),
3366
+ version: z18.string().max(100)
3367
+ })).max(20)
3368
+ });
3351
3369
  var deviceRegistration = z18.object({
3352
3370
  deviceType: z18.enum(["laptop", "server"]).optional(),
3353
3371
  name: z18.string().trim().min(1).max(200),
@@ -3358,6 +3376,7 @@ var deviceRegistration = z18.object({
3358
3376
  protocolVersion: z18.number().int(),
3359
3377
  harnesses: z18.array(harnessInfoSchema).max(20),
3360
3378
  computerUse: deviceComputerCapability.optional(),
3379
+ runner: deviceRunnerCapability.optional(),
3361
3380
  /**
3362
3381
  * This machine's one device id, the same in every workspace (ADR ORV-284).
3363
3382
  * Registering with it in another workspace joins the same device there.
@@ -3383,6 +3402,7 @@ var deviceHeartbeatSchema = z18.object({
3383
3402
  failedDeviceCommands: z18.array(z18.object({ id: z18.uuid(), error: z18.string().max(500) })).max(100).optional(),
3384
3403
  harnesses: z18.array(harnessInfoSchema).max(20),
3385
3404
  computerUse: deviceComputerCapability.optional(),
3405
+ runner: deviceRunnerCapability.optional(),
3386
3406
  deviceType: z18.enum(["laptop", "server"]).optional(),
3387
3407
  runs: z18.array(heartbeatRunSchema).max(500),
3388
3408
  worktreeDiskBytes: z18.number().int().nonnegative(),
@@ -4098,7 +4118,7 @@ var InvalidIdError = class extends DaemonError {
4098
4118
  // package.json
4099
4119
  var package_default = {
4100
4120
  name: "@mikka/daemon",
4101
- version: "0.0.113",
4121
+ version: "0.0.115",
4102
4122
  description: "Local Mikka daemon: runs agents through the user's own CLIs",
4103
4123
  type: "module",
4104
4124
  private: true,
@@ -4130,7 +4150,8 @@ var package_default = {
4130
4150
  build: "node scripts/build.mjs",
4131
4151
  "test:package": "node --test test/package.test.mjs",
4132
4152
  "test:repository-identity": "node --experimental-strip-types --test test/repository-identity-pure.node-test.ts",
4133
- "test:github-credentials": "node --test test/github-credentials.node-test.mjs"
4153
+ "test:github-credentials": "node --test test/github-credentials.node-test.mjs",
4154
+ "test:run-container": "node --import tsx --test --test-timeout=900000 test/run-container.docker-test.ts"
4134
4155
  },
4135
4156
  dependencies: {
4136
4157
  "@agentclientprotocol/sdk": "1.9.0",
@@ -4157,7 +4178,7 @@ var package_default = {
4157
4178
  engines: {
4158
4179
  node: ">=24"
4159
4180
  },
4160
- gitHead: "aaeb12ba1c18c1b1212089f956f9469c3c987929"
4181
+ gitHead: "359ba1cd2bc68cbb7b92e957579690d9f43878b8"
4161
4182
  };
4162
4183
 
4163
4184
  // src/paths.ts
@@ -4620,6 +4641,9 @@ var HttpServerLink = class {
4620
4641
  async nativeContext(deviceId, runId, signal) {
4621
4642
  return this.call("POST", `${devicePaths.claim(checkId(deviceId), checkId(runId)).replace(/\/claim$/, "")}/subscription`, { body: { action: "context" }, schema: nativeBrokerContextSchema, signal });
4622
4643
  }
4644
+ async nativeLease(deviceId, runId, signal) {
4645
+ return this.call("POST", `${devicePaths.claim(checkId(deviceId), checkId(runId)).replace(/\/claim$/, "")}/subscription-lease`, { schema: nativeLeaseSchema, signal });
4646
+ }
4623
4647
  async nativeRequest(deviceId, runId, payload, signal) {
4624
4648
  const response = await this.send("POST", `${devicePaths.claim(checkId(deviceId), checkId(runId)).replace(/\/claim$/, "")}/subscription`, { action: "request", payload }, this.credential, { signal, timeoutMs: 275e3 });
4625
4649
  const contentType = response.headers.get("content-type")?.split(";")[0];
package/login.js CHANGED
@@ -2343,7 +2343,11 @@ var harnessInfoSchema = z6.object({
2343
2343
  defaultModelSlot: z6.string().trim().min(1).max(128).optional(),
2344
2344
  /** Deprecated (#312, 2026-10-27): could host the native Coordinator. The server keeps that runtime switched off. */
2345
2345
  coordinator: z6.boolean().optional(),
2346
- /** Set only by a runner with an isolated, owner-bound subscription broker. */
2346
+ /**
2347
+ * Set only by a runner that runs subscriptions under owner-bound custody:
2348
+ * the hosted runner's broker, or a device daemon that takes one run's
2349
+ * short-lived access lease (never the refresh grant) and wipes it at run end.
2350
+ */
2347
2351
  subscriptionBroker: z6.literal(true).optional(),
2348
2352
  /** Set only by an E2B worker with the guarded Bot computer broker. */
2349
2353
  computerBroker: z6.literal(true).optional(),
@@ -2838,6 +2842,17 @@ var runSkillRefSchema = z13.object({
2838
2842
  var id2 = z14.string().min(1).max(64);
2839
2843
  var isoTime = z14.iso.datetime({ offset: true });
2840
2844
  var deviceComputerCapability = z14.object({ installed: z14.boolean(), version: z14.string().max(100).nullable() }).strict();
2845
+ var deviceRunnerCapability = z14.object({
2846
+ os: z14.string().max(50),
2847
+ arch: z14.string().max(50),
2848
+ freeDiskBytes: z14.number().int().nonnegative().nullable(),
2849
+ docker: z14.boolean(),
2850
+ harnesses: z14.array(z14.object({
2851
+ harness: harnessSchema,
2852
+ state: z14.enum(["installed", "not_installed", "unsupported"]),
2853
+ version: z14.string().max(100)
2854
+ })).max(20)
2855
+ });
2841
2856
  var deviceRegistration = z14.object({
2842
2857
  deviceType: z14.enum(["laptop", "server"]).optional(),
2843
2858
  name: z14.string().trim().min(1).max(200),
@@ -2848,6 +2863,7 @@ var deviceRegistration = z14.object({
2848
2863
  protocolVersion: z14.number().int(),
2849
2864
  harnesses: z14.array(harnessInfoSchema).max(20),
2850
2865
  computerUse: deviceComputerCapability.optional(),
2866
+ runner: deviceRunnerCapability.optional(),
2851
2867
  /**
2852
2868
  * This machine's one device id, the same in every workspace (ADR ORV-284).
2853
2869
  * Registering with it in another workspace joins the same device there.
@@ -2873,6 +2889,7 @@ var deviceHeartbeatSchema = z14.object({
2873
2889
  failedDeviceCommands: z14.array(z14.object({ id: z14.uuid(), error: z14.string().max(500) })).max(100).optional(),
2874
2890
  harnesses: z14.array(harnessInfoSchema).max(20),
2875
2891
  computerUse: deviceComputerCapability.optional(),
2892
+ runner: deviceRunnerCapability.optional(),
2876
2893
  deviceType: z14.enum(["laptop", "server"]).optional(),
2877
2894
  runs: z14.array(heartbeatRunSchema).max(500),
2878
2895
  worktreeDiskBytes: z14.number().int().nonnegative(),
@@ -3681,6 +3698,9 @@ var nativeBrokerContextSchema = z22.object({
3681
3698
  plan: z22.string().max(40).optional(),
3682
3699
  expiresAt: z22.iso.datetime()
3683
3700
  }).strict();
3701
+ var nativeLeaseSchema = nativeBrokerContextSchema.extend({
3702
+ accessToken: z22.string().min(1).max(32768).regex(/^[^\r\n\0]+$/)
3703
+ }).strict();
3684
3704
 
3685
3705
  // src/login.ts
3686
3706
  import { z as z27 } from "zod";
@@ -3706,7 +3726,7 @@ var ServerUnreachableError = class extends DaemonError {
3706
3726
  // package.json
3707
3727
  var package_default = {
3708
3728
  name: "@mikka/daemon",
3709
- version: "0.0.113",
3729
+ version: "0.0.115",
3710
3730
  description: "Local Mikka daemon: runs agents through the user's own CLIs",
3711
3731
  type: "module",
3712
3732
  private: true,
@@ -3738,7 +3758,8 @@ var package_default = {
3738
3758
  build: "node scripts/build.mjs",
3739
3759
  "test:package": "node --test test/package.test.mjs",
3740
3760
  "test:repository-identity": "node --experimental-strip-types --test test/repository-identity-pure.node-test.ts",
3741
- "test:github-credentials": "node --test test/github-credentials.node-test.mjs"
3761
+ "test:github-credentials": "node --test test/github-credentials.node-test.mjs",
3762
+ "test:run-container": "node --import tsx --test --test-timeout=900000 test/run-container.docker-test.ts"
3742
3763
  },
3743
3764
  dependencies: {
3744
3765
  "@agentclientprotocol/sdk": "1.9.0",
@@ -3765,7 +3786,7 @@ var package_default = {
3765
3786
  engines: {
3766
3787
  node: ">=24"
3767
3788
  },
3768
- gitHead: "aaeb12ba1c18c1b1212089f956f9469c3c987929"
3789
+ gitHead: "359ba1cd2bc68cbb7b92e957579690d9f43878b8"
3769
3790
  };
3770
3791
 
3771
3792
  // src/paths.ts