vivekmind 1.0.0 → 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/README.md +30 -1
- package/cli.js +91 -28
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -143,7 +143,8 @@ Over 40 built-in commands for session control, configuration, and workflow manag
|
|
|
143
143
|
|
|
144
144
|
```
|
|
145
145
|
/model Switch AI model
|
|
146
|
-
/
|
|
146
|
+
/context Show context window usage breakdown (add "detail" for per-item)
|
|
147
|
+
/compress Compress chat history to save context (shows % saved)
|
|
147
148
|
/clear Clear conversation
|
|
148
149
|
/memory Open memory manager
|
|
149
150
|
/remember Save info to memory
|
|
@@ -260,6 +261,7 @@ vivekmind -p "refactor module" --output stream-json
|
|
|
260
261
|
|
|
261
262
|
### Additional Features
|
|
262
263
|
|
|
264
|
+
- **Context Compression** — Aggressive multi-layer compression system that reduces token usage by 80-95% on long sessions, minimizing AWS Bedrock costs. Combines LLM-based summarization, microcompaction (automatic old tool output clearing), and output pruning to keep 100k+ token sessions within budget. Triggered automatically at 70% context usage or manually via `/compress`.
|
|
263
265
|
- **Sandbox** — Docker and Podman sandbox support for safe code execution
|
|
264
266
|
- **LSP Integration** — Language Server Protocol for code intelligence
|
|
265
267
|
- **Extensions** — Install community extensions from GitHub or npm
|
|
@@ -275,6 +277,33 @@ vivekmind -p "refactor module" --output stream-json
|
|
|
275
277
|
|
|
276
278
|
---
|
|
277
279
|
|
|
280
|
+
## Token Optimization
|
|
281
|
+
|
|
282
|
+
VivekMind includes a comprehensive token optimization system designed to minimize API costs, especially important for AWS Bedrock users who pay per token.
|
|
283
|
+
|
|
284
|
+
### How It Works
|
|
285
|
+
|
|
286
|
+
The compression system operates on three layers:
|
|
287
|
+
|
|
288
|
+
1. **Microcompaction (automatic)** — Before every API turn, old tool results (file reads, shell output, grep results) that are no longer relevant are replaced with a one-line placeholder. This is triggered by either idle time (>60 min) or when tool outputs consume more than 20% of the context window. The most recent 3 results are preserved.
|
|
289
|
+
|
|
290
|
+
2. **Output Pruning (automatic)** — When building the compression prompt, high-volume tool outputs (file reads, shell, grep, glob, etc.) are aggressively truncated to 80 characters per tool in the history being summarized. This prevents the compression LLM call itself from bloating.
|
|
291
|
+
|
|
292
|
+
3. **LLM-Based Compression (automatic + manual)** — When context usage exceeds 70% of the model's context window, the entire conversation history (except the most recent 5%) is sent to the LLM to produce a structured XML `<state_snapshot>` containing: overall goal, key knowledge, user preferences, file system state, unresolved bugs, recent actions, and current plan. The summary is capped at 1024 output tokens. Manual trigger via `/compress` uses a 3% preserve threshold for more aggressive compression.
|
|
293
|
+
|
|
294
|
+
### Context Usage Display
|
|
295
|
+
|
|
296
|
+
The footer shows real-time context window usage as a percentage with the actual token count (e.g., `45.2% context used (181.2k/200k tok)`). The `/context` command shows a detailed breakdown by category: system prompt, built-in tools, MCP tools, memory files, skills, and messages.
|
|
297
|
+
|
|
298
|
+
### Cost Impact
|
|
299
|
+
|
|
300
|
+
For a typical 100k-token session on AWS Bedrock (Claude Sonnet):
|
|
301
|
+
- **Without compression**: Every turn sends the full 100k+ tokens, costing ~$1.50/turn
|
|
302
|
+
- **With compression**: History is summarized to ~3-5k tokens after the 70% threshold, reducing per-turn cost by 80-95% for subsequent turns
|
|
303
|
+
- **Microcompaction alone**: Clears 40-60% of historical tool output bloat before it reaches the LLM
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
278
307
|
## Configuration
|
|
279
308
|
|
|
280
309
|
### Settings
|
package/cli.js
CHANGED
|
@@ -172983,7 +172983,7 @@ __export(geminiContentGenerator_exports, {
|
|
|
172983
172983
|
createGeminiContentGenerator: () => createGeminiContentGenerator
|
|
172984
172984
|
});
|
|
172985
172985
|
function createGeminiContentGenerator(config2, gcConfig) {
|
|
172986
|
-
const version2 = "1.0.
|
|
172986
|
+
const version2 = "1.0.1";
|
|
172987
172987
|
const userAgent2 = config2.userAgent || `VivekMindCode/${version2} (${process.platform}; ${process.arch})`;
|
|
172988
172988
|
const baseHeaders = {
|
|
172989
172989
|
"User-Agent": userAgent2
|
|
@@ -203095,7 +203095,7 @@ var init_pricing = __esm({
|
|
|
203095
203095
|
});
|
|
203096
203096
|
|
|
203097
203097
|
// packages/core/src/core/bedrockContentGenerator/bedrockContentGenerator.js
|
|
203098
|
-
var import_client_bedrock_runtime, debugLogger21, BedrockContentGenerator;
|
|
203098
|
+
var import_client_bedrock_runtime, DUMMY_TOOL, debugLogger21, BedrockContentGenerator;
|
|
203099
203099
|
var init_bedrockContentGenerator = __esm({
|
|
203100
203100
|
"packages/core/src/core/bedrockContentGenerator/bedrockContentGenerator.js"() {
|
|
203101
203101
|
"use strict";
|
|
@@ -203107,6 +203107,18 @@ var init_bedrockContentGenerator = __esm({
|
|
|
203107
203107
|
init_safeJsonParse();
|
|
203108
203108
|
init_debugLogger();
|
|
203109
203109
|
init_tokenLimits();
|
|
203110
|
+
DUMMY_TOOL = {
|
|
203111
|
+
toolSpec: {
|
|
203112
|
+
name: "dummy_tool_prevent_validation_error",
|
|
203113
|
+
description: "A placeholder tool to satisfy AWS Bedrock requirements when conversation history contains tool blocks.",
|
|
203114
|
+
inputSchema: {
|
|
203115
|
+
json: {
|
|
203116
|
+
type: "object",
|
|
203117
|
+
properties: {}
|
|
203118
|
+
}
|
|
203119
|
+
}
|
|
203120
|
+
}
|
|
203121
|
+
};
|
|
203110
203122
|
debugLogger21 = createDebugLogger("BEDROCK");
|
|
203111
203123
|
BedrockContentGenerator = class {
|
|
203112
203124
|
static {
|
|
@@ -203139,12 +203151,15 @@ var init_bedrockContentGenerator = __esm({
|
|
|
203139
203151
|
const modelId = this.contentGeneratorConfig.model;
|
|
203140
203152
|
const { messages, system } = this.converter.convertGeminiRequestToConverse(request4);
|
|
203141
203153
|
const toolConfig = request4.config?.tools ? await this.converter.convertGeminiToolsToConverse(request4.config.tools) : void 0;
|
|
203154
|
+
const hasToolUseOrToolResult = messages.some(
|
|
203155
|
+
(msg) => msg.content?.some((block2) => "toolUse" in block2 || "toolResult" in block2)
|
|
203156
|
+
);
|
|
203142
203157
|
const inferenceConfig = this.buildInferenceConfig(request4);
|
|
203143
203158
|
const command2 = new import_client_bedrock_runtime.ConverseCommand({
|
|
203144
203159
|
modelId,
|
|
203145
203160
|
messages,
|
|
203146
203161
|
system,
|
|
203147
|
-
toolConfig: toolConfig && toolConfig.tools && toolConfig.tools.length > 0 ? toolConfig : void 0,
|
|
203162
|
+
toolConfig: toolConfig && toolConfig.tools && toolConfig.tools.length > 0 ? toolConfig : hasToolUseOrToolResult ? { tools: [DUMMY_TOOL] } : void 0,
|
|
203148
203163
|
inferenceConfig
|
|
203149
203164
|
});
|
|
203150
203165
|
debugLogger21.info(`Converse request: model=${modelId}, messages=${messages.length}`);
|
|
@@ -203162,12 +203177,15 @@ var init_bedrockContentGenerator = __esm({
|
|
|
203162
203177
|
const modelId = this.contentGeneratorConfig.model;
|
|
203163
203178
|
const { messages, system } = this.converter.convertGeminiRequestToConverse(request4);
|
|
203164
203179
|
const toolConfig = request4.config?.tools ? await this.converter.convertGeminiToolsToConverse(request4.config.tools) : void 0;
|
|
203180
|
+
const hasToolUseOrToolResult = messages.some(
|
|
203181
|
+
(msg) => msg.content?.some((block2) => "toolUse" in block2 || "toolResult" in block2)
|
|
203182
|
+
);
|
|
203165
203183
|
const inferenceConfig = this.buildInferenceConfig(request4);
|
|
203166
203184
|
const command2 = new import_client_bedrock_runtime.ConverseStreamCommand({
|
|
203167
203185
|
modelId,
|
|
203168
203186
|
messages,
|
|
203169
203187
|
system,
|
|
203170
|
-
toolConfig: toolConfig && toolConfig.tools && toolConfig.tools.length > 0 ? toolConfig : void 0,
|
|
203188
|
+
toolConfig: toolConfig && toolConfig.tools && toolConfig.tools.length > 0 ? toolConfig : hasToolUseOrToolResult ? { tools: [DUMMY_TOOL] } : void 0,
|
|
203171
203189
|
inferenceConfig
|
|
203172
203190
|
});
|
|
203173
203191
|
debugLogger21.info(`ConverseStream request: model=${modelId}, messages=${messages.length}`);
|
|
@@ -207083,7 +207101,7 @@ This error was probably caused by cyclic schema references in one of the followi
|
|
|
207083
207101
|
}
|
|
207084
207102
|
if (chunk.usageMetadata) {
|
|
207085
207103
|
usageMetadata = chunk.usageMetadata;
|
|
207086
|
-
const lastPromptTokenCount = usageMetadata.
|
|
207104
|
+
const lastPromptTokenCount = usageMetadata.promptTokenCount || usageMetadata.totalTokenCount;
|
|
207087
207105
|
if (lastPromptTokenCount && this.telemetryService) {
|
|
207088
207106
|
this.telemetryService.setLastPromptTokenCount(lastPromptTokenCount);
|
|
207089
207107
|
}
|
|
@@ -367994,7 +368012,7 @@ var require_backend = __commonJS({
|
|
|
367994
368012
|
) : symbolOrNumber;
|
|
367995
368013
|
}
|
|
367996
368014
|
__name(getTypeSymbol, "getTypeSymbol");
|
|
367997
|
-
var _ReactTypeOfWork = ReactTypeOfWork, CacheComponent = _ReactTypeOfWork.CacheComponent, ClassComponent = _ReactTypeOfWork.ClassComponent, IncompleteClassComponent = _ReactTypeOfWork.IncompleteClassComponent, FunctionComponent = _ReactTypeOfWork.FunctionComponent, IndeterminateComponent = _ReactTypeOfWork.IndeterminateComponent, ForwardRef = _ReactTypeOfWork.ForwardRef, HostRoot = _ReactTypeOfWork.HostRoot, HostHoistable = _ReactTypeOfWork.HostHoistable, HostSingleton = _ReactTypeOfWork.HostSingleton, HostComponent = _ReactTypeOfWork.HostComponent, HostPortal = _ReactTypeOfWork.HostPortal, HostText = _ReactTypeOfWork.HostText,
|
|
368015
|
+
var _ReactTypeOfWork = ReactTypeOfWork, CacheComponent = _ReactTypeOfWork.CacheComponent, ClassComponent = _ReactTypeOfWork.ClassComponent, IncompleteClassComponent = _ReactTypeOfWork.IncompleteClassComponent, FunctionComponent = _ReactTypeOfWork.FunctionComponent, IndeterminateComponent = _ReactTypeOfWork.IndeterminateComponent, ForwardRef = _ReactTypeOfWork.ForwardRef, HostRoot = _ReactTypeOfWork.HostRoot, HostHoistable = _ReactTypeOfWork.HostHoistable, HostSingleton = _ReactTypeOfWork.HostSingleton, HostComponent = _ReactTypeOfWork.HostComponent, HostPortal = _ReactTypeOfWork.HostPortal, HostText = _ReactTypeOfWork.HostText, Fragment28 = _ReactTypeOfWork.Fragment, LazyComponent = _ReactTypeOfWork.LazyComponent, LegacyHiddenComponent = _ReactTypeOfWork.LegacyHiddenComponent, MemoComponent = _ReactTypeOfWork.MemoComponent, OffscreenComponent = _ReactTypeOfWork.OffscreenComponent, Profiler = _ReactTypeOfWork.Profiler, ScopeComponent = _ReactTypeOfWork.ScopeComponent, SimpleMemoComponent = _ReactTypeOfWork.SimpleMemoComponent, SuspenseComponent = _ReactTypeOfWork.SuspenseComponent, SuspenseListComponent = _ReactTypeOfWork.SuspenseListComponent, TracingMarkerComponent = _ReactTypeOfWork.TracingMarkerComponent;
|
|
367998
368016
|
function resolveFiberType(type) {
|
|
367999
368017
|
var typeSymbol = getTypeSymbol(type);
|
|
368000
368018
|
switch (typeSymbol) {
|
|
@@ -368040,7 +368058,7 @@ var require_backend = __commonJS({
|
|
|
368040
368058
|
case HostPortal:
|
|
368041
368059
|
case HostText:
|
|
368042
368060
|
return null;
|
|
368043
|
-
case
|
|
368061
|
+
case Fragment28:
|
|
368044
368062
|
return "Fragment";
|
|
368045
368063
|
case LazyComponent:
|
|
368046
368064
|
return "Lazy";
|
|
@@ -368106,7 +368124,7 @@ var require_backend = __commonJS({
|
|
|
368106
368124
|
function attach(hook2, rendererID, renderer2, global2) {
|
|
368107
368125
|
var version2 = renderer2.reconcilerVersion || renderer2.version;
|
|
368108
368126
|
var _getInternalReactCons = getInternalReactConstants(version2), getDisplayNameForFiber = _getInternalReactCons.getDisplayNameForFiber, getTypeSymbol = _getInternalReactCons.getTypeSymbol, ReactPriorityLevels = _getInternalReactCons.ReactPriorityLevels, ReactTypeOfWork = _getInternalReactCons.ReactTypeOfWork, StrictModeBits = _getInternalReactCons.StrictModeBits;
|
|
368109
|
-
var CacheComponent = ReactTypeOfWork.CacheComponent, ClassComponent = ReactTypeOfWork.ClassComponent, ContextConsumer = ReactTypeOfWork.ContextConsumer, DehydratedSuspenseComponent = ReactTypeOfWork.DehydratedSuspenseComponent, ForwardRef = ReactTypeOfWork.ForwardRef,
|
|
368127
|
+
var CacheComponent = ReactTypeOfWork.CacheComponent, ClassComponent = ReactTypeOfWork.ClassComponent, ContextConsumer = ReactTypeOfWork.ContextConsumer, DehydratedSuspenseComponent = ReactTypeOfWork.DehydratedSuspenseComponent, ForwardRef = ReactTypeOfWork.ForwardRef, Fragment28 = ReactTypeOfWork.Fragment, FunctionComponent = ReactTypeOfWork.FunctionComponent, HostRoot = ReactTypeOfWork.HostRoot, HostHoistable = ReactTypeOfWork.HostHoistable, HostSingleton = ReactTypeOfWork.HostSingleton, HostPortal = ReactTypeOfWork.HostPortal, HostComponent = ReactTypeOfWork.HostComponent, HostText = ReactTypeOfWork.HostText, IncompleteClassComponent = ReactTypeOfWork.IncompleteClassComponent, IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, LegacyHiddenComponent = ReactTypeOfWork.LegacyHiddenComponent, MemoComponent = ReactTypeOfWork.MemoComponent, OffscreenComponent = ReactTypeOfWork.OffscreenComponent, SimpleMemoComponent = ReactTypeOfWork.SimpleMemoComponent, SuspenseComponent = ReactTypeOfWork.SuspenseComponent, SuspenseListComponent = ReactTypeOfWork.SuspenseListComponent, TracingMarkerComponent = ReactTypeOfWork.TracingMarkerComponent;
|
|
368110
368128
|
var ImmediatePriority = ReactPriorityLevels.ImmediatePriority, UserBlockingPriority = ReactPriorityLevels.UserBlockingPriority, NormalPriority = ReactPriorityLevels.NormalPriority, LowPriority = ReactPriorityLevels.LowPriority, IdlePriority = ReactPriorityLevels.IdlePriority, NoPriority = ReactPriorityLevels.NoPriority;
|
|
368111
368129
|
var getLaneLabelMap = renderer2.getLaneLabelMap, injectProfilingHooks = renderer2.injectProfilingHooks, overrideHookState = renderer2.overrideHookState, overrideHookStateDeletePath = renderer2.overrideHookStateDeletePath, overrideHookStateRenamePath = renderer2.overrideHookStateRenamePath, overrideProps = renderer2.overrideProps, overridePropsDeletePath = renderer2.overridePropsDeletePath, overridePropsRenamePath = renderer2.overridePropsRenamePath, scheduleRefresh = renderer2.scheduleRefresh, setErrorHandler = renderer2.setErrorHandler, setSuspenseHandler = renderer2.setSuspenseHandler, scheduleUpdate = renderer2.scheduleUpdate;
|
|
368112
368130
|
var supportsTogglingError = typeof setErrorHandler === "function" && typeof scheduleUpdate === "function";
|
|
@@ -368321,7 +368339,7 @@ var require_backend = __commonJS({
|
|
|
368321
368339
|
return true;
|
|
368322
368340
|
case HostRoot:
|
|
368323
368341
|
return false;
|
|
368324
|
-
case
|
|
368342
|
+
case Fragment28:
|
|
368325
368343
|
return key === null;
|
|
368326
368344
|
default:
|
|
368327
368345
|
var typeSymbol = getTypeSymbol(type);
|
|
@@ -368396,7 +368414,7 @@ var require_backend = __commonJS({
|
|
|
368396
368414
|
return ElementTypeHostComponent;
|
|
368397
368415
|
case HostPortal:
|
|
368398
368416
|
case HostText:
|
|
368399
|
-
case
|
|
368417
|
+
case Fragment28:
|
|
368400
368418
|
return ElementTypeOtherOrUnknown;
|
|
368401
368419
|
case MemoComponent:
|
|
368402
368420
|
case SimpleMemoComponent:
|
|
@@ -467989,7 +468007,7 @@ var require_react_is_development = __commonJS({
|
|
|
467989
468007
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
467990
468008
|
var Element2 = REACT_ELEMENT_TYPE;
|
|
467991
468009
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
467992
|
-
var
|
|
468010
|
+
var Fragment28 = REACT_FRAGMENT_TYPE;
|
|
467993
468011
|
var Lazy = REACT_LAZY_TYPE;
|
|
467994
468012
|
var Memo = REACT_MEMO_TYPE;
|
|
467995
468013
|
var Portal = REACT_PORTAL_TYPE;
|
|
@@ -468061,7 +468079,7 @@ var require_react_is_development = __commonJS({
|
|
|
468061
468079
|
exports2.ContextProvider = ContextProvider;
|
|
468062
468080
|
exports2.Element = Element2;
|
|
468063
468081
|
exports2.ForwardRef = ForwardRef;
|
|
468064
|
-
exports2.Fragment =
|
|
468082
|
+
exports2.Fragment = Fragment28;
|
|
468065
468083
|
exports2.Lazy = Lazy;
|
|
468066
468084
|
exports2.Memo = Memo;
|
|
468067
468085
|
exports2.Portal = Portal;
|
|
@@ -501307,7 +501325,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
501307
501325
|
// packages/cli/src/utils/version.ts
|
|
501308
501326
|
async function getCliVersion() {
|
|
501309
501327
|
const pkgJson = await getPackageJson();
|
|
501310
|
-
return "1.0.
|
|
501328
|
+
return "1.0.1";
|
|
501311
501329
|
}
|
|
501312
501330
|
__name(getCliVersion, "getCliVersion");
|
|
501313
501331
|
|
|
@@ -512976,7 +512994,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds, options2) => {
|
|
|
512976
512994
|
|
|
512977
512995
|
// packages/cli/src/generated/git-commit.ts
|
|
512978
512996
|
init_esbuild_shims();
|
|
512979
|
-
var GIT_COMMIT_INFO = "
|
|
512997
|
+
var GIT_COMMIT_INFO = "97ca1a8d7";
|
|
512980
512998
|
|
|
512981
512999
|
// packages/cli/src/utils/systemInfo.ts
|
|
512982
513000
|
async function getNpmVersion() {
|
|
@@ -552401,7 +552419,18 @@ function CompressionMessage({
|
|
|
552401
552419
|
return t4("Compressing chat history");
|
|
552402
552420
|
}
|
|
552403
552421
|
switch (compressionStatus) {
|
|
552404
|
-
case CompressionStatus.COMPRESSED:
|
|
552422
|
+
case CompressionStatus.COMPRESSED: {
|
|
552423
|
+
const reduction = originalTokens > 0 ? Math.round((originalTokens - newTokens) / originalTokens * 100) : 0;
|
|
552424
|
+
if (reduction > 0) {
|
|
552425
|
+
return t4(
|
|
552426
|
+
"Chat history compressed: {{originalTokens}} \u2192 {{newTokens}} tokens ({{reduction}}% saved)",
|
|
552427
|
+
{
|
|
552428
|
+
originalTokens: String(originalTokens),
|
|
552429
|
+
newTokens: String(newTokens),
|
|
552430
|
+
reduction: String(reduction)
|
|
552431
|
+
}
|
|
552432
|
+
);
|
|
552433
|
+
}
|
|
552405
552434
|
return t4(
|
|
552406
552435
|
"Chat history compressed from {{originalTokens}} to {{newTokens}} tokens.",
|
|
552407
552436
|
{
|
|
@@ -552409,6 +552438,7 @@ function CompressionMessage({
|
|
|
552409
552438
|
newTokens: String(newTokens)
|
|
552410
552439
|
}
|
|
552411
552440
|
);
|
|
552441
|
+
}
|
|
552412
552442
|
case CompressionStatus.COMPRESSION_FAILED_INFLATED_TOKEN_COUNT:
|
|
552413
552443
|
if (originalTokens < 5e4) {
|
|
552414
552444
|
return t4("Compression was not beneficial for this history size.");
|
|
@@ -552428,7 +552458,7 @@ function CompressionMessage({
|
|
|
552428
552458
|
}, "getCompressionText");
|
|
552429
552459
|
const text = getCompressionText();
|
|
552430
552460
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
552431
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box_default, { marginRight: 1, children: isPending ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(build_default, { type: "dots" }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text3, { color: theme.text.accent, children: "\u2726" }) }),
|
|
552461
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box_default, { marginRight: 1, children: isPending ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text3, { color: theme.text.accent, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(build_default, { type: "dots" }) }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text3, { color: theme.text.accent, children: "\u2726" }) }),
|
|
552432
552462
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
552433
552463
|
Text3,
|
|
552434
552464
|
{
|
|
@@ -569956,6 +569986,16 @@ var import_react136 = __toESM(require_react(), 1);
|
|
|
569956
569986
|
init_esbuild_shims();
|
|
569957
569987
|
init_i18n();
|
|
569958
569988
|
var import_jsx_runtime129 = __toESM(require_jsx_runtime(), 1);
|
|
569989
|
+
function formatTokenCount2(tokens) {
|
|
569990
|
+
if (tokens >= 1e6) {
|
|
569991
|
+
return `${(tokens / 1e6).toFixed(1)}M`;
|
|
569992
|
+
}
|
|
569993
|
+
if (tokens >= 1e3) {
|
|
569994
|
+
return `${(tokens / 1e3).toFixed(1)}k`;
|
|
569995
|
+
}
|
|
569996
|
+
return `${tokens}`;
|
|
569997
|
+
}
|
|
569998
|
+
__name(formatTokenCount2, "formatTokenCount");
|
|
569959
569999
|
function formatPercentageUsed(percentage) {
|
|
569960
570000
|
if (percentage > 1) {
|
|
569961
570001
|
return ">100";
|
|
@@ -569974,16 +570014,39 @@ var ContextUsageDisplay = /* @__PURE__ */ __name(({
|
|
|
569974
570014
|
const percentage = promptTokenCount / contextWindowSize;
|
|
569975
570015
|
const percentageUsed = formatPercentageUsed(percentage);
|
|
569976
570016
|
const isOverLimit = percentage > 1;
|
|
569977
|
-
const
|
|
569978
|
-
if (
|
|
569979
|
-
|
|
570017
|
+
const tokenStr = formatTokenCount2(promptTokenCount);
|
|
570018
|
+
if (terminalWidth < 80) {
|
|
570019
|
+
const label2 = t4("% used");
|
|
570020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(Text3, { color: isOverLimit ? theme.status.error : theme.text.secondary, children: [
|
|
569980
570021
|
percentageUsed,
|
|
569981
|
-
|
|
569982
|
-
] })
|
|
570022
|
+
label2
|
|
570023
|
+
] });
|
|
569983
570024
|
}
|
|
569984
|
-
|
|
570025
|
+
if (terminalWidth < 120) {
|
|
570026
|
+
const label2 = t4("% ctx");
|
|
570027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(Text3, { color: isOverLimit ? theme.status.error : theme.text.secondary, children: [
|
|
570028
|
+
percentageUsed,
|
|
570029
|
+
label2,
|
|
570030
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(Text3, { dimColor: true, children: [
|
|
570031
|
+
" ",
|
|
570032
|
+
"(",
|
|
570033
|
+
tokenStr,
|
|
570034
|
+
")"
|
|
570035
|
+
] })
|
|
570036
|
+
] });
|
|
570037
|
+
}
|
|
570038
|
+
const label = t4("% context used");
|
|
570039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(Text3, { color: isOverLimit ? theme.status.error : theme.text.secondary, children: [
|
|
569985
570040
|
percentageUsed,
|
|
569986
|
-
label
|
|
570041
|
+
label,
|
|
570042
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(Text3, { dimColor: true, children: [
|
|
570043
|
+
" ",
|
|
570044
|
+
"(",
|
|
570045
|
+
tokenStr,
|
|
570046
|
+
"/",
|
|
570047
|
+
formatTokenCount2(contextWindowSize),
|
|
570048
|
+
" tok)"
|
|
570049
|
+
] })
|
|
569987
570050
|
] });
|
|
569988
570051
|
}, "ContextUsageDisplay");
|
|
569989
570052
|
|
|
@@ -577761,15 +577824,15 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
577761
577824
|
const [taskStartTokens, setTaskStartTokens] = (0, import_react170.useState)(0);
|
|
577762
577825
|
const prevStreamingStateRef = (0, import_react170.useRef)(null);
|
|
577763
577826
|
(0, import_react170.useEffect)(() => {
|
|
577764
|
-
|
|
577827
|
+
const prev = prevStreamingStateRef.current;
|
|
577828
|
+
if (prev === "waiting_for_confirmation" /* WaitingForConfirmation */ && streamingState === "responding" /* Responding */) {
|
|
577765
577829
|
setTimerResetKey((prevKey) => prevKey + 1);
|
|
577766
577830
|
setRetainedElapsedTime(0);
|
|
577767
|
-
|
|
577768
|
-
} else if (streamingState === "idle" /* Idle */ && prevStreamingStateRef.current === "responding" /* Responding */) {
|
|
577831
|
+
} else if (streamingState === "idle" /* Idle */ && prev === "responding" /* Responding */) {
|
|
577769
577832
|
setTimerResetKey((prevKey) => prevKey + 1);
|
|
577770
577833
|
setRetainedElapsedTime(0);
|
|
577771
577834
|
setTaskStartTokens(0);
|
|
577772
|
-
} else if (streamingState === "responding" /* Responding */ &&
|
|
577835
|
+
} else if (streamingState === "responding" /* Responding */ && prev !== "responding" /* Responding */) {
|
|
577773
577836
|
setTaskStartTokens(currentCandidatesTokens ?? 0);
|
|
577774
577837
|
} else if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */) {
|
|
577775
577838
|
setRetainedElapsedTime(elapsedTimeFromTimer);
|
|
@@ -588845,7 +588908,7 @@ var VivekMindAgent = class {
|
|
|
588845
588908
|
async initialize(args2) {
|
|
588846
588909
|
this.clientCapabilities = args2.clientCapabilities;
|
|
588847
588910
|
const authMethods = buildAuthMethods();
|
|
588848
|
-
const version2 = "1.0.
|
|
588911
|
+
const version2 = "1.0.1";
|
|
588849
588912
|
return {
|
|
588850
588913
|
protocolVersion: PROTOCOL_VERSION,
|
|
588851
588914
|
agentInfo: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vivekmind",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Open-source terminal AI agent with full AWS Bedrock support. Bring your own keys.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://code.vivekmind.com",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"bundled"
|
|
26
26
|
],
|
|
27
27
|
"config": {
|
|
28
|
-
"sandboxImageUri": "ghcr.io/lnxtanx/vivekmind-cli:1.0.
|
|
28
|
+
"sandboxImageUri": "ghcr.io/lnxtanx/vivekmind-cli:1.0.1"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {},
|
|
31
31
|
"optionalDependencies": {
|