wave-code 1.0.5 → 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.
Files changed (39) hide show
  1. package/dist/components/AgentsManager.d.ts +7 -0
  2. package/dist/components/AgentsManager.js +109 -0
  3. package/dist/components/ConfirmationSelector.js +17 -3
  4. package/dist/components/InputBox.js +7 -21
  5. package/dist/components/LoginCommand.js +31 -2
  6. package/dist/components/MarketplaceAddForm.js +16 -2
  7. package/dist/constants/commands.js +6 -0
  8. package/dist/contexts/useChat.d.ts +2 -1
  9. package/dist/contexts/useChat.js +96 -21
  10. package/dist/hooks/useInputManager.d.ts +2 -0
  11. package/dist/hooks/useInputManager.js +8 -0
  12. package/dist/managers/inputHandlers.js +3 -0
  13. package/dist/managers/inputReducer.d.ts +4 -0
  14. package/dist/managers/inputReducer.js +8 -0
  15. package/dist/reducers/agentsManagerReducer.d.ts +26 -0
  16. package/dist/reducers/agentsManagerReducer.js +54 -0
  17. package/dist/stdio/agentBridge.d.ts +4 -0
  18. package/dist/stdio/agentBridge.js +45 -10
  19. package/dist/stdio/protocol.d.ts +1 -1
  20. package/dist/utils/rewindCheckpoints.d.ts +2 -2
  21. package/dist/utils/rewindCheckpoints.js +4 -2
  22. package/dist/utils/usageSummary.d.ts +0 -4
  23. package/dist/utils/usageSummary.js +1 -34
  24. package/package.json +2 -2
  25. package/src/components/AgentsManager.tsx +290 -0
  26. package/src/components/ConfirmationSelector.tsx +18 -3
  27. package/src/components/InputBox.tsx +54 -45
  28. package/src/components/LoginCommand.tsx +35 -2
  29. package/src/components/MarketplaceAddForm.tsx +17 -2
  30. package/src/constants/commands.ts +6 -0
  31. package/src/contexts/useChat.tsx +159 -72
  32. package/src/hooks/useInputManager.ts +8 -0
  33. package/src/managers/inputHandlers.ts +2 -0
  34. package/src/managers/inputReducer.ts +10 -0
  35. package/src/reducers/agentsManagerReducer.ts +91 -0
  36. package/src/stdio/agentBridge.ts +55 -9
  37. package/src/stdio/protocol.ts +2 -0
  38. package/src/utils/rewindCheckpoints.ts +3 -2
  39. 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
- // Cache-related tokens (for Claude models)
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(