Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions packages/amico-run/src/pasqal_verb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
// token appears in the digest, the JSON output, or the launcher argv.
import { spawn } from "node:child_process";
import { existsSync } from "node:fs";
import { homedir } from "node:os";
import { dirname, join, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { amicodeOpsDir } from "./session_retention.js";
import {
pulseSha256,
readDevicePathStatus,
Expand Down Expand Up @@ -55,15 +55,6 @@ function flagValue(argv: string[], name: string): string | undefined {

// ── connector + launcher resolution ───────────────────────────────────────────

/** $AMICODE_OPS_DIR → ~/.amico/amicode — the SAME resolution the fork's
* amicodeOpsDir() and the extension use, so the packaged connector is found
* where it is staged. */
function amicodeOpsDir(env: NodeJS.ProcessEnv): string {
const v = env.AMICODE_OPS_DIR;
if (v && v.trim() !== "") return v;
return join(homedir(), ".amico", "amicode");
}

/** $AMICO_PASQAL_CONNECTOR overrides; default is the staged submit connector. */
function connectorScript(env: NodeJS.ProcessEnv): string {
const v = env.AMICO_PASQAL_CONNECTOR;
Expand Down
11 changes: 3 additions & 8 deletions packages/amico-run/src/solver_mode.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { readFileSync } from "node:fs";
import { homedir } from "node:os";
import { join } from "node:path";
import { amicodeOpsDir } from "./session_retention.js";

// ============================================================================
// The selected solver, read from the extension's solver-mode.json contract.
Expand All @@ -17,13 +17,8 @@ import { join } from "node:path";

export type SolverMode = "piccolo" | "hp";

/** $AMICODE_OPS_DIR → ~/.amico/amicode — the SAME resolution the fork's
* amicodeOpsDir(), the extension, and pasqal_verb.ts use, so we read exactly
* the file the extension wrote. */
function amicodeOpsDir(env: NodeJS.ProcessEnv): string {
const v = env.AMICODE_OPS_DIR;
return v && v.trim() !== "" ? v : join(homedir(), ".amico", "amicode");
}
// amicodeOpsDir (session_retention.ts) is the amico-run resolution: $AMICODE_OPS_DIR
// → ~/.amico/amicode, so we read exactly the file the extension wrote.

export function solverModeFile(env: NodeJS.ProcessEnv = process.env): string {
return join(amicodeOpsDir(env), "solver-mode.json");
Expand Down
Loading