clawmoney 0.15.71 → 0.16.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/relay/provider.js
CHANGED
|
@@ -85,9 +85,16 @@ const STATIC_CLAUDE_CODE_HEADERS = {
|
|
|
85
85
|
// matches claudeCodeSystemPrompts template #2 in sub2api's validator
|
|
86
86
|
// (hasClaudeCodeSystemPrompt → dice coefficient ≥ 0.5).
|
|
87
87
|
const CLAUDE_CODE_SYSTEM_PROMPT_LEAD = "You are a Claude agent, built on Anthropic's Claude Agent SDK.";
|
|
88
|
-
//
|
|
89
|
-
//
|
|
90
|
-
|
|
88
|
+
// Template-mode instructions ONLY — not used in passthrough mode.
|
|
89
|
+
// In passthrough, the buyer's Claude Code sends its own tool definitions
|
|
90
|
+
// and expects full agentic behavior; injecting "do not use tools" here
|
|
91
|
+
// would break WebSearch / Bash / Edit / all other tools, producing
|
|
92
|
+
// "current mode can't use tools" responses from the model.
|
|
93
|
+
const RELAY_INSTRUCTIONS_TEMPLATE = "You are operating in pure-LLM relay mode. Respond to the user's message with plain text only. Do not use tools. Do not ask clarifying questions. Be concise.";
|
|
94
|
+
// Passthrough-mode marker — just the CC identity lead, no tool-suppression.
|
|
95
|
+
// The buyer controls tool behavior via the body's `tools` array and
|
|
96
|
+
// their own system prompt.
|
|
97
|
+
const RELAY_INSTRUCTIONS_PASSTHROUGH = "";
|
|
91
98
|
// Short-name → fully qualified ID mapping required by the Claude OAuth API.
|
|
92
99
|
const MODEL_ID_OVERRIDES = {
|
|
93
100
|
"claude-sonnet-4-5": "claude-sonnet-4-5-20250929",
|
|
@@ -828,7 +835,7 @@ async function doCallClaudeApi(opts) {
|
|
|
828
835
|
},
|
|
829
836
|
{
|
|
830
837
|
type: "text",
|
|
831
|
-
text: `${CLAUDE_CODE_SYSTEM_PROMPT_LEAD}\n\n${
|
|
838
|
+
text: `${CLAUDE_CODE_SYSTEM_PROMPT_LEAD}\n\n${RELAY_INSTRUCTIONS_TEMPLATE}`,
|
|
832
839
|
// Mark the last system block for prompt caching. Real Claude Code
|
|
833
840
|
// *always* attaches cache_control: {type: "ephemeral"} to its system
|
|
834
841
|
// blocks — Anthropic uses the presence of this marker as part of its
|
|
@@ -1171,9 +1178,13 @@ function ensureClaudeCodeShell(body, fingerprint) {
|
|
|
1171
1178
|
// marker that unblocks the ordering validator.
|
|
1172
1179
|
if (!hasCcMarker) {
|
|
1173
1180
|
const buyerUsesExtendedCache = bodyHasExtendedCacheBlock(body);
|
|
1181
|
+
// Passthrough mode: inject ONLY the CC identity lead, no tool
|
|
1182
|
+
// suppression. The buyer's Claude Code drives tool use via its own
|
|
1183
|
+
// tools array + system prompt. Appending "Do not use tools" here
|
|
1184
|
+
// would break WebSearch / Bash / Edit / every other tool.
|
|
1174
1185
|
const markerBlock = {
|
|
1175
1186
|
type: "text",
|
|
1176
|
-
text:
|
|
1187
|
+
text: CLAUDE_CODE_SYSTEM_PROMPT_LEAD,
|
|
1177
1188
|
cache_control: buyerUsesExtendedCache
|
|
1178
1189
|
? { type: "ephemeral", ttl: "1h" }
|
|
1179
1190
|
: { type: "ephemeral" },
|