@iaforged/context-code 1.2.9 → 1.2.10
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/README.md +119 -119
- package/context-bootstrap.js +26 -26
- package/dist/src/QueryEngine.js +394 -327
- package/dist/src/bridge/bridgeUI.js +1 -1
- package/dist/src/buddy/prompt.js +4 -4
- package/dist/src/cli/handlers/auth.js +126 -9
- package/dist/src/cli/print.js +35 -1
- package/dist/src/commands/agent/agent.js +28 -2
- package/dist/src/commands/agent/agentStore.js +8 -1
- package/dist/src/commands/agent/index.js +1 -1
- package/dist/src/commands/bridge-kick.js +9 -9
- package/dist/src/commands/commit.js +34 -34
- package/dist/src/commands/init-verifiers.js +3 -3
- package/dist/src/commands/init.js +88 -88
- package/dist/src/commands/insights.js +787 -787
- package/dist/src/commands/install.js +19 -19
- package/dist/src/commands/login/login.js +21 -12
- package/dist/src/commands/logout/logout.js +9 -0
- package/dist/src/commands/model/model.js +9 -4
- package/dist/src/commands/orchestrate/SwarmUI.js +50 -0
- package/dist/src/commands/orchestrate/index.js +2 -2
- package/dist/src/commands/orchestrate/orchestrate.js +708 -12
- package/dist/src/commands/pr_comments/index.js +33 -33
- package/dist/src/commands/profile/index.js +1 -1
- package/dist/src/commands/profile/profile.js +52 -3
- package/dist/src/commands/provider/index.js +1 -1
- package/dist/src/commands/provider/provider.js +117 -45
- package/dist/src/commands/resumen/index.js +9 -0
- package/dist/src/commands/resumen/resumen.js +29 -0
- package/dist/src/commands/security-review.js +190 -190
- package/dist/src/commands/swarm-auto/index.js +9 -0
- package/dist/src/commands/swarm-auto/swarmAuto.js +111 -0
- package/dist/src/commands/swarm-init/index.js +9 -0
- package/dist/src/commands/swarm-init/swarmInit.js +72 -0
- package/dist/src/commands/team/team.js +39 -6
- package/dist/src/commands.js +14 -0
- package/dist/src/components/LogoV2/CondensedLogo.js +2 -2
- package/dist/src/components/PromptInput/PromptInputQueuedCommands.js +3 -3
- package/dist/src/components/agents/agentFileUtils.js +6 -6
- package/dist/src/components/permissions/hooks.js +5 -5
- package/dist/src/constants/outputStyles.js +83 -83
- package/dist/src/core/agents/blueprints.js +58 -0
- package/dist/src/core/agents/cliAdapter.js +61 -0
- package/dist/src/core/agents/registry.js +93 -0
- package/dist/src/core/agents/runtime.js +4 -0
- package/dist/src/core/agents/runtime.smoke.js +42 -0
- package/dist/src/core/agents/swarm.smoke.js +48 -0
- package/dist/src/core/agents/swarmTools.js +38 -0
- package/dist/src/core/auth/index.js +2 -0
- package/dist/src/core/auth/loginCliAdapter.js +24 -0
- package/dist/src/core/auth/loginCore.js +67 -0
- package/dist/src/core/auth/logoutCliAdapter.js +34 -0
- package/dist/src/core/auth/logoutCore.js +52 -0
- package/dist/src/core/auth/preflight.smoke.js +151 -0
- package/dist/src/core/index.js +21 -0
- package/dist/src/core/mcp/blueprints.js +27 -0
- package/dist/src/core/mcp/common.js +14 -0
- package/dist/src/core/mcp/runtime.js +67 -0
- package/dist/src/core/mcp/runtime.smoke.js +50 -0
- package/dist/src/core/mcp/swarmClient.js +40 -0
- package/dist/src/core/mcp/swarmSetup.js +43 -0
- package/dist/src/core/providers/cliAdapter.js +39 -0
- package/dist/src/core/providers/contracts.js +1 -0
- package/dist/src/core/providers/index.js +3 -0
- package/dist/src/core/providers/llmCore.js +123 -0
- package/dist/src/core/providers/providerCore.js +141 -0
- package/dist/src/core/providers/providerModelCompatibility.js +98 -0
- package/dist/src/core/providers/providerParitySmoke.js +83 -0
- package/dist/src/core/providers/providerProfileModelSmoke.js +80 -0
- package/dist/src/core/query/contracts.js +1 -0
- package/dist/src/core/query/runtime.js +117 -0
- package/dist/src/core/query/runtime.smoke.js +39 -0
- package/dist/src/core/query/timelineThinking.smoke.js +25 -0
- package/dist/src/core/query/wiring.smoke.js +76 -0
- package/dist/src/core/skills/cliAdapter.js +38 -0
- package/dist/src/core/skills/index.js +52 -0
- package/dist/src/core/skills/runtime.smoke.js +53 -0
- package/dist/src/core/tasks/runtime.js +205 -0
- package/dist/src/core/tasks/runtime.smoke.js +63 -0
- package/dist/src/core/tasks/sdkAdapter.js +4 -0
- package/dist/src/core/tools/contracts.js +3 -0
- package/dist/src/core/tools/fileResolution.js +112 -0
- package/dist/src/core/tools/fileResolution.smoke.js +33 -0
- package/dist/src/core/tools/filesCore.js +51 -0
- package/dist/src/core/tools/filesCore.smoke.js +108 -0
- package/dist/src/core/tools/gitCore.js +20 -0
- package/dist/src/core/tools/imageParity.smoke.js +36 -0
- package/dist/src/core/tools/notebookParity.smoke.js +68 -0
- package/dist/src/core/tools/registry.js +22 -0
- package/dist/src/core/tools/runtime.smoke.js +32 -0
- package/dist/src/core/tools/shellCore.js +60 -0
- package/dist/src/core/types/agentContext.js +9 -0
- package/dist/src/core/types/auth.js +3 -0
- package/dist/src/core/types/command.js +13 -0
- package/dist/src/core/types/provider.js +3 -0
- package/dist/src/core/types/sdkEvent.js +10 -0
- package/dist/src/core/types/swarm.js +1 -0
- package/dist/src/cost-tracker.js +3 -3
- package/dist/src/hooks/useAwaySummary.js +22 -9
- package/dist/src/main.js +32 -2
- package/dist/src/screens/REPL.js +9 -0
- package/dist/src/services/AgentSummary/agentSummary.js +10 -10
- package/dist/src/services/autoDream/autoDream.js +5 -5
- package/dist/src/services/autoDream/consolidationPrompt.js +49 -49
- package/dist/src/services/compact/prompt.js +238 -238
- package/dist/src/services/limits/sessionCounter.js +17 -17
- package/dist/src/services/mcp/client.js +27 -1
- package/dist/src/services/orchestration/execution/AgentTaskExecutor.js +39 -20
- package/dist/src/services/orchestration/execution/OrchestrationExecutionRuntime.js +65 -58
- package/dist/src/skills/bundled/loop.js +57 -57
- package/dist/src/skills/bundled/remember.js +53 -53
- package/dist/src/skills/bundled/simplify.js +49 -49
- package/dist/src/skills/bundled/skillify.js +2 -2
- package/dist/src/state/onChangeAppState.js +6 -0
- package/dist/src/tasks/LocalAgentTask/LocalAgentTask.js +5 -5
- package/dist/src/tasks/LocalMainSessionTask.js +5 -5
- package/dist/src/tasks/LocalShellTask/LocalShellTask.js +13 -13
- package/dist/src/tools/AgentTool/forkSubagent.js +25 -25
- package/dist/src/tools/AskUserQuestionTool/prompt.js +29 -29
- package/dist/src/tools/BashTool/BashTool.js +27 -2
- package/dist/src/tools/BriefTool/prompt.js +14 -14
- package/dist/src/tools/EnterPlanModeTool/EnterPlanModeTool.js +12 -12
- package/dist/src/tools/EnterPlanModeTool/prompt.js +140 -140
- package/dist/src/tools/ExitPlanModeTool/ExitPlanModeV2Tool.js +18 -18
- package/dist/src/tools/ExitPlanModeTool/prompt.js +23 -23
- package/dist/src/tools/ExitWorktreeTool/prompt.js +29 -29
- package/dist/src/tools/FileEditTool/prompt.js +7 -7
- package/dist/src/tools/FileReadTool/FileReadTool.js +18 -1
- package/dist/src/tools/FileWriteTool/prompt.js +6 -6
- package/dist/src/tools/GlobTool/prompt.js +4 -4
- package/dist/src/tools/GrepTool/prompt.js +10 -10
- package/dist/src/tools/LSPTool/prompt.js +18 -18
- package/dist/src/tools/ListMcpResourcesTool/prompt.js +15 -15
- package/dist/src/tools/PowerShellTool/PowerShellTool.js +25 -2
- package/dist/src/tools/ReadMcpResourceTool/prompt.js +13 -13
- package/dist/src/tools/SendMessageTool/prompt.js +36 -36
- package/dist/src/tools/SkillTool/prompt.js +21 -21
- package/dist/src/tools/SleepTool/prompt.js +10 -10
- package/dist/src/tools/TaskCreateTool/prompt.js +41 -41
- package/dist/src/tools/TaskGetTool/prompt.js +21 -21
- package/dist/src/tools/TaskListTool/prompt.js +30 -30
- package/dist/src/tools/TaskOutputTool/TaskOutputTool.js +8 -8
- package/dist/src/tools/TaskStopTool/prompt.js +5 -5
- package/dist/src/tools/TaskUpdateTool/prompt.js +74 -74
- package/dist/src/tools/TodoWriteTool/prompt.js +178 -178
- package/dist/src/tools/ToolSearchTool/prompt.js +9 -9
- package/dist/src/tools/WebFetchTool/WebFetchTool.js +9 -9
- package/dist/src/tools/WebFetchTool/prompt.js +31 -31
- package/dist/src/tools/WebSearchTool/prompt.js +26 -26
- package/dist/src/utils/agentContext.js +2 -0
- package/dist/src/utils/agenticSessionSearch.js +38 -38
- package/dist/src/utils/config.js +2 -0
- package/dist/src/utils/genericProcessUtils.js +21 -21
- package/dist/src/utils/heapDumpService.js +4 -4
- package/dist/src/utils/mcpValidation.js +2 -2
- package/dist/src/utils/model/modelStrings.js +1 -1
- package/dist/src/utils/model/providers.js +5 -0
- package/dist/src/utils/orchestration/store/providerAgentStore.js +22 -22
- package/dist/src/utils/orchestration/store/providerWorkspaceStore.js +10 -10
- package/dist/src/utils/orchestration/store/runStore.js +68 -68
- package/dist/src/utils/orchestration/store/teamStore.js +28 -28
- package/dist/src/utils/permissions/permissionExplainer.js +6 -6
- package/dist/src/utils/permissions/permissionsDb.js +43 -43
- package/dist/src/utils/sdkEventQueue.js +2 -0
- package/dist/src/utils/secureStorage/sqliteStorage.js +12 -12
- package/dist/src/utils/standardMcp/common.js +15 -0
- package/dist/src/utils/standardMcp/setup.js +52 -0
- package/dist/src/utils/swarm/teammatePromptAddendum.js +10 -10
- package/dist/src/utils/task/framework.js +6 -6
- package/package.json +1 -1
- package/dist/src/commands/usage/index.js +0 -7
- package/dist/src/commands/usage/usage.js +0 -5
|
@@ -78,10 +78,10 @@ function decryptPayload(payload) {
|
|
|
78
78
|
return decrypted.toString('utf8');
|
|
79
79
|
}
|
|
80
80
|
function savePayload(db, plainText) {
|
|
81
|
-
db.prepare(`
|
|
82
|
-
INSERT INTO secure_storage (key, value)
|
|
83
|
-
VALUES (?, ?)
|
|
84
|
-
ON CONFLICT(key) DO UPDATE SET value = excluded.value
|
|
81
|
+
db.prepare(`
|
|
82
|
+
INSERT INTO secure_storage (key, value)
|
|
83
|
+
VALUES (?, ?)
|
|
84
|
+
ON CONFLICT(key) DO UPDATE SET value = excluded.value
|
|
85
85
|
`).run('main_storage', encryptPayload(plainText));
|
|
86
86
|
}
|
|
87
87
|
function getStoredPayload() {
|
|
@@ -113,14 +113,14 @@ function getDb() {
|
|
|
113
113
|
}
|
|
114
114
|
const sqlite = require('node:sqlite');
|
|
115
115
|
_db = new sqlite.DatabaseSync(path);
|
|
116
|
-
_db.exec(`
|
|
117
|
-
PRAGMA journal_mode = WAL;
|
|
118
|
-
PRAGMA synchronous = NORMAL;
|
|
119
|
-
|
|
120
|
-
CREATE TABLE IF NOT EXISTS secure_storage (
|
|
121
|
-
key TEXT PRIMARY KEY,
|
|
122
|
-
value TEXT NOT NULL
|
|
123
|
-
);
|
|
116
|
+
_db.exec(`
|
|
117
|
+
PRAGMA journal_mode = WAL;
|
|
118
|
+
PRAGMA synchronous = NORMAL;
|
|
119
|
+
|
|
120
|
+
CREATE TABLE IF NOT EXISTS secure_storage (
|
|
121
|
+
key TEXT PRIMARY KEY,
|
|
122
|
+
value TEXT NOT NULL
|
|
123
|
+
);
|
|
124
124
|
`);
|
|
125
125
|
return _db;
|
|
126
126
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants for Standard MCP servers.
|
|
3
|
+
*/
|
|
4
|
+
export const STANDARD_MCP_SERVERS = {
|
|
5
|
+
DUCKDUCKGO: 'duckduckgo',
|
|
6
|
+
FILESYSTEM: 'filesystem',
|
|
7
|
+
MEMORY: 'memory',
|
|
8
|
+
SEQUENTIAL_THINKING: 'sequential-thinking'
|
|
9
|
+
};
|
|
10
|
+
export const STANDARD_MCP_DESCRIPTIONS = {
|
|
11
|
+
[STANDARD_MCP_SERVERS.DUCKDUCKGO]: 'Buscador de internet DuckDuckGo para obtener información actualizada.',
|
|
12
|
+
[STANDARD_MCP_SERVERS.FILESYSTEM]: 'Acceso al sistema de archivos local para leer y escribir archivos.',
|
|
13
|
+
[STANDARD_MCP_SERVERS.MEMORY]: 'Sistema de memoria a largo plazo para recordar hechos y preferencias.',
|
|
14
|
+
[STANDARD_MCP_SERVERS.SEQUENTIAL_THINKING]: 'Herramienta para razonamiento secuencial y resolución de problemas complejos.'
|
|
15
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { getCwd } from '../cwd.js';
|
|
3
|
+
import { STANDARD_MCP_SERVERS, STANDARD_MCP_DESCRIPTIONS } from './common.js';
|
|
4
|
+
/**
|
|
5
|
+
* Finds the npx executable on Windows.
|
|
6
|
+
*/
|
|
7
|
+
function findNpx() {
|
|
8
|
+
const commonPath = 'C:\\Program Files\\nodejs\\npx.cmd';
|
|
9
|
+
if (existsSync(commonPath)) {
|
|
10
|
+
return commonPath;
|
|
11
|
+
}
|
|
12
|
+
return 'npx';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Setup standard MCP servers as built-in tools.
|
|
16
|
+
*/
|
|
17
|
+
export function setupStandardMCPs() {
|
|
18
|
+
const npx = findNpx();
|
|
19
|
+
const cwd = getCwd();
|
|
20
|
+
return {
|
|
21
|
+
mcpConfig: {
|
|
22
|
+
[STANDARD_MCP_SERVERS.DUCKDUCKGO]: {
|
|
23
|
+
type: 'stdio',
|
|
24
|
+
command: npx,
|
|
25
|
+
args: ['-y', 'duckduckgo-mcp-server'],
|
|
26
|
+
scope: 'dynamic',
|
|
27
|
+
description: STANDARD_MCP_DESCRIPTIONS[STANDARD_MCP_SERVERS.DUCKDUCKGO]
|
|
28
|
+
},
|
|
29
|
+
[STANDARD_MCP_SERVERS.FILESYSTEM]: {
|
|
30
|
+
type: 'stdio',
|
|
31
|
+
command: npx,
|
|
32
|
+
args: ['-y', '@modelcontextprotocol/server-filesystem', cwd],
|
|
33
|
+
scope: 'dynamic',
|
|
34
|
+
description: STANDARD_MCP_DESCRIPTIONS[STANDARD_MCP_SERVERS.FILESYSTEM]
|
|
35
|
+
},
|
|
36
|
+
[STANDARD_MCP_SERVERS.MEMORY]: {
|
|
37
|
+
type: 'stdio',
|
|
38
|
+
command: npx,
|
|
39
|
+
args: ['-y', '@modelcontextprotocol/server-memory'],
|
|
40
|
+
scope: 'dynamic',
|
|
41
|
+
description: STANDARD_MCP_DESCRIPTIONS[STANDARD_MCP_SERVERS.MEMORY]
|
|
42
|
+
},
|
|
43
|
+
[STANDARD_MCP_SERVERS.SEQUENTIAL_THINKING]: {
|
|
44
|
+
type: 'stdio',
|
|
45
|
+
command: npx,
|
|
46
|
+
args: ['-y', '@modelcontextprotocol/server-sequential-thinking'],
|
|
47
|
+
scope: 'dynamic',
|
|
48
|
+
description: STANDARD_MCP_DESCRIPTIONS[STANDARD_MCP_SERVERS.SEQUENTIAL_THINKING]
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* This is appended to the full main agent system prompt for teammates.
|
|
5
5
|
* It explains visibility constraints and communication requirements.
|
|
6
6
|
*/
|
|
7
|
-
export const TEAMMATE_SYSTEM_PROMPT_ADDENDUM = `
|
|
8
|
-
# Agent Teammate Communication
|
|
9
|
-
|
|
10
|
-
IMPORTANT: You are running as an agent in a team. To communicate with anyone on your team:
|
|
11
|
-
- Use the SendMessage tool with \`to: "<name>"\` to send messages to specific teammates
|
|
12
|
-
- Use the SendMessage tool with \`to: "*"\` sparingly for team-wide broadcasts
|
|
13
|
-
|
|
14
|
-
Just writing a response in text is not visible to others on your team - you MUST use the SendMessage tool.
|
|
15
|
-
|
|
16
|
-
The user interacts primarily with the team lead. Your work is coordinated through the task system and teammate messaging.
|
|
7
|
+
export const TEAMMATE_SYSTEM_PROMPT_ADDENDUM = `
|
|
8
|
+
# Agent Teammate Communication
|
|
9
|
+
|
|
10
|
+
IMPORTANT: You are running as an agent in a team. To communicate with anyone on your team:
|
|
11
|
+
- Use the SendMessage tool with \`to: "<name>"\` to send messages to specific teammates
|
|
12
|
+
- Use the SendMessage tool with \`to: "*"\` sparingly for team-wide broadcasts
|
|
13
|
+
|
|
14
|
+
Just writing a response in text is not visible to others on your team - you MUST use the SendMessage tool.
|
|
15
|
+
|
|
16
|
+
The user interacts primarily with the team lead. Your work is coordinated through the task system and teammate messaging.
|
|
17
17
|
`;
|
|
@@ -208,12 +208,12 @@ function enqueueTaskNotification(attachment) {
|
|
|
208
208
|
const toolUseIdLine = attachment.toolUseId
|
|
209
209
|
? `\n<${TOOL_USE_ID_TAG}>${attachment.toolUseId}</${TOOL_USE_ID_TAG}>`
|
|
210
210
|
: '';
|
|
211
|
-
const message = `<${TASK_NOTIFICATION_TAG}>
|
|
212
|
-
<${TASK_ID_TAG}>${attachment.taskId}</${TASK_ID_TAG}>${toolUseIdLine}
|
|
213
|
-
<${TASK_TYPE_TAG}>${attachment.taskType}</${TASK_TYPE_TAG}>
|
|
214
|
-
<${OUTPUT_FILE_TAG}>${outputPath}</${OUTPUT_FILE_TAG}>
|
|
215
|
-
<${STATUS_TAG}>${attachment.status}</${STATUS_TAG}>
|
|
216
|
-
<${SUMMARY_TAG}>Task "${attachment.description}" ${statusText}</${SUMMARY_TAG}>
|
|
211
|
+
const message = `<${TASK_NOTIFICATION_TAG}>
|
|
212
|
+
<${TASK_ID_TAG}>${attachment.taskId}</${TASK_ID_TAG}>${toolUseIdLine}
|
|
213
|
+
<${TASK_TYPE_TAG}>${attachment.taskType}</${TASK_TYPE_TAG}>
|
|
214
|
+
<${OUTPUT_FILE_TAG}>${outputPath}</${OUTPUT_FILE_TAG}>
|
|
215
|
+
<${STATUS_TAG}>${attachment.status}</${STATUS_TAG}>
|
|
216
|
+
<${SUMMARY_TAG}>Task "${attachment.description}" ${statusText}</${SUMMARY_TAG}>
|
|
217
217
|
</${TASK_NOTIFICATION_TAG}>`;
|
|
218
218
|
enqueuePendingNotification({ value: message, mode: 'task-notification' });
|
|
219
219
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iaforged/context-code",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.10",
|
|
4
4
|
"description": "Context Code es un asistente de desarrollo para la terminal. Puede revisar tu proyecto, editar archivos, ejecutar comandos y apoyarte en tareas reales de programacion.",
|
|
5
5
|
"author": "Context AI",
|
|
6
6
|
"license": "MIT",
|