@aspectlylabs/mikka 0.0.156 → 0.0.158

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/http-link.js CHANGED
@@ -2410,11 +2410,42 @@ function classifyWrite(worktree, target) {
2410
2410
  return ok2 ? "write_in_worktree" : "write_outside_repo";
2411
2411
  }
2412
2412
 
2413
+ // src/agents/run-sandbox-launcher.ts
2414
+ import { isIP } from "node:net";
2415
+ import { NetworkConfigSchema } from "@anthropic-ai/sandbox-runtime";
2416
+ var NETWORK_DECISION_MS = 5 * 6e4;
2417
+ function canonicalHost(host) {
2418
+ if (!host || /[\s\x00-\x1f\x7f%\\/@?#*]/u.test(host)) return;
2419
+ const bare = host.startsWith("[") && host.endsWith("]") ? host.slice(1, -1) : host;
2420
+ if (isIP(bare) === 6) return new URL(`http://[${bare}]`).hostname.slice(1, -1);
2421
+ if (bare.includes(":")) return;
2422
+ try {
2423
+ return new URL(`http://${bare}`).hostname.toLowerCase();
2424
+ } catch {
2425
+ return void 0;
2426
+ }
2427
+ }
2428
+ function matchesRunSandboxDomain(request, domains) {
2429
+ const host = canonicalHost(request.host);
2430
+ if (!host || !Number.isInteger(request.port) || request.port < 1 || request.port > 65535) return false;
2431
+ return domains.some((entry) => {
2432
+ if (entry === "*") return true;
2433
+ const parts = /^(\[[^\]]+\]|[^:]+?)(?::([1-9][0-9]{0,4}))?$/u.exec(entry);
2434
+ if (!parts || parts[2] !== void 0 && (Number(parts[2]) > 65535 || Number(parts[2]) !== request.port)) return false;
2435
+ const wildcard = parts[1].startsWith("*.");
2436
+ const pattern = canonicalHost(wildcard ? parts[1].slice(2) : parts[1]);
2437
+ if (!pattern) return false;
2438
+ if (!wildcard) return host === pattern;
2439
+ return !isIP(host) && pattern.includes(".") && host.endsWith(`.${pattern}`);
2440
+ });
2441
+ }
2442
+
2413
2443
  // src/agents/tool-approval-policy.ts
2414
- function toolApprovalDecision(request, policy, worktree, apps = []) {
2444
+ function toolApprovalDecision(request, policy, worktree, apps = [], runHosts = []) {
2415
2445
  if (request.method === "sandbox/network" && policy) {
2416
2446
  const value = request.input;
2417
2447
  if (!value || typeof value.host !== "string" || /[*/:]/.test(value.host) || !networkDomainSchema.safeParse(value.host).success || !Number.isInteger(value.port) || Number(value.port) < 1 || Number(value.port) > 65535) return "deny";
2448
+ if (policy.permissions.network === "ask" && matchesRunSandboxDomain({ host: value.host, port: Number(value.port) }, [...policy.networkAllow, ...runHosts])) return "allow";
2418
2449
  return policy.permissions.network;
2419
2450
  }
2420
2451
  if (request.method.startsWith("cli/") && policy && worktree) {
@@ -4144,7 +4175,7 @@ var InvalidIdError = class extends DaemonError {
4144
4175
  // package.json
4145
4176
  var package_default = {
4146
4177
  name: "@mikka/daemon",
4147
- version: "0.0.156",
4178
+ version: "0.0.158",
4148
4179
  description: "Local Mikka daemon: runs agents through the user's own CLIs",
4149
4180
  type: "module",
4150
4181
  private: true,
@@ -4204,7 +4235,7 @@ var package_default = {
4204
4235
  engines: {
4205
4236
  node: ">=24"
4206
4237
  },
4207
- gitHead: "3fe02256b52ef29ce2581173987f01d3b2054448"
4238
+ gitHead: "5011b7faac02b82a863d07eba4d7180d47fccc2b"
4208
4239
  };
4209
4240
 
4210
4241
  // src/paths.ts
@@ -4429,7 +4460,13 @@ var HttpServerLink = class {
4429
4460
  const response = z26.object({ decision: z26.enum(["pending", "allow", "deny"]) });
4430
4461
  const liveness = new AbortController();
4431
4462
  const gate = new ToolApprovalGate(assignment.runId, {
4432
- permission: (request) => toolApprovalDecision(request, assignment.policy, worktree, runApps(assignment.mcp)?.apps.map((app) => app.name)),
4463
+ permission: (request) => toolApprovalDecision(
4464
+ request,
4465
+ assignment.policy,
4466
+ worktree,
4467
+ runApps(assignment.mcp)?.apps.map((app) => app.name),
4468
+ assignment.github ? [new URL(assignment.github.endpoint).host] : []
4469
+ ),
4433
4470
  // Keep the callback pending at the tool boundary. The adapter's current
4434
4471
  // session and checkpoint remain intact; handback resolves this same call.
4435
4472
  isLive: async () => {
package/login.js CHANGED
@@ -3748,7 +3748,7 @@ var ServerUnreachableError = class extends DaemonError {
3748
3748
  // package.json
3749
3749
  var package_default = {
3750
3750
  name: "@mikka/daemon",
3751
- version: "0.0.156",
3751
+ version: "0.0.158",
3752
3752
  description: "Local Mikka daemon: runs agents through the user's own CLIs",
3753
3753
  type: "module",
3754
3754
  private: true,
@@ -3808,7 +3808,7 @@ var package_default = {
3808
3808
  engines: {
3809
3809
  node: ">=24"
3810
3810
  },
3811
- gitHead: "3fe02256b52ef29ce2581173987f01d3b2054448"
3811
+ gitHead: "5011b7faac02b82a863d07eba4d7180d47fccc2b"
3812
3812
  };
3813
3813
 
3814
3814
  // src/paths.ts
@@ -3817,6 +3817,10 @@ var DAEMON_VERSION = package_default.version;
3817
3817
  // src/server-link-http.ts
3818
3818
  import { z as z26 } from "zod";
3819
3819
 
3820
+ // src/agents/run-sandbox-launcher.ts
3821
+ import { NetworkConfigSchema } from "@anthropic-ai/sandbox-runtime";
3822
+ var NETWORK_DECISION_MS = 5 * 6e4;
3823
+
3820
3824
  // ../protocol/src/capture.ts
3821
3825
  import { z as z23 } from "zod";
3822
3826
  var CAPTURE_CONTENT_TYPES = [
package/main.js CHANGED
@@ -3785,7 +3785,7 @@ import { join as join5 } from "node:path";
3785
3785
  // package.json
3786
3786
  var package_default = {
3787
3787
  name: "@mikka/daemon",
3788
- version: "0.0.156",
3788
+ version: "0.0.158",
3789
3789
  description: "Local Mikka daemon: runs agents through the user's own CLIs",
3790
3790
  type: "module",
3791
3791
  private: true,
@@ -3845,7 +3845,7 @@ var package_default = {
3845
3845
  engines: {
3846
3846
  node: ">=24"
3847
3847
  },
3848
- gitHead: "3fe02256b52ef29ce2581173987f01d3b2054448"
3848
+ gitHead: "5011b7faac02b82a863d07eba4d7180d47fccc2b"
3849
3849
  };
3850
3850
 
3851
3851
  // src/paths.ts
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "version": 1,
3
- "sourceSha": "3fe02256b52ef29ce2581173987f01d3b2054448",
3
+ "sourceSha": "5011b7faac02b82a863d07eba4d7180d47fccc2b",
4
4
  "repository": "alexj11324/Mikka",
5
- "buildRunId": "41301873626",
5
+ "buildRunId": "41302393087",
6
6
  "buildKind": "github-actions-main",
7
7
  "sourceLockSha256": "c99f1e4f641d8e004cfe807653478e10f91e53fcf47102add5f4c154cdc1cb57",
8
- "createdAt": "2026-11-01T11:34:59.039Z",
8
+ "createdAt": "2026-11-01T11:42:53.862Z",
9
9
  "sbom": "sbom.cdx.json",
10
10
  "files": [
11
11
  {
@@ -40,13 +40,13 @@
40
40
  },
41
41
  {
42
42
  "path": "cli.js",
43
- "size": 649906,
44
- "sha256": "ea0a5d8f7d1729d9a7febf4a1474182ea867594b08bba034046ce9e1660ea88a"
43
+ "size": 650215,
44
+ "sha256": "cfc4375d3e8899a0158acdd1f1657a1a8a9a7a571f6c0e97f3b9a95073ac070f"
45
45
  },
46
46
  {
47
47
  "path": "client.js",
48
48
  "size": 141206,
49
- "sha256": "186de19be0c69837ec16496844d3fce1054404df99236b0c632751ae004a6d9f"
49
+ "sha256": "2cdd4c4f455cb8a479cc8f3cd246bed6fca887dfa7b03930f0de1740606b8357"
50
50
  },
51
51
  {
52
52
  "path": "computer/driver.mjs",
@@ -175,8 +175,8 @@
175
175
  },
176
176
  {
177
177
  "path": "http-link.js",
178
- "size": 182550,
179
- "sha256": "b16fcb4cc7efaeb1d01b7737d7d398736c080e99b77510f42539c00cde8865a7"
178
+ "size": 184199,
179
+ "sha256": "44337947eded390388ea746b45dd2f8fc1337341b55781b781a1137dbf057fca"
180
180
  },
181
181
  {
182
182
  "path": "log.js",
@@ -185,13 +185,13 @@
185
185
  },
186
186
  {
187
187
  "path": "login.js",
188
- "size": 145941,
189
- "sha256": "fc3edd9d7e5c7d59028e288c6f18c1f53380da713b49a63476d0742e2aabf1d0"
188
+ "size": 146084,
189
+ "sha256": "aa4ef0750fb257e5e8acdc9c84dcb2e511897a95b1233f64a08d4a6f251f1198"
190
190
  },
191
191
  {
192
192
  "path": "main.js",
193
193
  "size": 595432,
194
- "sha256": "056bb0f88e08eacfdc643f775a2d101593e0f722d076006515358c05f99f8b90"
194
+ "sha256": "892201d33a9ccb0ade2e140734d66741a999d00db4ca1c0e5267f51d941df4b1"
195
195
  },
196
196
  {
197
197
  "path": "mikka-mcp.mjs",
@@ -200,23 +200,23 @@
200
200
  },
201
201
  {
202
202
  "path": "mikka.js",
203
- "size": 649922,
204
- "sha256": "8e03efbabb2d9a8ff443ebfbab63fd859e4b05fff4340f8543d3003eb0731053"
203
+ "size": 650231,
204
+ "sha256": "2976ffecb0e7b84e62b479ea34ffef69ff7fcb7c4560d8326a881fbd1612300b"
205
205
  },
206
206
  {
207
207
  "path": "npm-shrinkwrap.json",
208
208
  "size": 78117,
209
- "sha256": "7a9077f4872f82c1b74dab4c0d5abe22862bcc4cf0b349560439bd51df7f1c11"
209
+ "sha256": "ffb3b1145474a9ae74dfe5ae6b223c573fe609c723083fb1df5a6303c705e1db"
210
210
  },
211
211
  {
212
212
  "path": "package.json",
213
213
  "size": 1247,
214
- "sha256": "10cd534abaa4aedba3968f2000a3dfe0738ef5af654a76567b15edfbdb9a1db4"
214
+ "sha256": "7b607843a43f5c8c75e42cc9000d87a4d3d073d3825b604d6b7b12cf1586e718"
215
215
  },
216
216
  {
217
217
  "path": "paths.js",
218
218
  "size": 4138,
219
- "sha256": "3f687c02d1b5442dd6243b682e8d2db4902bdf4354e4fe9b9507ff3966b9e27d"
219
+ "sha256": "f77cb303b7bd7a6f1e631fbeffe7bd15025b31611b358fc92f0347d458148661"
220
220
  },
221
221
  {
222
222
  "path": "sandbox.js",
@@ -226,7 +226,7 @@
226
226
  {
227
227
  "path": "sbom.cdx.json",
228
228
  "size": 144314,
229
- "sha256": "93003336a8e6c7f2520b064b5250af5188aad04e25550daee8d6fdf89164ff17"
229
+ "sha256": "01ad52f2e39e913f6787b60ca598da642e94aaa91da6d45f90127c2c78ced0a7"
230
230
  }
231
231
  ]
232
232
  }