@kud/gh-cockpit 0.1.19 → 0.2.1
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/README.md +1 -0
- package/dist/{chunk-KKM7DQZT.js → chunk-E7DTQQX6.js} +9 -3
- package/dist/extensions/index.js +1 -1
- package/dist/index.d.ts +25 -1
- package/dist/index.js +3 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -164,6 +164,7 @@ A poller is wrong twice over: it spends quota on the long stretches where nothin
|
|
|
164
164
|
| `configureInbox(config)` | Host opinions: `repoPriority`, `profiles`, `checkoutDir`, `cacheNamespace`, `cacheTtlMs` |
|
|
165
165
|
| `parseArgs(argv)` | Parses `--here`, `--include`, `--exclude` and a positional filter name. You decide what they mean |
|
|
166
166
|
| `registerCheckDrills(drills)` | Where a CI check drills in; unregistered checks open in a browser |
|
|
167
|
+
| `registerPrompts(forms)` | What a delegated agent is told to do. Nothing registered means the agent starts cold, and `y` copies the row URL |
|
|
167
168
|
| `detailFor(ctx)` | The drill-in view for a row — `PrView` or `IssueView` |
|
|
168
169
|
| `PrView` · `IssueView` | The drill-in views themselves, if you want to wrap them |
|
|
169
170
|
| `withRetry(fn)` | Retries transient `50x` responses; GitHub returns them under load |
|
|
@@ -28,6 +28,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
28
28
|
return to;
|
|
29
29
|
};
|
|
30
30
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
31
|
+
|
|
32
|
+
// src/prompts.ts
|
|
33
|
+
var registered = {};
|
|
34
|
+
var registerPrompts = (forms) => {
|
|
35
|
+
registered = forms;
|
|
36
|
+
};
|
|
37
|
+
var seedPromptFor = (ctx) => registered.seed?.(ctx);
|
|
38
|
+
var portablePromptFor = (ctx) => registered.portable?.(ctx) ?? ctx.url;
|
|
31
39
|
var DrillView = ({
|
|
32
40
|
title,
|
|
33
41
|
subtitle,
|
|
@@ -185,8 +193,6 @@ var PLACEMENTS = [
|
|
|
185
193
|
];
|
|
186
194
|
var isInstalled = async (cmd) => (await $({ nothrow: true, quiet: true })`command -v ${cmd}`).exitCode === 0;
|
|
187
195
|
var shellQuote = (s) => `'${s.replace(/'/g, `'\\''`)}'`;
|
|
188
|
-
var seedPromptFor = (item) => item.kind === "pr" ? `/k-pr ${item.number}` : item.labels?.includes("plan") ? `/k-project plan ${item.number}` : `/k-project ${item.url}`;
|
|
189
|
-
var portablePromptFor = (item) => item.kind === "pr" ? `/k-pr ${item.url}` : item.labels?.includes("plan") ? `/k-project plan ${item.number} ${item.repo}` : `/k-project ${item.url}`;
|
|
190
196
|
var CopyPromptNotice = ({
|
|
191
197
|
item,
|
|
192
198
|
onBack
|
|
@@ -310,4 +316,4 @@ var AiLauncher = ({
|
|
|
310
316
|
);
|
|
311
317
|
};
|
|
312
318
|
|
|
313
|
-
export { AiLauncher, CopyPromptNotice, DrillView, __export, __reExport, computeHealth, lib_exports, seedPromptFor, signalPath, toGHItem, withRetry };
|
|
319
|
+
export { AiLauncher, CopyPromptNotice, DrillView, __export, __reExport, computeHealth, lib_exports, registerPrompts, seedPromptFor, signalPath, toGHItem, withRetry };
|
package/dist/extensions/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -96,6 +96,30 @@ declare const parseArgs: (argv: readonly string[]) => CockpitArgs;
|
|
|
96
96
|
/** Whether the flags said anything at all, which decides if they override. */
|
|
97
97
|
declare const hasPatterns: (f: RepoFilter) => boolean;
|
|
98
98
|
|
|
99
|
+
type PromptContext = {
|
|
100
|
+
kind: "pr" | "issue";
|
|
101
|
+
number: number;
|
|
102
|
+
/** `owner/name` of the repo the row belongs to. */
|
|
103
|
+
repo: string;
|
|
104
|
+
url: string;
|
|
105
|
+
labels?: string[];
|
|
106
|
+
};
|
|
107
|
+
type PromptForms = {
|
|
108
|
+
/**
|
|
109
|
+
* For an agent the cockpit launches itself. It has already `cd`'d into the
|
|
110
|
+
* checkout, so a repo-relative reference is safe here.
|
|
111
|
+
*/
|
|
112
|
+
seed?: (ctx: PromptContext) => string | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* For the clipboard, addressed to a session whose working directory we do not
|
|
115
|
+
* control. Every reference has to be repo-qualified or a URL — a bare number
|
|
116
|
+
* resolves against whatever repo the reader happens to be sitting in.
|
|
117
|
+
*/
|
|
118
|
+
portable?: (ctx: PromptContext) => string | undefined;
|
|
119
|
+
};
|
|
120
|
+
/** Supply the host's prompt forms. Call once, before rendering. */
|
|
121
|
+
declare const registerPrompts: (forms: PromptForms) => void;
|
|
122
|
+
|
|
99
123
|
declare const detailFor: (ctx: DetailContext) => React.JSX.Element;
|
|
100
124
|
|
|
101
125
|
declare const DrillView: ({ title, subtitle, hints, children, }: {
|
|
@@ -128,4 +152,4 @@ declare const IssueView: ({ item, login, onBack, }: {
|
|
|
128
152
|
onBack: () => void;
|
|
129
153
|
}) => React.JSX.Element;
|
|
130
154
|
|
|
131
|
-
export { type CheckDrill, type CheckDrillContext, type CockpitArgs, type CockpitConfig, type CockpitItem, DrillView, IssueView, PrView, type TabSearch, type TabSpec, checkDrillFor, computeHealth, defineCockpit, detailFor, hasPatterns, parseArgs, registerCheckDrills, signalPath, toGHItem, withRetry };
|
|
155
|
+
export { type CheckDrill, type CheckDrillContext, type CockpitArgs, type CockpitConfig, type CockpitItem, DrillView, IssueView, PrView, type PromptContext, type PromptForms, type TabSearch, type TabSpec, checkDrillFor, computeHealth, defineCockpit, detailFor, hasPatterns, parseArgs, registerCheckDrills, registerPrompts, signalPath, toGHItem, withRetry };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __export, withRetry, toGHItem, signalPath, mergeInboxData, computeHealth, buildInboxQuery, buildInboxQueries, DrillView, lib_exports, AiLauncher, seedPromptFor, CopyPromptNotice, __reExport } from './chunk-
|
|
2
|
-
export { DrillView, buildInboxQueries, buildInboxQuery, computeHealth, mergeInboxData, signalPath, toGHItem, withRetry } from './chunk-
|
|
1
|
+
import { __export, withRetry, toGHItem, signalPath, registerPrompts, mergeInboxData, computeHealth, buildInboxQuery, buildInboxQueries, DrillView, lib_exports, AiLauncher, seedPromptFor, CopyPromptNotice, __reExport } from './chunk-E7DTQQX6.js';
|
|
2
|
+
export { DrillView, buildInboxQueries, buildInboxQuery, computeHealth, mergeInboxData, registerPrompts, signalPath, toGHItem, withRetry } from './chunk-E7DTQQX6.js';
|
|
3
3
|
import { parsePatterns, HealthPanel, CommentsPanel, inboxConfig } from '@kud/gh-ink';
|
|
4
4
|
import { $ } from 'zx';
|
|
5
5
|
import { useState, useEffect } from 'react';
|
|
@@ -27,6 +27,7 @@ __export(index_exports, {
|
|
|
27
27
|
mergeInboxData: () => mergeInboxData,
|
|
28
28
|
parseArgs: () => parseArgs,
|
|
29
29
|
registerCheckDrills: () => registerCheckDrills,
|
|
30
|
+
registerPrompts: () => registerPrompts,
|
|
30
31
|
signalPath: () => signalPath,
|
|
31
32
|
toGHItem: () => toGHItem,
|
|
32
33
|
withRetry: () => withRetry
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kud/gh-cockpit",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
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,8 +53,8 @@
|
|
|
53
53
|
"react": ">=19"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@kud/gh": "0.
|
|
57
|
-
"@kud/gh-ink": "0.
|
|
56
|
+
"@kud/gh": "0.9.0",
|
|
57
|
+
"@kud/gh-ink": "0.32.0",
|
|
58
58
|
"@kud/ink-ui": "0.14.0",
|
|
59
59
|
"zx": "8.8.5"
|
|
60
60
|
},
|