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.
Files changed (108) hide show
  1. package/.oesignore +17 -17
  2. package/CHANGELOG.md +96 -95
  3. package/LICENSE +21 -21
  4. package/README.md +150 -235
  5. package/oes.json +13 -11
  6. package/package.json +100 -100
  7. package/scripts/install-git-hooks.mjs +29 -29
  8. package/src/pware.oc.core/constants/index.ts +18 -18
  9. package/src/pware.oc.core/constants/pware.oc.core.constants.eventKind.ts +29 -29
  10. package/src/pware.oc.core/constants/pware.oc.core.constants.eventName.ts +15 -13
  11. package/src/pware.oc.core/constants/pware.oc.core.constants.eventType.ts +241 -241
  12. package/src/pware.oc.core/constants/pware.oc.core.constants.myWork.ts +55 -55
  13. package/src/pware.oc.core/constants/pware.oc.core.constants.partType.ts +65 -65
  14. package/src/pware.oc.core/constants/pware.oc.core.constants.phase.ts +58 -58
  15. package/src/pware.oc.core/constants/pware.oc.core.constants.pulse.ts +63 -63
  16. package/src/pware.oc.core/constants/pware.oc.core.constants.rowKind.ts +34 -34
  17. package/src/pware.oc.core/constants/pware.oc.core.constants.status.ts +74 -74
  18. package/src/pware.oc.core/constants/pware.oc.core.constants.toolName.ts +69 -69
  19. package/src/pware.oc.core/git/index.ts +7 -7
  20. package/src/pware.oc.core/git/pware.oc.core.git.ts +237 -237
  21. package/src/pware.oc.core/git/pware.oc.core.gitignore.ts +87 -87
  22. package/src/pware.oc.core/index.ts +19 -18
  23. package/src/pware.oc.core/pware.oc.core.bus.ts +42 -42
  24. package/src/pware.oc.core/pware.oc.core.cache.ts +48 -48
  25. package/src/pware.oc.core/pware.oc.core.clipboard.ts +97 -97
  26. package/src/pware.oc.core/pware.oc.core.debug.ts +280 -280
  27. package/src/pware.oc.core/pware.oc.core.events.ts +79 -79
  28. package/src/pware.oc.core/pware.oc.core.glyph.ts +135 -135
  29. package/src/pware.oc.core/pware.oc.core.layout.ts +234 -234
  30. package/src/pware.oc.core/pware.oc.core.oes.ts +99 -89
  31. package/src/pware.oc.core/pware.oc.core.paths.ts +240 -240
  32. package/src/pware.oc.core/pware.oc.core.preview.ts +74 -74
  33. package/src/pware.oc.core/pware.oc.core.pulse.ts +726 -726
  34. package/src/pware.oc.core/pware.oc.core.runtimeConfig.ts +41 -0
  35. package/src/pware.oc.core/pware.oc.core.sqlite.ts +164 -175
  36. package/src/pware.oc.core/pware.oc.core.sqliteGateway.ts +89 -0
  37. package/src/pware.oc.core/pware.oc.core.status.ts +214 -214
  38. package/src/pware.oc.core/pware.oc.core.timing.ts +63 -63
  39. package/src/pware.oc.core/pware.oc.core.width.ts +215 -215
  40. package/src/pware.oc.omo/constants/index.ts +15 -15
  41. package/src/pware.oc.omo/constants/pware.oc.omo.constants.backgroundTask.ts +18 -18
  42. package/src/pware.oc.omo/constants/pware.oc.omo.constants.boulderStatus.ts +49 -49
  43. package/src/pware.oc.omo/constants/pware.oc.omo.constants.docKind.ts +29 -29
  44. package/src/pware.oc.omo/constants/pware.oc.omo.constants.eventName.ts +11 -11
  45. package/src/pware.oc.omo/constants/pware.oc.omo.constants.planStatus.ts +60 -60
  46. package/src/pware.oc.omo/constants/pware.oc.omo.constants.reviewStatus.ts +49 -49
  47. package/src/pware.oc.omo/constants/pware.oc.omo.constants.startWork.ts +25 -25
  48. package/src/pware.oc.omo/constants/pware.oc.omo.constants.verdict.ts +38 -38
  49. package/src/pware.oc.omo/index.ts +7 -7
  50. package/src/pware.oc.omo/resolver/index.ts +19 -19
  51. package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.approval.ts +179 -179
  52. package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.approvalGroup.ts +116 -116
  53. package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.approvalState.ts +34 -34
  54. package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.boulder.ts +503 -503
  55. package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.config.ts +40 -40
  56. package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.doc.ts +269 -269
  57. package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.draftFile.ts +18 -18
  58. package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.notepadsFile.ts +18 -18
  59. package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.plan.ts +155 -155
  60. package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.planFile.ts +363 -361
  61. package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.proofFile.ts +18 -18
  62. package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.rulesFile.ts +11 -11
  63. package/src/pware.oc.omo/resolver/pware.oc.omo.resolver.runContinuationFile.ts +14 -14
  64. package/src/pware.oc.opencode/constants/index.ts +10 -10
  65. package/src/pware.oc.opencode/constants/pware.oc.opencode.constants.eventName.ts +15 -15
  66. package/src/pware.oc.opencode/constants/pware.oc.opencode.constants.fileTouch.ts +18 -18
  67. package/src/pware.oc.opencode/constants/pware.oc.opencode.constants.questionKind.ts +45 -45
  68. package/src/pware.oc.opencode/constants/pware.oc.opencode.constants.sessionStatus.ts +58 -58
  69. package/src/pware.oc.opencode/index.ts +8 -8
  70. package/src/pware.oc.opencode/pware.oc.opencode.events.ts +182 -182
  71. package/src/pware.oc.opencode/pware.oc.opencode.files.ts +399 -399
  72. package/src/pware.oc.opencode/resolver/index.ts +223 -170
  73. package/src/pware.oc.opencode/resolver/pware.oc.opencode.resolver.file.ts +150 -162
  74. package/src/pware.oc.opencode/resolver/pware.oc.opencode.resolver.question.ts +149 -185
  75. package/src/pware.oc.opencode/resolver/pware.oc.opencode.resolver.session.ts +248 -211
  76. package/src/pware.oc.opencode/resolver/pware.oc.opencode.resolver.todo.ts +22 -26
  77. package/src/pware.oc.opencode/resolver/pware.oc.opencode.resolver.tool.ts +224 -236
  78. package/src/pware.oc.perf/index.ts +14 -14
  79. package/src/pware.oc.perf/pware.oc.perf.asciichart.d.ts +15 -15
  80. package/src/pware.oc.perf/pware.oc.perf.charts.ts +284 -284
  81. package/src/pware.oc.perf/pware.oc.perf.reader.ts +962 -927
  82. package/src/pware.oc.perf/pware.oc.perf.realtime.ts +88 -88
  83. package/src/pware.oc.perf/pware.oc.perf.realtimeBlock.ts +118 -118
  84. package/src/pware.oc.perf/pware.oc.perf.realtimeCpuRam.ts +79 -79
  85. package/src/pware.oc.perf/pware.oc.perf.realtimeSampler.ts +71 -71
  86. package/src/pware.oc.perf/pware.oc.perf.realtimeTimeline.ts +214 -214
  87. package/src/pware.oc.perf/pware.oc.perf.self.ts +179 -179
  88. package/src/pware.oc.perf/pware.oc.perf.view.tsx +463 -462
  89. package/src/pware.oc.runtime/index.ts +13 -13
  90. package/src/pware.oc.runtime/pware.oc.runtime.monitor.ts +142 -142
  91. package/src/pware.oc.runtime/pware.oc.runtime.mywork-enrich.ts +87 -79
  92. package/src/pware.oc.runtime/pware.oc.runtime.mywork.ts +282 -253
  93. package/src/pware.oc.runtime/pware.oc.runtime.omoRead.ts +37 -0
  94. package/src/pware.oc.runtime/pware.oc.runtime.questions.ts +83 -95
  95. package/src/pware.oc.runtime/pware.oc.runtime.snapshotClient.ts +130 -129
  96. package/src/pware.oc.runtime/pware.oc.runtime.source.ts +105 -105
  97. package/src/pware.oc.runtime/pware.oc.runtime.worker.ts +44 -43
  98. package/src/pware.oc.runtime/resolver/index.ts +268 -224
  99. package/src/pware.oc.runtime/resolver/pware.oc.runtime.resolver.delegate.ts +146 -146
  100. package/src/pware.oc.ui/index.ts +12 -12
  101. package/src/pware.oc.ui/pware.oc.ui.chrome.tsx +381 -339
  102. package/src/pware.oc.ui/pware.oc.ui.glyphs.tsx +144 -144
  103. package/src/pware.oc.ui/pware.oc.ui.host.tsx +111 -111
  104. package/src/pware.oc.ui/pware.oc.ui.live.tsx +82 -82
  105. package/src/pware.oc.ui/pware.oc.ui.menudialogs.tsx +843 -843
  106. package/src/pware.oc.ui/pware.oc.ui.sections.tsx +552 -526
  107. package/src/pware.oc.ui/pware.oc.ui.sidebar.tsx +1718 -1629
  108. 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
+ }
@@ -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"