dr-claw 1.1.3 → 1.1.4
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/assets/{_basePickBy-CTZ7OJiJ.js → _basePickBy-7CEpiVqc.js} +1 -1
- package/dist/assets/{_baseUniq-LYG5erFT.js → _baseUniq-yh8GoKah.js} +1 -1
- package/dist/assets/{arc-CYhqYtN8.js → arc-xxYot-So.js} +1 -1
- package/dist/assets/{architectureDiagram-VXUJARFQ-B7xb9vYd.js → architectureDiagram-VXUJARFQ-Bb1NqOFB.js} +1 -1
- package/dist/assets/{blockDiagram-VD42YOAC-Dz6eN3Yc.js → blockDiagram-VD42YOAC-D8xMHk8C.js} +1 -1
- package/dist/assets/{c4Diagram-YG6GDRKO-DIa9rHl5.js → c4Diagram-YG6GDRKO-69UiBMVa.js} +1 -1
- package/dist/assets/channel-BJdHHkhR.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-JZVAPeYL.js → chunk-4BX2VUAB-DXrPhE6K.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-BoNiAnP-.js → chunk-55IACEB6-B3sw4AGX.js} +1 -1
- package/dist/assets/{chunk-B4BG7PRW-BURhBXxZ.js → chunk-B4BG7PRW-Dd4n17kR.js} +1 -1
- package/dist/assets/{chunk-DI55MBZ5-Bxa-FsXa.js → chunk-DI55MBZ5-DuTb9gb8.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-Dn_6iLa4.js → chunk-FMBD7UC4-CGErQ-ud.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-B0N2-K2K.js → chunk-QN33PNHL-Bk5fuYbR.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-Bd7csSYW.js → chunk-QZHKN3VN-2UdZTbge.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-DV5aJTr6.js → chunk-TZMSLE5B-Bl-UYKEK.js} +1 -1
- package/dist/assets/{classDiagram-2ON5EDUG-iZL_J_xq.js → classDiagram-2ON5EDUG-EaoBDWqJ.js} +1 -1
- package/dist/assets/{classDiagram-v2-WZHVMYZB-iZL_J_xq.js → classDiagram-v2-WZHVMYZB-EaoBDWqJ.js} +1 -1
- package/dist/assets/clone-CwXTbwxl.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-C_Uhc5Rn.js → cose-bilkent-S5V4N54A-qXNKLX2R.js} +1 -1
- package/dist/assets/{dagre-6UL2VRFP-BiW_P9KL.js → dagre-6UL2VRFP-DmHvDWep.js} +1 -1
- package/dist/assets/{diagram-PSM6KHXK-uGQgzEbt.js → diagram-PSM6KHXK-C_Rj4DX3.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-qox_ZDR7.js → diagram-QEK2KX5R-BVr3mPXW.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-RKFFDPoU.js → diagram-S2PKOQOG-DVx6i0Qe.js} +1 -1
- package/dist/assets/{erDiagram-Q2GNP2WA-11Go9j0k.js → erDiagram-Q2GNP2WA-BJQyv9_t.js} +1 -1
- package/dist/assets/{flowDiagram-NV44I4VS-DBAiHvAx.js → flowDiagram-NV44I4VS-DCR8sPAE.js} +1 -1
- package/dist/assets/{ganttDiagram-JELNMOA3-Dzc11a-7.js → ganttDiagram-JELNMOA3-BcXFAthK.js} +1 -1
- package/dist/assets/{gitGraphDiagram-V2S2FVAM-DJVXfOqP.js → gitGraphDiagram-V2S2FVAM-CnS56w1x.js} +1 -1
- package/dist/assets/{graph-CJ95S3XQ.js → graph-DGtZXuDY.js} +1 -1
- package/dist/assets/index-C-sL-ag0.css +1 -0
- package/dist/assets/index-VdqxIFPL.js +670 -0
- package/dist/assets/{infoDiagram-HS3SLOUP-DpdkGgBK.js → infoDiagram-HS3SLOUP-DtI272ZD.js} +1 -1
- package/dist/assets/{journeyDiagram-XKPGCS4Q-CSGpNz7D.js → journeyDiagram-XKPGCS4Q-DHp_Kica.js} +1 -1
- package/dist/assets/{kanban-definition-3W4ZIXB7-BvPB3vMM.js → kanban-definition-3W4ZIXB7-CjgHMNku.js} +1 -1
- package/dist/assets/{layout-C96BbhFQ.js → layout-Cnc-DCSb.js} +1 -1
- package/dist/assets/{linear-HjDfr5-H.js → linear-BtRgmV19.js} +1 -1
- package/dist/assets/{mermaid.core-J7RjAKTD.js → mermaid.core-B20uzv6N.js} +5 -5
- package/dist/assets/{mindmap-definition-VGOIOE7T-C6MlEWCC.js → mindmap-definition-VGOIOE7T-bbcLXkWp.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-Bi5BLoNG.js → pieDiagram-ADFJNKIX-B4fEzWKO.js} +1 -1
- package/dist/assets/{quadrantDiagram-AYHSOK5B-Bo14V3Q1.js → quadrantDiagram-AYHSOK5B-B5G0SMbK.js} +1 -1
- package/dist/assets/{requirementDiagram-UZGBJVZJ-CP3_EwJ4.js → requirementDiagram-UZGBJVZJ-DsqtOFgj.js} +1 -1
- package/dist/assets/{sankeyDiagram-TZEHDZUN-B3wFfI_W.js → sankeyDiagram-TZEHDZUN-CiGemFRE.js} +1 -1
- package/dist/assets/{sequenceDiagram-WL72ISMW-fZVhVt_s.js → sequenceDiagram-WL72ISMW-hEMvYbe9.js} +1 -1
- package/dist/assets/{stateDiagram-FKZM4ZOC-BooCitAX.js → stateDiagram-FKZM4ZOC-Cn8VB7b1.js} +1 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-DaH0PZOq.js +1 -0
- package/dist/assets/{timeline-definition-IT6M3QCI-CM0zUx-Q.js → timeline-definition-IT6M3QCI-DChT1GUr.js} +1 -1
- package/dist/assets/{treemap-GDKQZRPO-B-8ph3e8.js → treemap-GDKQZRPO-Dflv6a8z.js} +1 -1
- package/dist/assets/{xychartDiagram-PRI3JC2R-Q2k0EFpn.js → xychartDiagram-PRI3JC2R-Dr4urXR8.js} +1 -1
- package/dist/icons/nanoclaude.png +0 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/public/icons/nanoclaude.png +0 -0
- package/scripts/native-runtime.mjs +5 -3
- package/server/__tests__/gemini-api.test.mjs +699 -0
- package/server/__tests__/gemini-session-index.test.mjs +95 -0
- package/server/claude-sdk.js +82 -3
- package/server/cli-chat.js +28 -17
- package/server/cli.js +13 -1
- package/server/data/news-log-arxiv.json +1 -0
- package/server/data/news-log-huggingface.json +1 -0
- package/server/data/news-results-arxiv.json +460 -0
- package/server/data/news-results-huggingface.json +817 -0
- package/server/data/research_interests_arxiv.json +50 -0
- package/server/data/research_interests_huggingface.json +4 -0
- package/server/database/db.js +92 -0
- package/server/database/init.sql +17 -1
- package/server/gemini-api.js +1838 -0
- package/server/gemini-cli.js +13 -2
- package/server/index.js +94 -17
- package/server/load-env.js +13 -1
- package/server/local-gpu.js +3 -1
- package/server/nano-claude-code.js +340 -0
- package/server/nanoSessionPaths.js +41 -0
- package/server/openai-codex.js +6 -2
- package/server/openrouter.js +37 -22
- package/server/projects.js +207 -0
- package/server/routes/agent.js +32 -7
- package/server/routes/auto-research.js +1 -1
- package/server/routes/claude-btw.js +55 -0
- package/server/routes/cli-auth.js +103 -2
- package/server/routes/commands.js +25 -1
- package/server/routes/community-tools.js +26 -21
- package/server/routes/memory.js +143 -0
- package/server/routes/news.js +3 -0
- package/server/routes/skills.js +35 -0
- package/server/routes/user.js +3 -5
- package/server/utils/__tests__/safePath.test.js +93 -0
- package/server/utils/cliResolution.js +13 -1
- package/server/utils/geminiOAuth.js +333 -0
- package/server/utils/memoryPrompt.js +78 -0
- package/server/utils/safePath.js +51 -0
- package/server/utils/sessionIndex.js +2 -0
- package/server/utils/skillExpander.js +142 -0
- package/server/utils/spawnAsync.js +78 -0
- package/shared/modelConstants.js +19 -1
- package/dist/assets/channel-Dk-4X8XT.js +0 -1
- package/dist/assets/clone-DbPu_xVW.js +0 -1
- package/dist/assets/index-1MRmplD1.css +0 -1
- package/dist/assets/index-CFbkRzqw.js +0 -664
- package/dist/assets/stateDiagram-v2-4FDKWEC3-BzH7qQMD.js +0 -1
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { beforeEach, afterEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { mkdir, mkdtemp, rm, writeFile } from 'fs/promises';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
|
|
6
|
+
const originalHome = process.env.HOME;
|
|
7
|
+
const originalUserProfile = process.env.USERPROFILE;
|
|
8
|
+
const originalDatabasePath = process.env.DATABASE_PATH;
|
|
9
|
+
|
|
10
|
+
let tempRoot = null;
|
|
11
|
+
|
|
12
|
+
async function loadTestModules() {
|
|
13
|
+
vi.resetModules();
|
|
14
|
+
const projects = await import('../projects.js');
|
|
15
|
+
const database = await import('../database/db.js');
|
|
16
|
+
await database.initializeDatabase();
|
|
17
|
+
return { projects, database };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
describe('Gemini API session indexing', () => {
|
|
21
|
+
beforeEach(async () => {
|
|
22
|
+
tempRoot = await mkdtemp(path.join(os.tmpdir(), 'dr-claw-gemini-index-'));
|
|
23
|
+
process.env.HOME = tempRoot;
|
|
24
|
+
process.env.USERPROFILE = tempRoot;
|
|
25
|
+
process.env.DATABASE_PATH = path.join(tempRoot, 'db', 'auth.db');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
afterEach(async () => {
|
|
29
|
+
vi.resetModules();
|
|
30
|
+
|
|
31
|
+
if (originalHome === undefined) delete process.env.HOME;
|
|
32
|
+
else process.env.HOME = originalHome;
|
|
33
|
+
|
|
34
|
+
if (originalUserProfile === undefined) delete process.env.USERPROFILE;
|
|
35
|
+
else process.env.USERPROFILE = originalUserProfile;
|
|
36
|
+
|
|
37
|
+
if (originalDatabasePath === undefined) delete process.env.DATABASE_PATH;
|
|
38
|
+
else process.env.DATABASE_PATH = originalDatabasePath;
|
|
39
|
+
|
|
40
|
+
if (tempRoot) {
|
|
41
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
42
|
+
tempRoot = null;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('discovers API-written Gemini sessions from ~/.gemini/sessions', async () => {
|
|
47
|
+
const { projects } = await loadTestModules();
|
|
48
|
+
const projectPath = path.join(tempRoot, 'workspace', 'gemini-project');
|
|
49
|
+
const sessionId = 'gemini-api-session-1';
|
|
50
|
+
const sessionsDir = path.join(tempRoot, '.gemini', 'sessions');
|
|
51
|
+
const sessionFile = path.join(sessionsDir, `${sessionId}.jsonl`);
|
|
52
|
+
|
|
53
|
+
await mkdir(projectPath, { recursive: true });
|
|
54
|
+
await mkdir(sessionsDir, { recursive: true });
|
|
55
|
+
await writeFile(sessionFile, [
|
|
56
|
+
JSON.stringify({
|
|
57
|
+
type: 'session_meta',
|
|
58
|
+
payload: {
|
|
59
|
+
id: sessionId,
|
|
60
|
+
cwd: projectPath,
|
|
61
|
+
timestamp: '2026-04-05T12:00:00.000Z',
|
|
62
|
+
sessionMode: 'research',
|
|
63
|
+
title: 'Explore Gemini API flow',
|
|
64
|
+
},
|
|
65
|
+
cwd: projectPath,
|
|
66
|
+
timestamp: '2026-04-05T12:00:00.000Z',
|
|
67
|
+
title: 'Explore Gemini API flow',
|
|
68
|
+
}),
|
|
69
|
+
JSON.stringify({
|
|
70
|
+
type: 'message',
|
|
71
|
+
role: 'user',
|
|
72
|
+
content: 'Explore Gemini API flow',
|
|
73
|
+
timestamp: '2026-04-05T12:00:01.000Z',
|
|
74
|
+
}),
|
|
75
|
+
JSON.stringify({
|
|
76
|
+
type: 'message',
|
|
77
|
+
role: 'assistant',
|
|
78
|
+
content: 'I inspected the repository.',
|
|
79
|
+
timestamp: '2026-04-05T12:00:02.000Z',
|
|
80
|
+
}),
|
|
81
|
+
'',
|
|
82
|
+
].join('\n'), 'utf-8');
|
|
83
|
+
|
|
84
|
+
const sessions = await projects.getGeminiSessions(projectPath, { limit: 5 });
|
|
85
|
+
|
|
86
|
+
expect(sessions).toHaveLength(1);
|
|
87
|
+
expect(sessions[0]).toEqual(expect.objectContaining({
|
|
88
|
+
id: sessionId,
|
|
89
|
+
name: 'Explore Gemini API flow',
|
|
90
|
+
mode: 'research',
|
|
91
|
+
projectPath,
|
|
92
|
+
messageCount: 2,
|
|
93
|
+
}));
|
|
94
|
+
});
|
|
95
|
+
});
|
package/server/claude-sdk.js
CHANGED
|
@@ -25,6 +25,7 @@ import { applyStageTagsToSession, recordIndexedSession } from './utils/sessionIn
|
|
|
25
25
|
import { buildTempAttachmentFilename } from './utils/imageAttachmentFiles.js';
|
|
26
26
|
|
|
27
27
|
import { createRequestId, waitForToolApproval, resolveToolApproval as resolvePermApproval, matchesToolPermission } from './utils/permissions.js';
|
|
28
|
+
import { buildMemoryBlock } from './utils/memoryPrompt.js';
|
|
28
29
|
|
|
29
30
|
const activeSessions = new Map();
|
|
30
31
|
const pendingClaudeSessionIndexReconciles = new Map();
|
|
@@ -143,10 +144,12 @@ function mapCliOptionsToSDK(options = {}) {
|
|
|
143
144
|
sdkOptions.model = options.model || CLAUDE_MODELS.DEFAULT;
|
|
144
145
|
console.log(`Using model: ${sdkOptions.model}`);
|
|
145
146
|
|
|
146
|
-
// Map system prompt configuration
|
|
147
|
+
// Map system prompt configuration with optional user memory injection
|
|
148
|
+
const memoryBlock = options.userId ? buildMemoryBlock(options.userId) : '';
|
|
147
149
|
sdkOptions.systemPrompt = {
|
|
148
150
|
type: 'preset',
|
|
149
|
-
preset: 'claude_code' // Required to use CLAUDE.md
|
|
151
|
+
preset: 'claude_code', // Required to use CLAUDE.md
|
|
152
|
+
...(memoryBlock ? { append: memoryBlock } : {}),
|
|
150
153
|
};
|
|
151
154
|
|
|
152
155
|
// Map setting sources for CLAUDE.md loading
|
|
@@ -869,6 +872,81 @@ function getActiveClaudeSDKSessions() {
|
|
|
869
872
|
return getAllSessions();
|
|
870
873
|
}
|
|
871
874
|
|
|
875
|
+
const BTW_SYSTEM_PROMPT = `You answer a short side question for someone in the middle of a coding session.
|
|
876
|
+
|
|
877
|
+
Rules:
|
|
878
|
+
- You have NO tools. Do not claim to read files, run commands, or fetch URLs unless that information already appears in the conversation context below.
|
|
879
|
+
- Use the "Conversation context" section plus general programming knowledge. If something is not in the context, say you do not see it there.
|
|
880
|
+
- Be concise.`;
|
|
881
|
+
|
|
882
|
+
/**
|
|
883
|
+
* One-shot, tool-free side question (Claude Code /btw-style). Does not resume the main SDK session.
|
|
884
|
+
*/
|
|
885
|
+
async function runClaudeBtw({ question, transcript, cwd, model, signal }) {
|
|
886
|
+
const safeTranscript =
|
|
887
|
+
typeof transcript === 'string' && transcript.trim()
|
|
888
|
+
? transcript
|
|
889
|
+
: '(No prior conversation in this session.)';
|
|
890
|
+
const userBlock = `## Conversation context\n\n${safeTranscript}\n\n---\n\n## Side question\n\n${question}`;
|
|
891
|
+
|
|
892
|
+
const sdkOptions = {
|
|
893
|
+
cwd: cwd || process.cwd(),
|
|
894
|
+
model: model || CLAUDE_MODELS.DEFAULT,
|
|
895
|
+
tools: [],
|
|
896
|
+
allowedTools: [],
|
|
897
|
+
settingSources: [],
|
|
898
|
+
systemPrompt: BTW_SYSTEM_PROMPT,
|
|
899
|
+
permissionMode: 'default',
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
const prevStreamTimeout = process.env.CLAUDE_CODE_STREAM_CLOSE_TIMEOUT;
|
|
903
|
+
process.env.CLAUDE_CODE_STREAM_CLOSE_TIMEOUT = '120000';
|
|
904
|
+
|
|
905
|
+
let answer = '';
|
|
906
|
+
let lastError = null;
|
|
907
|
+
|
|
908
|
+
try {
|
|
909
|
+
const queryInstance = query({
|
|
910
|
+
prompt: userBlock,
|
|
911
|
+
options: sdkOptions,
|
|
912
|
+
});
|
|
913
|
+
|
|
914
|
+
for await (const message of queryInstance) {
|
|
915
|
+
if (signal?.aborted) {
|
|
916
|
+
break;
|
|
917
|
+
}
|
|
918
|
+
if (message.type === 'result') {
|
|
919
|
+
if (message.subtype === 'success') {
|
|
920
|
+
answer = message.result || answer;
|
|
921
|
+
} else {
|
|
922
|
+
lastError = Array.isArray(message.errors) ? message.errors.join('\n') : 'Side question failed';
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
} catch (err) {
|
|
927
|
+
if (signal?.aborted) {
|
|
928
|
+
return { answer: '' };
|
|
929
|
+
}
|
|
930
|
+
throw new Error(err?.message || String(err));
|
|
931
|
+
} finally {
|
|
932
|
+
if (prevStreamTimeout !== undefined) {
|
|
933
|
+
process.env.CLAUDE_CODE_STREAM_CLOSE_TIMEOUT = prevStreamTimeout;
|
|
934
|
+
} else {
|
|
935
|
+
delete process.env.CLAUDE_CODE_STREAM_CLOSE_TIMEOUT;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
if (signal?.aborted) {
|
|
940
|
+
return { answer: '' };
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
if (lastError) {
|
|
944
|
+
throw new Error(lastError);
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
return { answer: answer || '' };
|
|
948
|
+
}
|
|
949
|
+
|
|
872
950
|
// Export public API
|
|
873
951
|
export {
|
|
874
952
|
queryClaudeSDK,
|
|
@@ -877,5 +955,6 @@ export {
|
|
|
877
955
|
getClaudeSDKSessionStartTime,
|
|
878
956
|
getActiveClaudeSDKSessions,
|
|
879
957
|
resolveToolApproval,
|
|
880
|
-
getContextWindowForModel
|
|
958
|
+
getContextWindowForModel,
|
|
959
|
+
runClaudeBtw,
|
|
881
960
|
};
|
package/server/cli-chat.js
CHANGED
|
@@ -14,6 +14,8 @@ import path from 'path';
|
|
|
14
14
|
import os from 'os';
|
|
15
15
|
import { exec } from 'child_process';
|
|
16
16
|
import { promisify } from 'util';
|
|
17
|
+
import spawnAsync from './utils/spawnAsync.js';
|
|
18
|
+
import { safePath } from './utils/safePath.js';
|
|
17
19
|
|
|
18
20
|
const execAsync = promisify(exec);
|
|
19
21
|
|
|
@@ -164,10 +166,9 @@ const TOOL_SCHEMAS = [
|
|
|
164
166
|
// ── Tool execution ────────────────────────────────────────────────────────────
|
|
165
167
|
|
|
166
168
|
async function executeTool(name, args, workingDir) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
};
|
|
169
|
+
// Constrain all paths to the project root to prevent LLM-driven
|
|
170
|
+
// prompt-injection attacks from reading/writing outside the workspace.
|
|
171
|
+
const resolve = (p) => safePath(p, workingDir);
|
|
171
172
|
const trunc = (s) =>
|
|
172
173
|
s.length <= MAX_OUTPUT_CHARS ? s : s.slice(0, MAX_OUTPUT_CHARS) + `\n…(truncated)`;
|
|
173
174
|
|
|
@@ -210,23 +211,33 @@ async function executeTool(name, args, workingDir) {
|
|
|
210
211
|
}
|
|
211
212
|
case 'Glob': {
|
|
212
213
|
const dir = resolve(args.path);
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
214
|
+
try {
|
|
215
|
+
const { stdout } = await spawnAsync('rg', ['--files', '--glob', args.pattern], {
|
|
216
|
+
cwd: dir, timeout: 30_000,
|
|
217
|
+
});
|
|
218
|
+
const lines = stdout.split('\n').filter(Boolean).slice(0, 300);
|
|
219
|
+
return trunc(lines.join('\n') || '(no matches)');
|
|
220
|
+
} catch {
|
|
221
|
+
try {
|
|
222
|
+
const { stdout } = await spawnAsync('find', ['.', '-name', args.pattern, '-type', 'f'], {
|
|
223
|
+
cwd: dir, timeout: 30_000,
|
|
224
|
+
});
|
|
225
|
+
const lines = stdout.split('\n').filter(Boolean).slice(0, 300);
|
|
226
|
+
return trunc(lines.join('\n') || '(no matches)');
|
|
227
|
+
} catch {
|
|
228
|
+
return '(no matches)';
|
|
229
|
+
}
|
|
230
|
+
}
|
|
222
231
|
}
|
|
223
232
|
case 'Grep': {
|
|
224
233
|
const target = resolve(args.path);
|
|
225
|
-
|
|
226
|
-
if (args.include)
|
|
227
|
-
|
|
234
|
+
const rgArgs = ['--line-number', '--max-count', '100', '--max-columns', '200'];
|
|
235
|
+
if (args.include) rgArgs.push('--glob', args.include);
|
|
236
|
+
rgArgs.push('-e', args.pattern, '--', target);
|
|
228
237
|
try {
|
|
229
|
-
const { stdout } = await
|
|
238
|
+
const { stdout } = await spawnAsync('rg', rgArgs, {
|
|
239
|
+
cwd: workingDir, timeout: 30_000,
|
|
240
|
+
});
|
|
230
241
|
return trunc(stdout || '(no matches)');
|
|
231
242
|
} catch (err) {
|
|
232
243
|
if (err.code === 1) return '(no matches)';
|
package/server/cli.js
CHANGED
|
@@ -57,6 +57,18 @@ const c = {
|
|
|
57
57
|
const packageJsonPath = path.join(__dirname, '../package.json');
|
|
58
58
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
59
59
|
|
|
60
|
+
function stripOptionalEnvQuotes(raw) {
|
|
61
|
+
const v = String(raw).trim();
|
|
62
|
+
if (v.length >= 2) {
|
|
63
|
+
const open = v[0];
|
|
64
|
+
const close = v[v.length - 1];
|
|
65
|
+
if ((open === '"' && close === '"') || (open === "'" && close === "'")) {
|
|
66
|
+
return v.slice(1, -1);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return v;
|
|
70
|
+
}
|
|
71
|
+
|
|
60
72
|
// Load environment variables from .env file if it exists
|
|
61
73
|
function loadEnvFile() {
|
|
62
74
|
try {
|
|
@@ -67,7 +79,7 @@ function loadEnvFile() {
|
|
|
67
79
|
if (trimmedLine && !trimmedLine.startsWith('#')) {
|
|
68
80
|
const [key, ...valueParts] = trimmedLine.split('=');
|
|
69
81
|
if (key && valueParts.length > 0 && !process.env[key]) {
|
|
70
|
-
process.env[key] = valueParts.join('=')
|
|
82
|
+
process.env[key] = stripOptionalEnvQuotes(valueParts.join('='));
|
|
71
83
|
}
|
|
72
84
|
}
|
|
73
85
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
["[runtime] Using python3 | Python 3.9.6 | /Library/Developer/CommandLineTools/usr/bin/python3","/Users/dingjiesong/Library/Python/3.9/lib/python/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020","warnings.warn(","11:54:21 [INFO] Loading config from: /Users/dingjiesong/Documents/workspace/ai-scientist/dr-claw/server/data/research_interests_arxiv.json","11:54:21 [INFO] Using current date: 2026-04-09","11:54:21 [INFO] Date windows:","11:54:21 [INFO] Recent 30 days: 2026-03-10 to 2026-04-09","11:54:21 [INFO] Past year (31-365 days): 2025-04-09 to 2026-03-09","11:54:21 [INFO] ======================================================================","11:54:21 [INFO] Step 1: Searching recent papers (last 30 days) from arXiv","11:54:21 [INFO] ======================================================================","11:54:21 [INFO] [arXiv] Searching papers from 2026-03-10 to 2026-04-09","11:54:22 [INFO] [arXiv] Found 200 papers","11:54:22 [INFO] Scored 200 recent papers","11:54:22 [INFO] Skipping Semantic Scholar hot paper search (disabled)","11:54:22 [INFO] ======================================================================","11:54:22 [INFO] Step 3: Merging and ranking results","11:54:22 [INFO] ======================================================================","11:54:22 [INFO] Total unique papers after deduplication: 200","11:54:22 [INFO] Results saved to: /Users/dingjiesong/Documents/workspace/ai-scientist/dr-claw/server/data/news-results-arxiv.json","11:54:22 [INFO] Top 10 papers:","11:54:22 [INFO] 1. TraceSafe: A Systematic Assessment of LLM Guardrails on Mult... (Score: 10.13)","11:54:22 [INFO] 2. Appear2Meaning: A Cross-Cultural Benchmark for Structured Cu... (Score: 8.93)","11:54:22 [INFO] 3. A Systematic Study of Retrieval Pipeline Design for Retrieva... (Score: 8.53)","11:54:22 [INFO] 4. Dynamic Context Evolution for Scalable Synthetic Data Genera... (Score: 8.53)","11:54:22 [INFO] 5. Strategic Persuasion with Trait-Conditioned Multi-Agent Syst... (Score: 8.4)","11:54:22 [INFO] 6. Personalized RewardBench: Evaluating Reward Models with Huma... (Score: 8.13)","11:54:22 [INFO] 7. AgentCity: Constitutional Governance for Autonomous Agent Ec... (Score: 8.0)","11:54:22 [INFO] 8. On the Step Length Confounding in LLM Reasoning Data Selecti... (Score: 7.87)","11:54:22 [INFO] 9. STRIDE-ED: A Strategy-Grounded Stepwise Reasoning Framework ... (Score: 7.73)","11:54:22 [INFO] 10. Differentiable Environment-Trajectory Co-Optimization for Sa... (Score: 7.6)"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
["[runtime] Using python3 | Python 3.9.6 | /Library/Developer/CommandLineTools/usr/bin/python3","/Users/dingjiesong/Library/Python/3.9/lib/python/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020","warnings.warn(","11:54:28 [INFO] No config provided — showing all HuggingFace Daily Papers","11:54:28 [INFO] Fetching HuggingFace Daily Papers...","11:54:28 [INFO] [HF] Fetched 50 daily paper entries","11:54:28 [INFO] Normalized 50 papers from 50 raw entries","11:54:28 [INFO] Scored 50 papers (0 filtered out by relevance/exclusion)","11:54:28 [INFO] Results saved to: /Users/dingjiesong/Documents/workspace/ai-scientist/dr-claw/server/data/news-results-huggingface.json","11:54:28 [INFO] Top 30 papers:","11:54:28 [INFO] 1. MegaTrain: Full Precision Training of 100B+ Parameter Large ... (Score: 6.09, Upvotes-based popularity: 2.22)","11:54:28 [INFO] 2. ThinkTwice: Jointly Optimizing Large Language Models for Rea... (Score: 6.08, Upvotes-based popularity: 1.98)","11:54:28 [INFO] 3. GBQA: A Game Benchmark for Evaluating LLMs as Quality Assura... (Score: 6.07, Upvotes-based popularity: 2.34)","11:54:28 [INFO] 4. RAGEN-2: Reasoning Collapse in Agentic RL... (Score: 6.0, Upvotes-based popularity: 2.4)","11:54:28 [INFO] 5. Vanast: Virtual Try-On with Human Image Animation via Synthe... (Score: 5.97, Upvotes-based popularity: 2.1)","11:54:28 [INFO] 6. Think in Strokes, Not Pixels: Process-Driven Image Generatio... (Score: 5.85, Upvotes-based popularity: 2.28)","11:54:28 [INFO] 7. Watch Before You Answer: Learning from Visually Grounded Pos... (Score: 5.62, Upvotes-based popularity: 1.62)","11:54:28 [INFO] 8. How Well Do Agentic Skills Work in the Wild: Benchmarking LL... (Score: 5.61, Upvotes-based popularity: 1.74)","11:54:28 [INFO] 9. In-Place Test-Time Training... (Score: 5.08, Upvotes-based popularity: 1.08)","11:54:28 [INFO] 10. SEVerA: Verified Synthesis of Self-Evolving Agents... (Score: 5.0, Upvotes-based popularity: 0.9)","11:54:28 [INFO] 11. MARS: Enabling Autoregressive Models Multi-Token Generation... (Score: 4.96, Upvotes-based popularity: 1.26)","11:54:28 [INFO] 12. INSPATIO-WORLD: A Real-Time 4D World Simulator via Spatiotem... (Score: 4.94, Upvotes-based popularity: 0.84)","11:54:28 [INFO] 13. Paper Circle: An Open-source Multi-agent Research Discovery ... (Score: 4.93, Upvotes-based popularity: 1.2)","11:54:28 [INFO] 14. General Multimodal Protein Design Enables DNA-Encoding of Ch... (Score: 4.81, Upvotes-based popularity: 1.38)","11:54:28 [INFO] 15. DARE: Diffusion Large Language Models Alignment and Reinforc... (Score: 4.71, Upvotes-based popularity: 1.08)","11:54:28 [INFO] 16. ClawsBench: Evaluating Capability and Safety of LLM Producti... (Score: 4.59, Upvotes-based popularity: 1.02)","11:54:28 [INFO] 17. TC-AE: Unlocking Token Capacity for Deep Compression Autoenc... (Score: 4.54, Upvotes-based popularity: 0.54)","11:54:28 [INFO] 18. MMEmb-R1: Reasoning-Enhanced Multimodal Embedding with Pair-... (Score: 4.52, Upvotes-based popularity: 0.42)","11:54:28 [INFO] 19. FP4 Explore, BF16 Train: Diffusion Reinforcement Learning vi... (Score: 4.42, Upvotes-based popularity: 0.42)","11:54:28 [INFO] 20. MedGemma 1.5 Technical Report... (Score: 4.41, Upvotes-based popularity: 0.54)","11:54:28 [INFO] 21. FlowInOne:Unifying Multimodal Generation as Image-in, Image-... (Score: 4.4, Upvotes-based popularity: 0.3)","11:54:28 [INFO] 22. Scientific Graphics Program Synthesis via Dual Self-Consiste... (Score: 4.28, Upvotes-based popularity: 0.18)","11:54:28 [INFO] 23. Graph-Based Chain-of-Thought Pruning for Reducing Redundant ... (Score: 4.23, Upvotes-based popularity: 0.36)","11:54:28 [INFO] 24. Experience Transfer for Multimodal LLM Agents in Minecraft G... (Score: 4.23, Upvotes-based popularity: 0.36)","11:54:28 [INFO] 25. AgentGL: Towards Agentic Graph Learning with LLMs via Reinfo... (Score: 4.22, Upvotes-based popularity: 0.12)","11:54:28 [INFO] 26. Learning to Hint for Reinforcement Learning... (Score: 4.18, Upvotes-based popularity: 0.18)","11:54:28 [INFO] 27. Personalized RewardBench: Evaluating Reward Models with Huma... (Score: 4.18, Upvotes-based popularity: 0.18)","11:54:28 [INFO] 28. REAM: Merging Improves Pruning of Experts in LLMs... (Score: 4.18, Upvotes-based popularity: 0.18)","11:54:28 [INFO] 29. Context-Value-Action Architecture for Value-Driven Large Lan... (Score: 4.18, Upvotes-based popularity: 0.18)","11:54:28 [INFO] 30. Action Images: End-to-End Policy Learning via Multiview Vide... (Score: 4.14, Upvotes-based popularity: 0.54)"]
|