erosolar-cli 1.0.1
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/ARCHITECTURE.json +157 -0
- package/Agents.md +207 -0
- package/LICENSE +21 -0
- package/SOURCE_OF_TRUTH.json +103 -0
- package/dist/adapters/browser/index.js +10 -0
- package/dist/adapters/node/index.js +34 -0
- package/dist/adapters/remote/index.js +19 -0
- package/dist/adapters/types.js +1 -0
- package/dist/bin/erosolar.js +6 -0
- package/dist/capabilities/bashCapability.js +23 -0
- package/dist/capabilities/filesystemCapability.js +23 -0
- package/dist/capabilities/index.js +3 -0
- package/dist/capabilities/searchCapability.js +23 -0
- package/dist/capabilities/tavilyCapability.js +26 -0
- package/dist/capabilities/toolRegistry.js +98 -0
- package/dist/config.js +60 -0
- package/dist/contracts/v1/agent.js +7 -0
- package/dist/contracts/v1/provider.js +6 -0
- package/dist/contracts/v1/tool.js +6 -0
- package/dist/core/agent.js +135 -0
- package/dist/core/agentProfiles.js +34 -0
- package/dist/core/contextWindow.js +29 -0
- package/dist/core/errors/apiKeyErrors.js +114 -0
- package/dist/core/preferences.js +157 -0
- package/dist/core/secretStore.js +143 -0
- package/dist/core/toolRuntime.js +180 -0
- package/dist/core/types.js +1 -0
- package/dist/plugins/providers/anthropic/index.js +24 -0
- package/dist/plugins/providers/deepseek/index.js +24 -0
- package/dist/plugins/providers/google/index.js +25 -0
- package/dist/plugins/providers/index.js +17 -0
- package/dist/plugins/providers/openai/index.js +25 -0
- package/dist/plugins/providers/xai/index.js +24 -0
- package/dist/plugins/tools/bash/localBashPlugin.js +13 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js +13 -0
- package/dist/plugins/tools/index.js +2 -0
- package/dist/plugins/tools/nodeDefaults.js +16 -0
- package/dist/plugins/tools/registry.js +57 -0
- package/dist/plugins/tools/search/localSearchPlugin.js +13 -0
- package/dist/plugins/tools/tavily/tavilyPlugin.js +16 -0
- package/dist/providers/anthropicProvider.js +218 -0
- package/dist/providers/googleProvider.js +193 -0
- package/dist/providers/openaiChatCompletionsProvider.js +148 -0
- package/dist/providers/openaiResponsesProvider.js +182 -0
- package/dist/providers/providerFactory.js +21 -0
- package/dist/runtime/agentHost.js +152 -0
- package/dist/runtime/agentSession.js +65 -0
- package/dist/runtime/browser.js +9 -0
- package/dist/runtime/cloud.js +9 -0
- package/dist/runtime/node.js +10 -0
- package/dist/runtime/universal.js +28 -0
- package/dist/shell/__tests__/bracketedPasteManager.test.js +35 -0
- package/dist/shell/bracketedPasteManager.js +75 -0
- package/dist/shell/interactiveShell.js +1426 -0
- package/dist/shell/shellApp.js +392 -0
- package/dist/tools/bashTools.js +117 -0
- package/dist/tools/diffUtils.js +137 -0
- package/dist/tools/fileTools.js +232 -0
- package/dist/tools/searchTools.js +175 -0
- package/dist/tools/tavilyTools.js +176 -0
- package/dist/ui/__tests__/richText.test.js +36 -0
- package/dist/ui/codeHighlighter.js +843 -0
- package/dist/ui/designSystem.js +98 -0
- package/dist/ui/display.js +731 -0
- package/dist/ui/layout.js +108 -0
- package/dist/ui/richText.js +318 -0
- package/dist/ui/theme.js +91 -0
- package/dist/workspace.js +44 -0
- package/package.json +62 -0
- package/scripts/preinstall-clean-bins.mjs +66 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { icons, theme } from './theme.js';
|
|
2
|
+
import { getContentWidth, normalizePanelWidth, renderPanel, wrapParagraph, measure, } from './layout.js';
|
|
3
|
+
const toneColors = {
|
|
4
|
+
neutral: theme.ui.text,
|
|
5
|
+
info: theme.info,
|
|
6
|
+
success: theme.success,
|
|
7
|
+
warning: theme.warning,
|
|
8
|
+
danger: theme.error,
|
|
9
|
+
accent: theme.secondary,
|
|
10
|
+
};
|
|
11
|
+
export function renderStatusBar(segments, options = {}) {
|
|
12
|
+
if (!segments.length) {
|
|
13
|
+
return '';
|
|
14
|
+
}
|
|
15
|
+
const width = clampWidth(options.width ?? getContentWidth());
|
|
16
|
+
const divider = theme.ui.muted(` ${icons.bullet} `);
|
|
17
|
+
const chunks = segments
|
|
18
|
+
.filter((segment) => Boolean(segment.label?.trim() && segment.value?.trim()))
|
|
19
|
+
.map((segment) => formatStatusChunk(segment));
|
|
20
|
+
if (!chunks.length) {
|
|
21
|
+
return '';
|
|
22
|
+
}
|
|
23
|
+
const lines = [];
|
|
24
|
+
let current = '';
|
|
25
|
+
const pushChunk = (chunk) => {
|
|
26
|
+
if (!current) {
|
|
27
|
+
current = chunk;
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const candidate = `${current}${divider}${chunk}`;
|
|
31
|
+
if (measure(candidate) > width) {
|
|
32
|
+
lines.push(padLine(current, width));
|
|
33
|
+
current = chunk;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
current = candidate;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
chunks.forEach(pushChunk);
|
|
40
|
+
if (current) {
|
|
41
|
+
lines.push(padLine(current, width));
|
|
42
|
+
}
|
|
43
|
+
return lines.join('\n');
|
|
44
|
+
}
|
|
45
|
+
export function renderCallout(message, options = {}) {
|
|
46
|
+
const width = options.width ?? getContentWidth();
|
|
47
|
+
const tone = options.tone ?? 'info';
|
|
48
|
+
const icon = options.icon ?? icons.info;
|
|
49
|
+
const title = options.title ?? capitalize(tone);
|
|
50
|
+
const accent = toneColors[tone] ?? toneColors.info;
|
|
51
|
+
const paragraphs = wrapParagraph(message, Math.max(24, normalizePanelWidth(width) - 4));
|
|
52
|
+
return renderPanel(paragraphs, {
|
|
53
|
+
icon,
|
|
54
|
+
title,
|
|
55
|
+
accentColor: accent,
|
|
56
|
+
borderColor: accent,
|
|
57
|
+
width,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
export function renderSectionHeading(title, options = {}) {
|
|
61
|
+
const width = clampWidth(options.width ?? getContentWidth());
|
|
62
|
+
const accent = toneColors[options.tone ?? 'accent'] ?? toneColors.accent;
|
|
63
|
+
const icon = options.icon ? `${options.icon} ` : '';
|
|
64
|
+
const label = `${icon}${title}`.toUpperCase();
|
|
65
|
+
const underline = accent('━'.repeat(width));
|
|
66
|
+
const subtitle = options.subtitle?.trim()
|
|
67
|
+
? `${theme.ui.muted(options.subtitle.trim())}`
|
|
68
|
+
: '';
|
|
69
|
+
const lines = [underline, accent(padLine(label, width))];
|
|
70
|
+
if (subtitle) {
|
|
71
|
+
lines.push(padLine(subtitle, width));
|
|
72
|
+
}
|
|
73
|
+
return lines.join('\n');
|
|
74
|
+
}
|
|
75
|
+
function formatStatusChunk(segment) {
|
|
76
|
+
const tone = toneColors[segment.tone ?? 'neutral'] ?? toneColors.neutral;
|
|
77
|
+
const icon = segment.icon ? `${tone(segment.icon)} ` : '';
|
|
78
|
+
const label = theme.ui.muted(segment.label.trim().toUpperCase());
|
|
79
|
+
const value = tone(segment.value.trim());
|
|
80
|
+
return `${icon}${label} ${value}`;
|
|
81
|
+
}
|
|
82
|
+
function padLine(text, width) {
|
|
83
|
+
const visible = measure(text);
|
|
84
|
+
if (visible >= width) {
|
|
85
|
+
return text;
|
|
86
|
+
}
|
|
87
|
+
return `${text}${' '.repeat(width - visible)}`;
|
|
88
|
+
}
|
|
89
|
+
function clampWidth(value) {
|
|
90
|
+
const normalized = Math.max(32, Math.floor(value));
|
|
91
|
+
return Math.min(120, normalized);
|
|
92
|
+
}
|
|
93
|
+
function capitalize(value) {
|
|
94
|
+
if (!value) {
|
|
95
|
+
return '';
|
|
96
|
+
}
|
|
97
|
+
return value.slice(0, 1).toUpperCase() + value.slice(1);
|
|
98
|
+
}
|