@nexus-cortex/cli 4.71.0 → 4.73.0

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/.cortex/orient ADDED
@@ -0,0 +1,97 @@
1
+ #!/bin/sh
2
+ # Generic mechanical orient — the shipped scaffold's boot-minimal turn-1 target
3
+ # (HARNESS_IMPROVEMENT_BACKLOG item 9b). Vendored by prepack to
4
+ # <pkg>/.cortex/orient; the boot-minimal clause points here when the project
5
+ # has no .cortex/orient of its own. Deterministic, read-only except for one
6
+ # mechanical .cortex/CORTEX.md render (never overwrites), always exits 0.
7
+ W="$(pwd)"
8
+ echo "== WORKSPACE MAP: $W =="
9
+ ls -1A "$W" 2>/dev/null | head -40
10
+ PROJECT=""
11
+ CMDS=""
12
+ if [ -f package.json ]; then
13
+ if command -v node >/dev/null 2>&1; then
14
+ PROJECT=$(node -e 'try{console.log(require("./package.json").name||"")}catch(e){}' 2>/dev/null)
15
+ SCRIPTS=$(node -e 'try{Object.keys(require("./package.json").scripts||{}).forEach(k=>console.log(k))}catch(e){}' 2>/dev/null | head -12)
16
+ else
17
+ PROJECT=$(sed -n 's/.*"name"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' package.json | head -1)
18
+ SCRIPTS=$(tr ',' '\n' < package.json | sed -n 's/.*"\([A-Za-z0-9:_-]*\)"[[:space:]]*:[[:space:]]*".*/\1/p' | head -12)
19
+ fi
20
+ if [ -n "$SCRIPTS" ]; then
21
+ echo "-- package.json scripts --"
22
+ printf '%s\n' "$SCRIPTS" | sed 's/^/ npm run /'
23
+ CMDS=$(printf '%s\n' "$SCRIPTS" | head -8 | sed 's/^/- `npm run /;s/$/`/')
24
+ fi
25
+ fi
26
+ [ -f requirements.txt ] && echo "-- python deps: requirements.txt ($(wc -l < requirements.txt | tr -d ' ') lines)"
27
+ [ -f pyproject.toml ] && echo "-- python: pyproject.toml present"
28
+ [ -f Cargo.toml ] && echo "-- rust: Cargo.toml present (cargo build / cargo test)"
29
+ if [ -f Makefile ]; then
30
+ echo "-- make targets --"
31
+ sed -n 's/^\([A-Za-z0-9_.-][A-Za-z0-9_.-]*\):.*/ make \1/p' Makefile | head -8
32
+ fi
33
+ if [ -f README.md ]; then
34
+ echo "-- README head --"
35
+ head -12 README.md
36
+ fi
37
+ # Capability index — harness-owned steering (item 9b): the skills shipped with
38
+ # the install, reachable through plain bash reads (works under any tool frame).
39
+ SK="${CORTEX_ROOT:-$HOME}/.cortex/skills"
40
+ if [ -d "$SK" ]; then
41
+ echo "== CAPABILITY GUIDES (load one with: cat <path>/SKILL.md) =="
42
+ for d in "$SK"/*/; do
43
+ [ -d "$d" ] || continue
44
+ n=$(basename "$d")
45
+ desc=$(sed -n 's/^description:[[:space:]]*//p' "$d/SKILL.md" 2>/dev/null | head -1 | cut -c1-90)
46
+ case "$desc" in ">"|"|"|"") desc="guide";; esac
47
+ echo " $SK/$n — $desc"
48
+ done | head -14
49
+ fi
50
+ echo "note: when your tool list is limited, additional tools may be discoverable via the SearchTools tool."
51
+ # Mechanical CORTEX.md (items 9c + 10): machine-authored sections live between
52
+ # markers so the drift check can regenerate ONLY what the machine wrote.
53
+ # - absent doc -> write fresh (with markers)
54
+ # - doc w/ markers + drift -> stage .cortex/CORTEX.md.next + .diff for the
55
+ # HELPER-model curation boundary (item 10); print ONE informational line —
56
+ # the working model gets zero decision surface.
57
+ # - doc without markers -> fully hand-authored; never touched, never staged.
58
+ MB_BEGIN="<!-- orient:auto:begin -->"
59
+ MB_END="<!-- orient:auto:end -->"
60
+ machine_block() {
61
+ echo "$MB_BEGIN"
62
+ echo "## Project"
63
+ echo "${PROJECT:-$(basename "$W")} — see README for details."
64
+ echo
65
+ echo "## Key Commands"
66
+ if [ -n "$CMDS" ]; then printf '%s\n' "$CMDS"; else echo "- (no package.json scripts; check README/Makefile)"; fi
67
+ echo
68
+ echo "## Structure (top level)"
69
+ ls -1A "$W" 2>/dev/null | head -25 | sed 's/^/- /'
70
+ echo "$MB_END"
71
+ }
72
+ DOC=.cortex/CORTEX.md
73
+ if [ ! -f "$DOC" ]; then
74
+ mkdir -p .cortex 2>/dev/null
75
+ {
76
+ echo "# CORTEX.md (mechanical orient scan — refine with init_cortex_context)"
77
+ echo
78
+ machine_block
79
+ } > "$DOC" 2>/dev/null && echo "(wrote mechanical .cortex/CORTEX.md)"
80
+ elif grep -q "orient:auto:begin" "$DOC" 2>/dev/null; then
81
+ machine_block > .cortex/.orient-fresh-block 2>/dev/null
82
+ awk '/orient:auto:begin/{f=1} f{print} /orient:auto:end/{f=0}' "$DOC" > .cortex/.orient-cur-block 2>/dev/null
83
+ if cmp -s .cortex/.orient-cur-block .cortex/.orient-fresh-block; then
84
+ rm -f .cortex/.orient-fresh-block .cortex/.orient-cur-block
85
+ rm -f "$DOC.next" "$DOC.diff"
86
+ echo "(CORTEX.md current)"
87
+ else
88
+ awk -v fresh=.cortex/.orient-fresh-block '
89
+ /orient:auto:begin/ {skip=1; while ((getline line < fresh) > 0) print line; close(fresh); next}
90
+ /orient:auto:end/ {skip=0; next}
91
+ skip!=1 {print}' "$DOC" > "$DOC.next" 2>/dev/null
92
+ diff -u "$DOC" "$DOC.next" > "$DOC.diff" 2>/dev/null
93
+ rm -f .cortex/.orient-fresh-block .cortex/.orient-cur-block
94
+ echo "(doctrine refresh staged for curation: machine sections drifted)"
95
+ fi
96
+ fi
97
+ exit 0
package/.env.example CHANGED
@@ -447,6 +447,9 @@ MENTORSHIP_ACTIVE_DISCOVERY=false
447
447
  # Prompt-mass composition (BASH_PLUS_SPEC P6): full (default) | minimal (only
448
448
  # the core system prompt; guides/CLAUDE.md/memory dropped) | defer (minimal on
449
449
  # turn 1, full corpus appended once at the first tool-result boundary).
450
+ # defer COMPOSES with a card's promptPreset (item 9a): a boot-minimal card
451
+ # keeps its narrow replacement prompt on turn 1 and receives the full corpus
452
+ # (incl. project CORTEX.md/AGENTS.md, read lazily at lift) after first action.
450
453
  # Effective on providers only where delivery is ON (see flag above).
451
454
  #CORTEX_PROMPT_MASS=minimal
452
455
 
@@ -531,3 +534,13 @@ MENTORSHIP_ACTIVE_DISCOVERY=false
531
534
  #CORTEX_BENCH_HOLDOUT=false
532
535
  #CORTEX_BENCH_SOURCE=cortex-bench
533
536
  #CORTEX_EXPERIMENT_TAG=
537
+
538
+ # Item 10 — helper-curated doctrine freshness (session-start / defer-lift boundary).
539
+ # When true, a staged mechanical CORTEX.md refresh (written by the orient script on
540
+ # drift) is curated by the HELPER model in a side context and applied atomically
541
+ # (with .prev rollback) BEFORE doctrine is delivered — synchronous, bounded,
542
+ # fail-open to the previous doc on timeout. The MAIN model never sees the diff.
543
+ #CORTEX_DOCTRINE_CURATION=true
544
+ # Curation wait bound (ms) and output size budget (bytes).
545
+ #CORTEX_DOCTRINE_CURATION_TIMEOUT_MS=25000
546
+ #CORTEX_DOCTRINE_MAX_BYTES=16384
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexus-cortex/cli",
3
- "version": "4.71.0",
3
+ "version": "4.73.0",
4
4
  "description": "Nexus Cortex CLI - Terminal interface for multi-provider LLM orchestration",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -19,7 +19,7 @@
19
19
  "prepack": "node ../../scripts/copy-pkg-cortex-scaffold.mjs"
20
20
  },
21
21
  "dependencies": {
22
- "@nexus-cortex/core": "4.71.0",
22
+ "@nexus-cortex/core": "4.73.0",
23
23
  "chalk": "^4.1.2",
24
24
  "cli-spinners": "^2.9.0",
25
25
  "commander": "^11.0.0",
@@ -31,7 +31,7 @@
31
31
  "marked-terminal": "^6.0.0",
32
32
  "node-fetch": "^3.3.2",
33
33
  "undici": "^7.28.0",
34
- "nexus-canon": "1.9.5"
34
+ "nexus-canon": "1.10.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/diff": "^7.0.2",