@expiren/opencode-antigravity-auth 1.6.5 → 1.6.6
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 +19 -16
- package/dist/index.js.map +2 -2
- package/dist/src/plugin/request.d.ts.map +1 -1
- package/dist/src/plugin/request.js +2 -22
- package/dist/src/plugin/request.js.map +1 -1
- package/dist/src/plugin/transform/claude.d.ts.map +1 -1
- package/dist/src/plugin/transform/claude.js +5 -19
- package/dist/src/plugin/transform/claude.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5303,6 +5303,7 @@ function needsThinkingRecovery(state) {
|
|
|
5303
5303
|
|
|
5304
5304
|
// src/plugin/transform/claude.ts
|
|
5305
5305
|
var CLAUDE_THINKING_MAX_OUTPUT_TOKENS = 64e3;
|
|
5306
|
+
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.";
|
|
5306
5307
|
function isClaudeModel(model) {
|
|
5307
5308
|
return model.toLowerCase().includes("claude");
|
|
5308
5309
|
}
|
|
@@ -5310,6 +5311,23 @@ function isClaudeThinkingModel(model) {
|
|
|
5310
5311
|
const lower = model.toLowerCase();
|
|
5311
5312
|
return lower.includes("claude") && lower.includes("thinking");
|
|
5312
5313
|
}
|
|
5314
|
+
function appendClaudeThinkingHint(payload, hint = CLAUDE_INTERLEAVED_THINKING_HINT) {
|
|
5315
|
+
const existing = payload.systemInstruction;
|
|
5316
|
+
if (typeof existing === "string") {
|
|
5317
|
+
payload.systemInstruction = existing.trim().length > 0 ? { role: "user", parts: [{ text: existing }, { text: hint }] } : hint;
|
|
5318
|
+
} else if (existing && typeof existing === "object") {
|
|
5319
|
+
const sys = existing;
|
|
5320
|
+
const partsValue = sys.parts;
|
|
5321
|
+
if (Array.isArray(partsValue)) {
|
|
5322
|
+
sys.parts = [...partsValue, { text: hint }];
|
|
5323
|
+
} else {
|
|
5324
|
+
sys.parts = [{ text: hint }];
|
|
5325
|
+
}
|
|
5326
|
+
payload.systemInstruction = sys;
|
|
5327
|
+
} else if (Array.isArray(payload.contents)) {
|
|
5328
|
+
payload.systemInstruction = { parts: [{ text: hint }] };
|
|
5329
|
+
}
|
|
5330
|
+
}
|
|
5313
5331
|
|
|
5314
5332
|
// src/plugin/transform/gemini.ts
|
|
5315
5333
|
var UNSUPPORTED_SCHEMA_FIELDS = /* @__PURE__ */ new Set([
|
|
@@ -7223,22 +7241,7 @@ function prepareAntigravityRequest(input2, init, accessToken, projectId, endpoin
|
|
|
7223
7241
|
delete requestPayload.system_instruction;
|
|
7224
7242
|
}
|
|
7225
7243
|
if (isClaudeThinking && Array.isArray(requestPayload.tools) && requestPayload.tools.length > 0) {
|
|
7226
|
-
|
|
7227
|
-
const existing = requestPayload.systemInstruction;
|
|
7228
|
-
if (typeof existing === "string") {
|
|
7229
|
-
requestPayload.systemInstruction = { parts: [{ text: existing }, { text: hint }] };
|
|
7230
|
-
} else if (existing && typeof existing === "object") {
|
|
7231
|
-
const sys = existing;
|
|
7232
|
-
const partsValue = sys.parts;
|
|
7233
|
-
if (Array.isArray(partsValue)) {
|
|
7234
|
-
sys.parts = [...partsValue, { text: hint }];
|
|
7235
|
-
} else {
|
|
7236
|
-
sys.parts = [{ text: hint }];
|
|
7237
|
-
}
|
|
7238
|
-
requestPayload.systemInstruction = sys;
|
|
7239
|
-
} else if (Array.isArray(requestPayload.contents)) {
|
|
7240
|
-
requestPayload.systemInstruction = { parts: [{ text: hint }] };
|
|
7241
|
-
}
|
|
7244
|
+
appendClaudeThinkingHint(requestPayload);
|
|
7242
7245
|
}
|
|
7243
7246
|
const cachedContentFromExtra = typeof requestPayload.extra_body === "object" && requestPayload.extra_body ? requestPayload.extra_body.cached_content ?? requestPayload.extra_body.cachedContent : void 0;
|
|
7244
7247
|
const cachedContent = requestPayload.cached_content ?? requestPayload.cachedContent ?? cachedContentFromExtra;
|