@aspectlylabs/mikka 0.0.173 → 0.0.175

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/cli.js CHANGED
@@ -4480,7 +4480,7 @@ import { join as join4 } from "node:path";
4480
4480
  // package.json
4481
4481
  var package_default = {
4482
4482
  name: "@mikka/daemon",
4483
- version: "0.0.173",
4483
+ version: "0.0.175",
4484
4484
  description: "Local Mikka daemon: runs agents through the user's own CLIs",
4485
4485
  type: "module",
4486
4486
  private: true,
@@ -4540,7 +4540,7 @@ var package_default = {
4540
4540
  engines: {
4541
4541
  node: ">=24"
4542
4542
  },
4543
- gitHead: "f0f4857928d1cfc385e5087b443f6c740b47727d"
4543
+ gitHead: "40c2d30f5dcc962b55413f8aef96f760b17b7abc"
4544
4544
  };
4545
4545
 
4546
4546
  // src/paths.ts
@@ -6481,12 +6481,12 @@ var WorktreeManager = class {
6481
6481
  * through a ref of the run's own (FETCH_HEAD is shared by concurrent
6482
6482
  * runs), dropped again once read.
6483
6483
  */
6484
- async fetchBranch(repoPath, remote, branch, runId) {
6484
+ async fetchBranch(repoPath, remote, branch, runId, env = {}) {
6485
6485
  await assertBranchName(branch);
6486
6486
  const ref = `refs/mikka/fetch/${assertSafeId("run id", runId)}`;
6487
6487
  const git2 = (args, timeout) => execa2("git", [...FETCH_GIT, ...args], {
6488
6488
  cwd: repoPath,
6489
- env: { ...process.env, GIT_TERMINAL_PROMPT: "0" },
6489
+ env: { ...process.env, ...env, GIT_TERMINAL_PROMPT: "0" },
6490
6490
  stdin: "ignore",
6491
6491
  timeout
6492
6492
  });
@@ -7015,6 +7015,22 @@ exec env NODE_USE_ENV_PROXY=1 ${process.versions.electron ? "ELECTRON_RUN_AS_NOD
7015
7015
  GIT_COMMITTER_EMAIL: "agent@mikka.invalid"
7016
7016
  };
7017
7017
  }
7018
+ async function withRunGitCredentials(assignment, privateDir, work) {
7019
+ if (!assignment.github || !assignment.mcp) return work({});
7020
+ mkdirSync6(privateDir, { recursive: true, mode: 448 });
7021
+ const dir = mkdtempSync2(join9(privateDir, "github-fetch-"));
7022
+ try {
7023
+ let env = {};
7024
+ try {
7025
+ env = prepareGitHubEnvironment(dir, { ...assignment.github, runToken: assignment.mcp.token, issueId: assignment.issueId }, process.env.PATH ?? "");
7026
+ } catch {
7027
+ return await work({});
7028
+ }
7029
+ return await work(Object.fromEntries(Object.entries(env).filter(([key2]) => key2.startsWith("GIT_CONFIG_") || key2 === "GIT_TERMINAL_PROMPT")));
7030
+ } finally {
7031
+ rmSync6(dir, { recursive: true, force: true });
7032
+ }
7033
+ }
7018
7034
  async function agentPublishedReceipt(input) {
7019
7035
  mkdirSync6(input.privateDir, { recursive: true, mode: 448 });
7020
7036
  const receiptDir = mkdtempSync2(join9(input.privateDir, "github-receipt-"));
@@ -11818,6 +11834,7 @@ function createRunMasker(secrets) {
11818
11834
  // src/runs/supervisor.ts
11819
11835
  import { createHash as createHash6, randomUUID as randomUUID6 } from "node:crypto";
11820
11836
  import { join as join28, resolve as resolve11 } from "node:path";
11837
+ import { tmpdir as tmpdir4 } from "node:os";
11821
11838
  import { execa as execa13 } from "execa";
11822
11839
 
11823
11840
  // src/agents/checkpoint.ts
@@ -12849,11 +12866,16 @@ var RunSupervisor = class {
12849
12866
  const base = await this.deps.baseRef(assignment);
12850
12867
  if (!branch || !pushDecision(runPolicy(assignment.policy), repo.push?.approved === true).push) return base;
12851
12868
  try {
12852
- return await this.deps.worktrees.fetchBranch(
12853
- repo.path,
12854
- repo.push?.remote ?? "origin",
12855
- branch,
12856
- runId
12869
+ return await withRunGitCredentials(
12870
+ assignment,
12871
+ runPaths(this.deps.adapterStateDir ?? join28(tmpdir4(), "mikka-run-state"), runId).privateDir,
12872
+ (env) => this.deps.worktrees.fetchBranch(
12873
+ repo.path,
12874
+ repo.push?.remote ?? "origin",
12875
+ branch,
12876
+ runId,
12877
+ env
12878
+ )
12857
12879
  );
12858
12880
  } catch (error) {
12859
12881
  this.deps.log.info(
@@ -13411,26 +13433,26 @@ var RepositoryCache = class {
13411
13433
  return path;
13412
13434
  }
13413
13435
  /** Serialize clone/fetch against the same cache, including other processes. */
13414
- async prepare(remoteUrl, signal) {
13436
+ async prepare(remoteUrl, signal, env = {}) {
13415
13437
  signal?.throwIfAborted();
13416
13438
  const { remoteUrl: remote } = normalizeRepository(remoteUrl, { allowFile: this.allowFile });
13417
13439
  const path = this.pathFor(remote);
13418
13440
  this.ensureParents(dirname14(path));
13419
13441
  const release = await this.lock(path, signal);
13420
13442
  try {
13421
- return await withRepoConfig(path, () => this.update(path, remote, signal));
13443
+ return await withRepoConfig(path, () => this.update(path, remote, signal, env));
13422
13444
  } finally {
13423
13445
  await release();
13424
13446
  }
13425
13447
  }
13426
- async update(path, remote, signal) {
13448
+ async update(path, remote, signal, env = {}) {
13427
13449
  signal?.throwIfAborted();
13428
13450
  const git2 = (args, cwd) => execa14("git", [
13429
13451
  ...FETCH_GIT,
13430
13452
  "-c",
13431
13453
  `protocol.file.allow=${this.allowFile ? "always" : "never"}`,
13432
13454
  ...args
13433
- ], { cwd, env: { ...process.env, GIT_TERMINAL_PROMPT: "0" }, stdin: "ignore", timeout: FETCH_TIMEOUT_MS, cancelSignal: signal, killDescendants: true });
13455
+ ], { cwd, env: { ...process.env, ...env, GIT_TERMINAL_PROMPT: "0" }, stdin: "ignore", timeout: FETCH_TIMEOUT_MS, cancelSignal: signal, killDescendants: true });
13434
13456
  if (!existsSync7(path)) {
13435
13457
  const temporary = `${path}.clone-${randomUUID7()}`;
13436
13458
  try {
@@ -15094,7 +15116,11 @@ var Daemon = class {
15094
15116
  } : void 0,
15095
15117
  repository: (assignment) => this.repository(assignment),
15096
15118
  prepareRepository: async (assignment, signal) => {
15097
- if (assignment.remoteUrl) await this.repositories.prepare(assignment.remoteUrl, signal);
15119
+ if (assignment.remoteUrl) await withRunGitCredentials(
15120
+ assignment,
15121
+ runPaths(this.paths.adapterState, assignment.runId).privateDir,
15122
+ (env) => this.repositories.prepare(assignment.remoteUrl, signal, env)
15123
+ );
15098
15124
  },
15099
15125
  baseRef: (assignment) => assignment.remoteUrl ? this.repositories.baseRef(assignment.remoteUrl, assignment.baseBranch) : Promise.resolve(assignment.baseBranch ?? "HEAD"),
15100
15126
  log: this.log,
package/client.js CHANGED
@@ -3741,7 +3741,7 @@ import { join } from "node:path";
3741
3741
  // package.json
3742
3742
  var package_default = {
3743
3743
  name: "@mikka/daemon",
3744
- version: "0.0.173",
3744
+ version: "0.0.175",
3745
3745
  description: "Local Mikka daemon: runs agents through the user's own CLIs",
3746
3746
  type: "module",
3747
3747
  private: true,
@@ -3801,7 +3801,7 @@ var package_default = {
3801
3801
  engines: {
3802
3802
  node: ">=24"
3803
3803
  },
3804
- gitHead: "f0f4857928d1cfc385e5087b443f6c740b47727d"
3804
+ gitHead: "40c2d30f5dcc962b55413f8aef96f760b17b7abc"
3805
3805
  };
3806
3806
 
3807
3807
  // src/paths.ts
package/http-link.js CHANGED
@@ -4175,7 +4175,7 @@ var InvalidIdError = class extends DaemonError {
4175
4175
  // package.json
4176
4176
  var package_default = {
4177
4177
  name: "@mikka/daemon",
4178
- version: "0.0.173",
4178
+ version: "0.0.175",
4179
4179
  description: "Local Mikka daemon: runs agents through the user's own CLIs",
4180
4180
  type: "module",
4181
4181
  private: true,
@@ -4235,7 +4235,7 @@ var package_default = {
4235
4235
  engines: {
4236
4236
  node: ">=24"
4237
4237
  },
4238
- gitHead: "f0f4857928d1cfc385e5087b443f6c740b47727d"
4238
+ gitHead: "40c2d30f5dcc962b55413f8aef96f760b17b7abc"
4239
4239
  };
4240
4240
 
4241
4241
  // src/paths.ts
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.173",
3751
+ version: "0.0.175",
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: "f0f4857928d1cfc385e5087b443f6c740b47727d"
3811
+ gitHead: "40c2d30f5dcc962b55413f8aef96f760b17b7abc"
3812
3812
  };
3813
3813
 
3814
3814
  // src/paths.ts
package/main.js CHANGED
@@ -2785,12 +2785,12 @@ var WorktreeManager = class {
2785
2785
  * through a ref of the run's own (FETCH_HEAD is shared by concurrent
2786
2786
  * runs), dropped again once read.
2787
2787
  */
2788
- async fetchBranch(repoPath, remote, branch, runId) {
2788
+ async fetchBranch(repoPath, remote, branch, runId, env = {}) {
2789
2789
  await assertBranchName(branch);
2790
2790
  const ref = `refs/mikka/fetch/${assertSafeId("run id", runId)}`;
2791
2791
  const git2 = (args, timeout) => execa2("git", [...FETCH_GIT, ...args], {
2792
2792
  cwd: repoPath,
2793
- env: { ...process.env, GIT_TERMINAL_PROMPT: "0" },
2793
+ env: { ...process.env, ...env, GIT_TERMINAL_PROMPT: "0" },
2794
2794
  stdin: "ignore",
2795
2795
  timeout
2796
2796
  });
@@ -3319,6 +3319,22 @@ exec env NODE_USE_ENV_PROXY=1 ${process.versions.electron ? "ELECTRON_RUN_AS_NOD
3319
3319
  GIT_COMMITTER_EMAIL: "agent@mikka.invalid"
3320
3320
  };
3321
3321
  }
3322
+ async function withRunGitCredentials(assignment, privateDir, work) {
3323
+ if (!assignment.github || !assignment.mcp) return work({});
3324
+ mkdirSync4(privateDir, { recursive: true, mode: 448 });
3325
+ const dir = mkdtempSync2(join4(privateDir, "github-fetch-"));
3326
+ try {
3327
+ let env = {};
3328
+ try {
3329
+ env = prepareGitHubEnvironment(dir, { ...assignment.github, runToken: assignment.mcp.token, issueId: assignment.issueId }, process.env.PATH ?? "");
3330
+ } catch {
3331
+ return await work({});
3332
+ }
3333
+ return await work(Object.fromEntries(Object.entries(env).filter(([key2]) => key2.startsWith("GIT_CONFIG_") || key2 === "GIT_TERMINAL_PROMPT")));
3334
+ } finally {
3335
+ rmSync5(dir, { recursive: true, force: true });
3336
+ }
3337
+ }
3322
3338
  async function agentPublishedReceipt(input) {
3323
3339
  mkdirSync4(input.privateDir, { recursive: true, mode: 448 });
3324
3340
  const receiptDir = mkdtempSync2(join4(input.privateDir, "github-receipt-"));
@@ -3785,7 +3801,7 @@ import { join as join5 } from "node:path";
3785
3801
  // package.json
3786
3802
  var package_default = {
3787
3803
  name: "@mikka/daemon",
3788
- version: "0.0.173",
3804
+ version: "0.0.175",
3789
3805
  description: "Local Mikka daemon: runs agents through the user's own CLIs",
3790
3806
  type: "module",
3791
3807
  private: true,
@@ -3845,7 +3861,7 @@ var package_default = {
3845
3861
  engines: {
3846
3862
  node: ">=24"
3847
3863
  },
3848
- gitHead: "f0f4857928d1cfc385e5087b443f6c740b47727d"
3864
+ gitHead: "40c2d30f5dcc962b55413f8aef96f760b17b7abc"
3849
3865
  };
3850
3866
 
3851
3867
  // src/paths.ts
@@ -10872,6 +10888,7 @@ function createRunMasker(secrets) {
10872
10888
  // src/runs/supervisor.ts
10873
10889
  import { createHash as createHash6, randomUUID as randomUUID5 } from "node:crypto";
10874
10890
  import { join as join28, resolve as resolve11 } from "node:path";
10891
+ import { tmpdir as tmpdir4 } from "node:os";
10875
10892
  import { execa as execa13 } from "execa";
10876
10893
 
10877
10894
  // src/agents/checkpoint.ts
@@ -11903,11 +11920,16 @@ var RunSupervisor = class {
11903
11920
  const base = await this.deps.baseRef(assignment);
11904
11921
  if (!branch || !pushDecision(runPolicy(assignment.policy), repo.push?.approved === true).push) return base;
11905
11922
  try {
11906
- return await this.deps.worktrees.fetchBranch(
11907
- repo.path,
11908
- repo.push?.remote ?? "origin",
11909
- branch,
11910
- runId
11923
+ return await withRunGitCredentials(
11924
+ assignment,
11925
+ runPaths(this.deps.adapterStateDir ?? join28(tmpdir4(), "mikka-run-state"), runId).privateDir,
11926
+ (env) => this.deps.worktrees.fetchBranch(
11927
+ repo.path,
11928
+ repo.push?.remote ?? "origin",
11929
+ branch,
11930
+ runId,
11931
+ env
11932
+ )
11911
11933
  );
11912
11934
  } catch (error) {
11913
11935
  this.deps.log.info(
@@ -12477,26 +12499,26 @@ var RepositoryCache = class {
12477
12499
  return path;
12478
12500
  }
12479
12501
  /** Serialize clone/fetch against the same cache, including other processes. */
12480
- async prepare(remoteUrl, signal) {
12502
+ async prepare(remoteUrl, signal, env = {}) {
12481
12503
  signal?.throwIfAborted();
12482
12504
  const { remoteUrl: remote } = normalizeRepository(remoteUrl, { allowFile: this.allowFile });
12483
12505
  const path = this.pathFor(remote);
12484
12506
  this.ensureParents(dirname14(path));
12485
12507
  const release = await this.lock(path, signal);
12486
12508
  try {
12487
- return await withRepoConfig(path, () => this.update(path, remote, signal));
12509
+ return await withRepoConfig(path, () => this.update(path, remote, signal, env));
12488
12510
  } finally {
12489
12511
  await release();
12490
12512
  }
12491
12513
  }
12492
- async update(path, remote, signal) {
12514
+ async update(path, remote, signal, env = {}) {
12493
12515
  signal?.throwIfAborted();
12494
12516
  const git2 = (args, cwd) => execa14("git", [
12495
12517
  ...FETCH_GIT,
12496
12518
  "-c",
12497
12519
  `protocol.file.allow=${this.allowFile ? "always" : "never"}`,
12498
12520
  ...args
12499
- ], { cwd, env: { ...process.env, GIT_TERMINAL_PROMPT: "0" }, stdin: "ignore", timeout: FETCH_TIMEOUT_MS, cancelSignal: signal, killDescendants: true });
12521
+ ], { cwd, env: { ...process.env, ...env, GIT_TERMINAL_PROMPT: "0" }, stdin: "ignore", timeout: FETCH_TIMEOUT_MS, cancelSignal: signal, killDescendants: true });
12500
12522
  if (!existsSync7(path)) {
12501
12523
  const temporary = `${path}.clone-${randomUUID6()}`;
12502
12524
  try {
@@ -14160,7 +14182,11 @@ var Daemon = class {
14160
14182
  } : void 0,
14161
14183
  repository: (assignment) => this.repository(assignment),
14162
14184
  prepareRepository: async (assignment, signal) => {
14163
- if (assignment.remoteUrl) await this.repositories.prepare(assignment.remoteUrl, signal);
14185
+ if (assignment.remoteUrl) await withRunGitCredentials(
14186
+ assignment,
14187
+ runPaths(this.paths.adapterState, assignment.runId).privateDir,
14188
+ (env) => this.repositories.prepare(assignment.remoteUrl, signal, env)
14189
+ );
14164
14190
  },
14165
14191
  baseRef: (assignment) => assignment.remoteUrl ? this.repositories.baseRef(assignment.remoteUrl, assignment.baseBranch) : Promise.resolve(assignment.baseBranch ?? "HEAD"),
14166
14192
  log: this.log,
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "version": 1,
3
- "sourceSha": "f0f4857928d1cfc385e5087b443f6c740b47727d",
3
+ "sourceSha": "40c2d30f5dcc962b55413f8aef96f760b17b7abc",
4
4
  "repository": "alexj11324/Mikka",
5
- "buildRunId": "41308067207",
5
+ "buildRunId": "41308305346",
6
6
  "buildKind": "github-actions-main",
7
7
  "sourceLockSha256": "c99f1e4f641d8e004cfe807653478e10f91e53fcf47102add5f4c154cdc1cb57",
8
- "createdAt": "2026-11-01T13:04:13.631Z",
8
+ "createdAt": "2026-11-01T13:18:13.036Z",
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": 650230,
44
- "sha256": "666643726eeb6514a80ab849b658f35199aaebd0d0967ea9a9aa341d5d57ec6e"
43
+ "size": 651388,
44
+ "sha256": "daef13a7ea3acc1d13e5b7100ff3334bf537ac221ba7f56a17789d0e1e03998d"
45
45
  },
46
46
  {
47
47
  "path": "client.js",
48
48
  "size": 141206,
49
- "sha256": "32a6dcff6ecb0b1f2f3378db5ba1cc5b555168d484def492360ef7f9345ad298"
49
+ "sha256": "b00cfc25e6645a6031fa47f48bc95a49a6ecba9320f38a1792c7d440f0f56166"
50
50
  },
51
51
  {
52
52
  "path": "computer/driver.mjs",
@@ -176,7 +176,7 @@
176
176
  {
177
177
  "path": "http-link.js",
178
178
  "size": 184199,
179
- "sha256": "6df0de0bd6a3afd4c5ab74d3f8d63830ce3c7b049675b7769cd2373d7df4adfc"
179
+ "sha256": "ae2a8f51eb5531129152ddc306fb98ef772e2e7885b8024b18845de592cb6a0c"
180
180
  },
181
181
  {
182
182
  "path": "log.js",
@@ -186,12 +186,12 @@
186
186
  {
187
187
  "path": "login.js",
188
188
  "size": 146084,
189
- "sha256": "d34c26ba6b9f0ad87edeebab91df1655c9d3b1dd32f729cc61382e52731518e2"
189
+ "sha256": "05708133b289bd62392516d43de0683b9fbf33ad82a3ed62e6b7faa9d59bee58"
190
190
  },
191
191
  {
192
192
  "path": "main.js",
193
- "size": 595447,
194
- "sha256": "464d5d501c71a1bbe4a38712465244d9aec70c125e75b124ff120d61c1b6bc83"
193
+ "size": 596605,
194
+ "sha256": "c72859a84fff5a9c748ee180dffd528d8ce111dc130a286cbea0704da1d1e01a"
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": 650246,
204
- "sha256": "a06968aefae3c1ccd33dd43f165d9492119d21db921dee708a7a0896d09a734f"
203
+ "size": 651404,
204
+ "sha256": "a3d80073e818524231dfad412e8177da0e0351dbcfa48804d139ad97baf4a347"
205
205
  },
206
206
  {
207
207
  "path": "npm-shrinkwrap.json",
208
208
  "size": 78117,
209
- "sha256": "65a4dfcacfbb51ec07e851a08615dea08e603bca3ab661e7bb210aaeac8a395a"
209
+ "sha256": "82de8018a77ff842026eeab967ef08ca3a1b3d26ee38007639e959cc7b98278c"
210
210
  },
211
211
  {
212
212
  "path": "package.json",
213
213
  "size": 1247,
214
- "sha256": "b04797960d02bec545262483034f898bd2ef46bc2a2ca23fb8e8d4f48bc66c7f"
214
+ "sha256": "24afc353aefc415a721fb3095c6153322214e5962e310522769eadc18c7cb1ee"
215
215
  },
216
216
  {
217
217
  "path": "paths.js",
218
218
  "size": 4138,
219
- "sha256": "16aaad5f1e7e7b699fa646821418d2136f6c40dc4d7dd63e838240c8e3f75e89"
219
+ "sha256": "26ea39ddbb4b03e8a123436cdf1fb7591393a4eb49480ad91d479fbf19a9b109"
220
220
  },
221
221
  {
222
222
  "path": "run-sandbox-worker.mjs",
@@ -231,7 +231,7 @@
231
231
  {
232
232
  "path": "sbom.cdx.json",
233
233
  "size": 144314,
234
- "sha256": "ae89074dbaea988c336c6016873da9ce849d258390fdc794ea172d1cbf7b562f"
234
+ "sha256": "d35351848c82b0aadf26a215009d9313c8416b8d7b755cd42fc6049fd8f83504"
235
235
  }
236
236
  ]
237
237
  }
package/mikka.js CHANGED
@@ -4481,7 +4481,7 @@ import { join as join4 } from "node:path";
4481
4481
  // package.json
4482
4482
  var package_default = {
4483
4483
  name: "@mikka/daemon",
4484
- version: "0.0.173",
4484
+ version: "0.0.175",
4485
4485
  description: "Local Mikka daemon: runs agents through the user's own CLIs",
4486
4486
  type: "module",
4487
4487
  private: true,
@@ -4541,7 +4541,7 @@ var package_default = {
4541
4541
  engines: {
4542
4542
  node: ">=24"
4543
4543
  },
4544
- gitHead: "f0f4857928d1cfc385e5087b443f6c740b47727d"
4544
+ gitHead: "40c2d30f5dcc962b55413f8aef96f760b17b7abc"
4545
4545
  };
4546
4546
 
4547
4547
  // src/paths.ts
@@ -6482,12 +6482,12 @@ var WorktreeManager = class {
6482
6482
  * through a ref of the run's own (FETCH_HEAD is shared by concurrent
6483
6483
  * runs), dropped again once read.
6484
6484
  */
6485
- async fetchBranch(repoPath, remote, branch, runId) {
6485
+ async fetchBranch(repoPath, remote, branch, runId, env = {}) {
6486
6486
  await assertBranchName(branch);
6487
6487
  const ref = `refs/mikka/fetch/${assertSafeId("run id", runId)}`;
6488
6488
  const git2 = (args, timeout) => execa2("git", [...FETCH_GIT, ...args], {
6489
6489
  cwd: repoPath,
6490
- env: { ...process.env, GIT_TERMINAL_PROMPT: "0" },
6490
+ env: { ...process.env, ...env, GIT_TERMINAL_PROMPT: "0" },
6491
6491
  stdin: "ignore",
6492
6492
  timeout
6493
6493
  });
@@ -7016,6 +7016,22 @@ exec env NODE_USE_ENV_PROXY=1 ${process.versions.electron ? "ELECTRON_RUN_AS_NOD
7016
7016
  GIT_COMMITTER_EMAIL: "agent@mikka.invalid"
7017
7017
  };
7018
7018
  }
7019
+ async function withRunGitCredentials(assignment, privateDir, work) {
7020
+ if (!assignment.github || !assignment.mcp) return work({});
7021
+ mkdirSync6(privateDir, { recursive: true, mode: 448 });
7022
+ const dir = mkdtempSync2(join9(privateDir, "github-fetch-"));
7023
+ try {
7024
+ let env = {};
7025
+ try {
7026
+ env = prepareGitHubEnvironment(dir, { ...assignment.github, runToken: assignment.mcp.token, issueId: assignment.issueId }, process.env.PATH ?? "");
7027
+ } catch {
7028
+ return await work({});
7029
+ }
7030
+ return await work(Object.fromEntries(Object.entries(env).filter(([key2]) => key2.startsWith("GIT_CONFIG_") || key2 === "GIT_TERMINAL_PROMPT")));
7031
+ } finally {
7032
+ rmSync6(dir, { recursive: true, force: true });
7033
+ }
7034
+ }
7019
7035
  async function agentPublishedReceipt(input) {
7020
7036
  mkdirSync6(input.privateDir, { recursive: true, mode: 448 });
7021
7037
  const receiptDir = mkdtempSync2(join9(input.privateDir, "github-receipt-"));
@@ -11819,6 +11835,7 @@ function createRunMasker(secrets) {
11819
11835
  // src/runs/supervisor.ts
11820
11836
  import { createHash as createHash6, randomUUID as randomUUID6 } from "node:crypto";
11821
11837
  import { join as join28, resolve as resolve11 } from "node:path";
11838
+ import { tmpdir as tmpdir4 } from "node:os";
11822
11839
  import { execa as execa13 } from "execa";
11823
11840
 
11824
11841
  // src/agents/checkpoint.ts
@@ -12850,11 +12867,16 @@ var RunSupervisor = class {
12850
12867
  const base = await this.deps.baseRef(assignment);
12851
12868
  if (!branch || !pushDecision(runPolicy(assignment.policy), repo.push?.approved === true).push) return base;
12852
12869
  try {
12853
- return await this.deps.worktrees.fetchBranch(
12854
- repo.path,
12855
- repo.push?.remote ?? "origin",
12856
- branch,
12857
- runId
12870
+ return await withRunGitCredentials(
12871
+ assignment,
12872
+ runPaths(this.deps.adapterStateDir ?? join28(tmpdir4(), "mikka-run-state"), runId).privateDir,
12873
+ (env) => this.deps.worktrees.fetchBranch(
12874
+ repo.path,
12875
+ repo.push?.remote ?? "origin",
12876
+ branch,
12877
+ runId,
12878
+ env
12879
+ )
12858
12880
  );
12859
12881
  } catch (error) {
12860
12882
  this.deps.log.info(
@@ -13412,26 +13434,26 @@ var RepositoryCache = class {
13412
13434
  return path;
13413
13435
  }
13414
13436
  /** Serialize clone/fetch against the same cache, including other processes. */
13415
- async prepare(remoteUrl, signal) {
13437
+ async prepare(remoteUrl, signal, env = {}) {
13416
13438
  signal?.throwIfAborted();
13417
13439
  const { remoteUrl: remote } = normalizeRepository(remoteUrl, { allowFile: this.allowFile });
13418
13440
  const path = this.pathFor(remote);
13419
13441
  this.ensureParents(dirname14(path));
13420
13442
  const release = await this.lock(path, signal);
13421
13443
  try {
13422
- return await withRepoConfig(path, () => this.update(path, remote, signal));
13444
+ return await withRepoConfig(path, () => this.update(path, remote, signal, env));
13423
13445
  } finally {
13424
13446
  await release();
13425
13447
  }
13426
13448
  }
13427
- async update(path, remote, signal) {
13449
+ async update(path, remote, signal, env = {}) {
13428
13450
  signal?.throwIfAborted();
13429
13451
  const git2 = (args, cwd) => execa14("git", [
13430
13452
  ...FETCH_GIT,
13431
13453
  "-c",
13432
13454
  `protocol.file.allow=${this.allowFile ? "always" : "never"}`,
13433
13455
  ...args
13434
- ], { cwd, env: { ...process.env, GIT_TERMINAL_PROMPT: "0" }, stdin: "ignore", timeout: FETCH_TIMEOUT_MS, cancelSignal: signal, killDescendants: true });
13456
+ ], { cwd, env: { ...process.env, ...env, GIT_TERMINAL_PROMPT: "0" }, stdin: "ignore", timeout: FETCH_TIMEOUT_MS, cancelSignal: signal, killDescendants: true });
13435
13457
  if (!existsSync7(path)) {
13436
13458
  const temporary = `${path}.clone-${randomUUID7()}`;
13437
13459
  try {
@@ -15095,7 +15117,11 @@ var Daemon = class {
15095
15117
  } : void 0,
15096
15118
  repository: (assignment) => this.repository(assignment),
15097
15119
  prepareRepository: async (assignment, signal) => {
15098
- if (assignment.remoteUrl) await this.repositories.prepare(assignment.remoteUrl, signal);
15120
+ if (assignment.remoteUrl) await withRunGitCredentials(
15121
+ assignment,
15122
+ runPaths(this.paths.adapterState, assignment.runId).privateDir,
15123
+ (env) => this.repositories.prepare(assignment.remoteUrl, signal, env)
15124
+ );
15099
15125
  },
15100
15126
  baseRef: (assignment) => assignment.remoteUrl ? this.repositories.baseRef(assignment.remoteUrl, assignment.baseBranch) : Promise.resolve(assignment.baseBranch ?? "HEAD"),
15101
15127
  log: this.log,
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@aspectlylabs/mikka",
3
- "version": "0.0.173",
3
+ "version": "0.0.175",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@aspectlylabs/mikka",
9
- "version": "0.0.173",
9
+ "version": "0.0.175",
10
10
  "license": "AGPL-3.0-only",
11
11
  "dependencies": {
12
12
  "@agentclientprotocol/sdk": "1.9.0",
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@aspectlylabs/mikka",
3
- "version": "0.0.173",
3
+ "version": "0.0.175",
4
4
  "description": "Local Mikka daemon: runs agents through the user's own CLIs",
5
- "gitHead": "f0f4857928d1cfc385e5087b443f6c740b47727d",
5
+ "gitHead": "40c2d30f5dcc962b55413f8aef96f760b17b7abc",
6
6
  "type": "module",
7
7
  "private": false,
8
8
  "license": "AGPL-3.0-only",
package/paths.js CHANGED
@@ -6,7 +6,7 @@ import { join } from "node:path";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@mikka/daemon",
9
- version: "0.0.173",
9
+ version: "0.0.175",
10
10
  description: "Local Mikka daemon: runs agents through the user's own CLIs",
11
11
  type: "module",
12
12
  private: true,
@@ -66,7 +66,7 @@ var package_default = {
66
66
  engines: {
67
67
  node: ">=24"
68
68
  },
69
- gitHead: "f0f4857928d1cfc385e5087b443f6c740b47727d"
69
+ gitHead: "40c2d30f5dcc962b55413f8aef96f760b17b7abc"
70
70
  };
71
71
 
72
72
  // src/paths.ts
package/sbom.cdx.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
3
3
  "bomFormat": "CycloneDX",
4
4
  "specVersion": "1.5",
5
- "serialNumber": "urn:uuid:57e9fca5-ac79-4f36-8d0a-71d72bbad1a7",
5
+ "serialNumber": "urn:uuid:94bf9212-c8f7-460f-a995-2830e655ec28",
6
6
  "version": 1,
7
7
  "metadata": {
8
- "timestamp": "2026-11-01T13:04:12.654Z",
8
+ "timestamp": "2026-11-01T13:18:12.223Z",
9
9
  "lifecycles": [
10
10
  {
11
11
  "phase": "pre-build"
@@ -19,13 +19,13 @@
19
19
  }
20
20
  ],
21
21
  "component": {
22
- "bom-ref": "@aspectlylabs/mikka@0.0.173",
22
+ "bom-ref": "@aspectlylabs/mikka@0.0.175",
23
23
  "type": "library",
24
- "name": ".retained-build-lJvCJN",
25
- "version": "0.0.173",
24
+ "name": ".retained-build-4JCFyC",
25
+ "version": "0.0.175",
26
26
  "scope": "required",
27
27
  "description": "Local Mikka daemon: runs agents through the user's own CLIs",
28
- "purl": "pkg:npm/%40aspectlylabs/mikka@0.0.173",
28
+ "purl": "pkg:npm/%40aspectlylabs/mikka@0.0.175",
29
29
  "properties": [],
30
30
  "externalReferences": [
31
31
  {
@@ -4627,7 +4627,7 @@
4627
4627
  ],
4628
4628
  "dependencies": [
4629
4629
  {
4630
- "ref": "@aspectlylabs/mikka@0.0.173",
4630
+ "ref": "@aspectlylabs/mikka@0.0.175",
4631
4631
  "dependsOn": [
4632
4632
  "@agentclientprotocol/sdk@1.9.0",
4633
4633
  "@anthropic-ai/claude-agent-sdk@0.3.305",