litmus-cli 1.4.84-desktop.2 → 1.4.84-desktop.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.
|
@@ -8,6 +8,7 @@ export type DesktopApp = "codex" | "claude";
|
|
|
8
8
|
export declare const DESKTOP_WORKSPACE_FOLDER = "/home/candidate/workspace";
|
|
9
9
|
export declare function claudeDesktopUrl(alias: string): string;
|
|
10
10
|
export declare function desktopAppInstructions(app: DesktopApp, alias: string): string[];
|
|
11
|
-
/**
|
|
11
|
+
/** Validate remote configuration without printing credentials or candidate content. */
|
|
12
|
+
export declare function desktopAppConfigurationScript(app: DesktopApp): string;
|
|
12
13
|
export declare function desktopAppProbeCommand(app: DesktopApp): string;
|
|
13
14
|
//# sourceMappingURL=desktop-app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"desktop-app.d.ts","sourceRoot":"","sources":["../../src/lib/desktop-app.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAA;AAC3C,eAAO,MAAM,wBAAwB,8BAA8B,CAAA;AAEnE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGtD;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAc/E;AAED,
|
|
1
|
+
{"version":3,"file":"desktop-app.d.ts","sourceRoot":"","sources":["../../src/lib/desktop-app.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAA;AAC3C,eAAO,MAAM,wBAAwB,8BAA8B,CAAA;AAEnE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGtD;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAc/E;AAED,uFAAuF;AACvF,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,CAgDrE;AAID,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,CAQ9D"}
|
package/dist/lib/desktop-app.js
CHANGED
|
@@ -20,11 +20,65 @@ export function desktopAppInstructions(app, alias) {
|
|
|
20
20
|
"Start a chat in that remote project. Submit from your Litmus assessment page.",
|
|
21
21
|
];
|
|
22
22
|
}
|
|
23
|
-
/**
|
|
23
|
+
/** Validate remote configuration without printing credentials or candidate content. */
|
|
24
|
+
export function desktopAppConfigurationScript(app) {
|
|
25
|
+
const common = `import json,os,pathlib,tomllib,urllib.parse
|
|
26
|
+
home=pathlib.Path.home()
|
|
27
|
+
def require(ok):
|
|
28
|
+
if not ok: raise ValueError("Desktop app configuration is incomplete")
|
|
29
|
+
proxy=urllib.parse.urlparse(os.environ.get("HTTPS_PROXY",""))
|
|
30
|
+
require(proxy.scheme in ("http","https") and bool(proxy.hostname))
|
|
31
|
+
ca=pathlib.Path(os.environ.get("NODE_EXTRA_CA_CERTS","/nonexistent"))
|
|
32
|
+
require(ca.is_file() and os.access(ca,os.R_OK))
|
|
33
|
+
`;
|
|
34
|
+
if (app === "claude")
|
|
35
|
+
return common + `s=json.loads((home/".claude/settings.json").read_text())
|
|
36
|
+
require(isinstance(s,dict) and s.get("disableAllHooks") is not True)
|
|
37
|
+
h=s.get("hooks",{})
|
|
38
|
+
command="node /opt/litmus/lib/hook-logger.cjs claude /home/candidate/workspace --hosted-workspace /home/candidate"
|
|
39
|
+
for event in ("UserPromptSubmit","Stop"):
|
|
40
|
+
entries=[e for g in h.get(event,[]) if g.get("matcher") is None for e in g.get("hooks",[]) if e.get("command")==command and e.get("type")=="command" and isinstance(e.get("timeout"),(int,float)) and e["timeout"]>=15 and not e.get("async",False)]
|
|
41
|
+
require(len(entries)==1)
|
|
42
|
+
env=s.get("env",{})
|
|
43
|
+
require(isinstance(env,dict) and env.get("CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC")=="1")
|
|
44
|
+
for key in ("HTTPS_PROXY","HTTP_PROXY","NODE_EXTRA_CA_CERTS"):
|
|
45
|
+
require(key not in env or env[key]==os.environ.get(key))
|
|
46
|
+
# Authentication may be supplied by Desktop sign-in. If workspace pre-auth is set,
|
|
47
|
+
# both its route and credential must be present; never print either value.
|
|
48
|
+
base=os.environ.get("ANTHROPIC_BASE_URL","")
|
|
49
|
+
if base:
|
|
50
|
+
require(urllib.parse.urlparse(base).scheme in ("http","https") and bool(urllib.parse.urlparse(base).hostname))
|
|
51
|
+
require(bool(os.environ.get("ANTHROPIC_AUTH_TOKEN") or os.environ.get("ANTHROPIC_API_KEY")))
|
|
52
|
+
print("ready")
|
|
53
|
+
`;
|
|
54
|
+
return common + `config=tomllib.loads((home/".codex/config.toml").read_text())
|
|
55
|
+
require(config.get("check_for_update_on_startup") is False)
|
|
56
|
+
require(config.get("sandbox_mode")=="danger-full-access")
|
|
57
|
+
require(config.get("features",{}).get("hooks") is not False)
|
|
58
|
+
daemon=json.loads((home/".codex/app-server-daemon/settings.json").read_text())
|
|
59
|
+
require(daemon.get("updater",{}).get("autoUpdateEnabled") is False)
|
|
60
|
+
provider=config.get("model_provider")
|
|
61
|
+
if provider=="litmus":
|
|
62
|
+
route=config.get("model_providers",{}).get("litmus",{})
|
|
63
|
+
require(route.get("wire_api")=="responses")
|
|
64
|
+
url=urllib.parse.urlparse(route.get("base_url",""))
|
|
65
|
+
require(url.scheme in ("http","https") and bool(url.hostname))
|
|
66
|
+
require(bool(os.environ.get(route.get("env_key",""))))
|
|
67
|
+
require(route.get("http_headers",{}).get("X-Litmus-Client")=="codex")
|
|
68
|
+
else:
|
|
69
|
+
# Personal account sign-in is supported; an unknown provider is not our config.
|
|
70
|
+
require(provider in (None,"openai"))
|
|
71
|
+
print("ready")
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
function shellQuote(value) { return "'" + value.replace(/'/g, "'\\''") + "'"; }
|
|
24
75
|
export function desktopAppProbeCommand(app) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
76
|
+
const configuration = `python3 -c ${shellQuote(desktopAppConfigurationScript(app))}`;
|
|
77
|
+
if (app === "codex") {
|
|
78
|
+
// Reuse the image's exact hook/requirements/node verifier, including root ownership,
|
|
79
|
+
// rather than maintaining another approximation of its shell command contract.
|
|
80
|
+
return "bash -lc 'command -v codex >/dev/null && codex app-server --help >/dev/null 2>&1' && python3 /opt/litmus/lib/install_codex_hook.py verify --expect-root-owned --expect-node >/dev/null 2>&1 && test -r /opt/litmus/lib/hook-logger.cjs && " + configuration;
|
|
81
|
+
}
|
|
82
|
+
return "command -v node >/dev/null && test -r /opt/litmus/lib/hook-logger.cjs && " + configuration;
|
|
29
83
|
}
|
|
30
84
|
//# sourceMappingURL=desktop-app.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"desktop-app.js","sourceRoot":"","sources":["../../src/lib/desktop-app.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,wBAAwB,GAAG,2BAA2B,CAAA;AAEnE,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,IAAI,CAAC,8BAA8B,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;IAC1F,OAAO,8BAA8B,kBAAkB,CAAC,KAAK,CAAC,eAAe,kBAAkB,CAAC,wBAAwB,CAAC,EAAE,CAAA;AAC7H,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,GAAe,EAAE,KAAa;IACnE,IAAI,GAAG,KAAK,QAAQ;QAAE,OAAO;YAC3B,oGAAoG;YACpG,gBAAgB,CAAC,KAAK,CAAC;YACvB,aAAa,KAAK,EAAE;YACpB,mBAAmB,wBAAwB,EAAE;YAC7C,2GAA2G;SAC5G,CAAA;IACD,OAAO;QACL,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