@kud/gh-cockpit 0.10.4 → 0.11.0

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.
@@ -1,14 +1,14 @@
1
- import { useWindowSize, Box, Text, useInput } from 'ink';
2
- import { Panel, colors, FooterHints, useListCursor } from '@kud/ink-ui';
3
- import { jsx, jsxs } from 'react/jsx-runtime';
4
- import { inboxConfig, clipboard, buildCheckoutCmd, runHere, openInTab, runInPane, runInPaneHorizontal } from '@kud/gh-ink';
5
- export { ActionMenu, App, COLS, CiStatusLine, CommentsPanel, HealthPanel, MIN_SIDEBAR_COLS, NEEDS_YOU_SECTION, PIN_MARK, PrRow, SIDEBAR_COLS, SidePanel, StatusStripLine, ageLabel, bandOf, budgetNotice, buildActions, buildCheckoutCmd, checkoutDirs, clipboard, configureInbox, counts, drillCmd, explainGhAction, explainItem, filterByOrigin, filterByRepos, filterBySearch, fitCount, gapsAbove, healthColor, healthDisplay, healthGlyph, healthLegend, impliedLabels, inboxConfig, insertRepoHeaders, itermRun, jumpToRepo, jumpToRepoPane, labelPriority, layoutGHItems, matchesFilter, maxViewStart, moveCursor, numberColumnsOf, openInTab, parsePatterns, profileOf, railCapacity, railHeights, railRowsOf, railWidth, railsOf, readCache, relativeTime, renderMarkdown, repoPriority, reposInSections, resetInboxConfig, resolveRepoPath, runHere, runInPane, runInPaneHorizontal, sameCiStatusState, sectionShedOf, signatureOf, sortByRecency, sortItems, stripGlyph, stripLayout, stripSignature, toCiStatusState, trailingColumnsOf, truncate, useActionMenu, whoseMove, windowCount, withHeaders, withoutItem, workCount, writeCache } from '@kud/gh-ink';
1
+ import { inboxConfig, useChrome, clipboard, buildCheckoutCmd, runHere, openInTab, runInPane, runInPaneHorizontal } from '@kud/gh-ink';
2
+ export { ActionMenu, App, COLS, CiStatusLine, CommentsPanel, HealthPanel, MIN_SIDEBAR_COLS, NEEDS_YOU_SECTION, PIN_MARK, PrRow, SIDEBAR_COLS, SidePanel, StatusStripLine, ageLabel, bandOf, budgetNotice, buildActions, buildCheckoutCmd, checkoutDirs, clipboard, configureInbox, counts, drillCmd, explainGhAction, explainItem, filterByOrigin, filterByRepos, filterBySearch, fitCount, gapsAbove, healthColor, healthDisplay, healthGlyph, healthLegend, impliedLabels, inboxConfig, insertRepoHeaders, isMenuGap, itermRun, jumpToRepo, jumpToRepoPane, labelPriority, layoutGHItems, matchesFilter, maxViewStart, menuRowsOf, menuTone, moveCursor, numberColumnsOf, openInTab, parsePatterns, profileOf, railCapacity, railHeights, railRowsOf, railWidth, railsOf, readCache, relativeTime, renderMarkdown, repoPriority, reposInSections, resetInboxConfig, resolveRepoPath, runHere, runInPane, runInPaneHorizontal, sameCiStatusState, sectionShedOf, signatureOf, sortByRecency, sortItems, stripGlyph, stripLayout, stripSignature, toCiStatusState, trailingColumnsOf, truncate, useActionMenu, useChrome, whoseMove, windowCount, withHeaders, withoutItem, workCount, writeCache } from '@kud/gh-ink';
6
3
  export { toGHItem } from '@kud/gh-workflow';
7
4
  import { mkdirSync } from 'fs';
8
5
  import { homedir } from 'os';
9
6
  import { join } from 'path';
10
7
  import { computeHealth as computeHealth$1 } from '@kud/gh';
11
- export { buildInboxQueries, buildInboxQuery, mergeInboxData } from '@kud/gh';
8
+ export { buildInboxQueries, buildInboxQuery, fetchInbox, mergeInboxData } from '@kud/gh';
9
+ import { Box, Text, useWindowSize, useInput } from 'ink';
10
+ import { Panel, colors, FooterHints, useListCursor } from '@kud/ink-ui';
11
+ import { jsxs, jsx } from 'react/jsx-runtime';
12
12
  import { $ } from 'zx';
13
13
  import { useRef, useEffect, useState } from 'react';
14
14
 
@@ -20,25 +20,6 @@ var registerPrompts = (forms) => {
20
20
  var DEFAULT_SEED = (ctx) => ctx.kind === "pr" ? `Review the pull request at ${ctx.url}. Its branch is already checked out here.` : `Work on the issue at ${ctx.url}. Its repository is already checked out here.`;
21
21
  var seedPromptFor = (ctx) => registered.seed?.(ctx) ?? DEFAULT_SEED(ctx);
22
22
  var portablePromptFor = (ctx) => registered.portable?.(ctx) ?? ctx.url;
23
- var DrillView = ({
24
- title,
25
- subtitle,
26
- hints,
27
- children
28
- }) => {
29
- const { rows } = useWindowSize();
30
- return /* @__PURE__ */ jsx(Panel, { children: /* @__PURE__ */ jsxs(Box, { flexDirection: "column", height: rows - 2, paddingX: 1, children: [
31
- /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
32
- /* @__PURE__ */ jsx(Text, { color: colors.accent, bold: true, children: title }),
33
- subtitle ? /* @__PURE__ */ jsxs(Box, { marginTop: 1, children: [
34
- /* @__PURE__ */ jsx(Text, { bold: true, children: "Title: " }),
35
- /* @__PURE__ */ jsx(Text, { children: subtitle })
36
- ] }) : null
37
- ] }),
38
- /* @__PURE__ */ jsx(Box, { flexDirection: "column", flexGrow: 1, children }),
39
- /* @__PURE__ */ jsx(FooterHints, { hints })
40
- ] }) });
41
- };
42
23
  var withRetry = async (fn, attempts = 3, delayMs = 1e3) => {
43
24
  for (let i = 0; i < attempts; i++) {
44
25
  try {
@@ -70,6 +51,47 @@ var signalPath = () => {
70
51
  mkdirSync(dir, { recursive: true });
71
52
  return join(dir, "cockpit-dirty");
72
53
  };
54
+ var SHELL_KEYS = /* @__PURE__ */ new Set(["esc", "\u232B", "q", "?"]);
55
+ var DrillView = ({
56
+ title,
57
+ subtitle,
58
+ hints,
59
+ children
60
+ }) => {
61
+ const inShell = useChrome({
62
+ scope: title,
63
+ hints: hints.filter(([key]) => !SHELL_KEYS.has(key))
64
+ });
65
+ if (inShell) {
66
+ return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
67
+ subtitle ? /* @__PURE__ */ jsxs(Box, { marginBottom: 1, children: [
68
+ /* @__PURE__ */ jsx(Text, { bold: true, children: "Title: " }),
69
+ /* @__PURE__ */ jsx(Text, { children: subtitle })
70
+ ] }) : null,
71
+ children
72
+ ] });
73
+ }
74
+ return /* @__PURE__ */ jsx(LegacyDrillView, { title, subtitle, hints, children });
75
+ };
76
+ var LegacyDrillView = ({
77
+ title,
78
+ subtitle,
79
+ hints,
80
+ children
81
+ }) => {
82
+ const { rows } = useWindowSize();
83
+ return /* @__PURE__ */ jsx(Panel, { children: /* @__PURE__ */ jsxs(Box, { flexDirection: "column", height: rows - 2, paddingX: 1, children: [
84
+ /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
85
+ /* @__PURE__ */ jsx(Text, { color: colors.accent, bold: true, children: title }),
86
+ subtitle ? /* @__PURE__ */ jsxs(Box, { marginTop: 1, children: [
87
+ /* @__PURE__ */ jsx(Text, { bold: true, children: "Title: " }),
88
+ /* @__PURE__ */ jsx(Text, { children: subtitle })
89
+ ] }) : null
90
+ ] }),
91
+ /* @__PURE__ */ jsx(Box, { flexDirection: "column", flexGrow: 1, children }),
92
+ /* @__PURE__ */ jsx(FooterHints, { hints })
93
+ ] }) });
94
+ };
73
95
  var CANDIDATES = [
74
96
  { id: "claude", label: "Claude Code", cmd: "claude", acceptsPrompt: true },
75
97
  { id: "opencode", label: "opencode", cmd: "opencode" },
@@ -1,4 +1,4 @@
1
- import { AiLauncher, seedPromptFor, CopyPromptNotice } from '../chunk-B3FS2IVR.js';
1
+ import { AiLauncher, seedPromptFor, CopyPromptNotice } from '../chunk-CSQKL753.js';
2
2
  import { useEffect } from 'react';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
@@ -34,6 +34,10 @@ var delegateExtension = {
34
34
  // action menu under `m`. Without this it would still work as a keypress and stay
35
35
  // absent from the menu, which is exactly the gap that prompted 0.5.0.
36
36
  scope: "item",
37
+ // An act on the row, grouped with Submit and Land in the menu's Act band.
38
+ // No `icon`: none of the menu's nerd-font verbs names delegating, and a
39
+ // near-miss glyph is worse than the empty column text mode already draws.
40
+ menuGroup: "act",
37
41
  body: (onExit, target) => /* @__PURE__ */ jsx(
38
42
  DelegateScreen,
39
43
  {
@@ -63,6 +67,8 @@ var copyPromptExtension = {
63
67
  key: "y",
64
68
  hint: "copy prompt",
65
69
  scope: "item",
70
+ // No `menuGroup`: unmarked item extensions land with the quiet verbs at the
71
+ // menu's end. The menu capitalises the hint for the row's label.
66
72
  body: (onExit, target) => /* @__PURE__ */ jsx(CopyPromptScreen, { item: target?.item, onExit })
67
73
  };
68
74
 
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { RepoFilter, InboxExtension, GHItem, NeedsYou, DetailContext } from '@kud/gh-ink';
3
3
  export * from '@kud/gh-ink';
4
- export { ActionMenu, App, COLS, CiStatusLine, CommentsPanel, HealthPanel, MIN_SIDEBAR_COLS, NEEDS_YOU_SECTION, PIN_MARK, PrRow, SIDEBAR_COLS, SidePanel, StatusStripLine, ageLabel, bandOf, budgetNotice, buildActions, buildCheckoutCmd, checkoutDirs, clipboard, configureInbox, counts, drillCmd, explainGhAction, explainItem, filterByOrigin, filterByRepos, filterBySearch, fitCount, gapsAbove, healthColor, healthDisplay, healthGlyph, healthLegend, impliedLabels, inboxConfig, insertRepoHeaders, itermRun, jumpToRepo, jumpToRepoPane, labelPriority, layoutGHItems, matchesFilter, maxViewStart, moveCursor, numberColumnsOf, openInTab, parsePatterns, profileOf, railCapacity, railHeights, railRowsOf, railWidth, railsOf, readCache, relativeTime, renderMarkdown, repoPriority, reposInSections, resetInboxConfig, resolveRepoPath, runHere, runInPane, runInPaneHorizontal, sameCiStatusState, sectionShedOf, signatureOf, sortByRecency, sortItems, stripGlyph, stripLayout, stripSignature, toCiStatusState, trailingColumnsOf, truncate, useActionMenu, whoseMove, windowCount, withHeaders, withoutItem, workCount, writeCache } from '@kud/gh-ink';
4
+ export { ActionMenu, App, COLS, CiStatusLine, CommentsPanel, HealthPanel, MIN_SIDEBAR_COLS, NEEDS_YOU_SECTION, PIN_MARK, PrRow, SIDEBAR_COLS, SidePanel, StatusStripLine, ageLabel, bandOf, budgetNotice, buildActions, buildCheckoutCmd, checkoutDirs, clipboard, configureInbox, counts, drillCmd, explainGhAction, explainItem, filterByOrigin, filterByRepos, filterBySearch, fitCount, gapsAbove, healthColor, healthDisplay, healthGlyph, healthLegend, impliedLabels, inboxConfig, insertRepoHeaders, isMenuGap, itermRun, jumpToRepo, jumpToRepoPane, labelPriority, layoutGHItems, matchesFilter, maxViewStart, menuRowsOf, menuTone, moveCursor, numberColumnsOf, openInTab, parsePatterns, profileOf, railCapacity, railHeights, railRowsOf, railWidth, railsOf, readCache, relativeTime, renderMarkdown, repoPriority, reposInSections, resetInboxConfig, resolveRepoPath, runHere, runInPane, runInPaneHorizontal, sameCiStatusState, sectionShedOf, signatureOf, sortByRecency, sortItems, stripGlyph, stripLayout, stripSignature, toCiStatusState, trailingColumnsOf, truncate, useActionMenu, useChrome, whoseMove, windowCount, withHeaders, withoutItem, workCount, writeCache } from '@kud/gh-ink';
5
5
  import { Health } from '@kud/gh';
6
- export { InboxSource, buildInboxQueries, buildInboxQuery, mergeInboxData } from '@kud/gh';
6
+ export { InboxRunner, InboxSource, buildInboxQueries, buildInboxQuery, fetchInbox, mergeInboxData } from '@kud/gh';
7
7
  export { CockpitItem, toGHItem } from '@kud/gh-workflow';
8
8
 
9
9
  declare const withRetry: <T>(fn: () => Promise<T>, attempts?: number, delayMs?: number) => Promise<T>;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { useActionMenu, buildActions, AiLauncher, seedPromptFor, CopyPromptNotice, DrillView, ActionMenu, resolveRepoPath, openInTab } from './chunk-B3FS2IVR.js';
2
- export { ActionMenu, App, COLS, CiStatusLine, CommentsPanel, DrillView, HealthPanel, MIN_SIDEBAR_COLS, NEEDS_YOU_SECTION, PIN_MARK, PrRow, SIDEBAR_COLS, SidePanel, StatusStripLine, ageLabel, bandOf, budgetNotice, buildActions, buildCheckoutCmd, buildInboxQueries, buildInboxQuery, checkoutDirs, clipboard, computeHealth, configureInbox, counts, drillCmd, explainGhAction, explainItem, filterByOrigin, filterByRepos, filterBySearch, fitCount, gapsAbove, healthColor, healthDisplay, healthGlyph, healthLegend, impliedLabels, inboxConfig, insertRepoHeaders, itermRun, jumpToRepo, jumpToRepoPane, labelPriority, layoutGHItems, matchesFilter, maxViewStart, mergeInboxData, moveCursor, numberColumnsOf, openInTab, parsePatterns, profileOf, railCapacity, railHeights, railRowsOf, railWidth, railsOf, readCache, registerPrompts, relativeTime, renderMarkdown, repoPriority, reposInSections, resetInboxConfig, resolveRepoPath, runHere, runInPane, runInPaneHorizontal, sameCiStatusState, sectionShedOf, signalPath, signatureOf, sortByRecency, sortItems, stripGlyph, stripLayout, stripSignature, toCiStatusState, toGHItem, trailingColumnsOf, truncate, useActionMenu, whoseMove, windowCount, withHeaders, withRetry, withoutItem, workCount, writeCache } from './chunk-B3FS2IVR.js';
1
+ import { useActionMenu, buildActions, AiLauncher, seedPromptFor, CopyPromptNotice, DrillView, ActionMenu, resolveRepoPath, openInTab } from './chunk-CSQKL753.js';
2
+ export { ActionMenu, App, COLS, CiStatusLine, CommentsPanel, DrillView, HealthPanel, MIN_SIDEBAR_COLS, NEEDS_YOU_SECTION, PIN_MARK, PrRow, SIDEBAR_COLS, SidePanel, StatusStripLine, ageLabel, bandOf, budgetNotice, buildActions, buildCheckoutCmd, buildInboxQueries, buildInboxQuery, checkoutDirs, clipboard, computeHealth, configureInbox, counts, drillCmd, explainGhAction, explainItem, fetchInbox, filterByOrigin, filterByRepos, filterBySearch, fitCount, gapsAbove, healthColor, healthDisplay, healthGlyph, healthLegend, impliedLabels, inboxConfig, insertRepoHeaders, isMenuGap, itermRun, jumpToRepo, jumpToRepoPane, labelPriority, layoutGHItems, matchesFilter, maxViewStart, menuRowsOf, menuTone, mergeInboxData, moveCursor, numberColumnsOf, openInTab, parsePatterns, profileOf, railCapacity, railHeights, railRowsOf, railWidth, railsOf, readCache, registerPrompts, relativeTime, renderMarkdown, repoPriority, reposInSections, resetInboxConfig, resolveRepoPath, runHere, runInPane, runInPaneHorizontal, sameCiStatusState, sectionShedOf, signalPath, signatureOf, sortByRecency, sortItems, stripGlyph, stripLayout, stripSignature, toCiStatusState, toGHItem, trailingColumnsOf, truncate, useActionMenu, useChrome, whoseMove, windowCount, withHeaders, withRetry, withoutItem, workCount, writeCache } from './chunk-CSQKL753.js';
3
3
  import { parsePatterns, HealthPanel, CommentsPanel, inboxConfig } from '@kud/gh-ink';
4
4
  import { Box, Text, useStdin, useInput } from 'ink';
5
5
  import { colors, useTabs, Tabs, TextInput, useListCursor, ScrollView } from '@kud/ink-ui';
@@ -600,11 +600,15 @@ var PrView = ({
600
600
  {
601
601
  label: "Delegate to an agent",
602
602
  hint: "a",
603
+ // An act on the row, grouped with the host's other acts — the menu
604
+ // sorts by group, so appended rows still land in display order.
605
+ group: "act",
603
606
  run: () => setAi(true)
604
607
  },
605
608
  {
606
609
  label: "Copy prompt to clipboard",
607
610
  hint: "y",
611
+ group: "copy",
608
612
  run: () => setCopy(true)
609
613
  }
610
614
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/gh-cockpit",
3
- "version": "0.10.4",
3
+ "version": "0.11.0",
4
4
  "description": "A configurable GitHub cockpit for the terminal — your PRs, reviews and issues in one Ink TUI, grouped by whose move it is.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -53,11 +53,11 @@
53
53
  "react": ">=19"
54
54
  },
55
55
  "dependencies": {
56
- "@kud/gh": "0.19.0",
57
- "@kud/gh-ink": "0.66.1",
56
+ "@kud/gh": "0.20.0",
57
+ "@kud/gh-ink": "0.67.0",
58
58
  "@kud/ink-ui": "0.33.0",
59
59
  "zx": "8.8.5",
60
- "@kud/gh-workflow": "0.14.0"
60
+ "@kud/gh-workflow": "0.14.1"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/node": "22.20.1",