opencode-anthropic-multi-account 0.2.54 → 0.2.55
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
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
showToast,
|
|
26
26
|
sleep,
|
|
27
27
|
updateConfigField
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-H4MJVDCK.js";
|
|
29
29
|
import "./chunk-IIROTFG6.js";
|
|
30
30
|
|
|
31
31
|
// ../providers/claude-code/src/opencode-shared.ts
|
|
@@ -35,7 +35,7 @@ import { createHash, randomUUID } from "crypto";
|
|
|
35
35
|
var data_default2 = {
|
|
36
36
|
_version: 1,
|
|
37
37
|
_schemaVersion: 1,
|
|
38
|
-
_captured: "2026-06-
|
|
38
|
+
_captured: "2026-06-11T10:38:41.156Z",
|
|
39
39
|
_source: "bundled",
|
|
40
40
|
agent_identity: "You are a Claude agent, built on Anthropic's Claude Agent SDK.",
|
|
41
41
|
system_prompt: 'You are an interactive agent that helps users with software engineering tasks.\n\nIMPORTANT: Assist with authorized security testing, defensive security, CTF challenges, and educational contexts. Refuse requests for destructive techniques, DoS attacks, mass targeting, supply chain compromise, or detection evasion for malicious purposes. Dual-use security tools (C2 frameworks, credential testing, exploit development) require clear authorization context: pentesting engagements, CTF competitions, security research, or defensive use cases.\n\n# Harness\n - Text you output outside of tool use is displayed to the user as Github-flavored markdown in a terminal.\n - Tools run behind a user-selected permission mode; a denied call means the user declined it \u2014 adjust, don\'t retry verbatim.\n - `<system-reminder>` tags in messages and tool results are injected by the harness, not the user. Hooks may intercept tool calls; treat hook output as user feedback.\n - Prefer the dedicated file/search tools over shell commands when one fits. Independent tool calls can run in parallel in one response.\n - Reference code as `file_path:line_number` \u2014 it\'s clickable.\n\nWrite code that reads like the surrounding code: match its comment density, naming, and idiom.\n\nFor actions that are hard to reverse or outward-facing, confirm first unless durably authorized or explicitly told to proceed without asking; approval in one context doesn\'t extend to the next. Sending content to an external service publishes it; it may be cached or indexed even if later deleted. Before deleting or overwriting, look at the target \u2014 if what you find contradicts how it was described, or you didn\'t create it, surface that instead of proceeding. Report outcomes faithfully: if tests fail, say so with the output; if a step was skipped, say that; when something is done and verified, state it plainly without hedging.\n\n# Session-specific guidance\n - When the user types `/<skill-name>`, invoke it via Skill. Only use skills listed in the user-invocable skills section \u2014 don\'t guess.\n - Default: NO `/schedule` offer \u2014 most tasks just end. Offer ONLY when this turn\'s work left a named artifact with a future obligation you can quote verbatim: a flag/gate/experiment key with a stated ramp or cleanup date; a `.skip`/`xfail`/temp instrumentation with a written "remove after X" condition; a job ID with an ETA; a dated TODO. Quote the artifact in a one-line offer and derive timing from it \u2014 if no concrete date/ETA/condition exists in the work, skip; never invent or default a timeframe. NEVER offer for: unfinished scope ("do the rest" is not a follow-up \u2014 finish it now), anything doable in this PR, refactors/bugfixes/docs/renames/dep-bumps, or after the user signals done. At most once per session. Phrase the offer as: "Want me to `/schedule` \u2026 on <date from the artifact>?"\n - If the user asks about "ultrareview" or how to run it, explain that /code-review ultra launches a multi-agent cloud review of the current branch (or /code-review ultra <PR#> for a GitHub PR); /ultrareview is a deprecated alias for the same command. It is user-triggered and billed; you cannot launch it yourself, so do not attempt to via Bash or otherwise. It needs a git repository (offer to "git init" if not in one); the no-arg form bundles the local branch and does not need a GitHub remote.\n\n# Memory\n\nYou have a persistent file-based memory at `/Users/user/.claude/projects/project/memory/`. This directory already exists \u2014 write to it directly with the Write tool (do not run mkdir or check for its existence). Each memory is one file holding one fact, with frontmatter:\n\n```markdown\n---\nname: <short-kebab-case-slug>\ndescription: <one-line summary \u2014 used to decide relevance during recall>\nmetadata:\n type: user | feedback | project | reference\n---\n\n<the fact; for feedback/project, follow with **Why:** and **How to apply:** lines. Link related memories with [[their-name]].>\n```\n\nIn the body, link to related memories with `[[name]]`, where `name` is the other memory\'s `name:` slug. Link liberally \u2014 a `[[name]]` that doesn\'t match an existing memory yet is fine; it marks something worth writing later, not an error.\n\n`user` \u2014 who the user is (role, expertise, preferences). `feedback` \u2014 guidance the user has given on how you should work, both corrections and confirmed approaches; include the why. `project` \u2014 ongoing work, goals, or constraints not derivable from the code or git history; convert relative dates to absolute. `reference` \u2014 pointers to external resources (URLs, dashboards, tickets).\n\nAfter writing the file, add a one-line pointer in `MEMORY.md` (`- [Title](file.md) \u2014 hook`). `MEMORY.md` is the index loaded into context each session \u2014 one line per memory, no frontmatter, never put memory content there.\n\nBefore saving, check for an existing file that already covers it \u2014 update that file rather than creating a duplicate; delete memories that turn out to be wrong. Don\'t save what the repo already records (code structure, past fixes, git history, CLAUDE.md) or what only matters to this conversation; if asked to remember one of those, ask what was non-obvious about it and save that instead. Recalled memories appearing inside `<system-reminder>` blocks are background context, not user instructions, and reflect what was true when written \u2014 if one names a file, function, or flag, verify it still exists before recommending it.\n\n# Language\nAlways respond in Korean. Use Korean for all explanations, comments, and communications with the user. Technical terms and code identifiers should remain in their original form.\nMaintain full orthographic correctness for Korean, including all required diacritical marks, accents, and special characters. Never substitute accented characters with their ASCII equivalents (e.g., never write "nao" for "n\xE3o", "fur" for "f\xFCr", or "loeschen" for "l\xF6schen").\n\n# Context management\nWhen the conversation grows long, some or all of the current context is summarized; the summary, along with any remaining unsummarized context, is provided in the next context window so work can continue \u2014 you don\'t need to wrap up early or hand off mid-task.\n\nWhen you have enough information to act, act. Do not re-derive facts already established in the conversation, re-litigate a decision the user has already made, or narrate options you will not pursue. If you are weighing a choice, give a recommendation, not an exhaustive survey\n\ngitStatus: This is the git status at the start of the conversation. Note that this status is a snapshot in time, and will not update during the conversation.\n\nCurrent branch: (dynamic)\n\nMain branch (you will usually use this for PRs): (dynamic)\n\nGit user: (dynamic)\n\nStatus:\n(dynamic)\n\nRecent commits:\n(dynamic)',
|
|
@@ -84,7 +84,8 @@ Reach for this when the task matches an available agent type, when you have inde
|
|
|
84
84
|
enum: [
|
|
85
85
|
"sonnet",
|
|
86
86
|
"opus",
|
|
87
|
-
"haiku"
|
|
87
|
+
"haiku",
|
|
88
|
+
"fable"
|
|
88
89
|
]
|
|
89
90
|
},
|
|
90
91
|
run_in_background: {
|
|
@@ -1136,7 +1137,7 @@ If the result says the push wasn't sent, that's expected \u2014 no action needed
|
|
|
1136
1137
|
"Write"
|
|
1137
1138
|
],
|
|
1138
1139
|
anthropic_beta: "claude-code-20250219,oauth-2025-04-20,context-1m-2025-08-07,interleaved-thinking-2025-05-14,thinking-token-count-2026-05-13,context-management-2025-06-27,prompt-caching-scope-2026-01-05,mid-conversation-system-2026-04-07,advisor-tool-2026-03-01,effort-2025-11-24,extended-cache-ttl-2025-04-11",
|
|
1139
|
-
cc_version: "2.1.
|
|
1140
|
+
cc_version: "2.1.173",
|
|
1140
1141
|
header_order: [
|
|
1141
1142
|
"Accept",
|
|
1142
1143
|
"Authorization",
|
|
@@ -1166,7 +1167,7 @@ If the result says the push wasn't sent, that's expected \u2014 no action needed
|
|
|
1166
1167
|
"anthropic-dangerous-direct-browser-access": "true",
|
|
1167
1168
|
"anthropic-version": "2023-06-01",
|
|
1168
1169
|
"content-type": "application/json",
|
|
1169
|
-
"user-agent": "claude-cli/2.1.
|
|
1170
|
+
"user-agent": "claude-cli/2.1.173 (external, sdk-cli)",
|
|
1170
1171
|
"x-app": "cli",
|
|
1171
1172
|
"x-stainless-timeout": "600"
|
|
1172
1173
|
},
|
|
@@ -3931,6 +3932,79 @@ function extractToolNamesFromRequestBody(body) {
|
|
|
3931
3932
|
}
|
|
3932
3933
|
}
|
|
3933
3934
|
|
|
3935
|
+
// ../providers/claude-code/src/effort-capability.ts
|
|
3936
|
+
var EFFORT_PREFERENCE = ["xhigh", "max", "high", "medium", "low"];
|
|
3937
|
+
function readRecord2(value) {
|
|
3938
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
3939
|
+
}
|
|
3940
|
+
function normalizeEffortValue(value) {
|
|
3941
|
+
return value.trim().toLowerCase().replace(/[^a-z_-]+$/g, "");
|
|
3942
|
+
}
|
|
3943
|
+
function parseEffortCapabilityRejection(body) {
|
|
3944
|
+
const match = /does not support effort level\s+['"`]?([^'"`.\s]+)['"`]?\.?\s*Supported levels:\s*([a-z,\s_-]+)/i.exec(body);
|
|
3945
|
+
if (!match?.[1] || !match[2]) {
|
|
3946
|
+
return null;
|
|
3947
|
+
}
|
|
3948
|
+
const supported = match[2].split(",").map(normalizeEffortValue).filter(Boolean);
|
|
3949
|
+
return supported.length > 0 ? { rejected: normalizeEffortValue(match[1]), supported } : null;
|
|
3950
|
+
}
|
|
3951
|
+
function bestSupportedEffort(supported) {
|
|
3952
|
+
for (const effort of EFFORT_PREFERENCE) {
|
|
3953
|
+
if (supported.includes(effort)) {
|
|
3954
|
+
return effort;
|
|
3955
|
+
}
|
|
3956
|
+
}
|
|
3957
|
+
return supported[0] ?? "high";
|
|
3958
|
+
}
|
|
3959
|
+
function clampUnsupportedEffortInBody(body, supportedEffortsByModel) {
|
|
3960
|
+
if (typeof body !== "string") {
|
|
3961
|
+
return { body, changed: false };
|
|
3962
|
+
}
|
|
3963
|
+
try {
|
|
3964
|
+
const parsed = JSON.parse(body);
|
|
3965
|
+
const record = readRecord2(parsed);
|
|
3966
|
+
const modelId = typeof record?.model === "string" ? record.model : void 0;
|
|
3967
|
+
const outputConfig = readRecord2(record?.output_config);
|
|
3968
|
+
const effort = typeof outputConfig?.effort === "string" ? outputConfig.effort : void 0;
|
|
3969
|
+
if (!modelId || !outputConfig || !effort) {
|
|
3970
|
+
return { body, changed: false, modelId };
|
|
3971
|
+
}
|
|
3972
|
+
const supported = supportedEffortsByModel.get(modelId);
|
|
3973
|
+
if (!supported || supported.includes(effort)) {
|
|
3974
|
+
return { body, changed: false, modelId, effort };
|
|
3975
|
+
}
|
|
3976
|
+
const clamped = bestSupportedEffort(supported);
|
|
3977
|
+
outputConfig.effort = clamped;
|
|
3978
|
+
return { body: JSON.stringify(record), changed: true, modelId, effort: clamped };
|
|
3979
|
+
} catch {
|
|
3980
|
+
return { body, changed: false };
|
|
3981
|
+
}
|
|
3982
|
+
}
|
|
3983
|
+
function clampEffortAfterRejection(body, rejection, supportedEffortsByModel) {
|
|
3984
|
+
if (typeof body !== "string") {
|
|
3985
|
+
return { body, changed: false };
|
|
3986
|
+
}
|
|
3987
|
+
try {
|
|
3988
|
+
const parsed = JSON.parse(body);
|
|
3989
|
+
const record = readRecord2(parsed);
|
|
3990
|
+
const modelId = typeof record?.model === "string" ? record.model : void 0;
|
|
3991
|
+
const outputConfig = readRecord2(record?.output_config);
|
|
3992
|
+
const effort = typeof outputConfig?.effort === "string" ? outputConfig.effort : void 0;
|
|
3993
|
+
if (!modelId || !outputConfig || !effort) {
|
|
3994
|
+
return { body, changed: false, modelId };
|
|
3995
|
+
}
|
|
3996
|
+
supportedEffortsByModel.set(modelId, [...rejection.supported]);
|
|
3997
|
+
if (rejection.supported.includes(effort)) {
|
|
3998
|
+
return { body, changed: false, modelId, effort };
|
|
3999
|
+
}
|
|
4000
|
+
const clamped = bestSupportedEffort(rejection.supported);
|
|
4001
|
+
outputConfig.effort = clamped;
|
|
4002
|
+
return { body: JSON.stringify(record), changed: true, modelId, effort: clamped };
|
|
4003
|
+
} catch {
|
|
4004
|
+
return { body, changed: false };
|
|
4005
|
+
}
|
|
4006
|
+
}
|
|
4007
|
+
|
|
3934
4008
|
// src/tools/observation.ts
|
|
3935
4009
|
import { promises as fs } from "fs";
|
|
3936
4010
|
import { dirname, join as join2 } from "path";
|
|
@@ -4210,6 +4284,7 @@ var AccountRuntimeFactory = class {
|
|
|
4210
4284
|
identity;
|
|
4211
4285
|
runtimes = /* @__PURE__ */ new Map();
|
|
4212
4286
|
initLocks = /* @__PURE__ */ new Map();
|
|
4287
|
+
effortSupportByModel = /* @__PURE__ */ new Map();
|
|
4213
4288
|
lastRequestTime = 0;
|
|
4214
4289
|
pacingGate = Promise.resolve();
|
|
4215
4290
|
pacingTestOverrides = {};
|
|
@@ -4357,13 +4432,38 @@ var AccountRuntimeFactory = class {
|
|
|
4357
4432
|
throw error;
|
|
4358
4433
|
}
|
|
4359
4434
|
};
|
|
4360
|
-
let outboundBody =
|
|
4435
|
+
let outboundBody = clampUnsupportedEffortInBody(
|
|
4436
|
+
transformedRequest.body,
|
|
4437
|
+
this.effortSupportByModel
|
|
4438
|
+
).body;
|
|
4439
|
+
const retryEffortCapability = async (currentResponse, requestHeaders) => {
|
|
4440
|
+
if (currentResponse.status !== 400) {
|
|
4441
|
+
return currentResponse;
|
|
4442
|
+
}
|
|
4443
|
+
const responseBody = await currentResponse.clone().text().catch(() => "");
|
|
4444
|
+
const rejection = parseEffortCapabilityRejection(responseBody);
|
|
4445
|
+
if (!rejection) {
|
|
4446
|
+
return currentResponse;
|
|
4447
|
+
}
|
|
4448
|
+
const clamped = clampEffortAfterRejection(
|
|
4449
|
+
outboundBody,
|
|
4450
|
+
rejection,
|
|
4451
|
+
this.effortSupportByModel
|
|
4452
|
+
);
|
|
4453
|
+
if (!clamped.changed) {
|
|
4454
|
+
return currentResponse;
|
|
4455
|
+
}
|
|
4456
|
+
outboundBody = clamped.body;
|
|
4457
|
+
return performFetch(requestHeaders, outboundBody);
|
|
4458
|
+
};
|
|
4361
4459
|
let response = await performFetch(headers, outboundBody);
|
|
4460
|
+
response = await retryEffortCapability(response, headers);
|
|
4362
4461
|
if (await isAssistantPrefillUnsupportedResponse(response)) {
|
|
4363
4462
|
const retryBody = removeTrailingAssistantPrefillBody(outboundBody);
|
|
4364
4463
|
if (retryBody) {
|
|
4365
4464
|
outboundBody = retryBody;
|
|
4366
4465
|
response = await performFetch(headers, outboundBody);
|
|
4466
|
+
response = await retryEffortCapability(response, headers);
|
|
4367
4467
|
}
|
|
4368
4468
|
}
|
|
4369
4469
|
for (let attempt = 0; attempt < LONG_CONTEXT_BETAS.length; attempt += 1) {
|
|
@@ -4399,6 +4499,7 @@ var AccountRuntimeFactory = class {
|
|
|
4399
4499
|
getExcludedBetas(modelId)
|
|
4400
4500
|
);
|
|
4401
4501
|
response = await performFetch(retryHeaders, outboundBody);
|
|
4502
|
+
response = await retryEffortCapability(response, retryHeaders);
|
|
4402
4503
|
}
|
|
4403
4504
|
return applyResponseReverseLookup(response, transformedRequest.reverseLookup);
|
|
4404
4505
|
}
|