@cortexkit/opencode-magic-context 0.21.7 → 0.21.8
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/features/magic-context/dreamer/runner.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/sidekick/agent.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +5 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta.d.ts +1 -1
- package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
- package/dist/features/magic-context/storage-subagent-invocations.d.ts +52 -0
- package/dist/features/magic-context/storage-subagent-invocations.d.ts.map +1 -0
- package/dist/features/magic-context/storage.d.ts +2 -1
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/features/magic-context/subagent-token-capture.d.ts +33 -0
- package/dist/features/magic-context/subagent-token-capture.d.ts.map +1 -0
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
- package/dist/features/magic-context/work-metrics.d.ts +13 -0
- package/dist/features/magic-context/work-metrics.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-compressor.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts +2 -0
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +1 -0
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/index.js +14647 -14231
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +2 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/subagent-runner.d.ts +5 -0
- package/dist/shared/subagent-runner.d.ts.map +1 -1
- package/dist/tui/data/context-db.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/rpc-types.ts +2 -0
- package/src/shared/subagent-runner.ts +14 -0
- package/src/tui/data/context-db.ts +2 -0
- package/src/tui/index.tsx +17 -25
- package/src/tui/slots/sidebar-content.tsx +49 -67
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-handlers.d.ts","sourceRoot":"","sources":["../../src/plugin/rpc-handlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,OAAO,EAAE,KAAK,eAAe,IAAI,QAAQ,EAAgB,MAAM,mCAAmC,CAAC;AAWnG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAgBlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAmDzE,wBAAgB,oBAAoB,CAChC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,qBAAqB,CAAC,EAAE,MAAM,EAK9B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,eAAe,
|
|
1
|
+
{"version":3,"file":"rpc-handlers.d.ts","sourceRoot":"","sources":["../../src/plugin/rpc-handlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,OAAO,EAAE,KAAK,eAAe,IAAI,QAAQ,EAAgB,MAAM,mCAAmC,CAAC;AAWnG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAgBlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAmDzE,wBAAgB,oBAAoB,CAChC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,qBAAqB,CAAC,EAAE,MAAM,EAK9B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,eAAe,CAmVjB;AAED,wBAAgB,iBAAiB,CAC7B,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,qBAAqB,CAAC,EAAE,MAAM,GAC/B,YAAY,CAuKd;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAC/B,SAAS,EAAE,qBAAqB,EAChC,IAAI,EAAE;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB,EAAE,gBAAgB,CAAC;CACtC,GACF,IAAI,CAkKN"}
|
|
@@ -54,6 +54,8 @@ export interface SidebarSnapshot {
|
|
|
54
54
|
* scheduler and transform paths.
|
|
55
55
|
*/
|
|
56
56
|
executeThreshold: number;
|
|
57
|
+
newWorkTokens?: number | null;
|
|
58
|
+
totalInputTokens?: number | null;
|
|
57
59
|
}
|
|
58
60
|
export interface StatusDetail extends SidebarSnapshot {
|
|
59
61
|
tagCounter: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-types.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAA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AAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,oBAAoB,EAAE,YAAY,GAAG,QAAQ,CAAC;IAC9C;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB,EAAE,MAAM,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -88,6 +88,11 @@ export interface SubagentRunOptions {
|
|
|
88
88
|
* runner's hot path. Errors are swallowed.
|
|
89
89
|
*/
|
|
90
90
|
onProgress?: (event: SubagentProgressEvent) => void;
|
|
91
|
+
/** Optional token accounting metadata. When present, harness runners persist subagent_invocations. */
|
|
92
|
+
accountingSessionId?: string | undefined;
|
|
93
|
+
accountingSubagent?: "historian" | "historian_editor" | "compressor" | "dreamer" | "sidekick" | "user_memory_review" | "recomp" | undefined;
|
|
94
|
+
accountingTask?: string | null | undefined;
|
|
95
|
+
accountingParentInvocationId?: number | null | undefined;
|
|
91
96
|
}
|
|
92
97
|
/**
|
|
93
98
|
* Progress events emitted by a runner during a run. Distinct from the final
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-runner.d.ts","sourceRoot":"","sources":["../../src/shared/subagent-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;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;;;;;;;;;;;;GA+BG;AACH,MAAM,MAAM,iBAAiB,GACvB;IACI,EAAE,EAAE,IAAI,CAAC;IACT,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,GACD;IACI,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EACA,SAAS,GACT,OAAO,GACP,cAAc,GACd,WAAW,GACX,cAAc,GACd,eAAe,GACf,cAAc,GACd,cAAc,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAC;AAER;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC3B,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;;;;;OAMG;IACH,GAAG,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAChE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-db.d.ts","sourceRoot":"","sources":["../../../src/tui/data/context-db.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAA0B,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEpG,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC;AAc9C,2DAA2D;AAC3D,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAGrD;AAED,+BAA+B;AAC/B,wBAAgB,QAAQ,IAAI,IAAI,CAI/B;
|
|
1
|
+
{"version":3,"file":"context-db.d.ts","sourceRoot":"","sources":["../../../src/tui/data/context-db.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAA0B,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEpG,YAAY,EAAE,eA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CHANGED
|
@@ -90,6 +90,20 @@ export interface SubagentRunOptions {
|
|
|
90
90
|
* runner's hot path. Errors are swallowed.
|
|
91
91
|
*/
|
|
92
92
|
onProgress?: (event: SubagentProgressEvent) => void;
|
|
93
|
+
|
|
94
|
+
/** Optional token accounting metadata. When present, harness runners persist subagent_invocations. */
|
|
95
|
+
accountingSessionId?: string | undefined;
|
|
96
|
+
accountingSubagent?:
|
|
97
|
+
| "historian"
|
|
98
|
+
| "historian_editor"
|
|
99
|
+
| "compressor"
|
|
100
|
+
| "dreamer"
|
|
101
|
+
| "sidekick"
|
|
102
|
+
| "user_memory_review"
|
|
103
|
+
| "recomp"
|
|
104
|
+
| undefined;
|
|
105
|
+
accountingTask?: string | null | undefined;
|
|
106
|
+
accountingParentInvocationId?: number | null | undefined;
|
|
93
107
|
}
|
|
94
108
|
|
|
95
109
|
/**
|
package/src/tui/index.tsx
CHANGED
|
@@ -261,27 +261,12 @@ const StatusDialog = (props: { api: TuiPluginApi; s: StatusDetail }) => {
|
|
|
261
261
|
return { segs, total }
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
let sum = widths.reduce((a, b) => a + b, 0)
|
|
271
|
-
while (sum > barWidth) {
|
|
272
|
-
const maxIdx = widths.indexOf(Math.max(...widths))
|
|
273
|
-
if (widths[maxIdx] > 1) { widths[maxIdx]--; sum-- } else break
|
|
274
|
-
}
|
|
275
|
-
while (sum < barWidth) {
|
|
276
|
-
const maxIdx = widths.indexOf(Math.max(...widths))
|
|
277
|
-
widths[maxIdx]++; sum++
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
return segs.map((seg, i) => ({
|
|
281
|
-
chars: "█".repeat(widths[i] || 0),
|
|
282
|
-
color: seg.color,
|
|
283
|
-
}))
|
|
284
|
-
}
|
|
264
|
+
// The status-dialog breakdown bar uses flex layout (same approach as the
|
|
265
|
+
// sidebar breakdown). Each segment becomes a colored box with
|
|
266
|
+
// flexGrow=tokens and flexBasis=0, parent has width="100%", so opentui
|
|
267
|
+
// distributes the dialog's full width proportionally regardless of the
|
|
268
|
+
// dialog's actual rendered width.
|
|
269
|
+
const barSegments = () => breakdownSegments().segs.filter((seg) => seg.tokens > 0)
|
|
285
270
|
|
|
286
271
|
return (
|
|
287
272
|
<box flexDirection="column" width="100%" paddingLeft={2} paddingRight={2} paddingTop={1} paddingBottom={1}>
|
|
@@ -304,10 +289,17 @@ const StatusDialog = (props: { api: TuiPluginApi; s: StatusDetail }) => {
|
|
|
304
289
|
</text>
|
|
305
290
|
</box>
|
|
306
291
|
|
|
307
|
-
{/* Segmented breakdown bar
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
292
|
+
{/* Segmented breakdown bar: flex row of colored boxes filling
|
|
293
|
+
the dialog width. See barSegments comment above. */}
|
|
294
|
+
<box width="100%" flexDirection="row" height={1}>
|
|
295
|
+
{barSegments().map((seg) => (
|
|
296
|
+
<box
|
|
297
|
+
key={seg.label}
|
|
298
|
+
flexGrow={Math.max(1, seg.tokens)}
|
|
299
|
+
flexBasis={0}
|
|
300
|
+
height={1}
|
|
301
|
+
backgroundColor={seg.color}
|
|
302
|
+
/>
|
|
311
303
|
))}
|
|
312
304
|
</box>
|
|
313
305
|
|
|
@@ -48,16 +48,13 @@ const TokenBreakdown = (props: {
|
|
|
48
48
|
theme: TuiThemeCurrent
|
|
49
49
|
snapshot: SidebarSnapshot
|
|
50
50
|
}) => {
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
// already does (`Math.max(20, innerWidth)`).
|
|
59
|
-
const barWidth = 24
|
|
60
|
-
|
|
51
|
+
// The bar is rendered as a flex row of colored boxes, each with
|
|
52
|
+
// flexGrow=tokens and flexBasis=0. opentui distributes the parent
|
|
53
|
+
// container's full width proportionally, so the bar always fills the
|
|
54
|
+
// sidebar regardless of terminal size. No hardcoded width is needed —
|
|
55
|
+
// this fixes both the over-wide bar that wrapped onto a second line on
|
|
56
|
+
// narrow sidebars (issue #90) and the under-wide bar that left empty
|
|
57
|
+
// space on the right on wide sidebars.
|
|
61
58
|
const segments = createMemo<TokenSegment[]>(() => {
|
|
62
59
|
const s = props.snapshot
|
|
63
60
|
const total = s.inputTokens || 1
|
|
@@ -151,66 +148,33 @@ const TokenBreakdown = (props: {
|
|
|
151
148
|
|
|
152
149
|
const totalTokens = createMemo(() => props.snapshot.inputTokens || 1)
|
|
153
150
|
|
|
154
|
-
//
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
// Convert to character widths. Minimum 1 char ONLY when the segment
|
|
164
|
-
// has tokens > 0 — zero-token segments (e.g. Conversation when the
|
|
165
|
-
// calibrator rounded it to zero) must get width 0 so the bar stays
|
|
166
|
-
// proportional. The legend row still renders for zero-token segments
|
|
167
|
-
// to keep the row stable.
|
|
168
|
-
let widths = segs.map((seg, i) =>
|
|
169
|
-
seg.tokens > 0 ? Math.max(1, Math.round(proportions[i] * barWidth)) : 0,
|
|
170
|
-
)
|
|
171
|
-
|
|
172
|
-
// Adjust to exactly barWidth
|
|
173
|
-
const sum = widths.reduce((a, b) => a + b, 0)
|
|
174
|
-
if (sum > barWidth) {
|
|
175
|
-
// Shrink from the largest segments
|
|
176
|
-
let excess = sum - barWidth
|
|
177
|
-
while (excess > 0) {
|
|
178
|
-
const maxIdx = widths.indexOf(Math.max(...widths))
|
|
179
|
-
if (widths[maxIdx] > 1) {
|
|
180
|
-
widths[maxIdx]--
|
|
181
|
-
excess--
|
|
182
|
-
} else {
|
|
183
|
-
break
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
} else if (sum < barWidth) {
|
|
187
|
-
// Expand the largest segments
|
|
188
|
-
let deficit = barWidth - sum
|
|
189
|
-
while (deficit > 0) {
|
|
190
|
-
const maxIdx = widths.indexOf(Math.max(...widths))
|
|
191
|
-
widths[maxIdx]++
|
|
192
|
-
deficit--
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return widths
|
|
197
|
-
})
|
|
198
|
-
|
|
199
|
-
const barSegments = createMemo(() => {
|
|
200
|
-
const segs = segments()
|
|
201
|
-
const widths = segmentWidths()
|
|
202
|
-
return segs.map((seg, i) => ({
|
|
203
|
-
chars: "█".repeat(widths[i] || 0),
|
|
204
|
-
color: seg.color,
|
|
205
|
-
}))
|
|
206
|
-
})
|
|
151
|
+
// Render-time segments for the bar. Zero-token segments are filtered out
|
|
152
|
+
// entirely (no flex weight, no rendered box) so they don't claim any
|
|
153
|
+
// width. Non-zero segments still get a Math.max(1, ...) floor on
|
|
154
|
+
// flexGrow so very small contributions remain visible as a thin sliver.
|
|
155
|
+
// The legend rows below show every segment (including zeros) for table
|
|
156
|
+
// stability — only the bar prunes them.
|
|
157
|
+
const barSegments = createMemo(() =>
|
|
158
|
+
segments().filter((seg) => seg.tokens > 0),
|
|
159
|
+
)
|
|
207
160
|
|
|
208
161
|
return (
|
|
209
162
|
<box width="100%" flexDirection="column">
|
|
210
|
-
{/* Segmented bar
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
163
|
+
{/* Segmented bar: a width="100%" flex row of colored boxes,
|
|
164
|
+
each with flexGrow proportional to its token count and
|
|
165
|
+
flexBasis=0. opentui distributes the parent's full width
|
|
166
|
+
proportionally, so the bar always fills the sidebar
|
|
167
|
+
regardless of terminal size. Height is fixed at 1 row;
|
|
168
|
+
backgroundColor renders the colored bar. */}
|
|
169
|
+
<box width="100%" flexDirection="row" height={1}>
|
|
170
|
+
{barSegments().map((seg) => (
|
|
171
|
+
<box
|
|
172
|
+
key={seg.key}
|
|
173
|
+
flexGrow={Math.max(1, seg.tokens)}
|
|
174
|
+
flexBasis={0}
|
|
175
|
+
height={1}
|
|
176
|
+
backgroundColor={seg.color}
|
|
177
|
+
/>
|
|
214
178
|
))}
|
|
215
179
|
</box>
|
|
216
180
|
|
|
@@ -477,6 +441,24 @@ const SidebarContent = (props: {
|
|
|
477
441
|
/>
|
|
478
442
|
</>
|
|
479
443
|
)}
|
|
444
|
+
|
|
445
|
+
{/* Stats — v0.21.8 ships a single "Total tokens" number while we
|
|
446
|
+
figure out how to present the new-work / reprocessed
|
|
447
|
+
categorization without confusing users. The underlying
|
|
448
|
+
snapshot fields (newWorkTokens, totalInputTokens) and the
|
|
449
|
+
session_meta columns are still populated; only the UI is
|
|
450
|
+
simplified for now. */}
|
|
451
|
+
{s()?.totalInputTokens != null && (
|
|
452
|
+
<>
|
|
453
|
+
<SectionHeader theme={props.theme} title="Stats" />
|
|
454
|
+
<StatRow
|
|
455
|
+
theme={props.theme}
|
|
456
|
+
label="Total tokens"
|
|
457
|
+
value={compactTokens(s()!.totalInputTokens ?? 0)}
|
|
458
|
+
dim
|
|
459
|
+
/>
|
|
460
|
+
</>
|
|
461
|
+
)}
|
|
480
462
|
</box>
|
|
481
463
|
)
|
|
482
464
|
}
|