@ornexus/neocortex 4.59.1
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/LICENSE +56 -0
- package/LICENSE-COMMERCIAL.md +70 -0
- package/README.md +58 -0
- package/dist/sbom.cdx.json +7067 -0
- package/docs/install/coderabbit-manual-setup.md +86 -0
- package/docs/install/installer-diagnostics.md +107 -0
- package/docs/install/linux-global-install.md +97 -0
- package/install.js +572 -0
- package/install.ps1 +2214 -0
- package/install.sh +2013 -0
- package/package.json +118 -0
- package/packages/client/dist/adapters/adapter-registry.d.ts +61 -0
- package/packages/client/dist/adapters/adapter-registry.js +1 -0
- package/packages/client/dist/adapters/antigravity-adapter.d.ts +18 -0
- package/packages/client/dist/adapters/antigravity-adapter.js +2 -0
- package/packages/client/dist/adapters/claude-code-adapter.d.ts +19 -0
- package/packages/client/dist/adapters/claude-code-adapter.js +3 -0
- package/packages/client/dist/adapters/codex-adapter.d.ts +19 -0
- package/packages/client/dist/adapters/codex-adapter.js +2 -0
- package/packages/client/dist/adapters/cursor-adapter.d.ts +19 -0
- package/packages/client/dist/adapters/cursor-adapter.js +4 -0
- package/packages/client/dist/adapters/gemini-adapter.d.ts +18 -0
- package/packages/client/dist/adapters/gemini-adapter.js +2 -0
- package/packages/client/dist/adapters/index.d.ts +19 -0
- package/packages/client/dist/adapters/index.js +1 -0
- package/packages/client/dist/adapters/platform-detector.d.ts +48 -0
- package/packages/client/dist/adapters/platform-detector.js +1 -0
- package/packages/client/dist/adapters/target-adapter.d.ts +70 -0
- package/packages/client/dist/adapters/target-adapter.js +0 -0
- package/packages/client/dist/adapters/vscode-adapter.d.ts +19 -0
- package/packages/client/dist/adapters/vscode-adapter.js +2 -0
- package/packages/client/dist/agent/refresh-stubs.d.ts +80 -0
- package/packages/client/dist/agent/refresh-stubs.js +2 -0
- package/packages/client/dist/agent/update-agent-yaml.d.ts +26 -0
- package/packages/client/dist/agent/update-agent-yaml.js +1 -0
- package/packages/client/dist/agent/update-description.d.ts +45 -0
- package/packages/client/dist/agent/update-description.js +1 -0
- package/packages/client/dist/cache/crypto-utils.d.ts +30 -0
- package/packages/client/dist/cache/crypto-utils.js +1 -0
- package/packages/client/dist/cache/encrypted-cache.d.ts +30 -0
- package/packages/client/dist/cache/encrypted-cache.js +1 -0
- package/packages/client/dist/cache/in-memory-asset-cache.d.ts +62 -0
- package/packages/client/dist/cache/in-memory-asset-cache.js +1 -0
- package/packages/client/dist/cache/index.d.ts +13 -0
- package/packages/client/dist/cache/index.js +1 -0
- package/packages/client/dist/cache/protected-pi-boundary.d.ts +19 -0
- package/packages/client/dist/cache/protected-pi-boundary.js +1 -0
- package/packages/client/dist/checkpoint/checkpoint-client-reader.d.ts +45 -0
- package/packages/client/dist/checkpoint/checkpoint-client-reader.js +2 -0
- package/packages/client/dist/checkpoint/index.d.ts +12 -0
- package/packages/client/dist/checkpoint/index.js +1 -0
- package/packages/client/dist/checkpoint/shared-checkpoint-types.d.ts +85 -0
- package/packages/client/dist/checkpoint/shared-checkpoint-types.js +1 -0
- package/packages/client/dist/cli.d.ts +14 -0
- package/packages/client/dist/cli.js +48 -0
- package/packages/client/dist/commands/activate.d.ts +55 -0
- package/packages/client/dist/commands/activate.js +8 -0
- package/packages/client/dist/commands/cache-status.d.ts +39 -0
- package/packages/client/dist/commands/cache-status.js +2 -0
- package/packages/client/dist/commands/invoke.d.ts +229 -0
- package/packages/client/dist/commands/invoke.js +63 -0
- package/packages/client/dist/commands/refresh-memory.d.ts +11 -0
- package/packages/client/dist/commands/refresh-memory.js +1 -0
- package/packages/client/dist/config/resolver-selection.d.ts +40 -0
- package/packages/client/dist/config/resolver-selection.js +1 -0
- package/packages/client/dist/config/secure-config.d.ts +78 -0
- package/packages/client/dist/config/secure-config.js +12 -0
- package/packages/client/dist/constants.d.ts +25 -0
- package/packages/client/dist/constants.js +1 -0
- package/packages/client/dist/context/context-collector.d.ts +28 -0
- package/packages/client/dist/context/context-collector.js +2 -0
- package/packages/client/dist/context/context-sanitizer.d.ts +28 -0
- package/packages/client/dist/context/context-sanitizer.js +1 -0
- package/packages/client/dist/continuity/continuity-client-state-store.d.ts +183 -0
- package/packages/client/dist/continuity/continuity-client-state-store.js +1 -0
- package/packages/client/dist/continuity/invoke-hooks.d.ts +18 -0
- package/packages/client/dist/continuity/invoke-hooks.js +1 -0
- package/packages/client/dist/continuity/migrations/001-initial-schema.d.ts +11 -0
- package/packages/client/dist/continuity/migrations/001-initial-schema.js +263 -0
- package/packages/client/dist/continuity/sqlite-store.d.ts +409 -0
- package/packages/client/dist/continuity/sqlite-store.js +226 -0
- package/packages/client/dist/errors/error-messages.d.ts +40 -0
- package/packages/client/dist/errors/error-messages.js +2 -0
- package/packages/client/dist/graph-retrieval/pre-command-hook.d.ts +31 -0
- package/packages/client/dist/graph-retrieval/pre-command-hook.js +1 -0
- package/packages/client/dist/graph-retrieval/shared-graph-retrieval-contract.d.ts +77 -0
- package/packages/client/dist/graph-retrieval/shared-graph-retrieval-contract.js +1 -0
- package/packages/client/dist/i18n/first-run.d.ts +23 -0
- package/packages/client/dist/i18n/first-run.js +2 -0
- package/packages/client/dist/index.d.ts +56 -0
- package/packages/client/dist/index.js +1 -0
- package/packages/client/dist/license/index.d.ts +5 -0
- package/packages/client/dist/license/index.js +1 -0
- package/packages/client/dist/license/license-client.d.ts +79 -0
- package/packages/client/dist/license/license-client.js +1 -0
- package/packages/client/dist/machine/fingerprint.d.ts +34 -0
- package/packages/client/dist/machine/fingerprint.js +2 -0
- package/packages/client/dist/machine/index.d.ts +5 -0
- package/packages/client/dist/machine/index.js +1 -0
- package/packages/client/dist/memory/project-memory-writer.d.ts +74 -0
- package/packages/client/dist/memory/project-memory-writer.js +36 -0
- package/packages/client/dist/memory/shared-project-memory-types.d.ts +370 -0
- package/packages/client/dist/memory/shared-project-memory-types.js +2 -0
- package/packages/client/dist/policy/architecture-policy.d.ts +40 -0
- package/packages/client/dist/policy/architecture-policy.js +2 -0
- package/packages/client/dist/policy/index.d.ts +8 -0
- package/packages/client/dist/policy/index.js +1 -0
- package/packages/client/dist/policy/shared-policy-types.d.ts +89 -0
- package/packages/client/dist/policy/shared-policy-types.js +0 -0
- package/packages/client/dist/resilience/circuit-breaker.d.ts +70 -0
- package/packages/client/dist/resilience/circuit-breaker.js +1 -0
- package/packages/client/dist/resilience/degradation-manager.d.ts +67 -0
- package/packages/client/dist/resilience/degradation-manager.js +1 -0
- package/packages/client/dist/resilience/freshness-indicator.d.ts +59 -0
- package/packages/client/dist/resilience/freshness-indicator.js +1 -0
- package/packages/client/dist/resilience/index.d.ts +8 -0
- package/packages/client/dist/resilience/index.js +1 -0
- package/packages/client/dist/resilience/recovery-detector.d.ts +59 -0
- package/packages/client/dist/resilience/recovery-detector.js +1 -0
- package/packages/client/dist/resolvers/asset-resolver.d.ts +79 -0
- package/packages/client/dist/resolvers/asset-resolver.js +0 -0
- package/packages/client/dist/resolvers/local-resolver.d.ts +26 -0
- package/packages/client/dist/resolvers/local-resolver.js +8 -0
- package/packages/client/dist/resolvers/remote-resolver.d.ts +91 -0
- package/packages/client/dist/resolvers/remote-resolver.js +1 -0
- package/packages/client/dist/runner/cli.d.ts +121 -0
- package/packages/client/dist/runner/cli.js +20 -0
- package/packages/client/dist/runner/scheduler.d.ts +116 -0
- package/packages/client/dist/runner/scheduler.js +6 -0
- package/packages/client/dist/runner-cli.d.ts +9 -0
- package/packages/client/dist/runner-cli.js +3 -0
- package/packages/client/dist/state/project-state-snapshot.d.ts +15 -0
- package/packages/client/dist/state/project-state-snapshot.js +1 -0
- package/packages/client/dist/state/state-json-repair.d.ts +17 -0
- package/packages/client/dist/state/state-json-repair.js +3 -0
- package/packages/client/dist/telemetry/index.d.ts +5 -0
- package/packages/client/dist/telemetry/index.js +1 -0
- package/packages/client/dist/telemetry/offline-queue.d.ts +57 -0
- package/packages/client/dist/telemetry/offline-queue.js +1 -0
- package/packages/client/dist/tier/index.d.ts +5 -0
- package/packages/client/dist/tier/index.js +1 -0
- package/packages/client/dist/tier/tier-aware-client.d.ts +105 -0
- package/packages/client/dist/tier/tier-aware-client.js +1 -0
- package/packages/client/dist/types/index.d.ts +140 -0
- package/packages/client/dist/types/index.js +1 -0
- package/packages/client/dist/yoloop/discovery-hook.d.ts +85 -0
- package/packages/client/dist/yoloop/discovery-hook.js +2 -0
- package/packages/client/dist/yoloop/index.d.ts +10 -0
- package/packages/client/dist/yoloop/index.js +1 -0
- package/packages/client/dist/yoloop/invoke-hooks.d.ts +125 -0
- package/packages/client/dist/yoloop/invoke-hooks.js +5 -0
- package/packages/client/dist/yoloop/shared-discover-epics.d.ts +289 -0
- package/packages/client/dist/yoloop/shared-discover-epics.js +1 -0
- package/packages/client/dist/yoloop/shared-yoloop-types.d.ts +172 -0
- package/packages/client/dist/yoloop/shared-yoloop-types.js +1 -0
- package/packages/client/dist/yoloop/yoloop-client-state-store.d.ts +124 -0
- package/packages/client/dist/yoloop/yoloop-client-state-store.js +1 -0
- package/postinstall.js +754 -0
- package/targets-stubs/antigravity/README.md +36 -0
- package/targets-stubs/antigravity/gemini.md +29 -0
- package/targets-stubs/antigravity/install-antigravity.sh +153 -0
- package/targets-stubs/antigravity/mcp-config.json +30 -0
- package/targets-stubs/antigravity/skill/SKILL.md +159 -0
- package/targets-stubs/claude-code/.mcp.json +32 -0
- package/targets-stubs/claude-code/README.md +20 -0
- package/targets-stubs/claude-code/neocortex-root.agent.yaml +42 -0
- package/targets-stubs/claude-code/neocortex-root.md +310 -0
- package/targets-stubs/claude-code/neocortex.agent.yaml +42 -0
- package/targets-stubs/claude-code/neocortex.md +378 -0
- package/targets-stubs/codex/AGENTS.md +244 -0
- package/targets-stubs/codex/README.md +47 -0
- package/targets-stubs/codex/config-mcp.toml +22 -0
- package/targets-stubs/codex/install-codex.sh +63 -0
- package/targets-stubs/codex/neocortex.toml +29 -0
- package/targets-stubs/cursor/README.md +33 -0
- package/targets-stubs/cursor/agent.md +204 -0
- package/targets-stubs/cursor/install-cursor.sh +50 -0
- package/targets-stubs/cursor/mcp.json +30 -0
- package/targets-stubs/gemini-cli/README.md +34 -0
- package/targets-stubs/gemini-cli/agent.md +234 -0
- package/targets-stubs/gemini-cli/agents/neocortex.md +54 -0
- package/targets-stubs/gemini-cli/gemini.md +46 -0
- package/targets-stubs/gemini-cli/install-gemini.sh +70 -0
- package/targets-stubs/gemini-cli/settings-mcp.json +30 -0
- package/targets-stubs/kimi/mcp.json +33 -0
- package/targets-stubs/kimi/neocortex.md +54 -0
- package/targets-stubs/lib/mcp-merge.js +189 -0
- package/targets-stubs/openclaw/README.md +12 -0
- package/targets-stubs/openclaw/SKILL.md +88 -0
- package/targets-stubs/opencode/neocortex-root.md +261 -0
- package/targets-stubs/opencode/neocortex.md +59 -0
- package/targets-stubs/opencode/opencode-mcp.json +35 -0
- package/targets-stubs/vscode/README.md +34 -0
- package/targets-stubs/vscode/copilot-instructions.md +47 -0
- package/targets-stubs/vscode/install-vscode.sh +72 -0
- package/targets-stubs/vscode/mcp.json +36 -0
- package/targets-stubs/vscode/neocortex.agent.md +245 -0
package/package.json
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ornexus/neocortex",
|
|
3
|
+
"version": "4.59.1",
|
|
4
|
+
"description": "Neocortex v4.59.1 - Orquestrador de Desenvolvimento de Epics & Stories para Claude Code",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"claude",
|
|
7
|
+
"claude-code",
|
|
8
|
+
"agent",
|
|
9
|
+
"orchestrator",
|
|
10
|
+
"development-workflow",
|
|
11
|
+
"epic",
|
|
12
|
+
"story",
|
|
13
|
+
"automation",
|
|
14
|
+
"ai-agent",
|
|
15
|
+
"llm",
|
|
16
|
+
"devops",
|
|
17
|
+
"ci-cd",
|
|
18
|
+
"git-workflow",
|
|
19
|
+
"pull-request",
|
|
20
|
+
"code-review"
|
|
21
|
+
],
|
|
22
|
+
"author": {
|
|
23
|
+
"name": "OrNexus Team",
|
|
24
|
+
"url": "https://github.com/ornexus-ai"
|
|
25
|
+
},
|
|
26
|
+
"license": "BSL-1.1",
|
|
27
|
+
"licensing": {
|
|
28
|
+
"type": "Business Source License 1.1",
|
|
29
|
+
"url": "https://github.com/OrNexus-AI/neocortex/blob/main/LICENSE",
|
|
30
|
+
"commercial": "https://github.com/OrNexus-AI/neocortex/blob/main/LICENSE-COMMERCIAL.md"
|
|
31
|
+
},
|
|
32
|
+
"workspaces": [
|
|
33
|
+
"packages/shared",
|
|
34
|
+
"packages/core",
|
|
35
|
+
"packages/client"
|
|
36
|
+
],
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/OrNexus-AI/neocortex.git"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/ornexus-ai/neocortex#readme",
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/ornexus-ai/neocortex/issues"
|
|
44
|
+
},
|
|
45
|
+
"bin": {
|
|
46
|
+
"neocortex": "install.js",
|
|
47
|
+
"neocortex-client": "packages/client/dist/cli.js",
|
|
48
|
+
"neocortex-runner": "packages/client/dist/runner-cli.js"
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
"README.md",
|
|
52
|
+
"LICENSE",
|
|
53
|
+
"LICENSE-COMMERCIAL.md",
|
|
54
|
+
"install.js",
|
|
55
|
+
"install.sh",
|
|
56
|
+
"install.ps1",
|
|
57
|
+
"docs/install/linux-global-install.md",
|
|
58
|
+
"docs/install/coderabbit-manual-setup.md",
|
|
59
|
+
"docs/install/installer-diagnostics.md",
|
|
60
|
+
"postinstall.js",
|
|
61
|
+
"packages/client/dist/",
|
|
62
|
+
"!packages/client/dist/**/*.js.map",
|
|
63
|
+
"!packages/client/dist/**/*.d.ts.map",
|
|
64
|
+
"targets-stubs/",
|
|
65
|
+
"dist/sbom.cdx.json"
|
|
66
|
+
],
|
|
67
|
+
"scripts": {
|
|
68
|
+
"test": "node scripts/test-root.mjs",
|
|
69
|
+
"build": "npm run build -w packages/shared && npm run build -w packages/client && node scripts/strip-source-map-comments.js && node scripts/minify-client-dist.mjs",
|
|
70
|
+
"build:clean": "rm -rf packages/shared/dist packages/client/dist && npm run build",
|
|
71
|
+
"build:client": "npm run build -w packages/client",
|
|
72
|
+
"build:shared": "npm run build -w packages/shared",
|
|
73
|
+
"postinstall": "node postinstall.js",
|
|
74
|
+
"sync": "node sync-version.js",
|
|
75
|
+
"validate": "node scripts/validate-pre-publish.js",
|
|
76
|
+
"validate:bash": "bash scripts/validate-pre-publish.sh",
|
|
77
|
+
"admin:dev": "cd admin && npm run dev",
|
|
78
|
+
"admin:build": "cd admin && npm run build",
|
|
79
|
+
"admin:test": "cd admin && npm run test",
|
|
80
|
+
"admin:lint": "cd admin && npm run lint",
|
|
81
|
+
"portal:dev": "cd portal && npm run dev",
|
|
82
|
+
"portal:build": "cd portal && npm run build",
|
|
83
|
+
"portal:test": "cd portal && npm run test",
|
|
84
|
+
"test:e2e": "bash scripts/e2e-smoke-test.sh",
|
|
85
|
+
"sbom": "bash scripts/generate-sbom.sh",
|
|
86
|
+
"prepublishOnly": "npm run build && npm --prefix packages/server run build -- --noEmit && node scripts/validate-pre-publish.js && node sync-version.js && npm run sbom && node -e \"const p=require('./package.json');const fs=require('fs');p.description='Neocortex v'+p.version+' - Orquestrador de Desenvolvimento de Epics & Stories para Claude Code';fs.writeFileSync('./package.json',JSON.stringify(p,null,2)+'\\n');console.log('Publishing Neocortex v'+p.version+'...')\"",
|
|
87
|
+
"version": "npm run sync && echo 'Nova versao:' && cat package.json | grep version"
|
|
88
|
+
},
|
|
89
|
+
"engines": {
|
|
90
|
+
"node": ">=18.0.0"
|
|
91
|
+
},
|
|
92
|
+
"os": [
|
|
93
|
+
"darwin",
|
|
94
|
+
"linux",
|
|
95
|
+
"win32"
|
|
96
|
+
],
|
|
97
|
+
"publishConfig": {
|
|
98
|
+
"access": "public"
|
|
99
|
+
},
|
|
100
|
+
"funding": {
|
|
101
|
+
"type": "github",
|
|
102
|
+
"url": "https://github.com/sponsors/ornexus"
|
|
103
|
+
},
|
|
104
|
+
"dependencies": {
|
|
105
|
+
"@clack/prompts": "^1.0.1",
|
|
106
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
107
|
+
"execa": "^9.6.1",
|
|
108
|
+
"node-cache": "^5.1.2",
|
|
109
|
+
"picocolors": "^1.1.1",
|
|
110
|
+
"zod": "^4.3.6"
|
|
111
|
+
},
|
|
112
|
+
"optionalDependencies": {
|
|
113
|
+
"better-sqlite3": "^12.11.1"
|
|
114
|
+
},
|
|
115
|
+
"devDependencies": {
|
|
116
|
+
"@cyclonedx/cyclonedx-npm": "^2.0.0"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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 type { TargetAdapter } from './target-adapter.js';
|
|
14
|
+
export declare class UnknownTargetError extends Error {
|
|
15
|
+
readonly targetId: string;
|
|
16
|
+
constructor(targetId: string);
|
|
17
|
+
}
|
|
18
|
+
export declare class AdapterRegistry {
|
|
19
|
+
private readonly adapters;
|
|
20
|
+
/**
|
|
21
|
+
* Register a target adapter.
|
|
22
|
+
*
|
|
23
|
+
* @param adapter - The adapter instance to register
|
|
24
|
+
* @throws Error if an adapter with the same target ID is already registered
|
|
25
|
+
*/
|
|
26
|
+
register(adapter: TargetAdapter): void;
|
|
27
|
+
/**
|
|
28
|
+
* Get an adapter by target ID.
|
|
29
|
+
*
|
|
30
|
+
* @param targetId - The target platform identifier
|
|
31
|
+
* @returns The adapter instance, or undefined if not found
|
|
32
|
+
*/
|
|
33
|
+
get(targetId: string): TargetAdapter | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Get an adapter by target ID, throwing if not found.
|
|
36
|
+
*
|
|
37
|
+
* @param targetId - The target platform identifier
|
|
38
|
+
* @returns The adapter instance
|
|
39
|
+
* @throws UnknownTargetError if no adapter is registered for the target
|
|
40
|
+
*/
|
|
41
|
+
getOrThrow(targetId: string): TargetAdapter;
|
|
42
|
+
/**
|
|
43
|
+
* Check if an adapter is registered for a target.
|
|
44
|
+
*
|
|
45
|
+
* @param targetId - The target platform identifier
|
|
46
|
+
* @returns true if an adapter is registered
|
|
47
|
+
*/
|
|
48
|
+
has(targetId: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* List all registered target IDs.
|
|
51
|
+
*
|
|
52
|
+
* @returns Array of registered target identifiers
|
|
53
|
+
*/
|
|
54
|
+
listTargets(): string[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Create a registry pre-populated with all 6 default platform adapters.
|
|
58
|
+
*
|
|
59
|
+
* @returns AdapterRegistry with claude-code, cursor, vscode, gemini-cli, codex, antigravity
|
|
60
|
+
*/
|
|
61
|
+
export declare function createDefaultRegistry(): AdapterRegistry;
|
|
@@ -0,0 +1 @@
|
|
|
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";class g 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]]);class c{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 g(r);return e}has(r){return this.adapters.has(r)}listTargets(){return[...this.adapters.keys()]}}function l(){const t=new c;for(const[,r]of a)t.register(r());return t}export{c as AdapterRegistry,g as UnknownTargetError,l as createDefaultRegistry};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license FSL-1.1
|
|
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
|
+
import type { InjectionMethod, PlatformInstructions, TargetAdapter, TargetCapabilities, TargetConfig } from './target-adapter.js';
|
|
13
|
+
export declare class AntigravityAdapter implements TargetAdapter {
|
|
14
|
+
formatPrompt(assembledPrompt: string, platformInstructions: PlatformInstructions, config: TargetConfig): string;
|
|
15
|
+
getTargetId(): string;
|
|
16
|
+
getCapabilities(): TargetCapabilities;
|
|
17
|
+
getInjectionMethod(): InjectionMethod;
|
|
18
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
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};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license FSL-1.1
|
|
3
|
+
* Copyright (c) 2026 OrNexus AI
|
|
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
|
+
import type { InjectionMethod, PlatformInstructions, TargetAdapter, TargetCapabilities, TargetConfig } from './target-adapter.js';
|
|
14
|
+
export declare class ClaudeCodeAdapter implements TargetAdapter {
|
|
15
|
+
formatPrompt(assembledPrompt: string, platformInstructions: PlatformInstructions, config: TargetConfig): string;
|
|
16
|
+
getTargetId(): string;
|
|
17
|
+
getCapabilities(): TargetCapabilities;
|
|
18
|
+
getInjectionMethod(): InjectionMethod;
|
|
19
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
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};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license FSL-1.1
|
|
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
|
+
import type { InjectionMethod, PlatformInstructions, TargetAdapter, TargetCapabilities, TargetConfig } from './target-adapter.js';
|
|
14
|
+
export declare class CodexAdapter implements TargetAdapter {
|
|
15
|
+
formatPrompt(assembledPrompt: string, platformInstructions: PlatformInstructions, config: TargetConfig): string;
|
|
16
|
+
getTargetId(): string;
|
|
17
|
+
getCapabilities(): TargetCapabilities;
|
|
18
|
+
getInjectionMethod(): InjectionMethod;
|
|
19
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
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};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license FSL-1.1
|
|
3
|
+
* Copyright (c) 2026 OrNexus AI
|
|
4
|
+
*
|
|
5
|
+
* Cursor Adapter - Formats prompts as .cursorrules content.
|
|
6
|
+
*
|
|
7
|
+
* Cursor reads system instructions from .cursorrules files.
|
|
8
|
+
* This adapter produces concise, directive-style rules optimized
|
|
9
|
+
* for Cursor's instruction format.
|
|
10
|
+
*
|
|
11
|
+
* Story 42.8
|
|
12
|
+
*/
|
|
13
|
+
import type { InjectionMethod, PlatformInstructions, TargetAdapter, TargetCapabilities, TargetConfig } from './target-adapter.js';
|
|
14
|
+
export declare class CursorAdapter implements TargetAdapter {
|
|
15
|
+
formatPrompt(assembledPrompt: string, platformInstructions: PlatformInstructions, config: TargetConfig): string;
|
|
16
|
+
getTargetId(): string;
|
|
17
|
+
getCapabilities(): TargetCapabilities;
|
|
18
|
+
getInjectionMethod(): InjectionMethod;
|
|
19
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const l="cursor",T=1e5,c={supportsMarkdown:!0,supportsMultiFile:!1,supportsMultiTurn:!0,supportsTools:!0,maxContextLength:1e5};function p(n){const s=n.split(`
|
|
2
|
+
`),t=[];for(const o of s){const e=o.trim();if(e===""){t.length>0&&t[t.length-1]!==""&&t.push("");continue}if(e.startsWith("#")){t.push(e);continue}if(e.startsWith("-")||e.startsWith("*")||e.startsWith("```")||e.startsWith(">")){t.push(e);continue}if(t.length>0&&f(t)){t.push(o);continue}e.length>0&&t.push(`- ${e}`)}return t.join(`
|
|
3
|
+
`).trim()}function f(n){let s=0;for(const t of n)t.trim().startsWith("```")&&s++;return s%2!==0}class g{formatPrompt(s,t,o){const e=[],h=o.verbose===!0?s:p(s);if(e.push(h),t.tools&&t.tools.length>0){e.push(""),e.push("## Tools");for(const r of t.tools)e.push(`- ${r}`)}if(t.contextFiles&&t.contextFiles.length>0){e.push(""),e.push("## Context");for(const r of t.contextFiles)e.push(`- @${r}`)}let i=e.join(`
|
|
4
|
+
`);const u=o.maxPromptLength??1e5;return i.length>u&&(i=i.slice(0,u)),i}getTargetId(){return l}getCapabilities(){return c}getInjectionMethod(){return"file"}}export{g as CursorAdapter};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license FSL-1.1
|
|
3
|
+
* Copyright (c) 2026 OrNexus AI
|
|
4
|
+
*
|
|
5
|
+
* Gemini CLI Adapter - Formats prompts as GEMINI.md system instructions.
|
|
6
|
+
*
|
|
7
|
+
* Gemini CLI reads system instructions from GEMINI.md files
|
|
8
|
+
* with @import directives for referenced standards and skills.
|
|
9
|
+
*
|
|
10
|
+
* Story 42.8
|
|
11
|
+
*/
|
|
12
|
+
import type { InjectionMethod, PlatformInstructions, TargetAdapter, TargetCapabilities, TargetConfig } from './target-adapter.js';
|
|
13
|
+
export declare class GeminiAdapter implements TargetAdapter {
|
|
14
|
+
formatPrompt(assembledPrompt: string, platformInstructions: PlatformInstructions, config: TargetConfig): string;
|
|
15
|
+
getTargetId(): string;
|
|
16
|
+
getCapabilities(): TargetCapabilities;
|
|
17
|
+
getInjectionMethod(): InjectionMethod;
|
|
18
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const i="gemini-cli",g=1e6,n={supportsMarkdown:!0,supportsMultiFile:!0,supportsMultiTurn:!0,supportsTools:!0,maxContextLength:1e6};class r{formatPrompt(u,t,h){const e=[];if(e.push(u),t.contextFiles&&t.contextFiles.length>0){e.push(""),e.push("## Standards"),e.push("");for(const o of t.contextFiles)e.push(`@import ${o}`)}if(t.tools&&t.tools.length>0){e.push(""),e.push("## Available Tools"),e.push("");for(const o of t.tools)e.push(`- ${o}`)}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=h.maxPromptLength??1e6;return s.length>p&&(s=s.slice(0,p)),s}getTargetId(){return i}getCapabilities(){return n}getInjectionMethod(){return"file"}}export{r as GeminiAdapter};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license FSL-1.1
|
|
3
|
+
* Copyright (c) 2026 OrNexus AI
|
|
4
|
+
*
|
|
5
|
+
* @neocortex/client - Target Adapters
|
|
6
|
+
*
|
|
7
|
+
* Platform-specific prompt formatting for 6 supported targets.
|
|
8
|
+
*
|
|
9
|
+
* Story 42.8
|
|
10
|
+
*/
|
|
11
|
+
export type { InjectionMethod, PlatformInstructions, TargetAdapter, TargetCapabilities, TargetConfig, } from './target-adapter.js';
|
|
12
|
+
export { ClaudeCodeAdapter } from './claude-code-adapter.js';
|
|
13
|
+
export { CursorAdapter } from './cursor-adapter.js';
|
|
14
|
+
export { VSCodeAdapter } from './vscode-adapter.js';
|
|
15
|
+
export { GeminiAdapter } from './gemini-adapter.js';
|
|
16
|
+
export { CodexAdapter } from './codex-adapter.js';
|
|
17
|
+
export { AntigravityAdapter } from './antigravity-adapter.js';
|
|
18
|
+
export { detectPlatform, isValidTargetId, type DetectionContext, type DetectionResult, type FileExistsCheck, type TargetId, } from './platform-detector.js';
|
|
19
|
+
export { AdapterRegistry, createDefaultRegistry, UnknownTargetError, } from './adapter-registry.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ClaudeCodeAdapter as t}from"./claude-code-adapter.js";import{CursorAdapter as a}from"./cursor-adapter.js";import{VSCodeAdapter as d}from"./vscode-adapter.js";import{GeminiAdapter as m}from"./gemini-adapter.js";import{CodexAdapter as i}from"./codex-adapter.js";import{AntigravityAdapter as g}from"./antigravity-adapter.js";import{detectPlatform as C,isValidTargetId as l}from"./platform-detector.js";import{AdapterRegistry as u,createDefaultRegistry as y,UnknownTargetError as c}from"./adapter-registry.js";export{u as AdapterRegistry,g as AntigravityAdapter,t as ClaudeCodeAdapter,i as CodexAdapter,a as CursorAdapter,m as GeminiAdapter,c as UnknownTargetError,d as VSCodeAdapter,y as createDefaultRegistry,C as detectPlatform,l as isValidTargetId};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license FSL-1.1
|
|
3
|
+
* Copyright (c) 2026 OrNexus AI
|
|
4
|
+
*
|
|
5
|
+
* Platform Detector - Auto-detects the current platform target.
|
|
6
|
+
*
|
|
7
|
+
* Uses a priority-ordered detection chain to identify which AI coding
|
|
8
|
+
* platform the CLI is running within, based on filesystem markers
|
|
9
|
+
* and environment variables.
|
|
10
|
+
*
|
|
11
|
+
* Detection priority:
|
|
12
|
+
* 1. --target flag (explicit override)
|
|
13
|
+
* 2. CODEX_ env var + AGENTS.md file -> Codex
|
|
14
|
+
* 3. .cursorrules file -> Cursor
|
|
15
|
+
* 4. CLAUDE.md file -> Claude Code
|
|
16
|
+
* 5. .vscode/ directory -> VS Code
|
|
17
|
+
* 6. GEMINI_CLI env var -> Gemini CLI
|
|
18
|
+
* 7. CODEX_ env var prefix -> Codex
|
|
19
|
+
* 8. Default fallback -> Claude Code
|
|
20
|
+
*
|
|
21
|
+
* Story 42.8
|
|
22
|
+
*/
|
|
23
|
+
/** Supported platform target identifiers */
|
|
24
|
+
export type TargetId = 'claude-code' | 'cursor' | 'vscode' | 'gemini' | 'codex' | 'opencode' | 'github-copilot-cli' | 'kimi' | 'antigravity';
|
|
25
|
+
/** Context provided to the platform detector */
|
|
26
|
+
export interface DetectionContext {
|
|
27
|
+
readonly cwd: string;
|
|
28
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
29
|
+
readonly targetFlag?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Result of platform detection */
|
|
32
|
+
export interface DetectionResult {
|
|
33
|
+
readonly targetId: TargetId;
|
|
34
|
+
readonly confidence: number;
|
|
35
|
+
readonly reason: string;
|
|
36
|
+
}
|
|
37
|
+
/** Check if a string is a valid TargetId */
|
|
38
|
+
export declare function isValidTargetId(value: string): value is TargetId;
|
|
39
|
+
export declare function normalizeTargetId(value: string): TargetId | null;
|
|
40
|
+
export type FileExistsCheck = (path: string) => boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Detect the current platform target based on the execution context.
|
|
43
|
+
*
|
|
44
|
+
* @param context - Detection context with cwd, env, and optional target flag
|
|
45
|
+
* @param fileExists - Injectable filesystem check (for testing)
|
|
46
|
+
* @returns Detection result with target ID, confidence, and reason
|
|
47
|
+
*/
|
|
48
|
+
export declare function detectPlatform(context: DetectionContext, fileExists?: FileExistsCheck): DetectionResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{existsSync as n}from"node:fs";import{join as i}from"node:path";const t=new Set(["claude-code","cursor","vscode","gemini","codex","opencode","github-copilot-cli","kimi","antigravity"]),d=Object.freeze({claude:"claude-code","claude-code":"claude-code",cursor:"cursor",vscode:"vscode","vscode-copilot":"vscode",gemini:"gemini","gemini-cli":"gemini",codex:"codex","codex-cli":"codex",opencode:"opencode","copilot-cli":"github-copilot-cli","github-copilot-cli":"github-copilot-cli",kimi:"kimi",antigravity:"antigravity"});function f(e){return t.has(e)}function a(e){return d[e.trim().toLowerCase()]??null}const u=e=>n(e);function g(e,r=u){if(e.targetFlag){const o=a(e.targetFlag);if(o)return{targetId:o,confidence:1,reason:`Explicit --target=${o} flag`}}const c=Object.keys(e.env).some(o=>o.startsWith("CODEX_"));return c&&r(i(e.cwd,"AGENTS.md"))?{targetId:"codex",confidence:.96,reason:"Found CODEX_ environment variable and uppercase AGENTS.md in project root"}:r(i(e.cwd,".cursorrules"))?{targetId:"cursor",confidence:.95,reason:"Found .cursorrules file in project root"}:r(i(e.cwd,"CLAUDE.md"))?{targetId:"claude-code",confidence:.9,reason:"Found CLAUDE.md file in project root"}:r(i(e.cwd,".vscode"))?{targetId:"vscode",confidence:.7,reason:"Found .vscode/ directory in project root"}:e.env.GEMINI_CLI!==void 0?{targetId:"gemini",confidence:.9,reason:"GEMINI_CLI environment variable is set"}:c?{targetId:"codex",confidence:.85,reason:"Found environment variable with CODEX_ prefix"}:{targetId:"claude-code",confidence:.5,reason:"Default fallback (no platform markers detected)"}}export{g as detectPlatform,f as isValidTargetId,a as normalizeTargetId};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license FSL-1.1
|
|
3
|
+
* Copyright (c) 2026 OrNexus AI
|
|
4
|
+
*
|
|
5
|
+
* TargetAdapter Interface - Core abstraction for platform-specific prompt formatting.
|
|
6
|
+
*
|
|
7
|
+
* Each platform target (Claude Code, Cursor, VS Code, Gemini CLI, Codex, Antigravity)
|
|
8
|
+
* implements this interface to transform assembled prompts into platform-native format.
|
|
9
|
+
*
|
|
10
|
+
* Story 42.8
|
|
11
|
+
*/
|
|
12
|
+
/** How the formatted prompt is injected into the platform */
|
|
13
|
+
export type InjectionMethod = 'file' | 'api' | 'stdin';
|
|
14
|
+
/** Platform-specific instructions to inject alongside the prompt */
|
|
15
|
+
export interface PlatformInstructions {
|
|
16
|
+
readonly tools?: readonly string[];
|
|
17
|
+
readonly mcpConfig?: Readonly<Record<string, unknown>>;
|
|
18
|
+
readonly contextFiles?: readonly string[];
|
|
19
|
+
readonly maxTokens?: number;
|
|
20
|
+
}
|
|
21
|
+
/** Configuration specific to a target platform */
|
|
22
|
+
export interface TargetConfig {
|
|
23
|
+
readonly maxPromptLength?: number;
|
|
24
|
+
readonly preserveMarkdown?: boolean;
|
|
25
|
+
readonly verbose?: boolean;
|
|
26
|
+
readonly customHeaders?: Readonly<Record<string, string>>;
|
|
27
|
+
}
|
|
28
|
+
/** Capabilities reported by a target adapter */
|
|
29
|
+
export interface TargetCapabilities {
|
|
30
|
+
readonly supportsMarkdown: boolean;
|
|
31
|
+
readonly supportsMultiFile: boolean;
|
|
32
|
+
readonly supportsMultiTurn: boolean;
|
|
33
|
+
readonly supportsTools: boolean;
|
|
34
|
+
readonly maxContextLength: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Core interface for all platform target adapters.
|
|
38
|
+
*
|
|
39
|
+
* Each adapter transforms an assembled prompt (from the Prompt Assembly Engine)
|
|
40
|
+
* into the native format expected by its target platform.
|
|
41
|
+
*/
|
|
42
|
+
export interface TargetAdapter {
|
|
43
|
+
/**
|
|
44
|
+
* Format an assembled prompt for the target platform.
|
|
45
|
+
*
|
|
46
|
+
* @param assembledPrompt - The raw assembled prompt from the server
|
|
47
|
+
* @param platformInstructions - Platform-specific instructions (tools, MCP, etc.)
|
|
48
|
+
* @param config - Target configuration overrides
|
|
49
|
+
* @returns Formatted prompt string ready for platform injection
|
|
50
|
+
*/
|
|
51
|
+
formatPrompt(assembledPrompt: string, platformInstructions: PlatformInstructions, config: TargetConfig): string;
|
|
52
|
+
/**
|
|
53
|
+
* Get the unique identifier for this target platform.
|
|
54
|
+
*
|
|
55
|
+
* @returns Target ID (e.g., "claude-code", "cursor")
|
|
56
|
+
*/
|
|
57
|
+
getTargetId(): string;
|
|
58
|
+
/**
|
|
59
|
+
* Get the capabilities of this target platform.
|
|
60
|
+
*
|
|
61
|
+
* @returns Capabilities object describing what the platform supports
|
|
62
|
+
*/
|
|
63
|
+
getCapabilities(): TargetCapabilities;
|
|
64
|
+
/**
|
|
65
|
+
* Get the method used to inject prompts into the platform.
|
|
66
|
+
*
|
|
67
|
+
* @returns Injection method: "file", "api", or "stdin"
|
|
68
|
+
*/
|
|
69
|
+
getInjectionMethod(): InjectionMethod;
|
|
70
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license FSL-1.1
|
|
3
|
+
* Copyright (c) 2026 OrNexus AI
|
|
4
|
+
*
|
|
5
|
+
* VS Code Adapter - Formats prompts for VS Code extension chat participant API.
|
|
6
|
+
*
|
|
7
|
+
* VS Code uses extensions and the chat API for AI interactions.
|
|
8
|
+
* This adapter formats prompts as system messages with structured
|
|
9
|
+
* instruction blocks suitable for the chat participant API.
|
|
10
|
+
*
|
|
11
|
+
* Story 42.8
|
|
12
|
+
*/
|
|
13
|
+
import type { InjectionMethod, PlatformInstructions, TargetAdapter, TargetCapabilities, TargetConfig } from './target-adapter.js';
|
|
14
|
+
export declare class VSCodeAdapter implements TargetAdapter {
|
|
15
|
+
formatPrompt(assembledPrompt: string, platformInstructions: PlatformInstructions, config: TargetConfig): string;
|
|
16
|
+
getTargetId(): string;
|
|
17
|
+
getCapabilities(): TargetCapabilities;
|
|
18
|
+
getInjectionMethod(): InjectionMethod;
|
|
19
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const u="vscode",c=128e3,h={supportsMarkdown:!0,supportsMultiFile:!0,supportsMultiTurn:!0,supportsTools:!0,maxContextLength:128e3};class g{formatPrompt(n,t,p){const e=[];if(e.push("<system-instructions>"),e.push(n),e.push("</system-instructions>"),t.tools&&t.tools.length>0){e.push(""),e.push("<available-tools>");for(const o of t.tools)e.push(`- ${o}`);e.push("</available-tools>")}if(t.mcpConfig&&Object.keys(t.mcpConfig).length>0&&(e.push(""),e.push("<mcp-config>"),e.push(JSON.stringify(t.mcpConfig,null,2)),e.push("</mcp-config>")),t.contextFiles&&t.contextFiles.length>0){e.push(""),e.push("<context-files>");for(const o of t.contextFiles)e.push(o);e.push("</context-files>")}let s=e.join(`
|
|
2
|
+
`);const i=p.maxPromptLength??128e3;return s.length>i&&(s=s.slice(0,i)),s}getTargetId(){return u}getCapabilities(){return h}getInjectionMethod(){return"api"}}export{g as VSCodeAdapter};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license FSL-1.1
|
|
3
|
+
* Copyright (c) 2026 OrNexus AI
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Neocortex CLI, licensed under the
|
|
6
|
+
* Functional Source License, Version 1.1 (FSL-1.1).
|
|
7
|
+
*
|
|
8
|
+
* Change Date: February 20, 2029
|
|
9
|
+
* Change License: MIT
|
|
10
|
+
*
|
|
11
|
+
* See the LICENSE file in the project root for full license text.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Replace all version strings in a stub file with the given version.
|
|
15
|
+
* Handles 4 patterns:
|
|
16
|
+
* 1. Emoji description: 🧠Neocortex vX.Y.Z
|
|
17
|
+
* 2. Plain markdown header: # Neocortex vX.Y.Z
|
|
18
|
+
* 3. Banner line: │ ### ######## vX.Y.Z ...│
|
|
19
|
+
* 4. YAML version field: version: 'X.Y.Z'
|
|
20
|
+
*
|
|
21
|
+
* Never throws -- version patching is best-effort.
|
|
22
|
+
* Story 71.2
|
|
23
|
+
*/
|
|
24
|
+
export declare function patchVersionInFile(filePath: string, version: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* P148.05: STUB_TARGETS shape exported for drift tests
|
|
27
|
+
* (`refresh-stubs.test.ts` AC4, `p148-stub-topology.test.ts` AC5).
|
|
28
|
+
* Public surface is the array values + element shape -- field names are
|
|
29
|
+
* documentation, never IP-bearing.
|
|
30
|
+
*/
|
|
31
|
+
export interface StubTarget {
|
|
32
|
+
/** Directory where the stub is installed */
|
|
33
|
+
destDir: string;
|
|
34
|
+
/** Source directory name in targets-stubs/ */
|
|
35
|
+
sourceDir: string;
|
|
36
|
+
/** Files to copy */
|
|
37
|
+
files: string[];
|
|
38
|
+
}
|
|
39
|
+
export declare const STUB_TARGETS: readonly StubTarget[];
|
|
40
|
+
/**
|
|
41
|
+
* Find the monorepo / npm package root by walking up from this file's location.
|
|
42
|
+
* Looks for a package.json with name '@ornexus/neocortex' (monorepo root) or
|
|
43
|
+
* '@neocortex/client' (client package root that contains targets-stubs after build).
|
|
44
|
+
*
|
|
45
|
+
* Returns null if not found within 10 levels.
|
|
46
|
+
*/
|
|
47
|
+
export declare function findPackageRoot(): string | null;
|
|
48
|
+
/**
|
|
49
|
+
* Options for refreshStubs.
|
|
50
|
+
*/
|
|
51
|
+
export interface RefreshStubsOptions {
|
|
52
|
+
/**
|
|
53
|
+
* When true, creates destDir if it doesn't exist (used by activate command).
|
|
54
|
+
* When false (default), skips targets whose destDir doesn't exist.
|
|
55
|
+
* Epic 67 - Story 67.3
|
|
56
|
+
*/
|
|
57
|
+
forceCreate?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* When set, only refreshes this specific target (e.g., 'claude-code').
|
|
60
|
+
* When undefined, refreshes all targets.
|
|
61
|
+
* Epic 67 - Story 67.3: activate only creates claude-code stubs (AC8).
|
|
62
|
+
*/
|
|
63
|
+
targetFilter?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Refresh installed stubs if CLI version differs from installed version.
|
|
67
|
+
*
|
|
68
|
+
* For each stub target:
|
|
69
|
+
* 1. Read .version from install dir
|
|
70
|
+
* 2. Compare with cliVersion
|
|
71
|
+
* 3. If different (or .version missing): re-copy all stub files + write .version
|
|
72
|
+
* 4. If same: skip (no-op)
|
|
73
|
+
*
|
|
74
|
+
* When options.forceCreate is true, creates destDir if it doesn't exist.
|
|
75
|
+
* When options.targetFilter is set, only processes matching target.
|
|
76
|
+
*
|
|
77
|
+
* Never throws -- stub refresh is non-critical.
|
|
78
|
+
* Returns the number of targets that were refreshed.
|
|
79
|
+
*/
|
|
80
|
+
export declare function refreshStubs(cliVersion: string, options?: RefreshStubsOptions): number;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{readFileSync as g,writeFileSync as p,copyFileSync as S,existsSync as l,mkdirSync as x}from"node:fs";import{join as e,dirname as D}from"node:path";import{homedir as i}from"node:os";import{fileURLToPath as k}from"node:url";import{setSecureFilePermissions as h}from"../config/secure-config.js";const F=60,R=25;function E(c,r){try{let t=g(c,"utf-8");const s=t;t=t.replace(/🧠Neocortex v[\d.]+/g,`\u{1F9E0} Neocortex v${r}`),t=t.replace(/# Neocortex v[\d.]+/g,`# Neocortex v${r}`),t=t.replace(/^(│ ### ######## v)[\d.]+(\s*│)$/gm,()=>{const a=`v${r}`,u=F-R-a.length;return`\u2502 ### ######## ${a}${" ".repeat(Math.max(0,u))}\u2502`}),t=t.replace(/version: '[\d.]+'/g,`version: '${r}'`),t!==s&&p(c,t,"utf-8")}catch{}}const $=[{destDir:e(i(),".claude","agents","neocortex"),sourceDir:"claude-code",files:["neocortex.md","neocortex.agent.yaml","neocortex-root.md","neocortex-root.agent.yaml"]},{destDir:e(i(),".gemini","agents"),sourceDir:"gemini-cli",files:["agent.md"]},{destDir:e(i(),".cursor","agents"),sourceDir:"cursor",files:["agent.md"]},{destDir:e(i(),".opencode","agents"),sourceDir:"opencode",files:["neocortex.md","neocortex-root.md"]},{destDir:e(i(),".codex"),sourceDir:"codex",files:["AGENTS.md"]},{destDir:e(i(),".codex","agents"),sourceDir:"codex",files:["neocortex.toml"]},{destDir:e(i(),".copilot","agents"),sourceDir:"vscode",files:["neocortex.agent.md"]},{destDir:e(i(),".agent","skills","neocortex"),sourceDir:"antigravity",files:["skill/SKILL.md"]}];function I(){try{const c=k(import.meta.url);let r=D(c);for(let t=0;t<10;t++){try{if(JSON.parse(g(e(r,"package.json"),"utf-8")).name==="@ornexus/neocortex")return r}catch{}r=D(r)}}catch{}return null}function A(c){try{const r=e(c,".version");if(l(r))return g(r,"utf-8").trim()||null}catch{}return null}function L(c,r){try{const t=r?.forceCreate??!1,s=r?.targetFilter,a=I();if(!a)return 0;const u=e(a,"targets-stubs");if(!l(u))return 0;let f=0;for(const o of $)try{if(s&&o.sourceDir!==s)continue;if(!l(o.destDir))if(t)x(o.destDir,{recursive:!0});else continue;if(A(o.destDir)===c)continue;const y=e(u,o.sourceDir);if(!l(y))continue;let v=!1;for(const n of o.files){const N=e(y,n),d=e(o.destDir,n);l(N)&&(x(D(d),{recursive:!0}),S(N,d),(n.endsWith(".md")||n.endsWith(".yaml")||n.endsWith(".yml"))&&E(d,c),h(d),v=!0)}if(v){const n=e(o.destDir,".version");p(n,c+`
|
|
2
|
+
`,"utf-8"),h(n),f++}}catch{}if(f>0)try{const o=e(i(),".neocortex");x(o,{recursive:!0});const m=e(o,".update-check");p(m,"",{flag:"w"}),h(m)}catch{}return f}catch{return 0}}export{$ as STUB_TARGETS,I as findPackageRoot,E as patchVersionInFile,L as refreshStubs};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license FSL-1.1
|
|
3
|
+
* Copyright (c) 2026 OrNexus AI
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Neocortex CLI, licensed under the
|
|
6
|
+
* Functional Source License, Version 1.1 (FSL-1.1).
|
|
7
|
+
*
|
|
8
|
+
* Change Date: February 20, 2029
|
|
9
|
+
* Change License: MIT
|
|
10
|
+
*
|
|
11
|
+
* See the LICENSE file in the project root for full license text.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Update agent.yaml files across all known locations.
|
|
15
|
+
* Returns count of files updated.
|
|
16
|
+
*
|
|
17
|
+
* Never throws.
|
|
18
|
+
*/
|
|
19
|
+
export declare function updateAgentYaml(version: string, tier?: string): number;
|
|
20
|
+
/**
|
|
21
|
+
* Update agent.yaml at a specific file path (used for testing).
|
|
22
|
+
* Returns true if the file was modified.
|
|
23
|
+
*
|
|
24
|
+
* Never throws.
|
|
25
|
+
*/
|
|
26
|
+
export declare function updateAgentYamlAt(filePath: string, version: string, tier?: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{readFileSync as f,writeFileSync as l,existsSync as u}from"node:fs";import{join as p}from"node:path";import{homedir as m}from"node:os";const E={free:"Free",pro:"Pro",enterprise:"Enterprise"},s=/^(\s*version:\s*)'[^']*'/m,c=/^(\s*title:\s*)'[^']*'/m,d=[p(m(),".claude","agents","neocortex","neocortex.agent.yaml")];function i(t,r,n){try{if(!u(t))return!1;let e=f(t,"utf-8");const o=e,a=E[n.toLowerCase()]??"Free";return s.test(e)&&(e=e.replace(s,`$1'${r}'`)),c.test(e)&&(e=e.replace(c,`$1'Development Orchestrator (${a})'`)),e===o?!1:(l(t,e,"utf-8"),!0)}catch{return!1}}function L(t,r){const n=r??"free";let e=0;for(const o of d)i(o,t,n)&&e++;return e}function S(t,r,n){return i(t,r,n??"free")}export{L as updateAgentYaml,S as updateAgentYamlAt};
|