@opencow-ai/opencow-agent-sdk 0.4.16 → 0.4.17
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/capabilities/tools/BashTool/prompt.d.ts +1 -0
- package/dist/capabilities/tools/NotebookEditTool/NotebookEditTool.d.ts +0 -8
- package/dist/cli.mjs +1075 -2042
- package/dist/client.js +30 -402
- package/dist/constants/envVars.d.ts +0 -1
- package/dist/providers/shared/model/model.d.ts +0 -9
- package/dist/sdk.js +30 -402
- package/dist/session/sessionStorage.d.ts +0 -4
- package/dist/session/settings/types.d.ts +0 -5
- package/dist/state/AppStateStore.d.ts +0 -2
- package/dist/types/hooks.d.ts +0 -2
- package/dist/types/logs.d.ts +1 -26
- package/dist/types/toolRuntime.d.ts +0 -2
- package/package.json +1 -1
- package/dist/capabilities/generatedFiles.d.ts +0 -14
- package/dist/capabilities/tools/shared/teamMemorySync/index.d.ts +0 -121
- package/dist/capabilities/tools/shared/teamMemorySync/types.d.ts +0 -132
- package/dist/capabilities/tools/shared/teamMemorySync/watcher.d.ts +0 -78
- package/dist/lib/sequential.d.ts +0 -12
- package/dist/session/attribution.d.ts +0 -40
- package/dist/session/commitAttribution.d.ts +0 -193
- package/dist/session/sessionFileAccessHooks.d.ts +0 -11
package/dist/sdk.js
CHANGED
|
@@ -26189,7 +26189,6 @@ var init_envVars = __esm(() => {
|
|
|
26189
26189
|
MEMORY_EXTRA_GUIDELINES: envVar("OPENCOW_MEMORY_EXTRA_GUIDELINES", "CLAUDE_COWORK_MEMORY_EXTRA_GUIDELINES"),
|
|
26190
26190
|
MEMORY_PATH_OVERRIDE: envVar("OPENCOW_MEMORY_PATH_OVERRIDE", "CLAUDE_COWORK_MEMORY_PATH_OVERRIDE"),
|
|
26191
26191
|
DEBUG_INPUT: envVar("OPENCOW_DEBUG_INPUT"),
|
|
26192
|
-
DISABLE_CO_AUTHORED_BY: envVar("OPENCOW_DISABLE_CO_AUTHORED_BY"),
|
|
26193
26192
|
DISABLE_EARLY_INPUT: envVar("OPENCOW_DISABLE_EARLY_INPUT"),
|
|
26194
26193
|
ENABLE_EXTENDED_KEYS: envVar("OPENCOW_ENABLE_EXTENDED_KEYS"),
|
|
26195
26194
|
USE_READABLE_STDIN: envVar("OPENCOW_USE_READABLE_STDIN")
|
|
@@ -44651,8 +44650,6 @@ function hasPrefix(src, prefix, at, end) {
|
|
|
44651
44650
|
return end - at >= prefix.length && src.compare(prefix, 0, prefix.length, at, at + prefix.length) === 0;
|
|
44652
44651
|
}
|
|
44653
44652
|
function processStraddle(s, chunk, bytesRead) {
|
|
44654
|
-
s.straddleSnapCarryLen = 0;
|
|
44655
|
-
s.straddleSnapTailEnd = 0;
|
|
44656
44653
|
if (s.carryLen === 0)
|
|
44657
44654
|
return 0;
|
|
44658
44655
|
const cb = s.carryBuf;
|
|
@@ -44660,11 +44657,7 @@ function processStraddle(s, chunk, bytesRead) {
|
|
|
44660
44657
|
if (firstNl === -1 || firstNl >= bytesRead)
|
|
44661
44658
|
return 0;
|
|
44662
44659
|
const tailEnd = firstNl + 1;
|
|
44663
|
-
if (hasPrefix(cb, ATTR_SNAP_PREFIX, 0, s.carryLen)) {
|
|
44664
|
-
s.straddleSnapCarryLen = s.carryLen;
|
|
44665
|
-
s.straddleSnapTailEnd = tailEnd;
|
|
44666
|
-
s.lastSnapSrc = null;
|
|
44667
|
-
} else if (s.carryLen < ATTR_SNAP_PREFIX.length) {
|
|
44660
|
+
if (hasPrefix(cb, ATTR_SNAP_PREFIX, 0, s.carryLen)) {} else if (s.carryLen < ATTR_SNAP_PREFIX.length) {
|
|
44668
44661
|
return 0;
|
|
44669
44662
|
} else {
|
|
44670
44663
|
if (hasPrefix(cb, SYSTEM_PREFIX, 0, s.carryLen)) {
|
|
@@ -44675,7 +44668,6 @@ function processStraddle(s, chunk, bytesRead) {
|
|
|
44675
44668
|
s.out.len = 0;
|
|
44676
44669
|
s.boundaryStartOffset = s.bufFileOff;
|
|
44677
44670
|
s.hasPreservedSegment = false;
|
|
44678
|
-
s.lastSnapSrc = null;
|
|
44679
44671
|
}
|
|
44680
44672
|
}
|
|
44681
44673
|
sinkWrite(s.out, cb, 0, s.carryLen);
|
|
@@ -44689,8 +44681,6 @@ function scanChunkLines(s, buf, boundaryMarker) {
|
|
|
44689
44681
|
let boundaryAt = buf.indexOf(boundaryMarker);
|
|
44690
44682
|
let runStart = 0;
|
|
44691
44683
|
let lineStart = 0;
|
|
44692
|
-
let lastSnapStart = -1;
|
|
44693
|
-
let lastSnapEnd = -1;
|
|
44694
44684
|
let nl = buf.indexOf(LF2);
|
|
44695
44685
|
while (nl !== -1) {
|
|
44696
44686
|
const lineEnd = nl + 1;
|
|
@@ -44699,8 +44689,6 @@ function scanChunkLines(s, buf, boundaryMarker) {
|
|
|
44699
44689
|
}
|
|
44700
44690
|
if (hasPrefix(buf, ATTR_SNAP_PREFIX, lineStart, lineEnd)) {
|
|
44701
44691
|
sinkWrite(s.out, buf, runStart, lineStart);
|
|
44702
|
-
lastSnapStart = lineStart;
|
|
44703
|
-
lastSnapEnd = lineEnd;
|
|
44704
44692
|
runStart = lineEnd;
|
|
44705
44693
|
} else if (boundaryAt >= lineStart && boundaryAt < Math.min(lineStart + BOUNDARY_SEARCH_BOUND, lineEnd)) {
|
|
44706
44694
|
const hit = parseBoundaryLine(buf.toString("utf-8", lineStart, nl));
|
|
@@ -44710,9 +44698,6 @@ function scanChunkLines(s, buf, boundaryMarker) {
|
|
|
44710
44698
|
s.out.len = 0;
|
|
44711
44699
|
s.boundaryStartOffset = s.bufFileOff + lineStart;
|
|
44712
44700
|
s.hasPreservedSegment = false;
|
|
44713
|
-
s.lastSnapSrc = null;
|
|
44714
|
-
lastSnapStart = -1;
|
|
44715
|
-
s.straddleSnapCarryLen = 0;
|
|
44716
44701
|
runStart = lineStart;
|
|
44717
44702
|
}
|
|
44718
44703
|
boundaryAt = buf.indexOf(boundaryMarker, boundaryAt + boundaryMarker.length);
|
|
@@ -44721,25 +44706,7 @@ function scanChunkLines(s, buf, boundaryMarker) {
|
|
|
44721
44706
|
nl = buf.indexOf(LF2, lineStart);
|
|
44722
44707
|
}
|
|
44723
44708
|
sinkWrite(s.out, buf, runStart, lineStart);
|
|
44724
|
-
return {
|
|
44725
|
-
}
|
|
44726
|
-
function captureSnap(s, buf, chunk, lastSnapStart, lastSnapEnd) {
|
|
44727
|
-
if (lastSnapStart !== -1) {
|
|
44728
|
-
s.lastSnapLen = lastSnapEnd - lastSnapStart;
|
|
44729
|
-
if (s.lastSnapBuf === undefined || s.lastSnapLen > s.lastSnapBuf.length) {
|
|
44730
|
-
s.lastSnapBuf = Buffer.allocUnsafe(s.lastSnapLen);
|
|
44731
|
-
}
|
|
44732
|
-
buf.copy(s.lastSnapBuf, 0, lastSnapStart, lastSnapEnd);
|
|
44733
|
-
s.lastSnapSrc = s.lastSnapBuf;
|
|
44734
|
-
} else if (s.straddleSnapCarryLen > 0) {
|
|
44735
|
-
s.lastSnapLen = s.straddleSnapCarryLen + s.straddleSnapTailEnd;
|
|
44736
|
-
if (s.lastSnapBuf === undefined || s.lastSnapLen > s.lastSnapBuf.length) {
|
|
44737
|
-
s.lastSnapBuf = Buffer.allocUnsafe(s.lastSnapLen);
|
|
44738
|
-
}
|
|
44739
|
-
s.carryBuf.copy(s.lastSnapBuf, 0, 0, s.straddleSnapCarryLen);
|
|
44740
|
-
chunk.copy(s.lastSnapBuf, s.straddleSnapCarryLen, 0, s.straddleSnapTailEnd);
|
|
44741
|
-
s.lastSnapSrc = s.lastSnapBuf;
|
|
44742
|
-
}
|
|
44709
|
+
return { trailStart: lineStart };
|
|
44743
44710
|
}
|
|
44744
44711
|
function captureCarry(s, buf, trailStart) {
|
|
44745
44712
|
s.carryLen = buf.length - trailStart;
|
|
@@ -44753,19 +44720,10 @@ function captureCarry(s, buf, trailStart) {
|
|
|
44753
44720
|
function finalizeOutput(s) {
|
|
44754
44721
|
if (s.carryLen > 0) {
|
|
44755
44722
|
const cb = s.carryBuf;
|
|
44756
|
-
if (hasPrefix(cb, ATTR_SNAP_PREFIX, 0, s.carryLen)) {
|
|
44757
|
-
s.lastSnapSrc = cb;
|
|
44758
|
-
s.lastSnapLen = s.carryLen;
|
|
44759
|
-
} else {
|
|
44723
|
+
if (!hasPrefix(cb, ATTR_SNAP_PREFIX, 0, s.carryLen)) {
|
|
44760
44724
|
sinkWrite(s.out, cb, 0, s.carryLen);
|
|
44761
44725
|
}
|
|
44762
44726
|
}
|
|
44763
|
-
if (s.lastSnapSrc) {
|
|
44764
|
-
if (s.out.len > 0 && s.out.buf[s.out.len - 1] !== LF2) {
|
|
44765
|
-
sinkWrite(s.out, LF_BYTE, 0, 1);
|
|
44766
|
-
}
|
|
44767
|
-
sinkWrite(s.out, s.lastSnapSrc, 0, s.lastSnapLen);
|
|
44768
|
-
}
|
|
44769
44727
|
}
|
|
44770
44728
|
async function readTranscriptForLoad(filePath, fileSize) {
|
|
44771
44729
|
const boundaryMarker = compactBoundaryMarker();
|
|
@@ -44774,18 +44732,13 @@ async function readTranscriptForLoad(filePath, fileSize) {
|
|
|
44774
44732
|
out: {
|
|
44775
44733
|
buf: Buffer.allocUnsafe(Math.min(fileSize, 8 * 1024 * 1024)),
|
|
44776
44734
|
len: 0,
|
|
44777
|
-
cap: fileSize
|
|
44735
|
+
cap: fileSize
|
|
44778
44736
|
},
|
|
44779
44737
|
boundaryStartOffset: 0,
|
|
44780
44738
|
hasPreservedSegment: false,
|
|
44781
|
-
lastSnapSrc: null,
|
|
44782
|
-
lastSnapLen: 0,
|
|
44783
|
-
lastSnapBuf: undefined,
|
|
44784
44739
|
bufFileOff: 0,
|
|
44785
44740
|
carryLen: 0,
|
|
44786
|
-
carryBuf: undefined
|
|
44787
|
-
straddleSnapCarryLen: 0,
|
|
44788
|
-
straddleSnapTailEnd: 0
|
|
44741
|
+
carryBuf: undefined
|
|
44789
44742
|
};
|
|
44790
44743
|
const chunk = Buffer.allocUnsafe(CHUNK_SIZE);
|
|
44791
44744
|
const fd = await fsOpen(filePath, "r");
|
|
@@ -44807,7 +44760,6 @@ async function readTranscriptForLoad(filePath, fileSize) {
|
|
|
44807
44760
|
buf = chunk.subarray(chunkOff, bytesRead);
|
|
44808
44761
|
}
|
|
44809
44762
|
const r = scanChunkLines(s, buf, boundaryMarker);
|
|
44810
|
-
captureSnap(s, buf, chunk, r.lastSnapStart, r.lastSnapEnd);
|
|
44811
44763
|
captureCarry(s, buf, r.trailStart);
|
|
44812
44764
|
s.bufFileOff += r.trailStart;
|
|
44813
44765
|
}
|
|
@@ -44821,7 +44773,7 @@ async function readTranscriptForLoad(filePath, fileSize) {
|
|
|
44821
44773
|
hasPreservedSegment: s.hasPreservedSegment
|
|
44822
44774
|
};
|
|
44823
44775
|
}
|
|
44824
|
-
var LITE_READ_BUF_SIZE = 65536, MAX_SANITIZED_LENGTH = 200, TRANSCRIPT_READ_CHUNK_SIZE, SKIP_PRECOMPACT_THRESHOLD, _compactBoundaryMarker, ATTR_SNAP_PREFIX, SYSTEM_PREFIX, LF2 = 10,
|
|
44776
|
+
var LITE_READ_BUF_SIZE = 65536, MAX_SANITIZED_LENGTH = 200, TRANSCRIPT_READ_CHUNK_SIZE, SKIP_PRECOMPACT_THRESHOLD, _compactBoundaryMarker, ATTR_SNAP_PREFIX, SYSTEM_PREFIX, LF2 = 10, BOUNDARY_SEARCH_BOUND = 256;
|
|
44825
44777
|
var init_sessionStoragePortable = __esm(() => {
|
|
44826
44778
|
init_state2();
|
|
44827
44779
|
init_getWorktreePathsPortable();
|
|
@@ -44829,7 +44781,6 @@ var init_sessionStoragePortable = __esm(() => {
|
|
|
44829
44781
|
SKIP_PRECOMPACT_THRESHOLD = 5 * 1024 * 1024;
|
|
44830
44782
|
ATTR_SNAP_PREFIX = Buffer.from('{"type":"attribution-snapshot"');
|
|
44831
44783
|
SYSTEM_PREFIX = Buffer.from('{"type":"system"');
|
|
44832
|
-
LF_BYTE = Buffer.from([LF2]);
|
|
44833
44784
|
});
|
|
44834
44785
|
|
|
44835
44786
|
// src/lib/path.ts
|
|
@@ -46062,21 +46013,6 @@ async function readWorktreeHeadSha(worktreePath) {
|
|
|
46062
46013
|
}
|
|
46063
46014
|
return head.sha;
|
|
46064
46015
|
}
|
|
46065
|
-
async function getRemoteUrlForDir(cwd) {
|
|
46066
|
-
const gitDir = await resolveGitDir(cwd);
|
|
46067
|
-
if (!gitDir) {
|
|
46068
|
-
return null;
|
|
46069
|
-
}
|
|
46070
|
-
const url2 = await parseGitConfigValue(gitDir, "remote", "origin", "url");
|
|
46071
|
-
if (url2) {
|
|
46072
|
-
return url2;
|
|
46073
|
-
}
|
|
46074
|
-
const commonDir = await getCommonDir(gitDir);
|
|
46075
|
-
if (commonDir && commonDir !== gitDir) {
|
|
46076
|
-
return parseGitConfigValue(commonDir, "remote", "origin", "url");
|
|
46077
|
-
}
|
|
46078
|
-
return null;
|
|
46079
|
-
}
|
|
46080
46016
|
var resolveGitDirCache, WATCH_INTERVAL_MS = 1000, gitWatcher;
|
|
46081
46017
|
var init_gitFilesystem = __esm(() => {
|
|
46082
46018
|
init_state();
|
|
@@ -63886,11 +63822,6 @@ var init_types5 = __esm(() => {
|
|
|
63886
63822
|
respectGitignore: exports_external2.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). " + "Note: .ignore files are always respected."),
|
|
63887
63823
|
cleanupPeriodDays: exports_external2.number().nonnegative().int().optional().describe("Number of days to retain chat transcripts (default: 30). Setting to 0 disables session persistence entirely: no transcripts are written and existing transcripts are deleted at startup."),
|
|
63888
63824
|
env: EnvironmentVariablesSchema().optional().describe("Environment variables to set for Claude Code sessions"),
|
|
63889
|
-
attribution: exports_external2.object({
|
|
63890
|
-
commit: exports_external2.string().optional().describe("Attribution text for git commits, including any trailers. " + "Empty string hides attribution."),
|
|
63891
|
-
pr: exports_external2.string().optional().describe("Attribution text for pull request descriptions. " + "Empty string hides attribution.")
|
|
63892
|
-
}).optional().describe("Customize attribution text for commits and PRs. " + "Each field defaults to the standard Claude Code attribution if not set."),
|
|
63893
|
-
includeCoAuthoredBy: exports_external2.boolean().optional().describe("Deprecated: Use attribution instead. " + "Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),
|
|
63894
63825
|
includeGitInstructions: exports_external2.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),
|
|
63895
63826
|
permissions: PermissionsSchema().optional().describe("Tool usage permissions configuration"),
|
|
63896
63827
|
model: exports_external2.string().optional().describe("Override the default model used by Claude Code"),
|
|
@@ -64093,7 +64024,7 @@ var init_validationTips = __esm(() => {
|
|
|
64093
64024
|
{
|
|
64094
64025
|
matches: (ctx) => ctx.code === "invalid_type" && ctx.expected === "boolean",
|
|
64095
64026
|
tip: {
|
|
64096
|
-
suggestion: 'Use true or false without quotes. Example: "
|
|
64027
|
+
suggestion: 'Use true or false without quotes. Example: "includeGitInstructions": true'
|
|
64097
64028
|
}
|
|
64098
64029
|
},
|
|
64099
64030
|
{
|
|
@@ -69436,13 +69367,6 @@ function renderModelName(model) {
|
|
|
69436
69367
|
}
|
|
69437
69368
|
return model;
|
|
69438
69369
|
}
|
|
69439
|
-
function getPublicModelName(model) {
|
|
69440
|
-
const publicName = getPublicModelDisplayName(model);
|
|
69441
|
-
if (publicName) {
|
|
69442
|
-
return `Claude ${publicName}`;
|
|
69443
|
-
}
|
|
69444
|
-
return `Claude (${model})`;
|
|
69445
|
-
}
|
|
69446
69370
|
function parseUserSpecifiedModel(modelInput) {
|
|
69447
69371
|
const modelInputTrimmed = modelInput.trim();
|
|
69448
69372
|
const normalizedModel = modelInputTrimmed.toLowerCase();
|
|
@@ -108847,7 +108771,6 @@ __export(exports_sessionStorage, {
|
|
|
108847
108771
|
recordContextCollapseSnapshot: () => recordContextCollapseSnapshot,
|
|
108848
108772
|
recordContextCollapseCommit: () => recordContextCollapseCommit,
|
|
108849
108773
|
recordContentReplacement: () => recordContentReplacement,
|
|
108850
|
-
recordAttributionSnapshot: () => recordAttributionSnapshot,
|
|
108851
108774
|
readRemoteAgentMetadata: () => readRemoteAgentMetadata,
|
|
108852
108775
|
readAgentMetadata: () => readAgentMetadata,
|
|
108853
108776
|
reAppendSessionMetadata: () => reAppendSessionMetadata,
|
|
@@ -109509,11 +109432,6 @@ class Project {
|
|
|
109509
109432
|
await this.appendEntry(queueOp);
|
|
109510
109433
|
});
|
|
109511
109434
|
}
|
|
109512
|
-
async insertAttributionSnapshot(snapshot) {
|
|
109513
|
-
return this.trackWrite(async () => {
|
|
109514
|
-
await this.appendEntry(snapshot);
|
|
109515
|
-
});
|
|
109516
|
-
}
|
|
109517
109435
|
async insertContentReplacement(replacements2, agentId) {
|
|
109518
109436
|
return this.trackWrite(async () => {
|
|
109519
109437
|
const entry = {
|
|
@@ -109569,8 +109487,6 @@ class Project {
|
|
|
109569
109487
|
this.enqueueWrite(sessionFile, entry);
|
|
109570
109488
|
} else if (entry.type === "file-history-snapshot") {
|
|
109571
109489
|
this.enqueueWrite(sessionFile, entry);
|
|
109572
|
-
} else if (entry.type === "attribution-snapshot") {
|
|
109573
|
-
this.enqueueWrite(sessionFile, entry);
|
|
109574
109490
|
} else if (entry.type === "speculation-accept") {
|
|
109575
109491
|
this.enqueueWrite(sessionFile, entry);
|
|
109576
109492
|
} else if (entry.type === "mode") {
|
|
@@ -109713,9 +109629,6 @@ async function removeTranscriptMessage(targetUuid) {
|
|
|
109713
109629
|
async function recordFileHistorySnapshot(messageId, snapshot, isSnapshotUpdate) {
|
|
109714
109630
|
await getProject().insertFileHistorySnapshot(messageId, snapshot, isSnapshotUpdate);
|
|
109715
109631
|
}
|
|
109716
|
-
async function recordAttributionSnapshot(snapshot) {
|
|
109717
|
-
await getProject().insertAttributionSnapshot(snapshot);
|
|
109718
|
-
}
|
|
109719
109632
|
async function recordContentReplacement(replacements2, agentId) {
|
|
109720
109633
|
await getProject().insertContentReplacement(replacements2, agentId);
|
|
109721
109634
|
}
|
|
@@ -110391,9 +110304,6 @@ function buildFileHistorySnapshotChain(fileHistorySnapshots, conversation) {
|
|
|
110391
110304
|
}
|
|
110392
110305
|
return snapshots;
|
|
110393
110306
|
}
|
|
110394
|
-
function buildAttributionSnapshotChain(attributionSnapshots, _conversation) {
|
|
110395
|
-
return Array.from(attributionSnapshots.values());
|
|
110396
|
-
}
|
|
110397
110307
|
async function loadTranscriptFromFile(filePath) {
|
|
110398
110308
|
if (filePath.endsWith(".jsonl")) {
|
|
110399
110309
|
const {
|
|
@@ -110402,7 +110312,6 @@ async function loadTranscriptFromFile(filePath) {
|
|
|
110402
110312
|
customTitles,
|
|
110403
110313
|
tags,
|
|
110404
110314
|
fileHistorySnapshots,
|
|
110405
|
-
attributionSnapshots,
|
|
110406
110315
|
contextCollapseCommits,
|
|
110407
110316
|
contextCollapseSnapshot,
|
|
110408
110317
|
leafUuids,
|
|
@@ -110422,7 +110331,7 @@ async function loadTranscriptFromFile(filePath) {
|
|
|
110422
110331
|
const tag = tags.get(leafMessage.sessionId);
|
|
110423
110332
|
const sessionId = leafMessage.sessionId;
|
|
110424
110333
|
return {
|
|
110425
|
-
...convertToLogOption(transcript, 0, summary, customTitle, buildFileHistorySnapshotChain(fileHistorySnapshots, transcript), tag, filePath,
|
|
110334
|
+
...convertToLogOption(transcript, 0, summary, customTitle, buildFileHistorySnapshotChain(fileHistorySnapshots, transcript), tag, filePath, undefined, contentReplacements.get(sessionId) ?? []),
|
|
110426
110335
|
contextCollapseCommits: contextCollapseCommits.filter((e) => e.sessionId === sessionId),
|
|
110427
110336
|
contextCollapseSnapshot: contextCollapseSnapshot?.sessionId === sessionId ? contextCollapseSnapshot : undefined,
|
|
110428
110337
|
worktreeSession: worktreeStates.has(sessionId) ? worktreeStates.get(sessionId) : undefined
|
|
@@ -110494,7 +110403,7 @@ function countVisibleMessages(transcript) {
|
|
|
110494
110403
|
}
|
|
110495
110404
|
return count3;
|
|
110496
110405
|
}
|
|
110497
|
-
function convertToLogOption(transcript, value = 0, summary, customTitle, fileHistorySnapshots, tag, fullPath,
|
|
110406
|
+
function convertToLogOption(transcript, value = 0, summary, customTitle, fileHistorySnapshots, tag, fullPath, agentSetting, contentReplacements) {
|
|
110498
110407
|
const lastMessage = transcript.at(-1);
|
|
110499
110408
|
const firstMessage = transcript[0];
|
|
110500
110409
|
const firstPrompt = extractFirstPrompt(transcript);
|
|
@@ -110518,7 +110427,6 @@ function convertToLogOption(transcript, value = 0, summary, customTitle, fileHis
|
|
|
110518
110427
|
customTitle,
|
|
110519
110428
|
tag,
|
|
110520
110429
|
fileHistorySnapshots,
|
|
110521
|
-
attributionSnapshots,
|
|
110522
110430
|
contentReplacements,
|
|
110523
110431
|
gitBranch: lastMessage.gitBranch,
|
|
110524
110432
|
projectPath: firstMessage.cwd
|
|
@@ -110781,7 +110689,6 @@ async function loadFullLog(log) {
|
|
|
110781
110689
|
modes,
|
|
110782
110690
|
worktreeStates,
|
|
110783
110691
|
fileHistorySnapshots,
|
|
110784
|
-
attributionSnapshots,
|
|
110785
110692
|
contentReplacements,
|
|
110786
110693
|
contextCollapseCommits,
|
|
110787
110694
|
contextCollapseSnapshot,
|
|
@@ -110817,7 +110724,6 @@ async function loadFullLog(log) {
|
|
|
110817
110724
|
teamName: transcript[0]?.teamName ?? log.teamName,
|
|
110818
110725
|
leafUuid: mostRecentLeaf?.uuid ?? log.leafUuid,
|
|
110819
110726
|
fileHistorySnapshots: buildFileHistorySnapshotChain(fileHistorySnapshots, transcript),
|
|
110820
|
-
attributionSnapshots: buildAttributionSnapshotChain(attributionSnapshots, transcript),
|
|
110821
110727
|
contentReplacements: sessionId ? contentReplacements.get(sessionId) ?? [] : log.contentReplacements,
|
|
110822
110728
|
contextCollapseCommits: sessionId ? contextCollapseCommits.filter((e) => e.sessionId === sessionId) : undefined,
|
|
110823
110729
|
contextCollapseSnapshot: sessionId && contextCollapseSnapshot?.sessionId === sessionId ? contextCollapseSnapshot : undefined
|
|
@@ -111070,7 +110976,6 @@ async function loadTranscriptFile(filePath, opts) {
|
|
|
111070
110976
|
const modes = new Map;
|
|
111071
110977
|
const worktreeStates = new Map;
|
|
111072
110978
|
const fileHistorySnapshots = new Map;
|
|
111073
|
-
const attributionSnapshots = new Map;
|
|
111074
110979
|
const contentReplacements = new Map;
|
|
111075
110980
|
const agentContentReplacements = new Map;
|
|
111076
110981
|
const contextCollapseCommits = [];
|
|
@@ -111157,8 +111062,6 @@ async function loadTranscriptFile(filePath, opts) {
|
|
|
111157
111062
|
prRepositories.set(entry.sessionId, entry.prRepository);
|
|
111158
111063
|
} else if (entry.type === "file-history-snapshot") {
|
|
111159
111064
|
fileHistorySnapshots.set(entry.messageId, entry);
|
|
111160
|
-
} else if (entry.type === "attribution-snapshot") {
|
|
111161
|
-
attributionSnapshots.set(entry.messageId, entry);
|
|
111162
111065
|
} else if (entry.type === "content-replacement") {
|
|
111163
111066
|
if (entry.agentId) {
|
|
111164
111067
|
const existing = agentContentReplacements.get(entry.agentId) ?? [];
|
|
@@ -111248,7 +111151,6 @@ async function loadTranscriptFile(filePath, opts) {
|
|
|
111248
111151
|
modes,
|
|
111249
111152
|
worktreeStates,
|
|
111250
111153
|
fileHistorySnapshots,
|
|
111251
|
-
attributionSnapshots,
|
|
111252
111154
|
contentReplacements,
|
|
111253
111155
|
agentContentReplacements,
|
|
111254
111156
|
contextCollapseCommits,
|
|
@@ -111276,7 +111178,6 @@ async function getLastSessionLog(sessionId) {
|
|
|
111276
111178
|
agentSettings,
|
|
111277
111179
|
worktreeStates,
|
|
111278
111180
|
fileHistorySnapshots,
|
|
111279
|
-
attributionSnapshots,
|
|
111280
111181
|
contentReplacements,
|
|
111281
111182
|
contextCollapseCommits,
|
|
111282
111183
|
contextCollapseSnapshot
|
|
@@ -111295,7 +111196,7 @@ async function getLastSessionLog(sessionId) {
|
|
|
111295
111196
|
const tag = tags.get(lastMessage.sessionId);
|
|
111296
111197
|
const agentSetting = agentSettings.get(sessionId);
|
|
111297
111198
|
return {
|
|
111298
|
-
...convertToLogOption(transcript, 0, summary, customTitle, buildFileHistorySnapshotChain(fileHistorySnapshots, transcript), tag, getTranscriptPathForSession(sessionId),
|
|
111199
|
+
...convertToLogOption(transcript, 0, summary, customTitle, buildFileHistorySnapshotChain(fileHistorySnapshots, transcript), tag, getTranscriptPathForSession(sessionId), agentSetting, contentReplacements.get(sessionId) ?? []),
|
|
111299
111200
|
worktreeSession: worktreeStates.get(sessionId),
|
|
111300
111201
|
contextCollapseCommits: contextCollapseCommits.filter((e) => e.sessionId === sessionId),
|
|
111301
111202
|
contextCollapseSnapshot: contextCollapseSnapshot?.sessionId === sessionId ? contextCollapseSnapshot : undefined
|
|
@@ -111639,7 +111540,6 @@ async function loadAllLogsFromSessionFile(sessionFile, projectPathOverride) {
|
|
|
111639
111540
|
prRepositories,
|
|
111640
111541
|
modes,
|
|
111641
111542
|
fileHistorySnapshots,
|
|
111642
|
-
attributionSnapshots,
|
|
111643
111543
|
contentReplacements,
|
|
111644
111544
|
leafUuids
|
|
111645
111545
|
} = await loadTranscriptFile(sessionFile, { keepAllLeaves: true });
|
|
@@ -111696,7 +111596,6 @@ async function loadAllLogsFromSessionFile(sessionFile, projectPathOverride) {
|
|
|
111696
111596
|
gitBranch: leafMessage.gitBranch,
|
|
111697
111597
|
projectPath: projectPathOverride ?? firstMessage.cwd,
|
|
111698
111598
|
fileHistorySnapshots: buildFileHistorySnapshotChain(fileHistorySnapshots, chain),
|
|
111699
|
-
attributionSnapshots: buildAttributionSnapshotChain(attributionSnapshots, chain),
|
|
111700
111599
|
contentReplacements: contentReplacements.get(sessionId) ?? []
|
|
111701
111600
|
});
|
|
111702
111601
|
}
|
|
@@ -233510,173 +233409,6 @@ var init_promptSuggestion = __esm(() => {
|
|
|
233510
233409
|
};
|
|
233511
233410
|
});
|
|
233512
233411
|
|
|
233513
|
-
// src/capabilities/generatedFiles.ts
|
|
233514
|
-
var EXCLUDED_FILENAMES, EXCLUDED_EXTENSIONS;
|
|
233515
|
-
var init_generatedFiles = __esm(() => {
|
|
233516
|
-
EXCLUDED_FILENAMES = new Set([
|
|
233517
|
-
"package-lock.json",
|
|
233518
|
-
"yarn.lock",
|
|
233519
|
-
"pnpm-lock.yaml",
|
|
233520
|
-
"bun.lockb",
|
|
233521
|
-
"bun.lock",
|
|
233522
|
-
"composer.lock",
|
|
233523
|
-
"gemfile.lock",
|
|
233524
|
-
"cargo.lock",
|
|
233525
|
-
"poetry.lock",
|
|
233526
|
-
"pipfile.lock",
|
|
233527
|
-
"shrinkwrap.json",
|
|
233528
|
-
"npm-shrinkwrap.json"
|
|
233529
|
-
]);
|
|
233530
|
-
EXCLUDED_EXTENSIONS = new Set([
|
|
233531
|
-
".lock",
|
|
233532
|
-
".min.js",
|
|
233533
|
-
".min.css",
|
|
233534
|
-
".min.html",
|
|
233535
|
-
".bundle.js",
|
|
233536
|
-
".bundle.css",
|
|
233537
|
-
".generated.ts",
|
|
233538
|
-
".generated.js",
|
|
233539
|
-
".d.ts"
|
|
233540
|
-
]);
|
|
233541
|
-
});
|
|
233542
|
-
|
|
233543
|
-
// src/lib/sequential.ts
|
|
233544
|
-
function sequential(fn) {
|
|
233545
|
-
const queue2 = [];
|
|
233546
|
-
let processing = false;
|
|
233547
|
-
async function processQueue() {
|
|
233548
|
-
if (processing)
|
|
233549
|
-
return;
|
|
233550
|
-
if (queue2.length === 0)
|
|
233551
|
-
return;
|
|
233552
|
-
processing = true;
|
|
233553
|
-
while (queue2.length > 0) {
|
|
233554
|
-
const { args, resolve: resolve15, reject: reject2, context: context3 } = queue2.shift();
|
|
233555
|
-
try {
|
|
233556
|
-
const result = await fn.apply(context3, args);
|
|
233557
|
-
resolve15(result);
|
|
233558
|
-
} catch (error41) {
|
|
233559
|
-
reject2(error41);
|
|
233560
|
-
}
|
|
233561
|
-
}
|
|
233562
|
-
processing = false;
|
|
233563
|
-
if (queue2.length > 0) {
|
|
233564
|
-
processQueue();
|
|
233565
|
-
}
|
|
233566
|
-
}
|
|
233567
|
-
return function(...args) {
|
|
233568
|
-
return new Promise((resolve15, reject2) => {
|
|
233569
|
-
queue2.push({ args, resolve: resolve15, reject: reject2, context: this });
|
|
233570
|
-
processQueue();
|
|
233571
|
-
});
|
|
233572
|
-
};
|
|
233573
|
-
}
|
|
233574
|
-
|
|
233575
|
-
// src/session/commitAttribution.ts
|
|
233576
|
-
function getAttributionRepoRoot() {
|
|
233577
|
-
const cwd = getCwd3();
|
|
233578
|
-
return findGitRoot(cwd) ?? getOriginalCwd();
|
|
233579
|
-
}
|
|
233580
|
-
function getRepoClassCached() {
|
|
233581
|
-
return repoClassCache.get(getAttributionRepoRoot()) ?? null;
|
|
233582
|
-
}
|
|
233583
|
-
function isInternalModelRepoCached() {
|
|
233584
|
-
return getRepoClassCached() === "internal";
|
|
233585
|
-
}
|
|
233586
|
-
function getClientSurface() {
|
|
233587
|
-
return resolveEnvVar("ENTRYPOINT") ?? "cli";
|
|
233588
|
-
}
|
|
233589
|
-
function createEmptyAttributionState() {
|
|
233590
|
-
return {
|
|
233591
|
-
fileStates: new Map,
|
|
233592
|
-
sessionBaselines: new Map,
|
|
233593
|
-
surface: getClientSurface(),
|
|
233594
|
-
startingHeadSha: null,
|
|
233595
|
-
promptCount: 0,
|
|
233596
|
-
promptCountAtLastCommit: 0,
|
|
233597
|
-
permissionPromptCount: 0,
|
|
233598
|
-
permissionPromptCountAtLastCommit: 0,
|
|
233599
|
-
escapeCount: 0,
|
|
233600
|
-
escapeCountAtLastCommit: 0
|
|
233601
|
-
};
|
|
233602
|
-
}
|
|
233603
|
-
var INTERNAL_MODEL_REPOS, repoClassCache, isInternalModelRepo;
|
|
233604
|
-
var init_commitAttribution = __esm(() => {
|
|
233605
|
-
init_state();
|
|
233606
|
-
init_cwd2();
|
|
233607
|
-
init_debug();
|
|
233608
|
-
init_execFileNoThrow();
|
|
233609
|
-
init_fsOperations();
|
|
233610
|
-
init_generatedFiles();
|
|
233611
|
-
init_gitFilesystem();
|
|
233612
|
-
init_git();
|
|
233613
|
-
init_log2();
|
|
233614
|
-
init_model();
|
|
233615
|
-
init_state2();
|
|
233616
|
-
INTERNAL_MODEL_REPOS = [
|
|
233617
|
-
"github.com:anthropics/claude-cli-internal",
|
|
233618
|
-
"github.com/anthropics/claude-cli-internal",
|
|
233619
|
-
"github.com:anthropics/anthropic",
|
|
233620
|
-
"github.com/anthropics/anthropic",
|
|
233621
|
-
"github.com:anthropics/apps",
|
|
233622
|
-
"github.com/anthropics/apps",
|
|
233623
|
-
"github.com:anthropics/casino",
|
|
233624
|
-
"github.com/anthropics/casino",
|
|
233625
|
-
"github.com:anthropics/dbt",
|
|
233626
|
-
"github.com/anthropics/dbt",
|
|
233627
|
-
"github.com:anthropics/dotfiles",
|
|
233628
|
-
"github.com/anthropics/dotfiles",
|
|
233629
|
-
"github.com:anthropics/terraform-config",
|
|
233630
|
-
"github.com/anthropics/terraform-config",
|
|
233631
|
-
"github.com:anthropics/hex-export",
|
|
233632
|
-
"github.com/anthropics/hex-export",
|
|
233633
|
-
"github.com:anthropics/feedback-v2",
|
|
233634
|
-
"github.com/anthropics/feedback-v2",
|
|
233635
|
-
"github.com:anthropics/labs",
|
|
233636
|
-
"github.com/anthropics/labs",
|
|
233637
|
-
"github.com:anthropics/argo-rollouts",
|
|
233638
|
-
"github.com/anthropics/argo-rollouts",
|
|
233639
|
-
"github.com:anthropics/starling-configs",
|
|
233640
|
-
"github.com/anthropics/starling-configs",
|
|
233641
|
-
"github.com:anthropics/ts-tools",
|
|
233642
|
-
"github.com/anthropics/ts-tools",
|
|
233643
|
-
"github.com:anthropics/ts-capsules",
|
|
233644
|
-
"github.com/anthropics/ts-capsules",
|
|
233645
|
-
"github.com:anthropics/feldspar-testing",
|
|
233646
|
-
"github.com/anthropics/feldspar-testing",
|
|
233647
|
-
"github.com:anthropics/trellis",
|
|
233648
|
-
"github.com/anthropics/trellis",
|
|
233649
|
-
"github.com:anthropics/claude-for-hiring",
|
|
233650
|
-
"github.com/anthropics/claude-for-hiring",
|
|
233651
|
-
"github.com:anthropics/forge-web",
|
|
233652
|
-
"github.com/anthropics/forge-web",
|
|
233653
|
-
"github.com:anthropics/infra-manifests",
|
|
233654
|
-
"github.com/anthropics/infra-manifests",
|
|
233655
|
-
"github.com:anthropics/mycro_manifests",
|
|
233656
|
-
"github.com/anthropics/mycro_manifests",
|
|
233657
|
-
"github.com:anthropics/mycro_configs",
|
|
233658
|
-
"github.com/anthropics/mycro_configs",
|
|
233659
|
-
"github.com:anthropics/mobile-apps",
|
|
233660
|
-
"github.com/anthropics/mobile-apps"
|
|
233661
|
-
];
|
|
233662
|
-
repoClassCache = new Map;
|
|
233663
|
-
isInternalModelRepo = sequential(async () => {
|
|
233664
|
-
const cwd = getAttributionRepoRoot();
|
|
233665
|
-
const cached2 = repoClassCache.get(cwd);
|
|
233666
|
-
if (cached2 !== undefined) {
|
|
233667
|
-
return cached2 === "internal";
|
|
233668
|
-
}
|
|
233669
|
-
const remoteUrl = await getRemoteUrlForDir(cwd);
|
|
233670
|
-
if (!remoteUrl) {
|
|
233671
|
-
repoClassCache.set(cwd, "none");
|
|
233672
|
-
return false;
|
|
233673
|
-
}
|
|
233674
|
-
const isInternal = INTERNAL_MODEL_REPOS.some((repo) => remoteUrl.includes(repo));
|
|
233675
|
-
repoClassCache.set(cwd, isInternal ? "internal" : "external");
|
|
233676
|
-
return isInternal;
|
|
233677
|
-
});
|
|
233678
|
-
});
|
|
233679
|
-
|
|
233680
233412
|
// src/state/AppStateStore.ts
|
|
233681
233413
|
function getDefaultAppState() {
|
|
233682
233414
|
const teammateUtils = (init_teammate(), __toCommonJS(exports_teammate));
|
|
@@ -233724,7 +233456,6 @@ function getDefaultAppState() {
|
|
|
233724
233456
|
trackedFiles: new Set,
|
|
233725
233457
|
snapshotSequence: 0
|
|
233726
233458
|
},
|
|
233727
|
-
attribution: createEmptyAttributionState(),
|
|
233728
233459
|
mcp: {
|
|
233729
233460
|
clients: [],
|
|
233730
233461
|
tools: [],
|
|
@@ -233787,7 +233518,6 @@ var IDLE_SPECULATION_STATE;
|
|
|
233787
233518
|
var init_AppStateStore = __esm(() => {
|
|
233788
233519
|
init_promptSuggestion();
|
|
233789
233520
|
init_Tool();
|
|
233790
|
-
init_commitAttribution();
|
|
233791
233521
|
init_settings2();
|
|
233792
233522
|
init_thinking();
|
|
233793
233523
|
IDLE_SPECULATION_STATE = { status: "idle" };
|
|
@@ -256221,7 +255951,6 @@ async function createBashShellProvider(shellPath, options2) {
|
|
|
256221
255951
|
const normalizedCommand = rewriteWindowsNullRedirect(command);
|
|
256222
255952
|
const addStdinRedirect = shouldAddStdinRedirect(normalizedCommand);
|
|
256223
255953
|
let quotedCommand = quoteShellCommand(normalizedCommand, addStdinRedirect);
|
|
256224
|
-
if (false) {}
|
|
256225
255954
|
if (normalizedCommand.includes("|") && addStdinRedirect) {
|
|
256226
255955
|
quotedCommand = rearrangePipeCommand(normalizedCommand);
|
|
256227
255956
|
}
|
|
@@ -256893,9 +256622,7 @@ var init_NotebookEditTool = __esm(() => {
|
|
|
256893
256622
|
language: exports_external2.string().describe("The programming language of the notebook"),
|
|
256894
256623
|
edit_mode: exports_external2.string().describe("The edit mode that was used"),
|
|
256895
256624
|
error: exports_external2.string().optional().describe("Error message if the operation failed"),
|
|
256896
|
-
notebook_path: exports_external2.string().describe("The path to the notebook file")
|
|
256897
|
-
original_file: exports_external2.string().describe("The original notebook content before modification"),
|
|
256898
|
-
updated_file: exports_external2.string().describe("The updated notebook content after modification")
|
|
256625
|
+
notebook_path: exports_external2.string().describe("The path to the notebook file")
|
|
256899
256626
|
}));
|
|
256900
256627
|
NotebookEditTool = buildToolRuntime({
|
|
256901
256628
|
name: NOTEBOOK_EDIT_TOOL_NAME2,
|
|
@@ -257091,9 +256818,7 @@ var init_NotebookEditTool = __esm(() => {
|
|
|
257091
256818
|
edit_mode: "replace",
|
|
257092
256819
|
error: "Notebook is not valid JSON.",
|
|
257093
256820
|
cell_id,
|
|
257094
|
-
notebook_path: fullPath
|
|
257095
|
-
original_file: "",
|
|
257096
|
-
updated_file: ""
|
|
256821
|
+
notebook_path: fullPath
|
|
257097
256822
|
}
|
|
257098
256823
|
};
|
|
257099
256824
|
}
|
|
@@ -257177,9 +256902,7 @@ var init_NotebookEditTool = __esm(() => {
|
|
|
257177
256902
|
edit_mode: edit_mode ?? "replace",
|
|
257178
256903
|
cell_id: new_cell_id || undefined,
|
|
257179
256904
|
error: "",
|
|
257180
|
-
notebook_path: fullPath
|
|
257181
|
-
original_file: content,
|
|
257182
|
-
updated_file: updatedContent
|
|
256905
|
+
notebook_path: fullPath
|
|
257183
256906
|
};
|
|
257184
256907
|
return {
|
|
257185
256908
|
data
|
|
@@ -257193,9 +256916,7 @@ var init_NotebookEditTool = __esm(() => {
|
|
|
257193
256916
|
edit_mode: "replace",
|
|
257194
256917
|
error: error41.message,
|
|
257195
256918
|
cell_id,
|
|
257196
|
-
notebook_path: fullPath
|
|
257197
|
-
original_file: "",
|
|
257198
|
-
updated_file: ""
|
|
256919
|
+
notebook_path: fullPath
|
|
257199
256920
|
};
|
|
257200
256921
|
return {
|
|
257201
256922
|
data: data2
|
|
@@ -257208,9 +256929,7 @@ var init_NotebookEditTool = __esm(() => {
|
|
|
257208
256929
|
edit_mode: "replace",
|
|
257209
256930
|
error: "Unknown error occurred while editing notebook",
|
|
257210
256931
|
cell_id,
|
|
257211
|
-
notebook_path: fullPath
|
|
257212
|
-
original_file: "",
|
|
257213
|
-
updated_file: ""
|
|
256932
|
+
notebook_path: fullPath
|
|
257214
256933
|
};
|
|
257215
256934
|
return {
|
|
257216
256935
|
data
|
|
@@ -258523,85 +258242,6 @@ var init_commandSemantics = __esm(() => {
|
|
|
258523
258242
|
]);
|
|
258524
258243
|
});
|
|
258525
258244
|
|
|
258526
|
-
// src/session/sessionFileAccessHooks.ts
|
|
258527
|
-
var init_sessionFileAccessHooks = __esm(() => {
|
|
258528
|
-
init_state();
|
|
258529
|
-
init_types9();
|
|
258530
|
-
init_FileReadTool();
|
|
258531
|
-
init_FileWriteTool();
|
|
258532
|
-
init_GlobTool();
|
|
258533
|
-
init_GrepTool();
|
|
258534
|
-
init_memoryFileDetection();
|
|
258535
|
-
init_agentContext();
|
|
258536
|
-
});
|
|
258537
|
-
|
|
258538
|
-
// src/lib/undercover.ts
|
|
258539
|
-
function isUndercover() {
|
|
258540
|
-
return false;
|
|
258541
|
-
}
|
|
258542
|
-
function getUndercoverInstructions() {
|
|
258543
|
-
return "";
|
|
258544
|
-
}
|
|
258545
|
-
|
|
258546
|
-
// src/session/attribution.ts
|
|
258547
|
-
function getAttributionTexts() {
|
|
258548
|
-
if (process.env.USER_TYPE === "ant" && isUndercover()) {
|
|
258549
|
-
return { commit: "", pr: "" };
|
|
258550
|
-
}
|
|
258551
|
-
if (getClientType() === "remote") {
|
|
258552
|
-
const remoteSessionId = resolveEnvVar("REMOTE_SESSION_ID");
|
|
258553
|
-
if (remoteSessionId) {
|
|
258554
|
-
const ingressUrl = process.env.SESSION_INGRESS_URL;
|
|
258555
|
-
if (!isRemoteSessionLocal(remoteSessionId, ingressUrl)) {
|
|
258556
|
-
const sessionUrl = getRemoteSessionUrl(remoteSessionId, ingressUrl);
|
|
258557
|
-
return { commit: sessionUrl, pr: sessionUrl };
|
|
258558
|
-
}
|
|
258559
|
-
}
|
|
258560
|
-
return { commit: "", pr: "" };
|
|
258561
|
-
}
|
|
258562
|
-
const model = getMainLoopModel();
|
|
258563
|
-
const isKnownPublicModel = getPublicModelDisplayName(model) !== null;
|
|
258564
|
-
const modelName = isInternalModelRepoCached() || isKnownPublicModel ? getPublicModelName(model) : "Claude Opus 4.6";
|
|
258565
|
-
const defaultAttribution = "\uD83E\uDD16 Generated with [OpenCow](https://github.com/Gitlawb/opencow)";
|
|
258566
|
-
const coAuthorDomain = isFamily(getProvider(), "firstParty") ? "anthropic.com" : "opencow.dev";
|
|
258567
|
-
const defaultCommit = isEnvTruthy(resolveEnvVar("DISABLE_CO_AUTHORED_BY")) ? "" : `Co-Authored-By: ${modelName} <noreply@${coAuthorDomain}>`;
|
|
258568
|
-
const settings = getInitialSettings();
|
|
258569
|
-
if (settings.attribution) {
|
|
258570
|
-
return {
|
|
258571
|
-
commit: settings.attribution.commit ?? defaultCommit,
|
|
258572
|
-
pr: settings.attribution.pr ?? defaultAttribution
|
|
258573
|
-
};
|
|
258574
|
-
}
|
|
258575
|
-
if (settings.includeCoAuthoredBy === false) {
|
|
258576
|
-
return { commit: "", pr: "" };
|
|
258577
|
-
}
|
|
258578
|
-
return { commit: defaultCommit, pr: defaultAttribution };
|
|
258579
|
-
}
|
|
258580
|
-
var MEMORY_ACCESS_TOOL_NAMES;
|
|
258581
|
-
var init_attribution = __esm(() => {
|
|
258582
|
-
init_state();
|
|
258583
|
-
init_envUtils();
|
|
258584
|
-
init_xml();
|
|
258585
|
-
init_commitAttribution();
|
|
258586
|
-
init_debug();
|
|
258587
|
-
init_json();
|
|
258588
|
-
init_log2();
|
|
258589
|
-
init_state2();
|
|
258590
|
-
init_model();
|
|
258591
|
-
init_sessionFileAccessHooks();
|
|
258592
|
-
init_sessionStorage();
|
|
258593
|
-
init_sessionStoragePortable();
|
|
258594
|
-
init_settings2();
|
|
258595
|
-
init_fsOperations();
|
|
258596
|
-
MEMORY_ACCESS_TOOL_NAMES = new Set([
|
|
258597
|
-
FILE_READ_TOOL_NAME,
|
|
258598
|
-
GREP_TOOL_NAME,
|
|
258599
|
-
GLOB_TOOL_NAME,
|
|
258600
|
-
FILE_EDIT_TOOL_NAME,
|
|
258601
|
-
FILE_WRITE_TOOL_NAME
|
|
258602
|
-
]);
|
|
258603
|
-
});
|
|
258604
|
-
|
|
258605
258245
|
// src/lib/timeouts.ts
|
|
258606
258246
|
function getDefaultBashTimeoutMs(env4 = process.env) {
|
|
258607
258247
|
const envValue = env4.BASH_DEFAULT_TIMEOUT_MS;
|
|
@@ -258625,6 +258265,14 @@ function getMaxBashTimeoutMs(env4 = process.env) {
|
|
|
258625
258265
|
}
|
|
258626
258266
|
var DEFAULT_TIMEOUT_MS = 120000, MAX_TIMEOUT_MS = 600000;
|
|
258627
258267
|
|
|
258268
|
+
// src/lib/undercover.ts
|
|
258269
|
+
function isUndercover() {
|
|
258270
|
+
return false;
|
|
258271
|
+
}
|
|
258272
|
+
function getUndercoverInstructions() {
|
|
258273
|
+
return "";
|
|
258274
|
+
}
|
|
258275
|
+
|
|
258628
258276
|
// src/capabilities/tools/BashTool/prompt.ts
|
|
258629
258277
|
function getDefaultTimeoutMs() {
|
|
258630
258278
|
return getDefaultBashTimeoutMs();
|
|
@@ -258662,7 +258310,6 @@ Use the gh command via the Bash tool for other GitHub-related tasks including wo
|
|
|
258662
258310
|
# Other common operations
|
|
258663
258311
|
- View comments on a Github PR: gh api repos/foo/bar/pulls/123/comments`;
|
|
258664
258312
|
}
|
|
258665
|
-
const { commit: commitAttribution, pr: prAttribution } = getAttributionTexts();
|
|
258666
258313
|
return `# Committing changes with git
|
|
258667
258314
|
|
|
258668
258315
|
Only create commits when requested by the user. If unclear, ask first. When the user asks you to create a new git commit, follow these steps carefully:
|
|
@@ -258689,8 +258336,7 @@ Git Safety Protocol:
|
|
|
258689
258336
|
- Ensure it accurately reflects the changes and their purpose
|
|
258690
258337
|
3. Run the following commands in parallel:
|
|
258691
258338
|
- Add relevant untracked files to the staging area.
|
|
258692
|
-
- Create the commit with a message
|
|
258693
|
-
${commitAttribution}` : "."}
|
|
258339
|
+
- Create the commit with a message.
|
|
258694
258340
|
- Run git status after the commit completes to verify success.
|
|
258695
258341
|
Note: git status depends on the commit completing, so run it sequentially after the commit.
|
|
258696
258342
|
4. If the commit fails due to pre-commit hook: fix the issue and create a NEW commit
|
|
@@ -258705,9 +258351,7 @@ Important notes:
|
|
|
258705
258351
|
- In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:
|
|
258706
258352
|
<example>
|
|
258707
258353
|
git commit -m "$(cat <<'EOF'
|
|
258708
|
-
Commit message here
|
|
258709
|
-
|
|
258710
|
-
${commitAttribution}` : ""}
|
|
258354
|
+
Commit message here.
|
|
258711
258355
|
EOF
|
|
258712
258356
|
)"
|
|
258713
258357
|
</example>
|
|
@@ -258735,9 +258379,7 @@ gh pr create --title "the pr title" --body "$(cat <<'EOF'
|
|
|
258735
258379
|
<1-3 bullet points>
|
|
258736
258380
|
|
|
258737
258381
|
## Test plan
|
|
258738
|
-
[Bulleted markdown checklist of TODOs for testing the pull request...]
|
|
258739
|
-
|
|
258740
|
-
${prAttribution}` : ""}
|
|
258382
|
+
[Bulleted markdown checklist of TODOs for testing the pull request...]
|
|
258741
258383
|
EOF
|
|
258742
258384
|
)"
|
|
258743
258385
|
</example>
|
|
@@ -258911,7 +258553,6 @@ function getSimplePrompt() {
|
|
|
258911
258553
|
}
|
|
258912
258554
|
var init_prompt9 = __esm(() => {
|
|
258913
258555
|
init_prompts2();
|
|
258914
|
-
init_attribution();
|
|
258915
258556
|
init_embeddedTools();
|
|
258916
258557
|
init_envUtils();
|
|
258917
258558
|
init_gitSettings();
|
|
@@ -282904,7 +282545,7 @@ function getAnthropicEnvMetadata() {
|
|
|
282904
282545
|
function getBuildAgeMinutes() {
|
|
282905
282546
|
if (false)
|
|
282906
282547
|
;
|
|
282907
|
-
const buildTime = new Date("2026-07-
|
|
282548
|
+
const buildTime = new Date("2026-07-13T03:43:07.519Z").getTime();
|
|
282908
282549
|
if (isNaN(buildTime))
|
|
282909
282550
|
return;
|
|
282910
282551
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -283425,7 +283066,6 @@ function createSubagentContext(parentContext, overrides) {
|
|
|
283425
283066
|
setResponseLength: overrides?.shareSetResponseLength ? parentContext.setResponseLength : () => {},
|
|
283426
283067
|
pushApiMetricsEntry: overrides?.shareSetResponseLength ? parentContext.pushApiMetricsEntry : undefined,
|
|
283427
283068
|
updateFileHistoryState: () => {},
|
|
283428
|
-
updateAttributionState: parentContext.updateAttributionState,
|
|
283429
283069
|
addNotification: undefined,
|
|
283430
283070
|
setToolJSX: undefined,
|
|
283431
283071
|
setStreamMode: undefined,
|
|
@@ -284764,7 +284404,6 @@ function runPostCompactCleanup(querySource) {
|
|
|
284764
284404
|
clearClassifierApprovals();
|
|
284765
284405
|
_clearSpeculativeChecks?.();
|
|
284766
284406
|
clearBetaTracingState();
|
|
284767
|
-
if (false) {}
|
|
284768
284407
|
clearSessionMessagesCache();
|
|
284769
284408
|
}
|
|
284770
284409
|
var _clearSpeculativeChecks = null;
|
|
@@ -290535,8 +290174,7 @@ async function* executeHooks({
|
|
|
290535
290174
|
} else {
|
|
290536
290175
|
const batchStartTime2 = Date.now();
|
|
290537
290176
|
const context4 = toolUseContext ? {
|
|
290538
|
-
getAppState: toolUseContext.getAppState
|
|
290539
|
-
updateAttributionState: toolUseContext.updateAttributionState
|
|
290177
|
+
getAppState: toolUseContext.getAppState
|
|
290540
290178
|
} : undefined;
|
|
290541
290179
|
for (const [i3, { hook }] of matchingHooks.entries()) {
|
|
290542
290180
|
if (hook.type === "callback") {
|
|
@@ -292250,8 +291888,7 @@ async function executeHookCallback({
|
|
|
292250
291888
|
toolUseContext
|
|
292251
291889
|
}) {
|
|
292252
291890
|
const context4 = toolUseContext ? {
|
|
292253
|
-
getAppState: toolUseContext.getAppState
|
|
292254
|
-
updateAttributionState: toolUseContext.updateAttributionState
|
|
291891
|
+
getAppState: toolUseContext.getAppState
|
|
292255
291892
|
} : undefined;
|
|
292256
291893
|
const json2 = await hook.callback(hookInput, toolUseID, signal, hookIndex, context4);
|
|
292257
291894
|
if (isAsyncHookJSONOutput(json2)) {
|
|
@@ -300403,14 +300040,6 @@ class QueryEngine {
|
|
|
300403
300040
|
return { ...prev, fileHistory: updated };
|
|
300404
300041
|
});
|
|
300405
300042
|
},
|
|
300406
|
-
updateAttributionState: (updater) => {
|
|
300407
|
-
setAppState((prev) => {
|
|
300408
|
-
const updated = updater(prev.attribution);
|
|
300409
|
-
if (updated === prev.attribution)
|
|
300410
|
-
return prev;
|
|
300411
|
-
return { ...prev, attribution: updated };
|
|
300412
|
-
});
|
|
300413
|
-
},
|
|
300414
300043
|
setSDKStatus,
|
|
300415
300044
|
onToolInvoke,
|
|
300416
300045
|
uploadMedia
|
|
@@ -300502,7 +300131,6 @@ class QueryEngine {
|
|
|
300502
300131
|
setInProgressToolUseIDs: () => {},
|
|
300503
300132
|
setResponseLength: () => {},
|
|
300504
300133
|
updateFileHistoryState: processUserInputContext.updateFileHistoryState,
|
|
300505
|
-
updateAttributionState: processUserInputContext.updateAttributionState,
|
|
300506
300134
|
setSDKStatus,
|
|
300507
300135
|
uploadMedia
|
|
300508
300136
|
};
|
|
@@ -336394,4 +336022,4 @@ export {
|
|
|
336394
336022
|
AbortError2 as AbortError
|
|
336395
336023
|
};
|
|
336396
336024
|
|
|
336397
|
-
//# debugId=
|
|
336025
|
+
//# debugId=546BBB52271BD24364756E2164756E21
|