opencode-extended-sidebar 0.2.90 → 0.2.91
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/.oesignore +17 -17
- package/CHANGELOG.md +96 -95
- package/LICENSE +21 -21
- package/README.md +150 -235
- package/oes.json +13 -11
- package/package.json +100 -100
- package/scripts/install-git-hooks.mjs +29 -29
- package/src/pware.oc.core/constants/index.ts +18 -18
- package/src/pware.oc.core/constants/pware.oc.core.constants.eventKind.ts +29 -29
- package/src/pware.oc.core/constants/pware.oc.core.constants.eventName.ts +15 -13
- package/src/pware.oc.core/constants/pware.oc.core.constants.eventType.ts +241 -241
- package/src/pware.oc.core/constants/pware.oc.core.constants.myWork.ts +55 -55
- package/src/pware.oc.core/constants/pware.oc.core.constants.partType.ts +65 -65
- package/src/pware.oc.core/constants/pware.oc.core.constants.phase.ts +58 -58
- package/src/pware.oc.core/constants/pware.oc.core.constants.pulse.ts +63 -63
- package/src/pware.oc.core/constants/pware.oc.core.constants.rowKind.ts +34 -34
- package/src/pware.oc.core/constants/pware.oc.core.constants.status.ts +74 -74
- package/src/pware.oc.core/constants/pware.oc.core.constants.toolName.ts +69 -69
- package/src/pware.oc.core/git/index.ts +7 -7
- package/src/pware.oc.core/git/pware.oc.core.git.ts +237 -237
- package/src/pware.oc.core/git/pware.oc.core.gitignore.ts +87 -87
- package/src/pware.oc.core/index.ts +19 -18
- package/src/pware.oc.core/pware.oc.core.bus.ts +42 -42
- package/src/pware.oc.core/pware.oc.core.cache.ts +48 -48
- package/src/pware.oc.core/pware.oc.core.clipboard.ts +97 -97
- package/src/pware.oc.core/pware.oc.core.debug.ts +280 -280
- package/src/pware.oc.core/pware.oc.core.events.ts +79 -79
- package/src/pware.oc.core/pware.oc.core.glyph.ts +135 -135
- package/src/pware.oc.core/pware.oc.core.layout.ts +234 -234
- package/src/pware.oc.core/pware.oc.core.oes.ts +99 -89
- package/src/pware.oc.core/pware.oc.core.paths.ts +240 -240
- package/src/pware.oc.core/pware.oc.core.preview.ts +74 -74
- package/src/pware.oc.core/pware.oc.core.pulse.ts +726 -726
- package/src/pware.oc.core/pware.oc.core.runtimeConfig.ts +41 -0
- package/src/pware.oc.core/pware.oc.core.sqlite.ts +164 -175
- package/src/pware.oc.core/pware.oc.core.sqliteGateway.ts +89 -0
- package/src/pware.oc.core/pware.oc.core.status.ts +214 -214
- package/src/pware.oc.core/pware.oc.core.timing.ts +63 -63
- package/src/pware.oc.core/pware.oc.core.width.ts +215 -215
- package/src/pware.oc.omo/constants/index.ts +15 -15
- package/src/pware.oc.omo/constants/pware.oc.omo.constants.backgroundTask.ts +18 -18
- package/src/pware.oc.omo/constants/pware.oc.omo.constants.boulderStatus.ts +49 -49
- package/src/pware.oc.omo/constants/pware.oc.omo.constants.docKind.ts +29 -29
- package/src/pware.oc.omo/constants/pware.oc.omo.constants.eventName.ts +11 -11
- package/src/pware.oc.omo/constants/pware.oc.omo.constants.planStatus.ts +60 -60
- package/src/pware.oc.omo/constants/pware.oc.omo.constants.reviewStatus.ts +49 -49
- package/src/pware.oc.omo/constants/pware.oc.omo.constants.startWork.ts +25 -25
- package/src/pware.oc.omo/constants/pware.oc.omo.constants.verdict.ts +38 -38
- package/src/pware.oc.omo/index.ts +7 -7
- package/src/pware.oc.omo/resolver/index.ts +19 -19
- package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.approval.ts +179 -179
- package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.approvalGroup.ts +116 -116
- package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.approvalState.ts +34 -34
- package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.boulder.ts +503 -503
- package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.config.ts +40 -40
- package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.doc.ts +269 -269
- package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.draftFile.ts +18 -18
- package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.notepadsFile.ts +18 -18
- package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.plan.ts +155 -155
- package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.planFile.ts +363 -361
- package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.proofFile.ts +18 -18
- package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.rulesFile.ts +11 -11
- package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.runContinuationFile.ts +14 -14
- package/src/pware.oc.opencode/constants/index.ts +10 -10
- package/src/pware.oc.opencode/constants/pware.oc.opencode.constants.eventName.ts +15 -15
- package/src/pware.oc.opencode/constants/pware.oc.opencode.constants.fileTouch.ts +18 -18
- package/src/pware.oc.opencode/constants/pware.oc.opencode.constants.questionKind.ts +45 -45
- package/src/pware.oc.opencode/constants/pware.oc.opencode.constants.sessionStatus.ts +58 -58
- package/src/pware.oc.opencode/index.ts +8 -8
- package/src/pware.oc.opencode/pware.oc.opencode.events.ts +182 -182
- package/src/pware.oc.opencode/pware.oc.opencode.files.ts +399 -399
- package/src/pware.oc.opencode/resolver/index.ts +223 -170
- package/src/pware.oc.opencode/resolver/pware.oc.opencode.resolver.file.ts +150 -162
- package/src/pware.oc.opencode/resolver/pware.oc.opencode.resolver.question.ts +149 -185
- package/src/pware.oc.opencode/resolver/pware.oc.opencode.resolver.session.ts +248 -211
- package/src/pware.oc.opencode/resolver/pware.oc.opencode.resolver.todo.ts +22 -26
- package/src/pware.oc.opencode/resolver/pware.oc.opencode.resolver.tool.ts +224 -236
- package/src/pware.oc.perf/index.ts +14 -14
- package/src/pware.oc.perf/pware.oc.perf.asciichart.d.ts +15 -15
- package/src/pware.oc.perf/pware.oc.perf.charts.ts +284 -284
- package/src/pware.oc.perf/pware.oc.perf.reader.ts +962 -927
- package/src/pware.oc.perf/pware.oc.perf.realtime.ts +88 -88
- package/src/pware.oc.perf/pware.oc.perf.realtimeBlock.ts +118 -118
- package/src/pware.oc.perf/pware.oc.perf.realtimeCpuRam.ts +79 -79
- package/src/pware.oc.perf/pware.oc.perf.realtimeSampler.ts +71 -71
- package/src/pware.oc.perf/pware.oc.perf.realtimeTimeline.ts +214 -214
- package/src/pware.oc.perf/pware.oc.perf.self.ts +179 -179
- package/src/pware.oc.perf/pware.oc.perf.view.tsx +463 -462
- package/src/pware.oc.runtime/index.ts +13 -13
- package/src/pware.oc.runtime/pware.oc.runtime.monitor.ts +142 -142
- package/src/pware.oc.runtime/pware.oc.runtime.mywork-enrich.ts +87 -79
- package/src/pware.oc.runtime/pware.oc.runtime.mywork.ts +282 -253
- package/src/pware.oc.runtime/pware.oc.runtime.omoRead.ts +37 -0
- package/src/pware.oc.runtime/pware.oc.runtime.questions.ts +83 -95
- package/src/pware.oc.runtime/pware.oc.runtime.snapshotClient.ts +130 -129
- package/src/pware.oc.runtime/pware.oc.runtime.source.ts +105 -105
- package/src/pware.oc.runtime/pware.oc.runtime.worker.ts +44 -43
- package/src/pware.oc.runtime/resolver/index.ts +268 -224
- package/src/pware.oc.runtime/resolver/pware.oc.runtime.resolver.delegate.ts +146 -146
- package/src/pware.oc.ui/index.ts +12 -12
- package/src/pware.oc.ui/pware.oc.ui.chrome.tsx +381 -339
- package/src/pware.oc.ui/pware.oc.ui.glyphs.tsx +144 -144
- package/src/pware.oc.ui/pware.oc.ui.host.tsx +111 -111
- package/src/pware.oc.ui/pware.oc.ui.live.tsx +82 -82
- package/src/pware.oc.ui/pware.oc.ui.menudialogs.tsx +843 -843
- package/src/pware.oc.ui/pware.oc.ui.sections.tsx +552 -526
- package/src/pware.oc.ui/pware.oc.ui.sidebar.tsx +1718 -1629
- package/src/pware.oc.ui.tsx +98 -98
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* pware.oc.core.live.resolver.delegate
|
|
3
|
-
*
|
|
4
|
-
* Delegate resolution across providers: boulder tasks enriched with SQLite
|
|
5
|
-
* session rows, plus the grouping rules for the panel. `RuntimeSnapshot` is a
|
|
6
|
-
* type-only import from the live aggregate, so there is no runtime cycle.
|
|
7
|
-
*/
|
|
8
|
-
import type { Delegate, OmoSnapshot } from "../../pware.oc.omo/resolver/pware.oc.omo.resolver.boulder.js"
|
|
9
|
-
import { normalizeStatus } from "../../pware.oc.core/pware.oc.core.status.js"
|
|
10
|
-
import {
|
|
11
|
-
STATUS_ARCHIVED,
|
|
12
|
-
STATUS_COMPLETED,
|
|
13
|
-
STATUS_ERROR,
|
|
14
|
-
STATUS_RUNNING,
|
|
15
|
-
STATUS_UNKNOWN,
|
|
16
|
-
} from "../../pware.oc.core/constants/pware.oc.core.constants.status.js"
|
|
17
|
-
import {
|
|
18
|
-
SESSION_STATUS_ARCHIVED,
|
|
19
|
-
SESSION_STATUS_IDLE,
|
|
20
|
-
SESSION_STATUS_RUNNING,
|
|
21
|
-
} from "../../pware.oc.opencode/constants/pware.oc.opencode.constants.sessionStatus.js"
|
|
22
|
-
import { isRealSession, type DbSnapshot, type SessionView } from "../../pware.oc.opencode/resolver/index.js"
|
|
23
|
-
import type { RuntimeSnapshot } from "./index.js"
|
|
24
|
-
|
|
25
|
-
export type DelegateView = Delegate & {
|
|
26
|
-
tokensTotal: number | null
|
|
27
|
-
timeUpdated: number | null
|
|
28
|
-
archived: boolean
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Boulder often leaves `task_sessions` on `running` after the work (and the
|
|
33
|
-
* OpenCode session) has finished. SQLite session status wins.
|
|
34
|
-
*/
|
|
35
|
-
export function reconcileDelegateStatus(
|
|
36
|
-
omoStatus: string,
|
|
37
|
-
sess?: Pick<SessionView, "status"> | null,
|
|
38
|
-
): string {
|
|
39
|
-
const omo = (omoStatus || STATUS_UNKNOWN).toLowerCase()
|
|
40
|
-
if (!sess) return omo
|
|
41
|
-
if (sess.status === SESSION_STATUS_ARCHIVED) return STATUS_COMPLETED
|
|
42
|
-
const c = normalizeStatus(omoStatus)
|
|
43
|
-
const omoError = c === STATUS_ERROR
|
|
44
|
-
const omoDone = c === STATUS_COMPLETED
|
|
45
|
-
if (sess.status === SESSION_STATUS_IDLE) {
|
|
46
|
-
if (omoError) return omo
|
|
47
|
-
if (omoDone) return omo
|
|
48
|
-
return STATUS_COMPLETED
|
|
49
|
-
}
|
|
50
|
-
if (omoError || omoDone) return omo
|
|
51
|
-
// A live SQLite session is authoritative — a queued boulder entry (no status
|
|
52
|
-
// yet) must not show as waiting while its subagent is actually running.
|
|
53
|
-
if (sess.status === SESSION_STATUS_RUNNING) return STATUS_RUNNING
|
|
54
|
-
return omo === STATUS_UNKNOWN ? STATUS_RUNNING : omo
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export function enrichDelegates(omo: OmoSnapshot, db: DbSnapshot): DelegateView[] {
|
|
58
|
-
return omo.delegates.map((d) => {
|
|
59
|
-
const sess = d.sessionId ? db.byId[d.sessionId] : undefined
|
|
60
|
-
return {
|
|
61
|
-
...d,
|
|
62
|
-
status: reconcileDelegateStatus(d.status, sess),
|
|
63
|
-
tokensTotal: sess ? sess.tokensTotal : null,
|
|
64
|
-
timeUpdated: sess?.timeUpdated ?? d.updatedAt,
|
|
65
|
-
archived: sess?.status === SESSION_STATUS_ARCHIVED,
|
|
66
|
-
}
|
|
67
|
-
})
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** Display key — empty / missing agent collapses to `agent`. */
|
|
71
|
-
export function delegateAgentKey(d: Pick<DelegateView, "agent">): string {
|
|
72
|
-
const s = (d.agent || "").trim()
|
|
73
|
-
return s || "agent"
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export type DelegateListItem =
|
|
77
|
-
| { kind: "header"; agent: string; count: number; members: DelegateView[] }
|
|
78
|
-
| { kind: "row"; grouped: boolean; delegate: DelegateView }
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Cluster by agent when two or more names appear. Group order follows first
|
|
82
|
-
* appearance (keeps recency on Current). One agent → flat rows, no headers.
|
|
83
|
-
*/
|
|
84
|
-
export function groupDelegates(list: DelegateView[]): DelegateListItem[] {
|
|
85
|
-
if (list.length === 0) return []
|
|
86
|
-
const seen = new Set<string>()
|
|
87
|
-
for (const d of list) seen.add(delegateAgentKey(d))
|
|
88
|
-
const grouped = seen.size >= 2
|
|
89
|
-
if (!grouped) {
|
|
90
|
-
return list.map((delegate) => ({ kind: "row" as const, grouped: false, delegate }))
|
|
91
|
-
}
|
|
92
|
-
const order: string[] = []
|
|
93
|
-
const buckets = new Map<string, DelegateView[]>()
|
|
94
|
-
for (const d of list) {
|
|
95
|
-
const key = delegateAgentKey(d)
|
|
96
|
-
let bucket = buckets.get(key)
|
|
97
|
-
if (!bucket) {
|
|
98
|
-
bucket = []
|
|
99
|
-
buckets.set(key, bucket)
|
|
100
|
-
order.push(key)
|
|
101
|
-
}
|
|
102
|
-
bucket.push(d)
|
|
103
|
-
}
|
|
104
|
-
const out: DelegateListItem[] = []
|
|
105
|
-
for (const agent of order) {
|
|
106
|
-
const rows = buckets.get(agent) ?? []
|
|
107
|
-
out.push({ kind: "header", agent, count: rows.length, members: rows })
|
|
108
|
-
for (const delegate of rows) out.push({ kind: "row", grouped: true, delegate })
|
|
109
|
-
}
|
|
110
|
-
return out
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/** Delegates of this session only: SQLite children + OMO tasks whose parent is this session. */
|
|
114
|
-
export function delegatesForSession(snap: RuntimeSnapshot, sessionId: string): DelegateView[] {
|
|
115
|
-
const childIds = new Set(snap.db.children.map((c) => c.id))
|
|
116
|
-
const out: DelegateView[] = []
|
|
117
|
-
const seen = new Set<string>()
|
|
118
|
-
const push = (d: DelegateView) => {
|
|
119
|
-
const key = d.sessionId || d.taskKey
|
|
120
|
-
if (!key || seen.has(key) || key === sessionId) return
|
|
121
|
-
seen.add(key)
|
|
122
|
-
out.push(d)
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// Boulder is project-wide. A new main session must not inherit another run's tasks.
|
|
126
|
-
for (const d of snap.delegates) {
|
|
127
|
-
const parent = d.sessionId ? snap.db.byId[d.sessionId]?.parentId : null
|
|
128
|
-
if (parent === sessionId || (d.sessionId && childIds.has(d.sessionId))) push(d)
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
for (const c of snap.db.children) {
|
|
132
|
-
if (!isRealSession(c)) continue
|
|
133
|
-
push({
|
|
134
|
-
taskKey: c.id,
|
|
135
|
-
title: c.title,
|
|
136
|
-
sessionId: c.id,
|
|
137
|
-
agent: c.agent,
|
|
138
|
-
status: c.status,
|
|
139
|
-
updatedAt: c.timeUpdated,
|
|
140
|
-
tokensTotal: c.tokensTotal,
|
|
141
|
-
timeUpdated: c.timeUpdated,
|
|
142
|
-
archived: c.status === SESSION_STATUS_ARCHIVED,
|
|
143
|
-
})
|
|
144
|
-
}
|
|
145
|
-
return out
|
|
146
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* pware.oc.core.live.resolver.delegate
|
|
3
|
+
*
|
|
4
|
+
* Delegate resolution across providers: boulder tasks enriched with SQLite
|
|
5
|
+
* session rows, plus the grouping rules for the panel. `RuntimeSnapshot` is a
|
|
6
|
+
* type-only import from the live aggregate, so there is no runtime cycle.
|
|
7
|
+
*/
|
|
8
|
+
import type { Delegate, OmoSnapshot } from "../../pware.oc.omo/resolver/pware.oc.omo.resolver.boulder.js"
|
|
9
|
+
import { normalizeStatus } from "../../pware.oc.core/pware.oc.core.status.js"
|
|
10
|
+
import {
|
|
11
|
+
STATUS_ARCHIVED,
|
|
12
|
+
STATUS_COMPLETED,
|
|
13
|
+
STATUS_ERROR,
|
|
14
|
+
STATUS_RUNNING,
|
|
15
|
+
STATUS_UNKNOWN,
|
|
16
|
+
} from "../../pware.oc.core/constants/pware.oc.core.constants.status.js"
|
|
17
|
+
import {
|
|
18
|
+
SESSION_STATUS_ARCHIVED,
|
|
19
|
+
SESSION_STATUS_IDLE,
|
|
20
|
+
SESSION_STATUS_RUNNING,
|
|
21
|
+
} from "../../pware.oc.opencode/constants/pware.oc.opencode.constants.sessionStatus.js"
|
|
22
|
+
import { isRealSession, type DbSnapshot, type SessionView } from "../../pware.oc.opencode/resolver/index.js"
|
|
23
|
+
import type { RuntimeSnapshot } from "./index.js"
|
|
24
|
+
|
|
25
|
+
export type DelegateView = Delegate & {
|
|
26
|
+
tokensTotal: number | null
|
|
27
|
+
timeUpdated: number | null
|
|
28
|
+
archived: boolean
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Boulder often leaves `task_sessions` on `running` after the work (and the
|
|
33
|
+
* OpenCode session) has finished. SQLite session status wins.
|
|
34
|
+
*/
|
|
35
|
+
export function reconcileDelegateStatus(
|
|
36
|
+
omoStatus: string,
|
|
37
|
+
sess?: Pick<SessionView, "status"> | null,
|
|
38
|
+
): string {
|
|
39
|
+
const omo = (omoStatus || STATUS_UNKNOWN).toLowerCase()
|
|
40
|
+
if (!sess) return omo
|
|
41
|
+
if (sess.status === SESSION_STATUS_ARCHIVED) return STATUS_COMPLETED
|
|
42
|
+
const c = normalizeStatus(omoStatus)
|
|
43
|
+
const omoError = c === STATUS_ERROR
|
|
44
|
+
const omoDone = c === STATUS_COMPLETED
|
|
45
|
+
if (sess.status === SESSION_STATUS_IDLE) {
|
|
46
|
+
if (omoError) return omo
|
|
47
|
+
if (omoDone) return omo
|
|
48
|
+
return STATUS_COMPLETED
|
|
49
|
+
}
|
|
50
|
+
if (omoError || omoDone) return omo
|
|
51
|
+
// A live SQLite session is authoritative — a queued boulder entry (no status
|
|
52
|
+
// yet) must not show as waiting while its subagent is actually running.
|
|
53
|
+
if (sess.status === SESSION_STATUS_RUNNING) return STATUS_RUNNING
|
|
54
|
+
return omo === STATUS_UNKNOWN ? STATUS_RUNNING : omo
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function enrichDelegates(omo: OmoSnapshot, db: DbSnapshot): DelegateView[] {
|
|
58
|
+
return omo.delegates.map((d) => {
|
|
59
|
+
const sess = d.sessionId ? db.byId[d.sessionId] : undefined
|
|
60
|
+
return {
|
|
61
|
+
...d,
|
|
62
|
+
status: reconcileDelegateStatus(d.status, sess),
|
|
63
|
+
tokensTotal: sess ? sess.tokensTotal : null,
|
|
64
|
+
timeUpdated: sess?.timeUpdated ?? d.updatedAt,
|
|
65
|
+
archived: sess?.status === SESSION_STATUS_ARCHIVED,
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Display key — empty / missing agent collapses to `agent`. */
|
|
71
|
+
export function delegateAgentKey(d: Pick<DelegateView, "agent">): string {
|
|
72
|
+
const s = (d.agent || "").trim()
|
|
73
|
+
return s || "agent"
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export type DelegateListItem =
|
|
77
|
+
| { kind: "header"; agent: string; count: number; members: DelegateView[] }
|
|
78
|
+
| { kind: "row"; grouped: boolean; delegate: DelegateView }
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Cluster by agent when two or more names appear. Group order follows first
|
|
82
|
+
* appearance (keeps recency on Current). One agent → flat rows, no headers.
|
|
83
|
+
*/
|
|
84
|
+
export function groupDelegates(list: DelegateView[]): DelegateListItem[] {
|
|
85
|
+
if (list.length === 0) return []
|
|
86
|
+
const seen = new Set<string>()
|
|
87
|
+
for (const d of list) seen.add(delegateAgentKey(d))
|
|
88
|
+
const grouped = seen.size >= 2
|
|
89
|
+
if (!grouped) {
|
|
90
|
+
return list.map((delegate) => ({ kind: "row" as const, grouped: false, delegate }))
|
|
91
|
+
}
|
|
92
|
+
const order: string[] = []
|
|
93
|
+
const buckets = new Map<string, DelegateView[]>()
|
|
94
|
+
for (const d of list) {
|
|
95
|
+
const key = delegateAgentKey(d)
|
|
96
|
+
let bucket = buckets.get(key)
|
|
97
|
+
if (!bucket) {
|
|
98
|
+
bucket = []
|
|
99
|
+
buckets.set(key, bucket)
|
|
100
|
+
order.push(key)
|
|
101
|
+
}
|
|
102
|
+
bucket.push(d)
|
|
103
|
+
}
|
|
104
|
+
const out: DelegateListItem[] = []
|
|
105
|
+
for (const agent of order) {
|
|
106
|
+
const rows = buckets.get(agent) ?? []
|
|
107
|
+
out.push({ kind: "header", agent, count: rows.length, members: rows })
|
|
108
|
+
for (const delegate of rows) out.push({ kind: "row", grouped: true, delegate })
|
|
109
|
+
}
|
|
110
|
+
return out
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** Delegates of this session only: SQLite children + OMO tasks whose parent is this session. */
|
|
114
|
+
export function delegatesForSession(snap: RuntimeSnapshot, sessionId: string): DelegateView[] {
|
|
115
|
+
const childIds = new Set(snap.db.children.map((c) => c.id))
|
|
116
|
+
const out: DelegateView[] = []
|
|
117
|
+
const seen = new Set<string>()
|
|
118
|
+
const push = (d: DelegateView) => {
|
|
119
|
+
const key = d.sessionId || d.taskKey
|
|
120
|
+
if (!key || seen.has(key) || key === sessionId) return
|
|
121
|
+
seen.add(key)
|
|
122
|
+
out.push(d)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Boulder is project-wide. A new main session must not inherit another run's tasks.
|
|
126
|
+
for (const d of snap.delegates) {
|
|
127
|
+
const parent = d.sessionId ? snap.db.byId[d.sessionId]?.parentId : null
|
|
128
|
+
if (parent === sessionId || (d.sessionId && childIds.has(d.sessionId))) push(d)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
for (const c of snap.db.children) {
|
|
132
|
+
if (!isRealSession(c)) continue
|
|
133
|
+
push({
|
|
134
|
+
taskKey: c.id,
|
|
135
|
+
title: c.title,
|
|
136
|
+
sessionId: c.id,
|
|
137
|
+
agent: c.agent,
|
|
138
|
+
status: c.status,
|
|
139
|
+
updatedAt: c.timeUpdated,
|
|
140
|
+
tokensTotal: c.tokensTotal,
|
|
141
|
+
timeUpdated: c.timeUpdated,
|
|
142
|
+
archived: c.status === SESSION_STATUS_ARCHIVED,
|
|
143
|
+
})
|
|
144
|
+
}
|
|
145
|
+
return out
|
|
146
|
+
}
|
package/src/pware.oc.ui/index.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* pware.oc.ui
|
|
3
|
-
*
|
|
4
|
-
* TUI layer: chrome, shared sections, the sidebar panel, dialogs, glyphs.
|
|
5
|
-
*/
|
|
6
|
-
export * from "./pware.oc.ui.chrome.js"
|
|
7
|
-
export * from "./pware.oc.ui.sections.js"
|
|
8
|
-
export * from "./pware.oc.ui.sidebar.js"
|
|
9
|
-
export * from "./pware.oc.ui.menudialogs.js"
|
|
10
|
-
export * from "./pware.oc.ui.glyphs.js"
|
|
11
|
-
export * from "./pware.oc.ui.live.js"
|
|
12
|
-
export * from "./pware.oc.ui.host.js"
|
|
1
|
+
/**
|
|
2
|
+
* pware.oc.ui
|
|
3
|
+
*
|
|
4
|
+
* TUI layer: chrome, shared sections, the sidebar panel, dialogs, glyphs.
|
|
5
|
+
*/
|
|
6
|
+
export * from "./pware.oc.ui.chrome.js"
|
|
7
|
+
export * from "./pware.oc.ui.sections.js"
|
|
8
|
+
export * from "./pware.oc.ui.sidebar.js"
|
|
9
|
+
export * from "./pware.oc.ui.menudialogs.js"
|
|
10
|
+
export * from "./pware.oc.ui.glyphs.js"
|
|
11
|
+
export * from "./pware.oc.ui.live.js"
|
|
12
|
+
export * from "./pware.oc.ui.host.js"
|