@ornexus/neocortex 4.61.5 → 4.62.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/dist/release-source.json +1 -1
- package/dist/sbom.cdx.json +1193 -1193
- package/install.ps1 +31 -34
- package/install.sh +1 -1
- package/package.json +5 -2
- package/packages/client/dist/adapters/adapter-registry.js +1 -108
- package/packages/client/dist/adapters/antigravity-adapter.js +2 -77
- package/packages/client/dist/adapters/claude-code-adapter.js +3 -79
- package/packages/client/dist/adapters/codex-adapter.js +2 -80
- package/packages/client/dist/adapters/cursor-adapter.js +4 -115
- package/packages/client/dist/adapters/gemini-adapter.js +2 -71
- package/packages/client/dist/adapters/grok-adapter.js +2 -42
- package/packages/client/dist/adapters/index.js +1 -22
- package/packages/client/dist/adapters/platform-detector.js +1 -220
- package/packages/client/dist/adapters/target-adapter.js +0 -12
- package/packages/client/dist/adapters/vscode-adapter.js +2 -72
- package/packages/client/dist/agent/refresh-stubs.js +2 -443
- package/packages/client/dist/agent/update-agent-yaml.js +1 -102
- package/packages/client/dist/agent/update-description.d.ts +8 -1
- package/packages/client/dist/agent/update-description.js +2 -260
- package/packages/client/dist/cache/crypto-utils.js +1 -78
- package/packages/client/dist/cache/encrypted-cache.js +1 -338
- package/packages/client/dist/cache/in-memory-asset-cache.js +1 -73
- package/packages/client/dist/cache/index.js +1 -13
- package/packages/client/dist/cache/protected-pi-boundary.js +1 -44
- package/packages/client/dist/checkpoint/checkpoint-client-reader.js +2 -127
- package/packages/client/dist/checkpoint/index.js +1 -11
- package/packages/client/dist/checkpoint/shared-checkpoint-types.js +1 -32
- package/packages/client/dist/cli.js +5 -364
- package/packages/client/dist/commands/activate.js +8 -394
- package/packages/client/dist/commands/architecture-answers.js +7 -274
- package/packages/client/dist/commands/architecture-memory-terminal.js +4 -253
- package/packages/client/dist/commands/architecture-non-ui-continuation.js +1 -100
- package/packages/client/dist/commands/architecture-root-binding.js +1 -51
- package/packages/client/dist/commands/cache-status.js +2 -112
- package/packages/client/dist/commands/config.js +1 -88
- package/packages/client/dist/commands/doctor.js +2 -635
- package/packages/client/dist/commands/invoke.d.ts +17 -0
- package/packages/client/dist/commands/invoke.js +148 -7822
- package/packages/client/dist/commands/legacy-epic-terminal.js +1 -71
- package/packages/client/dist/commands/legacy-story-branch.js +1 -96
- package/packages/client/dist/commands/legacy-story-pr.js +1 -276
- package/packages/client/dist/commands/mutation-qa-checkpoint.js +5 -285
- package/packages/client/dist/commands/mutation-qa-gate.js +1 -54
- package/packages/client/dist/commands/mutation-qa-git.js +1 -41
- package/packages/client/dist/commands/mutation-qa-policy.js +1 -102
- package/packages/client/dist/commands/mutation-qa-run.js +3 -219
- package/packages/client/dist/commands/mutation-qa-verdict.js +1 -149
- package/packages/client/dist/commands/mutation-qa.js +1 -220
- package/packages/client/dist/commands/native-agent.js +2 -136
- package/packages/client/dist/commands/planning-diagnosis.js +1 -43
- package/packages/client/dist/commands/planning-generation.js +1 -53
- package/packages/client/dist/commands/planning-memory.js +1 -40
- package/packages/client/dist/commands/planning-research.js +1 -42
- package/packages/client/dist/commands/private-session.js +1 -75
- package/packages/client/dist/commands/property-qa.js +1 -139
- package/packages/client/dist/commands/qa-control.js +1 -16
- package/packages/client/dist/commands/qa-scan-browser-launch.js +1 -55
- package/packages/client/dist/commands/qa-scan-browser-route.js +1 -28
- package/packages/client/dist/commands/qa-scan-capture.js +5 -663
- package/packages/client/dist/commands/qa-scan-discovery.js +3 -376
- package/packages/client/dist/commands/qa-scan-review.js +5 -826
- package/packages/client/dist/commands/qa-synthetic-backend-capture.js +1 -266
- package/packages/client/dist/commands/qa-synthetic-backend-review.js +1 -297
- package/packages/client/dist/commands/qa-synthetic-backend.js +2 -340
- package/packages/client/dist/commands/qa-synthetic-broker-port.js +1 -85
- package/packages/client/dist/commands/qa-synthetic-browser.js +1 -39
- package/packages/client/dist/commands/refactor-characterization.js +21 -671
- package/packages/client/dist/commands/refactor-commit.js +13 -399
- package/packages/client/dist/commands/refactor-control.js +3 -142
- package/packages/client/dist/commands/refactor-cpp-assertions.js +3 -93
- package/packages/client/dist/commands/refactor-review.js +5 -283
- package/packages/client/dist/commands/refactor-root.js +7 -588
- package/packages/client/dist/commands/refresh-memory.js +3 -174
- package/packages/client/dist/commands/shared-architecture-non-ui.js +1 -24
- package/packages/client/dist/commands/story-checkpoint.d.ts +5 -1
- package/packages/client/dist/commands/story-checkpoint.js +1 -203
- package/packages/client/dist/commands/story-worktree.js +5 -258
- package/packages/client/dist/config/host-auth-broker.js +1 -60
- package/packages/client/dist/config/host-auth-reference.js +1 -93
- package/packages/client/dist/config/profile-directory.js +1 -13
- package/packages/client/dist/config/resolver-selection.js +1 -278
- package/packages/client/dist/config/secure-config.js +12 -281
- package/packages/client/dist/config.js +2 -224
- package/packages/client/dist/constants.js +1 -25
- package/packages/client/dist/context/context-collector.js +2 -222
- package/packages/client/dist/context/context-sanitizer.js +1 -145
- package/packages/client/dist/continuity/autonomous-governance.js +1 -285
- package/packages/client/dist/continuity/continuity-client-state-store.js +1 -1587
- package/packages/client/dist/continuity/invoke-hooks.js +1 -129
- package/packages/client/dist/continuity/migrations/001-initial-schema.js +2 -12
- package/packages/client/dist/continuity/migrations/002-processing-output-summary-indexes.js +2 -12
- package/packages/client/dist/continuity/migrations/003-headless-execution-attempts.js +2 -12
- package/packages/client/dist/continuity/migrations/004-outbox-delivery-state.js +2 -12
- package/packages/client/dist/continuity/migrations/005-bounded-headless-queue.js +2 -12
- package/packages/client/dist/continuity/migrations/006-native-agent-dispatches.js +2 -10
- package/packages/client/dist/continuity/native-agent-store.js +1 -69
- package/packages/client/dist/continuity/native-agent-types.js +1 -105
- package/packages/client/dist/continuity/outbox.js +1 -117
- package/packages/client/dist/continuity/runner-bootstrap-policy.js +1 -172
- package/packages/client/dist/continuity/sqlite-store.js +81 -2612
- package/packages/client/dist/effects/invoke-effect-gateways.js +1 -62
- package/packages/client/dist/errors/error-messages.js +2 -258
- package/packages/client/dist/errors/frontmatter-diagnostics.d.ts +10 -1
- package/packages/client/dist/errors/frontmatter-diagnostics.js +1 -125
- package/packages/client/dist/evidence/collector.js +1 -347
- package/packages/client/dist/evidence/index.js +1 -1
- package/packages/client/dist/evidence/types.js +0 -2
- package/packages/client/dist/fs/atomic-state-replace.js +1 -152
- package/packages/client/dist/generated/command-registry.generated.js +1 -4076
- package/packages/client/dist/generated/public-projections.generated.js +1 -149
- package/packages/client/dist/git/direct-yolo-c01-retry.js +4 -138
- package/packages/client/dist/git/direct-yolo-checkpoint.d.ts +94 -9
- package/packages/client/dist/git/direct-yolo-checkpoint.js +3 -1592
- package/packages/client/dist/git/epic-operational-state.js +2 -672
- package/packages/client/dist/git/git-lifecycle-step-ids.js +1 -14
- package/packages/client/dist/git/git-lifecycle-store.d.ts +88 -0
- package/packages/client/dist/git/git-lifecycle-store.js +9 -2529
- package/packages/client/dist/git/legacy-story-branch-checkpoint.js +9 -259
- package/packages/client/dist/git/legacy-story-branch-setup.js +4 -348
- package/packages/client/dist/git/legacy-story-pr.js +70 -3538
- package/packages/client/dist/git/neocortex-trailers.js +2 -53
- package/packages/client/dist/git/release-gate-env.d.ts +62 -0
- package/packages/client/dist/git/release-gate-env.js +1 -0
- package/packages/client/dist/git/secure-filesystem-boundary.d.ts +24 -0
- package/packages/client/dist/git/secure-filesystem-boundary.js +20 -186
- package/packages/client/dist/git/story-worktree-cleanup.js +4 -1058
- package/packages/client/dist/git/story-worktree-integration.d.ts +62 -0
- package/packages/client/dist/git/story-worktree-integration.js +3 -603
- package/packages/client/dist/git/story-worktree-manager.js +3 -843
- package/packages/client/dist/git/story-worktree-paths.js +1 -150
- package/packages/client/dist/git/story-write-set-extension.d.ts +44 -0
- package/packages/client/dist/git/story-write-set-extension.js +1 -0
- package/packages/client/dist/graph-retrieval/pre-command-hook.js +1 -284
- package/packages/client/dist/graph-retrieval/shared-graph-retrieval-contract.js +1 -237
- package/packages/client/dist/i18n/first-run.js +2 -60
- package/packages/client/dist/index.js +1 -50
- package/packages/client/dist/invocation/invoke-input.js +1 -24
- package/packages/client/dist/license/host-auth-recovery.js +1 -401
- package/packages/client/dist/license/index.js +1 -5
- package/packages/client/dist/license/license-client.js +1 -337
- package/packages/client/dist/machine/fingerprint.js +2 -163
- package/packages/client/dist/machine/index.js +1 -5
- package/packages/client/dist/memory/project-memory-path-scope.js +1 -62
- package/packages/client/dist/memory/project-memory-writer.js +41 -1117
- package/packages/client/dist/memory/shared-project-memory-types.js +2 -259
- package/packages/client/dist/migrations/epic-lifecycle-backfill.js +3 -1060
- package/packages/client/dist/migrations/project-identity-capability.js +1 -50
- package/packages/client/dist/migrations/project-identity.js +7 -493
- package/packages/client/dist/migrations/state-json.js +4 -393
- package/packages/client/dist/policy/architecture-policy.js +2 -184
- package/packages/client/dist/policy/index.js +1 -7
- package/packages/client/dist/policy/shared-policy-types.js +0 -38
- package/packages/client/dist/policy/subagent-approval-policy.js +1 -57
- package/packages/client/dist/private-execution/clean-baseline.js +2 -279
- package/packages/client/dist/private-execution/codex-executor.js +4 -574
- package/packages/client/dist/private-execution/codex-host-runtime.js +1 -137
- package/packages/client/dist/private-execution/codex-lifecycle-guard.js +1 -97
- package/packages/client/dist/private-execution/codex-scoped-permissions.js +1 -128
- package/packages/client/dist/private-execution/delivery.js +13 -410
- package/packages/client/dist/private-execution/diagnosis-root-review.js +2 -294
- package/packages/client/dist/private-execution/frozen-handoff.js +6 -19
- package/packages/client/dist/private-execution/implementation-validation.js +2 -106
- package/packages/client/dist/private-execution/isolated-admission.js +23 -1432
- package/packages/client/dist/private-execution/isolated-session.js +5 -725
- package/packages/client/dist/private-execution/isolated-workspace.js +1 -122
- package/packages/client/dist/private-execution/pact-consumer-runtime.js +3 -409
- package/packages/client/dist/private-execution/pact-test-source.js +1 -258
- package/packages/client/dist/private-execution/pact-toolchain.js +3 -290
- package/packages/client/dist/private-execution/pact-write-set.js +1 -172
- package/packages/client/dist/private-execution/planning-diagnosis-checkpoint.js +5 -406
- package/packages/client/dist/private-execution/planning-generation-checkpoint.js +5 -462
- package/packages/client/dist/private-execution/planning-memory-checkpoint.js +3 -139
- package/packages/client/dist/private-execution/planning-research-checkpoint.js +4 -325
- package/packages/client/dist/private-execution/private-report-store.js +1 -42
- package/packages/client/dist/private-execution/property-test-candidate.js +1 -103
- package/packages/client/dist/private-execution/property-test-choices.js +3 -147
- package/packages/client/dist/private-execution/property-test-plan.js +7 -271
- package/packages/client/dist/private-execution/property-test-review.js +4 -258
- package/packages/client/dist/private-execution/property-test-runtime.js +9 -372
- package/packages/client/dist/private-execution/property-test-source.js +1 -139
- package/packages/client/dist/private-execution/root-checkpoint.js +1 -80
- package/packages/client/dist/private-execution/root-memory-git-evidence.js +3 -135
- package/packages/client/dist/private-execution/root-memory-recovery.js +1 -93
- package/packages/client/dist/private-execution/root-memory-request.js +1 -29
- package/packages/client/dist/private-execution/root-memory-scope.js +1 -178
- package/packages/client/dist/private-execution/root-memory-writer.js +1 -102
- package/packages/client/dist/private-execution/session-lease.js +1 -63
- package/packages/client/dist/private-execution/shared-private-admission-types.js +1 -50
- package/packages/client/dist/private-execution/shared-project-validation.js +1 -66
- package/packages/client/dist/private-execution/shared-root-memory-types.js +1 -61
- package/packages/client/dist/private-execution/ux-source-validation.js +1 -372
- package/packages/client/dist/private-execution/ux-write-set.js +2 -191
- package/packages/client/dist/registry/registry-reconciliation.js +1 -234
- package/packages/client/dist/resilience/circuit-breaker.js +1 -170
- package/packages/client/dist/resilience/degradation-manager.js +1 -164
- package/packages/client/dist/resilience/freshness-indicator.js +1 -100
- package/packages/client/dist/resilience/index.js +1 -8
- package/packages/client/dist/resilience/recovery-detector.js +1 -74
- package/packages/client/dist/resolvers/asset-resolver.js +0 -13
- package/packages/client/dist/resolvers/local-resolver.js +8 -255
- package/packages/client/dist/resolvers/remote-resolver.js +1 -233
- package/packages/client/dist/runner/binary.js +1 -404
- package/packages/client/dist/runner/cli.js +17 -1571
- package/packages/client/dist/runner/epic-background-dispatcher.js +1 -124
- package/packages/client/dist/runner/headless/adapters.js +1 -49
- package/packages/client/dist/runner/headless/background-root.js +1 -85
- package/packages/client/dist/runner/headless/child-env.d.ts +92 -0
- package/packages/client/dist/runner/headless/child-env.js +1 -0
- package/packages/client/dist/runner/headless/claude-code-adapter.js +1 -79
- package/packages/client/dist/runner/headless/continuous-story-workspace.js +11 -1776
- package/packages/client/dist/runner/headless/epic-git-reconciliation-inventory.js +1 -69
- package/packages/client/dist/runner/headless/epic-merge-candidate-qa.js +2 -111
- package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.d.ts +1 -0
- package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.js +10 -1464
- package/packages/client/dist/runner/headless/epic-terminal-git-runner.js +2 -357
- package/packages/client/dist/runner/headless/fake-adapter.js +1 -62
- package/packages/client/dist/runner/headless/managed-environment-cleanup.js +1 -274
- package/packages/client/dist/runner/headless/managed-profile.js +1 -149
- package/packages/client/dist/runner/headless/opencode-adapter.js +2 -145
- package/packages/client/dist/runner/headless/prepared-story-bundle.js +1 -43
- package/packages/client/dist/runner/headless/resolver.js +1 -231
- package/packages/client/dist/runner/headless/run-yolo.js +1 -886
- package/packages/client/dist/runner/headless/run-yoloop.js +2 -2657
- package/packages/client/dist/runner/headless/types.js +2 -575
- package/packages/client/dist/runner/host-capacity.js +1 -59
- package/packages/client/dist/runner/local-console.js +13 -396
- package/packages/client/dist/runner/portal-sync-worker.js +1 -1487
- package/packages/client/dist/runner/project-identity.js +1 -106
- package/packages/client/dist/runner/scheduler.js +7 -995
- package/packages/client/dist/runner-cli.js +2 -18
- package/packages/client/dist/state/invocation-shape.js +1 -13
- package/packages/client/dist/state/project-state-snapshot.js +1 -1754
- package/packages/client/dist/state/state-json-repair.js +3 -785
- package/packages/client/dist/state/structural-dag-projection.js +1 -118
- package/packages/client/dist/telemetry/index.js +1 -5
- package/packages/client/dist/telemetry/offline-queue.js +1 -131
- package/packages/client/dist/tier/index.js +1 -5
- package/packages/client/dist/tier/tier-aware-client.js +1 -405
- package/packages/client/dist/types/index.js +1 -38
- package/packages/client/dist/version.js +1 -27
- package/packages/client/dist/yolo/change-evidence-collector.d.ts +10 -0
- package/packages/client/dist/yolo/change-evidence-collector.js +1 -262
- package/packages/client/dist/yolo/invoke-envelope-capability.d.ts +2 -0
- package/packages/client/dist/yolo/invoke-envelope-capability.js +1 -65
- package/packages/client/dist/yolo/project-manifest-projection-collector.d.ts +28 -0
- package/packages/client/dist/yolo/project-manifest-projection-collector.js +1 -0
- package/packages/client/dist/yolo/spec-envelope-collector.d.ts +9 -0
- package/packages/client/dist/yolo/spec-envelope-collector.js +5 -184
- package/packages/client/dist/yoloop/discovery-hook.js +2 -300
- package/packages/client/dist/yoloop/index.js +1 -8
- package/packages/client/dist/yoloop/invoke-hooks.js +12 -669
- package/packages/client/dist/yoloop/shared-discover-epics.d.ts +16 -0
- package/packages/client/dist/yoloop/shared-discover-epics.js +1 -1007
- package/packages/client/dist/yoloop/shared-yoloop-types.js +1 -33
- package/packages/client/dist/yoloop/target-normalization.js +1 -180
- package/packages/client/dist/yoloop/yoloop-client-state-store.js +1 -1920
- package/packages/shared/dist/frontmatter-context-contract.js +164 -52
- package/packages/shared/dist/project-manifest-projection.js +199 -0
- package/packages/shared/dist/project-validation-commands.js +14 -6
- package/packages/shared/dist/yolo/spec-envelope-rules.js +85 -0
- package/packages/shared/dist/yolo/spec-envelope.js +33 -7
- package/packages/shared/dist/yoloop/epic-terminal-git.js +94 -6
- package/packages/shared/dist/yoloop/story-write-scope.js +212 -0
- package/targets-stubs/antigravity/gemini.md +1 -1
- package/targets-stubs/antigravity/install-antigravity.sh +13 -4
- package/targets-stubs/antigravity/skill/SKILL.md +1 -1
- package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
- package/targets-stubs/claude-code/neocortex-root.md +2 -2
- package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
- package/targets-stubs/claude-code/neocortex.md +5 -5
- package/targets-stubs/codex/AGENTS.md +1 -1
- package/targets-stubs/cursor/agent.md +2 -2
- package/targets-stubs/gemini-cli/agent.md +2 -2
- package/targets-stubs/lib/managed-config-merge.js +77 -1
- package/targets-stubs/lib/managed-profile.sh +7 -0
- package/targets-stubs/opencode/neocortex-root.md +1 -1
- package/targets-stubs/vscode/install-vscode.sh +21 -0
- package/targets-stubs/vscode/neocortex.agent.md +2 -2
package/install.ps1
CHANGED
|
@@ -17,7 +17,7 @@ param(
|
|
|
17
17
|
[string]$ServerUrl = ('https://{0}.{1}.{2}' -f 'api','neocortex','sh')
|
|
18
18
|
)
|
|
19
19
|
|
|
20
|
-
$VERSION = "4.
|
|
20
|
+
$VERSION = "4.62.0"
|
|
21
21
|
|
|
22
22
|
# =============================================================================
|
|
23
23
|
# CONFIGURACOES
|
|
@@ -368,6 +368,21 @@ function Get-ManagedPlatformBase {
|
|
|
368
368
|
return $DefaultBase
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
+
# P226.13: true when a destination resolves to the user home. A global install
|
|
372
|
+
# targets the home; project folders (.github\*, .agent\*) must never be created
|
|
373
|
+
# there. Only guards creation; nothing is ever removed.
|
|
374
|
+
function Test-NeocortexUserHome {
|
|
375
|
+
param([string]$Path, [string]$HomePath = $env:USERPROFILE)
|
|
376
|
+
if (-not $Path -or -not $HomePath) { return $false }
|
|
377
|
+
try {
|
|
378
|
+
$candidate = [System.IO.Path]::GetFullPath($Path).TrimEnd('\', '/')
|
|
379
|
+
$homeFull = [System.IO.Path]::GetFullPath($HomePath).TrimEnd('\', '/')
|
|
380
|
+
} catch {
|
|
381
|
+
return $false
|
|
382
|
+
}
|
|
383
|
+
return [string]::Equals($candidate, $homeFull, [System.StringComparison]::OrdinalIgnoreCase)
|
|
384
|
+
}
|
|
385
|
+
|
|
371
386
|
# =============================================================================
|
|
372
387
|
# ACL HELPERS (Story 66.1 - Windows file permission hardening)
|
|
373
388
|
# Fail-open: never throws, never blocks installation
|
|
@@ -1465,28 +1480,16 @@ function Install-Targets {
|
|
|
1465
1480
|
# P201.08: preserve existing agents/skills; update owned files only.
|
|
1466
1481
|
|
|
1467
1482
|
# P124.02: source filename is neocortex.agent.md (canonical Custom Agents extension).
|
|
1483
|
+
# P226.13: global install never creates project folders (.github\*) in
|
|
1484
|
+
# the home; the user-level Custom Agents location is ~/.copilot/agents.
|
|
1468
1485
|
if (Test-Path "$vscodeTargetDir\neocortex.agent.md") {
|
|
1469
|
-
New-Item -ItemType Directory -Path "$homeDir\.github\agents" -Force | Out-Null
|
|
1470
|
-
Copy-ManagedFile -Source "$vscodeTargetDir\neocortex.agent.md" -Destination "$homeDir\.github\agents\neocortex.agent.md" -ManagedId "profile-vscode-neocortex-agent" -BaseDir $homeDir | Out-Null
|
|
1471
|
-
Copy-ManagedFile -Source "$vscodeTargetDir\neocortex.agent.md" -Destination "$homeDir\.github\agents\neocortex.md" -ManagedId "profile-vscode-neocortex-compat" -BaseDir $homeDir | Out-Null
|
|
1472
1486
|
New-Item -ItemType Directory -Path "$homeDir\.copilot\agents" -Force | Out-Null
|
|
1473
1487
|
Copy-ManagedFile -Source "$vscodeTargetDir\neocortex.agent.md" -Destination "$homeDir\.copilot\agents\neocortex.agent.md" -ManagedId "profile-copilot-neocortex-agent" -BaseDir $homeDir | Out-Null
|
|
1474
1488
|
}
|
|
1475
|
-
if (Test-Path "$vscodeTargetDir\instructions" -PathType Container) {
|
|
1476
|
-
New-Item -ItemType Directory -Path "$homeDir\.github\instructions" -Force | Out-Null
|
|
1477
|
-
Copy-Item -Path "$vscodeTargetDir\instructions\*.instructions.md" -Destination "$homeDir\.github\instructions\" -Force -ErrorAction SilentlyContinue
|
|
1478
|
-
}
|
|
1479
|
-
if (Test-Path "$vscodeTargetDir\prompts" -PathType Container) {
|
|
1480
|
-
New-Item -ItemType Directory -Path "$homeDir\.github\prompts" -Force | Out-Null
|
|
1481
|
-
Copy-Item -Path "$vscodeTargetDir\prompts\*.prompt.md" -Destination "$homeDir\.github\prompts\" -Force -ErrorAction SilentlyContinue
|
|
1482
|
-
}
|
|
1483
1489
|
if (Test-Path "$vscodeTargetDir\mcp.json") {
|
|
1484
1490
|
# User-level additive merge -- preserves user-defined servers (root key is "servers" in VS Code)
|
|
1485
1491
|
Merge-JsonMcpConfig -StubFile "$vscodeTargetDir\mcp.json" -DestFile (Get-VsCodeUserMcpPath) -RootKey "servers"
|
|
1486
1492
|
}
|
|
1487
|
-
if (Test-Path "$vscodeTargetDir\copilot-instructions.md") {
|
|
1488
|
-
Copy-ManagedFile -Source "$vscodeTargetDir\copilot-instructions.md" -Destination "$homeDir\.github\copilot-instructions.md" -ManagedId "profile-vscode-copilot-instructions" -BaseDir $homeDir | Out-Null
|
|
1489
|
-
}
|
|
1490
1493
|
Write-Ok "vscode"
|
|
1491
1494
|
$script:TargetResults += "$target`:OK"
|
|
1492
1495
|
$script:TargetCount++
|
|
@@ -1582,22 +1585,11 @@ function Install-Targets {
|
|
|
1582
1585
|
$geminiHome = if ($env:GEMINI_HOME) { $env:GEMINI_HOME } else { "$homeDir\.gemini" }
|
|
1583
1586
|
if ($antiTargetDir -and (Test-Path $antiTargetDir -PathType Container)) {
|
|
1584
1587
|
# NOTE: Do NOT recursively delete $geminiHome\antigravity -- merge mcp_config.json instead
|
|
1585
|
-
|
|
1586
|
-
New-Item -ItemType Directory -Path "$homeDir\.agent\skills\neocortex" -Force | Out-Null
|
|
1587
|
-
Copy-ManagedFile -Source "$antiTargetDir\skill\SKILL.md" -Destination "$homeDir\.agent\skills\neocortex\SKILL.md" -ManagedId "profile-antigravity-skill" -BaseDir $homeDir | Out-Null
|
|
1588
|
-
}
|
|
1588
|
+
# P226.13: global install never creates project folders (.agent\*) in the home.
|
|
1589
1589
|
if (Test-Path "$antiTargetDir\neocortex.md") {
|
|
1590
1590
|
New-Item -ItemType Directory -Path "$geminiHome\config\agents" -Force | Out-Null
|
|
1591
1591
|
Copy-ManagedFile -Source "$antiTargetDir\neocortex.md" -Destination "$geminiHome\config\agents\neocortex.md" -ManagedId "profile-antigravity-neocortex" -BaseDir $geminiHome | Out-Null
|
|
1592
1592
|
}
|
|
1593
|
-
if (Test-Path "$antiTargetDir\rules" -PathType Container) {
|
|
1594
|
-
New-Item -ItemType Directory -Path "$homeDir\.agent\rules" -Force | Out-Null
|
|
1595
|
-
Copy-Item -Path "$antiTargetDir\rules\*.md" -Destination "$homeDir\.agent\rules\" -Force -ErrorAction SilentlyContinue
|
|
1596
|
-
}
|
|
1597
|
-
if (Test-Path "$antiTargetDir\workflows" -PathType Container) {
|
|
1598
|
-
New-Item -ItemType Directory -Path "$homeDir\.agent\workflows" -Force | Out-Null
|
|
1599
|
-
Copy-Item -Path "$antiTargetDir\workflows\*.md" -Destination "$homeDir\.agent\workflows\" -Force -ErrorAction SilentlyContinue
|
|
1600
|
-
}
|
|
1601
1593
|
if (Test-Path "$antiTargetDir\mcp-config.json") {
|
|
1602
1594
|
New-Item -ItemType Directory -Path "$geminiHome\antigravity" -Force | Out-Null
|
|
1603
1595
|
# Antigravity uses root mcpServers; preserve custom entries while migrating managed legacy top-level entries.
|
|
@@ -1784,21 +1776,24 @@ function New-ProjectDirectories {
|
|
|
1784
1776
|
"vscode" {
|
|
1785
1777
|
$vscodeTargetDir = Resolve-TargetDir -Target "vscode"
|
|
1786
1778
|
if ($vscodeTargetDir -and (Test-Path $vscodeTargetDir -PathType Container)) {
|
|
1779
|
+
# P226.13: a project directory that resolves to the home is a global
|
|
1780
|
+
# destination; skip project folders there (nothing is removed).
|
|
1781
|
+
$vscodeProjectIsHome = Test-NeocortexUserHome -Path $projectDir
|
|
1787
1782
|
# P124.02: source filename is neocortex.agent.md (canonical Custom Agents extension).
|
|
1788
|
-
if (Test-Path "$vscodeTargetDir\neocortex.agent.md") {
|
|
1783
|
+
if ((-not $vscodeProjectIsHome) -and (Test-Path "$vscodeTargetDir\neocortex.agent.md")) {
|
|
1789
1784
|
New-Item -ItemType Directory -Path "$projectDir\.github\agents" -Force | Out-Null
|
|
1790
1785
|
Copy-ManagedFile -Source "$vscodeTargetDir\neocortex.agent.md" -Destination "$projectDir\.github\agents\neocortex.agent.md" -ManagedId "project-vscode-neocortex-agent" -BaseDir $projectDir | Out-Null
|
|
1791
1786
|
Copy-ManagedFile -Source "$vscodeTargetDir\neocortex.agent.md" -Destination "$projectDir\.github\agents\neocortex.md" -ManagedId "project-vscode-neocortex-compat" -BaseDir $projectDir | Out-Null
|
|
1792
1787
|
}
|
|
1793
|
-
if (Test-Path "$vscodeTargetDir\instructions" -PathType Container) {
|
|
1788
|
+
if ((-not $vscodeProjectIsHome) -and (Test-Path "$vscodeTargetDir\instructions" -PathType Container)) {
|
|
1794
1789
|
New-Item -ItemType Directory -Path "$projectDir\.github\instructions" -Force | Out-Null
|
|
1795
1790
|
Copy-Item -Path "$vscodeTargetDir\instructions\*.instructions.md" -Destination "$projectDir\.github\instructions\" -Force -ErrorAction SilentlyContinue
|
|
1796
1791
|
}
|
|
1797
|
-
if (Test-Path "$vscodeTargetDir\prompts" -PathType Container) {
|
|
1792
|
+
if ((-not $vscodeProjectIsHome) -and (Test-Path "$vscodeTargetDir\prompts" -PathType Container)) {
|
|
1798
1793
|
New-Item -ItemType Directory -Path "$projectDir\.github\prompts" -Force | Out-Null
|
|
1799
1794
|
Copy-Item -Path "$vscodeTargetDir\prompts\*.prompt.md" -Destination "$projectDir\.github\prompts\" -Force -ErrorAction SilentlyContinue
|
|
1800
1795
|
}
|
|
1801
|
-
if (Test-Path "$vscodeTargetDir\copilot-instructions.md") {
|
|
1796
|
+
if ((-not $vscodeProjectIsHome) -and (Test-Path "$vscodeTargetDir\copilot-instructions.md")) {
|
|
1802
1797
|
Copy-ManagedFile -Source "$vscodeTargetDir\copilot-instructions.md" -Destination "$projectDir\.github\copilot-instructions.md" -ManagedId "project-vscode-copilot-instructions" -BaseDir $projectDir | Out-Null
|
|
1803
1798
|
}
|
|
1804
1799
|
$targetSummary += "vscode"
|
|
@@ -1845,7 +1840,9 @@ function New-ProjectDirectories {
|
|
|
1845
1840
|
"antigravity" {
|
|
1846
1841
|
$antiTargetDir = Resolve-TargetDir -Target "antigravity"
|
|
1847
1842
|
if ($antiTargetDir -and (Test-Path $antiTargetDir -PathType Container)) {
|
|
1848
|
-
|
|
1843
|
+
# P226.13: skip project .agent\* folders when the project resolves to the home.
|
|
1844
|
+
$antiProjectIsHome = Test-NeocortexUserHome -Path $projectDir
|
|
1845
|
+
if ((-not $antiProjectIsHome) -and (Test-Path "$antiTargetDir\skill\SKILL.md")) {
|
|
1849
1846
|
New-Item -ItemType Directory -Path "$projectDir\.agent\skills\neocortex" -Force | Out-Null
|
|
1850
1847
|
Copy-ManagedFile -Source "$antiTargetDir\skill\SKILL.md" -Destination "$projectDir\.agent\skills\neocortex\SKILL.md" -ManagedId "project-antigravity-skill" -BaseDir $projectDir | Out-Null
|
|
1851
1848
|
}
|
|
@@ -1853,11 +1850,11 @@ function New-ProjectDirectories {
|
|
|
1853
1850
|
New-Item -ItemType Directory -Path "$projectDir\.agents\agents" -Force | Out-Null
|
|
1854
1851
|
Copy-ManagedFile -Source "$antiTargetDir\neocortex.md" -Destination "$projectDir\.agents\agents\neocortex.md" -ManagedId "project-antigravity-neocortex" -BaseDir $projectDir | Out-Null
|
|
1855
1852
|
}
|
|
1856
|
-
if (Test-Path "$antiTargetDir\rules" -PathType Container) {
|
|
1853
|
+
if ((-not $antiProjectIsHome) -and (Test-Path "$antiTargetDir\rules" -PathType Container)) {
|
|
1857
1854
|
New-Item -ItemType Directory -Path "$projectDir\.agent\rules" -Force | Out-Null
|
|
1858
1855
|
Copy-Item -Path "$antiTargetDir\rules\*.md" -Destination "$projectDir\.agent\rules\" -Force -ErrorAction SilentlyContinue
|
|
1859
1856
|
}
|
|
1860
|
-
if (Test-Path "$antiTargetDir\workflows" -PathType Container) {
|
|
1857
|
+
if ((-not $antiProjectIsHome) -and (Test-Path "$antiTargetDir\workflows" -PathType Container)) {
|
|
1861
1858
|
New-Item -ItemType Directory -Path "$projectDir\.agent\workflows" -Force | Out-Null
|
|
1862
1859
|
Copy-Item -Path "$antiTargetDir\workflows\*.md" -Destination "$projectDir\.agent\workflows\" -Force -ErrorAction SilentlyContinue
|
|
1863
1860
|
}
|
package/install.sh
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ornexus/neocortex",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "Neocortex v4.
|
|
3
|
+
"version": "4.62.0",
|
|
4
|
+
"description": "Neocortex v4.62.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
|
7
7
|
"claude-code",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"packages/shared/dist/strict-readonly.js",
|
|
59
59
|
"packages/shared/dist/frontmatter-context-contract.js",
|
|
60
60
|
"packages/shared/dist/yolo/spec-envelope.js",
|
|
61
|
+
"packages/shared/dist/yolo/spec-envelope-rules.js",
|
|
61
62
|
"packages/shared/dist/yolo/change-evidence.js",
|
|
62
63
|
"packages/shared/dist/invocation/",
|
|
63
64
|
"packages/shared/dist/compatibility/index.js",
|
|
@@ -85,9 +86,11 @@
|
|
|
85
86
|
"packages/shared/dist/yoloop/epic-terminal-git.js",
|
|
86
87
|
"packages/shared/dist/yoloop/operational-budget.js",
|
|
87
88
|
"packages/shared/dist/yoloop/host-capacity.js",
|
|
89
|
+
"packages/shared/dist/project-manifest-projection.js",
|
|
88
90
|
"packages/shared/dist/yoloop/wave-decision-receipt.js",
|
|
89
91
|
"packages/shared/dist/yoloop/planning-graph.js",
|
|
90
92
|
"packages/shared/dist/yoloop/public-story-write-set.js",
|
|
93
|
+
"packages/shared/dist/yoloop/story-write-scope.js",
|
|
91
94
|
"packages/shared/dist/yoloop/recovery-types.js",
|
|
92
95
|
"packages/shared/dist/yoloop/release-blocked.js",
|
|
93
96
|
"!packages/client/dist/**/*.js.map",
|
|
@@ -1,108 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* @license FSL-1.1
|
|
3
|
-
* Copyright (c) 2026 OrNexus AI
|
|
4
|
-
*
|
|
5
|
-
* Adapter Registry - Plugin-style registry for target adapters.
|
|
6
|
-
*
|
|
7
|
-
* Manages registration and lookup of TargetAdapter instances.
|
|
8
|
-
* Supports dynamic registration for extensibility and provides
|
|
9
|
-
* a factory function for the default set of 6 adapters.
|
|
10
|
-
*
|
|
11
|
-
* Story 42.8
|
|
12
|
-
*/
|
|
13
|
-
import { ClaudeCodeAdapter } from './claude-code-adapter.js';
|
|
14
|
-
import { CursorAdapter } from './cursor-adapter.js';
|
|
15
|
-
import { VSCodeAdapter } from './vscode-adapter.js';
|
|
16
|
-
import { GeminiAdapter } from './gemini-adapter.js';
|
|
17
|
-
import { CodexAdapter } from './codex-adapter.js';
|
|
18
|
-
import { AntigravityAdapter } from './antigravity-adapter.js';
|
|
19
|
-
import { GrokAdapter } from './grok-adapter.js';
|
|
20
|
-
// ── Error Types ─────────────────────────────────────────────────────────────
|
|
21
|
-
export class UnknownTargetError extends Error {
|
|
22
|
-
targetId;
|
|
23
|
-
constructor(targetId) {
|
|
24
|
-
super(`Unknown target: "${targetId}". Available targets: ${[...DEFAULT_ADAPTERS.keys()].join(', ')}`);
|
|
25
|
-
this.targetId = targetId;
|
|
26
|
-
this.name = 'UnknownTargetError';
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
// ── Default Adapters Map ────────────────────────────────────────────────────
|
|
30
|
-
const DEFAULT_ADAPTERS = new Map([
|
|
31
|
-
['claude-code', () => new ClaudeCodeAdapter()],
|
|
32
|
-
['cursor', () => new CursorAdapter()],
|
|
33
|
-
['vscode', () => new VSCodeAdapter()],
|
|
34
|
-
['gemini-cli', () => new GeminiAdapter()],
|
|
35
|
-
['codex', () => new CodexAdapter()],
|
|
36
|
-
['antigravity', () => new AntigravityAdapter()],
|
|
37
|
-
['grok', () => new GrokAdapter()],
|
|
38
|
-
]);
|
|
39
|
-
// ── Registry Implementation ─────────────────────────────────────────────────
|
|
40
|
-
export class AdapterRegistry {
|
|
41
|
-
adapters = new Map();
|
|
42
|
-
/**
|
|
43
|
-
* Register a target adapter.
|
|
44
|
-
*
|
|
45
|
-
* @param adapter - The adapter instance to register
|
|
46
|
-
* @throws Error if an adapter with the same target ID is already registered
|
|
47
|
-
*/
|
|
48
|
-
register(adapter) {
|
|
49
|
-
const id = adapter.getTargetId();
|
|
50
|
-
if (this.adapters.has(id)) {
|
|
51
|
-
throw new Error(`Adapter already registered for target: "${id}"`);
|
|
52
|
-
}
|
|
53
|
-
this.adapters.set(id, adapter);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Get an adapter by target ID.
|
|
57
|
-
*
|
|
58
|
-
* @param targetId - The target platform identifier
|
|
59
|
-
* @returns The adapter instance, or undefined if not found
|
|
60
|
-
*/
|
|
61
|
-
get(targetId) {
|
|
62
|
-
return this.adapters.get(targetId);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Get an adapter by target ID, throwing if not found.
|
|
66
|
-
*
|
|
67
|
-
* @param targetId - The target platform identifier
|
|
68
|
-
* @returns The adapter instance
|
|
69
|
-
* @throws UnknownTargetError if no adapter is registered for the target
|
|
70
|
-
*/
|
|
71
|
-
getOrThrow(targetId) {
|
|
72
|
-
const adapter = this.adapters.get(targetId);
|
|
73
|
-
if (!adapter) {
|
|
74
|
-
throw new UnknownTargetError(targetId);
|
|
75
|
-
}
|
|
76
|
-
return adapter;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Check if an adapter is registered for a target.
|
|
80
|
-
*
|
|
81
|
-
* @param targetId - The target platform identifier
|
|
82
|
-
* @returns true if an adapter is registered
|
|
83
|
-
*/
|
|
84
|
-
has(targetId) {
|
|
85
|
-
return this.adapters.has(targetId);
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* List all registered target IDs.
|
|
89
|
-
*
|
|
90
|
-
* @returns Array of registered target identifiers
|
|
91
|
-
*/
|
|
92
|
-
listTargets() {
|
|
93
|
-
return [...this.adapters.keys()];
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
// ── Factory Function ────────────────────────────────────────────────────────
|
|
97
|
-
/**
|
|
98
|
-
* Create a registry pre-populated with all default platform adapters.
|
|
99
|
-
*
|
|
100
|
-
* @returns AdapterRegistry with all supported prompt adapters
|
|
101
|
-
*/
|
|
102
|
-
export function createDefaultRegistry() {
|
|
103
|
-
const registry = new AdapterRegistry();
|
|
104
|
-
for (const [, factory] of DEFAULT_ADAPTERS) {
|
|
105
|
-
registry.register(factory());
|
|
106
|
-
}
|
|
107
|
-
return registry;
|
|
108
|
-
}
|
|
1
|
+
import{ClaudeCodeAdapter as o}from"./claude-code-adapter.js";import{CursorAdapter as s}from"./cursor-adapter.js";import{VSCodeAdapter as n}from"./vscode-adapter.js";import{GeminiAdapter as i}from"./gemini-adapter.js";import{CodexAdapter as d}from"./codex-adapter.js";import{AntigravityAdapter as p}from"./antigravity-adapter.js";import{GrokAdapter as g}from"./grok-adapter.js";class c extends Error{targetId;constructor(r){super(`Unknown target: "${r}". Available targets: ${[...a.keys()].join(", ")}`),this.targetId=r,this.name="UnknownTargetError"}}const a=new Map([["claude-code",()=>new o],["cursor",()=>new s],["vscode",()=>new n],["gemini-cli",()=>new i],["codex",()=>new d],["antigravity",()=>new p],["grok",()=>new g]]);class w{adapters=new Map;register(r){const e=r.getTargetId();if(this.adapters.has(e))throw new Error(`Adapter already registered for target: "${e}"`);this.adapters.set(e,r)}get(r){return this.adapters.get(r)}getOrThrow(r){const e=this.adapters.get(r);if(!e)throw new c(r);return e}has(r){return this.adapters.has(r)}listTargets(){return[...this.adapters.keys()]}}function k(){const t=new w;for(const[,r]of a)t.register(r());return t}export{w as AdapterRegistry,c as UnknownTargetError,k as createDefaultRegistry};
|
|
@@ -1,77 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Copyright (c) 2026 OrNexus AI
|
|
4
|
-
*
|
|
5
|
-
* Antigravity Adapter - Formats prompts for the Antigravity platform.
|
|
6
|
-
*
|
|
7
|
-
* Antigravity shares the GEMINI.md format with Gemini CLI but adds
|
|
8
|
-
* platform-specific sections for workflows and rules.
|
|
9
|
-
*
|
|
10
|
-
* Story 42.8
|
|
11
|
-
*/
|
|
12
|
-
// ── Constants ───────────────────────────────────────────────────────────────
|
|
13
|
-
const TARGET_ID = 'antigravity';
|
|
14
|
-
const MAX_CONTEXT_LENGTH = 1_000_000;
|
|
15
|
-
const CAPABILITIES = {
|
|
16
|
-
supportsMarkdown: true,
|
|
17
|
-
supportsMultiFile: true,
|
|
18
|
-
supportsMultiTurn: true,
|
|
19
|
-
supportsTools: true,
|
|
20
|
-
maxContextLength: MAX_CONTEXT_LENGTH,
|
|
21
|
-
};
|
|
22
|
-
// ── Implementation ──────────────────────────────────────────────────────────
|
|
23
|
-
export class AntigravityAdapter {
|
|
24
|
-
formatPrompt(assembledPrompt, platformInstructions, config) {
|
|
25
|
-
const sections = [];
|
|
26
|
-
// Main prompt content (shared Gemini format)
|
|
27
|
-
sections.push(assembledPrompt);
|
|
28
|
-
// @import directives for standards (shared with Gemini)
|
|
29
|
-
if (platformInstructions.contextFiles && platformInstructions.contextFiles.length > 0) {
|
|
30
|
-
sections.push('');
|
|
31
|
-
sections.push('## Standards');
|
|
32
|
-
sections.push('');
|
|
33
|
-
for (const file of platformInstructions.contextFiles) {
|
|
34
|
-
sections.push(`@import ${file}`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
// Antigravity-specific: workflow support
|
|
38
|
-
sections.push('');
|
|
39
|
-
sections.push('## Antigravity-Specific');
|
|
40
|
-
sections.push('');
|
|
41
|
-
sections.push('This GEMINI.md is shared between Gemini CLI and Antigravity targets.');
|
|
42
|
-
sections.push('For Antigravity-specific features:');
|
|
43
|
-
// Tool definitions
|
|
44
|
-
if (platformInstructions.tools && platformInstructions.tools.length > 0) {
|
|
45
|
-
sections.push('');
|
|
46
|
-
sections.push('### Tools');
|
|
47
|
-
sections.push('');
|
|
48
|
-
for (const tool of platformInstructions.tools) {
|
|
49
|
-
sections.push(`- ${tool}`);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
// MCP configuration
|
|
53
|
-
if (platformInstructions.mcpConfig && Object.keys(platformInstructions.mcpConfig).length > 0) {
|
|
54
|
-
sections.push('');
|
|
55
|
-
sections.push('### MCP Servers');
|
|
56
|
-
sections.push('');
|
|
57
|
-
sections.push('```json');
|
|
58
|
-
sections.push(JSON.stringify(platformInstructions.mcpConfig, null, 2));
|
|
59
|
-
sections.push('```');
|
|
60
|
-
}
|
|
61
|
-
let result = sections.join('\n');
|
|
62
|
-
const maxLength = config.maxPromptLength ?? MAX_CONTEXT_LENGTH;
|
|
63
|
-
if (result.length > maxLength) {
|
|
64
|
-
result = result.slice(0, maxLength);
|
|
65
|
-
}
|
|
66
|
-
return result;
|
|
67
|
-
}
|
|
68
|
-
getTargetId() {
|
|
69
|
-
return TARGET_ID;
|
|
70
|
-
}
|
|
71
|
-
getCapabilities() {
|
|
72
|
-
return CAPABILITIES;
|
|
73
|
-
}
|
|
74
|
-
getInjectionMethod() {
|
|
75
|
-
return 'file';
|
|
76
|
-
}
|
|
77
|
-
}
|
|
1
|
+
const u="antigravity",g=1e6,n={supportsMarkdown:!0,supportsMultiFile:!0,supportsMultiTurn:!0,supportsTools:!0,maxContextLength:1e6};class l{formatPrompt(h,t,o){const e=[];if(e.push(h),t.contextFiles&&t.contextFiles.length>0){e.push(""),e.push("## Standards"),e.push("");for(const i of t.contextFiles)e.push(`@import ${i}`)}if(e.push(""),e.push("## Antigravity-Specific"),e.push(""),e.push("This GEMINI.md is shared between Gemini CLI and Antigravity targets."),e.push("For Antigravity-specific features:"),t.tools&&t.tools.length>0){e.push(""),e.push("### Tools"),e.push("");for(const i of t.tools)e.push(`- ${i}`)}t.mcpConfig&&Object.keys(t.mcpConfig).length>0&&(e.push(""),e.push("### MCP Servers"),e.push(""),e.push("```json"),e.push(JSON.stringify(t.mcpConfig,null,2)),e.push("```"));let s=e.join(`
|
|
2
|
+
`);const p=o.maxPromptLength??1e6;return s.length>p&&(s=s.slice(0,p)),s}getTargetId(){return u}getCapabilities(){return n}getInjectionMethod(){return"file"}}export{l as AntigravityAdapter};
|
|
@@ -1,79 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* Claude Code Adapter - Formats prompts as CLAUDE.md content.
|
|
6
|
-
*
|
|
7
|
-
* Claude Code reads system prompts from CLAUDE.md and referenced .md files.
|
|
8
|
-
* This adapter preserves full Markdown formatting, headers, sections,
|
|
9
|
-
* code blocks, and injects platform-specific instructions.
|
|
10
|
-
*
|
|
11
|
-
* Story 42.8
|
|
12
|
-
*/
|
|
13
|
-
// ── Constants ───────────────────────────────────────────────────────────────
|
|
14
|
-
const TARGET_ID = 'claude-code';
|
|
15
|
-
const MAX_CONTEXT_LENGTH = 200_000;
|
|
16
|
-
const CAPABILITIES = {
|
|
17
|
-
supportsMarkdown: true,
|
|
18
|
-
supportsMultiFile: true,
|
|
19
|
-
supportsMultiTurn: true,
|
|
20
|
-
supportsTools: true,
|
|
21
|
-
maxContextLength: MAX_CONTEXT_LENGTH,
|
|
22
|
-
};
|
|
23
|
-
// ── Implementation ──────────────────────────────────────────────────────────
|
|
24
|
-
export class ClaudeCodeAdapter {
|
|
25
|
-
formatPrompt(assembledPrompt, platformInstructions, config) {
|
|
26
|
-
const sections = [];
|
|
27
|
-
// Main prompt content (preserved as-is for Claude Code)
|
|
28
|
-
sections.push(assembledPrompt);
|
|
29
|
-
// Inject platform-specific instructions
|
|
30
|
-
if (platformInstructions.tools && platformInstructions.tools.length > 0) {
|
|
31
|
-
sections.push('');
|
|
32
|
-
sections.push('## Available Tools');
|
|
33
|
-
sections.push('');
|
|
34
|
-
for (const tool of platformInstructions.tools) {
|
|
35
|
-
sections.push(`- ${tool}`);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
if (platformInstructions.mcpConfig && Object.keys(platformInstructions.mcpConfig).length > 0) {
|
|
39
|
-
sections.push('');
|
|
40
|
-
sections.push('## MCP Configuration');
|
|
41
|
-
sections.push('');
|
|
42
|
-
sections.push('```json');
|
|
43
|
-
sections.push(JSON.stringify(platformInstructions.mcpConfig, null, 2));
|
|
44
|
-
sections.push('```');
|
|
45
|
-
}
|
|
46
|
-
if (platformInstructions.contextFiles && platformInstructions.contextFiles.length > 0) {
|
|
47
|
-
sections.push('');
|
|
48
|
-
sections.push('## Context Files');
|
|
49
|
-
sections.push('');
|
|
50
|
-
for (const file of platformInstructions.contextFiles) {
|
|
51
|
-
sections.push(`@${file}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
// Apply custom headers
|
|
55
|
-
if (config.customHeaders && Object.keys(config.customHeaders).length > 0) {
|
|
56
|
-
const headerLines = [];
|
|
57
|
-
for (const [key, value] of Object.entries(config.customHeaders)) {
|
|
58
|
-
headerLines.push(`${key}: ${value}`);
|
|
59
|
-
}
|
|
60
|
-
sections.unshift(headerLines.join('\n'), '');
|
|
61
|
-
}
|
|
62
|
-
let result = sections.join('\n');
|
|
63
|
-
// Enforce max length if configured
|
|
64
|
-
const maxLength = config.maxPromptLength ?? MAX_CONTEXT_LENGTH;
|
|
65
|
-
if (result.length > maxLength) {
|
|
66
|
-
result = result.slice(0, maxLength);
|
|
67
|
-
}
|
|
68
|
-
return result;
|
|
69
|
-
}
|
|
70
|
-
getTargetId() {
|
|
71
|
-
return TARGET_ID;
|
|
72
|
-
}
|
|
73
|
-
getCapabilities() {
|
|
74
|
-
return CAPABILITIES;
|
|
75
|
-
}
|
|
76
|
-
getInjectionMethod() {
|
|
77
|
-
return 'file';
|
|
78
|
-
}
|
|
79
|
-
}
|
|
1
|
+
const i="claude-code",T=2e5,r={supportsMarkdown:!0,supportsMultiFile:!0,supportsMultiTurn:!0,supportsTools:!0,maxContextLength:2e5};class g{formatPrompt(n,s,o){const e=[];if(e.push(n),s.tools&&s.tools.length>0){e.push(""),e.push("## Available Tools"),e.push("");for(const t of s.tools)e.push(`- ${t}`)}if(s.mcpConfig&&Object.keys(s.mcpConfig).length>0&&(e.push(""),e.push("## MCP Configuration"),e.push(""),e.push("```json"),e.push(JSON.stringify(s.mcpConfig,null,2)),e.push("```")),s.contextFiles&&s.contextFiles.length>0){e.push(""),e.push("## Context Files"),e.push("");for(const t of s.contextFiles)e.push(`@${t}`)}if(o.customHeaders&&Object.keys(o.customHeaders).length>0){const t=[];for(const[l,p]of Object.entries(o.customHeaders))t.push(`${l}: ${p}`);e.unshift(t.join(`
|
|
2
|
+
`),"")}let u=e.join(`
|
|
3
|
+
`);const h=o.maxPromptLength??2e5;return u.length>h&&(u=u.slice(0,h)),u}getTargetId(){return i}getCapabilities(){return r}getInjectionMethod(){return"file"}}export{g as ClaudeCodeAdapter};
|
|
@@ -1,80 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Copyright (c) 2026 OrNexus AI
|
|
4
|
-
*
|
|
5
|
-
* Codex Adapter - Formats prompts as AGENTS.md content.
|
|
6
|
-
*
|
|
7
|
-
* Codex reads agent instructions from AGENTS.md files.
|
|
8
|
-
* This adapter produces concise, agent-instruction style content
|
|
9
|
-
* optimized for Codex's instruction format.
|
|
10
|
-
*
|
|
11
|
-
* Story 42.8
|
|
12
|
-
*/
|
|
13
|
-
// ── Constants ───────────────────────────────────────────────────────────────
|
|
14
|
-
const TARGET_ID = 'codex';
|
|
15
|
-
const MAX_CONTEXT_LENGTH = 200_000;
|
|
16
|
-
const CAPABILITIES = {
|
|
17
|
-
supportsMarkdown: true,
|
|
18
|
-
supportsMultiFile: false,
|
|
19
|
-
supportsMultiTurn: true,
|
|
20
|
-
supportsTools: true,
|
|
21
|
-
maxContextLength: MAX_CONTEXT_LENGTH,
|
|
22
|
-
};
|
|
23
|
-
// ── Implementation ──────────────────────────────────────────────────────────
|
|
24
|
-
export class CodexAdapter {
|
|
25
|
-
formatPrompt(assembledPrompt, platformInstructions, config) {
|
|
26
|
-
const sections = [];
|
|
27
|
-
// Agent-style header
|
|
28
|
-
sections.push(assembledPrompt);
|
|
29
|
-
// Architecture section (concise)
|
|
30
|
-
if (platformInstructions.tools && platformInstructions.tools.length > 0) {
|
|
31
|
-
sections.push('');
|
|
32
|
-
sections.push('## Tools');
|
|
33
|
-
sections.push('');
|
|
34
|
-
for (const tool of platformInstructions.tools) {
|
|
35
|
-
sections.push(`- ${tool}`);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
// Context references
|
|
39
|
-
if (platformInstructions.contextFiles && platformInstructions.contextFiles.length > 0) {
|
|
40
|
-
sections.push('');
|
|
41
|
-
sections.push('## Context Files');
|
|
42
|
-
sections.push('');
|
|
43
|
-
for (const file of platformInstructions.contextFiles) {
|
|
44
|
-
sections.push(`- ${file}`);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
// MCP config (Codex supports MCP via config-mcp.toml)
|
|
48
|
-
if (platformInstructions.mcpConfig && Object.keys(platformInstructions.mcpConfig).length > 0) {
|
|
49
|
-
sections.push('');
|
|
50
|
-
sections.push('## MCP Configuration');
|
|
51
|
-
sections.push('');
|
|
52
|
-
sections.push('```toml');
|
|
53
|
-
// Convert to TOML-style representation
|
|
54
|
-
for (const [key, value] of Object.entries(platformInstructions.mcpConfig)) {
|
|
55
|
-
sections.push(`[${key}]`);
|
|
56
|
-
if (typeof value === 'object' && value !== null) {
|
|
57
|
-
for (const [subKey, subValue] of Object.entries(value)) {
|
|
58
|
-
sections.push(`${subKey} = ${JSON.stringify(subValue)}`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
sections.push('```');
|
|
63
|
-
}
|
|
64
|
-
let result = sections.join('\n');
|
|
65
|
-
const maxLength = config.maxPromptLength ?? MAX_CONTEXT_LENGTH;
|
|
66
|
-
if (result.length > maxLength) {
|
|
67
|
-
result = result.slice(0, maxLength);
|
|
68
|
-
}
|
|
69
|
-
return result;
|
|
70
|
-
}
|
|
71
|
-
getTargetId() {
|
|
72
|
-
return TARGET_ID;
|
|
73
|
-
}
|
|
74
|
-
getCapabilities() {
|
|
75
|
-
return CAPABILITIES;
|
|
76
|
-
}
|
|
77
|
-
getInjectionMethod() {
|
|
78
|
-
return 'file';
|
|
79
|
-
}
|
|
80
|
-
}
|
|
1
|
+
const c="codex",T=2e5,g={supportsMarkdown:!0,supportsMultiFile:!1,supportsMultiTurn:!0,supportsTools:!0,maxContextLength:2e5};class f{formatPrompt(p,t,h){const e=[];if(e.push(p),t.tools&&t.tools.length>0){e.push(""),e.push("## Tools"),e.push("");for(const o of t.tools)e.push(`- ${o}`)}if(t.contextFiles&&t.contextFiles.length>0){e.push(""),e.push("## Context Files"),e.push("");for(const o of t.contextFiles)e.push(`- ${o}`)}if(t.mcpConfig&&Object.keys(t.mcpConfig).length>0){e.push(""),e.push("## MCP Configuration"),e.push(""),e.push("```toml");for(const[o,u]of Object.entries(t.mcpConfig))if(e.push(`[${o}]`),typeof u=="object"&&u!==null)for(const[i,l]of Object.entries(u))e.push(`${i} = ${JSON.stringify(l)}`);e.push("```")}let s=e.join(`
|
|
2
|
+
`);const n=h.maxPromptLength??2e5;return s.length>n&&(s=s.slice(0,n)),s}getTargetId(){return c}getCapabilities(){return g}getInjectionMethod(){return"file"}}export{f as CodexAdapter};
|