@dmrlzz/davecode 0.0.0-stage → 0.3.0
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/LICENSE +21 -0
- package/README.md +33 -2
- package/bin/davecode.js +2 -0
- package/dist/ChatApp-FO5SABXB.js +893 -0
- package/dist/ChatApp-FO5SABXB.js.map +1 -0
- package/dist/RunnerView-DLVR7C22.js +18 -0
- package/dist/RunnerView-DLVR7C22.js.map +1 -0
- package/dist/accounts-MTMGYKEP.js +724 -0
- package/dist/accounts-MTMGYKEP.js.map +1 -0
- package/dist/budget-RBHCEDPP.js +115 -0
- package/dist/budget-RBHCEDPP.js.map +1 -0
- package/dist/chat-ZDXX3N6X.js +95 -0
- package/dist/chat-ZDXX3N6X.js.map +1 -0
- package/dist/chunk-23KTE7IK.js +114 -0
- package/dist/chunk-23KTE7IK.js.map +1 -0
- package/dist/chunk-7XVXEO7U.js +23 -0
- package/dist/chunk-7XVXEO7U.js.map +1 -0
- package/dist/chunk-BOLFK3BH.js +20 -0
- package/dist/chunk-BOLFK3BH.js.map +1 -0
- package/dist/chunk-C7FDRA3U.js +9087 -0
- package/dist/chunk-C7FDRA3U.js.map +1 -0
- package/dist/chunk-DYQ56FBT.js +47 -0
- package/dist/chunk-DYQ56FBT.js.map +1 -0
- package/dist/chunk-FRFSJMN4.js +79 -0
- package/dist/chunk-FRFSJMN4.js.map +1 -0
- package/dist/chunk-IC3TDONV.js +12 -0
- package/dist/chunk-IC3TDONV.js.map +1 -0
- package/dist/chunk-IVZHKUCD.js +180 -0
- package/dist/chunk-IVZHKUCD.js.map +1 -0
- package/dist/chunk-MSLLH5XP.js +213 -0
- package/dist/chunk-MSLLH5XP.js.map +1 -0
- package/dist/chunk-OXRMGR72.js +20 -0
- package/dist/chunk-OXRMGR72.js.map +1 -0
- package/dist/chunk-OYEYNDOO.js +200 -0
- package/dist/chunk-OYEYNDOO.js.map +1 -0
- package/dist/chunk-PIIJ3RSI.js +1610 -0
- package/dist/chunk-PIIJ3RSI.js.map +1 -0
- package/dist/chunk-SF5ZEAP4.js +105 -0
- package/dist/chunk-SF5ZEAP4.js.map +1 -0
- package/dist/chunk-VVCXGQMY.js +107 -0
- package/dist/chunk-VVCXGQMY.js.map +1 -0
- package/dist/config-FRMY5OHG.js +158 -0
- package/dist/config-FRMY5OHG.js.map +1 -0
- package/dist/dashboard/assets/Accounts-BR3ZfVk4.js +1 -0
- package/dist/dashboard/assets/Badge-B-qzNRrZ.js +55 -0
- package/dist/dashboard/assets/Callout-B9g_wPDi.js +1 -0
- package/dist/dashboard/assets/Field-BfabPEcY.js +1 -0
- package/dist/dashboard/assets/Goals-BsV-6m94.js +1 -0
- package/dist/dashboard/assets/Library-CEA9P1m-.js +1 -0
- package/dist/dashboard/assets/Markdown-ClRsddnB.js +69 -0
- package/dist/dashboard/assets/Panel-B9tSgX6l.js +1 -0
- package/dist/dashboard/assets/RoutesPage-Dh-BJ3ir.js +4 -0
- package/dist/dashboard/assets/Runner-C_e9l5l2.js +1 -0
- package/dist/dashboard/assets/Settings-C6Yc1Gjg.js +1 -0
- package/dist/dashboard/assets/Switch-CUpOJjUT.js +1 -0
- package/dist/dashboard/assets/Tasks-CTku0rR3.js +2 -0
- package/dist/dashboard/assets/Traffic-CE6wZSMr.js +1 -0
- package/dist/dashboard/assets/Workspace-CxFxvkA6.js +1 -0
- package/dist/dashboard/assets/arrow-up-DL3CuFOO.js +1 -0
- package/dist/dashboard/assets/forms-D6UIYgC5.js +1 -0
- package/dist/dashboard/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/dist/dashboard/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/dist/dashboard/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/dist/dashboard/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/dist/dashboard/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
- package/dist/dashboard/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
- package/dist/dashboard/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
- package/dist/dashboard/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
- package/dist/dashboard/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
- package/dist/dashboard/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
- package/dist/dashboard/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/dist/dashboard/assets/index-1iH716Xy.css +2 -0
- package/dist/dashboard/assets/index-BMWr9EKo.js +104 -0
- package/dist/dashboard/assets/task-errors-CE4oEr8H.js +1 -0
- package/dist/dashboard/assets/trash-CWqeZ7eg.js +1 -0
- package/dist/dashboard/favicon.svg +7 -0
- package/dist/dashboard/github.svg +1 -0
- package/dist/dashboard/index.html +31 -0
- package/dist/dist-ZPXEVBEC.js +357 -0
- package/dist/dist-ZPXEVBEC.js.map +1 -0
- package/dist/doctor-7RUD4D3A.js +279 -0
- package/dist/doctor-7RUD4D3A.js.map +1 -0
- package/dist/goal-JFRNPBSD.js +302 -0
- package/dist/goal-JFRNPBSD.js.map +1 -0
- package/dist/index.js +381 -0
- package/dist/index.js.map +1 -0
- package/dist/init-NFYNO3A3.js +194 -0
- package/dist/init-NFYNO3A3.js.map +1 -0
- package/dist/prompts-L37J72YW.js +215 -0
- package/dist/prompts-L37J72YW.js.map +1 -0
- package/dist/run-ARUPXFFB.js +376 -0
- package/dist/run-ARUPXFFB.js.map +1 -0
- package/dist/runner-state-QFU3LJVJ.js +17 -0
- package/dist/runner-state-QFU3LJVJ.js.map +1 -0
- package/dist/start-CFPOVIAR.js +285 -0
- package/dist/start-CFPOVIAR.js.map +1 -0
- package/dist/status-E4EACVE2.js +25 -0
- package/dist/status-E4EACVE2.js.map +1 -0
- package/dist/tasks-ZIK6BVEX.js +184 -0
- package/dist/tasks-ZIK6BVEX.js.map +1 -0
- package/package.json +68 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./Panel-B9tSgX6l.js";import{ft as t,pt as n}from"./Badge-B-qzNRrZ.js";var r={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};r.node;var i=e(r);function a(e){if(!n(e))return t(e);switch(e.code){case`brain_read_only`:return`This gateway exposes the project brain read-only, so the task graph cannot be edited here.`;case`no_brain`:return`No project is loaded. Start the gateway inside an initialised project (davecode init).`;case`cycle`:return e.cycle?`That would create a dependency cycle: ${e.cycle.join(` → `)}.`:e.message;case`has_dependents`:return e.dependents?.length?`Other tasks still depend on it: ${e.dependents.join(`, `)}. Remove those dependencies first.`:e.message;case`task_in_progress`:return`The task is in progress. Reopen it before deleting it.`;case`duplicate_id`:return`A task with this id already exists.`;case`invalid_transition`:return`The task cannot move to that status from its current one. ${e.message}`;case`config_invalid`:return`The global config file is not valid, so it was left untouched. ${e.message}`;default:return t(e)}}export{i as n,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./Panel-B9tSgX6l.js";var t={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};t.node;var n=e(t);export{n as t};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none">
|
|
2
|
+
<title>DaveCode</title>
|
|
3
|
+
<rect width="32" height="32" rx="7" fill="#0c0c0d"/>
|
|
4
|
+
<rect x="0.5" y="0.5" width="31" height="31" rx="6.5" stroke="#2a2a2e"/>
|
|
5
|
+
<path d="M10 9h5.5a7 7 0 0 1 0 14H10V9Z" stroke="#f0f0f2" stroke-width="2.25" stroke-linejoin="round"/>
|
|
6
|
+
<circle cx="22.5" cy="16" r="2.25" fill="#ff7a3d"/>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" data-theme="dark">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<meta name="color-scheme" content="dark light" />
|
|
7
|
+
<meta name="description" content="DaveCode dashboard: quota-aware AI gateway and autonomous coding engine." />
|
|
8
|
+
<link rel="icon" type="image/svg+xml" href="./favicon.svg" />
|
|
9
|
+
<title>DaveCode</title>
|
|
10
|
+
<script>
|
|
11
|
+
// Apply the stored theme before first paint to avoid a light/dark flash.
|
|
12
|
+
let storedTheme = null;
|
|
13
|
+
try {
|
|
14
|
+
storedTheme = localStorage.getItem('davecode.theme');
|
|
15
|
+
} catch (_) {}
|
|
16
|
+
if (storedTheme === 'system') {
|
|
17
|
+
storedTheme = matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
|
|
18
|
+
}
|
|
19
|
+
if (storedTheme === 'light' || storedTheme === 'dark') {
|
|
20
|
+
document.documentElement.dataset.theme = storedTheme;
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
<script type="module" crossorigin src="./assets/index-BMWr9EKo.js"></script>
|
|
24
|
+
<link rel="modulepreload" crossorigin href="./assets/Panel-B9tSgX6l.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="./assets/Badge-B-qzNRrZ.js">
|
|
26
|
+
<link rel="stylesheet" crossorigin href="./assets/index-1iH716Xy.css">
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<div id="root"></div>
|
|
30
|
+
</body>
|
|
31
|
+
</html>
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AccountRepository,
|
|
3
|
+
AnthropicProvider,
|
|
4
|
+
AuditLog,
|
|
5
|
+
AutonomousRunner,
|
|
6
|
+
BRAIN_DIR,
|
|
7
|
+
BudgetService,
|
|
8
|
+
BuiltinExecutor,
|
|
9
|
+
CLAUDE_CLI_INSTRUCTIONS,
|
|
10
|
+
CLI_LOGINS,
|
|
11
|
+
CONTEXT_TRUNCATION_MARKER,
|
|
12
|
+
ChromiumProfileManager,
|
|
13
|
+
ChromiumUnavailableError,
|
|
14
|
+
CircuitBreaker,
|
|
15
|
+
ClaudeCliExecutor,
|
|
16
|
+
ClaudeCliProvider,
|
|
17
|
+
CodexCliProvider,
|
|
18
|
+
CommandError,
|
|
19
|
+
ConfigError,
|
|
20
|
+
ConnectionChecker,
|
|
21
|
+
DAVECODE_SYSTEM_PROMPT,
|
|
22
|
+
DEFAULT_ALLOWED_COMMANDS,
|
|
23
|
+
DEFAULT_CONTEXT_BUDGET_CHARS,
|
|
24
|
+
DEFAULT_JEV_BASE_URL,
|
|
25
|
+
DEFAULT_JEV_MODEL,
|
|
26
|
+
DEFAULT_ROLES,
|
|
27
|
+
EXPERIMENTAL_PROVIDER_KINDS,
|
|
28
|
+
EventBus,
|
|
29
|
+
ExecutorAbortedError,
|
|
30
|
+
ExecutorError,
|
|
31
|
+
ExperimentalDisabledError,
|
|
32
|
+
GEMINI_CLI_SETTINGS,
|
|
33
|
+
GeminiCliProvider,
|
|
34
|
+
GeminiProvider,
|
|
35
|
+
GeminiWebProvider,
|
|
36
|
+
Git,
|
|
37
|
+
GitError,
|
|
38
|
+
GlobalBrain,
|
|
39
|
+
GoalError,
|
|
40
|
+
GoalOrchestrator,
|
|
41
|
+
GoalService,
|
|
42
|
+
GoalStore,
|
|
43
|
+
InvalidNoteNameError,
|
|
44
|
+
JevJudge,
|
|
45
|
+
JudgeError,
|
|
46
|
+
Keyring,
|
|
47
|
+
KeyringError,
|
|
48
|
+
LLM_JUDGE_PROMPT,
|
|
49
|
+
LlmJudge,
|
|
50
|
+
LockTimeoutError,
|
|
51
|
+
LoginError,
|
|
52
|
+
LoginService,
|
|
53
|
+
MIGRATIONS,
|
|
54
|
+
MeteredExecutor,
|
|
55
|
+
MissingBrainError,
|
|
56
|
+
NoneJudge,
|
|
57
|
+
OpenAICompatibleProvider,
|
|
58
|
+
OpenAIProvider,
|
|
59
|
+
PROVIDER_KINDS,
|
|
60
|
+
PathEscapeError,
|
|
61
|
+
ProjectBrain,
|
|
62
|
+
ProjectBrainSource,
|
|
63
|
+
ProviderError,
|
|
64
|
+
QUOTA_WINDOWS,
|
|
65
|
+
QuotaEngine,
|
|
66
|
+
READ_ONLY_GIT_SUBCOMMANDS,
|
|
67
|
+
READ_ONLY_TOOL_DEFINITIONS,
|
|
68
|
+
ROUTE_PREFIX,
|
|
69
|
+
ReportedLimitsStore,
|
|
70
|
+
Router,
|
|
71
|
+
RouterError,
|
|
72
|
+
RunnerCodeTasks,
|
|
73
|
+
RunnerError,
|
|
74
|
+
SUBSCRIPTION_PROVIDER_KINDS,
|
|
75
|
+
SandboxManager,
|
|
76
|
+
TASK_INSTRUCTIONS,
|
|
77
|
+
TASK_STATUSES,
|
|
78
|
+
TOOL_DEFINITIONS,
|
|
79
|
+
TaskGraphError,
|
|
80
|
+
UsageRepository,
|
|
81
|
+
UsageTracker,
|
|
82
|
+
VALIDATION_STEPS,
|
|
83
|
+
VERSION,
|
|
84
|
+
Validator,
|
|
85
|
+
WINDOW_MS,
|
|
86
|
+
WorkspaceLock,
|
|
87
|
+
WorkspaceTools,
|
|
88
|
+
acceptanceOf,
|
|
89
|
+
accountDir,
|
|
90
|
+
accountServes,
|
|
91
|
+
addTask,
|
|
92
|
+
applySafetyGuard,
|
|
93
|
+
approximateTokens,
|
|
94
|
+
assertSafeRef,
|
|
95
|
+
blockedTasks,
|
|
96
|
+
buildTaskContext,
|
|
97
|
+
canTransition,
|
|
98
|
+
checkRunnable,
|
|
99
|
+
cliBinaryFor,
|
|
100
|
+
commitMessage,
|
|
101
|
+
configSchema,
|
|
102
|
+
configuredModels,
|
|
103
|
+
connectionMethod,
|
|
104
|
+
countTextTokens,
|
|
105
|
+
createEngine,
|
|
106
|
+
createExecutor,
|
|
107
|
+
createGoalService,
|
|
108
|
+
createJudge,
|
|
109
|
+
createProviders,
|
|
110
|
+
createRunner,
|
|
111
|
+
davecodeHome,
|
|
112
|
+
deepMerge,
|
|
113
|
+
defaultModelFor,
|
|
114
|
+
dependentsOf,
|
|
115
|
+
envLayer,
|
|
116
|
+
errorKindFromStatus,
|
|
117
|
+
estimateTokens2,
|
|
118
|
+
extractJsonObject,
|
|
119
|
+
findCycles,
|
|
120
|
+
findProjectRoot,
|
|
121
|
+
geminiCliEnv,
|
|
122
|
+
geminiHomeEnv,
|
|
123
|
+
globalPaths,
|
|
124
|
+
goalSchema,
|
|
125
|
+
inferProviders,
|
|
126
|
+
initialTaskPrompt,
|
|
127
|
+
isFailoverEligible,
|
|
128
|
+
isGoalId,
|
|
129
|
+
isTerminalGoal,
|
|
130
|
+
limitsFor,
|
|
131
|
+
limitsFromHeaders,
|
|
132
|
+
llmVerdictSchema,
|
|
133
|
+
loadConfig,
|
|
134
|
+
loadMasterKey,
|
|
135
|
+
loginCommandFor,
|
|
136
|
+
loginEnv,
|
|
137
|
+
loginFromEnv,
|
|
138
|
+
migrate,
|
|
139
|
+
newId2,
|
|
140
|
+
nextTask,
|
|
141
|
+
openDatabase,
|
|
142
|
+
outboundAction,
|
|
143
|
+
parseModel,
|
|
144
|
+
parseRetryAfter,
|
|
145
|
+
parseTaskGraph,
|
|
146
|
+
projectOverridesRouting,
|
|
147
|
+
projectPaths,
|
|
148
|
+
readyGoalTasks,
|
|
149
|
+
readyTasks,
|
|
150
|
+
removeTask,
|
|
151
|
+
repairPrompt,
|
|
152
|
+
reportedFraction,
|
|
153
|
+
resolveCandidates,
|
|
154
|
+
resolveRepoPath,
|
|
155
|
+
resolveRoles,
|
|
156
|
+
routeModel,
|
|
157
|
+
routeSchema,
|
|
158
|
+
routeTargetSchema,
|
|
159
|
+
runProcess,
|
|
160
|
+
sanitizeNoteName,
|
|
161
|
+
schemaVersion,
|
|
162
|
+
seedGeminiHome,
|
|
163
|
+
selectClaudeAccount,
|
|
164
|
+
setTaskStatus,
|
|
165
|
+
spawnProbe,
|
|
166
|
+
splitCommand,
|
|
167
|
+
summarize,
|
|
168
|
+
summarizeValidation,
|
|
169
|
+
taskGraphSchema,
|
|
170
|
+
taskIdSchema,
|
|
171
|
+
topologicalOrder,
|
|
172
|
+
truncateHead,
|
|
173
|
+
truncateTail,
|
|
174
|
+
updateTask,
|
|
175
|
+
validateTaskGraph,
|
|
176
|
+
withFileLock,
|
|
177
|
+
writeGlobalRouting
|
|
178
|
+
} from "./chunk-C7FDRA3U.js";
|
|
179
|
+
export {
|
|
180
|
+
AccountRepository,
|
|
181
|
+
AnthropicProvider,
|
|
182
|
+
AuditLog,
|
|
183
|
+
AutonomousRunner,
|
|
184
|
+
BRAIN_DIR,
|
|
185
|
+
BudgetService,
|
|
186
|
+
BuiltinExecutor,
|
|
187
|
+
CLAUDE_CLI_INSTRUCTIONS,
|
|
188
|
+
CLI_LOGINS,
|
|
189
|
+
CONTEXT_TRUNCATION_MARKER,
|
|
190
|
+
ChromiumProfileManager,
|
|
191
|
+
ChromiumUnavailableError,
|
|
192
|
+
CircuitBreaker,
|
|
193
|
+
ClaudeCliExecutor,
|
|
194
|
+
ClaudeCliProvider,
|
|
195
|
+
CodexCliProvider,
|
|
196
|
+
CommandError,
|
|
197
|
+
ConfigError,
|
|
198
|
+
ConnectionChecker,
|
|
199
|
+
DAVECODE_SYSTEM_PROMPT,
|
|
200
|
+
DEFAULT_ALLOWED_COMMANDS,
|
|
201
|
+
DEFAULT_CONTEXT_BUDGET_CHARS,
|
|
202
|
+
DEFAULT_JEV_BASE_URL,
|
|
203
|
+
DEFAULT_JEV_MODEL,
|
|
204
|
+
DEFAULT_ROLES,
|
|
205
|
+
EXPERIMENTAL_PROVIDER_KINDS,
|
|
206
|
+
EventBus,
|
|
207
|
+
ExecutorAbortedError,
|
|
208
|
+
ExecutorError,
|
|
209
|
+
ExperimentalDisabledError,
|
|
210
|
+
GEMINI_CLI_SETTINGS,
|
|
211
|
+
GeminiCliProvider,
|
|
212
|
+
GeminiProvider,
|
|
213
|
+
GeminiWebProvider,
|
|
214
|
+
Git,
|
|
215
|
+
GitError,
|
|
216
|
+
GlobalBrain,
|
|
217
|
+
GoalError,
|
|
218
|
+
GoalOrchestrator,
|
|
219
|
+
GoalService,
|
|
220
|
+
GoalStore,
|
|
221
|
+
InvalidNoteNameError,
|
|
222
|
+
JevJudge,
|
|
223
|
+
JudgeError,
|
|
224
|
+
Keyring,
|
|
225
|
+
KeyringError,
|
|
226
|
+
LLM_JUDGE_PROMPT,
|
|
227
|
+
LlmJudge,
|
|
228
|
+
LockTimeoutError,
|
|
229
|
+
LoginError,
|
|
230
|
+
LoginService,
|
|
231
|
+
MIGRATIONS,
|
|
232
|
+
MeteredExecutor,
|
|
233
|
+
MissingBrainError,
|
|
234
|
+
NoneJudge,
|
|
235
|
+
OpenAICompatibleProvider,
|
|
236
|
+
OpenAIProvider,
|
|
237
|
+
PROVIDER_KINDS,
|
|
238
|
+
PathEscapeError,
|
|
239
|
+
ProjectBrain,
|
|
240
|
+
ProjectBrainSource,
|
|
241
|
+
ProviderError,
|
|
242
|
+
QUOTA_WINDOWS,
|
|
243
|
+
QuotaEngine,
|
|
244
|
+
READ_ONLY_GIT_SUBCOMMANDS,
|
|
245
|
+
READ_ONLY_TOOL_DEFINITIONS,
|
|
246
|
+
ROUTE_PREFIX,
|
|
247
|
+
ReportedLimitsStore,
|
|
248
|
+
Router,
|
|
249
|
+
RouterError,
|
|
250
|
+
RunnerCodeTasks,
|
|
251
|
+
RunnerError,
|
|
252
|
+
SUBSCRIPTION_PROVIDER_KINDS,
|
|
253
|
+
SandboxManager,
|
|
254
|
+
TASK_INSTRUCTIONS,
|
|
255
|
+
TASK_STATUSES,
|
|
256
|
+
TOOL_DEFINITIONS,
|
|
257
|
+
TaskGraphError,
|
|
258
|
+
UsageRepository,
|
|
259
|
+
UsageTracker,
|
|
260
|
+
VALIDATION_STEPS,
|
|
261
|
+
VERSION,
|
|
262
|
+
Validator,
|
|
263
|
+
WINDOW_MS,
|
|
264
|
+
WorkspaceLock,
|
|
265
|
+
WorkspaceTools,
|
|
266
|
+
acceptanceOf,
|
|
267
|
+
accountDir,
|
|
268
|
+
accountServes,
|
|
269
|
+
addTask,
|
|
270
|
+
applySafetyGuard,
|
|
271
|
+
approximateTokens,
|
|
272
|
+
assertSafeRef,
|
|
273
|
+
blockedTasks,
|
|
274
|
+
buildTaskContext,
|
|
275
|
+
canTransition,
|
|
276
|
+
checkRunnable,
|
|
277
|
+
cliBinaryFor,
|
|
278
|
+
commitMessage,
|
|
279
|
+
configSchema,
|
|
280
|
+
configuredModels,
|
|
281
|
+
connectionMethod,
|
|
282
|
+
countTextTokens,
|
|
283
|
+
createEngine,
|
|
284
|
+
createExecutor,
|
|
285
|
+
createGoalService,
|
|
286
|
+
createJudge,
|
|
287
|
+
createProviders,
|
|
288
|
+
createRunner,
|
|
289
|
+
davecodeHome,
|
|
290
|
+
deepMerge,
|
|
291
|
+
defaultModelFor,
|
|
292
|
+
dependentsOf,
|
|
293
|
+
envLayer,
|
|
294
|
+
errorKindFromStatus,
|
|
295
|
+
estimateTokens2 as estimateTokens,
|
|
296
|
+
extractJsonObject,
|
|
297
|
+
findCycles,
|
|
298
|
+
findProjectRoot,
|
|
299
|
+
geminiCliEnv,
|
|
300
|
+
geminiHomeEnv,
|
|
301
|
+
globalPaths,
|
|
302
|
+
goalSchema,
|
|
303
|
+
inferProviders,
|
|
304
|
+
initialTaskPrompt,
|
|
305
|
+
isFailoverEligible,
|
|
306
|
+
isGoalId,
|
|
307
|
+
isTerminalGoal,
|
|
308
|
+
limitsFor,
|
|
309
|
+
limitsFromHeaders,
|
|
310
|
+
llmVerdictSchema,
|
|
311
|
+
loadConfig,
|
|
312
|
+
loadMasterKey,
|
|
313
|
+
loginCommandFor,
|
|
314
|
+
loginEnv,
|
|
315
|
+
loginFromEnv,
|
|
316
|
+
migrate,
|
|
317
|
+
newId2 as newId,
|
|
318
|
+
nextTask,
|
|
319
|
+
openDatabase,
|
|
320
|
+
outboundAction,
|
|
321
|
+
parseModel,
|
|
322
|
+
parseRetryAfter,
|
|
323
|
+
parseTaskGraph,
|
|
324
|
+
projectOverridesRouting,
|
|
325
|
+
projectPaths,
|
|
326
|
+
readyGoalTasks,
|
|
327
|
+
readyTasks,
|
|
328
|
+
removeTask,
|
|
329
|
+
repairPrompt,
|
|
330
|
+
reportedFraction,
|
|
331
|
+
resolveCandidates,
|
|
332
|
+
resolveRepoPath,
|
|
333
|
+
resolveRoles,
|
|
334
|
+
routeModel,
|
|
335
|
+
routeSchema,
|
|
336
|
+
routeTargetSchema,
|
|
337
|
+
runProcess,
|
|
338
|
+
sanitizeNoteName,
|
|
339
|
+
schemaVersion,
|
|
340
|
+
seedGeminiHome,
|
|
341
|
+
selectClaudeAccount,
|
|
342
|
+
setTaskStatus,
|
|
343
|
+
spawnProbe,
|
|
344
|
+
splitCommand,
|
|
345
|
+
summarize,
|
|
346
|
+
summarizeValidation,
|
|
347
|
+
taskGraphSchema,
|
|
348
|
+
taskIdSchema,
|
|
349
|
+
topologicalOrder,
|
|
350
|
+
truncateHead,
|
|
351
|
+
truncateTail,
|
|
352
|
+
updateTask,
|
|
353
|
+
validateTaskGraph,
|
|
354
|
+
withFileLock,
|
|
355
|
+
writeGlobalRouting
|
|
356
|
+
};
|
|
357
|
+
//# sourceMappingURL=dist-ZPXEVBEC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import {
|
|
2
|
+
padEnd
|
|
3
|
+
} from "./chunk-SF5ZEAP4.js";
|
|
4
|
+
import {
|
|
5
|
+
printJson
|
|
6
|
+
} from "./chunk-DYQ56FBT.js";
|
|
7
|
+
import "./chunk-VVCXGQMY.js";
|
|
8
|
+
import {
|
|
9
|
+
GatewayClient,
|
|
10
|
+
connectHost,
|
|
11
|
+
detectProjectRoot,
|
|
12
|
+
resolveDashboardDir,
|
|
13
|
+
which
|
|
14
|
+
} from "./chunk-PIIJ3RSI.js";
|
|
15
|
+
import {
|
|
16
|
+
EXIT
|
|
17
|
+
} from "./chunk-7XVXEO7U.js";
|
|
18
|
+
import {
|
|
19
|
+
loadConfig,
|
|
20
|
+
openDatabase
|
|
21
|
+
} from "./chunk-C7FDRA3U.js";
|
|
22
|
+
|
|
23
|
+
// src/commands/doctor.ts
|
|
24
|
+
import { existsSync } from "fs";
|
|
25
|
+
import { mkdir, rm, writeFile } from "fs/promises";
|
|
26
|
+
import { createServer } from "net";
|
|
27
|
+
import { join } from "path";
|
|
28
|
+
var MIN_NODE = [22, 12];
|
|
29
|
+
function nodeVersionOk(version) {
|
|
30
|
+
const [major = 0, minor = 0] = version.replace(/^v/, "").split(".").map(Number);
|
|
31
|
+
return major > MIN_NODE[0] || major === MIN_NODE[0] && minor >= MIN_NODE[1];
|
|
32
|
+
}
|
|
33
|
+
async function runDoctor(input, probes) {
|
|
34
|
+
const results = [];
|
|
35
|
+
const add = (r) => results.push(r);
|
|
36
|
+
add(
|
|
37
|
+
nodeVersionOk(probes.nodeVersion) ? { id: "node", label: "Node.js", status: "ok", detail: probes.nodeVersion } : {
|
|
38
|
+
id: "node",
|
|
39
|
+
label: "Node.js",
|
|
40
|
+
status: "fail",
|
|
41
|
+
detail: `${probes.nodeVersion} (needs ${MIN_NODE.join(".")}+)`,
|
|
42
|
+
fix: "Install Node.js 22.12 or newer: https://nodejs.org"
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
let config;
|
|
46
|
+
try {
|
|
47
|
+
config = probes.loadConfig();
|
|
48
|
+
add({ id: "config", label: "Config", status: "ok", detail: "valid" });
|
|
49
|
+
} catch (err) {
|
|
50
|
+
add({
|
|
51
|
+
id: "config",
|
|
52
|
+
label: "Config",
|
|
53
|
+
status: "fail",
|
|
54
|
+
detail: err.message.split("\n").slice(0, 3).join(" "),
|
|
55
|
+
fix: "Fix the file named above; `davecode config path` lists every config location."
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
add({ id: "sqlite", label: "better-sqlite3", status: "ok", detail: await probes.loadSqlite() });
|
|
60
|
+
} catch (err) {
|
|
61
|
+
add({
|
|
62
|
+
id: "sqlite",
|
|
63
|
+
label: "better-sqlite3",
|
|
64
|
+
status: "fail",
|
|
65
|
+
detail: `cannot load: ${err.message.split("\n")[0]}`,
|
|
66
|
+
fix: "Rebuild the native module: pnpm rebuild better-sqlite3 (needs a C++ toolchain if no prebuilt binary matches your Node version)."
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
await probes.checkWritable(input.home);
|
|
71
|
+
add({ id: "home", label: "Home directory", status: "ok", detail: `${input.home} is writable` });
|
|
72
|
+
} catch (err) {
|
|
73
|
+
add({
|
|
74
|
+
id: "home",
|
|
75
|
+
label: "Home directory",
|
|
76
|
+
status: "fail",
|
|
77
|
+
detail: `${input.home} is not writable (${err.code ?? err.message})`,
|
|
78
|
+
fix: "Fix the permissions or point DaveCode elsewhere with --home <dir> / DAVECODE_HOME."
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const keyPath = join(input.home, "master.key");
|
|
82
|
+
if (input.env.DAVECODE_MASTER_KEY) {
|
|
83
|
+
add({
|
|
84
|
+
id: "master-key",
|
|
85
|
+
label: "Master key",
|
|
86
|
+
status: "ok",
|
|
87
|
+
detail: "from DAVECODE_MASTER_KEY"
|
|
88
|
+
});
|
|
89
|
+
} else if (probes.exists(keyPath)) {
|
|
90
|
+
add({ id: "master-key", label: "Master key", status: "ok", detail: keyPath });
|
|
91
|
+
} else {
|
|
92
|
+
add({
|
|
93
|
+
id: "master-key",
|
|
94
|
+
label: "Master key",
|
|
95
|
+
status: "warn",
|
|
96
|
+
detail: "not created yet",
|
|
97
|
+
fix: "It is generated on first use (davecode start or accounts add). Back it up: without it stored secrets cannot be decrypted."
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (config) {
|
|
101
|
+
const { host, port, authToken } = config.server;
|
|
102
|
+
const baseUrl = `http://${connectHost(host)}:${port}`;
|
|
103
|
+
if (!await probes.portInUse(host, port)) {
|
|
104
|
+
add({ id: "port", label: "Gateway port", status: "ok", detail: `${host}:${port} is free` });
|
|
105
|
+
} else {
|
|
106
|
+
const version = await probes.gatewayVersion(baseUrl, authToken);
|
|
107
|
+
add(
|
|
108
|
+
version ? {
|
|
109
|
+
id: "port",
|
|
110
|
+
label: "Gateway port",
|
|
111
|
+
status: "ok",
|
|
112
|
+
detail: `DaveCode ${version} is already running at ${baseUrl}`
|
|
113
|
+
} : {
|
|
114
|
+
id: "port",
|
|
115
|
+
label: "Gateway port",
|
|
116
|
+
status: "fail",
|
|
117
|
+
detail: `${host}:${port} is used by another program`,
|
|
118
|
+
fix: `Stop it, or use another port: davecode start --port ${port + 1} (or DAVECODE_PORT).`
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
const tools = [
|
|
124
|
+
{
|
|
125
|
+
cmd: "git",
|
|
126
|
+
label: "git",
|
|
127
|
+
required: true,
|
|
128
|
+
why: "needed by the autonomous runner (task branches and merges)",
|
|
129
|
+
fix: "Install git: https://git-scm.com/downloads"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
cmd: "claude",
|
|
133
|
+
label: "Claude Code CLI",
|
|
134
|
+
required: false,
|
|
135
|
+
why: "only for claude-cli accounts",
|
|
136
|
+
fix: "npm install -g @anthropic-ai/claude-code"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
cmd: "codex",
|
|
140
|
+
label: "Codex CLI",
|
|
141
|
+
required: false,
|
|
142
|
+
why: "only for codex-cli accounts",
|
|
143
|
+
fix: "npm install -g @openai/codex"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
cmd: "gemini",
|
|
147
|
+
label: "Gemini CLI",
|
|
148
|
+
required: false,
|
|
149
|
+
why: "only for gemini-cli accounts",
|
|
150
|
+
fix: "npm install -g @google/gemini-cli"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
cmd: "gh",
|
|
154
|
+
label: "GitHub CLI",
|
|
155
|
+
required: false,
|
|
156
|
+
why: "optional, for opening pull requests",
|
|
157
|
+
fix: "Install gh: https://cli.github.com"
|
|
158
|
+
}
|
|
159
|
+
];
|
|
160
|
+
for (const tool of tools) {
|
|
161
|
+
const path = probes.which(tool.cmd);
|
|
162
|
+
add(
|
|
163
|
+
path ? { id: tool.cmd, label: tool.label, status: "ok", detail: path } : {
|
|
164
|
+
id: tool.cmd,
|
|
165
|
+
label: tool.label,
|
|
166
|
+
status: tool.required ? "fail" : "warn",
|
|
167
|
+
detail: `not found on PATH (${tool.why})`,
|
|
168
|
+
fix: tool.fix
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
const dashboard = probes.dashboardDir();
|
|
173
|
+
add(
|
|
174
|
+
dashboard ? { id: "dashboard", label: "Dashboard build", status: "ok", detail: dashboard } : {
|
|
175
|
+
id: "dashboard",
|
|
176
|
+
label: "Dashboard build",
|
|
177
|
+
status: "warn",
|
|
178
|
+
detail: "not built (the gateway still works without it)",
|
|
179
|
+
fix: "pnpm --filter @davecode/ui build"
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
return results;
|
|
183
|
+
}
|
|
184
|
+
function portInUse(host, port) {
|
|
185
|
+
return new Promise((resolve) => {
|
|
186
|
+
const server = createServer();
|
|
187
|
+
server.once("error", (err) => {
|
|
188
|
+
resolve(err.code === "EADDRINUSE" || err.code === "EACCES");
|
|
189
|
+
});
|
|
190
|
+
server.listen({ host, port, exclusive: true }, () => {
|
|
191
|
+
server.close(() => resolve(false));
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
function defaultProbes(ctx, projectRoot) {
|
|
196
|
+
return {
|
|
197
|
+
nodeVersion: process.version,
|
|
198
|
+
loadConfig: () => loadConfig({ home: ctx.home, env: ctx.env, ...projectRoot ? { projectRoot } : {} }),
|
|
199
|
+
async loadSqlite() {
|
|
200
|
+
const db = openDatabase(":memory:");
|
|
201
|
+
try {
|
|
202
|
+
const row = db.prepare("select sqlite_version() as v").get();
|
|
203
|
+
return `loads (SQLite ${row.v})`;
|
|
204
|
+
} finally {
|
|
205
|
+
db.close();
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
async checkWritable(dir) {
|
|
209
|
+
await mkdir(dir, { recursive: true });
|
|
210
|
+
const probe = join(dir, `.doctor-${process.pid}.tmp`);
|
|
211
|
+
await writeFile(probe, "ok");
|
|
212
|
+
await rm(probe, { force: true });
|
|
213
|
+
},
|
|
214
|
+
exists: existsSync,
|
|
215
|
+
portInUse,
|
|
216
|
+
async gatewayVersion(baseUrl, token) {
|
|
217
|
+
const client = new GatewayClient({ baseUrl, ...token ? { token } : {} });
|
|
218
|
+
try {
|
|
219
|
+
return (await client.health(800))?.version;
|
|
220
|
+
} catch {
|
|
221
|
+
return void 0;
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
which: (cmd) => which(cmd, ctx.env),
|
|
225
|
+
async reachable(url) {
|
|
226
|
+
try {
|
|
227
|
+
await fetch(url, { signal: AbortSignal.timeout(800) });
|
|
228
|
+
return true;
|
|
229
|
+
} catch {
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
dashboardDir: () => resolveDashboardDir(ctx.env)
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
function renderDoctor(ctx, results) {
|
|
237
|
+
const { theme } = ctx;
|
|
238
|
+
const lines = [theme.bold(theme.accent("DaveCode doctor")), ""];
|
|
239
|
+
const width = Math.max(...results.map((r) => r.label.length)) + 2;
|
|
240
|
+
for (const r of results) {
|
|
241
|
+
const mark = r.status === "ok" ? theme.ok(theme.glyph.ok) : r.status === "warn" ? theme.warn(theme.glyph.warn) : theme.error(theme.glyph.fail);
|
|
242
|
+
const detail = r.status === "ok" ? theme.dim(r.detail) : r.detail;
|
|
243
|
+
lines.push(` ${mark} ${padEnd(r.label, width)} ${detail}`);
|
|
244
|
+
if (r.fix && r.status !== "ok")
|
|
245
|
+
lines.push(` ${" ".repeat(width)}${theme.dim(`fix: ${r.fix}`)}`);
|
|
246
|
+
}
|
|
247
|
+
const count = (s) => results.filter((r) => r.status === s).length;
|
|
248
|
+
const fails = count("fail");
|
|
249
|
+
const warns = count("warn");
|
|
250
|
+
lines.push("");
|
|
251
|
+
lines.push(
|
|
252
|
+
[
|
|
253
|
+
theme.ok(`${count("ok")} ok`),
|
|
254
|
+
warns ? theme.warn(`${warns} warning${warns === 1 ? "" : "s"}`) : `${warns} warnings`,
|
|
255
|
+
fails ? theme.error(`${fails} failure${fails === 1 ? "" : "s"}`) : "0 failures"
|
|
256
|
+
].join(theme.dim(" \xB7 "))
|
|
257
|
+
);
|
|
258
|
+
return lines;
|
|
259
|
+
}
|
|
260
|
+
async function doctorCommand(ctx, probes) {
|
|
261
|
+
const projectRoot = await detectProjectRoot(ctx.cwd, ctx.home);
|
|
262
|
+
const merged = { ...defaultProbes(ctx, projectRoot), ...probes };
|
|
263
|
+
const results = await runDoctor({ home: ctx.home, env: ctx.env }, merged);
|
|
264
|
+
const failed = results.some((r) => r.status === "fail");
|
|
265
|
+
if (ctx.json) {
|
|
266
|
+
printJson(ctx, { ok: !failed, checks: results });
|
|
267
|
+
} else {
|
|
268
|
+
for (const line of renderDoctor(ctx, results)) ctx.out(line);
|
|
269
|
+
}
|
|
270
|
+
return failed ? EXIT.failure : EXIT.ok;
|
|
271
|
+
}
|
|
272
|
+
export {
|
|
273
|
+
defaultProbes,
|
|
274
|
+
doctorCommand,
|
|
275
|
+
nodeVersionOk,
|
|
276
|
+
renderDoctor,
|
|
277
|
+
runDoctor
|
|
278
|
+
};
|
|
279
|
+
//# sourceMappingURL=doctor-7RUD4D3A.js.map
|