opencode-anthropic-multi-account 0.2.104 → 0.2.106

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.
@@ -7,6 +7,7 @@ import { spawn } from "child_process";
7
7
  import { createServer } from "http";
8
8
  import { basename, dirname as dirname2, join as join2 } from "path";
9
9
  import {
10
+ chmodSync,
10
11
  existsSync as existsSync2,
11
12
  readFileSync,
12
13
  renameSync
@@ -21,7 +22,7 @@ import {
21
22
  var data_default = {
22
23
  _version: 2,
23
24
  _schemaVersion: 2,
24
- _captured: "2026-07-26T03:45:11.728Z",
25
+ _captured: "2026-08-01T00:28:43.762Z",
25
26
  _source: "bundled",
26
27
  agent_identity: "You are a Claude agent, built on Anthropic's Claude Agent SDK.",
27
28
  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\nWhen you use a pronoun for someone \u2014 the user or anyone else you mention \u2014 and their pronouns haven't been stated, use they/them. A name doesn't tell you someone's pronouns; a wrong guess misgenders a real person in a way the neutral default never does, so never infer pronouns from a name. This applies to all user-visible text, including visible thinking.\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\n# Memory\n\nYou have a persistent file-based memory at `/home/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# 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)",
@@ -1332,7 +1333,7 @@ When the user is actively at the terminal, your output already reaches them \u20
1332
1333
  },
1333
1334
  {
1334
1335
  name: "WebSearch",
1335
- description: 'Search the web. Returns result blocks with titles and URLs. US-only.\n\n- The current month is July 2026 \u2014 use this when searching for recent information.\n- `allowed_domains` / `blocked_domains` filter results.\n- After answering from results, end with a "Sources:" list of the URLs you used as markdown links.',
1336
+ description: 'Search the web. Returns result blocks with titles and URLs. US-only.\n\n- The current month is August 2026 \u2014 use this when searching for recent information.\n- `allowed_domains` / `blocked_domains` filter results.\n- After answering from results, end with a "Sources:" list of the URLs you used as markdown links.',
1336
1337
  input_schema: {
1337
1338
  $schema: "https://json-schema.org/draft/2020-12/schema",
1338
1339
  type: "object",
@@ -2297,6 +2298,18 @@ function getOsName() {
2297
2298
  return "Linux";
2298
2299
  }
2299
2300
 
2301
+ // ../providers/claude-code/src/capture-provenance.ts
2302
+ import { randomUUID as randomUUID2 } from "crypto";
2303
+ function createClaudeCodeCaptureNonce() {
2304
+ return `kyoli-capture-${randomUUID2()}`;
2305
+ }
2306
+ function isClaudeCodeCaptureRequest(request, nonce) {
2307
+ if (request.method !== "POST" || !request.url || !nonce) {
2308
+ return false;
2309
+ }
2310
+ return request.url.split("?", 1)[0] === `/${nonce}/v1/messages`;
2311
+ }
2312
+
2300
2313
  // ../providers/claude-code/src/fingerprint-capture.ts
2301
2314
  var CURRENT_SCHEMA_VERSION = 2;
2302
2315
  var LIVE_TTL_MS = 24 * 60 * 60 * 1e3;
@@ -2419,6 +2432,13 @@ function quarantineCorruptCache(cachePath) {
2419
2432
  }
2420
2433
  function readLiveCacheSync(sourceOverride = "cached") {
2421
2434
  const cachePath = getCachePath();
2435
+ if (process.platform !== "win32") {
2436
+ try {
2437
+ chmodSync(cachePath, 384);
2438
+ } catch {
2439
+ return null;
2440
+ }
2441
+ }
2422
2442
  try {
2423
2443
  const parsed = JSON.parse(readFileSync(cachePath, "utf8"));
2424
2444
  if (!isTemplateData(parsed)) {
@@ -2461,7 +2481,7 @@ async function atomicWriteJson(targetPath, payload) {
2461
2481
  );
2462
2482
  await mkdir2(dirname2(targetPath), { recursive: true });
2463
2483
  await writeFile2(tmpPath, `${JSON.stringify(payload, null, 2)}
2464
- `, "utf8");
2484
+ `, { encoding: "utf8", mode: 384 });
2465
2485
  await rename(tmpPath, targetPath);
2466
2486
  }
2467
2487
  async function writeLiveCache(template2) {
@@ -2664,8 +2684,14 @@ async function captureLiveTemplateAsync(timeoutMs = DEFAULT_CAPTURE_TIMEOUT_MS,
2664
2684
  return null;
2665
2685
  }
2666
2686
  let capturedRequest = null;
2687
+ const captureNonce = createClaudeCodeCaptureNonce();
2667
2688
  const responseBody = createSseResponseBody();
2668
2689
  const server = createServer(async (req, res) => {
2690
+ if (!isClaudeCodeCaptureRequest(req, captureNonce)) {
2691
+ res.writeHead(404, { "content-type": "application/json" });
2692
+ res.end('{"error":"not_found"}');
2693
+ return;
2694
+ }
2669
2695
  try {
2670
2696
  const bodyText = await captureRequestBody(req);
2671
2697
  const parsedBody = JSON.parse(bodyText);
@@ -2698,7 +2724,7 @@ async function captureLiveTemplateAsync(timeoutMs = DEFAULT_CAPTURE_TIMEOUT_MS,
2698
2724
  reject(new Error("capture server failed to bind"));
2699
2725
  });
2700
2726
  });
2701
- const baseUrl = `http://${LOOPBACK_HOST}:${address.port}`;
2727
+ const baseUrl = `http://${LOOPBACK_HOST}:${address.port}/${captureNonce}`;
2702
2728
  await runClaudeCapture({
2703
2729
  binaryPath,
2704
2730
  baseUrl,
@@ -2900,4 +2926,4 @@ export {
2900
2926
  setFingerprintCaptureTestOverridesForTest,
2901
2927
  resetFingerprintCaptureForTest
2902
2928
  };
2903
- //# sourceMappingURL=chunk-R4DIX7J7.js.map
2929
+ //# sourceMappingURL=chunk-3UZ74ORA.js.map