@iaforged/context-code 1.0.77 → 1.0.79
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 +68 -68
- package/cli.js +8515 -8515
- package/context-bootstrap.js +27 -27
- package/dist/src/bootstrap/state.js +3 -0
- package/dist/src/bridge/bridgeMain.js +40 -40
- package/dist/src/cli/print.js +12 -12
- package/dist/src/commands/agent/agent.js +8 -0
- package/dist/src/commands/commit-push-pr.js +55 -55
- package/dist/src/commands/createMovedToPluginCommand.js +9 -9
- package/dist/src/commands/init-verifiers.js +238 -238
- package/dist/src/commands/init.js +216 -216
- package/dist/src/commands/install.js +2 -2
- package/dist/src/commands/login/login.js +24 -10
- package/dist/src/commands/orchestrate/index.js +1 -1
- package/dist/src/commands/orchestrate/orchestrate.js +110 -24
- package/dist/src/commands/profile/profile.js +15 -1
- package/dist/src/commands/provider/index.js +1 -1
- package/dist/src/commands/provider/provider.js +34 -1
- package/dist/src/commands/review.js +22 -22
- package/dist/src/commands/run/index.js +2 -2
- package/dist/src/commands/run/run.js +63 -61
- package/dist/src/commands/team/index.js +1 -1
- package/dist/src/commands/team/team.js +84 -76
- package/dist/src/commands/team-auto/teamAuto.js +89 -29
- package/dist/src/commands/terminalSetup/terminalSetup.js +24 -24
- package/dist/src/commands/usage/index.js +7 -0
- package/dist/src/commands/usage/usage.js +5 -0
- package/dist/src/commands/workspace/workspace.js +39 -31
- package/dist/src/commands.js +0 -2
- package/dist/src/components/ConsoleOAuthFlow.js +92 -14
- package/dist/src/components/ModelPicker.js +2 -0
- package/dist/src/components/agents/generateAgent.js +92 -92
- package/dist/src/components/grove/Grove.js +10 -10
- package/dist/src/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.js +8 -8
- package/dist/src/constants/geminiOAuth.js +13 -0
- package/dist/src/constants/github-app.js +134 -134
- package/dist/src/constants/prompts.js +123 -123
- package/dist/src/coordinator/coordinatorMode.js +252 -252
- package/dist/src/hooks/useTypeahead.js +7 -7
- package/dist/src/ink/reconciler.js +7 -7
- package/dist/src/main.js +5 -5
- package/dist/src/memdir/findRelevantMemories.js +6 -6
- package/dist/src/services/MagicDocs/prompts.js +56 -56
- package/dist/src/services/PromptSuggestion/promptSuggestion.js +29 -29
- package/dist/src/services/SessionMemory/prompts.js +66 -66
- package/dist/src/services/api/openai.js +584 -21
- package/dist/src/services/limits/adapters/ollama.js +3 -3
- package/dist/src/services/oauth/geminiCli.js +107 -0
- package/dist/src/services/orchestration/execution/AgentTaskExecutor.js +5 -3
- package/dist/src/services/orchestration/execution/OrchestrationExecutionRuntime.js +18 -18
- package/dist/src/services/orchestration/global/reporting.js +2 -2
- package/dist/src/services/toolUseSummary/toolUseSummaryGenerator.js +9 -9
- package/dist/src/skills/bundled/batch.js +78 -78
- package/dist/src/skills/bundled/claudeApi.js +34 -34
- package/dist/src/skills/bundled/claudeInChrome.js +4 -4
- package/dist/src/skills/bundled/debug.js +36 -36
- package/dist/src/skills/bundled/scheduleRemoteAgents.js +151 -151
- package/dist/src/skills/bundled/skillify.js +132 -132
- package/dist/src/skills/bundled/stuck.js +53 -53
- package/dist/src/skills/bundled/updateConfig.js +418 -418
- package/dist/src/tasks/RemoteAgentTask/RemoteAgentTask.js +26 -26
- package/dist/src/tools/AgentTool/AgentTool.js +7 -7
- package/dist/src/tools/AgentTool/built-in/claudeCodeGuideAgent.js +67 -67
- package/dist/src/tools/AgentTool/built-in/exploreAgent.js +32 -32
- package/dist/src/tools/AgentTool/built-in/generalPurposeAgent.js +13 -13
- package/dist/src/tools/AgentTool/built-in/planAgent.js +49 -49
- package/dist/src/tools/AgentTool/built-in/statuslineSetup.js +129 -129
- package/dist/src/tools/AgentTool/built-in/verificationAgent.js +119 -119
- package/dist/src/tools/AgentTool/prompt.js +131 -131
- package/dist/src/tools/AgentTool/runAgent.js +9 -9
- package/dist/src/tools/BashTool/BashTool.js +10 -10
- package/dist/src/tools/BashTool/prompt.js +94 -94
- package/dist/src/tools/ConfigTool/prompt.js +29 -29
- package/dist/src/tools/EnterWorktreeTool/prompt.js +27 -27
- package/dist/src/tools/FileReadTool/prompt.js +12 -12
- package/dist/src/tools/PowerShellTool/prompt.js +82 -82
- package/dist/src/tools/RemoteTriggerTool/prompt.js +9 -9
- package/dist/src/tools/ScheduleCronTool/prompt.js +37 -37
- package/dist/src/tools/TeamCreateTool/prompt.js +110 -110
- package/dist/src/tools/TeamDeleteTool/prompt.js +13 -13
- package/dist/src/utils/advisor.js +15 -15
- package/dist/src/utils/api.js +2 -2
- package/dist/src/utils/auth.js +207 -2
- package/dist/src/utils/autoUpdater.js +18 -18
- package/dist/src/utils/bash/ShellSnapshot.js +86 -86
- package/dist/src/utils/bash/commands.js +61 -61
- package/dist/src/utils/claudeInChrome/prompt.js +53 -53
- package/dist/src/utils/claudeInChrome/setup.js +8 -8
- package/dist/src/utils/databaseMcp/server/queries.js +632 -632
- package/dist/src/utils/deepLink/registerProtocol.js +35 -35
- package/dist/src/utils/deepLink/terminalLauncher.js +12 -12
- package/dist/src/utils/hooks/execAgentHook.js +7 -7
- package/dist/src/utils/hooks/execPromptHook.js +4 -4
- package/dist/src/utils/hooks/skillImprovement.js +36 -36
- package/dist/src/utils/logoV2Utils.js +1 -1
- package/dist/src/utils/mcp/dateTimeParser.js +9 -9
- package/dist/src/utils/messages.js +191 -191
- package/dist/src/utils/model/model.js +18 -0
- package/dist/src/utils/model/modelOptions.js +51 -1
- package/dist/src/utils/model/modelStrings.js +5 -1
- package/dist/src/utils/model/modelSupportOverrides.js +3 -0
- package/dist/src/utils/model/providerBaseUrls.js +6 -1
- package/dist/src/utils/model/providerCatalog.js +64 -28
- package/dist/src/utils/model/providerModels.js +88 -17
- package/dist/src/utils/model/providerProfiles.js +8 -0
- package/dist/src/utils/model/providerProfilesDb.js +578 -393
- package/dist/src/utils/model/providerSwitch.js +12 -0
- package/dist/src/utils/model/providerWorkspaces.js +2 -0
- package/dist/src/utils/model/providers.js +65 -2
- package/dist/src/utils/orchestration/store/providerWorkspaceStore.js +3 -1
- package/dist/src/utils/orchestration/store/runStore.js +47 -47
- package/dist/src/utils/orchestration/store/teamStore.js +61 -61
- package/dist/src/utils/powershell/parser.js +253 -253
- package/dist/src/utils/sessionTitle.js +12 -12
- package/dist/src/utils/sideQuestion.js +17 -17
- package/dist/src/utils/status.js +1 -1
- package/dist/src/utils/swarm/backends/registry.js +9 -9
- package/dist/src/utils/telemetry/instrumentation.js +9 -9
- package/dist/src/utils/teleport.js +15 -15
- package/dist/src/utils/undercover.js +28 -28
- package/package.json +1 -1
|
@@ -72,34 +72,34 @@ async function registerMacos(claudePath) {
|
|
|
72
72
|
}
|
|
73
73
|
await fs.mkdir(path.dirname(MACOS_SYMLINK_PATH), { recursive: true });
|
|
74
74
|
// Info.plist — registers the URL scheme with claude as the executable
|
|
75
|
-
const infoPlist = `<?xml version="1.0" encoding="UTF-8"?>
|
|
76
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
77
|
-
<plist version="1.0">
|
|
78
|
-
<dict>
|
|
79
|
-
<key>CFBundleIdentifier</key>
|
|
80
|
-
<string>${MACOS_BUNDLE_ID}</string>
|
|
81
|
-
<key>CFBundleName</key>
|
|
82
|
-
<string>${APP_NAME}</string>
|
|
83
|
-
<key>CFBundleExecutable</key>
|
|
84
|
-
<string>claude</string>
|
|
85
|
-
<key>CFBundleVersion</key>
|
|
86
|
-
<string>1.0</string>
|
|
87
|
-
<key>CFBundlePackageType</key>
|
|
88
|
-
<string>APPL</string>
|
|
89
|
-
<key>LSBackgroundOnly</key>
|
|
90
|
-
<true/>
|
|
91
|
-
<key>CFBundleURLTypes</key>
|
|
92
|
-
<array>
|
|
93
|
-
<dict>
|
|
94
|
-
<key>CFBundleURLName</key>
|
|
95
|
-
<string>Context Code Deep Link</string>
|
|
96
|
-
<key>CFBundleURLSchemes</key>
|
|
97
|
-
<array>
|
|
98
|
-
<string>${DEEP_LINK_PROTOCOL}</string>
|
|
99
|
-
</array>
|
|
100
|
-
</dict>
|
|
101
|
-
</array>
|
|
102
|
-
</dict>
|
|
75
|
+
const infoPlist = `<?xml version="1.0" encoding="UTF-8"?>
|
|
76
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
77
|
+
<plist version="1.0">
|
|
78
|
+
<dict>
|
|
79
|
+
<key>CFBundleIdentifier</key>
|
|
80
|
+
<string>${MACOS_BUNDLE_ID}</string>
|
|
81
|
+
<key>CFBundleName</key>
|
|
82
|
+
<string>${APP_NAME}</string>
|
|
83
|
+
<key>CFBundleExecutable</key>
|
|
84
|
+
<string>claude</string>
|
|
85
|
+
<key>CFBundleVersion</key>
|
|
86
|
+
<string>1.0</string>
|
|
87
|
+
<key>CFBundlePackageType</key>
|
|
88
|
+
<string>APPL</string>
|
|
89
|
+
<key>LSBackgroundOnly</key>
|
|
90
|
+
<true/>
|
|
91
|
+
<key>CFBundleURLTypes</key>
|
|
92
|
+
<array>
|
|
93
|
+
<dict>
|
|
94
|
+
<key>CFBundleURLName</key>
|
|
95
|
+
<string>Context Code Deep Link</string>
|
|
96
|
+
<key>CFBundleURLSchemes</key>
|
|
97
|
+
<array>
|
|
98
|
+
<string>${DEEP_LINK_PROTOCOL}</string>
|
|
99
|
+
</array>
|
|
100
|
+
</dict>
|
|
101
|
+
</array>
|
|
102
|
+
</dict>
|
|
103
103
|
</plist>`;
|
|
104
104
|
await fs.writeFile(path.join(contentsDir, 'Info.plist'), infoPlist);
|
|
105
105
|
// Symlink to the already-signed claude binary — avoids a new executable
|
|
@@ -119,13 +119,13 @@ async function registerMacos(claudePath) {
|
|
|
119
119
|
*/
|
|
120
120
|
async function registerLinux(claudePath) {
|
|
121
121
|
await fs.mkdir(path.dirname(linuxDesktopPath()), { recursive: true });
|
|
122
|
-
const desktopEntry = `[Desktop Entry]
|
|
123
|
-
Name=${APP_NAME}
|
|
124
|
-
Comment=Handle ${DEEP_LINK_PROTOCOL}:// deep links for Context Code
|
|
125
|
-
${linuxExecLine(claudePath)}
|
|
126
|
-
Type=Application
|
|
127
|
-
NoDisplay=true
|
|
128
|
-
MimeType=x-scheme-handler/${DEEP_LINK_PROTOCOL};
|
|
122
|
+
const desktopEntry = `[Desktop Entry]
|
|
123
|
+
Name=${APP_NAME}
|
|
124
|
+
Comment=Handle ${DEEP_LINK_PROTOCOL}:// deep links for Context Code
|
|
125
|
+
${linuxExecLine(claudePath)}
|
|
126
|
+
Type=Application
|
|
127
|
+
NoDisplay=true
|
|
128
|
+
MimeType=x-scheme-handler/${DEEP_LINK_PROTOCOL};
|
|
129
129
|
`;
|
|
130
130
|
await fs.writeFile(linuxDesktopPath(), desktopEntry);
|
|
131
131
|
// Register as the default handler for the scheme. On headless boxes
|
|
@@ -213,15 +213,15 @@ async function launchMacosTerminal(terminal, claudePath, claudeArgs, cwd) {
|
|
|
213
213
|
// make a second one. Check `running` first: if already running (even
|
|
214
214
|
// with zero windows), create a window; if not, `activate` lets iTerm's
|
|
215
215
|
// startup create the first window.
|
|
216
|
-
const script = `tell application "iTerm"
|
|
217
|
-
if running then
|
|
218
|
-
create window with default profile
|
|
219
|
-
else
|
|
220
|
-
activate
|
|
221
|
-
end if
|
|
222
|
-
tell current session of current window
|
|
223
|
-
write text ${appleScriptQuote(shCmd)}
|
|
224
|
-
end tell
|
|
216
|
+
const script = `tell application "iTerm"
|
|
217
|
+
if running then
|
|
218
|
+
create window with default profile
|
|
219
|
+
else
|
|
220
|
+
activate
|
|
221
|
+
end if
|
|
222
|
+
tell current session of current window
|
|
223
|
+
write text ${appleScriptQuote(shCmd)}
|
|
224
|
+
end tell
|
|
225
225
|
end tell`;
|
|
226
226
|
const { code } = await execFileNoThrow('osascript', ['-e', script], {
|
|
227
227
|
useCwd: false,
|
|
@@ -232,9 +232,9 @@ end tell`;
|
|
|
232
232
|
}
|
|
233
233
|
case 'Terminal': {
|
|
234
234
|
const shCmd = buildShellCommand(claudePath, claudeArgs, cwd);
|
|
235
|
-
const script = `tell application "Terminal"
|
|
236
|
-
do script ${appleScriptQuote(shCmd)}
|
|
237
|
-
activate
|
|
235
|
+
const script = `tell application "Terminal"
|
|
236
|
+
do script ${appleScriptQuote(shCmd)}
|
|
237
|
+
activate
|
|
238
238
|
end tell`;
|
|
239
239
|
const { code } = await execFileNoThrow('osascript', ['-e', script], {
|
|
240
240
|
useCwd: false,
|
|
@@ -65,13 +65,13 @@ _messages, agentName) {
|
|
|
65
65
|
structuredOutputTool,
|
|
66
66
|
];
|
|
67
67
|
const systemPrompt = asSystemPrompt([
|
|
68
|
-
`You are verifying a stop condition in Context Code. Your task is to verify that the agent completed the given plan. The conversation transcript is available at: ${transcriptPath}\nYou can read this file to analyze the conversation history if needed.
|
|
69
|
-
|
|
70
|
-
Use the available tools to inspect the codebase and verify the condition.
|
|
71
|
-
Use as few steps as possible - be efficient and direct.
|
|
72
|
-
|
|
73
|
-
When done, return your result using the ${SYNTHETIC_OUTPUT_TOOL_NAME} tool with:
|
|
74
|
-
- ok: true if the condition is met
|
|
68
|
+
`You are verifying a stop condition in Context Code. Your task is to verify that the agent completed the given plan. The conversation transcript is available at: ${transcriptPath}\nYou can read this file to analyze the conversation history if needed.
|
|
69
|
+
|
|
70
|
+
Use the available tools to inspect the codebase and verify the condition.
|
|
71
|
+
Use as few steps as possible - be efficient and direct.
|
|
72
|
+
|
|
73
|
+
When done, return your result using the ${SYNTHETIC_OUTPUT_TOOL_NAME} tool with:
|
|
74
|
+
- ok: true if the condition is met
|
|
75
75
|
- ok: false with reason if the condition is not met`,
|
|
76
76
|
]);
|
|
77
77
|
const model = hook.model ?? getSmallFastModel();
|
|
@@ -35,10 +35,10 @@ export async function execPromptHook(hook, hookName, hookEvent, jsonInput, signa
|
|
|
35
35
|
const response = await queryModelWithoutStreaming({
|
|
36
36
|
messages: messagesToQuery,
|
|
37
37
|
systemPrompt: asSystemPrompt([
|
|
38
|
-
`You are evaluating a hook in Context Code.
|
|
39
|
-
|
|
40
|
-
Your response must be a JSON object matching one of the following schemas:
|
|
41
|
-
1. If the condition is met, return: {"ok": true}
|
|
38
|
+
`You are evaluating a hook in Context Code.
|
|
39
|
+
|
|
40
|
+
Your response must be a JSON object matching one of the following schemas:
|
|
41
|
+
1. If the condition is met, return: {"ok": true}
|
|
42
42
|
2. If the condition is not met, return: {"ok": false, "reason": "Reason for why it is not met"}`,
|
|
43
43
|
]),
|
|
44
44
|
thinkingConfig: { type: 'disabled' },
|
|
@@ -69,27 +69,27 @@ function createSkillImprovementHook() {
|
|
|
69
69
|
lastAnalyzedIndex = context.messages.length;
|
|
70
70
|
return [
|
|
71
71
|
createUserMessage({
|
|
72
|
-
content: `You are analyzing a conversation where a user is executing a skill (a repeatable process).
|
|
73
|
-
Your job: identify if the user's recent messages contain preferences, requests, or corrections that should be permanently added to the skill definition for future runs.
|
|
74
|
-
|
|
75
|
-
<skill_definition>
|
|
76
|
-
${projectSkill.content}
|
|
77
|
-
</skill_definition>
|
|
78
|
-
|
|
79
|
-
<recent_messages>
|
|
80
|
-
${formatRecentMessages(newMessages)}
|
|
81
|
-
</recent_messages>
|
|
82
|
-
|
|
83
|
-
Look for:
|
|
84
|
-
- Requests to add, change, or remove steps: "can you also ask me X", "please do Y too", "don't do Z"
|
|
85
|
-
- Preferences about how steps should work: "ask me about energy levels", "note the time", "use a casual tone"
|
|
86
|
-
- Corrections: "no, do X instead", "always use Y", "make sure to..."
|
|
87
|
-
|
|
88
|
-
Ignore:
|
|
89
|
-
- Routine conversation that doesn't generalize (one-time answers, chitchat)
|
|
90
|
-
- Things the skill already does
|
|
91
|
-
|
|
92
|
-
Output a JSON array inside <updates> tags. Each item: {"section": "which step/section to modify or 'new step'", "change": "what to add/modify", "reason": "which user message prompted this"}.
|
|
72
|
+
content: `You are analyzing a conversation where a user is executing a skill (a repeatable process).
|
|
73
|
+
Your job: identify if the user's recent messages contain preferences, requests, or corrections that should be permanently added to the skill definition for future runs.
|
|
74
|
+
|
|
75
|
+
<skill_definition>
|
|
76
|
+
${projectSkill.content}
|
|
77
|
+
</skill_definition>
|
|
78
|
+
|
|
79
|
+
<recent_messages>
|
|
80
|
+
${formatRecentMessages(newMessages)}
|
|
81
|
+
</recent_messages>
|
|
82
|
+
|
|
83
|
+
Look for:
|
|
84
|
+
- Requests to add, change, or remove steps: "can you also ask me X", "please do Y too", "don't do Z"
|
|
85
|
+
- Preferences about how steps should work: "ask me about energy levels", "note the time", "use a casual tone"
|
|
86
|
+
- Corrections: "no, do X instead", "always use Y", "make sure to..."
|
|
87
|
+
|
|
88
|
+
Ignore:
|
|
89
|
+
- Routine conversation that doesn't generalize (one-time answers, chitchat)
|
|
90
|
+
- Things the skill already does
|
|
91
|
+
|
|
92
|
+
Output a JSON array inside <updates> tags. Each item: {"section": "which step/section to modify or 'new step'", "change": "what to add/modify", "reason": "which user message prompted this"}.
|
|
93
93
|
Output <updates>[]</updates> if no updates are needed.`,
|
|
94
94
|
}),
|
|
95
95
|
];
|
|
@@ -160,21 +160,21 @@ export async function applySkillImprovement(skillName, updates) {
|
|
|
160
160
|
const response = await queryModelWithoutStreaming({
|
|
161
161
|
messages: [
|
|
162
162
|
createUserMessage({
|
|
163
|
-
content: `You are editing a skill definition file. Apply the following improvements to the skill.
|
|
164
|
-
|
|
165
|
-
<current_skill_file>
|
|
166
|
-
${currentContent}
|
|
167
|
-
</current_skill_file>
|
|
168
|
-
|
|
169
|
-
<improvements>
|
|
170
|
-
${updateList}
|
|
171
|
-
</improvements>
|
|
172
|
-
|
|
173
|
-
Rules:
|
|
174
|
-
- Integrate the improvements naturally into the existing structure
|
|
175
|
-
- Preserve frontmatter (--- block) exactly as-is
|
|
176
|
-
- Preserve the overall format and style
|
|
177
|
-
- Do not remove existing content unless an improvement explicitly replaces it
|
|
163
|
+
content: `You are editing a skill definition file. Apply the following improvements to the skill.
|
|
164
|
+
|
|
165
|
+
<current_skill_file>
|
|
166
|
+
${currentContent}
|
|
167
|
+
</current_skill_file>
|
|
168
|
+
|
|
169
|
+
<improvements>
|
|
170
|
+
${updateList}
|
|
171
|
+
</improvements>
|
|
172
|
+
|
|
173
|
+
Rules:
|
|
174
|
+
- Integrate the improvements naturally into the existing structure
|
|
175
|
+
- Preserve frontmatter (--- block) exactly as-is
|
|
176
|
+
- Preserve the overall format and style
|
|
177
|
+
- Do not remove existing content unless an improvement explicitly replaces it
|
|
178
178
|
- Output the complete updated file inside <updated_file> tags`,
|
|
179
179
|
}),
|
|
180
180
|
],
|
|
@@ -40,15 +40,15 @@ export async function parseNaturalLanguageDateTime(input, format, signal) {
|
|
|
40
40
|
const formatDescription = format === 'date'
|
|
41
41
|
? 'YYYY-MM-DD (date only, no time)'
|
|
42
42
|
: `YYYY-MM-DDTHH:MM:SS${timezone} (full date-time with timezone)`;
|
|
43
|
-
const userPrompt = `Current context:
|
|
44
|
-
- Current date and time: ${currentDateTime} (UTC)
|
|
45
|
-
- Local timezone: ${timezone}
|
|
46
|
-
- Day of week: ${dayOfWeek}
|
|
47
|
-
|
|
48
|
-
User input: "${input}"
|
|
49
|
-
|
|
50
|
-
Output format: ${formatDescription}
|
|
51
|
-
|
|
43
|
+
const userPrompt = `Current context:
|
|
44
|
+
- Current date and time: ${currentDateTime} (UTC)
|
|
45
|
+
- Local timezone: ${timezone}
|
|
46
|
+
- Day of week: ${dayOfWeek}
|
|
47
|
+
|
|
48
|
+
User input: "${input}"
|
|
49
|
+
|
|
50
|
+
Output format: ${formatDescription}
|
|
51
|
+
|
|
52
52
|
Parse the user's input into ISO 8601 format. Return ONLY the formatted string, or "INVALID" if the input is incomplete or unparseable.`;
|
|
53
53
|
try {
|
|
54
54
|
const result = await queryHaiku({
|