@nodii/dev 0.6.64 → 0.6.66

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/dist/core.js CHANGED
@@ -4,7 +4,7 @@ import { chmod, mkdir, readFile, rm, writeFile } from "node:fs/promises";
4
4
  import { homedir, platform } from "node:os";
5
5
  import { dirname, join } from "node:path";
6
6
 
7
- export const VERSION = "0.6.64";
7
+ export const VERSION = "0.6.66";
8
8
  export const configPath = () =>
9
9
  process.env.NODII_DEV_CONFIG_PATH ??
10
10
  join(homedir(), ".config/nodii-dev/config.json");
package/dist/doctor.js CHANGED
@@ -5,7 +5,7 @@ import { devRequest, encode, isOAuthConfig, query, setAuthProvider } from "./cor
5
5
  import { OAuthAuthProvider, decodeClaims, loadRefreshToken } from "./oauth.js";
6
6
  import { inferGitContext, repoName } from "./lanes.js";
7
7
  import { figmaFileKey, figmaLockCheck, holdsSet, notRegisteredHint, scopeText } from "./figma.js";
8
- import { EMBED_MODEL, EMBED_MODEL_DIGEST, EMBED_PIN, PICKER_CONTEXT, PICKER_MODEL, PICKER_MODEL_DIGEST, STALE_PIN_HINT, inspectOllama } from "./gather.js";
8
+ import { EMBED_MODEL, EMBED_MODEL_DIGEST, EMBED_PIN, PICKER_CONTEXT, PICKER_MODEL, PICKER_MODEL_DIGESTS, STALE_PIN_HINT, inspectOllama, pickerBuild, pinnedDigests } from "./gather.js";
9
9
  import { hookDiagnostics } from "./hook-doctor.js";
10
10
  import { hostBootedAt } from "./host.js";
11
11
  import { listAccounts } from "./accounts.js";
@@ -272,12 +272,15 @@ export async function doctorCommand(deps = {}) {
272
272
  try {
273
273
  const picker = await (deps.ollamaInspector ?? inspectOllama)();
274
274
  checks.push(ok("ollama", `version ${picker.version} at the local Gather endpoint`, { version: picker.version }));
275
- if (picker.modelInstalled && picker.modelMatches)
276
- checks.push(ok("picker_model", `${PICKER_MODEL} installed${picker.digest ? ` (${picker.digest})` : ""}`, {
277
- model: PICKER_MODEL, digest: picker.digest ?? null, size: picker.size ?? null,
275
+ // Two registry builds of gemma4:12b are accepted; say which one is installed.
276
+ if (picker.modelInstalled && picker.modelMatches) {
277
+ const build = pickerBuild(picker.digest);
278
+ checks.push(ok("picker_model", `${PICKER_MODEL} installed${picker.digest ? ` (${picker.digest}${build ? `, the ${build.build}` : ""})` : ""}`, {
279
+ model: PICKER_MODEL, digest: picker.digest ?? null, build: build?.build ?? null, size: picker.size ?? null,
278
280
  }));
281
+ }
279
282
  else if (!picker.modelInstalled) checks.push(missing("picker_model", `${PICKER_MODEL} is not installed`, "nodii-dev setup --yes", { model: PICKER_MODEL }));
280
- else checks.push(missing("picker_model", `${PICKER_MODEL} digest is ${picker.digest ?? "unknown"}; this CLI pins ${PICKER_MODEL_DIGEST}; ${STALE_PIN_HINT}`, "nodii-dev setup --yes", { model: PICKER_MODEL, digest: picker.digest ?? null, requiredDigest: PICKER_MODEL_DIGEST }));
283
+ else checks.push(missing("picker_model", `${PICKER_MODEL} digest is ${picker.digest ?? "unknown"}; this CLI pins ${pinnedDigests()}; ${STALE_PIN_HINT}`, "nodii-dev setup --yes", { model: PICKER_MODEL, digest: picker.digest ?? null, acceptedDigests: PICKER_MODEL_DIGESTS }));
281
284
  // Gather loads the picker at an explicit num_ctx; a copy resident at another
282
285
  // context (Ollama's default is the model's full window) holds far more memory.
283
286
  const context = picker.loadedContext ?? null;
package/dist/gather.js CHANGED
@@ -9,16 +9,25 @@ import { CliError } from "./core.js";
9
9
  const execFileAsync = promisify(execFile);
10
10
 
11
11
  export const PICKER_MODEL = "gemma4:12b";
12
- // The build the Ollama registry serves to Ollama on Apple silicon: an MLX nvfp4
13
- // build. The registry chooses the manifest by User-Agent, so `ollama pull` on an
14
- // M-series Mac lands this digest, not the GGUF one other clients see (hub-58
15
- // re-pin, NODII-DEV-CLI-11). This build has no structured output (pickDocuments).
16
- export const PICKER_MODEL_DIGEST = "sha256:c7597fc90b86aff6965317f37dd5465402284e26382d9b4bf2dfe3ef1491f4b6";
12
+ // gemma4:12b has two registry builds under the same tag, and the picker accepts
13
+ // either (NODII-DEV-CLI-33). The registry chooses the manifest by User-Agent and
14
+ // client, so two Macs pulling the same tag can land different digests:
15
+ // - c7597fc9…: the MLX nvfp4 build Ollama on Apple silicon pulled at the hub-58
16
+ // re-pin (NODII-DEV-CLI-11). It has no structured output (pickDocuments).
17
+ // - 6114515d…: the build a fresh M5 Mac with Ollama 0.32.15 pulls (nodii-clis #113).
18
+ // Any other digest is refused (PICKER_MODEL_VERSION_MISMATCH).
19
+ export const PICKER_MODEL_BUILDS = [
20
+ { digest: "sha256:c7597fc90b86aff6965317f37dd5465402284e26382d9b4bf2dfe3ef1491f4b6", build: "MLX nvfp4 build (hub-58 pin)" },
21
+ { digest: "sha256:6114515d63c17436a7c0417d82820ac65ad643e2806c5a3c89cb62846436ed0b", build: "build a fresh M5 with Ollama 0.32.15 pulls (nodii-clis #113)" },
22
+ ];
23
+ export const PICKER_MODEL_DIGESTS = PICKER_MODEL_BUILDS.map((x) => x.digest);
24
+ // The first accepted build; tests and fakes install this one.
25
+ export const PICKER_MODEL_DIGEST = PICKER_MODEL_DIGESTS[0];
17
26
  // E4B and 26B are compared in Gather tuning only; each is pinned the same way
18
27
  // (public registry tag + manifest digest) and never pulled by setup.
19
28
  export const TUNING_MODELS = {
20
29
  "gemma-e4b": { name: "gemma4:e4b", digest: "sha256:dc35e8d9c6061baa6f0fa870975ab6932e2542b579b13ea0f199fa4bb7300c9c" },
21
- "gemma-12b": { name: PICKER_MODEL, digest: PICKER_MODEL_DIGEST },
30
+ "gemma-12b": { name: PICKER_MODEL, digest: PICKER_MODEL_DIGEST, digests: PICKER_MODEL_DIGESTS },
22
31
  "gemma-26b": { name: "gemma4:26b", digest: "sha256:001e5dafc3c77684c2307ebc6ab8e336e10c9b18eca52acf547d72fc83c3ca8c" },
23
32
  };
24
33
  // The section embedding pin (Dev's GATHER_EMBEDDING_*): `setup` pulls it,
@@ -113,10 +122,18 @@ async function jsonRequest(path, { baseUrl = ollamaUrl(), fetchImpl = fetch, tim
113
122
  return payload;
114
123
  }
115
124
 
116
- const PINNED = { name: PICKER_MODEL, digest: PICKER_MODEL_DIGEST };
125
+ const PINNED = { name: PICKER_MODEL, digest: PICKER_MODEL_DIGEST, digests: PICKER_MODEL_DIGESTS };
117
126
  // Ollama's /api/tags reports the manifest digest as bare hex; the pin carries
118
127
  // the registry's `sha256:` form. Compare them without the algorithm prefix.
119
128
  const bareDigest = (digest) => typeof digest === "string" ? digest.replace(/^sha256:/, "") : null;
129
+ // A pin names one digest, or an allowlist of registry builds of the same tag.
130
+ const pinDigests = (pin) => pin.digests ?? [pin.digest];
131
+ /** The accepted digest(s) of a pin, for messages: "X" or "X or Y". */
132
+ export const pinnedDigests = (pin = PINNED) => pinDigests(pin).join(" or ");
133
+ /** The accepted gemma4:12b build a digest is, or null when it is not one of them. */
134
+ export function pickerBuild(digest) {
135
+ return PICKER_MODEL_BUILDS.find((x) => bareDigest(x.digest) === bareDigest(digest)) ?? null;
136
+ }
120
137
 
121
138
  export async function inspectOllama(options = {}) {
122
139
  const pin = options.model ?? PINNED;
@@ -134,7 +151,7 @@ export async function inspectOllama(options = {}) {
134
151
  version: String(version.version ?? "unknown"),
135
152
  model: pin.name,
136
153
  modelInstalled: Boolean(model),
137
- modelMatches: Boolean(model?.digest) && bareDigest(model.digest) === bareDigest(pin.digest),
154
+ modelMatches: Boolean(model?.digest) && pinDigests(pin).some((digest) => bareDigest(digest) === bareDigest(model.digest)),
138
155
  digest: model?.digest ?? null,
139
156
  size: model?.size ?? null,
140
157
  details: model?.details ?? null,
@@ -149,7 +166,7 @@ export async function requirePicker(options = {}) {
149
166
  if (!status.modelInstalled)
150
167
  throw new CliError("PICKER_MODEL_MISSING", `Local Gather picker is missing ${pin.name}. ${fix} to pull it.`, 1, status);
151
168
  if (!status.modelMatches)
152
- throw new CliError("PICKER_MODEL_VERSION_MISMATCH", `Local ${pin.name} is ${status.digest ?? "an unknown digest"}; this CLI pins ${pin.digest}. ${fix} to pull it; ${STALE_PIN_HINT}`, 1, status);
169
+ throw new CliError("PICKER_MODEL_VERSION_MISMATCH", `Local ${pin.name} is ${status.digest ?? "an unknown digest"}; this CLI pins ${pinnedDigests(pin)}. ${fix} to pull it; ${STALE_PIN_HINT}`, 1, status);
153
170
  return status;
154
171
  }
155
172
 
@@ -590,7 +607,7 @@ export async function setupOllama({ check = false, inspect = inspectOllama, exec
590
607
  return { changed: embed.changed, ...current, embed };
591
608
  }
592
609
  if (check && current.modelInstalled)
593
- throw new CliError("PICKER_MODEL_VERSION_MISMATCH", `${PICKER_MODEL} digest is ${current.digest ?? "unknown"}; this CLI pins ${PICKER_MODEL_DIGEST}. Run \`nodii-dev setup --yes\` to pull it; ${STALE_PIN_HINT}`, 1, current);
610
+ throw new CliError("PICKER_MODEL_VERSION_MISMATCH", `${PICKER_MODEL} digest is ${current.digest ?? "unknown"}; this CLI pins ${pinnedDigests()}. Run \`nodii-dev setup --yes\` to pull it; ${STALE_PIN_HINT}`, 1, current);
594
611
  if (check) throw new CliError("PICKER_MODEL_MISSING", `${PICKER_MODEL} is not installed.`, 1, current);
595
612
  } catch (error) {
596
613
  if (check || !["PICKER_UNAVAILABLE", "PICKER_MODEL_MISSING"].includes(error?.code)) throw error;
@@ -603,7 +620,7 @@ export async function setupOllama({ check = false, inspect = inspectOllama, exec
603
620
  const ready = await inspect();
604
621
  if (!ready.modelInstalled) throw new CliError("PICKER_MODEL_MISSING", `Ollama pull finished but ${PICKER_MODEL} is not installed.`, 1, ready);
605
622
  // A fresh pull is what the registry serves now, so a mismatch here is a stale pin.
606
- if (!ready.modelMatches) throw new CliError("PICKER_MODEL_VERSION_MISMATCH", `The Ollama registry serves ${PICKER_MODEL} at ${ready.digest ?? "an unknown digest"}, but this CLI pins ${PICKER_MODEL_DIGEST}: the pin is stale, so pulling again will not help. Update nodii-dev to a release with the current pin.`, 1, { ...ready, stalePin: true });
623
+ if (!ready.modelMatches) throw new CliError("PICKER_MODEL_VERSION_MISMATCH", `The Ollama registry serves ${PICKER_MODEL} at ${ready.digest ?? "an unknown digest"}, but this CLI pins ${pinnedDigests()}: the pin is stale, so pulling again will not help. Update nodii-dev to a release with the current pin.`, 1, { ...ready, stalePin: true });
607
624
  const embed = await setupEmbedModel({ check, inspect, exec });
608
625
  return { changed: [PICKER_MODEL, ...embed.changed], ...ready, embed };
609
626
  }
@@ -30,7 +30,7 @@
30
30
  // it until it returns [] (each round can reveal instances inside slot
31
31
  // content).
32
32
 
33
- export const VERSION = "1.0.10";
33
+ export const VERSION = "1.0.11";
34
34
 
35
35
  /** @typedef {{ nodeId: string, check: string, detail: string }} Finding */
36
36
  /**
@@ -628,6 +628,37 @@ export function checkConformance({
628
628
  for (const r of roles)
629
629
  for (const label of r.labels ?? [])
630
630
  labelRoles.set(label.trim().toLowerCase(), r);
631
+ // Labels that mark a role only inside named components: they win there.
632
+ const scopedLabels = new Map();
633
+ for (const r of roles)
634
+ for (const { labels, within } of r.labelsIn ?? [])
635
+ for (const label of labels) {
636
+ const key = label.trim().toLowerCase();
637
+ const scopes = scopedLabels.get(key) ?? [];
638
+ scopes.push({
639
+ role: r,
640
+ within: new Set(within.map((name) => name.trim().toLowerCase())),
641
+ });
642
+ scopedLabels.set(key, scopes);
643
+ }
644
+ const roleOfLabel = (a, n, label) => {
645
+ const scopes = scopedLabels.get(label);
646
+ if (scopes) {
647
+ const names = new Set();
648
+ for (const x of a.ancestors(n)) {
649
+ names.add(x.name?.toLowerCase());
650
+ const set = a.setOf({
651
+ componentId: x.type === "INSTANCE" ? x.componentId : x.id,
652
+ });
653
+ if (set?.name) names.add(set.name.toLowerCase());
654
+ }
655
+ const scoped = scopes.find((s) =>
656
+ [...s.within].some((name) => names.has(name))
657
+ );
658
+ if (scoped) return scoped.role;
659
+ }
660
+ return labelRoles.get(label);
661
+ };
631
662
  const librarySetNames = new Set();
632
663
  const usedRoles = new Set();
633
664
  const analyses = Object.values(nodes ?? {})
@@ -872,7 +903,7 @@ export function checkConformance({
872
903
  // (even one whose variant carries the label) and for a label it
873
904
  // overrode; a button a library block composes with its own label is
874
905
  // the library's (MW6-17).
875
- const role = labelRoles.get(text.toLowerCase());
906
+ const role = roleOfLabel(a, n, text.toLowerCase());
876
907
  if (role) {
877
908
  const up = a.ancestors(n);
878
909
  const holder = up
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodii/dev",
3
- "version": "0.6.64",
3
+ "version": "0.6.66",
4
4
  "description": "Agent CLI for Nodii Dev, reached through the platform edge",
5
5
  "type": "module",
6
6
  "bin": {