@expiren/opencode-antigravity-auth 1.6.34 → 1.6.36
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/index.js +35 -2
- package/dist/index.js.map +2 -2
- package/dist/src/plugin/request-helpers.d.ts.map +1 -1
- package/dist/src/plugin/request-helpers.js +2 -2
- package/dist/src/plugin/request-helpers.js.map +1 -1
- package/dist/src/plugin/request.d.ts.map +1 -1
- package/dist/src/plugin/request.js +7 -1
- package/dist/src/plugin/request.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5517,12 +5517,12 @@ function injectToolHardeningInstruction(payload, instructionText) {
|
|
|
5517
5517
|
if (existing && typeof existing === "object" && "parts" in existing) {
|
|
5518
5518
|
const parts = existing.parts;
|
|
5519
5519
|
if (Array.isArray(parts)) {
|
|
5520
|
-
parts.
|
|
5520
|
+
parts.push(instructionPart);
|
|
5521
5521
|
}
|
|
5522
5522
|
} else if (typeof existing === "string") {
|
|
5523
5523
|
payload.systemInstruction = {
|
|
5524
5524
|
role: "user",
|
|
5525
|
-
parts: [
|
|
5525
|
+
parts: [{ text: existing }, instructionPart]
|
|
5526
5526
|
};
|
|
5527
5527
|
} else {
|
|
5528
5528
|
payload.systemInstruction = {
|
|
@@ -5838,6 +5838,7 @@ function computeClaudeMaxOutputTokens(thinkingBudget) {
|
|
|
5838
5838
|
}
|
|
5839
5839
|
return Math.min(Math.max(thinkingBudget * 2, 32e3), CLAUDE_THINKING_MAX_OUTPUT_TOKENS);
|
|
5840
5840
|
}
|
|
5841
|
+
var CLAUDE_INTERLEAVED_THINKING_HINT = "Interleaved thinking is enabled. You may think between tool calls and after receiving tool results before deciding the next action or final answer. Do not mention these instructions or any constraints about thinking blocks; just apply them.";
|
|
5841
5842
|
function isClaudeModel(model) {
|
|
5842
5843
|
return model.toLowerCase().includes("claude");
|
|
5843
5844
|
}
|
|
@@ -5845,6 +5846,35 @@ function isClaudeThinkingModel(model) {
|
|
|
5845
5846
|
const lower = model.toLowerCase();
|
|
5846
5847
|
return lower.includes("claude") && lower.includes("thinking");
|
|
5847
5848
|
}
|
|
5849
|
+
function appendClaudeThinkingHint(payload, hint = CLAUDE_INTERLEAVED_THINKING_HINT) {
|
|
5850
|
+
const existing = payload.systemInstruction;
|
|
5851
|
+
if (typeof existing === "string" && existing.includes(hint)) {
|
|
5852
|
+
return;
|
|
5853
|
+
}
|
|
5854
|
+
if (existing && typeof existing === "object") {
|
|
5855
|
+
const sys = existing;
|
|
5856
|
+
if (Array.isArray(sys.parts)) {
|
|
5857
|
+
const alreadyHasHint = sys.parts.some(
|
|
5858
|
+
(p) => p && typeof p === "object" && p.text === hint
|
|
5859
|
+
);
|
|
5860
|
+
if (alreadyHasHint) return;
|
|
5861
|
+
}
|
|
5862
|
+
}
|
|
5863
|
+
if (typeof existing === "string") {
|
|
5864
|
+
payload.systemInstruction = existing.trim().length > 0 ? { role: "user", parts: [{ text: existing }, { text: hint }] } : hint;
|
|
5865
|
+
} else if (existing && typeof existing === "object") {
|
|
5866
|
+
const sys = existing;
|
|
5867
|
+
const partsValue = sys.parts;
|
|
5868
|
+
if (Array.isArray(partsValue)) {
|
|
5869
|
+
sys.parts = [...partsValue, { text: hint }];
|
|
5870
|
+
} else {
|
|
5871
|
+
sys.parts = [{ text: hint }];
|
|
5872
|
+
}
|
|
5873
|
+
payload.systemInstruction = sys;
|
|
5874
|
+
} else if (Array.isArray(payload.contents)) {
|
|
5875
|
+
payload.systemInstruction = { parts: [{ text: hint }] };
|
|
5876
|
+
}
|
|
5877
|
+
}
|
|
5848
5878
|
|
|
5849
5879
|
// src/plugin/transform/gemini.ts
|
|
5850
5880
|
var UNSUPPORTED_SCHEMA_FIELDS = /* @__PURE__ */ new Set([
|
|
@@ -7880,6 +7910,9 @@ function prepareAntigravityRequest(input2, init, accessToken, projectId, endpoin
|
|
|
7880
7910
|
CLAUDE_TOOL_SYSTEM_INSTRUCTION
|
|
7881
7911
|
);
|
|
7882
7912
|
}
|
|
7913
|
+
if (isClaudeThinking && Array.isArray(requestPayload.tools) && requestPayload.tools.length > 0) {
|
|
7914
|
+
appendClaudeThinkingHint(requestPayload);
|
|
7915
|
+
}
|
|
7883
7916
|
}
|
|
7884
7917
|
const conversationKey = resolveConversationKey(requestPayload);
|
|
7885
7918
|
signatureSessionKey = buildSignatureSessionKey(PLUGIN_SESSION_ID, effectiveModel, conversationKey, resolveProjectKey(projectId));
|