@ornexus/neocortex 4.66.4 → 4.66.6

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.
Files changed (62) hide show
  1. package/dist/release-source.json +1 -1
  2. package/dist/sbom.cdx.json +1194 -1194
  3. package/install.js +2 -0
  4. package/install.ps1 +93 -35
  5. package/install.sh +68 -100
  6. package/package.json +2 -2
  7. package/packages/client/dist/agent/refresh-stubs.d.ts +9 -0
  8. package/packages/client/dist/agent/refresh-stubs.js +2 -2
  9. package/packages/client/dist/agent/update-agent-yaml.js +1 -1
  10. package/packages/client/dist/agent/update-description.d.ts +23 -0
  11. package/packages/client/dist/agent/update-description.js +1 -2
  12. package/packages/client/dist/cli.js +14 -6
  13. package/packages/client/dist/commands/activate.js +8 -8
  14. package/packages/client/dist/commands/auth-doctor.d.ts +24 -0
  15. package/packages/client/dist/commands/auth-doctor.js +7 -0
  16. package/packages/client/dist/commands/invoke.d.ts +3 -1
  17. package/packages/client/dist/commands/invoke.js +101 -95
  18. package/packages/client/dist/config/profile-directory.d.ts +24 -0
  19. package/packages/client/dist/config/profile-directory.js +1 -1
  20. package/packages/client/dist/config/project-root.d.ts +40 -0
  21. package/packages/client/dist/config/project-root.js +1 -0
  22. package/packages/client/dist/errors/error-messages.js +2 -2
  23. package/packages/client/dist/git/epic-operational-state.d.ts +18 -0
  24. package/packages/client/dist/git/epic-operational-state.js +2 -2
  25. package/packages/client/dist/license/license-client.d.ts +2 -1
  26. package/packages/client/dist/license/license-client.js +1 -1
  27. package/packages/client/dist/migrations/epic-lifecycle-backfill.d.ts +7 -0
  28. package/packages/client/dist/migrations/epic-lifecycle-backfill.js +3 -3
  29. package/packages/shared/dist/executable-graph-catalog/contracts.js +6 -6
  30. package/packages/shared/dist/invocation/diagnose-degraded-continuation.d.ts +14 -0
  31. package/packages/shared/dist/invocation/diagnose-degraded-continuation.js +39 -0
  32. package/packages/shared/dist/invocation/diagnose-degraded-continuation.test.d.ts +1 -0
  33. package/packages/shared/dist/invocation/diagnose-degraded-continuation.test.js +26 -0
  34. package/packages/shared/dist/invocation/index.d.ts +1 -0
  35. package/packages/shared/dist/invocation/index.js +1 -0
  36. package/targets-stubs/antigravity/gemini.md +1 -1
  37. package/targets-stubs/antigravity/neocortex.md +15 -1
  38. package/targets-stubs/antigravity/skill/SKILL.md +18 -4
  39. package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
  40. package/targets-stubs/claude-code/neocortex-root.md +13 -5
  41. package/targets-stubs/claude-code/neocortex-sentinel.md +1 -1
  42. package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
  43. package/targets-stubs/claude-code/neocortex.md +13 -5
  44. package/targets-stubs/codex/AGENTS.md +20 -21
  45. package/targets-stubs/codex/neocortex.toml +15 -1
  46. package/targets-stubs/cursor/agent.md +19 -5
  47. package/targets-stubs/deepseek-harness/SKILL.md +15 -1
  48. package/targets-stubs/gemini-cli/README.md +7 -5
  49. package/targets-stubs/gemini-cli/agent.md +19 -5
  50. package/targets-stubs/gemini-cli/agents/neocortex.md +19 -5
  51. package/targets-stubs/gemini-cli/gemini.md +8 -7
  52. package/targets-stubs/gemini-cli/install-gemini.sh +35 -11
  53. package/targets-stubs/grok/README.md +5 -0
  54. package/targets-stubs/grok/SKILL.md +16 -1
  55. package/targets-stubs/grok/install-grok.sh +19 -6
  56. package/targets-stubs/kimi/neocortex.md +15 -1
  57. package/targets-stubs/lib/managed-config-merge.js +276 -23
  58. package/targets-stubs/lib/managed-profile.sh +38 -0
  59. package/targets-stubs/openclaw/SKILL.md +20 -17
  60. package/targets-stubs/opencode/neocortex-root.md +20 -22
  61. package/targets-stubs/opencode/neocortex.md +20 -22
  62. package/targets-stubs/vscode/neocortex.agent.md +19 -5
@@ -134,12 +134,50 @@ neocortex_managed_profile() {
134
134
  return 1
135
135
  }
136
136
 
137
+ # Retire a historical managed profile only when the manifest or an explicit
138
+ # helper fingerprint proves ownership. Unknown/user-edited bytes are preserved.
139
+ # The top-level installer already exposes managed_retire_file; standalone
140
+ # adapters use the same dependency-free helper directly.
141
+ neocortex_managed_retire() {
142
+ local source_root="$1"
143
+ local destination="$2"
144
+ local base_dir="$3"
145
+ local managed_id="$4"
146
+ NEOCORTEX_MANAGED_ACTION=""
147
+ NEOCORTEX_MANAGED_REASON=""
148
+ if command -v managed_retire_file >/dev/null 2>&1; then
149
+ managed_retire_file "$destination" "$managed_id" "$base_dir"
150
+ return $?
151
+ fi
152
+ local helper="$source_root/targets-stubs/lib/managed-config-merge.js"
153
+ local manifest="$base_dir/.neocortex/managed-config-manifest.json"
154
+ if [ -f "$helper" ] && command -v node >/dev/null 2>&1; then
155
+ local output status dry=""
156
+ [ "${DRY_RUN:-false}" = true ] && dry="--dry-run"
157
+ output="$(node "$helper" retire-legacy "$destination" "$manifest" "$base_dir" "$managed_id" $dry 2>&1)"
158
+ status=$?
159
+ neocortex_managed_parse "$output"
160
+ [ "$status" -eq 0 ] || NEOCORTEX_MANAGED_ACTION="failed"
161
+ [ "$NEOCORTEX_MANAGED_ACTION" != "failed" ]
162
+ return $?
163
+ fi
164
+ NEOCORTEX_MANAGED_ACTION="skipped"
165
+ NEOCORTEX_MANAGED_REASON="managed-helper-unavailable"
166
+ return 0
167
+ }
168
+
137
169
  # Report the last neocortex_managed_profile outcome with an adapter prefix.
138
170
  # Usage: neocortex_managed_report "[CODEX]" "~/.codex/AGENTS.md (global)"
139
171
  neocortex_managed_report() {
140
172
  local prefix="$1"
141
173
  local label="$2"
142
174
  case "$NEOCORTEX_MANAGED_ACTION" in
175
+ removed|planned-removed)
176
+ echo "$prefix Retired: $label" ;;
177
+ none)
178
+ : ;;
179
+ preserved)
180
+ echo "$prefix Preserved local changes: $label ($NEOCORTEX_MANAGED_REASON)" >&2 ;;
143
181
  noop|planned-noop)
144
182
  echo "$prefix Up to date: $label" ;;
145
183
  created|updated|legacy-migrated|restored|planned-*)
@@ -117,25 +117,13 @@ Rules:
117
117
 
118
118
  ## Project root resolution
119
119
 
120
- Resolve the project root safely before invoking the client:
121
-
122
- 1. If `OPENCLAW_NEOCORTEX_PROJECT_ROOT` is set and non-empty, use it.
123
- 2. Otherwise prefer `git rev-parse --show-toplevel` from the current workspace.
124
- 3. If the workspace is intentionally not a Git repository, fall back to the
125
- current physical directory with `pwd -P`.
126
-
127
- Example shell wrapper:
120
+ Let the P231.04 client resolver derive the effective project root internally.
121
+ Do not construct a shell command or interpolate a root path in the wrapper.
122
+ `OPENCLAW_NEOCORTEX_PROJECT_ROOT` remains client-owned and is never interpolated here.
128
123
 
129
124
  ```bash
130
- if [ -n "$OPENCLAW_NEOCORTEX_PROJECT_ROOT" ]; then
131
- PROJECT_ROOT="$OPENCLAW_NEOCORTEX_PROJECT_ROOT"
132
- else
133
- PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)"
134
- fi
135
-
136
125
  neocortex-client invoke \
137
126
  --args "{SELECTED_USER_ARGS_VERBATIM}" \
138
- --project-root "$PROJECT_ROOT" \
139
127
  --format plain
140
128
  ```
141
129
 
@@ -143,6 +131,21 @@ Replace `{SELECTED_USER_ARGS_VERBATIM}` with only the explicit Neocortex command
143
131
  and arguments the user intended after the trigger, preserving that selected
144
132
  payload verbatim without rewriting or removing `*` tokens.
145
133
 
134
+ ## Degraded diagnose continuation
135
+
136
+ Inspect `metadata.diagnose` only when the explicit selected payload's canonical
137
+ trigger is `diagnose` and `assertDiagnoseDegradedContinuation` accepts the exact
138
+ `DiagnoseDegradedContinuation/1.0` object. Unknown, missing, or extra fields,
139
+ wrong literals, an absent contract, or an unrelated degraded reason authorizes
140
+ no additional inspection or action.
141
+
142
+ For an admitted continuation, the current agent alone may inspect only the
143
+ explicit request and public local read-only evidence. Return probable cause,
144
+ inspected evidence, limitation, and a safe plan. Do not claim protected workflow
145
+ execution, spawn or delegate, reinvoke Neocortex, create tasks, or write files.
146
+ Never include protected prompts, raw logs, secrets, PII, private URLs, ambient
147
+ conversation history, or asset-derived text.
148
+
146
149
  ### Large input compatibility
147
150
 
148
151
  Use `--args` exactly as shown above for normal triggers; it preserves the
@@ -151,8 +154,8 @@ or mega prompt that cannot safely fit in a shell argument, use exactly one
151
154
  large-input source instead:
152
155
 
153
156
  ```bash
154
- neocortex-client invoke --stdin --project-root "$PROJECT_ROOT" --format plain < synthetic.story.md
155
- neocortex-client invoke --args-file ./synthetic.story.md --project-root "$PROJECT_ROOT" --format plain
157
+ neocortex-client invoke --stdin --format plain < synthetic.story.md
158
+ neocortex-client invoke --args-file ./synthetic.story.md --format plain
156
159
  ```
157
160
 
158
161
  Do not force migration to these options, do not combine them with `--args`, and
@@ -74,7 +74,7 @@ user's own `*yolo @docs/stories/<id>.story.md` is never refused.
74
74
  ┌────────────────────────────────────────────────────────────┐
75
75
  │ │
76
76
  │ ####### N E O C O R T E X │
77
- │ ### ######## v4.66.4 │
77
+ │ ### ######## v4.66.6 │
78
78
  │ ######### ##### │
79
79
  │ ## ############## Development Orchestrator │
80
80
  │ ## ### ###### ## OrNexus Team │
@@ -90,24 +90,9 @@ user's own `*yolo @docs/stories/<id>.story.md` is never refused.
90
90
 
91
91
  ## Auto-Update Check
92
92
 
93
- BEFORE the first `neocortex-client invoke` call in each session, run this silent
94
- update check:
95
-
96
- ```bash
97
- UPDATE_MARKER="$HOME/.neocortex/.update-check"
98
- if [ -f "$UPDATE_MARKER" ] && [ "$(find "$UPDATE_MARKER" -mmin -1440 2>/dev/null)" ]; then
99
- : # Recently checked, skip
100
- else
101
- PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)
102
- neocortex-client reconcile-registry --project-root "$PROJECT_ROOT" --check-latest >/dev/null 2>&1
103
- mkdir -p "$HOME/.neocortex" && touch "$UPDATE_MARKER" 2>/dev/null
104
- fi
105
- ```
106
-
107
- Rules:
108
- - Run ONCE per session, NEVER repeat within the same conversation
109
- - If ANY command fails, ignore and proceed with `neocortex-client invoke` normally
110
- - Do NOT show output to user unless explicitly asked
93
+ Before first invoke per session, run `neocortex-client reconcile-registry
94
+ --check-latest` natively from the workspace with output suppressed. Never add
95
+ `--project-root` or shell interpolation; ignore failure.
111
96
 
112
97
  ## Invocation Protocol
113
98
 
@@ -122,12 +107,25 @@ When the user invokes Neocortex, follow this protocol EXACTLY:
122
107
  ```bash
123
108
  neocortex-client invoke \
124
109
  --args "{USER_ARGS}" \
125
- --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" \
126
110
  --format plain
127
111
  ```
128
112
 
129
113
  3. **Follow EXACTLY the instructions returned** by the thin client on stdout.
130
114
 
115
+ ## Degraded diagnose continuation
116
+
117
+ Inspect `metadata.diagnose` only if the explicit selected payload trigger is `diagnose`
118
+ and `assertDiagnoseDegradedContinuation` accepts the exact
119
+ `DiagnoseDegradedContinuation/1.0` object. Unknown, missing, or extra fields and
120
+ all other rejections authorize no additional inspection or action.
121
+
122
+ For an admitted continuation, the current agent alone may use the explicit
123
+ request and public local read-only evidence to report probable cause, inspected evidence,
124
+ limitation, and a safe plan. Do not claim protected workflow
125
+ execution, spawn or delegate, reinvoke Neocortex, create tasks, or write files.
126
+ Exclude protected prompts, raw logs, secrets, PII, private URLs, ambient
127
+ conversation history, and asset-derived text.
128
+
131
129
  ### Large input compatibility
132
130
 
133
131
  Use `--args` exactly as shown above for normal triggers and delegated prompts; it
@@ -136,8 +134,8 @@ synthetic story or mega prompt that cannot safely fit in a shell argument, use
136
134
  exactly one large-input source instead:
137
135
 
138
136
  ```bash
139
- neocortex-client invoke --stdin --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" --format plain < synthetic.story.md
140
- neocortex-client invoke --args-file ./synthetic.story.md --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" --format plain
137
+ neocortex-client invoke --stdin --format plain < synthetic.story.md
138
+ neocortex-client invoke --args-file ./synthetic.story.md --format plain
141
139
  ```
142
140
 
143
141
  Do not force migration to these options, do not combine them with `--args`, and
@@ -73,7 +73,7 @@ user's own `*yolo @docs/stories/<id>.story.md` is never refused.
73
73
  ┌────────────────────────────────────────────────────────────┐
74
74
  │ │
75
75
  │ ####### N E O C O R T E X │
76
- │ ### ######## v4.66.4 │
76
+ │ ### ######## v4.66.6 │
77
77
  │ ######### ##### │
78
78
  │ ## ############## Development Orchestrator │
79
79
  │ ## ### ###### ## OrNexus Team │
@@ -89,24 +89,9 @@ user's own `*yolo @docs/stories/<id>.story.md` is never refused.
89
89
 
90
90
  ## Auto-Update Check
91
91
 
92
- BEFORE the first `neocortex-client invoke` call in each session, run this silent
93
- update check:
94
-
95
- ```bash
96
- UPDATE_MARKER="$HOME/.neocortex/.update-check"
97
- if [ -f "$UPDATE_MARKER" ] && [ "$(find "$UPDATE_MARKER" -mmin -1440 2>/dev/null)" ]; then
98
- : # Recently checked, skip
99
- else
100
- PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)
101
- neocortex-client reconcile-registry --project-root "$PROJECT_ROOT" --check-latest >/dev/null 2>&1
102
- mkdir -p "$HOME/.neocortex" && touch "$UPDATE_MARKER" 2>/dev/null
103
- fi
104
- ```
105
-
106
- Rules:
107
- - Run ONCE per session, NEVER repeat within the same conversation
108
- - If ANY command fails, ignore and proceed with `neocortex-client invoke` normally
109
- - Do NOT show output to user unless explicitly asked
92
+ Before first invoke per session, run `neocortex-client reconcile-registry
93
+ --check-latest` natively from the workspace with output suppressed. Never add
94
+ `--project-root` or shell interpolation; ignore failure.
110
95
 
111
96
  ## Invocation Protocol
112
97
 
@@ -121,7 +106,6 @@ When the user invokes Neocortex, follow this protocol EXACTLY:
121
106
  ```bash
122
107
  neocortex-client invoke \
123
108
  --args "{USER_ARGS}" \
124
- --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" \
125
109
  --format plain
126
110
  ```
127
111
 
@@ -129,6 +113,20 @@ neocortex-client invoke \
129
113
  4. If `invoke` returns `private-execution-client-required` and
130
114
  `next_action: retry-with-private-execution-beta`, rerun once with `--private-execution-beta`.
131
115
 
116
+ ## Degraded diagnose continuation
117
+
118
+ Inspect `metadata.diagnose` only if the explicit selected payload trigger is `diagnose`
119
+ and `assertDiagnoseDegradedContinuation` accepts the exact
120
+ `DiagnoseDegradedContinuation/1.0` object. Unknown, missing, or extra fields and
121
+ all other rejections authorize no additional inspection or action.
122
+
123
+ For an admitted continuation, the current agent alone may use the explicit
124
+ request and public local read-only evidence to report probable cause, inspected evidence,
125
+ limitation, and a safe plan. Do not claim protected workflow
126
+ execution, spawn or delegate, reinvoke Neocortex, create tasks, or write files.
127
+ Exclude protected prompts, raw logs, secrets, PII, private URLs, ambient
128
+ conversation history, and asset-derived text.
129
+
132
130
  ### Large input compatibility
133
131
 
134
132
  Use `--args` exactly as shown above for normal triggers and delegated prompts; it
@@ -137,8 +135,8 @@ synthetic story or mega prompt that cannot safely fit in a shell argument, use
137
135
  exactly one large-input source instead:
138
136
 
139
137
  ```bash
140
- neocortex-client invoke --stdin --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" --format plain < synthetic.story.md
141
- neocortex-client invoke --args-file ./synthetic.story.md --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" --format plain
138
+ neocortex-client invoke --stdin --format plain < synthetic.story.md
139
+ neocortex-client invoke --args-file ./synthetic.story.md --format plain
142
140
  ```
143
141
 
144
142
  Do not force migration to these options, do not combine them with `--args`, and
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "neocortex"
3
- description: "Neocortex v4.66.4 | OrNexus Team"
3
+ description: "Neocortex v4.66.6 | OrNexus Team"
4
4
  tools:
5
5
  # Read / Edit (built-in tool sets)
6
6
  - read
@@ -82,7 +82,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
82
82
  ┌────────────────────────────────────────────────────────────┐
83
83
  │ │
84
84
  │ ####### N E O C O R T E X │
85
- │ ### ######## v4.66.4 │
85
+ │ ### ######## v4.66.6 │
86
86
  │ ######### ##### │
87
87
  │ ## ############## Development Orchestrator │
88
88
  │ ## ### ###### ## OrNexus Team │
@@ -132,12 +132,26 @@ Quando o usuario invocar este agente, siga EXATAMENTE este protocolo:
132
132
  ```bash
133
133
  neocortex-client invoke \
134
134
  --args "{ARGS_DO_USUARIO}" \
135
- --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" \
136
135
  --format plain
137
136
  ```
138
137
 
139
138
  3. **Seguir EXATAMENTE as instrucoes retornadas** pelo thin client no stdout
140
139
 
140
+ ## Degraded diagnose continuation
141
+
142
+ Inspect `metadata.diagnose` only when the explicit selected payload's canonical
143
+ trigger is `diagnose` and `assertDiagnoseDegradedContinuation` accepts the exact
144
+ `DiagnoseDegradedContinuation/1.0` object. Unknown, missing, or extra fields,
145
+ wrong literals, an absent contract, or an unrelated degraded reason authorizes
146
+ no additional inspection or action.
147
+
148
+ For an admitted continuation, the current agent alone may inspect only the
149
+ explicit request and public local read-only evidence. Return probable cause,
150
+ inspected evidence, limitation, and a safe plan. Do not claim protected workflow
151
+ execution, spawn or delegate, reinvoke Neocortex, create tasks, or write files.
152
+ Never include protected prompts, raw logs, secrets, PII, private URLs, ambient
153
+ conversation history, or asset-derived text.
154
+
141
155
  ### Compatibilidade para entrada grande
142
156
 
143
157
  Use `--args` exatamente como mostrado acima para triggers normais e prompts
@@ -146,8 +160,8 @@ explicitamente uma story sintetica ou mega prompt grande demais para caber com
146
160
  seguranca em um argumento de shell, use exatamente uma fonte de entrada grande:
147
161
 
148
162
  ```bash
149
- neocortex-client invoke --stdin --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" --format plain < synthetic.story.md
150
- neocortex-client invoke --args-file ./synthetic.story.md --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" --format plain
163
+ neocortex-client invoke --stdin --format plain < synthetic.story.md
164
+ neocortex-client invoke --args-file ./synthetic.story.md --format plain
151
165
  ```
152
166
 
153
167
  Nao force migracao para estas opcoes, nao combine com `--args`, e nao use estas