wave-code 1.0.6 → 1.0.7
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/components/AgentsManager.d.ts +7 -0
- package/dist/components/AgentsManager.js +109 -0
- package/dist/components/ConfirmationSelector.js +17 -3
- package/dist/components/InputBox.js +7 -21
- package/dist/components/LoginCommand.js +31 -2
- package/dist/components/MarketplaceAddForm.js +16 -2
- package/dist/constants/commands.js +6 -0
- package/dist/contexts/useChat.d.ts +2 -1
- package/dist/contexts/useChat.js +15 -2
- package/dist/hooks/useInputManager.d.ts +2 -0
- package/dist/hooks/useInputManager.js +8 -0
- package/dist/managers/inputHandlers.js +3 -0
- package/dist/managers/inputReducer.d.ts +4 -0
- package/dist/managers/inputReducer.js +8 -0
- package/dist/reducers/agentsManagerReducer.d.ts +26 -0
- package/dist/reducers/agentsManagerReducer.js +54 -0
- package/dist/stdio/agentBridge.d.ts +3 -0
- package/dist/stdio/agentBridge.js +38 -10
- package/dist/stdio/protocol.d.ts +1 -1
- package/dist/utils/usageSummary.d.ts +0 -4
- package/dist/utils/usageSummary.js +1 -34
- package/package.json +2 -2
- package/src/components/AgentsManager.tsx +290 -0
- package/src/components/ConfirmationSelector.tsx +18 -3
- package/src/components/InputBox.tsx +54 -45
- package/src/components/LoginCommand.tsx +35 -2
- package/src/components/MarketplaceAddForm.tsx +17 -2
- package/src/constants/commands.ts +6 -0
- package/src/contexts/useChat.tsx +23 -2
- package/src/hooks/useInputManager.ts +8 -0
- package/src/managers/inputHandlers.ts +2 -0
- package/src/managers/inputReducer.ts +10 -0
- package/src/reducers/agentsManagerReducer.ts +91 -0
- package/src/stdio/agentBridge.ts +47 -9
- package/src/stdio/protocol.ts +2 -0
- package/src/utils/usageSummary.ts +2 -46
|
@@ -12,13 +12,9 @@ export interface TokenSummary {
|
|
|
12
12
|
agent_calls: number;
|
|
13
13
|
compactions: number;
|
|
14
14
|
};
|
|
15
|
-
//
|
|
15
|
+
// Normalized cache tokens
|
|
16
16
|
cache_read_input_tokens?: number;
|
|
17
17
|
cache_creation_input_tokens?: number;
|
|
18
|
-
cache_creation?: {
|
|
19
|
-
ephemeral_5m_input_tokens: number;
|
|
20
|
-
ephemeral_1h_input_tokens: number;
|
|
21
|
-
};
|
|
22
18
|
}
|
|
23
19
|
|
|
24
20
|
/**
|
|
@@ -65,22 +61,6 @@ export function calculateTokenSummary(
|
|
|
65
61
|
(summary.cache_creation_input_tokens || 0) +
|
|
66
62
|
usage.cache_creation_input_tokens;
|
|
67
63
|
}
|
|
68
|
-
if (
|
|
69
|
-
usage.cache_creation &&
|
|
70
|
-
(usage.cache_creation.ephemeral_5m_input_tokens > 0 ||
|
|
71
|
-
usage.cache_creation.ephemeral_1h_input_tokens > 0)
|
|
72
|
-
) {
|
|
73
|
-
if (!summary.cache_creation) {
|
|
74
|
-
summary.cache_creation = {
|
|
75
|
-
ephemeral_5m_input_tokens: 0,
|
|
76
|
-
ephemeral_1h_input_tokens: 0,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
summary.cache_creation.ephemeral_5m_input_tokens +=
|
|
80
|
-
usage.cache_creation.ephemeral_5m_input_tokens || 0;
|
|
81
|
-
summary.cache_creation.ephemeral_1h_input_tokens +=
|
|
82
|
-
usage.cache_creation.ephemeral_1h_input_tokens || 0;
|
|
83
|
-
}
|
|
84
64
|
|
|
85
65
|
// Track operation types
|
|
86
66
|
if (usage.operation_type === "agent") {
|
|
@@ -132,8 +112,6 @@ export function displayUsageSummary(
|
|
|
132
112
|
let totalCompactions = 0;
|
|
133
113
|
let totalCacheRead = 0;
|
|
134
114
|
let totalCacheCreation = 0;
|
|
135
|
-
let totalCache5m = 0;
|
|
136
|
-
let totalCache1h = 0;
|
|
137
115
|
let hasCacheData = false;
|
|
138
116
|
|
|
139
117
|
for (const [, summary] of Object.entries(summaries)) {
|
|
@@ -147,8 +125,7 @@ export function displayUsageSummary(
|
|
|
147
125
|
// Display cache information if available
|
|
148
126
|
if (
|
|
149
127
|
summary.cache_read_input_tokens ||
|
|
150
|
-
summary.cache_creation_input_tokens
|
|
151
|
-
summary.cache_creation
|
|
128
|
+
summary.cache_creation_input_tokens
|
|
152
129
|
) {
|
|
153
130
|
hasCacheData = true;
|
|
154
131
|
console.log(" Cache Usage:");
|
|
@@ -172,21 +149,6 @@ export function displayUsageSummary(
|
|
|
172
149
|
);
|
|
173
150
|
totalCacheCreation += summary.cache_creation_input_tokens;
|
|
174
151
|
}
|
|
175
|
-
|
|
176
|
-
if (summary.cache_creation) {
|
|
177
|
-
if (summary.cache_creation.ephemeral_5m_input_tokens > 0) {
|
|
178
|
-
console.log(
|
|
179
|
-
` 5m cache: ${summary.cache_creation.ephemeral_5m_input_tokens.toLocaleString()} tokens`,
|
|
180
|
-
);
|
|
181
|
-
totalCache5m += summary.cache_creation.ephemeral_5m_input_tokens;
|
|
182
|
-
}
|
|
183
|
-
if (summary.cache_creation.ephemeral_1h_input_tokens > 0) {
|
|
184
|
-
console.log(
|
|
185
|
-
` 1h cache: ${summary.cache_creation.ephemeral_1h_input_tokens.toLocaleString()} tokens`,
|
|
186
|
-
);
|
|
187
|
-
totalCache1h += summary.cache_creation.ephemeral_1h_input_tokens;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
152
|
}
|
|
191
153
|
|
|
192
154
|
console.log(
|
|
@@ -219,12 +181,6 @@ export function displayUsageSummary(
|
|
|
219
181
|
` Created cache: ${totalCacheCreation.toLocaleString()} tokens`,
|
|
220
182
|
);
|
|
221
183
|
}
|
|
222
|
-
if (totalCache5m > 0) {
|
|
223
|
-
console.log(` 5m cache: ${totalCache5m.toLocaleString()} tokens`);
|
|
224
|
-
}
|
|
225
|
-
if (totalCache1h > 0) {
|
|
226
|
-
console.log(` 1h cache: ${totalCache1h.toLocaleString()} tokens`);
|
|
227
|
-
}
|
|
228
184
|
}
|
|
229
185
|
|
|
230
186
|
console.log(
|