cc-claw 0.27.0 → 0.27.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/dist/cli.js +14 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -33,7 +33,7 @@ var VERSION;
|
|
|
33
33
|
var init_version = __esm({
|
|
34
34
|
"src/version.ts"() {
|
|
35
35
|
"use strict";
|
|
36
|
-
VERSION = true ? "0.27.
|
|
36
|
+
VERSION = true ? "0.27.1" : (() => {
|
|
37
37
|
try {
|
|
38
38
|
return JSON.parse(readFileSync(join(process.cwd(), "package.json"), "utf-8")).version ?? "unknown";
|
|
39
39
|
} catch {
|
|
@@ -6449,7 +6449,7 @@ function isSensitivePath(filePath) {
|
|
|
6449
6449
|
function createRestrictedBashTool(chatId, permMode, whitelist) {
|
|
6450
6450
|
const isYolo = permMode === "yolo";
|
|
6451
6451
|
return tool({
|
|
6452
|
-
description: isYolo ?
|
|
6452
|
+
description: isYolo ? `Run any shell command. Use this for ALL external CLI tools. No restrictions. Format: restrictedBash({command: 'gsearch "query" --type news'})` : "Run a whitelisted shell command. Use this for ANY external CLI tool \u2014 do NOT call CLIs as separate tools by name, always route them through restrictedBash. Format: restrictedBash({command: 'toolname args...'})",
|
|
6453
6453
|
inputSchema: z.object({
|
|
6454
6454
|
command: z.string().describe("The shell command to run")
|
|
6455
6455
|
}),
|
|
@@ -7140,7 +7140,7 @@ var init_api_common = __esm({
|
|
|
7140
7140
|
// Tool calling: provide tools and allow up to 5 steps
|
|
7141
7141
|
...hasTools ? {
|
|
7142
7142
|
tools: tools2,
|
|
7143
|
-
stopWhen: stepCountIs(
|
|
7143
|
+
stopWhen: stepCountIs(15),
|
|
7144
7144
|
onStepFinish: ({ toolCalls, toolResults }) => {
|
|
7145
7145
|
if (onToolAction && toolCalls.length > 0) {
|
|
7146
7146
|
for (const tc of toolCalls) {
|
|
@@ -9883,7 +9883,7 @@ function searchSkill(userMessage) {
|
|
|
9883
9883
|
}
|
|
9884
9884
|
);
|
|
9885
9885
|
}
|
|
9886
|
-
async function assembleBootstrapPrompt(userMessage, entityType = "main", profile = "interactive", chatId, permMode, responseStyle, agentMode, sideQuestContext, planningDirective, chatContext) {
|
|
9886
|
+
async function assembleBootstrapPrompt(userMessage, entityType = "main", profile = "interactive", chatId, permMode, responseStyle, agentMode, sideQuestContext, planningDirective, chatContext, backendType) {
|
|
9887
9887
|
const sections = [];
|
|
9888
9888
|
if (planningDirective) {
|
|
9889
9889
|
sections.push(planningDirective);
|
|
@@ -9895,6 +9895,15 @@ async function assembleBootstrapPrompt(userMessage, entityType = "main", profile
|
|
|
9895
9895
|
if (permMode && permMode !== "yolo") {
|
|
9896
9896
|
sections.push(buildPermissionNotice(permMode));
|
|
9897
9897
|
}
|
|
9898
|
+
if (backendType === "api" && profile !== "minimal") {
|
|
9899
|
+
sections.push(`[API Backend \u2014 Tool Usage]
|
|
9900
|
+
You are operating as a direct API model (not a CLI like Claude Code or Gemini CLI).
|
|
9901
|
+
External tools (gsearch, pwm, gws, gemcli, nlm, curl, python3, etc.) are accessed ONLY via the \`restrictedBash\` tool.
|
|
9902
|
+
NEVER call external CLIs as direct tools by name \u2014 they are not registered as native tools.
|
|
9903
|
+
Correct: restrictedBash({"command": "gsearch \\"query\\" --type news"})
|
|
9904
|
+
Incorrect: gsearch({"query": "..."}) \u2190 this will fail silently
|
|
9905
|
+
If a skill or instruction says to use a CLI tool, always route it through restrictedBash.`);
|
|
9906
|
+
}
|
|
9898
9907
|
if (responseStyle) {
|
|
9899
9908
|
if (responseStyle === "concise") {
|
|
9900
9909
|
sections.push("[Response Style]\nYou must be as concise and direct as possible. Avoid unnecessary verbosity, pleasantries, or long explanations.");
|
|
@@ -21514,7 +21523,7 @@ async function askAgentImpl(chatId, userMessage, opts) {
|
|
|
21514
21523
|
const { entityType, bootstrapProfile: profile } = optsEntityType && optsProfile ? { entityType: optsEntityType, bootstrapProfile: optsProfile } : resolveFromLegacyTier(bootstrapTier ?? "full");
|
|
21515
21524
|
const effectiveAgentMode = optsAgentMode ?? getAgentMode(settingsChat);
|
|
21516
21525
|
const sideQuestCtx = settingsSourceChatId ? { parentChatId: settingsSourceChatId, actualChatId: chatId } : void 0;
|
|
21517
|
-
const fullPrompt = await assembleBootstrapPrompt(userMessage, entityType, profile, settingsChat, mode, responseStyle, effectiveAgentMode, sideQuestCtx, planningDirective, opts?.chatContext);
|
|
21526
|
+
const fullPrompt = await assembleBootstrapPrompt(userMessage, entityType, profile, settingsChat, mode, responseStyle, effectiveAgentMode, sideQuestCtx, planningDirective, opts?.chatContext, adapter.type);
|
|
21518
21527
|
if (adapter.streamDirect) {
|
|
21519
21528
|
const resolvedModel2 = model2 ?? adapter.defaultModel;
|
|
21520
21529
|
const abortController = new AbortController();
|
package/package.json
CHANGED