pantheon-opencode 1.1.1-beta.8 → 1.1.1-beta.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pantheon-opencode",
3
- "version": "1.1.1-beta.8",
3
+ "version": "1.1.1-beta.9",
4
4
  "description": "Multi-agent orchestration for OpenCode — 14 specialized agents, TDD, Themis review gates.",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -1 +1 @@
1
- {"version":3,"file":"tui.d.ts","names":[],"sources":["../src/index.tsx"],"mappings":";;cAmTM,QAAQ;EAAoB"}
1
+ {"version":3,"file":"tui.d.ts","names":[],"sources":["../src/index.tsx"],"mappings":";;cAiUM,QAAQ;EAAoB"}
@@ -464,14 +464,32 @@ function View(props) {
464
464
  })();
465
465
  }
466
466
  const tui = async (api, _options, _meta) => {
467
- let version = "5.0.0";
467
+ let version = "1.1.1-beta.6";
468
468
  try {
469
469
  const wt = api.state.path?.worktree ?? "";
470
470
  const fp = wt ? `${wt}/package.json` : "package.json";
471
471
  const result = await api.client.file.read({ query: { path: fp } });
472
472
  const match = String(result?.content ?? "").match(/"version":\s*"([^"]+)"/);
473
473
  if (match?.[1]) version = match[1];
474
- } catch {}
474
+ else throw new Error("no version in file");
475
+ } catch {
476
+ try {
477
+ const proc = api.client?.process;
478
+ if (typeof proc?.exec === "function") {
479
+ const r = await proc.exec({
480
+ command: "git",
481
+ args: [
482
+ "describe",
483
+ "--tags",
484
+ "--always"
485
+ ],
486
+ timeoutMs: 3e3
487
+ });
488
+ const tag = (r.stdout ?? r.output ?? "").trim().replace(/^v/, "").replace(/-\d+-g[0-9a-f]+$/, "");
489
+ if (tag && tag !== "5.0.0") version = tag;
490
+ }
491
+ } catch {}
492
+ }
475
493
  api.slots.register({
476
494
  order: 900,
477
495
  slots: { sidebar_content(_ctx, props) {
@@ -285,15 +285,29 @@ function View(props: { api: TuiPluginApi; sessionID: string; version: string })
285
285
  /* ─── Plugin Registration ────────────────────────────────── */
286
286
 
287
287
  const tui: TuiPlugin = async (api, _options, _meta) => {
288
- let version = '5.0.0'
288
+ /* Try multiple paths to find the real Pantheon version:
289
+ * 1. Worktree package.json (dev setup)
290
+ * 2. Git describe --tags (any git repo)
291
+ * 3. Plugin's own package.json (installed) */
292
+ let version = '1.1.1-beta.6'
289
293
  try {
290
294
  const wt = ((api.state as any).path?.worktree ?? '') as string
291
295
  const fp = wt ? `${wt}/package.json` : 'package.json'
292
296
  const result = await api.client.file.read({ query: { path: fp } })
293
297
  const content = String(result?.content ?? '')
294
298
  const match = content.match(/"version":\s*"([^"]+)"/)
295
- if (match?.[1]) version = match[1]
296
- } catch { /* use default */ }
299
+ if (match?.[1]) { version = match[1] } else { throw new Error('no version in file') }
300
+ } catch {
301
+ try {
302
+ const proc = (api as any).client?.process
303
+ if (typeof proc?.exec === 'function') {
304
+ const r = await proc.exec({ command: 'git', args: ['describe', '--tags', '--always'], timeoutMs: 3000 })
305
+ const stdout = (r.stdout ?? r.output ?? '') as string
306
+ const tag = stdout.trim().replace(/^v/, '').replace(/-\d+-g[0-9a-f]+$/, '')
307
+ if (tag && tag !== '5.0.0') version = tag
308
+ }
309
+ } catch { /* keep default */ }
310
+ }
297
311
 
298
312
  api.slots.register({
299
313
  order: 900,
@@ -285,15 +285,29 @@ function View(props: { api: TuiPluginApi; sessionID: string; version: string })
285
285
  /* ─── Plugin Registration ────────────────────────────────── */
286
286
 
287
287
  const tui: TuiPlugin = async (api, _options, _meta) => {
288
- let version = '5.0.0'
288
+ /* Try multiple paths to find the real Pantheon version:
289
+ * 1. Worktree package.json (dev setup)
290
+ * 2. Git describe --tags (any git repo)
291
+ * 3. Plugin's own package.json (installed) */
292
+ let version = '1.1.1-beta.6'
289
293
  try {
290
294
  const wt = ((api.state as any).path?.worktree ?? '') as string
291
295
  const fp = wt ? `${wt}/package.json` : 'package.json'
292
296
  const result = await api.client.file.read({ query: { path: fp } })
293
297
  const content = String(result?.content ?? '')
294
298
  const match = content.match(/"version":\s*"([^"]+)"/)
295
- if (match?.[1]) version = match[1]
296
- } catch { /* use default */ }
299
+ if (match?.[1]) { version = match[1] } else { throw new Error('no version in file') }
300
+ } catch {
301
+ try {
302
+ const proc = (api as any).client?.process
303
+ if (typeof proc?.exec === 'function') {
304
+ const r = await proc.exec({ command: 'git', args: ['describe', '--tags', '--always'], timeoutMs: 3000 })
305
+ const stdout = (r.stdout ?? r.output ?? '') as string
306
+ const tag = stdout.trim().replace(/^v/, '').replace(/-\d+-g[0-9a-f]+$/, '')
307
+ if (tag && tag !== '5.0.0') version = tag
308
+ }
309
+ } catch { /* keep default */ }
310
+ }
297
311
 
298
312
  api.slots.register({
299
313
  order: 900,