nomarmy 0.1.0-alpha.2 → 0.1.0-alpha.21
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/README.md +86 -480
- package/bin/nomarmy.mjs +1081 -185
- package/docker/Dockerfile +2 -2
- package/docker/Dockerfile.go +6 -4
- package/docker/Dockerfile.rust +17 -2
- package/harnesses/_template/README.md +27 -0
- package/harnesses/_template/harness.yml +26 -0
- package/harnesses/browser-playwright/README.md +35 -0
- package/harnesses/browser-playwright/fixture/package.json +1 -0
- package/harnesses/browser-playwright/fixture/page.html +1 -0
- package/harnesses/browser-playwright/fixture/page.spec.js +5 -0
- package/harnesses/browser-playwright/fixture/playwright.config.js +8 -0
- package/harnesses/browser-playwright/harness.yml +18 -0
- package/harnesses/go/README.md +45 -0
- package/harnesses/go/harness.yml +14 -0
- package/harnesses/mock-oidc/README.md +31 -0
- package/harnesses/mock-oidc/fixture/.nomarmy.yml +4 -0
- package/harnesses/mock-oidc/fixture/discovery.test.mjs +16 -0
- package/harnesses/mock-oidc/harness.yml +19 -0
- package/harnesses/node/README.md +53 -0
- package/harnesses/node/harness.yml +18 -0
- package/harnesses/python/README.md +46 -0
- package/harnesses/python/harness.yml +16 -0
- package/harnesses/rust/README.md +45 -0
- package/harnesses/rust/harness.yml +13 -0
- package/install.sh +29 -9
- package/lib/admission.mjs +178 -30
- package/lib/agents.mjs +8 -6
- package/lib/army.mjs +25 -10
- package/lib/codex-link.mjs +37 -0
- package/lib/config.mjs +15 -0
- package/lib/connect.mjs +232 -19
- package/lib/continue-from.mjs +103 -0
- package/lib/coordinator-instructions.mjs +5 -1
- package/lib/diff-checks.mjs +114 -0
- package/lib/dispatch-schema.mjs +14 -12
- package/lib/doctor.mjs +98 -9
- package/lib/egress-proxy.mjs +116 -0
- package/lib/execute.mjs +241 -33
- package/lib/git-record.mjs +27 -3
- package/lib/harness-schema.mjs +61 -0
- package/lib/harnesses.mjs +99 -0
- package/lib/health.mjs +162 -18
- package/lib/install-freshness.mjs +114 -0
- package/lib/jev-checks.mjs +110 -0
- package/lib/job-format.mjs +54 -0
- package/lib/judge.mjs +130 -0
- package/lib/limits.mjs +77 -0
- package/lib/model-probe.mjs +61 -0
- package/lib/mutation.mjs +159 -0
- package/lib/notify.mjs +30 -3
- package/lib/openclaw-install.mjs +122 -0
- package/lib/openclaw-path.mjs +28 -0
- package/lib/openclaw-run.mjs +74 -12
- package/lib/openclaw-runtime-health.mjs +56 -0
- package/lib/outcome.mjs +21 -2
- package/lib/outcomes.mjs +6 -0
- package/lib/path-utils.mjs +4 -0
- package/lib/podman-health.mjs +41 -0
- package/lib/process.mjs +4 -1
- package/lib/propose.mjs +10 -11
- package/lib/refusal-retry.mjs +16 -0
- package/lib/registry-python.mjs +98 -0
- package/lib/registry-secrets.mjs +140 -0
- package/lib/repo-query.mjs +13 -7
- package/lib/runs.mjs +7 -1
- package/lib/same-path.mjs +14 -0
- package/lib/sandbox-images.mjs +499 -83
- package/lib/sandbox-vm.mjs +32 -0
- package/lib/scan.mjs +5 -1
- package/lib/schema.mjs +20 -11
- package/lib/scout.mjs +21 -3
- package/lib/server-context.mjs +21 -1
- package/lib/setup-steps.mjs +55 -0
- package/lib/share.mjs +82 -0
- package/lib/stale-sessions.mjs +60 -0
- package/lib/stats.mjs +315 -0
- package/lib/statusline.mjs +32 -6
- package/lib/subscription-setup.mjs +13 -0
- package/lib/suggestions.mjs +153 -0
- package/lib/thinking.mjs +23 -0
- package/lib/transcript.mjs +30 -5
- package/lib/usage-limits.mjs +329 -0
- package/lib/user-config.mjs +106 -0
- package/lib/validators.mjs +220 -0
- package/lib/verification-artifacts.mjs +46 -0
- package/lib/verification-flow.mjs +52 -7
- package/lib/verification-network.mjs +66 -0
- package/lib/verify.mjs +338 -85
- package/lib/worker-prompt.mjs +5 -2
- package/lib/wsl-cli.mjs +152 -0
- package/lib/wsl.mjs +230 -0
- package/lib/zod-issues.mjs +15 -0
- package/mcp/server.mjs +165 -34
- package/package.json +7 -5
- package/playbooks/feature.md +8 -5
- package/scripts/configure-openclaw.sh +4 -2
- package/scripts/generate-harness-docs.mjs +42 -0
- package/scripts/install-openclaw.mjs +23 -0
- package/scripts/lib.sh +9 -2
- package/scripts/select-model.mjs +12 -5
- package/scripts/start-inference.sh +2 -2
package/scripts/lib.sh
CHANGED
|
@@ -19,9 +19,13 @@ nomarmy_compat_prefix(){
|
|
|
19
19
|
done
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
# Your settings live here, over the package's config/ defaults, so an update
|
|
23
|
+
# can't reset them (lib/user-config.mjs does the same for the CLI).
|
|
24
|
+
nomarmy_user_config_dir(){ echo "${NOMARMY_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/nomarmy}"; }
|
|
25
|
+
|
|
22
26
|
nomarmy_available_profiles(){
|
|
23
27
|
local root; root="$(nomarmy_root)"
|
|
24
|
-
find "$root/config/profiles" -name '*.env' -exec basename {} .env \; | sort | tr '\n' ' '
|
|
28
|
+
{ find "$root/config/profiles" -name '*.env' -exec basename {} .env \; ; find "$(nomarmy_user_config_dir)/profiles" -name '*.env' -exec basename {} .env \; 2>/dev/null; } | sort -u | tr '\n' ' '
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
# Where this install's models run (lib/execution.mjs is the same logic for the
|
|
@@ -129,7 +133,8 @@ load_profile(){
|
|
|
129
133
|
elif command -v nvidia-smi >/dev/null 2>&1; then profile=nvidia-linux
|
|
130
134
|
else profile=cpu-linux; fi
|
|
131
135
|
fi
|
|
132
|
-
profile_file="$
|
|
136
|
+
profile_file="$(nomarmy_user_config_dir)/profiles/$profile.env"
|
|
137
|
+
[[ -f "$profile_file" ]] || profile_file="$root/config/profiles/$profile.env"
|
|
133
138
|
if [[ ! -f "$profile_file" ]]; then
|
|
134
139
|
echo "ERROR: unknown profile '$profile'. Available: $(nomarmy_available_profiles)" >&2
|
|
135
140
|
exit 2
|
|
@@ -137,6 +142,8 @@ load_profile(){
|
|
|
137
142
|
set -a
|
|
138
143
|
# shellcheck disable=SC1091
|
|
139
144
|
source "$root/config/common.env"
|
|
145
|
+
# shellcheck disable=SC1091
|
|
146
|
+
[[ -f "$(nomarmy_user_config_dir)/common.env" ]] && source "$(nomarmy_user_config_dir)/common.env"
|
|
140
147
|
# shellcheck disable=SC1090
|
|
141
148
|
source "$profile_file"
|
|
142
149
|
set +a
|
package/scripts/select-model.mjs
CHANGED
|
@@ -3,12 +3,17 @@ import { createInterface } from "node:readline/promises";
|
|
|
3
3
|
import { stdin as input, stdout as output } from "node:process";
|
|
4
4
|
import { readFile, writeFile } from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
|
+
import { userCommonPath } from "../lib/user-config.mjs";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
// fileURLToPath, not URL.pathname: on Windows that gave "/C:/Users/Jason%20Pugh/...",
|
|
10
|
+
// a stray slash and an encoded space, and connect failed copying from C:\\C:\\...
|
|
11
|
+
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
8
12
|
const args = process.argv.slice(2);
|
|
9
13
|
let query = "";
|
|
10
14
|
let repo = "";
|
|
11
|
-
|
|
15
|
+
// Your settings file, not the package's config/ (an update would reset it): lib/user-config.mjs.
|
|
16
|
+
let configPath = userCommonPath();
|
|
12
17
|
|
|
13
18
|
for (let index = 0; index < args.length; index += 1) {
|
|
14
19
|
const value = args[index];
|
|
@@ -70,16 +75,18 @@ try {
|
|
|
70
75
|
const alias = (await rl.question(`Local model alias [${defaultAlias}]: `)).trim() || defaultAlias;
|
|
71
76
|
if (!/^[A-Za-z0-9._-]+$/.test(alias)) throw new Error("Alias may contain only letters, numbers, dots, underscores, and hyphens.");
|
|
72
77
|
|
|
73
|
-
console.log(`\nReady to update ${
|
|
78
|
+
console.log(`\nReady to update ${configPath}:`);
|
|
74
79
|
console.log(` NOMARMY_MODEL_REPO=${repo}`);
|
|
75
80
|
console.log(` NOMARMY_MODEL_QUANT=${requestedQuant}`);
|
|
76
81
|
console.log(` NOMARMY_MODEL_ALIAS=${alias}`);
|
|
77
|
-
if ((await rl.question("Apply this model configuration? [
|
|
82
|
+
if (["n", "no"].includes((await rl.question("Apply this model configuration? [Y/n] ")).trim().toLowerCase())) {
|
|
78
83
|
console.log("Canceled; no model configuration changed.");
|
|
79
84
|
process.exit(0);
|
|
80
85
|
}
|
|
81
86
|
|
|
82
|
-
|
|
87
|
+
// Your settings file may not exist yet: start it rather than fail.
|
|
88
|
+
const existing = await readFile(configPath, "utf8").catch(() => "");
|
|
89
|
+
await import("node:fs").then((fs) => fs.mkdirSync(path.dirname(configPath), { recursive: true }));
|
|
83
90
|
const replace = (key, value, text) => {
|
|
84
91
|
const line = `${key}=${value}`;
|
|
85
92
|
return new RegExp(`^${key}=.*$`, "m").test(text) ? text.replace(new RegExp(`^${key}=.*$`, "m"), line) : `${text.trimEnd()}\n${line}\n`;
|
|
@@ -15,8 +15,8 @@ if [[ -f "$PID" ]] && kill -0 "$(cat "$PID")" 2>/dev/null; then echo "llama-serv
|
|
|
15
15
|
BIN="$NOMARMY_INSTALL_ROOT/llama-server"; [[ -x "$BIN" ]] || { echo "ERROR: $BIN missing"; exit 1; }
|
|
16
16
|
ARGS=(-hf "$NOMARMY_MODEL_REPO:$NOMARMY_MODEL_QUANT" --alias "$NOMARMY_MODEL_ALIAS" --host "$NOMARMY_LLAMA_HOST" --port "$NOMARMY_LLAMA_PORT" -c "$NOMARMY_LLAMA_CONTEXT" -np "$NOMARMY_LLAMA_PARALLEL" -ngl "$NOMARMY_LLAMA_GPU_LAYERS" -t "$NOMARMY_LLAMA_THREADS" --metrics)
|
|
17
17
|
# Everything below is optional advanced tuning, unset by default: nothing
|
|
18
|
-
# here changes behavior for anyone who hasn't set these. See
|
|
19
|
-
#
|
|
18
|
+
# here changes behavior for anyone who hasn't set these. See "Advanced
|
|
19
|
+
# llama-server tuning" in docs/configuration.md for what each one is for.
|
|
20
20
|
[[ -n "${NOMARMY_LLAMA_CACHE_TYPE_K:-}" ]] && ARGS+=(--cache-type-k "$NOMARMY_LLAMA_CACHE_TYPE_K")
|
|
21
21
|
[[ -n "${NOMARMY_LLAMA_CACHE_TYPE_V:-}" ]] && ARGS+=(--cache-type-v "$NOMARMY_LLAMA_CACHE_TYPE_V")
|
|
22
22
|
[[ -n "${NOMARMY_LLAMA_FLASH_ATTN:-}" ]] && ARGS+=(--flash-attn "$NOMARMY_LLAMA_FLASH_ATTN")
|